text: /**
   * Copyright 2014 Telerik AD
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  /**
   * Copyright 2014 Telerik AD
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  !function(e,define){define(["./kendo.data.min","./kendo.popup.min"],e)}(function(){return function(e,t){function n(t,i){t.filters&&(t.filters=e.grep(t.filters,function(e){return n(e,i),e.filters?e.filters.length:e.field!=i}))}var i=window.kendo,r=i.ui,a=r.Widget,o=i.keys,s=i.support,l=i.htmlEncode,u=i._activeElement,c="id",d="li",f="change",h="k-state-focused",p="k-state-hover",g="k-loading",m="open",v="close",_="select",y="selected",b="progress",w="requestEnd",x="width",k=e.extend,C=e.proxy,S=s.browser,F=S.msie&&9>S.version,T=/"/g,D={ComboBox:"DropDownList",DropDownList:"ComboBox"},M=a.extend({init:function(t,n){var i,r=this,o=r.ns;a.fn.init.call(r,t,n),t=r.element,r._isSelect=t.is(_),r._template(),r.ul=e('<ul unselectable="on" class="k-list k-reset"/>').css({overflow:s.kineticScrollNeeded?"":"auto"}).on("mouseenter"+o,d,function(){e(this).addClass(p)}).on("mouseleave"+o,d,function(){e(this).removeClass(p)}).on("click"+o,d,C(r._click,r)).attr({tabIndex:-1,role:"listbox","aria-hidden":!0}),r.list=e("<div class='k-list-container'/>").append(r.ul).on("mousedown"+o,function(e){e.preventDefault()}),i=t.attr(c),i&&(r.list.attr(c,i+"-list"),r.ul.attr(c,i+"_listbox"),r._optionID=i+"_option_selected"),r._header(),r._accessors(),r._initValue()},options:{valuePrimitive:!1,headerTemplate:""},setOptions:function(e){a.fn.setOptions.call(this,e),e&&e.enable!==t&&(e.enabled=e.enable)},focus:function(){this._focused.focus()},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},_filterSource:function(e){var t=this,i=t.options,r=t.dataSource,a=r.filter()||{};n(a,i.dataTextField),e&&(a=a.filters||[],a.push(e)),r.filter(a)},_header:function(){var t,n=this.options.headerTemplate;e.isFunction(n)&&(n=n({})),n&&(this.list.prepend(n),t=this.ul.prev(),this.header=t[0]?t:null)},_initValue:function(){var e=this,t=e.options.value;null!==t?e.element.val(t):(t=e._accessor(),e.options.value=t),e._old=t},_ignoreCase:function(){var e,t=this,n=t.dataSource.reader.model;n&&n.fields&&(e=n.fields[t.options.dataTextField],e&&e.type&&"string"!==e.type&&(t.options.ignoreCase=!1))},items:function(){return this.ul[0].children},current:function(e){var n=this,i=n._optionID;return e===t?n._current:(n._current&&(n._current.removeClass(h).removeAttr("aria-selected").removeAttr(c),n._focused.removeAttr("aria-activedescendant")),e&&(e.addClass(h),n._scroll(e),i&&(e.attr("id",i),n._focused.attr("aria-activedescendant",i))),n._current=e,t)},destroy:function(){var e=this,t=e.ns;a.fn.destroy.call(e),e._unbindDataSource(),e.ul.off(t),e.list.off(t),e._touchScroller&&e._touchScroller.destroy(),e.popup.destroy(),e._form&&e._form.off("reset",e._resetHandler)},dataItem:function(e){var n=this;return e===t&&(e=n.selectedIndex),n._data()[e]},_accessors:function(){var e=this,t=e.element,n=e.options,r=i.getter,a=t.attr(i.attr("text-field")),o=t.attr(i.attr("value-field"));a&&(n.dataTextField=a),o&&(n.dataValueField=o),e._text=r(n.dataTextField),e._value=r(n.dataValueField)},_aria:function(e){var n=this,i=n.options,r=n._focused;i.suggest!==t&&r.attr("aria-autocomplete",i.suggest?"both":"list"),e=e?e+" "+n.ul[0].id:n.ul[0].id,r.attr("aria-owns",e),n.ul.attr("aria-live",i.filter&&"none"!==i.filter?"polite":"off")},_blur:function(){var e=this;e._change(),e.close()},_change:function(){var e,n=this,i=n.selectedIndex,r=n.options.value,a=n.value();n._isSelect&&!n._bound&&r&&(a=r),a!==n._old?e=!0:i!==t&&i!==n._oldIndex&&(e=!0),e&&(n._old=a,n._oldIndex=i,n.trigger(f),n.element.trigger(f))},_click:function(t){t.isDefaultPrevented()||this._accept(e(t.currentTarget))},_data:function(){return this.dataSource.view()},_enable:function(){var e=this,n=e.options,i=e.element.is("[disabled]");n.enable!==t&&(n.enabled=n.enable),!n.enabled||i?e.enable(!1):e.readonly(e.element.is("[readonly]"))},_focus:function(e){var n=this,i=!0;return n.popup.visible()&&e&&n.trigger(_,{item:e})?(n.close(),t):(n._select(e),n._triggerCascade(i),n._blur(),t)},_index:function(e){var t,n,i=this,r=i._data();for(t=0,n=r.length;n>t;t++)if(i._dataValue(r[t])==e)return t;return-1},_dataValue:function(e){var n=this._value(e);return n===t&&(n=this._text(e)),n},_height:function(e){if(e){var t,n=this,i=n.list,r=n.popup.visible(),a=n.options.height,o=n.header;t=i.add(i.parent(".k-animation-container")).show(),a=n.ul[0].scrollHeight>a?a:"auto",t.height(a),o&&n.ul.height("auto"==a?a:i.height()-o.height()),r||t.hide()}},_adjustListWidth:function(){var e,t,n=this.list,i=n[0].style.width,r=this.wrapper;if(n.data(x)||!i)return e=window.getComputedStyle?window.getComputedStyle(r[0],null):0,t=e?parseFloat(e.width):r.outerWidth(),e&&(S.mozilla||S.msie)&&(t+=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight)+parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth)),i="border-box"!==n.css("box-sizing")?t-(n.outerWidth()-n.width()):t,n.css({fontFamily:r.css("font-family"),width:i}).data(x,i),!0},_popup:function(){var e=this,t=e.list,n=e._focused,a=e.options,o=e.wrapper;e.popup=new r.Popup(t,k({},a.popup,{anchor:o,open:function(t){e._adjustListWidth(),e.trigger(m)?t.preventDefault():(n.attr("aria-expanded",!0),e.ul.attr("aria-hidden",!1))},close:function(t){e.trigger(v)?t.preventDefault():(n.attr("aria-expanded",!1),e.ul.attr("aria-hidden",!0))},animation:a.animation,isRtl:s.isRtl(o)})),e.popup.one(m,function(){e._height(e._data().length)}),e._touchScroller=i.touchScroller(e.popup.element)},_makeUnselectable:function(){F&&this.list.find("*").attr("unselectable","on")},_toggleHover:function(t){e(t.currentTarget).toggleClass(p,"mouseenter"===t.type)},_toggle:function(e,n){var i=this,r=s.touch&&s.MSPointers&&s.pointers;e=e!==t?e:!i.popup.visible(),n||r||i._focused[0]===u()||i._focused.focus(),i[e?m:v]()},_scroll:function(e){if(e){e[0]&&(e=e[0]);var t,n,i=this.ul[0],r=e.offsetTop,a=e.offsetHeight,o=i.scrollTop,s=i.clientHeight,l=r+a,u=this._touchScroller;u?(t=u.dimensions.y,t.enabled&&r>t.size&&(r=r-t.size+a+4,u.scrollTo(0,-r))):(n=this.header?this.header.outerHeight():0,i.scrollTop=o>r?r-n:l>o+s?l-s-n:o)}},_template:function(){var e=this,t=e.options,n=t.template,r=t.dataSource;e._isSelect&&e.element[0].length&&(r||(t.dataTextField=t.dataTextField||"text",t.dataValueField=t.dataValueField||"value")),n?(n=i.template(n),e.template=function(e){return'<li tabindex="-1" role="option" unselectable="on" class="k-item">'+n(e)+"</li>"}):e.template=i.template('<li tabindex="-1" role="option" unselectable="on" class="k-item">${'+i.expr(t.dataTextField,"data")+"}</li>",{useWithBlock:!1})},_triggerCascade:function(e){var t=this,n=t.value();(!t._bound&&n||t._old!==n)&&t.trigger("cascade",{userTriggered:e})},_unbindDataSource:function(){var e=this;e.dataSource.unbind(f,e._refreshHandler).unbind(b,e._progressHandler).unbind(w,e._requestEndHandler).unbind("error",e._errorHandler)}});k(M,{inArray:function(e,t){var n,i,r=t.children;if(!e||e.parentNode!==t)return-1;for(n=0,i=r.length;i>n;n++)if(e===r[n])return n;return-1}}),i.ui.List=M,r.Select=M.extend({init:function(e,t){M.fn.init.call(this,e,t),this._initial=this.element.val()},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this._bound=!1,this.options.autoBind&&this.dataSource.fetch()},close:function(){this.popup.close()},select:function(e){var n=this;return e===t?n.selectedIndex:(n._select(e),n._triggerCascade(),n._old=n._accessor(),n._oldIndex=n.selectedIndex,t)},_accessor:function(e,n){var i,r=this.element[0],a=this._isSelect,o=r.selectedIndex;return e===t?(a?o>-1&&(i=r.options[o],i&&(e=i.value)):e=r.value,e):(a?(o>-1&&r.options[o].removeAttribute(y),r.selectedIndex=n,i=r.options[n],i&&i.setAttribute(y,y)):r.value=e,t)},_hideBusy:function(){var e=this;clearTimeout(e._busy),e._arrow.removeClass(g),e._focused.attr("aria-busy",!1),e._busy=null},_showBusy:function(){var e=this;e._request=!0,e._busy||(e._busy=setTimeout(function(){e._focused.attr("aria-busy",!0),e._arrow.addClass(g)},100))},_requestEnd:function(){this._request=!1},_dataSource:function(){var t,n=this,r=n.element,a=n.options,o=a.dataSource||{};o=e.isArray(o)?{data:o}:o,n._isSelect&&(t=r[0].selectedIndex,t>-1&&(a.index=t),o.select=r,o.fields=[{field:a.dataTextField},{field:a.dataValueField}]),n.dataSource&&n._refreshHandler?n._unbindDataSource():(n._refreshHandler=C(n.refresh,n),n._progressHandler=C(n._showBusy,n),n._requestEndHandler=C(n._requestEnd,n),n._errorHandler=C(n._hideBusy,n)),n.dataSource=i.data.DataSource.create(o).bind(f,n._refreshHandler).bind(b,n._progressHandler).bind(w,n._requestEndHandler).bind("error",n._errorHandler)},_get:function(t){var n,i,r=this,a=r._data();if("function"==typeof t)for(n=0,i=a.length;i>n;n++)if(t(a[n])){t=n;break}if("number"==typeof t){if(0>t)return e();t=e(r.ul[0].children[t])}return t&&t.nodeType&&(t=e(t)),t},_move:function(e){var t,n,i=this,r=e.keyCode,a=i.ul[0],s=i.popup.visible()?"_select":"_accept",l=i._current,u=r===o.DOWN;if(r===o.UP||u){if(e.altKey)i.toggle(u);else{if(t=a.firstChild,!t&&!i._accessor()&&"filter"!==i._state)return i._fetch||(i.dataSource.one(f,function(){i._move(e),i._fetch=!1}),i._fetch=!0,i._filterSource()),e.preventDefault(),!0;u?(!l||-1===i.selectedIndex&&!i.value()&&l[0]===t?l=t:(l=l[0].nextSibling,l||t!==a.lastChild||(l=t)),i[s](l)):(l=l?l[0].previousSibling:a.lastChild,l||t!==a.lastChild||(l=t),i[s](l))}e.preventDefault(),n=!0}else r===o.ENTER||r===o.TAB?(i.popup.visible()&&e.preventDefault(),!i._typing&&(i.popup.visible()||l&&l.hasClass("k-state-selected"))||(l=null),i._accept(l),n=!0):r===o.ESC&&(i.popup.visible()&&e.preventDefault(),i.close(),n=!0);return n},_selectItem:function(){var e,n,i=this,r=i._bound===t,a=i.options;e=i._isSelect&&!i._initial&&!a.value&&a.index&&!i._bound,e||(n=i._selectedValue||r&&a.value||i._accessor()),n?i.value(n):r&&i.select(a.index)},_fetchItems:function(e){var n=this,i=n.ul[0].firstChild;return n._request?!0:n._fetch||i?t:n.options.cascadeFrom?!i:(n.dataSource.one(f,function(){n._old=t,n.value(e),n._fetch=!1}),n._fetch=!0,n.dataSource.fetch(),!0)},_options:function(e,n){var i,r,a,o,s=this,u=s.element,c=e.length,d="",f=0;for(n&&(f=1,d=n);c>f;f++)i="<option",r=e[f],a=s._text(r),o=s._value(r),o!==t&&(o+="",-1!==o.indexOf('"')&&(o=o.replace(T,"&quot;")),i+=' value="'+o+'"'),i+=">",a!==t&&(i+=l(a)),i+="</option>",d+=i;u.html(d)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(t._initial)})},t._form=r.on("reset",t._resetHandler))},_cascade:function(){var t,i,r,a,o,s=this,l=s.options,u=l.cascadeFrom;if(u){if(s._selectedValue=l.value||s._accessor(),i=e("#"+u),t=i.data("kendo"+l.name),t||(t=i.data("kendo"+D[l.name])),!t)return;l.autoBind=!1,a=l.cascadeFromField||t.options.dataValueField,o=function(){s.dataSource.unbind(f,o);var e=s._selectedValue||s.value();s._userTriggered?s._clearSelection(t,!0):e?(s.value(e),s.dataSource.view()[0]&&-1!==s.selectedIndex||s._clearSelection(t,!0)):s.select(l.index),s.enable(),s._triggerCascade(s._userTriggered),s._userTriggered=!1},r=function(){var e,i,r,l=t.dataItem(),u=l?t._value(l):null;u||0===u?(e=s.dataSource.filter()||{},n(e,a),i=e.filters||[],i.push({field:a,operator:"eq",value:u}),r=function(){s.unbind("dataBound",r),o.apply(s,arguments)},s.first("dataBound",r),s.dataSource.filter(i)):(s.enable(!1),s._clearSelection(t),s._triggerCascade(s._userTriggered),s._userTriggered=!1)},t.first("cascade",function(e){s._userTriggered=e.userTriggered,r()}),t._bound?r():t.value()||s.enable(!1)}}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});