/**
* Kendo UI v2016.1.112 (http://www.telerik.com/kendo-ui)
* Copyright 2016 Telerik AD. All rights reserved.
*
* Kendo UI commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
* If you do not own a commercial license, this file shall be governed by the trial license terms.
*/
!function(e,define){define("kendo.selectable.min",["kendo.core.min","kendo.userevents.min"],e)}(function(){return function(e,t){function n(e,t){if(!e.is(":visible"))return!1;var n=l.getOffset(e),i=t.left+t.width,s=t.top+t.height;return n.right=n.left+e.outerWidth(),n.bottom=n.top+e.outerHeight(),!(n.left>i||t.left>n.right||n.top>s||t.top>n.bottom)}var i,l=window.kendo,s=l.ui.Widget,a=e.proxy,o=Math.abs,r="aria-selected",c="k-state-selected",u="k-state-selecting",d="k-selectable",f="change",v=".kendoSelectable",m="k-state-unselecting",h="input,a,textarea,.k-multiselect-wrap,select,button,a.k-button>.k-icon,button.k-button>.k-icon,span.k-icon.k-i-expand,span.k-icon.k-i-collapse",p=l.support.browser.msie,_=!1;!function(e){!function(){e('
').on("click",">*",function(){_=!0}).find("span").click().end().off()}()}(e),i=s.extend({init:function(t,n){var i,o=this;s.fn.init.call(o,t,n),o._marquee=e(""),o._lastActive=null,o.element.addClass(d),o.relatedTarget=o.options.relatedTarget,i=o.options.multiple,this.options.aria&&i&&o.element.attr("aria-multiselectable",!0),o.userEvents=new l.UserEvents(o.element,{global:!0,allowSelection:!0,filter:(_?"":"."+d+" ")+o.options.filter,tap:a(o._tap,o)}),i&&o.userEvents.bind("start",a(o._start,o)).bind("move",a(o._move,o)).bind("end",a(o._end,o)).bind("select",a(o._select,o))},events:[f],options:{name:"Selectable",filter:">*",multiple:!1,relatedTarget:e.noop},_isElement:function(e){var t,n=this.element,i=n.length,l=!1;for(e=e[0],t=0;i>t;t++)if(n[t]===e){l=!0;break}return l},_tap:function(t){var n,i=e(t.target),l=this,s=t.event.ctrlKey||t.event.metaKey,a=l.options.multiple,o=a&&t.event.shiftKey,r=t.event.which,u=t.event.button;!l._isElement(i.closest("."+d))||r&&3==r||u&&2==u||this._allowSelection(t.event.target)&&(n=i.hasClass(c),a&&s||l.clear(),i=i.add(l.relatedTarget(i)),o?l.selectRange(l._firstSelectee(),i):(n&&s?(l._unselect(i),l._notify(f)):l.value(i),l._lastActive=l._downTarget=i))},_start:function(n){var i,l=this,s=e(n.target),a=s.hasClass(c),o=n.event.ctrlKey||n.event.metaKey;if(this._allowSelection(n.event.target)){if(l._downTarget=s,!l._isElement(s.closest("."+d)))return l.userEvents.cancel(),t;l.options.useAllItems?l._items=l.element.find(l.options.filter):(i=s.closest(l.element),l._items=i.find(l.options.filter)),n.sender.capture(),l._marquee.appendTo(document.body).css({left:n.x.client+1,top:n.y.client+1,width:0,height:0}),o||l.clear(),s=s.add(l.relatedTarget(s)),a&&(l._selectElement(s,!0),o&&s.addClass(m))}},_move:function(e){var t=this,n={left:e.x.startLocation>e.x.location?e.x.location:e.x.startLocation,top:e.y.startLocation>e.y.location?e.y.location:e.y.startLocation,width:o(e.x.initialDelta),height:o(e.y.initialDelta)};t._marquee.css(n),t._invalidateSelectables(n,e.event.ctrlKey||e.event.metaKey),e.preventDefault()},_end:function(){var e,t=this;t._marquee.remove(),t._unselect(t.element.find(t.options.filter+"."+m)).removeClass(m),e=t.element.find(t.options.filter+"."+u),e=e.add(t.relatedTarget(e)),t.value(e),t._lastActive=t._downTarget,t._items=null},_invalidateSelectables:function(e,t){var i,l,s,a,o=this._downTarget[0],r=this._items;for(i=0,l=r.length;l>i;i++)a=r.eq(i),s=a.add(this.relatedTarget(a)),n(a,e)?a.hasClass(c)?t&&o!==a[0]&&s.removeClass(c).addClass(m):a.hasClass(u)||a.hasClass(m)||s.addClass(u):a.hasClass(u)?s.removeClass(u):t&&a.hasClass(m)&&s.removeClass(m).addClass(c)},value:function(e){var n=this,i=a(n._selectElement,n);return e?(e.each(function(){i(this)}),n._notify(f),t):n.element.find(n.options.filter+"."+c)},_firstSelectee:function(){var e,t=this;return null!==t._lastActive?t._lastActive:(e=t.value(),e.length>0?e[0]:t.element.find(t.options.filter)[0])},_selectElement:function(t,n){var i=e(t),l=!n&&this._notify("select",{element:t});i.removeClass(u),l||(i.addClass(c),this.options.aria&&i.attr(r,!0))},_notify:function(e,t){return t=t||{},this.trigger(e,t)},_unselect:function(e){return e.removeClass(c),this.options.aria&&e.attr(r,!1),e},_select:function(t){this._allowSelection(t.event.target)&&(!p||p&&!e(l._activeElement()).is(h))&&t.preventDefault()},_allowSelection:function(t){return e(t).is(h)?(this.userEvents.cancel(),this._downTarget=null,!1):!0},resetTouchEvents:function(){this.userEvents.cancel()},clear:function(){var e=this.element.find(this.options.filter+"."+c);this._unselect(e)},selectRange:function(t,n){var i,l,s,a=this;for(a.clear(),a.element.length>1&&(s=a.options.continuousItems()),s&&s.length||(s=a.element.find(a.options.filter)),t=e.inArray(e(t)[0],s),n=e.inArray(e(n)[0],s),t>n&&(l=t,t=n,n=l),a.options.useAllItems||(n+=a.element.length-1),i=t;n>=i;i++)a._selectElement(s[i]);a._notify(f)},destroy:function(){var e=this;s.fn.destroy.call(e),e.element.off(v),e.userEvents.destroy(),e._marquee=e._lastActive=e.element=e.userEvents=null}}),i.parseOptions=function(e){var t="string"==typeof e&&e.toLowerCase();return{multiple:t&&t.indexOf("multiple")>-1,cell:t&&t.indexOf("cell")>-1}},l.ui.plugin(i)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});
//# sourceMappingURL=kendo.selectable.min.js.map