Bug 17178: Add virtual keyboard to advanced cataloguing editor
[koha.git] / koha-tmpl / intranet-tmpl / lib / keyboard / js / jquery.keyboard.extension-all.min.js
1 /*! jQuery UI Virtual Keyboard (1.29.1) - ALL Extensions + Mousewheel */
2 /*! jQuery UI Virtual Keyboard Alt Key Popup v2.0.0 */
3 !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(b){"use strict";var f=b.keyboard;b.extend(f.css,{altKeyPopup:"ui-keyboard-popup",altKeyOverlay:"ui-keyboard-overlay",altKeyPopupOpen:"ui-keyboard-popup-open"}),f.altKeys=b.extend({a:"å æ ā ă ą à á â ã ä",A:"Å Æ Ā Ă Ą À Á Â Ã Ä",c:"ç ć ĉ ċ č",C:"Ç Ć Ĉ Ċ Č",d:"ď ð ď",D:"Ď Ð Ď",e:"ė ę ĕ ě ə è é ê ë ē",E:"Ė Ę Ĕ Ě Ǝ È É Ê Ë Ē",g:"ģ ğ ĝ ġ",G:"Ģ Ğ Ĝ Ġ",h:"ĥ ħ",H:"Ĥ Ħ",i:"ı į ī ï î í ì ĩ ĭ",I:"İ Į Ī Ï Î Í Ì Ĩ Ĭ",j:"ĵ",J:"Ĵ",k:"ķ",K:"Ķ",l:"Ł Ľ Ļ Ĺ Ŀ",L:"ł ľ ļ ĺ ŀ",n:"ʼn ň ņ ń ñ",N:"ʼn Ň Ņ Ń Ñ",o:"œ ő ø ö õ ô ó ò ō ŏ",O:"Œ Ő Ø Ö Õ Ô Ó Ò Ō Ŏ",r:"ŕ ř ŗ",R:"Ŕ Ř Ŗ",s:"ś š ş ß § ŝ",S:"Ś Š Ş ẞ § Ŝ",t:"þ ť ț ţ ŧ",T:"Þ Ť Ț Ţ Ŧ",u:"ų ű ů ū ü û ú ù ũ ŭ",U:"Ų Ű Ů Ū Ü Û Ú Ù Ũ Ŭ",w:"ŵ",W:"Ŵ",y:"ý",Y:"Ý",z:"ź ż ž",Z:"Ź Ż Ž","!":"¡",$:"€ £ ¤ ¥ ¢ ₡ ₱ ₩ ₹ ₪ ₭ ₮ ₦ ₤","?":"¿","'":"〈 「 『 “",'"':"〉 」 』 ”","(":"《 【 〔",")":"》 】 〕"},f.altKeys),b.fn.addAltKeyPopup=function(e){var t={holdTime:500,popupVisible:"popup-visible",popupHidden:"popup-hidden",popupPosition:null};return this.each(function(){var y=b(this).data("keyboard");if(y){if(y.altkeypopup_options=b.extend({},t,y.altkeypopup_options,e),y.altkeypopup_namespace)return y.altkeypopup_setup();y.altkeypopup_namespace=y.namespace+"AltKeyPopup",y.extensionNamespace.push(y.altkeypopup_namespace),y.altkeypopup_setup=function(){var a,e="mousedown touchstart ".split(" ").join(y.altkeypopup_namespace+" "),t="mouseup touchend touchcancel ".split(" ").join(y.altkeypopup_namespace+" ");y.options.repeatRate=0,y.unbindButton(y.altkeypopup_namespace).bindButton(e,function(){clearTimeout(a);var e=b(this),t=e.attr("data-value")||"",o=y.altkeypopup_options.holdTime;t in f.altKeys&&(o?a=setTimeout(function(){y.altKeyPopup_popup(t,e)},o):y.altKeyPopup_popup(t,e))}).bindButton(t,function(){clearTimeout(a)}),y.altkeypopup_blockingFlag=!1,y.$preview.unbind("keypress keydown keyup ".split(" ").join(y.altkeypopup_namespace+" ").trim()).bind("keypress keydown keyup ".split(" ").join(y.altkeypopup_namespace+" "),function(e){if("keyup"===e.type)return clearTimeout(a),y.altkeypopup_blockingFlag=!1,"Escape"!==e.key;var t=f.builtLayouts[y.layout],o=b(e.target),n=e.key,i=e.key;return"keydown"===e.type&&i in f.altKeys?y.altkeypopup_blockingFlag!==n&&(y.altkeypopup_blockingFlag=n,!0):y.altkeypopup_blockingFlag?(t.hasMappedKeys&&t.mappedKeys.hasOwnProperty(i)&&(i=t.mappedKeys[i]),i in f.altKeys&&(clearTimeout(a),a=setTimeout(function(){y.altkeypopup_blockingFlag===n&&y.altKeyPopup_popup(i,o)},y.altkeypopup_options.holdTime)),!0):void 0})},y.altKeyPopup_close=function(){y.altkeypopup_blockingFlag=!1,y.altKeyPopup_$overlay=null,setTimeout(function(){if(y.$keyboard.length){y.$keyboard.removeClass(f.css.altKeyPopupOpen);var e=y.$keyboard.find("."+f.css.altKeyOverlay);e&&e.remove()}},1),b(document).unbind(y.altkeypopup_namespace),y.$preview.focus(),y.options.ignoreEsc=y.altKeyPopup_savedIgnoreEsc,y.$el.trigger(y.altkeypopup_options.popupHidden,[y])},y.altKeyPopup_popup=function(e,t){if(!y.$keyboard.find("."+f.css.altKeyOverlay).length){var o,n,i,a,s,r,p,u,l,d=f.css,c={$kb:y.$keyboard,kbWidth:y.$keyboard.outerWidth(),kbHeight:y.$keyboard.outerHeight(),$key:t};y.altKeyPopup_$overlay=b('<div class="'+d.altKeyOverlay+'" />').css({width:c.kbWidth,height:c.kbHeight}).appendTo(y.$keyboard).bind("click touchstart",function(){y.altKeyPopup_close()}),l="inactive hidden ".split(" ").join(y.altkeypopup_namespace+" "),y.$keyboard.addClass(f.css.altKeyPopupOpen),y.$el.unbind(l).bind(l,function(){y.altKeyPopup_close()}),"bksp"!==e&&f.keyaction.bksp(y),n=b('<div class="'+d.altKeyPopup+" "+y.options.css.container+'" />'),o=f.altKeys[e].split(/\s+/),y.buildRow(n,0,o,[]),i=n.appendTo(y.altKeyPopup_$overlay).children().bind("mousedown touchstart",function(){y.altKeyPopup_close()}).bind("mouseover mouseleave",function(e){i.removeClass(y.options.css.buttonHover),"mouseleave"!==e.type&&b(this).addClass(y.options.css.buttonHover)}),y.altKeyPopup_navigate(!0),y.altKeyPopup_savedIgnoreEsc=y.options.ignoreEsc,y.options.ignoreEsc=!0,b(document).unbind(y.altkeypopup_namespace).bind("keydown"+y.altkeypopup_namespace,function(){return!1}).bind("keyup"+y.altkeypopup_namespace,function(e){return"Escape"===e.key?(e.which=0,y.altKeyPopup_close()):y.altKeyPopup_navigate(e),!1}),p=(c.$popup=n).outerWidth(),(a=t.position().left-p/2)+p>c.kbWidth&&(a=c.kbWidth-p)<0&&n.css({width:c.kbWidth,height:"auto"}),s=t.position().top-t.outerHeight()-5,u=n.outerHeight(),r=y.$keyboard.find("."+d.keySet).position().top,s+u>c.kbHeight&&(s=c.kbHeight-u)<r&&n.css({height:c.popupHeight,width:"auto"}),c.popupWidth=n.outerWidth(),c.popupHeight=n.outerHeight(),c.popupLeft=a<0?0:a,c.popupTop=s<r?r:s,n.css({position:"absolute",left:c.popupLeft,top:c.popupTop}),"function"==typeof y.altkeypopup_options.popupPosition&&y.altkeypopup_options.popupPosition(y,c),y.$preview.blur(),y.$el.trigger(y.altkeypopup_options.popupVisible,[y])}},y.altKeyPopup_navigate=function(e){var t,o=f.css,n=(f.navigationKeys,y.options.css.buttonHover),i=y.$keyboard.find("."+o.altKeyPopup).find("."+o.keyButton),a=i.length-1;if(!0===e)return i.eq(0).addClass(n),void(y.altKeyPopup_currentIndex=0);if(t=y.altKeyPopup_currentIndex,"Enter"===e.key)return y.insertText(i.eq(t).attr("data-value")),y.altKeyPopup_close(),!0;switch(e.key){case"End":t=a;break;case"Home":t=0;break;case"ArrowLeft":t-=1;break;case"ArrowRight":t+=1}t<0&&(t=0),a<t&&(t=a),y.altKeyPopup_currentIndex=t,i.removeClass(n).eq(t).addClass(n)},y.options.alwaysOpen&&y.isVisible()&&y.altkeypopup_setup(),y.$el.unbind(f.events.kbBeforeVisible+y.altkeypopup_namespace).bind(f.events.kbBeforeVisible+y.altkeypopup_namespace,function(){y.altkeypopup_setup()})}})}}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(s){"use strict";s.fn.addAutocomplete=function(i){var a={position:{of:null,my:"right top",at:"left top",collision:"flip"},events:"autocomplete",data:""};return this.each(function(){var t,o,n=s(this).data("keyboard");n&&(o=n.namespace+"Autocomplete",n.autocomplete_namespace=o,n.extensionNamespace.push(o),n.autocomplete_init=function(){var e=(t=n.autocomplete_options=s.extend(!0,{},a,i)).events||t.data||"autocomplete";n.options.alwaysOpen&&n.isVisible()&&n.autocomplete_setup(),n.$el.unbind(o).bind(s.keyboard.events.kbVisible+o,function(){n.autocomplete_setup()}).bind(s.keyboard.events.kbHidden+o,function(){n.$el[t.data||"autocomplete"]("close")}).bind(s.keyboard.events.kbChange+o,function(){n.hasAutocomplete&&n.isVisible()&&n.$el.val(n.$preview.val())}).bind(e+"open"+o,function(){if(n.hasAutocomplete){var e=s.extend({},t.position);e.of=e.of||n.$keyboard,n.$autocomplete.menu.element.position(e)}}).bind(e+"select"+o,function(e,t){n.autocomplete_getVal(t.item)})},n.autocomplete_getVal=function(e){var t;switch(typeof e){case"string":t=e||"";break;case"object":t=e.label||e.value||"";break;default:t=n.preview&&n.preview.value||n.el.value}t=t.toString(),n.hasAutocomplete&&""!==t&&((n.$preview||n.$el).val(t).focus(),n.last.start=t.length,n.last.end=t.length,n.last.val=t)},n.autocomplete_update=function(e){clearTimeout(n.$autocomplete.searching),n.$autocomplete.searching=setTimeout(function(){n.$autocomplete.term!==n.$autocomplete.element.val()&&(n.$autocomplete.selectedItem=null,n.$autocomplete.search(null,e))},n.$autocomplete.options.delay)},n.autocomplete_navKeys={8:"backSpace",9:"tab",13:"enter",20:"capsLock",27:"escape",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"delete"},n.autocomplete_setup=function(){var t;if(n.$autocomplete=n.$el.data(n.autocomplete_options.data)||n.$el.data("uiAutocomplete")||n.$el.data("ui-autocomplete")||n.$el.data("autocomplete"),n.hasAutocomplete=void 0!==n.$autocomplete&&!n.$autocomplete.options.disabled,n.hasAutocomplete){n.$preview.bind("keydown"+o+" keypress"+o,function(e){n.$preview&&e.namespace!==n.$autocomplete.eventNamespace&&(e.namespace=n.$autocomplete.eventNamespace.slice(1),(t=n.autocomplete_navKeys[e.which])?n.el!==n.preview&&(n.$el.triggerHandler(e),"enter"===t&&setTimeout(function(){n.$autocomplete&&(n.$preview.val(n.$autocomplete.selectedItem.value),n.$preview.focus())},100)):n.autocomplete_update(e))});var e="mouseup mousedown mouseleave touchstart touchend touchcancel ".split(" ").join(o+" ");n.bindButton(e,function(e){n.autocomplete_update(e)})}n.escCloseCallback.autocomplete||(n.escCloseCallback.autocomplete=n.checkAutocompleteMenu)},n.checkAutocompleteMenu=function(e){return n.hasAutocomplete&&e.closest("ul").hasClass("ui-autocomplete")},n.autocomplete_destroy=function(){clearTimeout(n.$autocomplete.searching),n.hasAutocomplete=!1,n.$el.unbind(o),n.$preview&&(n.$preview.unbind(o),n.unbindButton(o)),delete n.$autocomplete},n.autocomplete_init())})}}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(b){"use strict";var f=b.keyboard;f.firefox=void 0!==window.mozInnerScreenX,b.extend(f.css,{caret:"ui-keyboard-caret",caretMirror:"ui-keyboard-mirror-div"}),b.fn.addCaret=function(e){var t={caretClass:"",charAttr:"data-character",charIndex:1,offsetX:0,offsetY:0,adjustHt:0};return this.each(function(){var c,n,i=f.events,y=b(this).data("keyboard");y&&(c=y.caret_options=b.extend({},t,e),n=y.caret_namespace=y.namespace+"caret",y.extensionNamespace.push(n),y.textareaCaretProperties=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],y.caret_setup=function(){var e=f.css,t="keyup keypress mouseup mouseleave ".split(" ").join(n+" "),o="position:absolute;visibility:hidden;top:-9999em;left:-9999em;white-space:pre-wrap;z-index:-10;"+("INPUT"===y.preview.nodeName?"":"word-wrap:break-word;");y.$keyboard.find("."+e.caretMirror).remove(),y.caret_$div=b('<div class="'+e.caretMirror+'" style="'+o+'">').appendTo(y.$keyboard),y.$caret&&y.$caret.remove(),y.$caret=b('<div class="'+e.caret+" "+c.caretClass+'" style="position:absolute;">').insertAfter(y.$preview),y.$el.unbind(i.kbChange+n).bind(i.kbChange+n,function(){y.findCaretPos()}),y.$preview.unbind(t).bind(t,function(){y.findCaretPos()})},y.findCaretPos=function(){if(y.caret_$div){var t,o,e,n,i,a,s,r,p=y.preview,u=parseFloat(y.$preview.css("fontSize")),l="INPUT"===p.nodeName,d=y.caret_$div[0];t=d.style,o=window.getComputedStyle?getComputedStyle(p,null):p.currentStyle,n=f.caret(y.$preview),i=Math["ltr"===o.direction?"max":"min"](n.start,n.end),y.textareaCaretProperties.forEach(function(e){t[e]=o[e]}),f.firefox&&(t.width=parseInt(o.width,10)-2+"px",p.scrollHeight>parseInt(o.height,10)&&(t.overflowY="scroll")),t.width=parseInt(l?p.scrollWidth:o.width,10)+(l?2*u:0)+"px",d.textContent=p.value.substring(0,i),"INPUT"===p.nodeName&&(d.textContent=d.textContent.replace(/\x20/g," ")),(s=document.createElement("span")).textContent=p.value.substring(i)||"​",d.appendChild(s),r=b(s).position(),n="center"===t.textAlign?u:0,y.caretPos={top:r.top+parseInt(o.borderTopWidth,10)+c.offsetY,left:r.left+parseInt(o.borderLeftWidth,10)+c.offsetX-n},e=parseInt(y.$caret.css("margin-top"),10),t=Math.round(u+2*e)+c.adjustHt,r=y.$preview.position(),y.$caret.css({top:r.top-p.scrollTop+y.caretPos.top-e,left:r.left-p.scrollLeft+y.caretPos.left,height:t}),a=p.value.substring(i,i+c.charIndex).replace(/\s/," ")||" ",y.$caret.attr(c.charAttr,a)}},y.$el.unbind(n).bind(i.kbBeforeVisible+n,function(){y.caret_setup()}).bind(i.kbVisible+n,function(){y.findCaretPos()}).bind(i.kbHidden+n,function(){var e="keyup keypress mouseup mouseleave ".split(" ").join(n+" ");y.$preview.unbind(e),y.$caret.remove(),y.$caret=null,y.caret_$div=null}),y.options.alwaysOpen&&y.isVisible()&&(y.caret_setup(),y.findCaretPos()))})}}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(n){"use strict";var i=n.keyboard;i.css.extender="ui-keyboard-extender",i.language.en.display.extender=" :toggle_numpad",i.layouts.numpad={normal:["{clear} / * -","7 8 9 +","4 5 6 %","1 2 3 =","0 {dec} {left} {right}"]},i.keyaction.extender=function(e){return e.extender_toggle(),!1},n.fn.addExtender=function(e){var t={layout:"numpad",showing:!1,reposition:!0};return this.each(function(){var o=n(this).data("keyboard");if(o){if(o.extender_options=n.extend({},t,o.extender_options,e),o.extender_namespace)return o.extender_layoutSwitcher();o.extender_namespace=o.namespace+"extender",o.extensionNamespace.push(o.extender_namespace),o.extender_layoutSwitcher=function(){o.extender_lastKeyset=o.last.keyset,o.extender_bindEvents(!1),o.$el.one(i.events.kbBeforeVisible,function(){o.shiftActive=o.extender_lastKeyset[0],o.altActive=o.extender_lastKeyset[1],o.metaActive=o.extender_lastKeyset[2],o.showKeySet(),o.extender_setup(),o.extender_bindEvents()}),o.redraw()},o.extender_bindEvents=function(e){var t=i.events.kbBeforeVisible+o.extender_namespace;o.$el.unbind(t),!1!==e&&o.$el.bind(t,function(){o.extender_setup()})},o.extender_setup=function(){var e,t=o.extender_options.layout;void 0===i.builtLayouts[t]&&o.buildKeyboard(t),(e=i.builtLayouts[t].$keyboard.find("."+i.css.keySet+"-normal").clone()).removeClass().removeAttr("name").addClass(i.css.extender).children("button").removeAttr("data-pos"),e[0].style.display=o.extender_options.showing?"inline-block":"none",o.$keyboard.find("div."+i.css.extender).remove(),o.$keyboard.append(e),o.extender_toggle(o.extender_options.showing),o.bindKeys()},o.extender_toggle=function(e){o.extender_options.showing=void 0===e?!o.extender_options.showing:e,o.$keyboard.find("button."+i.css.extender).toggleClass(o.options.css.buttonActive,o.extender_options.showing).end().find("div."+i.css.extender)[0].style.display=o.extender_options.showing?"inline-block":"none",o.extender_options.reposition&&n(window).trigger("resize")},o.options.alwaysOpen&&o.isVisible()&&o.extender_setup(),o.extender_bindEvents()}})}}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(s){s.fn.addMobile=function(e){var a,t={container:{theme:"b",cssClass:"ui-body"},input:{theme:"b",cssClass:""},buttonMarkup:{theme:"b",cssClass:"ui-btn",shadow:"true",corners:"true"},buttonHover:{theme:"b",cssClass:"ui-btn-hover"},buttonAction:{theme:"b",cssClass:"ui-btn-active"},buttonActive:{theme:"b",cssClass:"ui-btn-active"},allThemes:"a b c"};return this.each(function(){var i=s(this).data("keyboard");i&&void 0!==s.fn.textinput&&(i.mobile_options=a=s.extend(!0,{},t,e),i.mobile_themes=s.trim((" "+a.allThemes).split(" ").join(" "+a.buttonMarkup.cssClass+"-")+(" "+a.allThemes).split(" ").join(" "+a.buttonAction.cssClass+"-")+(" "+a.allThemes).split(" ").join(" "+a.buttonActive.cssClass+"-")),void 0===i.options.mobile_savedActiveClass&&(i.options.mobile_savedActiveClass=""+i.options.css.buttonActive),i.mobile_init=function(){var e=i.namespace+"Mobile";s("."+s.keyboard.css.input).textinput(),i.options.alwaysOpen&&i.isVisible&&i.mobile_setup(),i.extensionNamespace.push(e),i.$el.unbind(e).bind(s.keyboard.events.kbBeforeVisible+e,function(){i&&i.el.active&&i.$keyboard.length&&i.$keyboard.css("visibility","hidden")}).bind(s.keyboard.events.kbVisible+e,function(){i&&i.el.active&&i.$keyboard.length&&(i.mobile_setup(),i.$keyboard.css("visibility","visible"),i.$preview.focus())})},i.mobile_setup=function(){var e,t=s.keyboard.css,o=i.options,n=i.mobile_themes;i.mobile_$actionKeys=i.$keyboard.find("."+i.options.css.buttonAction),o.css.buttonActive=o.mobile_savedActiveClass+" "+i.modOptions(a.buttonActive,a.buttonMarkup),i.$keyboard.addClass(i.modOptions(a.container,a.container)).find("."+t.preview).removeClass("ui-widget ui-widget-content").addClass(i.modOptions(a.input,a.input)).end().find("button").removeClass(s.trim("ui-corner-all ui-state-default "+n)).addClass(i.modOptions(a.buttonMarkup,a.buttonMarkup)).not(i.mobile_$actionKeys).hover(function(){s(this).removeClass(n).addClass(i.modOptions(a.buttonHover,a.buttonMarkup))},function(){s(this).removeClass(n+" "+a.buttonHover.cssClass).addClass(i.modOptions(a.buttonMarkup,a.buttonMarkup))}),i.mobile_$actionKeys.removeClass(n).addClass(i.modOptions(a.buttonAction,a.buttonMarkup)),i.msie&&i.$preview[0]!==i.el&&(i.$preview.hide(),i.$keyboard.css("width",""),i.width=i.$keyboard.outerWidth(),i.$keyboard.width(i.width+parseInt(i.$preview.css("fontSize"),10)),i.$preview.width(i.width),i.$preview.show()),s.ui&&s.ui.position&&((e=o.position).of=e.of||i.$el.data("keyboardPosition")||i.$el,e.collision=e.collision||"flipfit flipfit",i.$keyboard.position(e))},i.modOptions=function(e,t){return" "+(e.cssClass||"")+" "+(t&&t.cssClass?t.cssClass+"-"+(e.theme||""):"")+("true"==e.shadow?" ui-shadow":"")+("true"==e.corners?" ui-corner-all":"")},i.mobile_init())})}}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(b){"use strict";b.keyboard=b.keyboard||{},b.keyboard.navigationKeys={toggle:112,enter:13,pageup:33,pagedown:34,end:35,home:36,left:37,up:38,right:39,down:40,caretrt:45,caretlt:46,caretright:function(e){b.keyboard.keyaction.right(e)},caretleft:function(e){b.keyboard.keyaction.left(e)}},b.fn.addNavigation=function(t){return this.each(function(){var l,e,d=b(this).data("keyboard"),c=d.options,n=b.keyboard.events,y=b.keyboard.css;d&&(d.navigation_options=l=b.extend({},{position:[0,0],toggleMode:!1,focusClass:"hasFocus",toggleKey:null,rowLooping:!1},t),d.navigation_keys=e=b.extend({},b.keyboard.navigationKeys),d.navigation_namespace=d.namespace+"Nav",d.extensionNamespace.push(d.navigation_namespace),d.saveNav=[d.options.tabNavigation,d.options.enterNavigation],d.allNavKeys=b.map(e,function(e){return e}),d.navigation_init=function(){d.$keyboard.toggleClass(l.focusClass,l.toggleMode).find("."+y.keySet+":visible").find("."+y.keyButton+'[data-pos="'+l.position[0]+","+l.position[1]+'"]').addClass(c.css.buttonHover),d.$preview.unbind(d.navigation_namespace).bind("keydown"+d.navigation_namespace,function(e){return d.checkKeys(e.which)})},d.checkKeys=function(e,t){if(void 0!==e&&d.isVisible()){var o=d.navigation_keys;return(e===(l.toggleKey||o.toggle)||t)&&(l.toggleMode=!t&&!l.toggleMode,d.options.tabNavigation=!l.toggleMode&&d.saveNav[0],d.options.enterNavigation=!l.toggleMode&&d.saveNav[1]),d.$keyboard.toggleClass(l.focusClass,l.toggleMode),l.toggleMode&&e===o.enter?(d.$keyboard.find("."+y.keySet+":visible").find("."+y.keyButton+'[data-pos="'+l.position[0]+","+l.position[1]+'"]').trigger(n.kbRepeater),!1):l.toggleMode&&0<=b.inArray(e,d.allNavKeys)?(d.navigateKeys(e),!1):void 0}},d.getMaxIndex=function(e,t){return e.find("."+y.keyButton+'[data-pos^="'+t+',"]').length-1},d.leftNavigateKey=function(e,t){var o=d.navigation_options.rowLooping,n=e-1;return 0<=n?n:o?t:0},d.rightNavigateKey=function(e,t){var o=d.navigation_options.rowLooping,n=e+1;return n<=t?n:o?0:t},d.navigateKeys=function(e,t,o){if(d.isVisible()){o="number"==typeof o?o:l.position[1],t="number"==typeof t?t:l.position[0];var n,i=d.$keyboard.find("."+y.keySet+":visible"),a=i.find("."+y.endRow).length-1,s=d.getMaxIndex(i,t),r=d.last,p=d.$preview.val().length,u=d.navigation_keys;switch(e){case u.pageup:t=0;break;case u.pagedown:t=a;break;case u.end:o=s;break;case u.home:o=0;break;case u.left:o=d.leftNavigateKey(o,s);break;case u.up:t+=0<t?-1:0,n=d.getMaxIndex(i,t),o=o===s?n:o;break;case u.right:o=d.rightNavigateKey(o,s);break;case u.down:t+=a<t+1?0:1,n=d.getMaxIndex(i,t),o=o===s?n:o;break;case u.caretrt:r.start++;break;case u.caretlt:r.start--}e!==u.caretrt&&e!==u.caretlt||(r.start=r.start<0?0:r.start>p?p:r.start,d.last.start=d.last.end=r.end=r.start,b.keyboard.caret(d.$preview,d.last)),(s=d.getMaxIndex(i,t))<o&&(o=s),i.find("."+c.css.buttonHover).removeClass(c.css.buttonHover),i.find("."+y.keyButton+'[data-pos="'+t+","+o+'"]').addClass(c.css.buttonHover),l.position=[t,o]}},d.options.alwaysOpen&&d.isVisible()&&(d.$keyboard.find("."+c.css.buttonHover).removeClass(c.css.buttonHover),d.navigation_init()),d.$el.unbind(d.navigation_namespace).bind(n.kbVisible,function(){d.$keyboard.find("."+c.css.buttonHover).removeClass(c.css.buttonHover),d.navigation_init()}).bind(n.kbInactive+" "+n.kbHidden,function(e){d.checkKeys(e.which,!0)}).bind(n.kbKeysetChange,function(){d.navigateKeys(null)}).bind("navigate navigateTo",function(e,t,o){var n;(t=isNaN(t)?t.toLowerCase():t)in d.navigation_keys?(n=d.navigation_keys[t],isNaN(n)&&n in b.keyboard.keyaction?b.keyboard.keyaction[n](d,this,e):"function"==typeof n?n(d):d.checkKeys(n)):"string"==typeof t&&t in b.keyboard.keyaction?b.keyboard.keyaction[t](d,this,e):d.navigateKeys(null,t,o)}))})}}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(p){"use strict";p.keyboard=p.keyboard||{},p.fn.previewKeyset=function(o){return this.each(function(){var e=p(this).data("keyboard"),t=e.namespace+"Preview";e&&(e.previewKeyset_options=p.extend({},{sets:["normal","shift","alt","alt-shift"]},o),e.extensionNamespace.push(t),e.previewKeyset=function(){var a=p.keyboard.css,s=e.previewKeyset_options.sets,r=e.$keyboard.find("."+a.keySet).filter('[name="'+s.join('"],[name="')+'"]');1<r.length&&r.eq(0).find("."+a.keyButton).not("."+a.keyAction).each(function(){var e,t,o={},n=s.length,i=r.find('button[data-pos="'+p(this).attr("data-pos")+'"]');for(e=0;e<n;e++)t=i.eq(e).parent().attr("name"),0<=p.inArray(t,s)&&(o["data-"+t]=i.eq(e).find("."+a.keyText).text());i.attr(o)})},e.options.alwaysOpen&&e.isVisible()?e.previewKeyset():e.$el.unbind(p.keyboard.events.kbBeforeVisible+t).bind(p.keyboard.events.kbBeforeVisible+t,function(){e.previewKeyset()}))})}}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(b){"use strict";b.keyboard=b.keyboard||{},b.fn.addScramble=function(e){var n={targetKeys:/[a-z\d]/i,byRow:!0,byKeySet:!1,randomizeOnce:!0,randomizeInput:!1,init:null,sameForAll:!1};return this.each(function(){var c,y=b(this).data("keyboard"),t=y.namespace+"Scramble",o=y.options;y&&!y.scramble_options&&(c=y.scramble_options=b.extend({},n,e),y.extensionNamespace.push(t),c.orig_create=o.create,y.scramble_setup=function(e){var t,o,n,i,a,s,r,p,u,l,d;if(t=e.find("."+b.keyboard.css.keySet),e.length){for(c.byKeySet&&(t=t.eq(0)),o=0;o<t.length;o++)if(n=t.eq(o),r=0,d=[],u=[],p=[],l=[],n.children("button, span, br").each(function(){"BR"===this.tagName?(c.byRow?(d.push(this),u.push(!1),l[r]=d,p[r]=u,d=[],u=[]):(l[r]=this,p[r]=!1),r++):(s=!(1!==(s=b(this).attr("data-value")||"").length||!c.targetKeys.test(s))&&s,c.byRow?(d.push(this),u.push(s)):(l[r]=this,p[r]=s,r++))}),n.find("."+b.keyboard.css.endRow).remove(),c.byRow)for(a=0;a<l.length;a++)for(d=y.shuffle(l[a],p[a]),i=0;i<d.length;i++)n.append(d[i]);else for(d=y.shuffle(l,p),i=0;i<d.length;i++)n.append(d[i]);return c.byKeySet&&(e=y.realign(e)),e}},y.getRandomUInt=function(e){var t=window.crypto||window.msCrypto;if(void 0===t)return Math.floor(Math.random()*e);var o=new Uint32Array(1);return t.getRandomValues(o),o[0]%e},y.shuffle=function(e,t){for(var o,n,i=e.length;0<i;)n=y.getRandomUInt(i),!1===t[i-1]&&i--,!1!==t[i-1]&&!1!==t[n]&&(o=e[--i],e[i]=e[n],e[n]=o);return e},y.realign=function(e){var o,n,i,a=e.find("."+b.keyboard.css.keySet),t=a.eq(0);return a=a.filter(":gt(0)"),t.children().each(function(e,t){n="BR"===t.tagName,i=b(t).attr("data-pos"),a.each(function(e,t){o=n?"br:first":'button[data-pos="'+i+'"]',b(t).find(o).appendTo(t)})}),e},y.setScrambleLayout=function(){if(!/^scrambled/.test(o.layout)){y.orig_layout=o.layout;var e=e||"scrambled"+Math.round(1e4*Math.random());o.layout=c.sameForAll?e:"scrambled"+Math.round(1e4*Math.random())}},o.create=function(){var e=o.layout;b.keyboard.builtLayouts[e]={mappedKeys:{},acceptedKeys:[],$keyboard:null},y.layout=o.layout=y.orig_layout,y.buildKeyboard(y.layout,!0),y.layout=o.layout=e,b.keyboard.builtLayouts[e]=b.extend(!0,{},b.keyboard.builtLayouts[y.orig_layout]),c.randomizeOnce&&(b.keyboard.builtLayouts[e].$keyboard=y.scramble_setup(b.keyboard.builtLayouts[y.orig_layout].$keyboard.clone())),y.$keyboard=b.keyboard.builtLayouts[e].$keyboard,c.randomizeInput?y.$el.unbind(b.keyboard.events.kbChange+t).bind(b.keyboard.events.kbChange+t,function(e,t){c.targetKeys.test(t.last.key)&&(t.$keyboard.find("."+o.css.buttonHover).removeClass(o.css.buttonHover),t.$keyboard=t.scramble_setup(t.$keyboard),b(document.elementFromPoint(e.clientX,e.clientY)).trigger("mouseenter"))}):c.randomizeOnce||y.$el.unbind(b.keyboard.events.kbBeforeVisible+t).bind(b.keyboard.events.kbBeforeVisible+t,function(e,t){t.$keyboard=t.scramble_setup(t.$keyboard)}),"function"==typeof c.orig_create&&c.orig_create(y)},y.setScrambleLayout(),o.alwaysOpen&&y.$keyboard.length?setTimeout(function(){var e=b.keyboard.builtLayouts;y.$keyboard=y.scramble_setup(y.$keyboard),y.setScrambleLayout(),void 0===e[o.layout]&&(e[o.layout]={mappedKeys:b.extend({},e[y.layout].mappedKeys),acceptedKeys:b.extend([],e[y.layout].acceptedKeys),$keyboard:y.$keyboard.clone()}),"function"==typeof c.init&&c.init(y)},0):"function"==typeof c.init&&c.init(y))})}}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(i){i.fn.addTyping=function(e){var t={showTyping:!0,lockTypeIn:!1,delay:250,hoverDelay:250},b=i.keyboard;return this.each(function(){var c,y=i(this).data("keyboard");y&&(c=y.typing_options=i.extend({},t,e),y.typing_keymap={" ":"space",'"':"34","'":"39","&nbsp;":"space","\b":"bksp","{b}":"bksp","{d}":"del","{l}":"left","{r}":"right","\n":"enter","\r":"enter","{e}":"enter","\t":"tab","{t}":"tab"},y.typing_xref={8:"bksp",9:"tab",13:"enter",32:"space",37:"left",39:"right",46:"del"},y.typing_event=!1,y.typing_namespace=y.namespace+"typing",y.extensionNamespace.push(y.typing_namespace),c.savedLockInput=y.options.lockInput,y.typing_setup_reset=function(){var e=b.events,t=y.typing_namespace,o=[e.kbHidden,e.kbInactive,""].join(t+" ");y.$el.unbind(t).bind(o,function(){y.typing_reset()}),y.unbindButton(t).bindButton("mousedown"+t,function(){y.typing_reset()})},y.typing_setup=function(){var e=y.typing_namespace;y.typing_setup_reset(),y.$el.bind(b.events.kbBeforeVisible+e,function(){y.typing_setup()}),y.$preview.unbind(e).bind("keyup"+e,function(e){return!(c.init&&c.lockTypeIn||!c.showTyping)&&(37<=e.which&&e.which<=40?void 0:(16===e.which&&(y.shiftActive=!1),18===e.which&&(y.altActive=!1),16===e.which||18===e.which?(y.showSet(),void setTimeout(function(){y.$preview&&y.$preview.focus()},200)):void 0))}).bind("keydown"+e,function(e){if(c.init&&c.lockTypeIn||!c.showTyping)return!1;e.temp=!1,16===e.which&&(e.temp=!y.shiftActive,y.shiftActive=!0),18===e.which&&(e.temp=!y.altActive,y.altActive=!0),e.temp&&(y.showSet(),y.$preview.focus()),y.typing_event=!0,y.typing_xref[e.which]&&y.typing_findKey("",e)}).bind("keypress"+e,function(e){if(c.init&&c.lockTypeIn)return!1;y.typing_event&&!y.options.lockInput&&(y.typing_reset(),y.typing_event=!0,y.typing_findKey("",e))})},y.typing_reset=function(){y.typing_event=c.init=!1,c.text="",c.len=c.current=0,y.options.lockInput=c.savedLockInput},y.typeIn=function(e,t,o,n){if(!y.isVisible())return clearTimeout(y.typing_timer),void y.typing_reset();if(y.typing_event){if(void 0===e)return y.typing_event=!1,void(y.options.lockInput=c.savedLockInput)}else!0!==c.init&&(c.init=!0,y.options.lockInput=c.lockTypeIn,c.text=e||c.text||"",c.len=c.text.length,c.delay=t||c.delay,c.current=0,o&&(c.callback=o)),"{"===(e=c.text.substring(c.current,++c.current))&&"}"===c.text.substring(c.current+1,c.current+2)&&(e+=c.text.substring(c.current,c.current+=2)),y.typing_findKey(e,n)},y.typing_findKey=function(e,t){var o,n,i,a,s,r,p,u,l=b.css,d=b.builtLayouts[y.layout].mappedKeys;if(y.isOpen&&y.$keyboard.length)if(r=y.$keyboard.find("."+l.keySet),a=e in y.typing_keymap?y.typing_keymap[e]:e,o="."+l.keyButton+'[data-action="'+a+'"]',y.typing_event&&t&&(o="keypress"!==t.type&&y.typing_xref.hasOwnProperty(t.keyCode||t.which)?"."+l.keyPrefix+y.processName(y.typing_xref[t.keyCode||t.which]):(n=String.fromCharCode(t.charCode||t.which),d.hasOwnProperty(n)?"."+l.keyButton+'[data-value="'+d[n].replace(/"/g,'\\"')+'"]':"."+l.keyPrefix+y.processName(n))),(s=r.filter(":visible").find(o)).length?y.typing_simulateKey(s,e,t):(u=(s=y.typing_event?r.find(o):(i=e in y.typing_keymap?y.typing_keymap[e]:y.processName(e),r.find("."+l.keyPrefix+i))).closest("."+l.keySet)).attr("name")?(c.showTyping&&(p=u.attr("name"),y.shiftActive=/shift/.test(p),y.altActive=/alt/.test(p),y.metaActive=y.last.keyset[2]=!!/\bmeta/.test(p)&&p.match(/meta[\w-]+/)[0],y.showSet(y.metaActive)),y.typing_simulateKey(s,e,t)):y.typing_event||(e in y.typing_keymap&&y.typing_keymap[e]in b.keyaction?b.keyaction[y.typing_keymap[e]](y,s,t):y.insertText(e),y.checkCombos(),y.$el.trigger(b.events.kbChange,[y,y.el])),c.current<=c.len&&0!==c.len){if(!y.isVisible())return;y.typing_timer=setTimeout(function(){y.typeIn()},c.delay)}else{if(0!==c.len)return y.typing_reset(),void("function"==typeof c.callback&&(y.typing_timer=setTimeout(function(){"function"==typeof c.callback&&c.callback(y)},c.delay)));y.typing_reset()}},y.typing_simulateKey=function(e,t,o){var n=e.length;y.isVisible()&&(c.showTyping&&n&&(e.filter(":visible").trigger("mouseenter"+y.namespace),c.showTyping&&n&&setTimeout(function(){e.trigger("mouseleave"+y.namespace)},Math.min(c.hoverDelay,c.delay))),y.typing_event||setTimeout(function(){t in y.typing_keymap&&y.typing_keymap[t]in b.keyaction?((o=o||i.Event("keypress")).target=e,b.keyaction[y.typing_keymap[t]](y,e,o)):y.insertText(t),y.checkCombos(),y.$el.trigger(b.events.kbChange,[y,y.el])},c.delay/3))},c.showTyping&&y.options.alwaysOpen&&y.isVisible()?y.typing_setup():y.$el.unbind(b.events.kbBeforeVisible+y.typing_namespace).bind(b.events.kbBeforeVisible+y.typing_namespace,function(){c.showTyping?y.typing_setup():y.typing_setup_reset()}))})}}),
4 /*! Mousewheel version: 3.1.12 * (c) 2014 Brandon Aaron * MIT License */
5 function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(c){var y,b,e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],t="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],f=Array.prototype.slice;if(c.event.fixHooks)for(var o=e.length;o;)c.event.fixHooks[e[--o]]=c.event.mouseHooks;var m=c.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=t.length;e;)this.addEventListener(t[--e],n,!1);else this.onmousewheel=n;c.data(this,"mousewheel-line-height",m.getLineHeight(this)),c.data(this,"mousewheel-page-height",m.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=t.length;e;)this.removeEventListener(t[--e],n,!1);else this.onmousewheel=null;c.removeData(this,"mousewheel-line-height"),c.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var t=c(e),o=t["offsetParent"in c.fn?"offsetParent":"parent"]();return o.length||(o=c("body")),parseInt(o.css("fontSize"),10)||parseInt(t.css("fontSize"),10)||16},getPageHeight:function(e){return c(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function n(e){var t,o=e||window.event,n=f.call(arguments,1),i=0,a=0,s=0,r=0,p=0;if((e=c.event.fix(o)).type="mousewheel","detail"in o&&(s=-1*o.detail),"wheelDelta"in o&&(s=o.wheelDelta),"wheelDeltaY"in o&&(s=o.wheelDeltaY),"wheelDeltaX"in o&&(a=-1*o.wheelDeltaX),"axis"in o&&o.axis===o.HORIZONTAL_AXIS&&(a=-1*s,s=0),i=0===s?a:s,"deltaY"in o&&(i=s=-1*o.deltaY),"deltaX"in o&&(a=o.deltaX,0===s&&(i=-1*a)),0!==s||0!==a){if(1===o.deltaMode){var u=c.data(this,"mousewheel-line-height");i*=u,s*=u,a*=u}else if(2===o.deltaMode){var l=c.data(this,"mousewheel-page-height");i*=l,s*=l,a*=l}if(t=Math.max(Math.abs(s),Math.abs(a)),(!b||t<b)&&v(o,b=t)&&(b/=40),v(o,t)&&(i/=40,a/=40,s/=40),i=Math[1<=i?"floor":"ceil"](i/b),a=Math[1<=a?"floor":"ceil"](a/b),s=Math[1<=s?"floor":"ceil"](s/b),m.settings.normalizeOffset&&this.getBoundingClientRect){var d=this.getBoundingClientRect();r=e.clientX-d.left,p=e.clientY-d.top}return e.deltaX=a,e.deltaY=s,e.deltaFactor=b,e.offsetX=r,e.offsetY=p,e.deltaMode=0,n.unshift(e,i,a,s),y&&clearTimeout(y),y=setTimeout(h,200),(c.event.dispatch||c.event.handle).apply(this,n)}}function h(){b=null}function v(e,t){return m.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}c.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})});