(function(e,m){function r(a){return a.id&&e('label[for="'+a.id+'"]').val()||a.name}function A(a,b,c){c||(c=0);b.each(function(){var b=e(this),h=this,j=this.nodeName.toLowerCase(),g,f;"label"==j&&b.find("input, textarea, select").length&&(g=b.text(),b=b.children().first(),h=b.get(0),j=h.nodeName.toLowerCase());switch(j){case "menu":f={name:b.attr("label"),items:{}};c=A(f.items,b.children(),c);break;case "a":case "button":f={name:b.text(),disabled:!!b.attr("disabled"),callback:function(){b.click()}};
break;case "menuitem":case "command":switch(b.attr("type")){case m:case "command":case "menuitem":f={name:b.attr("label"),disabled:!!b.attr("disabled"),callback:function(){b.click()}};break;case "checkbox":f={type:"checkbox",disabled:!!b.attr("disabled"),name:b.attr("label"),selected:!!b.attr("checked")};break;case "radio":f={type:"radio",disabled:!!b.attr("disabled"),name:b.attr("label"),radio:b.attr("radiogroup"),value:b.attr("id"),selected:!!b.attr("checked")};break;default:f=m}break;case "hr":f=
"-------";break;case "input":switch(b.attr("type")){case "text":f={type:"text",name:g||r(h),disabled:!!b.attr("disabled"),value:b.val()};break;case "checkbox":f={type:"checkbox",name:g||r(h),disabled:!!b.attr("disabled"),selected:!!b.attr("checked")};break;case "radio":f={type:"radio",name:g||r(h),disabled:!!b.attr("disabled"),radio:!!b.attr("name"),value:b.val(),selected:!!b.attr("checked")};break;default:f=m}break;case "select":f={type:"select",name:g||r(h),disabled:!!b.attr("disabled"),selected:b.val(),
options:{}};b.children().each(function(){f.options[this.value]=e(this).text()});break;case "textarea":f={type:"textarea",name:g||r(h),disabled:!!b.attr("disabled"),value:b.val()};break;case "label":break;default:f={type:"html",html:b.clone(!0)}}f&&(c++,a["key"+c]=f)});return c}e.support.htmlMenuitem="HTMLMenuItemElement"in window;e.support.htmlCommand="HTMLCommandElement"in window;e.support.eventSelectstart="onselectstart"in document.documentElement;if(!e.ui||!e.ui.widget){var C=e.cleanData;e.cleanData=
function(a){for(var b=0,c;null!=(c=a[b]);b++)try{e(c).triggerHandler("remove")}catch(d){}C(a)}}var k=null,u=!1,p=e(window),v=0,q={},l={},w={},x={selector:null,appendTo:null,trigger:"right",autoHide:!1,delay:200,reposition:!0,determinePosition:function(a){if(e.ui&&e.ui.position)a.css("display","block").position({my:"center top",at:"center bottom",of:this,offset:"0 5",collision:"fit"}).css("display","none");else{var b=this.offset();b.top+=this.outerHeight();b.left+=this.outerWidth()/2-a.outerWidth()/
2;a.css(b)}},position:function(a,b,c){if(!b&&!c)a.determinePosition.call(this,a.$menu);else{b="maintain"===b&&"maintain"===c?a.$menu.position():{top:c,left:b};c=p.scrollTop()+p.height();var d=p.scrollLeft()+p.width(),e=a.$menu.height(),f=a.$menu.width();b.top+e>c&&(b.top-=e);b.left+f>d&&(b.left-=f);a.$menu.css(b)}},positionSubmenu:function(a){if(e.ui&&e.ui.position)a.css("display","block").position({my:"left top",at:"right top",of:this,collision:"flipfit fit"}).css("display","");else{var b={top:0,
left:this.outerWidth()};a.css(b)}},zIndex:1,animation:{duration:50,show:"slideDown",hide:"slideUp"},events:{show:e.noop,hide:e.noop},callback:null,items:{}},s=null,y=null,z=null,B,f={abortevent:function(a){a.preventDefault();a.stopImmediatePropagation()},contextmenu:function(a){var b=e(this);a.preventDefault();a.stopImmediatePropagation();if(!("right"!=a.data.trigger&&a.originalEvent)&&!b.hasClass("context-menu-active")&&!b.hasClass("context-menu-disabled")){k=b;if(a.data.build){var c=a.data.build(k,
a);if(!1===c)return;a.data=e.extend(!0,{},x,a.data,c||{});if(!a.data.items||e.isEmptyObject(a.data.items))throw window.console&&(console.error||console.log)("No items specified to show in contextMenu"),Error("No Items sepcified");a.data.$trigger=k;n.create(a.data)}n.show.call(b,a.data,a.pageX,a.pageY)}},click:function(a){a.preventDefault();a.stopImmediatePropagation();e(this).trigger(e.Event("contextmenu",{data:a.data,pageX:a.pageX,pageY:a.pageY}))},mousedown:function(a){var b=e(this);k&&(k.length&&
!k.is(b))&&k.data("contextMenu").$menu.trigger("contextmenu:hide");2==a.button&&(k=b.data("contextMenuActive",!0))},mouseup:function(a){var b=e(this);b.data("contextMenuActive")&&(k&&k.length&&k.is(b)&&!b.hasClass("context-menu-disabled"))&&(a.preventDefault(),a.stopImmediatePropagation(),k=b,b.trigger(e.Event("contextmenu",{data:a.data,pageX:a.pageX,pageY:a.pageY})));b.removeData("contextMenuActive")},mouseenter:function(a){var b=e(this),c=e(a.relatedTarget),d=e(document);if(!c.is(".context-menu-list")&&
!c.closest(".context-menu-list").length&&(!k||!k.length))y=a.pageX,z=a.pageY,B=a.data,d.on("mousemove.contextMenuShow",f.mousemove),s=setTimeout(function(){s=null;d.off("mousemove.contextMenuShow");k=b;b.trigger(e.Event("contextmenu",{data:B,pageX:y,pageY:z}))},a.data.delay)},mousemove:function(a){y=a.pageX;z=a.pageY},mouseleave:function(a){a=e(a.relatedTarget);if(!a.is(".context-menu-list")&&!a.closest(".context-menu-list").length){try{clearTimeout(s)}catch(b){}s=null}},layerClick:function(a){var b=
e(this).data("contextMenuRoot"),c=a.button,d=a.pageX,f=a.pageY,j,g;a.preventDefault();a.stopImmediatePropagation();setTimeout(function(){var k,l="left"==b.trigger&&0===c||"right"==b.trigger&&2===c;document.elementFromPoint&&(b.$layer.hide(),j=document.elementFromPoint(d-p.scrollLeft(),f-p.scrollTop()),b.$layer.show());if(b.reposition&&l)if(document.elementFromPoint){if(b.$trigger.is(j)||b.$trigger.has(j).length){b.position.call(b.$trigger,b,d,f);return}}else if(g=b.$trigger.offset(),k=e(window),g.top+=
k.scrollTop(),g.top<=a.pageY&&(g.left+=k.scrollLeft(),g.left<=a.pageX&&(g.bottom=g.top+b.$trigger.outerHeight(),g.bottom>=a.pageY&&(g.right=g.left+b.$trigger.outerWidth(),g.right>=a.pageX)))){b.position.call(b.$trigger,b,d,f);return}if(j&&l)b.$trigger.one("contextmenu:hidden",function(){e(j).contextMenu({x:d,y:f})});b.$menu.trigger("contextmenu:hide")},50)},keyStop:function(a,b){b.isInput||a.preventDefault();a.stopPropagation()},key:function(a){var b=k.data("contextMenu")||{};switch(a.keyCode){case 9:case 38:if(f.keyStop(a,
b),b.isInput){if(9==a.keyCode&&a.shiftKey){a.preventDefault();b.$selected&&b.$selected.find("input, textarea, select").blur();b.$menu.trigger("prevcommand");return}if(38==a.keyCode&&"checkbox"==b.$selected.find("input, textarea, select").prop("type")){a.preventDefault();return}}else if(9!=a.keyCode||a.shiftKey){b.$menu.trigger("prevcommand");return}case 40:f.keyStop(a,b);if(b.isInput){if(9==a.keyCode){a.preventDefault();b.$selected&&b.$selected.find("input, textarea, select").blur();b.$menu.trigger("nextcommand");
return}if(40==a.keyCode&&"checkbox"==b.$selected.find("input, textarea, select").prop("type")){a.preventDefault();return}}else{b.$menu.trigger("nextcommand");return}break;case 37:f.keyStop(a,b);if(b.isInput||!b.$selected||!b.$selected.length)break;if(!b.$selected.parent().hasClass("context-menu-root")){a=b.$selected.parent().parent();b.$selected.trigger("contextmenu:blur");b.$selected=a;return}break;case 39:f.keyStop(a,b);if(b.isInput||!b.$selected||!b.$selected.length)break;var c=b.$selected.data("contextMenu")||
{};if(c.$menu&&b.$selected.hasClass("context-menu-submenu")){b.$selected=null;c.$selected=null;c.$menu.trigger("nextcommand");return}break;case 35:case 36:if(!b.$selected||!b.$selected.find("input, textarea, select").length)(b.$selected&&b.$selected.parent()||b.$menu).children(":not(.disabled, .not-selectable)")[36==a.keyCode?"first":"last"]().trigger("contextmenu:focus"),a.preventDefault();return;case 13:f.keyStop(a,b);if(b.isInput){if(b.$selected&&!b.$selected.is("textarea, select")){a.preventDefault();
return}break}b.$selected&&b.$selected.trigger("mouseup");return;case 32:case 33:case 34:f.keyStop(a,b);return;case 27:f.keyStop(a,b);b.$menu.trigger("contextmenu:hide");return;default:if(c=String.fromCharCode(a.keyCode).toUpperCase(),b.accesskeys[c]){b.accesskeys[c].$node.trigger(b.accesskeys[c].$menu?"contextmenu:focus":"mouseup");return}}a.stopPropagation();b.$selected&&b.$selected.trigger(a)},prevItem:function(a){a.stopPropagation();var b=e(this).data("contextMenu")||{};if(b.$selected){var c=b.$selected,
b=b.$selected.parent().data("contextMenu")||{};b.$selected=c}for(var c=b.$menu.children(),d=!b.$selected||!b.$selected.prev().length?c.last():b.$selected.prev(),h=d;d.hasClass("disabled")||d.hasClass("not-selectable");)if(d=d.prev().length?d.prev():c.last(),d.is(h))return;b.$selected&&f.itemMouseleave.call(b.$selected.get(0),a);f.itemMouseenter.call(d.get(0),a);a=d.find("input, textarea, select");a.length&&a.focus()},nextItem:function(a){a.stopPropagation();var b=e(this).data("contextMenu")||{};if(b.$selected){var c=
b.$selected,b=b.$selected.parent().data("contextMenu")||{};b.$selected=c}for(var c=b.$menu.children(),d=!b.$selected||!b.$selected.next().length?c.first():b.$selected.next(),h=d;d.hasClass("disabled")||d.hasClass("not-selectable");)if(d=d.next().length?d.next():c.first(),d.is(h))return;b.$selected&&f.itemMouseleave.call(b.$selected.get(0),a);f.itemMouseenter.call(d.get(0),a);a=d.find("input, textarea, select");a.length&&a.focus()},focusInput:function(){var a=e(this).closest(".context-menu-item"),
b=a.data(),c=b.contextMenu,b=b.contextMenuRoot;b.$selected=c.$selected=a;b.isInput=c.isInput=!0},blurInput:function(){var a=e(this).closest(".context-menu-item").data();a.contextMenuRoot.isInput=a.contextMenu.isInput=!1},menuMouseenter:function(){e(this).data().contextMenuRoot.hovering=!0},menuMouseleave:function(a){var b=e(this).data().contextMenuRoot;b.$layer&&b.$layer.is(a.relatedTarget)&&(b.hovering=!1)},itemMouseenter:function(a){var b=e(this),c=b.data(),d=c.contextMenu,c=c.contextMenuRoot;c.hovering=
!0;a&&(c.$layer&&c.$layer.is(a.relatedTarget))&&(a.preventDefault(),a.stopImmediatePropagation());(d.$menu?d:c).$menu.children(".hover").trigger("contextmenu:blur");b.hasClass("disabled")||b.hasClass("not-selectable")?d.$selected=null:b.trigger("contextmenu:focus")},itemMouseleave:function(a){var b=e(this),c=b.data(),d=c.contextMenu,c=c.contextMenuRoot;c!==d&&c.$layer&&c.$layer.is(a.relatedTarget)?(c.$selected&&c.$selected.trigger("contextmenu:blur"),a.preventDefault(),a.stopImmediatePropagation(),
c.$selected=d.$selected=d.$node):b.trigger("contextmenu:blur")},itemClick:function(a){var b=e(this),c=b.data(),d=c.contextMenuRoot,f=c.contextMenuKey;if(c.contextMenu.items[f]&&!b.is(".disabled, .context-menu-submenu, .context-menu-separator, .not-selectable")){a.preventDefault();a.stopImmediatePropagation();if(e.isFunction(d.callbacks[f])&&Object.prototype.hasOwnProperty.call(d.callbacks,f))a=d.callbacks[f];else if(e.isFunction(d.callback))a=d.callback;else return;!1!==a.call(d.$trigger,f,d)?d.$menu.trigger("contextmenu:hide"):
d.$menu.parent().length&&n.update.call(d.$trigger,d)}},inputClick:function(a){a.stopImmediatePropagation()},hideMenu:function(a,b){var c=e(this).data("contextMenuRoot");n.hide.call(c.$trigger,c,b&&b.force)},focusItem:function(a){a.stopPropagation();a=e(this);var b=a.data(),c=b.contextMenu,b=b.contextMenuRoot;a.addClass("hover").siblings(".hover").trigger("contextmenu:blur");c.$selected=b.$selected=a;c.$node&&b.positionSubmenu.call(c.$node,c.$menu)},blurItem:function(a){a.stopPropagation();a=e(this);
var b=a.data().contextMenu;a.removeClass("hover");b.$selected=null}},n={show:function(a,b,c){var d=e(this),h={};e("#context-menu-layer").trigger("mousedown");a.$trigger=d;if(!1===a.events.show.call(d,a))k=null;else{n.update.call(d,a);a.position.call(d,a,b,c);if(a.zIndex){b=0;for(c=d;!(b=Math.max(b,parseInt(c.css("z-index"),10)||0),c=c.parent(),!c||!c.length||-1<"html body".indexOf(c.prop("nodeName").toLowerCase())););h.zIndex=b+a.zIndex}n.layer.call(a.$menu,a,h.zIndex);a.$menu.find("ul").css("zIndex",
h.zIndex+1);a.$menu.css(h)[a.animation.show](a.animation.duration,function(){d.trigger("contextmenu:visible")});d.data("contextMenu",a).addClass("context-menu-active");e(document).off("keydown.contextMenu").on("keydown.contextMenu",f.key);if(a.autoHide)e(document).on("mousemove.contextMenuAutoHide",function(b){var c=d.offset();c.right=c.left+d.outerWidth();c.bottom=c.top+d.outerHeight();a.$layer&&(!a.hovering&&(!(b.pageX>=c.left&&b.pageX<=c.right)||!(b.pageY>=c.top&&b.pageY<=c.bottom)))&&a.$menu.trigger("contextmenu:hide")})}},
hide:function(a,b){var c=e(this);a||(a=c.data("contextMenu")||{});if(b||!(a.events&&!1===a.events.hide.call(c,a))){c.removeData("contextMenu").removeClass("context-menu-active");if(a.$layer){var d=a.$layer;setTimeout(function(){d.remove()},10);try{delete a.$layer}catch(f){a.$layer=null}}k=null;a.$menu.find(".hover").trigger("contextmenu:blur");a.$selected=null;e(document).off(".contextMenuAutoHide").off("keydown.contextMenu");a.$menu&&a.$menu[a.animation.hide](a.animation.duration,function(){a.build&&
(a.$menu.remove(),e.each(a,function(b){switch(b){case "ns":case "selector":case "build":case "trigger":return!0;default:a[b]=m;try{delete a[b]}catch(c){}return!0}}));setTimeout(function(){c.trigger("contextmenu:hidden")},10)})}},create:function(a,b){b===m&&(b=a);a.$menu=e('<ul class="context-menu-list"></ul>').addClass(a.className||"").data({contextMenu:a,contextMenuRoot:b});e.each(["callbacks","commands","inputs"],function(c,d){a[d]={};b[d]||(b[d]={})});b.accesskeys||(b.accesskeys={});e.each(a.items,
function(c,d){var h=e('<li class="context-menu-item"></li>').addClass(d.className||""),j=null,g=null;h.on("click",e.noop);d.$node=h.data({contextMenu:a,contextMenuRoot:b,contextMenuKey:c});if(d.accesskey){for(var k=d.accesskey.split(/\s+/),l=[],m=0,t;t=k[m];m++)t=t[0].toUpperCase(),l.push(t);for(k=0;m=l[k];k++)if(!b.accesskeys[m]){b.accesskeys[m]=d;d._name=d.name.replace(RegExp("("+m+")","i"),'<span class="context-menu-accesskey">$1</span>');break}}if("string"==typeof d)h.addClass("context-menu-separator not-selectable");
else if(d.type&&w[d.type])w[d.type].call(h,d,a,b),e.each([a,b],function(b,a){a.commands[c]=d;e.isFunction(d.callback)&&(a.callbacks[c]=d.callback)});else{"html"==d.type?h.addClass("context-menu-html not-selectable"):d.type?(j=e("<label></label>").appendTo(h),e("<span></span>").html(d._name||d.name).appendTo(j),h.addClass("context-menu-input"),a.hasTypes=!0,e.each([a,b],function(b,a){a.commands[c]=d;a.inputs[c]=d})):d.items&&(d.type="sub");switch(d.type){case "text":g=e('<input type="text" value="1" name="" value="">').attr("name",
"context-menu-input-"+c).val(d.value||"").appendTo(j);break;case "textarea":g=e('<textarea name=""></textarea>').attr("name","context-menu-input-"+c).val(d.value||"").appendTo(j);d.height&&g.height(d.height);break;case "checkbox":g=e('<input type="checkbox" value="1" name="" value="">').attr("name","context-menu-input-"+c).val(d.value||"").prop("checked",!!d.selected).prependTo(j);break;case "radio":g=e('<input type="radio" value="1" name="" value="">').attr("name","context-menu-input-"+d.radio).val(d.value||
"").prop("checked",!!d.selected).prependTo(j);break;case "select":g=e('<select name="">').attr("name","context-menu-input-"+c).appendTo(j);d.options&&(e.each(d.options,function(b,a){e("<option></option>").val(b).text(a).appendTo(g)}),g.val(d.selected));break;case "sub":e("<span></span>").html(d._name||d.name).appendTo(h);d.appendTo=d.$node;n.create(d,b);h.data("contextMenu",d).addClass("context-menu-submenu");d.callback=null;break;case "html":e(d.html).appendTo(h);break;default:e.each([a,b],function(b,
a){a.commands[c]=d;e.isFunction(d.callback)&&(a.callbacks[c]=d.callback)}),e("<span></span>").html(d._name||d.name||"").appendTo(h)}if(d.type&&("sub"!=d.type&&"html"!=d.type)&&(g.on("focus",f.focusInput).on("blur",f.blurInput),d.events))g.on(d.events,a);d.icon&&h.addClass("icon icon-"+d.icon)}d.$input=g;d.$label=j;h.appendTo(a.$menu);if(!a.hasTypes&&e.support.eventSelectstart)h.on("selectstart.disableTextSelect",f.abortevent)});a.$node||a.$menu.css("display","none").addClass("context-menu-root");
a.$menu.appendTo(a.appendTo||document.body)},resize:function(a,b){a.css({position:"absolute",display:"block"});a.data("width",Math.ceil(a.width())+1);a.css({position:"static",minWidth:"0px",maxWidth:"100000px"});a.find("> li > ul").each(function(){n.resize(e(this),!0)});b||a.find("ul").andSelf().css({position:"",display:"",minWidth:"",maxWidth:""}).width(function(){return e(this).data("width")})},update:function(a,b){var c=this;b===m&&(b=a,n.resize(a.$menu));a.$menu.children().each(function(){var d=
e(this),f=d.data("contextMenuKey"),j=a.items[f],f=e.isFunction(j.disabled)&&j.disabled.call(c,f,b)||!0===j.disabled;d[f?"addClass":"removeClass"]("disabled");if(j.type)switch(d.find("input, select, textarea").prop("disabled",f),j.type){case "text":case "textarea":j.$input.val(j.value||"");break;case "checkbox":case "radio":j.$input.val(j.value||"").prop("checked",!!j.selected);break;case "select":j.$input.val(j.selected||"")}j.$menu&&n.update.call(c,j,b)})},layer:function(a,b){var c=a.$layer=e('<div id="context-menu-layer" style="position:fixed; z-index:'+
b+'; top:0; left:0; opacity: 0; filter: alpha(opacity=0); background-color: #000;"></div>').css({height:p.height(),width:p.width(),display:"block"}).data("contextMenuRoot",a).insertBefore(this).on("contextmenu",f.abortevent).on("mousedown",f.layerClick);e.support.fixedPosition||c.css({position:"absolute",height:e(document).height()});return c}};e.fn.contextMenu=function(a){a===m?this.first().trigger("contextmenu"):a.x&&a.y?this.first().trigger(e.Event("contextmenu",{pageX:a.x,pageY:a.y})):"hide"===
a?(a=this.data("contextMenu").$menu)&&a.trigger("contextmenu:hide"):"destroy"===a?e.contextMenu("destroy",{context:this}):e.isPlainObject(a)?(a.context=this,e.contextMenu("create",a)):a?this.removeClass("context-menu-disabled"):a||this.addClass("context-menu-disabled");return this};e.contextMenu=function(a,b){"string"!=typeof a&&(b=a,a="create");"string"==typeof b?b={selector:b}:b===m&&(b={});var c=e.extend(!0,{},x,b||{}),d=e(document),h=d,j=!1;!c.context||!c.context.length?c.context=document:(h=
e(c.context).first(),c.context=h.get(0),j=c.context!==document);switch(a){case "create":if(!c.selector)throw Error("No selector specified");if(c.selector.match(/.context-menu-(list|item|input)($|\s)/))throw Error('Cannot bind to selector "'+c.selector+'" as it contains a reserved className');if(!c.build&&(!c.items||e.isEmptyObject(c.items)))throw Error("No Items sepcified");v++;c.ns=".contextMenu"+v;j||(q[c.selector]=c.ns);l[c.ns]=c;c.trigger||(c.trigger="right");u||(d.on({"contextmenu:hide.contextMenu":f.hideMenu,
"prevcommand.contextMenu":f.prevItem,"nextcommand.contextMenu":f.nextItem,"contextmenu.contextMenu":f.abortevent,"mouseenter.contextMenu":f.menuMouseenter,"mouseleave.contextMenu":f.menuMouseleave},".context-menu-list").on("mouseup.contextMenu",".context-menu-input",f.inputClick).on({"mouseup.contextMenu":f.itemClick,"contextmenu:focus.contextMenu":f.focusItem,"contextmenu:blur.contextMenu":f.blurItem,"contextmenu.contextMenu":f.abortevent,"mouseenter.contextMenu":f.itemMouseenter,"mouseleave.contextMenu":f.itemMouseleave},
".context-menu-item"),u=!0);h.on("contextmenu"+c.ns,c.selector,c,f.contextmenu);if(j)h.on("remove"+c.ns,function(){e(this).contextMenu("destroy")});switch(c.trigger){case "hover":h.on("mouseenter"+c.ns,c.selector,c,f.mouseenter).on("mouseleave"+c.ns,c.selector,c,f.mouseleave);break;case "left":h.on("click"+c.ns,c.selector,c,f.click)}c.build||n.create(c);break;case "destroy":var g;if(j){var k=c.context;e.each(l,function(b,a){if(a.context!==k)return!0;g=e(".context-menu-list").filter(":visible");g.length&&
g.data().contextMenuRoot.$trigger.is(e(a.context).find(a.selector))&&g.trigger("contextmenu:hide",{force:!0});try{l[a.ns].$menu&&l[a.ns].$menu.remove(),delete l[a.ns]}catch(c){l[a.ns]=null}e(a.context).off(a.ns);return!0})}else if(c.selector){if(q[c.selector]){g=e(".context-menu-list").filter(":visible");g.length&&g.data().contextMenuRoot.$trigger.is(c.selector)&&g.trigger("contextmenu:hide",{force:!0});try{l[q[c.selector]].$menu&&l[q[c.selector]].$menu.remove(),delete l[q[c.selector]]}catch(p){l[q[c.selector]]=
null}d.off(q[c.selector])}}else d.off(".contextMenu .contextMenuAutoHide"),e.each(l,function(a,b){e(b.context).off(b.ns)}),q={},l={},v=0,u=!1,e("#context-menu-layer, .context-menu-list").remove();break;case "html5":(!e.support.htmlCommand&&!e.support.htmlMenuitem||"boolean"==typeof b&&b)&&e('menu[type="context"]').each(function(){this.id&&e.contextMenu({selector:"[contextmenu="+this.id+"]",items:e.contextMenu.fromMenu(this)})}).css("display","none");break;default:throw Error('Unknown operation "'+
a+'"');}return this};e.contextMenu.setInputValues=function(a,b){b===m&&(b={});e.each(a.inputs,function(a,d){switch(d.type){case "text":case "textarea":d.value=b[a]||"";break;case "checkbox":d.selected=b[a]?!0:!1;break;case "radio":d.selected=(b[d.radio]||"")==d.value?!0:!1;break;case "select":d.selected=b[a]||""}})};e.contextMenu.getInputValues=function(a,b){b===m&&(b={});e.each(a.inputs,function(a,d){switch(d.type){case "text":case "textarea":case "select":b[a]=d.$input.val();break;case "checkbox":b[a]=
d.$input.prop("checked");break;case "radio":d.$input.prop("checked")&&(b[d.radio]=d.value)}});return b};e.contextMenu.fromMenu=function(a){a=e(a);var b={};A(b,a.children());return b};e.contextMenu.defaults=x;e.contextMenu.types=w;e.contextMenu.handle=f;e.contextMenu.op=n;e.contextMenu.menus=l})(jQuery);