/*
 AngularJS v1.2.23
 (c) 2010-2014 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(Q,X,t){'use strict';function x(b){return function(){var a=arguments[0],c,a="["+(b?b+":":"")+a+"] http://errors.angularjs.org/1.2.23/"+(b?b+"/":"")+a;for(c=1;c<arguments.length;c++)a=a+(1==c?"?":"&")+"p"+(c-1)+"="+encodeURIComponent("function"==typeof arguments[c]?arguments[c].toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof arguments[c]?"undefined":"string"!=typeof arguments[c]?JSON.stringify(arguments[c]):arguments[c]);return Error(a)}}function fb(b){if(null==b||Fa(b))return!1;
var a=b.length;return 1===b.nodeType&&a?!0:z(b)||H(b)||0===a||"number"===typeof a&&0<a&&a-1 in b}function r(b,a,c){var d;if(b)if(P(b))for(d in b)"prototype"==d||("length"==d||"name"==d||b.hasOwnProperty&&!b.hasOwnProperty(d))||a.call(c,b[d],d);else if(H(b)||fb(b))for(d=0;d<b.length;d++)a.call(c,b[d],d);else if(b.forEach&&b.forEach!==r)b.forEach(a,c);else for(d in b)b.hasOwnProperty(d)&&a.call(c,b[d],d);return b}function Zb(b){var a=[],c;for(c in b)b.hasOwnProperty(c)&&a.push(c);return a.sort()}function Tc(b,
a,c){for(var d=Zb(b),e=0;e<d.length;e++)a.call(c,b[d[e]],d[e]);return d}function $b(b){return function(a,c){b(c,a)}}function gb(){for(var b=la.length,a;b;){b--;a=la[b].charCodeAt(0);if(57==a)return la[b]="A",la.join("");if(90==a)la[b]="0";else return la[b]=String.fromCharCode(a+1),la.join("")}la.unshift("0");return la.join("")}function ac(b,a){a?b.$$hashKey=a:delete b.$$hashKey}function B(b){var a=b.$$hashKey;r(arguments,function(a){a!==b&&r(a,function(a,c){b[c]=a})});ac(b,a);return b}function Z(b){return parseInt(b,
10)}function bc(b,a){return B(new (B(function(){},{prototype:b})),a)}function y(){}function Ga(b){return b}function $(b){return function(){return b}}function D(b){return"undefined"===typeof b}function A(b){return"undefined"!==typeof b}function T(b){return null!=b&&"object"===typeof b}function z(b){return"string"===typeof b}function Ab(b){return"number"===typeof b}function sa(b){return"[object Date]"===ya.call(b)}function P(b){return"function"===typeof b}function hb(b){return"[object RegExp]"===ya.call(b)}
function Fa(b){return b&&b.document&&b.location&&b.alert&&b.setInterval}function Uc(b){return!(!b||!(b.nodeName||b.prop&&b.attr&&b.find))}function Vc(b,a,c){var d=[];r(b,function(b,f,g){d.push(a.call(c,b,f,g))});return d}function Qa(b,a){if(b.indexOf)return b.indexOf(a);for(var c=0;c<b.length;c++)if(a===b[c])return c;return-1}function Ra(b,a){var c=Qa(b,a);0<=c&&b.splice(c,1);return a}function Ha(b,a,c,d){if(Fa(b)||b&&b.$evalAsync&&b.$watch)throw Sa("cpws");if(a){if(b===a)throw Sa("cpi");c=c||[];
d=d||[];if(T(b)){var e=Qa(c,b);if(-1!==e)return d[e];c.push(b);d.push(a)}if(H(b))for(var f=a.length=0;f<b.length;f++)e=Ha(b[f],null,c,d),T(b[f])&&(c.push(b[f]),d.push(e)),a.push(e);else{var g=a.$$hashKey;H(a)?a.length=0:r(a,function(b,c){delete a[c]});for(f in b)e=Ha(b[f],null,c,d),T(b[f])&&(c.push(b[f]),d.push(e)),a[f]=e;ac(a,g)}}else if(a=b)H(b)?a=Ha(b,[],c,d):sa(b)?a=new Date(b.getTime()):hb(b)?(a=RegExp(b.source,b.toString().match(/[^\/]*$/)[0]),a.lastIndex=b.lastIndex):T(b)&&(a=Ha(b,{},c,d));
return a}function ga(b,a){if(H(b)){a=a||[];for(var c=0;c<b.length;c++)a[c]=b[c]}else if(T(b))for(c in a=a||{},b)!ib.call(b,c)||"$"===c.charAt(0)&&"$"===c.charAt(1)||(a[c]=b[c]);return a||b}function za(b,a){if(b===a)return!0;if(null===b||null===a)return!1;if(b!==b&&a!==a)return!0;var c=typeof b,d;if(c==typeof a&&"object"==c)if(H(b)){if(!H(a))return!1;if((c=b.length)==a.length){for(d=0;d<c;d++)if(!za(b[d],a[d]))return!1;return!0}}else{if(sa(b))return sa(a)?isNaN(b.getTime())&&isNaN(a.getTime())||b.getTime()===
a.getTime():!1;if(hb(b)&&hb(a))return b.toString()==a.toString();if(b&&b.$evalAsync&&b.$watch||a&&a.$evalAsync&&a.$watch||Fa(b)||Fa(a)||H(a))return!1;c={};for(d in b)if("$"!==d.charAt(0)&&!P(b[d])){if(!za(b[d],a[d]))return!1;c[d]=!0}for(d in a)if(!c.hasOwnProperty(d)&&"$"!==d.charAt(0)&&a[d]!==t&&!P(a[d]))return!1;return!0}return!1}function Bb(b,a){var c=2<arguments.length?Aa.call(arguments,2):[];return!P(a)||a instanceof RegExp?a:c.length?function(){return arguments.length?a.apply(b,c.concat(Aa.call(arguments,
0))):a.apply(b,c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}}function Wc(b,a){var c=a;"string"===typeof b&&"$"===b.charAt(0)?c=t:Fa(a)?c="$WINDOW":a&&X===a?c="$DOCUMENT":a&&(a.$evalAsync&&a.$watch)&&(c="$SCOPE");return c}function ta(b,a){return"undefined"===typeof b?t:JSON.stringify(b,Wc,a?"  ":null)}function cc(b){return z(b)?JSON.parse(b):b}function Ta(b){"function"===typeof b?b=!0:b&&0!==b.length?(b=N(""+b),b=!("f"==b||"0"==b||"false"==b||"no"==b||"n"==b||"[]"==b)):b=!1;
return b}function ha(b){b=u(b).clone();try{b.empty()}catch(a){}var c=u("<div>").append(b).html();try{return 3===b[0].nodeType?N(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+N(b)})}catch(d){return N(c)}}function dc(b){try{return decodeURIComponent(b)}catch(a){}}function ec(b){var a={},c,d;r((b||"").split("&"),function(b){b&&(c=b.replace(/\+/g,"%20").split("="),d=dc(c[0]),A(d)&&(b=A(c[1])?dc(c[1]):!0,ib.call(a,d)?H(a[d])?a[d].push(b):a[d]=[a[d],b]:a[d]=b))});return a}function Cb(b){var a=
[];r(b,function(b,d){H(b)?r(b,function(b){a.push(Ba(d,!0)+(!0===b?"":"="+Ba(b,!0)))}):a.push(Ba(d,!0)+(!0===b?"":"="+Ba(b,!0)))});return a.length?a.join("&"):""}function jb(b){return Ba(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Ba(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,a?"%20":"+")}function Xc(b,a){function c(a){a&&d.push(a)}var d=[b],e,f,g=["ng:app","ng-app","x-ng-app",
"data-ng-app"],k=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;r(g,function(a){g[a]=!0;c(X.getElementById(a));a=a.replace(":","\\:");b.querySelectorAll&&(r(b.querySelectorAll("."+a),c),r(b.querySelectorAll("."+a+"\\:"),c),r(b.querySelectorAll("["+a+"]"),c))});r(d,function(a){if(!e){var b=k.exec(" "+a.className+" ");b?(e=a,f=(b[2]||"").replace(/\s+/g,",")):r(a.attributes,function(b){!e&&g[b.name]&&(e=a,f=b.value)})}});e&&a(e,f?[f]:[])}function fc(b,a){var c=function(){b=u(b);if(b.injector()){var c=b[0]===X?
"document":ha(b);throw Sa("btstrpd",c.replace(/</,"&lt;").replace(/>/,"&gt;"));}a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);a.unshift("ng");c=gc(a);c.invoke(["$rootScope","$rootElement","$compile","$injector","$animate",function(a,b,c,d,e){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},d=/^NG_DEFER_BOOTSTRAP!/;if(Q&&!d.test(Q.name))return c();Q.name=Q.name.replace(d,"");Ua.resumeBootstrap=function(b){r(b,function(b){a.push(b)});c()}}function kb(b,a){a=
a||"_";return b.replace(Yc,function(b,d){return(d?a:"")+b.toLowerCase()})}function Db(b,a,c){if(!b)throw Sa("areq",a||"?",c||"required");return b}function Va(b,a,c){c&&H(b)&&(b=b[b.length-1]);Db(P(b),a,"not a function, got "+(b&&"object"===typeof b?b.constructor.name||"Object":typeof b));return b}function Ca(b,a){if("hasOwnProperty"===b)throw Sa("badname",a);}function hc(b,a,c){if(!a)return b;a=a.split(".");for(var d,e=b,f=a.length,g=0;g<f;g++)d=a[g],b&&(b=(e=b)[d]);return!c&&P(b)?Bb(e,b):b}function Eb(b){var a=
b[0];b=b[b.length-1];if(a===b)return u(a);var c=[a];do{a=a.nextSibling;if(!a)break;c.push(a)}while(a!==b);return u(c)}function Zc(b){var a=x("$injector"),c=x("ng");b=b.angular||(b.angular={});b.$$minErr=b.$$minErr||x;return b.module||(b.module=function(){var b={};return function(e,f,g){if("hasOwnProperty"===e)throw c("badname","module");f&&b.hasOwnProperty(e)&&(b[e]=null);return b[e]||(b[e]=function(){function b(a,d,e){return function(){c[e||"push"]([a,d,arguments]);return n}}if(!f)throw a("nomod",
e);var c=[],d=[],l=b("$injector","invoke"),n={_invokeQueue:c,_runBlocks:d,requires:f,name:e,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:b("$provide","value"),constant:b("$provide","constant","unshift"),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider","register"),directive:b("$compileProvider","directive"),config:l,run:function(a){d.push(a);return this}};g&&l(g);return n}())}}())}
function $c(b){B(b,{bootstrap:fc,copy:Ha,extend:B,equals:za,element:u,forEach:r,injector:gc,noop:y,bind:Bb,toJson:ta,fromJson:cc,identity:Ga,isUndefined:D,isDefined:A,isString:z,isFunction:P,isObject:T,isNumber:Ab,isElement:Uc,isArray:H,version:ad,isDate:sa,lowercase:N,uppercase:Ia,callbacks:{counter:0},$$minErr:x,$$csp:Wa});Xa=Zc(Q);try{Xa("ngLocale")}catch(a){Xa("ngLocale",[]).provider("$locale",bd)}Xa("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:cd});a.provider("$compile",
ic).directive({a:dd,input:jc,textarea:jc,form:ed,script:fd,select:gd,style:hd,option:id,ngBind:jd,ngBindHtml:kd,ngBindTemplate:ld,ngClass:md,ngClassEven:nd,ngClassOdd:od,ngCloak:pd,ngController:qd,ngForm:rd,ngHide:sd,ngIf:td,ngInclude:ud,ngInit:vd,ngNonBindable:wd,ngPluralize:xd,ngRepeat:yd,ngShow:zd,ngStyle:Ad,ngSwitch:Bd,ngSwitchWhen:Cd,ngSwitchDefault:Dd,ngOptions:Ed,ngTransclude:Fd,ngModel:Gd,ngList:Hd,ngChange:Id,required:kc,ngRequired:kc,ngValue:Jd}).directive({ngInclude:Kd}).directive(Fb).directive(lc);
a.provider({$anchorScroll:Ld,$animate:Md,$browser:Nd,$cacheFactory:Od,$controller:Pd,$document:Qd,$exceptionHandler:Rd,$filter:mc,$interpolate:Sd,$interval:Td,$http:Ud,$httpBackend:Vd,$location:Wd,$log:Xd,$parse:Yd,$rootScope:Zd,$q:$d,$sce:ae,$sceDelegate:be,$sniffer:ce,$templateCache:de,$timeout:ee,$window:fe,$$rAF:ge,$$asyncCallback:he})}])}function Ya(b){return b.replace(ie,function(a,b,d,e){return e?d.toUpperCase():d}).replace(je,"Moz$1")}function Gb(b,a,c,d){function e(b){var e=c&&b?[this.filter(b)]:
[this],m=a,h,l,n,p,q,s;if(!d||null!=b)for(;e.length;)for(h=e.shift(),l=0,n=h.length;l<n;l++)for(p=u(h[l]),m?p.triggerHandler("$destroy"):m=!m,q=0,p=(s=p.children()).length;q<p;q++)e.push(Da(s[q]));return f.apply(this,arguments)}var f=Da.fn[b],f=f.$original||f;e.$original=f;Da.fn[b]=e}function S(b){if(b instanceof S)return b;z(b)&&(b=aa(b));if(!(this instanceof S)){if(z(b)&&"<"!=b.charAt(0))throw Hb("nosel");return new S(b)}if(z(b)){var a=b;b=X;var c;if(c=ke.exec(a))b=[b.createElement(c[1])];else{var d=
b,e;b=d.createDocumentFragment();c=[];if(Ib.test(a)){d=b.appendChild(d.createElement("div"));e=(le.exec(a)||["",""])[1].toLowerCase();e=ba[e]||ba._default;d.innerHTML="<div>&#160;</div>"+e[1]+a.replace(me,"<$1></$2>")+e[2];d.removeChild(d.firstChild);for(a=e[0];a--;)d=d.lastChild;a=0;for(e=d.childNodes.length;a<e;++a)c.push(d.childNodes[a]);d=b.firstChild;d.textContent=""}else c.push(d.createTextNode(a));b.textContent="";b.innerHTML="";b=c}Jb(this,b);u(X.createDocumentFragment()).append(this)}else Jb(this,
b)}function Kb(b){return b.cloneNode(!0)}function Ja(b){Lb(b);var a=0;for(b=b.childNodes||[];a<b.length;a++)Ja(b[a])}function nc(b,a,c,d){if(A(d))throw Hb("offargs");var e=ma(b,"events");ma(b,"handle")&&(D(a)?r(e,function(a,c){Za(b,c,a);delete e[c]}):r(a.split(" "),function(a){D(c)?(Za(b,a,e[a]),delete e[a]):Ra(e[a]||[],c)}))}function Lb(b,a){var c=b.ng339,d=$a[c];d&&(a?delete $a[c].data[a]:(d.handle&&(d.events.$destroy&&d.handle({},"$destroy"),nc(b)),delete $a[c],b.ng339=t))}function ma(b,a,c){var d=
b.ng339,d=$a[d||-1];if(A(c))d||(b.ng339=d=++ne,d=$a[d]={}),d[a]=c;else return d&&d[a]}function Mb(b,a,c){var d=ma(b,"data"),e=A(c),f=!e&&A(a),g=f&&!T(a);d||g||ma(b,"data",d={});if(e)d[a]=c;else if(f){if(g)return d&&d[a];B(d,a)}else return d}function Nb(b,a){return b.getAttribute?-1<(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+a+" "):!1}function lb(b,a){a&&b.setAttribute&&r(a.split(" "),function(a){b.setAttribute("class",aa((" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g,
" ").replace(" "+aa(a)+" "," ")))})}function mb(b,a){if(a&&b.setAttribute){var c=(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");r(a.split(" "),function(a){a=aa(a);-1===c.indexOf(" "+a+" ")&&(c+=a+" ")});b.setAttribute("class",aa(c))}}function Jb(b,a){if(a){a=a.nodeName||!A(a.length)||Fa(a)?[a]:a;for(var c=0;c<a.length;c++)b.push(a[c])}}function oc(b,a){return nb(b,"$"+(a||"ngController")+"Controller")}function nb(b,a,c){9==b.nodeType&&(b=b.documentElement);for(a=H(a)?a:[a];b;){for(var d=
0,e=a.length;d<e;d++)if((c=u.data(b,a[d]))!==t)return c;b=b.parentNode||11===b.nodeType&&b.host}}function pc(b){for(var a=0,c=b.childNodes;a<c.length;a++)Ja(c[a]);for(;b.firstChild;)b.removeChild(b.firstChild)}function qc(b,a){var c=ob[a.toLowerCase()];return c&&rc[b.nodeName]&&c}function oe(b,a){var c=function(c,e){c.preventDefault||(c.preventDefault=function(){c.returnValue=!1});c.stopPropagation||(c.stopPropagation=function(){c.cancelBubble=!0});c.target||(c.target=c.srcElement||X);if(D(c.defaultPrevented)){var f=
c.preventDefault;c.preventDefault=function(){c.defaultPrevented=!0;f.call(c)};c.defaultPrevented=!1}c.isDefaultPrevented=function(){return c.defaultPrevented||!1===c.returnValue};var g=ga(a[e||c.type]||[]);r(g,function(a){a.call(b,c)});8>=R?(c.preventDefault=null,c.stopPropagation=null,c.isDefaultPrevented=null):(delete c.preventDefault,delete c.stopPropagation,delete c.isDefaultPrevented)};c.elem=b;return c}function Ka(b,a){var c=typeof b,d;"function"==c||"object"==c&&null!==b?"function"==typeof(d=
b.$$hashKey)?d=b.$$hashKey():d===t&&(d=b.$$hashKey=(a||gb)()):d=b;return c+":"+d}function ab(b,a){if(a){var c=0;this.nextUid=function(){return++c}}r(b,this.put,this)}function sc(b){var a,c;"function"===typeof b?(a=b.$inject)||(a=[],b.length&&(c=b.toString().replace(pe,""),c=c.match(qe),r(c[1].split(re),function(b){b.replace(se,function(b,c,d){a.push(d)})})),b.$inject=a):H(b)?(c=b.length-1,Va(b[c],"fn"),a=b.slice(0,c)):Va(b,"fn",!0);return a}function gc(b){function a(a){return function(b,c){if(T(b))r(b,
$b(a));else return a(b,c)}}function c(a,b){Ca(a,"service");if(P(b)||H(b))b=n.instantiate(b);if(!b.$get)throw bb("pget",a);return l[a+k]=b}function d(a,b){return c(a,{$get:b})}function e(a){var b=[],c,d,f,k;r(a,function(a){if(!h.get(a)){h.put(a,!0);try{if(z(a))for(c=Xa(a),b=b.concat(e(c.requires)).concat(c._runBlocks),d=c._invokeQueue,f=0,k=d.length;f<k;f++){var g=d[f],m=n.get(g[0]);m[g[1]].apply(m,g[2])}else P(a)?b.push(n.invoke(a)):H(a)?b.push(n.invoke(a)):Va(a,"module")}catch(l){throw H(a)&&(a=
a[a.length-1]),l.message&&(l.stack&&-1==l.stack.indexOf(l.message))&&(l=l.message+"\n"+l.stack),bb("modulerr",a,l.stack||l.message||l);}}});return b}function f(a,b){function c(d){if(a.hasOwnProperty(d)){if(a[d]===g)throw bb("cdep",d+" <- "+m.join(" <- "));return a[d]}try{return m.unshift(d),a[d]=g,a[d]=b(d)}catch(e){throw a[d]===g&&delete a[d],e;}finally{m.shift()}}function d(a,b,e){var f=[],k=sc(a),g,m,h;m=0;for(g=k.length;m<g;m++){h=k[m];if("string"!==typeof h)throw bb("itkn",h);f.push(e&&e.hasOwnProperty(h)?
e[h]:c(h))}H(a)&&(a=a[g]);return a.apply(b,f)}return{invoke:d,instantiate:function(a,b){var c=function(){},e;c.prototype=(H(a)?a[a.length-1]:a).prototype;c=new c;e=d(a,c,b);return T(e)||P(e)?e:c},get:c,annotate:sc,has:function(b){return l.hasOwnProperty(b+k)||a.hasOwnProperty(b)}}}var g={},k="Provider",m=[],h=new ab([],!0),l={$provide:{provider:a(c),factory:a(d),service:a(function(a,b){return d(a,["$injector",function(a){return a.instantiate(b)}])}),value:a(function(a,b){return d(a,$(b))}),constant:a(function(a,
b){Ca(a,"constant");l[a]=b;p[a]=b}),decorator:function(a,b){var c=n.get(a+k),d=c.$get;c.$get=function(){var a=q.invoke(d,c);return q.invoke(b,null,{$delegate:a})}}}},n=l.$injector=f(l,function(){throw bb("unpr",m.join(" <- "));}),p={},q=p.$injector=f(p,function(a){a=n.get(a+k);return q.invoke(a.$get,a)});r(e(b),function(a){q.invoke(a||y)});return q}function Ld(){var b=!0;this.disableAutoScrolling=function(){b=!1};this.$get=["$window","$location","$rootScope",function(a,c,d){function e(a){var b=null;
r(a,function(a){b||"a"!==N(a.nodeName)||(b=a)});return b}function f(){var b=c.hash(),d;b?(d=g.getElementById(b))?d.scrollIntoView():(d=e(g.getElementsByName(b)))?d.scrollIntoView():"top"===b&&a.scrollTo(0,0):a.scrollTo(0,0)}var g=a.document;b&&d.$watch(function(){return c.hash()},function(){d.$evalAsync(f)});return f}]}function he(){this.$get=["$$rAF","$timeout",function(b,a){return b.supported?function(a){return b(a)}:function(b){return a(b,0,!1)}}]}function te(b,a,c,d){function e(a){try{a.apply(null,
Aa.call(arguments,1))}finally{if(s--,0===s)for(;L.length;)try{L.pop()()}catch(b){c.error(b)}}}function f(a,b){(function ca(){r(v,function(a){a()});C=b(ca,a)})()}function g(){w=null;O!=k.url()&&(O=k.url(),r(da,function(a){a(k.url())}))}var k=this,m=a[0],h=b.location,l=b.history,n=b.setTimeout,p=b.clearTimeout,q={};k.isMock=!1;var s=0,L=[];k.$$completeOutstandingRequest=e;k.$$incOutstandingRequestCount=function(){s++};k.notifyWhenNoOutstandingRequests=function(a){r(v,function(a){a()});0===s?a():L.push(a)};
var v=[],C;k.addPollFn=function(a){D(C)&&f(100,n);v.push(a);return a};var O=h.href,I=a.find("base"),w=null;k.url=function(a,c){h!==b.location&&(h=b.location);l!==b.history&&(l=b.history);if(a){if(O!=a)return O=a,d.history?c?l.replaceState(null,"",a):(l.pushState(null,"",a),I.attr("href",I.attr("href"))):(w=a,c?h.replace(a):h.href=a),k}else return w||h.href.replace(/%27/g,"'")};var da=[],K=!1;k.onUrlChange=function(a){if(!K){if(d.history)u(b).on("popstate",g);if(d.hashchange)u(b).on("hashchange",g);
else k.addPollFn(g);K=!0}da.push(a);return a};k.baseHref=function(){var a=I.attr("href");return a?a.replace(/^(https?\:)?\/\/[^\/]*/,""):""};var W={},ea="",J=k.baseHref();k.cookies=function(a,b){var d,e,f,k;if(a)b===t?m.cookie=escape(a)+"=;path="+J+";expires=Thu, 01 Jan 1970 00:00:00 GMT":z(b)&&(d=(m.cookie=escape(a)+"="+escape(b)+";path="+J).length+1,4096<d&&c.warn("Cookie '"+a+"' possibly not set or overflowed because it was too large ("+d+" > 4096 bytes)!"));else{if(m.cookie!==ea)for(ea=m.cookie,
d=ea.split("; "),W={},f=0;f<d.length;f++)e=d[f],k=e.indexOf("="),0<k&&(a=unescape(e.substring(0,k)),W[a]===t&&(W[a]=unescape(e.substring(k+1))));return W}};k.defer=function(a,b){var c;s++;c=n(function(){delete q[c];e(a)},b||0);q[c]=!0;return c};k.defer.cancel=function(a){return q[a]?(delete q[a],p(a),e(y),!0):!1}}function Nd(){this.$get=["$window","$log","$sniffer","$document",function(b,a,c,d){return new te(b,d,a,c)}]}function Od(){this.$get=function(){function b(b,d){function e(a){a!=n&&(p?p==a&&
(p=a.n):p=a,f(a.n,a.p),f(a,n),n=a,n.n=null)}function f(a,b){a!=b&&(a&&(a.p=b),b&&(b.n=a))}if(b in a)throw x("$cacheFactory")("iid",b);var g=0,k=B({},d,{id:b}),m={},h=d&&d.capacity||Number.MAX_VALUE,l={},n=null,p=null;return a[b]={put:function(a,b){if(h<Number.MAX_VALUE){var c=l[a]||(l[a]={key:a});e(c)}if(!D(b))return a in m||g++,m[a]=b,g>h&&this.remove(p.key),b},get:function(a){if(h<Number.MAX_VALUE){var b=l[a];if(!b)return;e(b)}return m[a]},remove:function(a){if(h<Number.MAX_VALUE){var b=l[a];if(!b)return;
b==n&&(n=b.p);b==p&&(p=b.n);f(b.n,b.p);delete l[a]}delete m[a];g--},removeAll:function(){m={};g=0;l={};n=p=null},destroy:function(){l=k=m=null;delete a[b]},info:function(){return B({},k,{size:g})}}}var a={};b.info=function(){var b={};r(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]};return b}}function de(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function ic(b,a){var c={},d="Directive",e=/^\s*directive\:\s*([\d\w_\-]+)\s+(.*)$/,f=/(([\d\w_\-]+)(?:\:([^;]+))?;?)/,
g=/^(on[a-z]+|formaction)$/;this.directive=function m(a,e){Ca(a,"directive");z(a)?(Db(e,"directiveFactory"),c.hasOwnProperty(a)||(c[a]=[],b.factory(a+d,["$injector","$exceptionHandler",function(b,d){var e=[];r(c[a],function(c,f){try{var g=b.invoke(c);P(g)?g={compile:$(g)}:!g.compile&&g.link&&(g.compile=$(g.link));g.priority=g.priority||0;g.index=f;g.name=g.name||a;g.require=g.require||g.controller&&g.name;g.restrict=g.restrict||"A";e.push(g)}catch(m){d(m)}});return e}])),c[a].push(e)):r(a,$b(m));
return this};this.aHrefSanitizationWhitelist=function(b){return A(b)?(a.aHrefSanitizationWhitelist(b),this):a.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(b){return A(b)?(a.imgSrcSanitizationWhitelist(b),this):a.imgSrcSanitizationWhitelist()};this.$get=["$injector","$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope","$document","$sce","$animate","$$sanitizeUri",function(a,b,l,n,p,q,s,L,v,C,O,I){function w(a,b,c,d,e){a instanceof
u||(a=u(a));r(a,function(b,c){3==b.nodeType&&b.nodeValue.match(/\S+/)&&(a[c]=u(b).wrap("<span></span>").parent()[0])});var f=K(a,b,a,c,d,e);da(a,"ng-scope");return function(b,c,d,e){Db(b,"scope");var g=c?La.clone.call(a):a;r(d,function(a,b){g.data("$"+b+"Controller",a)});d=0;for(var m=g.length;d<m;d++){var h=g[d].nodeType;1!==h&&9!==h||g.eq(d).data("$scope",b)}c&&c(g,b);f&&f(b,g,g,e);return g}}function da(a,b){try{a.addClass(b)}catch(c){}}function K(a,b,c,d,e,f){function g(a,c,d,e){var f,h,l,q,n,
p,s;f=c.length;var M=Array(f);for(q=0;q<f;q++)M[q]=c[q];p=q=0;for(n=m.length;q<n;p++)h=M[p],c=m[q++],f=m[q++],c?(c.scope?(l=a.$new(),u.data(h,"$scope",l)):l=a,s=c.transcludeOnThisElement?W(a,c.transclude,e):!c.templateOnThisElement&&e?e:!e&&b?W(a,b):null,c(f,l,h,d,s)):f&&f(a,h.childNodes,t,e)}for(var m=[],h,l,q,n,p=0;p<a.length;p++)h=new Ob,l=ea(a[p],[],h,0===p?d:t,e),(f=l.length?F(l,a[p],h,b,c,null,[],[],f):null)&&f.scope&&da(h.$$element,"ng-scope"),h=f&&f.terminal||!(q=a[p].childNodes)||!q.length?
null:K(q,f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b),m.push(f,h),n=n||f||h,f=null;return n?g:null}function W(a,b,c){return function(d,e,f){var g=!1;d||(d=a.$new(),g=d.$$transcluded=!0);e=b(d,e,f,c);if(g)e.on("$destroy",function(){d.$destroy()});return e}}function ea(a,b,c,d,g){var h=c.$attr,m;switch(a.nodeType){case 1:ca(b,na(Ma(a).toLowerCase()),"E",d,g);for(var l,q,n,p=a.attributes,s=0,L=p&&p.length;s<L;s++){var C=!1,O=!1;l=p[s];if(!R||8<=R||l.specified){m=l.name;q=
aa(l.value);l=na(m);if(n=V.test(l))m=kb(l.substr(6),"-");var v=l.replace(/(Start|End)$/,"");l===v+"Start"&&(C=m,O=m.substr(0,m.length-5)+"end",m=m.substr(0,m.length-6));l=na(m.toLowerCase());h[l]=m;if(n||!c.hasOwnProperty(l))c[l]=q,qc(a,l)&&(c[l]=!0);Q(a,b,q,l);ca(b,l,"A",d,g,C,O)}}a=a.className;if(z(a)&&""!==a)for(;m=f.exec(a);)l=na(m[2]),ca(b,l,"C",d,g)&&(c[l]=aa(m[3])),a=a.substr(m.index+m[0].length);break;case 3:x(b,a.nodeValue);break;case 8:try{if(m=e.exec(a.nodeValue))l=na(m[1]),ca(b,l,"M",
d,g)&&(c[l]=aa(m[2]))}catch(w){}}b.sort(D);return b}function J(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw ia("uterdir",b,c);1==a.nodeType&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return u(d)}function E(a,b,c){return function(d,e,f,g,m){e=J(e[0],b,c);return a(d,e,f,g,m)}}function F(a,c,d,e,f,g,m,n,p){function L(a,b,c,d){if(a){c&&(a=E(a,c,d));a.require=G.require;a.directiveName=oa;if(K===G||G.$$isolateScope)a=
tc(a,{isolateScope:!0});m.push(a)}if(b){c&&(b=E(b,c,d));b.require=G.require;b.directiveName=oa;if(K===G||G.$$isolateScope)b=tc(b,{isolateScope:!0});n.push(b)}}function C(a,b,c,d){var e,f="data",g=!1;if(z(b)){for(;"^"==(e=b.charAt(0))||"?"==e;)b=b.substr(1),"^"==e&&(f="inheritedData"),g=g||"?"==e;e=null;d&&"data"===f&&(e=d[b]);e=e||c[f]("$"+b+"Controller");if(!e&&!g)throw ia("ctreq",b,a);}else H(b)&&(e=[],r(b,function(b){e.push(C(a,b,c,d))}));return e}function O(a,e,f,g,p){function L(a,b){var c;2>
arguments.length&&(b=a,a=t);Ea&&(c=ea);return p(a,b,c)}var v,M,w,I,E,J,ea={},qb;v=c===f?d:ga(d,new Ob(u(f),d.$attr));M=v.$$element;if(K){var Na=/^\s*([@=&])(\??)\s*(\w*)\s*$/;J=e.$new(!0);!F||F!==K&&F!==K.$$originalDirective?M.data("$isolateScopeNoTemplate",J):M.data("$isolateScope",J);da(M,"ng-isolate-scope");r(K.scope,function(a,c){var d=a.match(Na)||[],f=d[3]||c,g="?"==d[2],d=d[1],m,l,n,p;J.$$isolateBindings[c]=d+f;switch(d){case "@":v.$observe(f,function(a){J[c]=a});v.$$observers[f].$$scope=e;
v[f]&&(J[c]=b(v[f])(e));break;case "=":if(g&&!v[f])break;l=q(v[f]);p=l.literal?za:function(a,b){return a===b||a!==a&&b!==b};n=l.assign||function(){m=J[c]=l(e);throw ia("nonassign",v[f],K.name);};m=J[c]=l(e);J.$watch(function(){var a=l(e);p(a,J[c])||(p(a,m)?n(e,a=J[c]):J[c]=a);return m=a},null,l.literal);break;case "&":l=q(v[f]);J[c]=function(a){return l(e,a)};break;default:throw ia("iscp",K.name,c,a);}})}qb=p&&L;W&&r(W,function(a){var b={$scope:a===K||a.$$isolateScope?J:e,$element:M,$attrs:v,$transclude:qb},
c;E=a.controller;"@"==E&&(E=v[a.name]);c=s(E,b);ea[a.name]=c;Ea||M.data("$"+a.name+"Controller",c);a.controllerAs&&(b.$scope[a.controllerAs]=c)});g=0;for(w=m.length;g<w;g++)try{I=m[g],I(I.isolateScope?J:e,M,v,I.require&&C(I.directiveName,I.require,M,ea),qb)}catch(ca){l(ca,ha(M))}g=e;K&&(K.template||null===K.templateUrl)&&(g=J);a&&a(g,f.childNodes,t,p);for(g=n.length-1;0<=g;g--)try{I=n[g],I(I.isolateScope?J:e,M,v,I.require&&C(I.directiveName,I.require,M,ea),qb)}catch(pb){l(pb,ha(M))}}p=p||{};for(var v=
-Number.MAX_VALUE,I,W=p.controllerDirectives,K=p.newIsolateScopeDirective,F=p.templateDirective,ca=p.nonTlbTranscludeDirective,D=!1,B=!1,Ea=p.hasElementTranscludeDirective,x=d.$$element=u(c),G,oa,U,S=e,R,Q=0,pa=a.length;Q<pa;Q++){G=a[Q];var V=G.$$start,Y=G.$$end;V&&(x=J(c,V,Y));U=t;if(v>G.priority)break;if(U=G.scope)I=I||G,G.templateUrl||(N("new/isolated scope",K,G,x),T(U)&&(K=G));oa=G.name;!G.templateUrl&&G.controller&&(U=G.controller,W=W||{},N("'"+oa+"' controller",W[oa],G,x),W[oa]=G);if(U=G.transclude)D=
!0,G.$$tlb||(N("transclusion",ca,G,x),ca=G),"element"==U?(Ea=!0,v=G.priority,U=x,x=d.$$element=u(X.createComment(" "+oa+": "+d[oa]+" ")),c=x[0],Na(f,Aa.call(U,0),c),S=w(U,e,v,g&&g.name,{nonTlbTranscludeDirective:ca})):(U=u(Kb(c)).contents(),x.empty(),S=w(U,e));if(G.template)if(B=!0,N("template",F,G,x),F=G,U=P(G.template)?G.template(x,d):G.template,U=Z(U),G.replace){g=G;U=Ib.test(U)?u(aa(U)):[];c=U[0];if(1!=U.length||1!==c.nodeType)throw ia("tplrt",oa,"");Na(f,x,c);pa={$attr:{}};U=ea(c,[],pa);var $=
a.splice(Q+1,a.length-(Q+1));K&&pb(U);a=a.concat(U).concat($);A(d,pa);pa=a.length}else x.html(U);if(G.templateUrl)B=!0,N("template",F,G,x),F=G,G.replace&&(g=G),O=y(a.splice(Q,a.length-Q),x,d,f,D&&S,m,n,{controllerDirectives:W,newIsolateScopeDirective:K,templateDirective:F,nonTlbTranscludeDirective:ca}),pa=a.length;else if(G.compile)try{R=G.compile(x,d,S),P(R)?L(null,R,V,Y):R&&L(R.pre,R.post,V,Y)}catch(ba){l(ba,ha(x))}G.terminal&&(O.terminal=!0,v=Math.max(v,G.priority))}O.scope=I&&!0===I.scope;O.transcludeOnThisElement=
D;O.templateOnThisElement=B;O.transclude=S;p.hasElementTranscludeDirective=Ea;return O}function pb(a){for(var b=0,c=a.length;b<c;b++)a[b]=bc(a[b],{$$isolateScope:!0})}function ca(b,e,f,g,h,q,n){if(e===h)return null;h=null;if(c.hasOwnProperty(e)){var p;e=a.get(e+d);for(var s=0,v=e.length;s<v;s++)try{p=e[s],(g===t||g>p.priority)&&-1!=p.restrict.indexOf(f)&&(q&&(p=bc(p,{$$start:q,$$end:n})),b.push(p),h=p)}catch(L){l(L)}}return h}function A(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;r(a,function(d,e){"$"!=
e.charAt(0)&&(b[e]&&b[e]!==d&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});r(b,function(b,f){"class"==f?(da(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):"style"==f?(e.attr("style",e.attr("style")+";"+b),a.style=(a.style?a.style+";":"")+b):"$"==f.charAt(0)||a.hasOwnProperty(f)||(a[f]=b,d[f]=c[f])})}function y(a,b,c,d,e,f,g,m){var h=[],l,q,s=b[0],v=a.shift(),L=B({},v,{templateUrl:null,transclude:null,replace:null,$$originalDirective:v}),O=P(v.templateUrl)?v.templateUrl(b,c):v.templateUrl;
b.empty();n.get(C.getTrustedResourceUrl(O),{cache:p}).success(function(n){var p,C;n=Z(n);if(v.replace){n=Ib.test(n)?u(aa(n)):[];p=n[0];if(1!=n.length||1!==p.nodeType)throw ia("tplrt",v.name,O);n={$attr:{}};Na(d,b,p);var w=ea(p,[],n);T(v.scope)&&pb(w);a=w.concat(a);A(c,n)}else p=s,b.html(n);a.unshift(L);l=F(a,p,c,e,b,v,f,g,m);r(d,function(a,c){a==p&&(d[c]=b[0])});for(q=K(b[0].childNodes,e);h.length;){n=h.shift();C=h.shift();var I=h.shift(),E=h.shift(),w=b[0];if(C!==s){var J=C.className;m.hasElementTranscludeDirective&&
v.replace||(w=Kb(p));Na(I,u(C),w);da(u(w),J)}C=l.transcludeOnThisElement?W(n,l.transclude,E):E;l(q,n,w,d,C)}h=null}).error(function(a,b,c,d){throw ia("tpload",d.url);});return function(a,b,c,d,e){a=e;h?(h.push(b),h.push(c),h.push(d),h.push(a)):(l.transcludeOnThisElement&&(a=W(b,l.transclude,e)),l(q,b,c,d,a))}}function D(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function N(a,b,c,d){if(b)throw ia("multidir",b.name,c.name,a,ha(d));}function x(a,
c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){var b=a.parent().length;b&&da(a.parent(),"ng-binding");return function(a,c){var e=c.parent(),f=e.data("$binding")||[];f.push(d);e.data("$binding",f);b||da(e,"ng-binding");a.$watch(d,function(a){c[0].nodeValue=a})}}})}function S(a,b){if("srcdoc"==b)return C.HTML;var c=Ma(a);if("xlinkHref"==b||"FORM"==c&&"action"==b||"IMG"!=c&&("src"==b||"ngSrc"==b))return C.RESOURCE_URL}function Q(a,c,d,e){var f=b(d,!0);if(f){if("multiple"===e&&"SELECT"===
Ma(a))throw ia("selmulti",ha(a));c.push({priority:100,compile:function(){return{pre:function(c,d,m){d=m.$$observers||(m.$$observers={});if(g.test(e))throw ia("nodomevents");if(f=b(m[e],!0,S(a,e)))m[e]=f(c),(d[e]||(d[e]=[])).$$inter=!0,(m.$$observers&&m.$$observers[e].$$scope||c).$watch(f,function(a,b){"class"===e&&a!=b?m.$updateClass(a,b):m.$set(e,a)})}}}})}}function Na(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,m;if(a)for(g=0,m=a.length;g<m;g++)if(a[g]==d){a[g++]=c;m=g+e-1;for(var h=a.length;g<
h;g++,m++)m<h?a[g]=a[m]:delete a[g];a.length-=e-1;break}f&&f.replaceChild(c,d);a=X.createDocumentFragment();a.appendChild(d);c[u.expando]=d[u.expando];d=1;for(e=b.length;d<e;d++)f=b[d],u(f).remove(),a.appendChild(f),delete b[d];b[0]=c;b.length=1}function tc(a,b){return B(function(){return a.apply(null,arguments)},a,b)}var Ob=function(a,b){this.$$element=a;this.$attr=b||{}};Ob.prototype={$normalize:na,$addClass:function(a){a&&0<a.length&&O.addClass(this.$$element,a)},$removeClass:function(a){a&&0<
a.length&&O.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=uc(a,b),d=uc(b,a);0===c.length?O.removeClass(this.$$element,d):0===d.length?O.addClass(this.$$element,c):O.setClass(this.$$element,c,d)},$set:function(a,b,c,d){var e=qc(this.$$element[0],a);e&&(this.$$element.prop(a,b),d=e);this[a]=b;d?this.$attr[a]=d:(d=this.$attr[a])||(this.$attr[a]=d=kb(a,"-"));e=Ma(this.$$element);if("A"===e&&"href"===a||"IMG"===e&&"src"===a)this[a]=b=I(b,"src"===a);!1!==c&&(null===b||b===t?this.$$element.removeAttr(d):
this.$$element.attr(d,b));(c=this.$$observers)&&r(c[a],function(a){try{a(b)}catch(c){l(c)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers={}),e=d[a]||(d[a]=[]);e.push(b);L.$evalAsync(function(){e.$$inter||b(c[a])});return b}};var pa=b.startSymbol(),Ea=b.endSymbol(),Z="{{"==pa||"}}"==Ea?Ga:function(a){return a.replace(/\{\{/g,pa).replace(/}}/g,Ea)},V=/^ngAttr[A-Z]/;return w}]}function na(b){return Ya(b.replace(ue,""))}function uc(b,a){var c="",d=b.split(/\s+/),e=a.split(/\s+/),
f=0;a:for(;f<d.length;f++){for(var g=d[f],k=0;k<e.length;k++)if(g==e[k])continue a;c+=(0<c.length?" ":"")+g}return c}function Pd(){var b={},a=/^(\S+)(\s+as\s+(\w+))?$/;this.register=function(a,d){Ca(a,"controller");T(a)?B(b,a):b[a]=d};this.$get=["$injector","$window",function(c,d){return function(e,f){var g,k,m;z(e)&&(g=e.match(a),k=g[1],m=g[3],e=b.hasOwnProperty(k)?b[k]:hc(f.$scope,k,!0)||hc(d,k,!0),Va(e,k,!0));g=c.instantiate(e,f);if(m){if(!f||"object"!==typeof f.$scope)throw x("$controller")("noscp",
k||e.name,m);f.$scope[m]=g}return g}}]}function Qd(){this.$get=["$window",function(b){return u(b.document)}]}function Rd(){this.$get=["$log",function(b){return function(a,c){b.error.apply(b,arguments)}}]}function vc(b){var a={},c,d,e;if(!b)return a;r(b.split("\n"),function(b){e=b.indexOf(":");c=N(aa(b.substr(0,e)));d=aa(b.substr(e+1));c&&(a[c]=a[c]?a[c]+", "+d:d)});return a}function wc(b){var a=T(b)?b:t;return function(c){a||(a=vc(b));return c?a[N(c)]||null:a}}function xc(b,a,c){if(P(c))return c(b,
a);r(c,function(c){b=c(b,a)});return b}function Ud(){var b=/^\s*(\[|\{[^\{])/,a=/[\}\]]\s*$/,c=/^\)\]\}',?\n/,d={"Content-Type":"application/json;charset=utf-8"},e=this.defaults={transformResponse:[function(d){z(d)&&(d=d.replace(c,""),b.test(d)&&a.test(d)&&(d=cc(d)));return d}],transformRequest:[function(a){return T(a)&&"[object File]"!==ya.call(a)&&"[object Blob]"!==ya.call(a)?ta(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ga(d),put:ga(d),patch:ga(d)},xsrfCookieName:"XSRF-TOKEN",
xsrfHeaderName:"X-XSRF-TOKEN"},f=this.interceptors=[],g=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(a,b,c,d,n,p){function q(a){function b(a){var d=B({},a,{data:xc(a.data,a.headers,c.transformResponse)});return 200<=a.status&&300>a.status?d:n.reject(d)}var c={method:"get",transformRequest:e.transformRequest,transformResponse:e.transformResponse},d=function(a){var b=e.headers,c=B({},a.headers),d,f,b=B({},b.common,b[N(a.method)]);
a:for(d in b){a=N(d);for(f in c)if(N(f)===a)continue a;c[d]=b[d]}(function(a){var b;r(a,function(c,d){P(c)&&(b=c(),null!=b?a[d]=b:delete a[d])})})(c);return c}(a);B(c,a);c.headers=d;c.method=Ia(c.method);var f=[function(a){d=a.headers;var c=xc(a.data,wc(d),a.transformRequest);D(c)&&r(d,function(a,b){"content-type"===N(b)&&delete d[b]});D(a.withCredentials)&&!D(e.withCredentials)&&(a.withCredentials=e.withCredentials);return s(a,c,d).then(b,b)},t],g=n.when(c);for(r(C,function(a){(a.request||a.requestError)&&
f.unshift(a.request,a.requestError);(a.response||a.responseError)&&f.push(a.response,a.responseError)});f.length;){a=f.shift();var m=f.shift(),g=g.then(a,m)}g.success=function(a){g.then(function(b){a(b.data,b.status,b.headers,c)});return g};g.error=function(a){g.then(null,function(b){a(b.data,b.status,b.headers,c)});return g};return g}function s(c,f,g){function h(a,b,c,e){E&&(200<=a&&300>a?E.put(u,[a,b,vc(c),e]):E.remove(u));p(b,a,c,e);d.$$phase||d.$apply()}function p(a,b,d,e){b=Math.max(b,0);(200<=
b&&300>b?C.resolve:C.reject)({data:a,status:b,headers:wc(d),config:c,statusText:e})}function s(){var a=Qa(q.pendingRequests,c);-1!==a&&q.pendingRequests.splice(a,1)}var C=n.defer(),r=C.promise,E,F,u=L(c.url,c.params);q.pendingRequests.push(c);r.then(s,s);!c.cache&&!e.cache||(!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method)||(E=T(c.cache)?c.cache:T(e.cache)?e.cache:v);if(E)if(F=E.get(u),A(F)){if(F&&P(F.then))return F.then(s,s),F;H(F)?p(F[1],F[0],ga(F[2]),F[3]):p(F,200,{},"OK")}else E.put(u,r);D(F)&&
((F=Pb(c.url)?b.cookies()[c.xsrfCookieName||e.xsrfCookieName]:t)&&(g[c.xsrfHeaderName||e.xsrfHeaderName]=F),a(c.method,u,f,h,g,c.timeout,c.withCredentials,c.responseType));return r}function L(a,b){if(!b)return a;var c=[];Tc(b,function(a,b){null===a||D(a)||(H(a)||(a=[a]),r(a,function(a){T(a)&&(sa(a)?a=a.toISOString():T(a)&&(a=ta(a)));c.push(Ba(b)+"="+Ba(a))}))});0<c.length&&(a+=(-1==a.indexOf("?")?"?":"&")+c.join("&"));return a}var v=c("$http"),C=[];r(f,function(a){C.unshift(z(a)?p.get(a):p.invoke(a))});
r(g,function(a,b){var c=z(a)?p.get(a):p.invoke(a);C.splice(b,0,{response:function(a){return c(n.when(a))},responseError:function(a){return c(n.reject(a))}})});q.pendingRequests=[];(function(a){r(arguments,function(a){q[a]=function(b,c){return q(B(c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){r(arguments,function(a){q[a]=function(b,c,d){return q(B(d||{},{method:a,url:b,data:c}))}})})("post","put");q.defaults=e;return q}]}function ve(b){if(8>=R&&(!b.match(/^(get|post|head|put|delete|options)$/i)||
!Q.XMLHttpRequest))return new Q.ActiveXObject("Microsoft.XMLHTTP");if(Q.XMLHttpRequest)return new Q.XMLHttpRequest;throw x("$httpBackend")("noxhr");}function Vd(){this.$get=["$browser","$window","$document",function(b,a,c){return we(b,ve,b.defer,a.angular.callbacks,c[0])}]}function we(b,a,c,d,e){function f(a,b,c){var f=e.createElement("script"),g=null;f.type="text/javascript";f.src=a;f.async=!0;g=function(a){Za(f,"load",g);Za(f,"error",g);e.body.removeChild(f);f=null;var k=-1,s="unknown";a&&("load"!==
a.type||d[b].called||(a={type:"error"}),s=a.type,k="error"===a.type?404:200);c&&c(k,s)};rb(f,"load",g);rb(f,"error",g);8>=R&&(f.onreadystatechange=function(){z(f.readyState)&&/loaded|complete/.test(f.readyState)&&(f.onreadystatechange=null,g({type:"load"}))});e.body.appendChild(f);return g}var g=-1;return function(e,m,h,l,n,p,q,s){function L(){C=g;I&&I();w&&w.abort()}function v(a,d,e,f,g){K&&c.cancel(K);I=w=null;0===d&&(d=e?200:"file"==ua(m).protocol?404:0);a(1223===d?204:d,e,f,g||"");b.$$completeOutstandingRequest(y)}
var C;b.$$incOutstandingRequestCount();m=m||b.url();if("jsonp"==N(e)){var O="_"+(d.counter++).toString(36);d[O]=function(a){d[O].data=a;d[O].called=!0};var I=f(m.replace("JSON_CALLBACK","angular.callbacks."+O),O,function(a,b){v(l,a,d[O].data,"",b);d[O]=y})}else{var w=a(e);w.open(e,m,!0);r(n,function(a,b){A(a)&&w.setRequestHeader(b,a)});w.onreadystatechange=function(){if(w&&4==w.readyState){var a=null,b=null,c="";C!==g&&(a=w.getAllResponseHeaders(),b="response"in w?w.response:w.responseText);C===g&&
10>R||(c=w.statusText);v(l,C||w.status,b,a,c)}};q&&(w.withCredentials=!0);if(s)try{w.responseType=s}catch(da){if("json"!==s)throw da;}w.send(h||null)}if(0<p)var K=c(L,p);else p&&P(p.then)&&p.then(L)}}function Sd(){var b="{{",a="}}";this.startSymbol=function(a){return a?(b=a,this):b};this.endSymbol=function(b){return b?(a=b,this):a};this.$get=["$parse","$exceptionHandler","$sce",function(c,d,e){function f(f,h,l){for(var n,p,q=0,s=[],L=f.length,v=!1,C=[];q<L;)-1!=(n=f.indexOf(b,q))&&-1!=(p=f.indexOf(a,
n+g))?(q!=n&&s.push(f.substring(q,n)),s.push(q=c(v=f.substring(n+g,p))),q.exp=v,q=p+k,v=!0):(q!=L&&s.push(f.substring(q)),q=L);(L=s.length)||(s.push(""),L=1);if(l&&1<s.length)throw yc("noconcat",f);if(!h||v)return C.length=L,q=function(a){try{for(var b=0,c=L,g;b<c;b++){if("function"==typeof(g=s[b]))if(g=g(a),g=l?e.getTrusted(l,g):e.valueOf(g),null==g)g="";else switch(typeof g){case "string":break;case "number":g=""+g;break;default:g=ta(g)}C[b]=g}return C.join("")}catch(k){a=yc("interr",f,k.toString()),
d(a)}},q.exp=f,q.parts=s,q}var g=b.length,k=a.length;f.startSymbol=function(){return b};f.endSymbol=function(){return a};return f}]}function Td(){this.$get=["$rootScope","$window","$q",function(b,a,c){function d(d,g,k,m){var h=a.setInterval,l=a.clearInterval,n=c.defer(),p=n.promise,q=0,s=A(m)&&!m;k=A(k)?k:0;p.then(null,null,d);p.$$intervalId=h(function(){n.notify(q++);0<k&&q>=k&&(n.resolve(q),l(p.$$intervalId),delete e[p.$$intervalId]);s||b.$apply()},g);e[p.$$intervalId]=n;return p}var e={};d.cancel=
function(b){return b&&b.$$intervalId in e?(e[b.$$intervalId].reject("canceled"),a.clearInterval(b.$$intervalId),delete e[b.$$intervalId],!0):!1};return d}]}function bd(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January February March April May June July August September October November December".split(" "),
SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(b){return 1===b?"one":"other"}}}}function Qb(b){b=b.split("/");for(var a=b.length;a--;)b[a]=
jb(b[a]);return b.join("/")}function zc(b,a,c){b=ua(b,c);a.$$protocol=b.protocol;a.$$host=b.hostname;a.$$port=Z(b.port)||xe[b.protocol]||null}function Ac(b,a,c){var d="/"!==b.charAt(0);d&&(b="/"+b);b=ua(b,c);a.$$path=decodeURIComponent(d&&"/"===b.pathname.charAt(0)?b.pathname.substring(1):b.pathname);a.$$search=ec(b.search);a.$$hash=decodeURIComponent(b.hash);a.$$path&&"/"!=a.$$path.charAt(0)&&(a.$$path="/"+a.$$path)}function qa(b,a){if(0===a.indexOf(b))return a.substr(b.length)}function cb(b){var a=
b.indexOf("#");return-1==a?b:b.substr(0,a)}function Rb(b){return b.substr(0,cb(b).lastIndexOf("/")+1)}function Bc(b,a){this.$$html5=!0;a=a||"";var c=Rb(b);zc(b,this,b);this.$$parse=function(a){var e=qa(c,a);if(!z(e))throw Sb("ipthprfx",a,c);Ac(e,this,b);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=Cb(this.$$search),b=this.$$hash?"#"+jb(this.$$hash):"";this.$$url=Qb(this.$$path)+(a?"?"+a:"")+b;this.$$absUrl=c+this.$$url.substr(1)};this.$$rewrite=function(d){var e;
if((e=qa(b,d))!==t)return d=e,(e=qa(a,e))!==t?c+(qa("/",e)||e):b+d;if((e=qa(c,d))!==t)return c+e;if(c==d+"/")return c}}function Tb(b,a){var c=Rb(b);zc(b,this,b);this.$$parse=function(d){var e=qa(b,d)||qa(c,d),e="#"==e.charAt(0)?qa(a,e):this.$$html5?e:"";if(!z(e))throw Sb("ihshprfx",d,a);Ac(e,this,b);d=this.$$path;var f=/^\/[A-Z]:(\/.*)/;0===e.indexOf(b)&&(e=e.replace(b,""));f.exec(e)||(d=(e=f.exec(d))?e[1]:d);this.$$path=d;this.$$compose()};this.$$compose=function(){var c=Cb(this.$$search),e=this.$$hash?
"#"+jb(this.$$hash):"";this.$$url=Qb(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+(this.$$url?a+this.$$url:"")};this.$$rewrite=function(a){if(cb(b)==cb(a))return a}}function Ub(b,a){this.$$html5=!0;Tb.apply(this,arguments);var c=Rb(b);this.$$rewrite=function(d){var e;if(b==cb(d))return d;if(e=qa(c,d))return b+a+e;if(c===d+"/")return c};this.$$compose=function(){var c=Cb(this.$$search),e=this.$$hash?"#"+jb(this.$$hash):"";this.$$url=Qb(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+a+this.$$url}}function sb(b){return function(){return this[b]}}
function Cc(b,a){return function(c){if(D(c))return this[b];this[b]=a(c);this.$$compose();return this}}function Wd(){var b="",a=!1;this.hashPrefix=function(a){return A(a)?(b=a,this):b};this.html5Mode=function(b){return A(b)?(a=b,this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement",function(c,d,e,f){function g(a){c.$broadcast("$locationChangeSuccess",k.absUrl(),a)}var k,m,h=d.baseHref(),l=d.url(),n;a?(n=l.substring(0,l.indexOf("/",l.indexOf("//")+2))+(h||"/"),m=e.history?Bc:Ub):(n=
cb(l),m=Tb);k=new m(n,"#"+b);k.$$parse(k.$$rewrite(l));var p=/^\s*(javascript|mailto):/i;f.on("click",function(a){if(!a.ctrlKey&&!a.metaKey&&2!=a.which){for(var e=u(a.target);"a"!==N(e[0].nodeName);)if(e[0]===f[0]||!(e=e.parent())[0])return;var g=e.prop("href");T(g)&&"[object SVGAnimatedString]"===g.toString()&&(g=ua(g.animVal).href);if(!p.test(g)){if(m===Ub){var h=e.attr("href")||e.attr("xlink:href");if(h&&0>h.indexOf("://"))if(g="#"+b,"/"==h[0])g=n+g+h;else if("#"==h[0])g=n+g+(k.path()||"/")+h;
else{var l=k.path().split("/"),h=h.split("/");2!==l.length||l[1]||(l.length=1);for(var q=0;q<h.length;q++)"."!=h[q]&&(".."==h[q]?l.pop():h[q].length&&l.push(h[q]));g=n+g+l.join("/")}}l=k.$$rewrite(g);g&&(!e.attr("target")&&l&&!a.isDefaultPrevented())&&(a.preventDefault(),l!=d.url()&&(k.$$parse(l),c.$apply(),Q.angular["ff-684208-preventDefault"]=!0))}}});k.absUrl()!=l&&d.url(k.absUrl(),!0);d.onUrlChange(function(a){k.absUrl()!=a&&(c.$evalAsync(function(){var b=k.absUrl();k.$$parse(a);c.$broadcast("$locationChangeStart",
a,b).defaultPrevented?(k.$$parse(b),d.url(b)):g(b)}),c.$$phase||c.$digest())});var q=0;c.$watch(function(){var a=d.url(),b=k.$$replace;q&&a==k.absUrl()||(q++,c.$evalAsync(function(){c.$broadcast("$locationChangeStart",k.absUrl(),a).defaultPrevented?k.$$parse(a):(d.url(k.absUrl(),b),g(a))}));k.$$replace=!1;return q});return k}]}function Xd(){var b=!0,a=this;this.debugEnabled=function(a){return A(a)?(b=a,this):b};this.$get=["$window",function(c){function d(a){a instanceof Error&&(a.stack?a=a.message&&
-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=c.console||{},e=b[a]||b.log||y;a=!1;try{a=!!e.apply}catch(m){}return a?function(){var a=[];r(arguments,function(b){a.push(d(b))});return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){b&&c.apply(a,arguments)}}()}}]}function ja(b,
a){if("__defineGetter__"===b||"__defineSetter__"===b||"__lookupGetter__"===b||"__lookupSetter__"===b||"__proto__"===b)throw ka("isecfld",a);return b}function Oa(b,a){if(b){if(b.constructor===b)throw ka("isecfn",a);if(b.document&&b.location&&b.alert&&b.setInterval)throw ka("isecwindow",a);if(b.children&&(b.nodeName||b.prop&&b.attr&&b.find))throw ka("isecdom",a);if(b===Object)throw ka("isecobj",a);}return b}function tb(b,a,c,d,e){e=e||{};a=a.split(".");for(var f,g=0;1<a.length;g++){f=ja(a.shift(),d);
var k=b[f];k||(k={},b[f]=k);b=k;b.then&&e.unwrapPromises&&(va(d),"$$v"in b||function(a){a.then(function(b){a.$$v=b})}(b),b.$$v===t&&(b.$$v={}),b=b.$$v)}f=ja(a.shift(),d);Oa(b,d);Oa(b[f],d);return b[f]=c}function Dc(b,a,c,d,e,f,g){ja(b,f);ja(a,f);ja(c,f);ja(d,f);ja(e,f);return g.unwrapPromises?function(g,m){var h=m&&m.hasOwnProperty(b)?m:g,l;if(null==h)return h;(h=h[b])&&h.then&&(va(f),"$$v"in h||(l=h,l.$$v=t,l.then(function(a){l.$$v=a})),h=h.$$v);if(!a)return h;if(null==h)return t;(h=h[a])&&h.then&&
(va(f),"$$v"in h||(l=h,l.$$v=t,l.then(function(a){l.$$v=a})),h=h.$$v);if(!c)return h;if(null==h)return t;(h=h[c])&&h.then&&(va(f),"$$v"in h||(l=h,l.$$v=t,l.then(function(a){l.$$v=a})),h=h.$$v);if(!d)return h;if(null==h)return t;(h=h[d])&&h.then&&(va(f),"$$v"in h||(l=h,l.$$v=t,l.then(function(a){l.$$v=a})),h=h.$$v);if(!e)return h;if(null==h)return t;(h=h[e])&&h.then&&(va(f),"$$v"in h||(l=h,l.$$v=t,l.then(function(a){l.$$v=a})),h=h.$$v);return h}:function(f,g){var h=g&&g.hasOwnProperty(b)?g:f;if(null==
h)return h;h=h[b];if(!a)return h;if(null==h)return t;h=h[a];if(!c)return h;if(null==h)return t;h=h[c];if(!d)return h;if(null==h)return t;h=h[d];return e?null==h?t:h=h[e]:h}}function Ec(b,a,c){if(Vb.hasOwnProperty(b))return Vb[b];var d=b.split("."),e=d.length,f;if(a.csp)f=6>e?Dc(d[0],d[1],d[2],d[3],d[4],c,a):function(b,f){var g=0,k;do k=Dc(d[g++],d[g++],d[g++],d[g++],d[g++],c,a)(b,f),f=t,b=k;while(g<e);return k};else{var g="var p;\n";r(d,function(b,d){ja(b,c);g+="if(s == null) return undefined;\ns="+
(d?"s":'((k&&k.hasOwnProperty("'+b+'"))?k:s)')+'["'+b+'"];\n'+(a.unwrapPromises?'if (s && s.then) {\n pw("'+c.replace(/(["\r\n])/g,"\\$1")+'");\n if (!("$$v" in s)) {\n p=s;\n p.$$v = undefined;\n p.then(function(v) {p.$$v=v;});\n}\n s=s.$$v\n}\n':"")});var g=g+"return s;",k=new Function("s","k","pw",g);k.toString=$(g);f=a.unwrapPromises?function(a,b){return k(a,b,va)}:k}"hasOwnProperty"!==b&&(Vb[b]=f);return f}function Yd(){var b={},a={csp:!1,unwrapPromises:!1,logPromiseWarnings:!0};this.unwrapPromises=
function(b){return A(b)?(a.unwrapPromises=!!b,this):a.unwrapPromises};this.logPromiseWarnings=function(b){return A(b)?(a.logPromiseWarnings=b,this):a.logPromiseWarnings};this.$get=["$filter","$sniffer","$log",function(c,d,e){a.csp=d.csp;va=function(b){a.logPromiseWarnings&&!Fc.hasOwnProperty(b)&&(Fc[b]=!0,e.warn("[$parse] Promise found in the expression `"+b+"`. Automatic unwrapping of promises in Angular expressions is deprecated."))};return function(d){var e;switch(typeof d){case "string":if(b.hasOwnProperty(d))return b[d];
e=new Wb(a);e=(new db(e,c,a)).parse(d);"hasOwnProperty"!==d&&(b[d]=e);return e;case "function":return d;default:return y}}}]}function $d(){this.$get=["$rootScope","$exceptionHandler",function(b,a){return ye(function(a){b.$evalAsync(a)},a)}]}function ye(b,a){function c(a){return a}function d(a){return g(a)}var e=function(){var g=[],h,l;return l={resolve:function(a){if(g){var c=g;g=t;h=f(a);c.length&&b(function(){for(var a,b=0,d=c.length;b<d;b++)a=c[b],h.then(a[0],a[1],a[2])})}},reject:function(a){l.resolve(k(a))},
notify:function(a){if(g){var c=g;g.length&&b(function(){for(var b,d=0,e=c.length;d<e;d++)b=c[d],b[2](a)})}},promise:{then:function(b,f,k){var l=e(),L=function(d){try{l.resolve((P(b)?b:c)(d))}catch(e){l.reject(e),a(e)}},v=function(b){try{l.resolve((P(f)?f:d)(b))}catch(c){l.reject(c),a(c)}},C=function(b){try{l.notify((P(k)?k:c)(b))}catch(d){a(d)}};g?g.push([L,v,C]):h.then(L,v,C);return l.promise},"catch":function(a){return this.then(null,a)},"finally":function(a){function b(a,c){var d=e();c?d.resolve(a):
d.reject(a);return d.promise}function d(e,f){var g=null;try{g=(a||c)()}catch(k){return b(k,!1)}return g&&P(g.then)?g.then(function(){return b(e,f)},function(a){return b(a,!1)}):b(e,f)}return this.then(function(a){return d(a,!0)},function(a){return d(a,!1)})}}}},f=function(a){return a&&P(a.then)?a:{then:function(c){var d=e();b(function(){d.resolve(c(a))});return d.promise}}},g=function(a){var b=e();b.reject(a);return b.promise},k=function(c){return{then:function(f,g){var k=e();b(function(){try{k.resolve((P(g)?
g:d)(c))}catch(b){k.reject(b),a(b)}});return k.promise}}};return{defer:e,reject:g,when:function(k,h,l,n){var p=e(),q,s=function(b){try{return(P(h)?h:c)(b)}catch(d){return a(d),g(d)}},L=function(b){try{return(P(l)?l:d)(b)}catch(c){return a(c),g(c)}},v=function(b){try{return(P(n)?n:c)(b)}catch(d){a(d)}};b(function(){f(k).then(function(a){q||(q=!0,p.resolve(f(a).then(s,L,v)))},function(a){q||(q=!0,p.resolve(L(a)))},function(a){q||p.notify(v(a))})});return p.promise},all:function(a){var b=e(),c=0,d=H(a)?
[]:{};r(a,function(a,e){c++;f(a).then(function(a){d.hasOwnProperty(e)||(d[e]=a,--c||b.resolve(d))},function(a){d.hasOwnProperty(e)||b.reject(a)})});0===c&&b.resolve(d);return b.promise}}}function ge(){this.$get=["$window","$timeout",function(b,a){var c=b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame,d=b.cancelAnimationFrame||b.webkitCancelAnimationFrame||b.mozCancelAnimationFrame||b.webkitCancelRequestAnimationFrame,e=!!c,f=e?function(a){var b=c(a);return function(){d(b)}}:
function(b){var c=a(b,16.66,!1);return function(){a.cancel(c)}};f.supported=e;return f}]}function Zd(){var b=10,a=x("$rootScope"),c=null;this.digestTtl=function(a){arguments.length&&(b=a);return b};this.$get=["$injector","$exceptionHandler","$parse","$browser",function(d,e,f,g){function k(){this.$id=gb();this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this["this"]=this.$root=this;this.$$destroyed=!1;this.$$asyncQueue=[];this.$$postDigestQueue=
[];this.$$listeners={};this.$$listenerCount={};this.$$isolateBindings={}}function m(b){if(p.$$phase)throw a("inprog",p.$$phase);p.$$phase=b}function h(a,b){var c=f(a);Va(c,b);return c}function l(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function n(){}k.prototype={constructor:k,$new:function(a){a?(a=new k,a.$root=this.$root,a.$$asyncQueue=this.$$asyncQueue,a.$$postDigestQueue=this.$$postDigestQueue):(this.$$childScopeClass||(this.$$childScopeClass=
function(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$id=gb();this.$$childScopeClass=null},this.$$childScopeClass.prototype=this),a=new this.$$childScopeClass);a["this"]=a;a.$parent=this;a.$$prevSibling=this.$$childTail;this.$$childHead?this.$$childTail=this.$$childTail.$$nextSibling=a:this.$$childHead=this.$$childTail=a;return a},$watch:function(a,b,d){var e=h(a,"watch"),f=this.$$watchers,g={fn:b,last:n,get:e,exp:a,
eq:!!d};c=null;if(!P(b)){var k=h(b||y,"listener");g.fn=function(a,b,c){k(c)}}if("string"==typeof a&&e.constant){var m=g.fn;g.fn=function(a,b,c){m.call(this,a,b,c);Ra(f,g)}}f||(f=this.$$watchers=[]);f.unshift(g);return function(){Ra(f,g);c=null}},$watchCollection:function(a,b){var c=this,d,e,g,k=1<b.length,h=0,m=f(a),l=[],p={},n=!0,r=0;return this.$watch(function(){d=m(c);var a,b,f;if(T(d))if(fb(d))for(e!==l&&(e=l,r=e.length=0,h++),a=d.length,r!==a&&(h++,e.length=r=a),b=0;b<a;b++)f=e[b]!==e[b]&&d[b]!==
d[b],f||e[b]===d[b]||(h++,e[b]=d[b]);else{e!==p&&(e=p={},r=0,h++);a=0;for(b in d)d.hasOwnProperty(b)&&(a++,e.hasOwnProperty(b)?(f=e[b]!==e[b]&&d[b]!==d[b],f||e[b]===d[b]||(h++,e[b]=d[b])):(r++,e[b]=d[b],h++));if(r>a)for(b in h++,e)e.hasOwnProperty(b)&&!d.hasOwnProperty(b)&&(r--,delete e[b])}else e!==d&&(e=d,h++);return h},function(){n?(n=!1,b(d,d,c)):b(d,g,c);if(k)if(T(d))if(fb(d)){g=Array(d.length);for(var a=0;a<d.length;a++)g[a]=d[a]}else for(a in g={},d)ib.call(d,a)&&(g[a]=d[a]);else g=d})},$digest:function(){var d,
f,g,k,h=this.$$asyncQueue,l=this.$$postDigestQueue,r,w,t=b,K,W=[],u,J,E;m("$digest");c=null;do{w=!1;for(K=this;h.length;){try{E=h.shift(),E.scope.$eval(E.expression)}catch(F){p.$$phase=null,e(F)}c=null}a:do{if(k=K.$$watchers)for(r=k.length;r--;)try{if(d=k[r])if((f=d.get(K))!==(g=d.last)&&!(d.eq?za(f,g):"number"===typeof f&&"number"===typeof g&&isNaN(f)&&isNaN(g)))w=!0,c=d,d.last=d.eq?Ha(f,null):f,d.fn(f,g===n?f:g,K),5>t&&(u=4-t,W[u]||(W[u]=[]),J=P(d.exp)?"fn: "+(d.exp.name||d.exp.toString()):d.exp,
J+="; newVal: "+ta(f)+"; oldVal: "+ta(g),W[u].push(J));else if(d===c){w=!1;break a}}catch(A){p.$$phase=null,e(A)}if(!(k=K.$$childHead||K!==this&&K.$$nextSibling))for(;K!==this&&!(k=K.$$nextSibling);)K=K.$parent}while(K=k);if((w||h.length)&&!t--)throw p.$$phase=null,a("infdig",b,ta(W));}while(w||h.length);for(p.$$phase=null;l.length;)try{l.shift()()}catch(x){e(x)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this!==p&&(r(this.$$listenerCount,
Bb(null,l,this)),a.$$childHead==this&&(a.$$childHead=this.$$nextSibling),a.$$childTail==this&&(a.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=null,this.$$listeners={},this.$$watchers=this.$$asyncQueue=this.$$postDigestQueue=[],this.$destroy=this.$digest=this.$apply=y,this.$on=
this.$watch=function(){return y})}},$eval:function(a,b){return f(a)(this,b)},$evalAsync:function(a){p.$$phase||p.$$asyncQueue.length||g.defer(function(){p.$$asyncQueue.length&&p.$digest()});this.$$asyncQueue.push({scope:this,expression:a})},$$postDigest:function(a){this.$$postDigestQueue.push(a)},$apply:function(a){try{return m("$apply"),this.$eval(a)}catch(b){e(b)}finally{p.$$phase=null;try{p.$digest()}catch(c){throw e(c),c;}}},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=
c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){c[Qa(c,b)]=null;l(e,1,a)}},$emit:function(a,b){var c=[],d,f=this,g=!1,k={name:a,targetScope:f,stopPropagation:function(){g=!0},preventDefault:function(){k.defaultPrevented=!0},defaultPrevented:!1},h=[k].concat(Aa.call(arguments,1)),m,l;do{d=f.$$listeners[a]||c;k.currentScope=f;m=0;for(l=d.length;m<l;m++)if(d[m])try{d[m].apply(null,h)}catch(p){e(p)}else d.splice(m,
1),m--,l--;if(g)break;f=f.$parent}while(f);return k},$broadcast:function(a,b){for(var c=this,d=this,f={name:a,targetScope:this,preventDefault:function(){f.defaultPrevented=!0},defaultPrevented:!1},g=[f].concat(Aa.call(arguments,1)),k,h;c=d;){f.currentScope=c;d=c.$$listeners[a]||[];k=0;for(h=d.length;k<h;k++)if(d[k])try{d[k].apply(null,g)}catch(m){e(m)}else d.splice(k,1),k--,h--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}return f}};
var p=new k;return p}]}function cd(){var b=/^\s*(https?|ftp|mailto|tel|file):/,a=/^\s*((https?|ftp|file):|data:image\/)/;this.aHrefSanitizationWhitelist=function(a){return A(a)?(b=a,this):b};this.imgSrcSanitizationWhitelist=function(b){return A(b)?(a=b,this):a};this.$get=function(){return function(c,d){var e=d?a:b,f;if(!R||8<=R)if(f=ua(c).href,""!==f&&!f.match(e))return"unsafe:"+f;return c}}}function ze(b){if("self"===b)return b;if(z(b)){if(-1<b.indexOf("***"))throw wa("iwcard",b);b=b.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,
"\\$1").replace(/\x08/g,"\\x08").replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*");return RegExp("^"+b+"$")}if(hb(b))return RegExp("^"+b.source+"$");throw wa("imatcher");}function Gc(b){var a=[];A(b)&&r(b,function(b){a.push(ze(b))});return a}function be(){this.SCE_CONTEXTS=fa;var b=["self"],a=[];this.resourceUrlWhitelist=function(a){arguments.length&&(b=Gc(a));return b};this.resourceUrlBlacklist=function(b){arguments.length&&(a=Gc(b));return a};this.$get=["$injector",function(c){function d(a){var b=
function(a){this.$$unwrapTrustedValue=function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()};b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()};return b}var e=function(a){throw wa("unsafe");};c.has("$sanitize")&&(e=c.get("$sanitize"));var f=d(),g={};g[fa.HTML]=d(f);g[fa.CSS]=d(f);g[fa.URL]=d(f);g[fa.JS]=d(f);g[fa.RESOURCE_URL]=d(g[fa.URL]);return{trustAs:function(a,b){var c=g.hasOwnProperty(a)?g[a]:null;if(!c)throw wa("icontext",
a,b);if(null===b||b===t||""===b)return b;if("string"!==typeof b)throw wa("itype",a);return new c(b)},getTrusted:function(c,d){if(null===d||d===t||""===d)return d;var f=g.hasOwnProperty(c)?g[c]:null;if(f&&d instanceof f)return d.$$unwrapTrustedValue();if(c===fa.RESOURCE_URL){var f=ua(d.toString()),l,n,p=!1;l=0;for(n=b.length;l<n;l++)if("self"===b[l]?Pb(f):b[l].exec(f.href)){p=!0;break}if(p)for(l=0,n=a.length;l<n;l++)if("self"===a[l]?Pb(f):a[l].exec(f.href)){p=!1;break}if(p)return d;throw wa("insecurl",
d.toString());}if(c===fa.HTML)return e(d);throw wa("unsafe");},valueOf:function(a){return a instanceof f?a.$$unwrapTrustedValue():a}}}]}function ae(){var b=!0;this.enabled=function(a){arguments.length&&(b=!!a);return b};this.$get=["$parse","$sniffer","$sceDelegate",function(a,c,d){if(b&&c.msie&&8>c.msieDocumentMode)throw wa("iequirks");var e=ga(fa);e.isEnabled=function(){return b};e.trustAs=d.trustAs;e.getTrusted=d.getTrusted;e.valueOf=d.valueOf;b||(e.trustAs=e.getTrusted=function(a,b){return b},
e.valueOf=Ga);e.parseAs=function(b,c){var d=a(c);return d.literal&&d.constant?d:function(a,c){return e.getTrusted(b,d(a,c))}};var f=e.parseAs,g=e.getTrusted,k=e.trustAs;r(fa,function(a,b){var c=N(b);e[Ya("parse_as_"+c)]=function(b){return f(a,b)};e[Ya("get_trusted_"+c)]=function(b){return g(a,b)};e[Ya("trust_as_"+c)]=function(b){return k(a,b)}});return e}]}function ce(){this.$get=["$window","$document",function(b,a){var c={},d=Z((/android (\d+)/.exec(N((b.navigator||{}).userAgent))||[])[1]),e=/Boxee/i.test((b.navigator||
{}).userAgent),f=a[0]||{},g=f.documentMode,k,m=/^(Moz|webkit|O|ms)(?=[A-Z])/,h=f.body&&f.body.style,l=!1,n=!1;if(h){for(var p in h)if(l=m.exec(p)){k=l[0];k=k.substr(0,1).toUpperCase()+k.substr(1);break}k||(k="WebkitOpacity"in h&&"webkit");l=!!("transition"in h||k+"Transition"in h);n=!!("animation"in h||k+"Animation"in h);!d||l&&n||(l=z(f.body.style.webkitTransition),n=z(f.body.style.webkitAnimation))}return{history:!(!b.history||!b.history.pushState||4>d||e),hashchange:"onhashchange"in b&&(!g||7<
g),hasEvent:function(a){if("input"==a&&9==R)return!1;if(D(c[a])){var b=f.createElement("div");c[a]="on"+a in b}return c[a]},csp:Wa(),vendorPrefix:k,transitions:l,animations:n,android:d,msie:R,msieDocumentMode:g}}]}function ee(){this.$get=["$rootScope","$browser","$q","$exceptionHandler",function(b,a,c,d){function e(e,k,m){var h=c.defer(),l=h.promise,n=A(m)&&!m;k=a.defer(function(){try{h.resolve(e())}catch(a){h.reject(a),d(a)}finally{delete f[l.$$timeoutId]}n||b.$apply()},k);l.$$timeoutId=k;f[k]=h;
return l}var f={};e.cancel=function(b){return b&&b.$$timeoutId in f?(f[b.$$timeoutId].reject("canceled"),delete f[b.$$timeoutId],a.defer.cancel(b.$$timeoutId)):!1};return e}]}function ua(b,a){var c=b;R&&(V.setAttribute("href",c),c=V.href);V.setAttribute("href",c);return{href:V.href,protocol:V.protocol?V.protocol.replace(/:$/,""):"",host:V.host,search:V.search?V.search.replace(/^\?/,""):"",hash:V.hash?V.hash.replace(/^#/,""):"",hostname:V.hostname,port:V.port,pathname:"/"===V.pathname.charAt(0)?V.pathname:
"/"+V.pathname}}function Pb(b){b=z(b)?ua(b):b;return b.protocol===Hc.protocol&&b.host===Hc.host}function fe(){this.$get=$(Q)}function mc(b){function a(d,e){if(T(d)){var f={};r(d,function(b,c){f[c]=a(c,b)});return f}return b.factory(d+c,e)}var c="Filter";this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+c)}}];a("currency",Ic);a("date",Jc);a("filter",Ae);a("json",Be);a("limitTo",Ce);a("lowercase",De);a("number",Kc);a("orderBy",Lc);a("uppercase",Ee)}function Ae(){return function(b,
a,c){if(!H(b))return b;var d=typeof c,e=[];e.check=function(a){for(var b=0;b<e.length;b++)if(!e[b](a))return!1;return!0};"function"!==d&&(c="boolean"===d&&c?function(a,b){return Ua.equals(a,b)}:function(a,b){if(a&&b&&"object"===typeof a&&"object"===typeof b){for(var d in a)if("$"!==d.charAt(0)&&ib.call(a,d)&&c(a[d],b[d]))return!0;return!1}b=(""+b).toLowerCase();return-1<(""+a).toLowerCase().indexOf(b)});var f=function(a,b){if("string"==typeof b&&"!"===b.charAt(0))return!f(a,b.substr(1));switch(typeof a){case "boolean":case "number":case "string":return c(a,
b);case "object":switch(typeof b){case "object":return c(a,b);default:for(var d in a)if("$"!==d.charAt(0)&&f(a[d],b))return!0}return!1;case "array":for(d=0;d<a.length;d++)if(f(a[d],b))return!0;return!1;default:return!1}};switch(typeof a){case "boolean":case "number":case "string":a={$:a};case "object":for(var g in a)(function(b){"undefined"!==typeof a[b]&&e.push(function(c){return f("$"==b?c:c&&c[b],a[b])})})(g);break;case "function":e.push(a);break;default:return b}d=[];for(g=0;g<b.length;g++){var k=
b[g];e.check(k)&&d.push(k)}return d}}function Ic(b){var a=b.NUMBER_FORMATS;return function(b,d){D(d)&&(d=a.CURRENCY_SYM);return Mc(b,a.PATTERNS[1],a.GROUP_SEP,a.DECIMAL_SEP,2).replace(/\u00A4/g,d)}}function Kc(b){var a=b.NUMBER_FORMATS;return function(b,d){return Mc(b,a.PATTERNS[0],a.GROUP_SEP,a.DECIMAL_SEP,d)}}function Mc(b,a,c,d,e){if(null==b||!isFinite(b)||T(b))return"";var f=0>b;b=Math.abs(b);var g=b+"",k="",m=[],h=!1;if(-1!==g.indexOf("e")){var l=g.match(/([\d\.]+)e(-?)(\d+)/);l&&"-"==l[2]&&
l[3]>e+1?(g="0",b=0):(k=g,h=!0)}if(h)0<e&&(-1<b&&1>b)&&(k=b.toFixed(e));else{g=(g.split(Nc)[1]||"").length;D(e)&&(e=Math.min(Math.max(a.minFrac,g),a.maxFrac));b=+(Math.round(+(b.toString()+"e"+e)).toString()+"e"+-e);b=(""+b).split(Nc);g=b[0];b=b[1]||"";var l=0,n=a.lgSize,p=a.gSize;if(g.length>=n+p)for(l=g.length-n,h=0;h<l;h++)0===(l-h)%p&&0!==h&&(k+=c),k+=g.charAt(h);for(h=l;h<g.length;h++)0===(g.length-h)%n&&0!==h&&(k+=c),k+=g.charAt(h);for(;b.length<e;)b+="0";e&&"0"!==e&&(k+=d+b.substr(0,e))}m.push(f?
a.negPre:a.posPre);m.push(k);m.push(f?a.negSuf:a.posSuf);return m.join("")}function Xb(b,a,c){var d="";0>b&&(d="-",b=-b);for(b=""+b;b.length<a;)b="0"+b;c&&(b=b.substr(b.length-a));return d+b}function Y(b,a,c,d){c=c||0;return function(e){e=e["get"+b]();if(0<c||e>-c)e+=c;0===e&&-12==c&&(e=12);return Xb(e,a,d)}}function ub(b,a){return function(c,d){var e=c["get"+b](),f=Ia(a?"SHORT"+b:b);return d[f][e]}}function Jc(b){function a(a){var b;if(b=a.match(c)){a=new Date(0);var f=0,g=0,k=b[8]?a.setUTCFullYear:
a.setFullYear,m=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=Z(b[9]+b[10]),g=Z(b[9]+b[11]));k.call(a,Z(b[1]),Z(b[2])-1,Z(b[3]));f=Z(b[4]||0)-f;g=Z(b[5]||0)-g;k=Z(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));m.call(a,f,g,k,b)}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e){var f="",g=[],k,m;e=e||"mediumDate";e=b.DATETIME_FORMATS[e]||e;z(c)&&(c=Fe.test(c)?Z(c):a(c));Ab(c)&&(c=new Date(c));if(!sa(c))return c;
for(;e;)(m=Ge.exec(e))?(g=g.concat(Aa.call(m,1)),e=g.pop()):(g.push(e),e=null);r(g,function(a){k=He[a];f+=k?k(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return f}}function Be(){return function(b){return ta(b,!0)}}function Ce(){return function(b,a){if(!H(b)&&!z(b))return b;a=Infinity===Math.abs(Number(a))?Number(a):Z(a);if(z(b))return a?0<=a?b.slice(0,a):b.slice(a,b.length):"";var c=[],d,e;a>b.length?a=b.length:a<-b.length&&(a=-b.length);0<a?(d=0,e=a):(d=b.length+a,e=b.length);
for(;d<e;d++)c.push(b[d]);return c}}function Lc(b){return function(a,c,d){function e(a,b){return Ta(b)?function(b,c){return a(c,b)}:a}function f(a,b){var c=typeof a,d=typeof b;return c==d?(sa(a)&&sa(b)&&(a=a.valueOf(),b=b.valueOf()),"string"==c&&(a=a.toLowerCase(),b=b.toLowerCase()),a===b?0:a<b?-1:1):c<d?-1:1}if(!H(a)||!c)return a;c=H(c)?c:[c];c=Vc(c,function(a){var c=!1,d=a||Ga;if(z(a)){if("+"==a.charAt(0)||"-"==a.charAt(0))c="-"==a.charAt(0),a=a.substring(1);d=b(a);if(d.constant){var g=d();return e(function(a,
b){return f(a[g],b[g])},c)}}return e(function(a,b){return f(d(a),d(b))},c)});for(var g=[],k=0;k<a.length;k++)g.push(a[k]);return g.sort(e(function(a,b){for(var d=0;d<c.length;d++){var e=c[d](a,b);if(0!==e)return e}return 0},d))}}function xa(b){P(b)&&(b={link:b});b.restrict=b.restrict||"AC";return $(b)}function Oc(b,a,c,d){function e(a,c){c=c?"-"+kb(c,"-"):"";d.removeClass(b,(a?vb:wb)+c);d.addClass(b,(a?wb:vb)+c)}var f=this,g=b.parent().controller("form")||xb,k=0,m=f.$error={},h=[];f.$name=a.name||
a.ngForm;f.$dirty=!1;f.$pristine=!0;f.$valid=!0;f.$invalid=!1;g.$addControl(f);b.addClass(Pa);e(!0);f.$addControl=function(a){Ca(a.$name,"input");h.push(a);a.$name&&(f[a.$name]=a)};f.$removeControl=function(a){a.$name&&f[a.$name]===a&&delete f[a.$name];r(m,function(b,c){f.$setValidity(c,!0,a)});Ra(h,a)};f.$setValidity=function(a,b,c){var d=m[a];if(b)d&&(Ra(d,c),d.length||(k--,k||(e(b),f.$valid=!0,f.$invalid=!1),m[a]=!1,e(!0,a),g.$setValidity(a,!0,f)));else{k||e(b);if(d){if(-1!=Qa(d,c))return}else m[a]=
d=[],k++,e(!1,a),g.$setValidity(a,!1,f);d.push(c);f.$valid=!1;f.$invalid=!0}};f.$setDirty=function(){d.removeClass(b,Pa);d.addClass(b,yb);f.$dirty=!0;f.$pristine=!1;g.$setDirty()};f.$setPristine=function(){d.removeClass(b,yb);d.addClass(b,Pa);f.$dirty=!1;f.$pristine=!0;r(h,function(a){a.$setPristine()})}}function ra(b,a,c,d){b.$setValidity(a,c);return c?d:t}function Pc(b,a){var c,d;if(a)for(c=0;c<a.length;++c)if(d=a[c],b[d])return!0;return!1}function Ie(b,a,c,d,e){T(e)&&(b.$$hasNativeValidators=!0,
b.$parsers.push(function(f){if(b.$error[a]||Pc(e,d)||!Pc(e,c))return f;b.$setValidity(a,!1)}))}function zb(b,a,c,d,e,f){var g=a.prop(Je),k=a[0].placeholder,m={},h=N(a[0].type);d.$$validityState=g;if(!e.android){var l=!1;a.on("compositionstart",function(a){l=!0});a.on("compositionend",function(){l=!1;n()})}var n=function(e){if(!l){var f=a.val();if(R&&"input"===(e||m).type&&a[0].placeholder!==k)k=a[0].placeholder;else if("password"!==h&&Ta(c.ngTrim||"T")&&(f=aa(f)),e=g&&d.$$hasNativeValidators,d.$viewValue!==
f||""===f&&e)b.$$phase?d.$setViewValue(f):b.$apply(function(){d.$setViewValue(f)})}};if(e.hasEvent("input"))a.on("input",n);else{var p,q=function(){p||(p=f.defer(function(){n();p=null}))};a.on("keydown",function(a){a=a.keyCode;91===a||(15<a&&19>a||37<=a&&40>=a)||q()});if(e.hasEvent("paste"))a.on("paste cut",q)}a.on("change",n);d.$render=function(){a.val(d.$isEmpty(d.$viewValue)?"":d.$viewValue)};var s=c.ngPattern;s&&((e=s.match(/^\/(.*)\/([gim]*)$/))?(s=RegExp(e[1],e[2]),e=function(a){return ra(d,
"pattern",d.$isEmpty(a)||s.test(a),a)}):e=function(c){var e=b.$eval(s);if(!e||!e.test)throw x("ngPattern")("noregexp",s,e,ha(a));return ra(d,"pattern",d.$isEmpty(c)||e.test(c),c)},d.$formatters.push(e),d.$parsers.push(e));if(c.ngMinlength){var r=Z(c.ngMinlength);e=function(a){return ra(d,"minlength",d.$isEmpty(a)||a.length>=r,a)};d.$parsers.push(e);d.$formatters.push(e)}if(c.ngMaxlength){var v=Z(c.ngMaxlength);e=function(a){return ra(d,"maxlength",d.$isEmpty(a)||a.length<=v,a)};d.$parsers.push(e);
d.$formatters.push(e)}}function Yb(b,a){b="ngClass"+b;return["$animate",function(c){function d(a,b){var c=[],d=0;a:for(;d<a.length;d++){for(var e=a[d],l=0;l<b.length;l++)if(e==b[l])continue a;c.push(e)}return c}function e(a){if(!H(a)){if(z(a))return a.split(" ");if(T(a)){var b=[];r(a,function(a,c){a&&(b=b.concat(c.split(" ")))});return b}}return a}return{restrict:"AC",link:function(f,g,k){function m(a,b){var c=g.data("$classCounts")||{},d=[];r(a,function(a){if(0<b||c[a])c[a]=(c[a]||0)+b,c[a]===+(0<
b)&&d.push(a)});g.data("$classCounts",c);return d.join(" ")}function h(b){if(!0===a||f.$index%2===a){var h=e(b||[]);if(!l){var q=m(h,1);k.$addClass(q)}else if(!za(b,l)){var s=e(l),q=d(h,s),h=d(s,h),h=m(h,-1),q=m(q,1);0===q.length?c.removeClass(g,h):0===h.length?c.addClass(g,q):c.setClass(g,q,h)}}l=ga(b)}var l;f.$watch(k[b],h,!0);k.$observe("class",function(a){h(f.$eval(k[b]))});"ngClass"!==b&&f.$watch("$index",function(c,d){var g=c&1;if(g!==(d&1)){var h=e(f.$eval(k[b]));g===a?(g=m(h,1),k.$addClass(g)):
(g=m(h,-1),k.$removeClass(g))}})}}}]}var Je="validity",N=function(b){return z(b)?b.toLowerCase():b},ib=Object.prototype.hasOwnProperty,Ia=function(b){return z(b)?b.toUpperCase():b},R,u,Da,Aa=[].slice,Ke=[].push,ya=Object.prototype.toString,Sa=x("ng"),Ua=Q.angular||(Q.angular={}),Xa,Ma,la=["0","0","0"];R=Z((/msie (\d+)/.exec(N(navigator.userAgent))||[])[1]);isNaN(R)&&(R=Z((/trident\/.*; rv:(\d+)/.exec(N(navigator.userAgent))||[])[1]));y.$inject=[];Ga.$inject=[];var H=function(){return P(Array.isArray)?
Array.isArray:function(b){return"[object Array]"===ya.call(b)}}(),aa=function(){return String.prototype.trim?function(b){return z(b)?b.trim():b}:function(b){return z(b)?b.replace(/^\s\s*/,"").replace(/\s\s*$/,""):b}}();Ma=9>R?function(b){b=b.nodeName?b:b[0];return b.scopeName&&"HTML"!=b.scopeName?Ia(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?b.nodeName:b[0].nodeName};var Wa=function(){if(A(Wa.isActive_))return Wa.isActive_;var b=!(!X.querySelector("[ng-csp]")&&!X.querySelector("[data-ng-csp]"));
if(!b)try{new Function("")}catch(a){b=!0}return Wa.isActive_=b},Yc=/[A-Z]/g,ad={full:"1.2.23",major:1,minor:2,dot:23,codeName:"superficial-malady"};S.expando="ng339";var $a=S.cache={},ne=1,rb=Q.document.addEventListener?function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)},Za=Q.document.removeEventListener?function(b,a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)};S._data=function(b){return this.cache[b[this.expando]]||{}};var ie=/([\:\-\_]+(.))/g,
je=/^moz([A-Z])/,Hb=x("jqLite"),ke=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Ib=/<|&#?\w+;/,le=/<([\w:]+)/,me=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ba={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ba.optgroup=ba.option;ba.tbody=ba.tfoot=ba.colgroup=ba.caption=ba.thead;ba.th=
ba.td;var La=S.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;"complete"===X.readyState?setTimeout(a):(this.on("DOMContentLoaded",a),S(Q).on("load",a))},toString:function(){var b=[];r(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return 0<=b?u(this[b]):u(this[this.length+b])},length:0,push:Ke,sort:[].sort,splice:[].splice},ob={};r("multiple selected checked disabled readOnly required open".split(" "),function(b){ob[N(b)]=b});var rc={};r("input select option textarea button form details".split(" "),
function(b){rc[Ia(b)]=!0});r({data:Mb,removeData:Lb},function(b,a){S[a]=b});r({data:Mb,inheritedData:nb,scope:function(b){return u.data(b,"$scope")||nb(b.parentNode||b,["$isolateScope","$scope"])},isolateScope:function(b){return u.data(b,"$isolateScope")||u.data(b,"$isolateScopeNoTemplate")},controller:oc,injector:function(b){return nb(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:Nb,css:function(b,a,c){a=Ya(a);if(A(c))b.style[a]=c;else{var d;8>=R&&(d=b.currentStyle&&b.currentStyle[a],
""===d&&(d="auto"));d=d||b.style[a];8>=R&&(d=""===d?t:d);return d}},attr:function(b,a,c){var d=N(a);if(ob[d])if(A(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||y).specified?d:t;else if(A(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),null===b?t:b},prop:function(b,a,c){if(A(c))b[a]=c;else return b[a]},text:function(){function b(b,d){var e=a[b.nodeType];if(D(d))return e?b[e]:"";b[e]=d}var a=[];9>R?(a[1]=
"innerText",a[3]="nodeValue"):a[1]=a[3]="textContent";b.$dv="";return b}(),val:function(b,a){if(D(a)){if("SELECT"===Ma(b)&&b.multiple){var c=[];r(b.options,function(a){a.selected&&c.push(a.value||a.text)});return 0===c.length?null:c}return b.value}b.value=a},html:function(b,a){if(D(a))return b.innerHTML;for(var c=0,d=b.childNodes;c<d.length;c++)Ja(d[c]);b.innerHTML=a},empty:pc},function(b,a){S.prototype[a]=function(a,d){var e,f,g=this.length;if(b!==pc&&(2==b.length&&b!==Nb&&b!==oc?a:d)===t){if(T(a)){for(e=
0;e<g;e++)if(b===Mb)b(this[e],a);else for(f in a)b(this[e],f,a[f]);return this}e=b.$dv;g=e===t?Math.min(g,1):g;for(f=0;f<g;f++){var k=b(this[f],a,d);e=e?e+k:k}return e}for(e=0;e<g;e++)b(this[e],a,d);return this}});r({removeData:Lb,dealoc:Ja,on:function a(c,d,e,f){if(A(f))throw Hb("onargs");var g=ma(c,"events"),k=ma(c,"handle");g||ma(c,"events",g={});k||ma(c,"handle",k=oe(c,g));r(d.split(" "),function(d){var f=g[d];if(!f){if("mouseenter"==d||"mouseleave"==d){var l=X.body.contains||X.body.compareDocumentPosition?
function(a,c){var d=9===a.nodeType?a.documentElement:a,e=c&&c.parentNode;return a===e||!!(e&&1===e.nodeType&&(d.contains?d.contains(e):a.compareDocumentPosition&&a.compareDocumentPosition(e)&16))}:function(a,c){if(c)for(;c=c.parentNode;)if(c===a)return!0;return!1};g[d]=[];a(c,{mouseleave:"mouseout",mouseenter:"mouseover"}[d],function(a){var c=a.relatedTarget;c&&(c===this||l(this,c))||k(a,d)})}else rb(c,d,k),g[d]=[];f=g[d]}f.push(e)})},off:nc,one:function(a,c,d){a=u(a);a.on(c,function f(){a.off(c,
d);a.off(c,f)});a.on(c,d)},replaceWith:function(a,c){var d,e=a.parentNode;Ja(a);r(new S(c),function(c){d?e.insertBefore(c,d.nextSibling):e.replaceChild(c,a);d=c})},children:function(a){var c=[];r(a.childNodes,function(a){1===a.nodeType&&c.push(a)});return c},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,c){r(new S(c),function(c){1!==a.nodeType&&11!==a.nodeType||a.appendChild(c)})},prepend:function(a,c){if(1===a.nodeType){var d=a.firstChild;r(new S(c),function(c){a.insertBefore(c,
d)})}},wrap:function(a,c){c=u(c)[0];var d=a.parentNode;d&&d.replaceChild(c,a);c.appendChild(a)},remove:function(a){Ja(a);var c=a.parentNode;c&&c.removeChild(a)},after:function(a,c){var d=a,e=a.parentNode;r(new S(c),function(a){e.insertBefore(a,d.nextSibling);d=a})},addClass:mb,removeClass:lb,toggleClass:function(a,c,d){c&&r(c.split(" "),function(c){var f=d;D(f)&&(f=!Nb(a,c));(f?mb:lb)(a,c)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){if(a.nextElementSibling)return a.nextElementSibling;
for(a=a.nextSibling;null!=a&&1!==a.nodeType;)a=a.nextSibling;return a},find:function(a,c){return a.getElementsByTagName?a.getElementsByTagName(c):[]},clone:Kb,triggerHandler:function(a,c,d){var e,f;e=c.type||c;var g=(ma(a,"events")||{})[e];g&&(e={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopPropagation:y,type:e,target:a},c.type&&(e=B(e,c)),c=ga(g),f=d?[e].concat(d):[e],r(c,function(c){c.apply(a,f)}))}},function(a,c){S.prototype[c]=
function(c,e,f){for(var g,k=0;k<this.length;k++)D(g)?(g=a(this[k],c,e,f),A(g)&&(g=u(g))):Jb(g,a(this[k],c,e,f));return A(g)?g:this};S.prototype.bind=S.prototype.on;S.prototype.unbind=S.prototype.off});ab.prototype={put:function(a,c){this[Ka(a,this.nextUid)]=c},get:function(a){return this[Ka(a,this.nextUid)]},remove:function(a){var c=this[a=Ka(a,this.nextUid)];delete this[a];return c}};var qe=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,re=/,/,se=/^\s*(_?)(\S+?)\1\s*$/,pe=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,
bb=x("$injector"),Le=x("$animate"),Md=["$provide",function(a){this.$$selectors={};this.register=function(c,d){var e=c+"-animation";if(c&&"."!=c.charAt(0))throw Le("notcsel",c);this.$$selectors[c.substr(1)]=e;a.factory(e,d)};this.classNameFilter=function(a){1===arguments.length&&(this.$$classNameFilter=a instanceof RegExp?a:null);return this.$$classNameFilter};this.$get=["$timeout","$$asyncCallback",function(a,d){return{enter:function(a,c,g,k){g?g.after(a):(c&&c[0]||(c=g.parent()),c.append(a));k&&
d(k)},leave:function(a,c){a.remove();c&&d(c)},move:function(a,c,d,k){this.enter(a,c,d,k)},addClass:function(a,c,g){c=z(c)?c:H(c)?c.join(" "):"";r(a,function(a){mb(a,c)});g&&d(g)},removeClass:function(a,c,g){c=z(c)?c:H(c)?c.join(" "):"";r(a,function(a){lb(a,c)});g&&d(g)},setClass:function(a,c,g,k){r(a,function(a){mb(a,c);lb(a,g)});k&&d(k)},enabled:y}}]}],ia=x("$compile");ic.$inject=["$provide","$$sanitizeUriProvider"];var ue=/^(x[\:\-_]|data[\:\-_])/i,yc=x("$interpolate"),Me=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,
xe={http:80,https:443,ftp:21},Sb=x("$location");Ub.prototype=Tb.prototype=Bc.prototype={$$html5:!1,$$replace:!1,absUrl:sb("$$absUrl"),url:function(a,c){if(D(a))return this.$$url;var d=Me.exec(a);d[1]&&this.path(decodeURIComponent(d[1]));(d[2]||d[1])&&this.search(d[3]||"");this.hash(d[5]||"",c);return this},protocol:sb("$$protocol"),host:sb("$$host"),port:sb("$$port"),path:Cc("$$path",function(a){return"/"==a.charAt(0)?a:"/"+a}),search:function(a,c){switch(arguments.length){case 0:return this.$$search;
case 1:if(z(a))this.$$search=ec(a);else if(T(a))r(a,function(c,e){null==c&&delete a[e]}),this.$$search=a;else throw Sb("isrcharg");break;default:D(c)||null===c?delete this.$$search[a]:this.$$search[a]=c}this.$$compose();return this},hash:Cc("$$hash",Ga),replace:function(){this.$$replace=!0;return this}};var ka=x("$parse"),Fc={},va,Ne=Function.prototype.call,Oe=Function.prototype.apply,Qc=Function.prototype.bind,eb={"null":function(){return null},"true":function(){return!0},"false":function(){return!1},
undefined:y,"+":function(a,c,d,e){d=d(a,c);e=e(a,c);return A(d)?A(e)?d+e:d:A(e)?e:t},"-":function(a,c,d,e){d=d(a,c);e=e(a,c);return(A(d)?d:0)-(A(e)?e:0)},"*":function(a,c,d,e){return d(a,c)*e(a,c)},"/":function(a,c,d,e){return d(a,c)/e(a,c)},"%":function(a,c,d,e){return d(a,c)%e(a,c)},"^":function(a,c,d,e){return d(a,c)^e(a,c)},"=":y,"===":function(a,c,d,e){return d(a,c)===e(a,c)},"!==":function(a,c,d,e){return d(a,c)!==e(a,c)},"==":function(a,c,d,e){return d(a,c)==e(a,c)},"!=":function(a,c,d,e){return d(a,
c)!=e(a,c)},"<":function(a,c,d,e){return d(a,c)<e(a,c)},">":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)},"&":function(a,c,d,e){return d(a,c)&e(a,c)},"|":function(a,c,d,e){return e(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Pe={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},Wb=function(a){this.options=a};Wb.prototype=
{constructor:Wb,lex:function(a){this.text=a;this.index=0;this.ch=t;this.lastCh=":";for(this.tokens=[];this.index<this.text.length;){this.ch=this.text.charAt(this.index);if(this.is("\"'"))this.readString(this.ch);else if(this.isNumber(this.ch)||this.is(".")&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdent(this.ch))this.readIdent();else if(this.is("(){}[].,;:?"))this.tokens.push({index:this.index,text:this.ch}),this.index++;else if(this.isWhitespace(this.ch)){this.index++;continue}else{a=
this.ch+this.peek();var c=a+this.peek(2),d=eb[this.ch],e=eb[a],f=eb[c];f?(this.tokens.push({index:this.index,text:c,fn:f}),this.index+=3):e?(this.tokens.push({index:this.index,text:a,fn:e}),this.index+=2):d?(this.tokens.push({index:this.index,text:this.ch,fn:d}),this.index+=1):this.throwError("Unexpected next character ",this.index,this.index+1)}this.lastCh=this.ch}return this.tokens},is:function(a){return-1!==a.indexOf(this.ch)},was:function(a){return-1!==a.indexOf(this.lastCh)},peek:function(a){a=
a||1;return this.index+a<this.text.length?this.text.charAt(this.index+a):!1},isNumber:function(a){return"0"<=a&&"9">=a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdent:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,c,d){d=d||this.index;c=A(c)?"s "+c+"-"+this.index+" ["+this.text.substring(c,d)+"]":" "+d;throw ka("lexerr",a,c,this.text);
},readNumber:function(){for(var a="",c=this.index;this.index<this.text.length;){var d=N(this.text.charAt(this.index));if("."==d||this.isNumber(d))a+=d;else{var e=this.peek();if("e"==d&&this.isExpOperator(e))a+=d;else if(this.isExpOperator(d)&&e&&this.isNumber(e)&&"e"==a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||e&&this.isNumber(e)||"e"!=a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}a*=1;this.tokens.push({index:c,text:a,literal:!0,constant:!0,fn:function(){return a}})},
readIdent:function(){for(var a=this,c="",d=this.index,e,f,g,k;this.index<this.text.length;){k=this.text.charAt(this.index);if("."===k||this.isIdent(k)||this.isNumber(k))"."===k&&(e=this.index),c+=k;else break;this.index++}if(e)for(f=this.index;f<this.text.length;){k=this.text.charAt(f);if("("===k){g=c.substr(e-d+1);c=c.substr(0,e-d);this.index=f;break}if(this.isWhitespace(k))f++;else break}d={index:d,text:c};if(eb.hasOwnProperty(c))d.fn=eb[c],d.literal=!0,d.constant=!0;else{var m=Ec(c,this.options,
this.text);d.fn=B(function(a,c){return m(a,c)},{assign:function(d,e){return tb(d,c,e,a.text,a.options)}})}this.tokens.push(d);g&&(this.tokens.push({index:e,text:"."}),this.tokens.push({index:e+1,text:g}))},readString:function(a){var c=this.index;this.index++;for(var d="",e=a,f=!1;this.index<this.text.length;){var g=this.text.charAt(this.index),e=e+g;if(f)"u"===g?(f=this.text.substring(this.index+1,this.index+5),f.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+f+"]"),this.index+=
4,d+=String.fromCharCode(parseInt(f,16))):d+=Pe[g]||g,f=!1;else if("\\"===g)f=!0;else{if(g===a){this.index++;this.tokens.push({index:c,text:e,string:d,literal:!0,constant:!0,fn:function(){return d}});return}d+=g}this.index++}this.throwError("Unterminated quote",c)}};var db=function(a,c,d){this.lexer=a;this.$filter=c;this.options=d};db.ZERO=B(function(){return 0},{constant:!0});db.prototype={constructor:db,parse:function(a){this.text=a;this.tokens=this.lexer.lex(a);a=this.statements();0!==this.tokens.length&&
this.throwError("is an unexpected token",this.tokens[0]);a.literal=!!a.literal;a.constant=!!a.constant;return a},primary:function(){var a;if(this.expect("("))a=this.filterChain(),this.consume(")");else if(this.expect("["))a=this.arrayDeclaration();else if(this.expect("{"))a=this.object();else{var c=this.expect();(a=c.fn)||this.throwError("not a primary expression",c);a.literal=!!c.literal;a.constant=!!c.constant}for(var d;c=this.expect("(","[",".");)"("===c.text?(a=this.functionCall(a,d),d=null):
"["===c.text?(d=a,a=this.objectIndex(a)):"."===c.text?(d=a,a=this.fieldAccess(a)):this.throwError("IMPOSSIBLE");return a},throwError:function(a,c){throw ka("syntax",c.text,a,c.index+1,this.text,this.text.substring(c.index));},peekToken:function(){if(0===this.tokens.length)throw ka("ueoe",this.text);return this.tokens[0]},peek:function(a,c,d,e){if(0<this.tokens.length){var f=this.tokens[0],g=f.text;if(g===a||g===c||g===d||g===e||!(a||c||d||e))return f}return!1},expect:function(a,c,d,e){return(a=this.peek(a,
c,d,e))?(this.tokens.shift(),a):!1},consume:function(a){this.expect(a)||this.throwError("is unexpected, expecting ["+a+"]",this.peek())},unaryFn:function(a,c){return B(function(d,e){return a(d,e,c)},{constant:c.constant})},ternaryFn:function(a,c,d){return B(function(e,f){return a(e,f)?c(e,f):d(e,f)},{constant:a.constant&&c.constant&&d.constant})},binaryFn:function(a,c,d){return B(function(e,f){return c(e,f,a,d)},{constant:a.constant&&d.constant})},statements:function(){for(var a=[];;)if(0<this.tokens.length&&
!this.peek("}",")",";","]")&&a.push(this.filterChain()),!this.expect(";"))return 1===a.length?a[0]:function(c,d){for(var e,f=0;f<a.length;f++){var g=a[f];g&&(e=g(c,d))}return e}},filterChain:function(){for(var a=this.expression(),c;;)if(c=this.expect("|"))a=this.binaryFn(a,c.fn,this.filter());else return a},filter:function(){for(var a=this.expect(),c=this.$filter(a.text),d=[];;)if(a=this.expect(":"))d.push(this.expression());else{var e=function(a,e,k){k=[k];for(var m=0;m<d.length;m++)k.push(d[m](a,
e));return c.apply(a,k)};return function(){return e}}},expression:function(){return this.assignment()},assignment:function(){var a=this.ternary(),c,d;return(d=this.expect("="))?(a.assign||this.throwError("implies assignment but ["+this.text.substring(0,d.index)+"] can not be assigned to",d),c=this.ternary(),function(d,f){return a.assign(d,c(d,f),f)}):a},ternary:function(){var a=this.logicalOR(),c,d;if(this.expect("?")){c=this.assignment();if(d=this.expect(":"))return this.ternaryFn(a,c,this.assignment());
this.throwError("expected :",d)}else return a},logicalOR:function(){for(var a=this.logicalAND(),c;;)if(c=this.expect("||"))a=this.binaryFn(a,c.fn,this.logicalAND());else return a},logicalAND:function(){var a=this.equality(),c;if(c=this.expect("&&"))a=this.binaryFn(a,c.fn,this.logicalAND());return a},equality:function(){var a=this.relational(),c;if(c=this.expect("==","!=","===","!=="))a=this.binaryFn(a,c.fn,this.equality());return a},relational:function(){var a=this.additive(),c;if(c=this.expect("<",
">","<=",">="))a=this.binaryFn(a,c.fn,this.relational());return a},additive:function(){for(var a=this.multiplicative(),c;c=this.expect("+","-");)a=this.binaryFn(a,c.fn,this.multiplicative());return a},multiplicative:function(){for(var a=this.unary(),c;c=this.expect("*","/","%");)a=this.binaryFn(a,c.fn,this.unary());return a},unary:function(){var a;return this.expect("+")?this.primary():(a=this.expect("-"))?this.binaryFn(db.ZERO,a.fn,this.unary()):(a=this.expect("!"))?this.unaryFn(a.fn,this.unary()):
this.primary()},fieldAccess:function(a){var c=this,d=this.expect().text,e=Ec(d,this.options,this.text);return B(function(c,d,k){return e(k||a(c,d))},{assign:function(e,g,k){(k=a(e,k))||a.assign(e,k={});return tb(k,d,g,c.text,c.options)}})},objectIndex:function(a){var c=this,d=this.expression();this.consume("]");return B(function(e,f){var g=a(e,f),k=d(e,f),m;ja(k,c.text);if(!g)return t;(g=Oa(g[k],c.text))&&(g.then&&c.options.unwrapPromises)&&(m=g,"$$v"in g||(m.$$v=t,m.then(function(a){m.$$v=a})),g=
g.$$v);return g},{assign:function(e,f,g){var k=ja(d(e,g),c.text);(g=Oa(a(e,g),c.text))||a.assign(e,g={});return g[k]=f}})},functionCall:function(a,c){var d=[];if(")"!==this.peekToken().text){do d.push(this.expression());while(this.expect(","))}this.consume(")");var e=this;return function(f,g){for(var k=[],m=c?c(f,g):f,h=0;h<d.length;h++)k.push(d[h](f,g));h=a(f,g,m)||y;Oa(m,e.text);var l=e.text;if(h){if(h.constructor===h)throw ka("isecfn",l);if(h===Ne||h===Oe||Qc&&h===Qc)throw ka("isecff",l);}k=h.apply?
h.apply(m,k):h(k[0],k[1],k[2],k[3],k[4]);return Oa(k,e.text)}},arrayDeclaration:function(){var a=[],c=!0;if("]"!==this.peekToken().text){do{if(this.peek("]"))break;var d=this.expression();a.push(d);d.constant||(c=!1)}while(this.expect(","))}this.consume("]");return B(function(c,d){for(var g=[],k=0;k<a.length;k++)g.push(a[k](c,d));return g},{literal:!0,constant:c})},object:function(){var a=[],c=!0;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;var d=this.expect(),d=d.string||d.text;this.consume(":");
var e=this.expression();a.push({key:d,value:e});e.constant||(c=!1)}while(this.expect(","))}this.consume("}");return B(function(c,d){for(var e={},m=0;m<a.length;m++){var h=a[m];e[h.key]=h.value(c,d)}return e},{literal:!0,constant:c})}};var Vb={},wa=x("$sce"),fa={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},V=X.createElement("a"),Hc=ua(Q.location.href,!0);mc.$inject=["$provide"];Ic.$inject=["$locale"];Kc.$inject=["$locale"];var Nc=".",He={yyyy:Y("FullYear",4),yy:Y("FullYear",
2,0,!0),y:Y("FullYear",1),MMMM:ub("Month"),MMM:ub("Month",!0),MM:Y("Month",2,1),M:Y("Month",1,1),dd:Y("Date",2),d:Y("Date",1),HH:Y("Hours",2),H:Y("Hours",1),hh:Y("Hours",2,-12),h:Y("Hours",1,-12),mm:Y("Minutes",2),m:Y("Minutes",1),ss:Y("Seconds",2),s:Y("Seconds",1),sss:Y("Milliseconds",3),EEEE:ub("Day"),EEE:ub("Day",!0),a:function(a,c){return 12>a.getHours()?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){a=-1*a.getTimezoneOffset();return a=(0<=a?"+":"")+(Xb(Math[0<a?"floor":"ceil"](a/60),2)+Xb(Math.abs(a%60),
2))}},Ge=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,Fe=/^\-?\d+$/;Jc.$inject=["$locale"];var De=$(N),Ee=$(Ia);Lc.$inject=["$parse"];var dd=$({restrict:"E",compile:function(a,c){8>=R&&(c.href||c.name||c.$set("href",""),a.append(X.createComment("IE fix")));if(!c.href&&!c.xlinkHref&&!c.name)return function(a,c){var f="[object SVGAnimatedString]"===ya.call(c.prop("href"))?"xlink:href":"href";c.on("click",function(a){c.attr(f)||a.preventDefault()})}}}),Fb={};r(ob,function(a,
c){if("multiple"!=a){var d=na("ng-"+c);Fb[d]=function(){return{priority:100,link:function(a,f,g){a.$watch(g[d],function(a){g.$set(c,!!a)})}}}}});r(["src","srcset","href"],function(a){var c=na("ng-"+a);Fb[c]=function(){return{priority:99,link:function(d,e,f){var g=a,k=a;"href"===a&&"[object SVGAnimatedString]"===ya.call(e.prop("href"))&&(k="xlinkHref",f.$attr[k]="xlink:href",g=null);f.$observe(c,function(c){c?(f.$set(k,c),R&&g&&e.prop(g,f[k])):"href"===a&&f.$set(k,null)})}}}});var xb={$addControl:y,
$removeControl:y,$setValidity:y,$setDirty:y,$setPristine:y};Oc.$inject=["$element","$attrs","$scope","$animate"];var Rc=function(a){return["$timeout",function(c){return{name:"form",restrict:a?"EAC":"E",controller:Oc,compile:function(){return{pre:function(a,e,f,g){if(!f.action){var k=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1};rb(e[0],"submit",k);e.on("$destroy",function(){c(function(){Za(e[0],"submit",k)},0,!1)})}var m=e.parent().controller("form"),h=f.name||f.ngForm;h&&tb(a,
h,g,h);if(m)e.on("$destroy",function(){m.$removeControl(g);h&&tb(a,h,t,h);B(g,xb)})}}}}}]},ed=Rc(),rd=Rc(!0),Qe=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,Re=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,Se=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,Sc={text:zb,number:function(a,c,d,e,f,g){zb(a,c,d,e,f,g);e.$parsers.push(function(a){var c=e.$isEmpty(a);if(c||Se.test(a))return e.$setValidity("number",!0),""===
a?null:c?a:parseFloat(a);e.$setValidity("number",!1);return t});Ie(e,"number",Te,null,e.$$validityState);e.$formatters.push(function(a){return e.$isEmpty(a)?"":""+a});d.min&&(a=function(a){var c=parseFloat(d.min);return ra(e,"min",e.$isEmpty(a)||a>=c,a)},e.$parsers.push(a),e.$formatters.push(a));d.max&&(a=function(a){var c=parseFloat(d.max);return ra(e,"max",e.$isEmpty(a)||a<=c,a)},e.$parsers.push(a),e.$formatters.push(a));e.$formatters.push(function(a){return ra(e,"number",e.$isEmpty(a)||Ab(a),a)})},
url:function(a,c,d,e,f,g){zb(a,c,d,e,f,g);a=function(a){return ra(e,"url",e.$isEmpty(a)||Qe.test(a),a)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a,c,d,e,f,g){zb(a,c,d,e,f,g);a=function(a){return ra(e,"email",e.$isEmpty(a)||Re.test(a),a)};e.$formatters.push(a);e.$parsers.push(a)},radio:function(a,c,d,e){D(d.name)&&c.attr("name",gb());c.on("click",function(){c[0].checked&&a.$apply(function(){e.$setViewValue(d.value)})});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",
e.$render)},checkbox:function(a,c,d,e){var f=d.ngTrueValue,g=d.ngFalseValue;z(f)||(f=!0);z(g)||(g=!1);c.on("click",function(){a.$apply(function(){e.$setViewValue(c[0].checked)})});e.$render=function(){c[0].checked=e.$viewValue};e.$isEmpty=function(a){return a!==f};e.$formatters.push(function(a){return a===f});e.$parsers.push(function(a){return a?f:g})},hidden:y,button:y,submit:y,reset:y,file:y},Te=["badInput"],jc=["$browser","$sniffer",function(a,c){return{restrict:"E",require:"?ngModel",link:function(d,
e,f,g){g&&(Sc[N(f.type)]||Sc.text)(d,e,f,g,c,a)}}}],wb="ng-valid",vb="ng-invalid",Pa="ng-pristine",yb="ng-dirty",Ue=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate",function(a,c,d,e,f,g){function k(a,c){c=c?"-"+kb(c,"-"):"";g.removeClass(e,(a?vb:wb)+c);g.addClass(e,(a?wb:vb)+c)}this.$modelValue=this.$viewValue=Number.NaN;this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$name=d.name;var m=f(d.ngModel),
h=m.assign;if(!h)throw x("ngModel")("nonassign",d.ngModel,ha(e));this.$render=y;this.$isEmpty=function(a){return D(a)||""===a||null===a||a!==a};var l=e.inheritedData("$formController")||xb,n=0,p=this.$error={};e.addClass(Pa);k(!0);this.$setValidity=function(a,c){p[a]!==!c&&(c?(p[a]&&n--,n||(k(!0),this.$valid=!0,this.$invalid=!1)):(k(!1),this.$invalid=!0,this.$valid=!1,n++),p[a]=!c,k(c,a),l.$setValidity(a,c,this))};this.$setPristine=function(){this.$dirty=!1;this.$pristine=!0;g.removeClass(e,yb);g.addClass(e,
Pa)};this.$setViewValue=function(d){this.$viewValue=d;this.$pristine&&(this.$dirty=!0,this.$pristine=!1,g.removeClass(e,Pa),g.addClass(e,yb),l.$setDirty());r(this.$parsers,function(a){d=a(d)});this.$modelValue!==d&&(this.$modelValue=d,h(a,d),r(this.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}}))};var q=this;a.$watch(function(){var c=m(a);if(q.$modelValue!==c){var d=q.$formatters,e=d.length;for(q.$modelValue=c;e--;)c=d[e](c);q.$viewValue!==c&&(q.$viewValue=c,q.$render())}return c})}],Gd=
function(){return{require:["ngModel","^?form"],controller:Ue,link:function(a,c,d,e){var f=e[0],g=e[1]||xb;g.$addControl(f);a.$on("$destroy",function(){g.$removeControl(f)})}}},Id=$({require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),kc=function(){return{require:"?ngModel",link:function(a,c,d,e){if(e){d.required=!0;var f=function(a){if(d.required&&e.$isEmpty(a))e.$setValidity("required",!1);else return e.$setValidity("required",!0),a};e.$formatters.push(f);
e.$parsers.unshift(f);d.$observe("required",function(){f(e.$viewValue)})}}}},Hd=function(){return{require:"ngModel",link:function(a,c,d,e){var f=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])||d.ngList||",";e.$parsers.push(function(a){if(!D(a)){var c=[];a&&r(a.split(f),function(a){a&&c.push(aa(a))});return c}});e.$formatters.push(function(a){return H(a)?a.join(", "):t});e.$isEmpty=function(a){return!a||!a.length}}}},Ve=/^(true|false|\d+)$/,Jd=function(){return{priority:100,compile:function(a,c){return Ve.test(c.ngValue)?
function(a,c,f){f.$set("value",a.$eval(f.ngValue))}:function(a,c,f){a.$watch(f.ngValue,function(a){f.$set("value",a)})}}}},jd=xa({compile:function(a){a.addClass("ng-binding");return function(a,d,e){d.data("$binding",e.ngBind);a.$watch(e.ngBind,function(a){d.text(a==t?"":a)})}}}),ld=["$interpolate",function(a){return function(c,d,e){c=a(d.attr(e.$attr.ngBindTemplate));d.addClass("ng-binding").data("$binding",c);e.$observe("ngBindTemplate",function(a){d.text(a)})}}],kd=["$sce","$parse",function(a,c){return{compile:function(d){d.addClass("ng-binding");
return function(d,f,g){f.data("$binding",g.ngBindHtml);var k=c(g.ngBindHtml);d.$watch(function(){return(k(d)||"").toString()},function(c){f.html(a.getTrustedHtml(k(d))||"")})}}}}],md=Yb("",!0),od=Yb("Odd",0),nd=Yb("Even",1),pd=xa({compile:function(a,c){c.$set("ngCloak",t);a.removeClass("ng-cloak")}}),qd=[function(){return{scope:!0,controller:"@",priority:500}}],lc={};r("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),
function(a){var c=na("ng-"+a);lc[c]=["$parse",function(d){return{compile:function(e,f){var g=d(f[c]);return function(c,d){d.on(N(a),function(a){c.$apply(function(){g(c,{$event:a})})})}}}}]});var td=["$animate",function(a){return{transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(c,d,e,f,g){var k,m,h;c.$watch(e.ngIf,function(f){Ta(f)?m||(m=c.$new(),g(m,function(c){c[c.length++]=X.createComment(" end ngIf: "+e.ngIf+" ");k={clone:c};a.enter(c,d.parent(),d)})):(h&&(h.remove(),
h=null),m&&(m.$destroy(),m=null),k&&(h=Eb(k.clone),a.leave(h,function(){h=null}),k=null))})}}}],ud=["$http","$templateCache","$anchorScroll","$animate","$sce",function(a,c,d,e,f){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:Ua.noop,compile:function(g,k){var m=k.ngInclude||k.src,h=k.onload||"",l=k.autoscroll;return function(g,k,q,r,L){var v=0,t,u,I,w=function(){u&&(u.remove(),u=null);t&&(t.$destroy(),t=null);I&&(e.leave(I,function(){u=null}),u=I,I=null)};g.$watch(f.parseAsResourceUrl(m),
function(f){var m=function(){!A(l)||l&&!g.$eval(l)||d()},q=++v;f?(a.get(f,{cache:c}).success(function(a){if(q===v){var c=g.$new();r.template=a;a=L(c,function(a){w();e.enter(a,null,k,m)});t=c;I=a;t.$emit("$includeContentLoaded");g.$eval(h)}}).error(function(){q===v&&w()}),g.$emit("$includeContentRequested")):(w(),r.template=null)})}}}}],Kd=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(c,d,e,f){d.html(f.template);a(d.contents())(c)}}}],vd=xa({priority:450,
compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),wd=xa({terminal:!0,priority:1E3}),xd=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,f,g){var k=g.count,m=g.$attr.when&&f.attr(g.$attr.when),h=g.offset||0,l=e.$eval(m)||{},n={},p=c.startSymbol(),q=c.endSymbol(),s=/^when(Minus)?(.+)$/;r(g,function(a,c){s.test(c)&&(l[N(c.replace("when","").replace("Minus","-"))]=f.attr(g.$attr[c]))});r(l,function(a,e){n[e]=c(a.replace(d,p+k+"-"+h+q))});e.$watch(function(){var c=
parseFloat(e.$eval(k));if(isNaN(c))return"";c in l||(c=a.pluralCat(c-h));return n[c](e,f,!0)},function(a){f.text(a)})}}}],yd=["$parse","$animate",function(a,c){var d=x("ngRepeat");return{transclude:"element",priority:1E3,terminal:!0,$$tlb:!0,link:function(e,f,g,k,m){var h=g.ngRepeat,l=h.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),n,p,q,s,t,v,C={$id:Ka};if(!l)throw d("iexp",h);g=l[1];k=l[2];(l=l[3])?(n=a(l),p=function(a,c,d){v&&(C[v]=a);C[t]=c;C.$index=d;return n(e,
C)}):(q=function(a,c){return Ka(c)},s=function(a){return a});l=g.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!l)throw d("iidexp",g);t=l[3]||l[1];v=l[2];var A={};e.$watchCollection(k,function(a){var g,k,l=f[0],n,C={},J,E,F,x,z,y,H=[];if(fb(a))z=a,n=p||q;else{n=p||s;z=[];for(F in a)a.hasOwnProperty(F)&&"$"!=F.charAt(0)&&z.push(F);z.sort()}J=z.length;k=H.length=z.length;for(g=0;g<k;g++)if(F=a===z?g:z[g],x=a[F],x=n(F,x,g),Ca(x,"`track by` id"),A.hasOwnProperty(x))y=A[x],delete A[x],C[x]=
y,H[g]=y;else{if(C.hasOwnProperty(x))throw r(H,function(a){a&&a.scope&&(A[a.id]=a)}),d("dupes",h,x);H[g]={id:x};C[x]=!1}for(F in A)A.hasOwnProperty(F)&&(y=A[F],g=Eb(y.clone),c.leave(g),r(g,function(a){a.$$NG_REMOVED=!0}),y.scope.$destroy());g=0;for(k=z.length;g<k;g++){F=a===z?g:z[g];x=a[F];y=H[g];H[g-1]&&(l=H[g-1].clone[H[g-1].clone.length-1]);if(y.scope){E=y.scope;n=l;do n=n.nextSibling;while(n&&n.$$NG_REMOVED);y.clone[0]!=n&&c.move(Eb(y.clone),null,u(l));l=y.clone[y.clone.length-1]}else E=e.$new();
E[t]=x;v&&(E[v]=F);E.$index=g;E.$first=0===g;E.$last=g===J-1;E.$middle=!(E.$first||E.$last);E.$odd=!(E.$even=0===(g&1));y.scope||m(E,function(a){a[a.length++]=X.createComment(" end ngRepeat: "+h+" ");c.enter(a,null,u(l));l=a;y.scope=E;y.clone=a;C[y.id]=y})}A=C})}}}],zd=["$animate",function(a){return function(c,d,e){c.$watch(e.ngShow,function(c){a[Ta(c)?"removeClass":"addClass"](d,"ng-hide")})}}],sd=["$animate",function(a){return function(c,d,e){c.$watch(e.ngHide,function(c){a[Ta(c)?"addClass":"removeClass"](d,
"ng-hide")})}}],Ad=xa(function(a,c,d){a.$watch(d.ngStyle,function(a,d){d&&a!==d&&r(d,function(a,d){c.css(d,"")});a&&c.css(a)},!0)}),Bd=["$animate",function(a){return{restrict:"EA",require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(c,d,e,f){var g=[],k=[],m=[],h=[];c.$watch(e.ngSwitch||e.on,function(d){var n,p;n=0;for(p=m.length;n<p;++n)m[n].remove();n=m.length=0;for(p=h.length;n<p;++n){var q=k[n];h[n].$destroy();m[n]=q;a.leave(q,function(){m.splice(n,1)})}k.length=0;h.length=
0;if(g=f.cases["!"+d]||f.cases["?"])c.$eval(e.change),r(g,function(d){var e=c.$new();h.push(e);d.transclude(e,function(c){var e=d.element;k.push(c);a.enter(c,e.parent(),e)})})})}}}],Cd=xa({transclude:"element",priority:800,require:"^ngSwitch",link:function(a,c,d,e,f){e.cases["!"+d.ngSwitchWhen]=e.cases["!"+d.ngSwitchWhen]||[];e.cases["!"+d.ngSwitchWhen].push({transclude:f,element:c})}}),Dd=xa({transclude:"element",priority:800,require:"^ngSwitch",link:function(a,c,d,e,f){e.cases["?"]=e.cases["?"]||
[];e.cases["?"].push({transclude:f,element:c})}}),Fd=xa({link:function(a,c,d,e,f){if(!f)throw x("ngTransclude")("orphan",ha(c));f(function(a){c.empty();c.append(a)})}}),fd=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(c,d){"text/ng-template"==d.type&&a.put(d.id,c[0].text)}}}],We=x("ngOptions"),Ed=$({terminal:!0}),gd=["$compile","$parse",function(a,c){var d=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,
e={$setViewValue:y};return{restrict:"E",require:["select","?ngModel"],controller:["$element","$scope","$attrs",function(a,c,d){var m=this,h={},l=e,n;m.databound=d.ngModel;m.init=function(a,c,d){l=a;n=d};m.addOption=function(c){Ca(c,'"option value"');h[c]=!0;l.$viewValue==c&&(a.val(c),n.parent()&&n.remove())};m.removeOption=function(a){this.hasOption(a)&&(delete h[a],l.$viewValue==a&&this.renderUnknownOption(a))};m.renderUnknownOption=function(c){c="? "+Ka(c)+" ?";n.val(c);a.prepend(n);a.val(c);n.prop("selected",
!0)};m.hasOption=function(a){return h.hasOwnProperty(a)};c.$on("$destroy",function(){m.renderUnknownOption=y})}],link:function(e,g,k,m){function h(a,c,d,e){d.$render=function(){var a=d.$viewValue;e.hasOption(a)?(z.parent()&&z.remove(),c.val(a),""===a&&v.prop("selected",!0)):D(a)&&v?c.val(""):e.renderUnknownOption(a)};c.on("change",function(){a.$apply(function(){z.parent()&&z.remove();d.$setViewValue(c.val())})})}function l(a,c,d){var e;d.$render=function(){var a=new ab(d.$viewValue);r(c.find("option"),
function(c){c.selected=A(a.get(c.value))})};a.$watch(function(){za(e,d.$viewValue)||(e=ga(d.$viewValue),d.$render())});c.on("change",function(){a.$apply(function(){var a=[];r(c.find("option"),function(c){c.selected&&a.push(c.value)});d.$setViewValue(a)})})}function n(e,f,g){function k(){var a={"":[]},c=[""],d,h,s,t,w;s=g.$modelValue;t=v(e)||[];var E=n?Zb(t):t,I,M,B;M={};B=!1;if(q)if(h=g.$modelValue,u&&H(h))for(B=new ab([]),d={},w=0;w<h.length;w++)d[m]=h[w],B.put(u(e,d),h[w]);else B=new ab(h);w=B;
var D,J;for(B=0;I=E.length,B<I;B++){h=B;if(n){h=E[B];if("$"===h.charAt(0))continue;M[n]=h}M[m]=t[h];d=p(e,M)||"";(h=a[d])||(h=a[d]=[],c.push(d));q?d=A(w.remove(u?u(e,M):r(e,M))):(u?(d={},d[m]=s,d=u(e,d)===u(e,M)):d=s===r(e,M),w=w||d);D=l(e,M);D=A(D)?D:"";h.push({id:u?u(e,M):n?E[B]:B,label:D,selected:d})}q||(x||null===s?a[""].unshift({id:"",label:"",selected:!w}):w||a[""].unshift({id:"?",label:"",selected:!0}));M=0;for(E=c.length;M<E;M++){d=c[M];h=a[d];z.length<=M?(s={element:y.clone().attr("label",
d),label:h.label},t=[s],z.push(t),f.append(s.element)):(t=z[M],s=t[0],s.label!=d&&s.element.attr("label",s.label=d));D=null;B=0;for(I=h.length;B<I;B++)d=h[B],(w=t[B+1])?(D=w.element,w.label!==d.label&&D.text(w.label=d.label),w.id!==d.id&&D.val(w.id=d.id),D[0].selected!==d.selected&&(D.prop("selected",w.selected=d.selected),R&&D.prop("selected",w.selected))):(""===d.id&&x?J=x:(J=C.clone()).val(d.id).prop("selected",d.selected).attr("selected",d.selected).text(d.label),t.push({element:J,label:d.label,
id:d.id,selected:d.selected}),D?D.after(J):s.element.append(J),D=J);for(B++;t.length>B;)t.pop().element.remove()}for(;z.length>M;)z.pop()[0].element.remove()}var h;if(!(h=s.match(d)))throw We("iexp",s,ha(f));var l=c(h[2]||h[1]),m=h[4]||h[6],n=h[5],p=c(h[3]||""),r=c(h[2]?h[1]:m),v=c(h[7]),u=h[8]?c(h[8]):null,z=[[{element:f,label:""}]];x&&(a(x)(e),x.removeClass("ng-scope"),x.remove());f.empty();f.on("change",function(){e.$apply(function(){var a,c=v(e)||[],d={},h,l,p,s,w,x,y;if(q)for(l=[],s=0,x=z.length;s<
x;s++)for(a=z[s],p=1,w=a.length;p<w;p++){if((h=a[p].element)[0].selected){h=h.val();n&&(d[n]=h);if(u)for(y=0;y<c.length&&(d[m]=c[y],u(e,d)!=h);y++);else d[m]=c[h];l.push(r(e,d))}}else if(h=f.val(),"?"==h)l=t;else if(""===h)l=null;else if(u)for(y=0;y<c.length;y++){if(d[m]=c[y],u(e,d)==h){l=r(e,d);break}}else d[m]=c[h],n&&(d[n]=h),l=r(e,d);g.$setViewValue(l);k()})});g.$render=k;e.$watchCollection(v,k);q&&e.$watchCollection(function(){return g.$modelValue},k)}if(m[1]){var p=m[0];m=m[1];var q=k.multiple,
s=k.ngOptions,x=!1,v,C=u(X.createElement("option")),y=u(X.createElement("optgroup")),z=C.clone();k=0;for(var w=g.children(),B=w.length;k<B;k++)if(""===w[k].value){v=x=w.eq(k);break}p.init(m,x,z);q&&(m.$isEmpty=function(a){return!a||0===a.length});s?n(e,g,m):q?l(e,g,m):h(e,g,m,p)}}}}],id=["$interpolate",function(a){var c={addOption:y,removeOption:y};return{restrict:"E",priority:100,compile:function(d,e){if(D(e.value)){var f=a(d.text(),!0);f||e.$set("value",d.text())}return function(a,d,e){var h=d.parent(),
l=h.data("$selectController")||h.parent().data("$selectController");l&&l.databound?d.prop("selected",!1):l=c;f?a.$watch(f,function(a,c){e.$set("value",a);a!==c&&l.removeOption(c);l.addOption(a)}):l.addOption(e.value);d.on("$destroy",function(){l.removeOption(e.value)})}}}}],hd=$({restrict:"E",terminal:!0});Q.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):((Da=Q.jQuery)&&Da.fn.on?(u=Da,B(Da.fn,{scope:La.scope,isolateScope:La.isolateScope,controller:La.controller,injector:La.injector,
inheritedData:La.inheritedData}),Gb("remove",!0,!0,!1),Gb("empty",!1,!1,!1),Gb("html",!1,!1,!0)):u=S,Ua.element=u,$c(Ua),u(X).ready(function(){Xc(X,fc)}))})(window,document);!window.angular.$$csp()&&window.angular.element(document).find("head").prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\\:form{display:block;}.ng-animate-block-transitions{transition:0s all!important;-webkit-transition:0s all!important;}.ng-hide-add-active,.ng-hide-remove{display:block!important;}</style>');

// angular-resource.min.js
/*
 AngularJS v1.2.23
 (c) 2010-2014 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(H,a,A){'use strict';function D(p,g){g=g||{};a.forEach(g,function(a,c){delete g[c]});for(var c in p)!p.hasOwnProperty(c)||"$"===c.charAt(0)&&"$"===c.charAt(1)||(g[c]=p[c]);return g}var v=a.$$minErr("$resource"),C=/^(\.[a-zA-Z_$][0-9a-zA-Z_$]*)+$/;a.module("ngResource",["ng"]).factory("$resource",["$http","$q",function(p,g){function c(a,c){this.template=a;this.defaults=c||{};this.urlParams={}}function t(n,w,l){function r(h,d){var e={};d=x({},w,d);s(d,function(b,d){u(b)&&(b=b());var k;if(b&&
b.charAt&&"@"==b.charAt(0)){k=h;var a=b.substr(1);if(null==a||""===a||"hasOwnProperty"===a||!C.test("."+a))throw v("badmember",a);for(var a=a.split("."),f=0,c=a.length;f<c&&k!==A;f++){var g=a[f];k=null!==k?k[g]:A}}else k=b;e[d]=k});return e}function e(a){return a.resource}function f(a){D(a||{},this)}var F=new c(n);l=x({},B,l);s(l,function(h,d){var c=/^(POST|PUT|PATCH)$/i.test(h.method);f[d]=function(b,d,k,w){var q={},n,l,y;switch(arguments.length){case 4:y=w,l=k;case 3:case 2:if(u(d)){if(u(b)){l=
b;y=d;break}l=d;y=k}else{q=b;n=d;l=k;break}case 1:u(b)?l=b:c?n=b:q=b;break;case 0:break;default:throw v("badargs",arguments.length);}var t=this instanceof f,m=t?n:h.isArray?[]:new f(n),z={},B=h.interceptor&&h.interceptor.response||e,C=h.interceptor&&h.interceptor.responseError||A;s(h,function(a,b){"params"!=b&&("isArray"!=b&&"interceptor"!=b)&&(z[b]=G(a))});c&&(z.data=n);F.setUrlParams(z,x({},r(n,h.params||{}),q),h.url);q=p(z).then(function(b){var d=b.data,k=m.$promise;if(d){if(a.isArray(d)!==!!h.isArray)throw v("badcfg",
h.isArray?"array":"object",a.isArray(d)?"array":"object");h.isArray?(m.length=0,s(d,function(b){"object"===typeof b?m.push(new f(b)):m.push(b)})):(D(d,m),m.$promise=k)}m.$resolved=!0;b.resource=m;return b},function(b){m.$resolved=!0;(y||E)(b);return g.reject(b)});q=q.then(function(b){var a=B(b);(l||E)(a,b.headers);return a},C);return t?q:(m.$promise=q,m.$resolved=!1,m)};f.prototype["$"+d]=function(b,a,k){u(b)&&(k=a,a=b,b={});b=f[d].call(this,b,this,a,k);return b.$promise||b}});f.bind=function(a){return t(n,
x({},w,a),l)};return f}var B={get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}},E=a.noop,s=a.forEach,x=a.extend,G=a.copy,u=a.isFunction;c.prototype={setUrlParams:function(c,g,l){var r=this,e=l||r.template,f,p,h=r.urlParams={};s(e.split(/\W/),function(a){if("hasOwnProperty"===a)throw v("badname");!/^\d+$/.test(a)&&(a&&RegExp("(^|[^\\\\]):"+a+"(\\W|$)").test(e))&&(h[a]=!0)});e=e.replace(/\\:/g,":");g=g||{};s(r.urlParams,function(d,
c){f=g.hasOwnProperty(c)?g[c]:r.defaults[c];a.isDefined(f)&&null!==f?(p=encodeURIComponent(f).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"%20").replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+"),e=e.replace(RegExp(":"+c+"(\\W|$)","g"),function(a,c){return p+c})):e=e.replace(RegExp("(/?):"+c+"(\\W|$)","g"),function(a,c,d){return"/"==d.charAt(0)?d:c+d})});e=e.replace(/\/+$/,"")||"/";e=e.replace(/\/\.(?=\w+($|\?))/,".");c.url=e.replace(/\/\\\./,
"/.");s(g,function(a,e){r.urlParams[e]||(c.params=c.params||{},c.params[e]=a)})}};return t}])})(window,window.angular);
//# sourceMappingURL=angular-resource.min.js.map

// angular-sanitize.min.js
/*
 AngularJS v1.2.23
 (c) 2010-2014 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(q,g,r){'use strict';function F(a){var d=[];t(d,g.noop).chars(a);return d.join("")}function m(a){var d={};a=a.split(",");var c;for(c=0;c<a.length;c++)d[a[c]]=!0;return d}function G(a,d){function c(a,b,c,h){b=g.lowercase(b);if(u[b])for(;f.last()&&v[f.last()];)e("",f.last());w[b]&&f.last()==b&&e("",b);(h=x[b]||!!h)||f.push(b);var n={};c.replace(H,function(a,b,d,c,e){n[b]=s(d||c||e||"")});d.start&&d.start(b,n,h)}function e(a,b){var c=0,e;if(b=g.lowercase(b))for(c=f.length-1;0<=c&&f[c]!=b;c--);
if(0<=c){for(e=f.length-1;e>=c;e--)d.end&&d.end(f[e]);f.length=c}}"string"!==typeof a&&(a=null===a||"undefined"===typeof a?"":""+a);var b,l,f=[],n=a,h;for(f.last=function(){return f[f.length-1]};a;){h="";l=!0;if(f.last()&&y[f.last()])a=a.replace(RegExp("(.*)<\\s*\\/\\s*"+f.last()+"[^>]*>","i"),function(a,b){b=b.replace(I,"$1").replace(J,"$1");d.chars&&d.chars(s(b));return""}),e("",f.last());else{if(0===a.indexOf("\x3c!--"))b=a.indexOf("--",4),0<=b&&a.lastIndexOf("--\x3e",b)===b&&(d.comment&&d.comment(a.substring(4,
b)),a=a.substring(b+3),l=!1);else if(z.test(a)){if(b=a.match(z))a=a.replace(b[0],""),l=!1}else if(K.test(a)){if(b=a.match(A))a=a.substring(b[0].length),b[0].replace(A,e),l=!1}else L.test(a)&&((b=a.match(B))?(b[4]&&(a=a.substring(b[0].length),b[0].replace(B,c)),l=!1):(h+="<",a=a.substring(1)));l&&(b=a.indexOf("<"),h+=0>b?a:a.substring(0,b),a=0>b?"":a.substring(b),d.chars&&d.chars(s(h)))}if(a==n)throw M("badparse",a);n=a}e()}function s(a){if(!a)return"";var d=N.exec(a);a=d[1];var c=d[3];if(d=d[2])p.innerHTML=
d.replace(/</g,"&lt;"),d="textContent"in p?p.textContent:p.innerText;return a+d+c}function C(a){return a.replace(/&/g,"&amp;").replace(O,function(a){var c=a.charCodeAt(0);a=a.charCodeAt(1);return"&#"+(1024*(c-55296)+(a-56320)+65536)+";"}).replace(P,function(a){return"&#"+a.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function t(a,d){var c=!1,e=g.bind(a,a.push);return{start:function(a,l,f){a=g.lowercase(a);!c&&y[a]&&(c=a);c||!0!==D[a]||(e("<"),e(a),g.forEach(l,function(c,f){var k=
g.lowercase(f),l="img"===a&&"src"===k||"background"===k;!0!==Q[k]||!0===E[k]&&!d(c,l)||(e(" "),e(f),e('="'),e(C(c)),e('"'))}),e(f?"/>":">"))},end:function(a){a=g.lowercase(a);c||!0!==D[a]||(e("</"),e(a),e(">"));a==c&&(c=!1)},chars:function(a){c||e(C(a))}}}var M=g.$$minErr("$sanitize"),B=/^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/,A=/^<\/\s*([\w:-]+)[^>]*>/,H=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,L=/^</,
K=/^<\//,I=/\x3c!--(.*?)--\x3e/g,z=/<!DOCTYPE([^>]*?)>/i,J=/<!\[CDATA\[(.*?)]]\x3e/g,O=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,P=/([^\#-~| |!])/g,x=m("area,br,col,hr,img,wbr");q=m("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr");r=m("rp,rt");var w=g.extend({},r,q),u=g.extend({},q,m("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul")),v=g.extend({},r,m("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),
y=m("script,style"),D=g.extend({},x,u,v,w),E=m("background,cite,href,longdesc,src,usemap"),Q=g.extend({},E,m("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,target,title,type,valign,value,vspace,width")),p=document.createElement("pre"),N=/^(\s*)([\s\S]*?)(\s*)$/;g.module("ngSanitize",[]).provider("$sanitize",
function(){this.$get=["$$sanitizeUri",function(a){return function(d){var c=[];G(d,t(c,function(c,b){return!/^unsafe/.test(a(c,b))}));return c.join("")}}]});g.module("ngSanitize").filter("linky",["$sanitize",function(a){var d=/((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"]/,c=/^mailto:/;return function(e,b){function l(a){a&&k.push(F(a))}function f(a,c){k.push("<a ");g.isDefined(b)&&(k.push('target="'),k.push(b),k.push('" '));k.push('href="');k.push(a);k.push('">');l(c);k.push("</a>")}
if(!e)return e;for(var n,h=e,k=[],m,p;n=h.match(d);)m=n[0],n[2]==n[3]&&(m="mailto:"+m),p=n.index,l(h.substr(0,p)),f(m,n[0].replace(c,"")),h=h.substring(p+n[0].length);l(h);return a(k.join(""))}}])})(window,window.angular);
//# sourceMappingURL=angular-sanitize.min.js.map


/**
 * Fuse.js v6.4.6 - Lightweight fuzzy-search (http://fusejs.io)
 *
 * Copyright (c) 2021 Kiro Risk (http://kiro.me)
 * All Rights Reserved. Apache Software License 2.0
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 */

(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  typeof define === 'function' && define.amd ? define(factory) :
  (global = global || self, global.Fuse = factory());
}(this, (function () { 'use strict';

  function _typeof(obj) {
    "@babel/helpers - typeof";

    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
      _typeof = function (obj) {
        return typeof obj;
      };
    } else {
      _typeof = function (obj) {
        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
      };
    }

    return _typeof(obj);
  }

  function _classCallCheck(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }

  function _defineProperties(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }

  function _createClass(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties(Constructor, staticProps);
    return Constructor;
  }

  function _defineProperty(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value: value,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value;
    }

    return obj;
  }

  function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);

    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      if (enumerableOnly) symbols = symbols.filter(function (sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      });
      keys.push.apply(keys, symbols);
    }

    return keys;
  }

  function _objectSpread2(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i] != null ? arguments[i] : {};

      if (i % 2) {
        ownKeys(Object(source), true).forEach(function (key) {
          _defineProperty(target, key, source[key]);
        });
      } else if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
      } else {
        ownKeys(Object(source)).forEach(function (key) {
          Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
      }
    }

    return target;
  }

  function _inherits(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }

    subClass.prototype = Object.create(superClass && superClass.prototype, {
      constructor: {
        value: subClass,
        writable: true,
        configurable: true
      }
    });
    if (superClass) _setPrototypeOf(subClass, superClass);
  }

  function _getPrototypeOf(o) {
    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
      return o.__proto__ || Object.getPrototypeOf(o);
    };
    return _getPrototypeOf(o);
  }

  function _setPrototypeOf(o, p) {
    _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
      o.__proto__ = p;
      return o;
    };

    return _setPrototypeOf(o, p);
  }

  function _isNativeReflectConstruct() {
    if (typeof Reflect === "undefined" || !Reflect.construct) return false;
    if (Reflect.construct.sham) return false;
    if (typeof Proxy === "function") return true;

    try {
      Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
      return true;
    } catch (e) {
      return false;
    }
  }

  function _assertThisInitialized(self) {
    if (self === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }

    return self;
  }

  function _possibleConstructorReturn(self, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    }

    return _assertThisInitialized(self);
  }

  function _createSuper(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct();

    return function _createSuperInternal() {
      var Super = _getPrototypeOf(Derived),
          result;

      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf(this).constructor;

        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }

      return _possibleConstructorReturn(this, result);
    };
  }

  function _toConsumableArray(arr) {
    return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  }

  function _arrayWithoutHoles(arr) {
    if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  }

  function _iterableToArray(iter) {
    if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
  }

  function _unsupportedIterableToArray(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return _arrayLikeToArray(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  }

  function _arrayLikeToArray(arr, len) {
    if (len == null || len > arr.length) len = arr.length;

    for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];

    return arr2;
  }

  function _nonIterableSpread() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }

  function isArray(value) {
    return !Array.isArray ? getTag(value) === '[object Array]' : Array.isArray(value);
  } // Adapted from: https://github.com/lodash/lodash/blob/master/.internal/baseToString.js

  var INFINITY = 1 / 0;
  function baseToString(value) {
    // Exit early for strings to avoid a performance hit in some environments.
    if (typeof value == 'string') {
      return value;
    }

    var result = value + '';
    return result == '0' && 1 / value == -INFINITY ? '-0' : result;
  }
  function toString(value) {
    return value == null ? '' : baseToString(value);
  }
  function isString(value) {
    return typeof value === 'string';
  }
  function isNumber(value) {
    return typeof value === 'number';
  } // Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js

  function isBoolean(value) {
    return value === true || value === false || isObjectLike(value) && getTag(value) == '[object Boolean]';
  }
  function isObject(value) {
    return _typeof(value) === 'object';
  } // Checks if `value` is object-like.

  function isObjectLike(value) {
    return isObject(value) && value !== null;
  }
  function isDefined(value) {
    return value !== undefined && value !== null;
  }
  function isBlank(value) {
    return !value.trim().length;
  } // Gets the `toStringTag` of `value`.
  // Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js

  function getTag(value) {
    return value == null ? value === undefined ? '[object Undefined]' : '[object Null]' : Object.prototype.toString.call(value);
  }

  var EXTENDED_SEARCH_UNAVAILABLE = 'Extended search is not available';
  var INCORRECT_INDEX_TYPE = "Incorrect 'index' type";
  var LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = function LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key) {
    return "Invalid value for key ".concat(key);
  };
  var PATTERN_LENGTH_TOO_LARGE = function PATTERN_LENGTH_TOO_LARGE(max) {
    return "Pattern length exceeds max of ".concat(max, ".");
  };
  var MISSING_KEY_PROPERTY = function MISSING_KEY_PROPERTY(name) {
    return "Missing ".concat(name, " property in key");
  };
  var INVALID_KEY_WEIGHT_VALUE = function INVALID_KEY_WEIGHT_VALUE(key) {
    return "Property 'weight' in key '".concat(key, "' must be a positive integer");
  };

  var hasOwn = Object.prototype.hasOwnProperty;

  var KeyStore = /*#__PURE__*/function () {
    function KeyStore(keys) {
      var _this = this;

      _classCallCheck(this, KeyStore);

      this._keys = [];
      this._keyMap = {};
      var totalWeight = 0;
      keys.forEach(function (key) {
        var obj = createKey(key);
        totalWeight += obj.weight;

        _this._keys.push(obj);

        _this._keyMap[obj.id] = obj;
        totalWeight += obj.weight;
      }); // Normalize weights so that their sum is equal to 1

      this._keys.forEach(function (key) {
        key.weight /= totalWeight;
      });
    }

    _createClass(KeyStore, [{
      key: "get",
      value: function get(keyId) {
        return this._keyMap[keyId];
      }
    }, {
      key: "keys",
      value: function keys() {
        return this._keys;
      }
    }, {
      key: "toJSON",
      value: function toJSON() {
        return JSON.stringify(this._keys);
      }
    }]);

    return KeyStore;
  }();
  function createKey(key) {
    var path = null;
    var id = null;
    var src = null;
    var weight = 1;

    if (isString(key) || isArray(key)) {
      src = key;
      path = createKeyPath(key);
      id = createKeyId(key);
    } else {
      if (!hasOwn.call(key, 'name')) {
        throw new Error(MISSING_KEY_PROPERTY('name'));
      }

      var name = key.name;
      src = name;

      if (hasOwn.call(key, 'weight')) {
        weight = key.weight;

        if (weight <= 0) {
          throw new Error(INVALID_KEY_WEIGHT_VALUE(name));
        }
      }

      path = createKeyPath(name);
      id = createKeyId(name);
    }

    return {
      path: path,
      id: id,
      weight: weight,
      src: src
    };
  }
  function createKeyPath(key) {
    return isArray(key) ? key : key.split('.');
  }
  function createKeyId(key) {
    return isArray(key) ? key.join('.') : key;
  }

  function get(obj, path) {
    var list = [];
    var arr = false;

    var deepGet = function deepGet(obj, path, index) {
      if (!isDefined(obj)) {
        return;
      }

      if (!path[index]) {
        // If there's no path left, we've arrived at the object we care about.
        list.push(obj);
      } else {
        var key = path[index];
        var value = obj[key];

        if (!isDefined(value)) {
          return;
        } // If we're at the last value in the path, and if it's a string/number/bool,
        // add it to the list


        if (index === path.length - 1 && (isString(value) || isNumber(value) || isBoolean(value))) {
          list.push(toString(value));
        } else if (isArray(value)) {
          arr = true; // Search each item in the array.

          for (var i = 0, len = value.length; i < len; i += 1) {
            deepGet(value[i], path, index + 1);
          }
        } else if (path.length) {
          // An object. Recurse further.
          deepGet(value, path, index + 1);
        }
      }
    }; // Backwards compatibility (since path used to be a string)


    deepGet(obj, isString(path) ? path.split('.') : path, 0);
    return arr ? list : list[0];
  }

  var MatchOptions = {
    // Whether the matches should be included in the result set. When `true`, each record in the result
    // set will include the indices of the matched characters.
    // These can consequently be used for highlighting purposes.
    includeMatches: false,
    // When `true`, the matching function will continue to the end of a search pattern even if
    // a perfect match has already been located in the string.
    findAllMatches: false,
    // Minimum number of characters that must be matched before a result is considered a match
    minMatchCharLength: 1
  };
  var BasicOptions = {
    // When `true`, the algorithm continues searching to the end of the input even if a perfect
    // match is found before the end of the same input.
    isCaseSensitive: false,
    // When true, the matching function will continue to the end of a search pattern even if
    includeScore: false,
    // List of properties that will be searched. This also supports nested properties.
    keys: [],
    // Whether to sort the result list, by score
    shouldSort: true,
    // Default sort function: sort by ascending score, ascending index
    sortFn: function sortFn(a, b) {
      return a.score === b.score ? a.idx < b.idx ? -1 : 1 : a.score < b.score ? -1 : 1;
    }
  };
  var FuzzyOptions = {
    // Approximately where in the text is the pattern expected to be found?
    location: 0,
    // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
    // (of both letters and location), a threshold of '1.0' would match anything.
    threshold: 0.6,
    // Determines how close the match must be to the fuzzy location (specified above).
    // An exact letter match which is 'distance' characters away from the fuzzy location
    // would score as a complete mismatch. A distance of '0' requires the match be at
    // the exact location specified, a threshold of '1000' would require a perfect match
    // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
    distance: 100
  };
  var AdvancedOptions = {
    // When `true`, it enables the use of unix-like search commands
    useExtendedSearch: false,
    // The get function to use when fetching an object's properties.
    // The default will search nested paths *ie foo.bar.baz*
    getFn: get,
    // When `true`, search will ignore `location` and `distance`, so it won't matter
    // where in the string the pattern appears.
    // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
    ignoreLocation: false,
    // When `true`, the calculation for the relevance score (used for sorting) will
    // ignore the field-length norm.
    // More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
    ignoreFieldNorm: false
  };
  var Config = _objectSpread2({}, BasicOptions, {}, MatchOptions, {}, FuzzyOptions, {}, AdvancedOptions);

  var SPACE = /[^ ]+/g; // Field-length norm: the shorter the field, the higher the weight.
  // Set to 3 decimals to reduce index size.

  function norm() {
    var mantissa = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 3;
    var cache = new Map();
    var m = Math.pow(10, mantissa);
    return {
      get: function get(value) {
        var numTokens = value.match(SPACE).length;

        if (cache.has(numTokens)) {
          return cache.get(numTokens);
        }

        var norm = 1 / Math.sqrt(numTokens); // In place of `toFixed(mantissa)`, for faster computation

        var n = parseFloat(Math.round(norm * m) / m);
        cache.set(numTokens, n);
        return n;
      },
      clear: function clear() {
        cache.clear();
      }
    };
  }

  var FuseIndex = /*#__PURE__*/function () {
    function FuseIndex() {
      var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
          _ref$getFn = _ref.getFn,
          getFn = _ref$getFn === void 0 ? Config.getFn : _ref$getFn;

      _classCallCheck(this, FuseIndex);

      this.norm = norm(3);
      this.getFn = getFn;
      this.isCreated = false;
      this.setIndexRecords();
    }

    _createClass(FuseIndex, [{
      key: "setSources",
      value: function setSources() {
        var docs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
        this.docs = docs;
      }
    }, {
      key: "setIndexRecords",
      value: function setIndexRecords() {
        var records = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
        this.records = records;
      }
    }, {
      key: "setKeys",
      value: function setKeys() {
        var _this = this;

        var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
        this.keys = keys;
        this._keysMap = {};
        keys.forEach(function (key, idx) {
          _this._keysMap[key.id] = idx;
        });
      }
    }, {
      key: "create",
      value: function create() {
        var _this2 = this;

        if (this.isCreated || !this.docs.length) {
          return;
        }

        this.isCreated = true; // List is Array<String>

        if (isString(this.docs[0])) {
          this.docs.forEach(function (doc, docIndex) {
            _this2._addString(doc, docIndex);
          });
        } else {
          // List is Array<Object>
          this.docs.forEach(function (doc, docIndex) {
            _this2._addObject(doc, docIndex);
          });
        }

        this.norm.clear();
      } // Adds a doc to the end of the index

    }, {
      key: "add",
      value: function add(doc) {
        var idx = this.size();

        if (isString(doc)) {
          this._addString(doc, idx);
        } else {
          this._addObject(doc, idx);
        }
      } // Removes the doc at the specified index of the index

    }, {
      key: "removeAt",
      value: function removeAt(idx) {
        this.records.splice(idx, 1); // Change ref index of every subsquent doc

        for (var i = idx, len = this.size(); i < len; i += 1) {
          this.records[i].i -= 1;
        }
      }
    }, {
      key: "getValueForItemAtKeyId",
      value: function getValueForItemAtKeyId(item, keyId) {
        return item[this._keysMap[keyId]];
      }
    }, {
      key: "size",
      value: function size() {
        return this.records.length;
      }
    }, {
      key: "_addString",
      value: function _addString(doc, docIndex) {
        if (!isDefined(doc) || isBlank(doc)) {
          return;
        }

        var record = {
          v: doc,
          i: docIndex,
          n: this.norm.get(doc)
        };
        this.records.push(record);
      }
    }, {
      key: "_addObject",
      value: function _addObject(doc, docIndex) {
        var _this3 = this;

        var record = {
          i: docIndex,
          $: {}
        }; // Iterate over every key (i.e, path), and fetch the value at that key

        this.keys.forEach(function (key, keyIndex) {
          // console.log(key)
          var value = _this3.getFn(doc, key.path);

          if (!isDefined(value)) {
            return;
          }

          if (isArray(value)) {
            (function () {
              var subRecords = [];
              var stack = [{
                nestedArrIndex: -1,
                value: value
              }];

              while (stack.length) {
                var _stack$pop = stack.pop(),
                    nestedArrIndex = _stack$pop.nestedArrIndex,
                    _value = _stack$pop.value;

                if (!isDefined(_value)) {
                  continue;
                }

                if (isString(_value) && !isBlank(_value)) {
                  var subRecord = {
                    v: _value,
                    i: nestedArrIndex,
                    n: _this3.norm.get(_value)
                  };
                  subRecords.push(subRecord);
                } else if (isArray(_value)) {
                  _value.forEach(function (item, k) {
                    stack.push({
                      nestedArrIndex: k,
                      value: item
                    });
                  });
                }
              }

              record.$[keyIndex] = subRecords;
            })();
          } else if (!isBlank(value)) {
            var subRecord = {
              v: value,
              n: _this3.norm.get(value)
            };
            record.$[keyIndex] = subRecord;
          }
        });
        this.records.push(record);
      }
    }, {
      key: "toJSON",
      value: function toJSON() {
        return {
          keys: this.keys,
          records: this.records
        };
      }
    }]);

    return FuseIndex;
  }();
  function createIndex(keys, docs) {
    var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
        _ref2$getFn = _ref2.getFn,
        getFn = _ref2$getFn === void 0 ? Config.getFn : _ref2$getFn;

    var myIndex = new FuseIndex({
      getFn: getFn
    });
    myIndex.setKeys(keys.map(createKey));
    myIndex.setSources(docs);
    myIndex.create();
    return myIndex;
  }
  function parseIndex(data) {
    var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
        _ref3$getFn = _ref3.getFn,
        getFn = _ref3$getFn === void 0 ? Config.getFn : _ref3$getFn;

    var keys = data.keys,
        records = data.records;
    var myIndex = new FuseIndex({
      getFn: getFn
    });
    myIndex.setKeys(keys);
    myIndex.setIndexRecords(records);
    return myIndex;
  }

  function computeScore(pattern) {
    var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
        _ref$errors = _ref.errors,
        errors = _ref$errors === void 0 ? 0 : _ref$errors,
        _ref$currentLocation = _ref.currentLocation,
        currentLocation = _ref$currentLocation === void 0 ? 0 : _ref$currentLocation,
        _ref$expectedLocation = _ref.expectedLocation,
        expectedLocation = _ref$expectedLocation === void 0 ? 0 : _ref$expectedLocation,
        _ref$distance = _ref.distance,
        distance = _ref$distance === void 0 ? Config.distance : _ref$distance,
        _ref$ignoreLocation = _ref.ignoreLocation,
        ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation;

    var accuracy = errors / pattern.length;

    if (ignoreLocation) {
      return accuracy;
    }

    var proximity = Math.abs(expectedLocation - currentLocation);

    if (!distance) {
      // Dodge divide by zero error.
      return proximity ? 1.0 : accuracy;
    }

    return accuracy + proximity / distance;
  }

  function convertMaskToIndices() {
    var matchmask = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
    var minMatchCharLength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Config.minMatchCharLength;
    var indices = [];
    var start = -1;
    var end = -1;
    var i = 0;

    for (var len = matchmask.length; i < len; i += 1) {
      var match = matchmask[i];

      if (match && start === -1) {
        start = i;
      } else if (!match && start !== -1) {
        end = i - 1;

        if (end - start + 1 >= minMatchCharLength) {
          indices.push([start, end]);
        }

        start = -1;
      }
    } // (i-1 - start) + 1 => i - start


    if (matchmask[i - 1] && i - start >= minMatchCharLength) {
      indices.push([start, i - 1]);
    }

    return indices;
  }

  // Machine word size
  var MAX_BITS = 32;

  function search(text, pattern, patternAlphabet) {
    var _ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
        _ref$location = _ref.location,
        location = _ref$location === void 0 ? Config.location : _ref$location,
        _ref$distance = _ref.distance,
        distance = _ref$distance === void 0 ? Config.distance : _ref$distance,
        _ref$threshold = _ref.threshold,
        threshold = _ref$threshold === void 0 ? Config.threshold : _ref$threshold,
        _ref$findAllMatches = _ref.findAllMatches,
        findAllMatches = _ref$findAllMatches === void 0 ? Config.findAllMatches : _ref$findAllMatches,
        _ref$minMatchCharLeng = _ref.minMatchCharLength,
        minMatchCharLength = _ref$minMatchCharLeng === void 0 ? Config.minMatchCharLength : _ref$minMatchCharLeng,
        _ref$includeMatches = _ref.includeMatches,
        includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
        _ref$ignoreLocation = _ref.ignoreLocation,
        ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation;

    if (pattern.length > MAX_BITS) {
      throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS));
    }

    var patternLen = pattern.length; // Set starting location at beginning text and initialize the alphabet.

    var textLen = text.length; // Handle the case when location > text.length

    var expectedLocation = Math.max(0, Math.min(location, textLen)); // Highest score beyond which we give up.

    var currentThreshold = threshold; // Is there a nearby exact match? (speedup)

    var bestLocation = expectedLocation; // Performance: only computer matches when the minMatchCharLength > 1
    // OR if `includeMatches` is true.

    var computeMatches = minMatchCharLength > 1 || includeMatches; // A mask of the matches, used for building the indices

    var matchMask = computeMatches ? Array(textLen) : [];
    var index; // Get all exact matches, here for speed up

    while ((index = text.indexOf(pattern, bestLocation)) > -1) {
      var score = computeScore(pattern, {
        currentLocation: index,
        expectedLocation: expectedLocation,
        distance: distance,
        ignoreLocation: ignoreLocation
      });
      currentThreshold = Math.min(score, currentThreshold);
      bestLocation = index + patternLen;

      if (computeMatches) {
        var i = 0;

        while (i < patternLen) {
          matchMask[index + i] = 1;
          i += 1;
        }
      }
    } // Reset the best location


    bestLocation = -1;
    var lastBitArr = [];
    var finalScore = 1;
    var binMax = patternLen + textLen;
    var mask = 1 << patternLen - 1;

    for (var _i = 0; _i < patternLen; _i += 1) {
      // Scan for the best match; each iteration allows for one more error.
      // Run a binary search to determine how far from the match location we can stray
      // at this error level.
      var binMin = 0;
      var binMid = binMax;

      while (binMin < binMid) {
        var _score2 = computeScore(pattern, {
          errors: _i,
          currentLocation: expectedLocation + binMid,
          expectedLocation: expectedLocation,
          distance: distance,
          ignoreLocation: ignoreLocation
        });

        if (_score2 <= currentThreshold) {
          binMin = binMid;
        } else {
          binMax = binMid;
        }

        binMid = Math.floor((binMax - binMin) / 2 + binMin);
      } // Use the result from this iteration as the maximum for the next.


      binMax = binMid;
      var start = Math.max(1, expectedLocation - binMid + 1);
      var finish = findAllMatches ? textLen : Math.min(expectedLocation + binMid, textLen) + patternLen; // Initialize the bit array

      var bitArr = Array(finish + 2);
      bitArr[finish + 1] = (1 << _i) - 1;

      for (var j = finish; j >= start; j -= 1) {
        var currentLocation = j - 1;
        var charMatch = patternAlphabet[text.charAt(currentLocation)];

        if (computeMatches) {
          // Speed up: quick bool to int conversion (i.e, `charMatch ? 1 : 0`)
          matchMask[currentLocation] = +!!charMatch;
        } // First pass: exact match


        bitArr[j] = (bitArr[j + 1] << 1 | 1) & charMatch; // Subsequent passes: fuzzy match

        if (_i) {
          bitArr[j] |= (lastBitArr[j + 1] | lastBitArr[j]) << 1 | 1 | lastBitArr[j + 1];
        }

        if (bitArr[j] & mask) {
          finalScore = computeScore(pattern, {
            errors: _i,
            currentLocation: currentLocation,
            expectedLocation: expectedLocation,
            distance: distance,
            ignoreLocation: ignoreLocation
          }); // This match will almost certainly be better than any existing match.
          // But check anyway.

          if (finalScore <= currentThreshold) {
            // Indeed it is
            currentThreshold = finalScore;
            bestLocation = currentLocation; // Already passed `loc`, downhill from here on in.

            if (bestLocation <= expectedLocation) {
              break;
            } // When passing `bestLocation`, don't exceed our current distance from `expectedLocation`.


            start = Math.max(1, 2 * expectedLocation - bestLocation);
          }
        }
      } // No hope for a (better) match at greater error levels.


      var _score = computeScore(pattern, {
        errors: _i + 1,
        currentLocation: expectedLocation,
        expectedLocation: expectedLocation,
        distance: distance,
        ignoreLocation: ignoreLocation
      });

      if (_score > currentThreshold) {
        break;
      }

      lastBitArr = bitArr;
    }

    var result = {
      isMatch: bestLocation >= 0,
      // Count exact matches (those with a score of 0) to be "almost" exact
      score: Math.max(0.001, finalScore)
    };

    if (computeMatches) {
      var indices = convertMaskToIndices(matchMask, minMatchCharLength);

      if (!indices.length) {
        result.isMatch = false;
      } else if (includeMatches) {
        result.indices = indices;
      }
    }

    return result;
  }

  function createPatternAlphabet(pattern) {
    var mask = {};

    for (var i = 0, len = pattern.length; i < len; i += 1) {
      var char = pattern.charAt(i);
      mask[char] = (mask[char] || 0) | 1 << len - i - 1;
    }

    return mask;
  }

  var BitapSearch = /*#__PURE__*/function () {
    function BitapSearch(pattern) {
      var _this = this;

      var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
          _ref$location = _ref.location,
          location = _ref$location === void 0 ? Config.location : _ref$location,
          _ref$threshold = _ref.threshold,
          threshold = _ref$threshold === void 0 ? Config.threshold : _ref$threshold,
          _ref$distance = _ref.distance,
          distance = _ref$distance === void 0 ? Config.distance : _ref$distance,
          _ref$includeMatches = _ref.includeMatches,
          includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
          _ref$findAllMatches = _ref.findAllMatches,
          findAllMatches = _ref$findAllMatches === void 0 ? Config.findAllMatches : _ref$findAllMatches,
          _ref$minMatchCharLeng = _ref.minMatchCharLength,
          minMatchCharLength = _ref$minMatchCharLeng === void 0 ? Config.minMatchCharLength : _ref$minMatchCharLeng,
          _ref$isCaseSensitive = _ref.isCaseSensitive,
          isCaseSensitive = _ref$isCaseSensitive === void 0 ? Config.isCaseSensitive : _ref$isCaseSensitive,
          _ref$ignoreLocation = _ref.ignoreLocation,
          ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation;

      _classCallCheck(this, BitapSearch);

      this.options = {
        location: location,
        threshold: threshold,
        distance: distance,
        includeMatches: includeMatches,
        findAllMatches: findAllMatches,
        minMatchCharLength: minMatchCharLength,
        isCaseSensitive: isCaseSensitive,
        ignoreLocation: ignoreLocation
      };
      this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
      this.chunks = [];

      if (!this.pattern.length) {
        return;
      }

      var addChunk = function addChunk(pattern, startIndex) {
        _this.chunks.push({
          pattern: pattern,
          alphabet: createPatternAlphabet(pattern),
          startIndex: startIndex
        });
      };

      var len = this.pattern.length;

      if (len > MAX_BITS) {
        var i = 0;
        var remainder = len % MAX_BITS;
        var end = len - remainder;

        while (i < end) {
          addChunk(this.pattern.substr(i, MAX_BITS), i);
          i += MAX_BITS;
        }

        if (remainder) {
          var startIndex = len - MAX_BITS;
          addChunk(this.pattern.substr(startIndex), startIndex);
        }
      } else {
        addChunk(this.pattern, 0);
      }
    }

    _createClass(BitapSearch, [{
      key: "searchIn",
      value: function searchIn(text) {
        var _this$options = this.options,
            isCaseSensitive = _this$options.isCaseSensitive,
            includeMatches = _this$options.includeMatches;

        if (!isCaseSensitive) {
          text = text.toLowerCase();
        } // Exact match


        if (this.pattern === text) {
          var _result = {
            isMatch: true,
            score: 0
          };

          if (includeMatches) {
            _result.indices = [[0, text.length - 1]];
          }

          return _result;
        } // Otherwise, use Bitap algorithm


        var _this$options2 = this.options,
            location = _this$options2.location,
            distance = _this$options2.distance,
            threshold = _this$options2.threshold,
            findAllMatches = _this$options2.findAllMatches,
            minMatchCharLength = _this$options2.minMatchCharLength,
            ignoreLocation = _this$options2.ignoreLocation;
        var allIndices = [];
        var totalScore = 0;
        var hasMatches = false;
        this.chunks.forEach(function (_ref2) {
          var pattern = _ref2.pattern,
              alphabet = _ref2.alphabet,
              startIndex = _ref2.startIndex;

          var _search = search(text, pattern, alphabet, {
            location: location + startIndex,
            distance: distance,
            threshold: threshold,
            findAllMatches: findAllMatches,
            minMatchCharLength: minMatchCharLength,
            includeMatches: includeMatches,
            ignoreLocation: ignoreLocation
          }),
              isMatch = _search.isMatch,
              score = _search.score,
              indices = _search.indices;

          if (isMatch) {
            hasMatches = true;
          }

          totalScore += score;

          if (isMatch && indices) {
            allIndices = [].concat(_toConsumableArray(allIndices), _toConsumableArray(indices));
          }
        });
        var result = {
          isMatch: hasMatches,
          score: hasMatches ? totalScore / this.chunks.length : 1
        };

        if (hasMatches && includeMatches) {
          result.indices = allIndices;
        }

        return result;
      }
    }]);

    return BitapSearch;
  }();

  var BaseMatch = /*#__PURE__*/function () {
    function BaseMatch(pattern) {
      _classCallCheck(this, BaseMatch);

      this.pattern = pattern;
    }

    _createClass(BaseMatch, [{
      key: "search",
      value: function search()
      /*text*/
      {}
    }], [{
      key: "isMultiMatch",
      value: function isMultiMatch(pattern) {
        return getMatch(pattern, this.multiRegex);
      }
    }, {
      key: "isSingleMatch",
      value: function isSingleMatch(pattern) {
        return getMatch(pattern, this.singleRegex);
      }
    }]);

    return BaseMatch;
  }();

  function getMatch(pattern, exp) {
    var matches = pattern.match(exp);
    return matches ? matches[1] : null;
  }

  var ExactMatch = /*#__PURE__*/function (_BaseMatch) {
    _inherits(ExactMatch, _BaseMatch);

    var _super = _createSuper(ExactMatch);

    function ExactMatch(pattern) {
      _classCallCheck(this, ExactMatch);

      return _super.call(this, pattern);
    }

    _createClass(ExactMatch, [{
      key: "search",
      value: function search(text) {
        var isMatch = text === this.pattern;
        return {
          isMatch: isMatch,
          score: isMatch ? 0 : 1,
          indices: [0, this.pattern.length - 1]
        };
      }
    }], [{
      key: "type",
      get: function get() {
        return 'exact';
      }
    }, {
      key: "multiRegex",
      get: function get() {
        return /^="(.*)"$/;
      }
    }, {
      key: "singleRegex",
      get: function get() {
        return /^=(.*)$/;
      }
    }]);

    return ExactMatch;
  }(BaseMatch);

  var InverseExactMatch = /*#__PURE__*/function (_BaseMatch) {
    _inherits(InverseExactMatch, _BaseMatch);

    var _super = _createSuper(InverseExactMatch);

    function InverseExactMatch(pattern) {
      _classCallCheck(this, InverseExactMatch);

      return _super.call(this, pattern);
    }

    _createClass(InverseExactMatch, [{
      key: "search",
      value: function search(text) {
        var index = text.indexOf(this.pattern);
        var isMatch = index === -1;
        return {
          isMatch: isMatch,
          score: isMatch ? 0 : 1,
          indices: [0, text.length - 1]
        };
      }
    }], [{
      key: "type",
      get: function get() {
        return 'inverse-exact';
      }
    }, {
      key: "multiRegex",
      get: function get() {
        return /^!"(.*)"$/;
      }
    }, {
      key: "singleRegex",
      get: function get() {
        return /^!(.*)$/;
      }
    }]);

    return InverseExactMatch;
  }(BaseMatch);

  var PrefixExactMatch = /*#__PURE__*/function (_BaseMatch) {
    _inherits(PrefixExactMatch, _BaseMatch);

    var _super = _createSuper(PrefixExactMatch);

    function PrefixExactMatch(pattern) {
      _classCallCheck(this, PrefixExactMatch);

      return _super.call(this, pattern);
    }

    _createClass(PrefixExactMatch, [{
      key: "search",
      value: function search(text) {
        var isMatch = text.startsWith(this.pattern);
        return {
          isMatch: isMatch,
          score: isMatch ? 0 : 1,
          indices: [0, this.pattern.length - 1]
        };
      }
    }], [{
      key: "type",
      get: function get() {
        return 'prefix-exact';
      }
    }, {
      key: "multiRegex",
      get: function get() {
        return /^\^"(.*)"$/;
      }
    }, {
      key: "singleRegex",
      get: function get() {
        return /^\^(.*)$/;
      }
    }]);

    return PrefixExactMatch;
  }(BaseMatch);

  var InversePrefixExactMatch = /*#__PURE__*/function (_BaseMatch) {
    _inherits(InversePrefixExactMatch, _BaseMatch);

    var _super = _createSuper(InversePrefixExactMatch);

    function InversePrefixExactMatch(pattern) {
      _classCallCheck(this, InversePrefixExactMatch);

      return _super.call(this, pattern);
    }

    _createClass(InversePrefixExactMatch, [{
      key: "search",
      value: function search(text) {
        var isMatch = !text.startsWith(this.pattern);
        return {
          isMatch: isMatch,
          score: isMatch ? 0 : 1,
          indices: [0, text.length - 1]
        };
      }
    }], [{
      key: "type",
      get: function get() {
        return 'inverse-prefix-exact';
      }
    }, {
      key: "multiRegex",
      get: function get() {
        return /^!\^"(.*)"$/;
      }
    }, {
      key: "singleRegex",
      get: function get() {
        return /^!\^(.*)$/;
      }
    }]);

    return InversePrefixExactMatch;
  }(BaseMatch);

  var SuffixExactMatch = /*#__PURE__*/function (_BaseMatch) {
    _inherits(SuffixExactMatch, _BaseMatch);

    var _super = _createSuper(SuffixExactMatch);

    function SuffixExactMatch(pattern) {
      _classCallCheck(this, SuffixExactMatch);

      return _super.call(this, pattern);
    }

    _createClass(SuffixExactMatch, [{
      key: "search",
      value: function search(text) {
        var isMatch = text.endsWith(this.pattern);
        return {
          isMatch: isMatch,
          score: isMatch ? 0 : 1,
          indices: [text.length - this.pattern.length, text.length - 1]
        };
      }
    }], [{
      key: "type",
      get: function get() {
        return 'suffix-exact';
      }
    }, {
      key: "multiRegex",
      get: function get() {
        return /^"(.*)"\$$/;
      }
    }, {
      key: "singleRegex",
      get: function get() {
        return /^(.*)\$$/;
      }
    }]);

    return SuffixExactMatch;
  }(BaseMatch);

  var InverseSuffixExactMatch = /*#__PURE__*/function (_BaseMatch) {
    _inherits(InverseSuffixExactMatch, _BaseMatch);

    var _super = _createSuper(InverseSuffixExactMatch);

    function InverseSuffixExactMatch(pattern) {
      _classCallCheck(this, InverseSuffixExactMatch);

      return _super.call(this, pattern);
    }

    _createClass(InverseSuffixExactMatch, [{
      key: "search",
      value: function search(text) {
        var isMatch = !text.endsWith(this.pattern);
        return {
          isMatch: isMatch,
          score: isMatch ? 0 : 1,
          indices: [0, text.length - 1]
        };
      }
    }], [{
      key: "type",
      get: function get() {
        return 'inverse-suffix-exact';
      }
    }, {
      key: "multiRegex",
      get: function get() {
        return /^!"(.*)"\$$/;
      }
    }, {
      key: "singleRegex",
      get: function get() {
        return /^!(.*)\$$/;
      }
    }]);

    return InverseSuffixExactMatch;
  }(BaseMatch);

  var FuzzyMatch = /*#__PURE__*/function (_BaseMatch) {
    _inherits(FuzzyMatch, _BaseMatch);

    var _super = _createSuper(FuzzyMatch);

    function FuzzyMatch(pattern) {
      var _this;

      var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
          _ref$location = _ref.location,
          location = _ref$location === void 0 ? Config.location : _ref$location,
          _ref$threshold = _ref.threshold,
          threshold = _ref$threshold === void 0 ? Config.threshold : _ref$threshold,
          _ref$distance = _ref.distance,
          distance = _ref$distance === void 0 ? Config.distance : _ref$distance,
          _ref$includeMatches = _ref.includeMatches,
          includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
          _ref$findAllMatches = _ref.findAllMatches,
          findAllMatches = _ref$findAllMatches === void 0 ? Config.findAllMatches : _ref$findAllMatches,
          _ref$minMatchCharLeng = _ref.minMatchCharLength,
          minMatchCharLength = _ref$minMatchCharLeng === void 0 ? Config.minMatchCharLength : _ref$minMatchCharLeng,
          _ref$isCaseSensitive = _ref.isCaseSensitive,
          isCaseSensitive = _ref$isCaseSensitive === void 0 ? Config.isCaseSensitive : _ref$isCaseSensitive,
          _ref$ignoreLocation = _ref.ignoreLocation,
          ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation;

      _classCallCheck(this, FuzzyMatch);

      _this = _super.call(this, pattern);
      _this._bitapSearch = new BitapSearch(pattern, {
        location: location,
        threshold: threshold,
        distance: distance,
        includeMatches: includeMatches,
        findAllMatches: findAllMatches,
        minMatchCharLength: minMatchCharLength,
        isCaseSensitive: isCaseSensitive,
        ignoreLocation: ignoreLocation
      });
      return _this;
    }

    _createClass(FuzzyMatch, [{
      key: "search",
      value: function search(text) {
        return this._bitapSearch.searchIn(text);
      }
    }], [{
      key: "type",
      get: function get() {
        return 'fuzzy';
      }
    }, {
      key: "multiRegex",
      get: function get() {
        return /^"(.*)"$/;
      }
    }, {
      key: "singleRegex",
      get: function get() {
        return /^(.*)$/;
      }
    }]);

    return FuzzyMatch;
  }(BaseMatch);

  var IncludeMatch = /*#__PURE__*/function (_BaseMatch) {
    _inherits(IncludeMatch, _BaseMatch);

    var _super = _createSuper(IncludeMatch);

    function IncludeMatch(pattern) {
      _classCallCheck(this, IncludeMatch);

      return _super.call(this, pattern);
    }

    _createClass(IncludeMatch, [{
      key: "search",
      value: function search(text) {
        var location = 0;
        var index;
        var indices = [];
        var patternLen = this.pattern.length; // Get all exact matches

        while ((index = text.indexOf(this.pattern, location)) > -1) {
          location = index + patternLen;
          indices.push([index, location - 1]);
        }

        var isMatch = !!indices.length;
        return {
          isMatch: isMatch,
          score: isMatch ? 0 : 1,
          indices: indices
        };
      }
    }], [{
      key: "type",
      get: function get() {
        return 'include';
      }
    }, {
      key: "multiRegex",
      get: function get() {
        return /^'"(.*)"$/;
      }
    }, {
      key: "singleRegex",
      get: function get() {
        return /^'(.*)$/;
      }
    }]);

    return IncludeMatch;
  }(BaseMatch);

  var searchers = [ExactMatch, IncludeMatch, PrefixExactMatch, InversePrefixExactMatch, InverseSuffixExactMatch, SuffixExactMatch, InverseExactMatch, FuzzyMatch];
  var searchersLen = searchers.length; // Regex to split by spaces, but keep anything in quotes together

  var SPACE_RE = / +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;
  var OR_TOKEN = '|'; // Return a 2D array representation of the query, for simpler parsing.
  // Example:
  // "^core go$ | rb$ | py$ xy$" => [["^core", "go$"], ["rb$"], ["py$", "xy$"]]

  function parseQuery(pattern) {
    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    return pattern.split(OR_TOKEN).map(function (item) {
      var query = item.trim().split(SPACE_RE).filter(function (item) {
        return item && !!item.trim();
      });
      var results = [];

      for (var i = 0, len = query.length; i < len; i += 1) {
        var queryItem = query[i]; // 1. Handle multiple query match (i.e, once that are quoted, like `"hello world"`)

        var found = false;
        var idx = -1;

        while (!found && ++idx < searchersLen) {
          var searcher = searchers[idx];
          var token = searcher.isMultiMatch(queryItem);

          if (token) {
            results.push(new searcher(token, options));
            found = true;
          }
        }

        if (found) {
          continue;
        } // 2. Handle single query matches (i.e, once that are *not* quoted)


        idx = -1;

        while (++idx < searchersLen) {
          var _searcher = searchers[idx];

          var _token = _searcher.isSingleMatch(queryItem);

          if (_token) {
            results.push(new _searcher(_token, options));
            break;
          }
        }
      }

      return results;
    });
  }

  // to a singl match

  var MultiMatchSet = new Set([FuzzyMatch.type, IncludeMatch.type]);
  /**
   * Command-like searching
   * ======================
   *
   * Given multiple search terms delimited by spaces.e.g. `^jscript .python$ ruby !java`,
   * search in a given text.
   *
   * Search syntax:
   *
   * | Token       | Match type                 | Description                            |
   * | ----------- | -------------------------- | -------------------------------------- |
   * | `jscript`   | fuzzy-match                | Items that fuzzy match `jscript`       |
   * | `=scheme`   | exact-match                | Items that are `scheme`                |
   * | `'python`   | include-match              | Items that include `python`            |
   * | `!ruby`     | inverse-exact-match        | Items that do not include `ruby`       |
   * | `^java`     | prefix-exact-match         | Items that start with `java`           |
   * | `!^earlang` | inverse-prefix-exact-match | Items that do not start with `earlang` |
   * | `.js$`      | suffix-exact-match         | Items that end with `.js`              |
   * | `!.go$`     | inverse-suffix-exact-match | Items that do not end with `.go`       |
   *
   * A single pipe character acts as an OR operator. For example, the following
   * query matches entries that start with `core` and end with either`go`, `rb`,
   * or`py`.
   *
   * ```
   * ^core go$ | rb$ | py$
   * ```
   */

  var ExtendedSearch = /*#__PURE__*/function () {
    function ExtendedSearch(pattern) {
      var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
          _ref$isCaseSensitive = _ref.isCaseSensitive,
          isCaseSensitive = _ref$isCaseSensitive === void 0 ? Config.isCaseSensitive : _ref$isCaseSensitive,
          _ref$includeMatches = _ref.includeMatches,
          includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
          _ref$minMatchCharLeng = _ref.minMatchCharLength,
          minMatchCharLength = _ref$minMatchCharLeng === void 0 ? Config.minMatchCharLength : _ref$minMatchCharLeng,
          _ref$ignoreLocation = _ref.ignoreLocation,
          ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation,
          _ref$findAllMatches = _ref.findAllMatches,
          findAllMatches = _ref$findAllMatches === void 0 ? Config.findAllMatches : _ref$findAllMatches,
          _ref$location = _ref.location,
          location = _ref$location === void 0 ? Config.location : _ref$location,
          _ref$threshold = _ref.threshold,
          threshold = _ref$threshold === void 0 ? Config.threshold : _ref$threshold,
          _ref$distance = _ref.distance,
          distance = _ref$distance === void 0 ? Config.distance : _ref$distance;

      _classCallCheck(this, ExtendedSearch);

      this.query = null;
      this.options = {
        isCaseSensitive: isCaseSensitive,
        includeMatches: includeMatches,
        minMatchCharLength: minMatchCharLength,
        findAllMatches: findAllMatches,
        ignoreLocation: ignoreLocation,
        location: location,
        threshold: threshold,
        distance: distance
      };
      this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
      this.query = parseQuery(this.pattern, this.options);
    }

    _createClass(ExtendedSearch, [{
      key: "searchIn",
      value: function searchIn(text) {
        var query = this.query;

        if (!query) {
          return {
            isMatch: false,
            score: 1
          };
        }

        var _this$options = this.options,
            includeMatches = _this$options.includeMatches,
            isCaseSensitive = _this$options.isCaseSensitive;
        text = isCaseSensitive ? text : text.toLowerCase();
        var numMatches = 0;
        var allIndices = [];
        var totalScore = 0; // ORs

        for (var i = 0, qLen = query.length; i < qLen; i += 1) {
          var searchers = query[i]; // Reset indices

          allIndices.length = 0;
          numMatches = 0; // ANDs

          for (var j = 0, pLen = searchers.length; j < pLen; j += 1) {
            var searcher = searchers[j];

            var _searcher$search = searcher.search(text),
                isMatch = _searcher$search.isMatch,
                indices = _searcher$search.indices,
                score = _searcher$search.score;

            if (isMatch) {
              numMatches += 1;
              totalScore += score;

              if (includeMatches) {
                var type = searcher.constructor.type;

                if (MultiMatchSet.has(type)) {
                  allIndices = [].concat(_toConsumableArray(allIndices), _toConsumableArray(indices));
                } else {
                  allIndices.push(indices);
                }
              }
            } else {
              totalScore = 0;
              numMatches = 0;
              allIndices.length = 0;
              break;
            }
          } // OR condition, so if TRUE, return


          if (numMatches) {
            var result = {
              isMatch: true,
              score: totalScore / numMatches
            };

            if (includeMatches) {
              result.indices = allIndices;
            }

            return result;
          }
        } // Nothing was matched


        return {
          isMatch: false,
          score: 1
        };
      }
    }], [{
      key: "condition",
      value: function condition(_, options) {
        return options.useExtendedSearch;
      }
    }]);

    return ExtendedSearch;
  }();

  var registeredSearchers = [];
  function register() {
    registeredSearchers.push.apply(registeredSearchers, arguments);
  }
  function createSearcher(pattern, options) {
    for (var i = 0, len = registeredSearchers.length; i < len; i += 1) {
      var searcherClass = registeredSearchers[i];

      if (searcherClass.condition(pattern, options)) {
        return new searcherClass(pattern, options);
      }
    }

    return new BitapSearch(pattern, options);
  }

  var LogicalOperator = {
    AND: '$and',
    OR: '$or'
  };
  var KeyType = {
    PATH: '$path',
    PATTERN: '$val'
  };

  var isExpression = function isExpression(query) {
    return !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);
  };

  var isPath = function isPath(query) {
    return !!query[KeyType.PATH];
  };

  var isLeaf = function isLeaf(query) {
    return !isArray(query) && isObject(query) && !isExpression(query);
  };

  var convertToExplicit = function convertToExplicit(query) {
    return _defineProperty({}, LogicalOperator.AND, Object.keys(query).map(function (key) {
      return _defineProperty({}, key, query[key]);
    }));
  }; // When `auto` is `true`, the parse function will infer and initialize and add
  // the appropriate `Searcher` instance


  function parse(query, options) {
    var _ref3 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
        _ref3$auto = _ref3.auto,
        auto = _ref3$auto === void 0 ? true : _ref3$auto;

    var next = function next(query) {
      var keys = Object.keys(query);
      var isQueryPath = isPath(query);

      if (!isQueryPath && keys.length > 1 && !isExpression(query)) {
        return next(convertToExplicit(query));
      }

      if (isLeaf(query)) {
        var key = isQueryPath ? query[KeyType.PATH] : keys[0];
        var pattern = isQueryPath ? query[KeyType.PATTERN] : query[key];

        if (!isString(pattern)) {
          throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key));
        }

        var obj = {
          keyId: createKeyId(key),
          pattern: pattern
        };

        if (auto) {
          obj.searcher = createSearcher(pattern, options);
        }

        return obj;
      }

      var node = {
        children: [],
        operator: keys[0]
      };
      keys.forEach(function (key) {
        var value = query[key];

        if (isArray(value)) {
          value.forEach(function (item) {
            node.children.push(next(item));
          });
        }
      });
      return node;
    };

    if (!isExpression(query)) {
      query = convertToExplicit(query);
    }

    return next(query);
  }

  function computeScore$1(results, _ref) {
    var _ref$ignoreFieldNorm = _ref.ignoreFieldNorm,
        ignoreFieldNorm = _ref$ignoreFieldNorm === void 0 ? Config.ignoreFieldNorm : _ref$ignoreFieldNorm;
    results.forEach(function (result) {
      var totalScore = 1;
      result.matches.forEach(function (_ref2) {
        var key = _ref2.key,
            norm = _ref2.norm,
            score = _ref2.score;
        var weight = key ? key.weight : null;
        totalScore *= Math.pow(score === 0 && weight ? Number.EPSILON : score, (weight || 1) * (ignoreFieldNorm ? 1 : norm));
      });
      result.score = totalScore;
    });
  }

  function transformMatches(result, data) {
    var matches = result.matches;
    data.matches = [];

    if (!isDefined(matches)) {
      return;
    }

    matches.forEach(function (match) {
      if (!isDefined(match.indices) || !match.indices.length) {
        return;
      }

      var indices = match.indices,
          value = match.value;
      var obj = {
        indices: indices,
        value: value
      };

      if (match.key) {
        obj.key = match.key.src;
      }

      if (match.idx > -1) {
        obj.refIndex = match.idx;
      }

      data.matches.push(obj);
    });
  }

  function transformScore(result, data) {
    data.score = result.score;
  }

  function format(results, docs) {
    var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
        _ref$includeMatches = _ref.includeMatches,
        includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
        _ref$includeScore = _ref.includeScore,
        includeScore = _ref$includeScore === void 0 ? Config.includeScore : _ref$includeScore;

    var transformers = [];
    if (includeMatches) transformers.push(transformMatches);
    if (includeScore) transformers.push(transformScore);
    return results.map(function (result) {
      var idx = result.idx;
      var data = {
        item: docs[idx],
        refIndex: idx
      };

      if (transformers.length) {
        transformers.forEach(function (transformer) {
          transformer(result, data);
        });
      }

      return data;
    });
  }

  var Fuse = /*#__PURE__*/function () {
    function Fuse(docs) {
      var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      var index = arguments.length > 2 ? arguments[2] : undefined;

      _classCallCheck(this, Fuse);

      this.options = _objectSpread2({}, Config, {}, options);

      if (this.options.useExtendedSearch && !true) {
        throw new Error(EXTENDED_SEARCH_UNAVAILABLE);
      }

      this._keyStore = new KeyStore(this.options.keys);
      this.setCollection(docs, index);
    }

    _createClass(Fuse, [{
      key: "setCollection",
      value: function setCollection(docs, index) {
        this._docs = docs;

        if (index && !(index instanceof FuseIndex)) {
          throw new Error(INCORRECT_INDEX_TYPE);
        }

        this._myIndex = index || createIndex(this.options.keys, this._docs, {
          getFn: this.options.getFn
        });
      }
    }, {
      key: "add",
      value: function add(doc) {
        if (!isDefined(doc)) {
          return;
        }

        this._docs.push(doc);

        this._myIndex.add(doc);
      }
    }, {
      key: "remove",
      value: function remove() {
        var predicate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {
          return (
            /* doc, idx */
            false
          );
        };
        var results = [];

        for (var i = 0, len = this._docs.length; i < len; i += 1) {
          var doc = this._docs[i];

          if (predicate(doc, i)) {
            this.removeAt(i);
            i -= 1;
            len -= 1;
            results.push(doc);
          }
        }

        return results;
      }
    }, {
      key: "removeAt",
      value: function removeAt(idx) {
        this._docs.splice(idx, 1);

        this._myIndex.removeAt(idx);
      }
    }, {
      key: "getIndex",
      value: function getIndex() {
        return this._myIndex;
      }
    }, {
      key: "search",
      value: function search(query) {
        var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
            _ref$limit = _ref.limit,
            limit = _ref$limit === void 0 ? -1 : _ref$limit;

        var _this$options = this.options,
            includeMatches = _this$options.includeMatches,
            includeScore = _this$options.includeScore,
            shouldSort = _this$options.shouldSort,
            sortFn = _this$options.sortFn,
            ignoreFieldNorm = _this$options.ignoreFieldNorm;
        var results = isString(query) ? isString(this._docs[0]) ? this._searchStringList(query) : this._searchObjectList(query) : this._searchLogical(query);
        computeScore$1(results, {
          ignoreFieldNorm: ignoreFieldNorm
        });

        if (shouldSort) {
          results.sort(sortFn);
        }

        if (isNumber(limit) && limit > -1) {
          results = results.slice(0, limit);
        }

        return format(results, this._docs, {
          includeMatches: includeMatches,
          includeScore: includeScore
        });
      }
    }, {
      key: "_searchStringList",
      value: function _searchStringList(query) {
        var searcher = createSearcher(query, this.options);
        var records = this._myIndex.records;
        var results = []; // Iterate over every string in the index

        records.forEach(function (_ref2) {
          var text = _ref2.v,
              idx = _ref2.i,
              norm = _ref2.n;

          if (!isDefined(text)) {
            return;
          }

          var _searcher$searchIn = searcher.searchIn(text),
              isMatch = _searcher$searchIn.isMatch,
              score = _searcher$searchIn.score,
              indices = _searcher$searchIn.indices;

          if (isMatch) {
            results.push({
              item: text,
              idx: idx,
              matches: [{
                score: score,
                value: text,
                norm: norm,
                indices: indices
              }]
            });
          }
        });
        return results;
      }
    }, {
      key: "_searchLogical",
      value: function _searchLogical(query) {
        var _this = this;

        var expression = parse(query, this.options);

        var evaluate = function evaluate(node, item, idx) {
          if (!node.children) {
            var keyId = node.keyId,
                searcher = node.searcher;

            var matches = _this._findMatches({
              key: _this._keyStore.get(keyId),
              value: _this._myIndex.getValueForItemAtKeyId(item, keyId),
              searcher: searcher
            });

            if (matches && matches.length) {
              return [{
                idx: idx,
                item: item,
                matches: matches
              }];
            }

            return [];
          }
          /*eslint indent: [2, 2, {"SwitchCase": 1}]*/


          switch (node.operator) {
            case LogicalOperator.AND:
              {
                var res = [];

                for (var i = 0, len = node.children.length; i < len; i += 1) {
                  var child = node.children[i];
                  var result = evaluate(child, item, idx);

                  if (result.length) {
                    res.push.apply(res, _toConsumableArray(result));
                  } else {
                    return [];
                  }
                }

                return res;
              }

            case LogicalOperator.OR:
              {
                var _res = [];

                for (var _i = 0, _len = node.children.length; _i < _len; _i += 1) {
                  var _child = node.children[_i];

                  var _result = evaluate(_child, item, idx);

                  if (_result.length) {
                    _res.push.apply(_res, _toConsumableArray(_result));

                    break;
                  }
                }

                return _res;
              }
          }
        };

        var records = this._myIndex.records;
        var resultMap = {};
        var results = [];
        records.forEach(function (_ref3) {
          var item = _ref3.$,
              idx = _ref3.i;

          if (isDefined(item)) {
            var expResults = evaluate(expression, item, idx);

            if (expResults.length) {
              // Dedupe when adding
              if (!resultMap[idx]) {
                resultMap[idx] = {
                  idx: idx,
                  item: item,
                  matches: []
                };
                results.push(resultMap[idx]);
              }

              expResults.forEach(function (_ref4) {
                var _resultMap$idx$matche;

                var matches = _ref4.matches;

                (_resultMap$idx$matche = resultMap[idx].matches).push.apply(_resultMap$idx$matche, _toConsumableArray(matches));
              });
            }
          }
        });
        return results;
      }
    }, {
      key: "_searchObjectList",
      value: function _searchObjectList(query) {
        var _this2 = this;

        var searcher = createSearcher(query, this.options);
        var _this$_myIndex = this._myIndex,
            keys = _this$_myIndex.keys,
            records = _this$_myIndex.records;
        var results = []; // List is Array<Object>

        records.forEach(function (_ref5) {
          var item = _ref5.$,
              idx = _ref5.i;

          if (!isDefined(item)) {
            return;
          }

          var matches = []; // Iterate over every key (i.e, path), and fetch the value at that key

          keys.forEach(function (key, keyIndex) {
            matches.push.apply(matches, _toConsumableArray(_this2._findMatches({
              key: key,
              value: item[keyIndex],
              searcher: searcher
            })));
          });

          if (matches.length) {
            results.push({
              idx: idx,
              item: item,
              matches: matches
            });
          }
        });
        return results;
      }
    }, {
      key: "_findMatches",
      value: function _findMatches(_ref6) {
        var key = _ref6.key,
            value = _ref6.value,
            searcher = _ref6.searcher;

        if (!isDefined(value)) {
          return [];
        }

        var matches = [];

        if (isArray(value)) {
          value.forEach(function (_ref7) {
            var text = _ref7.v,
                idx = _ref7.i,
                norm = _ref7.n;

            if (!isDefined(text)) {
              return;
            }

            var _searcher$searchIn2 = searcher.searchIn(text),
                isMatch = _searcher$searchIn2.isMatch,
                score = _searcher$searchIn2.score,
                indices = _searcher$searchIn2.indices;

            if (isMatch) {
              matches.push({
                score: score,
                key: key,
                value: text,
                idx: idx,
                norm: norm,
                indices: indices
              });
            }
          });
        } else {
          var text = value.v,
              norm = value.n;

          var _searcher$searchIn3 = searcher.searchIn(text),
              isMatch = _searcher$searchIn3.isMatch,
              score = _searcher$searchIn3.score,
              indices = _searcher$searchIn3.indices;

          if (isMatch) {
            matches.push({
              score: score,
              key: key,
              value: text,
              norm: norm,
              indices: indices
            });
          }
        }

        return matches;
      }
    }]);

    return Fuse;
  }();

  Fuse.version = '6.4.6';
  Fuse.createIndex = createIndex;
  Fuse.parseIndex = parseIndex;
  Fuse.config = Config;

  {
    Fuse.parseQuery = parse;
  }

  {
    register(ExtendedSearch);
  }

  return Fuse;

})));

// Generated from latin_map.pl Sun Jun 20 20:17:18 2010
var Latinise = {};
Latinise.latin_map = {
'Á': 'A', // LATIN CAPITAL LETTER A WITH ACUTE
'Ă': 'A', // LATIN CAPITAL LETTER A WITH BREVE
'Ắ': 'A', // LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
'Ặ': 'A', // LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
'Ằ': 'A', // LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
'Ẳ': 'A', // LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
'Ẵ': 'A', // LATIN CAPITAL LETTER A WITH BREVE AND TILDE
'Ǎ': 'A', // LATIN CAPITAL LETTER A WITH CARON
'Â': 'A', // LATIN CAPITAL LETTER A WITH CIRCUMFLEX
'Ấ': 'A', // LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
'Ậ': 'A', // LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
'Ầ': 'A', // LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
'Ẩ': 'A', // LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
'Ẫ': 'A', // LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
'Ä': 'A', // LATIN CAPITAL LETTER A WITH DIAERESIS
'Ǟ': 'A', // LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
'Ȧ': 'A', // LATIN CAPITAL LETTER A WITH DOT ABOVE
'Ǡ': 'A', // LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
'Ạ': 'A', // LATIN CAPITAL LETTER A WITH DOT BELOW
'Ȁ': 'A', // LATIN CAPITAL LETTER A WITH DOUBLE GRAVE
'À': 'A', // LATIN CAPITAL LETTER A WITH GRAVE
'Ả': 'A', // LATIN CAPITAL LETTER A WITH HOOK ABOVE
'Ȃ': 'A', // LATIN CAPITAL LETTER A WITH INVERTED BREVE
'Ā': 'A', // LATIN CAPITAL LETTER A WITH MACRON
'Ą': 'A', // LATIN CAPITAL LETTER A WITH OGONEK
'Å': 'A', // LATIN CAPITAL LETTER A WITH RING ABOVE
'Ǻ': 'A', // LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
'Ḁ': 'A', // LATIN CAPITAL LETTER A WITH RING BELOW
'Ⱥ': 'A', // LATIN CAPITAL LETTER A WITH STROKE
'Ã': 'A', // LATIN CAPITAL LETTER A WITH TILDE
'Ꜳ': 'AA', // LATIN CAPITAL LETTER AA
'Æ': 'AE', // LATIN CAPITAL LETTER AE
'Ǽ': 'AE', // LATIN CAPITAL LETTER AE WITH ACUTE
'Ǣ': 'AE', // LATIN CAPITAL LETTER AE WITH MACRON
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER AFRICAN D' (Ɖ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER ALPHA' (Ɑ)
'Ꜵ': 'AO', // LATIN CAPITAL LETTER AO
'Ꜷ': 'AU', // LATIN CAPITAL LETTER AU
'Ꜹ': 'AV', // LATIN CAPITAL LETTER AV
'Ꜻ': 'AV', // LATIN CAPITAL LETTER AV WITH HORIZONTAL BAR
'Ꜽ': 'AY', // LATIN CAPITAL LETTER AY
'Ḃ': 'B', // LATIN CAPITAL LETTER B WITH DOT ABOVE
'Ḅ': 'B', // LATIN CAPITAL LETTER B WITH DOT BELOW
'Ɓ': 'B', // LATIN CAPITAL LETTER B WITH HOOK
'Ḇ': 'B', // LATIN CAPITAL LETTER B WITH LINE BELOW
'Ƀ': 'B', // LATIN CAPITAL LETTER B WITH STROKE
'Ƃ': 'B', // LATIN CAPITAL LETTER B WITH TOPBAR
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER BROKEN L' (Ꝇ)
'Ć': 'C', // LATIN CAPITAL LETTER C WITH ACUTE
'Č': 'C', // LATIN CAPITAL LETTER C WITH CARON
'Ç': 'C', // LATIN CAPITAL LETTER C WITH CEDILLA
'Ḉ': 'C', // LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
'Ĉ': 'C', // LATIN CAPITAL LETTER C WITH CIRCUMFLEX
'Ċ': 'C', // LATIN CAPITAL LETTER C WITH DOT ABOVE
'Ƈ': 'C', // LATIN CAPITAL LETTER C WITH HOOK
'Ȼ': 'C', // LATIN CAPITAL LETTER C WITH STROKE
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER CON' (Ꝯ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER CUATRILLO' (Ꜭ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER CUATRILLO WITH COMMA' (Ꜯ)
'Ď': 'D', // LATIN CAPITAL LETTER D WITH CARON
'Ḑ': 'D', // LATIN CAPITAL LETTER D WITH CEDILLA
'Ḓ': 'D', // LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW
'Ḋ': 'D', // LATIN CAPITAL LETTER D WITH DOT ABOVE
'Ḍ': 'D', // LATIN CAPITAL LETTER D WITH DOT BELOW
'Ɗ': 'D', // LATIN CAPITAL LETTER D WITH HOOK
'Ḏ': 'D', // LATIN CAPITAL LETTER D WITH LINE BELOW
'ǲ': 'D', // LATIN CAPITAL LETTER D WITH SMALL LETTER Z
'ǅ': 'D', // LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON
'Đ': 'D', // LATIN CAPITAL LETTER D WITH STROKE
'Ƌ': 'D', // LATIN CAPITAL LETTER D WITH TOPBAR
'Ǳ': 'DZ', // LATIN CAPITAL LETTER DZ
'Ǆ': 'DZ', // LATIN CAPITAL LETTER DZ WITH CARON
'É': 'E', // LATIN CAPITAL LETTER E WITH ACUTE
'Ĕ': 'E', // LATIN CAPITAL LETTER E WITH BREVE
'Ě': 'E', // LATIN CAPITAL LETTER E WITH CARON
'Ȩ': 'E', // LATIN CAPITAL LETTER E WITH CEDILLA
'Ḝ': 'E', // LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
'Ê': 'E', // LATIN CAPITAL LETTER E WITH CIRCUMFLEX
'Ế': 'E', // LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
'Ệ': 'E', // LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
'Ề': 'E', // LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
'Ể': 'E', // LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
'Ễ': 'E', // LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
'Ḙ': 'E', // LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW
'Ë': 'E', // LATIN CAPITAL LETTER E WITH DIAERESIS
'Ė': 'E', // LATIN CAPITAL LETTER E WITH DOT ABOVE
'Ẹ': 'E', // LATIN CAPITAL LETTER E WITH DOT BELOW
'Ȅ': 'E', // LATIN CAPITAL LETTER E WITH DOUBLE GRAVE
'È': 'E', // LATIN CAPITAL LETTER E WITH GRAVE
'Ẻ': 'E', // LATIN CAPITAL LETTER E WITH HOOK ABOVE
'Ȇ': 'E', // LATIN CAPITAL LETTER E WITH INVERTED BREVE
'Ē': 'E', // LATIN CAPITAL LETTER E WITH MACRON
'Ḗ': 'E', // LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
'Ḕ': 'E', // LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
'Ę': 'E', // LATIN CAPITAL LETTER E WITH OGONEK
'Ɇ': 'E', // LATIN CAPITAL LETTER E WITH STROKE
'Ẽ': 'E', // LATIN CAPITAL LETTER E WITH TILDE
'Ḛ': 'E', // LATIN CAPITAL LETTER E WITH TILDE BELOW
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER EGYPTOLOGICAL AIN' (Ꜥ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER EGYPTOLOGICAL ALEF' (Ꜣ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER ENG' (Ŋ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER ESH' (Ʃ)
'Ꝫ': 'ET', // LATIN CAPITAL LETTER ET
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER ETH' (Ð)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER EZH' (Ʒ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER EZH REVERSED' (Ƹ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER EZH WITH CARON' (Ǯ)
'Ḟ': 'F', // LATIN CAPITAL LETTER F WITH DOT ABOVE
'Ƒ': 'F', // LATIN CAPITAL LETTER F WITH HOOK
'Ǵ': 'G', // LATIN CAPITAL LETTER G WITH ACUTE
'Ğ': 'G', // LATIN CAPITAL LETTER G WITH BREVE
'Ǧ': 'G', // LATIN CAPITAL LETTER G WITH CARON
'Ģ': 'G', // LATIN CAPITAL LETTER G WITH CEDILLA
'Ĝ': 'G', // LATIN CAPITAL LETTER G WITH CIRCUMFLEX
'Ġ': 'G', // LATIN CAPITAL LETTER G WITH DOT ABOVE
'Ɠ': 'G', // LATIN CAPITAL LETTER G WITH HOOK
'Ḡ': 'G', // LATIN CAPITAL LETTER G WITH MACRON
'Ǥ': 'G', // LATIN CAPITAL LETTER G WITH STROKE
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER GAMMA' (Ɣ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER GLOTTAL STOP' (Ɂ)
'Ḫ': 'H', // LATIN CAPITAL LETTER H WITH BREVE BELOW
'Ȟ': 'H', // LATIN CAPITAL LETTER H WITH CARON
'Ḩ': 'H', // LATIN CAPITAL LETTER H WITH CEDILLA
'Ĥ': 'H', // LATIN CAPITAL LETTER H WITH CIRCUMFLEX
'Ⱨ': 'H', // LATIN CAPITAL LETTER H WITH DESCENDER
'Ḧ': 'H', // LATIN CAPITAL LETTER H WITH DIAERESIS
'Ḣ': 'H', // LATIN CAPITAL LETTER H WITH DOT ABOVE
'Ḥ': 'H', // LATIN CAPITAL LETTER H WITH DOT BELOW
'Ħ': 'H', // LATIN CAPITAL LETTER H WITH STROKE
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER HALF H' (Ⱶ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER HENG' (Ꜧ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER HWAIR' (Ƕ)
'Í': 'I', // LATIN CAPITAL LETTER I WITH ACUTE
'Ĭ': 'I', // LATIN CAPITAL LETTER I WITH BREVE
'Ǐ': 'I', // LATIN CAPITAL LETTER I WITH CARON
'Î': 'I', // LATIN CAPITAL LETTER I WITH CIRCUMFLEX
'Ï': 'I', // LATIN CAPITAL LETTER I WITH DIAERESIS
'Ḯ': 'I', // LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
'İ': 'I', // LATIN CAPITAL LETTER I WITH DOT ABOVE
'Ị': 'I', // LATIN CAPITAL LETTER I WITH DOT BELOW
'Ȉ': 'I', // LATIN CAPITAL LETTER I WITH DOUBLE GRAVE
'Ì': 'I', // LATIN CAPITAL LETTER I WITH GRAVE
'Ỉ': 'I', // LATIN CAPITAL LETTER I WITH HOOK ABOVE
'Ȋ': 'I', // LATIN CAPITAL LETTER I WITH INVERTED BREVE
'Ī': 'I', // LATIN CAPITAL LETTER I WITH MACRON
'Į': 'I', // LATIN CAPITAL LETTER I WITH OGONEK
'Ɨ': 'I', // LATIN CAPITAL LETTER I WITH STROKE
'Ĩ': 'I', // LATIN CAPITAL LETTER I WITH TILDE
'Ḭ': 'I', // LATIN CAPITAL LETTER I WITH TILDE BELOW
'Ꝺ': 'D', // LATIN CAPITAL LETTER INSULAR D
'Ꝼ': 'F', // LATIN CAPITAL LETTER INSULAR F
'Ᵹ': 'G', // LATIN CAPITAL LETTER INSULAR G
'Ꞃ': 'R', // LATIN CAPITAL LETTER INSULAR R
'Ꞅ': 'S', // LATIN CAPITAL LETTER INSULAR S
'Ꞇ': 'T', // LATIN CAPITAL LETTER INSULAR T
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER IOTA' (Ɩ)
'Ꝭ': 'IS', // LATIN CAPITAL LETTER IS
'Ĵ': 'J', // LATIN CAPITAL LETTER J WITH CIRCUMFLEX
'Ɉ': 'J', // LATIN CAPITAL LETTER J WITH STROKE
'Ḱ': 'K', // LATIN CAPITAL LETTER K WITH ACUTE
'Ǩ': 'K', // LATIN CAPITAL LETTER K WITH CARON
'Ķ': 'K', // LATIN CAPITAL LETTER K WITH CEDILLA
'Ⱪ': 'K', // LATIN CAPITAL LETTER K WITH DESCENDER
'Ꝃ': 'K', // LATIN CAPITAL LETTER K WITH DIAGONAL STROKE
'Ḳ': 'K', // LATIN CAPITAL LETTER K WITH DOT BELOW
'Ƙ': 'K', // LATIN CAPITAL LETTER K WITH HOOK
'Ḵ': 'K', // LATIN CAPITAL LETTER K WITH LINE BELOW
'Ꝁ': 'K', // LATIN CAPITAL LETTER K WITH STROKE
'Ꝅ': 'K', // LATIN CAPITAL LETTER K WITH STROKE AND DIAGONAL STROKE
'Ĺ': 'L', // LATIN CAPITAL LETTER L WITH ACUTE
'Ƚ': 'L', // LATIN CAPITAL LETTER L WITH BAR
'Ľ': 'L', // LATIN CAPITAL LETTER L WITH CARON
'Ļ': 'L', // LATIN CAPITAL LETTER L WITH CEDILLA
'Ḽ': 'L', // LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW
'Ḷ': 'L', // LATIN CAPITAL LETTER L WITH DOT BELOW
'Ḹ': 'L', // LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
'Ⱡ': 'L', // LATIN CAPITAL LETTER L WITH DOUBLE BAR
'Ꝉ': 'L', // LATIN CAPITAL LETTER L WITH HIGH STROKE
'Ḻ': 'L', // LATIN CAPITAL LETTER L WITH LINE BELOW
'Ŀ': 'L', // LATIN CAPITAL LETTER L WITH MIDDLE DOT
'Ɫ': 'L', // LATIN CAPITAL LETTER L WITH MIDDLE TILDE
'ǈ': 'L', // LATIN CAPITAL LETTER L WITH SMALL LETTER J
'Ł': 'L', // LATIN CAPITAL LETTER L WITH STROKE
'Ǉ': 'LJ', // LATIN CAPITAL LETTER LJ
'Ḿ': 'M', // LATIN CAPITAL LETTER M WITH ACUTE
'Ṁ': 'M', // LATIN CAPITAL LETTER M WITH DOT ABOVE
'Ṃ': 'M', // LATIN CAPITAL LETTER M WITH DOT BELOW
'Ɱ': 'M', // LATIN CAPITAL LETTER M WITH HOOK
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER MIDDLE-WELSH LL' (Ỻ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER MIDDLE-WELSH V' (Ỽ)
'Ń': 'N', // LATIN CAPITAL LETTER N WITH ACUTE
'Ň': 'N', // LATIN CAPITAL LETTER N WITH CARON
'Ņ': 'N', // LATIN CAPITAL LETTER N WITH CEDILLA
'Ṋ': 'N', // LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW
'Ṅ': 'N', // LATIN CAPITAL LETTER N WITH DOT ABOVE
'Ṇ': 'N', // LATIN CAPITAL LETTER N WITH DOT BELOW
'Ǹ': 'N', // LATIN CAPITAL LETTER N WITH GRAVE
'Ɲ': 'N', // LATIN CAPITAL LETTER N WITH LEFT HOOK
'Ṉ': 'N', // LATIN CAPITAL LETTER N WITH LINE BELOW
'Ƞ': 'N', // LATIN CAPITAL LETTER N WITH LONG RIGHT LEG
'ǋ': 'N', // LATIN CAPITAL LETTER N WITH SMALL LETTER J
'Ñ': 'N', // LATIN CAPITAL LETTER N WITH TILDE
'Ǌ': 'NJ', // LATIN CAPITAL LETTER NJ
'Ó': 'O', // LATIN CAPITAL LETTER O WITH ACUTE
'Ŏ': 'O', // LATIN CAPITAL LETTER O WITH BREVE
'Ǒ': 'O', // LATIN CAPITAL LETTER O WITH CARON
'Ô': 'O', // LATIN CAPITAL LETTER O WITH CIRCUMFLEX
'Ố': 'O', // LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
'Ộ': 'O', // LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
'Ồ': 'O', // LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
'Ổ': 'O', // LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
'Ỗ': 'O', // LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
'Ö': 'O', // LATIN CAPITAL LETTER O WITH DIAERESIS
'Ȫ': 'O', // LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
'Ȯ': 'O', // LATIN CAPITAL LETTER O WITH DOT ABOVE
'Ȱ': 'O', // LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
'Ọ': 'O', // LATIN CAPITAL LETTER O WITH DOT BELOW
'Ő': 'O', // LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
'Ȍ': 'O', // LATIN CAPITAL LETTER O WITH DOUBLE GRAVE
'Ò': 'O', // LATIN CAPITAL LETTER O WITH GRAVE
'Ỏ': 'O', // LATIN CAPITAL LETTER O WITH HOOK ABOVE
'Ơ': 'O', // LATIN CAPITAL LETTER O WITH HORN
'Ớ': 'O', // LATIN CAPITAL LETTER O WITH HORN AND ACUTE
'Ợ': 'O', // LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
'Ờ': 'O', // LATIN CAPITAL LETTER O WITH HORN AND GRAVE
'Ở': 'O', // LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
'Ỡ': 'O', // LATIN CAPITAL LETTER O WITH HORN AND TILDE
'Ȏ': 'O', // LATIN CAPITAL LETTER O WITH INVERTED BREVE
'Ꝋ': 'O', // LATIN CAPITAL LETTER O WITH LONG STROKE OVERLAY
'Ꝍ': 'O', // LATIN CAPITAL LETTER O WITH LOOP
'Ō': 'O', // LATIN CAPITAL LETTER O WITH MACRON
'Ṓ': 'O', // LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
'Ṑ': 'O', // LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
'Ɵ': 'O', // LATIN CAPITAL LETTER O WITH MIDDLE TILDE
'Ǫ': 'O', // LATIN CAPITAL LETTER O WITH OGONEK
'Ǭ': 'O', // LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
'Ø': 'O', // LATIN CAPITAL LETTER O WITH STROKE
'Ǿ': 'O', // LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
'Õ': 'O', // LATIN CAPITAL LETTER O WITH TILDE
'Ṍ': 'O', // LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
'Ṏ': 'O', // LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
'Ȭ': 'O', // LATIN CAPITAL LETTER O WITH TILDE AND MACRON
'Ƣ': 'OI', // LATIN CAPITAL LETTER OI
'Ꝏ': 'OO', // LATIN CAPITAL LETTER OO
'Ɛ': 'E', // LATIN CAPITAL LETTER OPEN E
'Ɔ': 'O', // LATIN CAPITAL LETTER OPEN O
'Ȣ': 'OU', // LATIN CAPITAL LETTER OU
'Ṕ': 'P', // LATIN CAPITAL LETTER P WITH ACUTE
'Ṗ': 'P', // LATIN CAPITAL LETTER P WITH DOT ABOVE
'Ꝓ': 'P', // LATIN CAPITAL LETTER P WITH FLOURISH
'Ƥ': 'P', // LATIN CAPITAL LETTER P WITH HOOK
'Ꝕ': 'P', // LATIN CAPITAL LETTER P WITH SQUIRREL TAIL
'Ᵽ': 'P', // LATIN CAPITAL LETTER P WITH STROKE
'Ꝑ': 'P', // LATIN CAPITAL LETTER P WITH STROKE THROUGH DESCENDER
'Ꝙ': 'Q', // LATIN CAPITAL LETTER Q WITH DIAGONAL STROKE
'Ꝗ': 'Q', // LATIN CAPITAL LETTER Q WITH STROKE THROUGH DESCENDER
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER R ROTUNDA' (Ꝛ)
'Ŕ': 'R', // LATIN CAPITAL LETTER R WITH ACUTE
'Ř': 'R', // LATIN CAPITAL LETTER R WITH CARON
'Ŗ': 'R', // LATIN CAPITAL LETTER R WITH CEDILLA
'Ṙ': 'R', // LATIN CAPITAL LETTER R WITH DOT ABOVE
'Ṛ': 'R', // LATIN CAPITAL LETTER R WITH DOT BELOW
'Ṝ': 'R', // LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
'Ȑ': 'R', // LATIN CAPITAL LETTER R WITH DOUBLE GRAVE
'Ȓ': 'R', // LATIN CAPITAL LETTER R WITH INVERTED BREVE
'Ṟ': 'R', // LATIN CAPITAL LETTER R WITH LINE BELOW
'Ɍ': 'R', // LATIN CAPITAL LETTER R WITH STROKE
'Ɽ': 'R', // LATIN CAPITAL LETTER R WITH TAIL
'Ꜿ': 'C', // LATIN CAPITAL LETTER REVERSED C WITH DOT
'Ǝ': 'E', // LATIN CAPITAL LETTER REVERSED E
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER RUM ROTUNDA' (Ꝝ)
'Ś': 'S', // LATIN CAPITAL LETTER S WITH ACUTE
'Ṥ': 'S', // LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
'Š': 'S', // LATIN CAPITAL LETTER S WITH CARON
'Ṧ': 'S', // LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
'Ş': 'S', // LATIN CAPITAL LETTER S WITH CEDILLA
'Ŝ': 'S', // LATIN CAPITAL LETTER S WITH CIRCUMFLEX
'Ș': 'S', // LATIN CAPITAL LETTER S WITH COMMA BELOW
'Ṡ': 'S', // LATIN CAPITAL LETTER S WITH DOT ABOVE
'Ṣ': 'S', // LATIN CAPITAL LETTER S WITH DOT BELOW
'Ṩ': 'S', // LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER SALTILLO' (Ꞌ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER SCHWA' (Ə)
'ẞ': 'SS', // LATIN CAPITAL LETTER SHARP S
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER SMALL Q WITH HOOK TAIL' (Ɋ)
'Ť': 'T', // LATIN CAPITAL LETTER T WITH CARON
'Ţ': 'T', // LATIN CAPITAL LETTER T WITH CEDILLA
'Ṱ': 'T', // LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW
'Ț': 'T', // LATIN CAPITAL LETTER T WITH COMMA BELOW
'Ⱦ': 'T', // LATIN CAPITAL LETTER T WITH DIAGONAL STROKE
'Ṫ': 'T', // LATIN CAPITAL LETTER T WITH DOT ABOVE
'Ṭ': 'T', // LATIN CAPITAL LETTER T WITH DOT BELOW
'Ƭ': 'T', // LATIN CAPITAL LETTER T WITH HOOK
'Ṯ': 'T', // LATIN CAPITAL LETTER T WITH LINE BELOW
'Ʈ': 'T', // LATIN CAPITAL LETTER T WITH RETROFLEX HOOK
'Ŧ': 'T', // LATIN CAPITAL LETTER T WITH STROKE
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER THORN' (Þ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER THORN WITH STROKE' (Ꝥ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER THORN WITH STROKE THROUGH DESCENDER' (Ꝧ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER TONE FIVE' (Ƽ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER TONE SIX' (Ƅ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER TONE TWO' (Ƨ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER TRESILLO' (Ꜫ)
'Ɐ': 'A', // LATIN CAPITAL LETTER TURNED A
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER TURNED INSULAR G' (Ꝿ)
'Ꞁ': 'L', // LATIN CAPITAL LETTER TURNED L
'Ɯ': 'M', // LATIN CAPITAL LETTER TURNED M
'Ʌ': 'V', // LATIN CAPITAL LETTER TURNED V
'Ꜩ': 'TZ', // LATIN CAPITAL LETTER TZ
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER U BAR' (Ʉ)
'Ú': 'U', // LATIN CAPITAL LETTER U WITH ACUTE
'Ŭ': 'U', // LATIN CAPITAL LETTER U WITH BREVE
'Ǔ': 'U', // LATIN CAPITAL LETTER U WITH CARON
'Û': 'U', // LATIN CAPITAL LETTER U WITH CIRCUMFLEX
'Ṷ': 'U', // LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW
'Ü': 'U', // LATIN CAPITAL LETTER U WITH DIAERESIS
'Ǘ': 'U', // LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
'Ǚ': 'U', // LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
'Ǜ': 'U', // LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
'Ǖ': 'U', // LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
'Ṳ': 'U', // LATIN CAPITAL LETTER U WITH DIAERESIS BELOW
'Ụ': 'U', // LATIN CAPITAL LETTER U WITH DOT BELOW
'Ű': 'U', // LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
'Ȕ': 'U', // LATIN CAPITAL LETTER U WITH DOUBLE GRAVE
'Ù': 'U', // LATIN CAPITAL LETTER U WITH GRAVE
'Ủ': 'U', // LATIN CAPITAL LETTER U WITH HOOK ABOVE
'Ư': 'U', // LATIN CAPITAL LETTER U WITH HORN
'Ứ': 'U', // LATIN CAPITAL LETTER U WITH HORN AND ACUTE
'Ự': 'U', // LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
'Ừ': 'U', // LATIN CAPITAL LETTER U WITH HORN AND GRAVE
'Ử': 'U', // LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
'Ữ': 'U', // LATIN CAPITAL LETTER U WITH HORN AND TILDE
'Ȗ': 'U', // LATIN CAPITAL LETTER U WITH INVERTED BREVE
'Ū': 'U', // LATIN CAPITAL LETTER U WITH MACRON
'Ṻ': 'U', // LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
'Ų': 'U', // LATIN CAPITAL LETTER U WITH OGONEK
'Ů': 'U', // LATIN CAPITAL LETTER U WITH RING ABOVE
'Ũ': 'U', // LATIN CAPITAL LETTER U WITH TILDE
'Ṹ': 'U', // LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
'Ṵ': 'U', // LATIN CAPITAL LETTER U WITH TILDE BELOW
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER UPSILON' (Ʊ)
'Ꝟ': 'V', // LATIN CAPITAL LETTER V WITH DIAGONAL STROKE
'Ṿ': 'V', // LATIN CAPITAL LETTER V WITH DOT BELOW
'Ʋ': 'V', // LATIN CAPITAL LETTER V WITH HOOK
'Ṽ': 'V', // LATIN CAPITAL LETTER V WITH TILDE
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER VEND' (Ꝩ)
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER VISIGOTHIC Z' (Ꝣ)
'Ꝡ': 'VY', // LATIN CAPITAL LETTER VY
'Ẃ': 'W', // LATIN CAPITAL LETTER W WITH ACUTE
'Ŵ': 'W', // LATIN CAPITAL LETTER W WITH CIRCUMFLEX
'Ẅ': 'W', // LATIN CAPITAL LETTER W WITH DIAERESIS
'Ẇ': 'W', // LATIN CAPITAL LETTER W WITH DOT ABOVE
'Ẉ': 'W', // LATIN CAPITAL LETTER W WITH DOT BELOW
'Ẁ': 'W', // LATIN CAPITAL LETTER W WITH GRAVE
'Ⱳ': 'W', // LATIN CAPITAL LETTER W WITH HOOK
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER WYNN' (Ƿ)
'Ẍ': 'X', // LATIN CAPITAL LETTER X WITH DIAERESIS
'Ẋ': 'X', // LATIN CAPITAL LETTER X WITH DOT ABOVE
'Ý': 'Y', // LATIN CAPITAL LETTER Y WITH ACUTE
'Ŷ': 'Y', // LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
'Ÿ': 'Y', // LATIN CAPITAL LETTER Y WITH DIAERESIS
'Ẏ': 'Y', // LATIN CAPITAL LETTER Y WITH DOT ABOVE
'Ỵ': 'Y', // LATIN CAPITAL LETTER Y WITH DOT BELOW
'Ỳ': 'Y', // LATIN CAPITAL LETTER Y WITH GRAVE
'Ƴ': 'Y', // LATIN CAPITAL LETTER Y WITH HOOK
'Ỷ': 'Y', // LATIN CAPITAL LETTER Y WITH HOOK ABOVE
'Ỿ': 'Y', // LATIN CAPITAL LETTER Y WITH LOOP
'Ȳ': 'Y', // LATIN CAPITAL LETTER Y WITH MACRON
'Ɏ': 'Y', // LATIN CAPITAL LETTER Y WITH STROKE
'Ỹ': 'Y', // LATIN CAPITAL LETTER Y WITH TILDE
// CANNOT FIND APPROXIMATION FOR 'LATIN CAPITAL LETTER YOGH' (Ȝ)
'Ź': 'Z', // LATIN CAPITAL LETTER Z WITH ACUTE
'Ž': 'Z', // LATIN CAPITAL LETTER Z WITH CARON
'Ẑ': 'Z', // LATIN CAPITAL LETTER Z WITH CIRCUMFLEX
'Ⱬ': 'Z', // LATIN CAPITAL LETTER Z WITH DESCENDER
'Ż': 'Z', // LATIN CAPITAL LETTER Z WITH DOT ABOVE
'Ẓ': 'Z', // LATIN CAPITAL LETTER Z WITH DOT BELOW
'Ȥ': 'Z', // LATIN CAPITAL LETTER Z WITH HOOK
'Ẕ': 'Z', // LATIN CAPITAL LETTER Z WITH LINE BELOW
'Ƶ': 'Z', // LATIN CAPITAL LETTER Z WITH STROKE
'Ĳ': 'IJ', // LATIN CAPITAL LIGATURE IJ
'Œ': 'OE', // LATIN CAPITAL LIGATURE OE
// CANNOT FIND APPROXIMATION FOR 'LATIN CROSS' (✝)
// CANNOT FIND APPROXIMATION FOR 'LATIN EPIGRAPHIC LETTER ARCHAIC M' (ꟿ)
// CANNOT FIND APPROXIMATION FOR 'LATIN EPIGRAPHIC LETTER I LONGA' (ꟾ)
// CANNOT FIND APPROXIMATION FOR 'LATIN EPIGRAPHIC LETTER INVERTED M' (ꟽ)
// CANNOT FIND APPROXIMATION FOR 'LATIN EPIGRAPHIC LETTER REVERSED F' (ꟻ)
// CANNOT FIND APPROXIMATION FOR 'LATIN EPIGRAPHIC LETTER REVERSED P' (ꟼ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER AIN' (ᴥ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER ALVEOLAR CLICK' (ǂ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER BIDENTAL PERCUSSIVE' (ʭ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER BILABIAL CLICK' (ʘ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER BILABIAL PERCUSSIVE' (ʬ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER DENTAL CLICK' (ǀ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER GLOTTAL STOP' (ʔ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER GLOTTAL STOP WITH STROKE' (ʡ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER INVERTED GLOTTAL STOP' (ʖ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER INVERTED GLOTTAL STOP WITH STROKE' (ƾ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER LATERAL CLICK' (ǁ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER PHARYNGEAL VOICED FRICATIVE' (ʕ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER RETROFLEX CLICK' (ǃ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER REVERSED ESH LOOP' (ƪ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER REVERSED GLOTTAL STOP WITH STROKE' (ʢ)
'ᴀ': 'A', // LATIN LETTER SMALL CAPITAL A
'ᴁ': 'AE', // LATIN LETTER SMALL CAPITAL AE
'ʙ': 'B', // LATIN LETTER SMALL CAPITAL B
'ᴃ': 'B', // LATIN LETTER SMALL CAPITAL BARRED B
'ᴄ': 'C', // LATIN LETTER SMALL CAPITAL C
'ᴅ': 'D', // LATIN LETTER SMALL CAPITAL D
'ᴇ': 'E', // LATIN LETTER SMALL CAPITAL E
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER SMALL CAPITAL ETH' (ᴆ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER SMALL CAPITAL EZH' (ᴣ)
'ꜰ': 'F', // LATIN LETTER SMALL CAPITAL F
'ɢ': 'G', // LATIN LETTER SMALL CAPITAL G
'ʛ': 'G', // LATIN LETTER SMALL CAPITAL G WITH HOOK
'ʜ': 'H', // LATIN LETTER SMALL CAPITAL H
'ɪ': 'I', // LATIN LETTER SMALL CAPITAL I
'ʁ': 'R', // LATIN LETTER SMALL CAPITAL INVERTED R
'ᴊ': 'J', // LATIN LETTER SMALL CAPITAL J
'ᴋ': 'K', // LATIN LETTER SMALL CAPITAL K
'ʟ': 'L', // LATIN LETTER SMALL CAPITAL L
'ᴌ': 'L', // LATIN LETTER SMALL CAPITAL L WITH STROKE
'ᴍ': 'M', // LATIN LETTER SMALL CAPITAL M
'ɴ': 'N', // LATIN LETTER SMALL CAPITAL N
'ᴏ': 'O', // LATIN LETTER SMALL CAPITAL O
'ɶ': 'OE', // LATIN LETTER SMALL CAPITAL OE
'ᴐ': 'O', // LATIN LETTER SMALL CAPITAL OPEN O
'ᴕ': 'OU', // LATIN LETTER SMALL CAPITAL OU
'ᴘ': 'P', // LATIN LETTER SMALL CAPITAL P
'ʀ': 'R', // LATIN LETTER SMALL CAPITAL R
'ᴎ': 'N', // LATIN LETTER SMALL CAPITAL REVERSED N
'ᴙ': 'R', // LATIN LETTER SMALL CAPITAL REVERSED R
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER SMALL CAPITAL RUM' (ꝶ)
'ꜱ': 'S', // LATIN LETTER SMALL CAPITAL S
'ᴛ': 'T', // LATIN LETTER SMALL CAPITAL T
'ⱻ': 'E', // LATIN LETTER SMALL CAPITAL TURNED E
'ᴚ': 'R', // LATIN LETTER SMALL CAPITAL TURNED R
'ᴜ': 'U', // LATIN LETTER SMALL CAPITAL U
'ᴠ': 'V', // LATIN LETTER SMALL CAPITAL V
'ᴡ': 'W', // LATIN LETTER SMALL CAPITAL W
'ʏ': 'Y', // LATIN LETTER SMALL CAPITAL Y
'ᴢ': 'Z', // LATIN LETTER SMALL CAPITAL Z
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER STRETCHED C' (ʗ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER TWO WITH STROKE' (ƻ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER VOICED LARYNGEAL SPIRANT' (ᴤ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER WYNN' (ƿ)
// CANNOT FIND APPROXIMATION FOR 'LATIN LETTER YR' (Ʀ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL CAPITAL LETTER I WITH STROKE' (ᵻ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL CAPITAL LETTER U WITH STROKE' (ᵾ)
'á': 'a', // LATIN SMALL LETTER A WITH ACUTE
'ă': 'a', // LATIN SMALL LETTER A WITH BREVE
'ắ': 'a', // LATIN SMALL LETTER A WITH BREVE AND ACUTE
'ặ': 'a', // LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
'ằ': 'a', // LATIN SMALL LETTER A WITH BREVE AND GRAVE
'ẳ': 'a', // LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
'ẵ': 'a', // LATIN SMALL LETTER A WITH BREVE AND TILDE
'ǎ': 'a', // LATIN SMALL LETTER A WITH CARON
'â': 'a', // LATIN SMALL LETTER A WITH CIRCUMFLEX
'ấ': 'a', // LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
'ậ': 'a', // LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
'ầ': 'a', // LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
'ẩ': 'a', // LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
'ẫ': 'a', // LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
'ä': 'a', // LATIN SMALL LETTER A WITH DIAERESIS
'ǟ': 'a', // LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
'ȧ': 'a', // LATIN SMALL LETTER A WITH DOT ABOVE
'ǡ': 'a', // LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
'ạ': 'a', // LATIN SMALL LETTER A WITH DOT BELOW
'ȁ': 'a', // LATIN SMALL LETTER A WITH DOUBLE GRAVE
'à': 'a', // LATIN SMALL LETTER A WITH GRAVE
'ả': 'a', // LATIN SMALL LETTER A WITH HOOK ABOVE
'ȃ': 'a', // LATIN SMALL LETTER A WITH INVERTED BREVE
'ā': 'a', // LATIN SMALL LETTER A WITH MACRON
'ą': 'a', // LATIN SMALL LETTER A WITH OGONEK
'ᶏ': 'a', // LATIN SMALL LETTER A WITH RETROFLEX HOOK
'ẚ': 'a', // LATIN SMALL LETTER A WITH RIGHT HALF RING
'å': 'a', // LATIN SMALL LETTER A WITH RING ABOVE
'ǻ': 'a', // LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
'ḁ': 'a', // LATIN SMALL LETTER A WITH RING BELOW
'ⱥ': 'a', // LATIN SMALL LETTER A WITH STROKE
'ã': 'a', // LATIN SMALL LETTER A WITH TILDE
'ꜳ': 'aa', // LATIN SMALL LETTER AA
'æ': 'ae', // LATIN SMALL LETTER AE
'ǽ': 'ae', // LATIN SMALL LETTER AE WITH ACUTE
'ǣ': 'ae', // LATIN SMALL LETTER AE WITH MACRON
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER ALPHA' (ɑ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER ALPHA WITH RETROFLEX HOOK' (ᶐ)
'ꜵ': 'ao', // LATIN SMALL LETTER AO
'ꜷ': 'au', // LATIN SMALL LETTER AU
'ꜹ': 'av', // LATIN SMALL LETTER AV
'ꜻ': 'av', // LATIN SMALL LETTER AV WITH HORIZONTAL BAR
'ꜽ': 'ay', // LATIN SMALL LETTER AY
'ḃ': 'b', // LATIN SMALL LETTER B WITH DOT ABOVE
'ḅ': 'b', // LATIN SMALL LETTER B WITH DOT BELOW
'ɓ': 'b', // LATIN SMALL LETTER B WITH HOOK
'ḇ': 'b', // LATIN SMALL LETTER B WITH LINE BELOW
'ᵬ': 'b', // LATIN SMALL LETTER B WITH MIDDLE TILDE
'ᶀ': 'b', // LATIN SMALL LETTER B WITH PALATAL HOOK
'ƀ': 'b', // LATIN SMALL LETTER B WITH STROKE
'ƃ': 'b', // LATIN SMALL LETTER B WITH TOPBAR
'ɵ': 'o', // LATIN SMALL LETTER BARRED O
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER BOTTOM HALF O' (ᴗ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER BROKEN L' (ꝇ)
'ć': 'c', // LATIN SMALL LETTER C WITH ACUTE
'č': 'c', // LATIN SMALL LETTER C WITH CARON
'ç': 'c', // LATIN SMALL LETTER C WITH CEDILLA
'ḉ': 'c', // LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
'ĉ': 'c', // LATIN SMALL LETTER C WITH CIRCUMFLEX
'ɕ': 'c', // LATIN SMALL LETTER C WITH CURL
'ċ': 'c', // LATIN SMALL LETTER C WITH DOT ABOVE
'ƈ': 'c', // LATIN SMALL LETTER C WITH HOOK
'ȼ': 'c', // LATIN SMALL LETTER C WITH STROKE
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER CLOSED OMEGA' (ɷ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER CLOSED OPEN E' (ʚ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER CLOSED REVERSED OPEN E' (ɞ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER CON' (ꝯ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER CUATRILLO' (ꜭ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER CUATRILLO WITH COMMA' (ꜯ)
'ď': 'd', // LATIN SMALL LETTER D WITH CARON
'ḑ': 'd', // LATIN SMALL LETTER D WITH CEDILLA
'ḓ': 'd', // LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW
'ȡ': 'd', // LATIN SMALL LETTER D WITH CURL
'ḋ': 'd', // LATIN SMALL LETTER D WITH DOT ABOVE
'ḍ': 'd', // LATIN SMALL LETTER D WITH DOT BELOW
'ɗ': 'd', // LATIN SMALL LETTER D WITH HOOK
'ᶑ': 'd', // LATIN SMALL LETTER D WITH HOOK AND TAIL
'ḏ': 'd', // LATIN SMALL LETTER D WITH LINE BELOW
'ᵭ': 'd', // LATIN SMALL LETTER D WITH MIDDLE TILDE
'ᶁ': 'd', // LATIN SMALL LETTER D WITH PALATAL HOOK
'đ': 'd', // LATIN SMALL LETTER D WITH STROKE
'ɖ': 'd', // LATIN SMALL LETTER D WITH TAIL
'ƌ': 'd', // LATIN SMALL LETTER D WITH TOPBAR
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER DB DIGRAPH' (ȸ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER DELTA' (ẟ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER DEZH DIGRAPH' (ʤ)
'ı': 'i', // LATIN SMALL LETTER DOTLESS I
'ȷ': 'j', // LATIN SMALL LETTER DOTLESS J
'ɟ': 'j', // LATIN SMALL LETTER DOTLESS J WITH STROKE
'ʄ': 'j', // LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER DUM' (ꝱ)
'ǳ': 'dz', // LATIN SMALL LETTER DZ
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER DZ DIGRAPH' (ʣ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER DZ DIGRAPH WITH CURL' (ʥ)
'ǆ': 'dz', // LATIN SMALL LETTER DZ WITH CARON
'é': 'e', // LATIN SMALL LETTER E WITH ACUTE
'ĕ': 'e', // LATIN SMALL LETTER E WITH BREVE
'ě': 'e', // LATIN SMALL LETTER E WITH CARON
'ȩ': 'e', // LATIN SMALL LETTER E WITH CEDILLA
'ḝ': 'e', // LATIN SMALL LETTER E WITH CEDILLA AND BREVE
'ê': 'e', // LATIN SMALL LETTER E WITH CIRCUMFLEX
'ế': 'e', // LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
'ệ': 'e', // LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
'ề': 'e', // LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
'ể': 'e', // LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
'ễ': 'e', // LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
'ḙ': 'e', // LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW
'ë': 'e', // LATIN SMALL LETTER E WITH DIAERESIS
'ė': 'e', // LATIN SMALL LETTER E WITH DOT ABOVE
'ẹ': 'e', // LATIN SMALL LETTER E WITH DOT BELOW
'ȅ': 'e', // LATIN SMALL LETTER E WITH DOUBLE GRAVE
'è': 'e', // LATIN SMALL LETTER E WITH GRAVE
'ẻ': 'e', // LATIN SMALL LETTER E WITH HOOK ABOVE
'ȇ': 'e', // LATIN SMALL LETTER E WITH INVERTED BREVE
'ē': 'e', // LATIN SMALL LETTER E WITH MACRON
'ḗ': 'e', // LATIN SMALL LETTER E WITH MACRON AND ACUTE
'ḕ': 'e', // LATIN SMALL LETTER E WITH MACRON AND GRAVE
'ⱸ': 'e', // LATIN SMALL LETTER E WITH NOTCH
'ę': 'e', // LATIN SMALL LETTER E WITH OGONEK
'ᶒ': 'e', // LATIN SMALL LETTER E WITH RETROFLEX HOOK
'ɇ': 'e', // LATIN SMALL LETTER E WITH STROKE
'ẽ': 'e', // LATIN SMALL LETTER E WITH TILDE
'ḛ': 'e', // LATIN SMALL LETTER E WITH TILDE BELOW
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER EGYPTOLOGICAL AIN' (ꜥ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER EGYPTOLOGICAL ALEF' (ꜣ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER ENG' (ŋ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER ESH' (ʃ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER ESH WITH CURL' (ʆ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER ESH WITH PALATAL HOOK' (ᶋ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER ESH WITH RETROFLEX HOOK' (ᶘ)
'ꝫ': 'et', // LATIN SMALL LETTER ET
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER ETH' (ð)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER EZH' (ʒ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER EZH REVERSED' (ƹ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER EZH WITH CARON' (ǯ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER EZH WITH CURL' (ʓ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER EZH WITH RETROFLEX HOOK' (ᶚ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER EZH WITH TAIL' (ƺ)
'ḟ': 'f', // LATIN SMALL LETTER F WITH DOT ABOVE
'ƒ': 'f', // LATIN SMALL LETTER F WITH HOOK
'ᵮ': 'f', // LATIN SMALL LETTER F WITH MIDDLE TILDE
'ᶂ': 'f', // LATIN SMALL LETTER F WITH PALATAL HOOK
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER FENG DIGRAPH' (ʩ)
'ǵ': 'g', // LATIN SMALL LETTER G WITH ACUTE
'ğ': 'g', // LATIN SMALL LETTER G WITH BREVE
'ǧ': 'g', // LATIN SMALL LETTER G WITH CARON
'ģ': 'g', // LATIN SMALL LETTER G WITH CEDILLA
'ĝ': 'g', // LATIN SMALL LETTER G WITH CIRCUMFLEX
'ġ': 'g', // LATIN SMALL LETTER G WITH DOT ABOVE
'ɠ': 'g', // LATIN SMALL LETTER G WITH HOOK
'ḡ': 'g', // LATIN SMALL LETTER G WITH MACRON
'ᶃ': 'g', // LATIN SMALL LETTER G WITH PALATAL HOOK
'ǥ': 'g', // LATIN SMALL LETTER G WITH STROKE
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER GAMMA' (ɣ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER GLOTTAL STOP' (ɂ)
'ḫ': 'h', // LATIN SMALL LETTER H WITH BREVE BELOW
'ȟ': 'h', // LATIN SMALL LETTER H WITH CARON
'ḩ': 'h', // LATIN SMALL LETTER H WITH CEDILLA
'ĥ': 'h', // LATIN SMALL LETTER H WITH CIRCUMFLEX
'ⱨ': 'h', // LATIN SMALL LETTER H WITH DESCENDER
'ḧ': 'h', // LATIN SMALL LETTER H WITH DIAERESIS
'ḣ': 'h', // LATIN SMALL LETTER H WITH DOT ABOVE
'ḥ': 'h', // LATIN SMALL LETTER H WITH DOT BELOW
'ɦ': 'h', // LATIN SMALL LETTER H WITH HOOK
'ẖ': 'h', // LATIN SMALL LETTER H WITH LINE BELOW
'ħ': 'h', // LATIN SMALL LETTER H WITH STROKE
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER HALF H' (ⱶ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER HENG' (ꜧ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER HENG WITH HOOK' (ɧ)
'ƕ': 'hv', // LATIN SMALL LETTER HV
'í': 'i', // LATIN SMALL LETTER I WITH ACUTE
'ĭ': 'i', // LATIN SMALL LETTER I WITH BREVE
'ǐ': 'i', // LATIN SMALL LETTER I WITH CARON
'î': 'i', // LATIN SMALL LETTER I WITH CIRCUMFLEX
'ï': 'i', // LATIN SMALL LETTER I WITH DIAERESIS
'ḯ': 'i', // LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
'ị': 'i', // LATIN SMALL LETTER I WITH DOT BELOW
'ȉ': 'i', // LATIN SMALL LETTER I WITH DOUBLE GRAVE
'ì': 'i', // LATIN SMALL LETTER I WITH GRAVE
'ỉ': 'i', // LATIN SMALL LETTER I WITH HOOK ABOVE
'ȋ': 'i', // LATIN SMALL LETTER I WITH INVERTED BREVE
'ī': 'i', // LATIN SMALL LETTER I WITH MACRON
'į': 'i', // LATIN SMALL LETTER I WITH OGONEK
'ᶖ': 'i', // LATIN SMALL LETTER I WITH RETROFLEX HOOK
'ɨ': 'i', // LATIN SMALL LETTER I WITH STROKE
'ĩ': 'i', // LATIN SMALL LETTER I WITH TILDE
'ḭ': 'i', // LATIN SMALL LETTER I WITH TILDE BELOW
'ꝺ': 'd', // LATIN SMALL LETTER INSULAR D
'ꝼ': 'f', // LATIN SMALL LETTER INSULAR F
'ᵹ': 'g', // LATIN SMALL LETTER INSULAR G
'ꞃ': 'r', // LATIN SMALL LETTER INSULAR R
'ꞅ': 's', // LATIN SMALL LETTER INSULAR S
'ꞇ': 't', // LATIN SMALL LETTER INSULAR T
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER IOTA' (ɩ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER IOTA WITH STROKE' (ᵼ)
'ꝭ': 'is', // LATIN SMALL LETTER IS
'ǰ': 'j', // LATIN SMALL LETTER J WITH CARON
'ĵ': 'j', // LATIN SMALL LETTER J WITH CIRCUMFLEX
'ʝ': 'j', // LATIN SMALL LETTER J WITH CROSSED-TAIL
'ɉ': 'j', // LATIN SMALL LETTER J WITH STROKE
'ḱ': 'k', // LATIN SMALL LETTER K WITH ACUTE
'ǩ': 'k', // LATIN SMALL LETTER K WITH CARON
'ķ': 'k', // LATIN SMALL LETTER K WITH CEDILLA
'ⱪ': 'k', // LATIN SMALL LETTER K WITH DESCENDER
'ꝃ': 'k', // LATIN SMALL LETTER K WITH DIAGONAL STROKE
'ḳ': 'k', // LATIN SMALL LETTER K WITH DOT BELOW
'ƙ': 'k', // LATIN SMALL LETTER K WITH HOOK
'ḵ': 'k', // LATIN SMALL LETTER K WITH LINE BELOW
'ᶄ': 'k', // LATIN SMALL LETTER K WITH PALATAL HOOK
'ꝁ': 'k', // LATIN SMALL LETTER K WITH STROKE
'ꝅ': 'k', // LATIN SMALL LETTER K WITH STROKE AND DIAGONAL STROKE
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER KRA' (ĸ)
'ĺ': 'l', // LATIN SMALL LETTER L WITH ACUTE
'ƚ': 'l', // LATIN SMALL LETTER L WITH BAR
'ɬ': 'l', // LATIN SMALL LETTER L WITH BELT
'ľ': 'l', // LATIN SMALL LETTER L WITH CARON
'ļ': 'l', // LATIN SMALL LETTER L WITH CEDILLA
'ḽ': 'l', // LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW
'ȴ': 'l', // LATIN SMALL LETTER L WITH CURL
'ḷ': 'l', // LATIN SMALL LETTER L WITH DOT BELOW
'ḹ': 'l', // LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
'ⱡ': 'l', // LATIN SMALL LETTER L WITH DOUBLE BAR
'ꝉ': 'l', // LATIN SMALL LETTER L WITH HIGH STROKE
'ḻ': 'l', // LATIN SMALL LETTER L WITH LINE BELOW
'ŀ': 'l', // LATIN SMALL LETTER L WITH MIDDLE DOT
'ɫ': 'l', // LATIN SMALL LETTER L WITH MIDDLE TILDE
'ᶅ': 'l', // LATIN SMALL LETTER L WITH PALATAL HOOK
'ɭ': 'l', // LATIN SMALL LETTER L WITH RETROFLEX HOOK
'ł': 'l', // LATIN SMALL LETTER L WITH STROKE
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER LAMBDA WITH STROKE' (ƛ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER LEZH' (ɮ)
'ǉ': 'lj', // LATIN SMALL LETTER LJ
'ſ': 's', // LATIN SMALL LETTER LONG S
'ẜ': 's', // LATIN SMALL LETTER LONG S WITH DIAGONAL STROKE
'ẛ': 's', // LATIN SMALL LETTER LONG S WITH DOT ABOVE
'ẝ': 's', // LATIN SMALL LETTER LONG S WITH HIGH STROKE
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER LS DIGRAPH' (ʪ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER LUM' (ꝲ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER LZ DIGRAPH' (ʫ)
'ḿ': 'm', // LATIN SMALL LETTER M WITH ACUTE
'ṁ': 'm', // LATIN SMALL LETTER M WITH DOT ABOVE
'ṃ': 'm', // LATIN SMALL LETTER M WITH DOT BELOW
'ɱ': 'm', // LATIN SMALL LETTER M WITH HOOK
'ᵯ': 'm', // LATIN SMALL LETTER M WITH MIDDLE TILDE
'ᶆ': 'm', // LATIN SMALL LETTER M WITH PALATAL HOOK
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER MIDDLE-WELSH LL' (ỻ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER MIDDLE-WELSH V' (ỽ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER MUM' (ꝳ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER N PRECEDED BY APOSTROPHE' (ŉ)
'ń': 'n', // LATIN SMALL LETTER N WITH ACUTE
'ň': 'n', // LATIN SMALL LETTER N WITH CARON
'ņ': 'n', // LATIN SMALL LETTER N WITH CEDILLA
'ṋ': 'n', // LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW
'ȵ': 'n', // LATIN SMALL LETTER N WITH CURL
'ṅ': 'n', // LATIN SMALL LETTER N WITH DOT ABOVE
'ṇ': 'n', // LATIN SMALL LETTER N WITH DOT BELOW
'ǹ': 'n', // LATIN SMALL LETTER N WITH GRAVE
'ɲ': 'n', // LATIN SMALL LETTER N WITH LEFT HOOK
'ṉ': 'n', // LATIN SMALL LETTER N WITH LINE BELOW
'ƞ': 'n', // LATIN SMALL LETTER N WITH LONG RIGHT LEG
'ᵰ': 'n', // LATIN SMALL LETTER N WITH MIDDLE TILDE
'ᶇ': 'n', // LATIN SMALL LETTER N WITH PALATAL HOOK
'ɳ': 'n', // LATIN SMALL LETTER N WITH RETROFLEX HOOK
'ñ': 'n', // LATIN SMALL LETTER N WITH TILDE
'ǌ': 'nj', // LATIN SMALL LETTER NJ
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER NUM' (ꝴ)
'ó': 'o', // LATIN SMALL LETTER O WITH ACUTE
'ŏ': 'o', // LATIN SMALL LETTER O WITH BREVE
'ǒ': 'o', // LATIN SMALL LETTER O WITH CARON
'ô': 'o', // LATIN SMALL LETTER O WITH CIRCUMFLEX
'ố': 'o', // LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
'ộ': 'o', // LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
'ồ': 'o', // LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
'ổ': 'o', // LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
'ỗ': 'o', // LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
'ö': 'o', // LATIN SMALL LETTER O WITH DIAERESIS
'ȫ': 'o', // LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
'ȯ': 'o', // LATIN SMALL LETTER O WITH DOT ABOVE
'ȱ': 'o', // LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
'ọ': 'o', // LATIN SMALL LETTER O WITH DOT BELOW
'ő': 'o', // LATIN SMALL LETTER O WITH DOUBLE ACUTE
'ȍ': 'o', // LATIN SMALL LETTER O WITH DOUBLE GRAVE
'ò': 'o', // LATIN SMALL LETTER O WITH GRAVE
'ỏ': 'o', // LATIN SMALL LETTER O WITH HOOK ABOVE
'ơ': 'o', // LATIN SMALL LETTER O WITH HORN
'ớ': 'o', // LATIN SMALL LETTER O WITH HORN AND ACUTE
'ợ': 'o', // LATIN SMALL LETTER O WITH HORN AND DOT BELOW
'ờ': 'o', // LATIN SMALL LETTER O WITH HORN AND GRAVE
'ở': 'o', // LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
'ỡ': 'o', // LATIN SMALL LETTER O WITH HORN AND TILDE
'ȏ': 'o', // LATIN SMALL LETTER O WITH INVERTED BREVE
'ꝋ': 'o', // LATIN SMALL LETTER O WITH LONG STROKE OVERLAY
'ꝍ': 'o', // LATIN SMALL LETTER O WITH LOOP
'ⱺ': 'o', // LATIN SMALL LETTER O WITH LOW RING INSIDE
'ō': 'o', // LATIN SMALL LETTER O WITH MACRON
'ṓ': 'o', // LATIN SMALL LETTER O WITH MACRON AND ACUTE
'ṑ': 'o', // LATIN SMALL LETTER O WITH MACRON AND GRAVE
'ǫ': 'o', // LATIN SMALL LETTER O WITH OGONEK
'ǭ': 'o', // LATIN SMALL LETTER O WITH OGONEK AND MACRON
'ø': 'o', // LATIN SMALL LETTER O WITH STROKE
'ǿ': 'o', // LATIN SMALL LETTER O WITH STROKE AND ACUTE
'õ': 'o', // LATIN SMALL LETTER O WITH TILDE
'ṍ': 'o', // LATIN SMALL LETTER O WITH TILDE AND ACUTE
'ṏ': 'o', // LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
'ȭ': 'o', // LATIN SMALL LETTER O WITH TILDE AND MACRON
'ƣ': 'oi', // LATIN SMALL LETTER OI
'ꝏ': 'oo', // LATIN SMALL LETTER OO
'ɛ': 'e', // LATIN SMALL LETTER OPEN E
'ᶓ': 'e', // LATIN SMALL LETTER OPEN E WITH RETROFLEX HOOK
'ɔ': 'o', // LATIN SMALL LETTER OPEN O
'ᶗ': 'o', // LATIN SMALL LETTER OPEN O WITH RETROFLEX HOOK
'ȣ': 'ou', // LATIN SMALL LETTER OU
'ṕ': 'p', // LATIN SMALL LETTER P WITH ACUTE
'ṗ': 'p', // LATIN SMALL LETTER P WITH DOT ABOVE
'ꝓ': 'p', // LATIN SMALL LETTER P WITH FLOURISH
'ƥ': 'p', // LATIN SMALL LETTER P WITH HOOK
'ᵱ': 'p', // LATIN SMALL LETTER P WITH MIDDLE TILDE
'ᶈ': 'p', // LATIN SMALL LETTER P WITH PALATAL HOOK
'ꝕ': 'p', // LATIN SMALL LETTER P WITH SQUIRREL TAIL
'ᵽ': 'p', // LATIN SMALL LETTER P WITH STROKE
'ꝑ': 'p', // LATIN SMALL LETTER P WITH STROKE THROUGH DESCENDER
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER PHI' (ɸ)
'ꝙ': 'q', // LATIN SMALL LETTER Q WITH DIAGONAL STROKE
'ʠ': 'q', // LATIN SMALL LETTER Q WITH HOOK
'ɋ': 'q', // LATIN SMALL LETTER Q WITH HOOK TAIL
'ꝗ': 'q', // LATIN SMALL LETTER Q WITH STROKE THROUGH DESCENDER
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER QP DIGRAPH' (ȹ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER R ROTUNDA' (ꝛ)
'ŕ': 'r', // LATIN SMALL LETTER R WITH ACUTE
'ř': 'r', // LATIN SMALL LETTER R WITH CARON
'ŗ': 'r', // LATIN SMALL LETTER R WITH CEDILLA
'ṙ': 'r', // LATIN SMALL LETTER R WITH DOT ABOVE
'ṛ': 'r', // LATIN SMALL LETTER R WITH DOT BELOW
'ṝ': 'r', // LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
'ȑ': 'r', // LATIN SMALL LETTER R WITH DOUBLE GRAVE
'ɾ': 'r', // LATIN SMALL LETTER R WITH FISHHOOK
'ᵳ': 'r', // LATIN SMALL LETTER R WITH FISHHOOK AND MIDDLE TILDE
'ȓ': 'r', // LATIN SMALL LETTER R WITH INVERTED BREVE
'ṟ': 'r', // LATIN SMALL LETTER R WITH LINE BELOW
'ɼ': 'r', // LATIN SMALL LETTER R WITH LONG LEG
'ᵲ': 'r', // LATIN SMALL LETTER R WITH MIDDLE TILDE
'ᶉ': 'r', // LATIN SMALL LETTER R WITH PALATAL HOOK
'ɍ': 'r', // LATIN SMALL LETTER R WITH STROKE
'ɽ': 'r', // LATIN SMALL LETTER R WITH TAIL
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER RAMS HORN' (ɤ)
'ↄ': 'c', // LATIN SMALL LETTER REVERSED C
'ꜿ': 'c', // LATIN SMALL LETTER REVERSED C WITH DOT
'ɘ': 'e', // LATIN SMALL LETTER REVERSED E
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER REVERSED OPEN E' (ɜ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER REVERSED OPEN E WITH HOOK' (ɝ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER REVERSED OPEN E WITH RETROFLEX HOOK' (ᶔ)
'ɿ': 'r', // LATIN SMALL LETTER REVERSED R WITH FISHHOOK
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER RUM' (ꝵ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER RUM ROTUNDA' (ꝝ)
'ś': 's', // LATIN SMALL LETTER S WITH ACUTE
'ṥ': 's', // LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
'š': 's', // LATIN SMALL LETTER S WITH CARON
'ṧ': 's', // LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
'ş': 's', // LATIN SMALL LETTER S WITH CEDILLA
'ŝ': 's', // LATIN SMALL LETTER S WITH CIRCUMFLEX
'ș': 's', // LATIN SMALL LETTER S WITH COMMA BELOW
'ṡ': 's', // LATIN SMALL LETTER S WITH DOT ABOVE
'ṣ': 's', // LATIN SMALL LETTER S WITH DOT BELOW
'ṩ': 's', // LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
'ʂ': 's', // LATIN SMALL LETTER S WITH HOOK
'ᵴ': 's', // LATIN SMALL LETTER S WITH MIDDLE TILDE
'ᶊ': 's', // LATIN SMALL LETTER S WITH PALATAL HOOK
'ȿ': 's', // LATIN SMALL LETTER S WITH SWASH TAIL
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER SALTILLO' (ꞌ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER SCHWA' (ə)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER SCHWA WITH HOOK' (ɚ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER SCHWA WITH RETROFLEX HOOK' (ᶕ)
'ɡ': 'g', // LATIN SMALL LETTER SCRIPT G
'ß': 'ss', // LATIN SMALL LETTER SHARP S
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER SIDEWAYS DIAERESIZED U' (ᴞ)
'ᴑ': 'o', // LATIN SMALL LETTER SIDEWAYS O
'ᴓ': 'o', // LATIN SMALL LETTER SIDEWAYS O WITH STROKE
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER SIDEWAYS OPEN O' (ᴒ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER SIDEWAYS TURNED M' (ᴟ)
'ᴝ': 'u', // LATIN SMALL LETTER SIDEWAYS U
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER SQUAT REVERSED ESH' (ʅ)
'ť': 't', // LATIN SMALL LETTER T WITH CARON
'ţ': 't', // LATIN SMALL LETTER T WITH CEDILLA
'ṱ': 't', // LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW
'ț': 't', // LATIN SMALL LETTER T WITH COMMA BELOW
'ȶ': 't', // LATIN SMALL LETTER T WITH CURL
'ẗ': 't', // LATIN SMALL LETTER T WITH DIAERESIS
'ⱦ': 't', // LATIN SMALL LETTER T WITH DIAGONAL STROKE
'ṫ': 't', // LATIN SMALL LETTER T WITH DOT ABOVE
'ṭ': 't', // LATIN SMALL LETTER T WITH DOT BELOW
'ƭ': 't', // LATIN SMALL LETTER T WITH HOOK
'ṯ': 't', // LATIN SMALL LETTER T WITH LINE BELOW
'ᵵ': 't', // LATIN SMALL LETTER T WITH MIDDLE TILDE
'ƫ': 't', // LATIN SMALL LETTER T WITH PALATAL HOOK
'ʈ': 't', // LATIN SMALL LETTER T WITH RETROFLEX HOOK
'ŧ': 't', // LATIN SMALL LETTER T WITH STROKE
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER TAILLESS PHI' (ⱷ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER TC DIGRAPH WITH CURL' (ʨ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER TESH DIGRAPH' (ʧ)
'ᵺ': 'th', // LATIN SMALL LETTER TH WITH STRIKETHROUGH
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER THORN' (þ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER THORN WITH STROKE' (ꝥ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER THORN WITH STROKE THROUGH DESCENDER' (ꝧ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER TONE FIVE' (ƽ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER TONE SIX' (ƅ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER TONE TWO' (ƨ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER TOP HALF O' (ᴖ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER TRESILLO' (ꜫ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER TS DIGRAPH' (ʦ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER TUM' (ꝷ)
'ɐ': 'a', // LATIN SMALL LETTER TURNED A
'ᴂ': 'ae', // LATIN SMALL LETTER TURNED AE
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER TURNED ALPHA' (ɒ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER TURNED DELTA' (ƍ)
'ǝ': 'e', // LATIN SMALL LETTER TURNED E
'ᵷ': 'g', // LATIN SMALL LETTER TURNED G
'ɥ': 'h', // LATIN SMALL LETTER TURNED H
'ʮ': 'h', // LATIN SMALL LETTER TURNED H WITH FISHHOOK
'ʯ': 'h', // LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL
'ᴉ': 'i', // LATIN SMALL LETTER TURNED I
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER TURNED INSULAR G' (ꝿ)
'ʞ': 'k', // LATIN SMALL LETTER TURNED K
'ꞁ': 'l', // LATIN SMALL LETTER TURNED L
'ɯ': 'm', // LATIN SMALL LETTER TURNED M
'ɰ': 'm', // LATIN SMALL LETTER TURNED M WITH LONG LEG
'ᴔ': 'oe', // LATIN SMALL LETTER TURNED OE
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER TURNED OPEN E' (ᴈ)
'ɹ': 'r', // LATIN SMALL LETTER TURNED R
'ɻ': 'r', // LATIN SMALL LETTER TURNED R WITH HOOK
'ɺ': 'r', // LATIN SMALL LETTER TURNED R WITH LONG LEG
'ⱹ': 'r', // LATIN SMALL LETTER TURNED R WITH TAIL
'ʇ': 't', // LATIN SMALL LETTER TURNED T
'ʌ': 'v', // LATIN SMALL LETTER TURNED V
'ʍ': 'w', // LATIN SMALL LETTER TURNED W
'ʎ': 'y', // LATIN SMALL LETTER TURNED Y
'ꜩ': 'tz', // LATIN SMALL LETTER TZ
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER U BAR' (ʉ)
'ú': 'u', // LATIN SMALL LETTER U WITH ACUTE
'ŭ': 'u', // LATIN SMALL LETTER U WITH BREVE
'ǔ': 'u', // LATIN SMALL LETTER U WITH CARON
'û': 'u', // LATIN SMALL LETTER U WITH CIRCUMFLEX
'ṷ': 'u', // LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW
'ü': 'u', // LATIN SMALL LETTER U WITH DIAERESIS
'ǘ': 'u', // LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
'ǚ': 'u', // LATIN SMALL LETTER U WITH DIAERESIS AND CARON
'ǜ': 'u', // LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
'ǖ': 'u', // LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
'ṳ': 'u', // LATIN SMALL LETTER U WITH DIAERESIS BELOW
'ụ': 'u', // LATIN SMALL LETTER U WITH DOT BELOW
'ű': 'u', // LATIN SMALL LETTER U WITH DOUBLE ACUTE
'ȕ': 'u', // LATIN SMALL LETTER U WITH DOUBLE GRAVE
'ù': 'u', // LATIN SMALL LETTER U WITH GRAVE
'ủ': 'u', // LATIN SMALL LETTER U WITH HOOK ABOVE
'ư': 'u', // LATIN SMALL LETTER U WITH HORN
'ứ': 'u', // LATIN SMALL LETTER U WITH HORN AND ACUTE
'ự': 'u', // LATIN SMALL LETTER U WITH HORN AND DOT BELOW
'ừ': 'u', // LATIN SMALL LETTER U WITH HORN AND GRAVE
'ử': 'u', // LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
'ữ': 'u', // LATIN SMALL LETTER U WITH HORN AND TILDE
'ȗ': 'u', // LATIN SMALL LETTER U WITH INVERTED BREVE
'ū': 'u', // LATIN SMALL LETTER U WITH MACRON
'ṻ': 'u', // LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
'ų': 'u', // LATIN SMALL LETTER U WITH OGONEK
'ᶙ': 'u', // LATIN SMALL LETTER U WITH RETROFLEX HOOK
'ů': 'u', // LATIN SMALL LETTER U WITH RING ABOVE
'ũ': 'u', // LATIN SMALL LETTER U WITH TILDE
'ṹ': 'u', // LATIN SMALL LETTER U WITH TILDE AND ACUTE
'ṵ': 'u', // LATIN SMALL LETTER U WITH TILDE BELOW
'ᵫ': 'ue', // LATIN SMALL LETTER UE
'ꝸ': 'um', // LATIN SMALL LETTER UM
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER UPSILON' (ʊ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER UPSILON WITH STROKE' (ᵿ)
'ⱴ': 'v', // LATIN SMALL LETTER V WITH CURL
'ꝟ': 'v', // LATIN SMALL LETTER V WITH DIAGONAL STROKE
'ṿ': 'v', // LATIN SMALL LETTER V WITH DOT BELOW
'ʋ': 'v', // LATIN SMALL LETTER V WITH HOOK
'ᶌ': 'v', // LATIN SMALL LETTER V WITH PALATAL HOOK
'ⱱ': 'v', // LATIN SMALL LETTER V WITH RIGHT HOOK
'ṽ': 'v', // LATIN SMALL LETTER V WITH TILDE
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER VEND' (ꝩ)
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER VISIGOTHIC Z' (ꝣ)
'ꝡ': 'vy', // LATIN SMALL LETTER VY
'ẃ': 'w', // LATIN SMALL LETTER W WITH ACUTE
'ŵ': 'w', // LATIN SMALL LETTER W WITH CIRCUMFLEX
'ẅ': 'w', // LATIN SMALL LETTER W WITH DIAERESIS
'ẇ': 'w', // LATIN SMALL LETTER W WITH DOT ABOVE
'ẉ': 'w', // LATIN SMALL LETTER W WITH DOT BELOW
'ẁ': 'w', // LATIN SMALL LETTER W WITH GRAVE
'ⱳ': 'w', // LATIN SMALL LETTER W WITH HOOK
'ẘ': 'w', // LATIN SMALL LETTER W WITH RING ABOVE
'ẍ': 'x', // LATIN SMALL LETTER X WITH DIAERESIS
'ẋ': 'x', // LATIN SMALL LETTER X WITH DOT ABOVE
'ᶍ': 'x', // LATIN SMALL LETTER X WITH PALATAL HOOK
'ý': 'y', // LATIN SMALL LETTER Y WITH ACUTE
'ŷ': 'y', // LATIN SMALL LETTER Y WITH CIRCUMFLEX
'ÿ': 'y', // LATIN SMALL LETTER Y WITH DIAERESIS
'ẏ': 'y', // LATIN SMALL LETTER Y WITH DOT ABOVE
'ỵ': 'y', // LATIN SMALL LETTER Y WITH DOT BELOW
'ỳ': 'y', // LATIN SMALL LETTER Y WITH GRAVE
'ƴ': 'y', // LATIN SMALL LETTER Y WITH HOOK
'ỷ': 'y', // LATIN SMALL LETTER Y WITH HOOK ABOVE
'ỿ': 'y', // LATIN SMALL LETTER Y WITH LOOP
'ȳ': 'y', // LATIN SMALL LETTER Y WITH MACRON
'ẙ': 'y', // LATIN SMALL LETTER Y WITH RING ABOVE
'ɏ': 'y', // LATIN SMALL LETTER Y WITH STROKE
'ỹ': 'y', // LATIN SMALL LETTER Y WITH TILDE
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LETTER YOGH' (ȝ)
'ź': 'z', // LATIN SMALL LETTER Z WITH ACUTE
'ž': 'z', // LATIN SMALL LETTER Z WITH CARON
'ẑ': 'z', // LATIN SMALL LETTER Z WITH CIRCUMFLEX
'ʑ': 'z', // LATIN SMALL LETTER Z WITH CURL
'ⱬ': 'z', // LATIN SMALL LETTER Z WITH DESCENDER
'ż': 'z', // LATIN SMALL LETTER Z WITH DOT ABOVE
'ẓ': 'z', // LATIN SMALL LETTER Z WITH DOT BELOW
'ȥ': 'z', // LATIN SMALL LETTER Z WITH HOOK
'ẕ': 'z', // LATIN SMALL LETTER Z WITH LINE BELOW
'ᵶ': 'z', // LATIN SMALL LETTER Z WITH MIDDLE TILDE
'ᶎ': 'z', // LATIN SMALL LETTER Z WITH PALATAL HOOK
'ʐ': 'z', // LATIN SMALL LETTER Z WITH RETROFLEX HOOK
'ƶ': 'z', // LATIN SMALL LETTER Z WITH STROKE
'ɀ': 'z', // LATIN SMALL LETTER Z WITH SWASH TAIL
'ﬀ': 'ff', // LATIN SMALL LIGATURE FF
'ﬃ': 'ffi', // LATIN SMALL LIGATURE FFI
'ﬄ': 'ffl', // LATIN SMALL LIGATURE FFL
'ﬁ': 'fi', // LATIN SMALL LIGATURE FI
'ﬂ': 'fl', // LATIN SMALL LIGATURE FL
'ĳ': 'ij', // LATIN SMALL LIGATURE IJ
// CANNOT FIND APPROXIMATION FOR 'LATIN SMALL LIGATURE LONG S T' (ﬅ)
'œ': 'oe', // LATIN SMALL LIGATURE OE
'ﬆ': 'st', // LATIN SMALL LIGATURE ST
'ₐ': 'a', // LATIN SUBSCRIPT SMALL LETTER A
'ₑ': 'e', // LATIN SUBSCRIPT SMALL LETTER E
'ᵢ': 'i', // LATIN SUBSCRIPT SMALL LETTER I
'ⱼ': 'j', // LATIN SUBSCRIPT SMALL LETTER J
'ₒ': 'o', // LATIN SUBSCRIPT SMALL LETTER O
'ᵣ': 'r', // LATIN SUBSCRIPT SMALL LETTER R
// CANNOT FIND APPROXIMATION FOR 'LATIN SUBSCRIPT SMALL LETTER SCHWA' (ₔ)
'ᵤ': 'u', // LATIN SUBSCRIPT SMALL LETTER U
'ᵥ': 'v', // LATIN SUBSCRIPT SMALL LETTER V
'ₓ': 'x' // LATIN SUBSCRIPT SMALL LETTER X
};

String.prototype.latinise = function() {
	return this.replace(/[^A-Za-z0-9\[\] ]/g, function(x) { return Latinise.latin_map[x] || x; });
};

// American English spelling :)
String.prototype.latinize = String.prototype.latinise;

String.prototype.isLatin = function() {
	return this == this.latinise();
};




jQuery(function($){
	$.datepicker.regional['es_ES'] = {
			 closeText: 'Cerrar',
			 prevText: '<Ant',
			 nextText: 'Sig>',
			 currentText: 'Hoy',
			 monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
			 monthNamesShort: ['Ene','Feb','Mar','Abr', 'May','Jun','Jul','Ago','Sep', 'Oct','Nov','Dic'],
			 dayNames: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
			 dayNamesShort: ['Dom','Lun','Mar','Mié','Jue','Vie','Sáb'],
			 dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'],
			 weekHeader: 'Sm',
			 dateFormat: 'dd/mm/yy',
			 firstDay: 1,
			 isRTL: false,
			 showMonthAfterYear: false,
			 yearSuffix: ''
	};

	$.datepicker.regional['gl_ES'] = {
			 closeText: 'Pechar',
			 prevText: '<Ant',
			 nextText: 'Nex>',
			 currentText: 'Hoxe',
			 monthNames: ['Xaneiro', 'Febreiro', 'Marzo', 'Abril', 'Maio', 'Xuño', 'Xullo', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Decembro'],
			 monthNamesShort: ['Xan','Feb','Mar','Abr', 'Mai','Xuñ','Xul','Ago','Set', 'Out','Nov','Dec'],
			 dayNames: ['Domingo', 'Luns', 'Martes', 'Mércores', 'Xoves', 'Venres', 'Sábado'],
			 dayNamesShort: ['Dom','Lun','Mar','Mér','Xov','Ven','Sáb'],
			 dayNamesMin: ['Do','Lu','Ma','Mé','Xo','Ve','Sá'],
			 weekHeader: 'Sm',
			 dateFormat: 'dd/mm/yy',
			 firstDay: 1,
			 isRTL: false,
			 showMonthAfterYear: false,
			 yearSuffix: ''
	};

	$.datepicker.regional['ca_ES'] = {
			 closeText: 'Tanca',
			 prevText: '<Ant',
			 nextText: 'Seg>',
			 currentText: 'Avui',
			 monthNames: ['Gener', 'Febrer', 'Març', 'Abril', 'Maig', 'Juny', 'Juliol', 'Agost', 'Setembre', 'Octubre', 'Novembre', 'Desembre'],
			 monthNamesShort: ['Gen','Feb','Mar','Abr', 'Mai','Jun','Jul','Ago','Set', 'Oct','Nov','Des'],
			 dayNames: ['Diumenge', 'Dilluns', 'Dimarts', 'Dimecres', 'Dijous', 'Divendres', 'Dissabte'],
			 dayNamesShort: ['Diu','Dil','Dim','Dim','Dij','Div','Dis'],
			 dayNamesMin: ['Dg','Dl','Dt','Dc','Dj','Dv','Ds'],
			 weekHeader: 'Sm',
			 dateFormat: 'dd/mm/yy',
			 firstDay: 1,
			 isRTL: false,
			 showMonthAfterYear: false,
			 yearSuffix: ''
	};

	$.datepicker.regional['ca_ES_VALENCIA'] = {
			 closeText: 'Tanca',
			 prevText: '<Ant',
			 nextText: 'Seg>',
			 currentText: 'Avui',
			 monthNames: ['Gener', 'Febrer', 'Març', 'Abril', 'Maig', 'Juny', 'Juliol', 'Agost', 'Setembre', 'Octubre', 'Novembre', 'Desembre'],
			 monthNamesShort: ['Gen','Feb','Mar','Abr', 'Mai','Jun','Jul','Ago','Set', 'Oct','Nov','Des'],
			 dayNames: ['Diumenge', 'Dilluns', 'Dimarts', 'Dimecres', 'Dijous', 'Divendres', 'Dissabte'],
			 dayNamesShort: ['Diu','Dil','Dim','Dim','Dij','Div','Dis'],
			 dayNamesMin: ['Dg','Dl','Dt','Dc','Dj','Dv','Ds'],
			 weekHeader: 'Sm',
			 dateFormat: 'dd/mm/yy',
			 firstDay: 1,
			 isRTL: false,
			 showMonthAfterYear: false,
			 yearSuffix: ''
	};

	$.datepicker.regional['eu_ES'] = {
			 closeText: 'Egina',
			 prevText: '<Aur',
			 nextText: 'Hur>',
			 currentText: 'Gaur',
			 monthNames: ['Urtarrila','Otsaila','Martxoa','Apirila','Maiatza','Ekaina',
			 'Uztaila','Abuztua','Iraila','Urria','Azaroa','Abendua'],
			 monthNamesShort: ['Urt','Ots','Mar','Api','Mai','Eka',
			 'Uzt','Abu','Ira','Urr','Aza','Abe'],
			 dayNames: ['Igandea','Astelehena','Asteartea','Asteazkena','Osteguna','Ostirala','Larunbata'],
			 dayNamesShort: ['Iga','Ast','Ast','Ast','Ost','Ost','Lar'],
			 dayNamesMin: ['Ig','As','As','As','Os','Os','La'],
			 dateFormat: 'dd/mm/yy', firstDay: 1,
			 isRTL: false
	};

	$.datepicker.regional['en_US'] = {
			 closeText: 'Close',
			 prevText: '<Prev',
			 nextText: 'Next>',
			 currentText: 'Today',
			 monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
			 monthNamesShort: ['Jan','Feb','Mar','Apr', 'May','Jun','Jul','Aug','Sep', 'Oct','Nov','Dec'],
			 dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
			 dayNamesShort: ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],
			 dayNamesMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
			 weekHeader: 'Wk',
			 dateFormat: 'mm/dd/yy',
			 firstDay: 0,
			 isRTL: false,
			 showMonthAfterYear: false,
			 yearSuffix: ''
	};


    $.datepicker.regional['fr_FR'] = {
        closeText: 'Fermer',
        prevText: '&#x3c;Préc',
        nextText: 'Suiv&#x3e;',
        currentText: 'Courant',
        monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
        'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
        monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
        'Jul','Aoû','Sep','Oct','Nov','Déc'],
        dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
        dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
        dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
        weekHeader: 'Sm',
        dateFormat: 'dd/mm/yy',
        firstDay: 1,
        isRTL: false,
        showMonthAfterYear: false,
        yearSuffix: ''};

    $.datepicker.regional['de_DE'] = {
			closeText: 'schließen',
			prevText: '<zurück',
			nextText: 'Vor>',
			currentText: 'Heute',
			monthNames: ['Januar','Februar','März','April','Mai','Juni', 'Juli','August','September','Oktober','November','Dezember'],
			monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', 'Jul','Aug','Sep','Okt','Nov','Dez'],
			dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
			dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
			dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
			weekHeader: 'Wo',
			dateFormat: 'dd/mm/yy',
			firstDay: 1,
	        isRTL: false,
	        showMonthAfterYear: false,
			yearSuffix: ''
            };

    $.datepicker.regional['pt_PT'] = {
			 closeText: 'Cerrar',
			 prevText: '<Ant',
			 nextText: 'Sig>',
			 currentText: 'Hoy',
			 monthNames: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
			 monthNamesShort: ['Jan','Fev','Mar','Abr', 'Mai','Jun','Jul','Ago','Set', 'Out','Nov','Dez'],
			 dayNames: ['Domingo', 'Segunda-feira', 'Terça-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sábado'],
			 dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
			 dayNamesMin: ['Do','Se','Te','Qa','Qi','Se','Sá'],
			 weekHeader: 'Sm',
			 dateFormat: 'dd/mm/yy',
			 firstDay: 1,
			 isRTL: false,
			 showMonthAfterYear: false,
			 yearSuffix: ''
	};

    $.datepicker.regional['it_IT'] = {
			 closeText: 'Chiudi',
			 prevText: '<Pre',
			 nextText: 'Suc>',
			 currentText: 'Oggi',
			 monthNames: ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre'],
			 monthNamesShort: ['Gen','Feb','Mar','Apr', 'Mag','Giu','Lug','Ago','Set', 'Ott','Nov','Dic'],
			 dayNames: ['Domenica', 'Lunedi', 'Martedì', 'Mercoledì', 'Giovedi', 'Venerdì', 'Sabato'],
			 dayNamesShort: ['Dom', 'Lun','Mar','Mer','Gio','Ven','Sab'],
			 dayNamesMin: ['Do','Lu','Ma','Me','Gi','Ve','Sa'],
			 weekHeader: 'Sett',
			 dateFormat: 'dd/mm/yy',
			 firstDay: 1,
			 isRTL: false,
			 showMonthAfterYear: false,
			 yearSuffix: ''
	};

	// WA-6756 Seteo desde aqui ya el locale, porque aun no se ha mostrado el calendario en vista
	$.datepicker.setDefaults($.datepicker.regional[i18n.locale]);
});


/*! jQuery UI - v1.12.1 - 2025-02-07
* http://jqueryui.com
* Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/draggable.js, widgets/droppable.js, widgets/resizable.js, widgets/selectable.js, widgets/sortable.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/selectmenu.js, widgets/slider.js, widgets/spinner.js, widgets/tabs.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */

(t=>{"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(k){k.ui=k.ui||{};k.ui.version="1.12.1";var n,s,x,C,o,a,r,h,l,i,W=0,c=Array.prototype.slice;k.cleanData=(n=k.cleanData,function(t){for(var e,i,s=0;null!=(i=t[s]);s++)try{(e=k._data(i,"events"))&&e.remove&&k(i).triggerHandler("remove")}catch(t){}n(t)}),k.widget=function(t,i,e){var s,n,o,a={},r=t.split(".")[0],h=r+"-"+(t=t.split(".")[1]);return e||(e=i,i=k.Widget),k.isArray(e)&&(e=k.extend.apply(null,[{}].concat(e))),k.expr[":"][h.toLowerCase()]=function(t){return!!k.data(t,h)},k[r]=k[r]||{},s=k[r][t],n=k[r][t]=function(t,e){if(!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},k.extend(n,s,{version:e.version,_proto:k.extend({},e),_childConstructors:[]}),(o=new i).options=k.widget.extend({},o.options),k.each(e,function(e,s){function n(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}k.isFunction(s)?a[e]=function(){var t,e=this._super,i=this._superApply;return this._super=n,this._superApply=o,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:a[e]=s}),n.prototype=k.widget.extend(o,{widgetEventPrefix:s&&o.widgetEventPrefix||t},a,{constructor:n,namespace:r,widgetName:t,widgetFullName:h}),s?(k.each(s._childConstructors,function(t,e){var i=e.prototype;k.widget(i.namespace+"."+i.widgetName,n,e._proto)}),delete s._childConstructors):i._childConstructors.push(n),k.widget.bridge(t,n),n},k.widget.extend=function(t){for(var e,i,s=c.call(arguments,1),n=0,o=s.length;n<o;n++)for(e in s[n])i=s[n][e],s[n].hasOwnProperty(e)&&void 0!==i&&(k.isPlainObject(i)?t[e]=k.isPlainObject(t[e])?k.widget.extend({},t[e],i):k.widget.extend({},i):t[e]=i);return t},k.widget.bridge=function(o,e){var a=e.prototype.widgetFullName||o;k.fn[o]=function(i){var t="string"==typeof i,s=c.call(arguments,1),n=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=k.data(this,a);return"instance"===i?(n=e,!1):e?k.isFunction(e[i])&&"_"!==i.charAt(0)?(t=e[i].apply(e,s))!==e&&void 0!==t?(n=t&&t.jquery?n.pushStack(t.get()):t,!1):void 0:k.error("no such method '"+i+"' for "+o+" widget instance"):k.error("cannot call methods on "+o+" prior to initialization; attempted to call method '"+i+"'")}):n=void 0:(s.length&&(i=k.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=k.data(this,a);t?(t.option(i||{}),t._init&&t._init()):k.data(this,a,new e(i,this))})),n}},k.Widget=function(){},k.Widget._childConstructors=[],k.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=k(e||this.defaultElement||this)[0],this.element=k(e),this.uuid=W++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=k(),this.hoverable=k(),this.focusable=k(),this.classesElementLookup={},e!==this&&(k.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=k(e.style?e.ownerDocument:e.document||e),this.window=k(this.document[0].defaultView||this.document[0].parentWindow)),this.options=k.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:k.noop,_create:k.noop,_init:k.noop,destroy:function(){var i=this;this._destroy(),k.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:k.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return k.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=k.widget.extend({},this.options[t]),n=0;n<i.length-1;n++)s[i[n]]=s[i[n]]||{},s=s[i[n]];if(t=i.pop(),1===arguments.length)return void 0===s[t]?null:s[t];s[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=e}return this._setOptions(o),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,s;for(e in t)s=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&s&&s.length&&(i=k(s.get()),this._removeClass(s,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(n){var o=[],a=this;function t(t,e){for(var i,s=0;s<t.length;s++)i=a.classesElementLookup[t[s]]||k(),i=n.add?k(k.unique(i.get().concat(n.element.get()))):k(i.not(n.element).get()),a.classesElementLookup[t[s]]=i,o.push(t[s]),e&&n.classes[t[s]]&&o.push(n.classes[t[s]])}return n=k.extend({element:this.element,classes:this.options.classes||{}},n),this._on(n.element,{remove:"_untrackClassesElement"}),n.keys&&t(n.keys.match(/\S+/g)||[],!0),n.extra&&t(n.extra.match(/\S+/g)||[]),o.join(" ")},_untrackClassesElement:function(i){var s=this;k.each(s.classesElementLookup,function(t,e){-1!==k.inArray(i.target,e)&&(s.classesElementLookup[t]=k(e.not(i.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){var n="string"==typeof t||null===t,e={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s="boolean"==typeof s?s:i};return e.element.toggleClass(this._classes(e),s),this},_on:function(n,o,t){var a,r=this;"boolean"!=typeof n&&(t=o,o=n,n=!1),t?(o=a=k(o),this.bindings=this.bindings.add(o)):(t=o,o=this.element,a=this.widget()),k.each(t,function(t,e){function i(){if(n||!0!==r.options.disabled&&!k(this).hasClass("ui-state-disabled"))return("string"==typeof e?r[e]:e).apply(r,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||k.guid++);var t=t.match(/^([\w:-]*)\s*(.*)$/),s=t[1]+r.eventNamespace,t=t[2];t?a.on(s,t,i):o.on(s,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e).off(e),this.bindings=k(this.bindings.not(t).get()),this.focusable=k(this.focusable.not(t).get()),this.hoverable=k(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(k(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(k(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(k(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(k(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var s,n,o=this.options[t];if(i=i||{},(e=k.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],n=e.originalEvent)for(s in n)s in e||(e[s]=n[s]);return this.element.trigger(e,i),!(k.isFunction(o)&&!1===o.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},k.each({show:"fadeIn",hide:"fadeOut"},function(o,a){k.Widget.prototype["_"+o]=function(e,t,i){var s=(t="string"==typeof t?{effect:t}:t)?!0!==t&&"number"!=typeof t&&t.effect||a:o,n=!k.isEmptyObject(t="number"==typeof(t=t||{})?{duration:t}:t);t.complete=i,t.delay&&e.delay(t.delay),n&&k.effects&&k.effects.effect[s]?e[o](t):s!==o&&e[s]?e[s](t.duration,t.easing,i):e.queue(function(t){k(this)[o](),i&&i.call(e[0]),t()})}}),k.widget;function E(t,e,i){return[parseFloat(t[0])*(l.test(t[0])?e/100:1),parseFloat(t[1])*(l.test(t[1])?i/100:1)]}function D(t,e){return parseInt(k.css(t,e),10)||0}x=Math.max,C=Math.abs,o=/left|center|right/,a=/top|center|bottom/,r=/[\+\-]\d+(\.[\d]+)?%?/,h=/^\w+/,l=/%$/,i=k.fn.position,k.position={scrollbarWidth:function(){var t,e,i;return void 0!==s?s:(i=(e=k("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>")).children()[0],k("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i)},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?k.position.scrollbarWidth():0,height:e?k.position.scrollbarWidth():0}},getWithinInfo:function(t){var e=k(t||window),i=k.isWindow(e[0]),s=!!e[0]&&9===e[0].nodeType;return{element:e,isWindow:i,isDocument:s,offset:!i&&!s?k(t).offset():{left:0,top:0},scrollLeft:e.scrollLeft(),scrollTop:e.scrollTop(),width:e.outerWidth(),height:e.outerHeight()}}},k.fn.position=function(u){if(!u||!u.of)return i.apply(this,arguments);u=k.extend({},u);var d,p,f,g,m,t,_=k(u.of),v=k.position.getWithinInfo(u.within),b=k.position.getScrollInfo(v),y=(u.collision||"flip").split(" "),w={},e=9===(e=(t=_)[0]).nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:k.isWindow(e)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:e.preventDefault?{width:0,height:0,offset:{top:e.pageY,left:e.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()};return _[0].preventDefault&&(u.at="left top"),p=e.width,f=e.height,m=k.extend({},g=e.offset),k.each(["my","at"],function(){var t,e,i=(u[this]||"").split(" ");(i=1===i.length?o.test(i[0])?i.concat(["center"]):a.test(i[0])?["center"].concat(i):["center","center"]:i)[0]=o.test(i[0])?i[0]:"center",i[1]=a.test(i[1])?i[1]:"center",t=r.exec(i[0]),e=r.exec(i[1]),w[this]=[t?t[0]:0,e?e[0]:0],u[this]=[h.exec(i[0])[0],h.exec(i[1])[0]]}),1===y.length&&(y[1]=y[0]),"right"===u.at[0]?m.left+=p:"center"===u.at[0]&&(m.left+=p/2),"bottom"===u.at[1]?m.top+=f:"center"===u.at[1]&&(m.top+=f/2),d=E(w.at,p,f),m.left+=d[0],m.top+=d[1],this.each(function(){var i,t,a=k(this),r=a.outerWidth(),h=a.outerHeight(),e=D(this,"marginLeft"),s=D(this,"marginTop"),n=r+e+D(this,"marginRight")+b.width,o=h+s+D(this,"marginBottom")+b.height,l=k.extend({},m),c=E(w.my,a.outerWidth(),a.outerHeight());"right"===u.my[0]?l.left-=r:"center"===u.my[0]&&(l.left-=r/2),"bottom"===u.my[1]?l.top-=h:"center"===u.my[1]&&(l.top-=h/2),l.left+=c[0],l.top+=c[1],i={marginLeft:e,marginTop:s},k.each(["left","top"],function(t,e){k.ui.position[y[t]]&&k.ui.position[y[t]][e](l,{targetWidth:p,targetHeight:f,elemWidth:r,elemHeight:h,collisionPosition:i,collisionWidth:n,collisionHeight:o,offset:[d[0]+c[0],d[1]+c[1]],my:u.my,at:u.at,within:v,elem:a})}),u.using&&(t=function(t){var e=g.left-l.left,i=e+p-r,s=g.top-l.top,n=s+f-h,o={target:{element:_,left:g.left,top:g.top,width:p,height:f},element:{element:a,left:l.left,top:l.top,width:r,height:h},horizontal:i<0?"left":0<e?"right":"center",vertical:n<0?"top":0<s?"bottom":"middle"};p<r&&C(e+i)<p&&(o.horizontal="center"),f<h&&C(s+n)<f&&(o.vertical="middle"),x(C(e),C(i))>x(C(s),C(n))?o.important="horizontal":o.important="vertical",u.using.call(this,t,o)}),a.offset(k.extend(l,{using:t}))})},k.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,s=s.width,o=t.left-e.collisionPosition.marginLeft,a=n-o,r=o+e.collisionWidth-s-n;s<e.collisionWidth?0<a&&r<=0?(i=t.left+a+e.collisionWidth-s-n,t.left+=a-i):t.left=!(0<r&&a<=0)&&r<a?n+s-e.collisionWidth:n:0<a?t.left+=a:0<r?t.left-=r:t.left=x(t.left-o,t.left)},top:function(t,e){var i,s=e.within,s=s.isWindow?s.scrollTop:s.offset.top,n=e.within.height,o=t.top-e.collisionPosition.marginTop,a=s-o,r=o+e.collisionHeight-n-s;n<e.collisionHeight?0<a&&r<=0?(i=t.top+a+e.collisionHeight-n-s,t.top+=a-i):t.top=!(0<r&&a<=0)&&r<a?s+n-e.collisionHeight:s:0<a?t.top+=a:0<r?t.top-=r:t.top=x(t.top-o,t.top)}},flip:{left:function(t,e){var i=e.within,s=i.offset.left+i.scrollLeft,n=i.width,i=i.isWindow?i.scrollLeft:i.offset.left,o=t.left-e.collisionPosition.marginLeft,a=o-i,o=o+e.collisionWidth-n-i,r="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,h="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,l=-2*e.offset[0];a<0?((n=t.left+r+h+l+e.collisionWidth-n-s)<0||n<C(a))&&(t.left+=r+h+l):0<o&&(0<(s=t.left-e.collisionPosition.marginLeft+r+h+l-i)||C(s)<o)&&(t.left+=r+h+l)},top:function(t,e){var i=e.within,s=i.offset.top+i.scrollTop,n=i.height,i=i.isWindow?i.scrollTop:i.offset.top,o=t.top-e.collisionPosition.marginTop,a=o-i,o=o+e.collisionHeight-n-i,r="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,h="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,l=-2*e.offset[1];a<0?((n=t.top+r+h+l+e.collisionHeight-n-s)<0||n<C(a))&&(t.top+=r+h+l):0<o&&(0<(s=t.top-e.collisionPosition.marginTop+r+h+l-i)||C(s)<o)&&(t.top+=r+h+l)}},flipfit:{left:function(){k.ui.position.flip.left.apply(this,arguments),k.ui.position.fit.left.apply(this,arguments)},top:function(){k.ui.position.flip.top.apply(this,arguments),k.ui.position.fit.top.apply(this,arguments)}}};var F;k.ui.position,k.extend(k.expr[":"],{data:k.expr.createPseudo?k.expr.createPseudo(function(e){return function(t){return!!k.data(t,e)}}):function(t,e,i){return!!k.data(t,i[3])}}),k.fn.extend({disableSelection:(F="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(F+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}});k.ui.focusable=function(t,e){var i,s,n,o=t.nodeName.toLowerCase();return"area"===o?(n=(i=t.parentNode).name,!(!t.href||!n||"map"!==i.nodeName.toLowerCase())&&0<(i=k("img[usemap='#"+n+"']")).length&&i.is(":visible")):(/^(input|select|textarea|button|object)$/.test(o)?(s=!t.disabled)&&(n=k(t).closest("fieldset")[0])&&(s=!n.disabled):s="a"===o&&t.href||e,s&&k(t).is(":visible")&&(t=>{for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e})(k(t)))},k.extend(k.expr[":"],{focusable:function(t){return k.ui.focusable(t,null!=k.attr(t,"tabindex"))}});k.ui.focusable,k.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):k(this[0].form)},k.ui.formResetMixin={_formResetHandler:function(){var e=k(this);setTimeout(function(){var t=e.data("ui-form-reset-instances");k.each(t,function(){this.refresh()})})},_bindFormResetHandler:function(){var t;this.form=this.element.form(),this.form.length&&((t=this.form.data("ui-form-reset-instances")||[]).length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t))},_unbindFormResetHandler:function(){var t;this.form.length&&((t=this.form.data("ui-form-reset-instances")).splice(k.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset"))}},"1.7"===k.fn.jquery.substring(0,3)&&(k.each(["Width","Height"],function(t,i){var n="Width"===i?["Left","Right"]:["Top","Bottom"],s=i.toLowerCase(),o={innerWidth:k.fn.innerWidth,innerHeight:k.fn.innerHeight,outerWidth:k.fn.outerWidth,outerHeight:k.fn.outerHeight};function a(t,e,i,s){return k.each(n,function(){e-=parseFloat(k.css(t,"padding"+this))||0,i&&(e-=parseFloat(k.css(t,"border"+this+"Width"))||0),s&&(e-=parseFloat(k.css(t,"margin"+this))||0)}),e}k.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){k(this).css(s,a(this,t)+"px")})},k.fn["outer"+i]=function(t,e){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){k(this).css(s,a(this,t,!0,e)+"px")})}}),k.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),k.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},k.ui.escapeSelector=(L=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g,function(t){return t.replace(L,"\\$1")}),k.fn.labels=function(){var t,e,i;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(e=this.eq(0).parents("label"),(t=this.attr("id"))&&(i=(i=this.eq(0).parents().last()).add((i.length?i:this).siblings()),t="label[for='"+k.ui.escapeSelector(t)+"']",e=e.add(i.find(t).addBack(t))),this.pushStack(e))},k.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,t=this.parents().filter(function(){var t=k(this);return(!i||"static"!==t.css("position"))&&s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&t.length?t:k(this[0].ownerDocument||document)},k.extend(k.expr[":"],{tabbable:function(t){var e=k.attr(t,"tabindex"),i=null!=e;return(!i||0<=e)&&k.ui.focusable(t,i)}}),k.fn.extend({uniqueId:(R=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++R)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&k(this).removeAttr("id")})}}),k.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var L,R,u=!1,d=(k(document).on("mouseup",function(){u=!1}),k.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(t){if(!0===k.data(t.target,e.widgetName+".preventClickEvent"))return k.removeData(t.target,e.widgetName+".preventClickEvent"),t.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){var e,i,s;if(!u)return this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),i=1===(this._mouseDownEvent=t).which,s=!("string"!=typeof(e=this).options.cancel||!t.target.nodeName)&&k(t.target).closest(this.options.cancel).length,i&&!s&&this._mouseCapture(t)&&(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?t.preventDefault():(!0===k.data(t.target,this.widgetName+".preventClickEvent")&&k.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return e._mouseMove(t)},this._mouseUpDelegate=function(t){return e._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),u=!0)),!0},_mouseMove:function(t){if(this._mouseMoved){if(k.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&k.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,u=!1,t.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),k.ui.plugin={add:function(t,e,i){var s,n=k.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n<o.length;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},k.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return i=(i=i||e.body).nodeName?i:e.body},k.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&k(t).trigger("blur")},k.widget("ui.draggable",k.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(t){var e=this.options;return!(this.helper||e.disabled||0<k(t.target).closest(".ui-resizable-handle").length||(this.handle=this._getHandle(t),!this.handle)||(this._blurActiveElement(t),this._blockFrames(!0===e.iframeFix?"iframe":e.iframeFix),0))},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=k(this);return k("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var e=k.ui.safeActiveElement(this.document[0]);k(t.target).closest(e).length||k.ui.safeBlur(e)},_mouseStart:function(t){var e=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),k.ui.ddmanager&&(k.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0<this.helper.parents().filter(function(){return"fixed"===k(this).css("position")}).length,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),k.ui.ddmanager&&!e.dropBehaviour&&k.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),k.ui.ddmanager&&k.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(t,e){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!e){e=this._uiHash();if(!1===this._trigger("drag",t,e))return this._mouseUp(new k.Event("mouseup",t)),!1;this.position=e.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",k.ui.ddmanager&&k.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var e=this,i=!1;return k.ui.ddmanager&&!this.options.dropBehaviour&&(i=k.ui.ddmanager.drop(this,t)),this.dropped&&(i=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!i||"valid"===this.options.revert&&i||!0===this.options.revert||k.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)?k(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==e._trigger("stop",t)&&e._clear()}):!1!==this._trigger("stop",t)&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),k.ui.ddmanager&&k.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.trigger("focus"),k.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new k.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(t){return!this.options.handle||!!k(t.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var e=this.options,i=k.isFunction(e.helper),t=i?k(e.helper.apply(this.element[0],[t])):"clone"===e.helper?this.element.clone().removeAttr("id"):this.element;return t.parents("body").length||t.appendTo("parent"===e.appendTo?this.element[0].parentNode:e.appendTo),i&&t[0]===this.element[0]&&this._setPositionRelative(),t[0]===this.element[0]||/(fixed|absolute)/.test(t.css("position"))||t.css("position","absolute"),t},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),"left"in(t=k.isArray(t)?{left:+t[0],top:+t[1]||0}:t)&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),e=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==e&&k.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this._isRootNode(this.offsetParent[0])?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){var t,e;return"relative"!==this.cssPosition?{top:0,left:0}:(t=this.element.position(),e=this._isRootNode(this.scrollParent[0]),{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())})},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e=this.options,i=this.document[0];this.relativeContainer=null,e.containment?"window"===e.containment?this.containment=[k(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,k(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,k(window).scrollLeft()+k(window).width()-this.helperProportions.width-this.margins.left,k(window).scrollTop()+(k(window).height()||i.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:"document"===e.containment?this.containment=[0,0,k(i).width()-this.helperProportions.width-this.margins.left,(k(i).height()||i.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:e.containment.constructor===Array?this.containment=e.containment:("parent"===e.containment&&(e.containment=this.helper[0].parentNode),(e=(i=k(e.containment))[0])&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i)):this.containment=null},_convertPositionTo:function(t,e){e=e||this.position;var t="absolute"===t?1:-1,i=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*t+this.offset.parent.top*t-("fixed"===this.cssPosition?-this.offset.scroll.top:i?0:this.offset.scroll.top)*t,left:e.left+this.offset.relative.left*t+this.offset.parent.left*t-("fixed"===this.cssPosition?-this.offset.scroll.left:i?0:this.offset.scroll.left)*t}},_generatePosition:function(t,e){var i,s=this.options,n=this._isRootNode(this.scrollParent[0]),o=t.pageX,a=t.pageY;return n&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),{top:(a=e&&(this.containment&&(i=this.relativeContainer?(e=this.relativeContainer.offset(),[this.containment[0]+e.left,this.containment[1]+e.top,this.containment[2]+e.left,this.containment[3]+e.top]):this.containment,t.pageX-this.offset.click.left<i[0]&&(o=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(a=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(o=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3])&&(a=i[3]+this.offset.click.top),s.grid&&(e=s.grid[1]?this.originalPageY+Math.round((a-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY,a=!i||e-this.offset.click.top>=i[1]||e-this.offset.click.top>i[3]?e:e-this.offset.click.top>=i[1]?e-s.grid[1]:e+s.grid[1],t=s.grid[0]?this.originalPageX+Math.round((o-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX,o=!i||t-this.offset.click.left>=i[0]||t-this.offset.click.left>i[2]?t:t-this.offset.click.left>=i[0]?t-s.grid[0]:t+s.grid[0]),"y"===s.axis&&(o=this.originalPageX),"x"===s.axis)?this.originalPageY:a)-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:n?0:this.offset.scroll.top),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:n?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,e,i){return i=i||this._uiHash(),k.ui.plugin.call(this,t,[e,i,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),k.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),k.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=k.extend({},t,{item:i.element});i.sortables=[],k(i.options.connectToSortable).each(function(){var t=k(this).sortable("instance");t&&!t.options.disabled&&(i.sortables.push(t),t.refreshPositions(),t._trigger("activate",e,s))})},stop:function(e,t,i){var s=k.extend({},t,{item:i.element});i.cancelHelperRemoval=!1,k.each(i.sortables,function(){var t=this;t.isOver?(t.isOver=0,i.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,s))})},drag:function(i,s,n){k.each(n.sortables,function(){var t=!1,e=this;e.positionAbs=n.positionAbs,e.helperProportions=n.helperProportions,e.offset.click=n.offset.click,e._intersectsWith(e.containerCache)&&(t=!0,k.each(n.sortables,function(){return this.positionAbs=n.positionAbs,this.helperProportions=n.helperProportions,this.offset.click=n.offset.click,t=this!==e&&this._intersectsWith(this.containerCache)&&k.contains(e.element[0],this.element[0])?!1:t})),t?(e.isOver||(e.isOver=1,n._parent=s.helper.parent(),e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",!0),e.options._helper=e.options.helper,e.options.helper=function(){return s.helper[0]},i.target=e.currentItem[0],e._mouseCapture(i,!0),e._mouseStart(i,!0,!0),e.offset.click.top=n.offset.click.top,e.offset.click.left=n.offset.click.left,e.offset.parent.left-=n.offset.parent.left-e.offset.parent.left,e.offset.parent.top-=n.offset.parent.top-e.offset.parent.top,n._trigger("toSortable",i),n.dropped=e.element,k.each(n.sortables,function(){this.refreshPositions()}),n.currentItem=n.element,e.fromOutside=n),e.currentItem&&(e._mouseDrag(i),s.position=e.position)):e.isOver&&(e.isOver=0,e.cancelHelperRemoval=!0,e.options._revert=e.options.revert,e.options.revert=!1,e._trigger("out",i,e._uiHash(e)),e._mouseStop(i,!0),e.options.revert=e.options._revert,e.options.helper=e.options._helper,e.placeholder&&e.placeholder.remove(),s.helper.appendTo(n._parent),n._refreshOffsets(i),s.position=n._generatePosition(i,!0),n._trigger("fromSortable",i),n.dropped=!1,k.each(n.sortables,function(){this.refreshPositions()}))})}}),k.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=k("body"),i=i.options;s.css("cursor")&&(i._cursor=s.css("cursor")),s.css("cursor",i.cursor)},stop:function(t,e,i){i=i.options;i._cursor&&k("body").css("cursor",i._cursor)}}),k.ui.plugin.add("draggable","opacity",{start:function(t,e,i){e=k(e.helper),i=i.options;e.css("opacity")&&(i._opacity=e.css("opacity")),e.css("opacity",i.opacity)},stop:function(t,e,i){i=i.options;i._opacity&&k(e.helper).css("opacity",i._opacity)}}),k.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,e,i){var s=i.options,n=!1,o=i.scrollParentNotHidden[0],a=i.document[0];o!==a&&"HTML"!==o.tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+o.offsetHeight-t.pageY<s.scrollSensitivity?o.scrollTop=n=o.scrollTop+s.scrollSpeed:t.pageY-i.overflowOffset.top<s.scrollSensitivity&&(o.scrollTop=n=o.scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+o.offsetWidth-t.pageX<s.scrollSensitivity?o.scrollLeft=n=o.scrollLeft+s.scrollSpeed:t.pageX-i.overflowOffset.left<s.scrollSensitivity&&(o.scrollLeft=n=o.scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(t.pageY-k(a).scrollTop()<s.scrollSensitivity?n=k(a).scrollTop(k(a).scrollTop()-s.scrollSpeed):k(window).height()-(t.pageY-k(a).scrollTop())<s.scrollSensitivity&&(n=k(a).scrollTop(k(a).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(t.pageX-k(a).scrollLeft()<s.scrollSensitivity?n=k(a).scrollLeft(k(a).scrollLeft()-s.scrollSpeed):k(window).width()-(t.pageX-k(a).scrollLeft())<s.scrollSensitivity&&(n=k(a).scrollLeft(k(a).scrollLeft()+s.scrollSpeed)))),!1!==n&&k.ui.ddmanager&&!s.dropBehaviour&&k.ui.ddmanager.prepareOffsets(i,t)}}),k.ui.plugin.add("draggable","snap",{start:function(t,e,i){var s=i.options;i.snapElements=[],k(s.snap.constructor!==String?s.snap.items||":data(ui-draggable)":s.snap).each(function(){var t=k(this),e=t.offset();this!==i.element[0]&&i.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:e.top,left:e.left})})},drag:function(t,e,i){for(var s,n,o,a,r,h,l,c,u,d=i.options,p=d.snapTolerance,f=e.offset.left,g=f+i.helperProportions.width,m=e.offset.top,_=m+i.helperProportions.height,v=i.snapElements.length-1;0<=v;v--)h=(r=i.snapElements[v].left-i.margins.left)+i.snapElements[v].width,c=(l=i.snapElements[v].top-i.margins.top)+i.snapElements[v].height,g<r-p||h+p<f||_<l-p||c+p<m||!k.contains(i.snapElements[v].item.ownerDocument,i.snapElements[v].item)?(i.snapElements[v].snapping&&i.options.snap.release&&i.options.snap.release.call(i.element,t,k.extend(i._uiHash(),{snapItem:i.snapElements[v].item})),i.snapElements[v].snapping=!1):("inner"!==d.snapMode&&(s=Math.abs(l-_)<=p,n=Math.abs(c-m)<=p,o=Math.abs(r-g)<=p,a=Math.abs(h-f)<=p,s&&(e.position.top=i._convertPositionTo("relative",{top:l-i.helperProportions.height,left:0}).top),n&&(e.position.top=i._convertPositionTo("relative",{top:c,left:0}).top),o&&(e.position.left=i._convertPositionTo("relative",{top:0,left:r-i.helperProportions.width}).left),a)&&(e.position.left=i._convertPositionTo("relative",{top:0,left:h}).left),u=s||n||o||a,"outer"!==d.snapMode&&(s=Math.abs(l-m)<=p,n=Math.abs(c-_)<=p,o=Math.abs(r-f)<=p,a=Math.abs(h-g)<=p,s&&(e.position.top=i._convertPositionTo("relative",{top:l,left:0}).top),n&&(e.position.top=i._convertPositionTo("relative",{top:c-i.helperProportions.height,left:0}).top),o&&(e.position.left=i._convertPositionTo("relative",{top:0,left:r}).left),a)&&(e.position.left=i._convertPositionTo("relative",{top:0,left:h-i.helperProportions.width}).left),!i.snapElements[v].snapping&&(s||n||o||a||u)&&i.options.snap.snap&&i.options.snap.snap.call(i.element,t,k.extend(i._uiHash(),{snapItem:i.snapElements[v].item})),i.snapElements[v].snapping=s||n||o||a||u)}}),k.ui.plugin.add("draggable","stack",{start:function(t,e,i){var s,i=i.options,i=k.makeArray(k(i.stack)).sort(function(t,e){return(parseInt(k(t).css("zIndex"),10)||0)-(parseInt(k(e).css("zIndex"),10)||0)});i.length&&(s=parseInt(k(i[0]).css("zIndex"),10)||0,k(i).each(function(t){k(this).css("zIndex",s+t)}),this.css("zIndex",s+i.length))}}),k.ui.plugin.add("draggable","zIndex",{start:function(t,e,i){e=k(e.helper),i=i.options;e.css("zIndex")&&(i._zIndex=e.css("zIndex")),e.css("zIndex",i.zIndex)},stop:function(t,e,i){i=i.options;i._zIndex&&k(e.helper).css("zIndex",i._zIndex)}}),k.ui.draggable,k.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,e=this.options,i=e.accept;this.isover=!1,this.isout=!0,this.accept=k.isFunction(i)?i:function(t){return t.is(i)},this.proportions=function(){if(!arguments.length)return t=t||{width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};t=arguments[0]},this._addToManager(e.scope),e.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){k.ui.ddmanager.droppables[t]=k.ui.ddmanager.droppables[t]||[],k.ui.ddmanager.droppables[t].push(this)},_splice:function(t){for(var e=0;e<t.length;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var t=k.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,e){var i;"accept"===t?this.accept=k.isFunction(e)?e:function(t){return t.is(e)}:"scope"===t&&(i=k.ui.ddmanager.droppables[this.options.scope],this._splice(i),this._addToManager(e)),this._super(t,e)},_activate:function(t){var e=k.ui.ddmanager.current;this._addActiveClass(),e&&this._trigger("activate",t,this.ui(e))},_deactivate:function(t){var e=k.ui.ddmanager.current;this._removeActiveClass(),e&&this._trigger("deactivate",t,this.ui(e))},_over:function(t){var e=k.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._addHoverClass(),this._trigger("over",t,this.ui(e)))},_out:function(t){var e=k.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._removeHoverClass(),this._trigger("out",t,this.ui(e)))},_drop:function(e,t){var i=t||k.ui.ddmanager.current,s=!1;return!(!i||(i.currentItem||i.element)[0]===this.element[0]||(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=k(this).droppable("instance");if(t.options.greedy&&!t.options.disabled&&t.options.scope===i.options.scope&&t.accept.call(t.element[0],i.currentItem||i.element)&&d(i,k.extend(t,{offset:t.element.offset()}),t.options.tolerance,e))return!(s=!0)}),s)||!this.accept.call(this.element[0],i.currentItem||i.element))&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(i)),this.element)},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}}),k.ui.intersect=function(t,e,i,s){if(!e.offset)return!1;var n=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,a=n+t.helperProportions.width,r=o+t.helperProportions.height,h=e.offset.left,l=e.offset.top,c=h+e.proportions().width,u=l+e.proportions().height;switch(i){case"fit":return h<=n&&a<=c&&l<=o&&r<=u;case"intersect":return h<n+t.helperProportions.width/2&&a-t.helperProportions.width/2<c&&l<o+t.helperProportions.height/2&&r-t.helperProportions.height/2<u;case"pointer":return B(s.pageY,l,e.proportions().height)&&B(s.pageX,h,e.proportions().width);case"touch":return(l<=o&&o<=u||l<=r&&r<=u||o<l&&u<r)&&(h<=n&&n<=c||h<=a&&a<=c||n<h&&c<a);default:return!1}});function B(t,e,i){return e<=t&&t<e+i}!(k.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,e){var i,s,n=k.ui.ddmanager.droppables[t.options.scope]||[],o=e?e.type:null,a=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();t:for(i=0;i<n.length;i++)if(!(n[i].options.disabled||t&&!n[i].accept.call(n[i].element[0],t.currentItem||t.element))){for(s=0;s<a.length;s++)if(a[s]===n[i].element[0]){n[i].proportions().height=0;continue t}n[i].visible="none"!==n[i].element.css("display"),n[i].visible&&("mousedown"===o&&n[i]._activate.call(n[i],e),n[i].offset=n[i].element.offset(),n[i].proportions({width:n[i].element[0].offsetWidth,height:n[i].element[0].offsetHeight}))}},drop:function(t,e){var i=!1;return k.each((k.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&d(t,this,this.options.tolerance,e)&&(i=this._drop.call(this,e)||i),!this.options.disabled)&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,e))}),i},dragStart:function(t,e){t.element.parentsUntil("body").on("scroll.droppable",function(){t.options.refreshPositions||k.ui.ddmanager.prepareOffsets(t,e)})},drag:function(n,o){n.options.refreshPositions&&k.ui.ddmanager.prepareOffsets(n,o),k.each(k.ui.ddmanager.droppables[n.options.scope]||[],function(){var t,e,i,s;this.options.disabled||this.greedyChild||!this.visible||(s=!(s=d(n,this,this.options.tolerance,o))&&this.isover?"isout":s&&!this.isover?"isover":null)&&(this.options.greedy&&(e=this.options.scope,(i=this.element.parents(":data(ui-droppable)").filter(function(){return k(this).droppable("instance").options.scope===e})).length)&&((t=k(i[0]).droppable("instance")).greedyChild="isover"===s),t&&"isover"===s&&(t.isover=!1,t.isout=!0,t._out.call(t,o)),this[s]=!0,this["isout"===s?"isover":"isout"]=!1,this["isover"===s?"_over":"_out"].call(this,o),t)&&"isout"===s&&(t.isout=!1,t.isover=!0,t._over.call(t,o))})},dragStop:function(t,e){t.element.parentsUntil("body").off("scroll.droppable"),t.options.refreshPositions||k.ui.ddmanager.prepareOffsets(t,e)}})!==k.uiBackCompat&&k.widget("ui.droppable",k.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}});k.ui.droppable,k.widget("ui.resizable",k.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(t,e){var i;return"hidden"!==k(t).css("overflow")&&(i=!1,0<t[e=e&&"left"===e?"scrollLeft":"scrollTop"]||(t[e]=1,i=0<t[e],t[e]=0,i))},_create:function(){var t,e=this.options,i=this;this._addClass("ui-resizable"),k.extend(this,{_aspectRatio:!!e.aspectRatio,aspectRatio:e.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:e.helper||e.ghost||e.animate?e.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(k("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&k(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();function t(t){k(t).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){this._super(t,e),"handles"===t&&(this._removeHandles(),this._setupHandles())},_setupHandles:function(){var t,e,i,s,n,o=this.options,a=this;if(this.handles=o.handles||(k(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=k(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e<i.length;e++)s="ui-resizable-"+(t=k.trim(i[e])),n=k("<div>"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.append(n);this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=k(this.handles[e]),this._on(this.handles[e],{mousedown:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=k(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?s.outerHeight():s.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){a.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=k(this.handles[e])[0])!==t.target&&!k.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=k(s.containment).scrollLeft()||0,i+=k(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=k(".ui-resizable-"+this.axis).css("cursor"),k("body").css("cursor","auto"===n?this.axis+"-resize":n),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(i=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),k.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(i=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,e=e?0:o.sizeDiff.width,e={width:o.helper.width()-e,height:o.helper.height()-i},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(k.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper)&&!n.animate&&this._proportionallyResize(),k("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n=this.options,n={minWidth:this._isNumber(n.minWidth)?n.minWidth:0,maxWidth:this._isNumber(n.maxWidth)?n.maxWidth:1/0,minHeight:this._isNumber(n.minHeight)?n.minHeight:0,maxHeight:this._isNumber(n.maxHeight)?n.maxHeight:1/0};(this._aspectRatio||t)&&(t=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,e=n.maxHeight*this.aspectRatio,s=n.maxWidth/this.aspectRatio,n.minWidth<t&&(n.minWidth=t),n.minHeight<i&&(n.minHeight=i),e<n.maxWidth&&(n.maxWidth=e),s<n.maxHeight)&&(n.maxHeight=s),this._vBoundaries=n},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,n=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=r-e.minWidth),s&&l&&(t.left=r-e.maxWidth),a&&i&&(t.top=h-e.minHeight),n&&i&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e<this._proportionallyResizeElements.length;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,e=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||k("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return k.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return k.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return k.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return k.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){k.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),k.ui.plugin.add("resizable","animate",{stop:function(e){var i=k(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,n=n?0:i.sizeDiff.width,n={width:i.size.width-n,height:i.size.height-o},o=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,a=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(k.extend(n,a&&o?{top:a,left:o}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&k(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),k.ui.plugin.add("resizable","containment",{start:function(){var i,s,t,e,n=k(this).resizable("instance"),o=n.options,a=n.element,o=o.containment,a=o instanceof k?o.get(0):/parent/.test(o)?a.parent().get(0):o;a&&(n.containerElement=k(a),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:k(document),left:0,top:0,width:k(document).width(),height:k(document).height()||document.body.parentNode.scrollHeight}):(i=k(a),s=[],k(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},o=n.containerOffset,e=n.containerSize.height,t=n.containerSize.width,t=n._hasScroll(a,"left")?a.scrollWidth:t,e=n._hasScroll(a)?a.scrollHeight:e,n.parentData={element:a,left:o.left,top:o.top,width:t,height:e}))},resize:function(t){var e=k(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,t=e._aspectRatio||t.shiftKey,o={top:0,left:0},a=e.containerElement,r=!0;a[0]!==document&&/static/.test(a.css("position"))&&(o=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-o.left),t&&(e.size.height=e.size.width/e.aspectRatio,r=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),t&&(e.size.width=e.size.height*e.aspectRatio,r=!1),e.position.top=e._helper?s.top:0),a=e.containerElement.get(0)===e.element.parent().get(0),i=/relative|absolute/.test(e.containerElement.css("position")),a&&i?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-o.left:e.offset.left-s.left)),a=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-o.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,t)&&(e.size.height=e.size.width/e.aspectRatio,r=!1),a+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-a,t)&&(e.size.width=e.size.height*e.aspectRatio,r=!1),r||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=k(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=k(t.helper),a=o.offset(),r=o.outerWidth()-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&k(this).css({left:a.left-s.left-i.left,width:r,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&k(this).css({left:a.left-s.left-i.left,width:r,height:o})}}),k.ui.plugin.add("resizable","alsoResize",{start:function(){var t=k(this).resizable("instance").options;k(t.alsoResize).each(function(){var t=k(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=k(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,a={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left:e.position.left-o.left||0};k(s.alsoResize).each(function(){var t=k(this),s=k(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];k.each(e,function(t,e){var i=(s[e]||0)+(a[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){k(this).removeData("ui-resizable-alsoresize")}}),k.ui.plugin.add("resizable","ghost",{start:function(){var t=k(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==k.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=k(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=k(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),k.ui.plugin.add("resizable","grid",{resize:function(){var t,e=k(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,a=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,c=Math.round((s.width-n.width)/h)*h,s=Math.round((s.height-n.height)/l)*l,u=n.width+c,d=n.height+s,p=i.maxWidth&&i.maxWidth<u,f=i.maxHeight&&i.maxHeight<d,g=i.minWidth&&i.minWidth>u,m=i.minHeight&&i.minHeight>d;i.grid=r,g&&(u+=h),m&&(d+=l),p&&(u-=h),f&&(d-=l),/^(se|s|e)$/.test(a)?(e.size.width=u,e.size.height=d):/^(ne)$/.test(a)?(e.size.width=u,e.size.height=d,e.position.top=o.top-s):/^(sw)$/.test(a)?(e.size.width=u,e.size.height=d,e.position.left=o.left-c):((d-l<=0||u-h<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0<d-l?(e.size.height=d,e.position.top=o.top-s):(d=l-t.height,e.size.height=d,e.position.top=o.top+n.height-d),0<u-h?(e.size.width=u,e.position.left=o.left-c):(u=h-t.width,e.size.width=u,e.position.left=o.left+n.width-u))}}),k.ui.resizable,k.widget("ui.selectable",k.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var i=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){i.elementPos=k(i.element[0]).offset(),i.selectees=k(i.options.filter,i.element[0]),i._addClass(i.selectees,"ui-selectee"),i.selectees.each(function(){var t=k(this),e=t.offset(),e={left:e.left-i.elementPos.left,top:e.top-i.elementPos.top};k.data(this,"selectable-item",{element:this,$element:t,left:e.left,top:e.top,right:e.left+t.outerWidth(),bottom:e.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=k("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(i){var s=this,t=this.options;this.opos=[i.pageX,i.pageY],this.elementPos=k(this.element[0]).offset(),this.options.disabled||(this.selectees=k(t.filter,this.element[0]),this._trigger("start",i),k(t.appendTo).append(this.helper),this.helper.css({left:i.pageX,top:i.pageY,width:0,height:0}),t.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var t=k.data(this,"selectable-item");t.startselected=!0,i.metaKey||i.ctrlKey||(s._removeClass(t.$element,"ui-selected"),t.selected=!1,s._addClass(t.$element,"ui-unselecting"),t.unselecting=!0,s._trigger("unselecting",i,{unselecting:t.element}))}),k(i.target).parents().addBack().each(function(){var t,e=k.data(this,"selectable-item");if(e)return t=!i.metaKey&&!i.ctrlKey||!e.$element.hasClass("ui-selected"),s._removeClass(e.$element,t?"ui-unselecting":"ui-selected")._addClass(e.$element,t?"ui-selecting":"ui-unselecting"),e.unselecting=!t,e.selecting=t,(e.selected=t)?s._trigger("selecting",i,{selecting:e.element}):s._trigger("unselecting",i,{unselecting:e.element}),!1}))},_mouseDrag:function(s){var t,n,o,a,r,h,l;if(this.dragged=!0,!this.options.disabled)return o=(n=this).options,a=this.opos[0],r=this.opos[1],(h=s.pageX)<a&&(t=h,h=a,a=t),(l=s.pageY)<r&&(t=l,l=r,r=t),this.helper.css({left:a,top:r,width:h-a,height:l-r}),this.selectees.each(function(){var t=k.data(this,"selectable-item"),e=!1,i={};t&&t.element!==n.element[0]&&(i.left=t.left+n.elementPos.left,i.right=t.right+n.elementPos.left,i.top=t.top+n.elementPos.top,i.bottom=t.bottom+n.elementPos.top,"touch"===o.tolerance?e=!(h<i.left||i.right<a||l<i.top||i.bottom<r):"fit"===o.tolerance&&(e=a<i.left&&i.right<h&&r<i.top&&i.bottom<l),e?(t.selected&&(n._removeClass(t.$element,"ui-selected"),t.selected=!1),t.unselecting&&(n._removeClass(t.$element,"ui-unselecting"),t.unselecting=!1),t.selecting||(n._addClass(t.$element,"ui-selecting"),t.selecting=!0,n._trigger("selecting",s,{selecting:t.element}))):(t.selecting&&((s.metaKey||s.ctrlKey)&&t.startselected?(n._removeClass(t.$element,"ui-selecting"),t.selecting=!1,n._addClass(t.$element,"ui-selected"),t.selected=!0):(n._removeClass(t.$element,"ui-selecting"),t.selecting=!1,t.startselected&&(n._addClass(t.$element,"ui-unselecting"),t.unselecting=!0),n._trigger("unselecting",s,{unselecting:t.element}))),!t.selected||s.metaKey||s.ctrlKey||t.startselected||(n._removeClass(t.$element,"ui-selected"),t.selected=!1,n._addClass(t.$element,"ui-unselecting"),t.unselecting=!0,n._trigger("unselecting",s,{unselecting:t.element}))))}),!1},_mouseStop:function(e){var i=this;return this.dragged=!1,k(".ui-unselecting",this.element[0]).each(function(){var t=k.data(this,"selectable-item");i._removeClass(t.$element,"ui-unselecting"),t.unselecting=!1,t.startselected=!1,i._trigger("unselected",e,{unselected:t.element})}),k(".ui-selecting",this.element[0]).each(function(){var t=k.data(this,"selectable-item");i._removeClass(t.$element,"ui-selecting")._addClass(t.$element,"ui-selected"),t.selecting=!1,t.selected=!0,t.startselected=!0,i._trigger("selected",e,{selected:t.element})}),this._trigger("stop",e),this.helper.remove(),!1}}),k.widget("ui.sortable",k.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return e<=t&&t<e+i},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var t=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),k.each(this.items,function(){t._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;0<=t;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,e){var i=null,s=!1,n=this;return!(this.reverting||this.options.disabled||"static"===this.options.type||(this._refreshItems(t),k(t.target).parents().each(function(){if(k.data(this,n.widgetName+"-item")===n)return i=k(this),!1}),!(i=k.data(t.target,n.widgetName+"-item")===n?k(t.target):i))||(this.options.handle&&!e&&(k(this.options.handle,i).find("*").addBack().each(function(){this===t.target&&(s=!0)}),!s)||(this.currentItem=i,this._removeCurrentsFromItems(),0)))},_mouseStart:function(t,e,i){var s,n,o=this.options;if((this.currentContainer=this).refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},k.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(n=this.document.find("body"),this.storedCursor=n.css("cursor"),n.css("cursor",o.cursor),this.storedStylesheet=k("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(n)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;0<=s;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return k.ui.ddmanager&&(k.ui.ddmanager.current=this),k.ui.ddmanager&&!o.dropBehaviour&&k.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var e,i,s,n,o=this.options,a=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-this.document.scrollTop()<o.scrollSensitivity?a=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<o.scrollSensitivity&&(a=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)),t.pageX-this.document.scrollLeft()<o.scrollSensitivity?a=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<o.scrollSensitivity&&(a=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed))),!1!==a)&&k.ui.ddmanager&&!o.dropBehaviour&&k.ui.ddmanager.prepareOffsets(this,t),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e=this.items.length-1;0<=e;e--)if(s=(i=this.items[e]).item[0],(n=this._intersectsWithPointer(i))&&i.instance===this.currentContainer&&!(s===this.currentItem[0]||this.placeholder[1===n?"next":"prev"]()[0]===s||k.contains(this.placeholder[0],s)||"semi-dynamic"===this.options.type&&k.contains(this.element[0],s))){if(this.direction=1===n?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;this._rearrange(t,i),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),k.ui.ddmanager&&k.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,e){var i,s,n,o;if(t)return k.ui.ddmanager&&!this.options.dropBehaviour&&k.ui.ddmanager.drop(this,t),this.options.revert?(s=(i=this).placeholder.offset(),o={},(n=this.options.axis)&&"x"!==n||(o.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),n&&"y"!==n||(o.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,k(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){i._clear(t)})):this._clear(t,e),!1},cancel:function(){if(this.dragging){this._mouseUp(new k.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;0<=t;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),k.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?k(this.domPosition.prev).after(this.currentItem):k(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var t=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},k(t).each(function(){var t=(k(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);t&&i.push((e.key||t[1]+"[]")+"="+(e.key&&e.expression?t[1]:t[2]))}),!i.length&&e.key&&i.push(e.key+"="),i.join("&")},toArray:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e.each(function(){i.push(k(t.item||this).attr(t.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,l="x"===this.options.axis||r<s+l&&s+l<h,c="y"===this.options.axis||o<e+c&&e+c<a;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?l&&c:o<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<a&&r<s+this.helperProportions.height/2&&n-this.helperProportions.height/2<h},_intersectsWithPointer:function(t){var e="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),t="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width);return!(!e||!t)&&(e=this._getDragVerticalDirection(),t=this._getDragHorizontalDirection(),this.floating?"right"===t||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),t=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),i=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return this.floating&&s?"right"===s&&t||"left"===s&&!t:i&&("down"===i&&e||"up"===i&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!=t&&(0<t?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(0<t?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(t){var e,i,s,n,o=[],a=[],r=this._connectWith();if(r&&t)for(e=r.length-1;0<=e;e--)for(i=(s=k(r[e],this.document[0])).length-1;0<=i;i--)(n=k.data(s[i],this.widgetFullName))&&n!==this&&!n.options.disabled&&a.push([k.isFunction(n.options.items)?n.options.items.call(n.element):k(n.options.items,n.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),n]);function h(){o.push(this)}for(a.push([k.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):k(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),e=a.length-1;0<=e;e--)a[e][0].each(h);return k(o)},_removeCurrentsFromItems:function(){var i=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=k.grep(this.items,function(t){for(var e=0;e<i.length;e++)if(i[e]===t.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var e,i,s,n,o,a,r,h,l=this.items,c=[[k.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):k(this.options.items,this.element),this]],u=this._connectWith();if(u&&this.ready)for(e=u.length-1;0<=e;e--)for(i=(s=k(u[e],this.document[0])).length-1;0<=i;i--)(n=k.data(s[i],this.widgetFullName))&&n!==this&&!n.options.disabled&&(c.push([k.isFunction(n.options.items)?n.options.items.call(n.element[0],t,{item:this.currentItem}):k(n.options.items,n.element),n]),this.containers.push(n));for(e=c.length-1;0<=e;e--)for(o=c[e][1],h=(a=c[e][i=0]).length;i<h;i++)(r=k(a[i])).data(this.widgetName+"-item",o),l.push({item:r,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){var e,i,s,n;for(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),e=this.items.length-1;0<=e;e--)(i=this.items[e]).instance!==this.currentContainer&&this.currentContainer&&i.item[0]!==this.currentItem[0]||(s=this.options.toleranceElement?k(this.options.toleranceElement,i.item):i.item,t||(i.width=s.outerWidth(),i.height=s.outerHeight()),n=s.offset(),i.left=n.left,i.top=n.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(e=this.containers.length-1;0<=e;e--)n=this.containers[e].element.offset(),this.containers[e].containerCache.left=n.left,this.containers[e].containerCache.top=n.top,this.containers[e].containerCache.width=this.containers[e].element.outerWidth(),this.containers[e].containerCache.height=this.containers[e].element.outerHeight();return this},_createPlaceholder:function(i){var s,n=(i=i||this).options;n.placeholder&&n.placeholder.constructor!==String||(s=n.placeholder,n.placeholder={element:function(){var t=i.currentItem[0].nodeName.toLowerCase(),e=k("<"+t+">",i.document[0]);return i._addClass(e,"ui-sortable-placeholder",s||i.currentItem[0].className)._removeClass(e,"ui-sortable-helper"),"tbody"===t?i._createTrPlaceholder(i.currentItem.find("tr").eq(0),k("<tr>",i.document[0]).appendTo(e)):"tr"===t?i._createTrPlaceholder(i.currentItem,e):"img"===t&&e.attr("src",i.currentItem.attr("src")),s||e.css("visibility","hidden"),e},update:function(t,e){s&&!n.forcePlaceholderSize||(e.height()||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width())||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10))}}),i.placeholder=k(n.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),n.placeholder.update(i,i.placeholder)},_createTrPlaceholder:function(t,e){var i=this;t.children().each(function(){k("<td>&#160;</td>",i.document[0]).attr("colspan",k(this).attr("colspan")||1).appendTo(e)})},_contactContainers:function(t){for(var e,i,s,n,o,a,r,h,l,c=null,u=null,d=this.containers.length-1;0<=d;d--)k.contains(this.currentItem[0],this.containers[d].element[0])||(this._intersectsWith(this.containers[d].containerCache)?c&&k.contains(this.containers[d].element[0],c.element[0])||(c=this.containers[d],u=d):this.containers[d].containerCache.over&&(this.containers[d]._trigger("out",t,this._uiHash(this)),this.containers[d].containerCache.over=0));if(c)if(1===this.containers.length)this.containers[u].containerCache.over||(this.containers[u]._trigger("over",t,this._uiHash(this)),this.containers[u].containerCache.over=1);else{for(i=1e4,s=null,n=(h=c.floating||this._isFloating(this.currentItem))?"left":"top",o=h?"width":"height",l=h?"pageX":"pageY",e=this.items.length-1;0<=e;e--)k.contains(this.containers[u].element[0],this.items[e].item[0])&&this.items[e].item[0]!==this.currentItem[0]&&(a=this.items[e].item.offset()[n],r=!1,t[l]-a>this.items[e][o]/2&&(r=!0),Math.abs(t[l]-a)<i)&&(i=Math.abs(t[l]-a),s=this.items[e],this.direction=r?"up":"down");(s||this.options.dropOnEmpty)&&(this.currentContainer===this.containers[u]?this.currentContainer.containerCache.over||(this.containers[u]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1):(s?this._rearrange(t,s,null,!0):this._rearrange(t,null,this.containers[u].element,!0),this._trigger("change",t,this._uiHash()),this.containers[u]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[u],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[u]._trigger("over",t,this._uiHash(this)),this.containers[u].containerCache.over=1))}},_createHelper:function(t){var e=this.options,t=k.isFunction(e.helper)?k(e.helper.apply(this.element[0],[t,this.currentItem])):"clone"===e.helper?this.currentItem.clone():this.currentItem;return t.parents("body").length||k("parent"!==e.appendTo?e.appendTo:this.currentItem[0].parentNode)[0].appendChild(t[0]),t[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),t[0].style.width&&!e.forceHelperSize||t.width(this.currentItem.width()),t[0].style.height&&!e.forceHelperSize||t.height(this.currentItem.height()),t},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),"left"in(t=k.isArray(t)?{left:+t[0],top:+t[1]||0}:t)&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&k.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&k.ui.ie?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){var t;return"relative"===this.cssPosition?{top:(t=this.currentItem.position()).top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}:{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),"document"!==i.containment&&"window"!==i.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===i.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===i.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(t=k(i.containment)[0],i=k(i.containment).offset(),e="hidden"!==k(t).css("overflow"),this.containment=[i.left+(parseInt(k(t).css("borderLeftWidth"),10)||0)+(parseInt(k(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(k(t).css("borderTopWidth"),10)||0)+(parseInt(k(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(e?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(k(t).css("borderLeftWidth"),10)||0)-(parseInt(k(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(e?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(k(t).css("borderTopWidth"),10)||0)-(parseInt(k(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,e){e=e||this.position;var t="absolute"===t?1:-1,i="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&k.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,s=/(html|body)/i.test(i[0].tagName);return{top:e.top+this.offset.relative.top*t+this.offset.parent.top*t-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():s?0:i.scrollTop())*t,left:e.left+this.offset.relative.left*t+this.offset.parent.left*t-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():s?0:i.scrollLeft())*t}},_generatePosition:function(t){var e=this.options,i=t.pageX,s=t.pageY,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&k.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(i=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(s=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(i=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3])&&(s=this.containment[3]+this.offset.click.top),e.grid)&&(t=this.originalPageY+Math.round((s-this.originalPageY)/e.grid[1])*e.grid[1],s=!this.containment||t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-e.grid[1]:t+e.grid[1],t=this.originalPageX+Math.round((i-this.originalPageX)/e.grid[0])*e.grid[0],i=!this.containment||t-this.offset.click.left>=this.containment[0]&&t-this.offset.click.left<=this.containment[2]?t:t-this.offset.click.left>=this.containment[0]?t-e.grid[0]:t+e.grid[0]),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop()),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function n(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this===this.currentContainer||e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer))),i=this.containers.length-1;0<=i;i--)e||s.push(n("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(n("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i<s.length;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===k.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(t){var e=t||this;return{helper:e.helper,placeholder:e.placeholder||k([]),position:e.position,originalPosition:e.originalPosition,offset:e.positionAbs,item:e.currentItem,sender:t?t.element:null}}}),k.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=k(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),t.collapsible||!1!==t.active&&null!=t.active||(t.active=0),this._processPanels(),t.active<0&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():k()}},_createIcons:function(){var t,e=this.options.icons;e&&(t=k("<span>"),this._addClass(t,"ui-accordion-header-icon","ui-icon "+e.header),t.prependTo(this.headers),t=this.active.children(".ui-accordion-header-icon"),this._removeClass(t,e.header)._addClass(t,null,e.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){"active"===t?this._activate(e):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||!1!==this.options.active||this._activate(0),"icons"===t&&(this._destroyIcons(),e)&&this._createIcons())},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var e=k.ui.keyCode,i=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case e.RIGHT:case e.DOWN:n=this.headers[(s+1)%i];break;case e.LEFT:case e.UP:n=this.headers[(s-1+i)%i];break;case e.SPACE:case e.ENTER:this._eventHandler(t);break;case e.HOME:n=this.headers[0];break;case e.END:n=this.headers[i-1]}n&&(k(t.target).attr("tabIndex",-1),k(n).attr("tabIndex",0),k(n).trigger("focus"),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===k.ui.keyCode.UP&&t.ctrlKey&&k(t.currentTarget).prev().trigger("focus")},refresh:function(){var t=this.options;this._processPanels(),!1===t.active&&!0===t.collapsible||!this.headers.length?(t.active=!1,this.active=k()):!1===t.active?this._activate(0):this.active.length&&!k.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=k()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var i,t=this.options,e=t.heightStyle,s=this.element.parent();this.active=this._findActive(t.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var t=k(this),e=t.uniqueId().attr("id"),i=t.next(),s=i.uniqueId().attr("id");t.attr("aria-controls",s),i.attr("aria-labelledby",e)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(t.event),"fill"===e?(i=s.height(),this.element.siblings(":visible").each(function(){var t=k(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=k(this).outerHeight(!0)}),this.headers.next().each(function(){k(this).height(Math.max(0,i-k(this).innerHeight()+k(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.headers.next().each(function(){var t=k(this).is(":visible");t||k(this).show(),i=Math.max(i,k(this).css("height","").height()),t||k(this).hide()}).height(i))},_activate:function(t){t=this._findActive(t)[0];t!==this.active[0]&&(t=t||this.active[0],this._eventHandler({target:t,currentTarget:t,preventDefault:k.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):k()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&k.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var e=this.options,i=this.active,s=k(t.currentTarget),n=s[0]===i[0],o=n&&e.collapsible,a=o?k():s.next(),r=i.next(),r={oldHeader:i,oldPanel:r,newHeader:o?k():s,newPanel:a};t.preventDefault(),n&&!e.collapsible||!1===this._trigger("beforeActivate",t,r)||(e.active=!o&&this.headers.index(s),this.active=n?k():s,this._toggle(r),this._removeClass(i,"ui-accordion-header-active","ui-state-active"),e.icons&&(a=i.children(".ui-accordion-header-icon"),this._removeClass(a,null,e.icons.activeHeader)._addClass(a,null,e.icons.header)),n)||(this._removeClass(s,"ui-accordion-header-collapsed")._addClass(s,"ui-accordion-header-active","ui-state-active"),e.icons&&(t=s.children(".ui-accordion-header-icon"),this._removeClass(t,null,e.icons.header)._addClass(t,null,e.icons.activeHeader)),this._addClass(s.next(),"ui-accordion-content-active"))},_toggle:function(t){var e=t.newPanel,i=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=e,this.prevHide=i,this.options.animate?this._animate(e,i,t):(i.hide(),e.show(),this._toggleComplete(t)),i.attr({"aria-hidden":"true"}),i.prev().attr({"aria-selected":"false","aria-expanded":"false"}),e.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):e.length&&this.headers.filter(function(){return 0===parseInt(k(this).attr("tabIndex"),10)}).attr("tabIndex",-1),e.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,i,e){function s(){o._toggleComplete(e)}var n,o=this,a=0,r=t.css("box-sizing"),h=t.length&&(!i.length||t.index()<i.index()),l=this.options.animate||{},h=h&&l.down||l,c=(c="string"==typeof h?h:c)||h.easing||l.easing,u=(u="number"==typeof h?h:u)||h.duration||l.duration;return i.length?t.length?(n=t.show().outerHeight(),i.animate(this.hideProps,{duration:u,easing:c,step:function(t,e){e.now=Math.round(t)}}),void t.hide().animate(this.showProps,{duration:u,easing:c,complete:s,step:function(t,e){e.now=Math.round(t),"height"!==e.prop?"content-box"===r&&(a+=e.now):"content"!==o.options.heightStyle&&(e.now=Math.round(n-i.outerHeight()-a),a=0)}})):i.animate(this.hideProps,u,c,s):t.animate(this.showProps,u,c,s)},_toggleComplete:function(t){var e=t.oldPanel,i=e.prev();this._removeClass(e,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),k.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(t){var e=k(t.target),i=k(k.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&e.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),e.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active)&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer))},"mouseenter .ui-menu-item":function(t){var e,i;this.previousFilter||(e=k(t.target).closest(".ui-menu-item"),i=k(t.currentTarget),e[0]===i[0]&&(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,i)))},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,i)},blur:function(t){this._delay(function(){k.contains(this.element[0],k.ui.safeActiveElement(this.document[0]))||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),t.children().each(function(){var t=k(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var e,i,s,n=!0;switch(t.keyCode){case k.ui.keyCode.PAGE_UP:this.previousPage(t);break;case k.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case k.ui.keyCode.HOME:this._move("first","first",t);break;case k.ui.keyCode.END:this._move("last","last",t);break;case k.ui.keyCode.UP:this.previous(t);break;case k.ui.keyCode.DOWN:this.next(t);break;case k.ui.keyCode.LEFT:this.collapse(t);break;case k.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case k.ui.keyCode.ENTER:case k.ui.keyCode.SPACE:this._activate(t);break;case k.ui.keyCode.ESCAPE:this.collapse(t);break;default:e=this.previousFilter||"",s=n=!1,i=96<=t.keyCode&&t.keyCode<=105?(t.keyCode-96).toString():String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),i===e?s=!0:i=e+i,e=this._filterMenuItems(i),(e=s&&-1!==e.index(this.active.next())?this.active.nextAll(".ui-menu-item"):e).length||(i=String.fromCharCode(t.keyCode),e=this._filterMenuItems(i)),e.length?(this.focus(t,e),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}n&&t.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var t,e,s=this,n=this.options.icons.submenu,i=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),t=i.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=k(this),e=t.prev(),i=k("<span>").data("ui-menu-submenu-caret",!0);s._addClass(i,"ui-menu-icon","ui-icon "+n),e.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",e.attr("id"))}),this._addClass(t,"ui-menu","ui-widget ui-widget-content ui-front"),(t=i.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var t=k(this);s._isDivider(t)&&s._addClass(t,"ui-menu-divider","ui-widget-content")}),e=(i=t.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(i,"ui-menu-item")._addClass(e,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!k.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){var i;"icons"===t&&(i=this.element.find(".ui-menu-icon"),this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(t){var e,i,s;this._hasScroll()&&(e=parseFloat(k.css(this.activeMenu[0],"borderTopWidth"))||0,i=parseFloat(k.css(this.activeMenu[0],"paddingTop"))||0,e=t.offset().top-this.activeMenu.offset().top-e-i,i=this.activeMenu.scrollTop(),s=this.activeMenu.height(),t=t.outerHeight(),e<0?this.activeMenu.scrollTop(i+e):s<e+t&&this.activeMenu.scrollTop(i+e-s+t))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(t){var e=k.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(e)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var t=i?this.element:k(e&&e.target).closest(this.element.find(".ui-menu"));t.length||(t=this.element),this._close(t),this.blur(e),this._removeClass(t.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=t},this.delay)},_close:function(t){(t=t||(this.active?this.active.parent():this.element)).find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(t){return!k(t.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;(s=this.active?"first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0):s)&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[e]()),this.focus(i,s)},nextPage:function(t){var e,i,s;this.active?this.isLastItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return(e=k(this)).offset().top-i-s<0}),this.focus(t,e)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())):this.next(t)},previousPage:function(t){var e,i,s;this.active?this.isFirstItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return 0<(e=k(this)).offset().top-i+s}),this.focus(t,e)):this.focus(t,this.activeMenu.find(this.options.items).first())):this.next(t)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||k(t.target).closest(".ui-menu-item");var e={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,e)},_filterMenuItems:function(t){var t=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),e=new RegExp("^"+t,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return e.test(k.trim(k(this).children(".ui-menu-item-wrapper").text()))})}}),k.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var i,s,n,t=this.element[0].nodeName.toLowerCase(),e="textarea"===t,t="input"===t;this.isMultiLine=e||!t&&this._isContentEditable(this.element),this.valueMethod=this.element[e||t?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(t){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var e=k.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:i=!0,this._move("previousPage",t);break;case e.PAGE_DOWN:i=!0,this._move("nextPage",t);break;case e.UP:i=!0,this._keyEvent("previous",t);break;case e.DOWN:i=!0,this._keyEvent("next",t);break;case e.ENTER:this.menu.active&&(i=!0,t.preventDefault(),this.menu.select(t));break;case e.TAB:this.menu.active&&this.menu.select(t);break;case e.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(t),t.preventDefault());break;default:s=!0,this._searchTimeout(t)}}},keypress:function(t){if(i)i=!1,this.isMultiLine&&!this.menu.element.is(":visible")||t.preventDefault();else if(!s){var e=k.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:this._move("previousPage",t);break;case e.PAGE_DOWN:this._move("nextPage",t);break;case e.UP:this._keyEvent("previous",t);break;case e.DOWN:this._keyEvent("next",t)}}},input:function(t){n?(n=!1,t.preventDefault()):this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(clearTimeout(this.searching),this.close(t),this._change(t))}}),this._initSource(),this.menu=k("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==k.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(t,e){var i;this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent)&&/^mouse/.test(t.originalEvent.type)?(this.menu.blur(),this.document.one("mousemove",function(){k(t.target).trigger(t.originalEvent)})):(i=e.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:i})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(i.value),(e=e.item.attr("aria-label")||i.value)&&k.trim(e).length&&(this.liveRegion.children().hide(),k("<div>").text(e).appendTo(this.liveRegion)))},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==k.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=k("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var e=this.menu.element[0];return t.target===this.element[0]||t.target===e||k.contains(e,t.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var t=this.options.appendTo;return t=(t=(t=t&&(t.jquery||t.nodeType?k(t):this.document.find(t).eq(0)))&&t[0]?t:this.element.closest(".ui-front, dialog")).length?t:this.document[0].body},_initSource:function(){var i,s,n=this;k.isArray(this.options.source)?(i=this.options.source,this.source=function(t,e){e(k.ui.autocomplete.filter(i,t.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(t,e){n.xhr&&n.xhr.abort(),n.xhr=k.ajax({url:s,data:t,dataType:"json",success:function(t){e(t)},error:function(){e([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),e=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;t&&(e||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):!1!==this._trigger("search",e)?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return k.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(t){t=t&&this._normalize(t),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:k.map(t,function(t){return"string"==typeof t?{label:t,value:t}:k.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var e=this.menu.element.empty();this._renderMenu(e,t),this.isNewMenu=!0,this.menu.refresh(),e.show(),this._resizeMenu(),e.position(k.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(i,t){var s=this;k.each(t,function(t,e){s._renderItemData(i,e)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(t,e){return k("<li>").append(k("<div>").text(e.label)).appendTo(t)},_move:function(t,e){this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),this.menu.blur()):this.menu[t](e):this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){var e;return!!t.length&&("inherit"===(e=t.prop("contentEditable"))?this._isContentEditable(t.parent()):"true"===e)}}),k.extend(k.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,e){var i=new RegExp(k.ui.autocomplete.escapeRegex(e),"i");return k.grep(t,function(t){return i.test(t.label||t.value||t)})}}),k.widget("ui.autocomplete",k.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(1<t?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),k("<div>").text(t).appendTo(this.liveRegion))}}),k.ui.autocomplete;var Y,p,j=/ui-corner-([a-z]){2,6}/g;k.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var o=this,a=[];k.each(this.options.items,function(s,t){var e,n={};t&&("controlgroupLabel"===s?((e=o.element.find(t)).each(function(){var t=k(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),o._addClass(e,null,"ui-widget ui-widget-content ui-state-default"),a=a.concat(e.get())):k.fn[s]&&(n=o["_"+s+"Options"]?o["_"+s+"Options"]("middle"):{classes:{}},o.element.find(t).each(function(){var t=k(this),e=t[s]("instance"),i=k.widget.extend({},n);"button"===s&&t.parent(".ui-spinner").length||((e=e||t[s]()[s]("instance"))&&(i.classes=o._resolveClassesValues(i.classes,e)),t[s](i),i=t[s]("widget"),k.data(i[0],"ui-controlgroup-data",e||t[s]("instance")),a.push(i[0]))})))}),this.childWidgets=k(k.unique(a)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var t=k(this).data("ui-controlgroup-data");t&&t[e]&&t[e]()})},_updateCornerClass:function(t,e){e=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,e)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){t=this._buildSimpleOptions(t,"ui-spinner");return t.classes["ui-spinner-up"]="",t.classes["ui-spinner-down"]="",t},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(i,s){var n={};return k.each(i,function(t){var e=s.options.classes[t]||"",e=k.trim(e.replace(j,""));n[t]=(e+" "+i[t]).replace(/\s+/g," ")}),n},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"===t?this._callChildMethod(e?"disable":"enable"):this.refresh()},refresh:function(){var n,o=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),n=this.childWidgets,(n=this.options.onlyVisible?n.filter(":visible"):n).length&&(k.each(["first","last"],function(t,e){var i,s=n[e]().data("ui-controlgroup-data");s&&o["_"+s.widgetName+"Options"]?((i=o["_"+s.widgetName+"Options"](1===n.length?"only":e)).classes=o._resolveClassesValues(i.classes,s),s.element[s.widgetName](i)):o._updateCornerClass(n[e](),e)}),this._callChildMethod("refresh"))}}),k.widget("ui.checkboxradio",[k.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,e=this,i=this._super()||{};return this._readType(),t=this.element.labels(),this.label=k(t[t.length-1]),this.label.length||k.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){e.originalLabel+=3===this.nodeType?k(this).text():this.outerHTML}),this.originalLabel&&(i.label=this.originalLabel),null!=(t=this.element[0].disabled)&&(i.disabled=t),i},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon)&&this._addClass(this.icon,null,"ui-state-hover"),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||k.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t=this.element[0].name,e="input[name='"+k.ui.escapeSelector(t)+"']";return t?(this.form.length?k(this.form[0].elements).filter(e):k(e).filter(function(){return 0===k(this).form().length})).not(this.element):k([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=k(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){"label"===t&&!e||(this._super(t,e),"disabled"===t?(this._toggleClass(this.label,null,"ui-state-disabled",e),this.element[0].disabled=e):this.refresh())},_updateIcon:function(t){var e="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=k("<span>"),this.iconSpace=k("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(e+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):e+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",e),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),(t=this.iconSpace?t.not(this.iconSpace[0]):t).remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),k.ui.checkboxradio,k.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),null!=(t=this.element[0].disabled)&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(t){t.keyCode===k.ui.keyCode.SPACE&&(t.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(t,e){var t="iconPosition"!==t,i=t?this.options.iconPosition:e,s="top"===i||"bottom"===i;this.icon?t&&this._removeClass(this.icon,null,this.options.icon):(this.icon=k("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),t&&this._addClass(this.icon,null,e),this._attachIcon(i),s?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=k("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(i))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=(void 0===t.showLabel?this.options:t).showLabel,i=(void 0===t.icon?this.options:t).icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace)&&this.iconSpace.remove()),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),this.element[0].disabled=e)&&this.element.blur()},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),!1!==k.uiBackCompat&&(k.widget("ui.button",k.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){"text"===t?this._super("showLabel",e):("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments))}}),k.fn.button=(Y=k.fn.button,function(){return!this.length||(this.length,"INPUT"!==this[0].tagName)||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?Y.apply(this,arguments):(k.ui.checkboxradio||k.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}),k.fn.buttonset=function(){return k.ui.controlgroup||k.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),k.ui.button;function q(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},k.extend(this._defaults,this.regional[""]),this.regional.en=k.extend(!0,{},this.regional[""]),this.regional["en-US"]=k.extend(!0,{},this.regional.en),this.dpDiv=K(k("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function K(t){var e="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.on("mouseout",e,function(){k(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&k(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&k(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",e,U)}function U(){k.datepicker._isDisabledDatepicker((p.inline?p.dpDiv.parent():p.input)[0])||(k(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),k(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&k(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&k(this).addClass("ui-datepicker-next-hover"))}function f(t,e){for(var i in k.extend(t,e),e)null==e[i]&&(t[i]=e[i])}k.extend(k.ui,{datepicker:{version:"1.12.1"}}),k.extend(q.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return f(this._defaults,t||{}),this},_attachDatepicker:function(t,e){var i,s=t.nodeName.toLowerCase(),n="div"===s||"span"===s;t.id||(this.uuid+=1,t.id="dp"+this.uuid),(i=this._newInst(k(t),n)).settings=k.extend({},e||{}),"input"===s?this._connectDatepicker(t,i):n&&this._inlineDatepicker(t,i)},_newInst:function(t,e){return{id:t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:e,dpDiv:e?K(k("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,e){var i=k(t);e.append=k([]),e.trigger=k([]),i.hasClass(this.markerClassName)||(this._attachments(i,e),i.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(e),k.data(t,"datepicker",e),e.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,e){var i,s=this._get(e,"appendText"),n=this._get(e,"isRTL");e.append&&e.append.remove(),s&&(e.append=k("<span class='"+this._appendClass+"'>"+s+"</span>"),t[n?"before":"after"](e.append)),t.off("focus",this._showDatepicker),e.trigger&&e.trigger.remove(),"focus"!==(s=this._get(e,"showOn"))&&"both"!==s||t.on("focus",this._showDatepicker),"button"!==s&&"both"!==s||(s=this._get(e,"buttonText"),i=this._get(e,"buttonImage"),e.trigger=k(this._get(e,"buttonImageOnly")?k("<img/>").addClass(this._triggerClass).attr({src:i,alt:s,title:s}):k("<button type='button'></button>").addClass(this._triggerClass).html(i?k("<img/>").attr({src:i,alt:s,title:s}):s)),t[n?"before":"after"](e.trigger),e.trigger.on("click",function(){return k.datepicker._datepickerShowing&&k.datepicker._lastInput===t[0]?k.datepicker._hideDatepicker():(k.datepicker._datepickerShowing&&k.datepicker._lastInput!==t[0]&&k.datepicker._hideDatepicker(),k.datepicker._showDatepicker(t[0])),!1}))},_autoSize:function(t){var e,i,s,n,o,a;this._get(t,"autoSize")&&!t.inline&&(o=new Date(2009,11,20),(a=this._get(t,"dateFormat")).match(/[DM]/)&&(o.setMonth((e=function(t){for(n=s=i=0;n<t.length;n++)t[n].length>i&&(i=t[n].length,s=n);return s})(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length))},_inlineDatepicker:function(t,e){var i=k(t);i.hasClass(this.markerClassName)||(i.addClass(this.markerClassName).append(e.dpDiv),k.data(t,"datepicker",e),this._setDate(e,this._getDefaultDate(e),!0),this._updateDatepicker(e),this._updateAlternate(e),e.settings.disabled&&this._disableDatepicker(t),e.dpDiv.css("display","block"))},_dialogDatepicker:function(t,e,i,s,n){var o,a=this._dialogInst;return a||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=k("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),k("body").append(this._dialogInput),(a=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},k.data(this._dialogInput[0],"datepicker",a)),f(a.settings,s||{}),e=e&&e.constructor===Date?this._formatDate(a,e):e,this._dialogInput.val(e),this._pos=n?n.length?n:[n.pageX,n.pageY]:null,this._pos||(o=document.documentElement.clientWidth,s=document.documentElement.clientHeight,e=document.documentElement.scrollLeft||document.body.scrollLeft,n=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[o/2-100+e,s/2-150+n]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),a.settings.onSelect=i,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),k.blockUI&&k.blockUI(this.dpDiv),k.data(this._dialogInput[0],"datepicker",a),this},_destroyDatepicker:function(t){var e,i=k(t),s=k.data(t,"datepicker");i.hasClass(this.markerClassName)&&(e=t.nodeName.toLowerCase(),k.removeData(t,"datepicker"),"input"===e?(s.append.remove(),s.trigger.remove(),i.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==e&&"span"!==e||i.removeClass(this.markerClassName).empty(),p===s)&&(p=null)},_enableDatepicker:function(e){var t,i=k(e),s=k.data(e,"datepicker");i.hasClass(this.markerClassName)&&("input"===(t=e.nodeName.toLowerCase())?(e.disabled=!1,s.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==t&&"span"!==t||((s=i.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=k.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var t,i=k(e),s=k.data(e,"datepicker");i.hasClass(this.markerClassName)&&("input"===(t=e.nodeName.toLowerCase())?(e.disabled=!0,s.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==t&&"span"!==t||((s=i.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=k.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(t)for(var e=0;e<this._disabledInputs.length;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(t){try{return k.data(t,"datepicker")}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,e,i){var s,n,o=this._getInst(t);if(2===arguments.length&&"string"==typeof e)return"defaults"===e?k.extend({},k.datepicker._defaults):o?"all"===e?k.extend({},o.settings):this._get(o,e):null;s=e||{},"string"==typeof e&&((s={})[e]=i),o&&(this._curInst===o&&this._hideDatepicker(),e=this._getDateDatepicker(t,!0),i=this._getMinMaxDate(o,"min"),n=this._getMinMaxDate(o,"max"),f(o.settings,s),null!==i&&void 0!==s.dateFormat&&void 0===s.minDate&&(o.settings.minDate=this._formatDate(o,i)),null!==n&&void 0!==s.dateFormat&&void 0===s.maxDate&&(o.settings.maxDate=this._formatDate(o,n)),"disabled"in s&&(s.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(k(t),o),this._autoSize(o),this._setDate(o,e),this._updateAlternate(o),this._updateDatepicker(o))},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){t=this._getInst(t);t&&this._updateDatepicker(t)},_setDateDatepicker:function(t,e){t=this._getInst(t);t&&(this._setDate(t,e),this._updateDatepicker(t),this._updateAlternate(t))},_getDateDatepicker:function(t,e){t=this._getInst(t);return t&&!t.inline&&this._setDateFromField(t,e),t?this._getDate(t):null},_doKeyDown:function(t){var e,i,s=k.datepicker._getInst(t.target),n=!0,o=s.dpDiv.is(".ui-datepicker-rtl");if(s._keyEvent=!0,k.datepicker._datepickerShowing)switch(t.keyCode){case 9:k.datepicker._hideDatepicker(),n=!1;break;case 13:return(i=k("td."+k.datepicker._dayOverClass+":not(."+k.datepicker._currentClass+")",s.dpDiv))[0]&&k.datepicker._selectDay(t.target,s.selectedMonth,s.selectedYear,i[0]),(i=k.datepicker._get(s,"onSelect"))?(e=k.datepicker._formatDate(s),i.apply(s.input?s.input[0]:null,[e,s])):k.datepicker._hideDatepicker(),!1;case 27:k.datepicker._hideDatepicker();break;case 33:k.datepicker._adjustDate(t.target,t.ctrlKey?-k.datepicker._get(s,"stepBigMonths"):-k.datepicker._get(s,"stepMonths"),"M");break;case 34:k.datepicker._adjustDate(t.target,t.ctrlKey?+k.datepicker._get(s,"stepBigMonths"):+k.datepicker._get(s,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&k.datepicker._clearDate(t.target),n=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&k.datepicker._gotoToday(t.target),n=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&k.datepicker._adjustDate(t.target,o?1:-1,"D"),n=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&k.datepicker._adjustDate(t.target,t.ctrlKey?-k.datepicker._get(s,"stepBigMonths"):-k.datepicker._get(s,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&k.datepicker._adjustDate(t.target,-7,"D"),n=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&k.datepicker._adjustDate(t.target,o?-1:1,"D"),n=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&k.datepicker._adjustDate(t.target,t.ctrlKey?+k.datepicker._get(s,"stepBigMonths"):+k.datepicker._get(s,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&k.datepicker._adjustDate(t.target,7,"D"),n=t.ctrlKey||t.metaKey;break;default:n=!1}else 36===t.keyCode&&t.ctrlKey?k.datepicker._showDatepicker(this):n=!1;n&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var e,i=k.datepicker._getInst(t.target);if(k.datepicker._get(i,"constrainInput"))return i=k.datepicker._possibleChars(k.datepicker._get(i,"dateFormat")),e=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||e<" "||!i||-1<i.indexOf(e)},_doKeyUp:function(t){t=k.datepicker._getInst(t.target);if(t.input.val()!==t.lastVal)try{k.datepicker.parseDate(k.datepicker._get(t,"dateFormat"),t.input?t.input.val():null,k.datepicker._getFormatConfig(t))&&(k.datepicker._setDateFromField(t),k.datepicker._updateAlternate(t),k.datepicker._updateDatepicker(t))}catch(t){}return!0},_showDatepicker:function(t){var e,i,s,n;"input"!==(t=t.target||t).nodeName.toLowerCase()&&(t=k("input",t.parentNode)[0]),k.datepicker._isDisabledDatepicker(t)||k.datepicker._lastInput===t||(n=k.datepicker._getInst(t),k.datepicker._curInst&&k.datepicker._curInst!==n&&(k.datepicker._curInst.dpDiv.stop(!0,!0),n)&&k.datepicker._datepickerShowing&&k.datepicker._hideDatepicker(k.datepicker._curInst.input[0]),!1===(i=(i=k.datepicker._get(n,"beforeShow"))?i.apply(t,[t,n]):{}))||(f(n.settings,i),n.lastVal=null,k.datepicker._lastInput=t,k.datepicker._setDateFromField(n),k.datepicker._inDialog&&(t.value=""),k.datepicker._pos||(k.datepicker._pos=k.datepicker._findPos(t),k.datepicker._pos[1]+=t.offsetHeight),e=!1,k(t).parents().each(function(){return!(e|="fixed"===k(this).css("position"))}),i={left:k.datepicker._pos[0],top:k.datepicker._pos[1]},k.datepicker._pos=null,n.dpDiv.empty(),n.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),k.datepicker._updateDatepicker(n),i=k.datepicker._checkOffset(n,i,e),n.dpDiv.css({position:k.datepicker._inDialog&&k.blockUI?"static":e?"fixed":"absolute",display:"none",left:i.left+"px",top:i.top+"px"}),n.inline)||(i=k.datepicker._get(n,"showAnim"),s=k.datepicker._get(n,"duration"),n.dpDiv.css("z-index",(t=>{for(var e;t.length&&t[0]!==document;){if(("absolute"===(e=t.css("position"))||"relative"===e||"fixed"===e)&&(e=parseInt(t.css("zIndex"),10),!isNaN(e))&&0!==e)return e;t=t.parent()}return 0})(k(t))+1),k.datepicker._datepickerShowing=!0,k.effects&&k.effects.effect[i]?n.dpDiv.show(i,k.datepicker._get(n,"showOptions"),s):n.dpDiv[i||"show"](i?s:null),k.datepicker._shouldFocusInput(n)&&n.input.trigger("focus"),k.datepicker._curInst=n)},_updateDatepicker:function(t){this.maxRows=4,(p=t).dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var e,i=this._getNumberOfMonths(t),s=i[1],n=t.dpDiv.find("."+this._dayOverClass+" a");0<n.length&&U.apply(n.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),1<s&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",17*s+"em"),t.dpDiv[(1!==i[0]||1!==i[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===k.datepicker._curInst&&k.datepicker._datepickerShowing&&k.datepicker._shouldFocusInput(t)&&t.input.trigger("focus"),t.yearshtml&&(e=t.yearshtml,setTimeout(function(){e===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),e=t.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(t,e,i){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,a=t.input?t.input.outerHeight():0,r=document.documentElement.clientWidth+(i?0:k(document).scrollLeft()),h=document.documentElement.clientHeight+(i?0:k(document).scrollTop());return e.left-=this._get(t,"isRTL")?s-o:0,e.left-=i&&e.left===t.input.offset().left?k(document).scrollLeft():0,e.top-=i&&e.top===t.input.offset().top+a?k(document).scrollTop():0,e.left-=Math.min(e.left,r<e.left+s&&s<r?Math.abs(e.left+s-r):0),e.top-=Math.min(e.top,h<e.top+n&&n<h?Math.abs(n+a):0),e},_findPos:function(t){for(var e=this._getInst(t),i=this._get(e,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||k.expr.filters.hidden(t));)t=t[i?"previousSibling":"nextSibling"];return[(e=k(t).offset()).left,e.top]},_hideDatepicker:function(t){var e,i,s=this._curInst;!s||t&&s!==k.data(t,"datepicker")||this._datepickerShowing&&(t=this._get(s,"showAnim"),i=this._get(s,"duration"),e=function(){k.datepicker._tidyDialog(s)},k.effects&&(k.effects.effect[t]||k.effects[t])?s.dpDiv.hide(t,k.datepicker._get(s,"showOptions"),i,e):s.dpDiv["slideDown"===t?"slideUp":"fadeIn"===t?"fadeOut":"hide"](t?i:null,e),t||e(),this._datepickerShowing=!1,(i=this._get(s,"onClose"))&&i.apply(s.input?s.input[0]:null,[s.input?s.input.val():"",s]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),k.blockUI)&&(k.unblockUI(),k("body").append(this.dpDiv)),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(t){var e;k.datepicker._curInst&&(t=k(t.target),e=k.datepicker._getInst(t[0]),!(t[0].id===k.datepicker._mainDivId||0!==t.parents("#"+k.datepicker._mainDivId).length||t.hasClass(k.datepicker.markerClassName)||t.closest("."+k.datepicker._triggerClass).length||!k.datepicker._datepickerShowing||k.datepicker._inDialog&&k.blockUI)||t.hasClass(k.datepicker.markerClassName)&&k.datepicker._curInst!==e)&&k.datepicker._hideDatepicker()},_adjustDate:function(t,e,i){var t=k(t),s=this._getInst(t[0]);this._isDisabledDatepicker(t[0])||(this._adjustInstDate(s,e+("M"===i?this._get(s,"showCurrentAtPos"):0),i),this._updateDatepicker(s))},_gotoToday:function(t){var e,t=k(t),i=this._getInst(t[0]);this._get(i,"gotoCurrent")&&i.currentDay?(i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear):(e=new Date,i.selectedDay=e.getDate(),i.drawMonth=i.selectedMonth=e.getMonth(),i.drawYear=i.selectedYear=e.getFullYear()),this._notifyChange(i),this._adjustDate(t)},_selectMonthYear:function(t,e,i){var t=k(t),s=this._getInst(t[0]);s["selected"+("M"===i?"Month":"Year")]=s["draw"+("M"===i?"Month":"Year")]=parseInt(e.options[e.selectedIndex].value,10),this._notifyChange(s),this._adjustDate(t)},_selectDay:function(t,e,i,s){var n=k(t);k(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(n[0])||((n=this._getInst(n[0])).selectedDay=n.currentDay=k("a",s).html(),n.selectedMonth=n.currentMonth=e,n.selectedYear=n.currentYear=i,this._selectDate(t,this._formatDate(n,n.currentDay,n.currentMonth,n.currentYear)))},_clearDate:function(t){t=k(t);this._selectDate(t,"")},_selectDate:function(t,e){var i,t=k(t),t=this._getInst(t[0]);e=null!=e?e:this._formatDate(t),t.input&&t.input.val(e),this._updateAlternate(t),(i=this._get(t,"onSelect"))?i.apply(t.input?t.input[0]:null,[e,t]):t.input&&t.input.trigger("change"),t.inline?this._updateDatepicker(t):(this._hideDatepicker(),this._lastInput=t.input[0],"object"!=typeof t.input[0]&&t.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(t){var e,i,s=this._get(t,"altField");s&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),e=this._getDate(t),i=this.formatDate(i,e,this._getFormatConfig(t)),k(s).val(i))},noWeekends:function(t){t=t.getDay();return[0<t&&t<6,""]},iso8601Week:function(t){var e,t=new Date(t.getTime());return t.setDate(t.getDate()+4-(t.getDay()||7)),e=t.getTime(),t.setMonth(0),t.setDate(1),Math.floor(Math.round((e-t)/864e5)/7)+1},parseDate:function(e,n,t){if(null==e||null==n)throw"Invalid arguments";if(""===(n="object"==typeof n?n.toString():n+""))return null;for(var i,s,o=0,a=(t?t.shortYearCutoff:null)||this._defaults.shortYearCutoff,a="string"!=typeof a?a:(new Date).getFullYear()%100+parseInt(a,10),r=(t?t.dayNamesShort:null)||this._defaults.dayNamesShort,h=(t?t.dayNames:null)||this._defaults.dayNames,l=(t?t.monthNamesShort:null)||this._defaults.monthNamesShort,c=(t?t.monthNames:null)||this._defaults.monthNames,u=-1,d=-1,p=-1,f=-1,g=!1,m=function(t){t=y+1<e.length&&e.charAt(y+1)===t;return t&&y++,t},_=function(t){var e=m(t),e="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,t=new RegExp("^\\d{"+("y"===t?e:1)+","+e+"}"),e=n.substring(o).match(t);if(e)return o+=e[0].length,parseInt(e[0],10);throw"Missing number at position "+o},v=function(t,e,i){var s=-1,t=k.map(m(t)?i:e,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(k.each(t,function(t,e){var i=e[1];if(n.substr(o,i.length).toLowerCase()===i.toLowerCase())return s=e[0],o+=i.length,!1}),-1!==s)return s+1;throw"Unknown name at position "+o},b=function(){if(n.charAt(o)!==e.charAt(y))throw"Unexpected literal at position "+o;o++},y=0;y<e.length;y++)if(g)"'"!==e.charAt(y)||m("'")?b():g=!1;else switch(e.charAt(y)){case"d":p=_("d");break;case"D":v("D",r,h);break;case"o":f=_("o");break;case"m":d=_("m");break;case"M":d=v("M",l,c);break;case"y":u=_("y");break;case"@":u=(s=new Date(_("@"))).getFullYear(),d=s.getMonth()+1,p=s.getDate();break;case"!":u=(s=new Date((_("!")-this._ticksTo1970)/1e4)).getFullYear(),d=s.getMonth()+1,p=s.getDate();break;case"'":m("'")?b():g=!0;break;default:b()}if(o<n.length&&(t=n.substr(o),!/^\s+/.test(t)))throw"Extra/unparsed characters found in date: "+t;if(-1===u?u=(new Date).getFullYear():u<100&&(u+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u<=a?0:-100)),-1<f)for(d=1,p=f;;){if(p<=(i=this._getDaysInMonth(u,d-1)))break;d++,p-=i}if((s=this._daylightSavingAdjust(new Date(u,d-1,p))).getFullYear()!==u||s.getMonth()+1!==d||s.getDate()!==p)throw"Invalid date";return s},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(e,t,i){if(!t)return"";function s(t,e,i){var s=""+e;if(c(t))for(;s.length<i;)s="0"+s;return s}function n(t,e,i,s){return(c(t)?s:i)[e]}var o,a=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,r=(i?i.dayNames:null)||this._defaults.dayNames,h=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,l=(i?i.monthNames:null)||this._defaults.monthNames,c=function(t){t=o+1<e.length&&e.charAt(o+1)===t;return t&&o++,t},u="",d=!1;if(t)for(o=0;o<e.length;o++)if(d)"'"!==e.charAt(o)||c("'")?u+=e.charAt(o):d=!1;else switch(e.charAt(o)){case"d":u+=s("d",t.getDate(),2);break;case"D":u+=n("D",t.getDay(),a,r);break;case"o":u+=s("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=s("m",t.getMonth()+1,2);break;case"M":u+=n("M",t.getMonth(),h,l);break;case"y":u+=c("y")?t.getFullYear():(t.getFullYear()%100<10?"0":"")+t.getFullYear()%100;break;case"@":u+=t.getTime();break;case"!":u+=1e4*t.getTime()+this._ticksTo1970;break;case"'":c("'")?u+="'":d=!0;break;default:u+=e.charAt(o)}return u},_possibleChars:function(e){for(var t="",i=!1,s=function(t){t=n+1<e.length&&e.charAt(n+1)===t;return t&&n++,t},n=0;n<e.length;n++)if(i)"'"!==e.charAt(n)||s("'")?t+=e.charAt(n):i=!1;else switch(e.charAt(n)){case"d":case"m":case"y":case"@":t+="0123456789";break;case"D":case"M":return null;case"'":s("'")?t+="'":i=!0;break;default:t+=e.charAt(n)}return t},_get:function(t,e){return(void 0!==t.settings[e]?t.settings:this._defaults)[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(t){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(r,t,e){var i,s=null==t||""===t?e:"string"==typeof t?(t=>{try{return k.datepicker.parseDate(k.datepicker._get(r,"dateFormat"),t,k.datepicker._getFormatConfig(r))}catch(t){}for(var e=(t.toLowerCase().match(/^c/)?k.datepicker._getDate(r):null)||new Date,i=e.getFullYear(),s=e.getMonth(),n=e.getDate(),o=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,a=o.exec(t);a;){switch(a[2]||"d"){case"d":case"D":n+=parseInt(a[1],10);break;case"w":case"W":n+=7*parseInt(a[1],10);break;case"m":case"M":s+=parseInt(a[1],10),n=Math.min(n,k.datepicker._getDaysInMonth(i,s));break;case"y":case"Y":i+=parseInt(a[1],10),n=Math.min(n,k.datepicker._getDaysInMonth(i,s))}a=o.exec(t)}return new Date(i,s,n)})(t):"number"==typeof t?isNaN(t)?e:(s=t,(i=new Date).setDate(i.getDate()+s),i):new Date(t.getTime());return(s=s&&"Invalid Date"===s.toString()?e:s)&&(s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0)),this._daylightSavingAdjust(s)},_daylightSavingAdjust:function(t){return t?(t.setHours(12<t.getHours()?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,e=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=e.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=e.getMonth(),t.drawYear=t.selectedYear=t.currentYear=e.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){return!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay))},_attachHandlers:function(t){var e=this._get(t,"stepMonths"),i="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){k.datepicker._adjustDate(i,-e,"M")},next:function(){k.datepicker._adjustDate(i,+e,"M")},hide:function(){k.datepicker._hideDatepicker()},today:function(){k.datepicker._gotoToday(i)},selectDay:function(){return k.datepicker._selectDay(i,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return k.datepicker._selectMonthYear(i,this,"M"),!1},selectYear:function(){return k.datepicker._selectMonthYear(i,this,"Y"),!1}};k(this).on(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,W,E,F,L,a,r,R,h,l,c,u,d,p,f,g,m,_,B,v,b,y,w,Y,j,k,x,C,D=new Date,q=this._daylightSavingAdjust(new Date(D.getFullYear(),D.getMonth(),D.getDate())),I=this._get(t,"isRTL"),D=this._get(t,"showButtonPanel"),P=this._get(t,"hideIfNoPrevNext"),T=this._get(t,"navigationAsDateFormat"),M=this._getNumberOfMonths(t),S=this._get(t,"showCurrentAtPos"),H=this._get(t,"stepMonths"),K=1!==M[0]||1!==M[1],U=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),z=this._getMinMaxDate(t,"min"),O=this._getMinMaxDate(t,"max"),A=t.drawMonth-S,N=t.drawYear;if(A<0&&(A+=12,N--),O)for(e=this._daylightSavingAdjust(new Date(O.getFullYear(),O.getMonth()-M[0]*M[1]+1,O.getDate())),e=z&&e<z?z:e;this._daylightSavingAdjust(new Date(N,A,1))>e;)--A<0&&(A=11,N--);for(t.drawMonth=A,t.drawYear=N,S=this._get(t,"prevText"),S=T?this.formatDate(S,this._daylightSavingAdjust(new Date(N,A-H,1)),this._getFormatConfig(t)):S,i=this._canAdjustMonth(t,-1,N,A)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+S+"'><span class='ui-icon ui-icon-circle-triangle-"+(I?"e":"w")+"'>"+S+"</span></a>":P?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+S+"'><span class='ui-icon ui-icon-circle-triangle-"+(I?"e":"w")+"'>"+S+"</span></a>",S=this._get(t,"nextText"),S=T?this.formatDate(S,this._daylightSavingAdjust(new Date(N,A+H,1)),this._getFormatConfig(t)):S,s=this._canAdjustMonth(t,1,N,A)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+S+"'><span class='ui-icon ui-icon-circle-triangle-"+(I?"w":"e")+"'>"+S+"</span></a>":P?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+S+"'><span class='ui-icon ui-icon-circle-triangle-"+(I?"w":"e")+"'>"+S+"</span></a>",H=this._get(t,"currentText"),P=this._get(t,"gotoCurrent")&&t.currentDay?U:q,H=T?this.formatDate(H,P,this._getFormatConfig(t)):H,S=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",T=D?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(I?S:"")+(this._isInRange(t,P)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+H+"</button>":"")+(I?"":S)+"</div>":"",n=parseInt(this._get(t,"firstDay"),10),n=isNaN(n)?0:n,o=this._get(t,"showWeek"),W=this._get(t,"dayNames"),E=this._get(t,"dayNamesMin"),F=this._get(t,"monthNames"),L=this._get(t,"monthNamesShort"),a=this._get(t,"beforeShowDay"),r=this._get(t,"showOtherMonths"),R=this._get(t,"selectOtherMonths"),h=this._getDefaultDate(t),l="",u=0;u<M[0];u++){for(d="",this.maxRows=4,p=0;p<M[1];p++){if(f=this._daylightSavingAdjust(new Date(N,A,t.selectedDay)),g=" ui-corner-all",m="",K){if(m+="<div class='ui-datepicker-group",1<M[1])switch(p){case 0:m+=" ui-datepicker-group-first",g=" ui-corner-"+(I?"right":"left");break;case M[1]-1:m+=" ui-datepicker-group-last",g=" ui-corner-"+(I?"left":"right");break;default:m+=" ui-datepicker-group-middle",g=""}m+="'>"}for(m+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+g+"'>"+(/all|left/.test(g)&&0===u?I?s:i:"")+(/all|right/.test(g)&&0===u?I?i:s:"")+this._generateMonthYearHeader(t,A,N,z,O,0<u||0<p,F,L)+"</div><table class='ui-datepicker-calendar'><thead><tr>",_=o?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",c=0;c<7;c++)_+="<th scope='col'"+(5<=(c+n+6)%7?" class='ui-datepicker-week-end'":"")+"><span title='"+W[B=(c+n)%7]+"'>"+E[B]+"</span></th>";for(m+=_+"</tr></thead><tbody>",b=this._getDaysInMonth(N,A),N===t.selectedYear&&A===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,b)),v=(this._getFirstDayOfMonth(N,A)-n+7)%7,b=Math.ceil((v+b)/7),y=K&&this.maxRows>b?this.maxRows:b,this.maxRows=y,w=this._daylightSavingAdjust(new Date(N,A,1-v)),Y=0;Y<y;Y++){for(m+="<tr>",j=o?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(w)+"</td>":"",c=0;c<7;c++)k=a?a.apply(t.input?t.input[0]:null,[w]):[!0,""],C=(x=w.getMonth()!==A)&&!R||!k[0]||z&&w<z||O&&O<w,j+="<td class='"+(5<=(c+n+6)%7?" ui-datepicker-week-end":"")+(x?" ui-datepicker-other-month":"")+(w.getTime()===f.getTime()&&A===t.selectedMonth&&t._keyEvent||h.getTime()===w.getTime()&&h.getTime()===f.getTime()?" "+this._dayOverClass:"")+(C?" "+this._unselectableClass+" ui-state-disabled":"")+(x&&!r?"":" "+k[1]+(w.getTime()===U.getTime()?" "+this._currentClass:"")+(w.getTime()===q.getTime()?" ui-datepicker-today":""))+"'"+(x&&!r||!k[2]?"":" title='"+k[2].replace(/'/g,"&#39;")+"'")+(C?"":" data-handler='selectDay' data-event='click' data-month='"+w.getMonth()+"' data-year='"+w.getFullYear()+"'")+">"+(x&&!r?"&#xa0;":C?"<span class='ui-state-default'>"+w.getDate()+"</span>":"<a class='ui-state-default"+(w.getTime()===q.getTime()?" ui-state-highlight":"")+(w.getTime()===U.getTime()?" ui-state-active":"")+(x?" ui-priority-secondary":"")+"' href='#'>"+w.getDate()+"</a>")+"</td>",w.setDate(w.getDate()+1),w=this._daylightSavingAdjust(w);m+=j+"</tr>"}11<++A&&(A=0,N++),d+=m+="</tbody></table>"+(K?"</div>"+(0<M[0]&&p===M[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}l+=d}return l+=T,t._keyEvent=!1,l},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var h,l,c,u,d,p,f,g=this._get(t,"changeMonth"),m=this._get(t,"changeYear"),_=this._get(t,"showMonthAfterYear"),v="<div class='ui-datepicker-title'>",b="";if(o||!g)b+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,b+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;c<12;c++)(!h||c>=s.getMonth())&&(!l||c<=n.getMonth())&&(b+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");b+="</select>"}if(_||(v+=b+(!o&&g&&m?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",o||!m)v+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(a=this._get(t,"yearRange").split(":"),u=(new Date).getFullYear(),p=(d=function(t){t=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?u+parseInt(t,10):parseInt(t,10);return isNaN(t)?u:t})(a[0]),f=Math.max(p,d(a[1]||"")),p=s?Math.max(p,s.getFullYear()):p,f=n?Math.min(f,n.getFullYear()):f,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";p<=f;p++)t.yearshtml+="<option value='"+p+"'"+(p===i?" selected='selected'":"")+">"+p+"</option>";t.yearshtml+="</select>",v+=t.yearshtml,t.yearshtml=null}return v+=this._get(t,"yearSuffix"),_&&(v+=(!o&&g&&m?"":"&#xa0;")+b),v+="</div>"},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),e=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),s=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,e)));t.selectedDay=s.getDate(),t.drawMonth=t.selectedMonth=s.getMonth(),t.drawYear=t.selectedYear=s.getFullYear(),"M"!==i&&"Y"!==i||this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),t=this._getMinMaxDate(t,"max"),i=i&&e<i?i:e;return t&&t<i?t:i},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){t=this._get(t,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),i=this._daylightSavingAdjust(new Date(i,s+(e<0?e:n[0]*n[1]),1));return e<0&&i.setDate(this._getDaysInMonth(i.getFullYear(),i.getMonth())),this._isInRange(t,i)},_isInRange:function(t,e){var i,s=this._getMinMaxDate(t,"min"),n=this._getMinMaxDate(t,"max"),o=null,a=null,t=this._get(t,"yearRange");return t&&(t=t.split(":"),i=(new Date).getFullYear(),o=parseInt(t[0],10),a=parseInt(t[1],10),t[0].match(/[+\-].*/)&&(o+=i),t[1].match(/[+\-].*/))&&(a+=i),(!s||e.getTime()>=s.getTime())&&(!n||e.getTime()<=n.getTime())&&(!o||e.getFullYear()>=o)&&(!a||e.getFullYear()<=a)},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return{shortYearCutoff:"string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);s=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),s,this._getFormatConfig(t))}}),k.fn.datepicker=function(t){if(!this.length)return this;k.datepicker.initialized||(k(document).on("mousedown",k.datepicker._checkExternalClick),k.datepicker.initialized=!0),0===k("#"+k.datepicker._mainDivId).length&&k("body").append(k.datepicker.dpDiv);var e=Array.prototype.slice.call(arguments,1);return"string"==typeof t&&("isDisabled"===t||"getDate"===t||"widget"===t)||"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?k.datepicker["_"+t+"Datepicker"].apply(k.datepicker,[this[0]].concat(e)):this.each(function(){"string"==typeof t?k.datepicker["_"+t+"Datepicker"].apply(k.datepicker,[this].concat(e)):k.datepicker._attachDatepicker(this,t)})},k.datepicker=new q,k.datepicker.initialized=!1,k.datepicker.uuid=(new Date).getTime(),k.datepicker.version="1.12.1";k.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var e=k(this).css(t).offset().top;e<0&&k(this).css("top",t.top-e)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&k.fn.draggable&&this._makeDraggable(),this.options.resizable&&k.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?k(t):this.document.find(t||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(t=e.parent.children().eq(e.index)).length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:k.noop,enable:k.noop,close:function(t){var e=this;this._isOpen&&!1!==this._trigger("beforeClose",t)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||k.ui.safeBlur(k.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){e._trigger("close",t)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!1,s=this.uiDialog.siblings(".ui-front:visible").map(function(){return+k(this).css("z-index")}).get(),s=Math.max.apply(null,s);return s>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",s+1),i=!0),i&&!e&&this._trigger("focus",t),i},open:function(){var t=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=k(k.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var t=this._focusedElement;(t=(t=(t=(t=(t=t||this.element.find("[autofocus]")).length?t:this.element.find(":tabbable")).length?t:this.uiDialogButtonPane.find(":tabbable")).length?t:this.uiDialogTitlebarClose.filter(":tabbable")).length?t:this.uiDialog).eq(0).trigger("focus")},_keepFocus:function(t){function e(){var t=k.ui.safeActiveElement(this.document[0]);this.uiDialog[0]===t||k.contains(this.uiDialog[0],t)||this._focusTabbable()}t.preventDefault(),e.call(this),this._delay(e)},_createWrapper:function(){this.uiDialog=k("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(t){var e,i,s;this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===k.ui.keyCode.ESCAPE?(t.preventDefault(),this.close(t)):t.keyCode!==k.ui.keyCode.TAB||t.isDefaultPrevented()||(e=this.uiDialog.find(":tabbable"),i=e.filter(":first"),s=e.filter(":last"),t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==i[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){s.trigger("focus")}),t.preventDefault()):(this._delay(function(){i.trigger("focus")}),t.preventDefault()))},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=k("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(t){k(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=k("<button type='button'></button>").button({label:k("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),t=k("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(t,"ui-dialog-title"),this._title(t),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=k("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=k("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var s=this,t=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),k.isEmptyObject(t)||k.isArray(t)&&!t.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(k.each(t,function(t,e){var i;e=k.isFunction(e)?{click:e,text:t}:e,e=k.extend({type:"button"},e),i=e.click,t={icon:e.icon,iconPosition:e.iconPosition,showLabel:e.showLabel,icons:e.icons,text:e.text},delete e.click,delete e.icon,delete e.iconPosition,delete e.showLabel,delete e.icons,"boolean"==typeof e.text&&delete e.text,k("<button></button>",e).button(t).appendTo(s.uiButtonSet).on("click",function(){i.apply(s.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var n=this,o=this.options;function a(t){return{position:t.position,offset:t.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(t,e){n._addClass(k(this),"ui-dialog-dragging"),n._blockFrames(),n._trigger("dragStart",t,a(e))},drag:function(t,e){n._trigger("drag",t,a(e))},stop:function(t,e){var i=e.offset.left-n.document.scrollLeft(),s=e.offset.top-n.document.scrollTop();o.position={my:"left top",at:"left"+(0<=i?"+":"")+i+" top"+(0<=s?"+":"")+s,of:n.window},n._removeClass(k(this),"ui-dialog-dragging"),n._unblockFrames(),n._trigger("dragStop",t,a(e))}})},_makeResizable:function(){var n=this,o=this.options,t=o.resizable,e=this.uiDialog.css("position"),t="string"==typeof t?t:"n,e,s,w,se,sw,ne,nw";function a(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:o.minWidth,minHeight:this._minHeight(),handles:t,start:function(t,e){n._addClass(k(this),"ui-dialog-resizing"),n._blockFrames(),n._trigger("resizeStart",t,a(e))},resize:function(t,e){n._trigger("resize",t,a(e))},stop:function(t,e){var i=n.uiDialog.offset(),s=i.left-n.document.scrollLeft(),i=i.top-n.document.scrollTop();o.height=n.uiDialog.height(),o.width=n.uiDialog.width(),o.position={my:"left top",at:"left"+(0<=s?"+":"")+s+" top"+(0<=i?"+":"")+i,of:n.window},n._removeClass(k(this),"ui-dialog-resizing"),n._unblockFrames(),n._trigger("resizeStop",t,a(e))}}).css("position",e)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=k(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),e=k.inArray(this,t);-1!==e&&t.splice(e,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||this.document.data("ui-dialog-instances",t=[]),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};k.each(t,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(t,e){var i,s=this.uiDialog;"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:k("<a>").text(""+this.options.closeText).html()}),"draggable"===t&&((i=s.is(":data(ui-draggable)"))&&!e&&s.draggable("destroy"),!i)&&e&&this._makeDraggable(),"position"===t&&this._position(),"resizable"===t&&((i=s.is(":data(ui-resizable)"))&&!e&&s.resizable("destroy"),i&&"string"==typeof e&&s.resizable("option","handles",e),i||!1===e||this._makeResizable()),"title"===t)&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title"))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=k(this);return k("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return!!k(t.target).closest(".ui-dialog").length||!!k(t.target).closest(".ui-datepicker").length},_createOverlay:function(){var e;this.options.modal&&(e=!0,this._delay(function(){e=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(t){e||this._allowInteraction(t)||(t.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=k("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1))},_destroyOverlay:function(){var t;this.options.modal&&this.overlay&&((t=this.document.data("ui-dialog-overlays")-1)?this.document.data("ui-dialog-overlays",t):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null)}}),!1!==k.uiBackCompat&&k.widget("ui.dialog",k.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}}),k.ui.dialog,k.widget("ui.progressbar",{version:"1.12.1",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=k("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){if(void 0===t)return this.options.value;this.options.value=this._constrainedValue(t),this._refreshValue()},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=!1===t,"number"!=typeof t&&(t=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,e=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).width(e.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,t===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=k("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),k.widget("ui.selectmenu",[k.ui.formResetMixin,{version:"1.12.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var t=this.element.uniqueId().attr("id");this.ids={element:t,button:t+"-button",menu:t+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=k()},_drawButton:function(){var t,e=this,i=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.focus(),t.preventDefault()}}),this.element.hide(),this.button=k("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),t=k("<span>").appendTo(this.button),this._addClass(t,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(i).appendTo(this.button),!1!==this.options.width&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){e._rendered||e._refreshMenu()})},_drawMenu:function(){var i=this;this.menu=k("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=k("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,e){t.preventDefault(),i._setSelection(),i._select(e.item.data("ui-selectmenu-item"),t)},focus:function(t,e){e=e.item.data("ui-selectmenu-item");null!=i.focusIndex&&e.index!==i.focusIndex&&(i._trigger("focus",t,{item:e}),i.isOpen||i._select(e,t)),i.focusIndex=e.index,i.button.attr("aria-activedescendant",i.menuItems.eq(e.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t=this.element.find("option");this.menu.empty(),this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,t.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(k.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(t){var e=k("<span>");return this._setText(e,t.label),this._addClass(e,"ui-selectmenu-text"),e},_renderMenu:function(s,t){var n=this,o="";k.each(t,function(t,e){var i;e.optgroup!==o&&(i=k("<li>",{text:e.optgroup}),n._addClass(i,"ui-selectmenu-optgroup","ui-menu-divider"+(e.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),i.appendTo(s),o=e.optgroup),n._renderItemData(s,e)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(t,e){var i=k("<li>"),s=k("<div>",{title:e.element.attr("title")});return e.disabled&&this._addClass(i,null,"ui-state-disabled"),this._setText(s,e.label),i.append(s).appendTo(t)},_setText:function(t,e){e?t.text(e):t.html("&#160;")},_move:function(t,e){var i,s=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),s+=":not(.ui-state-disabled)"),(i="first"===t||"last"===t?i["first"===t?"prevAll":"nextAll"](s).eq(-1):i[t+"All"](s).eq(0)).length&&this.menuInstance.focus(e,i)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?((t=window.getSelection()).removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(t){!this.isOpen||k(t.target).closest(".ui-selectmenu-menu, #"+k.ui.escapeSelector(this.ids.button)).length||this.close(t)}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection()).rangeCount&&(this.range=t.getRangeAt(0)):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(t){var e=!0;switch(t.keyCode){case k.ui.keyCode.TAB:case k.ui.keyCode.ESCAPE:this.close(t),e=!1;break;case k.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case k.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case k.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case k.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case k.ui.keyCode.LEFT:this._move("prev",t);break;case k.ui.keyCode.RIGHT:this._move("next",t);break;case k.ui.keyCode.HOME:case k.ui.keyCode.PAGE_UP:this._move("first",t);break;case k.ui.keyCode.END:case k.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),e=!1}e&&t.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==i&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){t=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(t,e){var i;"icons"===t&&(i=this.button.find("span.ui-icon"),this._removeClass(i,null,this.options.icons.button)._addClass(i,null,e.button)),this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var t=this.options.appendTo;return t=(t=(t=t&&(t.jquery||t.nodeType?k(t):this.document.find(t).eq(0)))&&t[0]?t:this.element.closest(".ui-front, dialog")).length?t:this.document[0].body},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;!1===t?this.button.css("width",""):(null===t&&(t=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(t))},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(t){var i=this,s=[];t.each(function(t,e){s.push(i._parseOption(k(e),t))}),this.items=s},_parseOption:function(t,e){var i=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),k.widget("ui.slider",k.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,e=this.options,i=this.element.find(".ui-slider-handle"),s=[],n=e.values&&e.values.length||1;for(i.length>n&&(i.slice(n).remove(),i=i.slice(0,n)),t=i.length;t<n;t++)s.push("<span tabindex='0'></span>");this.handles=i.add(k(s.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(t){k(this).data("ui-slider-handle-index",t).attr("tabIndex",0)})},_createRange:function(){var t=this.options;t.range?(!0===t.range&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:k.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=k("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==t.range&&"max"!==t.range||this._addClass(this.range,"ui-slider-range-"+t.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,o,e,a,r=this,h=this.options;return!h.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var e=Math.abs(i-r.values(t));(e<s||s===e&&(t===r._lastChangedValue||r.values(t)===h.min))&&(s=e,n=k(this),o=t)}),!1!==this._start(t,o))&&(this._mouseSliding=!0,this._handleIndex=o,this._addClass(n,null,"ui-state-active"),n.trigger("focus"),e=n.offset(),a=!k(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=a?{left:0,top:0}:{left:t.pageX-e.left-n.width()/2,top:t.pageY-e.top-n.height()/2-(parseInt(n.css("borderTopWidth"),10)||0)-(parseInt(n.css("borderBottomWidth"),10)||0)+(parseInt(n.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,i),this._animateOff=!0)},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},e=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,e),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,t="horizontal"===this.orientation?(e=this.elementSize.width,t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),t=t/e;return(t=1<t?1:t)<0&&(t=0),"vertical"===this.orientation&&(t=1-t),e=this._valueMax()-this._valueMin(),t=this._valueMin()+t*e,this._trimAlignValue(t)},_uiHash:function(t,e,i){var s={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==e?e:this.values(t),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var s,n=this.value(),o=this.values();this._hasMultipleValues()&&(s=this.values(e?0:1),n=this.values(e),2===this.options.values.length&&!0===this.options.range&&(i=0===e?Math.min(s,i):Math.max(s,i)),o[e]=i),i!==n&&!1!==this._trigger("slide",t,this._uiHash(e,i,o))&&(this._hasMultipleValues()?this.values(e,i):this.value(i))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){if(!arguments.length)return this._value();this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0)},values:function(t,e){var i,s,n;if(1<arguments.length)this.options.values[t]=this._trimAlignValue(e),this._refreshValue(),this._change(null,t);else{if(!arguments.length)return this._values();if(!k.isArray(t))return this._hasMultipleValues()?this._values(t):this.value();for(i=this.options.values,s=t,n=0;n<i.length;n+=1)i[n]=this._trimAlignValue(s[n]),this._change(null,n);this._refreshValue()}},_setOption:function(t,e){var i,s=0;switch("range"===t&&!0===this.options.range&&("min"===e?(this.options.value=this._values(0),this.options.values=null):"max"===e&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),k.isArray(this.options.values)&&(s=this.options.values.length),this._super(t,e),t){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(e),this.handles.css("horizontal"===e?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),i=s-1;0<=i;i--)this._change(null,i);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return this._trimAlignValue(t)},_values:function(t){var e,i;if(arguments.length)return t=this.options.values[t],this._trimAlignValue(t);if(this._hasMultipleValues()){for(e=this.options.values.slice(),i=0;i<e.length;i+=1)e[i]=this._trimAlignValue(e[i]);return e}return[]},_trimAlignValue:function(t){var e,i;return t<=this._valueMin()?this._valueMin():t>=this._valueMax()?this._valueMax():(e=0<this.options.step?this.options.step:1,i=t-(t=(t-this._valueMin())%e),2*Math.abs(t)>=e&&(i+=0<t?e:-e),parseFloat(i.toFixed(5)))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step;(t=Math.round((t-e)/i)*i+e)>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return t=null!==this.options.min?Math.max(t,this._precisionOf(this.options.min)):t},_precisionOf:function(t){var t=t.toString(),e=t.indexOf(".");return-1===e?0:t.length-e-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,t,s,n,o=this.options.range,a=this.options,r=this,h=!this._animateOff&&a.animate,l={};this._hasMultipleValues()?this.handles.each(function(t){i=(r.values(t)-r._valueMin())/(r._valueMax()-r._valueMin())*100,l["horizontal"===r.orientation?"left":"bottom"]=i+"%",k(this).stop(1,1)[h?"animate":"css"](l,a.animate),!0===r.options.range&&("horizontal"===r.orientation?(0===t&&r.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},a.animate),1===t&&r.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:a.animate})):(0===t&&r.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},a.animate),1===t&&r.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:a.animate}))),e=i}):(t=this.value(),s=this._valueMin(),n=this._valueMax(),i=n!==s?(t-s)/(n-s)*100:0,l["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](l,a.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},a.animate),"max"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:100-i+"%"},a.animate),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},a.animate),"max"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:100-i+"%"},a.animate))},_handleEvents:{keydown:function(t){var e,i,s,n=k(t.target).data("ui-slider-handle-index");switch(t.keyCode){case k.ui.keyCode.HOME:case k.ui.keyCode.END:case k.ui.keyCode.PAGE_UP:case k.ui.keyCode.PAGE_DOWN:case k.ui.keyCode.UP:case k.ui.keyCode.RIGHT:case k.ui.keyCode.DOWN:case k.ui.keyCode.LEFT:if(t.preventDefault(),this._keySliding||(this._keySliding=!0,this._addClass(k(t.target),null,"ui-state-active"),!1!==this._start(t,n)))break;return}switch(s=this.options.step,e=i=this._hasMultipleValues()?this.values(n):this.value(),t.keyCode){case k.ui.keyCode.HOME:i=this._valueMin();break;case k.ui.keyCode.END:i=this._valueMax();break;case k.ui.keyCode.PAGE_UP:i=this._trimAlignValue(e+(this._valueMax()-this._valueMin())/this.numPages);break;case k.ui.keyCode.PAGE_DOWN:i=this._trimAlignValue(e-(this._valueMax()-this._valueMin())/this.numPages);break;case k.ui.keyCode.UP:case k.ui.keyCode.RIGHT:if(e===this._valueMax())return;i=this._trimAlignValue(e+s);break;case k.ui.keyCode.DOWN:case k.ui.keyCode.LEFT:if(e===this._valueMin())return;i=this._trimAlignValue(e-s)}this._slide(t,n,i)},keyup:function(t){var e=k(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,e),this._change(t,e),this._removeClass(k(t.target),null,"ui-state-active"))}}});function e(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}k.widget("ui.spinner",{version:"1.12.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var s=this._super(),n=this.element;return k.each(["min","max","step"],function(t,e){var i=n.attr(e);null!=i&&i.length&&(s[e]=i)}),s},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t))},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((0<e?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(t){var e;function i(){this.element[0]!==k.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=e,this._delay(function(){this.previous=e}))}e=this.element[0]===k.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),!1!==this._start(t)&&this._repeat(null,k(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(k(t.currentTarget).hasClass("ui-state-active"))return!1!==this._start(t)&&void this._repeat(null,k(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&0<this.uiSpinner.height()&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(t){var e=this.options,i=k.ui.keyCode;switch(t.keyCode){case i.UP:return this._repeat(null,1,t),!0;case i.DOWN:return this._repeat(null,-1,t),!0;case i.PAGE_UP:return this._repeat(null,e.page,t),!0;case i.PAGE_DOWN:return this._repeat(null,-e.page,t),!0}return!1},_start:function(t){return!(!this.spinning&&!1===this._trigger("start",t))&&(this.counter||(this.counter=1),this.spinning=!0)},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",e,{value:i})||(this._value(i),this.counter++)},_increment:function(t){var e=this.options.incremental;return e?k.isFunction(e)?e(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return t=null!==this.options.min?Math.max(t,this._precisionOf(this.options.min)):t},_precisionOf:function(t){var t=t.toString(),e=t.indexOf(".");return-1===e?0:t.length-e-1},_adjustValue:function(t){var e=this.options,i=null!==e.min?e.min:0,s=t-i;return t=i+Math.round(s/e.step)*e.step,t=parseFloat(t.toFixed(this._precision())),null!==e.max&&t>e.max?e.max:null!==e.min&&t<e.min?e.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var i;"culture"===t||"numberFormat"===t?(i=this._parse(this.element.val()),this.options[t]=e,this.element.val(this._format(i))):("max"!==t&&"min"!==t&&"step"!==t||"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(i=this.buttons.first().find(".ui-icon"),this._removeClass(i,null,this.options.icons.up),this._addClass(i,null,e.up),i=this.buttons.last().find(".ui-icon"),this._removeClass(i,null,this.options.icons.down),this._addClass(i,null,e.down)),this._super(t,e))},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:e(function(t){this._super(t)}),_parse:function(t){return""===(t="string"==typeof t&&""!==t?window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t:t)||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null!==t&&t===this._adjustValue(t)},_value:function(t,e){var i;""!==t&&null!==(i=this._parse(t))&&(e||(i=this._adjustValue(i)),t=this._format(i)),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){if(!arguments.length)return this._parse(this.element.val());e(this._value).call(this,t)},widget:function(){return this.uiSpinner}}),!1!==k.uiBackCompat&&k.widget("ui.spinner",k.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}});k.ui.spinner,k.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(g=/#.*$/,function(t){var e=t.href.replace(g,""),i=location.href.replace(g,"");try{e=decodeURIComponent(e)}catch(t){}try{i=decodeURIComponent(i)}catch(t){}return 1<t.hash.length&&e===i}),_create:function(){var e=this,t=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,t.collapsible),this._processTabs(),t.active=this._initialActive(),k.isArray(t.disabled)&&(t.disabled=k.unique(t.disabled.concat(k.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(t.active):this.active=k(),this._refresh(),this.active.length&&this.load(t.active)},_initialActive:function(){var i=this.options.active,t=this.options.collapsible,s=location.hash.substring(1);return null===i&&(s&&this.tabs.each(function(t,e){if(k(e).attr("aria-controls")===s)return i=t,!1}),null!==(i=null===i?this.tabs.index(this.tabs.filter(".ui-tabs-active")):i)&&-1!==i||(i=!!this.tabs.length&&0)),!1!==i&&-1===(i=this.tabs.index(this.tabs.eq(i)))&&(i=!t&&0),i=!t&&!1===i&&this.anchors.length?0:i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):k()}},_tabKeydown:function(t){var e=k(k.ui.safeActiveElement(this.document[0])).closest("li"),i=this.tabs.index(e),s=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case k.ui.keyCode.RIGHT:case k.ui.keyCode.DOWN:i++;break;case k.ui.keyCode.UP:case k.ui.keyCode.LEFT:s=!1,i--;break;case k.ui.keyCode.END:i=this.anchors.length-1;break;case k.ui.keyCode.HOME:i=0;break;case k.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i);case k.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i!==this.options.active&&i);default:return}t.preventDefault(),clearTimeout(this.activating),i=this._focusNextTab(i,s),t.ctrlKey||t.metaKey||(e.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",i)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===k.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===k.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===k.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,e){var i=this.tabs.length-1;for(;-1!==k.inArray(t=(t=i<t?0:t)<0?i:t,this.options.disabled);)t=e?t+1:t-1;return t},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){"active"===t?this._activate(e):(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||!1!==this.options.active||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e))},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,e=this.tablist.children(":has(a[href])");t.disabled=k.map(e.filter(".ui-state-disabled"),function(t){return e.index(t)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!k.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=k()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=k()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var h=this,t=this.tabs,e=this.anchors,i=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){k(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){k(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return k("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=k(),this.anchors.each(function(t,e){var i,s,n,o=k(e).uniqueId().attr("id"),a=k(e).closest("li"),r=a.attr("aria-controls");h._isLocal(e)?(n=(i=e.hash).substring(1),s=h.element.find(h._sanitizeSelector(i))):(n=a.attr("aria-controls")||k({}).uniqueId()[0].id,(s=h.element.find(i="#"+n)).length||(s=h._createPanel(n)).insertAfter(h.panels[t-1]||h.tablist),s.attr("aria-live","polite")),s.length&&(h.panels=h.panels.add(s)),r&&a.data("ui-tabs-aria-controls",r),a.attr({"aria-controls":n,"aria-labelledby":o}),s.attr("aria-labelledby",o)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),t&&(this._off(t.not(this.tabs)),this._off(e.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return k("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var e,i;for(k.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),i=0;e=this.tabs[i];i++)e=k(e),!0===t||-1!==k.inArray(i,t)?(e.attr("aria-disabled","true"),this._addClass(e,null,"ui-state-disabled")):(e.removeAttr("aria-disabled"),this._removeClass(e,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var i={};t&&k.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,e=this.element.parent();"fill"===t?(i=e.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=k(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=k(this).outerHeight(!0)}),this.panels.each(function(){k(this).height(Math.max(0,i-k(this).innerHeight()+k(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,k(this).height("").height())}).height(i))},_eventHandler:function(t){var e=this.options,i=this.active,s=k(t.currentTarget).closest("li"),n=s[0]===i[0],o=n&&e.collapsible,a=o?k():this._getPanelForTab(s),r=i.length?this._getPanelForTab(i):k(),i={oldTab:i,oldPanel:r,newTab:o?k():s,newPanel:a};t.preventDefault(),s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||n&&!e.collapsible||!1===this._trigger("beforeActivate",t,i)||(e.active=!o&&this.tabs.index(s),this.active=n?k():s,this.xhr&&this.xhr.abort(),r.length||a.length||k.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,i))},_toggle:function(t,e){var i=this,s=e.newPanel,n=e.oldPanel;function o(){i.running=!1,i._trigger("activate",t,e)}function a(){i._addClass(e.newTab.closest("li"),"ui-tabs-active","ui-state-active"),s.length&&i.options.show?i._show(s,i.options.show,o):(s.show(),o())}this.running=!0,n.length&&this.options.hide?this._hide(n,this.options.hide,function(){i._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),a()}):(this._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n.hide(),a()),n.attr("aria-hidden","true"),e.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),s.length&&n.length?e.oldTab.attr("tabIndex",-1):s.length&&this.tabs.filter(function(){return 0===k(this).attr("tabIndex")}).attr("tabIndex",-1),s.attr("aria-hidden","false"),e.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var t=this._findActive(t);t[0]!==this.active[0]&&(t=(t=t.length?t:this.active).find(".ui-tabs-anchor")[0],this._eventHandler({target:t,currentTarget:t,preventDefault:k.noop}))},_findActive:function(t){return!1===t?k():this.tabs.eq(t)},_getIndex:function(t){return t="string"==typeof t?this.anchors.index(this.anchors.filter("[href$='"+k.ui.escapeSelector(t)+"']")):t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){k.data(this,"ui-tabs-destroy")?k(this).remove():k(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=k(this),e=t.data("ui-tabs-aria-controls");e?t.attr("aria-controls",e).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var t=this.options.disabled;!1!==t&&(t=void 0!==i&&(i=this._getIndex(i),k.isArray(t)?k.map(t,function(t){return t!==i?t:null}):k.map(this.tabs,function(t,e){return e!==i?e:null})),this._setOptionDisabled(t))},disable:function(t){var e=this.options.disabled;if(!0!==e){if(void 0===t)e=!0;else{if(t=this._getIndex(t),-1!==k.inArray(t,e))return;e=k.isArray(e)?k.merge([t],e).sort():[t]}this._setOptionDisabled(e)}},load:function(t,s){t=this._getIndex(t);function n(t,e){"abort"===e&&o.panels.stop(!1,!0),o._removeClass(i,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===o.xhr&&delete o.xhr}var o=this,i=this.tabs.eq(t),t=i.find(".ui-tabs-anchor"),a=this._getPanelForTab(i),r={tab:i,panel:a};this._isLocal(t[0])||(this.xhr=k.ajax(this._ajaxSettings(t,s,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(i,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,i){setTimeout(function(){a.html(t),o._trigger("load",s,r),n(i,e)},1)}).fail(function(t,e){setTimeout(function(){n(t,e)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,e){return n._trigger("beforeLoad",i,k.extend({jqXHR:t,ajaxSettings:e},s))}}},_getPanelForTab:function(t){t=k(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+t))}}),!1!==k.uiBackCompat&&k.widget("ui.tabs",k.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),k.ui.tabs;var g,m,_,v,V,$,b,y,w,I,P,X,G,Q,J,Z,tt,et,it,st,T,M="ui-effects-",S="ui-effects-style",H="ui-effects-animated",nt=k;function z(t,e,i){var s=w[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:t<0?0:s.max<t?s.max:t)}function ot(s){var n=b(),o=n._rgba=[];return s=s.toLowerCase(),P($,function(t,e){var i=e.re.exec(s),i=i&&e.parse(i),e=e.space||"rgba";if(i)return i=n[e](i),n[y[e].cache]=i[y[e].cache],o=n._rgba=i._rgba,!1}),o.length?("0,0,0,0"===o.join()&&m.extend(o,v.transparent),n):v[s]}function O(t,e,i){return 6*(i=(i+1)%1)<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}function at(t){var e,i,s=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,n={};if(s&&s.length&&s[0]&&s[s[0]])for(i=s.length;i--;)"string"==typeof s[e=s[i]]&&(n[k.camelCase(e)]=s[e]);else for(e in s)"string"==typeof s[e]&&(n[e]=s[e]);return n}function A(t,e,i,s){return t={effect:t=k.isPlainObject(t)?(e=t).effect:t},k.isFunction(e=null==e?{}:e)&&(s=e,i=null,e={}),"number"!=typeof e&&!k.fx.speeds[e]||(s=i,i=e,e={}),k.isFunction(i)&&(s=i,i=null),e&&k.extend(t,e),i=i||e.duration,t.duration=k.fx.off?0:"number"==typeof i?i:i in k.fx.speeds?k.fx.speeds[i]:k.fx.speeds._default,t.complete=s||e.complete,t}function N(t){return!t||"number"==typeof t||k.fx.speeds[t]||"string"==typeof t&&!k.effects.effect[t]||k.isFunction(t)||"object"==typeof t&&!t.effect}function rt(t,e){var i=e.outerWidth(),e=e.outerHeight(),t=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/.exec(t)||["",0,i,e,0];return{top:parseFloat(t[1])||0,right:"auto"===t[2]?i:parseFloat(t[2]),bottom:"auto"===t[3]?e:parseFloat(t[3]),left:parseFloat(t[4])||0}}k.effects={effect:{}},V=/^([\-+])=\s*(\d+\.?\d*)/,$=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],b=(m=nt).Color=function(t,e,i,s){return new m.Color.fn.parse(t,e,i,s)},y={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},w={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},I=b.support={},t=m("<p>")[0],P=m.each,t.style.cssText="background-color:rgba(1,1,1,.5)",I.rgba=-1<t.style.backgroundColor.indexOf("rgba"),P(y,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),(b.fn=m.extend(b.prototype,{parse:function(n,t,e,i){if(n===_)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=m(n).css(t),t=_);var o=this,s=m.type(n),a=this._rgba=[];return t!==_&&(n=[n,t,e,i],s="array"),"string"===s?this.parse(ot(n)||v._default):"array"===s?(P(y.rgba.props,function(t,e){a[e.idx]=z(n[e.idx],e)}),this):"object"===s?(n instanceof b?P(y,function(t,e){n[e.cache]&&(o[e.cache]=n[e.cache].slice())}):P(y,function(t,i){var s=i.cache;P(i.props,function(t,e){if(!o[s]&&i.to){if("alpha"===t||null==n[t])return;o[s]=i.to(o._rgba)}o[s][e.idx]=z(n[t],e,!0)}),o[s]&&m.inArray(null,o[s].slice(0,3))<0&&(o[s][3]=1,i.from)&&(o._rgba=i.from(o[s]))}),this):void 0},is:function(t){var n=b(t),o=!0,a=this;return P(y,function(t,e){var i,s=n[e.cache];return s&&(i=a[e.cache]||e.to&&e.to(a._rgba)||[],P(e.props,function(t,e){if(null!=s[e.idx])return o=s[e.idx]===i[e.idx]})),o}),o},_space:function(){var i=[],s=this;return P(y,function(t,e){s[e.cache]&&i.push(t)}),i.pop()},transition:function(t,a){var t=(l=b(t))._space(),e=y[t],i=0===this.alpha()?b("transparent"):this,r=i[e.cache]||e.to(i._rgba),h=r.slice(),l=l[e.cache];return P(e.props,function(t,e){var i=e.idx,s=r[i],n=l[i],o=w[e.type]||{};null!==n&&(null===s?h[i]=n:(o.mod&&(n-s>o.mod/2?s+=o.mod:s-n>o.mod/2&&(s-=o.mod)),h[i]=z((n-s)*a+s,e)))}),this[t](h)},blend:function(t){var e,i,s;return 1===this._rgba[3]?this:(e=this._rgba.slice(),i=e.pop(),s=b(t)._rgba,b(m.map(e,function(t,e){return(1-i)*s[e]+i*t})))},toRgbaString:function(){var t="rgba(",e=m.map(this._rgba,function(t,e){return null==t?2<e?1:0:t});return 1===e[3]&&(e.pop(),t="rgb("),t+e.join()+")"},toHslaString:function(){var t="hsla(",e=m.map(this.hsla(),function(t,e){return null==t&&(t=2<e?1:0),t=e&&e<3?Math.round(100*t)+"%":t});return 1===e[3]&&(e.pop(),t="hsl("),t+e.join()+")"},toHexString:function(t){var e=this._rgba.slice(),i=e.pop();return t&&e.push(~~(255*i)),"#"+m.map(e,function(t){return 1===(t=(t||0).toString(16)).length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}})).parse.prototype=b.fn,y.hsla.to=function(t){var e,i,s,n,o,a,r,h;return null==t[0]||null==t[1]||null==t[2]?[null,null,null,t[3]]:(e=t[0]/255,i=t[1]/255,s=t[2]/255,t=t[3],n=(h=Math.max(e,i,s))-(r=Math.min(e,i,s)),a=.5*(o=h+r),r=r===h?0:e===h?60*(i-s)/n+360:i===h?60*(s-e)/n+120:60*(e-i)/n+240,h=0==n?0:a<=.5?n/o:n/(2-o),[Math.round(r)%360,h,a,null==t?1:t])},y.hsla.from=function(t){var e,i,s;return null==t[0]||null==t[1]||null==t[2]?[null,null,null,t[3]]:(e=t[0]/360,s=t[1],i=t[3],s=2*(t=t[2])-(t=t<=.5?t*(1+s):t+s-t*s),[Math.round(255*O(s,t,e+1/3)),Math.round(255*O(s,t,e)),Math.round(255*O(s,t,e-1/3)),i])},P(y,function(r,t){var e=t.props,o=t.cache,a=t.to,h=t.from;b.fn[r]=function(t){var i,s,n;return a&&!this[o]&&(this[o]=a(this._rgba)),t===_?this[o].slice():(i=m.type(t),s="array"===i||"object"===i?t:arguments,n=this[o].slice(),P(e,function(t,e){t=s["object"===i?t:e.idx];null==t&&(t=n[e.idx]),n[e.idx]=z(t,e)}),h?((t=b(h(n)))[o]=n,t):b(n))},P(e,function(o,a){b.fn[o]||(b.fn[o]=function(t){var e=m.type(t),i="alpha"===o?this._hsla?"hsla":"rgba":r,s=this[i](),n=s[a.idx];return"undefined"===e?n:("function"===e&&(t=t.call(this,n),e=m.type(t)),null==t&&a.empty?this:("string"===e&&(e=V.exec(t))&&(t=n+parseFloat(e[2])*("+"===e[1]?1:-1)),s[a.idx]=t,this[i](s)))})})}),(b.hook=function(t){t=t.split(" ");P(t,function(t,o){m.cssHooks[o]={set:function(t,e){var i,s,n="";if("transparent"!==e&&("string"!==m.type(e)||(i=ot(e)))){if(e=b(i||e),!I.rgba&&1!==e._rgba[3]){for(s="backgroundColor"===o?t.parentNode:t;(""===n||"transparent"===n)&&s&&s.style;)try{n=m.css(s,"backgroundColor"),s=s.parentNode}catch(t){}e=e.blend(n&&"transparent"!==n?n:"_default")}e=e.toRgbaString()}try{t.style[o]=e}catch(t){}}},m.fx.step[o]=function(t){t.colorInit||(t.start=b(t.elem,o),t.end=b(t.end),t.colorInit=!0),m.cssHooks[o].set(t.elem,t.start.transition(t.end,t.pos))}})})("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),m.cssHooks.borderColor={expand:function(i){var s={};return P(["Top","Right","Bottom","Left"],function(t,e){s["border"+e+"Color"]=i}),s}},v=m.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"},J=["add","remove","toggle"],Z={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1},k.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,e){k.fx.step[e]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(nt.style(t.elem,e,t.end),t.setAttr=!0)}}),k.fn.addBack||(k.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),k.effects.animateClass=function(n,t,e,i){var o=k.speed(t,e,i);return this.queue(function(){var i=k(this),t=i.attr("class")||"",e=(e=o.children?i.find("*").addBack():i).map(function(){return{el:k(this),start:at(this)}}),s=function(){k.each(J,function(t,e){n[e]&&i[e+"Class"](n[e])})};s(),e=e.map(function(){return this.end=at(this.el[0]),this.diff=((t,e)=>{var i,s,n={};for(i in e)s=e[i],t[i]===s||Z[i]||!k.fx.step[i]&&isNaN(parseFloat(s))||(n[i]=s);return n})(this.start,this.end),this}),i.attr("class",t),e=e.map(function(){var t=this,e=k.Deferred(),i=k.extend({},o,{queue:!1,complete:function(){e.resolve(t)}});return this.el.animate(this.diff,i),e.promise()}),k.when.apply(k,e.get()).done(function(){s(),k.each(arguments,function(){var e=this.el;k.each(this.diff,function(t){e.css(t,"")})}),o.complete.call(i[0])})})},k.fn.extend({addClass:(Q=k.fn.addClass,function(t,e,i,s){return e?k.effects.animateClass.call(this,{add:t},e,i,s):Q.apply(this,arguments)}),removeClass:(G=k.fn.removeClass,function(t,e,i,s){return 1<arguments.length?k.effects.animateClass.call(this,{remove:t},e,i,s):G.apply(this,arguments)}),toggleClass:(X=k.fn.toggleClass,function(t,e,i,s,n){return"boolean"==typeof e||void 0===e?i?k.effects.animateClass.call(this,e?{add:t}:{remove:t},i,s,n):X.apply(this,arguments):k.effects.animateClass.call(this,{toggle:t},e,i,s)}),switchClass:function(t,e,i,s,n){return k.effects.animateClass.call(this,{add:e,remove:t},i,s,n)}}),k.expr&&k.expr.filters&&k.expr.filters.animated&&(k.expr.filters.animated=(tt=k.expr.filters.animated,function(t){return!!k(t).data(H)||tt(t)})),!1!==k.uiBackCompat&&k.extend(k.effects,{save:function(t,e){for(var i=0,s=e.length;i<s;i++)null!==e[i]&&t.data(M+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;s<n;s++)null!==e[s]&&(i=t.data(M+e[s]),t.css(e[s],i))},setMode:function(t,e){return e="toggle"===e?t.is(":hidden")?"show":"hide":e},createWrapper:function(i){if(i.parent().is(".ui-effects-wrapper"))return i.parent();var s={width:i.outerWidth(!0),height:i.outerHeight(!0),float:i.css("float")},t=k("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:i.width(),height:i.height()},n=document.activeElement;try{n.id}catch(t){n=document.body}return i.wrap(t),i[0]!==n&&!k.contains(i[0],n)||k(n).trigger("focus"),t=i.parent(),"static"===i.css("position")?(t.css({position:"relative"}),i.css({position:"relative"})):(k.extend(s,{position:i.css("position"),zIndex:i.css("z-index")}),k.each(["top","left","bottom","right"],function(t,e){s[e]=i.css(e),isNaN(parseInt(s[e],10))&&(s[e]="auto")}),i.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),i.css(e),t.css(s).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!k.contains(t[0],e)||k(e).trigger("focus")),t}}),k.extend(k.effects,{version:"1.12.1",define:function(t,e,i){return i||(i=e,e="effect"),k.effects.effect[t]=i,k.effects.effect[t].mode=e,i},scaledDimensions:function(t,e,i){var s;return 0===e?{height:0,width:0,outerHeight:0,outerWidth:0}:(s="horizontal"!==i?(e||100)/100:1,i="vertical"!==i?(e||100)/100:1,{height:t.height()*i,width:t.width()*s,outerHeight:t.outerHeight()*i,outerWidth:t.outerWidth()*s})},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();1<e&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(S,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(S)||"",t.removeData(S)},mode:function(t,e){t=t.is(":hidden");return"toggle"===e&&(e=t?"show":"hide"),e=(t?"hide"===e:"show"===e)?"none":e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(t){var e,i=t.css("position"),s=t.position();return t.css({marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()),/^(static|relative)/.test(i)&&(i="absolute",e=k("<"+t[0].nodeName+">").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(M+"placeholder",e)),t.css({position:i,left:s.left,top:s.top}),e},removePlaceholder:function(t){var e=M+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(t){k.effects.restoreStyle(t),k.effects.removePlaceholder(t)},setTransition:function(s,t,n,o){return o=o||{},k.each(t,function(t,e){var i=s.cssUnit(e);0<i[0]&&(o[e]=i[0]*n+i[1])}),o}}),k.fn.extend({effect:function(){function t(t){var e=k(this),i=k.effects.mode(e,r)||o;e.data(H,!0),h.push(i),o&&("show"===i||i===o&&"hide"===i)&&e.show(),o&&"none"===i||k.effects.saveStyle(e),k.isFunction(t)&&t()}var s=A.apply(this,arguments),n=k.effects.effect[s.effect],o=n.mode,e=s.queue,i=e||"fx",a=s.complete,r=s.mode,h=[];return k.fx.off||!n?r?this[r](s.duration,a):this.each(function(){a&&a.call(this)}):!1===e?this.each(t).each(l):this.queue(i,t).queue(i,l);function l(t){var e=k(this);function i(){k.isFunction(a)&&a.call(e[0]),k.isFunction(t)&&t()}s.mode=h.shift(),!1===k.uiBackCompat||o?"none"===s.mode?(e[r](),i()):n.call(e[0],s,function(){e.removeData(H),k.effects.cleanUp(e),"hide"===s.mode&&e.hide(),i()}):(e.is(":hidden")?"hide"===r:"show"===r)?(e[r](),i()):n.call(e[0],s,i)}},show:(st=k.fn.show,function(t){return N(t)?st.apply(this,arguments):((t=A.apply(this,arguments)).mode="show",this.effect.call(this,t))}),hide:(it=k.fn.hide,function(t){return N(t)?it.apply(this,arguments):((t=A.apply(this,arguments)).mode="hide",this.effect.call(this,t))}),toggle:(et=k.fn.toggle,function(t){return N(t)||"boolean"==typeof t?et.apply(this,arguments):((t=A.apply(this,arguments)).mode="toggle",this.effect.call(this,t))}),cssUnit:function(t){var i=this.css(t),s=[];return k.each(["em","px","%","pt"],function(t,e){0<i.indexOf(e)&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):rt(this.css("clip"),this)},transfer:function(t,e){var i=k(this),s=k(t.to),n="fixed"===s.css("position"),o=k("body"),a=n?o.scrollTop():0,o=n?o.scrollLeft():0,r=s.offset(),r={top:r.top-a,left:r.left-o,height:s.innerHeight(),width:s.innerWidth()},s=i.offset(),h=k("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(t.className).css({top:s.top-a,left:s.left-o,height:i.innerHeight(),width:i.innerWidth(),position:n?"fixed":"absolute"}).animate(r,t.duration,t.easing,function(){h.remove(),k.isFunction(e)&&e()})}}),k.fx.step.clip=function(t){t.clipInit||(t.start=k(t.elem).cssClip(),"string"==typeof t.end&&(t.end=rt(t.end,t.elem)),t.clipInit=!0),k(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})},T={},k.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){T[t]=function(t){return Math.pow(t,e+2)}}),k.extend(T,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;t<((e=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),k.each(T,function(t,e){k.easing["easeIn"+t]=e,k.easing["easeOut"+t]=function(t){return 1-e(1-t)},k.easing["easeInOut"+t]=function(t){return t<.5?e(2*t)/2:1-e(-2*t+2)/2}});var t=k.effects;k.effects.define("blind","hide",function(t,e){var i={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},s=k(this),n=t.direction||"up",o=s.cssClip(),a={clip:k.extend({},o)},r=k.effects.createPlaceholder(s);a.clip[i[n][0]]=a.clip[i[n][1]],"show"===t.mode&&(s.cssClip(a.clip),r&&r.css(k.effects.clipToBox(a)),a.clip=o),r&&r.animate(k.effects.clipToBox(a),t.duration,t.easing),s.animate(a,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),k.effects.define("bounce",function(t,e){var i,s,n=k(this),o=t.mode,a="hide"===o,o="show"===o,r=t.direction||"up",h=t.distance,l=t.times||5,c=2*l+(o||a?1:0),u=t.duration/c,d=t.easing,p="up"===r||"down"===r?"top":"left",f="up"===r||"left"===r,g=0,t=n.queue().length;for(k.effects.createPlaceholder(n),r=n.css(p),h=h||n["top"==p?"outerHeight":"outerWidth"]()/3,o&&((s={opacity:1})[p]=r,n.css("opacity",0).css(p,f?2*-h:2*h).animate(s,u,d)),a&&(h/=Math.pow(2,l-1)),(s={})[p]=r;g<l;g++)(i={})[p]=(f?"-=":"+=")+h,n.animate(i,u,d).animate(s,u,d),h=a?2*h:h/2;a&&((i={opacity:0})[p]=(f?"-=":"+=")+h,n.animate(i,u,d)),n.queue(e),k.effects.unshift(n,t,1+c)}),k.effects.define("clip","hide",function(t,e){var i={},s=k(this),n=t.direction||"vertical",o="both"===n,a=o||"horizontal"===n,o=o||"vertical"===n,n=s.cssClip();i.clip={top:o?(n.bottom-n.top)/2:n.top,right:a?(n.right-n.left)/2:n.right,bottom:o?(n.bottom-n.top)/2:n.bottom,left:a?(n.right-n.left)/2:n.left},k.effects.createPlaceholder(s),"show"===t.mode&&(s.cssClip(i.clip),i.clip=n),s.animate(i,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),k.effects.define("drop","hide",function(t,e){var i,s=k(this),n="show"===t.mode,o=t.direction||"left",a="up"===o||"down"===o?"top":"left",o="up"===o||"left"===o?"-=":"+=",r="+="==o?"-=":"+=",h={opacity:0};k.effects.createPlaceholder(s),i=t.distance||s["top"==a?"outerHeight":"outerWidth"](!0)/2,h[a]=o+i,n&&(s.css(h),h[a]=r+i,h.opacity=1),s.animate(h,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),k.effects.define("explode","hide",function(t,e){var i,s,n,o,a,r,h=t.pieces?Math.round(Math.sqrt(t.pieces)):3,l=h,c=k(this),u="show"===t.mode,d=c.show().css("visibility","hidden").offset(),p=Math.ceil(c.outerWidth()/l),f=Math.ceil(c.outerHeight()/h),g=[];function m(){g.push(this),g.length===h*l&&(c.css({visibility:"visible"}),k(g).remove(),e())}for(i=0;i<h;i++)for(o=d.top+i*f,r=i-(h-1)/2,s=0;s<l;s++)n=d.left+s*p,a=s-(l-1)/2,c.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-s*p,top:-i*f}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:p,height:f,left:n+(u?a*p:0),top:o+(u?r*f:0),opacity:u?0:1}).animate({left:n+(u?0:a*p),top:o+(u?0:r*f),opacity:u?1:0},t.duration||500,t.easing,m)}),k.effects.define("fade","toggle",function(t,e){var i="show"===t.mode;k(this).css("opacity",i?0:1).animate({opacity:i?1:0},{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),k.effects.define("fold","hide",function(e,t){var i=k(this),s=e.mode,n="show"===s,s="hide"===s,o=e.size||15,a=/([0-9]+)%/.exec(o),r=!!e.horizFirst?["right","bottom"]:["bottom","right"],h=e.duration/2,l=k.effects.createPlaceholder(i),c=i.cssClip(),u={clip:k.extend({},c)},d={clip:k.extend({},c)},p=[c[r[0]],c[r[1]]],f=i.queue().length;a&&(o=parseInt(a[1],10)/100*p[s?0:1]),u.clip[r[0]]=o,d.clip[r[0]]=o,d.clip[r[1]]=0,n&&(i.cssClip(d.clip),l&&l.css(k.effects.clipToBox(d)),d.clip=c),i.queue(function(t){l&&l.animate(k.effects.clipToBox(u),h,e.easing).animate(k.effects.clipToBox(d),h,e.easing),t()}).animate(u,h,e.easing).animate(d,h,e.easing).queue(t),k.effects.unshift(i,f,4)}),k.effects.define("highlight","show",function(t,e){var i=k(this),s={backgroundColor:i.css("backgroundColor")};"hide"===t.mode&&(s.opacity=0),k.effects.saveStyle(i),i.css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(s,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),k.effects.define("size",function(s,e){var n,i=k(this),t=["fontSize"],o=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],a=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],r=s.mode,h="effect"!==r,l=s.scale||"both",c=s.origin||["middle","center"],u=i.css("position"),d=i.position(),p=k.effects.scaledDimensions(i),f=s.from||p,g=s.to||k.effects.scaledDimensions(i,0);k.effects.createPlaceholder(i),"show"===r&&(r=f,f=g,g=r),n={from:{y:f.height/p.height,x:f.width/p.width},to:{y:g.height/p.height,x:g.width/p.width}},"box"!==l&&"both"!==l||(n.from.y!==n.to.y&&(f=k.effects.setTransition(i,o,n.from.y,f),g=k.effects.setTransition(i,o,n.to.y,g)),n.from.x!==n.to.x&&(f=k.effects.setTransition(i,a,n.from.x,f),g=k.effects.setTransition(i,a,n.to.x,g))),"content"!==l&&"both"!==l||n.from.y!==n.to.y&&(f=k.effects.setTransition(i,t,n.from.y,f),g=k.effects.setTransition(i,t,n.to.y,g)),c&&(r=k.effects.getBaseline(c,p),f.top=(p.outerHeight-f.outerHeight)*r.y+d.top,f.left=(p.outerWidth-f.outerWidth)*r.x+d.left,g.top=(p.outerHeight-g.outerHeight)*r.y+d.top,g.left=(p.outerWidth-g.outerWidth)*r.x+d.left),i.css(f),"content"!==l&&"both"!==l||(o=o.concat(["marginTop","marginBottom"]).concat(t),a=a.concat(["marginLeft","marginRight"]),i.find("*[width]").each(function(){var t=k(this),e=k.effects.scaledDimensions(t),i={height:e.height*n.from.y,width:e.width*n.from.x,outerHeight:e.outerHeight*n.from.y,outerWidth:e.outerWidth*n.from.x},e={height:e.height*n.to.y,width:e.width*n.to.x,outerHeight:e.height*n.to.y,outerWidth:e.width*n.to.x};n.from.y!==n.to.y&&(i=k.effects.setTransition(t,o,n.from.y,i),e=k.effects.setTransition(t,o,n.to.y,e)),n.from.x!==n.to.x&&(i=k.effects.setTransition(t,a,n.from.x,i),e=k.effects.setTransition(t,a,n.to.x,e)),h&&k.effects.saveStyle(t),t.css(i),t.animate(e,s.duration,s.easing,function(){h&&k.effects.restoreStyle(t)})})),i.animate(g,{queue:!1,duration:s.duration,easing:s.easing,complete:function(){var t=i.offset();0===g.opacity&&i.css("opacity",f.opacity),h||(i.css("position","static"===u?"relative":u).offset(t),k.effects.saveStyle(i)),e()}})}),k.effects.define("scale",function(t,e){var i=k(this),s=t.mode,s=parseInt(t.percent,10)||(0===parseInt(t.percent,10)||"effect"!==s?0:100),i=k.extend(!0,{from:k.effects.scaledDimensions(i),to:k.effects.scaledDimensions(i,s,t.direction||"both"),origin:t.origin||["middle","center"]},t);t.fade&&(i.from.opacity=1,i.to.opacity=0),k.effects.effect.size.call(this,i,e)}),k.effects.define("puff","hide",function(t,e){t=k.extend(!0,{},t,{fade:!0,percent:parseInt(t.percent,10)||150});k.effects.effect.scale.call(this,t,e)}),k.effects.define("pulsate","show",function(t,e){var i=k(this),s=t.mode,n="show"===s,o=2*(t.times||5)+(n||"hide"===s?1:0),a=t.duration/o,r=0,h=1,s=i.queue().length;for(!n&&i.is(":visible")||(i.css("opacity",0).show(),r=1);h<o;h++)i.animate({opacity:r},a,t.easing),r=1-r;i.animate({opacity:r},a,t.easing),i.queue(e),k.effects.unshift(i,s,1+o)}),k.effects.define("shake",function(t,e){var i=1,s=k(this),n=t.direction||"left",o=t.distance||20,a=t.times||3,r=2*a+1,h=Math.round(t.duration/r),l="up"===n||"down"===n?"top":"left",n="up"===n||"left"===n,c={},u={},d={},p=s.queue().length;for(k.effects.createPlaceholder(s),c[l]=(n?"-=":"+=")+o,u[l]=(n?"+=":"-=")+2*o,d[l]=(n?"-=":"+=")+2*o,s.animate(c,h,t.easing);i<a;i++)s.animate(u,h,t.easing).animate(d,h,t.easing);s.animate(u,h,t.easing).animate(c,h/2,t.easing).queue(e),k.effects.unshift(s,p,1+r)}),k.effects.define("slide","show",function(t,e){var i,s,n=k(this),o={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},a=t.mode,r=t.direction||"left",h="up"===r||"down"===r?"top":"left",l="up"===r||"left"===r,c=t.distance||n["top"==h?"outerHeight":"outerWidth"](!0),u={};k.effects.createPlaceholder(n),i=n.cssClip(),s=n.position()[h],u[h]=(l?-1:1)*c+s,u.clip=n.cssClip(),u.clip[o[r][1]]=u.clip[o[r][0]],"show"===a&&(n.cssClip(u.clip),n.css(h,u[h]),u.clip=i,u[h]=s),n.animate(u,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),t=!1!==k.uiBackCompat?k.effects.define("transfer",function(t,e){k(this).transfer(t,e)}):t});

/**
 * jQuery.browser.mobile will be true if the browser is a mobile device
 **/
(jQuery.browser=jQuery.browser||{}).mobile=(/android|webos|iphone|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())) 
	&& screen.width < 940;
/*!
 * jQuery Mousewheel 3.1.13
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 */

(function (factory) {
    if ( typeof define === 'function' && define.amd ) {
        // AMD. Register as an anonymous module.
        define(['jquery'], factory);
    } else if (typeof exports === 'object') {
        // Node/CommonJS style for Browserify
        module.exports = factory;
    } else {
        // Browser globals
        factory(jQuery);
    }
}(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, false );
                }
            } else {
                this.onmousewheel = handler;
            }
            // Store the line height and page height for this particular element
            $.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, false );
                }
            } else {
                this.onmousewheel = null;
            }
            // Clean up the data we added to the element
            $.removeData(this, 'mousewheel-line-height');
            $.removeData(this, 'mousewheel-page-height');
        },

        getLineHeight: function(elem) {
            var $elem = $(elem),
                $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
            if (!$parent.length) {
                $parent = $('body');
            }
            return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
        },

        getPageHeight: function(elem) {
            return $(elem).height();
        },

        settings: {
            adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
            normalizeOffset: true  // calls getBoundingClientRect for each event
        }
    };

    $.fn.extend({
        mousewheel: function(fn) {
            return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
        },

        unmousewheel: function(fn) {
            return this.unbind('mousewheel', fn);
        }
    });


    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;
        event = $.event.fix(orgEvent);
        event.type = 'mousewheel';

        // Old school scrollwheel delta
        if ( 'detail'      in orgEvent ) { deltaY = orgEvent.detail * -1;      }
        if ( 'wheelDelta'  in orgEvent ) { deltaY = orgEvent.wheelDelta;       }
        if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY;      }
        if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }

        // Firefox < 17 horizontal scrolling related to DOMMouseScroll event
        if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
            deltaX = deltaY * -1;
            deltaY = 0;
        }

        // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
        delta = deltaY === 0 ? deltaX : deltaY;

        // New school wheel delta (wheel event)
        if ( 'deltaY' in orgEvent ) {
            deltaY = orgEvent.deltaY * -1;
            delta  = deltaY;
        }
        if ( 'deltaX' in orgEvent ) {
            deltaX = orgEvent.deltaX;
            if ( deltaY === 0 ) { delta  = deltaX * -1; }
        }

        // No change actually happened, no reason to go any further
        if ( deltaY === 0 && deltaX === 0 ) { return; }

        // Need to convert lines and pages to pixels if we aren't already in pixels
        // There are three delta modes:
        //   * deltaMode 0 is by pixels, nothing to do
        //   * deltaMode 1 is by lines
        //   * deltaMode 2 is by pages
        if ( orgEvent.deltaMode === 1 ) {
            var lineHeight = $.data(this, 'mousewheel-line-height');
            delta  *= lineHeight;
            deltaY *= lineHeight;
            deltaX *= lineHeight;
        } else if ( orgEvent.deltaMode === 2 ) {
            var pageHeight = $.data(this, 'mousewheel-page-height');
            delta  *= pageHeight;
            deltaY *= pageHeight;
            deltaX *= pageHeight;
        }

        // Store lowest absolute delta to normalize the delta values
        absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );

        if ( !lowestDelta || absDelta < lowestDelta ) {
            lowestDelta = absDelta;

            // Adjust older deltas if necessary
            if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
                lowestDelta /= 40;
            }
        }

        // Adjust older deltas if necessary
        if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
            // Divide all the things by 40!
            delta  /= 40;
            deltaX /= 40;
            deltaY /= 40;
        }

        // Get a whole, normalized value for the deltas
        delta  = Math[ delta  >= 1 ? 'floor' : 'ceil' ](delta  / lowestDelta);
        deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
        deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);

        // Normalise offsetX and offsetY properties
        if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
            var boundingRect = this.getBoundingClientRect();
            offsetX = event.clientX - boundingRect.left;
            offsetY = event.clientY - boundingRect.top;
        }

        // Add information to the event object
        event.deltaX = deltaX;
        event.deltaY = deltaY;
        event.deltaFactor = lowestDelta;
        event.offsetX = offsetX;
        event.offsetY = offsetY;
        // Go ahead and set deltaMode to 0 since we converted to pixels
        // Although this is a little odd since we overwrite the deltaX/Y
        // properties with normalized deltas.
        event.deltaMode = 0;

        // Add event and delta to the front of the arguments
        args.unshift(event, delta, deltaX, deltaY);

        // Clearout lowestDelta after sometime to better
        // handle multiple device types that give different
        // a different lowestDelta
        // Ex: trackpad = 3 and mouse wheel = 120
        if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
        nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);

        return ($.event.dispatch || $.event.handle).apply(this, args);
    }

    function nullLowestDelta() {
        lowestDelta = null;
    }

    function shouldAdjustOldDeltas(orgEvent, absDelta) {
        // If this is an older event and the delta is divisable by 120,
        // then we are assuming that the browser is treating this as an
        // older mouse wheel event and that we should divide the deltas
        // by 40 to try and get a more usable deltaFactor.
        // Side note, this actually impacts the reported scroll distance
        // in older browsers and can cause scrolling to be slower than native.
        // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
        return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
    }

}));
/************************
jquery-timepicker v1.4.13
http://jonthornton.github.com/jquery-timepicker/

requires jQuery 1.7+
************************/


(function (factory) {
    if (typeof exports === "object" && exports &&
        typeof module === "object" && module && module.exports === exports) {
        // Browserify. Attach to jQuery module.
        factory(require("jquery"));
    } else if (typeof define === 'function' && define.amd) {
		// AMD. Register as an anonymous module.
		define(['jquery'], factory);
	} else {
		// Browser globals
		factory(jQuery);
	}
}(function ($) {
	var _baseDate = _generateBaseDate();
	var _ONE_DAY = 86400;
	var _lang = {
		am: 'am',
		pm: 'pm',
		AM: 'AM',
		PM: 'PM',
		decimal: '.',
		mins: 'mins',
		hr: 'hr',
		hrs: 'hrs'
	};

	var methods =
	{
		init: function(options)
		{
			return this.each(function()
			{
				var self = $(this);

				// pick up settings from data attributes
				var attributeOptions = [];
				for (var key in $.fn.timepicker.defaults) {
					if (self.data(key))  {
						attributeOptions[key] = self.data(key);
					}
				}

				var settings = $.extend({}, $.fn.timepicker.defaults, attributeOptions, options);

				if (settings.lang) {
					_lang = $.extend(_lang, settings.lang);
				}

				settings = _parseSettings(settings);
				self.data('timepicker-settings', settings);
				self.addClass('ui-timepicker-input');

				if (settings.useSelect) {
					_render(self);
				} else {
					self.prop('autocomplete', 'off');
					self.on('click.timepicker focus.timepicker', methods.show);
					self.on('change.timepicker', _formatValue);
					self.on('keydown.timepicker', _keydownhandler);
					self.on('keyup.timepicker', _keyuphandler);

					_formatValue.call(self.get(0));
				}
			});
		},

		show: function(e)
		{
			var self = $(this);
			var settings = self.data('timepicker-settings');

			if (e) {
				if (!settings.showOnFocus) {
					return true;
				}

				e.preventDefault();
			}

			if (settings.useSelect) {
				self.data('timepicker-list').focus();
				return;
			}

			if (_hideKeyboard(self)) {
				// block the keyboard on mobile devices
				self.blur();
			}

			var list = self.data('timepicker-list');

			// check if input is readonly
			if (self.prop('readonly')) {
				return;
			}

			// check if list needs to be rendered
			if (!list || list.length === 0 || typeof settings.durationTime === 'function') {
				_render(self);
				list = self.data('timepicker-list');
			}

			if (_isVisible(list)) {
				return;
			}

			// make sure other pickers are hidden
			methods.hide();

			// position the dropdown relative to the input
			list.show();
			var listOffset = {};

			if (settings.orientation == 'rtl') {
				// right-align the dropdown
				listOffset.left = self.offset().left + self.outerWidth() - list.outerWidth() + parseInt(list.css('marginLeft').replace('px', ''), 10);
			} else {
				// left-align the dropdown
				listOffset.left = self.offset().left + parseInt(list.css('marginLeft').replace('px', ''), 10);
			}

			if ((self.offset().top + self.outerHeight(true) + list.outerHeight()) > $(window).height() + $(window).scrollTop()) {
				// position the dropdown on top
				list.addClass('ui-timepicker-positioned-top');
				listOffset.top = self.offset().top - list.outerHeight() + parseInt(list.css('marginTop').replace('px', ''), 10);
			} else {
				// put it under the input
				list.removeClass('ui-timepicker-positioned-top');
				listOffset.top = self.offset().top + self.outerHeight() + parseInt(list.css('marginTop').replace('px', ''), 10);
			}

			list.offset(listOffset);

			// position scrolling
			var selected = list.find('.ui-timepicker-selected');

			if (!selected.length) {
				if (_getTimeValue(self)) {
					selected = _findRow(self, list, _time2int(_getTimeValue(self)));
				} else if (settings.scrollDefault) {
					selected = _findRow(self, list, settings.scrollDefault);
				}
			}

			if (selected && selected.length) {
				var topOffset = list.scrollTop() + selected.position().top - selected.outerHeight();
				list.scrollTop(topOffset);
			} else {
				list.scrollTop(0);
			}

			// attach close handlers
			$(document).on('touchstart.ui-timepicker mousedown.ui-timepicker', _closeHandler);
			if (settings.closeOnWindowScroll) {
				$(document).on('scroll.ui-timepicker', _closeHandler);
			}

			self.trigger('showTimepicker');

			return this;
		},

		hide: function(e)
		{
			var self = $(this);
			var settings = self.data('timepicker-settings');

			if (settings && settings.useSelect) {
				self.blur();
			}

			$('.ui-timepicker-wrapper').each(function() {
				var list = $(this);
				if (!_isVisible(list)) {
					return;
				}

				var self = list.data('timepicker-input');
				var settings = self.data('timepicker-settings');

				if (settings && settings.selectOnBlur) {
					_selectValue(self);
				}

				list.hide();
				self.trigger('hideTimepicker');
			});

			return this;
		},

		option: function(key, value)
		{
			return this.each(function(){
				var self = $(this);
				var settings = self.data('timepicker-settings');
				var list = self.data('timepicker-list');

				if (typeof key == 'object') {
					settings = $.extend(settings, key);

				} else if (typeof key == 'string' && typeof value != 'undefined') {
					settings[key] = value;

				} else if (typeof key == 'string') {
					return settings[key];
				}

				settings = _parseSettings(settings);

				self.data('timepicker-settings', settings);

				if (list) {
					list.remove();
					self.data('timepicker-list', false);
				}

				if (settings.useSelect) {
					_render(self);
				}
			});
		},

		getSecondsFromMidnight: function()
		{
			return _time2int(_getTimeValue(this));
		},

		getTime: function(relative_date)
		{
			var self = this;

			var time_string = _getTimeValue(self);
			if (!time_string) {
				return null;
			}

			if (!relative_date) {
				relative_date = new Date();
			}
			var offset = _time2int(time_string);

			// construct a Date with today's date, and offset's time
			var time = new Date(relative_date);
			time.setHours(offset / 3600);
			time.setMinutes(offset % 3600 / 60);
			time.setSeconds(offset % 60);
			time.setMilliseconds(0);

			return time;
		},

		setTime: function(value)
		{
			var self = this;
			var settings = self.data('timepicker-settings');

			if (settings.forceRoundTime) {
				var prettyTime = _roundAndFormatTime(value, settings)
			} else {
				var prettyTime = _int2time(_time2int(value), settings.timeFormat);
			}

			_setTimeValue(self, prettyTime);
			if (self.data('timepicker-list')) {
				_setSelected(self, self.data('timepicker-list'));
			}

			return this;
		},

		remove: function()
		{
			var self = this;

			// check if this element is a timepicker
			if (!self.hasClass('ui-timepicker-input')) {
				return;
			}

			var settings = self.data('timepicker-settings');
			self.removeAttr('autocomplete', 'off');
			self.removeClass('ui-timepicker-input');
			self.removeData('timepicker-settings');
			self.off('.timepicker');

			// timepicker-list won't be present unless the user has interacted with this timepicker
			if (self.data('timepicker-list')) {
				self.data('timepicker-list').remove();
			}

			if (settings.useSelect) {
				self.show();
			}

			self.removeData('timepicker-list');

			return this;
		}
	};

	// private methods

	function _isVisible(elem)
	{
		var el = elem[0];
		return el.offsetWidth > 0 && el.offsetHeight > 0;
	}

	function _parseSettings(settings)
	{
		if (settings.minTime) {
			settings.minTime = _time2int(settings.minTime);
		}

		if (settings.maxTime) {
			settings.maxTime = _time2int(settings.maxTime);
		}

		if (settings.durationTime && typeof settings.durationTime !== 'function') {
			settings.durationTime = _time2int(settings.durationTime);
		}

		if (settings.scrollDefault == 'now') {
			settings.scrollDefault = _time2int(new Date());
		} else if (settings.scrollDefault) {
			settings.scrollDefault = _time2int(settings.scrollDefault);
		} else if (settings.minTime) {
			settings.scrollDefault = settings.minTime;
		}

		if (settings.scrollDefault) {
			settings.scrollDefault = _roundTime(settings.scrollDefault, settings);
		}

		if ($.type(settings.timeFormat) === "string" && settings.timeFormat.match(/[gh]/)) {
			settings._twelveHourTime = true;
		}

		if (settings.disableTimeRanges.length > 0) {
			// convert string times to integers
			for (var i in settings.disableTimeRanges) {
				settings.disableTimeRanges[i] = [
					_time2int(settings.disableTimeRanges[i][0]),
					_time2int(settings.disableTimeRanges[i][1])
				];
			}

			// sort by starting time
			settings.disableTimeRanges = settings.disableTimeRanges.sort(function(a, b){
				return a[0] - b[0];
			});

			// merge any overlapping ranges
			for (var i = settings.disableTimeRanges.length-1; i > 0; i--) {
				if (settings.disableTimeRanges[i][0] <= settings.disableTimeRanges[i-1][1]) {
					settings.disableTimeRanges[i-1] = [
						Math.min(settings.disableTimeRanges[i][0], settings.disableTimeRanges[i-1][0]),
						Math.max(settings.disableTimeRanges[i][1], settings.disableTimeRanges[i-1][1])
					];
					settings.disableTimeRanges.splice(i, 1);
				}
			}
		}

		return settings;
	}

	function _render(self)
	{
		var settings = self.data('timepicker-settings');
		var list = self.data('timepicker-list');

		if (list && list.length) {
			list.remove();
			self.data('timepicker-list', false);
		}

		if (settings.useSelect) {
			list = $('<select />', { 'class': 'ui-timepicker-select' });
			var wrapped_list = list;
		} else {
			list = $('<ul />', { 'class': 'ui-timepicker-list' });

			var wrapped_list = $('<div />', { 'class': 'ui-timepicker-wrapper', 'tabindex': -1 });
			wrapped_list.css({'display':'none', 'position': 'absolute' }).append(list);
		}

		if (settings.noneOption) {
			if (settings.noneOption === true) {
				settings.noneOption = (settings.useSelect) ? 'Time...' : 'None';
			}

			if ($.isArray(settings.noneOption)) {
				for (var i in settings.noneOption) {
					if (parseInt(i, 10) == i){
						var noneElement = _generateNoneElement(settings.noneOption[i], settings.useSelect);
						list.append(noneElement);
					}
				}
			} else {
				var noneElement = _generateNoneElement(settings.noneOption, settings.useSelect);
				list.append(noneElement);
			}
		}

		if (settings.className) {
			wrapped_list.addClass(settings.className);
		}

		if ((settings.minTime !== null || settings.durationTime !== null) && settings.showDuration) {
			wrapped_list.addClass('ui-timepicker-with-duration');
			wrapped_list.addClass('ui-timepicker-step-'+settings.step);
		}

		var durStart = settings.minTime;
		if (typeof settings.durationTime === 'function') {
			durStart = _time2int(settings.durationTime());
		} else if (settings.durationTime !== null) {
			durStart = settings.durationTime;
		}
		var start = (settings.minTime !== null) ? settings.minTime : 0;
		var end = (settings.maxTime !== null) ? settings.maxTime : (start + _ONE_DAY - 1);

		if (end <= start) {
			// make sure the end time is greater than start time, otherwise there will be no list to show
			end += _ONE_DAY;
		}

		if (end === _ONE_DAY-1 && $.type(settings.timeFormat) === "string" && settings.timeFormat.indexOf('H') !== -1) {
			// show a 24:00 option when using military time
			end = _ONE_DAY;
		}

		var dr = settings.disableTimeRanges;
		var drCur = 0;
		var drLen = dr.length;

		for (var i=start; i <= end; i += settings.step*60) {
			var timeInt = i;
			var timeString = _int2time(timeInt, settings.timeFormat);

			if (settings.useSelect) {
				var row = $('<option />', { 'value': timeString });
				row.text(timeString);
			} else {
				var row = $('<li />');
				row.data('time', (timeInt <= 86400 ? timeInt : timeInt % 86400));
				row.text(timeString);
			}

			if ((settings.minTime !== null || settings.durationTime !== null) && settings.showDuration) {
				var durationString = _int2duration(i - durStart, settings.step);
				if (settings.useSelect) {
					row.text(row.text()+' ('+durationString+')');
				} else {
					var duration = $('<span />', { 'class': 'ui-timepicker-duration' });
					duration.text(' ('+durationString+')');
					row.append(duration);
				}
			}

			if (drCur < drLen) {
				if (timeInt >= dr[drCur][1]) {
					drCur += 1;
				}

				if (dr[drCur] && timeInt >= dr[drCur][0] && timeInt < dr[drCur][1]) {
					if (settings.useSelect) {
						row.prop('disabled', true);
					} else {
						row.addClass('ui-timepicker-disabled');
					}
				}
			}

			list.append(row);
		}

		wrapped_list.data('timepicker-input', self);
		self.data('timepicker-list', wrapped_list);

		if (settings.useSelect) {
			if (self.val()) {
				list.val(_roundAndFormatTime(self.val(), settings));
			}

			list.on('focus', function(){
				$(this).data('timepicker-input').trigger('showTimepicker');
			});
			list.on('blur', function(){
				$(this).data('timepicker-input').trigger('hideTimepicker');
			});
			list.on('change', function(){
				_setTimeValue(self, $(this).val(), 'select');
			});

			_setTimeValue(self, list.val());
			self.hide().after(list);
		} else {
			var appendTo = settings.appendTo;
			if (typeof appendTo === 'string') {
				appendTo = $(appendTo);
			} else if (typeof appendTo === 'function') {
				appendTo = appendTo(self);
			}
			appendTo.append(wrapped_list);
			_setSelected(self, list);

			list.on('mousedown', 'li', function(e) {

				// hack: temporarily disable the focus handler
				// to deal with the fact that IE fires 'focus'
				// events asynchronously
				self.off('focus.timepicker');
				self.on('focus.timepicker-ie-hack', function(){
					self.off('focus.timepicker-ie-hack');
					self.on('focus.timepicker', methods.show);
				});

				if (!_hideKeyboard(self)) {
					self[0].focus();
				}

				// make sure only the clicked row is selected
				list.find('li').removeClass('ui-timepicker-selected');
				$(this).addClass('ui-timepicker-selected');

				if (_selectValue(self)) {
					self.trigger('hideTimepicker');
					wrapped_list.hide();
				}
			});
		}
	}

	function _generateNoneElement(optionValue, useSelect)
	{
		var label, className, value;

		if (typeof optionValue == 'object') {
			label = optionValue.label;
			className = optionValue.className;
			value = optionValue.value;
		} else if (typeof optionValue == 'string') {
			label = optionValue;
		} else {
			$.error('Invalid noneOption value');
		}

		if (useSelect) {
			return $('<option />', {
					'value': value,
					'class': className,
					'text': label
				});
		} else {
			return $('<li />', {
					'class': className,
					'text': label
				}).data('time', value);
		}
	}

	function _roundTime(seconds, settings)
	{
		if (!$.isNumeric(seconds)) {
			seconds = _time2int(seconds);
		}

		if (seconds === null) {
			return null;
		} else {
			var offset = seconds % (settings.step*60); // step is in minutes

			if (offset >= settings.step*30) {
				// if offset is larger than a half step, round up
				seconds += (settings.step*60) - offset;
			} else {
				// round down
				seconds -= offset;
			}

			return seconds;
		}
	}

	function _roundAndFormatTime(seconds, settings)
	{
		seconds = _roundTime(seconds, settings);
		if (seconds !== null) {
			return _int2time(seconds, settings.timeFormat);
		}
	}

	function _generateBaseDate()
	{
		return new Date(1970, 1, 1, 0, 0, 0);
	}

	// event handler to decide whether to close timepicker
	function _closeHandler(e)
	{
		var target = $(e.target);
		var input = target.closest('.ui-timepicker-input');
		if (input.length === 0 && target.closest('.ui-timepicker-wrapper').length === 0) {
			methods.hide();
			$(document).unbind('.ui-timepicker');
		}
	}

	function _hideKeyboard(self)
	{
		var settings = self.data('timepicker-settings');
		return ((window.navigator.msMaxTouchPoints || 'ontouchstart' in document) && settings.disableTouchKeyboard);
	}

	function _findRow(self, list, value)
	{
		if (!value && value !== 0) {
			return false;
		}

		var settings = self.data('timepicker-settings');
		var out = false;
		var halfStep = settings.step*30;

		// loop through the menu items
		list.find('li').each(function(i, obj) {
			var jObj = $(obj);
			if (typeof jObj.data('time') != 'number') {
				return;
			}

			var offset = jObj.data('time') - value;

			// check if the value is less than half a step from each row
			if (Math.abs(offset) < halfStep || offset == halfStep) {
				out = jObj;
				return false;
			}
		});

		return out;
	}

	function _setSelected(self, list)
	{
		list.find('li').removeClass('ui-timepicker-selected');

		var timeValue = _time2int(_getTimeValue(self), self.data('timepicker-settings'));
		if (timeValue === null) {
			return;
		}

		var selected = _findRow(self, list, timeValue);
		if (selected) {

			var topDelta = selected.offset().top - list.offset().top;

			if (topDelta + selected.outerHeight() > list.outerHeight() || topDelta < 0) {
				list.scrollTop(list.scrollTop() + selected.position().top - selected.outerHeight());
			}

			selected.addClass('ui-timepicker-selected');
		}
	}


	function _formatValue(e, origin)
	{
		if (this.value === '' || origin == 'timepicker') {
			return;
		}

		var self = $(this);
		var list = self.data('timepicker-list');

		if (self.is(':focus') && (!e || e.type != 'change')) {
			return;
		}

		var seconds = _time2int(this.value);

		if (seconds === null) {
			self.trigger('timeFormatError');
			return;
		}

		var settings = self.data('timepicker-settings');
		var rangeError = false;
		// check that the time in within bounds
		if (settings.minTime !== null && seconds < settings.minTime) {
			rangeError = true;
		} else if (settings.maxTime !== null && seconds > settings.maxTime) {
			rangeError = true;
		}

		// check that time isn't within disabled time ranges
		$.each(settings.disableTimeRanges, function(){
			if (seconds >= this[0] && seconds < this[1]) {
				rangeError = true;
				return false;
			}
		});

		if (settings.forceRoundTime) {
			var offset = seconds % (settings.step*60); // step is in minutes

			if (offset >= settings.step*30) {
				// if offset is larger than a half step, round up
				seconds += (settings.step*60) - offset;
			} else {
				// round down
				seconds -= offset;
			}
		}

		var prettyTime = _int2time(seconds, settings.timeFormat);

		if (rangeError) {
			if (_setTimeValue(self, prettyTime, 'error')) {
				self.trigger('timeRangeError');
			}
		} else {
			_setTimeValue(self, prettyTime);
		}
	}

	function _getTimeValue(self)
	{
		if (self.is('input')) {
			return self.val();
		} else {
			// use the element's data attributes to store values
			return self.data('ui-timepicker-value');
		}
	}

	function _setTimeValue(self, value, source)
	{
		if (self.is('input')) {
			self.val(value);

			var settings = self.data('timepicker-settings');
			if (settings.useSelect && source != 'select') {
				self.data('timepicker-list').val(_roundAndFormatTime(value, settings));
			}
		}

		if (self.data('ui-timepicker-value') != value) {
			self.data('ui-timepicker-value', value);
			if (source == 'select') {
				self.trigger('selectTime').trigger('changeTime').trigger('change', 'timepicker');
			} else if (source != 'error') {
				self.trigger('changeTime');
			}

			return true;
		} else {
			self.trigger('selectTime');
			return false;
		}
	}

	/*
	*  Keyboard navigation via arrow keys
	*/
	function _keydownhandler(e)
	{
		var self = $(this);
		var list = self.data('timepicker-list');

		if (!list || !_isVisible(list)) {
			if (e.keyCode == 40) {
				// show the list!
				methods.show.call(self.get(0));
				list = self.data('timepicker-list');
				if (!_hideKeyboard(self)) {
					self.focus();
				}
			} else {
				return true;
			}
		}

		switch (e.keyCode) {

			case 13: // return
				if (_selectValue(self)) {
					methods.hide.apply(this);
				}

				e.preventDefault();
				return false;

			case 38: // up
				var selected = list.find('.ui-timepicker-selected');

				if (!selected.length) {
					list.find('li').each(function(i, obj) {
						if ($(obj).position().top > 0) {
							selected = $(obj);
							return false;
						}
					});
					selected.addClass('ui-timepicker-selected');

				} else if (!selected.is(':first-child')) {
					selected.removeClass('ui-timepicker-selected');
					selected.prev().addClass('ui-timepicker-selected');

					if (selected.prev().position().top < selected.outerHeight()) {
						list.scrollTop(list.scrollTop() - selected.outerHeight());
					}
				}

				return false;

			case 40: // down
				selected = list.find('.ui-timepicker-selected');

				if (selected.length === 0) {
					list.find('li').each(function(i, obj) {
						if ($(obj).position().top > 0) {
							selected = $(obj);
							return false;
						}
					});

					selected.addClass('ui-timepicker-selected');
				} else if (!selected.is(':last-child')) {
					selected.removeClass('ui-timepicker-selected');
					selected.next().addClass('ui-timepicker-selected');

					if (selected.next().position().top + 2*selected.outerHeight() > list.outerHeight()) {
						list.scrollTop(list.scrollTop() + selected.outerHeight());
					}
				}

				return false;

			case 27: // escape
				list.find('li').removeClass('ui-timepicker-selected');
				methods.hide();
				break;

			case 9: //tab
				methods.hide();
				break;

			default:
				return true;
		}
	}

	/*
	*	Time typeahead
	*/
	function _keyuphandler(e)
	{
		var self = $(this);
		var list = self.data('timepicker-list');

		if (!list || !_isVisible(list)) {
			return true;
		}

		if (!self.data('timepicker-settings').typeaheadHighlight) {
			list.find('li').removeClass('ui-timepicker-selected');
			return true;
		}

		switch (e.keyCode) {

			case 96: // numpad numerals
			case 97:
			case 98:
			case 99:
			case 100:
			case 101:
			case 102:
			case 103:
			case 104:
			case 105:
			case 48: // numerals
			case 49:
			case 50:
			case 51:
			case 52:
			case 53:
			case 54:
			case 55:
			case 56:
			case 57:
			case 65: // a
			case 77: // m
			case 80: // p
			case 186: // colon
			case 8: // backspace
			case 46: // delete
				_setSelected(self, list);
				break;

			default:
				// list.find('li').removeClass('ui-timepicker-selected');
				return;
		}
	}

	function _selectValue(self)
	{
		var settings = self.data('timepicker-settings');
		var list = self.data('timepicker-list');
		var timeValue = null;

		var cursor = list.find('.ui-timepicker-selected');

		if (cursor.hasClass('ui-timepicker-disabled')) {
			return false;
		}

		if (cursor.length) {
			// selected value found
			timeValue = cursor.data('time');
		}

		if (timeValue !== null) {
			if (typeof timeValue == 'string') {
				self.val(timeValue);
			} else {
				var timeString = _int2time(timeValue, settings.timeFormat);
				_setTimeValue(self, timeString, 'select');
			}
		}

		//self.trigger('change').trigger('selectTime');
		return true;
	}

	function _int2duration(seconds, step)
	{
		seconds = Math.abs(seconds);
		var minutes = Math.round(seconds/60),
			duration = [],
			hours, mins;

		if (minutes < 60) {
			// Only show (x mins) under 1 hour
			duration = [minutes, _lang.mins];
		} else {
			hours = Math.floor(minutes/60);
			mins = minutes%60;

			// Show decimal notation (eg: 1.5 hrs) for 30 minute steps
			if (step == 30 && mins == 30) {
				hours += _lang.decimal + 5;
			}

			duration.push(hours);
			duration.push(hours == 1 ? _lang.hr : _lang.hrs);

			// Show remainder minutes notation (eg: 1 hr 15 mins) for non-30 minute steps
			// and only if there are remainder minutes to show
			if (step != 30 && mins) {
				duration.push(mins);
				duration.push(_lang.mins);
			}
		}

		return duration.join(' ');
	}

	function _int2time(seconds, format)
	{
		if (seconds === null) {
			return;
		}

		var time = new Date(_baseDate.valueOf() + (seconds*1000));

		if (isNaN(time.getTime())) {
			return;
		}

		if ($.type(format) === "function") {
			return format(time);
		}

		var output = '';
		var hour, code;
		for (var i=0; i<format.length; i++) {

			code = format.charAt(i);
			switch (code) {

				case 'a':
					output += (time.getHours() > 11) ? _lang.pm : _lang.am;
					break;

				case 'A':
					output += (time.getHours() > 11) ? _lang.pm.toUpperCase() : _lang.am.toUpperCase();
					break;

				case 'g':
					hour = time.getHours() % 12;
					output += (hour === 0) ? '12' : hour;
					break;

				case 'G':
					output += time.getHours();
					break;

				case 'h':
					hour = time.getHours() % 12;

					if (hour !== 0 && hour < 10) {
						hour = '0'+hour;
					}

					output += (hour === 0) ? '12' : hour;
					break;

				case 'H':
					hour = time.getHours();
					if (seconds === _ONE_DAY) hour = 24;
					output += (hour > 9) ? hour : '0'+hour;
					break;

				case 'i':
					var minutes = time.getMinutes();
					output += (minutes > 9) ? minutes : '0'+minutes;
					break;

				case 's':
					seconds = time.getSeconds();
					output += (seconds > 9) ? seconds : '0'+seconds;
					break;

				case '\\':
					// escape character; add the next character and skip ahead
					i++;
					output += format.charAt(i);
					break;

				default:
					output += code;
			}
		}

		return output;
	}

	function _time2int(timeString, settings)
	{
		if (timeString === '') return null;
		if (!timeString || timeString+0 == timeString) return timeString;

		if (typeof(timeString) == 'object') {
			return timeString.getHours()*3600 + timeString.getMinutes()*60 + timeString.getSeconds();
		}

		timeString = timeString.toLowerCase();

		// if the last character is an "a" or "p", add the "m"
		if (timeString.slice(-1) == 'a' || timeString.slice(-1) == 'p') {
			timeString += 'm';
		}

		// try to parse time input
		var pattern = new RegExp('^([0-2]?[0-9])\\W?([0-5][0-9])?\\W?([0-5][0-9])?\\s*('+_lang.am+'|'+_lang.pm+')?$');
		var time = timeString.match(pattern);
		if (!time) {
			return null;
		}

		var hour = parseInt(time[1]*1, 10);
		var ampm = time[4];
		var hours = hour;

		if (hour <= 12 && ampm) {
			if (hour == 12) {
				hours = (time[4] == _lang.pm) ? 12 : 0;
			} else {
				hours = (hour + (time[4] == _lang.pm ? 12 : 0));
			}
		}

		var minutes = ( time[2]*1 || 0 );
		var seconds = ( time[3]*1 || 0 );
		var timeInt = hours*3600 + minutes*60 + seconds;

		// if no am/pm provided, intelligently guess based on the scrollDefault
		if (!ampm && settings && settings._twelveHourTime && settings.scrollDefault) {
			var delta = timeInt - settings.scrollDefault;
			if (delta < 0 && delta >= _ONE_DAY / -2) {
				timeInt = (timeInt + (_ONE_DAY / 2)) % _ONE_DAY;
			}
		}

		return timeInt
	}

	function _pad2(n) {
		return ("0" + n).slice(-2);
	}

	// Plugin entry
	$.fn.timepicker = function(method)
	{
		if (!this.length) return this;
		if (methods[method]) {
			// check if this element is a timepicker
			if (!this.hasClass('ui-timepicker-input')) {
				return this;
			}
			return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
		}
		else if(typeof method === "object" || !method) { return methods.init.apply(this, arguments); }
		else { $.error("Method "+ method + " does not exist on jQuery.timepicker"); }
	};
	// Global defaults
	$.fn.timepicker.defaults = {
		className: null,
		minTime: null,
		maxTime: null,
		durationTime: null,
		step: 30,
		showDuration: false,
		showOnFocus: true,
		timeFormat: 'g:ia',
		scrollDefault: null,
		selectOnBlur: false,
		disableTouchKeyboard: false,
		forceRoundTime: false,
		appendTo: 'body',
		orientation: 'ltr',
		disableTimeRanges: [],
		closeOnWindowScroll: false,
		typeaheadHighlight: true,
		noneOption: false
	};
}));

/*! jQuery Validation Plugin - v1.13.0 - 7/1/2014
 * http://jqueryvalidation.org/
 * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.validateDelegate(":submit","click",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(b.target).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(b.target).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.submit(function(b){function d(){var d;return c.settings.submitHandler?(c.submitButton&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c;return a(this[0]).is("form")?b=this.validate().form():(b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b})),b},removeAttrs:function(b){var c={},d=this;return a.each(b.split(/\s/),function(a,b){c[b]=d.attr(b),d.removeAttr(b)}),c},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){return!!a.trim(""+a(b).val())},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(a,b){(9!==b.which||""!==this.elementValue(a))&&(a.name in this.submitted||a===this.lastElement)&&this.element(a)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this[0].form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!this.is(e.ignore)&&e[d].call(c,this[0],b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']","focusin focusout keyup",b).validateDelegate("select, option, [type='radio'], [type='checkbox']","click",b),this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler),a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c=this.clean(b),d=this.validationTargetFor(c),e=!0;return this.lastElement=d,void 0===d?delete this.invalid[c.name]:(this.prepareElement(d),this.currentElements=a(d),e=this.check(d)!==!1,e?delete this.invalid[d.name]:this.invalid[d.name]=!0),a(b).attr("aria-invalid",!e),this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),e},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue").removeAttr("aria-invalid")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d=a(b),e=b.type;return"radio"===e||"checkbox"===e?a("input[name='"+b.name+"']:checked").val():"number"===e&&"undefined"!=typeof b.validity?b.validity.badInput?!1:d.val():(c=d.val(),"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f=a(b).rules(),g=a.map(f,function(a,b){return b}).length,h=!1,i=this.elementValue(b);for(d in f){e={method:d,parameters:f[d]};try{if(c=a.validator.methods[d].call(this,i,b,e.parameters),"dependency-mismatch"===c&&1===g){h=!0;continue}if(h=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(j){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",j),j}}if(!h)return this.objectLength(f)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a];return void 0},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customDataMessage(b,c),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(b,c){var d=this.defaultMessage(b,c.method),e=/\$?\{(\d+)\}/g;"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({message:d,element:b,method:c.method}),this.errorMap[b.name]=d,this.submitted[b.name]=d},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g=this.errorsFor(b),h=this.idOrName(b),i=a(b).attr("aria-describedby");g.length?(g.removeClass(this.settings.validClass).addClass(this.settings.errorClass),g.html(c)):(g=a("<"+this.settings.errorElement+">").attr("id",h+"-error").addClass(this.settings.errorClass).html(c||""),d=g,this.settings.wrapper&&(d=g.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b),g.is("label")?g.attr("for",h):0===g.parents("label[for='"+h+"']").length&&(f=g.attr("id"),i?i.match(new RegExp("\b"+f+"\b"))||(i+=" "+f):i=f,a(b).attr("aria-describedby",i),e=this.groups[b.name],e&&a.each(this.groups,function(b,c){c===e&&a("[name='"+b+"']",this.currentForm).attr("aria-describedby",g.attr("id"))}))),!c&&this.settings.success&&(g.text(""),"string"==typeof this.settings.success?g.addClass(this.settings.success):this.settings.success(g,b)),this.toShow=this.toShow.add(g)},errorsFor:function(b){var c=this.idOrName(b),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+d.replace(/\s+/g,", #")),this.errors().filter(e)},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(a){return this.checkable(a)&&(a=this.findByName(a.name).not(this.settings.ignore)[0]),a},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+b+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),/min|max/.test(c)&&(null===g||/number|range|text/.test(g))&&(d=Number(d)),d||0===d?e[c]=d:g===c&&"range"!==g&&(e[c]=!0);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b);for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),void 0!==d&&(e[c]=d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(b.min&&b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),b.minlength&&b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:a.trim(b).length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||d>=e},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e,f,g=this.previousValue(c);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),g.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=g.message,d="string"==typeof d&&{url:d}||d,g.old===b?g.valid:(g.old=b,e=this,this.startRequest(c),f={},f[c.name]=b,a.ajax(a.extend(!0,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:f,context:e.currentForm,success:function(d){var f,h,i,j=d===!0||"true"===d;e.settings.messages[c.name].remote=g.originalMessage,j?(i=e.formSubmitted,e.prepareElement(c),e.formSubmitted=i,e.successList.push(c),delete e.invalid[c.name],e.showErrors()):(f={},h=d||e.defaultMessage(c,"remote"),f[c.name]=g.message=a.isFunction(h)?h(b):h,e.invalid[c.name]=!0,e.showErrors(f)),g.valid=j,e.stopRequest(c,j)}},d)),"pending")}}}),a.format=function(){throw"$.format has been deprecated. Please use $.validator.format instead."};var b,c={};a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)}),a.extend(a.fn,{validateDelegate:function(b,c,d){return this.bind(c,function(c){var e=a(c.target);return e.is(b)?d.apply(e,arguments):void 0})}})});
var indigitallAlsa = new IndigitallAlsa();

document.addEventListener(
	"onIndigitallInitialized",
	function(){
		indigitallAlsa.indigitall_initialized = true;
		indigitallAlsa.listFunctionsToCallAfterInit.forEach(
			function(functionToCall) {
				functionToCall.execute();
			}
		);
	}
);

function IndigitallAlsa(){


	//---- INDIGITAL CONTROL DE FLUJO ----//
	/*
	El hecho de importar la libreria de indigitall (sdk.min.js) bajo el ambito de didomi,
	hace que sea de los ultimos scripts en ejecutarse.
	Por tanto hay que controlar que, si se hacen llamadas desde las vistas a funciones de indigitall,
	ya exista el objeto indigitall y ya este inicializado.
	Por ello desde las vistas nunca se llamara directamente a estas funciones (ej: indigitallAlsa.indigitall_login()) -->
	sino que simplemente se guardaran en la lista "listFunctionsToCallAfterInit" (ej: ver en step1-main.jsp o cartController.js),
	y ya seran automaticamente invocadas cuando se produzca el evento "onIndigitallInitialized".
	*/

	/**
	 * Tipo de objeto. Almacena una funcion dada y su array de argumentos.
	 * Al invocar a su metodo 'execute' se llamara a la funcion dada.
	 */
	this.FunctionToCallAfterInit = function(functionObject, functionArgs){
		this.functionObject = functionObject,
		this.functionArgs = functionArgs,
		this.execute = function(){
			functionObject.call(indigitallAlsa, functionArgs)
		}
	}

	/**
	 * Variable publica. Lista que contendra objetos de tipo FunctionToCallAfterInit.
	 * Cada vez que se introduzca un objeto FunctionToCallAfterInit,
	 * su funcion sera invocada cuando se complete la llamada a "indigitall.init" que se origina desde cookies_didomi.ftl
	 */
	this.listFunctionsToCallAfterInit = [];


	//---- INDIGITAL INIT ----//

	/**
	 * Variable publica. Flag que indica si se ha podido inicializar Indigitall tras hacer la llamada a indigitall.init()
	 */
	this.indigitall_initialized = false;

	/**
	 * Variable privada. Flag que indica si se ha producido algun error tras hacer la llamada a indigitall.init()
	 */
	var indigitall_error = false;


	/**
	 * Inicializa el objeto de la libreria Indigitall
	 */
	this.indigitall_init = function(indigitallKey){
		indigitall.init({
			appKey:indigitallKey,
			urlDeviceApi:'https://eu2.device-api.indigitall.com/v1',
			workerPath:'/o/Alsa-main-theme/js/indigitall/worker.min.js',
			requestLocation:!0,
			requestPushPermission: !0,
			onError:
				function(){
					indigitall_error = true;
				}
		})
		.then(
			function(response){
				if( indigitall_error){
					console.error("Indigitall - Finish Indigitall initialization with error");
				}else{
					console.log("Indigitall - Finish Indigitall initialization with success");
					setTimeout(
						function(){document.dispatchEvent(new Event("onIndigitallInitialized"))},
						1500
					);
				}
				// En todo caso lanzamos el evento "onIndigitallFinish" al finalizar el init() con o sin exito.
				// Esto se puede usar para evitar conflictos con otras librerias js, por ejemplo Inbenta
				setTimeout(
					function(){document.dispatchEvent(new Event("onIndigitallFinish"))},
					1500
				);
			}
		);
	}


	//---- INDIGITAL LOGIN ----//

	/**
	 * Asocia el dispositivo con Indigitall.
	 * Originalmente se invoca desde utilityMisc/view.jsp cuando el Alsaplus acaba de iniciar sesion
	 * @params args[0]: id del usuario autenticado (numero de tarjeta)
	 */
	this.indigitall_login = function(args){
		var alsaplus_user = args[0];
		if(!alsaplus_user){
			console.error("Indigitall - Couldn't log user. Couldn't get the user id");
		}
		// La funcion indigitall.logIn necesita https
		// WA-4960 Remplazamos la antigua llamada a indigitall.logIn por indigitall.setExternalCode
		indigitall.setExternalCode(
			alsaplus_user,
			(function(device){
				console.log("Indigitall - Successful logged user", alsaplus_user);
			}),
			(function(error){
				console.error("Indigitall - Couldn't log user", alsaplus_user);
			})
		);
	}


	//---- INDIGITAL SUBSCRIPTION FUNCTIONS ----//

	/**
	 * Comprueba si el PLID recibido esta en la lista de indigitallPLIDs,
	 * y en tal caso llama a la funcion subscribe.
	 * En caso contrario no realiza ninguna accion.
	 * @params args[0]: PLID de la pagina desde la que se invoca a esta funcion
	 * @params args[1]: lista de paginas asociadas a topics de indigitall
	 * @params args[2]: lista de topics asociados a paginas de indigitall
	 */
	this.subscribeByPlid = function(args){
		var plid = args[0];
		var str_indigitallPLIDs = args[1];
		var str_indigitalTopics = args[2];
		var indigitallPLIDs = str_indigitallPLIDs.split(":");
		var indigitalTopics = str_indigitalTopics.split(":");
		var index = indigitallPLIDs.indexOf(plid);
		// No se realiza ninguna accion si el PLID (arguments[0]) no pertenece a la lista de paginas (arguments[1]),
		// en cuyo caso index seria -1
		if( index>-1 && typeof(indigitalTopics[index]) !== "undefined" ){
			// observar que indigitall_subscribe recibe un array; tiene que ver con el control de las llamadas desde las vistas
			this.indigitall_subscribe([indigitalTopics[index]]);
		}
		/*
		Ejemplos de correlacion entre PLIDs y topics de indigitall:
			"21664283": "000026", // Pagina de Bonos (principal)
			"27624636": "000027", // Pagina de Bono Tarjeta Descuento
			"21840779": "000028", // Pagina de Bono Comparte
			"21845296": "000029", // Pagina de Bono Viajero Frecuente
			"21664352": "000030", // Pagina de Bono AlsaPass
			"21664339": "000031" // Pagina de Bono Turístico
		*/
	}

	/**
	 * Subscribe el dispositivo en el grupo de interes indicado
	 * @params args[0]: id del grupo de interes al que subscribirse
	 */
	this.indigitall_subscribe = function(args){
		var topicCode = args[0];
		if(!topicCode){
			console.error("Indigitall - Couldn't subscribe to topic. Couldn't get the topic id");
		}
		// La funcion indigitall.topicsList necesita https
		indigitall.topicsList(
			function (topics){
				var topicsAlreadySubscribed = [];
				topics.forEach( function(topic){
					if(topic.subscribed==true){
						topicsAlreadySubscribed.push(topic.code);
					}
				});
				if( !topicsAlreadySubscribed.includes(topicCode) ){
					// La funcion indigitall.topicsSubscribe no funciona desde el entorno local de desarrollo
					indigitall.topicsSubscribe(
						[topicCode],
						(function(){
							console.log("Indigitall - Successful subscribed to topic", topicCode);
						}),
						(function(){
							console.error("Indigitall - Couldn't subscribe to topic", topicCode);
						})
					);
				}else{
					console.log("Indigitall - The device is already subscribed to the topic " + topicCode);
				}
			},
			function(){
				console.error("Indigitall - Couldn't get topics");
			}
		);
	}

	/**
   	 * Desubscribe el dispositivo en el grupo de interes indicado
     * @params args[0]: id del grupo de interes al que desubscribirse
     */
    this.indigitall_unsubscribe = function(args){
    	var topicCode = args[0];
    	if(!topicCode){
    		console.error("Indigitall - Couldn't unsubscribe to topic. Couldn't get the topic id");
    	}
    	// La funcion indigitall.topicsList necesita https
    	indigitall.topicsList(
    		function (topics){
    			var topicsAlreadySubscribed = [];
    			topics.forEach( function(topic){
    				if(topic.subscribed==true){
    					topicsAlreadySubscribed.push(topic.code);
    				}
    			});
    			if(topicsAlreadySubscribed.includes(topicCode) ){
    				// La funcion indigitall.topicsUnsubscribe no funciona desde el entorno local de desarrollo
    				indigitall.topicsUnsubscribe(
    					[topicCode],
    					(function(){
    						console.log("Indigitall - Successful unsubscribed to topic", topicCode);
						}),
						(function(){
							console.error("Indigitall - Couldn't unsubscribe to topic", topicCode);
						})
					);
				}else{
					console.log("Indigitall - The device is already unsubscribed to the topic " + topicCode);
				}
			},
			function(){
				console.error("Indigitall - Couldn't get topics");
			}
		);
	}

	//----- INDIGITALL VOUCHERS FUNCTIONS -----//

    /**
     *
     */
    this.indigitall_beforeUnloadPage = function(args){

        var eventCode = "abandono_compra_bono";
        var customData = {
            origin: args[0],
            destination: args[1]
        };

        var frecuency = 7 * (24 * 3600 * 1000); // minimun time between events (in milliseconds)

        if (indigitall && Notification && Notification.permission === "granted") {

            var prevEventSentAt = parseInt(localStorage.getItem("indigitall.custom." + eventCode) || "0", 10);
            var now = (new Date()).getTime();

            if (now > prevEventSentAt + frecuency) {

                localStorage.setItem("indigitall.custom." + eventCode, now);

                indigitall.sendCustomEvent({
                    eventType: eventCode,
                    customData: customData,
                    async: false,
                });
            }
        }
    }

}

// IMPORTANTE: Antes de cargar de jQueryUI vamos a declarar alias sobre los componentes de Bootstrap (que ya han sido cargados por Liferay)
jQuery.fn.bsalert=jQuery.fn.alert,jQuery.fn.bsbutton=jQuery.fn.button,jQuery.fn.bscarousel=jQuery.fn.carousel,jQuery.fn.bscollapse=jQuery.fn.collapse,jQuery.fn.bsdropdown=jQuery.fn.dropdown,jQuery.fn.bsmodal=jQuery.fn.modal,jQuery.fn.bspopover=jQuery.fn.popover,jQuery.fn.bsscrollspy=jQuery.fn.scrollspy,jQuery.fn.bsaffix=jQuery.fn.affix;

jQuery('input[type=file]').change(function(){
	 var filename = jQuery(this).val().split('\\').pop();
	 var idname = jQuery(this).attr('id');
	 jQuery('div.'+idname).find('span').html(filename);
});
/**
 *	Gestiona acordeones accesibles, navegables mediante teclas de dirección. Ejemplo 37 de OpenAjax.
 *	http://www.oaa-accessibility.org/example/37/ 
 *	Utilizado en https://www.alsa.es/experiencia-alsa/planifica-tu-viaje/tarifas-y-descuentos
 */


/*
 * Ejemplo de inicialización:
 *
 *
$(document).ready(function() { 

  var accordion1 = new accordion("accordian1", true);
  // El valor false hace que los paneles salgan desplegados al desplazarse por las pestañas 
}); 
*/

// 
// keyCodes() is an object to contain keycodes needed for the application 
// 
function keyCodes() {
	// Define values for keycodes 
	this.tab = 9;
	this.enter = 13;
	this.esc = 27;

	this.space = 32;
	this.pageup = 33;
	this.pagedown = 34;
	this.end = 35;
	this.home = 36;

	this.left = 37;
	this.up = 38;
	this.right = 39;
	this.down = 40;

} // end keyCodes 

// 
// accordion() is a class constructor to create a ARIA-enabled tab panel widget. 
// 
// @param (id string) id is the id of the div containing the tab panel. 
// 
// @param (accordian boolean) accordian is true if the tab panel should operate 
//         as an accordian; false if a tab panel 
// 
// @return N/A 
// 
// Usage: Requires a div container and children as follows: 
// 
//         1. tabs/accordian headers have class 'tab' 
// 
//         2. panels are divs with class 'panel' 
// 
function accordion(id, accordian) {

	// define the class properties 

	this.panel_id = id; // store the id of the containing div 
	this.accordian = accordian; // true if this is an accordian control 
	this.$panel = $('#' + id); // store the jQuery object for the panel 
	this.keys = new keyCodes(); // keycodes needed for event handlers 
	this.$tabs = this.$panel.find('.tab'); // Array of panel tabs. 
	this.$panels = this.$panel.find('.panel'); // Array of panel. 
	this.animation_speed = 350; // Duración en milisegundos para las animaciones  
	// Bind event handlers 
	this.bindHandlers();

	// Initialize the tab panel 
	this.init();

} // end tabpanel() constructor 

// 
// Function init() is a member function to initialize the tab/accordian panel. Hides all panels. If a tab's 
// aria-selected attribute is true, makes that panel visible; otherwise, makes first panel visible. 
// 
// @return N/A 
// 
accordion.prototype.init = function() {
//		var $tab; // the selected tab - if one is selected 

		$(this.$tabs[0]).attr('tabindex', '0');
		// add aria attributes to the panels 
		//this.$panels.attr('aria-hidden', 'true');

		// get the selected tab 
		//$tab = this.$tabs.filter('[aria-selected="true"]');

//		if ($tab == undefined) {
//			$tab = this.$tabs.first();
//		}

//		// show the panel that the selected tab controls and set aria-hidden to false 
//		this.$panel.find('#' + $tab.attr('aria-controls')).attr('aria-hidden', 'false');

}; // end init() 

// 
// Function switchTabs() is a member function to give focus to a new tab or accordian header. 
// If it's a tab panel, the currently displayed panel is hidden and the panel associated with the new tab 
// is displayed. 
// 
// @param ($curTab obj) $curTab is the jQuery object of the currently selected tab 
// 
// @param ($newTab obj) $newTab is the jQuery object of new tab to switch to 
// 
// @return N/A 
// 
accordion.prototype.switchTabs = function($curTab, $newTab) {

	// Remove the highlighting from the current tab 
	//$curTab.removeClass('focus');

	// remove tab from the tab order and update its aria-selected attribute 
	$curTab.attr('tabindex', '-1').attr('aria-selected', 'false');


	// Highlight the new tab and update its aria-selected attribute 
	$newTab.attr('aria-selected', 'true');

	// If activating new tab/panel, swap the displayed panels 
	if (this.accordian == false) {
		// hide the current tab panel and set aria-hidden to true 
		this.$panel.find('#' + $curTab.attr('aria-controls')).attr('aria-hidden', 'true');

		// update the aria-expanded attribute for the old tab 
		$curTab.attr('aria-expanded', 'false');

		// show the new tab panel and set aria-hidden to false 
		this.$panel.find('#' + $newTab.attr('aria-controls')).attr('aria-hidden', 'false');

		// update the aria-expanded attribute for the new tab 
		$newTab.attr('aria-expanded', 'true');

	}

	// Make new tab navigable 
	$newTab.attr('tabindex', '0');

	// give the new tab focus 
	$newTab.trigger('focus');

}; // end switchTabs() 

// 
// Function togglePanel() is a member function to display or hide the panel 
// associated with an accordian header. Function also binds a keydown handler to the focusable items 
// in the panel when expanding and unbinds the handlers when collapsing. 
// 
// @param ($tab obj) $tab is the jQuery object of the currently selected tab 
// 
// @return N/A 
// 
accordion.prototype.togglePanel = function($tab) {

	$panel = this.$panel.find('#' + $tab.attr('aria-controls'));
	var panels = this.$panels;
	if ($panel.attr('aria-hidden') == 'true') { // Mostrar
		// Cerrar los otros paneles
		panels.slideUp(this.animation_speed, function() {
			panels.attr('aria-hidden', 'true');
		});
		this.$tabs.attr('aria-expanded', 'false');
		
		$panel.slideDown(this.animation_speed, function() {
			$panel.attr('aria-hidden', 'false');
		});

		// update the aria-expanded attribute 
		$tab.attr('aria-expanded', 'true');
		
		
		
	} else {	// Ocultar
		$panel.slideUp(this.animation_speed, function() {
			$panel.attr('aria-hidden', 'true');
		});

		// update the aria-expanded attribute 
		$tab.attr('aria-expanded', 'false');
	}

}; // end togglePanel() 

// 
// Function bindHandlers() is a member function to bind event handlers for the tabs 
// 
// @return N/A 
// 
accordion.prototype.bindHandlers = function() {

	var thisObj = this; // Store the this pointer for reference 

	////////////////////////////// 
	// Bind handlers for the tabs / accordian headers 

	// bind a tab keydown handler 
	this.$tabs.on('keydown', function(e) {
		return thisObj.handleTabKeyDown($(this), e);
	});

	// bind a tab keypress handler 
	this.$tabs.on('keypress', function(e) {
		return thisObj.handleTabKeyPress($(this), e);
	});

	// bind a tab click handler 
	this.$tabs.on("click", function(e) {
		return thisObj.handleTabClick($(this), e);
	});

	// bind a tab focus handler 
	this.$tabs.on('focus', function(e) {
		return thisObj.handleTabFocus($(this), e);
	});

	// bind a tab blur handler 
	this.$tabs.on('blur', function(e) {
		return thisObj.handleTabBlur($(this), e);
	});

	///////////////////////////// 
	// Bind handlers for the panels 

	// bind a keydown handlers for the panel focusable elements 
	this.$panels.on('keydown', function(e) {
		return thisObj.handlePanelKeyDown($(this), e);
	});

	// bind a keypress handler for the panel 
	this.$panels.on('keypress', function(e) {
		return thisObj.handlePanelKeyPress($(this), e);
	});

	// bind a panel click handler 
	this.$panels.on("click", function(e) {
		return thisObj.handlePanelClick($(this), e);
	});

}; // end bindHandlers() 

// 
// Function handleTabKeyDown() is a member function to process keydown events for a tab 
// 
// @param ($tab obj) $tab is the jquery object of the tab being processed 
// 
// @paran (e obj) e is the associated event object 
// 
// @return (boolean) Returns true if propagating; false if consuming event 
// 
accordion.prototype.handleTabKeyDown = function($tab, e) {

	if (e.altKey) {
		// do nothing 
		return true;
	}

	switch (e.keyCode) {
		case this.keys.enter:
		case this.keys.space:
			{

				// Only process if this is an accordian widget 
				if (this.accordian == true) {
					// display or collapse the panel 
					this.togglePanel($tab);

					e.stopPropagation();
					return false;
				}

				return true;
			}
		case this.keys.left:
		case this.keys.up:
			{

				var thisObj = this;
				var $prevTab; // holds jQuery object of tab from previous pass 
				var $newTab; // the new tab to switch to 

				if (e.ctrlKey) {
					// Ctrl+arrow moves focus from panel content to the open 
					// tab/accordian header. 
				} else {
					var curNdx = this.$tabs.index($tab);

					if (curNdx == 0) {
						// tab is the first one: 
						// set newTab to last tab 
						$newTab = this.$tabs.last();
					} else {
						// set newTab to previous 
						$newTab = this.$tabs.eq(curNdx - 1);
					}

					// switch to the new tab 
					this.switchTabs($tab, $newTab);
				}

				e.stopPropagation();
				return false;
			}
		case this.keys.right:
		case this.keys.down:
			{

				var $newTab; // the new tab to switch to 

				var curNdx = this.$tabs.index($tab);

				if (curNdx == this.$tabs.length - 1) {
					// tab is the last one: 
					// set newTab to first tab 
					$newTab = this.$tabs.first();
				} else {
					// set newTab to next tab 
					$newTab = this.$tabs.eq(curNdx + 1);
				}

				// switch to the new tab 
				this.switchTabs($tab, $newTab);

				e.stopPropagation();
				return false;
			}
		case this.keys.home:
			{

				// switch to the first tab 
				this.switchTabs($tab, this.$tabs.first());

				e.stopPropagation();
				return false;
			}
		case this.keys.end:
			{

				// switch to the last tab 
				this.switchTabs($tab, this.$tabs.last());

				e.stopPropagation();
				return false;
			}
	}
}; // end handleTabKeyDown() 

// 
// Function handleTabKeyPress() is a member function to process keypress events for a tab. 
// 
// 
// @param ($tab obj) $tab is the jquery object of the tab being processed 
// 
// @paran (e obj) e is the associated event object 
// 
// @return (boolean) Returns true if propagating; false if consuming event 
// 
accordion.prototype.handleTabKeyPress = function($tab, e) {

	if (e.altKey) {
		// do nothing 
		return true;
	}

	switch (e.keyCode) {
		case this.keys.enter:
		case this.keys.space:
		case this.keys.left:
		case this.keys.up:
		case this.keys.right:
		case this.keys.down:
		case this.keys.home:
		case this.keys.end:
			{
				e.stopPropagation();
				return false;
			}
		case this.keys.pageup:
		case this.keys.pagedown:
			{

				// The tab keypress handler must consume pageup and pagedown 
				// keypresses to prevent Firefox from switching tabs 
				// on ctrl+pageup and ctrl+pagedown 

				if (!e.ctrlKey) {
					return true;
				}

				e.stopPropagation();
				return false;
			}
	}

	return true;

}; // end handleTabKeyPress() 

// 
// Function handleTabClick() is a member function to process click events for tabs 
// 
// @param ($tab object) $tab is the jQuery object of the tab being processed 
// 
// @paran (e object) e is the associated event object 
// 
// @return (boolean) returns false 
// 
accordion.prototype.handleTabClick = function($tab, e) {

	// make clicked tab navigable 
	$tab.attr('tabindex', '0').attr('aria-selected', 'true');

	// remove all tabs from the tab order and update their aria-selected attribute 
	this.$tabs.not($tab).attr('tabindex', '-1').attr('aria-selected', 'false');

	// Expand the new panel 
	this.togglePanel($tab);

	e.stopPropagation();
	return false;

}; // end handleTabClick() 

// 
// Function handleTabFocus() is a member function to process focus events for tabs 
// 
// @param ($tab object) $tab is the jQuery object of the tab being processed 
// 
// @paran (e object) e is the associated event object 
// 
// @return (boolean) returns true 
// 
accordion.prototype.handleTabFocus = function($tab, e) {

	// Add the focus class to the tab 
	//$tab.addClass('focus');

	return true;

}; // end handleTabFocus() 

// 
// Function handleTabBlur() is a member function to process blur events for tabs 
// 
// @param ($tab object) $tab is the jQuery object of the tab being processed 
// 
// @paran (e object) e is the associated event object 
// 
// @return (boolean) returns true 
// 
accordion.prototype.handleTabBlur = function($tab, e) {

	// Remove the focus class to the tab 
	//$tab.removeClass('focus');

	return true;

}; // end handleTabBlur() 


///////////////////////////////////////////////////////// 
// Panel Event handlers 
// 

// 
// Function handlePanelKeyDown() is a member function to process keydown events for a panel 
// 
// @param ($panel obj) $panel is the jquery object of the panel being processed 
// 
// @paran (e obj) e is the associated event object 
// 
// @return (boolean) Returns true if propagating; false if consuming event 
// 
accordion.prototype.handlePanelKeyDown = function($panel, e) {

	if (e.altKey) {
		// do nothing 
		return true;
	}

	switch (e.keyCode) {
		case this.keys.tab:
			{
				var $focusable = $panel.find(':focusable');
				var curNdx = $focusable.index($(e.target));
				var panelNdx = this.$panels.index($panel);
				var numPanels = this.$panels.length;

				if (e.shiftKey) {
					// if this is the first focusable item in the panel 
					// find the preceding expanded panel (if any) that has 
					// focusable items and set focus to the last one in that 
					// panel. If there is no preceding panel or no focusable items 
					// do not process. 
					if (curNdx == 0 && panelNdx > 0) {

						// Iterate through previous panels until we find one that 
						// is expanded and has focusable elements 
						// 
						for (var ndx = panelNdx - 1; ndx >= 0; ndx--) {

							var $prevPanel = this.$panels.eq(ndx);
							var $prevTab = $('#' + $prevPanel.attr('aria-labelledby'));

							// get the focusable items in the panel 
							$focusable.length = 0;
							$focusable = $prevPanel.find(':focusable');

							if ($focusable.length > 0) {
								// there are focusable items in the panel. 
								// Set focus to the last item. 
								$focusable.last().trigger('focus');

								// Reset the aria-selected state of the tabs 
								this.$tabs.attr('aria-selected', 'false');

								// Set that associated tab's aria-selected state to true 
								$prevTab.attr('aria-selected', 'true');

								e.stopPropagation;
								return false;
							}
						}
					}
				} else if (panelNdx < numPanels) {

					// if this is the last focusable item in the panel 
					// find the nearest following expanded panel (if any) that has 
					// focusable items and set focus to the first one in that 
					// panel. If there is no preceding panel or no focusable items 
					// do not process. 
					if (curNdx == $focusable.length - 1) {

						// Iterate through following panels until we find one that 
						// is expanded and has focusable elements 
						// 
						for (var ndx = panelNdx + 1; ndx < numPanels; ndx++) {

							var $nextPanel = this.$panels.eq(ndx);
							var $nextTab = $('#' + $nextPanel.attr('aria-labelledby'));

							// get the focusable items in the panel 
							$focusable.length = 0;
							$focusable = $nextPanel.find(':focusable');

							if ($focusable.length > 0) {
								// there are focusable items in the panel. 
								// Set focus to the first item. 
								$focusable.first().trigger('focus');

								// Reset the aria-selected state of the tabs 
								this.$tabs.attr('aria-selected', 'false');

								// Set that associated tab's aria-selected state to true 
								$nextTab.attr('aria-selected', 'true');

								e.stopPropagation;
								return false;
							}
						}
					}
				}

				break;
			}
		case this.keys.left:
		case this.keys.up:
			{

				if (!e.ctrlKey) {
					// do not process 
					return true;
				}

				// get the jQuery object of the tab 
				var $tab = $('#' + $panel.attr('aria-labelledby'));

				// Move focus to the tab 
				$tab.trigger('focus');

				e.stopPropagation();
				return false;
			}
		case this.keys.pageup:
			{

				var $newTab;

				if (!e.ctrlKey) {
					// do not process 
					return true;
				}

				// get the jQuery object of the tab 
				var $tab = this.$tabs.filter('[aria-selected="true"]');

				// get the index of the tab in the tab list 
				var curNdx = this.$tabs.index($tab);

				if (curNdx == 0) {
					// this is the first tab, set focus on the last one 
					$newTab = this.$tabs.last();
				} else {
					// set focus on the previous tab 
					$newTab = this.$tabs.eq(curNdx - 1);
				}

				// switch to the new tab 
				this.switchTabs($tab, $newTab);

				e.stopPropagation();
				e.preventDefault();
				return false;
			}
		case this.keys.pagedown:
			{

				var $newTab;

				if (!e.ctrlKey) {
					// do not process 
					return true;
				}

				// get the jQuery object of the tab 
				var $tab = $('#' + $panel.attr('aria-labelledby'));

				// get the index of the tab in the tab list 
				var curNdx = this.$tabs.index($tab);

				if (curNdx == this.$tabs.length - 1) {
					// this is the last tab, set focus on the first one 
					$newTab = this.$tabs.first();
				} else {
					// set focus on the next tab 
					$newTab = this.$tabs.eq(curNdx + 1);
				}

				// switch to the new tab 
				this.switchTabs($tab, $newTab);

				e.stopPropagation();
				e.preventDefault();
				return false;
			}
	}

	return true;

}; // end handlePanelKeyDown() 

// 
// Function handlePanelKeyPress() is a member function to process keypress events for a panel 
// 
// @param ($panel obj) $panel is the jquery object of the panel being processed 
// 
// @paran (e obj) e is the associated event object 
// 
// @return (boolean) Returns true if propagating; false if consuming event 
// 
accordion.prototype.handlePanelKeyPress = function($panel, e) {

	if (e.altKey) {
		// do nothing 
		return true;
	}

	if (e.ctrlKey && (e.keyCode == this.keys.pageup || e.keyCode == this.keys.pagedown)) {
		e.stopPropagation();
		e.preventDefault();
		return false;
	}

	switch (e.keyCode) {
		case this.keys.esc:
			{
				e.stopPropagation();
				e.preventDefault();
				return false;
			}
	}

	return true;

}; // end handlePanelKeyPress() 

// 
// Function handlePanelClick() is a member function to process click events for panels 
// 
// @param ($panel object) $panel is the jQuery object of the panel being processed 
// 
// @param (e object) e is the associated event object 
// 
// @return (boolean) returns true 
// 
accordion.prototype.handlePanelClick = function($panel, e) {

	var $tab = $('#' + $panel.attr('aria-labelledby'));

	// make clicked panel's tab navigable 
	$tab.attr('tabindex', '0').attr('aria-selected', 'true');

	// remove all tabs from the tab order and update their aria-selected attribute 
	this.$tabs.not($tab).attr('tabindex', '-1').attr('aria-selected', 'false');

	return true;

}; // end handlePanelClick() 

// focusable is a small jQuery extension to add a :focusable selector. It is used to 
// get a list of all focusable elements in a panel. Credit to ajpiano on the jQuery forums. 
// 
$.extend($.expr[':'], {
	focusable: function(element) {
		var nodeName = element.nodeName.toLowerCase();
		var tabIndex = $(element).attr('tabindex');

		// the element and all of its ancestors must be visible 
		if (($(element)[(nodeName == 'area' ? 'parents' : 'closest')](':hidden').length) == true) {
			return false;
		}

		// If tabindex is defined, its value must be greater than 0 
		if (!isNaN(tabIndex) && tabIndex < 0) {
			return false;
		}

		// if the element is a standard form control, it must not be disabled 
		if (/input|select|textarea|button|object/.test(nodeName) == true) {

			return !element.disabled;
		}

		// if the element is a link, href must be defined 
		if ((nodeName == 'a' || nodeName == 'area') == true) {

			return (element.href.length > 0);
		}

		// this is some other page element that is not normally focusable. 
		return false;
	}
});

/**
 * Internacionalization loader
 * 
 * @author Iñaki Quesada Inclán (iqin)
 */

function I18n(_locale) {
		this.locale = _locale;
		this.translations = {};
		/** 
		 *  Añade una nueva traduccion
		 * @param key clave de la cadena
		 * @param t traducción de la cadena
		 **/
		this.addTranslation=function(key,t) {
			this.translations[key] = t;
		};
		/**
		 * Retorna el valor del locale actual
		 * @return Valor del locale actual
		 **/
		this.getLocale=function() {
			return this.locale;
		};
		/**
		 * Devuelve el valor de una traducción
		 * AVISO IMPORTANTE: Para los comillas, estamos usando la siguiente convencion:
		 * - Si un texto localizado contiene comillas, se usarán siempre comillas dobles.
		 * - Por tanto, cuando se referencie dicho texto en la parte javascript, hay que usar siempre 
		 * comillas simples, o se romperá el código
		 * 
		 * 
		 * @param key clave de la traducción
		 * @param params array con los parámetros, o string si es un único parámetro, o hash si es pluralizable. Ejemplo:
		 * 	<ul>
		 * 	 <li>i18n.t('string.to.translate', 'value')</li>
		 * 	 <li>i18n.t('string.to.translate', ['value1", 'value2'])</li>
		 * 	 <li>i18n.t('string.to.translate', { 'count': 1, 'args': ['value1', 'value2']})</li>
		 *  </ul>
		 * @return Traducción, o frase por defecto en caso de que no exista
		 */
		this.t=function(key, params) {
			if(this.translations[key]==undefined) {
				return "Undefined translation: " + key;
			}
			else {
				var translation = this.translations[key];
				if (typeof params === "string") {
					translation = translation.replace("$1",params);
				} else if (typeof params === "object") {
					if (params["count"] != undefined) {
						var keycount = key;
						var count = parseInt(params["count"]);
						if (isNaN(count)) {
							keycount = key + ".other";
						} else {
							if (count == 0) {
								keycount = key + ".zero";
							} else {
								if (count == 1) {
									keycount = key + ".one";
								} else {
									keycount = key + ".few";
								}
							}
						}
						if (this.translations[keycount] != undefined) {
							translation = this.translations[keycount];
						}
						if (params["args"] != undefined) {
							params = params["args"];
						}
						translation = translation.replace("$count", count);
					}
					try {
						for (var i = 0; i < params.length; i++) {
							translation = translation.replace("$" + (i + 1), params[i]);
						}
					} catch (e) {
						console.log("Error obteniendo la traducción: " + key);
					}
				}
				return translation;
			}
		};
}
/*
 * @file sag-alsa-infoWindow-ui.js
 *
 * @brief
 * This component generate bootstrap modal like windows.
 * You can specify by params many options like window type, title, text content,
 * text for buttons to support i18n, object with the content or an url to get
 * that object
 *
 * @param target: which html element to attach the component
 * @param dismissText: text to assign to the button that closes the window
 * @param actionText: text to assign to the button to confirm
 * @param action: function to execute when the user click on confirm button
 * @param contentUrl: URL to get the content to load in the window
 * @param content: object to set the content to load in the window
 * @param windowType: indicates the type of window to be created, it can be either 'alert' or 'dialog'
 * @param userTitle: optional window title which has preference over content title
 *
 * @NOTE 1: if param content is specified, it overrides object contentUrl
 *
 * @NOTE 2: whatever you decide to get the content by URL or specifing an object,
 * the object should have two properties: title and text.
 * (i.e: {"title": "My window title", "text": "The text to show in the window"})
 *
 * @NOTE 3: if the objects content is html, be aware to scape doble quotes
 *
 * @author	Josué Prieto Lentijo, <josue.prietolentijo@softwareag.com>
 * @date	3-9-2014
 * @version 0.1.0
 *
 * */

(function ($){
	// Plugin definition
	$.fn.infoWindow = function(params) {
		var deferred = new jQuery.Deferred();;
		var options = $.extend({}, $.fn.infoWindow.defaults, params);
//		console.log("Inicializando componente...");
		// Referencia al componente.
		var component = this;

		// Genero el id para contenedor de la ventana modal
		var modalId;

		// UUID para los ids
		var d = new Date().getTime();
	    var timeId = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
	        var r = (d + Math.random()*16)%16 | 0;
	        d = Math.floor(d/16);
	        return (c=='x' ? r : (r&0x7|0x8)).toString(16);
	    });

		//contenido de la ventana modal
		var contenido;

		/**
		 * Métodos privados
		 */
		// Inicializacion componente
		var init = function(){
//			console.log('init infoWindow');
			if (modalId == undefined){
				modalId = 'infoWindow_'+ timeId;
			}
//			event.preventDefault();
			//generamos el contenido y lo agregamos al elemento de destino
			if (contenido == undefined){
				contenido = generateWindowContent();
				loadContent(contenido);
			}
			//mostramos la ventana modal
			component.showModalWindow();
			// Asignamos los eventos a los botones de ok y cancel
			$("#" + modalId).find("button.btn-primary").on("click", clicked_ok);
			$("#" + modalId).find("button.btn-default").on("click", clicked_ko);

			$("#" + modalId).find("button.btn-primary").attr("data-ref", modalId);

			// Controlamos el evento hidden para eliminar la instacia del infoWindow
			$("#" + modalId).on("hidden.bs.modal", selfDestroy);
		};

		var clicked_ok = function(event) {
			deferred.resolve($(event.currentTarget));
			component.hideModalWindow();
		};

		var clicked_ko = function(event) {
			deferred.reject("reject");
		};

		var selfDestroy = function(event) {
			$("#" + modalId).remove();
            // Con la versión de bootstrap de 7.4 esto sería innecesario, ya se encarga bootstrap, pero lo mantenemos por compatibilidad y ante la imposibilidad de
            // de probarlo en TODOS los sitios donde se utilizan modales.
            $(".modal-backdrop").remove();
			if(typeof(options.isSubModal)!="undefined" && options.isSubModal){
				if($('div[class*="modal"].fade.in').length){
					// Si al cerrar esta ventana aun queda una modal abierta, mantener la clase "modal-open" en el body
					$("body").addClass("modal-open");
				}
			}
		};


		//genera el contenido de la ventana modal
		var generateWindowContent = function (){
			var windowHtml = '';
			var content = {};
			var thereIsAnError = false;
			//obtenemos el contenido
			if(!options.content && !options.contentUrl){
//				console.log('no se indican content ni contentUrl');
//				console.log('ejecutando options.confirmAction');
				options.confirmAction();
			}
			else{
				if (options.content){// el contenido se pasa como parametro
					content = options.content;
				}
				else if(options.contentUrl != ''){// se indica una URL en la que se sirve el contenido
					$.ajax({
						method: 'GET',
						url: options.contentUrl,
						cache: false,
						async: false,
						dataType: 'json',
						beforeSend: function(){
							$('#loading').show();
						},
						success: function(externalContent){
							$('#loading').hide();
							content = externalContent;
						},
						error: function(){
							$('#loading').hide();
							console.log('error getting external infoWindow content');
							content.title = i18n.t('infoWindow.error.title');
							content.text = i18n.t('infoWindow.error.text');
							thereIsAnError = true;
						}
					});
				}

				/* set user title if defined */
				if (options.replaceTitle && !thereIsAnError && options.userTitle && options.userTitle != '' ) {
					content.title = options.userTitle + ": " + content.title;
				} else {
					if (options.userTitle && options.userTitle != '' && !thereIsAnError){
						content.title = options.userTitle;
					}
				}

				// Rellenamos el html con el contenido obtenido
				// TODO: cargar template con {{mustache}}
				windowHtml = '<div id="'+modalId+'" class="sag-modal '+options.specialClass+'" aria-labelledby="myModalLabel" aria-describedby="myModalDesc" aria-hidden="true" data-test-id="infoWindow" tabindex="-1" role="dialog"><div class="sag-modal-dialog sag-modal-dialog-full"><div class="sag-modal-header">';
				if(options.closeEnabled){
					windowHtml += '<button type="button" class="close" aria-label="' + i18n.t('general.navigation.close') + '" title="' + i18n.t('general.navigation.close') + '" data-dismiss="modal"><span class="sr-only">'+i18n.t('general.navigation.close')+'</span></button>';
				}
				if (content.title != ''){
//				if (content && content.title != ''){
					windowHtml += '<h2 aria-live="polite" role="status" class="sag-modal-title" id="myModalLabel">'+content.title+'</h2>';
				}
//				if (content && content.text != ''){
					windowHtml += '</div><div class="sag-modal-content"><div aria-live="polite" role="status" class="sag-modal-body sagCustomScrollBar" id="myModalDesc" tabindex="0">'+content.text+'</div>';
//				}
				// Eliminamos botón de cerrar de los popup WA-2381
//				windowHtml += '<div class="sag-modal-footer"><button type="button" class="btn btn-default btn-modal" data-dismiss="modal" data-test-id="infoWindowDismissBtn">'+options.dismissText+'</button>';
				windowHtml += '<div class="sag-modal-footer">';
				// Agregamos el boton aceptar si el tipo de ventana es dialog
				if (options.windowType == 'dialog' && !thereIsAnError){
					windowHtml += '<button type="button" aria-label="' + options.actionText + '" class="btn btn-primary btn-modal" data-id="acceptButton_'+timeId+'" data-test-id="infoWindowAcceptBtn">'+options.actionText+'</button>';
				}
				windowHtml += '</div></div></div></div>';

				return windowHtml;
			}

			return;

		};

		//carga el contenido generado
		var loadContent = function(content){
			var jQSelector;
			//obtenemos un selector jQuery apropiado
			if (options.target !== $.fn.infoWindow.defaults.target){
				//se indica target, selector por id con el target indicado
				if ($('#'+options.target).length > 0){
					jQSelector = '#'+options.target;
				} else {
					console.warn('There is no valid target specified, using defaults');
					jQSelector = $.fn.infoWindow.defaults.target;
				}
			}
			else{
				//no se indica target, empleamos el selector por defecto
				jQSelector = options.target;
			}
			// Asignar evento click al boton Aceptar
			$(jQSelector).append(content).on('click', '[data-id="acceptButton_'+timeId+'"]', options.confirmAction);
		};


		/**
		 * Métodos públicos
		 */
		// Muestra la ventana modal
		this.showModalWindow = function() {
			$('#' + modalId).detach().appendTo("#modalsContainer");
			$('#' + modalId).modal('show');

			var activeElement = $(document.activeElement);

			$('#' + modalId).on('shown.bs.modal', function (e) {
	    		$("body>div:not(#modalsContainer)").attr("aria-hidden", "true");
	    		$("#" + modalId).trigger('focus');
				if ($("#" + modalId).find("button.btn-default").length > 0) {
					$("#" + modalId).find("button.btn-default").trigger('focus');
				}

				if ($('#' + modalId).find("button.btn-primary").length > 0) {
					$('#' + modalId).find("button.btn-primary").trigger('focus');
				}
			});
			$('#' + modalId).on('hidden.bs.modal', function (e) {
	    		$("body>div:not(#modalsContainer)").removeAttr("aria-hidden");
	    		activeElement.trigger('focus');
	    	});

		};

		// Oculta la ventana modal
		this.hideModalWindow = function() {
			$('#'+modalId).modal('hide');
		};

		// Inicializa el componente
		init();

		// Devolver la instacia actual del componente
		//return component;
		return deferred.promise();
	};

	/**
	 * Opciones por defecto del plugin
	 */
	$.fn.infoWindow.defaults = {
			target: 'body',
			dismissText: 'Cancel',
			actionText: 'OK',
			specialClass: '',
			confirmAction: function(){
//				console.log('action button clicked');
				return false;
			},
			contentUrl:'',
			content: '',
			windowType: 'alert',
			closeEnabled: true
		};

})(jQuery);

'use strict';

/**
 * Inicializa los combos autocompletables de los origenes del buscador
 */

//var bFlagTren = false;



/**
 * Crea el combo de estaciones de origen indicando si tienen que precargar el destino una vez se seleccione el origen
 *
 * @param originStationName
 * 			id del componente HTML que contiene el nombre de la estacion
 * @param originStationId
 * 			id del componente HTML que contiene el id de la estacion seleccionada
 * @param urlJsonOrigins
 * 			URL del Ajax de donde se obtendran los origenes
 * @param urlUsualJsonOrigins
 * 			URL del Ajax de donde se obtendrán los origenes frecuentes
 * @param isJourneySearch
 * 			Indica si el combo debe de tener en cuenta si el origen seleccionado es una estacion de tren o no.
 * 			SOLO debe de venir a TRUE en los combos del JourneySearch
 * @param isInitialTrainTrip
 * 			TRUE si al cargar el combo debe activar las restricciones del tren. Solo se tendra en cuenta si isJourneySearch = true
 * @param keepDestination
 * 			TRUE si al seleccionar el origen, debe respetar el destino precargado, si existe. Solo se tendra en cuenta si isJourneySearch = true
 */
var originsUsuals = null;
var origins = null;
function initAutocompleteOrigins(originStationName,originStationId,urlJsonOrigins,urlJsonUsualOrigins,isJourneySearch,isInitialTrainTrip,keepDestination, isRoundTrip, isShipTrip, originStationSimplifiedName, originStationIsMoveliaStop)  {
//Invocamos al servidor para cargar los origines y los origenes habituales
origins = createOriginsList(urlJsonOrigins);

var isTrainTrip = isInitialTrainTrip;
//Hack para evitar problema en IE que controla si es la primera vez que cargamos el combo
var isFirstTimeLoad = true;

if(urlJsonUsualOrigins!=null)
{
	originsUsuals = createUsualOriginsList(urlJsonUsualOrigins);
}

$("#" + originStationName).autocomplete({
  source:
	  function(req, responseFn) {
	    var data = null;

		  // Ciudades habituales para la carga inicial del combo
		  if (originsUsuals!=null && originsUsuals.responseJSON!=null && req.term.length < 2) {
			  data = originsUsuals.responseJSON;
		  }
		  //Busca resultados sobre todas las poblaciones origen, con la cadena introducida por el usuario
		  if (origins!=null && origins.responseJSON!=null && req.term.length > 1) {
	          data = origins.responseJSON;
		  }
		  //filtramos

		  var results = buildResponse(data,req.term);
		  //Quitamos el spinner que indica espera
		  $( ".ui-autocomplete-image-spinner" ).remove();

	      responseFn(results);
	      //angular.element($("#" + originStationName)).scope().autocompleteOriginLoaded=true;
    },
    minLength: 0,
    delay: 200,
    messages: {
    	noResults: i18n.t('journeysearch.results', { 'count': 0}),
    	results: function(count) {
    		return i18n.t('journeysearch.results', { 'count': count});
    	}
    },
    create:function( event, ui ) {
    	if(isJourneySearch === true) {
        	//se desabilitan opciones cuando el destino seleccionado es la estación de trén del escorial

    		if (isTrainTrip === true || (isShipTrip === true && params["isInitiallyBusNautic"] !== "true")) {
    			enableShipTrainOptions();
		  	} else {
		  		disableShipTrainOptions();
		  	}

    		if (isRoundTrip === true) {
    			enableRoundTripOptions();
    			angular.element($(this)).scope().isTrainTravel(true);
		  	} else if (isRoundTrip === false) {
		  		disableRoundTripOptions();
		  		angular.element($(this)).scope().isTrainTravel(false);
		  	}
    	}

    	if($("#" + originStationName).val() == '') {
    		$("#" + originStationName).attr("placeholder", i18n.t('zz13.journeysearch.write.origin'));
    	}
      },
    search: function (event, ui) {
    	/* Evitar excepciones con los eventos de IE (WA-2501, WA-2560) */
    	/* En IE puede llegar un primer evento que no sabemos porque se produce que causa que se coloque mal la capa
    	 * de estaciones. Se debe ignorar este evento (solo la primera vez) */
    	if (isFirstTimeLoad === true) {
    		isFirstTimeLoad = false;
			if (typeof event.originalEvent !== "undefined" && (window.navigator.userAgent.indexOf("MSIE ") > 0 || navigator.userAgent.match(/Trident.*rv\:11\./))) {
				event.preventDefault();
				return;
			}
    	}

    	if(!$(this).next().is('i')) {
    		$(this).after( "<i class='fa fa-spinner fa-spin ui-autocomplete-image-spinner' ></i>" );
		}

    },
    select: function( event, ui ) {
      if (ui.item) {
    	  $("#" + originStationId).val(ui.item.id);
    	  $("#" + originStationName).val(ui.item.name);
    	  $("#" + originStationSimplifiedName).val(ui.item.simplifiedName);
    	  $("#" + originStationIsMoveliaStop).val(ui.item.isMoveliaStop);

    	  if(isJourneySearch){
	    	  angular.element($(this)).scope().previousOriginName = ui.item.value;
	    	  angular.element($(this)).scope().originStationId = ui.item.id;
	    	  angular.element($(this)).scope().$apply();
    	  }
      }

      if(!isJourneySearch){// esto se debe a que no existe controller asociado, sino el modelo lanza el evento onchange.
    	  $("#" + originStationId).trigger('change');
	  }

       if(isJourneySearch === true) {
	      //se desabilitan opciones cuando el destino seleccionado es la estación de trén del escorial

		  var isBusNautic = params["busNauticDestinations"] && params["busNauticDestinations"].includes(ui.item.id);
		  if (ui.item.isTrainStop === true || (ui.item.isShipStop === true && !isBusNautic)) {
			  enableShipTrainOptions();
		  }else {
			  disableShipTrainOptions();
		  }

    	  if(ui.item.isRoundTripStop !== true) {
    		  disableRoundTripOptions();
 			  angular.element($(this)).scope().isTrainTravel(false);
 		  } else if(ui.item.isRoundTripStop === true) {
 			  enableRoundTripOptions();
 			  angular.element($(this)).scope().isTrainTravel(true);
 		  }
      }

    },
    open: function() {
      $( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top ui-autocomplete-text-ellipsis" );
      if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
    	  $('.ui-autocomplete').off('menufocus hover mouseover');
      }

      if(isJourneySearch){
    	  angular.element($(this)).scope().isFocusedOrigin = true;
    	  angular.element($(this)).scope().$apply();
          angular.element($("#" + originStationName)).scope().autocompleteOriginLoaded=true;
           angular.element($(this)).scope().destinationStationName="";
      }

    },
    close: function() {
      $( window ).off("resize");
      $( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
      if(isJourneySearch){
    	  angular.element($(this)).scope().isFocusedOrigin = false;
    	  angular.element($(this)).scope().$apply();
    	  angular.element($("#" + originStationName)).scope().autocompleteOriginLoaded=false;
      }
    }
  }).on('focus', function(e, item){

	  $("#" + originStationId).val("");
	  $("#" + originStationName).val("");
	  if(!keepDestination)
	  {
		  $("input[name = 'destinationStationNameId']").val("");
		  $("input[name = 'destinationStationId']").val("");
	  }

	  if(isJourneySearch){
		  angular.element($(this)).scope().previousOriginName = "";
		  angular.element($(this)).scope().originStationName = "";
		  if(!keepDestination)
		  {
			  angular.element($(this)).scope().previousDestinationName = "";
			  angular.element($(this)).scope().destinationStationName = "";
		  }
		  angular.element($(this)).scope().$apply();

	  }

	  $(this).autocomplete("search");

  });
  $("#" + originStationName).autocomplete( "instance" )._renderItem = function( ul, item ) {
  		// Incluimos en cada origen la estrella de favoritos (si tiene)
  		var favoriteButtonHTML = "";
  		if (params["ajaxUpdateFavoriteStation"] != undefined && item.showFavoriteButton) {
			favoriteButtonHTML = "<span id='originFavBtn-" + item.id + "' class='fa " + (item.isFavorite ? "fa-star" : "fa-star-o") + "' data-toggle='tooltip' title='' onclick='updateFavoriteStation(\"" + item.id + "\",\"I\",event)'><span class='sr-only'>Favorito</span></span>";
  		}

		return $( "<li class='ui-journeysearch-item'>").addClass(item.icon).addClass('id-' + item.id).append( "<span class='ui-journeysearch-city'>"+ item.name + "</span><span class='ui-journeysearch-country'>" + item.countryName + "</span>" + favoriteButtonHTML).appendTo( ul );
  };
  $("#" + originStationName).autocomplete( "instance" )._renderMenu = function( ul, items ) {
	  var that = this;
	  if (items.length > 0) {
		  $.each( items, function( index, item ) {
		    that._renderItemData( ul, item );
		  });
	  }
  };
  //da el tamanio al combo igual que el del campo input
  $("#" + originStationName).autocomplete( "instance" )._resizeMenu = function () {
	  var ul = this.menu.element;
      ul.outerWidth(this.element.outerWidth());
      if(window.matchMedia("(max-width: 767px)").matches){
    	  ul.addClass('stages-list-mobile');
    	  var altura = $( window ).height() - 50;
    	  $(".stages-list-mobile").css("height", altura);

		  $( window ).resize(function() {
			if(window.matchMedia("(max-width: 767px)").matches){
				var altura = $( window ).height() - 50;
		    	$(".stages-list-mobile").css("height", altura);
			}
		  });
      }
      else{
    	  ul.addClass('origin-stages-list');
      }
      if(isJourneySearch){
    	  ul.addClass('journey-search-autocomplete');
      }
  };


}

/**
 * Inicializa los combos autocompletables de los destinos del buscador
 *
 */
function initAutocompleteDestinations(namespace, destinationStationNameId,destinationStationId, urlDestinations,originStationIdValue, urlJsonUsualDestinations, isJourneySearch, isTrainTrip, trenReyesMagosDestinationId, isRoundTrip, isShipTrip, destinationStationSimplifiedName, destinationStationIsMoveliaStop) {
//Hack para evitar problema en IE que controla si es la primera vez que cargamos el combo
var isFirstTimeLoad = true;

$("#" + destinationStationNameId).autocomplete({
  source: function( req, responseFn ) {
	  	  if (req.term.length < 2) {
	  		   //Invocamos al servidor para obtener los destinos habituales
	  		    $.ajax({
			    	type: 'GET',
			    	url: urlJsonUsualDestinations+  "&"+namespace+"originStationId" + "=" + $("#" + originStationIdValue).val(),
			        dataType: "json",
			        cache: false,
			        success: function (datajson) {
			        	 var results = buildResponse(datajson,req.term);
			        	 $( ".ui-autocomplete-image-spinner" ).remove();
			        	 responseFn(results);
			        	 return;
					}
			      });
	  	  }
	  	  else if (req.term.length > 1) {
			  //Invocamos al servidor para obtener todos los destinos para ese origen
		      $.ajax({
		    	type: 'GET',
		    	url: urlDestinations+  "&"+namespace+"originStationId" + "=" + $("#" + originStationIdValue).val(),
		        dataType: "json",
		        cache: false,
		        success: function (datajson) {
		        	 var results = buildResponse(datajson,req.term);
		        	 $( ".ui-autocomplete-image-spinner" ).remove();
		        	 responseFn(results);
		        	 return;
				}
		      });
		}
    },
	minLength: 0,
	delay: 200,
	messages: {
		noResults: i18n.t('journeysearch.results', { 'count': 0}),
		results: function(count) {
			return i18n.t('journeysearch.results', { 'count': count});
		}
	},
	create:function( event, ui ) {
		if(isJourneySearch === true) {
			//se desabilitan opciones cuando el destino seleccionado es la estación de trén del escorial

			if (isTrainTrip === true || (isShipTrip === true && params["isInitiallyBusNautic"] !== "true")) {
				enableShipTrainOptions();

				if (angular.element($(this)).scope().destinationStationId == trenReyesMagosDestinationId){
					enableReyesMagosChanges();
				} else {
					disableReyesMagosChanges();
				}
		  	} else {
		  		disableShipTrainOptions();
		  	}

			if (isRoundTrip === true) {
				enableRoundTripOptions();
				angular.element($(this)).scope().isTrainTravel(true);
			} else if (isRoundTrip === false){
				disableRoundTripOptions();
				angular.element($(this)).scope().isTrainTravel(false);
			}
		}

    	if($("#" + destinationStationNameId).val() == ''){
			 $("#" + destinationStationNameId).attr("placeholder", i18n.t('zz13.journeysearch.write.destination'));
		}
    },
    search: function (event, ui) {
    	/* Evitar excepciones con los eventos de IE (WA-2501, WA-2560)  */
    	/* En IE puede llegar un primer evento que no sabemos porque se produce que causa que se coloque mal la capa
    	 * de estaciones. Se debe ignorar este evento (solo la primera vez) */
    	if (isFirstTimeLoad === true) {
    		isFirstTimeLoad = false;
			if (typeof event.originalEvent !== "undefined" && (window.navigator.userAgent.indexOf("MSIE ") > 0 || navigator.userAgent.match(/Trident.*rv\:11\./))) {
				event.preventDefault();
				return;
			}
    	}

    	if(!$(this).next().is('i')) {
    		$(this).after( "<i class='fa fa-spinner fa-spin ui-autocomplete-image-spinner' ></i>" );
		}
    },
	select: function( event, ui ) {
	  if (ui.item) {
		  $("#" + destinationStationId).val(ui.item.id);
		  $("#" + destinationStationNameId).val(ui.item.name);
    	  $("#" + destinationStationSimplifiedName).val(ui.item.simplifiedName);
    	  $("#" + destinationStationIsMoveliaStop).val(ui.item.isMoveliaStop);

		  if(isJourneySearch){
			  angular.element($(this)).scope().previousDestinationName = ui.item.value;
			  angular.element($(this)).scope().destinationStationId = ui.item.id;
	    	  angular.element($(this)).scope().$apply();

			  var isBusNautic = params["busNauticDestinations"] && params["busNauticDestinations"].includes(ui.item.id);
	    	  if (ui.item.isTrainStop || (ui.item.isShipStop === true && !isBusNautic)){
	    		  enableShipTrainOptions();
	    	  } else {
	    		  disableShipTrainOptions();
	    	  }

	    	  if (ui.item.isRoundTripStop) {
	    		  enableRoundTripOptions();
	    		  angular.element($(this)).scope().isTrainTravel(true);
	    	  } else if (!ui.item.isRoundTripStop){
	    		  disableRoundTripOptions();
	    		  angular.element($(this)).scope().isTrainTravel(false);
	    	  }

	    	  // Se condicionan las modificaciones para el tren de RRMM
	    	  if (ui.item.id == trenReyesMagosDestinationId) {
	    		  enableReyesMagosChanges();
	    	  } else {
	    		  disableReyesMagosChanges();
	    	  }
		  }
		  if(!isJourneySearch){
			 $("#" + destinationStationId).trigger('change');
		  }

		  //Dado que en horarios el montaje del buscador no lleva asociado las "pantallas deslizables" no hacemos el focus dado que tiene un evento que nos lleva
		  // al componente de calendario, y no funcionaria el click en el destino.
		  if (event.target.id == "_SchedulePortlet_WAR_Alsaportlet_destinationStationNameIdSchedules"){
    		 return;
    	  }
		  else{
			  $("input[id='departureDate']").trigger('focus');
		  }
	  }
	},
	open: function() {
	  $( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top ui-autocomplete-text-ellipsis" );
	  if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
		  $('.ui-autocomplete').off('menufocus hover mouseover');
	  }

	  if(isJourneySearch){
    	  angular.element($(this)).scope().isFocusedDestination = true;
    	  angular.element($(this)).scope().$apply();

    	  angular.element($("#" + destinationStationNameId)).scope().autocompleteDestinationLoaded=true;
      }
	},
	close: function() {
	  $( window ).off("resize");
	  $( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
	  if(isJourneySearch){
	    angular.element($(this)).scope().isFocusedDestination = false;
	    angular.element($(this)).scope().$apply();

		angular.element($("#" + destinationStationNameId)).scope().autocompleteDestinationLoaded=false;
	  }
	}
	}).on('focus', function(){
	 	  $("#" + destinationStationId).val("");
	 	  $("#" + destinationStationNameId).val("");
	 	  if(isJourneySearch){
	 		  angular.element($(this)).scope().previousDestinationName = "";
	 		  angular.element($(this)).scope().destinationStationName = "";
	 		  angular.element($(this)).scope().$apply();
	 	  }

	 	  if($("#" + originStationIdValue).val()!=null && $("#" + originStationIdValue).val()!="")
	      {
	 		$(this).autocomplete("search");
	 	  }
	  });

   $("#" + destinationStationNameId).autocomplete( "instance" )._renderItem = function( ul, item ) {
      // Incluimos en cada destino la estrella de favoritos (si tiene)
      var favoriteButtonHTML = "";
      if (params["ajaxUpdateFavoriteStation"] != undefined && item.showFavoriteButton) {
		favoriteButtonHTML = "<span id='destinationFavBtn-" + item.id + "' class='fa " + (item.isFavorite ? "fa-star" : "fa-star-o") + "' data-toggle='tooltip' title='' onclick='updateFavoriteStation(\"" + item.id + "\",\"V\",event)'><span class='sr-only'>Favorito</span></span>";
      }

      return $( "<li class='ui-journeysearch-item'>").addClass(item.icon).addClass('id-' + item.id).append("<span class='ui-journeysearch-city'>"+  item.name + "</span><span class='ui-journeysearch-country'>" + item.countryName + "</span>" + favoriteButtonHTML).appendTo( ul );
   };
   $("#" + destinationStationNameId).autocomplete( "instance" )._renderMenu = function( ul, items ) {
	  var that = this;
	  if (items.length > 0) {
		  $.each( items, function( index, item ) {
		    that._renderItemData( ul, item );
		  });
	  }
   };
   //da el tamanio al combo igual que el del campo input
   $("#" + destinationStationNameId).autocomplete( "instance" )._resizeMenu = function () {
	  var ul = this.menu.element;
      ul.outerWidth(this.element.outerWidth());

      if(window.matchMedia("(max-width: 767px)").matches){
    	  ul.addClass('stages-list-mobile');
    	  var altura = $( window ).height() - 50;
    	  $(".stages-list-mobile").css("height", altura);

		  $( window ).resize(function() {
			if(window.matchMedia("(max-width: 767px)").matches){
				var altura = $( window ).height() - 50;
		    	$(".stages-list-mobile").css("height", altura);
			}
		  });
      }
      else{
    	  ul.addClass('destination-stages-list');
      }
      if(isJourneySearch){
    	  ul.addClass('journey-search-autocomplete');
      }
   };
}

/**
 * Filtramos las ciudades que cumplen una cadena de busqueda.
 * Se aniaden las ciudades que casen con  la cadena de entrada y tambien se desglosa para incluir las poblaciones hijas justo despues del padre
 * @param data json con todas las poblaciones padre
 * @param term termino insertado por el usuario en el combo autocompletable
 * @returns
 */
function buildResponse(data,term) {
	var results= [];
	var options = {
			includeScore: false,
			shouldSort: true,
			includeMatches: false,
			findAllMatches: true,
			minMatchCharLength: 1,
			location: 0,
			threshold: 0.25,
			distance: 500,
			keys: ["nameAutocomplete" ,
			{name: "provincecountryName", weight: 3 }
			,
			{name: "nomovelia", weight: 2 }
			,
			{name: "priority", weight: 9 },
			{name: "airportName", weight: 4 },
			]
			};

	 if(data!=null) {
  		 if(term!=null && term.length >0 ) {
  			 //usamos el algoritmo fuse.js para filtrar las ciudades padre por cadena introducida por el usuario
  			 term = accent_fold(term);
	  		 var fuse = new Fuse(data, options);
	  		 data = fuse.search(term);
	   	  }
		  for (var i = 0; i < data.length; i++) {
			  var item = data[i];
			  if(data[i]!=null && data[i].item !=null)
			  {
				  item = data[i].item;
			  }
			  results.push({
				  	value: item.name,
				  	name: item.name,
				  	countryName: item.provincecountryName,
				  	id: item.id,
				  	icon: item.icon,
				  	isTrainStop: item.isTrainStop,
				  	isRoundTripStop: item.isRoundTripStop,
				  	isShipStop: item.isShipStop,
				  	simplifiedName: item.simplifiedName,
				  	isMoveliaStop: item.isMoveliaStop,
				  	isFavorite: item.isFavorite,
				  	showFavoriteButton: item.showFavoriteButton
				  	});
			  //aniadimos las ciudades hijas si las tiene, justo despues del padre
			  if(item.stopsList!=null) {
			    	 for (var j = 0; j < item.stopsList.length; j++) {
			    		 var itemStop = item.stopsList[j];
			    		 //filtramos las hijas por la cadena introducida por el usuario
			    		 if((term!=null && itemStop.nameAutocomplete.toUpperCase().indexOf(term.toUpperCase()) > -1) || term==null) {
			    			 results.push({
			    				 value: itemStop.name,
			    				 name: itemStop.name,
			    				 countryName: itemStop.provincecountryName,
			    				 id: itemStop.id,
			    				 icon: itemStop.icon,
			    				 isTrainStop: itemStop.isTrainStop,
			 				  	 isRoundTripStop: item.isRoundTripStop,
			 				  	 isShipStop: item.isShipStop,
			 				  	 simplifiedName: item.simplifiedName,
							  	 isMoveliaStop: item.isMoveliaStop
			    			 });
			    		}
			    	 }
			   }
		  }
	  }
	 return results;
}



/**
 * Operacion que obtiene todos los origines
 */
function createOriginsList(urlJsonOrigins) {

		return $.ajax({
			type: 'GET',
			url: urlJsonOrigins,
			dataType: 'json',
			cache: false,
			success: function (stagesListJSON) {
				return stagesListJSON;
			},
			error: function () {
				console.log('Error obteniendo ciudades para origenes');
			},
			complete: function () {
			}
		});
}


/**
 * Busca los origines habituales para este usuario (cookies y sino las que devuelva backend)
 * @returns
 */
function createUsualOriginsList(urlJsonUsualOrigins) {
	//var userRegionName = getFreegeoIP();
	return $.ajax({
		type: 'GET',
		url: urlJsonUsualOrigins,
		dataType: 'json',
		cache: false,
		success: function (stagesListJSON) {
			return stagesListJSON;
		},
		error: function () {
			console.log('Error obteniendo ciudades habituales para origenes');
		},
		complete: function () {

		}
	});
}


/**
 * Busca las estaciones destino habituales
 * @param component
 * @returns
 */
function createUsualDestinationsList(urlJsonUsualDestinations) {
		return $.ajax({
			type: 'GET',
			url: urlJsonUsualDestinations,
			dataType: 'json',
			cache: false,
			success: function (stagesListJSON) {
				return stagesListJSON;
			},
			error: function () {
				console.log('Error obteniendo ciudades habituales para destinos');
			},
			complete: function () {
			}
		});
}

/**
 * Geolocaliza la IP del cliente
 * @returns
 */
function getFreegeoIP() {
	if (userRegionName == "") {
		return $.ajax({
			type : 'GET',
			// TODO: La llamada deberá ser mediante https, en el momento de hacer esto esa url no está funcionando bajo protocolo seguro
			url : 'https://freegeoip.net/json/',
			dataType : 'json',
			cache : false,
			timeout : 2000,//Límite de 2 segundos
			success : function(regionList) {
				// TODO: Este parámetro cambiara para obtener los origenes mediante la localidad en vez de la IP
				if (regionList != undefined && regionList.latitude != undefined && regionList.latitude != "" && regionList.longitude != undefined && regionList.longitude != "") {
					userRegionName = parseFloat(regionList.latitude).toFixed(2) + "," + parseFloat(regionList.longitude).toFixed(2);
				} else {
					userRegionName = userRegionNameDefault;
				}
			},
			error : function() {
				if (T) console.log('Error cargando ciudades habituales - FreegeoIP');
				userRegionName = userRegionNameDefault;
			}});
	} else {
		return userRegionName;
	}
}


/**
 * Crea una URL para una llamada JSON
 */
function createURLStation(urlBase,widgetValue,locationModeValue,regionalZoneValue,codeValue,timetableModeValue)
{
	var url = urlBase;
	if(widgetValue!=null && widgetValue!="")
	{
		url += "&widgetMode=" + widgetValue;
	}
	if(locationModeValue!=null && locationModeValue!="")
	{
		url += "&locationMode="+locationModeValue;
	}
	if(regionalZoneValue!=null && regionalZoneValue!="")
	{
		url += "&regionalZone="+regionalZoneValue;
	}
	if(codeValue!=null && codeValue!="")
	{
		url += "&code="+codeValue;
	}
	if(timetableModeValue!=null && timetableModeValue!="") {
		url += "&timetableMode=true";
	}
	return url;
}



/**
 * Quitamos los acentos de la cadena introducida por el usuario
 */
var accentMap = {"á":"a", "é":"e", "í":"i","ó":"o","ú":"u","Á":"A","É":"E","Í":"I","Ó":"O","Ú":"U"};

var accent_fold = function( term ) {
	var ret = "";
	for ( var i = 0; i < term.length; i++ ) {
		ret += accentMap[ term.charAt(i) ] || term.charAt(i);
	}
	return ret;
};

function enableRoundTripOptions(){
	if(!$('input[name=travelTypeOutward]').is(':checked')){
		$('input[name=travelTypeOutward]').trigger("click");
	}
	$('input[name=travelTypeOutward]').attr('disabled','disabled');
	$('input[name=travelTypeOpenReturn]').attr('disabled','disabled');
	$("#angularSwitchStations").addClass("disabled");
	$('input[name=LIFERAY_SHARED_isRoundTrip]').val("true");
}

function disableRoundTripOptions(){
	var destinationsDisablingSwitchButton = params["destinationsDisablingSwitchButton"] || "";
	$('input[name=travelTypeOutward]').prop('disabled', false);
	$('input[name=travelTypeOpenReturn]').prop('disabled', false);
	if (!destinationsDisablingSwitchButton.includes($('input[name=destinationStationId]').val())) {
		$("#angularSwitchStations").removeClass("disabled");
	}
	$('input[name=LIFERAY_SHARED_isRoundTrip]').val("false");
}

function enableShipTrainOptions(){

	$('input[name=nightly]').attr('disabled','disabled');
	$('input[name=nonStop]').attr('disabled','disabled');
	$('#labelNocturnos').addClass("desactivado");
	$('#labelDirectos').addClass("desactivado");
	$('input[name=LIFERAY_SHARED_isTrainTrip]').val("true");
	$('input[name=LIFERAY_SHARED_isShipTrip]').val("true");
	$(document).ready(function(){
		$("#JourneySearchPaxType_3").hide();
		$("#passengerComment_2").append("<span class='icn-information' aria-hidden='true' data-toggle='tooltip' title='"+i18n.t('zz17.journeySearch.passengerType.BABY.comment.train')+"'></span>");
		$('[data-toggle="tooltip"]').bstooltip({container:'body'});
	});
}

function disableShipTrainOptions(){
	$('input[name=nightly]').prop('disabled', false);
	$('input[name=nonStop]').prop('disabled', false);
	$('#labelNocturnos').removeClass("desactivado");
	$('#labelDirectos').removeClass("desactivado");
	$('input[name=LIFERAY_SHARED_isTrainTrip]').val("false");
	$('input[name=LIFERAY_SHARED_isShipTrip]').val("false");
	$(document).ready(function(){
		$("#JourneySearchPaxType_3").show();
		$("#passengerCommentInfo_2").html("");
	});
}

/*
 * Cambios en la selección de pasajeros por tren de Reyes Magos. Cambiar edad del niño y mostrar tooltip.
 */
function enableReyesMagosChanges(){
	$("#passengerComment_2").text($("#passengerComment_2").text().replace('4','0'));
	$("#passengerComment_2").after("<span class='icn-information' aria-hidden='true' data-toggle='tooltip' title='"+i18n.t('journeysearch.reyes.magos.tooltip')+"'></span>");
	$('[data-toggle="tooltip"]').bstooltip();
}

/*
 * Cambios en la selección de pasajeros por tren de Reyes Magos. Cambiar edad del niño y eliminar tooltip.
 */
function disableReyesMagosChanges(){
	$("#passengerComment_2").text($("#passengerComment_2").text().replace('0','4'));
	$("#passengerComment_2").next("span").remove()
}

'use strict';
var constraints = {};
var journeysearchValidator = null;
var errorListGeneral = null;


/**
 * Inicializa la parte de los combos
 */
function initJourneyCombos()
{
	// Evento para intercambiar el origen por el destino
	$("#switchStations").off("click").on("click", switchStationsJourney);
	//Cargamos el autocompletable del combo de origines
	$("#" + params["originStationName"]).val(params["selectedOriginName"]);
	$("#" + params["originStationId"]).val(params["selectedOriginId"]);
	$("#" + params["originStationSimplifiedName"]).val(params["selectedOriginStationSimplifiedName"]);
	$("#" + params["originStationIsMoveliaStop"]).val(params["selectedOriginStationIsMoveliaStop"]);
	//Cargamos el autocompletable del combo de destinos
	$("#" + params["destinationStationNameId"]).val(params["selectedDestinationName"]);
	$("#" + params["destinationStationId"]).val(params["selectedDestinationId"]);
	$("#" + params["destinationStationSimplifiedName"]).val(params["selectedDestinationStationSimplifiedName"]);
	$("#" + params["destinationStationIsMoveliaStop"]).val(params["selectedDestinationStationIsMoveliaStop"]);

	var urlOrigins = createURLStation(params["jsonGetOriginsURL"],params["widget"],params["locationMode"],params["regionalZone"],params["code"],params["timetableMode"]);
	var urlUsualsOrigins =createURLStation(params["jsonGetUsualOriginsURL"],params["widget"],params["locationMode"],params["regionalZone"],params["code"],params["timetableMode"]);
	initAutocompleteOrigins(params["originStationName"],params["originStationId"],urlOrigins,urlUsualsOrigins,true,params["isTrainTrip"],true,params["isRoundTrip"],
			params["isShipTrip"], params["originStationSimplifiedName"], params["originStationIsMoveliaStop"]);

	var urlDestinations = createURLStation(params["jsonGetDestinationsForOriginURL"],params["widget"],params["locationMode"],params["regionalZone"],params["code"],params["timetableMode"]);
	var urlJsonUsualDestinations= createURLStation(params["jsonGetUsualDestinationsForOriginURL"],params["widget"],params["locationMode"],params["regionalZone"],params["code"],params["timetableMode"]);
	initAutocompleteDestinations(params["namespace"],params["destinationStationNameId"],params["destinationStationId"],urlDestinations,params["originStationId"],urlJsonUsualDestinations,true,params["isTrainTrip"],
			params["trenReyesMagosDestinationId"],params["isRoundTrip"], params["isShipTrip"], params["destinationStationSimplifiedName"], params["destinationStationIsMoveliaStop"]);
}

/**
 * Inicializa el componente del buscador
 */
//TODO: Es peligroso recoger el namespace en JS del parametro global params["namespace"], porque en caso de que haya varios
//portlets en una pagina, queda dependiente del orden de carga cual será el valor de dicho parametro
//Para solucionar esto, habría que hacer que initJourneyCombos reciba el parametro de namespace, y que cada portlet
//que incluya los combos, envie de forma inequivoca su propio namespace
function initJourneySearchForm() {

	//Inicializamos los combos de origen y destino
	initJourneyCombos();

	// Tratamiento de las restricciones del journeySearch
	if (params["constraints"] != undefined && params["constraints"] != "") {
		constraints = JSON.parse(params["constraints"]);
		// De momento eliminamos la intro
		constraints["intro"] = "";
	} else {
		constraints["maxPassengers"] = 20;
		constraints["minPassengers"] = 1;
		constraints["allowOutward"] = true;
		constraints["allowReturn"] = true;
		constraints["allowOpenReturn"] = true;
		constraints["title"] = "";
		constraints["intro"] = "";
	}

	$("#"+params["namespace"]+"departureDate").datepicker({
		beforeShowDay: function (date) {
			// Desactiva los dias de Busnavidad elegidos por parametro config
			if (params["isBusnavidad"] && params["excludedDatesNaviluz"]) {
				var validDay = true;
				params["excludedDatesNaviluz"].split(":").forEach(function(dateIndex){
					if (date.getTime() == getDateFromString(dateIndex).getTime()) {
						validDay = false;
					}
				});
				// Solo hacemos return si es false
				if (!validDay) {
					return [false];
				}
			}

			var date1 = $.datepicker.parseDate($.datepicker._defaults.dateFormat, $("[name=departureDate]").val());
			var date2 = $.datepicker.parseDate($.datepicker._defaults.dateFormat, $("[name=returnDate]").val());
			if(date1 == null && date2 != null){
				date1 = $.datepicker.parseDate($.datepicker._defaults.dateFormat, $("[name=returnDate]").val());
			}
			var style = "";
			if( (date1 && date.getTime() == date1.getTime()) || (date2 && date.getTime() == date2.getTime()) ){
				style = "dp-highlight";
			}else if(date2 && date > date1 && date < date2){
				style = "dp-highlight-medium";
			}

			return [true, style];
		},
		onSelect: function(dateText, inst) {
			$("[name=departureDate]").val(dateText);
			$("[name=returnDate]").val("");
			var d = new Date();
			if (constraints["dateFrom"] != undefined) {
				$(this).datepicker("option", "minDate", getDateFromString(constraints["dateFrom"]));
			}else{
				$(this).datepicker("option", "minDate", d);
			}

			$("[name=returnDate]").datepicker("option", "minDate", dateText);
			$(this).trigger('change');
		},
		onClose: function(dateText, inst) {
//            this.trigger('focus');
//            this.blur();
	        //Por si se ha añadido dinamicamente el class "hide-year", lo quitamos
			//Lo hacemos con un timeout, porque de otra manera, llega a verse el año durante un instance
			setTimeout(function(){
				inst.dpDiv.removeClass("hide-year");
			}, 500);
			$("[name=departureDate]").valid();

			/* 2022-04 WA-4592 Comentamos este bloque.
			Con esto se hacia que la fecha de Vuelta reciba el foco despues de seleccionar la fecha de Ida.
			Hay destinos que deben bloquear la fecha de vuelta (ej, lagos de Covadonga),
			y este codigo esta permitiendo que en el paso 1 de compra el usuario pueda editarla.
			Se han hecho pruebas para verificar que habiendo comentado esto no se afecta al comportamiento del buscador */
			/*
			if(!window.matchMedia("(max-width: 767px)").matches){
				setTimeout(function(){
            		$("[name=returnDate]").trigger('focus');
            	}, 500);
			}
			*/
		}
	});

	// WA-6756 Muevo este setDefaults al jquery-ui-datepicker-locales.js porque por orden de carga,
	// al llegar aqui ya se esta mostrando el journeyserach abierto, haciendo que el calendario se cargara
	// en ingles por defecto
	//$.datepicker.setDefaults($.datepicker.regional[i18n.locale]);
	if (constraints["dateFrom"] != undefined) {
		$("[name=departureDate]").datepicker("option", "minDate", getDateFromString(constraints["dateFrom"]));
	} else {
		$("[name=departureDate]").datepicker("option", "minDate", 0);
	}

	if (params["isBusnavidad"] && params["startDateNaviluz"]) {
		$("[name=departureDate]").datepicker("option", "minDate", getDateFromString(params["startDateNaviluz"]));
	}  else {
		$("[name=departureDate]").datepicker("option", "minDate", 0);
	}

	if (constraints["dateTo"] != undefined) {
		$("[name=departureDate]").datepicker("option", "maxDate", getDateFromString(constraints["dateTo"]));
	}

	if (params["isBusnavidad"] && params["endDateNaviluz"]) {
		$("[name=departureDate]").datepicker("option", "maxDate", getDateFromString(params["endDateNaviluz"]));
	}

	$("[name=returnDate]").datepicker({
		beforeShowDay: function(date) {
			$.datepicker.regional[i18n.locale];
			var date1 = $.datepicker.parseDate($.datepicker._defaults.dateFormat, $("[name=departureDate]").val());
			var date2 = $.datepicker.parseDate($.datepicker._defaults.dateFormat, $("[name=returnDate]").val());
			if(date1==null && date2!=null){
				date1 = $.datepicker.parseDate($.datepicker._defaults.dateFormat, $("[name=returnDate]").val());
			}
			var style = "";

			if (date1 && date.getTime() == date1.getTime()){
				style = "dp-highlight selected";
			}else if (date2 && date.getTime() == date2.getTime()){
				style = "dp-highlight selected return";
			}else if(date2 && date > date1 && date < date2){
				style = "dp-highlight-medium";
			}
			return [true, style];
		},
		onSelect: function(dateText, inst) {
			var date1 = $.datepicker.parseDate($.datepicker._defaults.dateFormat, $("[name=departureDate]").val());

			$("[name=returnDate]").val(dateText);
			$(this).datepicker("option", "minDate", date1);
			$(this).trigger('change');
		},
		onClose: function(dateText, inst) {
           //Por si se ha añadido dinamicamente el class "hide-year", lo quitamos
			inst.dpDiv.removeClass("hide-year");
		}
	});


	if (constraints["dateFrom"] != undefined) {
		$("[name=returnDate]").datepicker("option", "minDate", getDateFromString(constraints["dateFrom"]));
	} else {
		if($("[name=returnDate]").val()==""){
			$("[name=returnDate]").datepicker("option", "minDate", 0);
		}else{
			$("[name=returnDate]").datepicker("option", "minDate", getDateFromString($("[name=returnDate]").data("date-from")));
		}
	}
	if (constraints["dateTo"] != undefined) {
		$("[name=returnDate]").datepicker("option", "maxDate", getDateFromString(constraints["dateTo"]));
	}

	if($("#employee").is(":checked")){
		$(".ui-spinner-button").prop( "hidden", true );
		$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-1").val("1");
		$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-1").prop( "readonly", true );
		$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-2").val("0");
		$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-2").prop( "disabled", true );
		$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-3").val("0");
		$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-3").prop( "disabled", true );
		$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-4").val("0");
		$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-4").prop( "disabled", true );
		$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-5").val("0");
		$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-5").prop( "disabled", true );
	}

	if (!constraints["allowOutward"]) {
		$("[name=travelType][value=OUTWARD]").parent().hide();
	}
	if (!constraints["allowOpenReturn"]) {
		$("[name=travelType][value=OPEN_RETURN]").parent().hide();
	}
	if (!constraints["allowReturn"]) {
		$("[name=travelType][value=RETURN]").parent().hide();
	}
	$("[name=travelType][value=OUTWARD]").on("change",clearReturnDate);
	$("[name=travelType][value=OPEN_RETURN]").on("change",clearReturnDate);

	function clearReturnDate() {
		$("[name=returnDate]").datepicker("setDate","");
	}


	// Codigo promocional, inicializacion
	$("#promoCodeWindow").on("click", function(e) {
		e.preventDefault();
		$(this).toggle();
		$("#" + $(this).data("ref")).toggle();
		$(".promo-code-error").hide();
		if($("#" + $(this).data("ref")).is(":visible")) {
			$("#" + $(this).data("ref") + " input").val("");
			$("#" + $(this).data("ref") + " input").first().trigger('focus');
		}
	});

	// Checker del codigo promocional
	$("#promoCodeChecker").on("click", {widgetMode: params["widget"], submit: false}, function(e) {
		var $youngPromoCodeScope = angular.element("#youngPromoCode").scope();
		var promoCodeVal = $("#" + $("#promoCodeChecker").data("ref")).val();
		if ($youngPromoCodeScope != undefined && $youngPromoCodeScope.youngPromoActive && promoCodeVal != "" && promoCodeVal.match($youngPromoCodeScope.youngPromoRegexp)) {
			$youngPromoCodeScope.doCheckYoungPromoCode();
			if(!$youngPromoCodeScope.$$phase) {
				$youngPromoCodeScope.$apply();
			}
		}

		checkPromoCode(e);
	});

	$("#promoCodeClear").on("click", function(e) {
		e.preventDefault();

		// Uncheck young promo 2023 checkbox
		var $youngPromoCodeScope = angular.element("#youngPromoCode").scope();
		if ($youngPromoCodeScope != undefined && $("input[name=promoCode]").val().match($youngPromoCodeScope.youngPromoRegexp)) {
			$youngPromoCodeScope.unCheckYoungPromoCode();
			if(!$youngPromoCodeScope.$$phase) {
				$youngPromoCodeScope.$apply();
			}
		}

		//invocamos al ajax que borrara de sesion y cookies
		deletePreLoadVoucher();

		$("#promoCodeWindow").toggle();
		$("#" + $(this).data("ref")).text("");
		$("#" + $(this).data("ref-code")).val("");
		$("#" + $(this).data("ref-alsapass-passenger")).val("");
		$("#" + $(this).data("ref-voucher-passenger")).val("");
		$(this).parent().hide();
	});

	$("#promoCode").on('keydown', function(e) {
		if(e.keyCode==13) {
			$(this).siblings("a").trigger("click");
			e.preventDefault();
		}
	});

	$.validator.addMethod("dateRange", function() {
		if ($("[name=travelType]").val() != "OUTWARD" && $("[name=travelType]").val() != "OPEN_RETURN") {
		    var date1 = $("[name=departureDate]").datepicker("getDate");
		    var date2 = $("[name=returnDate]").datepicker("getDate");
		    return (date1 <= date2);
		}
		return true;
	}, "");

	$.validator.addMethod("minPax", function() {
		var valor=$("[name=numPassengers]").val();
		if (valor<constraints["minPassengers"]) {
			return false;
		}
		return true;
	}, $.validator.messages.minPax);


	$.validator.addMethod("originStation", function() {
		var val = $("input[name=originStationId]").val();
		var empty = !(val != "") && (val != undefined);
		return !empty;
	}, $.validator.messages.originRequired);

	$.validator.addMethod("destinationStation", function() {
		var val = $("input[name=destinationStationId]").val();
		var empty = !(val != "") && (val != undefined);
		return !empty;
	}, $.validator.messages.destinationRequired);

	// Validación del formulario
	journeysearchValidator = $("#journeySearchForm").validate({
		showErrors: function(errorMap, errorList) {return;
			errorListGeneral = errorList;
	        $.each(this.validElements(), function (index, element) {
	            var $element = $(element);
	            $element.data("title", "") // Clear the title - there is no error associated anymore
	                .removeClass("error")
	                .popover("destroy");
	        });

	        // Create new tooltips for invalid elements
	        $.each(errorList, function (index, error) {
	            var $element = $(error.element);
	            $element.popover("destroy"); // Destroy any pre-existing tooltip so we can repopulate with new tooltip content
	            $element.data("title", error.message);
	            $element.addClass("error");
	            $element.popover({
	                trigger: "manual",
	                placement: "top",
	                content: error.message,
	                template: "<div class=\"tooltip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\"><div class=\"popover-content\"></div></div></div>"
	              }); // Create a new tooltip based on the error messsage we just set in the title
	            $element.popover("show");

	            if($element[0].name=="destinationStationNameId" || $element[0].name=="originStationNameId"){
	            	$element.attr("placeholder", i18n.t('zz16.journeysearch.write.example'));
	            }
	        });
	        if(errorList!=null && errorList[0]!=null){
	        	$.each(journeysearchValidator.currentForm, function (index, inputError) {
	    			if(  (inputError.validity.valid==false) ){
	    				var element = $(inputError);
	    	            element.popover("show");
	    			}
	    			if(inputError.name=="numPassengers" && inputError.value<=0){
	    				var element = $(inputError);
	    	            element.popover("show");
	    			}
	    		});
	    	}

	    },
		onfocusout: function(element) {
            this.element(element);
        },
		onkeyup: false,
		onclick: false,
		focusInvalid: true,
		ignore: "",
		messages: {
			returnDate: $.validator.messages.date,
			departureDate: $.validator.messages.date,
			originStationNameId: $.validator.messages.originRequired,
			destinationStationNameId: $.validator.messages.destinationRequired,
			numPassengers:function(element) {
				alert(constraints["minPassengers"]);
				if (constraints["minPassengers"] > 1)
				{
					return $.validator.messages.originRequired;
				}
				else
				{
					return $.validator.messages.minPax;
				}
			}
		},
		rules: {
			originStationNameId: {
				originStation: true
			},
			destinationStationNameId: {
				destinationStation: true
			},
			departureDate: {
				required: true
			},
			returnDate: {
				required: function(element) {
					return ($("[name=travelType]").val() != "OUTWARD" && $("[name=travelType]").val() != "OPEN_RETURN");
				},
				dateRange: true
			},
			numPassengers: {
				required: true,
				minPax: true
			}
		}

	});

	$("#journeySearchFormButton").on("click", function(e) {
//		//$(this).attr("disabled", "disabled");
		if ($("#promoCode").is(":visible") && $("#promoCode").val() != "") {
			// Hay que validar un código promocional
			checkPromoCode({data: {widgetMode: params["widget"], submit: true, buttonId: this}});
		} else {
			//Validar formulario de búsqueda y enviar
			validateAndSubmit(this);
		}
	});

	$("#employee").on("click", function(e) {
		if($("#employee").is(":checked")){
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-1").val("1");
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-1").prop( "readonly", true );
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-2").val("0");
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-2").prop( "disabled", true );
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-3").val("0");
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-3").prop( "disabled", true );
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-4").val("0");
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-4").prop( "disabled", true );
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-5").val("0");
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-5").prop( "disabled", true );
			$(".ui-spinner-button").prop( "hidden", true );
		}else{
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-1").val("1");
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-1").prop( "readonly", false );
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-2").val("0");
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-2").prop( "disabled", false );
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-3").val("0");
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-3").prop( "disabled", false );
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-4").val("0");
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-4").prop( "disabled", false );
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-5").val("0");
			$("#_JourneySearchPortlet_WAR_Alsaportlet_passengerType-5").prop( "disabled", false );
			$(".ui-spinner-button").prop( "hidden", false );
		}
	});


	// Establece la intro de la oferta
	if (constraints["intro"] != "") {
		setJourneySearchIntro(constraints["intro"]);
	}

	// En caso de encontrarnos en un popup, como un widget, cambiamos el action del formulario
	if (params["widget"] == true) {
		var action = $("#journeySearchForm").attr("action");
		action = action.replace("/widget", "");
		$("#journeySearchForm").attr("action", action);
		$("#journeySearchForm").attr("target", "_top");
		$("[name=departureDate]").datepicker("option", "numberOfMonths", 1);
		$("[name=departureDate]").datepicker("option", "showOtherMonths", false);
		$("[name=departureDate]").datepicker("option", "selectOtherMonths", false);
		$("[name=returnDate]").datepicker("option", "numberOfMonths", 1);
		$("[name=returnDate]").datepicker("option", "showOtherMonths", false);
		$("[name=returnDate]").datepicker("option", "selectOtherMonths", false);
		$("html").addClass("journeysearch-popup");
	}

}

/**
 * Control de evento de intercambiar origen por destino
 */
var switchStationsJourney = function(e) {
	e.preventDefault();
	if ($("input[name=destinationStationNameId]").is(':disabled') || !$("input[name=destinationStationId]").val() || !$("input[name=destinationStationNameId]").val()){
	}else{
		var auxName = $("input[name=originStationNameId]").val();
		var auxId = $("input[name=originStationId]").val();
		$("input[name=originStationNameId]").val($("input[name=destinationStationNameId]").val());
		$("input[name=originStationId]").val($("input[name=destinationStationId]").val());
		$("input[name=destinationStationNameId]").val(auxName);
		$("input[name=destinationStationId]").val(auxId);
	}
};

/**
 * Comprueba la validez del formulario de búsqueda y lo envía si es correcto
 * @param journeySearchFormButton
 */
function validateAndSubmit(journeySearchFormButton) {
	//Llegamos a través de la comprobación correcta del promoCode.
	top.window.location.href = $("#journeySearchForm").attr("action") + "&" + $("#journeySearchForm").serialize();
//	if (journeysearchValidator.form()) {
//		// Formulario validado, enviamos
//		// WA-1452 enviamos el formulario por URL para permitir la navegación atrás
//		// $("#journeySearchForm").submit();
//		top.window.location.href = $("#journeySearchForm").attr("action") + "&" + $("#journeySearchForm").serialize();
//	} else {
//		$(journeySearchFormButton).prop("disabled", false);
//	}
}

/**
 * Función que establece y muestra la intro de la promo
 * @param intro
 */
function setJourneySearchIntro(intro) {
	$("#journeySearchIntro").text(intro).show();
}

function reloadLists(component) {
	// Obtenemos los datos de los servicios y se los enviamos al componente para
	// que los cree.
	if (component.isOriginsInput()) {
		return $.when(
				createOriginsStagesList(component),
				createUsualOriginsStagesList(component)
		).always(function() {//Siempre

		});
	} else {
		return $.when(
				createDestinationsStagesList(component),
				createUsualDestinationsStagesList(component)
		).always(function() {//Siempre

		});
	}
}

/**
 * Si el código está validado se hacen las operaciones en vista consecuentes
 * @param elto
 * @param code
 * @param data
 * @param shouldSubmit
 * @param buttonId
 */
function codigoValido(elto, code, data, shouldSubmit, buttonId) {
	$("#" + elto.data("ref")).val(code);
	$("#" + elto.data("fieldset") + "> #promoCodeLabel").first().text(code);
	$("#" + elto.data("fieldset") + " input[name=promoCode]").val(code);
	//Si se reciben los datos del pasajero AlsaPass, lo almacenamos en un campo hidden en formato Json
	if (data["alsaPassPassenger"] != undefined) {
		$("#" + elto.data("fieldset") + " input[name=jsonAlsaPassPassenger]").val(JSON.stringify(data["alsaPassPassenger"]));
	}
	if (data["voucherPassenger"] != undefined) {
		$("#" + elto.data("fieldset") + " input[name=jsonVoucherPassenger]").val(JSON.stringify(data["voucherPassenger"]));
	}
	$("#" + elto.data("fieldset")).show();
	elto.parent().hide();

	if (shouldSubmit) {
		//angular.element($("#journeySearchForm")).scope().promoError = false;
		validateAndSubmit(buttonId);
	}
}

function codigoInvalido(data, widgetMode, shouldSubmit, buttonId) {
	// si el input de codigo promocional es visible, vaciar su valor
	var codeInput = $("#promoCodeForm").find("input").first();
	if(codeInput.is(":visible")){
		codeInput.val("");
	}

	if ($("input[name=promoCode]").val() != "") {
		$("#promoCodeClear").click();
	}

	if (widgetMode) {
		$(".promo-code-error").html(data["message"]);
		$(".promo-code-error").show();
	} else {
		// Este comportamiento tambien lo implementamos en journeySearchController.js si existe el parametro JOURNEY_SEARCH_PROMOCODE_ERROR
		$("#promoCodeModal").appendTo("body");
		$("#promoCodeModal").find(".sag-modal-body").html(data["message"]);
		$("#promoCodeModal").modal();

		$("#promoCodeModal").off("shown.bs.modal");
		$("#promoCodeModal").on("shown.bs.modal", function() {
			$("div.sag-modal-footer button.btn-primary").trigger('focus');

			//no permitimos el acceso a la info "detras" de la modal a los lectores de pantalla
			$("div.home.content-responsive").attr("aria-hidden", "true");
		});

		$("#promoCodeModal").off("hidden.bs.modal");
		$("#promoCodeModal").on("hidden.bs.modal", function() {
			$("div.home.content-responsive").attr("aria-hidden", "false");
		});
	}
	if (shouldSubmit) {
		$(buttonId).prop("disabled", false);
	}
}

/**
 * Función que comprueba la validez de un código promocional
 * Recibe como parámetro event.data.widgetMode, que nos dice si estamos en modo widget
 * Además recibe event.data.submit, que indica si se debe enviar el formulario tras chequear el código
 * @param e evento
 */
function checkPromoCode(e) {

	var validCode = false;
	var widgetMode = false;
	var shouldSubmit = false;
	var buttonId = null;
	if (e != undefined) {
		widgetMode = (e.data.widgetMode == true);
		shouldSubmit = e.data.submit;
		if (shouldSubmit) {
			buttonId = e.data.buttonId;
		} else {
			e.preventDefault();
		}
	}
	var elto = $("#promoCodeChecker");
	var code = $("#" + elto.data("ref")).val();
	var url = params["ajaxCheckPromotionalCode"];
	var url_collective = params["ajaxCheckPromotionalCollectiveCode"];


	//nuevos campos para validar el codigo promocional
	var originStationId = $("input[name=originStationId]").val();
	var destinationStationId = $("input[name=destinationStationId]").val();
	var departureDate = $("[name=departureDate]").val();
	var returnDate =    $("[name=returnDate]").val();
	var passengerType1 =    $("[name=passengerType-1]").val();
	var passengerType2 =    $("[name=passengerType-2]").val();
	var passengerType3 =    $("[name=passengerType-3]").val();
	var passengerType4 =    $("[name=passengerType-4]").val();
	var passengerType5 =    $("[name=passengerType-5]").val();
	var travelType = $("[name=travelType]").val();


	if (widgetMode) {
		// Quitamos el /widget para cuando nos encontremos en modo widget, genera la url incorrecta
		url = url.replace("/widget", "");
		url = url.replace(/AjaxCheckPromotionalCode&(.)*/,"AjaxCheckPromotionalCode");
		url_collective = url_collective.replace("/widget", "");
		url_collective = url_collective.replace(/AjaxCheckPromotionalCollectiveCode&(.)*/,"AjaxCheckPromotionalCollectiveCode");
	}
	code = code.toUpperCase();
	$("#" + elto.data("ref")).val(code);
	var seats = $("[name=numPassengers]").val();

	if (isNaN(seats)) {
		$("#promoCodeModal").appendTo("body");
		$("#promoCodeModal").find(".sag-modal-body").html(i18n.t('journeysearch.invalid-passengers-amount'));
		$("#promoCodeModal").modal();
	} else {
		if (code!="") {
			checkPromotionalCode(url, code, seats, originStationId,destinationStationId,departureDate,returnDate,passengerType1,passengerType2,passengerType3,passengerType4,passengerType5,travelType)
			.done(function(data)
			{
				if (data["valid"] == true && data.questions && Object.prototype.toString.call(data.questions) === '[object Array]')
				{
					/* Formulario de preguntas */
					showQuestionsForm(data.questions, url_collective, code)
					.then(function(data)
					{
						codigoValido(elto, code, data, shouldSubmit, buttonId);
					}, function() {});
				}
				else
				{
					if (data["valid"] == true)
				    {
					   codigoValido(elto, code, data, shouldSubmit, buttonId);
				    }
				    else
				    {
					   codigoInvalido(data, widgetMode, shouldSubmit, buttonId);
				    }
			  }
			}).fail(function() {
				if (shouldSubmit) {
					$(buttonId).prop("disabled", false);
				}
				$("#promoCodeWindow").toggle();
				$("#promoCodeForm").hide();
				$("#promoCodeForm").find("input").first().val("");
				if (!widgetMode) {
					$("#promoCodeModal").appendTo("body");
					$("#promoCodeModal").find(".sag-modal-body").html(i18n.t('promotions.code-not-valid.validation-error'));
					$("#promoCodeModal").modal();
				}
				return false;
			});
		}
	}
}

/**
 * Recalcula la posición de los datepicker, para cuando se redimensione la pantalla, etc
 * @param elto El datepicker del cual queremos recalcular su posición
 */
function recalculateDatepickerPosition(elto)  {
	var _left = elto.offset().left;
	var _top = elto.offset().top + elto.outerHeight() + 5;
	setTimeout(function() {
		elto.datepicker('widget').css({left: _left});
		elto.datepicker('widget').css({top: _top});
	}, 1);
}



/**
* Función para ocultar el input del código promocional
*/
function hidePromoCode() {
$("#promoCodeForm").hide();
$("#promoCodeWindow").show();

}


/**
 * Calls ajax function to check the promotional code
 * @param code
 */
function checkPromotionalCode(url, code, seats,originStationId,destinationStationId,departureDate,returnDate,passengerType1,passengerType2,passengerType3,passengerType4,passengerType5,travelType) {
	var data = {};
	data[params["namespace"] + "promoCode"] = code;
	data[params["namespace"] + "seats"] = seats;
	data[params["namespace"] + "originStationId"] = originStationId;
	data[params["namespace"] + "destinationStationId"] = destinationStationId;
	data[params["namespace"] + "departureDate"] = departureDate;
	data[params["namespace"] + "returnDate"] = returnDate;
	data[params["namespace"] + "passengerType-1"] = passengerType1;
	data[params["namespace"] + "passengerType-2"] = passengerType2;
	data[params["namespace"] + "passengerType-3"] = passengerType3;
	data[params["namespace"] + "passengerType-4"] = passengerType4;
	data[params["namespace"] + "passengerType-5"] = passengerType5;
	data[params["namespace"] + "travelType"] = travelType;




	data["widgetMode"] = params["widget"];
	return $.ajax({
		type: 'GET',
		async: false,
		url: url,
		data: data,
		dataType: 'json'
	});
}

/**
 * Calls ajax function to check the promotional code
 * @param code
 */
function checkQuestions(url, code, questions) {
	var data = {};
	data[params["namespace"] + "promoCode"] = code;
	data[params["namespace"] + "questions"] = "{questions:"+ questions+"}";
	data["widgetMode"] = params["widget"];
	return $.ajax({
		type: 'POST',
		async: true,
		url: url,
		data: data,
		dataType: 'json'
	});
}



/**
 * Llamada al cancelar el formulario de preguntas
 * @param dfd
 * @returns {Number}
 */
function cancelPromocode(dfd) {
	$("#promoCodeWindow").toggle();
	$("#promoCodeForm").find("input").first().val("");
	$("#promoCodeForm").hide();

	//console.log("Cancelado");
	dfd.reject();
	return 0;
}

/**
 * Llamada al aceptar el formulario de preguntas
 * @param dfd
 * @param url
 * @param code
 */
function acceptPromocode(dfd, url, code) {
	if (questionsValidator.form()) {

		var form = $("#promoQuestionsForm");
		var questions = JSON.stringify(form.serializeArray());
		//console.log(questions);
		$("#okQModal").attr("disabled", "disabled");
		$("#okSpinner").removeClass("hidden-spin");

		checkQuestions(url, code, questions).then(function(data) {
			$("#okQModal").prop("disabled", false);
			$("#okSpinner").addClass("hidden-spin");
			//console.log("Ajax éxito");
			//console.log(data);

			if (data.cdresultado == "S") {
				$("#promoCodeQModal").modal("hide");
				//console.log("Aceptado");
				dfd.resolve(1);
			    return 1;
			}
			if (data.cdresultado == "N") {
				//Carnet joven no vigente
				$("#errorMsgQModal").html(i18n.t('zz12.promotions.code-not-valid.invalid-card'));
			}
			if (data.cdresultado == "NA") {
				//Error
				$("#errorMsgQModal").html(i18n.t('promotions.code-not-valid.validation-error'));
			}

		}, function() {
			$("#okQModal").prop("disabled", false);
			$("#okSpinner").addClass("hidden-spin");
			console.log("Error en la llamada al chequear el código promocional");
			$("#errorMsgQModal").html(i18n.t('promotions.code-not-valid.validation-error'));
		});

	} else {
		//console.log("datos incorrectos");
	}

}

//Validación del formulario
var questionsValidator = null;

/**
 * Compone el formulario de preguntas para validar el código promocional
 * @param questions
 */
function showQuestionsForm(questions, url, code) {

	var dfd = jQuery.Deferred();
	$("#promoCodeQModal").appendTo("body");
	var content = '<form id="promoQuestionsForm" class="form-promo-questions form-horizontal" role="form">';
	for (var i = 0; i < questions.length; i++) {
		content += '<div class="form-group">';
			content += '<label class="control-label col-md-4" for="q0' + i + '">';
			content +=  questions[i].name;
			content += '*</label>';
			content += '<div class="col-md-4">';
			if (questions[i].type === "text") {
				content += '<input type="text" class="form-control" id="q0' + i + '" name="' + questions[i].name +
					'" required data-test-id="questionInput" data-test-question-index = "' + i + '">';
			} else {
				console.log("Unsupported question type.");
			}
			content += '</div>';
		content += '</div>';
		if (questions[i].description && questions[i].description != '') {
			content += '<div class="form-group col-md-8">';
			content += '<div class="description">' + questions[i].description + '</div>';
			content += '</div>';
		}
	}
	content += '</form>';
	content += '<p id="errorMsgQModal" class="error" data-test-id="errorMsg"></p>';
	//console.log(content);

	$('#cancelQModal').off('click').on("click", function () {
		cancelPromocode(dfd);
	});
	$('#okQModal').off('click').on("click", function () {
		acceptPromocode(dfd, url, code);
	});

	$("#promoCodeQModal").find(".sag-modal-body").html(content);
	//Validación del formulario
	questionsValidator = $("#promoQuestionsForm").validate({
	});
	$("#promoQuestionsForm input").each(function () {
		$(this).rules("add", {
			required: true
		});
	});

	$("#promoCodeQModal").modal();
	return dfd.promise();
}

$.fn.centerDatePicker = function () {
	 $(".ui-datepicker").addClass("pruebaDP");
	 return this;
};


/**
 * Todo lo nuevo de bonos y precarga
 */


	/**
	 * No se quiere precargar un bono activo asi que se cierra la ventana emergente, se cierra el campo codigo promocional
	 * y se precargan si existen datos previos de una compra normal (datos de sesion o cookies)
	 * @returns
	 */
	function responseNoPopUpPreloadVoucher(){
		hidePromoCode();
		$("#popUpBonoPreload").hide();
		$("#journeySearchFormButtonjs").prop("disabled", false);

	}



	/**
	 * Llamada para recuperar los datos del bono activo de un usuario alsaplus y precargarlo en el buscador
	 * @returns
	 */
	function responseSiPopUpPreloadVoucher(){
		$.ajax({
			type: 'GET',
			async: false,
			url: params["AjaxPreLoadVoucherURL"],
			data: {"responsePreLoad":"V"},
			dataType: 'json'
			})
			.done(function(data){
				 if (data["isVoucherWithoutRoute"] || (data["originId"]!=undefined && data["destinationId"]!= undefined)) {
					// Desactiva el buscador en modo roundTrip
					$('input[name=travelTypeOutward]').prop('disabled', false);
					$('input[name=travelTypeOpenReturn]').prop('disabled', false);
					$("#angularSwitchStations").show();
					$('input[name=LIFERAY_SHARED_isRoundTrip]').val("false");
					angular.element($("#journeySearchForm")).scope().isTrainTravel(false);

					if (!data["isVoucherWithoutRoute"]) {
						angular.element($("#journeySearchForm")).scope().originStationId = data["originId"];
						angular.element($("#journeySearchForm")).scope().originStationName = data["originName"];
						angular.element($("#journeySearchForm")).scope().previousOriginName = data["originName"];
						angular.element($("#journeySearchForm")).scope().destinationStationId = data["destinationId"];
						angular.element($("#journeySearchForm")).scope().destinationStationName = data["destinationName"];
						angular.element($("#journeySearchForm")).scope().previousDestinationName = data["destinationName"];
					}

					// WA-6166 - Dejar de cargar fecha en precarga bonos
					// se quita la fecha de ida y la fecha de vuelta
					angular.element($("#journeySearchForm")).scope().returnDateDisplay = false;
					angular.element($("#journeySearchForm")).scope().search.travelType.outward = true;
					angular.element($("#journeySearchForm")).scope().search.travelType.open_return = false;
					angular.element($("#journeySearchForm")).scope().search.travelType.value = "OUTWARD";
					angular.element($("#journeySearchForm")).scope().departureDate = "";
					angular.element($("#journeySearchForm")).scope().returnDate = "";
					angular.element($("#journeySearchForm")).scope().journeySearchForm.departureDate.$pristine = true;
					angular.element($("#journeySearchForm")).scope().journeySearchForm._returnDate.$pristine = true;
					angular.element($("#journeySearchForm")).scope().$apply();

					//se carga el bono en codigo promocional
					var promoCode = data["promoCode"];
					$("#promoCodeWindow").click();
					$("#promoCode").val( promoCode );
					var elto = $("#promoCodeChecker");
					$("#" + elto.data("ref")).val(promoCode);
					$("#" + elto.data("fieldset") + "> #promoCodeLabel").first().text(promoCode);
					$("#" + elto.data("fieldset") + " input[name=promoCode]").val(promoCode);
					$("#" + elto.data("fieldset")).show();
					elto.parent().hide();

					// Cambia el titulo del bono aplicado a Bono Aplicado:
					$("#promoCodeTitle").text(params["promoCodeAppliedTitle"]);

					//ocultamos el pop-up
					$("#popUpBonoPreload").hide();
					angular.element($("#journeySearchForm")).scope().$apply();
					$("#journeySearchFormButtonjs").prop("disabled", false);
					$("#tooltipPromoCode").show();
					$("#tooltipPromoCode").delay(4250).fadeOut(400);

				}
			})
			.fail(function() {
					$("#promoCodeWindow").click();
					$("#promoCode").val('');

			});
	}

	/**
	 * Precarga de los bonos seleccionados desde el componente verde de la home (Angular)
	 * @returns
	 */
	function preloadVoucherHome(voucher){
		// Si esta condicion es valida es que estamos en el nuevo buscador (alsa-angular-workspace/journey-search)
		if (params.journeySearch && params.journeySearch["NEW_FUNNEL_ACTIVE"] == 'true' && $("#preloadVoucher").length) {
			params.journeySearch.preloadVoucher = voucher;
			$("#preloadVoucher").click();
		} else {
			// Desactiva el buscador en modo roundTrip
			$('input[name=travelTypeOutward]').prop('disabled', false);
			$('input[name=travelTypeOpenReturn]').prop('disabled', false);
			$("#angularSwitchStations").show();
			$('input[name=LIFERAY_SHARED_isRoundTrip]').val("false");
			angular.element($("#journeySearchForm")).scope().isTrainTravel(false);

			// Para bonos no vinculados a una ruta particular (bonos tarjeta)
			if (voucher.originStationId) {
				angular.element($("#journeySearchForm")).scope().originStationId = voucher.originStationId;
				angular.element($("#journeySearchForm")).scope().originStationName = voucher.originName;
				angular.element($("#journeySearchForm")).scope().previousOriginName = voucher.originName;
			}
			if (voucher.destinationStationId) {
				angular.element($("#journeySearchForm")).scope().destinationStationId = voucher.destinationStationId;
				angular.element($("#journeySearchForm")).scope().destinationStationName = voucher.destinationName;
				angular.element($("#journeySearchForm")).scope().previousDestinationName = voucher.destinationName;
			}

			// WA-6166 - Dejar de cargar fecha en precarga bonos
			// se quita la fecha de ida y la fecha de vuelta
			angular.element($("#journeySearchForm")).scope().returnDateDisplay = false;
			angular.element($("#journeySearchForm")).scope().search.travelType.outward = true;
			angular.element($("#journeySearchForm")).scope().search.travelType.open_return = false;
			angular.element($("#journeySearchForm")).scope().search.travelType.value = "OUTWARD";
			angular.element($("#journeySearchForm")).scope().departureDate = "";
			angular.element($("#journeySearchForm")).scope().returnDate = "";
			angular.element($("#journeySearchForm")).scope().journeySearchForm.departureDate.$pristine = true;
			angular.element($("#journeySearchForm")).scope().journeySearchForm._returnDate.$pristine = true;
			angular.element($("#journeySearchForm")).scope().$apply();


			//se carga el bono en codigo promocional
			if ($("input[name=promoCode]").val() != "") {
				$("#promoCodeClear").click();
			} else {
				hidePromoCode();
			}

			var promoCode = voucher.promoCode;
			$("#promoCodeWindow").click();
			$("#promoCode").val( promoCode );
			var elto = $("#promoCodeChecker");
			$("#" + elto.data("ref")).val(promoCode);
			$("#" + elto.data("fieldset") + " input[name=promoCode]").val(promoCode);
			$("#" + elto.data("fieldset") + "> #promoCodeLabel").first().text(promoCode);
			$("#" + elto.data("fieldset")).show();
			elto.parent().hide();

			// Cambia el titulo del bono aplicado a Bono Aplicado:
			$("#promoCodeTitle").text(params["promoCodeAppliedTitle"]);

			angular.element($("#journeySearchForm")).scope().$apply();
			$("#journeySearchFormButtonjs").prop("disabled", false);
			$("#tooltipPromoCode").show();
			$("#tooltipPromoCode").delay(4250).fadeOut(400);
		}
	}

	// Carga un codigo promocional (pasamos string)
	function preloadGenericPromocode(promoCode) {
		//se carga el bono en codigo promocional
		if ($("input[name=promoCode]").val() != "") {
			$("#promoCodeClear").click();
		} else {
			hidePromoCode();
		}

		$("#promoCodeWindow").click();
		$("#promoCode").val(promoCode);
		var elto = $("#promoCodeChecker");
		$("#" + elto.data("ref")).val(promoCode);
		$("#" + elto.data("fieldset") + " input[name=promoCode]").val(promoCode);
		$("#" + elto.data("fieldset") + "> #promoCodeLabel").first().text(promoCode);
		$("#" + elto.data("fieldset")).show();
		elto.parent().hide();

		// Cambia el titulo del bono aplicado a Bono Aplicado:
		$("#promoCodeTitle").text(params["promoCodeAppliedTitle"]);
	}

	/**
	 * Funcion para borrar la informacon sobre codigo promocional de bonos
	 * de la sesion y de la cookie
	 */
	function deletePreLoadVoucher()
	{
		$.ajax({
			type: 'GET',
			async: false,
			url: params["AjaxPreLoadVoucherDeleteURL"],
			data: {},
			dataType: 'html'
			})
	}

function updateFavoriteStation(stationId, journeyDirection, e) {
	// Al hacer clic en la estrella evitamos que se seleccione la estacion
	e.stopPropagation();

	// Activamos los tooltip vacios
	var favErrorTooltips = $(".ui-autocomplete li > .fa");
	favErrorTooltips.tooltip({
         content: function () {
             return this.getAttribute("title");
         },
     });

	// Obtenemos el elemento donde se ha hecho clic
	var elementFavBtn = $(e.target);

	$.ajax({
		type: 'GET',
		async: false,
		url: params["ajaxUpdateFavoriteStation"],
		data: {"stationId": stationId, "journeyDirection": journeyDirection},
		dataType: 'json'
	})
	.done(function(data){
		if (data === true && elementFavBtn[0] != undefined) {
			// En los tooltips, se limpian y ocultan los textos de error
			favErrorTooltips.attr("data-original-title", "");
			favErrorTooltips.attr("title", "");
			elementFavBtn.tooltip();
			//favErrorTooltips.bstooltip("option","hide");

			// Actualizamos clases
			if (elementFavBtn.hasClass("fa-star")) {
				elementFavBtn.removeClass("fa-star").addClass("fa-star-o");
			} else if (elementFavBtn.hasClass("fa-star-o")) {
				elementFavBtn.removeClass("fa-star-o").addClass("fa-star");
			}

			// Actualizamos (si es ida) los arrays de estaciones
			if (journeyDirection == "I") {
				var originStation = origins.responseJSON.find(function(origin) {return origin.id == stationId});
				var originUsualStation = originsUsuals.responseJSON.find(function(origin) {return origin.id == stationId});

				if (originUsualStation != undefined) {
					// se actualiza la estacion del listado usual
					updateFavoriteOriginUsualStationFlag(originUsualStation);

					if (originStation != undefined) {
						// se actualiza la estacion del listado general
						originStation.isFavorite = originUsualStation.isFavorite;
					}
				} else if (originUsualStation == undefined && originStation != undefined) {
					// se actualiza y aniade la estacion en el listado usual
					originStation.isFavorite = true;
					shiftPosFavoriteOriginUsualStation(originStation);
				}
			}
		}
	})
	.fail(function(data) {
		if (elementFavBtn[0] != undefined) {
			var tooltipErrorTxt = i18n.t('zzz06.favorite-stations.error.generic');

			if (data.responseText === "sizeLimitExceededErr") {
				tooltipErrorTxt = (journeyDirection == "I" ? i18n.t('zzz06.favorite-stations.error.max-origins') : i18n.t('zzz06.favorite-stations.error.max-destinations'));
			}

			// En el tooltip del elemento, se actualiza y muestra el texto de error
			elementFavBtn.attr("data-original-title", tooltipErrorTxt);
			elementFavBtn.attr("title", tooltipErrorTxt);
			elementFavBtn.bstooltip("option","show");
			elementFavBtn.tooltip().mouseover();
			setTimeout(function () { elementFavBtn.bstooltip("option","hide"); }, 4000);
		}
	});
}

function updateFavoriteOriginUsualStationFlag(station) {
	// toggle isFavorite
	station.isFavorite = !station.isFavorite;

	// se elimina del array de usuales
	originsUsuals.responseJSON.splice(originsUsuals.responseJSON.indexOf(station), 1);

	// se inserta al final o al princpio del array de usuales
	shiftPosFavoriteOriginUsualStation(station);
}

function shiftPosFavoriteOriginUsualStation(station) {
	if (station.isFavorite) {
		// se inserta al principio del array (si ahora es favorita)
		originsUsuals.responseJSON.unshift(station);
	} else {
		// se inserta al final del array (si ahora no es favorita)
		originsUsuals.responseJSON.push(station);
	}
}







/**
 * Impresión de documentos a PDF
 */
function PdfMaker() {
	
	this.makePdf = function (source, filename) {

		/* Se ignoran los elementos con el class 'ignore-pdf' */
		var elemsToDelete = $(".ignore-pdf");
		var specialElementHandlers = {};
		
		/* Se recorren los elementos a ignorar, si tienen un identificador se usa,
		 * si no se crea uno arbitrario */
		for (var i=0; i < elemsToDelete.length; i++) {
			var anId = "";
			if ($(elemsToDelete[i]).is('[id]')) {
				anId = $(elemsToDelete[i]).attr('id');
			} else {
				var autoId = "pdfId000"+i;
				$(elemsToDelete[i]).attr("id", autoId);
				anId = autoId;
			}
			specialElementHandlers['#' + anId] =  function(element, renderer){
				// true = "handled elsewhere, bypass text extraction"
				return true;
			};
		}
		
		
		var pdf = new jsPDF('p', 'pt', 'a4');

		var margins = {
			    top: 60,
			    bottom: 60,
			    left: 40,
			    width: 522
			  };
		
		/* Debido a limitaciones de la librería se cambia el símbolo de euro por su nombre */
		$(source).find("span").text(function () {
		    return $(this).text().replace("€", "euros");
		});
		
		pdf.fromHTML(
		  	source // HTML string or DOM elem ref.
		  	, margins.left // x coord
		  	, margins.top // y coord
		  	, {
		  		'width': margins.width // max width of content on PDF
		  		, 'elementHandlers': specialElementHandlers
		  	},
		  	function (dispose) {
		  	  // dispose: object with X, Y of the last line add to the PDF
		  	  //          this allow the insertion of new lines after html
		        pdf.save(filename);
		        /* Se vuelve a poner el símbolo de euro */
		        $(source).find("span").text(function () {
				    return $(this).text().replace("euros", "€"); 
				}); 
		      },
		  	margins
		  );		
		
	};
};
/**
 *	Gestiona pestañas y paneles accesibles, navegables mediante teclas de dirección. Ejemplo 34 de OpenAjax.
 *	http://www.oaa-accessibility.org/example/34/
 *	Utilizado en https://www.alsa.es/nuestros-destinos/aeropuertos
 */

/* Ejemplo de uso:
$(document).ready(function() {

	var panel1 = new tabpanel("tabpanel1", false);
}); */

// 
// keyCodes() is an object to contain keycodes needed for the application 
// 
function keyCodes() {
	// Define values for keycodes 
	this.tab = 9;
	this.enter = 13;
	this.esc = 27;

	this.space = 32;
	this.pageup = 33;
	this.pagedown = 34;
	this.end = 35;
	this.home = 36;

	this.left = 37;
	this.up = 38;
	this.right = 39;
	this.down = 40;

} // end keyCodes 

// 
// tabpanel() is a class constructor to create a ARIA-enabled tab panel widget. 
// 
// @param (id string) id is the id of the div containing the tab panel. 
// 
// @param (accordian boolean) accordian is true if the tab panel should operate 
//         as an accordian; false if a tab panel 
// 
// @return N/A 
// 
// Usage: Requires a div container and children as follows: 
// 
//         1. tabs/accordian headers have class 'tab' 
// 
//         2. panels are divs with class 'panel' 
// 
function tabpanel(id, accordian) {

	// define the class properties 

	this.panel_id = id; // store the id of the containing div 
	this.accordian = accordian; // true if this is an accordian control 
	this.$panel = $('#' + id); // store the jQuery object for the panel 
	this.keys = new keyCodes(); // keycodes needed for event handlers 
	this.$tabs = this.$panel.find('.tab'); // Array of panel tabs. 
	this.$panels = this.$panel.find('.t-panel'); // Array of panels. 

	// Bind event handlers 
	this.bindHandlers();

	// Initialize the tab panel 
	this.init();

} // end tabpanel() constructor 

// 
// Function init() is a member function to initialize the tab/accordian panel. Hides all panels. If a tab 
// has the class 'selected', makes that panel visible; otherwise, makes first panel visible. 
// 
// @return N/A 
// 
tabpanel.prototype.init = function() {

	// Hace enfocable la primera pestaña y la selecciona
	$(this.$tabs[0]).attr({'tabindex': '0', 'aria-selected': 'true'}).parent().addClass('active');
	
	// add aria attributes to the panels 
	this.$panels.attr('aria-hidden', 'true');

	// hide all the panels 
	this.$panels.hide();

	// show the panel that the selected tab controls and set aria-hidden to false 
	$(this.$panels[0]).show().attr('aria-hidden', 'false');
	
	// Evita scroll al ancla
    $(this.$tabs).on("click", function(e) {
    	e.preventDefault();
    });
}; // end init() 

// 
// Function switchTabs() is a member function to give focus to a new tab or accordian header. 
// If it's a tab panel, the currently displayed panel is hidden and the panel associated with the new tab 
// is displayed. 
// 
// @param ($curTab obj) $curTab is the jQuery object of the currently selected tab 
// 
// @param ($newTab obj) $newTab is the jQuery object of new tab to switch to 
// 
// @return N/A 
// 
tabpanel.prototype.switchTabs = function($curTab, $newTab) {

	// Remove the highlighting from the current tab 
	$curTab.parent().removeClass('active');

	// remove tab from the tab order and update its aria-selected attribute 
	$curTab.attr('tabindex', '-1').attr('aria-selected', 'false');

	// update the aria attributes 

	// Highlight the new tab and update its aria-selected attribute 
	$newTab.attr('aria-selected', 'true').parent().addClass('active');

	// If this is a tab panel, swap displayed tabs 
	if (this.accordian == false) {
		// hide the current tab panel and set aria-hidden to true 
		this.$panel.find('#' + $curTab.attr('aria-controls')).hide().attr('aria-hidden', 'true');

		// show the new tab panel and set aria-hidden to false 
		this.$panel.find('#' + $newTab.attr('aria-controls')).show().attr('aria-hidden', 'false');
	}

	// Make new tab navigable 
	$newTab.attr('tabindex', '0');

	// give the new tab focus 
	$newTab.trigger('focus');

}; // end switchTabs() 

// 
// Function togglePanel() is a member function to display or hide the panel associated with an accordian header 
// 
// @param ($tab obj) $tab is the jQuery object of the currently selected tab 
// 
// @return N/A 
// 
tabpanel.prototype.togglePanel = function($tab) {

	$panel = this.$panel.find('#' + $tab.attr('aria-controls'));

	if ($panel.attr('aria-hidden') == 'true') {
		//$panel.slideDown(100);
		$panel.attr('aria-hidden', 'false');
	} else {
		//$panel.slideUp(100);
		$panel.attr('aria-hidden', 'true');
	}
}; // end togglePanel() 

// 
// Function bindHandlers() is a member function to bind event handlers for the tabs 
// 
// @return N/A 
// 
tabpanel.prototype.bindHandlers = function() {

	var thisObj = this; // Store the this pointer for reference 

	////////////////////////////// 
	// Bind handlers for the tabs / accordian headers 

	// bind a tab keydown handler 
	this.$tabs.on('keydown', function(e) {
		return thisObj.handleTabKeyDown($(this), e);
	});

	// bind a tab keypress handler 
	this.$tabs.on('keypress', function(e) {
		return thisObj.handleTabKeyPress($(this), e);
	});

	// bind a tab click handler 
	this.$tabs.on("click", function(e) {
		return thisObj.handleTabClick($(this), e);
	});

	// bind a tab focus handler 
	this.$tabs.on('focus', function(e) {
		return thisObj.handleTabFocus($(this), e);
	});

	// bind a tab blur handler 
	this.$tabs.on('blur', function(e) {
		return thisObj.handleTabBlur($(this), e);
	});

	///////////////////////////// 
	// Bind handlers for the panels 

	// bind a keydown handlers for the panel focusable elements 
	this.$panels.on('keydown', function(e) {
		return thisObj.handlePanelKeyDown($(this), e);
	});

	// bind a keypress handler for the panel 
	this.$panels.on('keypress', function(e) {
		return thisObj.handlePanelKeyPress($(this), e);
	});

}; // end bindHandlers() 

// 
// Function handleTabKeyDown() is a member function to process keydown events for a tab 
// 
// @param ($tab obj) $tab is the jquery object of the tab being processed 
// 
// @param (e obj) e is the associated event object 
// 
// @return (boolean) Returns true if propagating; false if consuming event 
// 
tabpanel.prototype.handleTabKeyDown = function($tab, e) {

	if (e.altKey) {
		// do nothing 
		return true;
	}

	switch (e.keyCode) {
		case this.keys.enter:
		case this.keys.space:
			{

				// Only process if this is an accordian widget 
				if (this.accordian == true) {
					// display or collapse the panel 
					this.togglePanel($tab);

					e.stopPropagation();
					return false;
				}

				return true;
			}
		case this.keys.left:
		case this.keys.up:
			{

				var thisObj = this;
				var $prevTab; // holds jQuery object of tab from previous pass 
				var $newTab; // the new tab to switch to 

				if (e.ctrlKey) {
					// Ctrl+arrow moves focus from panel content to the open 
					// tab/accordian header. 
				} else {
					var curNdx = this.$tabs.index($tab);

					if (curNdx == 0) {
						// tab is the first one: 
						// set newTab to last tab 
						$newTab = this.$tabs.last();
					} else {
						// set newTab to previous 
						$newTab = this.$tabs.eq(curNdx - 1);
					}

					// switch to the new tab 
					this.switchTabs($tab, $newTab);
				}

				e.stopPropagation();
				return false;
			}
		case this.keys.right:
		case this.keys.down:
			{

				var thisObj = this;
				var foundTab = false; // set to true when current tab found in array 
				var $newTab; // the new tab to switch to 

				var curNdx = this.$tabs.index($tab);

				if (curNdx == this.$tabs.length - 1) {
					// tab is the last one: 
					// set newTab to first tab 
					$newTab = this.$tabs.first();
				} else {
					// set newTab to next tab 
					$newTab = this.$tabs.eq(curNdx + 1);
				}

				// switch to the new tab 
				this.switchTabs($tab, $newTab);

				e.stopPropagation();
				return false;
			}
		case this.keys.home:
			{

				// switch to the first tab 
				this.switchTabs($tab, this.$tabs.first());

				e.stopPropagation();
				return false;
			}
		case this.keys.end:
			{

				// switch to the last tab 
				this.switchTabs($tab, this.$tabs.last());

				e.stopPropagation();
				return false;
			}
	}
}; // end handleTabKeyDown() 

// 
// Function handleTabKeyPress() is a member function to process keypress events for a tab. 
// 
// 
// @param ($tab obj) $tab is the jquery object of the tab being processed 
// 
// @param (e obj) e is the associated event object 
// 
// @return (boolean) Returns true if propagating; false if consuming event 
// 
tabpanel.prototype.handleTabKeyPress = function($tab, e) {

	if (e.altKey) {
		// do nothing 
		return true;
	}

	switch (e.keyCode) {
		case this.keys.enter:
		case this.keys.space:
		case this.keys.left:
		case this.keys.up:
		case this.keys.right:
		case this.keys.down:
		case this.keys.home:
		case this.keys.end:
			{
				e.stopPropagation();
				return false;
			}
		case this.keys.pageup:
		case this.keys.pagedown:
			{
				// The tab keypress handler must consume pageup and pagedown 
				// keypresses to prevent Firefox from switching tabs 
				// on ctrl+pageup and ctrl+pagedown 

				if (!e.ctrlKey) {
					return true;
				}

				e.stopPropagation();
				return false;
			}
	}

	return true;

}; // end handleTabKeyPress() 

// 
// Function handleTabClick() is a member function to process click events for tabs 
// 
// @param ($tab object) $tab is the jQuery object of the tab being processed 
// 
// @param (e object) e is the associated event object 
// 
// @return (boolean) returns true 
// 
tabpanel.prototype.handleTabClick = function($tab, e) {

	// Remove the highlighting from all tabs 
	this.$tabs.parent().removeClass('active');

	// remove all tabs from the tab order and reset their aria-selected attribute 
	this.$tabs.attr('tabindex', '-1').attr('aria-selected', 'false');

	// hide all tab panels 
	this.$panels.hide().attr('aria-hidden', 'true');

	// Highlight the clicked tab and update its aria-selected attribute 
	$tab.attr('aria-selected', 'true').parent().addClass('active');

	// show the clicked tab panel 
	this.$panel.find('#' + $tab.attr('aria-controls')).show().attr('aria-hidden', 'false');

	// make clicked tab navigable 
	$tab.attr('tabindex', '0');

	// give the tab focus 
	$tab.trigger('focus');

	return true;

}; // end handleTabClick() 

// 
// Function handleTabFocus() is a member function to process focus events for tabs 
// 
// @param ($tab object) $tab is the jQuery object of the tab being processed 
// 
// @param (e object) e is the associated event object 
// 
// @return (boolean) returns true 
// 
tabpanel.prototype.handleTabFocus = function($tab, e) {

	// Add the focus class to the tab 
	//$tab.addClass('focus');

	return true;

}; // end handleTabFocus() 

// 
// Function handleTabBlur() is a member function to process blur events for tabs 
// 
// @param ($tab object) $tab is the jQuery object of the tab being processed 
// 
// @param (e object) e is the associated event object 
// 
// @return (boolean) returns true 
// 
tabpanel.prototype.handleTabBlur = function($tab, e) {

	// Remove the focus class to the tab 
	//$tab.removeClass('focus');

	return true;

}; // end handleTabBlur() 


///////////////////////////////////////////////////////// 
// Panel Event handlers 
// 

// 
// Function handlePanelKeyDown() is a member function to process keydown events for a panel 
// 
// @param ($elem obj) $elem is the jquery object of the element being processed 
// 
// @param (e obj) e is the associated event object 
// 
// @return (boolean) Returns true if propagating; false if consuming event 
// 
tabpanel.prototype.handlePanelKeyDown = function($elem, e) {

	if (e.altKey) {
		// do nothing 
		return true;
	}

	switch (e.keyCode) {
		case this.keys.esc:
			{
				e.stopPropagation();
				return false;
			}
		case this.keys.left:
		case this.keys.up:
			{

				if (!e.ctrlKey) {
					// do not process 
					return true;
				}

				// get the jQuery object of the tab 
				var $tab = $('#' + $elem.attr('aria-labelledby'));

				// Move focus to the tab 
				$tab.trigger('focus');

				e.stopPropagation();
				return false;
			}
		case this.keys.pageup:
			{

				var $newTab;

				if (!e.ctrlKey) {
					// do not process 
					return true;
				}

				// get the jQuery object of the tab 
				var $tab = this.$tabs.filter('.active');

				// get the index of the tab in the tab list 
				var curNdx = this.$tabs.index($tab);

				if (curNdx == 0) {
					// this is the first tab, set focus on the last one 
					$newTab = this.$tabs.last();
				} else {
					// set focus on the previous tab 
					$newTab = this.$tabs.eq(curNdx - 1);
				}

				// switch to the new tab 
				this.switchTabs($tab, $newTab);

				e.stopPropagation();
				e.preventDefault();
				return false;
			}
		case this.keys.pagedown:
			{

				var $newTab;

				if (!e.ctrlKey) {
					// do not process 
					return true;
				}

				// get the jQuery object of the tab 
				var $tab = $('#' + $elem.attr('aria-labelledby'));

				// get the index of the tab in the tab list 
				var curNdx = this.$tabs.index($tab);

				if (curNdx == this.$tabs.length - 1) {
					// this is the last tab, set focus on the first one 
					$newTab = this.$tabs.first();
				} else {
					// set focus on the next tab 
					$newTab = this.$tabs.eq(curNdx + 1);
				}

				// switch to the new tab 
				this.switchTabs($tab, $newTab);

				e.stopPropagation();
				e.preventDefault();
				return false;
			}
	}

	return true;

}; // end handlePanelKeyDown() 

// 
// Function handlePanelKeyPress() is a member function to process keypress events for a panel 
// 
// @param ($elem obj) $elem is the jquery object of the element being processed 
// 
// @param (e obj) e is the associated event object 
// 
// @return (boolean) Returns true if propagating; false if consuming event 
// 
tabpanel.prototype.handlePanelKeyPress = function($elem, e) {

	if (e.altKey) {
		// do nothing 
		return true;
	}

	if (e.ctrlKey && (e.keyCode == this.keys.pageup || e.keyCode == this.keys.pagedown)) {
		e.stopPropagation();
		e.preventDefault();
		return false;
	}

	switch (e.keyCode) {
		case this.keys.esc:
			{
				e.stopPropagation();
				e.preventDefault();
				return false;
			}
	}

	return true;

}; // end handlePanelKeyPress() 

// focusable is a small jQuery extension to add a :focusable selector. It is used to 
// get a list of all focusable elements in a panel. Credit to ajpiano on the jQuery forums. 
// 
$.extend($.expr[':'], {
	focusable: function(element) {
		var nodeName = element.nodeName.toLowerCase();
		var tabIndex = $(element).attr('tabindex');

		// the element and all of its ancestors must be visible 
		if (($(element)[nodeName == 'area' ? 'parents' : 'closest'](':hidden').length) == true) {
			return false;
		}

		// If tabindex is defined, its value must be greater than 0 
		if (!isNaN(tabIndex) && tabIndex < 0) {
			return false;
		}

		// if the element is a standard form control, it must not be disabled 
		if (/input|select|textarea|button|object/.test(nodeName) == true) {

			return !element.disabled;
		}

		// if the element is a link, href must be defined 
		if ((nodeName == 'a' || nodeName == 'area') == true) {

			return (element.href.length > 0);
		}

		// this is some other page element that is not normally focusable. 
		return false;
	}
});


/**
 * Fichero de utilidades
 */

/**
 * Transforma una fecha desde el formato que nos llega de java a tipo fecha
 * Recupera el formato de fecha de params["jsonDateFormat"], que debería estar cargado
 *
 * @param date
 * @returns {Date}
 */
function getDateFromString(date) {
	var parts;
	parts = date.split(" ")[0].split("/");
	return new Date(parts[0], parts[1] - 1, parts[2]);
}


/**
 * Gets millis date from java string
 * @param date, string with java date in the form dd/MM/yyyy  hh:mm
 * @returns number, the date in millis format
 */
function getMillisFromString (stringDate) {
	var parts, time, date, tempDate;
	parts = stringDate.split(" ");
	date = parts[0].split("/");
	time = parts[1].split(":");
	/* Javascript months are 0 based */
	tempDate = new Date(Date.UTC(date[2], date[1]-1, date[0], time[0], time[1]));
	return tempDate.getTime();
}


function setCookieByName(cookieName, expirationDays) {
	var d = new Date();
	d.setTime(d.getTime() + (expirationDays * 24 * 60 * 60 * 1000));
	var expires = "expires="+ d.toUTCString();
	document.cookie = cookieName + "=" + true + ";" + expires + ";path=/";
}

// Función auxiliar que comprueba que una determinada cookie exista
function existsCookie(cname) {
    var name = cname + "=";
    var ca = document.cookie.split(';');
    for(var i = 0; i < ca.length; i++) {
    	var c = ca[i].trim();
        if (c.indexOf(name) == 0) {
           	return true;
        }
    }
    return false;
}

//Returns the string value from a cookie
function readCookie(cname) {
    var nameEQ = cname + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i].trim();
        while (c.charAt(0)==' ') {
        	c = c.substring(1,c.length);
        }
        if (c.indexOf(nameEQ) == 0) {
        	return c.substring(nameEQ.length,c.length);
        }
    }
    return null;
}


/**
 * Segun el idioma devuelve la fecha de tipo string transformada en milisegundos
 * @param dateParam dd/mm/yyyy por ejemplo
 * @param locale es o en
 * @returns milisegundos
 */
function getMillisFromStringFormat(dateStringParam, locale)
{
	var dateSplit = dateStringParam.split("/");
	var mydate;
	//Se crean los objetos Date según el locale
	switch (locale) {
    case "en_US":
    	mydate = new Date(dateSplit[2], dateSplit[0]-1, dateSplit[1]);
        break;
    case "es_ES":
    default:
    	mydate = new Date(dateSplit[2], dateSplit[1]-1, dateSplit[0]);
	}
//	console.log(mydate.getTime());
	return mydate.getTime();
}

/**
 * Devuelve una fecha pasada como milisegundos en string a mostrar
 * @param millisParam
 * @param locale
 * @returns {String}
 */
function getStringDateFromMillis(millisParam, locale)
{
//	console.log(millisParam);
	//Rellena con un cero por la izquierda si es una sola cifra
	var fillZero = function(digit) {
		digit = String(digit);
		if (digit.length == 1) {
			return ("0" + digit);
		} else {
			return digit;
		}
	};
	//console.log(millisParam);
	var myDate = new Date(millisParam);
	var myDateStr;
	switch (locale) {
    case "en_US":
    	//console.log("entro");
    	//console.log(myDate);
    	myDateStr = fillZero(myDate.getUTCMonth()+1) + "/" + fillZero(myDate.getUTCDate()) +"/" + myDate.getUTCFullYear();
        break;
    case "es_ES":
    default:
    	myDateStr = fillZero(myDate.getUTCDate()) + "/" + fillZero(myDate.getUTCMonth()+1) + "/" + myDate.getUTCFullYear();
	}
	// Comprobamos que la conversión se haya realizado correctamente
	if (myDateStr != null && myDateStr.indexOf("NaN") !== -1) {
		myDateStr = null;
	}
	return myDateStr;

}

/**
 * Check if a string represents a regular integer: or it is '0' or a
 * sequence of digits starting with a digit different from '0'
 *
 * @param str
 * @returns
 */
function isNormalInteger(str) {
    return /^\+?(0|[1-9]\d*)$/.test(str);
}

/**
 * Check if a string represents a sequence of digits (without decimal separator)
 * Useful for checking telephone number and other numeric codes
 *
 * @param str
 * @returns
 */
function isDigitSequence(str) {
    return /^\d*$/.test(str);
}

/**
 * Decodes a Base 64 String
 * Only supports ASCII
 * Extracted from http://ntt.cc/2008/01/19/base64-encoder-decoder-with-javascript.html
 * Alternative a window.atob(), not present in IE10-
 *
 * @param input
 * @returns
 */
function decode64(input) {
	var keyStr = "ABCDEFGHIJKLMNOP" +
	               "QRSTUVWXYZabcdef" +
	               "ghijklmnopqrstuv" +
	               "wxyz0123456789+/" +
	               "=";

    var output = "";
    var chr1, chr2, chr3 = "";
    var enc1, enc2, enc3, enc4 = "";
    var i = 0;

    // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
    var base64test = /[^A-Za-z0-9\+\/\=]/g;
    if (base64test.exec(input)) {
    	console.log("Detectados caracteres no validos en el texto de entrada. " +
    			"Los caracteres validos en base64 son A-Z, a-z, 0-9, '+', '/', y '='." +
    			"Habrá errores en la decodificación.");
    }
    input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

    do {
       enc1 = keyStr.indexOf(input.charAt(i++));
       enc2 = keyStr.indexOf(input.charAt(i++));
       enc3 = keyStr.indexOf(input.charAt(i++));
       enc4 = keyStr.indexOf(input.charAt(i++));

       chr1 = (enc1 << 2) | (enc2 >> 4);
       chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
       chr3 = ((enc3 & 3) << 6) | enc4;

       output = output + String.fromCharCode(chr1);

       if (enc3 != 64) {
          output = output + String.fromCharCode(chr2);
       }
       if (enc4 != 64) {
          output = output + String.fromCharCode(chr3);
       }

       chr1 = chr2 = chr3 = "";
       enc1 = enc2 = enc3 = enc4 = "";

    } while (i < input.length);

    return unescape(output);
 }

/**
 * Devuelve el nombre de un portlet a partir de su namespace (elimina los "_" del principio y del final)
 * @param namespace
 * @returns
 */
function getPortletNameFromPortletNamespace(namespace) {
	return namespace.substring(1, namespace.length - 1);
}

/**
 * Get the number of watchers on a given Angular scope
 *//*
$scope.watchersContainedIn = function() {
	var scope = $scope;
    var watchers = (scope.$$watchers) ? scope.$$watchers.length : 0;
    var child = scope.$$childHead;
    while (child) {
    	watchers += (child.$$watchers) ? child.$$watchers.length : 0;
        child = child.$$nextSibling;
    }
    return watchers;
};*/

/**
 * Parses an url String and returns an associative array with the pairs name - value
 * of each parameter contained in the url
 * Extracted from http://jquery-howto.blogspot.com.es/2009/09/get-url-parameters-values-with-jquery.html
 *
 * @param url the url to parse
 * @return associative array
 *
 */
function getUrlParams(url) {
    var vars = [], hash;
    var hashes = url.slice(url.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
//        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}

/**
 * Parses an String and returns if complains both the NIE and NIF formats and
 * if the char control is valid. Notice that NIF validation is a subcase of
 * NIE validation
 *
 * @param value
 * @returns {Boolean}
 */
function checkNIEControlChar(value) {
	if (value != undefined){
		if (value.match(/^[XYZ]?\d+[A-Z]$/)) {	//más de un número seguido(s) de una letra mayúscula
			if (value && value.length < 10 && value.length > 1) {
				var number = value.slice(0, value.length-1);
				var charControl = value.slice(value.length-1, value.length);

				//Si es extranjero:
				number = number.replace('X', 0);
				number = number.replace('Y', 1);
				number = number.replace('Z', 2);
				if (!isNaN(number)) { //is number
					var cod = number % 23;
					var letra = 'TRWAGMYFPDXBNJZSQVHLCKET';
					letra = letra.substring(cod, cod+1);
					if (letra == charControl.toUpperCase()) {
						return true;
					}

				}
			}
		}
	}
	return false;
}

/**
 * Retrieves the position of the supplied element
 *
 * @param elem DOM element object
 * @returns an object with the coordinates {top, left}
 */
function getElementCoordinates(elem) { // crossbrowser version
    var box = elem.getBoundingClientRect();

    var body = document.body;
    var docEl = document.documentElement;

    var scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop;
    var scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft;

    var clientTop = docEl.clientTop || body.clientTop || 0;
    var clientLeft = docEl.clientLeft || body.clientLeft || 0;

    var top  = box.top +  scrollTop - clientTop;
    var left = box.left + scrollLeft - clientLeft;

    return { top: Math.round(top), left: Math.round(left) };
}



/**
 * Makes a click in the header button to scroll to the JourneySearch or show it in the modal window
 *
 */
function goToJourneySearch() {

	var maxWidth992Query = window.matchMedia("(max-width: 991px)");
	//SI... es movil o tablet y esta presente el boton de la cabecera, invocamos su click
	if (maxWidth992Query.matches && $('#journeySearchHeaderButton').length) {
		$('#journeySearchHeaderButton').trigger("click");
	}

}

/**
 * Compara la fecha de ida o vuelta con el dia de hoy (devuelve true si es fecha anterior a hoy)
 * Si la ida ya es fecha pasada , la vuelta la devolvera como fecha pasada si o si
 * @param departureDataToFilter
 * @param returnDataToFilter
 * @param sagTravelType
 * @returns
 */
function isDatePast(departureDataToFilter,returnDataToFilter,sagTravelType){
	var journeyDate;
	var isPast = false;
	var todayDate = new Date();
	todayDate.setHours(0,0,0,0);

	//siempre se comprueba la ida, si la ida es pasada la vuelta consideramos que tambien
	var parts = departureDataToFilter.split(" ")[0].split("/");
	journeyDate = new Date(parts[2], parts[1] - 1, parts[0]);
	journeyDate.setHours(0,0,0,2);
	if(todayDate.getTime() > journeyDate.getTime()){isPast=true;}

	 //si la ida no esta pasada y es vuelta, comprobamos la vuelta
	 if (!isPast && sagTravelType.toUpperCase() === 'RETURN'){
		  parts = returnDataToFilter.split(" ")[0].split("/");
		  journeyDate = new Date(parts[2], parts[1] - 1, parts[0]);
		  journeyDate.setHours(0,0,0,2);
		  if(todayDate.getTime() > journeyDate.getTime()){isPast=true;}

	 }

	return isPast;
}

function isOneDayForward(inputDate) {
	// Parse the input date string in the format "dd/mm/yyyy"
    var dateParts = inputDate.split("/");
    var day = parseInt(dateParts[0], 10);
    // Substract one month since months in JS comes from 0 to 11
    var month = parseInt(dateParts[1], 10) - 1;
    var year = parseInt(dateParts[2], 10);

    var inputDateObject = new Date(year, month, day);
    inputDateObject.setHours(0, 0, 0, 0);

    var currentDate = new Date();
    currentDate.setHours(0, 0, 0, 0);

    var oneDayInMillis = 24 * 60 * 60 * 1000;

    return (inputDateObject.getTime() - currentDate.getTime() === oneDayInMillis);
}

window.Liferay = window.Liferay || {};

Liferay.Widget = function(options) {
	options = options || {};

	var id = options.id || '_Liferay_widget' + (Math.ceil(Math.random() * (new Date).getTime()));
	var height = options.height || '100%';
	var url = options.url || 'http://www.liferay.com/widget/web/guest/community/forums/-/message_boards';
	var width = options.width || '100%';
	var title = options.title || 'Frame for widget';

	var html = '<iframe frameborder="0" height="' + height + '" id="' + id + '" src="' + url + '" width="' + width + '" title="'+title+'"></iframe>';

	document.write(html);
}
// Para hacer clickable un elemento que contiene un <a>
// Le añadiremos también la clase .cursor-pointer para
// mostrar que este elemento es clickable
// Hacemos el on sobre el body para el caso de que el elemento clickable se cargue por angular después de que el Dom esté cargado
//Pasa por ejemplo en el bono del paso 1 de compra
$(function(){
	$("body:not(.has-edit-mode-menu)").on("click", ".clickable", function(){
		var noTextSelected = !window.getSelection().toString();
		if (noTextSelected) { /* Si no estamos seleccionando texto dentro del bloque redireccionamos a la url que se indica en el enlace */
			window.location=$(this).find("a").attr("href");
		}
	     return false;
	});
	$("body:not(.has-edit-mode-menu)").on("click", ".clickable-new-tab", function(){ /* Para abrir el enlace en nueva ventana */
    		var noTextSelected = !window.getSelection().toString();
    		if (noTextSelected) { /* Si no estamos seleccionando texto dentro del bloque redireccionamos a la url que se indica en el enlace */
    			var url=$(this).find("a").attr("href");
    			window.open(url, '_blank');
    		}
    	     return false;
    	});
});


// accesibilidad de los elementos padre de los select, span.select

$(document).ready(function(){
	setTimeout(function(){
		$("select").on("focus",function(){
			$(this).parent().addClass("accesible-select");
		});

		$(".form-group span.select select").on('blur', function(){
			$(this).parent().removeClass("accesible-select");
		});
	}, 1000)
	
});
/**
Funciones para gestionar la accesibilidad de los sliders
*/
var sagSlider = function() {
'use strict';

	var SMALL_DIV = 10;
	var BIG_DIV = 5;

	return {
		moveSlider : function(event, min, max, current) {

			//			var max = parseInt(maxStr);
//			var min = parseInt(minStr);
//			var current = parseInt(currentStr);
			var smallStep = (max - min) / SMALL_DIV;
			var bigStep = (max - min) / BIG_DIV;
			
			event = event || window.event;
			
			var keyCode = event.keyCode || event.charCode;
				//var target = event.target || event.srcElement; 
				//var passThrough = true;
			var nuevo;
			switch (keyCode) {
				case 40: // down arrow
				case 37: // left arrow
					event.preventDefault();
					nuevo = (current - smallStep);
					if (nuevo <= min) return min;
					else
						return nuevo;
				break;
				case 38: // up arrow
				case 39: // right arrow
					event.preventDefault();
					nuevo = (current + smallStep);
					if (nuevo >= max) return max;
					else
						return nuevo;
				break;
				case 33: // page up
					event.preventDefault();
					nuevo = (current + bigStep);
					if (nuevo >= max) return max;
					else
						return nuevo;
				break;
				case 34: // page down
					event.preventDefault();
					nuevo = (current - bigStep);
					if (nuevo <= min) return min;
					else
						return nuevo;
				break;
				case 36: // home
					event.preventDefault();
					nuevo = min;
					return nuevo;
				break;		
				case 35: // end
					event.preventDefault();
					nuevo = max;
					return nuevo;
				break;		
				case 27: // escape
					//target.blur();
					//passThrough = false;
				//break;
				default:
					return current;
				break;
				}
			
			return current;
		}
	//, fname : function() {}
	};
}();


!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n=n||self).LazyLoad=t()}(this,(function(){"use strict";function n(){return(n=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n}).apply(this,arguments)}var t="undefined"!=typeof window,e=t&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),i=t&&"IntersectionObserver"in window,a=t&&"classList"in document.createElement("p"),o=t&&window.devicePixelRatio>1,r={elements_selector:".lazy",container:e||t?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1},c=function(t){return n({},r,t)},l=function(n,t){var e,i=new n(t);try{e=new CustomEvent("LazyLoad::Initialized",{detail:{instance:i}})}catch(n){(e=document.createEvent("CustomEvent")).initCustomEvent("LazyLoad::Initialized",!1,!1,{instance:i})}window.dispatchEvent(e)},s=function(n,t){return n.getAttribute("data-"+t)},u=function(n,t,e){var i="data-"+t;null!==e?n.setAttribute(i,e):n.removeAttribute(i)},d=function(n){return s(n,"ll-status")},f=function(n,t){return u(n,"ll-status",t)},_=function(n){return f(n,null)},g=function(n){return null===d(n)},v=function(n){return"native"===d(n)},p=["loading","loaded","applied","error"],b=function(n,t,e,i){n&&(void 0===i?void 0===e?n(t):n(t,e):n(t,e,i))},h=function(n,t){a?n.classList.add(t):n.className+=(n.className?" ":"")+t},m=function(n,t){a?n.classList.remove(t):n.className=n.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},E=function(n){return n.llTempImage},I=function(n,t){if(t){var e=t._observer;e&&e.unobserve(n)}},y=function(n,t){n&&(n.loadingCount+=t)},A=function(n,t){n&&(n.toLoadCount=t)},L=function(n){for(var t,e=[],i=0;t=n.children[i];i+=1)"SOURCE"===t.tagName&&e.push(t);return e},w=function(n,t,e){e&&n.setAttribute(t,e)},z=function(n,t){n.removeAttribute(t)},k=function(n){return!!n.llOriginalAttrs},O=function(n){if(!k(n)){var t={};t.src=n.getAttribute("src"),t.srcset=n.getAttribute("srcset"),t.sizes=n.getAttribute("sizes"),n.llOriginalAttrs=t}},C=function(n){if(k(n)){var t=n.llOriginalAttrs;w(n,"src",t.src),w(n,"srcset",t.srcset),w(n,"sizes",t.sizes)}},N=function(n,t){w(n,"sizes",s(n,t.data_sizes)),w(n,"srcset",s(n,t.data_srcset)),w(n,"src",s(n,t.data_src))},x=function(n){z(n,"src"),z(n,"srcset"),z(n,"sizes")},M=function(n,t){var e=n.parentNode;e&&"PICTURE"===e.tagName&&L(e).forEach(t)},R=function(n,t){L(n).forEach(t)},G={IMG:function(n,t){M(n,(function(n){O(n),N(n,t)})),O(n),N(n,t)},IFRAME:function(n,t){w(n,"src",s(n,t.data_src))},VIDEO:function(n,t){R(n,(function(n){w(n,"src",s(n,t.data_src))})),w(n,"poster",s(n,t.data_poster)),w(n,"src",s(n,t.data_src)),n.load()}},T=function(n,t){var e=G[n.tagName];e&&e(n,t)},D=function(n,t,e){y(e,1),h(n,t.class_loading),f(n,"loading"),b(t.callback_loading,n,e)},F={IMG:function(n,t){u(n,t.data_src,null),u(n,t.data_srcset,null),u(n,t.data_sizes,null),M(n,(function(n){u(n,t.data_srcset,null),u(n,t.data_sizes,null)}))},IFRAME:function(n,t){u(n,t.data_src,null)},VIDEO:function(n,t){u(n,t.data_src,null),u(n,t.data_poster,null),R(n,(function(n){u(n,t.data_src,null)}))}},V=function(n,t){u(n,t.data_bg_multi,null),u(n,t.data_bg_multi_hidpi,null)},j=function(n,t){var e=F[n.tagName];e?e(n,t):function(n,t){u(n,t.data_bg,null),u(n,t.data_bg_hidpi,null)}(n,t)},P=["IMG","IFRAME","VIDEO"],S=function(n,t){!t||function(n){return n.loadingCount>0}(t)||function(n){return n.toLoadCount>0}(t)||b(n.callback_finish,t)},U=function(n,t,e){n.addEventListener(t,e),n.llEvLisnrs[t]=e},$=function(n,t,e){n.removeEventListener(t,e)},q=function(n){return!!n.llEvLisnrs},H=function(n){if(q(n)){var t=n.llEvLisnrs;for(var e in t){var i=t[e];$(n,e,i)}delete n.llEvLisnrs}},B=function(n,t,e){!function(n){delete n.llTempImage}(n),y(e,-1),function(n){n&&(n.toLoadCount-=1)}(e),m(n,t.class_loading),t.unobserve_completed&&I(n,e)},J=function(n,t,e){var i=E(n)||n;q(i)||function(n,t,e){q(n)||(n.llEvLisnrs={});var i="VIDEO"===n.tagName?"loadeddata":"load";U(n,i,t),U(n,"error",e)}(i,(function(a){!function(n,t,e,i){var a=v(t);B(t,e,i),h(t,e.class_loaded),f(t,"loaded"),j(t,e),b(e.callback_loaded,t,i),a||S(e,i)}(0,n,t,e),H(i)}),(function(a){!function(n,t,e,i){var a=v(t);B(t,e,i),h(t,e.class_error),f(t,"error"),b(e.callback_error,t,i),a||S(e,i)}(0,n,t,e),H(i)}))},K=function(n,t,e){!function(n){n.llTempImage=document.createElement("IMG")}(n),J(n,t,e),function(n,t,e){var i=s(n,t.data_bg),a=s(n,t.data_bg_hidpi),r=o&&a?a:i;r&&(n.style.backgroundImage='url("'.concat(r,'")'),E(n).setAttribute("src",r),D(n,t,e))}(n,t,e),function(n,t,e){var i=s(n,t.data_bg_multi),a=s(n,t.data_bg_multi_hidpi),r=o&&a?a:i;r&&(n.style.backgroundImage=r,function(n,t,e){h(n,t.class_applied),f(n,"applied"),V(n,t),t.unobserve_completed&&I(n,t),b(t.callback_applied,n,e)}(n,t,e))}(n,t,e)},Q=function(n,t,e){!function(n){return P.indexOf(n.tagName)>-1}(n)?K(n,t,e):function(n,t,e){J(n,t,e),T(n,t),D(n,t,e)}(n,t,e)},W=["IMG","IFRAME"],X=function(n){return n.use_native&&"loading"in HTMLImageElement.prototype},Y=function(n,t,e){n.forEach((function(n){return function(n){return n.isIntersecting||n.intersectionRatio>0}(n)?function(n,t,e,i){f(n,"entered"),function(n,t,e){t.unobserve_entered&&I(n,e)}(n,e,i),b(e.callback_enter,n,t,i),function(n){return p.indexOf(d(n))>=0}(n)||Q(n,e,i)}(n.target,n,t,e):function(n,t,e,i){g(n)||(function(n,t,e,i){e.cancel_on_exit&&function(n){return"loading"===d(n)}(n)&&"IMG"===n.tagName&&(H(n),function(n){M(n,(function(n){x(n)})),x(n)}(n),function(n){M(n,(function(n){C(n)})),C(n)}(n),m(n,e.class_loading),y(i,-1),_(n),b(e.callback_cancel,n,t,i))}(n,t,e,i),b(e.callback_exit,n,t,i))}(n.target,n,t,e)}))},Z=function(n){return Array.prototype.slice.call(n)},nn=function(n){return n.container.querySelectorAll(n.elements_selector)},tn=function(n){return function(n){return"error"===d(n)}(n)},en=function(n,t){return function(n){return Z(n).filter(g)}(n||nn(t))},an=function(n,e){var a=c(n);this._settings=a,this.loadingCount=0,function(n,t){i&&!X(n)&&(t._observer=new IntersectionObserver((function(e){Y(e,n,t)}),function(n){return{root:n.container===document?null:n.container,rootMargin:n.thresholds||n.threshold+"px"}}(n)))}(a,this),function(n,e){t&&window.addEventListener("online",(function(){!function(n,t){var e;(e=nn(n),Z(e).filter(tn)).forEach((function(t){m(t,n.class_error),_(t)})),t.update()}(n,e)}))}(a,this),this.update(e)};return an.prototype={update:function(n){var t,a,o=this._settings,r=en(n,o);A(this,r.length),!e&&i?X(o)?function(n,t,e){n.forEach((function(n){-1!==W.indexOf(n.tagName)&&(n.setAttribute("loading","lazy"),function(n,t,e){J(n,t,e),T(n,t),j(n,t),f(n,"native")}(n,t,e))})),A(e,0)}(r,o,this):(a=r,function(n){n.disconnect()}(t=this._observer),function(n,t){t.forEach((function(t){n.observe(t)}))}(t,a)):this.loadAll(r)},destroy:function(){this._observer&&this._observer.disconnect(),nn(this._settings).forEach((function(n){delete n.llOriginalAttrs})),delete this._observer,delete this._settings,delete this.loadingCount,delete this.toLoadCount},loadAll:function(n){var t=this,e=this._settings;en(n,e).forEach((function(n){I(n,t),Q(n,e,t)}))}},an.load=function(n,t){var e=c(t);Q(n,e)},an.resetStatus=function(n){_(n)},t&&function(n,t){if(t)if(t.length)for(var e,i=0;e=t[i];i+=1)l(n,e);else l(n,t)}(an,window.lazyLoadOptions),an}));

