for(var userAgentInfo=navigator.userAgent,mobileAgents=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"],platformIs="pc",v=0;v<mobileAgents.length;v++)if(userAgentInfo.indexOf(mobileAgents[v])>0){platformIs="mobile";break}var clientIs="pc",screenWidth=window.screen.width,screenHeight=window.screen.height;function randomChars(len){len=len||8;var chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefjhijklmnopqrstuvwxyz123456789",max=chars.length,result="";for(i=0;i<len;i++)result+=chars.charAt(Math.floor(Math.random()*max));return result}clientIs=screenWidth<500?"phone":screenWidth>500&&screenWidth<900?"pad":screenWidth>900&&screenWidth<1200?"padflip":screenWidth>1200&&screenWidth<1500?"padpro":"pc",function($,window,undefined){var elems=$([]),jq_resize=$.resize=$.extend($.resize,{}),timeout_id,str_setTimeout="setTimeout",str_resize="resize",str_data="resize-special-event",str_delay="delay",str_throttle="throttleWindow";function loopy(){timeout_id=window.setTimeout((function(){elems.each((function(){var elem=$(this),width=elem.width(),height=elem.height(),data=$.data(this,str_data);width===data.w&&height===data.h||elem.trigger("resize",[data.w=width,data.h=height])})),loopy()}),jq_resize.delay)}jq_resize.delay=250,jq_resize[str_throttle]=!0,$.event.special.resize={setup:function(){if(!jq_resize[str_throttle]&&this.setTimeout)return!1;var elem=$(this);elems=elems.add(elem),$.data(this,str_data,{w:elem.width(),h:elem.height()}),1===elems.length&&loopy()},teardown:function(){if(!jq_resize[str_throttle]&&this.setTimeout)return!1;var elem=$(this);elems=elems.not(elem),elem.removeData(str_data),elems.length||clearTimeout(timeout_id)},add:function(handleObj){if(!jq_resize[str_throttle]&&this.setTimeout)return!1;var old_handler;function new_handler(e,w,h){var elem=$(this),data=$.data(this,str_data);data.w=void 0!==w?w:elem.width(),data.h=void 0!==h?h:elem.height(),old_handler.apply(this,arguments)}if($.isFunction(handleObj))return old_handler=handleObj,new_handler;old_handler=handleObj.handler,handleObj.handler=new_handler}}}(jQuery,this),jQuery.cookie=function(name,value,options){if(void 0===value){var cookieValue=null;if(document.cookie&&""!=document.cookie)for(var cookies=document.cookie.split(";"),i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==name+"="){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break}}return cookieValue}options=options||{},null===value&&(value="",(options=$.extend({},options)).expires=-1);var expires="",date;options.expires&&("number"==typeof options.expires||options.expires.toUTCString)&&("number"==typeof options.expires?(date=new Date).setTime(date.getTime()+24*options.expires*60*60*1e3):date=options.expires,expires="; expires="+date.toUTCString());var path=options.path?"; path="+options.path:"",domain=options.domain?"; domain="+options.domain:"",secure=options.secure?"; secure":"";document.cookie=[name,"=",encodeURIComponent(value),expires,path,domain,secure].join("")},function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof exports?module.exports=factory(require("jquery")):factory(jQuery)}((function(jQuery){"use strict";var domfocus=!1,mousefocus=!1,tabindexcounter=0,ascrailcounter=2e3,globalmaxzindex=0,$=jQuery,_doc=document,_win=window,$window=$(_win),delegatevents=[];function getScriptPath(){var scripts=_doc.currentScript||!!(s=_doc.getElementsByTagName("script")).length&&s[s.length-1],s,path=scripts?scripts.src.split("?")[0]:"";return path.split("/").length>0?path.split("/").slice(0,-1).join("/")+"/":""}var setAnimationFrame=_win.requestAnimationFrame||_win.webkitRequestAnimationFrame||_win.mozRequestAnimationFrame||!1,clearAnimationFrame=_win.cancelAnimationFrame||_win.webkitCancelAnimationFrame||_win.mozCancelAnimationFrame||!1;if(setAnimationFrame)_win.cancelAnimationFrame||(clearAnimationFrame=function(id){});else{var anilasttime=0;setAnimationFrame=function(callback,element){var currTime=(new Date).getTime(),timeToCall=Math.max(0,16-(currTime-anilasttime)),id=_win.setTimeout((function(){callback(currTime+timeToCall)}),timeToCall);return anilasttime=currTime+timeToCall,id},clearAnimationFrame=function(id){_win.clearTimeout(id)}}var ClsMutationObserver=_win.MutationObserver||_win.WebKitMutationObserver||!1,now=Date.now||function(){return(new Date).getTime()},_globaloptions={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"rgba(0,0,0,.3)",cursorcolorHover:"rgba(0,0,0,.4)",cursorwidth:"6px",cursorwidthHover:"14px",cursorborder:"0px solid #fff",cursorborderradius:"0px",scrollspeed:40,mousescrollstep:27,touchbehavior:!1,emulatetouch:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"rgba(0,0,0,.04)",iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!1,railhoffset:!1,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:!0,horizrailenabled:!0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",scriptpath:getScriptPath(),preventmultitouchscrolling:!0,disablemutationobserver:!1,enableobserver:!0,scrollbarid:!1,scrollCLass:!1},svgExpand='<svg viewBox="0 0 1024 1024"  xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path fill="rgba(0,0,0,.6)" d="M926.25224651 149.52928355a51.78153127 51.78153127 0 0 0-51.78153006-51.78153006h-258.90765513a51.78153127 51.78153127 0 0 0 0 103.56306133h133.07853513l-169.84342163 170.36123613a51.78153127 51.78153127 0 0 0 0 73.52977423 51.78153127 51.78153127 0 0 0 73.52977423 0L822.68918518 274.84058905V408.43693868a51.78153127 51.78153127 0 0 0 51.78153127 51.78153005 51.78153127 51.78153127 0 0 0 51.78153006-51.78153005zM445.20182518 578.79817482a51.78153127 51.78153127 0 0 0-73.52977423 0L201.31081482 748.64159645V615.56306132a51.78153127 51.78153127 0 0 0-51.78153127-51.78153005 51.78153127 51.78153127 0 0 0-51.78153006 51.78153005v258.90765513a51.78153127 51.78153127 0 0 0 51.78153006 51.78153006h258.90765513a51.78153127 51.78153127 0 0 0 0-103.56306133H274.84058905l170.36123613-170.36123613a51.78153127 51.78153127 0 0 0 0-73.52977423z"></path></svg>',svgCollapse='<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path fill="rgba(0,0,0,.6)" d="M874.47071645 356.65540741h-133.59634962l170.36123614-170.36123614a51.78153127 51.78153127 0 1 0-73.52977424-73.52977424L667.34459259 282.60781868V149.52928355a51.78153127 51.78153127 0 0 0-51.78153127-51.78153006 51.78153127 51.78153127 0 0 0-51.78153005 51.78153006v258.90765513a51.78153127 51.78153127 0 0 0 51.78153005 51.78153005h258.90765513a51.78153127 51.78153127 0 0 0 0-103.56306132zM408.43693868 563.78153127H149.52928355a51.78153127 51.78153127 0 0 0 0 103.56306132h133.07853513l-169.84342165 170.36123614a51.78153127 51.78153127 0 0 0 0 73.52977424 51.78153127 51.78153127 0 0 0 73.52977424 0L356.65540741 740.87436683V874.47071645a51.78153127 51.78153127 0 0 0 51.78153127 51.78153006 51.78153127 51.78153127 0 0 0 51.78153005-51.78153006v-258.90765513a51.78153127 51.78153127 0 0 0-51.78153005-51.78153005z"></path></svg>',browserdetected=!1,getBrowserDetection=function(){if(browserdetected)return browserdetected;var _el=_doc.createElement("DIV"),_style=_el.style,_agent=navigator.userAgent,_platform=navigator.platform,d={};function detectCursorGrab(){var lst=["grab","-webkit-grab","-moz-grab"];(d.ischrome&&!d.ischrome38||d.isie)&&(lst=[]);for(var a=0,l=lst.length;a<l;a++){var p=lst[a];if(_style.cursor=p,_style.cursor==p)return p}return"url(https://cdnjs.cloudflare.com/ajax/libs/slider-pro/1.3.0/css/images/openhand.cur),n-resize"}return d.haspointerlock="pointerLockElement"in _doc||"webkitPointerLockElement"in _doc||"mozPointerLockElement"in _doc,d.isopera="opera"in _win,d.isopera12=d.isopera&&"getUserMedia"in navigator,d.isoperamini="[object OperaMini]"===Object.prototype.toString.call(_win.operamini),d.isie="all"in _doc&&"attachEvent"in _el&&!d.isopera,d.isieold=d.isie&&!("msInterpolationMode"in _style),d.isie7=d.isie&&!d.isieold&&(!("documentMode"in _doc)||7===_doc.documentMode),d.isie8=d.isie&&"documentMode"in _doc&&8===_doc.documentMode,d.isie9=d.isie&&"performance"in _win&&9===_doc.documentMode,d.isie10=d.isie&&"performance"in _win&&10===_doc.documentMode,d.isie11="msRequestFullscreen"in _el&&_doc.documentMode>=11,d.ismsedge="msCredentials"in _win,d.ismozilla="MozAppearance"in _style,d.iswebkit=!d.ismsedge&&"WebkitAppearance"in _style,d.ischrome=d.iswebkit&&"chrome"in _win,d.ischrome38=d.ischrome&&"touchAction"in _style,d.ischrome22=!d.ischrome38&&d.ischrome&&d.haspointerlock,d.ischrome26=!d.ischrome38&&d.ischrome&&"transition"in _style,d.cantouch="ontouchstart"in _doc.documentElement||"ontouchstart"in _win,d.hasw3ctouch=!!_win.PointerEvent&&(navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),d.hasmstouch=!d.hasw3ctouch&&(_win.MSPointerEvent||!1),d.ismac=/^mac$/i.test(_platform),d.isios=d.cantouch&&/iphone|ipad|ipod/i.test(_platform),d.isios4=d.isios&&!("seal"in Object),d.isios7=d.isios&&"webkitHidden"in _doc,d.isios8=d.isios&&"hidden"in _doc,d.isios10=d.isios&&_win.Proxy,d.isandroid=/android/i.test(_agent),d.haseventlistener="addEventListener"in _el,d.trstyle=!1,d.hastransform=!1,d.hastranslate3d=!1,d.transitionstyle=!1,d.hastransition=!1,d.transitionend=!1,d.trstyle="transform",d.hastransform="transform"in _style||function(){for(var check=["msTransform","webkitTransform","MozTransform","OTransform"],a=0,c=check.length;a<c;a++)if(void 0!==_style[check[a]]){d.trstyle=check[a];break}d.hastransform=!!d.trstyle}(),d.hastransform&&(_style[d.trstyle]="translate3d(1px,2px,3px)",d.hastranslate3d=/translate3d/.test(_style[d.trstyle])),d.transitionstyle="transition",d.prefixstyle="",d.transitionend="transitionend",d.hastransition="transition"in _style||function(){d.transitionend=!1;for(var check=["webkitTransition","msTransition","MozTransition","OTransition","OTransition","KhtmlTransition"],prefix=["-webkit-","-ms-","-moz-","-o-","-o","-khtml-"],evs=["webkitTransitionEnd","msTransitionEnd","transitionend","otransitionend","oTransitionEnd","KhtmlTransitionEnd"],a=0,c=check.length;a<c;a++)if(check[a]in _style){d.transitionstyle=check[a],d.prefixstyle=prefix[a],d.transitionend=evs[a];break}d.ischrome26&&(d.prefixstyle=prefix[1]),d.hastransition=d.transitionstyle}(),d.cursorgrabvalue=detectCursorGrab(),d.hasmousecapture="setCapture"in _el,d.hasMutationObserver=!1!==ClsMutationObserver,_el=null,browserdetected=d,d},AxScrollClass=function(myopt,me){var self=this;this.version="3.7.6",this.name="axscroll",this.me=me;var $body=$("body"),opt=this.opt={doc:$body,win:!1};if($.extend(opt,_globaloptions),opt.snapbackspeed=80,myopt)for(var a in opt)void 0!==myopt[a]&&(opt[a]=myopt[a]);if(opt.disablemutationobserver&&(ClsMutationObserver=!1),this.doc=opt.doc,this.iddoc=this.doc&&this.doc[0]&&this.doc[0].id||"",this.ispage=/^BODY|HTML/.test(opt.win?opt.win[0].nodeName:this.doc[0].nodeName),this.haswrapper=!1!==opt.win,this.win=opt.win||(this.ispage?$window:this.doc),this.docscroll=this.ispage&&!this.haswrapper?$window:this.win,this.body=$body,this.viewport=!1,this.isfixed=!1,this.iframe=!1,this.isiframe="IFRAME"==this.doc[0].nodeName&&"IFRAME"==this.win[0].nodeName,this.istextarea="TEXTAREA"==this.win[0].nodeName,this.forcescreen=!1,this.canshowonmouseevent="scroll"!=opt.autohidemode,this.onmousedown=!1,this.onmouseup=!1,this.onmousemove=!1,this.onmousewheel=!1,this.onkeypress=!1,this.ongesturezoom=!1,this.onclick=!1,this.onscrollstart=!1,this.onscrollend=!1,this.onscrollcancel=!1,this.onzoomin=!1,this.onzoomout=!1,this.view=!1,this.page=!1,this.scroll={x:0,y:0},this.scrollratio={x:0,y:0},this.cursorheight=20,this.scrollvaluemax=0,"auto"==opt.rtlmode){var target=this.win[0]==_win?this.body:this.win,writingMode=target.css("writing-mode")||target.css("-webkit-writing-mode")||target.css("-ms-writing-mode")||target.css("-moz-writing-mode");"horizontal-tb"==writingMode||"lr-tb"==writingMode||""===writingMode?(this.isrtlmode="rtl"==target.css("direction"),this.isvertical=!1):(this.isrtlmode="vertical-rl"==writingMode||"tb"==writingMode||"tb-rl"==writingMode||"rl-tb"==writingMode,this.isvertical="vertical-rl"==writingMode||"tb"==writingMode||"tb-rl"==writingMode)}else this.isrtlmode=!0===opt.rtlmode,this.isvertical=!1;if(this.scrollrunning=!1,this.scrollmom=!1,this.observer=!1,this.observerremover=!1,this.observerbody=!1,!1!==opt.scrollbarid)this.id=opt.scrollbarid;else do{this.id="ascrail"+ascrailcounter++}while(_doc.getElementById(this.id));this.rail=!1,this.cursor=!1,this.cursorfreezed=!1,this.selectiondrag=!1,this.zoom=!1,this.zoomactive=!1,this.hasfocus=!1,this.hasmousefocus=!1,this.railslocked=!1,this.locked=!1,this.hidden=!1,this.cursoractive=!0,this.wheelprevented=!1,this.overflowx=opt.overflowx,this.overflowy=opt.overflowy,this.nativescrollingarea=!1,this.checkarea=0,this.events=[],this.saved={},this.delaylist={},this.synclist={},this.lastdeltax=0,this.lastdeltay=0,this.detected=getBrowserDetection();var cap=$.extend({},this.detected);this.canhwscroll=cap.hastransform&&opt.hwacceleration,this.ishwscroll=this.canhwscroll&&self.haswrapper,this.isrtlmode?this.isvertical?this.hasreversehr=!(cap.iswebkit||cap.isie||cap.isie11):this.hasreversehr=!(cap.iswebkit||cap.isie&&!cap.isie10&&!cap.isie11):this.hasreversehr=!1,this.istouchcapable=!1,(cap.cantouch||!cap.hasw3ctouch&&!cap.hasmstouch)&&(!cap.cantouch||cap.isios||cap.isandroid||!cap.iswebkit&&!cap.ismozilla)||(this.istouchcapable=!0),opt.enablemouselockapi||(cap.hasmousecapture=!1,cap.haspointerlock=!1),this.debounced=function(name,fn,tm){var dd;self&&(self.delaylist[name]||!1||(self.delaylist[name]={h:setAnimationFrame((function(){self.delaylist[name].fn.call(self),self.delaylist[name]=!1}),tm)},fn.call(self)),self.delaylist[name].fn=fn)},this.synched=function(name,fn){self.synclist[name]?self.synclist[name]=fn:(self.synclist[name]=fn,setAnimationFrame((function(){self&&(self.synclist[name]&&self.synclist[name].call(self),self.synclist[name]=null)})))},this.unsynched=function(name){self.synclist[name]&&(self.synclist[name]=!1)},this.css=function(el,pars){for(var n in pars)self.saved.css.push([el,n,el.css(n)]),el.css(n,pars[n])},this.scrollTop=function(val){return void 0===val?self.getScrollTop():self.setScrollTop(val)},this.scrollLeft=function(val){return void 0===val?self.getScrollLeft():self.setScrollLeft(val)};var BezierClass=function(st,ed,spd,p1,p2,p3,p4){this.st=st,this.ed=ed,this.spd=spd,this.p1=p1||0,this.p2=p2||1,this.p3=p3||0,this.p4=p4||1,this.ts=now(),this.df=ed-st};function getMatrixValues(){var tr=self.doc.css(cap.trstyle);return!(!tr||"matrix"!=tr.substr(0,6))&&tr.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/)}if(BezierClass.prototype={B2:function(t){return 3*(1-t)*(1-t)*t},B3:function(t){return 3*(1-t)*t*t},B4:function(t){return t*t*t},getPos:function(){return(now()-this.ts)/this.spd},getNow:function(){var pc=(now()-this.ts)/this.spd,bz=this.B2(pc)+this.B3(pc)+this.B4(pc);return pc>=1?this.ed:this.st+this.df*bz|0},update:function(ed,spd){return this.st=this.getNow(),this.ed=ed,this.spd=spd,this.ts=now(),this.df=this.ed-this.st,this}},this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"},cap.hastranslate3d&&cap.isios&&this.doc.css("-webkit-backface-visibility","hidden"),this.getScrollTop=function(last){if(!last){var mtx=getMatrixValues();if(mtx)return 16==mtx.length?-mtx[13]:-mtx[5];if(self.timerscroll&&self.timerscroll.bz)return self.timerscroll.bz.getNow()}return self.doc.translate.y},this.getScrollLeft=function(last){if(!last){var mtx=getMatrixValues();if(mtx)return 16==mtx.length?-mtx[12]:-mtx[4];if(self.timerscroll&&self.timerscroll.bh)return self.timerscroll.bh.getNow()}return self.doc.translate.x},this.notifyScrollEvent=function(el){var e=_doc.createEvent("UIEvents");e.initUIEvent("scroll",!1,!1,_win,1),e.niceevent=!0,el.dispatchEvent(e)};var cxscrollleft=this.isrtlmode?1:-1;cap.hastranslate3d&&opt.enabletranslate3d?(this.setScrollTop=function(val,silent){self.doc.translate.y=val,self.doc.translate.ty=-1*val+"px",self.doc.css(cap.trstyle,"translate3d("+self.doc.translate.tx+","+self.doc.translate.ty+",0)"),silent||self.notifyScrollEvent(self.win[0])},this.setScrollLeft=function(val,silent){self.doc.translate.x=val,self.doc.translate.tx=val*cxscrollleft+"px",self.doc.css(cap.trstyle,"translate3d("+self.doc.translate.tx+","+self.doc.translate.ty+",0)"),silent||self.notifyScrollEvent(self.win[0])}):(this.setScrollTop=function(val,silent){self.doc.translate.y=val,self.doc.translate.ty=-1*val+"px",self.doc.css(cap.trstyle,"translate("+self.doc.translate.tx+","+self.doc.translate.ty+")"),silent||self.notifyScrollEvent(self.win[0])},this.setScrollLeft=function(val,silent){self.doc.translate.x=val,self.doc.translate.tx=val*cxscrollleft+"px",self.doc.css(cap.trstyle,"translate("+self.doc.translate.tx+","+self.doc.translate.ty+")"),silent||self.notifyScrollEvent(self.win[0])})}else this.getScrollTop=function(){return self.docscroll.scrollTop()},this.setScrollTop=function(val){self.docscroll.scrollTop(val)},this.getScrollLeft=function(){var val;return val=self.hasreversehr?self.detected.ismozilla?self.page.maxw-Math.abs(self.docscroll.scrollLeft()):self.page.maxw-self.docscroll.scrollLeft():self.docscroll.scrollLeft()},this.setScrollLeft=function(val){return setTimeout((function(){if(self)return self.hasreversehr&&(val=self.detected.ismozilla?-(self.page.maxw-val):self.page.maxw-val),self.docscroll.scrollLeft(val)}),1)};function getZIndex(){var dom=self.win;if("zIndex"in dom)return dom.zIndex();for(;dom.length>0;){if(9==dom[0].nodeType)return!1;var zi=dom.css("zIndex");if(!isNaN(zi)&&0!==zi)return parseInt(zi);dom=dom.parent()}return!1}this.getTarget=function(e){return!!e&&(e.target?e.target:!!e.srcElement&&e.srcElement)},this.hasParent=function(e,id){if(!e)return!1;for(var el=e.target||e.srcElement||e||!1;el&&el.id!=id;)el=el.parentNode||!1;return!1!==el};var _convertBorderWidth={thin:1,medium:3,thick:5};function getWidthToPixel(dom,prop,chkheight){var wd=dom.css(prop),px=parseFloat(wd);if(isNaN(px)){var brd=3==(px=_convertBorderWidth[wd]||0)?chkheight?self.win.outerHeight()-self.win.innerHeight():self.win.outerWidth()-self.win.innerWidth():1;return self.isie8&&px&&(px+=1),brd?px:0}return px}this.getDocumentScrollOffset=function(){return{top:_win.pageYOffset||_doc.documentElement.scrollTop,left:_win.pageXOffset||_doc.documentElement.scrollLeft}},this.getOffset=function(){if(self.isfixed){var ofs=self.win.offset(),scrl=self.getDocumentScrollOffset();return ofs.top-=scrl.top,ofs.left-=scrl.left,ofs}var ww=self.win.offset();if(!self.viewport)return ww;var vp=self.viewport.offset();return{top:ww.top-vp.top,left:ww.left-vp.left}},this.updateScrollBar=function(len){var pos,off;if(self.ishwscroll)self.rail.css({height:self.win.innerHeight()-(opt.railpadding.top+opt.railpadding.bottom)}),self.railh&&self.railh.css({width:self.win.innerWidth()-(opt.railpadding.left+opt.railpadding.right)});else{var wpos=self.getOffset();if((pos={top:wpos.top,left:wpos.left-(opt.railpadding.left+opt.railpadding.right)}).top+=getWidthToPixel(self.win,"border-top-width",!0),pos.left+=self.rail.align?self.win.outerWidth()-getWidthToPixel(self.win,"border-right-width")-self.rail.width:getWidthToPixel(self.win,"border-left-width"),(off=opt.railoffset)&&(off.top&&(pos.top+=off.top),off.left&&(pos.left+=off.left)),self.railslocked||self.rail.css({top:pos.top,left:pos.left,height:(len?len.h:self.win.innerHeight())-(opt.railpadding.top+opt.railpadding.bottom)}),self.zoom&&self.zoom.css({top:pos.top+1,left:1==self.rail.align?pos.left-20:pos.left+self.rail.width+4}),self.railh&&!self.railslocked){pos={top:wpos.top,left:wpos.left},(off=opt.railhoffset)&&(off.top&&(pos.top+=off.top),off.left&&(pos.left+=off.left));var y=self.railh.align?pos.top+getWidthToPixel(self.win,"border-top-width",!0)+self.win.innerHeight()-self.railh.height:pos.top+getWidthToPixel(self.win,"border-top-width",!0),x=pos.left+getWidthToPixel(self.win,"border-left-width");self.railh.css({top:y-(opt.railpadding.top+opt.railpadding.bottom),left:x,width:self.railh.width})}}},this.doRailClick=function(e,dbl,hr){var fn,pg,cur,pos;self.railslocked||(self.cancelEvent(e),"pageY"in e||(e.pageX=e.clientX+_doc.documentElement.scrollLeft,e.pageY=e.clientY+_doc.documentElement.scrollTop),dbl?(fn=hr?self.doScrollLeft:self.doScrollTop,cur=hr?(e.pageX-self.railh.offset().left-self.cursorwidth/2)*self.scrollratio.x:(e.pageY-self.rail.offset().top-self.cursorheight/2)*self.scrollratio.y,self.unsynched("relativexy"),fn(0|cur)):(fn=hr?self.doScrollLeftBy:self.doScrollBy,cur=hr?self.scroll.x:self.scroll.y,pos=hr?e.pageX-self.railh.offset().left:e.pageY-self.rail.offset().top,pg=hr?self.view.w:self.view.h,fn(cur>=pos?pg:-pg)))},self.newscrolly=self.newscrollx=0,self.hasanimationframe="requestAnimationFrame"in _win,self.hascancelanimationframe="cancelAnimationFrame"in _win,self.hasborderbox=!1,this.init=function(){if(self.saved.css=[],cap.isoperamini)return!0;if(cap.isandroid&&!("hidden"in _doc))return!0;opt.emulatetouch=opt.emulatetouch||opt.touchbehavior,self.hasborderbox=_win.getComputedStyle&&"border-box"===_win.getComputedStyle(_doc.body)["box-sizing"];var _scrollyhidden={"overflow-y":"hidden"};if((cap.isie11||cap.isie10)&&(_scrollyhidden["-ms-overflow-style"]="none"),self.ishwscroll&&(this.doc.css(cap.transitionstyle,cap.prefixstyle+"transform 0ms ease-out"),cap.transitionend&&self.bind(self.doc,cap.transitionend,self.onScrollTransitionEnd,!1)),self.zindex="auto",self.ispage||"auto"!=opt.zindex?self.zindex=opt.zindex:self.zindex=getZIndex()||"auto",!self.ispage&&"auto"!=self.zindex&&self.zindex>globalmaxzindex&&(globalmaxzindex=self.zindex),self.isie&&0===self.zindex&&"auto"==opt.zindex&&(self.zindex="auto"),!self.ispage||!cap.isieold){var cont=self.docscroll;self.ispage&&(cont=self.haswrapper?self.win:self.doc),self.css(cont,_scrollyhidden),self.ispage&&(cap.isie11||cap.isie)&&self.css($("html"),_scrollyhidden),!cap.isios||self.ispage||self.haswrapper||self.css($body,{"-webkit-overflow-scrolling":"touch"});var cursor=$(_doc.createElement("div"));cursor.css({position:"relative",top:0,height:0,"background-color":opt.cursorcolor,border:opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":opt.cursorborderradius,"-moz-border-radius":opt.cursorborderradius,"border-radius":opt.cursorborderradius}),cursor.addClass("axscroll-cursors"),self.cursor=cursor;var rail=$(_doc.createElement("div"));rail.attr("id",self.id),rail.addClass("axscroll-rails axscroll-rails-vr");var differ=parseInt(opt.cursorwidthHover)-parseInt(opt.cursorwidth);rail.hover((function(){var leftDiffer=parseInt($(this).css("left"))-differ,zoom=$(this).next(".axscroll-zoom"),zoomDiffer=parseInt(zoom.css("left"))-differ;$(this).css({width:opt.cursorwidthHover,left:leftDiffer}),zoom.css({left:zoomDiffer})}),(function(){var leftDiffer=parseInt($(this).css("left"))+differ,zoom=$(this).next(".axscroll-zoom"),zoomDiffer=parseInt(zoom.css("left"))+differ;$(this).css({width:opt.cursorwidth,left:leftDiffer}),zoom.css({left:zoomDiffer})})),opt.scrollCLass&&rail.addClass(opt.scrollCLass);var v,a,kp=["left","right","top","bottom"];for(var n in kp)a=kp[n],(v=opt.railpadding[a]||0)&&rail.css("padding-"+a,v+"px");rail.append(cursor),rail.width=Math.max(parseFloat(opt.cursorwidth),cursor.outerWidth()),rail.css({width:rail.width+"px",zIndex:self.zindex,background:opt.background,cursor:"default"}),rail.visibility=!0,rail.scrollable=!0,rail.align="left"==opt.railalign?0:1,self.rail=rail,self.rail.drag=!1;var zoom=!1,railh;if(!opt.boxzoom||self.ispage||cap.isieold||(zoom=_doc.createElement("div"),self.bind(zoom,"click",self.doZoom),self.bind(zoom,"mouseenter",(function(){self.zoom.css("opacity",opt.cursoropacitymax)})),self.bind(zoom,"mouseleave",(function(){self.zoom.css("opacity",opt.cursoropacitymin)})),self.zoom=$(zoom),self.zoom.css({cursor:"pointer",zIndex:self.zindex,backgroundImage:"",height:18,width:18,backgroundPosition:"0 0"}).empty().prepend(svgExpand).addClass("axscroll-zoom"),opt.dblclickzoom&&self.bind(self.win,"dblclick",self.doZoom),cap.cantouch&&opt.gesturezoom&&(self.ongesturezoom=function(e){return e.scale>1.5&&self.doZoomIn(e),e.scale<.8&&self.doZoomOut(e),self.cancelEvent(e)},self.bind(self.win,"gestureend",self.ongesturezoom))),self.railh=!1,opt.horizrailenabled){self.css(cont,{overflowX:"hidden"}),(cursor=$(_doc.createElement("div"))).css({position:"absolute",top:0,height:opt.cursorwidth,width:0,backgroundColor:opt.cursorcolor,border:opt.cursorborder,backgroundClip:"padding-box","-webkit-border-radius":opt.cursorborderradius,"-moz-border-radius":opt.cursorborderradius,"border-radius":opt.cursorborderradius}),cursor.hover((function(){$(this).css("background-color",opt.cursorcolorHover)}),(function(){$(this).css("background-color",opt.cursorcolor)})),cap.isieold&&cursor.css("overflow","hidden"),cursor.addClass("axscroll-cursors"),self.cursorh=cursor,(railh=$(_doc.createElement("div"))).attr("id",self.id+"-hr"),railh.addClass("axscroll-rails axscroll-rails-hr");var differ=parseInt(opt.cursorwidthHover)-parseInt(opt.cursorwidth);railh.hover((function(){var topDiffer=parseInt($(this).css("top"))-differ;$(this).css({height:opt.cursorwidthHover,top:topDiffer}),$(this).find("div").css({height:opt.cursorwidthHover})}),(function(){var topDiffer=parseInt($(this).css("top"))+differ;$(this).css({height:opt.cursorwidth,top:topDiffer}),$(this).find("div").css({height:opt.cursorwidth})})),opt.scrollCLass&&railh.addClass(opt.scrollCLass),railh.height=Math.max(parseFloat(opt.cursorwidth),cursor.outerHeight()),railh.css({height:railh.height+"px",zIndex:self.zindex,background:opt.background}),railh.append(cursor),railh.visibility=!0,railh.scrollable=!0,railh.align="top"==opt.railvalign?0:1,self.railh=railh,self.railh.drag=!1}if(self.ispage)rail.css({position:"fixed",top:0,height:"100%"}),rail.css(rail.align?{right:0}:{left:0}),self.body.append(rail),self.railh&&(railh.css({position:"fixed",left:0,width:"100%"}),railh.css(railh.align?{bottom:0}:{top:0}),self.body.append(railh));else{if(self.ishwscroll){"static"==self.win.css("position")&&self.css(self.win,{position:"relative"});var bd="HTML"==self.win[0].nodeName?self.body:self.win;$(bd).scrollTop(0).scrollLeft(0),self.zoom&&(self.zoom.css({position:"absolute",top:1,right:0,"margin-right":rail.width+4}),bd.append(self.zoom)),rail.css({position:"absolute",top:0}),rail.css(rail.align?{right:0}:{left:0}),bd.append(rail),railh&&(railh.css({position:"absolute",left:0,bottom:0}),railh.css(railh.align?{bottom:0}:{top:0}),bd.append(railh))}else{self.isfixed="fixed"==self.win.css("position");var rlpos=self.isfixed?"fixed":"absolute";self.isfixed||(self.viewport=self.getViewport(self.win[0])),self.viewport&&(self.body=self.viewport,/fixed|absolute/.test(self.viewport.css("position"))||self.css(self.viewport,{position:"relative"})),rail.css({position:rlpos}),self.zoom&&self.zoom.css({position:rlpos}),self.updateScrollBar(),self.body.append(rail),self.zoom&&self.body.append(self.zoom),self.railh&&(railh.css({position:rlpos}),self.body.append(railh))}cap.isios&&self.css(self.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),opt.disableoutline&&(cap.isie&&self.win.attr("hideFocus","true"),cap.iswebkit&&self.win.css("outline","none"))}if(!1===opt.autohidemode?(self.autohidedom=!1,self.rail.css({opacity:opt.cursoropacitymax}),self.railh&&self.railh.css({opacity:opt.cursoropacitymax})):!0===opt.autohidemode||"leave"===opt.autohidemode?(self.autohidedom=$().add(self.rail),cap.isie8&&(self.autohidedom=self.autohidedom.add(self.cursor)),self.railh&&(self.autohidedom=self.autohidedom.add(self.railh)),self.railh&&cap.isie8&&(self.autohidedom=self.autohidedom.add(self.cursorh))):"scroll"==opt.autohidemode?(self.autohidedom=$().add(self.rail),self.railh&&(self.autohidedom=self.autohidedom.add(self.railh))):"cursor"==opt.autohidemode?(self.autohidedom=$().add(self.cursor),self.railh&&(self.autohidedom=self.autohidedom.add(self.cursorh))):"hidden"==opt.autohidemode&&(self.autohidedom=!1,self.hide(),self.railslocked=!1),cap.cantouch||self.istouchcapable||opt.emulatetouch||cap.hasmstouch){self.scrollmom=new ScrollMomentumClass2D(self);var delayedclick=null;self.ontouchstart=function(e){if(self.locked)return!1;if(e.pointerType&&("mouse"===e.pointerType||e.pointerType===e.MSPOINTER_TYPE_MOUSE))return!1;if(self.hasmoving=!1,self.scrollmom.timer&&(self.triggerScrollEnd(),self.scrollmom.stop()),!self.railslocked){var tg=self.getTarget(e),skp;if(tg)if(/INPUT/i.test(tg.nodeName)&&/range/i.test(tg.type))return self.stopPropagation(e);var ismouse="mousedown"===e.type;if(!("clientX"in e)&&"changedTouches"in e&&(e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY),self.forcescreen){var le=e;(e={original:e.original?e.original:e}).clientX=le.screenX,e.clientY=le.screenY}if(self.rail.drag={x:e.clientX,y:e.clientY,sx:self.scroll.x,sy:self.scroll.y,st:self.getScrollTop(),sl:self.getScrollLeft(),pt:2,dl:!1,tg:tg},self.ispage||!opt.directionlockdeadzone)self.rail.drag.dl="f";else{var view={w:$window.width(),h:$window.height()},page=self.getContentSize(),maxh=page.h-view.h,maxw=page.w-view.w;self.rail.scrollable&&!self.railh.scrollable?self.rail.drag.ck=maxh>0&&"v":!self.rail.scrollable&&self.railh.scrollable?self.rail.drag.ck=maxw>0&&"h":self.rail.drag.ck=!1}if(opt.emulatetouch&&self.isiframe&&cap.isie){var wp=self.win.position();self.rail.drag.x+=wp.left,self.rail.drag.y+=wp.top}if(self.hasmoving=!1,self.lastmouseup=!1,self.scrollmom.reset(e.clientX,e.clientY),tg&&ismouse){var ip;if(!/INPUT|SELECT|BUTTON|TEXTAREA/i.test(tg.nodeName))return cap.hasmousecapture&&tg.setCapture(),opt.emulatetouch?(tg.onclick&&!tg._onclick&&(tg._onclick=tg.onclick,tg.onclick=function(e){if(self.hasmoving)return!1;tg._onclick.call(this,e)}),self.cancelEvent(e)):self.stopPropagation(e);/SUBMIT|CANCEL|BUTTON/i.test($(tg).attr("type"))&&(self.preventclick={tg:tg,click:!1})}}},self.ontouchend=function(e){if(!self.rail.drag)return!0;if(2==self.rail.drag.pt){if(e.pointerType&&("mouse"===e.pointerType||e.pointerType===e.MSPOINTER_TYPE_MOUSE))return!1;self.rail.drag=!1;var ismouse="mouseup"===e.type;if(self.hasmoving&&(self.scrollmom.doMomentum(),self.lastmouseup=!0,self.hideCursor(),cap.hasmousecapture&&_doc.releaseCapture(),ismouse))return self.cancelEvent(e)}else if(1==self.rail.drag.pt)return self.onmouseup(e)};var moveneedoffset=opt.emulatetouch&&self.isiframe&&!cap.hasmousecapture,locktollerance=.3*opt.directionlockdeadzone|0;self.ontouchmove=function(e,byiframe){if(!self.rail.drag)return!0;if(e.targetTouches&&opt.preventmultitouchscrolling&&e.targetTouches.length>1)return!0;if(e.pointerType&&("mouse"===e.pointerType||e.pointerType===e.MSPOINTER_TYPE_MOUSE))return!0;if(2==self.rail.drag.pt){var ofy,ofx;if("changedTouches"in e&&(e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY),ofx=ofy=0,moveneedoffset&&!byiframe){var wp=self.win.position();ofx=-wp.left,ofy=-wp.top}var fy=e.clientY+ofy,my=fy-self.rail.drag.y,fx=e.clientX+ofx,mx=fx-self.rail.drag.x,ny=self.rail.drag.st-my;if(self.ishwscroll&&opt.bouncescroll)ny<0?ny=Math.round(ny/2):ny>self.page.maxh&&(ny=self.page.maxh+Math.round((ny-self.page.maxh)/2));else if(ny<0?(ny=0,fy=0):ny>self.page.maxh&&(ny=self.page.maxh,fy=0),0===fy&&!self.hasmoving)return self.ispage||(self.rail.drag=!1),!0;var nx=self.getScrollLeft();if(self.railh&&self.railh.scrollable&&(nx=self.isrtlmode?mx-self.rail.drag.sl:self.rail.drag.sl-mx,self.ishwscroll&&opt.bouncescroll?nx<0?nx=Math.round(nx/2):nx>self.page.maxw&&(nx=self.page.maxw+Math.round((nx-self.page.maxw)/2)):(nx<0&&(nx=0,fx=0),nx>self.page.maxw&&(nx=self.page.maxw,fx=0))),!self.hasmoving){if(self.rail.drag.y===e.clientY&&self.rail.drag.x===e.clientX)return self.cancelEvent(e);var ay=Math.abs(my),ax=Math.abs(mx),dz=opt.directionlockdeadzone;if(self.rail.drag.ck?"v"==self.rail.drag.ck?ax>dz&&ay<=locktollerance?self.rail.drag=!1:ay>dz&&(self.rail.drag.dl="v"):"h"==self.rail.drag.ck&&(ay>dz&&ax<=locktollerance?self.rail.drag=!1:ax>dz&&(self.rail.drag.dl="h")):ay>dz&&ax>dz?self.rail.drag.dl="f":ay>dz?self.rail.drag.dl=ax>locktollerance?"f":"v":ax>dz&&(self.rail.drag.dl=ay>locktollerance?"f":"h"),!self.rail.drag.dl)return self.cancelEvent(e);self.triggerScrollStart(e.clientX,e.clientY,0,0,0),self.hasmoving=!0}return self.preventclick&&!self.preventclick.click&&(self.preventclick.click=self.preventclick.tg.onclick||!1,self.preventclick.tg.onclick=self.onpreventclick),self.rail.drag.dl&&("v"==self.rail.drag.dl?nx=self.rail.drag.sl:"h"==self.rail.drag.dl&&(ny=self.rail.drag.st)),self.synched("touchmove",(function(){self.rail.drag&&2==self.rail.drag.pt&&(self.prepareTransition&&self.resetTransition(),self.rail.scrollable&&self.setScrollTop(ny),self.scrollmom.update(fx,fy),self.railh&&self.railh.scrollable?(self.setScrollLeft(nx),self.showCursor(ny,nx)):self.showCursor(ny),cap.isie10&&_doc.selection.clear())})),self.cancelEvent(e)}return 1==self.rail.drag.pt?self.onmousemove(e):void 0},self.ontouchstartCursor=function(e,hronly){if(!self.rail.drag||3==self.rail.drag.pt){if(self.locked)return self.cancelEvent(e);self.cancelScroll(),self.rail.drag={x:e.touches[0].clientX,y:e.touches[0].clientY,sx:self.scroll.x,sy:self.scroll.y,pt:3,hr:!!hronly};var tg=self.getTarget(e);return!self.ispage&&cap.hasmousecapture&&tg.setCapture(),self.isiframe&&!cap.hasmousecapture&&(self.saved.csspointerevents=self.doc.css("pointer-events"),self.css(self.doc,{"pointer-events":"none"})),self.cancelEvent(e)}},self.ontouchendCursor=function(e){if(self.rail.drag){if(cap.hasmousecapture&&_doc.releaseCapture(),self.isiframe&&!cap.hasmousecapture&&self.doc.css("pointer-events",self.saved.csspointerevents),3!=self.rail.drag.pt)return;return self.rail.drag=!1,self.cancelEvent(e)}},self.ontouchmoveCursor=function(e){if(self.rail.drag){if(3!=self.rail.drag.pt)return;if(self.cursorfreezed=!0,self.rail.drag.hr){self.scroll.x=self.rail.drag.sx+(e.touches[0].clientX-self.rail.drag.x),self.scroll.x<0&&(self.scroll.x=0);var mw=self.scrollvaluemaxw;self.scroll.x>mw&&(self.scroll.x=mw)}else{self.scroll.y=self.rail.drag.sy+(e.touches[0].clientY-self.rail.drag.y),self.scroll.y<0&&(self.scroll.y=0);var my=self.scrollvaluemax;self.scroll.y>my&&(self.scroll.y=my)}return self.synched("touchmove",(function(){self.rail.drag&&3==self.rail.drag.pt&&(self.showCursor(),self.rail.drag.hr?self.doScrollLeft(Math.round(self.scroll.x*self.scrollratio.x),opt.cursordragspeed):self.doScrollTop(Math.round(self.scroll.y*self.scrollratio.y),opt.cursordragspeed))})),self.cancelEvent(e)}}}if(self.onmousedown=function(e,hronly){if(!self.rail.drag||1==self.rail.drag.pt){if(self.railslocked)return self.cancelEvent(e);self.cancelScroll(),self.rail.drag={x:e.clientX,y:e.clientY,sx:self.scroll.x,sy:self.scroll.y,pt:1,hr:hronly||!1};var tg=self.getTarget(e);return cap.hasmousecapture&&tg.setCapture(),self.isiframe&&!cap.hasmousecapture&&(self.saved.csspointerevents=self.doc.css("pointer-events"),self.css(self.doc,{"pointer-events":"none"})),self.hasmoving=!1,self.cancelEvent(e)}},self.onmouseup=function(e){if(self.rail.drag)return 1!=self.rail.drag.pt||(cap.hasmousecapture&&_doc.releaseCapture(),self.isiframe&&!cap.hasmousecapture&&self.doc.css("pointer-events",self.saved.csspointerevents),self.rail.drag=!1,self.cursorfreezed=!1,self.hasmoving&&self.triggerScrollEnd(),self.cancelEvent(e))},self.onmousemove=function(e){if(self.rail.drag){if(1!==self.rail.drag.pt)return;if(cap.ischrome&&0===e.which)return self.onmouseup(e);if(self.cursorfreezed=!0,self.hasmoving||self.triggerScrollStart(e.clientX,e.clientY,0,0,0),self.hasmoving=!0,self.rail.drag.hr){self.scroll.x=self.rail.drag.sx+(e.clientX-self.rail.drag.x),self.scroll.x<0&&(self.scroll.x=0);var mw=self.scrollvaluemaxw;self.scroll.x>mw&&(self.scroll.x=mw)}else{self.scroll.y=self.rail.drag.sy+(e.clientY-self.rail.drag.y),self.scroll.y<0&&(self.scroll.y=0);var my=self.scrollvaluemax;self.scroll.y>my&&(self.scroll.y=my)}return self.synched("mousemove",(function(){self.cursorfreezed&&(self.showCursor(),self.rail.drag.hr?self.scrollLeft(Math.round(self.scroll.x*self.scrollratio.x)):self.scrollTop(Math.round(self.scroll.y*self.scrollratio.y)))})),self.cancelEvent(e)}self.checkarea=0},cap.cantouch||opt.emulatetouch)self.onpreventclick=function(e){if(self.preventclick)return self.preventclick.tg.onclick=self.preventclick.click,self.preventclick=!1,self.cancelEvent(e)},self.onclick=!cap.isios&&function(e){return!self.lastmouseup||(self.lastmouseup=!1,self.cancelEvent(e))},opt.grabcursorenabled&&cap.cursorgrabvalue&&(self.css(self.ispage?self.doc:self.win,{cursor:cap.cursorgrabvalue}),self.css(self.rail,{cursor:cap.cursorgrabvalue}));else{var checkSelectionScroll=function(e){if(self.selectiondrag){if(e){var ww=self.win.outerHeight(),df=e.pageY-self.selectiondrag.top;df>0&&df<ww&&(df=0),df>=ww&&(df-=ww),self.selectiondrag.df=df}if(0!==self.selectiondrag.df){var rt=-2*self.selectiondrag.df/6|0;self.doScrollBy(rt),self.debounced("doselectionscroll",(function(){checkSelectionScroll()}),50)}}};self.hasTextSelected="getSelection"in _doc?function(){return _doc.getSelection().rangeCount>0}:"selection"in _doc?function(){return"None"!=_doc.selection.type}:function(){return!1},self.onselectionstart=function(e){self.ispage||(self.selectiondrag=self.win.offset())},self.onselectionend=function(e){self.selectiondrag=!1},self.onselectiondrag=function(e){self.selectiondrag&&self.hasTextSelected()&&self.debounced("selectionscroll",(function(){checkSelectionScroll(e)}),250)}}if(cap.hasw3ctouch?(self.css(self.ispage?$("html"):self.win,{"touch-action":"none"}),self.css(self.rail,{"touch-action":"none"}),self.css(self.cursor,{"touch-action":"none"}),self.bind(self.win,"pointerdown",self.ontouchstart),self.bind(_doc,"pointerup",self.ontouchend),self.delegate(_doc,"pointermove",self.ontouchmove)):cap.hasmstouch?(self.css(self.ispage?$("html"):self.win,{"-ms-touch-action":"none"}),self.css(self.rail,{"-ms-touch-action":"none"}),self.css(self.cursor,{"-ms-touch-action":"none"}),self.bind(self.win,"MSPointerDown",self.ontouchstart),self.bind(_doc,"MSPointerUp",self.ontouchend),self.delegate(_doc,"MSPointerMove",self.ontouchmove),self.bind(self.cursor,"MSGestureHold",(function(e){e.preventDefault()})),self.bind(self.cursor,"contextmenu",(function(e){e.preventDefault()}))):cap.cantouch&&(self.bind(self.win,"touchstart",self.ontouchstart,!1,!0),self.bind(_doc,"touchend",self.ontouchend,!1,!0),self.bind(_doc,"touchcancel",self.ontouchend,!1,!0),self.delegate(_doc,"touchmove",self.ontouchmove,!1,!0)),opt.emulatetouch&&(self.bind(self.win,"mousedown",self.ontouchstart,!1,!0),self.bind(_doc,"mouseup",self.ontouchend,!1,!0),self.bind(_doc,"mousemove",self.ontouchmove,!1,!0)),(opt.cursordragontouch||!cap.cantouch&&!opt.emulatetouch)&&(self.rail.css({cursor:"default"}),self.railh&&self.railh.css({cursor:"default"}),self.jqbind(self.rail,"mouseenter",(function(){if(!self.ispage&&!self.win.is(":visible"))return!1;self.canshowonmouseevent&&self.showCursor(),self.rail.active=!0})),self.jqbind(self.rail,"mouseleave",(function(){self.rail.active=!1,self.rail.drag||self.hideCursor()})),opt.sensitiverail&&(self.bind(self.rail,"click",(function(e){self.doRailClick(e,!1,!1)})),self.bind(self.rail,"dblclick",(function(e){self.doRailClick(e,!0,!1)})),self.bind(self.cursor,"click",(function(e){self.cancelEvent(e)})),self.bind(self.cursor,"dblclick",(function(e){self.cancelEvent(e)}))),self.railh&&(self.jqbind(self.railh,"mouseenter",(function(){if(!self.ispage&&!self.win.is(":visible"))return!1;self.canshowonmouseevent&&self.showCursor(),self.rail.active=!0})),self.jqbind(self.railh,"mouseleave",(function(){self.rail.active=!1,self.rail.drag||self.hideCursor()})),opt.sensitiverail&&(self.bind(self.railh,"click",(function(e){self.doRailClick(e,!1,!0)})),self.bind(self.railh,"dblclick",(function(e){self.doRailClick(e,!0,!0)})),self.bind(self.cursorh,"click",(function(e){self.cancelEvent(e)})),self.bind(self.cursorh,"dblclick",(function(e){self.cancelEvent(e)}))))),opt.cursordragontouch&&(this.istouchcapable||cap.cantouch)&&(self.bind(self.cursor,"touchstart",self.ontouchstartCursor),self.bind(self.cursor,"touchmove",self.ontouchmoveCursor),self.bind(self.cursor,"touchend",self.ontouchendCursor),self.cursorh&&self.bind(self.cursorh,"touchstart",(function(e){self.ontouchstartCursor(e,!0)})),self.cursorh&&self.bind(self.cursorh,"touchmove",self.ontouchmoveCursor),self.cursorh&&self.bind(self.cursorh,"touchend",self.ontouchendCursor)),opt.emulatetouch||cap.isandroid||cap.isios?(self.bind(cap.hasmousecapture?self.win:_doc,"mouseup",self.ontouchend),self.onclick&&self.bind(_doc,"click",self.onclick),opt.cursordragontouch?(self.bind(self.cursor,"mousedown",self.onmousedown),self.bind(self.cursor,"mouseup",self.onmouseup),self.cursorh&&self.bind(self.cursorh,"mousedown",(function(e){self.onmousedown(e,!0)})),self.cursorh&&self.bind(self.cursorh,"mouseup",self.onmouseup)):(self.bind(self.rail,"mousedown",(function(e){e.preventDefault()})),self.railh&&self.bind(self.railh,"mousedown",(function(e){e.preventDefault()})))):(self.bind(cap.hasmousecapture?self.win:_doc,"mouseup",self.onmouseup),self.bind(_doc,"mousemove",self.onmousemove),self.onclick&&self.bind(_doc,"click",self.onclick),self.bind(self.cursor,"mousedown",self.onmousedown),self.bind(self.cursor,"mouseup",self.onmouseup),self.railh&&(self.bind(self.cursorh,"mousedown",(function(e){self.onmousedown(e,!0)})),self.bind(self.cursorh,"mouseup",self.onmouseup)),!self.ispage&&opt.enablescrollonselection&&(self.bind(self.win[0],"mousedown",self.onselectionstart),self.bind(_doc,"mouseup",self.onselectionend),self.bind(self.cursor,"mouseup",self.onselectionend),self.cursorh&&self.bind(self.cursorh,"mouseup",self.onselectionend),self.bind(_doc,"mousemove",self.onselectiondrag)),self.zoom&&(self.jqbind(self.zoom,"mouseenter",(function(){self.canshowonmouseevent&&self.showCursor(),self.rail.active=!0})),self.jqbind(self.zoom,"mouseleave",(function(){self.rail.active=!1,self.rail.drag||self.hideCursor()})))),opt.enablemousewheel&&(self.isiframe||self.mousewheel(cap.isie&&self.ispage?_doc:self.win,self.onmousewheel),self.mousewheel(self.rail,self.onmousewheel),self.railh&&self.mousewheel(self.railh,self.onmousewheelhr)),self.ispage||cap.cantouch||/HTML|^BODY/.test(self.win[0].nodeName)||(self.win.attr("tabindex")||self.win.attr({tabindex:++tabindexcounter}),self.bind(self.win,"focus",(function(e){domfocus=self.getTarget(e).id||self.getTarget(e)||!1,self.hasfocus=!0,self.canshowonmouseevent&&self.noticeCursor()})),self.bind(self.win,"blur",(function(e){domfocus=!1,self.hasfocus=!1})),self.bind(self.win,"mouseenter",(function(e){mousefocus=self.getTarget(e).id||self.getTarget(e)||!1,self.hasmousefocus=!0,self.canshowonmouseevent&&self.noticeCursor()})),self.bind(self.win,"mouseleave",(function(e){mousefocus=!1,self.hasmousefocus=!1,self.rail.drag||self.hideCursor()}))),self.onkeypress=function(e){if(self.railslocked&&0===self.page.maxh)return!0;e=e||_win.event;var tg=self.getTarget(e),tp;if(tg&&/INPUT|TEXTAREA|SELECT|OPTION/.test(tg.nodeName)&&(!(tg.getAttribute("type")||tg.type||!1)||!/submit|button|cancel/i.tp))return!0;if($(tg).attr("contenteditable"))return!0;if(self.hasfocus||self.hasmousefocus&&!domfocus||self.ispage&&!domfocus&&!mousefocus){var key=e.keyCode;if(self.railslocked&&27!=key)return self.cancelEvent(e);var ctrl=e.ctrlKey||!1,shift=e.shiftKey||!1,ret=!1;switch(key){case 38:case 63233:self.doScrollBy(72),ret=!0;break;case 40:case 63235:self.doScrollBy(-72),ret=!0;break;case 37:case 63232:self.railh&&(ctrl?self.doScrollLeft(0):self.doScrollLeftBy(72),ret=!0);break;case 39:case 63234:self.railh&&(ctrl?self.doScrollLeft(self.page.maxw):self.doScrollLeftBy(-72),ret=!0);break;case 33:case 63276:self.doScrollBy(self.view.h),ret=!0;break;case 34:case 63277:self.doScrollBy(-self.view.h),ret=!0;break;case 36:case 63273:self.railh&&ctrl?self.doScrollPos(0,0):self.doScrollTo(0),ret=!0;break;case 35:case 63275:self.railh&&ctrl?self.doScrollPos(self.page.maxw,self.page.maxh):self.doScrollTo(self.page.maxh),ret=!0;break;case 32:opt.spacebarenabled&&(shift?self.doScrollBy(self.view.h):self.doScrollBy(-self.view.h),ret=!0);break;case 27:self.zoomactive&&(self.doZoom(),ret=!0)}if(ret)return self.cancelEvent(e)}},opt.enablekeyboard&&self.bind(_doc,cap.isopera&&!cap.isopera12?"keypress":"keydown",self.onkeypress),self.bind(_doc,"keydown",(function(e){var ctrl;(e.ctrlKey||!1)&&(self.wheelprevented=!0)})),self.bind(_doc,"keyup",(function(e){var ctrl;e.ctrlKey||!1||(self.wheelprevented=!1)})),self.bind(_win,"blur",(function(e){self.wheelprevented=!1})),self.bind(_win,"resize",self.onscreenresize),self.bind(_win,"orientationchange",self.onscreenresize),self.bind(_win,"load",self.lazyResize),cap.ischrome&&!self.ispage&&!self.haswrapper){var tmp=self.win.attr("style"),ww=parseFloat(self.win.css("width"))+1;self.win.css("width",ww),self.synched("chromefix",(function(){self.win.attr("style",tmp)}))}if(self.onAttributeChange=function(e){self.lazyResize(self.isieold?250:30)},opt.enableobserver&&(self.isie11||!1===ClsMutationObserver||(self.observerbody=new ClsMutationObserver((function(mutations){if(mutations.forEach((function(mut){if("attributes"==mut.type)return $body.hasClass("modal-open")&&$body.hasClass("modal-dialog")&&!$.contains($(".modal-dialog")[0],self.doc[0])?self.hide():self.show()})),self.me.clientWidth!=self.page.width||self.me.clientHeight!=self.page.height)return self.lazyResize(30)})),self.observerbody.observe(_doc.body,{childList:!0,subtree:!0,characterData:!1,attributes:!0,attributeFilter:["class"]})),!self.ispage&&!self.haswrapper)){var _dom=self.win[0];!1!==ClsMutationObserver?(self.observer=new ClsMutationObserver((function(mutations){mutations.forEach(self.onAttributeChange)})),self.observer.observe(_dom,{childList:!0,characterData:!1,attributes:!0,subtree:!1}),self.observerremover=new ClsMutationObserver((function(mutations){mutations.forEach((function(mo){if(mo.removedNodes.length>0)for(var dd in mo.removedNodes)if(self&&mo.removedNodes[dd]===_dom)return self.remove()}))})),self.observerremover.observe(_dom.parentNode,{childList:!0,characterData:!1,attributes:!1,subtree:!1})):(self.bind(_dom,cap.isie&&!cap.isie9?"propertychange":"DOMAttrModified",self.onAttributeChange),cap.isie9&&_dom.attachEvent("onpropertychange",self.onAttributeChange),self.bind(_dom,"DOMNodeRemoved",(function(e){e.target===_dom&&self.remove()})))}!self.ispage&&opt.boxzoom&&self.bind(_win,"resize",self.resizeZoom),self.istextarea&&(self.bind(self.win,"keydown",self.lazyResize),self.bind(self.win,"mouseup",self.lazyResize)),self.lazyResize(30)}if("IFRAME"==this.doc[0].nodeName){var oniframeload=function(){var doc;self.iframexd=!1;try{var a=(doc="contentDocument"in this?this.contentDocument:this.contentWindow._doc).domain}catch(e){self.iframexd=!0,doc=!1}if(self.iframexd)return"console"in _win&&console.log("AxScroll error: policy restriced iframe"),!0;if(self.forcescreen=!0,self.isiframe&&(self.iframe={doc:$(doc),html:self.doc.contents().find("html")[0],body:self.doc.contents().find("body")[0]},self.getContentSize=function(){return{w:Math.max(self.iframe.html.scrollWidth,self.iframe.body.scrollWidth),h:Math.max(self.iframe.html.scrollHeight,self.iframe.body.scrollHeight)}},self.docscroll=$(self.iframe.body)),!cap.isios&&opt.iframeautoresize&&!self.isiframe){self.win.scrollTop(0),self.doc.height("");var hh=Math.max(doc.getElementsByTagName("html")[0].scrollHeight,doc.body.scrollHeight);self.doc.height(hh)}self.lazyResize(30),self.css($(self.iframe.body),_scrollyhidden),cap.isios&&self.haswrapper&&self.css($(doc.body),{"-webkit-transform":"translate3d(0,0,0)"}),"contentWindow"in this?self.bind(this.contentWindow,"scroll",self.onscroll):self.bind(doc,"scroll",self.onscroll),opt.enablemousewheel&&self.mousewheel(doc,self.onmousewheel),opt.enablekeyboard&&self.bind(doc,cap.isopera?"keypress":"keydown",self.onkeypress),cap.cantouch?(self.bind(doc,"touchstart",self.ontouchstart),self.bind(doc,"touchmove",self.ontouchmove)):opt.emulatetouch&&(self.bind(doc,"mousedown",self.ontouchstart),self.bind(doc,"mousemove",(function(e){return self.ontouchmove(e,!0)})),opt.grabcursorenabled&&cap.cursorgrabvalue&&self.css($(doc.body),{cursor:cap.cursorgrabvalue})),self.bind(doc,"mouseup",self.ontouchend),self.zoom&&(opt.dblclickzoom&&self.bind(doc,"dblclick",self.doZoom),self.ongesturezoom&&self.bind(doc,"gestureend",self.ongesturezoom))};this.doc[0].readyState&&"complete"===this.doc[0].readyState&&setTimeout((function(){oniframeload.call(self.doc[0],!1)}),500),self.bind(this.doc,"load",oniframeload)}},this.showCursor=function(py,px){if(self.cursortimeout&&(clearTimeout(self.cursortimeout),self.cursortimeout=0),self.rail){if(self.autohidedom&&(self.autohidedom.stop().css({opacity:opt.cursoropacitymax}),self.cursoractive=!0),self.rail.drag&&1==self.rail.drag.pt||(void 0!==py&&!1!==py&&(self.scroll.y=py/self.scrollratio.y|0),void 0!==px&&(self.scroll.x=px/self.scrollratio.x|0)),self.cursor.css({height:self.cursorheight,top:self.scroll.y}),self.cursorh){var lx=self.hasreversehr?self.scrollvaluemaxw-self.scroll.x:self.scroll.x;self.cursorh.css({width:self.cursorwidth,left:!self.rail.align&&self.rail.visibility?lx+self.rail.width:lx}),self.cursoractive=!0}self.zoom&&self.zoom.stop().css({opacity:opt.cursoropacitymax})}},this.hideCursor=function(tm){self.cursortimeout||self.rail&&self.autohidedom&&(self.hasmousefocus&&"leave"===opt.autohidemode||(self.cursortimeout=setTimeout((function(){self.rail.active&&self.showonmouseevent||(self.autohidedom.stop().animate({opacity:opt.cursoropacitymin}),self.zoom&&self.zoom.stop().animate({opacity:opt.cursoropacitymin}),self.cursoractive=!1),self.cursortimeout=0}),tm||opt.hidecursordelay)))},this.noticeCursor=function(tm,py,px){self.showCursor(py,px),self.rail.active||self.hideCursor(tm)},this.getContentSize=self.ispage?function(){return{w:Math.max(_doc.body.scrollWidth,_doc.documentElement.scrollWidth),h:Math.max(_doc.body.scrollHeight,_doc.documentElement.scrollHeight)}}:self.haswrapper?function(){return{w:self.doc[0].offsetWidth,h:self.doc[0].offsetHeight}}:function(){return{w:self.docscroll[0].scrollWidth,h:self.docscroll[0].scrollHeight}},this.onResize=function(e,page){if(!self||!self.win)return!1;var premaxh=self.page.maxh,premaxw=self.page.maxw,previewh=self.view.h,previeww=self.view.w,sy;if(self.view={w:self.ispage?self.win.width():self.win[0].clientWidth,h:self.ispage?self.win.height():self.win[0].clientHeight},self.page=page||self.getContentSize(),self.page.maxh=Math.max(0,self.page.h-self.view.h),self.page.maxw=Math.max(0,self.page.w-self.view.w),self.page.maxh==premaxh&&self.page.maxw==premaxw&&self.view.w==previeww&&self.view.h==previewh){if(self.ispage)return self;var pos=self.win.offset();if(self.lastposition){var lst=self.lastposition;if(lst.top==pos.top&&lst.left==pos.left)return self}self.lastposition=pos}return 0===self.page.maxh?(self.hideRail(),self.scrollvaluemax=0,self.scroll.y=0,self.scrollratio.y=0,self.cursorheight=0,self.setScrollTop(0),self.rail&&(self.rail.scrollable=!1)):(self.page.maxh-=opt.railpadding.top+opt.railpadding.bottom,self.rail.scrollable=!0),0===self.page.maxw?(self.hideRailHr(),self.scrollvaluemaxw=0,self.scroll.x=0,self.scrollratio.x=0,self.cursorwidth=0,self.setScrollLeft(0),self.railh&&(self.railh.scrollable=!1)):(self.page.maxw-=opt.railpadding.left+opt.railpadding.right,self.railh&&(self.railh.scrollable=opt.horizrailenabled)),self.railslocked=self.locked||0===self.page.maxh&&0===self.page.maxw,self.railslocked?(self.ispage||self.updateScrollBar(self.view),!1):(self.hidden||(self.rail.visibility||self.showRail(),self.railh&&!self.railh.visibility&&self.showRailHr()),self.istextarea&&self.win.css("resize")&&"none"!=self.win.css("resize")&&(self.view.h-=20),self.cursorheight=Math.min(self.view.h,Math.round(self.view.h*(self.view.h/self.page.h))),self.cursorheight=opt.cursorfixedheight?opt.cursorfixedheight:Math.max(opt.cursorminheight,self.cursorheight),self.cursorwidth=Math.min(self.view.w,Math.round(self.view.w*(self.view.w/self.page.w))),self.cursorwidth=opt.cursorfixedheight?opt.cursorfixedheight:Math.max(opt.cursorminheight,self.cursorwidth),self.scrollvaluemax=self.view.h-self.cursorheight-(opt.railpadding.top+opt.railpadding.bottom),self.hasborderbox||(self.scrollvaluemax-=self.cursor[0].offsetHeight-self.cursor[0].clientHeight),self.railh&&(self.railh.width=self.page.maxh>0?self.view.w-self.rail.width:self.view.w,self.scrollvaluemaxw=self.railh.width-self.cursorwidth-(opt.railpadding.left+opt.railpadding.right)),self.ispage||self.updateScrollBar(self.view),self.scrollratio={x:self.page.maxw/self.scrollvaluemaxw,y:self.page.maxh/self.scrollvaluemax},self.getScrollTop()>self.page.maxh?self.doScrollTop(self.page.maxh):(self.scroll.y=self.getScrollTop()/self.scrollratio.y|0,self.scroll.x=self.getScrollLeft()/self.scrollratio.x|0,self.cursoractive&&self.noticeCursor()),self.scroll.y&&0===self.getScrollTop()&&self.doScrollTo(self.scroll.y*self.scrollratio.y|0),self)},this.resize=self.onResize;var hlazyresize=0;function _modernWheelEvent(dom,name,fn,bubble){self._bind(dom,name,(function(e){var event={original:e=e||_win.event,target:e.target||e.srcElement,type:"wheel",deltaMode:"MozMousePixelScroll"==e.type?0:1,deltaX:0,deltaZ:0,preventDefault:function(){return e.preventDefault?e.preventDefault():e.returnValue=!1,!1},stopImmediatePropagation:function(){e.stopImmediatePropagation?e.stopImmediatePropagation():e.cancelBubble=!0}};return"mousewheel"==name?(e.wheelDeltaX&&(event.deltaX=-.025*e.wheelDeltaX),e.wheelDeltaY&&(event.deltaY=-.025*e.wheelDeltaY),!event.deltaY&&!event.deltaX&&(event.deltaY=-.025*e.wheelDelta)):event.deltaY=e.detail,fn.call(dom,event)}),bubble)}this.onscreenresize=function(e){clearTimeout(hlazyresize);var hiderails=!self.ispage&&!self.haswrapper;hiderails&&self.hideRails(),hlazyresize=setTimeout((function(){self&&(hiderails&&self.showRails(),self.resize()),hlazyresize=0}),120)},this.lazyResize=function(tm){return clearTimeout(hlazyresize),tm=isNaN(tm)?240:tm,hlazyresize=setTimeout((function(){self&&self.resize(),hlazyresize=0}),tm),self},this.jqbind=function(dom,name,fn){self.events.push({e:dom,n:name,f:fn,q:!0}),$(dom).on(name,fn)},this.mousewheel=function(dom,fn,bubble){var el="jquery"in dom?dom[0]:dom;if("onwheel"in _doc.createElement("div"))self._bind(el,"wheel",fn,bubble||!1);else{var wname=void 0!==_doc.onmousewheel?"mousewheel":"DOMMouseScroll";_modernWheelEvent(el,wname,fn,bubble||!1),"DOMMouseScroll"==wname&&_modernWheelEvent(el,"MozMousePixelScroll",fn,bubble||!1)}};var passiveSupported=!1;if(cap.haseventlistener){try{var options=Object.defineProperty({},"passive",{get:function(){passiveSupported=!0}});_win.addEventListener("test",null,options)}catch(err){}this.stopPropagation=function(e){return!!e&&((e=e.original?e.original:e).stopPropagation(),!1)},this.cancelEvent=function(e){return e.cancelable&&e.preventDefault(),e.stopImmediatePropagation(),e.preventManipulation&&e.preventManipulation(),!1}}else Event.prototype.preventDefault=function(){this.returnValue=!1},Event.prototype.stopPropagation=function(){this.cancelBubble=!0},_win.constructor.prototype.addEventListener=_doc.constructor.prototype.addEventListener=Element.prototype.addEventListener=function(type,listener,useCapture){this.attachEvent("on"+type,listener)},_win.constructor.prototype.removeEventListener=_doc.constructor.prototype.removeEventListener=Element.prototype.removeEventListener=function(type,listener,useCapture){this.detachEvent("on"+type,listener)},this.cancelEvent=function(e){return(e=e||_win.event)&&(e.cancelBubble=!0,e.cancel=!0,e.returnValue=!1),!1},this.stopPropagation=function(e){return(e=e||_win.event)&&(e.cancelBubble=!0),!1};this.delegate=function(dom,name,fn,bubble,active){var de=delegatevents[name]||!1;de||(de={a:[],l:[],f:function(e){for(var lst=de.l,l,r=!1,a=lst.length-1;a>=0;a--)if(!1===(r=lst[a].call(e.target,e)))return!1;return r}},self.bind(dom,name,de.f,bubble,active),delegatevents[name]=de),self.ispage?(de.a=[self.id].concat(de.a),de.l=[fn].concat(de.l)):(de.a.push(self.id),de.l.push(fn))},this.undelegate=function(dom,name,fn,bubble,active){var de=delegatevents[name]||!1;if(de&&de.l)for(var a=0,l=de.l.length;a<l;a++)de.a[a]===self.id&&(de.a.splice(a),de.l.splice(a),0===de.a.length&&(self._unbind(dom,name,de.l.f),delegatevents[name]=null))},this.bind=function(dom,name,fn,bubble,active){var el="jquery"in dom?dom[0]:dom;self._bind(el,name,fn,bubble||!1,active||!1)},this._bind=function(el,name,fn,bubble,active){self.events.push({e:el,n:name,f:fn,b:bubble,q:!1}),passiveSupported&&(active||el==window.document||el==window.document.body||el==window)?el.addEventListener(name,fn,{passive:!1,capture:bubble}):el.addEventListener(name,fn,bubble||!1)},this._unbind=function(el,name,fn,bub){delegatevents[name]?self.undelegate(el,name,fn,bub):el.removeEventListener(name,fn,bub)},this.unbindAll=function(){for(var a=0;a<self.events.length;a++){var r=self.events[a];r.q?r.e.unbind(r.n,r.f):self._unbind(r.e,r.n,r.f,r.b)}},this.showRails=function(){return self.showRail().showRailHr()},this.showRail=function(){return 0===self.page.maxh||!self.ispage&&"none"==self.win.css("display")||(self.rail.visibility=!0,self.rail.css("display","block")),self},this.showRailHr=function(){return self.railh&&(0===self.page.maxw||!self.ispage&&"none"==self.win.css("display")||(self.railh.visibility=!0,self.railh.css("display","block"))),self},this.hideRails=function(){return self.hideRail().hideRailHr()},this.hideRail=function(){return self.rail.visibility=!1,self.rail.css("display","none"),self},this.hideRailHr=function(){return self.railh&&(self.railh.visibility=!1,self.railh.css("display","none")),self},this.show=function(){return self.hidden=!1,self.railslocked=!1,self.showRails()},this.hide=function(){return self.hidden=!0,self.railslocked=!0,self.hideRails()},this.toggle=function(){return self.hidden?self.show():self.hide()},this.remove=function(){for(var n in self.stop(),self.cursortimeout&&clearTimeout(self.cursortimeout),self.delaylist)self.delaylist[n]&&clearAnimationFrame(self.delaylist[n].h);self.doZoomOut(),self.unbindAll(),cap.isie9&&self.win[0].detachEvent("onpropertychange",self.onAttributeChange),!1!==self.observer&&self.observer.disconnect(),!1!==self.observerremover&&self.observerremover.disconnect(),!1!==self.observerbody&&self.observerbody.disconnect(),self.events=null,self.cursor&&self.cursor.remove(),self.cursorh&&self.cursorh.remove(),self.rail&&self.rail.remove(),self.railh&&self.railh.remove(),self.zoom&&self.zoom.remove();for(var a=0;a<self.saved.css.length;a++){var d=self.saved.css[a];d[0].css(d[1],void 0===d[2]?"":d[2])}self.saved=!1,self.me.data("__axscroll","");var lst=$.axscroll;for(var i in lst.each((function(i){if(this&&this.id===self.id){delete lst[i];for(var b=++i;b<lst.length;b++,i++)lst[i]=lst[b];lst.length--,lst.length&&delete lst[lst.length]}})),self)self[i]=null,delete self[i];self=null},this.scrollstart=function(fn){return this.onscrollstart=fn,self},this.scrollend=function(fn){return this.onscrollend=fn,self},this.scrollcancel=function(fn){return this.onscrollcancel=fn,self},this.zoomin=function(fn){return this.onzoomin=fn,self},this.zoomout=function(fn){return this.onzoomout=fn,self},this.isScrollable=function(e){var dom=e.target?e.target:e;if("OPTION"==dom.nodeName)return!0;for(;dom&&1==dom.nodeType&&dom!==this.me[0]&&!/^BODY|HTML/.test(dom.nodeName);){var dd=$(dom),ov=dd.css("overflowY")||dd.css("overflowX")||dd.css("overflow")||"";if(/scroll|auto/.test(ov))return dom.clientHeight!=dom.scrollHeight;dom=!!dom.parentNode&&dom.parentNode}return!1},this.getViewport=function(me){for(var dom=!(!me||!me.parentNode)&&me.parentNode;dom&&1==dom.nodeType&&!/^BODY|HTML/.test(dom.nodeName);){var dd=$(dom);if(/fixed|absolute/.test(dd.css("position")))return dd;var ov=dd.css("overflowY")||dd.css("overflowX")||dd.css("overflow")||"";if(/scroll|auto/.test(ov)&&dom.clientHeight!=dom.scrollHeight)return dd;if(dd.getAxScroll().length>0)return dd;dom=!!dom.parentNode&&dom.parentNode}return!1},this.triggerScrollStart=function(cx,cy,rx,ry,ms){if(self.onscrollstart){var info={type:"scrollstart",current:{x:cx,y:cy},request:{x:rx,y:ry},end:{x:self.newscrollx,y:self.newscrolly},speed:ms};self.onscrollstart.call(self,info)}},this.triggerScrollEnd=function(){if(self.onscrollend){var px=self.getScrollLeft(),py=self.getScrollTop(),info={type:"scrollend",current:{x:px,y:py},end:{x:px,y:py}};self.onscrollend.call(self,info)}};var scrolldiry=0,scrolldirx=0,scrolltmr=0,scrollspd=1;function doScrollRelative(px,py,chkscroll,iswheel){self.scrollrunning||(self.newscrolly=self.getScrollTop(),self.newscrollx=self.getScrollLeft(),scrolltmr=now());var gap=now()-scrolltmr;if(scrolltmr=now(),gap>350?scrollspd=1:scrollspd+=(2-scrollspd)/10,py=py*scrollspd|0,px=px*scrollspd|0){if(iswheel)if(px<0){if(self.getScrollLeft()>=self.page.maxw)return!0}else if(self.getScrollLeft()<=0)return!0;var dx=px>0?1:-1;scrolldirx!==dx&&(self.scrollmom&&self.scrollmom.stop(),self.newscrollx=self.getScrollLeft(),scrolldirx=dx),self.lastdeltax-=px}if(py){var chk;if(function(){var top=self.getScrollTop();if(py<0){if(top>=self.page.maxh)return!0}else if(top<=0)return!0}()){if(opt.nativeparentscrolling&&chkscroll&&!self.ispage&&!self.zoomactive)return!0;var ny=self.view.h>>1;self.newscrolly<-ny?(self.newscrolly=-ny,py=-1):self.newscrolly>self.page.maxh+ny?(self.newscrolly=self.page.maxh+ny,py=1):py=0}var dy=py>0?1:-1;scrolldiry!==dy&&(self.scrollmom&&self.scrollmom.stop(),self.newscrolly=self.getScrollTop(),scrolldiry=dy),self.lastdeltay-=py}(py||px)&&self.synched("relativexy",(function(){var dty=self.lastdeltay+self.newscrolly;self.lastdeltay=0;var dtx=self.lastdeltax+self.newscrollx;self.lastdeltax=0,self.rail.drag||self.doScrollPos(dtx,dty)}))}var hasparentscrollingphase=!1;function execScrollWheel(e,hr,chkscroll){var px,py,hrend,chk;if(!chkscroll&&hasparentscrollingphase)return!0;(0===e.deltaMode?(px=-e.deltaX*(opt.mousescrollstep/54)|0,py=-e.deltaY*(opt.mousescrollstep/54)|0):1===e.deltaMode&&(px=-e.deltaX*opt.mousescrollstep*50/80|0,py=-e.deltaY*opt.mousescrollstep*50/80|0),hr&&opt.oneaxismousemode&&0===px&&py)&&(px=py,py=0,chkscroll&&(px<0?self.getScrollLeft()>=self.page.maxw:self.getScrollLeft()<=0)&&(py=px,px=0));if(self.isrtlmode&&(px=-px),!doScrollRelative(px,py,chkscroll,!0))return hasparentscrollingphase=!1,e.stopImmediatePropagation(),e.preventDefault();chkscroll&&(hasparentscrollingphase=!0)}if(this.onmousewheel=function(e){if(self.wheelprevented||self.locked)return!1;if(self.railslocked)return self.debounced("checkunlock",self.resize,250),!1;if(self.rail.drag)return self.cancelEvent(e);if("auto"===opt.oneaxismousemode&&0!==e.deltaX&&(opt.oneaxismousemode=!1),opt.oneaxismousemode&&0===e.deltaX&&!self.rail.scrollable)return!self.railh||!self.railh.scrollable||self.onmousewheelhr(e);var nw=now(),chk=!1;if(opt.preservenativescrolling&&self.checkarea+600<nw&&(self.nativescrollingarea=self.isScrollable(e),chk=!0),self.checkarea=nw,self.nativescrollingarea)return!0;var ret=execScrollWheel(e,!1,chk);return ret&&(self.checkarea=0),ret},this.onmousewheelhr=function(e){if(!self.wheelprevented){if(self.railslocked||!self.railh.scrollable)return!0;if(self.rail.drag)return self.cancelEvent(e);var nw=now(),chk=!1;return opt.preservenativescrolling&&self.checkarea+600<nw&&(self.nativescrollingarea=self.isScrollable(e),chk=!0),self.checkarea=nw,!!self.nativescrollingarea||(self.railslocked?self.cancelEvent(e):execScrollWheel(e,!0,chk))}},this.stop=function(){return self.cancelScroll(),self.scrollmon&&self.scrollmon.stop(),self.cursorfreezed=!1,self.scroll.y=Math.round(self.getScrollTop()*(1/self.scrollratio.y)),self.noticeCursor(),self},this.getTransitionSpeed=function(dif){return 80+dif/72*opt.scrollspeed|0},opt.smoothscroll)if(self.ishwscroll&&cap.hastransition&&opt.usetransition&&opt.smoothscroll){var lasttransitionstyle="";this.resetTransition=function(){lasttransitionstyle="",self.doc.css(cap.prefixstyle+"transition-duration","0ms")},this.prepareTransition=function(dif,istime){var ex=istime?dif:self.getTransitionSpeed(dif),trans=ex+"ms";return lasttransitionstyle!==trans&&(lasttransitionstyle=trans,self.doc.css(cap.prefixstyle+"transition-duration",trans)),ex},this.doScrollLeft=function(x,spd){var y=self.scrollrunning?self.newscrolly:self.getScrollTop();self.doScrollPos(x,y,spd)},this.doScrollTop=function(y,spd){var x=self.scrollrunning?self.newscrollx:self.getScrollLeft();self.doScrollPos(x,y,spd)},this.cursorupdate={running:!1,start:function(){var m=this;if(!m.running){m.running=!0;var loop=function(){m.running&&setAnimationFrame(loop),self.showCursor(self.getScrollTop(),self.getScrollLeft()),self.notifyScrollEvent(self.win[0])};setAnimationFrame(loop)}},stop:function(){this.running=!1}},this.doScrollPos=function(x,y,spd){var py=self.getScrollTop(),px=self.getScrollLeft();if(((self.newscrolly-py)*(y-py)<0||(self.newscrollx-px)*(x-px)<0)&&self.cancelScroll(),opt.bouncescroll?(y<0?y=y/2|0:y>self.page.maxh&&(y=self.page.maxh+(y-self.page.maxh)/2|0),x<0?x=x/2|0:x>self.page.maxw&&(x=self.page.maxw+(x-self.page.maxw)/2|0)):(y<0?y=0:y>self.page.maxh&&(y=self.page.maxh),x<0?x=0:x>self.page.maxw&&(x=self.page.maxw)),self.scrollrunning&&x==self.newscrollx&&y==self.newscrolly)return!1;self.newscrolly=y,self.newscrollx=x;var top=self.getScrollTop(),lft=self.getScrollLeft(),dst={};dst.x=x-lft,dst.y=y-top;var dd=0|Math.sqrt(dst.x*dst.x+dst.y*dst.y),ms=self.prepareTransition(dd);self.scrollrunning||(self.scrollrunning=!0,self.triggerScrollStart(lft,top,x,y,ms),self.cursorupdate.start()),self.scrollendtrapped=!0,cap.transitionend||(self.scrollendtrapped&&clearTimeout(self.scrollendtrapped),self.scrollendtrapped=setTimeout(self.onScrollTransitionEnd,ms)),self.setScrollTop(self.newscrolly),self.setScrollLeft(self.newscrollx)},this.cancelScroll=function(){if(!self.scrollendtrapped)return!0;var py=self.getScrollTop(),px=self.getScrollLeft();return self.scrollrunning=!1,cap.transitionend||clearTimeout(cap.transitionend),self.scrollendtrapped=!1,self.resetTransition(),self.setScrollTop(py),self.railh&&self.setScrollLeft(px),self.timerscroll&&self.timerscroll.tm&&clearInterval(self.timerscroll.tm),self.timerscroll=!1,self.cursorfreezed=!1,self.cursorupdate.stop(),self.showCursor(py,px),self},this.onScrollTransitionEnd=function(){if(self.scrollendtrapped){var py=self.getScrollTop(),px=self.getScrollLeft();if(py<0?py=0:py>self.page.maxh&&(py=self.page.maxh),px<0?px=0:px>self.page.maxw&&(px=self.page.maxw),py!=self.newscrolly||px!=self.newscrollx)return self.doScrollPos(px,py,opt.snapbackspeed);self.scrollrunning&&self.triggerScrollEnd(),self.scrollrunning=!1,self.scrollendtrapped=!1,self.resetTransition(),self.timerscroll=!1,self.setScrollTop(py),self.railh&&self.setScrollLeft(px),self.cursorupdate.stop(),self.noticeCursor(!1,py,px),self.cursorfreezed=!1}}}else this.doScrollLeft=function(x,spd){var y=self.scrollrunning?self.newscrolly:self.getScrollTop();self.doScrollPos(x,y,spd)},this.doScrollTop=function(y,spd){var x=self.scrollrunning?self.newscrollx:self.getScrollLeft();self.doScrollPos(x,y,spd)},this.doScrollPos=function(x,y,spd){var py=self.getScrollTop(),px=self.getScrollLeft();((self.newscrolly-py)*(y-py)<0||(self.newscrollx-px)*(x-px)<0)&&self.cancelScroll();var clipped=!1;if(self.bouncescroll&&self.rail.visibility||(y<0?(y=0,clipped=!0):y>self.page.maxh&&(y=self.page.maxh,clipped=!0)),self.bouncescroll&&self.railh.visibility||(x<0?(x=0,clipped=!0):x>self.page.maxw&&(x=self.page.maxw,clipped=!0)),self.scrollrunning&&self.newscrolly===y&&self.newscrollx===x)return!0;self.newscrolly=y,self.newscrollx=x,self.dst={},self.dst.x=x-px,self.dst.y=y-py,self.dst.px=px,self.dst.py=py;var dd=0|Math.sqrt(self.dst.x*self.dst.x+self.dst.y*self.dst.y),ms=self.getTransitionSpeed(dd);self.bzscroll={};var p3=clipped?1:.58;self.bzscroll.x=new BezierClass(px,self.newscrollx,ms,0,0,p3,1),self.bzscroll.y=new BezierClass(py,self.newscrolly,ms,0,0,p3,1);var loopid=now(),loop=function(){if(self.scrollrunning){var x=self.bzscroll.y.getPos();self.setScrollLeft(self.bzscroll.x.getNow()),self.setScrollTop(self.bzscroll.y.getNow()),x<=1?self.timer=setAnimationFrame(loop):(self.scrollrunning=!1,self.timer=0,self.triggerScrollEnd())}};self.scrollrunning||(self.triggerScrollStart(px,py,x,y,ms),self.scrollrunning=!0,self.timer=setAnimationFrame(loop))},this.cancelScroll=function(){return self.timer&&clearAnimationFrame(self.timer),self.timer=0,self.bzscroll=!1,self.scrollrunning=!1,self};else this.doScrollLeft=function(x,spd){var y=self.getScrollTop();self.doScrollPos(x,y,spd)},this.doScrollTop=function(y,spd){var x=self.getScrollLeft();self.doScrollPos(x,y,spd)},this.doScrollPos=function(x,y,spd){var nx=x>self.page.maxw?self.page.maxw:x;nx<0&&(nx=0);var ny=y>self.page.maxh?self.page.maxh:y;ny<0&&(ny=0),self.synched("scroll",(function(){self.setScrollTop(ny),self.setScrollLeft(nx)}))},this.cancelScroll=function(){};this.doScrollBy=function(stp,relative){doScrollRelative(0,stp)},this.doScrollLeftBy=function(stp,relative){doScrollRelative(stp,0)},this.doScrollTo=function(pos,relative){var ny=relative?Math.round(pos*self.scrollratio.y):pos;ny<0?ny=0:ny>self.page.maxh&&(ny=self.page.maxh),self.cursorfreezed=!1,self.doScrollTop(pos)},this.checkContentSize=function(){var pg=self.getContentSize();pg.h==self.page.h&&pg.w==self.page.w||self.resize(!1,pg)},self.onscroll=function(e){self.rail.drag||self.cursorfreezed||self.synched("scroll",(function(){self.scroll.y=Math.round(self.getScrollTop()/self.scrollratio.y),self.railh&&(self.scroll.x=Math.round(self.getScrollLeft()/self.scrollratio.x)),self.noticeCursor()}))},self.bind(self.docscroll,"scroll",self.onscroll),this.doZoomIn=function(e){if(!self.zoomactive){self.zoomactive=!0,self.zoomrestore={style:{}};var lst=["position","top","left","zIndex","backgroundColor","marginTop","marginBottom","marginLeft","marginRight"],win=self.win[0].style;for(var a in lst){var pp=lst[a];self.zoomrestore.style[pp]=void 0!==win[pp]?win[pp]:""}self.zoomrestore.style.width=self.win.css("width"),self.zoomrestore.style.height=self.win.css("height"),self.zoomrestore.padding={w:self.win.outerWidth()-self.win.width(),h:self.win.outerHeight()-self.win.height()},cap.isios4&&(self.zoomrestore.scrollTop=$window.scrollTop(),$window.scrollTop(0)),self.win.css({position:cap.isios4?"absolute":"fixed",top:0,left:0,zIndex:globalmaxzindex+100,margin:0});var bkg=self.win.css("backgroundColor");return(""===bkg||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(bkg))&&self.win.css("backgroundColor","#fff"),self.rail.css({zIndex:globalmaxzindex+101}),self.zoom.css({zIndex:globalmaxzindex+102}),self.zoom.css("backgroundPosition","0 -18px").empty().prepend(svgCollapse),self.resizeZoom(),self.onzoomin&&self.onzoomin.call(self),self.cancelEvent(e)}},this.doZoomOut=function(e){if(self.zoomactive)return self.zoomactive=!1,self.win.css("margin",""),self.win.css(self.zoomrestore.style),cap.isios4&&$window.scrollTop(self.zoomrestore.scrollTop),self.rail.css({"z-index":self.zindex}),self.zoom.css({"z-index":self.zindex}),self.zoomrestore=!1,self.zoom.css("backgroundPosition","0 0").empty().prepend(svgExpand),self.onResize(),self.onzoomout&&self.onzoomout.call(self),self.cancelEvent(e)},this.doZoom=function(e){return self.zoomactive?self.doZoomOut(e):self.doZoomIn(e)},this.resizeZoom=function(){if(self.zoomactive){var py=self.getScrollTop();self.win.css({width:$window.width()-self.zoomrestore.padding.w+"px",height:$window.height()-self.zoomrestore.padding.h+"px"}),self.onResize(),self.setScrollTop(Math.min(self.page.maxh,py))}},this.init(),$.axscroll.push(this)},ScrollMomentumClass2D=function(nc){var self=this;this.nc=nc,this.lastx=0,this.lasty=0,this.speedx=0,this.speedy=0,this.lasttime=0,this.steptime=0,this.snapx=!1,this.snapy=!1,this.demulx=0,this.demuly=0,this.lastscrollx=-1,this.lastscrolly=-1,this.chkx=0,this.chky=0,this.timer=0,this.reset=function(px,py){self.stop(),self.steptime=0,self.lasttime=now(),self.speedx=0,self.speedy=0,self.lastx=px,self.lasty=py,self.lastscrollx=-1,self.lastscrolly=-1},this.update=function(px,py){var tm=now();self.steptime=tm-self.lasttime,self.lasttime=tm;var dy=py-self.lasty,dx=px-self.lastx,sy,sx,newy=self.nc.getScrollTop()+dy,newx=self.nc.getScrollLeft()+dx;self.snapx=newx<0||newx>self.nc.page.maxw,self.snapy=newy<0||newy>self.nc.page.maxh,self.speedx=dx,self.speedy=dy,self.lastx=px,self.lasty=py},this.stop=function(){self.nc.unsynched("domomentum2d"),self.timer&&clearTimeout(self.timer),self.timer=0,self.lastscrollx=-1,self.lastscrolly=-1},this.doSnapy=function(nx,ny){var snap=!1;ny<0?(ny=0,snap=!0):ny>self.nc.page.maxh&&(ny=self.nc.page.maxh,snap=!0),nx<0?(nx=0,snap=!0):nx>self.nc.page.maxw&&(nx=self.nc.page.maxw,snap=!0),snap?self.nc.doScrollPos(nx,ny,self.nc.opt.snapbackspeed):self.nc.triggerScrollEnd()},this.doMomentum=function(gp){var t=now(),l=gp?t+gp:self.lasttime,sl=self.nc.getScrollLeft(),st=self.nc.getScrollTop(),pageh=self.nc.page.maxh,pagew=self.nc.page.maxw;self.speedx=pagew>0?Math.min(60,self.speedx):0,self.speedy=pageh>0?Math.min(60,self.speedy):0;var chk=l&&t-l<=60;(st<0||st>pageh||sl<0||sl>pagew)&&(chk=!1);var sy=!(!self.speedy||!chk)&&self.speedy,sx=!(!self.speedx||!chk)&&self.speedx;if(sy||sx){var tm=Math.max(16,self.steptime);if(tm>50){var xm=tm/50;self.speedx*=xm,self.speedy*=xm,tm=50}self.demulxy=0,self.lastscrollx=self.nc.getScrollLeft(),self.chkx=self.lastscrollx,self.lastscrolly=self.nc.getScrollTop(),self.chky=self.lastscrolly;var nx=self.lastscrollx,ny=self.lastscrolly,onscroll=function(){var df=now()-t>600?.04:.02;self.speedx&&(nx=Math.floor(self.lastscrollx-self.speedx*(1-self.demulxy)),self.lastscrollx=nx,(nx<0||nx>pagew)&&(df=.1)),self.speedy&&(ny=Math.floor(self.lastscrolly-self.speedy*(1-self.demulxy)),self.lastscrolly=ny,(ny<0||ny>pageh)&&(df=.1)),self.demulxy=Math.min(1,self.demulxy+df),self.nc.synched("domomentum2d",(function(){if(self.speedx){var scx=self.nc.getScrollLeft();self.chkx=nx,self.nc.setScrollLeft(nx)}if(self.speedy){var scy=self.nc.getScrollTop();self.chky=ny,self.nc.setScrollTop(ny)}self.timer||(self.nc.hideCursor(),self.doSnapy(nx,ny))})),self.demulxy<1?self.timer=setTimeout(onscroll,tm):(self.stop(),self.nc.hideCursor(),self.doSnapy(nx,ny))};onscroll()}else self.doSnapy(self.nc.getScrollLeft(),self.nc.getScrollTop())}},_scrollTop=jQuery.fn.scrollTop;jQuery.cssHooks.pageYOffset={get:function(elem,computed,extra){var nice=$.data(elem,"__axscroll")||!1;return nice&&nice.ishwscroll?nice.getScrollTop():_scrollTop.call(elem)},set:function(elem,value){var nice=$.data(elem,"__axscroll")||!1;return nice&&nice.ishwscroll?nice.setScrollTop(parseInt(value)):_scrollTop.call(elem,value),this}},jQuery.fn.scrollTop=function(value){if(void 0===value){var nice=this[0]&&$.data(this[0],"__axscroll")||!1;return nice&&nice.ishwscroll?nice.getScrollTop():_scrollTop.call(this)}return this.each((function(){var nice=$.data(this,"__axscroll")||!1;nice&&nice.ishwscroll?nice.setScrollTop(parseInt(value)):_scrollTop.call($(this),value)}))};var _scrollLeft=jQuery.fn.scrollLeft;$.cssHooks.pageXOffset={get:function(elem,computed,extra){var nice=$.data(elem,"__axscroll")||!1;return nice&&nice.ishwscroll?nice.getScrollLeft():_scrollLeft.call(elem)},set:function(elem,value){var nice=$.data(elem,"__axscroll")||!1;return nice&&nice.ishwscroll?nice.setScrollLeft(parseInt(value)):_scrollLeft.call(elem,value),this}},jQuery.fn.scrollLeft=function(value){if(void 0===value){var nice=this[0]&&$.data(this[0],"__axscroll")||!1;return nice&&nice.ishwscroll?nice.getScrollLeft():_scrollLeft.call(this)}return this.each((function(){var nice=$.data(this,"__axscroll")||!1;nice&&nice.ishwscroll?nice.setScrollLeft(parseInt(value)):_scrollLeft.call($(this),value)}))};var AxScrollArray=function(doms){var self=this;if(this.length=0,this.name="axscrollarray",this.each=function(fn){return $.each(self,fn),self},this.push=function(nice){self[self.length]=nice,self.length++},this.eq=function(idx){return self[idx]},doms)for(var a=0;a<doms.length;a++){var nice=$.data(doms[a],"__axscroll")||!1;nice&&(this[this.length]=nice,this.length++)}return this},pseudos;function mplex(el,lst,fn){for(var a=0,l=lst.length;a<l;a++)fn(el,lst[a])}mplex(AxScrollArray.prototype,["show","hide","toggle","onResize","resize","remove","stop","doScrollPos"],(function(e,n){e[n]=function(){var args=arguments;return this.each((function(){this[n].apply(this,args)}))}})),jQuery.fn.getAxScroll=function(index){return void 0===index?new AxScrollArray(this):this[index]&&$.data(this[index],"__axscroll")||!1},(jQuery.expr.pseudos||jQuery.expr[":"]).axscroll=function(a){return void 0!==$.data(a,"__axscroll")},$.fn.axScroll=function(wrapper,_opt){void 0!==_opt||"object"!=typeof wrapper||"jquery"in wrapper||(_opt=wrapper,wrapper=!1);var ret=new AxScrollArray;return this.each((function(){var $this=$(this),opt=$.extend({},_opt),docundef;if(wrapper){var wrp=$(wrapper);opt.doc=wrp.length>1?$(wrapper,$this):wrp,opt.win=$this}!("doc"in opt)||"win"in opt||(opt.win=$this);var nice=$this.data("__axscroll")||!1;nice||(opt.doc=opt.doc||$this,nice=new AxScrollClass(opt,$this),$this.data("__axscroll",nice)),ret.push(nice)})),1===ret.length?ret[0]:ret},_win.AxScroll={getjQuery:function(){return jQuery}},$.axscroll||($.axscroll=new AxScrollArray,$.axscroll.options=_globaloptions)})),"pc"==platformIs&&($(".ax-scroll").axScroll(),$("body").bind("resize",(function(){$(".ax-scroll").getAxScroll().resize()}))),function(window,document,undefined){"use strict";var factory;factory=function($){var pluginName="axPopup",pluginClass="ax-popup",pluginType="ax.popup",defaults={placement:"auto",container:null,width:"auto",height:"auto",maxWidth:"",maxHeight:"",trigger:"click",style:"",selector:!1,delay:{show:null,hide:300},async:{type:"GET",before:null,success:null,error:null},cache:!0,multi:!1,arrow:!0,title:"",content:"",closeable:!1,padding:!0,url:"",type:"html",direction:"",animation:null,template:'<div class="ax-popup"><div class="ax-arrow"></div><div class="ax-popup-inner"><a href="#" class="ax-close"></a><div class="ax-popup-title"></div><div class="ax-popup-content"><i class="ax-refresh"></i> <p>&nbsp;</p></div></div></div>',backdrop:!1,dismissible:!0,onShow:null,onHide:null,abortXHR:!0,autoHide:!1,offsetTop:0,offsetLeft:0,iframeOptions:{frameborder:"0",allowtransparency:"true",id:"",name:"",scrolling:"",onload:"",class:"",height:"100%",width:"100%"},hideEmpty:!1},rtlClass="ax-popup-rtl",_srcElements=[],backdrop=$('<div class="ax-popup-backdrop"></div>'),_globalIdSeed=0,_isBodyEventHandled=!1,_offsetOut=-2e3,$document=$(document),toNumber=function(numeric,fallback){return isNaN(numeric)?fallback||0:Number(numeric)},getPopFromElement=function($element){return $element.data("plugin_axPopup")},hideAllPop=function(){for(var pop=null,i=0;i<_srcElements.length;i++)(pop=getPopFromElement(_srcElements[i]))&&pop.hide(!0);$document.trigger("hiddenAll.ax.popup")},hideOtherPops=function(currentPop){for(var pop=null,i=0;i<_srcElements.length;i++)(pop=getPopFromElement(_srcElements[i]))&&pop.id!==currentPop.id&&pop.hide(!0);$document.trigger("hiddenAll.ax.popup")},isMobile="ontouchstart"in document.documentElement&&/Mobi/.test(navigator.userAgent),pointerEventToXY=function(e){var out={x:0,y:0};if("touchstart"===e.type||"touchmove"===e.type||"touchend"===e.type||"touchcancel"===e.type){var touch=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0];out.x=touch.pageX,out.y=touch.pageY}else"mousedown"!==e.type&&"mouseup"!==e.type&&"click"!==e.type||(out.x=e.pageX,out.y=e.pageY);return out};function AxPopup(element,options){return this.$element=$(element),options&&("string"!==$.type(options.delay)&&"number"!==$.type(options.delay)||(options.delay={show:options.delay,hide:options.delay})),this.options=$.extend({},defaults,options),this._defaults=defaults,this._name="axPopup",this._targetclick=!1,this.init(),_srcElements.push(this.$element),this}AxPopup.prototype={init:function(){if(this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");"manual"!==this.getTrigger()&&(isMobile?this.$element.off("touchend",this.options.selector).on("touchend",this.options.selector,$.proxy(this.toggle,this)):"click"===this.getTrigger()?this.$element.off("click",this.options.selector).on("click",this.options.selector,$.proxy(this.toggle,this)):"hover"===this.getTrigger()&&this.$element.off("mouseenter mouseleave click",this.options.selector).on("mouseenter",this.options.selector,$.proxy(this.mouseenterHandler,this)).on("mouseleave",this.options.selector,$.proxy(this.mouseleaveHandler,this))),this._poped=!1,this._inited=!0,this._opened=!1,this._idSeed=_globalIdSeed,this.id="axPopup"+this._idSeed,this.options.container=$(this.options.container||document.body).first(),this.options.backdrop&&backdrop.appendTo(this.options.container).hide(),_globalIdSeed++,"sticky"===this.getTrigger()&&this.show(),this.options.selector&&(this._options=$.extend({},this.options,{selector:""}))},destroy:function(){for(var index=-1,i=0;i<_srcElements.length;i++)if(_srcElements[i]===this.$element){index=i;break}_srcElements.splice(index,1),this.hide(),this.$element.data("plugin_axPopup",null),"click"===this.getTrigger()?this.$element.off("click"):"hover"===this.getTrigger()&&this.$element.off("mouseenter mouseleave"),this.$target&&this.$target.remove()},getDelegateOptions:function(){var options={};return this._options&&$.each(this._options,(function(key,value){defaults[key]!==value&&(options[key]=value)})),options},hide:function(force,event){if((force||"sticky"!==this.getTrigger())&&this._opened){event&&(event.preventDefault(),event.stopPropagation()),this.xhr&&!0===this.options.abortXHR&&(this.xhr.abort(),this.xhr=null);var e=$.Event("hide.ax.popup");if(this.$element.trigger(e,[this.$target]),this.$target){this.$target.removeClass("ax-in").addClass(this.getHideAnimation());var that=this;setTimeout((function(){that.$target.hide(),that.getCache()||that.$target.remove()}),that.getHideDelay())}this.options.backdrop&&backdrop.hide(),this._opened=!1,this.$element.trigger("hidden.ax.popup",[this.$target]),this.options.onHide&&this.options.onHide(this.$target)}},resetAutoHide:function(){var that=this,autoHide=that.getAutoHide();autoHide&&(that.autoHideHandler&&clearTimeout(that.autoHideHandler),that.autoHideHandler=setTimeout((function(){that.hide()}),autoHide))},delegate:function(eventTarget){var self=$(eventTarget).data("plugin_axPopup");return self||(self=new AxPopup(eventTarget,this.getDelegateOptions()),$(eventTarget).data("plugin_axPopup",self)),self},toggle:function(e){var self=this;e&&(e.preventDefault(),e.stopPropagation(),this.options.selector&&(self=this.delegate(e.currentTarget))),self[self.getTarget().hasClass("ax-in")?"hide":"show"]()},hideAll:function(){hideAllPop()},hideOthers:function(){hideOtherPops(this)},show:function(){if(!this._opened){var $target=this.getTarget().removeClass().addClass("ax-popup").addClass(this._customTargetClass);if(this.options.multi||this.hideOthers(),!this.getCache()||!this._poped||""===this.content){if(this.content="",this.setTitle(this.getTitle()),this.options.closeable||$target.find(".ax-close").off("click").remove(),this.isAsync()?this.setContentASync(this.options.content):this.setContent(this.getContent()),this.canEmptyHide()&&""===this.content)return;$target.show()}this.displayContent(),this.options.onShow&&this.options.onShow($target),this.bindBodyEvents(),this.options.backdrop&&backdrop.show(),this._opened=!0,this.resetAutoHide()}},displayContent:function(){var elementPos=this.getElementPosition(),$target=this.getTarget().removeClass().addClass("ax-popup").addClass(this._customTargetClass),$targetContent=this.getContentElement(),targetWidth=$target[0].offsetWidth,targetHeight=$target[0].offsetHeight,placement="bottom",e=$.Event("show.ax.popup");if(this.canEmptyHide()){var content=$targetContent.children().html();if(null!==content&&0===content.trim().length)return}this.$element.trigger(e,[$target]);var optWidth=this.$element.data("width")||this.options.width;""===optWidth&&(optWidth=this._defaults.width),"auto"!==optWidth&&$targetContent.width(optWidth);var optmaxWidth=this.$element.attr("data-maxWidth")||this.$element.data("maxWidth")||this.options.maxWidth;""===optmaxWidth?optmaxWidth=this._defaults.maxWidth:$targetContent.css("max-width",optmaxWidth);var optHeight=this.$element.data("height")||this.options.height;""===optHeight&&(optHeight=this._defaults.height),"auto"!==optHeight&&$targetContent.height(optHeight);var optmaxHeight=this.$element.attr("data-maxHeight")||this.$element.data("maxHeight")||this.options.maxHeight;""===optmaxHeight?optmaxHeight=this._defaults.maxHeight:$targetContent.css("max-height",optmaxHeight),this.options.style&&this.$target.addClass("ax-popup-"+this.options.style),"rtl"!==this.options.direction||$targetContent.hasClass(rtlClass)||$targetContent.addClass(rtlClass),this.options.arrow||$target.find(".ax-arrow").remove(),$target.detach().css({top:-2e3,left:-2e3,display:"block"}),this.getAnimation()&&$target.addClass(this.getAnimation()),$target.appendTo(this.options.container),placement=this.getPlacement(elementPos),this.$element.trigger("added.ax.popup"),this.initTargetEvents(),this.options.padding||("auto"!==this.options.height&&$targetContent.css("height",$targetContent.outerHeight()),this.$target.addClass("ax-no-padding")),targetWidth=$target[0].offsetWidth,targetHeight=$target[0].offsetHeight;var postionInfo=this.getTargetPositin(elementPos,placement,targetWidth,targetHeight);if(this.$target.css(postionInfo.position).addClass("ax-"+placement).addClass("ax-in"),"iframe"===this.options.type){var $iframe=$target.find("iframe"),iframeWidth=$target.width(),iframeHeight=$iframe.parent().height();""!==this.options.iframeOptions.width&&"auto"!==this.options.iframeOptions.width&&(iframeWidth=this.options.iframeOptions.width),""!==this.options.iframeOptions.height&&"auto"!==this.options.iframeOptions.height&&(iframeHeight=this.options.iframeOptions.height),$iframe.width(iframeWidth).height(iframeHeight)}if(this.options.arrow||this.$target.css({margin:0}),this.options.arrow){var $arrow=this.$target.find(".ax-arrow");$arrow.removeAttr("style"),"left"===placement||"right"===placement?$arrow.css({top:this.$target.height()/2}):"top"!==placement&&"bottom"!==placement||$arrow.css({left:this.$target.width()/2}),postionInfo.arrowOffset&&(-1===postionInfo.arrowOffset.left||-1===postionInfo.arrowOffset.top?$arrow.hide():$arrow.css(postionInfo.arrowOffset))}this._poped=!0,this.$element.trigger("shown.ax.popup",[this.$target]),$targetContent.axScroll()},isTargetLoaded:function(){return 0===this.getTarget().find("i.glyphicon-refresh").length},getTriggerElement:function(){return this.$element},getTarget:function(){if(!this.$target){var id="axPopup"+this._idSeed;this.$target=$(this.options.template).attr("id",id),this._customTargetClass="ax-popup"!==this.$target.attr("class")?this.$target.attr("class"):null,this.getTriggerElement().attr("data-target",id)}return this.$target.data("trigger-element")||this.$target.data("trigger-element",this.getTriggerElement()),this.$target},removeTarget:function(){this.$target.remove(),this.$target=null,this.$contentElement=null},getTitleElement:function(){return this.getTarget().find(".ax-popup-title")},getContentElement:function(){return this.$contentElement||(this.$contentElement=this.getTarget().find(".ax-popup-content")),this.$contentElement},getTitle:function(){return this.$element.attr("data-title")||this.options.title},getUrl:function(){return this.$element.attr("data-url")||this.options.url},getAutoHide:function(){return this.$element.attr("data-auto-hide")||this.options.autoHide},getOffsetTop:function(){return toNumber(this.$element.attr("data-offset-top"))||this.options.offsetTop},getOffsetLeft:function(){return toNumber(this.$element.attr("data-offset-left"))||this.options.offsetLeft},getCache:function(){var dataAttr=this.$element.attr("data-cache");if(void 0!==dataAttr)switch(dataAttr.toLowerCase()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":return!1}return this.options.cache},getTrigger:function(){return this.$element.attr("data-trigger")||this.options.trigger},getDelayShow:function(){var dataAttr=this.$element.attr("data-delay-show");return void 0!==dataAttr?dataAttr:0===this.options.delay.show?0:this.options.delay.show||100},getHideDelay:function(){var dataAttr=this.$element.attr("data-delay-hide");return void 0!==dataAttr?dataAttr:0===this.options.delay.hide?0:this.options.delay.hide||100},getAnimation:function(){var dataAttr=this.$element.attr("data-animation");return null==this.options.animation?dataAttr||this.options.animation:"ax-"+this.options.animation},getHideAnimation:function(){var ani=this.getAnimation();return ani?ani+"-out":"ax-out"},setTitle:function(title){var $titleEl=this.getTitleElement();title?("rtl"!==this.options.direction||$titleEl.hasClass(rtlClass)||$titleEl.addClass(rtlClass),$titleEl.html(title)):$titleEl.remove()},hasContent:function(){return this.getContent()},canEmptyHide:function(){return this.options.hideEmpty&&"html"===this.options.type},getIframe:function(){var $iframe=$("<iframe></iframe>").attr("src",this.getUrl()),self=this;return $.each(this._defaults.iframeOptions,(function(opt){void 0!==self.options.iframeOptions[opt]&&$iframe.attr(opt,self.options.iframeOptions[opt])})),$iframe},getContent:function(){if(this.getUrl())switch(this.options.type){case"iframe":this.content=this.getIframe();break;case"html":try{this.content=$(this.getUrl()),this.content.is(":visible")||this.content.show()}catch(error){throw new Error("Unable to get popover content. Invalid selector specified.")}}else if(!this.content){var content="";if(content=$.isFunction(this.options.content)?this.options.content.apply(this.$element[0],[this]):this.options.content,this.content=this.$element.attr("data-content")||content,!this.content){var $next=this.$element.next();$next&&$next.hasClass("ax-popup-content")&&(this.content=$next)}}return this.content},setContent:function(content){var $target=this.getTarget(),$ct=this.getContentElement();"string"==typeof content?$ct.html(content):content instanceof $&&($ct.html(""),this.options.cache?content.removeClass("ax-popup-content").appendTo($ct):content.clone(!0,!0).removeClass("ax-popup-content").appendTo($ct)),this.$target=$target},isAsync:function(){return"async"===this.options.type},setContentASync:function(content){var that=this;this.xhr||(this.xhr=$.ajax({url:this.getUrl(),type:this.options.async.type,cache:this.getCache(),beforeSend:function(xhr,settings){that.options.async.before&&that.options.async.before(that,xhr,settings)},success:function(data){var $targetContent;that.bindBodyEvents(),content&&$.isFunction(content)?that.content=content.apply(that.$element[0],[data]):that.content=data,that.setContent(that.content),that.getContentElement().removeAttr("style"),that.displayContent(),that.options.async.success&&that.options.async.success(that,data)},complete:function(){that.xhr=null},error:function(xhr,data){that.options.async.error&&that.options.async.error(that,xhr,data)}}))},bindBodyEvents:function(){_isBodyEventHandled||(this.options.dismissible&&"click"===this.getTrigger()?isMobile?$document.off("touchstart.ax-popup").on("touchstart.ax-popup",$.proxy(this.bodyTouchStartHandler,this)):($document.off("keyup.ax-popup").on("keyup.ax-popup",$.proxy(this.escapeHandler,this)),$document.off("click.ax-popup").on("click.ax-popup",$.proxy(this.bodyClickHandler,this))):"hover"===this.getTrigger()&&$document.off("touchend.ax-popup").on("touchend.ax-popup",$.proxy(this.bodyClickHandler,this)))},mouseenterHandler:function(e){var self=this;e&&this.options.selector&&(self=this.delegate(e.currentTarget)),self._timeout&&clearTimeout(self._timeout),self._enterTimeout=setTimeout((function(){self.getTarget().is(":visible")||self.show()}),this.getDelayShow())},mouseleaveHandler:function(){var self=this;clearTimeout(self._enterTimeout),self._timeout=setTimeout((function(){self.hide()}),this.getHideDelay())},escapeHandler:function(e){27===e.keyCode&&this.hideAll()},bodyTouchStartHandler:function(e){var self=this,$eventEl=$(e.currentTarget);$eventEl.on("touchend",(function(e){self.bodyClickHandler(e),$eventEl.off("touchend")})),$eventEl.on("touchmove",(function(){$eventEl.off("touchend")}))},bodyClickHandler:function(e){_isBodyEventHandled=!0;for(var canHide=!0,i=0;i<_srcElements.length;i++){var pop=getPopFromElement(_srcElements[i]);if(pop&&pop._opened){var offset=pop.getTarget().offset(),popX1=offset.left,popY1=offset.top,popX2=offset.left+pop.getTarget().width(),popY2=offset.top+pop.getTarget().height(),pt=pointerEventToXY(e),inPop;if(pt.x>=popX1&&pt.x<=popX2&&pt.y>=popY1&&pt.y<=popY2){canHide=!1;break}}}canHide&&hideAllPop()},initTargetEvents:function(){"hover"===this.getTrigger()&&this.$target.off("mouseenter mouseleave").on("mouseenter",$.proxy(this.mouseenterHandler,this)).on("mouseleave",$.proxy(this.mouseleaveHandler,this)),this.$target.find(".ax-close").off("click").on("click",$.proxy(this.hide,this,!0))},getPlacement:function(pos){var placement,container=this.options.container,clientWidth=container.innerWidth(),clientHeight=container.innerHeight(),scrollTop=container.scrollTop(),scrollLeft=container.scrollLeft(),pageX=Math.max(0,pos.left-scrollLeft),pageY=Math.max(0,pos.top-scrollTop),isH="horizontal"===(placement="function"==typeof this.options.placement?this.options.placement.call(this,this.getTarget()[0],this.$element[0]):this.$element.data("placement")||this.options.placement),isV="vertical"===placement,detect;return"auto"===placement||isH||isV?placement=pageX<clientWidth/3?pageY<clientHeight/3?isH?"right-bottom":"bottom-right":pageY<2*clientHeight/3?isV?pageY<=clientHeight/2?"bottom-right":"top-right":"right":isH?"right-top":"top-right":pageX<2*clientWidth/3?pageY<clientHeight/3?isH?pageX<=clientWidth/2?"right-bottom":"left-bottom":"bottom":pageY<2*clientHeight/3?isH?pageX<=clientWidth/2?"right":"left":pageY<=clientHeight/2?"bottom":"top":isH?pageX<=clientWidth/2?"right-top":"left-top":"top":pageY<clientHeight/3?isH?"left-bottom":"bottom-left":pageY<2*clientHeight/3?isV?pageY<=clientHeight/2?"bottom-left":"top-left":"left":isH?"left-top":"top-left":"auto-top"===placement?placement=pageX<clientWidth/3?"top-right":pageX<2*clientWidth/3?"top":"top-left":"auto-bottom"===placement?placement=pageX<clientWidth/3?"bottom-right":pageX<2*clientWidth/3?"bottom":"bottom-left":"auto-left"===placement?placement=pageY<clientHeight/3?"left-top":pageY<2*clientHeight/3?"left":"left-bottom":"auto-right"===placement&&(placement=pageY<clientHeight/3?"right-bottom":pageY<2*clientHeight/3?"right":"right-top"),"mobile"!=platformIs&&"phone"!=clientIs&&"pad"!=clientIs&&"padflip"!=clientIs&&"padpro"!=clientIs||(placement="center"),placement},getElementPosition:function(){var elRect=this.$element[0].getBoundingClientRect(),container=this.options.container,cssPos=container.css("position");if(container.is(document.body)||"static"===cssPos)return $.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth||elRect.width,height:this.$element[0].offsetHeight||elRect.height});if("fixed"===cssPos){var containerRect=container[0].getBoundingClientRect();return{top:elRect.top-containerRect.top+container.scrollTop(),left:elRect.left-containerRect.left+container.scrollLeft(),width:elRect.width,height:elRect.height}}return"relative"===cssPos?{top:this.$element.offset().top-container.offset().top,left:this.$element.offset().left-container.offset().left,width:this.$element[0].offsetWidth||elRect.width,height:this.$element[0].offsetHeight||elRect.height}:void 0},getTargetPositin:function(elementPos,placement,targetWidth,targetHeight){var pos=elementPos,container=this.options.container,elementW=this.$element.outerWidth(),elementH=this.$element.outerHeight(),scrollTop=document.documentElement.scrollTop+container.scrollTop(),scrollLeft=document.documentElement.scrollLeft+container.scrollLeft(),position={},arrowOffset=null,arrowSize=this.options.arrow?20:0,padding=10,fixedW=elementW<arrowSize+10?arrowSize:0,fixedH=elementH<arrowSize+10?arrowSize:0,refix=0,pageH=document.documentElement.clientHeight+scrollTop,pageW=document.documentElement.clientWidth+scrollLeft,validLeft=pos.left+pos.width/2-fixedW>0,validRight=pos.left+pos.width/2+fixedW<pageW,validTop=pos.top+pos.height/2-fixedH>0,validBottom=pos.top+pos.height/2+fixedH<pageH;switch(placement){case"center":position={top:$(window).height()/2-targetHeight/2,left:$(window).width()/2-targetWidth/2};break;case"bottom":position={top:pos.top+pos.height,left:pos.left+pos.width/2-targetWidth/2};break;case"top":position={top:pos.top-targetHeight,left:pos.left+pos.width/2-targetWidth/2};break;case"left":position={top:pos.top+pos.height/2-targetHeight/2,left:pos.left-targetWidth};break;case"right":position={top:pos.top+pos.height/2-targetHeight/2,left:pos.left+pos.width};break;case"top-right":position={top:pos.top-targetHeight,left:validLeft?pos.left-fixedW:10},arrowOffset={left:validLeft?Math.min(elementW,targetWidth)/2+fixedW:-2e3};break;case"top-left":refix=validRight?fixedW:-10,position={top:pos.top-targetHeight,left:pos.left-targetWidth+pos.width+refix},arrowOffset={left:validRight?targetWidth-Math.min(elementW,targetWidth)/2-fixedW:-2e3};break;case"bottom-right":position={top:pos.top+pos.height,left:validLeft?pos.left-fixedW:10},arrowOffset={left:validLeft?Math.min(elementW,targetWidth)/2+fixedW:-2e3};break;case"bottom-left":refix=validRight?fixedW:-10,position={top:pos.top+pos.height,left:pos.left-targetWidth+pos.width+refix},arrowOffset={left:validRight?targetWidth-Math.min(elementW,targetWidth)/2-fixedW:-2e3};break;case"right-top":refix=validBottom?fixedH:-10,position={top:pos.top-targetHeight+pos.height+refix,left:pos.left+pos.width},arrowOffset={top:validBottom?targetHeight-Math.min(elementH,targetHeight)/2-fixedH:-2e3};break;case"right-bottom":position={top:validTop?pos.top-fixedH:10,left:pos.left+pos.width},arrowOffset={top:validTop?Math.min(elementH,targetHeight)/2+fixedH:-2e3};break;case"left-top":refix=validBottom?fixedH:-10,position={top:pos.top-targetHeight+pos.height+refix,left:pos.left-targetWidth},arrowOffset={top:validBottom?targetHeight-Math.min(elementH,targetHeight)/2-fixedH:-2e3};break;case"left-bottom":position={top:validTop?pos.top-fixedH:10,left:pos.left-targetWidth},arrowOffset={top:validTop?Math.min(elementH,targetHeight)/2+fixedH:-2e3}}return position.top+=this.getOffsetTop(),position.left+=this.getOffsetLeft(),{position:position,arrowOffset:arrowOffset}}},$.fn.axPopup=function(options,noInit){var results=[],$result=this.each((function(){var axPopup=$.data(this,"plugin_axPopup");axPopup?"destroy"===options?axPopup.destroy():"string"==typeof options&&results.push(axPopup[options]()):(options?"string"==typeof options?"destroy"!==options&&(noInit||(axPopup=new AxPopup(this,null),results.push(axPopup[options]()))):"object"==typeof options&&(axPopup=new AxPopup(this,options)):axPopup=new AxPopup(this,null),$.data(this,"plugin_axPopup",axPopup))}));return results.length?results:$result};var AxPopups={show:function(selector,options){options?$(selector).axPopup(options).axPopup("show"):$(selector).axPopup("show")},hide:function(selector){$(selector).axPopup("hide")},create:function(selector,options){options=options||{},$(selector).axPopup(options)},isCreated:function(selector){var created=!0;return $(selector).each((function(i,item){created=created&&void 0!==$(item).data("plugin_axPopup")})),created},hideAll:function(){hideAllPop()},updateContent:function(selector,content){var pop=$(selector).data("plugin_axPopup");if(pop){var cache=pop.getCache();pop.options.cache=!1,pop.options.content=content,pop._opened?(pop._opened=!1,pop.show()):pop.isAsync()?pop.setContentASync(content):pop.setContent(content),pop.options.cache=cache}},updateContentAsync:function(selector,url){var pop=$(selector).data("plugin_axPopup");if(pop){var cache=pop.getCache(),type=pop.options.type;pop.options.cache=!1,pop.options.url=url,pop._opened?(pop._opened=!1,pop.show()):(pop.options.type="async",pop.setContentASync(pop.content)),pop.options.cache=cache,pop.options.type=type}},setDefaultOptions:function(options){defaults=$.extend({},defaults,options)}},_hideAll,_create,_isCreated,_show,_hide,_setDefaultOptions,_updateContent,_updateContentAsync;window.axPopups=AxPopups},"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof exports?module.exports=factory(require("jquery")):factory(window.jQuery)}(window,document),function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],factory):(global=global||self).axMenu=factory(global.jQuery)}(this,(function($){function _extends(){return(_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target}).apply(this,arguments)}var Util=function($){var TRANSITION_END="transitionend",Util={TRANSITION_END:"mmTransitionEnd",triggerTransitionEnd:function triggerTransitionEnd(element){$(element).trigger(TRANSITION_END)},supportsTransitionEnd:function supportsTransitionEnd(){return Boolean(TRANSITION_END)}};function getSpecialTransitionEndEvent(){return{bindType:TRANSITION_END,delegateType:TRANSITION_END,handle:function handle(event){if($(event.target).is(this))return event.handleObj.handler.apply(this,arguments)}}}function transitionEndEmulator(duration){var _this=this,called=!1;return $(this).one(Util.TRANSITION_END,(function(){called=!0})),setTimeout((function(){called||Util.triggerTransitionEnd(_this)}),duration),this}function setTransitionEndSupport(){$.fn.mmEmulateTransitionEnd=transitionEndEmulator,$.event.special[Util.TRANSITION_END]=getSpecialTransitionEndEvent()}return setTransitionEndSupport(),Util}($=$&&$.hasOwnProperty("default")?$.default:$),NAME="axMenu",DATA_KEY="axMenu",EVENT_KEY=".axMenu",DATA_API_KEY=".data-api",JQUERY_NO_CONFLICT=$.fn[NAME],TRANSITION_DURATION=350,Default={toggle:!0,cookie:!1,row:!1,width:"",dropWidth:"",gutter:"",trigger:"click",preventDefault:!0,triggerElement:"a",parentTrigger:"li",subMenu:"ul"},Event={SHOW:"show.axMenu",SHOWN:"shown.axMenu",HIDE:"hide.axMenu",HIDDEN:"hidden.axMenu",CLICK_DATA_API:"click.axMenu.data-api",CLICK_DATA_API_2:"mouseenter.axMenu.data-api",CLICK_DATA_API_3:"mouseleave.axMenu.data-api"},ClassName_AX="",ClassName_ACTIVE="ax-active",ClassName_SHOW="ax-show",ClassName_COLLAPSE="ax-collapse",ClassName_COLLAPSING="ax-collapsing",ClassName_COLLAPSED="ax-collapsed",ClassName_ROW="ax-menu-row",ClassName_HOVER="ax-menu-hover",AxMenu=function(){function AxMenu(element,config){this.element=element,this.config=_extends({},Default,{},config),this.transitioning=null,this.init()}var _proto=AxMenu.prototype;return _proto.init=function init(){var self=this,conf=this.config,el=$(this.element);if(el.addClass(ClassName_AX),1==conf.row&&el.addClass(ClassName_ROW),""!=conf.dropWidth&&el.children("li").children("ul").css("width",conf.dropWidth),""!=conf.width){el.children("li").css("width",conf.width);var offsetLeft=(el.children("li").width()-el.children("li").children("ul").width()-2)/2;el.children("li").children("ul").css("left",offsetLeft)}if(""!=conf.gutter&&el.children("li").css({"margin-left":conf.gutter,"margin-right":conf.gutter}),1==conf.cookie){var thisMenuid=el.attr("id");el.find("li").each((function(i){$(this).children("a:first-child").attr("aria-cookie",thisMenuid+i)}));var cookieId="menu-"+thisMenuid,cookieExpand="expand-"+thisMenuid;el.find("a").click((function(){var thismenu=$(this).attr("aria-cookie");$.cookie(cookieId,thismenu,{expires:365e3,path:"/"});var thisexpand=$(this).attr("aria-expanded");void 0===$(this).attr("aria-expanded")?$.cookie(cookieExpand,"false",{expires:365e3,path:"/"}):$.cookie(cookieExpand,thisexpand,{expires:365e3,path:"/"})}));var menuid=$("[aria-cookie="+$.cookie(cookieId)+"]");"true"==$.cookie(cookieExpand)?menuid.parent("li").removeClass(ClassName_ACTIVE):menuid.parent("li").addClass(ClassName_ACTIVE)}var thisActive=el.find(conf.parentTrigger+"."+ClassName_ACTIVE);$(thisActive).each((function(){$(this).children("ul").length>0?$(this).children(conf.triggerElement).attr("aria-expanded","true"):$(this).children(conf.triggerElement).attr("aria-expanded","childless")})),el.find(conf.parentTrigger+"."+ClassName_ACTIVE).parents(conf.parentTrigger).addClass(ClassName_ACTIVE),el.find(conf.parentTrigger+"."+ClassName_ACTIVE).parents(conf.parentTrigger).children(conf.triggerElement).attr("aria-expanded","true"),el.find(conf.parentTrigger+"."+ClassName_ACTIVE).has(conf.subMenu).children(conf.subMenu).addClass(ClassName_COLLAPSE+" "+ClassName_SHOW),el.find(conf.parentTrigger).not("."+ClassName_ACTIVE).has(conf.subMenu).children(conf.subMenu).addClass(ClassName_COLLAPSE),"hover"==conf.trigger?(el.find(conf.parentTrigger).on(Event.CLICK_DATA_API_3,(function(e){$(this).removeClass(ClassName_ACTIVE),$(this).children(conf.triggerElement).attr("aria-expanded","false"),$(this).children(conf.subMenu).removeClass(ClassName_SHOW)})),el.find(conf.parentTrigger).on(Event.CLICK_DATA_API_2,(function(e){var eTar=$(this).children(conf.triggerElement);if("true"!==eTar.attr("aria-disabled")){conf.preventDefault&&"#"===eTar.attr("href")&&e.preventDefault();var paRent=eTar.parent(conf.parentTrigger),sibLi=paRent.siblings(conf.parentTrigger),sibTrigger=sibLi.children(conf.triggerElement);paRent.hasClass(ClassName_ACTIVE)?(eTar.attr("aria-expanded","false"),self.removeActive(paRent)):(eTar.next("ul").length>0?eTar.attr("aria-expanded","true"):eTar.attr("aria-expanded","childless"),self.setActive(paRent),conf.toggle&&(self.removeActive(sibLi),sibTrigger.attr("aria-expanded","false"))),conf.onTransitionStart&&conf.onTransitionStart(e)}}))):el.find(conf.parentTrigger).children(conf.triggerElement).on(Event.CLICK_DATA_API,(function(e){var eTar=$(this);if("true"!==eTar.attr("aria-disabled")){conf.preventDefault&&"#"===eTar.attr("href")&&e.preventDefault();var paRent=eTar.parent(conf.parentTrigger),sibLi=paRent.siblings(conf.parentTrigger),sibTrigger=sibLi.children(conf.triggerElement);paRent.hasClass(ClassName_ACTIVE)?(eTar.attr("aria-expanded","false"),self.removeActive(paRent)):(eTar.next("ul").length>0?eTar.attr("aria-expanded","true"):eTar.attr("aria-expanded","childless"),self.setActive(paRent),conf.toggle&&(self.removeActive(sibLi),sibTrigger.attr("aria-expanded","false"))),conf.onTransitionStart&&conf.onTransitionStart(e)}}))},_proto.setActive=function setActive(li){$(li).addClass(ClassName_ACTIVE);var ul=$(li).children(this.config.subMenu);ul.length>0&&!ul.hasClass(ClassName_SHOW)&&this.show(ul)},_proto.removeActive=function removeActive(li){$(li).removeClass(ClassName_ACTIVE);var ul=$(li).children(this.config.subMenu+"."+ClassName_SHOW);ul.length>0&&this.hide(ul)},_proto.show=function show(element){var _this=this;if(!this.transitioning&&!$(element).hasClass(ClassName_COLLAPSING)){var elem=$(element),startEvent=$.Event(Event.SHOW);if(elem.trigger(startEvent),!startEvent.isDefaultPrevented()){if(elem.parent(this.config.parentTrigger).addClass(ClassName_ACTIVE),this.config.toggle){var toggleElem=elem.parent(this.config.parentTrigger).siblings().children(this.config.subMenu+"."+ClassName_SHOW);this.hide(toggleElem)}elem.removeClass(ClassName_COLLAPSE).addClass(ClassName_COLLAPSING).height(0),this.setTransitioning(!0);var complete=function complete(){_this.config&&_this.element&&(elem.removeClass(ClassName_COLLAPSING).addClass(ClassName_COLLAPSE+" "+ClassName_SHOW).height(""),_this.setTransitioning(!1),elem.trigger(Event.SHOWN))};elem.height(element[0].scrollHeight).one(Util.TRANSITION_END,complete).mmEmulateTransitionEnd(350)}}},_proto.hide=function hide(element){var _this2=this;if(!this.transitioning&&$(element).hasClass(ClassName_SHOW)){var elem=$(element),startEvent=$.Event(Event.HIDE);if(elem.trigger(startEvent),!startEvent.isDefaultPrevented()){elem.parent(this.config.parentTrigger).removeClass(ClassName_ACTIVE),elem.height(elem.height())[0].offsetHeight,elem.addClass(ClassName_COLLAPSING).removeClass(ClassName_COLLAPSE).removeClass(ClassName_SHOW),this.setTransitioning(!0);var complete=function complete(){_this2.config&&_this2.element&&(_this2.transitioning&&_this2.config.onTransitionEnd&&_this2.config.onTransitionEnd(),_this2.setTransitioning(!1),elem.trigger(Event.HIDDEN),elem.removeClass(ClassName_COLLAPSING).addClass(ClassName_COLLAPSE))};0===elem.height()||"none"===elem.css("display")?complete():elem.height(0).one(Util.TRANSITION_END,complete).mmEmulateTransitionEnd(350)}}},_proto.setTransitioning=function setTransitioning(isTransitioning){this.transitioning=isTransitioning},_proto.dispose=function dispose(){$.removeData(this.element,"axMenu"),$(this.element).find(this.config.parentTrigger).children(this.config.triggerElement).off(Event.CLICK_DATA_API),this.transitioning=null,this.config=null,this.element=null},AxMenu.jQueryInterface=function jQueryInterface(config){return this.each((function(){var $this=$(this),data=$this.data("axMenu"),conf=_extends({},Default,{},$this.data(),{},"object"==typeof config&&config?config:{});if(data||(data=new AxMenu(this,conf),$this.data("axMenu",data)),"string"==typeof config){if(void 0===data[config])throw new Error('No method named "'+config+'"');data[config]()}}))},AxMenu}();return $.fn[NAME]=AxMenu.jQueryInterface,$.fn[NAME].Constructor=AxMenu,$.fn[NAME].noConflict=function(){return $.fn[NAME]=JQUERY_NO_CONFLICT,AxMenu.jQueryInterface},AxMenu})),function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof module&&module.exports?module.exports=function(root,jQuery){return void 0===jQuery&&(jQuery="undefined"!=typeof window?require("jquery"):require("jquery")(root)),factory(jQuery),jQuery}:factory(jQuery)}((function(jQuery){var S2=function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var S2=jQuery.fn.select2.amd;var S2,factory;return function(){
/**
                 * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
                 * Released under MIT license, http://github.com/requirejs/almond/LICENSE
                 */
var requirejs,require,define;S2&&S2.requirejs||(S2?require=S2:S2={},function(undef){var main,req,makeMap,handlers,defined={},waiting={},config={},defining={},hasOwn=Object.prototype.hasOwnProperty,aps=[].slice,jsSuffixRegExp=/\.js$/;function hasProp(obj,prop){return hasOwn.call(obj,prop)}function normalize(name,baseName){var nameParts,nameSegment,mapValue,foundMap,lastIndex,foundI,foundStarMap,starI,i,j,part,normalizedBaseParts,baseParts=baseName&&baseName.split("/"),map=config.map,starMap=map&&map["*"]||{};if(name){for(lastIndex=(name=name.split("/")).length-1,config.nodeIdCompat&&jsSuffixRegExp.test(name[lastIndex])&&(name[lastIndex]=name[lastIndex].replace(jsSuffixRegExp,"")),"."===name[0].charAt(0)&&baseParts&&(name=(normalizedBaseParts=baseParts.slice(0,baseParts.length-1)).concat(name)),i=0;i<name.length;i++)if("."===(part=name[i]))name.splice(i,1),i-=1;else if(".."===part){if(0===i||1===i&&".."===name[2]||".."===name[i-1])continue;i>0&&(name.splice(i-1,2),i-=2)}name=name.join("/")}if((baseParts||starMap)&&map){for(i=(nameParts=name.split("/")).length;i>0;i-=1){if(nameSegment=nameParts.slice(0,i).join("/"),baseParts)for(j=baseParts.length;j>0;j-=1)if((mapValue=map[baseParts.slice(0,j).join("/")])&&(mapValue=mapValue[nameSegment])){foundMap=mapValue,foundI=i;break}if(foundMap)break;!foundStarMap&&starMap&&starMap[nameSegment]&&(foundStarMap=starMap[nameSegment],starI=i)}!foundMap&&foundStarMap&&(foundMap=foundStarMap,foundI=starI),foundMap&&(nameParts.splice(0,foundI,foundMap),name=nameParts.join("/"))}return name}function makeRequire(relName,forceSync){return function(){var args=aps.call(arguments,0);return"string"!=typeof args[0]&&1===args.length&&args.push(null),req.apply(undef,args.concat([relName,forceSync]))}}function makeNormalize(relName){return function(name){return normalize(name,relName)}}function makeLoad(depName){return function(value){defined[depName]=value}}function callDep(name){if(hasProp(waiting,name)){var args=waiting[name];delete waiting[name],defining[name]=!0,main.apply(undef,args)}if(!hasProp(defined,name)&&!hasProp(defining,name))throw new Error("No "+name);return defined[name]}function splitPrefix(name){var prefix,index=name?name.indexOf("!"):-1;return index>-1&&(prefix=name.substring(0,index),name=name.substring(index+1,name.length)),[prefix,name]}function makeRelParts(relName){return relName?splitPrefix(relName):[]}function makeConfig(name){return function(){return config&&config.config&&config.config[name]||{}}}makeMap=function(name,relParts){var plugin,parts=splitPrefix(name),prefix=parts[0],relResourceName=relParts[1];return name=parts[1],prefix&&(plugin=callDep(prefix=normalize(prefix,relResourceName))),prefix?name=plugin&&plugin.normalize?plugin.normalize(name,makeNormalize(relResourceName)):normalize(name,relResourceName):(prefix=(parts=splitPrefix(name=normalize(name,relResourceName)))[0],name=parts[1],prefix&&(plugin=callDep(prefix))),{f:prefix?prefix+"!"+name:name,n:name,pr:prefix,p:plugin}},handlers={require:function(name){return makeRequire(name)},exports:function(name){var e=defined[name];return void 0!==e?e:defined[name]={}},module:function(name){return{id:name,uri:"",exports:defined[name],config:makeConfig(name)}}},main=function(name,deps,callback,relName){var cjsModule,depName,ret,map,i,relParts,args=[],callbackType=typeof callback,usingExports;if(relParts=makeRelParts(relName=relName||name),"undefined"===callbackType||"function"===callbackType){for(deps=!deps.length&&callback.length?["require","exports","module"]:deps,i=0;i<deps.length;i+=1)if("require"===(depName=(map=makeMap(deps[i],relParts)).f))args[i]=handlers.require(name);else if("exports"===depName)args[i]=handlers.exports(name),usingExports=!0;else if("module"===depName)cjsModule=args[i]=handlers.module(name);else if(hasProp(defined,depName)||hasProp(waiting,depName)||hasProp(defining,depName))args[i]=callDep(depName);else{if(!map.p)throw new Error(name+" missing "+depName);map.p.load(map.n,makeRequire(relName,!0),makeLoad(depName),{}),args[i]=defined[depName]}ret=callback?callback.apply(defined[name],args):void 0,name&&(cjsModule&&cjsModule.exports!==undef&&cjsModule.exports!==defined[name]?defined[name]=cjsModule.exports:ret===undef&&usingExports||(defined[name]=ret))}else name&&(defined[name]=callback)},requirejs=require=req=function(deps,callback,relName,forceSync,alt){if("string"==typeof deps)return handlers[deps]?handlers[deps](callback):callDep(makeMap(deps,makeRelParts(callback)).f);if(!deps.splice){if((config=deps).deps&&req(config.deps,config.callback),!callback)return;callback.splice?(deps=callback,callback=relName,relName=null):deps=undef}return callback=callback||function(){},"function"==typeof relName&&(relName=forceSync,forceSync=alt),forceSync?main(undef,deps,callback,relName):setTimeout((function(){main(undef,deps,callback,relName)}),4),req},req.config=function(cfg){return req(cfg)},requirejs._defined=defined,(define=function(name,deps,callback){if("string"!=typeof name)throw new Error("See almond README: incorrect module build, no module name");deps.splice||(callback=deps,deps=[]),hasProp(defined,name)||hasProp(waiting,name)||(waiting[name]=[name,deps,callback])}).amd={jQuery:!0}}(),S2.requirejs=requirejs,S2.require=require,S2.define=define)}(),S2.define("almond",(function(){})),S2.define("jquery",[],(function(){var _$=jQuery||$;return null==_$&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),_$})),S2.define("select2/utils",["jquery"],(function($){var Utils={};function getMethods(theClass){var proto=theClass.prototype,methods=[];for(var methodName in proto){var m;"function"==typeof proto[methodName]&&("constructor"!==methodName&&methods.push(methodName))}return methods}Utils.Extend=function(ChildClass,SuperClass){var __hasProp={}.hasOwnProperty;function BaseConstructor(){this.constructor=ChildClass}for(var key in SuperClass)__hasProp.call(SuperClass,key)&&(ChildClass[key]=SuperClass[key]);return BaseConstructor.prototype=SuperClass.prototype,ChildClass.prototype=new BaseConstructor,ChildClass.__super__=SuperClass.prototype,ChildClass},Utils.Decorate=function(SuperClass,DecoratorClass){var decoratedMethods=getMethods(DecoratorClass),superMethods=getMethods(SuperClass);function DecoratedClass(){var unshift=Array.prototype.unshift,argCount=DecoratorClass.prototype.constructor.length,calledConstructor=SuperClass.prototype.constructor;argCount>0&&(unshift.call(arguments,SuperClass.prototype.constructor),calledConstructor=DecoratorClass.prototype.constructor),calledConstructor.apply(this,arguments)}function ctr(){this.constructor=DecoratedClass}DecoratorClass.displayName=SuperClass.displayName,DecoratedClass.prototype=new ctr;for(var m=0;m<superMethods.length;m++){var superMethod=superMethods[m];DecoratedClass.prototype[superMethod]=SuperClass.prototype[superMethod]}for(var calledMethod=function(methodName){var originalMethod=function(){};methodName in DecoratedClass.prototype&&(originalMethod=DecoratedClass.prototype[methodName]);var decoratedMethod=DecoratorClass.prototype[methodName];return function(){var unshift=Array.prototype.unshift;return unshift.call(arguments,originalMethod),decoratedMethod.apply(this,arguments)}},d=0;d<decoratedMethods.length;d++){var decoratedMethod=decoratedMethods[d];DecoratedClass.prototype[decoratedMethod]=calledMethod(decoratedMethod)}return DecoratedClass};var Observable=function(){this.listeners={}};Observable.prototype.on=function(event,callback){this.listeners=this.listeners||{},event in this.listeners?this.listeners[event].push(callback):this.listeners[event]=[callback]},Observable.prototype.trigger=function(event){var slice=Array.prototype.slice,params=slice.call(arguments,1);this.listeners=this.listeners||{},null==params&&(params=[]),0===params.length&&params.push({}),params[0]._type=event,event in this.listeners&&this.invoke(this.listeners[event],slice.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},Observable.prototype.invoke=function(listeners,params){for(var i=0,len=listeners.length;i<len;i++)listeners[i].apply(this,params)},Utils.Observable=Observable,Utils.generateChars=function(length){for(var chars="",i=0;i<length;i++){var randomChar;chars+=Math.floor(36*Math.random()).toString(36)}return chars},Utils.bind=function(func,context){return function(){func.apply(context,arguments)}},Utils._convertData=function(data){for(var originalKey in data){var keys=originalKey.split("-"),dataLevel=data;if(1!==keys.length){for(var k=0;k<keys.length;k++){var key=keys[k];(key=key.substring(0,1).toLowerCase()+key.substring(1))in dataLevel||(dataLevel[key]={}),k==keys.length-1&&(dataLevel[key]=data[originalKey]),dataLevel=dataLevel[key]}delete data[originalKey]}}return data},Utils.hasScroll=function(index,el){var $el=$(el),overflowX=el.style.overflowX,overflowY=el.style.overflowY;return(overflowX!==overflowY||"hidden"!==overflowY&&"visible"!==overflowY)&&("scroll"===overflowX||"scroll"===overflowY||($el.innerHeight()<el.scrollHeight||$el.innerWidth()<el.scrollWidth))},Utils.escapeMarkup=function(markup){var replaceMap={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof markup?markup:String(markup).replace(/[&<>"'\/\\]/g,(function(match){return replaceMap[match]}))},Utils.appendMany=function($element,$nodes){if("1.7"===$.fn.jquery.substr(0,3)){var $jqNodes=$();$.map($nodes,(function(node){$jqNodes=$jqNodes.add(node)})),$nodes=$jqNodes}$element.append($nodes)},Utils.__cache={};var id=0;return Utils.GetUniqueElementId=function(element){var select2Id=element.getAttribute("data-select-id");return null==select2Id&&(element.id?(select2Id=element.id,element.setAttribute("data-select-id",select2Id)):(element.setAttribute("data-select-id",++id),select2Id=id.toString())),select2Id},Utils.StoreData=function(element,name,value){var id=Utils.GetUniqueElementId(element);Utils.__cache[id]||(Utils.__cache[id]={}),Utils.__cache[id][name]=value},Utils.GetData=function(element,name){var id=Utils.GetUniqueElementId(element);return name?Utils.__cache[id]&&null!=Utils.__cache[id][name]?Utils.__cache[id][name]:$(element).data(name):Utils.__cache[id]},Utils.RemoveData=function(element){var id=Utils.GetUniqueElementId(element);null!=Utils.__cache[id]&&delete Utils.__cache[id],element.removeAttribute("data-select-id")},Utils})),S2.define("select2/results",["jquery","./utils"],(function($,Utils){function Results($element,options,dataAdapter){this.$element=$element,this.data=dataAdapter,this.options=options,Results.__super__.constructor.call(this)}return Utils.Extend(Results,Utils.Observable),Results.prototype.render=function(){var $results=$('<ul class="select2-results-options" role="listbox"></ul>');return this.options.get("multiple")&&$results.attr("aria-multiselectable","true"),this.$results=$results,$results},Results.prototype.clear=function(){this.$results.empty()},Results.prototype.displayMessage=function(params){var escapeMarkup=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var $message=$('<li role="alert" aria-live="assertive" class="select2-results-option"></li>'),message=this.options.get("translations").get(params.message);$message.append(escapeMarkup(message(params.args))),$message[0].className+=" select2-results-message",this.$results.append($message)},Results.prototype.hideMessages=function(){this.$results.find(".select2-results-message").remove()},Results.prototype.append=function(data){this.hideLoading();var $options=[];if(null!=data.results&&0!==data.results.length){data.results=this.sort(data.results);for(var d=0;d<data.results.length;d++){var item=data.results[d],$option=this.option(item);$options.push($option)}this.$results.append($options)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},Results.prototype.position=function($results,$dropdown){var $resultsContainer;$dropdown.find(".select2-results").append($results)},Results.prototype.sort=function(data){var sorter;return this.options.get("sorter")(data)},Results.prototype.highlightFirstItem=function(){var $options=this.$results.find(".select2-results-option[aria-selected]"),$selected=$options.filter("[aria-selected=true]");$selected.length>0?$selected.first().trigger("mouseenter"):$options.first().trigger("mouseenter"),this.ensureHighlightVisible()},Results.prototype.setClasses=function(){var self=this;this.data.current((function(selected){var selectedIds=$.map(selected,(function(s){return s.id.toString()})),$options;self.$results.find(".select2-results-option[aria-selected]").each((function(){var $option=$(this),item=Utils.GetData(this,"data"),id=""+item.id;null!=item.element&&item.element.selected||null==item.element&&$.inArray(id,selectedIds)>-1?$option.attr("aria-selected","true"):$option.attr("aria-selected","false")}))}))},Results.prototype.showLoading=function(params){this.hideLoading();var loadingMore,loading={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(params)},$loading=this.option(loading);$loading.className+=" loading-results",this.$results.prepend($loading)},Results.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},Results.prototype.option=function(data){var option=document.createElement("li");option.className="select2-results-option";var attrs={role:"option","aria-selected":"false"},matches=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(var attr in(null!=data.element&&matches.call(data.element,":disabled")||null==data.element&&data.disabled)&&(delete attrs["aria-selected"],attrs["aria-disabled"]="true"),null==data.id&&delete attrs["aria-selected"],null!=data._resultId&&(option.id=data._resultId),data.title&&(option.title=data.title),data.children&&(attrs.role="group",attrs["aria-label"]=data.text,delete attrs["aria-selected"]),attrs){var val=attrs[attr];option.setAttribute(attr,val)}if(data.children){var $option=$(option),label=document.createElement("strong");label.className="select2-results-group";var $label=$(label);this.template(data,label);for(var $children=[],c=0;c<data.children.length;c++){var child=data.children[c],$child=this.option(child);$children.push($child)}var $childrenContainer=$("<ul></ul>",{class:"select2-results-options select2-results-options-nested"});$childrenContainer.append($children),$(".select2-results-options").axScroll(),$option.append(label),$option.append($childrenContainer)}else this.template(data,option);return Utils.StoreData(option,"data",data),option},Results.prototype.bind=function(container,$container){var self=this,id=container.id+"-results";this.$results.attr("id",id),container.on("results:all",(function(params){self.clear(),self.append(params.data),container.isOpen()&&(self.setClasses(),self.highlightFirstItem())})),container.on("results:append",(function(params){self.append(params.data),container.isOpen()&&self.setClasses()})),container.on("query",(function(params){self.hideMessages(),self.showLoading(params)})),container.on("select",(function(){container.isOpen()&&(self.setClasses(),self.options.get("scrollAfterSelect")&&self.highlightFirstItem())})),container.on("unselect",(function(){container.isOpen()&&(self.setClasses(),self.options.get("scrollAfterSelect")&&self.highlightFirstItem())})),container.on("open",(function(){self.$results.attr("aria-expanded","true"),self.$results.attr("aria-hidden","false"),self.setClasses(),self.ensureHighlightVisible()})),container.on("close",(function(){self.$results.attr("aria-expanded","false"),self.$results.attr("aria-hidden","true"),self.$results.removeAttr("aria-activedescendant")})),container.on("results:toggle",(function(){var $highlighted=self.getHighlightedResults();0!==$highlighted.length&&$highlighted.trigger("mouseup")})),container.on("results:select",(function(){var $highlighted=self.getHighlightedResults();if(0!==$highlighted.length){var data=Utils.GetData($highlighted[0],"data");"true"==$highlighted.attr("aria-selected")?self.trigger("close",{}):self.trigger("select",{data:data})}})),container.on("results:previous",(function(){var $highlighted=self.getHighlightedResults(),$options=self.$results.find("[aria-selected]"),currentIndex=$options.index($highlighted);if(!(currentIndex<=0)){var nextIndex=currentIndex-1;0===$highlighted.length&&(nextIndex=0);var $next=$options.eq(nextIndex);$next.trigger("mouseenter");var currentOffset=self.$results.offset().top,nextTop=$next.offset().top,nextOffset=self.$results.scrollTop()+(nextTop-currentOffset);0===nextIndex?self.$results.scrollTop(0):nextTop-currentOffset<0&&self.$results.scrollTop(nextOffset)}})),container.on("results:next",(function(){var $highlighted=self.getHighlightedResults(),$options=self.$results.find("[aria-selected]"),currentIndex,nextIndex=$options.index($highlighted)+1;if(!(nextIndex>=$options.length)){var $next=$options.eq(nextIndex);$next.trigger("mouseenter");var currentOffset=self.$results.offset().top+self.$results.outerHeight(!1),nextBottom=$next.offset().top+$next.outerHeight(!1),nextOffset=self.$results.scrollTop()+nextBottom-currentOffset;0===nextIndex?self.$results.scrollTop(0):nextBottom>currentOffset&&self.$results.scrollTop(nextOffset)}})),container.on("results:focus",(function(params){params.element.addClass("select2-results-option-highlighted")})),container.on("results:message",(function(params){self.displayMessage(params)})),$.fn.mousewheel&&this.$results.on("mousewheel",(function(e){var top=self.$results.scrollTop(),bottom=self.$results.get(0).scrollHeight-top+e.deltaY,isAtTop=e.deltaY>0&&top-e.deltaY<=0,isAtBottom=e.deltaY<0&&bottom<=self.$results.height();isAtTop?(self.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):isAtBottom&&(self.$results.scrollTop(self.$results.get(0).scrollHeight-self.$results.height()),e.preventDefault(),e.stopPropagation())})),this.$results.on("mouseup",".select2-results-option[aria-selected]",(function(evt){var $this=$(this),data=Utils.GetData(this,"data");"true"!==$this.attr("aria-selected")?self.trigger("select",{originalEvent:evt,data:data}):self.options.get("multiple")?self.trigger("unselect",{originalEvent:evt,data:data}):self.trigger("close",{})})),this.$results.on("mouseenter",".select2-results-option[aria-selected]",(function(evt){var data=Utils.GetData(this,"data");self.getHighlightedResults().removeClass("select2-results-option-highlighted"),self.trigger("results:focus",{data:data,element:$(this)})}))},Results.prototype.getHighlightedResults=function(){var $highlighted;return this.$results.find(".select2-results-option-highlighted")},Results.prototype.destroy=function(){this.$results.remove()},Results.prototype.ensureHighlightVisible=function(){var $highlighted=this.getHighlightedResults();if(0!==$highlighted.length){var $options,currentIndex=this.$results.find("[aria-selected]").index($highlighted),currentOffset=this.$results.offset().top,nextTop=$highlighted.offset().top,nextOffset=this.$results.scrollTop()+(nextTop-currentOffset),offsetDelta=nextTop-currentOffset;nextOffset-=2*$highlighted.outerHeight(!1),currentIndex<=2?this.$results.scrollTop(0):(offsetDelta>this.$results.outerHeight()||offsetDelta<0)&&this.$results.scrollTop(nextOffset)}},Results.prototype.template=function(result,container){var template=this.options.get("templateResult"),escapeMarkup=this.options.get("escapeMarkup"),content=template(result,container);null==content?container.style.display="none":"string"==typeof content?container.innerHTML=escapeMarkup(content):$(container).append(content)},Results})),S2.define("select2/keys",[],(function(){var KEYS;return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}})),S2.define("select2/selection/base",["jquery","../utils","../keys"],(function($,Utils,KEYS){function BaseSelection($element,options){this.$element=$element,this.options=options,BaseSelection.__super__.constructor.call(this)}return Utils.Extend(BaseSelection,Utils.Observable),BaseSelection.prototype.render=function(){var $selection=$('<span class="select-text" role="combobox"  aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=Utils.GetData(this.$element[0],"old-tabindex")?this._tabindex=Utils.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),$selection.attr("title",this.$element.attr("title")),$selection.attr("tabindex",this._tabindex),$selection.attr("aria-disabled","false"),this.$selection=$selection,$selection},BaseSelection.prototype.bind=function(container,$container){var self=this,resultsId=container.id+"-results";this.container=container,this.$selection.on("focus",(function(evt){self.trigger("focus",evt)})),this.$selection.on("blur",(function(evt){self._handleBlur(evt)})),this.$selection.on("keydown",(function(evt){self.trigger("keypress",evt),evt.which===KEYS.SPACE&&evt.preventDefault()})),container.on("results:focus",(function(params){self.$selection.attr("aria-activedescendant",params.data._resultId)})),container.on("selection:update",(function(params){self.update(params.data)})),container.on("open",(function(){self.$selection.attr("aria-expanded","true"),self.$selection.attr("aria-owns",resultsId),self._attachCloseHandler(container)})),container.on("close",(function(){self.$selection.attr("aria-expanded","false"),self.$selection.removeAttr("aria-activedescendant"),self.$selection.removeAttr("aria-owns"),self.$selection.trigger("focus"),self._detachCloseHandler(container)})),container.on("enable",(function(){self.$selection.attr("tabindex",self._tabindex),self.$selection.attr("aria-disabled","false")})),container.on("disable",(function(){self.$selection.attr("tabindex","-1"),self.$selection.attr("aria-disabled","true")}))},BaseSelection.prototype._handleBlur=function(evt){var self=this;window.setTimeout((function(){document.activeElement==self.$selection[0]||$.contains(self.$selection[0],document.activeElement)||self.trigger("blur",evt)}),1)},BaseSelection.prototype._attachCloseHandler=function(container){$(document.body).on("mousedown.select2."+container.id,(function(e){var $target,$select=$(e.target).closest(".select2"),$all;$(".select2.select-box-open").each((function(){var $element;this!=$select[0]&&Utils.GetData(this,"element").select2("close")}))}))},BaseSelection.prototype._detachCloseHandler=function(container){$(document.body).off("mousedown.select2."+container.id)},BaseSelection.prototype.position=function($selection,$container){var $selectionContainer;$container.find(".selection").append($selection)},BaseSelection.prototype.destroy=function(){this._detachCloseHandler(this.container)},BaseSelection.prototype.update=function(data){throw new Error("The `update` method must be defined in child classes.")},BaseSelection.prototype.isEnabled=function(){return!this.isDisabled()},BaseSelection.prototype.isDisabled=function(){return this.options.get("disabled")},BaseSelection})),S2.define("select2/selection/single",["jquery","./base","../utils","../keys"],(function($,BaseSelection,Utils,KEYS){function SingleSelection(){SingleSelection.__super__.constructor.apply(this,arguments)}return Utils.Extend(SingleSelection,BaseSelection),SingleSelection.prototype.render=function(){var $selection=SingleSelection.__super__.render.call(this);return $selection.addClass("select-single"),$selection.html('<span class="select-rendered"></span><span class="select-arrow" role="arrow"><b role="arrow"></b></span>'),$selection},SingleSelection.prototype.bind=function(container,$container){var self=this;SingleSelection.__super__.bind.apply(this,arguments);var id=container.id+"-box";this.$selection.find(".select-rendered").attr("id",id).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",id),this.$selection.on("mousedown",(function(evt){1===evt.which&&self.trigger("toggle",{originalEvent:evt})})),this.$selection.on("focus",(function(evt){})),this.$selection.on("blur",(function(evt){})),container.on("focus",(function(evt){container.isOpen()||self.$selection.trigger("focus")}))},SingleSelection.prototype.clear=function(){var $rendered=this.$selection.find(".select-rendered");$rendered.empty(),$rendered.removeAttr("title")},SingleSelection.prototype.display=function(data,container){var template=this.options.get("templateSelection"),escapeMarkup;return this.options.get("escapeMarkup")(template(data,container))},SingleSelection.prototype.selectionContainer=function(){return $("<span></span>")},SingleSelection.prototype.update=function(data){if(0!==data.length){var selection=data[0],$rendered=this.$selection.find(".select-rendered"),formatted=this.display(selection,$rendered);$rendered.empty().append(formatted);var title=selection.title||selection.text;title?$rendered.attr("title",title):$rendered.removeAttr("title")}else this.clear()},SingleSelection})),S2.define("select2/selection/multiple",["jquery","./base","../utils"],(function($,BaseSelection,Utils){function MultipleSelection($element,options){MultipleSelection.__super__.constructor.apply(this,arguments)}return Utils.Extend(MultipleSelection,BaseSelection),MultipleSelection.prototype.render=function(){var $selection=MultipleSelection.__super__.render.call(this);return $selection.addClass("select-multiple"),$selection.html('<ul class="select-rendered"></ul>'),$selection},MultipleSelection.prototype.bind=function(container,$container){var self=this;MultipleSelection.__super__.bind.apply(this,arguments),this.$selection.on("click",(function(evt){self.trigger("toggle",{originalEvent:evt})})),this.$selection.on("click",".select-text-choice-remove",(function(evt){if(!self.isDisabled()){var $remove,$selection=$(this).parent(),data=Utils.GetData($selection[0],"data");self.trigger("unselect",{originalEvent:evt,data:data})}}))},MultipleSelection.prototype.clear=function(){var $rendered=this.$selection.find(".select-rendered");$rendered.empty(),$rendered.removeAttr("title")},MultipleSelection.prototype.display=function(data,container){var template=this.options.get("templateSelection"),escapeMarkup;return this.options.get("escapeMarkup")(template(data,container))},MultipleSelection.prototype.selectionContainer=function(){var $container;return $('<li class="select-text-choice"><span class="select-text-choice-remove" role="arrow">&times;</span></li>')},MultipleSelection.prototype.update=function(data){if(this.clear(),0!==data.length){for(var $selections=[],d=0;d<data.length;d++){var selection=data[d],$selection=this.selectionContainer(),formatted=this.display(selection,$selection);$selection.append(formatted);var title=selection.title||selection.text;title&&$selection.attr("title",title),Utils.StoreData($selection[0],"data",selection),$selections.push($selection)}var $rendered=this.$selection.find(".select-rendered");Utils.appendMany($rendered,$selections)}},MultipleSelection})),S2.define("select2/selection/placeholder",["../utils"],(function(Utils){function Placeholder(decorated,$element,options){this.placeholder=this.normalizePlaceholder(options.get("placeholder")),decorated.call(this,$element,options)}return Placeholder.prototype.normalizePlaceholder=function(_,placeholder){return"string"==typeof placeholder&&(placeholder={id:"",text:placeholder}),placeholder},Placeholder.prototype.createPlaceholder=function(decorated,placeholder){var $placeholder=this.selectionContainer();return $placeholder.html(this.display(placeholder)),$placeholder.addClass("select-text-placeholder").removeClass("select-text-choice"),$placeholder},Placeholder.prototype.update=function(decorated,data){var singlePlaceholder=1==data.length&&data[0].id!=this.placeholder.id,multipleSelections;if(data.length>1||singlePlaceholder)return decorated.call(this,data);this.clear();var $placeholder=this.createPlaceholder(this.placeholder);this.$selection.find(".select-rendered").append($placeholder)},Placeholder})),S2.define("select2/selection/allowClear",["jquery","../keys","../utils"],(function($,KEYS,Utils){function AllowClear(){}return AllowClear.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select-text-clear",(function(evt){self._handleClear(evt)})),container.on("keypress",(function(evt){self._handleKeyboardClear(evt,container)}))},AllowClear.prototype._handleClear=function(_,evt){if(!this.isDisabled()){var $clear=this.$selection.find(".select-text-clear");if(0!==$clear.length){evt.stopPropagation();var data=Utils.GetData($clear[0],"data"),previousVal=this.$element.val();this.$element.val(this.placeholder.id);var unselectData={data:data};if(this.trigger("clear",unselectData),unselectData.prevented)this.$element.val(previousVal);else{for(var d=0;d<data.length;d++)if(unselectData={data:data[d]},this.trigger("unselect",unselectData),unselectData.prevented)return void this.$element.val(previousVal);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},AllowClear.prototype._handleKeyboardClear=function(_,evt,container){container.isOpen()||evt.which!=KEYS.DELETE&&evt.which!=KEYS.BACKSPACE||this._handleClear(evt)},AllowClear.prototype.update=function(decorated,data){if(decorated.call(this,data),!(this.$selection.find(".select-text-placeholder").length>0||0===data.length)){var removeAll=this.options.get("translations").get("removeAllItems"),$remove=$('<span class="select-text-clear" title="'+removeAll()+'">&times;</span>');Utils.StoreData($remove[0],"data",data),this.$selection.find(".select-rendered").prepend($remove)}},AllowClear})),S2.define("select2/selection/search",["jquery","../utils","../keys"],(function($,Utils,KEYS){function Search(decorated,$element,options){decorated.call(this,$element,options)}return Search.prototype.render=function(decorated){var $search=$('<li class="select2-search select2-search-inline"><input class="select2-search-field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></li>');this.$searchContainer=$search,this.$search=$search.find("input");var $rendered=decorated.call(this);return this._transferTabIndex(),$rendered},Search.prototype.bind=function(decorated,container,$container){var self=this,resultsId=container.id+"-results";decorated.call(this,container,$container),container.on("open",(function(){self.$search.attr("aria-controls",resultsId),self.$search.trigger("focus")})),container.on("close",(function(){self.$search.val(""),self.$search.removeAttr("aria-controls"),self.$search.removeAttr("aria-activedescendant"),self.$search.trigger("focus")})),container.on("enable",(function(){self.$search.prop("disabled",!1),self._transferTabIndex()})),container.on("disable",(function(){self.$search.prop("disabled",!0)})),container.on("focus",(function(evt){self.$search.trigger("focus")})),container.on("results:focus",(function(params){params.data._resultId?self.$search.attr("aria-activedescendant",params.data._resultId):self.$search.removeAttr("aria-activedescendant")})),this.$selection.on("focusin",".select2-search-inline",(function(evt){self.trigger("focus",evt)})),this.$selection.on("focusout",".select2-search-inline",(function(evt){self._handleBlur(evt)})),this.$selection.on("keydown",".select2-search-inline",(function(evt){var key;if(evt.stopPropagation(),self.trigger("keypress",evt),self._keyUpPrevented=evt.isDefaultPrevented(),evt.which===KEYS.BACKSPACE&&""===self.$search.val()){var $previousChoice=self.$searchContainer.prev(".select-text-choice");if($previousChoice.length>0){var item=Utils.GetData($previousChoice[0],"data");self.searchRemoveChoice(item),evt.preventDefault()}}})),this.$selection.on("click",".select2-search-inline",(function(evt){self.$search.val()&&evt.stopPropagation()}));var msie=document.documentMode,disableInputEvents=msie&&msie<=11;this.$selection.on("input.searchcheck",".select2-search-inline",(function(evt){disableInputEvents?self.$selection.off("input.search input.searchcheck"):self.$selection.off("keyup.search")})),this.$selection.on("keyup.search input.search",".select2-search-inline",(function(evt){if(disableInputEvents&&"input"===evt.type)self.$selection.off("input.search input.searchcheck");else{var key=evt.which;key!=KEYS.SHIFT&&key!=KEYS.CTRL&&key!=KEYS.ALT&&key!=KEYS.TAB&&self.handleSearch(evt)}}))},Search.prototype._transferTabIndex=function(decorated){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},Search.prototype.createPlaceholder=function(decorated,placeholder){this.$search.attr("placeholder",placeholder.text)},Search.prototype.update=function(decorated,data){var searchHadFocus=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),decorated.call(this,data),this.$selection.find(".select-rendered").append(this.$searchContainer),this.resizeSearch(),searchHadFocus&&this.$search.trigger("focus")},Search.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var input=this.$search.val();this.trigger("query",{term:input})}this._keyUpPrevented=!1},Search.prototype.searchRemoveChoice=function(decorated,item){this.trigger("unselect",{data:item}),this.$search.val(item.text),this.handleSearch()},Search.prototype.resizeSearch=function(){this.$search.css("width","25px");var width="",minimumWidth;""!==this.$search.attr("placeholder")?width=this.$selection.find(".select-rendered").width():width="calc("+.75*(this.$search.val().length+1)+"em + 20px)";this.$search.css("width",width)},Search})),S2.define("select2/selection/eventRelay",["jquery"],(function($){function EventRelay(){}return EventRelay.prototype.bind=function(decorated,container,$container){var self=this,relayEvents=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],preventableEvents=["opening","closing","selecting","unselecting","clearing"];decorated.call(this,container,$container),container.on("*",(function(name,params){if(-1!==$.inArray(name,relayEvents)){params=params||{};var evt=$.Event("select2:"+name,{params:params});self.$element.trigger(evt),-1!==$.inArray(name,preventableEvents)&&(params.prevented=evt.isDefaultPrevented())}}))},EventRelay})),S2.define("select2/translation",["jquery","require"],(function($,require){function Translation(dict){this.dict=dict||{}}return Translation.prototype.all=function(){return this.dict},Translation.prototype.get=function(key){return this.dict[key]},Translation.prototype.extend=function(translation){this.dict=$.extend({},translation.all(),this.dict)},Translation._cache={},Translation.loadPath=function(path){if(!(path in Translation._cache)){var translations=require(path);Translation._cache[path]=translations}return new Translation(Translation._cache[path])},Translation})),S2.define("select2/diacritics",[],(function(){var diacritics;return{"Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","Ｃ":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"Dz","Ⓔ":"E","Ｅ":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","Ｇ":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","Ｈ":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","Ｉ":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","Ｋ":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","Ｌ":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","Ｎ":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","Ǌ":"NJ","ǋ":"Nj","Ⓞ":"O","Ｏ":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","Ｒ":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","Ｓ":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","Ｔ":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","Ｕ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","ｃ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","ｈ":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","ｓ":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}})),S2.define("select2/data/base",["../utils"],(function(Utils){function BaseAdapter($element,options){BaseAdapter.__super__.constructor.call(this)}return Utils.Extend(BaseAdapter,Utils.Observable),BaseAdapter.prototype.current=function(callback){throw new Error("The `current` method must be defined in child classes.")},BaseAdapter.prototype.query=function(params,callback){throw new Error("The `query` method must be defined in child classes.")},BaseAdapter.prototype.bind=function(container,$container){},BaseAdapter.prototype.destroy=function(){},BaseAdapter.prototype.generateResultId=function(container,data){var id=container.id+"-result-";return id+=Utils.generateChars(4),null!=data.id?id+="-"+data.id.toString():id+="-"+Utils.generateChars(4),id},BaseAdapter})),S2.define("select2/data/select",["./base","../utils","jquery"],(function(BaseAdapter,Utils,$){function SelectAdapter($element,options){this.$element=$element,this.options=options,SelectAdapter.__super__.constructor.call(this)}return Utils.Extend(SelectAdapter,BaseAdapter),SelectAdapter.prototype.current=function(callback){var data=[],self=this;this.$element.find(":selected").each((function(){var $option=$(this),option=self.item($option);data.push(option)})),callback(data)},SelectAdapter.prototype.select=function(data){var self=this;if(data.selected=!0,$(data.element).is("option"))return data.element.selected=!0,void this.$element.trigger("input").trigger("change");if(this.$element.prop("multiple"))this.current((function(currentData){var val=[];(data=[data]).push.apply(data,currentData);for(var d=0;d<data.length;d++){var id=data[d].id;-1===$.inArray(id,val)&&val.push(id)}self.$element.val(val),self.$element.trigger("input").trigger("change")}));else{var val=data.id;this.$element.val(val),this.$element.trigger("input").trigger("change")}},SelectAdapter.prototype.unselect=function(data){var self=this;if(this.$element.prop("multiple")){if(data.selected=!1,$(data.element).is("option"))return data.element.selected=!1,void this.$element.trigger("input").trigger("change");this.current((function(currentData){for(var val=[],d=0;d<currentData.length;d++){var id=currentData[d].id;id!==data.id&&-1===$.inArray(id,val)&&val.push(id)}self.$element.val(val),self.$element.trigger("input").trigger("change")}))}},SelectAdapter.prototype.bind=function(container,$container){var self=this;this.container=container,container.on("select",(function(params){self.select(params.data)})),container.on("unselect",(function(params){self.unselect(params.data)}))},SelectAdapter.prototype.destroy=function(){this.$element.find("*").each((function(){Utils.RemoveData(this)}))},SelectAdapter.prototype.query=function(params,callback){var data=[],self=this,$options;this.$element.children().each((function(){var $option=$(this);if($option.is("option")||$option.is("optgroup")){var option=self.item($option),matches=self.matches(params,option);null!==matches&&data.push(matches)}})),callback({results:data})},SelectAdapter.prototype.addOptions=function($options){Utils.appendMany(this.$element,$options)},SelectAdapter.prototype.option=function(data){var option;data.children?(option=document.createElement("optgroup")).label=data.text:void 0!==(option=document.createElement("option")).textContent?option.textContent=data.text:option.innerText=data.text,void 0!==data.id&&(option.value=data.id),data.disabled&&(option.disabled=!0),data.selected&&(option.selected=!0),data.title&&(option.title=data.title);var $option=$(option),normalizedData=this._normalizeItem(data);return normalizedData.element=option,Utils.StoreData(option,"data",normalizedData),$option},SelectAdapter.prototype.item=function($option){var data={};if(null!=(data=Utils.GetData($option[0],"data")))return data;if($option.is("option"))data={id:$option.val(),text:$option.text(),disabled:$option.prop("disabled"),selected:$option.prop("selected"),title:$option.prop("title")};else if($option.is("optgroup")){data={text:$option.prop("label"),children:[],title:$option.prop("title")};for(var $children=$option.children("option"),children=[],c=0;c<$children.length;c++){var $child=$($children[c]),child=this.item($child);children.push(child)}data.children=children}return(data=this._normalizeItem(data)).element=$option[0],Utils.StoreData($option[0],"data",data),data},SelectAdapter.prototype._normalizeItem=function(item){item!==Object(item)&&(item={id:item,text:item});var defaults={selected:!1,disabled:!1};return null!=(item=$.extend({},{text:""},item)).id&&(item.id=item.id.toString()),null!=item.text&&(item.text=item.text.toString()),null==item._resultId&&item.id&&null!=this.container&&(item._resultId=this.generateResultId(this.container,item)),$.extend({},defaults,item)},SelectAdapter.prototype.matches=function(params,data){var matcher;return this.options.get("matcher")(params,data)},SelectAdapter})),S2.define("select2/data/array",["./select","../utils","jquery"],(function(SelectAdapter,Utils,$){function ArrayAdapter($element,options){this._dataToConvert=options.get("data")||[],ArrayAdapter.__super__.constructor.call(this,$element,options)}return Utils.Extend(ArrayAdapter,SelectAdapter),ArrayAdapter.prototype.bind=function(container,$container){ArrayAdapter.__super__.bind.call(this,container,$container),this.addOptions(this.convertToOptions(this._dataToConvert))},ArrayAdapter.prototype.select=function(data){var $option=this.$element.find("option").filter((function(i,elm){return elm.value==data.id.toString()}));0===$option.length&&($option=this.option(data),this.addOptions($option)),ArrayAdapter.__super__.select.call(this,data)},ArrayAdapter.prototype.convertToOptions=function(data){var self=this,$existing=this.$element.find("option"),existingIds=$existing.map((function(){return self.item($(this)).id})).get(),$options=[];function onlyItem(item){return function(){return $(this).val()==item.id}}for(var d=0;d<data.length;d++){var item=this._normalizeItem(data[d]);if($.inArray(item.id,existingIds)>=0){var $existingOption=$existing.filter(onlyItem(item)),existingData=this.item($existingOption),newData=$.extend(!0,{},item,existingData),$newOption=this.option(newData);$existingOption.replaceWith($newOption)}else{var $option=this.option(item);if(item.children){var $children=this.convertToOptions(item.children);Utils.appendMany($option,$children)}$options.push($option)}}return $options},ArrayAdapter})),S2.define("select2/data/ajax",["./array","../utils","jquery"],(function(ArrayAdapter,Utils,$){function AjaxAdapter($element,options){this.ajaxOptions=this._applyDefaults(options.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),AjaxAdapter.__super__.constructor.call(this,$element,options)}return Utils.Extend(AjaxAdapter,ArrayAdapter),AjaxAdapter.prototype._applyDefaults=function(options){var defaults={data:function(params){return $.extend({},params,{q:params.term})},transport:function(params,success,failure){var $request=$.ajax(params);return $request.then(success),$request.fail(failure),$request}};return $.extend({},defaults,options,!0)},AjaxAdapter.prototype.processResults=function(results){return results},AjaxAdapter.prototype.query=function(params,callback){var matches=[],self=this;null!=this._request&&($.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var options=$.extend({type:"GET"},this.ajaxOptions);function request(){var $request=options.transport(options,(function(data){var results=self.processResults(data,params);self.options.get("debug")&&window.console&&console.error&&(results&&results.results&&$.isArray(results.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),callback(results)}),(function(){"status"in $request&&(0===$request.status||"0"===$request.status)||self.trigger("results:message",{message:"errorLoading"})}));self._request=$request}"function"==typeof options.url&&(options.url=options.url.call(this.$element,params)),"function"==typeof options.data&&(options.data=options.data.call(this.$element,params)),this.ajaxOptions.delay&&null!=params.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(request,this.ajaxOptions.delay)):request()},AjaxAdapter})),S2.define("select2/data/tags",["jquery"],(function($){function Tags(decorated,$element,options){var tags=options.get("tags"),createTag=options.get("createTag");void 0!==createTag&&(this.createTag=createTag);var insertTag=options.get("insertTag");if(void 0!==insertTag&&(this.insertTag=insertTag),decorated.call(this,$element,options),$.isArray(tags))for(var t=0;t<tags.length;t++){var tag=tags[t],item=this._normalizeItem(tag),$option=this.option(item);this.$element.append($option)}}return Tags.prototype.query=function(decorated,params,callback){var self=this;function wrapper(obj,child){for(var data=obj.results,i=0;i<data.length;i++){var option=data[i],checkChildren=null!=option.children&&!wrapper({results:option.children},!0),optionText,paramsTerm,checkText;if((option.text||"").toUpperCase()===(params.term||"").toUpperCase()||checkChildren)return!child&&(obj.data=data,void callback(obj))}if(child)return!0;var tag=self.createTag(params);if(null!=tag){var $option=self.option(tag);$option.attr("data-select-tag",!0),self.addOptions([$option]),self.insertTag(data,tag)}obj.results=data,callback(obj)}this._removeOldTags(),null!=params.term&&null==params.page?decorated.call(this,params,wrapper):decorated.call(this,params,callback)},Tags.prototype.createTag=function(decorated,params){var term=$.trim(params.term);return""===term?null:{id:term,text:term}},Tags.prototype.insertTag=function(_,data,tag){data.unshift(tag)},Tags.prototype._removeOldTags=function(_){var $options;this.$element.find("option[data-select-tag]").each((function(){this.selected||$(this).remove()}))},Tags})),S2.define("select2/data/tokenizer",["jquery"],(function($){function Tokenizer(decorated,$element,options){var tokenizer=options.get("tokenizer");void 0!==tokenizer&&(this.tokenizer=tokenizer),decorated.call(this,$element,options)}return Tokenizer.prototype.bind=function(decorated,container,$container){decorated.call(this,container,$container),this.$search=container.dropdown.$search||container.selection.$search||$container.find(".select2-search-field")},Tokenizer.prototype.query=function(decorated,params,callback){var self=this;function createAndSelect(data){var item=self._normalizeItem(data),$existingOptions;if(!self.$element.find("option").filter((function(){return $(this).val()===item.id})).length){var $option=self.option(item);$option.attr("data-select-tag",!0),self._removeOldTags(),self.addOptions([$option])}select(item)}function select(data){self.trigger("select",{data:data})}params.term=params.term||"";var tokenData=this.tokenizer(params,this.options,createAndSelect);tokenData.term!==params.term&&(this.$search.length&&(this.$search.val(tokenData.term),this.$search.trigger("focus")),params.term=tokenData.term),decorated.call(this,params,callback)},Tokenizer.prototype.tokenizer=function(_,params,options,callback){for(var separators=options.get("tokenSeparators")||[],term=params.term,i=0,createTag=this.createTag||function(params){return{id:params.term,text:params.term}};i<term.length;){var termChar=term[i];if(-1!==$.inArray(termChar,separators)){var part=term.substr(0,i),partParams,data=createTag($.extend({},params,{term:part}));null!=data?(callback(data),term=term.substr(i+1)||"",i=0):i++}else i++}return{term:term}},Tokenizer})),S2.define("select2/data/minimumInputLength",[],(function(){function MinimumInputLength(decorated,$e,options){this.minimumInputLength=options.get("minimumInputLength"),decorated.call(this,$e,options)}return MinimumInputLength.prototype.query=function(decorated,params,callback){params.term=params.term||"",params.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:params.term,params:params}}):decorated.call(this,params,callback)},MinimumInputLength})),S2.define("select2/data/maximumInputLength",[],(function(){function MaximumInputLength(decorated,$e,options){this.maximumInputLength=options.get("maximumInputLength"),decorated.call(this,$e,options)}return MaximumInputLength.prototype.query=function(decorated,params,callback){params.term=params.term||"",this.maximumInputLength>0&&params.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:params.term,params:params}}):decorated.call(this,params,callback)},MaximumInputLength})),S2.define("select2/data/maximumSelectionLength",[],(function(){function MaximumSelectionLength(decorated,$e,options){this.maximumSelectionLength=options.get("maximumSelectionLength"),decorated.call(this,$e,options)}return MaximumSelectionLength.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("select",(function(){self._checkIfMaximumSelected()}))},MaximumSelectionLength.prototype.query=function(decorated,params,callback){var self=this;this._checkIfMaximumSelected((function(){decorated.call(self,params,callback)}))},MaximumSelectionLength.prototype._checkIfMaximumSelected=function(_,successCallback){var self=this;this.current((function(currentData){var count=null!=currentData?currentData.length:0;self.maximumSelectionLength>0&&count>=self.maximumSelectionLength?self.trigger("results:message",{message:"maximumSelected",args:{maximum:self.maximumSelectionLength}}):successCallback&&successCallback()}))},MaximumSelectionLength})),S2.define("select2/dropdown",["jquery","./utils"],(function($,Utils){function Dropdown($element,options){this.$element=$element,this.options=options,Dropdown.__super__.constructor.call(this)}return Utils.Extend(Dropdown,Utils.Observable),Dropdown.prototype.render=function(){var $dropdown=$('<span class="select2-dropdown"><span class="select2-results"></span></span>');return $dropdown.attr("dir",this.options.get("dir")),this.$dropdown=$dropdown,$dropdown},Dropdown.prototype.bind=function(){},Dropdown.prototype.position=function($dropdown,$container){},Dropdown.prototype.destroy=function(){this.$dropdown.remove()},Dropdown})),S2.define("select2/dropdown/search",["jquery","../utils"],(function($,Utils){function Search(){}return Search.prototype.render=function(decorated){var $rendered=decorated.call(this),$search=$('<span class="select2-search select2-search-dropdown"><input class="select2-search-field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" placeholder="输入关键字..."/></span>');return this.$searchContainer=$search,this.$search=$search.find("input"),$rendered.prepend($search),$rendered},Search.prototype.bind=function(decorated,container,$container){var self=this,resultsId=container.id+"-results";decorated.call(this,container,$container),this.$search.on("keydown",(function(evt){self.trigger("keypress",evt),self._keyUpPrevented=evt.isDefaultPrevented()})),this.$search.on("input",(function(evt){$(this).off("keyup")})),this.$search.on("keyup input",(function(evt){self.handleSearch(evt)})),container.on("open",(function(){self.$search.attr("tabindex",0),self.$search.attr("aria-controls",resultsId),self.$search.trigger("focus"),window.setTimeout((function(){self.$search.trigger("focus")}),0)})),container.on("close",(function(){self.$search.attr("tabindex",-1),self.$search.removeAttr("aria-controls"),self.$search.removeAttr("aria-activedescendant"),self.$search.val(""),self.$search.trigger("blur")})),container.on("focus",(function(){container.isOpen()||self.$search.trigger("focus")})),container.on("results:all",(function(params){var showSearch;null!=params.query.term&&""!==params.query.term||(self.showSearch(params)?self.$searchContainer.removeClass("select2-search-hide"):self.$searchContainer.addClass("select2-search-hide"))})),container.on("results:focus",(function(params){params.data._resultId?self.$search.attr("aria-activedescendant",params.data._resultId):self.$search.removeAttr("aria-activedescendant")}))},Search.prototype.handleSearch=function(evt){if(!this._keyUpPrevented){var input=this.$search.val();this.trigger("query",{term:input})}this._keyUpPrevented=!1},Search.prototype.showSearch=function(_,params){return!0},Search})),S2.define("select2/dropdown/hidePlaceholder",[],(function(){function HidePlaceholder(decorated,$element,options,dataAdapter){this.placeholder=this.normalizePlaceholder(options.get("placeholder")),decorated.call(this,$element,options,dataAdapter)}return HidePlaceholder.prototype.append=function(decorated,data){data.results=this.removePlaceholder(data.results),decorated.call(this,data)},HidePlaceholder.prototype.normalizePlaceholder=function(_,placeholder){return"string"==typeof placeholder&&(placeholder={id:"",text:placeholder}),placeholder},HidePlaceholder.prototype.removePlaceholder=function(_,data){for(var modifiedData=data.slice(0),d=data.length-1;d>=0;d--){var item=data[d];this.placeholder.id===item.id&&modifiedData.splice(d,1)}return modifiedData},HidePlaceholder})),S2.define("select2/dropdown/infiniteScroll",["jquery"],(function($){function InfiniteScroll(decorated,$element,options,dataAdapter){this.lastParams={},decorated.call(this,$element,options,dataAdapter),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return InfiniteScroll.prototype.append=function(decorated,data){this.$loadingMore.remove(),this.loading=!1,decorated.call(this,data),this.showLoadingMore(data)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},InfiniteScroll.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("query",(function(params){self.lastParams=params,self.loading=!0})),container.on("query:append",(function(params){self.lastParams=params,self.loading=!0})),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},InfiniteScroll.prototype.loadMoreIfNeeded=function(){var isLoadMoreVisible=$.contains(document.documentElement,this.$loadingMore[0]),currentOffset,loadingMoreOffset;!this.loading&&isLoadMoreVisible&&(this.$results.offset().top+this.$results.outerHeight(!1)+50>=this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)&&this.loadMore())},InfiniteScroll.prototype.loadMore=function(){this.loading=!0;var params=$.extend({},{page:1},this.lastParams);params.page++,this.trigger("query:append",params)},InfiniteScroll.prototype.showLoadingMore=function(_,data){return data.pagination&&data.pagination.more},InfiniteScroll.prototype.createLoadingMore=function(){var $option=$('<li class="select2-results-option select2-results-option-load-more"role="option" aria-disabled="true"></li>'),message=this.options.get("translations").get("loadingMore");return $option.html(message(this.lastParams)),$option},InfiniteScroll})),S2.define("select2/dropdown/attachBody",["jquery","../utils"],(function($,Utils){function AttachBody(decorated,$element,options){this.$dropdownParent=$(options.get("dropdownParent")||document.body),decorated.call(this,$element,options)}return AttachBody.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("open",(function(){self._showDropdown(),self._attachPositioningHandler(container),self._bindContainerResultHandlers(container)})),container.on("close",(function(){self._hideDropdown(),self._detachPositioningHandler(container)})),this.$dropdownContainer.on("mousedown",(function(evt){evt.stopPropagation()}))},AttachBody.prototype.destroy=function(decorated){decorated.call(this),this.$dropdownContainer.remove()},AttachBody.prototype.position=function(decorated,$dropdown,$container){$dropdown.attr("class",$container.attr("class")),$dropdown.removeClass("select2"),$dropdown.addClass("select-box-open"),$dropdown.css({position:"absolute",top:-999999}),this.$container=$container},AttachBody.prototype.render=function(decorated){var $container=$("<span></span>"),$dropdown=decorated.call(this);return $container.append($dropdown),this.$dropdownContainer=$container,$container},AttachBody.prototype._hideDropdown=function(decorated){this.$dropdownContainer.detach()},AttachBody.prototype._bindContainerResultHandlers=function(decorated,container){if(!this._containerResultsHandlersBound){var self=this;container.on("results:all",(function(){self._positionDropdown(),self._resizeDropdown()})),container.on("results:append",(function(){self._positionDropdown(),self._resizeDropdown()})),container.on("results:message",(function(){self._positionDropdown(),self._resizeDropdown()})),container.on("select",(function(){self._positionDropdown(),self._resizeDropdown()})),container.on("unselect",(function(){self._positionDropdown(),self._resizeDropdown()})),this._containerResultsHandlersBound=!0}},AttachBody.prototype._attachPositioningHandler=function(decorated,container){var self=this,scrollEvent="scroll.select2."+container.id,resizeEvent="resize.select2."+container.id,orientationEvent="orientationchange.select2."+container.id,$watchers=this.$container.parents().filter(Utils.hasScroll);$watchers.each((function(){Utils.StoreData(this,"select2-scroll-position",{x:$(this).scrollLeft(),y:$(this).scrollTop()})})),$watchers.on(scrollEvent,(function(ev){var position=Utils.GetData(this,"select2-scroll-position");$(this).scrollTop(position.y)})),$(window).on(scrollEvent+" "+resizeEvent+" "+orientationEvent,(function(e){self._positionDropdown(),self._resizeDropdown()}))},AttachBody.prototype._detachPositioningHandler=function(decorated,container){var scrollEvent="scroll.select2."+container.id,resizeEvent="resize.select2."+container.id,orientationEvent="orientationchange.select2."+container.id,$watchers;this.$container.parents().filter(Utils.hasScroll).off(scrollEvent),$(window).off(scrollEvent+" "+resizeEvent+" "+orientationEvent)},AttachBody.prototype._positionDropdown=function(){var $window=$(window),isCurrentlyAbove=this.$dropdown.hasClass("select2-dropdown-above"),isCurrentlyBelow=this.$dropdown.hasClass("select2-dropdown-below"),newDirection=null,offset=this.$container.offset();offset.bottom=offset.top+this.$container.outerHeight(!1);var container={height:this.$container.outerHeight(!1)};container.top=offset.top,container.bottom=offset.top+container.height;var dropdown_height=this.$dropdown.outerHeight(!1),viewport_top=$window.scrollTop(),viewport_bottom=$window.scrollTop()+$window.height(),enoughRoomAbove=viewport_top<offset.top-dropdown_height,enoughRoomBelow=viewport_bottom>offset.bottom+dropdown_height,css={left:offset.left,top:container.bottom},$offsetParent=this.$dropdownParent;"static"===$offsetParent.css("position")&&($offsetParent=$offsetParent.offsetParent());var parentOffset={top:0,left:0};($.contains(document.body,$offsetParent[0])||$offsetParent[0].isConnected)&&(parentOffset=$offsetParent.offset()),css.top-=parentOffset.top,css.left-=parentOffset.left,isCurrentlyAbove||isCurrentlyBelow||(newDirection="below"),enoughRoomBelow||!enoughRoomAbove||isCurrentlyAbove?!enoughRoomAbove&&enoughRoomBelow&&isCurrentlyAbove&&(newDirection="below"):newDirection="above",("above"==newDirection||isCurrentlyAbove&&"below"!==newDirection)&&(css.top=container.top-parentOffset.top-dropdown_height),null!=newDirection&&(this.$dropdown.removeClass("select2-dropdown-below select2-dropdown-above").addClass("select2-dropdown-"+newDirection),this.$container.removeClass("select-box-below select-box-above").addClass("select-box-"+newDirection)),this.$dropdownContainer.css(css)},AttachBody.prototype._resizeDropdown=function(){var css={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(css.minWidth=css.width,css.position="relative",css.width="auto"),this.$dropdown.css(css)},AttachBody.prototype._showDropdown=function(decorated){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},AttachBody})),S2.define("select2/dropdown/minimumResultsForSearch",[],(function(){function countResults(data){for(var count=0,d=0;d<data.length;d++){var item=data[d];item.children?count+=countResults(item.children):count++}return count}function MinimumResultsForSearch(decorated,$element,options,dataAdapter){this.minimumResultsForSearch=options.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),decorated.call(this,$element,options,dataAdapter)}return MinimumResultsForSearch.prototype.showSearch=function(decorated,params){return!(countResults(params.data.results)<this.minimumResultsForSearch)&&decorated.call(this,params)},MinimumResultsForSearch})),S2.define("select2/dropdown/selectOnClose",["../utils"],(function(Utils){function SelectOnClose(){}return SelectOnClose.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("close",(function(params){self._handleSelectOnClose(params)}))},SelectOnClose.prototype._handleSelectOnClose=function(_,params){if(params&&null!=params.originalSelect2Event){var event=params.originalSelect2Event;if("select"===event._type||"unselect"===event._type)return}var $highlightedResults=this.getHighlightedResults();if(!($highlightedResults.length<1)){var data=Utils.GetData($highlightedResults[0],"data");null!=data.element&&data.element.selected||null==data.element&&data.selected||this.trigger("select",{data:data})}},SelectOnClose})),S2.define("select2/dropdown/closeOnSelect",[],(function(){function CloseOnSelect(){}return CloseOnSelect.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("select",(function(evt){self._selectTriggered(evt)})),container.on("unselect",(function(evt){self._selectTriggered(evt)}))},CloseOnSelect.prototype._selectTriggered=function(_,evt){var originalEvent=evt.originalEvent;originalEvent&&(originalEvent.ctrlKey||originalEvent.metaKey)||this.trigger("close",{originalEvent:originalEvent,originalSelect2Event:evt})},CloseOnSelect})),S2.define("select2/i18n/en",[],(function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(args){var overChars=args.input.length-args.maximum,message="请删除"+overChars+"个字符。";return 1!=overChars&&(message+="s"),message},inputTooShort:function(args){var remainingChars,message;return"请输入"+(args.minimum-args.input.length)+"个或更多字符。"},loadingMore:function(){return"加载中..."},maximumSelected:function(args){var message="最多只能选择"+args.maximum+"个项目。";return 1!=args.maximum&&(message+="s"),message},noResults:function(){return"未找到结果。"},searching:function(){return"搜索中..."},removeAllItems:function(){return"清除全部。"}}})),S2.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],(function($,require,ResultsList,SingleSelection,MultipleSelection,Placeholder,AllowClear,SelectionSearch,EventRelay,Utils,Translation,DIACRITICS,SelectData,ArrayData,AjaxData,Tags,Tokenizer,MinimumInputLength,MaximumInputLength,MaximumSelectionLength,Dropdown,DropdownSearch,HidePlaceholder,InfiniteScroll,AttachBody,MinimumResultsForSearch,SelectOnClose,CloseOnSelect,EnglishTranslation){function Defaults(){this.reset()}var defaults;return Defaults.prototype.apply=function(options){if(null==(options=$.extend(!0,{},this.defaults,options)).dataAdapter){if(null!=options.ajax?options.dataAdapter=AjaxData:null!=options.data?options.dataAdapter=ArrayData:options.dataAdapter=SelectData,options.minimumInputLength>0&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,MinimumInputLength)),options.maximumInputLength>0&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,MaximumInputLength)),options.maximumSelectionLength>0&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,MaximumSelectionLength)),options.tags&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,Tags)),null==options.tokenSeparators&&null==options.tokenizer||(options.dataAdapter=Utils.Decorate(options.dataAdapter,Tokenizer)),null!=options.query){var Query=require(options.amdBase+"compat/query");options.dataAdapter=Utils.Decorate(options.dataAdapter,Query)}if(null!=options.initSelection){var InitSelection=require(options.amdBase+"compat/initSelection");options.dataAdapter=Utils.Decorate(options.dataAdapter,InitSelection)}}if(null==options.resultsAdapter&&(options.resultsAdapter=ResultsList,null!=options.ajax&&(options.resultsAdapter=Utils.Decorate(options.resultsAdapter,InfiniteScroll)),null!=options.placeholder&&(options.resultsAdapter=Utils.Decorate(options.resultsAdapter,HidePlaceholder)),options.selectOnClose&&(options.resultsAdapter=Utils.Decorate(options.resultsAdapter,SelectOnClose))),null==options.dropdownAdapter){if(options.multiple)options.dropdownAdapter=Dropdown;else{var SearchableDropdown=Utils.Decorate(Dropdown,DropdownSearch);options.dropdownAdapter=SearchableDropdown}if(0!==options.minimumResultsForSearch&&(options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,MinimumResultsForSearch)),options.closeOnSelect&&(options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,CloseOnSelect)),null!=options.dropdownCssClass||null!=options.dropdownCss||null!=options.adaptDropdownCssClass){var DropdownCSS=require(options.amdBase+"compat/dropdownCss");options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,DropdownCSS)}options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,AttachBody)}if(null==options.selectionAdapter){if(options.multiple?options.selectionAdapter=MultipleSelection:options.selectionAdapter=SingleSelection,null!=options.placeholder&&(options.selectionAdapter=Utils.Decorate(options.selectionAdapter,Placeholder)),options.allowClear&&(options.selectionAdapter=Utils.Decorate(options.selectionAdapter,AllowClear)),options.multiple&&(options.selectionAdapter=Utils.Decorate(options.selectionAdapter,SelectionSearch)),null!=options.containerCssClass||null!=options.containerCss||null!=options.adaptContainerCssClass){var ContainerCSS=require(options.amdBase+"compat/containerCss");options.selectionAdapter=Utils.Decorate(options.selectionAdapter,ContainerCSS)}options.selectionAdapter=Utils.Decorate(options.selectionAdapter,EventRelay)}options.language=this._resolveLanguage(options.language),options.language.push("en");for(var uniqueLanguages=[],l=0;l<options.language.length;l++){var language=options.language[l];-1===uniqueLanguages.indexOf(language)&&uniqueLanguages.push(language)}return options.language=uniqueLanguages,options.translations=this._processTranslations(options.language,options.debug),options},Defaults.prototype.reset=function(){function stripDiacritics(text){function match(a){return DIACRITICS[a]||a}return text.replace(/[^\u0000-\u007E]/g,match)}function matcher(params,data){if(""===$.trim(params.term))return data;if(data.children&&data.children.length>0){for(var match=$.extend(!0,{},data),c=data.children.length-1;c>=0;c--){var child,matches;null==matcher(params,data.children[c])&&match.children.splice(c,1)}return match.children.length>0?match:matcher(params,match)}var original=stripDiacritics(data.text).toUpperCase(),term=stripDiacritics(params.term).toUpperCase();return original.indexOf(term)>-1?data:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:Utils.escapeMarkup,language:"zh-CN",matcher:matcher,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:-1,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(data){return data},templateResult:function(result){return result.text},templateSelection:function(selection){return selection.text},theme:"ax",width:"resolve"}},Defaults.prototype.applyFromElement=function(options,$element){var optionLanguage=options.language,defaultLanguage=this.defaults.language,elementLanguage=$element.prop("lang"),parentLanguage=$element.closest("[lang]").prop("lang"),languages=Array.prototype.concat.call(this._resolveLanguage(elementLanguage),this._resolveLanguage(optionLanguage),this._resolveLanguage(defaultLanguage),this._resolveLanguage(parentLanguage));return options.language=languages,options},Defaults.prototype._resolveLanguage=function(language){if(!language)return[];if($.isEmptyObject(language))return[];if($.isPlainObject(language))return[language];var languages;languages=$.isArray(language)?language:[language];for(var resolvedLanguages=[],l=0;l<languages.length;l++)if(resolvedLanguages.push(languages[l]),"string"==typeof languages[l]&&languages[l].indexOf("-")>0){var languageParts,baseLanguage=languages[l].split("-")[0];resolvedLanguages.push(baseLanguage)}return resolvedLanguages},Defaults.prototype._processTranslations=function(languages,debug){for(var translations=new Translation,l=0;l<languages.length;l++){var languageData=new Translation,language=languages[l];if("string"==typeof language)try{languageData=Translation.loadPath(language)}catch(e){try{language=this.defaults.amdLanguageBase+language,languageData=Translation.loadPath(language)}catch(ex){debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+language+'" could not be automatically loaded. A fallback will be used instead.')}}else languageData=$.isPlainObject(language)?new Translation(language):language;translations.extend(languageData)}return translations},Defaults.prototype.set=function(key,value){var camelKey,data={};data[$.camelCase(key)]=value;var convertedData=Utils._convertData(data);$.extend(!0,this.defaults,convertedData)},new Defaults})),S2.define("select2/options",["require","jquery","./defaults","./utils"],(function(require,$,Defaults,Utils){function Options(options,$element){if(this.options=options,null!=$element&&this.fromElement($element),null!=$element&&(this.options=Defaults.applyFromElement(this.options,$element)),this.options=Defaults.apply(this.options),$element&&$element.is("input")){var InputCompat=require(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=Utils.Decorate(this.options.dataAdapter,InputCompat)}}return Options.prototype.fromElement=function($e){var excludedData=["select2"];null==this.options.multiple&&(this.options.multiple=$e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=$e.prop("disabled")),null==this.options.dir&&($e.prop("dir")?this.options.dir=$e.prop("dir"):$e.closest("[dir]").prop("dir")?this.options.dir=$e.closest("[dir]").prop("dir"):this.options.dir="ltr"),$e.prop("disabled",this.options.disabled),$e.prop("multiple",this.options.multiple),Utils.GetData($e[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),Utils.StoreData($e[0],"data",Utils.GetData($e[0],"select2Tags")),Utils.StoreData($e[0],"tags",!0)),Utils.GetData($e[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax-url` and support for the old attribute will be removed in future versions of Select2."),$e.attr("ajax-url",Utils.GetData($e[0],"ajaxUrl")),Utils.StoreData($e[0],"ajax-Url",Utils.GetData($e[0],"ajaxUrl")));var dataset={};function upperCaseLetter(_,letter){return letter.toUpperCase()}for(var attr=0;attr<$e[0].attributes.length;attr++){var attributeName=$e[0].attributes[attr].name,prefix="data-";if(attributeName.substr(0,prefix.length)==prefix){var dataName=attributeName.substring(prefix.length),dataValue=Utils.GetData($e[0],dataName),camelDataName;dataset[dataName.replace(/-([a-z])/g,upperCaseLetter)]=dataValue}}$.fn.jquery&&"1."==$.fn.jquery.substr(0,2)&&$e[0].dataset&&(dataset=$.extend(!0,{},$e[0].dataset,dataset));var data=$.extend(!0,{},Utils.GetData($e[0]),dataset);for(var key in data=Utils._convertData(data))$.inArray(key,excludedData)>-1||($.isPlainObject(this.options[key])?$.extend(this.options[key],data[key]):this.options[key]=data[key]);return this},Options.prototype.get=function(key){return this.options[key]},Options.prototype.set=function(key,val){this.options[key]=val},Options})),S2.define("select2/core",["jquery","./options","./utils","./keys"],(function($,Options,Utils,KEYS){var Select2=function($element,options){null!=Utils.GetData($element[0],"select2")&&Utils.GetData($element[0],"select2").destroy(),this.$element=$element,this.id=this._generateId($element),options=options||{},this.options=new Options(options,$element),Select2.__super__.constructor.call(this);var tabindex=$element.attr("tabindex")||0;Utils.StoreData($element[0],"old-tabindex",tabindex),$element.attr("tabindex","-1");var DataAdapter=this.options.get("dataAdapter");this.dataAdapter=new DataAdapter($element,this.options);var $container=this.render();this._placeContainer($container);var SelectionAdapter=this.options.get("selectionAdapter");this.selection=new SelectionAdapter($element,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,$container);var DropdownAdapter=this.options.get("dropdownAdapter");this.dropdown=new DropdownAdapter($element,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,$container);var ResultsAdapter=this.options.get("resultsAdapter");this.results=new ResultsAdapter($element,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var self=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current((function(initialData){self.trigger("selection:update",{data:initialData})})),$element.addClass("select2-hidden-accessible"),$element.attr("aria-hidden","true"),this._syncAttributes(),Utils.StoreData($element[0],"select2",this),$element.data("select2",this)};return Utils.Extend(Select2,Utils.Observable),Select2.prototype._generateId=function($element){var id="";return id="select2-"+(id=(id=null!=$element.attr("id")?$element.attr("id"):null!=$element.attr("name")?$element.attr("name")+"-"+Utils.generateChars(2):Utils.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,""))},Select2.prototype._placeContainer=function($container){$container.insertAfter(this.$element);var width=this._resolveWidth(this.$element,this.options.get("width"));null!=width&&$container.css("width",width)},Select2.prototype._resolveWidth=function($element,method){var WIDTH=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i,computedStyle;if("resolve"==method){var styleWidth=this._resolveWidth($element,"style");return null!=styleWidth?styleWidth:this._resolveWidth($element,"element")}if("element"==method){var elementWidth=$element.outerWidth(!1);return elementWidth<=0?"auto":elementWidth+"px"}if("style"==method){var style=$element.attr("style");if("string"!=typeof style)return null;for(var attrs=style.split(";"),i=0,l=attrs.length;i<l;i+=1){var attr,matches=attrs[i].replace(/\s/g,"").match(WIDTH);if(null!==matches&&matches.length>=1)return matches[1]}return null}return"computedstyle"==method?window.getComputedStyle($element[0]).width:method},Select2.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},Select2.prototype._registerDomEvents=function(){var self=this;this.$element.on("change.select2",(function(){self.dataAdapter.current((function(data){self.trigger("selection:update",{data:data})}))})),this.$element.on("focus.select2",(function(evt){self.trigger("focus",evt)})),this._syncA=Utils.bind(this._syncAttributes,this),this._syncS=Utils.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var observer=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=observer?(this._observer=new observer((function(mutations){self._syncA(),self._syncS(null,mutations)})),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",self._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",self._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",self._syncS,!1))},Select2.prototype._registerDataEvents=function(){var self=this;this.dataAdapter.on("*",(function(name,params){self.trigger(name,params)}))},Select2.prototype._registerSelectionEvents=function(){var self=this,nonRelayEvents=["toggle","focus"];this.selection.on("toggle",(function(){self.toggleDropdown()})),this.selection.on("focus",(function(params){self.focus(params)})),this.selection.on("*",(function(name,params){-1===$.inArray(name,nonRelayEvents)&&self.trigger(name,params)}))},Select2.prototype._registerDropdownEvents=function(){var self=this;this.dropdown.on("*",(function(name,params){self.trigger(name,params)}))},Select2.prototype._registerResultsEvents=function(){var self=this;this.results.on("*",(function(name,params){self.trigger(name,params)}))},Select2.prototype._registerEvents=function(){var self=this;this.on("open",(function(){self.$container.addClass("select-box-open")})),this.on("close",(function(){self.$container.removeClass("select-box-open")})),this.on("enable",(function(){self.$container.removeClass("select-box-disabled")})),this.on("disable",(function(){self.$container.addClass("select-box-disabled")})),this.on("blur",(function(){self.$container.removeClass("select-box-focus")})),this.on("query",(function(params){self.isOpen()||self.trigger("open",{}),this.dataAdapter.query(params,(function(data){self.trigger("results:all",{data:data,query:params})}))})),this.on("query:append",(function(params){this.dataAdapter.query(params,(function(data){self.trigger("results:append",{data:data,query:params})}))})),this.on("keypress",(function(evt){var key=evt.which;self.isOpen()?key===KEYS.ESC||key===KEYS.TAB||key===KEYS.UP&&evt.altKey?(self.close(evt),evt.preventDefault()):key===KEYS.ENTER?(self.trigger("results:select",{}),evt.preventDefault()):key===KEYS.SPACE&&evt.ctrlKey?(self.trigger("results:toggle",{}),evt.preventDefault()):key===KEYS.UP?(self.trigger("results:previous",{}),evt.preventDefault()):key===KEYS.DOWN&&(self.trigger("results:next",{}),evt.preventDefault()):(key===KEYS.ENTER||key===KEYS.SPACE||key===KEYS.DOWN&&evt.altKey)&&(self.open(),evt.preventDefault())}))},Select2.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},Select2.prototype._isChangeMutation=function(evt,mutations){var changed=!1,self=this;if(!evt||!evt.target||"OPTION"===evt.target.nodeName||"OPTGROUP"===evt.target.nodeName){if(mutations)if(mutations.addedNodes&&mutations.addedNodes.length>0)for(var n=0;n<mutations.addedNodes.length;n++){var node;mutations.addedNodes[n].selected&&(changed=!0)}else mutations.removedNodes&&mutations.removedNodes.length>0?changed=!0:$.isArray(mutations)&&$.each(mutations,(function(evt,mutation){if(self._isChangeMutation(evt,mutation))return changed=!0,!1}));else changed=!0;return changed}},Select2.prototype._syncSubtree=function(evt,mutations){var changed=this._isChangeMutation(evt,mutations),self=this;changed&&this.dataAdapter.current((function(currentData){self.trigger("selection:update",{data:currentData})}))},Select2.prototype.trigger=function(name,args){var actualTrigger=Select2.__super__.trigger,preTriggerMap={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===args&&(args={}),name in preTriggerMap){var preTriggerName=preTriggerMap[name],preTriggerArgs={prevented:!1,name:name,args:args};if(actualTrigger.call(this,preTriggerName,preTriggerArgs),preTriggerArgs.prevented)return void(args.prevented=!0)}actualTrigger.call(this,name,args)},Select2.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},Select2.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},Select2.prototype.close=function(evt){this.isOpen()&&this.trigger("close",{originalEvent:evt})},Select2.prototype.isEnabled=function(){return!this.isDisabled()},Select2.prototype.isDisabled=function(){return this.options.get("disabled")},Select2.prototype.isOpen=function(){return this.$container.hasClass("select-box-open")},Select2.prototype.hasFocus=function(){return this.$container.hasClass("select-box-focus")},Select2.prototype.focus=function(data){this.hasFocus()||(this.$container.addClass("select-box-focus"),this.trigger("focus",{}))},Select2.prototype.enable=function(args){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=args&&0!==args.length||(args=[!0]);var disabled=!args[0];this.$element.prop("disabled",disabled)},Select2.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var data=[];return this.dataAdapter.current((function(currentData){data=currentData})),data},Select2.prototype.val=function(args){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==args||0===args.length)return this.$element.val();var newVal=args[0];$.isArray(newVal)&&(newVal=$.map(newVal,(function(obj){return obj.toString()}))),this.$element.val(newVal).trigger("input").trigger("change")},Select2.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",Utils.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),Utils.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},Select2.prototype.render=function(){var $container=$('<span class="select2 select-box"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return $container.attr("dir",this.options.get("dir")),this.$container=$container,this.$container.addClass("select-box-"+this.options.get("theme")),Utils.StoreData($container[0],"element",this.$element),$container},Select2})),S2.define("select2/compat/utils",["jquery"],(function($){function syncCssClasses($dest,$src,adapter){var classes,replacements=[],adapted;(classes=$.trim($dest.attr("class")))&&$((classes=""+classes).split(/\s+/)).each((function(){0===this.indexOf("select2-")&&replacements.push(this)})),(classes=$.trim($src.attr("class")))&&$((classes=""+classes).split(/\s+/)).each((function(){0!==this.indexOf("select2-")&&null!=(adapted=adapter(this))&&replacements.push(adapted)})),$dest.attr("class",replacements.join(" "))}return{syncCssClasses:syncCssClasses}})),S2.define("select2/compat/containerCss",["jquery","./utils"],(function($,CompatUtils){function _containerAdapter(clazz){return null}function ContainerCSS(){}return ContainerCSS.prototype.render=function(decorated){var $container=decorated.call(this),containerCssClass=this.options.get("containerCssClass")||"";$.isFunction(containerCssClass)&&(containerCssClass=containerCssClass(this.$element));var containerCssAdapter=this.options.get("adaptContainerCssClass");if(containerCssAdapter=containerCssAdapter||_containerAdapter,-1!==containerCssClass.indexOf(":all:")){containerCssClass=containerCssClass.replace(":all:","");var _cssAdapter=containerCssAdapter;containerCssAdapter=function(clazz){var adapted=_cssAdapter(clazz);return null!=adapted?adapted+" "+clazz:clazz}}var containerCss=this.options.get("containerCss")||{};return $.isFunction(containerCss)&&(containerCss=containerCss(this.$element)),CompatUtils.syncCssClasses($container,this.$element,containerCssAdapter),$container.css(containerCss),$container.addClass(containerCssClass),$container},ContainerCSS})),S2.define("select2/compat/dropdownCss",["jquery","./utils"],(function($,CompatUtils){function _dropdownAdapter(clazz){return null}function DropdownCSS(){}return DropdownCSS.prototype.render=function(decorated){var $dropdown=decorated.call(this),dropdownCssClass=this.options.get("dropdownCssClass")||"";$.isFunction(dropdownCssClass)&&(dropdownCssClass=dropdownCssClass(this.$element));var dropdownCssAdapter=this.options.get("adaptDropdownCssClass");if(dropdownCssAdapter=dropdownCssAdapter||_dropdownAdapter,-1!==dropdownCssClass.indexOf(":all:")){dropdownCssClass=dropdownCssClass.replace(":all:","");var _cssAdapter=dropdownCssAdapter;dropdownCssAdapter=function(clazz){var adapted=_cssAdapter(clazz);return null!=adapted?adapted+" "+clazz:clazz}}var dropdownCss=this.options.get("dropdownCss")||{};return $.isFunction(dropdownCss)&&(dropdownCss=dropdownCss(this.$element)),CompatUtils.syncCssClasses($dropdown,this.$element,dropdownCssAdapter),$dropdown.css(dropdownCss),$dropdown.addClass(dropdownCssClass),$dropdown},DropdownCSS})),S2.define("select2/compat/initSelection",["jquery"],(function($){function InitSelection(decorated,$element,options){options.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=options.get("initSelection"),this._isInitialized=!1,decorated.call(this,$element,options)}return InitSelection.prototype.current=function(decorated,callback){var self=this;this._isInitialized?decorated.call(this,callback):this.initSelection.call(null,this.$element,(function(data){self._isInitialized=!0,$.isArray(data)||(data=[data]),callback(data)}))},InitSelection})),S2.define("select2/compat/inputData",["jquery","../utils"],(function($,Utils){function InputData(decorated,$element,options){this._currentData=[],this._valueSeparator=options.get("valueSeparator")||",","hidden"===$element.prop("type")&&options.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),decorated.call(this,$element,options)}return InputData.prototype.current=function(_,callback){function getSelected(data,selectedIds){var selected=[];return data.selected||-1!==$.inArray(data.id,selectedIds)?(data.selected=!0,selected.push(data)):data.selected=!1,data.children&&selected.push.apply(selected,getSelected(data.children,selectedIds)),selected}for(var selected=[],d=0;d<this._currentData.length;d++){var data=this._currentData[d];selected.push.apply(selected,getSelected(data,this.$element.val().split(this._valueSeparator)))}callback(selected)},InputData.prototype.select=function(_,data){if(this.options.get("multiple")){var value=this.$element.val();value+=this._valueSeparator+data.id,this.$element.val(value),this.$element.trigger("input").trigger("change")}else this.current((function(allData){$.map(allData,(function(data){data.selected=!1}))})),this.$element.val(data.id),this.$element.trigger("input").trigger("change")},InputData.prototype.unselect=function(_,data){var self=this;data.selected=!1,this.current((function(allData){for(var values=[],d=0;d<allData.length;d++){var item=allData[d];data.id!=item.id&&values.push(item.id)}self.$element.val(values.join(self._valueSeparator)),self.$element.trigger("input").trigger("change")}))},InputData.prototype.query=function(_,params,callback){for(var results=[],d=0;d<this._currentData.length;d++){var data=this._currentData[d],matches=this.matches(params,data);null!==matches&&results.push(matches)}callback({results:results})},InputData.prototype.addOptions=function(_,$options){var options=$.map($options,(function($option){return Utils.GetData($option[0],"data")}));this._currentData.push.apply(this._currentData,options)},InputData})),S2.define("select2/compat/matcher",["jquery"],(function($){function oldMatcher(matcher){function wrappedMatcher(params,data){var match=$.extend(!0,{},data);if(null==params.term||""===$.trim(params.term))return match;if(data.children){for(var c=data.children.length-1;c>=0;c--){var child=data.children[c],doesMatch;matcher(params.term,child.text,child)||match.children.splice(c,1)}if(match.children.length>0)return match}return matcher(params.term,data.text,data)?match:null}return wrappedMatcher}return oldMatcher})),S2.define("select2/compat/query",[],(function(){function Query(decorated,$element,options){options.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),decorated.call(this,$element,options)}return Query.prototype.query=function(_,params,callback){var query;params.callback=callback,this.options.get("query").call(null,params)},Query})),S2.define("select2/dropdown/attachContainer",[],(function(){function AttachContainer(decorated,$element,options){decorated.call(this,$element,options)}return AttachContainer.prototype.position=function(decorated,$dropdown,$container){var $dropdownContainer;$container.find(".dropdown-wrapper").append($dropdown),$dropdown.addClass("select2-dropdown-below"),$container.addClass("select-box-below")},AttachContainer})),S2.define("select2/dropdown/stopPropagation",[],(function(){function StopPropagation(){}return StopPropagation.prototype.bind=function(decorated,container,$container){decorated.call(this,container,$container);var stoppedEvents=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(stoppedEvents.join(" "),(function(evt){evt.stopPropagation()}))},StopPropagation})),S2.define("select2/selection/stopPropagation",[],(function(){function StopPropagation(){}return StopPropagation.prototype.bind=function(decorated,container,$container){decorated.call(this,container,$container);var stoppedEvents=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(stoppedEvents.join(" "),(function(evt){evt.stopPropagation()}))},StopPropagation})),
/*!
         * jQuery Mousewheel 3.1.13
         *
         * Copyright jQuery Foundation and other contributors
         * Released under the MIT license
         * http://jquery.org/license
         */
factory=function($){var toFix=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],toBind="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],slice=Array.prototype.slice,nullLowestDeltaTimeout,lowestDelta;if($.event.fixHooks)for(var i=toFix.length;i;)$.event.fixHooks[toFix[--i]]=$.event.mouseHooks;var special=$.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var i=toBind.length;i;)this.addEventListener(toBind[--i],handler,!1);else this.onmousewheel=handler;$.data(this,"mousewheel-line-height",special.getLineHeight(this)),$.data(this,"mousewheel-page-height",special.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var i=toBind.length;i;)this.removeEventListener(toBind[--i],handler,!1);else this.onmousewheel=null;$.removeData(this,"mousewheel-line-height"),$.removeData(this,"mousewheel-page-height")},getLineHeight:function(elem){var $elem=$(elem),$parent=$elem["offsetParent"in $.fn?"offsetParent":"parent"]();return $parent.length||($parent=$("body")),parseInt($parent.css("fontSize"),10)||parseInt($elem.css("fontSize"),10)||16},getPageHeight:function(elem){return $(elem).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function handler(event){var orgEvent=event||window.event,args=slice.call(arguments,1),delta=0,deltaX=0,deltaY=0,absDelta=0,offsetX=0,offsetY=0;if((event=$.event.fix(orgEvent)).type="mousewheel","detail"in orgEvent&&(deltaY=-1*orgEvent.detail),"wheelDelta"in orgEvent&&(deltaY=orgEvent.wheelDelta),"wheelDeltaY"in orgEvent&&(deltaY=orgEvent.wheelDeltaY),"wheelDeltaX"in orgEvent&&(deltaX=-1*orgEvent.wheelDeltaX),"axis"in orgEvent&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS&&(deltaX=-1*deltaY,deltaY=0),delta=0===deltaY?deltaX:deltaY,"deltaY"in orgEvent&&(delta=deltaY=-1*orgEvent.deltaY),"deltaX"in orgEvent&&(deltaX=orgEvent.deltaX,0===deltaY&&(delta=-1*deltaX)),0!==deltaY||0!==deltaX){if(1===orgEvent.deltaMode){var lineHeight=$.data(this,"mousewheel-line-height");delta*=lineHeight,deltaY*=lineHeight,deltaX*=lineHeight}else if(2===orgEvent.deltaMode){var pageHeight=$.data(this,"mousewheel-page-height");delta*=pageHeight,deltaY*=pageHeight,deltaX*=pageHeight}if(absDelta=Math.max(Math.abs(deltaY),Math.abs(deltaX)),(!lowestDelta||absDelta<lowestDelta)&&(lowestDelta=absDelta,shouldAdjustOldDeltas(orgEvent,absDelta)&&(lowestDelta/=40)),shouldAdjustOldDeltas(orgEvent,absDelta)&&(delta/=40,deltaX/=40,deltaY/=40),delta=Math[delta>=1?"floor":"ceil"](delta/lowestDelta),deltaX=Math[deltaX>=1?"floor":"ceil"](deltaX/lowestDelta),deltaY=Math[deltaY>=1?"floor":"ceil"](deltaY/lowestDelta),special.settings.normalizeOffset&&this.getBoundingClientRect){var boundingRect=this.getBoundingClientRect();offsetX=event.clientX-boundingRect.left,offsetY=event.clientY-boundingRect.top}return event.deltaX=deltaX,event.deltaY=deltaY,event.deltaFactor=lowestDelta,event.offsetX=offsetX,event.offsetY=offsetY,event.deltaMode=0,args.unshift(event,delta,deltaX,deltaY),nullLowestDeltaTimeout&&clearTimeout(nullLowestDeltaTimeout),nullLowestDeltaTimeout=setTimeout(nullLowestDelta,200),($.event.dispatch||$.event.handle).apply(this,args)}}function nullLowestDelta(){lowestDelta=null}function shouldAdjustOldDeltas(orgEvent,absDelta){return special.settings.adjustOldDeltas&&"mousewheel"===orgEvent.type&&absDelta%120==0}$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel")},unmousewheel:function(fn){return this.unbind("mousewheel",fn)}})},"function"==typeof S2.define&&S2.define.amd?S2.define("jquery-mousewheel",["jquery"],factory):"object"==typeof exports?module.exports=factory:factory(jQuery),S2.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],(function($,_,Select2,Defaults,Utils){if(null==$.fn.select2){var thisMethods=["open","close","destroy"];$.fn.select2=function(options){if("object"==typeof(options=options||{}))return this.each((function(){var instanceOptions=$.extend(!0,{},options),instance=new Select2($(this),instanceOptions)})),this;if("string"==typeof options){var ret,args=Array.prototype.slice.call(arguments,1);return this.each((function(){var instance=Utils.GetData(this,"select2");null==instance&&window.console&&console.error&&console.error("The select2('"+options+"') method was called on an element that is not using Select2."),ret=instance[options].apply(instance,args)})),$.inArray(options,thisMethods)>-1?this:ret}throw new Error("Invalid arguments for Select2: "+options)}}return null==$.fn.select2.defaults&&($.fn.select2.defaults=Defaults),Select2})),{define:S2.define,require:S2.require}}(),select2=S2.require("jquery.select2");return jQuery.fn.select2.amd=S2,select2})),$(".ax-select").each((function(){$(this).attr("class").indexOf("ax-xs")>=0?$(this).select2({dropdownCssClass:"ax-xs"}):$(this).attr("class").indexOf("ax-sm")>=0?$(this).select2({dropdownCssClass:"ax-sm"}):$(this).attr("class").indexOf("ax-lg")>=0?$(this).select2({dropdownCssClass:"ax-lg"}):$(this).select2()})),$.fn.extend({txtaAutoHeight:function(){return this.each((function(){var $this=$(this);$this.attr("initAttrH")||$this.attr("initAttrH",$this.outerHeight()),setAutoHeight(this).on("input",(function(){setAutoHeight(this)}))}));function setAutoHeight(elem){var $obj=$(elem);return $obj.css({height:$obj.attr("initAttrH"),"overflow-y":"hidden"}).height(elem.scrollHeight)}}}),function(){var _=function(input,o){var me=this;if(_.count=(_.count||0)+1,this.count=_.count,this.isOpened=!1,this.input=$(input),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("aria-expanded","false"),this.input.setAttribute("aria-owns","ax-complete-list-"+this.count),this.input.setAttribute("role","combobox"),this.options=o=o||{},configure(this,{minChars:1,maxItems:20,text:!1,autoFirst:!1,data:_.DATA,filter:_.FILTER_CONTAINS,sort:!1!==o.sort&&_.SORT_BYLENGTH,container:_.CONTAINER,item:_.ITEM,replace:_.REPLACE,tabSelect:!1},o),this.index=-1,this.container=this.container(input),this.ul=$.create("ul",{hidden:"hidden",role:"listbox",id:"ax-complete-list-"+this.count,inside:this.container}),"true"==this.input.getAttribute("data-text")?this.text=!0:this.text=!1,this.text)var isShow="";else var isShow="display:none;";this.status=$.create("span",{className:"ax-text",role:"status",style:isShow,"aria-live":"assertive","aria-atomic":!0,inside:this.container,textContent:0!=this.minChars?"请输入"+this.minChars+"个或更多字符":"Begin typing for results."}),this._events={input:{input:this.evaluate.bind(this),blur:this.close.bind(this,{reason:"blur"}),keydown:function(evt){var c=evt.keyCode;me.opened&&(13===c&&me.selected?(evt.preventDefault(),me.select(void 0,void 0,evt)):9===c&&me.selected&&me.tabSelect?me.select(void 0,void 0,evt):27===c?me.close({reason:"esc"}):38!==c&&40!==c||(evt.preventDefault(),me[38===c?"previous":"next"]()))}},form:{submit:this.close.bind(this,{reason:"submit"})},ul:{mousedown:function(evt){evt.preventDefault()},click:function(evt){var li=evt.target;if(li!==this){for(;li&&!/li/i.test(li.nodeName);)li=li.parentNode;li&&0===evt.button&&(evt.preventDefault(),me.select(li,evt.target,evt))}}}},$.bind(this.input,this._events.input),$.bind(this.input.form,this._events.form),$.bind(this.ul,this._events.ul),this.input.hasAttribute("list")?(this.list="#"+this.input.getAttribute("list"),this.input.removeAttribute("list")):this.list=this.input.getAttribute("data-list")||o.list||[],_.all.push(this)};function Suggestion(data){var o=Array.isArray(data)?{label:data[0],value:data[1]}:"object"==typeof data&&"label"in data&&"value"in data?data:{label:data,value:data};this.label=o.label||o.value,this.value=o.value}function configure(instance,properties,o){for(var i in properties){var initial=properties[i],attrValue=instance.input.getAttribute("data-"+i.toLowerCase());instance[i]="number"==typeof initial?parseInt(attrValue):!1===initial?null!==attrValue:initial instanceof Function?null:attrValue,instance[i]||0===instance[i]||(instance[i]=i in o?o[i]:initial)}}_.prototype={set list(list){if(Array.isArray(list))this._list=list;else if("string"==typeof list&&list.indexOf(",")>-1)this._list=list.split(/\s*,\s*/);else if((list=$(list))&&list.children){var items=[];slice.apply(list.children).forEach((function(el){if(!el.disabled){var text=el.textContent.trim(),value=el.value||text,label=el.label||text;""!==value&&items.push({label:label,value:value})}})),this._list=items}document.activeElement===this.input&&this.evaluate()},get selected(){return this.index>-1},get opened(){return this.isOpened},close:function(o){this.opened&&(this.input.setAttribute("aria-expanded","false"),this.ul.setAttribute("hidden",""),this.isOpened=!1,this.index=-1,this.status.setAttribute("hidden",""),$.fire(this.input,"axcomplete-close",o||{}))},open:function(){this.input.setAttribute("aria-expanded","true"),this.ul.removeAttribute("hidden"),this.isOpened=!0,this.status.removeAttribute("hidden"),this.autoFirst&&-1===this.index&&this.goto(0),$.fire(this.input,"axcomplete-open")},destroy:function(){if($.unbind(this.input,this._events.input),$.unbind(this.input.form,this._events.form),!this.options.container){var parentNode=this.container.parentNode;parentNode.insertBefore(this.input,this.container),parentNode.removeChild(this.container)}this.input.removeAttribute("autocomplete"),this.input.removeAttribute("aria-autocomplete");var indexOfAxcomplete=_.all.indexOf(this);-1!==indexOfAxcomplete&&_.all.splice(indexOfAxcomplete,1)},next:function(){var count=this.ul.children.length;this.goto(this.index<count-1?this.index+1:count?0:-1)},previous:function(){var count=this.ul.children.length,pos=this.index-1;this.goto(this.selected&&-1!==pos?pos:count-1)},goto:function(i){var lis=this.ul.children;this.selected&&lis[this.index].setAttribute("aria-selected","false"),this.index=i,i>-1&&lis.length>0&&(lis[i].setAttribute("aria-selected","true"),this.status.textContent=lis[i].textContent+", 共"+(i+1)+"/"+lis.length,this.input.setAttribute("aria-activedescendant",this.ul.id+"-item-"+this.index),this.ul.scrollTop=lis[i].offsetTop-this.ul.clientHeight+lis[i].clientHeight,$.fire(this.input,"axcomplete-highlight",{text:this.suggestions[this.index]}))},select:function(selected,origin,originalEvent){if(selected?this.index=$.siblingIndex(selected):selected=this.ul.children[this.index],selected){var suggestion=this.suggestions[this.index],allowed;$.fire(this.input,"axcomplete-select",{text:suggestion,origin:origin||selected,originalEvent:originalEvent})&&(this.replace(suggestion),this.close({reason:"select"}),$.fire(this.input,"axcomplete-selectcomplete",{text:suggestion,originalEvent:originalEvent}))}},evaluate:function(){var me=this,value=this.input.value;value.length>=this.minChars&&this._list&&this._list.length>0?(this.index=-1,this.ul.innerHTML="",this.suggestions=this._list.map((function(item){return new Suggestion(me.data(item,value))})).filter((function(item){return me.filter(item,value)})),!1!==this.sort&&(this.suggestions=this.suggestions.sort(this.sort)),this.suggestions=this.suggestions.slice(0,this.maxItems),this.suggestions.forEach((function(text,index){me.ul.appendChild(me.item(text,value,index))})),0===this.ul.children.length?(this.status.textContent="没有匹配的选项!",this.close({reason:"不能匹配"})):(this.open(),this.status.textContent=this.ul.children.length+" 个匹配选项")):(this.close({reason:"不能匹配"}),this.status.textContent="没有匹配的选项!")}},_.all=[],_.FILTER_CONTAINS=function(text,input){var pure=text.replace(/<\/?[^>]*>/g,"");return RegExp($.regExpEscape(input.trim()),"i").test(pure)},_.FILTER_STARTSWITH=function(text,input){var pure=text.replace(/<\/?[^>]*>/g,"");return RegExp("^"+$.regExpEscape(input.trim()),"i").test(pure)},_.SORT_BYLENGTH=function(a,b){return a.length!==b.length?a.length-b.length:a<b?-1:1},_.CONTAINER=function(input){return $.create("div",{className:"ax-complete",around:input})},_.ITEM=function(text,input,item_id){var html=""===input.trim()?text:text.replace(RegExp($.regExpEscape(input.trim()),"gi"),"<mark>$&</mark>");return $.create("li",{innerHTML:html,role:"option","aria-selected":"false",id:"ax-complete-list-"+this.count+"-item-"+item_id})},_.REPLACE=function(text){this.input.value=text.value},_.DATA=function(item){return item},Object.defineProperty(Suggestion.prototype=Object.create(String.prototype),"length",{get:function(){return this.label.length}}),Suggestion.prototype.toString=Suggestion.prototype.valueOf=function(){return""+this.label};var slice=Array.prototype.slice;function $(expr,con){return"string"==typeof expr?(con||document).querySelector(expr):expr||null}function $$(expr,con){return slice.call((con||document).querySelectorAll(expr))}function init(){$$("input.ax-complete").forEach((function(input){new _(input)}))}$.create=function(tag,o){var element=document.createElement(tag);for(var i in o){var val=o[i];if("inside"===i)$(val).appendChild(element);else if("around"===i){var ref=$(val);ref.parentNode.insertBefore(element,ref),element.appendChild(ref),null!=ref.getAttribute("autofocus")&&ref.focus()}else i in element?element[i]=val:element.setAttribute(i,val)}return element},$.bind=function(element,o){if(element)for(var event in o){var callback=o[event];event.split(/\s+/).forEach((function(event){element.addEventListener(event,callback)}))}},$.unbind=function(element,o){if(element)for(var event in o){var callback=o[event];event.split(/\s+/).forEach((function(event){element.removeEventListener(event,callback)}))}},$.fire=function(target,type,properties){var evt=document.createEvent("HTMLEvents");for(var j in evt.initEvent(type,!0,!0),properties)evt[j]=properties[j];return target.dispatchEvent(evt)},$.regExpEscape=function(s){return s.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},$.siblingIndex=function(el){for(var i=0;el=el.previousElementSibling;i++);return i},"undefined"!=typeof self&&(self.Axcomplete=_),"undefined"!=typeof Document&&("loading"!==document.readyState?init():document.addEventListener("DOMContentLoaded",init)),_.$=$,_.$$=$$,"object"==typeof module&&module.exports&&(module.exports=_)}(),function($){$.fn.extend({axEll:function(options){var dft={textLength:"60",foldText:"收起",unfoldText:"全部",btnClass:"ax-color-primary"},opt=$.extend(dft,options);$(this).each((function(){var textNum=$(this).attr("data-num"),textTotal="";textTotal=""==textNum||void 0===textNum?opt.textLength:""!=textNum?textNum:"";var thisFold=$(this).attr("data-fold"),fnFold="";fnFold=""==thisFold||void 0===thisFold?opt.foldText:""!=thisFold?thisFold:"";var thisUnfold=$(this).attr("data-unfold"),fnUnfold="";fnUnfold=""==thisUnfold||void 0===thisUnfold?opt.unfoldText:""!=thisUnfold?thisUnfold:"";var thisBtnClass=$(this).attr("data-class"),fnBtnClass="";fnBtnClass=""==thisBtnClass||void 0===thisBtnClass?opt.btnClass:""!=textNum?thisBtnClass:"";var content=$.trim($(this).text()),contentEll=$.trim($(this).text()).substring(0,textTotal)+"...",more=!0;$(this).text().length>opt.textLength&&($(this).text($(this).text().substring(0,textTotal)),$(this).html(contentEll+"<a href='###' class='"+fnBtnClass+"'>"+fnUnfold+"</a>"),more=!0),$(this).on("click","a",(function(){more?($(this).parent().html(content+"<a href='###' class='"+fnBtnClass+"'>"+fnFold+"</a>"),more=!1):($(this).parent().html(contentEll+"<a href='###' class='"+fnBtnClass+"'>"+fnUnfold+"</a>"),more=!0)}))}))}})}(jQuery),function($){$.fn.extend({axTab:function(options){var dft={name:"ax-tab",index:"",cookie:""},opt=$.extend(dft,options);this.each((function(){var thisTab=$(this),thisNav="";thisNav=1==thisTab.hasClass("ax-box")||1==thisTab.hasClass("ax-panel")?thisTab.children('[class*="-header"]').find(".ax-tab-nav"):1==thisTab.children(".ax-grid").children().hasClass("ax-tab-nav")?thisTab.children(".ax-grid").children(".ax-tab-nav"):thisTab.children(".ax-tab-nav");var thisContent=thisTab.children(".ax-tab-content"),thisActive="ax-active",tabNum=Math.min.apply(null,[thisNav.children().length,thisContent.children().length]),thisIndex="";thisIndex=""==thisTab.attr("data-index")||void 0===thisTab.attr("data-index")?opt.index:""!=thisTab.attr("data-index")?thisTab.attr("data-index"):"";var thisCookie="";thisCookie=""==thisTab.attr("data-cookie")||void 0===thisTab.attr("data-cookie")?opt.cookie:""!=thisTab.attr("data-cookie")?thisTab.attr("data-cookie"):"",""!=thisIndex&&(thisCookie=""),thisTab.addClass(opt.name),""!=thisCookie?(thisNav.children().eq($.cookie(thisCookie)).addClass(thisActive).siblings().removeClass(thisActive),thisContent.children().eq($.cookie(thisCookie)).addClass(thisActive).siblings().removeClass(thisActive)):""==thisIndex||thisIndex<0||thisIndex-tabNum>-1?(thisNav.children().eq(0).addClass(thisActive).siblings().removeClass(thisActive),thisContent.children().eq(0).addClass(thisActive).siblings().removeClass(thisActive)):(thisNav.children().eq(thisIndex).addClass(thisActive).siblings().removeClass(thisActive),thisContent.children().eq(thisIndex).addClass(thisActive).siblings().removeClass(thisActive)),thisNav.children().on("click",(function(){var index=thisNav.children().index(this);""!=thisCookie&&$.cookie(thisCookie,index,{expires:365e3,path:"/"}),$(this).addClass(thisActive).siblings().removeClass(thisActive),thisContent.children().eq(index).addClass(thisActive).siblings().removeClass(thisActive)}))}))}})}(jQuery),function($){$.fn.extend({axAccordion:function(options){var dft={name:"ax-accordion",index:"",fold:!0,multiple:!0,duration:100,cookie:""},opt=$.extend(dft,options),itemClass=".ax-item",activeClass="ax-show";""!==opt.index&&($(this).children(itemClass).eq(opt.index).addClass("ax-show"),$(this).children(itemClass).eq(opt.index).children(".ax-panel-body").slideDown(200)),$(this).each((function(){var that=$(this),item=that.children(itemClass),length=that.children(itemClass).length,thisIndex="";thisIndex=""==that.attr("data-index")||void 0===that.attr("data-index")?opt.index:""!=that.attr("data-index")?that.attr("data-index"):"";var thisDuration="";thisDuration=""==that.attr("data-duration")||void 0===that.attr("data-duration")?opt.duration:""!=that.attr("data-duration")?that.attr("data-duration"):opt.duration;var thisMultiple="";thisMultiple=""==that.attr("data-multiple")||void 0===that.attr("data-multiple")?opt.multiple:"false"==that.attr("data-multiple")?that.attr("data-multiple"):opt.multiple;var thisFold="";thisFold=""==that.attr("data-fold")||void 0===that.attr("data-fold")?opt.fold:"false"==that.attr("data-fold")?that.attr("data-fold"):opt.fold;var thisCookie="";thisCookie=""==that.attr("data-cookie")||void 0===that.attr("data-cookie")?opt.cookie:""!=that.attr("data-cookie")?that.attr("data-cookie"):"","false"==thisFold&&(thisIndex="",thisCookie="",item.addClass("ax-show").siblings().removeClass("ax-show"),item.children(".ax-panel-body").slideDown(thisDuration)),thisIndex==$.cookie(thisCookie)&&(thisCookie=""),""!=thisCookie?"true"==$.cookie(thisCookie+"show")?(item.eq($.cookie(thisCookie)).addClass("ax-show").siblings().removeClass("ax-show"),item.eq($.cookie(thisCookie)).children(".ax-panel-body").slideDown(thisDuration),item.not(":eq("+$.cookie(thisCookie)+")").children(".ax-panel-body").slideUp(thisDuration)):(item.removeClass("ax-show"),item.children(".ax-panel-body").slideUp(thisDuration)):(""==thisIndex||thisIndex<0||thisIndex-length>-1)&&"true"==thisFold&&(item.removeClass("ax-show"),item.children(".ax-panel-body").slideUp(thisDuration)),""!=thisIndex&&(that.children(itemClass).eq(thisIndex).addClass("ax-show"),that.children(itemClass).eq(thisIndex).children(".ax-panel-body").slideDown(thisDuration)),item.not(".ax-disabled").each((function(){var collapse=$(this),collapseHeader=collapse.children(".ax-panel-header"),collapseBody=collapse.children(".ax-panel-body");collapseHeader.click((function(event){var index=item.index($(this).closest(itemClass));""!=thisCookie&&$.cookie(thisCookie,index,{expires:365e3,path:"/"}),0==$(this).next(".ax-panel-body").is(":visible")?(collapse.addClass("ax-show"),collapseBody.slideDown(thisDuration),"false"==thisMultiple&&(collapse.siblings(itemClass).removeClass("ax-show"),collapse.siblings(itemClass).children(".ax-panel-body").slideUp(thisDuration)),$.cookie(thisCookie+"show","true",{expires:365e3,path:"/"})):(collapse.removeClass("ax-show"),collapseBody.slideUp(thisDuration),$.cookie(thisCookie+"show","false",{expires:365e3,path:"/"})),event.stopPropagation()})),collapseHeader.find("a").click((function(event){event.stopPropagation()}))}))}))}})}(jQuery),$(document).ready((function(){$(".ax-more-ell").axEll(),$(".ax-tab").axTab(),$(".ax-accordion").axAccordion(),$(".ax-alert").each((function(){var that=$(this);$(this).find(".ax-close").click((function(){that.hide()}))})),$(".ax-tag").each((function(){var that=$(this);that.find("i,s").click((function(){that.hide()}))})),$(".ax-pos-left").each((function(){var posWidth=$(this).outerWidth(!0);$(this).siblings("input,textarea").css("padding-left",posWidth)})),$(window).resize((function(){$(".ax-pos-left").each((function(){var posWidth=$(this).outerWidth(!0);$(this).siblings("input,textarea").css("padding-left",posWidth)}))})),$(".ax-pos-right .ax-val-none").click((function(){$(this).parent().siblings("input,textarea").val("").removeClass("ax-fast-input"),$(this).parent().siblings(".ax-fast-list").hide()})),$(".ax-input-group").find(".ax-title-select").nextAll("div").addClass("ax-select-next"),$(".ax-input-group").find(".ax-title-select").nextAll("div").hover((function(){$(this).addClass("ax-hover")}),(function(){$(this).removeClass("ax-hover"),1==$(this).find("input").is(":focus")&&$(this).addClass("ax-hover"),$(this).find("input").blur((function(){$(this).parent().removeClass("ax-hover")}))})),$(".ax-input-group").find(".ax-operate,.ax-suffix,.ax-suffix-select").prev().addClass("ax-suffix-prev"),$(".ax-input-group").find(".ax-operate,.ax-suffix,.ax-suffix-select").prev().hover((function(){$(this).addClass("ax-hover")}),(function(){$(this).removeClass("ax-hover"),1==$(this).find("input").is(":focus")&&$(this).addClass("ax-hover"),$(this).find("input").blur((function(){$(this).parent().removeClass("ax-hover")}))})),$(".ax-panel").each((function(){var panel=$(this),closeBtn=panel.children(".ax-panel-header").find(".ax-panel-close");closeBtn.click((function(){0==panel.children(".ax-panel-body").is(":visible")?(closeBtn.removeClass("ax-rotate-180"),panel.children(".ax-panel-body").slideDown(100)):(closeBtn.addClass("ax-rotate-180"),panel.children(".ax-panel-body").slideUp(100))}))})),$(".ax-box").each((function(){var panel=$(this),headerDiv=panel.children(".ax-box-header"),closeBtn=headerDiv.find(".ax-box-close");headerDiv.children(".ax-des").length>0?""==headerDiv.children(".ax-des").html()&&headerDiv.addClass("ax-simple"):headerDiv.addClass("ax-simple"),closeBtn.click((function(){0==panel.children(".ax-box-body").is(":visible")?(closeBtn.removeClass("ax-rotate-180"),panel.children(".ax-box-body").slideDown(100)):(closeBtn.addClass("ax-rotate-180"),panel.children(".ax-box-body").slideUp(100))}))})),$(".ax-window").each((function(){var win=$(this),contain=win.find(".ax-window-contain"),content=win.find(".ax-window-content"),overlay=win.find(".ax-window-overlay"),close=win.find(".ax-window-close");overlay.click((function(){overlay.css({opacity:"0"}),setTimeout((function(){win.removeClass("ax-window-show"),overlay.removeAttr("style"),contain.removeAttr("style"),content.getAxScroll().hide()}),300),setTimeout((function(){content.getAxScroll().hide()}),300),contain.css({"animation-duration":".2s","animation-name":"scaleOut"})})),close.click((function(){overlay.css({opacity:"0"}),setTimeout((function(){win.removeClass("ax-window-show"),overlay.removeAttr("style"),contain.removeAttr("style")}),300),setTimeout((function(){content.getAxScroll().hide()}),300),contain.css({"animation-duration":".2s","animation-name":"scaleOut"})}))})),$(".ax-window[data-drag='true'] .ax-window-title").mousedown((function(e){$(this).css("cursor","move");var moveDIV=$(this).parent();$(this).parent().css({position:"fixed",transition:"none"});var offset=moveDIV.offset(),x=e.clientX-offset.left,y=e.clientY-offset.top;$(document).bind("mousemove",(function(ev){var _x=ev.clientX-x,_y=ev.clientY-y-$(window).scrollTop();moveDIV.css({left:_x+"px",top:_y+"px"})}))})),$(document).mouseup((function(){$(this).unbind("mousemove")})),$(".ax-drawer").each((function(){var win=$(this),winId=win.attr("id"),contain=win.find(".ax-drawer-contain"),content=win.find(".ax-drawer-content"),overlay=win.find(".ax-drawer-overlay"),close=win.find(".ax-drawer-close"),btnChild=win.find(".ax-open-child"),child=$("#"+winId+"-child"),parentId=winId.replace("-child",""),parent=$("#"+parentId),suffix=winId.substring(winId.length,winId.length-6),width=contain.css("width"),height=contain.css("height"),left=contain.css("left"),right=contain.css("right"),top=contain.css("top"),bottom=contain.css("bottom");overlay.click((function(){var parentContain=$("#"+parentId+"[class*='ax-drawer-show']").find(".ax-drawer-contain");overlay.css({opacity:"0"}),setTimeout((function(){win.removeClass("ax-drawer-show"),overlay.removeAttr("style"),contain.removeAttr("style"),content.getAxScroll().hide()}),300),setTimeout((function(){content.getAxScroll().hide()}),300),"right"==win.attr("data-position")?(contain.css({right:right}),"-child"==suffix&&"right"==parent.attr("data-position")&&parentContain.css({right:0})):"left"==win.attr("data-position")?(contain.css({left:left}),"-child"==suffix&&"left"==parent.attr("data-position")&&parentContain.css({left:0})):"top"==win.attr("data-position")?(contain.css({top:top}),"-child"==suffix&&"top"==parent.attr("data-position")&&parentContain.css({top:0})):"bottom"==win.attr("data-position")?(contain.css({bottom:bottom}),"-child"==suffix&&"bottom"==parent.attr("data-position")&&parentContain.css({bottom:0})):(contain.css({right:right}),"-child"==suffix&&void 0===parent.attr("data-position")&&parentContain.css({right:0}))})),close.click((function(){var parentContain=$("#"+parentId+"[class*='ax-drawer-show']").find(".ax-drawer-contain");overlay.css({opacity:"0"}),setTimeout((function(){win.removeClass("ax-drawer-show"),overlay.removeAttr("style"),contain.removeAttr("style")}),300),setTimeout((function(){content.getAxScroll().hide()}),300),"right"==win.attr("data-position")?(contain.css({right:right}),"-child"==suffix&&"right"==parent.attr("data-position")&&parentContain.css({right:0})):"left"==win.attr("data-position")?(contain.css({left:left}),"-child"==suffix&&"left"==parent.attr("data-position")&&parentContain.css({left:0})):"top"==win.attr("data-position")?(contain.css({top:top}),"-child"==suffix&&"top"==parent.attr("data-position")&&parentContain.css({top:0})):"bottom"==win.attr("data-position")?(contain.css({bottom:bottom}),"-child"==suffix&&"bottom"==parent.attr("data-position")&&parentContain.css({bottom:0})):(contain.css({right:right}),"-child"==suffix&&void 0===parent.attr("data-position")&&parentContain.css({right:0}))})),win.find(".ax-open-child").click((function(){child.addClass("ax-drawer-show"),"left"==win.attr("data-position")&&"left"==child.attr("data-position")?"phone"==clientIs?contain.css("left","50px"):contain.css("left","100px"):"right"==win.attr("data-position")&&"right"==child.attr("data-position")?"phone"==clientIs?contain.css("right","50px"):contain.css("right","100px"):"top"==win.attr("data-position")&&"top"==child.attr("data-position")?"phone"==clientIs?contain.css("top","50px"):contain.css("top","100px"):"bottom"==win.attr("data-position")&&"bottom"==child.attr("data-position")?"phone"==clientIs?contain.css("bottom","50px"):contain.css("bottom","100px"):win.attr("data-position")==child.attr("data-position")&&("phone"==clientIs?contain.css("right","50px"):contain.css("right","100px"))}))})),$(".ax-list-select").each((function(){var outer=$(this);outer.find(".ax-info-block").each((function(){var block=$(this),input=block.find("input"),mask=block.find(".ax-mask");block.append('<div class="ax-mask"></div>'),1==input.prop("disabled")?$(this).addClass("ax-disabled"):1==input.prop("checked")?$(this).addClass("ax-active"):$(this).removeClass("ax-active");var numAll=outer.find("input:not(:disabled)").length,numLoad=outer.find("input:checked:not(:disabled)").length,numName="group-select-"+outer.find("input").attr("name");"0"==numLoad?($("input[type=radio][value=1][name="+numName+"]").prop("checked",!1),$("input[type=radio][value=0][name="+numName+"]").prop("checked",!0)):(numLoad=numAll)?($("input[type=radio][value=0][name="+numName+"]").prop("checked",!1),$("input[type=radio][value=1][name="+numName+"]").prop("checked",!0)):$("input[type=radio][name="+numName+"]").prop("checked",!1),"checkbox"==input.attr("type")&&0==input.prop("disabled")?(block.on("click",".ax-mask",(function(){1==input.prop("checked")?(input.prop("checked",!1),block.removeClass("ax-active")):(input.prop("checked",!0),block.addClass("ax-active"))})),block.bind("click",(function(){var numFact=outer.find("input:checked:not(:disabled)").length;"0"==numFact?($("input[type=radio][value=1][name="+numName+"]").prop("checked",!1),$("input[type=radio][value=0][name="+numName+"]").prop("checked",!0)):numAll!=numFact?$("input[name="+numName+"]").prop("checked",!1):($("input[type=checkbox][name="+numName+"]").prop("checked",!0),$("input[type=radio][value=1][name="+numName+"]").prop("checked",!0))}))):"radio"==input.attr("type")&&0==input.prop("disabled")?block.on("click",".ax-mask",(function(){outer.find("input").prop("checked",!1),outer.find(".ax-info-block").removeClass("ax-active"),$(this).parent().find("input").prop("checked",!0),$(this).parent().addClass("ax-active")})):$(this).parent().removeClass("ax-active")}))})),$("input[name^='group-select-']").each((function(){var elem=$(this),groupName,groupName=(groupName=elem.attr("name")).replace("group-select-",""),input=$("input[name="+groupName+"]:not(:disabled)"),block=$("input[name="+groupName+"]:not(:disabled)").parent().parent().parent();"checkbox"==elem.attr("type")&&1==elem.prop("checked")?(input.prop("checked",!0),block.addClass("ax-active")):"radio"==elem.attr("type")&&1==elem.prop("checked")&&"1"==elem.attr("value")&&(input.prop("checked",!0),block.addClass("ax-active")),elem.bind("click",(function(){"1"==$(this).attr("value")&&1==$(this).prop("checked")?(input.prop("checked",!0),block.addClass("ax-active")):(input.prop("checked",!1),block.removeClass("ax-active"))}))})),$(".ax-overflow").each((function(){var overflow=$(this),max=0;overflow.find(".ax-inner > *").each((function(){$(this).width()>max&&(max=$(this).width())})),max>overflow.width()?overflow.addClass("ax-done"):overflow.removeClass("ax-done"),overflow.find(".ax-inner").scroll((function(){var minus;max-overflow.width()-$(this).scrollLeft()<44?overflow.removeClass("ax-done"):overflow.addClass("ax-done")}))})),$(".ax-scrollnav-h").each((function(){var nav=$(this),outer=$(this).find(".ax-scrollnav"),inner=$(this).find(".ax-scrollnav-list"),width=0;inner.find("li").each((function(){width+=parseInt($(this).outerWidth(!0))})),outer.width()<width&&(inner.css("width",width),outer.css("overflow-x","auto"))})),$(".ax-scrollnav-v").each((function(){var nav=$(this);$(this).find(".ax-close").click((function(){nav.hasClass("ax-hide")?(nav.removeClass("ax-hide"),$.cookie("scrollnav","show",{expires:3650,path:"/"})):(nav.addClass("ax-hide"),$.cookie("scrollnav","hide",{expires:3650,path:"/"}))}))})),"hide"===$.cookie("scrollnav")?$(".ax-scrollnav-v").addClass("ax-hide"):$(".ax-scrollnav-v").removeClass("ax-hide"),$(".ax-backtop .ax-item").hover((function(){$(this).addClass("ax-active"),$(this).find(".ax-text").fadeIn(200)}),(function(){$(this).removeClass("ax-active"),$(this).find(".ax-text").fadeOut(200)})),$(".ax-totop").click((function(){$("html, body").animate({scrollTop:0},"slow")})),$(".ax-lazy").each((function(){$(this).offset().top>$(window).height()&&$(this).addClass("ax-hide")})),$(".ax-ripple").each((function(){var width=$(this).innerWidth(),height=$(this).innerHeight(),size=Math.max(width,height);$(this).click((function(e){var that=$(this),x=e.clientX-(that.offset().left-$(window).scrollLeft()),y=e.clientY-(that.offset().top-$(window).scrollTop()),ripple=$("<u></u>");ripple.css({left:x,top:y,width:size,height:size}),that.append(ripple),setTimeout((function(){ripple.remove()}),800)}))})),$(".ax-dodge").each((function(){var that=$(this),input=that.find("input,textarea"),placeholder=input.attr("placeholder"),label=$("<label></label>");""==placeholder||"undefined"==placeholder?label.html("请输入内容..."):(label.html(placeholder),input.attr("placeholder","")),$(this).append(label),input.focus((function(){that.addClass("ax-active")})),input.blur((function(){""==$(this).val()?that.removeClass("ax-active"):that.addClass("ax-active")})),1==input.hasClass("ax-lg")&&$(this).addClass("ax-lg"),label.click((function(){input.focus()}))})),$(".ax-file").each((function(){var text=$(this).attr("data-text"),placeholder=$(this).attr("data-placeholder"),file=$(this).find("input[type=file]");""!=text&&"undefined"!=text||$(this).addClass("ax-simple"),file.hasClass("ax-xs")?$(this).addClass("ax-xs"):file.hasClass("ax-sm")?$(this).addClass("ax-sm"):file.hasClass("ax-lg")&&$(this).addClass("ax-lg"),$(this).on("change","input[type=file]",(function(){$(this).parent().addClass("ax-active"),$(this).parent().attr("data-placeholder",$(this).val().replace(/.*(\/|\\)/,"")),""==$(this).val()&&$(this).parent().attr("data-placeholder",placeholder).removeClass("ax-active")})),file.focus((function(){$(this).parent().addClass("ax-focus")})),file.blur((function(){$(this).parent().removeClass("ax-focus")}))})),$(".ax-search").each((function(){var that=$(this),input=that.find("input[type=text]"),reset=that.find(".ax-reset"),toggle=that.find(".ax-toggle"),use=!1;if(1==(use=""!=input.attr("data-list")&&void 0!==input.attr("data-list")||""!=input.attr("list")&&void 0!==input.attr("list"))){var complete=new Axcomplete(input[0]);toggle.click((function(){0===complete.ul.childNodes.length?(complete.minChars=0,complete.evaluate()):complete.ul.hasAttribute("hidden")?complete.evaluate():complete.close()}))}reset.on("click",(function(){input.val(""),$(this).hide(),1==use&&(complete.minChars=0,complete.close())})),input.on("input",(function(){""==$(this).val()?reset.hide():reset.css("display","inline-block")})),1==use&&input[0].addEventListener("axcomplete-select",(function(e){reset.css("display","inline-block")}),!1)}))})),$(window).scroll((function(){$(document).scrollTop()>=400?$(".ax-totop a").addClass("ax-show"):$(".ax-totop a").removeClass("ax-show"),$(".ax-lazy").each((function(){$(this).offset().top<$(window).scrollTop()+$(window).height()&&$(this).removeClass("ax-hide").addClass("ax-show")}))})),$(window).load((function(){}));