/* * Kendo UI Beta v2013.2.716 (http://kendoui.com) * Copyright 2013 Telerik AD. All rights reserved. * * Kendo UI Beta license terms available at * http://www.kendoui.com/purchase/license-agreement/kendo-ui-beta.aspx */ ("function"==typeof define&&define.amd?define:function(e,o){return o()})(["./kendo.core.min"],function(){!function(e){function o(o,t){return o===t||e.contains(o,t)}var t=window.kendo,n=t.ui,i=n.Widget,s=t.support,r=t.getOffset,l=t._activeElement,a="open",p="close",d="deactivate",c="activate",f="center",u="left",m="right",g="top",h="bottom",w="absolute",v="hidden",_="body",k="location",y="position",b="visible",x="effects",z="k-state-active",T="k-state-border",P=/k-state-border-(\w+)/,C=".k-picker-wrap, .k-dropdown-wrap, .k-link",S="down",E=e(window),I=e(document.documentElement),W="resize scroll",H=s.transitions.css,O=H+"transform",N=e.extend,A=".kendoPopup",L=["font-family","font-size","font-stretch","font-style","font-weight","line-height"],F=i.extend({init:function(o,n){var s,r=this;n=n||{},n.isRtl&&(n.origin=n.origin||h+" "+m,n.position=n.position||g+" "+m),i.fn.init.call(r,o,n),o=r.element,n=r.options,r.collisions=n.collision?n.collision.split(" "):[],1===r.collisions.length&&r.collisions.push(r.collisions[0]),s=e(r.options.anchor).closest(".k-popup,.k-group").filter(":not([class^=km-])"),n.appendTo=e(e(n.appendTo)[0]||s[0]||_),r.element.hide().addClass("k-popup k-group k-reset").toggleClass("k-rtl",!!n.isRtl).css({position:w}).appendTo(n.appendTo).on("mouseenter"+A,function(){r._hovered=!0}).on("mouseleave"+A,function(){r._hovered=!1}),r.wrapper=e(),n.animation===!1&&(n.animation={open:{effects:{}},close:{hide:!0,effects:{}}}),N(n.animation.open,{complete:function(){r.wrapper.css({overflow:b}),r.trigger(c)}}),N(n.animation.close,{complete:function(){r.wrapper.hide();var i,s,l=r.wrapper.data(k),a=e(n.anchor);l&&r.wrapper.css(l),n.anchor!=_&&(i=(a[0].className.match(P)||["","down"])[1],s=T+"-"+i,a.removeClass(s).children(C).removeClass(z).removeClass(s),o.removeClass(T+"-"+t.directions[i].reverse)),r._closing=!1,r.trigger(d)}}),r._mousedownProxy=function(e){r._mousedown(e)},r._resizeProxy=function(e){r._resize(e)},n.toggleTarget&&e(n.toggleTarget).on(n.toggleEvent+A,e.proxy(r.toggle,r))},events:[a,c,p,d],options:{name:"Popup",toggleEvent:"click",origin:h+" "+u,position:g+" "+u,anchor:_,collision:"flip fit",viewport:window,copyAnchorStyles:!0,animation:{open:{effects:"slideIn:down",transition:!0,duration:200},close:{duration:100,hide:!0}}},destroy:function(){var o,n=this,s=n.options,r=n.element.off(A);i.fn.destroy.call(n),s.toggleTarget&&e(s.toggleTarget).off(A),I.unbind(S,n._mousedownProxy),E.unbind(W,n._resizeProxy),s.appendTo[0]===document.body&&(o=r.parent(".k-animation-container"),o[0]?o.remove():r.remove()),t.destroy(n.element.children())},open:function(o,n){var i,r,l,p=this,d={isFixed:!isNaN(parseInt(n,10)),x:o,y:n},c=p.element,f=p.options,u="down",m=e(f.anchor);if(!p.visible()){if(f.copyAnchorStyles&&c.css(t.getComputedStyles(m[0],L)),c.data("animating")||p.trigger(a))return;I.unbind(S,p._mousedownProxy).bind(S,p._mousedownProxy),s.mobileOS.ios||s.mobileOS.android||E.unbind(W,p._resizeProxy).bind(W,p._resizeProxy),p.wrapper=r=t.wrap(c).css({overflow:v,display:"block",position:w}),s.mobileOS.android&&r.add(m).css(O,"translatez(0)"),r.css(y),e(f.appendTo)[0]==document.body&&r.css(g,"-10000px"),i=N(!0,{},f.animation.open),p.flipped=p._position(d),i.effects=t.parseEffects(i.effects,p.flipped),u=i.effects.slideIn?i.effects.slideIn.direction:u,f.anchor!=_&&(l=T+"-"+u,c.addClass(T+"-"+t.directions[u].reverse),m.addClass(l).children(C).addClass(z).addClass(l)),c.data(x,i.effects).kendoStop(!0).kendoAnimate(i)}},toggle:function(){var e=this;e[e.visible()?p:a]()},visible:function(){return this.element.is(":"+b)},close:function(){var o,n,i,s,r=this,l=r.options;if(r.visible()){if(o=r.wrapper[0]?r.wrapper:t.wrap(r.element).hide(),r._closing||r.trigger(p))return;r.element.find(".k-popup").each(function(){var o=e(this),t=o.data("kendoPopup");t&&t.close()}),I.unbind(S,r._mousedownProxy),E.unbind(W,r._resizeProxy),n=N(!0,{},l.animation.close),i=r.element.data(x),s=n.effects,!s&&!t.size(s)&&i&&t.size(i)&&(n.effects=i,n.reverse=!0),r._closing=!0,r.element.kendoStop(!0),o.css({overflow:v}),r.element.kendoAnimate(n)}},_resize:function(e){var t=this;"resize"===e.type?(clearTimeout(t._resizeTimeout),t._resizeTimeout=setTimeout(function(){t._position(),t._resizeTimeout=null},50)):t._hovered||o(t.element[0],l())||t.close()},_mousedown:function(n){var i=this,s=i.element[0],r=i.options,l=e(r.anchor)[0],a=r.toggleTarget,p=t.eventTarget(n),d=e(p).closest(".k-popup"),c=d.parent().parent(".km-shim").length;d=d[0],(c||!d||d===i.element[0])&&(o(s,p)||o(l,p)||a&&o(e(a)[0],p)||i.close())},_fit:function(e,o,t){var n=0;return e+o>t&&(n=t-(e+o)),0>e&&(n=-e),n},_flip:function(e,o,t,n,i,s,r){var l=0;return r=r||o,s!==i&&s!==f&&i!==f&&(e+r>n&&(l+=-(t+o)),0>e+l&&(l+=t+o)),l},_position:function(o){var t,n,i,l,a,p,d,c,f,u=this,m=u.element.css(y,""),g=u.wrapper,h=u.options,v=e(h.viewport),_=e(v).offset(),b=e(h.anchor),x=h.origin.toLowerCase().split(" "),z=h.position.toLowerCase().split(" "),T=u.collisions,P=s.zoomLevel(),C=10002,S=0,E=b.parents().filter(g.siblings());if(E[0])if(n=Number(e(E).css("zIndex")))C=n+1;else for(t=b.parentsUntil(E),i=t.length;i>S;S++)n=Number(e(t[S]).css("zIndex")),n&&n>C&&(C=n+1);return g.css("zIndex",C),o&&o.isFixed?g.css({left:o.x,top:o.y}):g.css(u._align(x,z)),l=r(g,y,b[0]===g.offsetParent()[0]),a=r(g),p=b.offsetParent().parent(".k-animation-container,.k-popup,.k-group"),p.length&&(l=r(g,y,!0),a=r(g)),v[0]===window?(a.top-=window.pageYOffset||document.documentElement.scrollTop||0,a.left-=window.pageXOffset||document.documentElement.scrollLeft||0):(a.top-=_.top,a.left-=_.left),u.wrapper.data(k)||g.data(k,N({},l)),d=N({},a),c=N({},l),"fit"===T[0]&&(c.top+=u._fit(d.top,g.outerHeight(),v.height()/P)),"fit"===T[1]&&(c.left+=u._fit(d.left,g.outerWidth(),v.width()/P)),f=N({},c),"flip"===T[0]&&(c.top+=u._flip(d.top,m.outerHeight(),b.outerHeight(),v.height()/P,x[0],z[0],g.outerHeight())),"flip"===T[1]&&(c.left+=u._flip(d.left,m.outerWidth(),b.outerWidth(),v.width()/P,x[1],z[1],g.outerWidth())),m.css(y,w),g.css(c),c.left!=f.left||c.top!=f.top},_align:function(o,t){var n,i=this,s=i.wrapper,l=e(i.options.anchor),a=o[0],p=o[1],d=t[0],c=t[1],u=r(l),g=e(i.options.appendTo),w=s.outerWidth(),v=s.outerHeight(),_=l.outerWidth(),k=l.outerHeight(),y=u.top,b=u.left,x=Math.round;return g[0]!=document.body&&(n=r(g),y-=n.top,b-=n.left),a===h&&(y+=k),a===f&&(y+=x(k/2)),d===h&&(y-=v),d===f&&(y-=x(v/2)),p===m&&(b+=_),p===f&&(b+=x(_/2)),c===m&&(b-=w),c===f&&(b-=x(w/2)),{top:y,left:b}}});n.plugin(F)}(window.kendo.jQuery)});