metro4
Version:
The front-end framework for Build responsive, mobile-first projects on the web with the first front-end component library in Metro Style
7 lines (6 loc) • 396 kB
JavaScript
/*
* Metro 4 Components Library v4.2.38 (https://metroui.org.ua)
* Copyright 2019 Sergey Pimenov
* Licensed under MIT
*/
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(i){"use strict";var x=i;if(void 0===i)throw new Error("Metro 4 requires jQuery!");if("MutationObserver"in window==!1)throw new Error("Metro 4 requires MutationObserver!");var e=x("meta[name='metro4:init']").attr("content"),t=x("meta[name='metro4:locale']").attr("content"),n=x("meta[name='metro4:week_start']").attr("content"),s=x("meta[name='metro4:date_format']").attr("content"),a=x("meta[name='metro4:date_format_input']").attr("content"),o=x("meta[name='metro4:animation_duration']").attr("content"),r=x("meta[name='metro4:callback_timeout']").attr("content"),l=x("meta[name='metro4:timeout']").attr("content"),c=x("meta[name='metro4:scroll_multiple']").attr("content"),d=x("meta[name='metro4:cloak']").attr("content"),h=x("meta[name='metro4:cloak_duration']").attr("content");void 0===window.METRO_INIT&&(window.METRO_INIT=void 0===e||JSON.parse(e)),void 0===window.METRO_DEBUG&&(window.METRO_DEBUG=!0),void 0===window.METRO_WEEK_START&&(window.METRO_WEEK_START=void 0!==n?parseInt(n):0),void 0===window.METRO_DATE_FORMAT&&(window.METRO_DATE_FORMAT=void 0!==s?s:"%Y-%m-%d"),void 0===window.METRO_DATE_FORMAT_INPUT&&(window.METRO_DATE_FORMAT_INPUT=void 0!==a?a:"%Y-%m-%d"),void 0===window.METRO_LOCALE&&(window.METRO_LOCALE=void 0!==t?t:"en-US"),void 0===window.METRO_ANIMATION_DURATION&&(window.METRO_ANIMATION_DURATION=void 0!==o?parseInt(o):300),void 0===window.METRO_CALLBACK_TIMEOUT&&(window.METRO_CALLBACK_TIMEOUT=void 0!==r?parseInt(r):500),void 0===window.METRO_TIMEOUT&&(window.METRO_TIMEOUT=void 0!==l?parseInt(l):2e3),void 0===window.METRO_SCROLL_MULTIPLE&&(window.METRO_SCROLL_MULTIPLE=void 0!==c?parseInt(c):20),void 0===window.METRO_CLOAK_REMOVE&&(window.METRO_CLOAK_REMOVE=void 0!==d?(""+d).toLowerCase():"fade"),void 0===window.METRO_CLOAK_DURATION&&(window.METRO_CLOAK_DURATION=void 0!==h?parseInt(h):500),void 0===window.METRO_HOTKEYS_FILTER_CONTENT_EDITABLE&&(window.METRO_HOTKEYS_FILTER_CONTENT_EDITABLE=!0),void 0===window.METRO_HOTKEYS_FILTER_INPUT_ACCEPTING_ELEMENTS&&(window.METRO_HOTKEYS_FILTER_INPUT_ACCEPTING_ELEMENTS=!0),void 0===window.METRO_HOTKEYS_FILTER_TEXT_INPUTS&&(window.METRO_HOTKEYS_FILTER_TEXT_INPUTS=!0),void 0===window.METRO_HOTKEYS_BUBBLE_UP&&(window.METRO_HOTKEYS_BUBBLE_UP=!1),void 0===window.METRO_THROWS&&(window.METRO_THROWS=!0),window.METRO_MEDIA=[],"function"!=typeof Object.create&&(Object.create=function(e){function t(){}return t.prototype=e,new t}),"function"!=typeof Object.values&&(Object.values=function(t){return Object.keys(t).map(function(e){return t[e]})}),"function"!=typeof window.setImmediate&&(window.setImmediate=function(e){return setTimeout(e,0)});var u="ontouchstart"in window||0<navigator.MaxTouchPoints||0<navigator.msMaxTouchPoints,S={version:"4.2.38",versionFull:"4.2.38.719 ",isTouchable:u,fullScreenEnabled:document.fullscreenEnabled,sheet:null,controlsPosition:{INSIDE:"inside",OUTSIDE:"outside"},groupMode:{ONE:"one",MULTI:"multi"},aspectRatio:{HD:"hd",SD:"sd",CINEMA:"cinema"},fullScreenMode:{WINDOW:"window",DESKTOP:"desktop"},position:{TOP:"top",BOTTOM:"bottom",LEFT:"left",RIGHT:"right",TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",LEFT_BOTTOM:"left-bottom",LEFT_TOP:"left-top",RIGHT_TOP:"right-top",RIGHT_BOTTOM:"right-bottom"},popoverEvents:{CLICK:"click",HOVER:"hover",FOCUS:"focus"},stepperView:{SQUARE:"square",CYCLE:"cycle",DIAMOND:"diamond"},listView:{LIST:"list",CONTENT:"content",ICONS:"icons",ICONS_MEDIUM:"icons-medium",ICONS_LARGE:"icons-large",TILES:"tiles",TABLE:"table"},events:{click:"click.metro",start:u?"touchstart.metro":"mousedown.metro",stop:u?"touchend.metro":"mouseup.metro",move:u?"touchmove.metro":"mousemove.metro",enter:u?"touchstart.metro":"mouseenter.metro",leave:"mouseleave.metro",focus:"focus.metro",blur:"blur.metro",resize:"resize.metro",keyup:"keyup.metro",keydown:"keydown.metro",keypress:"keypress.metro",dblclick:"dblclick.metro",input:"input.metro",change:"change.metro",cut:"cut.metro",paste:"paste.metro",scroll:"scroll.metro",scrollStart:"scrollstart.metro",scrollStop:"scrollstop.metro",mousewheel:"mousewheel.metro",inputchange:"change.metro input.metro propertychange.metro cut.metro paste.metro copy.metro",dragstart:"dragstart.metro",dragend:"dragend.metro",dragenter:"dragenter.metro",dragover:"dragover.metro",dragleave:"dragleave.metro",drop:"drop.metro",drag:"drag.metro"},keyCode:{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,BREAK:19,CAPS:20,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,COMMA:188},media_queries:{FS:"(min-width: 0px)",XS:"(min-width: 360px)",SM:"(min-width: 576px)",MD:"(min-width: 768px)",LG:"(min-width: 992px)",XL:"(min-width: 1200px)",XXL:"(min-width: 1452px)"},media_sizes:{FS:0,XS:360,SM:576,LD:640,MD:768,LG:992,XL:1200,XXL:1452},media_mode:{FS:"fs",XS:"xs",SM:"sm",MD:"md",LG:"lg",XL:"xl",XXL:"xxl"},media_modes:["fs","xs","sm","md","lg","xl","xxl"],actions:{REMOVE:1,HIDE:2},hotkeys:[],about:function(e){console.log("Metro 4 - v"+(!0===e?this.versionFull:this.version))},aboutDlg:function(e){alert("Metro 4 - v"+(!0===e?this.versionFull:this.version))},ver:function(e){return!0===e?this.versionFull:this.version},observe:function(){new MutationObserver(function(e){e.map(function(t){if("attributes"===t.type&&"data-role"!==t.attributeName){var n=x(t.target),e=n.data("metroComponent");void 0!==e&&x.each(e,function(){var e=n.data(this);e&&e.changeAttribute(t.attributeName)})}else if("childList"===t.type&&0<t.addedNodes.length){var i,s,a={},o={},r=t.addedNodes;for(i=0;i<r.length;i++){var l=t.addedNodes[i];"SCRIPT"!==l.tagName&&"STYLE"!==l.tagName&&(o=(s=x(t.addedNodes[i])).find("[data-role]"),(a=void 0!==s.data("role")?x.merge(o,s):o).length&&S.initWidgets(a))}}})}).observe(x("html")[0],{childList:!0,attributes:!0,subtree:!0})},init:function(){var e=x("[data-role]"),t=x("[data-hotkey]"),n=x("html");return!0===u?n.addClass("metro-touch-device"):n.addClass("metro-no-touch-device"),this.sheet=X.newCssSheet(),window.METRO_MEDIA=[],x.each(S.media_queries,function(e,t){X.media(t)&&METRO_MEDIA.push(S.media_mode[e])}),this.observe(),this.initHotkeys(t),this.initWidgets(e),this.about(!0),"fade"!==METRO_CLOAK_REMOVE?x(".m4-cloak").removeClass("m4-cloak"):x(".m4-cloak").animate({opacity:1},METRO_CLOAK_REMOVE,function(){x(".m4-cloak").removeClass("m4-cloak")}),this},initHotkeys:function(e){x.each(e,function(){var t=x(this),e=!!t.data("hotkey")&&t.data("hotkey").toLowerCase();!1!==e&&!0!==t.data("hotKeyBonded")&&(S.hotkeys.push(e),x(document).on(S.events.keyup,null,e,function(e){if(void 0!==t)return"A"===t[0].tagName&&void 0!==t.attr("href")&&""!==t.attr("href").trim()&&"#"!==t.attr("href").trim()?document.location.href=t.attr("href"):t.click(),METRO_HOTKEYS_BUBBLE_UP}),t.data("hotKeyBonded",!0))})},initWidgets:function(e){x.each(e,function(){var n=x(this);n.data("role").split(/\s*,\s*/).map(function(e){if(void 0!==x.fn[e]&&void 0===n.attr("data-role-"+e)){x.fn[e].call(n),n.attr("data-role-"+e,!0);var t=n.data("metroComponent");void 0===t?t=[e]:t.push(e),n.data("metroComponent",t)}})})},plugin:function(t,n){x.fn[t]=function(e){return this.each(function(){x.data(this,t,Object.create(n).init(e,this))})}},destroyPlugin:function(e,t){var n,i;if(e=X.isJQueryObject(e)?e[0]:e,n=x(e).data(t),!X.isValue(n))throw new Error("Component can not be destroyed: the element is not a Metro 4 component.");if(!X.isFunc(n.destroy))throw new Error("Component can not be destroyed: method destroy not found.");n.destroy(),i=x(e).data("metroComponent"),X.arrayDelete(i,t),x(e).data("metroComponent",i),x.removeData(e,t),x(e).removeAttr("data-role-"+t)},destroyPluginAll:function(e){e=X.isJQueryObject(e)?e[0]:e;var t=x(e).data("metroComponent");void 0!==t&&0<t.length&&x.each(t,function(){S.destroyPlugin(e,this)})},initPlugin:function(e,t){e=x(e);try{if(void 0!==x.fn[t]&&void 0===e.attr("data-role-"+t)){x.fn[t].call(e),e.attr("data-role-"+t,!0);var n=e.data("metroComponent");void 0===n?n=[t]:n.push(t),e.data("metroComponent",n)}}catch(e){console.log(e.message,e.stack)}},reinitPlugin:function(e,t){this.destroyPlugin(e,t),this.initPlugin(e,t)},reinitPluginAll:function(e){var t=x(e).data("metroComponent");void 0!==t&&0<t.length&&x.each(t,function(){S.reinitPlugin(e,this)})},noop:function(){},noop_true:function(){return!0},noop_false:function(){return!1},stop:function(e){e.stopPropagation(),e.preventDefault()},requestFullScreen:function(e){e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen?e.webkitRequestFullScreen():e.msRequestFullscreen?e.msRequestFullscreen():e.requestFullscreen()},exitFullScreen:function(){document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():document.exitFullscreen()},inFullScreen:function(){return void 0!==(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)}};window.Metro=S,x(window).on(S.events.resize,function(){window.METRO_MEDIA=[],x.each(S.media_queries,function(e,t){X.media(t)&&METRO_MEDIA.push(S.media_mode[e])})});var p={duration:METRO_ANIMATION_DURATION,func:"swing",switch:function(e,t){e.hide(),t.css({top:0,left:0}).show()},slideUp:function(e,t,n,i){var s=e.parent().outerHeight(!0);void 0===n&&(n=this.duration),void 0===i&&(i=this.func),e.css("z-index",1).animate({top:-s,opacity:0},n,i),t.css({top:s,left:0,zIndex:2}).animate({top:0,opacity:1},n,i)},slideDown:function(e,t,n,i){var s=e.parent().outerHeight(!0);void 0===n&&(n=this.duration),void 0===i&&(i=this.func),e.css("z-index",1).animate({top:s,opacity:0},n,i),t.css({left:0,top:-s,zIndex:2}).animate({top:0,opacity:1},n,i)},slideLeft:function(e,t,n,i){var s=e.parent().outerWidth(!0);void 0===n&&(n=this.duration),void 0===i&&(i=this.func),e.css("z-index",1).animate({left:-s,opacity:0},n,i),t.css({left:s,zIndex:2}).animate({left:0,opacity:1},n,i)},slideRight:function(e,t,n,i){var s=e.parent().outerWidth(!0);void 0===n&&(n=this.duration),void 0===i&&(i=this.func),e.css("z-index",1).animate({left:s,opacity:0},n,i),t.css({left:-s,zIndex:2}).animate({left:0,opacity:1},n,i)},fade:function(e,t,n){void 0===n&&(n=this.duration),e.animate({opacity:0},n),t.css({top:0,left:0}).animate({opacity:1},n)}};function f(e,t,n){this.r=e||0,this.g=t||0,this.g=n||0}function m(e,t,n){this.h=e||0,this.s=t||0,this.v=n||0}function v(e,t,n,i){this.c=e||0,this.m=t||0,this.y=n||0,this.k=i||0}S.animation=p;var g={TYPES:{HEX:"hex",RGB:"rgb",RGBA:"rgba",HSV:"hsv",HSL:"hsl",CMYK:"cmyk",UNKNOWN:"unknown"},PALETTES:{ALL:"colorList",METRO:"colorListMetro",STANDARD:"colorListStandard"},colorListMetro:{lime:"#a4c400",green:"#60a917",emerald:"#008a00",blue:"#00AFF0",teal:"#00aba9",cyan:"#1ba1e2",cobalt:"#0050ef",indigo:"#6a00ff",violet:"#aa00ff",pink:"#dc4fad",magenta:"#d80073",crimson:"#a20025",red:"#CE352C",orange:"#fa6800",amber:"#f0a30a",yellow:"#fff000",brown:"#825a2c",olive:"#6d8764",steel:"#647687",mauve:"#76608a",taupe:"#87794e"},colorListStandard:{aliceBlue:"#f0f8ff",antiqueWhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedAlmond:"#ffebcd",blue:"#0000ff",blueViolet:"#8a2be2",brown:"#a52a2a",burlyWood:"#deb887",cadetBlue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerBlue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkBlue:"#00008b",darkCyan:"#008b8b",darkGoldenRod:"#b8860b",darkGray:"#a9a9a9",darkGreen:"#006400",darkKhaki:"#bdb76b",darkMagenta:"#8b008b",darkOliveGreen:"#556b2f",darkOrange:"#ff8c00",darkOrchid:"#9932cc",darkRed:"#8b0000",darkSalmon:"#e9967a",darkSeaGreen:"#8fbc8f",darkSlateBlue:"#483d8b",darkSlateGray:"#2f4f4f",darkTurquoise:"#00ced1",darkViolet:"#9400d3",deepPink:"#ff1493",deepSkyBlue:"#00bfff",dimGray:"#696969",dodgerBlue:"#1e90ff",fireBrick:"#b22222",floralWhite:"#fffaf0",forestGreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#DCDCDC",ghostWhite:"#F8F8FF",gold:"#ffd700",goldenRod:"#daa520",gray:"#808080",green:"#008000",greenYellow:"#adff2f",honeyDew:"#f0fff0",hotPink:"#ff69b4",indianRed:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderBlush:"#fff0f5",lawnGreen:"#7cfc00",lemonChiffon:"#fffacd",lightBlue:"#add8e6",lightCoral:"#f08080",lightCyan:"#e0ffff",lightGoldenRodYellow:"#fafad2",lightGray:"#d3d3d3",lightGreen:"#90ee90",lightPink:"#ffb6c1",lightSalmon:"#ffa07a",lightSeaGreen:"#20b2aa",lightSkyBlue:"#87cefa",lightSlateGray:"#778899",lightSteelBlue:"#b0c4de",lightYellow:"#ffffe0",lime:"#00ff00",limeGreen:"#32dc32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumAquaMarine:"#66cdaa",mediumBlue:"#0000cd",mediumOrchid:"#ba55d3",mediumPurple:"#9370db",mediumSeaGreen:"#3cb371",mediumSlateBlue:"#7b68ee",mediumSpringGreen:"#00fa9a",mediumTurquoise:"#48d1cc",mediumVioletRed:"#c71585",midnightBlue:"#191970",mintCream:"#f5fffa",mistyRose:"#ffe4e1",moccasin:"#ffe4b5",navajoWhite:"#ffdead",navy:"#000080",oldLace:"#fdd5e6",olive:"#808000",oliveDrab:"#6b8e23",orange:"#ffa500",orangeRed:"#ff4500",orchid:"#da70d6",paleGoldenRod:"#eee8aa",paleGreen:"#98fb98",paleTurquoise:"#afeeee",paleVioletRed:"#db7093",papayaWhip:"#ffefd5",peachPuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderBlue:"#b0e0e6",purple:"#800080",rebeccaPurple:"#663399",red:"#ff0000",rosyBrown:"#bc8f8f",royalBlue:"#4169e1",saddleBrown:"#8b4513",salmon:"#fa8072",sandyBrown:"#f4a460",seaGreen:"#2e8b57",seaShell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",slyBlue:"#87ceeb",slateBlue:"#6a5acd",slateGray:"#708090",snow:"#fffafa",springGreen:"#00ff7f",steelBlue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whiteSmoke:"#f5f5f5",yellow:"#ffff00",yellowGreen:"#9acd32"},colorList:{},options:{angle:30,algorithm:1,step:.1,distance:5,tint1:.8,tint2:.4,shade1:.6,shade2:.3,alpha:1},init:function(){return this.colorList=x.extend({},this.colorListStandard,this.colorListMetro),this},setup:function(e){this.options=x.extend({},this.options,e)},color:function(e,t){return void 0!==this[t=t||this.PALETTES.ALL][e]&&this[t][e]},palette:function(e){return e=e||this.PALETTES.ALL,Object.keys(this[e])},colors:function(e){var t=[];return e=e||this.PALETTES.ALL,x.each(this[e],function(){t.push(this)}),t},hex2rgb:function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,n,i){return t+t+n+n+i+i});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},rgb2hex:function(e){return"#"+((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)},rgb2hsv:function(e){var t,n,i,s=new m,a=e.r/255,o=e.g/255,r=e.b/255,l=Math.max(a,o,r),c=Math.min(a,o,r),d=l-c;return n=0===(i=l)?0:1-c/l,t=l===c?0:l===a&&r<=o?(o-r)/d*60:l===a&&o<r?(o-r)/d*60+360:l===o?(r-a)/d*60+120:l===r?(a-o)/d*60+240:0,s.h=t,s.s=n,s.v=i,s},hsv2rgb:function(e){var t,n,i,s=e.h,a=100*e.s,o=100*e.v,r=(100-a)*o/100,l=s%60/60*(o-r),c=r+l,d=o-l;switch(Math.floor(s/60)){case 0:t=o,n=c,i=r;break;case 1:t=d,n=o,i=r;break;case 2:t=r,n=o,i=c;break;case 3:t=r,n=d,i=o;break;case 4:t=c,n=r,i=o;break;case 5:t=o,n=r,i=d}return{r:Math.round(255*t/100),g:Math.round(255*n/100),b:Math.round(255*i/100)}},hsv2hex:function(e){return this.rgb2hex(this.hsv2rgb(e))},hex2hsv:function(e){return this.rgb2hsv(this.hex2rgb(e))},rgb2cmyk:function(e){var t=new v,n=e.r/255,i=e.g/255,s=e.b/255;return t.k=Math.min(1-n,1-i,1-s),t.c=(1-n-t.k)/(1-t.k),t.m=(1-i-t.k)/(1-t.k),t.y=(1-s-t.k)/(1-t.k),t.c=Math.round(100*t.c),t.m=Math.round(100*t.m),t.y=Math.round(100*t.y),t.k=Math.round(100*t.k),t},cmyk2rgb:function(e){var t=new f,n=e.c/100,i=e.m/100,s=e.y/100,a=e.k/100;return t.r=1-Math.min(1,n*(1-a)+a),t.g=1-Math.min(1,i*(1-a)+a),t.b=1-Math.min(1,s*(1-a)+a),t.r=Math.round(255*t.r),t.g=Math.round(255*t.g),t.b=Math.round(255*t.b),t},hsv2hsl:function(e){var t,n,i;return t=e.h,i=(2-e.s)*e.v,n=e.s*e.v,{h:t,s:n/=i<=1?i:2-i,l:i/=2}},hsl2hsv:function(e){var t,n,i,s;return t=e.h,i=((s=2*e.l)+(n=e.s*(s<=1?s:2-s)))/2,{h:t,s:n=2*n/(s+n),l:i}},rgb2websafe:function(e){return{r:51*Math.round(e.r/51),g:51*Math.round(e.g/51),b:51*Math.round(e.b/51)}},rgba2websafe:function(e){return{r:51*Math.round(e.r/51),g:51*Math.round(e.g/51),b:51*Math.round(e.b/51),a:e.a}},hex2websafe:function(e){return this.rgb2hex(this.rgb2websafe(this.toRGB(e)))},hsv2websafe:function(e){return this.rgb2hsv(this.rgb2websafe(this.toRGB(e)))},hsl2websafe:function(e){return this.hsv2hsl(this.rgb2hsv(this.rgb2websafe(this.toRGB(e))))},cmyk2websafe:function(e){return this.rgb2cmyk(this.rgb2websafe(this.cmyk2rgb(e)))},websafe:function(e){return this.isHEX(e)?this.hex2websafe(e):this.isRGB(e)?this.rgb2websafe(e):this.isRGBA(e)?this.rgba2websafe(e):this.isHSV(e)?this.hsv2websafe(e):this.isHSL(e)?this.hsl2websafe(e):this.isCMYK(e)?this.cmyk2websafe(e):e},is:function(e){return this.isHEX(e)?this.TYPES.HEX:this.isRGB(e)?this.TYPES.RGB:this.isRGBA(e)?this.TYPES.RGBA:this.isHSV(e)?this.TYPES.HSV:this.isHSL(e)?this.TYPES.HSL:this.isCMYK(e)?this.TYPES.CMYK:this.TYPES.UNKNOWN},toRGB:function(e){if(this.isHSV(e))return this.hsv2rgb(e);if(this.isHSL(e))return this.hsv2rgb(this.hsl2hsv(e));if(this.isRGB(e))return e;if(this.isHEX(e))return this.hex2rgb(e);if(this.isCMYK(e))return this.cmyk2rgb(e);throw new Error("Unknown color format!")},toRGBA:function(e,t){var n=this.toRGB(e);return n.a=t||1,n},toHSV:function(e){return this.rgb2hsv(this.toRGB(e))},toHSL:function(e){return this.hsv2hsl(this.rgb2hsv(this.toRGB(e)))},toHSLA:function(e,t){var n;return(n=this.hsv2hsl(this.rgb2hsv(this.toRGB(e)))).a=t||this.options.alpha,n},toHEX:function(e){return this.rgb2hex(this.toRGB(e))},toCMYK:function(e){return this.rgb2cmyk(this.toRGB(e))},toHexString:function(e){return this.toHEX(e)},toHsvString:function(e){var t=this.toHSV(e);return"hsv("+[t.h,t.s,t.v].join(",")+")"},toHslString:function(e){var t=this.toHSL(e);return"hsl("+[Math.round(t.h),Math.round(100*t.s)+"%",Math.round(100*t.l)+"%"].join(",")+")"},toHslaString:function(e){var t=this.toHSLA(e);return"hsl("+[Math.round(t.h),Math.round(100*t.s)+"%",Math.round(100*t.l)+"%",t.a].join(",")+")"},toCmykString:function(e){var t=this.toCMYK(e);return"cmyk("+[t.c,t.m,t.y,t.k].join(",")+")"},toRgbString:function(e){var t=this.toRGB(e);return"rgb("+[t.r,t.g,t.b].join(",")+")"},toRgbaString:function(e){var t=this.toRGBA(e);return"rgba("+[t.r,t.g,t.b,t.a].join(",")+")"},toString:function(e){if(this.isHEX(e))return this.toHexString(e);if(this.isRGB(e))return this.toRgbString(e);if(this.isRGBA(e))return this.toRgbaString(e);if(this.isHSV(e))return this.toHsvString(e);if(this.isHSL(e))return this.toHslString(e);if(this.isHSLA(e))return this.toHslaString(e);if(this.isCMYK(e))return this.toCmykString(e);throw new Error("Unknown color format!")},grayscale:function(e,t){t=t||"hex";var n=this.toRGB(e),i=Math.round(.2125*n.r+.7154*n.g+.0721*n.b),s={r:i,g:i,b:i};return this["rgb2"+t](s)},darken:function(e,t){return void 0===t&&(t=10),this.lighten(e,-1*Math.abs(t))},lighten:function(e,t){var n,r,i=1,s=0<t,a=function(e,t){var n=e.slice(1),i=parseInt(n,16),s=(i>>16)+t;255<s?s=255:s<0&&(s=0);var a=(i>>8&255)+t;255<a?a=255:a<0&&(a=0);var o=(255&i)+t;return 255<o?o=255:o<0&&(o=0),r="#"+(o|a<<8|s<<16).toString(16)};for(void 0===t&&(t=10),(n=this.is(e))===this.TYPES.RGBA&&(i=e.a);r=a(this.toHEX(e),t),s?t--:t++,r.length<7;);switch(n){case"rgb":return this.toRGB(r);case"rgba":return this.toRGBA(r,i);case"hsv":return this.toHSV(r);case"hsl":return this.toHSL(r);case"cmyk":return this.toCMYK(r);default:return r}},isDark:function(e){var t=this.toRGB(e);return(299*t.r+587*t.g+114*t.b)/1e3<128},isLight:function(e){return!this.isDark(e)},isHSV:function(e){return X.isObject(e)&&"h"in e&&"s"in e&&"v"in e},isHSL:function(e){return X.isObject(e)&&"h"in e&&"s"in e&&"l"in e},isHSLA:function(e){return X.isObject(e)&&"h"in e&&"s"in e&&"l"in e&&"a"in e},isRGB:function(e){return X.isObject(e)&&"r"in e&&"g"in e&&"b"in e},isRGBA:function(e){return X.isObject(e)&&"r"in e&&"g"in e&&"b"in e&&"a"in e},isCMYK:function(e){return X.isObject(e)&&"c"in e&&"m"in e&&"y"in e&&"k"in e},isHEX:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)},isColor:function(e){return this.isHEX(e)||this.isRGB(e)||this.isRGBA(e)||this.isHSV(e)||this.isHSL(e)||this.isCMYK(e)},hueShift:function(e,t){for(e+=t;360<=e;)e-=360;for(;e<0;)e+=360;return e},getScheme:function(e,t,n,i){var s;this.options=x.extend({},this.options,i);var a,o=[],r=this;if(a=this.toHSV(e),!1===this.isHSV(a))return console.log("The value is a not supported color format!"),!1;function l(e,t,n){return Math.max(t,Math.min(e,n))}function c(e,t,n){return e<t?t:n<e?n:e}var d,h=a.h,u=a.s,p=a.v,f=this.options;switch(t){case"monochromatic":case"mono":if(1===f.algorithm)(d=this.hsv2rgb(a)).r=c(Math.round(d.r+(255-d.r)*f.tint1),0,255),d.g=c(Math.round(d.g+(255-d.g)*f.tint1),0,255),d.b=c(Math.round(d.b+(255-d.b)*f.tint1),0,255),o.push(this.rgb2hsv(d)),(d=this.hsv2rgb(a)).r=c(Math.round(d.r+(255-d.r)*f.tint2),0,255),d.g=c(Math.round(d.g+(255-d.g)*f.tint2),0,255),d.b=c(Math.round(d.b+(255-d.b)*f.tint2),0,255),o.push(this.rgb2hsv(d)),o.push(a),(d=this.hsv2rgb(a)).r=c(Math.round(d.r*f.shade1),0,255),d.g=c(Math.round(d.g*f.shade1),0,255),d.b=c(Math.round(d.b*f.shade1),0,255),o.push(this.rgb2hsv(d)),(d=this.hsv2rgb(a)).r=c(Math.round(d.r*f.shade2),0,255),d.g=c(Math.round(d.g*f.shade2),0,255),d.b=c(Math.round(d.b*f.shade2),0,255),o.push(this.rgb2hsv(d));else if(2===f.algorithm)for(o.push(a),s=1;s<=f.distance;s++)p=l(p-f.step,0,1),u=l(u-f.step,0,1),o.push({h:h,s:u,v:p});else if(3===f.algorithm)for(o.push(a),s=1;s<=f.distance;s++)p=l(p-f.step,0,1),o.push({h:h,s:u,v:p});else p=l(a.v+2*f.step,0,1),o.push({h:h,s:u,v:p}),p=l(a.v+f.step,0,1),o.push({h:h,s:u,v:p}),o.push(a),u=a.s,p=a.v,p=l(a.v-f.step,0,1),o.push({h:h,s:u,v:p}),p=l(a.v-2*f.step,0,1),o.push({h:h,s:u,v:p});break;case"complementary":case"complement":case"comp":o.push(a),h=this.hueShift(a.h,180),o.push({h:h,s:u,v:p});break;case"double-complementary":case"double-complement":case"double":o.push(a),console.log(h),h=this.hueShift(h,180),o.push({h:h,s:u,v:p}),console.log(h),h=this.hueShift(h,f.angle),o.push({h:h,s:u,v:p}),console.log(h),h=this.hueShift(h,180),o.push({h:h,s:u,v:p}),console.log(h);break;case"analogous":case"analog":h=this.hueShift(h,f.angle),o.push({h:h,s:u,v:p}),o.push(a),h=this.hueShift(a.h,0-f.angle),o.push({h:h,s:u,v:p});break;case"triadic":case"triad":for(o.push(a),s=1;s<3;s++)h=this.hueShift(h,120),o.push({h:h,s:u,v:p});break;case"tetradic":case"tetra":o.push(a),h=this.hueShift(a.h,180),o.push({h:h,s:u,v:p}),h=this.hueShift(a.h,-1*f.angle),o.push({h:h,s:u,v:p}),h=this.hueShift(h,180),o.push({h:h,s:u,v:p});break;case"square":for(o.push(a),s=1;s<4;s++)h=this.hueShift(h,90),o.push({h:h,s:u,v:p});break;case"split-complementary":case"split-complement":case"split":h=this.hueShift(h,180-f.angle),o.push({h:h,s:u,v:p}),o.push(a),h=this.hueShift(a.h,180+f.angle),o.push({h:h,s:u,v:p});break;default:console.log("Unknown scheme name")}return function(e,t){var n=[],i=r.options;switch(t){case"hex":n=e.map(function(e){return g.toHEX(e)});break;case"rgb":n=e.map(function(e){return g.toRGB(e)});break;case"rgba":n=e.map(function(e){return g.toRGBA(e,i.alpha)});break;case"hsl":n=e.map(function(e){return g.toHSL(e)});break;case"cmyk":n=e.map(function(e){return g.toCMYK(e)});break;default:n=e}return n}(o,n)}};S.colors=g.init(),x.easing.jswing=x.easing.swing,x.extend(x.easing,{def:"easeOutQuad",swing:function(e,t,n,i,s){return x.easing[x.easing.def](e,t,n,i,s)},easeInQuad:function(e,t,n,i,s){return i*(t/=s)*t+n},easeOutQuad:function(e,t,n,i,s){return-i*(t/=s)*(t-2)+n},easeInOutQuad:function(e,t,n,i,s){return(t/=s/2)<1?i/2*t*t+n:-i/2*(--t*(t-2)-1)+n},easeInCubic:function(e,t,n,i,s){return i*(t/=s)*t*t+n},easeOutCubic:function(e,t,n,i,s){return i*((t=t/s-1)*t*t+1)+n},easeInOutCubic:function(e,t,n,i,s){return(t/=s/2)<1?i/2*t*t*t+n:i/2*((t-=2)*t*t+2)+n},easeInQuart:function(e,t,n,i,s){return i*(t/=s)*t*t*t+n},easeOutQuart:function(e,t,n,i,s){return-i*((t=t/s-1)*t*t*t-1)+n},easeInOutQuart:function(e,t,n,i,s){return(t/=s/2)<1?i/2*t*t*t*t+n:-i/2*((t-=2)*t*t*t-2)+n},easeInQuint:function(e,t,n,i,s){return i*(t/=s)*t*t*t*t+n},easeOutQuint:function(e,t,n,i,s){return i*((t=t/s-1)*t*t*t*t+1)+n},easeInOutQuint:function(e,t,n,i,s){return(t/=s/2)<1?i/2*t*t*t*t*t+n:i/2*((t-=2)*t*t*t*t+2)+n},easeInSine:function(e,t,n,i,s){return-i*Math.cos(t/s*(Math.PI/2))+i+n},easeOutSine:function(e,t,n,i,s){return i*Math.sin(t/s*(Math.PI/2))+n},easeInOutSine:function(e,t,n,i,s){return-i/2*(Math.cos(Math.PI*t/s)-1)+n},easeInExpo:function(e,t,n,i,s){return 0==t?n:i*Math.pow(2,10*(t/s-1))+n},easeOutExpo:function(e,t,n,i,s){return t==s?n+i:i*(1-Math.pow(2,-10*t/s))+n},easeInOutExpo:function(e,t,n,i,s){return 0==t?n:t==s?n+i:(t/=s/2)<1?i/2*Math.pow(2,10*(t-1))+n:i/2*(2-Math.pow(2,-10*--t))+n},easeInCirc:function(e,t,n,i,s){return-i*(Math.sqrt(1-(t/=s)*t)-1)+n},easeOutCirc:function(e,t,n,i,s){return i*Math.sqrt(1-(t=t/s-1)*t)+n},easeInOutCirc:function(e,t,n,i,s){return(t/=s/2)<1?-i/2*(Math.sqrt(1-t*t)-1)+n:i/2*(Math.sqrt(1-(t-=2)*t)+1)+n},easeInElastic:function(e,t,n,i,s){var a=1.70158,o=0,r=i;return 0==t?n:1==(t/=s)?n+i:(o||(o=.3*s),a=r<Math.abs(i)?(r=i,o/4):o/(2*Math.PI)*Math.asin(i/r),-r*Math.pow(2,10*(t-=1))*Math.sin((t*s-a)*(2*Math.PI)/o)+n)},easeOutElastic:function(e,t,n,i,s){var a=1.70158,o=0,r=i;return 0==t?n:1==(t/=s)?n+i:(o||(o=.3*s),a=r<Math.abs(i)?(r=i,o/4):o/(2*Math.PI)*Math.asin(i/r),r*Math.pow(2,-10*t)*Math.sin((t*s-a)*(2*Math.PI)/o)+i+n)},easeInOutElastic:function(e,t,n,i,s){var a=1.70158,o=0,r=i;return 0==t?n:2==(t/=s/2)?n+i:(o||(o=s*(.3*1.5)),a=r<Math.abs(i)?(r=i,o/4):o/(2*Math.PI)*Math.asin(i/r),t<1?r*Math.pow(2,10*(t-=1))*Math.sin((t*s-a)*(2*Math.PI)/o)*-.5+n:r*Math.pow(2,-10*(t-=1))*Math.sin((t*s-a)*(2*Math.PI)/o)*.5+i+n)},easeInBack:function(e,t,n,i,s,a){return null==a&&(a=1.70158),i*(t/=s)*t*((a+1)*t-a)+n},easeOutBack:function(e,t,n,i,s,a){return null==a&&(a=1.70158),i*((t=t/s-1)*t*((a+1)*t+a)+1)+n},easeInOutBack:function(e,t,n,i,s,a){return null==a&&(a=1.70158),(t/=s/2)<1?i/2*(t*t*((1+(a*=1.525))*t-a))+n:i/2*((t-=2)*t*((1+(a*=1.525))*t+a)+2)+n},easeInBounce:function(e,t,n,i,s){return i-x.easing.easeOutBounce(e,s-t,0,i,s)+n},easeOutBounce:function(e,t,n,i,s){return(t/=s)<1/2.75?i*(7.5625*t*t)+n:t<2/2.75?i*(7.5625*(t-=1.5/2.75)*t+.75)+n:t<2.5/2.75?i*(7.5625*(t-=2.25/2.75)*t+.9375)+n:i*(7.5625*(t-=2.625/2.75)*t+.984375)+n},easeInOutBounce:function(e,t,n,i,s){return t<s/2?.5*x.easing.easeInBounce(e,2*t,0,i,s)+n:.5*x.easing.easeOutBounce(e,2*t-s,0,i,s)+.5*i+n}});var C={init:function(){return this},options:{csvDelimiter:"\t",csvNewLine:"\r\n",includeHeader:!0},setup:function(e){return this.options=x.extend({},this.options,e),this},base64:function(e){return window.btoa(unescape(encodeURIComponent(e)))},b64toBlob:function(e,t,n){t=t||"",n=n||512;var i,s=window.atob(e),a=[];for(i=0;i<s.length;i+=n){var o,r=s.slice(i,i+n),l=new Array(r.length);for(o=0;o<r.length;o+=1)l[o]=r.charCodeAt(o);var c=new window.Uint8Array(l);a.push(c)}return new Blob(a,{type:t})},tableToCSV:function(e,t,n){var i,s,a,o,r,l,c=this.options,d="";if(c=x.extend({},c,n),X.isJQueryObject(e)&&(e=e[0]),X.bool(c.includeHeader))for(s=e.querySelectorAll("thead")[0],a=0;a<s.rows.length;a++){for(r=s.rows[a],o=0;o<r.cells.length;o++)l=r.cells[o],d+=(o?c.csvDelimiter:"")+l.textContent.trim();d+=c.csvNewLine}for(i=e.querySelectorAll("tbody")[0],a=0;a<i.rows.length;a++){for(r=i.rows[a],o=0;o<r.cells.length;o++)l=r.cells[o],d+=(o?c.csvDelimiter:"")+l.textContent.trim();d+=c.csvNewLine}return X.isValue(t)?this.createDownload(this.base64("\ufeff"+d),"application/csv",t):d},createDownload:function(e,t,n){var i,s,a;return(s=document.createElement("a")).style.display="none",document.body.appendChild(s),i=this.b64toBlob(e,t),a=window.URL.createObjectURL(i),s.href=a,s.download=n||X.elementId("download"),s.click(),window.URL.revokeObjectURL(a),document.body.removeChild(s),!0}};S.export=C.init(),x.fn.extend({toggleAttr:function(t,n){return this.each(function(){var e=x(this);void 0!==n?e.attr(t,n):void 0!==e.attr(t)?e.removeAttr(t):e.attr(t,""+t)})},clearClasses:function(){return this.each(function(){this.className=""})},fire:function(t,n){return this.each(function(){var e=i.Event(t);e.detail=n,x(this).trigger(e)})}}),Array.prototype.shuffle=function(){for(var e,t,n=this.length;0!==n;)t=Math.floor(Math.random()*n),e=this[n-=1],this[n]=this[t],this[t]=e;return this},Array.prototype.clone=function(){return this.slice(0)},Array.prototype.unique=function(){for(var e=this.concat(),t=0;t<e.length;++t)for(var n=t+1;n<e.length;++n)e[t]===e[n]&&e.splice(n--,1);return e},Array.from||(Array.from=function(e){var t,n=[];if(void 0===e.length&&"object"==typeof e)return Object.values(e);if(void 0===e.length)throw new Error("Value can not be converted to array");for(t=0;t<e.length;t++)n.push(e[t]);return n}),"function"!=typeof Array.contains&&(Array.prototype.contains=function(e,t){return-1<this.indexOf(e,t)}),Number.prototype.format=function(e,t,n,i){var s="\\d(?=(\\d{"+(t||3)+"})+"+(0<e?"\\D":"$")+")",a=this.toFixed(Math.max(0,~~e));return(i?a.replace(".",i):a).replace(new RegExp(s,"g"),"$&"+(n||","))},String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)},String.prototype.contains=function(){return!!~String.prototype.indexOf.apply(this,arguments)},String.prototype.toDate=function(e,a){var t,n,i,s,o,r,l,c,d,h,u,p,f,m,v,g;a=a||"en-US";if(null==e||""===e)return new Date(this);if(t=this.replace(/[\/,.:\s]/g,"-"),n=e.toLowerCase().replace(/[^a-zA-Z0-9%]/g,"-").split("-"),i=t.split("-"),""===t.replace(/\-/g,"").trim())return"Invalid Date";if(s=-1<n.indexOf("mm")?n.indexOf("mm"):n.indexOf("%m"),o=-1<n.indexOf("dd")?n.indexOf("dd"):n.indexOf("%d"),r=-1<n.indexOf("yyyy")?n.indexOf("yyyy"):-1<n.indexOf("yy")?n.indexOf("yy"):n.indexOf("%y"),l=-1<n.indexOf("hh")?n.indexOf("hh"):n.indexOf("%h"),c=-1<n.indexOf("ii")?n.indexOf("ii"):-1<n.indexOf("mi")?n.indexOf("mi"):n.indexOf("%i"),d=-1<n.indexOf("ss")?n.indexOf("ss"):n.indexOf("%s"),!(-1<s&&""!==i[s]))return"Invalid Date";if(isNaN(parseInt(i[s]))){if(i[s]=function(e){var t,n,i,s;if(e=e.substr(0,3),void 0!==a&&"en-US"!==a&&void 0!==w&&void 0!==w[a]&&void 0!==w[a].calendar&&void 0!==w[a].calendar.months){for(n=w[a].calendar.months,s=12;s<n.length;s++)if(n[s].toLowerCase()===e.toLowerCase()){i=s-12;break}e=w["en-US"].calendar.months[i]}return t=Date.parse(e+" 1, 1972"),isNaN(t)?-1:new Date(t).getMonth()+1}(i[s]),-1===i[s])return"Invalid Date"}else if((g=parseInt(i[s]))<1||12<g)return"Invalid Date";return h=-1<r&&""!==i[r]?i[r]:null,u=-1<s&&""!==i[s]?i[s]:null,p=-1<o&&""!==i[o]?i[o]:null,f=-1<l&&""!==i[l]?i[l]:null,m=-1<c&&""!==i[c]?i[c]:null,v=-1<d&&""!==i[d]?i[d]:null,new Date(h,u-1,p,f,m,v)},String.prototype.toArray=function(e,n,i){return n=n||"string",i=null!=i&&i,(""+this).split(e=e||",").map(function(e){var t;switch(n){case"int":case"integer":t=parseInt(e);break;case"number":case"float":t=parseFloat(e);break;case"date":t=i?e.toDate(i):new Date(e);break;default:t=e.trim()}return t})},Date.prototype.getWeek=function(e){var t,n,i,s,a;return e=X.isValue(e)?"number"==typeof e?parseInt(e):0:METRO_WEEK_START,i=0<=(i=(n=new Date(this.getFullYear(),0,1)).getDay()-e)?i:i+7,s=Math.floor((this.getTime()-n.getTime()-6e4*(this.getTimezoneOffset()-n.getTimezoneOffset()))/864e5)+1,i<4?52<(a=Math.floor((s+i-1)/7)+1)&&(a=(t=0<=(t=new Date(this.getFullYear()+1,0,1).getDay()-e)?t:t+7)<4?1:53):a=Math.floor((s+i-1)/7),a},Date.prototype.getYear=function(){return this.getFullYear().toString().substr(-2)},Date.prototype.format=function(e,t){void 0===t&&(t="en-US");var n=(void 0!==S.locales&&void 0!==S.locales[t]?S.locales[t]:S.locales["en-US"]).calendar,i=this,s=i.getDay(),a=i.getDate(),o=i.getMonth(),r=i.getFullYear(),l=i.getHours(),c=n.days,d=n.months,h=[0,31,59,90,120,151,181,212,243,273,304,334],u=function(){var e=new Date(i);return e.setDate(a-(s+6)%7+3),e},p=function(e,t){return(""+(Math.pow(10,t)+e)).slice(1)};return e.replace(/(%[a-z])/gi,function(e){return{"%a":c[s].slice(0,3),"%A":c[s],"%b":d[o].slice(0,3),"%B":d[o],"%c":i.toUTCString(),"%C":Math.floor(r/100),"%d":p(a,2),dd:p(a,2),"%e":a,"%F":i.toISOString().slice(0,10),"%G":u().getFullYear(),"%g":(""+u().getFullYear()).slice(2),"%H":p(l,2),"%I":p((l+11)%12+1,2),"%j":p(h[o]+a+(1<o&&(r%4==0&&r%100!=0||r%400==0)?1:0),3),"%k":""+l,"%l":(l+11)%12+1,"%m":p(o+1,2),"%M":p(i.getMinutes(),2),"%p":l<12?"AM":"PM","%P":l<12?"am":"pm","%s":Math.round(i.getTime()/1e3),"%S":p(i.getSeconds(),2),"%u":s||7,"%V":function(){var e=u(),t=e.valueOf();e.setMonth(0,1);var n=e.getDay();return 4!==n&&e.setMonth(0,1+(4-n+7)%7),p(1+Math.ceil((t-e)/6048e5),2)}(),"%w":""+s,"%x":i.toLocaleDateString(),"%X":i.toLocaleTimeString(),"%y":(""+r).slice(2),"%Y":r,"%z":i.toTimeString().replace(/.+GMT([+-]\d+).+/,"$1"),"%Z":i.toTimeString().replace(/.+\((.+?)\)$/,"$1")}[e]||e})},Date.prototype.addHours=function(e){return this.setTime(this.getTime()+60*e*60*1e3),this},Date.prototype.addDays=function(e){return this.setDate(this.getDate()+e),this},Date.prototype.addMonths=function(e){return this.setMonth(this.getMonth()+e),this},Date.prototype.addYears=function(e){return this.setFullYear(this.getFullYear()+e),this};var b={specialKeys:{8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],textInputTypes:/textarea|input|select/i,options:{filterInputAcceptingElements:METRO_HOTKEYS_FILTER_INPUT_ACCEPTING_ELEMENTS,filterTextInputs:METRO_HOTKEYS_FILTER_TEXT_INPUTS,filterContentEditable:METRO_HOTKEYS_FILTER_CONTENT_EDITABLE},keyHandler:function(e){if("string"==typeof e.data&&(e.data={keys:e.data}),e.data&&e.data.keys&&"string"==typeof e.data.keys){var r=e.handler,l=e.data.keys.toLowerCase().split(" ");e.handler=function(n){if(this===n.target||!(b.options.filterInputAcceptingElements&&b.textInputTypes.test(n.target.nodeName)||b.options.filterContentEditable&&x(n.target).attr("contenteditable")||b.options.filterTextInputs&&-1<x.inArray(n.target.type,b.textAcceptingInputTypes))){var i="keypress"!==n.type&&b.specialKeys[n.which],e=String.fromCharCode(n.which).toLowerCase(),s="",t={};x.each(["alt","ctrl","shift"],function(e,t){n[t+"Key"]&&i!==t&&(s+=t+"+")}),n.metaKey&&!n.ctrlKey&&"meta"!==i&&(s+="meta+"),n.metaKey&&"meta"!==i&&-1<s.indexOf("alt+ctrl+shift+")&&(s=s.replace("alt+ctrl+shift+","hyper+")),i?t[s+i]=!0:(t[s+e]=!0,t[s+b.shiftNums[e]]=!0,"shift+"===s&&(t[b.shiftNums[e]]=!0));for(var a=0,o=l.length;a<o;a++)if(t[l[a]])return r.apply(this,arguments)}}}}};x.each(["keydown","keyup","keypress"],function(){x.event.special[this]={add:b.keyHandler}});var w={"en-US":{calendar:{months:["January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Su","Mo","Tu","We","Th","Fr","Sa","Sun","Mon","Tus","Wen","Thu","Fri","Sat"],time:{days:"DAYS",hours:"HOURS",minutes:"MINS",seconds:"SECS",month:"MON",day:"DAY",year:"YEAR"}},buttons:{ok:"OK",cancel:"Cancel",done:"Done",today:"Today",now:"Now",clear:"Clear",help:"Help",yes:"Yes",no:"No",random:"Random",save:"Save",reset:"Reset"}},"cn-ZH":{calendar:{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月","1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","日","一","二","三","四","五","六","周日","周一","周二","周三","周四","周五","周六"],time:{days:"天",hours:"时",minutes:"分",seconds:"秒",month:"月",day:"日",year:"年"}},buttons:{ok:"确认",cancel:"取消",done:"完成",today:"今天",now:"现在",clear:"清除",help:"帮助",yes:"是",no:"否",random:"随机",save:"保存",reset:"重啟"}},"de-DE":{calendar:{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember","Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sn","Mn","Di","Mi","Do","Fr","Sa","Son","Mon","Die","Mit","Don","Fre","Sam"],time:{days:"TAGE",hours:"UHR",minutes:"MIN",seconds:"SEK"}},buttons:{ok:"OK",cancel:"Abbrechen",done:"Fertig",today:"Heute",now:"Jetzt",clear:"Reinigen",help:"Hilfe",yes:"Ja",no:"Nein",random:"Zufällig",save:"Sparen",reset:"Zurücksetzen"}},"hu-HU":{calendar:{months:["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December","Jan","Feb","Már","Ápr","Máj","Jún","Júl","Aug","Szep","Okt","Nov","Dec"],days:["Vasárnap","Hétfő","Kedd","Szerda","Csütörtök","Péntek","Szombat","V","H","K","Sz","Cs","P","Sz","Vas","Hét","Ke","Sze","Csü","Pén","Szom"],time:{days:"NAP",hours:"ÓRA",minutes:"PERC",seconds:"MP"}},buttons:{ok:"OK",cancel:"Mégse",done:"Kész",today:"Ma",now:"Most",clear:"Törlés",help:"Segítség",yes:"Igen",no:"Nem",random:"Véletlen",save:"Mentés",reset:"Visszaállítás"}},"ru-RU":{calendar:{months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь","Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота","Вс","Пн","Вт","Ср","Чт","Пт","Сб","Вос","Пон","Вто","Сре","Чет","Пят","Суб"],time:{days:"ДНИ",hours:"ЧАСЫ",minutes:"МИН",seconds:"СЕК"}},buttons:{ok:"ОК",cancel:"Отмена",done:"Готово",today:"Сегодня",now:"Сейчас",clear:"Очистить",help:"Помощь",yes:"Да",no:"Нет",random:"Случайно",save:"Сохранить",reset:"Сброс"}},"uk-UA":{calendar:{months:["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень","Січ","Лют","Бер","Кві","Тра","Чер","Лип","Сер","Вер","Жов","Лис","Гру"],days:["Неділя","Понеділок","Вівторок","Середа","Четвер","П’ятниця","Субота","Нд","Пн","Вт","Ср","Чт","Пт","Сб","Нед","Пон","Вiв","Сер","Чет","Пят","Суб"],time:{days:"ДНІ",hours:"ГОД",minutes:"ХВИЛ",seconds:"СЕК"}},buttons:{ok:"ОК",cancel:"Відміна",done:"Готово",today:"Сьогодні",now:"Зараз",clear:"Очистити",help:"Допомога",yes:"Так",no:"Ні",random:"Випадково",save:"Зберегти",reset:"Скинути"}},"es-MX":{calendar:{months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre","Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Do","Lu","Ma","Mi","Ju","Vi","Sa","Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],time:{days:"DÍAS",hours:"HORAS",minutes:"MINS",seconds:"SEGS",month:"MES",day:"DÍA",year:"AÑO"}},buttons:{ok:"Aceptar",cancel:"Cancelar",done:"Hecho",today:"Hoy",now:"Ahora",clear:"Limpiar",help:"Ayuda",yes:"Si",no:"No",random:"Aleatorio",save:"Salvar",reset:"Reiniciar"}},"fr-FR":{calendar:{months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre","Janv","Févr","Mars","Avr","Mai","Juin","Juil","Août","Sept","Oct","Nov","Déc"],days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","De","Du","Ma","Me","Je","Ve","Sa","Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],time:{days:"JOURS",hours:"HEURES",minutes:"MINS",seconds:"SECS",month:"MOIS",day:"JOUR",year:"ANNEE"}},buttons:{ok:"OK",cancel:"Annulé",done:"Fait",today:"Aujourd'hui",now:"Maintenant",clear:"Effacé",help:"Aide",yes:"Oui",no:"Non",random:"Aléatoire",save:"Sauvegarder",reset:"Réinitialiser"}},"it-IT":{calendar:{months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre","Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato","Do","Lu","Ma","Me","Gi","Ve","Sa","Dom","Lun","Mar","Mer","Gio","Ven","Sab"],time:{days:"GIORNI",hours:"ORE",minutes:"MIN",seconds:"SEC",month:"MESE",day:"GIORNO",year:"ANNO"}},buttons:{ok:"OK",cancel:"Annulla",done:"Fatto",today:"Oggi",now:"Adesso",clear:"Cancella",help:"Aiuto",yes:"Sì",no:"No",random:"Random",save:"Salvare",reset:"Reset"}}};S.locales=w;var y=0;function T(e){return I(D(O(e),8*e.length))}function _(e){for(var t,n=y?"0123456789ABCDEF":"0123456789abcdef",i="",s=0;s<e.length;s++)t=e.charCodeAt(s),i+=n.charAt(t>>>4&15)+n.charAt(15&t);return i}function k(e){for(var t,n,i="",s=-1;++s<e.length;)t=e.charCodeAt(s),n=s+1<e.length?e.charCodeAt(s+1):0,55296<=t&&t<=56319&&56320<=n&&n<=57343&&(t=65536+((1023&t)<<10)+(1023&n),s++),t<=127?i+=String.fromCharCode(t):t<=2047?i+=String.fromCharCode(192|t>>>6&31,128|63&t):t<=65535?i+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(i+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return i}function O(e){var t,n=new Array(e.length>>2);for(t=0;t<n.length;t++)n[t]=0;for(t=0;t<8*e.length;t+=8)n[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return n}function I(e){for(var t="",n=0;n<32*e.length;n+=8)t+=String.fromCharCode(e[n>>5]>>>n%32&255);return t}function D(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var n=1732584193,i=-271733879,s=-1732584194,a=271733878,o=0;o<e.length;o+=16){var r=n,l=i,c=s,d=a;i=N(i=N(i=N(i=N(i=P(i=P(i=P(i=P(i=A(i=A(i=A(i=A(i=E(i=E(i=E(i=E(i,s=E(s,a=E(a,n=E(n,i,s,a,e[o],7,-680876936),i,s,e[o+1],12,-389564586),n,i,e[o+2],17,606105819),a,n,e[o+3],22,-1044525330),s=E(s,a=E(a,n=E(n,i,s,a,e[o+4],7,-176418897),i,s,e[o+5],12,1200080426),n,i,e[o+6],17,-1473231341),a,n,e[o+7],22,-45705983),s=E(s,a=E(a,n=E(n,i,s,a,e[o+8],7,1770035416),i,s,e[o+9],12,-1958414417),n,i,e[o+10],17,-42063),a,n,e[o+11],22,-1990404162),s=E(s,a=E(a,n=E(n,i,s,a,e[o+12],7,1804603682),i,s,e[o+13],12,-40341101),n,i,e[o+14],17,-1502002290),a,n,e[o+15],22,1236535329),s=A(s,a=A(a,n=A(n,i,s,a,e[o+1],5,-165796510),i,s,e[o+6],9,-1069501632),n,i,e[o+11],14,643717713),a,n,e[o],20,-373897302),s=A(s,a=A(a,n=A(n,i,s,a,e[o+5],5,-701558691),i,s,e[o+10],9,38016083),n,i,e[o+15],14,-660478335),a,n,e[o+4],20,-405537848),s=A(s,a=A(a,n=A(n,i,s,a,e[o+9],5,568446438),i,s,e[o+14],9,-1019803690),n,i,e[o+3],14,-187363961),a,n,e[o+8],20,1163531501),s=A(s,a=A(a,n=A(n,i,s,a,e[o+13],5,-1444681467),i,s,e[o+2],9,-51403784),n,i,e[o+7],14,1735328473),a,n,e[o+12],20,-1926607734),s=P(s,a=P(a,n=P(n,i,s,a,e[o+5],4,-378558),i,s,e[o+8],11,-2022574463),n,i,e[o+11],16,1839030562),a,n,e[o+14],23,-35309556),s=P(s,a=P(a,n=P(n,i,s,a,e[o+1],4,-1530992060),i,s,e[o+4],11,1272893353),n,i,e[o+7],16,-155497632),a,n,e[o+10],23,-1094730640),s=P(s,a=P(a,n=P(n,i,s,a,e[o+13],4,681279174),i,s,e[o],11,-358537222),n,i,e[o+3],16,-722521979),a,n,e[o+6],23,76029189),s=P(s,a=P(a,n=P(n,i,s,a,e[o+9],4,-640364487),i,s,e[o+12],11,-421815835),n,i,e[o+15],16,530742520),a,n,e[o+2],23,-995338651),s=N(s,a=N(a,n=N(n,i,s,a,e[o],6,-198630844),i,s,e[o+7],10,1126891415),n,i,e[o+14],15,-1416354905),a,n,e[o+5],21,-57434055),s=N(s,a=N(a,n=N(n,i,s,a,e[o+12],6,1700485571),i,s,e[o+3],10,-1894986606),n,i,e[o+10],15,-1051523),a,n,e[o+1],21,-2054922799),s=N(s,a=N(a,n=N(n,i,s,a,e[o+8],6,1873313359),i,s,e[o+15],10,-30611744),n,i,e[o+6],15,-1560198380),a,n,e[o+13],21,1309151649),s=N(s,a=N(a,n=N(n,i,s,a,e[o+4],6,-145523070),i,s,e[o+11],10,-1120210379),n,i,e[o+2],15,718787259),a,n,e[o+9],21,-343485551),n=R(n,r),i=R(i,l),s=R(s,c),a=R(a,d)}return[n,i,s,a]}function M(e,t,n,i,s,a){return R((o=R(R(t,e),R(i,a)))<<(r=s)|o>>>32-r,n);var o,r}function E(e,t,n,i,s,a,o){return M(t&n|~t&i,e,t,s,a,o)}function A(e,t,n,i,s,a,o){return M(t&i|n&~i,e,t,s,a,o)}function P(e,t,n,i,s,a,o){return M(t^n^i,e,t,s,a,o)}function N(e,t,n,i,s,a,o){return M(n^(t|~i),e,t,s,a,o)}function R(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}var F,L,H=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],V="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],B=Array.prototype.slice;if(x.event.fixHooks)for(var z=H.length;z;)x.event.fixHooks[H[--z]]=x.event.mouseHooks;function j(e){var t,n=e||window.event,i=B.call(arguments,1),s=0,a=0,o=0,r=0,l=0;if((e=x.event.fix(n)).type="mousewheel","detail"in n&&(o=-1*n.detail),"wheelDelta"in n&&(o=n.wheelDelta),"wheelDeltaY"in n&&(o=n.wheelDeltaY),"wheelDeltaX"in n&&(a=-1*n.wheelDeltaX),"axis"in n&&n.axis===n.HORIZONTAL_AXIS&&(a=-1*o,o=0),s=0===o?a:o,"deltaY"in n&&(s=o=-1*n.deltaY),"deltaX"in n&&(a=n.deltaX,0===o&&(s=-1*a)),0!==o||0!==a){if(1===n.deltaMode){var c=x.data(this,"mousewheel-line-height");s*=c,o*=c,a*=c}else if(2===n.deltaMode){var d=x.data(this,"mousewheel-page-height");s*=d,o*=d,a*=d}if(t=Math.max(Math.abs(o),Math.abs(a)),(!L||t<L)&&W(n,L=t)&&(L/=40),W(n,t)&&(s/=40,a/=40,o/=40),s=Math[1<=s?"floor":"ceil"](s/L),a=Math[1<=a?"floor":"ceil"](a/L),o=Math[1<=o?"floor":"ceil"](o/L),x.event.special.mousewheel.settings.normalizeOffset&&this.getBoundingClientRect){var h=this.getBoundingClientRect();r=e.clientX-h.left,l=e.clientY-h.top}return e.deltaX=a,e.deltaY=o,e.deltaFactor=L,e.offsetX=r,e.offsetY=l,e.deltaMode=0,i.unshift(e,s,a,o),F&&clearTimeout(F),F=setTimeout(U,200),(x.event.dispatch||x.event.handle).apply(this,i)}}function U(){L=null}function W(e,t){return x.event.special.mousewheel.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}x.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=V.length;e;)this.addEventListener(V[--e],j,!1);else this.onmousewheel=j;x.data(this,"mousewheel-line-height",x.event.special.mousewheel.getLineHeight(this)),x.data(this,"mousewheel-page-height",x.event.special.mousewheel.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=V.length;e;)this.removeEventListener(V[--e],j,!1);else this.onmousewheel=null;x.removeData(this,"mousewheel-line-height"),x.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var t=x(e),n=t["offsetParent"in x.fn?"offsetParent":"parent"]();return n.length||(n=x("body")),parseInt(n.css("fontSize"),10)||parseInt(t.css("fontSize"),10)||16},getPageHeight:function(e){return x(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}},x.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}});var Y=x.event.dispatch||x.event.handle,J=i.event.special,G="D"+ +new Date,K="D"+(+new Date+1);J.scrollstart={setup:function(e){var t,n=x.extend({latency:J.scrollstop.latency},e),i=function(e){t?(clearTimeout(t),t=null):(e.type="scrollstart",Y.apply(this,arguments)),t=setTimeout(function(){t=null},n.latency)};x(this).on("scroll",i).data(G,i)},teardown:function(){x(this).off("scroll",x(this).data(G))}},J.scrollstop={latency:250,setup:function(e){var i,s=x.extend({latency:J.scrollstop.latency},e),t=function(e){var t=this,n=arguments;i&&(clearTimeout(i),i=null),i=setTimeout(function(){i=null,e.type="scrollstop",Y.apply(t,n)},s.latency)};x(this).on("scroll",t).data(K,t)},teardown:function(){x(this).off("scroll",x(this).data(K))}};var q=function(e){return new q.init(e)};q.prototype={setKey:function(e){this.key=e},getKey:function(){return this.key},setItem:function(e,t){this.storage.setItem(this.key+":"+e,JSON.stringify(t))},getItem:function(e,t,n){var i,s;s=this.storage.getItem(this.key+":"+e);try{i=JSON.parse(s,n)}catch(e){i=null}return X.nvl(i,t)},getItemPart:function(e,t,n,i){var s,a=this.getItem(e,n,i);for(t=t.split("->"),s=0;s<t.length;s++)a=a[t[s]];return a},delItem:function(e){this.storage.removeItem(this.key+":"+e)},size:function(e){var t;switch(e){case"m":case"M":t=1048576;break;case"k":case"K":t=1024;break;default:t=1}return JSON.stringify(this.storage).length/t}},q.init=function(e){return this.key="",this.storage=e||window.localStorage,this},q.init.prototype=q.prototype,S.storage=q(window.localStorage),S.session=q(window.sessionStorage);S.template=function(e,t){for(var n,i,s=/<%(.+?)%>/g,a=/(^( )?(var|if|for|else|switch|case|break|{|}|;))(.*)?/g,o="with(obj) { var r=[];\n",r=0,l=function(e,t){return o+=t?e.match(a)?e+"\n":"r.push("+e+");\n":""!==e?'r.push("'+e.replace(/"/g,'\\"')+'");\n':"",l};i=s.exec(e);)l(e.slice(r,i.index))(i[1],!0),r=i.index+i[0].length;l(e.substr(r,e.length-r)),o=(o+'return r.join(""); }').replace(/[\r\t\n]/g," ");try{n=new Function("obj",o).apply(t,[t])}catch(e){console.error("'"+e.message+"'"," in \n\nCode:\n",o,"\n")}return n};var X={isUrl:function(e){return/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@\-\/]))?/.test(e)},isTag:function(e){return/^<\/?[\w\s="/.':;#-\/\?]+>/gi.test(e)},isColor:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)},isEmbedObject:function(n){var i=!1;return x.each(["iframe","object","embed","video"],function(e,t){"string"==typeof n&&n.toLowerCase()===t?i=!0:void 0!==n.nodeType&&n.tagName.toLowerCase()===t&&(i=!0)}),i},isVideoUrl:function(e){return/youtu\.be|youtube|vimeo/gi.test(e)},isDate:function(e,t){return!("object"!=typeof e||!X.isFunc(e