/*
Copyright 2013, KISSY v1.42
MIT Licensed
build time: Dec 4 22:04
*/
KISSY.add("combobox/combobox-xtpl",[],function(){return function(f){var a,d=this;a=this.config.utils;var j=a.runBlockCommand,k=a.renderOutput,g=a.getProperty,h=a.runInlineCommand,e=a.getPropertyOrRunCommand;a='
\n\n';var b={},c=[],m=g(d,f,"hasTrigger",0,6);c.push(m);b.params=c;b.fn=function(b){var a;a='\n\n'};a+=j(d,f,b,"if",6);a+='\n\n\n\n \n\n\n \n
\n"}});
KISSY.add("combobox/render",["component/control","./combobox-xtpl"],function(f,a){var d=a("component/control"),j=a("./combobox-xtpl");return d.getDefaultRender().extend({beforeCreateDom:function(a,d){f.mix(d,{input:"#ks-combobox-input-{id}",trigger:"#ks-combobox-trigger-{id}",invalidEl:"#ks-combobox-invalid-el-{id}",placeholderEl:"#ks-combobox-placeholder-{id}"})},getKeyEventTarget:function(){return this.control.get("input")},_onSetCollapsed:function(a){this.control.get("input").attr("aria-expanded",
!a)},_onSetDisabled:function(a,d){this.callSuper(a,d);this.control.get("input").attr("disabled",a)}},{ATTRS:{contentTpl:{value:j}},HTML_PARSER:{value:function(a){return a.one("."+this.getBaseCssClass("input")).val()},input:function(a){return a.one("."+this.getBaseCssClass("input"))},trigger:function(a){return a.one("."+this.getBaseCssClass("trigger"))},invalidEl:function(a){return a.one("."+this.getBaseCssClass("invalid-el"))},placeholderEl:function(a){return a.one("."+this.getBaseCssClass("placeholder"))}}})});
KISSY.add("combobox/control",["node","component/control","./render","menu"],function(f,a){function d(a){for(var b=0;b',g,h="paddingLeft,paddingTop,paddingBottom,paddingRight,marginLeft,marginTop,marginBottom,marginRight,borderLeftStyle,borderTopStyle,borderBottomStyle,borderRightStyle,borderLeftWidth,borderTopWidth,borderBottomWidth,borderRightWidth,line-height,outline,height,fontFamily,fontSize,fontWeight,fontVariant,fontStyle".split(",");return function(a){var b=
j(a),a=b[0],c=a.ownerDocument,g=j(c),h=a.scrollTop,i=a.scrollLeft;if(c.selection)return a=c.selection.createRange(),{left:a.boundingLeft+i+g.scrollLeft(),top:a.boundingTop+h+a.boundingHeight+g.scrollTop()};g=b.offset();if("textarea"!==a.type)return g.top+=a.offsetHeight,g;c=d(b);b=a.selectionStart;c.html(f.escapeHtml(a.value.substring(0,b-1))+"x");c.offset(g);g=c.last();a=g.offset();a.top+=g.height();0\n\n';f={};k=[];k.push("component/extension/content-xtpl");f.params=k;g&&(a("component/extension/content-xtpl"),f.params[0]=g.resolveByName(f.params[0]));b=j(this,
b,f,"include",3);return d+=e(b,!1)}});KISSY.add("menu/check-menuitem-render",["./menuitem-render","component/extension/content-render","./check-menuitem-xtpl"],function(e,a){var b=a("./menuitem-render"),c=a("component/extension/content-render"),h=a("./check-menuitem-xtpl");return b.extend([c],{beforeCreateDom:function(a){a.checked&&a.elCls.push(this.getBaseCssClasses("checked"))},_onSetChecked:function(a){var b=this.getBaseCssClasses("checked");this.$el[a?"addClass":"removeClass"](b)}},{ATTRS:{contentTpl:{value:h}}})});
KISSY.add("menu/check-menuitem",["./menuitem","./check-menuitem-render"],function(e,a){var b=a("./menuitem"),c=a("./check-menuitem-render");return b.extend({handleClickInternal:function(){this.callSuper();this.set("checked",!this.get("checked"));this.fire("click");return!0}},{ATTRS:{checked:{view:1},xrender:{value:c}},xclass:"check-menuitem"})});
KISSY.add("menu/submenu-xtpl",[],function(){return function(e){var a;a=this.config.utils;var b=a.renderOutput,c=a.runInlineCommand,h=a.getPropertyOrRunCommand;a='';c=h(this,e,{},"content",0,2);a+=b(c,!1);a+='
\n\u25ba'}});
KISSY.add("menu/submenu-render",["./submenu-xtpl","./menuitem-render","component/extension/content-render"],function(e,a){var b=a("./submenu-xtpl"),c=a("./menuitem-render"),h=a("component/extension/content-render");return c.extend([h],{decorateDom:function(a){var b=this.control,c=b.get("prefixCls"),a=a.one("."+c+"popupmenu"),e=a[0].ownerDocument.body;e.insertBefore(a[0],e.firstChild);e=this.getComponentConstructorByNode(c,a);b.setInternal("menu",new e({srcNode:a,prefixCls:c}))}},{ATTRS:{contentTpl:{value:b}}})});
KISSY.add("menu/submenu",["node","./menuitem","./submenu-render"],function(e,a){function b(a){var b=a.target;b!==this&&b.isMenuItem&&a.newVal&&(this.clearHidePopupMenuTimers(),this.get("highlighted")||(this.set("highlighted",!0),b.set("highlighted",!1),b.set("highlighted",!0)))}function c(){var a=this.get("menu"),b={node:this.$el,points:["tr","tl"],overflow:{adjustX:1,adjustY:1}};e.mix(a.get("align"),b,!1);a.show();this.el.setAttribute("aria-haspopup",a.get("el").attr("id"))}function h(){this.get("menu").hide()}
var d=a("node"),g=a("./menuitem"),i=a("./submenu-render"),j=d.KeyCode;return g.extend({isSubMenu:1,clearShowPopupMenuTimers:function(){var a;if(a=this._showTimer)a.cancel(),this._showTimer=null},clearHidePopupMenuTimers:function(){var a;if(a=this._dismissTimer)a.cancel(),this._dismissTimer=null},clearSubMenuTimers:function(){this.clearHidePopupMenuTimers();this.clearShowPopupMenuTimers()},bindUI:function(){this.on("afterHighlightedChange",b,this)},handleMouseLeaveInternal:function(){this.set("highlighted",
!1,{data:{fromMouse:1}});this.clearSubMenuTimers();this.get("menu").get("visible")&&(this._dismissTimer=e.later(h,1E3*this.get("menuDelay"),!1,this))},handleMouseEnterInternal:function(){this.set("highlighted",!0,{data:{fromMouse:1}});this.clearSubMenuTimers();this.get("menu").get("visible")||(this._showTimer=e.later(c,1E3*this.get("menuDelay"),!1,this))},_onSetHighlighted:function(a,b){b&&(this.callSuper(b),b.fromMouse||(a&&!b.fromKeyboard?c.call(this):a||h.call(this)))},handleClickInternal:function(){c.call(this);
this.callSuper()},handleKeyDownInternal:function(a){var b=this.get("menu"),d,e=b.get("visible"),g=a.keyCode;if(e){if(!b.handleKeyDownInternal(a))if(g===j.LEFT)this.set("highlighted",!1),this.set("highlighted",!0,{data:{fromKeyboard:1}});else return}else if(g===j.RIGHT)c.call(this),a=b.get("children"),(d=a[0])&&d.set("highlighted",!0,{data:{fromKeyboard:1}});else{if(g===j.ENTER)return this.handleClickInternal(a);return}return!0},containsElement:function(a){return this.get("menu").containsElement(a)},
destructor:function(){var a=this.get("menu");this.clearSubMenuTimers();a.destroy()}},{ATTRS:{menuDelay:{value:0.15},menu:{value:{},getter:function(a){a.isControl||(a.xclass=a.xclass||"popupmenu",a=this.createComponent(a),this.setInternal("menu",a));return a},setter:function(a){a.isControl&&a.setInternal("parent",this)}},xrender:{value:i}},xclass:"submenu"})});
KISSY.add("menu/popupmenu-render",["component/extension/content-render","./menu-render"],function(e,a){var b=a("component/extension/content-render");return a("./menu-render").extend([b])});
KISSY.add("menu/popupmenu",["component/extension/align","component/extension/shim","./control","./popupmenu-render"],function(e,a){var b=a("component/extension/align"),c=a("component/extension/shim"),h=a("./control"),d=a("./popupmenu-render");return h.extend([c,b],{getRootMenu:function(){var a=this,b;do b=a,a=a.get("parent");while(a&&(a.isMenuItem||a.isMenu));return b===this?null:b},handleMouseLeaveInternal:function(a){this.callSuper(a);if(this.get("autoHideOnMouseLeave")){var b=this.getRootMenu();
b&&(clearTimeout(b._popupAutoHideTimer),b._popupAutoHideTimer=setTimeout(function(){var a;(a=b.get("highlightedItem"))&&a.set("highlighted",!1)},1E3*this.get("parent").get("menuDelay")))}},isPopupMenu:1,handleBlurInternal:function(a){this.callSuper(a);this.hide()}},{ATTRS:{focusable:{value:!1},autoHideOnMouseLeave:{},contentEl:{},visible:{value:!1},xrender:{value:d}},xclass:"popupmenu"})});
KISSY.add("menu",["menu/control","menu/menuitem","menu/check-menuitem","menu/submenu","menu/popupmenu"],function(e,a){var b=a("menu/control"),c=a("menu/menuitem"),h=a("menu/check-menuitem"),d=a("menu/submenu"),g=a("menu/popupmenu");b.Item=c;b.CheckItem=h;b.SubMenu=d;b.PopupMenu=g;return b});
/*
Copyright 2014, KISSY v1.42
MIT Licensed
build time: Feb 25 15:53
*/
KISSY.add("component/extension/delegate-children",["node","component/manager"],function(d,e){function h(a){a.target===this&&a.component.$el.addClass(this.__childClsTag)}function i(a){a.target===this&&(a=a.component.$el)&&a.removeClass(this.__childClsTag)}function f(){this.__childClsTag=d.guid("ks-component-child");this.on("afterRenderChild",h,this).on("afterRemoveChild",i,this)}var j=e("node"),k=e("component/manager"),g=d.UA.ieMode,c=j.Gesture;d.Features.isTouchEventSupported();d.augment(f,{handleChildrenEvents:function(a){if(!this.get("disabled")){var b=
this.getOwnerControl(a);if(b&&!b.get("disabled"))switch(a.stopPropagation(),a.type){case c.start:b.handleMouseDown(a);break;case c.end:b.handleMouseUp(a);break;case c.tap:b.handleClick(a);break;case "mouseenter":b.handleMouseEnter(a);break;case "mouseleave":b.handleMouseLeave(a);break;case "contextmenu":b.handleContextMenu(a);break;case "dblclick":b.handleDblClick(a);break;default:a.type+" unhandled!"}}},__bindUI:function(){var a=c.start+" "+c.end+" "+c.tap;c.cancel&&(a+=" "+c.cancel);a+=" mouseenter mouseleave contextmenu "+
(g&&9>g?"dblclick ":"");this.$el.delegate(a,"."+this.__childClsTag,this.handleChildrenEvents,this)},getOwnerControl:function(a){return k.getComponent(a.currentTarget.id)}});return f});