/* Minification failed. Returning unminified contents.
(15689,36-37): run-time error JS1195: Expected expression: >
(15691,41-42): run-time error JS1195: Expected expression: >
(15697,14-15): run-time error JS1195: Expected expression: )
(15700,9-10): run-time error JS1002: Syntax error: }
(15706,25-26): run-time error JS1004: Expected ';': {
(15930,23-24): run-time error JS1014: Invalid character: `
(15930,24-25): run-time error JS1195: Expected expression: <
(15930,276-281): run-time error JS1197: Too many errors. The file might not be a JavaScript file: class
(15927,5-16): run-time error JS1301: End of file encountered before function is properly closed: function ()
(15930,353-355): run-time error JS1007: Expected ']': ng
(15930,355-356): run-time error JS1197: Too many errors. The file might not be a JavaScript file: -
(15708,5-29): run-time error JS1018: 'return' statement outside of function: return parseInt(key, 10)
 */
/*! jQuery v2.0.3 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
//@ sourceMappingURL=jquery.min.map
*/
(function(e,undefined){var t,n,r=typeof undefined,i=e.location,o=e.document,s=o.documentElement,a=e.jQuery,u=e.$,l={},c=[],p="2.0.3",f=c.concat,h=c.push,d=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,x=function(e,n){return new x.fn.init(e,n,t)},b=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^-ms-/,N=/-([\da-z])/gi,E=function(e,t){return t.toUpperCase()},S=function(){o.removeEventListener("DOMContentLoaded",S,!1),e.removeEventListener("load",S,!1),x.ready()};x.fn=x.prototype={jquery:p,constructor:x,init:function(e,t,n){var r,i;if(!e)return this;if("string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:T.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof x?t[0]:t,x.merge(this,x.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:o,!0)),C.test(r[1])&&x.isPlainObject(t))for(r in t)x.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=o.getElementById(r[2]),i&&i.parentNode&&(this.length=1,this[0]=i),this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?n.ready(e):(e.selector!==undefined&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return d.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},a=1,u=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[1]||{},a=2),"object"==typeof s||x.isFunction(s)||(s={}),u===a&&(s=this,--a);u>a;a++)if(null!=(e=arguments[a]))for(t in e)n=s[t],r=e[t],s!==r&&(l&&r&&(x.isPlainObject(r)||(i=x.isArray(r)))?(i?(i=!1,o=n&&x.isArray(n)?n:[]):o=n&&x.isPlainObject(n)?n:{},s[t]=x.extend(l,o,r)):r!==undefined&&(s[t]=r));return s},x.extend({expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=a),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){(e===!0?--x.readyWait:x.isReady)||(x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(o,[x]),x.fn.trigger&&x(o).trigger("ready").off("ready")))},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if("object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:JSON.parse,parseXML:function(e){var t,n;if(!e||"string"!=typeof e)return null;try{n=new DOMParser,t=n.parseFromString(e,"text/xml")}catch(r){t=undefined}return(!t||t.getElementsByTagName("parsererror").length)&&x.error("Invalid XML: "+e),t},noop:function(){},globalEval:function(e){var t,n=eval;e=x.trim(e),e&&(1===e.indexOf("use strict")?(t=o.createElement("script"),t.text=e,o.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(k,"ms-").replace(N,E)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,s=j(e);if(n){if(s){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(s){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:function(e){return null==e?"":v.call(e)},makeArray:function(e,t){var n=t||[];return null!=e&&(j(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:g.call(t,e,n)},merge:function(e,t){var n=t.length,r=e.length,i=0;if("number"==typeof n)for(;n>i;i++)e[r++]=t[i];else while(t[i]!==undefined)e[r++]=t[i++];return e.length=r,e},grep:function(e,t,n){var r,i=[],o=0,s=e.length;for(n=!!n;s>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,s=j(e),a=[];if(s)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(a[a.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(a[a.length]=r);return f.apply([],a)},guid:1,proxy:function(e,t){var n,r,i;return"string"==typeof t&&(n=e[t],t=e,e=n),x.isFunction(e)?(r=d.call(arguments,2),i=function(){return e.apply(t||this,r.concat(d.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):undefined},access:function(e,t,n,r,i,o,s){var a=0,u=e.length,l=null==n;if("object"===x.type(n)){i=!0;for(a in n)x.access(e,t,a,n[a],!0,o,s)}else if(r!==undefined&&(i=!0,x.isFunction(r)||(s=!0),l&&(s?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(x(e),n)})),t))for(;u>a;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:l?t.call(e):u?t(e[0],n):o},now:Date.now,swap:function(e,t,n,r){var i,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=s[o];return i}}),x.ready.promise=function(t){return n||(n=x.Deferred(),"complete"===o.readyState?setTimeout(x.ready):(o.addEventListener("DOMContentLoaded",S,!1),e.addEventListener("load",S,!1))),n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function j(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}t=x(o),function(e,undefined){var t,n,r,i,o,s,a,u,l,c,p,f,h,d,g,m,y,v="sizzle"+-new Date,b=e.document,w=0,T=0,C=st(),k=st(),N=st(),E=!1,S=function(e,t){return e===t?(E=!0,0):0},j=typeof undefined,D=1<<31,A={}.hasOwnProperty,L=[],q=L.pop,H=L.push,O=L.push,F=L.slice,P=L.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",W="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",$=W.replace("w","w#"),B="\\["+M+"*("+W+")"+M+"*(?:([*^$|!~]?=)"+M+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+$+")|)|)"+M+"*\\]",I=":("+W+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+B.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=RegExp("^"+M+"*,"+M+"*"),X=RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=RegExp(M+"*[+~]"),Y=RegExp("="+M+"*([^\\]'\"]*)"+M+"*\\]","g"),V=RegExp(I),G=RegExp("^"+$+"$"),J={ID:RegExp("^#("+W+")"),CLASS:RegExp("^\\.("+W+")"),TAG:RegExp("^("+W.replace("w","w*")+")"),ATTR:RegExp("^"+B),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:RegExp("^(?:"+R+")$","i"),needsContext:RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Q=/^[^{]+\{\s*\[native \w/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Z=/^(?:input|select|textarea|button)$/i,et=/^h\d$/i,tt=/'|\\/g,nt=RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),rt=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{O.apply(L=F.call(b.childNodes),b.childNodes),L[b.childNodes.length].nodeType}catch(it){O={apply:L.length?function(e,t){H.apply(e,F.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function ot(e,t,r,i){var o,s,a,u,l,f,g,m,x,w;if((t?t.ownerDocument||t:b)!==p&&c(t),t=t||p,r=r||[],!e||"string"!=typeof e)return r;if(1!==(u=t.nodeType)&&9!==u)return[];if(h&&!i){if(o=K.exec(e))if(a=o[1]){if(9===u){if(s=t.getElementById(a),!s||!s.parentNode)return r;if(s.id===a)return r.push(s),r}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(a))&&y(t,s)&&s.id===a)return r.push(s),r}else{if(o[2])return O.apply(r,t.getElementsByTagName(e)),r;if((a=o[3])&&n.getElementsByClassName&&t.getElementsByClassName)return O.apply(r,t.getElementsByClassName(a)),r}if(n.qsa&&(!d||!d.test(e))){if(m=g=v,x=t,w=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){f=gt(e),(g=t.getAttribute("id"))?m=g.replace(tt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",l=f.length;while(l--)f[l]=m+mt(f[l]);x=U.test(e)&&t.parentNode||t,w=f.join(",")}if(w)try{return O.apply(r,x.querySelectorAll(w)),r}catch(T){}finally{g||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,r,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>i.cacheLength&&delete t[e.shift()],t[n]=r}return t}function at(e){return e[v]=!0,e}function ut(e){var t=p.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function lt(e,t){var n=e.split("|"),r=e.length;while(r--)i.attrHandle[n[r]]=t}function ct(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return at(function(t){return t=+t,at(function(n,r){var i,o=e([],n.length,t),s=o.length;while(s--)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}s=ot.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},n=ot.support={},c=ot.setDocument=function(e){var t=e?e.ownerDocument||e:b,r=t.defaultView;return t!==p&&9===t.nodeType&&t.documentElement?(p=t,f=t.documentElement,h=!s(t),r&&r.attachEvent&&r!==r.top&&r.attachEvent("onbeforeunload",function(){c()}),n.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ut(function(e){return e.appendChild(t.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),n.getById=ut(function(e){return f.appendChild(e).id=v,!t.getElementsByName||!t.getElementsByName(v).length}),n.getById?(i.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){return e.getAttribute("id")===t}}):(delete i.find.ID,i.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=n.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==j?t.getElementsByTagName(e):undefined}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.CLASS=n.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==j&&h?t.getElementsByClassName(e):undefined},g=[],d=[],(n.qsa=Q.test(t.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||d.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll(":checked").length||d.push(":checked")}),ut(function(e){var n=t.createElement("input");n.setAttribute("type","hidden"),e.appendChild(n).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&d.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||d.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),d.push(",.*:")})),(n.matchesSelector=Q.test(m=f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ut(function(e){n.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",I)}),d=d.length&&RegExp(d.join("|")),g=g.length&&RegExp(g.join("|")),y=Q.test(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},S=f.compareDocumentPosition?function(e,r){if(e===r)return E=!0,0;var i=r.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(r);return i?1&i||!n.sortDetached&&r.compareDocumentPosition(e)===i?e===t||y(b,e)?-1:r===t||y(b,r)?1:l?P.call(l,e)-P.call(l,r):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,n){var r,i=0,o=e.parentNode,s=n.parentNode,a=[e],u=[n];if(e===n)return E=!0,0;if(!o||!s)return e===t?-1:n===t?1:o?-1:s?1:l?P.call(l,e)-P.call(l,n):0;if(o===s)return ct(e,n);r=e;while(r=r.parentNode)a.unshift(r);r=n;while(r=r.parentNode)u.unshift(r);while(a[i]===u[i])i++;return i?ct(a[i],u[i]):a[i]===b?-1:u[i]===b?1:0},t):p},ot.matches=function(e,t){return ot(e,null,null,t)},ot.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Y,"='$1']"),!(!n.matchesSelector||!h||g&&g.test(t)||d&&d.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return ot(t,p,null,[e]).length>0},ot.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},ot.attr=function(e,t){(e.ownerDocument||e)!==p&&c(e);var r=i.attrHandle[t.toLowerCase()],o=r&&A.call(i.attrHandle,t.toLowerCase())?r(e,t,!h):undefined;return o===undefined?n.attributes||!h?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null:o},ot.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},ot.uniqueSort=function(e){var t,r=[],i=0,o=0;if(E=!n.detectDuplicates,l=!n.sortStable&&e.slice(0),e.sort(S),E){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return e},o=ot.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=ot.selectors={cacheLength:50,createPseudo:at,match:J,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(nt,rt),e[3]=(e[4]||e[5]||"").replace(nt,rt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ot.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ot.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return J.CHILD.test(e[0])?null:(e[3]&&e[4]!==undefined?e[2]=e[4]:n&&V.test(n)&&(t=gt(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(nt,rt).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&C(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ot.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,h,d,g=o!==s?"nextSibling":"previousSibling",m=t.parentNode,y=a&&t.nodeName.toLowerCase(),x=!u&&!a;if(m){if(o){while(g){p=t;while(p=p[g])if(a?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;d=g="only"===e&&!d&&"nextSibling"}return!0}if(d=[s?m.firstChild:m.lastChild],s&&x){c=m[v]||(m[v]={}),l=c[e]||[],h=l[0]===w&&l[1],f=l[0]===w&&l[2],p=h&&m.childNodes[h];while(p=++h&&p&&p[g]||(f=h=0)||d.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[w,h,f];break}}else if(x&&(l=(t[v]||(t[v]={}))[e])&&l[0]===w)f=l[1];else while(p=++h&&p&&p[g]||(f=h=0)||d.pop())if((a?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(x&&((p[v]||(p[v]={}))[e]=[w,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||ot.error("unsupported pseudo: "+e);return r[v]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?at(function(e,n){var i,o=r(e,t),s=o.length;while(s--)i=P.call(e,o[s]),e[i]=!(n[i]=o[s])}):function(e){return r(e,0,n)}):r}},pseudos:{not:at(function(e){var t=[],n=[],r=a(e.replace(z,"$1"));return r[v]?at(function(e,t,n,i){var o,s=r(e,null,i,[]),a=e.length;while(a--)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:at(function(e){return function(t){return ot(e,t).length>0}}),contains:at(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:at(function(e){return G.test(e||"")||ot.error("unsupported lang: "+e),e=e.replace(nt,rt).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return et.test(e.nodeName)},input:function(e){return Z.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},i.pseudos.nth=i.pseudos.eq;for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[t]=pt(t);for(t in{submit:!0,reset:!0})i.pseudos[t]=ft(t);function dt(){}dt.prototype=i.filters=i.pseudos,i.setFilters=new dt;function gt(e,t){var n,r,o,s,a,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);a=e,u=[],l=i.preFilter;while(a){(!n||(r=_.exec(a)))&&(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=X.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(z," ")}),a=a.slice(n.length));for(s in i.filter)!(r=J[s].exec(a))||l[s]&&!(r=l[s](r))||(n=r.shift(),o.push({value:n,type:s,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ot.error(e):k(e,u).slice(0)}function mt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function yt(e,t,n){var i=t.dir,o=n&&"parentNode"===i,s=T++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,a){var u,l,c,p=w+" "+s;if(a){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,a))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[v]||(t[v]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,a)||r,l[1]===!0)return!0}}function vt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,s=[],a=0,u=e.length,l=null!=t;for(;u>a;a++)(o=e[a])&&(!n||n(o,r,i))&&(s.push(o),l&&t.push(a));return s}function bt(e,t,n,r,i,o){return r&&!r[v]&&(r=bt(r)),i&&!i[v]&&(i=bt(i,o)),at(function(o,s,a,u){var l,c,p,f=[],h=[],d=s.length,g=o||Ct(t||"*",a.nodeType?[a]:a,[]),m=!e||!o&&t?g:xt(g,f,e,a,u),y=n?i||(o?e:d||r)?[]:s:m;if(n&&n(m,y,a,u),r){l=xt(y,h),r(l,[],a,u),c=l.length;while(c--)(p=l[c])&&(y[h[c]]=!(m[h[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?P.call(o,p):f[c])>-1&&(o[l]=!(s[l]=p))}}else y=xt(y===s?y.splice(d,y.length):y),i?i(null,s,y,u):O.apply(s,y)})}function wt(e){var t,n,r,o=e.length,s=i.relative[e[0].type],a=s||i.relative[" "],l=s?1:0,c=yt(function(e){return e===t},a,!0),p=yt(function(e){return P.call(t,e)>-1},a,!0),f=[function(e,n,r){return!s&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>l;l++)if(n=i.relative[e[l].type])f=[yt(vt(f),n)];else{if(n=i.filter[e[l].type].apply(null,e[l].matches),n[v]){for(r=++l;o>r;r++)if(i.relative[e[r].type])break;return bt(l>1&&vt(f),l>1&&mt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&wt(e.slice(l,r)),o>r&&wt(e=e.slice(r)),o>r&&mt(e))}f.push(n)}return vt(f)}function Tt(e,t){var n=0,o=t.length>0,s=e.length>0,a=function(a,l,c,f,h){var d,g,m,y=[],v=0,x="0",b=a&&[],T=null!=h,C=u,k=a||s&&i.find.TAG("*",h&&l.parentNode||l),N=w+=null==C?1:Math.random()||.1;for(T&&(u=l!==p&&l,r=n);null!=(d=k[x]);x++){if(s&&d){g=0;while(m=e[g++])if(m(d,l,c)){f.push(d);break}T&&(w=N,r=++n)}o&&((d=!m&&d)&&v--,a&&b.push(d))}if(v+=x,o&&x!==v){g=0;while(m=t[g++])m(b,y,l,c);if(a){if(v>0)while(x--)b[x]||y[x]||(y[x]=q.call(f));y=xt(y)}O.apply(f,y),T&&!a&&y.length>0&&v+t.length>1&&ot.uniqueSort(f)}return T&&(w=N,u=C),b};return o?at(a):a}a=ot.compile=function(e,t){var n,r=[],i=[],o=N[e+" "];if(!o){t||(t=gt(e)),n=t.length;while(n--)o=wt(t[n]),o[v]?r.push(o):i.push(o);o=N(e,Tt(i,r))}return o};function Ct(e,t,n){var r=0,i=t.length;for(;i>r;r++)ot(e,t[r],n);return n}function kt(e,t,r,o){var s,u,l,c,p,f=gt(e);if(!o&&1===f.length){if(u=f[0]=f[0].slice(0),u.length>2&&"ID"===(l=u[0]).type&&n.getById&&9===t.nodeType&&h&&i.relative[u[1].type]){if(t=(i.find.ID(l.matches[0].replace(nt,rt),t)||[])[0],!t)return r;e=e.slice(u.shift().value.length)}s=J.needsContext.test(e)?0:u.length;while(s--){if(l=u[s],i.relative[c=l.type])break;if((p=i.find[c])&&(o=p(l.matches[0].replace(nt,rt),U.test(u[0].type)&&t.parentNode||t))){if(u.splice(s,1),e=o.length&&mt(u),!e)return O.apply(r,o),r;break}}}return a(e,f)(o,t,!h,r,U.test(e)),r}n.sortStable=v.split("").sort(S).join("")===v,n.detectDuplicates=E,c(),n.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(p.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||lt("type|href|height|width",function(e,t,n){return n?undefined:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||lt("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?undefined:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||lt(R,function(e,t,n){var r;return n?undefined:(r=e.getAttributeNode(t))&&r.specified?r.value:e[t]===!0?t.toLowerCase():null}),x.find=ot,x.expr=ot.selectors,x.expr[":"]=x.expr.pseudos,x.unique=ot.uniqueSort,x.text=ot.getText,x.isXMLDoc=ot.isXML,x.contains=ot.contains}(e);var D={};function A(e){var t=D[e]={};return x.each(e.match(w)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?D[e]||A(e):x.extend({},e);var t,n,r,i,o,s,a=[],u=!e.once&&[],l=function(p){for(t=e.memory&&p,n=!0,s=i||0,i=0,o=a.length,r=!0;a&&o>s;s++)if(a[s].apply(p[0],p[1])===!1&&e.stopOnFalse){t=!1;break}r=!1,a&&(u?u.length&&l(u.shift()):t?a=[]:c.disable())},c={add:function(){if(a){var n=a.length;(function s(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&c.has(n)||a.push(n):n&&n.length&&"string"!==r&&s(n)})})(arguments),r?o=a.length:t&&(i=n,l(t))}return this},remove:function(){return a&&x.each(arguments,function(e,t){var n;while((n=x.inArray(t,a,n))>-1)a.splice(n,1),r&&(o>=n&&o--,s>=n&&s--)}),this},has:function(e){return e?x.inArray(e,a)>-1:!(!a||!a.length)},empty:function(){return a=[],o=0,this},disable:function(){return a=u=t=undefined,this},disabled:function(){return!a},lock:function(){return u=undefined,t||c.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!a||n&&!u||(t=t||[],t=[e,t.slice?t.slice():t],r?u.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var s=o[0],a=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&&s.add(function(){n=a},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=s.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=d.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),s=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?d.call(arguments):r,n===a?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},a,u,l;if(r>1)for(a=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(s(t,l,n)).fail(o.reject).progress(s(t,u,a)):--i;return i||o.resolveWith(l,n),o.promise()}}),x.support=function(t){var n=o.createElement("input"),r=o.createDocumentFragment(),i=o.createElement("div"),s=o.createElement("select"),a=s.appendChild(o.createElement("option"));return n.type?(n.type="checkbox",t.checkOn=""!==n.value,t.optSelected=a.selected,t.reliableMarginRight=!0,t.boxSizingReliable=!0,t.pixelPosition=!1,n.checked=!0,t.noCloneChecked=n.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!a.disabled,n=o.createElement("input"),n.value="t",n.type="radio",t.radioValue="t"===n.value,n.setAttribute("checked","t"),n.setAttribute("name","t"),r.appendChild(n),t.checkClone=r.cloneNode(!0).cloneNode(!0).lastChild.checked,t.focusinBubbles="onfocusin"in e,i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===i.style.backgroundClip,x(function(){var n,r,s="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",a=o.getElementsByTagName("body")[0];a&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(n).appendChild(i),i.innerHTML="",i.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",x.swap(a,null!=a.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===i.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(i,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(i,null)||{width:"4px"}).width,r=i.appendChild(o.createElement("div")),r.style.cssText=i.style.cssText=s,r.style.marginRight=r.style.width="0",i.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),a.removeChild(n))}),t):t}({});var L,q,H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,O=/([A-Z])/g;function F(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=x.expando+Math.random()}F.uid=1,F.accepts=function(e){return e.nodeType?1===e.nodeType||9===e.nodeType:!0},F.prototype={key:function(e){if(!F.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=F.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(r){t[this.expando]=n,x.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var r,i=this.key(e),o=this.cache[i];if("string"==typeof t)o[t]=n;else if(x.isEmptyObject(o))x.extend(this.cache[i],t);else for(r in t)o[r]=t[r];return o},get:function(e,t){var n=this.cache[this.key(e)];return t===undefined?n:n[t]},access:function(e,t,n){var r;return t===undefined||t&&"string"==typeof t&&n===undefined?(r=this.get(e,t),r!==undefined?r:this.get(e,x.camelCase(t))):(this.set(e,t,n),n!==undefined?n:t)},remove:function(e,t){var n,r,i,o=this.key(e),s=this.cache[o];if(t===undefined)this.cache[o]={};else{x.isArray(t)?r=t.concat(t.map(x.camelCase)):(i=x.camelCase(t),t in s?r=[t,i]:(r=i,r=r in s?[r]:r.match(w)||[])),n=r.length;while(n--)delete s[r[n]]}},hasData:function(e){return!x.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&&delete this.cache[e[this.expando]]}},L=new F,q=new F,x.extend({acceptData:F.accepts,hasData:function(e){return L.hasData(e)||q.hasData(e)},data:function(e,t,n){return L.access(e,t,n)},removeData:function(e,t){L.remove(e,t)},_data:function(e,t,n){return q.access(e,t,n)},_removeData:function(e,t){q.remove(e,t)}}),x.fn.extend({data:function(e,t){var n,r,i=this[0],o=0,s=null;if(e===undefined){if(this.length&&(s=L.get(i),1===i.nodeType&&!q.get(i,"hasDataAttrs"))){for(n=i.attributes;n.length>o;o++)r=n[o].name,0===r.indexOf("data-")&&(r=x.camelCase(r.slice(5)),P(i,r,s[r]));q.set(i,"hasDataAttrs",!0)}return s}return"object"==typeof e?this.each(function(){L.set(this,e)}):x.access(this,function(t){var n,r=x.camelCase(e);if(i&&t===undefined){if(n=L.get(i,e),n!==undefined)return n;if(n=L.get(i,r),n!==undefined)return n;if(n=P(i,r,undefined),n!==undefined)return n}else this.each(function(){var n=L.get(this,r);L.set(this,r,t),-1!==e.indexOf("-")&&n!==undefined&&L.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){L.remove(this,e)})}});function P(e,t,n){var r;if(n===undefined&&1===e.nodeType)if(r="data-"+t.replace(O,"-$1").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:H.test(n)?JSON.parse(n):n}catch(i){}L.set(e,t,n)}else n=undefined;return n}x.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=q.get(e,t),n&&(!r||x.isArray(n)?r=q.access(e,t,x.makeArray(n)):r.push(n)),r||[]):undefined},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),s=function(){x.dequeue(e,t)
};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,s,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return q.get(e,n)||q.access(e,n,{empty:x.Callbacks("once memory").add(function(){q.remove(e,[t+"queue",n])})})}}),x.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),n>arguments.length?x.queue(this[0],e):t===undefined?this:this.each(function(){var n=x.queue(this,e,t);x._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=x.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=undefined),e=e||"fx";while(s--)n=q.get(o[s],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(t)}});var R,M,W=/[\t\r\n\f]/g,$=/\r/g,B=/^(?:input|select|textarea|button)$/i;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[x.propFix[e]||e]})},addClass:function(e){var t,n,r,i,o,s=0,a=this.length,u="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];a>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(W," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,s=0,a=this.length,u=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];a>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(W," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,i=0,o=x(this),s=e.match(w)||[];while(t=s[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===r||"boolean"===n)&&(this.className&&q.set(this,"__className__",this.className),this.className=this.className||e===!1?"":q.get(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(W," ").indexOf(t)>=0)return!0;return!1},val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=x.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,x(this).val()):e,null==i?i="":"number"==typeof i?i+="":x.isArray(i)&&(i=x.map(i,function(e){return null==e?"":e+""})),t=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&t.set(this,i,"value")!==undefined||(this.value=i))});if(i)return t=x.valHooks[i.type]||x.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&(n=t.get(i,"value"))!==undefined?n:(n=i.value,"string"==typeof n?n.replace($,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,s=o?null:[],a=o?i+1:r.length,u=0>i?a:o?i:0;for(;a>u;u++)if(n=r[u],!(!n.selected&&u!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),s=i.length;while(s--)r=i[s],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,t,n){var i,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===r?x.prop(e,t,n):(1===s&&x.isXMLDoc(e)||(t=t.toLowerCase(),i=x.attrHooks[t]||(x.expr.match.bool.test(t)?M:R)),n===undefined?i&&"get"in i&&null!==(o=i.get(e,t))?o:(o=x.find.attr(e,t),null==o?undefined:o):null!==n?i&&"set"in i&&(o=i.set(e,n,t))!==undefined?o:(e.setAttribute(t,n+""),n):(x.removeAttr(e,t),undefined))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return o=1!==s||!x.isXMLDoc(e),o&&(t=x.propFix[t]||t,i=x.propHooks[t]),n!==undefined?i&&"set"in i&&(r=i.set(e,n,t))!==undefined?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||B.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),M={set:function(e,t,n){return t===!1?x.removeAttr(e,n):e.setAttribute(n,n),n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,t){var n=x.expr.attrHandle[t]||x.find.attr;x.expr.attrHandle[t]=function(e,t,r){var i=x.expr.attrHandle[t],o=r?undefined:(x.expr.attrHandle[t]=undefined)!=n(e,t,r)?t.toLowerCase():null;return x.expr.attrHandle[t]=i,o}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,t){return x.isArray(t)?e.checked=x.inArray(x(e).val(),t)>=0:undefined}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var I=/^key/,z=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,X=/^([^.]*)(?:\.(.+)|)$/;function U(){return!0}function Y(){return!1}function V(){try{return o.activeElement}catch(e){}}x.event={global:{},add:function(e,t,n,i,o){var s,a,u,l,c,p,f,h,d,g,m,y=q.get(e);if(y){n.handler&&(s=n,n=s.handler,o=s.selector),n.guid||(n.guid=x.guid++),(l=y.events)||(l=y.events={}),(a=y.handle)||(a=y.handle=function(e){return typeof x===r||e&&x.event.triggered===e.type?undefined:x.event.dispatch.apply(a.elem,arguments)},a.elem=e),t=(t||"").match(w)||[""],c=t.length;while(c--)u=X.exec(t[c])||[],d=m=u[1],g=(u[2]||"").split(".").sort(),d&&(f=x.event.special[d]||{},d=(o?f.delegateType:f.bindType)||d,f=x.event.special[d]||{},p=x.extend({type:d,origType:m,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&x.expr.match.needsContext.test(o),namespace:g.join(".")},s),(h=l[d])||(h=l[d]=[],h.delegateCount=0,f.setup&&f.setup.call(e,i,g,a)!==!1||e.addEventListener&&e.addEventListener(d,a,!1)),f.add&&(f.add.call(e,p),p.handler.guid||(p.handler.guid=n.guid)),o?h.splice(h.delegateCount++,0,p):h.push(p),x.event.global[d]=!0);e=null}},remove:function(e,t,n,r,i){var o,s,a,u,l,c,p,f,h,d,g,m=q.hasData(e)&&q.get(e);if(m&&(u=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(a=X.exec(t[l])||[],h=g=a[1],d=(a[2]||"").split(".").sort(),h){p=x.event.special[h]||{},h=(r?p.delegateType:p.bindType)||h,f=u[h]||[],a=a[2]&&RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=f.length;while(o--)c=f[o],!i&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(f.splice(o,1),c.selector&&f.delegateCount--,p.remove&&p.remove.call(e,c));s&&!f.length&&(p.teardown&&p.teardown.call(e,d,m.handle)!==!1||x.removeEvent(e,h,m.handle),delete u[h])}else for(h in u)x.event.remove(e,h+t[l],n,r,!0);x.isEmptyObject(u)&&(delete m.handle,q.remove(e,"events"))}},trigger:function(t,n,r,i){var s,a,u,l,c,p,f,h=[r||o],d=y.call(t,"type")?t.type:t,g=y.call(t,"namespace")?t.namespace.split("."):[];if(a=u=r=r||o,3!==r.nodeType&&8!==r.nodeType&&!_.test(d+x.event.triggered)&&(d.indexOf(".")>=0&&(g=d.split("."),d=g.shift(),g.sort()),c=0>d.indexOf(":")&&"on"+d,t=t[x.expando]?t:new x.Event(d,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=g.join("."),t.namespace_re=t.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=undefined,t.target||(t.target=r),n=null==n?[t]:x.makeArray(n,[t]),f=x.event.special[d]||{},i||!f.trigger||f.trigger.apply(r,n)!==!1)){if(!i&&!f.noBubble&&!x.isWindow(r)){for(l=f.delegateType||d,_.test(l+d)||(a=a.parentNode);a;a=a.parentNode)h.push(a),u=a;u===(r.ownerDocument||o)&&h.push(u.defaultView||u.parentWindow||e)}s=0;while((a=h[s++])&&!t.isPropagationStopped())t.type=s>1?l:f.bindType||d,p=(q.get(a,"events")||{})[t.type]&&q.get(a,"handle"),p&&p.apply(a,n),p=c&&a[c],p&&x.acceptData(a)&&p.apply&&p.apply(a,n)===!1&&t.preventDefault();return t.type=d,i||t.isDefaultPrevented()||f._default&&f._default.apply(h.pop(),n)!==!1||!x.acceptData(r)||c&&x.isFunction(r[d])&&!x.isWindow(r)&&(u=r[c],u&&(r[c]=null),x.event.triggered=d,r[d](),x.event.triggered=undefined,u&&(r[c]=u)),t.result}},dispatch:function(e){e=x.event.fix(e);var t,n,r,i,o,s=[],a=d.call(arguments),u=(q.get(this,"events")||{})[e.type]||[],l=x.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),t=0;while((i=s[t++])&&!e.isPropagationStopped()){e.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(o.namespace))&&(e.handleObj=o,e.data=o.data,r=((x.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a),r!==undefined&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,s=[],a=t.delegateCount,u=e.target;if(a&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!==this;u=u.parentNode||this)if(u.disabled!==!0||"click"!==e.type){for(r=[],n=0;a>n;n++)o=t[n],i=o.selector+" ",r[i]===undefined&&(r[i]=o.needsContext?x(i,this).index(u)>=0:x.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&s.push({elem:u,handlers:r})}return t.length>a&&s.push({elem:this,handlers:t.slice(a)}),s},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,s=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||o,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||s===undefined||(e.which=1&s?1:2&s?3:4&s?2:0),e}},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,s=e,a=this.fixHooks[i];a||(this.fixHooks[i]=a=z.test(i)?this.mouseHooks:I.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,e=new x.Event(s),t=r.length;while(t--)n=r[t],e[n]=s[n];return e.target||(e.target=o),3===e.target.nodeType&&(e.target=e.target.parentNode),a.filter?a.filter(e,s):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==V()&&this.focus?(this.focus(),!1):undefined},delegateType:"focusin"},blur:{trigger:function(){return this===V()&&this.blur?(this.blur(),!1):undefined},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&x.nodeName(this,"input")?(this.click(),!1):undefined},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==undefined&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},x.Event=function(e,t){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.getPreventDefault&&e.getPreventDefault()?U:Y):this.type=e,t&&x.extend(this,t),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,undefined):new x.Event(e,t)},x.Event.prototype={isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=U,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=U,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=U,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,t,n,r,i){var o,s;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=undefined);for(s in e)this.on(s,t,n,e[s],i);return this}if(null==n&&null==r?(r=t,n=t=undefined):null==r&&("string"==typeof t?(r=n,n=undefined):(r=n,n=t,t=undefined)),r===!1)r=Y;else if(!r)return this;return 1===i&&(o=r,r=function(e){return x().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=x.guid++)),this.each(function(){x.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,x(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return(t===!1||"function"==typeof t)&&(n=t,t=undefined),n===!1&&(n=Y),this.each(function(){x.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?x.event.trigger(e,t,n,!0):undefined}});var G=/^.[^:#\[\.,]*$/,J=/^(?:parents|prev(?:Until|All))/,Q=x.expr.match.needsContext,K={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t=x(e,this),n=t.length;return this.filter(function(){var e=0;for(;n>e;e++)if(x.contains(this,t[e]))return!0})},not:function(e){return this.pushStack(et(this,e||[],!0))},filter:function(e){return this.pushStack(et(this,e||[],!1))},is:function(e){return!!et(this,"string"==typeof e&&Q.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],s=Q.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(s?s.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?g.call(x(e),this[0]):g.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function Z(e,t){while((e=e[t])&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return Z(e,"nextSibling")},prev:function(e){return Z(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return e.contentDocument||x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(K[e]||x.unique(i),J.test(e)&&i.reverse()),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,t,n){var r=[],i=n!==undefined;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&x(e).is(n))break;r.push(e)}return r},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function et(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(G.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return g.call(t,e)>=0!==n})}var tt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,nt=/<([\w:]+)/,rt=/<|&#?\w+;/,it=/<(?:script|style|link)/i,ot=/^(?:checkbox|radio)$/i,st=/checked\s*(?:[^=]|=\s*.checked.)/i,at=/^$|\/(?:java|ecma)script/i,ut=/^true\/(.*)/,lt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ct={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,"",""]};ct.optgroup=ct.option,ct.tbody=ct.tfoot=ct.colgroup=ct.caption=ct.thead,ct.th=ct.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===undefined?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=pt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=pt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(mt(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&dt(mt(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++)1===e.nodeType&&(x.cleanData(mt(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===undefined&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!it.test(e)&&!ct[(nt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(tt,"<$1></$2>");try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(x.cleanData(mt(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=f.apply([],e);var r,i,o,s,a,u,l=0,c=this.length,p=this,h=c-1,d=e[0],g=x.isFunction(d);if(g||!(1>=c||"string"!=typeof d||x.support.checkClone)&&st.test(d))return this.each(function(r){var i=p.eq(r);g&&(e[0]=d.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(r=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),i=r.firstChild,1===r.childNodes.length&&(r=i),i)){for(o=x.map(mt(r,"script"),ft),s=o.length;c>l;l++)a=r,l!==h&&(a=x.clone(a,!0,!0),s&&x.merge(o,mt(a,"script"))),t.call(this[l],a,l);if(s)for(u=o[o.length-1].ownerDocument,x.map(o,ht),l=0;s>l;l++)a=o[l],at.test(a.type||"")&&!q.access(a,"globalEval")&&x.contains(u,a)&&(a.src?x._evalUrl(a.src):x.globalEval(a.textContent.replace(lt,"")))}return this}}),x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=[],i=x(e),o=i.length-1,s=0;for(;o>=s;s++)n=s===o?this:this.clone(!0),x(i[s])[t](n),h.apply(r,n.get());return this.pushStack(r)}}),x.extend({clone:function(e,t,n){var r,i,o,s,a=e.cloneNode(!0),u=x.contains(e.ownerDocument,e);if(!(x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(s=mt(a),o=mt(e),r=0,i=o.length;i>r;r++)yt(o[r],s[r]);if(t)if(n)for(o=o||mt(e),s=s||mt(a),r=0,i=o.length;i>r;r++)gt(o[r],s[r]);else gt(e,a);return s=mt(a,"script"),s.length>0&&dt(s,!u&&mt(e,"script")),a},buildFragment:function(e,t,n,r){var i,o,s,a,u,l,c=0,p=e.length,f=t.createDocumentFragment(),h=[];for(;p>c;c++)if(i=e[c],i||0===i)if("object"===x.type(i))x.merge(h,i.nodeType?[i]:i);else if(rt.test(i)){o=o||f.appendChild(t.createElement("div")),s=(nt.exec(i)||["",""])[1].toLowerCase(),a=ct[s]||ct._default,o.innerHTML=a[1]+i.replace(tt,"<$1></$2>")+a[2],l=a[0];while(l--)o=o.lastChild;x.merge(h,o.childNodes),o=f.firstChild,o.textContent=""}else h.push(t.createTextNode(i));f.textContent="",c=0;while(i=h[c++])if((!r||-1===x.inArray(i,r))&&(u=x.contains(i.ownerDocument,i),o=mt(f.appendChild(i),"script"),u&&dt(o),n)){l=0;while(i=o[l++])at.test(i.type||"")&&n.push(i)}return f},cleanData:function(e){var t,n,r,i,o,s,a=x.event.special,u=0;for(;(n=e[u])!==undefined;u++){if(F.accepts(n)&&(o=n[q.expando],o&&(t=q.cache[o]))){if(r=Object.keys(t.events||{}),r.length)for(s=0;(i=r[s])!==undefined;s++)a[i]?x.event.remove(n,i):x.removeEvent(n,i,t.handle);q.cache[o]&&delete q.cache[o]}delete L.cache[n[L.expando]]}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}});function pt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ft(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function ht(e){var t=ut.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function dt(e,t){var n=e.length,r=0;for(;n>r;r++)q.set(e[r],"globalEval",!t||q.get(t[r],"globalEval"))}function gt(e,t){var n,r,i,o,s,a,u,l;if(1===t.nodeType){if(q.hasData(e)&&(o=q.access(e),s=q.set(t,o),l=o.events)){delete s.handle,s.events={};for(i in l)for(n=0,r=l[i].length;r>n;n++)x.event.add(t,i,l[i][n])}L.hasData(e)&&(a=L.access(e),u=x.extend({},a),L.set(t,u))}}function mt(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return t===undefined||t&&x.nodeName(e,t)?x.merge([e],n):n}function yt(e,t){var n=t.nodeName.toLowerCase();"input"===n&&ot.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}x.fn.extend({wrapAll:function(e){var t;return x.isFunction(e)?this.each(function(t){x(this).wrapAll(e.call(this,t))}):(this[0]&&(t=x(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var vt,xt,bt=/^(none|table(?!-c[ea]).+)/,wt=/^margin/,Tt=RegExp("^("+b+")(.*)$","i"),Ct=RegExp("^("+b+")(?!px)[a-z%]+$","i"),kt=RegExp("^([+-])=("+b+")","i"),Nt={BODY:"block"},Et={position:"absolute",visibility:"hidden",display:"block"},St={letterSpacing:0,fontWeight:400},jt=["Top","Right","Bottom","Left"],Dt=["Webkit","O","Moz","ms"];function At(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Dt.length;while(i--)if(t=Dt[i]+n,t in e)return t;return r}function Lt(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function qt(t){return e.getComputedStyle(t,null)}function Ht(e,t){var n,r,i,o=[],s=0,a=e.length;for(;a>s;s++)r=e[s],r.style&&(o[s]=q.get(r,"olddisplay"),n=r.style.display,t?(o[s]||"none"!==n||(r.style.display=""),""===r.style.display&&Lt(r)&&(o[s]=q.access(r,"olddisplay",Rt(r.nodeName)))):o[s]||(i=Lt(r),(n&&"none"!==n||!i)&&q.set(r,"olddisplay",i?n:x.css(r,"display"))));for(s=0;a>s;s++)r=e[s],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[s]||"":"none"));return e}x.fn.extend({css:function(e,t){return x.access(this,function(e,t,n){var r,i,o={},s=0;if(x.isArray(t)){for(r=qt(e),i=t.length;i>s;s++)o[t[s]]=x.css(e,t[s],!1,r);return o}return n!==undefined?x.style(e,t,n):x.css(e,t)},e,t,arguments.length>1)},show:function(){return Ht(this,!0)},hide:function(){return Ht(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Lt(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=vt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,a=x.camelCase(t),u=e.style;return t=x.cssProps[a]||(x.cssProps[a]=At(u,a)),s=x.cssHooks[t]||x.cssHooks[a],n===undefined?s&&"get"in s&&(i=s.get(e,!1,r))!==undefined?i:u[t]:(o=typeof n,"string"===o&&(i=kt.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(x.css(e,t)),o="number"),null==n||"number"===o&&isNaN(n)||("number"!==o||x.cssNumber[a]||(n+="px"),x.support.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),s&&"set"in s&&(n=s.set(e,n,r))===undefined||(u[t]=n)),undefined)}},css:function(e,t,n,r){var i,o,s,a=x.camelCase(t);return t=x.cssProps[a]||(x.cssProps[a]=At(e.style,a)),s=x.cssHooks[t]||x.cssHooks[a],s&&"get"in s&&(i=s.get(e,!0,n)),i===undefined&&(i=vt(e,t,r)),"normal"===i&&t in St&&(i=St[t]),""===n||n?(o=parseFloat(i),n===!0||x.isNumeric(o)?o||0:i):i}}),vt=function(e,t,n){var r,i,o,s=n||qt(e),a=s?s.getPropertyValue(t)||s[t]:undefined,u=e.style;return s&&(""!==a||x.contains(e.ownerDocument,e)||(a=x.style(e,t)),Ct.test(a)&&wt.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=s.width,u.width=r,u.minWidth=i,u.maxWidth=o)),a};function Ot(e,t,n){var r=Tt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Ft(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,s=0;for(;4>o;o+=2)"margin"===n&&(s+=x.css(e,n+jt[o],!0,i)),r?("content"===n&&(s-=x.css(e,"padding"+jt[o],!0,i)),"margin"!==n&&(s-=x.css(e,"border"+jt[o]+"Width",!0,i))):(s+=x.css(e,"padding"+jt[o],!0,i),"padding"!==n&&(s+=x.css(e,"border"+jt[o]+"Width",!0,i)));return s}function Pt(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=qt(e),s=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=vt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Ct.test(i))return i;r=s&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+Ft(e,t,n||(s?"border":"content"),r,o)+"px"}function Rt(e){var t=o,n=Nt[e];return n||(n=Mt(e,t),"none"!==n&&n||(xt=(xt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(xt[0].contentWindow||xt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=Mt(e,t),xt.detach()),Nt[e]=n),n}function Mt(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,t){x.cssHooks[t]={get:function(e,n,r){return n?0===e.offsetWidth&&bt.test(x.css(e,"display"))?x.swap(e,Et,function(){return Pt(e,t,r)}):Pt(e,t,r):undefined},set:function(e,n,r){var i=r&&qt(e);return Ot(e,n,r?Ft(e,t,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,t){return t?x.swap(e,{display:"inline-block"},vt,[e,"marginRight"]):undefined}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,t){x.cssHooks[t]={get:function(e,n){return n?(n=vt(e,t),Ct.test(n)?x(e).position()[t]+"px":n):undefined}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+jt[r]+t]=o[r]||o[r-2]||o[0];return i}},wt.test(e)||(x.cssHooks[e+t].set=Ot)});var Wt=/%20/g,$t=/\[\]$/,Bt=/\r?\n/g,It=/^(?:submit|button|image|reset|file)$/i,zt=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&zt.test(this.nodeName)&&!It.test(e)&&(this.checked||!ot.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(Bt,"\r\n")}}):{name:t.name,value:n.replace(Bt,"\r\n")}}).get()}}),x.param=function(e,t){var n,r=[],i=function(e,t){t=x.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(t===undefined&&(t=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){i(this.name,this.value)});else for(n in e)_t(n,e[n],t,i);return r.join("&").replace(Wt,"+")};function _t(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||$t.test(e)?r(e,i):_t(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)_t(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)
},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var Xt,Ut,Yt=x.now(),Vt=/\?/,Gt=/#.*$/,Jt=/([?&])_=[^&]*/,Qt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Kt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Zt=/^(?:GET|HEAD)$/,en=/^\/\//,tn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,nn=x.fn.load,rn={},on={},sn="*/".concat("*");try{Ut=i.href}catch(an){Ut=o.createElement("a"),Ut.href="",Ut=Ut.href}Xt=tn.exec(Ut.toLowerCase())||[];function un(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function ln(e,t,n,r){var i={},o=e===on;function s(a){var u;return i[a]=!0,x.each(e[a]||[],function(e,a){var l=a(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):undefined:(t.dataTypes.unshift(l),s(l),!1)}),u}return s(t.dataTypes[0])||!i["*"]&&s("*")}function cn(e,t){var n,r,i=x.ajaxSettings.flatOptions||{};for(n in t)t[n]!==undefined&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,t,n){if("string"!=typeof e&&nn)return nn.apply(this,arguments);var r,i,o,s=this,a=e.indexOf(" ");return a>=0&&(r=e.slice(a),e=e.slice(0,a)),x.isFunction(t)?(n=t,t=undefined):t&&"object"==typeof t&&(i="POST"),s.length>0&&x.ajax({url:e,type:i,dataType:"html",data:t}).done(function(e){o=arguments,s.html(r?x("<div>").append(x.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){s.each(n,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ut,type:"GET",isLocal:Kt.test(Xt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":sn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?cn(cn(e,x.ajaxSettings),t):cn(x.ajaxSettings,e)},ajaxPrefilter:un(rn),ajaxTransport:un(on),ajax:function(e,t){"object"==typeof e&&(t=e,e=undefined),t=t||{};var n,r,i,o,s,a,u,l,c=x.ajaxSetup({},t),p=c.context||c,f=c.context&&(p.nodeType||p.jquery)?x(p):x.event,h=x.Deferred(),d=x.Callbacks("once memory"),g=c.statusCode||{},m={},y={},v=0,b="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===v){if(!o){o={};while(t=Qt.exec(i))o[t[1].toLowerCase()]=t[2]}t=o[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===v?i:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return v||(e=y[n]=y[n]||e,m[e]=t),this},overrideMimeType:function(e){return v||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>v)for(t in e)g[t]=[g[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||b;return n&&n.abort(t),k(0,t),this}};if(h.promise(T).complete=d.add,T.success=T.done,T.error=T.fail,c.url=((e||c.url||Ut)+"").replace(Gt,"").replace(en,Xt[1]+"//"),c.type=t.method||t.type||c.method||c.type,c.dataTypes=x.trim(c.dataType||"*").toLowerCase().match(w)||[""],null==c.crossDomain&&(a=tn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===Xt[1]&&a[2]===Xt[2]&&(a[3]||("http:"===a[1]?"80":"443"))===(Xt[3]||("http:"===Xt[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=x.param(c.data,c.traditional)),ln(rn,c,t,T),2===v)return T;u=c.global,u&&0===x.active++&&x.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Zt.test(c.type),r=c.url,c.hasContent||(c.data&&(r=c.url+=(Vt.test(r)?"&":"?")+c.data,delete c.data),c.cache===!1&&(c.url=Jt.test(r)?r.replace(Jt,"$1_="+Yt++):r+(Vt.test(r)?"&":"?")+"_="+Yt++)),c.ifModified&&(x.lastModified[r]&&T.setRequestHeader("If-Modified-Since",x.lastModified[r]),x.etag[r]&&T.setRequestHeader("If-None-Match",x.etag[r])),(c.data&&c.hasContent&&c.contentType!==!1||t.contentType)&&T.setRequestHeader("Content-Type",c.contentType),T.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+sn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)T.setRequestHeader(l,c.headers[l]);if(c.beforeSend&&(c.beforeSend.call(p,T,c)===!1||2===v))return T.abort();b="abort";for(l in{success:1,error:1,complete:1})T[l](c[l]);if(n=ln(on,c,t,T)){T.readyState=1,u&&f.trigger("ajaxSend",[T,c]),c.async&&c.timeout>0&&(s=setTimeout(function(){T.abort("timeout")},c.timeout));try{v=1,n.send(m,k)}catch(C){if(!(2>v))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,t,o,a){var l,m,y,b,w,C=t;2!==v&&(v=2,s&&clearTimeout(s),n=undefined,i=a||"",T.readyState=e>0?4:0,l=e>=200&&300>e||304===e,o&&(b=pn(c,T,o)),b=fn(c,b,T,l),l?(c.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(x.lastModified[r]=w),w=T.getResponseHeader("etag"),w&&(x.etag[r]=w)),204===e||"HEAD"===c.type?C="nocontent":304===e?C="notmodified":(C=b.state,m=b.data,y=b.error,l=!y)):(y=C,(e||!C)&&(C="error",0>e&&(e=0))),T.status=e,T.statusText=(t||C)+"",l?h.resolveWith(p,[m,C,T]):h.rejectWith(p,[T,C,y]),T.statusCode(g),g=undefined,u&&f.trigger(l?"ajaxSuccess":"ajaxError",[T,c,l?m:y]),d.fireWith(p,[T,C]),u&&(f.trigger("ajaxComplete",[T,c]),--x.active||x.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,t){return x.get(e,undefined,t,"script")}}),x.each(["get","post"],function(e,t){x[t]=function(e,n,r,i){return x.isFunction(n)&&(i=i||r,r=n,n=undefined),x.ajax({url:e,type:t,dataType:i,data:n,success:r})}});function pn(e,t,n){var r,i,o,s,a=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),r===undefined&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}s||(s=i)}o=o||s}return o?(o!==u[0]&&u.unshift(o),n[o]):undefined}function fn(e,t,n,r){var i,o,s,a,u,l={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)l[s.toLowerCase()]=e.converters[s];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(s=l[u+" "+o]||l["* "+o],!s)for(i in l)if(a=i.split(" "),a[1]===o&&(s=l[u+" "+a[0]]||l["* "+a[0]])){s===!0?s=l[i]:l[i]!==!0&&(o=a[0],c.unshift(a[1]));break}if(s!==!0)if(s&&e["throws"])t=s(t);else try{t=s(t)}catch(p){return{state:"parsererror",error:s?p:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===undefined&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),x.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=x("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),o.head.appendChild(t[0])},abort:function(){n&&n()}}}});var hn=[],dn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=hn.pop()||x.expando+"_"+Yt++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,s,a=t.jsonp!==!1&&(dn.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&dn.test(t.data)&&"data");return a||"jsonp"===t.dataTypes[0]?(i=t.jsonpCallback=x.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(dn,"$1"+i):t.jsonp!==!1&&(t.url+=(Vt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||x.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){s=arguments},r.always(function(){e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,hn.push(i)),s&&x.isFunction(o)&&o(s[0]),s=o=undefined}),"script"):undefined}),x.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var gn=x.ajaxSettings.xhr(),mn={0:200,1223:204},yn=0,vn={};e.ActiveXObject&&x(e).on("unload",function(){for(var e in vn)vn[e]();vn=undefined}),x.support.cors=!!gn&&"withCredentials"in gn,x.support.ajax=gn=!!gn,x.ajaxTransport(function(e){var t;return x.support.cors||gn&&!e.crossDomain?{send:function(n,r){var i,o,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)s[i]=e.xhrFields[i];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)s.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete vn[o],t=s.onload=s.onerror=null,"abort"===e?s.abort():"error"===e?r(s.status||404,s.statusText):r(mn[s.status]||s.status,s.statusText,"string"==typeof s.responseText?{text:s.responseText}:undefined,s.getAllResponseHeaders()))}},s.onload=t(),s.onerror=t("error"),t=vn[o=yn++]=t("abort"),s.send(e.hasContent&&e.data||null)},abort:function(){t&&t()}}:undefined});var xn,bn,wn=/^(?:toggle|show|hide)$/,Tn=RegExp("^(?:([+-])=|)("+b+")([a-z%]*)$","i"),Cn=/queueHooks$/,kn=[An],Nn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Tn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),s=(x.cssNumber[e]||"px"!==o&&+r)&&Tn.exec(x.css(n.elem,e)),a=1,u=20;if(s&&s[3]!==o){o=o||s[3],i=i||[],s=+r||1;do a=a||".5",s/=a,x.style(n.elem,e,s+o);while(a!==(a=n.cur()/r)&&1!==a&&--u)}return i&&(s=n.start=+s||+r||0,n.unit=o,n.end=i[1]?s+(i[1]+1)*i[2]:+i[2]),n}]};function En(){return setTimeout(function(){xn=undefined}),xn=x.now()}function Sn(e,t,n){var r,i=(Nn[t]||[]).concat(Nn["*"]),o=0,s=i.length;for(;s>o;o++)if(r=i[o].call(n,t,e))return r}function jn(e,t,n){var r,i,o=0,s=kn.length,a=x.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=xn||En(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,s=0,u=l.tweens.length;for(;u>s;s++)l.tweens[s].run(o);return a.notifyWith(e,[l,o,n]),1>o&&u?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:xn||En(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?a.resolveWith(e,[l,t]):a.rejectWith(e,[l,t]),this}}),c=l.props;for(Dn(c,l.opts.specialEasing);s>o;o++)if(r=kn[o].call(l,e,c,l.opts))return r;return x.map(c,Sn,l),x.isFunction(l.opts.start)&&l.opts.start.call(e,l),x.fx.timer(x.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function Dn(e,t){var n,r,i,o,s;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),s=x.cssHooks[r],s&&"expand"in s){o=s.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(jn,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Nn[n]=Nn[n]||[],Nn[n].unshift(t)},prefilter:function(e,t){t?kn.unshift(e):kn.push(e)}});function An(e,t,n){var r,i,o,s,a,u,l=this,c={},p=e.style,f=e.nodeType&&Lt(e),h=q.get(e,"fxshow");n.queue||(a=x._queueHooks(e,"fx"),null==a.unqueued&&(a.unqueued=0,u=a.empty.fire,a.empty.fire=function(){a.unqueued||u()}),a.unqueued++,l.always(function(){l.always(function(){a.unqueued--,x.queue(e,"fx").length||a.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(p.display="inline-block")),n.overflow&&(p.overflow="hidden",l.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],wn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show")){if("show"!==i||!h||h[r]===undefined)continue;f=!0}c[r]=h&&h[r]||x.style(e,r)}if(!x.isEmptyObject(c)){h?"hidden"in h&&(f=h.hidden):h=q.access(e,"fxshow",{}),o&&(h.hidden=!f),f?x(e).show():l.done(function(){x(e).hide()}),l.done(function(){var t;q.remove(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)s=Sn(f?h[r]:0,r,l),r in h||(h[r]=s.start,f&&(s.end=s.start,s.start="width"===r||"height"===r?1:0))}}function Ln(e,t,n,r,i){return new Ln.prototype.init(e,t,n,r,i)}x.Tween=Ln,Ln.prototype={constructor:Ln,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=Ln.propHooks[this.prop];return e&&e.get?e.get(this):Ln.propHooks._default.get(this)},run:function(e){var t,n=Ln.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Ln.propHooks._default.set(this),this}},Ln.prototype.init.prototype=Ln.prototype,Ln.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Ln.propHooks.scrollTop=Ln.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(qn(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Lt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),s=function(){var t=jn(this,x.extend({},e),o);(i||q.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||o.queue===!1?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=undefined),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=x.timers,s=q.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&Cn.test(i)&&r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));(t||!n)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=q.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,s=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;s>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function qn(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=jt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:qn("show"),slideUp:qn("hide"),slideToggle:qn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=Ln.prototype.init,x.fx.tick=function(){var e,t=x.timers,n=0;for(xn=x.now();t.length>n;n++)e=t[n],e()||t[n]!==e||t.splice(n--,1);t.length||x.fx.stop(),xn=undefined},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){bn||(bn=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(bn),bn=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===undefined?this:this.each(function(t){x.offset.setOffset(this,e,t)});var t,n,i=this[0],o={top:0,left:0},s=i&&i.ownerDocument;if(s)return t=s.documentElement,x.contains(t,i)?(typeof i.getBoundingClientRect!==r&&(o=i.getBoundingClientRect()),n=Hn(s),{top:o.top+n.pageYOffset-t.clientTop,left:o.left+n.pageXOffset-t.clientLeft}):o},x.offset={setOffset:function(e,t,n){var r,i,o,s,a,u,l,c=x.css(e,"position"),p=x(e),f={};"static"===c&&(e.style.position="relative"),a=p.offset(),o=x.css(e,"top"),u=x.css(e,"left"),l=("absolute"===c||"fixed"===c)&&(o+u).indexOf("auto")>-1,l?(r=p.position(),s=r.top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(u)||0),x.isFunction(t)&&(t=t.call(e,n,a)),null!=t.top&&(f.top=t.top-a.top+s),null!=t.left&&(f.left=t.left-a.left+i),"using"in t?t.using.call(e,f):p.css(f)}},x.fn.extend({position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===x.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(r=e.offset()),r.top+=x.css(e[0],"borderTopWidth",!0),r.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-x.css(n,"marginTop",!0),left:t.left-r.left-x.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,n){var r="pageYOffset"===n;x.fn[t]=function(i){return x.access(this,function(t,i,o){var s=Hn(t);return o===undefined?s?s[n]:t[i]:(s?s.scrollTo(r?e.pageXOffset:o,r?o:e.pageYOffset):t[i]=o,undefined)},t,i,arguments.length,null)}});function Hn(e){return x.isWindow(e)?e:9===e.nodeType&&e.defaultView}x.each({Height:"height",Width:"width"},function(e,t){x.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){x.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),s=n||(r===!0||i===!0?"margin":"border");return x.access(this,function(t,n,r){var i;return x.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):r===undefined?x.css(t,n,s):x.style(t,n,r,s)},t,o?r:undefined,o,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}),"object"==typeof e&&"object"==typeof e.document&&(e.jQuery=e.$=x)})(window);
;
/*! jQuery UI - v1.10.3 - 2013-05-03
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.effect.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.position.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
(function(t,e){function i(e,i){var n,o,a,r=e.nodeName.toLowerCase();return"area"===r?(n=e.parentNode,o=n.name,e.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap=#"+o+"]")[0],!!a&&s(a)):!1):(/input|select|textarea|button|object/.test(r)?!e.disabled:"a"===r?e.href||i:i)&&s(e)}function s(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}var n=0,o=/^ui-id-\d+$/;t.ui=t.ui||{},t.extend(t.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),t.fn.extend({focus:function(e){return function(i,s){return"number"==typeof i?this.each(function(){var e=this;setTimeout(function(){t(e).focus(),s&&s.call(e)},i)}):e.apply(this,arguments)}}(t.fn.focus),scrollParent:function(){var e;return e=t.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.css(this,"position"))&&/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(i){if(i!==e)return this.css("zIndex",i);if(this.length)for(var s,n,o=t(this[0]);o.length&&o[0]!==document;){if(s=o.css("position"),("absolute"===s||"relative"===s||"fixed"===s)&&(n=parseInt(o.css("zIndex"),10),!isNaN(n)&&0!==n))return n;o=o.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){o.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])},focusable:function(e){return i(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var s=t.attr(e,"tabindex"),n=isNaN(s);return(n||s>=0)&&i(e,!n)}}),t("<a>").outerWidth(1).jquery||t.each(["Width","Height"],function(i,s){function n(e,i,s,n){return t.each(o,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),n&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var o="Width"===s?["Left","Right"]:["Top","Bottom"],a=s.toLowerCase(),r={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+s]=function(i){return i===e?r["inner"+s].call(this):this.each(function(){t(this).css(a,n(this,i)+"px")})},t.fn["outer"+s]=function(e,i){return"number"!=typeof e?r["outer"+s].call(this,e):this.each(function(){t(this).css(a,n(this,e,!0,i)+"px")})}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(i){return arguments.length?e.call(this,t.camelCase(i)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.support.selectstart="onselectstart"in document.createElement("div"),t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.extend(t.ui,{plugin:{add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i){var s,n=t.plugins[e];if(n&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(s=0;n.length>s;s++)t.options[n[s][0]]&&n[s][1].apply(t.element,i)}},hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)}})})(jQuery),function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(o){}n(e)},t.widget=function(i,s,n){var o,a,r,h,l={},c=i.split(".")[0];i=i.split(".")[1],o=c+"-"+i,n||(n=s,s=t.Widget),t.expr[":"][o.toLowerCase()]=function(e){return!!t.data(e,o)},t[c]=t[c]||{},a=t[c][i],r=t[c][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new r(t,i)},t.extend(r,a,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),h=new s,h.options=t.widget.extend({},h.options),t.each(n,function(i,n){return t.isFunction(n)?(l[i]=function(){var t=function(){return s.prototype[i].apply(this,arguments)},e=function(t){return s.prototype[i].apply(this,t)};return function(){var i,s=this._super,o=this._superApply;return this._super=t,this._superApply=e,i=n.apply(this,arguments),this._super=s,this._superApply=o,i}}(),e):(l[i]=n,e)}),r.prototype=t.widget.extend(h,{widgetEventPrefix:a?h.widgetEventPrefix:i},l,{constructor:r,namespace:c,widgetName:i,widgetFullName:o}),a?(t.each(a._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,r,i._proto)}),delete a._childConstructors):s._childConstructors.push(r),t.widget.bridge(i,r)},t.widget.extend=function(i){for(var n,o,a=s.call(arguments,1),r=0,h=a.length;h>r;r++)for(n in a[r])o=a[r][n],a[r].hasOwnProperty(n)&&o!==e&&(i[n]=t.isPlainObject(o)?t.isPlainObject(i[n])?t.widget.extend({},i[n],o):t.widget.extend({},o):o);return i},t.widget.bridge=function(i,n){var o=n.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,h=s.call(arguments,1),l=this;return a=!r&&h.length?t.widget.extend.apply(null,[a].concat(h)):a,r?this.each(function(){var s,n=t.data(this,o);return n?t.isFunction(n[a])&&"_"!==a.charAt(0)?(s=n[a].apply(n,h),s!==n&&s!==e?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):e):t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new n(a,this))}),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,s){var n,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},n=i.split("."),i=n.shift(),n.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;n.length-1>a;a++)o[n[a]]=o[n[a]]||{},o=o[n[a]];if(i=n.pop(),s===e)return o[i]===e?null:o[i];o[i]=s}else{if(s===e)return this.options[i]===e?null:this.options[i];r[i]=s}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var o,a=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=o=t(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,o=this.widget()),t.each(n,function(n,r){function h(){return i||a.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof r?a[r]:r).apply(a,arguments):e}"string"!=typeof r&&(h.guid=r.guid=r.guid||h.guid||t.guid++);var l=n.match(/^(\w+)\s*(.*)$/),c=l[1]+a.eventNamespace,u=l[2];u?o.delegate(u,c,h):s.bind(c,h)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}})}(jQuery),function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,o="string"==typeof this.options.cancel&&i.target.nodeName?t(i.target).closest(this.options.cancel).length:!1;return n&&!o&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return s._mouseMove(t)},this._mouseUpDelegate=function(t){return s._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0)):!0}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_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}})}(jQuery),function(t){t.widget("ui.draggable",t.ui.mouse,{version:"1.10.3",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||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(t(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){t("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return 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"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"original"!==this.options.helper||t.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1):!1},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_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 e,i,s,n=this.options;return n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===n.containment?(this.containment=[0,0,t(document).width()-this.helperProportions.width-this.margins.left,(t(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):n.containment.constructor===Array?(this.containment=n.containment,undefined):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e="hidden"!==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),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(e){var i,s,n,o,a=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=e.pageX,l=e.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,h=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s]),"drag"===e&&(this.positionAbs=this._convertPositionTo("absolute")),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i){var s=t(this).data("ui-draggable"),n=s.options,o=t.extend({},i,{item:s.element});s.sortables=[],t(n.connectToSortable).each(function(){var i=t.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",e,o))})},stop:function(e,i){var s=t(this).data("ui-draggable"),n=t.extend({},i,{item:s.element});t.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,n))})},drag:function(e,i){var s=t(this).data("ui-draggable"),n=this;t.each(s.sortables,function(){var o=!1,a=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,t.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==a&&this.instance._intersectsWith(this.instance.containerCache)&&t.contains(a.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=t(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",e),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",e),s.dropped=!1)})}}),t.ui.plugin.add("draggable","cursor",{start:function(){var e=t("body"),i=t(this).data("ui-draggable").options;e.css("cursor")&&(i._cursor=e.css("cursor")),e.css("cursor",i.cursor)},stop:function(){var e=t(this).data("ui-draggable").options;e._cursor&&t("body").css("cursor",e._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._opacity&&t(i.helper).css("opacity",s._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(){var e=t(this).data("ui-draggable");e.scrollParent[0]!==document&&"HTML"!==e.scrollParent[0].tagName&&(e.overflowOffset=e.scrollParent.offset())},drag:function(e){var i=t(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-e.pageY<s.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+s.scrollSpeed:e.pageY-i.overflowOffset.top<s.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-e.pageX<s.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+s.scrollSpeed:e.pageX-i.overflowOffset.left<s.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(e.pageY-t(document).scrollTop()<s.scrollSensitivity?n=t(document).scrollTop(t(document).scrollTop()-s.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<s.scrollSensitivity&&(n=t(document).scrollTop(t(document).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(e.pageX-t(document).scrollLeft()<s.scrollSensitivity?n=t(document).scrollLeft(t(document).scrollLeft()-s.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<s.scrollSensitivity&&(n=t(document).scrollLeft(t(document).scrollLeft()+s.scrollSpeed)))),n!==!1&&t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(i,e)}}),t.ui.plugin.add("draggable","snap",{start:function(){var e=t(this).data("ui-draggable"),i=e.options;e.snapElements=[],t(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=t(this),s=i.offset();this!==e.element[0]&&e.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:s.top,left:s.left})})},drag:function(e,i){var s,n,o,a,r,h,l,c,u,d,p=t(this).data("ui-draggable"),f=p.options,g=f.snapTolerance,m=i.offset.left,v=m+p.helperProportions.width,_=i.offset.top,b=_+p.helperProportions.height;for(u=p.snapElements.length-1;u>=0;u--)r=p.snapElements[u].left,h=r+p.snapElements[u].width,l=p.snapElements[u].top,c=l+p.snapElements[u].height,r-g>v||m>h+g||l-g>b||_>c+g||!t.contains(p.snapElements[u].item.ownerDocument,p.snapElements[u].item)?(p.snapElements[u].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=!1):("inner"!==f.snapMode&&(s=g>=Math.abs(l-b),n=g>=Math.abs(c-_),o=g>=Math.abs(r-v),a=g>=Math.abs(h-m),s&&(i.position.top=p._convertPositionTo("relative",{top:l-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c,left:0}).top-p.margins.top),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h}).left-p.margins.left)),d=s||n||o||a,"outer"!==f.snapMode&&(s=g>=Math.abs(l-_),n=g>=Math.abs(c-b),o=g>=Math.abs(r-m),a=g>=Math.abs(h-v),s&&(i.position.top=p._convertPositionTo("relative",{top:l,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c-p.helperProportions.height,left:0}).top-p.margins.top),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[u].snapping&&(s||n||o||a||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=s||n||o||a||d)}}),t.ui.plugin.add("draggable","stack",{start:function(){var e,i=this.data("ui-draggable").options,s=t.makeArray(t(i.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});s.length&&(e=parseInt(t(s[0]).css("zIndex"),10)||0,t(s).each(function(i){t(this).css("zIndex",e+i)}),this.css("zIndex",e+s.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._zIndex&&t(i.helper).css("zIndex",s._zIndex)}})}(jQuery),function(t){function e(t,e,i){return t>e&&e+i>t}t.widget("ui.droppable",{version:"1.10.3",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e=this.options,i=e.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(i)?i:function(t){return t.is(i)
},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},t.ui.ddmanager.droppables[e.scope]=t.ui.ddmanager.droppables[e.scope]||[],t.ui.ddmanager.droppables[e.scope].push(this),e.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=0,i=t.ui.ddmanager.droppables[this.options.scope];i.length>e;e++)i[e]===this&&i.splice(e,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,i){"accept"===e&&(this.accept=t.isFunction(i)?i:function(t){return t.is(i)}),t.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=t.data(this,"ui-droppable");return e.options.greedy&&!e.options.disabled&&e.options.scope===s.options.scope&&e.accept.call(e.element[0],s.currentItem||s.element)&&t.ui.intersect(s,t.extend(e,{offset:e.element.offset()}),e.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}}}),t.ui.intersect=function(t,i,s){if(!i.offset)return!1;var n,o,a=(t.positionAbs||t.position.absolute).left,r=a+t.helperProportions.width,h=(t.positionAbs||t.position.absolute).top,l=h+t.helperProportions.height,c=i.offset.left,u=c+i.proportions.width,d=i.offset.top,p=d+i.proportions.height;switch(s){case"fit":return a>=c&&u>=r&&h>=d&&p>=l;case"intersect":return a+t.helperProportions.width/2>c&&u>r-t.helperProportions.width/2&&h+t.helperProportions.height/2>d&&p>l-t.helperProportions.height/2;case"pointer":return n=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,o=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,e(o,d,i.proportions.height)&&e(n,c,i.proportions.width);case"touch":return(h>=d&&p>=h||l>=d&&p>=l||d>h&&l>p)&&(a>=c&&u>=a||r>=c&&u>=r||c>a&&r>u);default:return!1}},t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;o.length>s;s++)if(!(o[s].options.disabled||e&&!o[s].accept.call(o[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===o[s].element[0]){o[s].proportions.height=0;continue t}o[s].visible="none"!==o[s].element.css("display"),o[s].visible&&("mousedown"===a&&o[s]._activate.call(o[s],i),o[s].offset=o[s].element.offset(),o[s].proportions={width:o[s].element[0].offsetWidth,height:o[s].element[0].offsetHeight})}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&t.ui.intersect(e,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,o,a=t.ui.intersect(e,this,this.options.tolerance),r=!a&&this.isover?"isout":a&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,o=this.element.parents(":data(ui-droppable)").filter(function(){return t.data(this,"ui-droppable").options.scope===n}),o.length&&(s=t.data(o[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}}}(jQuery),function(t){function e(t){return parseInt(t,10)||0}function i(t){return!isNaN(parseInt(t,10))}t.widget("ui.resizable",t.ui.mouse,{version:"1.10.3",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,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},_create:function(){var e,i,s,n,o,a=this,r=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t("<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.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom: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({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(t(".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.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},i=0;e.length>i;i++)s=t.trim(e[i]),o="ui-resizable-"+s,n=t("<div class='ui-resizable-handle "+o+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=t(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),t(this.handles[i]).length},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.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")}),r.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(t(this).removeClass("ui-resizable-autohide"),a._handles.show())}).mouseleave(function(){r.disabled||a.resizing||(t(this).addClass("ui-resizable-autohide"),a._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(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),i(this.originalElement),this},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,o,a=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=e(this.helper.css("left")),n=e(this.helper.css("top")),a.containment&&(s+=t(a.containment).scrollLeft()||0,n+=t(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,o=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===o?this.axis+"-resize":o),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(e){var i,s=this.helper,n={},o=this.originalMousePosition,a=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,c=this.size.height,u=e.pageX-o.left||0,d=e.pageY-o.top||0,p=this._change[a];return p?(i=p.apply(this,[e,u,d]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==c&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(n)||this._trigger("resize",e,this.ui()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&t.ui.hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,h=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,s,n,o,a,r=this.options;a={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=a.minHeight*this.aspectRatio,n=a.minWidth/this.aspectRatio,s=a.maxHeight*this.aspectRatio,o=a.maxWidth/this.aspectRatio,e>a.minWidth&&(a.minWidth=e),n>a.minHeight&&(a.minHeight=n),a.maxWidth>s&&(a.maxWidth=s),a.maxHeight>o&&(a.maxHeight=o)),this._vBoundaries=a},_updateCache:function(t){this.offset=this.helper.offset(),i(t.left)&&(this.position.left=t.left),i(t.top)&&(this.position.top=t.top),i(t.height)&&(this.size.height=t.height),i(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,s=this.size,n=this.axis;return i(t.height)?t.width=t.height*this.aspectRatio:i(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===n&&(t.left=e.left+(s.width-t.width),t.top=null),"nw"===n&&(t.top=e.top+(s.height-t.height),t.left=e.left+(s.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,s=this.axis,n=i(t.width)&&e.maxWidth&&e.maxWidth<t.width,o=i(t.height)&&e.maxHeight&&e.maxHeight<t.height,a=i(t.width)&&e.minWidth&&e.minWidth>t.width,r=i(t.height)&&e.minHeight&&e.minHeight>t.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,c=/sw|nw|w/.test(s),u=/nw|ne|n/.test(s);return a&&(t.width=e.minWidth),r&&(t.height=e.minHeight),n&&(t.width=e.maxWidth),o&&(t.height=e.maxHeight),a&&c&&(t.left=h-e.minWidth),n&&c&&(t.left=h-e.maxWidth),r&&u&&(t.top=l-e.minHeight),o&&u&&(t.top=l-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},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var t,e,i,s,n,o=this.helper||this.element;for(t=0;this._proportionallyResizeElements.length>t;t++){if(n=this._proportionallyResizeElements[t],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],e=0;i.length>e;e++)this.borderDif[e]=(parseInt(i[e],10)||0)+(parseInt(s[e],10)||0);n.css({height:o.height()-this.borderDif[0]-this.borderDif[2]||0,width:o.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.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,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,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}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&t.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,o,a,r,h,l=t(this).data("ui-resizable"),c=l.options,u=l.element,d=c.containment,p=d instanceof t?d.get(0):/parent/.test(d)?u.parent().get(0):d;p&&(l.containerElement=t(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(i=t(p),s=[],t(["Top","Right","Left","Bottom"]).each(function(t,n){s[t]=e(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,o=l.containerSize.height,a=l.containerSize.width,r=t.ui.hasScroll(p,"left")?p.scrollWidth:a,h=t.ui.hasScroll(p)?p.scrollHeight:o,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(e){var i,s,n,o,a=t(this).data("ui-resizable"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio),a.position.top=a._helper?h.top:0),a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top,i=Math.abs((a._helper?a.offset.left-u.left:a.offset.left-u.left)+a.sizeDiff.width),s=Math.abs((a._helper?a.offset.top-u.top:a.offset.top-h.top)+a.sizeDiff.height),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o&&(i-=a.parentData.left),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio))},stop:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=function(e){t(e).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):t.each(i.alsoResize,function(t){s(t)})},resize:function(e,i){var s=t(this).data("ui-resizable"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0},h=function(e,s){t(e).each(function(){var e=t(this),n=t(this).data("ui-resizable-alsoresize"),o={},a=s&&s.length?s:e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(a,function(t,e){var i=(n[e]||0)+(r[e]||0);i&&i>=0&&(o[e]=i||null)}),e.css(o)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):t.each(n.alsoResize,function(t,e){h(t,e)})},stop:function(){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).data("ui-resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).data("ui-resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e=t(this).data("ui-resizable"),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,u=Math.round((s.height-n.height)/l)*l,d=n.width+c,p=n.height+u,f=i.maxWidth&&d>i.maxWidth,g=i.maxHeight&&p>i.maxHeight,m=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=h),v&&(p+=l),f&&(d-=h),g&&(p-=l),/^(se|s|e)$/.test(a)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.top=o.top-u):/^(sw)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.left=o.left-c):(e.size.width=d,e.size.height=p,e.position.top=o.top-u,e.position.left=o.left-c)}})}(jQuery),function(t){t.widget("ui.selectable",t.ui.mouse,{version:"1.10.3",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 e,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e=t(i.options.filter,i.element[0]),e.addClass("ui-selectee"),e.each(function(){var e=t(this),i=e.offset();t.data(this,"selectable-item",{element:this,$element:e,left:i.left,top:i.top,right:i.left+e.outerWidth(),bottom:i.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=e.addClass("ui-selectee"),this._mouseInit(),this.helper=t("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):undefined}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,o=this.opos[0],a=this.opos[1],r=e.pageX,h=e.pageY;return o>r&&(i=r,r=o,o=i),a>h&&(i=h,h=a,a=i),this.helper.css({left:o,top:a,width:r-o,height:h-a}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||o>i.right||i.top>h||a>i.bottom):"fit"===n.tolerance&&(l=i.left>o&&r>i.right&&i.top>a&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}})}(jQuery),function(t){function e(t,e,i){return t>e&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.3",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},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):undefined}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),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},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.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(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-t(document).scrollTop()<a.scrollSensitivity?r=t(document).scrollTop(t(document).scrollTop()-a.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<a.scrollSensitivity&&(r=t(document).scrollTop(t(document).scrollTop()+a.scrollSpeed)),e.pageX-t(document).scrollLeft()<a.scrollSensitivity?r=t(document).scrollLeft(t(document).scrollLeft()-a.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<a.scrollSensitivity&&(r=t(document).scrollLeft(t(document).scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),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"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;
this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].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(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_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,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,o=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return n?this.floating?a&&"right"===a||"down"===o?2:1:o&&("down"===o?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&s||"left"===o&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var i,s,n,o,a=[],r=[],h=this._connectWith();if(h&&e)for(i=h.length-1;i>=0;i--)for(n=t(h[i]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&r.push([t.isFunction(o.options.items)?o.options.items.call(o.element):t(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(r.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=r.length-1;i>=0;i--)r[i][0].each(function(){a.push(this)});return t(a)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?e.currentItem.children().each(function(){t("<td>&#160;</td>",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,o,a,r,h,l,c,u,d,p,f=null,g=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],g=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[g].containerCache.over||(this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1);else{for(a=1e4,r=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],o=this.items.length-1;o>=0;o--)t.contains(this.containers[g].element[0],this.items[o].item[0])&&this.items[o].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[o].top,this.items[o].height))&&(u=this.items[o].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[o][l]-c)&&(d=!0,u+=this.items[o][l]),a>Math.abs(u-c)&&(a=Math.abs(u-c),r=this.items[o],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[g])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[g].element,!0),this._trigger("change",s,this._uiHash()),this.containers[g]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[g],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[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")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{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 e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.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).removeClass("ui-sortable-helper")}else this.currentItem.show();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(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;i>=0;i--)e||s.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(function(t){return function(e){t._trigger("out",e,this._uiHash(this))}}.call(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,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),i=0;s.length>i;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(i=0;s.length>i;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})}(jQuery),function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[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:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,o){var a,r=o.re.exec(i),h=r&&o.parse(r),l=o.space||"rgba";return h?(a=s[l](h),s[c[l].cache]=a[c[l].cache],n=s._rgba=a._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{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]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={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"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,a,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,h],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),o=c[n],a=0===this.alpha()?l("transparent"):this,r=a[o.cache]||o.to(a._rgba),h=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],l=s[o],c=u[n.type]||{};null!==l&&(null===a?h[o]=l:(c.mod&&(l-a>c.mod/2?a+=c.mod:a-l>c.mod/2&&(a-=c.mod)),h[o]=i((l-a)*e+a,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),h=Math.min(s,n,o),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-o)/l+360:n===r?60*(o-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[a]&&(this[a]=h(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[a]=d,n):l(d)},f(o,function(e,i){l.fn[e]||(l.fn[e]=function(n){var o,a=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=l(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.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"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function s(e,i){var s,n,a={};for(s in i)n=i[s],e[s]!==n&&(o[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(a[s]=n));return a}var n=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,o,a,r){var h=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",l=h.children?a.find("*").addBack():a;l=l.map(function(){var e=t(this);return{el:e,start:i(this)}}),o=function(){t.each(n,function(t,i){e[i]&&a[i+"Class"](e[i])})},o(),l=l.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),a.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,o,a,r){return"boolean"==typeof n||n===e?o?t.effects.animateClass.call(this,n?{add:s}:{remove:s},o,a,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,o,a)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.3",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,o;for(o=0;s.length>o;o++)null!==s[o]&&(n=t.data(i+s[o]),n===e&&(n=""),t.css(s[o],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),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}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(o)&&o.call(n[0]),t.isFunction(e)&&e()}var n=t(this),o=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):a.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,o=i.queue,a=t.effects.effect[i.effect];return t.fx.off||!a?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):o===!1?this.each(e):this.queue(o||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{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;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()}(jQuery),function(t){var e=0,i={},s={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",s.height=s.paddingTop=s.paddingBottom=s.borderTopWidth=s.borderBottomWidth="show",t.widget("ui.accordion",{version:"1.10.3",options:{active:0,animate:{},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},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t(),content:this.active.length?this.active.next():t()}},_createIcons:function(){var e=this.options.icons;e&&(t("<span>").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons"))
},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),undefined):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),"disabled"===t&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!e),undefined)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:o=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[s-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),o.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().focus()},refresh:function(){var e=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,s=this.options,n=s.heightStyle,o=this.element.parent(),a=this.accordionId="ui-accordion-"+(this.element.attr("id")||++e);this.active=this._findActive(s.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(e){var i=t(this),s=i.attr("id"),n=i.next(),o=n.attr("id");s||(s=a+"-header-"+e,i.attr("id",s)),o||(o=a+"-panel-"+e,n.attr("id",o)),i.attr("aria-controls",o),n.attr("aria-labelledby",s)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(s.event),"fill"===n?(i=o.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.headers.each(function(){i-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===n&&(i=0,this.headers.next().each(function(){i=Math.max(i,t(this).css("height","").height())}).height(i))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.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(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n[0]===s[0],a=o&&i.collapsible,r=a?t():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:a?t():n,newPanel:r};e.preventDefault(),o&&!i.collapsible||this._trigger("beforeActivate",e,l)===!1||(i.active=a?!1:this.headers.index(n),this.active=o?t():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),o||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-expanded":"false","aria-hidden":"true"}),s.prev().attr("aria-selected","false"),i.length&&s.length?s.prev().attr("tabIndex",-1):i.length&&this.headers.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(t,e,n){var o,a,r,h=this,l=0,c=t.length&&(!e.length||t.index()<e.index()),u=this.options.animate||{},d=c&&u.down||u,p=function(){h._toggleComplete(n)};return"number"==typeof d&&(r=d),"string"==typeof d&&(a=d),a=a||d.easing||u.easing,r=r||d.duration||u.duration,e.length?t.length?(o=t.show().outerHeight(),e.animate(i,{duration:r,easing:a,step:function(t,e){e.now=Math.round(t)}}),t.hide().animate(s,{duration:r,easing:a,complete:p,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?l+=i.now:"content"!==h.options.heightStyle&&(i.now=Math.round(o-e.outerHeight()-l),l=0)}}),undefined):e.animate(i,r,a,p):t.animate(s,r,a,p)},_toggleComplete:function(t){var e=t.oldPanel;e.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}})}(jQuery),function(t){var e=0;t.widget("ui.autocomplete",{version:"1.10.3",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},pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),o="textarea"===n,a="input"===n;this.isMultiLine=o?!0:a?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,undefined;e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,this._keyEvent("previous",n);break;case o.DOWN:e=!0,this._keyEvent("next",n);break;case o.ENTER:case o.NUMPAD_ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case o.TAB:this.menu.active&&this.menu.select(n);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),undefined;if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,t.preventDefault(),undefined):(this._searchTimeout(t),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(t),this._change(t),undefined)}}),this._initSource(),this.menu=t("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];t(e.target).closest(".ui-menu-item").length||this._delay(function(){var e=this;this.document.one("mousedown",function(s){s.target===e.element[0]||s.target===i||t.contains(i,s.target)||e.close()})})},menufocus:function(e,i){if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)}),undefined;var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",e,{item:s})?e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.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=t("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").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()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e||(e=this.element.closest(".ui-front")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,t))},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):this._trigger("search",e)!==!1?this._search(t):undefined},_search:function(t){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var t=this,i=++e;return function(s){i===e&&t.__response(s),t.pending--,t.pending||t.element.removeClass("ui-autocomplete-loading")}},__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.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(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({label:e.label||e.value,value:e.value||e.label},e)})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<a>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this._value(this.term),this.menu.blur(),undefined):(this.menu[t](e),undefined):(this.search(null,e),undefined)},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())}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.text(e))}})}(jQuery),function(t){var e,i,s,n,o="ui-button ui-widget ui-state-default ui-corner-all",a="ui-state-hover ui-state-active ",r="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",h=function(){var e=t(this);setTimeout(function(){e.find(":ui-button").button("refresh")},1)},l=function(e){var i=e.name,s=e.form,n=t([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?t(s).find("[name='"+i+"']"):t("[name='"+i+"']",e.ownerDocument).filter(function(){return!this.form})),n};t.widget("ui.button",{version:"1.10.3",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,h),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var a=this,r=this.options,c="checkbox"===this.type||"radio"===this.type,u=c?"":"ui-state-active",d="ui-state-focus";null===r.label&&(r.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(o).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){r.disabled||this===e&&t(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){r.disabled||t(this).removeClass(u)}).bind("click"+this.eventNamespace,function(t){r.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){a.buttonElement.addClass(d)}).bind("blur"+this.eventNamespace,function(){a.buttonElement.removeClass(d)}),c&&(this.element.bind("change"+this.eventNamespace,function(){n||a.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(t){r.disabled||(n=!1,i=t.pageX,s=t.pageY)}).bind("mouseup"+this.eventNamespace,function(t){r.disabled||(i!==t.pageX||s!==t.pageY)&&(n=!0)})),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return r.disabled||n?!1:undefined}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(r.disabled||n)return!1;t(this).addClass("ui-state-active"),a.buttonElement.attr("aria-pressed","true");var e=a.element[0];l(e).not(e).map(function(){return t(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return r.disabled?!1:(t(this).addClass("ui-state-active"),e=this,a.document.one("mouseup",function(){e=null}),undefined)}).bind("mouseup"+this.eventNamespace,function(){return r.disabled?!1:(t(this).removeClass("ui-state-active"),undefined)}).bind("keydown"+this.eventNamespace,function(e){return r.disabled?!1:((e.keyCode===t.ui.keyCode.SPACE||e.keyCode===t.ui.keyCode.ENTER)&&t(this).addClass("ui-state-active"),undefined)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){t(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(e){e.keyCode===t.ui.keyCode.SPACE&&t(this).click()})),this._setOption("disabled",r.disabled),this._resetButton()},_determineButtonType:function(){var t,e,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(t=this.element.parents().last(),e="label[for='"+this.element.attr("id")+"']",this.buttonElement=t.find(e),this.buttonElement.length||(t=t.length?t.siblings():this.element.siblings(),this.buttonElement=t.filter(e),this.buttonElement.length||(this.buttonElement=t.find(e))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(o+" "+a+" "+r).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(t,e){return this._super(t,e),"disabled"===t?(e?this.element.prop("disabled",!0):this.element.prop("disabled",!1),undefined):(this._resetButton(),undefined)},refresh:function(){var e=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");e!==this.options.disabled&&this._setOption("disabled",e),"radio"===this.type?l(this.element[0]).each(function(){t(this).is(":checked")?t(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):t(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),undefined;var e=this.buttonElement.removeClass(r),i=t("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(e.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,o=[];s.primary||s.secondary?(this.options.text&&o.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&e.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&e.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(o.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||e.attr("title",t.trim(i)))):o.push("ui-button-text-only"),e.addClass(o.join(" "))}}),t.widget("ui.buttonset",{version:"1.10.3",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(t,e){"disabled"===t&&this.buttons.button("option",t,e),this._super(t,e)},refresh:function(){var e="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(e?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(e?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})}(jQuery),function(t,e){function i(){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},t.extend(this._defaults,this.regional[""]),this.dpDiv=s(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function s(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(i,"mouseout",function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){t.datepicker._isDisabledDatepicker(o.inline?e.parent()[0]:o.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))})}function n(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}t.extend(t.ui,{datepicker:{version:"1.10.3"}});var o,a="datepicker";t.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return n(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,o;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),o=this._newInst(t(e),n),o.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,o):n&&this._inlineDatepicker(e,o)},_newInst:function(e,i){var n=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:n,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?s(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),t.data(e,a,i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,o,a=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=t("<span class='"+this._appendClass+"'>"+a+"</span>"),e[r?"before":"after"](i.append)),e.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:o,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(o?t("<img/>").attr({src:o,alt:n,title:n}):n)),e[r?"before":"after"](i.trigger),i.trigger.click(function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,o=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(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(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,a,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,o,r){var h,l,c,u,d,p=this._dialogInst;return p||(this.uuid+=1,h="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+h+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),t("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},t.data(this._dialogInput[0],a,p)),n(p.settings,o||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=r?r.length?r:[r.pageX,r.pageY]:null,this._pos||(l=document.documentElement.clientWidth,c=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[l/2-100+u,c/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],a,p),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,a);s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,a),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty())},_enableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,a);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,a);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,a)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,s,o){var a,r,h,l,c=this._getInst(i);return 2===arguments.length&&"string"==typeof s?"defaults"===s?t.extend({},t.datepicker._defaults):c?"all"===s?t.extend({},c.settings):this._get(c,s):null:(a=s||{},"string"==typeof s&&(a={},a[s]=o),c&&(this._curInst===c&&this._hideDatepicker(),r=this._getDateDatepicker(i,!0),h=this._getMinMaxDate(c,"min"),l=this._getMinMaxDate(c,"max"),n(c.settings,a),null!==h&&a.dateFormat!==e&&a.minDate===e&&(c.settings.minDate=this._formatDate(c,h)),null!==l&&a.dateFormat!==e&&a.maxDate===e&&(c.settings.maxDate=this._formatDate(c,l)),"disabled"in a&&(a.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(t(i),c),this._autoSize(c),this._setDate(c,r),this._updateAlternate(c),this._updateDatepicker(c)),e)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,o=t.datepicker._getInst(e.target),a=!0,r=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",o.dpDiv),n[0]&&t.datepicker._selectDay(e.target,o.selectedMonth,o.selectedYear,n[0]),i=t.datepicker._get(o,"onSelect"),i?(s=t.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[s,o])):t.datepicker._hideDatepicker(),!1;
case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(i){var s,n,o=t.datepicker._getInst(i.target);return t.datepicker._get(o,"constrainInput")?(s=t.datepicker._possibleChars(t.datepicker._get(o,"dateFormat")),n=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">n||!s||s.indexOf(n)>-1):e},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var i,s,o,a,r,h,l;i=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==i&&(t.datepicker._curInst.dpDiv.stop(!0,!0),i&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),s=t.datepicker._get(i,"beforeShow"),o=s?s.apply(e,[e,i]):{},o!==!1&&(n(i.settings,o),i.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(i),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),a=!1,t(e).parents().each(function(){return a|="fixed"===t(this).css("position"),!a}),r={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(i),r=t.datepicker._checkOffset(i,r,a),i.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":a?"fixed":"absolute",display:"none",left:r.left+"px",top:r.top+"px"}),i.inline||(h=t.datepicker._get(i,"showAnim"),l=t.datepicker._get(i,"duration"),i.dpDiv.zIndex(t(e).zIndex()+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[h]?i.dpDiv.show(h,t.datepicker._get(i,"showOptions"),l):i.dpDiv[h||"show"](h?l:null),t.datepicker._shouldFocusInput(i)&&i.input.focus(),t.datepicker._curInst=i))}},_updateDatepicker:function(e){this.maxRows=4,o=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,s=this._getNumberOfMonths(e),n=s[1],a=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.focus(),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),o=e.dpDiv.outerHeight(),a=e.input?e.input.outerWidth():0,r=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-a:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+r?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+o>l&&l>o?Math.abs(o+r):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,o,r=this._curInst;!r||e&&r!==t.data(e,a)||this._datepickerShowing&&(i=this._get(r,"showAnim"),s=this._get(r,"duration"),n=function(){t.datepicker._tidyDialog(r)},t.effects&&(t.effects.effect[i]||t.effects[i])?r.dpDiv.hide(i,t.datepicker._get(r,"showOptions"),s,n):r.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,o=this._get(r,"onClose"),o&&o.apply(r.input?r.input[0]:null,[r.input?r.input.val():"",r]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),o=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(o,i+("M"===s?this._get(o,"showCurrentAtPos"):0),s),this._updateDatepicker(o))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),o=this._getInst(n[0]);o["selected"+("M"===s?"Month":"Year")]=o["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(n)},_selectDay:function(e,i,s,n){var o,a=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||(o=this._getInst(a[0]),o.selectedDay=o.currentDay=t("a",n).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=s,this._selectDate(e,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),o=this._getInst(n[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),s=this._get(o,"onSelect"),s?s.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger("change"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],"object"!=typeof o.input[0]&&o.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,o=this._get(e,"altField");o&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(o).each(function(){t(this).val(n)}))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(i,s,n){if(null==i||null==s)throw"Invalid arguments";if(s="object"==typeof s?""+s:s+"",""===s)return null;var o,a,r,h,l=0,c=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof c?c:(new Date).getFullYear()%100+parseInt(c,10),d=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,p=(n?n.dayNames:null)||this._defaults.dayNames,f=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,g=(n?n.monthNames:null)||this._defaults.monthNames,m=-1,v=-1,_=-1,b=-1,y=!1,w=function(t){var e=i.length>o+1&&i.charAt(o+1)===t;return e&&o++,e},k=function(t){var e=w(t),i="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n=RegExp("^\\d{1,"+i+"}"),o=s.substring(l).match(n);if(!o)throw"Missing number at position "+l;return l+=o[0].length,parseInt(o[0],10)},x=function(i,n,o){var a=-1,r=t.map(w(i)?o:n,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(r,function(t,i){var n=i[1];return s.substr(l,n.length).toLowerCase()===n.toLowerCase()?(a=i[0],l+=n.length,!1):e}),-1!==a)return a+1;throw"Unknown name at position "+l},D=function(){if(s.charAt(l)!==i.charAt(o))throw"Unexpected literal at position "+l;l++};for(o=0;i.length>o;o++)if(y)"'"!==i.charAt(o)||w("'")?D():y=!1;else switch(i.charAt(o)){case"d":_=k("d");break;case"D":x("D",d,p);break;case"o":b=k("o");break;case"m":v=k("m");break;case"M":v=x("M",f,g);break;case"y":m=k("y");break;case"@":h=new Date(k("@")),m=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"!":h=new Date((k("!")-this._ticksTo1970)/1e4),m=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"'":w("'")?D():y=!0;break;default:D()}if(s.length>l&&(r=s.substr(l),!/^\s+/.test(r)))throw"Extra/unparsed characters found in date: "+r;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),b>-1)for(v=1,_=b;;){if(a=this._getDaysInMonth(m,v-1),a>=_)break;v++,_-=a}if(h=this._daylightSavingAdjust(new Date(m,v-1,_)),h.getFullYear()!==m||h.getMonth()+1!==v||h.getDate()!==_)throw"Invalid date";return h},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:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,o=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},l=function(t,e,i){var s=""+e;if(h(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return h(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||h("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=l("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,o);break;case"o":u+=l("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=l("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),a,r);break;case"y":u+=h("y")?e.getFullYear():(10>e.getYear()%100?"0":"")+e.getYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":h("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,i){return t.settings[i]!==e?t.settings[i]:this._defaults[i]},_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(r){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(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},o=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,o=n.getFullYear(),a=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":a+=parseInt(l[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a));break;case"y":case"Y":o+=parseInt(l[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a))}l=h.exec(i)}return new Date(o,a,r)},a=null==i||""===i?s:"string"==typeof i?o(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return a=a&&"Invalid Date"==""+a?s:a,a&&(a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)),this._daylightSavingAdjust(a)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,a=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=a.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=a.getMonth(),t.drawYear=t.selectedYear=t.currentYear=a.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){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(s,-i,"M")},next:function(){t.datepicker._adjustDate(s,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(s)},selectDay:function(){return t.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,h,l,c,u,d,p,f,g,m,v,_,b,y,w,k,x,D,C,I,P,T,M,S,z,A,H,E,N,W,O,F,R,L=new Date,j=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),Y=this._get(t,"isRTL"),B=this._get(t,"showButtonPanel"),V=this._get(t,"hideIfNoPrevNext"),K=this._get(t,"navigationAsDateFormat"),U=this._getNumberOfMonths(t),q=this._get(t,"showCurrentAtPos"),Q=this._get(t,"stepMonths"),X=1!==U[0]||1!==U[1],$=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),G=this._getMinMaxDate(t,"min"),J=this._getMinMaxDate(t,"max"),Z=t.drawMonth-q,te=t.drawYear;if(0>Z&&(Z+=12,te--),J)for(e=this._daylightSavingAdjust(new Date(J.getFullYear(),J.getMonth()-U[0]*U[1]+1,J.getDate())),e=G&&G>e?G:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-Q,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":V?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+Q,1)),this._getFormatConfig(t)):n,o=this._canAdjustMonth(t,1,te,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":V?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",a=this._get(t,"currentText"),r=this._get(t,"gotoCurrent")&&t.currentDay?$:j,a=K?this.formatDate(a,r,this._getFormatConfig(t)):a,h=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>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(t,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(Y?"":h)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),g=this._get(t,"monthNamesShort"),m=this._get(t,"beforeShowDay"),v=this._get(t,"showOtherMonths"),_=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;U[0]>k;k++){for(x="",this.maxRows=4,D=0;U[1]>D;D++){if(C=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),I=" ui-corner-all",P="",X){if(P+="<div class='ui-datepicker-group",U[1]>1)switch(D){case 0:P+=" ui-datepicker-group-first",I=" ui-corner-"+(Y?"right":"left");break;case U[1]-1:P+=" ui-datepicker-group-last",I=" ui-corner-"+(Y?"left":"right");break;default:P+=" ui-datepicker-group-middle",I=""}P+="'>"}for(P+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+I+"'>"+(/all|left/.test(I)&&0===k?Y?o:s:"")+(/all|right/.test(I)&&0===k?Y?s:o:"")+this._generateMonthYearHeader(t,Z,te,G,J,k>0||D>0,f,g)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",T=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;7>w;w++)M=(w+c)%7,T+="<th"+((w+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[M]+"'>"+p[M]+"</span></th>";for(P+=T+"</tr></thead><tbody>",S=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,S)),z=(this._getFirstDayOfMonth(te,Z)-c+7)%7,A=Math.ceil((z+S)/7),H=X?this.maxRows>A?this.maxRows:A:A,this.maxRows=H,E=this._daylightSavingAdjust(new Date(te,Z,1-z)),N=0;H>N;N++){for(P+="<tr>",W=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(E)+"</td>":"",w=0;7>w;w++)O=m?m.apply(t.input?t.input[0]:null,[E]):[!0,""],F=E.getMonth()!==Z,R=F&&!_||!O[0]||G&&G>E||J&&E>J,W+="<td class='"+((w+c+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(E.getTime()===C.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===E.getTime()&&b.getTime()===C.getTime()?" "+this._dayOverClass:"")+(R?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!v?"":" "+O[1]+(E.getTime()===$.getTime()?" "+this._currentClass:"")+(E.getTime()===j.getTime()?" ui-datepicker-today":""))+"'"+(F&&!v||!O[2]?"":" title='"+O[2].replace(/'/g,"&#39;")+"'")+(R?"":" data-handler='selectDay' data-event='click' data-month='"+E.getMonth()+"' data-year='"+E.getFullYear()+"'")+">"+(F&&!v?"&#xa0;":R?"<span class='ui-state-default'>"+E.getDate()+"</span>":"<a class='ui-state-default"+(E.getTime()===j.getTime()?" ui-state-highlight":"")+(E.getTime()===$.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+E.getDate()+"</a>")+"</td>",E.setDate(E.getDate()+1),E=this._daylightSavingAdjust(E);P+=W+"</tr>"}Z++,Z>11&&(Z=0,te++),P+="</tbody></table>"+(X?"</div>"+(U[0]>0&&D===U[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),x+=P}y+=x}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var h,l,c,u,d,p,f,g,m=this._get(t,"changeMonth"),v=this._get(t,"changeYear"),_=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(o||!m)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!h||c>=s.getMonth())&&(!l||n.getMonth()>=c)&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(_||(b+=y+(!o&&m&&v?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",o||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e},f=p(u[0]),g=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,g=n?Math.min(g,n.getFullYear()):g,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";g>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),_&&(b+=(!o&&m&&v?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.drawYear+("Y"===i?e:0),n=t.drawMonth+("M"===i?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,o)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_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){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_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),o=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),o=this._getMinMaxDate(t,"max"),a=null,r=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),a=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(a+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||e.getTime()>=n.getTime())&&(!o||e.getTime()<=o.getTime())&&(!a||e.getFullYear()>=a)&&(!r||r>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,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);var n=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"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).mousedown(t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new i,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.10.3"}(jQuery),function(t){var e={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};t.widget("ui.dialog",{version:"1.10.3",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",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(e){var i=t(this).css(e).offset().top;0>i&&t(this).css("top",e.top-i)}},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},_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"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&this._trigger("beforeClose",e)!==!1&&(this._isOpen=!1,this._destroyOverlay(),this.opener.filter(":focusable").focus().length||t(this.document[0].activeElement).blur(),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!e&&this._trigger("focus",t),i},open:function(){var e=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),undefined):(this._isOpen=!0,this.opener=t(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._trigger("open"),undefined)},_focusTabbable:function(){var t=this.element.find("[autofocus]");t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).focus()},_keepFocus:function(e){function i(){var e=this.document[0].activeElement,i=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);i||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),this.close(e),undefined;if(e.keyCode===t.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(n.focus(1),e.preventDefault()):(s.focus(1),e.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 e;this.uiDialogTitlebar=t("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=t("<button></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(e),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title||t.html("&#160;"),t.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),undefined):(t.each(i,function(i,s){var n,o;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(e.element[0],arguments)},o={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,t("<button></button>",s).button(o).appendTo(e.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),undefined)},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){t(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,o){s.position=[o.position.left-i.document.scrollLeft(),o.position.top-i.document.scrollTop()],t(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,e(o))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}
}var i=this,s=this.options,n=s.resizable,o=this.uiDialog.css("position"),a="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:a,start:function(s,n){t(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function(n,o){s.height=t(this).height(),s.width=t(this).width(),t(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,e(o))}}).css("position",o)},_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(s){var n=this,o=!1,a={};t.each(s,function(t,s){n._setOption(t,s),t in e&&(o=!0),t in i&&(a[t]=s)}),o&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",a)},_setOption:function(t,e){var i,s,n=this.uiDialog;"dialogClass"===t&&n.removeClass(this.options.dialogClass).addClass(e),"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:""+e}),"draggable"===t&&(i=n.is(":data(ui-draggable)"),i&&!e&&n.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&(s=n.is(":data(ui-resizable)"),s&&!e&&n.resizable("destroy"),s&&"string"==typeof e&&n.resizable("option","handles",e),s||e===!1||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 e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return t(e.target).closest(".ui-dialog").length?!0:!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=this,i=this.widgetFullName;t.ui.dialog.overlayInstances||this._delay(function(){t.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(s){e._allowInteraction(s)||(s.preventDefault(),t(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=t("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),t.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(t.ui.dialog.overlayInstances--,t.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),t.ui.dialog.overlayInstances=0,t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{_position:function(){var e,i=this.options.position,s=[],n=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(s=i.split?i.split(" "):[i[0],i[1]],1===s.length&&(s[1]=s[0]),t.each(["left","top"],function(t,e){+s[t]===s[t]&&(n[t]=s[t],s[t]=e)}),i={my:s[0]+(0>n[0]?n[0]:"+"+n[0])+" "+s[1]+(0>n[1]?n[1]:"+"+n[1]),at:s.join(" ")}),i=t.extend({},t.ui.dialog.prototype.options.position,i)):i=t.ui.dialog.prototype.options.position,e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.position(i),e||this.uiDialog.hide()}})}(jQuery),function(t){var e=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(s,n){var o,a,r,h=t(this),l=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(h,s.mode||"hide"),u=s.direction||"up",d=e.test(u),p=d?"height":"width",f=d?"top":"left",g=i.test(u),m={},v="show"===c;h.parent().is(".ui-effects-wrapper")?t.effects.save(h.parent(),l):t.effects.save(h,l),h.show(),o=t.effects.createWrapper(h).css({overflow:"hidden"}),a=o[p](),r=parseFloat(o.css(f))||0,m[p]=v?a:0,g||(h.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),m[f]=v?r:a+r),v&&(o.css(p,0),g||o.css(f,r+a)),o.animate(m,{duration:s.duration,easing:s.easing,queue:!1,complete:function(){"hide"===c&&h.hide(),t.effects.restore(h,l),t.effects.removeWrapper(h),n()}})}}(jQuery),function(t){t.effects.effect.bounce=function(e,i){var s,n,o,a=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(a,e.mode||"effect"),l="hide"===h,c="show"===h,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||l?1:0),g=e.duration/f,m=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=a.queue(),y=b.length;for((c||l)&&r.push("opacity"),t.effects.save(a,r),a.show(),t.effects.createWrapper(a),d||(d=a["top"===v?"outerHeight":"outerWidth"]()/3),c&&(o={opacity:1},o[v]=0,a.css("opacity",0).css(v,_?2*-d:2*d).animate(o,g,m)),l&&(d/=Math.pow(2,p-1)),o={},o[v]=0,s=0;p>s;s++)n={},n[v]=(_?"-=":"+=")+d,a.animate(n,g,m).animate(o,g,m),d=l?2*d:d/2;l&&(n={opacity:0},n[v]=(_?"-=":"+=")+d,a.animate(n,g,m)),a.queue(function(){l&&a.hide(),t.effects.restore(a,r),t.effects.removeWrapper(a),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),a.dequeue()}}(jQuery),function(t){t.effects.effect.clip=function(e,i){var s,n,o,a=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(a,e.mode||"hide"),l="show"===h,c=e.direction||"vertical",u="vertical"===c,d=u?"height":"width",p=u?"top":"left",f={};t.effects.save(a,r),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n="IMG"===a[0].tagName?s:a,o=n[d](),l&&(n.css(d,0),n.css(p,o/2)),f[d]=l?o:0,f[p]=l?0:o/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){l||a.hide(),t.effects.restore(a,r),t.effects.removeWrapper(a),i()}})}}(jQuery),function(t){t.effects.effect.drop=function(e,i){var s,n=t(this),o=["position","top","bottom","left","right","opacity","height","width"],a=t.effects.setMode(n,e.mode||"hide"),r="show"===a,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,o),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===c?-s:s),u[l]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&n.hide(),t.effects.restore(n,o),t.effects.removeWrapper(n),i()}})}}(jQuery),function(t){t.effects.effect.explode=function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),g||p.hide(),i()}var o,a,r,h,l,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=t.effects.setMode(p,e.mode||"hide"),g="show"===f,m=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),_=Math.ceil(p.outerHeight()/u),b=[];for(o=0;u>o;o++)for(h=m.top+o*_,c=o-(u-1)/2,a=0;d>a;a++)r=m.left+a*v,l=a-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-a*v,top:-o*_}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:_,left:r+(g?l*v:0),top:h+(g?c*_:0),opacity:g?0:1}).animate({left:r+(g?0:l*v),top:h+(g?0:c*_),opacity:g?1:0},e.duration||500,e.easing,s)}}(jQuery),function(t){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}}(jQuery),function(t){t.effects.effect.fold=function(e,i){var s,n,o=t(this),a=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(o,e.mode||"hide"),h="show"===r,l="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=h!==d,f=p?["width","height"]:["height","width"],g=e.duration/2,m={},v={};t.effects.save(o,a),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[l?0:1]),h&&s.css(d?{height:0,width:c}:{height:c,width:0}),m[f[0]]=h?n[0]:c,v[f[1]]=h?n[1]:0,s.animate(m,g,e.easing).animate(v,g,e.easing,function(){l&&o.hide(),t.effects.restore(o,a),t.effects.removeWrapper(o),i()})}}(jQuery),function(t){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],o=t.effects.setMode(s,e.mode||"show"),a={backgroundColor:s.css("backgroundColor")};"hide"===o&&(a.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(a,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&s.hide(),t.effects.restore(s,n),i()}})}}(jQuery),function(t){t.effects.effect.pulsate=function(e,i){var s,n=t(this),o=t.effects.setMode(n,e.mode||"show"),a="show"===o,r="hide"===o,h=a||"hide"===o,l=2*(e.times||5)+(h?1:0),c=e.duration/l,u=0,d=n.queue(),p=d.length;for((a||!n.is(":visible"))&&(n.css("opacity",0).show(),u=1),s=1;l>s;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,l+1))),n.dequeue()}}(jQuery),function(t){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),o="hide"===n,a=parseInt(e.percent,10)||150,r=a/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:o?a:100,from:o?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),o=t.effects.setMode(s,e.mode||"effect"),a=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===o?0:100),r=e.direction||"both",h=e.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c={y:"horizontal"!==r?a/100:1,x:"vertical"!==r?a/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==o&&(n.origin=h||["middle","center"],n.restore=!0),n.from=e.from||("show"===o?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*c.y,width:l.width*c.x,outerHeight:l.outerHeight*c.y,outerWidth:l.outerWidth*c.x},n.fade&&("show"===o&&(n.from.opacity=0,n.to.opacity=1),"hide"===o&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,o,a=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],c=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(a,e.mode||"effect"),f=e.restore||"effect"!==p,g=e.scale||"both",m=e.origin||["middle","center"],v=a.css("position"),_=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&a.show(),s={height:a.height(),width:a.width(),outerHeight:a.outerHeight(),outerWidth:a.outerWidth()},"toggle"===e.mode&&"show"===p?(a.from=e.to||b,a.to=e.from||s):(a.from=e.from||("show"===p?b:s),a.to=e.to||("hide"===p?b:s)),o={from:{y:a.from.height/s.height,x:a.from.width/s.width},to:{y:a.to.height/s.height,x:a.to.width/s.width}},("box"===g||"both"===g)&&(o.from.y!==o.to.y&&(_=_.concat(u),a.from=t.effects.setTransition(a,u,o.from.y,a.from),a.to=t.effects.setTransition(a,u,o.to.y,a.to)),o.from.x!==o.to.x&&(_=_.concat(d),a.from=t.effects.setTransition(a,d,o.from.x,a.from),a.to=t.effects.setTransition(a,d,o.to.x,a.to))),("content"===g||"both"===g)&&o.from.y!==o.to.y&&(_=_.concat(c).concat(l),a.from=t.effects.setTransition(a,c,o.from.y,a.from),a.to=t.effects.setTransition(a,c,o.to.y,a.to)),t.effects.save(a,_),a.show(),t.effects.createWrapper(a),a.css("overflow","hidden").css(a.from),m&&(n=t.effects.getBaseline(m,s),a.from.top=(s.outerHeight-a.outerHeight())*n.y,a.from.left=(s.outerWidth-a.outerWidth())*n.x,a.to.top=(s.outerHeight-a.to.outerHeight)*n.y,a.to.left=(s.outerWidth-a.to.outerWidth)*n.x),a.css(a.from),("content"===g||"both"===g)&&(u=u.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),l=r.concat(u).concat(d),a.find("*[width]").each(function(){var i=t(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&t.effects.save(i,l),i.from={height:s.height*o.from.y,width:s.width*o.from.x,outerHeight:s.outerHeight*o.from.y,outerWidth:s.outerWidth*o.from.x},i.to={height:s.height*o.to.y,width:s.width*o.to.x,outerHeight:s.height*o.to.y,outerWidth:s.width*o.to.x},o.from.y!==o.to.y&&(i.from=t.effects.setTransition(i,u,o.from.y,i.from),i.to=t.effects.setTransition(i,u,o.to.y,i.to)),o.from.x!==o.to.x&&(i.from=t.effects.setTransition(i,d,o.from.x,i.from),i.to=t.effects.setTransition(i,d,o.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){f&&t.effects.restore(i,l)})})),a.animate(a.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===a.to.opacity&&a.css("opacity",a.from.opacity),"hide"===p&&a.hide(),t.effects.restore(a,_),f||("static"===v?a.css({position:"relative",top:a.to.top,left:a.to.left}):t.each(["top","left"],function(t,e){a.css(e,function(e,i){var s=parseInt(i,10),n=t?a.to.left:a.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(a),i()}})}}(jQuery),function(t){t.effects.effect.shake=function(e,i){var s,n=t(this),o=["position","top","bottom","left","right","height","width"],a=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",h=e.distance||20,l=e.times||3,c=2*l+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},g={},m={},v=n.queue(),_=v.length;for(t.effects.save(n,o),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+h,g[d]=(p?"+=":"-=")+2*h,m[d]=(p?"-=":"+=")+2*h,n.animate(f,u,e.easing),s=1;l>s;s++)n.animate(g,u,e.easing).animate(m,u,e.easing);n.animate(g,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===a&&n.hide(),t.effects.restore(n,o),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}}(jQuery),function(t){t.effects.effect.slide=function(e,i){var s,n=t(this),o=["position","top","bottom","left","right","width","height"],a=t.effects.setMode(n,e.mode||"show"),r="show"===a,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u={};t.effects.save(n,o),n.show(),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,c?isNaN(s)?"-"+s:-s:s),u[l]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&n.hide(),t.effects.restore(n,o),t.effects.removeWrapper(n),i()}})}}(jQuery),function(t){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),o="fixed"===n.css("position"),a=t("body"),r=o?a.scrollTop():0,h=o?a.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}}(jQuery),function(t){t.widget("ui.menu",{version:"1.10.3",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},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().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.mouseHandled=!0,this.select(e),i.has(".ui-menu").length?this.expand(e):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,o,a,r,h=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:h=!1,n=this.previousFilter||"",o=String.fromCharCode(e.keyCode),a=!1,clearTimeout(this.filterTimer),o===n?a=!0:o=n+o,r=RegExp("^"+i(o),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=a&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(o=String.fromCharCode(e.keyCode),r=RegExp("^"+i(o),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=o,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,o,a,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(o+n):n+r>a&&this.activeMenu.scrollTop(o+n-a+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_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(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},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 ").children(".ui-menu-item").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;this.active&&(s="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.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})}(jQuery),function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var o,a=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(o!==e)return o;var i,s,n=t("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=n.children()[0];return t("body").append(n),i=a.offsetWidth,n.css("overflow","scroll"),s=a.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),o=i-s},getScrollInfo:function(e){var i=e.isWindow?"":e.element.css("overflow-x"),s=e.isWindow?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,o="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:o?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]);return{element:i,isWindow:s,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var o,p,g,m,v,_,b=t(e.of),y=t.position.getWithinInfo(e.within),w=t.position.getScrollInfo(y),k=(e.collision||"flip").split(" "),x={};return _=n(b),b[0].preventDefault&&(e.at="left top"),p=_.width,g=_.height,m=_.offset,v=t.extend({},m),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=l.test(s[0])?s.concat(["center"]):c.test(s[0])?["center"].concat(s):["center","center"]),s[0]=l.test(s[0])?s[0]:"center",s[1]=c.test(s[1])?s[1]:"center",t=u.exec(s[0]),i=u.exec(s[1]),x[this]=[t?t[0]:0,i?i[0]:0],e[this]=[d.exec(s[0])[0],d.exec(s[1])[0]]}),1===k.length&&(k[1]=k[0]),"right"===e.at[0]?v.left+=p:"center"===e.at[0]&&(v.left+=p/2),"bottom"===e.at[1]?v.top+=g:"center"===e.at[1]&&(v.top+=g/2),o=i(x.at,p,g),v.left+=o[0],v.top+=o[1],this.each(function(){var n,l,c=t(this),u=c.outerWidth(),d=c.outerHeight(),f=s(this,"marginLeft"),_=s(this,"marginTop"),D=u+f+s(this,"marginRight")+w.width,C=d+_+s(this,"marginBottom")+w.height,I=t.extend({},v),P=i(x.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?I.left-=u:"center"===e.my[0]&&(I.left-=u/2),"bottom"===e.my[1]?I.top-=d:"center"===e.my[1]&&(I.top-=d/2),I.left+=P[0],I.top+=P[1],t.support.offsetFractions||(I.left=h(I.left),I.top=h(I.top)),n={marginLeft:f,marginTop:_},t.each(["left","top"],function(i,s){t.ui.position[k[i]]&&t.ui.position[k[i]][s](I,{targetWidth:p,targetHeight:g,elemWidth:u,elemHeight:d,collisionPosition:n,collisionWidth:D,collisionHeight:C,offset:[o[0]+P[0],o[1]+P[1]],my:e.my,at:e.at,within:y,elem:c})}),e.using&&(l=function(t){var i=m.left-I.left,s=i+p-u,n=m.top-I.top,o=n+g-d,h={target:{element:b,left:m.left,top:m.top,width:p,height:g},element:{element:c,left:I.left,top:I.top,width:u,height:d},horizontal:0>s?"left":i>0?"right":"center",vertical:0>o?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(h.horizontal="center"),d>g&&g>r(n+o)&&(h.vertical="middle"),h.important=a(r(i),r(s))>a(r(n),r(o))?"horizontal":"vertical",e.using.call(this,t,h)}),c.offset(t.extend(I,{using:l}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,o=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-o-n;e.collisionWidth>o?h>0&&0>=l?(i=t.left+h+e.collisionWidth-o-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+o-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=a(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,o=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-o-n;e.collisionHeight>o?h>0&&0>=l?(i=t.top+h+e.collisionHeight-o-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+o-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=a(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,a=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-a-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-a-o,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,a=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-a-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-a-o,t.top+p+f+g>c&&(0>s||r(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-h,t.top+p+f+g>u&&(i>0||u>r(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,o,a=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(a?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},a&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)e.style[o]=s[o];e.appendChild(r),i=a||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()}(jQuery),function(t,e){t.widget("ui.progressbar",{version:"1.10.3",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()
},value:function(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1: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)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})}(jQuery),function(t){var e=5;t.widget("ui.slider",t.ui.mouse,{version:"1.10.3",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",a=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)a.push(o);this.handles=n.add(t(a.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):this.range=t([])},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,o,a,r,h,l,c=this,u=this.options;return u.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-c.values(e));(n>i||n===i&&(e===c._lastChangedValue||c.values(e)===u.min))&&(n=i,o=t(this),a=e)}),r=this._start(e,a),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=a,o.addClass("ui-state-active").focus(),h=o.offset(),l=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-h.left-o.width()/2,top:e.pageY-h.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,a,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("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,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,o;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),o=this._valueMin()+s*n,this._trimAlignValue(o)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,o;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,o=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),o!==!1&&this.values(e,i,!0))):i!==this.value()&&(o=this._trigger("slide",t,{handle:this.handles[e],value:i}),o!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(e,i){var s,n,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),undefined;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],o=0;s.length>o;o+=1)s[o]=this._trimAlignValue(n[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,o,a=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,c={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),c["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](c,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),o=this._valueMax(),i=o!==n?100*((s-n)/(o-n)):0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](c,r.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===a&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===a&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var s,n,o,a,r=t(i.target).data("ui-slider-handle-index");switch(i.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(i.target).addClass("ui-state-active"),s=this._start(i,r),s===!1))return}switch(a=this.options.step,n=o=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case t.ui.keyCode.HOME:o=this._valueMin();break;case t.ui.keyCode.END:o=this._valueMax();break;case t.ui.keyCode.PAGE_UP:o=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.PAGE_DOWN:o=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;o=this._trimAlignValue(n+a);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;o=this._trimAlignValue(n-a)}this._slide(i,r,o)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})}(jQuery),function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.10.3",defaultElement:"<input>",widgetEventPrefix:"spin",options:{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.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?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(e){function i(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_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&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.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){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,this.element.val(this._format(i)),void 0}("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(e.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(e.down)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==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())})},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("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){return arguments.length?(e(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})}(jQuery),function(t,e){function i(){return++n}function s(t){return t.hash.length>1&&decodeURIComponent(t.href.replace(o,""))===decodeURIComponent(location.href.replace(o,""))}var n=0,o=/#.*$/;t.widget("ui.tabs",{version:"1.10.3",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,o){return t(o).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),o=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:o=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,o),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var o,a,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),c=l.attr("aria-controls");s(n)?(o=n.hash,a=e.element.find(e._sanitizeSelector(o))):(r=e._tabId(l),o="#"+r,a=e.element.find(o),a.length||(a=e._createPanel(r),a.insertAfter(e.panels[i-1]||e.tablist)),a.attr("aria-live","polite")),a.length&&(e.panels=e.panels.add(a)),c&&l.data("ui-tabs-aria-controls",c),l.attr({"aria-controls":o.substring(1),"aria-labelledby":h}),a.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),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(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n.closest("li"),a=o[0]===s[0],r=a&&i.collapsible,h=r?t():this._getPanelForTab(o),l=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:l,newTab:r?t():o,newPanel:h};e.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(o),this.active=a?t():o,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(o),e),this._toggle(e,c))},_toggle:function(e,i){function s(){o.running=!1,o._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),a.length&&o.options.show?o._show(a,o.options.show,s):(a.show(),s())}var o=this,a=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),a.length&&r.length?i.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,o=this.tabs.eq(e),a=o.find(".ui-tabs-anchor"),r=this._getPanelForTab(o),h={tab:o,panel:r};s(a[0])||(this.xhr=t.ajax(this._ajaxSettings(a,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(o.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),o.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,o){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:o},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})}(jQuery),function(t){function e(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))}function i(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")}var s=0;t.widget("ui.tooltip",{version:"1.10.3",options:{content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,i){var s=this;return"disabled"===e?(this[i?"_disable":"_enable"](),this.options[e]=i,void 0):(this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)}),void 0)},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s?this._open(e,t,s):(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=o),this._open(e,t,i)})}),i&&this._open(e,t,i),void 0)},_open:function(i,s,n){function o(t){l.of=t,a.is(":hidden")||a.position(l)}var a,r,h,l=t.extend({},this.options.position);
if(n){if(a=this._find(s),a.length)return a.find(".ui-tooltip-content").html(n),void 0;s.is("[title]")&&(i&&"mouseover"===i.type?s.attr("title",""):s.removeAttr("title")),a=this._tooltip(s),e(s,a.attr("id")),a.find(".ui-tooltip-content").html(n),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:o}),o(i)):a.position(t.extend({of:s},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){a.is(":visible")&&(o(l.of),clearInterval(h))},t.fx.interval)),this._trigger("open",i,{tooltip:a}),r={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var i=t.Event(e);i.currentTarget=s[0],this.close(i,!0)}},remove:function(){this._removeTooltip(a)}},i&&"mouseover"!==i.type||(r.mouseleave="close"),i&&"focusin"!==i.type||(r.focusout="close"),this._on(!0,s,r)}},close:function(e){var s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);this.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&n.attr("title",n.data("ui-tooltip-title")),i(n),o.stop(!0),this._hide(o,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:o}),this.closing=!1)},_tooltip:function(e){var i="ui-tooltip-"+s++,n=t("<div>").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("<div>").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[i]=e,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})}(jQuery);;
!function (t, e, n) {
    "use strict"; function r(t) { return function () { var e, n, r = arguments[0], i = "[" + (t ? t + ":" : "") + r + "] ", o = arguments[1], s = arguments, a = function (t) { return "function" == typeof t ? t.toString().replace(/ \{[\s\S]*$/, "") : "undefined" == typeof t ? "undefined" : "string" != typeof t ? JSON.stringify(t) : t }; for (e = i + o.replace(/\{\d+\}/g, function (t) { var e, n = +t.slice(1, -1); return n + 2 < s.length ? (e = s[n + 2], "function" == typeof e ? e.toString().replace(/ ?\{[\s\S]*$/, "") : "undefined" == typeof e ? "undefined" : "string" != typeof e ? F(e) : e) : t }), e = e + "\nhttp://errors.angularjs.org/1.2.13/" + (t ? t + "/" : "") + r, n = 2; n < arguments.length; n++) e = e + (2 == n ? "?" : "&") + "p" + (n - 2) + "=" + encodeURIComponent(a(arguments[n])); return new Error(e) } } function i(t) { if (null == t || k(t)) return !1; var e = t.length; return 1 === t.nodeType && e ? !0 : w(t) || S(t) || 0 === e || "number" == typeof e && e > 0 && e - 1 in t } function o(t, e, n) { var r; if (t) if (C(t)) for (r in t) "prototype" == r || "length" == r || "name" == r || t.hasOwnProperty && !t.hasOwnProperty(r) || e.call(n, t[r], r); else if (t.forEach && t.forEach !== o) t.forEach(e, n); else if (i(t)) for (r = 0; r < t.length; r++) e.call(n, t[r], r); else for (r in t) t.hasOwnProperty(r) && e.call(n, t[r], r); return t } function s(t) { var e = []; for (var n in t) t.hasOwnProperty(n) && e.push(n); return e.sort() } function a(t, e, n) { for (var r = s(t), i = 0; i < r.length; i++) e.call(n, t[r[i]], r[i]); return r } function u(t) { return function (e, n) { t(n, e) } } function c() { for (var t, e = xn.length; e;) { if (e--, t = xn[e].charCodeAt(0), 57 == t) return xn[e] = "A", xn.join(""); if (90 != t) return xn[e] = String.fromCharCode(t + 1), xn.join(""); xn[e] = "0" } return xn.unshift("0"), xn.join("") } function l(t, e) { e ? t.$$hashKey = e : delete t.$$hashKey } function f(t) { var e = t.$$hashKey; return o(arguments, function (e) { e !== t && o(e, function (e, n) { t[n] = e }) }), l(t, e), t } function h(t) { return parseInt(t, 10) } function p(t, e) { return f(new (f(function () { }, { prototype: t })), e) } function d() { } function $(t) { return t } function v(t) { return function () { return t } } function g(t) { return "undefined" == typeof t } function m(t) { return "undefined" != typeof t } function y(t) { return null != t && "object" == typeof t } function w(t) { return "string" == typeof t } function x(t) { return "number" == typeof t } function b(t) { return "[object Date]" === mn.call(t) } function S(t) { return "[object Array]" === mn.call(t) } function C(t) { return "function" == typeof t } function E(t) { return "[object RegExp]" === mn.call(t) } function k(t) { return t && t.document && t.location && t.alert && t.setInterval } function A(t) { return t && t.$evalAsync && t.$watch } function O(t) { return "[object File]" === mn.call(t) } function T(t) { return !(!t || !(t.nodeName || t.on && t.find)) } function M(t, e, n) { var r = []; return o(t, function (t, i, o) { r.push(e.call(n, t, i, o)) }), r } function P(t, e) { return -1 != j(t, e) } function j(t, e) { if (t.indexOf) return t.indexOf(e); for (var n = 0; n < t.length; n++) if (e === t[n]) return n; return -1 } function N(t, e) { var n = j(t, e); return n >= 0 && t.splice(n, 1), e } function D(t, e) { if (k(t) || A(t)) throw yn("cpws", "Can't copy! Making copies of Window or Scope instances is not supported."); if (e) { if (t === e) throw yn("cpi", "Can't copy! Source and destination are identical."); if (S(t)) { e.length = 0; for (var n = 0; n < t.length; n++) e.push(D(t[n])) } else { var r = e.$$hashKey; o(e, function (t, n) { delete e[n] }); for (var i in t) e[i] = D(t[i]); l(e, r) } } else e = t, t && (S(t) ? e = D(t, []) : b(t) ? e = new Date(t.getTime()) : E(t) ? e = new RegExp(t.source) : y(t) && (e = D(t, {}))); return e } function R(t, e) { e = e || {}; for (var n in t) !t.hasOwnProperty(n) || "$" === n.charAt(0) && "$" === n.charAt(1) || (e[n] = t[n]); return e } function q(t, e) { if (t === e) return !0; if (null === t || null === e) return !1; if (t !== t && e !== e) return !0; var r, i, o, s = typeof t, a = typeof e; if (s == a && "object" == s) { if (!S(t)) { if (b(t)) return b(e) && t.getTime() == e.getTime(); if (E(t) && E(e)) return t.toString() == e.toString(); if (A(t) || A(e) || k(t) || k(e) || S(e)) return !1; o = {}; for (i in t) if ("$" !== i.charAt(0) && !C(t[i])) { if (!q(t[i], e[i])) return !1; o[i] = !0 } for (i in e) if (!o.hasOwnProperty(i) && "$" !== i.charAt(0) && e[i] !== n && !C(e[i])) return !1; return !0 } if (!S(e)) return !1; if ((r = t.length) == e.length) { for (i = 0; r > i; i++) if (!q(t[i], e[i])) return !1; return !0 } } return !1 } function V() { return e.securityPolicy && e.securityPolicy.isActive || e.querySelector && !(!e.querySelector("[ng-csp]") && !e.querySelector("[data-ng-csp]")) } function I(t, e, n) { return t.concat(vn.call(e, n)) } function U(t, e) { return vn.call(t, e || 0) } function _(t, e) { var n = arguments.length > 2 ? U(arguments, 2) : []; return !C(e) || e instanceof RegExp ? e : n.length ? function () { return arguments.length ? e.apply(t, n.concat(vn.call(arguments, 0))) : e.apply(t, n) } : function () { return arguments.length ? e.apply(t, arguments) : e.call(t) } } function H(t, r) { var i = r; return "string" == typeof t && "$" === t.charAt(0) ? i = n : k(r) ? i = "$WINDOW" : r && e === r ? i = "$DOCUMENT" : A(r) && (i = "$SCOPE"), i } function F(t, e) { return "undefined" == typeof t ? n : JSON.stringify(t, H, e ? "  " : null) } function L(t) { return w(t) ? JSON.parse(t) : t } function B(t) { if ("function" == typeof t) t = !0; else if (t && 0 !== t.length) { var e = sn("" + t); t = !("f" == e || "0" == e || "false" == e || "no" == e || "n" == e || "[]" == e) } else t = !1; return t } function z(t) { t = hn(t).clone(); try { t.empty() } catch (e) { } var n = 3, r = hn("<div>").append(t).html(); try { return t[0].nodeType === n ? sn(r) : r.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/, function (t, e) { return "<" + sn(e) }) } catch (e) { return sn(r) } } function W(t) { try { return decodeURIComponent(t) } catch (e) { } } function J(t) { var e, n, r = {}; return o((t || "").split("&"), function (t) { if (t && (e = t.split("="), n = W(e[0]), m(n))) { var i = m(e[1]) ? W(e[1]) : !0; r[n] ? S(r[n]) ? r[n].push(i) : r[n] = [r[n], i] : r[n] = i } }), r } function Q(t) { var e = []; return o(t, function (t, n) { S(t) ? o(t, function (t) { e.push(K(n, !0) + (t === !0 ? "" : "=" + K(t, !0))) }) : e.push(K(n, !0) + (t === !0 ? "" : "=" + K(t, !0))) }), e.length ? e.join("&") : "" } function Y(t) { return K(t, !0).replace(/%26/gi, "&").replace(/%3D/gi, "=").replace(/%2B/gi, "+") } function K(t, e) { return encodeURIComponent(t).replace(/%40/gi, "@").replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, e ? "%20" : "+") } function X(t, n) { function r(t) { t && a.push(t) } var i, s, a = [t], u = ["ng:app", "ng-app", "x-ng-app", "data-ng-app"], c = /\sng[:\-]app(:\s*([\w\d_]+);?)?\s/; o(u, function (n) { u[n] = !0, r(e.getElementById(n)), n = n.replace(":", "\\:"), t.querySelectorAll && (o(t.querySelectorAll("." + n), r), o(t.querySelectorAll("." + n + "\\:"), r), o(t.querySelectorAll("[" + n + "]"), r)) }), o(a, function (t) { if (!i) { var e = " " + t.className + " ", n = c.exec(e); n ? (i = t, s = (n[2] || "").replace(/\s+/g, ",")) : o(t.attributes, function (e) { !i && u[e.name] && (i = t, s = e.value) }) } }), i && n(i, s ? [s] : []) } function Z(n, r) { var i = function () { if (n = hn(n), n.injector()) { var t = n[0] === e ? "document" : z(n); throw yn("btstrpd", "App Already Bootstrapped with this Element '{0}'", t) } r = r || [], r.unshift(["$provide", function (t) { t.value("$rootElement", n) }]), r.unshift("ng"); var i = Mt(r); return i.invoke(["$rootScope", "$rootElement", "$compile", "$injector", "$animate", function (t, e, n, r, i) { t.$apply(function () { e.data("$injector", r), n(e)(t) }) }]), i }, s = /^NG_DEFER_BOOTSTRAP!/; return t && !s.test(t.name) ? i() : (t.name = t.name.replace(s, ""), void (wn.resumeBootstrap = function (t) { o(t, function (t) { r.push(t) }), i() })) } function G(t, e) { return e = e || "_", t.replace(Sn, function (t, n) { return (n ? e : "") + t.toLowerCase() }) } function tt() { pn = t.jQuery, pn ? (hn = pn, f(pn.fn, { scope: Nn.scope, isolateScope: Nn.isolateScope, controller: Nn.controller, injector: Nn.injector, inheritedData: Nn.inheritedData }), lt("remove", !0, !0, !1), lt("empty", !1, !1, !1), lt("html", !1, !1, !0)) : hn = ft, wn.element = hn } function et(t, e, n) { if (!t) throw yn("areq", "Argument '{0}' is {1}", e || "?", n || "required"); return t } function nt(t, e, n) { return n && S(t) && (t = t[t.length - 1]), et(C(t), e, "not a function, got " + (t && "object" == typeof t ? t.constructor.name || "Object" : typeof t)), t } function rt(t, e) { if ("hasOwnProperty" === t) throw yn("badname", "hasOwnProperty is not a valid {0} name", e) } function it(t, e, n) { if (!e) return t; for (var r, i = e.split("."), o = t, s = i.length, a = 0; s > a; a++) r = i[a], t && (t = (o = t)[r]); return !n && C(t) ? _(o, t) : t } function ot(t) { var e = t[0], n = t[t.length - 1]; if (e === n) return hn(e); var r = e, i = [r]; do { if (r = r.nextSibling, !r) break; i.push(r) } while (r !== n); return hn(i) } function st(t) { function e(t, e, n) { return t[e] || (t[e] = n()) } var n = r("$injector"), i = r("ng"), o = e(t, "angular", Object); return o.$$minErr = o.$$minErr || r, e(o, "module", function () { var t = {}; return function (r, o, s) { var a = function (t, e) { if ("hasOwnProperty" === t) throw i("badname", "hasOwnProperty is not a valid {0} name", e) }; return a(r, "module"), o && t.hasOwnProperty(r) && (t[r] = null), e(t, r, function () { function t(t, n, r) { return function () { return e[r || "push"]([t, n, arguments]), u } } if (!o) throw n("nomod", "Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.", r); var e = [], i = [], a = t("$injector", "invoke"), u = { _invokeQueue: e, _runBlocks: i, requires: o, name: r, provider: t("$provide", "provider"), factory: t("$provide", "factory"), service: t("$provide", "service"), value: t("$provide", "value"), constant: t("$provide", "constant", "unshift"), animation: t("$animateProvider", "register"), filter: t("$filterProvider", "register"), controller: t("$controllerProvider", "register"), directive: t("$compileProvider", "directive"), config: a, run: function (t) { return i.push(t), this } }; return s && a(s), u }) } }) } function at(e) { f(e, { bootstrap: Z, copy: D, extend: f, equals: q, element: hn, forEach: o, injector: Mt, noop: d, bind: _, toJson: F, fromJson: L, identity: $, isUndefined: g, isDefined: m, isString: w, isFunction: C, isObject: y, isNumber: x, isElement: T, isArray: S, version: Cn, isDate: b, lowercase: sn, uppercase: un, callbacks: { counter: 0 }, $$minErr: r, $$csp: V }), dn = st(t); try { dn("ngLocale") } catch (n) { dn("ngLocale", []).provider("$locale", Zt) } dn("ng", ["ngLocale"], ["$provide", function (t) { t.provider({ $$sanitizeUri: Ce }), t.provider("$compile", qt).directive({ a: pr, input: Sr, textarea: Sr, form: gr, script: ii, select: ai, style: ci, option: ui, ngBind: Rr, ngBindHtml: Vr, ngBindTemplate: qr, ngClass: Ir, ngClassEven: _r, ngClassOdd: Ur, ngCloak: Hr, ngController: Fr, ngForm: mr, ngHide: Zr, ngIf: Br, ngInclude: zr, ngInit: Jr, ngNonBindable: Qr, ngPluralize: Yr, ngRepeat: Kr, ngShow: Xr, ngStyle: Gr, ngSwitch: ti, ngSwitchWhen: ei, ngSwitchDefault: ni, ngOptions: si, ngTransclude: ri, ngModel: Tr, ngList: jr, ngChange: Mr, required: Pr, ngRequired: Pr, ngValue: Dr }).directive({ ngInclude: Wr }).directive(dr).directive(Lr), t.provider({ $anchorScroll: Pt, $animate: Fn, $browser: Nt, $cacheFactory: Dt, $controller: Ut, $document: _t, $exceptionHandler: Ht, $filter: Re, $interpolate: Kt, $interval: Xt, $http: Wt, $httpBackend: Qt, $location: fe, $log: he, $parse: we, $rootScope: Se, $q: xe, $sce: Te, $sceDelegate: Oe, $sniffer: Me, $templateCache: Rt, $timeout: Pe, $window: De }) }]) } function ut() { return ++An } function ct(t) { return t.replace(Mn, function (t, e, n, r) { return r ? n.toUpperCase() : n }).replace(Pn, "Moz$1") } function lt(t, e, n, r) { function i(t) { var i, s, a, u, c, l, f, h = n && t ? [this.filter(t)] : [this], p = e; if (!r || null != t) for (; h.length;) for (i = h.shift(), s = 0, a = i.length; a > s; s++) for (u = hn(i[s]), p ? u.triggerHandler("$destroy") : p = !p, c = 0, l = (f = u.children()).length; l > c; c++) h.push(pn(f[c])); return o.apply(this, arguments) } var o = pn.fn[t]; o = o.$original || o, i.$original = o, pn.fn[t] = i } function ft(t) { if (t instanceof ft) return t; if (w(t) && (t = bn(t)), !(this instanceof ft)) { if (w(t) && "<" != t.charAt(0)) throw jn("nosel", "Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element"); return new ft(t) } if (w(t)) { var n = e.createElement("div"); n.innerHTML = "<div>&#160;</div>" + t, n.removeChild(n.firstChild), xt(this, n.childNodes); var r = hn(e.createDocumentFragment()); r.append(this) } else xt(this, t) } function ht(t) { return t.cloneNode(!0) } function pt(t) { $t(t); for (var e = 0, n = t.childNodes || []; e < n.length; e++) pt(n[e]) } function dt(t, e, n, r) { if (m(r)) throw jn("offargs", "jqLite#off() does not support the `selector` argument"); var i = vt(t, "events"), s = vt(t, "handle"); s && (g(e) ? o(i, function (e, n) { Tn(t, n, e), delete i[n] }) : o(e.split(" "), function (e) { g(n) ? (Tn(t, e, i[e]), delete i[e]) : N(i[e] || [], n) })) } function $t(t, e) { var r = t[kn], i = En[r]; if (i) { if (e) return void delete En[r].data[e]; i.handle && (i.events.$destroy && i.handle({}, "$destroy"), dt(t)), delete En[r], t[kn] = n } } function vt(t, e, n) { var r = t[kn], i = En[r || -1]; return m(n) ? (i || (t[kn] = r = ut(), i = En[r] = {}), void (i[e] = n)) : i && i[e] } function gt(t, e, n) { var r = vt(t, "data"), i = m(n), o = !i && m(e), s = o && !y(e); if (r || s || vt(t, "data", r = {}), i) r[e] = n; else { if (!o) return r; if (s) return r && r[e]; f(r, e) } } function mt(t, e) { return t.getAttribute ? (" " + (t.getAttribute("class") || "") + " ").replace(/[\n\t]/g, " ").indexOf(" " + e + " ") > -1 : !1 } function yt(t, e) { e && t.setAttribute && o(e.split(" "), function (e) { t.setAttribute("class", bn((" " + (t.getAttribute("class") || "") + " ").replace(/[\n\t]/g, " ").replace(" " + bn(e) + " ", " "))) }) } function wt(t, e) { if (e && t.setAttribute) { var n = (" " + (t.getAttribute("class") || "") + " ").replace(/[\n\t]/g, " "); o(e.split(" "), function (t) { t = bn(t), -1 === n.indexOf(" " + t + " ") && (n += t + " ") }), t.setAttribute("class", bn(n)) } } function xt(t, e) { if (e) { e = e.nodeName || !m(e.length) || k(e) ? [e] : e; for (var n = 0; n < e.length; n++) t.push(e[n]) } } function bt(t, e) { return St(t, "$" + (e || "ngController") + "Controller") } function St(t, e, r) { t = hn(t), 9 == t[0].nodeType && (t = t.find("html")); for (var i = S(e) ? e : [e]; t.length;) { for (var o = 0, s = i.length; s > o; o++) if ((r = t.data(i[o])) !== n) return r; t = t.parent() } } function Ct(t) { for (var e = 0, n = t.childNodes; e < n.length; e++) pt(n[e]); for (; t.firstChild;) t.removeChild(t.firstChild) } function Et(t, e) { var n = Dn[e.toLowerCase()]; return n && Rn[t.nodeName] && n } function kt(t, n) { var r = function (r, i) { if (r.preventDefault || (r.preventDefault = function () { r.returnValue = !1 }), r.stopPropagation || (r.stopPropagation = function () { r.cancelBubble = !0 }), r.target || (r.target = r.srcElement || e), g(r.defaultPrevented)) { var s = r.preventDefault; r.preventDefault = function () { r.defaultPrevented = !0, s.call(r) }, r.defaultPrevented = !1 } r.isDefaultPrevented = function () { return r.defaultPrevented || r.returnValue === !1 }; var a = R(n[i || r.type] || []); o(a, function (e) { e.call(t, r) }), 8 >= fn ? (r.preventDefault = null, r.stopPropagation = null, r.isDefaultPrevented = null) : (delete r.preventDefault, delete r.stopPropagation, delete r.isDefaultPrevented) }; return r.elem = t, r } function At(t) { var e, r = typeof t; return "object" == r && null !== t ? "function" == typeof (e = t.$$hashKey) ? e = t.$$hashKey() : e === n && (e = t.$$hashKey = c()) : e = t, r + ":" + e } function Ot(t) { o(t, this.put, this) } function Tt(t) { var e, n, r, i; return "function" == typeof t ? (e = t.$inject) || (e = [], t.length && (n = t.toString().replace(Un, ""), r = n.match(qn), o(r[1].split(Vn), function (t) { t.replace(In, function (t, n, r) { e.push(r) }) })), t.$inject = e) : S(t) ? (i = t.length - 1, nt(t[i], "fn"), e = t.slice(0, i)) : nt(t, "fn", !0), e } function Mt(t) { function e(t) { return function (e, n) { return y(e) ? void o(e, u(t)) : t(e, n) } } function n(t, e) { if (rt(t, "service"), (C(e) || S(e)) && (e = x.instantiate(e)), !e.$get) throw _n("pget", "Provider '{0}' must define $get factory method.", t); return m[t + p] = e } function r(t, e) { return n(t, { $get: e }) } function i(t, e) { return r(t, ["$injector", function (t) { return t.instantiate(e) }]) } function s(t, e) { return r(t, v(e)) } function a(t, e) { rt(t, "constant"), m[t] = e, b[t] = e } function c(t, e) { var n = x.get(t + p), r = n.$get; n.$get = function () { var t = E.invoke(r, n); return E.invoke(e, null, { $delegate: t }) } } function l(t) { var e, n, r, i, s = []; return o(t, function (t) { if (!g.get(t)) { g.put(t, !0); try { if (w(t)) for (e = dn(t), s = s.concat(l(e.requires)).concat(e._runBlocks), n = e._invokeQueue, r = 0, i = n.length; i > r; r++) { var o = n[r], a = x.get(o[0]); a[o[1]].apply(a, o[2]) } else C(t) ? s.push(x.invoke(t)) : S(t) ? s.push(x.invoke(t)) : nt(t, "module") } catch (u) { throw S(t) && (t = t[t.length - 1]), u.message && u.stack && -1 == u.stack.indexOf(u.message) && (u = u.message + "\n" + u.stack), _n("modulerr", "Failed to instantiate module {0} due to:\n{1}", t, u.stack || u.message || u) } } }), s } function f(t, e) { function n(n) { if (t.hasOwnProperty(n)) { if (t[n] === h) throw _n("cdep", "Circular dependency found: {0}", $.join(" <- ")); return t[n] } try { return $.unshift(n), t[n] = h, t[n] = e(n) } catch (r) { throw t[n] === h && delete t[n], r } finally { $.shift() } } function r(t, e, r) { var i, o, s, a = [], u = Tt(t); for (o = 0, i = u.length; i > o; o++) { if (s = u[o], "string" != typeof s) throw _n("itkn", "Incorrect injection token! Expected service name as string, got {0}", s); a.push(r && r.hasOwnProperty(s) ? r[s] : n(s)) } return t.$inject || (t = t[i]), t.apply(e, a) } function i(t, e) { var n, i, o = function () { }; return o.prototype = (S(t) ? t[t.length - 1] : t).prototype, n = new o, i = r(t, n, e), y(i) || C(i) ? i : n } return { invoke: r, instantiate: i, get: n, annotate: Tt, has: function (e) { return m.hasOwnProperty(e + p) || t.hasOwnProperty(e) } } } var h = {}, p = "Provider", $ = [], g = new Ot, m = { $provide: { provider: e(n), factory: e(r), service: e(i), value: e(s), constant: e(a), decorator: c } }, x = m.$injector = f(m, function () { throw _n("unpr", "Unknown provider: {0}", $.join(" <- ")) }), b = {}, E = b.$injector = f(b, function (t) { var e = x.get(t + p); return E.invoke(e.$get, e) }); return o(l(t), function (t) { E.invoke(t || d) }), E } function Pt() { var t = !0; this.disableAutoScrolling = function () { t = !1 }, this.$get = ["$window", "$location", "$rootScope", function (e, n, r) { function i(t) { var e = null; return o(t, function (t) { e || "a" !== sn(t.nodeName) || (e = t) }), e } function s() { var t, r = n.hash(); r ? (t = a.getElementById(r)) ? t.scrollIntoView() : (t = i(a.getElementsByName(r))) ? t.scrollIntoView() : "top" === r && e.scrollTo(0, 0) : e.scrollTo(0, 0) } var a = e.document; return t && r.$watch(function () { return n.hash() }, function () { r.$evalAsync(s) }), s }] } function jt(t, e, r, i) { function s(t) { try { t.apply(null, U(arguments, 1)) } finally { if (m--, 0 === m) for (; y.length;) try { y.pop()() } catch (e) { r.error(e) } } } function a(t, e) { !function n() { o(b, function (t) { t() }), x = e(n, t) }() } function u() { E = null, S != c.url() && (S = c.url(), o(k, function (t) { t(c.url()) })) } var c = this, l = e[0], f = t.location, h = t.history, p = t.setTimeout, $ = t.clearTimeout, v = {}; c.isMock = !1; var m = 0, y = []; c.$$completeOutstandingRequest = s, c.$$incOutstandingRequestCount = function () { m++ }, c.notifyWhenNoOutstandingRequests = function (t) { o(b, function (t) { t() }), 0 === m ? t() : y.push(t) }; var x, b = []; c.addPollFn = function (t) { return g(x) && a(100, p), b.push(t), t }; var S = f.href, C = e.find("base"), E = null; c.url = function (e, n) { if (f !== t.location && (f = t.location), h !== t.history && (h = t.history), e) { if (S == e) return; return S = e, i.history ? n ? h.replaceState(null, "", e) : (h.pushState(null, "", e), C.attr("href", C.attr("href"))) : (E = e, n ? f.replace(e) : f.href = e), c } return E || f.href.replace(/%27/g, "'") }; var k = [], A = !1; c.onUrlChange = function (e) { return A || (i.history && hn(t).on("popstate", u), i.hashchange ? hn(t).on("hashchange", u) : c.addPollFn(u), A = !0), k.push(e), e }, c.baseHref = function () { var t = C.attr("href"); return t ? t.replace(/^(https?\:)?\/\/[^\/]*/, "") : "" }; var O = {}, T = "", M = c.baseHref(); c.cookies = function (t, e) { var i, o, s, a, u; if (!t) { if (l.cookie !== T) for (T = l.cookie, o = T.split("; "), O = {}, a = 0; a < o.length; a++) s = o[a], u = s.indexOf("="), u > 0 && (t = unescape(s.substring(0, u)), O[t] === n && (O[t] = unescape(s.substring(u + 1)))); return O } e === n ? l.cookie = escape(t) + "=;path=" + M + ";expires=Thu, 01 Jan 1970 00:00:00 GMT" : w(e) && (i = (l.cookie = escape(t) + "=" + escape(e) + ";path=" + M).length + 1, i > 4096 && r.warn("Cookie '" + t + "' possibly not set or overflowed because it was too large (" + i + " > 4096 bytes)!")) }, c.defer = function (t, e) { var n; return m++, n = p(function () { delete v[n], s(t) }, e || 0), v[n] = !0, n }, c.defer.cancel = function (t) { return v[t] ? (delete v[t], $(t), s(d), !0) : !1 } } function Nt() { this.$get = ["$window", "$log", "$sniffer", "$document", function (t, e, n, r) { return new jt(t, r, e, n) }] } function Dt() { this.$get = function () { function t(t, n) { function i(t) { t != h && (p ? p == t && (p = t.n) : p = t, o(t.n, t.p), o(t, h), h = t, h.n = null) } function o(t, e) { t != e && (t && (t.p = e), e && (e.n = t)) } if (t in e) throw r("$cacheFactory")("iid", "CacheId '{0}' is already taken!", t); var s = 0, a = f({}, n, { id: t }), u = {}, c = n && n.capacity || Number.MAX_VALUE, l = {}, h = null, p = null; return e[t] = { put: function (t, e) { var n = l[t] || (l[t] = { key: t }); return i(n), g(e) ? void 0 : (t in u || s++, u[t] = e, s > c && this.remove(p.key), e) }, get: function (t) { var e = l[t]; if (e) return i(e), u[t] }, remove: function (t) { var e = l[t]; e && (e == h && (h = e.p), e == p && (p = e.n), o(e.n, e.p), delete l[t], delete u[t], s--) }, removeAll: function () { u = {}, s = 0, l = {}, h = p = null }, destroy: function () { u = null, a = null, l = null, delete e[t] }, info: function () { return f({}, a, { size: s }) } } } var e = {}; return t.info = function () { var t = {}; return o(e, function (e, n) { t[n] = e.info() }), t }, t.get = function (t) { return e[t] }, t } } function Rt() { this.$get = ["$cacheFactory", function (t) { return t("templates") }] } function qt(t, r) {
        var i = {}, s = "Directive", a = /^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/, c = /(([\d\w\-_]+)(?:\:([^;]+))?;?)/, l = /^<\s*(tr|th|td|tbody)(\s+[^>]*)?>/i, h = /^(on[a-z]+|formaction)$/; this.directive = function d(e, n) { return rt(e, "directive"), w(e) ? (et(n, "directiveFactory"), i.hasOwnProperty(e) || (i[e] = [], t.factory(e + s, ["$injector", "$exceptionHandler", function (t, n) { var r = []; return o(i[e], function (i, o) { try { var s = t.invoke(i); C(s) ? s = { compile: v(s) } : !s.compile && s.link && (s.compile = v(s.link)), s.priority = s.priority || 0, s.index = o, s.name = s.name || e, s.require = s.require || s.controller && s.name, s.restrict = s.restrict || "A", r.push(s) } catch (a) { n(a) } }), r }])), i[e].push(n)) : o(e, u(d)), this }, this.aHrefSanitizationWhitelist = function (t) { return m(t) ? (r.aHrefSanitizationWhitelist(t), this) : r.aHrefSanitizationWhitelist() }, this.imgSrcSanitizationWhitelist = function (t) { return m(t) ? (r.imgSrcSanitizationWhitelist(t), this) : r.imgSrcSanitizationWhitelist() }, this.$get = ["$injector", "$interpolate", "$exceptionHandler", "$http", "$templateCache", "$parse", "$controller", "$rootScope", "$document", "$sce", "$animate", "$$sanitizeUri", function (t, r, u, d, g, m, x, b, E, k, A, O) {
            function T(t, e, n, r, i) { t instanceof hn || (t = hn(t)), o(t, function (e, n) { 3 == e.nodeType && e.nodeValue.match(/\S+/) && (t[n] = e = hn(e).wrap("<span></span>").parent()[0]) }); var s = P(t, e, t, n, r, i); return M(t, "ng-scope"), function (e, n, r) { et(e, "scope"); var i = n ? Nn.clone.call(t) : t; o(r, function (t, e) { i.data("$" + e + "Controller", t) }); for (var a = 0, u = i.length; u > a; a++) { var c = i[a], l = c.nodeType; (1 === l || 9 === l) && i.eq(a).data("$scope", e) } return n && n(i, e), s && s(e, i, i), i } } function M(t, e) { try { t.addClass(e) } catch (n) { } } function P(t, e, r, i, o, s) { function a(t, r, i, o) { var s, a, u, c, l, f, h, p, $, v = r.length, g = new Array(v); for (h = 0; v > h; h++) g[h] = r[h]; for (h = 0, $ = 0, p = d.length; p > h; $++) u = g[$], s = d[h++], a = d[h++], c = hn(u), s ? (s.scope ? (l = t.$new(), c.data("$scope", l)) : l = t, f = s.transclude, f || !o && e ? s(a, l, u, i, j(t, f || e)) : s(a, l, u, i, o)) : a && a(t, u.childNodes, n, o) } for (var u, c, l, f, h, p, d = [], $ = 0; $ < t.length; $++) u = new nt, c = N(t[$], [], u, 0 === $ ? i : n, o), l = c.length ? I(c, t[$], u, e, r, null, [], [], s) : null, l && l.scope && M(hn(t[$]), "ng-scope"), h = l && l.terminal || !(f = t[$].childNodes) || !f.length ? null : P(f, l ? l.transclude : e), d.push(l, h), p = p || l || h, s = null; return p ? a : null } function j(t, e) { return function (n, r, i) { var o = !1; n || (n = t.$new(), n.$$transcluded = !0, o = !0); var s = e(n, r, i); return o && s.on("$destroy", _(n, n.$destroy)), s } } function N(t, e, n, r, i) { var o, s, u = t.nodeType, l = n.$attr; switch (u) { case 1: F(e, Vt($n(t).toLowerCase()), "E", r, i); for (var f, h, p, d, $, v = t.attributes, g = 0, m = v && v.length; m > g; g++) { var y = !1, x = !1; if (f = v[g], !fn || fn >= 8 || f.specified) { h = f.name, d = Vt(h), st.test(d) && (h = G(d.substr(6), "-")); var b = d.replace(/(Start|End)$/, ""); d === b + "Start" && (y = h, x = h.substr(0, h.length - 5) + "end", h = h.substr(0, h.length - 6)), p = Vt(h.toLowerCase()), l[p] = h, n[p] = $ = bn(f.value), Et(t, p) && (n[p] = !0), X(t, e, $, p), F(e, p, "A", r, i, y, x) } } if (s = t.className, w(s) && "" !== s) for (; o = c.exec(s) ;) p = Vt(o[2]), F(e, p, "C", r, i) && (n[p] = bn(o[3])), s = s.substr(o.index + o[0].length); break; case 3: Y(e, t.nodeValue); break; case 8: try { o = a.exec(t.nodeValue), o && (p = Vt(o[1]), F(e, p, "M", r, i) && (n[p] = bn(o[2]))) } catch (S) { } } return e.sort(J), e } function D(t, e, n) { var r = [], i = 0; if (e && t.hasAttribute && t.hasAttribute(e)) { do { if (!t) throw Ln("uterdir", "Unterminated attribute, found '{0}' but no matching '{1}' found.", e, n); 1 == t.nodeType && (t.hasAttribute(e) && i++, t.hasAttribute(n) && i--), r.push(t), t = t.nextSibling } while (i > 0) } else r.push(t); return hn(r) } function V(t, e, n) { return function (r, i, o, s, a) { return i = D(i[0], e, n), t(r, i, o, s, a) } } function I(t, i, s, a, c, l, f, h, p) { function d(t, e, n, r) { t && (n && (t = V(t, n, r)), t.require = b.require, (I === b || b.$$isolateScope) && (t = tt(t, { isolateScope: !0 })), f.push(t)), e && (n && (e = V(e, n, r)), e.require = b.require, (I === b || b.$$isolateScope) && (e = tt(e, { isolateScope: !0 })), h.push(e)) } function $(t, e, n) { var r, i = "data", s = !1; if (w(t)) { for (; "^" == (r = t.charAt(0)) || "?" == r;) t = t.substr(1), "^" == r && (i = "inheritedData"), s = s || "?" == r; if (r = null, n && "data" === i && (r = n[t]), r = r || e[i]("$" + t + "Controller"), !r && !s) throw Ln("ctreq", "Controller '{0}', required by directive '{1}', can't be found!", t, E); return r } return S(t) && (r = [], o(t, function (t) { r.push($(t, e, n)) })), r } function v(t, e, a, c, l) { function p(t, e) { var r; return arguments.length < 2 && (e = t, t = n), Y && (r = E), l(t, e, r) } var d, v, g, y, w, b, S, C, E = {}; if (d = i === a ? s : R(s, new nt(hn(a), s.$attr)), v = d.$$element, I) { var k = /^\s*([@=&])(\??)\s*(\w*)\s*$/, A = hn(a); S = e.$new(!0), _ && _ === I.$$originalDirective ? A.data("$isolateScope", S) : A.data("$isolateScopeNoTemplate", S), M(A, "ng-isolate-scope"), o(I.scope, function (t, n) { var i, o, s, a, u = t.match(k) || [], c = u[3] || n, l = "?" == u[2], f = u[1]; switch (S.$$isolateBindings[n] = f + c, f) { case "@": d.$observe(c, function (t) { S[n] = t }), d.$$observers[c].$$scope = e, d[c] && (S[n] = r(d[c])(e)); break; case "=": if (l && !d[c]) return; o = m(d[c]), a = o.literal ? q : function (t, e) { return t === e }, s = o.assign || function () { throw i = S[n] = o(e), Ln("nonassign", "Expression '{0}' used with directive '{1}' is non-assignable!", d[c], I.name) }, i = S[n] = o(e), S.$watch(function () { var t = o(e); return a(t, S[n]) || (a(t, i) ? s(e, t = S[n]) : S[n] = t), i = t }, null, o.literal); break; case "&": o = m(d[c]), S[n] = function (t) { return o(e, t) }; break; default: throw Ln("iscp", "Invalid isolate scope definition for directive '{0}'. Definition: {... {1}: '{2}' ...}", I.name, n, t) } }) } for (C = l && p, j && o(j, function (t) { var n, r = { $scope: t === I || t.$$isolateScope ? S : e, $element: v, $attrs: d, $transclude: C }; b = t.controller, "@" == b && (b = d[t.name]), n = x(b, r), E[t.name] = n, Y || v.data("$" + t.name + "Controller", n), t.controllerAs && (r.$scope[t.controllerAs] = n) }), g = 0, y = f.length; y > g; g++) try { w = f[g], w(w.isolateScope ? S : e, v, d, w.require && $(w.require, v, E), C) } catch (O) { u(O, z(v)) } var T = e; for (I && (I.template || null === I.templateUrl) && (T = S), t && t(T, a.childNodes, n, l), g = h.length - 1; g >= 0; g--) try { w = h[g], w(w.isolateScope ? S : e, v, d, w.require && $(w.require, v, E), C) } catch (O) { u(O, z(v)) } } p = p || {}; for (var g, b, E, k, A, O, P = -Number.MAX_VALUE, j = p.controllerDirectives, I = p.newIsolateScopeDirective, _ = p.templateDirective, F = p.nonTlbTranscludeDirective, J = !1, Y = p.hasElementTranscludeDirective, K = s.$$element = hn(i), X = l, G = a, et = 0, rt = t.length; rt > et; et++) { b = t[et]; var it = b.$$start, st = b.$$end; if (it && (K = D(i, it, st)), k = n, P > b.priority) break; if ((O = b.scope) && (g = g || b, b.templateUrl || (Q("new/isolated scope", I, b, K), y(O) && (I = b))), E = b.name, !b.templateUrl && b.controller && (O = b.controller, j = j || {}, Q("'" + E + "' controller", j[E], b, K), j[E] = b), (O = b.transclude) && (J = !0, b.$$tlb || (Q("transclusion", F, b, K), F = b), "element" == O ? (Y = !0, P = b.priority, k = D(i, it, st), K = s.$$element = hn(e.createComment(" " + E + ": " + s[E] + " ")), i = K[0], Z(c, hn(U(k)), i), G = T(k, a, P, X && X.name, { nonTlbTranscludeDirective: F })) : (k = hn(ht(i)).contents(), K.empty(), G = T(k, a))), b.template) if (Q("template", _, b, K), _ = b, O = C(b.template) ? b.template(K, s) : b.template, O = ot(O), b.replace) { if (X = b, k = B(O), i = k[0], 1 != k.length || 1 !== i.nodeType) throw Ln("tplrt", "Template for directive '{0}' must have exactly one root element. {1}", E, ""); Z(c, K, i); var at = { $attr: {} }, ut = N(i, [], at), ct = t.splice(et + 1, t.length - (et + 1)); I && H(ut), t = t.concat(ut).concat(ct), L(s, at), rt = t.length } else K.html(O); if (b.templateUrl) Q("template", _, b, K), _ = b, b.replace && (X = b), v = W(t.splice(et, t.length - et), K, s, c, G, f, h, { controllerDirectives: j, newIsolateScopeDirective: I, templateDirective: _, nonTlbTranscludeDirective: F }), rt = t.length; else if (b.compile) try { A = b.compile(K, s, G), C(A) ? d(null, A, it, st) : A && d(A.pre, A.post, it, st) } catch (lt) { u(lt, z(K)) } b.terminal && (v.terminal = !0, P = Math.max(P, b.priority)) } return v.scope = g && g.scope === !0, v.transclude = J && G, p.hasElementTranscludeDirective = Y, v } function H(t) { for (var e = 0, n = t.length; n > e; e++) t[e] = p(t[e], { $$isolateScope: !0 }) } function F(e, r, o, a, c, l, f) { if (r === c) return null; var h = null; if (i.hasOwnProperty(r)) for (var d, $ = t.get(r + s), v = 0, g = $.length; g > v; v++) try { d = $[v], (a === n || a > d.priority) && -1 != d.restrict.indexOf(o) && (l && (d = p(d, { $$start: l, $$end: f })), e.push(d), h = d) } catch (m) { u(m) } return h } function L(t, e) { var n = e.$attr, r = t.$attr, i = t.$$element; o(t, function (r, i) { "$" != i.charAt(0) && (e[i] && (r += ("style" === i ? ";" : " ") + e[i]), t.$set(i, r, !0, n[i])) }), o(e, function (e, o) { "class" == o ? (M(i, e), t["class"] = (t["class"] ? t["class"] + " " : "") + e) : "style" == o ? (i.attr("style", i.attr("style") + ";" + e), t.style = (t.style ? t.style + ";" : "") + e) : "$" == o.charAt(0) || t.hasOwnProperty(o) || (t[o] = e, r[o] = n[o]) }) } function B(t) { var e; if (t = bn(t), e = l.exec(t)) { e = e[1].toLowerCase(); var n = hn("<table>" + t + "</table>"), r = n.children("tbody"), i = /(td|th)/.test(e) && n.find("tr"); return r.length && "tbody" !== e && (n = r), i && i.length && (n = i), n.contents() } return hn("<div>" + t + "</div>").contents() } function W(t, e, n, r, i, s, a, u) { var c, l, h = [], p = e[0], $ = t.shift(), v = f({}, $, { templateUrl: null, transclude: null, replace: null, $$originalDirective: $ }), m = C($.templateUrl) ? $.templateUrl(e, n) : $.templateUrl; return e.empty(), d.get(k.getTrustedResourceUrl(m), { cache: g }).success(function (f) { var d, g, w, x; if (f = ot(f), $.replace) { if (w = B(f), d = w[0], 1 != w.length || 1 !== d.nodeType) throw Ln("tplrt", "Template for directive '{0}' must have exactly one root element. {1}", $.name, m); g = { $attr: {} }, Z(r, e, d); var b = N(d, [], g); y($.scope) && H(b), t = b.concat(t), L(n, g) } else d = p, e.html(f); for (t.unshift(v), c = I(t, d, n, i, e, $, s, a, u), o(r, function (t, n) { t == d && (r[n] = e[0]) }), l = P(e[0].childNodes, i) ; h.length;) { var S = h.shift(), C = h.shift(), E = h.shift(), k = h.shift(), A = e[0]; if (C !== p) { var O = C.className; u.hasElementTranscludeDirective && $.replace || (A = ht(d)), Z(E, hn(C), A), M(hn(A), O) } x = c.transclude ? j(S, c.transclude) : k, c(l, S, A, r, x) } h = null }).error(function (t, e, n, r) { throw Ln("tpload", "Failed to load template: {0}", r.url) }), function (t, e, n, r, i) { h ? (h.push(e), h.push(n), h.push(r), h.push(i)) : c(l, e, n, r, i) } } function J(t, e) { var n = e.priority - t.priority; return 0 !== n ? n : t.name !== e.name ? t.name < e.name ? -1 : 1 : t.index - e.index } function Q(t, e, n, r) { if (e) throw Ln("multidir", "Multiple directives [{0}, {1}] asking for {2} on: {3}", e.name, n.name, t, z(r)) } function Y(t, e) { var n = r(e, !0); n && t.push({ priority: 0, compile: v(function (t, e) { var r = e.parent(), i = r.data("$binding") || []; i.push(n), M(r.data("$binding", i), "ng-binding"), t.$watch(n, function (t) { e[0].nodeValue = t }) }) }) } function K(t, e) { if ("srcdoc" == e) return k.HTML; var n = $n(t); return "xlinkHref" == e || "FORM" == n && "action" == e || "IMG" != n && ("src" == e || "ngSrc" == e) ? k.RESOURCE_URL : void 0 } function X(t, e, n, i) { var o = r(n, !0); if (o) { if ("multiple" === i && "SELECT" === $n(t)) throw Ln("selmulti", "Binding to the 'multiple' attribute is not supported. Element: {0}", z(t)); e.push({ priority: 100, compile: function () { return { pre: function (e, n, s) { var a = s.$$observers || (s.$$observers = {}); if (h.test(i)) throw Ln("nodomevents", "Interpolations for HTML DOM event attributes are disallowed.  Please use the ng- versions (such as ng-click instead of onclick) instead."); o = r(s[i], !0, K(t, i)), o && (s[i] = o(e), (a[i] || (a[i] = [])).$$inter = !0, (s.$$observers && s.$$observers[i].$$scope || e).$watch(o, function (t, e) { "class" === i && t != e ? s.$updateClass(t, e) : s.$set(i, t) })) } } } }) } } function Z(t, n, r) { var i, o, s = n[0], a = n.length, u = s.parentNode; if (t) for (i = 0, o = t.length; o > i; i++) if (t[i] == s) { t[i++] = r; for (var c = i, l = c + a - 1, f = t.length; f > c; c++, l++) f > l ? t[c] = t[l] : delete t[c]; t.length -= a - 1; break } u && u.replaceChild(r, s); var h = e.createDocumentFragment(); h.appendChild(s), r[hn.expando] = s[hn.expando]; for (var p = 1, d = n.length; d > p; p++) { var $ = n[p]; hn($).remove(), h.appendChild($), delete n[p] } n[0] = r, n.length = 1 } function tt(t, e) { return f(function () { return t.apply(null, arguments) }, t, e) } var nt = function (t, e) { this.$$element = t, this.$attr = e || {} }; nt.prototype = { $normalize: Vt, $addClass: function (t) { t && t.length > 0 && A.addClass(this.$$element, t) }, $removeClass: function (t) { t && t.length > 0 && A.removeClass(this.$$element, t) }, $updateClass: function (t, e) { var n = It(t, e), r = It(e, t); 0 === n.length ? A.removeClass(this.$$element, r) : 0 === r.length ? A.addClass(this.$$element, n) : A.setClass(this.$$element, n, r) }, $set: function (t, e, r, i) { var s, a = Et(this.$$element[0], t); a && (this.$$element.prop(t, e), i = a), this[t] = e, i ? this.$attr[t] = i : (i = this.$attr[t], i || (this.$attr[t] = i = G(t, "-"))), s = $n(this.$$element), ("A" === s && "href" === t || "IMG" === s && "src" === t) && (this[t] = e = O(e, "src" === t)), r !== !1 && (null === e || e === n ? this.$$element.removeAttr(i) : this.$$element.attr(i, e)); var c = this.$$observers; c && o(c[t], function (t) { try { t(e) } catch (n) { u(n) } }) }, $observe: function (t, e) { var n = this, r = n.$$observers || (n.$$observers = {}), i = r[t] || (r[t] = []); return i.push(e), b.$evalAsync(function () { i.$$inter || e(n[t]) }), e } }; var rt = r.startSymbol(), it = r.endSymbol(), ot = "{{" == rt || "}}" == it ? $ : function (t) {
                return t.replace(/\{\{/g, rt).replace(/}}/g, it);
            }, st = /^ngAttr[A-Z]/; return T
        }]
    } function Vt(t) { return ct(t.replace(Bn, "")) } function It(t, e) { var n = "", r = t.split(/\s+/), i = e.split(/\s+/); t: for (var o = 0; o < r.length; o++) { for (var s = r[o], a = 0; a < i.length; a++) if (s == i[a]) continue t; n += (n.length > 0 ? " " : "") + s } return n } function Ut() { var t = {}, e = /^(\S+)(\s+as\s+(\w+))?$/; this.register = function (e, n) { rt(e, "controller"), y(e) ? f(t, e) : t[e] = n }, this.$get = ["$injector", "$window", function (n, i) { return function (o, s) { var a, u, c, l; if (w(o) && (u = o.match(e), c = u[1], l = u[3], o = t.hasOwnProperty(c) ? t[c] : it(s.$scope, c, !0) || it(i, c, !0), nt(o, c, !0)), a = n.instantiate(o, s), l) { if (!s || "object" != typeof s.$scope) throw r("$controller")("noscp", "Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.", c || o.name, l); s.$scope[l] = a } return a } }] } function _t() { this.$get = ["$window", function (t) { return hn(t.document) }] } function Ht() { this.$get = ["$log", function (t) { return function (e, n) { t.error.apply(t, arguments) } }] } function Ft(t) { var e, n, r, i = {}; return t ? (o(t.split("\n"), function (t) { r = t.indexOf(":"), e = sn(bn(t.substr(0, r))), n = bn(t.substr(r + 1)), e && (i[e] ? i[e] += ", " + n : i[e] = n) }), i) : i } function Lt(t) { var e = y(t) ? t : n; return function (n) { return e || (e = Ft(t)), n ? e[sn(n)] || null : e } } function Bt(t, e, n) { return C(n) ? n(t, e) : (o(n, function (n) { t = n(t, e) }), t) } function zt(t) { return t >= 200 && 300 > t } function Wt() { var t = /^\s*(\[|\{[^\{])/, e = /[\}\]]\s*$/, r = /^\)\]\}',?\n/, i = { "Content-Type": "application/json;charset=utf-8" }, s = this.defaults = { transformResponse: [function (n) { return w(n) && (n = n.replace(r, ""), t.test(n) && e.test(n) && (n = L(n))), n }], transformRequest: [function (t) { return y(t) && !O(t) ? F(t) : t }], headers: { common: { Accept: "application/json, text/plain, */*" }, post: D(i), put: D(i), patch: D(i) }, xsrfCookieName: "XSRF-TOKEN", xsrfHeaderName: "X-XSRF-TOKEN" }, u = this.interceptors = [], c = this.responseInterceptors = []; this.$get = ["$httpBackend", "$browser", "$cacheFactory", "$rootScope", "$q", "$injector", function (t, e, r, i, l, h) { function p(t) { function r(t) { var e = f({}, t, { data: Bt(t.data, t.headers, a.transformResponse) }); return zt(t.status) ? e : l.reject(e) } function i(t) { function e(t) { var e; o(t, function (n, r) { C(n) && (e = n(), null != e ? t[r] = e : delete t[r]) }) } var n, r, i, a = s.headers, u = f({}, t.headers); a = f({}, a.common, a[sn(t.method)]), e(a), e(u); t: for (n in a) { r = sn(n); for (i in u) if (sn(i) === r) continue t; u[n] = a[n] } return u } var a = { transformRequest: s.transformRequest, transformResponse: s.transformResponse }, u = i(t); f(a, t), a.headers = u, a.method = un(a.method); var c = Ne(a.url) ? e.cookies()[a.xsrfCookieName || s.xsrfCookieName] : n; c && (u[a.xsrfHeaderName || s.xsrfHeaderName] = c); var h = function (t) { u = t.headers; var e = Bt(t.data, Lt(u), t.transformRequest); return g(t.data) && o(u, function (t, e) { "content-type" === sn(e) && delete u[e] }), g(t.withCredentials) && !g(s.withCredentials) && (t.withCredentials = s.withCredentials), v(t, e, u).then(r, r) }, p = [h, n], d = l.when(a); for (o(E, function (t) { (t.request || t.requestError) && p.unshift(t.request, t.requestError), (t.response || t.responseError) && p.push(t.response, t.responseError) }) ; p.length;) { var $ = p.shift(), m = p.shift(); d = d.then($, m) } return d.success = function (t) { return d.then(function (e) { t(e.data, e.status, e.headers, a) }), d }, d.error = function (t) { return d.then(null, function (e) { t(e.data, e.status, e.headers, a) }), d }, d } function d(t) { o(arguments, function (t) { p[t] = function (e, n) { return p(f(n || {}, { method: t, url: e })) } }) } function $(t) { o(arguments, function (t) { p[t] = function (e, n, r) { return p(f(r || {}, { method: t, url: e, data: n })) } }) } function v(e, n, r) { function o(t, e, n) { c && (zt(t) ? c.put($, [t, e, Ft(n)]) : c.remove($)), a(e, t, n), i.$$phase || i.$apply() } function a(t, n, r) { n = Math.max(n, 0), (zt(n) ? h.resolve : h.reject)({ data: t, status: n, headers: Lt(r), config: e }) } function u() { var t = j(p.pendingRequests, e); -1 !== t && p.pendingRequests.splice(t, 1) } var c, f, h = l.defer(), d = h.promise, $ = x(e.url, e.params); if (p.pendingRequests.push(e), d.then(u, u), (e.cache || s.cache) && e.cache !== !1 && "GET" == e.method && (c = y(e.cache) ? e.cache : y(s.cache) ? s.cache : b), c) if (f = c.get($), m(f)) { if (f.then) return f.then(u, u), f; S(f) ? a(f[1], f[0], D(f[2])) : a(f, 200, {}) } else c.put($, d); return g(f) && t(e.method, $, n, o, r, e.timeout, e.withCredentials, e.responseType), d } function x(t, e) { if (!e) return t; var n = []; return a(e, function (t, e) { null === t || g(t) || (S(t) || (t = [t]), o(t, function (t) { y(t) && (t = F(t)), n.push(K(e) + "=" + K(t)) })) }), t + (-1 == t.indexOf("?") ? "?" : "&") + n.join("&") } var b = r("$http"), E = []; return o(u, function (t) { E.unshift(w(t) ? h.get(t) : h.invoke(t)) }), o(c, function (t, e) { var n = w(t) ? h.get(t) : h.invoke(t); E.splice(e, 0, { response: function (t) { return n(l.when(t)) }, responseError: function (t) { return n(l.reject(t)) } }) }), p.pendingRequests = [], d("get", "delete", "head", "jsonp"), $("post", "put"), p.defaults = s, p }] } function Jt(e) { if (8 >= fn && (!e.match(/^(get|post|head|put|delete|options)$/i) || !t.XMLHttpRequest)) return new t.ActiveXObject("Microsoft.XMLHTTP"); if (t.XMLHttpRequest) return new t.XMLHttpRequest; throw r("$httpBackend")("noxhr", "This browser does not support XMLHttpRequest.") } function Qt() { this.$get = ["$browser", "$window", "$document", function (t, e, n) { return Yt(t, Jt, t.defer, e.angular.callbacks, n[0]) }] } function Yt(t, e, n, r, i) { function s(t, e) { var n = i.createElement("script"), r = function () { n.onreadystatechange = n.onload = n.onerror = null, i.body.removeChild(n), e && e() }; return n.type = "text/javascript", n.src = t, fn && 8 >= fn ? n.onreadystatechange = function () { /loaded|complete/.test(n.readyState) && r() } : n.onload = n.onerror = function () { r() }, i.body.appendChild(n), r } var a = -1; return function (i, u, c, l, f, h, p, $) { function v() { y = a, x && x(), b && b.abort() } function g(e, r, i, o) { C && n.cancel(C), x = b = null, r = 0 === r ? i ? 200 : 404 : r, r = 1223 == r ? 204 : r, e(r, i, o), t.$$completeOutstandingRequest(d) } var y; if (t.$$incOutstandingRequestCount(), u = u || t.url(), "jsonp" == sn(i)) { var w = "_" + (r.counter++).toString(36); r[w] = function (t) { r[w].data = t }; var x = s(u.replace("JSON_CALLBACK", "angular.callbacks." + w), function () { r[w].data ? g(l, 200, r[w].data) : g(l, y || -2), r[w] = wn.noop }) } else { var b = e(i); if (b.open(i, u, !0), o(f, function (t, e) { m(t) && b.setRequestHeader(e, t) }), b.onreadystatechange = function () { if (b && 4 == b.readyState) { var t = null, e = null; y !== a && (t = b.getAllResponseHeaders(), e = "response" in b ? b.response : b.responseText), g(l, y || b.status, e, t) } }, p && (b.withCredentials = !0), $) try { b.responseType = $ } catch (S) { if ("json" !== $) throw S } b.send(c || null) } if (h > 0) var C = n(v, h); else h && h.then && h.then(v) } } function Kt() { var t = "{{", e = "}}"; this.startSymbol = function (e) { return e ? (t = e, this) : t }, this.endSymbol = function (t) { return t ? (e = t, this) : e }, this.$get = ["$parse", "$exceptionHandler", "$sce", function (n, r, i) { function o(o, u, c) { for (var l, f, h, p, d = 0, $ = [], v = o.length, m = !1, y = []; v > d;) -1 != (l = o.indexOf(t, d)) && -1 != (f = o.indexOf(e, l + s)) ? (d != l && $.push(o.substring(d, l)), $.push(h = n(p = o.substring(l + s, f))), h.exp = p, d = f + a, m = !0) : (d != v && $.push(o.substring(d)), d = v); if ((v = $.length) || ($.push(""), v = 1), c && $.length > 1) throw zn("noconcat", "Error while interpolating: {0}\nStrict Contextual Escaping disallows interpolations that concatenate multiple expressions when a trusted value is required.  See http://docs.angularjs.org/api/ng.$sce", o); return !u || m ? (y.length = v, h = function (t) { try { for (var e, n = 0, s = v; s > n; n++) "function" == typeof (e = $[n]) && (e = e(t), e = c ? i.getTrusted(c, e) : i.valueOf(e), null === e || g(e) ? e = "" : "string" != typeof e && (e = F(e))), y[n] = e; return y.join("") } catch (a) { var u = zn("interr", "Can't interpolate: {0}\n{1}", o, a.toString()); r(u) } }, h.exp = o, h.parts = $, h) : void 0 } var s = t.length, a = e.length; return o.startSymbol = function () { return t }, o.endSymbol = function () { return e }, o }] } function Xt() { this.$get = ["$rootScope", "$window", "$q", function (t, e, n) { function r(r, o, s, a) { var u = e.setInterval, c = e.clearInterval, l = n.defer(), f = l.promise, h = 0, p = m(a) && !a; return s = m(s) ? s : 0, f.then(null, null, r), f.$$intervalId = u(function () { l.notify(h++), s > 0 && h >= s && (l.resolve(h), c(f.$$intervalId), delete i[f.$$intervalId]), p || t.$apply() }, o), i[f.$$intervalId] = l, f } var i = {}; return r.cancel = function (t) { return t && t.$$intervalId in i ? (i[t.$$intervalId].reject("canceled"), clearInterval(t.$$intervalId), delete i[t.$$intervalId], !0) : !1 }, r }] } function Zt() { 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: "�", posSuf: "", negPre: "(�", 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, yyyy h:mm:ss a", "short": "MM/d/yyyy h:mm a", fullDate: "EEEE, MMMM d, yyyy", longDate: "MMMM d, yyyy", mediumDate: "MMM d, yyyy", shortDate: "MM/d/yyyy", mediumTime: "h:mm:ss a", shortTime: "h:mm a" }, pluralCat: function (t) { return 1 === t ? "one" : "other" } } } } function Gt(t) { for (var e = t.split("/"), n = e.length; n--;) e[n] = Y(e[n]); return e.join("/") } function te(t, e, n) { var r = je(t, n); e.$$protocol = r.protocol, e.$$host = r.hostname, e.$$port = h(r.port) || Jn[r.protocol] || null } function ee(t, e, n) { var r = "/" !== t.charAt(0); r && (t = "/" + t); var i = je(t, n); e.$$path = decodeURIComponent(r && "/" === i.pathname.charAt(0) ? i.pathname.substring(1) : i.pathname), e.$$search = J(i.search), e.$$hash = decodeURIComponent(i.hash), e.$$path && "/" != e.$$path.charAt(0) && (e.$$path = "/" + e.$$path) } function ne(t, e) { return 0 === e.indexOf(t) ? e.substr(t.length) : void 0 } function re(t) { var e = t.indexOf("#"); return -1 == e ? t : t.substr(0, e) } function ie(t) { return t.substr(0, re(t).lastIndexOf("/") + 1) } function oe(t) { return t.substring(0, t.indexOf("/", t.indexOf("//") + 2)) } function se(t, e) { this.$$html5 = !0, e = e || ""; var r = ie(t); te(t, this, t), this.$$parse = function (e) { var n = ne(r, e); if (!w(n)) throw Qn("ipthprfx", 'Invalid url "{0}", missing path prefix "{1}".', e, r); ee(n, this, t), this.$$path || (this.$$path = "/"), this.$$compose() }, this.$$compose = function () { var t = Q(this.$$search), e = this.$$hash ? "#" + Y(this.$$hash) : ""; this.$$url = Gt(this.$$path) + (t ? "?" + t : "") + e, this.$$absUrl = r + this.$$url.substr(1) }, this.$$rewrite = function (i) { var o, s; return (o = ne(t, i)) !== n ? (s = o, (o = ne(e, o)) !== n ? r + (ne("/", o) || o) : t + s) : (o = ne(r, i)) !== n ? r + o : r == i + "/" ? r : void 0 } } function ae(t, e) { var n = ie(t); te(t, this, t), this.$$parse = function (r) { function i(t, e, n) { var r, i = /^\/?.*?:(\/.*)/; return 0 === e.indexOf(n) && (e = e.replace(n, "")), i.exec(e) ? t : (r = i.exec(t), r ? r[1] : t) } var o = ne(t, r) || ne(n, r), s = "#" == o.charAt(0) ? ne(e, o) : this.$$html5 ? o : ""; if (!w(s)) throw Qn("ihshprfx", 'Invalid url "{0}", missing hash prefix "{1}".', r, e); ee(s, this, t), this.$$path = i(this.$$path, s, t), this.$$compose() }, this.$$compose = function () { var n = Q(this.$$search), r = this.$$hash ? "#" + Y(this.$$hash) : ""; this.$$url = Gt(this.$$path) + (n ? "?" + n : "") + r, this.$$absUrl = t + (this.$$url ? e + this.$$url : "") }, this.$$rewrite = function (e) { return re(t) == re(e) ? e : void 0 } } function ue(t, e) { this.$$html5 = !0, ae.apply(this, arguments); var n = ie(t); this.$$rewrite = function (r) { var i; return t == re(r) ? r : (i = ne(n, r)) ? t + e + i : n === r + "/" ? n : void 0 } } function ce(t) { return function () { return this[t] } } function le(t, e) { return function (n) { return g(n) ? this[t] : (this[t] = e(n), this.$$compose(), this) } } function fe() { var e = "", n = !1; this.hashPrefix = function (t) { return m(t) ? (e = t, this) : e }, this.html5Mode = function (t) { return m(t) ? (n = t, this) : n }, this.$get = ["$rootScope", "$browser", "$sniffer", "$rootElement", function (r, i, o, s) { function a(t) { r.$broadcast("$locationChangeSuccess", u.absUrl(), t) } var u, c, l, f = i.baseHref(), h = i.url(); n ? (l = oe(h) + (f || "/"), c = o.history ? se : ue) : (l = re(h), c = ae), u = new c(l, "#" + e), u.$$parse(u.$$rewrite(h)), s.on("click", function (e) { if (!e.ctrlKey && !e.metaKey && 2 != e.which) { for (var n = hn(e.target) ; "a" !== sn(n[0].nodeName) ;) if (n[0] === s[0] || !(n = n.parent())[0]) return; var o = n.prop("href"); y(o) && "[object SVGAnimatedString]" === o.toString() && (o = je(o.animVal).href); var a = u.$$rewrite(o); o && !n.attr("target") && a && !e.isDefaultPrevented() && (e.preventDefault(), a != i.url() && (u.$$parse(a), r.$apply(), t.angular["ff-684208-preventDefault"] = !0)) } }), u.absUrl() != h && i.url(u.absUrl(), !0), i.onUrlChange(function (t) { u.absUrl() != t && (r.$evalAsync(function () { var e = u.absUrl(); u.$$parse(t), r.$broadcast("$locationChangeStart", t, e).defaultPrevented ? (u.$$parse(e), i.url(e)) : a(e) }), r.$$phase || r.$digest()) }); var p = 0; return r.$watch(function () { var t = i.url(), e = u.$$replace; return p && t == u.absUrl() || (p++, r.$evalAsync(function () { r.$broadcast("$locationChangeStart", u.absUrl(), t).defaultPrevented ? u.$$parse(t) : (i.url(u.absUrl(), e), a(t)) })), u.$$replace = !1, p }), u }] } function he() { var t = !0, e = this; this.debugEnabled = function (e) { return m(e) ? (t = e, this) : t }, this.$get = ["$window", function (n) { function r(t) { return t instanceof Error && (t.stack ? t = t.message && -1 === t.stack.indexOf(t.message) ? "Error: " + t.message + "\n" + t.stack : t.stack : t.sourceURL && (t = t.message + "\n" + t.sourceURL + ":" + t.line)), t } function i(t) { var e = n.console || {}, i = e[t] || e.log || d, s = !1; try { s = !!i.apply } catch (a) { } return s ? function () { var t = []; return o(arguments, function (e) { t.push(r(e)) }), i.apply(e, t) } : function (t, e) { i(t, null == e ? "" : e) } } return { log: i("log"), info: i("info"), warn: i("warn"), error: i("error"), debug: function () { var n = i("debug"); return function () { t && n.apply(e, arguments) } }() } }] } function pe(t, e) { if ("constructor" === t) throw Kn("isecfld", 'Referencing "constructor" field in Angular expressions is disallowed! Expression: {0}', e); return t } function de(t, e) { if (t) { if (t.constructor === t) throw Kn("isecfn", "Referencing Function in Angular expressions is disallowed! Expression: {0}", e); if (t.document && t.location && t.alert && t.setInterval) throw Kn("isecwindow", "Referencing the Window in Angular expressions is disallowed! Expression: {0}", e); if (t.children && (t.nodeName || t.on && t.find)) throw Kn("isecdom", "Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}", e) } return t } function $e(t, e, r, i, o) { o = o || {}; for (var s, a = e.split("."), u = 0; a.length > 1; u++) { s = pe(a.shift(), i); var c = t[s]; c || (c = {}, t[s] = c), t = c, t.then && o.unwrapPromises && (Yn(i), "$$v" in t || !function (t) { t.then(function (e) { t.$$v = e }) }(t), t.$$v === n && (t.$$v = {}), t = t.$$v) } return s = pe(a.shift(), i), t[s] = r, r } function ve(t, e, r, i, o, s, a) { return pe(t, s), pe(e, s), pe(r, s), pe(i, s), pe(o, s), a.unwrapPromises ? function (a, u) { var c, l = u && u.hasOwnProperty(t) ? u : a; return null == l ? l : (l = l[t], l && l.then && (Yn(s), "$$v" in l || (c = l, c.$$v = n, c.then(function (t) { c.$$v = t })), l = l.$$v), e ? null == l ? n : (l = l[e], l && l.then && (Yn(s), "$$v" in l || (c = l, c.$$v = n, c.then(function (t) { c.$$v = t })), l = l.$$v), r ? null == l ? n : (l = l[r], l && l.then && (Yn(s), "$$v" in l || (c = l, c.$$v = n, c.then(function (t) { c.$$v = t })), l = l.$$v), i ? null == l ? n : (l = l[i], l && l.then && (Yn(s), "$$v" in l || (c = l, c.$$v = n, c.then(function (t) { c.$$v = t })), l = l.$$v), o ? null == l ? n : (l = l[o], l && l.then && (Yn(s), "$$v" in l || (c = l, c.$$v = n, c.then(function (t) { c.$$v = t })), l = l.$$v), l) : l) : l) : l) : l) } : function (s, a) { var u = a && a.hasOwnProperty(t) ? a : s; return null == u ? u : (u = u[t], e ? null == u ? n : (u = u[e], r ? null == u ? n : (u = u[r], i ? null == u ? n : (u = u[i], o ? null == u ? n : u = u[o] : u) : u) : u) : u) } } function ge(t, e) { return pe(t, e), function (e, r) { return null == e ? n : (r && r.hasOwnProperty(t) ? r : e)[t] } } function me(t, e, r) { return pe(t, r), pe(e, r), function (r, i) { return null == r ? n : (r = (i && i.hasOwnProperty(t) ? i : r)[t], null == r ? n : r[e]) } } function ye(t, e, r) { if (nr.hasOwnProperty(t)) return nr[t]; var i, s = t.split("."), a = s.length; if (e.unwrapPromises || 1 !== a) if (e.unwrapPromises || 2 !== a) if (e.csp) i = 6 > a ? ve(s[0], s[1], s[2], s[3], s[4], r, e) : function (t, i) { var o, u = 0; do o = ve(s[u++], s[u++], s[u++], s[u++], s[u++], r, e)(t, i), i = n, t = o; while (a > u); return o }; else { var u = "var p;\n"; o(s, function (t, n) { pe(t, r), u += "if(s == null) return undefined;\ns=" + (n ? "s" : '((k&&k.hasOwnProperty("' + t + '"))?k:s)') + '["' + t + '"];\n' + (e.unwrapPromises ? 'if (s && s.then) {\n pw("' + r.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' : "") }), u += "return s;"; var c = new Function("s", "k", "pw", u); c.toString = v(u), i = e.unwrapPromises ? function (t, e) { return c(t, e, Yn) } : c } else i = me(s[0], s[1], r); else i = ge(s[0], r); return "hasOwnProperty" !== t && (nr[t] = i), i } function we() { var t = {}, e = { csp: !1, unwrapPromises: !1, logPromiseWarnings: !0 }; this.unwrapPromises = function (t) { return m(t) ? (e.unwrapPromises = !!t, this) : e.unwrapPromises }, this.logPromiseWarnings = function (t) { return m(t) ? (e.logPromiseWarnings = t, this) : e.logPromiseWarnings }, this.$get = ["$filter", "$sniffer", "$log", function (n, r, i) { return e.csp = r.csp, Yn = function (t) { e.logPromiseWarnings && !Xn.hasOwnProperty(t) && (Xn[t] = !0, i.warn("[$parse] Promise found in the expression `" + t + "`. Automatic unwrapping of promises in Angular expressions is deprecated.")) }, function (r) { var i; switch (typeof r) { case "string": if (t.hasOwnProperty(r)) return t[r]; var o = new tr(e), s = new er(o, n, e); return i = s.parse(r, !1), "hasOwnProperty" !== r && (t[r] = i), i; case "function": return r; default: return d } } }] } function xe() { this.$get = ["$rootScope", "$exceptionHandler", function (t, e) { return be(function (e) { t.$evalAsync(e) }, e) }] } function be(t, e) { function r(t) { return t } function i(t) { return c(t) } function s(t) { var e = a(), n = 0, r = S(t) ? [] : {}; return o(t, function (t, i) { n++, u(t).then(function (t) { r.hasOwnProperty(i) || (r[i] = t, --n || e.resolve(r)) }, function (t) { r.hasOwnProperty(i) || e.reject(t) }) }), 0 === n && e.resolve(r), e.promise } var a = function () { var o, s, c = []; return s = { resolve: function (e) { if (c) { var r = c; c = n, o = u(e), r.length && t(function () { for (var t, e = 0, n = r.length; n > e; e++) t = r[e], o.then(t[0], t[1], t[2]) }) } }, reject: function (t) { s.resolve(l(t)) }, notify: function (e) { if (c) { var n = c; c.length && t(function () { for (var t, r = 0, i = n.length; i > r; r++) t = n[r], t[2](e) }) } }, promise: { then: function (t, n, s) { var u = a(), l = function (n) { try { u.resolve((C(t) ? t : r)(n)) } catch (i) { u.reject(i), e(i) } }, f = function (t) { try { u.resolve((C(n) ? n : i)(t)) } catch (r) { u.reject(r), e(r) } }, h = function (t) { try { u.notify((C(s) ? s : r)(t)) } catch (n) { e(n) } }; return c ? c.push([l, f, h]) : o.then(l, f, h), u.promise }, "catch": function (t) { return this.then(null, t) }, "finally": function (t) { function e(t, e) { var n = a(); return e ? n.resolve(t) : n.reject(t), n.promise } function n(n, i) { var o = null; try { o = (t || r)() } catch (s) { return e(s, !1) } return o && C(o.then) ? o.then(function () { return e(n, i) }, function (t) { return e(t, !1) }) : e(n, i) } return this.then(function (t) { return n(t, !0) }, function (t) { return n(t, !1) }) } } } }, u = function (e) { return e && C(e.then) ? e : { then: function (n) { var r = a(); return t(function () { r.resolve(n(e)) }), r.promise } } }, c = function (t) { var e = a(); return e.reject(t), e.promise }, l = function (n) { return { then: function (r, o) { var s = a(); return t(function () { try { s.resolve((C(o) ? o : i)(n)) } catch (t) { s.reject(t), e(t) } }), s.promise } } }, f = function (n, o, s, l) { var f, h = a(), p = function (t) { try { return (C(o) ? o : r)(t) } catch (n) { return e(n), c(n) } }, d = function (t) { try { return (C(s) ? s : i)(t) } catch (n) { return e(n), c(n) } }, $ = function (t) { try { return (C(l) ? l : r)(t) } catch (n) { e(n) } }; return t(function () { u(n).then(function (t) { f || (f = !0, h.resolve(u(t).then(p, d, $))) }, function (t) { f || (f = !0, h.resolve(d(t))) }, function (t) { f || h.notify($(t)) }) }), h.promise }; return { defer: a, reject: c, when: f, all: s } } function Se() { var t = 10, e = r("$rootScope"), n = null; this.digestTtl = function (e) { return arguments.length && (t = e), t }, this.$get = ["$injector", "$exceptionHandler", "$parse", "$browser", function (r, s, a, u) { function l() { this.$id = c(), 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 f(t) { if (g.$$phase) throw e("inprog", "{0} already in progress", g.$$phase); g.$$phase = t } function h() { g.$$phase = null } function p(t, e) { var n = a(t); return nt(n, e), n } function $(t, e, n) { do t.$$listenerCount[n] -= e, 0 === t.$$listenerCount[n] && delete t.$$listenerCount[n]; while (t = t.$parent) } function v() { } l.prototype = { constructor: l, $new: function (t) { var e, n; return t ? (n = new l, n.$root = this.$root, n.$$asyncQueue = this.$$asyncQueue, n.$$postDigestQueue = this.$$postDigestQueue) : (e = function () { }, e.prototype = this, n = new e, n.$id = c()), n["this"] = n, n.$$listeners = {}, n.$$listenerCount = {}, n.$parent = this, n.$$watchers = n.$$nextSibling = n.$$childHead = n.$$childTail = null, n.$$prevSibling = this.$$childTail, this.$$childHead ? (this.$$childTail.$$nextSibling = n, this.$$childTail = n) : this.$$childHead = this.$$childTail = n, n }, $watch: function (t, e, r) { var i = this, o = p(t, "watch"), s = i.$$watchers, a = { fn: e, last: v, get: o, exp: t, eq: !!r }; if (n = null, !C(e)) { var u = p(e || d, "listener"); a.fn = function (t, e, n) { u(n) } } if ("string" == typeof t && o.constant) { var c = a.fn; a.fn = function (t, e, n) { c.call(this, t, e, n), N(s, a) } } return s || (s = i.$$watchers = []), s.unshift(a), function () { N(s, a), n = null } }, $watchCollection: function (t, e) { function n() { s = l(u); var t, e; if (y(s)) if (i(s)) { o !== f && (o = f, p = o.length = 0, c++), t = s.length, p !== t && (c++, o.length = p = t); for (var n = 0; t > n; n++) o[n] !== s[n] && (c++, o[n] = s[n]) } else { o !== h && (o = h = {}, p = 0, c++), t = 0; for (e in s) s.hasOwnProperty(e) && (t++, o.hasOwnProperty(e) ? o[e] !== s[e] && (c++, o[e] = s[e]) : (p++, o[e] = s[e], c++)); if (p > t) { c++; for (e in o) o.hasOwnProperty(e) && !s.hasOwnProperty(e) && (p--, delete o[e]) } } else o !== s && (o = s, c++); return c } function r() { e(s, o, u) } var o, s, u = this, c = 0, l = a(t), f = [], h = {}, p = 0; return this.$watch(n, r) }, $digest: function () { var r, i, o, a, u, c, l, p, d, $, g, m = this.$$asyncQueue, y = this.$$postDigestQueue, w = t, x = this, b = []; f("$digest"), n = null; do { for (c = !1, p = x; m.length;) { try { g = m.shift(), g.scope.$eval(g.expression) } catch (S) { h(), s(S) } n = null }t: do { if (a = p.$$watchers) for (u = a.length; u--;) try { if (r = a[u]) if ((i = r.get(p)) === (o = r.last) || (r.eq ? q(i, o) : "number" == typeof i && "number" == typeof o && isNaN(i) && isNaN(o))) { if (r === n) { c = !1; break t } } else c = !0, n = r, r.last = r.eq ? D(i) : i, r.fn(i, o === v ? i : o, p), 5 > w && (d = 4 - w, b[d] || (b[d] = []), $ = C(r.exp) ? "fn: " + (r.exp.name || r.exp.toString()) : r.exp, $ += "; newVal: " + F(i) + "; oldVal: " + F(o), b[d].push($)) } catch (S) { h(), s(S) } if (!(l = p.$$childHead || p !== x && p.$$nextSibling)) for (; p !== x && !(l = p.$$nextSibling) ;) p = p.$parent } while (p = l); if ((c || m.length) && !w--) throw h(), e("infdig", "{0} $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: {1}", t, F(b)) } while (c || m.length); for (h() ; y.length;) try { y.shift()() } catch (S) { s(S) } }, $destroy: function () { if (!this.$$destroyed) { var t = this.$parent; this.$broadcast("$destroy"), this.$$destroyed = !0, this !== g && (o(this.$$listenerCount, _(null, $, this)), t.$$childHead == this && (t.$$childHead = this.$$nextSibling), t.$$childTail == this && (t.$$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 = null) } }, $eval: function (t, e) { return a(t)(this, e) }, $evalAsync: function (t) { g.$$phase || g.$$asyncQueue.length || u.defer(function () { g.$$asyncQueue.length && g.$digest() }), this.$$asyncQueue.push({ scope: this, expression: t }) }, $$postDigest: function (t) { this.$$postDigestQueue.push(t) }, $apply: function (t) { try { return f("$apply"), this.$eval(t) } catch (e) { s(e) } finally { h(); try { g.$digest() } catch (e) { throw s(e), e } } }, $on: function (t, e) { var n = this.$$listeners[t]; n || (this.$$listeners[t] = n = []), n.push(e); var r = this; do r.$$listenerCount[t] || (r.$$listenerCount[t] = 0), r.$$listenerCount[t]++; while (r = r.$parent); var i = this; return function () { n[j(n, e)] = null, $(i, 1, t) } }, $emit: function (t, e) { var n, r, i, o = [], a = this, u = !1, c = { name: t, targetScope: a, stopPropagation: function () { u = !0 }, preventDefault: function () { c.defaultPrevented = !0 }, defaultPrevented: !1 }, l = I([c], arguments, 1); do { for (n = a.$$listeners[t] || o, c.currentScope = a, r = 0, i = n.length; i > r; r++) if (n[r]) try { n[r].apply(null, l) } catch (f) { s(f) } else n.splice(r, 1), r--, i--; if (u) return c; a = a.$parent } while (a); return c }, $broadcast: function (t, e) { for (var n, r, i, o = this, a = o, u = o, c = { name: t, targetScope: o, preventDefault: function () { c.defaultPrevented = !0 }, defaultPrevented: !1 }, l = I([c], arguments, 1) ; a = u;) { for (c.currentScope = a, n = a.$$listeners[t] || [], r = 0, i = n.length; i > r; r++) if (n[r]) try { n[r].apply(null, l) } catch (f) { s(f) } else n.splice(r, 1), r--, i--; if (!(u = a.$$listenerCount[t] && a.$$childHead || a !== o && a.$$nextSibling)) for (; a !== o && !(u = a.$$nextSibling) ;) a = a.$parent } return c } }; var g = new l; return g }] } function Ce() { var t = /^\s*(https?|ftp|mailto|tel|file):/, e = /^\s*(https?|ftp|file):|data:image\//; this.aHrefSanitizationWhitelist = function (e) { return m(e) ? (t = e, this) : t }, this.imgSrcSanitizationWhitelist = function (t) { return m(t) ? (e = t, this) : e }, this.$get = function () { return function (n, r) { var i, o = r ? e : t; return fn && !(fn >= 8) || (i = je(n).href, "" === i || i.match(o)) ? n : "unsafe:" + i } } } function Ee(t) { return t.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1").replace(/\x08/g, "\\x08") } function ke(t) { if ("self" === t) return t; if (w(t)) { if (t.indexOf("***") > -1) throw rr("iwcard", "Illegal sequence *** in string matcher.  String: {0}", t); return t = Ee(t).replace("\\*\\*", ".*").replace("\\*", "[^:/.?&;]*"), new RegExp("^" + t + "$") } if (E(t)) return new RegExp("^" + t.source + "$"); throw rr("imatcher", 'Matchers may only be "self", string patterns or RegExp objects') } function Ae(t) { var e = []; return m(t) && o(t, function (t) { e.push(ke(t)) }), e } function Oe() { this.SCE_CONTEXTS = ir; var t = ["self"], e = []; this.resourceUrlWhitelist = function (e) { return arguments.length && (t = Ae(e)), t }, this.resourceUrlBlacklist = function (t) { return arguments.length && (e = Ae(t)), e }, this.$get = ["$injector", function (r) { function i(t, e) { return "self" === t ? Ne(e) : !!t.exec(e.href) } function o(n) { var r, o, s = je(n.toString()), a = !1; for (r = 0, o = t.length; o > r; r++) if (i(t[r], s)) { a = !0; break } if (a) for (r = 0, o = e.length; o > r; r++) if (i(e[r], s)) { a = !1; break } return a } function s(t) { var e = function (t) { this.$$unwrapTrustedValue = function () { return t } }; return t && (e.prototype = new t), e.prototype.valueOf = function () { return this.$$unwrapTrustedValue() }, e.prototype.toString = function () { return this.$$unwrapTrustedValue().toString() }, e } function a(t, e) { var r = h.hasOwnProperty(t) ? h[t] : null; if (!r) throw rr("icontext", "Attempted to trust a value in invalid context. Context: {0}; Value: {1}", t, e); if (null === e || e === n || "" === e) return e; if ("string" != typeof e) throw rr("itype", "Attempted to trust a non-string value in a content requiring a string: Context: {0}", t); return new r(e) } function u(t) { return t instanceof f ? t.$$unwrapTrustedValue() : t } function c(t, e) { if (null === e || e === n || "" === e) return e; var r = h.hasOwnProperty(t) ? h[t] : null; if (r && e instanceof r) return e.$$unwrapTrustedValue(); if (t === ir.RESOURCE_URL) { if (o(e)) return e; throw rr("insecurl", "Blocked loading resource from url not allowed by $sceDelegate policy.  URL: {0}", e.toString()) } if (t === ir.HTML) return l(e); throw rr("unsafe", "Attempting to use an unsafe value in a safe context.") } var l = function (t) { throw rr("unsafe", "Attempting to use an unsafe value in a safe context.") }; r.has("$sanitize") && (l = r.get("$sanitize")); var f = s(), h = {}; return h[ir.HTML] = s(f), h[ir.CSS] = s(f), h[ir.URL] = s(f), h[ir.JS] = s(f), h[ir.RESOURCE_URL] = s(h[ir.URL]), { trustAs: a, getTrusted: c, valueOf: u } }] } function Te() { var t = !0; this.enabled = function (e) { return arguments.length && (t = !!e), t }, this.$get = ["$parse", "$sniffer", "$sceDelegate", function (e, n, r) { if (t && n.msie && n.msieDocumentMode < 8) throw rr("iequirks", "Strict Contextual Escaping does not support Internet Explorer version < 9 in quirks mode.  You can fix this by adding the text <!doctype html> to the top of your HTML document.  See http://docs.angularjs.org/api/ng.$sce for more information."); var i = D(ir); i.isEnabled = function () { return t }, i.trustAs = r.trustAs, i.getTrusted = r.getTrusted, i.valueOf = r.valueOf, t || (i.trustAs = i.getTrusted = function (t, e) { return e }, i.valueOf = $), i.parseAs = function (t, n) { var r = e(n); return r.literal && r.constant ? r : function (e, n) { return i.getTrusted(t, r(e, n)) } }; var s = i.parseAs, a = i.getTrusted, u = i.trustAs; return o(ir, function (t, e) { var n = sn(e); i[ct("parse_as_" + n)] = function (e) { return s(t, e) }, i[ct("get_trusted_" + n)] = function (e) { return a(t, e) }, i[ct("trust_as_" + n)] = function (e) { return u(t, e) } }), i }] } function Me() { this.$get = ["$window", "$document", function (t, e) { var n, r, i = {}, o = h((/android (\d+)/.exec(sn((t.navigator || {}).userAgent)) || [])[1]), s = /Boxee/i.test((t.navigator || {}).userAgent), a = e[0] || {}, u = a.documentMode, c = /^(Moz|webkit|O|ms)(?=[A-Z])/, l = a.body && a.body.style, f = !1, p = !1; if (l) { for (var d in l) if (r = c.exec(d)) { n = r[0], n = n.substr(0, 1).toUpperCase() + n.substr(1); break } n || (n = "WebkitOpacity" in l && "webkit"), f = !!("transition" in l || n + "Transition" in l), p = !!("animation" in l || n + "Animation" in l), !o || f && p || (f = w(a.body.style.webkitTransition), p = w(a.body.style.webkitAnimation)) } return { history: !(!t.history || !t.history.pushState || 4 > o || s), hashchange: "onhashchange" in t && (!u || u > 7), hasEvent: function (t) { if ("input" == t && 9 == fn) return !1; if (g(i[t])) { var e = a.createElement("div"); i[t] = "on" + t in e } return i[t] }, csp: V(), vendorPrefix: n, transitions: f, animations: p, android: o, msie: fn, msieDocumentMode: u } }] } function Pe() { this.$get = ["$rootScope", "$browser", "$q", "$exceptionHandler", function (t, e, n, r) { function i(i, s, a) { var u, c = n.defer(), l = c.promise, f = m(a) && !a; return u = e.defer(function () { try { c.resolve(i()) } catch (e) { c.reject(e), r(e) } finally { delete o[l.$$timeoutId] } f || t.$apply() }, s), l.$$timeoutId = u, o[u] = c, l } var o = {}; return i.cancel = function (t) { return t && t.$$timeoutId in o ? (o[t.$$timeoutId].reject("canceled"), delete o[t.$$timeoutId], e.defer.cancel(t.$$timeoutId)) : !1 }, i }] } function je(t, e) { var n = t; return fn && (or.setAttribute("href", n), n = or.href), or.setAttribute("href", n), { href: or.href, protocol: or.protocol ? or.protocol.replace(/:$/, "") : "", host: or.host, search: or.search ? or.search.replace(/^\?/, "") : "", hash: or.hash ? or.hash.replace(/^#/, "") : "", hostname: or.hostname, port: or.port, pathname: "/" === or.pathname.charAt(0) ? or.pathname : "/" + or.pathname } } function Ne(t) { var e = w(t) ? je(t) : t; return e.protocol === sr.protocol && e.host === sr.host } function De() { this.$get = v(t) } function Re(t) { function e(r, i) { if (y(r)) { var s = {}; return o(r, function (t, n) { s[n] = e(n, t) }), s } return t.factory(r + n, i) } var n = "Filter"; this.register = e, this.$get = ["$injector", function (t) { return function (e) { return t.get(e + n) } }], e("currency", Ve), e("date", ze), e("filter", qe), e("json", We), e("limitTo", Je), e("lowercase", fr), e("number", Ie), e("orderBy", Qe), e("uppercase", hr) } function qe() { return function (t, e, n) { if (!S(t)) return t; var r = typeof n, i = []; i.check = function (t) { for (var e = 0; e < i.length; e++) if (!i[e](t)) return !1; return !0 }, "function" !== r && (n = "boolean" === r && n ? function (t, e) { return wn.equals(t, e) } : function (t, e) { if (t && e && "object" == typeof t && "object" == typeof e) { for (var r in t) if ("$" !== r.charAt(0) && an.call(t, r) && n(t[r], e[r])) return !0; return !1 } return e = ("" + e).toLowerCase(), ("" + t).toLowerCase().indexOf(e) > -1 }); var o = function (t, e) { if ("string" == typeof e && "!" === e.charAt(0)) return !o(t, e.substr(1)); switch (typeof t) { case "boolean": case "number": case "string": return n(t, e); case "object": switch (typeof e) { case "object": return n(t, e); default: for (var r in t) if ("$" !== r.charAt(0) && o(t[r], e)) return !0 } return !1; case "array": for (var i = 0; i < t.length; i++) if (o(t[i], e)) return !0; return !1; default: return !1 } }; switch (typeof e) { case "boolean": case "number": case "string": e = { $: e }; case "object": for (var s in e) !function (t) { "undefined" != typeof e[t] && i.push(function (n) { return o("$" == t ? n : n && n[t], e[t]) }) }(s); break; case "function": i.push(e); break; default: return t } for (var a = [], u = 0; u < t.length; u++) { var c = t[u]; i.check(c) && a.push(c) } return a } } function Ve(t) { var e = t.NUMBER_FORMATS; return function (t, n) { return g(n) && (n = e.CURRENCY_SYM), Ue(t, e.PATTERNS[1], e.GROUP_SEP, e.DECIMAL_SEP, 2).replace(/\u00A4/g, n) } } function Ie(t) { var e = t.NUMBER_FORMATS; return function (t, n) { return Ue(t, e.PATTERNS[0], e.GROUP_SEP, e.DECIMAL_SEP, n) } } function Ue(t, e, n, r, i) { if (isNaN(t) || !isFinite(t)) return ""; var o = 0 > t; t = Math.abs(t); var s = t + "", a = "", u = [], c = !1; if (-1 !== s.indexOf("e")) { var l = s.match(/([\d\.]+)e(-?)(\d+)/); l && "-" == l[2] && l[3] > i + 1 ? s = "0" : (a = s, c = !0) } if (c) i > 0 && t > -1 && 1 > t && (a = t.toFixed(i)); else { var f = (s.split(ar)[1] || "").length; g(i) && (i = Math.min(Math.max(e.minFrac, f), e.maxFrac)); var h = Math.pow(10, i); t = Math.round(t * h) / h; var p = ("" + t).split(ar), d = p[0]; p = p[1] || ""; var $, v = 0, m = e.lgSize, y = e.gSize; if (d.length >= m + y) for (v = d.length - m, $ = 0; v > $; $++) (v - $) % y === 0 && 0 !== $ && (a += n), a += d.charAt($); for ($ = v; $ < d.length; $++) (d.length - $) % m === 0 && 0 !== $ && (a += n), a += d.charAt($); for (; p.length < i;) p += "0"; i && "0" !== i && (a += r + p.substr(0, i)) } return u.push(o ? e.negPre : e.posPre), u.push(a), u.push(o ? e.negSuf : e.posSuf), u.join("") } function _e(t, e, n) { var r = ""; for (0 > t && (r = "-", t = -t), t = "" + t; t.length < e;) t = "0" + t; return n && (t = t.substr(t.length - e)), r + t } function He(t, e, n, r) { return n = n || 0, function (i) { var o = i["get" + t](); return (n > 0 || o > -n) && (o += n), 0 === o && -12 == n && (o = 12), _e(o, e, r) } } function Fe(t, e) {
        return function (n, r) {
            var i = n["get" + t](), o = un(e ? "SHORT" + t : t);
            return r[o][i]
        }
    } function Le(t) { var e = -1 * t.getTimezoneOffset(), n = e >= 0 ? "+" : ""; return n += _e(Math[e > 0 ? "floor" : "ceil"](e / 60), 2) + _e(Math.abs(e % 60), 2) } function Be(t, e) { return t.getHours() < 12 ? e.AMPMS[0] : e.AMPMS[1] } function ze(t) { function e(t) { var e; if (e = t.match(n)) { var r = new Date(0), i = 0, o = 0, s = e[8] ? r.setUTCFullYear : r.setFullYear, a = e[8] ? r.setUTCHours : r.setHours; e[9] && (i = h(e[9] + e[10]), o = h(e[9] + e[11])), s.call(r, h(e[1]), h(e[2]) - 1, h(e[3])); var u = h(e[4] || 0) - i, c = h(e[5] || 0) - o, l = h(e[6] || 0), f = Math.round(1e3 * parseFloat("0." + (e[7] || 0))); return a.call(r, u, c, l, f), r } return t } var n = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/; return function (n, r) { var i, s, a = "", u = []; if (r = r || "mediumDate", r = t.DATETIME_FORMATS[r] || r, w(n) && (n = lr.test(n) ? h(n) : e(n)), x(n) && (n = new Date(n)), !b(n)) return n; for (; r;) s = cr.exec(r), s ? (u = I(u, s, 1), r = u.pop()) : (u.push(r), r = null); return o(u, function (e) { i = ur[e], a += i ? i(n, t.DATETIME_FORMATS) : e.replace(/(^'|'$)/g, "").replace(/''/g, "'") }), a } } function We() { return function (t) { return F(t, !0) } } function Je() { return function (t, e) { if (!S(t) && !w(t)) return t; if (e = h(e), w(t)) return e ? e >= 0 ? t.slice(0, e) : t.slice(e, t.length) : ""; var n, r, i = []; for (e > t.length ? e = t.length : e < -t.length && (e = -t.length), e > 0 ? (n = 0, r = e) : (n = t.length + e, r = t.length) ; r > n; n++) i.push(t[n]); return i } } function Qe(t) { return function (e, n, r) { function i(t, e) { for (var r = 0; r < n.length; r++) { var i = n[r](t, e); if (0 !== i) return i } return 0 } function o(t, e) { return B(e) ? function (e, n) { return t(n, e) } : t } function s(t, e) { var n = typeof t, r = typeof e; return n == r ? ("string" == n && (t = t.toLowerCase(), e = e.toLowerCase()), t === e ? 0 : e > t ? -1 : 1) : r > n ? -1 : 1 } if (!S(e)) return e; if (!n) return e; n = S(n) ? n : [n], n = M(n, function (e) { var n = !1, r = e || $; return w(e) && (("+" == e.charAt(0) || "-" == e.charAt(0)) && (n = "-" == e.charAt(0), e = e.substring(1)), r = t(e)), o(function (t, e) { return s(r(t), r(e)) }, n) }); for (var a = [], u = 0; u < e.length; u++) a.push(e[u]); return a.sort(o(i, r)) } } function Ye(t) { return C(t) && (t = { link: t }), t.restrict = t.restrict || "AC", v(t) } function Ke(t, e) { function n(e, n) { n = n ? "-" + G(n, "-") : "", t.removeClass((e ? Er : Cr) + n).addClass((e ? Cr : Er) + n) } var r = this, i = t.parent().controller("form") || $r, s = 0, a = r.$error = {}, u = []; r.$name = e.name || e.ngForm, r.$dirty = !1, r.$pristine = !0, r.$valid = !0, r.$invalid = !1, i.$addControl(r), t.addClass(kr), n(!0), r.$addControl = function (t) { rt(t.$name, "input"), u.push(t), t.$name && (r[t.$name] = t) }, r.$removeControl = function (t) { t.$name && r[t.$name] === t && delete r[t.$name], o(a, function (e, n) { r.$setValidity(n, !0, t) }), N(u, t) }, r.$setValidity = function (t, e, o) { var u = a[t]; if (e) u && (N(u, o), u.length || (s--, s || (n(e), r.$valid = !0, r.$invalid = !1), a[t] = !1, n(!0, t), i.$setValidity(t, !0, r))); else { if (s || n(e), u) { if (P(u, o)) return } else a[t] = u = [], s++, n(!1, t), i.$setValidity(t, !1, r); u.push(o), r.$valid = !1, r.$invalid = !0 } }, r.$setDirty = function () { t.removeClass(kr).addClass(Ar), r.$dirty = !0, r.$pristine = !1, i.$setDirty() }, r.$setPristine = function () { t.removeClass(Ar).addClass(kr), r.$dirty = !1, r.$pristine = !0, o(u, function (t) { t.$setPristine() }) } } function Xe(t, e, r, i) { return t.$setValidity(e, r), r ? i : n } function Ze(t, e, n, i, o, s) { if (!o.android) { var a = !1; e.on("compositionstart", function (t) { a = !0 }), e.on("compositionend", function () { a = !1, u() }) } var u = function () { if (!a) { var r = e.val(); B(n.ngTrim || "T") && (r = bn(r)), i.$viewValue !== r && (t.$$phase ? i.$setViewValue(r) : t.$apply(function () { i.$setViewValue(r) })) } }; if (o.hasEvent("input")) e.on("input", u); else { var c, l = function () { c || (c = s.defer(function () { u(), c = null })) }; e.on("keydown", function (t) { var e = t.keyCode; 91 === e || e > 15 && 19 > e || e >= 37 && 40 >= e || l() }), o.hasEvent("paste") && e.on("paste cut", l) } e.on("change", u), i.$render = function () { e.val(i.$isEmpty(i.$viewValue) ? "" : i.$viewValue) }; var f, p, d = n.ngPattern; if (d) { var $ = function (t, e) { return Xe(i, "pattern", i.$isEmpty(e) || t.test(e), e) }; p = d.match(/^\/(.*)\/([gim]*)$/), p ? (d = new RegExp(p[1], p[2]), f = function (t) { return $(d, t) }) : f = function (n) { var i = t.$eval(d); if (!i || !i.test) throw r("ngPattern")("noregexp", "Expected {0} to be a RegExp but was {1}. Element: {2}", d, i, z(e)); return $(i, n) }, i.$formatters.push(f), i.$parsers.push(f) } if (n.ngMinlength) { var v = h(n.ngMinlength), g = function (t) { return Xe(i, "minlength", i.$isEmpty(t) || t.length >= v, t) }; i.$parsers.push(g), i.$formatters.push(g) } if (n.ngMaxlength) { var m = h(n.ngMaxlength), y = function (t) { return Xe(i, "maxlength", i.$isEmpty(t) || t.length <= m, t) }; i.$parsers.push(y), i.$formatters.push(y) } } function Ge(t, e, r, i, o, s) { if (Ze(t, e, r, i, o, s), i.$parsers.push(function (t) { var e = i.$isEmpty(t); return e || xr.test(t) ? (i.$setValidity("number", !0), "" === t ? null : e ? t : parseFloat(t)) : (i.$setValidity("number", !1), n) }), i.$formatters.push(function (t) { return i.$isEmpty(t) ? "" : "" + t }), r.min) { var a = function (t) { var e = parseFloat(r.min); return Xe(i, "min", i.$isEmpty(t) || t >= e, t) }; i.$parsers.push(a), i.$formatters.push(a) } if (r.max) { var u = function (t) { var e = parseFloat(r.max); return Xe(i, "max", i.$isEmpty(t) || e >= t, t) }; i.$parsers.push(u), i.$formatters.push(u) } i.$formatters.push(function (t) { return Xe(i, "number", i.$isEmpty(t) || x(t), t) }) } function tn(t, e, n, r, i, o) { Ze(t, e, n, r, i, o); var s = function (t) { return Xe(r, "url", r.$isEmpty(t) || yr.test(t), t) }; r.$formatters.push(s), r.$parsers.push(s) } function en(t, e, n, r, i, o) { Ze(t, e, n, r, i, o); var s = function (t) { return Xe(r, "email", r.$isEmpty(t) || wr.test(t), t) }; r.$formatters.push(s), r.$parsers.push(s) } function nn(t, e, n, r) { g(n.name) && e.attr("name", c()), e.on("click", function () { e[0].checked && t.$apply(function () { r.$setViewValue(n.value) }) }), r.$render = function () { var t = n.value; e[0].checked = t == r.$viewValue }, n.$observe("value", r.$render) } function rn(t, e, n, r) { var i = n.ngTrueValue, o = n.ngFalseValue; w(i) || (i = !0), w(o) || (o = !1), e.on("click", function () { t.$apply(function () { r.$setViewValue(e[0].checked) }) }), r.$render = function () { e[0].checked = r.$viewValue }, r.$isEmpty = function (t) { return t !== i }, r.$formatters.push(function (t) { return t === i }), r.$parsers.push(function (t) { return t ? i : o }) } function on(t, e) { return t = "ngClass" + t, function () { return { restrict: "AC", link: function (n, r, i) { function s(t) { if (e === !0 || n.$index % 2 === e) { var r = a(t || ""); u ? q(t, u) || i.$updateClass(r, a(u)) : i.$addClass(r) } u = D(t) } function a(t) { if (S(t)) return t.join(" "); if (y(t)) { var e = []; return o(t, function (t, n) { t && e.push(n) }), e.join(" ") } return t } var u; n.$watch(i[t], s, !0), i.$observe("class", function (e) { s(n.$eval(i[t])) }), "ngClass" !== t && n.$watch("$index", function (r, o) { var s = 1 & r; if (s !== o & 1) { var u = a(n.$eval(i[t])); s === e ? i.$addClass(u) : i.$removeClass(u) } }) } } } } var sn = function (t) { return w(t) ? t.toLowerCase() : t }, an = Object.prototype.hasOwnProperty, un = function (t) { return w(t) ? t.toUpperCase() : t }, cn = function (t) { return w(t) ? t.replace(/[A-Z]/g, function (t) { return String.fromCharCode(32 | t.charCodeAt(0)) }) : t }, ln = function (t) { return w(t) ? t.replace(/[a-z]/g, function (t) { return String.fromCharCode(-33 & t.charCodeAt(0)) }) : t }; "i" !== "I".toLowerCase() && (sn = cn, un = ln); var fn, hn, pn, dn, $n, vn = [].slice, gn = [].push, mn = Object.prototype.toString, yn = r("ng"), wn = (t.angular, t.angular || (t.angular = {})), xn = ["0", "0", "0"]; fn = h((/msie (\d+)/.exec(sn(navigator.userAgent)) || [])[1]), isNaN(fn) && (fn = h((/trident\/.*; rv:(\d+)/.exec(sn(navigator.userAgent)) || [])[1])), d.$inject = [], $.$inject = []; var bn = function () { return String.prototype.trim ? function (t) { return w(t) ? t.trim() : t } : function (t) { return w(t) ? t.replace(/^\s\s*/, "").replace(/\s\s*$/, "") : t } }(); $n = 9 > fn ? function (t) { return t = t.nodeName ? t : t[0], t.scopeName && "HTML" != t.scopeName ? un(t.scopeName + ":" + t.nodeName) : t.nodeName } : function (t) { return t.nodeName ? t.nodeName : t[0].nodeName }; var Sn = /[A-Z]/g, Cn = { full: "1.2.13", major: 1, minor: 2, dot: 13, codeName: "romantic-transclusion" }, En = ft.cache = {}, kn = ft.expando = "ng-" + (new Date).getTime(), An = 1, On = t.document.addEventListener ? function (t, e, n) { t.addEventListener(e, n, !1) } : function (t, e, n) { t.attachEvent("on" + e, n) }, Tn = t.document.removeEventListener ? function (t, e, n) { t.removeEventListener(e, n, !1) } : function (t, e, n) { t.detachEvent("on" + e, n) }, Mn = (ft._data = function (t) { return this.cache[t[this.expando]] || {} }, /([\:\-\_]+(.))/g), Pn = /^moz([A-Z])/, jn = r("jqLite"), Nn = ft.prototype = { ready: function (n) { function r() { i || (i = !0, n()) } var i = !1; "complete" === e.readyState ? setTimeout(r) : (this.on("DOMContentLoaded", r), ft(t).on("load", r)) }, toString: function () { var t = []; return o(this, function (e) { t.push("" + e) }), "[" + t.join(", ") + "]" }, eq: function (t) { return hn(t >= 0 ? this[t] : this[this.length + t]) }, length: 0, push: gn, sort: [].sort, splice: [].splice }, Dn = {}; o("multiple,selected,checked,disabled,readOnly,required,open".split(","), function (t) { Dn[sn(t)] = t }); var Rn = {}; o("input,select,option,textarea,button,form,details".split(","), function (t) { Rn[un(t)] = !0 }), o({ data: gt, inheritedData: St, scope: function (t) { return hn(t).data("$scope") || St(t.parentNode || t, ["$isolateScope", "$scope"]) }, isolateScope: function (t) { return hn(t).data("$isolateScope") || hn(t).data("$isolateScopeNoTemplate") }, controller: bt, injector: function (t) { return St(t, "$injector") }, removeAttr: function (t, e) { t.removeAttribute(e) }, hasClass: mt, css: function (t, e, r) { if (e = ct(e), !m(r)) { var i; return 8 >= fn && (i = t.currentStyle && t.currentStyle[e], "" === i && (i = "auto")), i = i || t.style[e], 8 >= fn && (i = "" === i ? n : i), i } t.style[e] = r }, attr: function (t, e, r) { var i = sn(e); if (Dn[i]) { if (!m(r)) return t[e] || (t.attributes.getNamedItem(e) || d).specified ? i : n; r ? (t[e] = !0, t.setAttribute(e, i)) : (t[e] = !1, t.removeAttribute(i)) } else if (m(r)) t.setAttribute(e, r); else if (t.getAttribute) { var o = t.getAttribute(e, 2); return null === o ? n : o } }, prop: function (t, e, n) { return m(n) ? void (t[e] = n) : t[e] }, text: function () { function t(t, n) { var r = e[t.nodeType]; return g(n) ? r ? t[r] : "" : void (t[r] = n) } var e = []; return 9 > fn ? (e[1] = "innerText", e[3] = "nodeValue") : e[1] = e[3] = "textContent", t.$dv = "", t }(), val: function (t, e) { if (g(e)) { if ("SELECT" === $n(t) && t.multiple) { var n = []; return o(t.options, function (t) { t.selected && n.push(t.value || t.text) }), 0 === n.length ? null : n } return t.value } t.value = e }, html: function (t, e) { if (g(e)) return t.innerHTML; for (var n = 0, r = t.childNodes; n < r.length; n++) pt(r[n]); t.innerHTML = e }, empty: Ct }, function (t, e) { ft.prototype[e] = function (e, r) { var i, o; if (t !== Ct && (2 == t.length && t !== mt && t !== bt ? e : r) === n) { if (y(e)) { for (i = 0; i < this.length; i++) if (t === gt) t(this[i], e); else for (o in e) t(this[i], o, e[o]); return this } for (var s = t.$dv, a = s === n ? Math.min(this.length, 1) : this.length, u = 0; a > u; u++) { var c = t(this[u], e, r); s = s ? s + c : c } return s } for (i = 0; i < this.length; i++) t(this[i], e, r); return this } }), o({ removeData: $t, dealoc: pt, on: function li(t, n, r, i) { if (m(i)) throw jn("onargs", "jqLite#on() does not support the `selector` or `eventData` parameters"); var s = vt(t, "events"), a = vt(t, "handle"); s || vt(t, "events", s = {}), a || vt(t, "handle", a = kt(t, s)), o(n.split(" "), function (n) { var i = s[n]; if (!i) { if ("mouseenter" == n || "mouseleave" == n) { var o = e.body.contains || e.body.compareDocumentPosition ? function (t, e) { var n = 9 === t.nodeType ? t.documentElement : t, r = e && e.parentNode; return t === r || !(!r || 1 !== r.nodeType || !(n.contains ? n.contains(r) : t.compareDocumentPosition && 16 & t.compareDocumentPosition(r))) } : function (t, e) { if (e) for (; e = e.parentNode;) if (e === t) return !0; return !1 }; s[n] = []; var u = { mouseleave: "mouseout", mouseenter: "mouseover" }; li(t, u[n], function (t) { var e = this, r = t.relatedTarget; (!r || r !== e && !o(e, r)) && a(t, n) }) } else On(t, n, a), s[n] = []; i = s[n] } i.push(r) }) }, off: dt, one: function (t, e, n) { t = hn(t), t.on(e, function r() { t.off(e, n), t.off(e, r) }), t.on(e, n) }, replaceWith: function (t, e) { var n, r = t.parentNode; pt(t), o(new ft(e), function (e) { n ? r.insertBefore(e, n.nextSibling) : r.replaceChild(e, t), n = e }) }, children: function (t) { var e = []; return o(t.childNodes, function (t) { 1 === t.nodeType && e.push(t) }), e }, contents: function (t) { return t.childNodes || [] }, append: function (t, e) { o(new ft(e), function (e) { (1 === t.nodeType || 11 === t.nodeType) && t.appendChild(e) }) }, prepend: function (t, e) { if (1 === t.nodeType) { var n = t.firstChild; o(new ft(e), function (e) { t.insertBefore(e, n) }) } }, wrap: function (t, e) { e = hn(e)[0]; var n = t.parentNode; n && n.replaceChild(e, t), e.appendChild(t) }, remove: function (t) { pt(t); var e = t.parentNode; e && e.removeChild(t) }, after: function (t, e) { var n = t, r = t.parentNode; o(new ft(e), function (t) { r.insertBefore(t, n.nextSibling), n = t }) }, addClass: wt, removeClass: yt, toggleClass: function (t, e, n) { g(n) && (n = !mt(t, e)), (n ? wt : yt)(t, e) }, parent: function (t) { var e = t.parentNode; return e && 11 !== e.nodeType ? e : null }, next: function (t) { if (t.nextElementSibling) return t.nextElementSibling; for (var e = t.nextSibling; null != e && 1 !== e.nodeType;) e = e.nextSibling; return e }, find: function (t, e) { return t.getElementsByTagName ? t.getElementsByTagName(e) : [] }, clone: ht, triggerHandler: function (t, e, n) { var r = (vt(t, "events") || {})[e]; n = n || []; var i = [{ preventDefault: d, stopPropagation: d }]; o(r, function (e) { e.apply(t, i.concat(n)) }) } }, function (t, e) { ft.prototype[e] = function (e, n, r) { for (var i, o = 0; o < this.length; o++) g(i) ? (i = t(this[o], e, n, r), m(i) && (i = hn(i))) : xt(i, t(this[o], e, n, r)); return m(i) ? i : this }, ft.prototype.bind = ft.prototype.on, ft.prototype.unbind = ft.prototype.off }), Ot.prototype = { put: function (t, e) { this[At(t)] = e }, get: function (t) { return this[At(t)] }, remove: function (t) { var e = this[t = At(t)]; return delete this[t], e } }; var qn = /^function\s*[^\(]*\(\s*([^\)]*)\)/m, Vn = /,/, In = /^\s*(_?)(\S+?)\1\s*$/, Un = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm, _n = r("$injector"), Hn = r("$animate"), Fn = ["$provide", function (t) { this.$$selectors = {}, this.register = function (e, n) { var r = e + "-animation"; if (e && "." != e.charAt(0)) throw Hn("notcsel", "Expecting class selector starting with '.' got '{0}'.", e); this.$$selectors[e.substr(1)] = r, t.factory(r, n) }, this.classNameFilter = function (t) { return 1 === arguments.length && (this.$$classNameFilter = t instanceof RegExp ? t : null), this.$$classNameFilter }, this.$get = ["$timeout", function (t) { return { enter: function (e, n, r, i) { r ? r.after(e) : (n && n[0] || (n = r.parent()), n.append(e)), i && t(i, 0, !1) }, leave: function (e, n) { e.remove(), n && t(n, 0, !1) }, move: function (t, e, n, r) { this.enter(t, e, n, r) }, addClass: function (e, n, r) { n = w(n) ? n : S(n) ? n.join(" ") : "", o(e, function (t) { wt(t, n) }), r && t(r, 0, !1) }, removeClass: function (e, n, r) { n = w(n) ? n : S(n) ? n.join(" ") : "", o(e, function (t) { yt(t, n) }), r && t(r, 0, !1) }, setClass: function (e, n, r, i) { o(e, function (t) { wt(t, n), yt(t, r) }), i && t(i, 0, !1) }, enabled: d } }] }], Ln = r("$compile"); qt.$inject = ["$provide", "$$sanitizeUriProvider"]; var Bn = /^(x[\:\-_]|data[\:\-_])/i, zn = r("$interpolate"), Wn = /^([^\?#]*)(\?([^#]*))?(#(.*))?$/, Jn = { http: 80, https: 443, ftp: 21 }, Qn = r("$location"); ue.prototype = ae.prototype = se.prototype = { $$html5: !1, $$replace: !1, absUrl: ce("$$absUrl"), url: function (t, e) { if (g(t)) return this.$$url; var n = Wn.exec(t); return n[1] && this.path(decodeURIComponent(n[1])), (n[2] || n[1]) && this.search(n[3] || ""), this.hash(n[5] || "", e), this }, protocol: ce("$$protocol"), host: ce("$$host"), port: ce("$$port"), path: le("$$path", function (t) { return "/" == t.charAt(0) ? t : "/" + t }), search: function (t, e) { switch (arguments.length) { case 0: return this.$$search; case 1: if (w(t)) this.$$search = J(t); else { if (!y(t)) throw Qn("isrcharg", "The first argument of the `$location#search()` call must be a string or an object."); this.$$search = t } break; default: g(e) || null === e ? delete this.$$search[t] : this.$$search[t] = e } return this.$$compose(), this }, hash: le("$$hash", $), replace: function () { return this.$$replace = !0, this } }; var Yn, Kn = r("$parse"), Xn = {}, Zn = { "null": function () { return null }, "true": function () { return !0 }, "false": function () { return !1 }, undefined: d, "+": function (t, e, r, i) { return r = r(t, e), i = i(t, e), m(r) ? m(i) ? r + i : r : m(i) ? i : n }, "-": function (t, e, n, r) { return n = n(t, e), r = r(t, e), (m(n) ? n : 0) - (m(r) ? r : 0) }, "*": function (t, e, n, r) { return n(t, e) * r(t, e) }, "/": function (t, e, n, r) { return n(t, e) / r(t, e) }, "%": function (t, e, n, r) { return n(t, e) % r(t, e) }, "^": function (t, e, n, r) { return n(t, e) ^ r(t, e) }, "=": d, "===": function (t, e, n, r) { return n(t, e) === r(t, e) }, "!==": function (t, e, n, r) { return n(t, e) !== r(t, e) }, "==": function (t, e, n, r) { return n(t, e) == r(t, e) }, "!=": function (t, e, n, r) { return n(t, e) != r(t, e) }, "<": function (t, e, n, r) { return n(t, e) < r(t, e) }, ">": function (t, e, n, r) { return n(t, e) > r(t, e) }, "<=": function (t, e, n, r) { return n(t, e) <= r(t, e) }, ">=": function (t, e, n, r) { return n(t, e) >= r(t, e) }, "&&": function (t, e, n, r) { return n(t, e) && r(t, e) }, "||": function (t, e, n, r) { return n(t, e) || r(t, e) }, "&": function (t, e, n, r) { return n(t, e) & r(t, e) }, "|": function (t, e, n, r) { return r(t, e)(t, e, n(t, e)) }, "!": function (t, e, n) { return !n(t, e) } }, Gn = { n: "\n", f: "\f", r: "\r", t: "	", v: "", "'": "'", '"': '"' }, tr = function (t) { this.options = t }; tr.prototype = { constructor: tr, lex: function (t) { this.text = t, this.index = 0, this.ch = n, this.lastCh = ":", this.tokens = []; for (var e, r = []; this.index < this.text.length;) { if (this.ch = this.text.charAt(this.index), 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(), this.was("{,") && "{" === r[0] && (e = this.tokens[this.tokens.length - 1]) && (e.json = -1 === e.text.indexOf(".")); else if (this.is("(){}[].,;:?")) this.tokens.push({ index: this.index, text: this.ch, json: this.was(":[,") && this.is("{[") || this.is("}]:,") }), this.is("{[") && r.unshift(this.ch), this.is("}]") && r.shift(), this.index++; else { if (this.isWhitespace(this.ch)) { this.index++; continue } var i = this.ch + this.peek(), o = i + this.peek(2), s = Zn[this.ch], a = Zn[i], u = Zn[o]; u ? (this.tokens.push({ index: this.index, text: o, fn: u }), this.index += 3) : a ? (this.tokens.push({ index: this.index, text: i, fn: a }), this.index += 2) : s ? (this.tokens.push({ index: this.index, text: this.ch, fn: s, json: this.was("[,:") && this.is("+-") }), this.index += 1) : this.throwError("Unexpected next character ", this.index, this.index + 1) } this.lastCh = this.ch } return this.tokens }, is: function (t) { return -1 !== t.indexOf(this.ch) }, was: function (t) { return -1 !== t.indexOf(this.lastCh) }, peek: function (t) { var e = t || 1; return this.index + e < this.text.length ? this.text.charAt(this.index + e) : !1 }, isNumber: function (t) { return t >= "0" && "9" >= t }, isWhitespace: function (t) { return " " === t || "\r" === t || "	" === t || "\n" === t || "" === t || " " === t }, isIdent: function (t) { return t >= "a" && "z" >= t || t >= "A" && "Z" >= t || "_" === t || "$" === t }, isExpOperator: function (t) { return "-" === t || "+" === t || this.isNumber(t) }, throwError: function (t, e, n) { n = n || this.index; var r = m(e) ? "s " + e + "-" + this.index + " [" + this.text.substring(e, n) + "]" : " " + n; throw Kn("lexerr", "Lexer Error: {0} at column{1} in expression [{2}].", t, r, this.text) }, readNumber: function () { for (var t = "", e = this.index; this.index < this.text.length;) { var n = sn(this.text.charAt(this.index)); if ("." == n || this.isNumber(n)) t += n; else { var r = this.peek(); if ("e" == n && this.isExpOperator(r)) t += n; else if (this.isExpOperator(n) && r && this.isNumber(r) && "e" == t.charAt(t.length - 1)) t += n; else { if (!this.isExpOperator(n) || r && this.isNumber(r) || "e" != t.charAt(t.length - 1)) break; this.throwError("Invalid exponent") } } this.index++ } t = 1 * t, this.tokens.push({ index: e, text: t, json: !0, fn: function () { return t } }) }, readIdent: function () { for (var t, e, n, r, i = this, o = "", s = this.index; this.index < this.text.length && (r = this.text.charAt(this.index), "." === r || this.isIdent(r) || this.isNumber(r)) ;) "." === r && (t = this.index), o += r, this.index++; if (t) for (e = this.index; e < this.text.length;) { if (r = this.text.charAt(e), "(" === r) { n = o.substr(t - s + 1), o = o.substr(0, t - s), this.index = e; break } if (!this.isWhitespace(r)) break; e++ } var a = { index: s, text: o }; if (Zn.hasOwnProperty(o)) a.fn = Zn[o], a.json = Zn[o]; else { var u = ye(o, this.options, this.text); a.fn = f(function (t, e) { return u(t, e) }, { assign: function (t, e) { return $e(t, o, e, i.text, i.options) } }) } this.tokens.push(a), n && (this.tokens.push({ index: t, text: ".", json: !1 }), this.tokens.push({ index: t + 1, text: n, json: !1 })) }, readString: function (t) { var e = this.index; this.index++; for (var n = "", r = t, i = !1; this.index < this.text.length;) { var o = this.text.charAt(this.index); if (r += o, i) { if ("u" === o) { var s = this.text.substring(this.index + 1, this.index + 5); s.match(/[\da-f]{4}/i) || this.throwError("Invalid unicode escape [\\u" + s + "]"), this.index += 4, n += String.fromCharCode(parseInt(s, 16)) } else { var a = Gn[o]; n += a ? a : o } i = !1 } else if ("\\" === o) i = !0; else { if (o === t) return this.index++, void this.tokens.push({ index: e, text: r, string: n, json: !0, fn: function () { return n } }); n += o } this.index++ } this.throwError("Unterminated quote", e) } }; var er = function (t, e, n) { this.lexer = t, this.$filter = e, this.options = n }; er.ZERO = function () { return 0 }, er.prototype = { constructor: er, parse: function (t, e) { this.text = t, this.json = e, this.tokens = this.lexer.lex(t), e && (this.assignment = this.logicalOR, this.functionCall = this.fieldAccess = this.objectIndex = this.filterChain = function () { this.throwError("is not valid json", { text: t, index: 0 }) }); var n = e ? this.primary() : this.statements(); return 0 !== this.tokens.length && this.throwError("is an unexpected token", this.tokens[0]), n.literal = !!n.literal, n.constant = !!n.constant, n }, primary: function () { var t; if (this.expect("(")) t = this.filterChain(), this.consume(")"); else if (this.expect("[")) t = this.arrayDeclaration(); else if (this.expect("{")) t = this.object(); else { var e = this.expect(); t = e.fn, t || this.throwError("not a primary expression", e), e.json && (t.constant = !0, t.literal = !0) } for (var n, r; n = this.expect("(", "[", ".") ;) "(" === n.text ? (t = this.functionCall(t, r), r = null) : "[" === n.text ? (r = t, t = this.objectIndex(t)) : "." === n.text ? (r = t, t = this.fieldAccess(t)) : this.throwError("IMPOSSIBLE"); return t }, throwError: function (t, e) { throw Kn("syntax", "Syntax Error: Token '{0}' {1} at column {2} of the expression [{3}] starting at [{4}].", e.text, t, e.index + 1, this.text, this.text.substring(e.index)) }, peekToken: function () { if (0 === this.tokens.length) throw Kn("ueoe", "Unexpected end of expression: {0}", this.text); return this.tokens[0] }, peek: function (t, e, n, r) { if (this.tokens.length > 0) { var i = this.tokens[0], o = i.text; if (o === t || o === e || o === n || o === r || !t && !e && !n && !r) return i } return !1 }, expect: function (t, e, n, r) { var i = this.peek(t, e, n, r); return i ? (this.json && !i.json && this.throwError("is not valid json", i), this.tokens.shift(), i) : !1 }, consume: function (t) { this.expect(t) || this.throwError("is unexpected, expecting [" + t + "]", this.peek()) }, unaryFn: function (t, e) { return f(function (n, r) { return t(n, r, e) }, { constant: e.constant }) }, ternaryFn: function (t, e, n) { return f(function (r, i) { return t(r, i) ? e(r, i) : n(r, i) }, { constant: t.constant && e.constant && n.constant }) }, binaryFn: function (t, e, n) { return f(function (r, i) { return e(r, i, t, n) }, { constant: t.constant && n.constant }) }, statements: function () { for (var t = []; ;) if (this.tokens.length > 0 && !this.peek("}", ")", ";", "]") && t.push(this.filterChain()), !this.expect(";")) return 1 === t.length ? t[0] : function (e, n) { for (var r, i = 0; i < t.length; i++) { var o = t[i]; o && (r = o(e, n)) } return r } }, filterChain: function () { for (var t, e = this.expression() ; ;) { if (!(t = this.expect("|"))) return e; e = this.binaryFn(e, t.fn, this.filter()) } }, filter: function () { for (var t = this.expect(), e = this.$filter(t.text), n = []; ;) { if (!(t = this.expect(":"))) { var r = function (t, r, i) { for (var o = [i], s = 0; s < n.length; s++) o.push(n[s](t, r)); return e.apply(t, o) }; return function () { return r } } n.push(this.expression()) } }, expression: function () { return this.assignment() }, assignment: function () { var t, e, n = this.ternary(); return (e = this.expect("=")) ? (n.assign || this.throwError("implies assignment but [" + this.text.substring(0, e.index) + "] can not be assigned to", e), t = this.ternary(), function (e, r) { return n.assign(e, t(e, r), r) }) : n }, ternary: function () { var t, e, n = this.logicalOR(); return (e = this.expect("?")) ? (t = this.ternary(), (e = this.expect(":")) ? this.ternaryFn(n, t, this.ternary()) : void this.throwError("expected :", e)) : n }, logicalOR: function () { for (var t, e = this.logicalAND() ; ;) { if (!(t = this.expect("||"))) return e; e = this.binaryFn(e, t.fn, this.logicalAND()) } }, logicalAND: function () { var t, e = this.equality(); return (t = this.expect("&&")) && (e = this.binaryFn(e, t.fn, this.logicalAND())), e }, equality: function () { var t, e = this.relational(); return (t = this.expect("==", "!=", "===", "!==")) && (e = this.binaryFn(e, t.fn, this.equality())), e }, relational: function () { var t, e = this.additive(); return (t = this.expect("<", ">", "<=", ">=")) && (e = this.binaryFn(e, t.fn, this.relational())), e }, additive: function () { for (var t, e = this.multiplicative() ; t = this.expect("+", "-") ;) e = this.binaryFn(e, t.fn, this.multiplicative()); return e }, multiplicative: function () { for (var t, e = this.unary() ; t = this.expect("*", "/", "%") ;) e = this.binaryFn(e, t.fn, this.unary()); return e }, unary: function () { var t; return this.expect("+") ? this.primary() : (t = this.expect("-")) ? this.binaryFn(er.ZERO, t.fn, this.unary()) : (t = this.expect("!")) ? this.unaryFn(t.fn, this.unary()) : this.primary() }, fieldAccess: function (t) { var e = this, n = this.expect().text, r = ye(n, this.options, this.text); return f(function (e, n, i) { return r(i || t(e, n)) }, { assign: function (r, i, o) { return $e(t(r, o), n, i, e.text, e.options) } }) }, objectIndex: function (t) { var e = this, r = this.expression(); return this.consume("]"), f(function (i, o) { var s, a, u = t(i, o), c = r(i, o); return u ? (s = de(u[c], e.text), s && s.then && e.options.unwrapPromises && (a = s, "$$v" in s || (a.$$v = n, a.then(function (t) { a.$$v = t })), s = s.$$v), s) : n }, { assign: function (n, i, o) { var s = r(n, o), a = de(t(n, o), e.text); return a[s] = i } }) }, functionCall: function (t, e) { var n = []; if (")" !== this.peekToken().text) do n.push(this.expression()); while (this.expect(",")); this.consume(")"); var r = this; return function (i, o) { for (var s = [], a = e ? e(i, o) : i, u = 0; u < n.length; u++) s.push(n[u](i, o)); var c = t(i, o, a) || d; de(a, r.text), de(c, r.text); var l = c.apply ? c.apply(a, s) : c(s[0], s[1], s[2], s[3], s[4]); return de(l, r.text) } }, arrayDeclaration: function () { var t = [], e = !0; if ("]" !== this.peekToken().text) do { var n = this.expression(); t.push(n), n.constant || (e = !1) } while (this.expect(",")); return this.consume("]"), f(function (e, n) { for (var r = [], i = 0; i < t.length; i++) r.push(t[i](e, n)); return r }, { literal: !0, constant: e }) }, object: function () { var t = [], e = !0; if ("}" !== this.peekToken().text) do { var n = this.expect(), r = n.string || n.text; this.consume(":"); var i = this.expression(); t.push({ key: r, value: i }), i.constant || (e = !1) } while (this.expect(",")); return this.consume("}"), f(function (e, n) { for (var r = {}, i = 0; i < t.length; i++) { var o = t[i]; r[o.key] = o.value(e, n) } return r }, { literal: !0, constant: e }) } }; var nr = {}, rr = r("$sce"), ir = { HTML: "html", CSS: "css", URL: "url", RESOURCE_URL: "resourceUrl", JS: "js" }, or = e.createElement("a"), sr = je(t.location.href, !0); Re.$inject = ["$provide"], Ve.$inject = ["$locale"], Ie.$inject = ["$locale"]; var ar = ".", ur = { yyyy: He("FullYear", 4), yy: He("FullYear", 2, 0, !0), y: He("FullYear", 1), MMMM: Fe("Month"), MMM: Fe("Month", !0), MM: He("Month", 2, 1), M: He("Month", 1, 1), dd: He("Date", 2), d: He("Date", 1), HH: He("Hours", 2), H: He("Hours", 1), hh: He("Hours", 2, -12), h: He("Hours", 1, -12), mm: He("Minutes", 2), m: He("Minutes", 1), ss: He("Seconds", 2), s: He("Seconds", 1), sss: He("Milliseconds", 3), EEEE: Fe("Day"), EEE: Fe("Day", !0), a: Be, Z: Le }, cr = /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/, lr = /^\-?\d+$/; ze.$inject = ["$locale"]; var fr = v(sn), hr = v(un); Qe.$inject = ["$parse"]; var pr = v({ restrict: "E", compile: function (t, n) { return 8 >= fn && (n.href || n.name || n.$set("href", ""), t.append(e.createComment("IE fix"))), n.href || n.xlinkHref || n.name ? void 0 : function (t, e) { var n = "[object SVGAnimatedString]" === mn.call(e.prop("href")) ? "xlink:href" : "href"; e.on("click", function (t) { e.attr(n) || t.preventDefault() }) } } }), dr = {}; o(Dn, function (t, e) { if ("multiple" != t) { var n = Vt("ng-" + e); dr[n] = function () { return { priority: 100, link: function (t, r, i) { t.$watch(i[n], function (t) { i.$set(e, !!t) }) } } } } }), o(["src", "srcset", "href"], function (t) { var e = Vt("ng-" + t); dr[e] = function () { return { priority: 99, link: function (n, r, i) { i.$observe(e, function (e) { e && (i.$set(t, e), fn && r.prop(t, i[t])) }) } } } }); var $r = { $addControl: d, $removeControl: d, $setValidity: d, $setDirty: d, $setPristine: d }; Ke.$inject = ["$element", "$attrs", "$scope"]; var vr = function (t) { return ["$timeout", function (e) { var r = { name: "form", restrict: t ? "EAC" : "E", controller: Ke, compile: function () { return { pre: function (t, r, i, o) { if (!i.action) { var s = function (t) { t.preventDefault ? t.preventDefault() : t.returnValue = !1 }; On(r[0], "submit", s), r.on("$destroy", function () { e(function () { Tn(r[0], "submit", s) }, 0, !1) }) } var a = r.parent().controller("form"), u = i.name || i.ngForm; u && $e(t, u, o, u), a && r.on("$destroy", function () { a.$removeControl(o), u && $e(t, u, n, u), f(o, $r) }) } } } }; return r }] }, gr = vr(), mr = vr(!0), yr = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/, wr = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9-]+(\.[a-z0-9-]+)*$/i, xr = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/, br = { text: Ze, number: Ge, url: tn, email: en, radio: nn, checkbox: rn, hidden: d, button: d, submit: d, reset: d, file: d }, Sr = ["$browser", "$sniffer", function (t, e) { return { restrict: "E", require: "?ngModel", link: function (n, r, i, o) { o && (br[sn(i.type)] || br.text)(n, r, i, o, e, t) } } }], Cr = "ng-valid", Er = "ng-invalid", kr = "ng-pristine", Ar = "ng-dirty", Or = ["$scope", "$exceptionHandler", "$attrs", "$element", "$parse", function (t, e, n, i, s) { function a(t, e) { e = e ? "-" + G(e, "-") : "", i.removeClass((t ? Er : Cr) + e).addClass((t ? Cr : Er) + e) } this.$viewValue = Number.NaN, this.$modelValue = Number.NaN, this.$parsers = [], this.$formatters = [], this.$viewChangeListeners = [], this.$pristine = !0, this.$dirty = !1, this.$valid = !0, this.$invalid = !1, this.$name = n.name; var u = s(n.ngModel), c = u.assign; if (!c) throw r("ngModel")("nonassign", "Expression '{0}' is non-assignable. Element: {1}", n.ngModel, z(i)); this.$render = d, this.$isEmpty = function (t) { return g(t) || "" === t || null === t || t !== t }; var l = i.inheritedData("$formController") || $r, f = 0, h = this.$error = {}; i.addClass(kr), a(!0), this.$setValidity = function (t, e) { h[t] !== !e && (e ? (h[t] && f--, f || (a(!0), this.$valid = !0, this.$invalid = !1)) : (a(!1), this.$invalid = !0, this.$valid = !1, f++), h[t] = !e, a(e, t), l.$setValidity(t, e, this)) }, this.$setPristine = function () { this.$dirty = !1, this.$pristine = !0, i.removeClass(Ar).addClass(kr) }, this.$setViewValue = function (n) { this.$viewValue = n, this.$pristine && (this.$dirty = !0, this.$pristine = !1, i.removeClass(kr).addClass(Ar), l.$setDirty()), o(this.$parsers, function (t) { n = t(n) }), this.$modelValue !== n && (this.$modelValue = n, c(t, n), o(this.$viewChangeListeners, function (t) { try { t() } catch (n) { e(n) } })) }; var p = this; t.$watch(function () { var e = u(t); if (p.$modelValue !== e) { var n = p.$formatters, r = n.length; for (p.$modelValue = e; r--;) e = n[r](e); p.$viewValue !== e && (p.$viewValue = e, p.$render()) } return e }) }], Tr = function () { return { require: ["ngModel", "^?form"], controller: Or, link: function (t, e, n, r) { var i = r[0], o = r[1] || $r; o.$addControl(i), t.$on("$destroy", function () { o.$removeControl(i) }) } } }, Mr = v({ require: "ngModel", link: function (t, e, n, r) { r.$viewChangeListeners.push(function () { t.$eval(n.ngChange) }) } }), Pr = function () { return { require: "?ngModel", link: function (t, e, n, r) { if (r) { n.required = !0; var i = function (t) { return n.required && r.$isEmpty(t) ? void r.$setValidity("required", !1) : (r.$setValidity("required", !0), t) }; r.$formatters.push(i), r.$parsers.unshift(i), n.$observe("required", function () { i(r.$viewValue) }) } } } }, jr = function () { return { require: "ngModel", link: function (t, e, r, i) { var s = /\/(.*)\//.exec(r.ngList), a = s && new RegExp(s[1]) || r.ngList || ",", u = function (t) { if (!g(t)) { var e = []; return t && o(t.split(a), function (t) { t && e.push(bn(t)) }), e } }; i.$parsers.push(u), i.$formatters.push(function (t) { return S(t) ? t.join(", ") : n }), i.$isEmpty = function (t) { return !t || !t.length } } } }, Nr = /^(true|false|\d+)$/, Dr = function () { return { priority: 100, compile: function (t, e) { return Nr.test(e.ngValue) ? function (t, e, n) { n.$set("value", t.$eval(n.ngValue)) } : function (t, e, n) { t.$watch(n.ngValue, function (t) { n.$set("value", t) }) } } } }, Rr = Ye(function (t, e, r) { e.addClass("ng-binding").data("$binding", r.ngBind), t.$watch(r.ngBind, function (t) { e.text(t == n ? "" : t) }) }), qr = ["$interpolate", function (t) { return function (e, n, r) { var i = t(n.attr(r.$attr.ngBindTemplate)); n.addClass("ng-binding").data("$binding", i), r.$observe("ngBindTemplate", function (t) { n.text(t) }) } }], Vr = ["$sce", "$parse", function (t, e) { return function (n, r, i) { function o() { return (s(n) || "").toString() } r.addClass("ng-binding").data("$binding", i.ngBindHtml); var s = e(i.ngBindHtml); n.$watch(o, function (e) { r.html(t.getTrustedHtml(s(n)) || "") }) } }], Ir = on("", !0), Ur = on("Odd", 0), _r = on("Even", 1), Hr = Ye({ compile: function (t, e) { e.$set("ngCloak", n), t.removeClass("ng-cloak") } }), Fr = [function () { return { scope: !0, controller: "@", priority: 500 } }], Lr = {}; o("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "), function (t) { var e = Vt("ng-" + t); Lr[e] = ["$parse", function (n) { return { compile: function (r, i) { var o = n(i[e]); return function (e, n, r) { n.on(sn(t), function (t) { e.$apply(function () { o(e, { $event: t }) }) }) } } } }] }); var Br = ["$animate", function (t) { return { transclude: "element", priority: 600, terminal: !0, restrict: "A", $$tlb: !0, link: function (n, r, i, o, s) { var a, u; n.$watch(i.ngIf, function (o) { B(o) ? u || (u = n.$new(), s(u, function (n) { n[n.length++] = e.createComment(" end ngIf: " + i.ngIf + " "), a = { clone: n }, t.enter(n, r.parent(), r) })) : (u && (u.$destroy(), u = null), a && (t.leave(ot(a.clone)), a = null)) }) } } }], zr = ["$http", "$templateCache", "$anchorScroll", "$animate", "$sce", function (t, e, n, r, i) {
        return {
            restrict: "ECA", priority: 400,
            terminal: !0, transclude: "element", controller: wn.noop, compile: function (o, s) { var a = s.ngInclude || s.src, u = s.onload || "", c = s.autoscroll; return function (o, s, l, f, h) { var p, d, $ = 0, v = function () { p && (p.$destroy(), p = null), d && (r.leave(d), d = null) }; o.$watch(i.parseAsResourceUrl(a), function (i) { var a = function () { !m(c) || c && !o.$eval(c) || n() }, l = ++$; i ? (t.get(i, { cache: e }).success(function (t) { if (l === $) { var e = o.$new(); f.template = t; var n = h(e, function (t) { v(), r.enter(t, null, s, a) }); p = e, d = n, p.$emit("$includeContentLoaded"), o.$eval(u) } }).error(function () { l === $ && v() }), o.$emit("$includeContentRequested")) : (v(), f.template = null) }) } }
        }
    }], Wr = ["$compile", function (t) { return { restrict: "ECA", priority: -400, require: "ngInclude", link: function (e, n, r, i) { n.html(i.template), t(n.contents())(e) } } }], Jr = Ye({ priority: 450, compile: function () { return { pre: function (t, e, n) { t.$eval(n.ngInit) } } } }), Qr = Ye({ terminal: !0, priority: 1e3 }), Yr = ["$locale", "$interpolate", function (t, e) { var n = /{}/g; return { restrict: "EA", link: function (r, i, s) { var a = s.count, u = s.$attr.when && i.attr(s.$attr.when), c = s.offset || 0, l = r.$eval(u) || {}, f = {}, h = e.startSymbol(), p = e.endSymbol(), d = /^when(Minus)?(.+)$/; o(s, function (t, e) { d.test(e) && (l[sn(e.replace("when", "").replace("Minus", "-"))] = i.attr(s.$attr[e])) }), o(l, function (t, r) { f[r] = e(t.replace(n, h + a + "-" + c + p)) }), r.$watch(function () { var e = parseFloat(r.$eval(a)); return isNaN(e) ? "" : (e in l || (e = t.pluralCat(e - c)), f[e](r, i, !0)) }, function (t) { i.text(t) }) } } }], Kr = ["$parse", "$animate", function (t, n) { function s(t) { return t.clone[0] } function a(t) { return t.clone[t.clone.length - 1] } var u = "$$NG_REMOVED", c = r("ngRepeat"); return { transclude: "element", priority: 1e3, terminal: !0, $$tlb: !0, link: function (r, l, f, h, p) { var d, $, v, g, m, y, w, x, b, S = f.ngRepeat, C = S.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/), E = { $id: At }; if (!C) throw c("iexp", "Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.", S); if (y = C[1], w = C[2], d = C[3], d ? ($ = t(d), v = function (t, e, n) { return b && (E[b] = t), E[x] = e, E.$index = n, $(r, E) }) : (g = function (t, e) { return At(e) }, m = function (t) { return t }), C = y.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/), !C) throw c("iidexp", "'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.", y); x = C[3] || C[1], b = C[2]; var k = {}; r.$watchCollection(w, function (t) { var f, h, d, $, y, w, C, E, A, O, T, M, P = l[0], j = {}, N = []; if (i(t)) O = t, A = v || g; else { A = v || m, O = []; for (w in t) t.hasOwnProperty(w) && "$" != w.charAt(0) && O.push(w); O.sort() } for ($ = O.length, h = N.length = O.length, f = 0; h > f; f++) if (w = t === O ? f : O[f], C = t[w], E = A(w, C, f), rt(E, "`track by` id"), k.hasOwnProperty(E)) T = k[E], delete k[E], j[E] = T, N[f] = T; else { if (j.hasOwnProperty(E)) throw o(N, function (t) { t && t.scope && (k[t.id] = t) }), c("dupes", "Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}", S, E); N[f] = { id: E }, j[E] = !1 } for (w in k) k.hasOwnProperty(w) && (T = k[w], M = ot(T.clone), n.leave(M), o(M, function (t) { t[u] = !0 }), T.scope.$destroy()); for (f = 0, h = O.length; h > f; f++) { if (w = t === O ? f : O[f], C = t[w], T = N[f], N[f - 1] && (P = a(N[f - 1])), T.scope) { y = T.scope, d = P; do d = d.nextSibling; while (d && d[u]); s(T) != d && n.move(ot(T.clone), null, hn(P)), P = a(T) } else y = r.$new(); y[x] = C, b && (y[b] = w), y.$index = f, y.$first = 0 === f, y.$last = f === $ - 1, y.$middle = !(y.$first || y.$last), y.$odd = !(y.$even = 0 === (1 & f)), T.scope || p(y, function (t) { t[t.length++] = e.createComment(" end ngRepeat: " + S + " "), n.enter(t, null, hn(P)), P = t, T.scope = y, T.clone = t, j[T.id] = T }) } k = j }) } } }], Xr = ["$animate", function (t) { return function (e, n, r) { e.$watch(r.ngShow, function (e) { t[B(e) ? "removeClass" : "addClass"](n, "ng-hide") }) } }], Zr = ["$animate", function (t) { return function (e, n, r) { e.$watch(r.ngHide, function (e) { t[B(e) ? "addClass" : "removeClass"](n, "ng-hide") }) } }], Gr = Ye(function (t, e, n) { t.$watch(n.ngStyle, function (t, n) { n && t !== n && o(n, function (t, n) { e.css(n, "") }), t && e.css(t) }, !0) }), ti = ["$animate", function (t) { return { restrict: "EA", require: "ngSwitch", controller: ["$scope", function () { this.cases = {} }], link: function (e, n, r, i) { var s, a, u = r.ngSwitch || r.on, c = []; e.$watch(u, function (n) { for (var u = 0, l = c.length; l > u; u++) c[u].$destroy(), t.leave(a[u]); a = [], c = [], (s = i.cases["!" + n] || i.cases["?"]) && (e.$eval(r.change), o(s, function (n) { var r = e.$new(); c.push(r), n.transclude(r, function (e) { var r = n.element; a.push(e), t.enter(e, r.parent(), r) }) })) }) } } }], ei = Ye({ transclude: "element", priority: 800, require: "^ngSwitch", link: function (t, e, n, r, i) { r.cases["!" + n.ngSwitchWhen] = r.cases["!" + n.ngSwitchWhen] || [], r.cases["!" + n.ngSwitchWhen].push({ transclude: i, element: e }) } }), ni = Ye({ transclude: "element", priority: 800, require: "^ngSwitch", link: function (t, e, n, r, i) { r.cases["?"] = r.cases["?"] || [], r.cases["?"].push({ transclude: i, element: e }) } }), ri = Ye({ link: function (t, e, n, i, o) { if (!o) throw r("ngTransclude")("orphan", "Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}", z(e)); o(function (t) { e.empty(), e.append(t) }) } }), ii = ["$templateCache", function (t) { return { restrict: "E", terminal: !0, compile: function (e, n) { if ("text/ng-template" == n.type) { var r = n.id, i = e[0].text; t.put(r, i) } } } }], oi = r("ngOptions"), si = v({ terminal: !0 }), ai = ["$compile", "$parse", function (t, r) { var i = /^\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]+?))?$/, a = { $setViewValue: d }; return { restrict: "E", require: ["select", "?ngModel"], controller: ["$element", "$scope", "$attrs", function (t, e, n) { var r, i, o = this, s = {}, u = a; o.databound = n.ngModel, o.init = function (t, e, n) { u = t, r = e, i = n }, o.addOption = function (e) { rt(e, '"option value"'), s[e] = !0, u.$viewValue == e && (t.val(e), i.parent() && i.remove()) }, o.removeOption = function (t) { this.hasOption(t) && (delete s[t], u.$viewValue == t && this.renderUnknownOption(t)) }, o.renderUnknownOption = function (e) { var n = "? " + At(e) + " ?"; i.val(n), t.prepend(i), t.val(n), i.prop("selected", !0) }, o.hasOption = function (t) { return s.hasOwnProperty(t) }, e.$on("$destroy", function () { o.renderUnknownOption = d }) }], link: function (a, u, c, l) { function f(t, e, n, r) { n.$render = function () { var t = n.$viewValue; r.hasOption(t) ? (E.parent() && E.remove(), e.val(t), "" === t && d.prop("selected", !0)) : g(t) && d ? e.val("") : r.renderUnknownOption(t) }, e.on("change", function () { t.$apply(function () { E.parent() && E.remove(), n.$setViewValue(e.val()) }) }) } function h(t, e, n) { var r; n.$render = function () { var t = new Ot(n.$viewValue); o(e.find("option"), function (e) { e.selected = m(t.get(e.value)) }) }, t.$watch(function () { q(r, n.$viewValue) || (r = D(n.$viewValue), n.$render()) }), e.on("change", function () { t.$apply(function () { var t = []; o(e.find("option"), function (e) { e.selected && t.push(e.value) }), n.$setViewValue(t) }) }) } function p(e, o, a) { function u() { var t, n, r, i, u, c, v, w, k, A, O, T, M, P, j, N = { "": [] }, D = [""], R = a.$modelValue, q = $(e) || [], V = h ? s(q) : q, I = {}, U = !1; if (y) if (g && S(R)) { U = new Ot([]); for (var _ = 0; _ < R.length; _++) I[f] = R[_], U.put(g(e, I), R[_]) } else U = new Ot(R); for (O = 0; k = V.length, k > O; O++) { if (v = O, h) { if (v = V[O], "$" === v.charAt(0)) continue; I[h] = v } if (I[f] = q[v], t = p(e, I) || "", (n = N[t]) || (n = N[t] = [], D.push(t)), y) T = m(U.remove(g ? g(e, I) : d(e, I))); else { if (g) { var H = {}; H[f] = R, T = g(e, H) === g(e, I) } else T = R === d(e, I); U = U || T } j = l(e, I), j = m(j) ? j : "", n.push({ id: g ? g(e, I) : h ? V[O] : O, label: j, selected: T }) } for (y || (x || null === R ? N[""].unshift({ id: "", label: "", selected: !U }) : U || N[""].unshift({ id: "?", label: "", selected: !0 })), A = 0, w = D.length; w > A; A++) { for (t = D[A], n = N[t], E.length <= A ? (i = { element: C.clone().attr("label", t), label: n.label }, u = [i], E.push(u), o.append(i.element)) : (u = E[A], i = u[0], i.label != t && i.element.attr("label", i.label = t)), M = null, O = 0, k = n.length; k > O; O++) r = n[O], (c = u[O + 1]) ? (M = c.element, c.label !== r.label && M.text(c.label = r.label), c.id !== r.id && M.val(c.id = r.id), c.selected !== r.selected && M.prop("selected", c.selected = r.selected)) : ("" === r.id && x ? P = x : (P = b.clone()).val(r.id).attr("selected", r.selected).text(r.label), u.push(c = { element: P, label: r.label, id: r.id, selected: r.selected }), M ? M.after(P) : i.element.append(P), M = P); for (O++; u.length > O;) u.pop().element.remove() } for (; E.length > A;) E.pop()[0].element.remove() } var c; if (!(c = w.match(i))) throw oi("iexp", "Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}", w, z(o)); var l = r(c[2] || c[1]), f = c[4] || c[6], h = c[5], p = r(c[3] || ""), d = r(c[2] ? c[1] : f), $ = r(c[7]), v = c[8], g = v ? r(c[8]) : null, E = [[{ element: o, label: "" }]]; x && (t(x)(e), x.removeClass("ng-scope"), x.remove()), o.empty(), o.on("change", function () { e.$apply(function () { var t, r, i, s, u, c, l, p, v, m = $(e) || [], w = {}; if (y) { for (i = [], c = 0, p = E.length; p > c; c++) for (t = E[c], u = 1, l = t.length; l > u; u++) if ((s = t[u].element)[0].selected) { if (r = s.val(), h && (w[h] = r), g) for (v = 0; v < m.length && (w[f] = m[v], g(e, w) != r) ; v++); else w[f] = m[r]; i.push(d(e, w)) } } else { if (r = o.val(), "?" == r) i = n; else if ("" === r) i = null; else if (g) { for (v = 0; v < m.length; v++) if (w[f] = m[v], g(e, w) == r) { i = d(e, w); break } } else w[f] = m[r], h && (w[h] = r), i = d(e, w); E[0].length > 1 && E[0][1].id !== r && (E[0][1].selected = !1) } a.$setViewValue(i) }) }), a.$render = u, e.$watch(u) } if (l[1]) { for (var d, $ = l[0], v = l[1], y = c.multiple, w = c.ngOptions, x = !1, b = hn(e.createElement("option")), C = hn(e.createElement("optgroup")), E = b.clone(), k = 0, A = u.children(), O = A.length; O > k; k++) if ("" === A[k].value) { d = x = A.eq(k); break } $.init(v, x, E), y && (v.$isEmpty = function (t) { return !t || 0 === t.length }), w ? p(a, u, v) : y ? h(a, u, v) : f(a, u, v, $) } } } }], ui = ["$interpolate", function (t) { var e = { addOption: d, removeOption: d }; return { restrict: "E", priority: 100, compile: function (n, r) { if (g(r.value)) { var i = t(n.text(), !0); i || r.$set("value", n.text()) } return function (t, n, r) { var o = "$selectController", s = n.parent(), a = s.data(o) || s.parent().data(o); a && a.databound ? n.prop("selected", !1) : a = e, i ? t.$watch(i, function (t, e) { r.$set("value", t), t !== e && a.removeOption(e), a.addOption(t) }) : a.addOption(r.value), n.on("$destroy", function () { a.removeOption(r.value) }) } } } }], ci = v({ restrict: "E", terminal: !0 }); tt(), at(wn), hn(e).ready(function () { X(e, Z) })
}(window, document), !angular.$$csp() && 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;}</style>');;
/*
 AngularJS v1.2.0rc1
 (c) 2010-2012 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(p,b,E){'use strict';function u(b,d){return l(new (l(function(){},{prototype:b})),d)}var v=b.copy,A=b.equals,l=b.extend,t=b.forEach,n=b.isDefined,w=b.isFunction,x=b.isString,B=b.element;p=b.module("ngRoute",["ng"]).provider("$route",function(){function b(c,q){var d=q.caseInsensitiveMatch,m={originalPath:c,regexp:c},l=m.keys=[];c=c.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?|\*])?/g,function(c,b,q,d){c="?"===d?d:null;d="*"===d?d:null;l.push({name:q,optional:!!c});b=b||"";return""+
(c?"":b)+"(?:"+(c?b:"")+(d&&"(.+)?"||"([^/]+)?")+")"+(c||"")}).replace(/([\/$\*])/g,"\\$1");m.regexp=RegExp("^"+c+"$",d?"i":"");return m}var d={};this.when=function(c,q){d[c]=l({reloadOnSearch:!0},q,c&&b(c,q));if(c){var h="/"==c[c.length-1]?c.substr(0,c.length-1):c+"/";d[h]=l({redirectTo:c},b(h,q))}return this};this.otherwise=function(c){this.when(null,c);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache","$sce",function(c,b,h,m,y,p,C,D){function r(){var a=
s(),e=k.current;if(a&&e&&a.$$route===e.$$route&&A(a.pathParams,e.pathParams)&&!a.reloadOnSearch&&!f)e.params=a.params,v(e.params,h),c.$broadcast("$routeUpdate",e);else if(a||e)f=!1,c.$broadcast("$routeChangeStart",a,e),(k.current=a)&&a.redirectTo&&(x(a.redirectTo)?b.path(g(a.redirectTo,a.params)).search(a.params).replace():b.url(a.redirectTo(a.pathParams,b.path(),b.search())).replace()),m.when(a).then(function(){if(a){var c=l({},a.resolve),b,e;t(c,function(a,b){c[b]=x(a)?y.get(a):y.invoke(a)});n(b=
a.template)?w(b)&&(b=b(a.params)):n(e=a.templateUrl)&&(w(e)&&(e=e(a.params)),e=D.getTrustedResourceUrl(e),n(e)&&(a.loadedTemplateUrl=e,b=p.get(e,{cache:C}).then(function(a){return a.data})));n(b)&&(c.$template=b);return m.all(c)}}).then(function(b){a==k.current&&(a&&(a.locals=b,v(a.params,h)),c.$broadcast("$routeChangeSuccess",a,e))},function(b){a==k.current&&c.$broadcast("$routeChangeError",a,e,b)})}function s(){var a,c;t(d,function(d,k){var f;if(f=!c){var g=b.path();f=d.keys;var m={};if(d.regexp)if(g=
d.regexp.exec(g)){for(var h=1,p=g.length;h<p;++h){var r=f[h-1],n="string"==typeof g[h]?decodeURIComponent(g[h]):g[h];r&&n&&(m[r.name]=n)}f=m}else f=null;else f=null;f=a=f}f&&(c=u(d,{params:l({},b.search(),a),pathParams:a}),c.$$route=d)});return c||d[null]&&u(d[null],{params:{},pathParams:{}})}function g(a,c){var b=[];t((a||"").split(":"),function(a,d){if(0==d)b.push(a);else{var f=a.match(/(\w+)(.*)/),g=f[1];b.push(c[g]);b.push(f[2]||"");delete c[g]}});return b.join("")}var f=!1,k={routes:d,reload:function(){f=
!0;c.$evalAsync(r)}};c.$on("$locationChangeSuccess",r);return k}]});p.provider("$routeParams",function(){this.$get=function(){return{}}});var z=500;p.directive("ngView",["$route","$anchorScroll","$compile","$controller","$animate",function(b,d,c,q,h){return{restrict:"ECA",terminal:!0,priority:z,compile:function(m,l){var p=l.onload||"";m.html("");var n=B(document.createComment(" ngView "));m.replaceWith(n);return function(l){function r(){g&&(g.$destroy(),g=null);f&&(h.leave(f),f=null)}function s(){var k=
b.current&&b.current.locals,a=k&&k.$template;if(a){r();g=l.$new();f=m.clone();f.html(a);h.enter(f,null,n);var a=c(f,!1,z-1),e=b.current;e.controller&&(k.$scope=g,k=q(e.controller,k),e.controllerAs&&(g[e.controllerAs]=k),f.data("$ngControllerController",k),f.children().data("$ngControllerController",k));e.scope=g;a(g);g.$emit("$viewContentLoaded");g.$eval(p);d()}else r()}var g,f;l.$on("$routeChangeSuccess",s);s()}}}}])})(window,window.angular);
/*
//@ sourceMappingURL=angular-route.min.js.map
*/
;
/*
 AngularJS v1.2.13
 (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){m.push(new f(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
;
/*
 AngularJS v1.2.13
 (c) 2010-2014 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(p,h,q){'use strict';function E(a){var e=[];s(e,h.noop).chars(a);return e.join("")}function k(a){var e={};a=a.split(",");var d;for(d=0;d<a.length;d++)e[a[d]]=!0;return e}function F(a,e){function d(a,b,d,g){b=h.lowercase(b);if(t[b])for(;f.last()&&u[f.last()];)c("",f.last());v[b]&&f.last()==b&&c("",b);(g=w[b]||!!g)||f.push(b);var l={};d.replace(G,function(a,b,e,c,d){l[b]=r(e||c||d||"")});e.start&&e.start(b,l,g)}function c(a,b){var c=0,d;if(b=h.lowercase(b))for(c=f.length-1;0<=c&&f[c]!=b;c--);
if(0<=c){for(d=f.length-1;d>=c;d--)e.end&&e.end(f[d]);f.length=c}}var b,g,f=[],l=a;for(f.last=function(){return f[f.length-1]};a;){g=!0;if(f.last()&&x[f.last()])a=a.replace(RegExp("(.*)<\\s*\\/\\s*"+f.last()+"[^>]*>","i"),function(b,a){a=a.replace(H,"$1").replace(I,"$1");e.chars&&e.chars(r(a));return""}),c("",f.last());else{if(0===a.indexOf("\x3c!--"))b=a.indexOf("--",4),0<=b&&a.lastIndexOf("--\x3e",b)===b&&(e.comment&&e.comment(a.substring(4,b)),a=a.substring(b+3),g=!1);else if(y.test(a)){if(b=a.match(y))a=
a.replace(b[0],""),g=!1}else if(J.test(a)){if(b=a.match(z))a=a.substring(b[0].length),b[0].replace(z,c),g=!1}else K.test(a)&&(b=a.match(A))&&(a=a.substring(b[0].length),b[0].replace(A,d),g=!1);g&&(b=a.indexOf("<"),g=0>b?a:a.substring(0,b),a=0>b?"":a.substring(b),e.chars&&e.chars(r(g)))}if(a==l)throw L("badparse",a);l=a}c()}function r(a){if(!a)return"";var e=M.exec(a);a=e[1];var d=e[3];if(e=e[2])n.innerHTML=e.replace(/</g,"&lt;"),e="textContent"in n?n.textContent:n.innerText;return a+e+d}function B(a){return a.replace(/&/g,
"&amp;").replace(N,function(a){return"&#"+a.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function s(a,e){var d=!1,c=h.bind(a,a.push);return{start:function(a,g,f){a=h.lowercase(a);!d&&x[a]&&(d=a);d||!0!==C[a]||(c("<"),c(a),h.forEach(g,function(d,f){var g=h.lowercase(f),k="img"===a&&"src"===g||"background"===g;!0!==O[g]||!0===D[g]&&!e(d,k)||(c(" "),c(f),c('="'),c(B(d)),c('"'))}),c(f?"/>":">"))},end:function(a){a=h.lowercase(a);d||!0!==C[a]||(c("</"),c(a),c(">"));a==d&&(d=!1)},chars:function(a){d||
c(B(a))}}}var L=h.$$minErr("$sanitize"),A=/^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,z=/^<\s*\/\s*([\w:-]+)[^>]*>/,G=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,K=/^</,J=/^<\s*\//,H=/\x3c!--(.*?)--\x3e/g,y=/<!DOCTYPE([^>]*?)>/i,I=/<!\[CDATA\[(.*?)]]\x3e/g,N=/([^\#-~| |!])/g,w=k("area,br,col,hr,img,wbr");p=k("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr");q=k("rp,rt");var v=h.extend({},q,p),t=h.extend({},p,k("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")),
u=h.extend({},q,k("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")),x=k("script,style"),C=h.extend({},w,t,u,v),D=k("background,cite,href,longdesc,src,usemap"),O=h.extend({},D,k("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")),
n=document.createElement("pre"),M=/^(\s*)([\s\S]*?)(\s*)$/;h.module("ngSanitize",[]).provider("$sanitize",function(){this.$get=["$$sanitizeUri",function(a){return function(e){var d=[];F(e,s(d,function(c,b){return!/^unsafe/.test(a(c,b))}));return d.join("")}}]});h.module("ngSanitize").filter("linky",["$sanitize",function(a){var e=/((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>]/,d=/^mailto:/;return function(c,b){function g(a){a&&m.push(E(a))}function f(a,c){m.push("<a ");h.isDefined(b)&&
(m.push('target="'),m.push(b),m.push('" '));m.push('href="');m.push(a);m.push('">');g(c);m.push("</a>")}if(!c)return c;for(var l,k=c,m=[],n,p;l=k.match(e);)n=l[0],l[2]==l[3]&&(n="mailto:"+n),p=l.index,g(k.substr(0,p)),f(n,l[0].replace(d,"")),k=k.substring(p+l[0].length);g(k);return a(m.join(""))}}])})(window,window.angular);
//# sourceMappingURL=angular-sanitize.min.js.map
;
/*
 AngularJS v1.2.13
 (c) 2010-2014 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(z,f,T){'use strict';f.module("ngAnimate",["ng"]).factory("$$animateReflow",["$window","$timeout","$document",function(f,h,d){var n=f.requestAnimationFrame||f.webkitRequestAnimationFrame||function(d){return h(d,10,!1)},w=f.cancelAnimationFrame||f.webkitCancelAnimationFrame||function(d){return h.cancel(d)};return function(d){var f=n(function(){d()});return function(){w(f)}}}]).factory("$$asyncQueueBuffer",["$timeout",function(f){var h,d=[];return function(n){f.cancel(h);d.push(n);h=f(function(){for(var f=
0;f<d.length;f++)d[f]();d=[]},0,!1)}}]).config(["$provide","$animateProvider",function($,h){function d(d){for(var f=0;f<d.length;f++){var l=d[f];if(l.nodeType==da)return l}}function n(l){return f.element(d(l))}var w=f.noop,D=f.forEach,ia=h.$$selectors,da=1,l="$$ngAnimateState",U="ng-animate",s={running:!0};$.decorator("$animate",["$delegate","$injector","$sniffer","$rootElement","$$asyncQueueBuffer","$rootScope","$document",function(x,z,ca,F,J,B,T){function V(a){if(a){var c=[],e={};a=a.substr(1).split(".");
(ca.transitions||ca.animations)&&a.push("");for(var A=0;A<a.length;A++){var d=a[A],f=ia[d];f&&!e[d]&&(c.push(z.get(f)),e[d]=!0)}return c}}function t(a,c,e,d,k,C,s){function t(b){var g=e.data(l);b=b||!g||!g.active[c]||m&&g.active[c].event!=a;K();!0===b?G():(g.active[c].done=G,n(L,"after",G))}function n(b,g,ja){"after"==g?H():x();var fa=g+"End";D(b,function(d,f){var A=function(){a:{var a=g+"Complete",c=b[f];c[a]=!0;(c[fa]||w)();for(c=0;c<b.length;c++)if(!b[c][a])break a;ja()}};"before"!=g||"enter"!=
a&&"move"!=a?d[g]?d[fa]=F?d[g](e,E,z,A):m?d[g](e,c,A):d[g](e,A):A():A()})}function h(b){var g="$animate:"+b;u&&(u[g]&&0<u[g].length)&&J(function(){e.triggerHandler(g,{event:a,className:c})})}function x(){h("before")}function H(){h("after")}function B(){h("close");s&&J(function(){s()})}function K(){K.hasBeenRun||(K.hasBeenRun=!0,C())}function G(){if(!G.hasBeenRun){G.hasBeenRun=!0;var b=e.data(l);b&&(m?M(e,c):(J(function(){var b=e.data(l)||{};Q==b.index&&M(e,c,a)}),e.data(l,b)));B()}}var E,z,F="setClass"==
a;F&&(E=c[0],z=c[1],c=E+" "+z);var v,y=e[0];y&&(v=y.className,v=v+" "+c);if(y&&W(v)){var u=f.element._data(y),u=u&&u.events,y=(" "+v).replace(/\s+/g,".");d||(d=k?k.parent():e.parent());var q=V(y),m="addClass"==a||"removeClass"==a||F,I=e.data(l)||{};k=I.active||{};y=I.totalActive||0;v=I.last;if(R(e,d)||0===q.length)K(),x(),H(),G();else{var L=[];m&&(I.disabled||v&&!v.classBased)||D(q,function(b){if(!b.allowCancel||b.allowCancel(e,a,c)){var g=b[a];"leave"==a?(b=g,g=null):b=b["before"+a.charAt(0).toUpperCase()+
a.substr(1)];L.push({before:b,after:g})}});if(0===L.length)K(),x(),H(),B();else{d=!1;if(0<y){q=[];if(m)"setClass"==v.event?(q.push(v),M(e,c)):k[c]&&(N=k[c],N.event==a?d=!0:(q.push(N),M(e,c)));else if("leave"==a&&k["ng-leave"])d=!0;else{for(var N in k)q.push(k[N]),M(e,N);k={};y=0}0<q.length&&f.forEach(q,function(b){(b.done||w)(!0);X(b.animations)})}!m||(F||d)||(d="addClass"==a==e.hasClass(c));if(d)x(),H(),B();else{e.addClass(U);var Q=S++;v={classBased:m,event:a,animations:L,done:t};y++;k[c]=v;e.data(l,
{last:v,active:k,index:Q,totalActive:y});n(L,"before",t)}}}}else K(),x(),H(),B()}function Y(a){a=d(a);D(a.querySelectorAll("."+U),function(a){a=f.element(a);(a=a.data(l))&&a.active&&f.forEach(a.active,function(a){(a.done||w)(!0);X(a.animations)})})}function X(a){D(a,function(a){a.beforeComplete||(a.beforeEnd||w)(!0);a.afterComplete||(a.afterEnd||w)(!0)})}function M(a,c){if(d(a)==d(F))s.disabled||(s.running=!1,s.structural=!1);else if(c){var e=a.data(l)||{},f=!0===c;!f&&(e.active&&e.active[c])&&(e.totalActive--,
delete e.active[c]);if(f||!e.totalActive)a.removeClass(U),a.removeData(l)}}function R(a,c){if(s.disabled)return!0;if(d(a)==d(F))return s.disabled||s.running;do{if(0===c.length)break;var e=d(c)==d(F),f=e?s:c.data(l),f=f&&(!!f.disabled||f.running||0<f.totalActive);if(e||f)return f;if(e)break}while(c=c.parent());return!0}var S=0;F.data(l,s);B.$$postDigest(function(){B.$$postDigest(function(){s.running=!1})});var Z=h.classNameFilter(),W=Z?function(a){return Z.test(a)}:function(){return!0};return{enter:function(a,
c,e,d){this.enabled(!1,a);x.enter(a,c,e);B.$$postDigest(function(){a=n(a);t("enter","ng-enter",a,c,e,w,d)})},leave:function(a,c){Y(a);this.enabled(!1,a);B.$$postDigest(function(){a=n(a);t("leave","ng-leave",a,null,null,function(){x.leave(a)},c)})},move:function(a,c,e,d){Y(a);this.enabled(!1,a);x.move(a,c,e);B.$$postDigest(function(){a=n(a);t("move","ng-move",a,c,e,w,d)})},addClass:function(a,c,d){a=n(a);t("addClass",c,a,null,null,function(){x.addClass(a,c)},d)},removeClass:function(a,c,d){a=n(a);
t("removeClass",c,a,null,null,function(){x.removeClass(a,c)},d)},setClass:function(a,c,d,f){a=n(a);t("setClass",[c,d],a,null,null,function(){x.setClass(a,c,d)},f)},enabled:function(a,c){switch(arguments.length){case 2:if(a)M(c);else{var d=c.data(l)||{};d.disabled=!0;c.data(l,d)}break;case 1:s.disabled=!a;break;default:a=!s.disabled}return!!a}}}]);h.register("",["$window","$sniffer","$timeout","$$animateReflow",function(l,s,h,n){function J(b,g){I&&I();m.push(g);I=n(function(){D(m,function(b){b()});
m=[];I=null;u={}})}function B(b,g){var a=Date.now()+1E3*g;if(!(a<=N)){h.cancel(L);var c=d(b);b=f.element(c);Q.push(b);N=a;L=h(function(){U(Q);Q=[]},g,!1)}}function U(b){D(b,function(b){(b=b.data(E))&&(b.closeAnimationFn||w)()})}function V(b,g){var a=g?u[g]:null;if(!a){var c=0,d=0,f=0,e=0,k,p,r,h;D(b,function(b){if(b.nodeType==da){b=l.getComputedStyle(b)||{};r=b[O+ea];c=Math.max(t(r),c);h=b[O+H];k=b[O+ha];d=Math.max(t(k),d);p=b[P+ha];e=Math.max(t(p),e);var g=t(b[P+ea]);0<g&&(g*=parseInt(b[P+K],10)||
1);f=Math.max(g,f)}});a={total:0,transitionPropertyStyle:h,transitionDurationStyle:r,transitionDelayStyle:k,transitionDelay:d,transitionDuration:c,animationDelayStyle:p,animationDelay:e,animationDuration:f};g&&(u[g]=a)}return a}function t(b){var g=0;b=f.isString(b)?b.split(/\s*,\s*/):[];D(b,function(b){g=Math.max(parseFloat(b)||0,g)});return g}function Y(b){var g=b.parent(),a=g.data(G);a||(g.data(G,++q),a=q);return a+"-"+d(b).className}function X(b,g,a,c){var e=Y(g),k=e+" "+a,l=u[k]?++u[k].total:
0,h={};if(0<l){var p=a+"-stagger",h=e+" "+p;(e=!u[h])&&g.addClass(p);h=V(g,h);e&&g.removeClass(p)}c=c||function(b){return b()};g.addClass(a);var p=g.data(E)||{},r=c(function(){return V(g,k)});c=r.transitionDuration;e=r.animationDuration;if(0===c&&0===e)return g.removeClass(a),!1;g.data(E,{running:p.running||0,itemIndex:l,stagger:h,timings:r,closeAnimationFn:f.noop});b=0<p.running||"setClass"==b;0<c&&M(g,a,b);0<e&&(d(g).style[P]="none 0s");return!0}function M(b,a,c){"ng-enter"!=a&&("ng-move"!=a&&"ng-leave"!=
a)&&c?b.addClass(ga):d(b).style[O+H]="none"}function R(b,a){var c=O+H,e=d(b);e.style[c]&&0<e.style[c].length&&(e.style[c]="");b.removeClass(ga)}function S(b){var a=P;b=d(b);b.style[a]&&0<b.style[a].length&&(b.style[a]="")}function Z(b,a,c,e){function f(b){a.off(w,k);a.removeClass(l);A(a,c);b=d(a);for(var e in q)b.style.removeProperty(q[e])}function k(b){b.stopPropagation();var a=b.originalEvent||b;b=a.$manualTimeStamp||a.timeStamp||Date.now();a=parseFloat(a.elapsedTime.toFixed($));Math.max(b-x,0)>=
u&&a>=s&&e()}var h=d(a);b=a.data(E);if(-1!=h.className.indexOf(c)&&b){var l="";D(c.split(" "),function(b,a){l+=(0<a?" ":"")+b+"-active"});var p=b.stagger,r=b.timings,n=b.itemIndex,s=Math.max(r.transitionDuration,r.animationDuration),t=Math.max(r.transitionDelay,r.animationDelay),u=t*y,x=Date.now(),w=ba+" "+aa,m="",q=[];if(0<r.transitionDuration){var z=r.transitionPropertyStyle;-1==z.indexOf("all")&&(m+=C+"transition-property: "+z+";",m+=C+"transition-duration: "+r.transitionDurationStyle+";",q.push(C+
"transition-property"),q.push(C+"transition-duration"))}0<n&&(0<p.transitionDelay&&0===p.transitionDuration&&(m+=C+"transition-delay: "+W(r.transitionDelayStyle,p.transitionDelay,n)+"; ",q.push(C+"transition-delay")),0<p.animationDelay&&0===p.animationDuration&&(m+=C+"animation-delay: "+W(r.animationDelayStyle,p.animationDelay,n)+"; ",q.push(C+"animation-delay")));0<q.length&&(r=h.getAttribute("style")||"",h.setAttribute("style",r+" "+m));a.on(w,k);a.addClass(l);b.closeAnimationFn=function(){f();
e()};h=(n*(Math.max(p.animationDelay,p.transitionDelay)||0)+(t+s)*v)*y;b.running++;B(a,h);return f}e()}function W(b,a,c){var d="";D(b.split(","),function(b,e){d+=(0<e?",":"")+(c*a+parseInt(b,10))+"s"});return d}function a(b,a,c,d){if(X(b,a,c,d))return function(b){b&&A(a,c)}}function c(b,a,c,d){if(a.data(E))return Z(b,a,c,d);A(a,c);d()}function e(b,g,d,e){var f=a(b,g,d);if(f){var h=f;J(g,function(){R(g,d);S(g);h=c(b,g,d,e)});return function(b){(h||w)(b)}}e()}function A(b,a){b.removeClass(a);var c=
b.data(E);c&&(c.running&&c.running--,c.running&&0!==c.running||b.removeData(E))}function k(b,a){var c="";b=f.isArray(b)?b:b.split(/\s+/);D(b,function(b,d){b&&0<b.length&&(c+=(0<d?" ":"")+b+a)});return c}var C="",O,aa,P,ba;z.ontransitionend===T&&z.onwebkittransitionend!==T?(C="-webkit-",O="WebkitTransition",aa="webkitTransitionEnd transitionend"):(O="transition",aa="transitionend");z.onanimationend===T&&z.onwebkitanimationend!==T?(C="-webkit-",P="WebkitAnimation",ba="webkitAnimationEnd animationend"):
(P="animation",ba="animationend");var ea="Duration",H="Property",ha="Delay",K="IterationCount",G="$$ngAnimateKey",E="$$ngAnimateCSS3Data",ga="ng-animate-block-transitions",$=3,v=1.5,y=1E3,u={},q=0,m=[],I,L=null,N=0,Q=[];return{enter:function(b,a){return e("enter",b,"ng-enter",a)},leave:function(b,a){return e("leave",b,"ng-leave",a)},move:function(a,c){return e("move",a,"ng-move",c)},beforeSetClass:function(b,c,d,e){var f=k(d,"-remove")+" "+k(c,"-add"),h=a("setClass",b,f,function(a){var e=b.attr("class");
b.removeClass(d);b.addClass(c);a=a();b.attr("class",e);return a});if(h)return J(b,function(){R(b,f);S(b);e()}),h;e()},beforeAddClass:function(b,c,d){var e=a("addClass",b,k(c,"-add"),function(a){b.addClass(c);a=a();b.removeClass(c);return a});if(e)return J(b,function(){R(b,c);S(b);d()}),e;d()},setClass:function(a,d,e,f){e=k(e,"-remove");d=k(d,"-add");return c("setClass",a,e+" "+d,f)},addClass:function(a,d,e){return c("addClass",a,k(d,"-add"),e)},beforeRemoveClass:function(b,c,d){var e=a("removeClass",
b,k(c,"-remove"),function(a){var d=b.attr("class");b.removeClass(c);a=a();b.attr("class",d);return a});if(e)return J(b,function(){R(b,c);S(b);d()}),e;d()},removeClass:function(a,d,e){return c("removeClass",a,k(d,"-remove"),e)}}}])}])})(window,window.angular);
//# sourceMappingURL=angular-animate.min.js.map
;
/*
 AngularJS v1.2.16-build.64+sha.245de33
 (c) 2010-2014 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(p,f,n){'use strict';f.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(e,b){var c={},g={},h,k=!1,l=f.copy,m=f.isUndefined;b.addPollFn(function(){var a=b.cookies();h!=a&&(h=a,l(a,g),l(a,c),k&&e.$apply())})();k=!0;e.$watch(function(){var a,d,e;for(a in g)m(c[a])&&b.cookies(a,n);for(a in c)d=c[a],f.isString(d)||(d=""+d,c[a]=d),d!==g[a]&&(b.cookies(a,d),e=!0);if(e)for(a in d=b.cookies(),c)c[a]!==d[a]&&(m(d[a])?delete c[a]:c[a]=d[a])});return c}]).factory("$cookieStore",
["$cookies",function(e){return{get:function(b){return(b=e[b])?f.fromJson(b):b},put:function(b,c){e[b]=f.toJson(c)},remove:function(b){delete e[b]}}}])})(window,window.angular);
//# sourceMappingURL=angular-cookies.min.js.map
;
angular.module("gettext",[]),angular.module("gettext").constant("gettext",function(a){return a}),angular.module("gettext").factory("gettextCatalog",["gettextPlurals","$http","$cacheFactory",function(a,b,c){var d,e=function(a){return d.debug&&d.currentLanguage!==d.baseLanguage?"[MISSING]: "+a:a};return d={debug:!1,strings:{},baseLanguage:"en",currentLanguage:"en",cache:c("strings"),setStrings:function(a,b){var c,d;this.strings[a]||(this.strings[a]={});for(c in b)d=b[c],this.strings[a][c]="string"==typeof d?[d]:d},getStringForm:function(a,b){var c=this.strings[this.currentLanguage]||{},d=c[a]||[];return d[b]},getString:function(a){return this.getStringForm(a,0)||e(a)},getPlural:function(b,c,d){var f=a(this.currentLanguage,b);return this.getStringForm(c,f)||e(1===b?c:d)},loadRemote:function(a){return b({method:"GET",url:a,cache:d.cache}).success(function(a){for(var b in a)d.setStrings(b,a[b])})}}}]),angular.module("gettext").directive("translate",["gettextCatalog","$interpolate","$parse","$compile",function(a,b,c,d){var e=function(){return String.prototype.trim?function(a){return"string"==typeof a?a.trim():a}:function(a){return"string"==typeof a?a.replace(/^\s*/,"").replace(/\s*$/,""):a}}();return{transclude:"element",priority:499,compile:function(f,g,h){return function(f,i){var j=function(a,b,c){if(!a)throw new Error("You should add a "+b+" attribute whenever you add a "+c+" attribute.")};if(j(!g.translatePlural||g.translateN,"translate-n","translate-plural"),j(!g.translateN||g.translatePlural,"translate-plural","translate-n"),g.ngIf)throw new Error("You should not combine translate with ng-if, this will lead to problems.");if(g.ngSwitchWhen)throw new Error("You should not combine translate with ng-switch-when, this will lead to problems.");var k=c(g.translateN);h(f,function(c){var h=e(c.html());return c.removeAttr("translate"),i.replaceWith(c),f.$watch(function(){var e,i=c.html();e=g.translatePlural?a.getPlural(k(f),h,g.translatePlural):a.getString(h);var j=b(e)(f);return i!==j?(c.html(j),void 0!==g.translateCompile&&d(c.contents())(f),c):void 0})})}}}}]),angular.module("gettext").filter("translate",["gettextCatalog","$interpolate","$parse",function(a){return function(b){return a.getString(b)}}]),angular.module("gettext").factory("gettextPlurals",function(){return function(a,b){switch(a){case"ay":case"bo":case"cgg":case"dz":case"fa":case"id":case"ja":case"jbo":case"ka":case"kk":case"km":case"ko":case"ky":case"lo":case"ms":case"my":case"sah":case"su":case"th":case"tt":case"ug":case"vi":case"wo":case"zh":return 0;case"is":return b%10!=1||b%100==11?1:0;case"jv":return 0!=b?1:0;case"mk":return 1==b||b%10==1?0:1;case"ach":case"ak":case"am":case"arn":case"br":case"fil":case"fr":case"gun":case"ln":case"mfe":case"mg":case"mi":case"oc":case"pt_BR":case"tg":case"ti":case"tr":case"uz":case"wa":case"zh":return b>1?1:0;case"lv":return b%10==1&&b%100!=11?0:0!=b?1:2;case"lt":return b%10==1&&b%100!=11?0:b%10>=2&&(10>b%100||b%100>=20)?1:2;case"be":case"bs":case"hr":case"ru":case"sr":case"uk":return b%10==1&&b%100!=11?0:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?1:2;case"mnk":return 0==b?0:1==b?1:2;case"ro":return 1==b?0:0==b||b%100>0&&20>b%100?1:2;case"pl":return 1==b?0:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?1:2;case"cs":case"sk":return 1==b?0:b>=2&&4>=b?1:2;case"sl":return b%100==1?1:b%100==2?2:b%100==3||b%100==4?3:0;case"mt":return 1==b?0:0==b||b%100>1&&11>b%100?1:b%100>10&&20>b%100?2:3;case"gd":return 1==b||11==b?0:2==b||12==b?1:b>2&&20>b?2:3;case"cy":return 1==b?0:2==b?1:8!=b&&11!=b?2:3;case"kw":return 1==b?0:2==b?1:3==b?2:3;case"ga":return 1==b?0:2==b?1:7>b?2:11>b?3:4;case"ar":return 0==b?0:1==b?1:2==b?2:b%100>=3&&10>=b%100?3:b%100>=11?4:5;default:return 1!=b?1:0}}});;
//     Underscore.js 1.6.0
//     http://underscorejs.org
//     (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
//     Underscore may be freely distributed under the MIT license.
(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?void(this._wrapped=n):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.6.0";var A=j.each=j.forEach=function(n,t,e){if(null==n)return n;if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return;return n};j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var O="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},j.find=j.detect=function(n,t,r){var e;return k(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var k=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:k(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,j.property(t))},j.where=function(n,t){return j.filter(n,j.matches(t))},j.findWhere=function(n,t){return j.find(n,j.matches(t))},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);var e=-1/0,u=-1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;o>u&&(e=n,u=o)}),e},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);var e=1/0,u=1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;u>o&&(e=n,u=o)}),e},j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e},j.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=j.values(n)),n[j.random(n.length-1)]):j.shuffle(n).slice(0,Math.max(0,t))};var E=function(n){return null==n?j.identity:j.isFunction(n)?n:j.property(n)};j.sortBy=function(n,t,r){return t=E(t),j.pluck(j.map(n,function(n,e,u){return{value:n,index:e,criteria:t.call(r,n,e,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=E(r),A(t,function(i,a){var o=r.call(e,i,a,t);n(u,o,i)}),u}};j.groupBy=F(function(n,t,r){j.has(n,t)?n[t].push(r):n[t]=[r]}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=E(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])<u?i=o+1:a=o}return i},j.toArray=function(n){return n?j.isArray(n)?o.call(n):n.length===+n.length?j.map(n,j.identity):j.values(n):[]},j.size=function(n){return null==n?0:n.length===+n.length?n.length:j.keys(n).length},j.first=j.head=j.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:0>t?[]:o.call(n,0,t)},j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},j.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},j.compact=function(n){return j.filter(n,j.identity)};var M=function(n,t,r){return t&&j.every(n,j.isArray)?c.apply(r,n):(A(n,function(n){j.isArray(n)||j.isArguments(n)?t?a.apply(r,n):M(n,t,r):r.push(n)}),r)};j.flatten=function(n,t){return M(n,t,[])},j.without=function(n){return j.difference(n,o.call(arguments,1))},j.partition=function(n,t){var r=[],e=[];return A(n,function(n){(t(n)?r:e).push(n)}),[r,e]},j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.contains(t,n)})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===j&&(e[u]=arguments[r++]);for(;r<arguments.length;)e.push(arguments[r++]);return n.apply(this,e)}},j.bindAll=function(n){var t=o.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return A(t,function(t){n[t]=j.bind(n[t],n)}),n},j.memoize=function(n,t){var r={};return t||(t=j.identity),function(){var e=t.apply(this,arguments);return j.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},j.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},j.defer=function(n){return j.delay.apply(j,[n,1].concat(o.call(arguments,1)))},j.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var c=function(){o=r.leading===!1?0:j.now(),a=null,i=n.apply(e,u),e=u=null};return function(){var l=j.now();o||r.leading!==!1||(o=l);var f=t-(l-o);return e=this,u=arguments,0>=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u),e=u=null):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o,c=function(){var l=j.now()-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u),i=u=null))};return function(){i=this,u=arguments,a=j.now();var l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u),i=u=null),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return j.partial(t,n)},j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=function(n){if(!j.isObject(n))return[];if(w)return w(n);var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o)&&"constructor"in n&&"constructor"in t)return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.constant=function(n){return function(){return n}},j.property=function(n){return function(t){return t[n]}},j.matches=function(n){return function(t){if(t===n)return!0;for(var r in n)if(n[r]!==t[r])return!1;return!0}},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},j.now=Date.now||function(){return(new Date).getTime()};var T={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};T.unescape=j.invert(T.escape);var I={escape:new RegExp("["+j.keys(T.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(T.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(I[n],function(t){return T[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof define&&define.amd&&define("underscore",[],function(){return j})}).call(this);
;
/*
 * Toastr
 * Version 2.0.1
 * Copyright 2012 John Papa and Hans Fjällemark.  
 * All Rights Reserved.  
 * Use, reproduction, distribution, and modification of this code is subject to the terms and 
 * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php
 *
 * Author: John Papa and Hans Fjällemark
 * Project: https://github.com/CodeSeven/toastr
 */
; (function (define) {
	define(['jquery'], function ($) {
		return (function () {
			var version = '2.0.1';
			var $container;
			var listener;
			var toastId = 0;
			var toastType = {
				error: 'error',
				info: 'info',
				success: 'success',
				warning: 'warning'
			};

			var toastr = {
				clear: clear,
				error: error,
				getContainer: getContainer,
				info: info,
				options: {},
				subscribe: subscribe,
				success: success,
				version: version,
				warning: warning
			};

			return toastr;

			//#region Accessible Methods
			function error(message, title, optionsOverride) {
				return notify({
					type: toastType.error,
					iconClass: getOptions().iconClasses.error,
					message: message,
					optionsOverride: optionsOverride,
					title: title
				});
			}

			function info(message, title, optionsOverride) {
				return notify({
					type: toastType.info,
					iconClass: getOptions().iconClasses.info,
					message: message,
					optionsOverride: optionsOverride,
					title: title
				});
			}

			function subscribe(callback) {
				listener = callback;
			}

			function success(message, title, optionsOverride) {
				return notify({
					type: toastType.success,
					iconClass: getOptions().iconClasses.success,
					message: message,
					optionsOverride: optionsOverride,
					title: title
				});
			}

			function warning(message, title, optionsOverride) {
				return notify({
					type: toastType.warning,
					iconClass: getOptions().iconClasses.warning,
					message: message,
					optionsOverride: optionsOverride,
					title: title
				});
			}

			function clear($toastElement) {
				var options = getOptions();
				if (!$container) { getContainer(options); }
				if ($toastElement && $(':focus', $toastElement).length === 0) {
					$toastElement[options.hideMethod]({
						duration: options.hideDuration,
						easing: options.hideEasing,
						complete: function () { removeToast($toastElement); }
					});
					return;
				}
				if ($container.children().length) {
					$container[options.hideMethod]({
						duration: options.hideDuration,
						easing: options.hideEasing,
						complete: function () { $container.remove(); }
					});
				}
			}
			//#endregion

			//#region Internal Methods

			function getDefaults() {
				return {
					tapToDismiss: true,
					toastClass: 'toast',
					containerId: 'toast-container',
					debug: false,

					showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery
					showDuration: 300,
					showEasing: 'swing', //swing and linear are built into jQuery
					onShown: undefined,
					hideMethod: 'fadeOut',
					hideDuration: 1000,
					hideEasing: 'swing',
					onHidden: undefined,

					extendedTimeOut: 1000,
					iconClasses: {
						error: 'toast-error',
						info: 'toast-info',
						success: 'toast-success',
						warning: 'toast-warning'
					},
					iconClass: 'toast-info',
					positionClass: 'toast-top-right',
					timeOut: 5000, // Set timeOut and extendedTimeout to 0 to make it sticky
					titleClass: 'toast-title',
					messageClass: 'toast-message',
					target: 'body',
					closeHtml: '<button>&times;</button>',
					newestOnTop: true
				};
			}

			function publish(args) {
				if (!listener) {
					return;
				}
				listener(args);
			}

			function notify(map) {
				var
					options = getOptions(),
					iconClass = map.iconClass || options.iconClass;

				if (typeof (map.optionsOverride) !== 'undefined') {
					options = $.extend(options, map.optionsOverride);
					iconClass = map.optionsOverride.iconClass || iconClass;
				}

				toastId++;

				$container = getContainer(options);
				var
					intervalId = null,
					$toastElement = $('<div/>'),
					$titleElement = $('<div/>'),
					$messageElement = $('<div/>'),
					$closeElement = $(options.closeHtml),
					response = {
						toastId: toastId,
						state: 'visible',
						startTime: new Date(),
						options: options,
						map: map
					};

				if (map.iconClass) {
					$toastElement.addClass(options.toastClass).addClass(iconClass);
				}

				if (map.title) {
					$titleElement.append(map.title).addClass(options.titleClass);
					$toastElement.append($titleElement);
				}

				if (map.message) {
					$messageElement.append(map.message).addClass(options.messageClass);
					$toastElement.append($messageElement);
				}

				if (options.closeButton) {
					$closeElement.addClass('toast-close-button');
					$toastElement.prepend($closeElement);
				}

				$toastElement.hide();
				if (options.newestOnTop) {
					$container.prepend($toastElement);
				} else {
					$container.append($toastElement);
				}


				$toastElement[options.showMethod](
					{ duration: options.showDuration, easing: options.showEasing, complete: options.onShown }
				);
				if (options.timeOut > 0) {
					intervalId = setTimeout(hideToast, options.timeOut);
				}

				$toastElement.hover(stickAround, delayedhideToast);
				if (!options.onclick && options.tapToDismiss) {
					$toastElement.click(hideToast);
				}
				if (options.closeButton && $closeElement) {
					$closeElement.click(function (event) {
						event.stopPropagation();
						hideToast(true);
					});
				}

				if (options.onclick) {
					$toastElement.click(function () {
						options.onclick();
						hideToast();
					});
				}

				publish(response);

				if (options.debug && console) {
					console.log(response);
				}

				return $toastElement;

				function hideToast(override) {
					if ($(':focus', $toastElement).length && !override) {
						return;
					}
					return $toastElement[options.hideMethod]({
						duration: options.hideDuration,
						easing: options.hideEasing,
						complete: function () {
							removeToast($toastElement);
							if (options.onHidden) {
								options.onHidden();
							}
							response.state = 'hidden';
							response.endTime = new Date(),
							publish(response);
						}
					});
				}

				function delayedhideToast() {
					if (options.timeOut > 0 || options.extendedTimeOut > 0) {
						intervalId = setTimeout(hideToast, options.extendedTimeOut);
					}
				}

				function stickAround() {
					clearTimeout(intervalId);
					$toastElement.stop(true, true)[options.showMethod](
						{ duration: options.showDuration, easing: options.showEasing }
					);
				}
			}
			function getContainer(options) {
				if (!options) { options = getOptions(); }
				$container = $('#' + options.containerId);
				if ($container.length) {
					return $container;
				}
				$container = $('<div/>')
					.attr('id', options.containerId)
					.addClass(options.positionClass);
				$container.appendTo($(options.target));
				return $container;
			}

			function getOptions() {
				return $.extend({}, getDefaults(), toastr.options);
			}

			function removeToast($toastElement) {
				if (!$container) { $container = getContainer(); }
				if ($toastElement.is(':visible')) {
					return;
				}
				$toastElement.remove();
				$toastElement = null;
				if ($container.children().length === 0) {
					$container.remove();
				}
			}
			//#endregion

		})();
	});
}(typeof define === 'function' && define.amd ? define : function (deps, factory) {
	if (typeof module !== 'undefined' && module.exports) { //Node
		module.exports = factory(require(deps[0]));
	} else {
		window['toastr'] = factory(window['jQuery']);
	}
}));
;
//fgnass.github.com/spin.js#v2.0.0
!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=j.substring(0,j.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return l[e]||(m.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",m.cssRules.length),l[e]=1),e}function d(a,b){var c,d,e=a.style;for(b=b.charAt(0).toUpperCase()+b.slice(1),d=0;d<k.length;d++)if(c=k[d]+b,void 0!==e[c])return c;return void 0!==e[b]?b:void 0}function e(a,b){for(var c in b)a.style[d(a,c)||c]=b[c];return a}function f(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)void 0===a[d]&&(a[d]=c[d])}return a}function g(a,b){return"string"==typeof a?a:a[b%a.length]}function h(a){this.opts=f(a||{},h.defaults,n)}function i(){function c(b,c){return a("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',c)}m.addRule(".spin-vml","behavior:url(#default#VML)"),h.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:k+" "+k,coordorigin:-j+" "+-j}),{width:k,height:k})}function h(a,h,i){b(m,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~h}),b(e(c("roundrect",{arcsize:d.corners}),{width:j,height:d.width,left:d.radius,top:-d.width>>1,filter:i}),c("fill",{color:g(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var i,j=d.length+d.width,k=2*j,l=2*-(d.width+d.length)+"px",m=e(f(),{position:"absolute",top:l,left:l});if(d.shadow)for(i=1;i<=d.lines;i++)h(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=d.lines;i++)h(i);return b(a,m)},h.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}}var j,k=["webkit","Moz","ms","O"],l={},m=function(){var c=a("style",{type:"text/css"});return b(document.getElementsByTagName("head")[0],c),c.sheet||c.styleSheet}(),n={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",position:"absolute"};h.defaults={},f(h.prototype,{spin:function(b){this.stop();{var c=this,d=c.opts,f=c.el=e(a(0,{className:d.className}),{position:d.position,width:0,zIndex:d.zIndex});d.radius+d.length+d.width}if(b&&(b.insertBefore(f,b.firstChild||null),e(f,{left:d.left,top:d.top})),f.setAttribute("role","progressbar"),c.lines(f,c.opts),!j){var g,h=0,i=(d.lines-1)*(1-d.direction)/2,k=d.fps,l=k/d.speed,m=(1-d.opacity)/(l*d.trail/100),n=l/d.lines;!function o(){h++;for(var a=0;a<d.lines;a++)g=Math.max(1-(h+(d.lines-a)*n)%l*m,d.opacity),c.opacity(f,a*d.direction+i,g,d);c.timeout=c.el&&setTimeout(o,~~(1e3/k))}()}return c},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=void 0),this},lines:function(d,f){function h(b,c){return e(a(),{position:"absolute",width:f.length+f.width+"px",height:f.width+"px",background:b,boxShadow:c,transformOrigin:"left",transform:"rotate("+~~(360/f.lines*k+f.rotate)+"deg) translate("+f.radius+"px,0)",borderRadius:(f.corners*f.width>>1)+"px"})}for(var i,k=0,l=(f.lines-1)*(1-f.direction)/2;k<f.lines;k++)i=e(a(),{position:"absolute",top:1+~(f.width/2)+"px",transform:f.hwaccel?"translate3d(0,0,0)":"",opacity:f.opacity,animation:j&&c(f.opacity,f.trail,l+k*f.direction,f.lines)+" "+1/f.speed+"s linear infinite"}),f.shadow&&b(i,e(h("#000","0 0 4px #000"),{top:"2px"})),b(d,b(i,h(g(f.color,k),"0 0 1px rgba(0,0,0,.1)")));return d},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}});var o=e(a("group"),{behavior:"url(#default#VML)"});return!d(o,"transform")&&o.adj?i():j=d(o,"animation"),h});;
/* ===================================================
 * bootstrap-transition.js v2.3.2
 * http://twitter.github.com/bootstrap/javascript.html#transitions
 * ===================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================== */


!function ($) {

    "use strict"; // jshint ;_;


    /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
     * ======================================================= */

    $(function () {

        $.support.transition = (function () {

            var transitionEnd = (function () {

                var el = document.createElement('bootstrap')
                  , transEndEventNames = {
                      'WebkitTransition': 'webkitTransitionEnd'
                    , 'MozTransition': 'transitionend'
                    , 'OTransition': 'oTransitionEnd otransitionend'
                    , 'transition': 'transitionend'
                  }
                  , name

                for (name in transEndEventNames) {
                    if (el.style[name] !== undefined) {
                        return transEndEventNames[name]
                    }
                }

            }())

            return transitionEnd && {
                end: transitionEnd
            }

        })()

    })

}(window.jQuery);
/* =========================================================
 * bootstrap-modal.js v2.3.2
 * http://twitter.github.com/bootstrap/javascript.html#modals
 * =========================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================= */


!function ($) {

    "use strict"; // jshint ;_;


    /* MODAL CLASS DEFINITION
     * ====================== */

    var Modal = function (element, options) {
        this.options = options
        this.$element = $(element)
          .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
        this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
    }

    Modal.prototype = {

        constructor: Modal

      , toggle: function () {
          return this[!this.isShown ? 'show' : 'hide']()
      }

      , show: function () {
          var that = this
            , e = $.Event('show')

          this.$element.trigger(e)

          if (this.isShown || e.isDefaultPrevented()) return

          this.isShown = true

          this.escape()

          this.backdrop(function () {
              var transition = $.support.transition && that.$element.hasClass('fade')

              if (!that.$element.parent().length) {
                  that.$element.appendTo(document.body) //don't move modals dom position
              }

              that.$element.show()

              if (transition) {
                  that.$element[0].offsetWidth // force reflow
              }

              that.$element
                .addClass('in')
                .attr('aria-hidden', false)

              that.enforceFocus()

              transition ?
                that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
                that.$element.focus().trigger('shown')

          })
      }

      , hide: function (e) {
          e && e.preventDefault()

          var that = this

          e = $.Event('hide')

          this.$element.trigger(e)

          if (!this.isShown || e.isDefaultPrevented()) return

          this.isShown = false

          this.escape()

          $(document).off('focusin.modal')

          this.$element
            .removeClass('in')
            .attr('aria-hidden', true)

          $.support.transition && this.$element.hasClass('fade') ?
            this.hideWithTransition() :
            this.hideModal()
      }

      , enforceFocus: function () {
          var that = this
          $(document).on('focusin.modal', function (e) {
              if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
                  that.$element.focus()
              }
          })
      }

      , escape: function () {
          var that = this
          if (this.isShown && this.options.keyboard) {
              this.$element.on('keyup.dismiss.modal', function (e) {
                  e.which == 27 && that.hide()
              })
          } else if (!this.isShown) {
              this.$element.off('keyup.dismiss.modal')
          }
      }

      , hideWithTransition: function () {
          var that = this
            , timeout = setTimeout(function () {
                that.$element.off($.support.transition.end)
                that.hideModal()
            }, 500)

          this.$element.one($.support.transition.end, function () {
              clearTimeout(timeout)
              that.hideModal()
          })
      }

      , hideModal: function () {
          var that = this
          this.$element.hide()
          this.backdrop(function () {
              that.removeBackdrop()
              that.$element.trigger('hidden')
          })
      }

      , removeBackdrop: function () {
          this.$backdrop && this.$backdrop.remove()
          this.$backdrop = null
      }

      , backdrop: function (callback) {
          var that = this
            , animate = this.$element.hasClass('fade') ? 'fade' : ''

          if (this.isShown && this.options.backdrop) {
              var doAnimate = $.support.transition && animate

              this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
                .appendTo(document.body)

              this.$backdrop.click(
                this.options.backdrop == 'static' ?
                  $.proxy(this.$element[0].focus, this.$element[0])
                : $.proxy(this.hide, this)
              )

              if (doAnimate) this.$backdrop[0].offsetWidth // force reflow

              this.$backdrop.addClass('in')

              if (!callback) return

              doAnimate ?
                this.$backdrop.one($.support.transition.end, callback) :
                callback()

          } else if (!this.isShown && this.$backdrop) {
              this.$backdrop.removeClass('in')

              $.support.transition && this.$element.hasClass('fade') ?
                this.$backdrop.one($.support.transition.end, callback) :
                callback()

          } else if (callback) {
              callback()
          }
      }
    }


    /* MODAL PLUGIN DEFINITION
     * ======================= */

    var old = $.fn.modal

    $.fn.modal = function (option) {
        return this.each(function () {
            var $this = $(this)
              , data = $this.data('modal')
              , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
            if (!data) $this.data('modal', (data = new Modal(this, options)))
            if (typeof option == 'string') data[option]()
            else if (options.show) data.show()
        })
    }

    $.fn.modal.defaults = {
        backdrop: true
      , keyboard: true
      , show: true
    }

    $.fn.modal.Constructor = Modal


    /* MODAL NO CONFLICT
     * ================= */

    $.fn.modal.noConflict = function () {
        $.fn.modal = old
        return this
    }


    /* MODAL DATA-API
     * ============== */

    $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
        var $this = $(this)
          , href = $this.attr('href')
          , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
          , option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())

        e.preventDefault()

        $target
          .modal(option)
          .one('hide', function () {
              $this.focus()
          })
    })

}(window.jQuery);

/* ============================================================
 * bootstrap-dropdown.js v2.3.2
 * http://twitter.github.com/bootstrap/javascript.html#dropdowns
 * ============================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================ */


!function ($) {

    "use strict"; // jshint ;_;


    /* DROPDOWN CLASS DEFINITION
     * ========================= */

    var toggle = '[data-toggle=dropdown]'
      , Dropdown = function (element) {
          var $el = $(element).on('click.dropdown.data-api', this.toggle)
          $('html').on('click.dropdown.data-api', function () {
              $el.parent().removeClass('open')
          })
      }

    Dropdown.prototype = {

        constructor: Dropdown

    , toggle: function (e) {
        var $this = $(this)
          , $parent
          , isActive

        if ($this.is('.disabled, :disabled')) return

        $parent = getParent($this)

        isActive = $parent.hasClass('open')

        clearMenus()

        if (!isActive) {
            if ('ontouchstart' in document.documentElement) {
                // if mobile we we use a backdrop because click events don't delegate
                $('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus)
            }
            $parent.toggleClass('open')
        }

        $this.focus()

        return false
    }

    , keydown: function (e) {
        var $this
          , $items
          , $active
          , $parent
          , isActive
          , index

        if (!/(38|40|27)/.test(e.keyCode)) return

        $this = $(this)

        e.preventDefault()
        e.stopPropagation()

        if ($this.is('.disabled, :disabled')) return

        $parent = getParent($this)

        isActive = $parent.hasClass('open')

        if (!isActive || (isActive && e.keyCode == 27)) {
            if (e.which == 27) $parent.find(toggle).focus()
            return $this.click()
        }

        $items = $('[role=menu] li:not(.divider):visible a', $parent)

        if (!$items.length) return

        index = $items.index($items.filter(':focus'))

        if (e.keyCode == 38 && index > 0) index--                                        // up
        if (e.keyCode == 40 && index < $items.length - 1) index++                        // down
        if (!~index) index = 0

        $items
          .eq(index)
          .focus()
    }

    }

    function clearMenus() {
        $('.dropdown-backdrop').remove()
        $(toggle).each(function () {
            getParent($(this)).removeClass('open')
        })
    }

    function getParent($this) {
        var selector = $this.attr('data-target')
          , $parent

        if (!selector) {
            selector = $this.attr('href')
            selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
        }

        $parent = selector && $(selector)

        if (!$parent || !$parent.length) $parent = $this.parent()

        return $parent
    }


    /* DROPDOWN PLUGIN DEFINITION
     * ========================== */

    var old = $.fn.dropdown

    $.fn.dropdown = function (option) {
        return this.each(function () {
            var $this = $(this)
              , data = $this.data('dropdown')
            if (!data) $this.data('dropdown', (data = new Dropdown(this)))
            if (typeof option == 'string') data[option].call($this)
        })
    }

    $.fn.dropdown.Constructor = Dropdown


    /* DROPDOWN NO CONFLICT
     * ==================== */

    $.fn.dropdown.noConflict = function () {
        $.fn.dropdown = old
        return this
    }


    /* APPLY TO STANDARD DROPDOWN ELEMENTS
     * =================================== */

    $(document)
      .on('click.dropdown.data-api', clearMenus)
      .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
      .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
      .on('keydown.dropdown.data-api', toggle + ', [role=menu]', Dropdown.prototype.keydown)

}(window.jQuery);

/* =============================================================
 * bootstrap-scrollspy.js v2.3.2
 * http://twitter.github.com/bootstrap/javascript.html#scrollspy
 * =============================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================== */


!function ($) {

    "use strict"; // jshint ;_;


    /* SCROLLSPY CLASS DEFINITION
     * ========================== */

    function ScrollSpy(element, options) {
        var process = $.proxy(this.process, this)
          , $element = $(element).is('body') ? $(window) : $(element)
          , href
        this.options = $.extend({}, $.fn.scrollspy.defaults, options)
        this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
        this.selector = (this.options.target
          || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
          || '') + ' .nav li > a'
        this.$body = $('body')
        this.refresh()
        this.process()
    }

    ScrollSpy.prototype = {

        constructor: ScrollSpy

      , refresh: function () {
          var self = this
            , $targets

          this.offsets = $([])
          this.targets = $([])

          $targets = this.$body
            .find(this.selector)
            .map(function () {
                var $el = $(this)
                  , href = $el.data('target') || $el.attr('href')
                  , $href = /^#\w/.test(href) && $(href)
                return ($href
                  && $href.length
                  && [[$href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href]]) || null
            })
            .sort(function (a, b) { return a[0] - b[0] })
            .each(function () {
                self.offsets.push(this[0])
                self.targets.push(this[1])
            })
      }

      , process: function () {
          var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
            , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
            , maxScroll = scrollHeight - this.$scrollElement.height()
            , offsets = this.offsets
            , targets = this.targets
            , activeTarget = this.activeTarget
            , i

          if (scrollTop >= maxScroll) {
              return activeTarget != (i = targets.last()[0])
                && this.activate(i)
          }

          for (i = offsets.length; i--;) {
              activeTarget != targets[i]
                && scrollTop >= offsets[i]
                && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
                && this.activate(targets[i])
          }
      }

      , activate: function (target) {
          var active
            , selector

          this.activeTarget = target

          $(this.selector)
            .parent('.active')
            .removeClass('active')

          selector = this.selector
            + '[data-target="' + target + '"],'
            + this.selector + '[href="' + target + '"]'

          active = $(selector)
            .parent('li')
            .addClass('active')

          if (active.parent('.dropdown-menu').length) {
              active = active.closest('li.dropdown').addClass('active')
          }

          active.trigger('activate')
      }

    }


    /* SCROLLSPY PLUGIN DEFINITION
     * =========================== */

    var old = $.fn.scrollspy

    $.fn.scrollspy = function (option) {
        return this.each(function () {
            var $this = $(this)
              , data = $this.data('scrollspy')
              , options = typeof option == 'object' && option
            if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
            if (typeof option == 'string') data[option]()
        })
    }

    $.fn.scrollspy.Constructor = ScrollSpy

    $.fn.scrollspy.defaults = {
        offset: 10
    }


    /* SCROLLSPY NO CONFLICT
     * ===================== */

    $.fn.scrollspy.noConflict = function () {
        $.fn.scrollspy = old
        return this
    }


    /* SCROLLSPY DATA-API
     * ================== */

    $(window).on('load', function () {
        $('[data-spy="scroll"]').each(function () {
            var $spy = $(this)
            $spy.scrollspy($spy.data())
        })
    })

}(window.jQuery);
/* ========================================================
 * bootstrap-tab.js v2.3.2
 * http://twitter.github.com/bootstrap/javascript.html#tabs
 * ========================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ======================================================== */


!function ($) {

    "use strict"; // jshint ;_;


    /* TAB CLASS DEFINITION
     * ==================== */

    var Tab = function (element) {
        this.element = $(element)
    }

    Tab.prototype = {

        constructor: Tab

    , show: function () {
        var $this = this.element
          , $ul = $this.closest('ul:not(.dropdown-menu)')
          , selector = $this.attr('data-target')
          , previous
          , $target
          , e

        if (!selector) {
            selector = $this.attr('href')
            selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
        }

        if ($this.parent('li').hasClass('active')) return

        previous = $ul.find('.active:last a')[0]

        e = $.Event('show', {
            relatedTarget: previous
        })

        $this.trigger(e)

        if (e.isDefaultPrevented()) return

        $target = $(selector)

        this.activate($this.parent('li'), $ul)
        this.activate($target, $target.parent(), function () {
            $this.trigger({
                type: 'shown'
            , relatedTarget: previous
            })
        })
    }

    , activate: function (element, container, callback) {
        var $active = container.find('> .active')
          , transition = callback
              && $.support.transition
              && $active.hasClass('fade')

        function next() {
            $active
              .removeClass('active')
              .find('> .dropdown-menu > .active')
              .removeClass('active')

            element.addClass('active')

            if (transition) {
                element[0].offsetWidth // reflow for transition
                element.addClass('in')
            } else {
                element.removeClass('fade')
            }

            if (element.parent('.dropdown-menu')) {
                element.closest('li.dropdown').addClass('active')
            }

            callback && callback()
        }

        transition ?
          $active.one($.support.transition.end, next) :
          next()

        $active.removeClass('in')
    }
    }


    /* TAB PLUGIN DEFINITION
     * ===================== */

    var old = $.fn.tab

    $.fn.tab = function (option) {
        return this.each(function () {
            var $this = $(this)
              , data = $this.data('tab')
            if (!data) $this.data('tab', (data = new Tab(this)))
            if (typeof option == 'string') data[option]()
        })
    }

    $.fn.tab.Constructor = Tab


    /* TAB NO CONFLICT
     * =============== */

    $.fn.tab.noConflict = function () {
        $.fn.tab = old
        return this
    }


    /* TAB DATA-API
     * ============ */

    $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
        e.preventDefault()
        $(this).tab('show')
    })

}(window.jQuery);
/* ===========================================================
 * bootstrap-tooltip.js v2.3.2
 * http://twitter.github.com/bootstrap/javascript.html#tooltips
 * Inspired by the original jQuery.tipsy by Jason Frame
 * ===========================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================== */


!function ($) {

    "use strict"; // jshint ;_;


    /* TOOLTIP PUBLIC CLASS DEFINITION
     * =============================== */

    var Tooltip = function (element, options) {
        this.init('tooltip', element, options)
    }

    Tooltip.prototype = {

        constructor: Tooltip

    , init: function (type, element, options) {
        var eventIn
          , eventOut
          , triggers
          , trigger
          , i

        this.type = type
        this.$element = $(element)
        this.options = this.getOptions(options)
        this.enabled = true

        triggers = this.options.trigger.split(' ')

        for (i = triggers.length; i--;) {
            trigger = triggers[i]
            if (trigger == 'click') {
                this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
            } else if (trigger != 'manual') {
                eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
                eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
                this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
                this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
            }
        }

        this.options.selector ?
          (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
          this.fixTitle()
    }

    , getOptions: function (options) {
        options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options)

        if (options.delay && typeof options.delay == 'number') {
            options.delay = {
                show: options.delay
            , hide: options.delay
            }
        }

        return options
    }

    , enter: function (e) {
        var defaults = $.fn[this.type].defaults
          , options = {}
          , self

        this._options && $.each(this._options, function (key, value) {
            if (defaults[key] != value) options[key] = value
        }, this)

        self = $(e.currentTarget)[this.type](options).data(this.type)

        if (!self.options.delay || !self.options.delay.show) return self.show()

        clearTimeout(this.timeout)
        self.hoverState = 'in'
        this.timeout = setTimeout(function () {
            if (self.hoverState == 'in') self.show()
        }, self.options.delay.show)
    }

    , leave: function (e) {
        var self = $(e.currentTarget)[this.type](this._options).data(this.type)

        if (this.timeout) clearTimeout(this.timeout)
        if (!self.options.delay || !self.options.delay.hide) return self.hide()

        self.hoverState = 'out'
        this.timeout = setTimeout(function () {
            if (self.hoverState == 'out') self.hide()
        }, self.options.delay.hide)
    }

    , show: function () {
        var $tip
          , pos
          , actualWidth
          , actualHeight
          , placement
          , tp
          , e = $.Event('show')

        if (this.hasContent() && this.enabled) {
            this.$element.trigger(e)
            if (e.isDefaultPrevented()) return
            $tip = this.tip()
            this.setContent()

            if (this.options.animation) {
                $tip.addClass('fade')
            }

            placement = typeof this.options.placement == 'function' ?
              this.options.placement.call(this, $tip[0], this.$element[0]) :
              this.options.placement

            $tip
              .detach()
              .css({ top: 0, left: 0, display: 'block' })

            this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)

            pos = this.getPosition()

            actualWidth = $tip[0].offsetWidth
            actualHeight = $tip[0].offsetHeight

            switch (placement) {
                case 'bottom':
                    tp = { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 }
                    break
                case 'top':
                    tp = { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 }
                    break
                case 'left':
                    tp = { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth }
                    break
                case 'right':
                    tp = { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
                    break
            }

            this.applyPlacement(tp, placement)
            this.$element.trigger('shown')
        }
    }

    , applyPlacement: function (offset, placement) {
        var $tip = this.tip()
          , width = $tip[0].offsetWidth
          , height = $tip[0].offsetHeight
          , actualWidth
          , actualHeight
          , delta
          , replace

        $tip
          .offset(offset)
          .addClass(placement)
          .addClass('in')

        actualWidth = $tip[0].offsetWidth
        actualHeight = $tip[0].offsetHeight

        if (placement == 'top' && actualHeight != height) {
            offset.top = offset.top + height - actualHeight
            replace = true
        }

        if (placement == 'bottom' || placement == 'top') {
            delta = 0

            if (offset.left < 0) {
                delta = offset.left * -2
                offset.left = 0
                $tip.offset(offset)
                actualWidth = $tip[0].offsetWidth
                actualHeight = $tip[0].offsetHeight
            }

            this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
        } else {
            this.replaceArrow(actualHeight - height, actualHeight, 'top')
        }

        if (replace) $tip.offset(offset)
    }

    , replaceArrow: function (delta, dimension, position) {
        this
          .arrow()
          .css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
    }

    , setContent: function () {
        var $tip = this.tip()
          , title = this.getTitle()

        $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
        $tip.removeClass('fade in top bottom left right')
    }

    , hide: function () {
        var that = this
          , $tip = this.tip()
          , e = $.Event('hide')

        this.$element.trigger(e)
        if (e.isDefaultPrevented()) return

        $tip.removeClass('in')

        function removeWithAnimation() {
            var timeout = setTimeout(function () {
                $tip.off($.support.transition.end).detach()
            }, 500)

            $tip.one($.support.transition.end, function () {
                clearTimeout(timeout)
                $tip.detach()
            })
        }

        $.support.transition && this.$tip.hasClass('fade') ?
          removeWithAnimation() :
          $tip.detach()

        this.$element.trigger('hidden')

        return this
    }

    , fixTitle: function () {
        var $e = this.$element
        if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
            $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
        }
    }

    , hasContent: function () {
        return this.getTitle()
    }

    , getPosition: function () {
        var el = this.$element[0]
        return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
            width: el.offsetWidth
        , height: el.offsetHeight
        }, this.$element.offset())
    }

    , getTitle: function () {
        var title
          , $e = this.$element
          , o = this.options

        title = $e.attr('data-original-title')
          || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)

        return title
    }

    , tip: function () {
        return this.$tip = this.$tip || $(this.options.template)
    }

    , arrow: function () {
        return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
    }

    , validate: function () {
        if (!this.$element[0].parentNode) {
            this.hide()
            this.$element = null
            this.options = null
        }
    }

    , enable: function () {
        this.enabled = true
    }

    , disable: function () {
        this.enabled = false
    }

    , toggleEnabled: function () {
        this.enabled = !this.enabled
    }

    , toggle: function (e) {
        var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this
        self.tip().hasClass('in') ? self.hide() : self.show()
    }

    , destroy: function () {
        this.hide().$element.off('.' + this.type).removeData(this.type)
    }

    }


    /* TOOLTIP PLUGIN DEFINITION
     * ========================= */

    var old = $.fn.tooltip

    $.fn.tooltip = function (option) {
        return this.each(function () {
            var $this = $(this)
              , data = $this.data('tooltip')
              , options = typeof option == 'object' && option
            if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
            if (typeof option == 'string') data[option]()
        })
    }

    $.fn.tooltip.Constructor = Tooltip

    $.fn.tooltip.defaults = {
        animation: true
    , placement: 'top'
    , selector: false
    , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
    , trigger: 'hover focus'
    , title: ''
    , delay: 0
    , html: false
    , container: false
    }


    /* TOOLTIP NO CONFLICT
     * =================== */

    $.fn.tooltip.noConflict = function () {
        $.fn.tooltip = old
        return this
    }

}(window.jQuery);

/* ===========================================================
 * bootstrap-popover.js v2.3.2
 * http://twitter.github.com/bootstrap/javascript.html#popovers
 * ===========================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * =========================================================== */


!function ($) {

    "use strict"; // jshint ;_;


    /* POPOVER PUBLIC CLASS DEFINITION
     * =============================== */

    var Popover = function (element, options) {
        this.init('popover', element, options)
    }


    /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
       ========================================== */

    Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {

        constructor: Popover

    , setContent: function () {
        var $tip = this.tip()
          , title = this.getTitle()
          , content = this.getContent()

        $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
        $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)

        $tip.removeClass('fade top bottom left right in')
    }

    , hasContent: function () {
        return this.getTitle() || this.getContent()
    }

    , getContent: function () {
        var content
          , $e = this.$element
          , o = this.options

        content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
          || $e.attr('data-content')

        return content
    }

    , tip: function () {
        if (!this.$tip) {
            this.$tip = $(this.options.template)
        }
        return this.$tip
    }

    , destroy: function () {
        this.hide().$element.off('.' + this.type).removeData(this.type)
    }

    })


    /* POPOVER PLUGIN DEFINITION
     * ======================= */

    var old = $.fn.popover

    $.fn.popover = function (option) {
        return this.each(function () {
            var $this = $(this)
              , data = $this.data('popover')
              , options = typeof option == 'object' && option
            if (!data) $this.data('popover', (data = new Popover(this, options)))
            if (typeof option == 'string') data[option]()
        })
    }

    $.fn.popover.Constructor = Popover

    $.fn.popover.defaults = $.extend({}, $.fn.tooltip.defaults, {
        placement: 'right'
    , trigger: 'click'
    , content: ''
    , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
    })


    /* POPOVER NO CONFLICT
     * =================== */

    $.fn.popover.noConflict = function () {
        $.fn.popover = old
        return this
    }

}(window.jQuery);

/* ==========================================================
 * bootstrap-affix.js v2.3.2
 * http://twitter.github.com/bootstrap/javascript.html#affix
 * ==========================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================== */


!function ($) {

    "use strict"; // jshint ;_;


    /* AFFIX CLASS DEFINITION
     * ====================== */

    var Affix = function (element, options) {
        this.options = $.extend({}, $.fn.affix.defaults, options)
        this.$window = $(window)
          .on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
          .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
        this.$element = $(element)
        this.checkPosition()
    }

    Affix.prototype.checkPosition = function () {
        if (!this.$element.is(':visible')) return

        var scrollHeight = $(document).height()
          , scrollTop = this.$window.scrollTop()
          , position = this.$element.offset()
          , offset = this.options.offset
          , offsetBottom = offset.bottom
          , offsetTop = offset.top
          , reset = 'affix affix-top affix-bottom'
          , affix

        if (typeof offset != 'object') offsetBottom = offsetTop = offset
        if (typeof offsetTop == 'function') offsetTop = offset.top()
        if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()

        affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
          false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
          'bottom' : offsetTop != null && scrollTop <= offsetTop ?
          'top' : false

        if (this.affixed === affix) return

        this.affixed = affix
        this.unpin = affix == 'bottom' ? position.top - scrollTop : null

        this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
    }


    /* AFFIX PLUGIN DEFINITION
     * ======================= */

    var old = $.fn.affix

    $.fn.affix = function (option) {
        return this.each(function () {
            var $this = $(this)
              , data = $this.data('affix')
              , options = typeof option == 'object' && option
            if (!data) $this.data('affix', (data = new Affix(this, options)))
            if (typeof option == 'string') data[option]()
        })
    }

    $.fn.affix.Constructor = Affix

    $.fn.affix.defaults = {
        offset: 0
    }


    /* AFFIX NO CONFLICT
     * ================= */

    $.fn.affix.noConflict = function () {
        $.fn.affix = old
        return this
    }


    /* AFFIX DATA-API
     * ============== */

    $(window).on('load', function () {
        $('[data-spy="affix"]').each(function () {
            var $spy = $(this)
              , data = $spy.data()

            data.offset = data.offset || {}

            data.offsetBottom && (data.offset.bottom = data.offsetBottom)
            data.offsetTop && (data.offset.top = data.offsetTop)

            $spy.affix(data)
        })
    })


}(window.jQuery);
/* ==========================================================
 * bootstrap-alert.js v2.3.2
 * http://twitter.github.com/bootstrap/javascript.html#alerts
 * ==========================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================== */


!function ($) {

    "use strict"; // jshint ;_;


    /* ALERT CLASS DEFINITION
     * ====================== */

    var dismiss = '[data-dismiss="alert"]'
      , Alert = function (el) {
          $(el).on('click', dismiss, this.close)
      }

    Alert.prototype.close = function (e) {
        var $this = $(this)
          , selector = $this.attr('data-target')
          , $parent

        if (!selector) {
            selector = $this.attr('href')
            selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
        }

        $parent = $(selector)

        e && e.preventDefault()

        $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())

        $parent.trigger(e = $.Event('close'))

        if (e.isDefaultPrevented()) return

        $parent.removeClass('in')

        function removeElement() {
            $parent
              .trigger('closed')
              .remove()
        }

        $.support.transition && $parent.hasClass('fade') ?
          $parent.on($.support.transition.end, removeElement) :
          removeElement()
    }


    /* ALERT PLUGIN DEFINITION
     * ======================= */

    var old = $.fn.alert

    $.fn.alert = function (option) {
        return this.each(function () {
            var $this = $(this)
              , data = $this.data('alert')
            if (!data) $this.data('alert', (data = new Alert(this)))
            if (typeof option == 'string') data[option].call($this)
        })
    }

    $.fn.alert.Constructor = Alert


    /* ALERT NO CONFLICT
     * ================= */

    $.fn.alert.noConflict = function () {
        $.fn.alert = old
        return this
    }


    /* ALERT DATA-API
     * ============== */

    $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)

}(window.jQuery);
/* ============================================================
 * bootstrap-button.js v2.3.2
 * http://twitter.github.com/bootstrap/javascript.html#buttons
 * ============================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================ */


!function ($) {

    "use strict"; // jshint ;_;


    /* BUTTON PUBLIC CLASS DEFINITION
     * ============================== */

    var Button = function (element, options) {
        this.$element = $(element)
        this.options = $.extend({}, $.fn.button.defaults, options)
    }

    Button.prototype.setState = function (state) {
        var d = 'disabled'
          , $el = this.$element
          , data = $el.data()
          , val = $el.is('input') ? 'val' : 'html'

        state = state + 'Text'
        data.resetText || $el.data('resetText', $el[val]())

        $el[val](data[state] || this.options[state])

        // push to event loop to allow forms to submit
        setTimeout(function () {
            state == 'loadingText' ?
              $el.addClass(d).attr(d, d) :
              $el.removeClass(d).removeAttr(d)
        }, 0)
    }

    Button.prototype.toggle = function () {
        var $parent = this.$element.closest('[data-toggle="buttons-radio"]')

        $parent && $parent
          .find('.active')
          .removeClass('active')

        this.$element.toggleClass('active')
    }


    /* BUTTON PLUGIN DEFINITION
     * ======================== */

    var old = $.fn.button

    $.fn.button = function (option) {
        return this.each(function () {
            var $this = $(this)
              , data = $this.data('button')
              , options = typeof option == 'object' && option
            if (!data) $this.data('button', (data = new Button(this, options)))
            if (option == 'toggle') data.toggle()
            else if (option) data.setState(option)
        })
    }

    $.fn.button.defaults = {
        loadingText: 'loading...'
    }

    $.fn.button.Constructor = Button


    /* BUTTON NO CONFLICT
     * ================== */

    $.fn.button.noConflict = function () {
        $.fn.button = old
        return this
    }


    /* BUTTON DATA-API
     * =============== */

    $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
        var $btn = $(e.target)
        if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
        $btn.button('toggle')
    })

}(window.jQuery);
/* =============================================================
 * bootstrap-collapse.js v2.3.2
 * http://twitter.github.com/bootstrap/javascript.html#collapse
 * =============================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================ */


!function ($) {

    "use strict"; // jshint ;_;


    /* COLLAPSE PUBLIC CLASS DEFINITION
     * ================================ */

    var Collapse = function (element, options) {
        this.$element = $(element)
        this.options = $.extend({}, $.fn.collapse.defaults, options)

        if (this.options.parent) {
            this.$parent = $(this.options.parent)
        }

        this.options.toggle && this.toggle()
    }

    Collapse.prototype = {

        constructor: Collapse

    , dimension: function () {
        var hasWidth = this.$element.hasClass('width')
        return hasWidth ? 'width' : 'height'
    }

    , show: function () {
        var dimension
          , scroll
          , actives
          , hasData

        if (this.transitioning || this.$element.hasClass('in')) return

        dimension = this.dimension()
        scroll = $.camelCase(['scroll', dimension].join('-'))
        actives = this.$parent && this.$parent.find('> .accordion-group > .in')

        if (actives && actives.length) {
            hasData = actives.data('collapse')
            if (hasData && hasData.transitioning) return
            actives.collapse('hide')
            hasData || actives.data('collapse', null)
        }

        this.$element[dimension](0)
        this.transition('addClass', $.Event('show'), 'shown')
        $.support.transition && this.$element[dimension](this.$element[0][scroll])
    }

    , hide: function () {
        var dimension
        if (this.transitioning || !this.$element.hasClass('in')) return
        dimension = this.dimension()
        this.reset(this.$element[dimension]())
        this.transition('removeClass', $.Event('hide'), 'hidden')
        this.$element[dimension](0)
    }

    , reset: function (size) {
        var dimension = this.dimension()

        this.$element
          .removeClass('collapse')
          [dimension](size || 'auto')
          [0].offsetWidth

        this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')

        return this
    }

    , transition: function (method, startEvent, completeEvent) {
        var that = this
          , complete = function () {
              if (startEvent.type == 'show') that.reset()
              that.transitioning = 0
              that.$element.trigger(completeEvent)
          }

        this.$element.trigger(startEvent)

        if (startEvent.isDefaultPrevented()) return

        this.transitioning = 1

        this.$element[method]('in')

        $.support.transition && this.$element.hasClass('collapse') ?
          this.$element.one($.support.transition.end, complete) :
          complete()
    }

    , toggle: function () {
        this[this.$element.hasClass('in') ? 'hide' : 'show']()
    }

    }


    /* COLLAPSE PLUGIN DEFINITION
     * ========================== */

    var old = $.fn.collapse

    $.fn.collapse = function (option) {
        return this.each(function () {
            var $this = $(this)
              , data = $this.data('collapse')
              , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
            if (!data) $this.data('collapse', (data = new Collapse(this, options)))
            if (typeof option == 'string') data[option]()
        })
    }

    $.fn.collapse.defaults = {
        toggle: true
    }

    $.fn.collapse.Constructor = Collapse


    /* COLLAPSE NO CONFLICT
     * ==================== */

    $.fn.collapse.noConflict = function () {
        $.fn.collapse = old
        return this
    }


    /* COLLAPSE DATA-API
     * ================= */

    $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
        var $this = $(this), href
          , target = $this.attr('data-target')
            || e.preventDefault()
            || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
          , option = $(target).data('collapse') ? 'toggle' : $this.data()
        $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
        $(target).collapse(option)
    })

}(window.jQuery);
/* ==========================================================
 * bootstrap-carousel.js v2.3.2
 * http://twitter.github.com/bootstrap/javascript.html#carousel
 * ==========================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================== */


!function ($) {

    "use strict"; // jshint ;_;


    /* CAROUSEL CLASS DEFINITION
     * ========================= */

    var Carousel = function (element, options) {
        this.$element = $(element)
        this.$indicators = this.$element.find('.carousel-indicators')
        this.options = options
        this.options.pause == 'hover' && this.$element
          .on('mouseenter', $.proxy(this.pause, this))
          .on('mouseleave', $.proxy(this.cycle, this))
    }

    Carousel.prototype = {

        cycle: function (e) {
            if (!e) this.paused = false
            if (this.interval) clearInterval(this.interval);
            this.options.interval
              && !this.paused
              && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
            return this
        }

    , getActiveIndex: function () {
        this.$active = this.$element.find('.item.active')
        this.$items = this.$active.parent().children()
        return this.$items.index(this.$active)
    }

    , to: function (pos) {
        var activeIndex = this.getActiveIndex()
          , that = this

        if (pos > (this.$items.length - 1) || pos < 0) return

        if (this.sliding) {
            return this.$element.one('slid', function () {
                that.to(pos)
            })
        }

        if (activeIndex == pos) {
            return this.pause().cycle()
        }

        return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
    }

    , pause: function (e) {
        if (!e) this.paused = true
        if (this.$element.find('.next, .prev').length && $.support.transition.end) {
            this.$element.trigger($.support.transition.end)
            this.cycle(true)
        }
        clearInterval(this.interval)
        this.interval = null
        return this
    }

    , next: function () {
        if (this.sliding) return
        return this.slide('next')
    }

    , prev: function () {
        if (this.sliding) return
        return this.slide('prev')
    }

    , slide: function (type, next) {
        var $active = this.$element.find('.item.active')
          , $next = next || $active[type]()
          , isCycling = this.interval
          , direction = type == 'next' ? 'left' : 'right'
          , fallback = type == 'next' ? 'first' : 'last'
          , that = this
          , e

        this.sliding = true

        isCycling && this.pause()

        $next = $next.length ? $next : this.$element.find('.item')[fallback]()

        e = $.Event('slide', {
            relatedTarget: $next[0]
        , direction: direction
        })

        if ($next.hasClass('active')) return

        if (this.$indicators.length) {
            this.$indicators.find('.active').removeClass('active')
            this.$element.one('slid', function () {
                var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
                $nextIndicator && $nextIndicator.addClass('active')
            })
        }

        if ($.support.transition && this.$element.hasClass('slide')) {
            this.$element.trigger(e)
            if (e.isDefaultPrevented()) return
            $next.addClass(type)
            $next[0].offsetWidth // force reflow
            $active.addClass(direction)
            $next.addClass(direction)
            this.$element.one($.support.transition.end, function () {
                $next.removeClass([type, direction].join(' ')).addClass('active')
                $active.removeClass(['active', direction].join(' '))
                that.sliding = false
                setTimeout(function () { that.$element.trigger('slid') }, 0)
            })
        } else {
            this.$element.trigger(e)
            if (e.isDefaultPrevented()) return
            $active.removeClass('active')
            $next.addClass('active')
            this.sliding = false
            this.$element.trigger('slid')
        }

        isCycling && this.cycle()

        return this
    }

    }


    /* CAROUSEL PLUGIN DEFINITION
     * ========================== */

    var old = $.fn.carousel

    $.fn.carousel = function (option) {
        return this.each(function () {
            var $this = $(this)
              , data = $this.data('carousel')
              , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
              , action = typeof option == 'string' ? option : options.slide
            if (!data) $this.data('carousel', (data = new Carousel(this, options)))
            if (typeof option == 'number') data.to(option)
            else if (action) data[action]()
            else if (options.interval) data.pause().cycle()
        })
    }

    $.fn.carousel.defaults = {
        interval: 5000
    , pause: 'hover'
    }

    $.fn.carousel.Constructor = Carousel


    /* CAROUSEL NO CONFLICT
     * ==================== */

    $.fn.carousel.noConflict = function () {
        $.fn.carousel = old
        return this
    }

    /* CAROUSEL DATA-API
     * ================= */

    $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
        var $this = $(this), href
          , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
          , options = $.extend({}, $target.data(), $this.data())
          , slideIndex

        $target.carousel(options)

        if (slideIndex = $this.attr('data-slide-to')) {
            $target.data('carousel').pause().to(slideIndex).cycle()
        }

        e.preventDefault()
    })

}(window.jQuery);
/* =============================================================
 * bootstrap-typeahead.js v2.3.2
 * http://twitter.github.com/bootstrap/javascript.html#typeahead
 * =============================================================
 * Copyright 2012 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================ */


!function ($) {

    "use strict"; // jshint ;_;


    /* TYPEAHEAD PUBLIC CLASS DEFINITION
     * ================================= */

    var Typeahead = function (element, options) {
        this.$element = $(element)
        this.options = $.extend({}, $.fn.typeahead.defaults, options)
        this.matcher = this.options.matcher || this.matcher
        this.sorter = this.options.sorter || this.sorter
        this.highlighter = this.options.highlighter || this.highlighter
        this.updater = this.options.updater || this.updater
        this.source = this.options.source
        this.$menu = $(this.options.menu)
        this.shown = false
        this.listen()
    }

    Typeahead.prototype = {

        constructor: Typeahead

    , select: function () {
        var val = this.$menu.find('.active').attr('data-value')
        this.$element
          .val(this.updater(val))
          .change()
        return this.hide()
    }

    , updater: function (item) {
        return item
    }

    , show: function () {
        var pos = $.extend({}, this.$element.position(), {
            height: this.$element[0].offsetHeight
        })

        this.$menu
          .insertAfter(this.$element)
          .css({
              top: pos.top + pos.height
          , left: pos.left
          })
          .show()

        this.shown = true
        return this
    }

    , hide: function () {
        this.$menu.hide()
        this.shown = false
        return this
    }

    , lookup: function (event) {
        var items
        this.query = this.$element.val()
        
        //if (!this.query || this.query.length < this.options.minLength) {
        //    return this.shown ? this.hide() : this
        //}

        items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source

        return items ? this.process(items) : this
    }

    , process: function (items) {
        var that = this
        items = $.grep(items, function (item) {
            return that.matcher(item)
        })

        items = this.sorter(items)

        if (!items.length) {
            return this.shown ? this.hide() : this
        }

        return this.render(items.slice(0, this.options.items)).show()
    }

    , matcher: function (item) {
        return ~item.toLowerCase().indexOf(this.query.toLowerCase())
    }

    , sorter: function (items) {
        var beginswith = []
          , caseSensitive = []
          , caseInsensitive = []
          , item

        while (item = items.shift()) {
            if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
            else if (~item.indexOf(this.query)) caseSensitive.push(item)
            else caseInsensitive.push(item)
        }

        return beginswith.concat(caseSensitive, caseInsensitive)
    }

    , highlighter: function (item) {
        var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
        return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
            return '<strong>' + match + '</strong>'
        })
    }

    , render: function (items) {
        var that = this

        items = $(items).map(function (i, item) {
            i = $(that.options.item).attr('data-value', item)
            i.find('a').html(that.highlighter(item))
            return i[0]
        })

        items.first().addClass('active')
        this.$menu.html(items)
        return this
    }

    , next: function (event) {
        var active = this.$menu.find('.active').removeClass('active')
          , next = active.next()

        if (!next.length) {
            next = $(this.$menu.find('li')[0])
        }

        next.addClass('active')
    }

    , prev: function (event) {
        var active = this.$menu.find('.active').removeClass('active')
          , prev = active.prev()

        if (!prev.length) {
            prev = this.$menu.find('li').last()
        }

        prev.addClass('active')
    }

    , listen: function () {
        this.$element
          .on('focus', $.proxy(this.focus, this))
          .on('blur', $.proxy(this.blur, this))
          .on('keypress', $.proxy(this.keypress, this))
          .on('keyup', $.proxy(this.keyup, this))

        if (this.eventSupported('keydown')) {
            this.$element.on('keydown', $.proxy(this.keydown, this))
        }

        this.$menu
          .on('click', $.proxy(this.click, this))
          .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
          .on('mouseleave', 'li', $.proxy(this.mouseleave, this))
    }

    , eventSupported: function (eventName) {
        var isSupported = eventName in this.$element
        if (!isSupported) {
            this.$element.setAttribute(eventName, 'return;')
            isSupported = typeof this.$element[eventName] === 'function'
        }
        return isSupported
    }

    , move: function (e) {
        if (!this.shown) return

        switch (e.keyCode) {
            case 9: // tab
            case 13: // enter
            case 27: // escape
                e.preventDefault()
                break

            case 38: // up arrow
                e.preventDefault()
                this.prev()
                break

            case 40: // down arrow
                e.preventDefault()
                this.next()
                break
        }

        e.stopPropagation()
    }

    , keydown: function (e) {
        
        this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40, 38, 9, 13, 27])
        this.move(e)
    }

    , keypress: function (e) {
        if (this.suppressKeyPressRepeat) return
        this.move(e)
    }

    , keyup: function (e) {
        switch (e.keyCode) {
            case 40: // down arrow
            case 38: // up arrow
            case 16: // shift
            case 17: // ctrl
            case 18: // alt
                break

            case 9: // tab
            case 13: // enter
                if (!this.shown) return
                this.select()
                break

            case 27: // escape
                if (!this.shown) return
                this.hide()
                break

            default:
                this.lookup()
        }

        e.stopPropagation()
        e.preventDefault()
    }

    , focus: function (e) {
        this.focused = true;
        this.lookup();
    }

    , blur: function (e) {
        this.focused = false
        if (!this.mousedover && this.shown) this.hide()
    }

    , click: function (e) {
        e.stopPropagation()
        e.preventDefault()
        this.select()
        this.$element.focus()
    }

    , mouseenter: function (e) {
        this.mousedover = true
        this.$menu.find('.active').removeClass('active')
        $(e.currentTarget).addClass('active')
    }

    , mouseleave: function (e) {
        this.mousedover = false
        if (!this.focused && this.shown) this.hide()
    }

    }


    /* TYPEAHEAD PLUGIN DEFINITION
     * =========================== */

    var old = $.fn.typeahead

    $.fn.typeahead = function (option) {
        return this.each(function () {
            var $this = $(this)
              , data = $this.data('typeahead')
              , options = typeof option == 'object' && option
            if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
            if (typeof option == 'string') data[option]()
        })
    }

    $.fn.typeahead.defaults = {
        source: []
    , menu: '<ul class="typeahead dropdown-menu"></ul>'
    , item: '<li><a href="#"></a></li>'
    , minLength: 0
    }

    $.fn.typeahead.Constructor = Typeahead


    /* TYPEAHEAD NO CONFLICT
     * =================== */

    $.fn.typeahead.noConflict = function () {
        $.fn.typeahead = old
        return this
    }


    /* TYPEAHEAD DATA-API
     * ================== */

    $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
        var $this = $(this)
        if ($this.data('typeahead')) return
        $this.typeahead($this.data())
    })

}(window.jQuery);;
(function(){"use strict";var a=angular.module("LocalStorageModule",[]);a.provider("localStorageService",function(){this.prefix="ls",this.storageType="localStorage",this.cookie={expiry:30,path:"/"},this.notify={setItem:!0,removeItem:!1},this.setPrefix=function(a){this.prefix=a},this.setStorageType=function(a){this.storageType=a},this.setStorageCookie=function(a,b){this.cookie={expiry:a,path:b}},this.setStorageCookieDomain=function(a){this.cookie.domain=a},this.setNotify=function(a,b){this.notify={setItem:a,removeItem:b}},this.$get=["$rootScope","$window","$document",function(a,b,c){var d,e=this.prefix,f=this.cookie,g=this.notify,h=this.storageType;c||(c=document),"."!==e.substr(-1)&&(e=e?e+".":"");var i=function(a){return e+a},j=function(){try{var c=h in b&&null!==b[h],e=i("__"+Math.round(1e7*Math.random()));return c&&(d=b[h],d.setItem(e,""),d.removeItem(e)),c}catch(f){return h="cookie",a.$broadcast("LocalStorageModule.notification.error",f.message),!1}}(),k=function(b,c){if(!j)return a.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),g.setItem&&a.$broadcast("LocalStorageModule.notification.setitem",{key:b,newvalue:c,storageType:"cookie"}),q(b,c);"undefined"==typeof c&&(c=null);try{(angular.isObject(c)||angular.isArray(c))&&(c=angular.toJson(c)),d&&d.setItem(i(b),c),g.setItem&&a.$broadcast("LocalStorageModule.notification.setitem",{key:b,newvalue:c,storageType:this.storageType})}catch(e){return a.$broadcast("LocalStorageModule.notification.error",e.message),q(b,c)}return!0},l=function(b){if(!j)return a.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),r(b);var c=d?d.getItem(i(b)):null;return c&&"null"!==c?"{"===c.charAt(0)||"["===c.charAt(0)?angular.fromJson(c):c:null},m=function(b){if(!j)return a.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),g.removeItem&&a.$broadcast("LocalStorageModule.notification.removeitem",{key:b,storageType:"cookie"}),s(b);try{d.removeItem(i(b)),g.removeItem&&a.$broadcast("LocalStorageModule.notification.removeitem",{key:b,storageType:this.storageType})}catch(c){return a.$broadcast("LocalStorageModule.notification.error",c.message),s(b)}return!0},n=function(){if(!j)return a.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),!1;var b=e.length,c=[];for(var f in d)if(f.substr(0,b)===e)try{c.push(f.substr(b))}catch(g){return a.$broadcast("LocalStorageModule.notification.error",g.Description),[]}return c},o=function(b){b=b||"";var c=e.slice(0,-1),f=new RegExp(c+"."+b);if(!j)return a.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),t();var g=e.length;for(var h in d)if(f.test(h))try{m(h.substr(g))}catch(i){return a.$broadcast("LocalStorageModule.notification.error",i.message),t()}return!0},p=function(){try{return navigator.cookieEnabled||"cookie"in c&&(c.cookie.length>0||(c.cookie="test").indexOf.call(c.cookie,"test")>-1)}catch(b){return a.$broadcast("LocalStorageModule.notification.error",b.message),!1}},q=function(b,d){if("undefined"==typeof d)return!1;if(!p())return a.$broadcast("LocalStorageModule.notification.error","COOKIES_NOT_SUPPORTED"),!1;try{var e="",g=new Date,h="";if(null===d?(g.setTime(g.getTime()+-864e5),e="; expires="+g.toGMTString(),d=""):0!==f.expiry&&(g.setTime(g.getTime()+24*f.expiry*60*60*1e3),e="; expires="+g.toGMTString()),b){var j="; path="+f.path;f.domain&&(h="; domain="+f.domain),c.cookie=i(b)+"="+encodeURIComponent(d)+e+j+h}}catch(k){return a.$broadcast("LocalStorageModule.notification.error",k.message),!1}return!0},r=function(b){if(!p())return a.$broadcast("LocalStorageModule.notification.error","COOKIES_NOT_SUPPORTED"),!1;for(var d=c.cookie&&c.cookie.split(";")||[],f=0;f<d.length;f++){for(var g=d[f];" "===g.charAt(0);)g=g.substring(1,g.length);if(0===g.indexOf(i(b)+"="))return decodeURIComponent(g.substring(e.length+b.length+1,g.length))}return null},s=function(a){q(a,null)},t=function(){for(var a=null,b=e.length,d=c.cookie.split(";"),f=0;f<d.length;f++){for(a=d[f];" "===a.charAt(0);)a=a.substring(1,a.length);var g=a.substring(b,a.indexOf("="));s(g)}},u=function(){return h},v=function(a,b,c){var d=l(b);null===d&&angular.isDefined(c)?d=c:angular.isObject(d)&&angular.isObject(c)&&(d=angular.extend(c,d)),a[b]=d,a.$watchCollection(b,function(a){k(b,a)})};return{isSupported:j,getStorageType:u,set:k,add:k,get:l,keys:n,remove:m,clearAll:o,bind:v,deriveKey:i,cookie:{set:q,add:q,get:r,remove:s,clearAll:t}}}]})}).call(this);;
/*
 * angular-ui-bootstrap
 * http://angular-ui.github.io/bootstrap/

 * Version: 0.10.0 - 2014-01-13
 * License: MIT
 */
angular.module("ui.bootstrap", ["ui.bootstrap.tpls", "ui.bootstrap.transition", "ui.bootstrap.collapse", "ui.bootstrap.accordion", "ui.bootstrap.alert", "ui.bootstrap.bindHtml", "ui.bootstrap.buttons", "ui.bootstrap.carousel", "ui.bootstrap.position", "ui.bootstrap.datepicker", "ui.bootstrap.dropdownToggle", "ui.bootstrap.actionToggle", "ui.bootstrap.modal", "ui.bootstrap.pagination", "ui.bootstrap.tooltip", "ui.bootstrap.popover", "ui.bootstrap.progressbar", "ui.bootstrap.rating", "ui.bootstrap.tabs", "ui.bootstrap.timepicker", "ui.bootstrap.typeahead"]);
angular.module("ui.bootstrap.tpls", ["template/accordion/accordion-group.html", "template/accordion/accordion.html", "template/alert/alert.html", "template/carousel/carousel.html", "template/carousel/slide.html", "template/datepicker/datepicker.html", "template/datepicker/popup.html", "template/modal/backdrop.html", "template/modal/window.html", "template/pagination/pager.html", "template/pagination/pagination.html", "template/tooltip/tooltip-html-unsafe-popup.html", "template/tooltip/tooltip-popup.html", "template/popover/popover.html", "template/progressbar/bar.html", "template/progressbar/progress.html", "template/progressbar/progressbar.html", "template/rating/rating.html", "template/tabs/tab.html", "template/tabs/tabset.html", "template/timepicker/timepicker.html", "template/typeahead/typeahead-match.html", "template/typeahead/typeahead-popup.html"]);
angular.module('ui.bootstrap.transition', [])

    /**
     * $transition service provides a consistent interface to trigger CSS 3 transitions and to be informed when they complete.
     * @param  {DOMElement} element  The DOMElement that will be animated.
     * @param  {string|object|function} trigger  The thing that will cause the transition to start:
     *   - As a string, it represents the css class to be added to the element.
     *   - As an object, it represents a hash of style attributes to be applied to the element.
     *   - As a function, it represents a function to be called that will cause the transition to occur.
     * @return {Promise}  A promise that is resolved when the transition finishes.
     */
    .factory('$transition', ['$q', '$timeout', '$rootScope', function ($q, $timeout, $rootScope) {

        var $transition = function (element, trigger, options) {
            options = options || {};
            var deferred = $q.defer();
            var endEventName = $transition[options.animation ? "animationEndEventName" : "transitionEndEventName"];

            var transitionEndHandler = function (event) {
                $rootScope.$apply(function () {
                    element.unbind(endEventName, transitionEndHandler);
                    deferred.resolve(element);
                });
            };

            if (endEventName) {
                element.bind(endEventName, transitionEndHandler);
            }

            // Wrap in a timeout to allow the browser time to update the DOM before the transition is to occur
            $timeout(function () {
                if (angular.isString(trigger)) {
                    element.addClass(trigger);
                } else if (angular.isFunction(trigger)) {
                    trigger(element);
                } else if (angular.isObject(trigger)) {
                    element.css(trigger);
                }
                //If browser does not support transitions, instantly resolve
                if (!endEventName) {
                    deferred.resolve(element);
                }
            });

            // Add our custom cancel function to the promise that is returned
            // We can call this if we are about to run a new transition, which we know will prevent this transition from ending,
            // i.e. it will therefore never raise a transitionEnd event for that transition
            deferred.promise.cancel = function () {
                if (endEventName) {
                    element.unbind(endEventName, transitionEndHandler);
                }
                deferred.reject('Transition cancelled');
            };

            return deferred.promise;
        };

        // Work out the name of the transitionEnd event
        var transElement = document.createElement('trans');
        var transitionEndEventNames = {
            'WebkitTransition': 'webkitTransitionEnd',
            'MozTransition': 'transitionend',
            'OTransition': 'oTransitionEnd',
            'transition': 'transitionend'
        };
        var animationEndEventNames = {
            'WebkitTransition': 'webkitAnimationEnd',
            'MozTransition': 'animationend',
            'OTransition': 'oAnimationEnd',
            'transition': 'animationend'
        };
        function findEndEventName(endEventNames) {
            for (var name in endEventNames) {
                if (transElement.style[name] !== undefined) {
                    return endEventNames[name];
                }
            }
        }
        $transition.transitionEndEventName = findEndEventName(transitionEndEventNames);
        $transition.animationEndEventName = findEndEventName(animationEndEventNames);
        return $transition;
    }]);

angular.module('ui.bootstrap.collapse', ['ui.bootstrap.transition'])

    .directive('collapse', ['$transition', '$timeout', function ($transition, $timeout) {

        return {
            link: function (scope, element, attrs) {

                var initialAnimSkip = true;
                var currentTransition;

                function doTransition(change) {
                    var newTransition = $transition(element, change);
                    if (currentTransition) {
                        currentTransition.cancel();
                    }
                    currentTransition = newTransition;
                    newTransition.then(newTransitionDone, newTransitionDone);
                    return newTransition;

                    function newTransitionDone() {
                        // Make sure it's this transition, otherwise, leave it alone.
                        if (currentTransition === newTransition) {
                            currentTransition = undefined;
                        }
                    }
                }

                function expand() {
                    if (initialAnimSkip) {
                        initialAnimSkip = false;
                        expandDone();
                    } else {
                        element.removeClass('collapse').addClass('collapsing');
                        doTransition({ height: element[0].scrollHeight + 'px' }).then(expandDone);
                    }
                }

                function expandDone() {
                    element.removeClass('collapsing');
                    element.addClass('collapse in');
                    element.css({ height: 'auto' });
                }

                function collapse() {
                    if (initialAnimSkip) {
                        initialAnimSkip = false;
                        collapseDone();
                        element.css({ height: 0 });
                    } else {
                        // CSS transitions don't work with height: auto, so we have to manually change the height to a specific value
                        element.css({ height: element[0].scrollHeight + 'px' });
                        //trigger reflow so a browser realizes that height was updated from auto to a specific value
                        var x = element[0].offsetWidth;

                        element.removeClass('collapse in').addClass('collapsing');

                        doTransition({ height: 0 }).then(collapseDone);
                    }
                }

                function collapseDone() {
                    element.removeClass('collapsing');
                    element.addClass('collapse');
                }

                scope.$watch(attrs.collapse, function (shouldCollapse) {
                    if (shouldCollapse) {
                        collapse();
                    } else {
                        expand();
                    }
                });
            }
        };
    }]);

angular.module('ui.bootstrap.accordion', ['ui.bootstrap.collapse'])

    .constant('accordionConfig', {
        closeOthers: true
    })

    .controller('AccordionController', ['$scope', '$attrs', 'accordionConfig', function ($scope, $attrs, accordionConfig) {

        // This array keeps track of the accordion groups
        this.groups = [];

        // Ensure that all the groups in this accordion are closed, unless close-others explicitly says not to
        this.closeOthers = function (openGroup) {
            var closeOthers = angular.isDefined($attrs.closeOthers) ? $scope.$eval($attrs.closeOthers) : accordionConfig.closeOthers;
            if (closeOthers) {
                angular.forEach(this.groups, function (group) {
                    if (group !== openGroup) {
                        group.isOpen = false;
                    }
                });
            }
        };

        // This is called from the accordion-group directive to add itself to the accordion
        this.addGroup = function (groupScope) {
            var that = this;
            this.groups.push(groupScope);

            groupScope.$on('$destroy', function (event) {
                that.removeGroup(groupScope);
            });
        };

        // This is called from the accordion-group directive when to remove itself
        this.removeGroup = function (group) {
            var index = this.groups.indexOf(group);
            if (index !== -1) {
                this.groups.splice(this.groups.indexOf(group), 1);
            }
        };

    }])

    // The accordion directive simply sets up the directive controller
    // and adds an accordion CSS class to itself element.
    .directive('accordion', function () {
        return {
            restrict: 'EA',
            controller: 'AccordionController',
            transclude: true,
            replace: false,
            templateUrl: 'template/accordion/accordion.html'
        };
    })

    // The accordion-group directive indicates a block of html that will expand and collapse in an accordion
    .directive('accordionGroup', ['$parse', function ($parse) {
        return {
            require: '^accordion',         // We need this directive to be inside an accordion
            restrict: 'EA',
            transclude: true,              // It transcludes the contents of the directive into the template
            replace: true,                // The element containing the directive will be replaced with the template
            templateUrl: 'template/accordion/accordion-group.html',
            scope: { heading: '@' },        // Create an isolated scope and interpolate the heading attribute onto this scope
            controller: function () {
                this.setHeading = function (element) {
                    this.heading = element;
                };
            },
            link: function (scope, element, attrs, accordionCtrl) {
                var getIsOpen, setIsOpen;

                accordionCtrl.addGroup(scope);

                scope.isOpen = false;

                if (attrs.isOpen) {
                    getIsOpen = $parse(attrs.isOpen);
                    setIsOpen = getIsOpen.assign;

                    scope.$parent.$watch(getIsOpen, function (value) {
                        scope.isOpen = !!value;
                    });
                }

                scope.$watch('isOpen', function (value) {
                    if (value) {
                        accordionCtrl.closeOthers(scope);
                    }
                    if (setIsOpen) {
                        setIsOpen(scope.$parent, value);
                    }
                });
            }
        };
    }])

    // Use accordion-heading below an accordion-group to provide a heading containing HTML
    // <accordion-group>
    //   <accordion-heading>Heading containing HTML - <img src="..."></accordion-heading>
    // </accordion-group>
    .directive('accordionHeading', function () {
        return {
            restrict: 'EA',
            transclude: true,   // Grab the contents to be used as the heading
            template: '',       // In effect remove this element!
            replace: true,
            require: '^accordionGroup',
            compile: function (element, attr, transclude) {
                return function link(scope, element, attr, accordionGroupCtrl) {
                    // Pass the heading to the accordion-group controller
                    // so that it can be transcluded into the right place in the template
                    // [The second parameter to transclude causes the elements to be cloned so that they work in ng-repeat]
                    accordionGroupCtrl.setHeading(transclude(scope, function () { }));
                };
            }
        };
    })

    // Use in the accordion-group template to indicate where you want the heading to be transcluded
    // You must provide the property on the accordion-group controller that will hold the transcluded element
    // <div class="accordion-group">
    //   <div class="accordion-heading" ><a ... accordion-transclude="heading">...</a></div>
    //   ...
    // </div>
    .directive('accordionTransclude', function () {
        return {
            require: '^accordionGroup',
            link: function (scope, element, attr, controller) {
                scope.$watch(function () { return controller[attr.accordionTransclude]; }, function (heading) {
                    if (heading) {
                        element.html('');
                        element.append(heading);
                    }
                });
            }
        };
    });

angular.module("ui.bootstrap.alert", [])

    .controller('AlertController', ['$scope', '$attrs', function ($scope, $attrs) {
        $scope.closeable = 'close' in $attrs;
    }])

    .directive('alert', function () {
        return {
            restrict: 'EA',
            controller: 'AlertController',
            templateUrl: 'template/alert/alert.html',
            transclude: true,
            replace: true,
            scope: {
                type: '=',
                close: '&'
            }
        };
    });

angular.module('ui.bootstrap.bindHtml', [])

    .directive('bindHtmlUnsafe', function () {
        return function (scope, element, attr) {
            element.addClass('ng-binding').data('$binding', attr.bindHtmlUnsafe);
            scope.$watch(attr.bindHtmlUnsafe, function bindHtmlUnsafeWatchAction(value) {
                element.html(value || '');
            });
        };
    });
angular.module('ui.bootstrap.buttons', [])

    .constant('buttonConfig', {
        activeClass: 'active',
        toggleEvent: 'click'
    })

    .controller('ButtonsController', ['buttonConfig', function (buttonConfig) {
        this.activeClass = buttonConfig.activeClass || 'active';
        this.toggleEvent = buttonConfig.toggleEvent || 'click';
    }])

    .directive('btnRadio', function () {
        return {
            require: ['btnRadio', 'ngModel'],
            controller: 'ButtonsController',
            link: function (scope, element, attrs, ctrls) {
                var buttonsCtrl = ctrls[0], ngModelCtrl = ctrls[1];

                //model -> UI
                ngModelCtrl.$render = function () {
                    element.toggleClass(buttonsCtrl.activeClass, angular.equals(ngModelCtrl.$modelValue, scope.$eval(attrs.btnRadio)));
                };

                //ui->model
                element.bind(buttonsCtrl.toggleEvent, function () {
                    if (!element.hasClass(buttonsCtrl.activeClass)) {
                        scope.$apply(function () {
                            ngModelCtrl.$setViewValue(scope.$eval(attrs.btnRadio));
                            ngModelCtrl.$render();
                        });
                    }
                });
            }
        };
    })

    .directive('btnCheckbox', function () {
        return {
            require: ['btnCheckbox', 'ngModel'],
            controller: 'ButtonsController',
            link: function (scope, element, attrs, ctrls) {
                var buttonsCtrl = ctrls[0], ngModelCtrl = ctrls[1];

                function getTrueValue() {
                    return getCheckboxValue(attrs.btnCheckboxTrue, true);
                }

                function getFalseValue() {
                    return getCheckboxValue(attrs.btnCheckboxFalse, false);
                }

                function getCheckboxValue(attributeValue, defaultValue) {
                    var val = scope.$eval(attributeValue);
                    return angular.isDefined(val) ? val : defaultValue;
                }

                //model -> UI
                ngModelCtrl.$render = function () {
                    element.toggleClass(buttonsCtrl.activeClass, angular.equals(ngModelCtrl.$modelValue, getTrueValue()));
                };

                //ui->model
                element.bind(buttonsCtrl.toggleEvent, function () {
                    scope.$apply(function () {
                        ngModelCtrl.$setViewValue(element.hasClass(buttonsCtrl.activeClass) ? getFalseValue() : getTrueValue());
                        ngModelCtrl.$render();
                    });
                });
            }
        };
    });

/**
* @ngdoc overview
* @name ui.bootstrap.carousel
*
* @description
* AngularJS version of an image carousel.
*
*/
angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition'])
    .controller('CarouselController', ['$scope', '$timeout', '$transition', '$q', function ($scope, $timeout, $transition, $q) {
        var self = this,
            slides = self.slides = [],
            currentIndex = -1,
            currentTimeout, isPlaying;
        self.currentSlide = null;

        var destroyed = false;
        /* direction: "prev" or "next" */
        self.select = function (nextSlide, direction) {
            var nextIndex = slides.indexOf(nextSlide);
            //Decide direction if it's not given
            if (direction === undefined) {
                direction = nextIndex > currentIndex ? "next" : "prev";
            }
            if (nextSlide && nextSlide !== self.currentSlide) {
                if ($scope.$currentTransition) {
                    $scope.$currentTransition.cancel();
                    //Timeout so ng-class in template has time to fix classes for finished slide
                    $timeout(goNext);
                } else {
                    goNext();
                }
            }
            function goNext() {
                // Scope has been destroyed, stop here.
                if (destroyed) { return; }
                //If we have a slide to transition from and we have a transition type and we're allowed, go
                if (self.currentSlide && angular.isString(direction) && !$scope.noTransition && nextSlide.$element) {
                    //We shouldn't do class manip in here, but it's the same weird thing bootstrap does. need to fix sometime
                    nextSlide.$element.addClass(direction);
                    var reflow = nextSlide.$element[0].offsetWidth; //force reflow

                    //Set all other slides to stop doing their stuff for the new transition
                    angular.forEach(slides, function (slide) {
                        angular.extend(slide, { direction: '', entering: false, leaving: false, active: false });
                    });
                    angular.extend(nextSlide, { direction: direction, active: true, entering: true });
                    angular.extend(self.currentSlide || {}, { direction: direction, leaving: true });

                    $scope.$currentTransition = $transition(nextSlide.$element, {});
                    //We have to create new pointers inside a closure since next & current will change
                    (function (next, current) {
                        $scope.$currentTransition.then(
                            function () { transitionDone(next, current); },
                            function () { transitionDone(next, current); }
                        );
                    }(nextSlide, self.currentSlide));
                } else {
                    transitionDone(nextSlide, self.currentSlide);
                }
                self.currentSlide = nextSlide;
                currentIndex = nextIndex;
                //every time you change slides, reset the timer
                restartTimer();
            }
            function transitionDone(next, current) {
                angular.extend(next, { direction: '', active: true, leaving: false, entering: false });
                angular.extend(current || {}, { direction: '', active: false, leaving: false, entering: false });
                $scope.$currentTransition = null;
            }
        };
        $scope.$on('$destroy', function () {
            destroyed = true;
        });

        /* Allow outside people to call indexOf on slides array */
        self.indexOfSlide = function (slide) {
            return slides.indexOf(slide);
        };

        $scope.next = function () {
            var newIndex = (currentIndex + 1) % slides.length;

            //Prevent this user-triggered transition from occurring if there is already one in progress
            if (!$scope.$currentTransition) {
                return self.select(slides[newIndex], 'next');
            }
        };

        $scope.prev = function () {
            var newIndex = currentIndex - 1 < 0 ? slides.length - 1 : currentIndex - 1;

            //Prevent this user-triggered transition from occurring if there is already one in progress
            if (!$scope.$currentTransition) {
                return self.select(slides[newIndex], 'prev');
            }
        };

        $scope.select = function (slide) {
            self.select(slide);
        };

        $scope.isActive = function (slide) {
            return self.currentSlide === slide;
        };

        $scope.slides = function () {
            return slides;
        };

        $scope.$watch('interval', restartTimer);
        $scope.$on('$destroy', resetTimer);

        function restartTimer() {
            resetTimer();
            var interval = +$scope.interval;
            if (!isNaN(interval) && interval >= 0) {
                currentTimeout = $timeout(timerFn, interval);
            }
        }

        function resetTimer() {
            if (currentTimeout) {
                $timeout.cancel(currentTimeout);
                currentTimeout = null;
            }
        }

        function timerFn() {
            if (isPlaying) {
                $scope.next();
                restartTimer();
            } else {
                $scope.pause();
            }
        }

        $scope.play = function () {
            if (!isPlaying) {
                isPlaying = true;
                restartTimer();
            }
        };
        $scope.pause = function () {
            if (!$scope.noPause) {
                isPlaying = false;
                resetTimer();
            }
        };

        self.addSlide = function (slide, element) {
            slide.$element = element;
            slides.push(slide);
            //if this is the first slide or the slide is set to active, select it
            if (slides.length === 1 || slide.active) {
                self.select(slides[slides.length - 1]);
                if (slides.length == 1) {
                    $scope.play();
                }
            } else {
                slide.active = false;
            }
        };

        self.removeSlide = function (slide) {
            //get the index of the slide inside the carousel
            var index = slides.indexOf(slide);
            slides.splice(index, 1);
            if (slides.length > 0 && slide.active) {
                if (index >= slides.length) {
                    self.select(slides[index - 1]);
                } else {
                    self.select(slides[index]);
                }
            } else if (currentIndex > index) {
                currentIndex--;
            }
        };

    }])

    /**
     * @ngdoc directive
     * @name ui.bootstrap.carousel.directive:carousel
     * @restrict EA
     *
     * @description
     * Carousel is the outer container for a set of image 'slides' to showcase.
     *
     * @param {number=} interval The time, in milliseconds, that it will take the carousel to go to the next slide.
     * @param {boolean=} noTransition Whether to disable transitions on the carousel.
     * @param {boolean=} noPause Whether to disable pausing on the carousel (by default, the carousel interval pauses on hover).
     *
     * @example
    <example module="ui.bootstrap">
      <file name="index.html">
        <carousel>
          <slide>
            <img src="http://placekitten.com/150/150" style="margin:auto;">
            <div class="carousel-caption">
              <p>Beautiful!</p>
            </div>
          </slide>
          <slide>
            <img src="http://placekitten.com/100/150" style="margin:auto;">
            <div class="carousel-caption">
              <p>D'aww!</p>
            </div>
          </slide>
        </carousel>
      </file>
      <file name="demo.css">
        .carousel-indicators {
          top: auto;
          bottom: 15px;
        }
      </file>
    </example>
     */
    .directive('carousel', [function () {
        return {
            restrict: 'EA',
            transclude: true,
            replace: true,
            controller: 'CarouselController',
            require: 'carousel',
            templateUrl: 'template/carousel/carousel.html',
            scope: {
                interval: '=',
                noTransition: '=',
                noPause: '='
            }
        };
    }])

    /**
     * @ngdoc directive
     * @name ui.bootstrap.carousel.directive:slide
     * @restrict EA
     *
     * @description
     * Creates a slide inside a {@link ui.bootstrap.carousel.directive:carousel carousel}.  Must be placed as a child of a carousel element.
     *
     * @param {boolean=} active Model binding, whether or not this slide is currently active.
     *
     * @example
    <example module="ui.bootstrap">
      <file name="index.html">
    <div ng-controller="CarouselDemoCtrl">
      <carousel>
        <slide ng-repeat="slide in slides" active="slide.active">
          <img ng-src="{{slide.image}}" style="margin:auto;">
          <div class="carousel-caption">
            <h4>Slide {{$index}}</h4>
            <p>{{slide.text}}</p>
          </div>
        </slide>
      </carousel>
      <div class="row-fluid">
        <div class="span6">
          <ul>
            <li ng-repeat="slide in slides">
              <button class="btn btn-mini" ng-class="{'btn-info': !slide.active, 'btn-success': slide.active}" ng-disabled="slide.active" ng-click="slide.active = true">select</button>
              {{$index}}: {{slide.text}}
            </li>
          </ul>
          <a class="btn" ng-click="addSlide()">Add Slide</a>
        </div>
        <div class="span6">
          Interval, in milliseconds: <input type="number" ng-model="myInterval">
          <br />Enter a negative number to stop the interval.
        </div>
      </div>
    </div>
      </file>
      <file name="script.js">
    function CarouselDemoCtrl($scope) {
      $scope.myInterval = 5000;
      var slides = $scope.slides = [];
      $scope.addSlide = function() {
        var newWidth = 200 + ((slides.length + (25 * slides.length)) % 150);
        slides.push({
          image: 'http://placekitten.com/' + newWidth + '/200',
          text: ['More','Extra','Lots of','Surplus'][slides.length % 4] + ' '
            ['Cats', 'Kittys', 'Felines', 'Cutes'][slides.length % 4]
        });
      };
      for (var i=0; i<4; i++) $scope.addSlide();
    }
      </file>
      <file name="demo.css">
        .carousel-indicators {
          top: auto;
          bottom: 15px;
        }
      </file>
    </example>
    */

    .directive('slide', ['$parse', function ($parse) {
        return {
            require: '^carousel',
            restrict: 'EA',
            transclude: true,
            replace: true,
            templateUrl: 'template/carousel/slide.html',
            scope: {
            },
            link: function (scope, element, attrs, carouselCtrl) {
                //Set up optional 'active' = binding
                if (attrs.active) {
                    var getActive = $parse(attrs.active);
                    var setActive = getActive.assign;
                    var lastValue = scope.active = getActive(scope.$parent);
                    scope.$watch(function parentActiveWatch() {
                        var parentActive = getActive(scope.$parent);

                        if (parentActive !== scope.active) {
                            // we are out of sync and need to copy
                            if (parentActive !== lastValue) {
                                // parent changed and it has precedence
                                lastValue = scope.active = parentActive;
                            } else {
                                // if the parent can be assigned then do so
                                setActive(scope.$parent, parentActive = lastValue = scope.active);
                            }
                        }
                        return parentActive;
                    });
                }

                carouselCtrl.addSlide(scope, element);
                //when the scope is destroyed then remove the slide from the current slides array
                scope.$on('$destroy', function () {
                    carouselCtrl.removeSlide(scope);
                });

                scope.$watch('active', function (active) {
                    if (active) {
                        carouselCtrl.select(scope);
                    }
                });
            }
        };
    }]);

angular.module('ui.bootstrap.position', [])

    /**
     * A set of utility methods that can be use to retrieve position of DOM elements.
     * It is meant to be used where we need to absolute-position DOM elements in
     * relation to other, existing elements (this is the case for tooltips, popovers,
     * typeahead suggestions etc.).
     */
    .factory('$position', ['$document', '$window', function ($document, $window) {

        function getStyle(el, cssprop) {
            if (el.currentStyle) { //IE
                return el.currentStyle[cssprop];
            } else if ($window.getComputedStyle) {
                return $window.getComputedStyle(el)[cssprop];
            }
            // finally try and get inline style
            return el.style[cssprop];
        }

        /**
         * Checks if a given element is statically positioned
         * @param element - raw DOM element
         */
        function isStaticPositioned(element) {
            return (getStyle(element, "position") || 'static') === 'static';
        }

        /**
         * returns the closest, non-statically positioned parentOffset of a given element
         * @param element
         */
        var parentOffsetEl = function (element) {
            var docDomEl = $document[0];
            var offsetParent = element.offsetParent || docDomEl;
            while (offsetParent && offsetParent !== docDomEl && isStaticPositioned(offsetParent)) {
                offsetParent = offsetParent.offsetParent;
            }
            return offsetParent || docDomEl;
        };

        return {
            /**
             * Provides read-only equivalent of jQuery's position function:
             * http://api.jquery.com/position/
             */
            position: function (element) {
                var elBCR = this.offset(element);
                var offsetParentBCR = { top: 0, left: 0 };
                var offsetParentEl = parentOffsetEl(element[0]);
                if (offsetParentEl != $document[0]) {
                    offsetParentBCR = this.offset(angular.element(offsetParentEl));
                    offsetParentBCR.top += offsetParentEl.clientTop - offsetParentEl.scrollTop;
                    offsetParentBCR.left += offsetParentEl.clientLeft - offsetParentEl.scrollLeft;
                }

                var boundingClientRect = element[0].getBoundingClientRect();
                return {
                    width: boundingClientRect.width || element.prop('offsetWidth'),
                    height: boundingClientRect.height || element.prop('offsetHeight'),
                    top: elBCR.top - offsetParentBCR.top,
                    left: elBCR.left - offsetParentBCR.left
                };
            },

            /**
             * Provides read-only equivalent of jQuery's offset function:
             * http://api.jquery.com/offset/
             */
            offset: function (element) {
                var boundingClientRect = element[0].getBoundingClientRect();
                return {
                    width: boundingClientRect.width || element.prop('offsetWidth'),
                    height: boundingClientRect.height || element.prop('offsetHeight'),
                    top: boundingClientRect.top + ($window.pageYOffset || $document[0].body.scrollTop || $document[0].documentElement.scrollTop),
                    left: boundingClientRect.left + ($window.pageXOffset || $document[0].body.scrollLeft || $document[0].documentElement.scrollLeft)
                };
            }
        };
    }]);

angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.position'])

    .constant('datepickerConfig', {
        dayFormat: 'dd',
        monthFormat: 'MMMM',
        yearFormat: 'yyyy',
        dayHeaderFormat: 'EEE',
        dayTitleFormat: 'MMMM yyyy',
        monthTitleFormat: 'yyyy',
        showWeeks: true,
        startingDay: 0,
        yearRange: 20,
        minDate: null,
        maxDate: null
    })

    .controller('DatepickerController', ['$scope', '$attrs', 'dateFilter', 'datepickerConfig', function ($scope, $attrs, dateFilter, dtConfig) {
        var format = {
            day: getValue($attrs.dayFormat, dtConfig.dayFormat),
            month: getValue($attrs.monthFormat, dtConfig.monthFormat),
            year: getValue($attrs.yearFormat, dtConfig.yearFormat),
            dayHeader: getValue($attrs.dayHeaderFormat, dtConfig.dayHeaderFormat),
            dayTitle: getValue($attrs.dayTitleFormat, dtConfig.dayTitleFormat),
            monthTitle: getValue($attrs.monthTitleFormat, dtConfig.monthTitleFormat)
        },
            startingDay = getValue($attrs.startingDay, dtConfig.startingDay),
            yearRange = getValue($attrs.yearRange, dtConfig.yearRange);

        this.minDate = dtConfig.minDate ? new Date(dtConfig.minDate) : null;
        this.maxDate = dtConfig.maxDate ? new Date(dtConfig.maxDate) : null;

        function getValue(value, defaultValue) {
            return angular.isDefined(value) ? $scope.$parent.$eval(value) : defaultValue;
        }

        function getDaysInMonth(year, month) {
            return new Date(year, month, 0).getDate();
        }

        function getDates(startDate, n) {
            var dates = new Array(n);
            var current = startDate, i = 0;
            while (i < n) {
                dates[i++] = new Date(current);
                current.setDate(current.getDate() + 1);
            }
            return dates;
        }

        function makeDate(date, format, isSelected, isSecondary) {
            return { date: date, label: dateFilter(date, format), selected: !!isSelected, secondary: !!isSecondary };
        }

        this.modes = [
            {
                name: 'day',
                getVisibleDates: function (date, selected) {
                    var year = date.getFullYear(), month = date.getMonth(), firstDayOfMonth = new Date(year, month, 1);
                    var difference = startingDay - firstDayOfMonth.getDay(),
                        numDisplayedFromPreviousMonth = (difference > 0) ? 7 - difference : -difference,
                        firstDate = new Date(firstDayOfMonth), numDates = 0;

                    if (numDisplayedFromPreviousMonth > 0) {
                        firstDate.setDate(-numDisplayedFromPreviousMonth + 1);
                        numDates += numDisplayedFromPreviousMonth; // Previous
                    }
                    numDates += getDaysInMonth(year, month + 1); // Current
                    numDates += (7 - numDates % 7) % 7; // Next

                    var days = getDates(firstDate, numDates), labels = new Array(7);
                    for (var i = 0; i < numDates; i++) {
                        var dt = new Date(days[i]);
                        days[i] = makeDate(dt, format.day, (selected && selected.getDate() === dt.getDate() && selected.getMonth() === dt.getMonth() && selected.getFullYear() === dt.getFullYear()), dt.getMonth() !== month);
                    }
                    for (var j = 0; j < 7; j++) {
                        labels[j] = dateFilter(days[j].date, format.dayHeader);
                    }
                    return { objects: days, title: dateFilter(date, format.dayTitle), labels: labels };
                },
                compare: function (date1, date2) {
                    return (new Date(date1.getFullYear(), date1.getMonth(), date1.getDate()) - new Date(date2.getFullYear(), date2.getMonth(), date2.getDate()));
                },
                split: 7,
                step: { months: 1 }
            },
            {
                name: 'month',
                getVisibleDates: function (date, selected) {
                    var months = new Array(12), year = date.getFullYear();
                    for (var i = 0; i < 12; i++) {
                        var dt = new Date(year, i, 1);
                        months[i] = makeDate(dt, format.month, (selected && selected.getMonth() === i && selected.getFullYear() === year));
                    }
                    return { objects: months, title: dateFilter(date, format.monthTitle) };
                },
                compare: function (date1, date2) {
                    return new Date(date1.getFullYear(), date1.getMonth()) - new Date(date2.getFullYear(), date2.getMonth());
                },
                split: 3,
                step: { years: 1 }
            },
            {
                name: 'year',
                getVisibleDates: function (date, selected) {
                    var years = new Array(yearRange), year = date.getFullYear(), startYear = parseInt((year - 1) / yearRange, 10) * yearRange + 1;
                    for (var i = 0; i < yearRange; i++) {
                        var dt = new Date(startYear + i, 0, 1);
                        years[i] = makeDate(dt, format.year, (selected && selected.getFullYear() === dt.getFullYear()));
                    }
                    return { objects: years, title: [years[0].label, years[yearRange - 1].label].join(' - ') };
                },
                compare: function (date1, date2) {
                    return date1.getFullYear() - date2.getFullYear();
                },
                split: 5,
                step: { years: yearRange }
            }
        ];

        this.isDisabled = function (date, mode) {
            var currentMode = this.modes[mode || 0];
            return ((this.minDate && currentMode.compare(date, this.minDate) < 0) || (this.maxDate && currentMode.compare(date, this.maxDate) > 0) || ($scope.dateDisabled && $scope.dateDisabled({ date: date, mode: currentMode.name })));
        };
    }])

    .directive('datepicker', ['dateFilter', '$parse', 'datepickerConfig', '$log', function (dateFilter, $parse, datepickerConfig, $log) {
        return {
            restrict: 'EA',
            replace: true,
            templateUrl: 'template/datepicker/datepicker.html',
            scope: {
                dateDisabled: '&'
            },
            require: ['datepicker', '?^ngModel'],
            controller: 'DatepickerController',
            link: function (scope, element, attrs, ctrls) {
                var datepickerCtrl = ctrls[0], ngModel = ctrls[1];

                if (!ngModel) {
                    return; // do nothing if no ng-model
                }

                // Configuration parameters
                var mode = 0, selected = new Date(), showWeeks = datepickerConfig.showWeeks;

                if (attrs.showWeeks) {
                    scope.$parent.$watch($parse(attrs.showWeeks), function (value) {
                        showWeeks = !!value;
                        updateShowWeekNumbers();
                    });
                } else {
                    updateShowWeekNumbers();
                }

                if (attrs.min) {
                    scope.$parent.$watch($parse(attrs.min), function (value) {
                        datepickerCtrl.minDate = value ? new Date(value) : null;
                        refill();
                    });
                }
                if (attrs.max) {
                    scope.$parent.$watch($parse(attrs.max), function (value) {
                        datepickerCtrl.maxDate = value ? new Date(value) : null;
                        refill();
                    });
                }

                function updateShowWeekNumbers() {
                    scope.showWeekNumbers = mode === 0 && showWeeks;
                }

                // Split array into smaller arrays
                function split(arr, size) {
                    var arrays = [];
                    while (arr.length > 0) {
                        arrays.push(arr.splice(0, size));
                    }
                    return arrays;
                }

                function refill(updateSelected) {
                    var date = null, valid = true;

                    if (ngModel.$modelValue) {
                        date = new Date(ngModel.$modelValue);

                        if (isNaN(date)) {
                            valid = false;
                            $log.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.');
                        } else if (updateSelected) {
                            selected = date;
                        }
                    }
                    ngModel.$setValidity('date', valid);

                    var currentMode = datepickerCtrl.modes[mode], data = currentMode.getVisibleDates(selected, date);
                    angular.forEach(data.objects, function (obj) {
                        obj.disabled = datepickerCtrl.isDisabled(obj.date, mode);
                    });

                    ngModel.$setValidity('date-disabled', (!date || !datepickerCtrl.isDisabled(date)));

                    scope.rows = split(data.objects, currentMode.split);
                    scope.labels = data.labels || [];
                    scope.title = data.title;
                }

                function setMode(value) {
                    mode = value;
                    updateShowWeekNumbers();
                    refill();
                }

                ngModel.$render = function () {
                    refill(true);
                };

                scope.select = function (date) {
                    if (mode === 0) {
                        var dt = ngModel.$modelValue ? new Date(ngModel.$modelValue) : new Date(0, 0, 0, 0, 0, 0, 0);
                        dt.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());
                        ngModel.$setViewValue(dt);
                        refill(true);
                    } else {
                        selected = date;
                        setMode(mode - 1);
                    }
                };
                scope.move = function (direction) {
                    var step = datepickerCtrl.modes[mode].step;
                    selected.setMonth(selected.getMonth() + direction * (step.months || 0));
                    selected.setFullYear(selected.getFullYear() + direction * (step.years || 0));
                    refill();
                };
                scope.toggleMode = function () {
                    setMode((mode + 1) % datepickerCtrl.modes.length);
                };
                scope.getWeekNumber = function (row) {
                    return (mode === 0 && scope.showWeekNumbers && row.length === 7) ? getISO8601WeekNumber(row[0].date) : null;
                };

                function getISO8601WeekNumber(date) {
                    var checkDate = new Date(date);
                    checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); // Thursday
                    var time = checkDate.getTime();
                    checkDate.setMonth(0); // Compare with Jan 1
                    checkDate.setDate(1);
                    return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
                }
            }
        };
    }])

    .constant('datepickerPopupConfig', {
        dateFormat: 'yyyy-MM-dd',
        currentText: 'Today',
        toggleWeeksText: 'Weeks',
        clearText: 'Clear',
        closeText: 'Done',
        closeOnDateSelection: true,
        appendToBody: false,
        showButtonBar: true
    })

    .directive('datepickerPopup', ['$compile', '$parse', '$document', '$position', 'dateFilter', 'datepickerPopupConfig', 'datepickerConfig',
        function ($compile, $parse, $document, $position, dateFilter, datepickerPopupConfig, datepickerConfig) {
            return {
                restrict: 'EA',
                require: 'ngModel',
                link: function (originalScope, element, attrs, ngModel) {
                    var scope = originalScope.$new(), // create a child scope so we are not polluting original one
                        dateFormat,
                        closeOnDateSelection = angular.isDefined(attrs.closeOnDateSelection) ? originalScope.$eval(attrs.closeOnDateSelection) : datepickerPopupConfig.closeOnDateSelection,
                        appendToBody = angular.isDefined(attrs.datepickerAppendToBody) ? originalScope.$eval(attrs.datepickerAppendToBody) : datepickerPopupConfig.appendToBody;

                    attrs.$observe('datepickerPopup', function (value) {
                        dateFormat = value || datepickerPopupConfig.dateFormat;
                        ngModel.$render();
                    });

                    scope.showButtonBar = angular.isDefined(attrs.showButtonBar) ? originalScope.$eval(attrs.showButtonBar) : datepickerPopupConfig.showButtonBar;

                    originalScope.$on('$destroy', function () {
                        $popup.remove();
                        scope.$destroy();
                    });

                    attrs.$observe('currentText', function (text) {
                        scope.currentText = angular.isDefined(text) ? text : datepickerPopupConfig.currentText;
                    });
                    attrs.$observe('toggleWeeksText', function (text) {
                        scope.toggleWeeksText = angular.isDefined(text) ? text : datepickerPopupConfig.toggleWeeksText;
                    });
                    attrs.$observe('clearText', function (text) {
                        scope.clearText = angular.isDefined(text) ? text : datepickerPopupConfig.clearText;
                    });
                    attrs.$observe('closeText', function (text) {
                        scope.closeText = angular.isDefined(text) ? text : datepickerPopupConfig.closeText;
                    });

                    var getIsOpen, setIsOpen;
                    if (attrs.isOpen) {
                        getIsOpen = $parse(attrs.isOpen);
                        setIsOpen = getIsOpen.assign;

                        originalScope.$watch(getIsOpen, function updateOpen(value) {
                            scope.isOpen = !!value;
                        });
                    }
                    scope.isOpen = getIsOpen ? getIsOpen(originalScope) : false; // Initial state

                    function setOpen(value) {
                        if (setIsOpen) {
                            setIsOpen(originalScope, !!value);
                        } else {
                            scope.isOpen = !!value;
                        }
                    }

                    var documentClickBind = function (event) {
                        if (scope.isOpen && event.target !== element[0]) {
                            scope.$apply(function () {
                                setOpen(false);
                            });
                        }
                    };

                    var elementFocusBind = function () {
                        scope.$apply(function () {
                            setOpen(true);
                        });
                    };

                    // popup element used to display calendar
                    var popupEl = angular.element('<div datepicker-popup-wrap><div datepicker></div></div>');
                    popupEl.attr({
                        'ng-model': 'date',
                        'ng-change': 'dateSelection()'
                    });
                    var datepickerEl = angular.element(popupEl.children()[0]),
                        datepickerOptions = {};
                    if (attrs.datepickerOptions) {
                        datepickerOptions = originalScope.$eval(attrs.datepickerOptions);
                        datepickerEl.attr(angular.extend({}, datepickerOptions));
                    }

                    // TODO: reverse from dateFilter string to Date object
                    function parseDate(viewValue) {
                        if (!viewValue) {
                            ngModel.$setValidity('date', true);
                            return null;
                        } else if (angular.isDate(viewValue)) {
                            ngModel.$setValidity('date', true);
                            return viewValue;
                        } else if (angular.isString(viewValue)) {
                            var date = new Date(viewValue);
                            if (isNaN(date)) {
                                ngModel.$setValidity('date', false);
                                return undefined;
                            } else {
                                ngModel.$setValidity('date', true);
                                return date;
                            }
                        } else {
                            ngModel.$setValidity('date', false);
                            return undefined;
                        }
                    }
                    ngModel.$parsers.unshift(parseDate);

                    // Inner change
                    scope.dateSelection = function (dt) {
                        if (angular.isDefined(dt)) {
                            scope.date = dt;
                        }
                        ngModel.$setViewValue(scope.date);
                        ngModel.$render();

                        if (closeOnDateSelection) {
                            setOpen(false);
                        }
                    };

                    element.bind('input change keyup', function () {
                        scope.$apply(function () {
                            scope.date = ngModel.$modelValue;
                        });
                    });

                    // Outter change
                    ngModel.$render = function () {
                        var date = ngModel.$viewValue ? dateFilter(ngModel.$viewValue, dateFormat) : '';
                        element.val(date);
                        scope.date = ngModel.$modelValue;
                    };

                    function addWatchableAttribute(attribute, scopeProperty, datepickerAttribute) {
                        if (attribute) {
                            originalScope.$watch($parse(attribute), function (value) {
                                scope[scopeProperty] = value;
                            });
                            datepickerEl.attr(datepickerAttribute || scopeProperty, scopeProperty);
                        }
                    }
                    addWatchableAttribute(attrs.min, 'min');
                    addWatchableAttribute(attrs.max, 'max');
                    if (attrs.showWeeks) {
                        addWatchableAttribute(attrs.showWeeks, 'showWeeks', 'show-weeks');
                    } else {
                        scope.showWeeks = 'show-weeks' in datepickerOptions ? datepickerOptions['show-weeks'] : datepickerConfig.showWeeks;
                        datepickerEl.attr('show-weeks', 'showWeeks');
                    }
                    if (attrs.dateDisabled) {
                        datepickerEl.attr('date-disabled', attrs.dateDisabled);
                    }

                    function updatePosition() {
                        scope.position = appendToBody ? $position.offset(element) : $position.position(element);
                        scope.position.top = scope.position.top + element.prop('offsetHeight');
                    }

                    var documentBindingInitialized = false, elementFocusInitialized = false;
                    scope.$watch('isOpen', function (value) {
                        if (value) {
                            updatePosition();
                            $document.bind('click', documentClickBind);
                            if (elementFocusInitialized) {
                                element.unbind('focus', elementFocusBind);
                            }
                            element[0].focus();
                            documentBindingInitialized = true;
                        } else {
                            if (documentBindingInitialized) {
                                $document.unbind('click', documentClickBind);
                            }
                            element.bind('focus', elementFocusBind);
                            elementFocusInitialized = true;
                        }

                        if (setIsOpen) {
                            setIsOpen(originalScope, value);
                        }
                    });

                    scope.today = function () {
                        scope.dateSelection(new Date());
                    };
                    scope.clear = function () {
                        scope.dateSelection(null);
                    };

                    var $popup = $compile(popupEl)(scope);
                    if (appendToBody) {
                        $document.find('body').append($popup);
                    } else {
                        element.after($popup);
                    }
                }
            };
        }])

    .directive('datepickerPopupWrap', function () {
        return {
            restrict: 'EA',
            replace: true,
            transclude: true,
            templateUrl: 'template/datepicker/popup.html',
            link: function (scope, element, attrs) {
                element.bind('click', function (event) {
                    event.preventDefault();
                    event.stopPropagation();
                });
            }
        };
    });

/*
 * dropdownToggle - Provides dropdown menu functionality in place of bootstrap js
 * @restrict class or attribute
 * @example:
   <li class="dropdown">
     <a class="dropdown-toggle">My Dropdown Menu</a>
     <ul class="dropdown-menu">
       <li ng-repeat="choice in dropChoices">
         <a ng-href="{{choice.href}}">{{choice.text}}</a>
       </li>
     </ul>
   </li>
 */

angular.module('ui.bootstrap.dropdownToggle', []).directive('dropdownToggle', ['$document', '$location', function ($document, $location) {
    var openElement = null,
        closeMenu = angular.noop;
    return {
        restrict: 'CA',
        link: function (scope, element, attrs) {
            //scope.$watch('$location.path', function() { closeMenu(); });
            //element.parent().bind('click', function() { closeMenu(); });
            //element.bind('click', function(event) {

            //  var elementWasOpen = (element === openElement);

            //  event.preventDefault();
            //  event.stopPropagation();

            //  if (!!openElement) {
            //    closeMenu();
            //  }

            //  if (!elementWasOpen && !element.hasClass('disabled') && !element.prop('disabled')) {
            //    element.parent().addClass('open');
            //    openElement = element;
            //    closeMenu = function(event) {
            //      if (event) {
            //        event.preventDefault();
            //        event.stopPropagation();
            //      }
            //      $document.unbind('click', closeMenu);
            //      element.parent().removeClass('open');
            //      closeMenu = angular.noop;
            //      openElement = null;
            //    };
            //    $document.bind('click', closeMenu);
            //  }
            //});
        }
    };
}]);

angular.module('ui.bootstrap.actionToggle', []).directive('actionToggle', ['$document', '$location', function ($document, $location) {
    var openElement = null,
        closeMenu = angular.noop;
    return {
        restrict: 'CA',
        link: function (scope, element, attrs) {
            scope.$watch('$location.path', function () { closeMenu(); });
            element.parent().bind('click', function () { closeMenu(); });
            element.bind('click', function (event) {

                var elementWasOpen = (element === openElement);

                event.preventDefault();
                event.stopPropagation();

                if (!!openElement) {
                    closeMenu();
                }

                if (!elementWasOpen && !element.hasClass('disabled') && !element.prop('disabled')) {
                    element.parent().addClass('open');
                    openElement = element;
                    closeMenu = function (event) {
                        if (event) {
                            event.preventDefault();
                            event.stopPropagation();
                        }
                        $document.unbind('click', closeMenu);
                        element.parent().removeClass('open');
                        closeMenu = angular.noop;
                        openElement = null;
                    };
                    $document.bind('click', closeMenu);
                }
            });
        }
    };
}]);

angular.module('ui.bootstrap.modal', ['ui.bootstrap.transition'])

    /**
     * A helper, internal data structure that acts as a map but also allows getting / removing
     * elements in the LIFO order
     */
    .factory('$$stackedMap', function () {
        return {
            createNew: function () {
                var stack = [];

                return {
                    add: function (key, value) {
                        stack.push({
                            key: key,
                            value: value
                        });
                    },
                    get: function (key) {
                        for (var i = 0; i < stack.length; i++) {
                            if (key == stack[i].key) {
                                return stack[i];
                            }
                        }
                    },
                    keys: function () {
                        var keys = [];
                        for (var i = 0; i < stack.length; i++) {
                            keys.push(stack[i].key);
                        }
                        return keys;
                    },
                    top: function () {
                        return stack[stack.length - 1];
                    },
                    remove: function (key) {
                        var idx = -1;
                        for (var i = 0; i < stack.length; i++) {
                            if (key == stack[i].key) {
                                idx = i;
                                break;
                            }
                        }
                        return stack.splice(idx, 1)[0];
                    },
                    removeTop: function () {
                        return stack.splice(stack.length - 1, 1)[0];
                    },
                    length: function () {
                        return stack.length;
                    }
                };
            }
        };
    })

    /**
     * A helper directive for the $modal service. It creates a backdrop element.
     */
    .directive('modalBackdrop', ['$timeout', function ($timeout) {
        return {
            restrict: 'EA',
            replace: true,
            templateUrl: '/App_Client/common/directives/bootstrapModal/backdrop.html?v=' + window.crm.constants.version,
            link: function (scope) {
                scope.view = scope.view || 'popup';
                scope.animate = false;

                //trigger CSS transitions
                $timeout(function () {
                    scope.animate = true;
                });
            }
        };
    }])

    .directive('modalWindow', ['$modalStack', '$timeout', function ($modalStack, $timeout) {
        return {
            restrict: 'EA',
            scope: {
                index: '@',
                animate: '='
            },
            replace: true,
            transclude: true,
            templateUrl: '/App_Client/common/directives/bootstrapModal/window.html?v=' + window.crm.constants.version,
            link: function (scope, element, attrs) {
                scope.windowClass = attrs.windowClass || '';
                scope.sizeclass = attrs.sizeclass || '';
                scope.view = attrs.view || 'popup';
                $timeout(function () {
                    // trigger CSS transitions
                    scope.animate = true;
                    // focus a freshly-opened modal
                    element[0].focus();
                    //element.find("upload-action-input").attr('style', 'display: none');
                });

                scope.close = function (evt) {
                    var modal = $modalStack.getTop();
                    if (modal && modal.value.backdrop && modal.value.backdrop != 'static' && (evt.target === evt.currentTarget)) {
                        evt.preventDefault();
                        evt.stopPropagation();
                        $modalStack.dismiss(modal.key, 'backdrop click');
                    }
                };
            }
        };
    }])

    .factory('$modalStack', ['$transition', '$timeout', '$document', '$compile', '$rootScope', '$$stackedMap',
        function ($transition, $timeout, $document, $compile, $rootScope, $$stackedMap) {

            var OPENED_MODAL_CLASS = 'modal-open';

            var backdropDomEl, backdropScope;
            var openedWindows = $$stackedMap.createNew();
            var $modalStack = {};

            function backdropIndex() {
                var topBackdropIndex = -1;
                var opened = openedWindows.keys();
                for (var i = 0; i < opened.length; i++) {
                    if (openedWindows.get(opened[i]).value.backdrop) {
                        topBackdropIndex = window.crm.constants.modalIndex;
                    }
                }
                return topBackdropIndex;
            }

            $rootScope.$watch(backdropIndex, function (newBackdropIndex) {
                if (backdropScope) {
                    backdropScope.index = newBackdropIndex;
                }
            });

            function removeModalWindow(modalInstance) {
                var body = $document.find('body').eq(0);
                var modalWindow = openedWindows.get(modalInstance).value;

                //clean up the stack
                openedWindows.remove(modalInstance);

                //remove window DOM element
                removeAfterAnimate(modalWindow.modalDomEl, modalWindow.modalScope, 400, checkRemoveBackdrop);
                body.toggleClass(OPENED_MODAL_CLASS, openedWindows.length() > 0);
                window.crm.constants.modalIndex--;
            }

            function checkRemoveBackdrop() {
                //remove backdrop if no longer needed
                if (backdropDomEl && backdropIndex() == -1) {
                    var backdropScopeRef = backdropScope;
                    removeAfterAnimate(backdropDomEl, backdropScope, 1000, function () {
                        backdropScopeRef.$destroy();
                        backdropScopeRef = null;
                    });
                    backdropDomEl = undefined;
                    backdropScope = undefined;
                }
            }

            function removeAfterAnimate(domEl, scope, emulateTime, done) {
                // Closing animation
                scope.animate = false;

                var transitionEndEventName = $transition.transitionEndEventName;
                if (transitionEndEventName) {
                    // transition out
                    var timeout = $timeout(afterAnimating, emulateTime);

                    domEl.bind(transitionEndEventName, function () {
                        $timeout.cancel(timeout);
                        afterAnimating();
                        scope.$apply();
                    });
                } else {
                    // Ensure this call is async
                    $timeout(afterAnimating, 0);
                }

                function afterAnimating() {
                    if (afterAnimating.done) {
                        return;
                    }
                    afterAnimating.done = true;

                    domEl.remove();
                    if (done) {
                        done();
                    }
                }
            }

            $document.bind('keydown', function (evt) {
                var modal;

                if (evt.which === 27) {
                    modal = openedWindows.top();
                    if (modal && modal.value.keyboard) {
                        $rootScope.$apply(function () {
                            $modalStack.dismiss(modal.key);
                        });
                    }
                }
            });

            $modalStack.open = function (modalInstance, modal) {
                window.crm.constants.modalIndex++;
                openedWindows.add(modalInstance, {
                    deferred: modal.deferred,
                    modalScope: modal.scope,
                    backdrop: modal.backdrop,
                    keyboard: modal.keyboard,
                    sizeclass: modal.sizeclass,
                    view: modal.view
                });

                var body = $document.find('body').eq(0),
                    currBackdropIndex = backdropIndex();

                if (currBackdropIndex >= 0 && !backdropDomEl) {
                    backdropScope = $rootScope.$new(true);
                    backdropScope.index = currBackdropIndex;
                    backdropScope.view = modal.view;
                    backdropDomEl = $compile('<div modal-backdrop></div>')(backdropScope);
                    body.append(backdropDomEl);
                }

                var angularDomEl = angular.element('<div modal-window></div>');
                angularDomEl.attr('window-class', modal.windowClass);
                angularDomEl.attr('sizeclass', modal.sizeclass);
                angularDomEl.attr('view', modal.view);
                angularDomEl.attr('index', window.crm.constants.modalIndex - 1);
                angularDomEl.attr('animate', 'animate');
                angularDomEl.html(modal.content);

                var modalDomEl = $compile(angularDomEl)(modal.scope);
                openedWindows.top().value.modalDomEl = modalDomEl;
                body.append(modalDomEl);
                body.addClass(OPENED_MODAL_CLASS);

            };

            $modalStack.close = function (modalInstance, result) {
                var modalWindow = openedWindows.get(modalInstance).value;
                if (modalWindow) {
                    modalWindow.deferred.resolve(result);
                    removeModalWindow(modalInstance);
                }
            };

            $modalStack.dismiss = function (modalInstance, reason) {
                var modalWindow = openedWindows.get(modalInstance).value;
                if (modalWindow) {
                    modalWindow.deferred.reject(reason);
                    removeModalWindow(modalInstance);
                }
            };

            $modalStack.dismissAll = function (reason) {
                var topModal = this.getTop();
                while (topModal) {
                    this.dismiss(topModal.key, reason);
                    topModal = this.getTop();
                }
            };

            $modalStack.getTop = function () {
                return openedWindows.top();
            };

            return $modalStack;
        }])

    .provider('$modal', function () {

        var $modalProvider = {
            options: {
                backdrop: true, //can be also false or 'static'
                keyboard: true
            },
            $get: ['$injector', '$rootScope', '$q', '$http', '$templateCache', '$controller', '$modalStack',
                function ($injector, $rootScope, $q, $http, $templateCache, $controller, $modalStack) {

                    var $modal = {};

                    function getTemplatePromise(options) {
                        return options.template ? $q.when(options.template) :
                            $http.get(options.templateUrl, { cache: $templateCache }).then(function (result) {
                                return result.data;
                            });
                    }

                    function getResolvePromises(resolves) {
                        var promisesArr = [];
                        angular.forEach(resolves, function (value, key) {
                            if (angular.isFunction(value) || angular.isArray(value)) {
                                promisesArr.push($q.when($injector.invoke(value)));
                            }
                        });
                        return promisesArr;
                    }

                    $modal.open = function (modalOptions) {

                        var modalResultDeferred = $q.defer();
                        var modalOpenedDeferred = $q.defer();

                        //prepare an instance of a modal to be injected into controllers and returned to a caller
                        var modalInstance = {
                            result: modalResultDeferred.promise,
                            opened: modalOpenedDeferred.promise,
                            close: function (result) {
                                $modalStack.close(modalInstance, result);
                            },
                            dismiss: function (reason) {
                                $modalStack.dismiss(modalInstance, reason);
                            }
                        };

                        //merge and clean up options
                        modalOptions = angular.extend({}, $modalProvider.options, modalOptions);
                        modalOptions.resolve = modalOptions.resolve || {};

                        //verify options
                        if (!modalOptions.template && !modalOptions.templateUrl) {
                            throw new Error('One of template or templateUrl options is required.');
                        }

                        var templateAndResolvePromise =
                            $q.all([getTemplatePromise(modalOptions)].concat(getResolvePromises(modalOptions.resolve)));


                        templateAndResolvePromise.then(function resolveSuccess(tplAndVars) {

                            var modalScope = (modalOptions.scope || $rootScope).$new();
                            modalScope.$close = modalInstance.close;
                            modalScope.$dismiss = modalInstance.dismiss;

                            var ctrlInstance, ctrlLocals = {};
                            var resolveIter = 1;

                            //controllers
                            if (modalOptions.controller) {
                                ctrlLocals.$scope = modalScope;
                                ctrlLocals.$modalInstance = modalInstance;
                                angular.forEach(modalOptions.resolve, function (value, key) {
                                    ctrlLocals[key] = tplAndVars[resolveIter++];
                                });

                                ctrlInstance = $controller(modalOptions.controller, ctrlLocals);
                            }

                            $modalStack.open(modalInstance, {
                                scope: modalScope,
                                deferred: modalResultDeferred,
                                content: tplAndVars[0],
                                backdrop: modalOptions.backdrop,
                                keyboard: modalOptions.keyboard,
                                windowClass: modalOptions.windowClass,
                                sizeclass: modalOptions.sizeclass || '',
                                view: modalOptions.view || '',
                            });

                        }, function resolveError(reason) {
                            modalResultDeferred.reject(reason);
                        });

                        templateAndResolvePromise.then(function () {
                            modalOpenedDeferred.resolve(true);
                        }, function () {
                            modalOpenedDeferred.reject(false);
                        });

                        return modalInstance;
                    };

                    return $modal;
                }]
        };

        return $modalProvider;
    });

angular.module('ui.bootstrap.pagination', [])

    .controller('PaginationController', ['$scope', '$attrs', '$parse', '$interpolate', function ($scope, $attrs, $parse, $interpolate) {
        var self = this,
            setNumPages = $attrs.numPages ? $parse($attrs.numPages).assign : angular.noop;

        this.init = function (defaultItemsPerPage) {
            if ($attrs.itemsPerPage) {
                $scope.$parent.$watch($parse($attrs.itemsPerPage), function (value) {
                    self.itemsPerPage = parseInt(value, 10);
                    $scope.totalPages = self.calculateTotalPages();
                });
            } else {
                this.itemsPerPage = defaultItemsPerPage;
            }
        };

        this.noPrevious = function () {
            return this.page === 1;
        };
        this.noNext = function () {
            return this.page === $scope.totalPages;
        };

        this.isActive = function (page) {
            return this.page === page;
        };

        this.calculateTotalPages = function () {
            var totalPages = this.itemsPerPage < 1 ? 1 : Math.ceil($scope.totalItems / this.itemsPerPage);
            return Math.max(totalPages || 0, 1);
        };

        this.getAttributeValue = function (attribute, defaultValue, interpolate) {
            return angular.isDefined(attribute) ? (interpolate ? $interpolate(attribute)($scope.$parent) : $scope.$parent.$eval(attribute)) : defaultValue;
        };

        this.render = function () {
            this.page = parseInt($scope.page, 10) || 1;
            if (this.page > 0 && this.page <= $scope.totalPages) {
                $scope.pages = this.getPages(this.page, $scope.totalPages);
            }
        };

        $scope.selectPage = function (page) {
            if (!self.isActive(page) && page > 0 && page <= $scope.totalPages) {
                $scope.page = page;
                $scope.onSelectPage({ page: page });
            }
        };

        $scope.$watch('page', function () {
            self.render();
        });

        $scope.$watch('totalItems', function () {
            $scope.totalPages = self.calculateTotalPages();
        });

        $scope.$watch('totalPages', function (value) {
            setNumPages($scope.$parent, value); // Readonly variable

            if (self.page > value) {
                $scope.selectPage(value);
            } else {
                self.render();
            }
        });
    }])

    .constant('paginationConfig', {
        itemsPerPage: 10,
        boundaryLinks: false,
        directionLinks: true,
        firstText: 'First',
        previousText: 'Previous',
        nextText: 'Next',
        lastText: 'Last',
        rotate: true
    })

    .directive('pagination', ['$parse', 'paginationConfig', function ($parse, config) {
        return {
            restrict: 'EA',
            scope: {
                page: '=',
                totalItems: '=',
                onSelectPage: ' &'
            },
            controller: 'PaginationController',
            templateUrl: 'template/pagination/pagination.html',
            replace: true,
            link: function (scope, element, attrs, paginationCtrl) {

                // Setup configuration parameters
                var maxSize,
                    boundaryLinks = paginationCtrl.getAttributeValue(attrs.boundaryLinks, config.boundaryLinks),
                    directionLinks = paginationCtrl.getAttributeValue(attrs.directionLinks, config.directionLinks),
                    firstText = paginationCtrl.getAttributeValue(attrs.firstText, config.firstText, true),
                    previousText = paginationCtrl.getAttributeValue(attrs.previousText, config.previousText, true),
                    nextText = paginationCtrl.getAttributeValue(attrs.nextText, config.nextText, true),
                    lastText = paginationCtrl.getAttributeValue(attrs.lastText, config.lastText, true),
                    rotate = paginationCtrl.getAttributeValue(attrs.rotate, config.rotate);

                paginationCtrl.init(config.itemsPerPage);

                if (attrs.maxSize) {
                    scope.$parent.$watch($parse(attrs.maxSize), function (value) {
                        maxSize = parseInt(value, 10);
                        paginationCtrl.render();
                    });
                }

                // Create page object used in template
                function makePage(number, text, isActive, isDisabled) {
                    return {
                        number: number,
                        text: text,
                        active: isActive,
                        disabled: isDisabled
                    };
                }

                paginationCtrl.getPages = function (currentPage, totalPages) {
                    var pages = [];

                    // Default page limits
                    var startPage = 1, endPage = totalPages;
                    var isMaxSized = (angular.isDefined(maxSize) && maxSize < totalPages);

                    // recompute if maxSize
                    if (isMaxSized) {
                        if (rotate) {
                            // Current page is displayed in the middle of the visible ones
                            startPage = Math.max(currentPage - Math.floor(maxSize / 2), 1);
                            endPage = startPage + maxSize - 1;

                            // Adjust if limit is exceeded
                            if (endPage > totalPages) {
                                endPage = totalPages;
                                startPage = endPage - maxSize + 1;
                            }
                        } else {
                            // Visible pages are paginated with maxSize
                            startPage = ((Math.ceil(currentPage / maxSize) - 1) * maxSize) + 1;

                            // Adjust last page if limit is exceeded
                            endPage = Math.min(startPage + maxSize - 1, totalPages);
                        }
                    }

                    // Add page number links
                    for (var number = startPage; number <= endPage; number++) {
                        var page = makePage(number, number, paginationCtrl.isActive(number), false);
                        pages.push(page);
                    }

                    // Add links to move between page sets
                    if (isMaxSized && !rotate) {
                        if (startPage > 1) {
                            var previousPageSet = makePage(startPage - 1, '...', false, false);
                            pages.unshift(previousPageSet);
                        }

                        if (endPage < totalPages) {
                            var nextPageSet = makePage(endPage + 1, '...', false, false);
                            pages.push(nextPageSet);
                        }
                    }

                    // Add previous & next links
                    if (directionLinks) {
                        var previousPage = makePage(currentPage - 1, previousText, false, paginationCtrl.noPrevious());
                        pages.unshift(previousPage);

                        var nextPage = makePage(currentPage + 1, nextText, false, paginationCtrl.noNext());
                        pages.push(nextPage);
                    }

                    // Add first & last links
                    if (boundaryLinks) {
                        var firstPage = makePage(1, firstText, false, paginationCtrl.noPrevious());
                        pages.unshift(firstPage);

                        var lastPage = makePage(totalPages, lastText, false, paginationCtrl.noNext());
                        pages.push(lastPage);
                    }

                    return pages;
                };
            }
        };
    }])

    .constant('pagerConfig', {
        itemsPerPage: 10,
        previousText: '« Previous',
        nextText: 'Next »',
        align: true
    })

    .directive('pager', ['pagerConfig', function (config) {
        return {
            restrict: 'EA',
            scope: {
                page: '=',
                totalItems: '=',
                onSelectPage: ' &'
            },
            controller: 'PaginationController',
            templateUrl: 'template/pagination/pager.html',
            replace: true,
            link: function (scope, element, attrs, paginationCtrl) {

                // Setup configuration parameters
                var previousText = paginationCtrl.getAttributeValue(attrs.previousText, config.previousText, true),
                    nextText = paginationCtrl.getAttributeValue(attrs.nextText, config.nextText, true),
                    align = paginationCtrl.getAttributeValue(attrs.align, config.align);

                paginationCtrl.init(config.itemsPerPage);

                // Create page object used in template
                function makePage(number, text, isDisabled, isPrevious, isNext) {
                    return {
                        number: number,
                        text: text,
                        disabled: isDisabled,
                        previous: (align && isPrevious),
                        next: (align && isNext)
                    };
                }

                paginationCtrl.getPages = function (currentPage) {
                    return [
                        makePage(currentPage - 1, previousText, paginationCtrl.noPrevious(), true, false),
                        makePage(currentPage + 1, nextText, paginationCtrl.noNext(), false, true)
                    ];
                };
            }
        };
    }]);

/**
 * The following features are still outstanding: animation as a
 * function, placement as a function, inside, support for more triggers than
 * just mouse enter/leave, html tooltips, and selector delegation.
 */
angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.bindHtml'])

    /**
     * The $tooltip service creates tooltip- and popover-like directives as well as
     * houses global options for them.
     */
    .provider('$tooltip', function () {
        // The default options tooltip and popover.
        var defaultOptions = {
            placement: 'top',
            animation: true,
            popupDelay: 0
        };

        // Default hide triggers for each show trigger
        var triggerMap = {
            'mouseenter': 'mouseleave',
            'click': 'click',
            'focus': 'blur'
        };

        // The options specified to the provider globally.
        var globalOptions = {};

        /**
         * `options({})` allows global configuration of all tooltips in the
         * application.
         *
         *   var app = angular.module( 'App', ['ui.bootstrap.tooltip'], function( $tooltipProvider ) {
         *     // place tooltips left instead of top by default
         *     $tooltipProvider.options( { placement: 'left' } );
         *   });
         */
        this.options = function (value) {
            angular.extend(globalOptions, value);
        };

        /**
         * This allows you to extend the set of trigger mappings available. E.g.:
         *
         *   $tooltipProvider.setTriggers( 'openTrigger': 'closeTrigger' );
         */
        this.setTriggers = function setTriggers(triggers) {
            angular.extend(triggerMap, triggers);
        };

        /**
         * This is a helper function for translating camel-case to snake-case.
         */
        function snake_case(name) {
            var regexp = /[A-Z]/g;
            var separator = '-';
            return name.replace(regexp, function (letter, pos) {
                return (pos ? separator : '') + letter.toLowerCase();
            });
        }

        /**
         * Returns the actual instance of the $tooltip service.
         * TODO support multiple triggers
         */
        this.$get = ['$window', '$compile', '$timeout', '$parse', '$document', '$position', '$interpolate', function ($window, $compile, $timeout, $parse, $document, $position, $interpolate) {
            return function $tooltip(type, prefix, defaultTriggerShow) {
                var options = angular.extend({}, defaultOptions, globalOptions);

                /**
                 * Returns an object of show and hide triggers.
                 *
                 * If a trigger is supplied,
                 * it is used to show the tooltip; otherwise, it will use the `trigger`
                 * option passed to the `$tooltipProvider.options` method; else it will
                 * default to the trigger supplied to this directive factory.
                 *
                 * The hide trigger is based on the show trigger. If the `trigger` option
                 * was passed to the `$tooltipProvider.options` method, it will use the
                 * mapped trigger from `triggerMap` or the passed trigger if the map is
                 * undefined; otherwise, it uses the `triggerMap` value of the show
                 * trigger; else it will just use the show trigger.
                 */
                function getTriggers(trigger) {
                    var show = trigger || options.trigger || defaultTriggerShow;
                    var hide = triggerMap[show] || show;
                    return {
                        show: show,
                        hide: hide
                    };
                }

                var directiveName = snake_case(type);

                var startSym = $interpolate.startSymbol();
                var endSym = $interpolate.endSymbol();
                var template =
                    '<div ' + directiveName + '-popup ' +
                    'title="' + startSym + 'tt_title' + endSym + '" ' +
                    'content="' + startSym + 'tt_content' + endSym + '" ' +
                    'placement="' + startSym + 'tt_placement' + endSym + '" ' +
                    'animation="tt_animation" ' +
                    'is-open="tt_isOpen"' +
                    '>' +
                    '</div>';

                return {
                    restrict: 'EA',
                    scope: true,
                    compile: function (tElem, tAttrs) {
                        var tooltipLinker = $compile(template);

                        return function link(scope, element, attrs) {
                            var tooltip;
                            var transitionTimeout;
                            var popupTimeout;
                            var appendToBody = angular.isDefined(options.appendToBody) ? options.appendToBody : false;
                            var triggers = getTriggers(undefined);
                            var hasRegisteredTriggers = false;
                            var hasEnableExp = angular.isDefined(attrs[prefix + 'Enable']);

                            var positionTooltip = function () {
                                var position,
                                    ttWidth,
                                    ttHeight,
                                    ttPosition;
                                // Get the position of the directive element.
                                position = appendToBody ? $position.offset(element) : $position.position(element);

                                // Get the height and width of the tooltip so we can center it.
                                ttWidth = tooltip.prop('offsetWidth');
                                ttHeight = tooltip.prop('offsetHeight');

                                // Calculate the tooltip's top and left coordinates to center it with
                                // this directive.
                                switch (scope.tt_placement) {
                                    case 'right':
                                        ttPosition = {
                                            top: position.top + position.height / 2 - ttHeight / 2,
                                            left: position.left + position.width
                                        };
                                        break;
                                    case 'bottom':
                                        ttPosition = {
                                            top: position.top + position.height,
                                            left: position.left + position.width / 2 - ttWidth / 2
                                        };
                                        break;
                                    case 'left':
                                        ttPosition = {
                                            top: position.top + position.height / 2 - ttHeight / 2,
                                            left: position.left - ttWidth
                                        };
                                        break;
                                    default:
                                        ttPosition = {
                                            top: position.top - ttHeight,
                                            left: position.left + position.width / 2 - ttWidth / 2
                                        };
                                        break;
                                }

                                ttPosition.top += 'px';
                                ttPosition.left += 'px';

                                // Now set the calculated positioning.
                                tooltip.css(ttPosition);

                            };

                            // By default, the tooltip is not open.
                            // TODO add ability to start tooltip opened
                            scope.tt_isOpen = false;

                            function toggleTooltipBind() {
                                if (!scope.tt_isOpen) {
                                    showTooltipBind();
                                } else {
                                    hideTooltipBind();
                                }
                            }

                            // Show the tooltip with delay if specified, otherwise show it immediately
                            function showTooltipBind() {
                                if (hasEnableExp && !scope.$eval(attrs[prefix + 'Enable'])) {
                                    return;
                                }
                                if (scope.tt_popupDelay) {
                                    popupTimeout = $timeout(show, scope.tt_popupDelay, false);
                                    popupTimeout.then(function (reposition) { reposition(); });
                                } else {
                                    show()();
                                }
                            }

                            function hideTooltipBind() {
                                scope.$apply(function () {
                                    hide();
                                });
                            }

                            // Show the tooltip popup element.
                            function show() {


                                // Don't show empty tooltips.
                                if (!scope.tt_content) {
                                    return angular.noop;
                                }

                                createTooltip();

                                // If there is a pending remove transition, we must cancel it, lest the
                                // tooltip be mysteriously removed.
                                if (transitionTimeout) {
                                    $timeout.cancel(transitionTimeout);
                                }

                                // Set the initial positioning.
                                tooltip.css({ top: 0, left: 0, display: 'block' });

                                // Now we add it to the DOM because need some info about it. But it's not 
                                // visible yet anyway.
                                if (appendToBody) {
                                    $document.find('body').append(tooltip);
                                } else {
                                    element.after(tooltip);
                                }

                                positionTooltip();

                                // And show the tooltip.
                                scope.tt_isOpen = true;
                                scope.$digest(); // digest required as $apply is not called

                                // Return positioning function as promise callback for correct
                                // positioning after draw.
                                return positionTooltip;
                            }

                            // Hide the tooltip popup element.
                            function hide() {
                                // First things first: we don't show it anymore.
                                scope.tt_isOpen = false;

                                //if tooltip is going to be shown after delay, we must cancel this
                                $timeout.cancel(popupTimeout);

                                // And now we remove it from the DOM. However, if we have animation, we 
                                // need to wait for it to expire beforehand.
                                // FIXME: this is a placeholder for a port of the transitions library.
                                if (scope.tt_animation) {
                                    transitionTimeout = $timeout(removeTooltip, 500);
                                } else {
                                    removeTooltip();
                                }
                            }

                            function createTooltip() {
                                // There can only be one tooltip element per directive shown at once.
                                if (tooltip) {
                                    removeTooltip();
                                }
                                tooltip = tooltipLinker(scope, function () { });

                                // Get contents rendered into the tooltip
                                scope.$digest();
                            }

                            function removeTooltip() {
                                if (tooltip) {
                                    tooltip.remove();
                                    tooltip = null;
                                }
                            }

                            /**
                             * Observe the relevant attributes.
                             */
                            attrs.$observe(type, function (val) {
                                scope.tt_content = val;

                                if (!val && scope.tt_isOpen) {
                                    hide();
                                }
                            });

                            attrs.$observe(prefix + 'Title', function (val) {
                                scope.tt_title = val;
                            });

                            attrs.$observe(prefix + 'Placement', function (val) {
                                scope.tt_placement = angular.isDefined(val) ? val : options.placement;
                            });

                            attrs.$observe(prefix + 'PopupDelay', function (val) {
                                var delay = parseInt(val, 10);
                                scope.tt_popupDelay = !isNaN(delay) ? delay : options.popupDelay;
                            });

                            var unregisterTriggers = function () {
                                if (hasRegisteredTriggers) {
                                    element.unbind(triggers.show, showTooltipBind);
                                    element.unbind(triggers.hide, hideTooltipBind);
                                }
                            };

                            attrs.$observe(prefix + 'Trigger', function (val) {
                                unregisterTriggers();

                                triggers = getTriggers(val);

                                if (triggers.show === triggers.hide) {
                                    element.bind(triggers.show, toggleTooltipBind);
                                } else {
                                    element.bind(triggers.show, showTooltipBind);
                                    element.bind(triggers.hide, hideTooltipBind);
                                }

                                hasRegisteredTriggers = true;
                            });

                            var animation = scope.$eval(attrs[prefix + 'Animation']);
                            scope.tt_animation = angular.isDefined(animation) ? !!animation : options.animation;

                            attrs.$observe(prefix + 'AppendToBody', function (val) {
                                appendToBody = angular.isDefined(val) ? $parse(val)(scope) : appendToBody;
                            });

                            // if a tooltip is attached to <body> we need to remove it on
                            // location change as its parent scope will probably not be destroyed
                            // by the change.
                            if (appendToBody) {
                                scope.$on('$locationChangeSuccess', function closeTooltipOnLocationChangeSuccess() {
                                    if (scope.tt_isOpen) {
                                        hide();
                                    }
                                });
                            }

                            // Make sure tooltip is destroyed and removed.
                            scope.$on('$destroy', function onDestroyTooltip() {
                                $timeout.cancel(transitionTimeout);
                                $timeout.cancel(popupTimeout);
                                unregisterTriggers();
                                removeTooltip();
                            });
                        };
                    }
                };
            };
        }];
    })

    .directive('tooltipPopup', function () {
        return {
            restrict: 'EA',
            replace: true,
            scope: { content: '@', placement: '@', animation: '&', isOpen: '&' },
            templateUrl: 'template/tooltip/tooltip-popup.html'
        };
    })

    .directive('tooltip', ['$tooltip', function ($tooltip) {
        return $tooltip('tooltip', 'tooltip', 'mouseenter');
    }])

    .directive('tooltipHtmlUnsafePopup', function () {
        return {
            restrict: 'EA',
            replace: true,
            scope: { content: '@', placement: '@', animation: '&', isOpen: '&' },
            templateUrl: 'template/tooltip/tooltip-html-unsafe-popup.html'
        };
    })

    .directive('tooltipHtmlUnsafe', ['$tooltip', function ($tooltip) {
        return $tooltip('tooltipHtmlUnsafe', 'tooltip', 'mouseenter');
    }]);

/**
 * The following features are still outstanding: popup delay, animation as a
 * function, placement as a function, inside, support for more triggers than
 * just mouse enter/leave, html popovers, and selector delegatation.
 */
angular.module('ui.bootstrap.popover', ['ui.bootstrap.tooltip'])

    .directive('popoverPopup', function () {
        return {
            restrict: 'EA',
            replace: true,
            scope: { title: '@', content: '@', placement: '@', animation: '&', isOpen: '&' },
            templateUrl: 'template/popover/popover.html'
        };
    })

    .directive('popover', ['$tooltip', function ($tooltip) {
        return $tooltip('popover', 'popover', 'click');
    }]);

angular.module('ui.bootstrap.progressbar', ['ui.bootstrap.transition'])

    .constant('progressConfig', {
        animate: true,
        max: 100
    })

    .controller('ProgressController', ['$scope', '$attrs', 'progressConfig', '$transition', function ($scope, $attrs, progressConfig, $transition) {
        var self = this,
            bars = [],
            max = angular.isDefined($attrs.max) ? $scope.$parent.$eval($attrs.max) : progressConfig.max,
            animate = angular.isDefined($attrs.animate) ? $scope.$parent.$eval($attrs.animate) : progressConfig.animate;

        this.addBar = function (bar, element) {
            var oldValue = 0, index = bar.$parent.$index;
            if (angular.isDefined(index) && bars[index]) {
                oldValue = bars[index].value;
            }
            bars.push(bar);

            this.update(element, bar.value, oldValue);

            bar.$watch('value', function (value, oldValue) {
                if (value !== oldValue) {
                    self.update(element, value, oldValue);
                }
            });

            bar.$on('$destroy', function () {
                self.removeBar(bar);
            });
        };

        // Update bar element width
        this.update = function (element, newValue, oldValue) {
            var percent = this.getPercentage(newValue);

            if (animate) {
                element.css('width', this.getPercentage(oldValue) + '%');
                $transition(element, { width: percent + '%' });
            } else {
                element.css({ 'transition': 'none', 'width': percent + '%' });
            }
        };

        this.removeBar = function (bar) {
            bars.splice(bars.indexOf(bar), 1);
        };

        this.getPercentage = function (value) {
            return Math.round(100 * value / max);
        };
    }])

    .directive('progress', function () {
        return {
            restrict: 'EA',
            replace: true,
            transclude: true,
            controller: 'ProgressController',
            require: 'progress',
            scope: {},
            template: '<div class="progress" ng-transclude></div>'
            //templateUrl: 'template/progressbar/progress.html' // Works in AngularJS 1.2
        };
    })

    .directive('bar', function () {
        return {
            restrict: 'EA',
            replace: true,
            transclude: true,
            require: '^progress',
            scope: {
                value: '=',
                type: '@'
            },
            templateUrl: 'template/progressbar/bar.html',
            link: function (scope, element, attrs, progressCtrl) {
                progressCtrl.addBar(scope, element);
            }
        };
    })

    .directive('progressbar', function () {
        return {
            restrict: 'EA',
            replace: true,
            transclude: true,
            controller: 'ProgressController',
            scope: {
                value: '=',
                type: '@'
            },
            templateUrl: 'template/progressbar/progressbar.html',
            link: function (scope, element, attrs, progressCtrl) {
                progressCtrl.addBar(scope, angular.element(element.children()[0]));
            }
        };
    });
angular.module('ui.bootstrap.rating', [])

    .constant('ratingConfig', {
        max: 5,
        stateOn: null,
        stateOff: null
    })

    .controller('RatingController', ['$scope', '$attrs', '$parse', 'ratingConfig', function ($scope, $attrs, $parse, ratingConfig) {

        this.maxRange = angular.isDefined($attrs.max) ? $scope.$parent.$eval($attrs.max) : ratingConfig.max;
        this.stateOn = angular.isDefined($attrs.stateOn) ? $scope.$parent.$eval($attrs.stateOn) : ratingConfig.stateOn;
        this.stateOff = angular.isDefined($attrs.stateOff) ? $scope.$parent.$eval($attrs.stateOff) : ratingConfig.stateOff;

        this.createRateObjects = function (states) {
            var defaultOptions = {
                stateOn: this.stateOn,
                stateOff: this.stateOff
            };

            for (var i = 0, n = states.length; i < n; i++) {
                states[i] = angular.extend({ index: i }, defaultOptions, states[i]);
            }
            return states;
        };

        // Get objects used in template
        $scope.range = angular.isDefined($attrs.ratingStates) ? this.createRateObjects(angular.copy($scope.$parent.$eval($attrs.ratingStates))) : this.createRateObjects(new Array(this.maxRange));

        $scope.rate = function (value) {
            if ($scope.value !== value && !$scope.readonly) {
                $scope.value = value;
            }
        };

        $scope.enter = function (value) {
            if (!$scope.readonly) {
                $scope.val = value;
            }
            $scope.onHover({ value: value });
        };

        $scope.reset = function () {
            $scope.val = angular.copy($scope.value);
            $scope.onLeave();
        };

        $scope.$watch('value', function (value) {
            $scope.val = value;
        });

        $scope.readonly = false;
        if ($attrs.readonly) {
            $scope.$parent.$watch($parse($attrs.readonly), function (value) {
                $scope.readonly = !!value;
            });
        }
    }])

    .directive('rating', function () {
        return {
            restrict: 'EA',
            scope: {
                value: '=',
                onHover: '&',
                onLeave: '&'
            },
            controller: 'RatingController',
            templateUrl: 'template/rating/rating.html',
            replace: true
        };
    });

/**
 * @ngdoc overview
 * @name ui.bootstrap.tabs
 *
 * @description
 * AngularJS version of the tabs directive.
 */

angular.module('ui.bootstrap.tabs', [])

    .controller('TabsetController', ['$scope', function TabsetCtrl($scope) {
        var ctrl = this,
            tabs = ctrl.tabs = $scope.tabs = [];

        ctrl.select = function (tab) {
            angular.forEach(tabs, function (tab) {
                tab.active = false;
            });
            tab.active = true;
        };

        ctrl.addTab = function addTab(tab) {
            tabs.push(tab);
            if (tabs.length === 1 || tab.active) {
                ctrl.select(tab);
            }
        };

        ctrl.removeTab = function removeTab(tab) {
            var index = tabs.indexOf(tab);
            //Select a new tab if the tab to be removed is selected
            if (tab.active && tabs.length > 1) {
                //If this is the last tab, select the previous tab. else, the next tab.
                var newActiveIndex = index == tabs.length - 1 ? index - 1 : index + 1;
                ctrl.select(tabs[newActiveIndex]);
            }
            tabs.splice(index, 1);
        };
    }])

    /**
     * @ngdoc directive
     * @name ui.bootstrap.tabs.directive:tabset
     * @restrict EA
     *
     * @description
     * Tabset is the outer container for the tabs directive
     *
     * @param {boolean=} vertical Whether or not to use vertical styling for the tabs.
     * @param {boolean=} justified Whether or not to use justified styling for the tabs.
     *
     * @example
    <example module="ui.bootstrap">
      <file name="index.html">
        <tabset>
          <tab heading="Tab 1"><b>First</b> Content!</tab>
          <tab heading="Tab 2"><i>Second</i> Content!</tab>
        </tabset>
        <hr />
        <tabset vertical="true">
          <tab heading="Vertical Tab 1"><b>First</b> Vertical Content!</tab>
          <tab heading="Vertical Tab 2"><i>Second</i> Vertical Content!</tab>
        </tabset>
        <tabset justified="true">
          <tab heading="Justified Tab 1"><b>First</b> Justified Content!</tab>
          <tab heading="Justified Tab 2"><i>Second</i> Justified Content!</tab>
        </tabset>
      </file>
    </example>
     */
    .directive('tabset', function () {
        return {
            restrict: 'EA',
            transclude: true,
            replace: true,
            scope: {},
            controller: 'TabsetController',
            templateUrl: 'template/tabs/tabset.html',
            link: function (scope, element, attrs) {
                scope.vertical = angular.isDefined(attrs.vertical) ? scope.$parent.$eval(attrs.vertical) : false;
                scope.justified = angular.isDefined(attrs.justified) ? scope.$parent.$eval(attrs.justified) : false;
                scope.type = angular.isDefined(attrs.type) ? scope.$parent.$eval(attrs.type) : 'tabs';
            }
        };
    })

    /**
     * @ngdoc directive
     * @name ui.bootstrap.tabs.directive:tab
     * @restrict EA
     *
     * @param {string=} heading The visible heading, or title, of the tab. Set HTML headings with {@link ui.bootstrap.tabs.directive:tabHeading tabHeading}.
     * @param {string=} select An expression to evaluate when the tab is selected.
     * @param {boolean=} active A binding, telling whether or not this tab is selected.
     * @param {boolean=} disabled A binding, telling whether or not this tab is disabled.
     *
     * @description
     * Creates a tab with a heading and content. Must be placed within a {@link ui.bootstrap.tabs.directive:tabset tabset}.
     *
     * @example
    <example module="ui.bootstrap">
      <file name="index.html">
        <div ng-controller="TabsDemoCtrl">
          <button class="btn btn-small" ng-click="items[0].active = true">
            Select item 1, using active binding
          </button>
          <button class="btn btn-small" ng-click="items[1].disabled = !items[1].disabled">
            Enable/disable item 2, using disabled binding
          </button>
          <br />
          <tabset>
            <tab heading="Tab 1">First Tab</tab>
            <tab select="alertMe()">
              <tab-heading><i class="icon-bell"></i> Alert me!</tab-heading>
              Second Tab, with alert callback and html heading!
            </tab>
            <tab ng-repeat="item in items"
              heading="{{item.title}}"
              disabled="item.disabled"
              active="item.active">
              {{item.content}}
            </tab>
          </tabset>
        </div>
      </file>
      <file name="script.js">
        function TabsDemoCtrl($scope) {
          $scope.items = [
            { title:"Dynamic Title 1", content:"Dynamic Item 0" },
            { title:"Dynamic Title 2", content:"Dynamic Item 1", disabled: true }
          ];
    
          $scope.alertMe = function() {
            setTimeout(function() {
              alert("You've selected the alert tab!");
            });
          };
        };
      </file>
    </example>
     */

    /**
     * @ngdoc directive
     * @name ui.bootstrap.tabs.directive:tabHeading
     * @restrict EA
     *
     * @description
     * Creates an HTML heading for a {@link ui.bootstrap.tabs.directive:tab tab}. Must be placed as a child of a tab element.
     *
     * @example
    <example module="ui.bootstrap">
      <file name="index.html">
        <tabset>
          <tab>
            <tab-heading><b>HTML</b> in my titles?!</tab-heading>
            And some content, too!
          </tab>
          <tab>
            <tab-heading><i class="icon-heart"></i> Icon heading?!?</tab-heading>
            That's right.
          </tab>
        </tabset>
      </file>
    </example>
     */
    .directive('tab', ['$parse', function ($parse) {
        return {
            require: '^tabset',
            restrict: 'EA',
            replace: true,
            templateUrl: 'template/tabs/tab.html',
            transclude: true,
            scope: {
                heading: '@',
                onSelect: '&select', //This callback is called in contentHeadingTransclude
                //once it inserts the tab's content into the dom
                onDeselect: '&deselect'
            },
            controller: function () {
                //Empty controller so other directives can require being 'under' a tab
            },
            compile: function (elm, attrs, transclude) {
                return function postLink(scope, elm, attrs, tabsetCtrl) {
                    var getActive, setActive;
                    if (attrs.active) {
                        getActive = $parse(attrs.active);
                        setActive = getActive.assign;
                        scope.$parent.$watch(getActive, function updateActive(value, oldVal) {
                            // Avoid re-initializing scope.active as it is already initialized
                            // below. (watcher is called async during init with value ===
                            // oldVal)
                            if (value !== oldVal) {
                                scope.active = !!value;
                            }
                        });
                        scope.active = getActive(scope.$parent);
                    } else {
                        setActive = getActive = angular.noop;
                    }

                    scope.$watch('active', function (active) {
                        // Note this watcher also initializes and assigns scope.active to the
                        // attrs.active expression.
                        setActive(scope.$parent, active);
                        if (active) {
                            tabsetCtrl.select(scope);
                            scope.onSelect();
                        } else {
                            scope.onDeselect();
                        }
                    });

                    scope.disabled = false;
                    if (attrs.disabled) {
                        scope.$parent.$watch($parse(attrs.disabled), function (value) {
                            scope.disabled = !!value;
                        });
                    }

                    scope.select = function () {
                        if (!scope.disabled) {
                            scope.active = true;
                        }
                    };

                    tabsetCtrl.addTab(scope);
                    scope.$on('$destroy', function () {
                        tabsetCtrl.removeTab(scope);
                    });


                    //We need to transclude later, once the content container is ready.
                    //when this link happens, we're inside a tab heading.
                    scope.$transcludeFn = transclude;
                };
            }
        };
    }])

    .directive('tabHeadingTransclude', [function () {
        return {
            restrict: 'A',
            require: '^tab',
            link: function (scope, elm, attrs, tabCtrl) {
                scope.$watch('headingElement', function updateHeadingElement(heading) {
                    if (heading) {
                        elm.html('');
                        elm.append(heading);
                    }
                });
            }
        };
    }])

    .directive('tabContentTransclude', function () {
        return {
            restrict: 'A',
            require: '^tabset',
            link: function (scope, elm, attrs) {
                var tab = scope.$eval(attrs.tabContentTransclude);

                //Now our tab is ready to be transcluded: both the tab heading area
                //and the tab content area are loaded.  Transclude 'em both.
                tab.$transcludeFn(tab.$parent, function (contents) {
                    angular.forEach(contents, function (node) {
                        if (isTabHeading(node)) {
                            //Let tabHeadingTransclude know.
                            tab.headingElement = node;
                        } else {
                            elm.append(node);
                        }
                    });
                });
            }
        };
        function isTabHeading(node) {
            return node.tagName && (
                node.hasAttribute('tab-heading') ||
                node.hasAttribute('data-tab-heading') ||
                node.tagName.toLowerCase() === 'tab-heading' ||
                node.tagName.toLowerCase() === 'data-tab-heading'
            );
        }
    })

    ;

angular.module('ui.bootstrap.timepicker', [])

    .constant('timepickerConfig', {
        hourStep: 1,
        minuteStep: 1,
        showMeridian: true,
        meridians: null,
        readonlyInput: false,
        mousewheel: true
    })

    .directive('timepicker', ['$parse', '$log', 'timepickerConfig', '$locale', function ($parse, $log, timepickerConfig, $locale) {
        return {
            restrict: 'EA',
            require: '?^ngModel',
            replace: true,
            scope: {},
            templateUrl: 'template/timepicker/timepicker.html',
            link: function (scope, element, attrs, ngModel) {
                if (!ngModel) {
                    return; // do nothing if no ng-model
                }

                var selected = new Date(),
                    meridians = angular.isDefined(attrs.meridians) ? scope.$parent.$eval(attrs.meridians) : timepickerConfig.meridians || $locale.DATETIME_FORMATS.AMPMS;

                var hourStep = timepickerConfig.hourStep;
                if (attrs.hourStep) {
                    scope.$parent.$watch($parse(attrs.hourStep), function (value) {
                        hourStep = parseInt(value, 10);
                    });
                }

                var minuteStep = timepickerConfig.minuteStep;
                if (attrs.minuteStep) {
                    scope.$parent.$watch($parse(attrs.minuteStep), function (value) {
                        minuteStep = parseInt(value, 10);
                    });
                }

                // 12H / 24H mode
                scope.showMeridian = timepickerConfig.showMeridian;
                if (attrs.showMeridian) {
                    scope.$parent.$watch($parse(attrs.showMeridian), function (value) {
                        scope.showMeridian = !!value;

                        if (ngModel.$error.time) {
                            // Evaluate from template
                            var hours = getHoursFromTemplate(), minutes = getMinutesFromTemplate();
                            if (angular.isDefined(hours) && angular.isDefined(minutes)) {
                                selected.setHours(hours);
                                refresh();
                            }
                        } else {
                            updateTemplate();
                        }
                    });
                }

                // Get scope.hours in 24H mode if valid
                function getHoursFromTemplate() {
                    var hours = parseInt(scope.hours, 10);
                    var valid = (scope.showMeridian) ? (hours > 0 && hours < 13) : (hours >= 0 && hours < 24);
                    if (!valid) {
                        return undefined;
                    }

                    if (scope.showMeridian) {
                        if (hours === 12) {
                            hours = 0;
                        }
                        if (scope.meridian === meridians[1]) {
                            hours = hours + 12;
                        }
                    }
                    return hours;
                }

                function getMinutesFromTemplate() {
                    var minutes = parseInt(scope.minutes, 10);
                    return (minutes >= 0 && minutes < 60) ? minutes : undefined;
                }

                function pad(value) {
                    return (angular.isDefined(value) && value.toString().length < 2) ? '0' + value : value;
                }

                // Input elements
                var inputs = element.find('input'), hoursInputEl = inputs.eq(0), minutesInputEl = inputs.eq(1);

                // Respond on mousewheel spin
                var mousewheel = (angular.isDefined(attrs.mousewheel)) ? scope.$eval(attrs.mousewheel) : timepickerConfig.mousewheel;
                if (mousewheel) {

                    var isScrollingUp = function (e) {
                        if (e.originalEvent) {
                            e = e.originalEvent;
                        }
                        //pick correct delta variable depending on event
                        var delta = (e.wheelDelta) ? e.wheelDelta : -e.deltaY;
                        return (e.detail || delta > 0);
                    };

                    hoursInputEl.bind('mousewheel wheel', function (e) {
                        scope.$apply((isScrollingUp(e)) ? scope.incrementHours() : scope.decrementHours());
                        e.preventDefault();
                    });

                    minutesInputEl.bind('mousewheel wheel', function (e) {
                        scope.$apply((isScrollingUp(e)) ? scope.incrementMinutes() : scope.decrementMinutes());
                        e.preventDefault();
                    });
                }

                scope.readonlyInput = (angular.isDefined(attrs.readonlyInput)) ? scope.$eval(attrs.readonlyInput) : timepickerConfig.readonlyInput;
                if (!scope.readonlyInput) {

                    var invalidate = function (invalidHours, invalidMinutes) {
                        ngModel.$setViewValue(null);
                        ngModel.$setValidity('time', false);
                        if (angular.isDefined(invalidHours)) {
                            scope.invalidHours = invalidHours;
                        }
                        if (angular.isDefined(invalidMinutes)) {
                            scope.invalidMinutes = invalidMinutes;
                        }
                    };

                    scope.updateHours = function () {
                        var hours = getHoursFromTemplate();

                        if (angular.isDefined(hours)) {
                            selected.setHours(hours);
                            refresh('h');
                        } else {
                            invalidate(true);
                        }
                    };

                    hoursInputEl.bind('blur', function (e) {
                        if (!scope.validHours && scope.hours < 10) {
                            scope.$apply(function () {
                                scope.hours = pad(scope.hours);
                            });
                        }
                    });

                    scope.updateMinutes = function () {
                        var minutes = getMinutesFromTemplate();

                        if (angular.isDefined(minutes)) {
                            selected.setMinutes(minutes);
                            refresh('m');
                        } else {
                            invalidate(undefined, true);
                        }
                    };

                    minutesInputEl.bind('blur', function (e) {
                        if (!scope.invalidMinutes && scope.minutes < 10) {
                            scope.$apply(function () {
                                scope.minutes = pad(scope.minutes);
                            });
                        }
                    });
                } else {
                    scope.updateHours = angular.noop;
                    scope.updateMinutes = angular.noop;
                }

                ngModel.$render = function () {
                    var date = ngModel.$modelValue ? new Date(ngModel.$modelValue) : null;

                    if (isNaN(date)) {
                        ngModel.$setValidity('time', false);
                        $log.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.');
                    } else {
                        if (date) {
                            selected = date;
                        }
                        makeValid();
                        updateTemplate();
                    }
                };

                // Call internally when we know that model is valid.
                function refresh(keyboardChange) {
                    makeValid();
                    ngModel.$setViewValue(new Date(selected));
                    updateTemplate(keyboardChange);
                }

                function makeValid() {
                    ngModel.$setValidity('time', true);
                    scope.invalidHours = false;
                    scope.invalidMinutes = false;
                }

                function updateTemplate(keyboardChange) {
                    var hours = selected.getHours(), minutes = selected.getMinutes();

                    if (scope.showMeridian) {
                        hours = (hours === 0 || hours === 12) ? 12 : hours % 12; // Convert 24 to 12 hour system
                    }
                    scope.hours = keyboardChange === 'h' ? hours : pad(hours);
                    scope.minutes = keyboardChange === 'm' ? minutes : pad(minutes);
                    scope.meridian = selected.getHours() < 12 ? meridians[0] : meridians[1];
                }

                function addMinutes(minutes) {
                    var dt = new Date(selected.getTime() + minutes * 60000);
                    selected.setHours(dt.getHours(), dt.getMinutes());
                    refresh();
                }

                scope.incrementHours = function () {
                    addMinutes(hourStep * 60);
                };
                scope.decrementHours = function () {
                    addMinutes(-hourStep * 60);
                };
                scope.incrementMinutes = function () {
                    addMinutes(minuteStep);
                };
                scope.decrementMinutes = function () {
                    addMinutes(-minuteStep);
                };
                scope.toggleMeridian = function () {
                    addMinutes(12 * 60 * ((selected.getHours() < 12) ? 1 : -1));
                };
            }
        };
    }]);

angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap.bindHtml'])

    /**
     * A helper service that can parse typeahead's syntax (string provided by users)
     * Extracted to a separate service for ease of unit testing
     */
    .factory('typeaheadParser', ['$parse', function ($parse) {

        //                      00000111000000000000022200000000000000003333333333333330000000000044000
        var TYPEAHEAD_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+(.*)$/;

        return {
            parse: function (input) {

                var match = input.match(TYPEAHEAD_REGEXP), modelMapper, viewMapper, source;
                if (!match) {
                    throw new Error(
                        "Expected typeahead specification in form of '_modelValue_ (as _label_)? for _item_ in _collection_'" +
                        " but got '" + input + "'.");
                }

                return {
                    itemName: match[3],
                    source: $parse(match[4]),
                    viewMapper: $parse(match[2] || match[1]),
                    modelMapper: $parse(match[1])
                };
            }
        };
    }])

    .directive('typeahead', ['$compile', '$parse', '$q', '$timeout', '$document', '$position', 'typeaheadParser',
        function ($compile, $parse, $q, $timeout, $document, $position, typeaheadParser) {

            var HOT_KEYS = [9, 13, 27, 38, 40];

            return {
                require: 'ngModel',
                link: function (originalScope, element, attrs, modelCtrl) {

                    //SUPPORTED ATTRIBUTES (OPTIONS)

                    //minimal no of characters that needs to be entered before typeahead kicks-in
                    var minSearch = originalScope.$eval(attrs.typeaheadMinLength) || 1;

                    //minimal wait time after last character typed before typehead kicks-in
                    var waitTime = originalScope.$eval(attrs.typeaheadWaitMs) || 0;

                    //should it restrict model values to the ones selected from the popup only?
                    var isEditable = originalScope.$eval(attrs.typeaheadEditable) !== false;

                    //binding to a variable that indicates if matches are being retrieved asynchronously
                    var isLoadingSetter = $parse(attrs.typeaheadLoading).assign || angular.noop;

                    //a callback executed when a match is selected
                    var onSelectCallback = $parse(attrs.typeaheadOnSelect);

                    var inputFormatter = attrs.typeaheadInputFormatter ? $parse(attrs.typeaheadInputFormatter) : undefined;

                    var appendToBody = attrs.typeaheadAppendToBody ? $parse(attrs.typeaheadAppendToBody) : false;

                    var IsShowDefault = attrs.typeaheadShowDefault ? $parse(attrs.typeaheadShowDefault) : false;

                    //INTERNAL VARIABLES

                    //model setter executed upon match selection
                    var $setModelValue = $parse(attrs.ngModel).assign;

                    //expressions used by typeahead
                    var parserResult = typeaheadParser.parse(attrs.typeahead);

                    var hasFocus;

                    //pop-up element used to display matches
                    var popUpEl = angular.element('<div typeahead-popup></div>');
                    popUpEl.attr({
                        matches: 'matches',
                        active: 'activeIdx',
                        select: 'select(activeIdx)',
                        query: 'query',
                        position: 'position'
                    });
                    //custom item template
                    if (angular.isDefined(attrs.typeaheadTemplateUrl)) {
                        popUpEl.attr('template-url', attrs.typeaheadTemplateUrl);
                    }

                    //create a child scope for the typeahead directive so we are not polluting original scope
                    //with typeahead-specific data (matches, query etc.)
                    var scope = originalScope.$new();
                    originalScope.$on('$destroy', function () {
                        scope.$destroy();
                    });

                    var resetMatches = function () {
                        scope.matches = [];
                        scope.activeIdx = -1;
                    };

                    console.log(scope.activeIdx);

                    var getMatchesAsync = function (inputValue) {
                        var locals = { $viewValue: inputValue };
                        isLoadingSetter(originalScope, true);
                        $q.when(parserResult.source(originalScope, locals)).then(function (matches) {

                            //it might happen that several async queries were in progress if a user were typing fast
                            //but we are interested only in responses that correspond to the current view value
                            if (typeof modelCtrl.$viewValue == "undefined" || modelCtrl.$viewValue.length == 0)
                                modelCtrl.$viewValue = "";
                            if (inputValue === modelCtrl.$viewValue && hasFocus) {
                                if (matches.length > 0) {

                                    scope.activeIdx = 0;
                                    scope.matches.length = 0;

                                    //transform labels
                                    for (var i = 0; i < matches.length; i++) {
                                        locals[parserResult.itemName] = matches[i];
                                        scope.matches.push({
                                            label: parserResult.viewMapper(scope, locals),
                                            model: matches[i]
                                        });
                                    }

                                    scope.query = inputValue;
                                    //position pop-up with matches - we need to re-calculate its position each time we are opening a window
                                    //with matches as a pop-up might be absolute-positioned and position of an input might have changed on a page
                                    //due to other elements being rendered
                                    scope.position = appendToBody ? $position.offset(element) : $position.position(element);
                                    scope.position.top = scope.position.top + element.prop('offsetHeight');
                                    isLoadingSetter(originalScope, false);
                                } else {
                                    resetMatches();
                                    isLoadingSetter(originalScope, false);
                                }

                            }
                            else {
                                isLoadingSetter(originalScope, false);
                            }
                        }, function () {
                            resetMatches();
                            isLoadingSetter(originalScope, false);
                        });
                    };

                    resetMatches();

                    //we need to propagate user's query so we can higlight matches
                    scope.query = undefined;

                    //Declare the timeout promise var outside the function scope so that stacked calls can be cancelled later 
                    var timeoutPromise;
                    if (IsShowDefault) {
                        element.on('focus', function () {
                            hasFocus = true;
                            inputValue = '';
                            if (waitTime > 0) {
                                if (timeoutPromise) {
                                    $timeout.cancel(timeoutPromise);//cancel previous timeout
                                }
                                timeoutPromise = $timeout(function () {
                                    getMatchesAsync(inputValue);
                                    isLoadingSetter(originalScope, false);
                                }, waitTime);
                            } else {
                                getMatchesAsync(inputValue);
                                isLoadingSetter(originalScope, false);
                            }
                            if (isEditable) {
                                return inputValue;
                            } else {
                                if (!inputValue) {
                                    // Reset in case user had typed something previously.
                                    modelCtrl.$setValidity('editable', true);
                                    return inputValue;
                                } else {
                                    modelCtrl.$setValidity('editable', false);
                                    return undefined;
                                }
                            }
                        });
                    }
                    //plug into $parsers pipeline to open a typeahead on view changes initiated from DOM
                    //$parsers kick-in on all the changes coming from the view as well as manually triggered by $setViewValue
                    modelCtrl.$parsers.unshift(function (inputValue) {
                        hasFocus = true;
                        if (inputValue && inputValue.length >= minSearch) {
                            if (waitTime > 0) {
                                if (timeoutPromise) {
                                    $timeout.cancel(timeoutPromise);//cancel previous timeout
                                }
                                timeoutPromise = $timeout(function () {
                                    getMatchesAsync(inputValue);
                                }, waitTime);
                            } else {
                                getMatchesAsync(inputValue);
                            }
                        } else {
                            isLoadingSetter(originalScope, false);
                            resetMatches();
                        }

                        if (isEditable) {
                            return inputValue;
                        } else {
                            if (!inputValue) {
                                // Reset in case user had typed something previously.
                                modelCtrl.$setValidity('editable', true);
                                return inputValue;
                            } else {
                                modelCtrl.$setValidity('editable', false);
                                return undefined;
                            }
                        }
                    });

                    modelCtrl.$formatters.push(function (modelValue) {

                        var candidateViewValue, emptyViewValue;
                        var locals = {};

                        if (inputFormatter) {

                            locals['$model'] = modelValue;
                            return inputFormatter(originalScope, locals);

                        } else {

                            //it might happen that we don't have enough info to properly render input value
                            //we need to check for this situation and simply return model value if we can't apply custom formatting
                            locals[parserResult.itemName] = modelValue;
                            candidateViewValue = parserResult.viewMapper(originalScope, locals);
                            locals[parserResult.itemName] = undefined;
                            emptyViewValue = parserResult.viewMapper(originalScope, locals);

                            return candidateViewValue !== emptyViewValue ? candidateViewValue : modelValue;
                        }
                    });

                    scope.select = function (activeIdx) {
                        //called from within the $digest() cycle
                        var locals = {};
                        var model, item;

                        locals[parserResult.itemName] = item = scope.matches[activeIdx].model;
                        model = parserResult.modelMapper(originalScope, locals);
                        $setModelValue(originalScope, model);
                        modelCtrl.$setValidity('editable', true);

                        onSelectCallback(originalScope, {
                            $item: item,
                            $model: model,
                            $label: parserResult.viewMapper(originalScope, locals)
                        });
                        resetMatches();

                        //return focus to the input element if a mach was selected via a mouse click event
                        //element[0].focus();
                    };

                    //bind keyboard events: arrows up(38) / down(40), enter(13) and tab(9), esc(27)
                    element.bind('keydown', function (evt) {

                        //typeahead is open and an "interesting" key was pressed
                        if (scope.matches.length === 0 || HOT_KEYS.indexOf(evt.which) === -1) {
                            return;
                        }

                        evt.preventDefault();

                        if (evt.which === 40) {
                            scope.activeIdx = (scope.activeIdx + 1) % scope.matches.length;
                            scope.$digest();

                        } else if (evt.which === 38) {
                            scope.activeIdx = (scope.activeIdx ? scope.activeIdx : scope.matches.length) - 1;
                            scope.$digest();

                        } else if (evt.which === 13 || evt.which === 9) {
                            scope.$apply(function () {
                                scope.select(scope.activeIdx);
                            });

                        } else if (evt.which === 27) {
                            evt.stopPropagation();

                            resetMatches();
                            scope.$digest();
                        }
                    });

                    element.bind('blur', function (evt) {
                        hasFocus = false;
                    });

                    // Keep reference to click handler to unbind it.
                    var dismissClickHandler = function (evt) {
                        if (element[0] !== evt.target) {
                            resetMatches();
                            scope.$digest();
                        }
                    };

                    $document.bind('click', dismissClickHandler);

                    originalScope.$on('$destroy', function () {
                        $document.unbind('click', dismissClickHandler);
                    });

                    var $popup = $compile(popUpEl)(scope);
                    if (appendToBody) {
                        $document.find('body').append($popup);
                    } else {
                        element.after($popup);
                    }
                }
            };

        }])

    .directive('typeaheadPopup', function () {
        return {
            restrict: 'EA',
            scope: {
                matches: '=',
                query: '=',
                active: '=',
                position: '=',
                select: '&'
            },
            replace: true,
            templateUrl: 'template/typeahead/typeahead-popup.html',
            link: function (scope, element, attrs) {

                scope.templateUrl = attrs.templateUrl;

                scope.isOpen = function () {
                    return scope.matches.length > 0;
                };

                scope.isActive = function (matchIdx) {
                    return scope.active == matchIdx;
                };

                scope.selectActive = function (matchIdx) {
                    scope.active = matchIdx;
                };

                scope.selectMatch = function (activeIdx) {
                    scope.select({ activeIdx: activeIdx });
                };
            }
        };
    })

    .directive('typeaheadMatch', ['$http', '$templateCache', '$compile', '$parse', function ($http, $templateCache, $compile, $parse) {
        return {
            restrict: 'EA',
            scope: {
                index: '=',
                match: '=',
                query: '='
            },
            link: function (scope, element, attrs) {
                var tplUrl = $parse(attrs.templateUrl)(scope.$parent) || 'template/typeahead/typeahead-match.html';
                $http.get(tplUrl, { cache: $templateCache }).success(function (tplContent) {
                    element.replaceWith($compile(tplContent.trim())(scope));
                });
            }
        };
    }])

    .filter('typeaheadHighlight', function () {

        function escapeRegexp(queryToEscape) {
            return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
        }

        return function (matchItem, query) {
            return query ? matchItem.replace(new RegExp(escapeRegexp(query), 'gi'), '<strong>$&</strong>') : matchItem;
        };
    });
angular.module("template/accordion/accordion-group.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/accordion/accordion-group.html",
        "<div class=\"panel panel-default\">\n" +
        "  <div class=\"panel-heading\">\n" +
        "    <h4 class=\"panel-title\">\n" +
        "      <a class=\"accordion-toggle\" ng-click=\"isOpen = !isOpen\" accordion-transclude=\"heading\">{{heading}}</a>\n" +
        "    </h4>\n" +
        "  </div>\n" +
        "  <div class=\"panel-collapse\" collapse=\"!isOpen\">\n" +
        "	  <div class=\"panel-body\" ng-transclude></div>\n" +
        "  </div>\n" +
        "</div>");
}]);

angular.module("template/accordion/accordion.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/accordion/accordion.html",
        "<div class=\"panel-group\" ng-transclude></div>");
}]);

angular.module("template/alert/alert.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/alert/alert.html",
        "<div class='alert' ng-class='\"alert-\" + (type || \"warning\")'>\n" +
        "    <button ng-show='closeable' type='button' class='close' ng-click='close()'>&times;</button>\n" +
        "    <div ng-transclude></div>\n" +
        "</div>\n" +
        "");
}]);

angular.module("template/carousel/carousel.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/carousel/carousel.html",
        "<div ng-mouseenter=\"pause()\" ng-mouseleave=\"play()\" class=\"carousel\">\n" +
        "    <ol class=\"carousel-indicators\" ng-show=\"slides().length > 1\">\n" +
        "        <li ng-repeat=\"slide in slides()\" ng-class=\"{active: isActive(slide)}\" ng-click=\"select(slide)\"></li>\n" +
        "    </ol>\n" +
        "    <div class=\"carousel-inner\" ng-transclude></div>\n" +
        "    <a class=\"left carousel-control\" ng-click=\"prev()\" ng-show=\"slides().length > 1\"><span class=\"icon-prev\"></span></a>\n" +
        "    <a class=\"right carousel-control\" ng-click=\"next()\" ng-show=\"slides().length > 1\"><span class=\"icon-next\"></span></a>\n" +
        "</div>\n" +
        "");
}]);

angular.module("template/carousel/slide.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/carousel/slide.html",
        "<div ng-class=\"{\n" +
        "    'active': leaving || (active && !entering),\n" +
        "    'prev': (next || active) && direction=='prev',\n" +
        "    'next': (next || active) && direction=='next',\n" +
        "    'right': direction=='prev',\n" +
        "    'left': direction=='next'\n" +
        "  }\" class=\"item text-center\" ng-transclude></div>\n" +
        "");
}]);

angular.module("template/datepicker/datepicker.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/datepicker/datepicker.html",
        "<table>\n" +
        "  <thead>\n" +
        "    <tr>\n" +
        "      <th><button type=\"button\" class=\"btn btn-default btn-sm pull-left\" ng-click=\"move(-1)\"><i class=\"glyphicon glyphicon-chevron-left\"></i></button></th>\n" +
        "      <th colspan=\"{{rows[0].length - 2 + showWeekNumbers}}\"><button type=\"button\" class=\"btn btn-default btn-sm btn-block\" ng-click=\"toggleMode()\"><strong>{{title}}</strong></button></th>\n" +
        "      <th><button type=\"button\" class=\"btn btn-default btn-sm pull-right\" ng-click=\"move(1)\"><i class=\"glyphicon glyphicon-chevron-right\"></i></button></th>\n" +
        "    </tr>\n" +
        "    <tr ng-show=\"labels.length > 0\" class=\"h6\">\n" +
        "      <th ng-show=\"showWeekNumbers\" class=\"text-center\">#</th>\n" +
        "      <th ng-repeat=\"label in labels\" class=\"text-center\">{{label}}</th>\n" +
        "    </tr>\n" +
        "  </thead>\n" +
        "  <tbody>\n" +
        "    <tr ng-repeat=\"row in rows\">\n" +
        "      <td ng-show=\"showWeekNumbers\" class=\"text-center\"><em>{{ getWeekNumber(row) }}</em></td>\n" +
        "      <td ng-repeat=\"dt in row\" class=\"text-center\">\n" +
        "        <button type=\"button\" style=\"width:100%;\" class=\"btn btn-default btn-sm\" ng-class=\"{'btn-info': dt.selected}\" ng-click=\"select(dt.date)\" ng-disabled=\"dt.disabled\"><span ng-class=\"{'text-muted': dt.secondary}\">{{dt.label}}</span></button>\n" +
        "      </td>\n" +
        "    </tr>\n" +
        "  </tbody>\n" +
        "</table>\n" +
        "");
}]);

angular.module("template/datepicker/popup.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/datepicker/popup.html",
        "<ul class=\"dropdown-menu\" ng-style=\"{display: (isOpen && 'block') || 'none', top: position.top+'px', left: position.left+'px'}\">\n" +
        "	<li ng-transclude></li>\n" +
        "	<li ng-show=\"showButtonBar\" style=\"padding:10px 9px 2px\">\n" +
        "		<span class=\"btn-group\">\n" +
        "			<button type=\"button\" class=\"btn btn-sm btn-info\" ng-click=\"today()\">{{currentText}}</button>\n" +
        "			<button type=\"button\" class=\"btn btn-sm btn-default\" ng-click=\"showWeeks = ! showWeeks\" ng-class=\"{active: showWeeks}\">{{toggleWeeksText}}</button>\n" +
        "			<button type=\"button\" class=\"btn btn-sm btn-danger\" ng-click=\"clear()\">{{clearText}}</button>\n" +
        "		</span>\n" +
        "		<button type=\"button\" class=\"btn btn-sm btn-success pull-right\" ng-click=\"isOpen = false\">{{closeText}}</button>\n" +
        "	</li>\n" +
        "</ul>\n" +
        "");
}]);

angular.module("template/modal/backdrop.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/modal/backdrop.html",
        "<div class=\"modal-backdrop fade\" ng-class=\"{in: animate}\" ng-style=\"{'z-index': 979 + index*10}\"></div>");
}]);

angular.module("template/modal/window.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/modal/window.html",
        "<div tabindex=\"-1\" class=\"modal fade {{ windowClass }}\" ng-class=\"{in: animate}\" ng-style=\"{'z-index': 1000 + index*10, display: 'block'}\" ng-click=\"close($event)\">\n" +
        "    <div class=\"modal-dialog {{sizeclass}}\"><div class=\"modal-content\" ng-transclude></div></div>\n" +
        "</div>");
}]);

angular.module("template/pagination/pager.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/pagination/pager.html",
        "<ul class=\"pager\">\n" +
        "  <li ng-repeat=\"page in pages\" ng-class=\"{disabled: page.disabled, previous: page.previous, next: page.next}\"><a ng-click=\"selectPage(page.number)\">{{page.text}}</a></li>\n" +
        "</ul>");
}]);

angular.module("template/pagination/pagination.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/pagination/pagination.html",
        "<ul class=\"pagination\">\n" +
        "  <li ng-repeat=\"page in pages\" ng-class=\"{active: page.active, disabled: page.disabled}\"><a ng-click=\"selectPage(page.number)\">{{page.text}}</a></li>\n" +
        "</ul>");
}]);

angular.module("template/tooltip/tooltip-html-unsafe-popup.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/tooltip/tooltip-html-unsafe-popup.html",
        "<div class=\"tooltip {{placement}}\" ng-class=\"{ in: isOpen(), fade: animation() }\">\n" +
        "  <div class=\"tooltip-arrow\"></div>\n" +
        "  <div class=\"tooltip-inner\" bind-html-unsafe=\"content\"></div>\n" +
        "</div>\n" +
        "");
}]);

angular.module("template/tooltip/tooltip-popup.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/tooltip/tooltip-popup.html",
        "<div class=\"tooltip {{placement}}\" ng-class=\"{ in: isOpen(), fade: animation() }\">\n" +
        "  <div class=\"tooltip-arrow\"></div>\n" +
        "  <div class=\"tooltip-inner\" ng-bind=\"content\"></div>\n" +
        "</div>\n" +
        "");
}]);

angular.module("template/popover/popover.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/popover/popover.html",
        "<div class=\"popover {{placement}}\" ng-class=\"{ in: isOpen(), fade: animation() }\">\n" +
        "  <div class=\"arrow\"></div>\n" +
        "\n" +
        "  <div class=\"popover-inner\">\n" +
        "      <h3 class=\"popover-title\" ng-bind=\"title\" ng-show=\"title\"></h3>\n" +
        "      <div class=\"popover-content\" ng-bind=\"content\"></div>\n" +
        "  </div>\n" +
        "</div>\n" +
        "");
}]);

angular.module("template/progressbar/bar.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/progressbar/bar.html",
        "<div class=\"progress-bar\" ng-class=\"type && 'progress-bar-' + type\" ng-transclude></div>");
}]);

angular.module("template/progressbar/progress.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/progressbar/progress.html",
        "<div class=\"progress\" ng-transclude></div>");
}]);

angular.module("template/progressbar/progressbar.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/progressbar/progressbar.html",
        "<div class=\"progress\"><div class=\"progress-bar\" ng-class=\"type && 'progress-bar-' + type\" ng-transclude></div></div>");
}]);

angular.module("template/rating/rating.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/rating/rating.html",
        "<span ng-mouseleave=\"reset()\">\n" +
        "    <i ng-repeat=\"r in range\" ng-mouseenter=\"enter($index + 1)\" ng-click=\"rate($index + 1)\" class=\"glyphicon\" ng-class=\"$index < val && (r.stateOn || 'glyphicon-star') || (r.stateOff || 'glyphicon-star-empty')\"></i>\n" +
        "</span>");
}]);

angular.module("template/tabs/tab.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/tabs/tab.html",
        "<li ng-class=\"{active: active, disabled: disabled}\">\n" +
        "  <a ng-click=\"select()\" tab-heading-transclude>{{heading}}</a>\n" +
        "</li>\n" +
        "");
}]);

angular.module("template/tabs/tabset-titles.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/tabs/tabset-titles.html",
        "<ul class=\"nav {{type && 'nav-' + type}}\" ng-class=\"{'nav-stacked': vertical}\">\n" +
        "</ul>\n" +
        "");
}]);

angular.module("template/tabs/tabset.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/tabs/tabset.html",
        "\n" +
        "<div class=\"tabbable\">\n" +
        "  <ul class=\"nav {{type && 'nav-' + type}}\" ng-class=\"{'nav-stacked': vertical, 'nav-justified': justified}\" ng-transclude></ul>\n" +
        "  <div class=\"tab-content\">\n" +
        "    <div class=\"tab-pane\" \n" +
        "         ng-repeat=\"tab in tabs\" \n" +
        "         ng-class=\"{active: tab.active}\"\n" +
        "         tab-content-transclude=\"tab\">\n" +
        "    </div>\n" +
        "  </div>\n" +
        "</div>\n" +
        "");
}]);

angular.module("template/timepicker/timepicker.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/timepicker/timepicker.html",
        "<table>\n" +
        "	<tbody>\n" +
        "		<tr class=\"text-center\">\n" +
        "			<td><a ng-click=\"incrementHours()\" class=\"btn btn-link\"><span class=\"glyphicon glyphicon-chevron-up\"></span></a></td>\n" +
        "			<td>&nbsp;</td>\n" +
        "			<td><a ng-click=\"incrementMinutes()\" class=\"btn btn-link\"><span class=\"glyphicon glyphicon-chevron-up\"></span></a></td>\n" +
        "			<td ng-show=\"showMeridian\"></td>\n" +
        "		</tr>\n" +
        "		<tr>\n" +
        "			<td style=\"width:50px;\" class=\"form-group\" ng-class=\"{'has-error': invalidHours}\">\n" +
        "				<input type=\"text\" ng-model=\"hours\" ng-change=\"updateHours()\" class=\"form-control text-center\" ng-mousewheel=\"incrementHours()\" ng-readonly=\"readonlyInput\" maxlength=\"2\">\n" +
        "			</td>\n" +
        "			<td>:</td>\n" +
        "			<td style=\"width:50px;\" class=\"form-group\" ng-class=\"{'has-error': invalidMinutes}\">\n" +
        "				<input type=\"text\" ng-model=\"minutes\" ng-change=\"updateMinutes()\" class=\"form-control text-center\" ng-readonly=\"readonlyInput\" maxlength=\"2\">\n" +
        "			</td>\n" +
        "			<td ng-show=\"showMeridian\"><button type=\"button\" class=\"btn btn-default text-center\" ng-click=\"toggleMeridian()\">{{meridian}}</button></td>\n" +
        "		</tr>\n" +
        "		<tr class=\"text-center\">\n" +
        "			<td><a ng-click=\"decrementHours()\" class=\"btn btn-link\"><span class=\"glyphicon glyphicon-chevron-down\"></span></a></td>\n" +
        "			<td>&nbsp;</td>\n" +
        "			<td><a ng-click=\"decrementMinutes()\" class=\"btn btn-link\"><span class=\"glyphicon glyphicon-chevron-down\"></span></a></td>\n" +
        "			<td ng-show=\"showMeridian\"></td>\n" +
        "		</tr>\n" +
        "	</tbody>\n" +
        "</table>\n" +
        "");
}]);

angular.module("template/typeahead/typeahead-match.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/typeahead/typeahead-match.html",
        "<a tabindex=\"-1\" bind-html-unsafe=\"match.label | typeaheadHighlight:query\"></a>");
}]);

angular.module("template/typeahead/typeahead-popup.html", []).run(["$templateCache", function ($templateCache) {
    $templateCache.put("template/typeahead/typeahead-popup.html",
        "<ul class=\"dropdown-menu\" ng-style=\"{display: isOpen()&&'block' || 'none', top: position.top+'px', left: position.left+'px'}\">\n" +
        "    <li ng-repeat=\"match in matches\" ng-class=\"{active: isActive($index) }\" ng-mouseenter=\"selectActive($index)\" ng-mousedown=\"selectMatch($index)\">\n" +
        "        <div typeahead-match index=\"$index\" match=\"match\" query=\"query\" template-url=\"templateUrl\"></div>\n" +
        "    </li>\n" +
        "</ul>");
}]);
;
/**
 * Copyright (c)2005-2009 Matt Kruse (javascripttoolbox.com)
 * 
 * Dual licensed under the MIT and GPL licenses. 
 * This basically means you can use this code however you want for
 * free, but don't claim to have written it yourself!
 * Donations always accepted: http://www.JavascriptToolbox.com/donate/
 * 
 * Please do not link to the .js files on javascripttoolbox.com from
 * your site. Copy the files locally to your server instead.
 * 
 */
/*
Date functions

These functions are used to parse, format, and manipulate Date objects.
See documentation and examples at http://www.JavascriptToolbox.com/lib/date/

*/
Date.$VERSION = 1.02;

// Utility function to append a 0 to single-digit numbers
Date.LZ = function(x) {return(x<0||x>9?"":"0")+x};
// Full month names. Change this for local month names
Date.monthNames = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
// Month abbreviations. Change this for local month names
Date.monthAbbreviations = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
// Full day names. Change this for local month names
Date.dayNames = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
// Day abbreviations. Change this for local month names
Date.dayAbbreviations = new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
// Used for parsing ambiguous dates like 1/2/2000 - default to preferring 'American' format meaning Jan 2.
// Set to false to prefer 'European' format meaning Feb 1
Date.preferAmericanFormat = true;

// If the getFullYear() method is not defined, create it
if (!Date.prototype.getFullYear) { 
	Date.prototype.getFullYear = function() { var yy=this.getYear(); return (yy<1900?yy+1900:yy); } ;
} 

// Parse a string and convert it to a Date object.
// If no format is passed, try a list of common formats.
// If string cannot be parsed, return null.
// Avoids regular expressions to be more portable.
Date.parseString = function(val, format) {
	// If no format is specified, try a few common formats
	if (typeof(format)=="undefined" || format==null || format=="") {
		var generalFormats=new Array('y-M-d','MMM d, y','MMM d,y','y-MMM-d','d-MMM-y','MMM d','MMM-d','d-MMM');
		var monthFirst=new Array('M/d/y','M-d-y','M.d.y','M/d','M-d');
		var dateFirst =new Array('d/M/y','d-M-y','d.M.y','d/M','d-M');
		var checkList=new Array(generalFormats,Date.preferAmericanFormat?monthFirst:dateFirst,Date.preferAmericanFormat?dateFirst:monthFirst);
		for (var i=0; i<checkList.length; i++) {
			var l=checkList[i];
			for (var j=0; j<l.length; j++) {
				var d=Date.parseString(val,l[j]);
				if (d!=null) { 
					return d; 
				}
			}
		}
		return null;
	};

	this.isInteger = function(val) {
		for (var i=0; i < val.length; i++) {
			if ("1234567890".indexOf(val.charAt(i))==-1) { 
				return false; 
			}
		}
		return true;
	};
	this.getInt = function(str,i,minlength,maxlength) {
		for (var x=maxlength; x>=minlength; x--) {
			var token=str.substring(i,i+x);
			if (token.length < minlength) { 
				return null; 
			}
			if (this.isInteger(token)) { 
				return token; 
			}
		}
	return null;
	};
	val=val+"";
	format=format+"";
	var i_val=0;
	var i_format=0;
	var c="";
	var token="";
	var token2="";
	var x,y;
	var year=new Date().getFullYear();
	var month=1;
	var date=1;
	var hh=0;
	var mm=0;
	var ss=0;
	var ampm="";
	while (i_format < format.length) {
		// Get next token from format string
		c=format.charAt(i_format);
		token="";
		while ((format.charAt(i_format)==c) && (i_format < format.length)) {
			token += format.charAt(i_format++);
		}
		// Extract contents of value based on format token
		if (token=="yyyy" || token=="yy" || token=="y") {
			if (token=="yyyy") { 
				x=4;y=4; 
			}
			if (token=="yy") { 
				x=2;y=2; 
			}
			if (token=="y") { 
				x=2;y=4; 
			}
			year=this.getInt(val,i_val,x,y);
			if (year==null) { 
				return null; 
			}
			i_val += year.length;
			if (year.length==2) {
				if (year > 70) { 
					year=1900+(year-0); 
				}
				else { 
					year=2000+(year-0); 
				}
			}
		}
		else if (token=="MMM" || token=="NNN"){
			month=0;
			var names = (token=="MMM"?(Date.monthNames.concat(Date.monthAbbreviations)):Date.monthAbbreviations);
			for (var i=0; i<names.length; i++) {
				var month_name=names[i];
				if (val.substring(i_val,i_val+month_name.length).toLowerCase()==month_name.toLowerCase()) {
					month=(i%12)+1;
					i_val += month_name.length;
					break;
				}
			}
			if ((month < 1)||(month>12)){
				return null;
			}
		}
		else if (token=="EE"||token=="E"){
			var names = (token=="EE"?Date.dayNames:Date.dayAbbreviations);
			for (var i=0; i<names.length; i++) {
				var day_name=names[i];
				if (val.substring(i_val,i_val+day_name.length).toLowerCase()==day_name.toLowerCase()) {
					i_val += day_name.length;
					break;
				}
			}
		}
		else if (token=="MM"||token=="M") {
			month=this.getInt(val,i_val,token.length,2);
			if(month==null||(month<1)||(month>12)){
				return null;
			}
			i_val+=month.length;
		}
		else if (token=="dd"||token=="d") {
			date=this.getInt(val,i_val,token.length,2);
			if(date==null||(date<1)||(date>31)){
				return null;
			}
			i_val+=date.length;
		}
		else if (token=="hh"||token=="h") {
			hh=this.getInt(val,i_val,token.length,2);
			if(hh==null||(hh<1)||(hh>12)){
				return null;
			}
			i_val+=hh.length;
		}
		else if (token=="HH"||token=="H") {
			hh=this.getInt(val,i_val,token.length,2);
			if(hh==null||(hh<0)||(hh>23)){
				return null;
			}
			i_val+=hh.length;
		}
		else if (token=="KK"||token=="K") {
			hh=this.getInt(val,i_val,token.length,2);
			if(hh==null||(hh<0)||(hh>11)){
				return null;
			}
			i_val+=hh.length;
			hh++;
		}
		else if (token=="kk"||token=="k") {
			hh=this.getInt(val,i_val,token.length,2);
			if(hh==null||(hh<1)||(hh>24)){
				return null;
			}
			i_val+=hh.length;
			hh--;
		}
		else if (token=="mm"||token=="m") {
			mm=this.getInt(val,i_val,token.length,2);
			if(mm==null||(mm<0)||(mm>59)){
				return null;
			}
			i_val+=mm.length;
		}
		else if (token=="ss"||token=="s") {
			ss=this.getInt(val,i_val,token.length,2);
			if(ss==null||(ss<0)||(ss>59)){
				return null;
			}
			i_val+=ss.length;
		}
		else if (token=="a") {
			if (val.substring(i_val,i_val+2).toLowerCase()=="am") {
				ampm="AM";
			}
			else if (val.substring(i_val,i_val+2).toLowerCase()=="pm") {
				ampm="PM";
			}
			else {
				return null;
			}
			i_val+=2;
		}
		else {
			if (val.substring(i_val,i_val+token.length)!=token) {
				return null;
			}
			else {
				i_val+=token.length;
			}
		}
	}
	// If there are any trailing characters left in the value, it doesn't match
	if (i_val != val.length) { 
		return null; 
	}
	// Is date valid for month?
	if (month==2) {
		// Check for leap year
		if ( ( (year%4==0)&&(year%100 != 0) ) || (year%400==0) ) { // leap year
			if (date > 29){ 
				return null; 
			}
		}
		else { 
			if (date > 28) { 
				return null; 
			} 
		}
	}
	if ((month==4)||(month==6)||(month==9)||(month==11)) {
		if (date > 30) { 
			return null; 
		}
	}
	// Correct hours value
	if (hh<12 && ampm=="PM") {
		hh=hh-0+12; 
	}
	else if (hh>11 && ampm=="AM") { 
		hh-=12; 
	}
	return new Date(year,month-1,date,hh,mm,ss);
};

// Check if a date string is valid
Date.isValid = function(val,format) {
	return (Date.parseString(val,format) != null);
};

// Check if a date object is before another date object
Date.prototype.isBefore = function(date2) {
	if (date2==null) { 
		return false; 
	}
	return (this.getTime()<date2.getTime());
};

// Check if a date object is after another date object
Date.prototype.isAfter = function(date2) {
	if (date2==null) { 
		return false; 
	}
	return (this.getTime()>date2.getTime());
};

// Check if two date objects have equal dates and times
Date.prototype.equals = function(date2) {
	if (date2==null) { 
		return false; 
	}
	return (this.getTime()==date2.getTime());
};

// Check if two date objects have equal dates, disregarding times
Date.prototype.equalsIgnoreTime = function(date2) {
	if (date2==null) { 
		return false; 
	}
	var d1 = new Date(this.getTime()).clearTime();
	var d2 = new Date(date2.getTime()).clearTime();
	return (d1.getTime()==d2.getTime());
};

// Format a date into a string using a given format string
Date.prototype.format = function(format) {
	format=format+"";
	var result="";
	var i_format=0;
	var c="";
	var token="";
	var y=this.getYear()+"";
	var M=this.getMonth()+1;
	var d=this.getDate();
	var E=this.getDay();
	var H=this.getHours();
	var m=this.getMinutes();
	var s=this.getSeconds();
	var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;
	// Convert real date parts into formatted versions
	var value=new Object();
	if (y.length < 4) {
		y=""+(+y+1900);
	}
	value["y"]=""+y;
	value["yyyy"]=y;
	value["yy"]=y.substring(2,4);
	value["M"]=M;
	value["MM"]=Date.LZ(M);
	value["MMM"]=Date.monthNames[M-1];
	value["NNN"]=Date.monthAbbreviations[M-1];
	value["d"]=d;
	value["dd"]=Date.LZ(d);
	value["E"]=Date.dayAbbreviations[E];
	value["EE"]=Date.dayNames[E];
	value["H"]=H;
	value["HH"]=Date.LZ(H);
	if (H==0){
		value["h"]=12;
	}
	else if (H>12){
		value["h"]=H-12;
	}
	else {
		value["h"]=H;
	}
	value["hh"]=Date.LZ(value["h"]);
	value["K"]=value["h"]-1;
	value["k"]=value["H"]+1;
	value["KK"]=Date.LZ(value["K"]);
	value["kk"]=Date.LZ(value["k"]);
	if (H > 11) { 
		value["a"]="PM"; 
	}
	else { 
		value["a"]="AM"; 
	}
	value["m"]=m;
	value["mm"]=Date.LZ(m);
	value["s"]=s;
	value["ss"]=Date.LZ(s);
	while (i_format < format.length) {
		c=format.charAt(i_format);
		token="";
		while ((format.charAt(i_format)==c) && (i_format < format.length)) {
			token += format.charAt(i_format++);
		}
		if (typeof(value[token])!="undefined") { 
			result=result + value[token]; 
		}
		else { 
			result=result + token; 
		}
	}
	return result;
};

// Get the full name of the day for a date
Date.prototype.getDayName = function() { 
	return Date.dayNames[this.getDay()];
};

// Get the abbreviation of the day for a date
Date.prototype.getDayAbbreviation = function() { 
	return Date.dayAbbreviations[this.getDay()];
};

// Get the full name of the month for a date
Date.prototype.getMonthName = function() {
	return Date.monthNames[this.getMonth()];
};

// Get the abbreviation of the month for a date
Date.prototype.getMonthAbbreviation = function() { 
	return Date.monthAbbreviations[this.getMonth()];
};

// Clear all time information in a date object
Date.prototype.clearTime = function() {
  this.setHours(0); 
  this.setMinutes(0);
  this.setSeconds(0); 
  this.setMilliseconds(0);
  return this;
};

// Add an amount of time to a date. Negative numbers can be passed to subtract time.
Date.prototype.add = function(interval, number) {
	if (typeof(interval)=="undefined" || interval==null || typeof(number)=="undefined" || number==null) { 
		return this; 
	}
	number = +number;
	if (interval=='y') { // year
		this.setFullYear(this.getFullYear()+number);
	}
	else if (interval=='M') { // Month
		this.setMonth(this.getMonth()+number);
	}
	else if (interval=='d') { // Day
		this.setDate(this.getDate()+number);
	}
	else if (interval=='w') { // Weekday
		var step = (number>0)?1:-1;
		while (number!=0) {
			this.add('d',step);
			while(this.getDay()==0 || this.getDay()==6) { 
				this.add('d',step);
			}
			number -= step;
		}
	}
	else if (interval=='h') { // Hour
		this.setHours(this.getHours() + number);
	}
	else if (interval=='m') { // Minute
		this.setMinutes(this.getMinutes() + number);
	}
	else if (interval=='s') { // Second
		this.setSeconds(this.getSeconds() + number);
	}
	return this;
};
;
/*** Directives and services for responding to idle users in AngularJS
* @author Mike Grabski <me@mikegrabski.com>
* @version v1.2.2
* @link https://github.com/HackedByChinese/ng-idle.git
* @license MIT
*/

!function(a,b,c){"use strict";b.module("ngIdle",["ngIdle.keepalive","ngIdle.idle","ngIdle.countdown","ngIdle.title","ngIdle.localStorage"]),b.module("ngIdle.keepalive",[]).provider("Keepalive",function(){var a={http:null,interval:600};this.http=function(c){if(!c)throw new Error("Argument must be a string containing a URL, or an object containing the HTTP request configuration.");b.isString(c)&&(c={url:c,method:"GET"}),c.cache=!1,a.http=c};var c=this.interval=function(b){if(b=parseInt(b),isNaN(b)||0>=b)throw new Error("Interval must be expressed in seconds and be greater than 0.");a.interval=b};this.$get=["$rootScope","$log","$interval","$http",function(d,e,f,g){function h(a,b){d.$broadcast("KeepaliveResponse",a,b)}function i(){d.$broadcast("Keepalive"),b.isObject(a.http)&&g(a.http).success(h).error(h)}var j={ping:null};return{_options:function(){return a},setInterval:c,start:function(){return f.cancel(j.ping),j.ping=f(i,1e3*a.interval),j.ping},stop:function(){f.cancel(j.ping)},ping:function(){i()}}}]}),b.module("ngIdle.idle",["ngIdle.keepalive","ngIdle.localStorage"]).provider("Idle",function(){var a={idle:1200,timeout:30,autoResume:"idle",interrupt:"mousemove keydown DOMMouseScroll mousewheel mousedown touchstart touchmove scroll",windowInterrupt:null,keepalive:!0},c=this.timeout=function(c){if(c===!1)a.timeout=0;else{if(!(b.isNumber(c)&&c>=0))throw new Error("Timeout must be zero or false to disable the feature, or a positive integer (in seconds) to enable it.");a.timeout=c}};this.interrupt=function(b){a.interrupt=b},this.windowInterrupt=function(b){a.windowInterrupt=b};var d=this.idle=function(b){if(0>=b)throw new Error("Idle must be a value in seconds, greater than 0.");a.idle=b};this.autoResume=function(b){b===!0?a.autoResume="idle":b===!1?a.autoResume="off":a.autoResume=b},this.keepalive=function(b){a.keepalive=b===!0},this.$get=["$interval","$log","$rootScope","$document","Keepalive","IdleLocalStorage","$window",function(e,f,g,h,i,j,k){function l(){a.keepalive&&(t.running&&i.ping(),i.start())}function m(){a.keepalive&&i.stop()}function n(){t.idling=!t.idling;var b=t.idling?"IdleStart":"IdleEnd";t.idling?(g.$broadcast(b),m(),a.timeout&&(t.countdown=a.timeout,o(),t.timeout=e(o,1e3,a.timeout,!1))):(l(),g.$broadcast(b)),e.cancel(t.idle)}function o(){if(t.idling){if(t.countdown<=0)return void p();g.$broadcast("IdleWarn",t.countdown),t.countdown--}}function p(){m(),e.cancel(t.idle),e.cancel(t.timeout),t.idling=!0,t.running=!1,t.countdown=0,g.$broadcast("IdleTimeout")}function q(a,b,c){var d=a.running();a.unwatch(),b(c),d&&a.watch()}function r(){var a=j.get("expiry");return a&&a.time?new Date(a.time):null}function s(a){a?j.set("expiry",{id:u,time:a}):j.remove("expiry")}var t={idle:null,timeout:null,idling:!1,running:!1,countdown:null},u=(new Date).getTime(),v={_options:function(){return a},_getNow:function(){return new Date},getIdle:function(){return a.idle},getTimeout:function(){return a.timeout},setIdle:function(a){q(this,d,a)},setTimeout:function(a){q(this,c,a)},isExpired:function(){var a=r();return null!==a&&a<=this._getNow()},running:function(){return t.running},idling:function(){return t.idling},watch:function(b){e.cancel(t.idle),e.cancel(t.timeout);var c=a.timeout?a.timeout:0;b||s(new Date((new Date).getTime()+1e3*(a.idle+c))),t.idling?n():t.running||l(),t.running=!0,t.idle=e(n,1e3*a.idle,0,!1)},unwatch:function(){e.cancel(t.idle),e.cancel(t.timeout),t.idling=!1,t.running=!1,s(null),m()},interrupt:function(b){return t.running?a.timeout&&this.isExpired()?void p():void((b||"idle"===a.autoResume||"notIdle"===a.autoResume&&!t.idling)&&this.watch(b)):void 0}},w={clientX:null,clientY:null,swap:function(a){var b={clientX:this.clientX,clientY:this.clientY};return this.clientX=a.clientX,this.clientY=a.clientY,b},hasMoved:function(a){var b=this.swap(a);return null===this.clientX||a.movementX||a.movementY?!0:b.clientX!=a.clientX||b.clientY!=a.clientY?!0:!1}};if(h.find("html").on(a.interrupt,function(a){"mousemove"===a.type&&a.originalEvent&&0===a.originalEvent.movementX&&0===a.originalEvent.movementY||("mousemove"!==a.type||w.hasMoved(a))&&v.interrupt()}),a.windowInterrupt)for(var x=a.windowInterrupt.split(" "),y=function(){v.interrupt()},z=0;z<x.length;z++)k.addEventListener?k.addEventListener(x[z],y,!1):k.attachEvent(x[z],y);var A=function(a){if("ngIdle.expiry"===a.key&&a.newValue&&a.newValue!==a.oldValue){var c=b.fromJson(a.newValue);if(c.id===u)return;v.interrupt(!0)}};return k.addEventListener?k.addEventListener("storage",A,!1):k.attachEvent("onstorage",A),v}]}),b.module("ngIdle.countdown",["ngIdle.idle"]).directive("idleCountdown",["Idle",function(a){return{restrict:"A",scope:{value:"=idleCountdown"},link:function(b){b.value=a.getTimeout(),b.$on("IdleWarn",function(a,c){b.$evalAsync(function(){b.value=c})}),b.$on("IdleTimeout",function(){b.$evalAsync(function(){b.value=0})})}}}]),b.module("ngIdle.title",[]).provider("Title",function(){function a(a,b,c){return new Array(b-String(a).length+1).join(c||"0")+a}var c={enabled:!0},d=this.enabled=function(a){c.enabled=a===!0};this.$get=["$document","$interpolate",function(e,f){var g={original:null,idle:"{{minutes}}:{{seconds}} until your session times out!",timedout:"Your session has expired."};return{setEnabled:d,isEnabled:function(){return c.enabled},original:function(a){return b.isUndefined(a)?g.original:void(g.original=a)},store:function(a){(a||!g.original)&&(g.original=this.value())},value:function(a){return b.isUndefined(a)?e[0].title:void(e[0].title=a)},idleMessage:function(a){return b.isUndefined(a)?g.idle:void(g.idle=a)},timedOutMessage:function(a){return b.isUndefined(a)?g.timedout:void(g.timedout=a)},setAsIdle:function(b){this.store();var c={totalSeconds:b};c.minutes=Math.floor(b/60),c.seconds=a(b-60*c.minutes,2),this.value(f(this.idleMessage())(c))},setAsTimedOut:function(){this.store(),this.value(this.timedOutMessage())},restore:function(){this.original()&&this.value(this.original())}}}]}).directive("title",["Title",function(a){return{restrict:"E",link:function(b,c,d){a.isEnabled()&&!d.idleDisabled&&(a.store(!0),b.$on("IdleStart",function(){a.original(c[0].innerText)}),b.$on("IdleWarn",function(b,c){a.setAsIdle(c)}),b.$on("IdleEnd",function(){a.restore()}),b.$on("IdleTimeout",function(){a.setAsTimedOut()}))}}}]),b.module("ngIdle.localStorage",[]).service("IdleStorageAccessor",["$window",function(a){return{get:function(){return a.localStorage}}}]).service("IdleLocalStorage",["IdleStorageAccessor",function(a){function d(){var a={};this.setItem=function(b,c){a[b]=c},this.getItem=function(b){return"undefined"!=typeof a[b]?a[b]:null},this.removeItem=function(b){a[b]=c}}function e(){try{var b=a.get();return b.setItem("ngIdleStorage",""),b.removeItem("ngIdleStorage"),b}catch(c){return new d}}var f=e();return{set:function(a,c){f.setItem("ngIdle."+a,b.toJson(c))},get:function(a){return b.fromJson(f.getItem("ngIdle."+a))},remove:function(a){f.removeItem("ngIdle."+a)},_wrapped:function(){return f}}}])}(window,window.angular);
//# sourceMappingURL=angular-idle.map;
(function(){for(var aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},k="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this,m=["String","prototype","repeat"],n=0;n<m.length-1;n++){var p=m[n];p in k||(k[p]={});k=k[p]}
var ba=m[m.length-1],r=k[ba],t=r?r:function(a){var b;if(null==this)throw new TypeError("The 'this' value for String.prototype.repeat must not be null or undefined");b=this+"";if(0>a||1342177279<a)throw new RangeError("Invalid count value");a|=0;for(var c="";a;)if(a&1&&(c+=b),a>>>=1)b+=b;return c};t!=r&&null!=t&&aa(k,ba,{configurable:!0,writable:!0,value:t});var ca=this;function u(a){return"string"==typeof a}
function v(a,b){var c=a.split("."),d=ca;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b}function w(a,b){function c(){}c.prototype=b.prototype;a.$=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.w=function(a,c,f){for(var d=Array(arguments.length-2),e=2;e<arguments.length;e++)d[e-2]=arguments[e];return b.prototype[c].apply(a,d)}};var x=Array.prototype.indexOf?function(a,b,c){return Array.prototype.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(u(a))return u(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1};function da(a,b){a.sort(b||ea)}function ea(a,b){return a>b?1:a<b?-1:0};function fa(a,b){this.a=a;this.h=!!b.i;this.c=b.b;this.m=b.type;this.l=!1;switch(this.c){case ga:case ha:case ia:case ja:case ka:case la:case ma:this.l=!0}this.g=b.defaultValue}var ma=1,la=2,ga=3,ha=4,ia=6,ja=16,ka=18;function na(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b};function oa(a,b){this.c=a;this.a={};for(var c=0;c<b.length;c++){var d=b[c];this.a[d.a]=d}}function pa(a){a=na(a.a);da(a,function(a,c){return a.a-c.a});return a};function y(){this.a={};this.g=this.f().a;this.c=this.h=null}y.prototype.has=function(a){return null!=this.a[a.a]};y.prototype.get=function(a,b){return A(this,a.a,b)};y.prototype.set=function(a,b){B(this,a.a,b)};
function qa(a,b){for(var c=pa(a.f()),d=0;d<c.length;d++){var e=c[d],f=e.a;if(null!=b.a[f]){a.c&&delete a.c[e.a];var g=11==e.c||10==e.c;if(e.h)for(var e=C(b,f)||[],h=0;h<e.length;h++){var l=a,q=f,z=g?e[h].clone():e[h];l.a[q]||(l.a[q]=[]);l.a[q].push(z);l.c&&delete l.c[q]}else e=C(b,f),g?(g=C(a,f))?qa(g,e):B(a,f,e.clone()):B(a,f,e)}}}y.prototype.clone=function(){var a=new this.constructor;a!=this&&(a.a={},a.c&&(a.c={}),qa(a,this));return a};
function C(a,b){var c=a.a[b];if(null==c)return null;if(a.h){if(!(b in a.c)){var d=a.h,e=a.g[b];if(null!=c)if(e.h){for(var f=[],g=0;g<c.length;g++)f[g]=d.a(e,c[g]);c=f}else c=d.a(e,c);return a.c[b]=c}return a.c[b]}return c}function A(a,b,c){var d=C(a,b);return a.g[b].h?d[c||0]:d}function D(a,b){var c;if(null!=a.a[b])c=A(a,b,void 0);else a:{c=a.g[b];if(void 0===c.g){var d=c.m;if(d===Boolean)c.g=!1;else if(d===Number)c.g=0;else if(d===String)c.g=c.l?"0":"";else{c=new d;break a}}c=c.g}return c}
function ra(a,b){return a.g[b].h?null!=a.a[b]?a.a[b].length:0:null!=a.a[b]?1:0}function B(a,b,c){a.a[b]=c;a.c&&(a.c[b]=c)}function E(a,b){var c=[],d;for(d in b)0!=d&&c.push(new fa(d,b[d]));return new oa(a,c)};function F(){}F.prototype.c=function(a){new a.c;throw Error("Unimplemented");};F.prototype.a=function(a,b){if(11==a.c||10==a.c)return b instanceof y?b:this.c(a.m.prototype.f(),b);if(14==a.c){if(u(b)&&sa.test(b)){var c=Number(b);if(0<c)return c}return b}if(!a.l)return b;c=a.m;if(c===String){if("number"==typeof b)return String(b)}else if(c===Number&&u(b)&&("Infinity"===b||"-Infinity"===b||"NaN"===b||sa.test(b)))return Number(b);return b};var sa=/^-?[0-9]+$/;function G(){}w(G,F);G.prototype.c=function(a,b){var c=new a.c;c.h=this;c.a=b;c.c={};return c};function H(){}w(H,G);H.prototype.a=function(a,b){return 8==a.c?!!b:F.prototype.a.apply(this,arguments)};function I(a,b){null!=a&&this.a.apply(this,arguments)}I.prototype.c="";I.prototype.set=function(a){this.c=""+a};I.prototype.a=function(a,b,c){this.c+=String(a);if(null!=b)for(var d=1;d<arguments.length;d++)this.c+=arguments[d];return this};I.prototype.toString=function(){return this.c};/*

 Protocol Buffer 2 Copyright 2008 Google Inc.
 All other code copyright its respective owners.
 Copyright (C) 2010 The Libphonenumber Authors

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
*/
function J(){y.call(this)}w(J,y);var ta=null;function K(){y.call(this)}w(K,y);var ua=null;function L(){y.call(this)}w(L,y);var wa=null;
J.prototype.f=function(){var a=ta;a||(ta=a=E(J,{0:{name:"NumberFormat",j:"i18n.phonenumbers.NumberFormat"},1:{name:"pattern",required:!0,b:9,type:String},2:{name:"format",required:!0,b:9,type:String},3:{name:"leading_digits_pattern",i:!0,b:9,type:String},4:{name:"national_prefix_formatting_rule",b:9,type:String},6:{name:"national_prefix_optional_when_formatting",b:8,type:Boolean},5:{name:"domestic_carrier_code_formatting_rule",b:9,type:String}}));return a};J.f=J.prototype.f;
K.prototype.f=function(){var a=ua;a||(ua=a=E(K,{0:{name:"PhoneNumberDesc",j:"i18n.phonenumbers.PhoneNumberDesc"},2:{name:"national_number_pattern",b:9,type:String},3:{name:"possible_number_pattern",b:9,type:String},9:{name:"possible_length",i:!0,b:5,type:Number},10:{name:"possible_length_local_only",i:!0,b:5,type:Number},6:{name:"example_number",b:9,type:String},7:{name:"national_number_matcher_data",b:12,type:String},8:{name:"possible_number_matcher_data",b:12,type:String}}));return a};K.f=K.prototype.f;
L.prototype.f=function(){var a=wa;a||(wa=a=E(L,{0:{name:"PhoneMetadata",j:"i18n.phonenumbers.PhoneMetadata"},1:{name:"general_desc",b:11,type:K},2:{name:"fixed_line",b:11,type:K},3:{name:"mobile",b:11,type:K},4:{name:"toll_free",b:11,type:K},5:{name:"premium_rate",b:11,type:K},6:{name:"shared_cost",b:11,type:K},7:{name:"personal_number",b:11,type:K},8:{name:"voip",b:11,type:K},21:{name:"pager",b:11,type:K},25:{name:"uan",b:11,type:K},27:{name:"emergency",b:11,type:K},28:{name:"voicemail",b:11,type:K},
24:{name:"no_international_dialling",b:11,type:K},9:{name:"id",required:!0,b:9,type:String},10:{name:"country_code",b:5,type:Number},11:{name:"international_prefix",b:9,type:String},17:{name:"preferred_international_prefix",b:9,type:String},12:{name:"national_prefix",b:9,type:String},13:{name:"preferred_extn_prefix",b:9,type:String},15:{name:"national_prefix_for_parsing",b:9,type:String},16:{name:"national_prefix_transform_rule",b:9,type:String},18:{name:"same_mobile_and_fixed_line_pattern",b:8,defaultValue:!1,
type:Boolean},19:{name:"number_format",i:!0,b:11,type:J},20:{name:"intl_number_format",i:!0,b:11,type:J},22:{name:"main_country_for_code",b:8,defaultValue:!1,type:Boolean},23:{name:"leading_digits",b:9,type:String},26:{name:"leading_zero_possible",b:8,defaultValue:!1,type:Boolean}}));return a};L.f=L.prototype.f;function M(){y.call(this)}var N;w(M,y);var xa={v:1,u:5,s:10,o:20};
M.prototype.f=function(){N||(N=E(M,{0:{name:"PhoneNumber",j:"i18n.phonenumbers.PhoneNumber"},1:{name:"country_code",required:!0,b:5,type:Number},2:{name:"national_number",required:!0,b:4,type:Number},3:{name:"extension",b:9,type:String},4:{name:"italian_leading_zero",b:8,type:Boolean},8:{name:"number_of_leading_zeros",b:5,defaultValue:1,type:Number},5:{name:"raw_input",b:9,type:String},6:{name:"country_code_source",b:14,defaultValue:1,type:xa},7:{name:"preferred_domestic_carrier_code",b:9,type:String}}));
return N};M.ctor=M;M.ctor.f=M.prototype.f;/*

 Copyright (C) 2010 The Libphonenumber Authors

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
*/
var O={1:"US AG AI AS BB BM BS CA DM DO GD GU JM KN KY LC MP MS PR SX TC TT VC VG VI".split(" "),7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],
86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],
253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],385:["HR"],386:["SI"],
387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],
692:["MH"],800:["001"],808:["001"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],870:["001"],878:["001"],880:["BD"],881:["001"],882:["001"],883:["001"],886:["TW"],888:["001"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],979:["001"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},ya={AC:[,[,,"[46]\\d{4}|[01589]\\d{5}","\\d{5,6}",,
,,,,[5,6]],[,,"6[2-467]\\d{3}","\\d{5}",,,"62889",,,[5]],[,,"4\\d{4}","\\d{5}",,,"40123",,,[5]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"AC",247,"00",,,,,,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"[01589]\\d{5}","\\d{6}",,,"542011",,,[6]],,,[,,"NA","NA",,,,,,[-1]]],AD:[,[,,"(?:[346-9]|180)\\d{5}","\\d{6,8}",,,,,,[6,8]],[,,"[78]\\d{5}","\\d{6}",,,"712345",,,[6]],[,,"[346]\\d{5}","\\d{6}",,,"312345",,,[6]],
[,,"180[02]\\d{4}","\\d{8}",,,"18001234",,,[8]],[,,"9\\d{5}","\\d{6}",,,"912345",,,[6]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"AD",376,"00",,,,,,,,[[,"(\\d{3})(\\d{3})","$1 $2",["[346-9]"]],[,"(180[02])(\\d{4})","$1 $2",["1"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AE:[,[,,"[2-79]\\d{7,8}|800\\d{2,9}","\\d{5,12}",,,,,,[5,6,7,8,9,10,11,12]],[,,"[2-4679][2-8]\\d{6}","\\d{7,8}",,,"22345678",,,[8]],[,,"5[024-6]\\d{7}",
"\\d{9}",,,"501234567",,,[9]],[,,"400\\d{6}|800\\d{2,9}","\\d{5,12}",,,"800123456"],[,,"900[02]\\d{5}","\\d{9}",,,"900234567",,,[9]],[,,"700[05]\\d{5}","\\d{9}",,,"700012345",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"AE",971,"00","0",,,"0",,,,[[,"([2-4679])(\\d{3})(\\d{4})","$1 $2 $3",["[2-4679][2-8]"],"0$1"],[,"(5\\d)(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],[,"([479]00)(\\d)(\\d{5})","$1 $2 $3",["[479]0"],"$1"],[,"([68]00)(\\d{2,9})","$1 $2",["60|8"],"$1"]],,[,,"NA","NA",,,,,,[-1]],
,,[,,"NA","NA",,,,,,[-1]],[,,"600[25]\\d{5}","\\d{9}",,,"600212345",,,[9]],,,[,,"NA","NA",,,,,,[-1]]],AF:[,[,,"[2-7]\\d{8}","\\d{7,9}",,,,,,[9],[7]],[,,"(?:[25][0-8]|[34][0-4]|6[0-5])[2-9]\\d{6}","\\d{7,9}",,,"234567890"],[,,"7(?:[014-9]\\d{7}|2[89]\\d{6})","\\d{9}",,,"701234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"AF",93,"00","0",,,"0",,,,[[,"([2-7]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],,[,,"NA","NA",
,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AG:[,[,,"[2589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}","\\d{7}(?:\\d{3})?",,,"2684601234"],[,,"268(?:464|7(?:2\\d|3[246]|64|7[0-689]|8[02-68]))\\d{4}","\\d{7}(?:\\d{3})?",,,"2684641234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",
,,"5002345678"],[,,"26848[01]\\d{4}","\\d{7}(?:\\d{3})?",,,"2684801234"],"AG",1,"011","1",,,"1",,,,,,[,,"26840[69]\\d{4}","\\d{7}(?:\\d{3})?",,,"2684061234"],,"268",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AI:[,[,,"[2589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"2644(?:6[12]|9[78])\\d{4}","\\d{7}(?:\\d{3})?",,,"2644612345"],[,,"264(?:235|476|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}","\\d{7}(?:\\d{3})?",,,"2642351234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",
,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"AI",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"264",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AL:[,[,,"[2-57]\\d{7}|6\\d{8}|8\\d{5,7}|9\\d{5}","\\d{5,9}",,,,,,[6,7,8,9],[5]],[,,"(?:2(?:[168][1-9]|[247]\\d|9[1-7])|3(?:1[1-3]|[2-6]\\d|[79][1-8]|8[1-9])|4\\d{2}|5(?:1[1-4]|[2-578]\\d|6[1-5]|9[1-7])|8(?:[19][1-5]|[2-6]\\d|[78][1-7]))\\d{5}",
"\\d{5,8}",,,"22345678",,,[8]],[,,"6[6-9]\\d{7}","\\d{9}",,,"661234567",,,[9]],[,,"800\\d{4}","\\d{7}",,,"8001234",,,[7]],[,,"900\\d{3}","\\d{6}",,,"900123",,,[6]],[,,"808\\d{3}","\\d{6}",,,"808123",,,[6]],[,,"700\\d{5}","\\d{8}",,,"70012345",,,[8]],[,,"NA","NA",,,,,,[-1]],"AL",355,"00","0",,,"0",,,,[[,"(4)(\\d{3})(\\d{4})","$1 $2 $3",["4[0-6]"],"0$1"],[,"(6[6-9])(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4[7-9]"],"0$1"],[,"(\\d{3})(\\d{3,5})",
"$1 $2",["[235][16-9]|8[016-9]|[79]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AM:[,[,,"[1-9]\\d{7}","\\d{5,8}",,,,,,[8],[5,6]],[,,"(?:1[0-2]\\d|2(?:2[2-46]|3[1-8]|4[2-69]|5[2-7]|6[1-9]|8[1-7])|3[12]2|47\\d)\\d{5}","\\d{5,8}",,,"10123456"],[,,"(?:4[139]|55|77|9[1-9])\\d{6}","\\d{8}",,,"77123456"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"90[016]\\d{5}","\\d{8}",,,"90012345"],[,,"80[1-4]\\d{5}","\\d{8}",,,"80112345"],[,,"NA","NA",
,,,,,[-1]],[,,"60(?:2[078]|[3-7]\\d|8[0-5])\\d{4}","\\d{8}",,,"60271234"],"AM",374,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],[,"(\\d{2})(\\d{6})","$1 $2",["4[139]|[5-7]|9[1-9]"],"0$1"],[,"(\\d{3})(\\d{5})","$1 $2",["[23]"],"(0$1)"],[,"(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8|90"],"0 $1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AO:[,[,,"[29]\\d{8}","\\d{9}",,,,,,[9]],[,,"2\\d(?:[26-9]\\d|\\d[26-9])\\d{5}","\\d{9}",
,,"222123456"],[,,"9[1-49]\\d{7}","\\d{9}",,,"923123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"AO",244,"00",,,,,,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AR:[,[,,"11\\d{8}|[2368]\\d{9}|9\\d{10}","\\d{6,11}",,,,,,[10,11],[6,7,8]],[,,"11\\d{8}|(?:2(?:2(?:[013]\\d|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[067]\\d)|4(?:7[3-8]|9\\d)|6(?:[01346]\\d|2[24-6]|5[15-8])|80\\d|9(?:[0124789]\\d|3[1-6]|5[234]|6[2-46]))|3(?:3(?:2[79]|6\\d|8[2578])|4(?:[78]\\d|0[0124-9]|[1-35]\\d|4[24-7]|6[02-9]|9[123678])|5(?:[138]\\d|2[1245]|4[1-9]|6[2-4]|7[1-6])|6[24]\\d|7(?:[0469]\\d|1[1568]|2[013-9]|3[145]|5[14-8]|7[2-57]|8[0-24-9])|8(?:[013578]\\d|2[15-7]|4[13-6]|6[1-357-9]|9[124]))|670\\d)\\d{6}",
"\\d{6,10}",,,"1123456789",,,[10]],[,,"675\\d{7}|9(?:11[2-9]\\d{7}|(?:2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[12358]|5[138]|6[24]|7[069]|8[013578]))[2-9]\\d{6}|\\d{4}[2-9]\\d{5})","\\d{6,11}",,,"91123456789",,,[11]],[,,"800\\d{7}","\\d{10}",,,"8001234567",,,[10]],[,,"60[04579]\\d{7}","\\d{10}",,,"6001234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"AR",54,"00","0",,,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))?15)?",
"9$1",,,[[,"([68]\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],[,"(\\d{2})(\\d{4})","$1-$2",["[2-9]"],"$1"],[,"(\\d{3})(\\d{4})","$1-$2",["[2-9]"],"$1"],[,"(\\d{4})(\\d{4})","$1-$2",["[2-9]"],"$1"],[,"(9)(11)(\\d{4})(\\d{4})","$2 15-$3-$4",["911"],"0$1"],[,"(9)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9(?:2[234689]|3[3-8])","9(?:2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[1-358]|5[138]|6[24]|7[069]|8[013578]))","9(?:2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|3[456]|[58]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45])))",
"9(?:2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|3(?:4|5[014]|6[1239])|[58]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45])))"],"0$1"],[,"(9)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9[23]"],"0$1"],[,"(11)(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",,1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[1-358]|5[138]|6[24]|7[069]|8[013578])","2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|3[456]|[58]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45]))",
"2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|3(?:4|5[014]|6[1239])|[58]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45]))"],"0$1",,1],[,"(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["[23]"],"0$1",,1],[,"(\\d{3})","$1",["1[012]|911"],"$1"]],[[,"([68]\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],[,"(9)(11)(\\d{4})(\\d{4})","$1 $2 $3-$4",["911"]],[,"(9)(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3-$4",["9(?:2[234689]|3[3-8])","9(?:2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[1-358]|5[138]|6[24]|7[069]|8[013578]))",
"9(?:2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|3[456]|[58]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45])))","9(?:2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|3(?:4|5[014]|6[1239])|[58]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45])))"]],[,"(9)(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3-$4",["9[23]"]],[,"(11)(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",
,1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[1-358]|5[138]|6[24]|7[069]|8[013578])","2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|3[456]|[58]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45]))","2(?:2(?:0[013-9]|[13])|3(?:0[013-9]|[67])|49|6(?:[0136]|4[0-59])|8|9(?:[19]|44|7[013-9]|8[14]))|3(?:36|4(?:[12]|3(?:4|5[014]|6[1239])|[58]4)|5(?:1|3[0-24-689]|8[46])|6|7[069]|8(?:[01]|34|[578][45]))"],
"0$1",,1],[,"(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["[23]"],"0$1",,1]],[,,"NA","NA",,,,,,[-1]],,,[,,"810\\d{7}","\\d{10}",,,"8101234567",,,[10]],[,,"810\\d{7}","\\d{10}",,,"8101234567",,,[10]],,,[,,"NA","NA",,,,,,[-1]]],AS:[,[,,"[5689]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"6846(?:22|33|44|55|77|88|9[19])\\d{4}","\\d{7}(?:\\d{3})?",,,"6846221234"],[,,"684(?:2(?:5[2468]|72)|7(?:3[13]|70))\\d{4}","\\d{7}(?:\\d{3})?",,,"6847331234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],
[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"AS",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"684",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AT:[,[,,"[1-9]\\d{3,12}","\\d{3,13}",,,,,,[4,5,6,7,8,9,10,11,12,13],[3]],[,,"1\\d{3,12}|(?:2(?:1[467]|2[13-8]|5[2357]|6[1-46-8]|7[1-8]|8[124-7]|9[1458])|3(?:1[1-8]|3[23568]|4[5-7]|5[1378]|6[1-38]|8[3-68])|4(?:2[1-8]|35|63|7[1368]|8[2457])|5(?:12|2[1-8]|3[357]|4[147]|5[12578]|6[37])|6(?:13|2[1-47]|4[1-35-8]|5[468]|62)|7(?:2[1-8]|3[25]|4[13478]|5[68]|6[16-8]|7[1-6]|9[45]))\\d{3,10}",
"\\d{3,13}",,,"1234567890"],[,,"6(?:5[0-3579]|6[013-9]|[7-9]\\d)\\d{4,10}","\\d{7,13}",,,"664123456",,,[7,8,9,10,11,12,13]],[,,"800\\d{6,10}","\\d{9,13}",,,"800123456",,,[9,10,11,12,13]],[,,"9(?:0[01]|3[019])\\d{6,10}","\\d{9,13}",,,"900123456",,,[9,10,11,12,13]],[,,"8(?:10\\d|2(?:[01]\\d|8\\d?))\\d{5,9}","\\d{8,13}",,,"810123456",,,[8,9,10,11,12,13]],[,,"NA","NA",,,,,,[-1]],[,,"780\\d{6,10}","\\d{9,13}",,,"780123456",,,[9,10,11,12,13]],"AT",43,"00","0",,,"0",,,,[[,"(116\\d{3})","$1",["116"],"$1"],
[,"(1)(\\d{3,12})","$1 $2",["1"],"0$1"],[,"(5\\d)(\\d{3,5})","$1 $2",["5[079]"],"0$1"],[,"(5\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["5[079]"],"0$1"],[,"(5\\d)(\\d{4})(\\d{4,7})","$1 $2 $3",["5[079]"],"0$1"],[,"(\\d{3})(\\d{3,10})","$1 $2",["316|46|51|732|6(?:5[0-3579]|[6-9])|7(?:[28]0)|[89]"],"0$1"],[,"(\\d{4})(\\d{3,9})","$1 $2",["2|3(?:1[1-578]|[3-8])|4[2378]|5[2-6]|6(?:[12]|4[1-9]|5[468])|7(?:2[1-8]|35|4[1-8]|[5-79])"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"5(?:(?:0[1-9]|17)\\d{2,10}|[79]\\d{3,11})|720\\d{6,10}",
"\\d{5,13}",,,"50123",,,[5,6,7,8,9,10,11,12,13]],,,[,,"NA","NA",,,,,,[-1]]],AU:[,[,,"[1-578]\\d{5,9}","\\d{6,10}",,,,,,[5,6,7,8,9,10]],[,,"[237]\\d{8}|8(?:[6-8]\\d{3}|9(?:[02-9]\\d{2}|1(?:[0-57-9]\\d|6[0135-9])))\\d{4}","\\d{8,9}",,,"212345678",,,[9]],[,,"14(?:5\\d|71)\\d{5}|4(?:[0-3]\\d|4[47-9]|5[0-25-9]|6[6-9]|7[02-9]|8[147-9]|9[017-9])\\d{6}","\\d{9}",,,"412345678",,,[9]],[,,"180(?:0\\d{3}|2)\\d{3}","\\d{7,10}",,,"1800123456",,,[7,10]],[,,"19(?:0[0126]\\d|[679])\\d{5}","\\d{8,10}",,,"1900123456",
,,[8,10]],[,,"13(?:00\\d{3}|45[0-4]|\\d)\\d{3}","\\d{6,10}",,,"1300123456",,,[6,8,10]],[,,"500\\d{6}","\\d{9}",,,"500123456",,,[9]],[,,"550\\d{6}","\\d{9}",,,"550123456",,,[9]],"AU",61,"(?:14(?:1[14]|34|4[17]|[56]6|7[47]|88))?001[14-689]","0",,,"0",,"0011",,[[,"([2378])(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[45]|14"],"0$1"],[,"(16)(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],[,"(1[389]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[38]0|90)","1(?:[38]00|90)"],
"$1"],[,"(180)(2\\d{3})","$1 $2",["180","1802"],"$1"],[,"(19\\d)(\\d{3})","$1 $2",["19[13]"],"$1"],[,"(19\\d{2})(\\d{4})","$1 $2",["19[679]"],"$1"],[,"(13)(\\d{2})(\\d{2})","$1 $2 $3",["13[1-9]"],"$1"]],,[,,"16\\d{3,7}","\\d{5,9}",,,"1612345",,,[5,6,7,8,9]],1,,[,,"1(?:3(?:00\\d{3}|45[0-4]|\\d)\\d{3}|80(?:0\\d{6}|2\\d{3}))","\\d{6,10}",,,"1300123456",,,[6,7,8,10]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AW:[,[,,"[25-9]\\d{6}","\\d{7}",,,,,,[7]],[,,"5(?:2\\d|8[1-9])\\d{4}","\\d{7}",,,"5212345"],
[,,"(?:5(?:6\\d|9[2-478])|6(?:[039]0|22|4[01]|6[0-2])|7[34]\\d|9(?:6[45]|9[4-8]))\\d{4}","\\d{7}",,,"5601234"],[,,"800\\d{4}","\\d{7}",,,"8001234"],[,,"900\\d{4}","\\d{7}",,,"9001234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"28\\d{5}|501\\d{4}","\\d{7}",,,"5011234"],"AW",297,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],AX:[,[,,"[135]\\d{5,9}|[27]\\d{4,9}|4\\d{5,10}|6\\d{7,8}|8\\d{6,9}",
"\\d{5,12}",,,,,,[5,6,7,8,9,10,11,12]],[,,"18[1-8]\\d{3,9}","\\d{6,12}",,,"1812345678",,,[6,7,8,9,10,11,12]],[,,"4\\d{5,10}|50\\d{4,8}","\\d{6,11}",,,"412345678",,,[6,7,8,9,10,11]],[,,"800\\d{4,7}","\\d{7,10}",,,"8001234567",,,[7,8,9,10]],[,,"[67]00\\d{5,6}","\\d{8,9}",,,"600123456",,,[8,9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"AX",358,"00|99(?:[02469]|5(?:11|33|5[59]|88|9[09]))","0",,,"0",,"00",,,,[,,"NA","NA",,,,,,[-1]],,,[,,"[13]00\\d{3,7}|2(?:0(?:0\\d{3,7}|2[023]\\d{1,6}|9[89]\\d{1,6}))|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})",
"\\d{5,10}",,,"100123",,,[5,6,7,8,9,10]],[,,"[13]0\\d{4,8}|2(?:0(?:[016-8]\\d{3,7}|[2-59]\\d{2,7})|9\\d{4,8})|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}",,,"10112345",,,[5,6,7,8,9,10]],,,[,,"NA","NA",,,,,,[-1]]],AZ:[,[,,"[1-9]\\d{8}","\\d{7,9}",,,,,,[9],[7]],[,,"(?:1[28]\\d{3}|2(?:02|1[24]|2[2-4]|33|[45]2|6[23])\\d{2}|365(?:[0-46-9]\\d|5[0-35-9]))\\d{4}","\\d{7,9}",,,"123123456"],[,,"(?:36554|(?:4[04]|5[015]|60|7[07])\\d{3})\\d{4}","\\d{9}",,,"401234567"],[,,"88\\d{7}",
"\\d{9}",,,"881234567"],[,,"900200\\d{3}","\\d{9}",,,"900200123"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"AZ",994,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["(?:1[28]|2(?:[45]2|[0-36])|365)"],"(0$1)"],[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[4-8]"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BA:[,
[,,"[3-9]\\d{7,8}","\\d{6,9}",,,,,,[8,9],[6]],[,,"(?:[35]\\d|49)\\d{6}","\\d{6,8}",,,"30123456",,,[8]],[,,"6(?:03|44|71|[1-356])\\d{6}","\\d{8,9}",,,"61123456"],[,,"8[08]\\d{6}","\\d{8}",,,"80123456",,,[8]],[,,"9[0246]\\d{6}","\\d{8}",,,"90123456",,,[8]],[,,"8[12]\\d{6}","\\d{8}",,,"82123456",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"BA",387,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-356]|[7-9]"],"0$1"],[,
"(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6[047]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"70[23]\\d{5}","\\d{8}",,,"70223456",,,[8]],,,[,,"NA","NA",,,,,,[-1]]],BB:[,[,,"[2589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"246(?:2(?:2[78]|7[0-4])|4(?:1[024-6]|2\\d|3[2-9])|5(?:20|[34]\\d|54|7[1-3])|6(?:2\\d|38)|7(?:37|57)|9(?:1[89]|63))\\d{4}","\\d{7}(?:\\d{3})?",,,"2464123456"],[,,"246(?:2(?:[356]\\d|4[0-57-9]|8[0-79])|45\\d|8(?:[2-5]\\d|83))\\d{4}","\\d{7}(?:\\d{3})?",
,,"2462501234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900\\d{7}|246976\\d{4}","\\d{7}(?:\\d{3})?",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"24631\\d{5}","\\d{7}(?:\\d{3})?",,,"2463101234"],"BB",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"246",[,,"NA","NA",,,,,,[-1]],[,,"246(?:292|41[7-9]|43[01])\\d{4}","\\d{7}(?:\\d{3})?",,,"2464301234"],,,[,,"NA","NA",,,,,,[-1]]],BD:[,[,,"[2-79]\\d{5,9}|1\\d{9}|8[0-7]\\d{4,8}",
"\\d{6,10}",,,,,,[6,7,8,9,10]],[,,"2(?:550\\d|7(?:1[0-267]|2[0-289]|3[0-29]|4[01]|5[1-3]|6[013]|7[017]|91)|8(?:0[125]|[139][1-6]|2[0157-9]|6[1-35]|7[1-5]|8[1-8]|90)|9(?:0[0-2]|1[0-4]|2[568]|3[3-6]|5[5-7]|6[0167]|7[15]|8[0146-8]))\\d{4}|3(?:12?[5-7]\\d{2}|0(?:2(?:[025-79]\\d|[348]\\d{1,2})|3(?:[2-4]\\d|[56]\\d?))|2(?:1\\d{2}|2(?:[12]\\d|[35]\\d{1,2}|4\\d?))|3(?:1\\d{2}|2(?:[2356]\\d|4\\d{1,2}))|4(?:1\\d{2}|2(?:2\\d{1,2}|[47]|5\\d{2}))|5(?:1\\d{2}|29)|[67]1\\d{2}|8(?:1\\d{2}|2(?:2\\d{2}|3|4\\d)))\\d{3}|4(?:0(?:2(?:[09]\\d|7)|33\\d{2})|1\\d{3}|2(?:1\\d{2}|2(?:[25]\\d?|[348]\\d|[67]\\d{1,2}))|3(?:1\\d{2}(?:\\d{2})?|2(?:[045]\\d|[236-9]\\d{1,2})|32\\d{2})|4(?:[18]\\d{2}|2(?:[2-46]\\d{2}|3)|5[25]\\d{2})|5(?:1\\d{2}|2(?:3\\d|5))|6(?:[18]\\d{2}|2(?:3(?:\\d{2})?|[46]\\d{1,2}|5\\d{2}|7\\d)|5(?:3\\d?|4\\d|[57]\\d{1,2}|6\\d{2}|8))|71\\d{2}|8(?:[18]\\d{2}|23\\d{2}|54\\d{2})|9(?:[18]\\d{2}|2[2-5]\\d{2}|53\\d{1,2}))\\d{3}|5(?:02[03489]\\d{2}|1\\d{2}|2(?:1\\d{2}|2(?:2(?:\\d{2})?|[457]\\d{2}))|3(?:1\\d{2}|2(?:[37](?:\\d{2})?|[569]\\d{2}))|4(?:1\\d{2}|2[46]\\d{2})|5(?:1\\d{2}|26\\d{1,2})|6(?:[18]\\d{2}|2|53\\d{2})|7(?:1|24)\\d{2}|8(?:1|26)\\d{2}|91\\d{2})\\d{3}|6(?:0(?:1\\d{2}|2(?:3\\d{2}|4\\d{1,2}))|2(?:2[2-5]\\d{2}|5(?:[3-5]\\d{2}|7)|8\\d{2})|3(?:1|2[3478])\\d{2}|4(?:1|2[34])\\d{2}|5(?:1|2[47])\\d{2}|6(?:[18]\\d{2}|6(?:2(?:2\\d|[34]\\d{2})|5(?:[24]\\d{2}|3\\d|5\\d{1,2})))|72[2-5]\\d{2}|8(?:1\\d{2}|2[2-5]\\d{2})|9(?:1\\d{2}|2[2-6]\\d{2}))\\d{3}|7(?:(?:02|[3-589]1|6[12]|72[24])\\d{2}|21\\d{3}|32)\\d{3}|8(?:(?:4[12]|[5-7]2|1\\d?)|(?:0|3[12]|[5-7]1|217)\\d)\\d{4}|9(?:[35]1|(?:[024]2|81)\\d|(?:1|[24]1)\\d{2})\\d{3}",
"\\d{6,9}",,,"27111234",,,[6,7,8,9]],[,,"(?:1[13-9]\\d|(?:3[78]|44)[02-9]|6(?:44|6[02-9]))\\d{7}","\\d{10}",,,"1812345678",,,[10]],[,,"80[03]\\d{7}","\\d{10}",,,"8001234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"96(?:0[49]|1[0-4]|6[69])\\d{6}","\\d{10}",,,"9604123456",,,[10]],"BD",880,"00","0",,,"0",,,,[[,"(2)(\\d{7,8})","$1-$2",["2"],"0$1"],[,"(\\d{2})(\\d{4,6})","$1-$2",["[3-79]1"],"0$1"],[,"(\\d{4})(\\d{3,6})","$1-$2",["1|3(?:0|[2-58]2)|4(?:0|[25]2|3[23]|[4689][25])|5(?:[02-578]2|6[25])|6(?:[0347-9]2|[26][25])|7[02-9]2|8(?:[023][23]|[4-7]2)|9(?:[02][23]|[458]2|6[016])"],
"0$1"],[,"(\\d{3})(\\d{3,7})","$1-$2",["[3-79][2-9]|8"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BE:[,[,,"[1-9]\\d{7,8}","\\d{8,9}",,,,,,[8,9]],[,,"(?:1[0-69]|[23][2-8]|4[23]|5\\d|6[013-57-9]|71|8[1-79]|9[2-4])\\d{6}|80[2-8]\\d{5}","\\d{8}",,,"12345678",,,[8]],[,,"4(?:6[0135-8]|[79]\\d|8[3-9])\\d{6}","\\d{9}",,,"470123456",,,[9]],[,,"800\\d{5}","\\d{8}",,,"80012345",,,[8]],[,,"(?:70[2-467]|90[0-79])\\d{5}","\\d{8}",,,"90123456",
,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"BE",32,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4[6-9]"],"0$1"],[,"(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[23]|4[23]|9[2-4]"],"0$1"],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[156]|7[018]|8(?:0[1-9]|[1-79])"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"78\\d{6}","\\d{8}",,,"78123456",,,[8]],
,,[,,"NA","NA",,,,,,[-1]]],BF:[,[,,"[25-7]\\d{7}","\\d{8}",,,,,,[8]],[,,"2(?:0(?:49|5[23]|9[016-9])|4(?:4[569]|5[4-6]|7[0179])|5(?:[34]\\d|50))\\d{4}","\\d{8}",,,"20491234"],[,,"(?:55[0-5]|6(?:[0-689]\\d|7[0-5]))\\d{5}|7\\d{7}","\\d{8}",,,"70123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"BF",226,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA",
"NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BG:[,[,,"[23567]\\d{5,7}|[489]\\d{6,8}","\\d{5,9}",,,,,,[6,7,8,9],[4,5]],[,,"2\\d{5,7}|(?:[36]\\d|5[1-9]|8[1-6]|9[1-7])\\d{5,6}|(?:4(?:[124-7]\\d|3[1-6])|7(?:0[1-9]|[1-9]\\d))\\d{4,5}","\\d{5,8}",,,"2123456",,,[6,7,8]],[,,"(?:8[7-9]\\d|9(?:8\\d|99))\\d{6}|4(?:3[0789]|8\\d)\\d{5}","\\d{8,9}",,,"48123456",,,[8,9]],[,,"800\\d{5}","\\d{8}",,,"80012345",,,[8]],[,,"90\\d{6}","\\d{8}",,,"90123456",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"700\\d{5}","\\d{5,9}",,,"70012345",
,,[8]],[,,"NA","NA",,,,,,[-1]],"BG",359,"00","0",,,"0",,,,[[,"(2)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],[,"(2)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],[,"(\\d{3})(\\d{4})","$1 $2",["43[124-7]|70[1-9]"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[124-7]|70[1-9]"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[78]00"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["999"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{3,4})",
"$1 $2 $3",["48|8[7-9]|9[08]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BH:[,[,,"[136-9]\\d{7}","\\d{8}",,,,,,[8]],[,,"(?:1(?:3[1356]|6[0156]|7\\d)\\d|6(?:1[16]\\d|500|6(?:0\\d|3[12]|44|7[7-9])|9[69][69])|7(?:1(?:11|78)|7\\d{2}))\\d{4}","\\d{8}",,,"17001234"],[,,"(?:3(?:[1-4679]\\d|5[013-69]|8[0-47-9])\\d|6(?:3(?:00|33|6[16])|6(?:[69]\\d|3[03-9]|7[0-6])))\\d{4}","\\d{8}",,,"36001234"],[,,"80\\d{6}","\\d{8}",,,"80123456"],[,,"(?:87|9[014578])\\d{6}",
"\\d{8}",,,"90123456"],[,,"84\\d{6}","\\d{8}",,,"84123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"BH",973,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BI:[,[,,"[267]\\d{7}","\\d{8}",,,,,,[8]],[,,"22\\d{6}","\\d{8}",,,"22201234"],[,,"(?:29|6[189]|7[124-9])\\d{6}","\\d{8}",,,"79561234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA",
"NA",,,,,,[-1]],"BI",257,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BJ:[,[,,"[2689]\\d{7}|7\\d{3}","\\d{4,8}",,,,,,[4,8]],[,,"2(?:02|1[037]|2[45]|3[68])\\d{5}","\\d{8}",,,"20211234",,,[8]],[,,"(?:6[1-8]|9[03-9])\\d{6}","\\d{8}",,,"90011234",,,[8]],[,,"7[3-5]\\d{2}","\\d{4}",,,"7312",,,[4]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"857[58]\\d{4}",
"\\d{8}",,,"85751234",,,[8]],"BJ",229,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"81\\d{6}","\\d{8}",,,"81123456",,,[8]],,,[,,"NA","NA",,,,,,[-1]]],BL:[,[,,"[56]\\d{8}","\\d{9}",,,,,,[9]],[,,"590(?:2[7-9]|5[12]|87)\\d{4}","\\d{9}",,,"590271234"],[,,"690(?:0[0-7]|[1-9]\\d)\\d{4}","\\d{9}",,,"690301234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],
"BL",590,"00","0",,,"0",,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BM:[,[,,"[4589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"441(?:2(?:02|23|61|[3479]\\d)|[46]\\d{2}|5(?:4\\d|60|89)|824)\\d{4}","\\d{7}(?:\\d{3})?",,,"4412345678"],[,,"441(?:[37]\\d|5[0-39])\\d{5}","\\d{7}(?:\\d{3})?",,,"4413701234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],
[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"BM",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"441",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BN:[,[,,"[2-578]\\d{6}","\\d{7}",,,,,,[7]],[,,"2(?:[013-9]\\d|2[0-7])\\d{4}|[3-5]\\d{6}","\\d{7}",,,"2345678"],[,,"22[89]\\d{4}|[78]\\d{6}","\\d{7}",,,"7123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,
,[-1]],"BN",673,"00",,,,,,,,[[,"([2-578]\\d{2})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BO:[,[,,"[23467]\\d{7}","\\d{7,8}",,,,,,[8],[7]],[,,"(?:2(?:2\\d{2}|5(?:11|[258]\\d|9[67])|6(?:12|2\\d|9[34])|8(?:2[34]|39|62))|3(?:3\\d{2}|4(?:6\\d|8[24])|8(?:25|42|5[257]|86|9[25])|9(?:2\\d|3[234]|4[248]|5[24]|6[2-6]|7\\d))|4(?:4\\d{2}|6(?:11|[24689]\\d|72)))\\d{4}","\\d{7,8}",,,"22123456"],[,,"[67]\\d{7}","\\d{8}",,,"71234567"],
[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"BO",591,"00(1\\d)?","0",,,"0(1\\d)?",,,,[[,"([234])(\\d{7})","$1 $2",["[234]"],,"0$CC $1"],[,"([67]\\d{7})","$1",["[67]"],,"0$CC $1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BQ:[,[,,"[347]\\d{6}","\\d{7}",,,,,,[7]],[,,"(?:318[023]|416[023]|7(?:1[578]|50)\\d)\\d{3}","\\d{7}",,,"7151234"],[,,"(?:318[14-68]|416[15-9]|7(?:0[01]|7[07]|[89]\\d)\\d)\\d{3}",
"\\d{7}",,,"3181234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"BQ",599,"00",,,,,,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BR:[,[,,"[1-46-9]\\d{7,10}|5(?:[0-4]\\d{7,9}|5(?:[2-8]\\d{7}|9\\d{7,8}))","\\d{8,11}",,,,,,[8,9,10,11]],[,,"(?:[14689][1-9]|2[12478]|3[1-578]|5[1-5]|7[13-579])[2-5]\\d{7}","\\d{8,11}",,,"1123456789",,,[10]],[,,"1[1-9](?:7|9\\d)\\d{7}|(?:2[12478]|3[1-578]|[4689][1-9]|5[1-5]|7[13-579])(?:[6-8]|9\\d?)\\d{7}",
"\\d{8,11}",,,"11961234567",,,[10,11]],[,,"800\\d{6,7}","\\d{8,11}",,,"800123456",,,[9,10]],[,,"(?:300|[59]00\\d?)\\d{6}","\\d{8,11}",,,"300123456",,,[9,10]],[,,"(?:300\\d(?:\\d{2})?|40(?:0\\d|20))\\d{4}","\\d{8,10}",,,"40041234",,,[8,10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"BR",55,"00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","0",,,"0(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2",,,[[,"(\\d{4})(\\d{4})","$1-$2",["[2-9](?:[1-9]|0[1-9])"],"$1"],[,"(\\d{5})(\\d{4})","$1-$2",["9(?:[1-9]|0[1-9])"],
"$1"],[,"(\\d{3,5})","$1",["1[125689]"],"$1"],[,"(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[1-5]|7[13-579])9"],"($1)","0 $CC ($1)"],[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["[1-9][1-9]"],"($1)","0 $CC ($1)"],[,"(\\d{4})(\\d{4})","$1-$2",["(?:300|40(?:0|20))"]],[,"([3589]00)(\\d{2,3})(\\d{4})","$1 $2 $3",["[3589]00"],"0$1"]],[[,"(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[1-5]|7[13-579])9"],"($1)","0 $CC ($1)"],[,"(\\d{2})(\\d{4})(\\d{4})",
"$1 $2-$3",["[1-9][1-9]"],"($1)","0 $CC ($1)"],[,"(\\d{4})(\\d{4})","$1-$2",["(?:300|40(?:0|20))"]],[,"([3589]00)(\\d{2,3})(\\d{4})","$1 $2 $3",["[3589]00"],"0$1"]],[,,"NA","NA",,,,,,[-1]],,,[,,"(?:300\\d|40(?:0\\d|20))\\d{4}","\\d{8}",,,"40041234",,,[8]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BS:[,[,,"[2589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[3467]|8[0-4]|9[2-467])|461|502|6(?:0[1-3]|12|7[67]|8[78]|9[89])|7(?:02|88))\\d{4}","\\d{7}(?:\\d{3})?",
,,"2423456789"],[,,"242(?:3(?:5[79]|[79]5)|4(?:[2-4][1-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-9]|65|77)|6[34]6|727)\\d{4}","\\d{7}(?:\\d{3})?",,,"2423591234"],[,,"242300\\d{4}|8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{7}(?:\\d{3})?",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"BS",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"242",[,,"NA","NA",,,,,,[-1]],
[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BT:[,[,,"[1-8]\\d{6,7}","\\d{6,8}",,,,,,[7,8],[6]],[,,"(?:2[3-6]|[34][5-7]|5[236]|6[2-46]|7[246]|8[2-4])\\d{5}","\\d{6,7}",,,"2345678",,,[7]],[,,"(?:1[67]|77)\\d{6}","\\d{8}",,,"17123456",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"BT",975,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1|77"]],[,"([2-8])(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]]],
,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BW:[,[,,"[2-79]\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"(?:2(?:4[0-48]|6[0-24]|9[0578])|3(?:1[0235-9]|55|[69]\\d|7[01])|4(?:6[03]|7[1267]|9[0-5])|5(?:3[0389]|4[0489]|7[1-47]|88|9[0-49])|6(?:2[1-35]|5[149]|8[067]))\\d{4}","\\d{7}",,,"2401234",,,[7]],[,,"7(?:[1-6]\\d|7[014-8])\\d{5}","\\d{8}",,,"71123456",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"90\\d{5}","\\d{7}",,,"9012345",,,[7]],[,,"NA","NA",,,,,,[-1]],[,
,"NA","NA",,,,,,[-1]],[,,"79[12][01]\\d{4}","\\d{8}",,,"79101234",,,[8]],"BW",267,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[2-6]"]],[,"(7\\d)(\\d{3})(\\d{3})","$1 $2 $3",["7"]],[,"(90)(\\d{5})","$1 $2",["9"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BY:[,[,,"[1-4]\\d{8}|800\\d{3,7}|[89]\\d{9,10}","\\d{5,11}",,,,,,[6,7,8,9,10,11],[5]],[,,"(?:1(?:5(?:1[1-5]|[24]\\d|6[2-4]|9[1-7])|6(?:[235]\\d|4[1-7])|7\\d{2})|2(?:1(?:[246]\\d|3[0-35-9]|5[1-9])|2(?:[235]\\d|4[0-8])|3(?:[26]\\d|3[02-79]|4[024-7]|5[03-7])))\\d{5}",
"\\d{5,9}",,,"152450911",,,[9]],[,,"(?:2(?:5[5679]|9[1-9])|33\\d|44\\d)\\d{6}","\\d{9}",,,"294911911",,,[9]],[,,"8(?:0[13]|20\\d)\\d{7}|800\\d{3,7}","\\d{5,11}",,,"8011234567"],[,,"(?:810|902)\\d{7}","\\d{10}",,,"9021234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"249\\d{6}","\\d{9}",,,"249123456",,,[9]],"BY",375,"810","8",,,"8?0?",,"8~10",,[[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["17[0-3589]|2[4-9]|[34]","17(?:[02358]|1[0-2]|9[0189])|2[4-9]|[34]"],"8 0$1"],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})",
"$1 $2-$3-$4",["1(?:5[24]|6[235]|7[467])|2(?:1[246]|2[25]|3[26])","1(?:5[24]|6(?:2|3[04-9]|5[0346-9])|7(?:[46]|7[37-9]))|2(?:1[246]|2[25]|3[26])"],"8 0$1"],[,"(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],[,"([89]\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8[01]|9"],"8 $1"],[,"(82\\d)(\\d{4})(\\d{4})","$1 $2 $3",["82"],"8 $1"],[,"(800)(\\d{3})","$1 $2",["800"],"8 $1"],
[,"(800)(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"8(?:[013]|[12]0)\\d{8}|800\\d{3,7}|902\\d{7}","\\d{5,11}",,,"82012345678"],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],BZ:[,[,,"[2-8]\\d{6}|0\\d{10}","\\d{7}(?:\\d{4})?",,,,,,[7,11]],[,,"(?:[23458][02]\\d|7(?:[02]\\d|32))\\d{4}","\\d{7}",,,"2221234",,,[7]],[,,"6[0-35-7]\\d{5}","\\d{7}",,,"6221234",,,[7]],[,,"0800\\d{7}","\\d{11}",,,"08001234123",,,[11]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,
"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"BZ",501,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],[,"(0)(800)(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],CA:[,[,,"[2-9]\\d{9}|3\\d{6}","\\d{7}(?:\\d{3})?",,,,,,[7,10]],[,,"(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|50)|5(?:06|1[49]|48|79|8[17])|6(?:0[04]|13|22|39|47)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}|310\\d{4}",
"\\d{7}(?:\\d{3})?",,,"2042345678",,,[10]],[,,"(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|50)|5(?:06|1[49]|48|79|8[17])|6(?:0[04]|13|22|39|47)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}","\\d{7}(?:\\d{3})?",,,"2042345678",,,[10]],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}|310\\d{4}","\\d{7}(?:\\d{3})?",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678",,,[10]],[,
,"NA","NA",,,,,,[-1]],"CA",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CC:[,[,,"[1458]\\d{5,9}","\\d{6,10}",,,,,,[6,7,9,10],[8]],[,,"89162\\d{4}","\\d{8,9}",,,"891621234",,,[9]],[,,"14(?:5\\d|71)\\d{5}|4(?:[0-2]\\d|3[0-57-9]|4[47-9]|5[0-25-9]|6[6-9]|7[02-9]|8[147-9]|9[017-9])\\d{6}","\\d{9}",,,"412345678",,,[9]],[,,"180(?:0\\d{3}|2)\\d{3}","\\d{7,10}",,,"1800123456",,,[7,10]],[,,"190[0126]\\d{6}","\\d{10}",,,"1900123456",
,,[10]],[,,"13(?:00\\d{2})?\\d{4}","\\d{6,10}",,,"1300123456",,,[6,10]],[,,"500\\d{6}","\\d{9}",,,"500123456",,,[9]],[,,"550\\d{6}","\\d{9}",,,"550123456",,,[9]],"CC",61,"(?:14(?:1[14]|34|4[17]|[56]6|7[47]|88))?001[14-689]","0",,,"0",,"0011",,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CD:[,[,,"[2-6]\\d{6}|[18]\\d{6,8}|9\\d{8}","\\d{7,9}",,,,,,[7,9]],[,,"1(?:2\\d{7}|\\d{6})|[2-6]\\d{6}","\\d{7,9}",,,"1234567"],[,,"8(?:[0-2459]\\d{2}|8)\\d{5}|9[017-9]\\d{7}",
"\\d{7,9}",,,"991234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CD",243,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["12"],"0$1"],[,"([89]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8[0-2459]|9"],"0$1"],[,"(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],[,"(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CF:[,
[,,"[278]\\d{7}","\\d{8}",,,,,,[8]],[,,"2[12]\\d{6}","\\d{8}",,,"21612345"],[,,"7[0257]\\d{6}","\\d{8}",,,"70012345"],[,,"NA","NA",,,,,,[-1]],[,,"8776\\d{4}","\\d{8}",,,"87761234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CF",236,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CG:[,[,,"[028]\\d{8}","\\d{9}",,,,,,[9]],[,,"222[1-589]\\d{5}","\\d{9}",
,,"222123456"],[,,"0[14-6]\\d{7}","\\d{9}",,,"061234567"],[,,"NA","NA",,,,,,[-1]],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CG",242,"00",,,,,,,,[[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]],[,"(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],CH:[,[,,"[2-9]\\d{8}|860\\d{9}","\\d{9}(?:\\d{3})?",,,,,,[9,12]],[,,"(?:2[12467]|3[1-4]|4[134]|5[256]|6[12]|[7-9]1)\\d{7}",
"\\d{9}",,,"212345678",,,[9]],[,,"7[5-9]\\d{7}","\\d{9}",,,"781234567",,,[9]],[,,"800\\d{6}","\\d{9}",,,"800123456",,,[9]],[,,"90[016]\\d{6}","\\d{9}",,,"900123456",,,[9]],[,,"84[0248]\\d{6}","\\d{9}",,,"840123456",,,[9]],[,,"878\\d{6}","\\d{9}",,,"878123456",,,[9]],[,,"NA","NA",,,,,,[-1]],"CH",41,"00","0",,,"0",,,,[[,"([2-9]\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]|[89]1"],"0$1"],[,"([89]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})",
"$1 $2 $3 $4 $5",["860"],"0$1"]],,[,,"74[0248]\\d{6}","\\d{9}",,,"740123456",,,[9]],,,[,,"NA","NA",,,,,,[-1]],[,,"5[18]\\d{7}","\\d{9}",,,"581234567",,,[9]],,,[,,"860\\d{9}","\\d{12}",,,"860123456789",,,[12]]],CI:[,[,,"[02-8]\\d{7}","\\d{8}",,,,,,[8]],[,,"(?:2(?:0[023]|1[02357]|[23][045]|4[03-5])|3(?:0[06]|1[069]|[2-4][07]|5[09]|6[08]))\\d{5}","\\d{8}",,,"21234567"],[,,"(?:0[1-9]|4\\d|5[14-9]|6[015-79]|7[578]|8[79])\\d{6}","\\d{8}",,,"01234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,
"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CI",225,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],CK:[,[,,"[2-8]\\d{4}","\\d{5}",,,,,,[5]],[,,"(?:2\\d|3[13-7]|4[1-5])\\d{3}","\\d{5}",,,"21234"],[,,"[5-8]\\d{4}","\\d{5}",,,"71234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CK",
682,"00",,,,,,,,[[,"(\\d{2})(\\d{3})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CL:[,[,,"(?:[2-9]|600|123)\\d{7,8}","\\d{7,11}",,,,,,[9,10,11],[7,8]],[,,"2(?:1962\\d{4}|2\\d{7}|32[0-267]\\d{5})|(?:3[2-5]|[47][1-35]|5[1-3578]|6[13-57])\\d{7}","\\d{7,9}",,,"221234567",,,[9]],[,,"9[3-9]\\d{7}","\\d{8,9}",,,"961234567",,,[9]],[,,"800\\d{6}|1230\\d{7}","\\d{9,11}",,,"800123456",,,[9,11]],[,,"NA","NA",,,,,,[-1]],[,,"600\\d{7,8}","\\d{10,11}",
,,"6001234567",,,[10,11]],[,,"NA","NA",,,,,,[-1]],[,,"44\\d{7}","\\d{9}",,,"441234567",,,[9]],"CL",56,"(?:0|1(?:1[0-69]|2[0-57]|5[13-58]|69|7[0167]|8[018]))0","0",,,"0|(1(?:1[0-69]|2[0-57]|5[13-58]|69|7[0167]|8[018]))",,,,[[,"(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[23]"],"($1)","$CC ($1)"],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[357]|4[1-35]|6[13-57]"],"($1)","$CC ($1)"],[,"(9)(\\d{4})(\\d{4})","$1 $2 $3",["9"],"0$1"],[,"(44)(\\d{3})(\\d{4})","$1 $2 $3",["44"],"0$1"],[,"([68]00)(\\d{3})(\\d{3,4})",
"$1 $2 $3",["60|8"],"$1"],[,"(600)(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"],"$1"],[,"(1230)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"$1"],[,"(\\d{5})(\\d{4})","$1 $2",["219"],"($1)","$CC ($1)"],[,"(\\d{4,5})","$1",["[1-9]"],"$1"]],[[,"(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[23]"],"($1)","$CC ($1)"],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[357]|4[1-35]|6[13-57]"],"($1)","$CC ($1)"],[,"(9)(\\d{4})(\\d{4})","$1 $2 $3",["9"],"0$1"],[,"(44)(\\d{3})(\\d{4})","$1 $2 $3",["44"],"0$1"],[,"([68]00)(\\d{3})(\\d{3,4})",
"$1 $2 $3",["60|8"],"$1"],[,"(600)(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"],"$1"],[,"(1230)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"$1"],[,"(\\d{5})(\\d{4})","$1 $2",["219"],"($1)","$CC ($1)"]],[,,"NA","NA",,,,,,[-1]],,,[,,"600\\d{7,8}","\\d{10,11}",,,"6001234567",,,[10,11]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CM:[,[,,"[2368]\\d{7,8}","\\d{8,9}",,,,,,[8,9]],[,,"2(?:22|33|4[23])\\d{6}","\\d{9}",,,"222123456",,,[9]],[,,"6[5-9]\\d{7}","\\d{9}",,,"671234567",,,[9]],[,,"800\\d{5}","\\d{8}",
,,"80012345",,,[8]],[,,"88\\d{6}","\\d{8}",,,"88012345",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CM",237,"00",,,,,,,,[[,"([26])(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]"]],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[23]|88"]],[,"(800)(\\d{2})(\\d{3})","$1 $2 $3",["80"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CN:[,[,,"[1-7]\\d{6,11}|8[0-357-9]\\d{6,9}|9\\d{7,10}","\\d{4,12}",
,,,,,[7,8,9,10,11,12],[5,6]],[,,"21(?:100\\d{2}|95\\d{3,4}|\\d{8,10})|(?:10|2[02-57-9]|3(?:11|7[179])|4(?:[15]1|3[1-35])|5(?:1\\d|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|8(?:[57]1|98))(?:100\\d{2}|95\\d{3,4}|\\d{8})|(?:3(?:1[02-9]|35|49|5\\d|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|3[3-9]|5[2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[17]\\d|2[248]|3[04-9]|4[3-6]|5[0-4689]|6[2368]|9[02-9])|8(?:078|1[236-8]|2[5-7]|3\\d|5[1-9]|7[02-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100\\d{2}|95\\d{3,4}|\\d{7})|80(?:29|6[03578]|7[018]|81)\\d{4}",
"\\d{4,12}",,,"1012345678"],[,,"1(?:[38]\\d|4[57]|5[0-35-9]|7[0136-8])\\d{8}","\\d{11}",,,"13123456789",,,[11]],[,,"(?:10)?800\\d{7}","\\d{10,12}",,,"8001234567",,,[10,12]],[,,"16[08]\\d{5}","\\d{8}",,,"16812345",,,[8]],[,,"400\\d{7}|950\\d{7,8}|(?:10|2[0-57-9]|3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[4789]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[3678]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))96\\d{3,4}",
"\\d{7,11}",,,"4001234567",,,[7,8,9,10,11]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CN",86,"(1(?:[129]\\d{3}|79\\d{2}))?00","0",,,"(1(?:[129]\\d{3}|79\\d{2}))|0",,"00",,[[,"(80\\d{2})(\\d{4})","$1 $2",["80[2678]"],"0$1","$CC $1",1],[,"([48]00)(\\d{3})(\\d{4})","$1 $2 $3",["[48]00"]],[,"(\\d{5,6})","$1",["100|95"]],[,"(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2\\d)[19]","(?:10|2\\d)(?:10|9[56])","(?:10|2\\d)(?:100|9[56])"],"0$1","$CC $1"],[,"(\\d{3})(\\d{5,6})","$1 $2",["[3-9]","[3-9]\\d{2}[19]",
"[3-9]\\d{2}(?:10|9[56])"],"0$1","$CC $1"],[,"(\\d{3,4})(\\d{4})","$1 $2",["[2-9]"]],[,"(21)(\\d{4})(\\d{4,6})","$1 $2 $3",["21"],"0$1","$CC $1",1],[,"([12]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["10[1-9]|2[02-9]","10[1-9]|2[02-9]","10(?:[1-79]|8(?:[1-9]|0[1-9]))|2[02-9]"],"0$1","$CC $1",1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|3|5[1-9]|7[02-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])"],
"0$1","$CC $1",1],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["3(?:11|7[179])|4(?:[15]1|3[1-35])|5(?:1|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|8(?:[57]1|98)"],"0$1","$CC $1",1],[,"(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["807","8078"],"0$1","$CC $1",1],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-578]"],,"$CC $1"],[,"(10800)(\\d{3})(\\d{4})","$1 $2 $3",["108","1080","10800"]],[,"(\\d{3})(\\d{7,8})","$1 $2",["950"]]],[[,"(80\\d{2})(\\d{4})","$1 $2",["80[2678]"],"0$1","$CC $1",1],[,"([48]00)(\\d{3})(\\d{4})",
"$1 $2 $3",["[48]00"]],[,"(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2\\d)[19]","(?:10|2\\d)(?:10|9[56])","(?:10|2\\d)(?:100|9[56])"],"0$1","$CC $1"],[,"(\\d{3})(\\d{5,6})","$1 $2",["[3-9]","[3-9]\\d{2}[19]","[3-9]\\d{2}(?:10|9[56])"],"0$1","$CC $1"],[,"(21)(\\d{4})(\\d{4,6})","$1 $2 $3",["21"],"0$1","$CC $1",1],[,"([12]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["10[1-9]|2[02-9]","10[1-9]|2[02-9]","10(?:[1-79]|8(?:[1-9]|0[1-9]))|2[02-9]"],"0$1","$CC $1",1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|3|5[1-9]|7[02-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])"],
"0$1","$CC $1",1],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["3(?:11|7[179])|4(?:[15]1|3[1-35])|5(?:1|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|8(?:[57]1|98)"],"0$1","$CC $1",1],[,"(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["807","8078"],"0$1","$CC $1",1],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-578]"],,"$CC $1"],[,"(10800)(\\d{3})(\\d{4})","$1 $2 $3",["108","1080","10800"]],[,"(\\d{3})(\\d{7,8})","$1 $2",["950"]]],[,,"NA","NA",,,,,,[-1]],,,[,,"(?:4|(?:10)?8)00\\d{7}|950\\d{7,8}","\\d{10,12}",
,,"4001234567",,,[10,11,12]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CO:[,[,,"(?:[13]\\d{0,3}|[24-8])\\d{7}","\\d{7,11}",,,,,,[8,10,11],[7]],[,,"[124-8][2-9]\\d{6}","\\d{8}",,,"12345678",,,[8]],[,,"3(?:0[0-5]|1\\d|2[0-3]|5[01])\\d{7}","\\d{10}",,,"3211234567",,,[10]],[,,"1800\\d{7}","\\d{11}",,,"18001234567",,,[11]],[,,"19(?:0[01]|4[78])\\d{7}","\\d{11}",,,"19001234567",,,[11]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CO",57,"00(?:4(?:[14]4|56)|[579])","0",
,,"0([3579]|4(?:44|56))?",,,,[[,"(\\d)(\\d{7})","$1 $2",["1(?:8[2-9]|9[0-3]|[2-7])|[24-8]","1(?:8[2-9]|9(?:09|[1-3])|[2-7])|[24-8]"],"($1)","0$CC $1"],[,"(\\d{3})(\\d{7})","$1 $2",["3"],,"0$CC $1"],[,"(1)(\\d{3})(\\d{7})","$1-$2-$3",["1(?:80|9[04])","1(?:800|9(?:0[01]|4[78]))"],"0$1"]],[[,"(\\d)(\\d{7})","$1 $2",["1(?:8[2-9]|9[0-3]|[2-7])|[24-8]","1(?:8[2-9]|9(?:09|[1-3])|[2-7])|[24-8]"],"($1)","0$CC $1"],[,"(\\d{3})(\\d{7})","$1 $2",["3"],,"0$CC $1"],[,"(1)(\\d{3})(\\d{7})","$1 $2 $3",["1(?:80|9[04])",
"1(?:800|9(?:0[01]|4[78]))"]]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CR:[,[,,"[24-9]\\d{7,9}","\\d{8,10}",,,,,,[8,10]],[,,"2[0-24-7]\\d{6}","\\d{8}",,,"22123456",,,[8]],[,,"5(?:0[01]|7[0-3])\\d{5}|(?:[67][0-3]|8[3-9])\\d{6}","\\d{8}",,,"83123456",,,[8]],[,,"800\\d{7}","\\d{10}",,,"8001234567",,,[10]],[,,"90[059]\\d{7}","\\d{10}",,,"9001234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"210[0-6]\\d{4}|4\\d{7}|5100\\d{4}",
"\\d{8}",,,"40001234",,,[8]],"CR",506,"00",,,,"(19(?:0[012468]|1[09]|20|66|77|99))",,,,[[,"(\\d{4})(\\d{4})","$1 $2",["[24-7]|8[3-9]"],,"$CC $1"],[,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]0"],,"$CC $1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CU:[,[,,"[2-57]\\d{5,7}","\\d{4,8}",,,,,,[6,7,8],[4,5]],[,,"2[1-4]\\d{5,6}|3(?:1\\d{6}|[23]\\d{4,6})|4(?:[125]\\d{5,6}|[36]\\d{6}|[78]\\d{4,6})|7\\d{6,7}","\\d{4,8}",,,"71234567"],[,,"5\\d{7}",
"\\d{8}",,,"51234567",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CU",53,"119","0",,,"0",,,,[[,"(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],[,"(\\d{2})(\\d{4,6})","$1 $2",["[2-4]"],"(0$1)"],[,"(\\d)(\\d{7})","$1 $2",["5"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CV:[,[,,"[259]\\d{6}","\\d{7}",,,,,,[7]],[,,"2(?:2[1-7]|3[0-8]|4[12]|5[1256]|6\\d|7[1-3]|8[1-5])\\d{4}",
"\\d{7}",,,"2211234"],[,,"(?:9\\d|59)\\d{5}","\\d{7}",,,"9911234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CV",238,"0",,,,,,,,[[,"(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CW:[,[,,"[169]\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"9(?:[48]\\d{2}|50\\d|7(?:2[0-24]|[34]\\d|6[35-7]|77|8[7-9]))\\d{4}","\\d{7,8}",,,"94151234",,,[8]],
[,,"9(?:5(?:[12467]\\d|3[01])|6(?:[15-9]\\d|3[01]))\\d{4}","\\d{7,8}",,,"95181234",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"60[0-2]\\d{4}","\\d{7}",,,"6001234",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"CW",599,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[13-7]"]],[,"(9)(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],,[,,"955\\d{5}","\\d{7,8}",,,"95581234",,,[8]],1,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CX:[,[,,"[1458]\\d{5,9}","\\d{6,10}",
,,,,,[6,7,8,9,10]],[,,"89164\\d{4}","\\d{8,9}",,,"891641234",,,[9]],[,,"14(?:5\\d|71)\\d{5}|4(?:[0-2]\\d|3[0-57-9]|4[47-9]|5[0-25-9]|6[6-9]|7[02-9]|8[147-9]|9[017-9])\\d{6}","\\d{9}",,,"412345678",,,[9]],[,,"180(?:0\\d{3}|2)\\d{3}","\\d{7,10}",,,"1800123456",,,[7,10]],[,,"190[0126]\\d{6}","\\d{10}",,,"1900123456",,,[10]],[,,"13(?:00\\d{2})?\\d{4}","\\d{6,10}",,,"1300123456",,,[6,8,10]],[,,"500\\d{6}","\\d{9}",,,"500123456",,,[9]],[,,"550\\d{6}","\\d{9}",,,"550123456",,,[9]],"CX",61,"(?:14(?:1[14]|34|4[17]|[56]6|7[47]|88))?001[14-689]",
"0",,,"0",,"0011",,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],CY:[,[,,"[257-9]\\d{7}","\\d{8}",,,,,,[8]],[,,"2[2-6]\\d{6}","\\d{8}",,,"22345678"],[,,"9[4-79]\\d{6}","\\d{8}",,,"96123456"],[,,"800\\d{5}","\\d{8}",,,"80001234"],[,,"90[09]\\d{5}","\\d{8}",,,"90012345"],[,,"80[1-9]\\d{5}","\\d{8}",,,"80112345"],[,,"700\\d{5}","\\d{8}",,,"70012345"],[,,"NA","NA",,,,,,[-1]],"CY",357,"00",,,,,,,,[[,"(\\d{2})(\\d{6})","$1 $2"]],,[,,"NA","NA",,,,
,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"(?:50|77)\\d{6}","\\d{8}",,,"77123456"],,,[,,"NA","NA",,,,,,[-1]]],CZ:[,[,,"[2-8]\\d{8}|9\\d{8,11}","\\d{9,12}",,,,,,[9,10,11,12]],[,,"2\\d{8}|(?:3[1257-9]|4[16-9]|5[13-9])\\d{7}","\\d{9,12}",,,"212345678",,,[9]],[,,"(?:60[1-8]|7(?:0[2-5]|[2379]\\d))\\d{6}","\\d{9,12}",,,"601123456",,,[9]],[,,"800\\d{6}","\\d{9,12}",,,"800123456",,,[9]],[,,"9(?:0[05689]|76)\\d{6}","\\d{9,12}",,,"900123456",,,[9]],[,,"8[134]\\d{7}","\\d{9,12}",,,"811234567",,,[9]],[,,"70[01]\\d{6}",
"\\d{9,12}",,,"700123456",,,[9]],[,,"9[17]0\\d{6}","\\d{9,12}",,,"910123456",,,[9]],"CZ",420,"00",,,,,,,,[[,"([2-9]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],[,"(96\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["96"]],[,"(9\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9[36]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"9(?:5\\d|7[234])\\d{6}","\\d{9,12}",,,"972123456",,,[9]],,,[,,"9(?:3\\d{9}|6\\d{7,10})","\\d{9,12}",,,"93123456789"]],DE:[,[,,"[1-35-9]\\d{3,14}|4(?:[0-8]\\d{4,12}|9(?:[0-37]\\d|4(?:[1-35-8]|4\\d?)|5\\d{1,2}|6[1-8]\\d?)\\d{2,8})",
"\\d{2,15}",,,,,,[4,5,6,7,8,9,10,11,12,13,14,15],[3]],[,,"[246]\\d{5,13}|3(?:0\\d{3,13}|2\\d{9}|[3-9]\\d{4,13})|5(?:0[2-8]|[1256]\\d|[38][0-8]|4\\d{0,2}|[79][0-7])\\d{3,11}|7(?:0[2-8]|[1-9]\\d)\\d{3,10}|8(?:0[2-9]|[1-9]\\d)\\d{3,10}|9(?:0[6-9]\\d{3,10}|1\\d{4,12}|[2-9]\\d{4,11})","\\d{2,15}",,,"30123456",,,[5,6,7,8,9,10,11,12,13,14,15]],[,,"1(?:5[0-25-9]\\d{8}|6[023]\\d{7,8}|7(?:[0-57-9]\\d?|6\\d)\\d{7})","\\d{10,11}",,,"15123456789",,,[10,11]],[,,"800\\d{7,12}","\\d{10,15}",,,"8001234567890",,,[10,
11,12,13,14,15]],[,,"137[7-9]\\d{6}|900(?:[135]\\d{6}|9\\d{7})","\\d{10,11}",,,"9001234567",,,[10,11]],[,,"1(?:3(?:7[1-6]\\d{6}|8\\d{4})|80\\d{5,11})","\\d{7,14}",,,"18012345",,,[7,8,9,10,11,12,13,14]],[,,"700\\d{8}","\\d{11}",,,"70012345678",,,[11]],[,,"NA","NA",,,,,,[-1]],"DE",49,"00","0",,,"0",,,,[[,"(1\\d{2})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],[,"(15\\d{3})(\\d{6})","$1 $2",["15[0568]"],"0$1"],[,"(1\\d{3})(\\d{7})","$1 $2",["15"],"0$1"],[,"(\\d{2})(\\d{3,11})","$1 $2",["3[02]|40|[68]9"],"0$1"],
[,"(\\d{3})(\\d{3,11})","$1 $2",["2(?:\\d1|0[2389]|1[24]|28|34)|3(?:[3-9][15]|40)|[4-8][1-9]1|9(?:06|[1-9]1)"],"0$1"],[,"(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|[7-9](?:\\d[1-9]|[1-9]\\d)|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])","[24-6]|[7-9](?:\\d[1-9]|[1-9]\\d)|3(?:3(?:0[1-467]|2[127-9]|3[124578]|[46][1246]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|3[1357]|4[13578]|6[1246]|7[1356]|9[1346])|5(?:0[14]|2[1-3589]|3[1357]|4[1246]|6[1-4]|7[1346]|8[13568]|9[1246])|6(?:0[356]|2[1-489]|3[124-6]|4[1347]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|3[1357]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|4[1347]|6[0135-9]|7[1467]|8[136])|9(?:0[12479]|2[1358]|3[1357]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))"],
"0$1"],[,"(3\\d{4})(\\d{1,10})","$1 $2",["3"],"0$1"],[,"(800)(\\d{7,12})","$1 $2",["800"],"0$1"],[,"(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["(?:18|90)0|137","1(?:37|80)|900[1359]"],"0$1"],[,"(1\\d{2})(\\d{5,11})","$1 $2",["181"],"0$1"],[,"(18\\d{3})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],[,"(18\\d{2})(\\d{7})","$1 $2",["18[68]"],"0$1"],[,"(18\\d)(\\d{8})","$1 $2",["18[2-579]"],"0$1"],[,"(700)(\\d{4})(\\d{4})","$1 $2 $3",["700"],"0$1"],[,"(138)(\\d{4})","$1 $2",["138"],"0$1"],[,"(15[013-68])(\\d{2})(\\d{8})",
"$1 $2 $3",["15[013-68]"],"0$1"],[,"(15[279]\\d)(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],[,"(1[67]\\d)(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"]],,[,,"16(?:4\\d{1,10}|[89]\\d{1,11})","\\d{4,14}",,,"16412345",,,[4,5,6,7,8,9,10,11,12,13,14]],,,[,,"NA","NA",,,,,,[-1]],[,,"18(?:1\\d{5,11}|[2-9]\\d{8})","\\d{8,14}",,,"18500123456",,,[8,9,10,11,12,13,14]],,,[,,"1(?:5(?:(?:2\\d55|7\\d99|9\\d33)\\d{7}|(?:[034568]00|113)\\d{8})|6(?:013|255|399)\\d{7,8}|7(?:[015]13|[234]55|[69]33|[78]99)\\d{7,8})",
"\\d{12,13}",,,"177991234567",,,[12,13]]],DJ:[,[,,"[27]\\d{7}","\\d{8}",,,,,,[8]],[,,"2(?:1[2-5]|7[45])\\d{5}","\\d{8}",,,"21360003"],[,,"77[0-26-8]\\d{5}","\\d{8}",,,"77831001"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"DJ",253,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],DK:[,[,,"[2-9]\\d{7}","\\d{8}",
,,,,,[8]],[,,"(?:[2-7]\\d|8[126-9]|9[1-36-9])\\d{6}","\\d{8}",,,"32123456"],[,,"(?:[2-7]\\d|8[126-9]|9[1-36-9])\\d{6}","\\d{8}",,,"20123456"],[,,"80\\d{6}","\\d{8}",,,"80123456"],[,,"90\\d{6}","\\d{8}",,,"90123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"DK",45,"00",,,,,,,1,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],DM:[,[,,"[57-9]\\d{9}","\\d{7}(?:\\d{3})?",
,,,,,[10],[7]],[,,"767(?:2(?:55|66)|4(?:2[01]|4[0-25-9])|50[0-4]|70[1-3])\\d{4}","\\d{7}(?:\\d{3})?",,,"7674201234"],[,,"767(?:2(?:[234689]5|7[5-7])|31[5-7]|61[2-7])\\d{4}","\\d{7}(?:\\d{3})?",,,"7672251234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"DM",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"767",[,,"NA",
"NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],DO:[,[,,"[589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"8(?:[04]9[2-9]\\d{6}|29(?:2(?:[0-59]\\d|6[04-9]|7[0-27]|8[0237-9])|3(?:[0-35-9]\\d|4[7-9])|[45]\\d{2}|6(?:[0-27-9]\\d|[3-5][1-9]|6[0135-8])|7(?:0[013-9]|[1-37]\\d|4[1-35689]|5[1-4689]|6[1-57-9]|8[1-79]|9[1-8])|8(?:0[146-9]|1[0-48]|[248]\\d|3[1-79]|5[01589]|6[013-68]|7[124-8]|9[0-8])|9(?:[0-24]\\d|3[02-46-9]|5[0-79]|60|7[0169]|8[57-9]|9[02-9]))\\d{4})","\\d{7}(?:\\d{3})?",
,,"8092345678"],[,,"8[024]9[2-9]\\d{6}","\\d{7}(?:\\d{3})?",,,"8092345678"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"DO",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"8[024]9",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],DZ:[,[,,"(?:[1-4]|[5-9]\\d)\\d{7}","\\d{8,9}",,,,,,[8,9]],[,
,"(?:1\\d|2[013-79]|3[0-8]|4[0135689])\\d{6}|9619\\d{5}","\\d{8,9}",,,"12345678"],[,,"(?:5[4-6]|7[7-9])\\d{7}|6(?:[569]\\d|7[0-6])\\d{6}","\\d{9}",,,"551234567",,,[9]],[,,"800\\d{6}","\\d{9}",,,"800123456",,,[9]],[,,"80[3-689]1\\d{5}","\\d{9}",,,"808123456",,,[9]],[,,"80[12]1\\d{5}","\\d{9}",,,"801123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"98[23]\\d{6}","\\d{9}",,,"983123456",,,[9]],"DZ",213,"00","0",,,"0",,,,[[,"([1-4]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],[,"([5-8]\\d{2})(\\d{2})(\\d{2})(\\d{2})",
"$1 $2 $3 $4",["[5-8]"],"0$1"],[,"(9\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],EC:[,[,,"1\\d{9,10}|[2-8]\\d{7}|9\\d{8}","\\d{7,11}",,,,,,[8,9,10,11],[7]],[,,"[2-7][2-7]\\d{6}","\\d{7,8}",,,"22123456",,,[8]],[,,"9(?:(?:39|[45][89]|7[7-9]|[89]\\d)\\d|6(?:[017-9]\\d|2[0-4]))\\d{5}","\\d{9}",,,"991234567",,,[9]],[,,"1800\\d{6,7}","\\d{10,11}",,,"18001234567",,,[10,11]],[,,"NA","NA",,,,
,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"[2-7]890\\d{4}","\\d{8}",,,"28901234",,,[8]],"EC",593,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[247]|[356][2-8]"],"(0$1)"],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],[,"(1800)(\\d{3})(\\d{3,4})","$1 $2 $3",["1"],"$1"]],[[,"(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[247]|[356][2-8]"]],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],[,"(1800)(\\d{3})(\\d{3,4})","$1 $2 $3",["1"],"$1"]],[,,"NA","NA",,,,,,[-1]],,,[,,
"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],EE:[,[,,"1\\d{3,4}|[3-9]\\d{6,7}|800\\d{6,7}","\\d{4,10}",,,,,,[4,5,7,8,10]],[,,"(?:3[23589]|4[3-8]|6\\d|7[1-9]|88)\\d{5}","\\d{7}",,,"3212345",,,[7]],[,,"(?:5\\d|8[1-5])\\d{6}|5(?:[02]\\d{2}|1(?:[0-8]\\d|95)|5[0-478]\\d|64[0-4]|65[1-589])\\d{3}","\\d{7,8}",,,"51234567",,,[7,8]],[,,"800(?:0\\d{3}|1\\d|[2-9])\\d{3}","\\d{7,10}",,,"80012345",,,[7,8,10]],[,,"(?:40\\d{2}|900)\\d{4}","\\d{7,8}",,,"9001234",,,[7,8]],[,,"NA","NA",,,
,,,[-1]],[,,"70[0-2]\\d{5}","\\d{8}",,,"70012345",,,[8]],[,,"NA","NA",,,,,,[-1]],"EE",372,"00",,,,,,,,[[,"([3-79]\\d{2})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]"]],[,"(70)(\\d{2})(\\d{4})","$1 $2 $3",["70"]],[,"(8000)(\\d{3})(\\d{3})","$1 $2 $3",["800","8000"]],[,"([458]\\d{3})(\\d{3,4})","$1 $2",["40|5|8(?:00|[1-5])","40|5|8(?:00[1-9]|[1-5])"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"1\\d{3,4}|800[2-9]\\d{3}",
"\\d{4,7}",,,"8002123",,,[4,5,7]],[,,"1(?:2[01245]|3[0-6]|4[1-489]|5[0-59]|6[1-46-9]|7[0-27-9]|8[189]|9[012])\\d{1,2}","\\d{4,5}",,,"12123",,,[4,5]],,,[,,"NA","NA",,,,,,[-1]]],EG:[,[,,"1\\d{4,9}|[2456]\\d{8}|3\\d{7}|[89]\\d{8,9}","\\d{5,10}",,,,,,[5,8,9,10],[7]],[,,"(?:1(?:3[23]\\d|5(?:[23]|9\\d))|2[2-4]\\d{2}|3\\d{2}|4(?:0[2-5]|[578][23]|64)\\d|5(?:0[2-7]|[57][23])\\d|6[24-689]3\\d|8(?:2[2-57]|4[26]|6[237]|8[2-4])\\d|9(?:2[27]|3[24]|52|6[2356]|7[2-4])\\d)\\d{5}|1[69]\\d{3}","\\d{5,9}",,,"234567890",
,,[5,8,9]],[,,"1(?:0[0-269]|1[0-245]|2[0-278])\\d{7}","\\d{10}",,,"1001234567",,,[10]],[,,"800\\d{7}","\\d{10}",,,"8001234567",,,[10]],[,,"900\\d{7}","\\d{10}",,,"9001234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"EG",20,"00","0",,,"0",,,,[[,"(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1[012]|[89]00"],"0$1"],[,"(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|[89][2-9]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,
[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],EH:[,[,,"[5-9]\\d{8}","\\d{9}",,,,,,[9]],[,,"528[89]\\d{5}","\\d{9}",,,"528812345"],[,,"(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[07][07]|6[12]))\\d{6}","\\d{9}",,,"650123456"],[,,"80\\d{7}","\\d{9}",,,"801234567"],[,,"89\\d{7}","\\d{9}",,,"891234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"5924[01]\\d{4}","\\d{9}",,,"592401234"],"EH",212,"00","0",,,"0",,,,,,[,,"NA","NA",,,,,,[-1]],,"528[89]",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],
,,[,,"NA","NA",,,,,,[-1]]],ER:[,[,,"[178]\\d{6}","\\d{6,7}",,,,,,[7],[6]],[,,"1(?:1[12568]|20|40|55|6[146])\\d{4}|8\\d{6}","\\d{6,7}",,,"8370362"],[,,"17[1-3]\\d{4}|7\\d{6}","\\d{7}",,,"7123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"ER",291,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3})","$1 $2 $3",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],ES:[,[,,"[5-9]\\d{8}",
"\\d{9}",,,,,,[9]],[,,"8(?:[13]0|[28][0-8]|[47][1-9]|5[01346-9]|6[0457-9])\\d{6}|9(?:[1238][0-8]\\d{6}|4[1-9]\\d{6}|5\\d{7}|6(?:[0-8]\\d{6}|9(?:0(?:[0-57-9]\\d{4}|6(?:0[0-8]|1[1-9]|[2-9]\\d)\\d{2})|[1-9]\\d{5}))|7(?:[124-9]\\d{2}|3(?:[0-8]\\d|9[1-9]))\\d{4})","\\d{9}",,,"810123456"],[,,"(?:6\\d{6}|7[1-4]\\d{5}|9(?:6906(?:09|10)|7390\\d{2}))\\d{2}","\\d{9}",,,"612345678"],[,,"[89]00\\d{6}","\\d{9}",,,"800123456"],[,,"80[367]\\d{6}","\\d{9}",,,"803123456"],[,,"90[12]\\d{6}","\\d{9}",,,"901123456"],
[,,"70\\d{7}","\\d{9}",,,"701234567"],[,,"NA","NA",,,,,,[-1]],"ES",34,"00",,,,,,,,[[,"([89]00)(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],[,"([5-9]\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[568]|[79][0-8]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"51\\d{7}","\\d{9}",,,"511234567"],,,[,,"NA","NA",,,,,,[-1]]],ET:[,[,,"[1-59]\\d{8}","\\d{7,9}",,,,,,[9],[7]],[,,"(?:11(?:1(?:1[124]|2[2-57]|3[1-5]|5[5-8]|8[6-8])|2(?:13|3[6-8]|5[89]|7[05-9]|8[2-6])|3(?:2[01]|3[0-289]|4[1289]|7[1-4]|87)|4(?:1[69]|3[2-49]|4[0-3]|6[5-8])|5(?:1[578]|44|5[0-4])|6(?:18|2[69]|39|4[5-7]|5[1-5]|6[0-59]|8[015-8]))|2(?:2(?:11[1-9]|22[0-7]|33\\d|44[1467]|66[1-68])|5(?:11[124-6]|33[2-8]|44[1467]|55[14]|66[1-3679]|77[124-79]|880))|3(?:3(?:11[0-46-8]|22[0-6]|33[0134689]|44[04]|55[0-6]|66[01467])|4(?:44[0-8]|55[0-69]|66[0-3]|77[1-5]))|4(?:6(?:22[0-24-7]|33[1-5]|44[13-69]|55[14-689]|660|88[1-4])|7(?:11[1-9]|22[1-9]|33[13-7]|44[13-6]|55[1-689]))|5(?:7(?:227|55[05]|(?:66|77)[14-8])|8(?:11[149]|22[013-79]|33[0-68]|44[013-8]|550|66[1-5]|77\\d)))\\d{4}",
"\\d{7,9}",,,"111112345"],[,,"9(?:[1-468]\\d|5[89])\\d{6}","\\d{9}",,,"911234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"ET",251,"00","0",,,"0",,,,[[,"([1-59]\\d)(\\d{3})(\\d{4})","$1 $2 $3",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],FI:[,[,,"1\\d{4,11}|[2-9]\\d{4,10}","\\d{5,12}",,,,,,[5,6,7,8,9,10,11,12]],[,,"1(?:[3569][1-8]\\d{3,9}|[47]\\d{5,10})|2[1-8]\\d{3,9}|3(?:[1-8]\\d{3,9}|9\\d{4,8})|[5689][1-8]\\d{3,9}",
"\\d{5,12}",,,"1312345678"],[,,"4\\d{5,10}|50\\d{4,8}","\\d{6,11}",,,"412345678",,,[6,7,8,9,10,11]],[,,"800\\d{4,7}","\\d{7,10}",,,"8001234567",,,[7,8,9,10]],[,,"[67]00\\d{5,6}","\\d{8,9}",,,"600123456",,,[8,9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"FI",358,"00|99(?:[02469]|5(?:11|33|5[59]|88|9[09]))","0",,,"0",,"00",,[[,"(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]00|[6-8]0)"],"0$1"],[,"(116\\d{3})","$1",["116"],"$1"],[,"(\\d{2})(\\d{4,10})","$1 $2",["[14]|2[09]|50|7[135]"],
"0$1"],[,"(\\d)(\\d{4,11})","$1 $2",["[25689][1-8]|3"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],1,,[,,"[13]00\\d{3,7}|2(?:0(?:0\\d{3,7}|2[023]\\d{1,6}|9[89]\\d{1,6}))|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}",,,"100123",,,[5,6,7,8,9,10]],[,,"[13]0\\d{4,8}|2(?:0(?:[016-8]\\d{3,7}|[2-59]\\d{2,7})|9\\d{4,8})|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}",,,"10112345",,,[5,6,7,8,9,10]],,,[,,"NA","NA",,,,,,[-1]]],FJ:[,[,,"[36-9]\\d{6}|0\\d{10}",
"\\d{7}(?:\\d{4})?",,,,,,[7,11]],[,,"(?:3[0-5]|6[25-7]|8[58])\\d{5}","\\d{7}",,,"3212345",,,[7]],[,,"(?:7[0-8]|8[034679]|9\\d)\\d{5}","\\d{7}",,,"7012345",,,[7]],[,,"0800\\d{7}","\\d{11}",,,"08001234567",,,[11]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"FJ",679,"0(?:0|52)",,,,,,"00",,[[,"(\\d{3})(\\d{4})","$1 $2",["[36-9]"]],[,"(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],
1,,[,,"NA","NA",,,,,,[-1]]],FK:[,[,,"[2-7]\\d{4}","\\d{5}",,,,,,[5]],[,,"[2-47]\\d{4}","\\d{5}",,,"31234"],[,,"[56]\\d{4}","\\d{5}",,,"51234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"FK",500,"00",,,,,,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],FM:[,[,,"[39]\\d{6}","\\d{7}",,,,,,[7]],[,,"3[2357]0[1-9]\\d{3}|9[2-6]\\d{5}","\\d{7}",,,"3201234"],[,,"3[2357]0[1-9]\\d{3}|9[2-7]\\d{5}",
"\\d{7}",,,"3501234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"FM",691,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],FO:[,[,,"[2-9]\\d{5}","\\d{6}",,,,,,[6]],[,,"(?:20|[3-4]\\d|8[19])\\d{4}","\\d{6}",,,"201234"],[,,"(?:[27][1-9]|5\\d)\\d{4}","\\d{6}",,,"211234"],[,,"80[257-9]\\d{3}","\\d{6}",,,"802123"],[,,"90(?:[1345][15-7]|2[125-7]|99)\\d{2}",
"\\d{6}",,,"901123"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"(?:6[0-36]|88)\\d{4}","\\d{6}",,,"601234"],"FO",298,"00",,,,"(10(?:01|[12]0|88))",,,,[[,"(\\d{6})","$1",,,"$CC $1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],FR:[,[,,"[1-9]\\d{8}","\\d{9}",,,,,,[9]],[,,"[1-5]\\d{8}","\\d{9}",,,"123456789"],[,,"(?:6\\d|7[3-9])\\d{7}","\\d{9}",,,"612345678"],[,,"80[0-5]\\d{6}","\\d{9}",,,"801234567"],[,,"89[1-37-9]\\d{6}","\\d{9}",,,
"891123456"],[,,"8(?:1[019]|2[0156]|84|90)\\d{6}","\\d{9}",,,"810123456"],[,,"NA","NA",,,,,,[-1]],[,,"9\\d{8}","\\d{9}",,,"912345678"],"FR",33,"00","0",,,"0",,,,[[,"([1-79])(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"],[,"(1\\d{2})(\\d{3})","$1 $2",["11"],"$1"],[,"(8\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"]],[[,"([1-79])(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"],[,"(8\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"]],[,
,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"80[6-9]\\d{6}","\\d{9}",,,"806123456"],,,[,,"NA","NA",,,,,,[-1]]],GA:[,[,,"0?\\d{7}","\\d{7,8}",,,,,,[7,8]],[,,"01\\d{6}","\\d{8}",,,"01441234",,,[8]],[,,"0?[2-7]\\d{6}","\\d{7,8}",,,"06031234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"GA",241,"00",,,,,,,,[[,"(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",
["0"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],GB:[,[,,"\\d{7,10}","\\d{4,10}",,,,,,[7,9,10],[4,5,6,8]],[,,"2(?:0[01378]|3[0189]|4[017]|8[0-46-9]|9[012])\\d{7}|1(?:(?:1(?:3[0-48]|[46][0-4]|5[012789]|7[0-49]|8[01349])|21[0-7]|31[0-8]|[459]1\\d|61[0-46-9]))\\d{6}|1(?:2(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-4789]|7[013-9]|9\\d)|3(?:0\\d|[25][02-9]|3[02-579]|[468][0-46-9]|7[1235679]|9[24578])|4(?:0[03-9]|[28][02-5789]|[37]\\d|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1235-9]|2[024-9]|3[015689]|4[02-9]|5[03-9]|6\\d|7[0-35-9]|8[0-468]|9[0-5789])|6(?:0[034689]|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0124578])|7(?:0[0246-9]|2\\d|3[023678]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-5789]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|2[02-689]|3[1-5789]|4[2-9]|5[0-579]|6[234789]|7[0124578]|8\\d|9[2-57]))\\d{6}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-4789]|8[345])))|3(?:638[2-5]|647[23]|8(?:47[04-9]|64[015789]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[123]))|5(?:24(?:3[2-79]|6\\d)|276\\d|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[567]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|955[0-4])|7(?:26(?:6[13-9]|7[0-7])|442\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|84(?:3[2-58]))|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}|176888[234678]\\d{2}|16977[23]\\d{3}",
"\\d{4,10}",,,"1212345678",,,[9,10]],[,,"7(?:[1-4]\\d\\d|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[04-9]\\d|1[02-9]|2[0-35-9]|3[0-689]))\\d{6}","\\d{10}",,,"7400123456",,,[10]],[,,"80(?:0(?:1111|\\d{6,7})|8\\d{7})|500\\d{6}","\\d{7}(?:\\d{2,3})?",,,"8001234567"],[,,"(?:87[123]|9(?:[01]\\d|8[2349]))\\d{7}","\\d{10}",,,"9012345678",,,[10]],[,,"8(?:4(?:5464\\d|[2-5]\\d{7})|70\\d{7})","\\d{7}(?:\\d{3})?",,,"8431234567",,,[7,10]],[,,"70\\d{8}",
"\\d{10}",,,"7012345678",,,[10]],[,,"56\\d{8}","\\d{10}",,,"5612345678",,,[10]],"GB",44,"00","0"," x",,"0",,,,[[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2|5[56]|7(?:0|6[013-9])","2|5[56]|7(?:0|6(?:[013-9]|2[0-35-9]))"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:1|\\d1)|3|9[018]"],"0$1"],[,"(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:387|5(?:24|39)|697|768|946)","1(?:3873|5(?:242|39[456])|697[347]|768[347]|9467)"],"0$1"],[,"(1\\d{3})(\\d{5,6})","$1 $2",["1"],"0$1"],[,"(7\\d{3})(\\d{6})",
"$1 $2",["7(?:[1-5789]|62)","7(?:[1-5789]|624)"],"0$1"],[,"(800)(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],[,"(845)(46)(4\\d)","$1 $2 $3",["845","8454","84546","845464"],"0$1"],[,"(8\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8(?:4[2-5]|7[0-3])"],"0$1"],[,"(80\\d)(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1"],[,"([58]00)(\\d{6})","$1 $2",["[58]00"],"0$1"]],,[,,"76(?:0[012]|2[356]|4[0134]|5[49]|6[0-369]|77|81|9[39])\\d{6}","\\d{10}",,,"7640123456",,,[10]],1,,[,,"NA","NA",,,,,,[-1]],[,
,"(?:3[0347]|55)\\d{8}","\\d{10}",,,"5512345678",,,[10]],,,[,,"NA","NA",,,,,,[-1]]],GD:[,[,,"[4589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"473(?:2(?:3[0-2]|69)|3(?:2[89]|86)|4(?:[06]8|3[5-9]|4[0-49]|5[5-79]|68|73|90)|63[68]|7(?:58|84)|800|938)\\d{4}","\\d{7}(?:\\d{3})?",,,"4732691234"],[,,"473(?:4(?:0[2-79]|1[04-9]|20|58)|5(?:2[01]|3[3-8])|901)\\d{4}","\\d{7}(?:\\d{3})?",,,"4734031234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],
[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"GD",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"473",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GE:[,[,,"[34578]\\d{8}","\\d{6,9}",,,,,,[9],[6]],[,,"(?:3(?:[256]\\d|4[124-9]|7[0-4])|4(?:1\\d|2[2-7]|3[1-79]|4[2-8]|7[239]|9[1-7]))\\d{6}","\\d{6,9}",,,"322123456"],[,,"5(?:14|5[01578]|68|7[0147-9]|9[0-35-9])\\d{6}","\\d{9}",,,"555123456"],[,,"800\\d{6}",
"\\d{9}",,,"800123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"706\\d{6}","\\d{9}",,,"706123456"],"GE",995,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5"],"$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"706\\d{6}","\\d{9}",,,"706123456"],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GF:[,[,,"[56]\\d{8}","\\d{9}",,,,,,[9]],
[,,"594(?:10|2[012457-9]|3[0-57-9]|4[3-9]|5[7-9]|6[0-3]|9[014])\\d{4}","\\d{9}",,,"594101234"],[,,"694(?:[04][0-7]|1[0-5]|3[018]|[29]\\d)\\d{4}","\\d{9}",,,"694201234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"GF",594,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GG:[,[,,"[135789]\\d{6,9}",
"\\d{6,10}",,,,,,[7,9,10],[6]],[,,"1481\\d{6}","\\d{6,10}",,,"1481456789",,,[10]],[,,"7(?:781|839|911)\\d{6}","\\d{10}",,,"7781123456",,,[10]],[,,"80(?:0(?:1111|\\d{6,7})|8\\d{7})|500\\d{6}","\\d{7}(?:\\d{2,3})?",,,"8001234567"],[,,"(?:87[123]|9(?:[01]\\d|8[0-3]))\\d{7}","\\d{10}",,,"9012345678",,,[10]],[,,"8(?:4(?:5464\\d|[2-5]\\d{7})|70\\d{7})","\\d{7}(?:\\d{3})?",,,"8431234567",,,[7,10]],[,,"70\\d{8}","\\d{10}",,,"7012345678",,,[10]],[,,"56\\d{8}","\\d{10}",,,"5612345678",,,[10]],"GG",44,"00",
"0"," x",,"0",,,,,,[,,"76(?:0[012]|2[356]|4[0134]|5[49]|6[0-369]|77|81|9[39])\\d{6}","\\d{10}",,,"7640123456",,,[10]],,,[,,"NA","NA",,,,,,[-1]],[,,"(?:3[0347]|55)\\d{8}","\\d{10}",,,"5512345678",,,[10]],,,[,,"NA","NA",,,,,,[-1]]],GH:[,[,,"[235]\\d{8}|8\\d{7}","\\d{7,9}",,,,,,[8,9],[7]],[,,"3(?:0[237]\\d|[167](?:2[0-6]|7\\d)|2(?:2[0-5]|7\\d)|3(?:2[0-3]|7\\d)|4(?:2[013-9]|3[01]|7\\d)|5(?:2[0-7]|7\\d)|8(?:2[0-2]|7\\d)|9(?:20|7\\d))\\d{5}","\\d{7,9}",,,"302345678",,,[9]],[,,"(?:2[034678]\\d|5(?:[047]\\d|5[3-6]|6[01]))\\d{6}",
"\\d{9}",,,"231234567",,,[9]],[,,"800\\d{5}","\\d{8}",,,"80012345",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"GH",233,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"],[,"(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"800\\d{5}","\\d{8}",,,"80012345",,,[8]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GI:[,[,,"[2568]\\d{7}","\\d{8}",,,,,,[8]],[,,"2(?:00\\d|1(?:6[24-7]|9\\d)|2(?:00|2[2457]))\\d{4}",
"\\d{8}",,,"20012345"],[,,"(?:5[46-8]|62)\\d{6}","\\d{8}",,,"57123456"],[,,"80\\d{6}","\\d{8}",,,"80123456"],[,,"8[1-689]\\d{6}","\\d{8}",,,"88123456"],[,,"87\\d{6}","\\d{8}",,,"87123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"GI",350,"00",,,,,,,,[[,"(\\d{3})(\\d{5})","$1 $2",["2"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GL:[,[,,"[1-689]\\d{5}","\\d{6}",,,,,,[6]],[,,"(?:19|3[1-6]|6[14689]|8[14-79]|9\\d)\\d{4}","\\d{6}",,,"321000"],
[,,"[245][2-9]\\d{4}","\\d{6}",,,"221234"],[,,"80\\d{4}","\\d{6}",,,"801234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"3[89]\\d{4}","\\d{6}",,,"381234"],"GL",299,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GM:[,[,,"[2-9]\\d{6}","\\d{7}",,,,,,[7]],[,,"(?:4(?:[23]\\d{2}|4(?:1[024679]|[6-9]\\d))|5(?:54[0-7]|6(?:[67]\\d)|7(?:1[04]|2[035]|3[58]|48))|8\\d{3})\\d{3}",
"\\d{7}",,,"5661234"],[,,"[23679]\\d{6}","\\d{7}",,,"3012345"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"GM",220,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GN:[,[,,"[367]\\d{7,8}","\\d{8,9}",,,,,,[8,9]],[,,"30(?:24|3[12]|4[1-35-7]|5[13]|6[189]|[78]1|9[1478])\\d{4}","\\d{8}",,,"30241234",,,[8]],[,,"6[02356]\\d{7}","\\d{9}",
,,"601123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"722\\d{6}","\\d{9}",,,"722123456",,,[9]],"GN",224,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GP:[,[,,"[56]\\d{8}","\\d{9}",,,,,,[9]],[,,"590(?:0[13468]|1[012]|2[0-68]|3[28]|4[0-8]|5[579]|6[0189]|70|8[0-689]|9\\d)\\d{4}",
"\\d{9}",,,"590201234"],[,,"690(?:0[0-7]|[1-9]\\d)\\d{4}","\\d{9}",,,"690301234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"GP",590,"00","0",,,"0",,,,[[,"([56]90)(\\d{2})(\\d{4})","$1 $2-$3",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GQ:[,[,,"[23589]\\d{8}","\\d{9}",,,,,,[9]],[,,"3(?:3(?:3\\d[7-9]|[0-24-9]\\d[46])|5\\d{2}[7-9])\\d{4}","\\d{9}",,,"333091234"],
[,,"(?:222|55[15])\\d{6}","\\d{9}",,,"222123456"],[,,"80\\d[1-9]\\d{5}","\\d{9}",,,"800123456"],[,,"90\\d[1-9]\\d{5}","\\d{9}",,,"900123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"GQ",240,"00",,,,,,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],[,"(\\d{3})(\\d{6})","$1 $2",["[89]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GR:[,[,,"[26-9]\\d{9}","\\d{10}",,,,,,[10]],[,,"2(?:1\\d{2}|2(?:2[1-46-9]|3[1-8]|4[1-7]|5[1-4]|6[1-8]|7[1-5]|[89][1-9])|3(?:1\\d|2[1-57]|[35][1-3]|4[13]|7[1-7]|8[124-6]|9[1-79])|4(?:1\\d|2[1-8]|3[1-4]|4[13-5]|6[1-578]|9[1-5])|5(?:1\\d|[29][1-4]|3[1-5]|4[124]|5[1-6])|6(?:1\\d|3[1245]|4[1-7]|5[13-9]|[269][1-6]|7[14]|8[1-5])|7(?:1\\d|2[1-5]|3[1-6]|4[1-7]|5[1-57]|6[135]|9[125-7])|8(?:1\\d|2[1-5]|[34][1-4]|9[1-57]))\\d{6}",
"\\d{10}",,,"2123456789"],[,,"69\\d{8}","\\d{10}",,,"6912345678"],[,,"800\\d{7}","\\d{10}",,,"8001234567"],[,,"90[19]\\d{7}","\\d{10}",,,"9091234567"],[,,"8(?:0[16]|12|25)\\d{7}","\\d{10}",,,"8011234567"],[,,"70\\d{8}","\\d{10}",,,"7012345678"],[,,"NA","NA",,,,,,[-1]],"GR",30,"00",,,,,,,,[[,"([27]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["2[2-9]1|[689]"]],[,"(2\\d{3})(\\d{6})","$1 $2",["2[2-9][02-9]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,
,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GT:[,[,,"[2-7]\\d{7}|1[89]\\d{9}","\\d{8}(?:\\d{3})?",,,,,,[8,11]],[,,"[267][2-9]\\d{6}","\\d{8}",,,"22456789",,,[8]],[,,"[345]\\d{7}","\\d{8}",,,"51234567",,,[8]],[,,"18[01]\\d{8}","\\d{11}",,,"18001112222",,,[11]],[,,"19\\d{9}","\\d{11}",,,"19001112222",,,[11]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"GT",502,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2",["[2-7]"]],[,"(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]],,[,,"NA",
"NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GU:[,[,,"[5689]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:56|7[1-9]|8[236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[5-9])|7(?:[079]7|2[0167]|3[45]|47|8[789])|8(?:[2-5789]8|6[48])|9(?:2[29]|6[79]|7[179]|8[789]|9[78]))\\d{4}","\\d{7}(?:\\d{3})?",,,"6713001234"],[,,"671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:56|7[1-9]|8[236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[5-9])|7(?:[079]7|2[0167]|3[45]|47|8[789])|8(?:[2-5789]8|6[48])|9(?:2[29]|6[79]|7[179]|8[789]|9[78]))\\d{4}",
"\\d{7}(?:\\d{3})?",,,"6713001234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"GU",1,"011","1",,,"1",,,1,,,[,,"NA","NA",,,,,,[-1]],,"671",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GW:[,[,,"(?:4(?:0\\d{5}|4\\d{7})|9\\d{8})","\\d{7,9}",,,,,,[7,9]],[,,"443(?:2[0125]|3[1245]|4[12]|5[1-4]|70|9[1-467])\\d{4}",
"\\d{9}",,,"443201234",,,[9]],[,,"9(?:55\\d|6(?:6\\d|9[012])|77\\d)\\d{5}","\\d{9}",,,"955012345",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"40\\d{5}","\\d{7}",,,"4012345",,,[7]],"GW",245,"00",,,,,,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["44|9[567]"]],[,"(\\d{3})(\\d{4})","$1 $2",["40"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],GY:[,[,,"[2-4679]\\d{6}","\\d{7}",,,,,,[7]],
[,,"(?:2(?:1[6-9]|2[0-35-9]|3[1-4]|5[3-9]|6\\d|7[0-24-79])|3(?:2[25-9]|3\\d)|4(?:4[0-24]|5[56])|77[1-57])\\d{4}","\\d{7}",,,"2201234"],[,,"6\\d{6}","\\d{7}",,,"6091234"],[,,"(?:289|862)\\d{4}","\\d{7}",,,"2891234"],[,,"9008\\d{3}","\\d{7}",,,"9008123"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"GY",592,"001",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],HK:[,[,,"[235-7]\\d{7}|8\\d{7,8}|9\\d{4,10}",
"\\d{5,11}",,,,,,[5,6,7,8,9,11]],[,,"(?:[23]\\d|58)\\d{6}","\\d{8}",,,"21234567",,,[8]],[,,"(?:5[1-79]\\d|6\\d{2}|8[4-79]\\d|9(?:0[1-9]|[1-8]\\d))\\d{5}","\\d{8}",,,"51234567",,,[8]],[,,"800\\d{6}","\\d{9}",,,"800123456",,,[9]],[,,"900(?:[0-24-9]\\d{7}|3\\d{1,4})","\\d{5,11}",,,"90012345678",,,[5,6,7,8,11]],[,,"NA","NA",,,,,,[-1]],[,,"8[1-3]\\d{6}","\\d{8}",,,"81123456",,,[8]],[,,"NA","NA",,,,,,[-1]],"HK",852,"00(?:[126-9]|30|5[09])?",,,,,,"00",,[[,"(\\d{4})(\\d{4})","$1 $2",["[235-7]|[89](?:0[1-9]|[1-9])"]],
[,"(800)(\\d{3})(\\d{3})","$1 $2 $3",["800"]],[,"(900)(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["900"]],[,"(900)(\\d{2,5})","$1 $2",["900"]]],,[,,"7\\d{7}","\\d{8}",,,"71234567",,,[8]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],HN:[,[,,"[237-9]\\d{7}","\\d{8}",,,,,,[8]],[,,"2(?:2(?:0[019]|1[1-36]|[23]\\d|4[056]|5[57]|7[01389]|8[0146-9]|9[012])|4(?:07|2[3-59]|3[13-689]|4[0-68]|5[1-35])|5(?:16|4[3-5]|5\\d|6[4-6]|74)|6(?:[056]\\d|17|3[04]|4[0-378]|[78][0-8]|9[01])|7(?:6[46-9]|7[02-9]|8[034])|8(?:79|8[0-35789]|9[1-57-9]))\\d{4}",
"\\d{8}",,,"22123456"],[,,"[37-9]\\d{7}","\\d{8}",,,"91234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"HN",504,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1-$2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],HR:[,[,,"[1-7]\\d{5,8}|[89]\\d{6,11}","\\d{6,12}",,,,,,[6,7,8,9,10,11,12]],[,,"1\\d{7}|(?:2[0-3]|3[1-5]|4[02-47-9]|5[1-3])\\d{6,7}","\\d{6,9}",,,"12345678",,,[8,9]],
[,,"9(?:[1-9]\\d{6,10}|01\\d{6,9})","\\d{8,12}",,,"912345678",,,[8,9,10,11,12]],[,,"80[01]\\d{4,7}","\\d{7,10}",,,"8001234567",,,[7,8,9,10]],[,,"6(?:[01459]\\d{4,7})","\\d{6,9}",,,"611234",,,[6,7,8,9]],[,,"NA","NA",,,,,,[-1]],[,,"7[45]\\d{4,7}","\\d{6,9}",,,"741234567",,,[6,7,8,9]],[,,"NA","NA",,,,,,[-1]],"HR",385,"00","0",,,"0",,,,[[,"(1)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],[,"(6[09])(\\d{4})(\\d{3})","$1 $2 $3",["6[09]"],"0$1"],[,"([67]2)(\\d{3})(\\d{3,4})","$1 $2 $3",["[67]2"],"0$1"],[,"([2-5]\\d)(\\d{3})(\\d{3,4})",
"$1 $2 $3",["[2-5]"],"0$1"],[,"(9\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],[,"(9\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9"],"0$1"],[,"(9\\d)(\\d{3,4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"],"0$1"],[,"(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[0145]|7"],"0$1"],[,"(\\d{2})(\\d{3,4})(\\d{3})","$1 $2 $3",["6[0145]|7"],"0$1"],[,"(80[01])(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],[,"(80[01])(\\d{3,4})(\\d{3})","$1 $2 $3",["8"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"[76]2\\d{6,7}",
"\\d{8,9}",,,"62123456",,,[8,9]],,,[,,"NA","NA",,,,,,[-1]]],HT:[,[,,"[2-489]\\d{7}","\\d{8}",,,,,,[8]],[,,"2(?:[248]\\d|5[1-5]|94)\\d{5}","\\d{8}",,,"22453300"],[,,"(?:3[1-9]\\d|4\\d{2}|9(?:8[0-35]|9[5-9]))\\d{5}","\\d{8}",,,"34101234"],[,,"8\\d{7}","\\d{8}",,,"80012345"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"98[89]\\d{5}","\\d{8}",,,"98901234"],"HT",509,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],
[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],HU:[,[,,"[1-9]\\d{7,8}","\\d{6,9}",,,,,,[8,9],[6]],[,,"(?:1\\d|2[2-9]|3[2-7]|4[24-9]|5[2-79]|6[23689]|7[2-9]|8[2-57-9]|9[2-69])\\d{6}","\\d{6,8}",,,"12345678",,,[8]],[,,"(?:[257]0|3[01])\\d{7}","\\d{9}",,,"201234567",,,[9]],[,,"[48]0\\d{6}","\\d{8}",,,"80123456",,,[8]],[,,"9[01]\\d{6}","\\d{8}",,,"90123456",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"21\\d{7}","\\d{9}",,,"211234567",,,[9]],"HU",36,"00","06",,,"06",,,,[[,"(1)(\\d{3})(\\d{4})",
"$1 $2 $3",["1"],"($1)"],[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"($1)"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"[48]0\\d{6}","\\d{8}",,,"80123456",,,[8]],[,,"38\\d{7}","\\d{6,9}",,,"381234567",,,[9]],,,[,,"NA","NA",,,,,,[-1]]],ID:[,[,,"(?:[1-79]\\d{6,10}|8\\d{7,11})","\\d{5,12}",,,,,,[7,8,9,10,11,12],[5,6]],[,,"2(?:1(?:14\\d{3}|[0-8]\\d{6,7}|500\\d{3}|9\\d{6})|2\\d{6,8}|4\\d{7,8})|(?:2(?:[35][1-4]|6[0-8]|7[1-6]|8\\d|9[1-8])|3(?:1|[25][1-8]|3[1-68]|4[1-3]|6[1-3568]|7[0-469]|8\\d)|4(?:0[1-589]|1[01347-9]|2[0-36-8]|3[0-24-68]|43|5[1-378]|6[1-5]|7[134]|8[1245])|5(?:1[1-35-9]|2[25-8]|3[124-9]|4[1-3589]|5[1-46]|6[1-8])|6(?:19?|[25]\\d|3[1-69]|4[1-6])|7(?:02|[125][1-9]|[36]\\d|4[1-8]|7[0-36-9])|9(?:0[12]|1[013-8]|2[0-479]|5[125-8]|6[23679]|7[159]|8[01346]))\\d{5,8}",
"\\d{5,11}",,,"612345678",,,[7,8,9,10,11]],[,,"(?:2(?:1(?:3[145]|4[01]|5[1-469]|60|8[0359]|9\\d)|2(?:88|9[1256])|3[1-4]9|4(?:36|91)|5(?:1[349]|[2-4]9)|6[0-7]9|7(?:[1-36]9|4[39])|8[1-5]9|9[1-48]9)|3(?:19[1-3]|2[12]9|3[13]9|4(?:1[69]|39)|5[14]9|6(?:1[69]|2[89])|709)|4[13]19|5(?:1(?:19|8[39])|4[129]9|6[12]9)|6(?:19[12]|2(?:[23]9|77))|7(?:1[13]9|2[15]9|419|5(?:1[89]|29)|6[15]9|7[178]9))\\d{5,6}|8[1-35-9]\\d{7,10}","\\d{9,12}",,,"812345678",,,[9,10,11,12]],[,,"177\\d{6,8}|800\\d{5,7}","\\d{8,11}",,,"8001234567",
,,[8,9,10,11]],[,,"809\\d{7}","\\d{10}",,,"8091234567",,,[10]],[,,"804\\d{7}","\\d{10}",,,"8041234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"ID",62,"0(?:0[1789]|10(?:00|1[67]))","0",,,"0",,,,[[,"(\\d{2})(\\d{5,8})","$1 $2",["2[124]|[36]1"],"(0$1)"],[,"(\\d{3})(\\d{5,8})","$1 $2",["[4579]|2[035-9]|[36][02-9]"],"(0$1)"],[,"(8\\d{2})(\\d{3,4})(\\d{3,5})","$1-$2-$3",["8[1-35-9]"],"0$1"],[,"(1)(500)(\\d{3})","$1 $2 $3",["15"],"$1"],[,"(177)(\\d{6,8})","$1 $2",["17"],"0$1"],[,"(800)(\\d{5,7})",
"$1 $2",["800"],"0$1"],[,"(804)(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],[,"(80\\d)(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80[79]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"8071\\d{6}","\\d{10}",,,"8071123456",,,[10]],[,,"1500\\d{3}|8071\\d{6}","\\d{7,10}",,,"8071123456",,,[7,10]],,,[,,"NA","NA",,,,,,[-1]]],IE:[,[,,"[124-9]\\d{6,9}","\\d{5,10}",,,,,,[7,8,9,10],[5,6]],[,,"1\\d{7,8}|2(?:1\\d{6,7}|3\\d{7}|[24-9]\\d{5})|4(?:0[24]\\d{5}|[1-469]\\d{7}|5\\d{6}|7\\d{5}|8[0-46-9]\\d{7})|5(?:0[45]\\d{5}|1\\d{6}|[23679]\\d{7}|8\\d{5})|6(?:1\\d{6}|[237-9]\\d{5}|[4-6]\\d{7})|7[14]\\d{7}|9(?:1\\d{6}|[04]\\d{7}|[35-9]\\d{5})",
"\\d{5,10}",,,"2212345"],[,,"8(?:22\\d{6}|[35-9]\\d{7})","\\d{9}",,,"850123456",,,[9]],[,,"1800\\d{6}","\\d{10}",,,"1800123456",,,[10]],[,,"15(?:1[2-8]|[2-8]0|9[089])\\d{6}","\\d{10}",,,"1520123456",,,[10]],[,,"18[59]0\\d{6}","\\d{10}",,,"1850123456",,,[10]],[,,"700\\d{6}","\\d{9}",,,"700123456",,,[9]],[,,"76\\d{7}","\\d{9}",,,"761234567",,,[9]],"IE",353,"00","0",,,"0",,,,[[,"(1)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],[,"(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],
[,"(\\d{3})(\\d{5})","$1 $2",["40[24]|50[45]"],"(0$1)"],[,"(48)(\\d{4})(\\d{4})","$1 $2 $3",["48"],"(0$1)"],[,"(818)(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[24-69]|7[14]"],"(0$1)"],[,"([78]\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["76|8[35-9]"],"0$1"],[,"(700)(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],[,"(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:8[059]|5)","1(?:8[059]0|5)"],"$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"18[59]0\\d{6}","\\d{10}",,,"1850123456",,,
[10]],[,,"818\\d{6}","\\d{9}",,,"818123456",,,[9]],,,[,,"8[35-9]\\d{8}","\\d{10}",,,"8501234567",,,[10]]],IL:[,[,,"[17]\\d{6,9}|[2-589]\\d{3}(?:\\d{3,6})?|6\\d{3}","\\d{4,10}",,,,,,[4,7,8,9,10]],[,,"[2-489]\\d{7}","\\d{7,8}",,,"21234567",,,[8]],[,,"5(?:[02-47-9]\\d{2}|5(?:01|2[23]|3[2-4]|4[45]|5[5689]|6[67]|7[0178]|8[6-9]|9[4-9])|6[2-9]\\d)\\d{5}","\\d{9}",,,"501234567",,,[9]],[,,"1(?:80[019]\\d{3}|255)\\d{3}","\\d{7,10}",,,"1800123456",,,[7,10]],[,,"1(?:212|(?:9(?:0[01]|19)|200)\\d{2})\\d{4}","\\d{8,10}",
,,"1919123456",,,[8,9,10]],[,,"1700\\d{6}","\\d{10}",,,"1700123456",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"7(?:18\\d|2[23]\\d|3[237]\\d|47\\d|6(?:5\\d|8[0168])|7\\d{2}|8(?:2\\d|33|55|77|81)|9[29]\\d)\\d{5}","\\d{9}",,,"771234567",,,[9]],"IL",972,"0(?:0|1[2-9])","0",,,"0",,,,[[,"([2-489])(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],[,"([57]\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],[,"(1)([7-9]\\d{2})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"],"$1"],[,"(1255)(\\d{3})","$1-$2",["125"],"$1"],[,
"(1200)(\\d{3})(\\d{3})","$1-$2-$3",["120"],"$1"],[,"(1212)(\\d{2})(\\d{2})","$1-$2-$3",["121"],"$1"],[,"(1599)(\\d{6})","$1-$2",["15"],"$1"],[,"(\\d{4})","*$1",["[2-689]"],"$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"1700\\d{6}|[2-689]\\d{3}","\\d{4,10}",,,"1700123456",,,[4,10]],[,,"[2-689]\\d{3}|1599\\d{6}","\\d{4}(?:\\d{6})?",,,"1599123456",,,[4,10]],,,[,,"NA","NA",,,,,,[-1]]],IM:[,[,,"[135789]\\d{6,9}","\\d{6,10}",,,,,,[10],[6]],[,,"1624\\d{6}","\\d{6,10}",,,"1624456789"],[,,"7[569]24\\d{6}","\\d{10}",
,,"7924123456"],[,,"808162\\d{4}","\\d{10}",,,"8081624567"],[,,"(?:872299|90[0167]624)\\d{4}","\\d{10}",,,"9016247890"],[,,"8(?:4(?:40[49]06|5624\\d)|70624\\d)\\d{3}","\\d{10}",,,"8456247890"],[,,"70\\d{8}","\\d{10}",,,"7012345678"],[,,"56\\d{8}","\\d{10}",,,"5612345678"],"IM",44,"00","0"," x",,"0",,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"3(?:08162\\d|3\\d{5}|4(?:40[49]06|5624\\d)|7(?:0624\\d|2299\\d))\\d{3}|55\\d{8}","\\d{10}",,,"5512345678"],,,[,,"NA","NA",,,,,,[-1]]],IN:[,[,,
"008\\d{9}|1\\d{7,12}|[2-9]\\d{9,10}","\\d{6,13}",,,,,,[8,9,10,11,12,13],[6,7]],[,,"(?:11|2[02]|33|4[04]|79)[2-7]\\d{7}|80[2-467]\\d{7}|(?:1(?:2[0-249]|3[0-25]|4[145]|[59][14]|6[014]|7[1257]|8[01346])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|[36][25]|22|4[28]|5[12]|[78]1|9[15])|6(?:12|[2345]1|57|6[13]|7[14]|80)|7(?:12|2[14]|3[134]|4[47]|5[15]|[67]1|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91))[2-7]\\d{6}|(?:(?:1(?:2[35-8]|3[346-9]|4[236-9]|[59][0235-9]|6[235-9]|7[34689]|8[257-9])|2(?:1[134689]|3[24-8]|4[2-8]|5[25689]|6[2-4679]|7[13-79]|8[2-479]|9[235-9])|3(?:01|1[79]|2[1-5]|4[25-8]|5[125689]|6[235-7]|7[157-9]|8[2-467])|4(?:1[14578]|2[5689]|3[2-467]|5[4-7]|6[35]|73|8[2689]|9[2389])|5(?:[16][146-9]|2[14-8]|3[1346]|4[14-69]|5[46]|7[2-4]|8[2-8]|9[246])|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|[57][2-689]|6[24-578]|8[1-6])|8(?:1[1357-9]|2[235-8]|3[03-57-9]|4[0-24-9]|5\\d|6[2457-9]|7[1-6]|8[1256]|9[2-4]))\\d|7(?:(?:1[013-9]|2[0235-9]|3[2679]|4[1-35689]|5[2-46-9]|[67][02-9]|9\\d)\\d|8(?:2[0-6]|[013-8]\\d)))[2-7]\\d{5}",
"\\d{6,10}",,,"1123456789",,,[10]],[,,"(?:7(?:0\\d{3}|2(?:[0235679]\\d{2}|[14][017-9]\\d|8(?:[0-59]\\d|6[089]|78)|9[389]\\d)|3(?:[05-8]\\d{2}|1(?:[089]\\d|7[5-8])|2(?:[5-8]\\d|[01][089])|3(?:07|[17-9]\\d)|4(?:[07-9]\\d|11)|9(?:[01689]\\d|59|70))|4(?:0[1-9]\\d|1(?:[015-9]\\d|2[089]|4[08])|2(?:09|[1-7][089]|[89]\\d)|3(?:[0-8][089]|9\\d)|4(?:[089]\\d|11|7[02-8])|5(?:0[089]|[59]9)|7(?:0[3-9]|11|7[02-8]|[89]\\d)|8(?:[0-24-7][089]|[389]\\d)|9(?:[0-6][089]|7[08]|[89]\\d))|5(?:[034678]\\d|2[03-9]|5[017-9]|9[7-9])\\d|6(?:0[0-47]|1[0-257-9]|2[0-4]|3[19]|5[4589]|[6-9]\\d)\\d|7(?:0[2-9]|[1-79]\\d|8[1-9])\\d|8(?:[0-79]\\d{2}|88[01])|99[4-9]\\d)|8(?:0(?:[01589]\\d|6[67])|1(?:[02-57-9]\\d|1[0135-9])|2(?:[236-9]\\d|5[1-9])|3(?:[0357-9]\\d|4[1-9])|[45]\\d{2}|6[02457-9]\\d|7(?:07|[1-69]\\d)|8(?:[0-26-9]\\d|44|5[2-9])|9(?:[035-9]\\d|2[2-9]|4[0-8]))\\d|9\\d{4})\\d{5}",
"\\d{10}",,,"9987654321",,,[10]],[,,"00800\\d{7}|1(?:600\\d{6}|80(?:0\\d{4,9}|3\\d{9}))","\\d{8,13}",,,"1800123456"],[,,"186[12]\\d{9}","\\d{13}",,,"1861123456789",,,[13]],[,,"1860\\d{7}","\\d{11}",,,"18603451234",,,[11]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"IN",91,"00","0",,,"0",,,,[[,"(\\d{5})(\\d{5})","$1 $2",["7(?:[023578]|4[0-57-9]|6[0-35-9]|99)|8(?:0[015689]|1[0-57-9]|2[2356-9]|3[0-57-9]|[45]|6[02457-9]|7[01-69]|8[0-24-9]|9[02-9])|9","7(?:[08]|2(?:[0235679]|[14][017-9]|8[0-79]|9[389])|3(?:[05-8]|1[07-9]|2[015-8]|[34][017-9]|9[015-9])|4(?:0[1-9]|1[0-24-9]|[2389]|[47][017-9]|5[059])|5(?:[034678]|2[03-9]|5[017-9]|9[7-9])|6(?:0[0-47]|1[0-257-9]|2[0-4]|3[19]|5[4589]|[6-9])|7(?:0[2-9]|[1-79]|8[1-9])|99[4-9])|8(?:0(?:[01589]|6[67])|1(?:[02-57-9]|1[0135-9])|2(?:[236-9]|5[1-9])|3(?:[0357-9]|4[1-9])|[45]|6[02457-9]|7(?:07|[1-69])|8(?:[0-26-9]|44|5[2-9])|9(?:[035-9]|2[2-9]|4[0-8]))|9",
"7(?:0|2(?:[0235679]|[14][017-9]|8(?:[0-569]|78)|9[389])|3(?:[05-8]|1(?:[089]|7[5-9])|2(?:[5-8]|[01][089])|3[017-9]|4(?:[07-9]|11)|9(?:[01689]|59|70))|4(?:0[1-9]|1(?:[015-9]|2[089]|4[08])|2(?:09|[1-7][089]|[89])|3(?:[0-8][089]|9)|4(?:[089]|11|7[02-8])|5(?:0[089]|[59]9)|7(?:0[3-9]|11|7[02-8]|[89])|8(?:[0-24-7][089]|[389])|9(?:[0-6][089]|7[08]|[89]))|5(?:[034678]|2[03-9]|5[017-9]|9[7-9])|6(?:0[0-47]|1[0-257-9]|2[0-4]|3[19]|5[4589]|[6-9])|7(?:0[2-9]|[1-79]|8[1-9])|8(?:[0-79]|88[01])|99[4-9])|8(?:0(?:[01589]|6[67])|1(?:[02-57-9]|1[0135-9])|2(?:[236-9]|5[1-9])|3(?:[0357-9]|4[1-9])|[45]|6[02457-9]|7(?:07|[1-69])|8(?:[0-26-9]|44|5[2-9])|9(?:[035-9]|2[2-9]|4[0-8]))|9"],
"0$1",,1],[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79|80[2-46]"],"0$1",,1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[569][14]|7[1257]|8[1346]|[68][1-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|[36][25]|22|4[28]|5[12]|[78]1|9[15])|6(?:12|[2345]1|57|6[13]|7[14]|80)"],"0$1",,1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",
["7(?:12|2[14]|3[134]|4[47]|5[15]|[67]1|88)","7(?:12|2[14]|3[134]|4[47]|5(?:1|5[2-6])|[67]1|88)"],"0$1",,1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)"],"0$1",,1],[,"(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[23579]|[468][1-9])|[2-8]"],"0$1",,1],[,"(\\d{2})(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3 $4",["008"],"0$1",,1],[,"(1600)(\\d{2})(\\d{4})","$1 $2 $3",["160","1600"],"$1",,1],[,"(1800)(\\d{4,5})","$1 $2",["180","1800"],"$1",,1],[,"(18[06]0)(\\d{2,4})(\\d{4})",
"$1 $2 $3",["18[06]","18[06]0"],"$1",,1],[,"(140)(\\d{3})(\\d{4})","$1 $2 $3",["140"],"$1",,1],[,"(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18[06]","18(?:0[03]|6[12])"],"$1",,1]],,[,,"NA","NA",,,,,,[-1]],,,[,,"00800\\d{7}|1(?:600\\d{6}|8(?:0(?:0\\d{4,9}|3\\d{9})|6(?:0\\d{7}|[12]\\d{9})))","\\d{8,13}",,,"1800123456"],[,,"140\\d{7}","\\d{10}",,,"1409305260",,,[10]],1,,[,,"NA","NA",,,,,,[-1]]],IO:[,[,,"3\\d{6}","\\d{7}",,,,,,[7]],[,,"37\\d{5}","\\d{7}",,,"3709100"],[,,"38\\d{5}","\\d{7}",,,"3801234"],
[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"IO",246,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],IQ:[,[,,"[1-7]\\d{7,9}","\\d{6,10}",,,,,,[8,9,10],[6,7]],[,,"1\\d{7}|(?:2[13-5]|3[02367]|4[023]|5[03]|6[026])\\d{6,7}","\\d{6,9}",,,"12345678",,,[8,9]],[,,"7[3-9]\\d{8}","\\d{10}",,,"7912345678",,,[10]],[,,"NA","NA",,,,,,[-1]],
[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"IQ",964,"00","0",,,"0",,,,[[,"(1)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],[,"([2-6]\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],[,"(7\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],IR:[,[,,"[1-8]\\d{9}|9(?:[0-4]\\d{8}|9\\d{2,8})","\\d{4,10}",,,,,,[4,5,6,7,8,9,10]],[,,"(?:1[137]|2[13-68]|3[1458]|4[145]|5[146-8]|6[146]|7[1467]|8[13467])\\d{8}",
"\\d{10}",,,"2123456789",,,[10]],[,,"9(?:0[1-3]|[13]\\d|2[0-2]|90)\\d{7}","\\d{10}",,,"9123456789",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"(?:[2-6]0\\d|993)\\d{7}","\\d{10}",,,"9932123456",,,[10]],"IR",98,"00","0",,,"0",,,,[[,"(21)(\\d{3,5})","$1 $2",["21"],"0$1"],[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["9"],"0$1"],[,
"(\\d{3})(\\d{3})","$1 $2",["9"],"0$1"]],,[,,"943\\d{7}","\\d{10}",,,"9432123456",,,[10]],,,[,,"NA","NA",,,,,,[-1]],[,,"9990\\d{0,6}","\\d{4,10}",,,"9990123456"],,,[,,"NA","NA",,,,,,[-1]]],IS:[,[,,"[4-9]\\d{6}|38\\d{7}","\\d{7,9}",,,,,,[7,9]],[,,"(?:4(?:1[0-24-6]|2[0-7]|[37][0-8]|4[0-245]|5[0-68]|6\\d|8[0-36-8])|5(?:05|[156]\\d|2[02578]|3[013-79]|4[03-7]|7[0-2578]|8[0-35-9]|9[013-689])|87[23])\\d{4}","\\d{7}",,,"4101234",,,[7]],[,,"38[589]\\d{6}|(?:6(?:1[1-8]|2[056]|3[089]|4[0167]|5[0159]|[67][0-69]|9\\d)|7(?:5[057]|6[0-2]|[78]\\d)|8(?:2[0-59]|3[0-4]|[469]\\d|5[1-9]))\\d{4}",
"\\d{7,9}",,,"6111234"],[,,"800\\d{4}","\\d{7}",,,"8001234",,,[7]],[,,"90\\d{5}","\\d{7}",,,"9011234",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"49\\d{5}","\\d{7}",,,"4921234",,,[7]],"IS",354,"1(?:0(?:01|10|20)|100)|00",,,,,,"00",,[[,"(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],[,"(3\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"809\\d{4}","\\d{7}",,,"8091234",,,[7]],,,[,,"(?:6(?:2[1-478]|49|8\\d)|8(?:7[0189]|80)|95[48])\\d{4}","\\d{7}",
,,"6211234",,,[7]]],IT:[,[,,"[01589]\\d{5,10}|3(?:[12457-9]\\d{8}|[36]\\d{7,9})","\\d{6,11}",,,,,,[6,7,8,9,10,11]],[,,"0(?:[26]\\d{4,9}|(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2346]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[34578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7})",
"\\d{6,11}",,,"0212345678"],[,,"3(?:[12457-9]\\d{8}|6\\d{7,8}|3\\d{7,9})","\\d{9,11}",,,"3123456789",,,[9,10,11]],[,,"80(?:0\\d{6}|3\\d{3})","\\d{6,9}",,,"800123456",,,[6,9]],[,,"0878\\d{5}|1(?:44|6[346])\\d{6}|89(?:2\\d{3}|4(?:[0-4]\\d{2}|[5-9]\\d{4})|5(?:[0-4]\\d{2}|[5-9]\\d{6})|9\\d{6})","\\d{6,10}",,,"899123456",,,[6,8,9,10]],[,,"84(?:[08]\\d{6}|[17]\\d{3})","\\d{6,9}",,,"848123456",,,[6,9]],[,,"1(?:78\\d|99)\\d{6}","\\d{9,10}",,,"1781234567",,,[9,10]],[,,"55\\d{8}","\\d{10}",,,"5512345678",,
,[10]],"IT",39,"00",,,,,,,,[[,"(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|55"]],[,"(0[26])(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],[,"(0[26])(\\d{4,6})","$1 $2",["0[26]"]],[,"(0\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]"]],[,"(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[245])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|[45][0-4]))"]],[,"(0\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["0[13-57-9][2-46-8]"]],[,"(0\\d{3})(\\d{2,6})","$1 $2",["0[13-57-9][2-46-8]"]],[,"(\\d{3})(\\d{3})(\\d{3,4})",
"$1 $2 $3",["[13]|8(?:00|4[08]|9[59])","[13]|8(?:00|4[08]|9(?:5[5-9]|9))"]],[,"(\\d{4})(\\d{4})","$1 $2",["894","894[5-9]"]],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["3"]]],,[,,"NA","NA",,,,,,[-1]],1,,[,,"848\\d{6}","\\d{9}",,,"848123456",,,[9]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],JE:[,[,,"[135789]\\d{6,9}","\\d{6,10}",,,,,,[10],[6]],[,,"1534\\d{6}","\\d{6,10}",,,"1534456789"],[,,"7(?:509|7(?:00|97)|829|937)\\d{6}","\\d{10}",,,"7797123456"],[,,"80(?:07(?:35|81)|8901)\\d{4}","\\d{10}",
,,"8007354567"],[,,"(?:871206|90(?:066[59]|1810|71(?:07|55)))\\d{4}","\\d{10}",,,"9018105678"],[,,"8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|70002)\\d{4}","\\d{10}",,,"8447034567"],[,,"701511\\d{4}","\\d{10}",,,"7015115678"],[,,"56\\d{8}","\\d{10}",,,"5612345678"],"JE",44,"00","0"," x",,"0",,,,,,[,,"76(?:0[012]|2[356]|4[0134]|5[49]|6[0-369]|77|81|9[39])\\d{6}","\\d{10}",,,"7640123456"],,,[,,"NA","NA",,,,,,[-1]],[,,"3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))\\d{4}|55\\d{8}",
"\\d{10}",,,"5512345678"],,,[,,"NA","NA",,,,,,[-1]]],JM:[,[,,"[589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"876(?:5(?:0[12]|1[0-468]|2[35]|63)|6(?:0[1-3579]|1[027-9]|[23]\\d|40|5[06]|6[2-589]|7[05]|8[04]|9[4-9])|7(?:0[2-689]|[1-6]\\d|8[056]|9[45])|9(?:0[1-8]|1[02378]|[2-8]\\d|9[2-468]))\\d{4}","\\d{7}(?:\\d{3})?",,,"8765123456"],[,,"876(?:2(?:[16-9]\\d|58)|[348]\\d{2}|5(?:0[3-9]|2[0-246-9]|6[0-24-9]|[3-578]\\d)|7(?:0[07]|7\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579]))\\d{4}","\\d{7}(?:\\d{3})?",
,,"8762101234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"JM",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"876",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],JO:[,[,,"[235-9]\\d{7,8}","\\d{8,9}",,,,,,[8,9]],[,,"(?:2(?:6(?:2[0-35-9]|3[0-57-8]|4[24-7]|5[0-24-8]|[6-8][023]|9[0-3])|7(?:0[1-79]|10|2[014-7]|3[0-689]|4[019]|5[0-3578]))|32(?:0[1-69]|1[1-35-7]|2[024-7]|3\\d|4[0-3]|[57][023]|6[03])|53(?:0[0-3]|[13][023]|2[0-59]|49|5[0-35-9]|6[15]|7[45]|8[1-6]|9[0-36-9])|6(?:2[50]0|3(?:00|33)|4(?:0[0125]|1[2-7]|2[0569]|[38][07-9]|4[025689]|6[0-589]|7\\d|9[0-2])|5(?:[01][056]|2[034]|3[0-57-9]|4[17-8]|5[0-69]|6[0-35-9]|7[1-379]|8[0-68]|9[02-39]))|87(?:[02]0|7[08]|90))\\d{4}",
"\\d{8}",,,"62001234",,,[8]],[,,"7(?:55|7[025-9]|8[015-9]|9[0-25-9])\\d{6}","\\d{9}",,,"790123456",,,[9]],[,,"80\\d{6}","\\d{8}",,,"80012345",,,[8]],[,,"900\\d{5}","\\d{8}",,,"90012345",,,[8]],[,,"85\\d{6}","\\d{8}",,,"85012345",,,[8]],[,,"70\\d{7}","\\d{9}",,,"700123456",,,[9]],[,,"NA","NA",,,,,,[-1]],"JO",962,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],[,"(7)(\\d{4})(\\d{4})","$1 $2 $3",["7[457-9]"],"0$1"],[,"(\\d{3})(\\d{5,6})","$1 $2",["70|8[0158]|9"],"0$1"]],
,[,,"74(?:66|77)\\d{5}","\\d{9}",,,"746612345",,,[9]],,,[,,"NA","NA",,,,,,[-1]],[,,"8(?:10|8\\d)\\d{5}","\\d{8}",,,"88101234",,,[8]],,,[,,"NA","NA",,,,,,[-1]]],JP:[,[,,"[1-9]\\d{8,9}|00(?:[36]\\d{7,14}|7\\d{5,7}|8\\d{7})","\\d{8,17}",,,,,,[8,9,10,11,12,13,14,15,16,17]],[,,"(?:1(?:1[235-8]|2[3-6]|3[3-9]|4[2-6]|[58][2-8]|6[2-7]|7[2-9]|9[1-9])|2[2-9]\\d|[36][1-9]\\d|4(?:6[02-8]|[2-578]\\d|9[2-59])|5(?:6[1-9]|7[2-8]|[2-589]\\d)|7(?:3[4-9]|4[02-9]|[25-9]\\d)|8(?:3[2-9]|4[5-9]|5[1-9]|8[03-9]|[2679]\\d)|9(?:[679][1-9]|[2-58]\\d))\\d{6}",
"\\d{9}",,,"312345678",,,[9]],[,,"[7-9]0[1-9]\\d{7}","\\d{10}",,,"9012345678",,,[10]],[,,"120\\d{6}|800\\d{7}|00(?:37\\d{6,13}|66\\d{6,13}|777(?:[01]\\d{2}|5\\d{3}|8\\d{4})|882[1245]\\d{4})","\\d{8,17}",,,"120123456"],[,,"990\\d{6}","\\d{9}",,,"990123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"60\\d{7}","\\d{9}",,,"601234567",,,[9]],[,,"50[1-9]\\d{7}","\\d{10}",,,"5012345678",,,[10]],"JP",81,"010","0",,,"0",,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{4})",
"$1-$2-$3",["800"],"0$1"],[,"(\\d{4})(\\d{4})","$1-$2",["0077"],"$1"],[,"(\\d{4})(\\d{2})(\\d{3,4})","$1-$2-$3",["0077"],"$1"],[,"(\\d{4})(\\d{2})(\\d{4})","$1-$2-$3",["0088"],"$1"],[,"(\\d{4})(\\d{3})(\\d{3,4})","$1-$2-$3",["00(?:37|66)"],"$1"],[,"(\\d{4})(\\d{4})(\\d{4,5})","$1-$2-$3",["00(?:37|66)"],"$1"],[,"(\\d{4})(\\d{5})(\\d{5,6})","$1-$2-$3",["00(?:37|66)"],"$1"],[,"(\\d{4})(\\d{6})(\\d{6,7})","$1-$2-$3",["00(?:37|66)"],"$1"],[,"(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[2579]0|80[1-9]"],"0$1"],
[,"(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|5(?:76|97)|499|746|8(?:3[89]|63|47|51)|9(?:49|80|9[16])","1(?:267|3(?:7[247]|9[278])|4(?:5[67]|66)|5(?:47|58|64|8[67])|6(?:3[245]|48|5[4-68]))|5(?:76|97)9|499[2468]|7468|8(?:3(?:8[78]|96)|636|477|51[24])|9(?:496|802|9(?:1[23]|69))","1(?:267|3(?:7[247]|9[278])|4(?:5[67]|66)|5(?:47|58|64|8[67])|6(?:3[245]|48|5[4-68]))|5(?:769|979[2-69])|499[2468]|7468|8(?:3(?:8[78]|96[2457-9])|636[2-57-9]|477|51[24])|9(?:496|802|9(?:1[23]|69))"],
"0$1"],[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["1(?:2[3-6]|3[3-9]|4[2-6]|5[2-8]|[68][2-7]|7[2-689]|9[1-578])|2(?:2[03-689]|3[3-58]|4[0-468]|5[04-8]|6[013-8]|7[06-9]|8[02-57-9]|9[13])|4(?:2[28]|3[689]|6[035-7]|7[05689]|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9[4-9])|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9[014-9])|8(?:2[49]|3[3-8]|4[5-8]|5[2-9]|6[35-9]|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9[3-7])","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-689]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9[2-8])|3(?:7[2-6]|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5[4-7]|6[2-9]|8[2-8]|9[236-9])|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3[34]|[4-7]))",
"1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-689]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6[56]))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))",
"1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-689]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6(?:5[25]|60)))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))"],
"0$1"],[,"(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1|2(?:2[37]|5[5-9]|64|78|8[39]|91)|4(?:2[2689]|64|7[347])|5(?:[2-589]|39)|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93)","1|2(?:2[37]|5(?:[57]|[68]0|9[19])|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93[34])","1|2(?:2[37]|5(?:[57]|[68]0|9(?:17|99))|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93(?:31|4))"],
"0$1"],[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["2(?:9[14-79]|74|[34]7|[56]9)|82|993"],"0$1"],[,"(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[2479][1-9]"],"0$1"]],[[,"(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],[,"(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[2579]0|80[1-9]"],"0$1"],[,"(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|5(?:76|97)|499|746|8(?:3[89]|63|47|51)|9(?:49|80|9[16])",
"1(?:267|3(?:7[247]|9[278])|4(?:5[67]|66)|5(?:47|58|64|8[67])|6(?:3[245]|48|5[4-68]))|5(?:76|97)9|499[2468]|7468|8(?:3(?:8[78]|96)|636|477|51[24])|9(?:496|802|9(?:1[23]|69))","1(?:267|3(?:7[247]|9[278])|4(?:5[67]|66)|5(?:47|58|64|8[67])|6(?:3[245]|48|5[4-68]))|5(?:769|979[2-69])|499[2468]|7468|8(?:3(?:8[78]|96[2457-9])|636[2-57-9]|477|51[24])|9(?:496|802|9(?:1[23]|69))"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["1(?:2[3-6]|3[3-9]|4[2-6]|5[2-8]|[68][2-7]|7[2-689]|9[1-578])|2(?:2[03-689]|3[3-58]|4[0-468]|5[04-8]|6[013-8]|7[06-9]|8[02-57-9]|9[13])|4(?:2[28]|3[689]|6[035-7]|7[05689]|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9[4-9])|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9[014-9])|8(?:2[49]|3[3-8]|4[5-8]|5[2-9]|6[35-9]|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9[3-7])",
"1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-689]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9[2-8])|3(?:7[2-6]|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5[4-7]|6[2-9]|8[2-8]|9[236-9])|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3[34]|[4-7]))",
"1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-689]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6[56]))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))",
"1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-689]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6(?:5[25]|60)))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))"],
"0$1"],[,"(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1|2(?:2[37]|5[5-9]|64|78|8[39]|91)|4(?:2[2689]|64|7[347])|5(?:[2-589]|39)|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93)","1|2(?:2[37]|5(?:[57]|[68]0|9[19])|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93[34])","1|2(?:2[37]|5(?:[57]|[68]0|9(?:17|99))|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93(?:31|4))"],
"0$1"],[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["2(?:9[14-79]|74|[34]7|[56]9)|82|993"],"0$1"],[,"(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[2479][1-9]"],"0$1"]],[,,"20\\d{8}","\\d{10}",,,"2012345678",,,[10]],,,[,,"00(?:37\\d{6,13}|66\\d{6,13}|777(?:[01]\\d{2}|5\\d{3}|8\\d{4})|882[1245]\\d{4})","\\d{8,17}",,,"00777012"],[,,"570\\d{6}","\\d{9}",,,"570123456",,,[9]],1,,[,,"NA","NA",,,,,,[-1]]],KE:[,[,,"20\\d{6,7}|[4-9]\\d{6,9}","\\d{7,10}",
,,,,,[7,8,9,10]],[,,"20\\d{6,7}|4(?:[0136]\\d{7}|[245]\\d{5,7})|5(?:[08]\\d{7}|[1-79]\\d{5,7})|6(?:[01457-9]\\d{5,7}|[26]\\d{7})","\\d{7,9}",,,"202012345",,,[7,8,9]],[,,"7(?:[0-369]\\d|4[0-2]|5[0-6]|7[0-7]|8[0-25-9])\\d{6}","\\d{9}",,,"712123456",,,[9]],[,,"800[24-8]\\d{5,6}","\\d{9,10}",,,"800223456",,,[9,10]],[,,"900[02-9]\\d{5}","\\d{9}",,,"900223456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"KE",254,"000","0",,,"005|0",,,,[[,"(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],
"0$1"],[,"(\\d{3})(\\d{6})","$1 $2",["7"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],KG:[,[,,"[235-8]\\d{8,9}","\\d{5,10}",,,,,,[9,10],[5,6]],[,,"(?:3(?:1(?:[256]\\d|3[1-9]|47)|2(?:22|3[0-479]|6[0-7])|4(?:22|5[6-9]|6\\d)|5(?:22|3[4-7]|59|6\\d)|6(?:22|5[35-7]|6\\d)|7(?:22|3[468]|4[1-9]|59|[67]\\d)|9(?:22|4[1-8]|6\\d))|6(?:09|12|2[2-4])\\d)\\d{5}","\\d{5,10}",,,"312123456",,,
[9]],[,,"(?:20[0-35]|5[124-7]\\d|7[07]\\d)\\d{6}","\\d{9}",,,"700123456",,,[9]],[,,"800\\d{6,7}","\\d{9,10}",,,"800123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"KG",996,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[25-7]|31[25]"],"0$1"],[,"(\\d{4})(\\d{5})","$1 $2",["3(?:1[36]|[2-9])"],"0$1"],[,"(\\d{3})(\\d{3})(\\d)(\\d{3})","$1 $2 $3 $4",["8"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,
[-1]],,,[,,"NA","NA",,,,,,[-1]]],KH:[,[,,"[1-9]\\d{7,9}","\\d{6,10}",,,,,,[8,9,10],[6,7]],[,,"(?:2[3-6]|3[2-6]|4[2-4]|[5-7][2-5])(?:[237-9]|4[56]|5\\d|6\\d?)\\d{5}|23(?:4[234]|8\\d{2})\\d{4}","\\d{6,9}",,,"23756789",,,[8,9]],[,,"(?:1(?:[013-79]\\d|[28]\\d{1,2})|2[3-6]48|3(?:[18]\\d{2}|[2-6]48)|4[2-4]48|5[2-5]48|6(?:[016-9]\\d|[2-5]48)|7(?:[07-9]\\d|[16]\\d{2}|[2-5]48)|8(?:[013-79]\\d|8\\d{2})|9(?:6\\d{2}|7\\d{1,2}|[0-589]\\d))\\d{5}","\\d{8,9}",,,"91234567",,,[8,9]],[,,"1800(?:1\\d|2[019])\\d{4}",
"\\d{10}",,,"1800123456",,,[10]],[,,"1900(?:1\\d|2[09])\\d{4}","\\d{10}",,,"1900123456",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"KH",855,"00[14-9]","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["1\\d[1-9]|[2-9]"],"0$1"],[,"(1[89]00)(\\d{3})(\\d{3})","$1 $2 $3",["1[89]0"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],KI:[,[,,"[2458]\\d{4}|3\\d{4,7}|7\\d{7}","\\d{5,8}",,,,,,[5,8]],[,,"(?:[24]\\d|3[1-9]|50|8[0-5])\\d{3}",
"\\d{5}",,,"31234",,,[5]],[,,"7\\d{7}","\\d{8}",,,"72012345",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"3001\\d{4}","\\d{5,8}",,,"30010000",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"KI",686,"00",,,,"0",,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],KM:[,[,,"[379]\\d{6}","\\d{7}",,,,,,[7]],[,,"7(?:6[0-37-9]|7[0-57-9])\\d{4}","\\d{7}",,,"7712345"],[,,"3[234]\\d{5}","\\d{7}",,,"3212345"],[,,"NA","NA",,,,,,[-1]],
[,,"(?:39[01]|9[01]0)\\d{4}","\\d{7}",,,"9001234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"KM",269,"00",,,,,,,,[[,"(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],KN:[,[,,"[589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"869(?:2(?:29|36)|302|4(?:6[015-9]|70))\\d{4}","\\d{7}(?:\\d{3})?",,,"8692361234"],[,,"869(?:5(?:5[6-8]|6[5-7])|66\\d|76[02-7])\\d{4}","\\d{7}(?:\\d{3})?",
,,"8697652917"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"KN",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"869",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],KP:[,[,,"1\\d{9}|[28]\\d{7}","\\d{6,8}|\\d{10}",,,,,,[8,10],[6,7]],[,,"2\\d{7}|85\\d{6}","\\d{6,8}",,,"21234567",,,[8]],[,,"19[123]\\d{7}",
"\\d{10}",,,"1921234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"KP",850,"00|99","0",,,"0",,,,[[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],[,"(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"2(?:[0-24-9]\\d{2}|3(?:[0-79]\\d|8[02-9]))\\d{4}","\\d{8}",,,"23821234",,,[8]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],
KR:[,[,,"007\\d{9,11}|[1-7]\\d{3,9}|8\\d{8}","\\d{3,14}",,,,,,[4,5,6,8,9,10,12,13,14],[3,7]],[,,"(?:2|3[1-3]|[46][1-4]|5[1-5])(?:1\\d{2,3}|[1-9]\\d{6,7})","\\d{3,10}",,,"22123456",,,[4,5,6,8,9,10]],[,,"1[0-26-9]\\d{7,8}","\\d{9,10}",,,"1000000000",,,[9,10]],[,,"(?:00798\\d{0,2}|80)\\d{7}","\\d{9,14}",,,"801234567",,,[9,12,13,14]],[,,"60[2-9]\\d{6}","\\d{9}",,,"602345678",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"50\\d{8}","\\d{10}",,,"5012345678",,,[10]],[,,"70\\d{8}","\\d{10}",,,"7012345678",,,[10]],"KR",
82,"00(?:[124-68]|3\\d{2}|7(?:[0-8]\\d|9[0-79]))","0",,,"0(8[1-46-8]|85\\d{2})?",,,,[[,"(\\d{5})(\\d{3,4})(\\d{4})","$1 $2 $3",["00798"],"$1","0$CC-$1"],[,"(\\d{5})(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["00798"],"$1","0$CC-$1"],[,"(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["1(?:0|1[19]|[69]9|5[458])|[57]0","1(?:0|1[19]|[69]9|5(?:44|59|8))|[57]0"],"0$1","0$CC-$1"],[,"(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["1(?:[01]|5[1-4]|6[2-8]|[7-9])|[68]0|[3-6][1-9][1-9]","1(?:[01]|5(?:[1-3]|4[56])|6[2-8]|[7-9])|[68]0|[3-6][1-9][1-9]"],
"0$1","0$CC-$1"],[,"(\\d{3})(\\d)(\\d{4})","$1-$2-$3",["131","1312"],"0$1","0$CC-$1"],[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["131","131[13-9]"],"0$1","0$CC-$1"],[,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["13[2-9]"],"0$1","0$CC-$1"],[,"(\\d{2})(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3-$4",["30"],"0$1","0$CC-$1"],[,"(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2[1-9]"],"0$1","0$CC-$1"],[,"(\\d)(\\d{3,4})","$1-$2",["21[0-46-9]"],"0$1","0$CC-$1"],[,"(\\d{2})(\\d{3,4})","$1-$2",["[3-6][1-9]1","[3-6][1-9]1(?:[0-46-9])"],
"0$1","0$CC-$1"],[,"(\\d{4})(\\d{4})","$1-$2",["1(?:5[46-9]|6[04678]|8[03579])","1(?:5(?:44|66|77|88|99)|6(?:00|44|6[16]|70|88)|8(?:00|33|55|77|99))"],"$1","0$CC-$1"]],[[,"(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["1(?:0|1[19]|[69]9|5[458])|[57]0","1(?:0|1[19]|[69]9|5(?:44|59|8))|[57]0"],"0$1","0$CC-$1"],[,"(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["1(?:[01]|5[1-4]|6[2-8]|[7-9])|[68]0|[3-6][1-9][1-9]","1(?:[01]|5(?:[1-3]|4[56])|6[2-8]|[7-9])|[68]0|[3-6][1-9][1-9]"],"0$1","0$CC-$1"],[,"(\\d{3})(\\d)(\\d{4})",
"$1-$2-$3",["131","1312"],"0$1","0$CC-$1"],[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["131","131[13-9]"],"0$1","0$CC-$1"],[,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["13[2-9]"],"0$1","0$CC-$1"],[,"(\\d{2})(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3-$4",["30"],"0$1","0$CC-$1"],[,"(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2[1-9]"],"0$1","0$CC-$1"],[,"(\\d)(\\d{3,4})","$1-$2",["21[0-46-9]"],"0$1","0$CC-$1"],[,"(\\d{2})(\\d{3,4})","$1-$2",["[3-6][1-9]1","[3-6][1-9]1(?:[0-46-9])"],"0$1","0$CC-$1"],[,"(\\d{4})(\\d{4})",
"$1-$2",["1(?:5[46-9]|6[04678]|8[03579])","1(?:5(?:44|66|77|88|99)|6(?:00|44|6[16]|70|88)|8(?:00|33|55|77|99))"],"$1","0$CC-$1"]],[,,"15\\d{7,8}","\\d{9,10}",,,"1523456789",,,[9,10]],,,[,,"00798\\d{7,9}","\\d{12,14}",,,"007981234567",,,[12,13,14]],[,,"1(?:5(?:44|66|77|88|99)|6(?:00|44|6[16]|70|88)|8(?:00|33|55|77|99))\\d{4}","\\d{8}",,,"15441234",,,[8]],,,[,,"NA","NA",,,,,,[-1]]],KW:[,[,,"[12569]\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"(?:18\\d|2(?:[23]\\d{2}|4(?:[1-35-9]\\d|44)|5(?:0[034]|[2-46]\\d|5[1-3]|7[1-7])))\\d{4}",
"\\d{7,8}",,,"22345678"],[,,"(?:5(?:[05]\\d{2}|1[0-7]\\d|2(?:22|5[25])|66\\d)|6(?:0[034679]\\d|222|5[015-9]\\d|6\\d{2}|7[067]\\d|9[0369]\\d)|9(?:0[09]\\d|22\\d|4[01479]\\d|55\\d|6[0679]\\d|[79]\\d{2}|8[057-9]\\d))\\d{4}","\\d{8}",,,"50012345"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"KW",965,"00",,,,,,,,[[,"(\\d{4})(\\d{3,4})","$1 $2",["[16]|2(?:[0-35-9]|4[0-35-9])|9[024-9]|52[25]"]],[,"(\\d{3})(\\d{5})","$1 $2",["244|5(?:[015]|66)"]]],
,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],KY:[,[,,"[3589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"345(?:2(?:22|44)|444|6(?:23|38|40)|7(?:4[35-79]|6[6-9]|77)|8(?:00|1[45]|25|[48]8)|9(?:14|4[035-9]))\\d{4}","\\d{7}(?:\\d{3})?",,,"3452221234"],[,,"345(?:32[1-9]|5(?:1[67]|2[5-7]|4[6-8]|76)|9(?:1[67]|2[2-9]|3[689]))\\d{4}","\\d{7}(?:\\d{3})?",,,"3453231234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}|345976\\d{4}",
"\\d{10}",,,"9002345678"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"KY",1,"011","1",,,"1",,,,,,[,,"345849\\d{4}","\\d{10}",,,"3458491234"],,"345",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],KZ:[,[,,"(?:33\\d|7\\d{2}|80[09])\\d{7}","\\d{10}",,,,,,[10]],[,,"33622\\d{5}|7(?:1(?:0(?:[23]\\d|4[023]|59|63)|1(?:[23]\\d|4[0-79]|59)|2(?:[23]\\d|59)|3(?:2\\d|3[1-79]|4[0-35-9]|59)|4(?:2\\d|3[013-79]|4[0-8]|5[1-79])|5(?:2\\d|3[1-8]|4[1-7]|59)|6(?:[234]\\d|5[19]|61)|72\\d|8(?:[27]\\d|3[1-46-9]|4[0-5]))|2(?:1(?:[23]\\d|4[46-9]|5[3469])|2(?:2\\d|3[0679]|46|5[12679])|3(?:[234]\\d|5[139])|4(?:2\\d|3[1235-9]|59)|5(?:[23]\\d|4[01246-8]|59|61)|6(?:2\\d|3[1-9]|4[0-4]|59)|7(?:[2379]\\d|40|5[279])|8(?:[23]\\d|4[0-3]|59)|9(?:2\\d|3[124578]|59)))\\d{5}",
"\\d{10}",,,"7123456789"],[,,"7(?:0[012578]|47|6[02-4]|7[15-8]|85)\\d{7}","\\d{10}",,,"7710009998"],[,,"800\\d{7}","\\d{10}",,,"8001234567"],[,,"809\\d{7}","\\d{10}",,,"8091234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"751\\d{7}","\\d{10}",,,"7511234567"],"KZ",7,"810","8",,,"8",,"8~10",,,,[,,"NA","NA",,,,,,[-1]],,,[,,"751\\d{7}","\\d{10}",,,"7511234567"],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],LA:[,[,,"[2-8]\\d{7,9}","\\d{6,10}",,,,,,[8,9,10],[6]],[,,"(?:2[13]|3(?:0\\d|[14])|[5-7][14]|41|8[1468])\\d{6}",
"\\d{6,9}",,,"21212862",,,[8,9]],[,,"20(?:2[2389]|5[4-689]|7[6-8]|9[15-9])\\d{6}","\\d{10}",,,"2023123456",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"LA",856,"00","0",,,"0",,,,[[,"(20)(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["20"],"0$1"],[,"([2-8]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],[,"(30)(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,
,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],LB:[,[,,"[13-9]\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"(?:[14-6]\\d{2}|7(?:[2-57]\\d|62|8[0-7]|9[04-9])|8[02-9]\\d|9\\d{2})\\d{4}","\\d{7}",,,"1123456",,,[7]],[,,"(?:3\\d|7(?:[01]\\d|6[013-9]|8[89]|9[1-3])|81\\d)\\d{5}","\\d{7,8}",,,"71123456"],[,,"NA","NA",,,,,,[-1]],[,,"9[01]\\d{6}","\\d{8}",,,"90123456",,,[8]],[,,"80\\d{6}","\\d{8}",,,"80123456",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"LB",961,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3})",
"$1 $2 $3",["[13-6]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]|9"],"0$1"],[,"([7-9]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[89][01]|7(?:[01]|6[013-9]|8[89]|9[1-3])"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],LC:[,[,,"[5789]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"758(?:4(?:30|5[0-9]|6[2-9]|8[0-2])|57[0-2]|638)\\d{4}","\\d{7}(?:\\d{3})?",,,"7584305678"],[,,"758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2[0-8]))\\d{4}","\\d{7}(?:\\d{3})?",
,,"7582845678"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"LC",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"758",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],LI:[,[,,"6\\d{8}|[23789]\\d{6}","\\d{7,9}",,,,,,[7,9]],[,,"(?:2(?:01|1[27]|3\\d|6[02-578]|96)|3(?:7[0135-7]|8[048]|9[0269]))\\d{4}",
"\\d{7}",,,"2345678",,,[7]],[,,"6(?:51[01]|6(?:0[0-6]|2[016-9]|39))\\d{5}|7(?:[37-9]\\d|42|56)\\d{4}","\\d{7,9}",,,"660234567"],[,,"80(?:02[28]|9\\d{2})\\d{2}","\\d{7}",,,"8002222",,,[7]],[,,"90(?:02[258]|1(?:23|3[14])|66[136])\\d{2}","\\d{7}",,,"9002222",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"LI",423,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[23789]"]],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[56]"]],[,"(69)(7\\d{2})(\\d{4})","$1 $2 $3",
["697"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"870(?:28|87)\\d{2}","\\d{7}",,,"8702812",,,[7]],,,[,,"697(?:42|56|[7-9]\\d)\\d{4}","\\d{9}",,,"697861234",,,[9]]],LK:[,[,,"[1-9]\\d{8}","\\d{7,9}",,,,,,[9],[7]],[,,"(?:[189]1|2[13-7]|3[1-8]|4[157]|5[12457]|6[35-7])[2-57]\\d{6}","\\d{7,9}",,,"112345678"],[,,"7[0125-8]\\d{7}","\\d{9}",,,"712345678"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"LK",94,"00","0",
,,"0",,,,[[,"(\\d{2})(\\d{1})(\\d{6})","$1 $2 $3",["[1-689]"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],LR:[,[,,"2\\d{7,8}|[378]\\d{8}|4\\d{6}|5\\d{6,8}","\\d{7,9}",,,,,,[7,8,9]],[,,"2\\d{7}","\\d{8}",,,"21234567",,,[8]],[,,"(?:20\\d{3}|330\\d{2}|4[67]\\d|5(?:55)?\\d{2}|77\\d{3}|88\\d{3})\\d{4}","\\d{7,9}",,,"770123456",,,[7,9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,
,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"332(?:02|[25]\\d)\\d{4}","\\d{9}",,,"332021234",,,[9]],"LR",231,"00","0",,,"0",,,,[[,"(2\\d)(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],[,"([4-5])(\\d{3})(\\d{3})","$1 $2 $3",["[45]"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23578]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],LS:[,[,,"[2568]\\d{7}","\\d{8}",,,,,,[8]],[,,"2\\d{7}","\\d{8}",,,"22123456"],[,,"[56]\\d{7}","\\d{8}",
,,"50123456"],[,,"800[256]\\d{4}","\\d{8}",,,"80021234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"LS",266,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],LT:[,[,,"[3-9]\\d{7}","\\d{8}",,,,,,[8]],[,,"(?:3[1478]|4[124-6]|52)\\d{6}","\\d{8}",,,"31234567"],[,,"6\\d{7}","\\d{8}",,,"61234567"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"9(?:0[0239]|10)\\d{5}",
"\\d{8}",,,"90012345"],[,,"808\\d{5}","\\d{8}",,,"80812345"],[,,"700\\d{5}","\\d{8}",,,"70012345"],[,,"NA","NA",,,,,,[-1]],"LT",370,"00","8",,,"[08]",,,,[[,"([34]\\d)(\\d{6})","$1 $2",["37|4(?:1|5[45]|6[2-4])"],"(8-$1)",,1],[,"([3-6]\\d{2})(\\d{5})","$1 $2",["3[148]|4(?:[24]|6[09])|528|6"],"(8-$1)",,1],[,"([7-9]\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"8 $1",,1],[,"(5)(2\\d{2})(\\d{4})","$1 $2 $3",["52[0-79]"],"(8-$1)",,1]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"70[67]\\d{5}",
"\\d{8}",,,"70712345"],,,[,,"NA","NA",,,,,,[-1]]],LU:[,[,,"[24-9]\\d{3,10}|3(?:[0-46-9]\\d{2,9}|5[013-9]\\d{1,8})","\\d{4,11}",,,,,,[4,5,6,7,8,9,10,11]],[,,"(?:2[2-9]\\d{2,9}|(?:[3457]\\d{2}|8(?:0[2-9]|[13-9]\\d)|9(?:0[89]|[2-579]\\d))\\d{1,8})","\\d{4,11}",,,"27123456"],[,,"6[2679][18]\\d{6}","\\d{9}",,,"628123456",,,[9]],[,,"800\\d{5}","\\d{8}",,,"80012345",,,[8]],[,,"90[015]\\d{5}","\\d{8}",,,"90012345",,,[8]],[,,"801\\d{5}","\\d{8}",,,"80112345",,,[8]],[,,"70\\d{6}","\\d{8}",,,"70123456",,,[8]],
[,,"20(?:1\\d{5}|[2-689]\\d{1,7})","\\d{4,10}",,,"20201234",,,[4,5,6,7,8,9,10]],"LU",352,"00",,,,"(15(?:0[06]|1[12]|35|4[04]|55|6[26]|77|88|99)\\d)",,,,[[,"(\\d{2})(\\d{3})","$1 $2",["[2-5]|7[1-9]|[89](?:[1-9]|0[2-9])"],,"$CC $1"],[,"(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-5]|7[1-9]|[89](?:[1-9]|0[2-9])"],,"$CC $1"],[,"(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20"],,"$CC $1"],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"],,"$CC $1"],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{3})",
"$1 $2 $3 $4",["20"],,"$CC $1"],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"],,"$CC $1"],[,"(\\d{2})(\\d{2})(\\d{2})(\\d{1,4})","$1 $2 $3 $4",["2(?:[12589]|4[12])|[3-5]|7[1-9]|8(?:[1-9]|0[2-9])|9(?:[1-9]|0[2-46-9])"],,"$CC $1"],[,"(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["70|80[01]|90[015]"],,"$CC $1"],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"],,"$CC $1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],
LV:[,[,,"[2689]\\d{7}","\\d{8}",,,,,,[8]],[,,"6\\d{7}","\\d{8}",,,"63123456"],[,,"2\\d{7}","\\d{8}",,,"21234567"],[,,"80\\d{6}","\\d{8}",,,"80123456"],[,,"90\\d{6}","\\d{8}",,,"90123456"],[,,"81\\d{6}","\\d{8}",,,"81123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"LV",371,"00",,,,,,,,[[,"([2689]\\d)(\\d{3})(\\d{3})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],LY:[,[,,"[25679]\\d{8}","\\d{7,9}",,,,,,[9],[7]],[,,"(?:2[1345]|5[1347]|6[123479]|71)\\d{7}",
"\\d{7,9}",,,"212345678"],[,,"9[1-6]\\d{7}","\\d{9}",,,"912345678"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"LY",218,"00","0",,,"0",,,,[[,"([25679]\\d)(\\d{7})","$1-$2",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MA:[,[,,"[5-9]\\d{8}","\\d{9}",,,,,,[9]],[,,"5(?:2(?:(?:[015-7]\\d|2[02-9]|3[2-57]|4[2-8]|8[235-7])\\d|9(?:0\\d|[89]0))|3(?:(?:[0-4]\\d|[57][2-9]|6[2-8]|9[3-9])\\d|8(?:0\\d|[89]0))|(?:4[067]|5[03])\\d{2})\\d{4}",
"\\d{9}",,,"520123456"],[,,"(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[07][07]|6[12]))\\d{6}","\\d{9}",,,"650123456"],[,,"80\\d{7}","\\d{9}",,,"801234567"],[,,"89\\d{7}","\\d{9}",,,"891234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"5924[01]\\d{4}","\\d{9}",,,"592401234"],"MA",212,"00","0",,,"0",,,,[[,"([5-7]\\d{2})(\\d{6})","$1-$2",["5(?:2[015-7]|3[0-4])|[67]"],"0$1"],[,"([58]\\d{3})(\\d{5})","$1-$2",["5(?:2[2-489]|3[5-9]|92)|892","5(?:2(?:[2-48]|90)|3(?:[5-79]|80)|924)|892"],"0$1"],[,"(5\\d{4})(\\d{4})",
"$1-$2",["5(?:29|38)","5(?:29|38)[89]"],"0$1"],[,"([5]\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:4[067]|5[03])"],"0$1"],[,"(8[09])(\\d{7})","$1-$2",["8(?:0|9[013-9])"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MC:[,[,,"[4689]\\d{7,8}","\\d{8,9}",,,,,,[8,9]],[,,"870\\d{5}|9[2-47-9]\\d{6}","\\d{8}",,,"99123456",,,[8]],[,,"6\\d{8}|4(?:4\\d|5[1-9])\\d{5}","\\d{8,9}",,,"612345678"],[,,"90\\d{6}","\\d{8}",,,"90123456",,,[8]],
[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"MC",377,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"$1"],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],[,"(6)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["8"],"$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"8\\d{7}","\\d{8}",,,,,,[8]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MD:[,[,,"[235-9]\\d{7}","\\d{8}",
,,,,,[8]],[,,"(?:2[1-9]\\d|3[1-79]\\d|5(?:33|5[257]))\\d{5}","\\d{8}",,,"22212345"],[,,"(?:562|6\\d{2}|7(?:[189]\\d|6[07]|7[457-9]))\\d{5}","\\d{8}",,,"62112345"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"90[056]\\d{5}","\\d{8}",,,"90012345"],[,,"808\\d{5}","\\d{8}",,,"80812345"],[,,"NA","NA",,,,,,[-1]],[,,"3[08]\\d{6}","\\d{8}",,,"30123456"],"MD",373,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],[,"([25-7]\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["2[13-9]|[5-7]"],"0$1"],[,
"([89]\\d{2})(\\d{5})","$1 $2",["[89]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"803\\d{5}","\\d{8}",,,"80312345"],,,[,,"NA","NA",,,,,,[-1]]],ME:[,[,,"[2-9]\\d{7,8}","\\d{6,9}",,,,,,[8,9],[6]],[,,"(?:20[2-8]|3(?:0[2-7]|[12][35-7]|3[4-7])|4(?:0[2367]|1[267])|5(?:0[467]|1[267]|2[367]))\\d{5}","\\d{6,8}",,,"30234567",,,[8]],[,,"6(?:00\\d|3[24]\\d|61\\d|7(?:[0-8]\\d|9(?:[3-9]|[0-2]\\d))|[89]\\d{2})\\d{4}","\\d{8,9}",,,"67622901"],[,,"80\\d{6}","\\d{8}",,,"80080002",,,[8]],[,,"(?:9(?:4[1568]|5[178]))\\d{5}",
"\\d{8}",,,"94515151",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"78[1-9]\\d{5}","\\d{8}",,,"78108780",,,[8]],"ME",382,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]|6[036-9]","[2-57-9]|6(?:[03689]|7(?:[0-8]|9[3-9]))"],"0$1"],[,"(67)(9)(\\d{3})(\\d{3})","$1 $2 $3 $4",["679","679[0-2]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"77\\d{6}","\\d{8}",,,"77273012",,,[8]],,,[,,"NA","NA",,,,,,[-1]]],MF:[,[,,"[56]\\d{8}","\\d{9}",,,,,,[9]],[,,"590(?:[02][79]|13|5[0-268]|[78]7)\\d{4}",
"\\d{9}",,,"590271234"],[,,"690(?:0[0-7]|[1-9]\\d)\\d{4}","\\d{9}",,,"690301234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"MF",590,"00","0",,,"0",,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MG:[,[,,"[23]\\d{8}","\\d{7,9}",,,,,,[9],[7]],[,,"20(?:2\\d{2}|4[47]\\d|5[3467]\\d|6[279]\\d|7(?:2[29]|[35]\\d)|8[268]\\d|9[245]\\d)\\d{4}","\\d{7,9}",,,"202123456"],[,,
"3[2-49]\\d{7}","\\d{9}",,,"321234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"22\\d{7}","\\d{9}",,,"221234567"],"MG",261,"00","0",,,"0",,,,[[,"([23]\\d)(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MH:[,[,,"[2-6]\\d{6}","\\d{7}",,,,,,[7]],[,,"(?:247|528|625)\\d{4}","\\d{7}",,,"2471234"],[,,"(?:235|329|45[56]|545)\\d{4}","\\d{7}",,,"2351234"],
[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"635\\d{4}","\\d{7}",,,"6351234"],"MH",692,"011","1",,,"1",,,,[[,"(\\d{3})(\\d{4})","$1-$2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MK:[,[,,"[2-578]\\d{7}","\\d{6,8}",,,,,,[8],[6,7]],[,,"(?:2(?:[23]\\d|5[124578]|6[01])|3(?:1[3-6]|[23][2-6]|4[2356])|4(?:[23][2-6]|4[3-6]|5[256]|6[25-8]|7[24-6]|8[4-6]))\\d{5}","\\d{6,8}",,,"22212345"],[,,"7(?:[0-25-8]\\d{2}|32\\d|421)\\d{4}",
"\\d{6,8}",,,"72345678"],[,,"800\\d{5}","\\d{6,8}",,,"80012345"],[,,"5[02-9]\\d{6}","\\d{6,8}",,,"50012345"],[,,"8(?:0[1-9]|[1-9]\\d)\\d{5}","\\d{6,8}",,,"80123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"MK",389,"00","0",,,"0",,,,[[,"(2)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],[,"([347]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],[,"([58]\\d{2})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA",
"NA",,,,,,[-1]]],ML:[,[,,"[246-9]\\d{7}","\\d{8}",,,,,,[8]],[,,"(?:2(?:0(?:2\\d|7[0-8])|1(?:2[5-7]|[3-689]\\d))|44[1239]\\d)\\d{4}","\\d{8}",,,"20212345"],[,,"(?:2(?:079|17\\d)|[679]\\d{3}|8[239]\\d{2})\\d{4}","\\d{8}",,,"65012345"],[,,"80\\d{6}","\\d{8}",,,"80012345"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"ML",223,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[246-9]"]],[,"(\\d{4})","$1",["67|74"]]],[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})",
"$1 $2 $3 $4",["[246-9]"]]],[,,"NA","NA",,,,,,[-1]],,,[,,"80\\d{6}","\\d{8}",,,"80012345"],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MM:[,[,,"[14578]\\d{5,7}|[26]\\d{5,8}|9(?:2\\d{0,2}|[58]|3\\d|4\\d{1,2}|6\\d?|[79]\\d{0,2})\\d{6}","\\d{5,10}",,,,,,[6,7,8,9,10],[5]],[,,"1(?:2\\d{1,2}|[3-5]\\d|6\\d?|[89][0-6]\\d)\\d{4}|2(?:2(?:000\\d{3}|\\d{4})|3\\d{4}|4(?:0\\d{5}|\\d{4})|5(?:1\\d{3,6}|[02-9]\\d{3,5})|[6-9]\\d{4})|4(?:2[245-8]|[346][2-6]|5[3-5])\\d{4}|5(?:2(?:20?|[3-8])|3[2-68]|4(?:21?|[4-8])|5[23]|6[2-4]|7[2-8]|8[24-7]|9[2-7])\\d{4}|6(?:0[23]|1[2356]|[24][2-6]|3[24-6]|5[2-4]|6[2-8]|7(?:[2367]|4\\d|5\\d?|8[145]\\d)|8[245]|9[24])\\d{4}|7(?:[04][24-8]|[15][2-7]|22|3[2-4])\\d{4}|8(?:1(?:2\\d{1,2}|[3-689]\\d)|2(?:2\\d|3(?:\\d|20)|[4-8]\\d)|3[24]\\d|4[24-7]\\d|5[245]\\d|6[23]\\d)\\d{3}",
"\\d{5,9}",,,"1234567",,,[6,7,8,9]],[,,"17[01]\\d{4}|9(?:2(?:[0-4]|5\\d{2}|6[0-5]\\d)|3[0-36]\\d|4(?:0[0-4]\\d|[1379]\\d|2\\d{2}|4[0-589]\\d|5\\d{2}|88)|5[0-6]|61?\\d|7(?:3\\d|[789]\\d{2})|8\\d|9(?:1\\d|[67]\\d{2}|[089]))\\d{5}","\\d{7,10}",,,"92123456",,,[7,8,9,10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"1333\\d{4}","\\d{8}",,,"13331234",,,[8]],"MM",95,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["1|2[245]"],"0$1"],[,"(2)(\\d{4})(\\d{4})",
"$1 $2 $3",["251"],"0$1"],[,"(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["67|81"],"0$1"],[,"(\\d{2})(\\d{2})(\\d{3,4})","$1 $2 $3",["[4-8]"],"0$1"],[,"(9)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],[,"(9)([34]\\d{4})(\\d{4})","$1 $2 $3",["9(?:3[0-36]|4[0-57-9])"],"0$1"],[,"(9)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92[56]"],"0$1"],[,"(9)(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["93"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,
"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MN:[,[,,"[12]\\d{7,9}|[57-9]\\d{7}","\\d{6,10}",,,,,,[8,9,10],[6,7]],[,,"[12](?:1\\d|2(?:[1-3]\\d?|7\\d)|3[2-8]\\d{1,2}|4[2-68]\\d{1,2}|5[1-4689]\\d{1,2})\\d{5}|5[0568]\\d{6}","\\d{6,10}",,,"50123456"],[,,"(?:8(?:[05689]\\d|3[01])|9[013-9]\\d)\\d{5}","\\d{8}",,,"88123456",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"7[05-8]\\d{6}","\\d{8}",,,"75123456",,,[8]],"MN",
976,"001","0",,,"0",,,,[[,"([12]\\d)(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],[,"([12]2\\d)(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],[,"([12]\\d{3})(\\d{5})","$1 $2",["[12](?:27|[3-5])","[12](?:27|[3-5]\\d)2"],"0$1"],[,"(\\d{4})(\\d{4})","$1 $2",["[57-9]"],"$1"],[,"([12]\\d{4})(\\d{4,5})","$1 $2",["[12](?:27|[3-5])","[12](?:27|[3-5]\\d)[4-9]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MO:[,[,,"[268]\\d{7}","\\d{8}",,,,,,[8]],
[,,"(?:28[2-57-9]|8[2-57-9]\\d)\\d{5}","\\d{8}",,,"28212345"],[,,"6(?:[2356]\\d|8[158])\\d{5}","\\d{8}",,,"66123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"MO",853,"00",,,,,,,,[[,"([268]\\d{3})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MP:[,[,,"[5689]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"670(?:2(?:3[3-7]|56|8[5-8])|32[1238]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[589]|8[3-9]8|989)\\d{4}",
"\\d{7}(?:\\d{3})?",,,"6702345678"],[,,"670(?:2(?:3[3-7]|56|8[5-8])|32[1238]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[589]|8[3-9]8|989)\\d{4}","\\d{7}(?:\\d{3})?",,,"6702345678"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"MP",1,"011","1",,,"1",,,1,,,[,,"NA","NA",,,,,,[-1]],,"670",[,,"NA","NA",,,,,,[-1]],[,,"NA",
"NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MQ:[,[,,"[56]\\d{8}","\\d{9}",,,,,,[9]],[,,"596(?:0[2-5]|[12]0|3[05-9]|4[024-8]|[5-7]\\d|89|9[4-8])\\d{4}","\\d{9}",,,"596301234"],[,,"696(?:[0-479]\\d|5[013]|8[0-689])\\d{4}","\\d{9}",,,"696201234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"MQ",596,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],
[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MR:[,[,,"[2-48]\\d{7}","\\d{8}",,,,,,[8]],[,,"25[08]\\d{5}|35\\d{6}|45[1-7]\\d{5}","\\d{8}",,,"35123456"],[,,"[234][0-46-9]\\d{6}","\\d{8}",,,"22123456"],[,,"800\\d{5}","\\d{8}",,,"80012345"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"MR",222,"00",,,,,,,,[[,"([2-48]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA",
"NA",,,,,,[-1]]],MS:[,[,,"[5689]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"664491\\d{4}","\\d{7}(?:\\d{3})?",,,"6644912345"],[,,"66449[2-6]\\d{4}","\\d{10}",,,"6644923456"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"MS",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"664",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,
,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MT:[,[,,"[2357-9]\\d{7}","\\d{8}",,,,,,[8]],[,,"2(?:0(?:1[0-6]|3[1-4]|[69]\\d)|[1-357]\\d{2})\\d{4}","\\d{8}",,,"21001234"],[,,"(?:7(?:210|[79]\\d{2})|9(?:2(?:1[01]|31)|696|8(?:1[1-3]|89|97)|9\\d{2}))\\d{4}","\\d{8}",,,"96961234"],[,,"800[3467]\\d{4}","\\d{8}",,,"80071234"],[,,"5(?:0(?:0(?:37|43)|6\\d{2}|70\\d|9[0168]\\d)|[12]\\d0[1-5])\\d{3}","\\d{8}",,,"50037123"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"3550\\d{4}","\\d{8}",,,"35501234"],"MT",356,
"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2"]],,[,,"7117\\d{4}","\\d{8}",,,"71171234"],,,[,,"NA","NA",,,,,,[-1]],[,,"501\\d{5}","\\d{8}",,,"50112345"],,,[,,"NA","NA",,,,,,[-1]]],MU:[,[,,"[2-9]\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"(?:2(?:[03478]\\d|1[0-7]|6[1-69])|4(?:[013568]\\d|2[4-7])|5(?:44\\d|471)|6\\d{2}|8(?:14|3[129]))\\d{4}","\\d{7,8}",,,"2012345"],[,,"5(?:2[59]\\d|4(?:2[1-389]|4\\d|7[1-9]|9\\d)|7\\d{2}|8(?:[0-25689]\\d|7[15-8])|9[0-8]\\d)\\d{4}","\\d{8}",,,"52512345",,,[8]],[,,"80[012]\\d{4}",
"\\d{7}",,,"8001234",,,[7]],[,,"30\\d{5}","\\d{7}",,,"3012345",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"3(?:20|9\\d)\\d{4}","\\d{7}",,,"3201234",,,[7]],"MU",230,"0(?:0|[2-7]0|33)",,,,,,"020",,[[,"([2-46-9]\\d{2})(\\d{4})","$1 $2",["[2-46-9]"]],[,"(5\\d{3})(\\d{4})","$1 $2",["5"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MV:[,[,,"[3467]\\d{6}|9(?:00\\d{7}|\\d{6})","\\d{7,10}",,,,,,[7,10]],[,,"(?:3(?:0[01]|3[0-59])|6(?:[567][02468]|8[024689]|90))\\d{4}",
"\\d{7}",,,"6701234",,,[7]],[,,"(?:46[46]|7[3-9]\\d|9[15-9]\\d)\\d{4}","\\d{7}",,,"7712345",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"900\\d{7}","\\d{10}",,,"9001234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"MV",960,"0(?:0|19)",,,,,,"00",,[[,"(\\d{3})(\\d{4})","$1-$2",["[3467]|9(?:[1-9]|0[1-9])"]],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["900"]]],,[,,"781\\d{4}","\\d{7}",,,"7812345",,,[7]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],
MW:[,[,,"(?:1(?:\\d{2})?|[2789]\\d{2})\\d{6}","\\d{7,9}",,,,,,[7,9]],[,,"(?:1[2-9]|21\\d{2})\\d{5}","\\d{7,9}",,,"1234567"],[,,"(?:111|77\\d|88\\d|99\\d)\\d{6}","\\d{9}",,,"991234567",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"MW",265,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1"],"0$1"],[,"(2\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1789]"],
"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MX:[,[,,"[1-9]\\d{9,10}","\\d{7,11}",,,,,,[10,11],[7,8]],[,,"(?:33|55|81)\\d{8}|(?:2(?:0[01]|2[2-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|7[1-8]|9[1-5])|4(?:1[1-57-9]|[24-6][1-9]|[37][1-8]|8[1-35-9]|9[2-689])|5(?:88|9[1-79])|6(?:1[2-68]|[234][1-9]|5[1-3689]|6[12457-9]|7[1-7]|8[67]|9[4-8])|7(?:[13467][1-9]|2[1-8]|5[13-9]|8[1-69]|9[17])|8(?:2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69][1-9]|7[12]|8[1-8]))\\d{7}",
"\\d{7,10}",,,"2221234567",,,[10]],[,,"1(?:(?:33|55|81)\\d{8}|(?:2(?:2[2-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|7[1-8]|9[1-5])|4(?:1[1-57-9]|[24-6][1-9]|[37][1-8]|8[1-35-9]|9[2-689])|5(?:88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-3689]|6[12457-9]|7[1-7]|8[67]|9[4-8])|7(?:[13467][1-9]|2[1-8]|5[13-9]|8[1-69]|9[17])|8(?:2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69][1-9]|7[12]|8[1-8]))\\d{7})","\\d{11}",,,"12221234567",,,
[11]],[,,"8(?:00|88)\\d{7}","\\d{10}",,,"8001234567",,,[10]],[,,"900\\d{7}","\\d{10}",,,"9001234567",,,[10]],[,,"300\\d{7}","\\d{10}",,,"3001234567",,,[10]],[,,"500\\d{7}","\\d{10}",,,"5001234567",,,[10]],[,,"NA","NA",,,,,,[-1]],"MX",52,"0[09]","01",,,"0[12]|04[45](\\d{10})","1$1",,,[[,"([358]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["33|55|81"],"01 $1",,1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2467]|3[0-2457-9]|5[089]|8[02-9]|9[0-35-9]"],"01 $1",,1],[,"(1)([358]\\d)(\\d{4})(\\d{4})","044 $2 $3 $4",
["1(?:33|55|81)"],"$1",,1],[,"(1)(\\d{3})(\\d{3})(\\d{4})","044 $2 $3 $4",["1(?:[2467]|3[0-2457-9]|5[089]|8[2-9]|9[1-35-9])"],"$1",,1]],[[,"([358]\\d)(\\d{4})(\\d{4})","$1 $2 $3",["33|55|81"],"01 $1",,1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2467]|3[0-2457-9]|5[089]|8[02-9]|9[0-35-9]"],"01 $1",,1],[,"(1)([358]\\d)(\\d{4})(\\d{4})","$1 $2 $3 $4",["1(?:33|55|81)"]],[,"(1)(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1(?:[2467]|3[0-2457-9]|5[089]|8[2-9]|9[1-35-9])"]]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA",
"NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],MY:[,[,,"[13-9]\\d{7,9}","\\d{6,10}",,,,,,[8,9,10],[6,7]],[,,"(?:3[2-9]\\d|[4-9][2-9])\\d{6}","\\d{6,9}",,,"323456789",,,[8,9]],[,,"1(?:1[1-5]\\d{2}|[02-4679][2-9]\\d|59\\d{2}|8(?:1[23]|[2-9]\\d))\\d{5}","\\d{9,10}",,,"123456789",,,[9,10]],[,,"1[378]00\\d{6}","\\d{10}",,,"1300123456",,,[10]],[,,"1600\\d{6}","\\d{10}",,,"1600123456",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"154\\d{7}","\\d{10}",,,"1541234567",,,[10]],
"MY",60,"00","0",,,"0",,,,[[,"([4-79])(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],[,"(3)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],[,"([18]\\d)(\\d{3})(\\d{3,4})","$1-$2 $3",["1[02-46-9][1-9]|8"],"0$1"],[,"(1)([36-8]00)(\\d{2})(\\d{4})","$1-$2-$3-$4",["1[36-8]0"]],[,"(11)(\\d{4})(\\d{4})","$1-$2 $3",["11"],"0$1"],[,"(15[49])(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],MZ:[,[,,"[28]\\d{7,8}","\\d{8,9}",
,,,,,[8,9]],[,,"2(?:[1346]\\d|5[0-2]|[78][12]|93)\\d{5}","\\d{8}",,,"21123456",,,[8]],[,,"8[23467]\\d{7}","\\d{9}",,,"821234567",,,[9]],[,,"800\\d{6}","\\d{9}",,,"800123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"MZ",258,"00",,,,,,,,[[,"([28]\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-7]"]],[,"(80\\d)(\\d{3})(\\d{3})","$1 $2 $3",["80"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],
NA:[,[,,"[68]\\d{7,8}","\\d{8,9}",,,,,,[8,9]],[,,"6(?:1(?:17|2(?:[0189]\\d|[2-6]|7\\d?)|3(?:[01378]|2\\d)|4(?:[024]|10?|3[15]?)|69|7[014])|2(?:17|5(?:[0-36-8]|4\\d?)|69|70)|3(?:17|2(?:[0237]\\d?|[14-689])|34|6[289]|7[01]|81)|4(?:17|2(?:[012]|7\\d?)|4(?:[06]|1\\d?)|5(?:[01357]|[25]\\d?)|69|7[01])|5(?:17|2(?:[0459]|[23678]\\d?)|69|7[01])|6(?:17|2(?:5|6\\d?)|38|42|69|7[01])|7(?:17|2(?:[569]|[234]\\d?)|3(?:0\\d?|[13])|69|7[01]))\\d{4}","\\d{8,9}",,,"61221234"],[,,"(?:60|8[125])\\d{7}","\\d{9}",,,"811234567",
,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"8701\\d{5}","\\d{9}",,,"870123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"8(?:3\\d{2}|86)\\d{5}","\\d{8,9}",,,"88612345"],"NA",264,"00","0",,,"0",,,,[[,"(8\\d)(\\d{3})(\\d{4})","$1 $2 $3",["8[1235]"],"0$1"],[,"(6\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],[,"(88)(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],[,"(870)(\\d{3})(\\d{3})","$1 $2 $3",["870"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA",
"NA",,,,,,[-1]]],NC:[,[,,"[2-57-9]\\d{5}","\\d{6}",,,,,,[6]],[,,"(?:2[03-9]|3[0-5]|4[1-7]|88)\\d{4}","\\d{6}",,,"201234"],[,,"(?:5[0-4]|[79]\\d|8[0-79])\\d{4}","\\d{6}",,,"751234"],[,,"NA","NA",,,,,,[-1]],[,,"36\\d{4}","\\d{6}",,,"366711"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"NC",687,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[2-46-9]|5[0-4]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],NE:[,
[,,"[0289]\\d{7}","\\d{8}",,,,,,[8]],[,,"2(?:0(?:20|3[1-7]|4[134]|5[14]|6[14578]|7[1-578])|1(?:4[145]|5[14]|6[14-68]|7[169]|88))\\d{4}","\\d{8}",,,"20201234"],[,,"(?:8[089]|9\\d)\\d{6}","\\d{8}",,,"93123456"],[,,"08\\d{6}","\\d{8}",,,"08123456"],[,,"09\\d{6}","\\d{8}",,,"09123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"NE",227,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[289]|09"]],[,"(08)(\\d{3})(\\d{3})","$1 $2 $3",["08"]]],,[,,"NA","NA",
,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],NF:[,[,,"[13]\\d{5}","\\d{5,6}",,,,,,[6],[5]],[,,"(?:1(?:06|17|28|39)|3[012]\\d)\\d{3}","\\d{5,6}",,,"106609"],[,,"3[58]\\d{4}","\\d{5,6}",,,"381234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"NF",672,"00",,,,,,,,[[,"(\\d{2})(\\d{4})","$1 $2",["1"]],[,"(\\d)(\\d{5})","$1 $2",["3"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],
[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],NG:[,[,,"[1-6]\\d{5,8}|9\\d{5,9}|[78]\\d{5,13}","\\d{5,14}",,,,,,[7,8,10,11,12,13,14],[5,6]],[,,"[12]\\d{6,7}|9(?:0[3-9]|[1-9]\\d)\\d{5}|(?:3\\d|4[023568]|5[02368]|6[02-469]|7[4-69]|8[2-9])\\d{6}|(?:4[47]|5[14579]|6[1578]|7[0-357])\\d{5,6}|(?:78|41)\\d{5}","\\d{5,8}",,,"12345678",,,[7,8]],[,,"(?:1(?:7[34]\\d|8(?:04|[124579]\\d|8[0-3])|95\\d)|287[0-7]|3(?:18[1-8]|88[0-7]|9(?:8[5-9]|6[1-5]))|4(?:28[0-2]|6(?:7[1-9]|8[02-47])|88[0-2])|5(?:2(?:7[7-9]|8\\d)|38[1-79]|48[0-7]|68[4-7])|6(?:2(?:7[7-9]|8\\d)|4(?:3[7-9]|[68][129]|7[04-69]|9[1-8])|58[0-2]|98[7-9])|7(?:38[0-7]|69[1-8]|78[2-4])|8(?:28[3-9]|38[0-2]|4(?:2[12]|3[147-9]|5[346]|7[4-9]|8[014-689]|90)|58[1-8]|78[2-9]|88[5-7])|98[07]\\d)\\d{4}|(?:70[1-689]\\d|8(?:0(?:1[01]|[2-9]\\d)|1(?:[0-8]\\d|9[01]))|90[2357-9]\\d)\\d{6}",
"\\d{8,10}",,,"8021234567",,,[8,10]],[,,"800\\d{7,11}","\\d{10,14}",,,"80017591759",,,[10,11,12,13,14]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"NG",234,"009","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|9(?:0[3-9]|[1-9])"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["70|8[01]|90[2357-9]"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-6]|7(?:[1-79]|0[1-9])|8[2-9]"],"0$1"],[,"([78]00)(\\d{4})(\\d{4,5})","$1 $2 $3",
["[78]00"],"0$1"],[,"([78]00)(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]00"],"0$1"],[,"(78)(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"700\\d{7,11}","\\d{10,14}",,,"7001234567",,,[10,11,12,13,14]],,,[,,"NA","NA",,,,,,[-1]]],NI:[,[,,"[12578]\\d{7}","\\d{8}",,,,,,[8]],[,,"2\\d{7}","\\d{8}",,,"21234567"],[,,"5(?:5[0-7]\\d{5}|[78]\\d{6})|7[5-8]\\d{6}|8\\d{7}","\\d{8}",,,"81234567"],[,,"1800\\d{4}","\\d{8}",,,"18001234"],[,,"NA","NA",,,,,,[-1]],[,,"NA",
"NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"NI",505,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],NL:[,[,,"1\\d{4,8}|[2-7]\\d{8}|[89]\\d{6,9}","\\d{5,10}",,,,,,[5,6,7,8,9,10]],[,,"(?:1[0135-8]|2[02-69]|3[0-68]|4[0135-9]|[57]\\d|8[478])\\d{7}","\\d{9}",,,"101234567",,,[9]],[,,"6[1-58]\\d{7}","\\d{9}",,,"612345678",,,[9]],[,,"800\\d{4,7}","\\d{7,10}",,,"8001234",,,[7,8,9,10]],[,,
"90[069]\\d{4,7}","\\d{7,10}",,,"9061234",,,[7,8,9,10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"(?:6760|85\\d{2})\\d{5}","\\d{9}",,,"851234567",,,[9]],"NL",31,"00","0",,,"0",,,,[[,"([1-578]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1[035]|2[0346]|3[03568]|4[0356]|5[0358]|7|8[4578]"],"0$1"],[,"([1-5]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],[,"(6)(\\d{8})","$1 $2",["6[0-57-9]"],"0$1"],[,"(66)(\\d{7})","$1 $2",["66"],"0$1"],[,"(14)(\\d{3,4})","$1 $2",
["14"],"$1"],[,"([89]0\\d)(\\d{4,7})","$1 $2",["80|9"],"0$1"]],,[,,"66\\d{7}","\\d{9}",,,"662345678",,,[9]],,,[,,"14\\d{3,4}","\\d{5,6}",,,,,,[5,6]],[,,"140(?:1(?:[035]|[16-8]\\d)|2(?:[0346]|[259]\\d)|3(?:[03568]|[124]\\d)|4(?:[0356]|[17-9]\\d)|5(?:[0358]|[124679]\\d)|7\\d|8[458])","\\d{5,6}",,,"14020",,,[5,6]],,,[,,"NA","NA",,,,,,[-1]]],NO:[,[,,"0\\d{4}|[2-9]\\d{7}","\\d{5}(?:\\d{3})?",,,,,,[5,8]],[,,"(?:2[1-4]|3[1-3578]|5[1-35-7]|6[1-4679]|7[0-8])\\d{6}","\\d{8}",,,"21234567",,,[8]],[,,"(?:4[015-8]|5[89]|87|9\\d)\\d{6}",
"\\d{8}",,,"40612345",,,[8]],[,,"80[01]\\d{5}","\\d{8}",,,"80012345",,,[8]],[,,"82[09]\\d{5}","\\d{8}",,,"82012345",,,[8]],[,,"810(?:0[0-6]|[2-8]\\d)\\d{3}","\\d{8}",,,"81021234",,,[8]],[,,"880\\d{5}","\\d{8}",,,"88012345",,,[8]],[,,"85[0-5]\\d{5}","\\d{8}",,,"85012345",,,[8]],"NO",47,"00",,,,,,,,[[,"([489]\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[489]"]],[,"([235-7]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-7]"]]],,[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]],[,,"0\\d{4}|81(?:0(?:0[7-9]|1\\d)|5\\d{2})\\d{3}",
"\\d{5}(?:\\d{3})?",,,"01234"],1,,[,,"81[23]\\d{5}","\\d{8}",,,"81212345",,,[8]]],NP:[,[,,"[1-8]\\d{7}|9(?:[1-69]\\d{6,8}|7[2-6]\\d{5,7}|8\\d{8})","\\d{6,10}",,,,,,[8,10],[6,7]],[,,"(?:1[0-6]\\d|2[13-79][2-6]|3[135-8][2-6]|4[146-9][2-6]|5[135-7][2-6]|6[13-9][2-6]|7[15-9][2-6]|8[1-46-9][2-6]|9[1-79][2-6])\\d{5}","\\d{6,8}",,,"14567890",,,[8]],[,,"9(?:6[013]|7[245]|8[0-24-6])\\d{7}","\\d{10}",,,"9841234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",
,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"NP",977,"00","0",,,"0",,,,[[,"(1)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],[,"(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-69]|7[15-9])"],"0$1"],[,"(9\\d{2})(\\d{7})","$1-$2",["9(?:6[013]|7[245]|8)"],"$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],NR:[,[,,"[458]\\d{6}","\\d{7}",,,,,,[7]],[,,"(?:444|888)\\d{4}","\\d{7}",,,"4441234"],[,,"55[5-9]\\d{4}","\\d{7}",,,"5551234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",
,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"NR",674,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],NU:[,[,,"[1-5]\\d{3}","\\d{4}",,,,,,[4]],[,,"[34]\\d{3}","\\d{4}",,,"4002"],[,,"[125]\\d{3}","\\d{4}",,,"1234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"NU",683,"00",,,,,,,,,,[,,"NA",
"NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],NZ:[,[,,"6[235-9]\\d{6}|[2-57-9]\\d{7,10}","\\d{7,11}",,,,,,[8,9,10,11],[7]],[,,"(?:3[2-79]|[49][2-9]|6[235-9]|7[2-57-9])\\d{6}|24099\\d{3}","\\d{7,8}",,,"32345678",,,[8]],[,,"2(?:[028]\\d{7,8}|1(?:[03]\\d{5,7}|[12457]\\d{5,6}|[689]\\d{5})|[79]\\d{7})","\\d{8,10}",,,"211234567",,,[8,9,10]],[,,"508\\d{6,7}|80\\d{6,8}","\\d{8,10}",,,"800123456",,,[8,9,10]],[,,"90\\d{7,9}","\\d{9,11}",,,"900123456",,,[9,10,11]],
[,,"NA","NA",,,,,,[-1]],[,,"70\\d{7}","\\d{9}",,,"701234567",,,[9]],[,,"NA","NA",,,,,,[-1]],"NZ",64,"0(?:0|161)","0",,,"0",,"00",,[[,"([34679])(\\d{3})(\\d{4})","$1-$2 $3",["[346]|7[2-57-9]|9[1-9]"],"0$1"],[,"(24099)(\\d{3})","$1 $2",["240","2409","24099"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["21"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:1[1-9]|[69]|7[0-35-9])|70|86"],"0$1"],[,"(2\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["2[028]"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",
["2(?:10|74)|5|[89]0"],"0$1"]],,[,,"[28]6\\d{6,7}","\\d{8,9}",,,"26123456",,,[8,9]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],OM:[,[,,"(?:5|[279]\\d)\\d{6}|800\\d{5,6}","\\d{7,9}",,,,,,[7,8,9]],[,,"2[2-6]\\d{6}","\\d{8}",,,"23123456",,,[8]],[,,"7[19]\\d{6}|9(?:0[1-9]|[1-9]\\d)\\d{5}","\\d{8}",,,"92123456",,,[8]],[,,"8007\\d{4,5}|500\\d{4}","\\d{7,9}",,,"80071234"],[,,"900\\d{5}","\\d{8}",,,"90012345",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA",
"NA",,,,,,[-1]],"OM",968,"00",,,,,,,,[[,"(2\\d)(\\d{6})","$1 $2",["2"]],[,"([79]\\d{3})(\\d{4})","$1 $2",["[79]"]],[,"([58]00)(\\d{4,6})","$1 $2",["[58]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PA:[,[,,"[1-9]\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"(?:1(?:0[0-8]|1[49]|2[37]|3[0137]|4[147]|5[05]|6[58]|7[0167]|8[58]|9[139])|2(?:[0235679]\\d|1[0-7]|4[04-9]|8[028])|3(?:[09]\\d|1[014-7]|2[0-3]|3[03]|4[03-57]|55|6[068]|7[06-8]|8[06-9])|4(?:3[013-69]|4\\d|7[0-589])|5(?:[01]\\d|2[0-7]|[56]0|79)|7(?:0[09]|2[0-267]|3[06]|[469]0|5[06-9]|7[0-24-79]|8[7-9])|8(?:09|[34]\\d|5[0134]|8[02])|9(?:0[6-9]|1[016-8]|2[036-8]|3[3679]|40|5[0489]|6[06-9]|7[046-9]|8[36-8]|9[1-9]))\\d{4}",
"\\d{7}",,,"2001234",,,[7]],[,,"(?:1[16]1|21[89]|8(?:1[01]|7[23]))\\d{4}|6(?:[024-9]\\d|1[0-5]|3[0-24-9])\\d{5}","\\d{7,8}",,,"60012345"],[,,"80[09]\\d{4}","\\d{7}",,,"8001234",,,[7]],[,,"(?:779|8(?:55|60|7[78])|9(?:00|81))\\d{4}","\\d{7}",,,"8601234",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"PA",507,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],[,"(\\d{4})(\\d{4})","$1-$2",["6"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,
,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PE:[,[,,"[14-9]\\d{7,8}","\\d{6,9}",,,,,,[8,9],[6,7]],[,,"(?:1\\d|4[1-4]|5[1-46]|6[1-7]|7[2-46]|8[2-4])\\d{6}","\\d{6,8}",,,"11234567",,,[8]],[,,"9\\d{8}","\\d{9}",,,"912345678",,,[9]],[,,"800\\d{5}","\\d{8}",,,"80012345",,,[8]],[,,"805\\d{5}","\\d{8}",,,"80512345",,,[8]],[,,"801\\d{5}","\\d{8}",,,"80112345",,,[8]],[,,"80[24]\\d{5}","\\d{8}",,,"80212345",,,[8]],[,,"NA","NA",,,,,,[-1]],"PE",51,"19(?:1[124]|77|90)00","0"," Anexo ",,"0",,,,[[,"(1)(\\d{7})","$1 $2",["1"],
"(0$1)"],[,"([4-8]\\d)(\\d{6})","$1 $2",["[4-7]|8[2-4]"],"(0$1)"],[,"(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],[,"(9\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PF:[,[,,"4\\d{5,7}|8\\d{7}","\\d{6}(?:\\d{2})?",,,,,,[6,8]],[,,"4(?:[09][45689]\\d|4)\\d{4}","\\d{6}(?:\\d{2})?",,,"40412345"],[,,"8[79]\\d{6}","\\d{8}",,,"87123456",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",
,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"PF",689,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4[09]|8[79]"]],[,"(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"44\\d{4}","\\d{6}",,,"441234",,,[6]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PG:[,[,,"[1-9]\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"(?:3[0-2]\\d|4[25]\\d|5[34]\\d|64[1-9]|77(?:[0-24]\\d|30)|85[02-46-9]|9[78]\\d)\\d{4}","\\d{7}",,,"3123456",,,[7]],[,,"(?:20150|68\\d{2}|7(?:[0-689]\\d|75)\\d{2})\\d{3}",
"\\d{7,8}",,,"6812345"],[,,"180\\d{4}","\\d{7}",,,"1801234",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"275\\d{4}","\\d{7}",,,"2751234",,,[7]],"PG",675,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[13-689]|27"]],[,"(\\d{4})(\\d{4})","$1 $2",["20|7"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PH:[,[,,"2\\d{5,7}|[3-9]\\d{7,9}|1800\\d{7,9}","\\d{5,13}",,,,,,[6,8,9,10,11,12,13],[5,7]],[,,"2\\d{5}(?:\\d{2})?|(?:3[2-68]|4[2-9]|5[2-6]|6[2-58]|7[24578]|8[2-8])\\d{7}|88(?:22\\d{6}|42\\d{4})",
"\\d{5,10}",,,"21234567",,,[6,8,9,10]],[,,"(?:81[37]|9(?:0[5-9]|1[024-9]|2[0-35-9]|3[02-9]|4[236-9]|50|7[34-79]|89|9[4-9]))\\d{7}","\\d{10}",,,"9051234567",,,[10]],[,,"1800\\d{7,9}","\\d{11,13}",,,"180012345678",,,[11,12,13]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"PH",63,"00","0",,,"0",,,,[[,"(2)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],[,"(2)(\\d{5})","$1 $2",["2"],"(0$1)"],[,"(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|5(?:22|44)|642|8(?:62|8[245])",
"3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],[,"(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],[,"([3-8]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[3-8]"],"(0$1)"],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["81|9"],"0$1"],[,"(1800)(\\d{3})(\\d{4})","$1 $2 $3",["1"]],[,"(1800)(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA",
"NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PK:[,[,,"1\\d{8}|[2-8]\\d{5,11}|9(?:[013-9]\\d{4,9}|2\\d(?:111\\d{6}|\\d{3,7}))","\\d{6,12}",,,,,,[8,9,10,11,12],[6,7]],[,,"(?:21|42)[2-9]\\d{7}|(?:2[25]|4[0146-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]\\d{6}|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8]))[2-9]\\d{5,6}|58[126]\\d{7}","\\d{6,10}",,,"2123456789",,,[9,10]],[,,"3(?:0\\d|1[0-6]|2[0-5]|3[0-7]|4[0-8]|55|64)\\d{7}",
"\\d{10}",,,"3012345678",,,[10]],[,,"800\\d{5}","\\d{8}",,,"80012345",,,[8]],[,,"900\\d{5}","\\d{8}",,,"90012345",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"122\\d{6}","\\d{9}",,,"122044444",,,[9]],[,,"NA","NA",,,,,,[-1]],"PK",92,"00","0",,,"0",,,,[[,"(\\d{2})(111)(\\d{3})(\\d{3})","$1 $2 $3 $4",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)1","(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)11","(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)111"],"(0$1)"],[,"(\\d{3})(111)(\\d{3})(\\d{3})",
"$1 $2 $3 $4",["2[349]|45|54|60|72|8[2-5]|9[2-9]","(?:2[349]|45|54|60|72|8[2-5]|9[2-9])\\d1","(?:2[349]|45|54|60|72|8[2-5]|9[2-9])\\d11","(?:2[349]|45|54|60|72|8[2-5]|9[2-9])\\d111"],"(0$1)"],[,"(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],[,"(\\d{3})(\\d{6,7})","$1 $2",["2[349]|45|54|60|72|8[2-5]|9[2-9]","(?:2[349]|45|54|60|72|8[2-5]|9[2-9])\\d[2-9]"],"(0$1)"],[,"(3\\d{2})(\\d{7})","$1 $2",["3"],"0$1"],[,"([15]\\d{3})(\\d{5,6})","$1 $2",["58[12]|1"],
"(0$1)"],[,"(586\\d{2})(\\d{5})","$1 $2",["586"],"(0$1)"],[,"([89]00)(\\d{3})(\\d{2})","$1 $2 $3",["[89]00"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"(?:2(?:[125]|3[2358]|4[2-4]|9[2-8])|4(?:[0-246-9]|5[3479])|5(?:[1-35-7]|4[2-467])|6(?:[1-8]|0[468])|7(?:[14]|2[236])|8(?:[16]|2[2-689]|3[23578]|4[3478]|5[2356])|9(?:1|22|3[27-9]|4[2-6]|6[3569]|9[2-7]))111\\d{6}","\\d{11,12}",,,"21111825888",,,[11,12]],,,[,,"NA","NA",,,,,,[-1]]],PL:[,[,,"[12]\\d{6,8}|[3-57-9]\\d{8}|6\\d{5,8}","\\d{6,9}",
,,,,,[6,7,8,9]],[,,"(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])\\d{7}|[12]2\\d{5}","\\d{6,9}",,,"123456789",,,[7,9]],[,,"(?:5[0137]|6[069]|7[2389]|88)\\d{7}","\\d{9}",,,"512345678",,,[9]],[,,"800\\d{6}","\\d{9}",,,"800123456",,,[9]],[,,"70\\d{7}","\\d{9}",,,"701234567",,,[9]],[,,"801\\d{6}","\\d{9}",,,"801234567",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"39\\d{7}","\\d{9}",,,"391234567",,,[9]],"PL",48,"00",,,,,,,,[[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[14]|2[0-57-9]|3[2-4]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145]"]],
[,"(\\d{2})(\\d{1})(\\d{4})","$1 $2 $3",["[12]2"]],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["26|39|5[0137]|6[0469]|7[02389]|8[08]"]],[,"(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],[,"(\\d{3})(\\d{3})","$1 $2",["64"]]],,[,,"64\\d{4,7}","\\d{6,9}",,,"641234567"],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PM:[,[,,"[45]\\d{5}","\\d{6}",,,,,,[6]],[,,"41\\d{4}","\\d{6}",,,"411234"],[,,"55\\d{4}","\\d{6}",,,"551234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,
,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"PM",508,"00","0",,,"0",,,,[[,"([45]\\d)(\\d{2})(\\d{2})","$1 $2 $3",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PR:[,[,,"[5789]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"(?:787|939)[2-9]\\d{6}","\\d{7}(?:\\d{3})?",,,"7872345678"],[,,"(?:787|939)[2-9]\\d{6}","\\d{7}(?:\\d{3})?",,,"7872345678"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],
[,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"PR",1,"011","1",,,"1",,,1,,,[,,"NA","NA",,,,,,[-1]],,"787|939",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PS:[,[,,"[24589]\\d{7,8}|1(?:[78]\\d{8}|[49]\\d{2,3})","\\d{4,10}",,,,,,[4,5,8,9,10],[7]],[,,"(?:22[234789]|42[45]|82[01458]|92[369])\\d{5}","\\d{7,8}",,,"22234567",,,[8]],[,,"5[69]\\d{7}","\\d{9}",,,
"599123456",,,[9]],[,,"1800\\d{6}","\\d{10}",,,"1800123456",,,[10]],[,,"1(?:4|9\\d)\\d{2}","\\d{4,5}",,,"19123",,,[4,5]],[,,"1700\\d{6}","\\d{10}",,,"1700123456",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"PS",970,"00","0",,,"0",,,,[[,"([2489])(2\\d{2})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],[,"(5[69]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],[,"(1[78]00)(\\d{3})(\\d{3})","$1 $2 $3",["1[78]"],"$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA",
"NA",,,,,,[-1]]],PT:[,[,,"[2-46-9]\\d{8}","\\d{9}",,,,,,[9]],[,,"2(?:[12]\\d|[35][1-689]|4[1-59]|6[1-35689]|7[1-9]|8[1-69]|9[1256])\\d{6}","\\d{9}",,,"212345678"],[,,"9(?:[1236]\\d{2}|480)\\d{5}","\\d{9}",,,"912345678"],[,,"80[02]\\d{6}","\\d{9}",,,"800123456"],[,,"6(?:0[178]|4[68])\\d{6}|76(?:0[1-57]|1[2-47]|2[237])\\d{5}","\\d{9}",,,"760123456"],[,,"80(?:8\\d|9[1579])\\d{5}","\\d{9}",,,"808123456"],[,,"884[0-4689]\\d{5}","\\d{9}",,,"884123456"],[,,"30\\d{7}","\\d{9}",,,"301234567"],"PT",351,"00",
,,,,,,,[[,"(2\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],[,"([2-46-9]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[3-9]|[346-9]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"7(?:0(?:7\\d|8[17]))\\d{5}","\\d{9}",,,"707123456"],,,[,,"600\\d{6}","\\d{9}",,,"600110000"]],PW:[,[,,"[2-8]\\d{6}","\\d{7}",,,,,,[7]],[,,"2552255|(?:277|345|488|5(?:35|44|87)|6(?:22|54|79)|7(?:33|47)|8(?:24|55|76))\\d{4}","\\d{7}",,,"2771234"],[,,"(?:6[234689]0|77[45789])\\d{4}","\\d{7}",,,"6201234"],[,,"NA","NA",,,,,
,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"PW",680,"01[12]",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],PY:[,[,,"5[0-5]\\d{4,7}|[2-46-9]\\d{5,8}","\\d{5,9}",,,,,,[6,7,8,9],[5]],[,,"(?:[26]1|3[289]|4[124678]|7[123]|8[1236])\\d{5,7}|(?:2(?:2[4568]|7[15]|9[1-5])|3(?:18|3[167]|4[2357]|51)|4(?:18|2[45]|3[12]|5[13]|64|71|9[1-47])|5(?:[1-4]\\d|5[0234])|6(?:3[1-3]|44|7[1-4678])|7(?:17|4[0-4]|6[1-578]|75|8[0-8])|858)\\d{5,6}",
"\\d{5,9}",,,"212345678",,,[7,8,9]],[,,"9(?:6[12]|[78][1-6]|9[1-5])\\d{6}","\\d{9}",,,"961456789",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"8700[0-4]\\d{4}","\\d{9}",,,"870012345",,,[9]],"PY",595,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{5})","$1 $2",["(?:[26]1|3[289]|4[124678]|7[123]|8[1236])"],"(0$1)"],[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["(?:[26]1|3[289]|4[124678]|7[123]|8[1236])"],"(0$1)"],[,"(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],
"0$1"],[,"(\\d{3})(\\d{6})","$1 $2",["9[1-9]"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8700"]],[,"(\\d{3})(\\d{4,5})","$1 $2",["[2-8][1-9]"],"(0$1)"],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8][1-9]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"[2-9]0\\d{4,7}","\\d{6,9}",,,"201234567"],,,[,,"NA","NA",,,,,,[-1]]],QA:[,[,,"[2-8]\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"4[04]\\d{6}","\\d{8}",,,"44123456",,,[8]],[,,"[3567]\\d{7}","\\d{8}",,,"33123456",,,[8]],[,,"800\\d{4}",
"\\d{7}",,,"8001234",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"QA",974,"00",,,,,,,,[[,"([28]\\d{2})(\\d{4})","$1 $2",["[28]"]],[,"([3-7]\\d{3})(\\d{4})","$1 $2",["[3-7]"]]],,[,,"2(?:[12]\\d|61)\\d{4}","\\d{7}",,,"2123456",,,[7]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],RE:[,[,,"[268]\\d{8}","\\d{9}",,,,,,[9]],[,,"262\\d{6}","\\d{9}",,,"262161234"],[,,"6(?:9[23]|47)\\d{6}","\\d{9}",,,"692123456"],[,,"80\\d{7}",
"\\d{9}",,,"801234567"],[,,"89[1-37-9]\\d{6}","\\d{9}",,,"891123456"],[,,"8(?:1[019]|2[0156]|84|90)\\d{6}","\\d{9}",,,"810123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"RE",262,"00","0",,,"0",,,,[[,"([268]\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],1,"262|6[49]|8",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],RO:[,[,,"2\\d{5,8}|[37-9]\\d{8}","\\d{6,9}",,,,,,[6,9]],[,,"2(?:1(?:\\d{7}|9\\d{3})|[3-6](?:\\d{7}|\\d9\\d{2}))|3[13-6]\\d{7}",
"\\d{6,9}",,,"211234567"],[,,"7(?:[0-8]\\d{2}|99\\d)\\d{5}","\\d{9}",,,"712345678",,,[9]],[,,"800\\d{6}","\\d{9}",,,"800123456",,,[9]],[,,"90[036]\\d{6}","\\d{9}",,,"900123456",,,[9]],[,,"801\\d{6}","\\d{9}",,,"801123456",,,[9]],[,,"802\\d{6}","\\d{9}",,,"802123456",,,[9]],[,,"NA","NA",,,,,,[-1]],"RO",40,"00","0"," int ",,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],[,"(21)(\\d{4})","$1 $2",["21"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[23][3-7]|[7-9]"],"0$1"],[,"(2\\d{2})(\\d{3})",
"$1 $2",["2[3-6]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"37\\d{7}","\\d{9}",,,"372123456",,,[9]],,,[,,"NA","NA",,,,,,[-1]]],RS:[,[,,"[126-9]\\d{4,11}|3(?:[0-79]\\d{3,10}|8[2-9]\\d{2,9})","\\d{5,12}",,,,,,[6,7,8,9,10,11,12],[5]],[,,"(?:1(?:[02-9][2-9]|1[1-9])\\d|2(?:[0-24-7][2-9]\\d|[389](?:0[2-9]|[2-9]\\d))|3(?:[0-8][2-9]\\d|9(?:[2-9]\\d|0[2-9])))\\d{3,8}","\\d{5,12}",,,"10234567",,,[7,8,9,10,11,12]],[,,"6(?:[0-689]|7\\d)\\d{6,7}","\\d{8,10}",,,"601234567",,,[8,9,10]],[,,
"800\\d{3,9}","\\d{6,12}",,,"80012345"],[,,"(?:90[0169]|78\\d)\\d{3,7}","\\d{6,12}",,,"90012345"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"RS",381,"00","0",,,"0",,,,[[,"([23]\\d{2})(\\d{4,9})","$1 $2",["(?:2[389]|39)0"],"0$1"],[,"([1-3]\\d)(\\d{5,10})","$1 $2",["1|2(?:[0-24-7]|[389][1-9])|3(?:[0-8]|9[1-9])"],"0$1"],[,"(6\\d)(\\d{6,8})","$1 $2",["6"],"0$1"],[,"([89]\\d{2})(\\d{3,9})","$1 $2",["[89]"],"0$1"],[,"(7[26])(\\d{4,9})","$1 $2",["7[26]"],"0$1"],[,"(7[08]\\d)(\\d{4,9})",
"$1 $2",["7[08]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"7[06]\\d{4,10}","\\d{6,12}",,,"700123456"],,,[,,"NA","NA",,,,,,[-1]]],RU:[,[,,"[3489]\\d{9}","\\d{10}",,,,,,[10]],[,,"(?:3(?:0[12]|4[1-35-79]|5[1-3]|65|8[1-58]|9[0145])|4(?:01|1[1356]|2[13467]|7[1-5]|8[1-7]|9[1-689])|8(?:1[1-8]|2[01]|3[13-6]|4[0-8]|5[15]|6[1-35-79]|7[1-37-9]))\\d{7}","\\d{10}",,,"3011234567"],[,,"9\\d{9}","\\d{10}",,,"9123456789"],[,,"80[04]\\d{7}","\\d{10}",,,"8001234567"],[,,"80[39]\\d{7}","\\d{10}",
,,"8091234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"RU",7,"810","8",,,"8",,"8~10",,[[,"(\\d{3})(\\d{2})(\\d{2})","$1-$2-$3",["[1-79]"],"$1",,1],[,"([3489]\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[34689]"],"8 ($1)",,1],[,"(7\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",,1]],[[,"([3489]\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[34689]"],"8 ($1)",,1],[,"(7\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",,1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA",
"NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],RW:[,[,,"[027-9]\\d{7,8}","\\d{8,9}",,,,,,[8,9]],[,,"2[258]\\d{7}|06\\d{6}","\\d{8,9}",,,"250123456"],[,,"7[238]\\d{7}","\\d{9}",,,"720123456",,,[9]],[,,"800\\d{6}","\\d{9}",,,"800123456",,,[9]],[,,"900\\d{6}","\\d{9}",,,"900123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"RW",250,"00","0",,,"0",,,,[[,"(2\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"$1"],[,"([7-9]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",
["[7-9]"],"0$1"],[,"(0\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],SA:[,[,,"1\\d{7,8}|(?:[2-467]|92)\\d{7}|5\\d{8}|8\\d{9}","\\d{7,10}",,,,,,[8,9,10],[7]],[,,"11\\d{7}|1?(?:2[24-8]|3[35-8]|4[3-68]|6[2-5]|7[235-7])\\d{6}","\\d{7,9}",,,"112345678",,,[8,9]],[,,"(?:5(?:[013-689]\\d|7[0-26-8])|811\\d)\\d{6}","\\d{9,10}",,,"512345678",,,[9,10]],[,,"800\\d{7}","\\d{10}",,,"8001234567",,,[10]],[,
,"NA","NA",,,,,,[-1]],[,,"92[05]\\d{6}","\\d{9}",,,"920012345",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"SA",966,"00","0",,,"0",,,,[[,"([1-467])(\\d{3})(\\d{4})","$1 $2 $3",["[1-467]"],"0$1"],[,"(1\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1[1-467]"],"0$1"],[,"(5\\d)(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],[,"(92\\d{2})(\\d{5})","$1 $2",["92"],"$1"],[,"(800)(\\d{3})(\\d{4})","$1 $2 $3",["80"],"$1"],[,"(811)(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",
,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SB:[,[,,"[1-9]\\d{4,6}","\\d{5,7}",,,,,,[5,7]],[,,"(?:1[4-79]|[23]\\d|4[0-2]|5[03]|6[0-37])\\d{3}","\\d{5}",,,"40123",,,[5]],[,,"48\\d{3}|7(?:30|[46-8]\\d|5[025-9]|9[0-5])\\d{4}|8[4-9]\\d{5}|9(?:1[2-9]|2[013-9]|3[0-2]|[46]\\d|5[0-46-9]|7[0-689]|8[0-79]|9[0-8])\\d{4}","\\d{5,7}",,,"7421234"],[,,"1[38]\\d{3}","\\d{5}",,,"18123",,,[5]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"5[12]\\d{3}","\\d{5}",,,"51123",
,,[5]],"SB",677,"0[01]",,,,,,,,[[,"(\\d{2})(\\d{5})","$1 $2",["[7-9]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SC:[,[,,"[2468]\\d{5,6}","\\d{6,7}",,,,,,[6,7]],[,,"4[2-46]\\d{5}","\\d{7}",,,"4217123",,,[7]],[,,"2[5-8]\\d{5}","\\d{7}",,,"2510123",,,[7]],[,,"8000\\d{2}","\\d{6}",,,"800000",,,[6]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"64\\d{5}","\\d{7}",,,"6412345",,,[7]],"SC",248,"0[0-2]",,,,,,"00",
,[[,"(\\d{3})(\\d{3})","$1 $2",["8"]],[,"(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SD:[,[,,"[19]\\d{8}","\\d{9}",,,,,,[9]],[,,"1(?:[125]\\d|8[3567])\\d{6}","\\d{9}",,,"121231234"],[,,"9[0-3569]\\d{7}","\\d{9}",,,"911231234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"SD",249,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{4})",
"$1 $2 $3",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SE:[,[,,"[1-35-9]\\d{5,11}|4\\d{6,8}","\\d{6,12}",,,,,,[6,7,8,9,10,12]],[,,"1(?:0[1-8]\\d{6}|[136]\\d{5,7}|(?:2[0-35]|4[0-4]|5[0-25-9]|7[13-6]|[89]\\d)\\d{5,6})|2(?:[136]\\d{5,7}|(?:2[0-7]|4[0136-8]|5[0138]|7[018]|8[01]|9[0-57])\\d{5,6})|3(?:[356]\\d{5,7}|(?:0[0-4]|1\\d|2[0-25]|4[056]|7[0-2]|8[0-3]|9[023])\\d{5,6})|4(?:[0246]\\d{5,7}|(?:1[013-8]|3[0135]|5[14-79]|7[0-246-9]|8[0156]|9[0-689])\\d{5,6})|5(?:0[0-6]|[15][0-5]|2[0-68]|3[0-4]|4\\d|6[03-5]|7[013]|8[0-79]|9[01])\\d{5,6}|6(?:[03]\\d{5,7}|(?:1[1-3]|2[0-4]|4[02-57]|5[0-37]|6[0-3]|7[0-2]|8[0247]|9[0-356])\\d{5,6})|8\\d{6,8}|9(?:0[1-9]\\d{4,6}|(?:1[0-68]|2\\d|3[02-5]|4[0-3]|5[0-4]|[68][01]|7[0135-8])\\d{5,6})",
"\\d{7,9}",,,"8123456",,,[7,8,9]],[,,"7[02369]\\d{7}","\\d{9}",,,"701234567",,,[9]],[,,"20\\d{4,7}","\\d{6,9}",,,"20123456",,,[6,7,8,9]],[,,"649\\d{6}|9(?:00|39|44)[1-8]\\d{3,6}","\\d{7,10}",,,"9001234567",,,[7,8,9,10]],[,,"77(?:0\\d{3}(?:\\d{3})?|[1-7]\\d{6})","\\d{6}(?:\\d{3})?",,,"771234567",,,[6,9]],[,,"75[1-8]\\d{6}","\\d{9}",,,"751234567",,,[9]],[,,"NA","NA",,,,,,[-1]],"SE",46,"00","0",,,"0",,,,[[,"(8)(\\d{2,3})(\\d{2,3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1"],[,"([1-69]\\d)(\\d{2,3})(\\d{2})(\\d{2})",
"$1-$2 $3 $4",["1[013689]|2[0136]|3[1356]|4[0246]|54|6[03]|90"],"0$1"],[,"([1-469]\\d)(\\d{3})(\\d{2})","$1-$2 $3",["1[136]|2[136]|3[356]|4[0246]|6[03]|90"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[0-5]|4[0-3])"],"0$1"],[,"(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[0-5]|4[0-3])"],"0$1"],[,"(7\\d)(\\d{3})(\\d{2})(\\d{2})",
"$1-$2 $3 $4",["7"],"0$1"],[,"(77)(\\d{2})(\\d{2})","$1-$2$3",["7"],"0$1"],[,"(20)(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1"],[,"(9[034]\\d)(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9[034]"],"0$1"],[,"(9[034]\\d)(\\d{4})","$1-$2",["9[034]"],"0$1"],[,"(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["25[245]|67[3-6]"],"0$1"]],[[,"(8)(\\d{2,3})(\\d{2,3})(\\d{2})","$1 $2 $3 $4",["8"]],[,"([1-69]\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[013689]|2[0136]|3[1356]|4[0246]|54|6[03]|90"]],
[,"([1-469]\\d)(\\d{3})(\\d{2})","$1 $2 $3",["1[136]|2[136]|3[356]|4[0246]|6[03]|90"]],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[0-5]|4[0-3])"]],[,"(\\d{3})(\\d{2,3})(\\d{2})","$1 $2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[0-5]|4[0-3])"]],[,"(7\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7"]],[,"(77)(\\d{2})(\\d{2})","$1 $2 $3",["7"]],
[,"(20)(\\d{2,3})(\\d{2})","$1 $2 $3",["20"]],[,"(9[034]\\d)(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["9[034]"]],[,"(9[034]\\d)(\\d{4})","$1 $2",["9[034]"]],[,"(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["25[245]|67[3-6]"]]],[,,"74[02-9]\\d{6}","\\d{9}",,,"740123456",,,[9]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"(?:25[245]|67[3-6])\\d{9}","\\d{12}",,,"254123456789",,,[12]]],SG:[,[,,"[36]\\d{7}|[17-9]\\d{7,10}","\\d{8,11}",,,,,,[8,10,11]],[,,"6[1-9]\\d{6}","\\d{8}",
,,"61234567",,,[8]],[,,"(?:8[1-8]|9[0-8])\\d{6}","\\d{8}",,,"81234567",,,[8]],[,,"1?800\\d{7}","\\d{10,11}",,,"18001234567",,,[10,11]],[,,"1900\\d{7}","\\d{11}",,,"19001234567",,,[11]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"3[12]\\d{6}","\\d{8}",,,"31234567",,,[8]],"SG",65,"0[0-3]\\d",,,,,,,,[[,"([3689]\\d{3})(\\d{4})","$1 $2",["[369]|8[1-9]"]],[,"(1[89]00)(\\d{3})(\\d{4})","$1 $2 $3",["1[89]"]],[,"(7000)(\\d{4})(\\d{3})","$1 $2 $3",["70"]],[,"(800)(\\d{3})(\\d{4})","$1 $2 $3",["80"]]],
,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"7000\\d{7}","\\d{11}",,,"70001234567",,,[11]],,,[,,"NA","NA",,,,,,[-1]]],SH:[,[,,"[256]\\d{4}","\\d{4,5}",,,,,,[4,5]],[,,"2(?:[0-57-9]\\d|6[4-9])\\d{2}","\\d{5}",,,"22158"],[,,"[56]\\d{4}","\\d{5}",,,,,,[5]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"262\\d{2}","\\d{5}",,,,,,[5]],"SH",290,"00",,,,,,,,,,[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA",
"NA",,,,,,[-1]]],SI:[,[,,"[1-7]\\d{6,7}|[89]\\d{4,7}","\\d{5,8}",,,,,,[5,6,7,8]],[,,"(?:1\\d|[25][2-8]|3[24-8]|4[24-8]|7[3-8])\\d{6}","\\d{7,8}",,,"11234567",,,[8]],[,,"(?:[37][01]|4[0139]|51|6[48])\\d{6}","\\d{8}",,,"31234567",,,[8]],[,,"80\\d{4,6}","\\d{6,8}",,,"80123456",,,[6,7,8]],[,,"90\\d{4,6}|89[1-3]\\d{2,5}","\\d{5,8}",,,"90123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"(?:59|8[1-3])\\d{6}","\\d{8}",,,"59012345",,,[8]],"SI",386,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{2})(\\d{2})",
"$1 $2 $3 $4",["[12]|3[24-8]|4[24-8]|5[2-8]|7[3-8]"],"(0$1)"],[,"([3-7]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],[,"([89][09])(\\d{3,6})","$1 $2",["[89][09]"],"0$1"],[,"([58]\\d{2})(\\d{5})","$1 $2",["59|8[1-3]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SJ:[,[,,"0\\d{4}|[4789]\\d{7}","\\d{5}(?:\\d{3})?",,,,,,[5,8]],[,,"79\\d{6}","\\d{8}",,,"79123456",,,[8]],[,,"(?:4[015-8]|5[89]|9\\d)\\d{6}","\\d{8}",,,"41234567",
,,[8]],[,,"80[01]\\d{5}","\\d{8}",,,"80012345",,,[8]],[,,"82[09]\\d{5}","\\d{8}",,,"82012345",,,[8]],[,,"810(?:0[0-6]|[2-8]\\d)\\d{3}","\\d{8}",,,"81021234",,,[8]],[,,"880\\d{5}","\\d{8}",,,"88012345",,,[8]],[,,"85[0-5]\\d{5}","\\d{8}",,,"85012345",,,[8]],"SJ",47,"00",,,,,,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"0\\d{4}|81(?:0(?:0[7-9]|1\\d)|5\\d{2})\\d{3}","\\d{5}(?:\\d{3})?",,,"01234"],1,,[,,"81[23]\\d{5}","\\d{8}",,,"81212345",,,[8]]],SK:[,[,,"(?:[2-68]\\d{5,8}|9\\d{6,8})","\\d{6,9}",
,,,,,[6,7,9]],[,,"2(?:16\\d{3,4}|\\d{8})|[3-5](?:[1-8]16\\d{2,3}|\\d{8})","\\d{6,9}",,,"212345678"],[,,"9(?:0(?:[1-8]\\d|9[1-9])|(?:1[0-24-9]|4[04589]|50)\\d)\\d{5}","\\d{9}",,,"912123456",,,[9]],[,,"800\\d{6}","\\d{9}",,,"800123456",,,[9]],[,,"9(?:[78]\\d{7}|00\\d{6})","\\d{9}",,,"900123456",,,[9]],[,,"8[5-9]\\d{7}","\\d{9}",,,"850123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"6(?:02|5[0-4]|9[0-6])\\d{6}","\\d{9}",,,"690123456",,,[9]],"SK",421,"00","0",,,"0",,,,[[,"(2)(16)(\\d{3,4})","$1 $2 $3",["216"],
"0$1"],[,"([3-5]\\d)(16)(\\d{2,3})","$1 $2 $3",["[3-5]"],"0$1"],[,"(2)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],[,"([3-5]\\d)(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"],[,"([689]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],[,"(9090)(\\d{3})","$1 $2",["9090"],"0$1"]],,[,,"9090\\d{3}","\\d{7}",,,"9090123",,,[7]],,,[,,"(?:602|8(?:00|[5-9]\\d)|9(?:00|[78]\\d))\\d{6}|9090\\d{3}","\\d{7,9}",,,"800123456",,,[7,9]],[,,"96\\d{7}","\\d{9}",,,"961234567",,,[9]],,,[,,"NA","NA",
,,,,,[-1]]],SL:[,[,,"[2-9]\\d{7}","\\d{6,8}",,,,,,[8],[6]],[,,"[235]2[2-4][2-9]\\d{4}","\\d{6,8}",,,"22221234"],[,,"(?:2[15]|3[03-5]|4[04]|5[05]|66|7[6-9]|88|99)\\d{6}","\\d{6,8}",,,"25123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"SL",232,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{6})","$1 $2",,"(0$1)"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SM:[,[,,"[05-7]\\d{7,9}",
"\\d{6,10}",,,,,,[8,10],[6]],[,,"0549(?:8[0157-9]|9\\d)\\d{4}","\\d{6,10}",,,"0549886377",,,[10]],[,,"6[16]\\d{6}","\\d{8}",,,"66661212",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"7[178]\\d{6}","\\d{8}",,,"71123456",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"5[158]\\d{6}","\\d{8}",,,"58001110",,,[8]],"SM",378,"00",,,,"(?:0549)?([89]\\d{5})","0549$1",,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],[,"(0549)(\\d{6})","$1 $2",["0"]],[,"(\\d{6})","0549 $1",["[89]"]]],[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})",
"$1 $2 $3 $4",["[5-7]"]],[,"(0549)(\\d{6})","($1) $2",["0"]],[,"(\\d{6})","(0549) $1",["[89]"]]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],SN:[,[,,"[3789]\\d{8}","\\d{9}",,,,,,[9]],[,,"3(?:0(?:1[0-2]|80)|282|3(?:8[1-9]|9[3-9])|611)\\d{5}","\\d{9}",,,"301012345"],[,,"7(?:[06-8]\\d|21|90)\\d{6}","\\d{9}",,,"701234567"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"88[4689]\\d{6}","\\d{9}",,,"884123456"],[,,"81[02468]\\d{6}","\\d{9}",,,"810123456"],
[,,"NA","NA",,,,,,[-1]],[,,"39[01]\\d{6}|3392\\d{5}|93330\\d{4}","\\d{9}",,,"933301234"],"SN",221,"00",,,,,,,,[[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]],[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SO:[,[,,"[1-79]\\d{6,8}","\\d{7,9}",,,,,,[7,8,9]],[,,"(?:1\\d|2[0-79]|3[0-46-8]|4[0-7]|59)\\d{5}","\\d{7}",,,"4012345",,,[7]],[,,"(?:15\\d|2(?:4\\d|8)|6[1-35-9]?\\d{2}|7(?:[1-8]\\d|99?\\d)|9(?:0[67]|[2-9])\\d)\\d{5}",
"\\d{7,9}",,,"71123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"SO",252,"00","0",,,"0",,,,[[,"(\\d)(\\d{6})","$1 $2",["2[0-79]|[13-5]"]],[,"(\\d)(\\d{7})","$1 $2",["24|[67]"]],[,"(\\d{2})(\\d{5,7})","$1 $2",["15|28|6[1-35-9]|799|9[2-9]"]],[,"(90\\d)(\\d{3})(\\d{3})","$1 $2 $3",["90"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SR:[,[,,"[2-8]\\d{5,6}","\\d{6,7}",
,,,,,[6,7]],[,,"(?:2[1-3]|3[0-7]|4\\d|5[2-58]|68\\d)\\d{4}","\\d{6,7}",,,"211234"],[,,"(?:7[124-7]|8[1-9])\\d{5}","\\d{7}",,,"7412345",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"5(?:6\\d{4}|90[0-4]\\d{3})","\\d{6,7}",,,"561234"],"SR",597,"00",,,,,,,,[[,"(\\d{3})(\\d{3})","$1-$2",["[2-4]|5[2-58]"]],[,"(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],[,"(\\d{3})(\\d{4})","$1-$2",["59|[6-8]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],
[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SS:[,[,,"[19]\\d{8}","\\d{9}",,,,,,[9]],[,,"18\\d{7}","\\d{9}",,,"181234567"],[,,"(?:12|9[1257])\\d{7}","\\d{9}",,,"977123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"SS",211,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",,"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],ST:[,[,,"[29]\\d{6}","\\d{7}",
,,,,,[7]],[,,"22\\d{5}","\\d{7}",,,"2221234"],[,,"9(?:0(?:0[5-9]|[1-9]\\d)|[89]\\d{2})\\d{3}","\\d{7}",,,"9812345"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"ST",239,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SV:[,[,,"[267]\\d{7}|[89]\\d{6}(?:\\d{4})?","\\d{7,8}|\\d{11}",,,,,,[7,8,11]],[,,"2[1-6]\\d{6}","\\d{8}",,,"21234567",
,,[8]],[,,"[67]\\d{7}","\\d{8}",,,"70123456",,,[8]],[,,"800\\d{4}(?:\\d{4})?","\\d{7}(?:\\d{4})?",,,"8001234",,,[7,11]],[,,"900\\d{4}(?:\\d{4})?","\\d{7}(?:\\d{4})?",,,"9001234",,,[7,11]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"SV",503,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2",["[267]"]],[,"(\\d{3})(\\d{4})","$1 $2",["[89]"]],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",
,,,,,[-1]]],SX:[,[,,"[5789]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"7215(?:4[2-8]|8[239]|9[056])\\d{4}","\\d{7}(?:\\d{3})?",,,"7215425678"],[,,"7215(?:1[02]|2\\d|5[034679]|8[014-8])\\d{4}","\\d{7}(?:\\d{3})?",,,"7215205678"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"SX",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,
,,,[-1]],,"721",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SY:[,[,,"[1-59]\\d{7,8}","\\d{6,9}",,,,,,[8,9],[6,7]],[,,"(?:1(?:1\\d?|4\\d|[2356])|2(?:1\\d?|[235])|3(?:[13]\\d|4)|4[13]|5[1-3])\\d{6}","\\d{6,9}",,,"112345678"],[,,"9(?:22|[3-589]\\d|6[024-9])\\d{6}","\\d{9}",,,"944567890",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"SY",963,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{3,4})",
"$1 $2 $3",["[1-5]"],"0$1",,1],[,"(9\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",,1]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],SZ:[,[,,"[027]\\d{7}","\\d{8}",,,,,,[8]],[,,"2[2-5]\\d{6}","\\d{8}",,,"22171234"],[,,"7[6-8]\\d{6}","\\d{8}",,,"76123456"],[,,"0800\\d{4}","\\d{8}",,,"08001234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"SZ",268,"00",,,,,,,,[[,"(\\d{4})(\\d{4})","$1 $2",["[027]"]]],
,[,,"NA","NA",,,,,,[-1]],,,[,,"0800\\d{4}","\\d{8}",,,"08001234"],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],TA:[,[,,"8\\d{3}","\\d{4}",,,,,,[-1,4]],[,,"8\\d{3}","\\d{4}",,,"8999",,,[4]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TA",290,"00",,,,,,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],TC:[,[,,"[5689]\\d{9}","\\d{7}(?:\\d{3})?",
,,,,,[10],[7]],[,,"649(?:712|9(?:4\\d|50))\\d{4}","\\d{7}(?:\\d{3})?",,,"6497121234"],[,,"649(?:2(?:3[129]|4[1-7])|3(?:3[1-389]|4[1-8])|4[34][1-3])\\d{4}","\\d{7}(?:\\d{3})?",,,"6492311234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"64971[01]\\d{4}","\\d{10}",,,"6497101234"],"TC",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"649",[,
,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],TD:[,[,,"[2679]\\d{7}","\\d{8}",,,,,,[8]],[,,"22(?:[3789]0|5[0-5]|6[89])\\d{4}","\\d{8}",,,"22501234"],[,,"(?:6[023568]\\d|77\\d|9\\d{2})\\d{5}","\\d{8}",,,"63012345"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TD",235,"00|16",,,,,,"00",,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA",
"NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],TG:[,[,,"[29]\\d{7}","\\d{8}",,,,,,[8]],[,,"2(?:2[2-7]|3[23]|44|55|66|77)\\d{5}","\\d{8}",,,"22212345"],[,,"9[0-389]\\d{6}","\\d{8}",,,"90112345"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TG",228,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],TH:[,[,,"[2-9]\\d{7,8}|1\\d{3}(?:\\d{5,6})?",
"\\d{4}|\\d{8,10}",,,,,,[4,8,9,10]],[,,"(?:2\\d|3[2-9]|4[2-5]|5[2-6]|7[3-7])\\d{6}","\\d{8}",,,"21234567",,,[8]],[,,"(?:14|6[1-5]|[89]\\d)\\d{7}","\\d{9}",,,"812345678",,,[9]],[,,"1800\\d{6}","\\d{10}",,,"1800123456",,,[10]],[,,"1900\\d{6}","\\d{10}",,,"1900123456",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"6[08]\\d{7}","\\d{9}",,,"601234567",,,[9]],"TH",66,"00","0",,,"0",,,,[[,"(2)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],[,"([13-9]\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["14|[3-9]"],
"0$1"],[,"(1[89]00)(\\d{3})(\\d{3})","$1 $2 $3",["1"],"$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"1\\d{3}","\\d{4}",,,"1100",,,[4]],[,,"1\\d{3}","\\d{4}",,,"1100",,,[4]],,,[,,"NA","NA",,,,,,[-1]]],TJ:[,[,,"[3-589]\\d{8}","\\d{3,9}",,,,,,[9],[3,5,7]],[,,"(?:3(?:1[3-5]|2[245]|3[12]|4[24-7]|5[25]|72)|4(?:46|74|87))\\d{6}","\\d{3,9}",,,"372123456"],[,,"(?:41[18]|5(?:0[125]|5\\d)|88\\d|9[0-35-9]\\d)\\d{6}","\\d{9}",,,"917123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA",
"NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TJ",992,"810","8",,,"8",,"8~10",,[[,"([349]\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[34]7|91[78]"],"(8) $1",,1],[,"([4589]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[148]|[58]|9(?:1[59]|[0235-9])"],"(8) $1",,1],[,"(331700)(\\d)(\\d{2})","$1 $2 $3",["331","3317","33170","331700"],"(8) $1",,1],[,"(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]","3(?:[1245]|3(?:[02-9]|1[0-589]))"],"(8) $1",,1]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,
"NA","NA",,,,,,[-1]]],TK:[,[,,"[2-47]\\d{3,6}","\\d{4,7}",,,,,,[4,5,6,7]],[,,"(?:2[2-4]|[34]\\d)\\d{2,5}","\\d{4,7}",,,"3101"],[,,"7[2-4]\\d{2,5}","\\d{4,7}",,,"7290"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TK",690,"00",,,,,,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],TL:[,[,,"[2-489]\\d{6}|7\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"(?:2[1-5]|3[1-9]|4[1-4])\\d{5}",
"\\d{7}",,,"2112345",,,[7]],[,,"7[3-8]\\d{6}","\\d{8}",,,"77212345",,,[8]],[,,"80\\d{5}","\\d{7}",,,"8012345",,,[7]],[,,"90\\d{5}","\\d{7}",,,"9012345",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"70\\d{5}","\\d{7}",,,"7012345",,,[7]],[,,"NA","NA",,,,,,[-1]],"TL",670,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[2-489]"]],[,"(\\d{4})(\\d{4})","$1 $2",["7"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],TM:[,[,,"[1-6]\\d{7}","\\d{8}",,,,,,[8]],[,,"(?:1(?:2\\d|3[1-9])|2(?:22|4[0-35-8])|3(?:22|4[03-9])|4(?:22|3[128]|4\\d|6[15])|5(?:22|5[7-9]|6[014-689]))\\d{5}",
"\\d{8}",,,"12345678"],[,,"6[1-9]\\d{6}","\\d{8}",,,"66123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TM",993,"810","8",,,"8",,"8~10",,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],[,"(\\d{2})(\\d{6})","$1 $2",["6"],"8 $1"],[,"(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["13|[2-5]"],"(8 $1)"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],
TN:[,[,,"[2-57-9]\\d{7}","\\d{8}",,,,,,[8]],[,,"3(?:[012]\\d|6[0-4]|91)\\d{5}|7\\d{7}|81200\\d{3}","\\d{8}",,,"71234567"],[,,"(?:[259]\\d|4[0-6])\\d{6}","\\d{8}",,,"20123456"],[,,"8010\\d{4}","\\d{8}",,,"80101234"],[,,"88\\d{6}","\\d{8}",,,"88123456"],[,,"8[12]10\\d{4}","\\d{8}",,,"81101234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TN",216,"00",,,,,,,,[[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,
[-1]]],TO:[,[,,"[02-8]\\d{4,6}","\\d{5,7}",,,,,,[5,7]],[,,"(?:2\\d|3[1-8]|4[1-4]|[56]0|7[0149]|8[05])\\d{3}","\\d{5}",,,"20123",,,[5]],[,,"(?:7[578]|8[47-9])\\d{5}","\\d{7}",,,"7715123",,,[7]],[,,"0800\\d{3}","\\d{7}",,,"0800222",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TO",676,"00",,,,,,,,[[,"(\\d{2})(\\d{3})","$1-$2",["[1-6]|7[0-4]|8[05]"]],[,"(\\d{3})(\\d{4})","$1 $2",["7[5-9]|8[47-9]"]],[,"(\\d{4})(\\d{3})","$1 $2",["0"]]],,[,,"NA",
"NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],TR:[,[,,"[2-589]\\d{9}|444\\d{4}","\\d{7,10}",,,,,,[7,10]],[,,"(?:2(?:[13][26]|[28][2468]|[45][268]|[67][246])|3(?:[13][28]|[24-6][2468]|[78][02468]|92)|4(?:[16][246]|[23578][2468]|4[26]))\\d{7}","\\d{10}",,,"2123456789",,,[10]],[,,"5(?:(?:0[1-7]|22|[34]\\d|5[1-59]|9[246])\\d{2}|6161)\\d{5}","\\d{10}",,,"5012345678",,,[10]],[,,"800\\d{7}","\\d{10}",,,"8001234567",,,[10]],[,,"900\\d{7}","\\d{10}",,,"9001234567",
,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TR",90,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[23]|4(?:[0-35-9]|4[0-35-9])"],"(0$1)",,1],[,"(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[02-69]"],"0$1",,1],[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["51|[89]"],"0$1",,1],[,"(444)(\\d{1})(\\d{3})","$1 $2 $3",["444"]]],,[,,"512\\d{7}","\\d{10}",,,"5123456789",,,[10]],,,[,,"444\\d{4}","\\d{7}",,,"4441444",,,[7]],[,,"444\\d{4}|850\\d{7}",
"\\d{7,10}",,,"4441444"],,,[,,"NA","NA",,,,,,[-1]]],TT:[,[,,"[589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"868(?:2(?:01|2[1-6]|3[1-5])|6(?:0[79]|1[02-8]|2[1-9]|[3-69]\\d|7[0-79])|82[124])\\d{4}","\\d{7}(?:\\d{3})?",,,"8682211234"],[,,"868(?:2(?:[789]\\d)|3(?:0[1-9]|1[02-9]|[2-9]\\d)|4[6-9]\\d|6(?:20|78|8\\d)|7(?:0[1-9]|1[02-9]|[2-9]\\d))\\d{4}","\\d{7}(?:\\d{3})?",,,"8682911234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,
,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"TT",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"868",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"868619\\d{4}","\\d{10}",,,"8686191234"]],TV:[,[,,"[279]\\d{4,6}","\\d{5,7}",,,,,,[5,6,7]],[,,"2[02-9]\\d{3}","\\d{5}",,,"20123",,,[5]],[,,"(?:70\\d|90)\\d{4}","\\d{6,7}",,,"901234",,,[6,7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",
,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"TV",688,"00",,,,,,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],TW:[,[,,"[2-689]\\d{7,8}|7\\d{7,9}","\\d{8,10}",,,,,,[8,9,10]],[,,"[2-8]\\d{7,8}","\\d{8,9}",,,"21234567",,,[8,9]],[,,"9\\d{8}","\\d{9}",,,"912345678",,,[9]],[,,"800\\d{6}","\\d{9}",,,"800123456",,,[9]],[,,"900\\d{6}","\\d{9}",,,"900123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"70\\d{8}","\\d{10}",,,"7012345678",,,[10]],
"TW",886,"0(?:0[25679]|19)","0","#",,"0",,,,[[,"([2-8])(\\d{3,4})(\\d{4})","$1 $2 $3",["[2-6]|[78][1-9]"],"0$1"],[,"([89]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["80|9"],"0$1"],[,"(70)(\\d{4})(\\d{4})","$1 $2 $3",["70"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],TZ:[,[,,"\\d{9}","\\d{7,9}",,,,,,[7,9]],[,,"2[2-8]\\d{7}","\\d{7,9}",,,"222345678"],[,,"(?:6[125-9]|7[1-9])\\d{7}","\\d{9}",,,"621234567",,,[9]],[,,"80[08]\\d{6}","\\d{9}",,,"800123456",
,,[9]],[,,"90\\d{7}","\\d{9}",,,"900123456",,,[9]],[,,"8(?:40|6[01])\\d{6}","\\d{9}",,,"840123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"41\\d{7}","\\d{9}",,,"412345678",,,[9]],"TZ",255,"00[056]","0",,,"0",,,,[[,"([24]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],[,"([67]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"],[,"([89]\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],UA:[,[,,"[3-9]\\d{8}",
"\\d{5,9}",,,,,,[9],[5,6,7]],[,,"(?:3[1-8]|4[13-8]|5[1-7]|6[12459])\\d{7}","\\d{5,9}",,,"311234567"],[,,"(?:39|50|6[36-8]|73|9[1-9])\\d{7}","\\d{9}",,,"391234567"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"900\\d{6}","\\d{9}",,,"900123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"89\\d{7}","\\d{9}",,,"891234567"],"UA",380,"00","0",,,"0",,"0~0",,[[,"([3-9]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[38]9|4(?:[45][0-5]|87)|5(?:0|6[37]|7[37])|6[36-8]|73|9[1-9]","[38]9|4(?:[45][0-5]|87)|5(?:0|6(?:3[14-7]|7)|7[37])|6[36-8]|73|9[1-9]"],
"0$1"],[,"([3-689]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["3[1-8]2|4[13678]2|5(?:[12457]2|6[24])|6(?:[49]2|[12][29]|5[24])|8[0-8]|90","3(?:[1-46-8]2[013-9]|52)|4(?:[1378]2|62[013-9])|5(?:[12457]2|6[24])|6(?:[49]2|[12][29]|5[24])|8[0-8]|90"],"0$1"],[,"([3-6]\\d{3})(\\d{5})","$1 $2",["3(?:5[013-9]|[1-46-8])|4(?:[137][013-9]|6|[45][6-9]|8[4-6])|5(?:[1245][013-9]|6[0135-9]|3|7[4-6])|6(?:[49][013-9]|5[0135-9]|[12][13-8])","3(?:5[013-9]|[1-46-8](?:22|[013-9]))|4(?:[137][013-9]|6(?:[013-9]|22)|[45][6-9]|8[4-6])|5(?:[1245][013-9]|6(?:3[02389]|[015689])|3|7[4-6])|6(?:[49][013-9]|5[0135-9]|[12][13-8])"],
"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],UG:[,[,,"\\d{9}","\\d{5,9}",,,,,,[9],[5,6,7]],[,,"20(?:[0147]\\d{2}|2(?:40|[5-9]\\d)|3(?:0[0-4]|[23]\\d)|5[0-4]\\d|6[035-9]\\d|8[0-2]\\d)\\d{4}|[34]\\d{8}","\\d{5,9}",,,"312345678"],[,,"7(?:(?:0[0-7]|[15789]\\d|30|4[0-4])\\d|2(?:[03]\\d|60))\\d{5}","\\d{9}",,,"712345678"],[,,"800[123]\\d{5}","\\d{9}",,,"800123456"],[,,"90[123]\\d{6}","\\d{9}",,,"901123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA",
"NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"UG",256,"00[057]","0",,,"0",,,,[[,"(\\d{3})(\\d{6})","$1 $2",["[7-9]|20(?:[013-8]|2[5-9])|4(?:6[45]|[7-9])"],"0$1"],[,"(\\d{2})(\\d{7})","$1 $2",["3|4(?:[1-5]|6[0-36-9])"],"0$1"],[,"(2024)(\\d{5})","$1 $2",["2024"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],US:[,[,,"[2-9]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"(?:2(?:0[1-35-9]|1[02-9]|2[04589]|3[149]|4[08]|5[1-46]|6[0279]|7[026]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[014679]|4[67]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-37]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[16]|5[017]|6[0-279]|78|8[12])|7(?:0[1-46-8]|1[02-9]|2[0457]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|28|3[0-25]|4[3578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[014678]|4[0179]|5[12469]|7[0-3589]|8[0459]))[2-9]\\d{6}",
"\\d{7}(?:\\d{3})?",,,"2015550123"],[,,"(?:2(?:0[1-35-9]|1[02-9]|2[04589]|3[149]|4[08]|5[1-46]|6[0279]|7[026]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[014679]|4[67]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-37]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[16]|5[017]|6[0-279]|78|8[12])|7(?:0[1-46-8]|1[02-9]|2[0457]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|28|3[0-25]|4[3578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[014678]|4[0179]|5[12469]|7[0-3589]|8[0459]))[2-9]\\d{6}",
"\\d{7}(?:\\d{3})?",,,"2015550123"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"US",1,"011","1",,,"1",,,1,[[,"(\\d{3})(\\d{4})","$1-$2",,,,1],[,"(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",,,,1]],[[,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3"]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA",
"NA",,,,,,[-1]]],UY:[,[,,"[2489]\\d{6,7}","\\d{7,8}",,,,,,[7,8]],[,,"2\\d{7}|4[2-7]\\d{6}","\\d{7,8}",,,"21231234",,,[8]],[,,"9[1-9]\\d{6}","\\d{8}",,,"94231234",,,[8]],[,,"80[05]\\d{4}","\\d{7}",,,"8001234",,,[7]],[,,"90[0-8]\\d{4}","\\d{7}",,,"9001234",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"UY",598,"0(?:1[3-9]\\d|0)","0"," int. ",,"0",,"00",,[[,"(\\d{4})(\\d{4})","$1 $2",["[24]"]],[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9[1-9]"],"0$1"],[,"(\\d{3})(\\d{4})",
"$1 $2",["[89]0"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],UZ:[,[,,"[679]\\d{8}","\\d{7,9}",,,,,,[9],[7]],[,,"(?:6(?:1(?:22|3[124]|4[1-4]|5[123578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|6\\d{2}|7(?:[23]\\d|7[69])|9(?:22|4[1-8]|6[135]))|7(?:0(?:5[4-9]|6[0146]|7[12456]|9[135-8])|1[12]\\d|2(?:22|3[1345789]|4[123579]|5[14])|3(?:2\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\d|3[1-579]|7[1-79])|5(?:22|5[1-9]|6[1457])|6(?:22|3[12457]|4[13-8])|9(?:22|5[1-9])))\\d{5}",
"\\d{7,9}",,,"662345678"],[,,"6(?:1(?:2(?:98|2[01])|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:11\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4])|7\\d{2})|5(?:19[01]|2(?:27|9[26])|30\\d|59\\d|7\\d{2})|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|3[79]\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79])|9[0-3]\\d)|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079]))|9(?:2(?:1[1267]|5\\d|3[01]|7[0-4])|5[67]\\d|6(?:2[0-26]|8\\d)|7\\d{2}))\\d{4}|7(?:0\\d{3}|1(?:13[01]|6(?:0[47]|1[67]|66)|71[3-69]|98\\d)|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|33\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078])|9[4-6]\\d)|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0127]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|6(?:2(?:2[1245]|4[2-4])|39\\d|41[179]|5(?:[349]\\d|5[0-2])|7(?:0[017]|[13]\\d|22|44|55|67|88))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[05629]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07])))\\d{4}|9[0-57-9]\\d{7}",
"\\d{9}",,,"912345678"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"UZ",998,"810","8",,,"8",,"8~10",,[[,"([679]\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"8 $1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],VA:[,[,,"(?:0(?:878\\d{5}|6698\\d{5})|[1589]\\d{5,10}|3(?:[12457-9]\\d{8}|[36]\\d{7,9}))","\\d{6,11}",,,,,,[6,8,9,10,11]],[,,"06698\\d{5}","\\d{10}",,,"0669812345",
,,[10]],[,,"3(?:[12457-9]\\d{8}|6\\d{7,8}|3\\d{7,9})","\\d{9,11}",,,"3123456789",,,[9,10,11]],[,,"80(?:0\\d{6}|3\\d{3})","\\d{6,9}",,,"800123456",,,[6,9]],[,,"0878\\d{5}|1(?:44|6[346])\\d{6}|89(?:2\\d{3}|4(?:[0-4]\\d{2}|[5-9]\\d{4})|5(?:[0-4]\\d{2}|[5-9]\\d{6})|9\\d{6})","\\d{6,10}",,,"899123456",,,[6,8,9,10]],[,,"84(?:[08]\\d{6}|[17]\\d{3})","\\d{6,9}",,,"848123456",,,[6,9]],[,,"1(?:78\\d|99)\\d{6}","\\d{9,10}",,,"1781234567",,,[9,10]],[,,"55\\d{8}","\\d{10}",,,"5512345678",,,[10]],"VA",39,"00",
,,,,,,,,,[,,"NA","NA",,,,,,[-1]],,,[,,"848\\d{6}","\\d{9}",,,"848123456",,,[9]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],VC:[,[,,"[5789]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"784(?:266|3(?:6[6-9]|7\\d|8[0-24-6])|4(?:38|5[0-36-8]|8[0-8])|5(?:55|7[0-2]|93)|638|784)\\d{4}","\\d{7}(?:\\d{3})?",,,"7842661234"],[,,"784(?:4(?:3[0-4]|5[45]|89|9[0-58])|5(?:2[6-9]|3[0-4]))\\d{4}","\\d{7}(?:\\d{3})?",,,"7844301234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}",
"\\d{10}",,,"9002345678"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"VC",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"784",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],VE:[,[,,"[24589]\\d{9}","\\d{7,10}",,,,,,[10],[7]],[,,"(?:2(?:12|3[457-9]|[58][1-9]|[467]\\d|9[1-6])|50[01])\\d{7}","\\d{7,10}",,,"2121234567"],[,,"4(?:1[24-8]|2[46])\\d{7}","\\d{10}",,,"4121234567"],[,,"800\\d{7}","\\d{10}",
,,"8001234567"],[,,"900\\d{7}","\\d{10}",,,"9001234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"VE",58,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{7})","$1-$2",,"0$1","$CC $1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],VG:[,[,,"[2589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"284(?:(?:229|4(?:22|9[45])|774|8(?:52|6[459]))\\d{4}|496[0-5]\\d{3})","\\d{7}(?:\\d{3})?",,,"2842291234"],[,,"284(?:(?:3(?:0[0-3]|4[0-367]|94)|4(?:4[0-6]|68|99)|54[0-57])\\d{4}|496[6-9]\\d{3})",
"\\d{7}(?:\\d{3})?",,,"2843001234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"VG",1,"011","1",,,"1",,,,,,[,,"NA","NA",,,,,,[-1]],,"284",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],VI:[,[,,"[3589]\\d{9}","\\d{7}(?:\\d{3})?",,,,,,[10],[7]],[,,"340(?:2(?:01|2[0678]|44|77)|3(?:32|44)|4(?:22|7[34])|5(?:1[34]|55)|6(?:26|4[23]|77|9[023])|7(?:1[2-589]|27|7\\d)|884|998)\\d{4}",
"\\d{7}(?:\\d{3})?",,,"3406421234"],[,,"340(?:2(?:01|2[0678]|44|77)|3(?:32|44)|4(?:22|7[34])|5(?:1[34]|55)|6(?:26|4[23]|77|9[023])|7(?:1[2-589]|27|7\\d)|884|998)\\d{4}","\\d{7}(?:\\d{3})?",,,"3406421234"],[,,"8(?:00|44|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"],[,,"900[2-9]\\d{6}","\\d{10}",,,"9002345678"],[,,"NA","NA",,,,,,[-1]],[,,"5(?:00|22|33|44|66|77|88)[2-9]\\d{6}","\\d{10}",,,"5002345678"],[,,"NA","NA",,,,,,[-1]],"VI",1,"011","1",,,"1",,,1,,,[,,"NA","NA",,,,,,[-1]],,"340",[,,"NA","NA",
,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],VN:[,[,,"[17]\\d{6,9}|[2-69]\\d{7,9}|8\\d{6,8}","\\d{7,10}",,,,,,[7,8,9,10]],[,,"(?:2(?:[025-79]|1[0189]|[348][01])|3(?:[0136-9]|[25][01])|4\\d|5(?:[01][01]|[2-9])|6(?:[0-46-8]|5[01])|7(?:[02-79]|[18][01]))\\d{7}|8(?:[1-57]\\d|[689][0-79])\\d{6}","\\d{9,10}",,,"2101234567",,,[9,10]],[,,"(?:9\\d|1(?:2\\d|6[2-9]|8[68]|99))\\d{7}|8[689]8\\d{6}","\\d{9,10}",,,"912345678",,,[9,10]],[,,"1800\\d{4,6}","\\d{8,10}",,,"1800123456",,,[8,9,10]],[,
,"1900\\d{4,6}","\\d{8,10}",,,"1900123456",,,[8,9,10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"VN",84,"00","0",,,"0",,,,[[,"([17]99)(\\d{4})","$1 $2",["[17]99"],"0$1",,1],[,"([48])(\\d{4})(\\d{4})","$1 $2 $3",["4|8(?:[1-57]|[689][0-79])"],"0$1",,1],[,"([235-7]\\d)(\\d{4})(\\d{3})","$1 $2 $3",["2[025-79]|3[0136-9]|5[2-9]|6[0-46-8]|7[02-79]"],"0$1",,1],[,"(80)(\\d{5})","$1 $2",["80"],"0$1",,1],[,"(69\\d)(\\d{4,5})","$1 $2",["69"],"0$1",,1],[,"([235-7]\\d{2})(\\d{4})(\\d{3})",
"$1 $2 $3",["2[1348]|3[25]|5[01]|65|7[18]"],"0$1",,1],[,"([89]\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8[689]8|9"],"0$1",,1],[,"(1[2689]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1(?:[26]|8[68]|99)"],"0$1",,1],[,"(1[89]00)(\\d{4,6})","$1 $2",["1[89]0"],"$1",,1]],,[,,"NA","NA",,,,,,[-1]],,,[,,"[17]99\\d{4}|69\\d{5,6}","\\d{7,8}",,,"1992000",,,[7,8]],[,,"[17]99\\d{4}|69\\d{5,6}|80\\d{5}","\\d{7,8}",,,"1992000",,,[7,8]],,,[,,"NA","NA",,,,,,[-1]]],VU:[,[,,"[2-57-9]\\d{4,6}","\\d{5,7}",,,,,,[5,7]],[,,"(?:2[02-9]\\d|3(?:[5-7]\\d|8[0-8])|48[4-9]|88\\d)\\d{2}",
"\\d{5}",,,"22123",,,[5]],[,,"(?:5(?:7[2-5]|[0-689]\\d)|7[013-7]\\d)\\d{4}","\\d{7}",,,"5912345",,,[7]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"VU",678,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[579]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"3[03]\\d{3}|900\\d{4}","\\d{5,7}",,,"30123"],,,[,,"NA","NA",,,,,,[-1]]],WF:[,[,,"[4-8]\\d{5}","\\d{6}",,,,,,[6]],[,,"(?:50|68|72)\\d{4}","\\d{6}",,,"501234"],[,
,"(?:50|68|72|8[23])\\d{4}","\\d{6}",,,"501234"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"WF",681,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"[48]0\\d{4}","\\d{6}",,,"401234"]],WS:[,[,,"[2-8]\\d{4,6}","\\d{5,7}",,,,,,[5,6,7]],[,,"(?:[2-5]\\d|6[1-9]|84\\d{2})\\d{3}","\\d{5,7}",,,"22123",,,[5,7]],[,,"(?:60|7[25-7]\\d)\\d{4}","\\d{6,7}",
,,"601234",,,[6,7]],[,,"800\\d{3}","\\d{6}",,,"800123",,,[6]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"WS",685,"0",,,,,,,,[[,"(8\\d{2})(\\d{3,4})","$1 $2",["8"]],[,"(7\\d)(\\d{5})","$1 $2",["7"]],[,"(\\d{5})","$1",["[2-6]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],YE:[,[,,"[1-7]\\d{6,8}","\\d{6,9}",,,,,,[7,8,9],[6]],[,,"(?:1(?:7\\d|[2-68])|2[2-68]|3[2358]|4[2-58]|5[2-6]|6[3-58]|7[24-68])\\d{5}",
"\\d{6,8}",,,"1234567",,,[7,8]],[,,"7[0137]\\d{7}","\\d{9}",,,"712345678",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"YE",967,"00","0",,,"0",,,,[[,"([1-7])(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7[24-68]"],"0$1"],[,"(7\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["7[0137]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],YT:[,[,,"[268]\\d{8}","\\d{9}",,,,,,[9]],[,
,"269(?:6[0-4]|50)\\d{4}","\\d{9}",,,"269601234"],[,,"639\\d{6}","\\d{9}",,,"639123456"],[,,"80\\d{7}","\\d{9}",,,"801234567"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"YT",262,"00","0",,,"0",,,,,,[,,"NA","NA",,,,,,[-1]],,"269|63",[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],ZA:[,[,,"[1-79]\\d{8}|8(?:[067]\\d{7}|[1-4]\\d{3,7})","\\d{5,9}",,,,,,[5,6,7,8,9]],[,,"(?:1[0-8]|2[0-378]|3[1-69]|4\\d|5[1346-8])\\d{7}","\\d{9}",
,,"101234567",,,[9]],[,,"(?:6[0-5]|7[0-46-9])\\d{7}|8[1-4]\\d{3,7}","\\d{5,9}",,,"711234567"],[,,"80\\d{7}","\\d{9}",,,"801234567",,,[9]],[,,"86[2-9]\\d{6}|90\\d{7}","\\d{9}",,,"862345678",,,[9]],[,,"860\\d{6}","\\d{9}",,,"860123456",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"87\\d{7}","\\d{9}",,,"871234567",,,[9]],"ZA",27,"00","0",,,"0",,,,[[,"(860)(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-79]|8(?:[0-47]|6[1-9])"],"0$1"],[,"(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],
"0$1"],[,"(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"861\\d{6}","\\d{9}",,,"861123456",,,[9]],,,[,,"NA","NA",,,,,,[-1]]],ZM:[,[,,"[289]\\d{8}","\\d{9}",,,,,,[9]],[,,"21[1-8]\\d{6}","\\d{9}",,,"211234567"],[,,"9(?:5[034589]|[67]\\d)\\d{6}","\\d{9}",,,"955123456"],[,,"800\\d{6}","\\d{9}",,,"800123456"],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"ZM",260,"00","0",,,"0",,,,[[,"([29]\\d)(\\d{7})",
"$1 $2",["[29]"],"0$1"],[,"(800)(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],ZW:[,[,,"2(?:[012457-9]\\d{3,8}|6(?:[14]\\d{7}|\\d{4}))|[13-79]\\d{4,9}|8[06]\\d{8}","\\d{3,10}",,,,,,[5,6,7,8,9,10],[3,4]],[,,"(?:2(?:0(?:4\\d|5\\d{2})|2[278]\\d|48\\d|7(?:[1-7]\\d|[089]\\d{2})|8(?:[2-57-9]|[146]\\d{2})|98)|3(?:08|17|3[78]|7(?:[19]|[56]\\d)|8[37]|98)|5[15][78]|6(?:28\\d{2}|[36]7|75\\d|[69]8|8(?:7\\d|8)))\\d{3}|(?:2(?:1[39]|2[0157]|6[14]|7[35]|84)|329)\\d{7}|(?:1(?:3\\d{2}|9\\d|[4-8])|2(?:0\\d{2}|[569]\\d)|3(?:[26]|[013459]\\d)|5(?:0|5\\d{2}|[689]\\d)|6(?:[39]|[01246]\\d|[78]\\d{2}))\\d{3}|(?:29\\d|39|54)\\d{6}|(?:(?:25|54)83|2582\\d)\\d{3}|(?:4\\d{6,7}|9[2-9]\\d{4,5})",
"\\d{3,10}",,,"1312345"],[,,"7[1378]\\d{7}","\\d{9}",,,"711234567"],[,,"800\\d{7}","\\d{10}",,,"8001234567",,,[10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"86(?:1[12]|30|44|55|77|8[367]|99)\\d{6}","\\d{10}",,,"8686123456",,,[10]],"ZW",263,"00","0",,,"0",,,,[[,"([49])(\\d{3})(\\d{2,4})","$1 $2 $3",["4|9[2-9]"],"0$1"],[,"(7\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["7"],"0$1"],[,"(86\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["86[24]"],"0$1"],[,"([2356]\\d{2})(\\d{3,5})","$1 $2",
["2(?:0[45]|2[278]|[49]8|[78])|3(?:08|17|3[78]|7[1569]|8[37]|98)|5[15][78]|6(?:[29]8|[38]7|6[78]|75|[89]8)"],"0$1"],[,"(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|6[14]|7[35]|84)|329"],"0$1"],[,"([1-356]\\d)(\\d{3,5})","$1 $2",["1[3-9]|2[0569]|3[0-69]|5[05689]|6[0-46-9]"],"0$1"],[,"([235]\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[23]9|54"],"0$1"],[,"([25]\\d{3})(\\d{3,5})","$1 $2",["(?:25|54)8","258[23]|5483"],"0$1"],[,"(8\\d{3})(\\d{6})","$1 $2",["86"],"0$1"],[,"(80\\d)(\\d{3})(\\d{4})",
"$1 $2 $3",["80"],"0$1"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],800:[,[,,"\\d{8}","\\d{8}",,,"12345678",,,[-1,8]],[,,"NA","NA",,,"12345678",,,[-1]],[,,"NA","NA",,,"12345678",,,[-1]],[,,"\\d{8}","\\d{8}",,,"12345678",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"001",800,,,,,,,,1,[[,"(\\d{4})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,
,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],808:[,[,,"\\d{8}","\\d{8}",,,"12345678",,,[-1,8]],[,,"NA","NA",,,"12345678",,,[-1]],[,,"NA","NA",,,"12345678",,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"\\d{8}","\\d{8}",,,"12345678",,,[8]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"001",808,,,,,,,,1,[[,"(\\d{4})(\\d{4})","$1 $2"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]],870:[,[,,"[35-7]\\d{8}","\\d{9}",,,"301234567",,,[-1,9]],
[,,"NA","NA",,,"301234567",,,[-1]],[,,"(?:[356]\\d|7[6-8])\\d{7}","\\d{9}",,,"301234567",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"001",870,,,,,,,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],878:[,[,,"1\\d{11}","\\d{12}",,,"101234567890",,,[-1,12]],[,,"NA","NA",,,"101234567890",,,[-1]],[,,"NA","NA",,,"101234567890",
,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"10\\d{10}","\\d{12}",,,"101234567890",,,[12]],"001",878,,,,,,,,1,[[,"(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],881:[,[,,"[67]\\d{8}","\\d{9}",,,"612345678",,,[-1,9]],[,,"NA","NA",,,"612345678",,,[-1]],[,,"[67]\\d{8}","\\d{9}",,,"612345678",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],
[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"001",881,,,,,,,,,[[,"(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[67]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],882:[,[,,"[13]\\d{6,11}","\\d{7,12}",,,"3451234567",,,[-1,7,8,9,10,11,12]],[,,"NA","NA",,,"3451234567",,,[-1]],[,,"3(?:2\\d{3}|37\\d{2}|4(?:2|7\\d{3}))\\d{4}","\\d{7,10}",,,"3451234567",,,[7,9,10]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,
,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15678]|9[0689])\\d{4}|6\\d{5,10})|3(?:45|9\\d{3})\\d{7}","\\d{7,12}",,,"390123456789",,,[7,8,9,10,11,12]],"001",882,,,,,,,,,[[,"(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],[,"(\\d{2})(\\d{5})","$1 $2",["16|342"]],[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["34[57]"]],[,"(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["348"]],[,"(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1"]],[,"(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",
["16"]],[,"(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["16|39"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"348[57]\\d{7}","\\d{11}",,,"3451234567",,,[11]]],883:[,[,,"51\\d{7}(?:\\d{3})?","\\d{9}(?:\\d{3})?",,,"510012345",,,[-1,9,12]],[,,"NA","NA",,,"510012345",,,[-1]],[,,"NA","NA",,,"510012345",,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"51(?:00\\d{5}(?:\\d{3})?|[13]0\\d{8})","\\d{9}(?:\\d{3})?",,,
"510012345",,,[9,12]],"001",883,,,,,,,,1,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],[,"(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["510"]],[,"(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]]],888:[,[,,"\\d{11}","\\d{11}",,,"12345678901",,,[-1,11]],[,,"NA","NA",,,"12345678901",,,[-1]],[,,"NA","NA",,,"12345678901",,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,
,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],"001",888,,,,,,,,1,[[,"(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"\\d{11}","\\d{11}",,,"12345678901",,,[11]],1,,[,,"NA","NA",,,,,,[-1]]],979:[,[,,"\\d{9}","\\d{9}",,,"123456789",,,[-1,9]],[,,"NA","NA",,,"123456789",,,[-1]],[,,"NA","NA",,,"123456789",,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"\\d{9}","\\d{9}",,,"123456789",,,[9]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],
"001",979,,,,,,,,1,[[,"(\\d)(\\d{4})(\\d{4})","$1 $2 $3"]],,[,,"NA","NA",,,,,,[-1]],,,[,,"NA","NA",,,,,,[-1]],[,,"NA","NA",,,,,,[-1]],1,,[,,"NA","NA",,,,,,[-1]]]};/*

 Copyright (C) 2010 The Libphonenumber Authors.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
*/
function P(){this.a={}}P.a=function(){return P.c?P.c:P.c=new P};
var za={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","\uff10":"0","\uff11":"1","\uff12":"2","\uff13":"3","\uff14":"4","\uff15":"5","\uff16":"6","\uff17":"7","\uff18":"8","\uff19":"9","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u06f0":"0","\u06f1":"1","\u06f2":"2","\u06f3":"3","\u06f4":"4","\u06f5":"5","\u06f6":"6","\u06f7":"7","\u06f8":"8","\u06f9":"9"},Aa={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",
7:"7",8:"8",9:"9","\uff10":"0","\uff11":"1","\uff12":"2","\uff13":"3","\uff14":"4","\uff15":"5","\uff16":"6","\uff17":"7","\uff18":"8","\uff19":"9","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u06f0":"0","\u06f1":"1","\u06f2":"2","\u06f3":"3","\u06f4":"4","\u06f5":"5","\u06f6":"6","\u06f7":"7","\u06f8":"8","\u06f9":"9",A:"2",B:"2",C:"2",D:"3",E:"3",F:"3",G:"4",H:"4",I:"4",J:"5",K:"5",L:"5",M:"6",N:"6",O:"6",P:"7",
Q:"7",R:"7",S:"7",T:"8",U:"8",V:"8",W:"9",X:"9",Y:"9",Z:"9"},Q=RegExp("^[+\uff0b]+"),Ba=RegExp("([0-9\uff10-\uff19\u0660-\u0669\u06f0-\u06f9])"),Ca=RegExp("[+\uff0b0-9\uff10-\uff19\u0660-\u0669\u06f0-\u06f9]"),Da=/[\\\/] *x/,Ea=RegExp("[^0-9\uff10-\uff19\u0660-\u0669\u06f0-\u06f9A-Za-z#]+$"),Fa=/(?:.*?[A-Za-z]){3}.*/,Ga=RegExp("(?:;ext=([0-9\uff10-\uff19\u0660-\u0669\u06f0-\u06f9]{1,7})|[ \u00a0\\t,]*(?:e?xt(?:ensi(?:o\u0301?|\u00f3))?n?|\uff45?\uff58\uff54\uff4e?|[,x\uff58#\uff03~\uff5e]|int|anexo|\uff49\uff4e\uff54)[:\\.\uff0e]?[ \u00a0\\t,-]*([0-9\uff10-\uff19\u0660-\u0669\u06f0-\u06f9]{1,7})#?|[- ]+([0-9\uff10-\uff19\u0660-\u0669\u06f0-\u06f9]{1,5})#)$",
"i"),Ha=RegExp("^[0-9\uff10-\uff19\u0660-\u0669\u06f0-\u06f9]{2}$|^[+\uff0b]*(?:[-x\u2010-\u2015\u2212\u30fc\uff0d-\uff0f \u00a0\u00ad\u200b\u2060\u3000()\uff08\uff09\uff3b\uff3d.\\[\\]/~\u2053\u223c\uff5e*]*[0-9\uff10-\uff19\u0660-\u0669\u06f0-\u06f9]){3,}[-x\u2010-\u2015\u2212\u30fc\uff0d-\uff0f \u00a0\u00ad\u200b\u2060\u3000()\uff08\uff09\uff3b\uff3d.\\[\\]/~\u2053\u223c\uff5e*A-Za-z0-9\uff10-\uff19\u0660-\u0669\u06f0-\u06f9]*(?:;ext=([0-9\uff10-\uff19\u0660-\u0669\u06f0-\u06f9]{1,7})|[ \u00a0\\t,]*(?:e?xt(?:ensi(?:o\u0301?|\u00f3))?n?|\uff45?\uff58\uff54\uff4e?|[,x\uff58#\uff03~\uff5e]|int|anexo|\uff49\uff4e\uff54)[:\\.\uff0e]?[ \u00a0\\t,-]*([0-9\uff10-\uff19\u0660-\u0669\u06f0-\u06f9]{1,7})#?|[- ]+([0-9\uff10-\uff19\u0660-\u0669\u06f0-\u06f9]{1,5})#)?$",
"i"),Ia=/(\$\d)/;function Ja(a){var b=a.search(Ca);0<=b?(a=a.substring(b),a=a.replace(Ea,""),b=a.search(Da),0<=b&&(a=a.substring(0,b))):a="";return a}function Ka(a){return 2>a.length?!1:R(Ha,a)}function La(a){return R(Fa,a)?S(a,Aa):S(a,za)}function Ma(a){var b=La(a.toString());a.c="";a.a(b)}function S(a,b){for(var c=new I,d,e=a.length,f=0;f<e;++f)d=a.charAt(f),d=b[d.toUpperCase()],null!=d&&c.a(d);return c.toString()}function T(a){return null!=a&&isNaN(a)&&a.toUpperCase()in ya}
function Na(a,b,c){if(0==A(b,2)&&null!=b.a[5]){var d=D(b,5);if(0<d.length)return d}var d=D(b,1),e=U(b);if(0==c)return Oa(d,0,e,"");if(!(d in O))return e;a=V(a,d,W(d));b=null!=b.a[3]&&A(b,3).length?3==c?";ext="+A(b,3):null!=a.a[13]?A(a,13)+D(b,3):" ext. "+D(b,3):"";a:{a=(C(a,20)||[]).length&&2!=c?C(a,20)||[]:C(a,19)||[];for(var f,g=a.length,h=0;h<g;++h){f=a[h];var l=ra(f,3);if(!l||!e.search(A(f,3,l-1)))if(l=new RegExp(A(f,1)),R(l,e)){a=f;break a}}a=null}a&&(g=a,a=D(g,2),f=new RegExp(A(g,1)),D(g,5),
g=D(g,4),e=2==c&&null!=g&&0<g.length?e.replace(f,a.replace(Ia,g)):e.replace(f,a),3==c&&(e=e.replace(RegExp("^[-x\u2010-\u2015\u2212\u30fc\uff0d-\uff0f \u00a0\u00ad\u200b\u2060\u3000()\uff08\uff09\uff3b\uff3d.\\[\\]/~\u2053\u223c\uff5e]+"),""),e=e.replace(RegExp("[-x\u2010-\u2015\u2212\u30fc\uff0d-\uff0f \u00a0\u00ad\u200b\u2060\u3000()\uff08\uff09\uff3b\uff3d.\\[\\]/~\u2053\u223c\uff5e]+","g"),"-")));return Oa(d,c,e,b)}function V(a,b,c){return"001"==c?X(a,""+b):X(a,c)}
function U(a){var b=""+A(a,2);return null!=a.a[4]&&A(a,4)?Array(D(a,8)+1).join("0")+b:b}function Oa(a,b,c,d){switch(b){case 0:return"+"+a+c+d;case 1:return"+"+a+" "+c+d;case 3:return"tel:+"+a+"-"+c+d;default:return c+d}}function Pa(a,b){switch(b){case 4:return A(a,5);case 3:return A(a,4);case 1:return A(a,3);case 0:case 2:return A(a,2);case 5:return A(a,6);case 6:return A(a,8);case 7:return A(a,7);case 8:return A(a,21);case 9:return A(a,25);case 10:return A(a,28);default:return A(a,1)}}
function Qa(a,b){return Y(a,A(b,1))?Y(a,A(b,5))?4:Y(a,A(b,4))?3:Y(a,A(b,6))?5:Y(a,A(b,8))?6:Y(a,A(b,7))?7:Y(a,A(b,21))?8:Y(a,A(b,25))?9:Y(a,A(b,28))?10:Y(a,A(b,2))?A(b,18)||Y(a,A(b,3))?2:0:!A(b,18)&&Y(a,A(b,3))?1:-1:-1}function X(a,b){if(null==b)return null;b=b.toUpperCase();var c=a.a[b];if(!c){c=ya[b];if(!c)return null;c=(new H).c(L.f(),c);a.a[b]=c}return c}function Y(a,b){var c=a.length;return 0<ra(b,9)&&-1==x(C(b,9)||[],c)?!1:R(D(b,2),a)}
function Ra(a,b){if(!b)return null;var c=D(b,1);if(c=O[c])if(1==c.length)c=c[0];else a:{for(var d=U(b),e,f=c.length,g=0;g<f;g++){e=c[g];var h=X(a,e);if(null!=h.a[23]){if(!d.search(A(h,23))){c=e;break a}}else if(-1!=Qa(d,h)){c=e;break a}}c=null}else c=null;return c}function W(a){return(a=O[a])?a[0]:"ZZ"}function Sa(a,b){var c=C(b,9)||[],d=C(b,10)||[],e=a.length;if(-1<x(d,e))return 0;d=c[0];return d==e?0:d>e?2:c[c.length-1]<e?3:-1<x(c,e,1)?0:3}
function Ta(a,b,c,d,e){if(!a.length)return 0;a=new I(a);var f;b&&(f=A(b,11));null==f&&(f="NonMatch");var g=a.toString();if(g.length)if(Q.test(g))g=g.replace(Q,""),a.c="",a.a(La(g)),f=1;else{g=new RegExp(f);Ma(a);f=a.toString();if(f.search(g))f=!1;else{var g=f.match(g)[0].length,h=f.substring(g).match(Ba);h&&null!=h[1]&&0<h[1].length&&"0"==S(h[1],za)?f=!1:(a.c="",a.a(f.substring(g)),f=!0)}f=f?5:20}else f=20;d&&B(e,6,f);if(20!=f){if(2>=a.c.length)throw"Phone number too short after IDD";a:{d=a.toString();
if(d.length&&"0"!=d.charAt(0))for(a=d.length,f=1;3>=f&&f<=a;++f)if(b=parseInt(d.substring(0,f),10),b in O){c.a(d.substring(f));c=b;break a}c=0}if(c)return B(e,1,c),c;throw"Invalid country calling code";}if(b&&(f=D(b,10),g=""+f,h=a.toString(),!h.lastIndexOf(g,0))){var l=new I(h.substring(g.length)),g=A(b,1),h=new RegExp(D(g,2));Ua(l,b,null);b=l.toString();if(!R(h,a.toString())&&R(h,b)||3==Sa(a.toString(),g))return c.a(b),d&&B(e,6,10),B(e,1,f),f}B(e,1,0);return 0}
function Ua(a,b,c){var d=a.toString(),e=d.length,f=A(b,15);if(e&&null!=f&&f.length){var g=new RegExp("^(?:"+f+")");if(e=g.exec(d)){var f=new RegExp(D(A(b,1),2)),h=R(f,d),l=e.length-1;b=A(b,16);if(null!=b&&b.length&&null!=e[l]&&e[l].length){if(d=d.replace(g,b),!h||R(f,d))c&&0<l&&c.a(e[1]),a.set(d)}else if(!h||R(f,d.substring(e[0].length)))c&&0<l&&null!=e[l]&&c.a(e[1]),a.set(d.substring(e[0].length))}}}
function Z(a,b,c){if(!T(c)&&0<b.length&&"+"!=b.charAt(0))throw"Invalid country calling code";return Va(a,b,c,!0)}
function Va(a,b,c,d){if(null==b)throw"The string supplied did not seem to be a phone number";if(250<b.length)throw"The string supplied is too long to be a phone number";var e=new I,f=b.indexOf(";phone-context=");if(0<f){var g=f+15;if("+"==b.charAt(g)){var h=b.indexOf(";",g);0<h?e.a(b.substring(g,h)):e.a(b.substring(g))}g=b.indexOf("tel:");e.a(b.substring(0<=g?g+4:0,f))}else e.a(Ja(b));f=e.toString();g=f.indexOf(";isub=");0<g&&(e.c="",e.a(f.substring(0,g)));if(!Ka(e.toString()))throw"The string supplied did not seem to be a phone number";
f=e.toString();if(!(T(c)||null!=f&&0<f.length&&Q.test(f)))throw"Invalid country calling code";f=new M;d&&B(f,5,b);a:{b=e.toString();g=b.search(Ga);if(0<=g&&Ka(b.substring(0,g)))for(var h=b.match(Ga),l=h.length,q=1;q<l;++q)if(null!=h[q]&&0<h[q].length){e.c="";e.a(b.substring(0,g));b=h[q];break a}b=""}0<b.length&&B(f,3,b);b=X(a,c);g=new I;h=0;l=e.toString();try{h=Ta(l,b,g,d,f)}catch(z){if("Invalid country calling code"==z&&Q.test(l)){if(l=l.replace(Q,""),h=Ta(l,b,g,d,f),!h)throw z;}else throw z;}h?
(e=W(h),e!=c&&(b=V(a,h,e))):(Ma(e),g.a(e.toString()),null!=c?(h=D(b,10),B(f,1,h)):d&&(delete f.a[6],f.c&&delete f.c[6]));if(2>g.c.length)throw"The string supplied is too short to be a phone number";b&&(a=new I,c=new I(g.toString()),Ua(c,b,a),2!=Sa(c.toString(),A(b,1))&&(g=c,d&&0<a.toString().length&&B(f,7,a.toString())));d=g.toString();a=d.length;if(2>a)throw"The string supplied is too short to be a phone number";if(17<a)throw"The string supplied is too long to be a phone number";if(1<d.length&&"0"==
d.charAt(0)){B(f,4,!0);for(a=1;a<d.length-1&&"0"==d.charAt(a);)a++;1!=a&&B(f,8,a)}B(f,2,parseInt(d,10));return f}function R(a,b){var c="string"==typeof a?b.match("^(?:"+a+")$"):b.match(a);return c&&c[0].length==b.length?!0:!1};v("intlTelInputUtils",{});v("intlTelInputUtils.formatNumber",function(a,b,c){try{var d=P.a(),e=Z(d,a,b);return Na(d,e,"undefined"==typeof c?0:c)}catch(f){return a}});v("intlTelInputUtils.getExampleNumber",function(a,b,c){try{var d=P.a(),e;a:{if(T(a)){var f=Pa(X(d,a),c);try{if(null!=f.a[6]){var g=D(f,6);e=Va(d,g,a,!1);break a}}catch(h){}}e=null}return Na(d,e,b?2:1)}catch(h){return""}});v("intlTelInputUtils.getExtension",function(a,b){try{return A(Z(P.a(),a,b),3)}catch(c){return""}});
v("intlTelInputUtils.getNumberType",function(a,b){try{var c=P.a(),d;var e=Z(c,a,b),f=Ra(c,e),g=V(c,D(e,1),f);if(g){var h=U(e);d=Qa(h,g)}else d=-1;return d}catch(l){return-99}});
v("intlTelInputUtils.getValidationError",function(a,b){try{var c=P.a(),d;var e=Z(c,a,b),f=U(e),g=D(e,1);if(g in O){var h=V(c,g,W(g));d=Sa(f,A(h,1))}else d=1;return d}catch(l){return"Invalid country calling code"==l?1:"The string supplied did not seem to be a phone number"==l?4:"Phone number too short after IDD"==l||"The string supplied is too short to be a phone number"==l?2:"The string supplied is too long to be a phone number"==l?3:-99}});
v("intlTelInputUtils.isValidNumber",function(a,b){try{var c=P.a(),d=Z(c,a,b),e;var f=Ra(c,d),g=D(d,1),h=V(c,g,f),l;if(!(l=!h)){var q;if(q="001"!=f){var z,va=X(c,f);if(!va)throw"Invalid region code: "+f;z=D(va,10);q=g!=z}l=q}if(l)e=!1;else{var Wa=U(d);e=-1!=Qa(Wa,h)}return e}catch(Xa){return!1}});v("intlTelInputUtils.numberFormat",{E164:0,INTERNATIONAL:1,NATIONAL:2,RFC3966:3});
v("intlTelInputUtils.numberType",{FIXED_LINE:0,MOBILE:1,FIXED_LINE_OR_MOBILE:2,TOLL_FREE:3,PREMIUM_RATE:4,SHARED_COST:5,VOIP:6,PERSONAL_NUMBER:7,PAGER:8,UAN:9,VOICEMAIL:10,UNKNOWN:-1});v("intlTelInputUtils.validationError",{IS_POSSIBLE:0,INVALID_COUNTRY_CODE:1,TOO_SHORT:2,TOO_LONG:3,NOT_A_NUMBER:4});})();
;
"use strict";angular.module("isoCurrency.common",[]).factory("iso4217",function(){var t={AFN:{text:"Afghani",fraction:2,symbol:"؋"},EUR:{text:"Euro",fraction:2,symbol:"€"},ALL:{text:"Lek",fraction:2,symbol:"Lek"},DZD:{text:"Algerian Dinar",fraction:2,symbol:"د.ج"},USD:{text:"US Dollar",fraction:2,symbol:"$"},AOA:{text:"Kwanza",fraction:2,symbol:"Kz"},XCD:{text:"East Caribbean Dollar",fraction:2,symbol:"$"},ARS:{text:"Argentine Peso",fraction:2,symbol:"$"},AMD:{text:"Armenian Dram",fraction:2,symbol:!1},AWG:{text:"Aruban Florin",fraction:2,symbol:"ƒ"},AUD:{text:"Australian Dollar",fraction:2,symbol:"$"},AZN:{text:"Azerbaijani Manat",fraction:2,symbol:"ман"},BSD:{text:"Bahamian Dollar",fraction:2,symbol:"$"},BHD:{text:"Bahraini Dinar",fraction:3,symbol:"BD"},BDT:{text:"Taka",fraction:2,symbol:"৳"},BBD:{text:"Barbados Dollar",fraction:2,symbol:"$"},BYR:{text:"Belarusian Ruble",fraction:0,symbol:"p."},BZD:{text:"Belize Dollar",fraction:2,symbol:"BZ$"},XOF:{text:"CFA Franc BCEAO",fraction:0,symbol:"CFA"},BMD:{text:"Bermudian Dollar",fraction:2,symbol:"$"},BTN:{text:"Ngultrum",fraction:2,symbol:"Nu"},INR:{text:"Indian Rupee",fraction:2,symbol:"₹"},BOB:{text:"Boliviano",fraction:2,symbol:"$b"},BOV:{text:"Mvdol",fraction:2,symbol:"$b"},BAM:{text:"Convertible Mark",fraction:2,symbol:"KM"},BWP:{text:"Pula",fraction:2,symbol:"P"},NOK:{text:"Norwegian Krone",fraction:2,symbol:"kr"},BRL:{text:"Brazilian Real",fraction:2,symbol:"R$"},BND:{text:"Brunei Dollar",fraction:2,symbol:"$"},BGN:{text:"Bulgarian Lev",fraction:2,symbol:"лв"},BIF:{text:"Burundian Franc",fraction:0,symbol:"BIF"},KHR:{text:"Riel",fraction:2,symbol:"៛"},XAF:{text:"CFA Franc BEAC",fraction:0,symbol:!1},CAD:{text:"Canadian Dollar",fraction:2,symbol:"$"},CVE:{text:"Cabo Verde Escudo",fraction:2,symbol:"$"},KYD:{text:"Cayman Islands Dollar",fraction:2,symbol:"$"},CLF:{text:"Unidad de Fomento",fraction:4,symbol:!1},CLP:{text:"Chilean Peso",fraction:0,symbol:"$"},CNY:{text:"Yuan Renminbi",fraction:2,symbol:"¥"},COP:{text:"Colombian Peso",fraction:2,symbol:"$"},COU:{text:"Unidad de Valor Real",fraction:2,symbol:!1},KMF:{text:"Comoro Franc",fraction:0,symbol:!1},CDF:{text:"Congolese Franc",fraction:2,symbol:!1},NZD:{text:"New Zealand Dollar",fraction:2,symbol:"$"},CRC:{text:"Costa Rican Colon",fraction:2,symbol:"₡"},HRK:{text:"Croatian Kuna",fraction:2,symbol:"kn"},CUC:{text:"Peso Convertible",fraction:2,symbol:!1},CUP:{text:"Cuban Peso",fraction:2,symbol:"₱"},ANG:{text:"Netherlands Antillean Guilder",fraction:2,symbol:"ƒ"},CZK:{text:"Czech Koruna",fraction:2,symbol:"Kč"},DKK:{text:"Danish Krone",fraction:2,symbol:"kr"},DJF:{text:"Djibouti Franc",fraction:0,symbol:!1},DOP:{text:"Dominican Peso",fraction:2,symbol:"RD$"},EGP:{text:"Egyptian Pound",fraction:2,symbol:"£"},SVC:{text:"El Salvador Colon",fraction:2,symbol:"$"},ERN:{text:"Nakfa",fraction:2,symbol:!1},ETB:{text:"Ethiopian Birr",fraction:2,symbol:!1},FKP:{text:"Falkland Islands Pound",fraction:2,symbol:"£"},FJD:{text:"Fiji Dollar",fraction:2,symbol:"$"},XPF:{text:"CFP Franc",fraction:0,symbol:!1},GMD:{text:"Dalasi",fraction:2,symbol:!1},GEL:{text:"Lari",fraction:2,symbol:!1},GHS:{text:"Ghan Cedi",fraction:2,symbol:!1},GIP:{text:"Gibraltar Pound",fraction:2,symbol:"£"},GTQ:{text:"Quetzal",fraction:2,symbol:"Q"},GBP:{text:"Pound Sterling",fraction:2,symbol:"£"},GNF:{text:"Guinean Franc",fraction:0,symbol:!1},GYD:{text:"Guyanese Dollar",fraction:2,symbol:"$"},HTG:{text:"Gourde",fraction:2,symbol:!1},HNL:{text:"Lempira",fraction:2,symbol:"L"},HKD:{text:"Hong Kong Dollar",fraction:2,symbol:"$"},HUF:{text:"Forint",fraction:2,symbol:"Ft"},ISK:{text:"Iceland Krona",fraction:0,symbol:"kr"},IDR:{text:"Rupiah",fraction:2,symbol:"Rp"},XDR:{text:"SDR (Special Drawing Right)",fraction:0,symbol:!1},IRR:{text:"Iranian Rial",fraction:2,symbol:"﷼"},IQD:{text:"Iraqi Dinar",fraction:3,symbol:!1},ILS:{text:"New Israeli Sheqel",fraction:2,symbol:"₪"},JMD:{text:"Jamaican Dollar",fraction:2,symbol:"J$"},JPY:{text:"Yen",fraction:0,symbol:"¥"},JOD:{text:"Jordanian Dinar",fraction:3,symbol:!1},KZT:{text:"Tenge",fraction:2,symbol:"₸"},KES:{text:"Kenyan Shilling",fraction:2,symbol:!1},KPW:{text:"North Korean Won",fraction:2,symbol:"₩"},KRW:{text:"Won",fraction:0,symbol:"₩"},KWD:{text:"Kuwaiti Dinar",fraction:3,symbol:!1},KGS:{text:"Som",fraction:2,symbol:"som"},LAK:{text:"Kip",fraction:2,symbol:"₭"},LBP:{text:"Lebanese Pound",fraction:2,symbol:"£"},LSL:{text:"Loti",fraction:2,symbol:!1},ZAR:{text:"Rand",fraction:2,symbol:"R"},LRD:{text:"Liberian Dollar",fraction:2,symbol:"$"},LYD:{text:"Libyan Dinar",fraction:3,symbol:!1},CHF:{text:"Swiss Franc",fraction:2,symbol:"CHF"},LTL:{text:"Lithuanian Litas",fraction:2,symbol:"Lt"},MOP:{text:"Pataca",fraction:2,symbol:!1},MKD:{text:"Denar",fraction:2,symbol:"ден"},MGA:{text:"Malagasy riary",fraction:2,symbol:!1},MWK:{text:"Kwacha",fraction:2,symbol:!1},MYR:{text:"Malaysian Ringgit",fraction:2,symbol:"RM"},MVR:{text:"Rufiyaa",fraction:2,symbol:!1},MRO:{text:"Ouguiya",fraction:2,symbol:!1},MUR:{text:"Mauritius Rupee",fraction:2,symbol:"₨"},XUA:{text:"ADB Unit of account",fraction:0,symbol:!1},MXN:{text:"Mexican Peso",fraction:2,symbol:"$"},MXV:{text:"Mexican Unidad de Inversion (UDI)",fraction:2,symbol:!1},MDL:{text:"Moldovan Leu",fraction:2,symbol:!1},MNT:{text:"Tugrik",fraction:2,symbol:"₮"},MAD:{text:"Moroccan Dirham",fraction:2,symbol:!1},MZN:{text:"Mozambique Metical",fraction:2,symbol:"MT"},MMK:{text:"Kyat",fraction:2,symbol:!1},NAD:{text:"Namibian Dollar",fraction:2,symbol:"$"},NPR:{text:"Nepalese Rupee",fraction:2,symbol:"₨"},NIO:{text:"Cordob Oro",fraction:2,symbol:"C$"},NGN:{text:"Naira",fraction:2,symbol:"₦"},OMR:{text:"Rial Omani",fraction:3,symbol:"﷼"},PKR:{text:"Pakistan Rupee",fraction:2,symbol:"₨"},PAB:{text:"Balboa",fraction:2,symbol:"B/."},PGK:{text:"Kina",fraction:2,symbol:"K"},PYG:{text:"Guarani",fraction:0,symbol:"Gs"},PEN:{text:"Nuevo Sol",fraction:2,symbol:"S/."},PHP:{text:"Philippine Peso",fraction:2,symbol:"₱"},PLN:{text:"Zloty",fraction:2,symbol:"zł"},QAR:{text:"Qatari Rial",fraction:2,symbol:"﷼"},RON:{text:"New Romanian Leu",fraction:2,symbol:"lei"},RUB:{text:"Russian Ruble",fraction:2,symbol:"руб"},RWF:{text:"Rwandan Franc",fraction:0,symbol:"R₣"},SHP:{text:"Saint Helena Pound",fraction:2,symbol:"£"},WST:{text:"Tala",fraction:2,symbol:"$"},STD:{text:"Dobra",fraction:2,symbol:!1},SAR:{text:"Saudi Riyal",fraction:2,symbol:"﷼"},RSD:{text:"Serbian Dinar",fraction:2,symbol:"Дин."},SCR:{text:"Seychelles Rupee",fraction:2,symbol:"₨"},SLL:{text:"Leone",fraction:2,symbol:"Le"},SGD:{text:"Singapore Dollar",fraction:2,symbol:"$"},XSU:{text:"Sucre",fraction:0,symbol:!1},SBD:{text:"Solomon Islands Dollar",fraction:2,symbol:"$"},SOS:{text:"Somali Shilling",fraction:2,symbol:"S"},SSP:{text:"South Sudanese Pound",fraction:2,symbol:!1},LKR:{text:"Sri Lankan Rupee",fraction:2,symbol:"₨"},SDG:{text:"Sudanese Pound",fraction:2,symbol:!1},SRD:{text:"Surinam Dollar",fraction:2,symbol:"$"},SZL:{text:"Lilangeni",fraction:2,symbol:!1},SEK:{text:"Swedish Krona",fraction:2,symbol:"kr"},CHE:{text:"WIR Euro",fraction:2,symbol:!1},CHW:{text:"WIR Franc",fraction:2,symbol:!1},SYP:{text:"Syrian Pound",fraction:2,symbol:"£"},TWD:{text:"New Taiwan Dollar",fraction:2,symbol:"NT$"},TJS:{text:"Somoni",fraction:2,symbol:!1},TZS:{text:"Tanzanian Shilling",fraction:2,symbol:!1},THB:{text:"Baht",fraction:2,symbol:"฿"},TOP:{text:"Pa’anga",fraction:2,symbol:!1},TTD:{text:"Trinidad and Tobago Dollar",fraction:2,symbol:"TT$"},TND:{text:"Tunisian Dinar",fraction:3,symbol:!1},TRY:{text:"Turkish Lira",fraction:2,symbol:"₺"},TMT:{text:"Turkmenistan New Manat",fraction:2,symbol:!1},UGX:{text:"Ugandan Shilling",fraction:0,symbol:!1},UAH:{text:"Hryvnia",fraction:2,symbol:"₴"},AED:{text:"UAE Dirham",fraction:2,symbol:!1},USN:{text:"US Dollar (Next day)",fraction:2,symbol:!1},UYI:{text:"Uruguay Peso en Unidades Indexadas (URUIURUI)",fraction:0,symbol:!1},UYU:{text:"Peso Uruguayo",fraction:2,symbol:"$U"},UZS:{text:"Uzbekistan Sum",fraction:2,symbol:"som"},VUV:{text:"Vatu",fraction:0,symbol:!1},VEF:{text:"Bolivar",fraction:2,symbol:"Bs"},VND:{text:"Dong",fraction:0,symbol:"₫"},YER:{text:"Yemeni Rial",fraction:2,symbol:"﷼"},ZMW:{text:"Zambian Kwacha",fraction:2,symbol:!1},ZWL:{text:"Zimbabwe Dollar",fraction:2,symbol:"$"}};return{getCurrencyByCode:function(o){return o&&"string"==typeof o?t[o.toUpperCase()]:void 0},getCurrencies:function(){return t}}}),angular.module("isoCurrency",["isoCurrency.common"]).filter("isoCurrency",["$filter","iso4217",function(t,o){return function(a,n,i){var r=o.getCurrencyByCode(n);if(!r)return a;var e=void 0===i?r.fraction:i;return t("currency")(a,r.symbol||n+" ",e)}}]);;
/*
 * International Telephone Input v9.2.4
 * https://github.com/jackocnr/intl-tel-input.git
 * Licensed under the MIT license
 */
// wrap in UMD - see https://github.com/umdjs/umd/blob/master/jqueryPluginCommonjs.js
(function (factory) {
    if (typeof define === "function" && define.amd) {
        define(["jquery"], function ($) {
            factory($, window, document);
        });
    } else if (typeof module === "object" && module.exports) {
        module.exports = factory(require("jquery"), window, document);
    } else {
        factory(jQuery, window, document);
    }
})(function ($, window, document, undefined) {
    "use strict";
    // these vars persist through all instances of the plugin
    var pluginName = "intlTelInput", id = 1, // give each instance it's own id for namespaced event handling
    defaults = {
        // whether or not to allow the dropdown
        allowDropdown: true,
        // if there is just a dial code in the input: remove it on blur, and re-add it on focus
        autoHideDialCode: false,
        // add a placeholder in the input with an example number for the selected country
        autoPlaceholder: "polite",
        // modify the auto placeholder
        customPlaceholder: null,
        // append menu to a specific element
        dropdownContainer: "",
        // don't display these countries
        excludeCountries: [],
        // format the input value during initialisation
        formatOnInit: true,
        // geoIp lookup function
        geoIpLookup: null,
        // initial country
        initialCountry: "",
        // don't insert international dial codes
        nationalMode: true,
        // number type to use for placeholders
        numberType: "MOBILE",
        // display only these countries
        onlyCountries: [],
        // the countries at the top of the list. defaults to united states and united kingdom
        preferredCountries: ["us", "gb"],
        // display the country dial code next to the selected flag so it's not part of the typed number
        separateDialCode: true,
        // specify the path to the libphonenumber script to enable validation/formatting
        utilsScript: ""
    }, keys = {
        UP: 38,
        DOWN: 40,
        ENTER: 13,
        ESC: 27,
        PLUS: 43,
        A: 65,
        Z: 90,
        SPACE: 32,
        TAB: 9
    };
    // keep track of if the window.load event has fired as impossible to check after the fact
    $(window).on("load", function () {
        // UPDATE: use a public static field so we can fudge it in the tests
        $.fn[pluginName].windowLoaded = true;
    });
    function Plugin(element, options) {
        this.telInput = $(element);
        this.options = $.extend({}, defaults, options);
        // event namespace
        this.ns = "." + pluginName + id++;
        // Chrome, FF, Safari, IE9+
        this.isGoodBrowser = Boolean(element.setSelectionRange);
        this.hadInitialPlaceholder = Boolean($(element).attr("placeholder"));
    }
    Plugin.prototype = {
        _init: function () {
            // if in nationalMode, disable options relating to dial codes
            if (this.options.nationalMode) {
                this.options.autoHideDialCode = false;
            }
            // if separateDialCode then doesn't make sense to A) insert dial code into input (autoHideDialCode), and B) display national numbers (because we're displaying the country dial code next to them)
            if (this.options.separateDialCode) {
                this.options.autoHideDialCode = this.options.nationalMode = false;
            }
            // we cannot just test screen size as some smartphones/website meta tags will report desktop resolutions
            // Note: for some reason jasmine breaks if you put this in the main Plugin function with the rest of these declarations
            // Note: to target Android Mobiles (and not Tablets), we must find "Android" and "Mobile"
            this.isMobile = /Android.+Mobile|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
            if (this.isMobile) {
                // trigger the mobile dropdown css
                $("body").addClass("iti-mobile");
                // on mobile, we want a full screen dropdown, so we must append it to the body
                if (!this.options.dropdownContainer) {
                    this.options.dropdownContainer = "body";
                }
            }
            // we return these deferred objects from the _init() call so they can be watched, and then we resolve them when each specific request returns
            // Note: again, jasmine breaks when I put these in the Plugin function
            this.autoCountryDeferred = new $.Deferred();
            this.utilsScriptDeferred = new $.Deferred();
            // process all the data: onlyCountries, excludeCountries, preferredCountries etc
            this._processCountryData();
            // generate the markup
            this._generateMarkup();
            // set the initial state of the input value and the selected flag
            this._setInitialState();
            // start all of the event listeners: autoHideDialCode, input keydown, selectedFlag click
            this._initListeners();
            // utils script, and auto country
            this._initRequests();
            // return the deferreds
            return [this.autoCountryDeferred, this.utilsScriptDeferred];
        },
        /********************
   *  PRIVATE METHODS
   ********************/
        // prepare all of the country data, including onlyCountries, excludeCountries and preferredCountries options
        _processCountryData: function () {
            // process onlyCountries or excludeCountries array if present
            this._processAllCountries();
            // process the countryCodes map
            this._processCountryCodes();
            // process the preferredCountries
            this._processPreferredCountries();
        },
        // add a country code to this.countryCodes
        _addCountryCode: function (iso2, dialCode, priority) {
            if (!(dialCode in this.countryCodes)) {
                this.countryCodes[dialCode] = [];
            }
            var index = priority || 0;
            this.countryCodes[dialCode][index] = iso2;
        },
        // filter the given countries using the process function
        _filterCountries: function (countryArray, processFunc) {
            var i;
            // standardise case
            for (i = 0; i < countryArray.length; i++) {
                countryArray[i] = countryArray[i].toLowerCase();
            }
            // build instance country array
            this.countries = [];
            for (i = 0; i < allCountries.length; i++) {
                if (processFunc($.inArray(allCountries[i].iso2, countryArray))) {
                    this.countries.push(allCountries[i]);
                }
            }
        },
        // process onlyCountries or excludeCountries array if present
        _processAllCountries: function () {
            if (this.options.onlyCountries.length) {
                // process onlyCountries option
                this._filterCountries(this.options.onlyCountries, function (inArray) {
                    // if country is in array
                    return inArray != -1;
                });
            } else if (this.options.excludeCountries.length) {
                // process excludeCountries option
                this._filterCountries(this.options.excludeCountries, function (inArray) {
                    // if country is not in array
                    return inArray == -1;
                });
            } else {
                this.countries = allCountries;
            }
        },
        // process the countryCodes map
        _processCountryCodes: function () {
            this.countryCodes = {};
            for (var i = 0; i < this.countries.length; i++) {
                var c = this.countries[i];
                this._addCountryCode(c.iso2, c.dialCode, c.priority);
                // area codes
                if (c.areaCodes) {
                    for (var j = 0; j < c.areaCodes.length; j++) {
                        // full dial code is country code + dial code
                        this._addCountryCode(c.iso2, c.dialCode + c.areaCodes[j]);
                    }
                }
            }
        },
        // process preferred countries - iterate through the preferences, fetching the country data for each one
        _processPreferredCountries: function () {
            this.preferredCountries = [];
            for (var i = 0; i < this.options.preferredCountries.length; i++) {
                var countryCode = this.options.preferredCountries[i].toLowerCase(), countryData = this._getCountryData(countryCode, false, true);
                if (countryData) {
                    this.preferredCountries.push(countryData);
                }
            }
        },
        // generate all of the markup for the plugin: the selected flag overlay, and the dropdown
        _generateMarkup: function () {
            // prevent autocomplete as there's no safe, cross-browser event we can react to, so it can easily put the plugin in an inconsistent state e.g. the wrong flag selected for the autocompleted number, which on submit could mean the wrong number is saved (esp in nationalMode)
            this.telInput.attr("autocomplete", "off");
            // containers (mostly for positioning)
            var parentClass = "intl-tel-input";
            if (this.options.allowDropdown) {
                parentClass += " allow-dropdown";
            }
            if (this.options.separateDialCode) {
                parentClass += " separate-dial-code";
            }
            this.telInput.wrap($("<div>", {
                "class": parentClass
            }));
            this.flagsContainer = $("<div>", {
                "class": "flag-container"
            }).insertBefore(this.telInput);
            // currently selected flag (displayed to left of input)
            var selectedFlag = $("<div>", {
                "class": "selected-flag"
            });
            selectedFlag.appendTo(this.flagsContainer);
            this.selectedFlagInner = $("<div>", {
                "class": "iti-flag"
            }).appendTo(selectedFlag);
            if (this.options.separateDialCode) {
                this.selectedDialCode = $("<div>", {
                    "class": "selected-dial-code"
                }).appendTo(selectedFlag);
            }
            if (this.options.allowDropdown) {
                // make element focusable and tab naviagable
                selectedFlag.attr("tabindex", "0");
                // CSS triangle
                $("<div>", {
                    "class": "iti-arrow"
                }).appendTo(selectedFlag);
                // country dropdown: preferred countries, then divider, then all countries
                this.countryList = $("<ul>", {
                    "class": "country-list hide"
                });
                if (this.preferredCountries.length) {
                    this._appendListItems(this.preferredCountries, "preferred");
                    $("<li>", {
                        "class": "divider"
                    }).appendTo(this.countryList);
                }
                this._appendListItems(this.countries, "");
                // this is useful in lots of places
                this.countryListItems = this.countryList.children(".country");
                // create dropdownContainer markup
                if (this.options.dropdownContainer) {
                    this.dropdown = $("<div>", {
                        "class": "intl-tel-input iti-container"
                    }).append(this.countryList);
                } else {
                    this.countryList.appendTo(this.flagsContainer);
                }
            } else {
                // a little hack so we don't break anything
                this.countryListItems = $();
            }
        },
        // add a country <li> to the countryList <ul> container
        _appendListItems: function (countries, className) {
            // we create so many DOM elements, it is faster to build a temp string
            // and then add everything to the DOM in one go at the end
            var tmp = "";
            // for each country
            for (var i = 0; i < countries.length; i++) {
                var c = countries[i];
                // open the list item
                tmp += "<li class='country " + className + "' data-dial-code='" + c.dialCode + "' data-country-code='" + c.iso2 + "'>";
                // add the flag
                tmp += "<div class='flag-box'><div class='iti-flag " + c.iso2 + "'></div></div>";
                // and the country name and dial code
                tmp += "<span class='country-name'>" + c.name + "</span>";
                tmp += "<span class='dial-code'>+" + c.dialCode + "</span>";
                // close the list item
                tmp += "</li>";
            }
            this.countryList.append(tmp);
        },
        // set the initial state of the input value and the selected flag by:
        // 1. extracting a dial code from the given number
        // 2. using explicit initialCountry
        // 3. picking the first preferred country
        // 4. picking the first country
        _setInitialState: function () {
            var val = this.telInput.val();
            // if we already have a dial code we can go ahead and set the flag, else fall back to default
            if (this._getDialCode(val)) {
                //this._updateFlagFromNumber(val, true);
            } else if (this.options.initialCountry !== "auto") {
                // see if we should select a flag
                if (this.options.initialCountry) {
                    this._setFlag(this.options.initialCountry.toLowerCase(), true);
                } else {
                    // no dial code and no initialCountry, so default to first in list
                    this.defaultCountry = this.preferredCountries.length ? this.preferredCountries[0].iso2 : this.countries[0].iso2;
                    if (!val) {
                        this._setFlag(this.defaultCountry, true);
                    }
                }
                // if empty and no nationalMode and no autoHideDialCode then insert the default dial code
                if (!val && !this.options.nationalMode && !this.options.autoHideDialCode && !this.options.separateDialCode) {
                    //this.telInput.val("+" + this.selectedCountryData.dialCode);
                    this.telInput.val("");
                }
            }
            // NOTE: if initialCountry is set to auto, that will be handled separately
            // format
            if (val) {
                // this wont be run after _updateDialCode as that's only called if no val
                this._updateValFromNumber(val, this.options.formatOnInit);
            }
        },
        // initialise the main event listeners: input keyup, and click selected flag
        _initListeners: function () {
            this._initKeyListeners();
            if (this.options.autoHideDialCode) {
                this._initFocusListeners();
            }
            if (this.options.allowDropdown) {
                this._initDropdownListeners();
            }
        },
        // initialise the dropdown listeners
        _initDropdownListeners: function () {
            var that = this;
            // hack for input nested inside label: clicking the selected-flag to open the dropdown would then automatically trigger a 2nd click on the input which would close it again
            var label = this.telInput.closest("label");
            if (label.length) {
                label.on("click" + this.ns, function (e) {
                    // if the dropdown is closed, then focus the input, else ignore the click
                    if (that.countryList.hasClass("hide")) {
                        that.telInput.focus();
                    } else {
                        e.preventDefault();
                    }
                });
            }
            // toggle country dropdown on click
            var selectedFlag = this.selectedFlagInner.parent();
            selectedFlag.on("click" + this.ns, function (e) {
                // only intercept this event if we're opening the dropdown
                // else let it bubble up to the top ("click-off-to-close" listener)
                // we cannot just stopPropagation as it may be needed to close another instance
                if (that.countryList.hasClass("hide") && !that.telInput.prop("disabled") && !that.telInput.prop("readonly")) {
                    that._showDropdown();
                }
            });
            // open dropdown list if currently focused
            this.flagsContainer.on("keydown" + that.ns, function (e) {
                var isDropdownHidden = that.countryList.hasClass("hide");
                if (isDropdownHidden && (e.which == keys.UP || e.which == keys.DOWN || e.which == keys.SPACE || e.which == keys.ENTER)) {
                    // prevent form from being submitted if "ENTER" was pressed
                    e.preventDefault();
                    // prevent event from being handled again by document
                    e.stopPropagation();
                    that._showDropdown();
                }
                // allow navigation from dropdown to input on TAB
                if (e.which == keys.TAB) {
                    that._closeDropdown();
                }
            });
        },
        // init many requests: utils script / geo ip lookup
        _initRequests: function () {
            var that = this;
            // if the user has specified the path to the utils script, fetch it on window.load, else resolve
            if (this.options.utilsScript) {
                // if the plugin is being initialised after the window.load event has already been fired
                if ($.fn[pluginName].windowLoaded) {
                    $.fn[pluginName].loadUtils(this.options.utilsScript, this.utilsScriptDeferred);
                } else {
                    // wait until the load event so we don't block any other requests e.g. the flags image
                    $(window).on("load", function () {
                        $.fn[pluginName].loadUtils(that.options.utilsScript, that.utilsScriptDeferred);
                    });
                }
            } else {
                this.utilsScriptDeferred.resolve();
            }
            if (this.options.initialCountry === "auto") {
                this._loadAutoCountry();
            } else {
                this.autoCountryDeferred.resolve();
            }
        },
        // perform the geo ip lookup
        _loadAutoCountry: function () {
            var that = this;
            // 3 options:
            // 1) already loaded (we're done)
            // 2) not already started loading (start)
            // 3) already started loading (do nothing - just wait for loading callback to fire)
            if ($.fn[pluginName].autoCountry) {
                this.handleAutoCountry();
            } else if (!$.fn[pluginName].startedLoadingAutoCountry) {
                // don't do this twice!
                $.fn[pluginName].startedLoadingAutoCountry = true;
                if (typeof this.options.geoIpLookup === "function") {
                    this.options.geoIpLookup(function (countryCode) {
                        $.fn[pluginName].autoCountry = countryCode.toLowerCase();
                        // tell all instances the auto country is ready
                        // TODO: this should just be the current instances
                        // UPDATE: use setTimeout in case their geoIpLookup function calls this callback straight away (e.g. if they have already done the geo ip lookup somewhere else). Using setTimeout means that the current thread of execution will finish before executing this, which allows the plugin to finish initialising.
                        setTimeout(function () {
                            $(".intl-tel-input input").intlTelInput("handleAutoCountry");
                        });
                    });
                }
            }
        },
        // initialize any key listeners
        _initKeyListeners: function () {
            var that = this;
            // update flag on keyup
            // (keep this listener separate otherwise the setTimeout breaks all the tests)
            this.telInput.on("keyup" + this.ns, function () {
                //that._updateFlagFromNumber(that.telInput.val());
            });
            // update flag on cut/paste events (now supported in all major browsers)
            this.telInput.on("cut" + this.ns + " paste" + this.ns, function () {
                // hack because "paste" event is fired before input is updated
                setTimeout(function () {
                    //that._updateFlagFromNumber(that.telInput.val());
                });
            });
        },
        // adhere to the input's maxlength attr
        _cap: function (number) {
            var max = this.telInput.attr("maxlength");
            return max && number.length > max ? number.substr(0, max) : number;
        },
        // listen for mousedown, focus and blur
        _initFocusListeners: function () {
            var that = this;
            // mousedown decides where the cursor goes, so if we're focusing we must preventDefault as we'll be inserting the dial code, and we want the cursor to be at the end no matter where they click
            this.telInput.on("mousedown" + this.ns, function (e) {
                if (!that.telInput.is(":focus") && !that.telInput.val()) {
                    e.preventDefault();
                    // but this also cancels the focus, so we must trigger that manually
                    that.telInput.focus();
                }
            });
            // on focus: if empty, insert the dial code for the currently selected flag
            this.telInput.on("focus" + this.ns, function (e) {
                if (!that.telInput.val() && !that.telInput.prop("readonly") && that.selectedCountryData.dialCode) {
                    // insert the dial code
                    //that.telInput.val("+" + that.selectedCountryData.dialCode);
                    that.telInput.val("");
                    // after auto-inserting a dial code, if the first key they hit is '+' then assume they are entering a new number, so remove the dial code. use keypress instead of keydown because keydown gets triggered for the shift key (required to hit the + key), and instead of keyup because that shows the new '+' before removing the old one
                    that.telInput.one("keypress.plus" + that.ns, function (e) {
                        if (e.which == keys.PLUS) {
                            that.telInput.val("");
                        }
                    });
                    // after tabbing in, make sure the cursor is at the end we must use setTimeout to get outside of the focus handler as it seems the selection happens after that
                    setTimeout(function () {
                        var input = that.telInput[0];
                        if (that.isGoodBrowser) {
                            var len = that.telInput.val().length;
                            input.setSelectionRange(len, len);
                        }
                    });
                }
            });
            // on blur or form submit: if just a dial code then remove it
            var form = this.telInput.prop("form");
            if (form) {
                $(form).on("submit" + this.ns, function () {
                    that._removeEmptyDialCode();
                });
            }
            this.telInput.on("blur" + this.ns, function () {
                that._removeEmptyDialCode();
            });
        },
        _removeEmptyDialCode: function () {
            var value = this.telInput.val(), startsPlus = value.charAt(0) == "+";
            if (startsPlus) {
                var numeric = this._getNumeric(value);
                // if just a plus, or if just a dial code
                if (!numeric || this.selectedCountryData.dialCode == numeric) {
                    this.telInput.val("");
                }
            }
            // remove the keypress listener we added on focus
            this.telInput.off("keypress.plus" + this.ns);
        },
        // extract the numeric digits from the given string
        _getNumeric: function (s) {
            return s.replace(/\D/g, "");
        },
        // show the dropdown
        _showDropdown: function () {
            this._setDropdownPosition();
            // update highlighting and scroll to active list item
            var activeListItem = this.countryList.children(".active");
            if (activeListItem.length) {
                this._highlightListItem(activeListItem);
                this._scrollTo(activeListItem);
            }
            // bind all the dropdown-related listeners: mouseover, click, click-off, keydown
            this._bindDropdownListeners();
            // update the arrow
            this.selectedFlagInner.children(".iti-arrow").addClass("up");
        },
        // decide where to position dropdown (depends on position within viewport, and scroll)
        _setDropdownPosition: function () {
            var that = this;
            if (this.options.dropdownContainer) {
                this.dropdown.appendTo(this.options.dropdownContainer);
            }
            // show the menu and grab the dropdown height
            this.dropdownHeight = this.countryList.removeClass("hide").outerHeight();
            if (!this.isMobile) {
                var pos = this.telInput.offset(), inputTop = pos.top, windowTop = $(window).scrollTop(), // dropdownFitsBelow = (dropdownBottom < windowBottom)
                dropdownFitsBelow = inputTop + this.telInput.outerHeight() + this.dropdownHeight < windowTop + $(window).height(), dropdownFitsAbove = inputTop - this.dropdownHeight > windowTop;
                // by default, the dropdown will be below the input. If we want to position it above the input, we add the dropup class.
                this.countryList.toggleClass("dropup", !dropdownFitsBelow && dropdownFitsAbove);
                // if dropdownContainer is enabled, calculate postion
                if (this.options.dropdownContainer) {
                    // by default the dropdown will be directly over the input because it's not in the flow. If we want to position it below, we need to add some extra top value.
                    var extraTop = !dropdownFitsBelow && dropdownFitsAbove ? 0 : this.telInput.innerHeight();
                    // calculate placement
                    this.dropdown.css({
                        top: inputTop + extraTop,
                        left: pos.left
                    });
                    // close menu on window scroll
                    $(window).on("scroll" + this.ns, function () {
                        that._closeDropdown();
                    });
                }
            }
        },
        // we only bind dropdown listeners when the dropdown is open
        _bindDropdownListeners: function () {
            var that = this;
            // when mouse over a list item, just highlight that one
            // we add the class "highlight", so if they hit "enter" we know which one to select
            this.countryList.on("mouseover" + this.ns, ".country", function (e) {
                that._highlightListItem($(this));
            });
            // listen for country selection
            this.countryList.on("click" + this.ns, ".country", function (e) {
                that._selectListItem($(this));
            });
            // click off to close
            // (except when this initial opening click is bubbling up)
            // we cannot just stopPropagation as it may be needed to close another instance
            var isOpening = true;
            $("html").on("click" + this.ns, function (e) {
                if (!isOpening) {
                    that._closeDropdown();
                }
                isOpening = false;
            });
            // listen for up/down scrolling, enter to select, or letters to jump to country name.
            // use keydown as keypress doesn't fire for non-char keys and we want to catch if they
            // just hit down and hold it to scroll down (no keyup event).
            // listen on the document because that's where key events are triggered if no input has focus
            var query = "", queryTimer = null;
            $(document).on("keydown" + this.ns, function (e) {
                // prevent down key from scrolling the whole page,
                // and enter key from submitting a form etc
                e.preventDefault();
                if (e.which == keys.UP || e.which == keys.DOWN) {
                    // up and down to navigate
                    that._handleUpDownKey(e.which);
                } else if (e.which == keys.ENTER) {
                    // enter to select
                    that._handleEnterKey();
                } else if (e.which == keys.ESC) {
                    // esc to close
                    that._closeDropdown();
                } else if (e.which >= keys.A && e.which <= keys.Z || e.which == keys.SPACE) {
                    // upper case letters (note: keyup/keydown only return upper case letters)
                    // jump to countries that start with the query string
                    if (queryTimer) {
                        clearTimeout(queryTimer);
                    }
                    query += String.fromCharCode(e.which);
                    that._searchForCountry(query);
                    // if the timer hits 1 second, reset the query
                    queryTimer = setTimeout(function () {
                        query = "";
                    }, 1e3);
                }
            });
        },
        // highlight the next/prev item in the list (and ensure it is visible)
        _handleUpDownKey: function (key) {
            var current = this.countryList.children(".highlight").first();
            var next = key == keys.UP ? current.prev() : current.next();
            if (next.length) {
                // skip the divider
                if (next.hasClass("divider")) {
                    next = key == keys.UP ? next.prev() : next.next();
                }
                this._highlightListItem(next);
                this._scrollTo(next);
            }
        },
        // select the currently highlighted item
        _handleEnterKey: function () {
            var currentCountry = this.countryList.children(".highlight").first();
            if (currentCountry.length) {
                this._selectListItem(currentCountry);
            }
        },
        // find the first list item whose name starts with the query string
        _searchForCountry: function (query) {
            for (var i = 0; i < this.countries.length; i++) {
                if (this._startsWith(this.countries[i].name, query)) {
                    var listItem = this.countryList.children("[data-country-code=" + this.countries[i].iso2 + "]").not(".preferred");
                    // update highlighting and scroll
                    this._highlightListItem(listItem);
                    this._scrollTo(listItem, true);
                    break;
                }
            }
        },
        // check if (uppercase) string a starts with string b
        _startsWith: function (a, b) {
            return a.substr(0, b.length).toUpperCase() == b;
        },
        // update the input's value to the given val (format first if possible)
        // NOTE: this is called from _setInitialState, handleUtils and setNumber
        _updateValFromNumber: function (number, doFormat) {
            //if (doFormat && window.intlTelInputUtils && this.selectedCountryData) {
            //    var format = !this.options.separateDialCode && (this.options.nationalMode || number.charAt(0) != "+") ? intlTelInputUtils.numberFormat.NATIONAL : intlTelInputUtils.numberFormat.INTERNATIONAL;
            //    number = intlTelInputUtils.formatNumber(number, this.selectedCountryData.iso2, format);
            //}
            //number = this._beforeSetNumber(number);
            this.telInput.val(number);
        },
        // check if need to select a new flag based on the given number
        // Note: called from _setInitialState, keyup handler, setNumber
        _updateFlagFromNumber: function (number, isInit) {
            // if we're in nationalMode and we already have US/Canada selected, make sure the number starts with a +1 so _getDialCode will be able to extract the area code
            // update: if we dont yet have selectedCountryData, but we're here (trying to update the flag from the number), that means we're initialising the plugin with a number that already has a dial code, so fine to ignore this bit
            if (number && this.options.nationalMode && this.selectedCountryData && this.selectedCountryData.dialCode == "1" && number.charAt(0) != "+") {
                if (number.charAt(0) != "1") {
                    number = "1" + number;
                }
                number = "+" + number;
            }
            // try and extract valid dial code from input
            var dialCode = this._getDialCode(number), countryCode = null;
            if (dialCode) {
                // check if one of the matching countries is already selected
                var countryCodes = this.countryCodes[this._getNumeric(dialCode)], alreadySelected = this.selectedCountryData && $.inArray(this.selectedCountryData.iso2, countryCodes) != -1;
                // if a matching country is not already selected (or this is an unknown NANP area code): choose the first in the list
                if (!alreadySelected || this._isUnknownNanp(number, dialCode)) {
                    // if using onlyCountries option, countryCodes[0] may be empty, so we must find the first non-empty index
                    for (var j = 0; j < countryCodes.length; j++) {
                        if (countryCodes[j]) {
                            countryCode = countryCodes[j];
                            break;
                        }
                    }
                }
            } else if (number.charAt(0) == "+" && this._getNumeric(number).length) {
                // invalid dial code, so empty
                // Note: use getNumeric here because the number has not been formatted yet, so could contain bad chars
                countryCode = "";
            } else if (!number || number == "+") {
                // empty, or just a plus, so default
                countryCode = this.defaultCountry;
            }

            if (countryCode !== null) {
                this._setFlag(countryCode, isInit);
            }
        },
        // check if the given number contains an unknown area code from the North American Numbering Plan i.e. the only dialCode that could be extracted was +1 (instead of say +1 702) and the actual number's length is >=4
        _isUnknownNanp: function (number, dialCode) {
            return dialCode == "+1" && this._getNumeric(number).length >= 4;
        },
        // remove highlighting from other list items and highlight the given item
        _highlightListItem: function (listItem) {
            this.countryListItems.removeClass("highlight");
            listItem.addClass("highlight");
        },
        // find the country data for the given country code
        // the ignoreOnlyCountriesOption is only used during init() while parsing the onlyCountries array
        _getCountryData: function (countryCode, ignoreOnlyCountriesOption, allowFail) {
            var countryList = ignoreOnlyCountriesOption ? allCountries : this.countries;
            for (var i = 0; i < countryList.length; i++) {
                if (countryList[i].iso2 == countryCode) {
                    return countryList[i];
                }
            }
            if (allowFail) {
                return null;
            } else {
                throw new Error("No country data for '" + countryCode + "'");
            }
        },
        // select the given flag, update the placeholder and the active list item
        // Note: called from _setInitialState, _updateFlagFromNumber, _selectListItem, setCountry
        _setFlag: function (countryCode, isInit) {
            var prevCountry = this.selectedCountryData && this.selectedCountryData.iso2 ? this.selectedCountryData : {};
            // do this first as it will throw an error and stop if countryCode is invalid
            this.selectedCountryData = countryCode ? this._getCountryData(countryCode, false, false) : {};
            // update the defaultCountry - we only need the iso2 from now on, so just store that
            if (this.selectedCountryData.iso2) {
                this.defaultCountry = this.selectedCountryData.iso2;
            }
            this.selectedFlagInner.attr("class", "iti-flag " + countryCode);
            // update the selected country's title attribute
            var title = countryCode ? this.selectedCountryData.name + ": +" + this.selectedCountryData.dialCode : "Unknown";
            this.selectedFlagInner.parent().attr("title", title);
            if (this.options.separateDialCode) {
                var dialCode = this.selectedCountryData.dialCode ? "+" + this.selectedCountryData.dialCode : "", parent = this.telInput.parent();
                if (prevCountry.dialCode) {
                    parent.removeClass("iti-sdc-" + (prevCountry.dialCode.length + 1));
                }
                if (dialCode) {
                    parent.addClass("iti-sdc-" + dialCode.length);
                }
                this.selectedDialCode.text(dialCode);
            }
            // and the input's placeholder
            this._updatePlaceholder();
            // update the active list item
            this.countryListItems.removeClass("active");
            if (countryCode) {
                this.countryListItems.find(".iti-flag." + countryCode).first().closest(".country").addClass("active");
            }
            // on change flag, trigger a custom event
            if (!isInit && prevCountry.iso2 !== countryCode) {
                this.telInput.trigger("countrychange", this.selectedCountryData);
            }
        },
        // update the input placeholder to an example number from the currently selected country
        _updatePlaceholder: function () {
            var shouldSetPlaceholder = this.options.autoPlaceholder === "aggressive" || !this.hadInitialPlaceholder && (this.options.autoPlaceholder === true || this.options.autoPlaceholder === "polite");
            if (window.intlTelInputUtils && shouldSetPlaceholder && this.selectedCountryData) {
                var numberType = intlTelInputUtils.numberType[this.options.numberType], placeholder = this.selectedCountryData.iso2 ? intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2, this.options.nationalMode, numberType) : "";
                placeholder = this._beforeSetNumber(placeholder);
                if (typeof this.options.customPlaceholder === "function") {
                    placeholder = this.options.customPlaceholder(placeholder, this.selectedCountryData);
                }
                this.telInput.attr("placeholder", placeholder);
            }
        },
        // called when the user selects a list item from the dropdown
        _selectListItem: function (listItem) {
            // update selected flag and active list item
            this._setFlag(listItem.attr("data-country-code"));
            this._closeDropdown();
            this._updateDialCode(listItem.attr("data-dial-code"), true);
            // focus the input
            this.telInput.focus();
            // put cursor at end - this fix is required for FF and IE11 (with nationalMode=false i.e. auto inserting dial code), who try to put the cursor at the beginning the first time
            if (this.isGoodBrowser) {
                var len = this.telInput.val().length;
                this.telInput[0].setSelectionRange(len, len);
            }
        },
        // close the dropdown and unbind any listeners
        _closeDropdown: function () {
            this.countryList.addClass("hide");
            // update the arrow
            this.selectedFlagInner.children(".iti-arrow").removeClass("up");
            // unbind key events
            $(document).off(this.ns);
            // unbind click-off-to-close
            $("html").off(this.ns);
            // unbind hover and click listeners
            this.countryList.off(this.ns);
            // remove menu from container
            if (this.options.dropdownContainer) {
                if (!this.isMobile) {
                    $(window).off("scroll" + this.ns);
                }
                this.dropdown.detach();
            }
        },
        // check if an element is visible within it's container, else scroll until it is
        _scrollTo: function (element, middle) {
            var container = this.countryList, containerHeight = container.height(), containerTop = container.offset().top, containerBottom = containerTop + containerHeight, elementHeight = element.outerHeight(), elementTop = element.offset().top, elementBottom = elementTop + elementHeight, newScrollTop = elementTop - containerTop + container.scrollTop(), middleOffset = containerHeight / 2 - elementHeight / 2;
            if (elementTop < containerTop) {
                // scroll up
                if (middle) {
                    newScrollTop -= middleOffset;
                }
                container.scrollTop(newScrollTop);
            } else if (elementBottom > containerBottom) {
                // scroll down
                if (middle) {
                    newScrollTop += middleOffset;
                }
                var heightDifference = containerHeight - elementHeight;
                container.scrollTop(newScrollTop - heightDifference);
            }
        },
        // replace any existing dial code with the new one
        // Note: called from _selectListItem and setCountry
        _updateDialCode: function (newDialCode, hasSelectedListItem) {
            var inputVal = this.telInput.val(), newNumber;
            // save having to pass this every time
            newDialCode = "+" + newDialCode;
            if (inputVal.charAt(0) == "+") {
                // there's a plus so we're dealing with a replacement (doesn't matter if nationalMode or not)
                var prevDialCode = this._getDialCode(inputVal);
                if (prevDialCode) {
                    // current number contains a valid dial code, so replace it
                    newNumber = inputVal.replace(prevDialCode, newDialCode);
                } else {
                    // current number contains an invalid dial code, so ditch it
                    // (no way to determine where the invalid dial code ends and the rest of the number begins)
                    newNumber = newDialCode;
                }
            } else if (this.options.nationalMode || this.options.separateDialCode) {
                // don't do anything
                return;
            } else {
                // nationalMode is disabled
                if (inputVal) {
                    // there is an existing value with no dial code: prefix the new dial code
                    newNumber = newDialCode + inputVal;
                } else if (hasSelectedListItem || !this.options.autoHideDialCode) {
                    // no existing value and either they've just selected a list item, or autoHideDialCode is disabled: insert new dial code
                    newNumber = newDialCode;
                } else {
                    return;
                }
            }
            //this.telInput.val(newNumber);
        },
        // try and extract a valid international dial code from a full telephone number
        // Note: returns the raw string inc plus character and any whitespace/dots etc
        _getDialCode: function (number) {
            var dialCode = "";
            // only interested in international numbers (starting with a plus)
            if (number.charAt(0) == "+") {
                var numericChars = "";
                // iterate over chars
                for (var i = 0; i < number.length; i++) {
                    var c = number.charAt(i);
                    // if char is number
                    if ($.isNumeric(c)) {
                        numericChars += c;
                        // if current numericChars make a valid dial code
                        if (this.countryCodes[numericChars]) {
                            // store the actual raw string (useful for matching later)
                            dialCode = number.substr(0, i + 1);
                        }
                        // longest dial code is 4 chars
                        if (numericChars.length == 4) {
                            break;
                        }
                    }
                }
            }
            return dialCode;
        },
        // get the input val, adding the dial code if separateDialCode is enabled
        _getFullNumber: function () {
            var prefix = this.options.separateDialCode ? "+" + this.selectedCountryData.dialCode : "";
            return this.telInput.val();
        },
        // remove the dial code if separateDialCode is enabled
        _beforeSetNumber: function (number) {
            if (this.options.separateDialCode) {
                var dialCode = this._getDialCode(number);
                if (dialCode) {
                    // US dialCode is "+1", which is what we want
                    // CA dialCode is "+1 123", which is wrong - should be "+1" (as it has multiple area codes)
                    // AS dialCode is "+1 684", which is what we want
                    // Solution: if the country has area codes, then revert to just the dial code
                    if (this.selectedCountryData.areaCodes !== null) {
                        dialCode = "+" + this.selectedCountryData.dialCode;
                    }
                    // a lot of numbers will have a space separating the dial code and the main number, and some NANP numbers will have a hyphen e.g. +1 684-733-1234 - in both cases we want to get rid of it
                    // NOTE: don't just trim all non-numerics as may want to preserve an open parenthesis etc
                    var start = number[dialCode.length] === " " || number[dialCode.length] === "-" ? dialCode.length + 1 : dialCode.length;
                    number = number.substr(start);
                }
            }
            return this._cap(number);
        },
        /********************
   *  PUBLIC METHODS
   ********************/
        // this is called when the geoip call returns
        handleAutoCountry: function () {
            if (this.options.initialCountry === "auto") {
                // we must set this even if there is an initial val in the input: in case the initial val is invalid and they delete it - they should see their auto country
                this.defaultCountry = $.fn[pluginName].autoCountry;
                // if there's no initial value in the input, then update the flag
                if (!this.telInput.val()) {
                    this.setCountry(this.defaultCountry);
                }
                this.autoCountryDeferred.resolve();
            }
        },
        // remove plugin
        destroy: function () {
            if (this.allowDropdown) {
                // make sure the dropdown is closed (and unbind listeners)
                this._closeDropdown();
                // click event to open dropdown
                this.selectedFlagInner.parent().off(this.ns);
                // label click hack
                this.telInput.closest("label").off(this.ns);
            }
            // unbind submit event handler on form
            if (this.options.autoHideDialCode) {
                var form = this.telInput.prop("form");
                if (form) {
                    $(form).off(this.ns);
                }
            }
            // unbind all events: key events, and focus/blur events if autoHideDialCode=true
            this.telInput.off(this.ns);
            // remove markup (but leave the original input)
            var container = this.telInput.parent();
            container.before(this.telInput).remove();
        },
        // get the extension from the current number
        getExtension: function () {
            if (window.intlTelInputUtils) {
                return intlTelInputUtils.getExtension(this._getFullNumber(), this.selectedCountryData.iso2);
            }
            return "";
        },
        // format the number to the given format
        getNumber: function (format) {
            if (window.intlTelInputUtils) {
                //return intlTelInputUtils.formatNumber(this._getFullNumber(), this.selectedCountryData.iso2, format);
                return intlTelInputUtils.formatNumber(this._getFullNumber(), "", format);
            }
            return "";
        },
        // get the type of the entered number e.g. landline/mobile
        getNumberType: function () {
            if (window.intlTelInputUtils) {
                return intlTelInputUtils.getNumberType(this._getFullNumber(), this.selectedCountryData.iso2);
            }
            return -99;
        },
        // get the country data for the currently selected flag
        getSelectedCountryData: function () {
            // if this is undefined, the plugin will return it's instance instead, so in that case an empty object makes more sense
            return this.selectedCountryData || {};
        },
        // get the validation error
        getValidationError: function () {
            if (window.intlTelInputUtils) {
                return intlTelInputUtils.getValidationError(this._getFullNumber(), this.selectedCountryData.iso2);
            }
            return -99;
        },
        // validate the input val - assumes the global function isValidNumber (from utilsScript)
        isValidNumber: function () {
            var val = $.trim(this._getFullNumber()), countryCode = this.options.nationalMode ? this.selectedCountryData.iso2 : "";
            return window.intlTelInputUtils ? intlTelInputUtils.isValidNumber(val, countryCode) : null;
        },
        // update the selected flag, and update the input val accordingly
        setCountry: function (countryCode) {
            countryCode = countryCode.toLowerCase();
            // check if already selected
            if (!this.selectedFlagInner.hasClass(countryCode)) {
                this._setFlag(countryCode);
                this._updateDialCode(this.selectedCountryData.dialCode, false);
            }
        },
        // set the input value and update the flag
        // NOTE: preventFormat arg is for public method
        setNumber: function (number, preventFormat) {
            // we must update the flag first, which updates this.selectedCountryData, which is used for formatting the number before displaying it
            //this._updateFlagFromNumber(number);
            this._updateValFromNumber(number, !preventFormat);
        },
        // this is called when the utils request completes
        handleUtils: function () {
            // if the request was successful
            if (window.intlTelInputUtils) {
                // if there's an initial value in the input, then format it
                if (this.telInput.val()) {
                    this._updateValFromNumber(this.telInput.val(), this.options.formatOnInit);
                }
                this._updatePlaceholder();
            }
            this.utilsScriptDeferred.resolve();
        }
    };
    // using https://github.com/jquery-boilerplate/jquery-boilerplate/wiki/Extending-jQuery-Boilerplate
    // (adapted to allow public functions)
    $.fn[pluginName] = function (options) {
        var args = arguments;
        // Is the first parameter an object (options), or was omitted,
        // instantiate a new instance of the plugin.
        if (options === undefined || typeof options === "object") {
            // collect all of the deferred objects for all instances created with this selector
            var deferreds = [];
            this.each(function () {
                if (!$.data(this, "plugin_" + pluginName)) {
                    var instance = new Plugin(this, options);
                    var instanceDeferreds = instance._init();
                    // we now have 2 deffereds: 1 for auto country, 1 for utils script
                    deferreds.push(instanceDeferreds[0]);
                    deferreds.push(instanceDeferreds[1]);
                    $.data(this, "plugin_" + pluginName, instance);
                }
            });
            // return the promise from the "master" deferred object that tracks all the others
            return $.when.apply(null, deferreds);
        } else if (typeof options === "string" && options[0] !== "_") {
            // If the first parameter is a string and it doesn't start
            // with an underscore or "contains" the `init`-function,
            // treat this as a call to a public method.
            // Cache the method call to make it possible to return a value
            var returns;
            this.each(function () {
                var instance = $.data(this, "plugin_" + pluginName);
                // Tests that there's already a plugin-instance
                // and checks that the requested public method exists
                if (instance instanceof Plugin && typeof instance[options] === "function") {
                    // Call the method of our plugin instance,
                    // and pass it the supplied arguments.
                    returns = instance[options].apply(instance, Array.prototype.slice.call(args, 1));
                }
                // Allow instances to be destroyed via the 'destroy' method
                if (options === "destroy") {
                    $.data(this, "plugin_" + pluginName, null);
                }
            });
            // If the earlier cached method gives a value back return the value,
            // otherwise return this to preserve chainability.
            return returns !== undefined ? returns : this;
        }
    };
    /********************
 *  STATIC METHODS
 ********************/
    // get the country data object
    $.fn[pluginName].getCountryData = function () {
        return allCountries;
    };
    // load the utils script
    $.fn[pluginName].loadUtils = function (path, utilsScriptDeferred) {
        if (!$.fn[pluginName].loadedUtilsScript) {
            // don't do this twice! (dont just check if window.intlTelInputUtils exists as if init plugin multiple times in quick succession, it may not have finished loading yet)
            $.fn[pluginName].loadedUtilsScript = true;
            // dont use $.getScript as it prevents caching
            $.ajax({
                type: "GET",
                url: path,
                complete: function () {
                    // tell all instances that the utils request is complete
                    $(".intl-tel-input input").intlTelInput("handleUtils");
                },
                dataType: "script",
                cache: true
            });
        } else if (utilsScriptDeferred) {
            utilsScriptDeferred.resolve();
        }
    };
    // version
    $.fn[pluginName].version = "9.2.4";
    // default options
    $.fn[pluginName].defaults = defaults;
    // Array of country objects for the flag dropdown.
    // Each contains a name, country code (ISO 3166-1 alpha-2) and dial code.
    // Originally from https://github.com/mledoze/countries
    // then with a couple of manual re-arrangements to be alphabetical
    // then changed Kazakhstan from +76 to +7
    // and Vatican City from +379 to +39 (see issue 50)
    // and Caribean Netherlands from +5997 to +599
    // and Curacao from +5999 to +599
    // Removed:  Kosovo, Pitcairn Islands, South Georgia
    // UPDATE Sept 12th 2015
    // List of regions that have iso2 country codes, which I have chosen to omit:
    // (based on this information: https://en.wikipedia.org/wiki/List_of_country_calling_codes)
    // AQ - Antarctica - all different country codes depending on which "base"
    // BV - Bouvet Island - no calling code
    // GS - South Georgia and the South Sandwich Islands - "inhospitable collection of islands" - same flag and calling code as Falkland Islands
    // HM - Heard Island and McDonald Islands - no calling code
    // PN - Pitcairn - tiny population (56), same calling code as New Zealand
    // TF - French Southern Territories - no calling code
    // UM - United States Minor Outlying Islands - no calling code
    // UPDATE the criteria of supported countries or territories (see issue 297)
    // Have an iso2 code: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
    // Have a country calling code: https://en.wikipedia.org/wiki/List_of_country_calling_codes
    // Have a flag
    // Must be supported by libphonenumber: https://github.com/googlei18n/libphonenumber
    // Update: converted objects to arrays to save bytes!
    // Update: added "priority" for countries with the same dialCode as others
    // Update: added array of area codes for countries with the same dialCode as others
    // So each country array has the following information:
    // [
    //    Country name,
    //    iso2 code,
    //    International dial code,
    //    Order (if >1 country with same dial code),
    //    Area codes (if >1 country with same dial code)
    // ]
    var allCountries = [["Afghanistan (‫افغانستان‬‎)", "af", "93"], ["Albania (Shqipëri)", "al", "355"], ["Algeria (‫الجزائر‬‎)", "dz", "213"], ["American Samoa", "as", "1684"], ["Andorra", "ad", "376"], ["Angola", "ao", "244"], ["Anguilla", "ai", "1264"], ["Antigua and Barbuda", "ag", "1268"], ["Argentina", "ar", "54"], ["Armenia (Հայաստան)", "am", "374"], ["Aruba", "aw", "297"], ["Australia", "au", "61", 0], ["Austria (Österreich)", "at", "43"], ["Azerbaijan (Azərbaycan)", "az", "994"], ["Bahamas", "bs", "1242"], ["Bahrain (‫البحرين‬‎)", "bh", "973"], ["Bangladesh (বাংলাদেশ)", "bd", "880"], ["Barbados", "bb", "1246"], ["Belarus (Беларусь)", "by", "375"], ["Belgium (België)", "be", "32"], ["Belize", "bz", "501"], ["Benin (Bénin)", "bj", "229"], ["Bermuda", "bm", "1441"], ["Bhutan (འབྲུག)", "bt", "975"], ["Bolivia", "bo", "591"], ["Bosnia and Herzegovina (Босна и Херцеговина)", "ba", "387"], ["Botswana", "bw", "267"], ["Brazil (Brasil)", "br", "55"], ["British Indian Ocean Territory", "io", "246"], ["British Virgin Islands", "vg", "1284"], ["Brunei", "bn", "673"], ["Bulgaria (България)", "bg", "359"], ["Burkina Faso", "bf", "226"], ["Burundi (Uburundi)", "bi", "257"], ["Cambodia (កម្ពុជា)", "kh", "855"], ["Cameroon (Cameroun)", "cm", "237"], ["Canada", "ca", "1", 1, ["204", "226", "236", "249", "250", "289", "306", "343", "365", "387", "403", "416", "418", "431", "437", "438", "450", "506", "514", "519", "548", "579", "581", "587", "604", "613", "639", "647", "672", "705", "709", "742", "778", "780", "782", "807", "819", "825", "867", "873", "902", "905"]], ["Cape Verde (Kabu Verdi)", "cv", "238"], ["Caribbean Netherlands", "bq", "599", 1], ["Cayman Islands", "ky", "1345"], ["Central African Republic (République centrafricaine)", "cf", "236"], ["Chad (Tchad)", "td", "235"], ["Chile", "cl", "56"], ["China (中国)", "cn", "86"], ["Christmas Island", "cx", "61", 2], ["Cocos (Keeling) Islands", "cc", "61", 1], ["Colombia", "co", "57"], ["Comoros (‫جزر القمر‬‎)", "km", "269"], ["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)", "cd", "243"], ["Congo (Republic) (Congo-Brazzaville)", "cg", "242"], ["Cook Islands", "ck", "682"], ["Costa Rica", "cr", "506"], ["Côte d’Ivoire", "ci", "225"], ["Croatia (Hrvatska)", "hr", "385"], ["Cuba", "cu", "53"], ["Curaçao", "cw", "599", 0], ["Cyprus (Κύπρος)", "cy", "357"], ["Czech Republic (Česká republika)", "cz", "420"], ["Denmark (Danmark)", "dk", "45"], ["Djibouti", "dj", "253"], ["Dominica", "dm", "1767"], ["Dominican Republic (República Dominicana)", "do", "1", 2, ["809", "829", "849"]], ["Ecuador", "ec", "593"], ["Egypt (‫مصر‬‎)", "eg", "20"], ["El Salvador", "sv", "503"], ["Equatorial Guinea (Guinea Ecuatorial)", "gq", "240"], ["Eritrea", "er", "291"], ["Estonia (Eesti)", "ee", "372"], ["Ethiopia", "et", "251"], ["Falkland Islands (Islas Malvinas)", "fk", "500"], ["Faroe Islands (Føroyar)", "fo", "298"], ["Fiji", "fj", "679"], ["Finland (Suomi)", "fi", "358", 0], ["France", "fr", "33"], ["French Guiana (Guyane française)", "gf", "594"], ["French Polynesia (Polynésie française)", "pf", "689"], ["Gabon", "ga", "241"], ["Gambia", "gm", "220"], ["Georgia (საქართველო)", "ge", "995"], ["Germany (Deutschland)", "de", "49"], ["Ghana (Gaana)", "gh", "233"], ["Gibraltar", "gi", "350"], ["Greece (Ελλάδα)", "gr", "30"], ["Greenland (Kalaallit Nunaat)", "gl", "299"], ["Grenada", "gd", "1473"], ["Guadeloupe", "gp", "590", 0], ["Guam", "gu", "1671"], ["Guatemala", "gt", "502"], ["Guernsey", "gg", "44", 1], ["Guinea (Guinée)", "gn", "224"], ["Guinea-Bissau (Guiné Bissau)", "gw", "245"], ["Guyana", "gy", "592"], ["Haiti", "ht", "509"], ["Honduras", "hn", "504"], ["Hong Kong (香港)", "hk", "852"], ["Hungary (Magyarország)", "hu", "36"], ["Iceland (Ísland)", "is", "354"], ["India (भारत)", "in", "91"], ["Indonesia", "id", "62"], ["Iran (‫ایران‬‎)", "ir", "98"], ["Iraq (‫العراق‬‎)", "iq", "964"], ["Ireland", "ie", "353"], ["Isle of Man", "im", "44", 2], ["Israel (‫ישראל‬‎)", "il", "972"], ["Italy (Italia)", "it", "39", 0], ["Jamaica", "jm", "1876"], ["Japan (日本)", "jp", "81"], ["Jersey", "je", "44", 3], ["Jordan (‫الأردن‬‎)", "jo", "962"], ["Kazakhstan (Казахстан)", "kz", "7", 1], ["Kenya", "ke", "254"], ["Kiribati", "ki", "686"], ["Kosovo", "xk", "383"], ["Kuwait (‫الكويت‬‎)", "kw", "965"], ["Kyrgyzstan (Кыргызстан)", "kg", "996"], ["Laos (ລາວ)", "la", "856"], ["Latvia (Latvija)", "lv", "371"], ["Lebanon (‫لبنان‬‎)", "lb", "961"], ["Lesotho", "ls", "266"], ["Liberia", "lr", "231"], ["Libya (‫ليبيا‬‎)", "ly", "218"], ["Liechtenstein", "li", "423"], ["Lithuania (Lietuva)", "lt", "370"], ["Luxembourg", "lu", "352"], ["Macau (澳門)", "mo", "853"], ["Macedonia (FYROM) (Македонија)", "mk", "389"], ["Madagascar (Madagasikara)", "mg", "261"], ["Malawi", "mw", "265"], ["Malaysia", "my", "60"], ["Maldives", "mv", "960"], ["Mali", "ml", "223"], ["Malta", "mt", "356"], ["Marshall Islands", "mh", "692"], ["Martinique", "mq", "596"], ["Mauritania (‫موريتانيا‬‎)", "mr", "222"], ["Mauritius (Moris)", "mu", "230"], ["Mayotte", "yt", "262", 1], ["Mexico (México)", "mx", "52"], ["Micronesia", "fm", "691"], ["Moldova (Republica Moldova)", "md", "373"], ["Monaco", "mc", "377"], ["Mongolia (Монгол)", "mn", "976"], ["Montenegro (Crna Gora)", "me", "382"], ["Montserrat", "ms", "1664"], ["Morocco (‫المغرب‬‎)", "ma", "212", 0], ["Mozambique (Moçambique)", "mz", "258"], ["Myanmar (Burma) (မြန်မာ)", "mm", "95"], ["Namibia (Namibië)", "na", "264"], ["Nauru", "nr", "674"], ["Nepal (नेपाल)", "np", "977"], ["Netherlands (Nederland)", "nl", "31"], ["New Caledonia (Nouvelle-Calédonie)", "nc", "687"], ["New Zealand", "nz", "64"], ["Nicaragua", "ni", "505"], ["Niger (Nijar)", "ne", "227"], ["Nigeria", "ng", "234"], ["Niue", "nu", "683"], ["Norfolk Island", "nf", "672"], ["North Korea (조선 민주주의 인민 공화국)", "kp", "850"], ["Northern Mariana Islands", "mp", "1670"], ["Norway (Norge)", "no", "47", 0], ["Oman (‫عُمان‬‎)", "om", "968"], ["Pakistan (‫پاکستان‬‎)", "pk", "92"], ["Palau", "pw", "680"], ["Palestine (‫فلسطين‬‎)", "ps", "970"], ["Panama (Panamá)", "pa", "507"], ["Papua New Guinea", "pg", "675"], ["Paraguay", "py", "595"], ["Peru (Perú)", "pe", "51"], ["Philippines", "ph", "63"], ["Poland (Polska)", "pl", "48"], ["Portugal", "pt", "351"], ["Puerto Rico", "pr", "1", 3, ["787", "939"]], ["Qatar (‫قطر‬‎)", "qa", "974"], ["Réunion (La Réunion)", "re", "262", 0], ["Romania (România)", "ro", "40"], ["Russia (Россия)", "ru", "7", 0], ["Rwanda", "rw", "250"], ["Saint Barthélemy (Saint-Barthélemy)", "bl", "590", 1], ["Saint Helena", "sh", "290"], ["Saint Kitts and Nevis", "kn", "1869"], ["Saint Lucia", "lc", "1758"], ["Saint Martin (Saint-Martin (partie française))", "mf", "590", 2], ["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)", "pm", "508"], ["Saint Vincent and the Grenadines", "vc", "1784"], ["Samoa", "ws", "685"], ["San Marino", "sm", "378"], ["São Tomé and Príncipe (São Tomé e Príncipe)", "st", "239"], ["Saudi Arabia (‫المملكة العربية السعودية‬‎)", "sa", "966"], ["Senegal (Sénégal)", "sn", "221"], ["Serbia (Србија)", "rs", "381"], ["Seychelles", "sc", "248"], ["Sierra Leone", "sl", "232"], ["Singapore", "sg", "65"], ["Sint Maarten", "sx", "1721"], ["Slovakia (Slovensko)", "sk", "421"], ["Slovenia (Slovenija)", "si", "386"], ["Solomon Islands", "sb", "677"], ["Somalia (Soomaaliya)", "so", "252"], ["South Africa", "za", "27"], ["South Korea (대한민국)", "kr", "82"], ["South Sudan (‫جنوب السودان‬‎)", "ss", "211"], ["Spain (España)", "es", "34"], ["Sri Lanka (ශ්‍රී ලංකාව)", "lk", "94"], ["Sudan (‫السودان‬‎)", "sd", "249"], ["Suriname", "sr", "597"], ["Svalbard and Jan Mayen", "sj", "47", 1], ["Swaziland", "sz", "268"], ["Sweden (Sverige)", "se", "46"], ["Switzerland (Schweiz)", "ch", "41"], ["Syria (‫سوريا‬‎)", "sy", "963"], ["Taiwan (台灣)", "tw", "886"], ["Tajikistan", "tj", "992"], ["Tanzania", "tz", "255"], ["Thailand (ไทย)", "th", "66"], ["Timor-Leste", "tl", "670"], ["Togo", "tg", "228"], ["Tokelau", "tk", "690"], ["Tonga", "to", "676"], ["Trinidad and Tobago", "tt", "1868"], ["Tunisia (‫تونس‬‎)", "tn", "216"], ["Turkey (Türkiye)", "tr", "90"], ["Turkmenistan", "tm", "993"], ["Turks and Caicos Islands", "tc", "1649"], ["Tuvalu", "tv", "688"], ["U.S. Virgin Islands", "vi", "1340"], ["Uganda", "ug", "256"], ["Ukraine (Україна)", "ua", "380"], ["United Arab Emirates (‫الإمارات العربية المتحدة‬‎)", "ae", "971"], ["United Kingdom", "gb", "44", 0], ["United States", "us", "1", 0], ["Uruguay", "uy", "598"], ["Uzbekistan (Oʻzbekiston)", "uz", "998"], ["Vanuatu", "vu", "678"], ["Vatican City (Città del Vaticano)", "va", "39", 1], ["Venezuela", "ve", "58"], ["Vietnam (Việt Nam)", "vn", "84"], ["Wallis and Futuna", "wf", "681"], ["Western Sahara (‫الصحراء الغربية‬‎)", "eh", "212", 1], ["Yemen (‫اليمن‬‎)", "ye", "967"], ["Zambia", "zm", "260"], ["Zimbabwe", "zw", "263"], ["Åland Islands", "ax", "358", 1]];
    // loop over all of the countries above
    for (var i = 0; i < allCountries.length; i++) {
        var c = allCountries[i];
        allCountries[i] = {
            name: c[0],
            iso2: c[1],
            dialCode: c[2],
            priority: c[3] || 0,
            areaCodes: c[4] || null
        };
    }
});;
/* ng-infinite-scroll - v1.1.2 - 2014-11-24 */
var mod;mod=angular.module("infinite-scroll",[]),mod.value("THROTTLE_MILLISECONDS",null),mod.directive("infiniteScroll",["$rootScope","$window","$timeout","THROTTLE_MILLISECONDS",function(a,b,c,d){return{scope:{infiniteScroll:"&",infiniteScrollContainer:"=",infiniteScrollDistance:"=",infiniteScrollDisabled:"=",infiniteScrollUseDocumentBottom:"="},link:function(e,f,g){var h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;return x=angular.element(b),t=null,u=null,i=null,j=null,q=!0,w=!1,p=function(a){return a=a[0]||a,isNaN(a.offsetHeight)?a.document.documentElement.clientHeight:a.offsetHeight},r=function(a){return a[0].getBoundingClientRect&&!a.css("none")?a[0].getBoundingClientRect().top+s(a):void 0},s=function(a){return a=a[0]||a,isNaN(window.pageYOffset)?a.document.documentElement.scrollTop:a.ownerDocument.defaultView.pageYOffset},o=function(){var b,c,d,g,h;return j===x?(b=p(j)+s(j[0].document.documentElement),d=r(f)+p(f)):(b=p(j),c=0,void 0!==r(j)&&(c=r(j)),d=r(f)-c+p(f)),w&&(d=p((f[0].ownerDocument||f[0].document).documentElement)),g=d-b,h=g<=p(j)*t+1,h?(i=!0,u?e.$$phase||a.$$phase?e.infiniteScroll():e.$apply(e.infiniteScroll):void 0):i=!1},v=function(a,b){var d,e,f;return f=null,e=0,d=function(){var b;return e=(new Date).getTime(),c.cancel(f),f=null,a.call(),b=null},function(){var g,h;return g=(new Date).getTime(),h=b-(g-e),0>=h?(clearTimeout(f),c.cancel(f),f=null,e=g,a.call()):f?void 0:f=c(d,h)}},null!=d&&(o=v(o,d)),e.$on("$destroy",function(){return j.unbind("scroll",o)}),m=function(a){return t=parseFloat(a)||0},e.$watch("infiniteScrollDistance",m),m(e.infiniteScrollDistance),l=function(a){return u=!a,u&&i?(i=!1,o()):void 0},e.$watch("infiniteScrollDisabled",l),l(e.infiniteScrollDisabled),n=function(a){return w=a},e.$watch("infiniteScrollUseDocumentBottom",n),n(e.infiniteScrollUseDocumentBottom),h=function(a){return null!=j&&j.unbind("scroll",o),j=a,null!=a?j.bind("scroll",o):void 0},h(x),k=function(a){if(null!=a&&0!==a.length){if(a instanceof HTMLElement?a=angular.element(a):"function"==typeof a.append?a=angular.element(a[a.length-1]):"string"==typeof a&&(a=angular.element(document.querySelector(a))),null!=a)return h(a);throw new Exception("invalid infinite-scroll-container attribute.")}},e.$watch("infiniteScrollContainer",k),k(e.infiniteScrollContainer||[]),null!=g.infiniteScrollParent&&h(angular.element(f.parent())),null!=g.infiniteScrollImmediateCheck&&(q=e.$eval(g.infiniteScrollImmediateCheck)),c(function(){return q?o():void 0},0)}}}]);;

(function (angular, document) {

     var mod = angular.module('viewhead', []);

     mod.directive(
         'viewTitle',
         ['$rootScope', function ($rootScope) {
             return {
                 restrict: 'EA',
                 link: [ 'scope', 'iElement', 'iAttrs', 'controller', 'transcludeFn', function (scope, iElement, iAttrs, controller, transcludeFn) {
                     // If we've been inserted as an element then we detach from the DOM because the caller
                     // doesn't want us to have any visual impact in the document.
                     // Otherwise, we're piggy-backing on an existing element so we'll just leave it alone.
                     var tagName = iElement[0].tagName.toLowerCase();
                     if (tagName === 'view-title' || tagName === 'viewtitle') {
                         iElement.remove();
                     }

                     scope.$watch(
                         function () {
                             return iElement.text();
                         },
                         function (newTitle) {
                             $rootScope.viewTitle = newTitle;
                         }
                     );
                     scope.$on(
                         '$destroy',
                         function () {
                             delete $rootScope.viewTitle;
                         }
                     );
                 }]
             };
         }]
     );

     mod.directive(
         'viewHead',
         function () {
             var head = angular.element(document.head);
             return {
                 restrict: 'A',
                 link: ['scope', 'iElement', 'iAttrs', 'controller', 'transcludeFn', function (scope, iElement, iAttrs, controller, transcludeFn) {
                     // Move the element into the head of the document.
                     // Although the physical location of the document changes, the element remains
                     // bound to the scope in which it was declared, so it can refer to variables from
                     // the view scope if necessary.
                     head.append(iElement);

                     // When the scope is destroyed, remove the element.
                     // This is on the assumption that we're being used in some sort of view scope.
                     // It doesn't make sense to use this directive outside of the view, and nor does it
                     // make sense to use it inside other scope-creating directives like ng-repeat.
                     scope.$on(
                         '$destroy',
                         function () {
                             iElement.remove();
                         }
                     );
                 }]
             };
         }
     );

})(angular, document);
;
/**
 * State-based routing for AngularJS
 * @version v0.2.11
 * @link http://angular-ui.github.com/
 * @license MIT License, http://www.opensource.org/licenses/MIT
 */

/* commonjs package manager support (eg componentjs) */
if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports) {
    module.exports = 'ui.router';
}

(function (window, angular, undefined) {
    /*jshint globalstrict:true*/
    /*global angular:false*/
    'use strict';

    var isDefined = angular.isDefined,
        isFunction = angular.isFunction,
        isString = angular.isString,
        isObject = angular.isObject,
        isArray = angular.isArray,
        forEach = angular.forEach,
        extend = angular.extend,
        copy = angular.copy;

    function inherit(parent, extra) {
        return extend(new (extend(function () { }, { prototype: parent }))(), extra);
    }

    function merge(dst) {
        forEach(arguments, function (obj) {
            if (obj !== dst) {
                forEach(obj, function (value, key) {
                    if (!dst.hasOwnProperty(key)) dst[key] = value;
                });
            }
        });
        return dst;
    }

    /**
     * Finds the common ancestor path between two states.
     *
     * @param {Object} first The first state.
     * @param {Object} second The second state.
     * @return {Array} Returns an array of state names in descending order, not including the root.
     */
    function ancestors(first, second) {
        var path = [];

        for (var n in first.path) {
            if (first.path[n] !== second.path[n]) break;
            path.push(first.path[n]);
        }
        return path;
    }

    /**
     * IE8-safe wrapper for `Object.keys()`.
     *
     * @param {Object} object A JavaScript object.
     * @return {Array} Returns the keys of the object as an array.
     */
    function objectKeys(object) {
        if (Object.keys) {
            return Object.keys(object);
        }
        var result = [];

        angular.forEach(object, function (val, key) {
            result.push(key);
        });
        return result;
    }

    /**
     * IE8-safe wrapper for `Array.prototype.indexOf()`.
     *
     * @param {Array} array A JavaScript array.
     * @param {*} value A value to search the array for.
     * @return {Number} Returns the array index value of `value`, or `-1` if not present.
     */
    function arraySearch(array, value) {
        if (Array.prototype.indexOf) {
            return array.indexOf(value, Number(arguments[2]) || 0);
        }
        var len = array.length >>> 0, from = Number(arguments[2]) || 0;
        from = (from < 0) ? Math.ceil(from) : Math.floor(from);

        if (from < 0) from += len;

        for (; from < len; from++) {
            if (from in array && array[from] === value) return from;
        }
        return -1;
    }

    /**
     * Merges a set of parameters with all parameters inherited between the common parents of the
     * current state and a given destination state.
     *
     * @param {Object} currentParams The value of the current state parameters ($stateParams).
     * @param {Object} newParams The set of parameters which will be composited with inherited params.
     * @param {Object} $current Internal definition of object representing the current state.
     * @param {Object} $to Internal definition of object representing state to transition to.
     */
    function inheritParams(currentParams, newParams, $current, $to) {
        var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = [];

        for (var i in parents) {
            if (!parents[i].params) continue;
            parentParams = objectKeys(parents[i].params);
            if (!parentParams.length) continue;

            for (var j in parentParams) {
                if (arraySearch(inheritList, parentParams[j]) >= 0) continue;
                inheritList.push(parentParams[j]);
                inherited[parentParams[j]] = currentParams[parentParams[j]];
            }
        }
        return extend({}, inherited, newParams);
    }

    /**
     * Performs a non-strict comparison of the subset of two objects, defined by a list of keys.
     *
     * @param {Object} a The first object.
     * @param {Object} b The second object.
     * @param {Array} keys The list of keys within each object to compare. If the list is empty or not specified,
     *                     it defaults to the list of keys in `a`.
     * @return {Boolean} Returns `true` if the keys match, otherwise `false`.
     */
    function equalForKeys(a, b, keys) {
        if (!keys) {
            keys = [];
            for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility
        }

        for (var i = 0; i < keys.length; i++) {
            var k = keys[i];
            if (a[k] != b[k]) return false; // Not '===', values aren't necessarily normalized
        }
        return true;
    }

    /**
     * Returns the subset of an object, based on a list of keys.
     *
     * @param {Array} keys
     * @param {Object} values
     * @return {Boolean} Returns a subset of `values`.
     */
    function filterByKeys(keys, values) {
        var filtered = {};

        forEach(keys, function (name) {
            filtered[name] = values[name];
        });
        return filtered;
    }
    /**
     * @ngdoc overview
     * @name ui.router.util
     *
     * @description
     * # ui.router.util sub-module
     *
     * This module is a dependency of other sub-modules. Do not include this module as a dependency
     * in your angular app (use {@link ui.router} module instead).
     *
     */
    angular.module('ui.router.util', ['ng']);

    /**
     * @ngdoc overview
     * @name ui.router.router
     * 
     * @requires ui.router.util
     *
     * @description
     * # ui.router.router sub-module
     *
     * This module is a dependency of other sub-modules. Do not include this module as a dependency
     * in your angular app (use {@link ui.router} module instead).
     */
    angular.module('ui.router.router', ['ui.router.util']);

    /**
     * @ngdoc overview
     * @name ui.router.state
     * 
     * @requires ui.router.router
     * @requires ui.router.util
     *
     * @description
     * # ui.router.state sub-module
     *
     * This module is a dependency of the main ui.router module. Do not include this module as a dependency
     * in your angular app (use {@link ui.router} module instead).
     * 
     */
    angular.module('ui.router.state', ['ui.router.router', 'ui.router.util']);

    /**
     * @ngdoc overview
     * @name ui.router
     *
     * @requires ui.router.state
     *
     * @description
     * # ui.router
     * 
     * ## The main module for ui.router 
     * There are several sub-modules included with the ui.router module, however only this module is needed
     * as a dependency within your angular app. The other modules are for organization purposes. 
     *
     * The modules are:
     * * ui.router - the main "umbrella" module
     * * ui.router.router - 
     * 
     * *You'll need to include **only** this module as the dependency within your angular app.*
     * 
     * <pre>
     * <!doctype html>
     * <html ng-app="myApp">
     * <head>
     *   <script src="js/angular.js"></script>
     *   <!-- Include the ui-router script -->
     *   <script src="js/angular-ui-router.min.js"></script>
     *   <script>
     *     // ...and add 'ui.router' as a dependency
     *     var myApp = angular.module('myApp', ['ui.router']);
     *   </script>
     * </head>
     * <body>
     * </body>
     * </html>
     * </pre>
     */
    angular.module('ui.router', ['ui.router.state']);

    angular.module('ui.router.compat', ['ui.router']);

    /**
     * @ngdoc object
     * @name ui.router.util.$resolve
     *
     * @requires $q
     * @requires $injector
     *
     * @description
     * Manages resolution of (acyclic) graphs of promises.
     */
    $Resolve.$inject = ['$q', '$injector'];
    function $Resolve($q, $injector) {

        var VISIT_IN_PROGRESS = 1,
            VISIT_DONE = 2,
            NOTHING = {},
            NO_DEPENDENCIES = [],
            NO_LOCALS = NOTHING,
            NO_PARENT = extend($q.when(NOTHING), { $$promises: NOTHING, $$values: NOTHING });


        /**
         * @ngdoc function
         * @name ui.router.util.$resolve#study
         * @methodOf ui.router.util.$resolve
         *
         * @description
         * Studies a set of invocables that are likely to be used multiple times.
         * <pre>
         * $resolve.study(invocables)(locals, parent, self)
         * </pre>
         * is equivalent to
         * <pre>
         * $resolve.resolve(invocables, locals, parent, self)
         * </pre>
         * but the former is more efficient (in fact `resolve` just calls `study` 
         * internally).
         *
         * @param {object} invocables Invocable objects
         * @return {function} a function to pass in locals, parent and self
         */
        this.study = function (invocables) {
            if (!isObject(invocables)) throw new Error("'invocables' must be an object");

            // Perform a topological sort of invocables to build an ordered plan
            var plan = [], cycle = [], visited = {};
            function visit(value, key) {
                if (visited[key] === VISIT_DONE) return;

                cycle.push(key);
                if (visited[key] === VISIT_IN_PROGRESS) {
                    cycle.splice(0, cycle.indexOf(key));
                    throw new Error("Cyclic dependency: " + cycle.join(" -> "));
                }
                visited[key] = VISIT_IN_PROGRESS;

                if (isString(value)) {
                    plan.push(key, [function () { return $injector.get(value); }], NO_DEPENDENCIES);
                } else {
                    var params = $injector.annotate(value);
                    forEach(params, function (param) {
                        if (param !== key && invocables.hasOwnProperty(param)) visit(invocables[param], param);
                    });
                    plan.push(key, value, params);
                }

                cycle.pop();
                visited[key] = VISIT_DONE;
            }
            forEach(invocables, visit);
            invocables = cycle = visited = null; // plan is all that's required

            function isResolve(value) {
                return isObject(value) && value.then && value.$$promises;
            }

            return function (locals, parent, self) {
                if (isResolve(locals) && self === undefined) {
                    self = parent; parent = locals; locals = null;
                }
                if (!locals) locals = NO_LOCALS;
                else if (!isObject(locals)) {
                    throw new Error("'locals' must be an object");
                }
                if (!parent) parent = NO_PARENT;
                else if (!isResolve(parent)) {
                    throw new Error("'parent' must be a promise returned by $resolve.resolve()");
                }

                // To complete the overall resolution, we have to wait for the parent
                // promise and for the promise for each invokable in our plan.
                var resolution = $q.defer(),
                    result = resolution.promise,
                    promises = result.$$promises = {},
                    values = extend({}, locals),
                    wait = 1 + plan.length / 3,
                    merged = false;

                function done() {
                    // Merge parent values we haven't got yet and publish our own $$values
                    if (!--wait) {
                        if (!merged) merge(values, parent.$$values);
                        result.$$values = values;
                        result.$$promises = true; // keep for isResolve()
                        delete result.$$inheritedValues;
                        resolution.resolve(values);
                    }
                }

                function fail(reason) {
                    result.$$failure = reason;
                    resolution.reject(reason);
                }

                // Short-circuit if parent has already failed
                if (isDefined(parent.$$failure)) {
                    fail(parent.$$failure);
                    return result;
                }

                if (parent.$$inheritedValues) {
                    merge(values, parent.$$inheritedValues);
                }

                // Merge parent values if the parent has already resolved, or merge
                // parent promises and wait if the parent resolve is still in progress.
                if (parent.$$values) {
                    merged = merge(values, parent.$$values);
                    result.$$inheritedValues = parent.$$values;
                    done();
                } else {
                    if (parent.$$inheritedValues) {
                        result.$$inheritedValues = parent.$$inheritedValues;
                    }
                    extend(promises, parent.$$promises);
                    parent.then(done, fail);
                }

                // Process each invocable in the plan, but ignore any where a local of the same name exists.
                for (var i = 0, ii = plan.length; i < ii; i += 3) {
                    if (locals.hasOwnProperty(plan[i])) done();
                    else invoke(plan[i], plan[i + 1], plan[i + 2]);
                }

                function invoke(key, invocable, params) {
                    // Create a deferred for this invocation. Failures will propagate to the resolution as well.
                    var invocation = $q.defer(), waitParams = 0;
                    function onfailure(reason) {
                        invocation.reject(reason);
                        fail(reason);
                    }
                    // Wait for any parameter that we have a promise for (either from parent or from this
                    // resolve; in that case study() will have made sure it's ordered before us in the plan).
                    forEach(params, function (dep) {
                        if (promises.hasOwnProperty(dep) && !locals.hasOwnProperty(dep)) {
                            waitParams++;
                            promises[dep].then(function (result) {
                                values[dep] = result;
                                if (!(--waitParams)) proceed();
                            }, onfailure);
                        }
                    });
                    if (!waitParams) proceed();
                    function proceed() {
                        if (isDefined(result.$$failure)) return;
                        try {
                            invocation.resolve($injector.invoke(invocable, self, values));
                            invocation.promise.then(function (result) {
                                values[key] = result;
                                done();
                            }, onfailure);
                        } catch (e) {
                            onfailure(e);
                        }
                    }
                    // Publish promise synchronously; invocations further down in the plan may depend on it.
                    promises[key] = invocation.promise;
                }

                return result;
            };
        };

        /**
         * @ngdoc function
         * @name ui.router.util.$resolve#resolve
         * @methodOf ui.router.util.$resolve
         *
         * @description
         * Resolves a set of invocables. An invocable is a function to be invoked via 
         * `$injector.invoke()`, and can have an arbitrary number of dependencies. 
         * An invocable can either return a value directly,
         * or a `$q` promise. If a promise is returned it will be resolved and the 
         * resulting value will be used instead. Dependencies of invocables are resolved 
         * (in this order of precedence)
         *
         * - from the specified `locals`
         * - from another invocable that is part of this `$resolve` call
         * - from an invocable that is inherited from a `parent` call to `$resolve` 
         *   (or recursively
         * - from any ancestor `$resolve` of that parent).
         *
         * The return value of `$resolve` is a promise for an object that contains 
         * (in this order of precedence)
         *
         * - any `locals` (if specified)
         * - the resolved return values of all injectables
         * - any values inherited from a `parent` call to `$resolve` (if specified)
         *
         * The promise will resolve after the `parent` promise (if any) and all promises 
         * returned by injectables have been resolved. If any invocable 
         * (or `$injector.invoke`) throws an exception, or if a promise returned by an 
         * invocable is rejected, the `$resolve` promise is immediately rejected with the 
         * same error. A rejection of a `parent` promise (if specified) will likewise be 
         * propagated immediately. Once the `$resolve` promise has been rejected, no 
         * further invocables will be called.
         * 
         * Cyclic dependencies between invocables are not permitted and will caues `$resolve`
         * to throw an error. As a special case, an injectable can depend on a parameter 
         * with the same name as the injectable, which will be fulfilled from the `parent` 
         * injectable of the same name. This allows inherited values to be decorated. 
         * Note that in this case any other injectable in the same `$resolve` with the same
         * dependency would see the decorated value, not the inherited value.
         *
         * Note that missing dependencies -- unlike cyclic dependencies -- will cause an 
         * (asynchronous) rejection of the `$resolve` promise rather than a (synchronous) 
         * exception.
         *
         * Invocables are invoked eagerly as soon as all dependencies are available. 
         * This is true even for dependencies inherited from a `parent` call to `$resolve`.
         *
         * As a special case, an invocable can be a string, in which case it is taken to 
         * be a service name to be passed to `$injector.get()`. This is supported primarily 
         * for backwards-compatibility with the `resolve` property of `$routeProvider` 
         * routes.
         *
         * @param {object} invocables functions to invoke or 
         * `$injector` services to fetch.
         * @param {object} locals  values to make available to the injectables
         * @param {object} parent  a promise returned by another call to `$resolve`.
         * @param {object} self  the `this` for the invoked methods
         * @return {object} Promise for an object that contains the resolved return value
         * of all invocables, as well as any inherited and local values.
         */
        this.resolve = function (invocables, locals, parent, self) {
            return this.study(invocables)(locals, parent, self);
        };
    }

    angular.module('ui.router.util').service('$resolve', $Resolve);


    /**
     * @ngdoc object
     * @name ui.router.util.$templateFactory
     *
     * @requires $http
     * @requires $templateCache
     * @requires $injector
     *
     * @description
     * Service. Manages loading of templates.
     */
    $TemplateFactory.$inject = ['$http', '$templateCache', '$injector'];
    function $TemplateFactory($http, $templateCache, $injector) {

        /**
         * @ngdoc function
         * @name ui.router.util.$templateFactory#fromConfig
         * @methodOf ui.router.util.$templateFactory
         *
         * @description
         * Creates a template from a configuration object. 
         *
         * @param {object} config Configuration object for which to load a template. 
         * The following properties are search in the specified order, and the first one 
         * that is defined is used to create the template:
         *
         * @param {string|object} config.template html string template or function to 
         * load via {@link ui.router.util.$templateFactory#fromString fromString}.
         * @param {string|object} config.templateUrl url to load or a function returning 
         * the url to load via {@link ui.router.util.$templateFactory#fromUrl fromUrl}.
         * @param {Function} config.templateProvider function to invoke via 
         * {@link ui.router.util.$templateFactory#fromProvider fromProvider}.
         * @param {object} params  Parameters to pass to the template function.
         * @param {object} locals Locals to pass to `invoke` if the template is loaded 
         * via a `templateProvider`. Defaults to `{ params: params }`.
         *
         * @return {string|object}  The template html as a string, or a promise for 
         * that string,or `null` if no template is configured.
         */
        this.fromConfig = function (config, params, locals) {
            return (
              isDefined(config.template) ? this.fromString(config.template, params) :
              isDefined(config.templateUrl) ? this.fromUrl(config.templateUrl, params) :
              isDefined(config.templateProvider) ? this.fromProvider(config.templateProvider, params, locals) :
              null
            );
        };

        /**
         * @ngdoc function
         * @name ui.router.util.$templateFactory#fromString
         * @methodOf ui.router.util.$templateFactory
         *
         * @description
         * Creates a template from a string or a function returning a string.
         *
         * @param {string|object} template html template as a string or function that 
         * returns an html template as a string.
         * @param {object} params Parameters to pass to the template function.
         *
         * @return {string|object} The template html as a string, or a promise for that 
         * string.
         */
        this.fromString = function (template, params) {
            return isFunction(template) ? template(params) : template;
        };

        /**
         * @ngdoc function
         * @name ui.router.util.$templateFactory#fromUrl
         * @methodOf ui.router.util.$templateFactory
         * 
         * @description
         * Loads a template from the a URL via `$http` and `$templateCache`.
         *
         * @param {string|Function} url url of the template to load, or a function 
         * that returns a url.
         * @param {Object} params Parameters to pass to the url function.
         * @return {string|Promise.<string>} The template html as a string, or a promise 
         * for that string.
         */
        this.fromUrl = function (url, params) {
            if (isFunction(url)) url = url(params);
            if (url == null) return null;
            else return $http
                .get(url, { cache: $templateCache })
                .then(function (response) { return response.data; });
        };

        /**
         * @ngdoc function
         * @name ui.router.util.$templateFactory#fromProvider
         * @methodOf ui.router.util.$templateFactory
         *
         * @description
         * Creates a template by invoking an injectable provider function.
         *
         * @param {Function} provider Function to invoke via `$injector.invoke`
         * @param {Object} params Parameters for the template.
         * @param {Object} locals Locals to pass to `invoke`. Defaults to 
         * `{ params: params }`.
         * @return {string|Promise.<string>} The template html as a string, or a promise 
         * for that string.
         */
        this.fromProvider = function (provider, params, locals) {
            return $injector.invoke(provider, null, locals || { params: params });
        };
    }

    angular.module('ui.router.util').service('$templateFactory', $TemplateFactory);

    /**
     * @ngdoc object
     * @name ui.router.util.type:UrlMatcher
     *
     * @description
     * Matches URLs against patterns and extracts named parameters from the path or the search
     * part of the URL. A URL pattern consists of a path pattern, optionally followed by '?' and a list
     * of search parameters. Multiple search parameter names are separated by '&'. Search parameters
     * do not influence whether or not a URL is matched, but their values are passed through into
     * the matched parameters returned by {@link ui.router.util.type:UrlMatcher#methods_exec exec}.
     * 
     * Path parameter placeholders can be specified using simple colon/catch-all syntax or curly brace
     * syntax, which optionally allows a regular expression for the parameter to be specified:
     *
     * * `':'` name - colon placeholder
     * * `'*'` name - catch-all placeholder
     * * `'{' name '}'` - curly placeholder
     * * `'{' name ':' regexp '}'` - curly placeholder with regexp. Should the regexp itself contain
     *   curly braces, they must be in matched pairs or escaped with a backslash.
     *
     * Parameter names may contain only word characters (latin letters, digits, and underscore) and
     * must be unique within the pattern (across both path and search parameters). For colon 
     * placeholders or curly placeholders without an explicit regexp, a path parameter matches any
     * number of characters other than '/'. For catch-all placeholders the path parameter matches
     * any number of characters.
     * 
     * Examples:
     * 
     * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for
     *   trailing slashes, and patterns have to match the entire path, not just a prefix.
     * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or
     *   '/user/bob/details'. The second path segment will be captured as the parameter 'id'.
     * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax.
     * * `'/user/{id:[^/]*}'` - Same as the previous example.
     * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id
     *   parameter consists of 1 to 8 hex digits.
     * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the
     *   path into the parameter 'path'.
     * * `'/files/*path'` - ditto.
     *
     * @param {string} pattern  The pattern to compile into a matcher.
     * @param {Object} config  A configuration object hash:
     *
     * * `caseInsensitive` - `true` if URL matching should be case insensitive, otherwise `false`, the default value (for backward compatibility) is `false`.
     * * `strict` - `false` if matching against a URL with a trailing slash should be treated as equivalent to a URL without a trailing slash, the default value is `true`.
     *
     * @property {string} prefix  A static prefix of this pattern. The matcher guarantees that any
     *   URL matching this matcher (i.e. any string for which {@link ui.router.util.type:UrlMatcher#methods_exec exec()} returns
     *   non-null) will start with this prefix.
     *
     * @property {string} source  The pattern that was passed into the constructor
     *
     * @property {string} sourcePath  The path portion of the source property
     *
     * @property {string} sourceSearch  The search portion of the source property
     *
     * @property {string} regex  The constructed regex that will be used to match against the url when 
     *   it is time to determine which url will match.
     *
     * @returns {Object}  New `UrlMatcher` object
     */
    function UrlMatcher(pattern, config) {
        config = angular.isObject(config) ? config : {};

        // Find all placeholders and create a compiled pattern, using either classic or curly syntax:
        //   '*' name
        //   ':' name
        //   '{' name '}'
        //   '{' name ':' regexp '}'
        // The regular expression is somewhat complicated due to the need to allow curly braces
        // inside the regular expression. The placeholder regexp breaks down as follows:
        //    ([:*])(\w+)               classic placeholder ($1 / $2)
        //    \{(\w+)(?:\:( ... ))?\}   curly brace placeholder ($3) with optional regexp ... ($4)
        //    (?: ... | ... | ... )+    the regexp consists of any number of atoms, an atom being either
        //    [^{}\\]+                  - anything other than curly braces or backslash
        //    \\.                       - a backslash escape
        //    \{(?:[^{}\\]+|\\.)*\}     - a matched set of curly braces containing other atoms
        var placeholder = /([:*])(\w+)|\{(\w+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,
            compiled = '^', last = 0, m,
            segments = this.segments = [],
            params = this.params = {};

        /**
         * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the
         * default value, which may be the result of an injectable function.
         */
        function $value(value) {
            /*jshint validthis: true */
            return isDefined(value) ? this.type.decode(value) : $UrlMatcherFactory.$$getDefaultValue(this);
        }

        function addParameter(id, type, config) {
            if (!/^\w+(-+\w+)*$/.test(id)) throw new Error("Invalid parameter name '" + id + "' in pattern '" + pattern + "'");
            if (params[id]) throw new Error("Duplicate parameter name '" + id + "' in pattern '" + pattern + "'");
            params[id] = extend({ type: type || new Type(), $value: $value }, config);
        }

        function quoteRegExp(string, pattern, isOptional) {
            var result = string.replace(/[\\\[\]\^$*+?.()|{}]/g, "\\$&");
            if (!pattern) return result;
            var flag = isOptional ? '?' : '';
            return result + flag + '(' + pattern + ')' + flag;
        }

        function paramConfig(param) {
            if (!config.params || !config.params[param]) return {};
            var cfg = config.params[param];
            return isObject(cfg) ? cfg : { value: cfg };
        }

        this.source = pattern;

        // Split into static segments separated by path parameter placeholders.
        // The number of segments is always 1 more than the number of parameters.
        var id, regexp, segment, type, cfg;

        while ((m = placeholder.exec(pattern))) {
            id = m[2] || m[3]; // IE[78] returns '' for unmatched groups instead of null
            regexp = m[4] || (m[1] == '*' ? '.*' : '[^/]*');
            segment = pattern.substring(last, m.index);
            type = this.$types[regexp] || new Type({ pattern: new RegExp(regexp) });
            cfg = paramConfig(id);

            if (segment.indexOf('?') >= 0) break; // we're into the search part

            compiled += quoteRegExp(segment, type.$subPattern(), isDefined(cfg.value));
            addParameter(id, type, cfg);
            segments.push(segment);
            last = placeholder.lastIndex;
        }
        segment = pattern.substring(last);

        // Find any search parameter names and remove them from the last segment
        var i = segment.indexOf('?');

        if (i >= 0) {
            var search = this.sourceSearch = segment.substring(i);
            segment = segment.substring(0, i);
            this.sourcePath = pattern.substring(0, last + i);

            // Allow parameters to be separated by '?' as well as '&' to make concat() easier
            forEach(search.substring(1).split(/[&?]/), function (key) {
                addParameter(key, null, paramConfig(key));
            });
        } else {
            this.sourcePath = pattern;
            this.sourceSearch = '';
        }

        compiled += quoteRegExp(segment) + (config.strict === false ? '\/?' : '') + '$';
        segments.push(segment);

        this.regexp = new RegExp(compiled, config.caseInsensitive ? 'i' : undefined);
        this.prefix = segments[0];
    }

    /**
     * @ngdoc function
     * @name ui.router.util.type:UrlMatcher#concat
     * @methodOf ui.router.util.type:UrlMatcher
     *
     * @description
     * Returns a new matcher for a pattern constructed by appending the path part and adding the
     * search parameters of the specified pattern to this pattern. The current pattern is not
     * modified. This can be understood as creating a pattern for URLs that are relative to (or
     * suffixes of) the current pattern.
     *
     * @example
     * The following two matchers are equivalent:
     * <pre>
     * new UrlMatcher('/user/{id}?q').concat('/details?date');
     * new UrlMatcher('/user/{id}/details?q&date');
     * </pre>
     *
     * @param {string} pattern  The pattern to append.
     * @param {Object} config  An object hash of the configuration for the matcher.
     * @returns {UrlMatcher}  A matcher for the concatenated pattern.
     */
    UrlMatcher.prototype.concat = function (pattern, config) {
        // Because order of search parameters is irrelevant, we can add our own search
        // parameters to the end of the new pattern. Parse the new pattern by itself
        // and then join the bits together, but it's much easier to do this on a string level.
        return new UrlMatcher(this.sourcePath + pattern + this.sourceSearch, config);
    };

    UrlMatcher.prototype.toString = function () {
        return this.source;
    };

    /**
     * @ngdoc function
     * @name ui.router.util.type:UrlMatcher#exec
     * @methodOf ui.router.util.type:UrlMatcher
     *
     * @description
     * Tests the specified path against this matcher, and returns an object containing the captured
     * parameter values, or null if the path does not match. The returned object contains the values
     * of any search parameters that are mentioned in the pattern, but their value may be null if
     * they are not present in `searchParams`. This means that search parameters are always treated
     * as optional.
     *
     * @example
     * <pre>
     * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {
     *   x: '1', q: 'hello'
     * });
     * // returns { id: 'bob', q: 'hello', r: null }
     * </pre>
     *
     * @param {string} path  The URL path to match, e.g. `$location.path()`.
     * @param {Object} searchParams  URL search parameters, e.g. `$location.search()`.
     * @returns {Object}  The captured parameter values.
     */
    UrlMatcher.prototype.exec = function (path, searchParams) {
        var m = this.regexp.exec(path);
        if (!m) return null;
        searchParams = searchParams || {};

        var params = this.parameters(), nTotal = params.length,
          nPath = this.segments.length - 1,
          values = {}, i, cfg, param;

        if (nPath !== m.length - 1) throw new Error("Unbalanced capture group in route '" + this.source + "'");

        for (i = 0; i < nPath; i++) {
            param = params[i];
            cfg = this.params[param];
            values[param] = cfg.$value(m[i + 1]);
        }
        for (/**/; i < nTotal; i++) {
            param = params[i];
            cfg = this.params[param];
            values[param] = cfg.$value(searchParams[param]);
        }

        return values;
    };

    /**
     * @ngdoc function
     * @name ui.router.util.type:UrlMatcher#parameters
     * @methodOf ui.router.util.type:UrlMatcher
     *
     * @description
     * Returns the names of all path and search parameters of this pattern in an unspecified order.
     * 
     * @returns {Array.<string>}  An array of parameter names. Must be treated as read-only. If the
     *    pattern has no parameters, an empty array is returned.
     */
    UrlMatcher.prototype.parameters = function (param) {
        if (!isDefined(param)) return objectKeys(this.params);
        return this.params[param] || null;
    };

    /**
     * @ngdoc function
     * @name ui.router.util.type:UrlMatcher#validate
     * @methodOf ui.router.util.type:UrlMatcher
     *
     * @description
     * Checks an object hash of parameters to validate their correctness according to the parameter
     * types of this `UrlMatcher`.
     *
     * @param {Object} params The object hash of parameters to validate.
     * @returns {boolean} Returns `true` if `params` validates, otherwise `false`.
     */
    UrlMatcher.prototype.validates = function (params) {
        var result = true, isOptional, cfg, self = this;

        forEach(params, function (val, key) {
            if (!self.params[key]) return;
            cfg = self.params[key];
            isOptional = !val && isDefined(cfg.value);
            result = result && (isOptional || cfg.type.is(val));
        });
        return result;
    };

    /**
     * @ngdoc function
     * @name ui.router.util.type:UrlMatcher#format
     * @methodOf ui.router.util.type:UrlMatcher
     *
     * @description
     * Creates a URL that matches this pattern by substituting the specified values
     * for the path and search parameters. Null values for path parameters are
     * treated as empty strings.
     *
     * @example
     * <pre>
     * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });
     * // returns '/user/bob?q=yes'
     * </pre>
     *
     * @param {Object} values  the values to substitute for the parameters in this pattern.
     * @returns {string}  the formatted URL (path and optionally search part).
     */
    UrlMatcher.prototype.format = function (values) {
        var segments = this.segments, params = this.parameters();

        if (!values) return segments.join('').replace('//', '/');

        var nPath = segments.length - 1, nTotal = params.length,
          result = segments[0], i, search, value, param, cfg, array;

        if (!this.validates(values)) return null;

        for (i = 0; i < nPath; i++) {
            param = params[i];
            value = values[param];
            cfg = this.params[param];

            if (!isDefined(value) && (segments[i] === '/' || segments[i + 1] === '/')) continue;
            if (value != null) result += encodeURIComponent(cfg.type.encode(value));
            result += segments[i + 1];
        }

        for (/**/; i < nTotal; i++) {
            param = params[i];
            value = values[param];
            if (value == null) continue;
            array = isArray(value);

            if (array) {
                value = value.map(encodeURIComponent).join('&' + param + '=');
            }
            result += (search ? '&' : '?') + param + '=' + (array ? value : encodeURIComponent(value));
            search = true;
        }
        return result;
    };

    UrlMatcher.prototype.$types = {};

    /**
     * @ngdoc object
     * @name ui.router.util.type:Type
     *
     * @description
     * Implements an interface to define custom parameter types that can be decoded from and encoded to
     * string parameters matched in a URL. Used by {@link ui.router.util.type:UrlMatcher `UrlMatcher`}
     * objects when matching or formatting URLs, or comparing or validating parameter values.
     *
     * See {@link ui.router.util.$urlMatcherFactory#methods_type `$urlMatcherFactory#type()`} for more
     * information on registering custom types.
     *
     * @param {Object} config  A configuration object hash that includes any method in `Type`'s public
     *        interface, and/or `pattern`, which should contain a custom regular expression used to match
     *        string parameters originating from a URL.
     *
     * @property {RegExp} pattern The regular expression pattern used to match values of this type when
     *           coming from a substring of a URL.
     *
     * @returns {Object}  Returns a new `Type` object.
     */
    function Type(config) {
        extend(this, config);
    }

    /**
     * @ngdoc function
     * @name ui.router.util.type:Type#is
     * @methodOf ui.router.util.type:Type
     *
     * @description
     * Detects whether a value is of a particular type. Accepts a native (decoded) value
     * and determines whether it matches the current `Type` object.
     *
     * @param {*} val  The value to check.
     * @param {string} key  Optional. If the type check is happening in the context of a specific
     *        {@link ui.router.util.type:UrlMatcher `UrlMatcher`} object, this is the name of the
     *        parameter in which `val` is stored. Can be used for meta-programming of `Type` objects.
     * @returns {Boolean}  Returns `true` if the value matches the type, otherwise `false`.
     */
    Type.prototype.is = function (val, key) {
        return true;
    };

    /**
     * @ngdoc function
     * @name ui.router.util.type:Type#encode
     * @methodOf ui.router.util.type:Type
     *
     * @description
     * Encodes a custom/native type value to a string that can be embedded in a URL. Note that the
     * return value does *not* need to be URL-safe (i.e. passed through `encodeURIComponent()`), it
     * only needs to be a representation of `val` that has been coerced to a string.
     *
     * @param {*} val  The value to encode.
     * @param {string} key  The name of the parameter in which `val` is stored. Can be used for
     *        meta-programming of `Type` objects.
     * @returns {string}  Returns a string representation of `val` that can be encoded in a URL.
     */
    Type.prototype.encode = function (val, key) {
        return val;
    };

    /**
     * @ngdoc function
     * @name ui.router.util.type:Type#decode
     * @methodOf ui.router.util.type:Type
     *
     * @description
     * Converts a string URL parameter value to a custom/native value.
     *
     * @param {string} val  The URL parameter value to decode.
     * @param {string} key  The name of the parameter in which `val` is stored. Can be used for
     *        meta-programming of `Type` objects.
     * @returns {*}  Returns a custom representation of the URL parameter value.
     */
    Type.prototype.decode = function (val, key) {
        return val;
    };

    /**
     * @ngdoc function
     * @name ui.router.util.type:Type#equals
     * @methodOf ui.router.util.type:Type
     *
     * @description
     * Determines whether two decoded values are equivalent.
     *
     * @param {*} a  A value to compare against.
     * @param {*} b  A value to compare against.
     * @returns {Boolean}  Returns `true` if the values are equivalent/equal, otherwise `false`.
     */
    Type.prototype.equals = function (a, b) {
        return a == b;
    };

    Type.prototype.$subPattern = function () {
        var sub = this.pattern.toString();
        return sub.substr(1, sub.length - 2);
    };

    Type.prototype.pattern = /.*/;

    /**
     * @ngdoc object
     * @name ui.router.util.$urlMatcherFactory
     *
     * @description
     * Factory for {@link ui.router.util.type:UrlMatcher `UrlMatcher`} instances. The factory
     * is also available to providers under the name `$urlMatcherFactoryProvider`.
     */
    function $UrlMatcherFactory() {

        var isCaseInsensitive = false, isStrictMode = true;

        var enqueue = true, typeQueue = [], injector, defaultTypes = {
            int: {
                decode: function (val) {
                    return parseInt(val, 10);
                },
                is: function (val) {
                    if (!isDefined(val)) return false;
                    return this.decode(val.toString()) === val;
                },
                pattern: /\d+/
            },
            bool: {
                encode: function (val) {
                    return val ? 1 : 0;
                },
                decode: function (val) {
                    return parseInt(val, 10) === 0 ? false : true;
                },
                is: function (val) {
                    return val === true || val === false;
                },
                pattern: /0|1/
            },
            string: {
                pattern: /[^\/]*/
            },
            date: {
                equals: function (a, b) {
                    return a.toISOString() === b.toISOString();
                },
                decode: function (val) {
                    return new Date(val);
                },
                encode: function (val) {
                    return [
                      val.getFullYear(),
                      ('0' + (val.getMonth() + 1)).slice(-2),
                      ('0' + val.getDate()).slice(-2)
                    ].join("-");
                },
                pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/
            }
        };

        function getDefaultConfig() {
            return {
                strict: isStrictMode,
                caseInsensitive: isCaseInsensitive
            };
        }

        function isInjectable(value) {
            return (isFunction(value) || (isArray(value) && isFunction(value[value.length - 1])));
        }

        /**
         * [Internal] Get the default value of a parameter, which may be an injectable function.
         */
        $UrlMatcherFactory.$$getDefaultValue = function (config) {
            if (!isInjectable(config.value)) return config.value;
            if (!injector) throw new Error("Injectable functions cannot be called at configuration time");
            return injector.invoke(config.value);
        };

        /**
         * @ngdoc function
         * @name ui.router.util.$urlMatcherFactory#caseInsensitive
         * @methodOf ui.router.util.$urlMatcherFactory
         *
         * @description
         * Defines whether URL matching should be case sensitive (the default behavior), or not.
         *
         * @param {boolean} value `false` to match URL in a case sensitive manner; otherwise `true`;
         */
        this.caseInsensitive = function (value) {
            isCaseInsensitive = value;
        };

        /**
         * @ngdoc function
         * @name ui.router.util.$urlMatcherFactory#strictMode
         * @methodOf ui.router.util.$urlMatcherFactory
         *
         * @description
         * Defines whether URLs should match trailing slashes, or not (the default behavior).
         *
         * @param {boolean} value `false` to match trailing slashes in URLs, otherwise `true`.
         */
        this.strictMode = function (value) {
            isStrictMode = value;
        };

        /**
         * @ngdoc function
         * @name ui.router.util.$urlMatcherFactory#compile
         * @methodOf ui.router.util.$urlMatcherFactory
         *
         * @description
         * Creates a {@link ui.router.util.type:UrlMatcher `UrlMatcher`} for the specified pattern.
         *   
         * @param {string} pattern  The URL pattern.
         * @param {Object} config  The config object hash.
         * @returns {UrlMatcher}  The UrlMatcher.
         */
        this.compile = function (pattern, config) {
            return new UrlMatcher(pattern, extend(getDefaultConfig(), config));
        };

        /**
         * @ngdoc function
         * @name ui.router.util.$urlMatcherFactory#isMatcher
         * @methodOf ui.router.util.$urlMatcherFactory
         *
         * @description
         * Returns true if the specified object is a `UrlMatcher`, or false otherwise.
         *
         * @param {Object} object  The object to perform the type check against.
         * @returns {Boolean}  Returns `true` if the object matches the `UrlMatcher` interface, by
         *          implementing all the same methods.
         */
        this.isMatcher = function (o) {
            if (!isObject(o)) return false;
            var result = true;

            forEach(UrlMatcher.prototype, function (val, name) {
                if (isFunction(val)) {
                    result = result && (isDefined(o[name]) && isFunction(o[name]));
                }
            });
            return result;
        };

        /**
         * @ngdoc function
         * @name ui.router.util.$urlMatcherFactory#type
         * @methodOf ui.router.util.$urlMatcherFactory
         *
         * @description
         * Registers a custom {@link ui.router.util.type:Type `Type`} object that can be used to
         * generate URLs with typed parameters.
         *
         * @param {string} name  The type name.
         * @param {Object|Function} def  The type definition. See
         *        {@link ui.router.util.type:Type `Type`} for information on the values accepted.
         *
         * @returns {Object}  Returns `$urlMatcherFactoryProvider`.
         *
         * @example
         * This is a simple example of a custom type that encodes and decodes items from an
         * array, using the array index as the URL-encoded value:
         *
         * <pre>
         * var list = ['John', 'Paul', 'George', 'Ringo'];
         *
         * $urlMatcherFactoryProvider.type('listItem', {
         *   encode: function(item) {
         *     // Represent the list item in the URL using its corresponding index
         *     return list.indexOf(item);
         *   },
         *   decode: function(item) {
         *     // Look up the list item by index
         *     return list[parseInt(item, 10)];
         *   },
         *   is: function(item) {
         *     // Ensure the item is valid by checking to see that it appears
         *     // in the list
         *     return list.indexOf(item) > -1;
         *   }
         * });
         *
         * $stateProvider.state('list', {
         *   url: "/list/{item:listItem}",
         *   controller: function($scope, $stateParams) {
         *     console.log($stateParams.item);
         *   }
         * });
         *
         * // ...
         *
         * // Changes URL to '/list/3', logs "Ringo" to the console
         * $state.go('list', { item: "Ringo" });
         * </pre>
         *
         * This is a more complex example of a type that relies on dependency injection to
         * interact with services, and uses the parameter name from the URL to infer how to
         * handle encoding and decoding parameter values:
         *
         * <pre>
         * // Defines a custom type that gets a value from a service,
         * // where each service gets different types of values from
         * // a backend API:
         * $urlMatcherFactoryProvider.type('dbObject', function(Users, Posts) {
         *
         *   // Matches up services to URL parameter names
         *   var services = {
         *     user: Users,
         *     post: Posts
         *   };
         *
         *   return {
         *     encode: function(object) {
         *       // Represent the object in the URL using its unique ID
         *       return object.id;
         *     },
         *     decode: function(value, key) {
         *       // Look up the object by ID, using the parameter
         *       // name (key) to call the correct service
         *       return services[key].findById(value);
         *     },
         *     is: function(object, key) {
         *       // Check that object is a valid dbObject
         *       return angular.isObject(object) && object.id && services[key];
         *     }
         *     equals: function(a, b) {
         *       // Check the equality of decoded objects by comparing
         *       // their unique IDs
         *       return a.id === b.id;
         *     }
         *   };
         * });
         *
         * // In a config() block, you can then attach URLs with
         * // type-annotated parameters:
         * $stateProvider.state('users', {
         *   url: "/users",
         *   // ...
         * }).state('users.item', {
         *   url: "/{user:dbObject}",
         *   controller: function($scope, $stateParams) {
         *     // $stateParams.user will now be an object returned from
         *     // the Users service
         *   },
         *   // ...
         * });
         * </pre>
         */
        this.type = function (name, def) {
            if (!isDefined(def)) return UrlMatcher.prototype.$types[name];
            typeQueue.push({ name: name, def: def });
            if (!enqueue) flushTypeQueue();
            return this;
        };

        /* No need to document $get, since it returns this */
        this.$get = ['$injector', function ($injector) {
            injector = $injector;
            enqueue = false;
            UrlMatcher.prototype.$types = {};
            flushTypeQueue();

            forEach(defaultTypes, function (type, name) {
                if (!UrlMatcher.prototype.$types[name]) UrlMatcher.prototype.$types[name] = new Type(type);
            });
            return this;
        }];

        // To ensure proper order of operations in object configuration, and to allow internal
        // types to be overridden, `flushTypeQueue()` waits until `$urlMatcherFactory` is injected
        // before actually wiring up and assigning type definitions
        function flushTypeQueue() {
            forEach(typeQueue, function (type) {
                if (UrlMatcher.prototype.$types[type.name]) {
                    throw new Error("A type named '" + type.name + "' has already been defined.");
                }
                var def = new Type(isInjectable(type.def) ? injector.invoke(type.def) : type.def);
                UrlMatcher.prototype.$types[type.name] = def;
            });
        }
    }

    // Register as a provider so it's available to other providers
    angular.module('ui.router.util').provider('$urlMatcherFactory', $UrlMatcherFactory);

    /**
     * @ngdoc object
     * @name ui.router.router.$urlRouterProvider
     *
     * @requires ui.router.util.$urlMatcherFactoryProvider
     * @requires $locationProvider
     *
     * @description
     * `$urlRouterProvider` has the responsibility of watching `$location`. 
     * When `$location` changes it runs through a list of rules one by one until a 
     * match is found. `$urlRouterProvider` is used behind the scenes anytime you specify 
     * a url in a state configuration. All urls are compiled into a UrlMatcher object.
     *
     * There are several methods on `$urlRouterProvider` that make it useful to use directly
     * in your module config.
     */
    $UrlRouterProvider.$inject = ['$locationProvider', '$urlMatcherFactoryProvider'];
    function $UrlRouterProvider($locationProvider, $urlMatcherFactory) {
        var rules = [], otherwise = null, interceptDeferred = false, listener;

        // Returns a string that is a prefix of all strings matching the RegExp
        function regExpPrefix(re) {
            var prefix = /^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(re.source);
            return (prefix != null) ? prefix[1].replace(/\\(.)/g, "$1") : '';
        }

        // Interpolates matched values into a String.replace()-style pattern
        function interpolate(pattern, match) {
            return pattern.replace(/\$(\$|\d{1,2})/, function (m, what) {
                return match[what === '$' ? 0 : Number(what)];
            });
        }

        /**
         * @ngdoc function
         * @name ui.router.router.$urlRouterProvider#rule
         * @methodOf ui.router.router.$urlRouterProvider
         *
         * @description
         * Defines rules that are used by `$urlRouterProvider` to find matches for
         * specific URLs.
         *
         * @example
         * <pre>
         * var app = angular.module('app', ['ui.router.router']);
         *
         * app.config(function ($urlRouterProvider) {
         *   // Here's an example of how you might allow case insensitive urls
         *   $urlRouterProvider.rule(function ($injector, $location) {
         *     var path = $location.path(),
         *         normalized = path.toLowerCase();
         *
         *     if (path !== normalized) {
         *       return normalized;
         *     }
         *   });
         * });
         * </pre>
         *
         * @param {object} rule Handler function that takes `$injector` and `$location`
         * services as arguments. You can use them to return a valid path as a string.
         *
         * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance
         */
        this.rule = function (rule) {
            if (!isFunction(rule)) throw new Error("'rule' must be a function");
            rules.push(rule);
            return this;
        };

        /**
         * @ngdoc object
         * @name ui.router.router.$urlRouterProvider#otherwise
         * @methodOf ui.router.router.$urlRouterProvider
         *
         * @description
         * Defines a path that is used when an invalid route is requested.
         *
         * @example
         * <pre>
         * var app = angular.module('app', ['ui.router.router']);
         *
         * app.config(function ($urlRouterProvider) {
         *   // if the path doesn't match any of the urls you configured
         *   // otherwise will take care of routing the user to the
         *   // specified url
         *   $urlRouterProvider.otherwise('/index');
         *
         *   // Example of using function rule as param
         *   $urlRouterProvider.otherwise(function ($injector, $location) {
         *     return '/a/valid/url';
         *   });
         * });
         * </pre>
         *
         * @param {string|object} rule The url path you want to redirect to or a function 
         * rule that returns the url path. The function version is passed two params: 
         * `$injector` and `$location` services, and must return a url string.
         *
         * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance
         */
        this.otherwise = function (rule) {
            if (isString(rule)) {
                var redirect = rule;
                rule = function () { return redirect; };
            }
            else if (!isFunction(rule)) throw new Error("'rule' must be a function");
            otherwise = rule;
            return this;
        };


        function handleIfMatch($injector, handler, match) {
            if (!match) return false;
            var result = $injector.invoke(handler, handler, { $match: match });
            return isDefined(result) ? result : true;
        }

        /**
         * @ngdoc function
         * @name ui.router.router.$urlRouterProvider#when
         * @methodOf ui.router.router.$urlRouterProvider
         *
         * @description
         * Registers a handler for a given url matching. if handle is a string, it is
         * treated as a redirect, and is interpolated according to the syntax of match
         * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).
         *
         * If the handler is a function, it is injectable. It gets invoked if `$location`
         * matches. You have the option of inject the match object as `$match`.
         *
         * The handler can return
         *
         * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`
         *   will continue trying to find another one that matches.
         * - **string** which is treated as a redirect and passed to `$location.url()`
         * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.
         *
         * @example
         * <pre>
         * var app = angular.module('app', ['ui.router.router']);
         *
         * app.config(function ($urlRouterProvider) {
         *   $urlRouterProvider.when($state.url, function ($match, $stateParams) {
         *     if ($state.$current.navigable !== state ||
         *         !equalForKeys($match, $stateParams) {
         *      $state.transitionTo(state, $match, false);
         *     }
         *   });
         * });
         * </pre>
         *
         * @param {string|object} what The incoming path that you want to redirect.
         * @param {string|object} handler The path you want to redirect your user to.
         */
        this.when = function (what, handler) {
            var redirect, handlerIsString = isString(handler);
            if (isString(what)) what = $urlMatcherFactory.compile(what);

            if (!handlerIsString && !isFunction(handler) && !isArray(handler))
                throw new Error("invalid 'handler' in when()");

            var strategies = {
                matcher: function (what, handler) {
                    if (handlerIsString) {
                        redirect = $urlMatcherFactory.compile(handler);
                        handler = ['$match', function ($match) { return redirect.format($match); }];
                    }
                    return extend(function ($injector, $location) {
                        return handleIfMatch($injector, handler, what.exec($location.path(), $location.search()));
                    }, {
                        prefix: isString(what.prefix) ? what.prefix : ''
                    });
                },
                regex: function (what, handler) {
                    if (what.global || what.sticky) throw new Error("when() RegExp must not be global or sticky");

                    if (handlerIsString) {
                        redirect = handler;
                        handler = ['$match', function ($match) { return interpolate(redirect, $match); }];
                    }
                    return extend(function ($injector, $location) {
                        return handleIfMatch($injector, handler, what.exec($location.path()));
                    }, {
                        prefix: regExpPrefix(what)
                    });
                }
            };

            var check = { matcher: $urlMatcherFactory.isMatcher(what), regex: what instanceof RegExp };

            for (var n in check) {
                if (check[n]) return this.rule(strategies[n](what, handler));
            }

            throw new Error("invalid 'what' in when()");
        };

        /**
         * @ngdoc function
         * @name ui.router.router.$urlRouterProvider#deferIntercept
         * @methodOf ui.router.router.$urlRouterProvider
         *
         * @description
         * Disables (or enables) deferring location change interception.
         *
         * If you wish to customize the behavior of syncing the URL (for example, if you wish to
         * defer a transition but maintain the current URL), call this method at configuration time.
         * Then, at run time, call `$urlRouter.listen()` after you have configured your own
         * `$locationChangeSuccess` event handler.
         *
         * @example
         * <pre>
         * var app = angular.module('app', ['ui.router.router']);
         *
         * app.config(function ($urlRouterProvider) {
         *
         *   // Prevent $urlRouter from automatically intercepting URL changes;
         *   // this allows you to configure custom behavior in between
         *   // location changes and route synchronization:
         *   $urlRouterProvider.deferIntercept();
         *
         * }).run(function ($rootScope, $urlRouter, UserService) {
         *
         *   $rootScope.$on('$locationChangeSuccess', function(e) {
         *     // UserService is an example service for managing user state
         *     if (UserService.isLoggedIn()) return;
         *
         *     // Prevent $urlRouter's default handler from firing
         *     e.preventDefault();
         *
         *     UserService.handleLogin().then(function() {
         *       // Once the user has logged in, sync the current URL
         *       // to the router:
         *       $urlRouter.sync();
         *     });
         *   });
         *
         *   // Configures $urlRouter's listener *after* your custom listener
         *   $urlRouter.listen();
         * });
         * </pre>
         *
         * @param {boolean} defer Indicates whether to defer location change interception. Passing
                  no parameter is equivalent to `true`.
         */
        this.deferIntercept = function (defer) {
            if (defer === undefined) defer = true;
            interceptDeferred = defer;
        };

        /**
         * @ngdoc object
         * @name ui.router.router.$urlRouter
         *
         * @requires $location
         * @requires $rootScope
         * @requires $injector
         * @requires $browser
         *
         * @description
         *
         */
        this.$get = $get;
        $get.$inject = ['$location', '$rootScope', '$injector', '$browser'];
        function $get($location, $rootScope, $injector, $browser) {

            var baseHref = $browser.baseHref(), location = $location.url();

            function appendBasePath(url, isHtml5, absolute) {
                if (baseHref === '/') return url;
                if (isHtml5) return baseHref.slice(0, -1) + url;
                if (absolute) return baseHref.slice(1) + url;
                return url;
            }

            // TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree
            function update(evt) {
                if (evt && evt.defaultPrevented) return;

                function check(rule) {
                    var handled = rule($injector, $location);

                    if (!handled) return false;
                    if (isString(handled)) $location.replace().url(handled);
                    return true;
                }
                var n = rules.length, i;

                for (i = 0; i < n; i++) {
                    if (check(rules[i])) return;
                }
                // always check otherwise last to allow dynamic updates to the set of rules
                if (otherwise) check(otherwise);
            }

            function listen() {
                listener = listener || $rootScope.$on('$locationChangeSuccess', update);
                return listener;
            }

            if (!interceptDeferred) listen();

            return {
                /**
                 * @ngdoc function
                 * @name ui.router.router.$urlRouter#sync
                 * @methodOf ui.router.router.$urlRouter
                 *
                 * @description
                 * Triggers an update; the same update that happens when the address bar url changes, aka `$locationChangeSuccess`.
                 * This method is useful when you need to use `preventDefault()` on the `$locationChangeSuccess` event,
                 * perform some custom logic (route protection, auth, config, redirection, etc) and then finally proceed
                 * with the transition by calling `$urlRouter.sync()`.
                 *
                 * @example
                 * <pre>
                 * angular.module('app', ['ui.router'])
                 *   .run(function($rootScope, $urlRouter) {
                 *     $rootScope.$on('$locationChangeSuccess', function(evt) {
                 *       // Halt state change from even starting
                 *       evt.preventDefault();
                 *       // Perform custom logic
                 *       var meetsRequirement = ...
                 *       // Continue with the update and state transition if logic allows
                 *       if (meetsRequirement) $urlRouter.sync();
                 *     });
                 * });
                 * </pre>
                 */
                sync: function () {
                    update();
                },

                listen: function () {
                    return listen();
                },

                update: function (read) {
                    if (read) {
                        location = $location.url();
                        return;
                    }
                    if ($location.url() === location) return;

                    $location.url(location);
                    $location.replace();
                },

                push: function (urlMatcher, params, options) {
                    $location.url(urlMatcher.format(params || {}));
                    if (options && options.replace) $location.replace();
                },

                /**
                 * @ngdoc function
                 * @name ui.router.router.$urlRouter#href
                 * @methodOf ui.router.router.$urlRouter
                 *
                 * @description
                 * A URL generation method that returns the compiled URL for a given
                 * {@link ui.router.util.type:UrlMatcher `UrlMatcher`}, populated with the provided parameters.
                 *
                 * @example
                 * <pre>
                 * $bob = $urlRouter.href(new UrlMatcher("/about/:person"), {
                 *   person: "bob"
                 * });
                 * // $bob == "/about/bob";
                 * </pre>
                 *
                 * @param {UrlMatcher} urlMatcher The `UrlMatcher` object which is used as the template of the URL to generate.
                 * @param {object=} params An object of parameter values to fill the matcher's required parameters.
                 * @param {object=} options Options object. The options are:
                 *
                 * - **`absolute`** - {boolean=false},  If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
                 *
                 * @returns {string} Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`
                 */
                href: function (urlMatcher, params, options) {
                    if (!urlMatcher.validates(params)) return null;

                    var isHtml5 = $locationProvider.html5Mode();
                    var url = urlMatcher.format(params);
                    options = options || {};

                    if (!isHtml5 && url !== null) {
                        url = "#" + $locationProvider.hashPrefix() + url;
                    }
                    url = appendBasePath(url, isHtml5, options.absolute);

                    if (!options.absolute || !url) {
                        return url;
                    }

                    var slash = (!isHtml5 && url ? '/' : ''), port = $location.port();
                    port = (port === 80 || port === 443 ? '' : ':' + port);

                    return [$location.protocol(), '://', $location.host(), port, slash, url].join('');
                }
            };
        }
    }

    angular.module('ui.router.router').provider('$urlRouter', $UrlRouterProvider);

    /**
     * @ngdoc object
     * @name ui.router.state.$stateProvider
     *
     * @requires ui.router.router.$urlRouterProvider
     * @requires ui.router.util.$urlMatcherFactoryProvider
     *
     * @description
     * The new `$stateProvider` works similar to Angular's v1 router, but it focuses purely
     * on state.
     *
     * A state corresponds to a "place" in the application in terms of the overall UI and
     * navigation. A state describes (via the controller / template / view properties) what
     * the UI looks like and does at that place.
     *
     * States often have things in common, and the primary way of factoring out these
     * commonalities in this model is via the state hierarchy, i.e. parent/child states aka
     * nested states.
     *
     * The `$stateProvider` provides interfaces to declare these states for your app.
     */
    $StateProvider.$inject = ['$urlRouterProvider', '$urlMatcherFactoryProvider'];
    function $StateProvider($urlRouterProvider, $urlMatcherFactory) {

        var root, states = {}, $state, queue = {}, abstractKey = 'abstract';

        // Builds state properties from definition passed to registerState()
        var stateBuilder = {

            // Derive parent state from a hierarchical name only if 'parent' is not explicitly defined.
            // state.children = [];
            // if (parent) parent.children.push(state);
            parent: function (state) {
                if (isDefined(state.parent) && state.parent) return findState(state.parent);
                // regex matches any valid composite state name
                // would match "contact.list" but not "contacts"
                var compositeName = /^(.+)\.[^.]+$/.exec(state.name);
                return compositeName ? findState(compositeName[1]) : root;
            },

            // inherit 'data' from parent and override by own values (if any)
            data: function (state) {
                if (state.parent && state.parent.data) {
                    state.data = state.self.data = extend({}, state.parent.data, state.data);
                }
                return state.data;
            },

            // Build a URLMatcher if necessary, either via a relative or absolute URL
            url: function (state) {
                var url = state.url, config = { params: state.params || {} };

                if (isString(url)) {
                    if (url.charAt(0) == '^') return $urlMatcherFactory.compile(url.substring(1), config);
                    return (state.parent.navigable || root).url.concat(url, config);
                }

                if (!url || $urlMatcherFactory.isMatcher(url)) return url;
                throw new Error("Invalid url '" + url + "' in state '" + state + "'");
            },

            // Keep track of the closest ancestor state that has a URL (i.e. is navigable)
            navigable: function (state) {
                return state.url ? state : (state.parent ? state.parent.navigable : null);
            },

            // Derive parameters for this state and ensure they're a super-set of parent's parameters
            params: function (state) {
                if (!state.params) {
                    return state.url ? state.url.params : state.parent.params;
                }
                return state.params;
            },

            // If there is no explicit multi-view configuration, make one up so we don't have
            // to handle both cases in the view directive later. Note that having an explicit
            // 'views' property will mean the default unnamed view properties are ignored. This
            // is also a good time to resolve view names to absolute names, so everything is a
            // straight lookup at link time.
            views: function (state) {
                var views = {};

                forEach(isDefined(state.views) ? state.views : { '': state }, function (view, name) {
                    if (name.indexOf('@') < 0) name += '@' + state.parent.name;
                    views[name] = view;
                });
                return views;
            },

            ownParams: function (state) {
                state.params = state.params || {};

                if (!state.parent) {
                    return objectKeys(state.params);
                }
                var paramNames = {}; forEach(state.params, function (v, k) { paramNames[k] = true; });

                forEach(state.parent.params, function (v, k) {
                    if (!paramNames[k]) {
                        throw new Error("Missing required parameter '" + k + "' in state '" + state.name + "'");
                    }
                    paramNames[k] = false;
                });
                var ownParams = [];

                forEach(paramNames, function (own, p) {
                    if (own) ownParams.push(p);
                });
                return ownParams;
            },

            // Keep a full path from the root down to this state as this is needed for state activation.
            path: function (state) {
                return state.parent ? state.parent.path.concat(state) : []; // exclude root from path
            },

            // Speed up $state.contains() as it's used a lot
            includes: function (state) {
                var includes = state.parent ? extend({}, state.parent.includes) : {};
                includes[state.name] = true;
                return includes;
            },

            $delegates: {}
        };

        function isRelative(stateName) {
            return stateName.indexOf(".") === 0 || stateName.indexOf("^") === 0;
        }

        function findState(stateOrName, base) {
            if (!stateOrName) return undefined;

            var isStr = isString(stateOrName),
                name = isStr ? stateOrName : stateOrName.name,
                path = isRelative(name);

            if (path) {
                if (!base) throw new Error("No reference point given for path '" + name + "'");
                var rel = name.split("."), i = 0, pathLength = rel.length, current = base;

                for (; i < pathLength; i++) {
                    if (rel[i] === "" && i === 0) {
                        current = base;
                        continue;
                    }
                    if (rel[i] === "^") {
                        if (!current.parent) throw new Error("Path '" + name + "' not valid for state '" + base.name + "'");
                        current = current.parent;
                        continue;
                    }
                    break;
                }
                rel = rel.slice(i).join(".");
                name = current.name + (current.name && rel ? "." : "") + rel;
            }
            var state = states[name];

            if (state && (isStr || (!isStr && (state === stateOrName || state.self === stateOrName)))) {
                return state;
            }
            return undefined;
        }

        function queueState(parentName, state) {
            if (!queue[parentName]) {
                queue[parentName] = [];
            }
            queue[parentName].push(state);
        }

        function registerState(state) {
            // Wrap a new object around the state so we can store our private details easily.
            state = inherit(state, {
                self: state,
                resolve: state.resolve || {},
                toString: function () { return this.name; }
            });

            var name = state.name;
            if (!isString(name) || name.indexOf('@') >= 0) throw new Error("State must have a valid name");
            if (states.hasOwnProperty(name)) throw new Error("State '" + name + "'' is already defined");

            // Get parent name
            var parentName = (name.indexOf('.') !== -1) ? name.substring(0, name.lastIndexOf('.'))
                : (isString(state.parent)) ? state.parent
                : '';

            // If parent is not registered yet, add state to queue and register later
            if (parentName && !states[parentName]) {
                return queueState(parentName, state.self);
            }

            for (var key in stateBuilder) {
                if (isFunction(stateBuilder[key])) state[key] = stateBuilder[key](state, stateBuilder.$delegates[key]);
            }
            states[name] = state;

            // Register the state in the global state list and with $urlRouter if necessary.
            if (!state[abstractKey] && state.url) {
                $urlRouterProvider.when(state.url, ['$match', '$stateParams', function ($match, $stateParams) {
                    if ($state.$current.navigable != state || !equalForKeys($match, $stateParams)) {
                        $state.transitionTo(state, $match, { location: false });
                    }
                }]);
            }

            // Register any queued children
            if (queue[name]) {
                for (var i = 0; i < queue[name].length; i++) {
                    registerState(queue[name][i]);
                }
            }

            return state;
        }

        // Checks text to see if it looks like a glob.
        function isGlob(text) {
            return text.indexOf('*') > -1;
        }

        // Returns true if glob matches current $state name.
        function doesStateMatchGlob(glob) {
            var globSegments = glob.split('.'),
                segments = $state.$current.name.split('.');

            //match greedy starts
            if (globSegments[0] === '**') {
                segments = segments.slice(segments.indexOf(globSegments[1]));
                segments.unshift('**');
            }
            //match greedy ends
            if (globSegments[globSegments.length - 1] === '**') {
                segments.splice(segments.indexOf(globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);
                segments.push('**');
            }

            if (globSegments.length != segments.length) {
                return false;
            }

            //match single stars
            for (var i = 0, l = globSegments.length; i < l; i++) {
                if (globSegments[i] === '*') {
                    segments[i] = '*';
                }
            }

            return segments.join('') === globSegments.join('');
        }


        // Implicit root state that is always active
        root = registerState({
            name: '',
            url: '^',
            views: null,
            'abstract': true
        });
        root.navigable = null;


        /**
         * @ngdoc function
         * @name ui.router.state.$stateProvider#decorator
         * @methodOf ui.router.state.$stateProvider
         *
         * @description
         * Allows you to extend (carefully) or override (at your own peril) the 
         * `stateBuilder` object used internally by `$stateProvider`. This can be used 
         * to add custom functionality to ui-router, for example inferring templateUrl 
         * based on the state name.
         *
         * When passing only a name, it returns the current (original or decorated) builder
         * function that matches `name`.
         *
         * The builder functions that can be decorated are listed below. Though not all
         * necessarily have a good use case for decoration, that is up to you to decide.
         *
         * In addition, users can attach custom decorators, which will generate new 
         * properties within the state's internal definition. There is currently no clear 
         * use-case for this beyond accessing internal states (i.e. $state.$current), 
         * however, expect this to become increasingly relevant as we introduce additional 
         * meta-programming features.
         *
         * **Warning**: Decorators should not be interdependent because the order of 
         * execution of the builder functions in non-deterministic. Builder functions 
         * should only be dependent on the state definition object and super function.
         *
         *
         * Existing builder functions and current return values:
         *
         * - **parent** `{object}` - returns the parent state object.
         * - **data** `{object}` - returns state data, including any inherited data that is not
         *   overridden by own values (if any).
         * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}
         *   or `null`.
         * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is 
         *   navigable).
         * - **params** `{object}` - returns an array of state params that are ensured to 
         *   be a super-set of parent's params.
         * - **views** `{object}` - returns a views object where each key is an absolute view 
         *   name (i.e. "viewName@stateName") and each value is the config object 
         *   (template, controller) for the view. Even when you don't use the views object 
         *   explicitly on a state config, one is still created for you internally.
         *   So by decorating this builder function you have access to decorating template 
         *   and controller properties.
         * - **ownParams** `{object}` - returns an array of params that belong to the state, 
         *   not including any params defined by ancestor states.
         * - **path** `{string}` - returns the full path from the root down to this state. 
         *   Needed for state activation.
         * - **includes** `{object}` - returns an object that includes every state that 
         *   would pass a `$state.includes()` test.
         *
         * @example
         * <pre>
         * // Override the internal 'views' builder with a function that takes the state
         * // definition, and a reference to the internal function being overridden:
         * $stateProvider.decorator('views', function (state, parent) {
         *   var result = {},
         *       views = parent(state);
         *
         *   angular.forEach(views, function (config, name) {
         *     var autoName = (state.name + '.' + name).replace('.', '/');
         *     config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';
         *     result[name] = config;
         *   });
         *   return result;
         * });
         *
         * $stateProvider.state('home', {
         *   views: {
         *     'contact.list': { controller: 'ListController' },
         *     'contact.item': { controller: 'ItemController' }
         *   }
         * });
         *
         * // ...
         *
         * $state.go('home');
         * // Auto-populates list and item views with /partials/home/contact/list.html,
         * // and /partials/home/contact/item.html, respectively.
         * </pre>
         *
         * @param {string} name The name of the builder function to decorate. 
         * @param {object} func A function that is responsible for decorating the original 
         * builder function. The function receives two parameters:
         *
         *   - `{object}` - state - The state config object.
         *   - `{object}` - super - The original builder function.
         *
         * @return {object} $stateProvider - $stateProvider instance
         */
        this.decorator = decorator;
        function decorator(name, func) {
            /*jshint validthis: true */
            if (isString(name) && !isDefined(func)) {
                return stateBuilder[name];
            }
            if (!isFunction(func) || !isString(name)) {
                return this;
            }
            if (stateBuilder[name] && !stateBuilder.$delegates[name]) {
                stateBuilder.$delegates[name] = stateBuilder[name];
            }
            stateBuilder[name] = func;
            return this;
        }

        /**
         * @ngdoc function
         * @name ui.router.state.$stateProvider#state
         * @methodOf ui.router.state.$stateProvider
         *
         * @description
         * Registers a state configuration under a given state name. The stateConfig object
         * has the following acceptable properties.
         *
         * <a id='template'></a>
         *
         * - **`template`** - {string|function=} - html template as a string or a function that returns
         *   an html template as a string which should be used by the uiView directives. This property 
         *   takes precedence over templateUrl.
         *   
         *   If `template` is a function, it will be called with the following parameters:
         *
         *   - {array.&lt;object&gt;} - state parameters extracted from the current $location.path() by
         *     applying the current state
         *
         * <a id='templateUrl'></a>
         *
         * - **`templateUrl`** - {string|function=} - path or function that returns a path to an html 
         *   template that should be used by uiView.
         *   
         *   If `templateUrl` is a function, it will be called with the following parameters:
         *
         *   - {array.&lt;object&gt;} - state parameters extracted from the current $location.path() by 
         *     applying the current state
         *
         * <a id='templateProvider'></a>
         *
         * - **`templateProvider`** - {function=} - Provider function that returns HTML content
         *   string.
         *
         * <a id='controller'></a>
         *
         * - **`controller`** - {string|function=} -  Controller fn that should be associated with newly 
         *   related scope or the name of a registered controller if passed as a string.
         *
         * <a id='controllerProvider'></a>
         *
         * - **`controllerProvider`** - {function=} - Injectable provider function that returns
         *   the actual controller or string.
         *
         * <a id='controllerAs'></a>
         * 
         * - **`controllerAs`** � {string=} � A controller alias name. If present the controller will be 
         *   published to scope under the controllerAs name.
         *
         * <a id='resolve'></a>
         *
         * - **`resolve`** - {object.&lt;string, function&gt;=} - An optional map of dependencies which 
         *   should be injected into the controller. If any of these dependencies are promises, 
         *   the router will wait for them all to be resolved or one to be rejected before the 
         *   controller is instantiated. If all the promises are resolved successfully, the values 
         *   of the resolved promises are injected and $stateChangeSuccess event is fired. If any 
         *   of the promises are rejected the $stateChangeError event is fired. The map object is:
         *   
         *   - key - {string}: name of dependency to be injected into controller
         *   - factory - {string|function}: If string then it is alias for service. Otherwise if function, 
         *     it is injected and return value it treated as dependency. If result is a promise, it is 
         *     resolved before its value is injected into controller.
         *
         * <a id='url'></a>
         *
         * - **`url`** - {string=} - A url with optional parameters. When a state is navigated or
         *   transitioned to, the `$stateParams` service will be populated with any 
         *   parameters that were passed.
         *
         * <a id='params'></a>
         *
         * - **`params`** - {object=} - An array of parameter names or regular expressions. Only 
         *   use this within a state if you are not using url. Otherwise you can specify your
         *   parameters within the url. When a state is navigated or transitioned to, the 
         *   $stateParams service will be populated with any parameters that were passed.
         *
         * <a id='views'></a>
         *
         * - **`views`** - {object=} - Use the views property to set up multiple views or to target views
         *   manually/explicitly.
         *
         * <a id='abstract'></a>
         *
         * - **`abstract`** - {boolean=} - An abstract state will never be directly activated, 
         *   but can provide inherited properties to its common children states.
         *
         * <a id='onEnter'></a>
         *
         * - **`onEnter`** - {object=} - Callback function for when a state is entered. Good way
         *   to trigger an action or dispatch an event, such as opening a dialog.
         * If minifying your scripts, make sure to use the `['injection1', 'injection2', function(injection1, injection2){}]` syntax.
         *
         * <a id='onExit'></a>
         *
         * - **`onExit`** - {object=} - Callback function for when a state is exited. Good way to
         *   trigger an action or dispatch an event, such as opening a dialog.
         * If minifying your scripts, make sure to use the `['injection1', 'injection2', function(injection1, injection2){}]` syntax.
         *
         * <a id='reloadOnSearch'></a>
         *
         * - **`reloadOnSearch = true`** - {boolean=} - If `false`, will not retrigger the same state 
         *   just because a search/query parameter has changed (via $location.search() or $location.hash()). 
         *   Useful for when you'd like to modify $location.search() without triggering a reload.
         *
         * <a id='data'></a>
         *
         * - **`data`** - {object=} - Arbitrary data object, useful for custom configuration.
         *
         * @example
         * <pre>
         * // Some state name examples
         *
         * // stateName can be a single top-level name (must be unique).
         * $stateProvider.state("home", {});
         *
         * // Or it can be a nested state name. This state is a child of the 
         * // above "home" state.
         * $stateProvider.state("home.newest", {});
         *
         * // Nest states as deeply as needed.
         * $stateProvider.state("home.newest.abc.xyz.inception", {});
         *
         * // state() returns $stateProvider, so you can chain state declarations.
         * $stateProvider
         *   .state("home", {})
         *   .state("about", {})
         *   .state("contacts", {});
         * </pre>
         *
         * @param {string} name A unique state name, e.g. "home", "about", "contacts". 
         * To create a parent/child state use a dot, e.g. "about.sales", "home.newest".
         * @param {object} definition State configuration object.
         */
        this.state = state;
        function state(name, definition) {
            /*jshint validthis: true */
            if (isObject(name)) definition = name;
            else definition.name = name;
            registerState(definition);
            return this;
        }

        /**
         * @ngdoc object
         * @name ui.router.state.$state
         *
         * @requires $rootScope
         * @requires $q
         * @requires ui.router.state.$view
         * @requires $injector
         * @requires ui.router.util.$resolve
         * @requires ui.router.state.$stateParams
         * @requires ui.router.router.$urlRouter
         *
         * @property {object} params A param object, e.g. {sectionId: section.id)}, that 
         * you'd like to test against the current active state.
         * @property {object} current A reference to the state's config object. However 
         * you passed it in. Useful for accessing custom data.
         * @property {object} transition Currently pending transition. A promise that'll 
         * resolve or reject.
         *
         * @description
         * `$state` service is responsible for representing states as well as transitioning
         * between them. It also provides interfaces to ask for current state or even states
         * you're coming from.
         */
        this.$get = $get;
        $get.$inject = ['$rootScope', '$q', '$view', '$injector', '$resolve', '$stateParams', '$urlRouter'];
        function $get($rootScope, $q, $view, $injector, $resolve, $stateParams, $urlRouter) {

            var TransitionSuperseded = $q.reject(new Error('transition superseded'));
            var TransitionPrevented = $q.reject(new Error('transition prevented'));
            var TransitionAborted = $q.reject(new Error('transition aborted'));
            var TransitionFailed = $q.reject(new Error('transition failed'));

            // Handles the case where a state which is the target of a transition is not found, and the user
            // can optionally retry or defer the transition
            function handleRedirect(redirect, state, params, options) {
                /**
                 * @ngdoc event
                 * @name ui.router.state.$state#$stateNotFound
                 * @eventOf ui.router.state.$state
                 * @eventType broadcast on root scope
                 * @description
                 * Fired when a requested state **cannot be found** using the provided state name during transition.
                 * The event is broadcast allowing any handlers a single chance to deal with the error (usually by
                 * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,
                 * you can see its three properties in the example. You can use `event.preventDefault()` to abort the
                 * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.
                 *
                 * @param {Object} event Event object.
                 * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.
                 * @param {State} fromState Current state object.
                 * @param {Object} fromParams Current state params.
                 *
                 * @example
                 *
                 * <pre>
                 * // somewhere, assume lazy.state has not been defined
                 * $state.go("lazy.state", {a:1, b:2}, {inherit:false});
                 *
                 * // somewhere else
                 * $scope.$on('$stateNotFound',
                 * function(event, unfoundState, fromState, fromParams){
                 *     console.log(unfoundState.to); // "lazy.state"
                 *     console.log(unfoundState.toParams); // {a:1, b:2}
                 *     console.log(unfoundState.options); // {inherit:false} + default options
                 * })
                 * </pre>
                 */
                var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);

                if (evt.defaultPrevented) {
                    $urlRouter.update();
                    return TransitionAborted;
                }

                if (!evt.retry) {
                    return null;
                }

                // Allow the handler to return a promise to defer state lookup retry
                if (options.$retry) {
                    $urlRouter.update();
                    return TransitionFailed;
                }
                var retryTransition = $state.transition = $q.when(evt.retry);

                retryTransition.then(function () {
                    if (retryTransition !== $state.transition) return TransitionSuperseded;
                    redirect.options.$retry = true;
                    return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);
                }, function () {
                    return TransitionAborted;
                });
                $urlRouter.update();

                return retryTransition;
            }

            root.locals = { resolve: null, globals: { $stateParams: {} } };

            $state = {
                params: {},
                current: root.self,
                $current: root,
                transition: null
            };

            /**
             * @ngdoc function
             * @name ui.router.state.$state#reload
             * @methodOf ui.router.state.$state
             *
             * @description
             * A method that force reloads the current state. All resolves are re-resolved, events are not re-fired, 
             * and controllers reinstantiated (bug with controllers reinstantiating right now, fixing soon).
             *
             * @example
             * <pre>
             * var app angular.module('app', ['ui.router']);
             *
             * app.controller('ctrl', function ($scope, $state) {
             *   $scope.reload = function(){
             *     $state.reload();
             *   }
             * });
             * </pre>
             *
             * `reload()` is just an alias for:
             * <pre>
             * $state.transitionTo($state.current, $stateParams, { 
             *   reload: true, inherit: false, notify: false 
             * });
             * </pre>
             */
            $state.reload = function reload() {
                $state.transitionTo($state.current, $stateParams, { reload: true, inherit: false, notify: false });
            };

            /**
             * @ngdoc function
             * @name ui.router.state.$state#go
             * @methodOf ui.router.state.$state
             *
             * @description
             * Convenience method for transitioning to a new state. `$state.go` calls 
             * `$state.transitionTo` internally but automatically sets options to 
             * `{ location: true, inherit: true, relative: $state.$current, notify: true }`. 
             * This allows you to easily use an absolute or relative to path and specify 
             * only the parameters you'd like to update (while letting unspecified parameters 
             * inherit from the currently active ancestor states).
             *
             * @example
             * <pre>
             * var app = angular.module('app', ['ui.router']);
             *
             * app.controller('ctrl', function ($scope, $state) {
             *   $scope.changeState = function () {
             *     $state.go('contact.detail');
             *   };
             * });
             * </pre>
             * <img src='../ngdoc_assets/StateGoExamples.png'/>
             *
             * @param {string} to Absolute state name or relative state path. Some examples:
             *
             * - `$state.go('contact.detail')` - will go to the `contact.detail` state
             * - `$state.go('^')` - will go to a parent state
             * - `$state.go('^.sibling')` - will go to a sibling state
             * - `$state.go('.child.grandchild')` - will go to grandchild state
             *
             * @param {object=} params A map of the parameters that will be sent to the state, 
             * will populate $stateParams. Any parameters that are not specified will be inherited from currently 
             * defined parameters. This allows, for example, going to a sibling state that shares parameters
             * specified in a parent state. Parameter inheritance only works between common ancestor states, I.e.
             * transitioning to a sibling will get you the parameters for all parents, transitioning to a child
             * will get you all current parameters, etc.
             * @param {object=} options Options object. The options are:
             *
             * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`
             *    will not. If string, must be `"replace"`, which will update url and also replace last history record.
             * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.
             * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), 
             *    defines which state to be relative from.
             * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.
             * - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params 
             *    have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd
             *    use this when you want to force a reload when *everything* is the same, including search params.
             *
             * @returns {promise} A promise representing the state of the new transition.
             *
             * Possible success values:
             *
             * - $state.current
             *
             * <br/>Possible rejection values:
             *
             * - 'transition superseded' - when a newer transition has been started after this one
             * - 'transition prevented' - when `event.preventDefault()` has been called in a `$stateChangeStart` listener
             * - 'transition aborted' - when `event.preventDefault()` has been called in a `$stateNotFound` listener or
             *   when a `$stateNotFound` `event.retry` promise errors.
             * - 'transition failed' - when a state has been unsuccessfully found after 2 tries.
             * - *resolve error* - when an error has occurred with a `resolve`
             *
             */
            $state.go = function go(to, params, options) {
                return $state.transitionTo(to, params, extend({ inherit: true, relative: $state.$current }, options));
            };

            /**
             * @ngdoc function
             * @name ui.router.state.$state#transitionTo
             * @methodOf ui.router.state.$state
             *
             * @description
             * Low-level method for transitioning to a new state. {@link ui.router.state.$state#methods_go $state.go}
             * uses `transitionTo` internally. `$state.go` is recommended in most situations.
             *
             * @example
             * <pre>
             * var app = angular.module('app', ['ui.router']);
             *
             * app.controller('ctrl', function ($scope, $state) {
             *   $scope.changeState = function () {
             *     $state.transitionTo('contact.detail');
             *   };
             * });
             * </pre>
             *
             * @param {string} to State name.
             * @param {object=} toParams A map of the parameters that will be sent to the state,
             * will populate $stateParams.
             * @param {object=} options Options object. The options are:
             *
             * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`
             *    will not. If string, must be `"replace"`, which will update url and also replace last history record.
             * - **`inherit`** - {boolean=false}, If `true` will inherit url parameters from current url.
             * - **`relative`** - {object=}, When transitioning with relative path (e.g '^'), 
             *    defines which state to be relative from.
             * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.
             * - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params 
             *    have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd
             *    use this when you want to force a reload when *everything* is the same, including search params.
             *
             * @returns {promise} A promise representing the state of the new transition. See
             * {@link ui.router.state.$state#methods_go $state.go}.
             */
            $state.transitionTo = function transitionTo(to, toParams, options) {
                toParams = toParams || {};
                options = extend({
                    location: true, inherit: false, relative: null, notify: true, reload: false, $retry: false
                }, options || {});

                var from = $state.$current, fromParams = $state.params, fromPath = from.path;
                var evt, toState = findState(to, options.relative);

                if (!isDefined(toState)) {
                    var redirect = { to: to, toParams: toParams, options: options };
                    var redirectResult = handleRedirect(redirect, from.self, fromParams, options);

                    if (redirectResult) {
                        return redirectResult;
                    }

                    // Always retry once if the $stateNotFound was not prevented
                    // (handles either redirect changed or state lazy-definition)
                    to = redirect.to;
                    toParams = redirect.toParams;
                    options = redirect.options;
                    toState = findState(to, options.relative);

                    if (!isDefined(toState)) {
                        if (!options.relative) throw new Error("No such state '" + to + "'");
                        throw new Error("Could not resolve '" + to + "' from state '" + options.relative + "'");
                    }
                }
                if (toState[abstractKey]) throw new Error("Cannot transition to abstract state '" + to + "'");
                if (options.inherit) toParams = inheritParams($stateParams, toParams || {}, $state.$current, toState);
                to = toState;

                var toPath = to.path;

                // Starting from the root of the path, keep all levels that haven't changed
                var keep = 0, state = toPath[keep], locals = root.locals, toLocals = [];

                if (!options.reload) {
                    while (state && state === fromPath[keep] && equalForKeys(toParams, fromParams, state.ownParams)) {
                        locals = toLocals[keep] = state.locals;
                        keep++;
                        state = toPath[keep];
                    }
                }

                // If we're going to the same state and all locals are kept, we've got nothing to do.
                // But clear 'transition', as we still want to cancel any other pending transitions.
                // TODO: We may not want to bump 'transition' if we're called from a location change
                // that we've initiated ourselves, because we might accidentally abort a legitimate
                // transition initiated from code?
                if (shouldTriggerReload(to, from, locals, options)) {
                    if (to.self.reloadOnSearch !== false) $urlRouter.update();
                    $state.transition = null;
                    return $q.when($state.current);
                }

                // Filter parameters before we pass them to event handlers etc.
                toParams = filterByKeys(objectKeys(to.params), toParams || {});

                // Broadcast start event and cancel the transition if requested
                if (options.notify) {
                    /**
                     * @ngdoc event
                     * @name ui.router.state.$state#$stateChangeStart
                     * @eventOf ui.router.state.$state
                     * @eventType broadcast on root scope
                     * @description
                     * Fired when the state transition **begins**. You can use `event.preventDefault()`
                     * to prevent the transition from happening and then the transition promise will be
                     * rejected with a `'transition prevented'` value.
                     *
                     * @param {Object} event Event object.
                     * @param {State} toState The state being transitioned to.
                     * @param {Object} toParams The params supplied to the `toState`.
                     * @param {State} fromState The current state, pre-transition.
                     * @param {Object} fromParams The params supplied to the `fromState`.
                     *
                     * @example
                     *
                     * <pre>
                     * $rootScope.$on('$stateChangeStart',
                     * function(event, toState, toParams, fromState, fromParams){
                     *     event.preventDefault();
                     *     // transitionTo() promise will be rejected with
                     *     // a 'transition prevented' error
                     * })
                     * </pre>
                     */
                    if ($rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams).defaultPrevented) {
                        $urlRouter.update();
                        return TransitionPrevented;
                    }
                }

                // Resolve locals for the remaining states, but don't update any global state just
                // yet -- if anything fails to resolve the current state needs to remain untouched.
                // We also set up an inheritance chain for the locals here. This allows the view directive
                // to quickly look up the correct definition for each view in the current state. Even
                // though we create the locals object itself outside resolveState(), it is initially
                // empty and gets filled asynchronously. We need to keep track of the promise for the
                // (fully resolved) current locals, and pass this down the chain.
                var resolved = $q.when(locals);

                for (var l = keep; l < toPath.length; l++, state = toPath[l]) {
                    locals = toLocals[l] = inherit(locals);
                    resolved = resolveState(state, toParams, state === to, resolved, locals);
                }

                // Once everything is resolved, we are ready to perform the actual transition
                // and return a promise for the new state. We also keep track of what the
                // current promise is, so that we can detect overlapping transitions and
                // keep only the outcome of the last transition.
                var transition = $state.transition = resolved.then(function () {
                    var l, entering, exiting;

                    if ($state.transition !== transition) return TransitionSuperseded;

                    // Exit 'from' states not kept
                    for (l = fromPath.length - 1; l >= keep; l--) {
                        exiting = fromPath[l];
                        if (exiting.self.onExit) {
                            $injector.invoke(exiting.self.onExit, exiting.self, exiting.locals.globals);
                        }
                        exiting.locals = null;
                    }

                    // Enter 'to' states not kept
                    for (l = keep; l < toPath.length; l++) {
                        entering = toPath[l];
                        entering.locals = toLocals[l];
                        if (entering.self.onEnter) {
                            $injector.invoke(entering.self.onEnter, entering.self, entering.locals.globals);
                        }
                    }

                    // Run it again, to catch any transitions in callbacks
                    if ($state.transition !== transition) return TransitionSuperseded;

                    // Update globals in $state
                    $state.$current = to;
                    $state.current = to.self;
                    $state.params = toParams;
                    copy($state.params, $stateParams);
                    $state.transition = null;

                    if (options.location && to.navigable) {
                        $urlRouter.push(to.navigable.url, to.navigable.locals.globals.$stateParams, {
                            replace: options.location === 'replace'
                        });
                    }

                    if (options.notify) {
                        /**
                         * @ngdoc event
                         * @name ui.router.state.$state#$stateChangeSuccess
                         * @eventOf ui.router.state.$state
                         * @eventType broadcast on root scope
                         * @description
                         * Fired once the state transition is **complete**.
                         *
                         * @param {Object} event Event object.
                         * @param {State} toState The state being transitioned to.
                         * @param {Object} toParams The params supplied to the `toState`.
                         * @param {State} fromState The current state, pre-transition.
                         * @param {Object} fromParams The params supplied to the `fromState`.
                         */
                        $rootScope.$broadcast('$stateChangeSuccess', to.self, toParams, from.self, fromParams);
                    }
                    $urlRouter.update(true);

                    return $state.current;
                }, function (error) {
                    if ($state.transition !== transition) return TransitionSuperseded;

                    $state.transition = null;
                    /**
                     * @ngdoc event
                     * @name ui.router.state.$state#$stateChangeError
                     * @eventOf ui.router.state.$state
                     * @eventType broadcast on root scope
                     * @description
                     * Fired when an **error occurs** during transition. It's important to note that if you
                     * have any errors in your resolve functions (javascript errors, non-existent services, etc)
                     * they will not throw traditionally. You must listen for this $stateChangeError event to
                     * catch **ALL** errors.
                     *
                     * @param {Object} event Event object.
                     * @param {State} toState The state being transitioned to.
                     * @param {Object} toParams The params supplied to the `toState`.
                     * @param {State} fromState The current state, pre-transition.
                     * @param {Object} fromParams The params supplied to the `fromState`.
                     * @param {Error} error The resolve error object.
                     */
                    evt = $rootScope.$broadcast('$stateChangeError', to.self, toParams, from.self, fromParams, error);

                    if (!evt.defaultPrevented) {
                        $urlRouter.update();
                    }

                    return $q.reject(error);
                });

                return transition;
            };

            /**
             * @ngdoc function
             * @name ui.router.state.$state#is
             * @methodOf ui.router.state.$state
             *
             * @description
             * Similar to {@link ui.router.state.$state#methods_includes $state.includes},
             * but only checks for the full state name. If params is supplied then it will be 
             * tested for strict equality against the current active params object, so all params 
             * must match with none missing and no extras.
             *
             * @example
             * <pre>
             * $state.$current.name = 'contacts.details.item';
             *
             * // absolute name
             * $state.is('contact.details.item'); // returns true
             * $state.is(contactDetailItemStateObject); // returns true
             *
             * // relative name (. and ^), typically from a template
             * // E.g. from the 'contacts.details' template
             * <div ng-class="{highlighted: $state.is('.item')}">Item</div>
             * </pre>
             *
             * @param {string|object} stateName The state name (absolute or relative) or state object you'd like to check.
             * @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like 
             * to test against the current active state.
             * @returns {boolean} Returns true if it is the state.
             */
            $state.is = function is(stateOrName, params) {
                var state = findState(stateOrName);

                if (!isDefined(state)) {
                    return undefined;
                }

                if ($state.$current !== state) {
                    return false;
                }

                return isDefined(params) && params !== null ? angular.equals($stateParams, params) : true;
            };

            /**
             * @ngdoc function
             * @name ui.router.state.$state#includes
             * @methodOf ui.router.state.$state
             *
             * @description
             * A method to determine if the current active state is equal to or is the child of the
             * state stateName. If any params are passed then they will be tested for a match as well.
             * Not all the parameters need to be passed, just the ones you'd like to test for equality.
             *
             * @example
             * Partial and relative names
             * <pre>
             * $state.$current.name = 'contacts.details.item';
             *
             * // Using partial names
             * $state.includes("contacts"); // returns true
             * $state.includes("contacts.details"); // returns true
             * $state.includes("contacts.details.item"); // returns true
             * $state.includes("contacts.list"); // returns false
             * $state.includes("about"); // returns false
             *
             * // Using relative names (. and ^), typically from a template
             * // E.g. from the 'contacts.details' template
             * <div ng-class="{highlighted: $state.includes('.item')}">Item</div>
             * </pre>
             *
             * Basic globbing patterns
             * <pre>
             * $state.$current.name = 'contacts.details.item.url';
             *
             * $state.includes("*.details.*.*"); // returns true
             * $state.includes("*.details.**"); // returns true
             * $state.includes("**.item.**"); // returns true
             * $state.includes("*.details.item.url"); // returns true
             * $state.includes("*.details.*.url"); // returns true
             * $state.includes("*.details.*"); // returns false
             * $state.includes("item.**"); // returns false
             * </pre>
             *
             * @param {string} stateOrName A partial name, relative name, or glob pattern
             * to be searched for within the current state name.
             * @param {object} params A param object, e.g. `{sectionId: section.id}`,
             * that you'd like to test against the current active state.
             * @returns {boolean} Returns true if it does include the state
             */
            $state.includes = function includes(stateOrName, params) {
                if (isString(stateOrName) && isGlob(stateOrName)) {
                    if (!doesStateMatchGlob(stateOrName)) {
                        return false;
                    }
                    stateOrName = $state.$current.name;
                }
                var state = findState(stateOrName);

                if (!isDefined(state)) {
                    return undefined;
                }
                if (!isDefined($state.$current.includes[state.name])) {
                    return false;
                }
                return equalForKeys(params, $stateParams);
            };


            /**
             * @ngdoc function
             * @name ui.router.state.$state#href
             * @methodOf ui.router.state.$state
             *
             * @description
             * A url generation method that returns the compiled url for the given state populated with the given params.
             *
             * @example
             * <pre>
             * expect($state.href("about.person", { person: "bob" })).toEqual("/about/bob");
             * </pre>
             *
             * @param {string|object} stateOrName The state name or state object you'd like to generate a url from.
             * @param {object=} params An object of parameter values to fill the state's required parameters.
             * @param {object=} options Options object. The options are:
             *
             * - **`lossy`** - {boolean=true} -  If true, and if there is no url associated with the state provided in the
             *    first parameter, then the constructed href url will be built from the first navigable ancestor (aka
             *    ancestor with a valid url).
             * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.
             * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), 
             *    defines which state to be relative from.
             * - **`absolute`** - {boolean=false},  If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
             * 
             * @returns {string} compiled state url
             */
            $state.href = function href(stateOrName, params, options) {
                options = extend({
                    lossy: true,
                    inherit: true,
                    absolute: false,
                    relative: $state.$current
                }, options || {});

                var state = findState(stateOrName, options.relative);

                if (!isDefined(state)) return null;
                if (options.inherit) params = inheritParams($stateParams, params || {}, $state.$current, state);

                var nav = (state && options.lossy) ? state.navigable : state;

                if (!nav || !nav.url) {
                    return null;
                }
                return $urlRouter.href(nav.url, filterByKeys(objectKeys(state.params), params || {}), {
                    absolute: options.absolute
                });
            };

            /**
             * @ngdoc function
             * @name ui.router.state.$state#get
             * @methodOf ui.router.state.$state
             *
             * @description
             * Returns the state configuration object for any specific state or all states.
             *
             * @param {string|Sbject=} stateOrName (absolute or relative) If provided, will only get the config for
             * the requested state. If not provided, returns an array of ALL state configs.
             * @returns {Object|Array} State configuration object or array of all objects.
             */
            $state.get = function (stateOrName, context) {
                if (arguments.length === 0) return objectKeys(states).map(function (name) { return states[name].self; });
                var state = findState(stateOrName, context);
                return (state && state.self) ? state.self : null;
            };

            function resolveState(state, params, paramsAreFiltered, inherited, dst) {
                // Make a restricted $stateParams with only the parameters that apply to this state if
                // necessary. In addition to being available to the controller and onEnter/onExit callbacks,
                // we also need $stateParams to be available for any $injector calls we make during the
                // dependency resolution process.
                var $stateParams = (paramsAreFiltered) ? params : filterByKeys(objectKeys(state.params), params);
                var locals = { $stateParams: $stateParams };

                // Resolve 'global' dependencies for the state, i.e. those not specific to a view.
                // We're also including $stateParams in this; that way the parameters are restricted
                // to the set that should be visible to the state, and are independent of when we update
                // the global $state and $stateParams values.
                dst.resolve = $resolve.resolve(state.resolve, locals, dst.resolve, state);
                var promises = [dst.resolve.then(function (globals) {
                    dst.globals = globals;
                })];
                if (inherited) promises.push(inherited);

                // Resolve template and dependencies for all views.
                forEach(state.views, function (view, name) {
                    var injectables = (view.resolve && view.resolve !== state.resolve ? view.resolve : {});
                    injectables.$template = [function () {
                        return $view.load(name, { view: view, locals: locals, params: $stateParams }) || '';
                    }];

                    promises.push($resolve.resolve(injectables, locals, dst.resolve, state).then(function (result) {
                        // References to the controller (only instantiated at link time)
                        if (isFunction(view.controllerProvider) || isArray(view.controllerProvider)) {
                            var injectLocals = angular.extend({}, injectables, locals);
                            result.$$controller = $injector.invoke(view.controllerProvider, null, injectLocals);
                        } else {
                            result.$$controller = view.controller;
                        }
                        // Provide access to the state itself for internal use
                        result.$$state = state;
                        result.$$controllerAs = view.controllerAs;
                        dst[name] = result;
                    }));
                });

                // Wait for all the promises and then return the activation object
                return $q.all(promises).then(function (values) {
                    return dst;
                });
            }

            return $state;
        }

        function shouldTriggerReload(to, from, locals, options) {
            if (to === from && ((locals === from.locals && !options.reload) || (to.self.reloadOnSearch === false))) {
                return true;
            }
        }
    }

    angular.module('ui.router.state')
      .value('$stateParams', {})
      .provider('$state', $StateProvider);


    $ViewProvider.$inject = [];
    function $ViewProvider() {

        this.$get = $get;
        /**
         * @ngdoc object
         * @name ui.router.state.$view
         *
         * @requires ui.router.util.$templateFactory
         * @requires $rootScope
         *
         * @description
         *
         */
        $get.$inject = ['$rootScope', '$templateFactory'];
        function $get($rootScope, $templateFactory) {
            return {
                // $view.load('full.viewName', { template: ..., controller: ..., resolve: ..., async: false, params: ... })
                /**
                 * @ngdoc function
                 * @name ui.router.state.$view#load
                 * @methodOf ui.router.state.$view
                 *
                 * @description
                 *
                 * @param {string} name name
                 * @param {object} options option object.
                 */
                load: function load(name, options) {
                    var result, defaults = {
                        template: null, controller: null, view: null, locals: null, notify: true, async: true, params: {}
                    };
                    options = extend(defaults, options);

                    if (options.view) {
                        result = $templateFactory.fromConfig(options.view, options.params, options.locals);
                    }
                    if (result && options.notify) {
                        /**
                         * @ngdoc event
                         * @name ui.router.state.$state#$viewContentLoading
                         * @eventOf ui.router.state.$view
                         * @eventType broadcast on root scope
                         * @description
                         *
                         * Fired once the view **begins loading**, *before* the DOM is rendered.
                         *
                         * @param {Object} event Event object.
                         * @param {Object} viewConfig The view config properties (template, controller, etc).
                         *
                         * @example
                         *
                         * <pre>
                         * $scope.$on('$viewContentLoading',
                         * function(event, viewConfig){
                         *     // Access to all the view config properties.
                         *     // and one special property 'targetView'
                         *     // viewConfig.targetView
                         * });
                         * </pre>
                         */
                        $rootScope.$broadcast('$viewContentLoading', options);
                    }
                    return result;
                }
            };
        }
    }

    angular.module('ui.router.state').provider('$view', $ViewProvider);

    /**
     * @ngdoc object
     * @name ui.router.state.$uiViewScrollProvider
     *
     * @description
     * Provider that returns the {@link ui.router.state.$uiViewScroll} service function.
     */
    function $ViewScrollProvider() {

        var useAnchorScroll = false;

        /**
         * @ngdoc function
         * @name ui.router.state.$uiViewScrollProvider#useAnchorScroll
         * @methodOf ui.router.state.$uiViewScrollProvider
         *
         * @description
         * Reverts back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) service for
         * scrolling based on the url anchor.
         */
        this.useAnchorScroll = function () {
            useAnchorScroll = true;
        };

        /**
         * @ngdoc object
         * @name ui.router.state.$uiViewScroll
         *
         * @requires $anchorScroll
         * @requires $timeout
         *
         * @description
         * When called with a jqLite element, it scrolls the element into view (after a
         * `$timeout` so the DOM has time to refresh).
         *
         * If you prefer to rely on `$anchorScroll` to scroll the view to the anchor,
         * this can be enabled by calling {@link ui.router.state.$uiViewScrollProvider#methods_useAnchorScroll `$uiViewScrollProvider.useAnchorScroll()`}.
         */
        this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) {
            if (useAnchorScroll) {
                return $anchorScroll;
            }

            return function ($element) {
                $timeout(function () {
                    $element[0].scrollIntoView();
                }, 0, false);
            };
        }];
    }

    angular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);

    /**
     * @ngdoc directive
     * @name ui.router.state.directive:ui-view
     *
     * @requires ui.router.state.$state
     * @requires $compile
     * @requires $controller
     * @requires $injector
     * @requires ui.router.state.$uiViewScroll
     * @requires $document
     *
     * @restrict ECA
     *
     * @description
     * The ui-view directive tells $state where to place your templates.
     *
     * @param {string=} ui-view A view name. The name should be unique amongst the other views in the
     * same state. You can have views of the same name that live in different states.
     *
     * @param {string=} autoscroll It allows you to set the scroll behavior of the browser window
     * when a view is populated. By default, $anchorScroll is overridden by ui-router's custom scroll
     * service, {@link ui.router.state.$uiViewScroll}. This custom service let's you
     * scroll ui-view elements into view when they are populated during a state activation.
     *
     * *Note: To revert back to old [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)
     * functionality, call `$uiViewScrollProvider.useAnchorScroll()`.*
     *
     * @param {string=} onload Expression to evaluate whenever the view updates.
     * 
     * @example
     * A view can be unnamed or named. 
     * <pre>
     * <!-- Unnamed -->
     * <div ui-view></div> 
     * 
     * <!-- Named -->
     * <div ui-view="viewName"></div>
     * </pre>
     *
     * You can only have one unnamed view within any template (or root html). If you are only using a 
     * single view and it is unnamed then you can populate it like so:
     * <pre>
     * <div ui-view></div> 
     * $stateProvider.state("home", {
     *   template: "<h1>HELLO!</h1>"
     * })
     * </pre>
     * 
     * The above is a convenient shortcut equivalent to specifying your view explicitly with the {@link ui.router.state.$stateProvider#views `views`}
     * config property, by name, in this case an empty name:
     * <pre>
     * $stateProvider.state("home", {
     *   views: {
     *     "": {
     *       template: "<h1>HELLO!</h1>"
     *     }
     *   }    
     * })
     * </pre>
     * 
     * But typically you'll only use the views property if you name your view or have more than one view 
     * in the same template. There's not really a compelling reason to name a view if its the only one, 
     * but you could if you wanted, like so:
     * <pre>
     * <div ui-view="main"></div>
     * </pre> 
     * <pre>
     * $stateProvider.state("home", {
     *   views: {
     *     "main": {
     *       template: "<h1>HELLO!</h1>"
     *     }
     *   }    
     * })
     * </pre>
     * 
     * Really though, you'll use views to set up multiple views:
     * <pre>
     * <div ui-view></div>
     * <div ui-view="chart"></div> 
     * <div ui-view="data"></div> 
     * </pre>
     * 
     * <pre>
     * $stateProvider.state("home", {
     *   views: {
     *     "": {
     *       template: "<h1>HELLO!</h1>"
     *     },
     *     "chart": {
     *       template: "<chart_thing/>"
     *     },
     *     "data": {
     *       template: "<data_thing/>"
     *     }
     *   }    
     * })
     * </pre>
     *
     * Examples for `autoscroll`:
     *
     * <pre>
     * <!-- If autoscroll present with no expression,
     *      then scroll ui-view into view -->
     * <ui-view autoscroll/>
     *
     * <!-- If autoscroll present with valid expression,
     *      then scroll ui-view into view if expression evaluates to true -->
     * <ui-view autoscroll='true'/>
     * <ui-view autoscroll='false'/>
     * <ui-view autoscroll='scopeVariable'/>
     * </pre>
     */
    $ViewDirective.$inject = ['$state', '$injector', '$uiViewScroll'];
    function $ViewDirective($state, $injector, $uiViewScroll) {

        function getService() {
            return ($injector.has) ? function (service) {
                return $injector.has(service) ? $injector.get(service) : null;
            } : function (service) {
                try {
                    return $injector.get(service);
                } catch (e) {
                    return null;
                }
            };
        }

        var service = getService(),
            $animator = service('$animator'),
            $animate = service('$animate');

        // Returns a set of DOM manipulation functions based on which Angular version
        // it should use
        function getRenderer(attrs, scope) {
            var statics = function () {
                return {
                    enter: function (element, target, cb) { target.after(element); cb(); },
                    leave: function (element, cb) { element.remove(); cb(); }
                };
            };

            if ($animate) {
                return {
                    enter: function (element, target, cb) { $animate.enter(element, null, target, cb); },
                    leave: function (element, cb) { $animate.leave(element, cb); }
                };
            }

            if ($animator) {
                var animate = $animator && $animator(scope, attrs);

                return {
                    enter: function (element, target, cb) { animate.enter(element, null, target); cb(); },
                    leave: function (element, cb) { animate.leave(element); cb(); }
                };
            }

            return statics();
        }

        var directive = {
            restrict: 'ECA',
            terminal: true,
            priority: 400,
            transclude: 'element',
            compile: function (tElement, tAttrs, $transclude) {
                return function (scope, $element, attrs) {
                    var previousEl, currentEl, currentScope, latestLocals,
                        onloadExp = attrs.onload || '',
                        autoScrollExp = attrs.autoscroll,
                        renderer = getRenderer(attrs, scope);

                    scope.$on('$stateChangeSuccess', function () {
                        updateView(false);
                    });
                    scope.$on('$viewContentLoading', function () {
                        updateView(false);
                    });

                    updateView(true);

                    function cleanupLastView() {
                        if (previousEl) {
                            previousEl.remove();
                            previousEl = null;
                        }

                        if (currentScope) {
                            currentScope.$destroy();
                            currentScope = null;
                        }

                        if (currentEl) {
                            renderer.leave(currentEl, function () {
                                previousEl = null;
                            });

                            previousEl = currentEl;
                            currentEl = null;
                        }
                    }

                    function updateView(firstTime) {
                        var newScope,
                            name = getUiViewName(attrs, $element.inheritedData('$uiView')),
                            previousLocals = name && $state.$current && $state.$current.locals[name];

                        if (!firstTime && previousLocals === latestLocals) return; // nothing to do
                        newScope = scope.$new();
                        latestLocals = $state.$current.locals[name];

                        var clone = $transclude(newScope, function (clone) {
                            renderer.enter(clone, $element, function onUiViewEnter() {
                                if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) {
                                    $uiViewScroll(clone);
                                }
                            });
                            cleanupLastView();
                        });

                        currentEl = clone;
                        currentScope = newScope;
                        /**
                         * @ngdoc event
                         * @name ui.router.state.directive:ui-view#$viewContentLoaded
                         * @eventOf ui.router.state.directive:ui-view
                         * @eventType emits on ui-view directive scope
                         * @description           *
                         * Fired once the view is **loaded**, *after* the DOM is rendered.
                         *
                         * @param {Object} event Event object.
                         */
                        currentScope.$emit('$viewContentLoaded');
                        currentScope.$eval(onloadExp);
                    }
                };
            }
        };

        return directive;
    }

    $ViewDirectiveFill.$inject = ['$compile', '$controller', '$state'];
    function $ViewDirectiveFill($compile, $controller, $state) {
        return {
            restrict: 'ECA',
            priority: -400,
            compile: function (tElement) {
                var initial = tElement.html();
                return function (scope, $element, attrs) {
                    var current = $state.$current,
                        name = getUiViewName(attrs, $element.inheritedData('$uiView')),
                        locals = current && current.locals[name];

                    if (!locals) {
                        return;
                    }

                    $element.data('$uiView', { name: name, state: locals.$$state });
                    $element.html(locals.$template ? locals.$template : initial);

                    var link = $compile($element.contents());

                    if (locals.$$controller) {
                        locals.$scope = scope;
                        var controller = $controller(locals.$$controller, locals);
                        if (locals.$$controllerAs) {
                            scope[locals.$$controllerAs] = controller;
                        }
                        $element.data('$ngControllerController', controller);
                        $element.children().data('$ngControllerController', controller);
                    }

                    link(scope);
                };
            }
        };
    }

    /**
     * Shared ui-view code for both directives:
     * Given attributes and inherited $uiView data, return the view's name
     */
    function getUiViewName(attrs, inherited) {
        var name = attrs.uiView || attrs.name || '';
        return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));
    }

    angular.module('ui.router.state').directive('uiView', $ViewDirective);
    angular.module('ui.router.state').directive('uiView', $ViewDirectiveFill);

    function parseStateRef(ref, current) {
        var preparsed = ref.match(/^\s*({[^}]*})\s*$/), parsed;
        if (preparsed) ref = current + '(' + preparsed[1] + ')';
        parsed = ref.replace(/\n/g, " ").match(/^([^(]+?)\s*(\((.*)\))?$/);
        if (!parsed || parsed.length !== 4) throw new Error("Invalid state ref '" + ref + "'");
        return { state: parsed[1], paramExpr: parsed[3] || null };
    }

    function stateContext(el) {
        var stateData = el.parent().inheritedData('$uiView');

        if (stateData && stateData.state && stateData.state.name) {
            return stateData.state;
        }
    }

    /**
     * @ngdoc directive
     * @name ui.router.state.directive:ui-sref
     *
     * @requires ui.router.state.$state
     * @requires $timeout
     *
     * @restrict A
     *
     * @description
     * A directive that binds a link (`<a>` tag) to a state. If the state has an associated 
     * URL, the directive will automatically generate & update the `href` attribute via 
     * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking 
     * the link will trigger a state transition with optional parameters. 
     *
     * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be 
     * handled natively by the browser.
     *
     * You can also use relative state paths within ui-sref, just like the relative 
     * paths passed to `$state.go()`. You just need to be aware that the path is relative
     * to the state that the link lives in, in other words the state that loaded the 
     * template containing the link.
     *
     * You can specify options to pass to {@link ui.router.state.$state#go $state.go()}
     * using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`,
     * and `reload`.
     *
     * @example
     * Here's an example of how you'd use ui-sref and how it would compile. If you have the 
     * following template:
     * <pre>
     * <a ui-sref="home">Home</a> | <a ui-sref="about">About</a> | <a ui-sref="{page: 2}">Next page</a>
     * 
     * <ul>
     *     <li ng-repeat="contact in contacts">
     *         <a ui-sref="contacts.detail({ id: contact.id })">{{ contact.name }}</a>
     *     </li>
     * </ul>
     * </pre>
     * 
     * Then the compiled html would be (assuming Html5Mode is off and current state is contacts):
     * <pre>
     * <a href="#/home" ui-sref="home">Home</a> | <a href="#/about" ui-sref="about">About</a> | <a href="#/contacts?page=2" ui-sref="{page: 2}">Next page</a>
     * 
     * <ul>
     *     <li ng-repeat="contact in contacts">
     *         <a href="#/contacts/1" ui-sref="contacts.detail({ id: contact.id })">Joe</a>
     *     </li>
     *     <li ng-repeat="contact in contacts">
     *         <a href="#/contacts/2" ui-sref="contacts.detail({ id: contact.id })">Alice</a>
     *     </li>
     *     <li ng-repeat="contact in contacts">
     *         <a href="#/contacts/3" ui-sref="contacts.detail({ id: contact.id })">Bob</a>
     *     </li>
     * </ul>
     *
     * <a ui-sref="home" ui-sref-opts="{reload: true}">Home</a>
     * </pre>
     *
     * @param {string} ui-sref 'stateName' can be any valid absolute or relative state
     * @param {Object} ui-sref-opts options to pass to {@link ui.router.state.$state#go $state.go()}
     */
    $StateRefDirective.$inject = ['$state', '$timeout'];
    function $StateRefDirective($state, $timeout) {
        var allowedOptions = ['location', 'inherit', 'reload'];

        return {
            restrict: 'A',
            require: ['?^uiSrefActive', '?^uiSrefActiveEq'],
            link: function (scope, element, attrs, uiSrefActive) {
                var ref = parseStateRef(attrs.uiSref, $state.current.name);
                var params = null, url = null, base = stateContext(element) || $state.$current;
                var isForm = element[0].nodeName === "FORM";
                var attr = isForm ? "action" : "href", nav = true;

                var options = { relative: base, inherit: true };
                var optionsOverride = scope.$eval(attrs.uiSrefOpts) || {};

                angular.forEach(allowedOptions, function (option) {
                    if (option in optionsOverride) {
                        options[option] = optionsOverride[option];
                    }
                });

                var update = function (newVal) {
                    if (newVal) params = newVal;
                    if (!nav) return;

                    var newHref = $state.href(ref.state, params, options);

                    var activeDirective = uiSrefActive[1] || uiSrefActive[0];
                    if (activeDirective) {
                        activeDirective.$$setStateInfo(ref.state, params);
                    }
                    if (newHref === null) {
                        nav = false;
                        return false;
                    }
                    element[0][attr] = newHref;
                };

                if (ref.paramExpr) {
                    scope.$watch(ref.paramExpr, function (newVal, oldVal) {
                        if (newVal !== params) update(newVal);
                    }, true);
                    params = scope.$eval(ref.paramExpr);
                }
                update();

                if (isForm) return;

                element.bind("click", function (e) {
                    var button = e.which || e.button;
                    if (!(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || element.attr('target'))) {
                        // HACK: This is to allow ng-clicks to be processed before the transition is initiated:
                        var transition = $timeout(function () {
                            $state.go(ref.state, params, options);
                        });
                        e.preventDefault();

                        e.preventDefault = function () {
                            $timeout.cancel(transition);
                        };
                    }
                });
            }
        };
    }

    /**
     * @ngdoc directive
     * @name ui.router.state.directive:ui-sref-active
     *
     * @requires ui.router.state.$state
     * @requires ui.router.state.$stateParams
     * @requires $interpolate
     *
     * @restrict A
     *
     * @description
     * A directive working alongside ui-sref to add classes to an element when the
     * related ui-sref directive's state is active, and removing them when it is inactive.
     * The primary use-case is to simplify the special appearance of navigation menus
     * relying on `ui-sref`, by having the "active" state's menu button appear different,
     * distinguishing it from the inactive menu items.
     *
     * ui-sref-active can live on the same element as ui-sref or on a parent element. The first
     * ui-sref-active found at the same level or above the ui-sref will be used.
     *
     * Will activate when the ui-sref's target state or any child state is active. If you
     * need to activate only when the ui-sref target state is active and *not* any of
     * it's children, then you will use
     * {@link ui.router.state.directive:ui-sref-active-eq ui-sref-active-eq}
     *
     * @example
     * Given the following template:
     * <pre>
     * <ul>
     *   <li ui-sref-active="active" class="item">
     *     <a href ui-sref="app.user({user: 'bilbobaggins'})">@bilbobaggins</a>
     *   </li>
     * </ul>
     * </pre>
     *
     *
     * When the app state is "app.user" (or any children states), and contains the state parameter "user" with value "bilbobaggins",
     * the resulting HTML will appear as (note the 'active' class):
     * <pre>
     * <ul>
     *   <li ui-sref-active="active" class="item active">
     *     <a ui-sref="app.user({user: 'bilbobaggins'})" href="/users/bilbobaggins">@bilbobaggins</a>
     *   </li>
     * </ul>
     * </pre>
     *
     * The class name is interpolated **once** during the directives link time (any further changes to the
     * interpolated value are ignored).
     *
     * Multiple classes may be specified in a space-separated format:
     * <pre>
     * <ul>
     *   <li ui-sref-active='class1 class2 class3'>
     *     <a ui-sref="app.user">link</a>
     *   </li>
     * </ul>
     * </pre>
     */

    /**
     * @ngdoc directive
     * @name ui.router.state.directive:ui-sref-active-eq
     *
     * @requires ui.router.state.$state
     * @requires ui.router.state.$stateParams
     * @requires $interpolate
     *
     * @restrict A
     *
     * @description
     * The same as {@link ui.router.state.directive:ui-sref-active ui-sref-active} but will will only activate
     * when the exact target state used in the `ui-sref` is active; no child states.
     *
     */
    $StateRefActiveDirective.$inject = ['$state', '$stateParams', '$interpolate'];
    function $StateRefActiveDirective($state, $stateParams, $interpolate) {
        return {
            restrict: "A",
            controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {
                var state, params, activeClass;

                // There probably isn't much point in $observing this
                // uiSrefActive and uiSrefActiveEq share the same directive object with some
                // slight difference in logic routing
                activeClass = $interpolate($attrs.uiSrefActiveEq || $attrs.uiSrefActive || '', false)($scope);

                // Allow uiSref to communicate with uiSrefActive[Equals]
                this.$$setStateInfo = function (newState, newParams) {
                    state = $state.get(newState, stateContext($element));
                    params = newParams;
                    update();
                };

                $scope.$on('$stateChangeSuccess', update);

                // Update route state
                function update() {
                    if (isMatch()) {
                        $element.addClass(activeClass);
                    } else {
                        $element.removeClass(activeClass);
                    }
                }

                function isMatch() {
                    if (typeof $attrs.uiSrefActiveEq !== 'undefined') {
                        return $state.$current.self === state && matchesParams();
                    } else {
                        return $state.includes(state.name) && matchesParams();
                    }
                }

                function matchesParams() {
                    return !params || equalForKeys(params, $stateParams);
                }
            }]
        };
    }

    angular.module('ui.router.state')
      .directive('uiSref', $StateRefDirective)
      .directive('uiSrefActive', $StateRefActiveDirective)
      .directive('uiSrefActiveEq', $StateRefActiveDirective);

    /**
     * @ngdoc filter
     * @name ui.router.state.filter:isState
     *
     * @requires ui.router.state.$state
     *
     * @description
     * Translates to {@link ui.router.state.$state#methods_is $state.is("stateName")}.
     */
    $IsStateFilter.$inject = ['$state'];
    function $IsStateFilter($state) {
        return function (state) {
            return $state.is(state);
        };
    }

    /**
     * @ngdoc filter
     * @name ui.router.state.filter:includedByState
     *
     * @requires ui.router.state.$state
     *
     * @description
     * Translates to {@link ui.router.state.$state#methods_includes $state.includes('fullOrPartialStateName')}.
     */
    $IncludedByStateFilter.$inject = ['$state'];
    function $IncludedByStateFilter($state) {
        return function (state) {
            return $state.includes(state);
        };
    }

    angular.module('ui.router.state')
      .filter('isState', $IsStateFilter)
      .filter('includedByState', $IncludedByStateFilter);
})(window, window.angular);;
var app = angular.module('app', [
    // Angular modules 
    'ngAnimate',        // animations
    'ngRoute',          // routing
    'ngSanitize',       // sanitizes html bindings (ex: sidebar.js)
    'common',          //Common Configuration for logger
    'ui.sortable',       //Drag-Drop List
    'ui.bootstrap',      //BootStrap Controls // disabled 'ui.bootstrap.dropdownToggle' for conflict of multiselect dropdown
    'bootstrap-tagsinput', //Tag input Control
    'ui.multiselect',     //Multi Select Control    
    'datePicker',         //DateTime Picker Control
    'angularFileUpload', // file upload control
    'ui.bootstrap.modalSlider', //Modal Slider Control
    'colorpicker.module',
    'angularSpinner', //Spinner/Loader
    'gettext', //Multilingual
    'ngCookies', //Cookies
    'unsavedChanges', //For UnSaved Changes
    'ui.router', // UI routing.
    'ngTagsInput',
    'LocalStorageModule',
    'infinite-scroll',
    'ui.multiselect.ns',
    'viewhead',
    'ngIdle',
    'isoCurrency' // Currency Filter With ISO Code
]);

// Configure Toastr
toastr.options.timeOut = 4000;
toastr.options.positionClass = 'toast-bottom-right';

app.value('$', $);

//App configuration
app.config(['$httpProvider', '$locationProvider', 'unsavedWarningsConfigProvider', '$provide', function ($httpProvider, $locationProvider, unsavedWarningsConfigProvider, $provide) {
    //$locationProvider.html5Mode(true);
    $httpProvider.interceptors.push('httpInterceptor');

    if (IsNotNullorEmpty(window.crm.constants.connectAPIIntercepterFlag) && window.crm.constants.connectAPIIntercepterFlag == 'true') {
        $httpProvider.interceptors.push('httpRequestInterceptor');
    }

    unsavedWarningsConfigProvider.useTranslateService = false;
    $provide.decorator('$sniffer', ['$delegate', function ($sniffer) {
        var msie = parseInt((/msie (\d+)/.exec(angular.lowercase(navigator.userAgent)) || [])[1], 10);
        var _hasEvent = $sniffer.hasEvent;
        $sniffer.hasEvent = function (event) {
            if (event === 'input' && msie > 10) {
                return false;
            }
            _hasEvent.call(this, event);
        };
        return $sniffer;
    }])
}]);

//Global Variable
var ClientHomeCurrencyCode = '';
var EnableMultiCurrencyProcessing = '';
var CartId = '';
var GuestContact = { FirstName: "", LastName: "", Email: "", CheckoutAs: "", GuestOrganization: {} };

app.run(["$rootScope", "gettextCatalog", "LocaleService", "$location", "UnsettledInvoiceSvc", "UserSettingSvc", "ClientFinancialSettingSvc", "PageCartSvc",
    function ($rootScope, gettextCatalog, LocaleService, $location, UnsettledInvoiceSvc, UserSettingSvc, ClientFinancialSettingSvc, PageCartSvc) {
        $rootScope.pageId = { Add: 'A', View: 'V', Other: 'O' };
        $rootScope.version = window.crm.constants.version;
        gettextCatalog.currentLanguage = window.crm.constants.culture;
        LocaleService.useLocale(window.crm.constants.culture, 'Common');

        //gettextCatalog.debug = true;
        //
        //$rootScope.$on('$routeChangeStart', function (ev, next, current) {
        //    var permission = next.$$route.permission;
        //    if (_.isString(permission) && !LocaleService.hasPermission(permission))
        //        $location.path('/');
        //});

        if (window.crm.constants.IsPublicPage !== true) {
            ClientFinancialSettingSvc.get().then(function (res) {
                ClientHomeCurrencyCode = res.data.Currency;
                EnableMultiCurrencyProcessing = res.data.EnableMultiCurrencyProcessing;
            });
        }

        CartId = PageCartSvc.GetCurrentCartId();

        GuestContact = PageCartSvc.GetCurrentGuestContact();
    }]);

app.run(
    ['$rootScope', '$state', '$stateParams',
        function ($rootScope, $state, $stateParams) {

            // It's very handy to add references to $state and $stateParams to the $rootScope
            // so that you can access them from any scope within your applications.For example,
            // <li ui-sref-active="active }"> will set the <li> // to active whenever
            // 'contacts.list' or one of its decendents is active.
            $rootScope.$state = $state;
            $rootScope.$stateParams = $stateParams;
        }
    ]
);
app.run(["$rootScope", function ($rootScope) { }]);

/*Javascript Error Handler*/
app.factory('$exceptionHandler', function () {
    return function (exception, cause) {
        var formatted = '';
        var properties = '';
        formatted += 'CRM Exception:\n';
        formatted += 'Caused by: ' + cause + '\n';
        properties += (exception.message) ? 'Message: ' + exception.message + '\n' : ''
        properties += (exception.fileName) ? 'File Name: ' + exception.fileName + '\n' : ''
        properties += (exception.lineNumber) ? 'Line Number: ' + exception.lineNumber + '\n' : ''
        properties += (exception.stack) ? 'Stack Trace: ' + exception.stack + '\n' : ''
        if (properties) {
            formatted += properties;
        }
        console.error(formatted);
    };
});


app.service('UnsettledInvoiceSvc', ["$q", "$resource", "common", function ($q, $resource, common) {
    var url = '/api/Financial/Invoice';
    //var promise = {
    return {
        GetUnsettledInvoiceCount: function () {
            return common.$http.get(url + "/GetUnsettledInvoiceCount");
        }
    }
    //}
    //return promise;
}]);

app.service('ClientFinancialSettingSvc', ["$q", "$resource", "common", function ($q, $resource, common) {
    var url = '/api/Setting/Finance';
    var financialSettingService;

    if (typeof (serviceBase) != 'undefined') {
        financialSettingService = serviceBase;
    }

    if (typeof (APIBasePath) != 'undefined') {
        if (IsNotNullorEmpty(financialSettingService)) {
            url = financialSettingService + 'api/FinancialSetting';
        }
    }

    return {
        get: function () {
            return common.$http.get(url);
        }
    }
}]);

app.service('PageCartSvc', ["$q", "$resource", "common", "localStorageService", function ($q, $resource, common, localStorageService) {
    return {
        GetCurrentCartId: function () {
            var cartKey = 'GuestCartId' + String(window.crm.constants.client);
            var cartId = localStorageService.get(cartKey);
            return cartId;
        },
        SetCartId: function (cartId) {
            var cartKey = 'GuestCartId' + String(window.crm.constants.client);
            localStorageService.set(cartKey, cartId);
        },
        ClearCartId: function () {
            var cartKey = 'GuestCartId' + String(window.crm.constants.client);
            localStorageService.remove(cartKey);
        },

        GetCurrentGuestContact: function () {
            var guestContactKey = 'GuestContact' + String(window.crm.constants.client);
            var guestContact = localStorageService.get(guestContactKey);
            return guestContact;
        },
        SetGuestContact: function (guestContact) {
            var guestContactKey = 'GuestContact' + String(window.crm.constants.client);
            localStorageService.set(guestContactKey, guestContact);
        },
        ClearGuestContact: function () {
            var guestContactKey = 'GuestContact' + String(window.crm.constants.client);
            localStorageService.remove(guestContactKey);
        },

        SetTempRelationId: function (id) {
            var relationKey = 'GuestRelationId' + String(window.crm.constants.client);
            localStorageService.set(relationKey, id);
        },
        GetTempRelationId: function () {
            var relationKey = 'GuestRelationId' + String(window.crm.constants.client);
            var relationId = localStorageService.get(relationKey);
            return relationId;
        },
        ClearTempRelationId: function () {
            var relationKey = 'GuestRelationId' + String(window.crm.constants.client);
            localStorageService.remove(relationKey);
        },

        //Membership message
        GetMessageAlert: function () {
            var msgKey = 'MessageAlert' + String(window.crm.constants.client);
            var msgKeyValue = sessionStorage.getItem(msgKey);
            return msgKeyValue;
        },
        SetMessageAlert: function (msgKeyValue) {
            var msgKey = 'MessageAlert' + String(window.crm.constants.client);
            sessionStorage.setItem(msgKey, msgKeyValue);
        },
    }
}]);


//Local Service for language translation
app.service('LocaleService', ['$q', '$resource', 'gettextCatalog', 'UserSettingSvc', 'common', function ($q, $resource, gettextCatalog, UserSettingSvc, common) {
    var self = {
        useLocale: function (language, area) {
            var path = '/Resources/' + area + '_' + language + '.json?v=' + window.crm.constants.version;
            var ssid = area + '_' + language;

            var defer = $q.defer();

            //if (sessionStorage) {
            //    if (sessionStorage.getItem(ssid)) {
            //        translation = JSON.parse(sessionStorage.getItem(ssid));
            //        gettextCatalog.currentLanguage = language;
            //        gettextCatalog.setStrings(language, translation);

            //        defer.resolve(translation);
            //    } else {
            //        $resource(path).get(function (translation) {
            //            gettextCatalog.currentLanguage = language;
            //            gettextCatalog.setStrings(language, translation);

            //            sessionStorage.setItem(ssid, JSON.stringify(translation));
            //            defer.resolve(translation);
            //        });
            //    };
            //}
            //else {
            $resource(path).get(function (translation) {
                gettextCatalog.currentLanguage = language;
                gettextCatalog.setStrings(language, translation);
                defer.resolve(translation);
            }, function () {
                language = 'en-US';
                var path = '/Resources/' + area + '_' + language + '.json';

                $resource(path).get(function (translation) {
                    gettextCatalog.currentLanguage = language;
                    gettextCatalog.setStrings(language, translation);
                    defer.resolve(translation);
                })
            });
            //}

            return defer.promise;
        },
        hasPermission: function (permission) {
            return false;
        },
        SaveUserVisitHistory: function (type, title) {
            //UserSettingSvc.SaveUserVisitHistory({ LinkName: linkName, LinkUrl: currentRequestUrl + "#" + common.$location.path() }).then(function (res) {
            linkname = breadcumType[type];
            if (IsNotNullorEmpty(title))
                linkname += ' - ' + title;

            UserSettingSvc.SaveUserVisitHistory({ LinkName: linkname, LinkUrl: common.$location.absUrl() }).then(function (res) {
            });
        }
    };

    return self;
}]);


var modalQuickFormInstance = ["$scope", "$modalInstance", function ($scope, $modalInstance) {
    $scope.CloseQuickForm = function () {
        $modalInstance.dismiss('cancel');
    }
}];

var modalSwitchContractInstance = ["$scope", "$modalInstance", "ClientNotification", "IsAdminUser",
    function ($scope, $modalInstance, ClientNotification, IsAdminUser) {

        $scope.Notification = {};
        $scope.IsAdminNotification = false;

        $scope.InitNotification = function () {
            $scope.Notification = ClientNotification;
            $scope.IsAdminNotification = (IsAdminUser === "True" || IsAdminUser === "true" || IsAdminUser === true) ? true : false;

        }

        $scope.CloseSwitchContractForm = function () {
            $modalInstance.dismiss('cancel');
        }

        $scope.GoToSwitchContract = function () {
            window.location.href = window.crm.constants.accountBaseUrl + "/MyAccount/ChangePlan?product=1";
        }

        $scope.InitNotification();

    }];

app.controller('MakedefaultCntrl', ['$scope', 'UserSettingSvc', '$window', 'aaNotify',
    function ($scope, UserSettingSvc, $window, aaNotify) {
        $scope.SetDefaultPage = function () {
            UserSettingSvc.saveUserSetting($window.location.pathname + $window.location.hash, 'DefaultPage').then(function (data) {
                aaNotify.success(data.data.Message.Description);
            });
        };
    }]);


/********** Start Account Logout Process **********/

app.service('UserSessionIdealModeSvc', ["$q", "$resource", "common", function ($q, $resource, common) {
    var urlCore = '/api/UserSetting';

    return {
        getUserSessionIdealTimeStatus: function () {
            return common.$http({
                url: urlCore + '/GetUserSessionIdealTimeStatus',
                method: "Get"
            });
        },
        updateUserSessionIdealTime: function () {
            return common.$http({
                url: urlCore + '/UpdateUserSessionIdealTime',
                method: "Post"
            });
        }
    }
}]);


app.controller('UserSessionIdealModeCtrl', ['$scope', '$modal', 'UserSessionIdealModeSvc', 'Idle', function ($scope, $modal, UserSessionIdealModeSvc, Idle) {
    $scope.idle = 60 * 40; // in seconds (default is 40 min)
    $scope.timeout = 60 * 5; // in seconds (default is 5 min)
    $scope.logoutTime = '5:00';

    $scope.initSessionIdealMode = function () {

    };

    $scope.$on('IdleStart', function () {
        closeSessionIdealModals();

        $scope.idealModeWarning = $modal.open({
            templateUrl: '/App_Client/views/SessionTimeoutWarning.html',
            keyboard: false,
            backdrop: 'static',
            scope: $scope,
            sizeclass: 'modal-small'
        });

    });

    $scope.$on('IdleEnd', function () {
        closeSessionIdealModals();
    });

    $scope.$on('IdleWarn', function (e, countdown) {
        var remainingTime = {};
        remainingTime.minutes = Math.floor(countdown / 60);
        remainingTime.seconds = padLeft(countdown - remainingTime.minutes * 60, 2);

        $scope.logoutTime = remainingTime.minutes + ':' + remainingTime.seconds;
    });

    function padLeft(nr, n, str) {
        return new Array(n - String(nr).length + 1).join(str || '0') + nr;
    }

    $scope.$on('IdleTimeout', function () {
        closeSessionIdealModals();
        document.getElementById('logoutForm').submit();

    });

    $scope.$on('Keepalive', function () {
        UserSessionIdealModeSvc.updateUserSessionIdealTime().then(function (res) {

        });
    });

    $scope.$watch('idle', function (value) {
        if (value !== null)
            Idle.setIdle(value);
    });

    $scope.$watch('timeout', function (value) {
        if (value !== null)
            Idle.setTimeout(value);
    });

    function closeSessionIdealModals() {
        if ($scope.idealModeWarning) {
            $scope.idealModeWarning.close();
            $scope.idealModeWarning = null;
        }
    }

    $scope.initSessionIdealMode();

}]);

app.config(["IdleProvider", "KeepaliveProvider", function (IdleProvider, KeepaliveProvider) {
    KeepaliveProvider.interval(300); // Set Interval in Second
    IdleProvider.windowInterrupt('focus');
}]);

app.run(["$rootScope", "Idle", "$log", "Keepalive", function ($rootScope, Idle, $log, Keepalive) {
    Idle.watch();
}]);



app.service('httpRequestInterceptor', ['UserAuthService', '$rootScope', function (UserAuthService, $rootScope) {
    var service = this;
    service.request = function (config) {
        //debugger;
        var access_token = UserAuthService.getAccessToken();
        var apiKey = null;
        if (apiKey == null)
            apiKey = UserAuthService.getApiKey();

        if (access_token) {
            config.headers.Authorization = 'Bearer ' + access_token;
        }

        if (apiKey) {

            config.headers["ApiKey"] = apiKey;
        }
        return config;
    };
}]);
/********** End Account Logout Process **********/

//main layout controller
app.controller("mainLayoutController", ['$scope', 'common', 'QuickContactSearchSvc', 'UserSettingSvc', 'LookupSvc', '$modal', '$rootScope', '$location', 'UnsettledInvoiceSvc', '$timeout', function ($scope, common, QuickContactSearchSvc, UserSettingSvc, LookupSvc, $modal, $rootScope, $location, UnsettledInvoiceSvc, $timeout) {
    //min max naviation property
    if (getCookie("mainLayoutController") == 'true') {
        $scope.minMaxNav = true;
    } else {
        $scope.minMaxNav = false;
    }
    $scope.setCookie = function () {
        $scope.minMaxNav = !$scope.minMaxNav;
        setCookie("mainLayoutController", $scope.minMaxNav, 1);
    }
    $scope.$watch("minMaxNav", function (n) {
        $scope.$broadcast("navChanged", { min: !n });
        if (typeof (n) !== undefined) {
            setTimeout(function () {
                globalVariable.resetLeftNavScroll("#leftNav > #moduleNav");
            }, 100)
        }
    });

    $scope.setTheme = function (arg) {
        //gmTheme required refesh the page 
        common.usSpinnerService.spin("mainWrapper");
        UserSettingSvc.saveUserTheme(arg).then(function () {
            window.location.reload();
        });
        //$("body").removeClass("darkTheme").removeClass("blueTheme").removeClass("burgundyTheme").removeClass("gmTheme");
        //$('body').addClass(arg);
    }

    // choose contact section show hide 
    var qsTitle = 'Recent';
    $scope.quickSearchTitle = qsTitle;
    $scope.activeChooseContactTab = 'recent';
    $scope.showQuickblock = function (param) {
        $scope.activeChooseContactTab = param;
    }
    // get contact details and show contact block
    $scope.selectedViewContact = {};
    $scope.showContactDetails = function (contact) {
        QuickContactSearchSvc.quickContactView(contact.ContactId).then(function (res) {
            common.usSpinnerService.spin("contactDetailContainer");
            if (!IsNotNullorEmpty(res.data.ErrorText) && res.status == 200) {
                $scope.selectedViewContact = angular.extend(contact, res.data.Result);
                // show box when all data loaded 
                $scope.activeChooseContactTab = 'details';
                common.usSpinnerService.stop("contactDetailContainer");
            } else {
                common.usSpinnerService.stop("contactDetailContainer");
                common.aaNotify.error(res.data.ErrorText);
                $scope.activeChooseContactTab = 'recent';

            };
        })

    }



    $scope.msgdisp = true;
    var Init = function () {

        if (window.crm.constants.ShowContractSwitchOption != undefined && window.crm.constants.ShowContractSwitchOption != null && window.crm.constants.ShowContractSwitchOption.NotificationId > 0) {
            //Show Popup
            $scope.OpenSwitchContractPopup(window.crm.constants.ShowContractSwitchOption, window.crm.constants.IsAdminUser);
        }

        $scope.QuickContact = { IndividualSetting: '', OrganizationSetting: '', IndividualSearchText: '', OrganizationSearchText: '' };
        LookupSvc.getQuickSearchIndividualSetting().$promise.then(function (data) {
            $scope.IndividualSetting = KeyValueToArray(data);
        });
        LookupSvc.getQuickSearchOrganizationSetting().$promise.then(function (data) {
            $scope.OrganizationSetting = KeyValueToArray(data);
        });
        UserSettingSvc.GetQuickContactSearchSetting().then(function (res) {
            $scope.QuickContact = res.data;
        });
    }

    $scope.OpenSwitchContractPopup = function (clientNotification, IsAdminUser) {
        var modalSwitchContractForm = $modal.open({
            templateUrl: '/App_Client/views/SwitchContract.html?v=' + window.crm.constants.version,
            controller: modalSwitchContractInstance,
            keyboard: true,
            backdrop: true,
            sizeclass: 'modal-md',
            scope: $scope,
            resolve: {
                ClientNotification: function () {
                    return clientNotification;
                },
                IsAdminUser: function () {
                    return IsAdminUser;
                }
            }
        });
        modalSwitchContractForm.result.then(function () {
        }, function () {
        });
    };

    $scope.OpenPromoPage = function () {
        var modalPrmoForm = $modal.open({
            templateUrl: '/App_Client/views/PromoPage.html?v=' + window.crm.constants.version,
            controller: modalPromoPageInstance,
            keyboard: true,
            backdrop: true,
            sizeclass: 'modal-lg',
            scope: $scope,
            resolve: {
            }
        });
        modalPrmoForm.result.then(function () {
        }, function () {
        });
    };

    $scope.quickContactSearchBtn = function () {
        $scope.msgdisp = false;
        if (IsNullorEmpty($scope.QuickContact.IndividualSearchText) && IsNullorEmpty($scope.QuickContact.OrganizationSearchText)) {
            $scope.msgdisp = false;
            return;
        }
        else {
            $scope.msgdisp = true;
        }
        if (IsNotNullorEmpty($scope.QuickContact.IndividualSearchText) && IsNotNullorEmpty($scope.QuickContact.OrganizationSearchText)) {
            common.aaNotify.error('This would trigger individual conact search only.');
        }
        QuickContactSearchSvc.saveQuickContactSearch($scope.QuickContact).then(function (res) {
            //$location.path('/ContactManagement/AdvanceSearch/Index');
            if ($location.path().indexOf('/personalinfo') >= 0)
                window.location.href = '/ContactManagement/List/Index/' + res.data.SearchId + '/' + $rootScope.pageId.Add;
            else if ($location.path().indexOf('/View/') >= 0)
                window.location.href = '/ContactManagement/List/Index/' + res.data.SearchId + '/' + $rootScope.pageId.View;
            else
                window.location.href = '/ContactManagement/List/Index/' + res.data.SearchId + '/' + $rootScope.pageId.View;

        });
    }
    $scope.onquickcontactselect = function ($item, $model, $label) {
        if ($item.ContactId != null && $item.ContactId > 0) {
            if ($item.GroupType == 'I') {
                window.location.href = "/ContactManagement/Individual/Details/#/view/" + $item.ContactId;
            }
            else {
                window.location.href = "/ContactManagement/Organization/Details/#/view/" + $item.ContactId;
            }
        }
    };
    $scope.AdvanceSearch = function () {
        $scope.PopupOpen = true;
        if ($scope.PopupOpen) {
            var modalInstance = $modal.open({
                templateUrl: '/App_Client/views/ContactManagement/Browse/BrowseContact.html?v=' + window.crm.constants.version,
                controller: "BrowseContactCtrl",
                sizeclass: 'modal-full',
                scope: $scope,
                keyboard: true,
                backdrop: false,
                resolve: {
                }
            });
            modalInstance.result.then(function () {
                $scope.PopupOpen = false;
                // window.location.reload(true);
                //init();
                //close
            }, function () {//cancel

                $scope.PopupOpen = false;
            });
        }
    };
    //quick navigation
    $scope.SetQuickForm = function (page) {
        $scope.OpenQuickFormDialog(page);
    }
    $scope.OpenQuickFormDialog = function (templateURL) {
        var modalQuickForm = $modal.open({
            templateUrl: templateURL + '?v=' + window.crm.constants.version,
            controller: modalQuickFormInstance,
            keyboard: true,
            backdrop: true,
            sizeclass: 'modal-full',
            scope: $scope
        });
    };
    // recent visites
    $scope.recentsVisits = [];
    UserSettingSvc.GetUserVisitHistory().then(function (res) {
        $scope.recentsVisits = res.data;
    });

    //unsettled invoice count
    // This code is commented due to we are not showing unsettled invoice count over UI so code block is not required anymore. IQR_DHC_11/20/2018.
    //$rootScope.UnsettledInvoiceCount = null;
    //UnsettledInvoiceSvc.GetUnsettledInvoiceCount().then(function (res) {
    //    $rootScope.UnsettledInvoiceCount = res.data;
    //});

    //get recent contact
    $rootScope.TopLevelRecentContacts = [];
    var storeRecentContact = [];
    UserSettingSvc.getRecentContact().then(function (res) {
        storeRecentContact = res.data
        $rootScope.TopLevelRecentContacts = storeRecentContact;
    });

    var keyPressingTimeout;
    $("#quickContactSearch").keyup(function (e) {
        if (e.keyCode == 13) {
            if ($rootScope.TopLevelRecentContacts.length > 0) {
                var firstContact = $rootScope.TopLevelRecentContacts[0];
                if (firstContact.GroupType == 'I') {
                    window.location.href = "/ContactManagement/Individual/Details/#/view/" + firstContact.ContactId;

                } else {
                    window.location.href = "/ContactManagement/Organization/Details/#/view/" + firstContact.ContactId;

                }
                $("#quick-contact").removeClass("open");
            }
        } else if (e.keyCode == 27) {
            //"Escape" key logic can be add here.
        } else {
            var n = $("#quickContactSearch").val();
            $timeout.cancel(keyPressingTimeout);
            keyPressingTimeout = $timeout(function () {
                $scope.activeChooseContactTab = 'recent';
                if (n.length > 2) {
                    common.usSpinnerService.spin("contactListContainer");
                    QuickContactSearchSvc.SearchContact(n).then(function (res) {
                        $rootScope.TopLevelRecentContacts = res.data;
                        $scope.quickSearchTitle = '';
                        common.usSpinnerService.stop("contactListContainer");
                    }, function (e) {
                        common.aaNotify.error(e);
                        $scope.quickSearchTitle = qsTitle;
                        common.usSpinnerService.stop("contactListContainer");
                    });
                } else if (n.length == 0) {
                    $rootScope.TopLevelRecentContacts = storeRecentContact;
                    $scope.quickSearchTitle = qsTitle;
                    common.usSpinnerService.stop("contactListContainer");
                }
            }, 1000);
        }
    });

    $scope.quickContactPopClose = function () {
        $scope.quickContactSearch = '';
        $scope.showQuickblock('recent');
        $("#quick-contact").removeClass("open");
        $rootScope.TopLevelRecentContacts = storeRecentContact;
        $scope.quickSearchTitle = qsTitle;
    }
    //set default page
    function SetDefaultPage() {
        UserSettingSvc.saveUserSetting($window.location.pathname + $window.location.hash, 'DefaultPage').then(function (data) {
            aaNotify.success(data.data.Message.Description);
        });
    };
    // receive payment
    $scope.OpenReceivePaymentContactSelectDialog = function (page) {
        GatewayType = '';
        UserSettingSvc.getGatewayType().then(function (data) {
            GatewayType = angular.fromJson(data.data);
        });

        var modalReceivePaymentContactSelect = $modal.open({
            templateUrl: page,
            controller: ['$scope', '$modalInstance', function ($scope, $modalInstance) {
                $scope.CancelReceivePaymentContactSelect = function () {
                    $modalInstance.dismiss();
                }
                $scope.AddReceivePaymentContactSelect = function (contactIdValue) {
                    if (IsNotNullorEmpty(contactIdValue)) {
                        $modalInstance.dismiss();
                    }
                    else {
                        common.aaNotify.error("Please select Contact");
                    }
                }
            }],
            keyboard: true,
            backdrop: true,
            scope: $scope
        });
        modalReceivePaymentContactSelect.result.then(function () {
            $scope.PopupOpen = false;
        }, function () {
            $scope.PopupOpen = false;
        });
    }

    Init();

    //global javascript properties and methods. 
    globalVariable.bindLeftNavScroll("#leftNav > #moduleNav");
}]);

var modalPromoPageInstance = ["$scope", "$modalInstance", "UserSettingSvc", "common", "aaNotify",
    function ($scope, $modalInstance, UserSettingSvc, common, aaNotify) {

        $scope.PromoDetails = {};

        $scope.InitTracking = function () {
            common.usSpinnerService.spin('spnPromoForm');
            UserSettingSvc.SavePromoTracking("O").then(function (data) {
                common.usSpinnerService.stop('spnPromoForm');
            });
        }

        $scope.SubmitForm = function () {
            common.usSpinnerService.spin('spnPromoForm');
            UserSettingSvc.SendPromoEmail($scope.PromoDetails).then(function (data) {
                UserSettingSvc.SavePromoTracking("S").then(function (data) {
                    common.usSpinnerService.stop('spnPromoForm');
                    //Need to show message
                    aaNotify.success("Your form has been successfully submitted.");
                    $modalInstance.dismiss('cancel');
                });
            });
        }

        $scope.ClosePromoForm = function () {
            $modalInstance.dismiss('cancel');
        }

        $scope.InitTracking();

    }];

var breadcumType = {
    'EventList': 'Event List',
    'EventAddEdit': 'Event',
    'EventSchedule': 'Event Schedule',
    'EventRegistrationType': 'Event Registration Type',
    'EventSettings': 'Event Settings',
    'EventDashboard': 'Event Dashboard',
    'EventRegistrations': 'Event Registrations',
    'EventAttendees': 'Event Attendees',
    'EventOtherItemPurchases': 'Event Other Item Purchases',
    'EventCheckInAttendees': 'Event Check In Attendees',
    'EventWaitlist': 'Event Waitlist',
    'EventConfigureRegistrationForm': 'Event Configure Registration Form',
    'EventWaitlistSettings': 'Event Waitlist Settings',
    'EventImageGallery': 'Event Image Gallery',
    'EventSponsors': 'Event Sponsors',
    'EventOtherItems': 'Event Other Items',
    'EventCustomizeTickets': 'Event Customize Tickets',
    'EventDocuments': 'Event Documents',
    'EventTrackExpenses': 'Event Track Expenses',
    'EventNotifications': 'Event Notifications',
    'EventQuickTicket': 'Event Quick Ticket',
    'EventInvite': 'Event Invite',
    'AppealList': 'Appeal List',
    'AppealAddEdit': 'Appeal',
    'AppealOutput': 'Appeal Output',
    'AppealSegments': 'Appeal Segments',
    'AppealPackages': 'Appeal Packages',
    'Dashboard': 'Dashboard',
    'AskArrayList': 'Ask Array List',
    'AskArray': 'Ask Array',
    'ChartOfAccounts': 'Chart Of Accounts',
    '_MinDonationAmt_': 'Minimum Donation Amount',
    'GiftAmountGrouping': 'Gift Amount Grouping',
    'CampaignList': 'Campaign List',
    'Campaign': 'Campaign',
    'AccountClasses': 'Account Classes',
    'ContactTypeList': 'Contact Types',
    'ContactType': 'Contact Type',
    'GiftSources': 'Gift Sources',
    'DonorCategory': 'Donor Category',
    'EmailNotificationList': 'Email Notifications',
    'EmailNotification': 'Email Notification',
    'EmailTypeList': 'Email Types',
    'EmploymentStatus': 'Employment Status',
    'Ethnicities': 'Ethnicities',
    'ExpenseGroups': 'Expense Groups',
    'GiftFrequencyGroupList': 'Gift Frequency Groups',
    'GiftFrequencyGroup': 'Gift Frequency Group',
    'FundList': 'Funds',
    'Fund': 'Fund',
    'HousingStatus': 'Housing Status',
    'IncomeLevels': 'Income Levels',
    'InteractionTypes': 'Interaction Types',
    'MaritalStatus': 'Marital Status',
    'NewsletterCategory': 'e-Blast Category',
    'OutputTemplates': 'Output Templates',
    'ParentingStatus': 'Parenting Status',
    'PhoneTypes': 'Phone Types',
    'Prefix': 'Prefix',
    'ProgramList': 'Programs',
    'Program': 'Program',
    'RecencyGrouplist': 'Recency Groups',
    'RecencyGroup': 'Recency Group',
    'RelationshipTypes': 'Relationship Types',
    'Scanlines': 'Scanlines',
    'Seeds': 'Seeds',
    'SmartTagList': 'Smart Tags',
    'SmartTag': 'Smart Tag',
    'Suffix': 'Suffix',
    'Tags': 'Tags',
    'Transcodes': 'Transcodes',
    'CustomDataSets': 'Custom Data Sets',
    'CustomDataSetSecurity': 'Custom Data Set Add/Edit Security',
    'CustomDataSetBasic': 'Custom Data Set Add/Edit Basic',
    'BatchGift': 'Batch Gift',
    'BatchPledge': 'Batch Pledge',
    'Gifts': 'Gifts',
    'Pledges': 'Pledges',
    'PledgeDetail': 'Pledge Detail',
    'Host': 'Host',
    'OtherItemList': 'Other Items',
    'OtherItem': 'Other Item',
    'RegistrationTypeList': 'Registration Types',
    'RegistrationType': 'RegistrationType',
    'SearchCategory': 'Search Category',
    'Venue': 'Venue',
    'Financials': 'Financials',
    'GrantList': 'Grant List',
    'Premium': 'Premium',
    'PremiumRule': 'Premium Rule',
    'AcknowledgementSettings': 'Acknowledgement Settings',
    'HygieneRulesSetup': 'Hygiene Rules Setup',
    'InvoiceNumberSetting': 'Invoice Number Setting',
    'InvoiceSetting': 'Invoice Setting',
    'ContactMerge': 'Contact Merge',
    'PaymentGatewaySetting': 'Payment Gateway Setting',
    'Salutation': 'Salutation',
    'SMTP': 'SMTP',
    'Individidual': "Contact",
    'Organization': 'Organization',
    'ContactView': 'View Contact',
    'ContactLayout': 'Contact Layout Setting',
    'OrganizationView': 'View Organization',
    'LayoutSettings': 'Layout Setting',
    'MergeIndividual': 'Merge Contact',
    'MergeOrganization': 'Merge Organization',
    'GrantAddEdit': 'Grant',
    'GrantList': 'Grant List',
    'NewsletterList': 'Newsletter List',
    'Newsletter': 'Newsletter',
    'ManageTemplate': 'Manage Template',
    'SendAcknowledgementList': 'Acknowledgement',
    'SendAcknowledgementHistory': 'Acknowledgemenet History',
    'SendAcknowledgementRecipient': 'Acknowledgement Recipient',
    'YearEndThankYou': 'Year End Thank You',
    'YearEndThankYouHistory': 'Year End Thank You History',
    'YearEndThankYouRecipient': 'Year End Thank You Recipient',
    'LabelsAndLettersList': 'Labels & Letters',
    'LabelAndLetterHistory': 'Labels & Letters History',
    'LabelAndLetterRecipient': 'Labels & Letters Recipient',
    'ReportViewAll': 'Report View All',
    'DefaultReport': 'Default Report',
    'EnhanceReport': 'Enhance Report',
    'Invoices': 'Invoices',
    'InvoicesCutomer': 'Invoices',
    'InvoiceDetail': 'Invoice',
    'InvoiceAddEdit': 'Invoice Edit',
    'FinancialTransactions': 'Transactions',
    'FinancialDeposit': 'Deposit',
    'FinancialDepositBatch': 'Deposit Batch',
    'AppealGift': 'Gift for Appeal',
    'Search': 'Search',
    "Pages": "Pages",
    "FundRaisingPage": "Fundraising Page",
    "FundRaisingPageSetup": "Fundraising Page Setup",
    "FundRaisingPageDetail": "Fundraising Page Detail",
    "PledgePage": "Fundraising Page",
    "PledgePageSetup": "Fundraising Page Setup",
    "PledgePageDetail": "Fundraising Page Detail",
    "FundRaisingPageMedia": "Fundraising Page Media",
    "Notifications": "Notifications",
    "OrganizationInformation": "Organization Information",
    "ApplicationRoles": "Application Roles",
    "ApplicationRole": "Application Role",
    "UserList": "User List",
    "User": "User",
    "Credentials": "Credentials",
    "ContactList": "Contacts",
    "FileImportProcessing": "File Import Processing",
    'Gift': 'Gift',
    'PremiumList': 'Premiums',
    'Premium': 'Premium',
    'PremiumRule': 'Premium Rule',
    'PremiumRuleList': 'Premium Rules',
    'PendingPremiumFulfillment': 'Pending Premium Fulfillment',
    'MailChimp': 'MailChimp',
    'DonationWidget': 'Create Donation Widget',
    'Benefit': 'Membership Benefits',
    'MembershipSettings': 'Membership Settings',
    'MembershipLevelList': 'Membership Levels',
    'MembershipLevelBasicSettings': 'Basic Settings',
    'MembershipLevelPricingSettings': 'Pricing Settings',
    'MembershipLevelBenefitSettings': 'Benefit Settings',
    'MembershipLevelNotificationSettings': 'Notification Settings',
    'MembershipLevelFormConfiguration': 'Membership Level Form Configuration',
    'ManageMembership': 'Manage Memberships',
    'MembershipBenefitFulfillment': 'Membership Benefit fulfillment',
    'MergeHistory': 'Merge History',
    'ReviewDuplicates': 'Review Duplicates',
    'BatchRenewal': 'Batch Renewal',
    'ImportUtilityHistory': 'Import Utility History',
    'ImportUtility': 'Import Utility',
    'DiscountConfigurationList': 'Discount Coupons',
    'DiscountConfig': 'Discount Coupon',
    'ReportGroupList': 'Report Groups',
    'ReportGroup': 'Report Group',
    'ClosureReason': 'Closure Reason',
    'Diagnosis': 'Diagnosis',
    'DietaryRestriction': 'Dietary Restrictions',
    'PackageCategory': 'Package Category',
    'ParticipatingChefs': 'Participating Chefs',
    'ReferralSource': 'Referral Source',
    'SupplementalProducts': 'Supplemental Products',
    'PackageConfigurationList': 'Package Configuration',
    'MealPlannerList': 'Meal Planner',
    'MealDashboard': 'Meal Planner Dashboard',
    'MealLabelAndLetterList': 'Labels & Letters',
    'MemberDirectory': 'Member Directory Configuration',
    'ManageDirectory': 'Manage Directory',
    'RecurringGift': 'Recurring Gift Profiles',
    'Financials': 'Financials',
    'newFromTemplate': 'Create New Communication',
    'sendAck': 'Send Acknowledgements',
    'history': 'History',
    'AuctionItem': 'Auction Items',
    'EAppeal': 'e-Appeal',
    'EventClassroomConfig': 'Event Classroom Configuration',
    'EventClassroom': 'Event Classroom',
    'YETSettings': 'Year End Thank You'
};
;
(function ($) {
    "use strict";

    var defaultOptions = {
        tagClass: function (item) {
            return 'label label-info';
        },
        itemValue: function (item) {
            return item ? item.toString() : item;
        },
        itemText: function (item) {
            return this.itemValue(item);
        },
        freeInput: false,
        maxTags: undefined,
        confirmKeys: [13],
        onTagExists: function (item, $tag) {
            $tag.hide().fadeIn();
        },
        customClass: ''
    };

    /**
     * Constructor function
     */
    function TagsInput(element, options) {
        this.itemsArray = [];
        this.$element = $(element);
        this.$element.hide();

        this.isSelect = (element.tagName === 'SELECT');
        this.multiple = (this.isSelect && element.hasAttribute('multiple'));
        this.objectItems = options && options.itemValue;
        this.placeholderText = options.placeholder || '';  //element.hasAttribute('placeholder') ? this.$element.attr('placeholder') : '';
        this.inputSize = Math.max(1, this.placeholderText.length);
        this.maxlengthFreetext = options.maxlengthFreetext;
        this.$container = $('<div class="bootstrap-tagsinput tag ' + options.customClass + '"></div>');

        var maxlength = "";
        if (typeof this.maxlengthFreetext != "undefined")
            maxlength = " maxlength='" + this.maxlengthFreetext + "'";
        this.$input = $('<input size="' + this.inputSize + '"' + maxlength + ' type="text" placeholder="' + this.placeholderText + '"/>').appendTo(this.$container);
        this.freeInput = options.freeInput;
        this.entitytext = options.entitytext;
        if (this.freeInput)
            this.$element.after($('<label class="label-info">If you want to create new ' + this.entitytext + ', please press enter key after you write.</label>'));

        this.$element.after(this.$container);

        this.build(options);
    }

    TagsInput.prototype = {
        constructor: TagsInput,

        /**
         * Adds the given item as a new tag. Pass true to dontPushVal to prevent
         * updating the elements val()
         */
        add: function (item, dontPushVal) {
            var self = this;

            if (self.options.maxTags && self.itemsArray.length >= self.options.maxTags)
                return;

            // Ignore falsey values, except false
            if (item !== false && !item)
                return;

            // Throw an error when trying to add an object while the itemValue option was not set
            if (typeof item === "object" && !self.objectItems)
                throw ("Can't add objects when itemValue option is not set");

            // Ignore strings only containg whitespace
            if (item.toString().match(/^\s*$/))
                return;

            // If SELECT but not multiple, remove current tag
            if (self.isSelect && !self.multiple && self.itemsArray.length > 0)
                self.remove(self.itemsArray[0]);

            if (typeof item === "string" && this.$element[0].tagName === 'SELECT') {
                var items = item.split(',');
                if (items.length > 1) {
                    for (var i = 0; i < items.length; i++) {
                        this.add(items[i], true);
                    }

                    if (!dontPushVal)
                        self.pushVal();
                    return;
                }
            }

            if (typeof item == "string") {
                item = self.options.keyvalueItem(item);
            }
            var itemValue = self.options.itemValue(item),
                itemText = self.options.itemText(item),
                tagClass = self.options.tagClass(item);

            // Ignore items allready added
            var existing = $.grep(self.itemsArray, function (item) { return self.options.itemValue(item) === itemValue; })[0];
            if (existing) {
                // Invoke onTagExists
                if (self.options.onTagExists) {
                    var $existingTag = $(".tag-item", self.$container).filter(function () { return $(this).data("item") === existing; });
                    self.options.onTagExists(item, $existingTag);
                }
                return;
            }

            // register item in internal array and map
            self.itemsArray.push(item);

            // add a tag element
            var $tag = $('<span class="tag-item ' + htmlEncode(tagClass) + '">' + htmlEncode(itemText) + '<span data-role="remove" class="icon-close"></span></span>');
            $tag.data('item', item);
            self.findInputWrapper().before($tag);
            $tag.after(' ');

            // add <option /> if item represents a value not present in one of the <select />'s options
            if (self.isSelect && !$('option[value="' + escape(itemValue) + '"]', self.$element)[0]) {
                var $option = $('<option selected>' + htmlEncode(itemText) + '</option>');
                $option.data('item', item);
                $option.attr('value', itemValue);
                self.$element.append($option);
            }

            if (!dontPushVal)
                self.pushVal();

            // Add class when reached maxTags
            if (self.options.maxTags === self.itemsArray.length)
                self.$container.addClass('bootstrap-tagsinput-max');

            self.$element.trigger($.Event('itemAdded', { item: item }));
        },

        /**
         * Removes the given item. Pass true to dontPushVal to prevent updating the
         * elements val()
         */
        remove: function (item, dontPushVal) {
            var self = this;

            if (self.objectItems) {
                if (typeof item === "object")
                    item = $.grep(self.itemsArray, function (other) { return self.options.itemValue(other) == self.options.itemValue(item); })[0];
                else
                    item = $.grep(self.itemsArray, function (other) { return self.options.itemValue(other) == item; })[0];
            }

            if (item) {
                $('.tag-item', self.$container).filter(function () { return $(this).data('item') === item; }).remove();
                $('option', self.$element).filter(function () { return $(this).data('item') === item; }).remove();
                self.itemsArray.splice($.inArray(item, self.itemsArray), 1);
            }

            if (!dontPushVal)
                self.pushVal();

            // Remove class when reached maxTags
            if (self.options.maxTags > self.itemsArray.length)
                self.$container.removeClass('bootstrap-tagsinput-max');

            self.$element.trigger($.Event('itemRemoved', { item: item }));
        },

        /**
         * Removes all items
         */
        removeAll: function () {
            var self = this;

            $('.tag-item', self.$container).remove();
            $('option', self.$element).remove();

            while (self.itemsArray.length > 0)
                self.itemsArray.pop();

            self.pushVal();

            if (self.options.maxTags && !this.isEnabled())
                this.enable();
        },

        /**
         * Refreshes the tags so they match the text/value of their corresponding
         * item.
         */
        refresh: function () {
            var self = this;
            $('.tag-item', self.$container).each(function () {
                var $tag = $(this),
                    item = $tag.data('item'),
                    itemValue = self.options.itemValue(item),
                    itemText = self.options.itemText(item),
                    tagClass = self.options.tagClass(item);

                // Update tag's class and inner text
                $tag.attr('class', null);
                $tag.addClass('tag-item ' + htmlEncode(tagClass));
                $tag.contents().filter(function () {
                    return this.nodeType == 3;
                })[0].nodeValue = htmlEncode(itemText);

                if (self.isSelect) {
                    var option = $('option', self.$element).filter(function () { return $(this).data('item') === item; });
                    option.attr('value', itemValue);
                }
            });
        },

        /**
         * Returns the items added as tags
         */
        items: function () {
            return this.itemsArray;
        },

        /**
         * Assembly value by retrieving the value of each item, and set it on the
         * element. 
         */
        pushVal: function () {
            var self = this,
                val = $.map(self.items(), function (item) {
                    return self.options.itemValue(item).toString();
                });
            self.$element.val(val, true).trigger('change');
        },

        /**
         * Initializes the tags input behaviour on the element
         */
        build: function (options) {
            var self = this;
            self.options = $.extend({}, defaultOptions, options);
            var typeahead = self.options.typeahead || {};
            // When itemValue is set, freeInput should always be false

            //if (self.objectItems)
            //    self.options.freeInput = false;

            makeOptionItemFunction(self.options, 'itemValue');
            makeOptionItemFunction(self.options, 'itemText');
            makeOptionItemFunction(self.options, 'tagClass');

            // for backwards compatibility, self.options.source is deprecated
            if (self.options.source)
                typeahead.source = self.options.source;

            if (typeahead.source && $.fn.typeahead) {
                makeOptionFunction(typeahead, 'source');

                self.$input.typeahead({
                    source: function (query, process) {
                        function processItems(items) {
                            var texts = [];

                            for (var i = 0; i < items.length; i++) {
                                var text = self.options.itemText(items[i]);
                                map[text] = items[i];
                                texts.push(text);
                            }
                            process(texts);
                        }

                        this.map = {};
                        var map = this.map,
                            data = typeahead.source(query);

                        if ($.isFunction(data.success)) {
                            // support for Angular promises
                            data.success(processItems);
                        } else {
                            // support for functions and jquery promises
                            $.when(data)
                             .then(processItems);
                        }
                    },
                    updater: function (text) {
                        self.add(this.map[text]);
                    },
                    matcher: function (text) {
                        return (text.toLowerCase().indexOf(this.query.trim().toString().toLowerCase()) !== -1);
                    },
                    sorter: function (texts) {
                        return texts.sort();
                    },
                    highlighter: function (text) {
                        var regex = new RegExp('(' + this.query + ')', 'gi');
                        return text.replace(regex, "<strong>$1</strong>");
                    }
                });
            }

            self.$container.on('click', $.proxy(function (event) {
                self.$input.focus();
            }, self));
            self.$container.on('blur', 'input', $.proxy(function (event) {
                
                var $input = $(event.target),
                    $inputWrapper = self.findInputWrapper();
                if (!self.options.freeInput) {
                    $input.val('');
                    event.preventDefault();
                }
            }));


            self.$container.on('keydown', 'input', $.proxy(function (event) {
                var $input = $(event.target),
                    $inputWrapper = self.findInputWrapper();

                //if (!self.options.freeInput && $input.val().length > 0) {
                //    $input.addClass("ng-dirty ng-invalid");
                //}

                switch (event.which) {
                    // BACKSPACE
                    case 8:
                        if (doGetCaretPosition($input[0]) === 0) {
                            var prev = $inputWrapper.prev();
                            if (prev) {
                                self.remove(prev.data('item'));
                            }
                        }
                        break;

                        // DELETE
                    case 46:
                        if (doGetCaretPosition($input[0]) === 0) {
                            var next = $inputWrapper.next();
                            if (next) {
                                self.remove(next.data('item'));
                            }
                        }
                        break;

                        // LEFT ARROW
                    case 37:
                        // Try to move the input before the previous tag
                        var $prevTag = $inputWrapper.prev();
                        if ($input.val().length === 0 && $prevTag[0]) {
                            $prevTag.before($inputWrapper);
                            $input.focus();
                        }
                        break;
                        // RIGHT ARROW
                    case 39:
                        // Try to move the input after the next tag
                        var $nextTag = $inputWrapper.next();
                        if ($input.val().length === 0 && $nextTag[0]) {
                            $nextTag.after($inputWrapper);
                            $input.focus();
                        }
                        break;
                    default:
                        // When key corresponds one of the confirmKeys, add current input
                        // as a new tag
                        if ($.inArray(event.which, self.options.confirmKeys) >= 0) {
                            if (self.options.freeInput) {
                                self.add($input.val());
                                $input.val('');
                            }
                            
                            event.preventDefault();
                        }
                }

                //if ($input.val().length >= this.maxlengthFreetext)
                //    $input.addClass("ng-dirty ng-invalid");

                

                // Reset internal input's size
                $input.attr('size', Math.max(this.inputSize, $input.val().length));
            }, self));

            // Remove icon clicked
            self.$container.on('click', '[data-role=remove]', $.proxy(function (event) {
                self.remove($(event.target).closest('.tag-item').data('item'));
            }, self));

            // Only add existing value as tags when using strings as tags
            if (self.options.itemValue === defaultOptions.itemValue) {
                if (self.$element[0].tagName === 'INPUT') {
                    self.add(self.$element.val());
                } else {
                    $('option', self.$element).each(function () {
                        self.add($(this).attr('value'), true);
                    });
                }
            }
        },

        /**
         * Removes all tagsinput behaviour and unregsiter all event handlers
         */
        destroy: function () {
            var self = this;

            // Unbind events
            self.$container.off('keypress', 'input');
            self.$container.off('click', '[role=remove]');

            self.$container.remove();
            self.$element.removeData('tagsinput');
            self.$element.show();
        },

        /**
         * Sets focus on the tagsinput 
         */
        focus: function () {
            this.$input.focus();
        },

        /**
         * Returns the internal input element
         */
        input: function () {
            return this.$input;
        },

        /**
         * Returns the element which is wrapped around the internal input. This
         * is normally the $container, but typeahead.js moves the $input element.
         */
        findInputWrapper: function () {
            var elt = this.$input[0],
                container = this.$container[0];
            while (elt && elt.parentNode !== container)
                elt = elt.parentNode;

            return $(elt);
        }
    };

    /**
     * Register JQuery plugin
     */
    $.fn.tagsinput = function (arg1, arg2) {
        var results = [];

        this.each(function () {
            var tagsinput = $(this).data('tagsinput');

            // Initialize a new tags input
            if (!tagsinput) {
                tagsinput = new TagsInput(this, arg1);
                $(this).data('tagsinput', tagsinput);
                results.push(tagsinput);

                if (this.tagName === 'SELECT') {
                    $('option', $(this)).attr('selected', 'selected');
                }

                // Init tags from $(this).val()
                $(this).val($(this).val());
            } else {
                // Invoke function on existing tags input
                var retVal = tagsinput[arg1](arg2);
                if (retVal !== undefined)
                    results.push(retVal);
            }
        });

        if (typeof arg1 == 'string') {
            // Return the results from the invoked function calls
            return results.length > 1 ? results : results[0];
        } else {
            return results;
        }
    };

    $.fn.tagsinput.Constructor = TagsInput;

    /**
     * Most options support both a string or number as well as a function as 
     * option value. This function makes sure that the option with the given
     * key in the given options is wrapped in a function
     */
    function makeOptionItemFunction(options, key) {
        if (typeof options[key] !== 'function') {
            var propertyName = options[key];
            options[key] = function (item) { return item[propertyName]; };
        }
    }
    function makeOptionFunction(options, key) {
        if (typeof options[key] !== 'function') {
            var value = options[key];
            options[key] = function () { return value; };
        }
    }
    /**
     * HtmlEncodes the given value
     */
    var htmlEncodeContainer = $('<div />');
    function htmlEncode(value) {
        if (value) {
            return htmlEncodeContainer.text(value).html();
        } else {
            return '';
        }
    }

    /**
     * Returns the position of the caret in the given input field
     * http://flightschool.acylt.com/devnotes/caret-position-woes/
     */
    function doGetCaretPosition(oField) {
        var iCaretPos = 0;
        if (document.selection) {
            oField.focus();
            var oSel = document.selection.createRange();
            oSel.moveStart('character', -oField.value.length);
            iCaretPos = oSel.text.length;
        } else if (oField.selectionStart || oField.selectionStart == '0') {
            iCaretPos = oField.selectionStart;
        }
        return (iCaretPos);
    }

    /**
     * Initialize tagsinput behaviour on inputs and selects which have
     * data-role=tagsinput
     */
    $(function () {
        $("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput();
    });
})(window.jQuery);;
angular.module('ui.multiselect', [])

  //from bootstrap-ui typeahead parser
  .factory('optionParser', ['$parse', function ($parse) {

      //                      00000111000000000000022200000000000000003333333333333330000000000044000
      var TYPEAHEAD_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+(.*)$/;

      return {
          parse: function (input) {

              var match = input.match(TYPEAHEAD_REGEXP), modelMapper, viewMapper, source;
              if (!match) {
                  throw new Error(
                    "Expected typeahead specification in form of '_modelValue_ (as _label_)? for _item_ in _collection_'" +
                      " but got '" + input + "'.");
              }

              return {
                  itemName: match[3],
                  source: $parse(match[4]),
                  viewMapper: $parse(match[2] || match[1]),
                  modelMapper: $parse(match[1])
              };
          }
      };
  }])

  .directive('multiselect', ['$parse', '$document', '$compile', 'optionParser',

    function ($parse, $document, $compile, optionParser) {
        return {
            restrict: 'E',
            replace: true,
            scope: true,
            require: 'ngModel',
            controller: ["$scope", "$element", "$attrs", function ($scope, $element, $attrs) {
                $scope.isFixed = $attrs.msFixed || "false";
                $scope.overflowContainer = $attrs.msOverflowContainer || null;
            }],
            link: function (originalScope, element, attrs, modelCtrl) {
                var exp = attrs.options,
                  parsedResult = optionParser.parse(exp),
                  isMultiple = attrs.multiple ? true : false,
                  required = false,
                  scope = originalScope.$new(),
                  changeHandler = attrs.change || angular.noop
                scope.items = [];
                scope.header = attrs.header || 'Select';
                scope.headerTitle = attrs.header || 'Select';
                scope.multiple = isMultiple;
                scope.disabled = false;
                scope.showOnApply = attrs.onApplyClick ? true : false;
                scope.onApplyClick = attrs.onApplyClick || angular.noop;
                scope.searchText = { label: '' };

                originalScope.$on('$destroy', function () {
                    scope.$destroy();
                });

                var popUpEl = angular.element('<multiselect-popup></multiselect-popup>');
                if (scope.multiple)
                    element.addClass("multi");

                //required validator
                if (attrs.required || attrs.ngRequired) {
                    required = true;
                }
                attrs.$observe('required', function (newVal) {
                    required = newVal;
                });

                //watch disabled state
                scope.$watch(function () {
                    return $parse(attrs.disabled)(originalScope);
                }, function (newVal) {
                    scope.disabled = newVal;
                });

                //watch single/multiple state for dynamically change single to multiple
                scope.$watch(function () {
                    return $parse(attrs.multiple)(originalScope);
                }, function (newVal) {
                    isMultiple = newVal || false;
                });

                //watch option changes for options that are populated dynamically
                scope.$watch(function () {
                    return parsedResult.source(originalScope);
                }, function (newVal) {
                    if (angular.isDefined(newVal))
                        parseModel();
                }, true);

                //watch model change
                scope.$watch(function () {
                    return modelCtrl.$modelValue;
                }, function (newVal, oldVal) {
                    //when directive initialize, newVal usually undefined. Also, if model value already set in the controller
                    //for preselected list then we need to mark checked in our scope item. But we don't want to do this every time
                    //model changes. We need to do this only if it is done outside directive scope, from controller, for example.
                    if (angular.isDefined(newVal)) {
                        markChecked(newVal);
                        scope.$eval(changeHandler);
                        try {
                            if (isMultiple) {
                                angular.forEach(scope.items, function (item) {
                                    var t = [];
                                    _.find(oldVal, function (m) {
                                        if ('' + m[attrs.itemkey] === '' + item.model[attrs.itemkey])
                                            t = item;
                                    });
                                    if (IsNotNullorEmpty(t) && item.checked) {
                                        item.checked = false;
                                    }
                                });
                            }
                            //else {
                            //    var t = _.find(scope.items, function (m) { if (oldVal.id === m.model.id) return m; });
                            //    t.checked = !t.checked;
                            //}
                        }
                        catch (err) {
                        }
                    }
                    else {
                        markChecked(oldVal);
                        scope.$eval(changeHandler);

                    }

                    if (IsNotNullorEmpty(modelCtrl.$modelValue)) {
                        if (isMultiple) {
                            angular.forEach(scope.items, function (item) {
                                var t = [];
                                _.find(modelCtrl.$modelValue, function (m) {
                                    if ('' + m[attrs.itemkey] === '' + item.model[attrs.itemkey])
                                        t = item;
                                });

                                if (IsNotNullorEmpty(t)) {
                                    item.checked = true;
                                }
                                else
                                    item.checked = false;
                            });
                        }
                        else {
                            var t = _.find(scope.items, function (m) {
                                if (modelCtrl.$modelValue === m.model) return m;
                            });
                            if (IsNotNullorEmpty(t)) {
                                t.checked = true;
                            }
                            else
                                t.checked = false;
                        }
                    }

                    getHeaderText();
                    modelCtrl.$setValidity('required', scope.valid());
                }, true);

                function parseModel() {
                    scope.items.length = 0;

                    var model = parsedResult.source(originalScope);

                    if (!angular.isDefined(model)) return;
                    for (var i = 0; i < model.length; i++) {
                        var local = {};
                        local[parsedResult.itemName] = model[i];

                        scope.items.push({
                            label: parsedResult.viewMapper(local),
                            model: model[i],
                            checked: false
                        });
                    }
                }
                parseModel();

                element.append($compile(popUpEl)(scope));

                function getHeaderText() {
                    if (is_empty(modelCtrl.$modelValue)) return scope.header = scope.headerTitle;

                    if (isMultiple) {
                        var local = {};
                        local[parsedResult.itemName] = modelCtrl.$modelValue[0];
                        scope.header = typeof parsedResult.viewMapper(local) != 'undefined' ? parsedResult.viewMapper(local) : scope.header;
                        if (modelCtrl.$modelValue.length > 1)
                            scope.header += ' + ' + (modelCtrl.$modelValue.length - 1) + ' ' + 'selected';
                    } else {
                        var local = {};
                        local[parsedResult.itemName] = modelCtrl.$modelValue;
                        scope.header = parsedResult.viewMapper(local);
                    }
                }

                function is_empty(obj) {
                    if (!obj) return true;
                    if (obj.length && obj.length > 0) return false;
                    for (var prop in obj) if (obj[prop]) return false;
                    return true;
                };

                scope.valid = function validModel() {
                    if (!required) return true;
                    var value = modelCtrl.$modelValue;
                    return (angular.isArray(value) && value.length > 0) || (!angular.isArray(value) && value != null);
                };

                function selectSingle(item) {
                    if (item.checked) {
                        scope.uncheckAll();
                    } else {
                        scope.uncheckAll();
                        item.checked = !item.checked;
                    }
                    setModelValue(false);
                }

                function selectMultiple(item) {

                    item.checked = !item.checked;
                    setModelValue(true);
                }

                function setModelValue(isMultiple) {
                    var value;
                    if (isMultiple) {
                        value = [];
                        //if (IsNotNullorEmpty(modelCtrl.$modelValue)) {
                        //    angular.forEach(scope.items, function (item) {
                        //        angular.forEach(modelCtrl.$modelValue, function (modelItem) {
                        //            if (item.model == modelItem && item.checked == false)
                        //                item.checked = true;
                        //        });
                        //    })
                        //}
                        angular.forEach(scope.items, function (item) {

                            if (item.checked)
                                value.push(item.model);
                        })

                    } else {
                        angular.forEach(scope.items, function (item) {
                            if (item.checked) {
                                value = item.model;
                                return false;
                            }
                        })
                    }
                    modelCtrl.$setViewValue(value);
                    scope.$eval(value);
                    //try {
                    //    scope.getmultiselectchange({ itms: modelCtrl.$modelValue });
                    //} catch (e) { }
                }

                function markChecked(newVal) {

                    if (!angular.isArray(newVal)) {
                        angular.forEach(scope.items, function (item) {

                            if (angular.equals(item.model, newVal)) {
                                item.checked = true;
                                return false;
                            }
                        });
                    } else {
                        angular.forEach(newVal, function (i) {
                            angular.forEach(scope.items, function (item) {

                                if (angular.equals(item.model, i)) {
                                    item.checked = true;
                                }
                            });
                        });
                    }
                }

                scope.checkAll = function () {
                    if (!isMultiple) return;
                    angular.forEach(scope.items, function (item) {
                        if (scope.searchText.label.length > 0) {
                            //item.checked = item.label.indexOf(scope.searchText.label) > 0 ? true : false;
                            item.checked = item.label.toLowerCase().indexOf(scope.searchText.label.toLowerCase()) != -1 ? true : false;

                        }
                        else
                            item.checked = true;
                    });
                    setModelValue(true);
                };

                scope.uncheckAll = function () {
                    angular.forEach(scope.items, function (item) {
                        item.checked = false;
                    });
                    setModelValue(true);
                };

                scope.select = function (item) {



                    if (isMultiple === false) {
                        selectSingle(item);

                        //scope.toggleSelect();
                    } else {

                        selectMultiple(item);
                    }

                };


            }
        };
    }])

  .directive('multiselectPopup', ['$document', '$window', function ($document, $window) {
      return {
          restrict: 'E',
          scope: true,
          replace: true,
          templateUrl: '/App_Client/common/directives/MultiSelect/multiselect.html?v=' + window.crm.constants.version,
          link: function (scope, element, attrs) {
              var obj = $(element);
              var dropdownObj = $(obj).find(".dropdown-menu");
              var _isFixed = scope.isFixed;
              var _overflowContainer = scope.overflowContainer;
              var _overflowElement = obj.closest(_overflowContainer);

              scope.isVisible = false;
              scope.toggleSelect = function () {
                  if (element.hasClass('open')) {
                      element.removeClass('open');
                      $document.unbind('click', clickHandler);
                      removeStyle();
                  } else {
                      element.addClass('open');
                      $document.bind('click', clickHandler);
                      scope.focus();
                      if (_isFixed == 'true') {
                          if (_overflowContainer != null || _overflowContainer != "") {
                              _overflowElement.css({ 'overflow': 'visible', 'height': $(_overflowElement).outerHeight() });
                          }
                          var dropdownPos = obj.offset();
                          var downPos = (dropdownPos.top + obj.height()) - $($window).scrollTop();
                          var topPos = ((dropdownPos.top - dropdownObj.height()) - $($window).scrollTop()) - 10;
                          var a = topPos + dropdownObj.height();
                          if ((a + 320) < $($window).height()) {
                              dropdownObj.css({ "top": downPos, "left": dropdownPos.left, "position": "fixed", "z-index": "1000" });
                          } else {
                              dropdownObj.css({ "top": topPos, "left": dropdownPos.left, "position": "fixed", "z-index": "1000" });
                          }
                      }
                      
                  }
              };
              scope.onapplyclick = function () {
                  scope.toggleSelect();
                  scope.$eval(scope.onApplyClick);
              };

              function removeStyle() {
                  if (_isFixed == 'true') {
                      if (_overflowContainer != null || _overflowContainer != "") {
                          _overflowElement.removeAttr("style");
                      }
                      dropdownObj.removeAttr("style");
                  }
              }

              function clickHandler(event) {
                  if (elementMatchesAnyInArray(event.target, element.find(event.target.tagName)))
                      return;

                  //var t = [];
                  //_.find(scope.$parent.items, function (i) {
                  //    if (i.checked)
                  //        t.push(i.model);
                  //});
                  //try{
                  //    scope.availableOpts({ itms: t });
                  //}catch(e){}
                  element.removeClass('open');
                  $document.unbind('click', clickHandler);
                  scope.$apply();
                  removeStyle();
              }

              scope.focus = function focus() {
                  var searchBox = element.find('input')[0];
                  searchBox.focus();
              }

              var elementMatchesAnyInArray = function (element, elementArray) {
                  for (var i = 0; i < elementArray.length; i++)
                      if (element == elementArray[i])
                          return true;
                  return false;
              }

          }
      }
  }]);

;
angular.module('ui.multiselect.ns', [])

  //from bootstrap-ui typeahead parser
  .factory('optionParser', ['$parse', function ($parse) {

      //                      00000111000000000000022200000000000000003333333333333330000000000044000
      var TYPEAHEAD_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+(.*)$/;

      return {
          parse: function (input) {

              var match = input.match(TYPEAHEAD_REGEXP), modelMapper, viewMapper, source;
              if (!match) {
                  throw new Error(
                    "Expected typeahead specification in form of '_modelValue_ (as _label_)? for _item_ in _collection_'" +
                      " but got '" + input + "'.");
              }

              return {
                  itemName: match[3],
                  source: $parse(match[4]),
                  viewMapper: $parse(match[2] || match[1]),
                  modelMapper: $parse(match[1])
              };
          }
      };
  }])

  .directive('nsmultiselect', ['$parse', '$document', '$compile', 'optionParser', '$sce',
    function ($parse, $document, $compile, optionParser, $sce) {
        return {
            restrict: 'E',
            replace: true,
            scope: true,
            require: 'ngModel',
            link: function (originalScope, element, attrs, modelCtrl) {
                var exp = attrs.options,
                  parsedResult = optionParser.parse(exp),
                  isMultiple = attrs.multiple ? true : false,
                  required = false,
                  scope = originalScope.$new(),
                  changeHandler = attrs.change || angular.noop
                scope.items = [];
                scope.header = attrs.header || 'Select';
                scope.headerTitle = attrs.header || 'Select';
                scope.multiple = isMultiple;
                scope.disabled = false;
                scope.showOnApply = attrs.onApplyClick ? true : false;
                scope.onApplyClick = attrs.onApplyClick || angular.noop;
                scope.searchText = { label: '' };

                originalScope.$on('$destroy', function () {
                    scope.$destroy();
                });

                var popUpEl = angular.element('<nsmultiselect-popup></nsmultiselect-popup>');
                if (scope.multiple)
                    element.addClass("multi");

                //required validator
                if (attrs.required || attrs.ngRequired) {
                    required = true;
                }
                attrs.$observe('required', function (newVal) {
                    required = newVal;
                });

                //watch disabled state
                scope.$watch(function () {
                    return $parse(attrs.disabled)(originalScope);
                }, function (newVal) {
                    scope.disabled = newVal;
                });

                //watch single/multiple state for dynamically change single to multiple
                scope.$watch(function () {
                    return $parse(attrs.multiple)(originalScope);
                }, function (newVal) {
                    isMultiple = newVal || false;
                });

                //watch option changes for options that are populated dynamically
                scope.$watch(function () {
                    return parsedResult.source(originalScope);
                }, function (newVal) {
                    if (angular.isDefined(newVal))
                        parseModel();
                }, true);

                //watch model change
                scope.$watch(function () {
                    return modelCtrl.$modelValue;
                }, function (newVal, oldVal) {
                    //when directive initialize, newVal usually undefined. Also, if model value already set in the controller
                    //for preselected list then we need to mark checked in our scope item. But we don't want to do this every time
                    //model changes. We need to do this only if it is done outside directive scope, from controller, for example.
                    if (angular.isDefined(newVal)) {
                        markChecked(newVal);
                        scope.$eval(changeHandler);
                        try {
                            if (isMultiple) {
                                angular.forEach(scope.items, function (item) {
                                    var t = [];
                                    _.find(oldVal, function (m) {
                                        if ('' + m[attrs.itemkey] === '' + item.model[attrs.itemkey]) {
                                            t = item;
                                            t.Subscribed = m.Subscribed;
                                            t.UnSubscribedText = m.UnSubscribedText;
                                        }
                                    });
                                    if (IsNotNullorEmpty(t) && item.checked) {
                                        item.UnSubscribedText = '';
                                        item.checked = false;
                                    }
                                });
                            }
                            //else {
                            //    var t = _.find(scope.items, function (m) { if (oldVal.id === m.model.id) return m; });
                            //    t.checked = !t.checked;
                            //}
                        }
                        catch (err) {
                        }
                    }
                    else {
                        markChecked(oldVal);
                        scope.$eval(changeHandler);
                    }

                    if (IsNotNullorEmpty(modelCtrl.$modelValue)) {
                        if (isMultiple) {
                            angular.forEach(scope.items, function (item) {
                                var t = [];
                                _.find(modelCtrl.$modelValue, function (m) {
                                    if ('' + m[attrs.itemkey] === '' + item.model[attrs.itemkey]) {
                                        t = item;
                                        t.Subscribed = m.Subscribed;
                                        t.UnSubscribedText = m.UnSubscribedText;
                                    }
                                });

                                if (IsNotNullorEmpty(t) && t.Subscribed) {
                                    item.UnSubscribedText = '';
                                    item.checked = true;
                                }
                                else
                                    item.checked = false;
                            });
                        }
                        else {
                            var t = _.find(scope.items, function (m) {
                                if (modelCtrl.$modelValue === m.model) return m;
                            });
                            if (IsNotNullorEmpty(t)) {
                                t.checked = true;
                            }
                            else
                                t.checked = false;
                        }
                    }

                    getHeaderText();
                    modelCtrl.$setValidity('required', scope.valid());
                }, true);

                function parseModel() {
                    scope.items.length = 0;
                    var model = parsedResult.source(originalScope);
                    if (!angular.isDefined(model)) return;
                    for (var i = 0; i < model.length; i++) {
                        var local = {};
                        local[parsedResult.itemName] = model[i];

                        scope.items.push({
                            label: parsedResult.viewMapper(local),
                            model: model[i],
                            checked: false,
                            Subscribed: local[parsedResult.itemName].Subscribed,
                            UnSubscribedText: local[parsedResult.itemName].UnSubscribedText
                        });
                    }
                }
                parseModel();

                element.append($compile(popUpEl)(scope));

                function getHeaderText() {
                    if (is_empty(modelCtrl.$modelValue)) return scope.header = scope.headerTitle;
                    if (isMultiple) {
                        var local = {};
                        local[parsedResult.itemName] = _.where(modelCtrl.$modelValue, { Subscribed: true })[0];
                        scope.header = typeof parsedResult.viewMapper(local) != 'undefined' ? parsedResult.viewMapper(local) : scope.header;
                        if (_.where(modelCtrl.$modelValue, { Subscribed: true }).length > 1)
                            scope.header += ' + ' + (_.where(modelCtrl.$modelValue, { Subscribed: true }).length - 1) + ' ' + 'selected';
                    } else {
                        var local = {};
                        local[parsedResult.itemName] = modelCtrl.$modelValue;
                        scope.header = parsedResult.viewMapper(local);
                    }
                }

                scope.to_trusted = function (html_code) {
                    return $sce.trustAsHtml(html_code);
                }


                function is_empty(obj) {
                    if (!obj) return true;
                    if (obj.length && obj.length > 0) return false;
                    for (var prop in obj) if (obj[prop]) return false;
                    return true;
                };

                scope.valid = function validModel() {
                    if (!required) return true;
                    var value = modelCtrl.$modelValue;
                    return (angular.isArray(value) && value.length > 0) || (!angular.isArray(value) && value != null);
                };

                function selectSingle(item) {
                    if (item.checked) {
                        scope.uncheckAll();
                    } else {
                        scope.uncheckAll();
                        item.checked = !item.checked;
                    }
                    setModelValue(false);
                }

                function selectMultiple(item) {
                    item.checked = !item.checked;
                    setModelValue(true);
                    originalScope.OnCheckedChange(item)
                }

                function setModelValue(isMultiple) {
                    var value;
                    if (isMultiple) {
                        value = [];
                        //if (IsNotNullorEmpty(modelCtrl.$modelValue)) {
                        //    angular.forEach(scope.items, function (item) {
                        //        angular.forEach(modelCtrl.$modelValue, function (modelItem) {
                        //            if (item.model == modelItem && item.checked == false)
                        //                item.checked = true;
                        //        });
                        //    })
                        //}
                        angular.forEach(scope.items, function (item) {
                            if (item.checked) {
                                item.model.Subscribed = item.checked;
                                item.model.UnSubscribedText = item.UnSubscribedText;
                                value.push(item.model);
                            }
                        });

                    } else {
                        angular.forEach(scope.items, function (item) {
                            if (item.checked) {
                                value = item.model;
                                return false;
                            }
                        })
                    }
                    modelCtrl.$setViewValue(value);
                    scope.$eval(value);
                    //try {
                    //    scope.getmultiselectchange({ itms: modelCtrl.$modelValue });
                    //} catch (e) { }
                }

                function markChecked(newVal) {

                    if (!angular.isArray(newVal)) {
                        angular.forEach(scope.items, function (item) {

                            if (angular.equals(item.model, newVal)) {
                                item.checked = true;
                                return false;
                            }
                        });
                    } else {
                        angular.forEach(newVal, function (i) {
                            angular.forEach(scope.items, function (item) {
                                if (angular.equals(item.model, i)) {
                                    item.checked = true;
                                }
                            });
                        });
                    }
                }

                scope.checkAll = function () {
                    if (!isMultiple) return;
                    angular.forEach(scope.items, function (item) {
                        if (scope.searchText.label.length > 0) {
                            item.checked = item.label.indexOf(scope.searchText.label) > 0 ? true : false;
                        }
                        else
                            item.checked = true;
                        originalScope.OnCheckedChange(item)
                    });
                    setModelValue(true);
                };

                scope.uncheckAll = function () {
                    angular.forEach(scope.items, function (item) {
                        item.checked = false;
                        originalScope.OnCheckedChange(item)
                    });
                    setModelValue(true);
                };

                scope.select = function (item) {
                    if (isMultiple === false) {
                        selectSingle(item);
                        //scope.toggleSelect();
                    } else {
                        selectMultiple(item);
                    }

                };


            }
        };
    }])

  .directive('nsmultiselectPopup', ['$document', function ($document) {
      return {
          restrict: 'E',
          scope: true,
          replace: true,
          templateUrl: '/App_Client/common/directives/MultiSelect/nsmultiselect.html?v=' + window.crm.constants.version,
          link: function (scope, element, attrs) {
              scope.isVisible = false;

              scope.toggleSelect = function () {
                  if (element.hasClass('open')) {
                      element.removeClass('open');
                      $document.unbind('click', clickHandler);
                  } else {
                      element.addClass('open');
                      $document.bind('click', clickHandler);
                      scope.focus();
                  }
              };

              scope.onapplyclick = function () {
                  scope.toggleSelect();
                  scope.$eval(scope.onApplyClick);
              };

              function clickHandler(event) {
                  if (elementMatchesAnyInArray(event.target, element.find(event.target.tagName)))
                      return;

                  //var t = [];
                  //_.find(scope.$parent.items, function (i) {
                  //    if (i.checked)
                  //        t.push(i.model);
                  //});
                  //try{
                  //    scope.availableOpts({ itms: t });
                  //}catch(e){}
                  element.removeClass('open');
                  $document.unbind('click', clickHandler);
                  scope.$apply();
              }

              scope.focus = function focus() {
                  var searchBox = element.find('input')[0];
                  searchBox.focus();
              }

              var elementMatchesAnyInArray = function (element, elementArray) {
                  for (var i = 0; i < elementArray.length; i++)
                      if (element == elementArray[i])
                          return true;
                  return false;
              }

          }
      }
  }]);

;
angular.module('bootstrap-tagsinput', [])
.directive('bootstrapTagsinput', [function () {

    function getItemProperty(scope, property) {
        if (!property)
            return undefined;

        if (angular.isFunction(scope.$parent[property]))
            return scope.$parent[property];

        return function (item) {
            if (typeof item == "string") {
                return item;
            }
            return item[property];
        };
    }
    function getItemKeyValueProperty(scope, key, value) {
        return function (item) {
            itemkeyvalue = {};
            itemkeyvalue[key] = item;
            itemkeyvalue[value] = item;
            return itemkeyvalue;
        };
    }
    return {
        restrict: 'EA',
        scope: {
            model: '=ngModel',
            onitemselect: '&'
        },
        template: '<select multiple></select>',
        replace: false,
        link: function (scope, element, attrs) {
            $(function () {
                if (!angular.isArray(scope.model))
                    scope.model = [];

                var select = $('select', element);
                select.tagsinput({
                    typeahead: {
                        source: angular.isFunction(scope.$parent[attrs.typeaheadSource]) ? scope.$parent[attrs.typeaheadSource] : null
                    },
                    itemValue: getItemProperty(scope, attrs.itemvalue),
                    itemText: getItemProperty(scope, attrs.itemtext),
                    maxTags: attrs.maxtags,
                    maxlengthFreetext: attrs.maxlengthfreetext,
                    placeholder: attrs.placeholder || '',
                    tagClass: angular.isFunction(scope.$parent[attrs.tagclass]) ? scope.$parent[attrs.tagclass] : function (item) { return attrs.tagclass; },
                    freeInput: typeof attrs.freeinput != 'undefined' && attrs.freeinput == "true" ? true : false,
                    entitytext: IsNotNullorEmpty(attrs.entitytext) ? attrs.entitytext : 'tag',
                    keyvalueItem: getItemKeyValueProperty(scope, attrs.itemvalue, attrs.itemtext),
                    customClass: attrs.customClass || '',
                   
                });

                for (var i = 0; i < scope.model.length; i++) {
                    select.tagsinput('add', scope.model[i]);
                }

                select.on('itemAdded', function (event) {
                    if (scope.model.indexOf(event.item) === -1)
                        scope.model.push(event.item);
                    scope.onitemselect({ $item: event.item });
                });

                select.on('itemRemoved', function (event) {
                    //var idx = scope.model.indexOf(event.item);

                    //6-28-2016 : due to watch this method gets called second time and that time we are not getting event...so added check here...Browser Specific- Chrome as well                    
                    if (event.item == undefined)
                        return;
                    var idx = -1;
                    for (i = 0; i < scope.model.length; i++) {
                        if (scope.model[i][attrs.itemvalue] == event.item[attrs.itemvalue] && scope.model[i][attrs.itemtext] == event.item[attrs.itemtext]) {
                            idx = i;
                            break;
                        }
                    }
                    if (idx !== -1)
                        scope.model.splice(idx, 1);
                });

                // create a shallow copy of model's current state, needed to determine
                // diff when model changes
                var prev = scope.model.slice();
                scope.$watch("model", function () {
                    var added = scope.model.filter(function (i) { return prev.indexOf(i) === -1; }),
                        removed = prev.filter(function (i) { return scope.model.indexOf(i) === -1; }),
                        i;

                    prev = scope.model.slice();

                    // Remove tags no longer in binded model
                    for (i = 0; i < removed.length; i++) {
                        select.tagsinput('remove', removed[i]);
                    }

                    // Refresh remaining tags
                    select.tagsinput('refresh');

                    // Add new items in model as tags
                    for (i = 0; i < added.length; i++) {
                        select.tagsinput('add', added[i]);
                    }
                }, true);
            });
        }
    };
}]);;
/*!
 * ngTagsInput v2.1.0
 * http://mbenford.github.io/ngTagsInput
 *
 * Copyright (c) 2013-2014 Michael Benford
 * License: MIT
 *
 * Generated at 2014-07-09 02:25:24 -0300
 */
(function () {
    'use strict';

    var KEYS = {
        backspace: 8,
        tab: 9,
        enter: 13,
        escape: 27,
        space: 32,
        up: 38,
        down: 40,
        comma: 188
    };

    var MAX_SAFE_INTEGER = 9007199254740991;
    var SUPPORTED_INPUT_TYPES = ['text', 'email', 'url'];

    function SimplePubSub() {
        var events = {};
        return {
            on: function (names, handler) {
                names.split(' ').forEach(function (name) {
                    if (!events[name]) {
                        events[name] = [];
                    }
                    events[name].push(handler);
                });
                return this;
            },
            trigger: function (name, args) {
                angular.forEach(events[name], function (handler) {
                    handler.call(null, args);
                });
                return this;
            }
        };
    }

    function makeObjectArray(array, key) {
        array = array || [];
        if (array.length > 0 && !angular.isObject(array[0])) {
            array.forEach(function (item, index) {
                array[index] = {};
                array[index][key] = item;
            });
        }
        return array;
    }

    function findInObjectArray(array, obj, key) {
        var item = null;
        for (var i = 0; i < array.length; i++) {
            // I'm aware of the internationalization issues regarding toLowerCase()
            // but I couldn't come up with a better solution right now
            if (safeToString(array[i][key]).toLowerCase() === safeToString(obj[key]).toLowerCase()) {
                item = array[i];
                break;
            }
        }
        return item;
    }

    function replaceAll(str, substr, newSubstr) {
        var expression = substr.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
        return str.replace(new RegExp(expression, 'gi'), newSubstr);
    }

    function safeToString(value) {
        return angular.isUndefined(value) || value == null ? '' : value.toString().trim();
    }

    var tagsInput = angular.module('ngTagsInput', []);

    /**
     * @ngdoc directive
     * @name tagsInput
     * @module ngTagsInput
     *
     * @description
     * Renders an input box with tag editing support.
     *
     * @param {string} ngModel Assignable angular expression to data-bind to.
     * @param {string=} [displayProperty=text] Property to be rendered as the tag label.
     * @param {string=} [input=text] Type of the input element. Only 'text', 'email' and 'url' are supported values.
     * @param {number=} tabindex Tab order of the control.
     * @param {string=} [placeholder=Add a tag] Placeholder text for the control.
     * @param {number=} [minLength=3] Minimum length for a new tag.
     * @param {number=} [maxLength=MAX_SAFE_INTEGER] Maximum length allowed for a new tag.
     * @param {number=} [minTags=0] Sets minTags validation error key if the number of tags added is less than minTags.
     * @param {number=} [maxTags=MAX_SAFE_INTEGER] Sets maxTags validation error key if the number of tags added is greater than maxTags.
     * @param {boolean=} [allowLeftoverText=false] Sets leftoverText validation error key if there is any leftover text in
     *                                             the input element when the directive loses focus.
     * @param {string=} [removeTagSymbol=×] Symbol character for the remove tag button.
     * @param {boolean=} [addOnEnter=true] Flag indicating that a new tag will be added on pressing the ENTER key.
     * @param {boolean=} [addOnSpace=false] Flag indicating that a new tag will be added on pressing the SPACE key.
     * @param {boolean=} [addOnComma=true] Flag indicating that a new tag will be added on pressing the COMMA key.
     * @param {boolean=} [addOnBlur=true] Flag indicating that a new tag will be added when the input field loses focus.
     * @param {boolean=} [replaceSpacesWithDashes=true] Flag indicating that spaces will be replaced with dashes.
     * @param {string=} [allowedTagsPattern=.+] Regular expression that determines whether a new tag is valid.
     * @param {boolean=} [enableEditingLastTag=false] Flag indicating that the last tag will be moved back into
     *                                                the new tag input box instead of being removed when the backspace key
     *                                                is pressed and the input box is empty.
     * @param {boolean=} [addFromAutocompleteOnly=false] Flag indicating that only tags coming from the autocomplete list will be allowed.
     *                                                   When this flag is true, addOnEnter, addOnComma, addOnSpace, addOnBlur and
     *                                                   allowLeftoverText values are ignored.
     * @param {expression} onTagAdded Expression to evaluate upon adding a new tag. The new tag is available as $tag.
     * @param {expression} onTagRemoved Expression to evaluate upon removing an existing tag. The removed tag is available as $tag.
     */
    tagsInput.directive('tagsInput', ["$timeout", "$document", "tagsInputConfig", function ($timeout, $document, tagsInputConfig) {
        function TagList(options, events) {
            var self = {}, getTagText, setTagText, tagIsValid;

            getTagText = function (tag) {
                return safeToString(tag[options.displayProperty]);
            };

            setTagText = function (tag, text) {
                tag[options.displayProperty] = text;
            };

            tagIsValid = function (tag) {
                var tagText = getTagText(tag);

                return tagText &&
                       tagText.length >= options.minLength &&
                       tagText.length <= options.maxLength &&
                       options.allowedTagsPattern.test(tagText) &&
                       !findInObjectArray(self.items, tag, options.displayProperty);
            };

            self.items = [];

            self.addText = function (text) {
                var tag = {};
                setTagText(tag, text);
                return self.add(tag);
            };

            self.add = function (tag) {
                var tagText = getTagText(tag);

                if (options.replaceSpacesWithDashes) {
                    tagText = tagText.replace(/\s/g, '-');
                }

                setTagText(tag, tagText);

                if (tagIsValid(tag)) {
                    self.items.push(tag);
                    events.trigger('tag-added', { $tag: tag });
                }
                else if (tagText) {
                    events.trigger('invalid-tag', { $tag: tag });
                }

                return tag;
            };

            self.remove = function (index) {
                var tag = self.items.splice(index, 1)[0];
                events.trigger('tag-removed', { $tag: tag });
                return tag;
            };

            self.removeLast = function () {
                var tag, lastTagIndex = self.items.length - 1;

                if (options.enableEditingLastTag || self.selected) {
                    self.selected = null;
                    tag = self.remove(lastTagIndex);
                }
                else if (!self.selected) {
                    self.selected = self.items[lastTagIndex];
                }

                return tag;
            };

            return self;
        }

        function validateType(type) {
            return SUPPORTED_INPUT_TYPES.indexOf(type) !== -1;
        }

        return {
            restrict: 'E',
            require: 'ngModel',
            scope: {
                tags: '=ngModel',
                onTagAdded: '&',
                onTagRemoved: '&'
            },
            replace: false,
            transclude: true,
            templateUrl: 'ngTagsInput/tags-input.html',
            controller: ["$scope", "$attrs", "$element", function ($scope, $attrs, $element) {
                $scope.events = new SimplePubSub();

                tagsInputConfig.load('tagsInput', $scope, $attrs, {
                    type: [String, 'text', validateType],
                    placeholder: [String, 'Add a tag'],
                    tabindex: [Number, null],
                    removeTagSymbol: [String, String.fromCharCode(215)],
                    replaceSpacesWithDashes: [Boolean, true],
                    minLength: [Number, 3],
                    maxLength: [Number, MAX_SAFE_INTEGER],
                    addOnEnter: [Boolean, true],
                    addOnSpace: [Boolean, false],
                    addOnComma: [Boolean, true],
                    addOnBlur: [Boolean, true],
                    allowedTagsPattern: [RegExp, /.+/],
                    enableEditingLastTag: [Boolean, false],
                    minTags: [Number, 0],
                    maxTags: [Number, MAX_SAFE_INTEGER],
                    displayProperty: [String, 'text'],
                    allowLeftoverText: [Boolean, false],
                    addFromAutocompleteOnly: [Boolean, false]
                });

                $scope.tagList = new TagList($scope.options, $scope.events);

                this.registerAutocomplete = function () {
                    var input = $element.find('input');
                    input.on('keydown', function (e) {
                        $scope.events.trigger('input-keydown', e);
                    });

                    return {
                        addTag: function (tag) {
                            return $scope.tagList.add(tag);
                        },
                        focusInput: function () {
                            input[0].focus();
                        },
                        getTags: function () {
                            return $scope.tags;
                        },
                        getOptions: function () {
                            return $scope.options;
                        },
                        on: function (name, handler) {
                            $scope.events.on(name, handler);
                            return this;
                        }
                    };
                };
            }],
            link: function (scope, element, attrs, ngModelCtrl) {
                var hotkeys = [KEYS.enter, KEYS.comma, KEYS.space, KEYS.backspace],
                    tagList = scope.tagList,
                    events = scope.events,
                    options = scope.options,
                    input = element.find('input'),
                    validationOptions = ['minTags', 'maxTags', 'allowLeftoverText'],
                    setElementValidity;

                setElementValidity = function () {
                    ngModelCtrl.$setValidity('maxTags', scope.tags.length <= options.maxTags);
                    ngModelCtrl.$setValidity('minTags', scope.tags.length >= options.minTags);
                    ngModelCtrl.$setValidity('leftoverText', options.allowLeftoverText ? true : !scope.newTag.text);
                };

                events
                    .on('tag-added', scope.onTagAdded)
                    .on('tag-removed', scope.onTagRemoved)
                    .on('tag-added', function () {
                        scope.newTag.text = '';
                    })
                    .on('tag-added tag-removed', function () {
                        ngModelCtrl.$setViewValue(scope.tags);
                    })
                    .on('invalid-tag', function () {
                        scope.newTag.invalid = true;
                    })
                    .on('input-change', function () {
                        tagList.selected = null;
                        scope.newTag.invalid = null;
                    })
                    .on('input-focus', function () {
                        ngModelCtrl.$setValidity('leftoverText', true);
                    })
                    .on('input-blur', function () {
                        if (!options.addFromAutocompleteOnly) {
                            if (options.addOnBlur) {
                                tagList.addText(scope.newTag.text);
                            }

                            setElementValidity();
                        }
                    })
                    .on('option-change', function (e) {
                        if (validationOptions.indexOf(e.name) !== -1) {
                            setElementValidity();
                        }
                    });

                scope.newTag = { text: '', invalid: null };

                scope.getDisplayText = function (tag) {
                    return safeToString(tag[options.displayProperty]);
                };

                scope.track = function (tag) {
                    return tag[options.displayProperty];
                };

                scope.newTagChange = function () {
                    events.trigger('input-change', scope.newTag.text);
                };

                scope.$watch('tags', function (value) {
                    scope.tags = makeObjectArray(value, options.displayProperty);
                    tagList.items = scope.tags;
                });

                scope.$watch('tags.length', function () {
                    setElementValidity();
                });

                input
                    .on('keydown', function (e) {
                        // This hack is needed because jqLite doesn't implement stopImmediatePropagation properly.
                        // I've sent a PR to Angular addressing this issue and hopefully it'll be fixed soon.
                        // https://github.com/angular/angular.js/pull/4833
                        if (e.isImmediatePropagationStopped && e.isImmediatePropagationStopped()) {
                            return;
                        }

                        var key = e.keyCode,
                            isModifier = e.shiftKey || e.altKey || e.ctrlKey || e.metaKey,
                            addKeys = {},
                            shouldAdd, shouldRemove;

                        if (isModifier || hotkeys.indexOf(key) === -1) {
                            return;
                        }

                        addKeys[KEYS.enter] = options.addOnEnter;
                        addKeys[KEYS.comma] = options.addOnComma;
                        addKeys[KEYS.space] = options.addOnSpace;

                        shouldAdd = !options.addFromAutocompleteOnly && addKeys[key];
                        shouldRemove = !shouldAdd && key === KEYS.backspace && scope.newTag.text.length === 0;

                        if (shouldAdd) {
                            tagList.addText(scope.newTag.text);

                            scope.$apply();
                            e.preventDefault();
                        }
                        else if (shouldRemove) {
                            var tag = tagList.removeLast();
                            if (tag && options.enableEditingLastTag) {
                                scope.newTag.text = tag[options.displayProperty];
                            }

                            scope.$apply();
                            e.preventDefault();
                        }
                    })
                    .on('focus', function () {
                        if (scope.hasFocus) {
                            return;
                        }
                        scope.hasFocus = true;
                        events.trigger('input-focus');

                        scope.$apply();
                    })
                    .on('blur', function () {
                        $timeout(function () {
                            var activeElement = $document.prop('activeElement'),
                                lostFocusToBrowserWindow = activeElement === input[0],
                                lostFocusToChildElement = element[0].contains(activeElement);

                            if (lostFocusToBrowserWindow || !lostFocusToChildElement) {
                                scope.hasFocus = false;
                                events.trigger('input-blur');
                            }
                        });
                    });

                element.find('div').on('click', function () {
                    input[0].focus();
                });
            }
        };
    }]);

    /**
     * @ngdoc directive
     * @name autoComplete
     * @module ngTagsInput
     *
     * @description
     * Provides autocomplete support for the tagsInput directive.
     *
     * @param {expression} source Expression to evaluate upon changing the input content. The input value is available as
     *                            $query. The result of the expression must be a promise that eventually resolves to an
     *                            array of strings.
     * @param {number=} [debounceDelay=100] Amount of time, in milliseconds, to wait before evaluating the expression in
     *                                      the source option after the last keystroke.
     * @param {number=} [minLength=3] Minimum number of characters that must be entered before evaluating the expression
     *                                 in the source option.
     * @param {boolean=} [highlightMatchedText=true] Flag indicating that the matched text will be highlighted in the
     *                                               suggestions list.
     * @param {number=} [maxResultsToShow=10] Maximum number of results to be displayed at a time.
     */
    tagsInput.directive('autoComplete', ["$document", "$timeout", "$sce", "tagsInputConfig", '$compile', '$templateCache', function ($document, $timeout, $sce, tagsInputConfig, $compile, $templateCache) {
        function SuggestionList(loadFn, options) {
            var self = {}, debouncedLoadId, getDifference, lastPromise;

            getDifference = function (array1, array2) {
                return array1.filter(function (item) {
                    return !findInObjectArray(array2, item, options.tagsInput.displayProperty);
                });
            };

            self.reset = function () {
                lastPromise = null;

                self.items = [];
                self.visible = false;
                self.index = -1;
                self.selected = null;
                self.query = null;

                $timeout.cancel(debouncedLoadId);
            };
            self.show = function () {
                self.selected = null;
                self.visible = true;
            };
            self.load = function (query, tags) {
                if (query.length < options.minLength) {
                    self.reset();
                    return;
                }

                $timeout.cancel(debouncedLoadId);
                debouncedLoadId = $timeout(function () {
                    self.query = query;

                    var promise = loadFn({ $query: query });
                    lastPromise = promise;

                    promise.then(function (items) {
                        if (promise !== lastPromise) {
                            return;
                        }

                        items = makeObjectArray(items.data || items, options.tagsInput.displayProperty);
                        items = getDifference(items, tags);
                        self.items = items.slice(0, options.maxResultsToShow);

                        if (self.items.length > 0) {
                            self.show();
                        }
                        else {
                            self.reset();
                        }
                    });
                }, options.debounceDelay, false);
            };
            self.selectNext = function () {
                self.select(++self.index);
            };
            self.selectPrior = function () {
                self.select(--self.index);
            };
            self.select = function (index) {
                if (index < 0) {
                    index = self.items.length - 1;
                }
                else if (index >= self.items.length) {
                    index = 0;
                }
                self.index = index;
                self.selected = self.items[index];
            };

            self.reset();

            return self;
        }

        function encodeHTML(value) {
            return value.replace(/&/g, '&amp;')
                        .replace(/</g, '&lt;')
                        .replace(/>/g, '&gt;');
        }

        return {
            restrict: 'E',
            require: '^tagsInput',
            scope: { source: '&' },
            //templateUrl: 'ngTagsInput/auto-complete.html',
            link: function (scope, element, attrs, tagsInputCtrl) {
                var hotkeys = [KEYS.enter, KEYS.tab, KEYS.escape, KEYS.up, KEYS.down],
                    suggestionList, tagsInput, options, getItem, getDisplayText, documentClick;

                tagsInputConfig.load('autoComplete', scope, attrs, {
                    debounceDelay: [Number, 100],
                    minLength: [Number, 3],
                    highlightMatchedText: [Boolean, true],
                    maxResultsToShow: [Number, 10]
                });



                options = scope.options;

                tagsInput = tagsInputCtrl.registerAutocomplete();
                options.tagsInput = tagsInput.getOptions();

                suggestionList = new SuggestionList(scope.source, options);

                getItem = function (item) {
                    return item[options.tagsInput.displayProperty];
                };

                getDisplayText = function (item) {
                    return safeToString(getItem(item));
                };

                scope.suggestionList = suggestionList;

                scope.addSuggestionByIndex = function (index) {
                    suggestionList.select(index);
                    scope.addSuggestion();
                };

                scope.addSuggestion = function () {
                    var added = false;

                    if (suggestionList.selected) {
                        tagsInput.addTag(suggestionList.selected);
                        suggestionList.reset();
                        tagsInput.focusInput();

                        added = true;
                    }
                    return added;
                };

                scope.highlight = function (item) {
                    var text = getDisplayText(item);
                    text = encodeHTML(text);
                    if (options.highlightMatchedText) {
                        text = replaceAll(text, encodeHTML(suggestionList.query), '<em>$&</em>');
                    }
                    return $sce.trustAsHtml(text);
                };

                scope.track = function (item) {
                    return getItem(item);
                };

                tagsInput
                    .on('tag-added invalid-tag', function () {
                        suggestionList.reset();
                    })
                    .on('input-change', function (value) {
                        if (value) {
                            suggestionList.load(value, tagsInput.getTags());
                        } else {
                            suggestionList.reset();
                        }
                    })
                    .on('input-keydown', function (e) {
                        var key, handled;

                        if (hotkeys.indexOf(e.keyCode) === -1) {
                            return;
                        }

                        // This hack is needed because jqLite doesn't implement stopImmediatePropagation properly.
                        // I've sent a PR to Angular addressing this issue and hopefully it'll be fixed soon.
                        // https://github.com/angular/angular.js/pull/4833
                        var immediatePropagationStopped = false;
                        e.stopImmediatePropagation = function () {
                            immediatePropagationStopped = true;
                            e.stopPropagation();
                        };
                        e.isImmediatePropagationStopped = function () {
                            return immediatePropagationStopped;
                        };

                        if (suggestionList.visible) {
                            key = e.keyCode;
                            handled = false;

                            if (key === KEYS.down) {
                                suggestionList.selectNext();
                                handled = true;
                            }
                            else if (key === KEYS.up) {
                                suggestionList.selectPrior();
                                handled = true;
                            }
                            else if (key === KEYS.escape) {
                                suggestionList.reset();
                                handled = true;
                            }
                            else if (key === KEYS.enter || key === KEYS.tab) {
                                handled = scope.addSuggestion();
                            }

                            if (handled) {
                                e.preventDefault();
                                e.stopImmediatePropagation();
                                scope.$apply();
                            }
                        }
                    })
                    .on('input-blur', function () {
                        suggestionList.reset();
                    });

                documentClick = function () {
                    if (suggestionList.visible) {
                        suggestionList.reset();
                        scope.$apply();
                    }
                };

                $document.on('click', documentClick);

                scope.$on('$destroy', function () {
                    $document.off('click', documentClick);
                });

                if (angular.isDefined(attrs.templateUrl)) {
                    scope.templateUrl = $templateCache.get(attrs.templateUrl);
                    //$compile(element)(scope);
                    //element.html(scope.templateUrl).show();
                    //$compile(element.contents())(scope);

                    //var controlscript = $templateCache.get(attrs.templateUrl);
                    //element.html(controlscript);
                    //$compile(element.contents())(scope);

                    //console.log(element.contents());
                }
                else
                    scope.templateUrl = $templateCache.get("ngTagsInput/auto-complete.html");

                element.html(scope.templateUrl).show();
                $compile(element.contents())(scope);
            }
        };
    }]);

    /**
     * @ngdoc directive
     * @name tiTranscludeAppend
     * @module ngTagsInput
     *
     * @description
     * Re-creates the old behavior of ng-transclude. Used internally by tagsInput directive.
     */
    tagsInput.directive('tiTranscludeAppend', function () {
        return function (scope, element, attrs, ctrl, transcludeFn) {
            transcludeFn(function (clone) {
                element.append(clone);
            });
        };
    });

    /**
     * @ngdoc directive
     * @name tiAutosize
     * @module ngTagsInput
     *
     * @description
     * Automatically sets the input's width so its content is always visible. Used internally by tagsInput directive.
     */
    tagsInput.directive('tiAutosize', function () {
        return {
            restrict: 'A',
            require: 'ngModel',
            link: function (scope, element, attrs, ctrl) {
                var THRESHOLD = 3,
                    span, resize;

                span = angular.element('<span class="input"></span>');
                span.css('display', 'none')
                    .css('visibility', 'hidden')
                    .css('width', 'auto')
                    .css('white-space', 'pre');

                element.parent().append(span);

                resize = function (originalValue) {
                    var value = originalValue, width;

                    if (angular.isString(value) && value.length === 0) {
                        value = attrs.placeholder;
                    }

                    if (value) {
                        span.text(value);
                        span.css('display', '');
                        width = span.prop('offsetWidth');
                        span.css('display', 'none');
                    }

                    element.css('width', width ? width + THRESHOLD + 'px' : '');

                    return originalValue;
                };

                ctrl.$parsers.unshift(resize);
                ctrl.$formatters.unshift(resize);

                attrs.$observe('placeholder', function (value) {
                    if (!ctrl.$modelValue) {
                        resize(value);
                    }
                });
            }
        };
    });

    /**
     * @ngdoc directive
     * @name tiBindAttrs
     * @module ngTagsInput
     *
     * @description
     * Binds attributes to expressions. Used internally by tagsInput directive.
     */
    tagsInput.directive('tiBindAttrs', function () {
        return function (scope, element, attrs) {
            scope.$watch(attrs.tiBindAttrs, function (value) {
                angular.forEach(value, function (value, key) {
                    attrs.$set(key, value);
                });
            }, true);
        };
    });

    /**
     * @ngdoc service
     * @name tagsInputConfig
     * @module ngTagsInput
     *
     * @description
     * Sets global configuration settings for both tagsInput and autoComplete directives. It's also used internally to parse and
     * initialize options from HTML attributes.
     */
    tagsInput.provider('tagsInputConfig', function () {
        var globalDefaults = {}, interpolationStatus = {};

        /**
         * @ngdoc method
         * @name setDefaults
         * @description Sets the default configuration option for a directive.
         * @methodOf tagsInputConfig
         *
         * @param {string} directive Name of the directive to be configured. Must be either 'tagsInput' or 'autoComplete'.
         * @param {object} defaults Object containing options and their values.
         *
         * @returns {object} The service itself for chaining purposes.
         */
        this.setDefaults = function (directive, defaults) {
            globalDefaults[directive] = defaults;
            return this;
        };

        /***
         * @ngdoc method
         * @name setActiveInterpolation
         * @description Sets active interpolation for a set of options.
         * @methodOf tagsInputConfig
         *
         * @param {string} directive Name of the directive to be configured. Must be either 'tagsInput' or 'autoComplete'.
         * @param {object} options Object containing which options should have interpolation turned on at all times.
         *
         * @returns {object} The service itself for chaining purposes.
         */
        this.setActiveInterpolation = function (directive, options) {
            interpolationStatus[directive] = options;
            return this;
        };

        this.$get = ["$interpolate", function ($interpolate) {
            var converters = {};
            converters[String] = function (value) { return value; };
            converters[Number] = function (value) { return parseInt(value, 10); };
            converters[Boolean] = function (value) { return value.toLowerCase() === 'true'; };
            converters[RegExp] = function (value) { return new RegExp(value); };

            return {
                load: function (directive, scope, attrs, options) {
                    var defaultValidator = function () { return true; };

                    scope.options = {};

                    angular.forEach(options, function (value, key) {
                        var type, localDefault, validator, converter, getDefault, updateValue;

                        type = value[0];
                        localDefault = value[1];
                        validator = value[2] || defaultValidator;
                        converter = converters[type];

                        getDefault = function () {
                            var globalValue = globalDefaults[directive] && globalDefaults[directive][key];
                            return angular.isDefined(globalValue) ? globalValue : localDefault;
                        };

                        updateValue = function (value) {
                            scope.options[key] = value && validator(value) ? converter(value) : getDefault();
                        };

                        if (interpolationStatus[directive] && interpolationStatus[directive][key]) {
                            attrs.$observe(key, function (value) {
                                updateValue(value);
                                scope.events.trigger('option-change', { name: key, newValue: value });
                            });
                        }
                        else {
                            updateValue(attrs[key] && $interpolate(attrs[key])(scope.$parent));
                        }
                    });
                }
            };
        }];
    });


    /* HTML templates */
    tagsInput.run(["$templateCache", function ($templateCache) {
        $templateCache.put('ngTagsInput/tags-input.html',
        "<div class=\"host\" tabindex=\"-1\" ti-transclude-append=\"\"><div class=\"tags\" ng-class=\"{focused: hasFocus}\"><ul class=\"tag-list\"><li class=\"tag-item\" ng-repeat=\"tag in tagList.items track by track(tag)\" ng-class=\"{ selected: tag == tagList.selected }\"><span ng-bind=\"getDisplayText(tag)\"></span> <a class=\"remove-button\" ng-click=\"tagList.remove($index)\" ng-bind=\"options.removeTagSymbol\"></a></li></ul><input class=\"input\" ng-model=\"newTag.text\" ng-change=\"newTagChange()\" ng-trim=\"false\" ng-class=\"{'invalid-tag': newTag.invalid}\" ti-bind-attrs=\"{type: options.type, placeholder: options.placeholder, tabindex: options.tabindex}\" ti-autosize=\"\"></div></div>"
      );

        $templateCache.put('ngTagsInput/auto-complete.html',
          "<div class=\"autocomplete\" ng-show=\"suggestionList.visible\"><ul class=\"suggestion-list\"><li class=\"suggestion-item\" ng-repeat=\"item in suggestionList.items track by track(item)\" ng-class=\"{selected: item == suggestionList.selected}\" ng-click=\"addSuggestionByIndex($index)\" ng-mouseenter=\"suggestionList.select($index)\" ng-bind-html=\"highlight(item)\"></li></ul></div>"
        );

        $templateCache.put('ngTagsInput/ContactEmailTemplate.html',
          "<div class=\"autocomplete\" ng-show=\"suggestionList.visible\"><ul class=\"suggestion-list\"><li class=\"suggestion-item\" ng-repeat=\"item in suggestionList.items track by $index\" ng-class=\"{selected: item == suggestionList.selected}\" ng-click=\"addSuggestionByIndex($index)\" ng-mouseenter=\"suggestionList.select($index)\"><table><tr><td><h5>{{item.ContactName}}</h5></td></tr><tr><td><span>{{item.ContactId}}#</span><span>{{item.Emails}}</span></td></tr></table></li></ul></div>"
        );
    }]);

}());;

var helper = {
    // method for array to comma saparate as a string
    arrayToCommaSaparate: function (array, keyValue) {
        var string = "";
        angular.forEach(array, function (key, index) {
            if (index != 0) {
                string += ",";
            }
            string += key[keyValue];
        });
        return string;
    },
    arrayToCommaSeperate: function (array) {
        var string = "";
        angular.forEach(array, function (key, index) {
            if (index != 0) {
                string += ",";
            }
            string += key;
        });
        return string;
    },
    keyValueObjectToArray: function (object, key, value, isInt) {
        var keyIsInt = isInt || false;
        var _array = [];
        angular.forEach(object, function (iValue, ikey) {
            var str;
            if (typeof (iValue) == "string") {
                if (keyIsInt) {
                    str = JSON.parse('{"' + key + '":' + ikey + ', "' + value + '": "' + iValue + '"}');
                } else {
                    str = JSON.parse('{"' + key + '":"' + ikey + '", "' + value + '": "' + iValue + '"}');
                }
                _array.push(str);
            }

        });
        return _array;
    },
    commaSapareteToArray: function (string) {
        var output = [];
        var a = string.replace(", ", ",");
        if (IsNotNullorEmpty(string)) {
            for (var i = 0; i < 10; i++) {
                a = a.replace(new RegExp(", ", 'g'), ",");
                a = a.replace(new RegExp(" ,", 'g'), ",");
            }
            output = a.split(",");
        }
        return output;
    },
    inlinestylefinder: function (object, prop) {
        var styles = $(object).attr("style"),
            value;
        styles && styles.split(";").forEach(function (e) {
            var style = e.split(":");
            if ($.trim(style[0]) === prop) {
                value = style[1];
            }
        });
        return value;
    },
    matchinlinestyleprop: function (object, prop, value) {
        var existingValue = helper.inlinestylefinder(object, prop);
        var macthed = false;
        if (value == existingValue) {
            macthed = true;
        }
        return macthed;
    },
    copyToClipboard: function (copyText) {
        if ($("#hiddenInputforCopy").length <= 0) {
            $("body").append('<input id="hiddenInputforCopy" type="text" style="position:fixed; left:0; top:-100px; z-index:100000;" />');
        }
        $("#hiddenInputforCopy").show();
        $("#hiddenInputforCopy").val(copyText).select();
        window.document.execCommand("copy");
        $("#hiddenInputforCopy").hide();
    },
    // jQuery plugin for checking scroll is exsit or not
    hasScrollBar: function (element) {
        var _this = $(element);
        return _this.get(0).scrollHeight > _this.height();
    },
    checkAllOnItemChange: function (list, callback) {
        var totalLength = list.length;
        var count = 0;
        list.forEach(function (item) {
            if (item.Selected) {
                count++;
            }
        });
        if (totalLength == count) {
            return callback(true);
        } else {
            return callback(false);
        }
    },
    stringToNumber: function (params) {
        let _number = params.value;
        let decimallength = 0;

        if (isNaN(parseFloat(_number))) {
            return { value: 0, msg: params.nanMsg || "Not a Number." }
        }
        if (_number.indexOf(".") != _number.lastIndexOf(".")) {
            return { value: parseFloat(_number), msg: null }
        }
        if (_number.indexOf(".") == (_number.length - 1)) {
            return { value: _number, msg: null }
        } else if (_number.indexOf(".") != -1) {
            decimallength = (_number.length - 1) - _number.indexOf(".");
            if (decimallength < params.decimal) {
                return { value: _number, msg: null }
            } else {
                if (parseFloat(_number) > params.maxValue) {
                    return { value: params.maxValue.toFixed(params.decimal), msg: params.maxMsg || "Number is higher than expected." }
                }
                return { value: parseFloat(_number).toFixed(params.decimal), msg: null }
            }
        }

        if (parseFloat(_number) > params.maxValue) {
            return { value: params.maxValue.toFixed(params.decimal), msg: params.maxMsg || "Number is higher than expected." }
        }

        return { value: parseFloat(_number), msg: null }
    },
    extendsArrays: function (destinationArray, sourceArray, matchProps) {
        var existsInDestination = false;
        sourceArray.forEach(sItem => {
            existsInDestination = false;
            destinationArray.map(dItem => {
                if (dItem[matchProps] == sItem[matchProps]) {
                    angular.extend(dItem, sItem);
                    existsInDestination = true;
                    return;
                }
            });
            if (!existsInDestination)
                destinationArray.push(sItem);
        });

    }
}

/*******Get interger in ng-Options*******/
function getIntKey(key) {
    // 10 is the radix, which is the base (assumed to be base 10 here) 
    return parseInt(key, 10);
};

/*******Convert Key-Value to Array*******/
function KeyValueToArray(List) {
    var array = [];
    angular.forEach(List, function (V, K) {
        if (K.indexOf('$') >= 0) { }
        else {
            array.push({ id: K, name: V })
        }
    })

    return array;
};

function ConvertKeyValueToArray(List) {
    var array = [];
    angular.forEach(List, function (V, K) {
        array.push({ id: K, name: V })
    })
    return array;
};


//Check object is Empty
function IsObjectEmpty(obj) {
    return angular.equals({}, obj);
};

//Check item is null or undefined
function Isundefinedornull(item) {
    return (item == undefined || item == null);
};

///Validate Array
function validarray(value) {
    return (angular.isArray(value) && value.length > 0) || (!angular.isArray(value) && value != null);
};

function getResolveValue(common, property) {
    if (common.$route.current.locals.hasOwnProperty(property))
        return common.$route.current.locals[property];
    else
        return '';
}

/*******UTC Date to Local Date*******/
function convertUTCDateToLocalDate(date) {
    if (IsNotNullorEmpty(date)) {
        var d = new Date(date);
        //var d = new Date(date.replace(/-/g, "/"))
        d = d - (d.getTimezoneOffset() * 60000);
        d = new Date(d);
        return d;
    }
    return null;
    //return d.toISOString().substr(0, 19) + "Z";
};

/*******UTC Date as Local Date - kamlesh*******/
var returnUTCDateasLocalDate = function (d) {
    //function f(n) { 
    //    return n < 10 ? '0' + n : n;
    //}
    //var d = '"' +
    //       d.getFullYear() + '-' +
    //       f(d.getMonth() + 1) + '-' +
    //       f(d.getDate()) + 'T' +
    //       f(d.getHours()) + ':' +
    //       f(d.getMinutes()) + ':' +
    //       f(d.getSeconds()) + 'Z' +
    //       '"';
    //return new Date(JSON.parse(d));

    // UTC Date Fromat Change By VP
    if (IsNotNullorEmpty(d)) {
        var dt = new Date(d);
        dt = dt - (dt.getTimezoneOffset() * 60000);
        dt = new Date(dt);
        return dt;
    }
    return null;
};

var returnLocalDateasUTCDate = function (dt) {
    //d = new Date(d);
    //return new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), 0);
    return new Date(dt);  // Change By VP
};

var returnLocalDateasStringValue = function (dt) { // dynamic field date value is string then Convert to Date value
    var d = new Date(dt);
    var _utc = new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds());
    return _utc;
};

function convertDateToclienttimezone(date) {
    if (!(date.indexOf("Z") > -1)) {
        date = date + "Z";
    }
    var d = new Date(date);
    d = d + (d.getTimezoneOffset() * 60000);
    d = new Date(d);
    return d;
    //return d.toISOString().substr(0, 19) + "Z";
};

function IsNotNullorEmptyNew(item) {
    var match = false;
    if (typeof item != 'undefined' && item != '' && item != null && item != 'null')
        match = true;
    if (match && item != null && typeof item.length != 'undefined' && item.length <= 0) {
        match = false;
    }
    return match;
};

function IsNotNullorEmpty(item) {
    var match = false;
    if (typeof item != 'undefined' && item != '' && item != null && item != 'null')
        match = true;
    if (match && item != null && typeof item.length != 'undefined' && item.length <= 0) {
        match = false;
    }
    return match;
};

function IsNullorEmpty(item) {
    return !IsNotNullorEmpty(item);
};
function FormatAddress(item) {
    var formattedAddress = '';
    if (IsNotNullorEmpty(item.AddressLine1)) {
        formattedAddress = item.AddressLine1;
        if (IsNotNullorEmpty(item.AddressLine2))
            formattedAddress = formattedAddress + ", " + item.AddressLine2;
        if (IsNotNullorEmpty(item.AddressLine3))
            formattedAddress = formattedAddress + ", " + item.AddressLine3;
        if (IsNotNullorEmpty(item.AddressLine4))
            formattedAddress = formattedAddress + ", " + item.AddressLine4;
        if (IsNotNullorEmpty(item.City))
            formattedAddress = formattedAddress + ", " + item.City;
        if (IsNotNullorEmpty(item.County))
            formattedAddress = formattedAddress + ", " + item.County;
        if (IsNotNullorEmpty(item.StateRegionProvince))
            formattedAddress = formattedAddress + ", " + item.StateRegionProvince;
        if (IsNotNullorEmpty(item.Country) && item.Country.toLowerCase() != 'usa')
            formattedAddress = formattedAddress + ", " + item.Country;
        if (IsNotNullorEmpty(item.PostalCode))
            formattedAddress = formattedAddress + "-" + item.PostalCode;
        if (IsNotNullorEmpty(item.Plus4Code))
            formattedAddress = formattedAddress + "-" + item.Plus4Code;
    }
    return formattedAddress;
}

function IsJSON(jsonString) {
    try {
        JSON.parse(jsonString);
        return true;
    } catch (e) {
        return false;
    }
};

function GenerateAddressKey(addressType, address1, address2, address3, address4, city, state, county, country, zip) {
    if (IsNotNullorEmpty(address1) && country == 'USA') {
        var address = (IsNotNullorEmpty(addressType) ? addressType : '') + (IsNotNullorEmpty(address1) ? address1 : '') + (IsNotNullorEmpty(address2) ? address2 : '') + (IsNotNullorEmpty(address3) ? address3 : '') + (IsNotNullorEmpty(address4) ? address4 : '') + (IsNotNullorEmpty(city) ? city : '') + (IsNotNullorEmpty(state) ? state : '') + (IsNotNullorEmpty(county) ? county : '') + (IsNotNullorEmpty(country) ? country : '') + (IsNotNullorEmpty(zip) ? zip : '');
        return address.replace(/([^a-z0-9]+)/gi, '');
    }
    return '';
};

//function FormatAddress(address1, address2, address3, address4, city, state, county, country, zip, plus4Code) {

//    var address = '';
//    if (IsNotNullorEmpty(address1)) {
//        address = address + ', ' + address1
//    }
//    if (IsNotNullorEmpty(address2)) {
//        address = address + ', ' + address2
//    }
//    if (IsNotNullorEmpty(address3)) {
//        address = address + ', ' + address3
//    }
//    if (IsNotNullorEmpty(address4)) {
//        address = address + ', ' + address4
//    }
//    if (IsNotNullorEmpty(city)) {
//        address = address + ', ' + city
//    }
//    if (IsNotNullorEmpty(county)) {
//        address = address + ', ' + county
//    }
//    if (IsNotNullorEmpty(state)) {
//        address = address + ', ' + state
//    }
//    if (IsNotNullorEmpty(country)) {
//        address = address + ', ' + country
//    }
//    if (IsNotNullorEmpty(zip)) {
//        address = address + ', ' + zip
//        if (IsNotNullorEmpty(plus4Code)) {
//            address = address + '-' + plus4Code
//        }
//    }
//    address = address.substring(2, address.length);

//    return address;
//};

var app = angular.module('app');

function getStateResolveItems(common) {
    return common.$state.$current.locals.resolve.$$values;
};

app.directive('quantity', [
    function () {
        return {
            restrict: 'E',
            template: `<span class="quantity"><span class="fa fa-minus-circle icon-size-small cursor-pointer pad-r-5" ng-class="{'color-black':!desableMinus}" ng-click="!desableMinus?decrease():return"></span><input type="number" min="{{setMin}}" ng-model="quantity" /><span class="fa fa-plus-circle icon-size-small cursor-pointer color-black pad-l-5" ng-click="increase()"></span></span>`,
            scope: {
                quantity: '=ngModel',
                min: '@',
                onChange: "&"
            },
            controller: ["$scope", function ($scope) {
                $scope.desableMinus = false;
                let minValue = (typeof ($scope.min) == 'undefined') ? 1 : angular.copy($scope.min);
                $scope.setMin = minValue;
                if (IsNullorEmpty($scope.quantity) || typeof ($scope.quantity) != "number") {
                    $scope.quantity = minValue;
                    $scope.desableMinus = true;
                }
                $scope.decrease = function () {
                    $scope.quantity--;
                }
                $scope.increase = function () {
                    $scope.quantity++;
                }
                $scope.$watch("quantity", function (n, o) {
                    if (typeof (n) == 'undefined' || IsNullorEmpty(n))
                        $scope.quantity = minValue;
                    if (n <= minValue) {
                        $scope.desableMinus = true;
                    }
                    if (n > minValue) {
                        $scope.desableMinus = false;
                    }
                    if (typeof ($scope.onChange) != 'undefined') {
                        $scope.onChange({ quantity: { new: n, old: o } });
                    }
                });
            }]
        };
    }]);

app.directive('quantitypublic', [
    function () {
        return {
            restrict: 'E',
            template: `<span class="quantity"><span class="fa fa-minus-circle icon-size-small cursor-pointer pad-r-5" ng-class="{'color-black':!desableMinus}" ng-click="!desableMinus?decrease():return"></span><input type="number" min="{{setMin}}" class="form-control" ng-model="quantity" /><span class="fa fa-plus-circle icon-size-small cursor-pointer color-black pad-l-5" ng-click="increase()"></span></span>`,
            scope: {
                quantity: '=ngModel',
                min: '@',
                onChange: "&"
            },
            controller: ["$scope", function ($scope) {
                $scope.desableMinus = false;
                let minValue = (typeof ($scope.min) == 'undefined') ? 0 : angular.copy($scope.min);
                $scope.setMin = minValue;
                if (IsNullorEmpty($scope.quantity) || typeof ($scope.quantity) != "number") {
                    $scope.quantity = minValue;
                    $scope.desableMinus = true;
                }
                $scope.decrease = function () {
                    $scope.quantity--;
                }
                $scope.increase = function () {
                    $scope.quantity++;
                }
                $scope.$watch("quantity", function (n, o) {
                    if (n <= minValue) {
                        $scope.desableMinus = true;
                    }
                    if (n > minValue) {
                        $scope.desableMinus = false;
                    }
                    $scope.onChange({ quantity: { new: n, old: o } });
                })
            }]
        };
    }]);

app.directive('readMore', [
    function () {
        return {
            restrict: 'E',
            replace: true,
            template: `<a class="readmore" href="javascript:void(0)" ng-show="visible">{{linklabel}}</a>`,
            scope: {
                visibale: "=",
                text: '=',
                shortText: "=",
                shortDescLength: '@',
                label: '@',
                headerText: "@"
            },
            controller: ["$scope", "$element", "$modal", function ($scope, $element, $modal) {
                $scope.visible = false;
                $scope.linklabel = "Read More";
                $scope.headerText = $scope.headerText || "Details";
                if (typeof ($scope.label) != 'undefined') {
                    $scope.linklabel = angular.copy($scope.label);
                }
                if ($scope.text.length > $scope.shortDescLength) {
                    $scope.visible = true;
                    $scope.shortText = $scope.text.substr(0, $scope.shortDescLength) + "...";
                } else {
                    $scope.shortText = angular.copy($scope.text);
                    $scope.visible = false;
                }
                $element.on('click', function () {
                    $modal.open({
                        template: `<div><div class="modal-header"><h3>{{header}}</h3><span class="modal-close icon-close" ng-click="close()"></span></div><div class="modal-body"><p class="pad-15">{{text}}</p></div><div class="modal-footer"><button ng-click="close()">{{"_Close_" | translate}}</button></div></div>`,
                        controller: ["$scope", "$modalInstance", "text", "header", function ($scope, $modalInstance, text, header) {
                            $scope.text = text;
                            $scope.header = header;
                            $scope.close = function () {
                                $modalInstance.dismiss('cancel');
                            };
                        }],
                        keyboard: false,
                        backdrop: 'static',
                        sizeclass: 'modal-md',
                        scope: false,
                        resolve: {
                            text: function () {
                                return angular.copy($scope.text);
                            },
                            header: function () {
                                return angular.copy($scope.headerText);
                            }
                        }
                    });
                });
            }]
        };
    }]);

app.directive('readMorePublic', [
    function () {
        return {
            restrict: 'E',
            replace: true,
            template: '<a class="readmore" href="javascript:void(0)" ng-show="visible">{{linklabel}}</a>',
            scope: {
                visibale: "=",
                text: '=',
                shortText: "=",
                shortDescLength: '@',
                label: '@',
                headerText: "@"
            },
            controller: ["$scope", "$element", "$modal", function ($scope, $element, $modal) {
                $scope.visible = false;
                $scope.linklabel = "Read More";
                $scope.headerText = $scope.headerText || "Details";
                if (typeof ($scope.label) != 'undefined') {
                    $scope.linklabel = angular.copy($scope.label);
                }
                if ($scope.text.length > $scope.shortDescLength) {
                    $scope.visible = true;
                    $scope.shortText = $scope.text.substr(0, $scope.shortDescLength) + "...";
                } else {
                    $scope.shortText = angular.copy($scope.text);
                    $scope.visible = false;
                }
                $element.on('click', function () {
                    $modal.open({
                        template: `<div><div class="modal-header"><h5 class="modal-title">{{header}}</h5><span class="close" ng-click="close()"></span></div><div class="modal-body"><span ng-bind-html="text| unsafe"></span></div><div class="modal-footer"><button class="btn btn-primary text-uppercase" ng-click="close()">{{"_Close_" | translate}}</button></div></div>`,
                        controller: ["$scope", "$modalInstance", "text", "header", function ($scope, $modalInstance, text, header) {
                            $scope.text = text;
                            $scope.header = header;
                            $scope.close = function () {
                                $modalInstance.dismiss('cancel');
                            };
                        }],
                        keyboard: false,
                        backdrop: 'static',
                        sizeclass: 'modal-md',
                        scope: false,
                        resolve: {
                            text: function () {
                                return angular.copy($scope.text);
                            },
                            header: function () {
                                return angular.copy($scope.headerText);
                            }
                        }
                    });
                });
            }]
        };
    }]);

// write numbersOnly
app.directive('numbersOnly', function () {
    return ['scope', 'element', 'attrs', function (scope, element, attrs) {
        var keyCode = [8, 9, 37, 39, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 110];
        element.bind("keydown", function (event) {
            if ($.inArray(event.which, keyCode) == -1) {
                scope.$apply(function () {
                    scope.$eval(attrs.onlyNum);
                    event.preventDefault();
                });
                event.preventDefault();
            }
        });
    }];
});

app.directive('integerOnly', function () {
    return ['scope', 'element', 'attrs', function (scope, element, attrs) {
        var keyCode = [8, 37, 39, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105];
        element.bind("keydown", function (event) {
            //console.log(event.which, $.inArray(event.which, keyCode));
            if ($.inArray(event.which, keyCode) == -1) {
                scope.$apply(function () {
                    scope.$eval(attrs.onlyNum);
                    event.preventDefault();
                });
                event.preventDefault();
            }
        });
    }];
});

app.directive('numbersMaxMin', function () {
    return {
        restrict: 'A',
        require: 'ngModel',
        link: ['scope', 'element', 'attrs', 'modelCtrl', function (scope, element, attrs, modelCtrl) {
            element.bind("blur", function (event) {
                if (!modelCtrl || !element.val()) return;

                var min = typeof attrs.min != 'undefined' ? Number(attrs.min) : 0;
                var max = typeof attrs.max != 'undefined' ? Number(attrs.max) : 99999999;

                var currentValue = Number(element.val().replace(/[^\d|\-+|\.+]/g, ''));

                //console.log(max, min, currentValue);
                if (!(currentValue >= min && currentValue <= max)) {
                    modelCtrl.$setViewValue(attrs.min);
                    modelCtrl.$render();
                }
            });
        }]
    };
});
app.directive('numbersMaxMinValue', function () {
    return {
        restrict: 'A',
        require: 'ngModel',
        link: ['scope', 'element', 'attrs', 'modelCtrl', function (scope, element, attrs, modelCtrl) {
            element.bind("blur", function (event) {
                if (!modelCtrl || !element.val()) { modelCtrl.$setViewValue(attrs.min); }

                var min = typeof attrs.min != 'undefined' ? Number(attrs.min) : 0;
                var max = typeof attrs.max != 'undefined' ? Number(attrs.max) : 99999999;

                var currentValue = Number(element.val());

                //console.log(max, min, currentValue);
                if (!(currentValue >= min && currentValue <= max)) {
                    modelCtrl.$setViewValue(attrs.min);
                    modelCtrl.$render();
                }
            });
        }]
    };
});
app.directive('validateDate', ['$parse', '$locale', function ($parse, $locale) {
    return {
        restrict: 'A',
        require: 'ngModel',
        link: ['scope', 'element', 'attrs', 'modelCtrl', function (scope, element, attrs, modelCtrl) {
            scope.$watch(attrs.ngModel, function (value) {
                IsValidDate();
            });

            scope.$watch(function () {
                return $parse(attrs.min)(scope);
            }, function (newVal) {
                IsValidDate();
            });

            scope.$watch(function () {
                return $parse(attrs.max)(scope);
            }, function (newVal) {
                IsValidDate();
            });


            function toDate(dateString) {
                var timeComponents = dateString.replace(/\s.*$/, '').split(':');
                if (dateString.indexOf("PM") > -1) {
                    timeComponents[0] = parseInt(timeComponents[0]) + 12;
                }

                var date = new Date();
                date.setHours(timeComponents[0]);
                date.setMinutes(timeComponents[1]);
                if (timeComponents[2])
                    date.setSeconds(timeComponents[2]);
                else
                    date.setSeconds(0);

                //date.setSeconds(timeComponents[2]);
                return date;
            }


            function IsValidDate() {
                if (!modelCtrl || !element.val()) {
                    modelCtrl.$setValidity('invaliddate', true);
                    return;
                }

                //console.log(attrs.format, $locale.DATETIME_FORMATS[attrs.format]);
                var view = typeof attrs.view != 'undefined' ? attrs.view : "date";
                if (view == 'date') {
                    var minDate = typeof attrs.min != 'undefined' ? new Date(attrs.min.replace(/"/g, "")) : new Date(1, 1, 1);
                    minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
                    var maxDate = typeof attrs.max != 'undefined' ? new Date(attrs.max.replace(/"/g, "")) : new Date(9999, 1, 1);
                    var inputDate = new Date(element.val()); //new Date(element.val().replace(/-/g, '/'));
                    if (angular.isDate(modelCtrl.$modelValue))
                        inputDate = new Date(modelCtrl.$modelValue);
                    //console.log(inputDate.getFullYear(), inputDate.getMonth(), inputDate.getDate(), element.val(), modelCtrl.$modelValue);
                    //console.log(inputDate.getTime() >= minDate.getTime() && inputDate.getTime() <= maxDate.getTime());
                    modelCtrl.$setValidity('invaliddate', inputDate.getTime() >= minDate.getTime() && inputDate.getTime() <= maxDate.getTime());
                }
                else if (view == 'hours') {

                    var minDate = typeof attrs.min != 'undefined' ? new Date(attrs.min.replace(/"/g, "")) : new Date(1, 1, 1);
                    var maxDate = typeof attrs.max != 'undefined' ? new Date(attrs.max.replace(/"/g, "")) : new Date(9999, 1, 1);
                    var inputTime = toDate(element.val()); //new Date(element.val().replace(/-/g, '/'));
                    if (angular.isDate(modelCtrl.$modelValue))
                        inputTime = new Date(modelCtrl.$modelValue);
                    var inputDate = typeof attrs.date != 'undefined' ? new Date(attrs.date.replace(/"/g, "")) : new Date(1, 1, 1);
                    var inputDate = new Date(inputDate.getFullYear(), inputDate.getMonth(), inputDate.getDate(), inputTime.getHours(), inputTime.getMinutes(), inputTime.getSeconds(), minDate.getMilliseconds());

                    //console.log(inputDate.getTime() >= minDate.getTime() && inputDate.getTime() <= maxDate.getTime());
                    modelCtrl.$setValidity('invaliddate', inputDate.getTime() >= minDate.getTime() && inputDate.getTime() <= maxDate.getTime());
                }

            }
        }]
    };
}]);

//http://weblogs.asp.net/dwahlin/archive/2013/09/24/building-a-custom-angularjs-unique-value-directive.aspx
app.directive('uniqueCode', ['UniqueCodeSvc', function (UniqueCodeSvc) {
    return {
        restrict: 'A',
        require: 'ngModel',
        link: ['scope', 'element', 'attrs', 'modelCtrl', function (scope, element, attrs, modelCtrl) {
            element.bind('blur', function (e) {
                if (!modelCtrl || !element.val()) return;
                var keyProperty = scope.$eval(attrs.uniqueCode);
                var currentValue = element.val();

                UniqueCodeSvc.checkUniqueCode(keyProperty.id || 0, keyProperty.type, currentValue)
                    .then(function (unique) {
                        //Ensure value that being checked hasn't changed
                        if (currentValue == element.val()) {
                            modelCtrl.$setValidity('unique', unique.Status);
                        }
                    }, function () {
                        //Probably want a more robust way to handle an error
                        modelCtrl.$setValidity('unique', true);
                    });

                //scope.$apply();
            });
        }]
    }
}]);

app.directive('phoneType', function (UniqueCodeSvc) {
    return {
        restrict: 'A',
        require: 'ngModel',
        link: ['scope', 'element', 'attrs', 'modelCtrl', function (scope, element, attrs, modelCtrl) {
            element.bind('blur', function (e) {
                if (!modelCtrl || !element.val()) return;
                var keyProperty = scope.$eval(attrs.uniqueCode);
                var currentValue = element.val();
                if (IsNotNullorEmpty(currentValue))
                    modelCtrl.$setValidity('phontyperequired', false);
            });
        }]
    }
});

app.directive('uniqueemail', ['ContactSelectorSvc', function (ContactSelectorSvc) {
    return {
        restrict: 'A',
        require: 'ngModel',
        link: ['scope', 'element', 'attrs', 'modelCtrl', function (scope, element, attrs, modelCtrl) {
            element.bind('keydown keypress', function (e) {
                modelCtrl.$setValidity('emailunique', true);
                if (IsNotNullorEmpty(scope.EnableSubmit)) {
                    if (typeof scope.EnableSubmit != 'undefined')
                        scope.EnableSubmit = false;
                    else
                        scope.EnableSubmit = true;
                }
            });
            element.bind('blur', function (e) {
                modelCtrl.$setValidity('emailunique', true);
                if (IsNotNullorEmpty(modelCtrl.$viewValue)) {
                    var contactId = IsNotNullorEmpty(attrs.contactid) ? attrs.contactid : 0;
                    var validateHygieneRule = IsNotNullorEmpty(attrs.validatehygienerule) ? attrs.validatehygienerule : false;
                    var validateemail = IsNotNullorEmpty(attrs.validateemail) && (attrs.validateemail == 'true' || attrs.validateemail == true) ? true : false;
                    validateemail = false; // set false to remove email unique validation from system.
                    if (validateemail) {
                        ContactSelectorSvc.CheckEmailExists(modelCtrl.$viewValue, contactId, validateHygieneRule).then(function (res) {
                            if (res.data == 'true') {
                                modelCtrl.$setValidity('emailunique', false);
                                if (typeof scope.EnableSubmit != 'undefined')
                                    scope.EnableSubmit = true;
                            }
                            else {
                                modelCtrl.$setValidity('emailunique', true);
                                if (typeof scope.EnableSubmit != 'undefined')
                                    scope.EnableSubmit = true;
                            }
                        }, function () {
                            modelCtrl.$setValidity('emailunique', true);
                            if (typeof scope.EnableSubmit != 'undefined')
                                scope.EnableSubmit = true;
                        });
                    }
                    else {
                        modelCtrl.$setValidity('emailunique', true);
                        if (typeof scope.EnableSubmit != 'undefined')
                            scope.EnableSubmit = true;
                    }
                }
            });
        }]
    }
}]);

app.directive("typeaheadwatchchanges", ['$timeout', function ($timeout) {
    return {
        restrict: 'A',
        require: ["ngModel"],
        link: ['scope', 'element', 'attrs', 'ctrls', function (scope, element, attr, ctrls) {
            element.bind('focus', function () {
                if (IsNotNullorEmpty(ctrls[0].$viewValue)) {
                    //ctrls[0].$setViewValue(ctrls[0].$viewValue);
                }
                else
                    ctrls[0].$setViewValue('#');
            });
        }]
    };
}]);

app.directive("typeaheadwatchchangeshousehold", function () {
    return {
        restrict: 'A',
        require: ["ngModel"],
        link: ['scope', 'element', 'attrs', 'ctrls', function (scope, element, attr, ctrls) {
            element.bind('focus', function () {
                if (attr.loadnewhousehold) {
                    if (IsNotNullorEmpty(ctrls[0].$viewValue))
                        ctrls[0].$setViewValue(ctrls[0].$viewValue);
                    else
                        ctrls[0].$setViewValue('#');
                }
            });
        }]
    };
});


/*Initial Referance taken from https://gist.github.com/thewarpaint/889690aeb21a8dfd7aba and modified as per the requirement.*/
app.filter('isoCurrencyWithK', ["$filter", "iso4217", function ($filter, iso4217) {
    return function (amount, fraction, currencyCode) {
        var exp = 0, rounded, currency, nagative, suffixes = ['', 'K', 'M', 'G', 'T', 'P', 'E'];
        //set decimal amount. Default 0
        var fractionSize = fraction === void 0 ? 0 : fraction;

        //check if the amount is more than 1000
        //if yes, set suffix for the amount
        if (amount >= 1000 || amount < -1000) {

            //check if amount is nagative
            if (amount <= -1000) {
                //set nagative amount as true
                nagative = true;
            }

            // remove nagative amount to positive for the calculation
            amount = Math.abs(amount)

            //find which suffix will set for the amount based on length.
            exp = Math.floor(Math.log(amount) / Math.log(1000));

            //get amount after dividing 1000 according the suffix divide rule.
            amount = amount / Math.pow(1000, exp);

            //apply nagative if original amount is nagative
            amount = nagative ? -amount : amount;
        }

        //check if currency code apply or not
        //if yes then procced for the currency
        if (currencyCode) {
            //get currency object from the list below based on the given code
            var currency = iso4217.getCurrencyByCode(currencyCode);

            //apply currency symbol to the amount
            amount = $filter('currency')(amount, currency.symbol || currencyCode + ' ', fractionSize);

        } else {
            //remain same amount if the currency code not apply
            //set decimal value also
            amount = amount.toFixed(fractionSize);
        }

        //return final output of the amount with "K" format include currency 
        return amount + suffixes[exp];
    };
}]);

app.filter('filterMultiple', ['$filter', function ($filter) {
    return function (items, keyObj) {
        var filterObj = {
            data: items,
            filteredData: items,
            applyFilter: function (obj, key) {
                if (typeof obj != 'undefined' && obj != '') {
                    var fData = [];
                    //if (this.filteredData.length == 0)
                    //this.filteredData = this.data;
                    if (obj) {
                        var fObj = {};
                        if (!angular.isArray(obj)) {
                            fObj[key] = obj;
                            fData = fData.concat($filter('filter')(this.filteredData, fObj));
                        } else if (angular.isArray(obj)) {
                            if (obj.length > 0) {
                                for (var i = 0; i < obj.length; i++) {
                                    if (angular.isDefined(obj[i])) {
                                        fObj[key] = obj[i];
                                        fData = fData.concat($filter('filter')(this.filteredData, fObj));
                                    }
                                }
                            }
                        }
                        if (fData.length > 0) {
                            this.filteredData = fData;
                        }
                        else {
                            count++;
                        }
                    }
                }
                else {
                    this.filteredData = this.data;
                }
            }
        };

        var count = 0;
        if (keyObj) {
            angular.forEach(keyObj, function (obj, key) {
                filterObj.applyFilter(obj, key);
            });
        }
        if (_.size(keyObj) == count)
            filterObj.filteredData = [];
        return filterObj.filteredData;
    }
}]);

app.filter('tel', function () {
    return function (tel) {
        if (!tel) { return ''; }

        var value = tel.toString().trim().replace(/^\+/, '');

        if (value.match(/[^0-9]/)) {
            return tel;
        }

        var country, city, number;

        switch (value.length) {
            case 10: // +1PPP####### -> C (PPP) ###-####
                country = 1;
                city = value.slice(0, 3);
                number = value.slice(3);
                break;

            case 11: // +CPPP####### -> CCC (PP) ###-####
                country = value[0];
                city = value.slice(1, 4);
                number = value.slice(4);
                break;

            case 12: // +CCCPP####### -> CCC (PP) ###-####
                country = value.slice(0, 3);
                city = value.slice(3, 5);
                number = value.slice(5);
                break;

            default:
                return tel;
        }

        if (country == 1) {
            country = "";
        }

        number = number.slice(0, 3) + '-' + number.slice(3);

        return (country + " (" + city + ") " + number).trim();
    };
});

app.filter('telformat', function () {
    return function (tel) {
        if (!tel) { return ''; }

        var value = tel.toString().trim().replace(/^\+/, '');

        if (value.match(/[^0-9]/)) {
            return tel;
        }

        var retVal = '';
        var country, city, number, ext;

        if (value.length == 10) {
            country = value.slice(0, 3);
            city = value.slice(3, 6);
            number = value.slice(6);

            retVal = (country + "-" + city + "-" + number).trim();
        }
        else if (value.length > 10) {
            country = value.slice(0, 3);
            city = value.slice(3, 6);
            number = value.slice(6, 10);
            ext = value.slice(10);

            retVal = (country + "-" + city + "-" + number + " ext." + ext).trim();
        }
        else if (value.length < 10 && value.length > 3) {
            country = value.slice(0, 3);
            city = value.slice(3);

            retVal = (country + "-" + city).trim();
        }
        else {
            retVal = value;
        }

        return retVal;
    };
});

app.filter('PanIdentity', function () {
    return function (PanIdentity) {
        if (!PanIdentity) { return ''; }

        var customisedString = '';
        var Last3characted = PanIdentity.length - 4;
        for (var i = 0, len = PanIdentity.length; i < len; i++) {
            if (Last3characted <= i) {
                customisedString += PanIdentity[i];
            }
            else {
                customisedString += "X";
            }
        }
        return customisedString;
    };
});

app.directive('httpPrefix', function () {
    return {
        restrict: 'A',
        require: 'ngModel',
        link: ['scope', 'element', 'attrs', 'controller', function (scope, element, attrs, controller) {
            function ensureHttpPrefix(value) {
                // Need to add prefix if we don't have http:// prefix already AND we don't have part of it
                if (value && !/^(http):\/\//i.test(value)
                    && 'http://'.indexOf(value) === -1) {
                    controller.$setViewValue('http://' + value);
                    controller.$render();
                    return 'http://' + value;
                }
                else
                    return value;
            }
            controller.$formatters.push(ensureHttpPrefix);
            controller.$parsers.push(ensureHttpPrefix);
        }]
    };
});

app.directive('clickOnce', ['$timeout', function ($timeout) {
    return {
        restrict: 'A',
        link: ['scope', 'element', 'attrs', function (scope, element, attrs) {
            //var replacementText = attrs.clickOnce;
            element.bind('click', function () {
                $timeout(function () {
                    //if (replacementText) {
                    //    element.html(replacementText);
                    //}
                    element.attr('disabled', true);
                }, 0);
                $timeout(function () {
                    //if (replacementText) {
                    //    element.html(replacementText);
                    //}
                    element.attr('disabled', false);
                }, 1500);
            });
        }]
    };
}]);

app.filter('cut', function () {
    return function (value, wordwise, max, tail) {
        if (!value) return '';

        max = parseInt(max, 10);
        if (!max) return value;
        if (value.length <= max) return value;

        value = value.substr(0, max);
        if (wordwise) {
            var lastspace = value.lastIndexOf(' ');
            if (lastspace !== -1) {
                //Also remove . and , so its gives a cleaner result.
                if (value.charAt(lastspace - 1) === '.' || value.charAt(lastspace - 1) === ',') {
                    lastspace = lastspace - 1;
                }
                value = value.substr(0, lastspace);
            }
        }

        return value + (tail || ' …');
    };
});

Date.prototype.addDays = function (num) {
    //https://www.pivotaltracker.com/story/show/148522727
    var result = new Date(this.valueOf());
    result.setDate(result.getDate() + num);
    return result

    /*var value = this.valueOf();
    value += 86400000 * num;
    return new Date(value);*/
};

Date.prototype.addSeconds = function (num) {
    var value = this.valueOf();
    value += 1000 * num;
    return new Date(value);
};

Date.prototype.addMinutes = function (num) {
    var value = this.valueOf();
    value += 60000 * num;
    return new Date(value);
};

Date.prototype.addHours = function (num) {
    var value = this.valueOf();
    value += 3600000 * num;
    return new Date(value);
};

Date.prototype.addMonths = function (num) {
    var value = new Date(this.valueOf());

    var mo = this.getMonth();
    var yr = this.getYear();

    mo = (mo + num) % 12;
    if (0 > mo) {
        yr += (this.getMonth() + num - mo - 12) / 12;
        mo += 12;
    }
    else
        yr += ((this.getMonth() + num - mo) / 12);

    value.setMonth(mo);
    value.setYear(yr);
    return value;
};

var ddlDays = [{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }, { id: 5 }, { id: 6 }, { id: 7 }, { id: 8 }, { id: 9 }, { id: 10 }, { id: 11 }, { id: 12 }, { id: 13 }, { id: 14 }, { id: 15 }, { id: 16 }, { id: 17 }, { id: 18 }, { id: 19 }, { id: 20 }, { id: 21 }, { id: 22 }, { id: 23 }, { id: 24 }, { id: 25 }, { id: 26 }, { id: 27 }, { id: 28 }, { id: 29 }, { id: 30 }, { id: 31 }]
var ddlMonths = [{ id: 0, name: 'January' }, { id: 1, name: 'February' }, { id: 2, name: 'March' }, { id: 3, name: 'April' }, { id: 4, name: 'May' }, { id: 5, name: 'June' }, { id: 6, name: 'July' }, { id: 7, name: 'August' }, { id: 8, name: 'September' }, { id: 9, name: 'October' }, { id: 10, name: 'November' }, { id: 11, name: 'December' }]
app.directive('validatedate', function () {
    return {
        restrict: 'A',
        require: 'ngModel',
        link: ['scope', 'element', 'attrs', 'modelCtrl', function (scope, element, attrs, modelCtrl) {
            function watch() {
                var day = IsNotNullorEmpty(attrs.day) ? attrs.day : '';
                var month = IsNotNullorEmpty(attrs.month) ? attrs.month : '';
                if (IsNotNullorEmpty(day) && IsNotNullorEmpty(month)) {
                    var dd = new Date(1900, month, day);
                    if (dd.getMonth() === parseInt(month) && dd.getDate() === parseInt(day))
                        modelCtrl.$setValidity('isvaliddate', true);
                    else {
                        modelCtrl.$setValidity('isvaliddate', false);
                    }
                }
                else
                    modelCtrl.$setValidity('isvaliddate', true);
            }
            scope.$watch(watch);
        }]
    }
});

function GetRandomDigit() {
    var id = '';
    for (var i = 1; i <= 10; i++) {
        id += Math.floor((Math.random() * 6) + 1);
    }
    return id;
};


app.filter('customDate', ['$filter', function ($filter) {
    return function (date, format) {
        if (IsNotNullorEmpty(date)) {
            return $filter('date')(new Date(date), format);
        }
        return '-';
    }
}]);



app.filter('bytes', function () {
    return function (bytes, precision) {
        if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-';
        if (typeof precision === 'undefined') precision = 1;
        var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
            number = Math.floor(Math.log(bytes) / Math.log(1024));
        return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
    }
});


var FileSizeLimitStringFormat = {};
FileSizeLimitStringFormat = {
    sizelimit: 1050000,
    formatVarString: function () {
        var args = [].slice.call(arguments);
        if (this.toString() != '[object Object]') {
            args.unshift(this.toString());
        }
        args[0] = "File '{1}' is exceeded limit. Please choose file less than 1MB.";
        var pattern = new RegExp('{([1-' + args.length + '])}', 'g');
        return String(args[0]).replace(pattern, function (match, index) { return args[index]; });
    }
};

app.directive("restrictMaxLength", ["$compile", function ($compile) {
    return {
        restrict: "A",
        require: "ngModel",
        scope: {
            model: '=ngModel'
        },
        controller: ["$scope", "$element", "$attrs", function ($scope, $element, $attrs) {
            $scope.maxVal = parseInt($attrs.restrictMaxLength);
            $scope.labelStyle = typeof ($attrs.labelStyle) != 'undefined' ? JSON.parse($attrs.labelStyle) : null;
            $scope.$watch("model", function (n) {
                if (typeof (n) != "undefined") {
                    if (n.length > $scope.maxVal) {
                        $scope.model = n.substring(0, $scope.maxVal);
                    }
                }
            });
            var contentTr = angular.element('<label ng-style="{{labelStyle}}" class="label-info no-colon">Characters left: {{maxVal-model.length}}</label>');
            contentTr.insertAfter($element);
            $compile(contentTr)($scope);
        }]
    }
}]);

app.directive('validPrice', function () { //Amount should be greater than zero
    return {
        require: "ngModel",
        link: ['scope', 'element', 'attrs', 'ctrl', function (scope, element, attrs, ctrl) {
            var regex = /^\d{1,18}(\.\d{1,4})?$/;
            ctrl.$parsers.unshift(function (viewValue) {
                var floatValue = parseFloat(viewValue);

                if ((viewValue.length == 0) || (floatValue >= 0 && regex.test(viewValue))) {
                    ctrl.$setValidity('validPrice', true);
                    //return viewValue;
                }
                else {
                    ctrl.$setValidity('validPrice', false);
                }
                return viewValue;
            });
        }]
    };
});

app.directive('verifyselectedyear', ['YearEndThankYouSvc', function (YearEndThankYouSvc) {
    return {
        restrict: 'A',
        require: 'ngModel',
        link: ['scope', 'element', 'attrs', 'modelCtrl', function (scope, element, attrs, modelCtrl) {
            element.bind('blur', function (e) {
                modelCtrl.$setValidity('verifyyear', true);
                if (IsNotNullorEmpty(scope.local)) {
                    if (typeof scope.local.EnableSubmit != 'undefined')
                        scope.local.EnableSubmit = false;
                    else
                        scope.local.EnableSubmit = true;
                }
                if (IsNotNullorEmpty(modelCtrl.$viewValue)) {
                    YearEndThankYouSvc.IsProcessPendingForYear(modelCtrl.$viewValue.name).then(function (res) {
                        if (res.data == 'true') {
                            modelCtrl.$setValidity('verifyyear', false);
                        }
                        else {
                            modelCtrl.$setValidity('verifyyear', true);
                        }
                        if (IsNotNullorEmpty(scope.local))
                            scope.local.EnableSubmit = true;
                    }, function () {
                        modelCtrl.$setValidity('verifyyear', true);
                        if (IsNotNullorEmpty(scope.local))
                            scope.local.EnableSubmit = true;
                    });
                }
                else {
                    if (IsNotNullorEmpty(scope.local))
                        scope.local.EnableSubmit = true;
                }
            });
        }]
    }
}]);


app.filter('unsafe', ['$sce', function ($sce) {
    return function (val) {
        return $sce.trustAsHtml(val);
    };
}]);


function ShowMessage(common, Message) {
    if (Message != null) {
        if (Message.Type == 'Error' || Message.Type == '1') {
            common.aaNotify.error(Message.Description);
            return false;
        }
        else {
            common.aaNotify.success(Message.Description);
            return true;
        }
    }

    return true;
};

function ShowResponseMessages(common, typedResponse, displayMessage) {
    if (displayMessage == null)
        displayMessage = true;

    if (typedResponse != null) {
        if (Number(typedResponse.StatusCode) == 200) {
            if (typedResponse.SuccessMessage != null && typedResponse.SuccessMessage != "")
                if (displayMessage)
                    common.aaNotify.success(typedResponse.SuccessMessage);
            return true;
        }
        else {

            if (typedResponse.ErrorText != null && typedResponse.ErrorText != "") {
                if (displayMessage)
                    common.aaNotify.error(typedResponse.ErrorText);
            }
            else {
                if (typedResponse.ErrorObject != null && typedResponse.ErrorObject != "") {
                    if (typedResponse.ErrorObject.Message != null) {
                        if (displayMessage)
                            common.aaNotify.error(typedResponse.ErrorObject.Message);
                    }
                    else if (typedResponse.ErrorObject.length > 0)
                        if (displayMessage)
                            common.aaNotify.error(typedResponse.ErrorObject[0].Message);
                }
                else {
                    if (typedResponse.length > 0) {
                        if (displayMessage)
                            common.aaNotify.error(typedResponse[0].Message);
                    }
                }
            }
            return false;
        }
    }
    return true;
};

app.filter('range', function () {
    return function (input, min, max) {
        min = parseInt(min); //Make string input int
        max = parseInt(max);
        for (var i = min; i <= max; i++)
            input.push(i);
        return input;
    };
});

app.filter('selectrange', function () {
    return function (input, total) {
        total = parseInt(total);
        for (var i = 1; i <= total; i++) {
            input.push(i);
        }

        return input;
    };
});


app.directive('focusMe', ['$timeout', function ($timeout) {
    return {
        restrict: 'A',
        link: ['scope', 'element', 'attrs', function (scope, element, attrs) {
            //console.log(element,"TEst");
            ////$timeout(function() {
            //element[0].focus();
            ////});
            $timeout(function () {
                element.focus();
            }, 100);
        }]
    };
}]);

app.directive('fixFocusMe', ['$timeout', function ($timeout) {
    return {
        restrict: 'A',
        link: function (scope, element) {
            $timeout(function () {
                element.focus();
            }, 100);

            element.bind('blur', function () {
                $timeout(function () {
                    element.focus();
                }, 100);
            });
        }
    };
}]);

app.directive('digitsOnly', function () {
    return {
        require: 'ngModel',
        link: ['scope', 'element', 'attrs', 'modelCtrl', function (scope, element, attrs, modelCtrl) {
            modelCtrl.$parsers.push(function (inputValue) {
                // this next if is necessary for when using ng-required on your input. 
                // In such cases, when a letter is typed first, this parser will be called
                // again, and the 2nd time, the value will be undefined
                if (inputValue == undefined) return ''
                var transformedInput = inputValue.replace(/[^0-9]/g, '');
                if (transformedInput != inputValue) {
                    modelCtrl.$setViewValue(transformedInput);
                    modelCtrl.$render();
                }

                return transformedInput;
            });
        }]
    }
});

app.filter('ordinalnumber', function () {
    return function (input) {
        var s = ["th", "st", "nd", "rd"], v = input % 100;
        return input + (s[(v - 20) % 10] || s[v] || s[0]);
        //var num = parseInt(input, 10);
        //return isNaN(num) ? input : ordinal.english(num);
    };
});

app.directive('ngEnter', function () {
    return ['scope', 'element', 'attrs', function (scope, element, attrs) {
        element.bind("keydown keypress", function (event) {
            if (event.which === 13) {
                scope.$apply(function () {
                    scope.$eval(attrs.ngEnter, { 'event': event });
                });
                event.preventDefault();
            }
        });
    }]
});

app.factory('focus', ['$timeout', '$window', function ($timeout, $window) {
    return function (id) {
        // timeout makes sure that is invoked after any other event has been triggered.
        // e.g. click events that need to run before the focus or
        // inputs elements that are in a disabled state but are enabled when those events
        // are triggered.
        $timeout(function () {
            var element = $window.document.getElementById(id);
            if (element)
                element.focus();
        });
    };
}]);

app.filter('isNullOrEmpty', function () {
    return function (str) {
        var reg = /\s/g;
        return IsNotNullorEmpty(str.replace(reg, ""));
    };
});

var phoneMask = {
    _ad: "{ mask: '999 999', greedy: true, autoUnmask: true }",
    _ae: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _af: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _ag: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _ai: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _al: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _am: "{ mask: '99 999999', greedy: true, autoUnmask: true }",
    _an: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _ao: "{ mask: '999 999 999', greedy: true, autoUnmask: true }",
    _ar: "{ mask: '9 99 9999-9999', greedy: true, autoUnmask: true }",
    _at: "{ mask: '999 999999', greedy: true, autoUnmask: true }",
    _au: "{ mask: '999 999 999', greedy: true, autoUnmask: true }",
    _aw: "{ mask: '999 9999', greedy: true, autoUnmask: true }",
    _az: "{ mask: '99 999 99 99', greedy: true, autoUnmask: true }",
    _ba: "{ mask: '99 999 999', greedy: true, autoUnmask: true }",
    _bb: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _bd: "{ mask: '9999-999999', greedy: true, autoUnmask: true }",
    _be: "{ mask: '999 99 99 99', greedy: true, autoUnmask: true }",
    _bf: "{ mask: '99 99 99 99', greedy: true, autoUnmask: true }",
    _bg: "{ mask: '99 999 999', greedy: true, autoUnmask: true }",
    _bh: "{ mask: '9999 9999', greedy: true, autoUnmask: true }",
    _bi: "{ mask: '99 99 99 99', greedy: true, autoUnmask: true }",
    _bj: "{ mask: '99 99 99 99', greedy: true, autoUnmask: true }",
    _bm: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _bn: "{ mask: '999 9999', greedy: true, autoUnmask: true }",
    _bo: "{ mask: '99999999', greedy: true, autoUnmask: true }",
    _br: "{ mask: '99 99999-9999', greedy: true, autoUnmask: true }",
    _bs: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _bt: "{ mask: '99 99 99 99', greedy: true, autoUnmask: true }",
    _bw: "{ mask: '99 999 999', greedy: true, autoUnmask: true }",
    _by: "{ mask: '99 999-99-99', greedy: true, autoUnmask: true }",
    _bz: "{ mask: '999-9999', greedy: true, autoUnmask: true }",
    _ca: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _cf: "{ mask: '99 99 99 99', greedy: true, autoUnmask: true }",
    _cg: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _ch: "{ mask: '99 999 99 99', greedy: true, autoUnmask: true }",
    _ci: "{ mask: '99 99 99 99', greedy: true, autoUnmask: true }",
    _ck: "{ mask: '99 999', greedy: true, autoUnmask: true }",
    _cl: "{ mask: '9 9999 9999', greedy: true, autoUnmask: true }",
    _cm: "{ mask: '9 99 99 99 99', greedy: true, autoUnmask: true }",
    _cn: "{ mask: '999 9999 9999', greedy: true, autoUnmask: true }",
    _co: "{ mask: '999 9999999', greedy: true, autoUnmask: true }",
    _cr: "{ mask: '9999 9999', greedy: true, autoUnmask: true }",
    _cu: "{ mask: '9 9999999', greedy: true, autoUnmask: true }",
    _cv: "{ mask: '999 99 99', greedy: true, autoUnmask: true }",
    _cy: "{ mask: '99 999999', greedy: true, autoUnmask: true }",
    _cz: "{ mask: '999 999 999', greedy: true, autoUnmask: true }",
    _de: "{ mask: '9999 9999999', greedy: true, autoUnmask: true }",
    _dj: "{ mask: '99 99 99 99', greedy: true, autoUnmask: true }",
    _dk: "{ mask: '99 99 99 99', greedy: true, autoUnmask: true }",
    _dm: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _do: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _dz: "{ mask: '999 99 99 99', greedy: true, autoUnmask: true }",
    _ec: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _ee: "{ mask: '9999 9999', greedy: true, autoUnmask: true }",
    _eg: "{ mask: '999 999 9999', greedy: true, autoUnmask: true }",
    _eh: "{ mask: '999-999999', greedy: true, autoUnmask: true }",
    _er: "{ mask: '9 999 999', greedy: true, autoUnmask: true }",
    _es: "{ mask: '999 99 99 99', greedy: true, autoUnmask: true }",
    _et: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _fi: "{ mask: '99 9999999', greedy: true, autoUnmask: true }",
    _fj: "{ mask: '999 9999', greedy: true, autoUnmask: true }",
    _fk: "{ mask: '99999', greedy: true, autoUnmask: true }",
    _fm: "{ mask: '999 9999', greedy: true, autoUnmask: true }",
    _fo: "{ mask: '999999', greedy: true, autoUnmask: true }",
    _fr: "{ mask: '9 99 99 99 99', greedy: true, autoUnmask: true }",
    _ga: "{ mask: '99 99 99 99', greedy: true, autoUnmask: true }",
    _gb: "{ mask: '9999 999999', greedy: true, autoUnmask: true }",
    _gd: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _ge: "{ mask: '999 99 99 99', greedy: true, autoUnmask: true }",
    _gh: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _gi: "{ mask: '99999999', greedy: true, autoUnmask: true }",
    _gl: "{ mask: '99 99 99', greedy: true, autoUnmask: true }",
    _gm: "{ mask: '999 9999', greedy: true, autoUnmask: true }",
    _gn: "{ mask: '999 99 99 99', greedy: true, autoUnmask: true }",
    _gq: "{ mask: '999 999 999', greedy: true, autoUnmask: true }",
    _gr: "{ mask: '999 999 9999', greedy: true, autoUnmask: true }",
    _gs: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _gt: "{ mask: '9999 9999', greedy: true, autoUnmask: true }",
    _gw: "{ mask: '999 999 999', greedy: true, autoUnmask: true }",
    _gy: "{ mask: '999 9999', greedy: true, autoUnmask: true }",
    _hk: "{ mask: '9999 9999', greedy: true, autoUnmask: true }",
    _hn: "{ mask: '9999-9999', greedy: true, autoUnmask: true }",
    _hr: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _ht: "{ mask: '99 99 9999', greedy: true, autoUnmask: true }",
    _hu: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _id: "{ mask: '999-999-999', greedy: true, autoUnmask: true }",
    _ie: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _il: "{ mask: '99-999-9999', greedy: true, autoUnmask: true }",
    _in: "{ mask: '99999 99999', greedy: true, autoUnmask: true }",
    _iq: "{ mask: '999 999 9999', greedy: true, autoUnmask: true }",
    _ir: "{ mask: '999 999 9999', greedy: true, autoUnmask: true }",
    _is: "{ mask: '999 9999', greedy: true, autoUnmask: true }",
    _it: "{ mask: '999 999 9999', greedy: true, autoUnmask: true }",
    _jm: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _jo: "{ mask: '9 9999 9999', greedy: true, autoUnmask: true }",
    _jp: "{ mask: '99-9999-9999', greedy: true, autoUnmask: true }",
    _ke: "{ mask: '999 999999', greedy: true, autoUnmask: true }",
    _kg: "{ mask: '999 999 999', greedy: true, autoUnmask: true }",
    _kh: "{ mask: '99 999 999', greedy: true, autoUnmask: true }",
    _ki: "{ mask: '99999999', greedy: true, autoUnmask: true }",
    _km: "{ mask: '999 99 99', greedy: true, autoUnmask: true }",
    _kn: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _kp: "{ mask: '999 999 9999', greedy: true, autoUnmask: true }",
    _kr: "{ mask: '99-9999-9999', greedy: true, autoUnmask: true }",
    _kw: "{ mask: '999 99999', greedy: true, autoUnmask: true }",
    _ky: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _kz: "{ mask: '999 999 9999', greedy: true, autoUnmask: true }",
    _la: "{ mask: '99 99 999 999', greedy: true, autoUnmask: true }",
    _lb: "{ mask: '99 999 999', greedy: true, autoUnmask: true }",
    _lc: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _li: "{ mask: '999 999 999', greedy: true, autoUnmask: true }",
    _lk: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _lr: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _ls: "{ mask: '9999 9999', greedy: true, autoUnmask: true }",
    _lt: "{ mask: '999 99999', greedy: true, autoUnmask: true }",
    _lu: "{ mask: '999 999 999', greedy: true, autoUnmask: true }",
    _lv: "{ mask: '99 999 999', greedy: true, autoUnmask: true }",
    _ly: "{ mask: '99-9999999', greedy: true, autoUnmask: true }",
    _ma: "{ mask: '999-999999', greedy: true, autoUnmask: true }",
    _mc: "{ mask: '9 99 99 99 99', greedy: true, autoUnmask: true }",
    _md: "{ mask: '999 99 999', greedy: true, autoUnmask: true }",
    _mg: "{ mask: '99 99 999 99', greedy: true, autoUnmask: true }",
    _mh: "{ mask: '999-9999', greedy: true, autoUnmask: true }",
    _mk: "{ mask: '99 999 999', greedy: true, autoUnmask: true }",
    _ml: "{ mask: '99 99 99 99', greedy: true, autoUnmask: true }",
    _mm: "{ mask: '9 999 9999', greedy: true, autoUnmask: true }",
    _mn: "{ mask: '9999 9999', greedy: true, autoUnmask: true }",
    _mo: "{ mask: '9999 9999', greedy: true, autoUnmask: true }",
    _mp: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _mr: "{ mask: '99 99 99 99', greedy: true, autoUnmask: true }",
    _ms: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _mt: "{ mask: '9999 9999', greedy: true, autoUnmask: true }",
    _mu: "{ mask: '9999 9999', greedy: true, autoUnmask: true }",
    _mv: "{ mask: '999-9999', greedy: true, autoUnmask: true }",
    _mw: "{ mask: '999 99 99 99', greedy: true, autoUnmask: true }",
    _mx: "{ mask: '9 999 999 9999', greedy: true, autoUnmask: true }",
    _my: "{ mask: '99-999 9999', greedy: true, autoUnmask: true }",
    _mz: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _na: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _ne: "{ mask: '99 99 99 99', greedy: true, autoUnmask: true }",
    _ng: "{ mask: '999 999 9999', greedy: true, autoUnmask: true }",
    _ni: "{ mask: '9999 9999', greedy: true, autoUnmask: true }",
    _nl: "{ mask: '9 99999999', greedy: true, autoUnmask: true }",
    _no: "{ mask: '999 99 999', greedy: true, autoUnmask: true }",
    _np: "{ mask: '999-9999999', greedy: true, autoUnmask: true }",
    _nr: "{ mask: '999 9999', greedy: true, autoUnmask: true }",
    _nz: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _om: "{ mask: '9999 9999', greedy: true, autoUnmask: true }",
    _pa: "{ mask: '9999-9999', greedy: true, autoUnmask: true }",
    _pe: "{ mask: '999 999 999', greedy: true, autoUnmask: true }",
    _pg: "{ mask: '999 9999', greedy: true, autoUnmask: true }",
    _ph: "{ mask: '999 999 9999', greedy: true, autoUnmask: true }",
    _pk: "{ mask: '999 9999999', greedy: true, autoUnmask: true }",
    _pl: "{ mask: '999 999 999', greedy: true, autoUnmask: true }",
    _pt: "{ mask: '999 999 999', greedy: true, autoUnmask: true }",
    _pw: "{ mask: '999 9999', greedy: true, autoUnmask: true }",
    _py: "{ mask: '999 999999', greedy: true, autoUnmask: true }",
    _qa: "{ mask: '9999 9999', greedy: true, autoUnmask: true }",
    _ro: "{ mask: '999 999 999', greedy: true, autoUnmask: true }",
    _ru: "{ mask: '999 999-99-99', greedy: true, autoUnmask: true }",
    _rw: "{ mask: '999 999 999', greedy: true, autoUnmask: true }",
    _sa: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _sb: "{ mask: '99 99999', greedy: true, autoUnmask: true }",
    _sc: "{ mask: '9 999 999', greedy: true, autoUnmask: true }",
    _sd: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _se: "{ mask: '99 999 99 99', greedy: true, autoUnmask: true }",
    _sf: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _sg: "{ mask: '9999 9999', greedy: true, autoUnmask: true }",
    _sh: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _si: "{ mask: '99 999 999', greedy: true, autoUnmask: true }",
    _sk: "{ mask: '999 999 999', greedy: true, autoUnmask: true }",
    _sl: "{ mask: '99 999999', greedy: true, autoUnmask: true }",
    _sm: "{ mask: '99 99 99 99', greedy: true, autoUnmask: true }",
    _sn: "{ mask: '99 999 99 99', greedy: true, autoUnmask: true }",
    _so: "{ mask: '9 9999999', greedy: true, autoUnmask: true }",
    _sr: "{ mask: '999-9999', greedy: true, autoUnmask: true }",
    _st: "{ mask: '999 9999', greedy: true, autoUnmask: true }",
    _sv: "{ mask: '9999 9999', greedy: true, autoUnmask: true }",
    _sy: "{ mask: '999 999 999', greedy: true, autoUnmask: true }",
    _sz: "{ mask: '9999 9999', greedy: true, autoUnmask: true }",
    _tc: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _td: "{ mask: '99 99 99 99', greedy: true, autoUnmask: true }",
    _tg: "{ mask: '99 99 99 99', greedy: true, autoUnmask: true }",
    _th: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _tj: "{ mask: '999 99 9999', greedy: true, autoUnmask: true }",
    _tm: "{ mask: '99 999999', greedy: true, autoUnmask: true }",
    _tn: "{ mask: '99 999 999', greedy: true, autoUnmask: true }",
    _to: "{ mask: '999 9999', greedy: true, autoUnmask: true }",
    _tr: "{ mask: '999 999 99 99', greedy: true, autoUnmask: true }",
    _tt: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _tv: "{ mask: '999999', greedy: true, autoUnmask: true }",
    _tw: "{ mask: '999 999 999', greedy: true, autoUnmask: true }",
    _tz: "{ mask: '999 999 999', greedy: true, autoUnmask: true }",
    _ua: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _ug: "{ mask: '999 999999', greedy: true, autoUnmask: true }",
    _us: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _uy: "{ mask: '99 999 999', greedy: true, autoUnmask: true }",
    _uz: "{ mask: '99 999 99 99', greedy: true, autoUnmask: true }",
    _va: "{ mask: '999 999 9999', greedy: true, autoUnmask: true }",
    _vc: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _ve: "{ mask: '999-9999999', greedy: true, autoUnmask: true }",
    _vg: "{ mask: '999-999-9999', greedy: true, autoUnmask: true }",
    _vn: "{ mask: '99 999 99 99', greedy: true, autoUnmask: true }",
    _vu: "{ mask: '999 9999', greedy: true, autoUnmask: true }",
    _ws: "{ mask: '999999', greedy: true, autoUnmask: true }",
    _ye: "{ mask: '999 999 999', greedy: true, autoUnmask: true }",
    _za: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }",
    _zm: "{ mask: '99 9999999', greedy: true, autoUnmask: true }",
    _zw: "{ mask: '99 999 9999', greedy: true, autoUnmask: true }"
};;
var module = angular.module('googleMap', []);

var placeSearch, autocomplete;
var componentForm = {
    street_number: { value: '', type: 'short_name' },
    route: { value: '', type: 'long_name' },
    neighborhood: { value: '', type: 'long_name' },
    sublocality: { value: '', type: 'long_name' },
    locality: { value: '', type: 'long_name' },
    sublocality_level_1: { value: '', type: 'long_name' },
    administrative_area_level_2: { value: '', type: 'long_name' },
    administrative_area_level_1: { value: '', type: 'long_name' },
    postal_code: { value: '', type: 'long_name' },
    country: { value: '', type: 'short_name' },
};

module.directive('ngMaps', function () {
    return {
        restrict: 'E',
        replace: true,
        templateUrl: "/App_Client/common/directives/GoogleMap/GoogleAddress.htm",
        scope: {
            address: '=ngModel',
            onlymapdisplay: '@onlymapdisplay',
            mapformid: '@mapformid'
        },
        controller: ["$scope", "common", "$rootScope", function ($scope, common, $rootScope) {
            $scope.NewLocation = false;
            $scope.LabelText = "Can't find your location?";
            $scope.onlymapdisplay = $scope.onlymapdisplay == "true";

            $scope.initialize = function () {
                if ($scope.onlymapdisplay == false)
                    $scope.initAutoComplete();

                if (IsNotNullorEmpty($scope.address.City))
                    $scope.calculateCoordinates(true);
            };

            $scope.initAutoComplete = function () {
                autocomplete = new google.maps.places.Autocomplete((document.forms[$scope.mapformid].autocomplete), { types: ['geocode'] });
                google.maps.event.addListener(autocomplete, 'place_changed', function () {
                    $scope.fillInAddress();
                    $scope.calculateCoordinates(false);
                });
            };

            $scope.$on('LoadAddress', function (e, args) {
                $scope.address = args;
                if ($scope.address)
                    $scope.calculateCoordinates(true);
            });

            //code to fill address. it is standard formate 
            $scope.fillInAddress = function () {
                var place = autocomplete.getPlace();

                $scope.address.Address1 = $scope.address.Address2 = $scope.address.City = $scope.address.County = $scope.address.StateRegionProvince = $scope.address.PostalCode = $scope.address.Country = '';

                for (var component in componentForm) {
                    componentForm[component].value = '';
                }

                //console.log(place.address_components);
                for (var i = 0; i < place.address_components.length; i++) {
                    var addressType = place.address_components[i].types[0];
                    if (componentForm[addressType]) {
                        componentForm[addressType].value = place.address_components[i][componentForm[addressType].type];
                    }
                }

                $scope.$apply(function () {
                    $scope.address.Address1 = componentForm["street_number"].value + ' ' + componentForm["route"].value;
                    $scope.address.Address2 = componentForm["neighborhood"].value + ' ' + (componentForm["sublocality"].value != '' ? componentForm["sublocality"].value : componentForm["sublocality_level_1"].value);
                    $scope.address.City = componentForm["locality"].value; //componentForm["locality"].value != '' ? componentForm["locality"].value : componentForm["sublocality_level_1"].value;
                    $scope.address.County = componentForm["administrative_area_level_2"].value;
                    $scope.address.StateRegionProvince = componentForm["administrative_area_level_1"].value;
                    $scope.address.PostalCode = componentForm["postal_code"].value;
                    $scope.address.Country = componentForm["country"].value;
                });
            }

            // code for calculate coordinates
            $scope.calculateCoordinates = function (obj) {
                var txtLatitude = '', txtLongitude = '', geocoder, address;

                if (obj == true) {
                    address = $scope.address.Address1 + ' ' +
                        $scope.address.Address2 + ' ' +
                        $scope.address.City + ' ' +
                        $scope.address.County + ' ' +
                        $scope.address.StateRegionProvince + ' ' + $scope.address.PostalCode + ' ' + $scope.address.Country;
                }
                else {
                    var txtLocation = document.forms[$scope.mapformid].autocomplete;

                    address = txtLocation.value;
                }

                geocoder = new google.maps.Geocoder();
                geocoder.geocode({ 'address': address }, function (results, status) {
                    if (status == google.maps.GeocoderStatus.OK) {

                        $scope.$apply(function () {
                            $scope.ShowAddress();
                        });

                        var location = results[0].geometry.location;
                        txtLatitude = location.lat();
                        txtLongitude = location.lng();
                        //txtLocation.value = results[0].formatted_address;

                        // code for set position in map start
                        var myLatlng = new google.maps.LatLng(txtLatitude, txtLongitude);
                        var myOptions = {
                            center: myLatlng,
                            zoom: 15,
                            mapTypeId: google.maps.MapTypeId.ROADMAP
                        };
                        var map = new google.maps.Map(document.getElementById($scope.mapformid), myOptions);

                        var marker = new google.maps.Marker({
                            position: myLatlng,
                            title: "lat: " + txtLatitude + " long: " + txtLongitude
                        });

                        marker.setMap(map);

                        var infowindow = new google.maps.InfoWindow({ content: "<b>Address:</b><br/> " + address + "" });
                        infowindow.open(map, marker);
                    }
                });
            }

            $scope.ShowAddress = function () {
                $scope.NewLocation = true;
                $scope.LabelText = "Reset Location";
            }

            $scope.CantFindLocation = function () {
                $scope.NewLocation = !$scope.NewLocation;
                if ($scope.NewLocation == true) {
                    $scope.ShowAddress();
                }
                else {
                    $scope.LabelText = "Can't find your location?";
                }
                $scope.ResetAddress();
            }

            $scope.ResetAddress = function () {
                document.getElementById($scope.mapformid).innerHTML = '';
                document.forms[$scope.mapformid].autocomplete.value = '';
                $scope.address.Address1 = $scope.address.Address2 = $scope.address.City = $scope.address.County = $scope.address.StateRegionProvince = $scope.address.PostalCode = $scope.address.Country = '';
            }

            $scope.initialize();
        }]
    };
});
;
/*!
* inputmask.js
* http://github.com/RobinHerbots/jquery.inputmask
* Copyright (c) 2010 - 2015 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 3.2.1-89
*/
!function(factory) {
    "function" == typeof define && define.amd ? define([ "inputmask.dependencyLib" ], factory) : "object" == typeof exports ? module.exports = factory(require("./inputmask.dependencyLib")) : factory(window.dependencyLib || jQuery);
}(function($) {
    function Inputmask(options) {
        this.el = void 0, this.opts = $.extend(!0, {}, this.defaults, options), this.noMasksCache = options && void 0 !== options.definitions, 
        this.userOptions = options || {}, resolveAlias(this.opts.alias, options, this.opts);
    }
    function isInputEventSupported(eventName) {
        var el = document.createElement("input"), evName = "on" + eventName, isSupported = evName in el;
        return isSupported || (el.setAttribute(evName, "return;"), isSupported = "function" == typeof el[evName]), 
        el = null, isSupported;
    }
    function isInputTypeSupported(inputType) {
        var isSupported = "text" === inputType || "tel" === inputType || "password" === inputType;
        if (!isSupported) {
            var el = document.createElement("input");
            el.setAttribute("type", inputType), isSupported = "text" === el.type, el = null;
        }
        return isSupported;
    }
    function resolveAlias(aliasStr, options, opts) {
        var aliasDefinition = opts.aliases[aliasStr];
        return aliasDefinition ? (aliasDefinition.alias && resolveAlias(aliasDefinition.alias, void 0, opts), 
        $.extend(!0, opts, aliasDefinition), $.extend(!0, opts, options), !0) : (null === opts.mask && (opts.mask = aliasStr), 
        !1);
    }
    function importAttributeOptions(npt, opts, userOptions) {
        function importOption(option) {
            var optionData = npt.getAttribute("data-inputmask-" + option.toLowerCase());
            null !== optionData && (optionData = "boolean" == typeof optionData ? optionData : optionData.toString(), 
            "string" == typeof optionData && 0 === option.indexOf("on") && (optionData = eval("(" + optionData + ")")), 
            "mask" === option && 0 === optionData.indexOf("[") ? (userOptions[option] = optionData.replace(/[\s[\]]/g, "").split(","), 
            userOptions[option][0] = userOptions[option][0].replace("'", ""), userOptions[option][userOptions[option].length - 1] = userOptions[option][userOptions[option].length - 1].replace("'", "")) : userOptions[option] = optionData);
        }
        var attrOptions = npt.getAttribute("data-inputmask");
        if (attrOptions && "" !== attrOptions) try {
            attrOptions = attrOptions.replace(new RegExp("'", "g"), '"');
            var dataoptions = $.parseJSON("{" + attrOptions + "}");
            $.extend(!0, userOptions, dataoptions);
        } catch (ex) {}
        for (var option in opts) importOption(option);
        if (userOptions.alias) {
            resolveAlias(userOptions.alias, userOptions, opts);
            for (option in opts) importOption(option);
        }
        return $.extend(!0, opts, userOptions), opts;
    }
    function generateMaskSet(opts, nocache) {
        function analyseMask(mask) {
            function MaskToken(isGroup, isOptional, isQuantifier, isAlternator) {
                this.matches = [], this.isGroup = isGroup || !1, this.isOptional = isOptional || !1, 
                this.isQuantifier = isQuantifier || !1, this.isAlternator = isAlternator || !1, 
                this.quantifier = {
                    min: 1,
                    max: 1
                };
            }
            function insertTestDefinition(mtoken, element, position) {
                var maskdef = opts.definitions[element];
                position = void 0 !== position ? position : mtoken.matches.length;
                var prevMatch = mtoken.matches[position - 1];
                if (maskdef && !escaped) {
                    maskdef.placeholder = $.isFunction(maskdef.placeholder) ? maskdef.placeholder.call(this, opts) : maskdef.placeholder;
                    for (var prevalidators = maskdef.prevalidator, prevalidatorsL = prevalidators ? prevalidators.length : 0, i = 1; i < maskdef.cardinality; i++) {
                        var prevalidator = prevalidatorsL >= i ? prevalidators[i - 1] : [], validator = prevalidator.validator, cardinality = prevalidator.cardinality;
                        mtoken.matches.splice(position++, 0, {
                            fn: validator ? "string" == typeof validator ? new RegExp(validator) : new function() {
                                this.test = validator;
                            }() : new RegExp("."),
                            cardinality: cardinality ? cardinality : 1,
                            optionality: mtoken.isOptional,
                            newBlockMarker: void 0 === prevMatch || prevMatch.def !== (maskdef.definitionSymbol || element),
                            casing: maskdef.casing,
                            def: maskdef.definitionSymbol || element,
                            placeholder: maskdef.placeholder,
                            mask: element
                        }), prevMatch = mtoken.matches[position - 1];
                    }
                    mtoken.matches.splice(position++, 0, {
                        fn: maskdef.validator ? "string" == typeof maskdef.validator ? new RegExp(maskdef.validator) : new function() {
                            this.test = maskdef.validator;
                        }() : new RegExp("."),
                        cardinality: maskdef.cardinality,
                        optionality: mtoken.isOptional,
                        newBlockMarker: void 0 === prevMatch || prevMatch.def !== (maskdef.definitionSymbol || element),
                        casing: maskdef.casing,
                        def: maskdef.definitionSymbol || element,
                        placeholder: maskdef.placeholder,
                        mask: element
                    });
                } else mtoken.matches.splice(position++, 0, {
                    fn: null,
                    cardinality: 0,
                    optionality: mtoken.isOptional,
                    newBlockMarker: void 0 === prevMatch || prevMatch.def !== element,
                    casing: null,
                    def: element,
                    placeholder: void 0,
                    mask: element
                }), escaped = !1;
            }
            function verifyGroupMarker(lastMatch, isOpenGroup) {
                lastMatch.isGroup && (lastMatch.isGroup = !1, insertTestDefinition(lastMatch, opts.groupmarker.start, 0), 
                isOpenGroup !== !0 && insertTestDefinition(lastMatch, opts.groupmarker.end));
            }
            function maskCurrentToken(m, currentToken, lastMatch, extraCondition) {
                currentToken.matches.length > 0 && (void 0 === extraCondition || extraCondition) && (lastMatch = currentToken.matches[currentToken.matches.length - 1], 
                verifyGroupMarker(lastMatch)), insertTestDefinition(currentToken, m);
            }
            function defaultCase() {
                if (openenings.length > 0) {
                    if (currentOpeningToken = openenings[openenings.length - 1], maskCurrentToken(m, currentOpeningToken, lastMatch, !currentOpeningToken.isAlternator), 
                    currentOpeningToken.isAlternator) {
                        alternator = openenings.pop();
                        for (var mndx = 0; mndx < alternator.matches.length; mndx++) alternator.matches[mndx].isGroup = !1;
                        openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1], 
                        currentOpeningToken.matches.push(alternator)) : currentToken.matches.push(alternator);
                    }
                } else maskCurrentToken(m, currentToken, lastMatch);
            }
            function reverseTokens(maskToken) {
                function reverseStatic(st) {
                    return st === opts.optionalmarker.start ? st = opts.optionalmarker.end : st === opts.optionalmarker.end ? st = opts.optionalmarker.start : st === opts.groupmarker.start ? st = opts.groupmarker.end : st === opts.groupmarker.end && (st = opts.groupmarker.start), 
                    st;
                }
                maskToken.matches = maskToken.matches.reverse();
                for (var match in maskToken.matches) {
                    var intMatch = parseInt(match);
                    if (maskToken.matches[match].isQuantifier && maskToken.matches[intMatch + 1] && maskToken.matches[intMatch + 1].isGroup) {
                        var qt = maskToken.matches[match];
                        maskToken.matches.splice(match, 1), maskToken.matches.splice(intMatch + 1, 0, qt);
                    }
                    void 0 !== maskToken.matches[match].matches ? maskToken.matches[match] = reverseTokens(maskToken.matches[match]) : maskToken.matches[match] = reverseStatic(maskToken.matches[match]);
                }
                return maskToken;
            }
            for (var match, m, openingToken, currentOpeningToken, alternator, lastMatch, groupToken, tokenizer = /(?:[?*+]|\{[0-9\+\*]+(?:,[0-9\+\*]*)?\})|[^.?*+^${[]()|\\]+|./g, escaped = !1, currentToken = new MaskToken(), openenings = [], maskTokens = []; match = tokenizer.exec(mask); ) if (m = match[0], 
            escaped) defaultCase(); else switch (m.charAt(0)) {
              case opts.escapeChar:
                escaped = !0;
                break;

              case opts.optionalmarker.end:
              case opts.groupmarker.end:
                if (openingToken = openenings.pop(), void 0 !== openingToken) if (openenings.length > 0) {
                    if (currentOpeningToken = openenings[openenings.length - 1], currentOpeningToken.matches.push(openingToken), 
                    currentOpeningToken.isAlternator) {
                        alternator = openenings.pop();
                        for (var mndx = 0; mndx < alternator.matches.length; mndx++) alternator.matches[mndx].isGroup = !1;
                        openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1], 
                        currentOpeningToken.matches.push(alternator)) : currentToken.matches.push(alternator);
                    }
                } else currentToken.matches.push(openingToken); else defaultCase();
                break;

              case opts.optionalmarker.start:
                openenings.push(new MaskToken(!1, !0));
                break;

              case opts.groupmarker.start:
                openenings.push(new MaskToken(!0));
                break;

              case opts.quantifiermarker.start:
                var quantifier = new MaskToken(!1, !1, !0);
                m = m.replace(/[{}]/g, "");
                var mq = m.split(","), mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]), mq1 = 1 === mq.length ? mq0 : isNaN(mq[1]) ? mq[1] : parseInt(mq[1]);
                if (("*" === mq1 || "+" === mq1) && (mq0 = "*" === mq1 ? 0 : 1), quantifier.quantifier = {
                    min: mq0,
                    max: mq1
                }, openenings.length > 0) {
                    var matches = openenings[openenings.length - 1].matches;
                    match = matches.pop(), match.isGroup || (groupToken = new MaskToken(!0), groupToken.matches.push(match), 
                    match = groupToken), matches.push(match), matches.push(quantifier);
                } else match = currentToken.matches.pop(), match.isGroup || (groupToken = new MaskToken(!0), 
                groupToken.matches.push(match), match = groupToken), currentToken.matches.push(match), 
                currentToken.matches.push(quantifier);
                break;

              case opts.alternatormarker:
                openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1], 
                lastMatch = currentOpeningToken.matches.pop()) : lastMatch = currentToken.matches.pop(), 
                lastMatch.isAlternator ? openenings.push(lastMatch) : (alternator = new MaskToken(!1, !1, !1, !0), 
                alternator.matches.push(lastMatch), openenings.push(alternator));
                break;

              default:
                defaultCase();
            }
            for (;openenings.length > 0; ) openingToken = openenings.pop(), verifyGroupMarker(openingToken, !0), 
            currentToken.matches.push(openingToken);
            return currentToken.matches.length > 0 && (lastMatch = currentToken.matches[currentToken.matches.length - 1], 
            verifyGroupMarker(lastMatch), maskTokens.push(currentToken)), opts.numericInput && reverseTokens(maskTokens[0]), 
            maskTokens;
        }
        function generateMask(mask, metadata) {
            if (null === mask || "" === mask) return void 0;
            if (1 === mask.length && opts.greedy === !1 && 0 !== opts.repeat && (opts.placeholder = ""), 
            opts.repeat > 0 || "*" === opts.repeat || "+" === opts.repeat) {
                var repeatStart = "*" === opts.repeat ? 0 : "+" === opts.repeat ? 1 : opts.repeat;
                mask = opts.groupmarker.start + mask + opts.groupmarker.end + opts.quantifiermarker.start + repeatStart + "," + opts.repeat + opts.quantifiermarker.end;
            }
            var masksetDefinition;
            return void 0 === Inputmask.prototype.masksCache[mask] || nocache === !0 ? (masksetDefinition = {
                mask: mask,
                maskToken: analyseMask(mask),
                validPositions: {},
                _buffer: void 0,
                buffer: void 0,
                tests: {},
                metadata: metadata
            }, nocache !== !0 && (Inputmask.prototype.masksCache[opts.numericInput ? mask.split("").reverse().join("") : mask] = masksetDefinition)) : masksetDefinition = $.extend(!0, {}, Inputmask.prototype.masksCache[mask]), 
            masksetDefinition;
        }
        function preProcessMask(mask) {
            return mask = mask.toString();
        }
        var ms;
        if ($.isFunction(opts.mask) && (opts.mask = opts.mask.call(this, opts)), $.isArray(opts.mask)) {
            if (opts.mask.length > 1) {
                opts.keepStatic = null === opts.keepStatic ? !0 : opts.keepStatic;
                var altMask = "(";
                return $.each(opts.numericInput ? opts.mask.reverse() : opts.mask, function(ndx, msk) {
                    altMask.length > 1 && (altMask += ")|("), altMask += preProcessMask(void 0 === msk.mask || $.isFunction(msk.mask) ? msk : msk.mask);
                }), altMask += ")", generateMask(altMask, opts.mask);
            }
            opts.mask = opts.mask.pop();
        }
        return opts.mask && (ms = void 0 === opts.mask.mask || $.isFunction(opts.mask.mask) ? generateMask(preProcessMask(opts.mask), opts.mask) : generateMask(preProcessMask(opts.mask.mask), opts.mask)), 
        ms;
    }
    function maskScope(actionObj, maskset, opts) {
        function getMaskTemplate(baseOnInput, minimalPos, includeInput) {
            minimalPos = minimalPos || 0;
            var ndxIntlzr, test, testPos, maskTemplate = [], pos = 0;
            do {
                if (baseOnInput === !0 && getMaskSet().validPositions[pos]) {
                    var validPos = getMaskSet().validPositions[pos];
                    test = validPos.match, ndxIntlzr = validPos.locator.slice(), maskTemplate.push(includeInput === !0 ? validPos.input : getPlaceholder(pos, test));
                } else testPos = getTestTemplate(pos, ndxIntlzr, pos - 1), test = testPos.match, 
                ndxIntlzr = testPos.locator.slice(), maskTemplate.push(getPlaceholder(pos, test));
                pos++;
            } while ((void 0 === maxLength || maxLength > pos - 1) && null !== test.fn || null === test.fn && "" !== test.def || minimalPos >= pos);
            return maskTemplate.pop(), maskTemplate;
        }
        function getMaskSet() {
            return maskset;
        }
        function resetMaskSet(soft) {
            var maskset = getMaskSet();
            maskset.buffer = void 0, maskset.tests = {}, soft !== !0 && (maskset._buffer = void 0, 
            maskset.validPositions = {}, maskset.p = 0);
        }
        function getLastValidPosition(closestTo, strict) {
            var maskset = getMaskSet(), lastValidPosition = -1, valids = maskset.validPositions;
            void 0 === closestTo && (closestTo = -1);
            var before = lastValidPosition, after = lastValidPosition;
            for (var posNdx in valids) {
                var psNdx = parseInt(posNdx);
                valids[psNdx] && (strict || null !== valids[psNdx].match.fn) && (closestTo >= psNdx && (before = psNdx), 
                psNdx >= closestTo && (after = psNdx));
            }
            return lastValidPosition = -1 !== before && closestTo - before > 1 || closestTo > after ? before : after;
        }
        function setValidPosition(pos, validTest, fromSetValid) {
            if (opts.insertMode && void 0 !== getMaskSet().validPositions[pos] && void 0 === fromSetValid) {
                var i, positionsClone = $.extend(!0, {}, getMaskSet().validPositions), lvp = getLastValidPosition();
                for (i = pos; lvp >= i; i++) delete getMaskSet().validPositions[i];
                getMaskSet().validPositions[pos] = validTest;
                var j, valid = !0, vps = getMaskSet().validPositions;
                for (i = j = pos; lvp >= i; i++) {
                    var t = positionsClone[i];
                    if (void 0 !== t) for (var posMatch = j, prevPosMatch = -1; posMatch < getMaskLength() && (null == t.match.fn && vps[i] && (vps[i].match.optionalQuantifier === !0 || vps[i].match.optionality === !0) || null != t.match.fn); ) {
                        if (null === t.match.fn || !opts.keepStatic && vps[i] && (void 0 !== vps[i + 1] && getTests(i + 1, vps[i].locator.slice(), i).length > 1 || void 0 !== vps[i].alternation) ? posMatch++ : posMatch = seekNext(j), 
                        positionCanMatchDefinition(posMatch, t.match.def)) {
                            valid = isValid(posMatch, t.input, !0, !0) !== !1, j = posMatch;
                            break;
                        }
                        if (valid = null == t.match.fn, prevPosMatch === posMatch) break;
                        prevPosMatch = posMatch;
                    }
                    if (!valid) break;
                }
                if (!valid) return getMaskSet().validPositions = $.extend(!0, {}, positionsClone), 
                !1;
            } else getMaskSet().validPositions[pos] = validTest;
            return !0;
        }
        function stripValidPositions(start, end, nocheck, strict) {
            var i, startPos = start;
            for (getMaskSet().p = start, i = startPos; end > i; i++) void 0 !== getMaskSet().validPositions[i] && (nocheck === !0 || opts.canClearPosition(getMaskSet(), i, getLastValidPosition(), strict, opts) !== !1) && delete getMaskSet().validPositions[i];
            for (resetMaskSet(!0), i = startPos + 1; i <= getLastValidPosition(); ) {
                for (;void 0 !== getMaskSet().validPositions[startPos]; ) startPos++;
                var s = getMaskSet().validPositions[startPos];
                startPos > i && (i = startPos + 1);
                var t = getMaskSet().validPositions[i];
                void 0 !== t && isMask(i) && void 0 === s ? (positionCanMatchDefinition(startPos, t.match.def) && isValid(startPos, t.input, !0) !== !1 && (delete getMaskSet().validPositions[i], 
                i++), startPos++) : i++;
            }
            var lvp = getLastValidPosition(), ml = getMaskLength();
            for (strict !== !0 && nocheck !== !0 && void 0 !== getMaskSet().validPositions[lvp] && getMaskSet().validPositions[lvp].input === opts.radixPoint && delete getMaskSet().validPositions[lvp], 
            i = lvp + 1; ml >= i; i++) getMaskSet().validPositions[i] && delete getMaskSet().validPositions[i];
            resetMaskSet(!0);
        }
        function getTestTemplate(pos, ndxIntlzr, tstPs) {
            var testPos = getMaskSet().validPositions[pos];
            if (void 0 === testPos) for (var testPositions = getTests(pos, ndxIntlzr, tstPs), lvp = getLastValidPosition(), lvTest = getMaskSet().validPositions[lvp] || getTests(0)[0], lvTestAltArr = void 0 !== lvTest.alternation ? lvTest.locator[lvTest.alternation].toString().split(",") : [], ndx = 0; ndx < testPositions.length && (testPos = testPositions[ndx], 
            !(testPos.match && (opts.greedy && testPos.match.optionalQuantifier !== !0 || (testPos.match.optionality === !1 || testPos.match.newBlockMarker === !1) && testPos.match.optionalQuantifier !== !0) && (void 0 === lvTest.alternation || lvTest.alternation !== testPos.alternation || void 0 !== testPos.locator[lvTest.alternation] && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","), lvTestAltArr)))); ndx++) ;
            return testPos;
        }
        function getTest(pos) {
            return getMaskSet().validPositions[pos] ? getMaskSet().validPositions[pos].match : getTests(pos)[0].match;
        }
        function positionCanMatchDefinition(pos, def) {
            for (var valid = !1, tests = getTests(pos), tndx = 0; tndx < tests.length; tndx++) if (tests[tndx].match && tests[tndx].match.def === def) {
                valid = !0;
                break;
            }
            return valid;
        }
        function getTests(pos, ndxIntlzr, tstPs, cacheable) {
            function resolveTestFromToken(maskToken, ndxInitializer, loopNdx, quantifierRecurse) {
                function handleMatch(match, loopNdx, quantifierRecurse) {
                    if (testPos > 1e4) throw "Inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. " + getMaskSet().mask;
                    if (testPos === pos && void 0 === match.matches) return matches.push({
                        match: match,
                        locator: loopNdx.reverse()
                    }), !0;
                    if (void 0 !== match.matches) {
                        if (match.isGroup && quantifierRecurse !== match) {
                            if (match = handleMatch(maskToken.matches[$.inArray(match, maskToken.matches) + 1], loopNdx)) return !0;
                        } else if (match.isOptional) {
                            var optionalToken = match;
                            if (match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse)) {
                                if (latestMatch = matches[matches.length - 1].match, isFirstMatch = 0 === $.inArray(latestMatch, optionalToken.matches), 
                                !isFirstMatch) return !0;
                                insertStop = !0, testPos = pos;
                            }
                        } else if (match.isAlternator) {
                            var maltMatches, alternateToken = match, malternateMatches = [], currentMatches = matches.slice(), loopNdxCnt = loopNdx.length, altIndex = ndxInitializer.length > 0 ? ndxInitializer.shift() : -1;
                            if (-1 === altIndex || "string" == typeof altIndex) {
                                var currentPos = testPos, ndxInitializerClone = ndxInitializer.slice(), altIndexArr = [];
                                "string" == typeof altIndex && (altIndexArr = altIndex.split(","));
                                for (var amndx = 0; amndx < alternateToken.matches.length; amndx++) {
                                    if (matches = [], match = handleMatch(alternateToken.matches[amndx], [ amndx ].concat(loopNdx), quantifierRecurse) || match, 
                                    match !== !0 && void 0 !== match && altIndexArr[altIndexArr.length - 1] < alternateToken.matches.length) {
                                        var ntndx = maskToken.matches.indexOf(match) + 1;
                                        maskToken.matches.length > ntndx && (match = handleMatch(maskToken.matches[ntndx], [ ntndx ].concat(loopNdx.slice(1, loopNdx.length)), quantifierRecurse), 
                                        match && (altIndexArr.push(ntndx.toString()), $.each(matches, function(ndx, lmnt) {
                                            lmnt.alternation = loopNdx.length - 1;
                                        })));
                                    }
                                    maltMatches = matches.slice(), testPos = currentPos, matches = [];
                                    for (var i = 0; i < ndxInitializerClone.length; i++) ndxInitializer[i] = ndxInitializerClone[i];
                                    for (var ndx1 = 0; ndx1 < maltMatches.length; ndx1++) {
                                        var altMatch = maltMatches[ndx1];
                                        altMatch.alternation = altMatch.alternation || loopNdxCnt;
                                        for (var ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) {
                                            var altMatch2 = malternateMatches[ndx2];
                                            if (altMatch.match.mask === altMatch2.match.mask && ("string" != typeof altIndex || -1 !== $.inArray(altMatch.locator[altMatch.alternation].toString(), altIndexArr))) {
                                                maltMatches.splice(ndx1, 1), ndx1--, altMatch2.locator[altMatch.alternation] = altMatch2.locator[altMatch.alternation] + "," + altMatch.locator[altMatch.alternation], 
                                                altMatch2.alternation = altMatch.alternation;
                                                break;
                                            }
                                        }
                                    }
                                    malternateMatches = malternateMatches.concat(maltMatches);
                                }
                                "string" == typeof altIndex && (malternateMatches = $.map(malternateMatches, function(lmnt, ndx) {
                                    if (isFinite(ndx)) {
                                        var mamatch, alternation = lmnt.alternation, altLocArr = lmnt.locator[alternation].toString().split(",");
                                        lmnt.locator[alternation] = void 0, lmnt.alternation = void 0;
                                        for (var alndx = 0; alndx < altLocArr.length; alndx++) mamatch = -1 !== $.inArray(altLocArr[alndx], altIndexArr), 
                                        mamatch && (void 0 !== lmnt.locator[alternation] ? (lmnt.locator[alternation] += ",", 
                                        lmnt.locator[alternation] += altLocArr[alndx]) : lmnt.locator[alternation] = parseInt(altLocArr[alndx]), 
                                        lmnt.alternation = alternation);
                                        if (void 0 !== lmnt.locator[alternation]) return lmnt;
                                    }
                                })), matches = currentMatches.concat(malternateMatches), testPos = pos, insertStop = matches.length > 0;
                            } else match = alternateToken.matches[altIndex] ? handleMatch(alternateToken.matches[altIndex], [ altIndex ].concat(loopNdx), quantifierRecurse) : !1;
                            if (match) return !0;
                        } else if (match.isQuantifier && quantifierRecurse !== maskToken.matches[$.inArray(match, maskToken.matches) - 1]) for (var qt = match, qndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; qndx < (isNaN(qt.quantifier.max) ? qndx + 1 : qt.quantifier.max) && pos >= testPos; qndx++) {
                            var tokenGroup = maskToken.matches[$.inArray(qt, maskToken.matches) - 1];
                            if (match = handleMatch(tokenGroup, [ qndx ].concat(loopNdx), tokenGroup)) {
                                if (latestMatch = matches[matches.length - 1].match, latestMatch.optionalQuantifier = qndx > qt.quantifier.min - 1, 
                                isFirstMatch = 0 === $.inArray(latestMatch, tokenGroup.matches)) {
                                    if (qndx > qt.quantifier.min - 1) {
                                        insertStop = !0, testPos = pos;
                                        break;
                                    }
                                    return !0;
                                }
                                return !0;
                            }
                        } else if (match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse)) return !0;
                    } else testPos++;
                }
                for (var tndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; tndx < maskToken.matches.length; tndx++) if (maskToken.matches[tndx].isQuantifier !== !0) {
                    var match = handleMatch(maskToken.matches[tndx], [ tndx ].concat(loopNdx), quantifierRecurse);
                    if (match && testPos === pos) return match;
                    if (testPos > pos) break;
                }
            }
            var latestMatch, isFirstMatch, maskTokens = getMaskSet().maskToken, testPos = ndxIntlzr ? tstPs : 0, ndxInitializer = ndxIntlzr || [ 0 ], matches = [], insertStop = !1;
            if (cacheable === !0 && getMaskSet().tests[pos]) return getMaskSet().tests[pos];
            if (void 0 === ndxIntlzr) {
                for (var test, previousPos = pos - 1; void 0 === (test = getMaskSet().validPositions[previousPos]) && previousPos > -1 && (!getMaskSet().tests[previousPos] || void 0 === (test = getMaskSet().tests[previousPos][0])); ) previousPos--;
                void 0 !== test && previousPos > -1 && (testPos = previousPos, ndxInitializer = test.locator.slice());
            }
            for (var mtndx = ndxInitializer.shift(); mtndx < maskTokens.length; mtndx++) {
                var match = resolveTestFromToken(maskTokens[mtndx], ndxInitializer, [ mtndx ]);
                if (match && testPos === pos || testPos > pos) break;
            }
            return (0 === matches.length || insertStop) && matches.push({
                match: {
                    fn: null,
                    cardinality: 0,
                    optionality: !0,
                    casing: null,
                    def: ""
                },
                locator: []
            }), getMaskSet().tests[pos] = $.extend(!0, [], matches), getMaskSet().tests[pos];
        }
        function getBufferTemplate() {
            return void 0 === getMaskSet()._buffer && (getMaskSet()._buffer = getMaskTemplate(!1, 1)), 
            getMaskSet()._buffer;
        }
        function getBuffer() {
            return void 0 === getMaskSet().buffer && (getMaskSet().buffer = getMaskTemplate(!0, getLastValidPosition(), !0)), 
            getMaskSet().buffer;
        }
        function refreshFromBuffer(start, end, buffer) {
            var i;
            if (buffer = buffer || getBuffer().slice(), start === !0) resetMaskSet(), start = 0, 
            end = buffer.length; else for (i = start; end > i; i++) delete getMaskSet().validPositions[i], 
            delete getMaskSet().tests[i];
            for (i = start; end > i; i++) resetMaskSet(!0), buffer[i] !== opts.skipOptionalPartCharacter && isValid(i, buffer[i], !0, !0);
        }
        function casing(elem, test) {
            switch (test.casing) {
              case "upper":
                elem = elem.toUpperCase();
                break;

              case "lower":
                elem = elem.toLowerCase();
            }
            return elem;
        }
        function checkAlternationMatch(altArr1, altArr2) {
            for (var altArrC = opts.greedy ? altArr2 : altArr2.slice(0, 1), isMatch = !1, alndx = 0; alndx < altArr1.length; alndx++) if (-1 !== $.inArray(altArr1[alndx], altArrC)) {
                isMatch = !0;
                break;
            }
            return isMatch;
        }
        function isValid(pos, c, strict, fromSetValid) {
            function _isValid(position, c, strict, fromSetValid) {
                var rslt = !1;
                return $.each(getTests(position), function(ndx, tst) {
                    for (var test = tst.match, loopend = c ? 1 : 0, chrs = "", i = test.cardinality; i > loopend; i--) chrs += getBufferElement(position - (i - 1));
                    if (c && (chrs += c), rslt = null != test.fn ? test.fn.test(chrs, getMaskSet(), position, strict, opts) : c !== test.def && c !== opts.skipOptionalPartCharacter || "" === test.def ? !1 : {
                        c: test.def,
                        pos: position
                    }, rslt !== !1) {
                        var elem = void 0 !== rslt.c ? rslt.c : c;
                        elem = elem === opts.skipOptionalPartCharacter && null === test.fn ? test.def : elem;
                        var validatedPos = position, possibleModifiedBuffer = getBuffer();
                        if (void 0 !== rslt.remove && ($.isArray(rslt.remove) || (rslt.remove = [ rslt.remove ]), 
                        $.each(rslt.remove.sort(function(a, b) {
                            return b - a;
                        }), function(ndx, lmnt) {
                            stripValidPositions(lmnt, lmnt + 1, !0);
                        })), void 0 !== rslt.insert && ($.isArray(rslt.insert) || (rslt.insert = [ rslt.insert ]), 
                        $.each(rslt.insert.sort(function(a, b) {
                            return a - b;
                        }), function(ndx, lmnt) {
                            isValid(lmnt.pos, lmnt.c, !0);
                        })), rslt.refreshFromBuffer) {
                            var refresh = rslt.refreshFromBuffer;
                            if (strict = !0, refreshFromBuffer(refresh === !0 ? refresh : refresh.start, refresh.end, possibleModifiedBuffer), 
                            void 0 === rslt.pos && void 0 === rslt.c) return rslt.pos = getLastValidPosition(), 
                            !1;
                            if (validatedPos = void 0 !== rslt.pos ? rslt.pos : position, validatedPos !== position) return rslt = $.extend(rslt, isValid(validatedPos, elem, !0)), 
                            !1;
                        } else if (rslt !== !0 && void 0 !== rslt.pos && rslt.pos !== position && (validatedPos = rslt.pos, 
                        refreshFromBuffer(position, validatedPos), validatedPos !== position)) return rslt = $.extend(rslt, isValid(validatedPos, elem, !0)), 
                        !1;
                        return rslt !== !0 && void 0 === rslt.pos && void 0 === rslt.c ? !1 : (ndx > 0 && resetMaskSet(!0), 
                        setValidPosition(validatedPos, $.extend({}, tst, {
                            input: casing(elem, test)
                        }), fromSetValid) || (rslt = !1), !1);
                    }
                }), rslt;
            }
            function alternate(pos, c, strict, fromSetValid) {
                for (var lastAlt, alternation, isValidRslt, altPos, i, validPos, validPsClone = $.extend(!0, {}, getMaskSet().validPositions), lAlt = getLastValidPosition(); lAlt >= 0 && (altPos = getMaskSet().validPositions[lAlt], 
                !altPos || void 0 === altPos.alternation || (lastAlt = lAlt, alternation = getMaskSet().validPositions[lastAlt].alternation, 
                getTestTemplate(lastAlt).locator[altPos.alternation] === altPos.locator[altPos.alternation])); lAlt--) ;
                if (void 0 !== alternation) {
                    lastAlt = parseInt(lastAlt);
                    for (var decisionPos in getMaskSet().validPositions) if (decisionPos = parseInt(decisionPos), 
                    altPos = getMaskSet().validPositions[decisionPos], decisionPos >= lastAlt && void 0 !== altPos.alternation) {
                        var altNdxs = getMaskSet().validPositions[lastAlt].locator[alternation].toString().split(","), decisionTaker = altPos.locator[alternation] || altNdxs[0];
                        decisionTaker.length > 0 && (decisionTaker = decisionTaker.split(",")[0]);
                        for (var mndx = 0; mndx < altNdxs.length; mndx++) if (decisionTaker < altNdxs[mndx]) {
                            for (var possibilityPos, possibilities, dp = decisionPos; dp >= 0; dp--) if (possibilityPos = getMaskSet().validPositions[dp], 
                            void 0 !== possibilityPos) {
                                possibilities = possibilityPos.locator[alternation], possibilityPos.locator[alternation] = parseInt(altNdxs[mndx]);
                                break;
                            }
                            if (decisionTaker !== possibilityPos.locator[alternation]) {
                                var validInputs = [], staticInputsBeforePos = 0;
                                for (i = decisionPos + 1; i < getLastValidPosition() + 1; i++) validPos = getMaskSet().validPositions[i], 
                                validPos && (null != validPos.match.fn ? validInputs.push(validPos.input) : pos > i && staticInputsBeforePos++), 
                                delete getMaskSet().validPositions[i], delete getMaskSet().tests[i];
                                for (resetMaskSet(!0), opts.keepStatic = !opts.keepStatic, isValidRslt = !0; validInputs.length > 0; ) {
                                    var input = validInputs.shift();
                                    if (input !== opts.skipOptionalPartCharacter && !(isValidRslt = isValid(getLastValidPosition() + 1, input, !1, !0))) break;
                                }
                                if (possibilityPos.alternation = alternation, possibilityPos.locator[alternation] = possibilities, 
                                isValidRslt) {
                                    var targetLvp = getLastValidPosition(pos) + 1, staticInputsBeforePosAlternate = 0;
                                    for (i = decisionPos + 1; i < getLastValidPosition() + 1; i++) validPos = getMaskSet().validPositions[i], 
                                    validPos && null == validPos.match.fn && pos > i && staticInputsBeforePosAlternate++;
                                    pos += staticInputsBeforePosAlternate - staticInputsBeforePos, isValidRslt = isValid(pos > targetLvp ? targetLvp : pos, c, strict, fromSetValid);
                                }
                                if (opts.keepStatic = !opts.keepStatic, isValidRslt) return isValidRslt;
                                resetMaskSet(), getMaskSet().validPositions = $.extend(!0, {}, validPsClone);
                            }
                        }
                        break;
                    }
                }
                return !1;
            }
            function trackbackAlternations(originalPos, newPos) {
                for (var vp = getMaskSet().validPositions[newPos], targetLocator = vp.locator, tll = targetLocator.length, ps = originalPos; newPos > ps; ps++) if (!isMask(ps)) {
                    var tests = getTests(ps), bestMatch = tests[0], equality = -1;
                    $.each(tests, function(ndx, tst) {
                        for (var i = 0; tll > i; i++) tst.locator[i] && checkAlternationMatch(tst.locator[i].toString().split(","), targetLocator[i].toString().split(",")) && i > equality && (equality = i, 
                        bestMatch = tst);
                    }), setValidPosition(ps, $.extend({}, bestMatch, {
                        input: bestMatch.match.def
                    }), !0);
                }
            }
            strict = strict === !0;
            for (var buffer = getBuffer(), pndx = pos - 1; pndx > -1 && !getMaskSet().validPositions[pndx]; pndx--) ;
            for (pndx++; pos > pndx; pndx++) void 0 === getMaskSet().validPositions[pndx] && ((!isMask(pndx) || buffer[pndx] !== getPlaceholder(pndx)) && getTests(pndx).length > 1 || buffer[pndx] === opts.radixPoint || "0" === buffer[pndx] && $.inArray(opts.radixPoint, buffer) < pndx) && _isValid(pndx, buffer[pndx], !0);
            var maskPos = pos, result = !1, positionsClone = $.extend(!0, {}, getMaskSet().validPositions);
            if (maskPos < getMaskLength() && (getBuffer(), result = _isValid(maskPos, c, strict, fromSetValid), 
            (!strict || fromSetValid) && result === !1)) {
                var currentPosValid = getMaskSet().validPositions[maskPos];
                if (!currentPosValid || null !== currentPosValid.match.fn || currentPosValid.match.def !== c && c !== opts.skipOptionalPartCharacter) {
                    if ((opts.insertMode || void 0 === getMaskSet().validPositions[seekNext(maskPos)]) && !isMask(maskPos)) for (var nPos = maskPos + 1, snPos = seekNext(maskPos); snPos >= nPos; nPos++) if (result = _isValid(nPos, c, strict, fromSetValid), 
                    result !== !1) {
                        trackbackAlternations(maskPos, nPos), maskPos = nPos;
                        break;
                    }
                } else result = {
                    caret: seekNext(maskPos)
                };
            }
            if (result === !1 && opts.keepStatic && isComplete(buffer) && (result = alternate(pos, c, strict, fromSetValid)), 
            result === !0 && (result = {
                pos: maskPos
            }), $.isFunction(opts.postValidation) && result !== !1 && !strict) {
                resetMaskSet(!0);
                var postValidResult = opts.postValidation(getBuffer(), opts);
                if (postValidResult) {
                    if (postValidResult.refreshFromBuffer) {
                        var refresh = postValidResult.refreshFromBuffer;
                        refreshFromBuffer(refresh === !0 ? refresh : refresh.start, refresh.end, postValidResult.buffer), 
                        resetMaskSet(!0), result = postValidResult;
                    }
                } else resetMaskSet(!0), getMaskSet().validPositions = $.extend(!0, {}, positionsClone), 
                result = !1;
            }
            return result;
        }
        function isMask(pos) {
            var test = getTest(pos);
            if (null != test.fn) return test.fn;
            if (!opts.keepStatic && void 0 === getMaskSet().validPositions[pos]) {
                for (var tests = getTests(pos), staticAlternations = !0, i = 0; i < tests.length; i++) if ("" !== tests[i].match.def && (void 0 === tests[i].alternation || tests[i].locator[tests[i].alternation].length > 1)) {
                    staticAlternations = !1;
                    break;
                }
                return staticAlternations;
            }
            return !1;
        }
        function getMaskLength() {
            var maskLength;
            maxLength = void 0 !== el ? el.maxLength : void 0, -1 === maxLength && (maxLength = void 0);
            var pos, lvp = getLastValidPosition(), testPos = getMaskSet().validPositions[lvp], ndxIntlzr = void 0 !== testPos ? testPos.locator.slice() : void 0;
            for (pos = lvp + 1; void 0 === testPos || null !== testPos.match.fn || null === testPos.match.fn && "" !== testPos.match.def; pos++) testPos = getTestTemplate(pos, ndxIntlzr, pos - 1), 
            ndxIntlzr = testPos.locator.slice();
            var lastTest = getTest(pos - 1);
            return maskLength = "" !== lastTest.def ? pos : pos - 1, void 0 === maxLength || maxLength > maskLength ? maskLength : maxLength;
        }
        function seekNext(pos, newBlock) {
            var maskL = getMaskLength();
            if (pos >= maskL) return maskL;
            for (var position = pos; ++position < maskL && (newBlock === !0 && (getTest(position).newBlockMarker !== !0 || !isMask(position)) || newBlock !== !0 && !isMask(position) && (opts.nojumps !== !0 || opts.nojumpsThreshold > position)); ) ;
            return position;
        }
        function seekPrevious(pos, newBlock) {
            var position = pos;
            if (0 >= position) return 0;
            for (;--position > 0 && (newBlock === !0 && getTest(position).newBlockMarker !== !0 || newBlock !== !0 && !isMask(position)); ) ;
            return position;
        }
        function getBufferElement(position) {
            return void 0 === getMaskSet().validPositions[position] ? getPlaceholder(position) : getMaskSet().validPositions[position].input;
        }
        function writeBuffer(input, buffer, caretPos, event, triggerInputEvent) {
            if (event && $.isFunction(opts.onBeforeWrite)) {
                var result = opts.onBeforeWrite.call(input, event, buffer, caretPos, opts);
                if (result) {
                    if (result.refreshFromBuffer) {
                        var refresh = result.refreshFromBuffer;
                        refreshFromBuffer(refresh === !0 ? refresh : refresh.start, refresh.end, result.buffer || buffer), 
                        resetMaskSet(!0), buffer = getBuffer();
                    }
                    caretPos = void 0 !== result.caret ? result.caret : caretPos;
                }
            }
            input.inputmask._valueSet(buffer.join("")), void 0 === caretPos || void 0 !== event && "blur" === event.type || caret(input, caretPos), 
            triggerInputEvent === !0 && (skipInputEvent = !0, $(input).trigger("input"));
        }
        function getPlaceholder(pos, test) {
            if (test = test || getTest(pos), void 0 !== test.placeholder) return test.placeholder;
            if (null === test.fn) {
                if (!opts.keepStatic && void 0 === getMaskSet().validPositions[pos]) {
                    for (var prevTest, tests = getTests(pos), hasAlternations = !1, i = 0; i < tests.length; i++) {
                        if (prevTest && "" !== tests[i].match.def && tests[i].match.def !== prevTest.match.def && (void 0 === tests[i].alternation || tests[i].alternation === prevTest.alternation)) {
                            hasAlternations = !0;
                            break;
                        }
                        tests[i].match.optionality !== !0 && tests[i].match.optionalQuantifier !== !0 && (prevTest = tests[i]);
                    }
                    if (hasAlternations) return opts.placeholder.charAt(pos % opts.placeholder.length);
                }
                return test.def;
            }
            return opts.placeholder.charAt(pos % opts.placeholder.length);
        }
        function checkVal(input, writeOut, strict, nptvl) {
            function isTemplateMatch() {
                var isMatch = !1, charCodeNdx = getBufferTemplate().slice(initialNdx, seekNext(initialNdx)).join("").indexOf(charCodes);
                if (-1 !== charCodeNdx && !isMask(initialNdx)) {
                    isMatch = !0;
                    for (var bufferTemplateArr = getBufferTemplate().slice(initialNdx, initialNdx + charCodeNdx), i = 0; i < bufferTemplateArr.length; i++) if (" " !== bufferTemplateArr[i]) {
                        isMatch = !1;
                        break;
                    }
                }
                return isMatch;
            }
            var inputValue = void 0 !== nptvl ? nptvl.slice() : input.inputmask._valueGet().split(""), charCodes = "", initialNdx = 0;
            if (resetMaskSet(), getMaskSet().p = seekNext(-1), writeOut && input.inputmask._valueSet(""), 
            !strict) if (opts.autoUnmask !== !0) {
                var staticInput = getBufferTemplate().slice(0, seekNext(-1)).join(""), matches = inputValue.join("").match(new RegExp("^" + Inputmask.escapeRegex(staticInput), "g"));
                matches && matches.length > 0 && (inputValue.splice(0, matches.length * staticInput.length), 
                initialNdx = seekNext(initialNdx));
            } else initialNdx = seekNext(initialNdx);
            $.each(inputValue, function(ndx, charCode) {
                var keypress = $.Event("keypress");
                keypress.which = charCode.charCodeAt(0), charCodes += charCode;
                var lvp = getLastValidPosition(void 0, !0), lvTest = getMaskSet().validPositions[lvp], nextTest = getTestTemplate(lvp + 1, lvTest ? lvTest.locator.slice() : void 0, lvp);
                if (!isTemplateMatch() || strict || opts.autoUnmask) {
                    var pos = strict ? ndx : null == nextTest.match.fn && nextTest.match.optionality && lvp + 1 < getMaskSet().p ? lvp + 1 : getMaskSet().p;
                    keypressEvent.call(input, keypress, !0, !1, strict, pos), initialNdx = pos + 1, 
                    charCodes = "";
                } else keypressEvent.call(input, keypress, !0, !1, !0, lvp + 1);
            }), writeOut && writeBuffer(input, getBuffer(), document.activeElement === input ? seekNext(getLastValidPosition(0)) : void 0, $.Event("checkval"));
        }
        function unmaskedvalue(input) {
            if (input.inputmask) {
                if (void 0 === input.className || -1 === input.className.indexOf("hasDatepicker")) {
                    var umValue = [], vps = getMaskSet().validPositions;
                    for (var pndx in vps) vps[pndx].match && null != vps[pndx].match.fn && umValue.push(vps[pndx].input);
                    var unmaskedValue = 0 === umValue.length ? null : (isRTL ? umValue.reverse() : umValue).join("");
                    if (null !== unmaskedValue) {
                        var bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join("");
                        $.isFunction(opts.onUnMask) && (unmaskedValue = opts.onUnMask.call(input, bufferValue, unmaskedValue, opts) || unmaskedValue);
                    }
                    return unmaskedValue;
                }
                return input.inputmask._valueGet();
            }
            return input.value;
        }
        function caret(input, begin, end) {
            function translatePosition(pos) {
                if (isRTL && "number" == typeof pos && (!opts.greedy || "" !== opts.placeholder)) {
                    var bffrLght = getBuffer().join("").length;
                    pos = bffrLght - pos;
                }
                return pos;
            }
            var range;
            if ("number" != typeof begin) return input.setSelectionRange ? (begin = input.selectionStart, 
            end = input.selectionEnd) : window.getSelection ? (range = window.getSelection().getRangeAt(0), 
            (range.commonAncestorContainer.parentNode === input || range.commonAncestorContainer === input) && (begin = range.startOffset, 
            end = range.endOffset)) : document.selection && document.selection.createRange && (range = document.selection.createRange(), 
            begin = 0 - range.duplicate().moveStart("character", -1e5), end = begin + range.text.length), 
            {
                begin: translatePosition(begin),
                end: translatePosition(end)
            };
            begin = translatePosition(begin), end = translatePosition(end), end = "number" == typeof end ? end : begin;
            var scrollCalc = input.style.fontSize.replace("px", "") * end;
            if (input.scrollLeft = scrollCalc > input.scrollWidth ? scrollCalc : 0, androidchrome || opts.insertMode !== !1 || begin !== end || end++, 
            input.setSelectionRange) input.selectionStart = begin, input.selectionEnd = end; else if (window.getSelection) {
                if (range = document.createRange(), void 0 === input.firstChild) {
                    var textNode = document.createTextNode("");
                    input.appendChild(textNode);
                }
                range.setStart(input.firstChild, begin < input.inputmask._valueGet().length ? begin : input.inputmask._valueGet().length), 
                range.setEnd(input.firstChild, end < input.inputmask._valueGet().length ? end : input.inputmask._valueGet().length), 
                range.collapse(!0);
                var sel = window.getSelection();
                sel.removeAllRanges(), sel.addRange(range);
            } else input.createTextRange && (range = input.createTextRange(), range.collapse(!0), 
            range.moveEnd("character", end), range.moveStart("character", begin), range.select());
        }
        function determineLastRequiredPosition(returnDefinition) {
            var pos, testPos, buffer = getBuffer(), bl = buffer.length, lvp = getLastValidPosition(), positions = {}, lvTest = getMaskSet().validPositions[lvp], ndxIntlzr = void 0 !== lvTest ? lvTest.locator.slice() : void 0;
            for (pos = lvp + 1; pos < buffer.length; pos++) testPos = getTestTemplate(pos, ndxIntlzr, pos - 1), 
            ndxIntlzr = testPos.locator.slice(), positions[pos] = $.extend(!0, {}, testPos);
            var lvTestAlt = lvTest && void 0 !== lvTest.alternation ? lvTest.locator[lvTest.alternation] : void 0;
            for (pos = bl - 1; pos > lvp && (testPos = positions[pos], (testPos.match.optionality || testPos.match.optionalQuantifier || lvTestAlt && (lvTestAlt !== positions[pos].locator[lvTest.alternation] && null != testPos.match.fn || null === testPos.match.fn && testPos.locator[lvTest.alternation] && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","), lvTestAlt.toString().split(",")) && "" !== getTests(pos)[0].def)) && buffer[pos] === getPlaceholder(pos, testPos.match)); pos--) bl--;
            return returnDefinition ? {
                l: bl,
                def: positions[bl] ? positions[bl].match : void 0
            } : bl;
        }
        function clearOptionalTail(buffer) {
            for (var rl = determineLastRequiredPosition(), lmib = buffer.length - 1; lmib > rl && !isMask(lmib); lmib--) ;
            return buffer.splice(rl, lmib + 1 - rl), buffer;
        }
        function isComplete(buffer) {
            if ($.isFunction(opts.isComplete)) return opts.isComplete.call(el, buffer, opts);
            if ("*" === opts.repeat) return void 0;
            var complete = !1, lrp = determineLastRequiredPosition(!0), aml = seekPrevious(lrp.l);
            if (void 0 === lrp.def || lrp.def.newBlockMarker || lrp.def.optionality || lrp.def.optionalQuantifier) {
                complete = !0;
                for (var i = 0; aml >= i; i++) {
                    var test = getTestTemplate(i).match;
                    if (null !== test.fn && void 0 === getMaskSet().validPositions[i] && test.optionality !== !0 && test.optionalQuantifier !== !0 || null === test.fn && buffer[i] !== getPlaceholder(i, test)) {
                        complete = !1;
                        break;
                    }
                }
            }
            return complete;
        }
        function isSelection(begin, end) {
            return isRTL ? begin - end > 1 || begin - end === 1 && opts.insertMode : end - begin > 1 || end - begin === 1 && opts.insertMode;
        }
        function wrapEvent(eventHandler) {
            return function(e) {
                var inComposition = !1;
                if (void 0 === this.inputmask) {
                    var imOpts = $.data(this, "_inputmask_opts");
                    imOpts ? new Inputmask(imOpts).mask(this) : $(this).off(".inputmask");
                } else {
                    if ("setvalue" === e.type || !(this.disabled || this.readOnly && !("keydown" === e.type && e.ctrlKey && 67 === e.keyCode || opts.tabThrough === !1 && e.keyCode === Inputmask.keyCode.TAB))) {
                        switch (e.type) {
                          case "input":
                            if (skipInputEvent === !0 || inComposition === !0) return skipInputEvent = !1, e.preventDefault();
                            break;

                          case "keydown":
                            skipKeyPressEvent = !1, inComposition = !1;
                            break;

                          case "keypress":
                            if (skipKeyPressEvent === !0) return e.preventDefault();
                            skipKeyPressEvent = !0;
                            break;

                          case "compositionstart":
                            inComposition = !0;
                            break;

                          case "compositionupdate":
                            skipInputEvent = !0;
                            break;

                          case "compositionend":
                            inComposition = !1;
                        }
                        return eventHandler.apply(this, arguments);
                    }
                    e.preventDefault();
                }
            };
        }
        function patchValueProperty(npt) {
            function patchValhook(type) {
                if ($.valHooks && void 0 === $.valHooks[type] || $.valHooks[type].inputmaskpatch !== !0) {
                    var valhookGet = $.valHooks[type] && $.valHooks[type].get ? $.valHooks[type].get : function(elem) {
                        return elem.value;
                    }, valhookSet = $.valHooks[type] && $.valHooks[type].set ? $.valHooks[type].set : function(elem, value) {
                        return elem.value = value, elem;
                    };
                    $.valHooks[type] = {
                        get: function(elem) {
                            if (elem.inputmask) {
                                if (elem.inputmask.opts.autoUnmask) return elem.inputmask.unmaskedvalue();
                                var result = valhookGet(elem), maskset = elem.inputmask.maskset, bufferTemplate = maskset._buffer;
                                return bufferTemplate = bufferTemplate ? bufferTemplate.join("") : "", result !== bufferTemplate ? result : "";
                            }
                            return valhookGet(elem);
                        },
                        set: function(elem, value) {
                            var result, $elem = $(elem);
                            return result = valhookSet(elem, value), elem.inputmask && $elem.triggerHandler("setvalue.inputmask"), 
                            result;
                        },
                        inputmaskpatch: !0
                    };
                }
            }
            function getter() {
                return this.inputmask ? this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : valueGet.call(this) !== getBufferTemplate().join("") ? valueGet.call(this) : "" : valueGet.call(this);
            }
            function setter(value) {
                valueSet.call(this, value), this.inputmask && $(this).triggerHandler("setvalue.inputmask");
            }
            function installNativeValueSetFallback(npt) {
                $(npt).on("mouseenter.inputmask", wrapEvent(function(event) {
                    var $input = $(this), input = this, value = input.inputmask._valueGet();
                    "" !== value && value !== getBuffer().join("") && $input.triggerHandler("setvalue.inputmask");
                }));
            }
            var valueGet, valueSet;
            npt.inputmask.__valueGet || (Object.getOwnPropertyDescriptor && void 0 === npt.value ? (valueGet = function() {
                return this.textContent;
            }, valueSet = function(value) {
                this.textContent = value;
            }, Object.defineProperty(npt, "value", {
                get: getter,
                set: setter
            })) : document.__lookupGetter__ && npt.__lookupGetter__("value") ? (valueGet = npt.__lookupGetter__("value"), 
            valueSet = npt.__lookupSetter__("value"), npt.__defineGetter__("value", getter), 
            npt.__defineSetter__("value", setter)) : (valueGet = function() {
                return npt.value;
            }, valueSet = function(value) {
                npt.value = value;
            }, patchValhook(npt.type), installNativeValueSetFallback(npt)), npt.inputmask.__valueGet = valueGet, 
            npt.inputmask._valueGet = function(overruleRTL) {
                return isRTL && overruleRTL !== !0 ? valueGet.call(this.el).split("").reverse().join("") : valueGet.call(this.el);
            }, npt.inputmask.__valueSet = valueSet, npt.inputmask._valueSet = function(value, overruleRTL) {
                valueSet.call(this.el, overruleRTL !== !0 && isRTL && null !== value && void 0 !== value ? value.split("").reverse().join("") : value);
            });
        }
        function handleRemove(input, k, pos, strict) {
            function generalize() {
                if (opts.keepStatic) {
                    resetMaskSet(!0);
                    var lastAlt, validInputs = [], positionsClone = $.extend(!0, {}, getMaskSet().validPositions);
                    for (lastAlt = getLastValidPosition(); lastAlt >= 0; lastAlt--) {
                        var validPos = getMaskSet().validPositions[lastAlt];
                        if (validPos && (null != validPos.match.fn && validInputs.push(validPos.input), 
                        delete getMaskSet().validPositions[lastAlt], void 0 !== validPos.alternation && validPos.locator[validPos.alternation] === getTestTemplate(lastAlt).locator[validPos.alternation])) break;
                    }
                    if (lastAlt > -1) for (;validInputs.length > 0; ) {
                        getMaskSet().p = seekNext(getLastValidPosition());
                        var keypress = $.Event("keypress");
                        keypress.which = validInputs.pop().charCodeAt(0), keypressEvent.call(input, keypress, !0, !1, !1, getMaskSet().p);
                    } else getMaskSet().validPositions = $.extend(!0, {}, positionsClone);
                }
            }
            if ((opts.numericInput || isRTL) && (k === Inputmask.keyCode.BACKSPACE ? k = Inputmask.keyCode.DELETE : k === Inputmask.keyCode.DELETE && (k = Inputmask.keyCode.BACKSPACE), 
            isRTL)) {
                var pend = pos.end;
                pos.end = pos.begin, pos.begin = pend;
            }
            k === Inputmask.keyCode.BACKSPACE && (pos.end - pos.begin < 1 || opts.insertMode === !1) ? (pos.begin = seekPrevious(pos.begin), 
            void 0 === getMaskSet().validPositions[pos.begin] || getMaskSet().validPositions[pos.begin].input !== opts.groupSeparator && getMaskSet().validPositions[pos.begin].input !== opts.radixPoint || pos.begin--) : k === Inputmask.keyCode.DELETE && pos.begin === pos.end && (pos.end = isMask(pos.end) ? pos.end + 1 : seekNext(pos.end) + 1, 
            void 0 === getMaskSet().validPositions[pos.begin] || getMaskSet().validPositions[pos.begin].input !== opts.groupSeparator && getMaskSet().validPositions[pos.begin].input !== opts.radixPoint || pos.end++), 
            stripValidPositions(pos.begin, pos.end, !1, strict), strict !== !0 && generalize();
            var lvp = getLastValidPosition(pos.begin);
            lvp < pos.begin ? (-1 === lvp && resetMaskSet(), getMaskSet().p = seekNext(lvp)) : strict !== !0 && (getMaskSet().p = pos.begin);
        }
        function keydownEvent(e) {
            var input = this, $input = $(input), k = e.keyCode, pos = caret(input);
            k === Inputmask.keyCode.BACKSPACE || k === Inputmask.keyCode.DELETE || iphone && 127 === k || e.ctrlKey && 88 === k && !isInputEventSupported("cut") ? (e.preventDefault(), 
            88 === k && (undoValue = getBuffer().join("")), handleRemove(input, k, pos), writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue !== getBuffer().join("")), 
            input.inputmask._valueGet() === getBufferTemplate().join("") ? $input.trigger("cleared") : isComplete(getBuffer()) === !0 && $input.trigger("complete"), 
            opts.showTooltip && $input.prop("title", getMaskSet().mask)) : k === Inputmask.keyCode.END || k === Inputmask.keyCode.PAGE_DOWN ? setTimeout(function() {
                var caretPos = seekNext(getLastValidPosition());
                opts.insertMode || caretPos !== getMaskLength() || e.shiftKey || caretPos--, caret(input, e.shiftKey ? pos.begin : caretPos, caretPos);
            }, 0) : k === Inputmask.keyCode.HOME && !e.shiftKey || k === Inputmask.keyCode.PAGE_UP ? caret(input, 0, e.shiftKey ? pos.begin : 0) : (opts.undoOnEscape && k === Inputmask.keyCode.ESCAPE || 90 === k && e.ctrlKey) && e.altKey !== !0 ? (checkVal(input, !0, !1, undoValue.split("")), 
            $input.trigger("click")) : k !== Inputmask.keyCode.INSERT || e.shiftKey || e.ctrlKey ? opts.tabThrough === !0 && k === Inputmask.keyCode.TAB ? (e.shiftKey === !0 ? (null === getTest(pos.begin).fn && (pos.begin = seekNext(pos.begin)), 
            pos.end = seekPrevious(pos.begin, !0), pos.begin = seekPrevious(pos.end, !0)) : (pos.begin = seekNext(pos.begin, !0), 
            pos.end = seekNext(pos.begin, !0), pos.end < getMaskLength() && pos.end--), pos.begin < getMaskLength() && (e.preventDefault(), 
            caret(input, pos.begin, pos.end))) : opts.insertMode !== !1 || e.shiftKey || (k === Inputmask.keyCode.RIGHT ? setTimeout(function() {
                var caretPos = caret(input);
                caret(input, caretPos.begin);
            }, 0) : k === Inputmask.keyCode.LEFT && setTimeout(function() {
                var caretPos = caret(input);
                caret(input, isRTL ? caretPos.begin + 1 : caretPos.begin - 1);
            }, 0)) : (opts.insertMode = !opts.insertMode, caret(input, opts.insertMode || pos.begin !== getMaskLength() ? pos.begin : pos.begin - 1)), 
            opts.onKeyDown.call(this, e, getBuffer(), caret(input).begin, opts), ignorable = -1 !== $.inArray(k, opts.ignorables);
        }
        function keypressEvent(e, checkval, writeOut, strict, ndx) {
            var input = this, $input = $(input), k = e.which || e.charCode || e.keyCode;
            if (!(checkval === !0 || e.ctrlKey && e.altKey) && (e.ctrlKey || e.metaKey || ignorable)) return k === Inputmask.keyCode.ENTER && undoValue !== getBuffer().join("") && setTimeout(function() {
                $input.trigger("change"), undoValue = getBuffer().join("");
            }, 0), !0;
            if (k) {
                46 === k && e.shiftKey === !1 && "," === opts.radixPoint && (k = 44);
                var forwardPosition, pos = checkval ? {
                    begin: ndx,
                    end: ndx
                } : caret(input), c = String.fromCharCode(k), isSlctn = isSelection(pos.begin, pos.end);
                isSlctn && (getMaskSet().undoPositions = $.extend(!0, {}, getMaskSet().validPositions), 
                handleRemove(input, Inputmask.keyCode.DELETE, pos, !0), pos.begin = getMaskSet().p, 
                opts.insertMode || (opts.insertMode = !opts.insertMode, setValidPosition(pos.begin, strict), 
                opts.insertMode = !opts.insertMode), isSlctn = !opts.multi), getMaskSet().writeOutBuffer = !0;
                var p = isRTL && !isSlctn ? pos.end : pos.begin, valResult = isValid(p, c, strict);
                if (valResult !== !1) {
                    if (valResult !== !0 && (p = void 0 !== valResult.pos ? valResult.pos : p, c = void 0 !== valResult.c ? valResult.c : c), 
                    resetMaskSet(!0), void 0 !== valResult.caret) forwardPosition = valResult.caret; else {
                        var vps = getMaskSet().validPositions;
                        forwardPosition = !opts.keepStatic && (void 0 !== vps[p + 1] && getTests(p + 1, vps[p].locator.slice(), p).length > 1 || void 0 !== vps[p].alternation) ? p + 1 : seekNext(p);
                    }
                    getMaskSet().p = forwardPosition;
                }
                if (writeOut !== !1) {
                    var self = this;
                    if (setTimeout(function() {
                        opts.onKeyValidation.call(self, valResult, opts);
                    }, 0), getMaskSet().writeOutBuffer && valResult !== !1) {
                        var buffer = getBuffer();
                        writeBuffer(input, buffer, checkval ? void 0 : opts.numericInput ? seekPrevious(forwardPosition) : forwardPosition, e, checkval !== !0), 
                        checkval !== !0 && setTimeout(function() {
                            isComplete(buffer) === !0 && $input.trigger("complete");
                        }, 0);
                    } else isSlctn && (getMaskSet().buffer = void 0, getMaskSet().validPositions = getMaskSet().undoPositions);
                } else isSlctn && (getMaskSet().buffer = void 0, getMaskSet().validPositions = getMaskSet().undoPositions);
                if (opts.showTooltip && $input.prop("title", getMaskSet().mask), checkval && $.isFunction(opts.onBeforeWrite)) {
                    var result = opts.onBeforeWrite.call(this, e, getBuffer(), forwardPosition, opts);
                    if (result && result.refreshFromBuffer) {
                        var refresh = result.refreshFromBuffer;
                        refreshFromBuffer(refresh === !0 ? refresh : refresh.start, refresh.end, result.buffer), 
                        resetMaskSet(!0), result.caret && (getMaskSet().p = result.caret);
                    }
                }
                if (e.preventDefault(), checkval) return valResult;
            }
        }
        function pasteEvent(e) {
            var input = this, $input = $(input), inputValue = input.inputmask._valueGet(!0), caretPos = caret(input);
            if ("propertychange" === e.type && input.inputmask._valueGet().length <= getMaskLength()) return !0;
            if ("paste" === e.type) {
                var valueBeforeCaret = inputValue.substr(0, caretPos.begin), valueAfterCaret = inputValue.substr(caretPos.end, inputValue.length);
                valueBeforeCaret === getBufferTemplate().slice(0, caretPos.begin).join("") && (valueBeforeCaret = ""), 
                valueAfterCaret === getBufferTemplate().slice(caretPos.end).join("") && (valueAfterCaret = ""), 
                window.clipboardData && window.clipboardData.getData ? inputValue = valueBeforeCaret + window.clipboardData.getData("Text") + valueAfterCaret : e.originalEvent && e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData && (inputValue = valueBeforeCaret + e.originalEvent.clipboardData.getData("text/plain") + valueAfterCaret);
            }
            var pasteValue = inputValue;
            if ($.isFunction(opts.onBeforePaste)) {
                if (pasteValue = opts.onBeforePaste.call(input, inputValue, opts), pasteValue === !1) return e.preventDefault(), 
                !1;
                pasteValue || (pasteValue = inputValue);
            }
            return checkVal(input, !1, !1, isRTL ? pasteValue.split("").reverse() : pasteValue.toString().split("")), 
            writeBuffer(input, getBuffer(), void 0, e, !0), $input.trigger("click"), isComplete(getBuffer()) === !0 && $input.trigger("complete"), 
            !1;
        }
        function inputFallBackEvent(e) {
            var input = this;
            checkVal(input, !0, !1), isComplete(getBuffer()) === !0 && $(input).trigger("complete"), 
            e.preventDefault();
        }
        function compositionStartEvent(e) {
            var input = this;
            undoValue = getBuffer().join(""), ("" === compositionData || 0 !== e.originalEvent.data.indexOf(compositionData)) && (compositionCaretPos = caret(input));
        }
        function compositionUpdateEvent(e) {
            var input = this, caretPos = caret(input);
            0 === e.originalEvent.data.indexOf(compositionData) && (resetMaskSet(), caretPos = compositionCaretPos);
            var newData = e.originalEvent.data;
            caret(input, caretPos.begin, caretPos.end);
            for (var i = 0; i < newData.length; i++) {
                var keypress = $.Event("keypress");
                keypress.which = newData.charCodeAt(i), skipKeyPressEvent = !1, ignorable = !1, 
                keypressEvent.call(input, keypress);
            }
            setTimeout(function() {
                var forwardPosition = getMaskSet().p;
                writeBuffer(input, getBuffer(), opts.numericInput ? seekPrevious(forwardPosition) : forwardPosition);
            }, 0), compositionData = e.originalEvent.data;
        }
        function compositionEndEvent(e) {}
        function setValueEvent(e) {
            var input = this, value = input.inputmask._valueGet();
            input.inputmask._valueSet($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(input, value, opts) || value : value), 
            checkVal(input, !0, !1), undoValue = getBuffer().join(""), (opts.clearMaskOnLostFocus || opts.clearIncomplete) && input.inputmask._valueGet() === getBufferTemplate().join("") && input.inputmask._valueSet("");
        }
        function focusEvent(e) {
            var input = this, nptValue = input.inputmask._valueGet();
            opts.showMaskOnFocus && (!opts.showMaskOnHover || opts.showMaskOnHover && "" === nptValue) ? input.inputmask._valueGet() !== getBuffer().join("") && writeBuffer(input, getBuffer(), seekNext(getLastValidPosition())) : mouseEnter === !1 && caret(input, seekNext(getLastValidPosition())), 
            opts.positionCaretOnTab === !0 && setTimeout(function() {
                caret(input, seekNext(getLastValidPosition()));
            }, 0), undoValue = getBuffer().join("");
        }
        function mouseleaveEvent(e) {
            var input = this;
            if (mouseEnter = !1, opts.clearMaskOnLostFocus) {
                var buffer = getBuffer().slice(), nptValue = input.inputmask._valueGet();
                document.activeElement !== input && nptValue !== input.getAttribute("placeholder") && "" !== nptValue && (-1 === getLastValidPosition() && nptValue === getBufferTemplate().join("") ? buffer = [] : clearOptionalTail(buffer), 
                writeBuffer(input, buffer));
            }
        }
        function clickEvent(e) {
            function doRadixFocus(clickPos) {
                if (opts.radixFocus && "" !== opts.radixPoint) {
                    var vps = getMaskSet().validPositions;
                    if (void 0 === vps[clickPos] || vps[clickPos].input === getPlaceholder(clickPos)) {
                        if (clickPos < seekNext(-1)) return !0;
                        var radixPos = $.inArray(opts.radixPoint, getBuffer());
                        if (-1 !== radixPos) {
                            for (var vp in vps) if (vp > radixPos && vps[vp].input !== getPlaceholder(vp)) return !1;
                            return !0;
                        }
                    }
                }
                return !1;
            }
            var input = this;
            if (document.activeElement === input) {
                var selectedCaret = caret(input);
                if (selectedCaret.begin === selectedCaret.end) if (doRadixFocus(selectedCaret.begin)) caret(input, $.inArray(opts.radixPoint, getBuffer())); else {
                    var clickPosition = selectedCaret.begin, lastPosition = seekNext(getLastValidPosition(clickPosition));
                    lastPosition > clickPosition ? caret(input, isMask(clickPosition) || isMask(clickPosition - 1) ? clickPosition : seekNext(clickPosition)) : caret(input, opts.numericInput ? 0 : lastPosition);
                }
            }
        }
        function dblclickEvent(e) {
            var input = this;
            setTimeout(function() {
                caret(input, 0, seekNext(getLastValidPosition()));
            }, 0);
        }
        function cutEvent(e) {
            skipInputEvent = !0;
            var input = this, $input = $(input), pos = caret(input);
            if (isRTL) {
                var clipboardData = window.clipboardData || e.originalEvent.clipboardData, clipData = clipboardData.getData("text").split("").reverse().join("");
                clipboardData.setData("text", clipData);
            }
            handleRemove(input, Inputmask.keyCode.DELETE, pos), writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue !== getBuffer().join("")), 
            input.inputmask._valueGet() === getBufferTemplate().join("") && $input.trigger("cleared"), 
            opts.showTooltip && (input.title = getMaskSet().mask);
        }
        function blurEvent(e) {
            var $input = $(this), input = this;
            if (input.inputmask) {
                var nptValue = input.inputmask._valueGet(), buffer = getBuffer().slice();
                undoValue !== buffer.join("") && setTimeout(function() {
                    $input.trigger("change"), undoValue = buffer.join("");
                }, 0), "" !== nptValue && (opts.clearMaskOnLostFocus && (-1 === getLastValidPosition() && nptValue === getBufferTemplate().join("") ? buffer = [] : clearOptionalTail(buffer)), 
                isComplete(buffer) === !1 && (setTimeout(function() {
                    $input.trigger("incomplete");
                }, 0), opts.clearIncomplete && (resetMaskSet(), buffer = opts.clearMaskOnLostFocus ? [] : getBufferTemplate().slice())), 
                writeBuffer(input, buffer, void 0, e));
            }
        }
        function mouseenterEvent(e) {
            var input = this;
            mouseEnter = !0, document.activeElement !== input && opts.showMaskOnHover && input.inputmask._valueGet() !== getBuffer().join("") && writeBuffer(input, getBuffer());
        }
        function mask(elem) {
            el = elem, $el = $(el), opts.showTooltip && (el.title = getMaskSet().mask), ("rtl" === el.dir || opts.rightAlign) && (el.style.textAlign = "right"), 
            ("rtl" === el.dir || opts.numericInput) && (el.dir = "ltr", el.removeAttribute("dir"), 
            el.inputmask.isRTL = !0, isRTL = !0), $el.off(".inputmask"), patchValueProperty(el), 
            ("INPUT" === el.tagName && isInputTypeSupported(el.getAttribute("type")) || el.isContentEditable) && ($(el.form).on("submit", function() {
                undoValue !== getBuffer().join("") && $el.trigger("change"), opts.clearMaskOnLostFocus && -1 === getLastValidPosition() && el.inputmask._valueGet && el.inputmask._valueGet() === getBufferTemplate().join("") && el.inputmask._valueSet(""), 
                opts.removeMaskOnSubmit && (el.inputmask._valueSet(el.inputmask.unmaskedvalue(), !0), 
                setTimeout(function() {
                    writeBuffer(el, getBuffer());
                }, 0));
            }).on("reset", function() {
                setTimeout(function() {
                    $el.triggerHandler("setvalue.inputmask");
                }, 0);
            }), $el.on("mouseenter.inputmask", wrapEvent(mouseenterEvent)).on("blur.inputmask", wrapEvent(blurEvent)).on("focus.inputmask", wrapEvent(focusEvent)).on("mouseleave.inputmask", wrapEvent(mouseleaveEvent)).on("click.inputmask", wrapEvent(clickEvent)).on("dblclick.inputmask", wrapEvent(dblclickEvent)).on(PasteEventType + ".inputmask dragdrop.inputmask drop.inputmask", wrapEvent(pasteEvent)).on("cut.inputmask", wrapEvent(cutEvent)).on("complete.inputmask", wrapEvent(opts.oncomplete)).on("incomplete.inputmask", wrapEvent(opts.onincomplete)).on("cleared.inputmask", wrapEvent(opts.oncleared)).on("keydown.inputmask", wrapEvent(keydownEvent)).on("keypress.inputmask", wrapEvent(keypressEvent)), 
            androidfirefox || $el.on("compositionstart.inputmask", wrapEvent(compositionStartEvent)).on("compositionupdate.inputmask", wrapEvent(compositionUpdateEvent)).on("compositionend.inputmask", wrapEvent(compositionEndEvent)), 
            "paste" === PasteEventType && $el.on("input.inputmask", wrapEvent(inputFallBackEvent))), 
            $el.on("setvalue.inputmask", wrapEvent(setValueEvent));
            var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(el, el.inputmask._valueGet(), opts) || el.inputmask._valueGet() : el.inputmask._valueGet();
            checkVal(el, !0, !1, initialValue.split(""));
            var buffer = getBuffer().slice();
            undoValue = buffer.join("");
            var activeElement;
            try {
                activeElement = document.activeElement;
            } catch (e) {}
            isComplete(buffer) === !1 && opts.clearIncomplete && resetMaskSet(), opts.clearMaskOnLostFocus && (buffer.join("") === getBufferTemplate().join("") ? buffer = [] : clearOptionalTail(buffer)), 
            writeBuffer(el, buffer), activeElement === el && caret(el, seekNext(getLastValidPosition()));
        }
        var undoValue, compositionCaretPos, compositionData, el, $el, maxLength, valueBuffer, isRTL = !1, skipKeyPressEvent = !1, skipInputEvent = !1, ignorable = !1, mouseEnter = !0;
        if (void 0 !== actionObj) switch (actionObj.action) {
          case "isComplete":
            return el = actionObj.el, $el = $(el), maskset = el.inputmask.maskset, opts = el.inputmask.opts, 
            isComplete(actionObj.buffer);

          case "unmaskedvalue":
            return el = actionObj.el, void 0 === el ? ($el = $({}), el = $el[0], el.inputmask = new Inputmask(), 
            el.inputmask.opts = opts, el.inputmask.el = el, el.inputmask.maskset = maskset, 
            el.inputmask.isRTL = opts.numericInput, opts.numericInput && (isRTL = !0), valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call($el, actionObj.value, opts) || actionObj.value : actionObj.value).split(""), 
            checkVal(el, !1, !1, isRTL ? valueBuffer.reverse() : valueBuffer), $.isFunction(opts.onBeforeWrite) && opts.onBeforeWrite.call(this, void 0, getBuffer(), 0, opts)) : $el = $(el), 
            maskset = el.inputmask.maskset, opts = el.inputmask.opts, isRTL = el.inputmask.isRTL, 
            unmaskedvalue(el);

          case "mask":
            undoValue = getBuffer().join(""), mask(actionObj.el);
            break;

          case "format":
            return $el = $({}), $el[0].inputmask = new Inputmask(), $el[0].inputmask.opts = opts, 
            $el[0].inputmask.el = $el[0], $el[0].inputmask.maskset = maskset, $el[0].inputmask.isRTL = opts.numericInput, 
            opts.numericInput && (isRTL = !0), valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call($el, actionObj.value, opts) || actionObj.value : actionObj.value).split(""), 
            checkVal(el, !1, !1, isRTL ? valueBuffer.reverse() : valueBuffer), $.isFunction(opts.onBeforeWrite) && opts.onBeforeWrite.call(this, void 0, getBuffer(), 0, opts), 
            actionObj.metadata ? {
                value: isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join(""),
                metadata: $el.inputmask("getmetadata")
            } : isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join("");

          case "isValid":
            $el = $({}), $el[0].inputmask = new Inputmask(), $el[0].inputmask.opts = opts, $el[0].inputmask.el = $el[0], 
            $el[0].inputmask.maskset = maskset, $el[0].inputmask.isRTL = opts.numericInput, 
            opts.numericInput && (isRTL = !0), valueBuffer = actionObj.value.split(""), checkVal(el, !1, !0, isRTL ? valueBuffer.reverse() : valueBuffer);
            for (var buffer = getBuffer(), rl = determineLastRequiredPosition(), lmib = buffer.length - 1; lmib > rl && !isMask(lmib); lmib--) ;
            return buffer.splice(rl, lmib + 1 - rl), isComplete(buffer) && actionObj.value === buffer.join("");

          case "getemptymask":
            return el = actionObj.el, $el = $(el), maskset = el.inputmask.maskset, opts = el.inputmask.opts, 
            getBufferTemplate();

          case "remove":
            el = actionObj.el, $el = $(el), maskset = el.inputmask.maskset, opts = el.inputmask.opts, 
            el.inputmask._valueSet(unmaskedvalue(el)), $el.off(".inputmask");
            var valueProperty;
            Object.getOwnPropertyDescriptor && (valueProperty = Object.getOwnPropertyDescriptor(el, "value")), 
            valueProperty && valueProperty.get ? el.inputmask.__valueGet && Object.defineProperty(el, "value", {
                get: el.inputmask.__valueGet,
                set: el.inputmask.__valueSet
            }) : document.__lookupGetter__ && el.__lookupGetter__("value") && el.inputmask.__valueGet && (el.__defineGetter__("value", el.inputmask.__valueGet), 
            el.__defineSetter__("value", el.inputmask.__valueSet)), el.inputmask = void 0;
            break;

          case "getmetadata":
            if (el = actionObj.el, $el = $(el), maskset = el.inputmask.maskset, opts = el.inputmask.opts, 
            $.isArray(maskset.metadata)) {
                for (var alternation, lvp = getLastValidPosition(), firstAlt = lvp; firstAlt >= 0; firstAlt--) if (getMaskSet().validPositions[firstAlt] && void 0 !== getMaskSet().validPositions[firstAlt].alternation) {
                    alternation = getMaskSet().validPositions[firstAlt].alternation;
                    break;
                }
                return void 0 !== alternation ? maskset.metadata[getMaskSet().validPositions[lvp].locator[alternation]] : maskset.metadata[0];
            }
            return maskset.metadata;
        }
    }
    Inputmask.prototype = {
        defaults: {
            placeholder: "_",
            optionalmarker: {
                start: "[",
                end: "]"
            },
            quantifiermarker: {
                start: "{",
                end: "}"
            },
            groupmarker: {
                start: "(",
                end: ")"
            },
            alternatormarker: "|",
            escapeChar: "\\",
            mask: null,
            oncomplete: $.noop,
            onincomplete: $.noop,
            oncleared: $.noop,
            repeat: 0,
            greedy: !0,
            autoUnmask: !1,
            removeMaskOnSubmit: !1,
            clearMaskOnLostFocus: !0,
            insertMode: !0,
            clearIncomplete: !1,
            aliases: {},
            alias: null,
            onKeyDown: $.noop,
            onBeforeMask: null,
            onBeforePaste: function(pastedValue, opts) {
                return $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask(pastedValue, opts) : pastedValue;
            },
            onBeforeWrite: null,
            onUnMask: null,
            showMaskOnFocus: !0,
            showMaskOnHover: !0,
            onKeyValidation: $.noop,
            skipOptionalPartCharacter: " ",
            showTooltip: !1,
            numericInput: !1,
            rightAlign: !1,
            undoOnEscape: !0,
            radixPoint: "",
            groupSeparator: "",
            radixFocus: !1,
            nojumps: !1,
            nojumpsThreshold: 0,
            keepStatic: null,
            positionCaretOnTab: !1,
            tabThrough: !1,
            supportsInputType: [],
            definitions: {
                "9": {
                    validator: "[0-9]",
                    cardinality: 1,
                    definitionSymbol: "*"
                },
                a: {
                    validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
                    cardinality: 1,
                    definitionSymbol: "*"
                },
                "*": {
                    validator: "[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
                    cardinality: 1
                }
            },
            ignorables: [ 8, 9, 13, 19, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123 ],
            isComplete: null,
            canClearPosition: $.noop,
            postValidation: null
        },
        masksCache: {},
        mask: function(el) {
            var scopedOpts = $.extend(!0, {}, this.opts);
            importAttributeOptions(el, scopedOpts, $.extend(!0, {}, this.userOptions));
            var maskset = generateMaskSet(scopedOpts, this.noMasksCache);
            return void 0 !== maskset && (void 0 !== el.inputmask && el.inputmask.remove(), 
            el.inputmask = new Inputmask(), el.inputmask.opts = scopedOpts, el.inputmask.noMasksCache = this.noMasksCache, 
            el.inputmask.userOptions = $.extend(!0, {}, this.userOptions), el.inputmask.el = el, 
            el.inputmask.maskset = maskset, el.inputmask.isRTL = !1, $.data(el, "_inputmask_opts", scopedOpts), 
            maskScope({
                action: "mask",
                el: el
            }, maskset, el.inputmask.opts)), el;
        },
        option: function(options) {
            return "string" == typeof options ? this.opts[options] : "object" == typeof options ? ($.extend(this.opts, options), 
            $.extend(this.userOptions, options), this) : void 0;
        },
        unmaskedvalue: function() {
            return this.el ? maskScope({
                action: "unmaskedvalue",
                el: this.el
            }) : void 0;
        },
        remove: function() {
            return this.el ? (maskScope({
                action: "remove",
                el: this.el
            }), this.el.inputmask = void 0, this.el) : void 0;
        },
        getemptymask: function() {
            return this.el ? maskScope({
                action: "getemptymask",
                el: this.el
            }) : void 0;
        },
        hasMaskedValue: function() {
            return !this.opts.autoUnmask;
        },
        isComplete: function() {
            return this.el ? maskScope({
                action: "isComplete",
                buffer: this.el.inputmask._valueGet().split(""),
                el: this.el
            }) : void 0;
        },
        getmetadata: function() {
            return this.el ? maskScope({
                action: "getmetadata",
                el: this.el
            }) : void 0;
        }
    }, Inputmask.extendDefaults = function(options) {
        $.extend(Inputmask.prototype.defaults, options);
    }, Inputmask.extendDefinitions = function(definition) {
        $.extend(Inputmask.prototype.defaults.definitions, definition);
    }, Inputmask.extendAliases = function(alias) {
        $.extend(Inputmask.prototype.defaults.aliases, alias);
    }, Inputmask.format = function(value, options, metadata) {
        var opts = $.extend(!0, {}, Inputmask.prototype.defaults, options);
        return resolveAlias(opts.alias, options, opts), maskScope({
            action: "format",
            value: value,
            metadata: metadata
        }, generateMaskSet(opts, options && void 0 !== options.definitions), opts);
    }, Inputmask.unmask = function(value, options) {
        var opts = $.extend(!0, {}, Inputmask.prototype.defaults, options);
        return resolveAlias(opts.alias, options, opts), maskScope({
            action: "unmaskedvalue",
            value: value
        }, generateMaskSet(opts, options && void 0 !== options.definitions), opts);
    }, Inputmask.isValid = function(value, options) {
        var opts = $.extend(!0, {}, Inputmask.prototype.defaults, options);
        return resolveAlias(opts.alias, options, opts), maskScope({
            action: "isValid",
            value: value
        }, generateMaskSet(opts, options && void 0 !== options.definitions), opts);
    }, Inputmask.escapeRegex = function(str) {
        var specials = [ "/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\", "$", "^" ];
        return str.replace(new RegExp("(\\" + specials.join("|\\") + ")", "gim"), "\\$1");
    }, Inputmask.keyCode = {
        ALT: 18,
        BACKSPACE: 8,
        CAPS_LOCK: 20,
        COMMA: 188,
        COMMAND: 91,
        COMMAND_LEFT: 91,
        COMMAND_RIGHT: 93,
        CONTROL: 17,
        DELETE: 46,
        DOWN: 40,
        END: 35,
        ENTER: 13,
        ESCAPE: 27,
        HOME: 36,
        INSERT: 45,
        LEFT: 37,
        MENU: 93,
        NUMPAD_ADD: 107,
        NUMPAD_DECIMAL: 110,
        NUMPAD_DIVIDE: 111,
        NUMPAD_ENTER: 108,
        NUMPAD_MULTIPLY: 106,
        NUMPAD_SUBTRACT: 109,
        PAGE_DOWN: 34,
        PAGE_UP: 33,
        PERIOD: 190,
        RIGHT: 39,
        SHIFT: 16,
        SPACE: 32,
        TAB: 9,
        UP: 38,
        WINDOWS: 91
    };
    var ua = navigator.userAgent, iphone = null !== ua.match(new RegExp("iphone", "i")), androidchrome = null !== ua.match(new RegExp("android.*chrome.*", "i")), androidfirefox = null !== ua.match(new RegExp("android.*firefox.*", "i")), PasteEventType = isInputEventSupported("paste") ? "paste" : isInputEventSupported("input") ? "input" : "propertychange";
    return window.Inputmask = Inputmask, Inputmask;
});;
/*!
* jquery.inputmask.js
* http://github.com/RobinHerbots/jquery.inputmask
* Copyright (c) 2010 - 2015 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 3.2.1-89
*/
!function(factory) {
    "function" == typeof define && define.amd ? define([ "jquery", "inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery, window.Inputmask);
}(function($, Inputmask) {
    return void 0 === $.fn.inputmask && ($.fn.inputmask = function(fn, options) {
        var nptmask, input;
        if (options = options || {}, "string" == typeof fn) switch (fn) {
          case "mask":
            return nptmask = new Inputmask(options), this.each(function() {
                nptmask.mask(this);
            });

          case "unmaskedvalue":
            return input = this.jquery && this.length > 0 ? this[0] : this, input.inputmask ? input.inputmask.unmaskedvalue() : $(input).val();

          case "remove":
            return this.each(function() {
                this.inputmask && this.inputmask.remove();
            });

          case "getemptymask":
            return input = this.jquery && this.length > 0 ? this[0] : this, input.inputmask ? input.inputmask.getemptymask() : "";

          case "hasMaskedValue":
            return input = this.jquery && this.length > 0 ? this[0] : this, input.inputmask ? input.inputmask.hasMaskedValue() : !1;

          case "isComplete":
            return input = this.jquery && this.length > 0 ? this[0] : this, input.inputmask ? input.inputmask.isComplete() : !0;

          case "getmetadata":
            return input = this.jquery && this.length > 0 ? this[0] : this, input.inputmask ? input.inputmask.getmetadata() : void 0;

          case "setvalue":
            input = this.jquery && this.length > 0 ? this[0] : this, $(input).val(options), 
            void 0 !== input.inputmask && $(input).triggerHandler("setvalue.inputmask");
            break;

          case "option":
            if ("string" != typeof options) return this.each(function() {
                return void 0 !== this.inputmask ? this.inputmask.option(options) : void 0;
            });
            if (input = this.jquery && this.length > 0 ? this[0] : this, void 0 !== input.inputmask) return input.inputmask.option(options);
            break;

          default:
            return options.alias = fn, nptmask = new Inputmask(options), this.each(function() {
                nptmask.mask(this);
            });
        } else {
            if ("object" == typeof fn) return nptmask = new Inputmask(fn), this.each(void 0 === fn.mask && void 0 === fn.alias ? function() {
                return void 0 !== this.inputmask ? this.inputmask.option(fn) : void nptmask.mask(this);
            } : function() {
                nptmask.mask(this);
            });
            if (void 0 === fn) return this.each(function() {
                nptmask = new Inputmask(options), nptmask.mask(this);
            });
        }
    }), $.fn.inputmask;
});;

var app = angular.module('app');
'use strict';
app.directive('phoneinputmask', ['$compile',
function ($compile) {
    return {
        restrict: 'AC',
        link: function (scope, el, attrs) {
            var countyCode = function (code) {
                if (IsNotNullorEmpty(phoneMask["_" + code]))
                    return phoneMask["_" + code];
                else
                    return phoneMask["_us"];
            }
            setTimeout(function () {
                $(el).inputmask(scope.$eval(countyCode(attrs.initialCountry)));
            }, 500);
            $(el).on('change', function () {
                scope.$eval(attrs.ngModel + "='" + el.val() + "'");
            });
            el.on("countrychange", function (e, countryData) {
                var a = JSON.parse(JSON.stringify(eval('(' + countyCode(countryData.iso2) + ')')));
                var b = a.mask.replace(/\D/g, "").length;
                if (el.val().length > b) {
                    var aa = el.val().substr(0, b);
                    scope.$eval(attrs.ngModel + "='" + aa + "'");
                }
                $(el).inputmask(scope.$eval(countyCode(countryData.iso2)));
            });
        },
    };
}]);
;
app.provider('ngIntlTelInput', function () {
    var me = this;
    var props = {};
    var setFn = function (obj) {
        if (typeof obj === 'object') {
            for (var key in obj) {
                props[key] = obj[key];
            }
        }
    };
    me.set = setFn;

    me.$get = ['$log', function ($log) {
        return Object.create(me, {
            init: {
                value: function (elm) {
                    if (!window.intlTelInputUtils) {
                        $log.warn('intlTelInputUtils is not defined. Formatting and validation will not work.');
                    }
                    elm.intlTelInput(props);
                }
            },
        });
    }];
});

window["phoneCountry"] = 'us';
//var cCodestring = '';
app.directive('ngIntlTelInput', ['ngIntlTelInput', '$log',
    function (ngIntlTelInput, $log) {
        return {
            restrict: 'A',
            require: 'ngModel',
            scope: { itemObject: "=", initialCountry: '@' },
            link: function (scope, elm, attr, ctrl) {
                if (IsNullorEmpty(scope.initialCountry)) {
                    scope.initialCountry = window["phoneCountry"];
                }

                elm.intlTelInput({
                    // allowDropdown: false,
                    // autoHideDialCode: false,
                    autoPlaceholder: "off",
                    // dropdownContainer: "body",
                    // excludeCountries: ["us"],
                    // geoIpLookup: function(callback) {
                    //   $.get("http://ipinfo.io", function() {}, "jsonp").always(function(resp) {
                    //     var countryCode = (resp && resp.country) ? resp.country : "";
                    //     callback(countryCode);
                    //   });
                    // },
                    initialCountry: scope.initialCountry,
                    // nationalMode: false,
                    // numberType: "MOBILE",
                    onlyCountries: ['ad', 'ae', 'af', 'ag', 'ai', 'al', 'am', 'an', 'ao', 'ar', 'at', 'au', 'aw', 'az', 'ba', 'bb', 'bd', 'be', 'bf', 'bg', 'bh', 'bi', 'bj', 'bm', 'bn', 'bo', 'br', 'bs', 'bt', 'bv', 'bw', 'by', 'bz', 'ca', 'cf', 'cg', 'ch', 'ci', 'ck', 'cl', 'cm', 'cn', 'co', 'cr', 'cu', 'cv', 'cy', 'cz', 'de', 'dj', 'dk', 'dm', 'do', 'dz', 'ec', 'ee', 'eg', 'eh', 'er', 'es', 'et', 'fi', 'fj', 'fk', 'fm', 'fo', 'fr', 'ga', 'gb', 'gd', 'ge', 'gh', 'gi', 'gl', 'gm', 'gn', 'gq', 'gr', 'gs', 'gt', 'gw', 'gy', 'hk', 'hn', 'hr', 'ht', 'hu', 'id', 'ie', 'il', 'in', 'iq', 'ir', 'is', 'it', 'jm', 'jo', 'jp', 'ke', 'kg', 'kh', 'ki', 'km', 'kn', 'kp', 'kr', 'kw', 'ky', 'kz', 'la', 'lb', 'lc', 'li', 'lk', 'lr', 'ls', 'lt', 'lu', 'lv', 'ly', 'ma', 'mc', 'md', 'mg', 'mh', 'mk', 'ml', 'mm', 'mn', 'mo', 'mp', 'mr', 'ms', 'mt', 'mu', 'mv', 'mw', 'mx', 'my', 'mz', 'na', 'ne', 'ng', 'ni', 'nl', 'no', 'np', 'nr', 'nz', 'om', 'pa', 'pe', 'pg', 'ph', 'pk', 'pl', 'pt', 'pw', 'py', 'qa', 'ro', 'ru', 'rw', 'sa', 'sb', 'sc', 'sd', 'se', 'sf', 'sg', 'sh', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'st', 'sv', 'sy', 'sz', 'tc', 'td', 'tg', 'th', 'tj', 'tm', 'tn', 'to', 'tp', 'tr', 'tt', 'tv', 'tw', 'tz', 'ua', 'ug', 'us', 'uy', 'uz', 'va', 'vc', 've', 'vg', 'vn', 'vu', 'ws', 'ye', 'za', 'zm', 'zr', 'zw'],
                    // preferredCountries: ['cn', 'jp'],
                    // separateDialCode: true,
                    //utilsScript: "/Scripts/Vendor/utils.js"
                });

                var countryData = elm.intlTelInput("getSelectedCountryData");
                if (IsNotNullorEmpty(scope.itemObject)) {
                    scope.itemObject.CountryCode = countryData.iso2;
                    scope.itemObject.CountryPhoneCode = countryData.dialCode;
                }

                elm.on("countrychange", function (e, countryData) {
                    scope.itemObject.CountryCode = countryData.iso2;
                    scope.itemObject.CountryPhoneCode = countryData.dialCode;
                });

                // Warning for bad directive usage.
                if (attr.type != 'text' && attr.type != 'tel' && elm.tagName != 'INPUT') {
                    $log.warn('ng-intl-tel-input can only be applied to a *text* input');
                    return;
                }
                // Override default country.
                if (attr.defaultCountry) {
                    ngIntlTelInput.set({ defaultCountry: attr.defaultCountry });
                }
                // Initialize.
                ngIntlTelInput.init(elm);

                // Set model value to valid, formatted version.
                ctrl.$parsers.push(function (value) {
                    return elm.intlTelInput('getNumber').replace(/[^\d]/, '');
                });

                ctrl.$parsers.push(function (value) {
                    if (value) {
                        elm.intlTelInput('setNumber', value);
                    }
                    return value;
                });

                // Set input value to model value and trigger evaluation.
                //ctrl.$formatters.push(function (value) {
                //    if (value) {
                //        elm.intlTelInput('setNumber', value);
                //    }
                //    return value;
                //});
            }
        };
    }]);



app.directive("flag", [function () {
    var DDO = {
        restrict: 'E',
        replace: true,
        scope: { countryCode: "@" },
        controller: ['$scope', function ($scope) {
            var code;
            $scope.$watch("countryCode", function (n, o) {
                if (IsNullorEmpty(n)) {
                    code = 'us'
                } else {
                    code = n.toLowerCase()
                }
                $scope.newCountryPhoneCode = code;
            })

        }],
        template: '<span class="iti-flag" ng-class="newCountryPhoneCode" style="display:inline-block;"></span>'
    }
    return DDO;
}]);
;
