pressbooks aldine theme the theme used for the front page or default book
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
667 KiB

/*!
infusion - v2.0.0
Thursday, December 8th, 2016, 3:42:03 PM
branch: HEAD
revision: 85a1ffe
*/
!function(global,factory){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=global.document?factory(global,!0):function(w){if(!w.document)throw new Error("jQuery requires a window with a document");return factory(w)}:factory(global)}("undefined"!=typeof window?window:this,function(window,noGlobal){"use strict";function DOMEval(code,doc){doc=doc||document;var script=doc.createElement("script");script.text=code,doc.head.appendChild(script).parentNode.removeChild(script)}function isArrayLike(obj){var length=!!obj&&"length"in obj&&obj.length,type=jQuery.type(obj);return"function"!==type&&!jQuery.isWindow(obj)&&("array"===type||0===length||"number"==typeof length&&length>0&&length-1 in obj)}function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier))return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not});if(qualifier.nodeType)return jQuery.grep(elements,function(elem){return elem===qualifier!==not});if("string"==typeof qualifier){if(risSimple.test(qualifier))return jQuery.filter(qualifier,elements,not);qualifier=jQuery.filter(qualifier,elements)}return jQuery.grep(elements,function(elem){return indexOf.call(qualifier,elem)>-1!==not&&1===elem.nodeType})}function sibling(cur,dir){for(;(cur=cur[dir])&&1!==cur.nodeType;);return cur}function createOptions(options){var object={};return jQuery.each(options.match(rnotwhite)||[],function(_,flag){object[flag]=!0}),object}function Identity(v){return v}function Thrower(ex){throw ex}function adoptValue(value,resolve,reject){var method;try{value&&jQuery.isFunction(method=value.promise)?method.call(value).done(resolve).fail(reject):value&&jQuery.isFunction(method=value.then)?method.call(value,resolve,reject):resolve.call(void 0,value)}catch(value){reject.call(void 0,value)}}function completed(){document.removeEventListener("DOMContentLoaded",completed),window.removeEventListener("load",completed),jQuery.ready()}function Data(){this.expando=jQuery.expando+Data.uid++}function dataAttr(elem,key,data){var name;if(void 0===data&&1===elem.nodeType)if(name="data-"+key.replace(rmultiDash,"-$&").toLowerCase(),data=elem.getAttribute(name),"string"==typeof data){try{data="true"===data||"false"!==data&&("null"===data?null:+data+""===data?+data:rbrace.test(data)?JSON.parse(data):data)}catch(e){}dataUser.set(elem,key,data)}else data=void 0;return data}function adjustCSS(elem,prop,valueParts,tween){var adjusted,scale=1,maxIterations=20,currentValue=tween?function(){return tween.cur()}:function(){return jQuery.css(elem,prop,"")},initial=currentValue(),unit=valueParts&&valueParts[3]||(jQuery.cssNumber[prop]?"":"px"),initialInUnit=(jQuery.cssNumber[prop]||"px"!==unit&&+initial)&&rcssNum.exec(jQuery.css(elem,prop));if(initialInUnit&&initialInUnit[3]!==unit){unit=unit||initialInUnit[3],valueParts=valueParts||[],initialInUnit=+initial||1;do scale=scale||".5",initialInUnit/=scale,jQuery.style(elem,prop,initialInUnit+unit);while(scale!==(scale=currentValue()/initial)&&1!==scale&&--maxIterations)}return valueParts&&(initialInUnit=+initialInUnit||+initial||0,adjusted=valueParts[1]?initialInUnit+(valueParts[1]+1)*valueParts[2]:+valueParts[2],tween&&(tween.unit=unit,tween.start=initialInUnit,tween.end=adjusted)),adjusted}function getDefaultDisplay(elem){var temp,doc=elem.ownerDocument,nodeName=elem.nodeName,display=defaultDisplayMap[nodeName];return display?display:(temp=doc.body.appendChild(doc.createElement(nodeName)),display=jQuery.css(temp,"display"),temp.parentNode.removeChild(temp),"none"===display&&(display="block"),defaultDisplayMap[nodeName]=display,display)}function showHide(elements,show){for(var display,elem,values=[],index=0,length=elements.length;index<length;index++)elem=elements[index],elem.style&&(display=elem.style.display,show?("none"===display&&(values[index]=dataPriv.get(elem,"display")||null,values[index]||(elem.style.display="")),""===elem.style.display&&isHiddenWithinTree(elem)&&(values[index]=getDefaultDisplay(elem))):"none"!==display&&(values[index]="none",dataPriv.set(elem,"display",display)));for(index=0;index<length;index++)null!=values[index]&&(elements[index].style.display=values[index]);return elements}function getAll(context,tag){var ret="undefined"!=typeof context.getElementsByTagName?context.getElementsByTagName(tag||"*"):"undefined"!=typeof context.querySelectorAll?context.querySelectorAll(tag||"*"):[];return void 0===tag||tag&&jQuery.nodeName(context,tag)?jQuery.merge([context],ret):ret}function setGlobalEval(elems,refElements){for(var i=0,l=elems.length;i<l;i++)dataPriv.set(elems[i],"globalEval",!refElements||dataPriv.get(refElements[i],"globalEval"))}function buildFragment(elems,context,scripts,selection,ignored){for(var elem,tmp,tag,wrap,contains,j,fragment=context.createDocumentFragment(),nodes=[],i=0,l=elems.length;i<l;i++)if(elem=elems[i],elem||0===elem)if("object"===jQuery.type(elem))jQuery.merge(nodes,elem.nodeType?[elem]:elem);else if(rhtml.test(elem)){for(tmp=tmp||fragment.appendChild(context.createElement("div")),tag=(rtagName.exec(elem)||["",""])[1].toLowerCase(),wrap=wrapMap[tag]||wrapMap._default,tmp.innerHTML=wrap[1]+jQuery.htmlPrefilter(elem)+wrap[2],j=wrap[0];j--;)tmp=tmp.lastChild;jQuery.merge(nodes,tmp.childNodes),tmp=fragment.firstChild,tmp.textContent=""}else nodes.push(context.createTextNode(elem));for(fragment.textContent="",i=0;elem=nodes[i++];)if(selection&&jQuery.inArray(elem,selection)>-1)ignored&&ignored.push(elem);else if(contains=jQuery.contains(elem.ownerDocument,elem),tmp=getAll(fragment.appendChild(elem),"script"),contains&&setGlobalEval(tmp),scripts)for(j=0;elem=tmp[j++];)rscriptType.test(elem.type||"")&&scripts.push(elem);return fragment}function returnTrue(){return!0}function returnFalse(){return!1}function safeActiveElement(){try{return document.activeElement}catch(err){}}function on(elem,types,selector,data,fn,one){var origFn,type;if("object"==typeof types){"string"!=typeof selector&&(data=data||selector,selector=void 0);for(type in types)on(elem,type,selector,data,types[type],one);return elem}if(null==data&&null==fn?(fn=selector,data=selector=void 0):null==fn&&("string"==typeof selector?(fn=data,data=void 0):(fn=data,data=selector,selector=void 0)),fn===!1)fn=returnFalse;else if(!fn)return elem;return 1===one&&(origFn=fn,fn=function(event){return jQuery().off(event),origFn.apply(this,arguments)},fn.guid=origFn.guid||(origFn.guid=jQuery.guid++)),elem.each(function(){jQuery.event.add(this,types,fn,data,selector)})}function manipulationTarget(elem,content){return jQuery.nodeName(elem,"table")&&jQuery.nodeName(11!==content.nodeType?content:content.firstChild,"tr")?elem.getElementsByTagName("tbody")[0]||elem:elem}function disableScript(elem){return elem.type=(null!==elem.getAttribute("type"))+"/"+elem.type,elem}function restoreScript(elem){var match=rscriptTypeMasked.exec(elem.type);return match?elem.type=match[1]:elem.removeAttribute("type"),elem}function cloneCopyEvent(src,dest){var i,l,type,pdataOld,pdataCur,udataOld,udataCur,events;if(1===dest.nodeType){if(dataPriv.hasData(src)&&(pdataOld=dataPriv.access(src),pdataCur=dataPriv.set(dest,pdataOld),events=pdataOld.events)){delete pdataCur.handle,pdataCur.events={};for(type in events)for(i=0,l=events[type].length;i<l;i++)jQuery.event.add(dest,type,events[type][i])}dataUser.hasData(src)&&(udataOld=dataUser.access(src),udataCur=jQuery.extend({},udataOld),dataUser.set(dest,udataCur))}}function fixInput(src,dest){var nodeName=dest.nodeName.toLowerCase();"input"===nodeName&&rcheckableType.test(src.type)?dest.checked=src.checked:"input"!==nodeName&&"textarea"!==nodeName||(dest.defaultValue=src.defaultValue)}function domManip(collection,args,callback,ignored){args=concat.apply([],args);var fragment,first,scripts,hasScripts,node,doc,i=0,l=collection.length,iNoClone=l-1,value=args[0],isFunction=jQuery.isFunction(value);if(isFunction||l>1&&"string"==typeof value&&!support.checkClone&&rchecked.test(value))return collection.each(function(index){var self=collection.eq(index);isFunction&&(args[0]=value.call(this,index,self.html())),domManip(self,args,callback,ignored)});if(l&&(fragment=buildFragment(args,collection[0].ownerDocument,!1,collection,ignored),first=fragment.firstChild,1===fragment.childNodes.length&&(fragment=first),first||ignored)){for(scripts=jQuery.map(getAll(fragment,"script"),disableScript),hasScripts=scripts.length;i<l;i++)node=fragment,i!==iNoClone&&(node=jQuery.clone(node,!0,!0),hasScripts&&jQuery.merge(scripts,getAll(node,"script"))),callback.call(collection[i],node,i);if(hasScripts)for(doc=scripts[scripts.length-1].ownerDocument,jQuery.map(scripts,restoreScript),i=0;i<hasScripts;i++)node=scripts[i],rscriptType.test(node.type||"")&&!dataPriv.access(node,"globalEval")&&jQuery.contains(doc,node)&&(node.src?jQuery._evalUrl&&jQuery._evalUrl(node.src):DOMEval(node.textContent.replace(rcleanScript,""),doc))}return collection}function remove(elem,selector,keepData){for(var node,nodes=selector?jQuery.filter(selector,elem):elem,i=0;null!=(node=nodes[i]);i++)keepData||1!==node.nodeType||jQuery.cleanData(getAll(node)),node.parentNode&&(keepData&&jQuery.contains(node.ownerDocument,node)&&setGlobalEval(getAll(node,"script")),node.parentNode.removeChild(node));return elem}function curCSS(elem,name,computed){var width,minWidth,maxWidth,ret,style=elem.style;return computed=computed||getStyles(elem),computed&&(ret=computed.getPropertyValue(name)||computed[name],""!==ret||jQuery.contains(elem.ownerDocument,elem)||(ret=jQuery.style(elem,name)),!support.pixelMarginRight()&&rnumnonpx.test(ret)&&rmargin.test(name)&&(width=style.width,minWidth=style.minWidth,maxWidth=style.maxWidth,style.minWidth=style.maxWidth=style.width=ret,ret=computed.width,style.width=width,style.minWidth=minWidth,style.maxWidth=maxWidth)),void 0!==ret?ret+"":ret}function addGetHookIf(conditionFn,hookFn){return{get:function(){return conditionFn()?void delete this.get:(this.get=hookFn).apply(this,arguments)}}}function vendorPropName(name){if(name in emptyStyle)return name;for(var capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;i--;)if(name=cssPrefixes[i]+capName,name in emptyStyle)return name}function setPositiveNumber(elem,value,subtract){var matches=rcssNum.exec(value);return matches?Math.max(0,matches[2]-(subtract||0))+(matches[3]||"px"):value}function augmentWidthOrHeight(elem,name,extra,isBorderBox,styles){for(var i=extra===(isBorderBox?"border":"content")?4:"width"===name?1:0,val=0;i<4;i+=2)"margin"===extra&&(val+=jQuery.css(elem,extra+cssExpand[i],!0,styles)),isBorderBox?("content"===extra&&(val-=jQuery.css(elem,"padding"+cssExpand[i],!0,styles)),"margin"!==extra&&(val-=jQuery.css(elem,"border"+cssExpand[i]+"Width",!0,styles))):(val+=jQuery.css(elem,"padding"+cssExpand[i],!0,styles),"padding"!==extra&&(val+=jQuery.css(elem,"border"+cssExpand[i]+"Width",!0,styles)));return val}function getWidthOrHeight(elem,name,extra){var val,valueIsBorderBox=!0,styles=getStyles(elem),isBorderBox="border-box"===jQuery.css(elem,"boxSizing",!1,styles);if(elem.getClientRects().length&&(val=elem.getBoundingClientRect()[name]),val<=0||null==val){if(val=curCSS(elem,name,styles),(val<0||null==val)&&(val=elem.style[name]),rnumnonpx.test(val))return val;valueIsBorderBox=isBorderBox&&(support.boxSizingReliable()||val===elem.style[name]),val=parseFloat(val)||0}return val+augmentWidthOrHeight(elem,name,extra||(isBorderBox?"border":"content"),valueIsBorderBox,styles)+"px"}function Tween(elem,options,prop,end,easing){return new Tween.prototype.init(elem,options,prop,end,easing)}function raf(){timerId&&(window.requestAnimationFrame(raf),jQuery.fx.tick())}function createFxNow(){return window.setTimeout(function(){fxNow=void 0}),fxNow=jQuery.now()}function genFx(type,includeWidth){var which,i=0,attrs={height:type};for(includeWidth=includeWidth?1:0;i<4;i+=2-includeWidth)which=cssExpand[i],attrs["margin"+which]=attrs["padding"+which]=type;return includeWidth&&(attrs.opacity=attrs.width=type),attrs}function createTween(value,prop,animation){for(var tween,collection=(Animation.tweeners[prop]||[]).concat(Animation.tweeners["*"]),index=0,length=collection.length;index<length;index++)if(tween=collection[index].call(animation,prop,value))return tween}function defaultPrefilter(elem,props,opts){var prop,value,toggle,hooks,oldfire,propTween,restoreDisplay,display,isBox="width"in props||"height"in props,anim=this,orig={},style=elem.style,hidden=elem.nodeType&&isHiddenWithinTree(elem),dataShow=dataPriv.get(elem,"fxshow");opts.queue||(hooks=jQuery._queueHooks(elem,"fx"),null==hooks.unqueued&&(hooks.unqueued=0,oldfire=hooks.empty.fire,hooks.empty.fire=function(){hooks.unqueued||oldfire()}),hooks.unqueued++,anim.always(function(){anim.always(function(){hooks.unqueued--,jQuery.queue(elem,"fx").length||hooks.empty.fire()})}));for(prop in props)if(value=props[prop],rfxtypes.test(value)){if(delete props[prop],toggle=toggle||"toggle"===value,value===(hidden?"hide":"show")){if("show"!==value||!dataShow||void 0===dataShow[prop])continue;hidden=!0}orig[prop]=dataShow&&dataShow[prop]||jQuery.style(elem,prop)}if(propTween=!jQuery.isEmptyObject(props),propTween||!jQuery.isEmptyObject(orig)){isBox&&1===elem.nodeType&&(opts.overflow=[style.overflow,style.overflowX,style.overflowY],restoreDisplay=dataShow&&dataShow.display,null==restoreDisplay&&(restoreDisplay=dataPriv.get(elem,"display")),display=jQuery.css(elem,"display"),"none"===display&&(restoreDisplay?display=restoreDisplay:(showHide([elem],!0),restoreDisplay=elem.style.display||restoreDisplay,display=jQuery.css(elem,"display"),showHide([elem]))),("inline"===display||"inline-block"===display&&null!=restoreDisplay)&&"none"===jQuery.css(elem,"float")&&(propTween||(anim.done(function(){style.display=restoreDisplay}),null==restoreDisplay&&(display=style.display,restoreDisplay="none"===display?"":display)),style.display="inline-block")),opts.overflow&&(style.overflow="hidden",anim.always(function(){style.overflow=opts.overflow[0],style.overflowX=opts.overflow[1],style.overflowY=opts.overflow[2]})),propTween=!1;for(prop in orig)propTween||(dataShow?"hidden"in dataShow&&(hidden=dataShow.hidden):dataShow=dataPriv.access(elem,"fxshow",{display:restoreDisplay}),toggle&&(dataShow.hidden=!hidden),hidden&&showHide([elem],!0),anim.done(function(){hidden||showHide([elem]),dataPriv.remove(elem,"fxshow");for(prop in orig)jQuery.style(elem,prop,orig[prop])})),propTween=createTween(hidden?dataShow[prop]:0,prop,anim),prop in dataShow||(dataShow[prop]=propTween.start,hidden&&(propTween.end=propTween.start,propTween.start=0))}}function propFilter(props,specialEasing){var index,name,easing,value,hooks;for(index in props)if(name=jQuery.camelCase(index),easing=specialEasing[name],value=props[index],jQuery.isArray(value)&&(easing=value[1],value=props[index]=value[0]),index!==name&&(props[name]=value,delete props[index]),hooks=jQuery.cssHooks[name],hooks&&"expand"in hooks){value=hooks.expand(value),delete props[name];for(index in value)index in props||(props[index]=value[index],specialEasing[index]=easing)}else specialEasing[name]=easing}function Animation(elem,properties,options){var result,stopped,index=0,length=Animation.prefilters.length,deferred=jQuery.Deferred().always(function(){delete tick.elem}),tick=function(){if(stopped)return!1;for(var currentTime=fxNow||createFxNow(),remaining=Math.max(0,animation.startTime+animation.duration-currentTime),temp=remaining/animation.duration||0,percent=1-temp,index=0,length=animation.tweens.length;index<length;index++)animation.tweens[index].run(percent);return deferred.notifyWith(elem,[animation,percent,remaining]),percent<1&&length?remaining:(deferred.resolveWith(elem,[animation]),!1)},animation=deferred.promise({elem:elem,props:jQuery.extend({},properties),opts:jQuery.extend(!0,{specialEasing:{},easing:jQuery.easing._default},options),originalProperties:properties,originalOptions:options,startTime:fxNow||createFxNow(),duration:options.duration,tweens:[],createTween:function(prop,end){var tween=jQuery.Tween(elem,animation.opts,prop,end,animation.opts.specialEasing[prop]||animation.opts.easing);return animation.tweens.push(tween),tween},stop:function(gotoEnd){var index=0,length=gotoEnd?animation.tweens.length:0;if(stopped)return this;for(stopped=!0;index<length;index++)animation.tweens[index].run(1);return gotoEnd?(deferred.notifyWith(elem,[animation,1,0]),deferred.resolveWith(elem,[animation,gotoEnd])):deferred.rejectWith(elem,[animation,gotoEnd]),this}}),props=animation.props;for(propFilter(props,animation.opts.specialEasing);index<length;index++)if(result=Animation.prefilters[index].call(animation,elem,props,animation.opts))return jQuery.isFunction(result.stop)&&(jQuery._queueHooks(animation.elem,animation.opts.queue).stop=jQuery.proxy(result.stop,result)),result;return jQuery.map(props,createTween,animation),jQuery.isFunction(animation.opts.start)&&animation.opts.start.call(elem,animation),jQuery.fx.timer(jQuery.extend(tick,{elem:elem,anim:animation,queue:animation.opts.queue})),animation.progress(animation.opts.progress).done(animation.opts.done,animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always)}function getClass(elem){return elem.getAttribute&&elem.getAttribute("class")||""}function buildParams(prefix,obj,traditional,add){var name;if(jQuery.isArray(obj))jQuery.each(obj,function(i,v){traditional||rbracket.test(prefix)?add(prefix,v):buildParams(prefix+"["+("object"==typeof v&&null!=v?i:"")+"]",v,traditional,add)});else if(traditional||"object"!==jQuery.type(obj))add(prefix,obj);else for(name in obj)buildParams(prefix+"["+name+"]",obj[name],traditional,add)}function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){"string"!=typeof dataTypeExpression&&(func=dataTypeExpression,dataTypeExpression="*");var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnotwhite)||[];if(jQuery.isFunction(func))for(;dataType=dataTypes[i++];)"+"===dataType[0]?(dataType=dataType.slice(1)||"*",(structure[dataType]=structure[dataType]||[]).unshift(func)):(structure[dataType]=structure[dataType]||[]).push(func)}}function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){function inspect(dataType){var selected;return inspected[dataType]=!0,jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);return"string"!=typeof dataTypeOrTransport||seekingTransport||inspected[dataTypeOrTransport]?seekingTransport?!(selected=dataTypeOrTransport):void 0:(options.dataTypes.unshift(dataTypeOrTransport),inspect(dataTypeOrTransport),!1)}),selected}var inspected={},seekingTransport=structure===transports;return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*")}function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src)void 0!==src[key]&&((flatOptions[key]?target:deep||(deep={}))[key]=src[key]);return deep&&jQuery.extend(!0,target,deep),target}function ajaxHandleResponses(s,jqXHR,responses){for(var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;"*"===dataTypes[0];)dataTypes.shift(),void 0===ct&&(ct=s.mimeType||jqXHR.getResponseHeader("Content-Type"));if(ct)for(type in contents)if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break}if(dataTypes[0]in responses)finalDataType=dataTypes[0];else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break}firstDataType||(firstDataType=type)}finalDataType=finalDataType||firstDataType}if(finalDataType)return finalDataType!==dataTypes[0]&&dataTypes.unshift(finalDataType),responses[finalDataType]}function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},dataTypes=s.dataTypes.slice();if(dataTypes[1])for(conv in s.converters)converters[conv.toLowerCase()]=s.converters[conv];for(current=dataTypes.shift();current;)if(s.responseFields[current]&&(jqXHR[s.responseFields[current]]=response),!prev&&isSuccess&&s.dataFilter&&(response=s.dataFilter(response,s.dataType)),prev=current,current=dataTypes.shift())if("*"===current)current=prev;else if("*"!==prev&&prev!==current){if(conv=converters[prev+" "+current]||converters["* "+current],!conv)for(conv2 in converters)if(tmp=conv2.split(" "),tmp[1]===current&&(conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]])){conv===!0?conv=converters[conv2]:converters[conv2]!==!0&&(current=tmp[0],dataTypes.unshift(tmp[1]));break}if(conv!==!0)if(conv&&s["throws"])response=conv(response);else try{response=conv(response)}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current}}}return{state:"success",data:response}}function getWindow(elem){return jQuery.isWindow(elem)?elem:9===elem.nodeType&&elem.defaultView}var arr=[],document=window.document,getProto=Object.getPrototypeOf,slice=arr.slice,concat=arr.concat,push=arr.push,indexOf=arr.indexOf,class2type={},toString=class2type.toString,hasOwn=class2type.hasOwnProperty,fnToString=hasOwn.toString,ObjectFunctionString=fnToString.call(Object),support={},version="3.1.0",jQuery=function(selector,context){return new jQuery.fn.init(selector,context)},rtrim=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,rmsPrefix=/^-ms-/,rdashAlpha=/-([a-z])/g,fcamelCase=function(all,letter){return letter.toUpperCase()};jQuery.fn=jQuery.prototype={jquery:version,constructor:jQuery,length:0,toArray:function(){return slice.call(this)},get:function(num){return null!=num?num<0?this[num+this.length]:this[num]:slice.call(this)},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);return ret.prevObject=this,ret},each:function(callback){return jQuery.each(this,callback)},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},slice:function(){return this.pushStack(slice.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(j>=0&&j<len?[this[j]]:[])},end:function(){return this.prevObject||this.constructor()},push:push,sort:arr.sort,splice:arr.splice},jQuery.extend=jQuery.fn.extend=function(){var options,name,src,copy,copyIsArray,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=!1;for("boolean"==typeof target&&(deep=target,target=arguments[i]||{},i++),"object"==typeof target||jQuery.isFunction(target)||(target={}),i===length&&(target=this,i--);i<length;i++)if(null!=(options=arguments[i]))for(name in options)src=target[name],copy=options[name],target!==copy&&(deep&&copy&&(jQuery.isPlainObject(copy)||(copyIsArray=jQuery.isArray(copy)))?(copyIsArray?(copyIsArray=!1,clone=src&&jQuery.isArray(src)?src:[]):clone=src&&jQuery.isPlainObject(src)?src:{},target[name]=jQuery.extend(deep,clone,copy)):void 0!==copy&&(target[name]=copy));return target},jQuery.extend({expando:"jQuery"+(version+Math.random()).replace(/\D/g,""),isReady:!0,error:function(msg){throw new Error(msg)},noop:function(){},isFunction:function(obj){return"function"===jQuery.type(obj)},isArray:Array.isArray,isWindow:function(obj){return null!=obj&&obj===obj.window},isNumeric:function(obj){var type=jQuery.type(obj);return("number"===type||"string"===type)&&!isNaN(obj-parseFloat(obj))},isPlainObject:function(obj){var proto,Ctor;return!(!obj||"[object Object]"!==toString.call(obj))&&(!(proto=getProto(obj))||(Ctor=hasOwn.call(proto,"constructor")&&proto.constructor,"function"==typeof Ctor&&fnToString.call(Ctor)===ObjectFunctionString))},isEmptyObject:function(obj){var name;for(name in obj)return!1;return!0},type:function(obj){return null==obj?obj+"":"object"==typeof obj||"function"==typeof obj?class2type[toString.call(obj)]||"object":typeof obj},globalEval:function(code){DOMEval(code)},camelCase:function(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase)},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase()},each:function(obj,callback){var length,i=0;if(isArrayLike(obj))for(length=obj.length;i<length&&callback.call(obj[i],i,obj[i])!==!1;i++);else for(i in obj)if(callback.call(obj[i],i,obj[i])===!1)break;return obj},trim:function(text){return null==text?"":(text+"").replace(rtrim,"")},makeArray:function(arr,results){var ret=results||[];return null!=arr&&(isArrayLike(Object(arr))?jQuery.merge(ret,"string"==typeof arr?[arr]:arr):push.call(ret,arr)),ret},inArray:function(elem,arr,i){return null==arr?-1:indexOf.call(arr,elem,i)},merge:function(first,second){for(var len=+second.length,j=0,i=first.length;j<len;j++)first[i++]=second[j];return first.length=i,first},grep:function(elems,callback,invert){for(var callbackInverse,matches=[],i=0,length=elems.length,callbackExpect=!invert;i<length;i++)callbackInverse=!callback(elems[i],i),callbackInverse!==callbackExpect&&matches.push(elems[i]);return matches},map:function(elems,callback,arg){var length,value,i=0,ret=[];if(isArrayLike(elems))for(length=elems.length;i<length;i++)value=callback(elems[i],i,arg),null!=value&&ret.push(value);else for(i in elems)value=callback(elems[i],i,arg),null!=value&&ret.push(value);return concat.apply([],ret)},guid:1,proxy:function(fn,context){var tmp,args,proxy;if("string"==typeof context&&(tmp=fn[context],context=fn,fn=tmp),jQuery.isFunction(fn))return args=slice.call(arguments,2),proxy=function(){return fn.apply(context||this,args.concat(slice.call(arguments)))},proxy.guid=fn.guid=fn.guid||jQuery.guid++,proxy},now:Date.now,support:support}),"function"==typeof Symbol&&(jQuery.fn[Symbol.iterator]=arr[Symbol.iterator]),jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(i,name){class2type["[object "+name+"]"]=name.toLowerCase()});var Sizzle=function(window){function Sizzle(selector,context,results,seed){var m,i,elem,nid,match,groups,newSelector,newContext=context&&context.ownerDocument,nodeType=context?context.nodeType:9;if(results=results||[],"string"!=typeof selector||!selector||1!==nodeType&&9!==nodeType&&11!==nodeType)return results;if(!seed&&((context?context.ownerDocument||context:preferredDoc)!==document&&setDocument(context),context=context||document,documentIsHTML)){if(11!==nodeType&&(match=rquickExpr.exec(selector)))if(m=match[1]){if(9===nodeType){if(!(elem=context.getElementById(m)))return results;if(elem.id===m)return results.push(elem),results}else if(newContext&&(elem=newContext.getElementById(m))&&contains(context,elem)&&elem.id===m)return results.push(elem),results}else{if(match[2])return push.apply(results,context.getElementsByTagName(selector)),results;if((m=match[3])&&support.getElementsByClassName&&context.getElementsByClassName)return push.apply(results,context.getElementsByClassName(m)),results}if(support.qsa&&!compilerCache[selector+" "]&&(!rbuggyQSA||!rbuggyQSA.test(selector))){if(1!==nodeType)newContext=context,newSelector=selector;else if("object"!==context.nodeName.toLowerCase()){for((nid=context.getAttribute("id"))?nid=nid.replace(rcssescape,fcssescape):context.setAttribute("id",nid=expando),groups=tokenize(selector),i=groups.length;i--;)groups[i]="#"+nid+" "+toSelector(groups[i]);newSelector=groups.join(","),newContext=rsibling.test(selector)&&testContext(context.parentNode)||context}if(newSelector)try{return push.apply(results,newContext.querySelectorAll(newSelector)),results}catch(qsaError){}finally{nid===expando&&context.removeAttribute("id")}}}return select(selector.replace(rtrim,"$1"),context,results,seed)}function createCache(){function cache(key,value){return keys.push(key+" ")>Expr.cacheLength&&delete cache[keys.shift()],cache[key+" "]=value}var keys=[];return cache}function markFunction(fn){return fn[expando]=!0,fn}function assert(fn){var el=document.createElement("fieldset");try{return!!fn(el)}catch(e){return!1}finally{el.parentNode&&el.parentNode.removeChild(el),el=null}}function addHandle(attrs,handler){for(var arr=attrs.split("|"),i=arr.length;i--;)Expr.attrHandle[arr[i]]=handler}function siblingCheck(a,b){var cur=b&&a,diff=cur&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(diff)return diff;if(cur)for(;cur=cur.nextSibling;)if(cur===b)return-1;return a?1:-1}function createInputPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return"input"===name&&elem.type===type}}function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return("input"===name||"button"===name)&&elem.type===type}}function createDisabledPseudo(disabled){return function(elem){return"label"in elem&&elem.disabled===disabled||"form"in elem&&elem.disabled===disabled||"form"in elem&&elem.disabled===!1&&(elem.isDisabled===disabled||elem.isDisabled!==!disabled&&("label"in elem||!disabledAncestor(elem))!==disabled)}}function createPositionalPseudo(fn){return markFunction(function(argument){return argument=+argument,markFunction(function(seed,matches){for(var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;i--;)seed[j=matchIndexes[i]]&&(seed[j]=!(matches[j]=seed[j]))})})}function testContext(context){return context&&"undefined"!=typeof context.getElementsByTagName&&context}function setFilters(){}function toSelector(tokens){for(var i=0,len=tokens.length,selector="";i<len;i++)selector+=tokens[i].value;return selector}function addCombinator(matcher,combinator,base){var dir=combinator.dir,skip=combinator.next,key=skip||dir,checkNonElements=base&&"parentNode"===key,doneName=done++;return combinator.first?function(elem,context,xml){for(;elem=elem[dir];)if(1===elem.nodeType||checkNonElements)return matcher(elem,context,xml)}:function(elem,context,xml){var oldCache,uniqueCache,outerCache,newCache=[dirruns,doneName];if(xml){for(;elem=elem[dir];)if((1===elem.nodeType||checkNonElements)&&matcher(elem,context,xml))return!0}else for(;elem=elem[dir];)if(1===elem.nodeType||checkNonElements)if(outerCache=elem[expando]||(elem[expando]={}),uniqueCache=outerCache[elem.uniqueID]||(outerCache[elem.uniqueID]={}),skip&&skip===elem.nodeName.toLowerCase())elem=elem[dir]||elem;else{if((oldCache=uniqueCache[key])&&oldCache[0]===dirruns&&oldCache[1]===doneName)return newCache[2]=oldCache[2];if(uniqueCache[key]=newCache,newCache[2]=matcher(elem,context,xml))return!0}}}function elementMatcher(matchers){return matchers.length>1?function(elem,context,xml){for(var i=matchers.length;i--;)if(!matchers[i](elem,context,xml))return!1;return!0}:matchers[0]}function multipleContexts(selector,contexts,results){for(var i=0,len=contexts.length;i<len;i++)Sizzle(selector,contexts[i],results);return results}function condense(unmatched,map,filter,context,xml){for(var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=null!=map;i<len;i++)(elem=unmatched[i])&&(filter&&!filter(elem,context,xml)||(newUnmatched.push(elem),mapped&&map.push(i)));return newUnmatched}function setMatcher(preFilter,selector,matcher,postFilter,postFinder,postSelector){return postFilter&&!postFilter[expando]&&(postFilter=setMatcher(postFilter)),postFinder&&!postFinder[expando]&&(postFinder=setMatcher(postFinder,postSelector)),markFunction(function(seed,results,context,xml){var temp,i,elem,preMap=[],postMap=[],preexisting=results.length,elems=seed||multipleContexts(selector||"*",context.nodeType?[context]:context,[]),matcherIn=!preFilter||!seed&&selector?elems:condense(elems,preMap,preFilter,context,xml),matcherOut=matcher?postFinder||(seed?preFilter:preexisting||postFilter)?[]:results:matcherIn;if(matcher&&matcher(matcherIn,matcherOut,context,xml),postFilter)for(temp=condense(matcherOut,postMap),postFilter(temp,[],context,xml),i=temp.length;i--;)(elem=temp[i])&&(matcherOut[postMap[i]]=!(matcherIn[postMap[i]]=elem));if(seed){if(postFinder||preFilter){if(postFinder){for(temp=[],i=matcherOut.length;i--;)(elem=matcherOut[i])&&temp.push(matcherIn[i]=elem);postFinder(null,matcherOut=[],temp,xml)}for(i=matcherOut.length;i--;)(elem=matcherOut[i])&&(temp=postFinder?indexOf(seed,elem):preMap[i])>-1&&(seed[temp]=!(results[temp]=elem));
}}else matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut),postFinder?postFinder(null,results,matcherOut,xml):push.apply(results,matcherOut)})}function matcherFromTokens(tokens){for(var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext},implicitRelative,!0),matchAnyContext=addCombinator(function(elem){return indexOf(checkContext,elem)>-1},implicitRelative,!0),matchers=[function(elem,context,xml){var ret=!leadingRelative&&(xml||context!==outermostContext)||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml));return checkContext=null,ret}];i<len;i++)if(matcher=Expr.relative[tokens[i].type])matchers=[addCombinator(elementMatcher(matchers),matcher)];else{if(matcher=Expr.filter[tokens[i].type].apply(null,tokens[i].matches),matcher[expando]){for(j=++i;j<len&&!Expr.relative[tokens[j].type];j++);return setMatcher(i>1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:" "===tokens[i-2].type?"*":""})).replace(rtrim,"$1"),matcher,i<j&&matcherFromTokens(tokens.slice(i,j)),j<len&&matcherFromTokens(tokens=tokens.slice(j)),j<len&&toSelector(tokens))}matchers.push(matcher)}return elementMatcher(matchers)}function matcherFromGroupMatchers(elementMatchers,setMatchers){var bySet=setMatchers.length>0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,outermost){var elem,j,matcher,matchedCount=0,i="0",unmatched=seed&&[],setMatched=[],contextBackup=outermostContext,elems=seed||byElement&&Expr.find.TAG("*",outermost),dirrunsUnique=dirruns+=null==contextBackup?1:Math.random()||.1,len=elems.length;for(outermost&&(outermostContext=context===document||context||outermost);i!==len&&null!=(elem=elems[i]);i++){if(byElement&&elem){for(j=0,context||elem.ownerDocument===document||(setDocument(elem),xml=!documentIsHTML);matcher=elementMatchers[j++];)if(matcher(elem,context||document,xml)){results.push(elem);break}outermost&&(dirruns=dirrunsUnique)}bySet&&((elem=!matcher&&elem)&&matchedCount--,seed&&unmatched.push(elem))}if(matchedCount+=i,bySet&&i!==matchedCount){for(j=0;matcher=setMatchers[j++];)matcher(unmatched,setMatched,context,xml);if(seed){if(matchedCount>0)for(;i--;)unmatched[i]||setMatched[i]||(setMatched[i]=pop.call(results));setMatched=condense(setMatched)}push.apply(results,setMatched),outermost&&!seed&&setMatched.length>0&&matchedCount+setMatchers.length>1&&Sizzle.uniqueSort(results)}return outermost&&(dirruns=dirrunsUnique,outermostContext=contextBackup),unmatched};return bySet?markFunction(superMatcher):superMatcher}var i,support,Expr,getText,isXML,tokenize,compile,select,outermostContext,sortInput,hasDuplicate,setDocument,document,docElem,documentIsHTML,rbuggyQSA,rbuggyMatches,matches,contains,expando="sizzle"+1*new Date,preferredDoc=window.document,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),sortOrder=function(a,b){return a===b&&(hasDuplicate=!0),0},hasOwn={}.hasOwnProperty,arr=[],pop=arr.pop,push_native=arr.push,push=arr.push,slice=arr.slice,indexOf=function(list,elem){for(var i=0,len=list.length;i<len;i++)if(list[i]===elem)return i;return-1},booleans="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",whitespace="[\\x20\\t\\r\\n\\f]",identifier="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",attributes="\\["+whitespace+"*("+identifier+")(?:"+whitespace+"*([*^$|!~]?=)"+whitespace+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+identifier+"))|)"+whitespace+"*\\]",pseudos=":("+identifier+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+attributes+")*)|.*)\\)|)",rwhitespace=new RegExp(whitespace+"+","g"),rtrim=new RegExp("^"+whitespace+"+|((?:^|[^\\\\])(?:\\\\.)*)"+whitespace+"+$","g"),rcomma=new RegExp("^"+whitespace+"*,"+whitespace+"*"),rcombinators=new RegExp("^"+whitespace+"*([>+~]|"+whitespace+")"+whitespace+"*"),rattributeQuotes=new RegExp("="+whitespace+"*([^\\]'\"]*?)"+whitespace+"*\\]","g"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={ID:new RegExp("^#("+identifier+")"),CLASS:new RegExp("^\\.("+identifier+")"),TAG:new RegExp("^("+identifier+"|[*])"),ATTR:new RegExp("^"+attributes),PSEUDO:new RegExp("^"+pseudos),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),bool:new RegExp("^(?:"+booleans+")$","i"),needsContext:new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rnative=/^[^{]+\{\s*\[native \w/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rsibling=/[+~]/,runescape=new RegExp("\\\\([\\da-f]{1,6}"+whitespace+"?|("+whitespace+")|.)","ig"),funescape=function(_,escaped,escapedWhitespace){var high="0x"+escaped-65536;return high!==high||escapedWhitespace?escaped:high<0?String.fromCharCode(high+65536):String.fromCharCode(high>>10|55296,1023&high|56320)},rcssescape=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,fcssescape=function(ch,asCodePoint){return asCodePoint?"\0"===ch?"<EFBFBD>":ch.slice(0,-1)+"\\"+ch.charCodeAt(ch.length-1).toString(16)+" ":"\\"+ch},unloadHandler=function(){setDocument()},disabledAncestor=addCombinator(function(elem){return elem.disabled===!0},{dir:"parentNode",next:"legend"});try{push.apply(arr=slice.call(preferredDoc.childNodes),preferredDoc.childNodes),arr[preferredDoc.childNodes.length].nodeType}catch(e){push={apply:arr.length?function(target,els){push_native.apply(target,slice.call(els))}:function(target,els){for(var j=target.length,i=0;target[j++]=els[i++];);target.length=j-1}}}support=Sizzle.support={},isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return!!documentElement&&"HTML"!==documentElement.nodeName},setDocument=Sizzle.setDocument=function(node){var hasCompare,subWindow,doc=node?node.ownerDocument||node:preferredDoc;return doc!==document&&9===doc.nodeType&&doc.documentElement?(document=doc,docElem=document.documentElement,documentIsHTML=!isXML(document),preferredDoc!==document&&(subWindow=document.defaultView)&&subWindow.top!==subWindow&&(subWindow.addEventListener?subWindow.addEventListener("unload",unloadHandler,!1):subWindow.attachEvent&&subWindow.attachEvent("onunload",unloadHandler)),support.attributes=assert(function(el){return el.className="i",!el.getAttribute("className")}),support.getElementsByTagName=assert(function(el){return el.appendChild(document.createComment("")),!el.getElementsByTagName("*").length}),support.getElementsByClassName=rnative.test(document.getElementsByClassName),support.getById=assert(function(el){return docElem.appendChild(el).id=expando,!document.getElementsByName||!document.getElementsByName(expando).length}),support.getById?(Expr.find.ID=function(id,context){if("undefined"!=typeof context.getElementById&&documentIsHTML){var m=context.getElementById(id);return m?[m]:[]}},Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId}}):(delete Expr.find.ID,Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node="undefined"!=typeof elem.getAttributeNode&&elem.getAttributeNode("id");return node&&node.value===attrId}}),Expr.find.TAG=support.getElementsByTagName?function(tag,context){return"undefined"!=typeof context.getElementsByTagName?context.getElementsByTagName(tag):support.qsa?context.querySelectorAll(tag):void 0}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if("*"===tag){for(;elem=results[i++];)1===elem.nodeType&&tmp.push(elem);return tmp}return results},Expr.find.CLASS=support.getElementsByClassName&&function(className,context){if("undefined"!=typeof context.getElementsByClassName&&documentIsHTML)return context.getElementsByClassName(className)},rbuggyMatches=[],rbuggyQSA=[],(support.qsa=rnative.test(document.querySelectorAll))&&(assert(function(el){docElem.appendChild(el).innerHTML="<a id='"+expando+"'></a><select id='"+expando+"-\r\\' msallowcapture=''><option selected=''></option></select>",el.querySelectorAll("[msallowcapture^='']").length&&rbuggyQSA.push("[*^$]="+whitespace+"*(?:''|\"\")"),el.querySelectorAll("[selected]").length||rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")"),el.querySelectorAll("[id~="+expando+"-]").length||rbuggyQSA.push("~="),el.querySelectorAll(":checked").length||rbuggyQSA.push(":checked"),el.querySelectorAll("a#"+expando+"+*").length||rbuggyQSA.push(".#.+[+~]")}),assert(function(el){el.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var input=document.createElement("input");input.setAttribute("type","hidden"),el.appendChild(input).setAttribute("name","D"),el.querySelectorAll("[name=d]").length&&rbuggyQSA.push("name"+whitespace+"*[*^$|!~]?="),2!==el.querySelectorAll(":enabled").length&&rbuggyQSA.push(":enabled",":disabled"),docElem.appendChild(el).disabled=!0,2!==el.querySelectorAll(":disabled").length&&rbuggyQSA.push(":enabled",":disabled"),el.querySelectorAll("*,:x"),rbuggyQSA.push(",.*:")})),(support.matchesSelector=rnative.test(matches=docElem.matches||docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector))&&assert(function(el){support.disconnectedMatch=matches.call(el,"*"),matches.call(el,"[s!='']:x"),rbuggyMatches.push("!=",pseudos)}),rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|")),rbuggyMatches=rbuggyMatches.length&&new RegExp(rbuggyMatches.join("|")),hasCompare=rnative.test(docElem.compareDocumentPosition),contains=hasCompare||rnative.test(docElem.contains)?function(a,b){var adown=9===a.nodeType?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!(!bup||1!==bup.nodeType||!(adown.contains?adown.contains(bup):a.compareDocumentPosition&&16&a.compareDocumentPosition(bup)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},sortOrder=hasCompare?function(a,b){if(a===b)return hasDuplicate=!0,0;var compare=!a.compareDocumentPosition-!b.compareDocumentPosition;return compare?compare:(compare=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&compare||!support.sortDetached&&b.compareDocumentPosition(a)===compare?a===document||a.ownerDocument===preferredDoc&&contains(preferredDoc,a)?-1:b===document||b.ownerDocument===preferredDoc&&contains(preferredDoc,b)?1:sortInput?indexOf(sortInput,a)-indexOf(sortInput,b):0:4&compare?-1:1)}:function(a,b){if(a===b)return hasDuplicate=!0,0;var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(!aup||!bup)return a===document?-1:b===document?1:aup?-1:bup?1:sortInput?indexOf(sortInput,a)-indexOf(sortInput,b):0;if(aup===bup)return siblingCheck(a,b);for(cur=a;cur=cur.parentNode;)ap.unshift(cur);for(cur=b;cur=cur.parentNode;)bp.unshift(cur);for(;ap[i]===bp[i];)i++;return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0},document):document},Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements)},Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document&&setDocument(elem),expr=expr.replace(rattributeQuotes,"='$1']"),support.matchesSelector&&documentIsHTML&&!compilerCache[expr+" "]&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&(!rbuggyQSA||!rbuggyQSA.test(expr)))try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&11!==elem.document.nodeType)return ret}catch(e){}return Sizzle(expr,document,null,[elem]).length>0},Sizzle.contains=function(context,elem){return(context.ownerDocument||context)!==document&&setDocument(context),contains(context,elem)},Sizzle.attr=function(elem,name){(elem.ownerDocument||elem)!==document&&setDocument(elem);var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):void 0;return void 0!==val?val:support.attributes||!documentIsHTML?elem.getAttribute(name):(val=elem.getAttributeNode(name))&&val.specified?val.value:null},Sizzle.escape=function(sel){return(sel+"").replace(rcssescape,fcssescape)},Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg)},Sizzle.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;if(hasDuplicate=!support.detectDuplicates,sortInput=!support.sortStable&&results.slice(0),results.sort(sortOrder),hasDuplicate){for(;elem=results[i++];)elem===results[i]&&(j=duplicates.push(i));for(;j--;)results.splice(duplicates[j],1)}return sortInput=null,results},getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(nodeType){if(1===nodeType||9===nodeType||11===nodeType){if("string"==typeof elem.textContent)return elem.textContent;for(elem=elem.firstChild;elem;elem=elem.nextSibling)ret+=getText(elem)}else if(3===nodeType||4===nodeType)return elem.nodeValue}else for(;node=elem[i++];)ret+=getText(node);return ret},Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(match){return match[1]=match[1].replace(runescape,funescape),match[3]=(match[3]||match[4]||match[5]||"").replace(runescape,funescape),"~="===match[2]&&(match[3]=" "+match[3]+" "),match.slice(0,4)},CHILD:function(match){return match[1]=match[1].toLowerCase(),"nth"===match[1].slice(0,3)?(match[3]||Sizzle.error(match[0]),match[4]=+(match[4]?match[5]+(match[6]||1):2*("even"===match[3]||"odd"===match[3])),match[5]=+(match[7]+match[8]||"odd"===match[3])):match[3]&&Sizzle.error(match[0]),match},PSEUDO:function(match){var excess,unquoted=!match[6]&&match[2];return matchExpr.CHILD.test(match[0])?null:(match[3]?match[2]=match[4]||match[5]||"":unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,!0))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)&&(match[0]=match[0].slice(0,excess),match[2]=unquoted.slice(0,excess)),match.slice(0,3))}},filter:{TAG:function(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return"*"===nodeNameSelector?function(){return!0}:function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName}},CLASS:function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test("string"==typeof elem.className&&elem.className||"undefined"!=typeof elem.getAttribute&&elem.getAttribute("class")||"")})},ATTR:function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);return null==result?"!="===operator:!operator||(result+="","="===operator?result===check:"!="===operator?result!==check:"^="===operator?check&&0===result.indexOf(check):"*="===operator?check&&result.indexOf(check)>-1:"$="===operator?check&&result.slice(-check.length)===check:"~="===operator?(" "+result.replace(rwhitespace," ")+" ").indexOf(check)>-1:"|="===operator&&(result===check||result.slice(0,check.length+1)===check+"-"))}},CHILD:function(type,what,argument,first,last){var simple="nth"!==type.slice(0,3),forward="last"!==type.slice(-4),ofType="of-type"===what;return 1===first&&0===last?function(elem){return!!elem.parentNode}:function(elem,context,xml){var cache,uniqueCache,outerCache,node,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType,diff=!1;if(parent){if(simple){for(;dir;){for(node=elem;node=node[dir];)if(ofType?node.nodeName.toLowerCase()===name:1===node.nodeType)return!1;start=dir="only"===type&&!start&&"nextSibling"}return!0}if(start=[forward?parent.firstChild:parent.lastChild],forward&&useCache){for(node=parent,outerCache=node[expando]||(node[expando]={}),uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={}),cache=uniqueCache[type]||[],nodeIndex=cache[0]===dirruns&&cache[1],diff=nodeIndex&&cache[2],node=nodeIndex&&parent.childNodes[nodeIndex];node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop();)if(1===node.nodeType&&++diff&&node===elem){uniqueCache[type]=[dirruns,nodeIndex,diff];break}}else if(useCache&&(node=elem,outerCache=node[expando]||(node[expando]={}),uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={}),cache=uniqueCache[type]||[],nodeIndex=cache[0]===dirruns&&cache[1],diff=nodeIndex),diff===!1)for(;(node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())&&((ofType?node.nodeName.toLowerCase()!==name:1!==node.nodeType)||!++diff||(useCache&&(outerCache=node[expando]||(node[expando]={}),uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={}),uniqueCache[type]=[dirruns,diff]),node!==elem)););return diff-=last,diff===first||diff%first===0&&diff/first>=0}}},PSEUDO:function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);return fn[expando]?fn(argument):fn.length>1?(args=[pseudo,pseudo,"",argument],Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){for(var idx,matched=fn(seed,argument),i=matched.length;i--;)idx=indexOf(seed,matched[i]),seed[idx]=!(matches[idx]=matched[i])}):function(elem){return fn(elem,0,args)}):fn}},pseudos:{not:markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,context,xml){for(var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;i--;)(elem=unmatched[i])&&(seed[i]=!(matches[i]=elem))}):function(elem,context,xml){return input[0]=elem,matcher(input,null,xml,results),input[0]=null,!results.pop()}}),has:markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0}}),contains:markFunction(function(text){return text=text.replace(runescape,funescape),function(elem){return(elem.textContent||elem.innerText||getText(elem)).indexOf(text)>-1}}),lang:markFunction(function(lang){return ridentifier.test(lang||"")||Sizzle.error("unsupported lang: "+lang),lang=lang.replace(runescape,funescape).toLowerCase(),function(elem){var elemLang;do if(elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang"))return elemLang=elemLang.toLowerCase(),elemLang===lang||0===elemLang.indexOf(lang+"-");while((elem=elem.parentNode)&&1===elem.nodeType);return!1}}),target:function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id},root:function(elem){return elem===docElem},focus:function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex)},enabled:createDisabledPseudo(!1),disabled:createDisabledPseudo(!0),checked:function(elem){var nodeName=elem.nodeName.toLowerCase();return"input"===nodeName&&!!elem.checked||"option"===nodeName&&!!elem.selected},selected:function(elem){return elem.parentNode&&elem.parentNode.selectedIndex,elem.selected===!0},empty:function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling)if(elem.nodeType<6)return!1;return!0},parent:function(elem){return!Expr.pseudos.empty(elem)},header:function(elem){return rheader.test(elem.nodeName)},input:function(elem){return rinputs.test(elem.nodeName)},button:function(elem){var name=elem.nodeName.toLowerCase();return"input"===name&&"button"===elem.type||"button"===name},text:function(elem){var attr;return"input"===elem.nodeName.toLowerCase()&&"text"===elem.type&&(null==(attr=elem.getAttribute("type"))||"text"===attr.toLowerCase())},first:createPositionalPseudo(function(){return[0]}),last:createPositionalPseudo(function(matchIndexes,length){return[length-1]}),eq:createPositionalPseudo(function(matchIndexes,length,argument){return[argument<0?argument+length:argument]}),even:createPositionalPseudo(function(matchIndexes,length){for(var i=0;i<length;i+=2)matchIndexes.push(i);return matchIndexes}),odd:createPositionalPseudo(function(matchIndexes,length){for(var i=1;i<length;i+=2)matchIndexes.push(i);return matchIndexes}),lt:createPositionalPseudo(function(matchIndexes,length,argument){for(var i=argument<0?argument+length:argument;--i>=0;)matchIndexes.push(i);return matchIndexes}),gt:createPositionalPseudo(function(matchIndexes,length,argument){for(var i=argument<0?argument+length:argument;++i<length;)matchIndexes.push(i);return matchIndexes})}},Expr.pseudos.nth=Expr.pseudos.eq;for(i in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})Expr.pseudos[i]=createInputPseudo(i);for(i in{submit:!0,reset:!0})Expr.pseudos[i]=createButtonPseudo(i);return setFilters.prototype=Expr.filters=Expr.pseudos,Expr.setFilters=new setFilters,tokenize=Sizzle.tokenize=function(selector,parseOnly){var matched,match,tokens,type,soFar,groups,preFilters,cached=tokenCache[selector+" "];if(cached)return parseOnly?0:cached.slice(0);for(soFar=selector,groups=[],preFilters=Expr.preFilter;soFar;){matched&&!(match=rcomma.exec(soFar))||(match&&(soFar=soFar.slice(match[0].length)||soFar),groups.push(tokens=[])),matched=!1,(match=rcombinators.exec(soFar))&&(matched=match.shift(),tokens.push({value:matched,type:match[0].replace(rtrim," ")}),soFar=soFar.slice(matched.length));for(type in Expr.filter)!(match=matchExpr[type].exec(soFar))||preFilters[type]&&!(match=preFilters[type](match))||(matched=match.shift(),tokens.push({value:matched,type:type,matches:match}),soFar=soFar.slice(matched.length));if(!matched)break}return parseOnly?soFar.length:soFar?Sizzle.error(selector):tokenCache(selector,groups).slice(0)},compile=Sizzle.compile=function(selector,match){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){for(match||(match=tokenize(selector)),i=match.length;i--;)cached=matcherFromTokens(match[i]),cached[expando]?setMatchers.push(cached):elementMatchers.push(cached);cached=compilerCache(selector,matcherFromGroupMatchers(elementMatchers,setMatchers)),cached.selector=selector}return cached},select=Sizzle.select=function(selector,context,results,seed){var i,tokens,token,type,find,compiled="function"==typeof selector&&selector,match=!seed&&tokenize(selector=compiled.selector||selector);if(results=results||[],1===match.length){if(tokens=match[0]=match[0].slice(0),tokens.length>2&&"ID"===(token=tokens[0]).type&&support.getById&&9===context.nodeType&&documentIsHTML&&Expr.relative[tokens[1].type]){if(context=(Expr.find.ID(token.matches[0].replace(runescape,funescape),context)||[])[0],!context)return results;compiled&&(context=context.parentNode),selector=selector.slice(tokens.shift().value.length)}for(i=matchExpr.needsContext.test(selector)?0:tokens.length;i--&&(token=tokens[i],!Expr.relative[type=token.type]);)if((find=Expr.find[type])&&(seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&testContext(context.parentNode)||context))){if(tokens.splice(i,1),selector=seed.length&&toSelector(tokens),!selector)return push.apply(results,seed),results;break}}return(compiled||compile(selector,match))(seed,context,!documentIsHTML,results,!context||rsibling.test(selector)&&testContext(context.parentNode)||context),results},support.sortStable=expando.split("").sort(sortOrder).join("")===expando,support.detectDuplicates=!!hasDuplicate,setDocument(),support.sortDetached=assert(function(el){return 1&el.compareDocumentPosition(document.createElement("fieldset"))}),assert(function(el){return el.innerHTML="<a href='#'></a>","#"===el.firstChild.getAttribute("href")})||addHandle("type|href|height|width",function(elem,name,isXML){if(!isXML)return elem.getAttribute(name,"type"===name.toLowerCase()?1:2)}),support.attributes&&assert(function(el){return el.innerHTML="<input/>",el.firstChild.setAttribute("value",""),""===el.firstChild.getAttribute("value")})||addHandle("value",function(elem,name,isXML){if(!isXML&&"input"===elem.nodeName.toLowerCase())return elem.defaultValue}),assert(function(el){return null==el.getAttribute("disabled")})||addHandle(booleans,function(elem,name,isXML){var val;if(!isXML)return elem[name]===!0?name.toLowerCase():(val=elem.getAttributeNode(name))&&val.specified?val.value:null}),Sizzle}(window);jQuery.find=Sizzle,jQuery.expr=Sizzle.selectors,jQuery.expr[":"]=jQuery.expr.pseudos,jQuery.uniqueSort=jQuery.unique=Sizzle.uniqueSort,jQuery.text=Sizzle.getText,jQuery.isXMLDoc=Sizzle.isXML,jQuery.contains=Sizzle.contains,jQuery.escapeSelector=Sizzle.escape;var dir=function(elem,dir,until){for(var matched=[],truncate=void 0!==until;(elem=elem[dir])&&9!==elem.nodeType;)if(1===elem.nodeType){if(truncate&&jQuery(elem).is(until))break;matched.push(elem)}return matched},siblings=function(n,elem){for(var matched=[];n;n=n.nextSibling)1===n.nodeType&&n!==elem&&matched.push(n);return matched},rneedsContext=jQuery.expr.match.needsContext,rsingleTag=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,risSimple=/^.[^:#\[\.,]*$/;jQuery.filter=function(expr,elems,not){var elem=elems[0];return not&&(expr=":not("+expr+")"),1===elems.length&&1===elem.nodeType?jQuery.find.matchesSelector(elem,expr)?[elem]:[]:jQuery.find.matches(expr,jQuery.grep(elems,function(elem){return 1===elem.nodeType}))},jQuery.fn.extend({find:function(selector){var i,ret,len=this.length,self=this;if("string"!=typeof selector)return this.pushStack(jQuery(selector).filter(function(){for(i=0;i<len;i++)if(jQuery.contains(self[i],this))return!0}));for(ret=this.pushStack([]),i=0;i<len;i++)jQuery.find(selector,self[i],ret);return len>1?jQuery.uniqueSort(ret):ret},filter:function(selector){return this.pushStack(winnow(this,selector||[],!1))},not:function(selector){return this.pushStack(winnow(this,selector||[],!0))},is:function(selector){return!!winnow(this,"string"==typeof selector&&rneedsContext.test(selector)?jQuery(selector):selector||[],!1).length}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,init=jQuery.fn.init=function(selector,context,root){var match,elem;if(!selector)return this;if(root=root||rootjQuery,"string"==typeof selector){if(match="<"===selector[0]&&">"===selector[selector.length-1]&&selector.length>=3?[null,selector,null]:rquickExpr.exec(selector),!match||!match[1]&&context)return!context||context.jquery?(context||root).find(selector):this.constructor(context).find(selector);if(match[1]){if(context=context instanceof jQuery?context[0]:context,jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,!0)),rsingleTag.test(match[1])&&jQuery.isPlainObject(context))for(match in context)jQuery.isFunction(this[match])?this[match](context[match]):this.attr(match,context[match]);return this}return elem=document.getElementById(match[2]),elem&&(this[0]=elem,this.length=1),this}return selector.nodeType?(this[0]=selector,this.length=1,this):jQuery.isFunction(selector)?void 0!==root.ready?root.ready(selector):selector(jQuery):jQuery.makeArray(selector,this)};init.prototype=jQuery.fn,rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:!0,contents:!0,next:!0,prev:!0};jQuery.fn.extend({has:function(target){var targets=jQuery(target,this),l=targets.length;return this.filter(function(){for(var i=0;i<l;i++)if(jQuery.contains(this,targets[i]))return!0})},closest:function(selectors,context){var cur,i=0,l=this.length,matched=[],targets="string"!=typeof selectors&&jQuery(selectors);if(!rneedsContext.test(selectors))for(;i<l;i++)for(cur=this[i];cur&&cur!==context;cur=cur.parentNode)if(cur.nodeType<11&&(targets?targets.index(cur)>-1:1===cur.nodeType&&jQuery.find.matchesSelector(cur,selectors))){matched.push(cur);break}return this.pushStack(matched.length>1?jQuery.uniqueSort(matched):matched)},index:function(elem){return elem?"string"==typeof elem?indexOf.call(jQuery(elem),this[0]):indexOf.call(this,elem.jquery?elem[0]:elem):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(selector,context){return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(),jQuery(selector,context))))},addBack:function(selector){return this.add(null==selector?this.prevObject:this.prevObject.filter(selector))}}),jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&11!==parent.nodeType?parent:null},parents:function(elem){return dir(elem,"parentNode")},parentsUntil:function(elem,i,until){return dir(elem,"parentNode",until)},next:function(elem){return sibling(elem,"nextSibling")},prev:function(elem){return sibling(elem,"previousSibling")},nextAll:function(elem){return dir(elem,"nextSibling")},prevAll:function(elem){return dir(elem,"previousSibling")},nextUntil:function(elem,i,until){return dir(elem,"nextSibling",until)},prevUntil:function(elem,i,until){return dir(elem,"previousSibling",until)},siblings:function(elem){return siblings((elem.parentNode||{}).firstChild,elem)},children:function(elem){return siblings(elem.firstChild)},contents:function(elem){return elem.contentDocument||jQuery.merge([],elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(until,selector){var matched=jQuery.map(this,fn,until);return"Until"!==name.slice(-5)&&(selector=until),selector&&"string"==typeof selector&&(matched=jQuery.filter(selector,matched)),this.length>1&&(guaranteedUnique[name]||jQuery.uniqueSort(matched),rparentsprev.test(name)&&matched.reverse()),this.pushStack(matched)}});var rnotwhite=/\S+/g;jQuery.Callbacks=function(options){options="string"==typeof options?createOptions(options):jQuery.extend({},options);var firing,memory,fired,locked,list=[],queue=[],firingIndex=-1,fire=function(){for(locked=options.once,fired=firing=!0;queue.length;firingIndex=-1)for(memory=queue.shift();++firingIndex<list.length;)list[firingIndex].apply(memory[0],memory[1])===!1&&options.stopOnFalse&&(firingIndex=list.length,memory=!1);options.memory||(memory=!1),firing=!1,locked&&(list=memory?[]:"")},self={add:function(){return list&&(memory&&!firing&&(firingIndex=list.length-1,queue.push(memory)),function add(args){jQuery.each(args,function(_,arg){jQuery.isFunction(arg)?options.unique&&self.has(arg)||list.push(arg):arg&&arg.length&&"string"!==jQuery.type(arg)&&add(arg)})}(arguments),memory&&!firing&&fire()),this},remove:function(){return jQuery.each(arguments,function(_,arg){for(var index;(index=jQuery.inArray(arg,list,index))>-1;)list.splice(index,1),index<=firingIndex&&firingIndex--}),this},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:list.length>0},empty:function(){return list&&(list=[]),this},disable:function(){return locked=queue=[],list=memory="",this},disabled:function(){return!list},lock:function(){return locked=queue=[],memory||firing||(list=memory=""),this},locked:function(){return!!locked},fireWith:function(context,args){return locked||(args=args||[],args=[context,args.slice?args.slice():args],queue.push(args),firing||fire()),this},fire:function(){return self.fireWith(this,arguments),this},fired:function(){return!!fired}};return self},jQuery.extend({Deferred:function(func){var tuples=[["notify","progress",jQuery.Callbacks("memory"),jQuery.Callbacks("memory"),2],["resolve","done",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),0,"resolved"],["reject","fail",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),1,"rejected"]],state="pending",promise={state:function(){return state},always:function(){return deferred.done(arguments).fail(arguments),this},"catch":function(fn){return promise.then(null,fn)},pipe:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){
jQuery.each(tuples,function(i,tuple){var fn=jQuery.isFunction(fns[tuple[4]])&&fns[tuple[4]];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);returned&&jQuery.isFunction(returned.promise)?returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject):newDefer[tuple[0]+"With"](this,fn?[returned]:arguments)})}),fns=null}).promise()},then:function(onFulfilled,onRejected,onProgress){function resolve(depth,deferred,handler,special){return function(){var that=this,args=arguments,mightThrow=function(){var returned,then;if(!(depth<maxDepth)){if(returned=handler.apply(that,args),returned===deferred.promise())throw new TypeError("Thenable self-resolution");then=returned&&("object"==typeof returned||"function"==typeof returned)&&returned.then,jQuery.isFunction(then)?special?then.call(returned,resolve(maxDepth,deferred,Identity,special),resolve(maxDepth,deferred,Thrower,special)):(maxDepth++,then.call(returned,resolve(maxDepth,deferred,Identity,special),resolve(maxDepth,deferred,Thrower,special),resolve(maxDepth,deferred,Identity,deferred.notifyWith))):(handler!==Identity&&(that=void 0,args=[returned]),(special||deferred.resolveWith)(that,args))}},process=special?mightThrow:function(){try{mightThrow()}catch(e){jQuery.Deferred.exceptionHook&&jQuery.Deferred.exceptionHook(e,process.stackTrace),depth+1>=maxDepth&&(handler!==Thrower&&(that=void 0,args=[e]),deferred.rejectWith(that,args))}};depth?process():(jQuery.Deferred.getStackHook&&(process.stackTrace=jQuery.Deferred.getStackHook()),window.setTimeout(process))}}var maxDepth=0;return jQuery.Deferred(function(newDefer){tuples[0][3].add(resolve(0,newDefer,jQuery.isFunction(onProgress)?onProgress:Identity,newDefer.notifyWith)),tuples[1][3].add(resolve(0,newDefer,jQuery.isFunction(onFulfilled)?onFulfilled:Identity)),tuples[2][3].add(resolve(0,newDefer,jQuery.isFunction(onRejected)?onRejected:Thrower))}).promise()},promise:function(obj){return null!=obj?jQuery.extend(obj,promise):promise}},deferred={};return jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[5];promise[tuple[1]]=list.add,stateString&&list.add(function(){state=stateString},tuples[3-i][2].disable,tuples[0][2].lock),list.add(tuple[3].fire),deferred[tuple[0]]=function(){return deferred[tuple[0]+"With"](this===deferred?void 0:this,arguments),this},deferred[tuple[0]+"With"]=list.fireWith}),promise.promise(deferred),func&&func.call(deferred,deferred),deferred},when:function(singleValue){var remaining=arguments.length,i=remaining,resolveContexts=Array(i),resolveValues=slice.call(arguments),master=jQuery.Deferred(),updateFunc=function(i){return function(value){resolveContexts[i]=this,resolveValues[i]=arguments.length>1?slice.call(arguments):value,--remaining||master.resolveWith(resolveContexts,resolveValues)}};if(remaining<=1&&(adoptValue(singleValue,master.done(updateFunc(i)).resolve,master.reject),"pending"===master.state()||jQuery.isFunction(resolveValues[i]&&resolveValues[i].then)))return master.then();for(;i--;)adoptValue(resolveValues[i],updateFunc(i),master.reject);return master.promise()}});var rerrorNames=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;jQuery.Deferred.exceptionHook=function(error,stack){window.console&&window.console.warn&&error&&rerrorNames.test(error.name)&&window.console.warn("jQuery.Deferred exception: "+error.message,error.stack,stack)},jQuery.readyException=function(error){window.setTimeout(function(){throw error})};var readyList=jQuery.Deferred();jQuery.fn.ready=function(fn){return readyList.then(fn)["catch"](function(error){jQuery.readyException(error)}),this},jQuery.extend({isReady:!1,readyWait:1,holdReady:function(hold){hold?jQuery.readyWait++:jQuery.ready(!0)},ready:function(wait){(wait===!0?--jQuery.readyWait:jQuery.isReady)||(jQuery.isReady=!0,wait!==!0&&--jQuery.readyWait>0||readyList.resolveWith(document,[jQuery]))}}),jQuery.ready.then=readyList.then,"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?window.setTimeout(jQuery.ready):(document.addEventListener("DOMContentLoaded",completed),window.addEventListener("load",completed));var access=function(elems,fn,key,value,chainable,emptyGet,raw){var i=0,len=elems.length,bulk=null==key;if("object"===jQuery.type(key)){chainable=!0;for(i in key)access(elems,fn,i,key[i],!0,emptyGet,raw)}else if(void 0!==value&&(chainable=!0,jQuery.isFunction(value)||(raw=!0),bulk&&(raw?(fn.call(elems,value),fn=null):(bulk=fn,fn=function(elem,key,value){return bulk.call(jQuery(elem),value)})),fn))for(;i<len;i++)fn(elems[i],key,raw?value:value.call(elems[i],i,fn(elems[i],key)));return chainable?elems:bulk?fn.call(elems):len?fn(elems[0],key):emptyGet},acceptData=function(owner){return 1===owner.nodeType||9===owner.nodeType||!+owner.nodeType};Data.uid=1,Data.prototype={cache:function(owner){var value=owner[this.expando];return value||(value={},acceptData(owner)&&(owner.nodeType?owner[this.expando]=value:Object.defineProperty(owner,this.expando,{value:value,configurable:!0}))),value},set:function(owner,data,value){var prop,cache=this.cache(owner);if("string"==typeof data)cache[jQuery.camelCase(data)]=value;else for(prop in data)cache[jQuery.camelCase(prop)]=data[prop];return cache},get:function(owner,key){return void 0===key?this.cache(owner):owner[this.expando]&&owner[this.expando][jQuery.camelCase(key)]},access:function(owner,key,value){return void 0===key||key&&"string"==typeof key&&void 0===value?this.get(owner,key):(this.set(owner,key,value),void 0!==value?value:key)},remove:function(owner,key){var i,cache=owner[this.expando];if(void 0!==cache){if(void 0!==key){jQuery.isArray(key)?key=key.map(jQuery.camelCase):(key=jQuery.camelCase(key),key=key in cache?[key]:key.match(rnotwhite)||[]),i=key.length;for(;i--;)delete cache[key[i]]}(void 0===key||jQuery.isEmptyObject(cache))&&(owner.nodeType?owner[this.expando]=void 0:delete owner[this.expando])}},hasData:function(owner){var cache=owner[this.expando];return void 0!==cache&&!jQuery.isEmptyObject(cache)}};var dataPriv=new Data,dataUser=new Data,rbrace=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,rmultiDash=/[A-Z]/g;jQuery.extend({hasData:function(elem){return dataUser.hasData(elem)||dataPriv.hasData(elem)},data:function(elem,name,data){return dataUser.access(elem,name,data)},removeData:function(elem,name){dataUser.remove(elem,name)},_data:function(elem,name,data){return dataPriv.access(elem,name,data)},_removeData:function(elem,name){dataPriv.remove(elem,name)}}),jQuery.fn.extend({data:function(key,value){var i,name,data,elem=this[0],attrs=elem&&elem.attributes;if(void 0===key){if(this.length&&(data=dataUser.get(elem),1===elem.nodeType&&!dataPriv.get(elem,"hasDataAttrs"))){for(i=attrs.length;i--;)attrs[i]&&(name=attrs[i].name,0===name.indexOf("data-")&&(name=jQuery.camelCase(name.slice(5)),dataAttr(elem,name,data[name])));dataPriv.set(elem,"hasDataAttrs",!0)}return data}return"object"==typeof key?this.each(function(){dataUser.set(this,key)}):access(this,function(value){var data;if(elem&&void 0===value){if(data=dataUser.get(elem,key),void 0!==data)return data;if(data=dataAttr(elem,key),void 0!==data)return data}else this.each(function(){dataUser.set(this,key,value)})},null,value,arguments.length>1,null,!0)},removeData:function(key){return this.each(function(){dataUser.remove(this,key)})}}),jQuery.extend({queue:function(elem,type,data){var queue;if(elem)return type=(type||"fx")+"queue",queue=dataPriv.get(elem,type),data&&(!queue||jQuery.isArray(data)?queue=dataPriv.access(elem,type,jQuery.makeArray(data)):queue.push(data)),queue||[]},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type)};"inprogress"===fn&&(fn=queue.shift(),startLength--),fn&&("fx"===type&&queue.unshift("inprogress"),delete hooks.stop,fn.call(elem,next,hooks)),!startLength&&hooks&&hooks.empty.fire()},_queueHooks:function(elem,type){var key=type+"queueHooks";return dataPriv.get(elem,key)||dataPriv.access(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){dataPriv.remove(elem,[type+"queue",key])})})}}),jQuery.fn.extend({queue:function(type,data){var setter=2;return"string"!=typeof type&&(data=type,type="fx",setter--),arguments.length<setter?jQuery.queue(this[0],type):void 0===data?this:this.each(function(){var queue=jQuery.queue(this,type,data);jQuery._queueHooks(this,type),"fx"===type&&"inprogress"!==queue[0]&&jQuery.dequeue(this,type)})},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type)})},clearQueue:function(type){return this.queue(type||"fx",[])},promise:function(type,obj){var tmp,count=1,defer=jQuery.Deferred(),elements=this,i=this.length,resolve=function(){--count||defer.resolveWith(elements,[elements])};for("string"!=typeof type&&(obj=type,type=void 0),type=type||"fx";i--;)tmp=dataPriv.get(elements[i],type+"queueHooks"),tmp&&tmp.empty&&(count++,tmp.empty.add(resolve));return resolve(),defer.promise(obj)}});var pnum=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,rcssNum=new RegExp("^(?:([+-])=|)("+pnum+")([a-z%]*)$","i"),cssExpand=["Top","Right","Bottom","Left"],isHiddenWithinTree=function(elem,el){return elem=el||elem,"none"===elem.style.display||""===elem.style.display&&jQuery.contains(elem.ownerDocument,elem)&&"none"===jQuery.css(elem,"display")},swap=function(elem,options,callback,args){var ret,name,old={};for(name in options)old[name]=elem.style[name],elem.style[name]=options[name];ret=callback.apply(elem,args||[]);for(name in options)elem.style[name]=old[name];return ret},defaultDisplayMap={};jQuery.fn.extend({show:function(){return showHide(this,!0)},hide:function(){return showHide(this)},toggle:function(state){return"boolean"==typeof state?state?this.show():this.hide():this.each(function(){isHiddenWithinTree(this)?jQuery(this).show():jQuery(this).hide()})}});var rcheckableType=/^(?:checkbox|radio)$/i,rtagName=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,rscriptType=/^$|\/(?:java|ecma)script/i,wrapMap={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option,wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead,wrapMap.th=wrapMap.td;var rhtml=/<|&#?\w+;/;!function(){var fragment=document.createDocumentFragment(),div=fragment.appendChild(document.createElement("div")),input=document.createElement("input");input.setAttribute("type","radio"),input.setAttribute("checked","checked"),input.setAttribute("name","t"),div.appendChild(input),support.checkClone=div.cloneNode(!0).cloneNode(!0).lastChild.checked,div.innerHTML="<textarea>x</textarea>",support.noCloneChecked=!!div.cloneNode(!0).lastChild.defaultValue}();var documentElement=document.documentElement,rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,rtypenamespace=/^([^.]*)(?:\.(.+)|)/;jQuery.event={global:{},add:function(elem,types,handler,data,selector){var handleObjIn,eventHandle,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.get(elem);if(elemData)for(handler.handler&&(handleObjIn=handler,handler=handleObjIn.handler,selector=handleObjIn.selector),selector&&jQuery.find.matchesSelector(documentElement,selector),handler.guid||(handler.guid=jQuery.guid++),(events=elemData.events)||(events=elemData.events={}),(eventHandle=elemData.handle)||(eventHandle=elemData.handle=function(e){return"undefined"!=typeof jQuery&&jQuery.event.triggered!==e.type?jQuery.event.dispatch.apply(elem,arguments):void 0}),types=(types||"").match(rnotwhite)||[""],t=types.length;t--;)tmp=rtypenamespace.exec(types[t])||[],type=origType=tmp[1],namespaces=(tmp[2]||"").split(".").sort(),type&&(special=jQuery.event.special[type]||{},type=(selector?special.delegateType:special.bindType)||type,special=jQuery.event.special[type]||{},handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn),(handlers=events[type])||(handlers=events[type]=[],handlers.delegateCount=0,special.setup&&special.setup.call(elem,data,namespaces,eventHandle)!==!1||elem.addEventListener&&elem.addEventListener(type,eventHandle)),special.add&&(special.add.call(elem,handleObj),handleObj.handler.guid||(handleObj.handler.guid=handler.guid)),selector?handlers.splice(handlers.delegateCount++,0,handleObj):handlers.push(handleObj),jQuery.event.global[type]=!0)},remove:function(elem,types,handler,selector,mappedTypes){var j,origCount,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.hasData(elem)&&dataPriv.get(elem);if(elemData&&(events=elemData.events)){for(types=(types||"").match(rnotwhite)||[""],t=types.length;t--;)if(tmp=rtypenamespace.exec(types[t])||[],type=origType=tmp[1],namespaces=(tmp[2]||"").split(".").sort(),type){for(special=jQuery.event.special[type]||{},type=(selector?special.delegateType:special.bindType)||type,handlers=events[type]||[],tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"),origCount=j=handlers.length;j--;)handleObj=handlers[j],!mappedTypes&&origType!==handleObj.origType||handler&&handler.guid!==handleObj.guid||tmp&&!tmp.test(handleObj.namespace)||selector&&selector!==handleObj.selector&&("**"!==selector||!handleObj.selector)||(handlers.splice(j,1),handleObj.selector&&handlers.delegateCount--,special.remove&&special.remove.call(elem,handleObj));origCount&&!handlers.length&&(special.teardown&&special.teardown.call(elem,namespaces,elemData.handle)!==!1||jQuery.removeEvent(elem,type,elemData.handle),delete events[type])}else for(type in events)jQuery.event.remove(elem,type+types[t],handler,selector,!0);jQuery.isEmptyObject(events)&&dataPriv.remove(elem,"handle events")}},dispatch:function(nativeEvent){var i,j,ret,matched,handleObj,handlerQueue,event=jQuery.event.fix(nativeEvent),args=new Array(arguments.length),handlers=(dataPriv.get(this,"events")||{})[event.type]||[],special=jQuery.event.special[event.type]||{};for(args[0]=event,i=1;i<arguments.length;i++)args[i]=arguments[i];if(event.delegateTarget=this,!special.preDispatch||special.preDispatch.call(this,event)!==!1){for(handlerQueue=jQuery.event.handlers.call(this,event,handlers),i=0;(matched=handlerQueue[i++])&&!event.isPropagationStopped();)for(event.currentTarget=matched.elem,j=0;(handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped();)event.rnamespace&&!event.rnamespace.test(handleObj.namespace)||(event.handleObj=handleObj,event.data=handleObj.data,ret=((jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler).apply(matched.elem,args),void 0!==ret&&(event.result=ret)===!1&&(event.preventDefault(),event.stopPropagation()));return special.postDispatch&&special.postDispatch.call(this,event),event.result}},handlers:function(event,handlers){var i,matches,sel,handleObj,handlerQueue=[],delegateCount=handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&("click"!==event.type||isNaN(event.button)||event.button<1))for(;cur!==this;cur=cur.parentNode||this)if(1===cur.nodeType&&(cur.disabled!==!0||"click"!==event.type)){for(matches=[],i=0;i<delegateCount;i++)handleObj=handlers[i],sel=handleObj.selector+" ",void 0===matches[sel]&&(matches[sel]=handleObj.needsContext?jQuery(sel,this).index(cur)>-1:jQuery.find(sel,this,null,[cur]).length),matches[sel]&&matches.push(handleObj);matches.length&&handlerQueue.push({elem:cur,handlers:matches})}return delegateCount<handlers.length&&handlerQueue.push({elem:this,handlers:handlers.slice(delegateCount)}),handlerQueue},addProp:function(name,hook){Object.defineProperty(jQuery.Event.prototype,name,{enumerable:!0,configurable:!0,get:jQuery.isFunction(hook)?function(){if(this.originalEvent)return hook(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[name]},set:function(value){Object.defineProperty(this,name,{enumerable:!0,configurable:!0,writable:!0,value:value})}})},fix:function(originalEvent){return originalEvent[jQuery.expando]?originalEvent:new jQuery.Event(originalEvent)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==safeActiveElement()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===safeActiveElement()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&jQuery.nodeName(this,"input"))return this.click(),!1},_default:function(event){return jQuery.nodeName(event.target,"a")}},beforeunload:{postDispatch:function(event){void 0!==event.result&&event.originalEvent&&(event.originalEvent.returnValue=event.result)}}}},jQuery.removeEvent=function(elem,type,handle){elem.removeEventListener&&elem.removeEventListener(type,handle)},jQuery.Event=function(src,props){return this instanceof jQuery.Event?(src&&src.type?(this.originalEvent=src,this.type=src.type,this.isDefaultPrevented=src.defaultPrevented||void 0===src.defaultPrevented&&src.returnValue===!1?returnTrue:returnFalse,this.target=src.target&&3===src.target.nodeType?src.target.parentNode:src.target,this.currentTarget=src.currentTarget,this.relatedTarget=src.relatedTarget):this.type=src,props&&jQuery.extend(this,props),this.timeStamp=src&&src.timeStamp||jQuery.now(),void(this[jQuery.expando]=!0)):new jQuery.Event(src,props)},jQuery.Event.prototype={constructor:jQuery.Event,isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=returnTrue,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=returnTrue,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=returnTrue,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},jQuery.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(event){var button=event.button;return null==event.which&&rkeyEvent.test(event.type)?null!=event.charCode?event.charCode:event.keyCode:!event.which&&void 0!==button&&rmouseEvent.test(event.type)?1&button?1:2&button?3:4&button?2:0:event.which}},jQuery.event.addProp),jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(orig,fix){jQuery.event.special[orig]={delegateType:fix,bindType:fix,handle:function(event){var ret,target=this,related=event.relatedTarget,handleObj=event.handleObj;return related&&(related===target||jQuery.contains(target,related))||(event.type=handleObj.origType,ret=handleObj.handler.apply(this,arguments),event.type=fix),ret}}}),jQuery.fn.extend({on:function(types,selector,data,fn){return on(this,types,selector,data,fn)},one:function(types,selector,data,fn){return on(this,types,selector,data,fn,1)},off:function(types,selector,fn){var handleObj,type;if(types&&types.preventDefault&&types.handleObj)return handleObj=types.handleObj,jQuery(types.delegateTarget).off(handleObj.namespace?handleObj.origType+"."+handleObj.namespace:handleObj.origType,handleObj.selector,handleObj.handler),this;if("object"==typeof types){for(type in types)this.off(type,selector,types[type]);return this}return selector!==!1&&"function"!=typeof selector||(fn=selector,selector=void 0),fn===!1&&(fn=returnFalse),this.each(function(){jQuery.event.remove(this,types,fn,selector)})}});var rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,rnoInnerhtml=/<script|<style|<link/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,rscriptTypeMasked=/^true\/(.*)/,rcleanScript=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;jQuery.extend({htmlPrefilter:function(html){return html.replace(rxhtmlTag,"<$1></$2>")},clone:function(elem,dataAndEvents,deepDataAndEvents){var i,l,srcElements,destElements,clone=elem.cloneNode(!0),inPage=jQuery.contains(elem.ownerDocument,elem);if(!(support.noCloneChecked||1!==elem.nodeType&&11!==elem.nodeType||jQuery.isXMLDoc(elem)))for(destElements=getAll(clone),srcElements=getAll(elem),i=0,l=srcElements.length;i<l;i++)fixInput(srcElements[i],destElements[i]);if(dataAndEvents)if(deepDataAndEvents)for(srcElements=srcElements||getAll(elem),destElements=destElements||getAll(clone),i=0,l=srcElements.length;i<l;i++)cloneCopyEvent(srcElements[i],destElements[i]);else cloneCopyEvent(elem,clone);return destElements=getAll(clone,"script"),destElements.length>0&&setGlobalEval(destElements,!inPage&&getAll(elem,"script")),clone},cleanData:function(elems){for(var data,elem,type,special=jQuery.event.special,i=0;void 0!==(elem=elems[i]);i++)if(acceptData(elem)){if(data=elem[dataPriv.expando]){if(data.events)for(type in data.events)special[type]?jQuery.event.remove(elem,type):jQuery.removeEvent(elem,type,data.handle);elem[dataPriv.expando]=void 0}elem[dataUser.expando]&&(elem[dataUser.expando]=void 0)}}}),jQuery.fn.extend({detach:function(selector){return remove(this,selector,!0)},remove:function(selector){return remove(this,selector)},text:function(value){return access(this,function(value){return void 0===value?jQuery.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=value)})},null,value,arguments.length)},append:function(){return domManip(this,arguments,function(elem){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var target=manipulationTarget(this,elem);target.appendChild(elem)}})},prepend:function(){return domManip(this,arguments,function(elem){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var target=manipulationTarget(this,elem);target.insertBefore(elem,target.firstChild)}})},before:function(){return domManip(this,arguments,function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this)})},after:function(){return domManip(this,arguments,function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this.nextSibling)})},empty:function(){for(var elem,i=0;null!=(elem=this[i]);i++)1===elem.nodeType&&(jQuery.cleanData(getAll(elem,!1)),elem.textContent="");return this},clone:function(dataAndEvents,deepDataAndEvents){return dataAndEvents=null!=dataAndEvents&&dataAndEvents,deepDataAndEvents=null==deepDataAndEvents?dataAndEvents:deepDataAndEvents,this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents)})},html:function(value){return access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(void 0===value&&1===elem.nodeType)return elem.innerHTML;if("string"==typeof value&&!rnoInnerhtml.test(value)&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=jQuery.htmlPrefilter(value);try{for(;i<l;i++)elem=this[i]||{},1===elem.nodeType&&(jQuery.cleanData(getAll(elem,!1)),elem.innerHTML=value);elem=0}catch(e){}}elem&&this.empty().append(value)},null,value,arguments.length)},replaceWith:function(){var ignored=[];return domManip(this,arguments,function(elem){var parent=this.parentNode;jQuery.inArray(this,ignored)<0&&(jQuery.cleanData(getAll(this)),parent&&parent.replaceChild(elem,this))},ignored)}}),jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){for(var elems,ret=[],insert=jQuery(selector),last=insert.length-1,i=0;i<=last;i++)elems=i===last?this:this.clone(!0),jQuery(insert[i])[original](elems),push.apply(ret,elems.get());return this.pushStack(ret)}});var rmargin=/^margin/,rnumnonpx=new RegExp("^("+pnum+")(?!px)[a-z%]+$","i"),getStyles=function(elem){var view=elem.ownerDocument.defaultView;return view&&view.opener||(view=window),view.getComputedStyle(elem)};!function(){function computeStyleTests(){if(div){div.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",div.innerHTML="",documentElement.appendChild(container);var divStyle=window.getComputedStyle(div);pixelPositionVal="1%"!==divStyle.top,reliableMarginLeftVal="2px"===divStyle.marginLeft,boxSizingReliableVal="4px"===divStyle.width,div.style.marginRight="50%",pixelMarginRightVal="4px"===divStyle.marginRight,documentElement.removeChild(container),div=null}}var pixelPositionVal,boxSizingReliableVal,pixelMarginRightVal,reliableMarginLeftVal,container=document.createElement("div"),div=document.createElement("div");div.style&&(div.style.backgroundClip="content-box",div.cloneNode(!0).style.backgroundClip="",support.clearCloneStyle="content-box"===div.style.backgroundClip,container.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",container.appendChild(div),jQuery.extend(support,{pixelPosition:function(){return computeStyleTests(),pixelPositionVal},boxSizingReliable:function(){return computeStyleTests(),boxSizingReliableVal},pixelMarginRight:function(){return computeStyleTests(),pixelMarginRightVal},reliableMarginLeft:function(){return computeStyleTests(),reliableMarginLeftVal}}))}();var rdisplayswap=/^(none|table(?!-c[ea]).+)/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:"0",fontWeight:"400"},cssPrefixes=["Webkit","Moz","ms"],emptyStyle=document.createElement("div").style;jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return""===ret?"1":ret}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(elem,name,value,extra){if(elem&&3!==elem.nodeType&&8!==elem.nodeType&&elem.style){var ret,type,hooks,origName=jQuery.camelCase(name),style=elem.style;return name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(origName)||origName),hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName],void 0===value?hooks&&"get"in hooks&&void 0!==(ret=hooks.get(elem,!1,extra))?ret:style[name]:(type=typeof value,"string"===type&&(ret=rcssNum.exec(value))&&ret[1]&&(value=adjustCSS(elem,name,ret),type="number"),null!=value&&value===value&&("number"===type&&(value+=ret&&ret[3]||(jQuery.cssNumber[origName]?"":"px")),support.clearCloneStyle||""!==value||0!==name.indexOf("background")||(style[name]="inherit"),hooks&&"set"in hooks&&void 0===(value=hooks.set(elem,value,extra))||(style[name]=value)),void 0)}},css:function(elem,name,extra,styles){var val,num,hooks,origName=jQuery.camelCase(name);return name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(origName)||origName),hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName],hooks&&"get"in hooks&&(val=hooks.get(elem,!0,extra)),void 0===val&&(val=curCSS(elem,name,styles)),"normal"===val&&name in cssNormalTransform&&(val=cssNormalTransform[name]),""===extra||extra?(num=parseFloat(val),extra===!0||isFinite(num)?num||0:val):val}}),jQuery.each(["height","width"],function(i,name){jQuery.cssHooks[name]={get:function(elem,computed,extra){if(computed)return!rdisplayswap.test(jQuery.css(elem,"display"))||elem.getClientRects().length&&elem.getBoundingClientRect().width?getWidthOrHeight(elem,name,extra):swap(elem,cssShow,function(){return getWidthOrHeight(elem,name,extra)})},set:function(elem,value,extra){var matches,styles=extra&&getStyles(elem),subtract=extra&&augmentWidthOrHeight(elem,name,extra,"border-box"===jQuery.css(elem,"boxSizing",!1,styles),styles);return subtract&&(matches=rcssNum.exec(value))&&"px"!==(matches[3]||"px")&&(elem.style[name]=value,value=jQuery.css(elem,name)),setPositiveNumber(elem,value,subtract)}}}),jQuery.cssHooks.marginLeft=addGetHookIf(support.reliableMarginLeft,function(elem,computed){if(computed)return(parseFloat(curCSS(elem,"marginLeft"))||elem.getBoundingClientRect().left-swap(elem,{marginLeft:0},function(){return elem.getBoundingClientRect().left}))+"px"}),jQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){for(var i=0,expanded={},parts="string"==typeof value?value.split(" "):[value];i<4;i++)expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0];return expanded}},rmargin.test(prefix)||(jQuery.cssHooks[prefix+suffix].set=setPositiveNumber)}),jQuery.fn.extend({css:function(name,value){return access(this,function(elem,name,value){var styles,len,map={},i=0;if(jQuery.isArray(name)){for(styles=getStyles(elem),len=name.length;i<len;i++)map[name[i]]=jQuery.css(elem,name[i],!1,styles);return map}return void 0!==value?jQuery.style(elem,name,value):jQuery.css(elem,name)},name,value,arguments.length>1)}}),jQuery.Tween=Tween,Tween.prototype={constructor:Tween,init:function(elem,options,prop,end,easing,unit){this.elem=elem,this.prop=prop,this.easing=easing||jQuery.easing._default,this.options=options,this.start=this.now=this.cur(),this.end=end,this.unit=unit||(jQuery.cssNumber[prop]?"":"px")},cur:function(){var hooks=Tween.propHooks[this.prop];return hooks&&hooks.get?hooks.get(this):Tween.propHooks._default.get(this)},run:function(percent){var eased,hooks=Tween.propHooks[this.prop];return this.options.duration?this.pos=eased=jQuery.easing[this.easing](percent,this.options.duration*percent,0,1,this.options.duration):this.pos=eased=percent,this.now=(this.end-this.start)*eased+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),hooks&&hooks.set?hooks.set(this):Tween.propHooks._default.set(this),this}},Tween.prototype.init.prototype=Tween.prototype,Tween.propHooks={_default:{get:function(tween){var result;return 1!==tween.elem.nodeType||null!=tween.elem[tween.prop]&&null==tween.elem.style[tween.prop]?tween.elem[tween.prop]:(result=jQuery.css(tween.elem,tween.prop,""),result&&"auto"!==result?result:0)},set:function(tween){jQuery.fx.step[tween.prop]?jQuery.fx.step[tween.prop](tween):1!==tween.elem.nodeType||null==tween.elem.style[jQuery.cssProps[tween.prop]]&&!jQuery.cssHooks[tween.prop]?tween.elem[tween.prop]=tween.now:jQuery.style(tween.elem,tween.prop,tween.now+tween.unit)}}},Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(tween){tween.elem.nodeType&&tween.elem.parentNode&&(tween.elem[tween.prop]=tween.now)}},jQuery.easing={linear:function(p){return p},swing:function(p){return.5-Math.cos(p*Math.PI)/2},_default:"swing"},jQuery.fx=Tween.prototype.init,jQuery.fx.step={};var fxNow,timerId,rfxtypes=/^(?:toggle|show|hide)$/,rrun=/queueHooks$/;jQuery.Animation=jQuery.extend(Animation,{tweeners:{"*":[function(prop,value){var tween=this.createTween(prop,value);return adjustCSS(tween.elem,prop,rcssNum.exec(value),tween),tween}]},tweener:function(props,callback){jQuery.isFunction(props)?(callback=props,props=["*"]):props=props.match(rnotwhite);for(var prop,index=0,length=props.length;index<length;index++)prop=props[index],Animation.tweeners[prop]=Animation.tweeners[prop]||[],Animation.tweeners[prop].unshift(callback)},prefilters:[defaultPrefilter],prefilter:function(callback,prepend){prepend?Animation.prefilters.unshift(callback):Animation.prefilters.push(callback)}}),jQuery.speed=function(speed,easing,fn){var opt=speed&&"object"==typeof speed?jQuery.extend({},speed):{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};return jQuery.fx.off||document.hidden?opt.duration=0:opt.duration="number"==typeof opt.duration?opt.duration:opt.duration in jQuery.fx.speeds?jQuery.fx.speeds[opt.duration]:jQuery.fx.speeds._default,
null!=opt.queue&&opt.queue!==!0||(opt.queue="fx"),opt.old=opt.complete,opt.complete=function(){jQuery.isFunction(opt.old)&&opt.old.call(this),opt.queue&&jQuery.dequeue(this,opt.queue)},opt},jQuery.fn.extend({fadeTo:function(speed,to,easing,callback){return this.filter(isHiddenWithinTree).css("opacity",0).show().end().animate({opacity:to},speed,easing,callback)},animate:function(prop,speed,easing,callback){var empty=jQuery.isEmptyObject(prop),optall=jQuery.speed(speed,easing,callback),doAnimation=function(){var anim=Animation(this,jQuery.extend({},prop),optall);(empty||dataPriv.get(this,"finish"))&&anim.stop(!0)};return doAnimation.finish=doAnimation,empty||optall.queue===!1?this.each(doAnimation):this.queue(optall.queue,doAnimation)},stop:function(type,clearQueue,gotoEnd){var stopQueue=function(hooks){var stop=hooks.stop;delete hooks.stop,stop(gotoEnd)};return"string"!=typeof type&&(gotoEnd=clearQueue,clearQueue=type,type=void 0),clearQueue&&type!==!1&&this.queue(type||"fx",[]),this.each(function(){var dequeue=!0,index=null!=type&&type+"queueHooks",timers=jQuery.timers,data=dataPriv.get(this);if(index)data[index]&&data[index].stop&&stopQueue(data[index]);else for(index in data)data[index]&&data[index].stop&&rrun.test(index)&&stopQueue(data[index]);for(index=timers.length;index--;)timers[index].elem!==this||null!=type&&timers[index].queue!==type||(timers[index].anim.stop(gotoEnd),dequeue=!1,timers.splice(index,1));!dequeue&&gotoEnd||jQuery.dequeue(this,type)})},finish:function(type){return type!==!1&&(type=type||"fx"),this.each(function(){var index,data=dataPriv.get(this),queue=data[type+"queue"],hooks=data[type+"queueHooks"],timers=jQuery.timers,length=queue?queue.length:0;for(data.finish=!0,jQuery.queue(this,type,[]),hooks&&hooks.stop&&hooks.stop.call(this,!0),index=timers.length;index--;)timers[index].elem===this&&timers[index].queue===type&&(timers[index].anim.stop(!0),timers.splice(index,1));for(index=0;index<length;index++)queue[index]&&queue[index].finish&&queue[index].finish.call(this);delete data.finish})}}),jQuery.each(["toggle","show","hide"],function(i,name){var cssFn=jQuery.fn[name];jQuery.fn[name]=function(speed,easing,callback){return null==speed||"boolean"==typeof speed?cssFn.apply(this,arguments):this.animate(genFx(name,!0),speed,easing,callback)}}),jQuery.each({slideDown:genFx("show"),slideUp:genFx("hide"),slideToggle:genFx("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(name,props){jQuery.fn[name]=function(speed,easing,callback){return this.animate(props,speed,easing,callback)}}),jQuery.timers=[],jQuery.fx.tick=function(){var timer,i=0,timers=jQuery.timers;for(fxNow=jQuery.now();i<timers.length;i++)timer=timers[i],timer()||timers[i]!==timer||timers.splice(i--,1);timers.length||jQuery.fx.stop(),fxNow=void 0},jQuery.fx.timer=function(timer){jQuery.timers.push(timer),timer()?jQuery.fx.start():jQuery.timers.pop()},jQuery.fx.interval=13,jQuery.fx.start=function(){timerId||(timerId=window.requestAnimationFrame?window.requestAnimationFrame(raf):window.setInterval(jQuery.fx.tick,jQuery.fx.interval))},jQuery.fx.stop=function(){window.cancelAnimationFrame?window.cancelAnimationFrame(timerId):window.clearInterval(timerId),timerId=null},jQuery.fx.speeds={slow:600,fast:200,_default:400},jQuery.fn.delay=function(time,type){return time=jQuery.fx?jQuery.fx.speeds[time]||time:time,type=type||"fx",this.queue(type,function(next,hooks){var timeout=window.setTimeout(next,time);hooks.stop=function(){window.clearTimeout(timeout)}})},function(){var input=document.createElement("input"),select=document.createElement("select"),opt=select.appendChild(document.createElement("option"));input.type="checkbox",support.checkOn=""!==input.value,support.optSelected=opt.selected,input=document.createElement("input"),input.value="t",input.type="radio",support.radioValue="t"===input.value}();var boolHook,attrHandle=jQuery.expr.attrHandle;jQuery.fn.extend({attr:function(name,value){return access(this,jQuery.attr,name,value,arguments.length>1)},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name)})}}),jQuery.extend({attr:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(3!==nType&&8!==nType&&2!==nType)return"undefined"==typeof elem.getAttribute?jQuery.prop(elem,name,value):(1===nType&&jQuery.isXMLDoc(elem)||(hooks=jQuery.attrHooks[name.toLowerCase()]||(jQuery.expr.match.bool.test(name)?boolHook:void 0)),void 0!==value?null===value?void jQuery.removeAttr(elem,name):hooks&&"set"in hooks&&void 0!==(ret=hooks.set(elem,value,name))?ret:(elem.setAttribute(name,value+""),value):hooks&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:(ret=jQuery.find.attr(elem,name),null==ret?void 0:ret))},attrHooks:{type:{set:function(elem,value){if(!support.radioValue&&"radio"===value&&jQuery.nodeName(elem,"input")){var val=elem.value;return elem.setAttribute("type",value),val&&(elem.value=val),value}}}},removeAttr:function(elem,value){var name,i=0,attrNames=value&&value.match(rnotwhite);if(attrNames&&1===elem.nodeType)for(;name=attrNames[i++];)elem.removeAttribute(name)}}),boolHook={set:function(elem,value,name){return value===!1?jQuery.removeAttr(elem,name):elem.setAttribute(name,name),name}},jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(i,name){var getter=attrHandle[name]||jQuery.find.attr;attrHandle[name]=function(elem,name,isXML){var ret,handle,lowercaseName=name.toLowerCase();return isXML||(handle=attrHandle[lowercaseName],attrHandle[lowercaseName]=ret,ret=null!=getter(elem,name,isXML)?lowercaseName:null,attrHandle[lowercaseName]=handle),ret}});var rfocusable=/^(?:input|select|textarea|button)$/i,rclickable=/^(?:a|area)$/i;jQuery.fn.extend({prop:function(name,value){return access(this,jQuery.prop,name,value,arguments.length>1)},removeProp:function(name){return this.each(function(){delete this[jQuery.propFix[name]||name]})}}),jQuery.extend({prop:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(3!==nType&&8!==nType&&2!==nType)return 1===nType&&jQuery.isXMLDoc(elem)||(name=jQuery.propFix[name]||name,hooks=jQuery.propHooks[name]),void 0!==value?hooks&&"set"in hooks&&void 0!==(ret=hooks.set(elem,value,name))?ret:elem[name]=value:hooks&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:elem[name]},propHooks:{tabIndex:{get:function(elem){var tabindex=jQuery.find.attr(elem,"tabindex");return tabindex?parseInt(tabindex,10):rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),support.optSelected||(jQuery.propHooks.selected={get:function(elem){var parent=elem.parentNode;return parent&&parent.parentNode&&parent.parentNode.selectedIndex,null},set:function(elem){var parent=elem.parentNode;parent&&(parent.selectedIndex,parent.parentNode&&parent.parentNode.selectedIndex)}}),jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this});var rclass=/[\t\r\n\f]/g;jQuery.fn.extend({addClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(jQuery.isFunction(value))return this.each(function(j){jQuery(this).addClass(value.call(this,j,getClass(this)))});if("string"==typeof value&&value)for(classes=value.match(rnotwhite)||[];elem=this[i++];)if(curValue=getClass(elem),cur=1===elem.nodeType&&(" "+curValue+" ").replace(rclass," ")){for(j=0;clazz=classes[j++];)cur.indexOf(" "+clazz+" ")<0&&(cur+=clazz+" ");finalValue=jQuery.trim(cur),curValue!==finalValue&&elem.setAttribute("class",finalValue)}return this},removeClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(jQuery.isFunction(value))return this.each(function(j){jQuery(this).removeClass(value.call(this,j,getClass(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof value&&value)for(classes=value.match(rnotwhite)||[];elem=this[i++];)if(curValue=getClass(elem),cur=1===elem.nodeType&&(" "+curValue+" ").replace(rclass," ")){for(j=0;clazz=classes[j++];)for(;cur.indexOf(" "+clazz+" ")>-1;)cur=cur.replace(" "+clazz+" "," ");finalValue=jQuery.trim(cur),curValue!==finalValue&&elem.setAttribute("class",finalValue)}return this},toggleClass:function(value,stateVal){var type=typeof value;return"boolean"==typeof stateVal&&"string"===type?stateVal?this.addClass(value):this.removeClass(value):jQuery.isFunction(value)?this.each(function(i){jQuery(this).toggleClass(value.call(this,i,getClass(this),stateVal),stateVal)}):this.each(function(){var className,i,self,classNames;if("string"===type)for(i=0,self=jQuery(this),classNames=value.match(rnotwhite)||[];className=classNames[i++];)self.hasClass(className)?self.removeClass(className):self.addClass(className);else void 0!==value&&"boolean"!==type||(className=getClass(this),className&&dataPriv.set(this,"__className__",className),this.setAttribute&&this.setAttribute("class",className||value===!1?"":dataPriv.get(this,"__className__")||""))})},hasClass:function(selector){var className,elem,i=0;for(className=" "+selector+" ";elem=this[i++];)if(1===elem.nodeType&&(" "+getClass(elem)+" ").replace(rclass," ").indexOf(className)>-1)return!0;return!1}});var rreturn=/\r/g,rspaces=/[\x20\t\r\n\f]+/g;jQuery.fn.extend({val:function(value){var hooks,ret,isFunction,elem=this[0];{if(arguments.length)return isFunction=jQuery.isFunction(value),this.each(function(i){var val;1===this.nodeType&&(val=isFunction?value.call(this,i,jQuery(this).val()):value,null==val?val="":"number"==typeof val?val+="":jQuery.isArray(val)&&(val=jQuery.map(val,function(value){return null==value?"":value+""})),hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()],hooks&&"set"in hooks&&void 0!==hooks.set(this,val,"value")||(this.value=val))});if(elem)return hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()],hooks&&"get"in hooks&&void 0!==(ret=hooks.get(elem,"value"))?ret:(ret=elem.value,"string"==typeof ret?ret.replace(rreturn,""):null==ret?"":ret)}}}),jQuery.extend({valHooks:{option:{get:function(elem){var val=jQuery.find.attr(elem,"value");return null!=val?val:jQuery.trim(jQuery.text(elem)).replace(rspaces," ")}},select:{get:function(elem){for(var value,option,options=elem.options,index=elem.selectedIndex,one="select-one"===elem.type,values=one?null:[],max=one?index+1:options.length,i=index<0?max:one?index:0;i<max;i++)if(option=options[i],(option.selected||i===index)&&!option.disabled&&(!option.parentNode.disabled||!jQuery.nodeName(option.parentNode,"optgroup"))){if(value=jQuery(option).val(),one)return value;values.push(value)}return values},set:function(elem,value){for(var optionSet,option,options=elem.options,values=jQuery.makeArray(value),i=options.length;i--;)option=options[i],(option.selected=jQuery.inArray(jQuery.valHooks.option.get(option),values)>-1)&&(optionSet=!0);return optionSet||(elem.selectedIndex=-1),values}}}}),jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function(elem,value){if(jQuery.isArray(value))return elem.checked=jQuery.inArray(jQuery(elem).val(),value)>-1}},support.checkOn||(jQuery.valHooks[this].get=function(elem){return null===elem.getAttribute("value")?"on":elem.value})});var rfocusMorph=/^(?:focusinfocus|focusoutblur)$/;jQuery.extend(jQuery.event,{trigger:function(event,data,elem,onlyHandlers){var i,cur,tmp,bubbleType,ontype,handle,special,eventPath=[elem||document],type=hasOwn.call(event,"type")?event.type:event,namespaces=hasOwn.call(event,"namespace")?event.namespace.split("."):[];if(cur=tmp=elem=elem||document,3!==elem.nodeType&&8!==elem.nodeType&&!rfocusMorph.test(type+jQuery.event.triggered)&&(type.indexOf(".")>-1&&(namespaces=type.split("."),type=namespaces.shift(),namespaces.sort()),ontype=type.indexOf(":")<0&&"on"+type,event=event[jQuery.expando]?event:new jQuery.Event(type,"object"==typeof event&&event),event.isTrigger=onlyHandlers?2:3,event.namespace=namespaces.join("."),event.rnamespace=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,event.result=void 0,event.target||(event.target=elem),data=null==data?[event]:jQuery.makeArray(data,[event]),special=jQuery.event.special[type]||{},onlyHandlers||!special.trigger||special.trigger.apply(elem,data)!==!1)){if(!onlyHandlers&&!special.noBubble&&!jQuery.isWindow(elem)){for(bubbleType=special.delegateType||type,rfocusMorph.test(bubbleType+type)||(cur=cur.parentNode);cur;cur=cur.parentNode)eventPath.push(cur),tmp=cur;tmp===(elem.ownerDocument||document)&&eventPath.push(tmp.defaultView||tmp.parentWindow||window)}for(i=0;(cur=eventPath[i++])&&!event.isPropagationStopped();)event.type=i>1?bubbleType:special.bindType||type,handle=(dataPriv.get(cur,"events")||{})[event.type]&&dataPriv.get(cur,"handle"),handle&&handle.apply(cur,data),handle=ontype&&cur[ontype],handle&&handle.apply&&acceptData(cur)&&(event.result=handle.apply(cur,data),event.result===!1&&event.preventDefault());return event.type=type,onlyHandlers||event.isDefaultPrevented()||special._default&&special._default.apply(eventPath.pop(),data)!==!1||!acceptData(elem)||ontype&&jQuery.isFunction(elem[type])&&!jQuery.isWindow(elem)&&(tmp=elem[ontype],tmp&&(elem[ontype]=null),jQuery.event.triggered=type,elem[type](),jQuery.event.triggered=void 0,tmp&&(elem[ontype]=tmp)),event.result}},simulate:function(type,elem,event){var e=jQuery.extend(new jQuery.Event,event,{type:type,isSimulated:!0});jQuery.event.trigger(e,null,elem)}}),jQuery.fn.extend({trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this)})},triggerHandler:function(type,data){var elem=this[0];if(elem)return jQuery.event.trigger(type,data,elem,!0)}}),jQuery.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name)}}),jQuery.fn.extend({hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver)}}),support.focusin="onfocusin"in window,support.focusin||jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){var handler=function(event){jQuery.event.simulate(fix,event.target,jQuery.event.fix(event))};jQuery.event.special[fix]={setup:function(){var doc=this.ownerDocument||this,attaches=dataPriv.access(doc,fix);attaches||doc.addEventListener(orig,handler,!0),dataPriv.access(doc,fix,(attaches||0)+1)},teardown:function(){var doc=this.ownerDocument||this,attaches=dataPriv.access(doc,fix)-1;attaches?dataPriv.access(doc,fix,attaches):(doc.removeEventListener(orig,handler,!0),dataPriv.remove(doc,fix))}}});var location=window.location,nonce=jQuery.now(),rquery=/\?/;jQuery.parseXML=function(data){var xml;if(!data||"string"!=typeof data)return null;try{xml=(new window.DOMParser).parseFromString(data,"text/xml")}catch(e){xml=void 0}return xml&&!xml.getElementsByTagName("parsererror").length||jQuery.error("Invalid XML: "+data),xml};var rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,valueOrFunction){var value=jQuery.isFunction(valueOrFunction)?valueOrFunction():valueOrFunction;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(null==value?"":value)};if(jQuery.isArray(a)||a.jquery&&!jQuery.isPlainObject(a))jQuery.each(a,function(){add(this.name,this.value)});else for(prefix in a)buildParams(prefix,a[prefix],traditional,add);return s.join("&")},jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this}).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!rcheckableType.test(type))}).map(function(i,elem){var val=jQuery(this).val();return null==val?null:jQuery.isArray(val)?jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")}}):{name:elem.name,value:val.replace(rCRLF,"\r\n")}}).get()}});var r20=/%20/g,rhash=/#.*$/,rts=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)$/gm,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,prefilters={},transports={},allTypes="*/".concat("*"),originAnchor=document.createElement("a");originAnchor.href=location.href,jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:location.href,type:"GET",isLocal:rlocalProtocol.test(location.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":jQuery.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target)},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;completed||(completed=!0,timeoutTimer&&window.clearTimeout(timeoutTimer),transport=void 0,responseHeadersString=headers||"",jqXHR.readyState=status>0?4:0,isSuccess=status>=200&&status<300||304===status,responses&&(response=ajaxHandleResponses(s,jqXHR,responses)),response=ajaxConvert(s,response,jqXHR,isSuccess),isSuccess?(s.ifModified&&(modified=jqXHR.getResponseHeader("Last-Modified"),modified&&(jQuery.lastModified[cacheURL]=modified),modified=jqXHR.getResponseHeader("etag"),modified&&(jQuery.etag[cacheURL]=modified)),204===status||"HEAD"===s.type?statusText="nocontent":304===status?statusText="notmodified":(statusText=response.state,success=response.data,error=response.error,isSuccess=!error)):(error=statusText,!status&&statusText||(statusText="error",status<0&&(status=0))),jqXHR.status=status,jqXHR.statusText=(nativeStatusText||statusText)+"",isSuccess?deferred.resolveWith(callbackContext,[success,statusText,jqXHR]):deferred.rejectWith(callbackContext,[jqXHR,statusText,error]),jqXHR.statusCode(statusCode),statusCode=void 0,fireGlobals&&globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error]),completeDeferred.fireWith(callbackContext,[jqXHR,statusText]),fireGlobals&&(globalEventContext.trigger("ajaxComplete",[jqXHR,s]),--jQuery.active||jQuery.event.trigger("ajaxStop")))}"object"==typeof url&&(options=url,url=void 0),options=options||{};var transport,cacheURL,responseHeadersString,responseHeaders,timeoutTimer,urlAnchor,completed,fireGlobals,i,uncached,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(completed){if(!responseHeaders)for(responseHeaders={};match=rheaders.exec(responseHeadersString);)responseHeaders[match[1].toLowerCase()]=match[2];match=responseHeaders[key.toLowerCase()]}return null==match?null:match},getAllResponseHeaders:function(){return completed?responseHeadersString:null},setRequestHeader:function(name,value){return null==completed&&(name=requestHeadersNames[name.toLowerCase()]=requestHeadersNames[name.toLowerCase()]||name,requestHeaders[name]=value),this},overrideMimeType:function(type){return null==completed&&(s.mimeType=type),this},statusCode:function(map){var code;if(map)if(completed)jqXHR.always(map[jqXHR.status]);else for(code in map)statusCode[code]=[statusCode[code],map[code]];return this},abort:function(statusText){var finalText=statusText||strAbort;return transport&&transport.abort(finalText),done(0,finalText),this}};if(deferred.promise(jqXHR),s.url=((url||s.url||location.href)+"").replace(rprotocol,location.protocol+"//"),s.type=options.method||options.type||s.method||s.type,s.dataTypes=(s.dataType||"*").toLowerCase().match(rnotwhite)||[""],null==s.crossDomain){urlAnchor=document.createElement("a");try{urlAnchor.href=s.url,urlAnchor.href=urlAnchor.href,s.crossDomain=originAnchor.protocol+"//"+originAnchor.host!=urlAnchor.protocol+"//"+urlAnchor.host}catch(e){s.crossDomain=!0}}if(s.data&&s.processData&&"string"!=typeof s.data&&(s.data=jQuery.param(s.data,s.traditional)),inspectPrefiltersOrTransports(prefilters,s,options,jqXHR),completed)return jqXHR;fireGlobals=jQuery.event&&s.global,fireGlobals&&0===jQuery.active++&&jQuery.event.trigger("ajaxStart"),s.type=s.type.toUpperCase(),s.hasContent=!rnoContent.test(s.type),cacheURL=s.url.replace(rhash,""),s.hasContent?s.data&&s.processData&&0===(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&(s.data=s.data.replace(r20,"+")):(uncached=s.url.slice(cacheURL.length),s.data&&(cacheURL+=(rquery.test(cacheURL)?"&":"?")+s.data,delete s.data),s.cache===!1&&(cacheURL=cacheURL.replace(rts,""),uncached=(rquery.test(cacheURL)?"&":"?")+"_="+nonce++ +uncached),s.url=cacheURL+uncached),s.ifModified&&(jQuery.lastModified[cacheURL]&&jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL]),jQuery.etag[cacheURL]&&jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL])),(s.data&&s.hasContent&&s.contentType!==!1||options.contentType)&&jqXHR.setRequestHeader("Content-Type",s.contentType),jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+("*"!==s.dataTypes[0]?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers)jqXHR.setRequestHeader(i,s.headers[i]);if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===!1||completed))return jqXHR.abort();if(strAbort="abort",completeDeferred.add(s.complete),jqXHR.done(s.success),jqXHR.fail(s.error),transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR)){if(jqXHR.readyState=1,fireGlobals&&globalEventContext.trigger("ajaxSend",[jqXHR,s]),completed)return jqXHR;s.async&&s.timeout>0&&(timeoutTimer=window.setTimeout(function(){jqXHR.abort("timeout")},s.timeout));try{completed=!1,transport.send(requestHeaders,done)}catch(e){if(completed)throw e;done(-1,e)}}else done(-1,"No Transport");return jqXHR},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},getScript:function(url,callback){return jQuery.get(url,void 0,callback,"script")}}),jQuery.each(["get","post"],function(i,method){jQuery[method]=function(url,data,callback,type){return jQuery.isFunction(data)&&(type=type||callback,callback=data,data=void 0),jQuery.ajax(jQuery.extend({url:url,type:method,dataType:type,data:data,success:callback},jQuery.isPlainObject(url)&&url))}}),jQuery._evalUrl=function(url){return jQuery.ajax({url:url,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},jQuery.fn.extend({wrapAll:function(html){var wrap;return this[0]&&(jQuery.isFunction(html)&&(html=html.call(this[0])),wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&wrap.insertBefore(this[0]),wrap.map(function(){for(var elem=this;elem.firstElementChild;)elem=elem.firstElementChild;return elem}).append(this)),this},wrapInner:function(html){return jQuery.isFunction(html)?this.each(function(i){jQuery(this).wrapInner(html.call(this,i))}):this.each(function(){var self=jQuery(this),contents=self.contents();contents.length?contents.wrapAll(html):self.append(html)})},wrap:function(html){var isFunction=jQuery.isFunction(html);return this.each(function(i){jQuery(this).wrapAll(isFunction?html.call(this,i):html)})},unwrap:function(selector){return this.parent(selector).not("body").each(function(){jQuery(this).replaceWith(this.childNodes)}),this}}),jQuery.expr.pseudos.hidden=function(elem){return!jQuery.expr.pseudos.visible(elem)},jQuery.expr.pseudos.visible=function(elem){return!!(elem.offsetWidth||elem.offsetHeight||elem.getClientRects().length)},jQuery.ajaxSettings.xhr=function(){try{return new window.XMLHttpRequest}catch(e){}};var xhrSuccessStatus={0:200,1223:204},xhrSupported=jQuery.ajaxSettings.xhr();support.cors=!!xhrSupported&&"withCredentials"in xhrSupported,support.ajax=xhrSupported=!!xhrSupported,jQuery.ajaxTransport(function(options){var callback,errorCallback;if(support.cors||xhrSupported&&!options.crossDomain)return{send:function(headers,complete){var i,xhr=options.xhr();if(xhr.open(options.type,options.url,options.async,options.username,options.password),options.xhrFields)for(i in options.xhrFields)xhr[i]=options.xhrFields[i];options.mimeType&&xhr.overrideMimeType&&xhr.overrideMimeType(options.mimeType),options.crossDomain||headers["X-Requested-With"]||(headers["X-Requested-With"]="XMLHttpRequest");for(i in headers)xhr.setRequestHeader(i,headers[i]);callback=function(type){return function(){callback&&(callback=errorCallback=xhr.onload=xhr.onerror=xhr.onabort=xhr.onreadystatechange=null,"abort"===type?xhr.abort():"error"===type?"number"!=typeof xhr.status?complete(0,"error"):complete(xhr.status,xhr.statusText):complete(xhrSuccessStatus[xhr.status]||xhr.status,xhr.statusText,"text"!==(xhr.responseType||"text")||"string"!=typeof xhr.responseText?{binary:xhr.response}:{text:xhr.responseText},xhr.getAllResponseHeaders()))}},xhr.onload=callback(),errorCallback=xhr.onerror=callback("error"),void 0!==xhr.onabort?xhr.onabort=errorCallback:xhr.onreadystatechange=function(){4===xhr.readyState&&window.setTimeout(function(){callback&&errorCallback()})},callback=callback("abort");try{xhr.send(options.hasContent&&options.data||null)}catch(e){if(callback)throw e}},abort:function(){callback&&callback()}}}),jQuery.ajaxPrefilter(function(s){s.crossDomain&&(s.contents.script=!1)}),jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(text){return jQuery.globalEval(text),text}}}),jQuery.ajaxPrefilter("script",function(s){void 0===s.cache&&(s.cache=!1),s.crossDomain&&(s.type="GET")}),jQuery.ajaxTransport("script",function(s){if(s.crossDomain){var script,callback;return{send:function(_,complete){script=jQuery("<script>").prop({charset:s.scriptCharset,src:s.url}).on("load error",callback=function(evt){script.remove(),callback=null,evt&&complete("error"===evt.type?404:200,evt.type)}),document.head.appendChild(script[0])},abort:function(){callback&&callback()}}}});var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop()||jQuery.expando+"_"+nonce++;return this[callback]=!0,callback}}),jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=s.jsonp!==!1&&(rjsonp.test(s.url)?"url":"string"==typeof s.data&&0===(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&rjsonp.test(s.data)&&"data");if(jsonProp||"jsonp"===s.dataTypes[0])return callbackName=s.jsonpCallback=jQuery.isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback,jsonProp?s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName):s.jsonp!==!1&&(s.url+=(rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName),s.converters["script json"]=function(){return responseContainer||jQuery.error(callbackName+" was not called"),responseContainer[0]},s.dataTypes[0]="json",overwritten=window[callbackName],window[callbackName]=function(){responseContainer=arguments},jqXHR.always(function(){void 0===overwritten?jQuery(window).removeProp(callbackName):window[callbackName]=overwritten,s[callbackName]&&(s.jsonpCallback=originalSettings.jsonpCallback,oldCallbacks.push(callbackName)),responseContainer&&jQuery.isFunction(overwritten)&&overwritten(responseContainer[0]),responseContainer=overwritten=void 0}),"script"}),support.createHTMLDocument=function(){var body=document.implementation.createHTMLDocument("").body;return body.innerHTML="<form></form><form></form>",2===body.childNodes.length}(),jQuery.parseHTML=function(data,context,keepScripts){if("string"!=typeof data)return[];"boolean"==typeof context&&(keepScripts=context,context=!1);var base,parsed,scripts;return context||(support.createHTMLDocument?(context=document.implementation.createHTMLDocument(""),base=context.createElement("base"),base.href=document.location.href,context.head.appendChild(base)):context=document),parsed=rsingleTag.exec(data),scripts=!keepScripts&&[],parsed?[context.createElement(parsed[1])]:(parsed=buildFragment([data],context,scripts),scripts&&scripts.length&&jQuery(scripts).remove(),jQuery.merge([],parsed.childNodes))},jQuery.fn.load=function(url,params,callback){var selector,type,response,self=this,off=url.indexOf(" ");return off>-1&&(selector=jQuery.trim(url.slice(off)),url=url.slice(0,off)),jQuery.isFunction(params)?(callback=params,params=void 0):params&&"object"==typeof params&&(type="POST"),self.length>0&&jQuery.ajax({url:url,type:type||"GET",dataType:"html",data:params}).done(function(responseText){response=arguments,self.html(selector?jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector):responseText)}).always(callback&&function(jqXHR,status){self.each(function(){callback.apply(this,response||[jqXHR.responseText,status,jqXHR])})}),this},jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(i,type){jQuery.fn[type]=function(fn){return this.on(type,fn)}}),jQuery.expr.pseudos.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem}).length},jQuery.offset={setOffset:function(elem,options,i){var curPosition,curLeft,curCSSTop,curTop,curOffset,curCSSLeft,calculatePosition,position=jQuery.css(elem,"position"),curElem=jQuery(elem),props={};"static"===position&&(elem.style.position="relative"),curOffset=curElem.offset(),curCSSTop=jQuery.css(elem,"top"),curCSSLeft=jQuery.css(elem,"left"),calculatePosition=("absolute"===position||"fixed"===position)&&(curCSSTop+curCSSLeft).indexOf("auto")>-1,calculatePosition?(curPosition=curElem.position(),curTop=curPosition.top,curLeft=curPosition.left):(curTop=parseFloat(curCSSTop)||0,curLeft=parseFloat(curCSSLeft)||0),jQuery.isFunction(options)&&(options=options.call(elem,i,jQuery.extend({},curOffset))),null!=options.top&&(props.top=options.top-curOffset.top+curTop),null!=options.left&&(props.left=options.left-curOffset.left+curLeft),"using"in options?options.using.call(elem,props):curElem.css(props)}},jQuery.fn.extend({offset:function(options){if(arguments.length)return void 0===options?this:this.each(function(i){jQuery.offset.setOffset(this,options,i)});var docElem,win,rect,doc,elem=this[0];if(elem)return elem.getClientRects().length?(rect=elem.getBoundingClientRect(),rect.width||rect.height?(doc=elem.ownerDocument,win=getWindow(doc),docElem=doc.documentElement,{top:rect.top+win.pageYOffset-docElem.clientTop,left:rect.left+win.pageXOffset-docElem.clientLeft}):rect):{top:0,left:0}},position:function(){if(this[0]){var offsetParent,offset,elem=this[0],parentOffset={top:0,left:0};return"fixed"===jQuery.css(elem,"position")?offset=elem.getBoundingClientRect():(offsetParent=this.offsetParent(),offset=this.offset(),jQuery.nodeName(offsetParent[0],"html")||(parentOffset=offsetParent.offset()),parentOffset={top:parentOffset.top+jQuery.css(offsetParent[0],"borderTopWidth",!0),
left:parentOffset.left+jQuery.css(offsetParent[0],"borderLeftWidth",!0)}),{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",!0),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var offsetParent=this.offsetParent;offsetParent&&"static"===jQuery.css(offsetParent,"position");)offsetParent=offsetParent.offsetParent;return offsetParent||documentElement})}}),jQuery.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(method,prop){var top="pageYOffset"===prop;jQuery.fn[method]=function(val){return access(this,function(elem,method,val){var win=getWindow(elem);return void 0===val?win?win[prop]:elem[method]:void(win?win.scrollTo(top?win.pageXOffset:val,top?val:win.pageYOffset):elem[method]=val)},method,val,arguments.length)}}),jQuery.each(["top","left"],function(i,prop){jQuery.cssHooks[prop]=addGetHookIf(support.pixelPosition,function(elem,computed){if(computed)return computed=curCSS(elem,prop),rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed})}),jQuery.each({Height:"height",Width:"width"},function(name,type){jQuery.each({padding:"inner"+name,content:type,"":"outer"+name},function(defaultExtra,funcName){jQuery.fn[funcName]=function(margin,value){var chainable=arguments.length&&(defaultExtra||"boolean"!=typeof margin),extra=defaultExtra||(margin===!0||value===!0?"margin":"border");return access(this,function(elem,type,value){var doc;return jQuery.isWindow(elem)?0===funcName.indexOf("outer")?elem["inner"+name]:elem.document.documentElement["client"+name]:9===elem.nodeType?(doc=elem.documentElement,Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc["offset"+name],doc["client"+name])):void 0===value?jQuery.css(elem,type,extra):jQuery.style(elem,type,value,extra)},type,chainable?margin:void 0,chainable)}})}),jQuery.fn.extend({bind:function(types,data,fn){return this.on(types,null,data,fn)},unbind:function(types,fn){return this.off(types,null,fn)},delegate:function(selector,types,data,fn){return this.on(types,selector,data,fn)},undelegate:function(selector,types,fn){return 1===arguments.length?this.off(selector,"**"):this.off(types,selector||"**",fn)}}),jQuery.parseJSON=JSON.parse,"function"==typeof define&&define.amd&&define("jquery",[],function(){return jQuery});var _jQuery=window.jQuery,_$=window.$;return jQuery.noConflict=function(deep){return window.$===jQuery&&(window.$=_$),deep&&window.jQuery===jQuery&&(window.jQuery=_jQuery),jQuery},noGlobal||(window.jQuery=window.$=jQuery),jQuery}),function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):factory(jQuery)}(function($){function visible(element){for(var visibility=element.css("visibility");"inherit"===visibility;)element=element.parent(),visibility=element.css("visibility");return"hidden"!==visibility}$.ui=$.ui||{};var widgetUuid=($.ui.version="1.12.1",0),widgetSlice=Array.prototype.slice;$.cleanData=function(orig){return function(elems){var events,elem,i;for(i=0;null!=(elem=elems[i]);i++)try{events=$._data(elem,"events"),events&&events.remove&&$(elem).triggerHandler("remove")}catch(e){}orig(elems)}}($.cleanData),$.widget=function(name,base,prototype){var existingConstructor,constructor,basePrototype,proxiedPrototype={},namespace=name.split(".")[0];name=name.split(".")[1];var fullName=namespace+"-"+name;return prototype||(prototype=base,base=$.Widget),$.isArray(prototype)&&(prototype=$.extend.apply(null,[{}].concat(prototype))),$.expr[":"][fullName.toLowerCase()]=function(elem){return!!$.data(elem,fullName)},$[namespace]=$[namespace]||{},existingConstructor=$[namespace][name],constructor=$[namespace][name]=function(options,element){return this._createWidget?void(arguments.length&&this._createWidget(options,element)):new constructor(options,element)},$.extend(constructor,existingConstructor,{version:prototype.version,_proto:$.extend({},prototype),_childConstructors:[]}),basePrototype=new base,basePrototype.options=$.widget.extend({},basePrototype.options),$.each(prototype,function(prop,value){return $.isFunction(value)?void(proxiedPrototype[prop]=function(){function _super(){return base.prototype[prop].apply(this,arguments)}function _superApply(args){return base.prototype[prop].apply(this,args)}return function(){var returnValue,__super=this._super,__superApply=this._superApply;return this._super=_super,this._superApply=_superApply,returnValue=value.apply(this,arguments),this._super=__super,this._superApply=__superApply,returnValue}}()):void(proxiedPrototype[prop]=value)}),constructor.prototype=$.widget.extend(basePrototype,{widgetEventPrefix:existingConstructor?basePrototype.widgetEventPrefix||name:name},proxiedPrototype,{constructor:constructor,namespace:namespace,widgetName:name,widgetFullName:fullName}),existingConstructor?($.each(existingConstructor._childConstructors,function(i,child){var childPrototype=child.prototype;$.widget(childPrototype.namespace+"."+childPrototype.widgetName,constructor,child._proto)}),delete existingConstructor._childConstructors):base._childConstructors.push(constructor),$.widget.bridge(name,constructor),constructor},$.widget.extend=function(target){for(var key,value,input=widgetSlice.call(arguments,1),inputIndex=0,inputLength=input.length;inputIndex<inputLength;inputIndex++)for(key in input[inputIndex])value=input[inputIndex][key],input[inputIndex].hasOwnProperty(key)&&void 0!==value&&($.isPlainObject(value)?target[key]=$.isPlainObject(target[key])?$.widget.extend({},target[key],value):$.widget.extend({},value):target[key]=value);return target},$.widget.bridge=function(name,object){var fullName=object.prototype.widgetFullName||name;$.fn[name]=function(options){var isMethodCall="string"==typeof options,args=widgetSlice.call(arguments,1),returnValue=this;return isMethodCall?this.length||"instance"!==options?this.each(function(){var methodValue,instance=$.data(this,fullName);return"instance"===options?(returnValue=instance,!1):instance?$.isFunction(instance[options])&&"_"!==options.charAt(0)?(methodValue=instance[options].apply(instance,args),methodValue!==instance&&void 0!==methodValue?(returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue,!1):void 0):$.error("no such method '"+options+"' for "+name+" widget instance"):$.error("cannot call methods on "+name+" prior to initialization; attempted to call method '"+options+"'")}):returnValue=void 0:(args.length&&(options=$.widget.extend.apply(null,[options].concat(args))),this.each(function(){var instance=$.data(this,fullName);instance?(instance.option(options||{}),instance._init&&instance._init()):$.data(this,fullName,new object(options,this))})),returnValue}},$.Widget=function(){},$.Widget._childConstructors=[],$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(options,element){element=$(element||this.defaultElement||this)[0],this.element=$(element),this.uuid=widgetUuid++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=$(),this.hoverable=$(),this.focusable=$(),this.classesElementLookup={},element!==this&&($.data(element,this.widgetFullName,this),this._on(!0,this.element,{remove:function(event){event.target===element&&this.destroy()}}),this.document=$(element.style?element.ownerDocument:element.document||element),this.window=$(this.document[0].defaultView||this.document[0].parentWindow)),this.options=$.widget.extend({},this.options,this._getCreateOptions(),options),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:$.noop,_create:$.noop,_init:$.noop,destroy:function(){var that=this;this._destroy(),$.each(this.classesElementLookup,function(key,value){that._removeClass(value,key)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:$.noop,widget:function(){return this.element},option:function(key,value){var parts,curOption,i,options=key;if(0===arguments.length)return $.widget.extend({},this.options);if("string"==typeof key)if(options={},parts=key.split("."),key=parts.shift(),parts.length){for(curOption=options[key]=$.widget.extend({},this.options[key]),i=0;i<parts.length-1;i++)curOption[parts[i]]=curOption[parts[i]]||{},curOption=curOption[parts[i]];if(key=parts.pop(),1===arguments.length)return void 0===curOption[key]?null:curOption[key];curOption[key]=value}else{if(1===arguments.length)return void 0===this.options[key]?null:this.options[key];options[key]=value}return this._setOptions(options),this},_setOptions:function(options){var key;for(key in options)this._setOption(key,options[key]);return this},_setOption:function(key,value){return"classes"===key&&this._setOptionClasses(value),this.options[key]=value,"disabled"===key&&this._setOptionDisabled(value),this},_setOptionClasses:function(value){var classKey,elements,currentElements;for(classKey in value)currentElements=this.classesElementLookup[classKey],value[classKey]!==this.options.classes[classKey]&&currentElements&&currentElements.length&&(elements=$(currentElements.get()),this._removeClass(currentElements,classKey),elements.addClass(this._classes({element:elements,keys:classKey,classes:value,add:!0})))},_setOptionDisabled:function(value){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!value),value&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(options){function processClassString(classes,checkOption){var current,i;for(i=0;i<classes.length;i++)current=that.classesElementLookup[classes[i]]||$(),current=$(options.add?$.unique(current.get().concat(options.element.get())):current.not(options.element).get()),that.classesElementLookup[classes[i]]=current,full.push(classes[i]),checkOption&&options.classes[classes[i]]&&full.push(options.classes[classes[i]])}var full=[],that=this;return options=$.extend({element:this.element,classes:this.options.classes||{}},options),this._on(options.element,{remove:"_untrackClassesElement"}),options.keys&&processClassString(options.keys.match(/\S+/g)||[],!0),options.extra&&processClassString(options.extra.match(/\S+/g)||[]),full.join(" ")},_untrackClassesElement:function(event){var that=this;$.each(that.classesElementLookup,function(key,value){$.inArray(event.target,value)!==-1&&(that.classesElementLookup[key]=$(value.not(event.target).get()))})},_removeClass:function(element,keys,extra){return this._toggleClass(element,keys,extra,!1)},_addClass:function(element,keys,extra){return this._toggleClass(element,keys,extra,!0)},_toggleClass:function(element,keys,extra,add){add="boolean"==typeof add?add:extra;var shift="string"==typeof element||null===element,options={extra:shift?keys:extra,keys:shift?element:keys,element:shift?this.element:element,add:add};return options.element.toggleClass(this._classes(options),add),this},_on:function(suppressDisabledCheck,element,handlers){var delegateElement,instance=this;"boolean"!=typeof suppressDisabledCheck&&(handlers=element,element=suppressDisabledCheck,suppressDisabledCheck=!1),handlers?(element=delegateElement=$(element),this.bindings=this.bindings.add(element)):(handlers=element,element=this.element,delegateElement=this.widget()),$.each(handlers,function(event,handler){function handlerProxy(){if(suppressDisabledCheck||instance.options.disabled!==!0&&!$(this).hasClass("ui-state-disabled"))return("string"==typeof handler?instance[handler]:handler).apply(instance,arguments)}"string"!=typeof handler&&(handlerProxy.guid=handler.guid=handler.guid||handlerProxy.guid||$.guid++);var match=event.match(/^([\w:-]*)\s*(.*)$/),eventName=match[1]+instance.eventNamespace,selector=match[2];selector?delegateElement.on(eventName,selector,handlerProxy):element.on(eventName,handlerProxy)})},_off:function(element,eventName){eventName=(eventName||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,element.off(eventName).off(eventName),this.bindings=$(this.bindings.not(element).get()),this.focusable=$(this.focusable.not(element).get()),this.hoverable=$(this.hoverable.not(element).get())},_delay:function(handler,delay){function handlerProxy(){return("string"==typeof handler?instance[handler]:handler).apply(instance,arguments)}var instance=this;return setTimeout(handlerProxy,delay||0)},_hoverable:function(element){this.hoverable=this.hoverable.add(element),this._on(element,{mouseenter:function(event){this._addClass($(event.currentTarget),null,"ui-state-hover")},mouseleave:function(event){this._removeClass($(event.currentTarget),null,"ui-state-hover")}})},_focusable:function(element){this.focusable=this.focusable.add(element),this._on(element,{focusin:function(event){this._addClass($(event.currentTarget),null,"ui-state-focus")},focusout:function(event){this._removeClass($(event.currentTarget),null,"ui-state-focus")}})},_trigger:function(type,event,data){var prop,orig,callback=this.options[type];if(data=data||{},event=$.Event(event),event.type=(type===this.widgetEventPrefix?type:this.widgetEventPrefix+type).toLowerCase(),event.target=this.element[0],orig=event.originalEvent)for(prop in orig)prop in event||(event[prop]=orig[prop]);return this.element.trigger(event,data),!($.isFunction(callback)&&callback.apply(this.element[0],[event].concat(data))===!1||event.isDefaultPrevented())}},$.each({show:"fadeIn",hide:"fadeOut"},function(method,defaultEffect){$.Widget.prototype["_"+method]=function(element,options,callback){"string"==typeof options&&(options={effect:options});var hasOptions,effectName=options?options===!0||"number"==typeof options?defaultEffect:options.effect||defaultEffect:method;options=options||{},"number"==typeof options&&(options={duration:options}),hasOptions=!$.isEmptyObject(options),options.complete=callback,options.delay&&element.delay(options.delay),hasOptions&&$.effects&&$.effects.effect[effectName]?element[method](options):effectName!==method&&element[effectName]?element[effectName](options.duration,options.easing,callback):element.queue(function(next){$(this)[method](),callback&&callback.call(element[0]),next()})}});$.widget;!function(){function getOffsets(offsets,width,height){return[parseFloat(offsets[0])*(rpercent.test(offsets[0])?width/100:1),parseFloat(offsets[1])*(rpercent.test(offsets[1])?height/100:1)]}function parseCss(element,property){return parseInt($.css(element,property),10)||0}function getDimensions(elem){var raw=elem[0];return 9===raw.nodeType?{width:elem.width(),height:elem.height(),offset:{top:0,left:0}}:$.isWindow(raw)?{width:elem.width(),height:elem.height(),offset:{top:elem.scrollTop(),left:elem.scrollLeft()}}:raw.preventDefault?{width:0,height:0,offset:{top:raw.pageY,left:raw.pageX}}:{width:elem.outerWidth(),height:elem.outerHeight(),offset:elem.offset()}}var cachedScrollbarWidth,max=Math.max,abs=Math.abs,rhorizontal=/left|center|right/,rvertical=/top|center|bottom/,roffset=/[\+\-]\d+(\.[\d]+)?%?/,rposition=/^\w+/,rpercent=/%$/,_position=$.fn.position;$.position={scrollbarWidth:function(){if(void 0!==cachedScrollbarWidth)return cachedScrollbarWidth;var w1,w2,div=$("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),innerDiv=div.children()[0];return $("body").append(div),w1=innerDiv.offsetWidth,div.css("overflow","scroll"),w2=innerDiv.offsetWidth,w1===w2&&(w2=div[0].clientWidth),div.remove(),cachedScrollbarWidth=w1-w2},getScrollInfo:function(within){var overflowX=within.isWindow||within.isDocument?"":within.element.css("overflow-x"),overflowY=within.isWindow||within.isDocument?"":within.element.css("overflow-y"),hasOverflowX="scroll"===overflowX||"auto"===overflowX&&within.width<within.element[0].scrollWidth,hasOverflowY="scroll"===overflowY||"auto"===overflowY&&within.height<within.element[0].scrollHeight;return{width:hasOverflowY?$.position.scrollbarWidth():0,height:hasOverflowX?$.position.scrollbarWidth():0}},getWithinInfo:function(element){var withinElement=$(element||window),isWindow=$.isWindow(withinElement[0]),isDocument=!!withinElement[0]&&9===withinElement[0].nodeType,hasOffset=!isWindow&&!isDocument;return{element:withinElement,isWindow:isWindow,isDocument:isDocument,offset:hasOffset?$(element).offset():{left:0,top:0},scrollLeft:withinElement.scrollLeft(),scrollTop:withinElement.scrollTop(),width:withinElement.outerWidth(),height:withinElement.outerHeight()}}},$.fn.position=function(options){if(!options||!options.of)return _position.apply(this,arguments);options=$.extend({},options);var atOffset,targetWidth,targetHeight,targetOffset,basePosition,dimensions,target=$(options.of),within=$.position.getWithinInfo(options.within),scrollInfo=$.position.getScrollInfo(within),collision=(options.collision||"flip").split(" "),offsets={};return dimensions=getDimensions(target),target[0].preventDefault&&(options.at="left top"),targetWidth=dimensions.width,targetHeight=dimensions.height,targetOffset=dimensions.offset,basePosition=$.extend({},targetOffset),$.each(["my","at"],function(){var horizontalOffset,verticalOffset,pos=(options[this]||"").split(" ");1===pos.length&&(pos=rhorizontal.test(pos[0])?pos.concat(["center"]):rvertical.test(pos[0])?["center"].concat(pos):["center","center"]),pos[0]=rhorizontal.test(pos[0])?pos[0]:"center",pos[1]=rvertical.test(pos[1])?pos[1]:"center",horizontalOffset=roffset.exec(pos[0]),verticalOffset=roffset.exec(pos[1]),offsets[this]=[horizontalOffset?horizontalOffset[0]:0,verticalOffset?verticalOffset[0]:0],options[this]=[rposition.exec(pos[0])[0],rposition.exec(pos[1])[0]]}),1===collision.length&&(collision[1]=collision[0]),"right"===options.at[0]?basePosition.left+=targetWidth:"center"===options.at[0]&&(basePosition.left+=targetWidth/2),"bottom"===options.at[1]?basePosition.top+=targetHeight:"center"===options.at[1]&&(basePosition.top+=targetHeight/2),atOffset=getOffsets(offsets.at,targetWidth,targetHeight),basePosition.left+=atOffset[0],basePosition.top+=atOffset[1],this.each(function(){var collisionPosition,using,elem=$(this),elemWidth=elem.outerWidth(),elemHeight=elem.outerHeight(),marginLeft=parseCss(this,"marginLeft"),marginTop=parseCss(this,"marginTop"),collisionWidth=elemWidth+marginLeft+parseCss(this,"marginRight")+scrollInfo.width,collisionHeight=elemHeight+marginTop+parseCss(this,"marginBottom")+scrollInfo.height,position=$.extend({},basePosition),myOffset=getOffsets(offsets.my,elem.outerWidth(),elem.outerHeight());"right"===options.my[0]?position.left-=elemWidth:"center"===options.my[0]&&(position.left-=elemWidth/2),"bottom"===options.my[1]?position.top-=elemHeight:"center"===options.my[1]&&(position.top-=elemHeight/2),position.left+=myOffset[0],position.top+=myOffset[1],collisionPosition={marginLeft:marginLeft,marginTop:marginTop},$.each(["left","top"],function(i,dir){$.ui.position[collision[i]]&&$.ui.position[collision[i]][dir](position,{targetWidth:targetWidth,targetHeight:targetHeight,elemWidth:elemWidth,elemHeight:elemHeight,collisionPosition:collisionPosition,collisionWidth:collisionWidth,collisionHeight:collisionHeight,offset:[atOffset[0]+myOffset[0],atOffset[1]+myOffset[1]],my:options.my,at:options.at,within:within,elem:elem})}),options.using&&(using=function(props){var left=targetOffset.left-position.left,right=left+targetWidth-elemWidth,top=targetOffset.top-position.top,bottom=top+targetHeight-elemHeight,feedback={target:{element:target,left:targetOffset.left,top:targetOffset.top,width:targetWidth,height:targetHeight},element:{element:elem,left:position.left,top:position.top,width:elemWidth,height:elemHeight},horizontal:right<0?"left":left>0?"right":"center",vertical:bottom<0?"top":top>0?"bottom":"middle"};targetWidth<elemWidth&&abs(left+right)<targetWidth&&(feedback.horizontal="center"),targetHeight<elemHeight&&abs(top+bottom)<targetHeight&&(feedback.vertical="middle"),max(abs(left),abs(right))>max(abs(top),abs(bottom))?feedback.important="horizontal":feedback.important="vertical",options.using.call(this,props,feedback)}),elem.offset($.extend(position,{using:using}))})},$.ui.position={fit:{left:function(position,data){var newOverRight,within=data.within,withinOffset=within.isWindow?within.scrollLeft:within.offset.left,outerWidth=within.width,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=withinOffset-collisionPosLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-withinOffset;data.collisionWidth>outerWidth?overLeft>0&&overRight<=0?(newOverRight=position.left+overLeft+data.collisionWidth-outerWidth-withinOffset,position.left+=overLeft-newOverRight):overRight>0&&overLeft<=0?position.left=withinOffset:overLeft>overRight?position.left=withinOffset+outerWidth-data.collisionWidth:position.left=withinOffset:overLeft>0?position.left+=overLeft:overRight>0?position.left-=overRight:position.left=max(position.left-collisionPosLeft,position.left)},top:function(position,data){var newOverBottom,within=data.within,withinOffset=within.isWindow?within.scrollTop:within.offset.top,outerHeight=data.within.height,collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=withinOffset-collisionPosTop,overBottom=collisionPosTop+data.collisionHeight-outerHeight-withinOffset;data.collisionHeight>outerHeight?overTop>0&&overBottom<=0?(newOverBottom=position.top+overTop+data.collisionHeight-outerHeight-withinOffset,position.top+=overTop-newOverBottom):overBottom>0&&overTop<=0?position.top=withinOffset:overTop>overBottom?position.top=withinOffset+outerHeight-data.collisionHeight:position.top=withinOffset:overTop>0?position.top+=overTop:overBottom>0?position.top-=overBottom:position.top=max(position.top-collisionPosTop,position.top)}},flip:{left:function(position,data){var newOverRight,newOverLeft,within=data.within,withinOffset=within.offset.left+within.scrollLeft,outerWidth=within.width,offsetLeft=within.isWindow?within.scrollLeft:within.offset.left,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=collisionPosLeft-offsetLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-offsetLeft,myOffset="left"===data.my[0]?-data.elemWidth:"right"===data.my[0]?data.elemWidth:0,atOffset="left"===data.at[0]?data.targetWidth:"right"===data.at[0]?-data.targetWidth:0,offset=-2*data.offset[0];overLeft<0?(newOverRight=position.left+myOffset+atOffset+offset+data.collisionWidth-outerWidth-withinOffset,(newOverRight<0||newOverRight<abs(overLeft))&&(position.left+=myOffset+atOffset+offset)):overRight>0&&(newOverLeft=position.left-data.collisionPosition.marginLeft+myOffset+atOffset+offset-offsetLeft,(newOverLeft>0||abs(newOverLeft)<overRight)&&(position.left+=myOffset+atOffset+offset))},top:function(position,data){var newOverTop,newOverBottom,within=data.within,withinOffset=within.offset.top+within.scrollTop,outerHeight=within.height,offsetTop=within.isWindow?within.scrollTop:within.offset.top,collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=collisionPosTop-offsetTop,overBottom=collisionPosTop+data.collisionHeight-outerHeight-offsetTop,top="top"===data.my[1],myOffset=top?-data.elemHeight:"bottom"===data.my[1]?data.elemHeight:0,atOffset="top"===data.at[1]?data.targetHeight:"bottom"===data.at[1]?-data.targetHeight:0,offset=-2*data.offset[1];overTop<0?(newOverBottom=position.top+myOffset+atOffset+offset+data.collisionHeight-outerHeight-withinOffset,(newOverBottom<0||newOverBottom<abs(overTop))&&(position.top+=myOffset+atOffset+offset)):overBottom>0&&(newOverTop=position.top-data.collisionPosition.marginTop+myOffset+atOffset+offset-offsetTop,(newOverTop>0||abs(newOverTop)<overBottom)&&(position.top+=myOffset+atOffset+offset))}},flipfit:{left:function(){$.ui.position.flip.left.apply(this,arguments),$.ui.position.fit.left.apply(this,arguments)},top:function(){$.ui.position.flip.top.apply(this,arguments),$.ui.position.fit.top.apply(this,arguments)}}}}();$.ui.position,$.extend($.expr[":"],{data:$.expr.createPseudo?$.expr.createPseudo(function(dataName){return function(elem){return!!$.data(elem,dataName)}}):function(elem,i,match){return!!$.data(elem,match[3])}}),$.fn.extend({disableSelection:function(){var eventType="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(eventType+".ui-disableSelection",function(event){event.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}});$.ui.focusable=function(element,hasTabindex){var map,mapName,img,focusableIfVisible,fieldset,nodeName=element.nodeName.toLowerCase();return"area"===nodeName?(map=element.parentNode,mapName=map.name,!(!element.href||!mapName||"map"!==map.nodeName.toLowerCase())&&(img=$("img[usemap='#"+mapName+"']"),img.length>0&&img.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(nodeName)?(focusableIfVisible=!element.disabled,focusableIfVisible&&(fieldset=$(element).closest("fieldset")[0],fieldset&&(focusableIfVisible=!fieldset.disabled))):focusableIfVisible="a"===nodeName?element.href||hasTabindex:hasTabindex,focusableIfVisible&&$(element).is(":visible")&&visible($(element)))},$.extend($.expr[":"],{focusable:function(element){return $.ui.focusable(element,null!=$.attr(element,"tabindex"))}});var mouseHandled=($.ui.focusable,$.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):$(this[0].form)},$.ui.formResetMixin={_formResetHandler:function(){var form=$(this);setTimeout(function(){var instances=form.data("ui-form-reset-instances");$.each(instances,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var instances=this.form.data("ui-form-reset-instances")||[];instances.length||this.form.on("reset.ui-form-reset",this._formResetHandler),instances.push(this),this.form.data("ui-form-reset-instances",instances)}},_unbindFormResetHandler:function(){if(this.form.length){var instances=this.form.data("ui-form-reset-instances");instances.splice($.inArray(this,instances),1),instances.length?this.form.data("ui-form-reset-instances",instances):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},$.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},$.ui.escapeSelector=function(){var selectorEscape=/([!"#$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g;return function(selector){return selector.replace(selectorEscape,"\\$1")}}(),$.fn.labels=function(){var ancestor,selector,id,labels,ancestors;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(labels=this.eq(0).parents("label"),id=this.attr("id"),id&&(ancestor=this.eq(0).parents().last(),ancestors=ancestor.add(ancestor.length?ancestor.siblings():this.siblings()),selector="label[for='"+$.ui.escapeSelector(id)+"']",labels=labels.add(ancestors.find(selector).addBack(selector))),this.pushStack(labels))},$.fn.scrollParent=function(includeHidden){var position=this.css("position"),excludeStaticParent="absolute"===position,overflowRegex=includeHidden?/(auto|scroll|hidden)/:/(auto|scroll)/,scrollParent=this.parents().filter(function(){var parent=$(this);return(!excludeStaticParent||"static"!==parent.css("position"))&&overflowRegex.test(parent.css("overflow")+parent.css("overflow-y")+parent.css("overflow-x"))}).eq(0);return"fixed"!==position&&scrollParent.length?scrollParent:$(this[0].ownerDocument||document)},$.extend($.expr[":"],{tabbable:function(element){var tabIndex=$.attr(element,"tabindex"),hasTabindex=null!=tabIndex;return(!hasTabindex||tabIndex>=0)&&$.ui.focusable(element,hasTabindex)}}),$.fn.extend({uniqueId:function(){var uuid=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++uuid)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&$(this).removeAttr("id")})}}),$.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),!1);$(document).on("mouseup",function(){mouseHandled=!1});$.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var that=this;this.element.on("mousedown."+this.widgetName,function(event){return that._mouseDown(event)}).on("click."+this.widgetName,function(event){if(!0===$.data(event.target,that.widgetName+".preventClickEvent"))return $.removeData(event.target,that.widgetName+".preventClickEvent"),event.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(event){if(!mouseHandled){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(event),this._mouseDownEvent=event;var that=this,btnIsLeft=1===event.which,elIsCancel=!("string"!=typeof this.options.cancel||!event.target.nodeName)&&$(event.target).closest(this.options.cancel).length;return!(btnIsLeft&&!elIsCancel&&this._mouseCapture(event))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){that.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(event)&&this._mouseDelayMet(event)&&(this._mouseStarted=this._mouseStart(event)!==!1,!this._mouseStarted)?(event.preventDefault(),!0):(!0===$.data(event.target,this.widgetName+".preventClickEvent")&&$.removeData(event.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(event){return that._mouseMove(event)},this._mouseUpDelegate=function(event){return that._mouseUp(event)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),event.preventDefault(),mouseHandled=!0,!0))}},_mouseMove:function(event){if(this._mouseMoved){if($.ui.ie&&(!document.documentMode||document.documentMode<9)&&!event.button)return this._mouseUp(event);if(!event.which)if(event.originalEvent.altKey||event.originalEvent.ctrlKey||event.originalEvent.metaKey||event.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(event)}return(event.which||event.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(event),event.preventDefault()):(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,event)!==!1,this._mouseStarted?this._mouseDrag(event):this._mouseUp(event)),!this._mouseStarted)},_mouseUp:function(event){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,event.target===this._mouseDownEvent.target&&$.data(event.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(event)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,mouseHandled=!1,event.preventDefault()},_mouseDistanceMet:function(event){return Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),$.ui.plugin={add:function(module,option,set){var i,proto=$.ui[module].prototype;for(i in set)proto.plugins[i]=proto.plugins[i]||[],proto.plugins[i].push([option,set[i]])},call:function(instance,name,args,allowDisconnected){var i,set=instance.plugins[name];if(set&&(allowDisconnected||instance.element[0].parentNode&&11!==instance.element[0].parentNode.nodeType))for(i=0;i<set.length;i++)instance.options[set[i][0]]&&set[i][1].apply(instance.element,args);
}},$.ui.safeActiveElement=function(document){var activeElement;try{activeElement=document.activeElement}catch(error){activeElement=document.body}return activeElement||(activeElement=document.body),activeElement.nodeName||(activeElement=document.body),activeElement},$.ui.safeBlur=function(element){element&&"body"!==element.nodeName.toLowerCase()&&$(element).trigger("blur")};$.widget("ui.draggable",$.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(key,value){this._super(key,value),"handle"===key&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?void(this.destroyOnClear=!0):(this._removeHandleClassName(),void this._mouseDestroy())},_mouseCapture:function(event){var o=this.options;return!(this.helper||o.disabled||$(event.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(event),!!this.handle&&(this._blurActiveElement(event),this._blockFrames(o.iframeFix===!0?"iframe":o.iframeFix),!0))},_blockFrames:function(selector){this.iframeBlocks=this.document.find(selector).map(function(){var iframe=$(this);return $("<div>").css("position","absolute").appendTo(iframe.parent()).outerWidth(iframe.outerWidth()).outerHeight(iframe.outerHeight()).offset(iframe.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(event){var activeElement=$.ui.safeActiveElement(this.document[0]),target=$(event.target);target.closest(activeElement).length||$.ui.safeBlur(activeElement)},_mouseStart:function(event){var o=this.options;return this.helper=this._createHelper(event),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),$.ui.ddmanager&&($.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===$(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(event),this.originalPosition=this.position=this._generatePosition(event,!1),this.originalPageX=event.pageX,this.originalPageY=event.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this._setContainment(),this._trigger("start",event)===!1?(this._clear(),!1):(this._cacheHelperProportions(),$.ui.ddmanager&&!o.dropBehaviour&&$.ui.ddmanager.prepareOffsets(this,event),this._mouseDrag(event,!0),$.ui.ddmanager&&$.ui.ddmanager.dragStart(this,event),!0)},_refreshOffsets:function(event){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:event.pageX-this.offset.left,top:event.pageY-this.offset.top}},_mouseDrag:function(event,noPropagation){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(event,!0),this.positionAbs=this._convertPositionTo("absolute"),!noPropagation){var ui=this._uiHash();if(this._trigger("drag",event,ui)===!1)return this._mouseUp(new $.Event("mouseup",event)),!1;this.position=ui.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",$.ui.ddmanager&&$.ui.ddmanager.drag(this,event),!1},_mouseStop:function(event){var that=this,dropped=!1;return $.ui.ddmanager&&!this.options.dropBehaviour&&(dropped=$.ui.ddmanager.drop(this,event)),this.dropped&&(dropped=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!dropped||"valid"===this.options.revert&&dropped||this.options.revert===!0||$.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped)?$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){that._trigger("stop",event)!==!1&&that._clear()}):this._trigger("stop",event)!==!1&&this._clear(),!1},_mouseUp:function(event){return this._unblockFrames(),$.ui.ddmanager&&$.ui.ddmanager.dragStop(this,event),this.handleElement.is(event.target)&&this.element.trigger("focus"),$.ui.mouse.prototype._mouseUp.call(this,event)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new $.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(event){return!this.options.handle||!!$(event.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(event){var o=this.options,helperIsFunction=$.isFunction(o.helper),helper=helperIsFunction?$(o.helper.apply(this.element[0],[event])):"clone"===o.helper?this.element.clone().removeAttr("id"):this.element;return helper.parents("body").length||helper.appendTo("parent"===o.appendTo?this.element[0].parentNode:o.appendTo),helperIsFunction&&helper[0]===this.element[0]&&this._setPositionRelative(),helper[0]===this.element[0]||/(fixed|absolute)/.test(helper.css("position"))||helper.css("position","absolute"),helper},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(obj){"string"==typeof obj&&(obj=obj.split(" ")),$.isArray(obj)&&(obj={left:+obj[0],top:+obj[1]||0}),"left"in obj&&(this.offset.click.left=obj.left+this.margins.left),"right"in obj&&(this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left),"top"in obj&&(this.offset.click.top=obj.top+this.margins.top),"bottom"in obj&&(this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top)},_isRootNode:function(element){return/(html|body)/i.test(element.tagName)||element===this.document[0]},_getParentOffset:function(){var po=this.offsetParent.offset(),document=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])&&(po.left+=this.scrollParent.scrollLeft(),po.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(po={top:0,left:0}),{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var p=this.element.position(),scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+(scrollIsRootNode?0:this.scrollParent.scrollTop()),left:p.left-(parseInt(this.helper.css("left"),10)||0)+(scrollIsRootNode?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var isUserScrollable,c,ce,o=this.options,document=this.document[0];return this.relativeContainer=null,o.containment?"window"===o.containment?void(this.containment=[$(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,$(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,$(window).scrollLeft()+$(window).width()-this.helperProportions.width-this.margins.left,$(window).scrollTop()+($(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===o.containment?void(this.containment=[0,0,$(document).width()-this.helperProportions.width-this.margins.left,($(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):o.containment.constructor===Array?void(this.containment=o.containment):("parent"===o.containment&&(o.containment=this.helper[0].parentNode),c=$(o.containment),ce=c[0],void(ce&&(isUserScrollable=/(scroll|auto)/.test(c.css("overflow")),this.containment=[(parseInt(c.css("borderLeftWidth"),10)||0)+(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),10)||0)+(parseInt(c.css("paddingTop"),10)||0),(isUserScrollable?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt(c.css("borderRightWidth"),10)||0)-(parseInt(c.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(isUserScrollable?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt(c.css("borderBottomWidth"),10)||0)-(parseInt(c.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=c))):void(this.containment=null)},_convertPositionTo:function(d,pos){pos||(pos=this.position);var mod="absolute"===d?1:-1,scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{top:pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-("fixed"===this.cssPosition?-this.offset.scroll.top:scrollIsRootNode?0:this.offset.scroll.top)*mod,left:pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-("fixed"===this.cssPosition?-this.offset.scroll.left:scrollIsRootNode?0:this.offset.scroll.left)*mod}},_generatePosition:function(event,constrainPosition){var containment,co,top,left,o=this.options,scrollIsRootNode=this._isRootNode(this.scrollParent[0]),pageX=event.pageX,pageY=event.pageY;return scrollIsRootNode&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),constrainPosition&&(this.containment&&(this.relativeContainer?(co=this.relativeContainer.offset(),containment=[this.containment[0]+co.left,this.containment[1]+co.top,this.containment[2]+co.left,this.containment[3]+co.top]):containment=this.containment,event.pageX-this.offset.click.left<containment[0]&&(pageX=containment[0]+this.offset.click.left),event.pageY-this.offset.click.top<containment[1]&&(pageY=containment[1]+this.offset.click.top),event.pageX-this.offset.click.left>containment[2]&&(pageX=containment[2]+this.offset.click.left),event.pageY-this.offset.click.top>containment[3]&&(pageY=containment[3]+this.offset.click.top)),o.grid&&(top=o.grid[1]?this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,pageY=containment?top-this.offset.click.top>=containment[1]||top-this.offset.click.top>containment[3]?top:top-this.offset.click.top>=containment[1]?top-o.grid[1]:top+o.grid[1]:top,left=o.grid[0]?this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,pageX=containment?left-this.offset.click.left>=containment[0]||left-this.offset.click.left>containment[2]?left:left-this.offset.click.left>=containment[0]?left-o.grid[0]:left+o.grid[0]:left),"y"===o.axis&&(pageX=this.originalPageX),"x"===o.axis&&(pageY=this.originalPageY)),{top:pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:scrollIsRootNode?0:this.offset.scroll.top),left:pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:scrollIsRootNode?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(type,event,ui){return ui=ui||this._uiHash(),$.ui.plugin.call(this,type,[event,ui,this],!0),/^(drag|start|stop)/.test(type)&&(this.positionAbs=this._convertPositionTo("absolute"),ui.offset=this.positionAbs),$.Widget.prototype._trigger.call(this,type,event,ui)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),$.ui.plugin.add("draggable","connectToSortable",{start:function(event,ui,draggable){var uiSortable=$.extend({},ui,{item:draggable.element});draggable.sortables=[],$(draggable.options.connectToSortable).each(function(){var sortable=$(this).sortable("instance");sortable&&!sortable.options.disabled&&(draggable.sortables.push(sortable),sortable.refreshPositions(),sortable._trigger("activate",event,uiSortable))})},stop:function(event,ui,draggable){var uiSortable=$.extend({},ui,{item:draggable.element});draggable.cancelHelperRemoval=!1,$.each(draggable.sortables,function(){var sortable=this;sortable.isOver?(sortable.isOver=0,draggable.cancelHelperRemoval=!0,sortable.cancelHelperRemoval=!1,sortable._storedCSS={position:sortable.placeholder.css("position"),top:sortable.placeholder.css("top"),left:sortable.placeholder.css("left")},sortable._mouseStop(event),sortable.options.helper=sortable.options._helper):(sortable.cancelHelperRemoval=!0,sortable._trigger("deactivate",event,uiSortable))})},drag:function(event,ui,draggable){$.each(draggable.sortables,function(){var innermostIntersecting=!1,sortable=this;sortable.positionAbs=draggable.positionAbs,sortable.helperProportions=draggable.helperProportions,sortable.offset.click=draggable.offset.click,sortable._intersectsWith(sortable.containerCache)&&(innermostIntersecting=!0,$.each(draggable.sortables,function(){return this.positionAbs=draggable.positionAbs,this.helperProportions=draggable.helperProportions,this.offset.click=draggable.offset.click,this!==sortable&&this._intersectsWith(this.containerCache)&&$.contains(sortable.element[0],this.element[0])&&(innermostIntersecting=!1),innermostIntersecting})),innermostIntersecting?(sortable.isOver||(sortable.isOver=1,draggable._parent=ui.helper.parent(),sortable.currentItem=ui.helper.appendTo(sortable.element).data("ui-sortable-item",!0),sortable.options._helper=sortable.options.helper,sortable.options.helper=function(){return ui.helper[0]},event.target=sortable.currentItem[0],sortable._mouseCapture(event,!0),sortable._mouseStart(event,!0,!0),sortable.offset.click.top=draggable.offset.click.top,sortable.offset.click.left=draggable.offset.click.left,sortable.offset.parent.left-=draggable.offset.parent.left-sortable.offset.parent.left,sortable.offset.parent.top-=draggable.offset.parent.top-sortable.offset.parent.top,draggable._trigger("toSortable",event),draggable.dropped=sortable.element,$.each(draggable.sortables,function(){this.refreshPositions()}),draggable.currentItem=draggable.element,sortable.fromOutside=draggable),sortable.currentItem&&(sortable._mouseDrag(event),ui.position=sortable.position)):sortable.isOver&&(sortable.isOver=0,sortable.cancelHelperRemoval=!0,sortable.options._revert=sortable.options.revert,sortable.options.revert=!1,sortable._trigger("out",event,sortable._uiHash(sortable)),sortable._mouseStop(event,!0),sortable.options.revert=sortable.options._revert,sortable.options.helper=sortable.options._helper,sortable.placeholder&&sortable.placeholder.remove(),ui.helper.appendTo(draggable._parent),draggable._refreshOffsets(event),ui.position=draggable._generatePosition(event,!0),draggable._trigger("fromSortable",event),draggable.dropped=!1,$.each(draggable.sortables,function(){this.refreshPositions()}))})}}),$.ui.plugin.add("draggable","cursor",{start:function(event,ui,instance){var t=$("body"),o=instance.options;t.css("cursor")&&(o._cursor=t.css("cursor")),t.css("cursor",o.cursor)},stop:function(event,ui,instance){var o=instance.options;o._cursor&&$("body").css("cursor",o._cursor)}}),$.ui.plugin.add("draggable","opacity",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;t.css("opacity")&&(o._opacity=t.css("opacity")),t.css("opacity",o.opacity)},stop:function(event,ui,instance){var o=instance.options;o._opacity&&$(ui.helper).css("opacity",o._opacity)}}),$.ui.plugin.add("draggable","scroll",{start:function(event,ui,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(event,ui,i){var o=i.options,scrolled=!1,scrollParent=i.scrollParentNotHidden[0],document=i.document[0];scrollParent!==document&&"HTML"!==scrollParent.tagName?(o.axis&&"x"===o.axis||(i.overflowOffset.top+scrollParent.offsetHeight-event.pageY<o.scrollSensitivity?scrollParent.scrollTop=scrolled=scrollParent.scrollTop+o.scrollSpeed:event.pageY-i.overflowOffset.top<o.scrollSensitivity&&(scrollParent.scrollTop=scrolled=scrollParent.scrollTop-o.scrollSpeed)),o.axis&&"y"===o.axis||(i.overflowOffset.left+scrollParent.offsetWidth-event.pageX<o.scrollSensitivity?scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft+o.scrollSpeed:event.pageX-i.overflowOffset.left<o.scrollSensitivity&&(scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft-o.scrollSpeed))):(o.axis&&"x"===o.axis||(event.pageY-$(document).scrollTop()<o.scrollSensitivity?scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed):$(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity&&(scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed))),o.axis&&"y"===o.axis||(event.pageX-$(document).scrollLeft()<o.scrollSensitivity?scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed):$(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity&&(scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed)))),scrolled!==!1&&$.ui.ddmanager&&!o.dropBehaviour&&$.ui.ddmanager.prepareOffsets(i,event)}}),$.ui.plugin.add("draggable","snap",{start:function(event,ui,i){var o=i.options;i.snapElements=[],$(o.snap.constructor!==String?o.snap.items||":data(ui-draggable)":o.snap).each(function(){var $t=$(this),$o=$t.offset();this!==i.element[0]&&i.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left})})},drag:function(event,ui,inst){var ts,bs,ls,rs,l,r,t,b,i,first,o=inst.options,d=o.snapTolerance,x1=ui.offset.left,x2=x1+inst.helperProportions.width,y1=ui.offset.top,y2=y1+inst.helperProportions.height;for(i=inst.snapElements.length-1;i>=0;i--)l=inst.snapElements[i].left-inst.margins.left,r=l+inst.snapElements[i].width,t=inst.snapElements[i].top-inst.margins.top,b=t+inst.snapElements[i].height,x2<l-d||x1>r+d||y2<t-d||y1>b+d||!$.contains(inst.snapElements[i].item.ownerDocument,inst.snapElements[i].item)?(inst.snapElements[i].snapping&&inst.options.snap.release&&inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})),inst.snapElements[i].snapping=!1):("inner"!==o.snapMode&&(ts=Math.abs(t-y2)<=d,bs=Math.abs(b-y1)<=d,ls=Math.abs(l-x2)<=d,rs=Math.abs(r-x1)<=d,ts&&(ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top),bs&&(ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top),ls&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left),rs&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left)),first=ts||bs||ls||rs,"outer"!==o.snapMode&&(ts=Math.abs(t-y1)<=d,bs=Math.abs(b-y2)<=d,ls=Math.abs(l-x1)<=d,rs=Math.abs(r-x2)<=d,ts&&(ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top),bs&&(ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top),ls&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left),rs&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left)),!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first)&&inst.options.snap.snap&&inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})),inst.snapElements[i].snapping=ts||bs||ls||rs||first)}}),$.ui.plugin.add("draggable","stack",{start:function(event,ui,instance){var min,o=instance.options,group=$.makeArray($(o.stack)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||0)-(parseInt($(b).css("zIndex"),10)||0)});group.length&&(min=parseInt($(group[0]).css("zIndex"),10)||0,$(group).each(function(i){$(this).css("zIndex",min+i)}),this.css("zIndex",min+group.length))}}),$.ui.plugin.add("draggable","zIndex",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;t.css("zIndex")&&(o._zIndex=t.css("zIndex")),t.css("zIndex",o.zIndex)},stop:function(event,ui,instance){var o=instance.options;o._zIndex&&$(ui.helper).css("zIndex",o._zIndex)}});$.ui.draggable;$.widget("ui.resizable",$.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(value){return parseFloat(value)||0},_isNumber:function(value){return!isNaN(parseFloat(value))},_hasScroll:function(el,a){if("hidden"===$(el).css("overflow"))return!1;var scroll=a&&"left"===a?"scrollLeft":"scrollTop",has=!1;return el[scroll]>0||(el[scroll]=1,has=el[scroll]>0,el[scroll]=0,has)},_create:function(){var margins,o=this.options,that=this;this._addClass("ui-resizable"),$.extend(this,{_aspectRatio:!!o.aspectRatio,aspectRatio:o.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:o.helper||o.ghost||o.animate?o.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap($("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,margins={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(margins),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(margins),this._proportionallyResize()),this._setupHandles(),o.autoHide&&$(this.element).on("mouseenter",function(){o.disabled||(that._removeClass("ui-resizable-autohide"),that._handles.show())}).on("mouseleave",function(){o.disabled||that.resizing||(that._addClass("ui-resizable-autohide"),that._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var wrapper,_destroy=function(exp){$(exp).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(_destroy(this.element),wrapper=this.element,this.originalElement.css({position:wrapper.css("position"),width:wrapper.outerWidth(),height:wrapper.outerHeight(),top:wrapper.css("top"),left:wrapper.css("left")}).insertAfter(wrapper),wrapper.remove()),this.originalElement.css("resize",this.originalResizeStyle),_destroy(this.originalElement),this},_setOption:function(key,value){switch(this._super(key,value),key){case"handles":this._removeHandles(),this._setupHandles()}},_setupHandles:function(){var handle,i,n,hname,axis,o=this.options,that=this;if(this.handles=o.handles||($(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=$(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),n=this.handles.split(","),this.handles={},i=0;i<n.length;i++)handle=$.trim(n[i]),hname="ui-resizable-"+handle,axis=$("<div>"),this._addClass(axis,"ui-resizable-handle "+hname),axis.css({zIndex:o.zIndex}),this.handles[handle]=".ui-resizable-"+handle,this.element.append(axis);this._renderAxis=function(target){var i,axis,padPos,padWrapper;target=target||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=$(this.handles[i]),this._on(this.handles[i],{mousedown:that._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(axis=$(this.handles[i],this.element),padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth(),padPos=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),target.css(padPos,padWrapper),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){that.resizing||(this.className&&(axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),that.axis=axis&&axis[1]?axis[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(event){var i,handle,capture=!1;for(i in this.handles)handle=$(this.handles[i])[0],(handle===event.target||$.contains(handle,event.target))&&(capture=!0);return!this.options.disabled&&capture},_mouseStart:function(event){var curleft,curtop,cursor,o=this.options,el=this.element;return this.resizing=!0,this._renderProxy(),curleft=this._num(this.helper.css("left")),curtop=this._num(this.helper.css("top")),o.containment&&(curleft+=$(o.containment).scrollLeft()||0,curtop+=$(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:curleft,top:curtop},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:el.width(),height:el.height()},this.originalSize=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()},this.sizeDiff={width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()},this.originalPosition={left:curleft,top:curtop},this.originalMousePosition={left:event.pageX,top:event.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,cursor=$(".ui-resizable-"+this.axis).css("cursor"),$("body").css("cursor","auto"===cursor?this.axis+"-resize":cursor),this._addClass("ui-resizable-resizing"),this._propagate("start",event),!0},_mouseDrag:function(event){var data,props,smp=this.originalMousePosition,a=this.axis,dx=event.pageX-smp.left||0,dy=event.pageY-smp.top||0,trigger=this._change[a];return this._updatePrevProperties(),!!trigger&&(data=trigger.apply(this,[event,dx,dy]),this._updateVirtualBoundaries(event.shiftKey),(this._aspectRatio||event.shiftKey)&&(data=this._updateRatio(data,event)),data=this._respectSize(data,event),this._updateCache(data),this._propagate("resize",event),props=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),$.isEmptyObject(props)||(this._updatePrevProperties(),this._trigger("resize",event,this.ui()),this._applyChanges()),!1)},_mouseStop:function(event){this.resizing=!1;var pr,ista,soffseth,soffsetw,s,left,top,o=this.options,that=this;return this._helper&&(pr=this._proportionallyResizeElements,ista=pr.length&&/textarea/i.test(pr[0].nodeName),soffseth=ista&&this._hasScroll(pr[0],"left")?0:that.sizeDiff.height,soffsetw=ista?0:that.sizeDiff.width,s={width:that.helper.width()-soffsetw,height:that.helper.height()-soffseth},left=parseFloat(that.element.css("left"))+(that.position.left-that.originalPosition.left)||null,top=parseFloat(that.element.css("top"))+(that.position.top-that.originalPosition.top)||null,o.animate||this.element.css($.extend(s,{top:top,left:left})),that.helper.height(that.size.height),that.helper.width(that.size.width),this._helper&&!o.animate&&this._proportionallyResize()),$("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",event),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var props={};return this.position.top!==this.prevPosition.top&&(props.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(props.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(props.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(props.height=this.size.height+"px"),this.helper.css(props),props},_updateVirtualBoundaries:function(forceAspectRatio){var pMinWidth,pMaxWidth,pMinHeight,pMaxHeight,b,o=this.options;b={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||forceAspectRatio)&&(pMinWidth=b.minHeight*this.aspectRatio,pMinHeight=b.minWidth/this.aspectRatio,pMaxWidth=b.maxHeight*this.aspectRatio,pMaxHeight=b.maxWidth/this.aspectRatio,pMinWidth>b.minWidth&&(b.minWidth=pMinWidth),pMinHeight>b.minHeight&&(b.minHeight=pMinHeight),pMaxWidth<b.maxWidth&&(b.maxWidth=pMaxWidth),pMaxHeight<b.maxHeight&&(b.maxHeight=pMaxHeight)),this._vBoundaries=b},_updateCache:function(data){this.offset=this.helper.offset(),this._isNumber(data.left)&&(this.position.left=data.left),this._isNumber(data.top)&&(this.position.top=data.top),this._isNumber(data.height)&&(this.size.height=data.height),this._isNumber(data.width)&&(this.size.width=data.width)},_updateRatio:function(data){var cpos=this.position,csize=this.size,a=this.axis;return this._isNumber(data.height)?data.width=data.height*this.aspectRatio:this._isNumber(data.width)&&(data.height=data.width/this.aspectRatio),"sw"===a&&(data.left=cpos.left+(csize.width-data.width),data.top=null),"nw"===a&&(data.top=cpos.top+(csize.height-data.height),data.left=cpos.left+(csize.width-data.width)),data},_respectSize:function(data){var o=this._vBoundaries,a=this.axis,ismaxw=this._isNumber(data.width)&&o.maxWidth&&o.maxWidth<data.width,ismaxh=this._isNumber(data.height)&&o.maxHeight&&o.maxHeight<data.height,isminw=this._isNumber(data.width)&&o.minWidth&&o.minWidth>data.width,isminh=this._isNumber(data.height)&&o.minHeight&&o.minHeight>data.height,dw=this.originalPosition.left+this.originalSize.width,dh=this.originalPosition.top+this.originalSize.height,cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);return isminw&&(data.width=o.minWidth),isminh&&(data.height=o.minHeight),ismaxw&&(data.width=o.maxWidth),ismaxh&&(data.height=o.maxHeight),isminw&&cw&&(data.left=dw-o.minWidth),ismaxw&&cw&&(data.left=dw-o.maxWidth),isminh&&ch&&(data.top=dh-o.minHeight),ismaxh&&ch&&(data.top=dh-o.maxHeight),data.width||data.height||data.left||!data.top?data.width||data.height||data.top||!data.left||(data.left=null):data.top=null,
data},_getPaddingPlusBorderDimensions:function(element){for(var i=0,widths=[],borders=[element.css("borderTopWidth"),element.css("borderRightWidth"),element.css("borderBottomWidth"),element.css("borderLeftWidth")],paddings=[element.css("paddingTop"),element.css("paddingRight"),element.css("paddingBottom"),element.css("paddingLeft")];i<4;i++)widths[i]=parseFloat(borders[i])||0,widths[i]+=parseFloat(paddings[i])||0;return{height:widths[0]+widths[2],width:widths[1]+widths[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var prel,i=0,element=this.helper||this.element;i<this._proportionallyResizeElements.length;i++)prel=this._proportionallyResizeElements[i],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(prel)),prel.css({height:element.height()-this.outerDimensions.height||0,width:element.width()-this.outerDimensions.width||0})},_renderProxy:function(){var el=this.element,o=this.options;this.elementOffset=el.offset(),this._helper?(this.helper=this.helper||$("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++o.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(event,dx){return{width:this.originalSize.width+dx}},w:function(event,dx){var cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx}},n:function(event,dx,dy){var cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy}},s:function(event,dx,dy){return{height:this.originalSize.height+dy}},se:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]))},sw:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]))},ne:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]))},nw:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]))}},_propagate:function(n,event){$.ui.plugin.call(this,n,[event,this.ui()]),"resize"!==n&&this._trigger(n,event,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),$.ui.plugin.add("resizable","animate",{stop:function(event){var that=$(this).resizable("instance"),o=that.options,pr=that._proportionallyResizeElements,ista=pr.length&&/textarea/i.test(pr[0].nodeName),soffseth=ista&&that._hasScroll(pr[0],"left")?0:that.sizeDiff.height,soffsetw=ista?0:that.sizeDiff.width,style={width:that.size.width-soffsetw,height:that.size.height-soffseth},left=parseFloat(that.element.css("left"))+(that.position.left-that.originalPosition.left)||null,top=parseFloat(that.element.css("top"))+(that.position.top-that.originalPosition.top)||null;that.element.animate($.extend(style,top&&left?{top:top,left:left}:{}),{duration:o.animateDuration,easing:o.animateEasing,step:function(){var data={width:parseFloat(that.element.css("width")),height:parseFloat(that.element.css("height")),top:parseFloat(that.element.css("top")),left:parseFloat(that.element.css("left"))};pr&&pr.length&&$(pr[0]).css({width:data.width,height:data.height}),that._updateCache(data),that._propagate("resize",event)}})}}),$.ui.plugin.add("resizable","containment",{start:function(){var element,p,co,ch,cw,width,height,that=$(this).resizable("instance"),o=that.options,el=that.element,oc=o.containment,ce=oc instanceof $?oc.get(0):/parent/.test(oc)?el.parent().get(0):oc;ce&&(that.containerElement=$(ce),/document/.test(oc)||oc===document?(that.containerOffset={left:0,top:0},that.containerPosition={left:0,top:0},that.parentData={element:$(document),left:0,top:0,width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight}):(element=$(ce),p=[],$(["Top","Right","Left","Bottom"]).each(function(i,name){p[i]=that._num(element.css("padding"+name))}),that.containerOffset=element.offset(),that.containerPosition=element.position(),that.containerSize={height:element.innerHeight()-p[3],width:element.innerWidth()-p[1]},co=that.containerOffset,ch=that.containerSize.height,cw=that.containerSize.width,width=that._hasScroll(ce,"left")?ce.scrollWidth:cw,height=that._hasScroll(ce)?ce.scrollHeight:ch,that.parentData={element:ce,left:co.left,top:co.top,width:width,height:height}))},resize:function(event){var woset,hoset,isParent,isOffsetRelative,that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cp=that.position,pRatio=that._aspectRatio||event.shiftKey,cop={top:0,left:0},ce=that.containerElement,continueResize=!0;ce[0]!==document&&/static/.test(ce.css("position"))&&(cop=co),cp.left<(that._helper?co.left:0)&&(that.size.width=that.size.width+(that._helper?that.position.left-co.left:that.position.left-cop.left),pRatio&&(that.size.height=that.size.width/that.aspectRatio,continueResize=!1),that.position.left=o.helper?co.left:0),cp.top<(that._helper?co.top:0)&&(that.size.height=that.size.height+(that._helper?that.position.top-co.top:that.position.top),pRatio&&(that.size.width=that.size.height*that.aspectRatio,continueResize=!1),that.position.top=that._helper?co.top:0),isParent=that.containerElement.get(0)===that.element.parent().get(0),isOffsetRelative=/relative|absolute/.test(that.containerElement.css("position")),isParent&&isOffsetRelative?(that.offset.left=that.parentData.left+that.position.left,that.offset.top=that.parentData.top+that.position.top):(that.offset.left=that.element.offset().left,that.offset.top=that.element.offset().top),woset=Math.abs(that.sizeDiff.width+(that._helper?that.offset.left-cop.left:that.offset.left-co.left)),hoset=Math.abs(that.sizeDiff.height+(that._helper?that.offset.top-cop.top:that.offset.top-co.top)),woset+that.size.width>=that.parentData.width&&(that.size.width=that.parentData.width-woset,pRatio&&(that.size.height=that.size.width/that.aspectRatio,continueResize=!1)),hoset+that.size.height>=that.parentData.height&&(that.size.height=that.parentData.height-hoset,pRatio&&(that.size.width=that.size.height*that.aspectRatio,continueResize=!1)),continueResize||(that.position.left=that.prevPosition.left,that.position.top=that.prevPosition.top,that.size.width=that.prevSize.width,that.size.height=that.prevSize.height)},stop:function(){var that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cop=that.containerPosition,ce=that.containerElement,helper=$(that.helper),ho=helper.offset(),w=helper.outerWidth()-that.sizeDiff.width,h=helper.outerHeight()-that.sizeDiff.height;that._helper&&!o.animate&&/relative/.test(ce.css("position"))&&$(this).css({left:ho.left-cop.left-co.left,width:w,height:h}),that._helper&&!o.animate&&/static/.test(ce.css("position"))&&$(this).css({left:ho.left-cop.left-co.left,width:w,height:h})}}),$.ui.plugin.add("resizable","alsoResize",{start:function(){var that=$(this).resizable("instance"),o=that.options;$(o.alsoResize).each(function(){var el=$(this);el.data("ui-resizable-alsoresize",{width:parseFloat(el.width()),height:parseFloat(el.height()),left:parseFloat(el.css("left")),top:parseFloat(el.css("top"))})})},resize:function(event,ui){var that=$(this).resizable("instance"),o=that.options,os=that.originalSize,op=that.originalPosition,delta={height:that.size.height-os.height||0,width:that.size.width-os.width||0,top:that.position.top-op.top||0,left:that.position.left-op.left||0};$(o.alsoResize).each(function(){var el=$(this),start=$(this).data("ui-resizable-alsoresize"),style={},css=el.parents(ui.originalElement[0]).length?["width","height"]:["width","height","top","left"];$.each(css,function(i,prop){var sum=(start[prop]||0)+(delta[prop]||0);sum&&sum>=0&&(style[prop]=sum||null)}),el.css(style)})},stop:function(){$(this).removeData("ui-resizable-alsoresize")}}),$.ui.plugin.add("resizable","ghost",{start:function(){var that=$(this).resizable("instance"),cs=that.size;that.ghost=that.originalElement.clone(),that.ghost.css({opacity:.25,display:"block",position:"relative",height:cs.height,width:cs.width,margin:0,left:0,top:0}),that._addClass(that.ghost,"ui-resizable-ghost"),$.uiBackCompat!==!1&&"string"==typeof that.options.ghost&&that.ghost.addClass(this.options.ghost),that.ghost.appendTo(that.helper)},resize:function(){var that=$(this).resizable("instance");that.ghost&&that.ghost.css({position:"relative",height:that.size.height,width:that.size.width})},stop:function(){var that=$(this).resizable("instance");that.ghost&&that.helper&&that.helper.get(0).removeChild(that.ghost.get(0))}}),$.ui.plugin.add("resizable","grid",{resize:function(){var outerDimensions,that=$(this).resizable("instance"),o=that.options,cs=that.size,os=that.originalSize,op=that.originalPosition,a=that.axis,grid="number"==typeof o.grid?[o.grid,o.grid]:o.grid,gridX=grid[0]||1,gridY=grid[1]||1,ox=Math.round((cs.width-os.width)/gridX)*gridX,oy=Math.round((cs.height-os.height)/gridY)*gridY,newWidth=os.width+ox,newHeight=os.height+oy,isMaxWidth=o.maxWidth&&o.maxWidth<newWidth,isMaxHeight=o.maxHeight&&o.maxHeight<newHeight,isMinWidth=o.minWidth&&o.minWidth>newWidth,isMinHeight=o.minHeight&&o.minHeight>newHeight;o.grid=grid,isMinWidth&&(newWidth+=gridX),isMinHeight&&(newHeight+=gridY),isMaxWidth&&(newWidth-=gridX),isMaxHeight&&(newHeight-=gridY),/^(se|s|e)$/.test(a)?(that.size.width=newWidth,that.size.height=newHeight):/^(ne)$/.test(a)?(that.size.width=newWidth,that.size.height=newHeight,that.position.top=op.top-oy):/^(sw)$/.test(a)?(that.size.width=newWidth,that.size.height=newHeight,that.position.left=op.left-ox):((newHeight-gridY<=0||newWidth-gridX<=0)&&(outerDimensions=that._getPaddingPlusBorderDimensions(this)),newHeight-gridY>0?(that.size.height=newHeight,that.position.top=op.top-oy):(newHeight=gridY-outerDimensions.height,that.size.height=newHeight,that.position.top=op.top+os.height-newHeight),newWidth-gridX>0?(that.size.width=newWidth,that.position.left=op.left-ox):(newWidth=gridX-outerDimensions.width,that.size.width=newWidth,that.position.left=op.left+os.width-newWidth))}});var controlgroupCornerRegex=($.ui.resizable,/ui-corner-([a-z]){2,6}/g);$.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var that=this,childWidgets=[];$.each(this.options.items,function(widget,selector){var labels,options={};if(selector)return"controlgroupLabel"===widget?(labels=that.element.find(selector),labels.each(function(){var element=$(this);element.children(".ui-controlgroup-label-contents").length||element.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),that._addClass(labels,null,"ui-widget ui-widget-content ui-state-default"),void(childWidgets=childWidgets.concat(labels.get()))):void($.fn[widget]&&(options=that["_"+widget+"Options"]?that["_"+widget+"Options"]("middle"):{classes:{}},that.element.find(selector).each(function(){var element=$(this),instance=element[widget]("instance"),instanceOptions=$.widget.extend({},options);if("button"!==widget||!element.parent(".ui-spinner").length){instance||(instance=element[widget]()[widget]("instance")),instance&&(instanceOptions.classes=that._resolveClassesValues(instanceOptions.classes,instance)),element[widget](instanceOptions);var widgetElement=element[widget]("widget");$.data(widgetElement[0],"ui-controlgroup-data",instance?instance:element[widget]("instance")),childWidgets.push(widgetElement[0])}})))}),this.childWidgets=$($.unique(childWidgets)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(method){this.childWidgets.each(function(){var element=$(this),data=element.data("ui-controlgroup-data");data&&data[method]&&data[method]()})},_updateCornerClass:function(element,position){var remove="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all",add=this._buildSimpleOptions(position,"label").classes.label;this._removeClass(element,null,remove),this._addClass(element,null,add)},_buildSimpleOptions:function(position,key){var direction="vertical"===this.options.direction,result={classes:{}};return result.classes[key]={middle:"",first:"ui-corner-"+(direction?"top":"left"),last:"ui-corner-"+(direction?"bottom":"right"),only:"ui-corner-all"}[position],result},_spinnerOptions:function(position){var options=this._buildSimpleOptions(position,"ui-spinner");return options.classes["ui-spinner-up"]="",options.classes["ui-spinner-down"]="",options},_buttonOptions:function(position){return this._buildSimpleOptions(position,"ui-button")},_checkboxradioOptions:function(position){return this._buildSimpleOptions(position,"ui-checkboxradio-label")},_selectmenuOptions:function(position){var direction="vertical"===this.options.direction;return{width:!!direction&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(direction?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(direction?"top":"left")},last:{"ui-selectmenu-button-open":direction?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(direction?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[position]}},_resolveClassesValues:function(classes,instance){var result={};return $.each(classes,function(key){var current=instance.options.classes[key]||"";current=$.trim(current.replace(controlgroupCornerRegex,"")),result[key]=(current+" "+classes[key]).replace(/\s+/g," ")}),result},_setOption:function(key,value){return"direction"===key&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(key,value),"disabled"===key?void this._callChildMethod(value?"disable":"enable"):void this.refresh()},refresh:function(){var children,that=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),children=this.childWidgets,this.options.onlyVisible&&(children=children.filter(":visible")),children.length&&($.each(["first","last"],function(index,value){var instance=children[value]().data("ui-controlgroup-data");if(instance&&that["_"+instance.widgetName+"Options"]){var options=that["_"+instance.widgetName+"Options"](1===children.length?"only":value);options.classes=that._resolveClassesValues(options.classes,instance),instance.element[instance.widgetName](options)}else that._updateCornerClass(children[value](),value)}),this._callChildMethod("refresh"))}});$.widget("ui.checkboxradio",[$.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var disabled,labels,that=this,options=this._super()||{};return this._readType(),labels=this.element.labels(),this.label=$(labels[labels.length-1]),this.label.length||$.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){that.originalLabel+=3===this.nodeType?$(this).text():this.outerHTML}),this.originalLabel&&(options.label=this.originalLabel),disabled=this.element[0].disabled,null!=disabled&&(options.disabled=disabled),options},_create:function(){var checked=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),checked&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var nodeName=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===nodeName&&/radio|checkbox/.test(this.type)||$.error("Can't create checkboxradio on element.nodeName="+nodeName+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var group,name=this.element[0].name,nameSelector="input[name='"+$.ui.escapeSelector(name)+"']";return name?(group=this.form.length?$(this.form[0].elements).filter(nameSelector):$(nameSelector).filter(function(){return 0===$(this).form().length}),group.not(this.element)):$([])},_toggleClasses:function(){var checked=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",checked),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",checked)._toggleClass(this.icon,null,"ui-icon-blank",!checked),"radio"===this.type&&this._getRadioGroup().each(function(){var instance=$(this).checkboxradio("instance");instance&&instance._removeClass(instance.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(key,value){if("label"!==key||value)return this._super(key,value),"disabled"===key?(this._toggleClass(this.label,null,"ui-state-disabled",value),void(this.element[0].disabled=value)):void this.refresh()},_updateIcon:function(checked){var toAdd="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=$("<span>"),this.iconSpace=$("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(toAdd+=checked?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,checked?"ui-icon-blank":"ui-icon-check")):toAdd+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",toAdd),checked||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var contents=this.label.contents().not(this.element[0]);this.icon&&(contents=contents.not(this.icon[0])),this.iconSpace&&(contents=contents.not(this.iconSpace[0])),contents.remove(),this.label.append(this.options.label)},refresh:function(){var checked=this.element[0].checked,isDisabled=this.element[0].disabled;this._updateIcon(checked),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",checked),null!==this.options.label&&this._updateLabel(),isDisabled!==this.options.disabled&&this._setOptions({disabled:isDisabled})}}]);$.ui.checkboxradio;$.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var disabled,options=this._super()||{};return this.isInput=this.element.is("input"),disabled=this.element[0].disabled,null!=disabled&&(options.disabled=disabled),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(options.label=this.originalLabel),options},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(event){event.keyCode===$.ui.keyCode.SPACE&&(event.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(option,value){var icon="iconPosition"!==option,position=icon?this.options.iconPosition:value,displayBlock="top"===position||"bottom"===position;this.icon?icon&&this._removeClass(this.icon,null,this.options.icon):(this.icon=$("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),icon&&this._addClass(this.icon,null,value),this._attachIcon(position),displayBlock?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=$("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(position))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(iconPosition){this.icon[/^(?:end|bottom)/.test(iconPosition)?"before":"after"](this.iconSpace)},_attachIcon:function(iconPosition){this.element[/^(?:end|bottom)/.test(iconPosition)?"append":"prepend"](this.icon)},_setOptions:function(options){var newShowLabel=void 0===options.showLabel?this.options.showLabel:options.showLabel,newIcon=void 0===options.icon?this.options.icon:options.icon;newShowLabel||newIcon||(options.showLabel=!0),this._super(options)},_setOption:function(key,value){"icon"===key&&(value?this._updateIcon(key,value):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===key&&this._updateIcon(key,value),"showLabel"===key&&(this._toggleClass("ui-button-icon-only",null,!value),this._updateTooltip()),"label"===key&&(this.isInput?this.element.val(value):(this.element.html(value),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(key,value),"disabled"===key&&(this._toggleClass(null,"ui-state-disabled",value),this.element[0].disabled=value,value&&this.element.blur())},refresh:function(){var isDisabled=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");isDisabled!==this.options.disabled&&this._setOptions({disabled:isDisabled}),this._updateTooltip()}}),$.uiBackCompat!==!1&&($.widget("ui.button",$.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(key,value){return"text"===key?void this._super("showLabel",value):("showLabel"===key&&(this.options.text=value),"icon"===key&&(this.options.icons.primary=value),"icons"===key&&(value.primary?(this._super("icon",value.primary),this._super("iconPosition","beginning")):value.secondary&&(this._super("icon",value.secondary),this._super("iconPosition","end"))),void this._superApply(arguments))}}),$.fn.button=function(orig){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?orig.apply(this,arguments):($.ui.checkboxradio||$.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}($.fn.button),$.fn.buttonset=function(){return $.ui.controlgroup||$.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))});$.ui.button;$.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(pos){var topOffset=$(this).css(pos).offset().top;topOffset<0&&$(this).css("top",pos.top-topOffset)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&$.fn.draggable&&this._makeDraggable(),this.options.resizable&&$.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var element=this.options.appendTo;return element&&(element.jquery||element.nodeType)?$(element):this.document.find(element||"body").eq(0)},_destroy:function(){var next,originalPosition=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),next=originalPosition.parent.children().eq(originalPosition.index),next.length&&next[0]!==this.element[0]?next.before(this.element):originalPosition.parent.append(this.element)},widget:function(){return this.uiDialog},disable:$.noop,enable:$.noop,close:function(event){var that=this;this._isOpen&&this._trigger("beforeClose",event)!==!1&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||$.ui.safeBlur($.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){that._trigger("close",event)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(event,silent){var moved=!1,zIndices=this.uiDialog.siblings(".ui-front:visible").map(function(){return+$(this).css("z-index")}).get(),zIndexMax=Math.max.apply(null,zIndices);return zIndexMax>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",zIndexMax+1),moved=!0),moved&&!silent&&this._trigger("focus",event),moved},open:function(){var that=this;return this._isOpen?void(this._moveToTop()&&this._focusTabbable()):(this._isOpen=!0,this.opener=$($.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){that._focusTabbable(),that._trigger("focus")}),this._makeFocusTarget(),void this._trigger("open"))},_focusTabbable:function(){var hasFocus=this._focusedElement;hasFocus||(hasFocus=this.element.find("[autofocus]")),hasFocus.length||(hasFocus=this.element.find(":tabbable")),hasFocus.length||(hasFocus=this.uiDialogButtonPane.find(":tabbable")),hasFocus.length||(hasFocus=this.uiDialogTitlebarClose.filter(":tabbable")),hasFocus.length||(hasFocus=this.uiDialog),hasFocus.eq(0).trigger("focus")},_keepFocus:function(event){function checkFocus(){var activeElement=$.ui.safeActiveElement(this.document[0]),isActive=this.uiDialog[0]===activeElement||$.contains(this.uiDialog[0],activeElement);isActive||this._focusTabbable()}event.preventDefault(),checkFocus.call(this),this._delay(checkFocus)},_createWrapper:function(){this.uiDialog=$("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(event){if(this.options.closeOnEscape&&!event.isDefaultPrevented()&&event.keyCode&&event.keyCode===$.ui.keyCode.ESCAPE)return event.preventDefault(),void this.close(event);if(event.keyCode===$.ui.keyCode.TAB&&!event.isDefaultPrevented()){var tabbables=this.uiDialog.find(":tabbable"),first=tabbables.filter(":first"),last=tabbables.filter(":last");event.target!==last[0]&&event.target!==this.uiDialog[0]||event.shiftKey?event.target!==first[0]&&event.target!==this.uiDialog[0]||!event.shiftKey||(this._delay(function(){last.trigger("focus")}),event.preventDefault()):(this._delay(function(){first.trigger("focus")}),event.preventDefault())}},mousedown:function(event){this._moveToTop(event)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var uiDialogTitle;this.uiDialogTitlebar=$("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(event){$(event.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=$("<button type='button'></button>").button({label:$("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(event){event.preventDefault(),this.close(event)}}),uiDialogTitle=$("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(uiDialogTitle,"ui-dialog-title"),this._title(uiDialogTitle),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":uiDialogTitle.attr("id")
})},_title:function(title){this.options.title?title.text(this.options.title):title.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=$("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=$("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var that=this,buttons=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),$.isEmptyObject(buttons)||$.isArray(buttons)&&!buttons.length?void this._removeClass(this.uiDialog,"ui-dialog-buttons"):($.each(buttons,function(name,props){var click,buttonOptions;props=$.isFunction(props)?{click:props,text:name}:props,props=$.extend({type:"button"},props),click=props.click,buttonOptions={icon:props.icon,iconPosition:props.iconPosition,showLabel:props.showLabel,icons:props.icons,text:props.text},delete props.click,delete props.icon,delete props.iconPosition,delete props.showLabel,delete props.icons,"boolean"==typeof props.text&&delete props.text,$("<button></button>",props).button(buttonOptions).appendTo(that.uiButtonSet).on("click",function(){click.apply(that.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),void this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){function filteredUi(ui){return{position:ui.position,offset:ui.offset}}var that=this,options=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(event,ui){that._addClass($(this),"ui-dialog-dragging"),that._blockFrames(),that._trigger("dragStart",event,filteredUi(ui))},drag:function(event,ui){that._trigger("drag",event,filteredUi(ui))},stop:function(event,ui){var left=ui.offset.left-that.document.scrollLeft(),top=ui.offset.top-that.document.scrollTop();options.position={my:"left top",at:"left"+(left>=0?"+":"")+left+" top"+(top>=0?"+":"")+top,of:that.window},that._removeClass($(this),"ui-dialog-dragging"),that._unblockFrames(),that._trigger("dragStop",event,filteredUi(ui))}})},_makeResizable:function(){function filteredUi(ui){return{originalPosition:ui.originalPosition,originalSize:ui.originalSize,position:ui.position,size:ui.size}}var that=this,options=this.options,handles=options.resizable,position=this.uiDialog.css("position"),resizeHandles="string"==typeof handles?handles:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:this._minHeight(),handles:resizeHandles,start:function(event,ui){that._addClass($(this),"ui-dialog-resizing"),that._blockFrames(),that._trigger("resizeStart",event,filteredUi(ui))},resize:function(event,ui){that._trigger("resize",event,filteredUi(ui))},stop:function(event,ui){var offset=that.uiDialog.offset(),left=offset.left-that.document.scrollLeft(),top=offset.top-that.document.scrollTop();options.height=that.uiDialog.height(),options.width=that.uiDialog.width(),options.position={my:"left top",at:"left"+(left>=0?"+":"")+left+" top"+(top>=0?"+":"")+top,of:that.window},that._removeClass($(this),"ui-dialog-resizing"),that._unblockFrames(),that._trigger("resizeStop",event,filteredUi(ui))}}).css("position",position)},_trackFocus:function(){this._on(this.widget(),{focusin:function(event){this._makeFocusTarget(),this._focusedElement=$(event.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var instances=this._trackingInstances(),exists=$.inArray(this,instances);exists!==-1&&instances.splice(exists,1)},_trackingInstances:function(){var instances=this.document.data("ui-dialog-instances");return instances||(instances=[],this.document.data("ui-dialog-instances",instances)),instances},_minHeight:function(){var options=this.options;return"auto"===options.height?options.minHeight:Math.min(options.minHeight,options.height)},_position:function(){var isVisible=this.uiDialog.is(":visible");isVisible||this.uiDialog.show(),this.uiDialog.position(this.options.position),isVisible||this.uiDialog.hide()},_setOptions:function(options){var that=this,resize=!1,resizableOptions={};$.each(options,function(key,value){that._setOption(key,value),key in that.sizeRelatedOptions&&(resize=!0),key in that.resizableRelatedOptions&&(resizableOptions[key]=value)}),resize&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",resizableOptions)},_setOption:function(key,value){var isDraggable,isResizable,uiDialog=this.uiDialog;"disabled"!==key&&(this._super(key,value),"appendTo"===key&&this.uiDialog.appendTo(this._appendTo()),"buttons"===key&&this._createButtons(),"closeText"===key&&this.uiDialogTitlebarClose.button({label:$("<a>").text(""+this.options.closeText).html()}),"draggable"===key&&(isDraggable=uiDialog.is(":data(ui-draggable)"),isDraggable&&!value&&uiDialog.draggable("destroy"),!isDraggable&&value&&this._makeDraggable()),"position"===key&&this._position(),"resizable"===key&&(isResizable=uiDialog.is(":data(ui-resizable)"),isResizable&&!value&&uiDialog.resizable("destroy"),isResizable&&"string"==typeof value&&uiDialog.resizable("option","handles",value),isResizable||value===!1||this._makeResizable()),"title"===key&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var nonContentHeight,minContentHeight,maxContentHeight,options=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),options.minWidth>options.width&&(options.width=options.minWidth),nonContentHeight=this.uiDialog.css({height:"auto",width:options.width}).outerHeight(),minContentHeight=Math.max(0,options.minHeight-nonContentHeight),maxContentHeight="number"==typeof options.maxHeight?Math.max(0,options.maxHeight-nonContentHeight):"none","auto"===options.height?this.element.css({minHeight:minContentHeight,maxHeight:maxContentHeight,height:"auto"}):this.element.height(Math.max(0,options.height-nonContentHeight)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var iframe=$(this);return $("<div>").css({position:"absolute",width:iframe.outerWidth(),height:iframe.outerHeight()}).appendTo(iframe.parent()).offset(iframe.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(event){return!!$(event.target).closest(".ui-dialog").length||!!$(event.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var isOpening=!0;this._delay(function(){isOpening=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(event){isOpening||this._allowInteraction(event)||(event.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=$("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var overlays=this.document.data("ui-dialog-overlays")-1;overlays?this.document.data("ui-dialog-overlays",overlays):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),$.uiBackCompat!==!1&&$.widget("ui.dialog",$.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(key,value){"dialogClass"===key&&this.uiDialog.removeClass(this.options.dialogClass).addClass(value),this._superApply(arguments)}});$.ui.dialog,$.widget("ui.slider",$.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var i,handleCount,options=this.options,existingHandles=this.element.find(".ui-slider-handle"),handle="<span tabindex='0'></span>",handles=[];for(handleCount=options.values&&options.values.length||1,existingHandles.length>handleCount&&(existingHandles.slice(handleCount).remove(),existingHandles=existingHandles.slice(0,handleCount)),i=existingHandles.length;i<handleCount;i++)handles.push(handle);this.handles=existingHandles.add($(handles.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(i){$(this).data("ui-slider-handle-index",i).attr("tabIndex",0)})},_createRange:function(){var options=this.options;options.range?(options.range===!0&&(options.values?options.values.length&&2!==options.values.length?options.values=[options.values[0],options.values[0]]:$.isArray(options.values)&&(options.values=options.values.slice(0)):options.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=$("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==options.range&&"max"!==options.range||this._addClass(this.range,"ui-slider-range-"+options.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(event){var position,normValue,distance,closestHandle,index,allowed,offset,mouseOverHandle,that=this,o=this.options;return!o.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),position={x:event.pageX,y:event.pageY},normValue=this._normValueFromMouse(position),distance=this._valueMax()-this._valueMin()+1,this.handles.each(function(i){var thisDistance=Math.abs(normValue-that.values(i));(distance>thisDistance||distance===thisDistance&&(i===that._lastChangedValue||that.values(i)===o.min))&&(distance=thisDistance,closestHandle=$(this),index=i)}),allowed=this._start(event,index),allowed!==!1&&(this._mouseSliding=!0,this._handleIndex=index,this._addClass(closestHandle,null,"ui-state-active"),closestHandle.trigger("focus"),offset=closestHandle.offset(),mouseOverHandle=!$(event.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=mouseOverHandle?{left:0,top:0}:{left:event.pageX-offset.left-closestHandle.width()/2,top:event.pageY-offset.top-closestHandle.height()/2-(parseInt(closestHandle.css("borderTopWidth"),10)||0)-(parseInt(closestHandle.css("borderBottomWidth"),10)||0)+(parseInt(closestHandle.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(event,index,normValue),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(event){var position={x:event.pageX,y:event.pageY},normValue=this._normValueFromMouse(position);return this._slide(event,this._handleIndex,normValue),!1},_mouseStop:function(event){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(event,this._handleIndex),this._change(event,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(position){var pixelTotal,pixelMouse,percentMouse,valueTotal,valueMouse;return"horizontal"===this.orientation?(pixelTotal=this.elementSize.width,pixelMouse=position.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(pixelTotal=this.elementSize.height,pixelMouse=position.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),percentMouse=pixelMouse/pixelTotal,percentMouse>1&&(percentMouse=1),percentMouse<0&&(percentMouse=0),"vertical"===this.orientation&&(percentMouse=1-percentMouse),valueTotal=this._valueMax()-this._valueMin(),valueMouse=this._valueMin()+percentMouse*valueTotal,this._trimAlignValue(valueMouse)},_uiHash:function(index,value,values){var uiHash={handle:this.handles[index],handleIndex:index,value:void 0!==value?value:this.value()};return this._hasMultipleValues()&&(uiHash.value=void 0!==value?value:this.values(index),uiHash.values=values||this.values()),uiHash},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(event,index){return this._trigger("start",event,this._uiHash(index))},_slide:function(event,index,newVal){var allowed,otherVal,currentValue=this.value(),newValues=this.values();this._hasMultipleValues()&&(otherVal=this.values(index?0:1),currentValue=this.values(index),2===this.options.values.length&&this.options.range===!0&&(newVal=0===index?Math.min(otherVal,newVal):Math.max(otherVal,newVal)),newValues[index]=newVal),newVal!==currentValue&&(allowed=this._trigger("slide",event,this._uiHash(index,newVal,newValues)),allowed!==!1&&(this._hasMultipleValues()?this.values(index,newVal):this.value(newVal)))},_stop:function(event,index){this._trigger("stop",event,this._uiHash(index))},_change:function(event,index){this._keySliding||this._mouseSliding||(this._lastChangedValue=index,this._trigger("change",event,this._uiHash(index)))},value:function(newValue){return arguments.length?(this.options.value=this._trimAlignValue(newValue),this._refreshValue(),void this._change(null,0)):this._value()},values:function(index,newValue){var vals,newValues,i;if(arguments.length>1)return this.options.values[index]=this._trimAlignValue(newValue),this._refreshValue(),void this._change(null,index);if(!arguments.length)return this._values();if(!$.isArray(arguments[0]))return this._hasMultipleValues()?this._values(index):this.value();for(vals=this.options.values,newValues=arguments[0],i=0;i<vals.length;i+=1)vals[i]=this._trimAlignValue(newValues[i]),this._change(null,i);this._refreshValue()},_setOption:function(key,value){var i,valsLength=0;switch("range"===key&&this.options.range===!0&&("min"===value?(this.options.value=this._values(0),this.options.values=null):"max"===value&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),$.isArray(this.options.values)&&(valsLength=this.options.values.length),this._super(key,value),key){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(value),this.handles.css("horizontal"===value?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),i=valsLength-1;i>=0;i--)this._change(null,i);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(value){this._super(value),this._toggleClass(null,"ui-state-disabled",!!value)},_value:function(){var val=this.options.value;return val=this._trimAlignValue(val)},_values:function(index){var val,vals,i;if(arguments.length)return val=this.options.values[index],val=this._trimAlignValue(val);if(this._hasMultipleValues()){for(vals=this.options.values.slice(),i=0;i<vals.length;i+=1)vals[i]=this._trimAlignValue(vals[i]);return vals}return[]},_trimAlignValue:function(val){if(val<=this._valueMin())return this._valueMin();if(val>=this._valueMax())return this._valueMax();var step=this.options.step>0?this.options.step:1,valModStep=(val-this._valueMin())%step,alignValue=val-valModStep;return 2*Math.abs(valModStep)>=step&&(alignValue+=valModStep>0?step:-step),parseFloat(alignValue.toFixed(5))},_calculateNewMax:function(){var max=this.options.max,min=this._valueMin(),step=this.options.step,aboveMin=Math.round((max-min)/step)*step;max=aboveMin+min,max>this.options.max&&(max-=step),this.max=parseFloat(max.toFixed(this._precision()))},_precision:function(){var precision=this._precisionOf(this.options.step);return null!==this.options.min&&(precision=Math.max(precision,this._precisionOf(this.options.min))),precision},_precisionOf:function(num){var str=num.toString(),decimal=str.indexOf(".");return decimal===-1?0:str.length-decimal-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(orientation){"vertical"===orientation&&this.range.css({width:"",left:""}),"horizontal"===orientation&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var lastValPercent,valPercent,value,valueMin,valueMax,oRange=this.options.range,o=this.options,that=this,animate=!this._animateOff&&o.animate,_set={};this._hasMultipleValues()?this.handles.each(function(i){valPercent=(that.values(i)-that._valueMin())/(that._valueMax()-that._valueMin())*100,_set["horizontal"===that.orientation?"left":"bottom"]=valPercent+"%",$(this).stop(1,1)[animate?"animate":"css"](_set,o.animate),that.options.range===!0&&("horizontal"===that.orientation?(0===i&&that.range.stop(1,1)[animate?"animate":"css"]({left:valPercent+"%"},o.animate),1===i&&that.range[animate?"animate":"css"]({width:valPercent-lastValPercent+"%"},{queue:!1,duration:o.animate})):(0===i&&that.range.stop(1,1)[animate?"animate":"css"]({bottom:valPercent+"%"},o.animate),1===i&&that.range[animate?"animate":"css"]({height:valPercent-lastValPercent+"%"},{queue:!1,duration:o.animate}))),lastValPercent=valPercent}):(value=this.value(),valueMin=this._valueMin(),valueMax=this._valueMax(),valPercent=valueMax!==valueMin?(value-valueMin)/(valueMax-valueMin)*100:0,_set["horizontal"===this.orientation?"left":"bottom"]=valPercent+"%",this.handle.stop(1,1)[animate?"animate":"css"](_set,o.animate),"min"===oRange&&"horizontal"===this.orientation&&this.range.stop(1,1)[animate?"animate":"css"]({width:valPercent+"%"},o.animate),"max"===oRange&&"horizontal"===this.orientation&&this.range.stop(1,1)[animate?"animate":"css"]({width:100-valPercent+"%"},o.animate),"min"===oRange&&"vertical"===this.orientation&&this.range.stop(1,1)[animate?"animate":"css"]({height:valPercent+"%"},o.animate),"max"===oRange&&"vertical"===this.orientation&&this.range.stop(1,1)[animate?"animate":"css"]({height:100-valPercent+"%"},o.animate))},_handleEvents:{keydown:function(event){var allowed,curVal,newVal,step,index=$(event.target).data("ui-slider-handle-index");switch(event.keyCode){case $.ui.keyCode.HOME:case $.ui.keyCode.END:case $.ui.keyCode.PAGE_UP:case $.ui.keyCode.PAGE_DOWN:case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:if(event.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass($(event.target),null,"ui-state-active"),allowed=this._start(event,index),allowed===!1))return}switch(step=this.options.step,curVal=newVal=this._hasMultipleValues()?this.values(index):this.value(),event.keyCode){case $.ui.keyCode.HOME:newVal=this._valueMin();break;case $.ui.keyCode.END:newVal=this._valueMax();break;case $.ui.keyCode.PAGE_UP:newVal=this._trimAlignValue(curVal+(this._valueMax()-this._valueMin())/this.numPages);break;case $.ui.keyCode.PAGE_DOWN:newVal=this._trimAlignValue(curVal-(this._valueMax()-this._valueMin())/this.numPages);break;case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:if(curVal===this._valueMax())return;newVal=this._trimAlignValue(curVal+step);break;case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:if(curVal===this._valueMin())return;newVal=this._trimAlignValue(curVal-step)}this._slide(event,index,newVal)},keyup:function(event){var index=$(event.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(event,index),this._change(event,index),this._removeClass($(event.target),null,"ui-state-active"))}}});$.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var rhash=/#.*$/;return function(anchor){var anchorUrl,locationUrl;anchorUrl=anchor.href.replace(rhash,""),locationUrl=location.href.replace(rhash,"");try{anchorUrl=decodeURIComponent(anchorUrl)}catch(error){}try{locationUrl=decodeURIComponent(locationUrl)}catch(error){}return anchor.hash.length>1&&anchorUrl===locationUrl}}(),_create:function(){var that=this,options=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,options.collapsible),this._processTabs(),options.active=this._initialActive(),$.isArray(options.disabled)&&(options.disabled=$.unique(options.disabled.concat($.map(this.tabs.filter(".ui-state-disabled"),function(li){return that.tabs.index(li)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(options.active):this.active=$(),this._refresh(),this.active.length&&this.load(options.active)},_initialActive:function(){var active=this.options.active,collapsible=this.options.collapsible,locationHash=location.hash.substring(1);return null===active&&(locationHash&&this.tabs.each(function(i,tab){if($(tab).attr("aria-controls")===locationHash)return active=i,!1}),null===active&&(active=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),null!==active&&active!==-1||(active=!!this.tabs.length&&0)),active!==!1&&(active=this.tabs.index(this.tabs.eq(active)),active===-1&&(active=!collapsible&&0)),!collapsible&&active===!1&&this.anchors.length&&(active=0),active},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):$()}},_tabKeydown:function(event){var focusedTab=$($.ui.safeActiveElement(this.document[0])).closest("li"),selectedIndex=this.tabs.index(focusedTab),goingForward=!0;if(!this._handlePageNav(event)){switch(event.keyCode){case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:selectedIndex++;break;case $.ui.keyCode.UP:case $.ui.keyCode.LEFT:goingForward=!1,selectedIndex--;break;case $.ui.keyCode.END:selectedIndex=this.anchors.length-1;break;case $.ui.keyCode.HOME:selectedIndex=0;break;case $.ui.keyCode.SPACE:return event.preventDefault(),clearTimeout(this.activating),void this._activate(selectedIndex);case $.ui.keyCode.ENTER:return event.preventDefault(),clearTimeout(this.activating),void this._activate(selectedIndex!==this.options.active&&selectedIndex);default:return}event.preventDefault(),clearTimeout(this.activating),selectedIndex=this._focusNextTab(selectedIndex,goingForward),event.ctrlKey||event.metaKey||(focusedTab.attr("aria-selected","false"),this.tabs.eq(selectedIndex).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",selectedIndex)},this.delay))}},_panelKeydown:function(event){this._handlePageNav(event)||event.ctrlKey&&event.keyCode===$.ui.keyCode.UP&&(event.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(event){return event.altKey&&event.keyCode===$.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):event.altKey&&event.keyCode===$.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(index,goingForward){function constrain(){return index>lastTabIndex&&(index=0),index<0&&(index=lastTabIndex),index}for(var lastTabIndex=this.tabs.length-1;$.inArray(constrain(),this.options.disabled)!==-1;)index=goingForward?index+1:index-1;return index},_focusNextTab:function(index,goingForward){return index=this._findNextTab(index,goingForward),this.tabs.eq(index).trigger("focus"),index},_setOption:function(key,value){return"active"===key?void this._activate(value):(this._super(key,value),"collapsible"===key&&(this._toggleClass("ui-tabs-collapsible",null,value),value||this.options.active!==!1||this._activate(0)),"event"===key&&this._setupEvents(value),void("heightStyle"===key&&this._setupHeightStyle(value)))},_sanitizeSelector:function(hash){return hash?hash.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var options=this.options,lis=this.tablist.children(":has(a[href])");options.disabled=$.map(lis.filter(".ui-state-disabled"),function(tab){return lis.index(tab)}),this._processTabs(),options.active!==!1&&this.anchors.length?this.active.length&&!$.contains(this.tablist[0],this.active[0])?this.tabs.length===options.disabled.length?(options.active=!1,this.active=$()):this._activate(this._findNextTab(Math.max(0,options.active-1),!1)):options.active=this.tabs.index(this.active):(options.active=!1,this.active=$()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var that=this,prevTabs=this.tabs,prevAnchors=this.anchors,prevPanels=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(event){$(this).is(".ui-state-disabled")&&event.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){$(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return $("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=$(),this.anchors.each(function(i,anchor){var selector,panel,panelId,anchorId=$(anchor).uniqueId().attr("id"),tab=$(anchor).closest("li"),originalAriaControls=tab.attr("aria-controls");that._isLocal(anchor)?(selector=anchor.hash,panelId=selector.substring(1),panel=that.element.find(that._sanitizeSelector(selector))):(panelId=tab.attr("aria-controls")||$({}).uniqueId()[0].id,selector="#"+panelId,panel=that.element.find(selector),panel.length||(panel=that._createPanel(panelId),panel.insertAfter(that.panels[i-1]||that.tablist)),panel.attr("aria-live","polite")),panel.length&&(that.panels=that.panels.add(panel)),originalAriaControls&&tab.data("ui-tabs-aria-controls",originalAriaControls),tab.attr({"aria-controls":panelId,"aria-labelledby":anchorId}),panel.attr("aria-labelledby",anchorId)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),prevTabs&&(this._off(prevTabs.not(this.tabs)),this._off(prevAnchors.not(this.anchors)),this._off(prevPanels.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(id){return $("<div>").attr("id",id).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(disabled){var currentItem,li,i;for($.isArray(disabled)&&(disabled.length?disabled.length===this.anchors.length&&(disabled=!0):disabled=!1),i=0;li=this.tabs[i];i++)currentItem=$(li),disabled===!0||$.inArray(i,disabled)!==-1?(currentItem.attr("aria-disabled","true"),this._addClass(currentItem,null,"ui-state-disabled")):(currentItem.removeAttr("aria-disabled"),this._removeClass(currentItem,null,"ui-state-disabled"));this.options.disabled=disabled,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,disabled===!0)},_setupEvents:function(event){var events={};event&&$.each(event.split(" "),function(index,eventName){events[eventName]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(event){event.preventDefault()}}),this._on(this.anchors,events),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(heightStyle){var maxHeight,parent=this.element.parent();"fill"===heightStyle?(maxHeight=parent.height(),maxHeight-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var elem=$(this),position=elem.css("position");"absolute"!==position&&"fixed"!==position&&(maxHeight-=elem.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){maxHeight-=$(this).outerHeight(!0)}),this.panels.each(function(){$(this).height(Math.max(0,maxHeight-$(this).innerHeight()+$(this).height()))}).css("overflow","auto")):"auto"===heightStyle&&(maxHeight=0,this.panels.each(function(){maxHeight=Math.max(maxHeight,$(this).height("").height())}).height(maxHeight))},_eventHandler:function(event){var options=this.options,active=this.active,anchor=$(event.currentTarget),tab=anchor.closest("li"),clickedIsActive=tab[0]===active[0],collapsing=clickedIsActive&&options.collapsible,toShow=collapsing?$():this._getPanelForTab(tab),toHide=active.length?this._getPanelForTab(active):$(),eventData={oldTab:active,oldPanel:toHide,newTab:collapsing?$():tab,newPanel:toShow};event.preventDefault(),tab.hasClass("ui-state-disabled")||tab.hasClass("ui-tabs-loading")||this.running||clickedIsActive&&!options.collapsible||this._trigger("beforeActivate",event,eventData)===!1||(options.active=!collapsing&&this.tabs.index(tab),this.active=clickedIsActive?$():tab,this.xhr&&this.xhr.abort(),toHide.length||toShow.length||$.error("jQuery UI Tabs: Mismatching fragment identifier."),toShow.length&&this.load(this.tabs.index(tab),event),this._toggle(event,eventData))},_toggle:function(event,eventData){function complete(){that.running=!1,that._trigger("activate",event,eventData)}function show(){that._addClass(eventData.newTab.closest("li"),"ui-tabs-active","ui-state-active"),toShow.length&&that.options.show?that._show(toShow,that.options.show,complete):(toShow.show(),complete())}var that=this,toShow=eventData.newPanel,toHide=eventData.oldPanel;this.running=!0,toHide.length&&this.options.hide?this._hide(toHide,this.options.hide,function(){that._removeClass(eventData.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),show()}):(this._removeClass(eventData.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),toHide.hide(),show()),toHide.attr("aria-hidden","true"),eventData.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),toShow.length&&toHide.length?eventData.oldTab.attr("tabIndex",-1):toShow.length&&this.tabs.filter(function(){return 0===$(this).attr("tabIndex")}).attr("tabIndex",-1),toShow.attr("aria-hidden","false"),eventData.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(index){
var anchor,active=this._findActive(index);active[0]!==this.active[0]&&(active.length||(active=this.active),anchor=active.find(".ui-tabs-anchor")[0],this._eventHandler({target:anchor,currentTarget:anchor,preventDefault:$.noop}))},_findActive:function(index){return index===!1?$():this.tabs.eq(index)},_getIndex:function(index){return"string"==typeof index&&(index=this.anchors.index(this.anchors.filter("[href$='"+$.ui.escapeSelector(index)+"']"))),index},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){$.data(this,"ui-tabs-destroy")?$(this).remove():$(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var li=$(this),prev=li.data("ui-tabs-aria-controls");prev?li.attr("aria-controls",prev).removeData("ui-tabs-aria-controls"):li.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(index){var disabled=this.options.disabled;disabled!==!1&&(void 0===index?disabled=!1:(index=this._getIndex(index),disabled=$.isArray(disabled)?$.map(disabled,function(num){return num!==index?num:null}):$.map(this.tabs,function(li,num){return num!==index?num:null})),this._setOptionDisabled(disabled))},disable:function(index){var disabled=this.options.disabled;if(disabled!==!0){if(void 0===index)disabled=!0;else{if(index=this._getIndex(index),$.inArray(index,disabled)!==-1)return;disabled=$.isArray(disabled)?$.merge([index],disabled).sort():[index]}this._setOptionDisabled(disabled)}},load:function(index,event){index=this._getIndex(index);var that=this,tab=this.tabs.eq(index),anchor=tab.find(".ui-tabs-anchor"),panel=this._getPanelForTab(tab),eventData={tab:tab,panel:panel},complete=function(jqXHR,status){"abort"===status&&that.panels.stop(!1,!0),that._removeClass(tab,"ui-tabs-loading"),panel.removeAttr("aria-busy"),jqXHR===that.xhr&&delete that.xhr};this._isLocal(anchor[0])||(this.xhr=$.ajax(this._ajaxSettings(anchor,event,eventData)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(tab,"ui-tabs-loading"),panel.attr("aria-busy","true"),this.xhr.done(function(response,status,jqXHR){setTimeout(function(){panel.html(response),that._trigger("load",event,eventData),complete(jqXHR,status)},1)}).fail(function(jqXHR,status){setTimeout(function(){complete(jqXHR,status)},1)})))},_ajaxSettings:function(anchor,event,eventData){var that=this;return{url:anchor.attr("href").replace(/#.*$/,""),beforeSend:function(jqXHR,settings){return that._trigger("beforeLoad",event,$.extend({jqXHR:jqXHR,ajaxSettings:settings},eventData))}}},_getPanelForTab:function(tab){var id=$(tab).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+id))}}),$.uiBackCompat!==!1&&$.widget("ui.tabs",$.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}});$.ui.tabs;$.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var title=$(this).attr("title")||"";return $("<a>").text(title).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(elem,id){var describedby=(elem.attr("aria-describedby")||"").split(/\s+/);describedby.push(id),elem.data("ui-tooltip-id",id).attr("aria-describedby",$.trim(describedby.join(" ")))},_removeDescribedBy:function(elem){var id=elem.data("ui-tooltip-id"),describedby=(elem.attr("aria-describedby")||"").split(/\s+/),index=$.inArray(id,describedby);index!==-1&&describedby.splice(index,1),elem.removeData("ui-tooltip-id"),describedby=$.trim(describedby.join(" ")),describedby?elem.attr("aria-describedby",describedby):elem.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=$("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=$([])},_setOption:function(key,value){var that=this;this._super(key,value),"content"===key&&$.each(this.tooltips,function(id,tooltipData){that._updateContent(tooltipData.element)})},_setOptionDisabled:function(value){this[value?"_disable":"_enable"]()},_disable:function(){var that=this;$.each(this.tooltips,function(id,tooltipData){var event=$.Event("blur");event.target=event.currentTarget=tooltipData.element[0],that.close(event,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var element=$(this);if(element.is("[title]"))return element.data("ui-tooltip-title",element.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var element=$(this);element.data("ui-tooltip-title")&&element.attr("title",element.data("ui-tooltip-title"))}),this.disabledTitles=$([])},open:function(event){var that=this,target=$(event?event.target:this.element).closest(this.options.items);target.length&&!target.data("ui-tooltip-id")&&(target.attr("title")&&target.data("ui-tooltip-title",target.attr("title")),target.data("ui-tooltip-open",!0),event&&"mouseover"===event.type&&target.parents().each(function(){var blurEvent,parent=$(this);parent.data("ui-tooltip-open")&&(blurEvent=$.Event("blur"),blurEvent.target=blurEvent.currentTarget=this,that.close(blurEvent,!0)),parent.attr("title")&&(parent.uniqueId(),that.parents[this.id]={element:this,title:parent.attr("title")},parent.attr("title",""))}),this._registerCloseHandlers(event,target),this._updateContent(target,event))},_updateContent:function(target,event){var content,contentOption=this.options.content,that=this,eventType=event?event.type:null;return"string"==typeof contentOption||contentOption.nodeType||contentOption.jquery?this._open(event,target,contentOption):(content=contentOption.call(target[0],function(response){that._delay(function(){target.data("ui-tooltip-open")&&(event&&(event.type=eventType),this._open(event,target,response))})}),void(content&&this._open(event,target,content)))},_open:function(event,target,content){function position(event){positionOption.of=event,tooltip.is(":hidden")||tooltip.position(positionOption)}var tooltipData,tooltip,delayedShow,a11yContent,positionOption=$.extend({},this.options.position);if(content){if(tooltipData=this._find(target))return void tooltipData.tooltip.find(".ui-tooltip-content").html(content);target.is("[title]")&&(event&&"mouseover"===event.type?target.attr("title",""):target.removeAttr("title")),tooltipData=this._tooltip(target),tooltip=tooltipData.tooltip,this._addDescribedBy(target,tooltip.attr("id")),tooltip.find(".ui-tooltip-content").html(content),this.liveRegion.children().hide(),a11yContent=$("<div>").html(tooltip.find(".ui-tooltip-content").html()),a11yContent.removeAttr("name").find("[name]").removeAttr("name"),a11yContent.removeAttr("id").find("[id]").removeAttr("id"),a11yContent.appendTo(this.liveRegion),this.options.track&&event&&/^mouse/.test(event.type)?(this._on(this.document,{mousemove:position}),position(event)):tooltip.position($.extend({of:target},this.options.position)),tooltip.hide(),this._show(tooltip,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(delayedShow=this.delayedShow=setInterval(function(){tooltip.is(":visible")&&(position(positionOption.of),clearInterval(delayedShow))},$.fx.interval)),this._trigger("open",event,{tooltip:tooltip})}},_registerCloseHandlers:function(event,target){var events={keyup:function(event){if(event.keyCode===$.ui.keyCode.ESCAPE){var fakeEvent=$.Event(event);fakeEvent.currentTarget=target[0],this.close(fakeEvent,!0)}}};target[0]!==this.element[0]&&(events.remove=function(){this._removeTooltip(this._find(target).tooltip)}),event&&"mouseover"!==event.type||(events.mouseleave="close"),event&&"focusin"!==event.type||(events.focusout="close"),this._on(!0,target,events)},close:function(event){var tooltip,that=this,target=$(event?event.currentTarget:this.element),tooltipData=this._find(target);return tooltipData?(tooltip=tooltipData.tooltip,void(tooltipData.closing||(clearInterval(this.delayedShow),target.data("ui-tooltip-title")&&!target.attr("title")&&target.attr("title",target.data("ui-tooltip-title")),this._removeDescribedBy(target),tooltipData.hiding=!0,tooltip.stop(!0),this._hide(tooltip,this.options.hide,function(){that._removeTooltip($(this))}),target.removeData("ui-tooltip-open"),this._off(target,"mouseleave focusout keyup"),target[0]!==this.element[0]&&this._off(target,"remove"),this._off(this.document,"mousemove"),event&&"mouseleave"===event.type&&$.each(this.parents,function(id,parent){$(parent.element).attr("title",parent.title),delete that.parents[id]}),tooltipData.closing=!0,this._trigger("close",event,{tooltip:tooltip}),tooltipData.hiding||(tooltipData.closing=!1)))):void target.removeData("ui-tooltip-open")},_tooltip:function(element){var tooltip=$("<div>").attr("role","tooltip"),content=$("<div>").appendTo(tooltip),id=tooltip.uniqueId().attr("id");return this._addClass(content,"ui-tooltip-content"),this._addClass(tooltip,"ui-tooltip","ui-widget ui-widget-content"),tooltip.appendTo(this._appendTo(element)),this.tooltips[id]={element:element,tooltip:tooltip}},_find:function(target){var id=target.data("ui-tooltip-id");return id?this.tooltips[id]:null},_removeTooltip:function(tooltip){tooltip.remove(),delete this.tooltips[tooltip.attr("id")]},_appendTo:function(target){var element=target.closest(".ui-front, dialog");return element.length||(element=this.document[0].body),element},_destroy:function(){var that=this;$.each(this.tooltips,function(id,tooltipData){var event=$.Event("blur"),element=tooltipData.element;event.target=event.currentTarget=element[0],that.close(event,!0),$("#"+id).remove(),element.data("ui-tooltip-title")&&(element.attr("title")||element.attr("title",element.data("ui-tooltip-title")),element.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),$.uiBackCompat!==!1&&$.widget("ui.tooltip",$.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var tooltipData=this._superApply(arguments);return this.options.tooltipClass&&tooltipData.tooltip.addClass(this.options.tooltipClass),tooltipData}});$.ui.tooltip});var fluid_2_0_0=fluid_2_0_0||{},fluid=fluid||fluid_2_0_0;!function($,fluid){"use strict";function transformInternal(source,togo,key,args){for(var transit=source[key],j=0;j<args.length-1;++j)transit=args[j+1](transit,key);togo[key]=transit}function regenerateCursor(source,segs,limit,sourceStrategy){for(var i=0;i<limit;++i)source=sourceStrategy(source,segs[i],i,fluid.makeArray(segs));return source}function regenerateSources(sources,segs,limit,sourceStrategies){for(var togo=[],i=0;i<sources.length;++i){var thisSource=regenerateCursor(sources[i],segs,limit,sourceStrategies[i]);void 0!==thisSource&&togo.push(thisSource)}return togo}fluid.version="Infusion 2.0.0",fluid.Error=Error,fluid.environment={fluid:fluid},fluid.global=fluid.global||"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},fluid.invokeLater=function(func){return setTimeout(func,1)},fluid.defeatLogging=!0,fluid.activityTracing=!1,fluid.activityTrace=[];var activityParser=/(%\w+)/g;fluid.renderOneActivity=function(activity,nowhile){for(var togo=nowhile===!0?[]:[" while "],message=activity.message,index=activityParser.lastIndex=0;;){var match=activityParser.exec(message);if(!match)break;var key=match[1].substring(1);togo.push(message.substring(index,match.index)),togo.push(activity.args[key]),index=activityParser.lastIndex}return index<message.length&&togo.push(message.substring(index)),togo},fluid.renderActivity=function(activityStack,renderer){return renderer=renderer||fluid.renderOneActivity,fluid.transform(activityStack,renderer)},fluid.singleThreadLocal=function(initFunc){var value=initFunc();return function(newValue){return void 0===newValue?value:value=newValue}},fluid.threadLocal=fluid.singleThreadLocal,fluid.globalThreadLocal=fluid.threadLocal(function(){return{}}),fluid.getActivityStack=function(){var root=fluid.globalThreadLocal();return root.activityStack||(root.activityStack=[]),root.activityStack},fluid.describeActivity=fluid.getActivityStack,fluid.logActivity=function(activity){activity=activity||fluid.describeActivity();var rendered=fluid.renderActivity(activity).reverse();fluid.log("Current activity: "),fluid.each(rendered,function(args){fluid.doLog(args)})},fluid.pushActivity=function(type,message,args){var record={type:type,message:message,args:args,time:(new Date).getTime()};fluid.activityTracing&&fluid.activityTrace.push(record),fluid.passLogLevel(fluid.logLevel.TRACE)&&fluid.doLog(fluid.renderOneActivity(record,!0));var activityStack=fluid.getActivityStack();activityStack.push(record)},fluid.popActivity=function(popframes){popframes=popframes||1,fluid.activityTracing&&fluid.activityTrace.push({pop:popframes});var activityStack=fluid.getActivityStack(),popped=activityStack.length-popframes;activityStack.length=popped<0?0:popped},fluid.FluidError=function(){var togo=Error.apply(this,arguments);this.message=togo.message;try{throw togo}catch(togo){this.stack=togo.stack}return this},fluid.FluidError.prototype=Object.create(Error.prototype),fluid.logFailure=function(args,activity){fluid.log.apply(null,[fluid.logLevel.FAIL,"ASSERTION FAILED: "].concat(args)),fluid.logActivity(activity)},fluid.renderLoggingArg=function(arg){return fluid.isPrimitive(arg)||!fluid.isPlainObject(arg)?arg:JSON.stringify(arg)},fluid.builtinFail=function(args){var message=fluid.transform(args,fluid.renderLoggingArg).join("");throw new fluid.FluidError("Assertion failure - check console for more details: "+message)},fluid.fail=function(){var args=fluid.makeArray(arguments),activity=fluid.makeArray(fluid.describeActivity());fluid.popActivity(activity.length),fluid.failureEvent?fluid.failureEvent.fire(args,activity):(fluid.logFailure(args,activity),fluid.builtinFail(args,activity))},fluid.expect=function(name,target,members){fluid.transform(fluid.makeArray(members),function(key){"undefined"==typeof target[key]&&fluid.fail(name+" missing required parameter "+key)})},fluid.isLogging=function(){return logLevelStack[0].priority>fluid.logLevel.IMPORTANT.priority},fluid.isLogLevel=function(arg){return fluid.isMarker(arg)&&void 0!==arg.priority},fluid.passLogLevel=function(testLogLevel){return testLogLevel.priority<=logLevelStack[0].priority},fluid.setLogging=function(enabled){var logLevel;"boolean"==typeof enabled?logLevel=fluid.logLevel[enabled?"INFO":"IMPORTANT"]:fluid.isLogLevel(enabled)?logLevel=enabled:fluid.fail("Unrecognised fluid logging level ",enabled),logLevelStack.unshift(logLevel),fluid.defeatLogging=!fluid.isLogging()},fluid.setLogLevel=fluid.setLogging,fluid.popLogging=function(){var togo=1===logLevelStack.length?logLevelStack[0]:logLevelStack.shift();return fluid.defeatLogging=!fluid.isLogging(),togo},fluid.doLog=function(args){"undefined"!=typeof console&&(console.debug?console.debug.apply(console,args):"function"==typeof console.log&&console.log.apply(console,args))},fluid.log=function(){var directArgs=fluid.makeArray(arguments),userLogLevel=fluid.logLevel.INFO;if(fluid.isLogLevel(directArgs[0])&&(userLogLevel=directArgs.shift()),fluid.passLogLevel(userLogLevel)){var arg0=fluid.renderTimestamp(new Date)+": ",args=[arg0].concat(directArgs);fluid.doLog(args)}},fluid.isValue=function(value){return void 0!==value&&null!==value},fluid.isPrimitive=function(value){var valueType=typeof value;return!value||"string"===valueType||"boolean"===valueType||"number"===valueType||"function"===valueType},fluid.isArrayable=function(totest){return totest&&(totest.jquery||"[object Array]"===Object.prototype.toString.call(totest))},fluid.isPlainObject=function(totest,strict){var string=Object.prototype.toString.call(totest);return"[object Array]"===string?!strict:"[object Object]"===string&&(!totest.constructor||!totest.constructor.prototype||Object.prototype.hasOwnProperty.call(totest.constructor.prototype,"isPrototypeOf"))},fluid.typeCode=function(totest){return fluid.isPrimitive(totest)||!fluid.isPlainObject(totest)?"primitive":fluid.isArrayable(totest)?"array":"object"},fluid.isIoCReference=function(ref){return"string"==typeof ref&&"{"===ref.charAt(0)&&ref.indexOf("}")>0},fluid.isDOMNode=function(obj){return obj&&"number"==typeof obj.nodeType},fluid.isComponent=function(obj){return obj&&obj.constructor===fluid.componentConstructor},fluid.isUncopyable=function(totest){return fluid.isPrimitive(totest)||!fluid.isPlainObject(totest)},fluid.isApplicable=function(totest){return totest.apply&&"function"==typeof totest.apply},fluid.identity=function(arg){return arg},fluid.notImplemented=function(){fluid.fail("This operation is not implemented")},fluid.firstDefined=function(a,b){return void 0===a?b:a},fluid.freshContainer=function(tocopy){return fluid.isArrayable(tocopy)?[]:{}},fluid.copyRecurse=function(tocopy,segs){return segs.length>fluid.strategyRecursionBailout&&fluid.fail("Runaway recursion encountered in fluid.copy - reached path depth of "+fluid.strategyRecursionBailout+" via path of "+segs.join(".")+"this object is probably circularly connected. Either adjust your object structure to remove the circularity or increase fluid.strategyRecursionBailout"),fluid.isUncopyable(tocopy)?tocopy:fluid.transform(tocopy,function(value,key){segs.push(key);var togo=fluid.copyRecurse(value,segs);return segs.pop(),togo})},fluid.copy=function(tocopy){return fluid.copyRecurse(tocopy,[])},fluid.extend=$.extend,fluid.makeArray=function(arg){var togo=[];if(null!==arg&&void 0!==arg)if(fluid.isPrimitive(arg)||"number"!=typeof arg.length)togo.push(arg);else for(var i=0;i<arg.length;++i)togo[i]=arg[i];return togo},fluid.pushArray=function(holder,member,topush){var array=holder[member]?holder[member]:holder[member]=[];fluid.isArrayable(topush)?array.push.apply(array,topush):array.push(topush)},fluid.transform=function(source){if(fluid.isPrimitive(source))return source;var togo=fluid.freshContainer(source);if(fluid.isArrayable(source))for(var i=0;i<source.length;++i)transformInternal(source,togo,i,arguments);else for(var key in source)transformInternal(source,togo,key,arguments);return togo},fluid.each=function(source,func){if(fluid.isArrayable(source))for(var i=0;i<source.length;++i)func(source[i],i);else for(var key in source)func(source[key],key)},fluid.make_find=function(find_if){var target=!find_if&&void 0;return function(source,func,deffolt){var disp;if(fluid.isArrayable(source)){for(var i=0;i<source.length;++i)if(disp=func(source[i],i),disp!==target)return find_if?source[i]:disp}else for(var key in source)if(disp=func(source[key],key),disp!==target)return find_if?source[key]:disp;return deffolt}},fluid.find=fluid.make_find(!1),fluid.find_if=fluid.make_find(!0),fluid.accumulate=function(list,fn,arg){for(var i=0;i<list.length;++i)arg=fn(list[i],arg,i);return arg},fluid.add=function(a,b){return a+b},fluid.remove_if=function(source,fn,target){if(fluid.isArrayable(source))for(var i=source.length-1;i>=0;--i)fn(source[i],i)&&(target&&target.unshift(source[i]),source.splice(i,1));else for(var key in source)fn(source[key],key)&&(target&&(target[key]=source[key]),delete source[key]);return target||source},fluid.generate=function(n,generator,applyFunc){for(var togo=[],i=0;i<n;++i)togo[i]=applyFunc?generator(i):generator;return togo},fluid.iota=function(count,first){first=first||0;for(var togo=[],i=0;i<count;++i)togo[togo.length]=first++;return togo},fluid.getMembers=function(holder,name){return fluid.transform(holder,function(member){return fluid.get(member,name)})},fluid.filterKeys=function(toFilter,keys,exclude){return fluid.remove_if($.extend({},toFilter),function(value,key){return exclude^keys.indexOf(key)===-1})},fluid.censorKeys=function(toCensor,keys){return fluid.filterKeys(toCensor,keys,!0)},fluid.makeFlatten=function(index){return function(obj){var togo=[];return fluid.each(obj,function(){togo.push(arguments[index])}),togo}},fluid.keys=fluid.makeFlatten(1),fluid.values=fluid.makeFlatten(0),fluid.contains=function(obj,value){return obj?fluid.isArrayable(obj)?obj.indexOf(value)!==-1:fluid.find(obj,function(thisValue){if(value===thisValue)return!0}):void 0},fluid.keyForValue=function(obj,value){return fluid.find(obj,function(thisValue,key){if(value===thisValue)return key})},fluid.arrayToHash=function(array){var togo={};return fluid.each(array,function(el){togo[el]=!0}),togo},fluid.stableSort=function(array,func){for(var i=0;i<array.length;i++){var j,k=array[i];for(j=i;j>0&&func(k,array[j-1])<0;j--)array[j]=array[j-1];array[j]=k}},fluid.hashToArray=function(hash,keyName,func){var togo=[];return fluid.each(hash,function(el,key){var newEl={};newEl[keyName]=key,func?newEl=func(newEl,el,key)||newEl:$.extend(!0,newEl,el),togo.push(newEl)}),togo},fluid.flatten=function(array){var togo=[];return fluid.each(array,function(element){fluid.isArrayable(element)?togo=togo.concat(element):togo.push(element)}),togo},fluid.clear=function(target){if(fluid.isArrayable(target))target.length=0;else for(var i in target)delete target[i]},fluid.compareStringLength=function(ascending){return ascending?function(a,b){return a.length-b.length}:function(a,b){return b.length-a.length}},fluid.parseInteger=function(string){return isFinite(string)&&string%1===0?Number(string):NaN},fluid.freezeRecursive=function(tofreeze){return fluid.isPlainObject(tofreeze)?(fluid.each(tofreeze,function(value){fluid.freezeRecursive(value)}),Object.freeze(tofreeze)):tofreeze},fluid.marker=function(){},fluid.makeMarker=function(value,extra){var togo=Object.create(fluid.marker.prototype);return togo.value=value,$.extend(togo,extra),Object.freeze(togo)},fluid.VALUE=fluid.makeMarker("VALUE"),fluid.NO_VALUE=fluid.makeMarker("NO_VALUE"),fluid.EXPAND=fluid.makeMarker("EXPAND"),fluid.isMarker=function(totest,type){return totest instanceof fluid.marker&&(!type||totest.value===type.value)},fluid.logLevelsSpec={FATAL:0,FAIL:5,WARN:10,IMPORTANT:12,INFO:15,TRACE:20},fluid.logLevel=fluid.transform(fluid.logLevelsSpec,function(value,key){return fluid.makeMarker(key,{priority:value})});var logLevelStack=[fluid.logLevel.IMPORTANT];fluid.model={},fluid.model.copyModel=function(target,source){fluid.clear(target),$.extend(!0,target,source)},fluid.model.parseEL=function(EL){return""===EL?[]:String(EL).split(".")},fluid.model.composePath=function(prefix,suffix){return""===prefix?suffix:""===suffix?prefix:prefix+"."+suffix},fluid.model.composeSegments=function(){return fluid.makeArray(arguments).join(".")},fluid.lastDotIndex=function(path){return path.lastIndexOf(".")},fluid.model.getToTailPath=function(path){var lastdot=fluid.lastDotIndex(path);return lastdot===-1?"":path.substring(0,lastdot)},fluid.model.getTailPath=function(path){var lastdot=fluid.lastDotIndex(path);return path.substring(lastdot+1)},fluid.path=fluid.model.composeSegments,fluid.composePath=fluid.model.composePath,fluid.requireDataBinding=function(){fluid.fail("Please include DataBinding.js in order to operate complex model accessor configuration")},fluid.model.setWithStrategy=fluid.model.getWithStrategy=fluid.requireDataBinding,fluid.model.resolvePathSegment=function(root,segment,create,origEnv){return!origEnv&&root.resolvePathSegment?root.resolvePathSegment(segment):create&&void 0===root[segment]?root[segment]={}:root[segment]},fluid.model.parseToSegments=function(EL,parseEL,copy){return"number"==typeof EL||"string"==typeof EL?parseEL(EL):copy?fluid.makeArray(EL):EL},fluid.model.pathToSegments=function(EL,config){var parser=config&&config.parser?config.parser.parse:fluid.model.parseEL;return fluid.model.parseToSegments(EL,parser)},fluid.model.accessImpl=function(root,EL,newValue,config,initSegs,returnSegs,traverser){var segs=fluid.model.pathToSegments(EL,config),initPos=0;initSegs&&(initPos=initSegs.length,segs=initSegs.concat(segs));var uncess=newValue===fluid.NO_VALUE?0:1;return root=traverser(root,segs,initPos,config,uncess),newValue===fluid.NO_VALUE||newValue===fluid.VALUE?returnSegs?{root:root,segs:segs}:root:void(root[segs[segs.length-1]]=newValue)},fluid.model.accessSimple=function(root,EL,newValue,environment,initSegs,returnSegs){return fluid.model.accessImpl(root,EL,newValue,environment,initSegs,returnSegs,fluid.model.traverseSimple)},fluid.model.traverseSimple=function(root,segs,initPos,environment,uncess){for(var origEnv=environment,limit=segs.length-uncess,i=0;i<limit;++i){if(!root)return root;var segment=segs[i];root=environment&&environment[segment]?environment[segment]:fluid.model.resolvePathSegment(root,segment,1===uncess,origEnv),environment=null}return root},fluid.model.setSimple=function(root,EL,newValue,environment,initSegs){fluid.model.accessSimple(root,EL,newValue,environment,initSegs,!1)},fluid.model.getSimple=function(root,EL,environment,initSegs){return null===EL||void 0===EL||0===EL.length?root:fluid.model.accessSimple(root,EL,fluid.NO_VALUE,environment,initSegs,!1)},fluid.getImmediate=function(root,segs,i){for(var limit=void 0===i?segs.length:i+1,j=0;j<limit;++j)root=root?root[segs[j]]:void 0;return root},fluid.decodeAccessorArg=function(arg3){return arg3&&arg3!==fluid.model.defaultGetConfig&&arg3!==fluid.model.defaultSetConfig?"environment"===arg3.type?arg3.value:void 0:null},fluid.set=function(root,EL,newValue,config,initSegs){var env=fluid.decodeAccessorArg(config);void 0===env?fluid.model.setWithStrategy(root,EL,newValue,config,initSegs):fluid.model.setSimple(root,EL,newValue,env,initSegs)},fluid.get=function(root,EL,config,initSegs){var env=fluid.decodeAccessorArg(config);return void 0===env?fluid.model.getWithStrategy(root,EL,config,initSegs):fluid.model.accessImpl(root,EL,fluid.NO_VALUE,env,null,!1,fluid.model.traverseSimple)},fluid.getGlobalValue=function(path,env){if(path)return env=env||fluid.environment,fluid.get(fluid.global,path,{type:"environment",value:env})},fluid.bind=function(obj,fnName,args){return obj[fnName].apply(obj,fluid.makeArray(args))},fluid.invokeGlobalFunction=function(functionPath,args,environment){var func=fluid.getGlobalValue(functionPath,environment);return func?func.apply(null,fluid.isArrayable(args)?args:fluid.makeArray(args)):void fluid.fail("Error invoking global function: "+functionPath+" could not be located")},fluid.registerGlobalFunction=function(functionPath,func,env){env=env||fluid.environment,fluid.set(fluid.global,functionPath,func,{type:"environment",value:env})},fluid.setGlobalValue=fluid.registerGlobalFunction,fluid.registerNamespace=function(naimspace,env){env=env||fluid.environment;var existing=fluid.getGlobalValue(naimspace,env);return existing||(existing={},fluid.setGlobalValue(naimspace,existing,env)),existing},fluid.dumpEl=fluid.identity,fluid.renderTimestamp=fluid.identity,fluid.generateUniquePrefix=function(){return Math.floor(1e12*Math.random()).toString(36)+"-"};var fluid_prefix=fluid.generateUniquePrefix();fluid.fluidInstance=fluid_prefix;var fluid_guid=1;fluid.allocateGuid=function(){return fluid_prefix+fluid_guid++},fluid.registerNamespace("fluid.event"),fluid.extremePriority=4e9,fluid.priorityTypes={first:-1,last:1,before:0,after:0},fluid.extremalPriorities={none:0,testing:10,authoring:20},fluid.parsePriorityConstraint=function(constraint,fixedOnly,site){var segs=constraint.split(":"),type=segs[0],lookup=fluid.priorityTypes[type];return void 0===lookup&&fluid.fail("Invalid constraint type in priority field "+constraint+": the only supported values are "+fluid.keys(fluid.priorityTypes).join(", ")+" or numeric"),fixedOnly&&0===lookup&&fluid.fail("Constraint type in priority field "+constraint+" is not supported in a "+site+" record - you must use either a numeric value or first, last"),{type:segs[0],target:segs[1]}},fluid.parsePriority=function(priority,count,fixedOnly,site){priority=priority||0;var togo={count:count||0,fixed:null,constraint:null,site:site};"number"==typeof priority?togo.fixed=-priority:togo.constraint=fluid.parsePriorityConstraint(priority,fixedOnly,site);var multiplier=togo.constraint?fluid.priorityTypes[togo.constraint.type]:0;if(0!==multiplier){var target=togo.constraint.target||"none",extremal=fluid.extremalPriorities[target];void 0===extremal&&fluid.fail("Unrecognised extremal priority target "+target+": the currently supported values are "+fluid.keys(fluid.extremalPriorities).join(", ")+": register your value in fluid.extremalPriorities"),togo.fixed=multiplier*(fluid.extremePriority+extremal)}return null!==togo.fixed&&(togo.fixed+=togo.count/1024),togo},fluid.renderPriority=function(parsed){return parsed.constraint?parsed.constraint.target?parsed.constraint.type+":"+parsed.constraint.target:parsed.constraint.type:Math.floor(parsed.fixed)},fluid.compareByPriority=function(recA,recB){return null!==recA.priority.fixed&&null!==recB.priority.fixed?recA.priority.fixed-recB.priority.fixed:(null===recA.priority.fixed)-(null===recB.priority.fixed)},fluid.honourConstraint=function(array,firstConstraint,c){var constraint=array[c].priority.constraint,matchIndex=fluid.find(array,function(element,index){return element.namespace===constraint.target?index:void 0},-1);if(matchIndex===-1)return!0;if(matchIndex>=firstConstraint)return!1;for(var offset="after"===constraint.type?1:0,target=matchIndex+offset,temp=array[c],shift=c;shift>=target;--shift)array[shift]=array[shift-1];return array[target]=temp,!0},fluid.sortByPriority=function(array){fluid.stableSort(array,fluid.compareByPriority);for(var firstConstraint=fluid.find(array,function(element,index){return element.priority.constraint&&0===fluid.priorityTypes[element.priority.constraint.type]?index:void 0},array.length);;){if(firstConstraint===array.length)return array;for(var oldFirstConstraint=firstConstraint,c=firstConstraint;c<array.length;++c){var applied=fluid.honourConstraint(array,firstConstraint,c);applied&&++firstConstraint}if(firstConstraint===oldFirstConstraint){var holders=array.slice(firstConstraint);fluid.fail("Could not find targets for any constraints in "+holders[0].priority.site+" ",holders,": none of the targets ("+fluid.getMembers(holders,"priority.constraint.target").join(", ")+") matched any namespaces of the elements in (",array.slice(0,firstConstraint),") - this is caused by either an invalid or circular reference")}}},fluid.parsePriorityRecords=function(records,name){var array=fluid.hashToArray(records,"namespace",function(newElement,oldElement,index){$.extend(newElement,oldElement),newElement.priority=fluid.parsePriority(oldElement.priority,index,!1,name)});return fluid.sortByPriority(array),array},fluid.event.identifyListener=function(listener,soft){return"string"==typeof listener||listener.$$fluid_guid||soft||(listener.$$fluid_guid=fluid.allocateGuid()),listener.$$fluid_guid},fluid.event.impersonateListener=function(origListener,newListener){fluid.event.identifyListener(origListener),newListener.$$fluid_guid=origListener.$$fluid_guid},fluid.event.sortListeners=function(listeners){var togo=[];return fluid.each(listeners,function(oneNamespace){for(var headHard,i=0;i<oneNamespace.length;++i){var thisListener=oneNamespace[i];thisListener.softNamespace||headHard||(headHard=thisListener)}headHard?togo.push(headHard):togo=togo.concat(oneNamespace)}),fluid.sortByPriority(togo)},fluid.event.resolveListener=function(listener){var listenerName=listener.globalName||("string"==typeof listener?listener:null);if(listenerName){var listenerFunc=fluid.getGlobalValue(listenerName);listenerFunc?listener=listenerFunc:fluid.fail("Unable to look up name "+listenerName+" as a global function")}return listener},fluid.nameComponent=function(that){return that?"component with typename "+that.typeName+" and id "+that.id:"[unknown component]"},fluid.event.nameEvent=function(that,eventName){return eventName+" of "+fluid.nameComponent(that);
},fluid.makeEventFirer=function(options){options=options||{};var that,name=options.name||"<anonymous>",lazyInit=function(){that.listeners={},that.byId={},that.sortedListeners=[],that.addListener=function(listener,namespace,priority,softNamespace,listenerId){var record;if(that.destroyed&&fluid.fail("Cannot add listener to destroyed event firer "+that.name),listener){fluid.isPlainObject(listener,!0)&&!fluid.isApplicable(listener)&&(record=listener,listener=record.listener,namespace=record.namespace,priority=record.priority,softNamespace=record.softNamespace,listenerId=record.listenerId),"string"==typeof listener&&(listener={globalName:listener});var id=listenerId||fluid.event.identifyListener(listener);namespace=namespace||id,record=$.extend(record||{},{namespace:namespace,listener:listener,softNamespace:softNamespace,listenerId:listenerId,priority:fluid.parsePriority(priority,that.sortedListeners.length,!1,"listeners")}),that.byId[id]=record;var thisListeners=that.listeners[namespace]=fluid.makeArray(that.listeners[namespace]);thisListeners[softNamespace?"push":"unshift"](record),that.sortedListeners=fluid.event.sortListeners(that.listeners)}},that.addListener.apply(null,arguments)};return that={eventId:fluid.allocateGuid(),name:name,ownerId:options.ownerId,typeName:"fluid.event.firer",destroy:function(){that.destroyed=!0},addListener:function(){lazyInit.apply(null,arguments)},removeListener:function(listener){if(that.listeners){var namespace,id,record;"string"==typeof listener?(namespace=listener,record=that.listeners[namespace],record||(id=namespace,namespace=null)):"function"==typeof listener&&(id=fluid.event.identifyListener(listener,!0),id||fluid.fail("Cannot remove unregistered listener function ",listener," from event "+that.name));var rec=that.byId[id],softNamespace=rec&&rec.softNamespace;namespace=namespace||rec&&rec.namespace||id,delete that.byId[id],record=that.listeners[namespace],record&&(softNamespace?fluid.remove_if(record,function(thisLis){return thisLis.listener.$$fluid_guid===id||thisLis.listenerId===id}):record.shift(),0===record.length&&delete that.listeners[namespace]),that.sortedListeners=fluid.event.sortListeners(that.listeners)}},fire:function(){var listeners=that.sortedListeners;if(listeners&&!that.destroyed){fluid.log(fluid.logLevel.TRACE,"Firing event "+name+" to list of "+listeners.length+" listeners");for(var i=0;i<listeners.length;++i){var lisrec=listeners[i];lisrec.listener=fluid.event.resolveListener(lisrec.listener);var value,listener=lisrec.listener,ret=listener.apply(null,arguments);if((options.preventable&&ret===!1||that.destroyed)&&(value=!1),void 0!==value)return value}}}}},fluid.fireEvent=function(component,eventName,args){var firer=component.events[eventName];firer&&firer.fire.apply(null,fluid.makeArray(args))},fluid.event.addListenerToFirer=function(firer,value,namespace,wrapper){if(wrapper=wrapper||fluid.identity,fluid.isArrayable(value))for(var i=0;i<value.length;++i)fluid.event.addListenerToFirer(firer,value[i],namespace,wrapper);else"function"==typeof value||"string"==typeof value?wrapper(firer).addListener(value,namespace):value&&"object"==typeof value&&wrapper(firer).addListener(value.listener,namespace||value.namespace,value.priority,value.softNamespace,value.listenerId)},fluid.event.resolveListenerRecord=function(records){return{records:records}},fluid.expandImmediate=function(material){fluid.fail("fluid.expandImmediate could not be loaded - please include FluidIoC.js in order to operate IoC-driven event with descriptor "+material)},fluid.mergeListeners=function(that,events,listeners){fluid.each(listeners,function(value,key){var firer,namespace;if(fluid.isIoCReference(key))firer=fluid.expandImmediate(key,that),firer||fluid.fail("Error in listener record: key "+key+' could not be looked up to an event firer - did you miss out "events." when referring to an event firer?');else{var keydot=key.indexOf(".");keydot!==-1&&(namespace=key.substring(keydot+1),key=key.substring(0,keydot)),events[key]||fluid.fail("Listener registered for event "+key+" which is not defined for this component"),firer=events[key]}var record=fluid.event.resolveListenerRecord(value,that,key,namespace,!0);fluid.event.addListenerToFirer(firer,record.records,namespace,record.adderWrapper)})},fluid.eventFromRecord=function(eventSpec,eventKey,that){var event,isIoCEvent=eventSpec&&("string"!=typeof eventSpec||fluid.isIoCReference(eventSpec));return isIoCEvent?fluid.event.resolveEvent?event=fluid.event.resolveEvent(that,eventKey,eventSpec):fluid.fail("fluid.event.resolveEvent could not be loaded - please include FluidIoC.js in order to operate IoC-driven event with descriptor ",eventSpec):event=fluid.makeEventFirer({name:fluid.event.nameEvent(that,eventKey),preventable:"preventable"===eventSpec,ownerId:that.id}),event},fluid.instantiateFirers=function(that,options){fluid.each(options.events,function(eventSpec,eventKey){that.events[eventKey]=fluid.eventFromRecord(eventSpec,eventKey,that)})},fluid.mergeListenerPolicy=function(target,source,key){"string"!=typeof key&&fluid.fail("Error in listeners declaration - the keys in this structure must resolve to event names - got "+key+" from ",source);var hasNamespace=!fluid.isIoCReference(key)&&key.indexOf(".")!==-1;return hasNamespace?source||target:fluid.arrayConcatPolicy(target,source)},fluid.makeMergeListenersPolicy=function(merger,modelRelay){return function(target,source){return target=target||{},modelRelay&&(fluid.isArrayable(source)||"string"==typeof source.target)?target[""]=merger(target[""],source,""):fluid.each(source,function(listeners,key){target[key]=merger(target[key],listeners,key)}),target}},fluid.validateListenersImplemented=function(that){var errors=[];return fluid.each(that.events,function(event,name){fluid.each(event.sortedListeners,function(lisrec){lisrec.listener!==fluid.notImplemented&&"fluid.notImplemented"!==lisrec.listener.globalName||errors.push({name:name,namespace:lisrec.namespace,componentSource:fluid.model.getSimple(that.options.listeners,[name+"."+lisrec.namespace,0,"componentSource"])})})}),errors},fluid.unique=function(array){return fluid.remove_if(array,function(element,i){return!element||i>0&&element===array[i-1]})},fluid.arrayConcatPolicy=function(target,source){return fluid.makeArray(target).concat(fluid.makeArray(source))},fluid.failureEvent=fluid.makeEventFirer({name:"failure event"}),fluid.failureEvent.addListener(fluid.builtinFail,"fail"),fluid.failureEvent.addListener(fluid.logFailure,"log","before:fail"),fluid.pushSoftFailure=function(condition){"function"==typeof condition?fluid.failureEvent.addListener(condition,"fail"):condition===-1?fluid.failureEvent.removeListener("fail"):"boolean"==typeof condition&&fluid.fail("pushSoftFailure with boolean value is no longer supported")},fluid.componentConstructor=function(){},fluid.typeTag=function(name){var that=Object.create(fluid.componentConstructor.prototype);return that.typeName=name,that.id=fluid.allocateGuid(),that};var gradeTick=1,gradeTickStore={};fluid.defaultsStore={},fluid.resolveGradesImpl=function(gs,gradeNames){gradeNames=fluid.makeArray(gradeNames);for(var i=gradeNames.length-1;i>=0;--i){var gradeName=gradeNames[i];if(gradeName&&!gs.gradeHash[gradeName]){var isDynamic=fluid.isIoCReference(gradeName),options=(isDynamic?null:fluid.rawDefaults(gradeName))||{},thisTick=gradeTickStore[gradeName]||gradeTick-1;gs.lastTick=Math.max(gs.lastTick,thisTick),gs.gradeHash[gradeName]=!0,gs.gradeChain.push(gradeName);for(var oGradeNames=fluid.makeArray(options.gradeNames),j=oGradeNames.length-1;j>=0;--j)fluid.resolveGradesImpl(gs,oGradeNames[j])}}return gs},fluid.resolveGradeStructure=function(defaultName,gradeNames){var gradeStruct={lastTick:0,gradeChain:[],gradeHash:{}};return fluid.resolveGradesImpl(gradeStruct,[defaultName].concat(fluid.makeArray(gradeNames))),gradeStruct.gradeChain.reverse(),gradeStruct},fluid.hasGrade=function(options,gradeName){return!(!options||!options.gradeNames)&&fluid.contains(options.gradeNames,gradeName)},fluid.resolveGrade=function(defaults,defaultName,gradeNames){var gradeStruct=fluid.resolveGradeStructure(defaultName,gradeNames),mergeArgs=fluid.transform(gradeStruct.gradeChain,fluid.rawDefaults,fluid.copy);fluid.remove_if(mergeArgs,function(options){return!options});for(var mergePolicy={},i=0;i<mergeArgs.length;++i)mergeArgs[i]&&mergeArgs[i].mergePolicy&&(mergePolicy=$.extend(!0,mergePolicy,mergeArgs[i].mergePolicy));mergeArgs=[mergePolicy,{}].concat(mergeArgs);var mergedDefaults=fluid.merge.apply(null,mergeArgs);return mergedDefaults.gradeNames=gradeStruct.gradeChain,fluid.freezeRecursive(mergedDefaults),{defaults:mergedDefaults,lastTick:gradeStruct.lastTick}},fluid.mergedDefaultsCache={},fluid.gradeNamesToKey=function(defaultName,gradeNames){return defaultName+"|"+gradeNames.join("|")},fluid.getMergedDefaults=function(defaultName,gradeNames){gradeNames=fluid.makeArray(gradeNames);var key=fluid.gradeNamesToKey(defaultName,gradeNames),mergedDefaults=fluid.mergedDefaultsCache[key];if(mergedDefaults){for(var lastTick=0,searchGrades=mergedDefaults.defaults.gradeNames||[],i=0;i<searchGrades.length;++i)lastTick=Math.max(lastTick,gradeTickStore[searchGrades[i]]||0);lastTick>mergedDefaults.lastTick&&(fluid.log(fluid.logLevel.TRACE,"Clearing cache for component "+defaultName+" with gradeNames ",searchGrades),mergedDefaults=null)}if(!mergedDefaults){var defaults=fluid.rawDefaults(defaultName);if(!defaults)return defaults;mergedDefaults=fluid.mergedDefaultsCache[key]=fluid.resolveGrade(defaults,defaultName,gradeNames)}return mergedDefaults.defaults},fluid.upgradePrimitiveFunc=function(rec,key){if(rec&&fluid.isPrimitive(rec)){var togo={};return togo[key||("string"==typeof rec&&"{"!==rec.charAt(0)?"funcName":"func")]=rec,togo.args=fluid.NO_VALUE,togo}return rec},fluid.annotateListeners=function(componentName,options){options.listeners=fluid.transform(options.listeners,function(record){var togo=fluid.makeArray(record);return fluid.transform(togo,function(onerec){return onerec=fluid.upgradePrimitiveFunc(onerec,"listener"),onerec.componentSource=componentName,onerec})}),options.invokers=fluid.transform(options.invokers,function(record){return record=fluid.upgradePrimitiveFunc(record),record&&(record.componentSource=componentName),record})},fluid.rawDefaults=function(componentName){var entry=fluid.defaultsStore[componentName];return entry&&entry.options},fluid.registerRawDefaults=function(componentName,options){fluid.pushActivity("registerRawDefaults","registering defaults for grade %componentName with options %options",{componentName:componentName,options:options});var optionsCopy=fluid.expandCompact?fluid.expandCompact(options):fluid.copy(options);fluid.annotateListeners(componentName,optionsCopy);var callerInfo=fluid.getCallerInfo&&fluid.getCallerInfo(6);fluid.defaultsStore[componentName]={options:optionsCopy,callerInfo:callerInfo},gradeTickStore[componentName]=gradeTick++,fluid.popActivity()},fluid.doIndexDefaults=function(defaultName,defaults,index,indexSpec){for(var requiredGrades=fluid.makeArray(indexSpec.gradeNames),i=0;i<requiredGrades.length;++i)if(!fluid.hasGrade(defaults,requiredGrades[i]))return;for(var indexFunc="function"==typeof indexSpec.indexFunc?indexSpec.indexFunc:fluid.getGlobalValue(indexSpec.indexFunc),keys=indexFunc(defaults)||[],j=0;j<keys.length;++j)fluid.pushArray(index,keys[j],defaultName)},fluid.indexDefaults=function(indexName,indexSpec){var index={};for(var defaultName in fluid.defaultsStore){var defaults=fluid.getMergedDefaults(defaultName);fluid.doIndexDefaults(defaultName,defaults,index,indexSpec)}return index},fluid.defaults=function(componentName,options){if(void 0===options)return fluid.getMergedDefaults(componentName);options&&options.options&&fluid.fail("Probable error in options structure for "+componentName+' with option named "options" - perhaps you meant to write these options at top level in fluid.defaults? - ',options),fluid.registerRawDefaults(componentName,options);var gradedDefaults=fluid.getMergedDefaults(componentName);fluid.hasGrade(gradedDefaults,"fluid.function")||fluid.makeComponentCreator(componentName)},fluid.makeComponentCreator=function(componentName){var creator=function(){var defaults=fluid.getMergedDefaults(componentName);if(defaults.gradeNames&&0!==defaults.gradeNames.length){if(defaults.initFunction)return fluid.initComponent(componentName,arguments);for(var blankGrades=[],i=0;i<defaults.gradeNames.length;++i){var gradeName=defaults.gradeNames[i],rawDefaults=fluid.rawDefaults(gradeName);rawDefaults||blankGrades.push(gradeName)}0===blankGrades.length?fluid.fail("Cannot make component creator for type "+componentName+" which does not have an initFunction defined"):fluid.fail("The grade hierarchy of component with type "+componentName+" is incomplete - it inherits from the following grade(s): "+blankGrades.join(", ")+" for which the grade definitions are corrupt or missing. Please check the files which might include these grades and ensure they are readable and have been loaded by this instance of Infusion")}else fluid.fail("Cannot make component creator for type "+componentName+" which does not have any gradeNames defined")},existing=fluid.getGlobalValue(componentName);existing&&$.extend(creator,existing),fluid.setGlobalValue(componentName,creator)},fluid.emptyPolicy=fluid.freezeRecursive({}),fluid.derefMergePolicy=function(policy){return(policy?policy["*"]:fluid.emptyPolicy)||fluid.emptyPolicy},fluid.compileMergePolicy=function(mergePolicy){var builtins={},defaultValues={},togo={builtins:builtins,defaultValues:defaultValues};return mergePolicy?(fluid.each(mergePolicy,function(value,key){var parsed={},builtin=!0;if("function"==typeof value)parsed.func=value;else if("object"==typeof value)parsed=value;else if(fluid.isDefaultValueMergePolicy(value))fluid.set(defaultValues,key,"{that}.options."+value),togo.hasDefaults=!0,builtin=!1;else for(var split=value.split(/\s*,\s*/),i=0;i<split.length;++i)parsed[split[i]]=!0;builtin&&fluid.set(builtins,fluid.composePath(key,"*"),parsed)}),togo):togo},fluid.isDefaultValueMergePolicy=function(policy){return"string"==typeof policy&&policy.indexOf(",")===-1&&!/replace|nomerge|noexpand/.test(policy)},fluid.mergeOneImpl=function(thisTarget,thisSource,j,sources,newPolicy,i,segs){var togo=thisTarget,primitiveTarget=fluid.isPrimitive(thisTarget);return void 0!==thisSource&&(newPolicy.func||null===thisSource||!fluid.isPlainObject(thisSource)||newPolicy.nomerge?(sources[j]=void 0,togo=newPolicy.func?newPolicy.func.call(null,thisTarget,thisSource,segs[i-1],segs,i):thisSource):primitiveTarget&&(togo=thisTarget=fluid.freshContainer(thisSource))),togo},fluid.fetchMergeChildren=function(target,i,segs,sources,mergePolicy,options){for(var thisPolicy=fluid.derefMergePolicy(mergePolicy),j=sources.length-1;j>=0;--j){var source=sources[j];if(void 0!==source&&(fluid.each(source,function(newSource,name){var childPolicy=fluid.concreteTrundler(mergePolicy,name);name in target&&(!options.evaluateFully||void 0!==childPolicy||fluid.isPrimitive(target[name]))||(segs[i]=name,options.strategy(target,name,i+1,segs,sources,mergePolicy))}),thisPolicy.replace))break}return target},fluid.inEvaluationMarker=Object.freeze({__CURRENTLY_IN_EVALUATION__:!0}),fluid.strategyRecursionBailout=50,fluid.makeMergeStrategy=function(options){var strategy=function(target,name,i,segs,sources,policy){if(i>fluid.strategyRecursionBailout&&fluid.fail("Overflow/circularity in options merging, current path is ",segs," at depth ",i,' - please protect components from merging using the "nomerge" merge policy'),!fluid.isPrimitive(target)){fluid.isTracing&&fluid.tracing.pathCount.push(fluid.path(segs.slice(0,i)));var oldTarget;if(name in target){if(oldTarget=target[name],!options.evaluateFully)return oldTarget}else target!==fluid.inEvaluationMarker&&(target[name]=fluid.inEvaluationMarker);void 0===sources&&(segs=fluid.makeArray(segs),sources=regenerateSources(options.sources,segs,i-1,options.sourceStrategies),policy=regenerateCursor(options.mergePolicy,segs,i-1,fluid.concreteTrundler));var start,limit,mul,newPolicyHolder=fluid.concreteTrundler(policy,name),newPolicy=fluid.derefMergePolicy(newPolicyHolder);newPolicy.replace?(start=1-sources.length,limit=0,mul=-1):(start=0,limit=sources.length-1,mul=1);for(var thisTarget,newSources=[],j=start;j<=limit;++j){var k=mul*j,thisSource=options.sourceStrategies[k](sources[k],name,i,segs);if(void 0!==thisSource&&(fluid.isPrimitive(thisSource)||(newSources[k]=thisSource),void 0===oldTarget)){if(mul===-1){thisTarget=target[name]=thisSource;break}thisTarget=fluid.mergeOneImpl(thisTarget,thisSource,j,newSources,newPolicy,i,segs,options),target!==fluid.inEvaluationMarker&&(target[name]=thisTarget)}}return void 0!==oldTarget&&(thisTarget=oldTarget),newSources.length>0&&fluid.isPlainObject(thisTarget)&&fluid.fetchMergeChildren(thisTarget,i,segs,newSources,newPolicyHolder,options),void 0===oldTarget&&0===newSources.length&&delete target[name],thisTarget}};return options.strategy=strategy,strategy},fluid.driveStrategy=function(root,pathSegs,strategy){pathSegs=fluid.makeArray(pathSegs);for(var i=0;i<pathSegs.length;++i){if(!root)return;root=strategy(root,pathSegs[i],i+1,pathSegs)}return root},fluid.concreteTrundler=function(source,seg){return source?source[seg]:void 0},fluid.merge=function(policy){var sources=Array.prototype.slice.call(arguments,1),compiled=fluid.compileMergePolicy(policy).builtins,options=fluid.makeMergeOptions(compiled,sources,{});return options.initter(),options.target},fluid.simpleGingerBlock=function(source,recordType){var block={target:source,simple:!0,strategy:fluid.concreteTrundler,initter:fluid.identity,recordType:recordType,priority:fluid.mergeRecordTypes[recordType]};return block},fluid.makeMergeOptions=function(policy,sources,userOptions){var options={mergePolicy:policy,sources:sources};return options=$.extend(options,userOptions),options.target=options.target||fluid.freshContainer(options.sources[0]),options.sourceStrategies=options.sourceStrategies||fluid.generate(options.sources.length,fluid.concreteTrundler),options.initter=function(){options.evaluateFully=!0,fluid.fetchMergeChildren(options.target,0,[],options.sources,options.mergePolicy,options)},fluid.makeMergeStrategy(options),options},fluid.transformOptions=function(options,transRec){fluid.expect("Options transformation record",transRec,["transformer","config"]);var transFunc=fluid.getGlobalValue(transRec.transformer);return transFunc.call(null,options,transRec.config)},fluid.findMergeBlocks=function(mergeBlocks,recordType){return fluid.remove_if(fluid.makeArray(mergeBlocks),function(block){return block.recordType!==recordType})},fluid.transformOptionsBlocks=function(mergeBlocks,transformOptions,recordTypes){fluid.each(recordTypes,function(recordType){var blocks=fluid.findMergeBlocks(mergeBlocks,recordType);fluid.each(blocks,function(block){var source=block.source?"source":"target";block[block.simple||"target"===source?"target":"source"]=fluid.transformOptions(block[source],transformOptions)})})},fluid.dedupeDistributionNamespaces=function(mergeBlocks){var byNamespace={};fluid.remove_if(mergeBlocks,function(mergeBlock){var ns=mergeBlock.namespace;if(ns){if(byNamespace[ns]&&byNamespace[ns]!==mergeBlock.contextThat.id)return!0;byNamespace[ns]=mergeBlock.contextThat.id}})},fluid.deliverOptionsStrategy=fluid.identity,fluid.computeComponentAccessor=fluid.identity,fluid.computeDynamicComponents=fluid.identity,fluid.mergeRecordTypes={defaults:1e3,defaultValueMerge:900,subcomponentRecord:800,user:700,distribution:100},fluid.model.applyChangeRequest=function(model,request){var segs=request.segs;if(0===segs.length)"ADD"===request.type?$.extend(!0,model,request.value):fluid.clear(model);else if("ADD"===request.type)fluid.model.setSimple(model,request.segs,request.value);else{for(var i=0;i<segs.length-1;++i)if(model=model[segs[i]],!model)return;var last=segs[segs.length-1];delete model[last]}},fluid.destroyValue=function(target,segs){target&&fluid.model.applyChangeRequest(target,{type:"DELETE",segs:segs})},fluid.mergeComponentOptions=function(that,componentName,userOptions,localOptions){function computeMergePolicy(){mergePolicy=fluid.driveStrategy(options,"mergePolicy",mergeOptions.strategy),mergePolicy=$.extend({},fluid.rootMergePolicy,mergePolicy),compiledPolicy=fluid.compileMergePolicy(mergePolicy),$.extend(!0,sharedMergePolicy,compiledPolicy.builtins)}var rawDefaults=fluid.rawDefaults(componentName),defaults=fluid.getMergedDefaults(componentName,rawDefaults&&rawDefaults.gradeNames?null:localOptions.gradeNames),sharedMergePolicy={},mergeBlocks=[];mergeBlocks=fluid.expandComponentOptions?mergeBlocks.concat(fluid.expandComponentOptions(sharedMergePolicy,defaults,userOptions,that)):mergeBlocks.concat([fluid.simpleGingerBlock(defaults,"defaults"),fluid.simpleGingerBlock(userOptions,"user")]);var options={},sourceStrategies=[],sources=[],baseMergeOptions={target:options,sourceStrategies:sourceStrategies},updateBlocks=function(){fluid.each(mergeBlocks,function(block){fluid.isPrimitive(block.priority)&&(block.priority=fluid.parsePriority(block.priority,0,!1,"options distribution"))}),fluid.sortByPriority(mergeBlocks),fluid.dedupeDistributionNamespaces(mergeBlocks),sourceStrategies.length=0,sources.length=0,fluid.each(mergeBlocks,function(block){sourceStrategies.push(block.strategy),sources.push(block.target)})};updateBlocks();var mergeOptions=fluid.makeMergeOptions(sharedMergePolicy,sources,baseMergeOptions);mergeOptions.mergeBlocks=mergeBlocks,mergeOptions.updateBlocks=updateBlocks,mergeOptions.destroyValue=function(segs){for(var i=0;i<mergeBlocks.length;++i)fluid.destroyValue(mergeBlocks[i].target,segs);fluid.destroyValue(baseMergeOptions.target,segs)};var compiledPolicy,mergePolicy;computeMergePolicy(),mergeOptions.computeMergePolicy=computeMergePolicy,compiledPolicy.hasDefaults&&(fluid.generateExpandBlock?(mergeBlocks.push(fluid.generateExpandBlock({options:compiledPolicy.defaultValues,recordType:"defaultValueMerge",priority:fluid.mergeRecordTypes.defaultValueMerge},that,{})),updateBlocks()):fluid.fail("Cannot operate mergePolicy ",mergePolicy," for component ",that," without including FluidIoC.js")),that.options=options,fluid.driveStrategy(options,"gradeNames",mergeOptions.strategy),fluid.deliverOptionsStrategy(that,options,mergeOptions),fluid.computeComponentAccessor(that,userOptions&&userOptions.localRecord);var transformOptions=fluid.driveStrategy(options,"transformOptions",mergeOptions.strategy);return transformOptions&&(fluid.transformOptionsBlocks(mergeBlocks,transformOptions,["user","subcomponentRecord"]),updateBlocks()),baseMergeOptions.target.mergePolicy||computeMergePolicy(),mergeOptions},fluid.defaults("fluid.function",{}),fluid.invokeGradedFunction=function(name,spec){var defaults=fluid.defaults(name);defaults&&defaults.argumentMap&&fluid.hasGrade(defaults,"fluid.function")||fluid.fail("Cannot look up name "+name+" to a function with registered argumentMap - got defaults ",defaults);var args=[];return fluid.each(defaults.argumentMap,function(value,key){args[value]=spec[key]}),fluid.invokeGlobalFunction(name,args)},fluid.noNamespaceDistributionPrefix="no-namespace-distribution-",fluid.mergeOneDistribution=function(target,source,key){var namespace=source.namespace||key||fluid.noNamespaceDistributionPrefix+fluid.allocateGuid();source.namespace=namespace,target[namespace]=$.extend(!0,{},target[namespace],source)},fluid.distributeOptionsPolicy=function(target,source){if(target=target||{},fluid.isArrayable(source))for(var i=0;i<source.length;++i)fluid.mergeOneDistribution(target,source[i]);else"string"==typeof source.target?fluid.mergeOneDistribution(target,source):fluid.each(source,function(oneSource,key){fluid.mergeOneDistribution(target,oneSource,key)});return target},fluid.mergingArray=function(){},fluid.mergingArray.prototype=[],fluid.membersMergePolicy=function(target,source){return target=target||{},fluid.each(source,function(oneSource,key){target[key]||(target[key]=new fluid.mergingArray),oneSource instanceof fluid.mergingArray?target[key].push.apply(target[key],oneSource):void 0!==oneSource&&target[key].push(oneSource)}),target},fluid.invokerStrategies=fluid.arrayToHash(["func","funcName","listener","this","method"]),fluid.invokersMergePolicy=function(target,source){return target=target||{},fluid.each(source,function(oneInvoker,name){if(!oneInvoker)return void(target[name]=oneInvoker);oneInvoker=fluid.upgradePrimitiveFunc(oneInvoker);var oneT=target[name];oneT||(oneT=target[name]={});for(var key in fluid.invokerStrategies)if(key in oneInvoker)for(var key2 in fluid.invokerStrategies)oneT[key2]=void 0;$.extend(oneT,oneInvoker)}),target},fluid.rootMergePolicy={gradeNames:fluid.arrayConcatPolicy,distributeOptions:fluid.distributeOptionsPolicy,members:{noexpand:!0,func:fluid.membersMergePolicy},invokers:{noexpand:!0,func:fluid.invokersMergePolicy},transformOptions:"replace",listeners:fluid.makeMergeListenersPolicy(fluid.mergeListenerPolicy)},fluid.defaults("fluid.component",{initFunction:"fluid.initLittleComponent",mergePolicy:fluid.rootMergePolicy,argumentMap:{options:0},events:{onCreate:null,onDestroy:null,afterDestroy:null}}),fluid.defaults("fluid.emptySubcomponent",{gradeNames:["fluid.component"]}),fluid.computeNickName=function(typeName){var segs=fluid.model.parseEL(typeName);return segs[segs.length-1]},fluid.defaults("fluid.typeFount",{gradeNames:["fluid.component"]}),fluid.initLittleComponent=function(name,userOptions,localOptions,receiver){var that=fluid.typeTag(name);that.lifecycleStatus="constructing",localOptions=localOptions||{gradeNames:"fluid.component"},that.destroy=fluid.makeRootDestroy(that);var mergeOptions=fluid.mergeComponentOptions(that,name,userOptions,localOptions);mergeOptions.exceptions={members:{model:!0,modelRelay:!0}};var options=that.options;that.events={},(receiver||fluid.identity)(that,options,mergeOptions.strategy),fluid.computeDynamicComponents(that,mergeOptions);for(var i=0;i<mergeOptions.mergeBlocks.length;++i)mergeOptions.mergeBlocks[i].initter();return mergeOptions.initter(),delete options.mergePolicy,fluid.instantiateFirers(that,options),fluid.mergeListeners(that,that.events,options.listeners),that},fluid.diagnoseFailedView=fluid.identity,fluid.makeRootDestroy=function(that){return function(){fluid.doDestroy(that),fluid.fireEvent(that,"afterDestroy",[that,"",null])}},fluid.isDestroyed=function(that){return"destroyed"===that.lifecycleStatus},fluid.doDestroy=function(that,name,parent){fluid.fireEvent(that,"onDestroy",[that,name||"",parent]),that.lifecycleStatus="destroyed";for(var key in that.events)"afterDestroy"!==key&&"function"==typeof that.events[key].destroy&&that.events[key].destroy();that.applier&&that.applier.destroy()},fluid.initComponent=function(componentName,initArgs){var options=fluid.defaults(componentName);options.gradeNames||fluid.fail("Cannot initialise component "+componentName+" which has no gradeName registered");var that,args=[componentName].concat(fluid.makeArray(initArgs));fluid.pushActivity("initComponent","constructing component of type %componentName with arguments %initArgs",{componentName:componentName,initArgs:initArgs}),that=fluid.invokeGlobalFunction(options.initFunction,args),fluid.diagnoseFailedView(componentName,that,options,args),fluid.initDependents&&fluid.initDependents(that);var errors=fluid.validateListenersImplemented(that);return errors.length>0&&fluid.fail(fluid.transform(errors,function(error){return["Error constructing component ",that," - the listener for event "+error.name+" with namespace "+error.namespace+((error.componentSource?" which was defined in grade "+error.componentSource:"")+" needs to be overridden with a concrete implementation")]})).join("\n"),"constructing"===that.lifecycleStatus&&(that.lifecycleStatus="constructed"),that.events.onCreate.fire(that),fluid.popActivity(),that},fluid.initSubcomponentImpl=function(that,entry,args){var togo;if("function"!=typeof entry){var entryType="string"==typeof entry?entry:entry.type;togo="fluid.emptySubcomponent"===entryType?null:fluid.invokeGlobalFunction(entryType,args)}else togo=entry.apply(null,args);return togo};var charStart="(?:[\\w\\u00c0-\\uFFFF*_-";fluid.simpleCSSMatcher={regexp:new RegExp("([#.]?)("+charStart+"]|\\\\.)+)","g"),charToTag:{"":"tag","#":"id",".":"clazz"}},fluid.IoCSSMatcher={regexp:new RegExp("([&#]?)("+charStart+"]|\\.|\\/)+)","g"),charToTag:{"":"context","&":"context","#":"id"}};var childSeg=new RegExp("\\s*(>)?\\s*","g");fluid.parseSelector=function(selstring,strategy){var togo=[];selstring=selstring.trim();var regexp=strategy.regexp;regexp.lastIndex=0;for(var lastIndex=0;;){for(var atNode=[],first=!0;;){var segMatch=regexp.exec(selstring);if(!segMatch)break;if(segMatch.index!==lastIndex){if(!first)break;fluid.fail("Error in selector string - cannot match child selector expression starting at "+selstring.substring(lastIndex))}var thisNode={},text=segMatch[2],targetTag=strategy.charToTag[segMatch[1]];targetTag&&(thisNode[targetTag]=text),atNode[atNode.length]=thisNode,lastIndex=regexp.lastIndex,first=!1}childSeg.lastIndex=lastIndex;var fullAtNode={predList:atNode},childMatch=childSeg.exec(selstring);if(childMatch&&childMatch.index===lastIndex||fluid.fail("Error in selector string - can not match child selector expression at "+selstring.substring(lastIndex)),">"===childMatch[1]&&(fullAtNode.child=!0),togo[togo.length]=fullAtNode,childSeg.lastIndex>=selstring.length)break;lastIndex=childSeg.lastIndex,regexp.lastIndex=childSeg.lastIndex}return togo},fluid.stringToRegExp=function(str,flags){return new RegExp(str.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),flags)},fluid.stringTemplate=function(template,values){var keys=fluid.keys(values);keys=keys.sort(fluid.compareStringLength());for(var i=0;i<keys.length;++i){var key=keys[i],re=fluid.stringToRegExp("%"+key,"g");template=template.replace(re,values[key])}return template}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.promise=function(){var that={onResolve:[],onReject:[]};return that.then=function(onResolve,onReject){return onResolve&&("resolve"===that.disposition?onResolve(that.value):that.onResolve.push(onResolve)),onReject&&("reject"===that.disposition?onReject(that.value):that.onReject.push(onReject)),that},that.resolve=function(value){return that.disposition?fluid.fail("Error: resolving promise ",that,' which has already received "'+that.disposition+'"'):that.complete("resolve",that.onResolve,value),that},that.reject=function(reason){return that.disposition?fluid.fail("Error: rejecting promise ",that,'which has already received "'+that.disposition+'"'):that.complete("reject",that.onReject,reason),that},that.complete=function(which,queue,arg){that.disposition=which,that.value=arg;for(var i=0;i<queue.length;++i)queue[i](arg)},that},fluid.isPromise=function(totest){return totest&&"function"==typeof totest.then},fluid.toPromise=function(promiseOrValue){if(fluid.isPromise(promiseOrValue))return promiseOrValue;var togo=fluid.promise();return togo.resolve(promiseOrValue),togo},fluid.promise.follow=function(source,target){source.then(target.resolve,target.reject)},fluid.promise.map=function(source,func){var promise=fluid.toPromise(source),togo=fluid.promise();return promise.then(function(value){var mapped=func(value);fluid.isPromise(mapped)?fluid.promise.follow(mapped,togo):togo.resolve(mapped)},function(error){togo.reject(error)}),togo},fluid.promise.makeSequencer=function(sources,options,strategy){return fluid.isArrayable(sources)||fluid.fail("fluid.promise sequence algorithms must be supplied an array as source"),{sources:sources,resolvedSources:[],index:0,strategy:strategy,options:options,returns:[],promise:fluid.promise()}},fluid.promise.progressSequence=function(that,retValue){that.returns.push(retValue),that.index++,fluid.promise.resumeSequence(that)},fluid.promise.processSequenceReject=function(that,error){for(var i=that.index-1;i>=0;--i){
var resolved=that.resolvedSources[i],accumulator=fluid.isPromise(resolved)&&"function"==typeof resolved.accumulateRejectionReason?resolved.accumulateRejectionReason:fluid.identity;error=accumulator(error)}that.promise.reject(error)},fluid.promise.resumeSequence=function(that){if(that.index===that.sources.length)that.promise.resolve(that.strategy.resolveResult(that));else{var value=that.strategy.invokeNext(that);that.resolvedSources[that.index]=value,fluid.isPromise(value)?value.then(function(retValue){fluid.promise.progressSequence(that,retValue)},function(error){fluid.promise.processSequenceReject(that,error)}):fluid.promise.progressSequence(that,value)}},fluid.promise.makeSequenceStrategy=function(){return{invokeNext:function(that){var source=that.sources[that.index];return"function"==typeof source?source(that.options):source},resolveResult:function(that){return that.returns}}},fluid.promise.sequence=function(sources,options){var sequencer=fluid.promise.makeSequencer(sources,options,fluid.promise.makeSequenceStrategy());return fluid.promise.resumeSequence(sequencer),sequencer.promise},fluid.promise.makeTransformerStrategy=function(){return{invokeNext:function(that){var lisrec=that.sources[that.index];lisrec.listener=fluid.event.resolveListener(lisrec.listener);var value=lisrec.listener(that.returns[that.index],that.options);return value},resolveResult:function(that){return that.returns[that.index]}}},fluid.promise.makeTransformer=function(listeners,payload,options){listeners.unshift({listener:function(){return payload}});var sequencer=fluid.promise.makeSequencer(listeners,options,fluid.promise.makeTransformerStrategy());return sequencer.returns.push(null),fluid.promise.resumeSequence(sequencer),sequencer},fluid.promise.filterNamespaces=function(listeners,namespaces){return namespaces?fluid.remove_if(fluid.makeArray(listeners),function(element){return element.namespace&&!element.softNamespace&&!fluid.contains(namespaces,element.namespace)}):listeners},fluid.promise.fireTransformEvent=function(event,payload,options){options=options||{};var listeners=options.reverse?fluid.makeArray(event.sortedListeners).reverse():fluid.makeArray(event.sortedListeners);listeners=fluid.promise.filterNamespaces(listeners,options.filterNamespaces);var transformer=fluid.promise.makeTransformer(listeners,payload,options);return transformer.promise}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";function applyOp(node,func){return node=$(node),node.trigger("fluid-"+func),node.triggerHandler(func),node[func](),node}fluid.uaMatch=function(ua){ua=ua.toLowerCase();var match=/(chrome)[ \/]([\w.]+)/.exec(ua)||/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||ua.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"}};var matched,browser;$.browser||(navigator.userAgent.match(/Trident\/7\./)?browser={msie:!0,version:11}:(matched=fluid.uaMatch(navigator.userAgent),browser={},matched.browser&&(browser[matched.browser]=!0,browser.version=matched.version),browser.chrome?browser.webkit=!0:browser.webkit&&(browser.safari=!0)),$.browser=browser);var NAMESPACE_KEY="fluid-scoped-data";fluid.getScopedData=function(target,key){var data=$(target).data(NAMESPACE_KEY);return data?data[key]:void 0},fluid.setScopedData=function(target,key,value){$(target).each(function(){var data=$.data(this,NAMESPACE_KEY)||{};data[key]=value,$.data(this,NAMESPACE_KEY,data)})};var lastFocusedElement=null;$(document).on("focusin",function(event){lastFocusedElement=event.target}),fluid.getLastFocusedElement=function(){return lastFocusedElement};var ENABLEMENT_KEY="enablement";fluid.enabled=function(target,state){return target=$(target),void 0===state?fluid.getScopedData(target,ENABLEMENT_KEY)!==!1:($("*",target).add(target).each(function(){void 0!==fluid.getScopedData(this,ENABLEMENT_KEY)?fluid.setScopedData(this,ENABLEMENT_KEY,state):/select|textarea|input/i.test(this.nodeName)&&$(this).prop("disabled",!state)}),void fluid.setScopedData(target,ENABLEMENT_KEY,state))},fluid.initEnablement=function(target){fluid.setScopedData(target,ENABLEMENT_KEY,!0)},fluid.resolveEventTarget=function(event){for(;event.originalEvent&&event.originalEvent.target;)event=event.originalEvent;return event.target},$.each(["focus","blur"],function(i,name){fluid[name]=function(elem){return applyOp(elem,name)}}),fluid.changeElementValue=function(node,value){node=$(node),node.val(value).change()}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.dom=fluid.dom||{};var getNextNode=function(iterator){if(iterator.node.firstChild)return iterator.node=iterator.node.firstChild,iterator.depth+=1,iterator;for(;iterator.node;){if(iterator.node.nextSibling)return iterator.node=iterator.node.nextSibling,iterator;iterator.node=iterator.node.parentNode,iterator.depth-=1}return iterator};fluid.dom.iterateDom=function(node,acceptor,allNodes){for(var condition,currentNode={node:node,depth:0},prevNode=node;null!==currentNode.node&&currentNode.depth>=0&&currentNode.depth<fluid.dom.iterateDom.DOM_BAIL_DEPTH;){if(condition=null,(1===currentNode.node.nodeType||allNodes)&&(condition=acceptor(currentNode.node,currentNode.depth)),condition)if("delete"===condition)currentNode.node.parentNode.removeChild(currentNode.node),currentNode.node=prevNode;else if("stop"===condition)return currentNode.node;prevNode=currentNode.node,currentNode=getNextNode(currentNode)}},fluid.dom.iterateDom.DOM_BAIL_DEPTH=256,fluid.dom.isContainer=function(container,containee){for(;containee;containee=containee.parentNode)if(container===containee)return!0;return!1},fluid.dom.getElementText=function(element){for(var nodes=element.childNodes,text="",i=0;i<nodes.length;++i){var child=nodes[i];3===child.nodeType&&(text+=child.nodeValue)}return text}}(jQuery,fluid_2_0_0),fluid_2_0_0=fluid_2_0_0||{},function($,fluid){"use strict";var unUnicode=/(\\u[\dabcdef]{4}|\\x[\dabcdef]{2})/g;fluid.unescapeProperties=function(string){string=string.replace(unUnicode,function(match){var code=match.substring(2),parsed=parseInt(code,16);return String.fromCharCode(parsed)});for(var pos=0;;){var backpos=string.indexOf("\\",pos);if(backpos===-1)break;if(backpos===string.length-1)return[string.substring(0,string.length-1),!0];var replace=string.charAt(backpos+1);"n"===replace&&(replace="\n"),"r"===replace&&(replace="\r"),"t"===replace&&(replace="\t"),string=string.substring(0,backpos)+replace+string.substring(backpos+2),pos=backpos+1}return[string,!1]};var breakPos=/[^\\][\s:=]/;fluid.parseJavaProperties=function(text){var togo={};text=text.replace(/\r\n/g,"\n"),text=text.replace(/\r/g,"\n");for(var contin,key,valueComp,valueRaw,valueEsc,lines=text.split("\n"),i=0;i<lines.length;++i){var line=$.trim(lines[i]);if(line&&"#"!==line.charAt(0)&&"!"!==line.charAt(0)){if(contin)valueEsc=fluid.unescapeProperties(line);else{valueComp="";var breakpos=line.search(breakPos);breakpos===-1?(key=line,valueRaw=""):(key=$.trim(line.substring(0,breakpos+1)),valueRaw=$.trim(line.substring(breakpos+2)),":"!==valueRaw.charAt(0)&&"="!==valueRaw.charAt(0)||(valueRaw=$.trim(valueRaw.substring(1)))),key=fluid.unescapeProperties(key)[0],valueEsc=fluid.unescapeProperties(valueRaw)}contin=valueEsc[1],valueEsc[1]?valueComp+=valueEsc[0]:togo[key]=valueComp+valueEsc[0]}}return togo},fluid.formatMessage=function(messageString,args){if(!args)return messageString;"string"==typeof args&&(args=[args]);for(var i=0;i<args.length;++i)messageString=messageString.replace("{"+i+"}",args[i]);return messageString}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{},fluid=fluid||fluid_2_0_0;!function($,fluid){"use strict";function printImpl(obj,small,options){function out(str){options.output+=str}var big=small+options.indentChars,isFunction="function"==typeof obj;if(void 0!==options.maxRenderChars&&options.output.length>options.maxRenderChars)return!0;if(null===obj)out("null");else if(void 0===obj)out("undefined");else if(obj===fluid.SYNTHETIC_PROPERTY)out("[Synthetic property]");else if(fluid.isPrimitive(obj)&&!isFunction)out(JSON.stringify(obj));else{if(options.stack.indexOf(obj)!==-1)return void out("(CIRCULAR)");options.stack.push(obj);var i;if(fluid.isArrayable(obj))if(0===obj.length)out("[]");else{for(out("[\n"+big),i=0;i<obj.length;++i){if(printImpl(obj[i],big,options))return!0;i!==obj.length-1&&out(",\n"+big)}out("\n"+small+"]")}else{out("{"+(isFunction?" Function":"")+"\n"+big);var keys=fluid.keys(obj);for(i=0;i<keys.length;++i){var key=keys[i],value=fluid.getSafeProperty(obj,key);if(out(JSON.stringify(key)+": "),printImpl(value,big,options))return!0;i!==keys.length-1&&out(",\n"+big)}out("\n"+small+"}")}options.stack.pop()}}fluid.renderTimestamp=function(date){var zeropad=function(num,width){width||(width=2);var numstr=void 0===num?"":num.toString();return"00000".substring(5-width+numstr.length)+numstr};return zeropad(date.getHours())+":"+zeropad(date.getMinutes())+":"+zeropad(date.getSeconds())+"."+zeropad(date.getMilliseconds(),3)},fluid.isTracing=!1,fluid.registerNamespace("fluid.tracing"),fluid.tracing.pathCount=[],fluid.tracing.summarisePathCount=function(pathCount){pathCount=pathCount||fluid.tracing.pathCount;for(var togo={},i=0;i<pathCount.length;++i){var path=pathCount[i];togo[path]?++togo[path]:togo[path]=1}var toReallyGo=[];return fluid.each(togo,function(el,path){toReallyGo.push({path:path,count:el})}),toReallyGo.sort(function(a,b){return b.count-a.count}),toReallyGo},fluid.tracing.condensePathCount=function(prefixes,pathCount){prefixes=fluid.makeArray(prefixes);var prefixCount={};fluid.each(prefixes,function(prefix){prefixCount[prefix]=0});var togo=[];return fluid.each(pathCount,function(el){var path=el.path;fluid.find(prefixes,function(prefix){if(0===path.indexOf(prefix))return prefixCount[prefix]+=el.count,!0})||togo.push(el)}),fluid.each(prefixCount,function(count,path){togo.unshift({path:path,count:count})}),togo},fluid.detectStackStyle=function(e){var style="other",stackStyle={offset:0};return e.arguments?style="chrome":"undefined"!=typeof window&&window.opera&&e.stacktrace?style="opera10":e.stack?(style="firefox",stackStyle.offset=e.stack.indexOf("Trace exception")===-1?1:0):"undefined"==typeof window||!window.opera||"stacktrace"in e||(style="opera"),stackStyle.style=style,stackStyle},fluid.obtainException=function(){try{throw new Error("Trace exception")}catch(e){return e}};var stackStyle=fluid.detectStackStyle(fluid.obtainException());fluid.registerNamespace("fluid.exceptionDecoders"),fluid.decodeStack=function(){if("firefox"!==stackStyle.style)return null;var e=fluid.obtainException();return fluid.exceptionDecoders[stackStyle.style](e)},fluid.exceptionDecoders.firefox=function(e){var delimiter="at ",lines=e.stack.replace(/(?:\n@:0)?\s+$/m,"").replace(/^\(/gm,"{anonymous}(").split("\n");return fluid.transform(lines,function(line){line=line.replace(/\)/g,"");var atind=line.indexOf(delimiter);return atind===-1?[line]:[line.substring(atind+delimiter.length),line.substring(0,atind)]})},fluid.getCallerInfo=function(atDepth){atDepth=(atDepth||3)-stackStyle.offset;var stack=fluid.decodeStack(),element=stack&&stack[atDepth][0];if(element){var lastslash=element.lastIndexOf("/");lastslash===-1&&(lastslash=0);var nextColon=element.indexOf(":",lastslash);return{path:element.substring(0,lastslash),filename:element.substring(lastslash+1,nextColon),index:element.substring(nextColon+1)}}return null},fluid.generatePadding=function(c,count){for(var togo="",i=0;i<count;++i)togo+=c;return togo},fluid.SYNTHETIC_PROPERTY={},fluid.getSafeProperty=function(obj,key){var desc=Object.getOwnPropertyDescriptor(obj,key);return desc&&!desc.get?obj[key]:fluid.SYNTHETIC_PROPERTY},fluid.prettyPrintJSON=function(obj,options){return options=$.extend({indent:4,stack:[],output:""},options),options.indentChars=fluid.generatePadding(" ",options.indent),printImpl(obj,"",options),options.output},fluid.dumpEl=function(element){var togo;if(!element)return"null";if(3===element.nodeType||8===element.nodeType)return"[data: "+element.data+"]";if(9===element.nodeType)return"[document: location "+element.location+"]";if(!element.nodeType&&fluid.isArrayable(element)){togo="[";for(var i=0;i<element.length;++i)togo+=fluid.dumpEl(element[i]),i<element.length-1&&(togo+=", ");return togo+"]"}return element=$(element),togo=element.get(0).tagName,element.id&&(togo+="#"+element.id),element.attr("class")&&(togo+="."+element.attr("class")),togo}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";function regenerateCursor(source,segs,limit,sourceStrategy){for(var i=0;i<limit;++i)source=sourceStrategy(source,segs[i],i,fluid.makeArray(segs));return source}fluid.visitComponentChildren=function(that,visitor,options,segs){segs=segs||[];for(var name in that){var component=that[name];if(!(!fluid.isComponent(component)||options.visited&&options.visited[component.id])){if(segs.push(name),options.visited&&(options.visited[component.id]=!0),visitor(component,name,segs,segs.length-1))return!0;options.flat||fluid.visitComponentChildren(component,visitor,options,segs),segs.pop()}}},fluid.getContextHash=function(instantiator,that){var shadow=instantiator.idToShadow[that.id];return shadow&&shadow.contextHash},fluid.componentHasGrade=function(that,gradeName){var contextHash=fluid.getContextHash(fluid.globalInstantiator,that);return!(!contextHash||!contextHash[gradeName])},fluid.visitComponentsForMatching=function(that,options,visitor){var instantiator=fluid.getInstantiator(that);options=$.extend({visited:{},instantiator:instantiator},options);var thatStack=[that],contextHashes=[fluid.getContextHash(instantiator,that)],visitorWrapper=function(component,name,segs){thatStack.length=1,contextHashes.length=1;for(var i=0;i<segs.length;++i){var child=thatStack[i][segs[i]];thatStack[i+1]=child,contextHashes[i+1]=fluid.getContextHash(instantiator,child)||{}}return visitor(component,thatStack,contextHashes,segs,segs.length)};fluid.visitComponentChildren(that,visitorWrapper,options,[])},fluid.getMemberNames=function(instantiator,thatStack){var path=instantiator.idToPath(thatStack[thatStack.length-1].id),segs=instantiator.parseEL(path);return segs.unshift.apply(segs,fluid.generate(thatStack.length-segs.length,"")),segs},fluid.visitComponentsForVisibility=function(instantiator,thatStack,visitor,options){options=options||{visited:{},flat:!0,instantiator:instantiator};for(var memberNames=fluid.getMemberNames(instantiator,thatStack),i=thatStack.length-1;i>=0;--i){var that=thatStack[i];if(options.visited[that.id]=!0,visitor(that,memberNames[i],memberNames,i))return;if(fluid.visitComponentChildren(that,visitor,options,memberNames))return;memberNames.pop()}},fluid.mountStrategy=function(prefix,root,toMount){var offset=prefix.length;return function(target,name,i,segs){if(!(i<=prefix.length)){for(var j=0;j<prefix.length;++j)if(segs[j]!==prefix[j])return;return toMount(target,name,i-prefix.length,segs.slice(offset))}}},fluid.invokerFromRecord=function(invokerec,name,that){fluid.pushActivity("makeInvoker","beginning instantiation of invoker with name %name and record %record as child of %that",{name:name,record:invokerec,that:that});var invoker=invokerec?fluid.makeInvoker(that,invokerec,name):void 0;return fluid.popActivity(),invoker},fluid.memberFromRecord=function(memberrecs,name,that){for(var togo,i=0;i<memberrecs.length;++i){var expanded=fluid.expandImmediate(memberrecs[i],that);togo=fluid.isPlainObject(togo)?$.extend(!0,togo,expanded):expanded}return togo},fluid.recordStrategy=function(that,options,optionsStrategy,recordPath,recordMaker,prefix,exceptions){return prefix=prefix||[],{strategy:function(target,name,i){if(1===i){var record=fluid.driveStrategy(options,[recordPath,name],optionsStrategy);if(void 0!==record){fluid.set(target,[name],fluid.inEvaluationMarker);var member=recordMaker(record,name,that);return fluid.set(target,[name],member),member}}},initter:function(){var records=fluid.driveStrategy(options,recordPath,optionsStrategy)||{};for(var name in records)exceptions&&exceptions[name]||fluid.getForComponent(that,prefix.concat([name]))}}},fluid.instantiateFirers=function(that){var shadow=fluid.shadowForComponent(that),initter=fluid.get(shadow,["eventStrategyBlock","initter"])||fluid.identity;initter()},fluid.makeDistributionRecord=function(contextThat,sourceRecord,sourcePath,targetSegs,exclusions,sourceType){sourceType=sourceType||"distribution",fluid.pushActivity("makeDistributionRecord","Making distribution record from source record %sourceRecord path %sourcePath to target path %targetSegs",{sourceRecord:sourceRecord,sourcePath:sourcePath,targetSegs:targetSegs});var source=fluid.copy(fluid.get(sourceRecord,sourcePath));fluid.each(exclusions,function(exclusion){fluid.model.applyChangeRequest(source,{segs:exclusion,type:"DELETE"})});var record={options:{}};return fluid.model.applyChangeRequest(record,{segs:targetSegs,type:"ADD",value:source}),fluid.checkComponentRecord(record),fluid.popActivity(),$.extend(record,{contextThat:contextThat,recordType:sourceType})},fluid.filterBlocks=function(contextThat,sourceBlocks,sourceSegs,targetSegs,exclusions,removeSource){var togo=[];return fluid.each(sourceBlocks,function(block){var source=fluid.get(block.source,sourceSegs);if(source){togo.push(fluid.makeDistributionRecord(contextThat,block.source,sourceSegs,targetSegs,exclusions,block.recordType));var rescued=$.extend({},source);removeSource&&fluid.model.applyChangeRequest(block.source,{segs:sourceSegs,type:"DELETE"}),fluid.each(exclusions,function(exclusion){var orig=fluid.get(rescued,exclusion);fluid.set(block.source,sourceSegs.concat(exclusion),orig)})}}),togo},fluid.noteCollectedDistribution=function(parentShadow,memberName,distribution){fluid.model.setSimple(parentShadow,["collectedDistributions",memberName,distribution.id],!0)},fluid.isCollectedDistribution=function(parentShadow,memberName,distribution){return fluid.model.getSimple(parentShadow,["collectedDistributions",memberName,distribution.id])},fluid.clearCollectedDistributions=function(parentShadow,memberName){fluid.model.applyChangeRequest(parentShadow,{segs:["collectedDistributions",memberName],type:"DELETE"})},fluid.collectDistributions=function(distributedBlocks,parentShadow,distribution,thatStack,contextHashes,memberNames,i){var lastMember=memberNames[memberNames.length-1];!fluid.isCollectedDistribution(parentShadow,lastMember,distribution)&&fluid.matchIoCSelector(distribution.selector,thatStack,contextHashes,memberNames,i)&&(distributedBlocks.push.apply(distributedBlocks,distribution.blocks),fluid.noteCollectedDistribution(parentShadow,lastMember,distribution))},fluid.registerCollectedClearer=function(shadow,parentShadow,memberName){!shadow.collectedClearer&&parentShadow&&(shadow.collectedClearer=function(){fluid.clearCollectedDistributions(parentShadow,memberName)})},fluid.receiveDistributions=function(parentThat,gradeNames,memberName,that){var instantiator=fluid.getInstantiator(parentThat||that),thatStack=instantiator.getThatStack(parentThat||that);thatStack.unshift(fluid.rootComponent);var memberNames=fluid.getMemberNames(instantiator,thatStack),shadows=fluid.transform(thatStack,function(thisThat){return instantiator.idToShadow[thisThat.id]}),parentShadow=shadows[shadows.length-(parentThat?1:2)],contextHashes=fluid.getMembers(shadows,"contextHash");parentThat?(memberNames.push(memberName),contextHashes.push(fluid.gradeNamesToHash(gradeNames)),thatStack.push(that)):fluid.registerCollectedClearer(shadows[shadows.length-1],parentShadow,memberNames[memberNames.length-1]);for(var distributedBlocks=[],i=0;i<thatStack.length-1;++i)fluid.each(shadows[i].distributions,function(distribution){fluid.collectDistributions(distributedBlocks,parentShadow,distribution,thatStack,contextHashes,memberNames,i)});return distributedBlocks},fluid.computeTreeDistance=function(path1,path2){for(var i=0;i<path1.length&&i<path2.length&&path1[i]===path2[i];)++i;return path1.length+path2.length-2*i},fluid.computeDistributionPriority=function(targetThat,distributedBlock){if(!distributedBlock.priority){var instantiator=fluid.getInstantiator(targetThat),targetStack=instantiator.getThatStack(targetThat),targetPath=fluid.getMemberNames(instantiator,targetStack),sourceStack=instantiator.getThatStack(distributedBlock.contextThat),sourcePath=fluid.getMemberNames(instantiator,sourceStack),distance=fluid.computeTreeDistance(targetPath,sourcePath);distributedBlock.priority=fluid.mergeRecordTypes.distribution-distance}return distributedBlock},fluid.applyDistributions=function(that,preBlocks,targetShadow){var distributedBlocks=fluid.transform(preBlocks,function(preBlock){return fluid.generateExpandBlock(preBlock,that,targetShadow.mergePolicy)},function(distributedBlock){return fluid.computeDistributionPriority(that,distributedBlock)}),mergeOptions=targetShadow.mergeOptions;return mergeOptions.mergeBlocks.push.apply(mergeOptions.mergeBlocks,distributedBlocks),mergeOptions.updateBlocks(),distributedBlocks},fluid.matchIoCSelector=function(selector,thatStack,contextHashes,memberNames,i){for(var thatpos=thatStack.length-1,selpos=selector.length-1;;){for(var mustMatchHere=thatpos===thatStack.length-1||selector[selpos].child,that=thatStack[thatpos],selel=selector[selpos],match=!0,j=0;j<selel.predList.length;++j){var pred=selel.predList[j];if(pred.context&&!contextHashes[thatpos][pred.context]&&memberNames[thatpos]!==pred.context){match=!1;break}if(pred.id&&that.id!==pred.id){match=!1;break}}if(0===selpos&&thatpos>i&&mustMatchHere&&(match=!1),match){if(0===selpos)return!0;--thatpos,--selpos}else{if(mustMatchHere)return!1;--thatpos}if(thatpos<i)return!1}},fluid.queryIoCSelector=function(root,selector,flat){var parsed=fluid.parseSelector(selector,fluid.IoCSSMatcher),togo=[];return fluid.visitComponentsForMatching(root,{flat:flat},function(that,thatStack,contextHashes,memberNames,i){fluid.matchIoCSelector(parsed,thatStack,contextHashes,memberNames,i)&&togo.push(that)}),togo},fluid.isIoCSSSelector=function(context){return context.indexOf(" ")!==-1},fluid.pushDistributions=function(targetHead,selector,target,blocks){var targetShadow=fluid.shadowForComponent(targetHead),id=fluid.allocateGuid(),distribution={id:id,target:target,selector:selector,blocks:blocks};return Object.freeze(distribution),Object.freeze(distribution.blocks),fluid.pushArray(targetShadow,"distributions",distribution),id},fluid.clearDistribution=function(targetHead,id){var targetShadow=fluid.shadowForComponent(targetHead);fluid.remove_if(targetShadow.distributions,function(distribution){return distribution.id===id})},fluid.clearDistributions=function(shadow){fluid.each(shadow.outDistributions,function(outDist){fluid.clearDistribution(outDist.targetComponent,outDist.distributionId)})},fluid.extractSelectorHead=function(parsedSelector){var predList=parsedSelector[0].predList,context=predList[0].context;return predList.length=0,context},fluid.parseExpectedOptionsPath=function(path,role){var segs=fluid.model.parseEL(path);return"options"!==segs[0]&&fluid.fail("Error in options distribution path ",path," - only "+role+' paths beginning with "options" are supported'),segs.slice(1)},fluid.replicateProperty=function(source,property,targets){void 0!==source[property]&&fluid.each(targets,function(target){target[property]=source[property]})},fluid.undistributableOptions=["gradeNames","distributeOptions","argumentMap","initFunction","mergePolicy","progressiveCheckerOptions"],fluid.distributeOptions=function(that,optionsStrategy){var thatShadow=fluid.shadowForComponent(that),records=fluid.driveStrategy(that.options,"distributeOptions",optionsStrategy);fluid.each(records,function(record){fluid.pushActivity("distributeOptions","parsing distributeOptions block %record %that ",{that:that,record:record}),"string"!=typeof record.target&&fluid.fail("Error in options distribution record ",record,' a member named "target" must be supplied holding an IoC reference'),"string"==typeof record.source^void 0===record.record&&fluid.fail("Error in options distribution record ",record,': must supply either a member "source" holding an IoC reference or a member "record" holding a literal record');var targetComp,selector,context,targetRef=fluid.parseContextReference(record.target);if(fluid.isIoCSSSelector(targetRef.context)){selector=fluid.parseSelector(targetRef.context,fluid.IoCSSMatcher);var headContext=fluid.extractSelectorHead(selector);"/"===headContext?targetComp=fluid.rootComponent:context=headContext}else context=targetRef.context;targetComp=targetComp||fluid.resolveContext(context,that),targetComp||fluid.fail("Error in options distribution record ",record," - could not resolve context {"+context+"} to a root component");var preBlocks,targetSegs=fluid.model.parseEL(targetRef.path);if(void 0!==record.record)preBlocks=[fluid.makeDistributionRecord(that,record.record,[],targetSegs,[])];else{var source=fluid.parseContextReference(record.source);"that"!==source.context&&fluid.fail("Error in options distribution record ",record," only a context of {that} is supported");var sourceSegs=fluid.parseExpectedOptionsPath(source.path,"source"),fullExclusions=fluid.makeArray(record.exclusions).concat(0===sourceSegs.length?fluid.undistributableOptions:[]),exclusions=fluid.transform(fullExclusions,function(exclusion){return fluid.model.parseEL(exclusion)});preBlocks=fluid.filterBlocks(that,thatShadow.mergeOptions.mergeBlocks,sourceSegs,targetSegs,exclusions,record.removeSource),thatShadow.mergeOptions.updateBlocks()}if(fluid.replicateProperty(record,"priority",preBlocks),fluid.replicateProperty(record,"namespace",preBlocks),selector){var distributionId=fluid.pushDistributions(targetComp,selector,record.target,preBlocks);thatShadow.outDistributions=thatShadow.outDistributions||[],thatShadow.outDistributions.push({targetComponent:targetComp,distributionId:distributionId})}else{var targetShadow=fluid.shadowForComponent(targetComp);fluid.applyDistributions(that,preBlocks,targetShadow)}fluid.popActivity()})},fluid.gradeNamesToHash=function(gradeNames){var contextHash={};return fluid.each(gradeNames,function(gradeName){contextHash[gradeName]=!0,contextHash[fluid.computeNickName(gradeName)]=!0}),contextHash},fluid.cacheShadowGrades=function(that,shadow){var contextHash=fluid.gradeNamesToHash(that.options.gradeNames);contextHash[shadow.memberName]||(contextHash[shadow.memberName]="memberName"),shadow.contextHash=contextHash,fluid.each(contextHash,function(troo,context){shadow.ownScope[context]=that,shadow.parentShadow&&"fluid.rootComponent"!==shadow.parentShadow.that.type&&(shadow.parentShadow.childrenScope[context]=that)})},fluid.deliverOptionsStrategy=function(that,target,mergeOptions){var shadow=fluid.shadowForComponent(that,shadow);fluid.cacheShadowGrades(that,shadow),shadow.mergeOptions=mergeOptions},fluid.collectDistributedGrades=function(rec){var distributedBlocks=fluid.receiveDistributions(null,null,null,rec.that);if(distributedBlocks.length>0){var readyBlocks=fluid.applyDistributions(rec.that,distributedBlocks,rec.shadow),gradeNamesList=fluid.transform(fluid.getMembers(readyBlocks,["source","gradeNames"]),fluid.makeArray);fluid.accumulateDynamicGrades(rec,fluid.flatten(gradeNamesList))}},fluid.applyDynamicGrades=function(rec){rec.oldGradeNames=fluid.makeArray(rec.gradeNames);var newDefaults=fluid.copy(fluid.getMergedDefaults(rec.that.typeName,rec.gradeNames));rec.gradeNames.length=0,rec.gradeNames.push.apply(rec.gradeNames,newDefaults.gradeNames),fluid.each(rec.gradeNames,function(gradeName){fluid.isIoCReference(gradeName)||(rec.seenGrades[gradeName]=!0)});var shadow=rec.shadow;fluid.cacheShadowGrades(rec.that,shadow),shadow.mergeOptions.destroyValue(["mergePolicy"]),shadow.mergeOptions.destroyValue(["components"]),shadow.mergeOptions.destroyValue(["invokers"]),rec.defaultsBlock.source=newDefaults,shadow.mergeOptions.updateBlocks(),shadow.mergeOptions.computeMergePolicy(),fluid.accumulateDynamicGrades(rec,newDefaults.gradeNames)},fluid.accumulateDynamicGrades=function(rec,newGradeNames){fluid.each(newGradeNames,function(gradeName){rec.seenGrades[gradeName]||(fluid.isIoCReference(gradeName)?(rec.rawDynamic.push(gradeName),rec.seenGrades[gradeName]=!0):fluid.contains(rec.oldGradeNames,gradeName)||rec.plainDynamic.push(gradeName))})},fluid.computeDynamicGrades=function(that,shadow,strategy){delete that.options.gradeNames;var gradeNames=fluid.driveStrategy(that.options,"gradeNames",strategy);gradeNames.length=0;var defaultsBlock=fluid.findMergeBlocks(shadow.mergeOptions.mergeBlocks,"defaults")[0],rec={that:that,shadow:shadow,defaultsBlock:defaultsBlock,gradeNames:gradeNames,seenGrades:{},plainDynamic:[],rawDynamic:[]};for(fluid.each(shadow.mergeOptions.mergeBlocks,function(block){gradeNames.push.apply(gradeNames,fluid.makeArray(block.target&&block.target.gradeNames)),fluid.applyDynamicGrades(rec)}),fluid.collectDistributedGrades(rec);;){for(;rec.plainDynamic.length>0;)gradeNames.push.apply(gradeNames,rec.plainDynamic),rec.plainDynamic.length=0,fluid.applyDynamicGrades(rec),fluid.collectDistributedGrades(rec);if(!(rec.rawDynamic.length>0))break;var expanded=fluid.expandImmediate(rec.rawDynamic.shift(),that,shadow.localDynamic);"function"==typeof expanded&&(expanded=expanded()),expanded&&(rec.plainDynamic=rec.plainDynamic.concat(expanded))}shadow.collectedClearer&&(shadow.collectedClearer(),delete shadow.collectedClearer)},fluid.computeDynamicComponentKey=function(recordKey,sourceKey){return recordKey+(0===sourceKey?"":"-"+sourceKey)},fluid.registerDynamicRecord=function(that,recordKey,sourceKey,record,toCensor){var key=fluid.computeDynamicComponentKey(recordKey,sourceKey),cRecord=fluid.copy(record);return delete cRecord[toCensor],fluid.set(that.options,["components",key],cRecord),key},fluid.computeDynamicComponents=function(that,mergeOptions){var shadow=fluid.shadowForComponent(that),localSub=shadow.subcomponentLocal={},records=fluid.driveStrategy(that.options,"dynamicComponents",mergeOptions.strategy);fluid.each(records,function(record,recordKey){if(record.sources||record.createOnEvent||fluid.fail("Cannot process dynamicComponents record ",record,' without a "sources" or "createOnEvent" entry'),record.sources){var sources=fluid.expandOptions(record.sources,that);fluid.each(sources,function(source,sourceKey){var key=fluid.registerDynamicRecord(that,recordKey,sourceKey,record,"sources");localSub[key]={source:source,sourcePath:sourceKey}})}else if(record.createOnEvent){var event=fluid.event.expandOneEvent(that,record.createOnEvent);fluid.set(shadow,["dynamicComponentCount",recordKey],0);var listener=function(){var key=fluid.registerDynamicRecord(that,recordKey,shadow.dynamicComponentCount[recordKey]++,record,"createOnEvent"),localRecord={arguments:fluid.makeArray(arguments)};fluid.initDependent(that,key,localRecord)};event.addListener(listener),fluid.recordListener(event,listener,shadow)}})},fluid.computeComponentAccessor=function(that,localRecord){var instantiator=fluid.globalInstantiator,shadow=fluid.shadowForComponent(that);shadow.localDynamic=localRecord;var options=that.options,strategy=shadow.mergeOptions.strategy,optionsStrategy=fluid.mountStrategy(["options"],options,strategy);shadow.invokerStrategy=fluid.recordStrategy(that,options,strategy,"invokers",fluid.invokerFromRecord),shadow.eventStrategyBlock=fluid.recordStrategy(that,options,strategy,"events",fluid.eventFromRecord,["events"]);var eventStrategy=fluid.mountStrategy(["events"],that,shadow.eventStrategyBlock.strategy,["events"]);if(shadow.memberStrategy=fluid.recordStrategy(that,options,strategy,"members",fluid.memberFromRecord,null,{model:!0,modelRelay:!0}),shadow.getConfig={strategies:[fluid.model.funcResolverStrategy,fluid.makeGingerStrategy(that),optionsStrategy,shadow.invokerStrategy.strategy,shadow.memberStrategy.strategy,eventStrategy]},fluid.computeDynamicGrades(that,shadow,strategy,shadow.mergeOptions.mergeBlocks),fluid.distributeOptions(that,strategy),
shadow.contextHash["fluid.resolveRoot"]){var memberName;if(shadow.contextHash["fluid.resolveRootSingle"]){var singleRootType=fluid.getForComponent(that,["options","singleRootType"]);singleRootType||fluid.fail("Cannot register object with grades "+Object.keys(shadow.contextHash).join(", ")+" as fluid.resolveRootSingle since it has not defined option singleRootType"),memberName=fluid.typeNameToMemberName(singleRootType)}else memberName=fluid.computeGlobalMemberName(that);var parent=fluid.resolveRootComponent;parent[memberName]&&instantiator.clearComponent(parent,memberName),instantiator.recordKnownComponent(parent,that,memberName,!1)}return shadow.getConfig},fluid.shadowForComponent=function(component){var instantiator=fluid.getInstantiator(component);return instantiator&&component?instantiator.idToShadow[component.id]:null},fluid.getForComponent=function(component,path){var shadow=fluid.shadowForComponent(component),getConfig=shadow?shadow.getConfig:void 0;return fluid.get(component,path,getConfig)},fluid.makeGingerStrategy=function(that){var instantiator=fluid.getInstantiator(that);return function(component,thisSeg,index,segs){var atval=component[thisSeg];if(atval===fluid.inEvaluationMarker&&index===segs.length&&fluid.fail('Error in component configuration - a circular reference was found during evaluation of path segment "'+thisSeg+'": for more details, see the activity records following this message in the console, or issue fluid.setLogging(fluid.logLevel.TRACE) when running your application'),index>1)return atval;if(void 0===atval&&component.hasOwnProperty(thisSeg))return fluid.NO_VALUE;if(void 0===atval){var parentPath=instantiator.idToShadow[component.id].path,childPath=instantiator.composePath(parentPath,thisSeg);atval=instantiator.pathToComponent[childPath]}if(void 0===atval){var subRecord=fluid.getForComponent(component,["options","components",thisSeg]);subRecord&&(subRecord.createOnEvent&&fluid.fail('Error resolving path segment "'+thisSeg+'" of path '+segs.join(".")+" since component with record ",subRecord,' has annotation "createOnEvent" - this very likely represents an implementation error. Either alter the reference so it does not match this component, or alter your workflow to ensure that the component is instantiated by the time this reference resolves'),fluid.initDependent(component,thisSeg),atval=component[thisSeg])}return atval}},fluid.frameworkGrades=["fluid.component","fluid.modelComponent","fluid.viewComponent","fluid.rendererComponent"],fluid.filterBuiltinGrades=function(gradeNames){return fluid.remove_if(fluid.makeArray(gradeNames),function(gradeName){return fluid.frameworkGrades.indexOf(gradeName)!==-1})},fluid.dumpGradeNames=function(that){return that.options&&that.options.gradeNames?" gradeNames: "+JSON.stringify(fluid.filterBuiltinGrades(that.options.gradeNames)):""},fluid.dumpThat=function(that){return'{ typeName: "'+that.typeName+'"'+fluid.dumpGradeNames(that)+" id: "+that.id+"}"},fluid.dumpThatStack=function(thatStack,instantiator){var togo=fluid.transform(thatStack,function(that){var path=instantiator.idToPath(that.id);return fluid.dumpThat(that)+(path?" - path: "+path:"")});return togo.join("\n")},fluid.dumpComponentPath=function(that){var path=fluid.pathForComponent(that);return path?fluid.pathUtil.composeSegments(path):"** no path registered for component **"},fluid.resolveContext=function(context,that,fast){if("that"===context)return that;if("object"==typeof context){var innerContext=fluid.resolveContext(context.context,that,fast);fluid.isComponent(innerContext)||fluid.triggerMismatchedPathError(context.context,that);var rawValue=fluid.getForComponent(innerContext,context.path),expanded=fluid.expandOptions(rawValue,that);return fluid.isComponent(expanded)||fluid.fail("Unable to resolve recursive context expression "+fluid.renderContextReference(context)+": the directly resolved value of "+rawValue+" did not resolve to a component in the scope of component ",that,": got ",expanded),expanded}var foundComponent,instantiator=fluid.globalInstantiator;if(fast){var shadow=instantiator.idToShadow[that.id];return shadow.ownScope[context]}var thatStack=instantiator.getFullStack(that);return fluid.visitComponentsForVisibility(instantiator,thatStack,function(component,name){var shadow=fluid.shadowForComponent(component);return context===name||shadow&&shadow.contextHash&&shadow.contextHash[context]||context===component.typeName?(foundComponent=component,!0):fluid.getForComponent(component,["options","components",context])&&!component[context]?(foundComponent=fluid.getForComponent(component,context),!0):void 0}),foundComponent},fluid.triggerMismatchedPathError=function(parsed,parentThat){var ref=fluid.renderContextReference(parsed);fluid.fail("Failed to resolve reference "+ref+" - could not match context with name "+parsed.context+" from component "+fluid.dumpThat(parentThat)+" at path "+fluid.dumpComponentPath(parentThat)+" component: ",parentThat)},fluid.makeStackFetcher=function(parentThat,localRecord,fast){var fetcher=function(parsed){parentThat&&"destroyed"===parentThat.lifecycleStatus&&fluid.fail("Cannot resolve reference "+fluid.renderContextReference(parsed)+" from component "+fluid.dumpThat(parentThat)+" which has been destroyed");var context=parsed.context;if(localRecord&&context in localRecord)return fluid.get(localRecord[context],parsed.path);var foundComponent=fluid.resolveContext(context,parentThat,fast);return foundComponent||""===parsed.path||fluid.triggerMismatchedPathError(parsed,parentThat),fluid.getForComponent(foundComponent,parsed.path)};return fetcher},fluid.makeStackResolverOptions=function(parentThat,localRecord,fast){return $.extend(fluid.copy(fluid.rawDefaults("fluid.makeExpandOptions")),{localRecord:localRecord||{},fetcher:fluid.makeStackFetcher(parentThat,localRecord,fast),contextThat:parentThat,exceptions:{members:{model:!0,modelRelay:!0}}})},fluid.clearListeners=function(shadow){fluid.each(shadow.listeners,function(rec){rec.event.removeListener(rec.listenerId||rec.listener)}),delete shadow.listeners},fluid.recordListener=function(event,listener,shadow,listenerId){event.ownerId!==shadow.that.id&&fluid.pushArray(shadow,"listeners",{event:event,listener:listener,listenerId:listenerId})},fluid.constructScopeObjects=function(instantiator,parent,child,childShadow){var parentShadow=parent?instantiator.idToShadow[parent.id]:null;childShadow.childrenScope=parentShadow?Object.create(parentShadow.ownScope):{},childShadow.ownScope=Object.create(childShadow.childrenScope),childShadow.parentShadow=parentShadow},fluid.clearChildrenScope=function(instantiator,parentShadow,child,childShadow){fluid.each(childShadow.contextHash,function(troo,context){parentShadow.childrenScope[context]===child&&delete parentShadow.childrenScope[context]})},fluid.instantiator=function(){function recordComponent(parent,component,path,name,created){var shadow;if(created)shadow=that.idToShadow[component.id]={},shadow.that=component,shadow.path=path,shadow.memberName=name,fluid.constructScopeObjects(that,parent,component,shadow);else{shadow=that.idToShadow[component.id],shadow.injectedPaths=shadow.injectedPaths||{},shadow.injectedPaths[path]=!0;var parentShadow=that.idToShadow[parent.id],keys=fluid.keys(shadow.contextHash);fluid.remove_if(keys,function(key){return shadow.contextHash&&"memberName"===shadow.contextHash[key]}),keys.push(name),fluid.each(keys,function(context){parentShadow.childrenScope[context]||(parentShadow.childrenScope[context]=component)})}that.pathToComponent[path]&&fluid.fail("Error during instantiation - path "+path+" which has just created component "+fluid.dumpThat(component)+" has already been used for component "+fluid.dumpThat(that.pathToComponent[path])+" - this is a circular instantiation or other oversight. Please clear the component using instantiator.clearComponent() before reusing the path."),that.pathToComponent[path]=component}var that=fluid.typeTag("instantiator");return $.extend(that,{lifecycleStatus:"constructed",pathToComponent:{},idToShadow:{},modelTransactions:{init:{}},composePath:fluid.model.composePath,composeSegments:fluid.model.composeSegments,parseEL:fluid.model.parseEL,events:{onComponentAttach:fluid.makeEventFirer({name:"instantiator's onComponentAttach event"}),onComponentClear:fluid.makeEventFirer({name:"instantiator's onComponentClear event"})}}),that.idToPath=function(id){var shadow=that.idToShadow[id];return shadow?shadow.path:""},that.getThatStack=function(component){var shadow=that.idToShadow[component.id];if(shadow){for(var path=shadow.path,parsed=that.parseEL(path),root=that.pathToComponent[""],togo=[],i=0;i<parsed.length;++i)root=root[parsed[i]],togo.push(root);return togo}return[]},that.getFullStack=function(component){var thatStack=component?that.getThatStack(component):[];return thatStack.unshift(fluid.resolveRootComponent),thatStack},that.recordRoot=function(component){recordComponent(null,component,"","",!0)},that.recordKnownComponent=function(parent,component,name,created){if(parent[name]=component,fluid.isComponent(component)||"instantiator"===component.type){var parentPath=that.idToShadow[parent.id].path,path=that.composePath(parentPath,name);recordComponent(parent,component,path,name,created),that.events.onComponentAttach.fire(component,path,that,created)}else fluid.fail("Cannot record non-component with value ",component,' at path "'+name+'" of parent ',parent)},that.clearConcreteComponent=function(record){fluid.each(record.childShadow.injectedPaths,function(troo,injectedPath){var parentPath=fluid.model.getToTailPath(injectedPath),otherParent=that.pathToComponent[parentPath];that.clearComponent(otherParent,fluid.model.getTailPath(injectedPath),record.child)}),fluid.clearDistributions(record.childShadow),fluid.clearListeners(record.childShadow),fluid.fireEvent(record.child,"afterDestroy",[record.child,record.name,record.component]),delete that.idToShadow[record.child.id]},that.clearComponent=function(component,name,child,options,nested,path){var shadow=that.idToShadow[component.id];options=options||{flat:!0,instantiator:that,destroyRecs:[]},child=child||component[name],path=path||shadow.path,void 0===path&&fluid.fail("Cannot clear component "+name+" from component ",component," which was not created by this instantiator");var childPath=that.composePath(path,name),childShadow=that.idToShadow[child.id];if(childShadow){var created=childShadow.path===childPath;that.events.onComponentClear.fire(child,childPath,component,created),created?(fluid.visitComponentChildren(child,function(gchild,gchildname,segs,i){var parentPath=that.composeSegments.apply(null,segs.slice(0,i));that.clearComponent(child,gchildname,null,options,!0,parentPath)},options,that.parseEL(childPath)),fluid.doDestroy(child,name,component),options.destroyRecs.push({child:child,childShadow:childShadow,name:name,component:component})):fluid.remove_if(childShadow.injectedPaths,function(troo,path){return path===childPath}),fluid.clearChildrenScope(that,shadow,child,childShadow),delete that.pathToComponent[childPath],nested||(delete component[name],fluid.each(options.destroyRecs,that.clearConcreteComponent))}},that},fluid.globalInstantiator=fluid.instantiator(),fluid.getInstantiator=function(component){var instantiator=fluid.globalInstantiator;return component&&instantiator.idToShadow[component.id]?instantiator:null},fluid.defaults("fluid.resolveRoot"),fluid.defaults("fluid.resolveRootSingle",{gradeNames:"fluid.resolveRoot"}),fluid.constructRootComponents=function(instantiator){fluid.rootComponent=instantiator.rootComponent=fluid.typeTag("fluid.rootComponent"),instantiator.recordRoot(fluid.rootComponent),fluid.resolveRootComponent=instantiator.resolveRootComponent=fluid.typeTag("fluid.resolveRootComponent"),instantiator.recordKnownComponent(fluid.rootComponent,fluid.resolveRootComponent,"resolveRootComponent",!0);var rootShadow=instantiator.idToShadow[fluid.rootComponent.id],resolveRootShadow=instantiator.idToShadow[fluid.resolveRootComponent.id];resolveRootShadow.ownScope=rootShadow.ownScope,resolveRootShadow.childrenScope=rootShadow.childrenScope,instantiator.recordKnownComponent(fluid.resolveRootComponent,instantiator,"instantiator",!0),resolveRootShadow.childrenScope.instantiator=instantiator},fluid.constructRootComponents(fluid.globalInstantiator),fluid.expandOptions=function(args,that,mergePolicy,localRecord,outerExpandOptions){if(!args)return args;fluid.pushActivity("expandOptions","expanding options %args for component %that ",{that:that,args:args});var expandOptions=fluid.makeStackResolverOptions(that,localRecord);expandOptions.mergePolicy=mergePolicy;var expanded=outerExpandOptions&&outerExpandOptions.defer?fluid.makeExpandOptions(args,expandOptions):fluid.expand(args,expandOptions);return fluid.popActivity(),expanded},fluid.localRecordExpected=fluid.arrayToHash(["type","options","container","createOnEvent","priority","recordType"]),fluid.checkComponentRecord=function(localRecord){fluid.each(localRecord,function(value,key){fluid.localRecordExpected[key]||fluid.fail("Probable error in subcomponent record ",localRecord,' - key "'+key+'" found, where the only legal options are '+fluid.keys(fluid.localRecordExpected).join(", "))})},fluid.mergeRecordsToList=function(that,mergeRecords){var list=[];return fluid.each(mergeRecords,function(value,key){if(value.recordType=key,"distributions"===key)list.push.apply(list,fluid.transform(value,function(distributedBlock){return fluid.computeDistributionPriority(that,distributedBlock)}));else{if(!value.options)return;value.priority=fluid.mergeRecordTypes[key],void 0===value.priority&&fluid.fail("Merge record with unrecognised type "+key+": ",value),list.push(value)}}),list};var addPolicyBuiltins=function(policy){return fluid.each(["gradeNames","mergePolicy","argumentMap","components","dynamicComponents","events","listeners","modelListeners","modelRelay","distributeOptions","transformOptions"],function(key){fluid.set(policy,[key,"*","noexpand"],!0)}),policy};fluid.generateExpandBlock=function(record,that,mergePolicy,localRecord){var expanded=fluid.expandOptions(record.options,record.contextThat||that,mergePolicy,localRecord,{defer:!0});return expanded.priority=record.priority,expanded.namespace=record.namespace,expanded.recordType=record.recordType,expanded};var expandComponentOptionsImpl=function(mergePolicy,defaults,initRecord,that){var defaultCopy=fluid.copy(defaults);addPolicyBuiltins(mergePolicy);var shadow=fluid.shadowForComponent(that);shadow.mergePolicy=mergePolicy;var mergeRecords={defaults:{options:defaultCopy}};$.extend(mergeRecords,initRecord.mergeRecords),mergeRecords.subcomponentRecord&&fluid.checkComponentRecord(mergeRecords.subcomponentRecord);var expandList=fluid.mergeRecordsToList(that,mergeRecords),togo=fluid.transform(expandList,function(value){return fluid.generateExpandBlock(value,that,mergePolicy,initRecord.localRecord)});return togo};fluid.fabricateDestroyMethod=function(that,name,instantiator,child){return function(){instantiator.clearComponent(that,name,child)}},fluid.computeGlobalMemberName=function(that){var nickName=fluid.computeNickName(that.typeName);return nickName+"-"+that.id},fluid.typeNameToMemberName=function(typeName){return typeName.replace(/\./g,"_")},fluid.expandComponentOptions=function(mergePolicy,defaults,userOptions,that){var initRecord=userOptions,instantiator=userOptions&&userOptions.marker===fluid.EXPAND?userOptions.instantiator:null;fluid.pushActivity("expandComponentOptions","expanding component options %options with record %record for component %that",{options:instantiator?userOptions.mergeRecords.user:userOptions,record:initRecord,that:that}),instantiator||(instantiator=fluid.globalInstantiator,initRecord={mergeRecords:{user:{options:fluid.expandCompact(userOptions,!0)}},memberName:fluid.computeGlobalMemberName(that),instantiator:instantiator,parentThat:fluid.rootComponent}),that.destroy=fluid.fabricateDestroyMethod(initRecord.parentThat,initRecord.memberName,instantiator,that),instantiator.recordKnownComponent(initRecord.parentThat,that,initRecord.memberName,!0);var togo=expandComponentOptionsImpl(mergePolicy,defaults,initRecord,that);return fluid.popActivity(),togo},fluid.assembleCreatorArguments=function(parentThat,typeName,options){var upDefaults=fluid.defaults(typeName);upDefaults&&upDefaults.argumentMap||fluid.fail("Error in assembleCreatorArguments: cannot look up component type name "+typeName+" to a component creator grade with an argumentMap");var fakeThat={},distributions=parentThat?fluid.receiveDistributions(parentThat,upDefaults.gradeNames,options.memberName,fakeThat):[];fluid.each(distributions,function(distribution){fluid.computeDistributionPriority(parentThat,distribution),fluid.isPrimitive(distribution.priority)&&(distribution.priority=fluid.parsePriority(distribution.priority,0,!1,"options distribution"))}),fluid.sortByPriority(distributions);var localDynamic=options.localDynamic,localRecord=$.extend({},fluid.censorKeys(options.componentRecord,["type"]),localDynamic),argMap=upDefaults.argumentMap,findKeys=Object.keys(argMap).concat(["type"]);fluid.each(findKeys,function(name){for(var i=0;i<distributions.length;++i)void 0!==distributions[i][name]&&(localRecord[name]=distributions[i][name])}),typeName=localRecord.type||typeName,delete localRecord.type,delete localRecord.options;var mergeRecords={distributions:distributions};void 0!==options.componentRecord&&(mergeRecords.subcomponentRecord=$.extend({},options.componentRecord));var args=[];fluid.each(argMap,function(index,name){var arg;if("options"===name)arg={marker:fluid.EXPAND,localRecord:localDynamic,mergeRecords:mergeRecords,instantiator:fluid.getInstantiator(parentThat),parentThat:parentThat,memberName:options.memberName};else{var value=localRecord[name];arg=fluid.expandImmediate(value,parentThat,localRecord)}args[index]=arg});var togo={args:args,funcName:typeName};return togo},fluid.initDependent=function(that,name,localRecord){if(!that[name]){var instance,component=that.options.components[name],instantiator=fluid.globalInstantiator,shadow=instantiator.idToShadow[that.id],localDynamic=localRecord||shadow.subcomponentLocal&&shadow.subcomponentLocal[name];if(fluid.pushActivity("initDependent",'instantiating dependent component at path "%path" with record %record as child of %parent',{path:shadow.path+"."+name,record:component,parent:that}),"string"==typeof component||component.expander)that[name]=fluid.inEvaluationMarker,instance=fluid.expandImmediate(component,that),instance?instantiator.recordKnownComponent(that,instance,name,!1):delete that[name];else if(component.type){var type=fluid.expandImmediate(component.type,that,localDynamic);type||fluid.fail("Error in subcomponent record: ",component.type," could not be resolved to a type for component ",name," of parent ",that);var invokeSpec=fluid.assembleCreatorArguments(that,type,{componentRecord:component,memberName:name,localDynamic:localDynamic});instance=fluid.initSubcomponentImpl(that,{type:invokeSpec.funcName},invokeSpec.args)}else fluid.fail("Unrecognised material in place of subcomponent "+name+' - no "type" field found');return fluid.popActivity(),instance}},fluid.bindDeferredComponent=function(that,componentName,component){var events=fluid.makeArray(component.createOnEvent);fluid.each(events,function(eventName){var event=fluid.isIoCReference(eventName)?fluid.expandOptions(eventName,that):that.events[eventName];event&&event.addListener||fluid.fail("Error instantiating createOnEvent component with name "+componentName+" of parent ",that," since event specification "+eventName+" could not be expanded to an event - got ",event),event.addListener(function(){fluid.pushActivity("initDeferred","instantiating deferred component %componentName of parent %that due to event %eventName",{componentName:componentName,that:that,eventName:eventName}),that[componentName]&&fluid.globalInstantiator.clearComponent(that,componentName);var localRecord={arguments:fluid.makeArray(arguments)};fluid.initDependent(that,componentName,localRecord),fluid.popActivity()},null,component.priority)})},fluid.priorityForComponent=function(component){return component.priority?component.priority:"fluid.typeFount"===component.type||fluid.hasGrade(fluid.defaults(component.type),"fluid.typeFount")?"first":void 0},fluid.initDependents=function(that){fluid.pushActivity("initDependents","instantiating dependent components for component %that",{that:that});var shadow=fluid.shadowForComponent(that);if(shadow.memberStrategy.initter(),shadow.invokerStrategy.initter(),fluid.getForComponent(that,"modelRelay"),fluid.getForComponent(that,"model"),!fluid.isDestroyed(that)){var options=that.options,components=options.components||{},componentSort=[];fluid.each(components,function(component,name){if(component.createOnEvent)fluid.bindDeferredComponent(that,name,component);else{var priority=fluid.priorityForComponent(component);componentSort.push({namespace:name,priority:fluid.parsePriority(priority)})}}),fluid.sortByPriority(componentSort),fluid.each(componentSort,function(entry){fluid.initDependent(that,entry.namespace)}),shadow.subcomponentLocal&&fluid.clear(shadow.subcomponentLocal),that.lifecycleStatus="constructed",fluid.assessTreeConstruction(that,shadow),fluid.popActivity()}},fluid.assessTreeConstruction=function(that,shadow){var instantiator=fluid.globalInstantiator,thatStack=instantiator.getThatStack(that),unstableUp=fluid.find_if(thatStack,function(that){return"constructing"===that.lifecycleStatus});unstableUp?that.lifecycleStatus="constructed":fluid.markSubtree(instantiator,that,shadow.path,"treeConstructed")},fluid.markSubtree=function(instantiator,that,path,state){that.lifecycleStatus=state,fluid.visitComponentChildren(that,function(child,name){var childPath=instantiator.composePath(path,name),childShadow=instantiator.idToShadow[child.id],created=childShadow&&childShadow.path===childPath;created&&fluid.markSubtree(instantiator,child,childPath,state)},{flat:!0})},fluid.pathForComponent=function(component,instantiator){instantiator=instantiator||fluid.getInstantiator(component)||fluid.globalInstantiator;var shadow=instantiator.idToShadow[component.id];return shadow?instantiator.parseEL(shadow.path):null},fluid.construct=function(path,options,instantiator){var record=fluid.destroy(path,instantiator);return fluid.set(record.parent,["options","components",record.memberName],{type:options.type,options:options}),fluid.initDependent(record.parent,record.memberName)},fluid.destroy=function(path,instantiator){instantiator=instantiator||fluid.globalInstantiator;var segs=fluid.model.parseToSegments(path,instantiator.parseEL,!0);0===segs.length&&fluid.fail("Cannot destroy the root component");var memberName=segs.pop(),parentPath=instantiator.composeSegments.apply(null,segs),parent=instantiator.pathToComponent[parentPath];return parent||fluid.fail("Cannot modify component with nonexistent parent at path ",path),parent[memberName]&&parent[memberName].destroy(),{parent:parent,memberName:memberName}},fluid.constructSingle=function(parentPath,options,instantiator){instantiator=instantiator||fluid.globalInstantiator,parentPath=parentPath||"";var segs=fluid.model.parseToSegments(parentPath,instantiator.parseEL,!0);"string"==typeof options&&(options={type:options});var type=options.type;type||fluid.fail("Cannot construct singleton object without a type entry"),options=$.extend({},options);var gradeNames=options.gradeNames=fluid.makeArray(options.gradeNames);gradeNames.unshift(type),options.type="fluid.component";var root=0===segs.length;root&&gradeNames.push("fluid.resolveRoot");var memberName=fluid.typeNameToMemberName(options.singleRootType||type);segs.push(memberName),fluid.construct(segs,options,instantiator)},fluid.destroySingle=function(parentPath,typeName,instantiator){instantiator=instantiator||fluid.globalInstantiator;var segs=fluid.model.parseToSegments(parentPath,instantiator.parseEL,!0),memberName=fluid.typeNameToMemberName(typeName);segs.push(memberName),fluid.destroy(segs,instantiator)},fluid.makeGradeLinkage=function(linkageName,inputNames,outputNames){fluid.defaults(linkageName,{gradeNames:"fluid.component",distributeOptions:{record:outputNames,target:"{/ "+inputNames.join("&")+"}.options.gradeNames"}}),fluid.constructSingle([],linkageName)},fluid.componentForPath=function(path){return fluid.globalInstantiator.pathToComponent[fluid.isArrayable(path)?path.join("."):path]},fluid["debugger"]=function(){},fluid.defaults("fluid.debuggingProbe",{gradeNames:["fluid.component"]}),fluid.probeToDistribution=function(probe){var instantiator=fluid.globalInstantiator,parsed=fluid.parseContextReference(probe.target),segs=fluid.model.parseToSegments(parsed.path,instantiator.parseEL,!0);"options"!==segs[0]&&segs.unshift("options");var parsedPriority=fluid.parsePriority(probe.priority);return parsedPriority.constraint&&!parsedPriority.constraint.target&&(parsedPriority.constraint.target="authoring"),{target:"{/ "+parsed.context+"}."+instantiator.composeSegments.apply(null,segs),record:{func:probe.func,funcName:probe.funcName,args:probe.args,priority:fluid.renderPriority(parsedPriority)}}},fluid.registerProbes=function(probes){var probeDistribution=fluid.transform(probes,fluid.probeToDistribution),memberName="fluid_debuggingProbe_"+fluid.allocateGuid();return fluid.construct([memberName],{type:"fluid.debuggingProbe",distributeOptions:probeDistribution}),memberName},fluid.deregisterProbes=function(probeName){fluid.destroy([probeName])},fluid.thisistToApplicable=function(record,recthis,that){return{apply:function(noThis,args){var resolvedThis=fluid.expandOptions(recthis,that);"string"==typeof resolvedThis&&(resolvedThis=fluid.getGlobalValue(resolvedThis)),resolvedThis||fluid.fail("Could not resolve reference "+recthis+" to a value");var resolvedFunc=resolvedThis[record.method];return"function"!=typeof resolvedFunc&&fluid.fail("Object ",resolvedThis," at reference "+recthis+" has no member named "+record.method+" which is a function "),fluid.log("Applying arguments ",args," to method "+record.method+" of instance ",resolvedThis),resolvedFunc.apply(resolvedThis,args)}}},fluid.changeToApplicable=function(record,that){return{apply:function(noThis,args,localRecord,mergeRecord){var parsed=fluid.parseValidModelReference(that,"changePath listener record",record.changePath),value=fluid.expandOptions(record.value,that,{},fluid.extend(localRecord,{arguments:args})),sources=mergeRecord&&mergeRecord.source&&mergeRecord.source.length?fluid.makeArray(record.source).concat(mergeRecord.source):record.source;parsed.applier.change(parsed.modelSegs,value,record.type,sources)}}},fluid.recordToApplicable=function(record,that,standard){if(void 0!==record.changePath)return fluid.changeToApplicable(record,that,standard);var recthis=record["this"];return record.method^recthis&&fluid.fail("Record ",that,' must contain both entries "method" and "this" if it contains either'),record.method?fluid.thisistToApplicable(record,recthis,that):null},fluid.getGlobalValueNonComponent=function(funcName,context){var defaults=fluid.defaults(funcName);return defaults&&fluid.hasGrade(defaults,"fluid.component")&&fluid.fail("Error in function specification - cannot invoke function "+funcName+" in the context of "+context+": component creator functions can only be used as subcomponents"),fluid.getGlobalValue(funcName)},fluid.makeInvoker=function(that,invokerec,name){invokerec=fluid.upgradePrimitiveFunc(invokerec),void 0===invokerec.args||invokerec.args===fluid.NO_VALUE||fluid.isArrayable(invokerec.args)||(invokerec.args=fluid.makeArray(invokerec.args));var func=fluid.recordToApplicable(invokerec,that),invokePre=fluid.preExpand(invokerec.args),localRecord={},expandOptions=fluid.makeStackResolverOptions(that,localRecord,!0);return func=func||(invokerec.funcName?fluid.getGlobalValueNonComponent(invokerec.funcName,"an invoker"):fluid.expandImmediate(invokerec.func,that)),func&&func.apply?func===fluid.notImplemented&&fluid.fail("Error constructing component ",that," - the invoker named "+name+" which was defined in grade "+invokerec.componentSource+" needs to be overridden with a concrete implementation"):fluid.fail("Error in invoker record: could not resolve members func, funcName or method to a function implementation - got "+func+" from ",invokerec),function(){fluid.defeatLogging===!1&&fluid.pushActivity("invokeInvoker","invoking invoker with name %name and record %record from path %path holding component %that",{name:name,record:invokerec,path:fluid.dumpComponentPath(that),that:that});var togo,finalArgs;return"destroyed"===that.lifecycleStatus?fluid.log(fluid.logLevel.WARN,"Ignoring call to invoker "+name+" of component ",that," which has been destroyed"):(localRecord.arguments=arguments,void 0===invokerec.args||invokerec.args===fluid.NO_VALUE?finalArgs=arguments:(fluid.expandImmediateImpl(invokePre,expandOptions),finalArgs=invokePre.source),togo=func.apply(null,finalArgs)),fluid.defeatLogging===!1&&fluid.popActivity(),togo}},fluid.event.makeTrackedListenerAdder=function(source){var shadow=fluid.shadowForComponent(source);return function(event){return{addListener:function(listener,namespace,priority,softNamespace,listenerId){fluid.recordListener(event,listener,shadow,listenerId),event.addListener.apply(null,arguments)}}}},fluid.event.listenerEngine=function(eventSpec,callback,adder){function checkFire(){var notall=fluid.find(eventSpec,function(value,key){if(void 0===argstruc[key])return!0});if(!notall){var oldstruc=argstruc;argstruc={},callback(oldstruc)}}var argstruc={};fluid.each(eventSpec,function(event,eventName){adder(event).addListener(function(){argstruc[eventName]=fluid.makeArray(arguments),checkFire()})})},fluid.event.dispatchListener=function(that,listener,eventName,eventSpec,indirectArgs){void 0===eventSpec.args||eventSpec.args===fluid.NO_VALUE||fluid.isArrayable(eventSpec.args)||(eventSpec.args=fluid.makeArray(eventSpec.args)),listener=fluid.event.resolveListener(listener);var dispatchPre=fluid.preExpand(eventSpec.args),localRecord={},expandOptions=fluid.makeStackResolverOptions(that,localRecord,!0),togo=function(){fluid.defeatLogging===!1&&fluid.pushActivity("dispatchListener","firing to listener to event named %eventName of component %that",{eventName:eventName,that:that});var finalArgs,args=indirectArgs?arguments[0]:arguments;localRecord.arguments=args,void 0!==eventSpec.args&&eventSpec.args!==fluid.NO_VALUE?(fluid.expandImmediateImpl(dispatchPre,expandOptions),finalArgs=dispatchPre.source):finalArgs=args;var togo=listener.apply(null,finalArgs);return fluid.defeatLogging===!1&&fluid.popActivity(),togo};return fluid.event.impersonateListener(listener,togo),togo},fluid.event.resolveSoftNamespace=function(key){if("string"!=typeof key)return null;var lastpos=Math.max(key.lastIndexOf("."),key.lastIndexOf("}"));return key.substring(lastpos+1)},fluid.event.resolveListenerRecord=function(lisrec,that,eventName,namespace,standard){var badRec=function(record,extra){fluid.fail("Error in listener record - could not resolve reference ",record,' to a listener or firer. Did you miss out "events." when referring to an event firer?'+extra)};fluid.pushActivity("resolveListenerRecord","resolving listener record for event named %eventName for component %that",{eventName:eventName,that:that});var records=fluid.makeArray(lisrec),transRecs=fluid.transform(records,function(record){var expanded=fluid.isPrimitive(record)||record.expander?{listener:record}:fluid.copy(record),methodist=fluid.recordToApplicable(record,that,standard);methodist?expanded.listener=methodist:expanded.listener=expanded.listener||expanded.func||expanded.funcName,expanded.listener||badRec(record,' Listener record must contain a member named "listener", "func", "funcName" or "method"');var softNamespace=record.method?fluid.event.resolveSoftNamespace(record["this"])+"."+record.method:fluid.event.resolveSoftNamespace(expanded.listener);expanded.namespace||namespace||!softNamespace||(expanded.softNamespace=!0,
expanded.namespace=(record.componentSource?record.componentSource:that.typeName)+"."+softNamespace);var listener=expanded.listener=fluid.expandOptions(expanded.listener,that);listener||badRec(record,"");var firer=!1;return"fluid.event.firer"===listener.typeName&&(listener=listener.fire,firer=!0),expanded.listener=standard&&(expanded.args&&"fluid.notImplemented"!==listener||firer)?fluid.event.dispatchListener(that,listener,eventName,expanded):listener,expanded.listenerId=fluid.allocateGuid(),expanded}),togo={records:transRecs,adderWrapper:standard?fluid.event.makeTrackedListenerAdder(that):null};return fluid.popActivity(),togo},fluid.event.expandOneEvent=function(that,event){var origin;return origin="string"==typeof event&&"{"!==event.charAt(0)?fluid.getForComponent(that,["events",event]):fluid.expandOptions(event,that),origin&&"fluid.event.firer"===origin.typeName||fluid.fail("Error in event specification - could not resolve base event reference ",event," to an event firer: got ",origin),origin},fluid.event.expandEvents=function(that,event){return"string"==typeof event?fluid.event.expandOneEvent(that,event):fluid.transform(event,function(oneEvent){return fluid.event.expandOneEvent(that,oneEvent)})},fluid.event.resolveEvent=function(that,eventName,eventSpec){fluid.pushActivity("resolveEvent","resolving event with name %eventName attached to component %that",{eventName:eventName,that:that});var adder=fluid.event.makeTrackedListenerAdder(that);"string"==typeof eventSpec&&(eventSpec={event:eventSpec});var event="fluid.event.firer"===eventSpec.typeName?eventSpec:eventSpec.event||eventSpec.events;event||fluid.fail("Event specification for event with name "+eventName+" does not include a base event specification: ",eventSpec);var firer,origin="fluid.event.firer"===event.typeName?event:fluid.event.expandEvents(that,event),isMultiple="fluid.event.firer"!==origin.typeName,isComposite=eventSpec.args||isMultiple;if(isComposite){firer=fluid.makeEventFirer({name:" [composite] "+fluid.event.nameEvent(that,eventName)});var dispatcher=fluid.event.dispatchListener(that,firer.fire,eventName,eventSpec,isMultiple);isMultiple?fluid.event.listenerEngine(origin,dispatcher,adder):adder(origin).addListener(dispatcher)}else firer={typeName:"fluid.event.firer"},firer.fire=function(){var outerArgs=fluid.makeArray(arguments);fluid.pushActivity("fireSynthetic","firing synthetic event %eventName ",{eventName:eventName});var togo=origin.fire.apply(null,outerArgs);return fluid.popActivity(),togo},firer.addListener=function(listener,namespace,priority,softNamespace,listenerId){var dispatcher=fluid.event.dispatchListener(that,listener,eventName,eventSpec);adder(origin).addListener(dispatcher,namespace,priority,softNamespace,listenerId)},firer.removeListener=function(listener){origin.removeListener(listener)};return fluid.popActivity(),firer},fluid.withEnvironment=function(envAdd,func,root){var key;root=root||fluid.globalThreadLocal();try{for(key in envAdd)root[key]=envAdd[key];return $.extend(root,envAdd),func()}finally{for(key in envAdd)delete root[key]}},fluid.fetchContextReference=function(parsed,directModel,env,elResolver,externalFetcher){elResolver&&(parsed=elResolver(parsed,env));var base=parsed.context?env[parsed.context]:directModel;if(!base){var resolveExternal=externalFetcher&&externalFetcher(parsed);return resolveExternal||base}return parsed.noDereference?parsed.path:fluid.get(base,parsed.path)},fluid.makeEnvironmentFetcher=function(directModel,elResolver,envGetter,externalFetcher){return envGetter=envGetter||fluid.globalThreadLocal,function(parsed){var env=envGetter();return fluid.fetchContextReference(parsed,directModel,env,elResolver,externalFetcher)}},fluid.coerceToPrimitive=function(string){return"false"!==string&&("true"===string||(isFinite(string)?Number(string):string))},fluid.compactStringToRec=function(string,type){var openPos=string.indexOf("("),closePos=string.indexOf(")");if((openPos===-1^closePos===-1||openPos>closePos)&&fluid.fail("Badly-formed compact "+type+" record without matching parentheses: "+string),openPos!==-1&&closePos!==-1){var trail=string.substring(closePos+1);""!==$.trim(trail)&&fluid.fail("Badly-formed compact "+type+" record "+string+" - unexpected material following close parenthesis: "+trail);var prefix=string.substring(0,openPos),body=string.substring(openPos+1,closePos),args=fluid.transform(body.split(","),$.trim,fluid.coerceToPrimitive),togo=fluid.upgradePrimitiveFunc(prefix,null);return togo.args=args,togo}return"expander"===type&&fluid.fail("Badly-formed compact expander record without parentheses: "+string),string},fluid.expandPrefix="@expand:",fluid.expandCompactString=function(string,active){var rec=string;if(0===string.indexOf(fluid.expandPrefix)){var rem=string.substring(fluid.expandPrefix.length);rec={expander:fluid.compactStringToRec(rem,"expander")}}else active&&(rec=fluid.compactStringToRec(string,active));return rec};var singularPenRecord={listeners:"listener",modelListeners:"modelListener"},singularRecord=$.extend({invokers:"invoker"},singularPenRecord);fluid.expandCompactRec=function(segs,target,source){fluid.guardCircularExpansion(segs,segs.length);var pen=segs.length>0?segs[segs.length-1]:"",active=singularRecord[pen];!active&&segs.length>1&&(active=singularPenRecord[segs[segs.length-2]]),fluid.each(source,function(value,key){return fluid.isPlainObject(value)?(target[key]=fluid.freshContainer(value),segs.push(key),fluid.expandCompactRec(segs,target[key],value),void segs.pop()):("string"==typeof value&&(value=fluid.expandCompactString(value,active)),void(target[key]=value))})},fluid.expandCompact=function(options){var togo={};return fluid.expandCompactRec([],togo,options),togo},fluid.extractEL=function(string,options){if("ALL"===options.ELstyle)return string;if(1===options.ELstyle.length){if(string.charAt(0)===options.ELstyle)return string.substring(1)}else if("${}"===options.ELstyle){var i1=string.indexOf("${"),i2=string.lastIndexOf("}");if(0===i1&&i2!==-1)return string.substring(2,i2)}},fluid.extractELWithContext=function(string,options){var EL=fluid.extractEL(string,options);return fluid.isIoCReference(EL)?fluid.parseContextReference(EL):EL?{path:EL}:EL},fluid.parseContextReference=function(reference,index,delimiter){index=index||0;var endcpos,context,nested,isNested="{"===reference.charAt(index+1);isNested?(nested=fluid.parseContextReference(reference,index+1,"}"),endcpos=nested.endpos):endcpos=reference.indexOf("}",index+1),endcpos===-1&&fluid.fail('Cannot parse context reference "'+reference+'": Malformed context reference without }'),context=isNested?nested:reference.substring(index+1,endcpos);var endpos=delimiter?reference.indexOf(delimiter,endcpos+1):reference.length,path=reference.substring(endcpos+1,endpos);return"."===path.charAt(0)&&(path=path.substring(1)),{context:context,path:path,endpos:endpos}},fluid.renderContextReference=function(parsed){var context=parsed.context;return"{"+("string"==typeof context?context:fluid.renderContextReference(context))+"}"+(parsed.path?"."+parsed.path:"")},fluid.resolveContextValue=function(string,options){function fetch(parsed){fluid.pushActivity("resolveContextValue","resolving context value %parsed",{parsed:parsed});var togo=options.fetcher(parsed);return fluid.pushActivity("resolvedContextValue","resolved value %parsed to value %value",{parsed:parsed,value:togo}),fluid.popActivity(2),togo}var parsed;if(options.bareContextRefs&&fluid.isIoCReference(string))return parsed=fluid.parseContextReference(string),fetch(parsed);if(options.ELstyle&&"${}"!==options.ELstyle&&(parsed=fluid.extractELWithContext(string,options)))return fetch(parsed);for(;"string"==typeof string;){var i1=string.indexOf("${"),i2=string.indexOf("}",i1+2);if(i1===-1||i2===-1)break;"{"===string.charAt(i1+2)?(parsed=fluid.parseContextReference(string,i1+2,"}"),i2=parsed.endpos):parsed={path:string.substring(i1+2,i2)};var subs=fetch(parsed),all=0===i1&&i2===string.length-1;if(void 0===subs||null===subs)return subs;string=all?subs:string.substring(0,i1)+subs+string.substring(i2+1)}return string},fluid.fetchExpandChildren=function(target,i,segs,source,mergePolicy,options){if(source.expander){var expanded=fluid.expandExpander(target,source,options);if(fluid.isPrimitive(expanded)||!fluid.isPlainObject(expanded)||fluid.isArrayable(expanded)^fluid.isArrayable(target))return expanded;$.extend(!0,target,expanded)}return fluid.each(source,function(newSource,key){void 0===newSource?target[key]=void 0:"expander"!==key&&(segs[i]=key,fluid.getImmediate(options.exceptions,segs,i)!==!0&&options.strategy(target,key,i+1,segs,source,mergePolicy))}),target},fluid.isUnexpandable=function(source){return fluid.isPrimitive(source)||!fluid.isPlainObject(source)},fluid.expandSource=function(options,target,i,segs,deliverer,source,policy,recurse){var expanded,isTrunk,thisPolicy=fluid.derefMergePolicy(policy);return"string"!=typeof source||thisPolicy.noexpand?thisPolicy.noexpand||fluid.isUnexpandable(source)?expanded=source:source.expander?expanded=fluid.expandExpander(deliverer,source,options):(expanded=fluid.freshContainer(source),isTrunk=!0):options.defaultEL&&"{"!==source.charAt(0)?expanded=source:(fluid.pushActivity("expandContextValue","expanding context value %source held at path %path",{source:source,path:fluid.path.apply(null,segs.slice(0,i))}),expanded=fluid.resolveContextValue(source,options),fluid.popActivity(1)),expanded!==fluid.NO_VALUE&&deliverer(expanded),isTrunk&&recurse(expanded,source,i,segs,policy),expanded},fluid.guardCircularExpansion=function(segs,i){i>fluid.strategyRecursionBailout&&fluid.fail("Overflow/circularity in options expansion, current path is ",segs," at depth ",i,' - please ensure options are not circularly connected, or protect from expansion using the "noexpand" policy or expander')},fluid.makeExpandStrategy=function(options){var recurse=function(target,source,i,segs,policy){return fluid.fetchExpandChildren(target,i||0,segs||[],source,policy,options)},strategy=function(target,name,i,segs,source,policy){function deliverer(value){target[name]=value}if(fluid.guardCircularExpansion(segs,i),target){if(target.hasOwnProperty(name))return target[name];void 0===source&&(source=regenerateCursor(options.source,segs,i-1,options.sourceStrategy),policy=regenerateCursor(options.mergePolicy,segs,i-1,fluid.concreteTrundler));var thisSource=options.sourceStrategy(source,name,i,segs),thisPolicy=fluid.concreteTrundler(policy,name);return fluid.expandSource(options,target,i,segs,deliverer,thisSource,thisPolicy,recurse)}};return options.recurse=recurse,options.strategy=strategy,strategy},fluid.defaults("fluid.makeExpandOptions",{ELstyle:"${}",bareContextRefs:!0,target:fluid.inCreationMarker}),fluid.makeExpandOptions=function(source,options){return options=$.extend({},fluid.rawDefaults("fluid.makeExpandOptions"),options),options.defaultEL="${}"===options.ELStyle&&options.bareContextRefs,options.expandSource=function(source){return fluid.expandSource(options,null,0,[],fluid.identity,source,options.mergePolicy,!1)},fluid.isUnexpandable(source)?(options.strategy=fluid.concreteTrundler,options.initter=fluid.identity,"string"==typeof source?options.target=options.expandSource(source):options.target=source):(options.source=source,options.target=fluid.freshContainer(source),options.sourceStrategy=options.sourceStrategy||fluid.concreteTrundler,fluid.makeExpandStrategy(options),options.initter=function(){options.target=fluid.fetchExpandChildren(options.target,0,[],options.source,options.mergePolicy,options)}),options},fluid.expand=function(source,options){var expandOptions=fluid.makeExpandOptions(source,options);return expandOptions.initter(),expandOptions.target},fluid.preExpandRecurse=function(root,source,holder,member,rootSegs){function pushExpander(expander){root.expanders.push({expander:expander,holder:holder,member:member}),delete holder[member]}if(fluid.guardCircularExpansion(rootSegs,rootSegs.length),fluid.isIoCReference(source)){var parsed=fluid.parseContextReference(source),segs=fluid.model.parseEL(parsed.path);pushExpander({typeFunc:fluid.expander.fetch,context:parsed.context,segs:segs})}else fluid.isPlainObject(source)&&(source.expander?(source.expander.typeFunc=fluid.getGlobalValue(source.expander.type||"fluid.invokeFunc"),pushExpander(source.expander)):fluid.each(source,function(value,key){rootSegs.push(key),fluid.preExpandRecurse(root,value,source,key,rootSegs),rootSegs.pop()}))},fluid.preExpand=function(source){var root={expanders:[],source:fluid.isUnexpandable(source)?source:fluid.copy(source)};return fluid.preExpandRecurse(root,root.source,root,"source",[]),root},fluid.expandImmediate=function(source,that,localRecord){var options=fluid.makeStackResolverOptions(that,localRecord,!0),root=fluid.preExpand(source);return fluid.expandImmediateImpl(root,options),root.source},fluid.expandImmediateImpl=function(root,options){for(var expanders=root.expanders,i=0;i<expanders.length;++i){var expander=expanders[i];expander.holder[expander.member]=expander.expander.typeFunc(null,expander,options)}},fluid.expandExpander=function(deliverer,source,options){var expander=fluid.getGlobalValue(source.expander.type||"fluid.invokeFunc");return expander||fluid.fail("Unknown expander with type "+source.expander.type),expander(deliverer,source,options)},fluid.registerNamespace("fluid.expander"),fluid.expander.fetch=function(deliverer,source,options){var localRecord=options.localRecord,context=source.expander.context,segs=source.expander.segs,inLocal=void 0!==localRecord[context],contextStatus=options.contextThat.lifecycleStatus,fast="treeConstructed"===contextStatus||"destroyed"===contextStatus,component=inLocal?localRecord[context]:fluid.resolveContext(context,options.contextThat,fast);if(component){var root=component;if(inLocal||"constructing"!==component.lifecycleStatus)for(var i=0;i<segs.length;++i)root=root?root[segs[i]]:void 0;else root=fluid.getForComponent(component,segs);return void 0!==root||inLocal||(root=fluid.getForComponent(component,segs)),root}segs.length>0&&fluid.triggerMismatchedPathError(source.expander,options.contextThat)},fluid.invokeFunc=function(deliverer,source,options){var expander=source.expander,args=fluid.makeArray(expander.args);expander.args=args,options.recurse?args=options.recurse([],args):(expander=fluid.expandImmediate(expander,options.contextThat,options.localRecord),args=expander.args);var funcEntry=expander.func||expander.funcName,func=(options.expandSource?options.expandSource(funcEntry):funcEntry)||fluid.recordToApplicable(expander,options.contextThat);return"string"==typeof func&&(func=fluid.getGlobalValue(func)),func||fluid.fail("Error in expander record ",expander,": "+funcEntry+" could not be resolved to a function for component ",options.contextThat),func.apply(null,args)},fluid.noexpand=function(deliverer,source){return source.expander.value?source.expander.value:source.expander.tree}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.model.makeEnvironmentStrategy=function(environment){return function(root,segment,index){return 0===index&&environment[segment]?environment[segment]:void 0}},fluid.model.defaultCreatorStrategy=function(root,segment){if(void 0===root[segment])return root[segment]={},root[segment]},fluid.model.defaultFetchStrategy=function(root,segment){return root[segment]},fluid.model.funcResolverStrategy=function(root,segment){if(root.resolvePathSegment)return root.resolvePathSegment(segment)},fluid.model.traverseWithStrategy=function(root,segs,initPos,config,uncess){for(var strategies=config.strategies,limit=segs.length-uncess,i=initPos;i<limit;++i){if(!root)return root;for(var accepted,j=0;j<strategies.length&&(accepted=strategies[j](root,segs[i],i+1,segs),void 0===accepted);++j);accepted===fluid.NO_VALUE&&(accepted=void 0),root=accepted}return root},fluid.model.getValueAndSegments=function(root,EL,config,initSegs){return fluid.model.accessWithStrategy(root,EL,fluid.NO_VALUE,config,initSegs,!0)},fluid.model.makeTrundler=function(config){return function(valueSeg,EL){return fluid.model.getValueAndSegments(valueSeg.root,EL,config,valueSeg.segs)}},fluid.model.getWithStrategy=function(root,EL,config,initSegs){return fluid.model.accessWithStrategy(root,EL,fluid.NO_VALUE,config,initSegs)},fluid.model.setWithStrategy=function(root,EL,newValue,config,initSegs){fluid.model.accessWithStrategy(root,EL,newValue,config,initSegs)},fluid.model.accessWithStrategy=function(root,EL,newValue,config,initSegs,returnSegs){if(fluid.isPrimitive(EL)||fluid.isArrayable(EL))return fluid.model.accessImpl(root,EL,newValue,config,initSegs,returnSegs,fluid.model.traverseWithStrategy);var key=EL.type||"default",resolver=config.resolvers[key];resolver||fluid.fail("Unable to find resolver of type "+key);var trundler=fluid.model.makeTrundler(config),valueSeg={root:root,segs:initSegs};return valueSeg=resolver(valueSeg,EL,trundler),EL.path&&valueSeg&&(valueSeg=trundler(valueSeg,EL.path)),returnSegs?valueSeg:valueSeg?valueSeg.root:void 0},fluid.registerNamespace("fluid.pathUtil"),fluid.pathUtil.getPathSegmentImpl=function(accept,path,i){var segment=null;accept&&(segment="");for(var escaped=!1,limit=path.length;i<limit;++i){var c=path.charAt(i);if(escaped)escaped=!1,null!==segment&&(segment+=c);else{if("."===c)break;"\\"===c?escaped=!0:null!==segment&&(segment+=c)}}return null!==segment&&(accept[0]=segment),i};var globalAccept=[];fluid.pathUtil.parseEL=function(path){for(var togo=[],index=0,limit=path.length;index<limit;){var firstdot=fluid.pathUtil.getPathSegmentImpl(globalAccept,path,index);togo.push(globalAccept[0]),index=firstdot+1}return togo},fluid.pathUtil.composeSegment=function(prefix,toappend){toappend=toappend.toString();for(var i=0;i<toappend.length;++i){var c=toappend.charAt(i);"."!==c&&"\\"!==c&&"}"!==c||(prefix+="\\"),prefix+=c}return prefix},fluid.pathUtil.escapeSegment=function(segment){return fluid.pathUtil.composeSegment("",segment)},fluid.pathUtil.composePath=function(prefix,suffix){return 0!==prefix.length&&(prefix+="."),fluid.pathUtil.composeSegment(prefix,suffix)},fluid.pathUtil.composeSegments=function(){for(var path="",i=0;i<arguments.length;++i)path=fluid.pathUtil.composePath(path,arguments[i]);return path},fluid.pathUtil.matchSegments=function(toMatch,segs,start,end){if(end-start!==toMatch.length)return!1;for(var i=start;i<end;++i)if(segs[i]!==toMatch[i-start])return!1;return!0},fluid.model.unescapedParser={parse:fluid.model.parseEL,compose:fluid.model.composeSegments},fluid.model.defaultGetConfig={parser:fluid.model.unescapedParser,strategies:[fluid.model.funcResolverStrategy,fluid.model.defaultFetchStrategy]},fluid.model.defaultSetConfig={parser:fluid.model.unescapedParser,strategies:[fluid.model.funcResolverStrategy,fluid.model.defaultFetchStrategy,fluid.model.defaultCreatorStrategy]},fluid.model.escapedParser={parse:fluid.pathUtil.parseEL,compose:fluid.pathUtil.composeSegments},fluid.model.escapedGetConfig={parser:fluid.model.escapedParser,strategies:[fluid.model.defaultFetchStrategy]},fluid.model.escapedSetConfig={parser:fluid.model.escapedParser,strategies:[fluid.model.defaultFetchStrategy,fluid.model.defaultCreatorStrategy]},fluid.initRelayModel=function(that){return fluid.deenlistModelComponent(that),that.model},fluid.isModelComplete=function(that){return"model"in that&&that.model!==fluid.inEvaluationMarker},fluid.enlistModelComponent=function(that){var instantiator=fluid.getInstantiator(that),enlist=instantiator.modelTransactions.init[that.id];return enlist||(enlist={that:that,applier:fluid.getForComponent(that,"applier"),complete:fluid.isModelComplete(that)},instantiator.modelTransactions.init[that.id]=enlist),enlist},fluid.clearTransactions=function(){var instantiator=fluid.globalInstantiator;fluid.clear(instantiator.modelTransactions),instantiator.modelTransactions.init={}},fluid.failureEvent.addListener(fluid.clearTransactions,"clearTransactions","before:fail"),fluid.clearLinkCounts=function(transRec,relaysAlso){fluid.each(transRec,function(value,key){"number"==typeof value?transRec[key]=0:relaysAlso&&value.options&&"number"==typeof value.relayCount&&(value.relayCount=0)})},fluid.sortCompleteLast=function(reca,recb){return(reca.completeOnInit?1:0)-(recb.completeOnInit?1:0)},fluid.operateInitialTransaction=function(that,mrec){var transac,transId=fluid.allocateGuid(),transRec=fluid.getModelTransactionRec(that,transId),transacs=fluid.transform(mrec,function(recel){return transac=recel.that.applier.initiate(null,"init",transId),transRec[recel.that.applier.applierId]={transaction:transac},transac}),recs=fluid.values(mrec).sort(fluid.sortCompleteLast);fluid.each(recs,function(recel){var that=recel.that,transac=transacs[that.id];recel.completeOnInit?fluid.initModelEvent(that,that.applier,transac,that.applier.listeners.sortedListeners):fluid.each(recel.initModels,function(initModel){transac.fireChangeRequest({type:"ADD",segs:[],value:initModel}),fluid.clearLinkCounts(transRec,!0)});var shadow=fluid.shadowForComponent(that);shadow&&(shadow.modelComplete=!0)}),transac.commit()},fluid.deenlistModelComponent=function(that){var instantiator=fluid.getInstantiator(that),mrec=instantiator.modelTransactions.init;if(mrec[that.id]){that.model=void 0,mrec[that.id].complete=!0;var incomplete=fluid.find_if(mrec,function(recel){return recel.complete!==!0});incomplete||(fluid.operateInitialTransaction(that,mrec),instantiator.modelTransactions.init={})}},fluid.parseModelReference=function(that,ref){var parsed=fluid.parseContextReference(ref);return parsed.segs=that.applier.parseEL(parsed.path),parsed},fluid.parseValidModelReference=function(that,name,ref,implicitRelay){var parsed,reject=function(message){fluid.fail("Error in "+name+": ",ref,message)};if("string"==typeof ref)if(fluid.isIoCReference(ref)){parsed=fluid.parseModelReference(that,ref);var modelPoint=parsed.segs.indexOf("model");modelPoint===-1?implicitRelay?parsed.nonModel=!0:reject(' must be a reference into a component model via a path including the segment "model"'):(parsed.modelSegs=parsed.segs.slice(modelPoint+1),parsed.contextSegs=parsed.segs.slice(0,modelPoint),delete parsed.path)}else parsed={path:ref,modelSegs:that.applier.parseEL(ref)};else fluid.isArrayable(ref.segs)||reject(' must contain an entry "segs" holding path segments referring a model path within a component'),parsed={context:ref.context,modelSegs:fluid.expandOptions(ref.segs,that)};var target;return parsed.context?(target=fluid.resolveContext(parsed.context,that),target||reject(" must be a reference to an existing component"),parsed.contextSegs&&(target=fluid.getForComponent(target,parsed.contextSegs))):target=that,parsed.nonModel||(target.applier||fluid.getForComponent(target,["applier"]),target.applier||reject(" must be a reference to a component with a ChangeApplier (descended from fluid.modelComponent)")),parsed.that=target,parsed.applier=target.applier,parsed.path||(parsed.path=target.applier.composeSegments.apply(null,parsed.modelSegs)),parsed},fluid.getModelTransactionRec=function(that,transId){var instantiator=fluid.getInstantiator(that);if(transId||fluid.fail("Cannot get transaction record without transaction id"),!instantiator)return null;var transRec=instantiator.modelTransactions[transId];return transRec||(transRec=instantiator.modelTransactions[transId]={relays:[],sources:{},externalChanges:{}}),transRec},fluid.recordChangeListener=function(component,applier,sourceListener,listenerId){var shadow=fluid.shadowForComponent(component);fluid.recordListener(applier.modelChanged,sourceListener,shadow,listenerId)},fluid.registerRelayTransaction=function(transRec,targetApplier,transId,options,npOptions){var newTrans=targetApplier.initiate("relay",null,transId),transEl=transRec[targetApplier.applierId]={transaction:newTrans,relayCount:0,namespace:npOptions.namespace,priority:npOptions.priority,options:options};return transEl.priority=fluid.parsePriority(transEl.priority,transRec.relays.length,!1,"model relay"),transRec.relays.push(transEl),transEl},fluid.relayRecursionBailout=100,fluid.registerDirectChangeRelay=function(target,targetSegs,source,sourceSegs,linkId,transducer,options,npOptions){var targetApplier=options.targetApplier||target.applier,sourceApplier=options.sourceApplier||source.applier,applierId=targetApplier.applierId;targetSegs=fluid.makeArray(targetSegs),sourceSegs=sourceSegs?fluid.makeArray(sourceSegs):sourceSegs;var spec,sourceListener=function(newValue,oldValue,path,changeRequest,trans,applier){var transId=trans.id,transRec=fluid.getModelTransactionRec(target,transId);applier&&trans&&!transRec[applier.applierId]&&(transRec[applier.applierId]={transaction:trans});var existing=transRec[applierId];transRec[linkId]=transRec[linkId]||0;var relay=!0;relay&&(++transRec[linkId],transRec[linkId]>fluid.relayRecursionBailout&&fluid.fail("Error in model relay specification at component ",target," - operated more than "+fluid.relayRecursionBailout+" relays without model value settling - current model contents are ",trans.newHolder.model),existing||(existing=fluid.registerRelayTransaction(transRec,targetApplier,transId,options,npOptions)),transducer&&!options.targetApplier?transducer(existing.transaction,options.sourceApplier?void 0:newValue,sourceSegs,targetSegs):void 0!==newValue&&existing.transaction.fireChangeRequest({type:"ADD",segs:targetSegs,value:newValue}))};sourceSegs&&(spec=sourceApplier.modelChanged.addListener({isRelay:!0,segs:sourceSegs,transactional:options.transactional},sourceListener),fluid.log(fluid.logLevel.TRACE,"Adding relay listener with listenerId "+spec.listenerId+" to source applier with id "+sourceApplier.applierId+" from target applier with id "+applierId+" for target component with id "+target.id)),source&&(fluid.recordChangeListener(source,sourceApplier,sourceListener,spec.listenerId),target!==source&&fluid.recordChangeListener(target,sourceApplier,sourceListener,spec.listenerId))},fluid.connectModelRelay=function(source,sourceSegs,target,targetSegs,options){function enlistComponent(component){var enlist=fluid.enlistModelComponent(component);if(enlist.complete){var shadow=fluid.shadowForComponent(component);shadow.modelComplete&&(enlist.completeOnInit=!0)}}var linkId=fluid.allocateGuid();enlistComponent(target),enlistComponent(source);var npOptions=fluid.filterKeys(options,["namespace","priority"]);options.update?options.targetApplier?fluid.registerDirectChangeRelay(source,sourceSegs,target,targetSegs,linkId,null,{transactional:!1,targetApplier:options.targetApplier,update:options.update},npOptions):fluid.registerDirectChangeRelay(target,targetSegs,source,[],linkId+"-transform",options.forwardAdapter,{transactional:!0,sourceApplier:options.forwardApplier},npOptions):(fluid.registerDirectChangeRelay(target,targetSegs,source,sourceSegs,linkId,options.forwardAdapter,{transactional:!1},npOptions),sourceSegs&&fluid.registerDirectChangeRelay(source,sourceSegs,target,targetSegs,linkId,options.backwardAdapter,{transactional:!1},npOptions))},fluid.parseSourceExclusionSpec=function(targetSpec,sourceSpec){return targetSpec.excludeSource=fluid.arrayToHash(fluid.makeArray(sourceSpec.excludeSource||(sourceSpec.includeSource?"*":void 0))),targetSpec.includeSource=fluid.arrayToHash(fluid.makeArray(sourceSpec.includeSource)),targetSpec},fluid.isExcludedChangeSource=function(transaction,spec){if(!spec||!spec.excludeSource)return!1;var excluded=spec.excludeSource["*"];for(var source in transaction.fullSources)spec.excludeSource[source]&&(excluded=!0),spec.includeSource[source]&&(excluded=!1);return excluded},fluid.model.guardedAdapter=function(transaction,cond,func,args){fluid.isExcludedChangeSource(transaction,cond)||func.apply(null,args)},fluid.transformToAdapter=function(transform,targetPath){var basedTransform={};return basedTransform[targetPath]=transform,function(trans,newValue){fluid.model.transformWithRules(newValue,basedTransform,{finalApplier:trans})}},fluid.makeTransformPackage=function(componentThat,transform,sourcePath,targetPath,forwardCond,backwardCond,namespace,priority){var that={forwardHolder:{model:transform},backwardHolder:{model:null}};that.generateAdapters=function(trans){that.forwardAdapterImpl=fluid.transformToAdapter(trans?trans.newHolder.model:that.forwardHolder.model,targetPath),null!==sourcePath&&(that.backwardHolder.model=fluid.model.transform.invertConfiguration(transform),that.backwardAdapterImpl=fluid.transformToAdapter(that.backwardHolder.model,sourcePath))},that.forwardAdapter=function(transaction,newValue){void 0===newValue&&that.generateAdapters(),fluid.model.guardedAdapter(transaction,forwardCond,that.forwardAdapterImpl,arguments)},that.runTransform=function(trans){trans.commit(),trans.reset()},that.forwardApplier=fluid.makeHolderChangeApplier(that.forwardHolder),that.forwardApplier.isRelayApplier=!0,that.invalidator=fluid.makeEventFirer({name:"Invalidator for model relay with applier "+that.forwardApplier.applierId}),null!==sourcePath&&(that.backwardApplier=fluid.makeHolderChangeApplier(that.backwardHolder),that.backwardAdapter=function(transaction){fluid.model.guardedAdapter(transaction,backwardCond,that.backwardAdapterImpl,arguments)}),that.update=that.invalidator.fire;var implicitOptions={targetApplier:that.forwardApplier,update:that.update,namespace:namespace,priority:priority,refCount:0};return that.forwardHolder.model=fluid.parseImplicitRelay(componentThat,transform,[],implicitOptions),that.refCount=implicitOptions.refCount,that.namespace=namespace,that.priority=priority,that.generateAdapters(),that.invalidator.addListener(that.generateAdapters),that.invalidator.addListener(that.runTransform),that},fluid.singleTransformToFull=function(singleTransform){var withPath=$.extend(!0,{inputPath:""},singleTransform);return{"":{transform:withPath}}},fluid.model.relayConditions={initOnly:{includeSource:"init"},liveOnly:{excludeSource:"init"},never:{includeSource:[]},always:{}},fluid.model.parseRelayCondition=function(condition){"initOnly"===condition?fluid.log(fluid.logLevel.WARN,'The relay condition "initOnly" is deprecated: Please use the form \'includeSource: "init"\' instead'):"liveOnly"===condition&&fluid.log(fluid.logLevel.WARN,'The relay condition "initOnly" is deprecated: Please use the form \'excludeSource: "init"\' instead');var exclusionRec;return condition?"string"==typeof condition?(exclusionRec=fluid.model.relayConditions[condition],exclusionRec||fluid.fail('Unrecognised model relay condition string "'+condition+'": the supported values are "never" or a record with members "includeSource" and/or "excludeSource"')):exclusionRec=condition:exclusionRec={},fluid.parseSourceExclusionSpec({},exclusionRec)},fluid.parseModelRelay=function(that,mrrec,key){var parsedSource=mrrec.source?fluid.parseValidModelReference(that,'modelRelay record member "source"',mrrec.source):{path:null,modelSegs:null},parsedTarget=fluid.parseValidModelReference(that,'modelRelay record member "target"',mrrec.target),namespace=mrrec.namespace||key,transform=mrrec.singleTransform?fluid.singleTransformToFull(mrrec.singleTransform):mrrec.transform;transform||fluid.fail('Cannot parse modelRelay record without element "singleTransform" or "transform":',mrrec);var forwardCond=fluid.model.parseRelayCondition(mrrec.forward),backwardCond=fluid.model.parseRelayCondition(mrrec.backward),transformPackage=fluid.makeTransformPackage(that,transform,parsedSource.path,parsedTarget.path,forwardCond,backwardCond,namespace,mrrec.priority);0===transformPackage.refCount?fluid.connectModelRelay(parsedSource.that||that,parsedSource.modelSegs,parsedTarget.that,parsedTarget.modelSegs,fluid.filterKeys(transformPackage,["forwardAdapter","backwardAdapter","namespace","priority"])):(parsedSource.modelSegs&&fluid.fail('Error in model relay definition: If a relay transform has a model dependency, you can not specify a "source" entry - please instead enter this as "input" in the transform specification. Definition was ',mrrec," for component ",that),fluid.connectModelRelay(parsedSource.that||that,parsedSource.modelSegs,parsedTarget.that,parsedTarget.modelSegs,transformPackage));
},fluid.parseImplicitRelay=function(that,modelRec,segs,options){var value;if(fluid.isIoCReference(modelRec)){var parsed=fluid.parseValidModelReference(that,"model reference from model (implicit relay)",modelRec,!0);parsed.nonModel?value=fluid.getForComponent(parsed.that,parsed.segs):(++options.refCount,fluid.connectModelRelay(that,segs,parsed.that,parsed.modelSegs,options))}else fluid.isPrimitive(modelRec)||!fluid.isPlainObject(modelRec)?value=modelRec:modelRec.expander&&fluid.isPlainObject(modelRec.expander)?value=fluid.expandOptions(modelRec,that):(value=fluid.freshContainer(modelRec),fluid.each(modelRec,function(innerValue,key){segs.push(key);var innerTrans=fluid.parseImplicitRelay(that,innerValue,segs,options);void 0!==innerTrans&&(value[key]=innerTrans),segs.pop()}));return value},fluid.model.notifyExternal=function(transRec){var allChanges=transRec?fluid.values(transRec.externalChanges):[];fluid.sortByPriority(allChanges);for(var i=0;i<allChanges.length;++i){var change=allChanges[i],targetApplier=change.args[5];targetApplier.destroyed||change.listener.apply(null,change.args)}fluid.clearLinkCounts(transRec,!0)},fluid.model.commitRelays=function(instantiator,transactionId){var transRec=instantiator.modelTransactions[transactionId];fluid.each(transRec,function(transEl){transEl.transaction&&(transEl.transaction.commit("relay"),transEl.transaction.reset())})},fluid.model.updateRelays=function(instantiator,transactionId){var transRec=instantiator.modelTransactions[transactionId],updates=0;return fluid.sortByPriority(transRec.relays),fluid.each(transRec.relays,function(transEl){transEl.transaction.changeRecord.changes>0&&transEl.relayCount<2&&transEl.options.update&&(transEl.relayCount++,fluid.clearLinkCounts(transRec),transEl.options.update(transEl.transaction,transRec),++updates)}),updates},fluid.establishModelRelay=function(that,optionsModel,optionsML,optionsMR,applier){function updateRelays(transaction){for(;fluid.model.updateRelays(instantiator,transaction.id)>0;);}function commitRelays(transaction,applier,code){"relay"!==code&&fluid.model.commitRelays(instantiator,transaction.id)}function concludeTransaction(transaction,applier,code){"relay"!==code&&(fluid.model.notifyExternal(instantiator.modelTransactions[transaction.id]),delete instantiator.modelTransactions[transaction.id])}var shadow=fluid.shadowForComponent(that);shadow.modelRelayEstablished?fluid.fail("FLUID-5887 failure: Model relay initialised twice on component",that):shadow.modelRelayEstablished=!0,fluid.mergeModelListeners(that,optionsML);var enlist=fluid.enlistModelComponent(that);fluid.each(optionsMR,function(mrrec,key){for(var i=0;i<mrrec.length;++i)fluid.parseModelRelay(that,mrrec[i],key)});var initModels=fluid.transform(optionsModel,function(modelRec){return fluid.parseImplicitRelay(that,modelRec,[],{refCount:0,priority:"first"})});enlist.initModels=initModels;var instantiator=fluid.getInstantiator(that);return applier.preCommit.addListener(updateRelays),applier.preCommit.addListener(commitRelays),applier.postCommit.addListener(concludeTransaction),null},fluid.defaults("fluid.modelComponent",{gradeNames:["fluid.component"],changeApplierOptions:{relayStyle:!0,cullUnchanged:!0},members:{model:"@expand:fluid.initRelayModel({that}, {that}.modelRelay)",applier:"@expand:fluid.makeHolderChangeApplier({that}, {that}.options.changeApplierOptions)",modelRelay:"@expand:fluid.establishModelRelay({that}, {that}.options.model, {that}.options.modelListeners, {that}.options.modelRelay, {that}.applier)"},mergePolicy:{model:{noexpand:!0,func:fluid.arrayConcatPolicy},modelListeners:fluid.makeMergeListenersPolicy(fluid.arrayConcatPolicy),modelRelay:fluid.makeMergeListenersPolicy(fluid.arrayConcatPolicy,!0)}}),fluid.modelChangedToChange=function(args){return{value:args[0],oldValue:args[1],path:args[2],transaction:args[4]}},fluid.event.invokeListener=function(listener,args,localRecord,mergeRecord){return"string"==typeof listener&&(listener=fluid.event.resolveListener(listener)),listener.apply(null,args,localRecord,mergeRecord)},fluid.resolveModelListener=function(that,record){var togo=function(){if(!fluid.isDestroyed(that)){var change=fluid.modelChangedToChange(arguments),args=arguments,localRecord={change:change,arguments:args},mergeRecord={source:Object.keys(change.transaction.sources)};record.args&&(args=fluid.expandOptions(record.args,that,{},localRecord)),fluid.event.invokeListener(record.listener,fluid.makeArray(args),localRecord,mergeRecord)}};return fluid.event.impersonateListener(record.listener,togo),togo},fluid.registerModelListeners=function(that,record,paths,namespace){var func=fluid.resolveModelListener(that,record);fluid.each(record.byTarget,function(parsedArray){function initModelEvent(){if(fluid.isModelComplete(parsed.that)){var trans=parsed.applier.initiate(null,"init");fluid.initModelEvent(that,parsed.applier,trans,[spec]),trans.commit()}}var parsed=parsedArray[0],spec={listener:func,listenerId:fluid.allocateGuid(),segsArray:fluid.getMembers(parsedArray,"modelSegs"),pathArray:fluid.getMembers(parsedArray,"path"),includeSource:record.includeSource,excludeSource:record.excludeSource,priority:fluid.expandOptions(record.priority,that),transactional:!0};if(spec=parsed.applier.modelChanged.addListener(spec,func,namespace,record.softNamespace),fluid.recordChangeListener(that,parsed.applier,func,spec.listenerId),that!==parsed.that&&!fluid.isModelComplete(that)){var onCreate=fluid.getForComponent(that,["events","onCreate"]);onCreate.addListener(initModelEvent)}})},fluid.mergeModelListeners=function(that,listeners){fluid.each(listeners,function(value,key){"string"==typeof value&&(value={funcName:value});var records=fluid.event.resolveListenerRecord(value,that,"modelListeners",null,!1).records;fluid.each(records,function(record){record.byTarget={};var paths=fluid.makeArray(void 0===record.path?key:record.path);fluid.each(paths,function(path){var parsed=fluid.parseValidModelReference(that,"modelListeners entry",path);fluid.pushArray(record.byTarget,parsed.that.id,parsed)});var namespace=(record.namespace&&!record.softNamespace?record.namespace:null)||(void 0!==record.path?key:null);fluid.registerModelListeners(that,record,paths,namespace)})})},fluid.fireChanges=function(applier,changes){for(var i=0;i<changes.length;++i)applier.fireChangeRequest(changes[i])},fluid.model.isChangedPath=function(changeMap,segs){for(var i=0;i<=segs.length;++i){if("string"==typeof changeMap)return!0;i<segs.length&&changeMap&&(changeMap=changeMap[segs[i]])}return!1},fluid.model.setChangedPath=function(options,segs,value){var notePath=function(record){segs.unshift(record),fluid.model.setSimple(options,segs,value),segs.shift()};fluid.model.isChangedPath(options.changeMap,segs)||(++options.changes,notePath("changeMap")),fluid.model.isChangedPath(options.deltaMap,segs)||(++options.deltas,notePath("deltaMap"))},fluid.model.fetchChangeChildren=function(target,i,segs,source,options){fluid.each(source,function(value,key){segs[i]=key,fluid.model.applyChangeStrategy(target,key,i,segs,value,options),segs.length=i})},fluid.model.isSameValue=function(a,b){if("number"!=typeof a||"number"!=typeof b)return a===b;if(a===b||a!==a&&b!==b)return!0;var relError=Math.abs((a-b)/b);return relError<1e-12},fluid.model.applyChangeStrategy=function(target,name,i,segs,source,options){var targetSlot=target[name],sourceCode=fluid.typeCode(source),targetCode=fluid.typeCode(targetSlot),changedValue=fluid.NO_VALUE;"primitive"===sourceCode?fluid.model.isSameValue(targetSlot,source)||(changedValue=source,++options.unchanged):(targetCode!==sourceCode||"array"===sourceCode&&source.length!==targetSlot.length)&&(changedValue=fluid.freshContainer(source)),changedValue!==fluid.NO_VALUE&&(target[name]=changedValue,options.changeMap&&fluid.model.setChangedPath(options,segs,options.inverse?"DELETE":"ADD")),"primitive"!==sourceCode&&fluid.model.fetchChangeChildren(target[name],i+1,segs,source,options)},fluid.model.stepTargetAccess=function(target,type,segs,startpos,endpos,options){for(var i=startpos;i<endpos;++i)if(target){var oldTrunk=target[segs[i]];target=fluid.model.traverseWithStrategy(target,segs,i,options["ADD"===type?"resolverSetConfig":"resolverGetConfig"],segs.length-i-1),oldTrunk!==target&&options.changeMap&&fluid.model.setChangedPath(options,segs.slice(0,i+1),"ADD")}return{root:target,last:segs[endpos]}},fluid.model.defaultAccessorConfig=function(options){return options=options||{},options.resolverSetConfig=options.resolverSetConfig||fluid.model.escapedSetConfig,options.resolverGetConfig=options.resolverGetConfig||fluid.model.escapedGetConfig,options},fluid.model.applyHolderChangeRequest=function(holder,request,options){options=fluid.model.defaultAccessorConfig(options),options.deltaMap=options.changeMap?{}:null,options.deltas=0;var pen,length=request.segs.length,atRoot=0===length;if(atRoot?pen={root:holder,last:"model"}:(holder.model||(holder.model={},fluid.model.setChangedPath(options,[],options.inverse?"DELETE":"ADD")),pen=fluid.model.stepTargetAccess(holder.model,request.type,request.segs,0,length-1,options)),"ADD"===request.type){var value=request.value,segs=fluid.makeArray(request.segs);fluid.model.applyChangeStrategy(pen.root,pen.last,length-1,segs,value,options,atRoot)}else"DELETE"===request.type?pen.root&&void 0!==pen.root[pen.last]&&(delete pen.root[pen.last],options.changeMap&&fluid.model.setChangedPath(options,request.segs,"DELETE")):fluid.fail("Unrecognised change type of "+request.type);return options.deltas?options.deltaMap:null},fluid.model.diff=function(modela,modelb,options){options=options||{changes:0,unchanged:0,changeMap:{}};var togo,typea=fluid.typeCode(modela),typeb=fluid.typeCode(modelb);if("primitive"===typea&&"primitive"===typeb)togo=fluid.model.isSameValue(modela,modelb);else if("primitive"===typea^"primitive"===typeb)togo=!1;else{var holdera={model:fluid.copy(modela)};fluid.model.applyHolderChangeRequest(holdera,{value:modelb,segs:[],type:"ADD"},options);var holderb={model:fluid.copy(modelb)};options.inverse=!0,fluid.model.applyHolderChangeRequest(holderb,{value:modela,segs:[],type:"ADD"},options),togo=0===options.changes}return togo===!1&&0===options.changes?(options.changes=1,options.changeMap=void 0===modelb?"DELETE":"ADD"):togo===!0&&0===options.unchanged&&(options.unchanged=1),togo},fluid.matchChanges=function(changeMap,specSegs,newHolder){for(var root=newHolder.model,map=changeMap,outSegs=["model"],wildcard=!1,togo=[],i=0;i<specSegs.length;++i){var seg=specSegs[i];"*"===seg?i===specSegs.length-1?wildcard=!0:fluid.fail("Wildcard specification in modelChanged listener is only supported for the final path segment: "+specSegs.join(".")):(outSegs.push(seg),map=fluid.isPrimitive(map)?map:map[seg],root=root?root[seg]:void 0)}return map&&(wildcard?fluid.each(root,function(value,key){togo.push(outSegs.concat(key))}):togo.push(outSegs)),togo},fluid.storeExternalChange=function(transRec,applier,invalidPath,spec,args){var pathString=applier.composeSegments.apply(null,invalidPath),keySegs=[applier.holder.id,spec.listenerId,spec.wildcard?pathString:""],keyString=keySegs.join("|");transRec.externalChanges[keyString]={listener:spec.listener,namespace:spec.namespace,priority:spec.priority,args:args}},fluid.notifyModelChanges=function(listeners,changeMap,newHolder,oldHolder,changeRequest,transaction,applier,that){if(listeners)for(var transRec=transaction&&fluid.getModelTransactionRec(that,transaction.id),i=0;i<listeners.length;++i)for(var spec=listeners[i],multiplePaths=spec.segsArray.length>1,j=0;j<spec.segsArray.length;++j)for(var invalidPaths=fluid.matchChanges(changeMap,spec.segsArray[j],newHolder),k=0;k<invalidPaths.length;++k){if(applier.destroyed)return;var invalidPath=invalidPaths[k];spec.listener=fluid.event.resolveListener(spec.listener);var args=[multiplePaths?newHolder.model:fluid.model.getSimple(newHolder,invalidPath),multiplePaths?oldHolder.model:fluid.model.getSimple(oldHolder,invalidPath),multiplePaths?[]:invalidPath.slice(1),changeRequest,transaction,applier];if(!spec.isRelay){var isNull=fluid.model.diff(args[0],args[1]);if(isNull)continue;var sourceExcluded=fluid.isExcludedChangeSource(transaction,spec);if(sourceExcluded)continue}transRec&&!spec.isRelay&&spec.transactional?fluid.storeExternalChange(transRec,applier,invalidPath,spec,args):spec.listener.apply(null,args)}},fluid.bindELMethods=function(applier){applier.parseEL=function(EL){return fluid.model.pathToSegments(EL,applier.options.resolverSetConfig)},applier.composeSegments=function(){return applier.options.resolverSetConfig.parser.compose.apply(null,arguments)}},fluid.initModelEvent=function(that,applier,trans,listeners){fluid.notifyModelChanges(listeners,"ADD",trans.oldHolder,fluid.emptyHolder,null,trans,applier,that)},fluid.emptyHolder=fluid.freezeRecursive({model:void 0}),fluid.preFireChangeRequest=function(applier,changeRequest){changeRequest.type||(changeRequest.type="ADD"),changeRequest.segs=changeRequest.segs||applier.parseEL(changeRequest.path)},fluid.bindRequestChange=function(that){that.change=function(path,value,type,source){var changeRequest={path:path,value:value,type:type,source:source};that.fireChangeRequest(changeRequest)}},fluid.isObjectSimple=function(totest){return"[object Object]"===Object.prototype.toString.call(totest)},fluid.mergeChangeSources=function(target,globalSources){fluid.isObjectSimple(globalSources)?fluid.extend(target,globalSources):fluid.each(fluid.makeArray(globalSources),function(globalSource){target[globalSource]=!0})},fluid.ChangeApplier=function(){},fluid.makeHolderChangeApplier=function(holder,options){options=fluid.model.defaultAccessorConfig(options);var applierId=fluid.allocateGuid(),that=new fluid.ChangeApplier,name=fluid.isComponent(holder)?"ChangeApplier for component "+fluid.dumpThat(holder):"ChangeApplier with id "+applierId;return $.extend(that,{applierId:applierId,holder:holder,listeners:fluid.makeEventFirer({name:"Internal change listeners for "+name}),transListeners:fluid.makeEventFirer({name:"External change listeners for "+name}),options:options,modelChanged:{},preCommit:fluid.makeEventFirer({name:"preCommit event for "+name}),postCommit:fluid.makeEventFirer({name:"postCommit event for "+name})}),that.destroy=function(){that.preCommit.destroy(),that.postCommit.destroy(),that.destroyed=!0},that.modelChanged.addListener=function(spec,listener,namespace,softNamespace){spec="string"==typeof spec?{path:spec}:fluid.copy(spec),spec.listenerId=spec.listenerId||fluid.allocateGuid(),spec.namespace=namespace,spec.softNamespace=softNamespace,"string"==typeof listener&&(listener={globalName:listener}),spec.listener=listener,spec.transactional!==!1&&(spec.transactional=!0),spec.segsArray||(void 0!==spec.path&&(spec.segs=spec.segs||that.parseEL(spec.path)),spec.segsArray||(spec.segsArray=[spec.segs])),fluid.parseSourceExclusionSpec(spec,spec),spec.wildcard=fluid.accumulate(fluid.transform(spec.segsArray,function(segs){return fluid.contains(segs,"*")}),fluid.add,0),spec.wildcard&&spec.segsArray.length>1&&fluid.fail("Error in model listener specification ",spec," - you may not supply a wildcard pattern as one of a set of multiple paths to be matched");var firer=that[spec.transactional?"transListeners":"listeners"];return firer.addListener(spec),spec},that.modelChanged.removeListener=function(listener){that.listeners.removeListener(listener),that.transListeners.removeListener(listener)},that.fireChangeRequest=function(changeRequest){var ation=that.initiate("local",changeRequest.source);ation.fireChangeRequest(changeRequest),ation.commit()},that.initiate=function(localSource,globalSources,transactionId){localSource="init"===globalSources?null:localSource||"local";var defeatPost="relay"===localSource,trans={instanceId:fluid.allocateGuid(),id:transactionId||fluid.allocateGuid(),changeRecord:{resolverSetConfig:options.resolverSetConfig,resolverGetConfig:options.resolverGetConfig},reset:function(){trans.oldHolder=holder,trans.newHolder={model:fluid.copy(holder.model)},trans.changeRecord.changes=0,trans.changeRecord.unchanged=0,trans.changeRecord.changeMap={}},commit:function(code){if(that.preCommit.fire(trans,that,code),trans.changeRecord.changes>0){var oldHolder={model:holder.model};holder.model=trans.newHolder.model,fluid.notifyModelChanges(that.transListeners.sortedListeners,trans.changeRecord.changeMap,holder,oldHolder,null,trans,that,holder)}defeatPost||that.postCommit.fire(trans,that,code)},fireChangeRequest:function(changeRequest){fluid.preFireChangeRequest(that,changeRequest),changeRequest.transactionId=trans.id;var deltaMap=fluid.model.applyHolderChangeRequest(trans.newHolder,changeRequest,trans.changeRecord);fluid.notifyModelChanges(that.listeners.sortedListeners,deltaMap,trans.newHolder,holder,changeRequest,trans,that,holder)},hasChangeSource:function(source){return trans.fullSources[source]}},transRec=fluid.getModelTransactionRec(holder,trans.id);return transRec&&(fluid.mergeChangeSources(transRec.sources,globalSources),trans.sources=transRec.sources,trans.fullSources=Object.create(transRec.sources),trans.fullSources[localSource]=!0),trans.reset(),fluid.bindRequestChange(trans),trans},fluid.bindRequestChange(that),fluid.bindELMethods(that),that}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{},fluid=fluid||fluid_2_0_0;!function($,fluid){"use strict";fluid.registerNamespace("fluid.model.transform"),fluid.defaults("fluid.transformFunction",{gradeNames:"fluid.function"}),fluid.defaults("fluid.standardInputTransformFunction",{gradeNames:"fluid.transformFunction"}),fluid.defaults("fluid.standardOutputTransformFunction",{gradeNames:"fluid.transformFunction"}),fluid.defaults("fluid.multiInputTransformFunction",{gradeNames:"fluid.transformFunction"}),fluid.defaults("fluid.standardTransformFunction",{gradeNames:["fluid.standardInputTransformFunction","fluid.standardOutputTransformFunction"]}),fluid.defaults("fluid.lens",{gradeNames:"fluid.transformFunction",invertConfiguration:null}),fluid.model.transform.pathToRule=function(inputPath){return{transform:{type:"fluid.transforms.value",inputPath:inputPath}}},fluid.model.transform.literalValueToRule=function(input){return{transform:{type:"fluid.transforms.literalValue",input:input}}},fluid.model.composePaths=function(prefix,suffix){return prefix=0===prefix?"0":prefix||"",suffix=0===suffix?"0":suffix||"",prefix?suffix?prefix+"."+suffix:prefix:suffix},fluid.model.transform.accumulateInputPath=function(inputPath,transformer,paths){void 0!==inputPath&&paths.push(fluid.model.composePaths(transformer.inputPrefix,inputPath))},fluid.model.transform.accumulateStandardInputPath=function(input,transformSpec,transformer,paths){fluid.model.transform.getValue(void 0,transformSpec[input],transformer),fluid.model.transform.accumulateInputPath(transformSpec[input+"Path"],transformer,paths)},fluid.model.transform.accumulateMultiInputPaths=function(inputVariables,transformSpec,transformer,paths){fluid.each(inputVariables,function(v,k){fluid.model.transform.accumulateStandardInputPath(k,transformSpec,transformer,paths)})},fluid.model.transform.getValue=function(inputPath,value,transformer){var togo;return void 0!==inputPath&&(togo=fluid.get(transformer.source,fluid.model.composePaths(transformer.inputPrefix,inputPath),transformer.resolverGetConfig)),void 0===togo&&(togo=fluid.isPrimitive(value)?value:"literalValue"in value?value.literalValue:void 0===value.transform?value:transformer.expand(value)),togo},fluid.model.transform.NONDEFAULT_OUTPUT_PATH_RETURN={},fluid.model.transform.setValue=function(userOutputPath,value,transformer){var toset=fluid.copy(value),outputPath=fluid.model.composePaths(transformer.outputPrefix,userOutputPath);return void 0!==toset&&transformer.applier.change(outputPath,toset),userOutputPath?fluid.model.transform.NONDEFAULT_OUTPUT_PATH_RETURN:toset},fluid.model.transform.resolveParam=function(transformSpec,transformer,key,def){var val=fluid.model.transform.getValue(transformSpec[key+"Path"],transformSpec[key],transformer);return void 0!==val?val:def},fluid.model.transform.matchValue=function(expected,actual,partialMatches){var stats={changes:0,unchanged:0,changeMap:{}};return fluid.model.diff(expected,actual,stats),0===stats.unchanged?0:partialMatches?0xffffff000000-16777216*stats.changes+stats.unchanged:stats.changes?0:0xffffff000000+stats.unchanged},fluid.model.transform.invertPaths=function(transformSpec,transformer){var oldOutput=fluid.model.composePaths(transformer.outputPrefix,transformSpec.outputPath);return transformSpec.outputPath=fluid.model.composePaths(transformer.inputPrefix,transformSpec.inputPath),transformSpec.inputPath=oldOutput,transformSpec},fluid.model.transform.prefixApplier=function(transformSpec,transformer){transformSpec.inputPrefix&&transformer.inputPrefixOp.push(transformSpec.inputPrefix),transformSpec.outputPrefix&&transformer.outputPrefixOp.push(transformSpec.outputPrefix),transformer.expand(transformSpec.input),transformSpec.inputPrefix&&transformer.inputPrefixOp.pop(),transformSpec.outputPrefix&&transformer.outputPrefixOp.pop()},fluid.defaults("fluid.model.transform.prefixApplier",{gradeNames:["fluid.transformFunction"]}),fluid.model.makePathStack=function(transform,prefixName){var stack=transform[prefixName+"Stack"]=[];return transform[prefixName]="",{push:function(prefix){var newPath=fluid.model.composePaths(transform[prefixName],prefix);stack.push(transform[prefixName]),transform[prefixName]=newPath},pop:function(){transform[prefixName]=stack.pop()}}},fluid.model.transform.doTransform=function(transformSpec,transformer,transformOpts){var expdef=transformOpts.defaults,transformFn=fluid.getGlobalValue(transformOpts.typeName);"function"!=typeof transformFn&&fluid.fail("Transformation record specifies transformation function with name "+transformSpec.type+" which is not a function - ",transformFn),fluid.hasGrade(expdef,"fluid.transformFunction")||(expdef=fluid.defaults("fluid.standardTransformFunction"));var transformArgs=[transformSpec,transformer];if(fluid.hasGrade(expdef,"fluid.multiInputTransformFunction")){var inputs={};fluid.each(expdef.inputVariables,function(v,k){inputs[k]=function(){var input=fluid.model.transform.getValue(transformSpec[k+"Path"],transformSpec[k],transformer);return input=void 0===input&&null!==v?v:input}}),transformArgs.unshift(inputs)}if(fluid.hasGrade(expdef,"fluid.standardInputTransformFunction")){"input"in transformSpec||"inputPath"in transformSpec||fluid.fail('Error in transform specification. Either "input" or "inputPath" must be specified for a standardInputTransformFunction: received ',transformSpec);var expanded=fluid.model.transform.getValue(transformSpec.inputPath,transformSpec.input,transformer);if(transformArgs.unshift(expanded),void 0===expanded)return}var transformed=transformFn.apply(null,transformArgs);if(fluid.hasGrade(expdef,"fluid.standardOutputTransformFunction")){var outputPath=void 0!==transformSpec.outputPath?transformSpec.outputPath:transformOpts.doOutput?"":void 0;void 0!==outputPath&&void 0!==transformed&&(fluid.model.transform.setValue(transformSpec.outputPath,transformed,transformer),transformed=void 0)}return transformed};var globalAccept=[];fluid.registerNamespace("fluid.pathUtil"),fluid.pathUtil.getPathSegment=function(path,i){return fluid.pathUtil.getPathSegmentImpl(globalAccept,path,i),globalAccept[0]},fluid.pathUtil.getHeadPath=function(path){return fluid.pathUtil.getPathSegment(path,0)},fluid.pathUtil.getFromHeadPath=function(path){var firstdot=fluid.pathUtil.getPathSegmentImpl(null,path,0);return firstdot===path.length?"":path.substring(firstdot+1)},fluid.pathUtil.matchPath=function(spec,path,exact){for(var togo=[];;){if(""===path^""===spec&&exact)return null;if(!spec||!path)break;var spechead=fluid.pathUtil.getHeadPath(spec),pathhead=fluid.pathUtil.getHeadPath(path);if("*"!==spechead&&spechead!==pathhead)return null;togo.push(pathhead),spec=fluid.pathUtil.getFromHeadPath(spec),path=fluid.pathUtil.getFromHeadPath(path)}return togo},fluid.model.transform.expandWildcards=function(transformer,source){fluid.each(source,function(value,key){var q=transformer.queuedTransforms;transformer.pathOp.push(fluid.pathUtil.escapeSegment(key.toString()));for(var i=0;i<q.length;++i)if(fluid.pathUtil.matchPath(q[i].matchPath,transformer.path,!0)){var esCopy=fluid.copy(q[i].transformSpec);(void 0===esCopy.inputPath||fluid.model.transform.hasWildcard(esCopy.inputPath))&&(esCopy.inputPath=""),transformer.inputPrefixOp.push(transformer.path),transformer.outputPrefixOp.push(transformer.path);var transformOpts=fluid.model.transform.lookupType(esCopy.type),result=fluid.model.transform.doTransform(esCopy,transformer,transformOpts);void 0!==result&&fluid.model.transform.setValue(null,result,transformer),transformer.outputPrefixOp.pop(),transformer.inputPrefixOp.pop()}fluid.isPrimitive(value)||fluid.model.transform.expandWildcards(transformer,value),transformer.pathOp.pop()})},fluid.model.transform.hasWildcard=function(path){return"string"==typeof path&&path.indexOf("*")!==-1},fluid.model.transform.maybePushWildcard=function(transformSpec,transformer){var matchPath,hw=fluid.model.transform.hasWildcard;return hw(transformSpec.inputPath)?matchPath=fluid.model.composePaths(transformer.inputPrefix,transformSpec.inputPath):(hw(transformer.outputPrefix)||hw(transformSpec.outputPath))&&(matchPath=fluid.model.composePaths(transformer.outputPrefix,transformSpec.outputPath)),!!matchPath&&(transformer.queuedTransforms.push({transformSpec:transformSpec,outputPrefix:transformer.outputPrefix,inputPrefix:transformer.inputPrefix,matchPath:matchPath}),!0)},fluid.model.sortByKeyLength=function(inObject){var keys=fluid.keys(inObject);return keys.sort(fluid.compareStringLength(!0))},fluid.model.transform.handleTransformStrategy=function(transformSpec,transformer,transformOpts){return fluid.model.transform.maybePushWildcard(transformSpec,transformer)?void 0:fluid.model.transform.doTransform(transformSpec,transformer,transformOpts)},fluid.model.transform.handleInvertStrategy=function(transformSpec,transformer,transformOpts){transformSpec=fluid.copy(transformSpec),fluid.hasGrade(transformOpts.defaults,"fluid.standardTransformFunction")&&(transformSpec=fluid.model.transform.invertPaths(transformSpec,transformer));var invertor=transformOpts.defaults&&transformOpts.defaults.invertConfiguration;if(invertor){var inverted=fluid.invokeGlobalFunction(invertor,[transformSpec,transformer]);transformer.inverted.push(inverted)}},fluid.model.transform.handleCollectStrategy=function(transformSpec,transformer,transformOpts){var defaults=transformOpts.defaults,standardInput=fluid.hasGrade(defaults,"fluid.standardInputTransformFunction"),multiInput=fluid.hasGrade(defaults,"fluid.multiInputTransformFunction");if(standardInput&&fluid.model.transform.accumulateStandardInputPath("input",transformSpec,transformer,transformer.inputPaths),multiInput&&fluid.model.transform.accumulateMultiInputPaths(defaults.inputVariables,transformSpec,transformer,transformer.inputPaths),!multiInput&&!standardInput){var collector=defaults.collectInputPaths;if(collector){var collected=fluid.makeArray(fluid.invokeGlobalFunction(collector,[transformSpec,transformer]));transformer.inputPaths=transformer.inputPaths.concat(collected)}}},fluid.model.transform.lookupType=function(typeName,transformSpec){typeName||fluid.fail("Transformation record is missing a type name: ",transformSpec),typeName.indexOf(".")===-1&&(typeName="fluid.transforms."+typeName);var defaults=fluid.defaults(typeName);return{defaults:defaults,typeName:typeName}},fluid.model.transform.processRule=function(rule,transformer){"string"==typeof rule?rule=fluid.model.transform.pathToRule(rule):void 0!==rule.literalValue&&(rule=fluid.model.transform.literalValueToRule(rule.literalValue));var togo;if(rule.transform){var transformSpec,transformOpts;if(fluid.isArrayable(rule.transform)){var transforms=rule.transform;togo=void 0;for(var i=0;i<transforms.length;++i)transformSpec=transforms[i],transformOpts=fluid.model.transform.lookupType(transformSpec.type),transformer.transformHandler(transformSpec,transformer,transformOpts)}else transformSpec=rule.transform,transformOpts=fluid.model.transform.lookupType(transformSpec.type),togo=transformer.transformHandler(transformSpec,transformer,transformOpts)}return fluid.isArrayable(rule)&&(transformer.collectedFlatSchemaOpts=transformer.collectedFlatSchemaOpts||{},transformer.collectedFlatSchemaOpts[transformer.outputPrefix]="array"),fluid.each(rule,function(value,key){if("transform"!==key){transformer.outputPrefixOp.push(key);var togo=transformer.expand(value,transformer);void 0!==togo&&(fluid.model.transform.setValue(null,togo,transformer),togo=void 0),transformer.outputPrefixOp.pop()}}),togo},fluid.model.transform.makeStrategy=function(transformer,handleFn,transformFn){transformFn=transformFn||fluid.model.transform.processRule,transformer.expand=function(rules){return transformFn(rules,transformer)},transformer.outputPrefixOp=fluid.model.makePathStack(transformer,"outputPrefix"),transformer.inputPrefixOp=fluid.model.makePathStack(transformer,"inputPrefix"),transformer.transformHandler=handleFn},fluid.model.transform.invertConfiguration=function(rules){var transformer={inverted:[]};return fluid.model.transform.makeStrategy(transformer,fluid.model.transform.handleInvertStrategy),transformer.expand(rules),{transform:transformer.inverted}},fluid.model.transform.collectInputPaths=function(rules){var transformer={inputPaths:[]};return fluid.model.transform.makeStrategy(transformer,fluid.model.transform.handleCollectStrategy),transformer.expand(rules),transformer.inputPaths},fluid.model.transform.flatSchemaStrategy=function(flatSchema,getConfig){var keys=fluid.model.sortByKeyLength(flatSchema);return function(root,segment,index,segs){for(var path=getConfig.parser.compose.apply(null,segs.slice(0,index)),i=0;i<keys.length;++i){var key=keys[i];if(null!==fluid.pathUtil.matchPath(key,path,!0))return flatSchema[key]}}},fluid.model.transform.defaultSchemaValue=function(schemaValue){var type=fluid.isPrimitive(schemaValue)?schemaValue:schemaValue.type;return"array"===type?[]:{}},fluid.model.transform.isomorphicSchemaStrategy=function(source,getConfig){return function(root,segment,index,segs){var existing=fluid.get(source,segs.slice(0,index),getConfig);return fluid.isArrayable(existing)?"array":"object"}},fluid.model.transform.decodeStrategy=function(source,options,getConfig){return options.isomorphic?fluid.model.transform.isomorphicSchemaStrategy(source,getConfig):options.flatSchema?fluid.model.transform.flatSchemaStrategy(options.flatSchema,getConfig):void 0},fluid.model.transform.schemaToCreatorStrategy=function(strategy){return function(root,segment,index,segs){if(void 0===root[segment]){var schemaValue=strategy(root,segment,index,segs);return root[segment]=fluid.model.transform.defaultSchemaValue(schemaValue),root[segment]}}},fluid.model.transform.sequence=function(source,rules,options){for(var i=0;i<rules.length;++i)source=fluid.model.transform(source,rules[i],options);return source},fluid.model.compareByPathLength=function(changea,changeb){var pdiff=changea.path.length-changeb.path.length;return 0===pdiff?changea.sequence-changeb.sequence:pdiff},fluid.model.fireSortedChanges=function(changes,applier){changes.sort(fluid.model.compareByPathLength),fluid.fireChanges(applier,changes)},fluid.model.transformWithRules=function(source,rules,options){options=options||{};var getConfig=fluid.model.escapedGetConfig,setConfig=fluid.model.escapedSetConfig,schemaStrategy=fluid.model.transform.decodeStrategy(source,options,getConfig),transformer={source:source,target:{model:schemaStrategy?fluid.model.transform.defaultSchemaValue(schemaStrategy(null,"",0,[""])):{}},resolverGetConfig:getConfig,resolverSetConfig:setConfig,collectedFlatSchemaOpts:void 0,queuedChanges:[],queuedTransforms:[]};fluid.model.transform.makeStrategy(transformer,fluid.model.transform.handleTransformStrategy),transformer.applier={fireChangeRequest:function(changeRequest){
changeRequest.sequence=transformer.queuedChanges.length,transformer.queuedChanges.push(changeRequest)}},fluid.bindRequestChange(transformer.applier),transformer.expand(rules);var rootSetConfig=fluid.copy(setConfig);return void 0!==transformer.collectedFlatSchemaOpts&&($.extend(transformer.collectedFlatSchemaOpts,options.flatSchema),schemaStrategy=fluid.model.transform.flatSchemaStrategy(transformer.collectedFlatSchemaOpts,getConfig)),rootSetConfig.strategies=[fluid.model.defaultFetchStrategy,schemaStrategy?fluid.model.transform.schemaToCreatorStrategy(schemaStrategy):fluid.model.defaultCreatorStrategy],transformer.finalApplier=options.finalApplier||fluid.makeHolderChangeApplier(transformer.target,{resolverSetConfig:rootSetConfig}),transformer.queuedTransforms.length>0&&(transformer.typeStack=[],transformer.pathOp=fluid.model.makePathStack(transformer,"path"),fluid.model.transform.expandWildcards(transformer,source)),fluid.model.fireSortedChanges(transformer.queuedChanges,transformer.finalApplier),transformer.target.model},$.extend(fluid.model.transformWithRules,fluid.model.transform),fluid.model.transform=fluid.model.transformWithRules,fluid.transformOne=function(rules){return{transformOptions:{transformer:"fluid.model.transformWithRules",config:rules}}},fluid.transformMany=function(rules){return{transformOptions:{transformer:"fluid.model.transform.sequence",config:rules}}}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{},fluid=fluid||fluid_2_0_0;!function($,fluid){"use strict";fluid.registerNamespace("fluid.model.transform"),fluid.registerNamespace("fluid.transforms"),fluid.defaults("fluid.transforms.value",{gradeNames:"fluid.standardTransformFunction",invertConfiguration:"fluid.identity"}),fluid.transforms.value=fluid.identity,fluid.transforms.identity=fluid.transforms.value,fluid.defaults("fluid.transforms.identity",{gradeNames:"fluid.transforms.value"}),fluid.transforms.invertToIdentity=function(transformSpec){return transformSpec.type="fluid.transforms.identity",transformSpec},fluid.defaults("fluid.transforms.literalValue",{gradeNames:"fluid.standardOutputTransformFunction"}),fluid.transforms.literalValue=function(transformSpec){return transformSpec.input},fluid.defaults("fluid.transforms.stringToNumber",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.stringToNumber.invert"}),fluid.transforms.stringToNumber=function(value){var newValue=Number(value);return isNaN(newValue)?void 0:newValue},fluid.transforms.stringToNumber.invert=function(transformSpec){return transformSpec.type="fluid.transforms.numberToString",transformSpec},fluid.defaults("fluid.transforms.numberToString",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.numberToString.invert"}),fluid.transforms.numberToString=function(value){return"number"!=typeof value?void 0:""+value},fluid.transforms.numberToString.invert=function(transformSpec){return transformSpec.type="fluid.transforms.stringToNumber",transformSpec},fluid.defaults("fluid.transforms.count",{gradeNames:"fluid.standardTransformFunction"}),fluid.transforms.count=function(value){return fluid.makeArray(value).length},fluid.defaults("fluid.transforms.round",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.invertToIdentity"}),fluid.transforms.round=function(value){return Math.round(value)},fluid.defaults("fluid.transforms.delete",{gradeNames:"fluid.transformFunction"}),fluid.transforms["delete"]=function(transformSpec,transformer){var outputPath=fluid.model.composePaths(transformer.outputPrefix,transformSpec.outputPath);transformer.applier.change(outputPath,null,"DELETE")},fluid.defaults("fluid.transforms.firstValue",{gradeNames:"fluid.standardOutputTransformFunction"}),fluid.transforms.firstValue=function(transformSpec,transformer){transformSpec.values&&transformSpec.values.length||fluid.fail('firstValue transformer requires an array of values at path named "values", supplied',transformSpec);for(var i=0;i<transformSpec.values.length;i++){var value=transformSpec.values[i],expanded=transformer.expand(value);if(void 0!==expanded)return expanded}},fluid.defaults("fluid.transforms.linearScale",{gradeNames:["fluid.multiInputTransformFunction","fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.linearScale.invert",inputVariables:{factor:1,offset:0}}),fluid.transforms.linearScale=function(input,extraInputs){var factor=extraInputs.factor(),offset=extraInputs.offset();if("number"==typeof input&&"number"==typeof factor&&"number"==typeof offset)return input*factor+offset},fluid.transforms.linearScale.invert=function(transformSpec){return delete transformSpec.factorPath,delete transformSpec.offsetPath,void 0!==transformSpec.factor&&(transformSpec.factor=0===transformSpec.factor?0:1/transformSpec.factor),void 0!==transformSpec.offset&&(transformSpec.offset=-transformSpec.offset*(void 0!==transformSpec.factor?transformSpec.factor:1)),transformSpec},fluid.defaults("fluid.transforms.binaryOp",{gradeNames:["fluid.multiInputTransformFunction","fluid.standardOutputTransformFunction"],inputVariables:{left:null,right:null}}),fluid.transforms.binaryLookup={"===":function(a,b){return fluid.model.isSameValue(a,b)},"!==":function(a,b){return!fluid.model.isSameValue(a,b)},"<=":function(a,b){return a<=b},"<":function(a,b){return a<b},">=":function(a,b){return a>=b},">":function(a,b){return a>b},"+":function(a,b){return a+b},"-":function(a,b){return a-b},"*":function(a,b){return a*b},"/":function(a,b){return a/b},"%":function(a,b){return a%b},"&&":function(a,b){return a&&b},"||":function(a,b){return a||b}},fluid.transforms.binaryOp=function(inputs,transformSpec,transformer){var left=inputs.left(),right=inputs.right(),operator=fluid.model.transform.getValue(void 0,transformSpec.operator,transformer),fun=fluid.transforms.binaryLookup[operator];return void 0===fun||void 0===left||void 0===right?void 0:fun(left,right)},fluid.defaults("fluid.transforms.condition",{gradeNames:["fluid.multiInputTransformFunction","fluid.standardOutputTransformFunction"],inputVariables:{"true":null,"false":null,condition:null}}),fluid.transforms.condition=function(inputs){var condition=inputs.condition();if(null!==condition)return inputs[condition?"true":"false"]()},fluid.defaults("fluid.transforms.valueMapper",{gradeNames:["fluid.transformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.valueMapper.invert",collectInputPaths:"fluid.transforms.valueMapper.collect"}),fluid.model.transform.compareMatches=function(speca,specb){var matchDiff=specb.matchValue-speca.matchValue;return 0===matchDiff?speca.index-specb.index:matchDiff},fluid.transforms.valueMapper=function(transformSpec,transformer){transformSpec.match||fluid.fail('valueMapper requires an array or hash of matches at path named "match", supplied ',transformSpec);var value=fluid.model.transform.getValue(transformSpec.defaultInputPath,void 0,transformer),matchedEntry=fluid.isArrayable(transformSpec.match)?fluid.transforms.valueMapper.longFormMatch(value,transformSpec,transformer):transformSpec.match[value];if(void 0===matchedEntry&&(matchedEntry=transformSpec.noMatch),void 0!==matchedEntry){var outputPath=void 0===matchedEntry.outputPath?transformSpec.defaultOutputPath:matchedEntry.outputPath;transformer.outputPrefixOp.push(outputPath);var outputValue;return fluid.isPrimitive(matchedEntry)?outputValue=matchedEntry:matchedEntry.outputUndefinedValue?outputValue=void 0:(outputValue=fluid.model.transform.resolveParam(matchedEntry,transformer,"outputValue",void 0),outputValue=void 0===outputValue?transformSpec.defaultOutputValue:outputValue),"string"==typeof outputPath&&void 0!==outputValue&&(fluid.model.transform.setValue(void 0,outputValue,transformer,transformSpec.merge),outputValue=void 0),transformer.outputPrefixOp.pop(),outputValue}},fluid.transforms.valueMapper.longFormMatch=function(valueFromDefaultPath,transformSpec,transformer){var o=transformSpec.match;0===o.length&&fluid.fail("valueMapper supplied empty list of matches: ",transformSpec);for(var matchPower=[],i=0;i<o.length;++i){var option=o[i],value=option.inputPath?fluid.model.transform.getValue(option.inputPath,void 0,transformer):valueFromDefaultPath,matchValue=fluid.model.transform.matchValue(option.inputValue,value,option.partialMatches);matchPower[i]={index:i,matchValue:matchValue}}return matchPower.sort(fluid.model.transform.compareMatches),matchPower[0].matchValue<=0?void 0:o[matchPower[0].index]},fluid.transforms.valueMapper.invert=function(transformSpec,transformer){var match=[],togo={type:"fluid.transforms.valueMapper",match:match},isArray=fluid.isArrayable(transformSpec.match);togo.defaultInputPath=fluid.model.composePaths(transformer.outputPrefix,transformSpec.defaultOutputPath),togo.defaultOutputPath=fluid.model.composePaths(transformer.inputPrefix,transformSpec.defaultInputPath);var def=fluid.firstDefined;return fluid.each(transformSpec.match,function(option,key){if(option.outputUndefinedValue!==!0){var outOption={},origInputValue=def(isArray?option.inputValue:key,transformSpec.defaultInputValue);void 0===origInputValue&&fluid.fail("Failure inverting configuration for valueMapper - inputValue could not be resolved for record "+key+": ",transformSpec),outOption.outputValue=origInputValue,outOption.inputValue=!isArray&&fluid.isPrimitive(option)?option:def(option.outputValue,transformSpec.defaultOutputValue),option.outputPath&&(outOption.inputPath=fluid.model.composePaths(transformer.outputPrefix,def(option.outputPath,transformSpec.outputPath))),option.inputPath&&(outOption.outputPath=fluid.model.composePaths(transformer.inputPrefix,def(option.inputPath,transformSpec.inputPath))),match.push(outOption)}}),togo},fluid.transforms.valueMapper.collect=function(transformSpec,transformer){var togo=[];return fluid.model.transform.accumulateInputPath(transformSpec.defaultInputPath,transformer,togo),fluid.each(transformSpec.match,function(option){fluid.model.transform.accumulateInputPath(option.inputPath,transformer,togo)}),togo},fluid.defaults("fluid.transforms.arrayToSetMembership",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.arrayToSetMembership.invert"}),fluid.transforms.arrayToSetMembership=function(value,transformSpec,transformer){var output={},options=transformSpec.options;return value&&fluid.isArrayable(value)||fluid.fail("arrayToSetMembership didn't find array at inputPath nor passed as value.",transformSpec),options||fluid.fail("arrayToSetMembership requires an options block set"),void 0===transformSpec.presentValue&&(transformSpec.presentValue=!0),void 0===transformSpec.missingValue&&(transformSpec.missingValue=!1),fluid.each(options,function(outPath,key){var outVal=value.indexOf(key)!==-1?transformSpec.presentValue:transformSpec.missingValue;fluid.set(output,outPath,outVal,transformer.resolverSetConfig)}),output},fluid.transforms.arrayToSetMembership.invertWithType=function(transformSpec,transformer,newType){transformSpec.type=newType;var newOptions={};return fluid.each(transformSpec.options,function(path,oldKey){newOptions[path]=oldKey}),transformSpec.options=newOptions,transformSpec},fluid.transforms.arrayToSetMembership.invert=function(transformSpec,transformer){return fluid.transforms.arrayToSetMembership.invertWithType(transformSpec,transformer,"fluid.transforms.setMembershipToArray")},fluid.defaults("fluid.transforms.setMembershipToArray",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.setMembershipToArray.invert"}),fluid.transforms.setMembershipToArray=function(input,transformSpec,transformer){var options=transformSpec.options;options||fluid.fail("setMembershipToArray requires an options block specified"),void 0===transformSpec.presentValue&&(transformSpec.presentValue=!0),void 0===transformSpec.missingValue&&(transformSpec.missingValue=!1);var outputArr=[];return fluid.each(options,function(outputVal,key){var value=fluid.get(input,key,transformer.resolverGetConfig);value===transformSpec.presentValue&&outputArr.push(outputVal)}),outputArr},fluid.transforms.setMembershipToArray.invert=function(transformSpec,transformer){return fluid.transforms.arrayToSetMembership.invertWithType(transformSpec,transformer,"fluid.transforms.arrayToSetMembership")},fluid.model.transform.applyPaths=function(operation,pathOp,paths){for(var i=0;i<paths.length;++i)"push"===operation?pathOp.push(paths[i]):pathOp.pop()},fluid.model.transform.expandInnerValues=function(inputPath,outputPath,transformer,innerValues){var inputPrefixOp=transformer.inputPrefixOp,outputPrefixOp=transformer.outputPrefixOp,apply=fluid.model.transform.applyPaths;apply("push",inputPrefixOp,inputPath),apply("push",outputPrefixOp,outputPath);var expanded={};return fluid.each(innerValues,function(innerValue){var expandedInner=transformer.expand(innerValue);fluid.isPrimitive(expandedInner)?expanded=expandedInner:$.extend(!0,expanded,expandedInner)}),apply("pop",outputPrefixOp,outputPath),apply("pop",inputPrefixOp,inputPath),expanded},fluid.defaults("fluid.transforms.indexArrayByKey",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.indexArrayByKey.invert"}),fluid.transforms.indexArrayByKey=function(arr,transformSpec,transformer){void 0===transformSpec.key&&fluid.fail("indexArrayByKey requires a 'key' option.",transformSpec),fluid.isArrayable(arr)||fluid.fail("indexArrayByKey didn't find array at inputPath.",transformSpec);var newHash={},pivot=transformSpec.key;return fluid.each(arr,function(v,k){var newKey=v[pivot],keyType=typeof newKey;"string"!==keyType&&"boolean"!==keyType&&"number"!==keyType&&fluid.fail("indexArrayByKey encountered untransformable array due to missing or invalid key",v);var content=fluid.copy(v);delete content[pivot],transformSpec.innerValue&&(content=fluid.model.transform.expandInnerValues([transformer.inputPrefix,transformSpec.inputPath,k.toString()],[transformSpec.outputPath,newKey],transformer,transformSpec.innerValue)),newHash[newKey]=content}),newHash},fluid.transforms.indexArrayByKey.invert=function(transformSpec){if(transformSpec.type="fluid.transforms.deindexIntoArrayByKey",transformSpec.innerValue)for(var innerValue=transformSpec.innerValue,i=0;i<innerValue.length;++i)innerValue[i]=fluid.model.transform.invertConfiguration(innerValue[i]);return transformSpec},fluid.defaults("fluid.transforms.deindexIntoArrayByKey",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.deindexIntoArrayByKey.invert"}),fluid.transforms.deindexIntoArrayByKey=function(hash,transformSpec,transformer){void 0===transformSpec.key&&fluid.fail('deindexIntoArrayByKey requires a "key" option.',transformSpec);var newArray=[],pivot=transformSpec.key;return fluid.each(hash,function(v,k){var content={};content[pivot]=k,transformSpec.innerValue&&(v=fluid.model.transform.expandInnerValues([transformSpec.inputPath,k],[transformSpec.outputPath,newArray.length.toString()],transformer,transformSpec.innerValue)),$.extend(!0,content,v),newArray.push(content)}),newArray},fluid.transforms.deindexIntoArrayByKey.invert=function(transformSpec){if(transformSpec.type="fluid.transforms.indexArrayByKey",transformSpec.innerValue)for(var innerValue=transformSpec.innerValue,i=0;i<innerValue.length;++i)innerValue[i]=fluid.model.transform.invertConfiguration(innerValue[i]);return transformSpec},fluid.defaults("fluid.transforms.limitRange",{gradeNames:"fluid.standardTransformFunction"}),fluid.transforms.limitRange=function(value,transformSpec){var min=transformSpec.min;if(void 0!==min){var excludeMin=transformSpec.excludeMin||0;min+=excludeMin,value<min&&(value=min)}var max=transformSpec.max;if(void 0!==max){var excludeMax=transformSpec.excludeMax||0;max-=excludeMax,value>max&&(value=max)}return value},fluid.defaults("fluid.transforms.indexOf",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.indexOf.invert"}),fluid.transforms.indexOf=function(value,transformSpec){"number"==typeof transformSpec.notFound&&transformSpec.notFound>=0&&fluid.fail("A positive number is not allowed as 'notFound' value for indexOf");var offset=fluid.transforms.parseIndexationOffset(transformSpec.offset,"indexOf"),array=fluid.makeArray(transformSpec.array),originalIndex=array.indexOf(value);return originalIndex===-1&&transformSpec.notFound?transformSpec.notFound:originalIndex+offset},fluid.transforms.indexOf.invert=function(transformSpec,transformer){var togo=fluid.transforms.invertArrayIndexation(transformSpec,transformer);return togo.type="fluid.transforms.dereference",togo},fluid.defaults("fluid.transforms.dereference",{gradeNames:["fluid.standardTransformFunction","fluid.lens"],invertConfiguration:"fluid.transforms.dereference.invert"}),fluid.transforms.dereference=function(value,transformSpec){if("number"==typeof value){var offset=fluid.transforms.parseIndexationOffset(transformSpec.offset,"dereference"),array=fluid.makeArray(transformSpec.array),index=value+offset;return array[index]}},fluid.transforms.dereference.invert=function(transformSpec,transformer){var togo=fluid.transforms.invertArrayIndexation(transformSpec,transformer);return togo.type="fluid.transforms.indexOf",togo},fluid.transforms.parseIndexationOffset=function(offset,transformName){var parsedOffset=0;return void 0!==offset&&(parsedOffset=fluid.parseInteger(offset),isNaN(parsedOffset)&&fluid.fail(transformName+' requires the value of "offset" to be an integer or a string that can be converted to an integer. '+offset+" is invalid.")),parsedOffset},fluid.transforms.invertArrayIndexation=function(transformSpec){return isNaN(Number(transformSpec.offset))||(transformSpec.offset=Number(transformSpec.offset)*-1),transformSpec},fluid.defaults("fluid.transforms.stringTemplate",{gradeNames:"fluid.standardOutputTransformFunction"}),fluid.transforms.stringTemplate=function(transformSpec){return fluid.stringTemplate(transformSpec.template,transformSpec.terms)},fluid.defaults("fluid.transforms.free",{gradeNames:"fluid.transformFunction"}),fluid.transforms.free=function(transformSpec){var args=fluid.makeArray(transformSpec.args);return fluid.invokeGlobalFunction(transformSpec.func,args)},fluid.defaults("fluid.transforms.quantize",{gradeNames:"fluid.standardTransformFunction"}),fluid.transforms.quantize=function(value,transformSpec,transform){transformSpec.ranges&&transformSpec.ranges.length||fluid.fail("fluid.transforms.quantize should have a key called ranges containing an array defining ranges to quantize");for(var i=0;i<transformSpec.ranges.length;i++){var rangeSpec=transformSpec.ranges[i];if(value<=rangeSpec.upperBound||void 0===rangeSpec.upperBound&&value>=Number.NEGATIVE_INFINITY)return fluid.isPrimitive(rangeSpec.output)?rangeSpec.output:transform.expand(rangeSpec.output)}},fluid.defaults("fluid.transforms.inRange",{gradeNames:"fluid.standardTransformFunction"}),fluid.transforms.inRange=function(value,transformSpec){return(void 0===transformSpec.min||transformSpec.min<=value)&&(void 0===transformSpec.max||transformSpec.max>=value)}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{},fluid=fluid||fluid_2_0_0;!function($,fluid){"use strict";fluid.thatistBridge=function(name,peer){var togo=function(funcname){for(var segs=funcname.split("."),move=peer,i=0;i<segs.length;++i)move=move[segs[i]];var args=[this];2===arguments.length&&(args=args.concat($.makeArray(arguments[1])));var ret=move.apply(null,args);this.that=function(){return ret};var type=typeof ret;return!ret||"string"===type||"number"===type||"boolean"===type||ret&&void 0!==ret.length?ret:this};return $.fn[name]=togo,togo},fluid.thatistBridge("fluid",fluid),fluid.thatistBridge("fluid_2_0_0",fluid_2_0_0);var normalizeTabindexName=function(){return $.browser.msie?"tabIndex":"tabindex"},canHaveDefaultTabindex=function(elements){return!(elements.length<=0)&&$(elements[0]).is("a, input, button, select, area, textarea, object")},getValue=function(elements){if(!(elements.length<=0)){if(!fluid.tabindex.hasAttr(elements))return canHaveDefaultTabindex(elements)?Number(0):void 0;var value=elements.attr(normalizeTabindexName());return Number(value)}},setValue=function(elements,toIndex){return elements.each(function(i,item){$(item).attr(normalizeTabindexName(),toIndex)})};fluid.tabindex=function(target,toIndex){return target=$(target),null!==toIndex&&void 0!==toIndex?setValue(target,toIndex):getValue(target)},fluid.tabindex.remove=function(target){return target=$(target),target.each(function(i,item){$(item).removeAttr(normalizeTabindexName())})},fluid.tabindex.hasAttr=function(target){if(target=$(target),target.length<=0)return!1;var togo=target.map(function(){var attributeNode=this.getAttributeNode(normalizeTabindexName());return!!attributeNode&&attributeNode.specified});return 1===togo.length?togo[0]:togo},fluid.tabindex.has=function(target){return target=$(target),fluid.tabindex.hasAttr(target)||canHaveDefaultTabindex(target)},fluid.a11y=$.a11y||{},fluid.a11y.orientation={HORIZONTAL:0,VERTICAL:1,BOTH:2};var UP_DOWN_KEYMAP={next:$.ui.keyCode.DOWN,previous:$.ui.keyCode.UP},LEFT_RIGHT_KEYMAP={next:$.ui.keyCode.RIGHT,previous:$.ui.keyCode.LEFT},unwrap=function(element){return element.jquery?element[0]:element},makeElementsTabFocussable=function(elements){elements.each(function(idx,item){item=$(item),(!item.fluid("tabindex.has")||item.fluid("tabindex")<0)&&item.fluid("tabindex",0)})};fluid.tabbable=function(target){target=$(target),makeElementsTabFocussable(target)};var CONTEXT_KEY="selectionContext",NO_SELECTION=-32768,cleanUpWhenLeavingContainer=function(selectionContext){selectionContext.activeItemIndex!==NO_SELECTION&&(selectionContext.options.onLeaveContainer?selectionContext.options.onLeaveContainer(selectionContext.selectables[selectionContext.activeItemIndex]):selectionContext.options.onUnselect&&selectionContext.options.onUnselect(selectionContext.selectables[selectionContext.activeItemIndex])),selectionContext.options.rememberSelectionState||(selectionContext.activeItemIndex=NO_SELECTION)},drawSelection=function(elementToSelect,handler){handler&&handler(elementToSelect)},eraseSelection=function(selectedElement,handler){handler&&selectedElement&&handler(selectedElement)},unselectElement=function(selectedElement,selectionContext){eraseSelection(selectedElement,selectionContext.options.onUnselect)},selectElement=function(elementToSelect,selectionContext){unselectElement(selectionContext.selectedElement(),selectionContext),elementToSelect=unwrap(elementToSelect);var newIndex=selectionContext.selectables.index(elementToSelect);newIndex!==-1&&(selectionContext.activeItemIndex=newIndex,drawSelection(elementToSelect,selectionContext.options.onSelect))},selectableFocusHandler=function(selectionContext){return function(evt){return $(evt.target).fluid("tabindex",0),selectElement(evt.target,selectionContext),evt.stopPropagation()}},selectableBlurHandler=function(selectionContext){return function(evt){return $(evt.target).fluid("tabindex",selectionContext.options.selectablesTabindex),unselectElement(evt.target,selectionContext),evt.stopPropagation()}},reifyIndex=function(sc_that){var elements=sc_that.selectables;sc_that.activeItemIndex>=elements.length&&(sc_that.activeItemIndex=sc_that.options.noWrap?elements.length-1:0),sc_that.activeItemIndex<0&&sc_that.activeItemIndex!==NO_SELECTION&&(sc_that.activeItemIndex=sc_that.options.noWrap?0:elements.length-1),sc_that.activeItemIndex>=0&&fluid.focus(elements[sc_that.activeItemIndex])},prepareShift=function(selectionContext){var selElm=selectionContext.selectedElement();selElm&&fluid.blur(selElm),unselectElement(selectionContext.selectedElement(),selectionContext),selectionContext.activeItemIndex===NO_SELECTION&&(selectionContext.activeItemIndex=-1)},focusNextElement=function(selectionContext){prepareShift(selectionContext),++selectionContext.activeItemIndex,reifyIndex(selectionContext)},focusPreviousElement=function(selectionContext){prepareShift(selectionContext),--selectionContext.activeItemIndex,reifyIndex(selectionContext)},arrowKeyHandler=function(selectionContext,keyMap){return function(evt){evt.which===keyMap.next?(focusNextElement(selectionContext),evt.preventDefault()):evt.which===keyMap.previous&&(focusPreviousElement(selectionContext),evt.preventDefault())}},getKeyMapForDirection=function(direction){var keyMap;return direction===fluid.a11y.orientation.HORIZONTAL?keyMap=LEFT_RIGHT_KEYMAP:direction===fluid.a11y.orientation.VERTICAL&&(keyMap=UP_DOWN_KEYMAP),keyMap},tabKeyHandler=function(selectionContext){return function(evt){evt.which===$.ui.keyCode.TAB&&(cleanUpWhenLeavingContainer(selectionContext),evt.shiftKey&&(selectionContext.focusIsLeavingContainer=!0))}},containerFocusHandler=function(selectionContext){return function(evt){var shouldOrig=selectionContext.options.autoSelectFirstItem,shouldSelect="function"==typeof shouldOrig?shouldOrig():shouldOrig;return selectionContext.focusIsLeavingContainer&&(shouldSelect=!1),shouldSelect&&evt.target===selectionContext.container.get(0)&&(selectionContext.activeItemIndex===NO_SELECTION&&(selectionContext.activeItemIndex=0),fluid.focus(selectionContext.selectables[selectionContext.activeItemIndex])),evt.stopPropagation()}},containerBlurHandler=function(selectionContext){return function(evt){return selectionContext.focusIsLeavingContainer=!1,evt.stopPropagation()}},makeElementsSelectable=function(container,defaults,userOptions){var options=$.extend(!0,{},defaults,userOptions),keyMap=getKeyMapForDirection(options.direction),selectableElements=options.selectableElements?options.selectableElements:container.find(options.selectableSelector),that={container:container,activeItemIndex:NO_SELECTION,selectables:selectableElements,focusIsLeavingContainer:!1,options:options};return that.selectablesUpdated=function(focusedItem){"number"==typeof that.options.selectablesTabindex&&that.selectables.fluid("tabindex",that.options.selectablesTabindex),that.selectables.off("focus."+CONTEXT_KEY),that.selectables.off("blur."+CONTEXT_KEY),that.selectables.on("focus."+CONTEXT_KEY,selectableFocusHandler(that)),that.selectables.on("blur."+CONTEXT_KEY,selectableBlurHandler(that)),keyMap&&that.options.noBubbleListeners&&(that.selectables.off("keydown."+CONTEXT_KEY),that.selectables.on("keydown."+CONTEXT_KEY,arrowKeyHandler(that,keyMap))),focusedItem?selectElement(focusedItem,that):reifyIndex(that)},that.refresh=function(){that.options.selectableSelector||fluid.fail("Cannot refresh selectable context which was not initialised by a selector"),that.selectables=container.find(options.selectableSelector),that.selectablesUpdated()},that.selectedElement=function(){return that.activeItemIndex<0?null:that.selectables[that.activeItemIndex]},keyMap&&!that.options.noBubbleListeners&&container.keydown(arrowKeyHandler(that,keyMap)),container.keydown(tabKeyHandler(that)),container.focus(containerFocusHandler(that)),container.blur(containerBlurHandler(that)),that.selectablesUpdated(),that};fluid.selectable=function(target,options){target=$(target);var that=makeElementsSelectable(target,fluid.selectable.defaults,options);return fluid.setScopedData(target,CONTEXT_KEY,that),that},fluid.selectable.select=function(target,toSelect){fluid.focus(toSelect)},fluid.selectable.selectNext=function(target){target=$(target),focusNextElement(fluid.getScopedData(target,CONTEXT_KEY))},fluid.selectable.selectPrevious=function(target){target=$(target),focusPreviousElement(fluid.getScopedData(target,CONTEXT_KEY))},fluid.selectable.currentSelection=function(target){target=$(target);var that=fluid.getScopedData(target,CONTEXT_KEY);return $(that.selectedElement())},fluid.selectable.defaults={direction:fluid.a11y.orientation.VERTICAL,selectablesTabindex:-1,autoSelectFirstItem:!0,rememberSelectionState:!0,selectableSelector:".selectable",selectableElements:null,onSelect:null,onUnselect:null,onLeaveContainer:null,noWrap:!1};var checkForModifier=function(binding,evt){if(!binding.modifier)return!0;var modifierKey=binding.modifier,isCtrlKeyPresent=modifierKey&&evt.ctrlKey,isAltKeyPresent=modifierKey&&evt.altKey,isShiftKeyPresent=modifierKey&&evt.shiftKey;return isCtrlKeyPresent||isAltKeyPresent||isShiftKeyPresent},makeActivationHandler=function(binding){return function(evt){var target=evt.target;if(fluid.enabled(target)){var code=evt.which?evt.which:evt.keyCode;if(code===binding.key&&binding.activateHandler&&checkForModifier(binding,evt)){var event=$.Event("fluid-activate");$(target).trigger(event,[binding.activateHandler]),event.isDefaultPrevented()&&evt.preventDefault()}}}},makeElementsActivatable=function(elements,onActivateHandler,defaultKeys,options){var bindings=[];$(defaultKeys).each(function(index,key){bindings.push({modifier:null,key:key,activateHandler:onActivateHandler})}),options&&options.additionalBindings&&(bindings=bindings.concat(options.additionalBindings)),fluid.initEnablement(elements);for(var i=0;i<bindings.length;++i){var binding=bindings[i];elements.keydown(makeActivationHandler(binding))}elements.on("fluid-activate",function(evt,handler){return handler=handler||onActivateHandler,handler?handler(evt):null})};fluid.activatable=function(target,fn,options){target=$(target),makeElementsActivatable(target,fn,fluid.activatable.defaults.keys,options)},fluid.activate=function(target){$(target).trigger("fluid-activate")},fluid.activatable.defaults={keys:[$.ui.keyCode.ENTER,$.ui.keyCode.SPACE]}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.viewComponent",{gradeNames:["fluid.modelComponent"],initFunction:"fluid.initView",argumentMap:{container:0,options:1},members:{dom:"@expand:fluid.initDomBinder({that}, {that}.options.selectors)"}}),fluid.dumpSelector=function(selectable){return"string"==typeof selectable?selectable:selectable.selector?selectable.selector:""},fluid.diagnoseFailedView=function(componentName,that,options,args){if(!that&&fluid.hasGrade(options,"fluid.viewComponent")){var container=fluid.wrap(args[1]),message1="Instantiation of view component with type "+componentName+" failed, since ";container?0===container.length?fluid.fail(message1+'selector "',fluid.dumpSelector(args[1]),'" did not match any markup in the document'):fluid.fail(message1+" component creator function did not return a value"):fluid.fail(message1+" container argument is empty")}},fluid.checkTryCatchParameter=function(){var location=window.location||{search:"",protocol:"file:"},GETparams=location.search.slice(1).split("&");return fluid.find(GETparams,function(param){if(0===param.indexOf("notrycatch"))return!0})===!0},fluid.notrycatch=fluid.checkTryCatchParameter(),fluid.wrap=function(obj,userJQuery){return userJQuery=userJQuery||$,!obj||obj.jquery?obj:userJQuery(obj)},fluid.unwrap=function(obj){return obj&&obj.jquery?obj[0]:obj},fluid.container=function(containerSpec,fallible,userJQuery){var selector=containerSpec.selector||containerSpec;userJQuery&&(containerSpec=fluid.unwrap(containerSpec));var container=fluid.wrap(containerSpec,userJQuery);if(fallible&&(!container||0===container.length))return null;if(!container||!container.jquery||1!==container.length){"string"!=typeof containerSpec&&(containerSpec=container.selector);var count=void 0!==container.length?container.length:0;fluid.fail((count>1?"More than one ("+count+") container elements were":"No container element was")+" found for selector "+containerSpec)}return fluid.isDOMNode(container[0])||fluid.fail("fluid.container was supplied a non-jQueryable element"),container.selector=selector,container.context=container.context||containerSpec.ownerDocument||document,container},fluid.createDomBinder=function(container,selectors){function cacheKey(name,thisContainer){return fluid.allocateSimpleId(thisContainer)+"-"+name}function record(name,thisContainer,result){that.cache[cacheKey(name,thisContainer)]=result}var that={id:fluid.allocateGuid(),
cache:{}},userJQuery=container.constructor;return that.locate=function(name,localContainer){var selector,thisContainer,togo;return selector=selectors[name],thisContainer=localContainer?$(localContainer):container,thisContainer||fluid.fail("DOM binder invoked for selector "+name+" without container"),togo=""===selector?thisContainer:selector?"function"==typeof selector?userJQuery(selector.call(null,fluid.unwrap(thisContainer))):userJQuery(selector,thisContainer):userJQuery(),togo.selector||(togo.selector=selector,togo.context=thisContainer),togo.selectorName=name,record(name,thisContainer,togo),togo},that.fastLocate=function(name,localContainer){var thisContainer=localContainer?localContainer:container,key=cacheKey(name,thisContainer),togo=that.cache[key];return togo?togo:that.locate(name,localContainer)},that.clear=function(){that.cache={}},that.refresh=function(names,localContainer){var thisContainer=localContainer?localContainer:container;"string"==typeof names&&(names=[names]),void 0===thisContainer.length&&(thisContainer=[thisContainer]);for(var i=0;i<names.length;++i)for(var j=0;j<thisContainer.length;++j)that.locate(names[i],thisContainer[j])},that.resolvePathSegment=that.locate,that},fluid.expectFilledSelector=function(result,message){result&&0===result.length&&result.jquery&&fluid.fail(message+': selector "'+result.selector+'" with name '+result.selectorName+" returned no results in context "+fluid.dumpEl(result.context))},fluid.initView=function(componentName,containerSpec,userOptions,localOptions){var container=fluid.container(containerSpec,!0);if(fluid.expectFilledSelector(container,'Error instantiating component with name "'+componentName),!container)return null;var receiver=function(that){that.container=container},that=fluid.initLittleComponent(componentName,userOptions,localOptions||{gradeNames:["fluid.viewComponent"]},receiver);that.dom||fluid.initDomBinder(that);var userJQuery=that.options.jQuery;return fluid.log("Constructing view component "+componentName+" with container "+container.constructor.expando+(userJQuery?" user jQuery "+userJQuery.expando:"")+" env: "+$.expando),that},fluid.initDomBinder=function(that,selectors){return that.container||fluid.fail("fluid.initDomBinder called for component with typeName "+that.typeName+' without an initialised container - this has probably resulted from placing "fluid.viewComponent" in incorrect position in grade merging order. Make sure to place it to the right of any non-view grades in the gradeNames list to ensure that it overrides properly: resolved gradeNames is ',that.options.gradeNames," for component ",that),that.dom=fluid.createDomBinder(that.container,selectors||that.options.selectors||{}),that.locate=that.dom.locate,that.dom},fluid.findAncestor=function(element,test){for(element=fluid.unwrap(element);element;){if(test(element))return element;element=element.parentNode}},fluid.findForm=function(node){return fluid.findAncestor(node,function(element){return"form"===element.nodeName.toLowerCase()})},fluid.each(["text","html"],function(method){fluid[method]=function(node,newValue){return node=$(node),void 0===newValue?node[method]():node[method](newValue)}}),fluid.value=function(nodeIn,newValue){var node=fluid.unwrap(nodeIn),multiple=!1;if(void 0===node.nodeType&&node.length>1&&(node=node[0],multiple=!0),"input"!==node.nodeName.toLowerCase()||!/radio|checkbox/.test(node.type))return void 0===newValue?$(node).val():$(node).val(newValue);var name=node.name;void 0===name&&fluid.fail("Cannot acquire value from node "+fluid.dumpEl(node)+" which does not have name attribute set");var elements;if(multiple)elements=nodeIn;else{elements=node.ownerDocument.getElementsByName(name);var scope=fluid.findForm(node);elements=$.grep(elements,function(element){return element.name===name&&(!scope||fluid.dom.isContainer(scope,element))})}if(void 0===newValue){var checked=$.map(elements,function(element){return element.checked?element.value:null});return"radio"===node.type?checked[0]:checked}"boolean"==typeof newValue&&(newValue=newValue?"true":"false"),$.each(elements,function(){this.checked=newValue instanceof Array?newValue.indexOf(this.value)!==-1:newValue===this.value})},fluid.BINDING_ROOT_KEY="fluid-binding-root",fluid.findData=function(elem,name){for(;elem;){var data=$.data(elem,name);if(data)return data;elem=elem.parentNode}},fluid.bindFossils=function(node,data,fossils){$.data(node,fluid.BINDING_ROOT_KEY,{data:data,fossils:fossils})},fluid.boundPathForNode=function(node,fossils){node=fluid.unwrap(node);var key=node.name||node.id,record=fossils[key];return record?record.EL:null},fluid.applyBoundChange=function(node,newValue,applier){node=fluid.unwrap(node),void 0===newValue&&(newValue=fluid.value(node)),void 0===node.nodeType&&node.length>0&&(node=node[0]);var root=fluid.findData(node,fluid.BINDING_ROOT_KEY);root||fluid.fail("Bound data could not be discovered in any node above "+fluid.dumpEl(node));var name=node.name,fossil=root.fossils[name];fossil||fluid.fail("No fossil discovered for name "+name+" in fossil record above "+fluid.dumpEl(node)),"boolean"==typeof fossil.oldvalue&&(newValue=!!newValue[0]);var EL=root.fossils[name].EL;applier?applier.fireChangeRequest({path:EL,value:newValue,source:"DOM:"+node.id}):fluid.set(root.data,EL,newValue)},fluid.jById=function(id,dokkument){dokkument=dokkument&&9===dokkument.nodeType?dokkument:document;var element=fluid.byId(id,dokkument),togo=element?$(element):[];return togo.selector="#"+id,togo.context=dokkument,togo},fluid.byId=function(id,dokkument){dokkument=dokkument&&9===dokkument.nodeType?dokkument:document;var el=dokkument.getElementById(id);return el?(el.id!==id&&fluid.fail("Problem in document structure - picked up element "+fluid.dumpEl(el)+" for id "+id+" without this id - most likely the element has a name which conflicts with this id"),el):null},fluid.getId=function(element){return fluid.unwrap(element).id},fluid.allocateSimpleId=function(element){if(element=fluid.unwrap(element),!element||fluid.isPrimitive(element))return null;if(!element.id){var simpleId="fluid-id-"+fluid.allocateGuid();element.id=simpleId}return element.id},fluid.getDocument=function(element){var node=fluid.unwrap(element);return 9===node.nodeType?node:node.ownerDocument},fluid.defaults("fluid.ariaLabeller",{gradeNames:["fluid.viewComponent"],labelAttribute:"aria-label",liveRegionMarkup:'<div class="liveRegion fl-hidden-accessible" aria-live="polite"></div>',liveRegionId:"fluid-ariaLabeller-liveRegion",invokers:{generateLiveElement:{funcName:"fluid.ariaLabeller.generateLiveElement",args:"{that}"},update:{funcName:"fluid.ariaLabeller.update",args:["{that}","{arguments}.0"]}},listeners:{onCreate:{func:"{that}.update",args:[null]}}}),fluid.ariaLabeller.update=function(that,newOptions){if(newOptions=newOptions||that.options,that.container.attr(that.options.labelAttribute,newOptions.text),newOptions.dynamicLabel){var live=fluid.jById(that.options.liveRegionId);0===live.length&&(live=that.generateLiveElement()),live.text(newOptions.text)}},fluid.ariaLabeller.generateLiveElement=function(that){var liveEl=$(that.options.liveRegionMarkup);return liveEl.prop("id",that.options.liveRegionId),$("body").append(liveEl),liveEl};var LABEL_KEY="aria-labelling";fluid.getAriaLabeller=function(element){element=$(element);var that=fluid.getScopedData(element,LABEL_KEY);return that},fluid.updateAriaLabel=function(element,text,options){options=$.extend({},options||{},{text:text});var that=fluid.getAriaLabeller(element);return that?that.update(options):(that=fluid.ariaLabeller(element,options),fluid.setScopedData(element,LABEL_KEY,that)),that};var dismissList={};$(document).click(function(event){for(var target=fluid.resolveEventTarget(event);target;){if(dismissList[target.id])return;target=target.parentNode}fluid.each(dismissList,function(dismissFunc,key){dismissFunc(event),delete dismissList[key]})}),fluid.globalDismissal=function(nodes,dismissFunc){fluid.each(nodes,function(node){var id=fluid.unwrap(node).ownerDocument===document?fluid.allocateSimpleId(node):fluid.allocateGuid();dismissFunc?dismissList[id]=dismissFunc:delete dismissList[id]})},fluid.now=function(){return Date.now?Date.now():(new Date).getTime()},fluid.deadMansBlur=function(control,options){var that={options:$.extend(!0,{},fluid.defaults("fluid.deadMansBlur"),options)};return that.blurPending=!1,that.lastCancel=0,that.canceller=function(event){fluid.log("Cancellation through "+event.type+" on "+fluid.dumpEl(event.target)),that.lastCancel=fluid.now(),that.blurPending=!1},that.noteProceeded=function(){fluid.globalDismissal(that.options.exclusions)},that.reArm=function(){fluid.globalDismissal(that.options.exclusions,that.proceed)},that.addExclusion=function(exclusions){fluid.globalDismissal(exclusions,that.proceed)},that.proceed=function(event){fluid.log("Direct proceed through "+event.type+" on "+fluid.dumpEl(event.target)),that.blurPending=!1,that.options.handler(control)},fluid.each(that.options.exclusions,function(exclusion){exclusion=$(exclusion),fluid.each(exclusion,function(excludeEl){$(excludeEl).on("focusin",that.canceller).on("fluid-focus",that.canceller).click(that.canceller).mousedown(that.canceller)})}),that.options.cancelByDefault?that.reArm():$(control).on("focusout",function(event){fluid.log("Starting blur timer for element "+fluid.dumpEl(event.target));var now=fluid.now();fluid.log("back delay: "+(now-that.lastCancel)),now-that.lastCancel>that.options.backDelay&&(that.blurPending=!0),setTimeout(function(){that.blurPending&&that.options.handler(control)},that.options.delay)}),that},fluid.defaults("fluid.deadMansBlur",{gradeNames:"fluid.function",delay:150,backDelay:100})}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";function canonUrl(url){return url}fluid.explodeLocalisedName=function(fileName,locale,defaultLocale){var lastDot=fileName.lastIndexOf(".");lastDot!==-1&&0!==lastDot||(lastDot=fileName.length);var baseName=fileName.substring(0,lastDot),extension=fileName.substring(lastDot),segs=locale.split("_"),exploded=fluid.transform(segs,function(seg,index){var shortSegs=segs.slice(0,index+1);return baseName+"_"+shortSegs.join("_")+extension});return defaultLocale&&exploded.unshift(baseName+"_"+defaultLocale+extension),exploded};var resourceCache={},pendingClass={};fluid.fetchResources=function(resourceSpecs,callback,options){var that={options:fluid.copy(options||{})};return that.resourceSpecs=resourceSpecs,that.callback=callback,that.operate=function(){fluid.fetchResources.fetchResourcesImpl(that)},fluid.each(resourceSpecs,function(resourceSpec,key){resourceSpec.recurseFirer=fluid.makeEventFirer({name:'I/O completion for resource "'+key+'"'}),resourceSpec.recurseFirer.addListener(that.operate),resourceSpec.url&&!resourceSpec.href&&(resourceSpec.href=resourceSpec.url),that.options.defaultLocale&&(resourceSpec.defaultLocale=that.options.defaultLocale,void 0===resourceSpec.locale&&(resourceSpec.locale=that.options.defaultLocale))}),that.options.amalgamateClasses&&fluid.fetchResources.amalgamateClasses(resourceSpecs,that.options.amalgamateClasses,that.operate),fluid.fetchResources.explodeForLocales(resourceSpecs),that.operate(),that},fluid.fetchResources.explodeForLocales=function(resourceSpecs){return fluid.each(resourceSpecs,function(resourceSpec,key){if(resourceSpec.locale){for(var exploded=fluid.explodeLocalisedName(resourceSpec.href,resourceSpec.locale,resourceSpec.defaultLocale),i=0;i<exploded.length;++i){var newKey=key+"$localised-"+i,newRecord=$.extend(!0,{},resourceSpec,{href:exploded[i],localeExploded:!0});resourceSpecs[newKey]=newRecord}resourceSpec.localeExploded=exploded.length}}),resourceSpecs},fluid.fetchResources.condenseOneResource=function(resourceSpecs,resourceSpec,key,localeCount){for(var localeSpecs=[resourceSpec],i=0;i<localeCount;++i){var localKey=key+"$localised-"+i;localeSpecs.unshift(resourceSpecs[localKey]),delete resourceSpecs[localKey]}var lastNonError=fluid.find_if(localeSpecs,function(spec){return!spec.fetchError});lastNonError&&(resourceSpecs[key]=lastNonError)},fluid.fetchResources.condenseForLocales=function(resourceSpecs){fluid.each(resourceSpecs,function(resourceSpec,key){"number"==typeof resourceSpec.localeExploded&&fluid.fetchResources.condenseOneResource(resourceSpecs,resourceSpec,key,resourceSpec.localeExploded)})},fluid.fetchResources.notifyResources=function(that,resourceSpecs,callback){fluid.fetchResources.condenseForLocales(resourceSpecs),callback(resourceSpecs)},fluid.fetchResources.amalgamateClasses=function(specs,classes,operator){fluid.each(classes,function(clazz){var pending=pendingClass[clazz];fluid.each(pending,function(pendingrec,canon){specs[clazz+"!"+canon]=pendingrec,pendingrec.recurseFirer.addListener(operator)})})},fluid.fetchResources.timeSuccessCallback=function(resourceSpec){if(resourceSpec.timeSuccess&&resourceSpec.options&&resourceSpec.options.success){var success=resourceSpec.options.success;resourceSpec.options.success=function(){var startTime=new Date,ret=success.apply(null,arguments);return fluid.log("External callback for URL "+resourceSpec.href+" completed - callback time: "+((new Date).getTime()-startTime.getTime())+"ms"),ret}}},fluid.fetchResources.clearResourceCache=function(url){url?delete resourceCache[canonUrl(url)]:fluid.clear(resourceCache)},fluid.fetchResources.handleCachedRequest=function(resourceSpec,response,fetchError){var canon=canonUrl(resourceSpec.href),cached=resourceCache[canon];if(cached.$$firer$$){fluid.log("Handling request for "+canon+" from cache");var fetchClass=resourceSpec.fetchClass;fetchClass&&pendingClass[fetchClass]&&(fluid.log("Clearing pendingClass entry for class "+fetchClass),delete pendingClass[fetchClass][canon]);var result={response:response,fetchError:fetchError};resourceCache[canon]=result,cached.fire(response,fetchError)}},fluid.fetchResources.completeRequest=function(thisSpec){thisSpec.queued=!1,thisSpec.completeTime=new Date,fluid.log("Request to URL "+thisSpec.href+" completed - total elapsed time: "+(thisSpec.completeTime.getTime()-thisSpec.initTime.getTime())+"ms"),thisSpec.recurseFirer.fire()},fluid.fetchResources.makeResourceCallback=function(thisSpec){return{success:function(response){thisSpec.resourceText=response,thisSpec.resourceKey=thisSpec.href,thisSpec.forceCache&&fluid.fetchResources.handleCachedRequest(thisSpec,response),fluid.fetchResources.completeRequest(thisSpec)},error:function(response,textStatus,errorThrown){thisSpec.fetchError={status:response.status,textStatus:response.textStatus,errorThrown:errorThrown},thisSpec.forceCache&&fluid.fetchResources.handleCachedRequest(thisSpec,null,thisSpec.fetchError),fluid.fetchResources.completeRequest(thisSpec)}}},fluid.fetchResources.issueCachedRequest=function(resourceSpec,options){var canon=canonUrl(resourceSpec.href),cached=resourceCache[canon];if(cached)cached.$$firer$$?(fluid.log("Request for cached resource which is in flight: url "+canon),cached.addListener(function(response,fetchError){response?options.success(response):options.error(fetchError)})):cached.response?options.success(cached.response):options.error(cached.fetchError);else{fluid.log("First request for cached resource with url "+canon),cached=fluid.makeEventFirer({name:"cache notifier for resource URL "+canon}),cached.$$firer$$=!0,resourceCache[canon]=cached;var fetchClass=resourceSpec.fetchClass;fetchClass&&(pendingClass[fetchClass]||(pendingClass[fetchClass]={}),pendingClass[fetchClass][canon]=resourceSpec),options.cache=!1,$.ajax(options)}},fluid.fetchResources.composeCallbacks=function(internal,external){return external?internal?function(){try{external.apply(null,arguments)}catch(e){fluid.log("Exception applying external fetchResources callback: "+e)}internal.apply(null,arguments)}:external:internal},fluid.fetchResources.composePolicy=function(target,source){return fluid.fetchResources.composeCallbacks(target,source)},fluid.defaults("fluid.fetchResources.issueRequest",{mergePolicy:{success:fluid.fetchResources.composePolicy,error:fluid.fetchResources.composePolicy,url:"reverse"}}),fluid.fetchResources.issueRequest=function(resourceSpec,key){var thisCallback=fluid.fetchResources.makeResourceCallback(resourceSpec),options={url:resourceSpec.href,success:thisCallback.success,error:thisCallback.error,dataType:resourceSpec.dataType||"text"};fluid.fetchResources.timeSuccessCallback(resourceSpec),options=fluid.merge(fluid.defaults("fluid.fetchResources.issueRequest").mergePolicy,options,resourceSpec.options),resourceSpec.queued=!0,resourceSpec.initTime=new Date,fluid.log("Request with key "+key+" queued for "+resourceSpec.href),resourceSpec.forceCache?fluid.fetchResources.issueCachedRequest(resourceSpec,options):$.ajax(options)},fluid.fetchResources.fetchResourcesImpl=function(that){var complete=!0,allSync=!0,resourceSpecs=that.resourceSpecs;for(var key in resourceSpecs){var resourceSpec=resourceSpecs[key];if(resourceSpec.options&&!resourceSpec.options.async||(allSync=!1),resourceSpec.href&&!resourceSpec.completeTime)resourceSpec.queued||fluid.fetchResources.issueRequest(resourceSpec,key),resourceSpec.queued&&(complete=!1);else if(resourceSpec.nodeId&&!resourceSpec.resourceText){var node=document.getElementById(resourceSpec.nodeId);resourceSpec.resourceText=fluid.dom.getElementText(node),resourceSpec.resourceKey=resourceSpec.nodeId}}complete&&that.callback&&!that.callbackCalled&&(that.callbackCalled=!0,$.browser.mozilla&&!allSync?setTimeout(function(){fluid.fetchResources.notifyResources(that,resourceSpecs,that.callback)},1):fluid.fetchResources.notifyResources(that,resourceSpecs,that.callback))},fluid.fetchResources.primeCacheFromResources=function(componentName){var resources=fluid.defaults(componentName).resources,expanded=(fluid.expandOptions?fluid.expandOptions:fluid.identity)(fluid.copy(resources));fluid.fetchResources(expanded)},fluid.registerNamespace("fluid.expander"),fluid.expander.makeDefaultFetchOptions=function(successdisposer,failid,options){return $.extend(!0,{dataType:"text"},options,{success:function(response,environmentdisposer){var json=JSON.parse(response);environmentdisposer(successdisposer(json))},error:function(response,textStatus){fluid.log("Error fetching "+failid+": "+textStatus)}})},fluid.expander.makeFetchExpander=function(options){return{expander:{type:"fluid.expander.deferredFetcher",href:options.url,options:fluid.expander.makeDefaultFetchOptions(options.disposer,options.url,options.options),resourceSpecCollector:"{resourceSpecCollector}",fetchKey:options.fetchKey}}},fluid.expander.deferredFetcher=function(deliverer,source,expandOptions){var expander=source.expander,spec=fluid.copy(expander),collector=fluid.expand(expander.resourceSpecCollector,expandOptions);delete spec.type,delete spec.resourceSpecCollector,delete spec.fetchKey;var environmentdisposer=function(disposed){deliverer(disposed)};spec.options.success=function(response){expander.options.success(response,environmentdisposer)};var key=expander.fetchKey||fluid.allocateGuid();return collector[key]=spec,fluid.NO_VALUE}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.resourceLoader",{gradeNames:["fluid.component"],listeners:{"onCreate.loadResources":{listener:"fluid.resourceLoader.loadResources",args:["{that}",{expander:{func:"{that}.resolveResources"}}]}},defaultLocale:null,locale:null,terms:{},resources:{},resourceOptions:{},invokers:{transformURL:{funcName:"fluid.stringTemplate",args:["{arguments}.0","{that}.options.terms"]},resolveResources:{funcName:"fluid.resourceLoader.resolveResources",args:"{that}"}},events:{onResourcesLoaded:null}}),fluid.resourceLoader.resolveResources=function(that){var mapped=fluid.transform(that.options.resources,that.transformURL);return fluid.transform(mapped,function(url){var resourceSpec={url:url,forceCache:!0,options:that.options.resourceOptions};return $.extend(resourceSpec,fluid.filterKeys(that.options,["defaultLocale","locale"]))})},fluid.resourceLoader.loadResources=function(that,resources){fluid.fetchResources(resources,function(){that.resources=resources,that.events.onResourcesLoaded.fire(resources)})}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.contextAware"),fluid.defaults("fluid.contextAware.marker",{gradeNames:["fluid.component"]}),fluid.contextAware.makeCheckMarkers=function(checks,path,instantiator){fluid.each(checks,function(value,markerTypeName){fluid.constructSingle(path,{type:markerTypeName,gradeNames:"fluid.contextAware.marker",value:value},instantiator)})},fluid.contextAware.performChecks=function(checkHash){return fluid.transform(checkHash,function(checkRecord){return"function"==typeof checkRecord?checkRecord={func:checkRecord}:"string"==typeof checkRecord&&(checkRecord={funcName:checkRecord}),fluid.isPrimitive(checkRecord)?checkRecord:"value"in checkRecord?checkRecord.value:"func"in checkRecord?checkRecord.func():"funcName"in checkRecord?fluid.invokeGlobalFunction(checkRecord.funcName):void fluid.fail("Error in contextAwareness check record ",checkRecord," - must contain an entry with name value, func, or funcName")})},fluid.contextAware.makeChecks=function(checkHash,path,instantiator){var checkOptions=fluid.contextAware.performChecks(checkHash);fluid.contextAware.makeCheckMarkers(checkOptions,path,instantiator)},fluid.contextAware.forgetChecks=function(markerNames,path,instantiator){instantiator=instantiator||fluid.globalInstantiator,path=path||[];var markerArray=fluid.makeArray(markerNames);fluid.each(markerArray,function(markerName){var memberName=fluid.typeNameToMemberName(markerName),segs=fluid.model.parseToSegments(path,instantiator.parseEL,!0);segs.push(memberName),fluid.destroy(segs,instantiator)})},fluid.defaults("fluid.contextAware",{gradeNames:["{that}.check"],mergePolicy:{contextAwareness:"noexpand"},contextAwareness:{},invokers:{check:{funcName:"fluid.contextAware.check",args:["{that}","{that}.options.contextAwareness"]}}}),fluid.contextAware.getCheckValue=function(that,reference){var targetRef=fluid.parseContextReference(reference),targetComponent=fluid.resolveContext(targetRef.context,that),path=targetRef.path||["options","value"],value=fluid.getForComponent(targetComponent,path);return value},fluid.contextAware.checkOne=function(that,contextAwareRecord){contextAwareRecord.checks&&contextAwareRecord.checks.contextValue&&fluid.fail("Nesting error in contextAwareness record ",contextAwareRecord,' - the "checks" entry must contain a hash and not a contextValue/gradeNames record at top level');var checkList=fluid.parsePriorityRecords(contextAwareRecord.checks,"contextAwareness checkRecord");return fluid.find(checkList,function(check){check.contextValue||fluid.fail("Cannot perform check for contextAwareness record ",check,' without a valid field named "contextValue"');var value=fluid.contextAware.getCheckValue(that,check.contextValue);if(void 0===check.equals?value:value===check.equals)return check.gradeNames},contextAwareRecord.defaultGradeNames)},fluid.contextAware.check=function(that,contextAwarenessOptions){var gradeNames=[],contextAwareList=fluid.parsePriorityRecords(contextAwarenessOptions,"contextAwareness adaptationRecord");return fluid.each(contextAwareList,function(record){var matched=fluid.contextAware.checkOne(that,record);gradeNames=gradeNames.concat(fluid.makeArray(matched))}),gradeNames},fluid.contextAware.makeAdaptation=function(options){fluid.expect("fluid.contextAware.makeAdaptation",options,["distributionName","targetName","adaptationName","checkName","record"]),fluid.defaults(options.distributionName,{gradeNames:["fluid.component"],distributeOptions:{target:"{/ "+options.targetName+"}.options.contextAwareness."+options.adaptationName+".checks."+options.checkName,record:options.record}}),fluid.constructSingle([],options.distributionName)},fluid.contextAware.isBrowser=function(){return"undefined"!=typeof window&&window.document},fluid.contextAware.makeChecks({"fluid.browser":{funcName:"fluid.contextAware.isBrowser"}}),fluid.registerNamespace("fluid.contextAware.browser"),fluid.contextAware.browser.getPlatformName=function(){return"undefined"!=typeof navigator&&navigator.platform?navigator.platform:void 0},fluid.contextAware.makeChecks({"fluid.browser.platformName":{funcName:"fluid.contextAware.browser.getPlatformName"}})}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.enhance"),fluid.contextAware.isBrowser()&&$.fn&&$("head").append("<style type='text/css'>.fl-progEnhance-basic, .fl-ProgEnhance-basic { display: none; } .fl-progEnhance-enhanced, .fl-ProgEnhance-enhanced { display: block; }</style>")}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.XMLP=function(strXML){return fluid.XMLP.XMLPImpl(strXML)},fluid.XMLP.closedTags={abbr:!0,br:!0,col:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,hr:!0,area:!0,embed:!0},fluid.XMLP._NONE=0,fluid.XMLP._ELM_B=1,fluid.XMLP._ELM_E=2,fluid.XMLP._ELM_EMP=3,fluid.XMLP._ATT=4,fluid.XMLP._TEXT=5,fluid.XMLP._ENTITY=6,fluid.XMLP._PI=7,fluid.XMLP._CDATA=8,fluid.XMLP._COMMENT=9,fluid.XMLP._DTD=10,fluid.XMLP._ERROR=11,fluid.XMLP._CONT_XML=0,fluid.XMLP._CONT_ALT=1,fluid.XMLP._ATT_NAME=0,fluid.XMLP._ATT_VAL=1,fluid.XMLP._STATE_PROLOG=1,fluid.XMLP._STATE_DOCUMENT=2,fluid.XMLP._STATE_MISC=3,fluid.XMLP._errs=[],fluid.XMLP._errs[fluid.XMLP.ERR_CLOSE_PI=0]="PI: missing closing sequence",fluid.XMLP._errs[fluid.XMLP.ERR_CLOSE_DTD=1]="DTD: missing closing sequence",fluid.XMLP._errs[fluid.XMLP.ERR_CLOSE_COMMENT=2]="Comment: missing closing sequence",fluid.XMLP._errs[fluid.XMLP.ERR_CLOSE_CDATA=3]="CDATA: missing closing sequence",fluid.XMLP._errs[fluid.XMLP.ERR_CLOSE_ELM=4]="Element: missing closing sequence",fluid.XMLP._errs[fluid.XMLP.ERR_CLOSE_ENTITY=5]="Entity: missing closing sequence",fluid.XMLP._errs[fluid.XMLP.ERR_PI_TARGET=6]="PI: target is required",fluid.XMLP._errs[fluid.XMLP.ERR_ELM_EMPTY=7]="Element: cannot be both empty and closing",fluid.XMLP._errs[fluid.XMLP.ERR_ELM_NAME=8]='Element: name must immediately follow "<"',fluid.XMLP._errs[fluid.XMLP.ERR_ELM_LT_NAME=9]='Element: "<" not allowed in element names',fluid.XMLP._errs[fluid.XMLP.ERR_ATT_VALUES=10]="Attribute: values are required and must be in quotes",fluid.XMLP._errs[fluid.XMLP.ERR_ATT_LT_NAME=11]='Element: "<" not allowed in attribute names',fluid.XMLP._errs[fluid.XMLP.ERR_ATT_LT_VALUE=12]='Attribute: "<" not allowed in attribute values',fluid.XMLP._errs[fluid.XMLP.ERR_ATT_DUP=13]="Attribute: duplicate attributes not allowed",fluid.XMLP._errs[fluid.XMLP.ERR_ENTITY_UNKNOWN=14]="Entity: unknown entity",fluid.XMLP._errs[fluid.XMLP.ERR_INFINITELOOP=15]="Infinite loop",fluid.XMLP._errs[fluid.XMLP.ERR_DOC_STRUCTURE=16]="Document: only comments, processing instructions, or whitespace allowed outside of document element",fluid.XMLP._errs[fluid.XMLP.ERR_ELM_NESTING=17]="Element: must be nested correctly",fluid.XMLP._checkStructure=function(that,iEvent){var stack=that.m_stack;if(fluid.XMLP._STATE_PROLOG==that.m_iState&&(that.m_iState=fluid.XMLP._STATE_DOCUMENT),fluid.XMLP._STATE_DOCUMENT===that.m_iState&&(fluid.XMLP._ELM_B!=iEvent&&fluid.XMLP._ELM_EMP!=iEvent||(that.m_stack[stack.length]=that.getName()),fluid.XMLP._ELM_E==iEvent||fluid.XMLP._ELM_EMP==iEvent)){if(0===stack.length)return fluid.XMLP._NONE;var strTop=stack[stack.length-1];if(that.m_stack.length--,null===strTop||strTop!==that.getName())return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ELM_NESTING)}return iEvent},fluid.XMLP._parseCDATA=function(that,iB){var iE=that.m_xml.indexOf("]]>",iB);return iE==-1?fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_CDATA):(fluid.XMLP._setContent(that,fluid.XMLP._CONT_XML,iB,iE),that.m_iP=iE+3,fluid.XMLP._CDATA)},fluid.XMLP._parseComment=function(that,iB){var iE=that.m_xml.indexOf("-->",iB);return iE==-1?fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_COMMENT):(fluid.XMLP._setContent(that,fluid.XMLP._CONT_XML,iB-4,iE+3),that.m_iP=iE+3,fluid.XMLP._COMMENT)},fluid.XMLP._parseDTD=function(that,iB){var iE,strClose,iInt,iLast;if(iE=that.m_xml.indexOf(">",iB),iE==-1)return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_DTD);for(iInt=that.m_xml.indexOf("[",iB),strClose=iInt!=-1&&iInt<iE?"]>":">";;){if(iE==iLast)return fluid.XMLP._setErr(that,fluid.XMLP.ERR_INFINITELOOP);if(iLast=iE,iE=that.m_xml.indexOf(strClose,iB),iE==-1)return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_DTD);if("]]>"!=that.m_xml.substring(iE-1,iE+2))break}return that.m_iP=iE+strClose.length,fluid.XMLP._DTD},fluid.XMLP._parsePI=function(that,iB){var iE,iTB,iTE,iCB,iCE;return iE=that.m_xml.indexOf("?>",iB),iE==-1?fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_PI):(iTB=fluid.SAXStrings.indexOfNonWhitespace(that.m_xml,iB,iE),iTB==-1?fluid.XMLP._setErr(that,fluid.XMLP.ERR_PI_TARGET):(iTE=fluid.SAXStrings.indexOfWhitespace(that.m_xml,iTB,iE),iTE==-1&&(iTE=iE),iCB=fluid.SAXStrings.indexOfNonWhitespace(that.m_xml,iTE,iE),iCB==-1&&(iCB=iE),iCE=fluid.SAXStrings.lastIndexOfNonWhitespace(that.m_xml,iCB,iE),iCE==-1&&(iCE=iE-1),that.m_name=that.m_xml.substring(iTB,iTE),fluid.XMLP._setContent(that,fluid.XMLP._CONT_XML,iCB,iCE+1),that.m_iP=iE+2,fluid.XMLP._PI))},fluid.XMLP._parseText=function(that,iB){var iE=that.m_xml.indexOf("<",iB);return iE==-1&&(iE=that.m_xml.length),fluid.XMLP._setContent(that,fluid.XMLP._CONT_XML,iB,iE),that.m_iP=iE,fluid.XMLP._TEXT},fluid.XMLP._setContent=function(that,iSrc){var args=arguments;fluid.XMLP._CONT_XML==iSrc?(that.m_cAlt=null,that.m_cB=args[2],that.m_cE=args[3]):(that.m_cAlt=args[2],that.m_cB=0,that.m_cE=args[2].length),that.m_cSrc=iSrc},fluid.XMLP._setErr=function(that,iErr){var strErr=fluid.XMLP._errs[iErr];return that.m_cAlt=strErr,that.m_cB=0,that.m_cE=strErr.length,that.m_cSrc=fluid.XMLP._CONT_ALT,fluid.XMLP._ERROR},fluid.XMLP._parseElement=function(that,iB){var iE,iDE,iType,strN;if(iDE=iE=that.m_xml.indexOf(">",iB),iE==-1)return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_ELM);if("/"==that.m_xml.charAt(iB)?(iType=fluid.XMLP._ELM_E,iB++):iType=fluid.XMLP._ELM_B,"/"==that.m_xml.charAt(iE-1)){if(iType==fluid.XMLP._ELM_E)return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ELM_EMPTY);iType=fluid.XMLP._ELM_EMP,iDE--}that.nameRegex.lastIndex=iB;var nameMatch=that.nameRegex.exec(that.m_xml);if(!nameMatch)return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ELM_NAME);if(strN=nameMatch[1].toLowerCase(),"li"===strN&&iType!==fluid.XMLP._ELM_E&&that.m_stack.length>0&&"li"===that.m_stack[that.m_stack.length-1]&&!that.m_emitSynthetic)return that.m_name="li",that.m_emitSynthetic=!0,fluid.XMLP._ELM_E;if(that.m_attributes={},that.m_cAlt="",that.nameRegex.lastIndex<iDE)for(that.m_iP=that.nameRegex.lastIndex;that.m_iP<iDE;){that.attrStartRegex.lastIndex=that.m_iP;var attrMatch=that.attrStartRegex.exec(that.m_xml);if(!attrMatch)return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ATT_VALUES);var attrval,attrname=attrMatch[1].toLowerCase();if(61===that.m_xml.charCodeAt(that.attrStartRegex.lastIndex)){var valRegex=34===that.m_xml.charCodeAt(that.attrStartRegex.lastIndex+1)?that.attrValRegex:that.attrValIERegex;if(valRegex.lastIndex=that.attrStartRegex.lastIndex+1,attrMatch=valRegex.exec(that.m_xml),!attrMatch)return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ATT_VALUES);attrval=attrMatch[1]}else attrval=attrname,valRegex=that.attrStartRegex;if(that.m_attributes[attrname]&&that.m_attributes[attrname]!==attrval)return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ATT_DUP);that.m_attributes[attrname]=attrval,that.m_iP=valRegex.lastIndex}if(strN.indexOf("<")!=-1)return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ELM_LT_NAME);if(that.m_name=strN,that.m_iP=iE+1,fluid.XMLP.closedTags[strN]){that.closeRegex.lastIndex=iE+1;var closeMatch=that.closeRegex.exec;if(closeMatch){var matchclose=that.m_xml.indexOf(strN,closeMatch.lastIndex);return matchclose===closeMatch.lastIndex?iType:fluid.XMLP._ELM_EMP}}return that.m_emitSynthetic=!1,iType},fluid.XMLP._parse=function(that){var iP=that.m_iP,xml=that.m_xml;
if(iP===xml.length)return fluid.XMLP._NONE;var c=xml.charAt(iP);if("<"!==c)return fluid.XMLP._parseText(that,iP);var c2=xml.charAt(iP+1);return"?"===c2?fluid.XMLP._parsePI(that,iP+2):"!"!==c2?fluid.XMLP._parseElement(that,iP+1):iP===xml.indexOf("<!DOCTYPE",iP)?fluid.XMLP._parseDTD(that,iP+9):iP===xml.indexOf("<!--",iP)?fluid.XMLP._parseComment(that,iP+4):iP===xml.indexOf("<![CDATA[",iP)?fluid.XMLP._parseCDATA(that,iP+9):void 0},fluid.XMLP.XMLPImpl=function(strXML){var that={};return that.m_xml=strXML,that.m_iP=0,that.m_iState=fluid.XMLP._STATE_PROLOG,that.m_stack=[],that.m_attributes={},that.m_emitSynthetic=!1,that.getColumnNumber=function(){return fluid.SAXStrings.getColumnNumber(that.m_xml,that.m_iP)},that.getContent=function(){return that.m_cSrc==fluid.XMLP._CONT_XML?that.m_xml:that.m_cAlt},that.getContentBegin=function(){return that.m_cB},that.getContentEnd=function(){return that.m_cE},that.getLineNumber=function(){return fluid.SAXStrings.getLineNumber(that.m_xml,that.m_iP)},that.getName=function(){return that.m_name},that.next=function(){return fluid.XMLP._checkStructure(that,fluid.XMLP._parse(that))},that.nameRegex=/([^\s\/>]+)/g,that.attrStartRegex=/\s*([\w:_][\w:_\-\.]*)/gm,that.attrValRegex=/\"([^\"]*)\"\s*/gm,that.attrValIERegex=/([^\>\s]+)\s*/gm,that.closeRegex=/\s*<\//g,that},fluid.SAXStrings={},fluid.SAXStrings.WHITESPACE=" \t\n\r",fluid.SAXStrings.QUOTES="\"'",fluid.SAXStrings.getColumnNumber=function(strD,iP){if(!strD)return-1;iP=iP||strD.length;var arrD=strD.substring(0,iP).split("\n");arrD.length--;var iLinePos=arrD.join("\n").length;return iP-iLinePos},fluid.SAXStrings.getLineNumber=function(strD,iP){return strD?(iP=iP||strD.length,strD.substring(0,iP).split("\n").length):-1},fluid.SAXStrings.indexOfNonWhitespace=function(strD,iB,iE){if(!strD)return-1;iB=iB||0,iE=iE||strD.length;for(var i=iB;i<iE;++i){var c=strD.charAt(i);if(" "!==c&&"\t"!==c&&"\n"!==c&&"\r"!==c)return i}return-1},fluid.SAXStrings.indexOfWhitespace=function(strD,iB,iE){if(!strD)return-1;iB=iB||0,iE=iE||strD.length;for(var i=iB;i<iE;i++)if(fluid.SAXStrings.WHITESPACE.indexOf(strD.charAt(i))!=-1)return i;return-1},fluid.SAXStrings.lastIndexOfNonWhitespace=function(strD,iB,iE){if(!strD)return-1;iB=iB||0,iE=iE||strD.length;for(var i=iE-1;i>=iB;i--)if(fluid.SAXStrings.WHITESPACE.indexOf(strD.charAt(i))==-1)return i;return-1},fluid.SAXStrings.replace=function(strD,iB,iE,strF,strR){return strD?(iB=iB||0,iE=iE||strD.length,strD.substring(iB,iE).split(strF).join(strR)):""}}(jQuery,fluid_2_0_0),fluid_2_0_0=fluid_2_0_0||{},function($,fluid){"use strict";fluid.parseTemplate=function(template,baseURL,scanStart,cutpoints_in,opts){function isSimpleClassCutpoint(tree){return 1===tree.length&&1===tree[0].predList.length&&tree[0].predList[0].clazz}function init(baseURLin,debugModeIn,cutpointsIn){if(t.rootlump=XMLLump(0,-1),tagstack=[t.rootlump],lumpindex=0,nestingdepth=0,justended=!1,defstart=-1,defend=-1,baseURL=baseURLin,debugMode=debugModeIn,cutpointsIn)for(var i=0;i<cutpointsIn.length;++i){var tree=fluid.parseSelector(cutpointsIn[i].selector,fluid.simpleCSSMatcher),clazz=isSimpleClassCutpoint(tree);clazz?simpleClassCutpoints[clazz]=cutpointsIn[i].id:(cutstatus.push([]),cutpoints.push($.extend({},cutpointsIn[i],{tree:tree})))}}function findTopContainer(){for(var i=tagstack.length-1;i>=0;--i){var lump=tagstack[i];if(void 0!==lump.rsfID)return lump}return t.rootlump}function newLump(){var togo=XMLLump(lumpindex,nestingdepth);return debugMode&&(togo.line=parser.getLineNumber(),togo.column=parser.getColumnNumber()),t.lumps[lumpindex]=togo,++lumpindex,togo}function addLump(mmap,ID,lump){var list=mmap[ID];list||(list=[],mmap[ID]=list),list[list.length]=lump}function checkContribute(ID,lump){if(ID.indexOf("scr=contribute-")!==-1){var scr=ID.substring("scr=contribute-".length);addLump(t.collectmap,scr,lump)}}function debugLump(lump){return"<"+lump.tagname+">"}function hasCssClass(clazz,totest){return!!totest&&(" "+totest+" ").indexOf(" "+clazz+" ")!==-1}function matchNode(term,headlump,headclazz){if(term.predList){for(var i=0;i<term.predList.length;++i){var pred=term.predList[i];if(pred.id&&headlump.attributemap.id!==pred.id)return!1;if(pred.clazz&&!hasCssClass(pred.clazz,headclazz))return!1;if(pred.tag&&headlump.tagname!==pred.tag)return!1}return!0}}function tagStartCut(headlump){var togo,i,headclazz=headlump.attributemap["class"];if(headclazz){var split=headclazz.split(" ");for(i=0;i<split.length;++i){var simpleCut=simpleClassCutpoints[$.trim(split[i])];if(simpleCut)return simpleCut}}for(i=0;i<cutpoints.length;++i){var cut=cutpoints[i],cutstat=cutstatus[i],nextterm=cutstat.length;if(nextterm<cut.tree.length){var term=cut.tree[nextterm];if(nextterm>0&&cut.tree[nextterm-1].child&&cutstat[nextterm-1]!==headlump.nestingdepth-1)continue;var isMatch=matchNode(term,headlump,headclazz);isMatch&&(cutstat[cutstat.length]=headlump.nestingdepth,cutstat.length===cut.tree.length&&(void 0!==togo&&fluid.fail("Cutpoint specification error - node "+debugLump(headlump)+" has already matched with rsf:id of "+togo),void 0!==cut.id&&null!==cut.id||fluid.fail("Error in cutpoints list - entry at position "+i+" does not have an id set"),togo=cut.id))}}return togo}function tagEndCut(){if(cutpoints)for(var i=0;i<cutpoints.length;++i){var cutstat=cutstatus[i];cutstat.length>0&&cutstat[cutstat.length-1]===nestingdepth&&cutstat.length--}}function processTagEnd(){tagEndCut();var endlump=newLump();--nestingdepth,endlump.text="</"+parser.getName()+">";var oldtop=tagstack[tagstack.length-1];oldtop.close_tag=t.lumps[lumpindex-1],tagstack.length--,justended=!0}function processTagStart(isempty){if(++nestingdepth,justended){justended=!1;var backlump=newLump();backlump.nestingdepth--}t.firstdocumentindex===-1&&(t.firstdocumentindex=lumpindex);var headlump=newLump(),stacktop=tagstack[tagstack.length-1];headlump.uplump=stacktop;var tagname=parser.getName();headlump.tagname=tagname;var attrs=headlump.attributemap=parser.m_attributes,ID=attrs[fluid.ID_ATTRIBUTE];void 0===ID&&(ID=tagStartCut(headlump));for(var attrname in attrs)void 0===ID&&(/href|src|codebase|action/.test(attrname)?ID="scr=rewrite-url":void 0===ID&&/for|headers/.test(attrname)&&(ID="scr=null"));if(ID){126===ID.charCodeAt(0)&&(ID=ID.substring(1),headlump.elide=!0),checkContribute(ID,headlump),headlump.rsfID=ID;var downreg=findTopContainer();for(downreg.downmap||(downreg.downmap={});downreg;)downreg.downmap&&addLump(downreg.downmap,ID,headlump),downreg=downreg.uplump;addLump(t.globalmap,ID,headlump);var colpos=ID.indexOf(":");if(colpos!==-1){var prefix=ID.substring(0,colpos);stacktop.finallump||(stacktop.finallump={}),stacktop.finallump[prefix]=headlump}}headlump.text="<"+tagname+fluid.dumpAttributes(attrs)+(isempty&&!ID?"/>":">"),tagstack[tagstack.length]=headlump,isempty&&(ID?processTagEnd():(--nestingdepth,tagstack.length--))}function processDefaultTag(){if(defstart!==-1){t.firstdocumentindex===-1&&(t.firstdocumentindex=lumpindex);var text=parser.getContent().substr(defstart,defend-defstart);justended=!1;var newlump=newLump();newlump.text=text,defstart=-1}}opts=opts||{},template||fluid.fail("empty template supplied to fluid.parseTemplate");var t,parser,tagstack,lumpindex=0,nestingdepth=0,justended=!1,defstart=-1,defend=-1,debugMode=!1,cutpoints=[],simpleClassCutpoints={},cutstatus=[],XMLLump=function(lumpindex,nestingdepth){return{nestingdepth:nestingdepth,lumpindex:lumpindex,parent:t}};t=fluid.XMLViewTemplate(),init(baseURL,opts.debugMode,cutpoints_in);var idpos=template.indexOf(fluid.ID_ATTRIBUTE);if(scanStart){var brackpos=template.indexOf(">",idpos);parser=fluid.XMLP(template.substring(brackpos+1))}else parser=fluid.XMLP(template);parseloop:for(;;){var iEvent=parser.next();switch(iEvent){case fluid.XMLP._ELM_B:processDefaultTag(),processTagStart(!1,"");break;case fluid.XMLP._ELM_E:processDefaultTag(),processTagEnd();break;case fluid.XMLP._ELM_EMP:processDefaultTag(),processTagStart(!0,"");break;case fluid.XMLP._PI:case fluid.XMLP._DTD:defstart=-1;continue;case fluid.XMLP._TEXT:case fluid.XMLP._ENTITY:case fluid.XMLP._CDATA:case fluid.XMLP._COMMENT:defstart===-1&&(defstart=parser.m_cB),defend=parser.m_cE;break;case fluid.XMLP._ERROR:fluid.setLogging(!0);var message="Error parsing template: "+parser.m_cAlt+" at line "+parser.getLineNumber();fluid.log(message),fluid.log("Just read: "+parser.m_xml.substring(parser.m_iP-30,parser.m_iP)),fluid.log("Still to read: "+parser.m_xml.substring(parser.m_iP,parser.m_iP+30)),fluid.fail(message);break parseloop;case fluid.XMLP._NONE:break parseloop}}processDefaultTag();var excess=tagstack.length-1;return excess&&fluid.fail("Error parsing template - unclosed tag(s) of depth "+excess+": "+fluid.transform(tagstack.splice(1,excess),function(lump){return debugLump(lump)}).join(", ")),t},fluid.debugLump=function(lump){var togo=lump.text;return togo+=" at ",togo+="lump line "+lump.line+" column "+lump.column+" index "+lump.lumpindex,togo+=null===lump.parent.href?"":" in file "+lump.parent.href},fluid.ID_ATTRIBUTE="rsf:id",fluid.getPrefix=function(id){var colpos=id.indexOf(":");return colpos===-1?id:id.substring(0,colpos)},fluid.SplitID=function(id){var that={},colpos=id.indexOf(":");return colpos===-1?that.prefix=id:(that.prefix=id.substring(0,colpos),that.suffix=id.substring(colpos+1)),that},fluid.XMLViewTemplate=function(){return{globalmap:{},collectmap:{},lumps:[],firstdocumentindex:-1}},fluid.XMLEncode=function(text){return text.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;")},fluid.dumpAttributes=function(attrcopy){var togo="";for(var attrname in attrcopy){var attrvalue=attrcopy[attrname];null!==attrvalue&&void 0!==attrvalue&&(togo+=" "+attrname+'="'+attrvalue+'"')}return togo},fluid.aggregateMMap=function(target,source){for(var key in source){var targhas=target[key];targhas||(target[key]=[]),target[key]=target[key].concat(source[key])}},fluid.parseTemplates=function(resourceSpec,templateList,opts){var togo=[];opts=opts||{},togo.globalmap={};for(var i=0;i<templateList.length;++i){var resource=resourceSpec[templateList[i]],lastslash=resource.href.lastIndexOf("/"),baseURL=lastslash===-1?"":resource.href.substring(0,lastslash+1),template=fluid.parseTemplate(resource.resourceText,baseURL,opts.scanStart&&0===i,resource.cutpoints,opts);0===i&&fluid.aggregateMMap(togo.globalmap,template.globalmap),template.href=resource.href,template.baseURL=baseURL,template.resourceKey=resource.resourceKey,togo[i]=template,fluid.aggregateMMap(togo.globalmap,template.rootlump.downmap)}return togo}}(jQuery,fluid_2_0_0),fluid_2_0_0=fluid_2_0_0||{},function($,fluid){"use strict";function debugPosition(component){return"as child of "+(component.parent.fullID?"component with full ID "+component.parent.fullID:"root")}function computeFullID(component){var togo="",move=component;for(void 0===component.children&&(togo=component.ID+(void 0!==component.localID?component.localID:""),move=component.parent);move.parent;){var parent=move.parent;if(void 0!==move.fullID)return togo=move.fullID+togo;if(void 0===move.noID){var ID=move.ID;void 0===ID&&fluid.fail("Error in component tree - component found with no ID "+debugPosition(parent)+": please check structure");var colpos=ID.indexOf(":"),prefix=colpos===-1?ID:ID.substring(0,colpos);togo=prefix+":"+(void 0===move.localID?"":move.localID)+":"+togo}move=parent}return togo}function processChild(value,key){if(renderer.isBoundPrimitive(value))return{componentType:"UIBound",value:value,ID:key};var unzip=unzipComponent(value);return unzip.ID?{ID:key,componentType:"UIContainer",children:[unzip]}:(unzip.ID=key,unzip)}function fixChildren(children){if(fluid.isArrayable(children))return children;var togo=[];for(var key in children){var value=children[key];if(fluid.isArrayable(value))for(var i=0;i<value.length;++i){var processed=processChild(value[i],key);togo[togo.length]=processed}else togo[togo.length]=processChild(value,key)}return togo}function fixupValue(uibound,model,resolverGetConfig){void 0===uibound.value&&void 0!==uibound.valuebinding&&(uibound.value=fluid.get(model,uibound.valuebinding,resolverGetConfig))}function upgradeBound(holder,property,model,resolverGetConfig){void 0!==holder[property]?renderer.isBoundPrimitive(holder[property])?holder[property]={value:holder[property]}:holder[property].messagekey&&(holder[property].componentType="UIMessage"):holder[property]={value:null},fixupValue(holder[property],model,resolverGetConfig)}function fixupTree(tree,model,resolverGetConfig){if(void 0===tree.componentType&&(tree=unzipComponent(tree,model,resolverGetConfig)),"UIContainer"===tree.componentType||tree.parent||(tree={children:[tree]}),tree.children){tree.childmap={};for(var i=0;i<tree.children.length;++i){var child=tree.children[i];void 0===child.componentType&&(child=unzipComponent(child,model,resolverGetConfig),tree.children[i]=child),child.parent=tree,void 0===child.ID&&fluid.fail("Error in component tree: component found with no ID "+debugPosition(child)),tree.childmap[child.ID]=child;var colpos=child.ID.indexOf(":");if(colpos===-1);else{var prefix=child.ID.substring(0,colpos),childlist=tree.childmap[prefix];childlist||(childlist=[],tree.childmap[prefix]=childlist),void 0===child.localID&&0!==childlist.length&&(child.localID=childlist.length),childlist[childlist.length]=child}child.fullID=computeFullID(child);var componentType=child.componentType;if("UISelect"===componentType)child.selection.fullID=child.fullID;else if("UIInitBlock"===componentType){for(var call=child.functionname+"(",childArgs=child.arguments,j=0;j<childArgs.length;++j)childArgs[j]instanceof fluid.ComponentReference&&(childArgs[j]=child.parent.fullID+childArgs[j].reference),call+=JSON.stringify(childArgs[j]),j<childArgs.length-1&&(call+=", ");child.markup={value:call+")\n"},child.componentType="UIVerbatim"}else"UIBound"===componentType&&fixupValue(child,model,resolverGetConfig);fixupTree(child,model,resolverGetConfig)}}return tree}function findNodeValue(rootNode){var node=fluid.dom.iterateDom(rootNode,function(node){return 8===node.nodeType||4===node.nodeType?"stop":null},!0),value=node.nodeValue;return 0===value.indexOf("[CDATA[")?value.substring(6,value.length-2):value}fluid.defaults("fluid.messageResolver",{gradeNames:["fluid.component"],mergePolicy:{messageBase:"nomerge",parents:"nomerge"},resolveFunc:fluid.stringTemplate,parseFunc:fluid.identity,messageBase:{},members:{messageBase:"@expand:{that}.options.parseFunc({that}.options.messageBase)"},invokers:{lookup:"fluid.messageResolver.lookup({that}, {arguments}.0)",resolve:"fluid.messageResolver.resolve({that}, {arguments}.0, {arguments}.1)"},parents:[]}),fluid.messageResolver.lookup=function(that,messagecodes){var resolved=fluid.messageResolver.resolveOne(that.messageBase,messagecodes);return void 0===resolved?fluid.find(that.options.parents,function(parent){return parent?parent.lookup(messagecodes):void 0}):{template:resolved,resolveFunc:that.options.resolveFunc}},fluid.messageResolver.resolve=function(that,messagecodes,args){if(!messagecodes)return"[No messagecodes provided]";messagecodes=fluid.makeArray(messagecodes);var looked=that.lookup(messagecodes);return looked?looked.resolveFunc(looked.template,args):"[Message string for key "+messagecodes[0]+" not found]"},fluid.messageResolver.resolveOne=function(messageBase,messagecodes){for(var i=0;i<messagecodes.length;++i){var code=messagecodes[i],message=messageBase[code];if(void 0!==message)return message}},fluid.messageLocator=function(messageBase,resolveFunc){var resolver=fluid.messageResolver({messageBase:messageBase,resolveFunc:resolveFunc});return function(messagecodes,args){return resolver.resolve(messagecodes,args)}};var renderer={};renderer.isBoundPrimitive=function(value){return fluid.isPrimitive(value)||fluid.isArrayable(value)&&(0===value.length||"string"==typeof value[0])};var unzipComponent;renderer.duckMap={children:"UIContainer",value:"UIBound",valuebinding:"UIBound",messagekey:"UIMessage",markup:"UIVerbatim",selection:"UISelect",target:"UILink",choiceindex:"UISelectChoice",functionname:"UIInitBlock"};var boundMap={UISelect:["selection","optionlist","optionnames"],UILink:["target","linktext"],UIVerbatim:["markup"],UIMessage:["messagekey"]};renderer.boundMap=fluid.transform(boundMap,fluid.arrayToHash),renderer.inferComponentType=function(component){for(var key in renderer.duckMap)if(void 0!==component[key])return renderer.duckMap[key]},renderer.applyComponentType=function(component){component.componentType=renderer.inferComponentType(component),void 0===component.componentType&&void 0!==component.ID&&(component.componentType="UIBound")},unzipComponent=function(component,model,resolverGetConfig){if(component&&renderer.applyComponentType(component),!component||void 0===component.componentType){var decorators=component.decorators;decorators&&delete component.decorators,component={componentType:"UIContainer",children:component},component.decorators=decorators}var cType=component.componentType;if("UIContainer"===cType)component.children=fixChildren(component.children);else{var map=renderer.boundMap[cType];map&&fluid.each(map,function(value,key){upgradeBound(component,key,model,resolverGetConfig)})}return component},fluid.NULL_STRING="▩null▩";var LINK_ATTRIBUTES={a:"href",link:"href",img:"src",frame:"src",script:"src",style:"src",input:"src",embed:"src",form:"action",applet:"codebase",object:"codebase"};renderer.decoratorComponentPrefix="**-renderer-",renderer.IDtoComponentName=function(ID,num){return renderer.decoratorComponentPrefix+ID.replace(/\./g,"")+"-"+num},renderer.invokeFluidDecorator=function(func,args,ID,num,options){var that;if(options.parentComponent){var parent=options.parentComponent,name=renderer.IDtoComponentName(ID,num);fluid.set(parent,["options","components",name],{type:func,container:args[0],options:args[1]}),that=fluid.initDependent(options.parentComponent,name)}else that=fluid.invokeGlobalFunction(func,args);return that},fluid.renderer=function(templates,tree,options,fossilsIn){function getRewriteKey(template,parent,id){return template.resourceKey+parent.fullID+id}function resolveInScope(searchID,defprefix,scope){var deflump,scopelook=scope?scope[searchID]:null;if(scopelook)for(var i=0;i<scopelook.length;++i){var scopelump=scopelook[i];if(deflump||scopelump.rsfID!==defprefix||(deflump=scopelump),scopelump.rsfID===searchID)return scopelump}return deflump}function resolveCall(sourcescope,child){var searchID=child.jointID?child.jointID:child.ID,split=fluid.SplitID(searchID),defprefix=split.prefix+":",match=resolveInScope(searchID,defprefix,sourcescope.downmap,child);return match?match:child.children&&(match=resolveInScope(searchID,defprefix,globalmap,child))?match:null}function noteCollected(template){seenset[template.href]||(fluid.aggregateMMap(collected,template.collectmap),seenset[template.href]=!0)}function resolveRecurse(basecontainer,parentlump){var i,id,resolved;for(i=0;i<basecontainer.children.length;++i){var branch=basecontainer.children[i];branch.children&&(resolved=resolveCall(parentlump,branch),resolved&&(branchmap[branch.fullID]=resolved,id=resolved.attributemap.id,void 0!==id&&(rewritemap[getRewriteKey(parentlump.parent,basecontainer,id)]=branch.fullID),noteCollected(resolved.parent),resolveRecurse(branch,resolved)))}if(parentlump.downmap)for(id in parentlump.downmap){var lumps=parentlump.downmap[id];for(i=0;i<lumps.length;++i){var lump=lumps[i],lumpid=lump.attributemap.id;if(void 0!==lumpid&&void 0!==lump.rsfID&&(resolved=fetchComponent(basecontainer,lump.rsfID),null!==resolved)){var resolveID=resolved.fullID;rewritemap[getRewriteKey(parentlump.parent,basecontainer,lumpid)]=resolveID}}}}function resolveBranches(globalmapp,basecontainer,parentlump){branchmap={},rewritemap={},seenset={},collected={},globalmap=globalmapp,branchmap[basecontainer.fullID]=parentlump,resolveRecurse(basecontainer,parentlump)}function dumpTillLump(lumps,start,limit){for(;start<limit;++start){var text=lumps[start].text;text&&(out+=lumps[start].text)}}function dumpScan(lumps,renderindex,basedepth,closeparent,insideleaf){for(var start=renderindex;;){if(renderindex===lumps.length)break;var lump=lumps[renderindex];if(lump.nestingdepth<basedepth)break;if(void 0!==lump.rsfID){if(!insideleaf)break;if(!(insideleaf&&lump.nestingdepth>basedepth+(closeparent?0:1)))break;fluid.log("Error in component tree - leaf component found to contain further components - at "+lump.toString())}++renderindex}return closeparent||renderindex!==lumps.length&&lumps[renderindex].rsfID||--renderindex,dumpTillLump(lumps,start,renderindex),renderindex}function isPlaceholder(){return!1}function isValue(value){return null!==value&&void 0!==value&&!isPlaceholder(value)}function openTag(){trc.iselide||(out+="<"+trc.uselump.tagname)}function closeTag(){trc.iselide||(out+="</"+trc.uselump.tagname+">")}function renderUnchanged(){dumpTillLump(trc.uselump.parent.lumps,trc.uselump.lumpindex+1,trc.close.lumpindex+(trc.iselide?0:1))}function isSelfClose(){return trc.endopen.lumpindex===trc.close.lumpindex&&fluid.XMLP.closedTags[trc.uselump.tagname]}function dumpTemplateBody(){isSelfClose()?trc.iselide||(out+="/>"):(trc.iselide||(out+=">"),dumpTillLump(trc.uselump.parent.lumps,trc.endopen.lumpindex,trc.close.lumpindex+(trc.iselide?0:1)))}function replaceAttributes(){trc.iselide||(out+=fluid.dumpAttributes(trc.attrcopy)),dumpTemplateBody()}function replaceAttributesOpen(){if(trc.iselide)replaceAttributes();else{out+=fluid.dumpAttributes(trc.attrcopy);var selfClose=isSelfClose();out+=selfClose?"/>":">",trc.nextpos=selfClose?trc.close.lumpindex+1:trc.endopen.lumpindex}}function replaceBody(value){out+=fluid.dumpAttributes(trc.attrcopy),trc.iselide||(out+=">"),out+=fluid.XMLEncode(value.toString()),closeTag()}function rewriteLeaf(value){isValue(value)?replaceBody(value):replaceAttributes()}function rewriteLeafOpen(value){trc.iselide?rewriteLeaf(trc.value):isValue(value)?replaceBody(value):replaceAttributesOpen()}function rewriteUrl(template,url){if(renderOptions.urlRewriter){var rewritten=renderOptions.urlRewriter(url);if(rewritten)return rewritten}if(!renderOptions.rebaseURLs)return url;var protpos=url.indexOf(":/");return"/"===url.charAt(0)||protpos!==-1&&protpos<7?url:renderOptions.baseURL+url}function dumpHiddenField(todump){out+='<input type="hidden" ';var isvirtual=todump.virtual,outattrs={};outattrs[isvirtual?"id":"name"]=todump.name,outattrs.value=todump.value,out+=fluid.dumpAttributes(outattrs),out+=" />\n"}function applyAutoBind(torender,finalID){function applyFunc(){fluid.applyBoundChange(fluid.byId(finalID,renderOptions.document),void 0,applier)}if(finalID){var tagname=trc.uselump.tagname,applier=renderOptions.applier;if(renderOptions.autoBind&&/input|select|textarea/.test(tagname)&&!renderedbindings[finalID]){var decorators=[{jQuery:["change",applyFunc]}];$.browser.msie&&"input"===tagname&&/radio|checkbox/.test(trc.attrcopy.type)&&decorators.push({jQuery:["click",applyFunc]}),$.browser.safari&&"input"===tagname&&"radio"===trc.attrcopy.type&&decorators.push({jQuery:["keyup",applyFunc]}),outDecoratorsImpl(torender,decorators,trc.attrcopy,finalID)}}}function dumpBoundFields(torender,parent){if(torender){var holder=parent?parent:torender;if(renderOptions.fossils&&void 0!==holder.valuebinding){var fossilKey=holder.submittingname||torender.finalID;renderOptions.fossils[fossilKey]={name:fossilKey,EL:holder.valuebinding,oldvalue:holder.value},applyAutoBind(torender,torender.finalID)}torender.fossilizedbinding&&dumpHiddenField(torender.fossilizedbinding),torender.fossilizedshaper&&dumpHiddenField(torender.fossilizedshaper)}}function dumpSelectionBindings(uiselect){renderedbindings[uiselect.selection.fullID]||(renderedbindings[uiselect.selection.fullID]=!0,dumpBoundFields(uiselect.selection),dumpBoundFields(uiselect.optionlist),dumpBoundFields(uiselect.optionnames))}function isSelectedValue(torender,value){var selection=torender.selection;return fluid.isArrayable(selection.value)?selection.value.indexOf(value)!==-1:selection.value===value}function getRelativeComponent(component,relativeID){for(component=component.parent;0===relativeID.indexOf("..::");)relativeID=relativeID.substring(4),component=component.parent;return component.childmap[relativeID]}function rewriteRewriteMap(from,to){fluid.each(rewritemap,function(value,key){value===from&&(rewritemap[key]=to)})}function adjustForID(attrcopy,component,late,forceID){late||delete attrcopy["rsf:id"],void 0!==component.finalID?attrcopy.id=component.finalID:void 0!==forceID?attrcopy.id=forceID:(attrcopy.id||late)&&(attrcopy.id=component.fullID);for(var count=1,baseid=attrcopy.id;renderOptions.document.getElementById(attrcopy.id)||usedIDs[attrcopy.id];)attrcopy.id=baseid+"-"+count++;return 1!==count&&rewriteRewriteMap(baseid,attrcopy.id),component.finalID=attrcopy.id,attrcopy.id}function assignSubmittingName(attrcopy,component,parent){var submitting=parent||component;return adjustForID(attrcopy,component,!0,component.fullID),void 0===submitting.submittingname&&submitting.willinput!==!1&&(submitting.submittingname=submitting.finalID||submitting.fullID),submitting.submittingname}function explodeDecorators(decorators){var togo=[];if(decorators.type)togo[0]=decorators;else for(var key in decorators){"$"===key&&(key="jQuery");var value=decorators[key],decorator={type:key};"jQuery"===key?(decorator.func=value[0],decorator.args=value.slice(1)):"addClass"===key||"removeClass"===key?decorator.classes=value:"attrs"===key?decorator.attributes=value:"identify"===key&&(decorator.key=value),togo[togo.length]=decorator}return togo}function outDecorators(torender,attrcopy){torender.decorators&&(void 0===torender.decorators.length&&(torender.decorators=explodeDecorators(torender.decorators)),outDecoratorsImpl(torender,torender.decorators,attrcopy))}function dumpBranchHead(branch,targetlump){if(!targetlump.elide){var attrcopy={};$.extend(!0,attrcopy,targetlump.attributemap),adjustForID(attrcopy,branch),outDecorators(branch,attrcopy),out+="<"+targetlump.tagname+" ",out+=fluid.dumpAttributes(attrcopy),out+=">"}}function resolveArgs(args){return args?(args=fluid.copy(args),fluid.transform(args,function(arg,index){return upgradeBound(args,index,renderOptions.model,renderOptions.resolverGetConfig),args[index].value})):args}function degradeMessage(torender){if("UIMessage"===torender.componentType)if(torender.componentType="UIBound",renderOptions.messageLocator){upgradeBound(torender,"messagekey",renderOptions.model,renderOptions.resolverGetConfig);var resArgs=resolveArgs(torender.args);torender.value=renderOptions.messageLocator(torender.messagekey.value,resArgs)}else torender.value="[No messageLocator is configured in options - please consult documentation on options.messageSource]"}function renderComponent(torender){function makeFail(torender,end){fluid.fail("Error in component tree - UISelectChoice with id "+torender.fullID+end)}var value,attrcopy=trc.attrcopy;degradeMessage(torender);var componentType=torender.componentType,tagname=trc.uselump.tagname;if(outDecorators(torender,attrcopy),"UIBound"===componentType||"UISelectChoice"===componentType){var parent;void 0!==torender.choiceindex&&(void 0!==torender.parentRelativeID?(parent=getRelativeComponent(torender,torender.parentRelativeID),parent||makeFail(torender," has parentRelativeID of "+torender.parentRelativeID+" which cannot be resolved")):makeFail(torender," does not have parentRelativeID set"),assignSubmittingName(attrcopy,torender,parent.selection),dumpSelectionBindings(parent));var submittingname=parent?parent.selection.submittingname:torender.submittingname;if(!parent&&torender.valuebinding&&(submittingname=assignSubmittingName(attrcopy,torender)),"input"!==tagname&&"textarea"!==tagname||void 0!==submittingname&&(attrcopy.name=submittingname),dumpBoundFields(torender,parent?parent.selection:null),"boolean"==typeof torender.value||"radio"===attrcopy.type||"checkbox"===attrcopy.type){var underlyingValue,directValue=torender.value;void 0!==torender.choiceindex&&(parent.optionlist.value||fluid.fail("Error in component tree - selection control with full ID "+parent.fullID+" has no values"),underlyingValue=parent.optionlist.value[torender.choiceindex],directValue=isSelectedValue(parent,underlyingValue)),isValue(directValue)&&(directValue?attrcopy.checked="checked":delete attrcopy.checked),attrcopy.value=fluid.XMLEncode(underlyingValue?underlyingValue:"true"),rewriteLeaf(null)}else fluid.isArrayable(torender.value)?renderUnchanged():(value=parent?parent["textarea"===tagname||"input"===tagname?"optionlist":"optionnames"].value[torender.choiceindex]:torender.value,"textarea"===tagname?(isPlaceholder(value)&&torender.willinput&&(value=""),rewriteLeaf(value)):"input"===tagname?((torender.willinput||isValue(value))&&(attrcopy.value=fluid.XMLEncode(String(value))),rewriteLeaf(null)):(delete attrcopy.name,rewriteLeafOpen(value)))}else if("UISelect"===componentType){var ishtmlselect="select"===tagname,ismultiple=!1;if(fluid.isArrayable(torender.selection.value)&&(ismultiple=!0,ishtmlselect&&(attrcopy.multiple="multiple")),assignSubmittingName(attrcopy,torender.selection),ishtmlselect&&(torender.selection.willinput!==!1&&(attrcopy.name=torender.selection.submittingname),applyAutoBind(torender,attrcopy.id)),out+=fluid.dumpAttributes(attrcopy),ishtmlselect){out+=">";var values=torender.optionlist.value,names=null!==torender.optionnames&&void 0!==torender.optionnames&&torender.optionnames.value?torender.optionnames.value:values;names&&names.length||fluid.fail("Error in component tree - UISelect component with fullID "+torender.fullID+" does not have optionnames set");for(var i=0;i<names.length;++i)out+='<option value="',value=values[i],null===value&&(value=fluid.NULL_STRING),out+=fluid.XMLEncode(value),isSelectedValue(torender,value)&&(out+='" selected="selected'),out+='">',out+=fluid.XMLEncode(names[i]),out+="</option>\n";closeTag()}else dumpTemplateBody();dumpSelectionBindings(torender)}else if("UILink"===componentType){var attrname=LINK_ATTRIBUTES[tagname];if(attrname){degradeMessage(torender.target);var target=torender.target.value;isValue(target)||(target=attrcopy[attrname]),target=rewriteUrl(trc.uselump.parent,target),attrcopy[attrname]=fluid.XMLEncode(target)}value=void 0,torender.linktext&&(degradeMessage(torender.linktext),value=torender.linktext.value),isValue(value)?rewriteLeaf(value):replaceAttributesOpen()}else if(void 0!==torender.markup){degradeMessage(torender.markup);var rendered=torender.markup.value;null===rendered?(out+=fluid.dumpAttributes(attrcopy),out+=">",renderUnchanged()):(trc.iselide||(out+=fluid.dumpAttributes(attrcopy),out+=">"),out+=rendered,closeTag())}void 0!==attrcopy.id&&(usedIDs[attrcopy.id]=!0)}function rewriteIDRelation(context){var attrname,attrval=trc.attrcopy["for"];if(void 0!==attrval?attrname="for":(attrval=trc.attrcopy.headers,void 0!==attrval&&(attrname="headers")),attrname){var tagname=trc.uselump.tagname;if(!("for"===attrname&&"label"!==tagname||"headers"===attrname&&"td"!==tagname&&"th"!==tagname)){var rewritten=rewritemap[getRewriteKey(trc.uselump.parent,context,attrval)];void 0!==rewritten&&(trc.attrcopy[attrname]=rewritten)}}}function renderComment(message){out+="<!-- "+fluid.XMLEncode(message)+"-->"}function renderDebugMessage(message){out+='<span style="background-color:#FF466B;color:white;padding:1px;">',out+=message,out+="</span><br/>"}function reportPath(branch){var path=branch.fullID;return path?"full path "+path:"component tree root"}function renderComponentSystem(context,torendero,lump){var lumpindex=lump.lumpindex,lumps=lump.parent.lumps,nextpos=-1,outerendopen=lumps[lumpindex+1],outerclose=lump.close_tag;nextpos=outerclose.lumpindex+1;var payloadlist=lump.downmap?lump.downmap["payload-component"]:null,payload=payloadlist?payloadlist[0]:null,iselide=126===lump.rsfID.charCodeAt(0),endopen=outerendopen,close=outerclose,uselump=lump,attrcopy={};if($.extend(!0,attrcopy,(null===payload?lump:payload).attributemap),trc.attrcopy=attrcopy,trc.uselump=uselump,
trc.endopen=endopen,trc.close=close,trc.nextpos=nextpos,trc.iselide=iselide,rewriteIDRelation(context),null===torendero&&lump.rsfID.indexOf("scr=")===(iselide?1:0)){var scrname=lump.rsfID.substring(4+(iselide?1:0));"ignore"===scrname?nextpos=trc.close.lumpindex+1:"rewrite-url"===scrname?torendero={componentType:"UILink",target:{}}:(openTag(),replaceAttributesOpen(),nextpos=trc.endopen.lumpindex)}return null!==torendero&&(payload&&(trc.endopen=lumps[payload.lumpindex+1],trc.close=payload.close_tag,trc.uselump=payload,dumpTillLump(lumps,lumpindex,payload.lumpindex),lumpindex=payload.lumpindex),adjustForID(attrcopy,torendero),openTag(),renderComponent(torendero),null!==payload&&trc.nextpos===nextpos&&dumpTillLump(lumps,trc.close.lumpindex+1,outerclose.lumpindex+1),nextpos=trc.nextpos),nextpos}function renderContainer(child,targetlump){var t2=targetlump.parent,firstchild=t2.lumps[targetlump.lumpindex+1];void 0!==child.children?dumpBranchHead(child,targetlump):renderComponentSystem(child.parent,child,targetlump),renderRecurse(child,targetlump,firstchild)}function fetchComponents(basecontainer,id){for(var togo;basecontainer&&!(togo=basecontainer.childmap[id]);)basecontainer=basecontainer.parent;return togo}function findChild(sourcescope,child){var split=fluid.SplitID(child.ID),headlumps=sourcescope.downmap[child.ID];return headlumps||(headlumps=sourcescope.downmap[split.prefix+":"]),headlumps?headlumps[0]:null}function renderCollect(collump){dumpTillLump(collump.parent.lumps,collump.lumpindex,collump.close_tag.lumpindex+1)}function renderCollects(){for(var key in collected)for(var collist=collected[key],i=0;i<collist.length;++i)renderCollect(collist[i])}function processDecoratorQueue(){for(var i=0;i<decoratorQueue.length;++i)for(var decorator=decoratorQueue[i],j=0;j<decorator.ids.length;++j){var id=decorator.ids[j],node=fluid.byId(id,renderOptions.document);if(node||fluid.fail("Error during rendering - component with id "+id+" which has a queued decorator was not found in the output markup"),"jQuery"===decorator.type){var jnode=renderOptions.jQuery(node);jnode[decorator.func].apply(jnode,fluid.makeArray(decorator.args))}else if("fluid"===decorator.type){var args=decorator.args;if(!args){var thisContainer=renderOptions.jQuery(node);decorator.container?decorator.container.push(node):decorator.container=thisContainer,args=[thisContainer,decorator.options]}var that=renderer.invokeFluidDecorator(decorator.func,args,id,i,options);decorator.that=that}else"event"===decorator.type&&(node[decorator.event]=decorator.handler)}}options=options||{},tree=tree||{};var debugMode=options.debugMode;!options.messageLocator&&options.messageSource&&(options.messageLocator=fluid.resolveMessageSource(options.messageSource)),options.document=options.document||document,options.jQuery=options.jQuery||$,options.fossils=options.fossils||fossilsIn||{};var fetchComponent,outDecoratorsImpl,globalmap={},branchmap={},rewritemap={},seenset={},collected={},out="",renderOptions=options,decoratorQueue=[],renderedbindings={},usedIDs={},that={options:options},trc={};outDecoratorsImpl=function(torender,decorators,attrcopy,finalID){var id,sanitizeAttrs=function(value,key){null===value||void 0===value?delete attrcopy[key]:attrcopy[key]=fluid.XMLEncode(value)};renderOptions.idMap=renderOptions.idMap||{};for(var i=0;i<decorators.length;++i){var decorator=decorators[i],type=decorator.type;if(type)if("$"===type&&(type=decorator.type="jQuery"),"jQuery"===type||"event"===type||"fluid"===type)id=adjustForID(attrcopy,torender,!0,finalID),void 0===decorator.ids&&(decorator.ids=[],decoratorQueue[decoratorQueue.length]=decorator),decorator.ids.push(id);else if("attrs"===type)fluid.each(decorator.attributes,sanitizeAttrs);else if("addClass"===type||"removeClass"===type){var fakeNode=$("<div>",{"class":attrcopy["class"]})[0];renderOptions.jQuery(fakeNode)[type](decorator.classes),attrcopy["class"]=fakeNode.className}else"identify"===type?(id=adjustForID(attrcopy,torender,!0,finalID),renderOptions.idMap[decorator.key]=id):"null"!==type&&fluid.log("Unrecognised decorator of type "+type+" found at component of ID "+finalID);else{var explodedDecorators=explodeDecorators(decorator);outDecoratorsImpl(torender,explodedDecorators,attrcopy,finalID)}}};var renderRecurse;return fetchComponent=function(basecontainer,id){if(0===id.indexOf("msg=")){var key=id.substring(4);return{componentType:"UIMessage",messagekey:key}}for(;basecontainer;){var togo=basecontainer.childmap[id];if(togo)return togo;basecontainer=basecontainer.parent}return null},renderRecurse=function(basecontainer,parentlump,baselump){var children,targetlump,child,rendered,renderindex=baselump.lumpindex,basedepth=parentlump.nestingdepth,t1=parentlump.parent;for(debugMode&&(rendered={});;){if(renderindex=dumpScan(t1.lumps,renderindex,basedepth,!parentlump.elide,!1),renderindex===t1.lumps.length)break;var lump=t1.lumps[renderindex],id=lump.rsfID;if(lump.nestingdepth<basedepth||void 0===id)break;if(126===id.charCodeAt(0)&&(id=id.substring(1)),id.indexOf(":")!==-1){var prefix=fluid.getPrefix(id);children=fetchComponents(basecontainer,prefix);var finallump=lump.uplump.finallump[prefix],closefinal=finallump.close_tag;if(children)for(var i=0;i<children.length;++i)if(child=children[i],child.children)debugMode&&(rendered[child.fullID]=!0),targetlump=branchmap[child.fullID],targetlump?(debugMode&&renderComment("Branching for "+child.fullID+" from "+fluid.debugLump(lump)+" to "+fluid.debugLump(targetlump)),renderContainer(child,targetlump),debugMode&&renderComment("Branch returned for "+child.fullID+fluid.debugLump(lump)+" to "+fluid.debugLump(targetlump))):debugMode&&renderDebugMessage("No matching template branch found for branch container with full ID "+child.fullID+" rendering from parent template branch "+fluid.debugLump(baselump));else{if(targetlump=findChild(parentlump,child),!targetlump){debugMode&&renderDebugMessage("Repetitive leaf with full ID "+child.fullID+" could not be rendered from parent template branch "+fluid.debugLump(baselump));continue}var renderend=renderComponentSystem(basecontainer,child,targetlump),wasopentag=renderend<t1.lumps.lengtn&&t1.lumps[renderend].nestingdepth>=targetlump.nestingdepth,newbase=child.children?child:basecontainer;wasopentag&&(renderRecurse(newbase,targetlump,t1.lumps[renderend]),renderend=targetlump.close_tag.lumpindex+1),i!==children.length-1?renderend<closefinal.lumpindex&&dumpScan(t1.lumps,renderend,targetlump.nestingdepth-1,!1,!1):dumpScan(t1.lumps,renderend,targetlump.nestingdepth,!0,!1)}else debugMode&&renderDebugMessage("No branch container with prefix "+prefix+": found in container "+reportPath(basecontainer)+" rendering at template position "+fluid.debugLump(baselump)+", skipping");renderindex=closefinal.lumpindex+1,debugMode&&renderComment("Stack returned from branch for ID "+id+" to "+fluid.debugLump(baselump)+": skipping from "+fluid.debugLump(lump)+" to "+fluid.debugLump(closefinal))}else{var component;id&&(component=fetchComponent(basecontainer,id,lump),debugMode&&component&&(rendered[component.fullID]=!0)),component&&void 0!==component.children?(renderContainer(component),renderindex=lump.close_tag.lumpindex+1):renderindex=renderComponentSystem(basecontainer,component,lump)}if(renderindex===t1.lumps.length)break}if(debugMode){children=basecontainer.children;for(var key=0;key<children.length;++key)child=children[key],rendered[child.fullID]||renderDebugMessage("Component "+child.componentType+" with full ID "+child.fullID+" could not be found within template "+fluid.debugLump(baselump))}},that.renderTemplates=function(){tree=fixupTree(tree,options.model,options.resolverGetConfig);var template=templates[0];return resolveBranches(templates.globalmap,tree,template.rootlump),renderedbindings={},renderCollects(),renderRecurse(tree,template.rootlump,template.lumps[template.firstdocumentindex]),out},that.processDecoratorQueue=function(){processDecoratorQueue()},that},jQuery.extend(!0,fluid.renderer,renderer),fluid.ComponentReference=function(reference){this.reference=reference},fluid.explode=function(hash,basepath){var togo=[];for(var key in hash){var binding=void 0===basepath?key:basepath+"."+key;togo[togo.length]={ID:key,value:hash[key],valuebinding:binding}}return togo},fluid.explodeSelectionToInputs=function(optionlist,opts){return fluid.transform(optionlist,function(option,index){return{ID:opts.rowID,children:[{ID:opts.inputID,parentRelativeID:"..::"+opts.selectID,choiceindex:index},{ID:opts.labelID,parentRelativeID:"..::"+opts.selectID,choiceindex:index}]}})},fluid.resolveMessageSource=function(messageSource){if("data"===messageSource.type){if(void 0===messageSource.url)return fluid.messageLocator(messageSource.messages,messageSource.resolveFunc)}else if("resolver"===messageSource.type)return messageSource.resolver.resolve},fluid.renderTemplates=function(templates,tree,options,fossilsIn){var renderer=fluid.renderer(templates,tree,options,fossilsIn),rendered=renderer.renderTemplates();return rendered},fluid.reRender=function(templates,node,tree,options){options=options||{};var renderer=fluid.renderer(templates,tree,options,options.fossils);options=renderer.options,node=fluid.unwrap(node);var lastId,lastFocusedElement=fluid.getLastFocusedElement?fluid.getLastFocusedElement():null;lastFocusedElement&&fluid.dom.isContainer(node,lastFocusedElement)&&(lastId=lastFocusedElement.id),$.browser.msie?options.jQuery(node).empty():node.innerHTML="";var rendered=renderer.renderTemplates();if(options.renderRaw&&(rendered=fluid.XMLEncode(rendered),rendered=rendered.replace(/\n/g,"<br/>")),options.model&&fluid.bindFossils(node,options.model,options.fossils),$.browser.msie?options.jQuery(node).html(rendered):node.innerHTML=rendered,renderer.processDecoratorQueue(),lastId){var element=fluid.byId(lastId,options.document);element&&options.jQuery(element).focus()}return templates},fluid.extractTemplate=function(node,armouring){return armouring?findNodeValue(node):node.innerHTML},fluid.render=function(source,target,tree,options){options=options||{};var template=source;"object"==typeof source&&(template=fluid.extractTemplate(fluid.unwrap(source.node),source.armouring)),target=fluid.unwrap(target);var resourceSpec={base:{resourceText:template,href:".",resourceKey:".",cutpoints:options.cutpoints}},templates=fluid.parseTemplates(resourceSpec,["base"],options);return fluid.reRender(templates,target,tree,options)},fluid.selfRender=function(node,tree,options){return options=options||{},fluid.render({node:node,armouring:options.armouring},node,tree,options)}}(jQuery,fluid_2_0_0),fluid_2_0_0=fluid_2_0_0||{},function($,fluid){"use strict";fluid.renderer||fluid.fail("fluidRenderer.js is a necessary dependency of RendererUtilities"),fluid.renderer.visitDecorators=function(that,visitor){fluid.visitComponentChildren(that,function(component,name){0===name.indexOf(fluid.renderer.decoratorComponentPrefix)&&visitor(component,name)},{flat:!0},[])},fluid.renderer.clearDecorators=function(that){var instantiator=fluid.getInstantiator(that);fluid.renderer.visitDecorators(that,function(component,name){instantiator.clearComponent(that,name)})},fluid.renderer.getDecoratorComponents=function(that){var togo={};return fluid.renderer.visitDecorators(that,function(component,name){togo[name]=component}),togo},fluid.renderer.modeliseOptions=function(options,defaults,baseOptions){return $.extend({},defaults,fluid.filterKeys(baseOptions,["model","applier"]),options)},fluid.renderer.reverseMerge=function(target,source,names){names=fluid.makeArray(names),fluid.each(names,function(name){void 0===target[name]&&void 0!==source[name]&&(target[name]=source[name])})},fluid.renderer.createRendererSubcomponent=function(container,selectors,options,parentThat,fossils){options=options||{};var source=options.templateSource?options.templateSource:{node:$(container)},nativeModel=void 0===options.rendererOptions.model,rendererOptions=fluid.renderer.modeliseOptions(options.rendererOptions,null,parentThat);if(rendererOptions.fossils=fossils||{},rendererOptions.parentComponent=parentThat,container.jquery){var cascadeOptions={document:container[0].ownerDocument,jQuery:container.constructor};fluid.renderer.reverseMerge(rendererOptions,cascadeOptions,fluid.keys(cascadeOptions))}var that={},templates=null;return that.render=function(tree){var cutpointFn=options.cutpointGenerator||"fluid.renderer.selectorsToCutpoints";rendererOptions.cutpoints=rendererOptions.cutpoints||fluid.invokeGlobalFunction(cutpointFn,[selectors,options]),nativeModel&&(rendererOptions.model=parentThat.model);var renderTarget=$(options.renderTarget?options.renderTarget:container);templates?(fluid.clear(rendererOptions.fossils),fluid.reRender(templates,renderTarget,tree,rendererOptions)):("function"==typeof source&&(source=source()),templates=fluid.render(source,renderTarget,tree,rendererOptions))},that},fluid.defaults("fluid.rendererComponent",{gradeNames:["fluid.viewComponent"],initFunction:"fluid.initRendererComponent",mergePolicy:{"rendererOptions.idMap":"nomerge",protoTree:"noexpand, replace",parentBundle:"nomerge","changeApplierOptions.resolverSetConfig":"resolverSetConfig"},invokers:{refreshView:{funcName:"fluid.rendererComponent.refreshView",args:"{that}"},produceTree:{funcName:"fluid.rendererComponent.produceTree",args:"{that}"}},rendererOptions:{autoBind:!0},events:{onResourcesFetched:null,prepareModelForRender:null,onRenderTree:null,afterRender:null},listeners:{onCreate:{funcName:"fluid.rendererComponent.renderOnInit",args:["{that}.options.renderOnInit","{that}"],priority:"last"}}}),fluid.rendererComponent.renderOnInit=function(renderOnInit,that){(renderOnInit||that.renderOnInit)&&that.refreshView()},fluid.protoExpanderForComponent=function(parentThat,options){var expanderOptions=fluid.renderer.modeliseOptions(options.expanderOptions,{ELstyle:"${}"},parentThat);fluid.renderer.reverseMerge(expanderOptions,options,["resolverGetConfig","resolverSetConfig"]);var expander=fluid.renderer.makeProtoExpander(expanderOptions,parentThat);return expander},fluid.rendererComponent.refreshView=function(that){if(!that.renderer)return void(that.renderOnInit=!0);fluid.renderer.clearDecorators(that),that.events.prepareModelForRender.fire(that.model,that.applier,that);var tree=that.produceTree(that),rendererFnOptions=that.renderer.rendererFnOptions;if(!rendererFnOptions.noexpand){var expander=fluid.protoExpanderForComponent(that,rendererFnOptions);tree=expander(tree)}that.events.onRenderTree.fire(that,tree),that.renderer.render(tree),that.events.afterRender.fire(that)},fluid.rendererComponent.produceTree=function(that){var produceTreeOption=that.options.produceTree;return produceTreeOption?("string"==typeof produceTreeOption?fluid.getGlobalValue(produceTreeOption):produceTreeOption)(that):that.options.protoTree},fluid.initRendererComponent=function(componentName,container,options){var that=fluid.initView(componentName,container,options,{gradeNames:["fluid.rendererComponent"]});fluid.getForComponent(that,"model"),fluid.getForComponent(that,"applier"),fluid.diagnoseFailedView(componentName,that,fluid.defaults(componentName),arguments),fluid.fetchResources(that.options.resources,that.events.onResourcesFetched.fire);var messageResolver,rendererOptions=fluid.renderer.modeliseOptions(that.options.rendererOptions,null,that);!rendererOptions.messageSource&&that.options.strings&&(messageResolver=fluid.messageResolver({messageBase:that.options.strings,resolveFunc:that.options.messageResolverFunction,parents:fluid.makeArray(that.options.parentBundle)}),rendererOptions.messageSource={type:"resolver",resolver:messageResolver}),fluid.renderer.reverseMerge(rendererOptions,that.options,["resolverGetConfig","resolverSetConfig"]),that.rendererOptions=rendererOptions;var rendererFnOptions=$.extend({},that.options.rendererFnOptions,{rendererOptions:rendererOptions,repeatingSelectors:that.options.repeatingSelectors,selectorsToIgnore:that.options.selectorsToIgnore,expanderOptions:{envAdd:{styles:that.options.styles}}});that.options.resources&&that.options.resources.template&&(rendererFnOptions.templateSource=function(){return that.options.resources.template.resourceText}),fluid.renderer.reverseMerge(rendererFnOptions,that.options,["resolverGetConfig","resolverSetConfig"]),rendererFnOptions.rendererTargetSelector&&(container=function(){return that.dom.locate(rendererFnOptions.rendererTargetSelector)});var renderer={fossils:{},rendererFnOptions:rendererFnOptions,boundPathForNode:function(node){return fluid.boundPathForNode(node,renderer.fossils)}},rendererSub=fluid.renderer.createRendererSubcomponent(container,that.options.selectors,rendererFnOptions,that,renderer.fossils);return that.renderer=$.extend(renderer,rendererSub),messageResolver&&(that.messageResolver=messageResolver),renderer.refreshView=fluid.getForComponent(that,"refreshView"),that};var removeSelectors=function(selectors,selectorsToIgnore){return fluid.each(fluid.makeArray(selectorsToIgnore),function(selectorToIgnore){delete selectors[selectorToIgnore]}),selectors},markRepeated=function(selectorKey,repeatingSelectors){return repeatingSelectors&&fluid.each(repeatingSelectors,function(repeatingSelector){selectorKey===repeatingSelector&&(selectorKey+=":")}),selectorKey};fluid.renderer.selectorsToCutpoints=function(selectors,options){var togo=[];options=options||{},selectors=fluid.copy(selectors),options.selectorsToIgnore&&(selectors=removeSelectors(selectors,options.selectorsToIgnore));for(var selectorKey in selectors)togo.push({id:markRepeated(selectorKey,options.repeatingSelectors),selector:selectors[selectorKey]});return togo},fluid.renderer.NO_COMPONENT={},fluid.renderer.mergeComponents=function(target,source){for(var key in source)target[key]=source[key];return target},fluid.registerNamespace("fluid.renderer.selection"),fluid.renderer.selection.inputs=function(options,container,key,config){fluid.expect("Selection to inputs expander",options,["selectID","inputID","labelID","rowID"]);var selection=config.expander(options.tree),rows=fluid.transform(selection.optionlist.value,function(option,index){var togo={},element={parentRelativeID:"..::"+options.selectID,choiceindex:index};return togo[options.inputID]=element,togo[options.labelID]=fluid.copy(element),togo}),togo={};return togo[options.selectID]=selection,togo[options.rowID]={children:rows},togo=config.expander(togo)},fluid.renderer.repeat=function(options,container,key,config){fluid.expect("Repetition expander",options,["controlledBy","tree"]);var env=config.threadLocal(),path=fluid.extractContextualPath(options.controlledBy,{ELstyle:"ALL"},env),list=fluid.get(config.model,path,config.resolverGetConfig),togo={};if(!list||0===list.length)return options.ifEmpty?config.expander(options.ifEmpty):togo;var expanded=[];fluid.each(list,function(element,i){var EL=fluid.model.composePath(path,i),envAdd={};options.pathAs&&(envAdd[options.pathAs]="${"+EL+"}"),options.valueAs&&(envAdd[options.valueAs]=fluid.get(config.model,EL,config.resolverGetConfig));var expandrow=fluid.withEnvironment(envAdd,function(){return config.expander(options.tree)},env);fluid.isArrayable(expandrow)?expandrow.length>0&&expanded.push({children:expandrow}):expandrow!==fluid.renderer.NO_COMPONENT&&expanded.push(expandrow)});var repeatID=options.repeatID;return repeatID.indexOf(":")===-1&&(repeatID+=":"),fluid.each(expanded,function(entry){entry.ID=repeatID}),expanded},fluid.renderer.condition=function(options,container,key,config){fluid.expect("Selection to condition expander",options,["condition"]);var condition;if(options.condition.funcName){var args=config.expandLight(options.condition.args);condition=fluid.invokeGlobalFunction(options.condition.funcName,args)}else condition=options.condition.expander?config.expander(options.condition):config.expandLight(options.condition);var tree=condition?options.trueTree:options.falseTree;return tree||(tree=fluid.renderer.NO_COMPONENT),config.expander(tree)},fluid.extractContextualPath=function(string,options,env,externalFetcher){var parsed=fluid.extractELWithContext(string,options);if(parsed)return parsed.context?env[parsed.context]?fluid.transformContextPath(parsed,env).path:{value:externalFetcher(parsed)}:parsed.path},fluid.transformContextPath=function(parsed,env){if(parsed.context){var EL,fetched=env[parsed.context];if("string"==typeof fetched&&(EL=fluid.extractEL(fetched,{ELstyle:"${}"})),EL)return{noDereference:""===parsed.path,path:fluid.model.composePath(EL,parsed.path)}}return parsed},fluid.renderer.makeExternalFetcher=function(contextThat){return function(parsed){var foundComponent=fluid.resolveContext(parsed.context,contextThat);return foundComponent?fluid.getForComponent(foundComponent,parsed.path):void 0}},fluid.renderer.makeProtoExpander=function(expandOptions,parentThat){function fetchEL(string){var env=threadLocal();return fluid.extractContextualPath(string,options,env,options.externalFetcher)}function detectBareBound(entry){return fluid.find(entry,function(value,key){return"decorators"===key})!==!1}var options=$.extend({ELstyle:"${}"},expandOptions);parentThat&&(options.externalFetcher=fluid.renderer.makeExternalFetcher(parentThat));var threadLocal,IDescape=options.IDescape||"\\",expandLight=function(source){return fluid.expand(source,options)},expandBound=function(value,concrete){if(void 0!==value.messagekey)return{componentType:"UIMessage",messagekey:expandBound(value.messagekey),args:expandLight(value.args)};var proto;fluid.isPrimitive(value)||fluid.isArrayable(value)?proto={}:(proto=$.extend({},value),proto.decorators&&(proto.decorators=expandLight(proto.decorators)),value=proto.value,delete proto.value);var EL;if("string"==typeof value){var fetched=fetchEL(value);EL="string"==typeof fetched?fetched:null,value=fluid.get(fetched,"value")||value}return EL?proto.valuebinding=EL:void 0!==value&&(proto.value=value),options.model&&proto.valuebinding&&void 0===proto.value&&(proto.value=fluid.get(options.model,proto.valuebinding,options.resolverGetConfig)),concrete&&(proto.componentType="UIBound"),proto};options.filter=fluid.expander.lightFilter;var expandCond,expandLeafOrCond,expandEntry=function(entry){var comp=[];return expandCond(entry,comp),{children:comp}},expandExternal=function(entry){if(entry===fluid.renderer.NO_COMPONENT)return entry;var singleTarget,target=[],pusher=function(comp){singleTarget=comp};return expandLeafOrCond(entry,target,pusher),singleTarget||target},expandConfig={model:options.model,resolverGetConfig:options.resolverGetConfig,resolverSetConfig:options.resolverSetConfig,expander:expandExternal,expandLight:expandLight},expandLeaf=function(leaf,componentType){var togo={componentType:componentType},map=fluid.renderer.boundMap[componentType]||{};for(var key in leaf)/decorators|args/.test(key)?togo[key]=expandLight(leaf[key]):map[key]?togo[key]=expandBound(leaf[key]):togo[key]=leaf[key];return togo},expandChildren=function(entry,pusher){for(var children=entry.children,i=0;i<children.length;++i){var target=[],comp={children:target},child=children[i],childPusher=function(comp){target[target.length]=comp};expandLeafOrCond(child,target,childPusher),1!==comp.children.length||comp.children[0].ID||(comp=comp.children[0]),pusher(comp)}};return expandLeafOrCond=function(entry,target,pusher){var componentType=fluid.renderer.inferComponentType(entry);componentType||!fluid.isPrimitive(entry)&&!detectBareBound(entry)||(componentType="UIBound"),componentType?pusher("UIBound"===componentType?expandBound(entry,!0):expandLeaf(entry,componentType)):(target||fluid.fail("Illegal cond->cond transition"),expandCond(entry,target))},expandCond=function(proto,target){var key,expandToTarget=function(expander){var expanded=fluid.invokeGlobalFunction(expander.type,[expander,proto,key,expandConfig]);expanded!==fluid.renderer.NO_COMPONENT&&fluid.each(expanded,function(el){target[target.length]=el})},condPusher=function(comp){comp.ID=key,target[target.length]=comp};for(key in proto){var entry=proto[key];if(key.charAt(0)===IDescape&&(key=key.substring(1)),"expander"===key){var expanders=fluid.makeArray(entry);fluid.each(expanders,expandToTarget)}else entry&&(entry.children?(key.indexOf(":")===-1&&(key+=":"),expandChildren(entry,condPusher)):fluid.renderer.isBoundPrimitive(entry)?condPusher(expandBound(entry,!0)):expandLeafOrCond(entry,null,condPusher))}},function(entry){return threadLocal=fluid.threadLocal(function(){return $.extend({},options.envAdd)}),options.fetcher=fluid.makeEnvironmentFetcher(options.model,fluid.transformContextPath,threadLocal,options.externalFetcher),expandConfig.threadLocal=threadLocal,expandEntry(entry)}}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.slidingPanel",{gradeNames:["fluid.viewComponent"],selectors:{panel:".flc-slidingPanel-panel",toggleButton:".flc-slidingPanel-toggleButton",toggleButtonLabel:".flc-slidingPanel-toggleButton"},strings:{showText:"show",hideText:"hide",panelLabel:"panel"},events:{onPanelHide:null,onPanelShow:null,afterPanelHide:null,afterPanelShow:null},listeners:{"onCreate.bindClick":{"this":"{that}.dom.toggleButton",method:"click",args:["{that}.togglePanel"]},"onCreate.bindModelChange":{listener:"{that}.applier.modelChanged.addListener",args:["isShowing","{that}.refreshView"]},"onCreate.setAriaProps":"{that}.setAriaProps","onCreate.setInitialState":{listener:"{that}.refreshView"},"onPanelHide.setText":{"this":"{that}.dom.toggleButtonLabel",method:"text",args:["{that}.options.strings.showText"],priority:"first"},"onPanelHide.setAriaLabel":{"this":"{that}.dom.toggleButtonLabel",method:"attr",args:["aria-label","{that}.options.strings.showTextAriaLabel"]},"onPanelShow.setText":{"this":"{that}.dom.toggleButtonLabel",method:"text",args:["{that}.options.strings.hideText"],priority:"first"},"onPanelShow.setAriaLabel":{"this":"{that}.dom.toggleButtonLabel",method:"attr",args:["aria-label","{that}.options.strings.hideTextAriaLabel"]},"onPanelHide.operate":{listener:"{that}.operateHide"},"onPanelShow.operate":{listener:"{that}.operateShow"},"onCreate.setAriaStates":"{that}.setAriaStates"},members:{panelId:{expander:{funcName:"fluid.allocateSimpleId",args:"{that}.dom.panel"}}},model:{isShowing:!1},modelListeners:{isShowing:{funcName:"{that}.setAriaStates",excludeSource:"init"}},invokers:{operateHide:{"this":"{that}.dom.panel",method:"slideUp",args:["{that}.options.animationDurations.hide","{that}.events.afterPanelHide.fire"]},operateShow:{"this":"{that}.dom.panel",method:"slideDown",args:["{that}.options.animationDurations.show","{that}.events.afterPanelShow.fire"]},hidePanel:{func:"{that}.applier.change",args:["isShowing",!1]},showPanel:{func:"{that}.applier.change",args:["isShowing",!0]},setAriaStates:{funcName:"fluid.slidingPanel.setAriaStates",args:["{that}","{that}.model.isShowing"]},setAriaProps:{funcName:"fluid.slidingPanel.setAriaProperties",args:["{that}","{that}.panelId"]},togglePanel:{funcName:"fluid.slidingPanel.togglePanel",args:["{that}"]},refreshView:{funcName:"fluid.slidingPanel.refreshView",args:["{that}"]}},animationDurations:{hide:400,show:400}}),fluid.slidingPanel.togglePanel=function(that){that.applier.change("isShowing",!that.model.isShowing)},fluid.slidingPanel.refreshView=function(that){that.events[that.model.isShowing?"onPanelShow":"onPanelHide"].fire()},fluid.slidingPanel.setAriaProperties=function(that,panelId){that.locate("toggleButton").attr({role:"button","aria-controls":panelId}),that.locate("panel").attr({"aria-label":that.options.strings.panelLabel,role:"group"})},fluid.slidingPanel.setAriaStates=function(that,isShowing){that.locate("toggleButton").attr("aria-pressed",isShowing),that.locate("panel").attr("aria-expanded",isShowing)}}(jQuery,fluid_2_0_0),function($){function simulateMouseEvent(event,simulatedType){if(!(event.originalEvent.touches.length>1)){event.preventDefault();var touch=event.originalEvent.changedTouches[0],simulatedEvent=document.createEvent("MouseEvents");simulatedEvent.initMouseEvent(simulatedType,!0,!0,window,1,touch.screenX,touch.screenY,touch.clientX,touch.clientY,!1,!1,!1,!1,0,null),event.target.dispatchEvent(simulatedEvent)}}if($.support.touch="ontouchend"in document,$.support.touch){var touchHandled,mouseProto=$.ui.mouse.prototype,_mouseInit=mouseProto._mouseInit;mouseProto._touchStart=function(event){var self=this;!touchHandled&&self._mouseCapture(event.originalEvent.changedTouches[0])&&(touchHandled=!0,self._touchMoved=!1,simulateMouseEvent(event,"mouseover"),simulateMouseEvent(event,"mousemove"),simulateMouseEvent(event,"mousedown"))},mouseProto._touchMove=function(event){touchHandled&&(this._touchMoved=!0,simulateMouseEvent(event,"mousemove"))},mouseProto._touchEnd=function(event){touchHandled&&(simulateMouseEvent(event,"mouseup"),simulateMouseEvent(event,"mouseout"),this._touchMoved||simulateMouseEvent(event,"click"),touchHandled=!1)},mouseProto._mouseInit=function(){var self=this;self.element.bind("touchstart",$.proxy(self,"_touchStart")).bind("touchmove",$.proxy(self,"_touchMove")).bind("touchend",$.proxy(self,"_touchEnd")),_mouseInit.call(self)}}}(jQuery);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.textfieldSlider",{gradeNames:["fluid.viewComponent","fluid.contextAware"],components:{textfield:{type:"fluid.textfieldSlider.textfield",container:"{textfieldSlider}.dom.textfield",options:{model:"{textfieldSlider}.model",range:"{textfieldSlider}.options.range",ariaOptions:"{textfieldSlider}.options.ariaOptions",strings:"{textfieldSlider}.options.strings"}},slider:{container:"{textfieldSlider}.dom.slider",options:{model:"{textfieldSlider}.model",range:"{textfieldSlider}.options.range",sliderOptions:"{textfieldSlider}.options.sliderOptions",ariaOptions:"{textfieldSlider}.options.ariaOptions",strings:"{textfieldSlider}.options.strings"}}},contextAwareness:{sliderVariety:{checks:{jQueryUI:{contextValue:"{fluid.prefsWidgetType}",equals:"jQueryUI",gradeNames:"fluid.textfieldSlider.jQueryUI"}},defaultGradeNames:"fluid.textfieldSlider.nativeHTML"}},selectors:{textfield:".flc-textfieldSlider-field",slider:".flc-textfieldSlider-slider"},model:{value:null},modelRelay:{target:"value",singleTransform:{type:"fluid.transforms.limitRange",input:"{that}.model.value",min:"{that}.options.range.min",max:"{that}.options.range.max"}},range:{min:0,max:100},ariaOptions:{},sliderOptions:{orientation:"horizontal",step:1},strings:{}}),fluid.defaults("fluid.textfieldSlider.nativeHTML",{components:{slider:{type:"fluid.slider.native"}}}),fluid.defaults("fluid.textfieldSlider.jQueryUI",{components:{slider:{type:"fluid.slider.jQuery"}}}),fluid.defaults("fluid.textfieldSlider.textfield",{gradeNames:["fluid.viewComponent"],range:{},modelRelay:{target:"value",singleTransform:{type:"fluid.transforms.stringToNumber",input:"{that}.model.stringValue"}},modelListeners:{value:{"this":"{that}.container",method:"val",args:["{change}.value"]},stringValue:{"this":"{that}.container",method:"val",args:["{that}.model.value"]}},listeners:{"onCreate.bindChangeEvt":{"this":"{that}.container",method:"change",args:["{that}.setModel"]},"onCreate.initTextfieldAttributes":{"this":"{that}.container",method:"attr",args:[{"aria-labelledby":"{that}.options.ariaOptions.aria-labelledby","aria-label":"{that}.options.strings.aria-label"}]}},invokers:{setModel:{changePath:"stringValue",value:"{arguments}.0.target.value"}}}),fluid.defaults("fluid.slider",{gradeNames:["fluid.viewComponent"],range:{}}),fluid.defaults("fluid.slider.native",{gradeNames:["fluid.slider"],modelRelay:{target:"value",singleTransform:{type:"fluid.transforms.stringToNumber",input:"{that}.model.stringValue"}},invokers:{setModel:{changePath:"stringValue",value:{expander:{"this":"{that}.container",method:"val"}}}},listeners:{"onCreate.initSliderAttributes":{"this":"{that}.container",method:"attr",args:[{min:"{that}.options.range.min",max:"{that}.options.range.max",step:"{that}.options.sliderOptions.step",type:"range",value:"{that}.model.value","aria-labelledby":"{that}.options.ariaOptions.aria-labelledby",
"aria-label":"{that}.options.strings.aria-label"}]},"onCreate.bindSlideEvt":{"this":"{that}.container",method:"on",args:["input","{that}.setModel"]},"onCreate.bindRangeChangeEvt":{"this":"{that}.container",method:"on",args:["change","{that}.setModel"]}},modelListeners:{value:[{"this":"{that}.container",method:"val",args:["{change}.value"],excludeSource:"init"}]}}),fluid.defaults("fluid.slider.jQuery",{gradeNames:["fluid.slider"],selectors:{thumb:".ui-slider-handle"},styles:{handle:"fl-slider-handle",range:"fl-slider-range"},members:{slider:{expander:{"this":"{that}.container",method:"slider",args:["{that}.combinedSliderOptions"]}},combinedSliderOptions:{expander:{funcName:"fluid.slider.combineSliderOptions",args:["{that}.options.sliderOptions","{that}.options.range"]}}},sliderOptions:{orientation:"horizontal",step:1,classes:{"ui-slider-handle":"{that}.options.styles.handle","ui-slider-range":"{that}.options.styles.range"}},invokers:{setSliderValue:{"this":"{that}.slider",method:"slider",args:["value","{arguments}.0"]},setSliderAriaValueNow:{"this":"{that}.dom.thumb",method:"attr",args:["aria-valuenow","{arguments}.0"]},setModel:{changePath:"value",value:"{arguments}.1.value"}},listeners:{"onCreate.initSliderAria":{"this":"{that}.dom.thumb",method:"attr",args:[{role:"slider","aria-valuenow":"{that}.combinedSliderOptions.value","aria-valuemin":"{that}.combinedSliderOptions.min","aria-valuemax":"{that}.combinedSliderOptions.max","aria-labelledby":"{that}.options.ariaOptions.aria-labelledby","aria-label":"{that}.options.strings.aria-label"}]},"onCreate.bindSlideEvt":{"this":"{that}.slider",method:"on",args:["slide","{that}.setModel"]}},modelListeners:{value:[{listener:"{that}.setSliderValue",args:["{change}.value"]},{listener:"{that}.setSliderAriaValueNow",args:["{change}.value"]}]}}),fluid.slider.combineSliderOptions=function(sliderOptions,model,range){return $.extend(!0,{},sliderOptions,model,range)}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.tableOfContents"),fluid.tableOfContents.headingTextToAnchorInfo=function(heading){var id=fluid.allocateSimpleId(heading),anchorInfo={id:id,url:"#"+id};return anchorInfo},fluid.tableOfContents.locateHeadings=function(that){var headings=that.locate("headings");return fluid.each(that.options.ignoreForToC,function(sel){headings=headings.not(sel).not(sel+" :header")}),headings},fluid.tableOfContents.refreshView=function(that){var headings=that.locateHeadings();that.anchorInfo=fluid.transform(headings,function(heading){return that.headingTextToAnchorInfo(heading)});var headingsModel=that.modelBuilder.assembleModel(headings,that.anchorInfo);that.applier.change("",headingsModel),that.events.onRefresh.fire()},fluid.defaults("fluid.tableOfContents",{gradeNames:["fluid.viewComponent"],components:{levels:{type:"fluid.tableOfContents.levels",createOnEvent:"onCreate",container:"{tableOfContents}.dom.tocContainer",options:{model:{headings:"{tableOfContents}.model"},events:{afterRender:"{tableOfContents}.events.afterRender"},listeners:{"{tableOfContents}.events.onRefresh":"{that}.refreshView"},strings:"{tableOfContents}.options.strings"}},modelBuilder:{type:"fluid.tableOfContents.modelBuilder"}},model:[],invokers:{headingTextToAnchorInfo:"fluid.tableOfContents.headingTextToAnchorInfo",locateHeadings:{funcName:"fluid.tableOfContents.locateHeadings",args:["{that}"]},refreshView:{funcName:"fluid.tableOfContents.refreshView",args:["{that}"]},hide:{"this":"{that}.dom.tocContainer",method:"hide"},show:{"this":"{that}.dom.tocContainer",method:"show"}},strings:{tocHeader:"Table of Contents"},selectors:{headings:":header:visible",tocContainer:".flc-toc-tocContainer"},ignoreForToC:{tocContainer:"{that}.options.selectors.tocContainer"},events:{onRefresh:null,afterRender:null,onReady:{events:{onCreate:"onCreate",afterRender:"afterRender"},args:["{that}"]}},listeners:{"onCreate.refreshView":"{that}.refreshView"}}),fluid.registerNamespace("fluid.tableOfContents.modelBuilder"),fluid.tableOfContents.modelBuilder.toModel=function(headingInfo,modelLevelFn){var headings=fluid.copy(headingInfo),buildModelLevel=function(headings,level){for(var modelLevel=[];headings.length>0;){var heading=headings[0];if(heading.level<level)break;if(heading.level>level){var subHeadings=buildModelLevel(headings,level+1);modelLevel.length>0?modelLevel[modelLevel.length-1].headings=subHeadings:modelLevel=modelLevelFn(modelLevel,subHeadings)}heading.level===level&&(modelLevel.push(heading),headings.shift())}return modelLevel};return buildModelLevel(headings,1)},fluid.tableOfContents.modelBuilder.gradualModelLevelFn=function(modelLevel,subHeadings){var subHeadingsClone=fluid.copy(subHeadings);return subHeadingsClone[0].level--,subHeadingsClone},fluid.tableOfContents.modelBuilder.skippedModelLevelFn=function(modelLevel,subHeadings){return modelLevel.push({headings:subHeadings}),modelLevel},fluid.tableOfContents.modelBuilder.convertToHeadingObjects=function(that,headings,anchorInfo){return headings=$(headings),fluid.transform(headings,function(heading,index){return{level:that.headingCalculator.getHeadingLevel(heading),text:$(heading).text(),url:anchorInfo[index].url}})},fluid.tableOfContents.modelBuilder.assembleModel=function(that,headings,anchorInfo){var headingInfo=that.convertToHeadingObjects(headings,anchorInfo);return that.toModel(headingInfo)},fluid.defaults("fluid.tableOfContents.modelBuilder",{gradeNames:["fluid.component"],components:{headingCalculator:{type:"fluid.tableOfContents.modelBuilder.headingCalculator"}},invokers:{toModel:{funcName:"fluid.tableOfContents.modelBuilder.toModel",args:["{arguments}.0","{modelBuilder}.modelLevelFn"]},modelLevelFn:"fluid.tableOfContents.modelBuilder.gradualModelLevelFn",convertToHeadingObjects:"fluid.tableOfContents.modelBuilder.convertToHeadingObjects({that}, {arguments}.0, {arguments}.1)",assembleModel:"fluid.tableOfContents.modelBuilder.assembleModel({that}, {arguments}.0, {arguments}.1)"}}),fluid.registerNamespace("fluid.tableOfContents.modelBuilder.headingCalculator"),fluid.tableOfContents.modelBuilder.headingCalculator.getHeadingLevel=function(that,heading){return that.options.levels.indexOf(heading.tagName)+1},fluid.defaults("fluid.tableOfContents.modelBuilder.headingCalculator",{gradeNames:["fluid.component"],invokers:{getHeadingLevel:"fluid.tableOfContents.modelBuilder.headingCalculator.getHeadingLevel({that}, {arguments}.0)"},levels:["H1","H2","H3","H4","H5","H6"]}),fluid.registerNamespace("fluid.tableOfContents.levels"),fluid.tableOfContents.levels.objModel=function(type,ID){var objModel={ID:type+ID+":",children:[]};return objModel},fluid.tableOfContents.levels.handleEmptyItemObj=function(itemObj){itemObj.decorators=[{type:"addClass",classes:"fl-tableOfContents-hide-bullet"}]},fluid.tableOfContents.levels.generateTree=function(headingsModel,currentLevel){currentLevel=currentLevel||0;var levelObj=fluid.tableOfContents.levels.objModel("level",currentLevel);if(0===headingsModel.headings.length)return currentLevel?[]:{children:[]};if(0===currentLevel){var tree={children:[fluid.tableOfContents.levels.generateTree(headingsModel,currentLevel+1)]};return tree}return $.each(headingsModel.headings,function(index,model){var itemObj=fluid.tableOfContents.levels.objModel("items",currentLevel),linkObj={ID:"link"+currentLevel,target:model.url,linktext:model.text};model.level?itemObj.children.push(linkObj):fluid.tableOfContents.levels.handleEmptyItemObj(itemObj),model.headings&&itemObj.children.push(fluid.tableOfContents.levels.generateTree(model,currentLevel+1)),levelObj.children.push(itemObj)}),levelObj},fluid.tableOfContents.levels.produceTree=function(that){var tree=fluid.tableOfContents.levels.generateTree(that.model);return tree.children.push({ID:"tocHeader",messagekey:"tocHeader"}),tree},fluid.tableOfContents.levels.fetchResources=function(that){fluid.fetchResources(that.options.resources,function(){that.container.append(that.options.resources.template.resourceText),that.refreshView()})},fluid.defaults("fluid.tableOfContents.levels",{gradeNames:["fluid.rendererComponent"],produceTree:"fluid.tableOfContents.levels.produceTree",strings:{tocHeader:"Table of Contents"},selectors:{tocHeader:".flc-toc-header",level1:".flc-toc-levels-level1",level2:".flc-toc-levels-level2",level3:".flc-toc-levels-level3",level4:".flc-toc-levels-level4",level5:".flc-toc-levels-level5",level6:".flc-toc-levels-level6",items1:".flc-toc-levels-items1",items2:".flc-toc-levels-items2",items3:".flc-toc-levels-items3",items4:".flc-toc-levels-items4",items5:".flc-toc-levels-items5",items6:".flc-toc-levels-items6",link1:".flc-toc-levels-link1",link2:".flc-toc-levels-link2",link3:".flc-toc-levels-link3",link4:".flc-toc-levels-link4",link5:".flc-toc-levels-link5",link6:".flc-toc-levels-link6"},repeatingSelectors:["level1","level2","level3","level4","level5","level6","items1","items2","items3","items4","items5","items6"],model:{headings:[]},listeners:{"onCreate.fetchResources":"fluid.tableOfContents.levels.fetchResources"},resources:{template:{forceCache:!0,url:"../html/TableOfContents.html"}},rendererFnOptions:{noexpand:!0},rendererOptions:{debugMode:!1}})}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.textToSpeech"),fluid.textToSpeech.isSupported=function(){return!(!window||!window.speechSynthesis)},fluid.textToSpeech.checkTTSSupport=function(delay){var promise=fluid.promise();if(fluid.textToSpeech.isSupported()){var toSpeak=new SpeechSynthesisUtterance("short");toSpeak.volume=0;var timeout=setTimeout(function(){fluid.textToSpeech.deferredSpeechSynthesisControl("cancel"),promise.reject()},delay||5e3);toSpeak.onend=function(){clearTimeout(timeout),fluid.textToSpeech.deferredSpeechSynthesisControl("cancel"),promise.resolve()},fluid.textToSpeech.deferredSpeechSynthesisControl("speak",toSpeak)}else setTimeout(promise.reject,0);return promise},fluid.defaults("fluid.textToSpeech",{gradeNames:["fluid.modelComponent"],events:{onStart:null,onStop:null,onError:null,onSpeechQueued:null},members:{queue:[]},model:{utteranceOpts:{}},modelListeners:{speaking:{listener:"fluid.textToSpeech.speak",args:["{that}","{change}.value"]},pauseRequested:{listener:"fluid.textToSpeech.requestControl",args:["{that}","pause","{change}"]},resumeRequested:{listener:"fluid.textToSpeech.requestControl",args:["{that}","resume","{change}"]}},invokers:{queueSpeech:{funcName:"fluid.textToSpeech.queueSpeech",args:["{that}","{arguments}.0","{arguments}.1","{arguments}.2"]},cancel:{funcName:"fluid.textToSpeech.cancel",args:["{that}"]},pause:{changePath:"pauseRequested",value:!0},resume:{changePath:"resumeRequested",value:!0},getVoices:{"this":"speechSynthesis",method:"getVoices"},handleStart:{changePath:"speaking",value:!0},handleEnd:{funcName:"fluid.textToSpeech.handleEnd",args:["{that}"]},handleError:"{that}.events.onError.fire",handlePause:{changePath:"paused",value:!0},handleResume:{changePath:"paused",value:!1}}}),fluid.textToSpeech.deferredSpeechSynthesisControl=function(control,args){setTimeout(function(){speechSynthesis[control](args)},1)},fluid.textToSpeech.throttle=function(func,wait,options){var timeout,context,args,result,previous=0;options||(options={});var later=function(){previous=options.leading===!1?0:(new Date).getTime(),timeout=null,result=func.apply(context,args),timeout||(context=args=null)},throttled=function(){var now=(new Date).getTime();previous||options.leading!==!1||(previous=now);var remaining=wait-(now-previous);return context=this,args=arguments,remaining<=0||remaining>wait?(timeout&&(clearTimeout(timeout),timeout=null),previous=now,result=func.apply(context,args),timeout||(context=args=null)):timeout||options.trailing===!1||(timeout=setTimeout(later,remaining)),result};return throttled.cancel=function(){clearTimeout(timeout),previous=0,timeout=context=args=null},throttled},fluid.textToSpeech.throttleControl=fluid.textToSpeech.throttle(fluid.textToSpeech.deferredSpeechSynthesisControl,100,{leading:!1}),fluid.textToSpeech.speak=function(that,speaking){that.events[speaking?"onStart":"onStop"].fire()},fluid.textToSpeech.requestControl=function(that,control,change){change.value&&(that.applier.change(change.path,!1),fluid.textToSpeech.throttleControl(control))},fluid.textToSpeech.handleEnd=function(that){that.queue.shift();var resetValues={speaking:!1,pending:!1,paused:!1};if(that.queue.length)that.applier.change("pending",!0);else if(!that.queue.length){var newModel=$.extend({},that.model,resetValues);that.applier.change("",newModel)}},fluid.textToSpeech.queueSpeech=function(that,text,interrupt,options){interrupt&&that.cancel();var errorFn=function(){that.handleError(text)},toSpeak=new SpeechSynthesisUtterance(text),eventBinding={onstart:that.handleStart,onend:that.handleEnd,onerror:errorFn,onpause:that.handlePause,onresume:that.handleResume};$.extend(toSpeak,that.model.utteranceOpts,options,eventBinding),that.queue.push({text:text,utterance:toSpeak}),that.events.onSpeechQueued.fire(text),fluid.textToSpeech.deferredSpeechSynthesisControl("speak",toSpeak)},fluid.textToSpeech.cancel=function(that){that.queue=[],fluid.textToSpeech.deferredSpeechSynthesisControl("cancel")}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.url"),fluid.url.generateDepth=function(depth){return fluid.generate(depth,"../").join("")},fluid.url.parsePathInfo=function(pathInfo){var togo={},segs=pathInfo.split("/");if(segs.length>0){var top=segs.length-1,dotpos=segs[top].indexOf(".");dotpos!==-1&&(togo.extension=segs[top].substring(dotpos+1),segs[top]=segs[top].substring(0,dotpos))}return togo.pathInfo=segs,togo},fluid.url.parsePathInfoTrim=function(pathInfo){var togo=fluid.url.parsePathInfo(pathInfo);return""===togo.pathInfo[togo.pathInfo.length-1]&&togo.pathInfo.length--,togo},fluid.url.collapseSegs=function(segs,from,to){var togo="";void 0===from&&(from=0),void 0===to&&(to=segs.length);for(var i=from;i<to-1;++i)togo+=segs[i]+"/";return to>from&&(togo+=segs[to-1]),togo},fluid.url.makeRelPath=function(parsed,index){var togo=fluid.kettle.collapseSegs(parsed.pathInfo,index);return parsed.extension&&(togo+="."+parsed.extension),togo},fluid.url.cononocolosePath=function(pathInfo){for(var consume=0,i=0;i<pathInfo.length;++i)".."===pathInfo[i]?++consume:0!==consume&&(pathInfo.splice(i-2*consume,2*consume),i-=2*consume,consume=0);return pathInfo},fluid.url.parseUri=function(str){for(var o=fluid.url.parseUri.options,m=o.parser[o.strictMode?"strict":"loose"].exec(str),uri={},i=14;i--;)uri[o.key[i]]=m[i]||"";return uri[o.q.name]={},uri[o.key[12]].replace(o.q.parser,function($0,$1,$2){$1&&(uri[o.q.name][$1]=$2)}),uri},fluid.url.parseUri.options={strictMode:!0,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},fluid.url.parseSegs=function(url){var parsed=fluid.url.parseUri(url),parsedSegs=fluid.url.parsePathInfoTrim(parsed.directory);return parsedSegs.pathInfo},fluid.url.isAbsoluteUrl=function(url){var parseRel=fluid.url.parseUri(url);return parseRel.host||parseRel.protocol||"/"===parseRel.directory.charAt(0)},fluid.url.computeRelativePrefix=function(outerLocation,iframeLocation,relPath){if(fluid.url.isAbsoluteUrl(relPath))return relPath;var relSegs=fluid.url.parsePathInfo(relPath).pathInfo,parsedOuter=fluid.url.parseSegs(outerLocation),parsedRel=parsedOuter.concat(relSegs);fluid.url.cononocolosePath(parsedRel);for(var parsedInner=fluid.url.parseSegs(iframeLocation),seg=0;seg<parsedRel.length&&parsedRel[seg]===parsedInner[seg];++seg);var excess=parsedInner.length-seg,back=fluid.url.generateDepth(excess),front=fluid.url.collapseSegs(parsedRel,seg);return back+front}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.dataSource",{gradeNames:["fluid.component"],invokers:{get:"fluid.notImplemented",set:"fluid.notImplemented"}}),fluid.defaults("fluid.prefs.store",{gradeNames:["fluid.prefs.dataSource","fluid.contextAware"],contextAwareness:{strategy:{defaultGradeNames:"fluid.prefs.cookieStore"}}}),fluid.defaults("fluid.prefs.cookieStore",{gradeNames:["fluid.prefs.store"],cookie:{name:"fluid-ui-settings",path:"/",expires:""},invokers:{get:{funcName:"fluid.prefs.cookieStore.get",args:"{that}.options.cookie.name"},set:{funcName:"fluid.prefs.cookieStore.set",args:["{arguments}.0","{that}.options.cookie"]}}}),fluid.prefs.cookieStore.get=function(cookieName){var cookie=document.cookie;if(!(cookie.length<=0)){var cookiePrefix=cookieName+"=",startIndex=cookie.indexOf(cookiePrefix);if(!(startIndex<0)){startIndex+=cookiePrefix.length;var endIndex=cookie.indexOf(";",startIndex);endIndex<startIndex&&(endIndex=cookie.length);var togo,cookieSection=cookie.substring(startIndex,endIndex);try{togo=JSON.parse(decodeURIComponent(cookieSection))}catch(e){fluid.log("Error parsing cookie "+cookieSection+" as JSON - clearing"),document.cookie=""}return togo}}},fluid.prefs.cookieStore.assembleCookie=function(cookieOptions){var cookieStr=cookieOptions.name+"="+cookieOptions.data;return cookieOptions.expires&&(cookieStr+="; expires="+cookieOptions.expires),cookieOptions.path&&(cookieStr+="; path="+cookieOptions.path),cookieStr},fluid.prefs.cookieStore.set=function(settings,cookieOptions){cookieOptions.data=encodeURIComponent(JSON.stringify(settings)),document.cookie=fluid.prefs.cookieStore.assembleCookie(cookieOptions)},fluid.defaults("fluid.prefs.tempStore",{gradeNames:["fluid.prefs.store","fluid.modelComponent"],invokers:{get:{funcName:"fluid.identity",args:"{that}.model"},set:{funcName:"fluid.prefs.tempStore.set",args:["{arguments}.0","{that}.applier"]}}}),fluid.prefs.tempStore.set=function(settings,applier){applier.fireChangeRequest({path:"",type:"DELETE"}),applier.change("",settings)},fluid.defaults("fluid.prefs.globalSettingsStore",{gradeNames:["fluid.component"],components:{settingsStore:{type:"fluid.prefs.store",options:{gradeNames:["fluid.resolveRootSingle"],singleRootType:"fluid.prefs.store"}}}})}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.initialModel",{gradeNames:["fluid.component"],members:{initialModel:{preferences:{}}}}),fluid.defaults("fluid.uiEnhancer",{gradeNames:["fluid.viewComponent"],invokers:{updateModel:{func:"{that}.applier.change",args:["","{arguments}.0"]}},userGrades:"@expand:fluid.prefs.filterEnhancerGrades({that}.options.gradeNames)"}),fluid.defaults("fluid.uiEnhancer.root",{gradeNames:["fluid.uiEnhancer","fluid.resolveRootSingle"],singleRootType:"fluid.uiEnhancer"}),fluid.uiEnhancer.ignorableGrades=["fluid.uiEnhancer","fluid.uiEnhancer.root","fluid.resolveRoot","fluid.resolveRootSingle"],fluid.prefs.filterEnhancerGrades=function(gradeNames){return fluid.remove_if(fluid.makeArray(gradeNames),function(gradeName){return fluid.frameworkGrades.indexOf(gradeName)!==-1||fluid.uiEnhancer.ignorableGrades.indexOf(gradeName)!==-1})},fluid.prefs.filterEnhancerOptions=function(options){return fluid.filterKeys(options,["classnameMap","fontSizeMap","tocTemplate","components"])},fluid.defaults("fluid.pageEnhancer",{gradeNames:["fluid.component","fluid.originalEnhancerOptions","fluid.prefs.initialModel","fluid.prefs.settingsGetter","fluid.resolveRootSingle"],distributeOptions:{source:"{that}.options.uiEnhancer",target:"{that > uiEnhancer}.options"},singleRootType:"fluid.pageEnhancer",components:{uiEnhancer:{type:"fluid.uiEnhancer.root",container:"body"}},originalUserOptions:"@expand:fluid.prefs.filterEnhancerOptions({uiEnhancer}.options)",listeners:{"onCreate.initModel":"fluid.pageEnhancer.init"}}),fluid.pageEnhancer.init=function(that){that.uiEnhancer.updateModel(fluid.get(that.getSettings(),"preferences"))}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.prefsEditorLoader",{gradeNames:["fluid.prefs.settingsGetter","fluid.prefs.initialModel","fluid.viewComponent"],defaultLocale:"en",members:{settings:{expander:{funcName:"fluid.prefs.prefsEditorLoader.getCompleteSettings",args:["{that}.initialModel","{that}.getSettings"]}}},components:{prefsEditor:{priority:"last",type:"fluid.prefs.prefsEditor",createOnEvent:"onCreatePrefsEditorReady",options:{members:{initialModel:"{prefsEditorLoader}.initialModel"},invokers:{getSettings:"{prefsEditorLoader}.getSettings"}}},templateLoader:{type:"fluid.resourceLoader",options:{events:{onResourcesLoaded:"{prefsEditorLoader}.events.onPrefsEditorTemplatesLoaded"}}},messageLoader:{type:"fluid.resourceLoader",options:{defaultLocale:"{prefsEditorLoader}.options.defaultLocale",locale:"{prefsEditorLoader}.settings.locale",resourceOptions:{dataType:"json"},events:{onResourcesLoaded:"{prefsEditorLoader}.events.onPrefsEditorMessagesLoaded"}}}},events:{onPrefsEditorTemplatesLoaded:null,onPrefsEditorMessagesLoaded:null,onCreatePrefsEditorReady:{events:{templateLoaded:"onPrefsEditorTemplatesLoaded",prefsEditorMessagesLoaded:"onPrefsEditorMessagesLoaded"}}},distributeOptions:[{source:"{that}.options.templateLoader",removeSource:!0,target:"{that > templateLoader}.options"},{source:"{that}.options.messageLoader",removeSource:!0,target:"{that > messageLoader}.options"},{source:"{that}.options.terms",target:"{that > templateLoader}.options.terms"},{source:"{that}.options.terms",target:"{that > messageLoader}.options.terms"},{source:"{that}.options.prefsEditor",removeSource:!0,target:"{that > prefsEditor}.options"}]}),fluid.prefs.prefsEditorLoader.getCompleteSettings=function(initialModel,getSettingsFunc){var savedSettings=getSettingsFunc();return $.extend(!0,{},initialModel,savedSettings)},fluid.defaults("fluid.prefs.transformDefaultPanelsOptions",{gradeNames:["fluid.viewComponent"],distributeOptions:[{source:"{that}.options.textSize",removeSource:!0,target:"{that textSize}.options"},{source:"{that}.options.lineSpace",removeSource:!0,target:"{that lineSpace}.options"},{source:"{that}.options.textFont",removeSource:!0,target:"{that textFont}.options"},{source:"{that}.options.contrast",removeSource:!0,target:"{that contrast}.options"},{source:"{that}.options.layoutControls",removeSource:!0,target:"{that layoutControls}.options"},{source:"{that}.options.linksControls",removeSource:!0,target:"{that linksControls}.options"}]}),fluid.defaults("fluid.prefs.settingsGetter",{gradeNames:["fluid.component"],members:{getSettings:"{fluid.prefs.store}.get"}}),fluid.defaults("fluid.prefs.settingsSetter",{gradeNames:["fluid.component"],invokers:{setSettings:{funcName:"fluid.prefs.settingsSetter.setSettings",args:["{arguments}.0","{fluid.prefs.store}.set"]}}}),fluid.prefs.settingsSetter.setSettings=function(model,set){var userSettings=fluid.copy(model);set(userSettings)},fluid.defaults("fluid.prefs.uiEnhancerRelay",{gradeNames:["fluid.modelComponent"],listeners:{"onCreate.addListener":"{that}.addListener","onDestroy.removeListener":"{that}.removeListener"},events:{updateEnhancerModel:"{fluid.prefs.prefsEditor}.events.onUpdateEnhancerModel"},invokers:{addListener:{funcName:"fluid.prefs.uiEnhancerRelay.addListener",args:["{that}.events.updateEnhancerModel","{that}.updateEnhancerModel"]},removeListener:{funcName:"fluid.prefs.uiEnhancerRelay.removeListener",args:["{that}.events.updateEnhancerModel","{that}.updateEnhancerModel"]},updateEnhancerModel:{funcName:"fluid.prefs.uiEnhancerRelay.updateEnhancerModel",args:["{uiEnhancer}","{fluid.prefs.prefsEditor}.model.preferences"]}}}),fluid.prefs.uiEnhancerRelay.addListener=function(modelChanged,listener){modelChanged.addListener(listener)},fluid.prefs.uiEnhancerRelay.removeListener=function(modelChanged,listener){modelChanged.removeListener(listener)},fluid.prefs.uiEnhancerRelay.updateEnhancerModel=function(uiEnhancer,newModel){uiEnhancer.updateModel(newModel)},fluid.defaults("fluid.prefs.prefsEditor",{gradeNames:["fluid.prefs.settingsGetter","fluid.prefs.settingsSetter","fluid.prefs.initialModel","fluid.viewComponent"],invokers:{fetch:{funcName:"fluid.prefs.prefsEditor.fetch",args:["{that}","{arguments}.0"]},applyChanges:{funcName:"fluid.prefs.prefsEditor.applyChanges",args:["{that}"]},save:{funcName:"fluid.prefs.prefsEditor.save",args:["{that}"]},saveAndApply:{funcName:"fluid.prefs.prefsEditor.saveAndApply",args:["{that}"]},reset:{funcName:"fluid.prefs.prefsEditor.reset",args:["{that}"]},cancel:{funcName:"fluid.prefs.prefsEditor.cancel",args:["{that}"]}},selectors:{cancel:".flc-prefsEditor-cancel",reset:".flc-prefsEditor-reset",save:".flc-prefsEditor-save",previewFrame:".flc-prefsEditor-preview-frame"},events:{onSave:null,onCancel:null,beforeReset:null,afterReset:null,onAutoSave:null,modelChanged:null,onPrefsEditorRefresh:null,onUpdateEnhancerModel:null,onPrefsEditorMarkupReady:null,onReady:null},listeners:{"onCreate.init":"fluid.prefs.prefsEditor.init","onAutoSave.save":"{that}.save"},modelListeners:{"":[{listener:"fluid.prefs.prefsEditor.handleAutoSave",args:["{that}"]},{listener:"{that}.events.modelChanged.fire",args:["{change}.value"]}]},resources:{template:"{templateLoader}.resources.prefsEditor"},autoSave:!1}),fluid.prefs.prefsEditor.applyChanges=function(that){that.events.onUpdateEnhancerModel.fire()},fluid.prefs.prefsEditor.fetch=function(that,eventName){var completeModel=that.getSettings();completeModel=$.extend(!0,{},that.initialModel,completeModel),that.applier.change("",completeModel),eventName&&that.events[eventName].fire(that),that.events.onPrefsEditorRefresh.fire(),that.applyChanges()},fluid.prefs.prefsEditor.save=function(that){if(that.model){var modelToSave=fluid.copy(that.model),initialModel=that.initialModel,stats={changes:0,unchanged:0,changeMap:{}},changedPrefs={};return fluid.model.diff(modelToSave.preferences,fluid.get(initialModel,["preferences"]),stats),0===stats.changes?delete modelToSave.preferences:(fluid.each(stats.changeMap,function(state,pref){fluid.set(changedPrefs,pref,modelToSave.preferences[pref])}),modelToSave.preferences=changedPrefs),that.events.onSave.fire(modelToSave),that.setSettings(modelToSave),modelToSave}},fluid.prefs.prefsEditor.saveAndApply=function(that){var prevSettings=that.getSettings(),changedSelections=that.save();fluid.model.diff(fluid.get(changedSelections,"preferences"),fluid.get(prevSettings,"preferences"))||(that.events.onPrefsEditorRefresh.fire(),that.applyChanges())},fluid.prefs.prefsEditor.reset=function(that){that.events.beforeReset.fire(that),that.applier.fireChangeRequest({path:"",type:"DELETE"}),that.applier.change("",fluid.copy(that.initialModel)),that.events.onPrefsEditorRefresh.fire(),that.events.afterReset.fire(that)},fluid.prefs.prefsEditor.cancel=function(that){that.events.onCancel.fire(),that.fetch()},fluid.prefs.prefsEditor.finishInit=function(that){var bindHandlers=function(that){var saveButton=that.locate("save");if(saveButton.length>0){saveButton.click(that.saveAndApply);var form=fluid.findForm(saveButton);$(form).submit(function(){that.saveAndApply()})}that.locate("reset").click(that.reset),that.locate("cancel").click(that.cancel)};that.container.append(that.options.resources.template.resourceText),bindHandlers(that),that.fetch("onPrefsEditorMarkupReady"),that.events.onReady.fire(that)},fluid.prefs.prefsEditor.handleAutoSave=function(that){that.options.autoSave&&that.events.onAutoSave.fire()},fluid.prefs.prefsEditor.init=function(that){setTimeout(function(){fluid.isDestroyed(that)||fluid.prefs.prefsEditor.finishInit(that)},1)},fluid.defaults("fluid.prefs.preview",{gradeNames:["fluid.viewComponent"],components:{enhancer:{type:"fluid.uiEnhancer",container:"{preview}.enhancerContainer",createOnEvent:"onReady"},templateLoader:"{templateLoader}"},invokers:{updateModel:{funcName:"fluid.prefs.preview.updateModel",args:["{preview}","{prefsEditor}.model.preferences"]}},events:{onReady:null},listeners:{"onCreate.startLoadingContainer":"fluid.prefs.preview.startLoadingContainer","{prefsEditor}.events.modelChanged":"{that}.updateModel","onReady.updateModel":"{that}.updateModel"},templateUrl:"%prefix/PrefsEditorPreview.html"}),fluid.prefs.preview.updateModel=function(that,preferences){setTimeout(function(){that.enhancer&&that.enhancer.updateModel(preferences)},0)},fluid.prefs.preview.startLoadingContainer=function(that){var templateUrl=that.templateLoader.transformURL(that.options.templateUrl);that.container.on("load",function(){that.enhancerContainer=$("body",that.container.contents()),that.events.onReady.fire()}),that.container.attr("src",templateUrl)}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.msgLookup",{gradeNames:["fluid.component"],members:{msgLookup:{expander:{funcName:"fluid.prefs.stringLookup",args:["{msgResolver}","{that}.options.stringArrayIndex"]}}},stringArrayIndex:{}}),fluid.prefs.stringLookup=function(messageResolver,stringArrayIndex){var that={id:fluid.allocateGuid()};return that.singleLookup=function(value){var looked=messageResolver.lookup([value]);return fluid.get(looked,"template")},that.multiLookup=function(values){return fluid.transform(values,function(value){return that.singleLookup(value)})},that.lookup=function(value){var values=fluid.get(stringArrayIndex,value)||value,lookupFn=fluid.isArrayable(values)?"multiLookup":"singleLookup";return that[lookupFn](values)},that.resolvePathSegment=that.lookup,that},fluid.defaults("fluid.prefs.panel",{gradeNames:["fluid.prefs.msgLookup","fluid.rendererComponent"],events:{onDomBind:null},listeners:{"onCreate.onDomBind":"{that}.events.onDomBind"},components:{msgResolver:{type:"fluid.messageResolver"}},rendererOptions:{messageLocator:"{msgResolver}.resolve"},distributeOptions:{source:"{that}.options.messageBase",target:"{that > msgResolver}.options.messageBase"}}),fluid.defaults("fluid.prefs.subPanel",{gradeNames:["fluid.prefs.panel","{that}.getDomBindGrade"],listeners:{"{compositePanel}.events.afterRender":{listener:"{that}.events.afterRender",args:["{that}"]},"onCreate.onDomBind":null,"afterRender.onDomBind":"{that}.resetDomBinder"},rules:{expander:{func:"fluid.prefs.subPanel.generateRules",args:["{that}.options.preferenceMap"]}},invokers:{refreshView:"{compositePanel}.refreshView",resetDomBinder:{funcName:"fluid.prefs.subPanel.resetDomBinder",args:["{that}"]},getDomBindGrade:{funcName:"fluid.prefs.subPanel.getDomBindGrade",args:["{prefsEditor}"]}},strings:{},parentBundle:"{compositePanel}.messageResolver",renderOnInit:!1}),fluid.defaults("fluid.prefs.subPanel.domBind",{gradeNames:["fluid.component"],listeners:{"onDomBind.domChange":{listener:"{prefsEditor}.events.onSignificantDOMChange"}}}),fluid.prefs.subPanel.getDomBindGrade=function(prefsEditor){var hasListener=void 0!==fluid.get(prefsEditor,"options.events.onSignificantDOMChange");if(hasListener)return"fluid.prefs.subPanel.domBind"},fluid.prefs.subPanel.resetDomBinder=function(that){var userJQuery=that.container.constructor,context=that.container[0].ownerDocument,selector=that.container.selector;that.container=userJQuery(selector,context),that.container.selector=selector,that.container.context=context,0===that.container.length&&fluid.fail("resetDomBinder got no elements in DOM for container searching for selector "+that.container.selector),fluid.initDomBinder(that,that.options.selectors),that.events.onDomBind.fire(that)},fluid.prefs.subPanel.safePrefKey=function(prefKey){return prefKey.replace(/[.]/g,"_")},fluid.prefs.subPanel.generateRules=function(preferenceMap){var rules={};return fluid.each(preferenceMap,function(prefObj,prefKey){fluid.each(prefObj,function(value,prefRule){0===prefRule.indexOf("model.")&&(rules[fluid.prefs.subPanel.safePrefKey(prefKey)]=prefRule.slice("model.".length));
})}),rules},fluid.registerNamespace("fluid.prefs.compositePanel"),fluid.prefs.compositePanel.arrayMergePolicy=function(target,source){return target=fluid.makeArray(target),source=fluid.makeArray(source),fluid.each(source,function(selector){target.indexOf(selector)<0&&target.push(selector)}),target},fluid.defaults("fluid.prefs.compositePanel",{gradeNames:["fluid.prefs.panel","{that}.getDistributeOptionsGrade","{that}.getSubPanelLifecycleBindings"],mergePolicy:{subPanelOverrides:"noexpand",selectorsToIgnore:fluid.prefs.compositePanel.arrayMergePolicy},selectors:{},selectorsToIgnore:[],repeatingSelectors:[],events:{initSubPanels:null},listeners:{"onCreate.combineResources":"{that}.combineResources","onCreate.appendTemplate":{"this":"{that}.container",method:"append",args:["{that}.options.resources.template.resourceText"]},"onCreate.initSubPanels":"{that}.events.initSubPanels","onCreate.hideInactive":"{that}.hideInactive","onCreate.surfaceSubpanelRendererSelectors":"{that}.surfaceSubpanelRendererSelectors","afterRender.hideInactive":"{that}.hideInactive"},invokers:{getDistributeOptionsGrade:{funcName:"fluid.prefs.compositePanel.assembleDistributeOptions",args:["{that}.options.components"]},getSubPanelLifecycleBindings:{funcName:"fluid.prefs.compositePanel.subPanelLifecycleBindings",args:["{that}.options.components"]},combineResources:{funcName:"fluid.prefs.compositePanel.combineTemplates",args:["{that}.options.resources","{that}.options.selectors"]},surfaceSubpanelRendererSelectors:{funcName:"fluid.prefs.compositePanel.surfaceSubpanelRendererSelectors",args:["{that}","{that}.options.components","{that}.options.selectors"]},produceSubPanelTrees:{funcName:"fluid.prefs.compositePanel.produceSubPanelTrees",args:["{that}"]},expandProtoTree:{funcName:"fluid.prefs.compositePanel.expandProtoTree",args:["{that}"]},produceTree:{funcName:"fluid.prefs.compositePanel.produceTree",args:["{that}"]},hideInactive:{funcName:"fluid.prefs.compositePanel.hideInactive",args:["{that}"]},handleRenderOnPreference:{funcName:"fluid.prefs.compositePanel.handleRenderOnPreference",args:["{that}","{that}.refreshView","{that}.conditionalCreateEvent","{arguments}.0","{arguments}.1","{arguments}.2"]},conditionalCreateEvent:{funcName:"fluid.prefs.compositePanel.conditionalCreateEvent"}},subPanelOverrides:{gradeNames:["fluid.prefs.subPanel"]},rendererFnOptions:{noexpand:!0,cutpointGenerator:"fluid.prefs.compositePanel.cutpointGenerator",subPanelRepeatingSelectors:{expander:{funcName:"fluid.prefs.compositePanel.surfaceRepeatingSelectors",args:["{that}.options.components"]}}},components:{},resources:{}}),fluid.prefs.compositePanel.prefetchComponentOptions=function(type,options){var baseOptions=fluid.getMergedDefaults(type,fluid.get(options,"gradeNames"));return fluid.merge(baseOptions.mergePolicy,fluid.copy(baseOptions),options)},fluid.prefs.compositePanel.isPanel=function(type,options){var opts=fluid.prefs.compositePanel.prefetchComponentOptions(type,options);return fluid.hasGrade(opts,"fluid.prefs.panel")},fluid.prefs.compositePanel.isActivePanel=function(comp){return comp&&fluid.hasGrade(comp.options,"fluid.prefs.panel")},fluid.prefs.compositePanel.assembleDistributeOptions=function(components){var gradeName="fluid.prefs.compositePanel.distributeOptions_"+fluid.allocateGuid(),distributeOptions=[],relayOption={};return fluid.each(components,function(componentOptions,componentName){fluid.prefs.compositePanel.isPanel(componentOptions.type,componentOptions.options)&&distributeOptions.push({source:"{that}.options.subPanelOverrides",target:"{that > "+componentName+"}.options"});var componentRelayRules={},definedOptions=fluid.prefs.compositePanel.prefetchComponentOptions(componentOptions.type,componentOptions.options),preferenceMap=fluid.get(definedOptions,["preferenceMap"]);fluid.each(preferenceMap,function(prefObj,prefKey){fluid.each(prefObj,function(value,prefRule){0===prefRule.indexOf("model.")&&fluid.set(componentRelayRules,prefRule.slice("model.".length),"{compositePanel}.model."+fluid.prefs.subPanel.safePrefKey(prefKey))})}),relayOption[componentName]=componentRelayRules,distributeOptions.push({source:"{that}.options.relayOption."+componentName,target:"{that > "+componentName+"}.options.model"})}),fluid.defaults(gradeName,{gradeNames:["fluid.component"],relayOption:relayOption,distributeOptions:distributeOptions}),gradeName},fluid.prefs.compositePanel.conditionalCreateEvent=function(value,createEvent){value&&createEvent()},fluid.prefs.compositePanel.handleRenderOnPreference=function(that,refreshViewFunc,conditionalCreateEventFunc,value,createEvent,componentNames){componentNames=fluid.makeArray(componentNames),conditionalCreateEventFunc(value,createEvent),fluid.each(componentNames,function(componentName){var comp=that[componentName];!value&&comp&&comp.destroy()}),refreshViewFunc()},fluid.prefs.compositePanel.creationEventName=function(pref){return"initOn_"+pref},fluid.prefs.compositePanel.generateModelListeners=function(conditionals){return fluid.transform(conditionals,function(componentNames,pref){var eventName=fluid.prefs.compositePanel.creationEventName(pref);return{func:"{that}.handleRenderOnPreference",args:["{change}.value","{that}.events."+eventName+".fire",componentNames]}})},fluid.prefs.compositePanel.subPanelLifecycleBindings=function(components){var gradeName="fluid.prefs.compositePanel.subPanelCreationTimingDistibution_"+fluid.allocateGuid(),distributeOptions=[],subPanelCreationOpts={"default":"initSubPanels"},conditionals={},listeners={},events={};return fluid.each(components,function(componentOptions,componentName){if(fluid.prefs.compositePanel.isPanel(componentOptions.type,componentOptions.options)){var creationEventOpt="default",renderOnPreference=fluid.get(componentOptions,"options.renderOnPreference");if(renderOnPreference){var pref=fluid.prefs.subPanel.safePrefKey(renderOnPreference),onCreateListener="onCreate."+pref;creationEventOpt=fluid.prefs.compositePanel.creationEventName(pref),subPanelCreationOpts[creationEventOpt]=creationEventOpt,events[creationEventOpt]=null,conditionals[pref]=conditionals[pref]||[],conditionals[pref].push(componentName),listeners[onCreateListener]={listener:"{that}.conditionalCreateEvent",args:["{that}.model."+pref,"{that}.events."+creationEventOpt+".fire"]}}distributeOptions.push({source:"{that}.options.subPanelCreationOpts."+creationEventOpt,target:"{that}.options.components."+componentName+".createOnEvent"})}}),fluid.defaults(gradeName,{gradeNames:["fluid.component"],events:events,listeners:listeners,modelListeners:fluid.prefs.compositePanel.generateModelListeners(conditionals),subPanelCreationOpts:subPanelCreationOpts,distributeOptions:distributeOptions}),gradeName},fluid.prefs.compositePanel.hideInactive=function(that){fluid.each(that.options.components,function(componentOpts,componentName){fluid.prefs.compositePanel.isPanel(componentOpts.type,componentOpts.options)&&!fluid.prefs.compositePanel.isActivePanel(that[componentName])&&that.locate(componentName).hide()})},fluid.prefs.compositePanel.combineTemplates=function(resources,selectors){var cutpoints=[],tree={children:[]};fluid.each(resources,function(resource,resourceName){"template"!==resourceName&&(tree.children.push({ID:resourceName,markup:resource.resourceText}),cutpoints.push({id:resourceName,selector:selectors[resourceName]}))});var resourceSpec={base:{resourceText:resources.template.resourceText,href:".",resourceKey:".",cutpoints:cutpoints}},templates=fluid.parseTemplates(resourceSpec,["base"]),renderer=fluid.renderer(templates,tree,{cutpoints:cutpoints,debugMode:!0});resources.template.resourceText=renderer.renderTemplates()},fluid.prefs.compositePanel.rebaseSelectorName=function(memberName,selectorName){return memberName+"_"+selectorName},fluid.prefs.compositePanel.surfaceSubpanelRendererSelectors=function(that,components,selectors){fluid.each(components,function(compOpts,compName){if(fluid.prefs.compositePanel.isPanel(compOpts.type,compOpts.options)){var opts=fluid.prefs.compositePanel.prefetchComponentOptions(compOpts.type,compOpts.options);fluid.each(opts.selectors,function(selector,selName){(!opts.selectorsToIgnore||opts.selectorsToIgnore.indexOf(selName)<0)&&fluid.set(selectors,fluid.prefs.compositePanel.rebaseSelectorName(compName,selName),selectors[compName]+" "+selector)})}})},fluid.prefs.compositePanel.surfaceRepeatingSelectors=function(components){var repeatingSelectors=[];return fluid.each(components,function(compOpts,compName){if(fluid.prefs.compositePanel.isPanel(compOpts.type,compOpts.options)){var opts=fluid.prefs.compositePanel.prefetchComponentOptions(compOpts.type,compOpts.options),rebasedRepeatingSelectors=fluid.transform(opts.repeatingSelectors,function(selector){return fluid.prefs.compositePanel.rebaseSelectorName(compName,selector)});repeatingSelectors=repeatingSelectors.concat(rebasedRepeatingSelectors)}}),repeatingSelectors},fluid.prefs.compositePanel.cutpointGenerator=function(selectors,options){var opts={selectorsToIgnore:options.selectorsToIgnore,repeatingSelectors:options.repeatingSelectors.concat(options.subPanelRepeatingSelectors)};return fluid.renderer.selectorsToCutpoints(selectors,opts)},fluid.prefs.compositePanel.rebaseID=function(value,memberName){return memberName+"_"+value},fluid.prefs.compositePanel.rebaseParentRelativeID=function(val,memberName){var slicePos="..::".length;return val.slice(0,slicePos)+fluid.prefs.compositePanel.rebaseID(val.slice(slicePos),memberName)},fluid.prefs.compositePanel.rebaseValueBinding=function(value,modelRelayRules){return fluid.find(modelRelayRules,function(oldModelPath,newModelPath){return value===oldModelPath?newModelPath:0===value.indexOf(oldModelPath)?value.replace(oldModelPath,newModelPath):void 0})||value},fluid.prefs.compositePanel.rebaseTreeComp=function(msgResolver,model,treeComp,memberName,modelRelayRules){var rebased=fluid.copy(treeComp);if(rebased.ID&&(rebased.ID=fluid.prefs.compositePanel.rebaseID(rebased.ID,memberName)),rebased.children)rebased.children=fluid.prefs.compositePanel.rebaseTree(msgResolver,model,rebased.children,memberName,modelRelayRules);else if(rebased.selection)rebased.selection=fluid.prefs.compositePanel.rebaseTreeComp(msgResolver,model,rebased.selection,memberName,modelRelayRules);else if(rebased.messagekey)rebased.componentType="UIBound",rebased.value=msgResolver.resolve(rebased.messagekey.value,rebased.messagekey.args),delete rebased.messagekey;else if(rebased.parentRelativeID)rebased.parentRelativeID=fluid.prefs.compositePanel.rebaseParentRelativeID(rebased.parentRelativeID,memberName);else if(rebased.valuebinding&&(rebased.valuebinding=fluid.prefs.compositePanel.rebaseValueBinding(rebased.valuebinding,modelRelayRules),rebased.value)){var modelValue=fluid.get(model,rebased.valuebinding);rebased.value=void 0!==modelValue?modelValue:rebased.value}return rebased},fluid.prefs.compositePanel.rebaseTree=function(msgResolver,model,tree,memberName,modelRelayRules){var rebased;return rebased=fluid.isArrayable(tree)?fluid.transform(tree,function(treeComp){return fluid.prefs.compositePanel.rebaseTreeComp(msgResolver,model,treeComp,memberName,modelRelayRules)}):fluid.prefs.compositePanel.rebaseTreeComp(msgResolver,model,tree,memberName,modelRelayRules)},fluid.prefs.compositePanel.produceTree=function(that){var produceTreeOption=that.options.produceTree,ownTree=produceTreeOption?("string"==typeof produceTreeOption?fluid.getGlobalValue(produceTreeOption):produceTreeOption)(that):that.expandProtoTree(),subPanelTree=that.produceSubPanelTrees(),tree={children:ownTree.children.concat(subPanelTree.children)};return tree},fluid.prefs.compositePanel.expandProtoTree=function(that){var expanderOptions=fluid.renderer.modeliseOptions(that.options.expanderOptions,{ELstyle:"${}"},that),expander=fluid.renderer.makeProtoExpander(expanderOptions,that);return expander(that.options.protoTree||{})},fluid.prefs.compositePanel.produceSubPanelTrees=function(that){var tree={children:[]};return fluid.each(that.options.components,function(options,componentName){var subPanel=that[componentName];if(fluid.prefs.compositePanel.isActivePanel(subPanel)){var expanderOptions=fluid.renderer.modeliseOptions(subPanel.options.expanderOptions,{ELstyle:"${}"},subPanel),expander=fluid.renderer.makeProtoExpander(expanderOptions,subPanel),subTree=subPanel.produceTree();subTree=fluid.get(subPanel.options,"rendererFnOptions.noexpand")?subTree:expander(subTree);var rebasedTree=fluid.prefs.compositePanel.rebaseTree(subPanel.msgResolver,that.model,subTree,componentName,subPanel.options.rules);tree.children=tree.children.concat(rebasedTree.children)}}),tree},fluid.defaults("fluid.prefs.prefsEditorConnections",{gradeNames:["fluid.component"],listeners:{"{fluid.prefs.prefsEditor}.events.onPrefsEditorRefresh":"{fluid.prefs.panel}.refreshView"},strings:{},parentBundle:"{fluid.prefs.prefsEditorLoader}.msgResolver"}),fluid.defaults("fluid.prefs.panel.textSize",{gradeNames:["fluid.prefs.panel"],preferenceMap:{"fluid.prefs.textSize":{"model.textSize":"default","range.min":"minimum","range.max":"maximum"}},range:{min:1,max:2},selectors:{textSize:".flc-prefsEditor-min-text-size",label:".flc-prefsEditor-min-text-size-label",multiplier:".flc-prefsEditor-multiplier",textSizeDescr:".flc-prefsEditor-text-size-descr"},selectorsToIgnore:["textSize"],components:{textfieldSlider:{type:"fluid.textfieldSlider",container:"{that}.dom.textSize",createOnEvent:"afterRender",options:{model:{value:"{fluid.prefs.panel.textSize}.model.textSize"},range:"{fluid.prefs.panel.textSize}.options.range",sliderOptions:"{fluid.prefs.panel.textSize}.options.sliderOptions",ariaOptions:{"aria-labelledby":"{textSize}.options.panelOptions.labelId"}}}},protoTree:{label:{messagekey:"textSizeLabel",decorators:{attrs:{id:"{that}.options.panelOptions.labelId"}}},multiplier:{messagekey:"multiplier"},textSizeDescr:{messagekey:"textSizeDescr"}},sliderOptions:{orientation:"horizontal",step:.1,range:"min"},panelOptions:{labelId:"textSize-label-"+fluid.allocateGuid()}}),fluid.defaults("fluid.prefs.panel.textFont",{gradeNames:["fluid.prefs.panel"],preferenceMap:{"fluid.prefs.textFont":{"model.value":"default","controlValues.textFont":"enum"}},selectors:{textFont:".flc-prefsEditor-text-font",label:".flc-prefsEditor-text-font-label",textFontDescr:".flc-prefsEditor-text-font-descr"},stringArrayIndex:{textFont:["textFont-default","textFont-times","textFont-comic","textFont-arial","textFont-verdana"]},protoTree:{label:{messagekey:"textFontLabel"},textFontDescr:{messagekey:"textFontDescr"},textFont:{optionnames:"${{that}.msgLookup.textFont}",optionlist:"${{that}.options.controlValues.textFont}",selection:"${value}",decorators:{type:"fluid",func:"fluid.prefs.selectDecorator",options:{styles:"{that}.options.classnameMap.textFont"}}}},classnameMap:null,controlValues:{textFont:["default","times","comic","arial","verdana"]}}),fluid.defaults("fluid.prefs.panel.lineSpace",{gradeNames:["fluid.prefs.panel"],preferenceMap:{"fluid.prefs.lineSpace":{"model.lineSpace":"default","range.min":"minimum","range.max":"maximum"}},range:{min:1,max:2},selectors:{lineSpace:".flc-prefsEditor-line-space",label:".flc-prefsEditor-line-space-label",multiplier:".flc-prefsEditor-multiplier",lineSpaceDescr:".flc-prefsEditor-line-space-descr"},selectorsToIgnore:["lineSpace"],components:{textfieldSlider:{type:"fluid.textfieldSlider",container:"{that}.dom.lineSpace",createOnEvent:"afterRender",options:{model:{value:"{fluid.prefs.panel.lineSpace}.model.lineSpace"},range:"{fluid.prefs.panel.lineSpace}.options.range",sliderOptions:"{fluid.prefs.panel.lineSpace}.options.sliderOptions",ariaOptions:{"aria-labelledby":"{lineSpace}.options.panelOptions.labelId"}}}},protoTree:{label:{messagekey:"lineSpaceLabel",decorators:{attrs:{id:"{that}.options.panelOptions.labelId"}}},multiplier:{messagekey:"multiplier"},lineSpaceDescr:{messagekey:"lineSpaceDescr"}},sliderOptions:{orientation:"horizontal",step:.1,range:"min"},panelOptions:{labelId:"lineSpace-label-"+fluid.allocateGuid()}}),fluid.defaults("fluid.prefs.panel.contrast",{gradeNames:["fluid.prefs.panel"],preferenceMap:{"fluid.prefs.contrast":{"model.value":"default","controlValues.theme":"enum"}},listeners:{"afterRender.style":"{that}.style"},selectors:{themeRow:".flc-prefsEditor-themeRow",themeLabel:".flc-prefsEditor-theme-label",themeInput:".flc-prefsEditor-themeInput",label:".flc-prefsEditor-contrast-label",contrastDescr:".flc-prefsEditor-contrast-descr"},styles:{defaultThemeLabel:"fl-prefsEditor-contrast-defaultThemeLabel"},stringArrayIndex:{theme:["contrast-default","contrast-bw","contrast-wb","contrast-by","contrast-yb","contrast-lgdg"]},repeatingSelectors:["themeRow"],protoTree:{label:{messagekey:"contrastLabel"},contrastDescr:{messagekey:"contrastDescr"},expander:{type:"fluid.renderer.selection.inputs",rowID:"themeRow",labelID:"themeLabel",inputID:"themeInput",selectID:"theme-radio",tree:{optionnames:"${{that}.msgLookup.theme}",optionlist:"${{that}.options.controlValues.theme}",selection:"${value}"}}},controlValues:{theme:["default","bw","wb","by","yb","lgdg"]},markup:{label:'<span class="fl-preview-A" aria-hidden="true"></span><span class="fl-hidden-accessible">%theme</span><div class="fl-crossout" aria-hidden="true"></div>'},invokers:{style:{funcName:"fluid.prefs.panel.contrast.style",args:["{that}.dom.themeLabel","{that}.msgLookup.theme","{that}.options.markup.label","{that}.options.controlValues.theme","default","{that}.options.classnameMap.theme","{that}.options.styles.defaultThemeLabel"]}}}),fluid.prefs.panel.contrast.style=function(labels,strings,markup,theme,defaultThemeName,style,defaultLabelStyle){fluid.each(labels,function(label,index){label=$(label);var themeValue=strings[index];label.html(fluid.stringTemplate(markup,{theme:themeValue})),label.attr("aria-label",themeValue);var labelTheme=theme[index];labelTheme===defaultThemeName&&label.addClass(defaultLabelStyle),label.addClass(style[labelTheme])})},fluid.defaults("fluid.prefs.panel.layoutControls",{gradeNames:["fluid.prefs.panel"],preferenceMap:{"fluid.prefs.tableOfContents":{"model.toc":"default"}},selectors:{toc:".flc-prefsEditor-toc",label:".flc-prefsEditor-toc-label",tocDescr:".flc-prefsEditor-toc-descr"},protoTree:{label:{messagekey:"tocLabel"},tocDescr:{messagekey:"tocDescr"},toc:"${toc}"}}),fluid.defaults("fluid.prefs.panel.emphasizeLinks",{gradeNames:["fluid.prefs.panel"],preferenceMap:{"fluid.prefs.emphasizeLinks":{"model.links":"default"}},selectors:{links:".flc-prefsEditor-links",linksChoiceLabel:".flc-prefsEditor-links-choice-label"},protoTree:{linksChoiceLabel:{messagekey:"linksChoiceLabel"},links:"${links}"}}),fluid.defaults("fluid.prefs.panel.inputsLarger",{gradeNames:["fluid.prefs.panel"],preferenceMap:{"fluid.prefs.inputsLarger":{"model.inputsLarger":"default"}},selectors:{inputsLarger:".flc-prefsEditor-inputs-larger",inputsChoiceLabel:".flc-prefsEditor-links-inputs-choice-label"},protoTree:{inputsChoiceLabel:{messagekey:"inputsChoiceLabel"},inputsLarger:"${inputsLarger}"}}),fluid.defaults("fluid.prefs.panel.linksControls",{gradeNames:["fluid.prefs.compositePanel"],selectors:{label:".flc-prefsEditor-linksControls-label"},protoTree:{label:{messagekey:"linksControlsLabel"}}}),fluid.defaults("fluid.prefs.selectDecorator",{gradeNames:["fluid.viewComponent"],listeners:{"onCreate.decorateOptions":"fluid.prefs.selectDecorator.decorateOptions"},styles:{preview:"fl-preview-theme"}}),fluid.prefs.selectDecorator.decorateOptions=function(that){fluid.each($("option",that.container),function(option){var styles=that.options.styles;$(option).addClass(styles.preview+" "+styles[fluid.value(option)])})}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.panel.speak",{gradeNames:["fluid.prefs.panel"],preferenceMap:{"fluid.prefs.speak":{"model.speak":"default"}},selectors:{speak:".flc-prefsEditor-speak",label:".flc-prefsEditor-speak-label",speakDescr:".flc-prefsEditor-speak-descr"},protoTree:{label:{messagekey:"speakLabel"},speakDescr:{messagekey:"speakDescr"},speak:"${speak}"}})}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.enactor",{gradeNames:["fluid.modelComponent"]}),fluid.defaults("fluid.prefs.enactor.styleElements",{gradeNames:["fluid.prefs.enactor"],cssClass:null,elementsToStyle:null,invokers:{applyStyle:{funcName:"fluid.prefs.enactor.styleElements.applyStyle",args:["{arguments}.0","{arguments}.1"]},resetStyle:{funcName:"fluid.prefs.enactor.styleElements.resetStyle",args:["{arguments}.0","{arguments}.1"]},handleStyle:{funcName:"fluid.prefs.enactor.styleElements.handleStyle",args:["{arguments}.0","{that}.options.elementsToStyle","{that}.options.cssClass","{that}.applyStyle","{that}.resetStyle"]}},modelListeners:{value:{listener:"{that}.handleStyle",args:["{change}.value"]}}}),fluid.prefs.enactor.styleElements.applyStyle=function(elements,cssClass){elements.addClass(cssClass)},fluid.prefs.enactor.styleElements.resetStyle=function(elements,cssClass){$(elements,"."+cssClass).addBack().removeClass(cssClass)},fluid.prefs.enactor.styleElements.handleStyle=function(value,elements,cssClass,applyStyleFunc,resetStyleFunc){var func=value?applyStyleFunc:resetStyleFunc;func(elements,cssClass)},fluid.defaults("fluid.prefs.enactor.classSwapper",{gradeNames:["fluid.prefs.enactor","fluid.viewComponent"],classes:{},invokers:{clearClasses:{funcName:"fluid.prefs.enactor.classSwapper.clearClasses",args:["{that}.container","{that}.classStr"]},swap:{funcName:"fluid.prefs.enactor.classSwapper.swap",args:["{arguments}.0","{that}","{that}.clearClasses"]}},modelListeners:{value:{listener:"{that}.swap",args:["{change}.value"]}},members:{classStr:{expander:{func:"fluid.prefs.enactor.classSwapper.joinClassStr",args:"{that}.options.classes"}}}}),fluid.prefs.enactor.classSwapper.clearClasses=function(container,classStr){container.removeClass(classStr)},fluid.prefs.enactor.classSwapper.swap=function(value,that,clearClassesFunc){clearClassesFunc(),that.container.addClass(that.options.classes[value])},fluid.prefs.enactor.classSwapper.joinClassStr=function(classes){var classStr="";return fluid.each(classes,function(oneClassName){oneClassName&&(classStr+=classStr?" "+oneClassName:oneClassName)}),classStr},fluid.defaults("fluid.prefs.enactor.emphasizeLinks",{gradeNames:["fluid.prefs.enactor.styleElements","fluid.viewComponent"],preferenceMap:{"fluid.prefs.emphasizeLinks":{"model.value":"default"}},cssClass:null,elementsToStyle:"{that}.container"}),fluid.defaults("fluid.prefs.enactor.inputsLarger",{gradeNames:["fluid.prefs.enactor.styleElements","fluid.viewComponent"],preferenceMap:{"fluid.prefs.inputsLarger":{"model.value":"default"}},cssClass:null,elementsToStyle:"{that}.container"}),fluid.defaults("fluid.prefs.enactor.textFont",{gradeNames:["fluid.prefs.enactor.classSwapper"],preferenceMap:{"fluid.prefs.textFont":{"model.value":"default"}}}),fluid.defaults("fluid.prefs.enactor.contrast",{gradeNames:["fluid.prefs.enactor.classSwapper"],preferenceMap:{"fluid.prefs.contrast":{"model.value":"default"}}}),fluid.prefs.enactor.getTextSizeInPx=function(container,fontSizeMap){var fontSize=container.css("font-size");return fontSizeMap[fontSize]&&(fontSize=fontSizeMap[fontSize]),parseFloat(fontSize)},fluid.defaults("fluid.prefs.enactor.textSize",{gradeNames:["fluid.prefs.enactor","fluid.viewComponent"],preferenceMap:{"fluid.prefs.textSize":{"model.value":"default"}},members:{root:{expander:{"this":"{that}.container",method:"closest",args:["html"]}}},fontSizeMap:{},invokers:{set:{funcName:"fluid.prefs.enactor.textSize.set",args:["{arguments}.0","{that}","{that}.getTextSizeInPx"]},getTextSizeInPx:{funcName:"fluid.prefs.enactor.getTextSizeInPx",args:["{that}.root","{that}.options.fontSizeMap"]}},modelListeners:{value:{listener:"{that}.set",args:["{change}.value"]}}}),fluid.prefs.enactor.textSize.set=function(times,that,getTextSizeInPxFunc){if(times=times||1,that.initialSize||(that.initialSize=getTextSizeInPxFunc()),that.initialSize){var targetSize=times*that.initialSize;that.root.css("font-size",targetSize+"px")}},fluid.defaults("fluid.prefs.enactor.lineSpace",{gradeNames:["fluid.prefs.enactor","fluid.viewComponent"],preferenceMap:{"fluid.prefs.lineSpace":{"model.value":"default"}},fontSizeMap:{},invokers:{set:{funcName:"fluid.prefs.enactor.lineSpace.set",args:["{arguments}.0","{that}","{that}.getLineHeightMultiplier"]},getTextSizeInPx:{funcName:"fluid.prefs.enactor.getTextSizeInPx",args:["{that}.container","{that}.options.fontSizeMap"]},getLineHeight:{funcName:"fluid.prefs.enactor.lineSpace.getLineHeight",args:"{that}.container"},getLineHeightMultiplier:{funcName:"fluid.prefs.enactor.lineSpace.getLineHeightMultiplier",args:[{expander:{func:"{that}.getLineHeight"}},{expander:{func:"{that}.getTextSizeInPx"}}]}},modelListeners:{value:{listener:"{that}.set",args:["{change}.value"]}}}),fluid.prefs.enactor.lineSpace.getLineHeight=function(container){return container.css("line-height")},fluid.prefs.enactor.lineSpace.getLineHeightMultiplier=function(lineHeight,fontSize){return lineHeight?"normal"===lineHeight?1.2:lineHeight.match(/[0-9]$/)?Number(lineHeight):Math.round(parseFloat(lineHeight)/fontSize*100)/100:0},fluid.prefs.enactor.lineSpace.set=function(times,that,getLineHeightMultiplierFunc){if(that.initialSize||(that.initialSize=getLineHeightMultiplierFunc()),that.initialSize){var targetLineSpace=times*that.initialSize;that.container.css("line-height",targetLineSpace)}},fluid.defaults("fluid.prefs.enactor.tableOfContents",{gradeNames:["fluid.prefs.enactor","fluid.viewComponent"],preferenceMap:{"fluid.prefs.tableOfContents":{"model.toc":"default"}},tocTemplate:null,components:{tableOfContents:{type:"fluid.tableOfContents",container:"{fluid.prefs.enactor.tableOfContents}.container",createOnEvent:"onCreateTOCReady",options:{components:{levels:{type:"fluid.tableOfContents.levels",options:{resources:{template:{forceCache:!0,url:"{fluid.prefs.enactor.tableOfContents}.options.tocTemplate"}}}}},listeners:{"afterRender.boilAfterTocRender":"{fluid.prefs.enactor.tableOfContents}.events.afterTocRender"}}}},invokers:{applyToc:{funcName:"fluid.prefs.enactor.tableOfContents.applyToc",args:["{arguments}.0","{that}"]}},events:{onCreateTOCReady:null,afterTocRender:null,onLateRefreshRelay:null},modelListeners:{toc:{listener:"{that}.applyToc",args:["{change}.value"]}},distributeOptions:{source:"{that}.options.ignoreForToC",target:"{that tableOfContents}.options.ignoreForToC"}}),fluid.prefs.enactor.tableOfContents.applyToc=function(value,that){value?that.tableOfContents?that.tableOfContents.show():that.events.onCreateTOCReady.fire():that.tableOfContents&&that.tableOfContents.hide()}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.enactor.speak",{gradeNames:"fluid.prefs.enactor",preferenceMap:{"fluid.prefs.speak":{"model.enabled":"default"}},components:{tts:{type:"fluid.textToSpeech",options:{model:"{speak}.model",invokers:{queueSpeech:{funcName:"fluid.prefs.enactor.speak.queueSpeech",args:["{that}","fluid.textToSpeech.queueSpeech","{arguments}.0","{arguments}.1","{arguments}.2"]}}}}}}),fluid.prefs.enactor.speak.queueSpeech=function(that,speechFn,text,interrupt,options){var str=text.toString();str=str.trim(),str.replace(/\s{2,}/gi," "),that.model.enabled&&str&&("string"==typeof speechFn?fluid.invokeGlobalFunction(speechFn,[that,str,interrupt,options]):speechFn(that,str,interrupt,options))},fluid.defaults("fluid.prefs.enactor.selfVoicing",{gradeNames:["fluid.prefs.enactor.speak","fluid.viewComponent"],modelListeners:{enabled:{listener:"{that}.handleSelfVoicing",args:["{change}.value"]}},invokers:{handleSelfVoicing:{funcName:"fluid.prefs.enactor.selfVoicing.handleSelfVoicing",args:["{that}.options.strings.welcomeMsg","{tts}.queueSpeech","{that}.readFromDOM","{tts}.cancel","{arguments}.0"]},readFromDOM:{funcName:"fluid.prefs.enactor.selfVoicing.readFromDOM",args:["{that}","{that}.container"]}},strings:{welcomeMsg:"text to speech enabled"}}),fluid.prefs.enactor.selfVoicing.handleSelfVoicing=function(welcomeMsg,queueSpeech,readFromDOM,cancel,enabled){enabled?(queueSpeech(welcomeMsg,!0),readFromDOM()):cancel()},fluid.prefs.enactor.selfVoicing.nodeType={ELEMENT_NODE:1,TEXT_NODE:3},fluid.prefs.enactor.selfVoicing.readFromDOM=function(that,elm){elm=$(elm);var nodes=elm.contents();fluid.each(nodes,function(node){if(node.nodeType===fluid.prefs.enactor.selfVoicing.nodeType.TEXT_NODE&&node.nodeValue&&that.tts.queueSpeech(node.nodeValue),node.nodeType===fluid.prefs.enactor.selfVoicing.nodeType.ELEMENT_NODE&&"none"!==window.getComputedStyle(node).display)if("IMG"===node.nodeName){var altText=node.getAttribute("alt");altText&&that.tts.queueSpeech(altText)}else fluid.prefs.enactor.selfVoicing.readFromDOM(that,node)})}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.initialModel.starter",{gradeNames:["fluid.prefs.initialModel"],members:{initialModel:{preferences:{textFont:"default",theme:"default",textSize:1,lineSpace:1,toc:!1,links:!1,inputsLarger:!1}}}}),fluid.defaults("fluid.uiEnhancer.cssClassEnhancerBase",{gradeNames:["fluid.component"],classnameMap:{textFont:{"default":"",times:"fl-font-times",comic:"fl-font-comic-sans",arial:"fl-font-arial",verdana:"fl-font-verdana"},theme:{"default":"fl-theme-prefsEditor-default",bw:"fl-theme-bw",wb:"fl-theme-wb",by:"fl-theme-by",yb:"fl-theme-yb",lgdg:"fl-theme-lgdg"},links:"fl-link-enhanced",inputsLarger:"fl-text-larger"}}),fluid.defaults("fluid.uiEnhancer.browserTextEnhancerBase",{gradeNames:["fluid.component"],fontSizeMap:{"xx-small":"9px","x-small":"11px",small:"13px",medium:"15px",large:"18px","x-large":"23px","xx-large":"30px"}}),fluid.defaults("fluid.uiEnhancer.starterEnactors",{gradeNames:["fluid.uiEnhancer","fluid.uiEnhancer.cssClassEnhancerBase","fluid.uiEnhancer.browserTextEnhancerBase"],model:"{fluid.prefs.initialModel}.initialModel.preferences",components:{textSize:{type:"fluid.prefs.enactor.textSize",container:"{uiEnhancer}.container",options:{fontSizeMap:"{uiEnhancer}.options.fontSizeMap",model:{value:"{uiEnhancer}.model.textSize"}}},textFont:{type:"fluid.prefs.enactor.textFont",container:"{uiEnhancer}.container",options:{classes:"{uiEnhancer}.options.classnameMap.textFont",model:{value:"{uiEnhancer}.model.textFont"}}},lineSpace:{type:"fluid.prefs.enactor.lineSpace",container:"{uiEnhancer}.container",options:{fontSizeMap:"{uiEnhancer}.options.fontSizeMap",model:{value:"{uiEnhancer}.model.lineSpace"}}},contrast:{type:"fluid.prefs.enactor.contrast",container:"{uiEnhancer}.container",options:{classes:"{uiEnhancer}.options.classnameMap.theme",model:{value:"{uiEnhancer}.model.theme"}}},emphasizeLinks:{type:"fluid.prefs.enactor.emphasizeLinks",container:"{uiEnhancer}.container",options:{cssClass:"{uiEnhancer}.options.classnameMap.links",model:{value:"{uiEnhancer}.model.links"}}},inputsLarger:{type:"fluid.prefs.enactor.inputsLarger",container:"{uiEnhancer}.container",options:{cssClass:"{uiEnhancer}.options.classnameMap.inputsLarger",model:{value:"{uiEnhancer}.model.inputsLarger"}}},tableOfContents:{type:"fluid.prefs.enactor.tableOfContents",container:"{uiEnhancer}.container",options:{tocTemplate:"{uiEnhancer}.options.tocTemplate",model:{toc:"{uiEnhancer}.model.toc"}}}}}),fluid.defaults("fluid.prefs.starterPanels",{gradeNames:["fluid.prefs.prefsEditor"],selectors:{textSize:".flc-prefsEditor-text-size",textFont:".flc-prefsEditor-text-font",lineSpace:".flc-prefsEditor-line-space",contrast:".flc-prefsEditor-contrast",textControls:".flc-prefsEditor-text-controls",layoutControls:".flc-prefsEditor-layout-controls",linksControls:".flc-prefsEditor-links-controls"},components:{textSize:{type:"fluid.prefs.panel.textSize",container:"{prefsEditor}.dom.textSize",createOnEvent:"onPrefsEditorMarkupReady",options:{gradeNames:"fluid.prefs.prefsEditorConnections",model:{textSize:"{prefsEditor}.model.preferences.textSize"},messageBase:"{messageLoader}.resources.textSize.resourceText",
resources:{template:"{templateLoader}.resources.textSize"}}},lineSpace:{type:"fluid.prefs.panel.lineSpace",container:"{prefsEditor}.dom.lineSpace",createOnEvent:"onPrefsEditorMarkupReady",options:{gradeNames:"fluid.prefs.prefsEditorConnections",model:{lineSpace:"{prefsEditor}.model.preferences.lineSpace"},messageBase:"{messageLoader}.resources.lineSpace.resourceText",resources:{template:"{templateLoader}.resources.lineSpace"}}},textFont:{type:"fluid.prefs.panel.textFont",container:"{prefsEditor}.dom.textFont",createOnEvent:"onPrefsEditorMarkupReady",options:{gradeNames:"fluid.prefs.prefsEditorConnections",classnameMap:"{uiEnhancer}.options.classnameMap",model:{value:"{prefsEditor}.model.preferences.textFont"},messageBase:"{messageLoader}.resources.textFont.resourceText",resources:{template:"{templateLoader}.resources.textFont"}}},contrast:{type:"fluid.prefs.panel.contrast",container:"{prefsEditor}.dom.contrast",createOnEvent:"onPrefsEditorMarkupReady",options:{gradeNames:"fluid.prefs.prefsEditorConnections",classnameMap:"{uiEnhancer}.options.classnameMap",model:{value:"{prefsEditor}.model.preferences.theme"},messageBase:"{messageLoader}.resources.contrast.resourceText",resources:{template:"{templateLoader}.resources.contrast"}}},layoutControls:{type:"fluid.prefs.panel.layoutControls",container:"{prefsEditor}.dom.layoutControls",createOnEvent:"onPrefsEditorMarkupReady",options:{gradeNames:"fluid.prefs.prefsEditorConnections",model:{toc:"{prefsEditor}.model.preferences.toc"},messageBase:"{messageLoader}.resources.layoutControls.resourceText",resources:{template:"{templateLoader}.resources.layoutControls"}}},linksControls:{type:"fluid.prefs.panel.linksControls",container:"{prefsEditor}.dom.linksControls",createOnEvent:"onPrefsEditorMarkupReady",options:{gradeNames:"fluid.prefs.prefsEditorConnections",selectors:{emphasizeLinks:".flc-prefsEditor-emphasizeLinks",inputsLarger:".flc-prefsEditor-inputsLarger"},selectorsToIgnore:["emphasizeLinks","inputsLarger"],model:{fluid_prefs_emphasizeLinks:"{prefsEditor}.model.preferences.links",fluid_prefs_inputsLarger:"{prefsEditor}.model.preferences.inputsLarger"},components:{emphasizeLinks:{type:"fluid.prefs.panel.emphasizeLinks",container:"{that}.dom.emphasizeLinks",createOnEvent:"initSubPanels",options:{messageBase:"{messageLoader}.resources.emphasizeLinks.resourceText"}},inputsLarger:{type:"fluid.prefs.panel.inputsLarger",container:"{that}.dom.inputsLarger",createOnEvent:"initSubPanels",options:{messageBase:"{messageLoader}.resources.inputsLarger.resourceText"}}},messageBase:"{messageLoader}.resources.linksControls.resourceText",resources:{template:"{templateLoader}.resources.linksControls",emphasizeLinks:"{templateLoader}.resources.emphasizeLinks",inputsLarger:"{templateLoader}.resources.inputsLarger"}}}}}),fluid.defaults("fluid.prefs.starterTemplateLoader",{gradeNames:["fluid.resourceLoader","fluid.contextAware"],resources:{textFont:"%templatePrefix/PrefsEditorTemplate-textFont.html",contrast:"%templatePrefix/PrefsEditorTemplate-contrast.html",layoutControls:"%templatePrefix/PrefsEditorTemplate-layout.html",linksControls:"%templatePrefix/PrefsEditorTemplate-linksControls.html",emphasizeLinks:"%templatePrefix/PrefsEditorTemplate-emphasizeLinks.html",inputsLarger:"%templatePrefix/PrefsEditorTemplate-inputsLarger.html"},contextAwareness:{startTemplateLoaderPrefsWidgetType:{checks:{jQueryUI:{contextValue:"{fluid.prefsWidgetType}",equals:"jQueryUI",gradeNames:"fluid.prefs.starterTemplateLoader.jQuery"}},defaultGradeNames:"fluid.prefs.starterTemplateLoader.native"}}}),fluid.defaults("fluid.prefs.starterTemplateLoader.native",{resources:{textSize:"%templatePrefix/PrefsEditorTemplate-textSize-nativeHTML.html",lineSpace:"%templatePrefix/PrefsEditorTemplate-lineSpace-nativeHTML.html"}}),fluid.defaults("fluid.prefs.starterTemplateLoader.jQuery",{resources:{textSize:"%templatePrefix/PrefsEditorTemplate-textSize-jQueryUI.html",lineSpace:"%templatePrefix/PrefsEditorTemplate-lineSpace-jQueryUI.html"}}),fluid.defaults("fluid.prefs.starterSeparatedPanelTemplateLoader",{gradeNames:["fluid.prefs.starterTemplateLoader"],resources:{prefsEditor:"%templatePrefix/SeparatedPanelPrefsEditor.html"}}),fluid.defaults("fluid.prefs.starterFullPreviewTemplateLoader",{gradeNames:["fluid.prefs.starterTemplateLoader"],resources:{prefsEditor:"%templatePrefix/FullPreviewPrefsEditor.html"}}),fluid.defaults("fluid.prefs.starterFullNoPreviewTemplateLoader",{gradeNames:["fluid.prefs.starterTemplateLoader"],resources:{prefsEditor:"%templatePrefix/FullNoPreviewPrefsEditor.html"}}),fluid.defaults("fluid.prefs.starterMessageLoader",{gradeNames:["fluid.resourceLoader"],resources:{prefsEditor:"%messagePrefix/prefsEditor.json",textSize:"%messagePrefix/textSize.json",textFont:"%messagePrefix/textFont.json",lineSpace:"%messagePrefix/lineSpace.json",contrast:"%messagePrefix/contrast.json",layoutControls:"%messagePrefix/tableOfContents.json",linksControls:"%messagePrefix/linksControls.json",emphasizeLinks:"%messagePrefix/emphasizeLinks.json",inputsLarger:"%messagePrefix/inputsLarger.json"}})}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.dom"),fluid.dom.getDocumentHeight=function(dokkument){var body=$("body",dokkument)[0];return body.offsetHeight},fluid.defaults("fluid.prefs.separatedPanel",{gradeNames:["fluid.prefs.prefsEditorLoader","fluid.contextAware"],events:{afterRender:null,onReady:null,onCreateSlidingPanelReady:{events:{iframeRendered:"afterRender",onPrefsEditorMessagesLoaded:"onPrefsEditorMessagesLoaded"}},templatesAndIframeReady:{events:{iframeReady:"afterRender",templatesLoaded:"onPrefsEditorTemplatesLoaded",messagesLoaded:"onPrefsEditorMessagesLoaded"}}},lazyLoad:!1,contextAwareness:{lazyLoad:{checks:{lazyLoad:{contextValue:"{fluid.prefs.separatedPanel}.options.lazyLoad",gradeNames:"fluid.prefs.separatedPanel.lazyLoad"}}},separatedPanelPrefsWidgetType:{checks:{jQueryUI:{contextValue:"{fluid.prefsWidgetType}",equals:"jQueryUI",gradeNames:"fluid.prefs.separatedPanel.jQueryUI"}},defaultGradeNames:"fluid.prefs.separatedPanel.nativeHTML"}},selectors:{reset:".flc-prefsEditor-reset",iframe:".flc-prefsEditor-iframe"},listeners:{"onReady.bindEvents":{listener:"fluid.prefs.separatedPanel.bindEvents",args:["{separatedPanel}.prefsEditor","{iframeRenderer}.iframeEnhancer","{separatedPanel}"]},"onCreate.hideReset":{listener:"fluid.prefs.separatedPanel.hideReset",args:["{separatedPanel}"]}},invokers:{bindReset:{funcName:"fluid.bind",args:["{separatedPanel}.dom.reset","click","{arguments}.0"]}},components:{slidingPanel:{type:"fluid.slidingPanel",container:"{separatedPanel}.container",createOnEvent:"onCreateSlidingPanelReady",options:{gradeNames:["fluid.prefs.msgLookup"],strings:{showText:"{that}.msgLookup.slidingPanelShowText",hideText:"{that}.msgLookup.slidingPanelHideText",showTextAriaLabel:"{that}.msgLookup.showTextAriaLabel",hideTextAriaLabel:"{that}.msgLookup.hideTextAriaLabel",panelLabel:"{that}.msgLookup.slidingPanelPanelLabel"},invokers:{operateShow:{funcName:"fluid.prefs.separatedPanel.showPanel",args:["{that}.dom.panel","{that}.events.afterPanelShow.fire"],"this":null,method:null},operateHide:{funcName:"fluid.prefs.separatedPanel.hidePanel",args:["{that}.dom.panel","{iframeRenderer}.iframe","{that}.events.afterPanelHide.fire"],"this":null,method:null}},components:{msgResolver:{type:"fluid.messageResolver",options:{messageBase:"{messageLoader}.resources.prefsEditor.resourceText"}}}}},iframeRenderer:{type:"fluid.prefs.separatedPanel.renderIframe",container:"{separatedPanel}.dom.iframe",options:{events:{afterRender:"{separatedPanel}.events.afterRender"},components:{iframeEnhancer:{type:"fluid.uiEnhancer",container:"{iframeRenderer}.renderPrefsEditorContainer",createOnEvent:"afterRender",options:{gradeNames:["{pageEnhancer}.uiEnhancer.options.userGrades"],jQuery:"{iframeRenderer}.jQuery",tocTemplate:"{pageEnhancer}.uiEnhancer.options.tocTemplate"}}}}},prefsEditor:{createOnEvent:"templatesAndIframeReady",container:"{iframeRenderer}.renderPrefsEditorContainer",options:{gradeNames:["fluid.prefs.uiEnhancerRelay"],model:"{separatedPanel}.model",events:{onSignificantDOMChange:null,updateEnhancerModel:"{that}.events.modelChanged"},listeners:{"modelChanged.save":"{that}.save","onCreate.bindReset":{listener:"{separatedPanel}.bindReset",args:["{that}.reset"]},"afterReset.applyChanges":"{that}.applyChanges","onReady.boilOnReady":{listener:"{separatedPanel}.events.onReady",args:"{separatedPanel}"}}}}},outerEnhancerOptions:"{originalEnhancerOptions}.options.originalUserOptions",distributeOptions:[{source:"{that}.options.slidingPanel",removeSource:!0,target:"{that > slidingPanel}.options"},{source:"{that}.options.iframeRenderer",removeSource:!0,target:"{that > iframeRenderer}.options"},{source:"{that}.options.iframe",removeSource:!0,target:"{that}.options.selectors.iframe"},{source:"{that}.options.outerEnhancerOptions",removeSource:!0,target:"{that iframeEnhancer}.options"},{source:"{that}.options.terms",target:"{that > iframeRenderer}.options.terms"}]}),fluid.defaults("fluid.prefs.separatedPanel.nativeHTML",{components:{iframeRenderer:{options:{markupProps:{src:"%templatePrefix/SeparatedPanelPrefsEditorFrame-nativeHTML.html"}}}}}),fluid.defaults("fluid.prefs.separatedPanel.jQueryUI",{components:{iframeRenderer:{options:{markupProps:{src:"%templatePrefix/SeparatedPanelPrefsEditorFrame-jQueryUI.html"}}}}}),fluid.prefs.separatedPanel.hideReset=function(separatedPanel){separatedPanel.locate("reset").hide()},fluid.defaults("fluid.prefs.separatedPanel.renderIframe",{gradeNames:["fluid.viewComponent"],events:{afterRender:null},styles:{container:"fl-prefsEditor-separatedPanel-iframe"},terms:{templatePrefix:"."},markupProps:{"class":"flc-iframe",src:"%templatePrefix/prefsEditorIframe.html"},listeners:{"onCreate.startLoadingIframe":"fluid.prefs.separatedPanel.renderIframe.startLoadingIframe"}}),fluid.prefs.separatedPanel.renderIframe.startLoadingIframe=function(that){var styles=that.options.styles;that.options.markupProps.src=fluid.stringTemplate(that.options.markupProps.src,that.options.terms),that.iframeSrc=that.options.markupProps.src,that.iframe=$("<iframe/>"),that.iframe.on("load",function(){var iframeWindow=that.iframe[0].contentWindow;that.iframeDocument=iframeWindow.document,that.jQuery=iframeWindow.jQuery||$,that.renderPrefsEditorContainer=that.jQuery("body",that.iframeDocument),that.jQuery(that.iframeDocument).ready(that.events.afterRender.fire)}),that.iframe.attr(that.options.markupProps),that.iframe.addClass(styles.container),that.iframe.hide(),that.iframe.appendTo(that.container)},fluid.prefs.separatedPanel.updateView=function(prefsEditor){prefsEditor.events.onPrefsEditorRefresh.fire(),prefsEditor.events.onSignificantDOMChange.fire()},fluid.prefs.separatedPanel.bindEvents=function(prefsEditor,iframeEnhancer,separatedPanel){var separatedPanelId=separatedPanel.slidingPanel.panelId;separatedPanel.locate("reset").attr({"aria-controls":separatedPanelId,role:"button"}),separatedPanel.slidingPanel.events.afterPanelShow.addListener(function(){fluid.prefs.separatedPanel.updateView(prefsEditor)},"updateView","after:openPanel"),prefsEditor.events.onPrefsEditorRefresh.addListener(function(){iframeEnhancer.updateModel(prefsEditor.model.preferences)},"updateModel"),prefsEditor.events.afterReset.addListener(function(prefsEditor){fluid.prefs.separatedPanel.updateView(prefsEditor)},"updateView"),prefsEditor.events.onSignificantDOMChange.addListener(function(){var dokkument=prefsEditor.container[0].ownerDocument,height=fluid.dom.getDocumentHeight(dokkument),iframe=separatedPanel.iframeRenderer.iframe,attrs={height:height+15},panel=separatedPanel.slidingPanel.locate("panel");panel.css({height:""}),iframe.animate(attrs,400)},"adjustHeight"),separatedPanel.slidingPanel.events.afterPanelHide.addListener(function(){separatedPanel.iframeRenderer.iframe.height(0),separatedPanel.iframeRenderer.iframe.hide()},"collapseFrame"),separatedPanel.slidingPanel.events.afterPanelShow.addListener(function(){separatedPanel.iframeRenderer.iframe.show(),separatedPanel.locate("reset").show()},"openPanel"),separatedPanel.slidingPanel.events.onPanelHide.addListener(function(){separatedPanel.locate("reset").hide()},"hideReset")},fluid.prefs.separatedPanel.hidePanel=function(panel,iframe,callback){iframe.clearQueue(),$(panel).animate({height:0},{duration:400,complete:callback})},fluid.prefs.separatedPanel.showPanel=function(panel,callback){fluid.invokeLater(callback)},fluid.defaults("fluid.prefs.separatedPanel.lazyLoad",{events:{onLazyLoad:null,onPrefsEditorMessagesPreloaded:null,onCreateSlidingPanelReady:{events:{onPrefsEditorMessagesLoaded:"onPrefsEditorMessagesPreloaded"}},templatesAndIframeReady:{events:{onLazyLoad:"onLazyLoad"}}},components:{templateLoader:{createOnEvent:"onLazyLoad"},messageLoader:{options:{events:{onResourcesPreloaded:"{separatedPanel}.events.onPrefsEditorMessagesPreloaded"},preloadResources:"prefsEditor",listeners:{"onCreate.loadResources":{listener:"fluid.prefs.separatedPanel.lazyLoad.preloadResources",args:["{that}",{expander:{func:"{that}.resolveResources"}},"{that}.options.preloadResources"]},"{separatedPanel}.events.onLazyLoad":{listener:"fluid.resourceLoader.loadResources",args:["{messageLoader}",{expander:{func:"{messageLoader}.resolveResources"}}]}}}},slidingPanel:{options:{invokers:{operateShow:{funcName:"fluid.prefs.separatedPanel.lazyLoad.showPanel",args:["{separatedPanel}","{that}.events.afterPanelShow.fire"]}}}}}}),fluid.prefs.separatedPanel.lazyLoad.showPanel=function(separatedPanel,callback){separatedPanel.prefsEditor?fluid.invokeLater(callback):(separatedPanel.events.onReady.addListener(function(that){that.events.onReady.removeListener("showPanelCallBack"),fluid.invokeLater(callback)},"showPanelCallBack"),separatedPanel.events.onLazyLoad.fire())},fluid.prefs.separatedPanel.lazyLoad.preloadResources=function(that,resources,toPreload){toPreload=fluid.makeArray(toPreload);var preloadResources={};fluid.each(toPreload,function(resourceName){preloadResources[resourceName]=resources[resourceName]}),fluid.fetchResources(preloadResources,function(){that.resources=preloadResources,that.events.onResourcesPreloaded.fire(preloadResources)})}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.fullNoPreview",{gradeNames:["fluid.prefs.prefsEditorLoader"],components:{prefsEditor:{container:"{that}.container",options:{listeners:{"afterReset.applyChanges":{listener:"{that}.applyChanges"},"afterReset.save":{listener:"{that}.save",priority:"after:applyChanges"},"onReady.boilOnReady":{listener:"{fullNoPreview}.events.onReady",args:"{fullNoPreview}"}}}}},events:{onReady:null}})}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.defaults("fluid.prefs.fullPreview",{gradeNames:["fluid.prefs.prefsEditorLoader"],outerUiEnhancerOptions:"{originalEnhancerOptions}.options.originalUserOptions",outerUiEnhancerGrades:"{originalEnhancerOptions}.uiEnhancer.options.userGrades",components:{prefsEditor:{container:"{that}.container",options:{components:{preview:{type:"fluid.prefs.preview",createOnEvent:"onReady",container:"{prefsEditor}.dom.previewFrame",options:{listeners:{"onReady.boilOnPreviewReady":"{fullPreview}.events.onPreviewReady"}}}},listeners:{"onReady.boilOnPrefsEditorReady":"{fullPreview}.events.onPrefsEditorReady"},distributeOptions:{source:"{that}.options.preview",removeSource:!0,target:"{that > preview}.options"}}}},events:{onPrefsEditorReady:null,onPreviewReady:null,onReady:{events:{onPrefsEditorReady:"onPrefsEditorReady",onPreviewReady:"onPreviewReady"},args:"{that}"}},distributeOptions:[{source:"{that}.options.outerUiEnhancerOptions",target:"{that enhancer}.options"},{source:"{that}.options.preview",target:"{that preview}.options"},{source:"{that}.options.previewEnhancer",target:"{that enhancer}.options"},{source:"{that}.options.outerUiEnhancerGrades",target:"{that enhancer}.options.gradeNames"}]})}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.prefs.schemas"),fluid.prefs.schemas.merge=function(target,source){return target||(target={type:"object",properties:{}}),source=source.properties||source,$.extend(!0,target.properties,source),target},fluid.defaults("fluid.prefs.primaryBuilder",{gradeNames:["fluid.component","{that}.buildPrimary"],schemaIndex:{expander:{func:"fluid.indexDefaults",args:["schemaIndex",{gradeNames:"fluid.prefs.schemas",indexFunc:"fluid.prefs.primaryBuilder.defaultSchemaIndexer"}]}},primarySchema:{},typeFilter:[],invokers:{buildPrimary:{funcName:"fluid.prefs.primaryBuilder.buildPrimary",args:["{that}.options.schemaIndex","{that}.options.typeFilter","{that}.options.primarySchema"]}}}),fluid.prefs.primaryBuilder.buildPrimary=function(schemaIndex,typeFilter,primarySchema){var suppliedPrimaryGradeName="fluid.prefs.schemas.suppliedPrimary"+fluid.allocateGuid();fluid.defaults(suppliedPrimaryGradeName,{gradeNames:["fluid.prefs.schemas"],schema:fluid.filterKeys(primarySchema.properties||primarySchema,typeFilter,!1)});var primary=[];return fluid.each(typeFilter,function(type){var schemaGrades=schemaIndex[type];schemaGrades&&primary.push.apply(primary,schemaGrades)}),primary.push(suppliedPrimaryGradeName),primary},fluid.prefs.primaryBuilder.defaultSchemaIndexer=function(defaults){if(defaults.schema)return fluid.keys(defaults.schema.properties)},fluid.defaults("fluid.prefs.schemas",{gradeNames:["fluid.component"],mergePolicy:{schema:fluid.prefs.schemas.merge}})}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.prefs"),fluid.defaults("fluid.prefs.auxSchema",{gradeNames:["fluid.component"],auxiliarySchema:{loaderGrades:["fluid.prefs.separatedPanel"]}}),fluid.prefs.expandSchemaValue=function(root,pathRef){return"@"!==pathRef.charAt(0)?pathRef:fluid.get(root,pathRef.substring(1))},fluid.prefs.addAtPath=function(root,path,object){var existingObject=fluid.get(root,path);return fluid.set(root,path,$.extend(!0,{},existingObject,object)),root},fluid.prefs.removeKey=function(root,key){var value=root[key];return delete root[key],value},fluid.prefs.rearrangeDirect=function(root,toPath,sourcePath){var result={},sourceValue=fluid.prefs.removeKey(root,sourcePath);return sourceValue&&fluid.set(result,toPath,sourceValue),result},fluid.prefs.addCommonOptions=function(root,path,commonOptions,templateValues){templateValues=templateValues||{};var existingValue=fluid.get(root,path);if(!existingValue)return root;var opts={},mergePolicy={};return fluid.each(commonOptions,function(value,key){if("container"===key){var componentType=fluid.get(root,[path,"type"]),componentOptions=fluid.defaults(componentType);if(void 0===fluid.get(componentOptions,["argumentMap","container"]))return!1}key.indexOf("gradeNames")!==-1&&(mergePolicy[key]=fluid.arrayConcatPolicy),key=fluid.stringTemplate(key,templateValues),value="string"==typeof value?fluid.stringTemplate(value,templateValues):value,fluid.set(opts,key,value)}),fluid.set(root,path,fluid.merge(mergePolicy,existingValue,opts)),root},fluid.prefs.containerNeeded=function(root,path){var componentType=fluid.get(root,[path,"type"]),componentOptions=fluid.defaults(componentType);return fluid.hasGrade(componentOptions,"fluid.viewComponent")||fluid.hasGrade(componentOptions,"fluid.rendererComponent")},fluid.prefs.checkPrimarySchema=function(primarySchema,prefKey){return primarySchema||fluid.fail("The primary schema for "+prefKey+" is not defined."),!!primarySchema},fluid.prefs.expandSchemaComponents=function(auxSchema,type,prefKey,componentConfig,index,commonOptions,modelCommonOptions,mappedDefaults){var componentOptions=fluid.copy(componentConfig)||{},components={},initialModel={},componentName=fluid.prefs.removeKey(componentOptions,"type"),regexp=new RegExp("\\.","g"),memberName=componentName.replace(regexp,"_"),flattenedPrefKey=prefKey.replace(regexp,"_");if(componentName){components[memberName]={type:componentName,options:componentOptions};var selectors=fluid.prefs.rearrangeDirect(componentOptions,memberName,"container"),templates=fluid.prefs.rearrangeDirect(componentOptions,memberName,"template"),messages=fluid.prefs.rearrangeDirect(componentOptions,memberName,"message"),preferenceMap=fluid.defaults(componentName).preferenceMap,map=preferenceMap[prefKey],prefSchema=mappedDefaults[prefKey];fluid.each(map,function(primaryPath,internalPath){if(fluid.prefs.checkPrimarySchema(prefSchema,prefKey)){var opts={};if(0===internalPath.indexOf("model.")){var internalModelName=internalPath.slice(6);fluid.set(opts,"model",fluid.get(opts,"model")||{}),fluid.prefs.addCommonOptions(opts,"model",modelCommonOptions,{internalModelName:internalModelName,externalModelName:flattenedPrefKey}),fluid.set(initialModel,["members","initialModel","preferences",flattenedPrefKey],prefSchema[primaryPath])}else fluid.set(opts,internalPath,prefSchema[primaryPath]);$.extend(!0,componentOptions,opts)}}),fluid.prefs.addCommonOptions(components,memberName,commonOptions,{prefKey:memberName}),fluid.prefs.addAtPath(auxSchema,[type,"components"],components),fluid.prefs.addAtPath(auxSchema,[type,"selectors"],selectors),fluid.prefs.addAtPath(auxSchema,["templateLoader","resources"],templates),fluid.prefs.addAtPath(auxSchema,["messageLoader","resources"],messages),fluid.prefs.addAtPath(auxSchema,"initialModel",initialModel)}return auxSchema},fluid.prefs.expandSchemaImpl=function(schemaToExpand,altSource){var expandedSchema=fluid.copy(schemaToExpand);return altSource=altSource||expandedSchema,fluid.each(expandedSchema,function(value,key){if("object"==typeof value)expandedSchema[key]=fluid.prefs.expandSchemaImpl(value,altSource);else if("string"==typeof value){var expandedVal=fluid.prefs.expandSchemaValue(altSource,value);void 0!==expandedVal?expandedSchema[key]=expandedVal:delete expandedSchema[key]}}),expandedSchema},fluid.prefs.expandCompositePanels=function(auxSchema,compositePanelList,panelIndex,panelCommonOptions,subPanelCommonOptions,compositePanelBasedOnSubCommonOptions,panelModelCommonOptions,mappedDefaults){var panelsToIgnore=[];return fluid.each(compositePanelList,function(compositeDetail,compositeKey){var compositePanelOptions={},components={},initialModel={},selectors={},templates={},messages={},selectorsToIgnore=[],thisCompositeOptions=fluid.copy(compositeDetail);fluid.set(compositePanelOptions,"type",thisCompositeOptions.type),delete thisCompositeOptions.type,selectors=fluid.prefs.rearrangeDirect(thisCompositeOptions,compositeKey,"container"),templates=fluid.prefs.rearrangeDirect(thisCompositeOptions,compositeKey,"template"),messages=fluid.prefs.rearrangeDirect(thisCompositeOptions,compositeKey,"message");var subPanelList=[],subPanels={},subPanelRenderOn={};fluid.isPlainObject(thisCompositeOptions.panels)&&!fluid.isArrayable(thisCompositeOptions.panels)?fluid.each(thisCompositeOptions.panels,function(subpanelArray,pref){subPanelList=subPanelList.concat(subpanelArray),"always"!==pref&&fluid.each(subpanelArray,function(onePanel){fluid.set(subPanelRenderOn,onePanel,pref)})}):subPanelList=thisCompositeOptions.panels,fluid.each(subPanelList,function(subPanelID){panelsToIgnore.push(subPanelID);var subPanelPrefsKey=fluid.get(auxSchema,[subPanelID,"type"]),safeSubPanelPrefsKey=fluid.prefs.subPanel.safePrefKey(subPanelPrefsKey);selectorsToIgnore.push(safeSubPanelPrefsKey);var subPanelOptions=fluid.copy(fluid.get(auxSchema,[subPanelID,"panel"])),subPanelType=fluid.get(subPanelOptions,"type");fluid.set(subPanels,[safeSubPanelPrefsKey,"type"],subPanelType);var renderOn=fluid.get(subPanelRenderOn,subPanelID);renderOn&&fluid.set(subPanels,[safeSubPanelPrefsKey,"options","renderOnPreference"],renderOn);var map=fluid.defaults(subPanelType).preferenceMap[subPanelPrefsKey],prefSchema=mappedDefaults[subPanelPrefsKey];fluid.each(map,function(primaryPath,internalPath){if(fluid.prefs.checkPrimarySchema(prefSchema,subPanelPrefsKey)){var opts;0===internalPath.indexOf("model.")?(fluid.set(compositePanelOptions,["options","model"],fluid.get(compositePanelOptions,["options","model"])||{}),fluid.prefs.addCommonOptions(compositePanelOptions,["options","model"],panelModelCommonOptions,{internalModelName:safeSubPanelPrefsKey,externalModelName:safeSubPanelPrefsKey}),fluid.set(initialModel,["members","initialModel","preferences",safeSubPanelPrefsKey],prefSchema[primaryPath])):(opts=opts||{options:{}},fluid.set(opts,"options."+internalPath,prefSchema[primaryPath])),$.extend(!0,subPanels[safeSubPanelPrefsKey],opts)}}),fluid.set(templates,safeSubPanelPrefsKey,fluid.get(subPanelOptions,"template")),fluid.set(messages,safeSubPanelPrefsKey,fluid.get(subPanelOptions,"message")),fluid.set(compositePanelOptions,["options","selectors",safeSubPanelPrefsKey],fluid.get(subPanelOptions,"container")),fluid.set(compositePanelOptions,["options","resources"],fluid.get(compositePanelOptions,["options","resources"])||{}),fluid.prefs.addCommonOptions(compositePanelOptions.options,"resources",compositePanelBasedOnSubCommonOptions,{subPrefKey:safeSubPanelPrefsKey}),delete subPanelOptions.type,delete subPanelOptions.template,delete subPanelOptions.message,delete subPanelOptions.container,fluid.set(subPanels,[safeSubPanelPrefsKey,"options"],$.extend(!0,{},fluid.get(subPanels,[safeSubPanelPrefsKey,"options"]),subPanelOptions)),fluid.prefs.addCommonOptions(subPanels,safeSubPanelPrefsKey,subPanelCommonOptions,{compositePanel:compositeKey,prefKey:safeSubPanelPrefsKey})}),delete thisCompositeOptions.panels,fluid.set(compositePanelOptions,["options"],$.extend(!0,{},compositePanelOptions.options,thisCompositeOptions)),fluid.set(compositePanelOptions,["options","selectorsToIgnore"],selectorsToIgnore),fluid.set(compositePanelOptions,["options","components"],subPanels),components[compositeKey]=compositePanelOptions,fluid.prefs.addCommonOptions(components,compositeKey,panelCommonOptions,{prefKey:compositeKey}),fluid.prefs.addAtPath(auxSchema,["panels","components"],components),fluid.prefs.addAtPath(auxSchema,["panels","selectors"],selectors),fluid.prefs.addAtPath(auxSchema,["templateLoader","resources"],templates),fluid.prefs.addAtPath(auxSchema,["messageLoader","resources"],messages),fluid.prefs.addAtPath(auxSchema,"initialModel",initialModel),$.extend(!0,auxSchema,{panelsToIgnore:panelsToIgnore})}),auxSchema},fluid.prefs.expandSchema=function(schemaToExpand,indexes,topCommonOptions,elementCommonOptions,mappedDefaults){var auxSchema=fluid.prefs.expandSchemaImpl(schemaToExpand);auxSchema.namespace=auxSchema.namespace||"fluid.prefs.created_"+fluid.allocateGuid();var terms=fluid.get(auxSchema,"terms");terms&&(delete auxSchema.terms,fluid.set(auxSchema,["terms","terms"],terms));var compositePanelList=fluid.get(auxSchema,"groups");return compositePanelList&&fluid.prefs.expandCompositePanels(auxSchema,compositePanelList,fluid.get(indexes,"panel"),fluid.get(elementCommonOptions,"panel"),fluid.get(elementCommonOptions,"subPanel"),fluid.get(elementCommonOptions,"compositePanelBasedOnSub"),fluid.get(elementCommonOptions,"panelModel"),mappedDefaults),fluid.each(auxSchema,function(category,prefName){var type="panel";category[type]&&!fluid.contains(auxSchema.panelsToIgnore,prefName)&&fluid.prefs.expandSchemaComponents(auxSchema,"panels",category.type,category[type],fluid.get(indexes,type),fluid.get(elementCommonOptions,type),fluid.get(elementCommonOptions,type+"Model"),mappedDefaults),type="enactor",category[type]&&fluid.prefs.expandSchemaComponents(auxSchema,"enactors",category.type,category[type],fluid.get(indexes,type),fluid.get(elementCommonOptions,type),fluid.get(elementCommonOptions,type+"Model"),mappedDefaults),fluid.each(["template","message"],function(type){prefName===type&&(fluid.set(auxSchema,[type+"Loader","resources","prefsEditor"],auxSchema[type]),delete auxSchema[type])})}),auxSchema.panelsToIgnore&&delete auxSchema.panelsToIgnore,fluid.each(topCommonOptions,function(topOptions,type){fluid.prefs.addCommonOptions(auxSchema,type,topOptions)}),auxSchema},fluid.defaults("fluid.prefs.auxBuilder",{gradeNames:["fluid.prefs.auxSchema"],mergePolicy:{elementCommonOptions:"noexpand"},topCommonOptions:{panels:{gradeNames:["fluid.prefs.prefsEditor"]},enactors:{gradeNames:["fluid.uiEnhancer"]},templateLoader:{gradeNames:["fluid.resourceLoader"]},messageLoader:{gradeNames:["fluid.resourceLoader"]},initialModel:{gradeNames:["fluid.prefs.initialModel"]},terms:{gradeNames:["fluid.component"]}},elementCommonOptions:{panel:{createOnEvent:"onPrefsEditorMarkupReady",container:"{prefsEditor}.dom.%prefKey","options.gradeNames":"fluid.prefs.prefsEditorConnections","options.resources.template":"{templateLoader}.resources.%prefKey","options.messageBase":"{messageLoader}.resources.%prefKey.resourceText"},panelModel:{"%internalModelName":"{prefsEditor}.model.preferences.%externalModelName"},compositePanelBasedOnSub:{"%subPrefKey":"{templateLoader}.resources.%subPrefKey"},subPanel:{container:"{%compositePanel}.dom.%prefKey","options.messageBase":"{messageLoader}.resources.%prefKey.resourceText"},enactor:{container:"{uiEnhancer}.container"},enactorModel:{"%internalModelName":"{uiEnhancer}.model.%externalModelName"}},indexes:{panel:{expander:{func:"fluid.indexDefaults",args:["panelsIndex",{gradeNames:"fluid.prefs.panel",indexFunc:"fluid.prefs.auxBuilder.prefMapIndexer"}]}},enactor:{expander:{func:"fluid.indexDefaults",args:["enactorsIndex",{gradeNames:"fluid.prefs.enactor",indexFunc:"fluid.prefs.auxBuilder.prefMapIndexer"}]}}},mappedDefaults:{},expandedAuxSchema:{expander:{func:"fluid.prefs.expandSchema",args:["{that}.options.auxiliarySchema","{that}.options.indexes","{that}.options.topCommonOptions","{that}.options.elementCommonOptions","{that}.options.mappedDefaults"]}}}),fluid.prefs.auxBuilder.prefMapIndexer=function(defaults){return fluid.keys(defaults.preferenceMap)}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function(fluid){"use strict";fluid.defaults("fluid.prefs.termsAware"),fluid.defaults("fluid.prefs.auxSchema.starter.textSize",{gradeNames:["fluid.contextAware"],auxiliarySchema:{textSize:{type:"fluid.prefs.textSize",enactor:{type:"fluid.prefs.enactor.textSize"},panel:{type:"fluid.prefs.panel.textSize",container:".flc-prefsEditor-text-size",message:"%messagePrefix/textSize.json"}}},contextAwareness:{textSizeSliderVariety:{checks:{jQueryUI:{contextValue:"{fluid.prefsWidgetType}",equals:"jQueryUI",gradeNames:"fluid.prefs.auxSchema.starter.textSize.jQueryUI"}},defaultGradeNames:"fluid.prefs.auxSchema.starter.textSize.nativeHTML"}}}),fluid.defaults("fluid.prefs.auxSchema.starter.textSize.nativeHTML",{auxiliarySchema:{textSize:{panel:{template:"%templatePrefix/PrefsEditorTemplate-textSize-nativeHTML.html"}}}}),fluid.defaults("fluid.prefs.auxSchema.starter.textSize.jQueryUI",{auxiliarySchema:{textSize:{panel:{template:"%templatePrefix/PrefsEditorTemplate-textSize-jQueryUI.html"}}}}),fluid.defaults("fluid.prefs.auxSchema.starter.lineSpace",{gradeNames:["fluid.contextAware"],auxiliarySchema:{lineSpace:{type:"fluid.prefs.lineSpace",enactor:{type:"fluid.prefs.enactor.lineSpace",fontSizeMap:{"xx-small":"9px","x-small":"11px",small:"13px",medium:"15px",large:"18px","x-large":"23px","xx-large":"30px"}},panel:{type:"fluid.prefs.panel.lineSpace",container:".flc-prefsEditor-line-space",message:"%messagePrefix/lineSpace.json"}}},contextAwareness:{lineSpaceSliderVariety:{checks:{jQueryUI:{contextValue:"{fluid.prefsWidgetType}",equals:"jQueryUI",gradeNames:"fluid.prefs.auxSchema.starter.lineSpace.jQueryUI"}},defaultGradeNames:"fluid.prefs.auxSchema.starter.lineSpace.nativeHTML"}}}),fluid.defaults("fluid.prefs.auxSchema.starter.lineSpace.nativeHTML",{auxiliarySchema:{lineSpace:{panel:{template:"%templatePrefix/PrefsEditorTemplate-lineSpace-nativeHTML.html"}}}}),fluid.defaults("fluid.prefs.auxSchema.starter.lineSpace.jQueryUI",{auxiliarySchema:{lineSpace:{panel:{template:"%templatePrefix/PrefsEditorTemplate-lineSpace-jQueryUI.html"}}}
}),fluid.defaults("fluid.prefs.auxSchema.starter",{gradeNames:["fluid.prefs.auxSchema","fluid.prefs.auxSchema.starter.lineSpace","fluid.prefs.auxSchema.starter.textSize"],auxiliarySchema:{loaderGrades:["fluid.prefs.separatedPanel"],namespace:"fluid.prefs.constructed",terms:{templatePrefix:"../../framework/preferences/html",messagePrefix:"../../framework/preferences/messages"},template:"%templatePrefix/SeparatedPanelPrefsEditor.html",message:"%messagePrefix/prefsEditor.json",textFont:{type:"fluid.prefs.textFont",classes:{"default":"",times:"fl-font-times",comic:"fl-font-comic-sans",arial:"fl-font-arial",verdana:"fl-font-verdana"},enactor:{type:"fluid.prefs.enactor.textFont",classes:"@textFont.classes"},panel:{type:"fluid.prefs.panel.textFont",container:".flc-prefsEditor-text-font",classnameMap:{textFont:"@textFont.classes"},template:"%templatePrefix/PrefsEditorTemplate-textFont.html",message:"%messagePrefix/textFont.json"}},contrast:{type:"fluid.prefs.contrast",classes:{"default":"fl-theme-prefsEditor-default",bw:"fl-theme-bw",wb:"fl-theme-wb",by:"fl-theme-by",yb:"fl-theme-yb",lgdg:"fl-theme-lgdg"},enactor:{type:"fluid.prefs.enactor.contrast",classes:"@contrast.classes"},panel:{type:"fluid.prefs.panel.contrast",container:".flc-prefsEditor-contrast",classnameMap:{theme:"@contrast.classes"},template:"%templatePrefix/PrefsEditorTemplate-contrast.html",message:"%messagePrefix/contrast.json"}},tableOfContents:{type:"fluid.prefs.tableOfContents",enactor:{type:"fluid.prefs.enactor.tableOfContents",tocTemplate:"../../components/tableOfContents/html/TableOfContents.html"},panel:{type:"fluid.prefs.panel.layoutControls",container:".flc-prefsEditor-layout-controls",template:"%templatePrefix/PrefsEditorTemplate-layout.html",message:"%messagePrefix/tableOfContents.json"}},emphasizeLinks:{type:"fluid.prefs.emphasizeLinks",enactor:{type:"fluid.prefs.enactor.emphasizeLinks",cssClass:"fl-link-enhanced"},panel:{type:"fluid.prefs.panel.emphasizeLinks",container:".flc-prefsEditor-emphasizeLinks",template:"%templatePrefix/PrefsEditorTemplate-emphasizeLinks.html",message:"%messagePrefix/emphasizeLinks.json"}},inputsLarger:{type:"fluid.prefs.inputsLarger",enactor:{type:"fluid.prefs.enactor.inputsLarger",cssClass:"fl-text-larger"},panel:{type:"fluid.prefs.panel.inputsLarger",container:".flc-prefsEditor-inputsLarger",template:"%templatePrefix/PrefsEditorTemplate-inputsLarger.html",message:"%messagePrefix/inputsLarger.json"}},groups:{linksControls:{container:".flc-prefsEditor-links-controls",template:"%templatePrefix/PrefsEditorTemplate-linksControls.html",message:"%messagePrefix/linksControls.json",type:"fluid.prefs.panel.linksControls",panels:["emphasizeLinks","inputsLarger"]}}}}),fluid.defaults("fluid.prefs.schemas.textSize",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.textSize":{type:"number","default":1,minimum:1,maximum:2,divisibleBy:.1}}}),fluid.defaults("fluid.prefs.schemas.lineSpace",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.lineSpace":{type:"number","default":1,minimum:1,maximum:2,divisibleBy:.1}}}),fluid.defaults("fluid.prefs.schemas.textFont",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.textFont":{type:"string","default":"default","enum":["default","times","comic","arial","verdana"]}}}),fluid.defaults("fluid.prefs.schemas.contrast",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.contrast":{type:"string","default":"default","enum":["default","bw","wb","by","yb","lgdg"]}}}),fluid.defaults("fluid.prefs.schemas.tableOfContents",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.tableOfContents":{type:"boolean","default":!1}}}),fluid.defaults("fluid.prefs.schemas.emphasizeLinks",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.emphasizeLinks":{type:"boolean","default":!1}}}),fluid.defaults("fluid.prefs.schemas.inputsLarger",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.inputsLarger":{type:"boolean","default":!1}}})}(fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function(fluid){"use strict";fluid.defaults("fluid.prefs.auxSchema.speak",{gradeNames:["fluid.prefs.auxSchema"],auxiliarySchema:{namespace:"fluid.prefs.constructed",terms:{templatePrefix:"../../framework/preferences/html/",messagePrefix:"../../framework/preferences/messages/"},template:"%templatePrefix/SeparatedPanelPrefsEditor.html",message:"%messagePrefix/prefsEditor.json",speak:{type:"fluid.prefs.speak",enactor:{type:"fluid.prefs.enactor.selfVoicing",container:"body"},panel:{type:"fluid.prefs.panel.speak",container:".flc-prefsEditor-speak",template:"%templatePrefix/PrefsEditorTemplate-speak.html",message:"%messagePrefix/speak.json"}}}}),fluid.defaults("fluid.prefs.schemas.speak",{gradeNames:["fluid.prefs.schemas"],schema:{"fluid.prefs.speak":{type:"boolean","default":!1}}})}(fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.registerNamespace("fluid.prefs"),fluid.defaults("fluid.prefs.builder",{gradeNames:["fluid.component","fluid.prefs.auxBuilder"],mergePolicy:{auxSchema:"expandedAuxSchema"},assembledPrefsEditorGrade:{expander:{func:"fluid.prefs.builder.generateGrade",args:["prefsEditor","{that}.options.auxSchema.namespace",{gradeNames:["fluid.prefs.assembler.prefsEd","fluid.viewComponent"],componentGrades:"{that}.options.constructedGrades",loaderGrades:"{that}.options.auxSchema.loaderGrades"}]}},assembledUIEGrade:{expander:{func:"fluid.prefs.builder.generateGrade",args:["uie","{that}.options.auxSchema.namespace",{gradeNames:["fluid.viewComponent","fluid.prefs.assembler.uie"],componentGrades:"{that}.options.constructedGrades"}]}},constructedGrades:{expander:{func:"fluid.prefs.builder.constructGrades",args:["{that}.options.auxSchema",["enactors","messages","panels","initialModel","templateLoader","messageLoader","terms"]]}},mappedDefaults:"{primaryBuilder}.options.schema.properties",components:{primaryBuilder:{type:"fluid.prefs.primaryBuilder",options:{typeFilter:{expander:{func:"fluid.prefs.builder.parseAuxSchema",args:"{builder}.options.auxiliarySchema"}}}}},distributeOptions:[{source:"{that}.options.primarySchema",removeSource:!0,target:"{that > primaryBuilder}.options.primarySchema"}]}),fluid.defaults("fluid.prefs.assembler.uie",{gradeNames:["fluid.viewComponent"],components:{store:{type:"fluid.prefs.globalSettingsStore",options:{distributeOptions:{target:"{that fluid.prefs.store}.options.contextAwareness.strategy.checks.user",record:{contextValue:"{fluid.prefs.assembler.uie}.options.storeType",gradeNames:"{fluid.prefs.assembler.uie}.options.storeType"}}}},enhancer:{type:"fluid.component",options:{gradeNames:"{that}.options.enhancerType",enhancerType:"fluid.pageEnhancer",components:{uiEnhancer:{options:{gradeNames:["{fluid.prefs.assembler.uie}.options.componentGrades.enactors"]}}}}}},distributeOptions:[{source:"{that}.options.enhancer",target:"{that uiEnhancer}.options",removeSource:!0},{source:"{that}.options.store",target:"{that fluid.prefs.store}.options"},{source:"{that}.options.enhancerType",target:"{that > enhancer}.options.enhancerType"}]}),fluid.defaults("fluid.prefs.assembler.prefsEd",{gradeNames:["fluid.viewComponent","fluid.prefs.assembler.uie"],components:{prefsEditorLoader:{type:"fluid.viewComponent",container:"{fluid.prefs.assembler.prefsEd}.container",priority:"last",options:{gradeNames:["{fluid.prefs.assembler.prefsEd}.options.componentGrades.terms","{fluid.prefs.assembler.prefsEd}.options.componentGrades.messages","{fluid.prefs.assembler.prefsEd}.options.componentGrades.initialModel","{that}.options.loaderGrades"],templateLoader:{gradeNames:["{fluid.prefs.assembler.prefsEd}.options.componentGrades.templateLoader"]},messageLoader:{gradeNames:["{fluid.prefs.assembler.prefsEd}.options.componentGrades.messageLoader"]},prefsEditor:{gradeNames:["{fluid.prefs.assembler.prefsEd}.options.componentGrades.panels","fluid.prefs.uiEnhancerRelay"]},events:{onReady:"{fluid.prefs.assembler.prefsEd}.events.onPrefsEditorReady"}}}},events:{onPrefsEditorReady:null,onReady:{events:{onPrefsEditorReady:"onPrefsEditorReady",onCreate:"onCreate"},args:["{that}"]}},distributeOptions:[{source:"{that}.options.loaderGrades",removeSource:!0,target:"{that > prefsEditorLoader}.options.loaderGrades"},{source:"{that}.options.prefsEditor",removeSource:!0,target:"{that prefsEditor}.options"},{source:"{that}.options.terms",removeSource:!0,target:"{that prefsEditorLoader}.options.terms"}]}),fluid.prefs.builder.generateGrade=function(name,namespace,options){var gradeNameTemplate="%namespace.%name",gradeName=fluid.stringTemplate(gradeNameTemplate,{name:name,namespace:namespace});return fluid.defaults(gradeName,options),gradeName},fluid.prefs.builder.constructGrades=function(auxSchema,gradeCategories){var constructedGrades={};return fluid.each(gradeCategories,function(category){var gradeOpts=auxSchema[category];fluid.get(gradeOpts,"gradeNames")&&(constructedGrades[category]=fluid.prefs.builder.generateGrade(category,auxSchema.namespace,gradeOpts))}),constructedGrades},fluid.prefs.builder.parseAuxSchema=function(auxSchema){var auxTypes=[];return fluid.each(auxSchema,function(field){var type=field.type;type&&auxTypes.push(type)}),auxTypes},fluid.prefs.create=function(container,options){options=options||{};var builder=fluid.prefs.builder(options.build);return fluid.invokeGlobalFunction(builder.options.assembledPrefsEditorGrade,[container,options.prefsEditor])}}(jQuery,fluid_2_0_0);var fluid_2_0_0=fluid_2_0_0||{};!function($,fluid){"use strict";fluid.prefs.builder({gradeNames:["fluid.prefs.auxSchema.starter"]}),fluid.defaults("fluid.uiOptions.prefsEditor",{gradeNames:["fluid.prefs.constructed.prefsEditor"],lazyLoad:!1,distributeOptions:[{record:"{that}.options.lazyLoad",target:"{that separatedPanel}.options.lazyLoad"},{source:"{that}.options.tocTemplate",target:"{that uiEnhancer}.options.tocTemplate"},{source:"{that}.options.ignoreForToC",target:"{that uiEnhancer}.options.ignoreForToC"}],enhancer:{distributeOptions:[{source:"{that}.options.tocTemplate",target:"{that > fluid.prefs.enactor.tableOfContents}.options.tocTemplate"},{source:"{that}.options.ignoreForToC",target:"{that > fluid.prefs.enactor.tableOfContents}.options.ignoreForToC"}]}})}(jQuery,fluid_2_0_0);
//# sourceMappingURL=infusion-uiOptions.js.map