/* Minification failed. Returning unminified contents.
(7365,8-9): run-time error JS1010: Expected identifier: .
(7365,8-9): run-time error JS1195: Expected expression: .
(8127,8-9): run-time error JS1010: Expected identifier: .
(8127,8-9): run-time error JS1195: Expected expression: .
 */
/*
* Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.list.min","./kendo.mobile.scroller.min"],e)}(function(){return function(e,t){function n(e,t,n){for(var i,o=0,r=t.length-1;r>o;++o)i=t[o],i in e||(e[i]={}),e=e[i];e[t[r]]=n}var i=window.kendo,o=i.ui,r=o.Select,s=i.support,a=i._activeElement,l=i.data.ObservableObject,c=i.keys,h=".kendoDropDownList",d="disabled",u="readonly",f="change",p="k-state-focused",g="k-state-default",m="k-state-disabled",v="aria-disabled",_="aria-readonly",w="mouseenter"+h+" mouseleave"+h,y="tabindex",b="filter",x="accept",k=e.proxy,C=r.extend({init:function(n,o){var s,a,l,c=this,d=o&&o.index;c.ns=h,o=e.isArray(o)?{dataSource:o}:o,r.fn.init.call(c,n,o),o=c.options,n=c.element.on("focus"+h,k(c._focusHandler,c)),c._focusInputHandler=e.proxy(c._focusInput,c),c._inputTemplate(),c._reset(),c._prev="",c._word="",c.optionLabel=e(),c._wrapper(),c._tabindex(),c.wrapper.data(y,c.wrapper.attr(y)),c._span(),c._popup(),c._mobile(),c._dataSource(),c._ignoreCase(),c._filterHeader(),c._aria(),c._enable(),c._oldIndex=c.selectedIndex=-1,d!==t&&(o.index=d),c._initialIndex=o.index,c._optionLabel(),c._initList(),c._cascade(),o.autoBind?c.dataSource.fetch():-1===c.selectedIndex&&(a=o.text||"",a||(s=o.optionLabel,s&&0===o.index?a=s:c._isSelect&&(a=n.children(":selected").text())),c._textAccessor(a)),l=e(c.element).parents("fieldset").is(":disabled"),l&&c.enable(!1),i.notify(c)},options:{name:"DropDownList",enabled:!0,autoBind:!0,index:0,text:null,value:null,delay:500,height:200,dataTextField:"",dataValueField:"",optionLabel:"",cascadeFrom:"",cascadeFromField:"",ignoreCase:!0,animation:{},filter:"none",minLength:1,virtual:!1,template:null,valueTemplate:null,optionLabelTemplate:null,groupTemplate:"#:data#",fixedGroupTemplate:"#:data#"},events:["open","close",f,"select","filtering","dataBinding","dataBound","cascade"],setOptions:function(e){r.fn.setOptions.call(this,e),this.listView.setOptions(this._listOptions(e)),this._optionLabel(),this._inputTemplate(),this._accessors(),this._filterHeader(),this._enable(),this._aria(),!this.value()&&this.optionLabel[0]&&this.select(0)},destroy:function(){var e=this;e.wrapper.off(h),e.element.off(h),e._inputWrapper.off(h),e._arrow.off(),e._arrow=null,e.optionLabel.off(),r.fn.destroy.call(e)},open:function(){var e=this;e.popup.visible()||(e.listView.isBound()&&e._state!==x?e._allowOpening()&&(e.popup.one("activate",e._focusInputHandler),e.popup.open(),e._focusItem()):(e._open=!0,e._state="rebind",e.filterInput&&(e.filterInput.val(""),e._prev=""),e._filterSource()))},_focusInput:function(){this._focusElement(this.filterInput)},_allowOpening:function(){return this.optionLabel[0]||this.filterInput||this.dataSource.view().length},toggle:function(e){this._toggle(e,!0)},current:function(e){var n;return e===t?(n=this.listView.focus(),!n&&0===this.selectedIndex&&this.optionLabel[0]?this.optionLabel:n):(this._focus(e),t)},dataItem:function(n){var i=this,o=null,r=!!i.optionLabel[0],s=i.options.optionLabel;return n===t?o=i.listView.selectedDataItems()[0]:("number"!=typeof n?n=n.hasClass("k-list-optionlabel")?-1:e(i.items()).index(n):r&&(n-=1),o=i.dataSource.flatView()[n]),!o&&r&&(o=e.isPlainObject(s)?new l(s):i._assignInstance(i._optionLabelText(),"")),o},refresh:function(){this.listView.refresh()},text:function(e){var n,i,o=this,r=o.options.ignoreCase;return e=null===e?"":e,e===t?o._textAccessor():("string"==typeof e&&(i=r?e.toLowerCase():e,o._select(function(e){return e=o._text(e),r&&(e=(e+"").toLowerCase()),e===i}),n=o.dataItem(),n&&(e=n)),o._textAccessor(e),t)},value:function(e){var n=this,i=n.dataSource;return e===t?(e=n._accessor()||n.listView.value()[0],e===t||null===e?"":e):(e&&(n._initialIndex=null),n._request&&n.options.cascadeFrom&&n.listView.isBound()?(n._valueSetter&&i.unbind(f,n._valueSetter),n._valueSetter=k(function(){n.value(e)},n),i.one(f,n._valueSetter),t):(n.listView.value(e).done(function(){-1===n.selectedIndex&&n.text()&&(n.text(""),n._accessor("",-1)),n._old=n._accessor(),n._oldIndex=n.selectedIndex}),n._fetchData(),t))},_optionLabel:function(){var n=this,o=n.options,r=o.optionLabel,s=o.optionLabelTemplate;return r?(s||(s="#:",s+="string"==typeof r?"data":i.expr(o.dataTextField,"data"),s+="#"),"function"!=typeof s&&(s=i.template(s)),n.optionLabelTemplate=s,n.optionLabel[0]||(n.optionLabel=e('<div class="k-list-optionlabel"></div>').prependTo(n.list)),n.optionLabel.html(s(r)).off().click(k(n._click,n)).on(w,n._toggleHover),n.angular("compile",function(){return{elements:n.optionLabel}}),t):(n.optionLabel.off().remove(),n.optionLabel=e(),t)},_optionLabelText:function(){var e=this.options.optionLabel;return"string"==typeof e?e:this._text(e)},_listBound:function(){var e,t,n,i=this,o=i._initialIndex,r=i.options.optionLabel,s=i._state===b,a=i.dataSource.flatView(),l=a.length;i._angularItems("compile"),i._presetValue=!1,i.options.virtual||(t=i._height(s?l||1:l),i._calculateGroupPadding(t)),i.popup.position(),i._isSelect&&(n=i.value(),l?r&&(r=i._option("",i._optionLabelText())):n&&(r=i._option(n,i.text())),i._options(a,r,n)),i._makeUnselectable(),s||(i._open&&i.toggle(i._allowOpening()),i._open=!1,i._fetch||(l?(!i.listView.value().length&&o>-1&&null!==o&&i.select(o),i._initialIndex=null,e=i.listView.selectedDataItems()[0],e&&i.text()!==i._text(e)&&i._selectValue(e)):i._textAccessor()!==i._optionLabelText()&&(i.listView.value(""),i._selectValue(null),i._oldIndex=i.selectedIndex))),i._hideBusy(),i.trigger("dataBound")},_listChange:function(){this._selectValue(this.listView.selectedDataItems()[0]),(this._presetValue||this._old&&-1===this._oldIndex)&&(this._oldIndex=this.selectedIndex)},_focusHandler:function(){this.wrapper.focus()},_focusinHandler:function(){this._inputWrapper.addClass(p),this._prevent=!1},_focusoutHandler:function(){var e=this,t=e._state===b,n=window.self!==window.top,i=e._focus();e._prevent||(clearTimeout(e._typingTimeout),t&&i&&!e.trigger("select",{item:i})&&e._select(i,!e.dataSource.view().length),s.mobileOS.ios&&n?e._change():e._blur(),e._inputWrapper.removeClass(p),e._prevent=!0,e._open=!1,e.element.blur())},_wrapperMousedown:function(){this._prevent=!!this.filterInput},_wrapperClick:function(e){e.preventDefault(),this.popup.unbind("activate",this._focusInputHandler),this._focused=this.wrapper,this._toggle()},_editable:function(e){var t=this,n=t.element,i=e.disable,o=e.readonly,r=t.wrapper.add(t.filterInput).off(h),s=t._inputWrapper.off(w);o||i?i?(r.removeAttr(y),s.addClass(m).removeClass(g)):(s.addClass(g).removeClass(m),r.on("focusin"+h,k(t._focusinHandler,t)).on("focusout"+h,k(t._focusoutHandler,t))):(n.removeAttr(d).removeAttr(u),s.addClass(g).removeClass(m).on(w,t._toggleHover),r.attr(y,r.data(y)).attr(v,!1).attr(_,!1).on("keydown"+h,k(t._keydown,t)).on("focusin"+h,k(t._focusinHandler,t)).on("focusout"+h,k(t._focusoutHandler,t)).on("mousedown"+h,k(t._wrapperMousedown,t)),t.wrapper.on("click"+h,k(t._wrapperClick,t)),t.filterInput||r.on("keypress"+h,k(t._keypress,t))),n.attr(d,i).attr(u,o),r.attr(v,i).attr(_,o)},_option:function(e,t){return'<option value="'+e+'">'+t+"</option>"},_keydown:function(e){var n,i,o=this,r=e.keyCode,s=e.altKey,l=o.popup.visible();if(o.filterInput&&(n=o.filterInput[0]===a()),r===c.LEFT?(r=c.UP,i=!0):r===c.RIGHT&&(r=c.DOWN,i=!0),!i||!n){if(e.keyCode=r,s&&r===c.UP&&o._focusElement(o.wrapper),r===c.ENTER&&o._typingTimeout&&o.filterInput&&l)return e.preventDefault(),t;i=o._move(e),i||(l&&o.filterInput||(r===c.HOME?(i=!0,o._firstItem()):r===c.END&&(i=!0,o._lastItem()),i&&(o._select(o._focus()),e.preventDefault())),s||i||!o.filterInput||o._search())}},_matchText:function(e,t){var n=this,i=n.options.ignoreCase,o=!1;return e+="",i&&(e=e.toLowerCase()),0===e.indexOf(n._word)&&(n.optionLabel[0]&&(t+=1),n._select(t),n.popup.visible()||n._change(),o=!0),o},_selectNext:function(e){for(var t,n=this,i=e,o=n.dataSource.flatView(),r=o.length;r>e;e++)if(t=n._text(o[e]),t&&n._matchText(t,e)&&(1!==n._word.length||i!==n.selectedIndex))return!0;if(i>0&&r>i)for(e=0;i>=e;e++)if(t=n._text(o[e]),t&&n._matchText(t,e))return!0;return!1},_keypress:function(e){var t,n,o,r=this;0!==e.which&&e.keyCode!==i.keys.ENTER&&(t=String.fromCharCode(e.charCode||e.keyCode),n=r.selectedIndex,o=r._word.length,r.options.ignoreCase&&(t=t.toLowerCase())," "===t&&e.preventDefault(),o||(r._word=t),r._last===t&&1>=o&&n>-1&&r._selectNext(n)||(o&&(r._word+=t),r._last=t,r._search()))},_popupOpen:function(){var e=this.popup;e.wrapper=i.wrap(e.element),e.element.closest(".km-root")[0]&&(e.wrapper.addClass("km-popup km-widget"),this.wrapper.addClass("km-widget"))},_popup:function(){r.fn._popup.call(this),this.popup.one("open",k(this._popupOpen,this))},_click:function(n){var i=n.item||e(n.currentTarget);return this.trigger("select",{item:i})?(this.close(),t):(this._userTriggered=!0,this._select(i),this._focusElement(this.wrapper),this._blur(),t)},_focusElement:function(e){var t=a(),n=this.wrapper,i=this.filterInput,o=e===i?n:i,r=s.mobileOS&&(s.touch||s.MSPointers||s.pointers);i&&i[0]===e[0]&&r||i&&o[0]===t&&(this._prevent=!0,this._focused=e.focus())},_filter:function(e){var n,i;e&&(n=this,i=n.options.ignoreCase,i&&(e=e.toLowerCase()),n._select(function(o){var r=n._text(o);return r!==t?(r+="",i&&(r=r.toLowerCase()),0===r.indexOf(e)):t}))},_search:function(){var e=this,n=e.dataSource,i=e.selectedIndex;if(clearTimeout(e._typingTimeout),"none"!==e.options.filter)e._typingTimeout=setTimeout(function(){var t=e.filterInput.val();e._prev!==t&&(e._prev=t,e.search(t)),e._typingTimeout=null},e.options.delay);else{if(e._typingTimeout=setTimeout(function(){e._word=""},e.options.delay),-1===i&&(i=0),!e.ul[0].firstChild)return n.fetch().done(function(){n.data()[0]&&i>-1&&e._selectNext(i)}),t;e._selectNext(i)}},_get:function(t){var n,i,o,r="function"==typeof t,s=r?e():e(t);if(this.optionLabel[0]&&("number"==typeof t?t>-1&&(t-=1):s.hasClass("k-list-optionlabel")&&(t=-1)),r){for(n=this.dataSource.flatView(),o=0;n.length>o;o++)if(t(n[o])){t=o,i=!0;break}i||(t=-1)}return t},_firstItem:function(){this.optionLabel[0]?this._focus(this.optionLabel):this.listView.first()},_lastItem:function(){this.optionLabel.removeClass("k-state-focused"),this.listView.last()},_nextItem:function(){this.optionLabel.hasClass("k-state-focused")?(this.optionLabel.removeClass("k-state-focused"),this.listView.first()):this.listView.next()},_prevItem:function(){this.optionLabel.hasClass("k-state-focused")||(this.listView.prev(),this.listView.focus()||this.optionLabel.addClass("k-state-focused"))},_focusItem:function(){var e=this.listView,n=e.focus(),i=e.select();i=i[i.length-1],i===t&&this.options.highlightFirst&&!n&&(i=0),i!==t?e.focus(i):this.options.optionLabel?(this._focus(this.optionLabel),this._select(this.optionLabel)):e.scrollToIndex(0)},_focus:function(e){var n=this.listView,i=this.optionLabel;return e===t?(e=n.focus(),!e&&i.hasClass("k-state-focused")&&(e=i),e):(i.removeClass("k-state-focused"),e=this._get(e),n.focus(e),-1===e&&i.addClass("k-state-focused"),t)},_select:function(e,t){var n=this;e=n._get(e),n.listView.select(e),t||n._state!==b||(n.listView.filter(!1),n._state=x),-1===e&&n._selectValue(null)},_selectValue:function(e){var n=this,i=n.options.optionLabel,o=n.optionLabel,r=n.listView.select(),s="",a="";r=r[r.length-1],r===t&&(r=-1),o.removeClass("k-state-focused k-state-selected"),e?(a=e,s=n._dataValue(e),i&&(r+=1)):i&&(n._focus(o.addClass("k-state-selected")),a=n._optionLabelText(),s="string"==typeof i?"":n._value(i),r=0),n.selectedIndex=r,null===s&&(s=""),n._textAccessor(a),n._accessor(s,r),n._triggerCascade()},_mobile:function(){var e=this,t=e.popup,n=s.mobileOS,i=t.element.parents(".km-root").eq(0);i.length&&n&&(t.options.animation.open.effects=n.android||n.meego?"fadeIn":n.ios||n.wp?"slideIn:up":t.options.animation.open.effects)},_filterHeader:function(){var t,n=this.options,i="none"!==n.filter;this.filterInput&&(this.filterInput.off(h).parent().remove(),this.filterInput=null),i&&(t='<span unselectable="on" class="k-icon k-i-search">select</span>',this.filterInput=e('<input class="k-textbox"/>').attr({role:"listbox","aria-haspopup":!0,"aria-expanded":!1}),this.list.prepend(e('<span class="k-list-filter" />').append(this.filterInput.add(t))))},_span:function(){var t,n=this,i=n.wrapper,o="span.k-input";t=i.find(o),t[0]||(i.append('<span unselectable="on" class="k-dropdown-wrap k-state-default"><span unselectable="on" class="k-input">&nbsp;</span><span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-arrow-s">select</span></span></span>').append(n.element),t=i.find(o)),n.span=t,n._inputWrapper=e(i[0].firstChild),n._arrow=i.find(".k-icon")},_wrapper:function(){var e,t=this,n=t.element,i=n[0];e=n.parent(),e.is("span.k-widget")||(e=n.wrap("<span />").parent(),e[0].style.cssText=i.style.cssText,e[0].title=i.title),n.hide(),t._focused=t.wrapper=e.addClass("k-widget k-dropdown k-header").addClass(i.className).css("display","").attr({unselectable:"on",role:"listbox","aria-haspopup":!0,"aria-expanded":!1})},_clearSelection:function(e){this.select(e.value()?0:-1)},_inputTemplate:function(){var t=this,n=t.options.valueTemplate;n=n?i.template(n):e.proxy(i.template("#:this._text(data)#",{useWithBlock:!1}),t),t.valueTemplate=n},_textAccessor:function(n){var i,o=null,r=this.valueTemplate,s=this.options,a=s.optionLabel,c=this.span;return n===t?c.text():(e.isPlainObject(n)||n instanceof l?o=n:a&&this._optionLabelText()===n&&(o=a,r=this.optionLabelTemplate),o||(o=this._assignInstance(n,this._accessor())),i=function(){return{elements:c.get(),data:[{dataItem:o}]}},this.angular("cleanup",i),c.html(r(o)),this.angular("compile",i),t)},_preselect:function(e,t){e||t||(t=this._optionLabelText()),this._accessor(e),this._textAccessor(t),this._old=this._accessor(),this._oldIndex=this.selectedIndex,this.listView.setValue(e),this._initialIndex=null,this._presetValue=!0},_assignInstance:function(e,t){var i=this.options.dataTextField,o={};return i?(n(o,i.split("."),e),n(o,this.options.dataValueField.split("."),t),o=new l(o)):o=e,o}});o.plugin(C)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});;
/*
* Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.core.min"],e)}(function(){return function(e){function t(e,t){var n=e.x.location,i=e.y.location,o=t.x.location,r=t.y.location,a=n-o,s=i-r;return{center:{x:(n+o)/2,y:(i+r)/2},distance:Math.sqrt(a*a+s*s)}}function n(e){var t,n,i,o=[],a=e.originalEvent,s=e.currentTarget,l=0;if(e.api)o.push({id:2,event:e,target:e.target,currentTarget:e.target,location:e,type:"api"});else if(e.type.match(/touch/))for(n=a?a.changedTouches:[],t=n.length;t>l;l++)i=n[l],o.push({location:i,event:e,target:i.target,currentTarget:s,id:i.identifier,type:"touch"});else o.push(r.pointers||r.msPointers?{location:a,event:e,target:e.target,currentTarget:s,id:a.pointerId,type:"pointer"}:{id:1,event:e,target:e.target,currentTarget:s,location:e,type:"mouse"});return o}function i(e){for(var t=o.eventMap.up.split(" "),n=0,i=t.length;i>n;n++)e(t[n])}var o=window.kendo,r=o.support,a=window.document,s=o.Class,l=o.Observable,c=e.now,d=e.extend,u=r.mobileOS,h=u&&u.android,p=800,f=r.browser.msie?5:0,g="press",m="hold",v="select",_="start",y="move",w="end",b="cancel",x="tap",k="release",C="gesturestart",S="gesturechange",T="gestureend",A="gesturetap",D={api:0,touch:0,mouse:9,pointer:9},M=!r.touch||r.mouseAndTouchPresent,E=s.extend({init:function(e,t){var n=this;n.axis=e,n._updateLocationData(t),n.startLocation=n.location,n.velocity=n.delta=0,n.timeStamp=c()},move:function(e){var t=this,n=e["page"+t.axis],i=c(),o=i-t.timeStamp||1;(n||!h)&&(t.delta=n-t.location,t._updateLocationData(e),t.initialDelta=n-t.startLocation,t.velocity=t.delta/o,t.timeStamp=i)},_updateLocationData:function(e){var t=this,n=t.axis;t.location=e["page"+n],t.client=e["client"+n],t.screen=e["screen"+n]}}),P=s.extend({init:function(e,t,n){d(this,{x:new E("X",n.location),y:new E("Y",n.location),type:n.type,threshold:e.threshold||D[n.type],userEvents:e,target:t,currentTarget:n.currentTarget,initialTouch:n.target,id:n.id,pressEvent:n,_moved:!1,_finished:!1})},press:function(){this._holdTimeout=setTimeout(e.proxy(this,"_hold"),this.userEvents.minHold),this._trigger(g,this.pressEvent)},_hold:function(){this._trigger(m,this.pressEvent)},move:function(e){var t=this;if(!t._finished){if(t.x.move(e.location),t.y.move(e.location),!t._moved){if(t._withinIgnoreThreshold())return;if(I.current&&I.current!==t.userEvents)return t.dispose();t._start(e)}t._finished||t._trigger(y,e)}},end:function(e){var t=this;t.endTime=c(),t._finished||(t._finished=!0,t._trigger(k,e),t._moved?t._trigger(w,e):t._trigger(x,e),clearTimeout(t._holdTimeout),t.dispose())},dispose:function(){var t=this.userEvents,n=t.touches;this._finished=!0,this.pressEvent=null,clearTimeout(this._holdTimeout),n.splice(e.inArray(this,n),1)},skip:function(){this.dispose()},cancel:function(){this.dispose()},isMoved:function(){return this._moved},_start:function(e){clearTimeout(this._holdTimeout),this.startTime=c(),this._moved=!0,this._trigger(_,e)},_trigger:function(e,t){var n=this,i=t.event,o={touch:n,x:n.x,y:n.y,target:n.target,event:i};n.userEvents.notify(e,o)&&i.preventDefault()},_withinIgnoreThreshold:function(){var e=this.x.initialDelta,t=this.y.initialDelta;return Math.sqrt(e*e+t*t)<=this.threshold}}),I=l.extend({init:function(t,n){var s,c,u,h=this,D=o.guid();n=n||{},s=h.filter=n.filter,h.threshold=n.threshold||f,h.minHold=n.minHold||p,h.touches=[],h._maxTouches=n.multiTouch?2:1,h.allowSelection=n.allowSelection,h.captureUpIfMoved=n.captureUpIfMoved,h.eventNS=D,t=e(t).handler(h),l.fn.init.call(h),d(h,{element:t,surface:e(n.global&&M?a.documentElement:n.surface||t),stopPropagation:n.stopPropagation,pressed:!1}),h.surface.handler(h).on(o.applyEventMap("move",D),"_move").on(o.applyEventMap("up cancel",D),"_end"),t.on(o.applyEventMap("down",D),s,"_start"),(r.pointers||r.msPointers)&&t.css("-ms-touch-action","pinch-zoom double-tap-zoom"),n.preventDragEvent&&t.on(o.applyEventMap("dragstart",D),o.preventDefault),t.on(o.applyEventMap("mousedown",D),s,{root:t},"_select"),h.captureUpIfMoved&&r.eventCapture&&(c=h.surface[0],u=e.proxy(h.preventIfMoving,h),i(function(e){c.addEventListener(e,u,!0)})),h.bind([g,m,x,_,y,w,k,b,C,S,T,A,v],n)},preventIfMoving:function(e){this._isMoved()&&e.preventDefault()},destroy:function(){var e,t=this;t._destroyed||(t._destroyed=!0,t.captureUpIfMoved&&r.eventCapture&&(e=t.surface[0],i(function(n){e.removeEventListener(n,t.preventIfMoving)})),t.element.kendoDestroy(t.eventNS),t.surface.kendoDestroy(t.eventNS),t.element.removeData("handler"),t.surface.removeData("handler"),t._disposeAll(),t.unbind(),delete t.surface,delete t.element,delete t.currentTarget)},capture:function(){I.current=this},cancel:function(){this._disposeAll(),this.trigger(b)},notify:function(e,n){var i=this,o=i.touches;if(this._isMultiTouch()){switch(e){case y:e=S;break;case w:e=T;break;case x:e=A}d(n,{touches:o},t(o[0],o[1]))}return this.trigger(e,d(n,{type:e}))},press:function(e,t,n){this._apiCall("_start",e,t,n)},move:function(e,t){this._apiCall("_move",e,t)},end:function(e,t){this._apiCall("_end",e,t)},_isMultiTouch:function(){return this.touches.length>1},_maxTouchesReached:function(){return this.touches.length>=this._maxTouches},_disposeAll:function(){for(var e=this.touches;e.length>0;)e.pop().dispose()},_isMoved:function(){return e.grep(this.touches,function(e){return e.isMoved()}).length},_select:function(e){(!this.allowSelection||this.trigger(v,{event:e}))&&e.preventDefault()},_start:function(t){var i,o,r=this,a=0,s=r.filter,l=n(t),c=l.length,d=t.which;if(!(d&&d>1||r._maxTouchesReached()))for(I.current=null,r.currentTarget=t.currentTarget,r.stopPropagation&&t.stopPropagation();c>a&&!r._maxTouchesReached();a++)o=l[a],i=s?e(o.currentTarget):r.element,i.length&&(o=new P(r,i,o),r.touches.push(o),o.press(),r._isMultiTouch()&&r.notify("gesturestart",{}))},_move:function(e){this._eachTouch("move",e)},_end:function(e){this._eachTouch("end",e)},_eachTouch:function(e,t){var i,o,r,a,s=this,l={},c=n(t),d=s.touches;for(i=0;d.length>i;i++)o=d[i],l[o.id]=o;for(i=0;c.length>i;i++)r=c[i],a=l[r.id],a&&a[e](r)},_apiCall:function(t,n,i,o){this[t]({api:!0,pageX:n,pageY:i,clientX:n,clientY:i,target:e(o||this.element)[0],stopPropagation:e.noop,preventDefault:e.noop})}});I.defaultThreshold=function(e){f=e},I.minHold=function(e){p=e},o.getTouches=n,o.touchDelta=t,o.UserEvents=I}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});;
/*
* Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.core.min","./kendo.userevents.min"],e)}(function(){return function(e,t){function n(e,t){return'<span unselectable="on" class="k-link"><span unselectable="on" class="k-icon k-i-arrow-'+e+'" title="'+t+'">'+t+"</span></span>"}var i=window.kendo,o=i.caret,r=i.keys,a=i.ui,s=a.Widget,l=i._activeElement,c=i._extractFormat,d=i.parseFloat,h=i.support.placeholder,u=i.getCulture,f=i._round,p="change",g="disabled",m="readonly",v="k-input",_="spin",w=".kendoNumericTextBox",y="touchend",b="mouseleave"+w,x="mouseenter"+w+" "+b,k="k-state-default",C="k-state-focused",S="k-state-hover",T="focus",D=".",A="k-state-selected",P="k-state-disabled",E="aria-disabled",M="aria-readonly",I=/^(-)?(\d*)$/,B=null,z=e.proxy,L=e.extend,F=s.extend({init:function(n,o){var r,a,l,d,h,u=this,f=o&&o.step!==t;s.fn.init.call(u,n,o),o=u.options,n=u.element.on("focusout"+w,z(u._focusout,u)).attr("role","spinbutton"),o.placeholder=o.placeholder||n.attr("placeholder"),u._initialOptions=L({},o),u._reset(),u._wrapper(),u._arrows(),u._input(),i.support.mobileOS?u._text.on(y+w+" "+T+w,function(){u._toggleText(!1),n.focus()}):u._text.on(T+w,z(u._click,u)),r=u.min(n.attr("min")),a=u.max(n.attr("max")),l=u._parse(n.attr("step")),o.min===B&&r!==B&&(o.min=r),o.max===B&&a!==B&&(o.max=a),f||l===B||(o.step=l),n.attr("aria-valuemin",o.min).attr("aria-valuemax",o.max),o.format=c(o.format),d=o.value,u.value(d!==B?d:n.val()),h=n.is("[disabled]")||e(u.element).parents("fieldset").is(":disabled"),h?u.enable(!1):u.readonly(n.is("[readonly]")),i.notify(u)},options:{name:"NumericTextBox",decimals:B,min:B,max:B,value:B,step:1,culture:"",format:"n",spinners:!0,placeholder:"",upArrowText:"Increase value",downArrowText:"Decrease value"},events:[p,_],_editable:function(e){var t=this,n=t.element,i=e.disable,o=e.readonly,r=t._text.add(n),a=t._inputWrapper.off(x);t._toggleText(!0),t._upArrowEventHandler.unbind("press"),t._downArrowEventHandler.unbind("press"),n.off("keydown"+w).off("keypress"+w).off("paste"+w),o||i?(a.addClass(i?P:k).removeClass(i?k:P),r.attr(g,i).attr(m,o).attr(E,i).attr(M,o)):(a.addClass(k).removeClass(P).on(x,t._toggleHover),r.removeAttr(g).removeAttr(m).attr(E,!1).attr(M,!1),t._upArrowEventHandler.bind("press",function(e){e.preventDefault(),t._spin(1),t._upArrow.addClass(A)}),t._downArrowEventHandler.bind("press",function(e){e.preventDefault(),t._spin(-1),t._downArrow.addClass(A)}),t.element.on("keydown"+w,z(t._keydown,t)).on("keypress"+w,z(t._keypress,t)).on("paste"+w,z(t._paste,t)))},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)})},destroy:function(){var e=this;e.element.add(e._text).add(e._upArrow).add(e._downArrow).add(e._inputWrapper).off(w),e._upArrowEventHandler.destroy(),e._downArrowEventHandler.destroy(),e._form&&e._form.off("reset",e._resetHandler),s.fn.destroy.call(e)},min:function(e){return this._option("min",e)},max:function(e){return this._option("max",e)},step:function(e){return this._option("step",e)},value:function(e){var n,i=this;return e===t?i._value:(e=i._parse(e),n=i._adjust(e),e===n&&(i._update(e),i._old=i._value),t)},focus:function(){this._focusin()},_adjust:function(e){var t=this,n=t.options,i=n.min,o=n.max;return e===B?e:(i!==B&&i>e?e=i:o!==B&&e>o&&(e=o),e)},_arrows:function(){var t,o=this,r=function(){clearTimeout(o._spinning),t.removeClass(A)},a=o.options,s=a.spinners,l=o.element;t=l.siblings(".k-icon"),t[0]||(t=e(n("n",a.upArrowText)+n("s",a.downArrowText)).insertAfter(l),t.wrapAll('<span class="k-select"/>')),s||(t.parent().toggle(s),o._inputWrapper.addClass("k-expand-padding")),o._upArrow=t.eq(0),o._upArrowEventHandler=new i.UserEvents(o._upArrow,{release:r}),o._downArrow=t.eq(1),o._downArrowEventHandler=new i.UserEvents(o._downArrow,{release:r})},_blur:function(){var e=this;e._toggleText(!0),e._change(e.element.val())},_click:function(e){var t=this;clearTimeout(t._focusing),t._focusing=setTimeout(function(){var n,i,r,a=e.target,s=o(a)[0],l=a.value.substring(0,s),c=t._format(t.options.format),d=c[","],h=0;d&&(i=RegExp("\\"+d,"g"),r=RegExp("([\\d\\"+d+"]+)(\\"+c[D]+")?(\\d+)?")),r&&(n=r.exec(l)),n&&(h=n[0].replace(i,"").length,-1!=l.indexOf("(")&&0>t._value&&h++),t._focusin(),o(t.element[0],h)})},_change:function(e){var t=this;t._update(e),e=t._value,t._old!=e&&(t._old=e,t._typing||t.element.trigger(p),t.trigger(p)),t._typing=!1},_culture:function(e){return e||u(this.options.culture)},_focusin:function(){var e=this;e._inputWrapper.addClass(C),e._toggleText(!1),e.element[0].focus()},_focusout:function(){var e=this;clearTimeout(e._focusing),e._inputWrapper.removeClass(C).removeClass(S),e._blur()},_format:function(e,t){var n=this._culture(t).numberFormat;return e=e.toLowerCase(),e.indexOf("c")>-1?n=n.currency:e.indexOf("p")>-1&&(n=n.percent),n},_input:function(){var t,n=this,i="k-formatted-value",o=n.element.addClass(v).show()[0],r=o.accessKey,a=n.wrapper;t=a.find(D+i),t[0]||(t=e('<input type="text"/>').insertBefore(o).addClass(i));try{o.setAttribute("type","text")}catch(s){o.type="text"}t[0].tabIndex=o.tabIndex,t[0].style.cssText=o.style.cssText,t[0].title=o.title,t.prop("placeholder",n.options.placeholder),r&&(t.attr("accesskey",r),o.accessKey=""),n._text=t.addClass(o.className)},_keydown:function(e){var t=this,n=e.keyCode;t._key=n,n==r.DOWN?t._step(-1):n==r.UP?t._step(1):n==r.ENTER?t._change(t.element.val()):t._typing=!0},_keypress:function(e){var t,n,i,a,s,l,c,d,h,u,f;0===e.which||e.metaKey||e.ctrlKey||e.keyCode===r.BACKSPACE||e.keyCode===r.ENTER||(t=this,n=t.options.min,i=t.element,a=o(i),s=a[0],l=a[1],c=String.fromCharCode(e.which),d=t._format(t.options.format),h=t._key===r.NUMPAD_DOT,u=i.val(),h&&(c=d[D]),u=u.substring(0,s)+c+u.substring(l),f=t._numericRegex(d).test(u),f&&h?(i.val(u),o(i,s+c.length),e.preventDefault()):(null!==n&&n>=0&&"-"===u.charAt(0)||!f)&&e.preventDefault(),t._key=0)},_numericRegex:function(e){var t=this,n=e[D],i=t.options.decimals;return n===D&&(n="\\"+n),i===B&&(i=e.decimals),0===i?I:(t._separator!==n&&(t._separator=n,t._floatRegExp=RegExp("^(-)?(((\\d+("+n+"\\d*)?)|("+n+"\\d*)))?$")),t._floatRegExp)},_paste:function(e){var t=this,n=e.target,i=n.value;setTimeout(function(){t._parse(n.value)===B&&t._update(i)})},_option:function(e,n){var i=this,o=i.options;return n===t?o[e]:(n=i._parse(n),(n||"step"!==e)&&(o[e]=n,i.element.attr("aria-value"+e,n).attr(e,n)),t)},_spin:function(e,t){var n=this;t=t||500,clearTimeout(n._spinning),n._spinning=setTimeout(function(){n._spin(e,50)},t),n._step(e)},_step:function(e){var t=this,n=t.element,i=t._parse(n.val())||0;l()!=n[0]&&t._focusin(),i+=t.options.step*e,t._update(t._adjust(i)),t._typing=!1,t.trigger(_)},_toggleHover:function(t){e(t.currentTarget).toggleClass(S,"mouseenter"===t.type)},_toggleText:function(e){var t=this;t._text.toggle(e),t.element.toggle(!e)},_parse:function(e,t){return d(e,this._culture(t),this.options.format)},_update:function(e){var t,n=this,o=n.options,r=o.format,a=o.decimals,s=n._culture(),l=n._format(r,s);a===B&&(a=l.decimals),e=n._parse(e,s),t=e!==B,t&&(e=parseFloat(f(e,a))),n._value=e=n._adjust(e),n._placeholder(i.toString(e,r,s)),t?(e=""+e,-1!==e.indexOf("e")&&(e=f(+e,a)),e=e.replace(D,l[D])):e="",n.element.val(e).attr("aria-valuenow",e)},_placeholder:function(e){this._text.val(e),h||e||this._text.val(this.options.placeholder)},_wrapper:function(){var t,n=this,i=n.element,o=i[0];t=i.parents(".k-numerictextbox"),t.is("span.k-numerictextbox")||(t=i.hide().wrap('<span class="k-numeric-wrap k-state-default" />').parent(),t=t.wrap("<span/>").parent()),t[0].style.cssText=o.style.cssText,o.style.width="",n.wrapper=t.addClass("k-widget k-numerictextbox").addClass(o.className).css("display",""),n._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),o=i?e("#"+i):n.closest("form");o[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(n[0].value),t.max(t._initialOptions.max),t.min(t._initialOptions.min)})},t._form=o.on("reset",t._resetHandler))}});a.plugin(F)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});;
/*
* Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.core.min"],e)}(function(){return function(e){function t(t){var n,i=s.ui.validator.ruleResolvers||{},o={};for(n in i)e.extend(!0,o,i[n].resolve(t));return o}function n(e){return e.replace(/&amp/g,"&amp;").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">")}function i(e){return e=(e+"").split("."),e.length>1?e[1].length:0}function o(t){return e(e.parseHTML?e.parseHTML(t):t)}function r(t,n){var i,o,r,a,l=e();for(r=0,a=t.length;a>r;r++)i=t[r],u.test(i.className)&&(o=i.getAttribute(s.attr("for")),o===n&&(l=l.add(i)));return l}var a,s=window.kendo,l=s.ui.Widget,c=".kendoValidator",d="k-invalid-msg",u=RegExp(d,"i"),h="k-invalid",p="k-valid",f=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,g=/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,m=":input:not(:button,[type=submit],[type=reset],[disabled],[readonly])",v=":checkbox:not([disabled],[readonly])",_="[type=number],[type=range]",y="blur",w="name",b="form",x="novalidate",k=e.proxy,C=function(e,t){return"string"==typeof t&&(t=RegExp("^(?:"+t+")$")),t.test(e)},S=function(e,t,n){var i=e.val();return e.filter(t).length&&""!==i?C(i,n):!0},T=function(e,t){return e.length?null!=e[0].attributes[t]:!1};s.ui.validator||(s.ui.validator={rules:{},messages:{}}),a=l.extend({init:function(n,i){var o=this,r=t(n),a="["+s.attr("validate")+"!=false]";i=i||{},i.rules=e.extend({},s.ui.validator.rules,r.rules,i.rules),i.messages=e.extend({},s.ui.validator.messages,r.messages,i.messages),l.fn.init.call(o,n,i),o._errorTemplate=s.template(o.options.errorTemplate),o.element.is(b)&&o.element.attr(x,x),o._inputSelector=m+a,o._checkboxSelector=v+a,o._errors={},o._attachEvents(),o._isValidated=!1},events:["validate","change"],options:{name:"Validator",errorTemplate:'<span class="k-widget k-tooltip k-tooltip-validation"><span class="k-icon k-warning"> </span> #=message#</span>',messages:{required:"{0} is required",pattern:"{0} is not valid",min:"{0} should be greater than or equal to {1}",max:"{0} should be smaller than or equal to {1}",step:"{0} is not valid",email:"{0} is not valid email",url:"{0} is not valid URL",date:"{0} is not valid date",dateCompare:"End date should be greater than or equal to the start date"},rules:{required:function(e){var t=e.filter("[type=checkbox]").length&&!e.is(":checked"),n=e.val();return!(T(e,"required")&&(""===n||!n||t))},pattern:function(e){return e.filter("[type=text],[type=email],[type=url],[type=tel],[type=search],[type=password]").filter("[pattern]").length&&""!==e.val()?C(e.val(),e.attr("pattern")):!0},min:function(e){if(e.filter(_+",["+s.attr("type")+"=number]").filter("[min]").length&&""!==e.val()){var t=parseFloat(e.attr("min"))||0,n=s.parseFloat(e.val());return n>=t}return!0},max:function(e){if(e.filter(_+",["+s.attr("type")+"=number]").filter("[max]").length&&""!==e.val()){var t=parseFloat(e.attr("max"))||0,n=s.parseFloat(e.val());return t>=n}return!0},step:function(e){if(e.filter(_+",["+s.attr("type")+"=number]").filter("[step]").length&&""!==e.val()){var t,n=parseFloat(e.attr("min"))||0,o=parseFloat(e.attr("step"))||1,r=parseFloat(e.val()),a=i(o);return a?(t=Math.pow(10,a),Math.floor((r-n)*t)%(o*t)/Math.pow(100,a)===0):(r-n)%o===0}return!0},email:function(e){return S(e,"[type=email],["+s.attr("type")+"=email]",f)},url:function(e){return S(e,"[type=url],["+s.attr("type")+"=url]",g)},date:function(e){return e.filter("[type^=date],["+s.attr("type")+"=date]").length&&""!==e.val()?null!==s.parseDate(e.val(),e.attr(s.attr("format"))):!0}},validateOnBlur:!0},destroy:function(){l.fn.destroy.call(this),this.element.off(c)},value:function(){return this._isValidated?0===this.errors().length:!1},_submit:function(e){return this.validate()?!0:(e.stopPropagation(),e.stopImmediatePropagation(),e.preventDefault(),!1)},_checkElement:function(e){var t=this.value();this.validateInput(e),this.value()!==t&&this.trigger("change")},_attachEvents:function(){var t=this;t.element.is(b)&&t.element.on("submit"+c,k(t._submit,t)),t.options.validateOnBlur&&(t.element.is(m)?(t.element.on(y+c,function(){t._checkElement(t.element)}),t.element.is(v)&&t.element.on("click"+c,function(){t._checkElement(t.element)})):(t.element.on(y+c,t._inputSelector,function(){t._checkElement(e(this))}),t.element.on("click"+c,t._checkboxSelector,function(){t._checkElement(e(this))})))},validate:function(){var e,t,n,i,o=!1,r=this.value();if(this._errors={},this.element.is(m))o=this.validateInput(this.element);else{for(i=!1,e=this.element.find(this._inputSelector),t=0,n=e.length;n>t;t++)this.validateInput(e.eq(t))||(i=!0);o=!i}return this.trigger("validate",{valid:o}),r!==o&&this.trigger("change"),o},validateInput:function(t){var i,r,a,l,c,u,f,g,m,v;return t=e(t),this._isValidated=!0,i=this,r=i._errorTemplate,a=i._checkValidity(t),l=a.valid,c="."+d,u=t.attr(w)||"",f=i._findMessageContainer(u).add(t.next(c).filter(function(){var t=e(this);return t.filter("["+s.attr("for")+"]").length?t.attr(s.attr("for"))===u:!0})).hide(),t.removeAttr("aria-invalid"),l?delete i._errors[u]:(g=i._extractMessage(t,a.key),i._errors[u]=g,m=o(r({message:n(g)})),v=f.attr("id"),i._decorateMessageContainer(m,u),v&&m.attr("id",v),f.replaceWith(m).length||m.insertAfter(t),m.show(),t.attr("aria-invalid",!0)),t.toggleClass(h,!l),t.toggleClass(p,l),l},hideMessages:function(){var e=this,t="."+d,n=e.element;n.is(m)?n.next(t).hide():n.find(t).hide()},_findMessageContainer:function(t){var n,i,o,a=s.ui.validator.messageLocators,l=e();for(i=0,o=this.element.length;o>i;i++)l=l.add(r(this.element[i].getElementsByTagName("*"),t));for(n in a)l=l.add(a[n].locate(this.element,t));return l},_decorateMessageContainer:function(e,t){var n,i=s.ui.validator.messageLocators;e.addClass(d).attr(s.attr("for"),t||"");for(n in i)i[n].decorate(e,t);e.attr("role","alert")},_extractMessage:function(e,t){var n=this,i=n.options.messages[t],o=e.attr(w);return i=s.isFunction(i)?i(e):i,s.format(e.attr(s.attr(t+"-msg"))||e.attr("validationMessage")||e.attr("title")||i||"",o,e.attr(t))},_checkValidity:function(e){var t,n=this.options.rules;for(t in n)if(!n[t].call(this,e))return{valid:!1,key:t};return{valid:!0}},errors:function(){var e,t=[],n=this._errors;for(e in n)t.push(n[e]);return t}}),s.ui.plugin(a)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});;
/*
* Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.datepicker.min","./kendo.numerictextbox.min","./kendo.validator.min","./kendo.binder.min"],e)}(function(){return function(e,t){function n(t){return t=null!=t?t:"",t.type||e.type(t)||"string"}function i(t){t.find(":input:not(:button, ["+a.attr("role")+"=upload], ["+a.attr("skip")+"], [type=file]), select").each(function(){var t=a.attr("bind"),n=this.getAttribute(t)||"",i="checkbox"===this.type||"radio"===this.type?"checked:":"value:",o=this.name;-1===n.indexOf(i)&&o&&(n+=(n.length?",":"")+i+o,e(this).attr(t,n))})}function o(e){var t,i,o=(e.model.fields||e.model)[e.field],r=n(o),s=o?o.validation:{},l=a.attr("type"),c=a.attr("bind"),h={name:e.field};for(t in s)i=s[t],p(t,_)>=0?h[l]=t:u(i)||(h[t]=f(i)?i.value||t:i),h[a.attr(t+"-msg")]=i.message;return p(r,_)>=0&&(h[l]=r),h[c]=("boolean"===r?"checked:":"value:")+e.field,h}function r(e){var t,n,i,o,r,s;if(e&&e.length)for(s=[],t=0,n=e.length;n>t;t++)i=e[t],r=i.text||i.value||i,o=null==i.value?i.text||i:i.value,s[t]={text:r,value:o};return s}function s(e,t){var n,i,o=e?e.validation||{}:{};for(n in o)i=o[n],f(i)&&i.value&&(i=i.value),u(i)&&(t[n]=i)}var a=window.kendo,l=a.ui,c=l.Widget,h=e.extend,d=a.support.browser.msie&&9>a.support.browser.version,u=a.isFunction,f=e.isPlainObject,p=e.inArray,g=/("|\%|'|\[|\]|\$|\.|\,|\:|\;|\+|\*|\&|\!|\#|\(|\)|<|>|\=|\?|\@|\^|\{|\}|\~|\/|\||`)/g,m='<div class="k-widget k-tooltip k-tooltip-validation" style="margin:0.5em"><span class="k-icon k-warning"> </span>#=message#<div class="k-callout k-callout-n"></div></div>',v="change",_=["url","email","number","date","boolean"],w={number:function(t,n){var i=o(n);e('<input type="text"/>').attr(i).appendTo(t).kendoNumericTextBox({format:n.format}),e("<span "+a.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},date:function(t,n){var i=o(n),r=n.format;r&&(r=a._extractFormat(r)),i[a.attr("format")]=r,e('<input type="text"/>').attr(i).appendTo(t).kendoDatePicker({format:n.format}),e("<span "+a.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},string:function(t,n){var i=o(n);e('<input type="text" class="k-input k-textbox"/>').attr(i).appendTo(t)},"boolean":function(t,n){var i=o(n);e('<input type="checkbox" />').attr(i).appendTo(t)},values:function(t,n){var i=o(n);e("<select "+a.attr("text-field")+'="text"'+a.attr("value-field")+'="value"'+a.attr("source")+"='"+a.stringify(r(n.values)).replace(/\'/g,"&apos;")+"'"+a.attr("role")+'="dropdownlist"/>').attr(i).appendTo(t),e("<span "+a.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)}},y=c.extend({init:function(t,n){var i=this;n.target&&(n.$angular=n.target.options.$angular),c.fn.init.call(i,t,n),i._validateProxy=e.proxy(i._validate,i),i.refresh()},events:[v],options:{name:"Editable",editors:w,clearContainer:!0,errorTemplate:m},editor:function(e,t){var i=this,o=i.options.editors,r=f(e),s=r?e.field:e,l=i.options.model||{},c=r&&e.values,d=c?"values":n(t),u=r&&e.editor,p=u?e.editor:o[d],m=i.element.find("["+a.attr("container-for")+"="+s.replace(g,"\\$1")+"]");p=p?p:o.string,u&&"string"==typeof e.editor&&(p=function(t){t.append(e.editor)}),m=m.length?m:i.element,p(m,h(!0,{},r?e:{field:s},{model:l}))},_validate:function(t){var n,i=this,o=t.value,r=i._validationEventInProgress,s={},l=a.attr("bind"),c=t.field.replace(g,"\\$1"),h=RegExp("(value|checked)\\s*:\\s*"+c+"\\s*(,|$)");s[t.field]=t.value,n=e(":input["+l+'*="'+c+'"]',i.element).filter("["+a.attr("validate")+"!='false']").filter(function(){return h.test(e(this).attr(l))}),n.length>1&&(n=n.filter(function(){var t=e(this);return!t.is(":radio")||t.val()==o}));try{i._validationEventInProgress=!0,(!i.validatable.validateInput(n)||!r&&i.trigger(v,{values:s}))&&t.preventDefault()}finally{i._validationEventInProgress=!1}},end:function(){return this.validatable.validate()},destroy:function(){var e=this;e.angular("cleanup",function(){return{elements:e.element}}),c.fn.destroy.call(e),e.options.model.unbind("set",e._validateProxy),a.unbind(e.element),e.validatable&&e.validatable.destroy(),a.destroy(e.element),e.element.removeData("kendoValidator")},refresh:function(){var n,o,r,l,c,h,u,p,g=this,m=g.options.fields||[],v=g.options.clearContainer?g.element.empty():g.element,_=g.options.model||{},w={};for(e.isArray(m)||(m=[m]),n=0,o=m.length;o>n;n++)r=m[n],l=f(r),c=l?r.field:r,h=(_.fields||_)[c],s(h,w),g.editor(r,h);if(g.options.target&&g.angular("compile",function(){return{elements:v,data:[{dataItem:_}]}}),!o){u=_.fields||_;for(c in u)s(u[c],w)}i(v),g.validatable&&g.validatable.destroy(),a.bind(v,g.options.model),g.options.model.unbind("set",g._validateProxy),g.options.model.bind("set",g._validateProxy),g.validatable=new a.ui.Validator(v,{validateOnBlur:!1,errorTemplate:g.options.errorTemplate||t,rules:w}),p=v.find(":kendoFocusable").eq(0).focus(),d&&p.focus()}});l.plugin(y)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});;
/*
* Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.core.min","./kendo.userevents.min"],e)}(function(){return function(e,t){function n(t,n){try{return e.contains(t,n)||t==n}catch(i){return!1}}function i(e,t){return parseInt(e.css(t),10)||0}function o(e,t){return Math.min(Math.max(e,t.min),t.max)}function r(e,t){var n=A(e),o=n.left+i(e,"borderLeftWidth")+i(e,"paddingLeft"),r=n.top+i(e,"borderTopWidth")+i(e,"paddingTop"),s=o+e.width()-t.outerWidth(!0),a=r+e.height()-t.outerHeight(!0);return{x:{min:o,max:s},y:{min:r,max:a}}}function s(n,i,o){for(var r,s,a=0,l=i&&i.length,c=o&&o.length;n&&n.parentNode;){for(a=0;l>a;a++)if(r=i[a],r.element[0]===n)return{target:r,targetElement:n};for(a=0;c>a;a++)if(s=o[a],e.contains(s.element[0],n)&&w.matchesSelector.call(n,s.options.filter))return{target:s,targetElement:n};n=n.parentNode}return t}function a(e,t){var n,i=t.options.group,o=e[i];if(k.fn.destroy.call(t),o.length>1){for(n=0;o.length>n;n++)if(o[n]==t){o.splice(n,1);break}}else o.length=0,delete e[i]}function l(e){var t,n,i,o=y.body;return e[0]===o?(n=o.scrollTop,i=o.scrollLeft,{top:n,left:i,bottom:n+b.height(),right:i+b.width()}):(t=e.offset(),t.bottom=t.top+e.height(),t.right=t.left+e.width(),t)}function c(e){return e===y.body||e===y.documentElement||e===y}function h(t){if(!t||c(t))return e(y.body);for(var n=e(t)[0];!_.isScrollable(n)&&!c(n);)n=n.parentNode;return e(n)}function d(e,t,n){var i={x:0,y:0},o=50;return o>e-n.left?i.x=-(o-(e-n.left)):o>n.right-e&&(i.x=o-(n.right-e)),o>t-n.top?i.y=-(o-(t-n.top)):o>n.bottom-t&&(i.y=o-(n.bottom-t)),i}var u,f,p,g,m,v,_=window.kendo,w=_.support,y=window.document,b=e(window),x=_.Class,k=_.ui.Widget,C=_.Observable,S=_.UserEvents,T=e.proxy,D=e.extend,A=_.getOffset,P={},M={},E={},I=_.elementUnderCursor,B="keyup",z="change",L="dragstart",R="hold",F="drag",O="dragend",V="dragcancel",N="hintDestroyed",H="dragenter",U="dragleave",j="drop",W=C.extend({init:function(t,n){var i=this,o=t[0];i.capture=!1,o.addEventListener?(e.each(_.eventMap.down.split(" "),function(){o.addEventListener(this,T(i._press,i),!0)}),e.each(_.eventMap.up.split(" "),function(){o.addEventListener(this,T(i._release,i),!0)})):(e.each(_.eventMap.down.split(" "),function(){o.attachEvent(this,T(i._press,i))}),e.each(_.eventMap.up.split(" "),function(){o.attachEvent(this,T(i._release,i))})),C.fn.init.call(i),i.bind(["press","release"],n||{})},captureNext:function(){this.capture=!0},cancelCapture:function(){this.capture=!1},_press:function(e){var t=this;t.trigger("press"),t.capture&&e.preventDefault()},_release:function(e){var t=this;t.trigger("release"),t.capture&&(e.preventDefault(),t.cancelCapture())}}),G=C.extend({init:function(t){var n=this;C.fn.init.call(n),n.forcedEnabled=!1,e.extend(n,t),n.scale=1,n.horizontal?(n.measure="offsetWidth",n.scrollSize="scrollWidth",n.axis="x"):(n.measure="offsetHeight",n.scrollSize="scrollHeight",n.axis="y")},makeVirtual:function(){e.extend(this,{virtual:!0,forcedEnabled:!0,_virtualMin:0,_virtualMax:0})},virtualSize:function(e,t){(this._virtualMin!==e||this._virtualMax!==t)&&(this._virtualMin=e,this._virtualMax=t,this.update())},outOfBounds:function(e){return e>this.max||this.min>e},forceEnabled:function(){this.forcedEnabled=!0},getSize:function(){return this.container[0][this.measure]},getTotal:function(){return this.element[0][this.scrollSize]},rescale:function(e){this.scale=e},update:function(e){var t=this,n=t.virtual?t._virtualMax:t.getTotal(),i=n*t.scale,o=t.getSize();(0!==n||t.forcedEnabled)&&(t.max=t.virtual?-t._virtualMin:0,t.size=o,t.total=i,t.min=Math.min(t.max,o-i),t.minScale=o/n,t.centerOffset=(i-o)/2,t.enabled=t.forcedEnabled||i>o,e||t.trigger(z,t))}}),q=C.extend({init:function(e){var t=this;C.fn.init.call(t),t.x=new G(D({horizontal:!0},e)),t.y=new G(D({horizontal:!1},e)),t.container=e.container,t.forcedMinScale=e.minScale,t.maxScale=e.maxScale||100,t.bind(z,e)},rescale:function(e){this.x.rescale(e),this.y.rescale(e),this.refresh()},centerCoordinates:function(){return{x:Math.min(0,-this.x.centerOffset),y:Math.min(0,-this.y.centerOffset)}},refresh:function(){var e=this;e.x.update(),e.y.update(),e.enabled=e.x.enabled||e.y.enabled,e.minScale=e.forcedMinScale||Math.min(e.x.minScale,e.y.minScale),e.fitScale=Math.max(e.x.minScale,e.y.minScale),e.trigger(z)}}),$=C.extend({init:function(e){var t=this;D(t,e),C.fn.init.call(t)},outOfBounds:function(){return this.dimension.outOfBounds(this.movable[this.axis])},dragMove:function(e){var t=this,n=t.dimension,i=t.axis,o=t.movable,r=o[i]+e;n.enabled&&((n.min>r&&0>e||r>n.max&&e>0)&&(e*=t.resistance),o.translateAxis(i,e),t.trigger(z,t))}}),Y=x.extend({init:function(e){var t,n,i,o,r=this;D(r,{elastic:!0},e),i=r.elastic?.5:0,o=r.movable,r.x=t=new $({axis:"x",dimension:r.dimensions.x,resistance:i,movable:o}),r.y=n=new $({axis:"y",dimension:r.dimensions.y,resistance:i,movable:o}),r.userEvents.bind(["move","end","gesturestart","gesturechange"],{gesturestart:function(e){r.gesture=e,r.offset=r.dimensions.container.offset()},gesturechange:function(e){var i,s,a,l=r.gesture,c=l.center,h=e.center,d=e.distance/l.distance,u=r.dimensions.minScale,f=r.dimensions.maxScale;u>=o.scale&&1>d&&(d+=.8*(1-d)),o.scale*d>=f&&(d=f/o.scale),s=o.x+r.offset.left,a=o.y+r.offset.top,i={x:(s-c.x)*d+h.x-s,y:(a-c.y)*d+h.y-a},o.scaleWith(d),t.dragMove(i.x),n.dragMove(i.y),r.dimensions.rescale(o.scale),r.gesture=e,e.preventDefault()},move:function(e){e.event.target.tagName.match(/textarea|input/i)||(t.dimension.enabled||n.dimension.enabled?(t.dragMove(e.x.delta),n.dragMove(e.y.delta),e.preventDefault()):e.touch.skip())},end:function(e){e.preventDefault()}})}}),Q=w.transitions.prefix+"Transform";f=w.hasHW3D?function(e,t,n){return"translate3d("+e+"px,"+t+"px,0) scale("+n+")"}:function(e,t,n){return"translate("+e+"px,"+t+"px) scale("+n+")"},p=C.extend({init:function(t){var n=this;C.fn.init.call(n),n.element=e(t),n.element[0].style.webkitTransformOrigin="left top",n.x=0,n.y=0,n.scale=1,n._saveCoordinates(f(n.x,n.y,n.scale))},translateAxis:function(e,t){this[e]+=t,this.refresh()},scaleTo:function(e){this.scale=e,this.refresh()},scaleWith:function(e){this.scale*=e,this.refresh()},translate:function(e){this.x+=e.x,this.y+=e.y,this.refresh()},moveAxis:function(e,t){this[e]=t,this.refresh()},moveTo:function(e){D(this,e),this.refresh()},refresh:function(){var e,t=this,n=t.x,i=t.y;t.round&&(n=Math.round(n),i=Math.round(i)),e=f(n,i,t.scale),e!=t.coordinates&&(_.support.browser.msie&&10>_.support.browser.version?(t.element[0].style.position="absolute",t.element[0].style.left=t.x+"px",t.element[0].style.top=t.y+"px"):t.element[0].style[Q]=e,t._saveCoordinates(e),t.trigger(z))},_saveCoordinates:function(e){this.coordinates=e}}),g=k.extend({init:function(e,t){var n,i=this;k.fn.init.call(i,e,t),n=i.options.group,n in M?M[n].push(i):M[n]=[i]},events:[H,U,j],options:{name:"DropTarget",group:"default"},destroy:function(){a(M,this)},_trigger:function(e,n){var i=this,o=P[i.options.group];return o?i.trigger(e,D({},n.event,{draggable:o,dropTarget:n.dropTarget})):t},_over:function(e){this._trigger(H,e)},_out:function(e){this._trigger(U,e)},_drop:function(e){var t=this,n=P[t.options.group];n&&(n.dropped=!t._trigger(j,e))}}),g.destroyGroup=function(e){var t,n=M[e]||E[e];if(n){for(t=0;n.length>t;t++)k.fn.destroy.call(n[t]);n.length=0,delete M[e],delete E[e]}},g._cache=M,m=g.extend({init:function(e,t){var n,i=this;k.fn.init.call(i,e,t),n=i.options.group,n in E?E[n].push(i):E[n]=[i]},destroy:function(){a(E,this)},options:{name:"DropTargetArea",group:"default",filter:null}}),v=k.extend({init:function(e,t){var n=this;k.fn.init.call(n,e,t),n._activated=!1,n.userEvents=new S(n.element,{global:!0,allowSelection:!0,filter:n.options.filter,threshold:n.options.distance,start:T(n._start,n),hold:T(n._hold,n),move:T(n._drag,n),end:T(n._end,n),cancel:T(n._cancel,n),select:T(n._select,n)}),n._afterEndHandler=T(n._afterEnd,n),n._captureEscape=T(n._captureEscape,n)},events:[R,L,F,O,V,N],options:{name:"Draggable",distance:_.support.touch?0:5,group:"default",cursorOffset:null,axis:null,container:null,filter:null,ignore:null,holdToDrag:!1,autoScroll:!1,dropped:!1},cancelHold:function(){this._activated=!1},_captureEscape:function(e){var t=this;e.keyCode===_.keys.ESC&&(t._trigger(V,{event:e}),t.userEvents.cancel())},_updateHint:function(t){var n,i=this,r=i.options,s=i.boundaries,a=r.axis,l=i.options.cursorOffset;l?n={left:t.x.location+l.left,top:t.y.location+l.top}:(i.hintOffset.left+=t.x.delta,i.hintOffset.top+=t.y.delta,n=e.extend({},i.hintOffset)),s&&(n.top=o(n.top,s.y),n.left=o(n.left,s.x)),"x"===a?delete n.top:"y"===a&&delete n.left,i.hint.css(n)},_shouldIgnoreTarget:function(t){var n=this.options.ignore;return n&&e(t).is(n)},_select:function(e){this._shouldIgnoreTarget(e.event.target)||e.preventDefault()},_start:function(n){var i,o=this,s=o.options,a=s.container,l=s.hint;return this._shouldIgnoreTarget(n.touch.initialTouch)||s.holdToDrag&&!o._activated?(o.userEvents.cancel(),t):(o.currentTarget=n.target,o.currentTargetOffset=A(o.currentTarget),l&&(o.hint&&o.hint.stop(!0,!0).remove(),o.hint=_.isFunction(l)?e(l.call(o,o.currentTarget)):l,i=A(o.currentTarget),o.hintOffset=i,o.hint.css({position:"absolute",zIndex:2e4,left:i.left,top:i.top}).appendTo(y.body),o.angular("compile",function(){o.hint.removeAttr("ng-repeat");for(var t=e(n.target);!t.data("$$kendoScope")&&t.length;)t=t.parent();return{elements:o.hint.get(),scopeFrom:t.data("$$kendoScope")}})),P[s.group]=o,o.dropped=!1,a&&(o.boundaries=r(a,o.hint)),e(y).on(B,o._captureEscape),o._trigger(L,n)&&(o.userEvents.cancel(),o._afterEnd()),o.userEvents.capture(),t)},_hold:function(e){this.currentTarget=e.target,this._trigger(R,e)?this.userEvents.cancel():this._activated=!0},_drag:function(n){var i,o,r=this;n.preventDefault(),i=this._elementUnderCursor(n),r._withDropTarget(i,function(i,o){if(!i)return u&&(u._trigger(U,D(n,{dropTarget:e(u.targetElement)})),u=null),t;if(u){if(o===u.targetElement)return;u._trigger(U,D(n,{dropTarget:e(u.targetElement)}))}i._trigger(H,D(n,{dropTarget:e(o)})),u=D(i,{targetElement:o})}),r._trigger(F,D(n,{dropTarget:u,elementUnderCursor:i})),this.options.autoScroll&&(this._cursorElement!==i&&(this._scrollableParent=h(i),this._cursorElement=i),this._scrollableParent[0]&&(o=d(n.x.location,n.y.location,l(this._scrollableParent)),this._scrollCompenstation=e.extend({},this.hintOffset),this._scrollVelocity=o,0===o.y&&0===o.x?(clearInterval(this._scrollInterval),this._scrollInterval=null):this._scrollInterval||(this._scrollInterval=setInterval(e.proxy(this,"_autoScroll"),50)))),r.hint&&r._updateHint(n)},_autoScroll:function(){var e,t,n,i,o,r,s,a=this._scrollableParent[0],l=this._scrollVelocity,c=this._scrollCompenstation;a&&(n=a===y.body,n?(e=y.body.offsetHeight>b.height(),t=y.body.offsetWidth>b.width()):(e=a.scrollHeight>=a.offsetHeight,t=a.scrollWidth>=a.offsetWidth),i=a.scrollTop+l.y,o=e&&i>0&&a.scrollHeight>i,r=a.scrollLeft+l.x,s=t&&r>0&&a.scrollWidth>r,o&&(a.scrollTop+=l.y),s&&(a.scrollLeft+=l.x),n&&(s||o)&&(o&&(c.top+=l.y),s&&(c.left+=l.x),this.hint.css(c)))},_end:function(t){this._withDropTarget(this._elementUnderCursor(t),function(n,i){n&&(n._drop(D({},t,{dropTarget:e(i)})),u=null)}),this._trigger(O,t),this._cancel(t.event)},_cancel:function(){var e=this;e._scrollableParent=null,clearInterval(this._scrollInterval),e._activated=!1,e.hint&&!e.dropped?setTimeout(function(){e.hint.stop(!0,!0).animate(e.currentTargetOffset,"fast",e._afterEndHandler)},0):e._afterEnd()},_trigger:function(e,t){var n=this;return n.trigger(e,D({},t.event,{x:t.x,y:t.y,currentTarget:n.currentTarget,initialTarget:t.touch?t.touch.initialTouch:null,dropTarget:t.dropTarget,elementUnderCursor:t.elementUnderCursor}))},_elementUnderCursor:function(e){var t=I(e),i=this.hint;return i&&n(i[0],t)&&(i.hide(),t=I(e),t||(t=I(e)),i.show()),t},_withDropTarget:function(e,t){var n,i=this.options.group,o=M[i],r=E[i];(o&&o.length||r&&r.length)&&(n=s(e,o,r),n?t(n.target,n.targetElement):t())},destroy:function(){var e=this;k.fn.destroy.call(e),e._afterEnd(),e.userEvents.destroy(),this._scrollableParent=null,this._cursorElement=null,clearInterval(this._scrollInterval),e.currentTarget=null},_afterEnd:function(){var t=this;t.hint&&t.hint.remove(),delete P[t.options.group],t.trigger("destroy"),t.trigger(N),e(y).off(B,t._captureEscape)}}),_.ui.plugin(g),_.ui.plugin(m),_.ui.plugin(v),_.TapCapture=W,_.containerBoundaries=r,D(_.ui,{Pane:Y,PaneDimensions:q,Movable:p}),_.ui.Draggable.utils={autoScrollVelocity:d,scrollableViewPort:l,findScrollableParent:h}}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});;
/*
* Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.draganddrop.min"],e)}(function(){return function(e,t){function n(e){return t!==e}function i(e,t,n){return Math.max(Math.min(parseInt(e,10),1/0===n?n:parseInt(n,10)),parseInt(t,10))}function r(e,t){return function(){var n=this,i=n.wrapper,r=i[0].style,o=n.options;return o.isMaximized||o.isMinimized?n:(n.restoreOptions={width:r.width,height:r.height},i.children(x).hide().end().children(b).find(G).parent().hide().eq(0).before(Z.action({name:"Restore"})),t.call(n),"maximize"==e?n.wrapper.children(b).find(Y).parent().hide():n.wrapper.children(b).find(Y).parent().show(),n)}}function o(){return!this.type||this.type.toLowerCase().indexOf("script")>=0}function a(e){var t=this;t.owner=e,t._draggable=new d(e.wrapper,{filter:">"+x,group:e.wrapper.id+"-resizing",dragstart:p(t.dragstart,t),drag:p(t.drag,t),dragend:p(t.dragend,t)}),t._draggable.userEvents.bind("press",p(t.addOverlay,t)),t._draggable.userEvents.bind("release",p(t.removeOverlay,t))}function s(e,t){var n=this;n.owner=e,n._draggable=new d(e.wrapper,{filter:t,group:e.wrapper.id+"-moving",dragstart:p(n.dragstart,n),drag:p(n.drag,n),dragend:p(n.dragend,n),dragcancel:p(n.dragcancel,n)}),n._draggable.userEvents.stopPropagation=!1}var l=window.kendo,c=l.ui.Widget,d=l.ui.Draggable,u=e.isPlainObject,h=l._activeElement,p=e.proxy,f=e.extend,g=e.each,m=l.template,v="body",_=".kendoWindow",y=".k-window",w=".k-window-title",b=w+"bar",k=".k-window-content",x=".k-resize-handle",C=".k-overlay",S="k-content-frame",T="k-loading",D="k-state-hover",A="k-state-focused",E="k-window-maximized",M=":visible",I="hidden",P="cursor",z="open",F="activate",R="deactivate",B="close",L="refresh",O="resize",H="resizeEnd",N="dragstart",V="dragend",U="error",W="overflow",j="zIndex",G=".k-window-actions .k-i-minimize,.k-window-actions .k-i-maximize",q=".k-i-pin",$=".k-i-unpin",Y=q+","+$,K=".k-window-titlebar .k-window-action",Q=".k-window-titlebar .k-i-refresh",X=l.isLocalUrl,J=c.extend({init:function(i,r){var a,s,d,h,f,g,m,v=this,x={},C=!1,S=r&&r.actions&&!r.actions.length;c.fn.init.call(v,i,r),r=v.options,h=r.position,i=v.element,f=r.content,S&&(r.actions=[]),v.appendTo=e(r.appendTo),v._animations(),f&&!u(f)&&(f=r.content={url:f}),i.find("script").filter(o).remove(),i.parent().is(v.appendTo)||h.top!==t&&h.left!==t||(i.is(M)?(x=i.offset(),C=!0):(s=i.css("visibility"),d=i.css("display"),i.css({visibility:I,display:""}),x=i.offset(),i.css({visibility:s,display:d})),h.top===t&&(h.top=x.top),h.left===t&&(h.left=x.left)),n(r.visible)&&null!==r.visible||(r.visible=i.is(M)),a=v.wrapper=i.closest(y),i.is(".k-content")&&a[0]||(i.addClass("k-window-content k-content"),v._createWindow(i,r),a=v.wrapper=i.closest(y),v._dimensions()),v._position(),r.pinned&&v.pin(!0),f&&v.refresh(f),r.visible&&v.toFront(),g=a.children(k),v._tabindex(g),r.visible&&r.modal&&v._overlay(a.is(M)).css({opacity:.5}),a.on("mouseenter"+_,K,p(v._buttonEnter,v)).on("mouseleave"+_,K,p(v._buttonLeave,v)).on("click"+_,"> "+K,p(v._windowActionHandler,v)),g.on("keydown"+_,p(v._keydown,v)).on("focus"+_,p(v._focus,v)).on("blur"+_,p(v._blur,v)),this._resizable(),this._draggable(),m=i.attr("id"),m&&(m+="_wnd_title",a.children(b).children(w).attr("id",m),g.attr({role:"dialog","aria-labelledby":m})),a.add(a.children(".k-resize-handle,"+b)).on("mousedown"+_,p(v.toFront,v)),v.touchScroller=l.touchScroller(i),v._resizeHandler=p(v._onDocumentResize,v),v._marker=l.guid().substring(0,8),e(window).on("resize"+_+v._marker,v._resizeHandler),r.visible&&(v.trigger(z),v.trigger(F)),l.notify(v)},_buttonEnter:function(t){e(t.currentTarget).addClass(D)},_buttonLeave:function(t){e(t.currentTarget).removeClass(D)},_focus:function(){this.wrapper.addClass(A)},_blur:function(){this.wrapper.removeClass(A)},_dimensions:function(){var e,t,n=this.wrapper,r=this.options,o=r.width,a=r.height,s=r.maxHeight,l=["minWidth","minHeight","maxWidth","maxHeight"];for(this.title(r.title),e=0;l.length>e;e++)t=r[l[e]],t&&1/0!=t&&n.css(l[e],t);s&&1/0!=s&&this.element.css("maxHeight",s),o&&n.width((""+o).indexOf("%")>0?o:i(o,r.minWidth,r.maxWidth)),a&&n.height((""+a).indexOf("%")>0?a:i(a,r.minHeight,r.maxHeight)),r.visible||n.hide()},_position:function(){var e=this.wrapper,t=this.options.position;0===t.top&&(t.top=""+t.top),0===t.left&&(t.left=""+t.left),e.css({top:t.top||"",left:t.left||""})},_animations:function(){var e=this.options;e.animation===!1&&(e.animation={open:{effects:{}},close:{hide:!0,effects:{}}})},_resize:function(){l.resize(this.element.children())},_resizable:function(){var t=this.options.resizable,n=this.wrapper;this.resizing&&(n.off("dblclick"+_).children(x).remove(),this.resizing.destroy(),this.resizing=null),t&&(n.on("dblclick"+_,b,p(function(t){e(t.target).closest(".k-window-action").length||this.toggleMaximization()},this)),g("n e s w se sw ne nw".split(" "),function(e,t){n.append(Z.resizeHandle(t))}),this.resizing=new a(this)),n=null},_draggable:function(){var e=this.options.draggable;this.dragging&&(this.dragging.destroy(),this.dragging=null),e&&(this.dragging=new s(this,e.dragHandle||b))},_actions:function(){var t=this.options.actions,n=this.wrapper.children(b),i=n.find(".k-window-actions");t=e.map(t,function(e){return{name:e}}),i.html(l.render(Z.action,t))},setOptions:function(e){c.fn.setOptions.call(this,e),this.restore(),this._animations(),this._dimensions(),this._position(),this._resizable(),this._draggable(),this._actions()},events:[z,F,R,B,L,O,H,N,V,U],options:{name:"Window",animation:{open:{effects:{zoom:{direction:"in"},fade:{direction:"in"}},duration:350},close:{effects:{zoom:{direction:"out",properties:{scale:.7}},fade:{direction:"out"}},duration:350,hide:!0}},title:"",actions:["Close"],autoFocus:!0,modal:!1,resizable:!0,draggable:!0,minWidth:90,minHeight:50,maxWidth:1/0,maxHeight:1/0,pinned:!1,position:{},content:null,visible:null,height:null,width:null,appendTo:"body"},_closable:function(){return e.inArray("close",e.map(this.options.actions,function(e){return e.toLowerCase()}))>-1},_keydown:function(e){var t,n,r,o,a,s,c=this,d=c.options,u=l.keys,h=e.keyCode,p=c.wrapper,f=10,g=c.options.isMaximized;e.target!=e.currentTarget||c._closing||(h==u.ESC&&c._closable()&&c._close(!1),!d.draggable||e.ctrlKey||g||(t=l.getOffset(p),h==u.UP?n=p.css("top",t.top-f):h==u.DOWN?n=p.css("top",t.top+f):h==u.LEFT?n=p.css("left",t.left-f):h==u.RIGHT&&(n=p.css("left",t.left+f))),d.resizable&&e.ctrlKey&&!g&&(h==u.UP?(n=!0,o=p.height()-f):h==u.DOWN&&(n=!0,o=p.height()+f),h==u.LEFT?(n=!0,r=p.width()-f):h==u.RIGHT&&(n=!0,r=p.width()+f),n&&(a=i(r,d.minWidth,d.maxWidth),s=i(o,d.minHeight,d.maxHeight),isNaN(a)||(p.width(a),c.options.width=a+"px"),isNaN(s)||(p.height(s),c.options.height=s+"px"),c.resize())),n&&e.preventDefault())},_overlay:function(t){var n=this.appendTo.children(C),i=this.wrapper;return n.length||(n=e("<div class='k-overlay' />")),n.insertBefore(i[0]).toggle(t).css(j,parseInt(i.css(j),10)-1),n},_actionForIcon:function(e){var t=/\bk-i-\w+\b/.exec(e[0].className)[0];return{"k-i-close":"_close","k-i-maximize":"maximize","k-i-minimize":"minimize","k-i-restore":"restore","k-i-refresh":"refresh","k-i-pin":"pin","k-i-unpin":"unpin"}[t]},_windowActionHandler:function(n){var i,r;if(!this._closing)return i=e(n.target).closest(".k-window-action").find(".k-icon"),r=this._actionForIcon(i),r?(n.preventDefault(),this[r](),!1):t},_modals:function(){var t=this,n=e(y).filter(function(){var n=e(this),i=t._object(n),r=i&&i.options;return r&&r.modal&&r.visible&&n.is(M)}).sort(function(t,n){return+e(t).css("zIndex")-+e(n).css("zIndex")});return t=null,n},_object:function(e){var n=e.children(k),i=l.widgetInstance(n);return i instanceof J?i:t},center:function(){var t,n,i=this,r=i.options.position,o=i.wrapper,a=e(window),s=0,l=0;return i.options.isMaximized?i:(i.options.pinned||(s=a.scrollTop(),l=a.scrollLeft()),n=l+Math.max(0,(a.width()-o.width())/2),t=s+Math.max(0,(a.height()-o.height()-parseInt(o.css("paddingTop"),10))/2),o.css({left:n,top:t}),r.top=t,r.left=n,i)},title:function(e){var t,n=this,i=n.wrapper,r=n.options,o=i.children(b),a=o.children(w);return arguments.length?(e===!1?(i.addClass("k-window-titleless"),o.remove()):(o.length?a.html(e):(i.prepend(Z.titlebar(r)),n._actions(),o=i.children(b)),t=o.outerHeight(),i.css("padding-top",t),o.css("margin-top",-t)),n.options.title=e,n):a.text()},content:function(e,t){var i=this.wrapper.children(k),r=i.children(".km-scroll-container");return i=r[0]?r:i,n(e)?(this.angular("cleanup",function(){return{elements:i.children()}}),l.destroy(this.element.children()),i.empty().html(e),this.angular("compile",function(){var e,n=[];for(e=i.length;--e>=0;)n.push({dataItem:t});return{elements:i.children(),data:n}}),this):i.html()},open:function(){var t,n,i=this,r=i.wrapper,o=i.options,a=o.animation.open,s=r.children(k),c=e(document);return i.trigger(z)||(i._closing&&r.kendoStop(!0,!0),i._closing=!1,i.toFront(),o.autoFocus&&i.element.focus(),o.visible=!0,o.modal&&(t=i._overlay(!1),t.kendoStop(!0,!0),a.duration&&l.effects.Fade?(n=l.fx(t).fadeIn(),n.duration(a.duration||0),n.endValue(.5),n.play()):t.css("opacity",.5),t.show()),r.is(M)||(s.css(W,I),r.show().kendoStop().kendoAnimate({effects:a.effects,duration:a.duration,complete:p(this._activate,this)}))),o.isMaximized&&(i._documentScrollTop=c.scrollTop(),i._documentScrollLeft=c.scrollLeft(),e("html, body").css(W,I)),i},_activate:function(){this.options.autoFocus&&this.element.focus(),this.trigger(F),this.wrapper.children(k).css(W,"")},_removeOverlay:function(n){var i,r=this._modals(),o=this.options,a=o.modal&&!r.length,s=o.modal?this._overlay(!0):e(t),c=o.animation.close;a?!n&&c.duration&&l.effects.Fade?(i=l.fx(s).fadeOut(),i.duration(c.duration||0),i.startValue(.5),i.play()):this._overlay(!1).remove():r.length&&this._object(r.last())._overlay(!0)},_close:function(t){var n=this,i=n.wrapper,r=n.options,o=r.animation.open,a=r.animation.close,s=e(document);if(i.is(M)&&!n.trigger(B,{userTriggered:!t})){if(n._closing)return;n._closing=!0,r.visible=!1,e(y).each(function(t,n){var r=e(n).children(k);n!=i&&r.find("> ."+S).length>0&&r.children(C).remove()}),this._removeOverlay(),i.kendoStop().kendoAnimate({effects:a.effects||o.effects,reverse:a.reverse===!0,duration:a.duration,complete:p(this._deactivate,this)})}n.options.isMaximized&&(e("html, body").css(W,""),n._documentScrollTop&&n._documentScrollTop>0&&s.scrollTop(n._documentScrollTop),n._documentScrollLeft&&n._documentScrollLeft>0&&s.scrollLeft(n._documentScrollLeft))},_deactivate:function(){var e,t=this;t.wrapper.hide().css("opacity",""),t.trigger(R),t.options.modal&&(e=t._object(t._modals().last()),e&&e.toFront())},close:function(){return this._close(!0),this},_actionable:function(t){return e(t).is(K+","+K+" .k-icon,:input,a")},_shouldFocus:function(t){var n=h(),i=this.element;return!(!this.options.autoFocus||e(n).is(i)||this._actionable(t)||i.find(n).length&&i.find(t).length)},toFront:function(t){var n,i,r=this,o=r.wrapper,a=o[0],s=+o.css(j),l=s,c=t&&t.target||null;return e(y).each(function(t,n){var i=e(n),r=i.css(j),o=i.children(k);isNaN(r)||(s=Math.max(+r,s)),n!=a&&o.find("> ."+S).length>0&&o.append(Z.overlay)}),(!o[0].style.zIndex||s>l)&&o.css(j,s+2),r.element.find("> .k-overlay").remove(),r._shouldFocus(c)&&(r.element.focus(),n=e(window).scrollTop(),i=parseInt(o.position().top,10),i>0&&n>i&&(n>0?e(window).scrollTop(i):o.css("top",n))),o=null,r},toggleMaximization:function(){return this._closing?this:this[this.options.isMaximized?"restore":"maximize"]()},restore:function(){var t=this,n=t.options,i=n.minHeight,r=t.restoreOptions,o=e(document);return n.isMaximized||n.isMinimized?(i&&1/0!=i&&t.wrapper.css("min-height",i),t.wrapper.css({position:n.pinned?"fixed":"absolute",left:r.left,top:r.top,width:r.width,height:r.height}).removeClass(E).find(".k-window-content,.k-resize-handle").show().end().find(".k-window-titlebar .k-i-restore").parent().remove().end().end().find(G).parent().show().end().end().find(Y).parent().show(),t.options.width=r.width,t.options.height=r.height,e("html, body").css(W,""),this._documentScrollTop&&this._documentScrollTop>0&&o.scrollTop(this._documentScrollTop),this._documentScrollLeft&&this._documentScrollLeft>0&&o.scrollLeft(this._documentScrollLeft),n.isMaximized=n.isMinimized=!1,t.resize(),t):t},maximize:r("maximize",function(){var t=this,n=t.wrapper,i=n.position(),r=e(document);f(t.restoreOptions,{left:i.left,top:i.top}),n.css({left:0,top:0,position:"fixed"}).addClass(E),this._documentScrollTop=r.scrollTop(),this._documentScrollLeft=r.scrollLeft(),e("html, body").css(W,I),t.options.isMaximized=!0,t._onDocumentResize()}),minimize:r("minimize",function(){var e=this;e.wrapper.css({height:"",minHeight:""}),e.element.hide(),e.options.isMinimized=!0}),pin:function(t){var n=this,i=e(window),r=n.wrapper,o=parseInt(r.css("top"),10),a=parseInt(r.css("left"),10);(t||!n.options.pinned&&!n.options.isMaximized)&&(r.css({position:"fixed",top:o-i.scrollTop(),left:a-i.scrollLeft()}),r.children(b).find(q).addClass("k-i-unpin").removeClass("k-i-pin"),n.options.pinned=!0)},unpin:function(){var t=this,n=e(window),i=t.wrapper,r=parseInt(i.css("top"),10),o=parseInt(i.css("left"),10);t.options.pinned&&!t.options.isMaximized&&(i.css({position:"",top:r+n.scrollTop(),left:o+n.scrollLeft()}),i.children(b).find($).addClass("k-i-pin").removeClass("k-i-unpin"),t.options.pinned=!1)},_onDocumentResize:function(){var t,n,i=this,r=i.wrapper,o=e(window),a=l.support.zoomLevel();i.options.isMaximized&&(t=o.width()/a,n=o.height()/a-parseInt(r.css("padding-top"),10),r.css({width:t,height:n}),i.options.width=t,i.options.height=n,i.resize())},refresh:function(t){var i,r,o,a=this,s=a.options,l=e(a.element);return u(t)||(t={url:t}),t=f({},s.content,t),r=n(s.iframe)?s.iframe:t.iframe,o=t.url,o?(n(r)||(r=!X(o)),r?(i=l.find("."+S)[0],i?i.src=o||i.src:l.html(Z.contentFrame(f({},s,{content:t}))),l.find("."+S).unbind("load"+_).on("load"+_,p(this._triggerRefresh,this))):a._ajaxRequest(t)):(t.template&&a.content(m(t.template)({})),a.trigger(L)),l.toggleClass("k-window-iframecontent",!!r),a},_triggerRefresh:function(){this.trigger(L)},_ajaxComplete:function(){clearTimeout(this._loadingIconTimeout),this.wrapper.find(Q).removeClass(T)},_ajaxError:function(e,t){this.trigger(U,{status:t,xhr:e})},_ajaxSuccess:function(e){return function(t){var n=t;e&&(n=m(e)(t||{})),this.content(n,t),this.element.prop("scrollTop",0),this.trigger(L)}},_showLoading:function(){this.wrapper.find(Q).addClass(T)},_ajaxRequest:function(t){this._loadingIconTimeout=setTimeout(p(this._showLoading,this),100),e.ajax(f({type:"GET",dataType:"html",cache:!1,error:p(this._ajaxError,this),complete:p(this._ajaxComplete,this),success:p(this._ajaxSuccess(t.template),this)},t))},_destroy:function(){this.resizing&&this.resizing.destroy(),this.dragging&&this.dragging.destroy(),this.wrapper.off(_).children(k).off(_).end().find(".k-resize-handle,.k-window-titlebar").off(_),e(window).off("resize"+_+this._marker),clearTimeout(this._loadingIconTimeout),c.fn.destroy.call(this),this.unbind(t),l.destroy(this.wrapper),this._removeOverlay(!0)},destroy:function(){this._destroy(),this.wrapper.empty().remove(),this.wrapper=this.appendTo=this.element=e()},_createWindow:function(){var t,n,i=this.element,r=this.options,o=l.support.isRtl(i);r.scrollable===!1&&i.attr("style","overflow:hidden;"),n=e(Z.wrapper(r)),t=i.find("iframe:not(.k-content)").map(function(){var e=this.getAttribute("src");return this.src="",e}),n.toggleClass("k-rtl",o).appendTo(this.appendTo).append(i).find("iframe:not(.k-content)").each(function(e){this.src=t[e]}),n.find(".k-window-title").css(o?"left":"right",n.find(".k-window-actions").outerWidth()+10),i.css("visibility","").show(),i.find("[data-role=editor]").each(function(){var t=e(this).data("kendoEditor");t&&t.refresh()}),n=i=null}}),Z={wrapper:m("<div class='k-widget k-window' />"),action:m("<a role='button' href='\\#' class='k-window-action k-link'><span role='presentation' class='k-icon k-i-#= name.toLowerCase() #'>#= name #</span></a>"),titlebar:m("<div class='k-window-titlebar k-header'>&nbsp;<span class='k-window-title'>#= title #</span><div class='k-window-actions' /></div>"),overlay:"<div class='k-overlay' />",contentFrame:m("<iframe frameborder='0' title='#= title #' class='"+S+"' src='#= content.url #'>This page requires frames in order to show content</iframe>"),resizeHandle:m("<div class='k-resize-handle k-resize-#= data #'></div>")};a.prototype={addOverlay:function(){this.owner.wrapper.append(Z.overlay)},removeOverlay:function(){this.owner.wrapper.find(C).remove()},dragstart:function(t){var n=this,i=n.owner,r=i.wrapper;n.elementPadding=parseInt(r.css("padding-top"),10),n.initialPosition=l.getOffset(r,"position"),n.resizeDirection=t.currentTarget.prop("className").replace("k-resize-handle k-resize-",""),n.initialSize={width:r.width(),height:r.height()},n.containerOffset=l.getOffset(i.appendTo,"position"),r.children(x).not(t.currentTarget).hide(),e(v).css(P,t.currentTarget.css(P))},drag:function(e){var t,n,r,o,a=this,s=a.owner,l=s.wrapper,c=s.options,d=a.resizeDirection,u=a.containerOffset,h=a.initialPosition,p=a.initialSize,f=Math.max(e.x.location,u.left),g=Math.max(e.y.location,u.top);d.indexOf("e")>=0?(t=f-h.left,l.width(i(t,c.minWidth,c.maxWidth))):d.indexOf("w")>=0&&(o=h.left+p.width,t=i(o-f,c.minWidth,c.maxWidth),l.css({left:o-t-u.left,width:t})),d.indexOf("s")>=0?(n=g-h.top-a.elementPadding,l.height(i(n,c.minHeight,c.maxHeight))):d.indexOf("n")>=0&&(r=h.top+p.height,n=i(r-g,c.minHeight,c.maxHeight),l.css({top:r-n-u.top,height:n})),t&&(s.options.width=t+"px"),n&&(s.options.height=n+"px"),s.resize()},dragend:function(t){var n=this,i=n.owner,r=i.wrapper;return r.children(x).not(t.currentTarget).show(),e(v).css(P,""),i.touchScroller&&i.touchScroller.reset(),27==t.keyCode&&r.css(n.initialPosition).css(n.initialSize),i.trigger(H),!1},destroy:function(){this._draggable&&this._draggable.destroy(),this._draggable=this.owner=null}},s.prototype={dragstart:function(t){var n=this.owner,i=n.element,r=i.find(".k-window-actions"),o=l.getOffset(n.appendTo);n.trigger(N),n.initialWindowPosition=l.getOffset(n.wrapper,"position"),n.startPosition={left:t.x.client-n.initialWindowPosition.left,top:t.y.client-n.initialWindowPosition.top},n.minLeftPosition=r.length>0?r.outerWidth()+parseInt(r.css("right"),10)-i.outerWidth():20-i.outerWidth(),n.minLeftPosition-=o.left,n.minTopPosition=-o.top,n.wrapper.append(Z.overlay).children(x).hide(),e(v).css(P,t.currentTarget.css(P))},drag:function(t){var n=this.owner,i=n.options.position,r=Math.max(t.y.client-n.startPosition.top,n.minTopPosition),o=Math.max(t.x.client-n.startPosition.left,n.minLeftPosition),a={left:o,top:r};e(n.wrapper).css(a),i.top=r,i.left=o},_finishDrag:function(){var t=this.owner;t.wrapper.children(x).toggle(!t.options.isMinimized).end().find(C).remove(),e(v).css(P,"")},dragcancel:function(e){this._finishDrag(),e.currentTarget.closest(y).css(this.owner.initialWindowPosition)},dragend:function(){return this._finishDrag(),this.owner.trigger(V),!1},destroy:function(){this._draggable&&this._draggable.destroy(),this._draggable=this.owner=null}},l.ui.plugin(J)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});;
/*
* Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.datepicker.min","./kendo.numerictextbox.min","./kendo.dropdownlist.min","./kendo.binder.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}))}function i(e){var t,n,i,o,r,s;if(e&&e.length)for(s=[],t=0,n=e.length;n>t;t++)i=e[t],r=i.text||i.value||i,o=null==i.value?i.text||i:i.value,s[t]={text:r,value:o};return s}function o(t,n){return e.grep(t,function(t){return t.filters?(t.filters=e.grep(t.filters,function(e){return e.field!=n}),t.filters.length):t.field!=n})}function r(t,n){t.filters&&(t.filters=e.grep(t.filters,function(e){return r(e,n),e.filters?e.filters.length:e.field==n&&"eq"==e.operator}))}function s(n){return"and"==n.logic&&n.filters.length>1?[]:n.filters?e.map(n.filters,function(e){return s(e)}):null!==n.value&&n.value!==t?[n.value]:[]}function a(e,n){for(var i,o,r=c.getter(n,!0),s=[],a=0,l={};e.length>a;)i=e[a++],o=r(i),o===t||null===o||l.hasOwnProperty(o)||(s.push(i),l[o]=!0);return s}function l(e,t){return function(n){var i=e(n);return a(i,t)}}var c=window.kendo,h=c.ui,d=e.proxy,u="kendoPopup",f="init",p="refresh",g="change",m=".kendoFilterMenu",v="Is equal to",_="Is not equal to",y={number:"numerictextbox",date:"datepicker"},w={string:"text",number:"number",date:"date"},b=c.isFunction,x=h.Widget,k='<div><div class="k-filter-help-text">#=messages.info#</div><label><input type="radio" data-#=ns#bind="checked: filters[0].value" value="true" name="filters[0].value"/>#=messages.isTrue#</label><label><input type="radio" data-#=ns#bind="checked: filters[0].value" value="false" name="filters[0].value"/>#=messages.isFalse#</label><div><button type="submit" class="k-button k-primary">#=messages.filter#</button><button type="reset" class="k-button">#=messages.clear#</button></div></div>',C='<div><div class="k-filter-help-text">#=messages.info#</div><select data-#=ns#bind="value: filters[0].operator" data-#=ns#role="dropdownlist">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select>#if(values){#<select data-#=ns#bind="value:filters[0].value" data-#=ns#text-field="text" data-#=ns#value-field="value" data-#=ns#source=\'#=kendo.stringify(values).replace(/\'/g,"&\\#39;")#\' data-#=ns#role="dropdownlist" data-#=ns#option-label="#=messages.selectValue#" data-#=ns#value-primitive="true"></select>#}else{#<input data-#=ns#bind="value:filters[0].value" class="k-textbox" type="text" #=role ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}##if(extra){#<select class="k-filter-and" data-#=ns#bind="value: logic" data-#=ns#role="dropdownlist"><option value="and">#=messages.and#</option><option value="or">#=messages.or#</option></select><select data-#=ns#bind="value: filters[1].operator" data-#=ns#role="dropdownlist">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select>#if(values){#<select data-#=ns#bind="value:filters[1].value" data-#=ns#text-field="text" data-#=ns#value-field="value" data-#=ns#source=\'#=kendo.stringify(values).replace(/\'/g,"&\\#39;")#\' data-#=ns#role="dropdownlist" data-#=ns#option-label="#=messages.selectValue#" data-#=ns#value-primitive="true"></select>#}else{#<input data-#=ns#bind="value: filters[1].value" class="k-textbox" type="text" #=role ? "data-" + ns + "role=\'" + role + "\'" : ""#/>#}##}#<div><button type="submit" class="k-button k-primary">#=messages.filter#</button><button type="reset" class="k-button">#=messages.clear#</button></div></div>',S='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-cancel">#=messages.cancel#</button>#=title#<button type="submit" class="k-button k-submit">#=messages.filter#</button></div><form class="k-filter-menu k-mobile-list"><ul class="k-filter-help-text"><li><span class="k-link">#=messages.info#</span><ul><li class="k-item"><label class="k-label">#=messages.operator#<select data-#=ns#bind="value: filters[0].operator">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select></label></li><li class="k-item"><label class="k-label">#=messages.value##if(values){#<select data-#=ns#bind="value:filters[0].value"><option value="">#=messages.selectValue#</option>#for(var val in values){#<option value="#=values[val].value#">#=values[val].text#</option>#}#</select>#}else{#<input data-#=ns#bind="value:filters[0].value" class="k-textbox" type="#=inputType#" #=useRole ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}#</label></li>#if(extra){#</ul><ul class="k-filter-help-text"><li><span class="k-link"></span><li class="k-item"><label class="k-label"><input type="radio" name="logic" class="k-check" data-#=ns#bind="checked: logic" value="and" />#=messages.and#</label></li><li class="k-item"><label class="k-label"><input type="radio" name="logic" class="k-check" data-#=ns#bind="checked: logic" value="or" />#=messages.or#</label></li></ul><ul class="k-filter-help-text"><li><span class="k-link"></span><li class="k-item"><label class="k-label">#=messages.operator#<select data-#=ns#bind="value: filters[1].operator">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select></label></li><li class="k-item"><label class="k-label">#=messages.value##if(values){#<select data-#=ns#bind="value:filters[1].value"><option value="">#=messages.selectValue#</option>#for(var val in values){#<option value="#=values[val].value#">#=values[val].text#</option>#}#</select>#}else{#<input data-#=ns#bind="value:filters[1].value" class="k-textbox" type="#=inputType#" #=useRole ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}#</label></li>#}#</ul></li><li class="k-button-container"><button type="reset" class="k-button">#=messages.clear#</button></li></ul></div></form></div>',T='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-cancel">#=messages.cancel#</button>#=title#<button type="submit" class="k-button k-submit">#=messages.filter#</button></div><form class="k-filter-menu k-mobile-list"><ul class="k-filter-help-text"><li><span class="k-link">#=messages.info#</span><ul><li class="k-item"><label class="k-label"><input class="k-check" type="radio" data-#=ns#bind="checked: filters[0].value" value="true" name="filters[0].value"/>#=messages.isTrue#</label></li><li class="k-item"><label class="k-label"><input class="k-check" type="radio" data-#=ns#bind="checked: filters[0].value" value="false" name="filters[0].value"/>#=messages.isFalse#</label></li></ul></li><li class="k-button-container"><button type="reset" class="k-button">#=messages.clear#</button></li></ul></form></div>',A=x.extend({init:function(t,n){var i,o,r,s,a=this,l="string";x.fn.init.call(a,t,n),i=a.operators=n.operators||{},t=a.element,n=a.options,n.appendToElement||(r=t.addClass("k-with-icon k-filterable").find(".k-grid-filter"),r[0]||(r=t.prepend('<a class="k-grid-filter" href="#"><span class="k-icon k-filter"/></a>').find(".k-grid-filter")),r.attr("tabindex",-1).on("click"+m,d(a._click,a))),a.link=r||e(),a.dataSource=n.dataSource,a.field=n.field||t.attr(c.attr("field")),a.model=a.dataSource.reader.model,a._parse=function(e){return e+""},a.model&&a.model.fields&&(s=a.model.fields[a.field],s&&(l=s.type||"string",s.parse&&(a._parse=d(s.parse,s)))),n.values&&(l="enums"),a.type=l,i=i[l]||n.operators[l];for(o in i)break;a._defaultFilter=function(){return{field:a.field,operator:o||"eq",value:""}},a._refreshHandler=d(a.refresh,a),a.dataSource.bind(g,a._refreshHandler),n.appendToElement?a._init():a.refresh()},_init:function(){var t,n=this,i=n.options.ui,o=b(i);n.pane=n.options.pane,n.pane&&(n._isMobile=!0),o||(t=i||y[n.type]),n._isMobile?n._createMobileForm(t):n._createForm(t),n.form.on("submit"+m,d(n._submit,n)).on("reset"+m,d(n._reset,n)),o&&n.form.find(".k-textbox").removeClass("k-textbox").each(function(){i(e(this))}),n.form.find("["+c.attr("role")+"=numerictextbox]").removeClass("k-textbox").end().find("["+c.attr("role")+"=datetimepicker]").removeClass("k-textbox").end().find("["+c.attr("role")+"=timepicker]").removeClass("k-textbox").end().find("["+c.attr("role")+"=datepicker]").removeClass("k-textbox"),n.refresh(),n.trigger(f,{field:n.field,container:n.form}),c.cycleForm(n.form)},_createForm:function(t){var n=this,o=n.options,r=n.operators||{},s=n.type;r=r[s]||o.operators[s],n.form=e('<form class="k-filter-menu"/>').html(c.template("boolean"===s?k:C)({field:n.field,format:o.format,ns:c.ns,messages:o.messages,extra:o.extra,operators:r,type:s,role:t,values:i(o.values)})),o.appendToElement?(n.element.append(n.form),n.popup=n.element.closest(".k-popup").data(u)):n.popup=n.form[u]({anchor:n.link,open:d(n._open,n),activate:d(n._activate,n),close:function(){n.options.closeCallback&&n.options.closeCallback(n.element)}}).data(u),n.form.on("keydown"+m,d(n._keydown,n))},_createMobileForm:function(t){var n=this,o=n.options,r=n.operators||{},s=n.type;r=r[s]||o.operators[s],n.form=e("<div />").html(c.template("boolean"===s?T:S)({field:n.field,title:o.title||n.field,format:o.format,ns:c.ns,messages:o.messages,extra:o.extra,operators:r,type:s,role:t,useRole:!c.support.input.date&&"date"===s||"number"===s,inputType:w[s],values:i(o.values)})),n.view=n.pane.append(n.form.html()),n.form=n.view.element.find("form"),n.view.element.on("click",".k-submit",function(e){n.form.submit(),e.preventDefault()}).on("click",".k-cancel",function(e){n._closeForm(),e.preventDefault()})},refresh:function(){var e=this,t=e.dataSource.filter()||{filters:[],logic:"and"};e.filterModel=c.observable({logic:"and",filters:[e._defaultFilter(),e._defaultFilter()]}),e.form&&c.bind(e.form.children().first(),e.filterModel),e._bind(t)?e.link.addClass("k-state-active"):e.link.removeClass("k-state-active")},destroy:function(){var e=this;x.fn.destroy.call(e),e.form&&(c.unbind(e.form),c.destroy(e.form),e.form.unbind(m),e.popup&&(e.popup.destroy(),e.popup=null),e.form=null),e.view&&(e.view.purge(),e.view=null),e.link.unbind(m),e._refreshHandler&&(e.dataSource.unbind(g,e._refreshHandler),e.dataSource=null),e.element=e.link=e._refreshHandler=e.filterModel=null},_bind:function(e){var t,n,i,o,r=this,s=e.filters,a=!1,l=0,c=r.filterModel;for(t=0,n=s.length;n>t;t++)o=s[t],o.field==r.field?(c.set("logic",e.logic),i=c.filters[l],i||(c.filters.push({field:r.field}),i=c.filters[l]),i.set("value",r._parse(o.value)),i.set("operator",o.operator),l++,a=!0):o.filters&&(a=a||r._bind(o));return a},_stripFilters:function(t){return e.grep(t,function(e){return""!==e.value&&null!=e.value})},_merge:function(e){var t,i,o,r=this,s=e.logic||"and",a=this._stripFilters(e.filters),l=r.dataSource.filter()||{filters:[],logic:"and"};for(n(l,r.field),i=0,o=a.length;o>i;i++)t=a[i],t.value=r._parse(t.value);return a.length&&(l.filters.length?(e.filters=a,"and"!==l.logic&&(l.filters=[{logic:l.logic,filters:l.filters}],l.logic="and"),l.filters.push(a.length>1?e:a[0])):(l.filters=a,l.logic=s)),l},filter:function(e){e=this._merge(e),e.filters.length&&this.dataSource.filter(e)},clear:function(){var t=this,n=t.dataSource.filter()||{filters:[]};n.filters=e.grep(n.filters,function(e){return e.filters?(e.filters=o(e.filters,t.field),e.filters.length):e.field!=t.field}),n.filters.length||(n=null),t.dataSource.filter(n)},_submit:function(e){e.preventDefault(),e.stopPropagation(),this.filter(this.filterModel.toJSON()),this._closeForm()},_reset:function(){this.clear(),this._closeForm()},_closeForm:function(){this._isMobile?this.pane.navigate("",this.options.animations.right):this.popup.close()},_click:function(e){e.preventDefault(),e.stopPropagation(),this.popup||this.pane||this._init(),this._isMobile?this.pane.navigate(this.view,this.options.animations.left):this.popup.toggle()},_open:function(){var t;e(".k-filter-menu").not(this.form).each(function(){t=e(this).data(u),t&&t.close()})},_activate:function(){this.form.find(":kendoFocusable:first").focus()},_keydown:function(e){e.keyCode==c.keys.ESC&&this.popup.close()},events:[f],options:{name:"FilterMenu",extra:!0,appendToElement:!1,type:"string",operators:{string:{eq:v,neq:_,startswith:"Starts with",contains:"Contains",doesnotcontain:"Does not contain",endswith:"Ends with"},number:{eq:v,neq:_,gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than"},date:{eq:v,neq:_,gte:"Is after or equal to",gt:"Is after",lte:"Is before or equal to",lt:"Is before"},enums:{eq:v,neq:_}},messages:{info:"Show items with value that:",isTrue:"is true",isFalse:"is false",filter:"Filter",clear:"Clear",and:"And",or:"Or",selectValue:"-Select value-",operator:"Operator",value:"Value",cancel:"Cancel"},animations:{left:"slide",right:"slide:right"}}}),D=".kendoFilterMultiCheck",P=c.data.DataSource,M=x.extend({init:function(t,n){var i,o;x.fn.init.call(this,t,n),n=this.options,this.element=e(t),i=this.field=this.options.field||this.element.attr(c.attr("field")),o=n.checkSource,this._foreignKeyValues()?(this.checkSource=P.create(n.values),this.checkSource.fetch()):n.forceUnique?(o=n.dataSource.options,delete o.pageSize,this.checkSource=P.create(o),this.checkSource.reader.data=l(this.checkSource.reader.data,this.field)):this.checkSource=P.create(o),this.dataSource=n.dataSource,this.model=this.dataSource.reader.model,this._parse=function(e){return e+""},this.model&&this.model.fields&&(i=this.model.fields[this.field],i&&(i.parse&&(this._parse=d(i.parse,i)),this.type=i.type||"string")),n.appendToElement?this._init():this._createLink(),this._refreshHandler=d(this.refresh,this),this.dataSource.bind(g,this._refreshHandler)},_createLink:function(){var e=this.element,t=e.addClass("k-with-icon k-filterable").find(".k-grid-filter");t[0]||(t=e.prepend('<a class="k-grid-filter" href="#"><span class="k-icon k-filter"/></a>').find(".k-grid-filter")),this._link=t.attr("tabindex",-1).on("click"+m,d(this._click,this))},_init:function(){var e=this,t=this.options.forceUnique,n=this.options;this.pane=n.pane,this.pane&&(this._isMobile=!0),this._createForm(),this._foreignKeyValues()?this.refresh():t&&!this.checkSource.options.serverPaging&&this.dataSource.data().length?(this.checkSource.data(a(this.dataSource.data(),this.field)),this.refresh()):(this._attachProgress(),this.checkSource.fetch(function(){e.refresh.call(e)})),this.options.forceUnique||(this.checkChangeHandler=function(){e.container.empty(),e.refresh()},this.checkSource.bind(g,this.checkChangeHandler)),this.form.on("keydown"+D,d(this._keydown,this)).on("submit"+D,d(this._filter,this)).on("reset"+D,d(this._reset,this)),this.trigger(f,{field:this.field,container:this.form})},_attachProgress:function(){var e=this;this._progressHandler=function(){h.progress(e.container,!0)},this._progressHideHandler=function(){h.progress(e.container,!1)},this.checkSource.bind("progress",this._progressHandler).bind("change",this._progressHideHandler)},_createForm:function(){var t,n,i=this.options,o="<ul class='k-reset k-multicheck-wrap'></ul><button type='submit' class='k-button k-primary'>"+i.messages.filter+"</button>";o+="<button type='reset' class='k-button'>"+i.messages.clear+"</button>",this.form=e('<form class="k-filter-menu"/>').html(o),this.container=this.form.find(".k-multicheck-wrap"),this._isMobile?(this.view=this.pane.append(this.form.addClass("k-mobile-list").wrap("<div/>").parent().html()),t=this.view.element,this.form=t.find("form"),this.container=t.find(".k-multicheck-wrap"),n=this,t.on("click",".k-primary",function(e){n.form.submit(),e.preventDefault()}).on("click","[type=reset]",function(e){n._reset(),e.preventDefault()})):i.appendToElement?(this.popup=this.element.closest(".k-popup").data(u),this.element.append(this.form)):this.popup=this.form.kendoPopup({anchor:this._link}).data(u)},createCheckAllItem:function(){var t=this.options,n=c.template(t.itemTemplate({field:"all",mobile:this._isMobile})),i=e(n({all:t.messages.checkAll}));this.container.prepend(i),this.checkBoxAll=i.find(":checkbox").eq(0).addClass("k-check-all"),this.checkAllHandler=d(this.checkAll,this),this.checkBoxAll.on(g+D,this.checkAllHandler)},updateCheckAllState:function(){if(this.checkBoxAll){var e=this.container.find(":checkbox:not(.k-check-all)").length==this.container.find(":checked:not(.k-check-all)").length;this.checkBoxAll.prop("checked",e)}},refresh:function(e){var t=this.options.forceUnique,n=this.dataSource,i=this.getFilterArray();this._link&&this._link.toggleClass("k-state-active",0!==i.length),this.form&&(!e||!t||e.sender!==n||n.options.serverPaging||"itemchange"!=e.action&&"add"!=e.action&&"remove"!=e.action||this._foreignKeyValues()||(this.checkSource.data(a(this.dataSource.data(),this.field)),this.container.empty()),this.container.is(":empty")&&this.createCheckBoxes(),this.checkValues(i),this.trigger(p))},getFilterArray:function(){var t,n=e.extend(!0,{},{filters:[],logic:"and"},this.dataSource.filter());return r(n,this.field),t=s(n)},createCheckBoxes:function(){var e,t,n,i=this.options,o={field:this.field,format:i.format,mobile:this._isMobile,type:this.type};this.options.forceUnique?this._foreignKeyValues()?(e=this.checkSource.data(),o.valueField="value",o.field="text"):e=this.checkSource.data():e=this.checkSource.view(),t=c.template(i.itemTemplate(o)),n=c.render(t,e),i.checkAll&&(this.createCheckAllItem(),this.container.on(g+D,":checkbox",d(this.updateCheckAllState,this))),this.container.append(n)},checkAll:function(){var e=this.checkBoxAll.is(":checked");this.container.find(":checkbox").prop("checked",e)},checkValues:function(t){var n=this;e(e.grep(this.container.find(":checkbox").prop("checked",!1),function(i){var o,r,s=!1;if(!e(i).is(".k-check-all"))for(o=n._parse(e(i).val()),r=0;t.length>r;r++)if(s="date"==n.type?t[r].getTime()==o.getTime():t[r]==o)return s})).prop("checked",!0),this.updateCheckAllState()},_filter:function(t){var n,i;t.preventDefault(),t.stopPropagation(),n={logic:"or"},i=this,n.filters=e.map(this.form.find(":checkbox:checked:not(.k-check-all)"),function(t){return{value:e(t).val(),operator:"eq",field:i.field}}),n=this._merge(n),n.filters.length&&this.dataSource.filter(n),this._closeForm()},_stripFilters:function(t){return e.grep(t,function(e){return null!=e.value})},_foreignKeyValues:function(){var e=this.options;return e.values&&!e.checkSource},destroy:function(){var e=this;x.fn.destroy.call(e),e.form&&(c.unbind(e.form),c.destroy(e.form),e.form.unbind(D),e.popup&&(e.popup.destroy(),e.popup=null),e.form=null,e.container&&(e.container.unbind(D),e.container=null),e.checkBoxAll&&e.checkBoxAll.unbind(D)),e.view&&(e.view.purge(),e.view=null),e._link&&e._link.unbind(m),e._refreshHandler&&(e.dataSource.unbind(g,e._refreshHandler),e.dataSource=null),e.checkChangeHandler&&e.checkSource.unbind(g,e.checkChangeHandler),e._progressHandler&&e.checkSource.unbind("progress",e._progressHandler),e._progressHideHandler&&e.checkSource.unbind("change",e._progressHideHandler),e.element=e.checkSource=e.container=e.checkBoxAll=e._link=e._refreshHandler=e.checkAllHandler=null},options:{name:"FilterMultiCheck",itemTemplate:function(e){var n=e.field,i=e.format,o=e.valueField,r=e.mobile,s="";return o===t&&(o=n),"date"==e.type&&(s=":yyyy-MM-ddTHH:mm:sszzz"),"<li class='k-item'><label class='k-label'><input type='checkbox' class='"+(r?"k-check":"")+"'  value='#:kendo.format('{0"+s+"}',"+o+")#'/>#:kendo.format('"+(i?i:"{0}")+"', "+n+")#</label></li>"},checkAll:!0,appendToElement:!1,messages:{checkAll:"Select All",clear:"Clear",filter:"Filter"},forceUnique:!0,animations:{left:"slide",right:"slide:right"}},events:[f,p]});e.extend(M.fn,{_click:A.fn._click,_keydown:A.fn._keydown,_reset:A.fn._reset,_closeForm:A.fn._closeForm,clear:A.fn.clear,_merge:A.fn._merge}),h.plugin(A),h.plugin(M)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});;
/*
* Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.core.min","./kendo.draganddrop.min"],e)}(function(){return function(e,t){function n(e){return e.position().top+3}var i=window.kendo,o=i.ui.Widget,r=e.proxy,a=!1,s=".kendoGroupable",l="change",c=i.template('<div class="k-group-indicator" data-#=data.ns#field="${data.field}" data-#=data.ns#title="${data.title || ""}" data-#=data.ns#dir="${data.dir || "asc"}"><a href="\\#" class="k-link"><span class="k-icon k-si-arrow-${(data.dir || "asc") == "asc" ? "n" : "s"}">(sorted ${(data.dir || "asc") == "asc" ? "ascending": "descending"})</span>${data.title ? data.title: data.field}</a><a class="k-button k-button-icon k-button-bare"><span class="k-icon k-group-delete"></span></a></div>',{useWithBlock:!1}),d=function(t){return e('<div class="k-header k-drag-clue" />').css({width:t.width(),paddingLeft:t.css("paddingLeft"),paddingRight:t.css("paddingRight"),lineHeight:t.height()+"px",paddingTop:t.css("paddingTop"),paddingBottom:t.css("paddingBottom")}).html(t.attr(i.attr("title"))||t.attr(i.attr("field"))).prepend('<span class="k-icon k-drag-status k-denied" />')},h=e('<div class="k-grouping-dropclue"/>'),u=o.extend({init:function(c,u){var f,p,g=this,m=i.guid(),v=r(g._intializePositions,g),_=g._dropCuePositions=[];o.fn.init.call(g,c,u),a=i.support.isRtl(c),p=a?"right":"left",g.draggable=f=g.options.draggable||new i.ui.Draggable(g.element,{filter:g.options.draggableElements,hint:d,group:m}),g.groupContainer=e(g.options.groupContainer,g.element).kendoDropTarget({group:f.options.group,dragenter:function(e){g._canDrag(e.draggable.currentTarget)&&(e.draggable.hint.find(".k-drag-status").removeClass("k-denied").addClass("k-add"),h.css("top",n(g.groupContainer)).css(p,0).appendTo(g.groupContainer))},dragleave:function(e){e.draggable.hint.find(".k-drag-status").removeClass("k-add").addClass("k-denied"),h.remove()},drop:function(t){var n,o=t.draggable.currentTarget,r=o.attr(i.attr("field")),s=o.attr(i.attr("title")),l=g.indicator(r),c=g._dropCuePositions,d=c[c.length-1];(o.hasClass("k-group-indicator")||g._canDrag(o))&&(d?(n=g._dropCuePosition(i.getOffset(h).left+parseInt(d.element.css("marginLeft"),10)*(a?-1:1)+parseInt(d.element.css("marginRight"),10)),n&&g._canDrop(e(l),n.element,n.left)&&(n.before?n.element.before(l||g.buildIndicator(r,s)):n.element.after(l||g.buildIndicator(r,s)),g._change())):(g.groupContainer.append(g.buildIndicator(r,s)),g._change()))}}).kendoDraggable({filter:"div.k-group-indicator",hint:d,group:f.options.group,dragcancel:r(g._dragCancel,g),dragstart:function(e){var t=e.currentTarget,i=parseInt(t.css("marginLeft"),10),o=t.position(),r=a?o.left-i:o.left+t.outerWidth();v(),h.css({top:n(g.groupContainer),left:r}).appendTo(g.groupContainer),this.hint.find(".k-drag-status").removeClass("k-denied").addClass("k-add")},dragend:function(){g._dragEnd(this)},drag:r(g._drag,g)}).on("click"+s,".k-button",function(t){t.preventDefault(),g._removeIndicator(e(this).parent())}).on("click"+s,".k-link",function(t){var n=e(this).parent(),o=g.buildIndicator(n.attr(i.attr("field")),n.attr(i.attr("title")),"asc"==n.attr(i.attr("dir"))?"desc":"asc");n.before(o).remove(),g._change(),t.preventDefault()}),f.bind(["dragend","dragcancel","dragstart","drag"],{dragend:function(){g._dragEnd(this)},dragcancel:r(g._dragCancel,g),dragstart:function(e){var n,i,o;return g.options.allowDrag||g._canDrag(e.currentTarget)?(v(),_.length?(n=_[_.length-1].element,i=parseInt(n.css("marginRight"),10),o=n.position().left+n.outerWidth()+i):o=0,t):(e.preventDefault(),t)},drag:r(g._drag,g)}),g.dataSource=g.options.dataSource,g.dataSource&&g._refreshHandler?g.dataSource.unbind(l,g._refreshHandler):g._refreshHandler=r(g.refresh,g),g.dataSource&&(g.dataSource.bind("change",g._refreshHandler),g.refresh())},refresh:function(){var t=this,n=t.dataSource;t.groupContainer&&t.groupContainer.empty().append(e.map(n.group()||[],function(n){var o=n.field,r=i.attr("field"),a=t.element.find(t.options.filter).filter(function(){return e(this).attr(r)===o});return t.buildIndicator(n.field,a.attr(i.attr("title")),n.dir)}).join("")),t._invalidateGroupContainer()},destroy:function(){var e=this;o.fn.destroy.call(e),e.groupContainer.off(s),e.groupContainer.data("kendoDropTarget")&&e.groupContainer.data("kendoDropTarget").destroy(),e.groupContainer.data("kendoDraggable")&&e.groupContainer.data("kendoDraggable").destroy(),e.options.draggable||e.draggable.destroy(),e.dataSource&&e._refreshHandler&&(e.dataSource.unbind("change",e._refreshHandler),e._refreshHandler=null),e.groupContainer=e.element=e.draggable=null},options:{name:"Groupable",filter:"th",draggableElements:"th",messages:{empty:"Drag a column header and drop it here to group by that column"}},indicator:function(t){var n=e(".k-group-indicator",this.groupContainer);return e.grep(n,function(n){return e(n).attr(i.attr("field"))===t})[0]},buildIndicator:function(e,t,n){return c({field:e.replace(/"/g,"'"),dir:n,title:t,ns:i.ns})},descriptors:function(){var t,n,o,r,a,s=this,l=e(".k-group-indicator",s.groupContainer);return t=s.element.find(s.options.filter).map(function(){var t=e(this),o=t.attr(i.attr("aggregates")),s=t.attr(i.attr("field"));if(o&&""!==o)for(n=o.split(","),o=[],r=0,a=n.length;a>r;r++)o.push({field:s,aggregate:n[r]});return o}).toArray(),e.map(l,function(n){return n=e(n),o=n.attr(i.attr("field")),{field:o,dir:n.attr(i.attr("dir")),aggregates:t||[]}})},_removeIndicator:function(e){var t=this;e.remove(),t._invalidateGroupContainer(),t._change()},_change:function(){var e=this;e.dataSource&&e.dataSource.group(e.descriptors())},_dropCuePosition:function(t){var n,i,o,r,s,l=this._dropCuePositions;if(h.is(":visible")&&0!==l.length)return t=Math.ceil(t),n=l[l.length-1],i=n.left,o=n.right,r=parseInt(n.element.css("marginLeft"),10),s=parseInt(n.element.css("marginRight"),10),t>=o&&!a||i>t&&a?t={left:n.element.position().left+(a?-r:n.element.outerWidth()+s),element:n.element,before:!1}:(t=e.grep(l,function(e){return t>=e.left&&e.right>=t||a&&t>e.right})[0],t&&(t={left:a?t.element.position().left+t.element.outerWidth()+s:t.element.position().left-r,element:t.element,before:!0})),t},_drag:function(e){var t=this._dropCuePosition(e.x.location);t&&h.css({left:t.left,right:"auto"})},_canDrag:function(e){var t=e.attr(i.attr("field"));return"false"!=e.attr(i.attr("groupable"))&&t&&(e.hasClass("k-group-indicator")||!this.indicator(t))},_canDrop:function(e,t,n){var i=e.next(),o=e[0]!==t[0]&&(!i[0]||t[0]!==i[0]||!a&&n>i.position().left||a&&n<i.position().left);return o},_dragEnd:function(t){var n=this,o=t.currentTarget.attr(i.attr("field")),r=n.indicator(o);t!==n.options.draggable&&!t.dropped&&r&&n._removeIndicator(e(r)),n._dragCancel()},_dragCancel:function(){h.remove(),this._dropCuePositions=[]},_intializePositions:function(){var t,n=this,o=e(".k-group-indicator",n.groupContainer);n._dropCuePositions=e.map(o,function(n){return n=e(n),t=i.getOffset(n).left,{left:parseInt(t,10),right:parseInt(t+n.outerWidth(),10),element:n}})},_invalidateGroupContainer:function(){var e=this.groupContainer;e&&e.is(":empty")&&e.html(this.options.messages.empty)}});i.ui.plugin(u)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});;
/*
* Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.autocomplete.min", "./kendo.datepicker.min", "./kendo.numerictextbox.min", "./kendo.combobox.min", "./kendo.dropdownlist.min"], e)
}(function () {
return function (e, t) {
function n(t, i) {var o, r, s=[]; if(e.isPlainObject(t)) if(t.hasOwnProperty("filters")) s=t.filters; else if(t.field == i) return t; for(e.isArray(t) &&(s=t), o=0; s.length >o; o++) if(r=n(s[o], i)) return r}function i(t, n) {t.filters&& (t.filters=e.grep(t.filters, function(e) {return i(e, n), e.filters?e.filters.length: e.field !=n}))
}function o(e, t) { var n=r.getter(t, !0); return function (t) {for(var i, o, r =e(t), s=[], a=0, l={ }; r.length>a;) i=r[a++], o=n(i), l.hasOwnProperty(o) ||(s.push(i), l[o]=!0); return s}}var r=window.kendo, s=r.ui, a=r.data.DataSource, l = s.Widget, c="change", h="boolean", d="enums", u="string", f="Is equal to", p="Is not equal to", g =e.proxy, m=l.extend({ init: function (n, i) {var o, s, a, f, p, m, v, _, w, y, b, x; if(n = e(n).addClass("k-filtercell"), o=this.wrapper=e("<span/>").appendTo(n), s=this, p=i, _=s.operators=i.operators||{
}, w=s.input=e("<input/>").attr(r.attr("bind"), "value: value").appendTo(o), l.fn.init.call(s, n[0], i), i=s.options, a=s.dataSource=i.dataSource, s.model= a.reader.model, v=i.type=u, y=r.getter("reader.model.fields", !0) (a) ||{ }, b=y[i.field], b&&b.type&&(v=i.type=b.type), i.values&&(i.type=v=d), _=_[v]||i.operators[v], !p.operator) for(m in _) { i.operator=m; break
}s._parse=function (e) { return e + ""}, s.model&&s.model.fields&&(x=s.model.fields[i.field], x&&x.parse&&(s._parse=g(x.parse, x))), s.viewModel=f=r.observable({operator : i.operator, value: null, operatorVisible: function() {var e=this.get("value"); return null !== e &&e!==t&&"undefined"!=e}}), f.bind(c, g(s.updateDsFilter, s)), v == u &&s.initSuggestDataSource(i), null!==i.inputWidth&&w.width(i.inputWidth), s._setInputType(i, v), v!=h&& i.showOperators!==!1?s._createOperatorDropDown(_): o.addClass("k-operator-hidden"), s._createClearIcon(), r.bind(this.wrapper, f), v == u &&(i.template||s.setAutoCompleteSource()), v==d&&s.setComboBoxSource(s.options.values), s._refreshUI(), s._refreshHandler=g(s._refreshUI, s), s.dataSource.bind(c, s._refreshHandler) }, _setInputType: function(t, n) {var i, o, s, a, l, c=this, f = c.input; "function"== typeof t.template ? t.template.call(c.viewModel, {element: c.input, dataSource : c.suggestDataSource}): n==u?f.attr(r.attr("role"), "autocomplete").attr(r.attr("text-field"), t.dataTextField ||t.field).attr(r.attr("filter"), t.suggestionOperator).attr(r.attr("delay"), t.delay).attr(r.attr("min-length"), t.minLength).attr(r.attr("value-primitive"), !0): "date"==n?f.attr(r.attr("role"), "datepicker"): n==h?(f.remove(), i=e("<input type='radio'/>"), o=c.wrapper, s=r.guid(), a=e("<label/>").text(t.messages.isTrue).append(i), i.attr(r.attr("bind"), "checked:value").attr("name", s).val("true"), l=a.clone().text(t.messages.isFalse), i.clone().val("false").appendTo(l), o.append([a, l])): "number"== n ? f.attr(r.attr("role"), "numerictextbox"): n==d && f.attr(r.attr("role"), "combobox").attr(r.attr("text-field"), "text").attr(r.attr("suggest"), !0).attr(r.attr("filter"), "contains").attr(r.attr("value-field"), "value").attr(r.attr("value-primitive"), !0) }, _createOperatorDropDown: function(t) {var n, i, o=[]; for(n in t) o.push({text: t[n], value: n }); i=e('<input class="k-dropdown-operator" '+ r.attr("bind") +'="value: operator"/>').appendTo(this.wrapper), this.operatorDropDown= i.kendoDropDownList({ dataSource: o, dataTextField : "text", dataValueField : "value", open: function() { this.popup.element.width(150) }, valuePrimitive: !0 }).data("kendoDropDownList"), this.operatorDropDown.wrapper.find(".k-i-arrow-s").removeClass("k-i-arrow-s").addClass("k-filter") }, initSuggestDataSource: function(e) { var n=e.suggestDataSource; n instanceof a||(!e.customDataSource&&n && (n.group = t), n=this.suggestDataSource=a.create(n)), e.customDataSource||(n._pageSize=t, n.reader.data=o(n.reader.data, this.options.field)), this.suggestDataSource=n }, setAutoCompleteSource: function() {var e=this.input.data("kendoAutoComplete"); e&&e.setDataSource(this.suggestDataSource) }, setComboBoxSource: function (e) { var t = a.create({data: e}), n=this.input.data("kendoComboBox"); n && n.setDataSource(t) }, _refreshUI : function() { var t=this, i=n(t.dataSource.filter(), this.options.field) ||{ }, o=t.viewModel; t.manuallyUpdatingVM= !0, i=e.extend(!0, { }, i), t.options.type==h&&o.value!==i.value&&t.wrapper.find(":radio").prop("checked", !1), i.operator&&o.set("operator", i.operator), o.set("value", i.value), t.manuallyUpdatingVM=!1 }, updateDsFilter: function(n) {var i, o, r, s=this, a = s.viewModel; s.manuallyUpdatingVM||"operator"==n.field&&a.value===t||(i=e.extend({ }, s.viewModel.toJSON(), {field: s.options.field }), o={logic: "and", filters: [] }, i.value!==t&&null!==i.value&&o.filters.push(i), r=s._merge(o), s.dataSource.filter(r.filters.length?r: { })) }, _merge: function(t) {var n, o, r, s=this, a=t.logic||"and", l=t.filters, c = s.dataSource.filter() ||{filters: [], logic: "and"}; for(i(c, s.options.field), o=0, r=l.length; r>o; o++) n=l[o], n.value=s._parse(n.value); return l=e.grep(l, function(e) { return ""!==e.value&&null!==e.value }), l.length&&(c.filters.length?(t.filters=l, "and"!==c.logic&&(c.filters= [{
	logic: c.logic, filters : c.filters}], c.logic ="and"), c.filters.push(l.length>1?t: l[0])): (c.filters =l, c.logic=a)), c }, _createClearIcon: function() {var t=this; e("<button type='button' class='k-button k-button-icon'/>").attr(r.attr("bind"), "visible:operatorVisible").html("<span class='k-icon k-i-close'/>").click(g(t.clearFilter, t)).appendTo(t.wrapper) }, clearFilter: function() {this.viewModel.set("value", null) }, destroy: function() {var e=this; e.filterModel=null, l.fn.destroy.call(e), r.destroy(e.element) }, events: [c], options: {name: "FilterCell", delay: 200, minLength: 1, inputWidth: null, values: t, customDataSource: !1, field: "", dataTextField: "", type: "string", suggestDataSource: null, suggestionOperator: "startswith", operator: "eq", showOperators: !0, template : null, messages: {isTrue: "is true", isFalse: "is false", filter: "Filter", clear: "Clear", operator: "Operator"}, operators: { string: {eq : f, neq : p, startswith : "Starts with", contains : "Contains", doesnotcontain: "Does not contain", endswith: "Ends with"}, number: { eq: f, neq: p, gte: "Is greater than or equal to", gt: "Is greater than", lte: "Is less than or equal to", lt: "Is less than" }, date : {eq : f, neq : p, gte: "Is after or equal to", gt: "Is after", lte: "Is before or equal to", lt: "Is before"}, enums: {eq: f, neq: p}}}}); s.plugin(m) }(window.kendo.jQuery), window.kendo}, "function"==typeof define && define.amd?define: function(e, t) {t() });;
/*
* Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.data.min"],e)}(function(){return function(e,t){function n(e,t,n,i,o){return e({idx:t,text:n,ns:c.ns,numeric:i,title:o||""})}function i(e,t,n){return x({className:e.substring(1),text:t,wrapClassName:n||""})}function o(e,t,n,i){e.find(t).parent().attr(c.attr("page"),n).attr("tabindex",-1).toggleClass("k-state-disabled",i)}function r(e,t){o(e,f,1,1>=t)}function a(e,t){o(e,g,Math.max(1,t-1),1>=t)}function s(e,t,n){o(e,m,Math.min(n,t+1),t>=n)}function l(e,t,n){o(e,p,n,t>=n)}var c=window.kendo,d=c.ui,h=d.Widget,u=e.proxy,f=".k-i-seek-w",p=".k-i-seek-e",g=".k-i-arrow-w",m=".k-i-arrow-e",v="change",_=".kendoPager",w="click",y="keydown",b="disabled",x=c.template('<a href="\\#" title="#=text#" class="k-link k-pager-nav #= wrapClassName #"><span class="k-icon #= className #">#=text#</span></a>'),k=h.extend({init:function(t,n){var o,d,b,x,k=this;h.fn.init.call(k,t,n),n=k.options,k.dataSource=c.data.DataSource.create(n.dataSource),k.linkTemplate=c.template(k.options.linkTemplate),k.selectTemplate=c.template(k.options.selectTemplate),k.currentPageTemplate=c.template(k.options.currentPageTemplate),o=k.page(),d=k.totalPages(),k._refreshHandler=u(k.refresh,k),k.dataSource.bind(v,k._refreshHandler),n.previousNext&&(k.element.find(f).length||(k.element.append(i(f,n.messages.first,"k-pager-first")),r(k.element,o,d)),k.element.find(g).length||(k.element.append(i(g,n.messages.previous)),a(k.element,o,d))),n.numeric&&(k.list=k.element.find(".k-pager-numbers"),k.list.length||(k.list=e('<ul class="k-pager-numbers k-reset" />').appendTo(k.element))),n.input&&(k.element.find(".k-pager-input").length||k.element.append('<span class="k-pager-input k-label">'+n.messages.page+'<input class="k-textbox">'+c.format(n.messages.of,d)+"</span>"),k.element.on(y+_,".k-pager-input input",u(k._keydown,k))),n.previousNext&&(k.element.find(m).length||(k.element.append(i(m,n.messages.next)),s(k.element,o,d)),k.element.find(p).length||(k.element.append(i(p,n.messages.last,"k-pager-last")),l(k.element,o,d))),n.pageSizes&&(k.element.find(".k-pager-sizes").length||(b=n.pageSizes.length?n.pageSizes:["all",5,10,20],x=e.map(b,function(e){return e.toLowerCase&&"all"===e.toLowerCase()?"<option value='all'>"+n.messages.allPages+"</option>":"<option>"+e+"</option>"}),e('<span class="k-pager-sizes k-label"><select/>'+n.messages.itemsPerPage+"</span>").appendTo(k.element).find("select").html(x.join("")).end().appendTo(k.element)),k.element.find(".k-pager-sizes select").val(k.pageSize()),c.ui.DropDownList&&k.element.find(".k-pager-sizes select").show().kendoDropDownList(),k.element.on(v+_,".k-pager-sizes select",u(k._change,k))),n.refresh&&(k.element.find(".k-pager-refresh").length||k.element.append('<a href="#" class="k-pager-refresh k-link" title="'+n.messages.refresh+'"><span class="k-icon k-i-refresh">'+n.messages.refresh+"</span></a>"),k.element.on(w+_,".k-pager-refresh",u(k._refreshClick,k))),n.info&&(k.element.find(".k-pager-info").length||k.element.append('<span class="k-pager-info k-label" />')),k.element.on(w+_,"a",u(k._click,k)).addClass("k-pager-wrap k-widget k-floatwrap"),k.element.on(w+_,".k-current-page",u(k._toggleActive,k)),n.autoBind&&k.refresh(),c.notify(k)},destroy:function(){var e=this;h.fn.destroy.call(e),e.element.off(_),e.dataSource.unbind(v,e._refreshHandler),e._refreshHandler=null,c.destroy(e.element),e.element=e.list=null},events:[v],options:{name:"Pager",selectTemplate:'<li><span class="k-state-selected">#=text#</span></li>',currentPageTemplate:'<li class="k-current-page"><span class="k-link k-pager-nav">#=text#</span></li>',linkTemplate:'<li><a tabindex="-1" href="\\#" class="k-link" data-#=ns#page="#=idx#" #if (title !== "") {# title="#=title#" #}#>#=text#</a></li>',buttonCount:10,autoBind:!0,numeric:!0,info:!0,input:!1,previousNext:!0,pageSizes:!1,refresh:!1,messages:{allPages:"All",display:"{0} - {1} of {2} items",empty:"No items to display",page:"Page",of:"of {0}",itemsPerPage:"items per page",first:"Go to the first page",previous:"Go to the previous page",next:"Go to the next page",last:"Go to the last page",refresh:"Refresh",morePages:"More pages"}},setDataSource:function(e){var t=this;t.dataSource.unbind(v,t._refreshHandler),t.dataSource=t.options.dataSource=e,e.bind(v,t._refreshHandler),t.options.autoBind&&e.fetch()},refresh:function(e){var t,i,o,d,h,u,f=this,p=1,g=f.page(),m="",v=f.options,_=f.pageSize(),w=f.dataSource.total(),y=f.totalPages(),x=f.linkTemplate,k=v.buttonCount;if(!e||"itemchange"!=e.action){if(v.numeric){for(g>k&&(o=g%k,p=0===o?g-k+1:g-o+1),i=Math.min(p+k-1,y),p>1&&(m+=n(x,p-1,"...",!1,v.messages.morePages)),t=p;i>=t;t++)m+=n(t==g?f.selectTemplate:x,t,t,!0);y>i&&(m+=n(x,t,"...",!1,v.messages.morePages)),""===m&&(m=f.selectTemplate({text:0})),m=this.currentPageTemplate({text:g})+m,f.list.removeClass("k-state-expanded").html(m)}v.info&&(m=w>0?c.format(v.messages.display,(g-1)*_+1,Math.min(g*_,w),w):v.messages.empty,f.element.find(".k-pager-info").html(m)),v.input&&f.element.find(".k-pager-input").html(f.options.messages.page+'<input class="k-textbox">'+c.format(v.messages.of,y)).find("input").val(g).attr(b,1>w).toggleClass("k-state-disabled",1>w),v.previousNext&&(r(f.element,g,y),a(f.element,g,y),s(f.element,g,y),l(f.element,g,y)),v.pageSizes&&(d=f.element.find(".k-pager-sizes option[value='all']").length>0,h=d&&_===this.dataSource.total(),u=_,h&&(_="all",u=v.messages.allPages),f.element.find(".k-pager-sizes select").val(_).filter("["+c.attr("role")+"=dropdownlist]").kendoDropDownList("value",_).kendoDropDownList("text",u))}},_keydown:function(e){if(e.keyCode===c.keys.ENTER){var t=this.element.find(".k-pager-input").find("input"),n=parseInt(t.val(),10);(isNaN(n)||1>n||n>this.totalPages())&&(n=this.page()),t.val(n),this.page(n)}},_refreshClick:function(e){e.preventDefault(),this.dataSource.read()},_change:function(e){var t=e.currentTarget.value,n=parseInt(t,10),i=this.dataSource;isNaN(n)?"all"==(t+"").toLowerCase()&&i.pageSize(i.total()):i.pageSize(n)},_toggleActive:function(){this.list.toggleClass("k-state-expanded")},_click:function(t){var n=e(t.currentTarget);t.preventDefault(),n.is(".k-state-disabled")||this.page(n.attr(c.attr("page")))},totalPages:function(){return Math.ceil((this.dataSource.total()||0)/(this.pageSize()||1))},pageSize:function(){return this.dataSource.pageSize()||this.dataSource.total()},page:function(e){return e===t?this.dataSource.total()>0?this.dataSource.page():0:(this.dataSource.page(e),this.trigger(v,{index:e}),t)}});d.plugin(k)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});;
/*
* Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.core.min","./kendo.userevents.min"],e)}(function(){return function(e,t){function n(e,t){if(!e.is(":visible"))return!1;var n=o.getOffset(e),i=t.left+t.width,r=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>r||t.top>n.bottom)}var i,o=window.kendo,r=o.ui.Widget,a=e.proxy,s=Math.abs,l="aria-selected",c="k-state-selected",d="k-state-selecting",u="k-selectable",h="change",f=".kendoSelectable",p="k-state-unselecting",g="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",m=o.support.browser.msie,v=!1;!function(e){!function(){e('<div class="parent"><span /></div>').on("click",">*",function(){v=!0}).find("span").click().end().off()}()}(e),i=r.extend({init:function(t,n){var i,s=this;r.fn.init.call(s,t,n),s._marquee=e("<div class='k-marquee'><div class='k-marquee-color'></div></div>"),s._lastActive=null,s.element.addClass(u),s.relatedTarget=s.options.relatedTarget,i=s.options.multiple,this.options.aria&&i&&s.element.attr("aria-multiselectable",!0),s.userEvents=new o.UserEvents(s.element,{global:!0,allowSelection:!0,filter:(v?"":"."+u+" ")+s.options.filter,tap:a(s._tap,s)}),i&&s.userEvents.bind("start",a(s._start,s)).bind("move",a(s._move,s)).bind("end",a(s._end,s)).bind("select",a(s._select,s))},events:[h],options:{name:"Selectable",filter:">*",multiple:!1,relatedTarget:e.noop},_isElement:function(e){var t,n=this.element,i=n.length,o=!1;for(e=e[0],t=0;i>t;t++)if(n[t]===e){o=!0;break}return o},_tap:function(t){var n,i=e(t.target),o=this,r=t.event.ctrlKey||t.event.metaKey,a=o.options.multiple,s=a&&t.event.shiftKey,l=t.event.which,d=t.event.button;!o._isElement(i.closest("."+u))||l&&3==l||d&&2==d||this._allowSelection(t.event.target)&&(n=i.hasClass(c),a&&r||o.clear(),i=i.add(o.relatedTarget(i)),s?o.selectRange(o._firstSelectee(),i):(n&&r?(o._unselect(i),o._notify(h)):o.value(i),o._lastActive=o._downTarget=i))},_start:function(n){var i,o=this,r=e(n.target),a=r.hasClass(c),s=n.event.ctrlKey||n.event.metaKey;if(this._allowSelection(n.event.target)){if(o._downTarget=r,!o._isElement(r.closest("."+u)))return o.userEvents.cancel(),t;o.options.useAllItems?o._items=o.element.find(o.options.filter):(i=r.closest(o.element),o._items=i.find(o.options.filter)),n.sender.capture(),o._marquee.appendTo(document.body).css({left:n.x.client+1,top:n.y.client+1,width:0,height:0}),s||o.clear(),r=r.add(o.relatedTarget(r)),a&&(o._selectElement(r,!0),s&&r.addClass(p))}},_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:s(e.x.initialDelta),height:s(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+"."+p)).removeClass(p),e=t.element.find(t.options.filter+"."+d),e=e.add(t.relatedTarget(e)),t.value(e),t._lastActive=t._downTarget,t._items=null},_invalidateSelectables:function(e,t){var i,o,r,a,s=this._downTarget[0],l=this._items;for(i=0,o=l.length;o>i;i++)a=l.eq(i),r=a.add(this.relatedTarget(a)),n(a,e)?a.hasClass(c)?t&&s!==a[0]&&r.removeClass(c).addClass(p):a.hasClass(d)||a.hasClass(p)||r.addClass(d):a.hasClass(d)?r.removeClass(d):t&&a.hasClass(p)&&r.removeClass(p).addClass(c)},value:function(e){var n=this,i=a(n._selectElement,n);return e?(e.each(function(){i(this)}),n._notify(h),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),o=!n&&this._notify("select",{element:t});i.removeClass(d),o||(i.addClass(c),this.options.aria&&i.attr(l,!0))},_notify:function(e,t){return t=t||{},this.trigger(e,t)},_unselect:function(e){return e.removeClass(c),this.options.aria&&e.attr(l,!1),e},_select:function(t){this._allowSelection(t.event.target)&&(!m||m&&!e(o._activeElement()).is(g))&&t.preventDefault()},_allowSelection:function(t){return e(t).is(g)?(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,o,r,a=this;for(a.clear(),a.element.length>1&&(r=a.options.continuousItems()),r&&r.length||(r=a.element.find(a.options.filter)),t=e.inArray(e(t)[0],r),n=e.inArray(e(n)[0],r),t>n&&(o=t,t=n,n=o),a.options.useAllItems||(n+=a.element.length-1),i=t;n>=i;i++)a._selectElement(r[i]);a._notify(h)},destroy:function(){var e=this;r.fn.destroy.call(e),e.element.off(f),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}},o.ui.plugin(i)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});;
/*
* Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.core.min","./kendo.binder.min","./kendo.fx.min"],e)}(function(){return function(e){function t(e){if(!e)return{};var t=e.match(v)||[];return{type:t[1],direction:t[3],reverse:"reverse"===t[5]}}var n=window.kendo,i=n.Observable,o="SCRIPT",r="init",a="show",s="hide",l="transitionStart",c="transitionEnd",d="attach",u="detach",h=/unrecognized expression/,p=i.extend({init:function(e,t){var o=this;t=t||{},i.fn.init.call(o),o.content=e,o.id=n.guid(),o.tagName=t.tagName||"div",o.model=t.model,o._wrap=t.wrap!==!1,this._evalTemplate=t.evalTemplate||!1,o._fragments={},o.bind([r,a,s,l,c],t)},render:function(t){var i=this,o=!i.element;return o&&(i.element=i._createElement()),t&&e(t).append(i.element),o&&(n.bind(i.element,i.model),i.trigger(r)),t&&(i._eachFragment(d),i.trigger(a)),i.element},clone:function(){return new f(this)},triggerBeforeShow:function(){return!0},triggerBeforeHide:function(){return!0},showStart:function(){this.element.css("display","")},showEnd:function(){},hideEnd:function(){this.hide()},beforeTransition:function(e){this.trigger(l,{type:e})},afterTransition:function(e){this.trigger(c,{type:e})},hide:function(){this._eachFragment(u),this.element.detach(),this.trigger(s)},destroy:function(){var e=this.element;e&&(n.unbind(e),n.destroy(e),e.remove())},fragments:function(t){e.extend(this._fragments,t)},_eachFragment:function(e){for(var t in this._fragments)this._fragments[t][e](this,t)},_createElement:function(){var t,i,r,a=this,s="<"+a.tagName+" />";try{i=e(document.getElementById(a.content)||a.content),i[0].tagName===o&&(i=i.html())}catch(l){h.test(l.message)&&(i=a.content)}return"string"==typeof i?(i=i.replace(/^\s+|\s+$/g,""),a._evalTemplate&&(i=n.template(i)(a.model||{})),t=e(s).append(i),a._wrap||(t=t.contents())):(t=i,a._evalTemplate&&(r=e(n.template(e("<div />").append(t.clone(!0)).html())(a.model||{})),e.contains(document,t[0])&&t.replaceWith(r),t=r),a._wrap&&(t=t.wrapAll(s).parent())),t}}),f=n.Class.extend({init:function(t){e.extend(this,{element:t.element.clone(!0),transition:t.transition,id:t.id}),t.element.parent().append(this.element)},hideEnd:function(){this.element.remove()},beforeTransition:e.noop,afterTransition:e.noop}),g=p.extend({init:function(e,t){p.fn.init.call(this,e,t),this.containers={}},container:function(e){var t=this.containers[e];return t||(t=this._createContainer(e),this.containers[e]=t),t},showIn:function(e,t,n){this.container(e).show(t,n)},_createContainer:function(e){var t,n=this.render(),i=n.find(e);if(!i.length&&n.is(e)){if(!n.is(e))throw Error("can't find a container with the specified "+e+" selector");i=n}return t=new _(i),t.bind("accepted",function(e){e.view.render(i)}),t}}),m=p.extend({attach:function(e,t){e.element.find(t).replaceWith(this.render())},detach:function(){}}),v=/^(\w+)(:(\w+))?( (\w+))?$/,_=i.extend({init:function(e){i.fn.init.call(this),this.container=e,this.history=[],this.view=null,this.running=!1},after:function(){this.running=!1,this.trigger("complete",{view:this.view}),this.trigger("after")},end:function(){this.view.showEnd(),this.previous.hideEnd(),this.after()},show:function(e,i,o){if(!e.triggerBeforeShow()||this.view&&!this.view.triggerBeforeHide())return this.trigger("after"),!1;o=o||e.id;var r=this,a=e===r.view?e.clone():r.view,s=r.history,l=s[s.length-2]||{},c=l.id===o,d=i||(c?s[s.length-1].transition:e.transition),u=t(d);return r.running&&r.effect.stop(),"none"===d&&(d=null),r.trigger("accepted",{view:e}),r.view=e,r.previous=a,r.running=!0,c?s.pop():s.push({id:o,transition:d}),a?(d&&n.effects.enabled?(e.element.addClass("k-fx-hidden"),e.showStart(),c&&!i&&(u.reverse=!u.reverse),r.effect=n.fx(e.element).replace(a.element,u.type).beforeTransition(function(){e.beforeTransition("show"),a.beforeTransition("hide")}).afterTransition(function(){e.afterTransition("show"),a.afterTransition("hide")}).direction(u.direction).setReverse(u.reverse),r.effect.run().then(function(){r.end()})):(e.showStart(),r.end()),!0):(e.showStart(),e.showEnd(),r.after(),!0)}});n.ViewContainer=_,n.Fragment=m,n.Layout=g,n.View=p,n.ViewClone=f}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});;
/*
* Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.core.min"],e)}(function(){return function(e,t){var n=window.kendo,i=n.ui,r=i.Widget,o="dir",a="asc",s="single",l="field",c="desc",d=".kendoColumnSorter",u=".k-link",h="aria-sort",p=e.proxy,f=r.extend({init:function(e,t){var n,i=this;r.fn.init.call(i,e,t),i._refreshHandler=p(i.refresh,i),i.dataSource=i.options.dataSource.bind("change",i._refreshHandler),n=i.element.find(u),n[0]||(n=i.element.wrapInner('<a class="k-link" href="#"/>').find(u)),i.link=n,i.element.on("click"+d,p(i._click,i))},options:{name:"ColumnSorter",mode:s,allowUnsort:!0,compare:null,filter:""},destroy:function(){var e=this;r.fn.destroy.call(e),e.element.off(d),e.dataSource.unbind("change",e._refreshHandler),e._refreshHandler=e.element=e.link=e.dataSource=null},refresh:function(){var t,i,r,s,d=this,u=d.dataSource.sort()||[],p=d.element,f=p.attr(n.attr(l));for(p.removeAttr(n.attr(o)),p.removeAttr(h),t=0,i=u.length;i>t;t++)r=u[t],f==r.field&&p.attr(n.attr(o),r.dir);s=p.attr(n.attr(o)),p.find(".k-i-arrow-n,.k-i-arrow-s").remove(),s===a?(e('<span class="k-icon k-i-arrow-n" />').appendTo(d.link),p.attr(h,"ascending")):s===c&&(e('<span class="k-icon k-i-arrow-s" />').appendTo(d.link),p.attr(h,"descending"))},_click:function(e){var i,r,d=this,u=d.element,h=u.attr(n.attr(l)),p=u.attr(n.attr(o)),f=d.options,g=null===d.options.compare?t:d.options.compare,m=d.dataSource.sort()||[];if(e.preventDefault(),!f.filter||u.is(f.filter)){if(p=p===a?c:p===c&&f.allowUnsort?t:a,f.mode===s)m=[{field:h,dir:p,compare:g}];else if("multiple"===f.mode){for(i=0,r=m.length;r>i;i++)if(m[i].field===h){m.splice(i,1);break}m.push({field:h,dir:p,compare:g})}this.dataSource.sort(m)}}});i.plugin(f)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});;
/*
* Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.data.min","./kendo.columnsorter.min","./kendo.editable.min","./kendo.window.min","./kendo.filtermenu.min","./kendo.columnmenu.min","./kendo.groupable.min","./kendo.pager.min","./kendo.selectable.min","./kendo.sortable.min","./kendo.reorderable.min","./kendo.resizable.min","./kendo.mobile.actionsheet.min","./kendo.mobile.pane.min","./kendo.ooxml.min","./kendo.excel.min","./kendo.progressbar.min","./kendo.pdf.min"],e)}(function(){return function(e,t){function n(e){return Array(e+1).join('<td class="k-group-cell">&nbsp;</td>')}function i(e){var t,n=" ";if(e){if(typeof e===ln)return e;for(t in e)n+=t+'="'+e[t]+'"'}return n}function o(t,n){e("th, th .k-grid-filter, th .k-link",t).add(document.body).css("cursor",n)}function r(t,n,i,o,r){var a,s=n;for(n=e(),r=r||1,a=0;r>a;a++)n=n.add(t.eq(s+a));"number"==typeof i?n[o?"insertBefore":"insertAfter"](t.eq(i)):n.appendTo(i)}function a(t,n,i){return e(t).add(n).find(i)}function s(e,t,n){var i,o,r,a;for(n=bt(n)?n:[n],i=0,o=n.length;o>i;i++)r=n[i],vt(r)&&r.click&&(a=r.name||r.text,t.on(on+Rt,"a.k-grid-"+(a||"").replace(/\s/g,""),{commandName:a},Ct(r.click,e)))}function l(e,t,n){return wt(e,function(e){var i,o;return e=typeof e===ln?{field:e}:e,(!f(e)||n)&&(e.attributes=W(e.attributes),e.footerAttributes=W(e.footerAttributes),e.headerAttributes=W(e.headerAttributes),i=!0),e.columns&&(e.columns=l(e.columns,t,i)),o=dt.guid(),e.headerAttributes=_t({id:o},e.headerAttributes),_t({encoded:t,hidden:i},e)})}function c(e,t){var n=[];return d(e,t,n),n[n.length-1]}function d(e,t,n){var i,o;for(n=n||[],i=0;t.length>i;i++){if(e===t[i])return!0;if(t[i].columns){if(o=n.length,n.push(t[i]),d(e,t[i].columns,n))return!0;n.splice(o,n.length-o)}}return!1}function h(e,t){var n=t?j:W;e.hidden=!t,e.attributes=n(e.attributes),e.footerAttributes=n(e.footerAttributes),e.headerAttributes=n(e.headerAttributes)}function u(){return"none"!==this.style.display}function f(e){return p([e]).length>0}function p(e){return yt(e,function(e){var t=!e.hidden;return t&&e.columns&&(t=p(e.columns).length>0),t})}function g(t){return e(t).map(function(){return this.toArray()})}function m(e,t,n){var i=w(B(t)),o=w(z(t)),r=e.rowSpan;e.rowSpan=n?i>o?r-(i-o)||1:r+(o-i):i>o?r+(i-o):r-(o-i)||1}function v(t,n,i,o,r,a,s){var l,c,d=w(t),h=w([n]);d>h&&(l=Array(s+1).join('<th class="k-group-cell k-header">&nbsp;</th>'),c=a.children(":not(.k-filter-row)"),e(Array(d-h+1).join("<tr>"+l+"</tr>")).insertAfter(c.last())),M(a,d-h),y(i,o,r,a)}function _(t,n,i){var o,r,a,s,l,c,d,h;for(i=i||0,a=n,n=O(n),s={},l=t.find(">tr:not(.k-filter-row)"),c=function(){var t=e(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")},d=0,h=n.length;h>d;d++)o=b(n[d],a),s[o.row]||(s[o.row]=l.eq(o.row).find(".k-header").filter(c)),r=s[o.row].eq(o.cell),r.attr(dt.attr("index"),i+d);return n.length}function w(e){var t,n,i=1,o=0;for(t=0;e.length>t;t++)e[t].columns&&(n=w(e[t].columns),n>o&&(o=n));return i+o}function y(t,n,i,o){var r,a,s=C(t[0],n),l=i.find(">tr:not(.k-filter-row):eq("+s.row+")>th.k-header"),c=e(),d=s.cell;for(r=0;t.length>r;r++)c=c.add(l.eq(d+r));for(o.find(">tr:not(.k-filter-row)").eq(s.row).append(c),a=[],r=0;t.length>r;r++)t[r].columns&&(a=a.concat(t[r].columns));a.length&&y(a,n,i,o)}function b(e,t,n,i){var o,r;for(n=n||0,i=i||{},i[n]=i[n]||0,r=0;t.length>r;r++){if(t[r]==e){o={cell:i[n],row:n};break}if(t[r].columns&&(o=b(e,t[r].columns,n+1,i)))break;i[n]++}return o}function x(e,t,n,i){var o,r=n.locked;do o=e[t],t+=i?1:-1;while(o&&t>-1&&e.length>t&&o!=n&&!o.columns&&o.locked==r);return o}function k(e,t,n,i){var o,r,a,s;return t.columns?(t=t.columns,t[i?0:t.length-1]):(o=c(t,e),r=o?o.columns:e,a=xt(t,r),0===a&&i?a++:a!=r.length-1||i?(a>0||0===a&&!i)&&(a+=i?-1:1):a--,s=xt(n,r),t=x(r,a,n,s>a),t&&t!=n&&t.columns?k(e,t,n,i):null)}function C(e,t,n,i){var o,r;for(n=n||0,i=i||{},i[n]=i[n]||0,r=0;t.length>r;r++){if(t[r]==e){o={cell:i[n],row:n};break}if(t[r].columns&&(o=C(e,t[r].columns,n+1,i)))break;t[r].hidden||i[n]++}return o}function S(e){var t=T(B(e));return t.concat(T(z(e)))}function T(e){var t,n=[],i=[];for(t=0;e.length>t;t++)n.push(e[t]),e[t].columns&&(i=i.concat(e[t].columns));return i.length&&(n=n.concat(T(i))),n}function D(e){var t,n,i=0;for(n=0;e.length>n;n++)t=e[n],t.columns?i+=D(t.columns):t.hidden&&i++;return i}function A(e){var t,n,i,o=0;for(n=0,i=e.length;i>n;n++)t=e[n].style.width,t&&-1==t.indexOf("%")&&(o+=parseInt(t,10));return o}function P(e,t){var n,i,o=e.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)");for(i=0;o.length>i;i++)n=o[i].rowSpan,n>1&&(o[i].rowSpan=n-t||1)}function M(e,t){var n,i=e.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)");for(n=0;i.length>n;n++)i[n].rowSpan+=t}function E(t){var n,i=t.find("tr:not(.k-filter-row)"),o=i.filter(function(){return!e(this).children().length}).remove().length,r=i.find("th:not(.k-group-cell,.k-hierarchy-cell)");for(n=0;r.length>n;n++)r[n].rowSpan>1&&(r[n].rowSpan-=o);return i.length-o}function I(e,t,n,i,o){var r,a,s,l=[];for(r=0,s=e.length;s>r;r++)a=n[i]||[],a.push(t.eq(o+r)),n[i]=a,e[r].columns&&(l=l.concat(e[r].columns));l.length&&I(l,t,n,i+1,o+e.length)}function B(e){return yt(e,function(e){return e.locked})}function z(e){return yt(e,function(e){return!e.locked})}function L(e){return yt(e,function(e){return!e.locked&&f(e)})}function R(e){return yt(e,function(e){return e.locked&&f(e)})}function F(e){var t,n=[];for(t=0;e.length>t;t++)e[t].hidden||(e[t].columns?n=n.concat(F(e[t].columns)):n.push(e[t]));return n}function O(e){var t,n=[];for(t=0;e.length>t;t++)e[t].columns?n=n.concat(O(e[t].columns)):n.push(e[t]);return n}function N(n){var i,o=n.find(">tr:not(.k-filter-row)"),r=function(){var t=e(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")},a=e();return o.length>1&&(a=o.find("th").filter(r).filter(function(){return this.rowSpan>1})),a=a.add(o.last().find("th").filter(r)),i=dt.attr("index"),a.sort(function(n,o){var r,a;return n=e(n),o=e(o),r=n.attr(i),a=o.attr(i),r===t&&(r=e(n).index()),a===t&&(a=e(o).index()),r=parseInt(r,10),a=parseInt(a,10),r>a?1:a>r?-1:0}),a}function H(t){var n,i,o,r,a,s,l,c=t.closest("table"),d=e().add(t),h=t.closest("tr"),u=c.find("tr:not(.k-filter-row)"),f=u.index(h);if(f>0){for(n=u.eq(f-1),i=n.find("th:not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return!e(this).attr("rowspan")}),o=0,r=h.find("th:not(.k-group-cell,.k-hierarchy-cell)").index(t),a=t.prevAll(":not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return this.colSpan>1}),s=0;a.length>s;s++)o+=a[s].colSpan||1;for(r+=Math.max(o-1,0),o=0,s=0;i.length>s;s++)if(l=i.eq(s),o+=l.attr("colSpan")?l[0].colSpan:1,r>=s&&o>r){d=H(l).add(d);break}}return d}function V(t){var n,i,o,r,a,s,l,c,d=t.closest("thead"),h=e().add(t),u=t.closest("tr"),f=d.find("tr:not(.k-filter-row)"),p=f.index(u)+t[0].rowSpan,g=dt.attr("colspan");if(f.length-1>=p){for(n=u.next(),i=u.find("th:not(.k-group-cell,.k-hierarchy-cell)").index(t),o=t.prevAll(":not(.k-group-cell,.k-hierarchy-cell)"),o=o.filter(function(){return!this.rowSpan||1===this.rowSpan}),a=0,r=0;o.length>r;r++)a+=parseInt(o.eq(r).attr(g),10)||1;for(s=n.find("th:not(.k-group-cell,.k-hierarchy-cell)"),l=parseInt(t.attr(g),10)||1,r=0;l>r;)n=s.eq(r+a),h=h.add(V(n)),c=parseInt(n.attr(g),10),c>1&&(l-=c-1),r++}return h}function U(t,n,i,o){var r,a=t;return o&&t.empty(),ft?t[0].innerHTML=i:(r=document.createElement("div"),r.innerHTML="<table><tbody>"+i+"</tbody></table>",t=r.firstChild.firstChild,n[0].replaceChild(t,a[0]),t=e(t)),t}function W(e){e=e||{};var t=e.style;return t?(t=t.replace(/((.*)?display)(.*)?:([^;]*)/i,"$1:none"),t===e.style&&(t=t.replace(/(.*)?/i,"display:none;$1"))):t="display:none",_t({},e,{style:t})}function j(e){e=e||{};var t=e.style;return t&&(e.style=t.replace(/(display\s*:\s*none\s*;?)*/gi,"")),e}function G(t,n,i,o){var r,a=t.find(">colgroup"),s=wt(n,function(e){return r=e.width,r&&0!==parseInt(r,10)?dt.format('<col style="width:{0}"/>',typeof r===ln?r:r+"px"):"<col />"});(i||a.find(".k-hierarchy-col").length)&&s.splice(0,0,'<col class="k-hierarchy-col" />'),a.length&&a.remove(),a=e(Array(o+1).join('<col class="k-group-col">')+s.join("")),a.is("colgroup")||(a=e("<colgroup/>").append(a)),t.prepend(a),yn.msie&&8==yn.version&&(t.css("display","inline-table"),window.setTimeout(function(){t.css("display","")},1))}function q(e,t){var n,i,o=0,r=e.find("th:not(.k-group-cell)");for(n=0,i=t.length;i>n;n++)t[n].locked&&(r.eq(n).insertBefore(r.eq(o)),r=e.find("th:not(.k-group-cell)"),o++)}function $(e){var t,n,i,o={};for(n=0,i=e.length;i>n;n++)t=e[n],o[t.value]=t.text;return o}function Y(e,t,n,i){var o=n&&n.length&&vt(n[0])&&"value"in n[0],r=o?$(n)[e]:e;return r=null!=r?r:"",t?dt.format(t,r):i===!1?r:dt.htmlEncode(r)}function Q(e,t,n){for(var i,o=0,r=e[o];r;){if(i=n?!0:"none"!==r.style.display,i&&!mn.test(r.className)&&--t<0){r.style.display=n?"":"none";break}r=e[++o]}}function X(t,n){for(var i,o,r=0,a=t.length;a>r;r+=1)o=t.eq(r),o.is(".k-grouping-row,.k-detail-row")?(i=o.children(":not(.k-group-cell):first,.k-detail-cell").last(),i.attr("colspan",parseInt(i.attr("colspan"),10)-1)):(o.hasClass("k-grid-edit-row")&&(i=o.children(".k-edit-container")[0])&&(i=e(i),i.attr("colspan",parseInt(i.attr("colspan"),10)-1),i.find("col").eq(n).remove(),o=i.find("tr:first")),Q(o[0].cells,n,!1))}function K(e){var t,n,i=[];for(n=0;e.length>n&&(t=e[n],"field"in t&&"value"in t&&"items"in t);n++)i.push(t),t.hasSubgroups&&(i=i.concat(K(t.items)));return i}function Z(e){var t,n,i=[];for(n=0;e.length>n&&(t=e[n],"field"in t&&"value"in t&&"items"in t);n++)t.hasSubgroups&&(i=i.concat(Z(t.items))),i.push(t.aggregates);return i}function J(t,n){for(var i,o,r,a=0,s=t.length;s>a;a+=1)o=t.eq(a),o.is(".k-grouping-row,.k-detail-row")?(i=o.children(":not(.k-group-cell):first,.k-detail-cell").last(),i.attr("colspan",parseInt(i.attr("colspan"),10)+1)):(o.hasClass("k-grid-edit-row")&&(i=o.children(".k-edit-container")[0])&&(i=e(i),i.attr("colspan",parseInt(i.attr("colspan"),10)+1),G(i.find(">form>table"),p(r),!1,0),o=i.find("tr:first")),Q(o[0].cells,n,!0))}function et(e,t,n){n=n||1;var i,o,r;for(o=0,r=e.length;r>o;o++)i=e.eq(o).children().last(),i.attr("colspan",parseInt(i.attr("colspan"),10)+n),i=t.eq(o).children().last(),i.attr("colspan",parseInt(i.attr("colspan"),10)-n)}function tt(e){var t,n,i=0,o=e.find(">colgroup>col");for(t=0,n=o.length;n>t;t+=1)i+=parseInt(o[t].style.width,10);return i}function nt(e,t){var n,i,o,r;e=e[0],t=t[0],e.rows.length!==t.rows.length&&(n=e.offsetHeight,i=t.offsetHeight,n>i?(o=t.rows[t.rows.length-1],vn.test(o.className)&&(o=t.rows[t.rows.length-2]),r=n-i):(o=e.rows[e.rows.length-1],vn.test(o.className)&&(o=e.rows[e.rows.length-2]),r=i-n),o.style.height=o.offsetHeight+r+"px")}function it(e,t){var n,i=e.offsetHeight,o=t.offsetHeight;i>o?n=i+"px":o>i&&(n=o+"px"),n&&(e.style.height=t.style.height=n)}function ot(e,t){var n,i,o;if(typeof e===ln&&e===t)return e;if(vt(e)&&e.name===t)return e;if(bt(e))for(n=0,i=e.length;i>n;n++)if(o=e[n],typeof o===ln&&o===t||o.name===t)return o;return null}function rt(t,n){var i,o,r,a=yn.msie;if(n===!0){if(t=e(t),i=!0,i&&(o=t.parent().scrollTop(),r=t.parent().scrollLeft()),a)try{t[0].setActive()}catch(s){t[0].focus()}else t[0].focus();i&&(t.parent().scrollTop(o),t.parent().scrollLeft(r))}else e(t).one("focusin",function(e){e.preventDefault()}).focus()}function at(n){var i=e(n.currentTarget),o=i.is("th"),r=this.table.add(this.lockedTable),a=this.thead.parent().add(e(">table",this.lockedHeader)),s=e(n.target).is(":button,a,:input,a>.k-icon,textarea,span.k-select,span.k-icon,span.k-link,.k-input,.k-multiselect-wrap,.k-tool-icon"),l=i.closest("table")[0];if(!dt.support.touch)return s&&i.find(dt.roleSelector("filtercell")).length?(this.current(i),t):((l===r[0]||l===r[1]||l===a[0]||l===a[1])&&(e(n.target).is("a.k-i-collapse, a.k-i-expand")||(this.options.navigatable&&this.current(i),(o||!s)&&setTimeout(function(){xn&&e(dt._activeElement()).hasClass("k-widget")||rt(l,!0)}),o&&n.preventDefault())),t)}function st(e){return e&&(e.hasClass("k-edit-cell")||e.parent().hasClass("k-grid-edit-row"))}function lt(e,t,i){return'<tr role="row" class="k-grouping-row">'+n(t)+'<td colspan="'+e+'" aria-expanded="true"><p class="k-reset"><a class="k-icon k-i-collapse" href="#" tabindex="-1"></a>'+i+"</p></td></tr>"}function ct(e){return'<tr role="row" class="k-grouping-row"><td colspan="'+e+'" aria-expanded="true"><p class="k-reset">&nbsp;</p></td></tr>'}var dt=window.kendo,ht=dt.ui,ut=dt.data.DataSource,ft=dt.support.tbodyInnerHtml,pt=dt._activeElement,gt=ht.Widget,mt=dt.keys,vt=e.isPlainObject,_t=e.extend,wt=e.map,yt=e.grep,bt=e.isArray,xt=e.inArray,kt=Array.prototype.push,Ct=e.proxy,St=dt.isFunction,Tt=e.isEmptyObject,Dt=Math,At="progress",Pt="error",Mt=":not(.k-group-cell):not(.k-hierarchy-cell):visible",Et="tbody>tr:not(.k-grouping-row):not(.k-detail-row):not(.k-group-footer) > td:not(.k-group-cell):not(.k-hierarchy-cell)",It="tr:not(.k-footer-template):visible",Bt=":not(.k-group-cell):not(.k-hierarchy-cell):visible",zt=It+":first>"+Bt+":first",Lt="th.k-header:not(.k-group-cell):not(.k-hierarchy-cell)",Rt=".kendoGrid",Ft="edit",Ot="save",Nt="remove",Ht="detailInit",Vt="filterMenuInit",Ut="columnMenuInit",Wt="change",jt="columnHide",Gt="columnShow",qt="saveChanges",$t="dataBound",Yt="detailExpand",Qt="detailCollapse",Xt="k-state-focused",Kt="k-state-selected",Zt="k-grid-norecords",Jt="columnResize",en="columnReorder",tn="columnLock",nn="columnUnlock",on="click",rn="height",an="tabIndex",sn="function",ln="string",cn="Are you sure you want to delete this record?",dn="No records available.",hn="Delete",un="Cancel",fn=/(\}|\#)/gi,pn=/#/gi,gn="[\\x20\\t\\r\\n\\f]",mn=RegExp("(^|"+gn+")(k-group-cell|k-hierarchy-cell)("+gn+"|$)"),vn=RegExp("(^|"+gn+")(k-filter-row)("+gn+"|$)"),_n='<a class="k-button k-button-icontext #=className#" #=attr# href="\\#"><span class="#=iconClass# #=imageClass#"></span>#=text#</a>',wn=!1,yn=dt.support.browser,bn=yn.msie&&7==yn.version,xn=yn.msie&&8==yn.version,kn=gt.extend({init:function(e,t){var n=this;gt.fn.init.call(n,e,t),n._refreshHandler=Ct(n.refresh,n),n.setDataSource(t.dataSource),n.wrap()},setDataSource:function(e){var t=this;t.dataSource&&t.dataSource.unbind(Wt,t._refreshHandler),t.dataSource=e,t.dataSource.bind(Wt,t._refreshHandler)},options:{name:"VirtualScrollable",itemHeight:e.noop,prefetch:!0},destroy:function(){var e=this;gt.fn.destroy.call(e),e.dataSource.unbind(Wt,e._refreshHandler),e.wrapper.add(e.verticalScrollbar).off(Rt),e.drag&&(e.drag.destroy(),e.drag=null),e.wrapper=e.element=e.verticalScrollbar=null,e._refreshHandler=null},wrap:function(){var t,n=this,i=dt.support.scrollbar()+1,o=n.element;o.css({width:"auto",overflow:"hidden"}).css(wn?"padding-left":"padding-right",i),n.content=o.children().first(),t=n.wrapper=n.content.wrap('<div class="k-virtual-scrollable-wrap"/>').parent().bind("DOMMouseScroll"+Rt+" mousewheel"+Rt,Ct(n._wheelScroll,n)),dt.support.kineticScrollNeeded&&(n.drag=new dt.UserEvents(n.wrapper,{global:!0,start:function(e){e.sender.capture()},move:function(e){n.verticalScrollbar.scrollTop(n.verticalScrollbar.scrollTop()-e.y.delta),t.scrollLeft(t.scrollLeft()-e.x.delta),e.preventDefault()}})),n.verticalScrollbar=e('<div class="k-scrollbar k-scrollbar-vertical" />').css({width:i}).appendTo(o).bind("scroll"+Rt,Ct(n._scroll,n))},_wheelScroll:function(t){if(!t.ctrlKey){var n=this.verticalScrollbar,i=n.scrollTop(),o=dt.wheelDeltaY(t);!o||o>0&&0===i||0>o&&i+n[0].clientHeight==n[0].scrollHeight||(t.preventDefault(),e(t.currentTarget).one("wheel"+Rt,!1),this.verticalScrollbar.scrollTop(i+-o))}},_scroll:function(e){var t=this,n=!t.options.prefetch,i=e.currentTarget.scrollTop,o=t.dataSource,r=t.itemHeight,a=o.skip()||0,s=t._rangeStart||a,l=t.element.innerHeight(),c=!!(t._scrollbarTop&&t._scrollbarTop>i),d=Dt.max(Dt.floor(i/r),0),h=Dt.max(d+Dt.floor(l/r),0);t._scrollTop=i-s*r,t._scrollbarTop=i,t._scrolling=n,t._fetch(d,h,c)||(t.wrapper[0].scrollTop=t._scrollTop),n&&(t._scrollingTimeout&&clearTimeout(t._scrollingTimeout),t._scrollingTimeout=setTimeout(function(){t._scrolling=!1,t._page(t._rangeStart,t.dataSource.take())},100))},itemIndex:function(e){var t=this._rangeStart||this.dataSource.skip()||0;return t+e},position:function(e){var t,n=this._rangeStart||this.dataSource.skip()||0,i=this.dataSource.pageSize();return t=e>n?e-n+1:n-e-1,t>i?i:t},scrollIntoView:function(e){var t=this.wrapper[0],n=t.clientHeight,i=this._scrollTop||t.scrollTop,o=e[0].offsetTop,r=e[0].offsetHeight;i>o?this.verticalScrollbar[0].scrollTop-=n/2:o+r>=i+n&&(this.verticalScrollbar[0].scrollTop+=n/2)},_fetch:function(t,n,i){var o=this,r=o.dataSource,a=o.itemHeight,s=r.take(),l=o._rangeStart||r.skip()||0,c=Dt.floor(t/s)*s,d=!1,h=.33;return l>t?(d=!0,l=Dt.max(0,n-s),o._scrollTop=(t-l)*a,o._page(l,s)):n>=l+s&&!i?(d=!0,l=t,o._scrollTop=a,o._page(l,s)):!o._fetching&&o.options.prefetch&&(c+s-s*h>t&&t>s&&r.prefetch(c-s,s,e.noop),n>c+s*h&&r.prefetch(c+s,s,e.noop)),d},fetching:function(){return this._fetching},_page:function(e,t){var n=this,i=!n.options.prefetch,o=n.dataSource;clearTimeout(n._timeout),n._fetching=!0,n._rangeStart=e,o.inRange(e,t)?o.range(e,t):(i||dt.ui.progress(n.wrapper.parent(),!0),n._timeout=setTimeout(function(){n._scrolling||(i&&dt.ui.progress(n.wrapper.parent(),!0),o.range(e,t))},100))},repaintScrollbar:function(){var e,t=this,n="",i=25e4,o=t.dataSource,r=dt.support.kineticScrollNeeded?0:dt.support.scrollbar(),a=t.wrapper[0],s=t.itemHeight=t.options.itemHeight()||0,l=a.scrollWidth>a.offsetWidth?r:0,c=o.total()*s+l;for(e=0;e<Dt.floor(c/i);e++)n+='<div style="width:1px;height:'+i+'px"></div>';c%i&&(n+='<div style="width:1px;height:'+c%i+'px"></div>'),t.verticalScrollbar.html(n),a.scrollTop=t._scrollTop},refresh:function(){var e=this,t=e.dataSource,n=e._rangeStart;dt.ui.progress(e.wrapper.parent(),!1),clearTimeout(e._timeout),e.repaintScrollbar(),e.drag&&e.drag.cancel(),n&&!e._fetching&&(e._rangeStart=t.skip(),1===t.page()&&(e.verticalScrollbar[0].scrollTop=0)),e._fetching=!1}}),Cn={create:{text:"Add new record",imageClass:"k-add",className:"k-grid-add",iconClass:"k-icon"},cancel:{text:"Cancel changes",imageClass:"k-cancel",className:"k-grid-cancel-changes",iconClass:"k-icon"},save:{text:"Save changes",imageClass:"k-update",className:"k-grid-save-changes",iconClass:"k-icon"},destroy:{text:"Delete",imageClass:"k-delete",className:"k-grid-delete",iconClass:"k-icon"},edit:{text:"Edit",imageClass:"k-edit",className:"k-grid-edit",iconClass:"k-icon"},update:{text:"Update",imageClass:"k-update",className:"k-primary k-grid-update",iconClass:"k-icon"},canceledit:{text:"Cancel",imageClass:"k-cancel",className:"k-grid-cancel",iconClass:"k-icon"},excel:{text:"Export to Excel",imageClass:"k-i-excel",className:"k-grid-excel",iconClass:"k-icon"},pdf:{text:"Export to PDF",imageClass:"k-i-pdf",className:"k-grid-pdf",iconClass:"k-icon"}},Sn=dt.ui.DataBoundWidget.extend({init:function(t,n,i){var o=this;n=bt(n)?{dataSource:n}:n,gt.fn.init.call(o,t,n),i&&(o._events=i),wn=dt.support.isRtl(t),o._element(),o._aria(),o._columns(o.options.columns),o._dataSource(),o._tbody(),o._pageable(),o._thead(),o._groupable(),o._toolbar(),o._setContentHeight(),o._templates(),o._navigatable(),o._selectable(),o._clipboard(),o._details(),o._editable(),o._attachCustomCommandsEvent(),o._minScreenSupport(),o.options.autoBind?o.dataSource.fetch():o._footer(),o.lockedContent&&(o.wrapper.addClass("k-grid-lockedcolumns"),o._resizeHandler=function(){o.resize()},e(window).on("resize"+Rt,o._resizeHandler)),dt.notify(o)},events:[Wt,"dataBinding","cancel",$t,Yt,Qt,Ht,Vt,Ut,Ft,Ot,Nt,qt,Jt,en,Gt,jt,tn,nn],setDataSource:function(e){var t=this,n=t.options.scrollable;t.options.dataSource=e,t._dataSource(),t._pageable(),t._thead(),n&&(n.virtual?t.content.find(">.k-virtual-scrollable-wrap").scrollLeft(0):t.content.scrollLeft(0)),t.options.groupable&&t._groupable(),t.virtualScrollable&&t.virtualScrollable.setDataSource(t.options.dataSource),t.options.navigatable&&t._navigatable(),t.options.selectable&&t._selectable(),t.options.autoBind&&e.fetch()},options:{name:"Grid",columns:[],toolbar:null,autoBind:!0,filterable:!1,scrollable:!0,sortable:!1,selectable:!1,allowCopy:!1,navigatable:!1,pageable:!1,editable:!1,groupable:!1,rowTemplate:"",altRowTemplate:"",noRecords:!1,dataSource:{},height:null,resizable:!1,reorderable:!1,columnMenu:!1,detailTemplate:null,columnResizeHandleWidth:3,mobile:"",messages:{editable:{cancelDelete:un,confirmation:cn,confirmDelete:hn},commands:{create:Cn.create.text,cancel:Cn.cancel.text,save:Cn.save.text,destroy:Cn.destroy.text,edit:Cn.edit.text,update:Cn.update.text,canceledit:Cn.canceledit.text,excel:Cn.excel.text,pdf:Cn.pdf.text},noRecords:dn}},destroy:function(){var t,n=this;n._angularItems("cleanup"),n._destroyColumnAttachments(),gt.fn.destroy.call(n),this._navigatableTables=null,n._resizeHandler&&e(window).off("resize"+Rt,n._resizeHandler),n.pager&&n.pager.element&&n.pager.destroy(),n.pager=null,n.groupable&&n.groupable.element&&n.groupable.element.kendoGroupable("destroy"),n.groupable=null,n.options.reorderable&&n.wrapper.data("kendoReorderable").destroy(),n.selectable&&n.selectable.element&&(n.selectable.destroy(),n.clearArea(),n.copyHandler&&(n.wrapper.off("keydown",n.copyHandler),n.unbind(n.copyHandler)),n.updateClipBoardState&&(n.unbind(n.updateClipBoardState),n.updateClipBoardState=null),n.clearAreaHandler&&n.wrapper.off("keyup",n.clearAreaHandler)),n.selectable=null,n.resizable&&(n.resizable.destroy(),n._resizeUserEvents&&(n._resizeHandleDocumentClickHandler&&e(document).off("click",n._resizeHandleDocumentClickHandler),n._resizeUserEvents.destroy(),n._resizeUserEvents=null),n.resizable=null),n.virtualScrollable&&n.virtualScrollable.element&&n.virtualScrollable.destroy(),n.virtualScrollable=null,n._destroyEditable(),n.dataSource&&(n.dataSource.unbind(Wt,n._refreshHandler).unbind(At,n._progressHandler).unbind(Pt,n._errorHandler),n._refreshHandler=n._progressHandler=n._errorHandler=null),t=n.element.add(n.wrapper).add(n.table).add(n.thead).add(n.wrapper.find(">.k-grid-toolbar")),n.content&&(t=t.add(n.content).add(n.content.find(">.k-virtual-scrollable-wrap"))),n.lockedHeader&&n._removeLockedContainers(),n.pane&&n.pane.destroy(),n.minScreenResizeHandler&&e(window).off("resize",n.minScreenResizeHandler),n._draggableInstance&&n._draggableInstance.element&&n._draggableInstance.destroy(),n._draggableInstance=null,t.off(Rt),dt.destroy(n.wrapper),n.rowTemplate=n.altRowTemplate=n.lockedRowTemplate=n.lockedAltRowTemplate=n.detailTemplate=n.footerTemplate=n.groupFooterTemplate=n.lockedGroupFooterTemplate=n.noRecordsTemplate=null,n.scrollables=n.thead=n.tbody=n.element=n.table=n.content=n.footer=n.wrapper=n._groupableClickHandler=n._setContentWidthHandler=null},getOptions:function(){var n,i,o,r=this.options;return r.dataSource=null,n=_t(!0,{},this.options),n.columns=dt.deepExtend([],this.columns),i=this.dataSource,o=i.options.data&&i._data,i.options.data=null,n.dataSource=e.extend(!0,{},i.options),i.options.data=o,n.dataSource.data=o,n.dataSource.page=i.page(),n.dataSource.filter=i.filter(),n.dataSource.pageSize=i.pageSize(),n.dataSource.sort=i.sort(),n.dataSource.group=i.group(),n.dataSource.aggregate=i.aggregate(),n.dataSource.transport&&(n.dataSource.transport.dataSource=null),n.$angular=t,n},setOptions:function(e){var t,n,i,o,r=this.getOptions();dt.deepExtend(r,e),e.dataSource||(r.dataSource=this.dataSource),t=this.wrapper,n=this._events,i=this.element,this.destroy(),this.options=null,this._isMobile&&(o=t.closest(dt.roleSelector("pane")).parent(),o.after(t),o.remove(),t.removeClass("k-grid-mobile")),t[0]!==i[0]&&(t.before(i),t.remove()),i.empty(),this.init(i,r,n),this._setEvents(r)},items:function(){return this.lockedContent?this._items(this.tbody).add(this._items(this.lockedTable.children("tbody"))):this._items(this.tbody)},_items:function(t){return t.children().filter(function(){var t=e(this);return!t.hasClass("k-grouping-row")&&!t.hasClass("k-detail-row")&&!t.hasClass("k-group-footer")})},dataItems:function(){var e,t,n,i=dt.ui.DataBoundWidget.fn.dataItems.call(this);if(this.lockedContent){for(e=i.length,t=Array(2*e),n=e;--n>=0;)t[n]=t[n+e]=i[n];i=t}return i},_destroyColumnAttachments:function(){var t=this;t.resizeHandle=null,t.thead&&(this.angular("cleanup",function(){return{elements:t.thead.get()}}),t.thead.add(t.lockedHeader).find("th").each(function(){var t=e(this),n=t.data("kendoFilterMenu"),i=t.data("kendoColumnSorter"),o=t.data("kendoColumnMenu");n&&n.destroy(),i&&i.destroy(),o&&o.destroy()}))},_attachCustomCommandsEvent:function(){var e,t,n,i=this,o=O(i.columns||[]);for(t=0,n=o.length;n>t;t++)e=o[t].command,e&&s(i,i.wrapper,e)},_aria:function(){var e=this.element.attr("id")||"aria";e&&(this._cellId=e+"_active_cell")},_element:function(){var t=this,n=t.element;n.is("table")||(n=t.options.scrollable?t.element.find("> .k-grid-content > table"):t.element.children("table"),n.length||(n=e("<table />").appendTo(t.element))),bn&&n.attr("cellspacing",0),t.table=n.attr("role",t._hasDetails()?"treegrid":"grid"),t._wrapper()},_createResizeHandle:function(t,n){var i,o,r,a,s,l,c,d=this,h=d.options.columnResizeHandleWidth,u=d.options.scrollable,f=d.resizeHandle,p=this._groups();if(f&&d.lockedContent&&f.data("th")[0]!==n[0]&&(f.off(Rt).remove(),f=null),f||(f=d.resizeHandle=e('<div class="k-resize-handle"><div class="k-resize-handle-inner"></div></div>'),t.append(f)),wn)i=n.position().left,u&&(a=n.closest(".k-grid-header-wrap, .k-grid-header-locked"),s=yn.msie?a.scrollLeft():0,l=yn.webkit?a[0].scrollWidth-a[0].offsetWidth-a.scrollLeft():0,c=yn.mozilla?a[0].scrollWidth-a[0].offsetWidth-(a[0].scrollWidth-a[0].offsetWidth-a.scrollLeft()):0,i-=l-c+s);else{for(i=n[0].offsetWidth,o=N(n.closest("thead")).filter(":visible"),r=0;o.length>r&&o[r]!=n[0];r++)i+=o[r].offsetWidth;p>0&&(i+=t.find(".k-group-cell:first").outerWidth()*p),d._hasDetails()&&(i+=t.find(".k-hierarchy-cell:first").outerWidth())}f.css({top:n.position().top,left:i-h,height:n.outerHeight(),width:3*h}).data("th",n).show(),f.off("dblclick"+Rt).on("dblclick"+Rt,function(){d._autoFitLeafColumn(n.data("index"))})},_positionColumnResizeHandle:function(){var t=this,n=t.options.columnResizeHandleWidth,i=t.lockedHeader?t.lockedHeader.find("thead:first"):e();t.thead.add(i).on("mousemove"+Rt,"th",function(i){var r,a,s,l=e(this);l.hasClass("k-group-cell")||l.hasClass("k-hierarchy-cell")||(r=i.clientX,a=e(window).scrollLeft(),s=l.offset().left+(wn?0:this.offsetWidth),r+a>s-n&&s+n>r+a?t._createResizeHandle(l.closest("div"),l):t.resizeHandle?t.resizeHandle.hide():o(t.wrapper,""))})},_resizeHandleDocumentClick:function(t){e(t.target).closest(".k-column-active").length||(e(document).off(t),this._hideResizeHandle())},_hideResizeHandle:function(){this.resizeHandle&&(this.resizeHandle.data("th").removeClass("k-column-active"),this.lockedContent&&!this._isMobile?(this.resizeHandle.off(Rt).remove(),this.resizeHandle=null):this.resizeHandle.hide())},_positionColumnResizeHandleTouch:function(){var t=this,n=t.lockedHeader?t.lockedHeader.find("thead:first"):e();t._resizeUserEvents=new dt.UserEvents(n.add(t.thead),{filter:"th:not(.k-group-cell):not(.k-hierarchy-cell)",threshold:10,hold:function(n){var i=e(n.target);n.preventDefault(),i.addClass("k-column-active"),t._createResizeHandle(i.closest("div"),i),t._resizeHandleDocumentClickHandler||(t._resizeHandleDocumentClickHandler=Ct(t._resizeHandleDocumentClick,t)),e(document).on("click",t._resizeHandleDocumentClickHandler)}})},_resizable:function(){var t,n,i,r,a,s,l,c=this,d=c.options,h=this._isMobile,u=dt.support.mobileOS?0:dt.support.scrollbar();d.resizable&&(t=d.scrollable?c.wrapper.find(".k-grid-header-wrap:first"):c.wrapper,h?c._positionColumnResizeHandleTouch(t):c._positionColumnResizeHandle(t),c.resizable&&c.resizable.destroy(),c.resizable=new ht.Resizable(t.add(c.lockedHeader),{handle:(d.scrollable?"":">")+".k-resize-handle",hint:function(t){return e('<div class="k-grid-resize-indicator" />').css({height:t.data("th").outerHeight()+c.tbody.attr("clientHeight")})},start:function(t){var u,f,p,g;l=e(t.currentTarget).data("th"),h&&c._hideResizeHandle(),u=l.closest("table"),f=e.inArray(l[0],N(l.closest("thead")).filter(":visible")),a=u.parent().hasClass("k-grid-header-locked"),p=a?c.lockedTable:c.table,g=c.footer||e(),c.footer&&c.lockedContent&&(g=c.footer.children(a?".k-grid-footer-locked":".k-grid-footer-wrap")),o(c.wrapper,"col-resize"),s=d.scrollable?u.find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+f+")").add(p.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+f+")")).add(g.find("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+f+")")):p.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+f+")"),n=t.x.location,i=l.outerWidth(),r=a?p.children("tbody").outerWidth():c.tbody.outerWidth(),yn.webkit&&c.wrapper.addClass("k-grid-column-resizing")},resize:function(t){var o,h,f,p,g,m,v=wn?-1:1,_=i+t.x.location*v-n*v;d.scrollable?(a&&c.lockedFooter?o=c.lockedFooter.children("table"):c.footer&&(o=c.footer.find(">.k-grid-footer-wrap>table")),o&&o[0]||(o=e()),h=l.closest("table"),f=a?c.lockedTable:c.table,p=!1,g=c.wrapper.width()-u,m=_,a&&r-i+m>g&&(m=i+(g-r-2*u),0>m&&(m=_),p=!0),m>10&&(s.css("width",m),r&&(m=p?g-2*u:r+t.x.location*v-n*v,f.add(h).add(o).css("width",m),a||(c._footerWidth=m)))):_>10&&s.css("width",_)},resizeend:function(){var e,t,n,r=l.outerWidth();o(c.wrapper,""),yn.webkit&&c.wrapper.removeClass("k-grid-column-resizing"),i!=r&&(t=c.lockedHeader?c.lockedHeader.find("thead:first tr:first").add(c.thead.find("tr:first")):l.parent(),n=l.attr(dt.attr("index")),n||(n=t.find("th:not(.k-group-cell):not(.k-hierarchy-cell)").index(l)),e=O(c.columns)[n],e.width=r,c.trigger(Jt,{column:e,oldWidth:i,newWidth:r}),c._applyLockedContainersWidth(),c._syncLockedContentHeight(),c._syncLockedHeaderHeight()),c._hideResizeHandle(),l=null}}))},_draggable:function(){var t=this;t.options.reorderable&&(t._draggableInstance&&t._draggableInstance.destroy(),t._draggableInstance=t.wrapper.kendoDraggable({group:dt.guid(),filter:t.content?".k-grid-header:first "+Lt:"table:first>.k-grid-header "+Lt,drag:function(){t._hideResizeHandle()},hint:function(t){return e('<div class="k-header k-drag-clue" />').css({width:t.width(),paddingLeft:t.css("paddingLeft"),paddingRight:t.css("paddingRight"),lineHeight:t.height()+"px",paddingTop:t.css("paddingTop"),paddingBottom:t.css("paddingBottom")}).html(t.attr(dt.attr("title"))||t.attr(dt.attr("field"))||t.text()).prepend('<span class="k-icon k-drag-status k-denied" />')}}).data("kendoDraggable"))},_reorderable:function(){var t,n=this;n.options.reorderable&&(n.wrapper.data("kendoReorderable")&&n.wrapper.data("kendoReorderable").destroy(),t=function(e,t,i){var o=e[t],r=e[i],a=c(o,n.columns);return e=a?a.columns:n.columns,xt(r,e)},n.wrapper.kendoReorderable({draggable:n._draggableInstance,dragOverContainers:function(e,i){var o=S(n.columns);return o[e].lockable!==!1&&t(o,e,i)>-1},inSameContainer:function(i){return e(i.source).parent()[0]===e(i.target).parent()[0]&&t(S(n.columns),i.sourceIndex,i.targetIndex)>-1},change:function(e){var i=S(n.columns),o=i[e.oldIndex],r=t(i,e.oldIndex,e.newIndex);n.trigger(en,{newIndex:r,oldIndex:xt(o,i),column:o}),n.reorderColumn(r,o,"before"===e.position)}}))},_reorderHeader:function(e,t,n){var i,o,s,l,c=this,d=b(e[0],c.columns),h=b(t,c.columns),u=[];for(i=0;e.length>i;i++)e[i].columns&&(u=u.concat(e[i].columns));o=a(c.lockedHeader,c.thead,"tr:eq("+d.row+")>th.k-header:not(.k-group-cell,.k-hierarchy-cell)"),s=B(e).length,l=B([t]).length,u.length?(s>0&&0===l?v(e,t,u,c.columns,c.lockedHeader.find("thead"),c.thead,this._groups()):0===s&&l>0&&v(e,t,u,c.columns,c.thead,c.lockedHeader.find("thead"),this._groups()),(t.columns||d.cell-h.cell>1||h.cell-d.cell>1)&&(t=k(c.columns,t,e[0],n),t&&c._reorderHeader(u,t,n))):s!==l&&m(o[d.cell],c.columns,s),r(o,d.cell,h.cell,n,e.length)},_reorderContent:function(t,n,i){var o,s,l,c,d=this,h=e(),u=t[0],f=p(t),g=xt(u,O(d.columns)),m=xt(n,O(d.columns)),v=xt(u,F(d.columns)),_=xt(n,F(d.columns)),w=B(d.columns).length,y=!!n.locked,b=d.footer||d.wrapper.find(".k-grid-footer"),x=o=_;
for(n.hidden&&(y?(_=d.lockedTable.find("colgroup"),x=d.lockedHeader.find("colgroup"),o=e(d.lockedFooter).find(">table>colgroup")):(_=d.tbody.prev(),x=d.thead.prev(),o=b.find(".k-grid-footer-wrap").find(">table>colgroup"))),d._hasFilterRow()&&r(d.wrapper.find(".k-filter-row th:not(.k-group-cell,.k-hierarchy-cell)"),g,m,i,t.length),r(a(d.lockedHeader,d.thead.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),v,x,i,f.length),d.options.scrollable&&r(a(d.lockedTable,d.tbody.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),v,_,i,f.length),b&&b.length&&(r(a(d.lockedFooter,b.find(".k-grid-footer-wrap"),">table>colgroup>col:not(.k-group-col,.k-hierarchy-col)"),v,o,i,f.length),r(b.find(".k-footer-template>td:not(.k-group-cell,.k-hierarchy-cell)"),g,m,i,t.length)),s=d.tbody.children(":not(.k-grouping-row,.k-detail-row)"),d.lockedTable&&(w>m?g>=w&&et(d.lockedTable.find(">tbody>tr.k-grouping-row"),d.table.find(">tbody>tr.k-grouping-row"),t.length):w>g&&et(d.table.find(">tbody>tr.k-grouping-row"),d.lockedTable.find(">tbody>tr.k-grouping-row"),t.length),h=d.lockedTable.find(">tbody>tr:not(.k-grouping-row,.k-detail-row)")),l=0,c=s.length;c>l;l+=1)r(a(h[l],s[l],">td:not(.k-group-cell,.k-hierarchy-cell)"),g,m,i,t.length)},_autoFitLeafColumn:function(e){this.autoFitColumn(O(this.columns)[e])},autoFitColumn:function(t){var n,i,o,r,a,s,l,c,d,h,p,g,m,v,_,w,y,b=this,x=b.options,k=b.columns,C=b.lockedHeader?N(b.lockedHeader.find(">table>thead")).filter(u).length:0,S="col:not(.k-group-col):not(.k-hierarchy-col)",D="td:visible:not(.k-group-cell):not(.k-hierarchy-cell)";if(t="number"==typeof t?k[t]:vt(t)?yt(T(k),function(e){return e===t})[0]:yt(T(k),function(e){return e.field===t})[0],t&&f(t)){for(n=xt(t,O(k)),r=t.locked,o=r?b.lockedHeader.children("table"):b.thead.parent(),i=o.find("[data-index='"+n+"']"),s=r?b.lockedTable:b.table,l=b.footer||e(),b.footer&&b.lockedContent&&(l=b.footer.children(r?".k-grid-footer-locked":".k-grid-footer-wrap")),c=l.find("table").first(),b.lockedHeader&&!r&&(n-=C),d=0;k.length>d&&k[d]!==t;d++)k[d].hidden&&n--;if(a=x.scrollable?o.find(S).eq(n).add(s.children("colgroup").find(S).eq(n)).add(c.find("colgroup").find(S).eq(n)):s.children("colgroup").find(S).eq(n),h=o.add(s).add(c),p=i.outerWidth(),a.width(""),h.css("table-layout","fixed"),a.width("auto"),h.addClass("k-autofitting"),h.css("table-layout",""),g=Math.ceil(Math.max(i.outerWidth(),s.find("tr:not(.k-grouping-row)").eq(0).children(D).eq(n).outerWidth(),c.find("tr").eq(0).children(D).eq(n).outerWidth()))+1,a.width(g),t.width=g,x.scrollable){for(m=o.find("col"),_=0,w=0,y=m.length;y>w;w+=1){if(v=m[w].style.width,!v||-1!=v.indexOf("%")){_=0;break}_+=parseInt(v,10)}_&&h.each(function(){this.style.width=_+"px"})}yn.msie&&8==yn.version&&(h.css("display","inline-table"),setTimeout(function(){h.css("display","table")},1)),h.removeClass("k-autofitting"),b.trigger(Jt,{column:t,oldWidth:p,newWidth:g}),b._applyLockedContainersWidth(),b._syncLockedContentHeight(),b._syncLockedHeaderHeight()}},reorderColumn:function(e,n,i){var o,r,a=this,s=c(n,a.columns),l=s?s.columns:a.columns,d=xt(n,l),h=l[e],u=!!h.locked,f=B(a.columns).length;d!==e&&(n.locked||!u||1!=z(a.columns).length)&&(!n.locked||u||1!=f)&&(a._hideResizeHandle(),i===t&&(i=d>e),r=[n],a._reorderHeader(r,h,i),a.lockedHeader&&(E(a.thead),E(a.lockedHeader)),h.columns&&(h=O(h.columns),h=h[i?0:h.length-1]),n.columns&&(r=O(n.columns)),a._reorderContent(r,h,i),o=!!n.locked,o=o!=u,n.locked=u,l.splice(i?e:e+1,0,n),l.splice(e>d?d:d+1,1),a._templates(),a._updateColumnCellIndex(),a._updateTablesWidth(),a._applyLockedContainersWidth(),a._syncLockedHeaderHeight(),a._syncLockedContentHeight(),a._updateFirstColumnClass(),o&&(u?a.trigger(tn,{column:n}):a.trigger(nn,{column:n})))},_updateColumnCellIndex:function(){var e,t=0;this.lockedHeader&&(e=this.lockedHeader.find("thead"),t=_(e,B(this.columns))),_(this.thead,z(this.columns),t)},lockColumn:function(e){var t,n=this.columns;e="number"==typeof e?n[e]:yt(n,function(t){return t.field===e})[0],!e||e.locked||e.hidden||(t=B(n).length-1,this.reorderColumn(t,e,!1))},unlockColumn:function(e){var t,n=this.columns;e="number"==typeof e?n[e]:yt(n,function(t){return t.field===e})[0],e&&e.locked&&!e.hidden&&(t=B(n).length,this.reorderColumn(t,e,!0))},cellIndex:function(t){var n=0;return this.lockedTable&&!e.contains(this.lockedTable[0],t[0])&&(n=O(B(this.columns)).length),e(t).parent().children("td:not(.k-group-cell,.k-hierarchy-cell)").index(t)+n},_modelForContainer:function(t){t=e(t),t.is("tr")||"popup"===this._editMode()||(t=t.closest("tr"));var n=t.attr(dt.attr("uid"));return this.dataSource.getByUid(n)},_editable:function(){var t,n=this,i=n.selectable&&n.selectable.options.multiple,o=n.options.editable,r=function(){var t=pt(),i=n._editContainer;!i||e.contains(i[0],t)||i[0]===t||e(t).closest(".k-animation-container").length||n.editable.end()&&n.closeCell()};o&&(t=n._editMode(),"incell"===t?o.update!==!1&&n.wrapper.on(on+Rt,"tr:not(.k-grouping-row) > td",function(t){var o=e(this),r=n.lockedTable&&o.closest("table")[0]===n.lockedTable[0];o.hasClass("k-hierarchy-cell")||o.hasClass("k-detail-cell")||o.hasClass("k-group-cell")||o.hasClass("k-edit-cell")||o.has("a.k-grid-delete").length||o.has("button.k-grid-delete").length||o.closest("tbody")[0]!==n.tbody[0]&&!r||e(t.target).is(":input")||(n.editable?n.editable.end()&&(i&&e(pt()).blur(),n.closeCell(),n.editCell(o)):n.editCell(o))}).on("focusin"+Rt,function(){e.contains(this,pt())||(clearTimeout(n.timer),n.timer=null)}).on("focusout"+Rt,function(){n.timer=setTimeout(r,1)}):o.update!==!1&&n.wrapper.on(on+Rt,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible a.k-grid-edit",function(t){t.preventDefault(),n.editRow(e(this).closest("tr"))}),o.destroy!==!1?n.wrapper.on(on+Rt,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible .k-grid-delete",function(t){t.preventDefault(),t.stopPropagation(),n.removeRow(e(this).closest("tr"))}):n.wrapper.on(on+Rt,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible button.k-grid-delete",function(e){e.stopPropagation(),n._confirmation()||e.preventDefault()}))},editCell:function(t){var n,i,o,r;t=e(t),n=this,i=O(n.columns)[n.cellIndex(t)],o=n._modelForContainer(t),n.closeCell(),!o||o.editable&&!o.editable(i.field)||i.command||!i.field||(n._attachModelChange(o),n._editContainer=t,n.editable=t.addClass("k-edit-cell").kendoEditable({fields:{field:i.field,format:i.format,editor:i.editor,values:i.values},model:o,target:n,change:function(e){n.trigger(Ot,{values:e.values,container:t,model:o})&&e.preventDefault()}}).data("kendoEditable"),r=t.parent().addClass("k-grid-edit-row"),n.lockedContent&&it(r[0],n._relatedRow(r).addClass("k-grid-edit-row")[0]),n.trigger(Ft,{container:t,model:o}))},_adjustLockedHorizontalScrollBar:function(){var e=this.table,t=e.parent(),n=e[0].offsetWidth>t[0].clientWidth?dt.support.scrollbar():0;this.lockedContent.height(t.height()-n)},_syncLockedContentHeight:function(){this.lockedTable&&(this.touchScroller||this._adjustLockedHorizontalScrollBar(),this._adjustRowsHeight(this.table,this.lockedTable))},_syncLockedHeaderHeight:function(){var e,t;this.lockedHeader&&(e=this.lockedHeader.children("table"),t=this.thead.parent(),this._adjustRowsHeight(e,t),nt(e,t))},_syncLockedFooterHeight:function(){this.lockedFooter&&this.footer&&this.footer.length&&this._adjustRowsHeight(this.lockedFooter.children("table"),this.footer.find(".k-grid-footer-wrap > table"))},_destroyEditable:function(){var e=this,t=function(){if(e.editable){var t=e.editView?e.editView.element:e._editContainer;t&&(t.off(on+Rt,"a.k-grid-cancel",e._editCancelClickHandler),t.off(on+Rt,"a.k-grid-update",e._editUpdateClickHandler)),e._detachModelChange(),e.editable.destroy(),e.editable=null,e._editContainer=null,e._destroyEditView()}};e.editable&&("popup"!==e._editMode()||e._isMobile?t():e._editContainer.data("kendoWindow").bind("deactivate",t).close()),e._actionSheet&&(e._actionSheet.destroy(),e._actionSheet=null)},_destroyEditView:function(){this.editView&&(this.editView.purge(),this.editView=null,this.pane.navigate(""))},_attachModelChange:function(e){var t=this;t._modelChangeHandler=function(e){t._modelChange({field:e.field,model:this})},e.bind("change",t._modelChangeHandler)},_detachModelChange:function(){var e=this,t=e._editContainer,n=e._modelForContainer(t);n&&n.unbind(Wt,e._modelChangeHandler)},closeCell:function(t){var n,i,o,r,a=this,s=a._editContainer;s&&(n=s.closest("tr").attr(dt.attr("uid")),r=a.dataSource.getByUid(n),t&&a.trigger("cancel",{container:s,model:r})||(s.removeClass("k-edit-cell"),i=O(a.columns)[a.cellIndex(s)],o=s.parent().removeClass("k-grid-edit-row"),a._destroyEditable(),a._displayCell(s,i,r),s.hasClass("k-dirty-cell")&&e('<span class="k-dirty"/>').prependTo(s),a.lockedContent&&it(o.css("height","")[0],a._relatedRow(o).css("height","")[0])))},_displayCell:function(e,t,n){var i=this,o={storage:{},count:0},r=_t({},dt.Template,i.options.templateSettings),a=dt.template(i._cellTmpl(t,o),r);o.count>0&&(a=Ct(a,o.storage)),e.empty().html(a(n)),i.angular("compile",function(){return{elements:e,data:[{dataItem:n}]}})},removeRow:function(e){this._confirmation(e)&&this._removeRow(e)},_removeRow:function(t){var n,i=this,o=i._editMode();"incell"!==o&&i.cancelRow(),t=e(t),i.lockedContent&&(t=t.add(i._relatedRow(t))),t=t.hide(),n=i._modelForContainer(t),n&&!i.trigger(Nt,{row:t,model:n})?(i.dataSource.remove(n),("inline"===o||"popup"===o)&&i.dataSource.sync()):"incell"===o&&i._destroyEditable()},_editMode:function(){var e="incell",t=this.options.editable;return t!==!0&&(e="string"==typeof t?t:t.mode||e),e},editRow:function(n){var i,o,r,a=this;n instanceof dt.data.ObservableObject?i=n:(n=e(n),i=a._modelForContainer(n)),o=a._editMode(),a.cancelRow(),i&&(a._attachModelChange(i),"popup"===o?a._createPopupEditor(i):"inline"===o?a._createInlineEditor(n,i):"incell"===o&&e(n).children(Mt).each(function(){var n=e(this),o=O(a.columns)[n.index()];return i=a._modelForContainer(n),i&&(!i.editable||i.editable(o.field))&&o.field?(a.editCell(n),!1):t}),r=a.editView?a.editView.element:a._editContainer,r&&(this._editCancelClickHandler||(this._editCancelClickHandler=Ct(this._editCancelClick,this)),r.on(on+Rt,"a.k-grid-cancel",this._editCancelClickHandler),this._editUpdateClickHandler||(this._editUpdateClickHandler=Ct(this._editUpdateClick,this)),r.on(on+Rt,"a.k-grid-update",this._editUpdateClickHandler)))},_editUpdateClick:function(e){e.preventDefault(),e.stopPropagation(),this.saveRow()},_editCancelClick:function(t){var n,i=this,o=i.options.navigatable,r=i.editable.options.model,a=i.editView?i.editView.element:i._editContainer;t.preventDefault(),t.stopPropagation(),i.trigger("cancel",{container:a,model:r})||(n=i.items().index(e(i.current()).parent()),i.cancelRow(),o&&(i.current(i.items().eq(n).children().filter(Bt).first()),rt(i.table,!0)))},_createPopupEditor:function(n){var i,o,r,a,s,l,c,d,h,u,f,p=this,g="<div "+dt.attr("uid")+'="'+n.uid+'" class="k-popup-edit-form'+(p._isMobile?" k-mobile-list":"")+'"><div class="k-edit-form-container">',m=[],v=O(p.columns),_=p.options.editable,w=_.template,y=vt(_)?_.window:{},b=_t({},dt.Template,p.options.templateSettings);if(y=y||{},w)for(typeof w===ln&&(w=window.unescape(w)),g+=dt.template(w,b)(n),r=0,a=v.length;a>r;r++)i=v[r],i.command&&(d=ot(i.command,"edit"),d&&(o=d));else for(r=0,a=v.length;a>r;r++)i=v[r],i.command?i.command&&(d=ot(i.command,"edit"),d&&(o=d)):(g+='<div class="k-edit-label"><label for="'+i.field+'">'+(i.title||i.field||"")+"</label></div>",n.editable&&!n.editable(i.field)||!i.field?(u={storage:{},count:0},s=dt.template(p._cellTmpl(i,u),b),u.count>0&&(s=Ct(s,u.storage)),g+='<div class="k-edit-field">'+s(n)+"</div>"):(m.push({field:i.field,format:i.format,editor:i.editor,values:i.values}),g+="<div "+dt.attr("container-for")+'="'+i.field+'" class="k-edit-field"></div>'));o&&vt(o)&&(o.text&&vt(o.text)&&(l=o.text.update,c=o.text.cancel),o.attr&&(h=o.attr)),p._isMobile?(g+="</div></div>",p.editView=p.pane.append("<div data-"+dt.ns+'role="view" data-'+dt.ns+'init-widgets="false" class="k-grid-edit-form"><div data-'+dt.ns+'role="header" class="k-header">'+p._createButton({name:"update",text:l,attr:h})+(y.title||"Edit")+p._createButton({name:"canceledit",text:c,attr:h})+"</div>"+g+"</div>"),f=p._editContainer=p.editView.element.find(".k-popup-edit-form")):(g+='<div class="k-edit-buttons k-state-default">',g+=p._createButton({name:"update",text:l,attr:h})+p._createButton({name:"canceledit",text:c,attr:h}),g+="</div></div></div>",f=p._editContainer=e(g).appendTo(p.wrapper).eq(0).kendoWindow(_t({modal:!0,resizable:!1,draggable:!0,title:"Edit",visible:!1,close:function(i){if(i.userTriggered){if(i.sender.element.focus(),p.trigger("cancel",{container:f,model:n}))return i.preventDefault(),t;var o=p.items().index(e(p.current()).parent());p.cancelRow(),p.options.navigatable&&(p.current(p.items().eq(o).children().filter(Bt).first()),rt(p.table,!0))}}},y))),p.editable=p._editContainer.kendoEditable({fields:m,model:n,clearContainer:!1,target:p}).data("kendoEditable"),p._isMobile&&f.find("input[type=checkbox],input[type=radio]").parent(".k-edit-field").addClass("k-check").prev(".k-edit-label").addClass("k-check").click(function(){e(this).next().children("input").click()}),p._openPopUpEditor(),p.trigger(Ft,{container:f,model:n})},_openPopUpEditor:function(){this._isMobile?this.pane.navigate(this.editView,this._editAnimation):this._editContainer.data("kendoWindow").center().open()},_createInlineEditor:function(t,n){var i,o,r,a=this,s=[];a.lockedContent&&(t=t.add(a._relatedRow(t))),t.children(":not(.k-group-cell,.k-hierarchy-cell)").each(function(){if(o=e(this),i=O(a.columns)[a.cellIndex(o)],i.command||!i.field||n.editable&&!n.editable(i.field)){if(i.command&&(r=ot(i.command,"edit"))){o.empty();var t,l,c;vt(r)&&(r.text&&vt(r.text)&&(t=r.text.update,l=r.text.cancel),r.attr&&(c=r.attr)),e(a._createButton({name:"update",text:t,attr:c})+a._createButton({name:"canceledit",text:l,attr:c})).appendTo(o)}}else s.push({field:i.field,format:i.format,editor:i.editor,values:i.values}),o.attr(dt.attr("container-for"),i.field),o.empty()}),a._editContainer=t,a.editable=new dt.ui.Editable(t.addClass("k-grid-edit-row"),{target:a,fields:s,model:n,clearContainer:!1}),t.length>1&&(it(t[0],t[1]),a._applyLockedContainersWidth()),a.trigger(Ft,{container:t,model:n})},cancelRow:function(){var e,t=this,n=t._editContainer;n&&(e=t._modelForContainer(n),t._destroyEditable(),t.dataSource.cancelChanges(e),t._displayRow("popup"!==t._editMode()?n:t.tbody.find("["+dt.attr("uid")+"="+e.uid+"]")))},saveRow:function(){var e=this,t=e._editContainer,n=e._modelForContainer(t),i=e.editable;t&&i&&i.end()&&!e.trigger(Ot,{container:t,model:n})&&e.dataSource.sync()},_displayRow:function(t){var n,i,o,r=this,a=r._modelForContainer(t),s=t.hasClass("k-state-selected"),l=t.hasClass("k-alt");a&&(r.lockedContent&&(n=e((l?r.lockedAltRowTemplate:r.lockedRowTemplate)(a)),r._relatedRow(t.last()).replaceWith(n)),r.angular("cleanup",function(){return{elements:t.get()}}),i=e((l?r.altRowTemplate:r.rowTemplate)(a)),t.replaceWith(i),r.angular("compile",function(){return{elements:i.get(),data:[{dataItem:a}]}}),s&&r.options.selectable&&r.select(i.add(n)),n&&it(i[0],n[0]),o=i.next(),o.hasClass("k-detail-row")&&o.is(":visible")&&i.find(".k-hierarchy-cell .k-icon").removeClass("k-plus").addClass("k-minus"))},_showMessage:function(t,n){var i,o,r,a=this;return a._isMobile?(i=dt.template('<ul><li class="km-actionsheet-title">#:title#</li><li><a href="\\#" class="k-button k-grid-delete">#:confirmDelete#</a></li></ul>'),o=e(i(t)).appendTo(a.view.element),r=a._actionSheet=new dt.mobile.ui.ActionSheet(o,{cancel:t.cancelDelete,cancelTemplate:'<li class="km-actionsheet-cancel"><a class="k-button" href="\\#">#:cancel#</a></li>',close:function(){this.destroy()},command:function(t){var i=e(t.currentTarget).parent();i.hasClass("km-actionsheet-cancel")||a._removeRow(n)},popup:a._actionSheetPopupOptions}),r.open(n),!1):window.confirm(t.title)},_confirmation:function(e){var t=this,n=t.options.editable,i=n===!0||typeof n===ln?t.options.messages.editable.confirmation:n.confirmation;return i!==!1&&null!=i?(typeof i===sn&&(i=i(t._modelForContainer(e))),t._showMessage({confirmDelete:n.confirmDelete||t.options.messages.editable.confirmDelete,cancelDelete:n.cancelDelete||t.options.messages.editable.cancelDelete,title:i===!0?t.options.messages.editable.confirmation:i},e)):!0},cancelChanges:function(){this.dataSource.cancelChanges()},saveChanges:function(){var e=this;(e.editable&&e.editable.end()||!e.editable)&&!e.trigger(qt)&&e.dataSource.sync()},addRow:function(){var e,t,n,i,o,r,a=this,s=a.dataSource,l=a._editMode(),c=a.options.editable.createAt||"",d=s.pageSize(),h=s.view()||[];(a.editable&&a.editable.end()||!a.editable)&&("incell"!=l&&a.cancelRow(),e=s.indexOf(h[0]),"bottom"==c.toLowerCase()&&(e+=h.length,d&&!s.options.serverPaging&&h.length>=d&&(e-=1)),0>e&&(e=s.page()>s.totalPages()?(s.page()-1)*d:0),t=s.insert(e,{}),n=t.uid,i=a.lockedContent?a.lockedTable:a.table,o=i.find("tr["+dt.attr("uid")+"="+n+"]"),r=o.children("td:not(.k-group-cell,.k-hierarchy-cell)").eq(a._firstEditableColumnIndex(o)),"inline"===l&&o.length?a.editRow(o):"popup"===l?a.editRow(t):r.length&&a.editCell(r),"bottom"==c.toLowerCase()&&a.lockedContent&&(a.lockedContent[0].scrollTop=a.content[0].scrollTop=a.content[0].offsetHeight))},_firstEditableColumnIndex:function(e){var t,n,i,o=this,r=O(o.columns),a=o._modelForContainer(e);for(n=0,i=r.length;i>n;n++)if(t=r[n],a&&(!a.editable||a.editable(t.field))&&!t.command&&t.field&&t.hidden!==!0)return n;return-1},_toolbar:function(){var t,n=this,i=n.wrapper,o=n.options.toolbar,r=n.options.editable;o&&(t=n.wrapper.find(".k-grid-toolbar"),t.length||(St(o)||(o=typeof o===ln?o:n._toolbarTmpl(o).replace(pn,"\\#"),o=Ct(dt.template(o),n)),t=e('<div class="k-header k-grid-toolbar" />').html(o({})).prependTo(i),n.angular("compile",function(){return{elements:t.get()}})),r&&r.create!==!1&&t.on(on+Rt,".k-grid-add",function(e){e.preventDefault(),n.addRow()}).on(on+Rt,".k-grid-cancel-changes",function(e){e.preventDefault(),n.cancelChanges()}).on(on+Rt,".k-grid-save-changes",function(e){e.preventDefault(),n.saveChanges()}),t.on(on+Rt,".k-grid-excel",function(e){e.preventDefault(),n.saveAsExcel()}),t.on(on+Rt,".k-grid-pdf",function(e){e.preventDefault(),n.saveAsPDF()}))},_toolbarTmpl:function(e){var t,n,i=this,o="";if(bt(e))for(t=0,n=e.length;n>t;t++)o+=i._createButton(e[t]);return o},_createButton:function(e){var n,o=e.template||_n,r=typeof e===ln?e:e.name||e.text,a=Cn[r]?Cn[r].className:"k-grid-"+(r||"").replace(/\s/g,""),s={className:a,text:r,imageClass:"",attr:"",iconClass:""},l=this.options.messages.commands;if(!(r||vt(e)&&e.template))throw Error("Custom commands should have name specified");return vt(e)?(e.className&&xt(s.className,e.className.split(" "))<0?e.className+=" "+s.className:e.className===t&&(e.className=s.className),"edit"===r&&vt(e.text)&&(e=_t(!0,{},e),e.text=e.text.edit),e.attr&&(vt(e.attr)&&(e.attr=i(e.attr)),typeof e.attr===ln&&(n=e.attr.match(/class="(.+?)"/),n&&xt(n[1],e.className.split(" "))<0&&(e.className+=" "+n[1]))),s=_t(!0,s,Cn[r],{text:l[r]},e)):s=_t(!0,s,Cn[r],{text:l[r]}),dt.template(o)(s)},_hasFooters:function(){return!!this.footerTemplate||!!this.groupFooterTemplate||this.footer&&this.footer.length>0||this.wrapper.find(".k-grid-footer").length>0},_groupable:function(){var t=this;t._groupableClickHandler?t.table.add(t.lockedTable).off(on+Rt,t._groupableClickHandler):t._groupableClickHandler=function(n){var i=e(this),o=i.closest("tr");i.hasClass("k-i-collapse")?t.collapseGroup(o):t.expandGroup(o),n.preventDefault(),n.stopPropagation()},t._isLocked()?t.lockedTable.on(on+Rt,".k-grouping-row .k-i-collapse, .k-grouping-row .k-i-expand",t._groupableClickHandler):t.table.on(on+Rt,".k-grouping-row .k-i-collapse, .k-grouping-row .k-i-expand",t._groupableClickHandler),t._attachGroupable()},_attachGroupable:function(){var t=this,n=t.wrapper,i=t.options.groupable,o=Lt+"["+dt.attr("field")+"]",r=t.content?".k-grid-header:first "+o:"table:first>.k-grid-header "+o;i&&i.enabled!==!1&&(n.has("div.k-grouping-header")[0]||e("<div>&nbsp;</div>").addClass("k-grouping-header").prependTo(n),t.groupable&&t.groupable.destroy(),t.groupable=new ht.Groupable(n,_t({},i,{draggable:t._draggableInstance,groupContainer:">div.k-grouping-header",dataSource:t.dataSource,draggableElements:r,filter:r,allowDrag:t.options.reorderable})))},_continuousItems:function(t,n){var i,o,r,a,s,l,c,d;if(this.lockedContent){for(i=this,o=i.table.add(i.lockedTable),r=e(t,o[0]),a=e(t,o[1]),s=n?B(i.columns).length:1,l=n?i.columns.length-s:1,c=[],d=0;r.length>d;d+=s)kt.apply(c,r.slice(d,d+s)),kt.apply(c,a.splice(0,l));return c}},_selectable:function(){var n,i,o,r,a=this,s=[],l=a._isLocked(),c=a.options.selectable;c&&(a.selectable&&a.selectable.destroy(),c=dt.ui.Selectable.parseOptions(c),n=c.multiple,i=c.cell,a._hasDetails()&&(s[s.length]=".k-detail-row"),(a.options.groupable||a._hasFooters())&&(s[s.length]=".k-grouping-row,.k-group-footer"),s=s.join(","),""!==s&&(s=":not("+s+")"),o=a.table,l&&(o=o.add(a.lockedTable)),r=">"+(i?Et:"tbody>tr"+s),a.selectable=new dt.ui.Selectable(o,{filter:r,aria:!0,multiple:n,change:function(){a.trigger(Wt)},useAllItems:l&&n&&i,relatedTarget:function(t){var n,o,r,s;if(!i&&l){for(o=e(),r=0,s=t.length;s>r;r++)n=a._relatedRow(t[r]),xt(n[0],t)<0&&(o=o.add(n));return o}},continuousItems:function(){return a._continuousItems(r,i)}}),a.options.navigatable&&o.on("keydown"+Rt,function(r){var s=a.current(),c=r.target;if(r.keyCode===mt.SPACEBAR&&e.inArray(c,o)>-1&&!s.is(".k-edit-cell,.k-header")&&s.parent().is(":not(.k-grouping-row,.k-detail-row,.k-group-footer)")){if(r.preventDefault(),r.stopPropagation(),s=i?s:s.parent(),l&&!i&&(s=s.add(a._relatedRow(s))),n)if(r.ctrlKey){if(s.hasClass(Kt))return s.removeClass(Kt),a.trigger(Wt),t}else a.selectable.clear();else a.selectable.clear();a.selectable.value(s)}}))},_clipboard:function(){var e,t=this.options,n=t.selectable;n&&t.allowCopy&&(e=this,t.navigatable||e.table.add(e.lockedTable).attr("tabindex",0).on("mousedown"+Rt+" keydown"+Rt,".k-detail-cell",function(e){e.target!==e.currentTarget&&e.stopImmediatePropagation()}).on("mousedown"+Rt,It+">"+Bt,Ct(at,e)),e.copyHandler=Ct(e.copySelection,e),e.updateClipBoardState=function(){e.areaClipBoard&&e.areaClipBoard.val(e.getTSV()).focus().select()},e.bind("change",e.updateClipBoardState),e.wrapper.on("keydown",e.copyHandler),e.clearAreaHandler=Ct(e.clearArea,e),e.wrapper.on("keyup",e.clearAreaHandler))},copySelection:function(t){t instanceof jQuery.Event&&!t.ctrlKey&&!t.metaKey||e(t.target).is("input:visible,textarea:visible")||window.getSelection&&""+window.getSelection()||document.selection&&document.selection.createRange().text||(this.areaClipBoard||(this.areaClipBoard=e("<textarea />").css({position:"fixed",top:"50%",left:"50%",opacity:0,width:0,height:0}).appendTo(this.wrapper)),this.areaClipBoard.val(this.getTSV()).focus().select())},getTSV:function(){var t,n,i,o,r,a,s=this,l=s.select(),c="	",d=s.options.allowCopy,h=!0;return e.isPlainObject(d)&&d.delimeter&&(c=d.delimeter),t="",l.length&&(l.eq(0).is("tr")&&(l=l.find("td:not(.k-group-cell)")),h&&l.filter(":visible"),n=[],i=this.columns.length,o=s._isLocked()&&B(s.columns).length,r=!0,e.each(l,function(t,a){var l,c,d,u;a=e(a),l=a.closest("tr"),c=l.index(),d=a.index(),h&&(d-=a.prevAll(":hidden").length),o&&r&&(r=e.contains(s.lockedTable[0],a[0])),s._groups()&&r&&(d-=s._groups()),d=r?d:d+o,i>d&&(i=d),u=a.text(),n[c]||(n[c]=[]),n[c][d]=u}),a=n.length,n=e.each(n,function(e,t){t&&(n[e]=t.slice(i),a>e&&(a=e))}),e.each(n.slice(a),function(e,n){t+=n?n.join(c)+"\r\n":"\r\n"})),t},clearArea:function(t){this.areaClipBoard&&t&&t.target===this.areaClipBoard[0]&&(this.options.navigatable?e(this.current()).closest("table").focus():this.table.focus()),this.areaClipBoard&&(this.areaClipBoard.remove(),this.areaClipBoard=null)},_minScreenSupport:function(){var t=this.hideMinScreenCols();t&&(this.minScreenResizeHandler=Ct(this.hideMinScreenCols,this),e(window).on("resize",this.minScreenResizeHandler))},hideMinScreenCols:function(){var e,n,i,o=this.columns,r=!1,a=window.innerWidth>0?window.innerWidth:screen.width;for(e=0;o.length>e;e++)n=o[e],i=n.minScreenWidth,i!==t&&null!==i&&(r=!0,i>a?this.hideColumn(n):this.showColumn(n));return r},_relatedRow:function(t){var n,i,o=this.lockedTable;return t=e(t),o?(n=t.closest(this.table.add(this.lockedTable)),i=n.find(">tbody>tr").index(t),n=n[0]===this.table[0]?o:this.table,n.find(">tbody>tr").eq(i)):t},clearSelection:function(){var e=this;e.selectable.clear(),e.trigger(Wt)},select:function(n){var i=this,o=i.selectable;return n=e(n),n.length?(o.options.multiple||(o.clear(),n=n.first()),i._isLocked()&&(n=n.add(n.map(function(){return i._relatedRow(this)}))),o.value(n),t):o.value()},_updateCurrentAttr:function(t,n){var i,o=e(t).data("headerId");e(t).removeClass(Xt).removeAttr("aria-describedby").closest("table").removeAttr("aria-activedescendant"),o?(o=o.replace(this._cellId,""),e(t).attr("id",o)):e(t).removeAttr("id"),n.data("headerId",n.attr("id")).attr("id",this._cellId).addClass(Xt).closest("table").attr("aria-activedescendant",this._cellId),n.closest("tr").hasClass("k-grouping-row")||n.hasClass("k-header")?n.attr("aria-describedby",this._cellId):(i=this.columns[this.cellIndex(n)],i&&(o=i.headerAttributes.id),n.attr("aria-describedby",o+" "+this._cellId)),this._current=n},_scrollCurrent:function(){var t,n,i,o,r,a,s=this._current,l=this.options.scrollable;s&&l&&(t=s.parent(),n=t.closest("table").parent(),i=n.is(".k-grid-content-locked,.k-grid-header-locked"),o=n.is(".k-grid-content-locked,.k-grid-content,.k-virtual-scrollable-wrap"),r=e(this.content).find(">.k-virtual-scrollable-wrap").andSelf().last()[0],o&&(l.virtual?(a=Math.max(xt(t[0],this._items(t.parent())),0),this._rowVirtualIndex=this.virtualScrollable.itemIndex(a),this.virtualScrollable.scrollIntoView(t)):this._scrollTo(this._relatedRow(t)[0],r)),this.lockedContent&&(this.lockedContent[0].scrollTop=r.scrollTop),i||this._scrollTo(s[0],r))},current:function(t){var n=this._current;return t=e(t),t.length&&(n&&n[0]===t[0]||(this._updateCurrentAttr(n,t),this._scrollCurrent())),this._current},_removeCurrent:function(){this._current&&(this._current.removeClass(Xt),this._current=null)},_scrollTo:function(t,n){var i,o=t.tagName.toLowerCase(),r="td"===o||"th"===o,a=t[r?"offsetLeft":"offsetTop"],s=t[r?"offsetWidth":"offsetHeight"],l=n[r?"scrollLeft":"scrollTop"],c=n[r?"clientWidth":"clientHeight"],d=a+s,h=0,u=0,f=0;wn&&r&&(i=e(t).closest("table")[0],yn.msie?u=i.offsetLeft:yn.mozilla&&(f=i.offsetLeft-dt.support.scrollbar())),l=Math.abs(l+u-f),h=l>a?a:d>l+c?c>=s?d-c:a:l,h=Math.abs(h+u)+f,n[r?"scrollLeft":"scrollTop"]=h},_navigatable:function(){var t,n,i,o=this;o.options.navigatable&&(t=o.table.add(o.lockedTable),n=o.thead.parent().add(e(">table",o.lockedHeader)),i=t,o.options.scrollable&&(i=i.add(n),n.attr(an,-1)),this._navigatableTables=i,i.off("mousedown"+Rt+" focus"+Rt+" focusout"+Rt+" keydown"+Rt),n.on("keydown"+Rt,Ct(o._openHeaderMenu,o)).find("a.k-link").attr("tabIndex",-1),t.attr(an,Dt.max(t.attr(an)||0,0)).on("mousedown"+Rt+" keydown"+Rt,".k-detail-cell",function(e){e.target!==e.currentTarget&&e.stopImmediatePropagation()}),i.on(dt.support.touch?"touchstart"+Rt:"mousedown"+Rt,It+">"+Bt,Ct(at,o)).on("focus"+Rt,Ct(o._tableFocus,o)).on("focusout"+Rt,Ct(o._tableBlur,o)).on("keydown"+Rt,Ct(o._tableKeyDown,o)))},_openHeaderMenu:function(e){e.altKey&&e.keyCode==mt.DOWN&&(this.current().find(".k-grid-filter, .k-header-column-menu").click(),e.stopImmediatePropagation())},_setTabIndex:function(e){this._navigatableTables.attr(an,-1),e.attr(an,0)},_tableFocus:function(t){var n,i;dt.support.touch||(n=this.current(),i=e(t.currentTarget),n&&n.is(":visible")?n.addClass(Xt):this.current(i.find(zt)),this._setTabIndex(i))},_tableBlur:function(){var e=this.current();e&&e.removeClass(Xt)},_tableKeyDown:function(n){var i,o=this.current(),r=this.virtualScrollable&&this.virtualScrollable.fetching(),a=e(n.target),s=!n.isDefaultPrevented()&&!a.is(":button,a,:input,a>.k-icon");return r?(n.preventDefault(),t):(o=o?o:e(this.lockedTable).add(this.table).find(zt),o.length&&(i=!1,s&&n.keyCode==mt.UP&&(i=this._moveUp(o)),s&&n.keyCode==mt.DOWN&&(i=this._moveDown(o)),s&&n.keyCode==(wn?mt.LEFT:mt.RIGHT)&&(i=this._moveRight(o,n.altKey)),s&&n.keyCode==(wn?mt.RIGHT:mt.LEFT)&&(i=this._moveLeft(o,n.altKey)),s&&n.keyCode==mt.PAGEDOWN&&(i=this._handlePageDown()),s&&n.keyCode==mt.PAGEUP&&(i=this._handlePageUp()),(n.keyCode==mt.ENTER||n.keyCode==mt.F2)&&(i=this._handleEnterKey(o,n.currentTarget,a)),n.keyCode==mt.ESC&&(i=this._handleEscKey(o,n.currentTarget)),n.keyCode==mt.TAB&&(i=this._handleTabKey(o,n.currentTarget,n.shiftKey)),i&&(n.preventDefault(),n.stopPropagation())),t)},_moveLeft:function(e,t){var n,i,o=e.parent(),r=o.parent();return t?this.collapseRow(o):(i=r.find(It).index(o),n=this._prevHorizontalCell(r,e,i),n[0]||(r=this._horizontalContainer(r),n=this._prevHorizontalCell(r,e,i),n[0]!==e[0]&&rt(r.parent(),!0)),this.current(n)),!0},_moveRight:function(e,t){var n,i,o=e.parent(),r=o.parent();return t?this.expandRow(o):(i=r.find(It).index(o),n=this._nextHorizontalCell(r,e,i),n[0]||(r=this._horizontalContainer(r,!0),n=this._nextHorizontalCell(r,e,i),n[0]!==e[0]&&rt(r.parent(),!0)),this.current(n)),!0},_moveUp:function(e){var t=e.parent().parent(),n=this._prevVerticalCell(t,e);return n[0]||(t=this._verticalContainer(t,!0),n=this._prevVerticalCell(t,e),n[0]&&rt(t.parent(),!0)),this.current(n),!0},_moveDown:function(e){var t=e.parent().parent(),n=this._nextVerticalCell(t,e);return n[0]||(t=this._verticalContainer(t),n=this._nextVerticalCell(t,e),n[0]&&rt(t.parent(),!0)),this.current(n),!0},_handlePageDown:function(){return this.options.pageable?(this.dataSource.page(this.dataSource.page()+1),!0):!1},_handlePageUp:function(){return this.options.pageable?(this.dataSource.page(this.dataSource.page()-1),!0):!1},_handleTabKey:function(t,n,i){var o,r=this.options.editable&&"incell"==this._editMode();return!r||t.is("th")?!1:(o=e(pt()).closest(".k-edit-cell"),o[0]&&o[0]!==t[0]&&(t=o),o=this._tabNext(t,n,i),o.length?(this._handleEditing(t,o,o.closest("table")),!0):!1)},_handleEscKey:function(t,n){var i,o=pt(),r="incell"==this._editMode();return st(t)?(r?this.closeCell(!0):(i=e(t).parent().index(),o&&o.blur(),this.cancelRow(),i>=0&&this.current(this.items().eq(i).children(Bt).first())),yn.msie&&9>yn.version&&document.body.focus(),rt(n,!0),!0):t.has(o).length?(rt(n,!0),!0):!1},_toggleCurrent:function(e){var t=e.parent();return t.is(".k-master-row,.k-grouping-row")?(t.find(".k-icon:first").click(),!0):!1},_handleEnterKey:function(t,n,i){var o,r=this.options.editable,a=i.closest("[role=gridcell]");return i.is("table")||e.contains(t[0],i[0])||(t=a),t.is("th")?(t.find(".k-link").click(),!0):!r&&this._toggleCurrent(t)?!0:(o=t.find(":kendoFocusable:first"),o[0]&&!t.hasClass("k-edit-cell")&&t.hasClass("k-state-focused")?(o.focus(),!0):r&&!i.is(":button,.k-button,textarea")?(a[0]||(a=t),this._handleEditing(a,!1,n),!0):!1)},_nextHorizontalCell:function(e,t,n){var i,o,r,a=t.nextAll(Mt);return a.length||(i=e.find(It),o=i.index(t.parent()),-1!=o)?a.first():t.hasClass("k-header")?(r=[],I([B(this.columns)[0]],V(i.eq(0).children().first()),r,0,0),r[n]?r[n][0]:t):t.parent().hasClass("k-filter-row")?i.last().children(Mt).first():i.eq(n).children(Mt).first()},_prevHorizontalCell:function(e,t,n){var i,o,r,a,s=t.prevAll(Mt);return s.length||(i=e.find(It),o=i.index(t.parent()),-1!=o)?s.first():t.hasClass("k-header")?(r=[],a=B(this.columns),I([a[a.length-1]],V(i.eq(0).children().last()),r,0,0),r[n]?r[n][0]:t):t.parent().hasClass("k-filter-row")?i.last().children(Mt).last():i.eq(n).children(Mt).last()},_currentDataIndex:function(e,n){var i,o=n.attr("data-index");return o?(i=B(this.columns).length,i&&!e.closest("div").hasClass("k-grid-content-locked")[0]?o-i:o):t},_prevVerticalCell:function(t,n){var i,o=n.parent(),r=t.children(It),a=r.index(o),s=this._currentDataIndex(t,n);
if(s||n.hasClass("k-header"))return i=H(n),i.eq(i.length-2);if(s=o.children(Mt).index(n),o.hasClass("k-filter-row"))return N(t).eq(s);if(-1==a){if(o=t.find(".k-filter-row"),!o[0])return N(t).eq(s)}else o=0===a?e():r.eq(a-1);return i=o.children(Mt),i.eq(i.length>s?s:0)},_nextVerticalCell:function(e,n){var i,o=n.parent(),r=e.children(It),a=r.index(o),s=this._currentDataIndex(e,n);return-1!=a&&s===t&&n.hasClass("k-header")?V(n).eq(1):(s=s?parseInt(s,10):o.children(Mt).index(n),o=r.eq(-1==a?0:a+n[0].rowSpan),i=o.children(Mt),i.eq(i.length>s?s:0))},_verticalContainer:function(e,t){var n=e.parent(),i=this._navigatableTables.length,o=Math.floor(i/2),r=xt(n[0],this._navigatableTables);return t&&(o*=-1),r+=o,(r>=0||i>r)&&(n=this._navigatableTables.eq(r)),n.find(t?"thead":"tbody")},_horizontalContainer:function(e,t){var n,i,o=this._navigatableTables.length;return 2>=o?e:(n=e.parent(),i=xt(n[0],this._navigatableTables),i+=t?1:-1,!t||2!=i&&i!=o?!t&&(1==i||0>i)?e:this._navigatableTables.eq(i).find("thead, tbody"):e)},_tabNext:function(e,t,n){var i=!0,o=n?e.prevAll(Mt+":first"):e.nextAll(":visible:first");return o.length||(o=e.parent(),this.lockedTable&&(i=n&&t==this.lockedTable[0]||!n&&t==this.table[0],o=this._relatedRow(o)),i&&(o=o[n?"prevAll":"nextAll"]("tr:not(.k-grouping-row):not(.k-detail-row):visible:first")),o=o.children(Mt+(n?":last":":first"))),o},_handleEditing:function(n,i,o){var r,a,s=this,l=e(pt()),c=s._editMode(),d=yn.msie,h=d&&9>yn.version,u=s._editContainer;if(o=e(o),a="incell"==c?n.hasClass("k-edit-cell"):n.parent().hasClass("k-grid-edit-row"),s.editable){if(e.contains(u[0],l[0])&&(yn.opera||h?l.change().triggerHandler("blur"):(l.blur(),d&&l.blur())),!s.editable)return rt(o),t;if(!s.editable.end())return s.current("incell"==c?u:u.children().filter(Mt).first()),r=u.find(":kendoFocusable:first")[0],r&&r.focus(),t;"incell"==c?s.closeCell():(s.saveRow(),a=!0)}i&&s.current(i),h&&document.body.focus(),rt(o,!0),(!a&&!i||i)&&("incell"==c?s.editCell(s.current()):s.editRow(s.current().parent()))},_wrapper:function(){var e=this,t=e.table,n=e.options.height,i=e.element;i.is("div")||(i=i.wrap("<div/>").parent()),e.wrapper=i.addClass("k-grid k-widget"),n&&(e.wrapper.css(rn,n),t.css(rn,"auto")),e._initMobile()},_initMobile:function(){var t,n=this.options,i=this;this._isMobile=n.mobile===!0&&dt.support.mobileOS||"phone"===n.mobile||"tablet"===n.mobile,this._isMobile&&(t=this.wrapper.addClass("k-grid-mobile").wrap("<div data-"+dt.ns+'role="view" data-'+dt.ns+'init-widgets="false"></div>').parent(),this.pane=dt.mobile.ui.Pane.wrap(t),this.view=this.pane.view(),this._actionSheetPopupOptions=e(document.documentElement).hasClass("km-root")?{modal:!1}:{align:"bottom center",position:"bottom center",effect:"slideIn:up"},n.height&&this.pane.element.parent().css(rn,n.height),this._editAnimation="slide",this.view.bind("show",function(){i._isLocked()&&(i._updateTablesWidth(),i._applyLockedContainersWidth(),i._syncLockedContentHeight(),i._syncLockedHeaderHeight(),i._syncLockedFooterHeight())}))},_tbody:function(){var t,n=this,i=n.table;t=i.find(">tbody"),t.length||(t=e("<tbody/>").appendTo(i)),n.tbody=t.attr("role","rowgroup")},_scrollable:function(){var t,n,i,o,r=this,a=r.options,s=a.scrollable,l=s!==!0&&s.virtual&&!r.virtualScrollable,c=!dt.support.kineticScrollNeeded||l?dt.support.scrollbar():0;s&&(t=r.wrapper.children(".k-grid-header"),t[0]||(t=e('<div class="k-grid-header" />').insertBefore(r.table)),t.css(wn?"padding-left":"padding-right",s.virtual?c+1:c),n=e('<table role="grid" />'),bn&&n.attr("cellspacing",0),n.width(r.table[0].style.width),n.append(r.thead),t.empty().append(e('<div class="k-grid-header-wrap" />').append(n)),r.content=r.table.parent(),r.content.is(".k-virtual-scrollable-wrap, .km-scroll-container")&&(r.content=r.content.parent()),r.content.is(".k-grid-content, .k-virtual-scrollable-wrap")||(r.content=r.table.wrap('<div class="k-grid-content" />').parent()),l&&(r.virtualScrollable=new kn(r.content,{dataSource:r.dataSource,itemHeight:function(){return r._averageRowHeight()}})),r.scrollables=t.children(".k-grid-header-wrap"),i=r.wrapper.find(".k-grid-footer"),i.length&&(r.scrollables=r.scrollables.add(i.children(".k-grid-footer-wrap"))),s.virtual?r.content.find(">.k-virtual-scrollable-wrap").unbind("scroll"+Rt).bind("scroll"+Rt,function(){r.scrollables.scrollLeft(this.scrollLeft),r.lockedContent&&(r.lockedContent[0].scrollTop=this.scrollTop)}):(r.content.unbind("scroll"+Rt).bind("scroll"+Rt,function(){r.scrollables.scrollLeft(this.scrollLeft),r.lockedContent&&(r.lockedContent[0].scrollTop=this.scrollTop)}),o=r.content.data("kendoTouchScroller"),o&&o.destroy(),o=dt.touchScroller(r.content),o&&o.movable&&(r.touchScroller=o,o.movable.bind("change",function(e){r.scrollables.scrollLeft(-e.sender.x),r.lockedContent&&r.lockedContent.scrollTop(-e.sender.y)}),r.one($t,function(e){e.sender.wrapper.addClass("k-grid-backface")}))))},_renderNoRecordsContent:function(){var t,n=this;n.options.noRecords&&(t=n.table.parent().children("."+Zt),t.length&&t.remove(),n.dataSource&&n.dataSource.view().length||e(n.noRecordsTemplate({})).insertAfter(n.table))},_setContentWidth:function(t){var n,i=this,o="k-grid-content-expander",r='<div class="'+o+'"></div>',a=i.resizable;i.options.scrollable&&i.wrapper.is(":visible")&&(n=i.table.parent().children("."+o),i._setContentWidthHandler=Ct(i._setContentWidth,i),i.dataSource&&i.dataSource.view().length?n[0]&&(n.remove(),a&&a.unbind("resize",i._setContentWidthHandler)):(n[0]||(n=e(r).appendTo(i.table.parent()),a&&a.bind("resize",i._setContentWidthHandler)),i.thead&&(n.width(i.thead.width()),t&&i.content.scrollLeft(t))),i._applyLockedContainersWidth())},_applyLockedContainersWidth:function(){if(this.options.scrollable&&this.lockedHeader){var e,t=this.thead.parent(),n=t.parent(),i=this.wrapper[0].clientWidth,o=this._groups(),r=dt.support.scrollbar(),a=this.lockedHeader.find(">table>colgroup>col:not(.k-group-col, .k-hierarchy-col)"),s=t.find(">colgroup>col:not(.k-group-col, .k-hierarchy-col)"),l=A(a),c=A(s);o>0&&(l+=this.lockedHeader.find(".k-group-cell:first").outerWidth()*o),l>=i&&(l=i-3*r),this.lockedHeader.add(this.lockedContent).width(l),n[0].style.width=n.parent().width()-l-2+"px",t.add(this.table).width(c),this.virtualScrollable&&(i-=r),this.content[0].style.width=i-l-2+"px",this.lockedFooter&&this.lockedFooter.length&&(this.lockedFooter.width(l),e=this.footer.find(".k-grid-footer-wrap"),e[0].style.width=n[0].clientWidth+"px",e.children().first().width(c))}},_setContentHeight:function(){var e,t=this,n=t.options,i=t.wrapper.innerHeight(),o=t.wrapper.children(".k-grid-header"),r=dt.support.scrollbar();n.scrollable&&t.wrapper.is(":visible")&&(i-=o.outerHeight(),t.pager&&(i-=t.pager.element.outerHeight()),n.groupable&&(i-=t.wrapper.children(".k-grouping-header").outerHeight()),n.toolbar&&(i-=t.wrapper.children(".k-grid-toolbar").outerHeight()),t.footerTemplate&&(i-=t.wrapper.children(".k-grid-footer").outerHeight()),e=function(e){var t,n;return e[0].style.height?!0:(t=e.height(),e.height("auto"),n=e.height(),t!=n?(e.height(""),!0):(e.height(""),!1))},e(t.wrapper)&&(i>2*r?(t.lockedContent&&(r=t.table[0].offsetWidth>t.table.parent()[0].clientWidth?r:0,t.lockedContent.height(i-r)),t.content.height(i)):t.content.height(2*r+1)))},_averageRowHeight:function(){var e,t=this,n=t._items(t.tbody).length,i=t._rowHeight;return 0===n?i:(t._rowHeight||(t._rowHeight=i=t.table.outerHeight()/n,t._sum=i,t._measures=1),e=t.table.outerHeight()/n,i!==e&&(t._measures++,t._sum+=e,t._rowHeight=t._sum/t._measures),i)},_dataSource:function(){var e,n=this,i=n.options,o=i.dataSource;o=bt(o)?{data:o}:o,vt(o)&&(_t(o,{table:n.table,fields:n.columns}),e=i.pageable,vt(e)&&e.pageSize!==t&&(o.pageSize=e.pageSize)),n.dataSource&&n._refreshHandler?n.dataSource.unbind(Wt,n._refreshHandler).unbind(At,n._progressHandler).unbind(Pt,n._errorHandler):(n._refreshHandler=Ct(n.refresh,n),n._progressHandler=Ct(n._requestStart,n),n._errorHandler=Ct(n._error,n)),n.dataSource=ut.create(o).bind(Wt,n._refreshHandler).bind(At,n._progressHandler).bind(Pt,n._errorHandler)},_error:function(){this._progress(!1)},_requestStart:function(){this._progress(!0)},_modelChange:function(t){var n,i,o,r,a,s,l,c,d,h,u=this,f=u.tbody,p=t.model,g=u.tbody.find("tr["+dt.attr("uid")+"="+p.uid+"]"),m=g.hasClass("k-alt"),v=u._items(f).index(g),_=u.lockedContent;if(_&&(n=u._relatedRow(g)),g.add(n).children(".k-edit-cell").length&&!u.options.rowTemplate)g.add(n).children(":not(.k-group-cell,.k-hierarchy-cell)").each(function(){i=e(this),o=O(u.columns)[u.cellIndex(i)],o.field===t.field&&(i.hasClass("k-edit-cell")?i.addClass("k-dirty-cell"):(u._displayCell(i,o,p),e('<span class="k-dirty"/>').prependTo(i)))});else if(!g.hasClass("k-grid-edit-row")){for(s=e().add(g),_&&(r=(m?u.lockedAltRowTemplate:u.lockedRowTemplate)(p),s=s.add(n),n.replaceWith(r)),u.angular("cleanup",function(){return{elements:s.get()}}),r=(m?u.altRowTemplate:u.rowTemplate)(p),g.replaceWith(r),r=u._items(f).eq(v),h=[{dataItem:p}],_&&(g=g.add(n),n=u._relatedRow(r)[0],it(r[0],n),r=r.add(n),h.push({dataItem:p})),u.angular("compile",function(){return{elements:r.get(),data:h}}),a=u.options.selectable,a&&g.hasClass("k-state-selected")&&u.select(r),c=s.children(":not(.k-group-cell,.k-hierarchy-cell)"),l=r.children(":not(.k-group-cell,.k-hierarchy-cell)"),v=0,d=u.columns.length;d>v;v++)o=u.columns[v],i=l.eq(v),a&&c.eq(v).hasClass("k-state-selected")&&i.addClass("k-state-selected"),o.field===t.field&&e('<span class="k-dirty"/>').prependTo(i);u.trigger("itemChange",{item:r,data:p,ns:ht})}},_pageable:function(){var t,n=this,i=n.options.pageable;i&&(t=n.wrapper.children("div.k-grid-pager"),t.length||(t=e('<div class="k-pager-wrap k-grid-pager"/>').appendTo(n.wrapper)),n.pager&&n.pager.destroy(),n.pager="object"==typeof i&&i instanceof dt.ui.Pager?i:new dt.ui.Pager(t,_t({},i,{dataSource:n.dataSource})))},_footer:function(){var t,n,i,o,r=this,a=r.dataSource.aggregates(),s="",l=r.footerTemplate,c=r.options,d=r.footer||r.wrapper.find(".k-grid-footer");l?(s=e(r._wrapFooter(l(a))),d.length?(n=s,r.angular("cleanup",function(){return{elements:d.get()}}),d.replaceWith(n),d=r.footer=n):d=r.footer=c.scrollable?c.pageable?s.insertBefore(r.wrapper.children("div.k-grid-pager")):s.appendTo(r.wrapper):s.insertBefore(r.tbody),r.angular("compile",function(){return{elements:d.find("td:not(.k-group-cell, .k-hierarchy-cell)").get(),data:wt(r.columns,function(e){return{column:e,aggregate:a[e.field]}})}})):d&&!r.footer&&(r.footer=d),d.length&&(c.scrollable&&(t=d.attr("tabindex",-1).children(".k-grid-footer-wrap"),r.scrollables=r.scrollables.filter(function(){return!e(this).is(".k-grid-footer-wrap")}).add(t)),r._footerWidth&&d.find("table").css("width",r._footerWidth),t&&(i=r.content.scrollLeft(),o=c.scrollable!==!0&&c.scrollable.virtual&&!r.virtualScrollable,o&&(i=r.wrapper.find(".k-virtual-scrollable-wrap").scrollLeft()),t.scrollLeft(i))),r.lockedContent&&(r._appendLockedColumnFooter(),r._applyLockedContainersWidth(),r._syncLockedFooterHeight())},_wrapFooter:function(t){var n=this,i="",o=dt.support.mobileOS?0:dt.support.scrollbar();return n.options.scrollable?(i=e('<div class="k-grid-footer"><div class="k-grid-footer-wrap"><table'+(bn?' cellspacing="0"':"")+"><tbody>"+t+"</tbody></table></div></div>"),n._appendCols(i.find("table")),i.css(wn?"padding-left":"padding-right",o),i):'<tfoot class="k-grid-footer">'+t+"</tfoot>"},_columnMenu:function(){var e,n,i,o,r,a,s,l,c,d=this,h=O(d.columns),u=d.options,f=u.columnMenu,p=yt(d.columns,function(e){return e.columns!==t}).length>0,g=this._isMobile,m=function(e){d.trigger(Ut,{field:e.field,container:e.container})},v=function(e){rt(e.closest("table"),!0)},_=u.$angular;if(f)for("boolean"==typeof f&&(f={}),a=N(d.thead),s=0,l=a.length;l>s;s++)n=h[s],c=a.eq(s),n.command||!n.field&&!c.attr("data-"+dt.ns+"field")||(e=c.data("kendoColumnMenu"),e&&e.destroy(),o=n.sortable!==!1&&f.sortable!==!1&&u.sortable!==!1?_t({},u.sortable,{compare:(n.sortable||{}).compare}):!1,r=u.filterable&&n.filterable!==!1&&f.filterable!==!1?_t({pane:d.pane},u.filterable,n.filterable):!1,n.filterable&&n.filterable.dataSource&&(r.forceUnique=!1,r.checkSource=n.filterable.dataSource),r&&(r.format=n.format),i={dataSource:d.dataSource,values:n.values,columns:f.columns,sortable:o,filterable:r,messages:f.messages,owner:d,closeCallback:v,init:m,pane:d.pane,filter:g?":not(.k-column-active)":"",lockedColumns:!p&&n.lockable!==!1&&B(h).length>0},_&&(i.$angular=_),c.kendoColumnMenu(i))},_headerCells:function(){return this.thead.find("th").filter(function(){var t=e(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")})},_filterable:function(){var e,t,n,i,o,r,a,s=this,l=O(s.columns),c=function(e){s.trigger(Vt,{field:e.field,container:e.container})},d=function(e){rt(e.closest("table"),!0)},h=s.options.filterable;if(h&&typeof h.mode==ln&&-1==h.mode.indexOf("menu")&&(h=!1),h&&!s.options.columnMenu)for(t=N(s.thead),i=0,o=t.length;o>i;i++)n=t.eq(i),l[i].filterable===!1||l[i].command||!l[i].field&&!n.attr("data-"+dt.ns+"field")||(e=n.data("kendoFilterMenu"),e&&e.destroy(),e=n.data("kendoFilterMultiCheck"),e&&e.destroy(),r=l[i].filterable,a=_t({},h,r,{dataSource:s.dataSource,values:l[i].values,format:l[i].format,closeCallback:d,title:l[i].title||l[i].field,init:c,pane:s.pane}),r&&r.messages&&(a.messages=_t(!0,{},h.messages,r.messages)),r&&r.dataSource&&(a.forceUnique=!1,a.checkSource=r.dataSource),r&&r.multi?n.kendoFilterMultiCheck(a):n.kendoFilterMenu(a))},_filterRow:function(){var t,n,i,o,r,a,s,l,c,d,h,u,f=this;if(f._hasFilterRow())for(t=O(f.columns),n=f.options.filterable,i=f.thead.find(".k-filter-row"),this._updateHeader(this.dataSource.group().length),o=0;t.length>o;o++)if(a=t[o],s=f.options.filterable.operators,l=!1,c=e("<th/>"),d=a.field,a.hidden&&c.hide(),i.append(c),d&&a.filterable!==!1){if(h=a.filterable&&a.filterable.cell||{},r=f.options.dataSource,r instanceof ut&&(r=f.options.dataSource.options),u=_t(!0,{},n.messages),a.filterable&&_t(!0,u,a.filterable.messages),h.enabled===!1){c.html("&nbsp;");continue}h.dataSource&&(r=h.dataSource,l=!0),a.filterable&&a.filterable.operators&&(s=a.filterable.operators),e("<span/>").attr(dt.attr("field"),d).kendoFilterCell({dataSource:f.dataSource,suggestDataSource:r,customDataSource:l,field:d,messages:u,values:a.values,template:h.template,delay:h.delay,inputWidth:h.inputWidth,suggestionOperator:h.suggestionOperator,minLength:h.minLength,dataTextField:h.dataTextField,operator:h.operator,operators:s,showOperators:h.showOperators}).appendTo(c)}else c.html("&nbsp;")},_sortable:function(){var e,t,n,i,o,r,a=this,s=O(a.columns),l=a.options.sortable;if(l){for(i=N(a.thead),o=0,r=i.length;r>o;o++)e=s[o],e.sortable!==!1&&!e.command&&e.field&&(n=i.eq(o),t=n.data("kendoColumnSorter"),t&&t.destroy(),n.attr("data-"+dt.ns+"field",e.field).kendoColumnSorter(_t({},l,e.sortable,{dataSource:a.dataSource,aria:!0,filter:":not(.k-column-active)"})));i=null}},_columns:function(t){var n,i,o,r=this,a=r.table,s=a.find("col"),c=r.options.dataSource;if(t=t.length?t:wt(a.find("th"),function(t,n){t=e(t);var i=t.attr(dt.attr("sortable")),o=t.attr(dt.attr("filterable")),r=t.attr(dt.attr("type")),a=t.attr(dt.attr("groupable")),l=t.attr(dt.attr("field")),c=t.attr(dt.attr("title")),d=t.attr(dt.attr("menu"));return l||(l=t.text().replace(/\s|[^A-z0-9]/g,"")),{field:l,type:r,title:c,sortable:"false"!==i,filterable:"false"!==o,groupable:"false"!==a,menu:d,template:t.attr(dt.attr("template")),width:s.eq(n).css("width")}}),n=!(r.table.find("tbody tr").length>0&&(!c||!c.transport)),r.options.scrollable){if(o=t,i=B(t),t=z(t),i.length>0&&0===t.length)throw Error("There should be at least one non locked column");q(r.element.find("tr:has(th):first"),o),t=i.concat(t)}r.columns=l(t,n)},_groups:function(){var e=this.dataSource.group();return e?e.length:0},_tmpl:function(e,t,o,r){var a,s,l,c,d=this,h=_t({},dt.Template,d.options.templateSettings),u=t.length,f={storage:{},count:0},p=d._hasDetails(),g=[],m=d._groups();if(!e){for(e="<tr",o&&g.push("k-alt"),p&&g.push("k-master-row"),g.length&&(e+=' class="'+g.join(" ")+'"'),u&&(e+=" "+dt.attr("uid")+'="#='+dt.expr("uid",h.paramName)+'#"'),e+=" role='row'>",m>0&&!r&&(e+=n(m)),p&&(e+='<td class="k-hierarchy-cell"><a class="k-icon k-plus" href="\\#" tabindex="-1"></a></td>'),a=0;u>a;a++)l=t[a],s=l.template,c=typeof s,e+="<td"+i(l.attributes)+" role='gridcell'>",e+=d._cellTmpl(l,f),e+="</td>";e+="</tr>"}return e=dt.template(e,h),f.count>0?Ct(e,f.storage):e},_headerCellText:function(e){var t=this,n=_t({},dt.Template,t.options.templateSettings),i=e.headerTemplate,o=typeof i,r=e.title||e.field||"";return o===sn?r=dt.template(i,n)({}):o===ln&&(r=i),r},_cellTmpl:function(e,t){var n,i,o=this,r=_t({},dt.Template,o.options.templateSettings),a=e.template,s=r.paramName,l=e.field,c="",d=e.format,h=typeof a,u=e.values;if(e.command){if(bt(e.command)){for(n=0,i=e.command.length;i>n;n++)c+=o._createButton(e.command[n]);return c.replace(pn,"\\#")}return o._createButton(e.command).replace(pn,"\\#")}return h===sn?(t.storage["tmpl"+t.count]=a,c+="#=this.tmpl"+t.count+"("+s+")#",t.count++):h===ln?c+=a:u&&u.length&&vt(u[0])&&"value"in u[0]&&l?(c+="#var v ="+dt.stringify($(u)).replace(pn,"\\#")+"#",c+="#var f = v[",r.useWithBlock||(c+=s+"."),c+=l+"]#",c+="${f != null ? f : ''}"):(c+=e.encoded?"#:":"#=",d&&(c+='kendo.format("'+d.replace(fn,"\\$1")+'",'),l?(l=dt.expr(l,s),c+=l+"==null?'':"+l):c+="''",d&&(c+=")"),c+="#"),c},_templates:function(){var t=this,n=t.options,i=t.dataSource,o=i.group(),r=t.footer||t.wrapper.find(".k-grid-footer"),a=i.aggregate(),s=O(t.columns),l=O(B(t.columns)),c=n.scrollable?O(z(t.columns)):s;if(n.scrollable&&l.length){if(n.rowTemplate||n.altRowTemplate)throw Error("Having both row template and locked columns is not supported");t.rowTemplate=t._tmpl(n.rowTemplate,c,!1,!0),t.altRowTemplate=t._tmpl(n.altRowTemplate||n.rowTemplate,c,!0,!0),t.lockedRowTemplate=t._tmpl(n.rowTemplate,l),t.lockedAltRowTemplate=t._tmpl(n.altRowTemplate||n.rowTemplate,l,!0)}else t.rowTemplate=t._tmpl(n.rowTemplate,c),t.altRowTemplate=t._tmpl(n.altRowTemplate||n.rowTemplate,c,!0);t._hasDetails()&&(t.detailTemplate=t._detailTmpl(n.detailTemplate||"")),(t._group&&!Tt(a)||!Tt(a)&&!r.length||yt(s,function(e){return e.footerTemplate}).length)&&(t.footerTemplate=t._footerTmpl(s,a,"footerTemplate","k-footer-template")),o&&yt(s,function(e){return e.groupFooterTemplate}).length&&(a=e.map(o,function(e){return e.aggregates}),t.groupFooterTemplate=t._footerTmpl(c,a,"groupFooterTemplate","k-group-footer",l.length),n.scrollable&&l.length&&(t.lockedGroupFooterTemplate=t._footerTmpl(l,a,"groupFooterTemplate","k-group-footer"))),t.options.noRecords&&(t.noRecordsTemplate=t._noRecordsTmpl())},_noRecordsTmpl:function(){var t,n,i,o='<div class="{0}">{1}</div>',r='<div class="k-grid-norecords-template"{1}>{0}</div>',a=this.options.scrollable&&!this.wrapper[0].style.height?' style="margin:0 auto;position:static;"':"",s={storage:{},count:0},l=e.extend({},dt.Template,this.options.templateSettings),c=l.paramName,d="";return t=this.options.noRecords.template?this.options.noRecords.template:dt.format(r,this.options.messages.noRecords,a),n=typeof t,"function"===n?(s.storage["tmpl"+s.count]=t,d+="#=this.tmpl"+s.count+"("+c+")#",s.count++):"string"===n&&(d+=t),i=dt.template(dt.format(o,Zt,d),l),s.count>0&&(i=e.proxy(i,s.storage)),i},_footerTmpl:function(e,t,o,r,a){var s,l,c,d,h,u=this,f=_t({},dt.Template,u.options.templateSettings),p=f.paramName,g="",m={},v=0,_={},w=u._groups(),y=u.dataSource._emptyAggregates(t);for(g+='<tr class="'+r+'">',w>0&&!a&&(g+=n(w)),u._hasDetails()&&(g+='<td class="k-hierarchy-cell">&nbsp;</td>'),s=0,l=e.length;l>s;s++)h=e[s],c=h[o],d=typeof c,g+="<td"+i(h.footerAttributes)+">",c?(d!==sn&&(_=y[h.field]?_t({},f,{paramName:p+"['"+h.field+"']"}):{},c=dt.template(c,_)),m["tmpl"+v]=c,g+="#=this.tmpl"+v+"("+p+")#",v++):g+="&nbsp;",g+="</td>";return g+="</tr>",g=dt.template(g,f),v>0?Ct(g,m):g},_detailTmpl:function(e){var t=this,i="",o=_t({},dt.Template,t.options.templateSettings),r=o.paramName,a={},s=0,l=t._groups(),c=p(O(t.columns)).length,d=typeof e;return i+='<tr class="k-detail-row">',l>0&&(i+=n(l)),i+='<td class="k-hierarchy-cell"></td><td class="k-detail-cell"'+(c?' colspan="'+c+'"':"")+">",d===sn?(a["tmpl"+s]=e,i+="#=this.tmpl"+s+"("+r+")#",s++):i+=e,i+="</td></tr>",i=dt.template(i,o),s>0?Ct(i,a):i},_hasDetails:function(){var e=this;return null!==e.options.detailTemplate||(e._events[Ht]||[]).length},_hasFilterRow:function(){var t=this.options.filterable,n=t&&typeof t.mode==ln&&-1!=t.mode.indexOf("row"),i=this.columns,o=e.grep(i,function(e){return e.filterable===!1});return i.length&&o.length==i.length&&(n=!1),n},_details:function(){var t=this;if(t.options.scrollable&&t._hasDetails()&&B(t.columns).length)throw Error("Having both detail template and locked columns is not supported");t.table.on(on+Rt,".k-hierarchy-cell .k-plus, .k-hierarchy-cell .k-minus",function(n){var i,o,r=e(this),a=r.hasClass("k-plus"),s=r.closest("tr.k-master-row"),l=t.detailTemplate,c=t._hasDetails();return r.toggleClass("k-plus",!a).toggleClass("k-minus",a),i=s.next(),c&&!i.hasClass("k-detail-row")&&(o=t.dataItem(s),i=e(l(o)).addClass(s.hasClass("k-alt")?"k-alt":"").insertAfter(s),t.angular("compile",function(){return{elements:i.get(),data:[{dataItem:o}]}}),t.trigger(Ht,{masterRow:s,detailRow:i,data:o,detailCell:i.find(".k-detail-cell")})),t.trigger(a?Yt:Qt,{masterRow:s,detailRow:i}),i.toggle(a),t._current&&t._current.attr("aria-expanded",a),n.preventDefault(),!1})},dataItem:function(t){if(t=e(t)[0],!t)return null;var n,i,o=this.tbody.children(),r=/k-grouping-row|k-detail-row|k-group-footer/,a=t.sectionRowIndex;for(i=a,n=0;a>n;n++)r.test(o[n].className)&&i--;return this._data[i]},expandRow:function(t){e(t).find("> td .k-plus, > td .k-i-expand").click()},collapseRow:function(t){e(t).find("> td .k-minus, > td .k-i-collapse").click()},_createHeaderCells:function(e,n){var o,r,a,s,l,c,d=this,h="",u=O(d.columns);for(o=0,s=e.length;s>o;o++)r=e[o].column||e[o],a=d._headerCellText(r),l="",c=xt(r,u),r.command?(h+="<th"+i(r.headerAttributes),n&&!e[o].colSpan&&(h+=" rowspan='"+n+"'"),c>-1&&(h+=dt.attr("index")+"='"+c+"'"),h+=">"+a+"</th>"):(r.field&&(l=dt.attr("field")+"='"+r.field+"' "),h+="<th role='columnheader' "+l,n&&!e[o].colSpan&&(h+=" rowspan='"+n+"'"),e[o].colSpan>1&&(h+='colspan="'+(e[o].colSpan-D(r.columns))+'" ',h+=dt.attr("colspan")+"='"+e[o].colSpan+"'"),r.title&&(h+=dt.attr("title")+'="'+r.title.replace('"',"&quot;").replace(/'/g,"'")+'" '),r.groupable!==t&&(h+=dt.attr("groupable")+"='"+r.groupable+"' "),r.aggregates&&r.aggregates.length&&(h+=dt.attr("aggregates")+"='"+r.aggregates+"'"),c>-1&&(h+=dt.attr("index")+"='"+c+"'"),h+=i(r.headerAttributes),h+=">"+a+"</th>");return h},_appendLockedColumnContent:function(){var t,n,i,o,r,a=this.columns,s=this.table.find("colgroup"),l=s.find("col:not(.k-group-col,.k-hierarchy-col)"),c=e(),d=0,h=0;for(t=0,n=a.length;n>t;t++)if(a[t].locked)if(f(a[t])){for(o=1,a[t].columns&&(o=O(a[t].columns).length-D(a[t].columns)),o=o||1,r=0;o>r;r++)c=c.add(l.eq(t+h+r-d));h+=o-1}else d++;i=e('<div class="k-grid-content-locked"><table'+(bn?' cellspacing="0"':"")+"><colgroup/><tbody></tbody></table></div>"),s.detach(),i.find("colgroup").append(c),s.insertBefore(this.table.find("tbody")),this.lockedContent=i.insertBefore(this.content),this.lockedTable=i.children("table")},_appendLockedColumnFooter:function(){var t,n,i=this,o=i.footer,r=o.find(".k-footer-template>td"),a=o.find(".k-grid-footer-wrap>table>colgroup>col"),s=e('<div class="k-grid-footer-locked"><table><colgroup /><tbody><tr class="k-footer-template"></tr></tbody></table></div>'),l=i._groups(),c=e(),d=e();for(c=c.add(r.filter(".k-group-cell")),t=0,n=O(B(i.columns)).length;n>t;t++)c=c.add(r.eq(t+l));for(d=d.add(a.filter(".k-group-col")),t=0,n=O(R(i.columns)).length;n>t;t++)d=d.add(a.eq(t+l));c.appendTo(s.find("tr")),d.appendTo(s.find("colgroup")),i.lockedFooter=s.prependTo(o)},_appendLockedColumnHeader:function(t){var n,i,o,r,a,s,l,c,d,h,u,p=this,m=this.columns,v=[],_=0,w=e(),y=p._hasFilterRow(),b=0,x=e(),k=0,C=e(),S=p.thead.prev().find("col:not(.k-group-col,.k-hierarchy-col)"),T=p.thead.find("tr:first .k-header:not(.k-group-cell,.k-hierarchy-cell)"),A=p.thead.find(".k-filter-row").find("th:not(.k-group-cell,.k-hierarchy-cell)"),M=0;for(n=0,o=m.length;o>n;n++){if(m[n].locked){if(l=T.eq(n),k=O(m[n].columns||[]).length,f(m[n])){for(m[n].columns&&(c=k-D(m[n].columns)),c=c||1,d=0;c>d;d++)w=w.add(S.eq(n+M+d-_));M+=c-1}for(I([m[n]],V(l),v,0,0),k=k||1,h=0;k>h;h++)x=x.add(A.eq(b+h));b+=k}m[n].columns&&(_+=D(m[n].columns)),f(m[n])||_++}if(v.length){for(i='<div class="k-grid-header-locked" style="width:1px"><table'+(bn?' cellspacing="0"':"")+"><colgroup/><thead>",i+=Array(v.length+1).join("<tr></tr>"),i+=(y?'<tr class="k-filter-row" />':"")+"</thead></table></div>",s=e(i),S=s.find("colgroup"),S.append(p.thead.prev().find("col.k-group-col").add(w)),r=s.find("thead tr:not(.k-filter-row)"),n=0,o=v.length;o>n;n++)C=g(v[n]),r.eq(n).append(p.thead.find("tr:eq("+n+") .k-group-cell").add(C));u=E(this.thead),u>v.length&&P(s,u-v.length),a=s.find(".k-filter-row"),a.append(p.thead.find(".k-filter-row .k-group-cell").add(x)),this.lockedHeader=s.prependTo(t),this.thead.find(".k-group-cell").remove(),this._syncLockedHeaderHeight()}},_removeLockedContainers:function(){var e=this.lockedHeader.add(this.lockedContent).add(this.lockedFooter);dt.destroy(e),e.off(Rt).remove(),this.lockedHeader=this.lockedContent=this.lockedFooter=null,this.selectable=null},_thead:function(){var t,n,i,o,r,a=this,s=a.columns,l=a._hasDetails()&&s.length,c=a._hasFilterRow(),d="",h=a.table.find(">thead"),u=a.element.find("thead:first").length>0;if(h.length||(h=e("<thead/>").insertBefore(a.tbody)),a.lockedHeader&&a.thead?(n=a.thead.find("tr:has(th):not(.k-filter-row)").html(""),n.remove(),n=e(),a._removeLockedContainers()):n=a.element.find(u?"thead:first tr:has(th):not(.k-filter-row)":"tr:has(th):first"),!n.length&&(n=h.children().first(),!n.length)){for(i=[{rowSpan:1,cells:[],index:0}],a._prepareColumns(i,s),t=0;i.length>t;t++)d+="<tr>",l&&(d+='<th class="k-hierarchy-cell">&nbsp;</th>'),d+=a._createHeaderCells(i[t].cells,i[t].rowSpan),d+="</tr>";n=e(d)}c&&(o=e("<tr/>"),o.addClass("k-filter-row"),(l||n.find(".k-hierarchy-cell").length)&&o.prepend('<th class="k-hierarchy-cell">&nbsp;</th>'),r=(a.thead||h).find(".k-filter-row"),r.length&&(dt.destroy(r),r.remove()),h.append(o)),n.children().length?l&&!n.find(".k-hierarchy-cell")[0]&&n.prepend('<th class="k-hierarchy-cell">&nbsp;</th>'):(d="",l&&(d+='<th class="k-hierarchy-cell">&nbsp;</th>'),d+=a._createHeaderCells(s),n.html(d)),n.attr("role","row").find("th").addClass("k-header"),a.options.scrollable||h.addClass("k-grid-header"),n.find("script").remove().end().prependTo(h),a.thead&&a._destroyColumnAttachments(),this.angular("cleanup",function(){return{elements:h.find("th").get()}}),this.angular("compile",function(){return{elements:h.find("th").get(),data:wt(s,function(e){return{column:e}})}}),a.thead=h.attr("role","rowgroup"),a._sortable(),a._filterable(),a._filterRow(),a._scrollable(),a._updateCols(),a._columnMenu(),this.options.scrollable&&B(this.columns).length&&(a._appendLockedColumnHeader(a.thead.closest(".k-grid-header")),a._appendLockedColumnContent(),a.lockedContent.bind("DOMMouseScroll"+Rt+" mousewheel"+Rt,Ct(a._wheelScroll,a)),a._applyLockedContainersWidth()),a._updateColumnCellIndex(),a._updateFirstColumnClass(),a._resizable(),a._draggable(),a._reorderable(),a.groupable&&a._attachGroupable()},_updateFirstColumnClass:function(){var t,n,i=this,o=i.columns||[],r=i._hasDetails()&&o.length;r||i._groups()||(t=e(),n=i.thead.find(">tr:not(.k-filter-row):not(:first)"),o=z(o),n.length&&o[0]&&!o[0].columns&&(t=t.add(n)),i._isLocked()&&(n=i.lockedHeader.find("thead>tr:not(.k-filter-row):not(:first)"),o=B(i.columns),n.length&&o[0]&&!o[0].columns&&(t=t.add(n))),t.each(function(){var t=e(this).find("th");t.removeClass("k-first"),t.eq(0).addClass("k-first")}))},_prepareColumns:function(e,t,n,i){var o,r,a=i||e[e.length-1],s=e[a.index+1],l=0;for(o=0;t.length>o;o++)r={column:t[o],colSpan:0},a.cells.push(r),t[o].columns&&t[o].columns.length&&(s||(s={rowSpan:0,cells:[],index:e.length},e.push(s)),r.colSpan=t[o].columns.length,this._prepareColumns(e,t[o].columns,r,s),l+=r.colSpan-1,a.rowSpan=e.length-a.index);n&&(n.colSpan+=l)},_wheelScroll:function(t){var n,i,o;t.ctrlKey||(n=this.content,this.options.scrollable.virtual&&(n=this.virtualScrollable.verticalScrollbar),i=n.scrollTop(),o=dt.wheelDeltaY(t),o&&(t.preventDefault(),e(t.currentTarget).one("wheel"+Rt,!1),n.scrollTop(i+-o)))},_isLocked:function(){return null!=this.lockedHeader},_updateCols:function(e){e=e||this.thead.parent().add(this.table),this._appendCols(e,this._isLocked())},_updateLockedCols:function(e){this._isLocked()&&(e=e||this.lockedHeader.find("table").add(this.lockedTable),G(e,F(R(this.columns)),this._hasDetails(),this._groups()))},_appendCols:function(e,t){t?G(e,F(L(this.columns)),this._hasDetails(),0):G(e,F(p(this.columns)),this._hasDetails(),this._groups())},_autoColumns:function(e){if(e&&e.toJSON){var t,n,i=this;e=e.toJSON(),n=!(i.table.find("tbody tr").length>0&&(!i.dataSource||!i.dataSource.transport));for(t in e)i.columns.push({field:t,encoded:n,headerAttributes:{id:dt.guid()}});i._thead(),i._templates()}},_rowsHtml:function(e,t){var n,i,o=this,r="",a=t.rowTemplate,s=t.altRowTemplate;for(n=0,i=e.length;i>n;n++)r+=n%2?s(e[n]):a(e[n]),o._data.push(e[n]);return r},_groupRowHtml:function(e,t,n,i,o,r){var a,s,l=this,c="",d=e.field,h=yt(O(l.columns),function(e){return e.field==d})[0]||{},u=h.groupHeaderTemplate,f=(h.title||d)+": "+Y(e.value,h.format,h.values,h.encoded),p=l._groupAggregatesDefaultObject||{},g=_t({},p,e.aggregates),m=_t({},{field:e.field,value:e.value,aggregates:g},e.aggregates[e.field]),v=o.groupFooterTemplate,_=e.items;if(u&&(f=typeof u===sn?u(m):dt.template(u)(m)),c+=i(t,n,f),e.hasSubgroups)for(a=0,s=_.length;s>a;a++)c+=l._groupRowHtml(_[a],r?t:t-1,n+1,i,o,r);else c+=l._rowsHtml(_,o);return v&&(c+=v(g)),c},collapseGroup:function(t){t=e(t);var n,i,o,r,a,s=this.options.groupable,l=s.showFooter,c=l?0:1,d=e();for(this._isLocked()&&(t.closest("div").hasClass("k-grid-content-locked")?d=this.tbody.children("tr:eq("+t.index()+")").nextAll("tr"):(d=t.nextAll("tr"),t=this.lockedTable.find(">tbody>tr:eq("+t.index()+")"))),n=t.find(".k-group-cell").length,t.find(".k-icon").addClass("k-i-expand").removeClass("k-i-collapse"),t.find("td[aria-expanded='true']:first").attr("aria-expanded",!1),t=t.nextAll("tr"),o=0,r=t.length;r>o&&(a=t.eq(o),i=a.find(".k-group-cell").length,a.hasClass("k-grouping-row")?c++:a.hasClass("k-group-footer")&&c--,!(n>=i||a.hasClass("k-group-footer")&&0>c));o++)a.hide(),d.eq(o).hide()},expandGroup:function(t){t=e(t);var n,i,o,r,a,s=this,l=s.options.groupable.showFooter,c=e(),d=[],h=1;for(this._isLocked()&&(t.closest("div").hasClass("k-grid-content-locked")?c=this.tbody.children("tr:eq("+t.index()+")").nextAll("tr"):(c=t.nextAll("tr"),t=this.lockedTable.find(">tbody>tr:eq("+t.index()+")"))),n=t.find(".k-group-cell").length,t.find(".k-icon").addClass("k-i-collapse").removeClass("k-i-expand"),t.find("td[aria-expanded='false']:first").attr("aria-expanded",!0),t=t.nextAll("tr"),r=0,a=t.length;a>r&&(i=t.eq(r),o=i.find(".k-group-cell").length,!(n>=o));r++)o!=n+1||i.hasClass("k-detail-row")||(i.show(),c.eq(r).show(),i.hasClass("k-grouping-row")&&i.find(".k-icon").hasClass("k-i-collapse")&&s.expandGroup(i),i.hasClass("k-master-row")&&i.find(".k-icon").hasClass("k-minus")&&(i.next().show(),c.eq(r+1).show())),i.hasClass("k-grouping-row")&&(l&&d.push(i.is(":visible")),h++),i.hasClass("k-group-footer")&&(l&&i.toggle(d.pop()),1==h?(i.show(),c.eq(r).show()):h--)},_updateHeader:function(t){var n=this,i=n._isLocked()?n.lockedHeader.find("thead"):n.thead,o=i.find("tr.k-filter-row").find("th.k-group-cell").length,r=i.find("tr:first").find("th.k-group-cell").length,a=i.children("tr:not(:first)").filter(function(){return!e(this).children(":visible").length
});t>r?(e(Array(t-r+1).join('<th class="k-group-cell k-header">&nbsp;</th>')).prependTo(i.children("tr:not(.k-filter-row)")),n.element.is(":visible")&&a.find("th.k-group-cell").hide()):r>t&&i.find("tr").each(function(){e(this).find("th.k-group-cell").filter(":eq("+t+"),:gt("+t+")").remove()}),t>o&&e(Array(t-o+1).join('<th class="k-group-cell k-header">&nbsp;</th>')).prependTo(i.find(".k-filter-row"))},_firstDataItem:function(e,t){return e&&t&&(e=e.hasSubgroups?this._firstDataItem(e.items[0],t):e.items[0]),e},_updateTablesWidth:function(){var t,n=this;n._isLocked()&&(t=e(">.k-grid-footer>.k-grid-footer-wrap>table",n.wrapper).add(n.thead.parent()).add(n.table),n._footerWidth=tt(t.eq(0)),t.width(n._footerWidth),t=e(">.k-grid-footer>.k-grid-footer-locked>table",n.wrapper).add(n.lockedHeader.find(">table")).add(n.lockedTable),t.width(tt(t.eq(0))))},hideColumn:function(n){var i,o,r,s,l,c,d,g,m,v,_=this,w=0,y=_.footer||_.wrapper.find(".k-grid-footer"),b=_.columns,x=_.lockedHeader?N(_.lockedHeader.find(">table>thead")).filter(u).length:0;if(n="number"==typeof n?b[n]:vt(n)?yt(T(b),function(e){return e===n})[0]:yt(T(b),function(e){return e.field===n})[0],n&&f(n)){if(n.columns&&n.columns.length){for(c=C(n,b),h(n,!1),Q(a(e(">table>thead",_.lockedHeader),_.thead,">tr:eq("+c.row+")>th"),c.cell,!1),r=0;n.columns.length>r;r++)this.hideColumn(n.columns[r]);return _.trigger(jt,{column:n}),t}if(m=xt(n,p(O(b))),h(n,!1),_._setParentsVisibility(n,!1),_._templates(),_._updateCols(),_._updateLockedCols(),v=_.thead,d=m,_.lockedHeader&&x>m?v=_.lockedHeader.find(">table>thead"):d-=x,i=N(v).filter(u).eq(d),i[0].style.display="none",Q(a(e(">table>thead",_.lockedHeader),_.thead,">tr.k-filter-row>th"),m,!1),y[0]&&(_._updateCols(y.find(">.k-grid-footer-wrap>table")),_._updateLockedCols(y.find(">.k-grid-footer-locked>table")),Q(y.find(".k-footer-template>td"),m,!1)),_.lockedTable&&x>m?X(_.lockedTable.find(">tbody>tr"),m):X(_.tbody.children(),m-x),_.lockedTable)_._updateTablesWidth(),_._applyLockedContainersWidth(),_._syncLockedContentHeight(),_._syncLockedHeaderHeight(),_._syncLockedFooterHeight();else{for(s=_.thead.prev().find("col"),r=0,g=s.length;g>r;r+=1){if(l=s[r].style.width,!l||-1!=l.indexOf("%")){w=0;break}w+=parseInt(l,10)}o=e(">.k-grid-header table:first,>.k-grid-footer table:first",_.wrapper).add(_.table),_._footerWidth=null,w&&(o.each(function(){this.style.width=w+"px"}),_._footerWidth=w),yn.msie&&8==yn.version&&(o.css("display","inline-table"),setTimeout(function(){o.css("display","table")},1))}_._updateFirstColumnClass(),_.trigger(jt,{column:n})}},_setParentsVisibility:function(t,n){var i,o,r,s,l,c=this.columns,u=[],f=n?function(e){return p(e.columns).length&&e.hidden}:function(e){return!p(e.columns).length&&!e.hidden};if(d(t,c,u)&&u.length)for(i=u.length-1;i>=0;i--)o=u[i],r=b(o,c),s=a(e(">table>thead",this.lockedHeader),this.thead,">tr:eq("+r.row+")>th:not(.k-group-cell):not(.k-hierarchy-cell)").eq(r.cell),f(o)&&(h(o,n),s[0].style.display=n?"":"none"),s.filter("["+dt.attr("colspan")+"]").length&&(l=parseInt(s.attr(dt.attr("colspan")),10),s[0].colSpan=l-D(o.columns)||1)},showColumn:function(n){var i,o,r,s,l,c,d,u,p,g,m,v=this,_=v.columns,w=v.footer||v.wrapper.find(".k-grid-footer"),y=v.lockedHeader?N(v.lockedHeader.find(">table>thead")).length:0;if(n="number"==typeof n?_[n]:vt(n)?yt(T(_),function(e){return e===n})[0]:yt(T(_),function(e){return e.field===n})[0],n&&!f(n)){if(n.columns&&n.columns.length){for(d=b(n,_),h(n,!0),Q(a(e(">table>thead",v.lockedHeader),v.thead,">tr:eq("+d.row+")>th"),d.cell,!0),i=0;n.columns.length>i;i++)this.showColumn(n.columns[i]);return v.trigger(Gt,{column:n}),t}if(g=xt(n,O(_)),h(n,!0),v._setParentsVisibility(n,!0),v._templates(),v._updateCols(),v._updateLockedCols(),m=v.thead,c=g,v.lockedHeader&&y>g?m=v.lockedHeader.find(">table>thead"):c-=y,r=N(m).eq(c),r[0].style.display="",Q(a(e(">table>thead",v.lockedHeader),v.thead,">tr.k-filter-row>th"),g,!0),w[0]&&(v._updateCols(w.find(">.k-grid-footer-wrap>table")),v._updateLockedCols(w.find(">.k-grid-footer-locked>table")),Q(w.find(".k-footer-template>td"),g,!0)),v.lockedTable&&y>g?J(v.lockedTable.find(">tbody>tr"),g):J(v.tbody.children(),g-y),v.lockedTable)v._updateTablesWidth(),v._applyLockedContainersWidth(),v._syncLockedContentHeight(),v._syncLockedHeaderHeight();else if(s=e(">.k-grid-header table:first,>.k-grid-footer table:first",v.wrapper).add(v.table),n.width){for(l=0,p=v.thead.prev().find("col"),i=0,o=p.length;o>i;i+=1){if(u=p[i].style.width,u.indexOf("%")>-1){l=0;break}l+=parseInt(u,10)}v._footerWidth=null,l&&(s.each(function(){this.style.width=l+"px"}),v._footerWidth=l)}else s.width("");v._updateFirstColumnClass(),v.trigger(Gt,{column:n})}},_progress:function(e){var t=this.element;this.lockedContent?t=this.wrapper:this.element.is("table")?t=this.element.parent():this.content&&this.content.length&&(t=this.content),dt.ui.progress(t,e)},_resize:function(e,t){this.content&&(this._setContentWidth(),this._setContentHeight()),this.virtualScrollable&&(t||this._rowHeight)&&(t&&(this._rowHeight=null),this.virtualScrollable.repaintScrollbar())},_isActiveInTable:function(){var t=pt();return this.table[0]===t||e.contains(this.table[0],t)||this._isLocked()&&(this.lockedTable[0]===t||e.contains(this.lockedTable[0],t))},refresh:function(t){var n,i=this,o=i.dataSource.view(),r=i.options.navigatable,a=e(i.current()),s=!1,l=(i.dataSource.group()||[]).length,c=i.content&&i.content.scrollLeft(),d=l+F(p(i.columns)).length;t&&"itemchange"===t.action&&i.editable||(t=t||{},i.trigger("dataBinding",{action:t.action||"rebind",index:t.index,items:t.items})||(i._angularItems("cleanup"),r&&(i._isActiveInTable()||i._editContainer&&i._editContainer.data("kendoWindow"))&&(s=a.is("th"),n=Math.max(i.cellIndex(a),0)),i._destroyEditable(),i._progress(!1),i._hideResizeHandle(),i._data=[],i.columns.length||(i._autoColumns(i._firstDataItem(o[0],l)),d=l+i.columns.length),i._group=l>0||i._group,i._group&&(i._templates(),i._updateCols(),i._updateLockedCols(),i._updateHeader(l),i._group=l>0),i._renderContent(o,d,l),i._renderLockedContent(o,d,l),i._footer(),i._renderNoRecordsContent(),i._setContentHeight(),i._setContentWidth(c),i.lockedTable&&(i.options.scrollable.virtual?i.content.find(">.k-virtual-scrollable-wrap").trigger("scroll"):i.touchScroller?i.touchScroller.movable.trigger("change"):i.content.trigger("scroll")),i._restoreCurrent(n,s),i.touchScroller&&i.touchScroller.contentResized(),i.selectable&&i.selectable.resetTouchEvents(),i._angularItems("compile"),i.trigger($t)))},_restoreCurrent:function(n,i){var o,r,a;n===t||0>n||(this._removeCurrent(),i?this.current(this.thead.find("th:not(.k-group-cell)").eq(n)):(o=0,this._rowVirtualIndex?o=this.virtualScrollable.position(this._rowVirtualIndex):n=0,r=e(),this.lockedTable&&(r=this.lockedTable.find(">tbody>tr").eq(o)),r=r.add(this.tbody.children().eq(o)),a=r.find(">td:not(.k-group-cell):not(.k-hierarchy-cell)").eq(n),this.current(a)),this._current&&rt(this._current.closest("table")[0],!0))},_angularItems:function(e){dt.ui.DataBoundWidget.fn._angularItems.call(this,e),"cleanup"===e&&this._cleanupDetailItems(),this._angularGroupItems(e),this._angularGroupFooterItems(e)},_cleanupDetailItems:function(){var e=this;e._hasDetails()&&(e.angular("cleanup",function(){return{elements:e.tbody.children(".k-detail-row")}}),e.tbody.find(".k-detail-cell").empty())},_angularGroupItems:function(t){var n=this;n._group&&n.angular(t,function(){return{elements:n.tbody.children(".k-grouping-row"),data:e.map(K(n.dataSource.view()),function(e){return{dataItem:e}})}})},_angularGroupFooterItems:function(t){var n=this;n._group&&n.groupFooterTemplate&&n.angular(t,function(){return{elements:n.tbody.children(".k-group-footer"),data:e.map(Z(n.dataSource.view()),function(e){return{dataItem:e}})}})},_renderContent:function(e,t,n){var i,o,r=this,a="",s=null!=r.lockedContent,l={rowTemplate:r.rowTemplate,altRowTemplate:r.altRowTemplate,groupFooterTemplate:r.groupFooterTemplate};if(t=s?t-F(R(r.columns)).length:t,n>0)for(t=s?t-n:t,r.detailTemplate&&t++,r.groupFooterTemplate&&(r._groupAggregatesDefaultObject=r.dataSource.aggregates()),i=0,o=e.length;o>i;i++)a+=r._groupRowHtml(e[i],t,0,s?ct:lt,l,s);else a+=r._rowsHtml(e,l);r.tbody=U(r.tbody,r.table,a,this.options.$angular)},_renderLockedContent:function(e,t,n){var i,o,r,a="",s={rowTemplate:this.lockedRowTemplate,altRowTemplate:this.lockedAltRowTemplate,groupFooterTemplate:this.lockedGroupFooterTemplate};if(this.lockedContent){if(r=this.lockedTable,n>0)for(t-=p(O(z(this.columns))).length,i=0,o=e.length;o>i;i++)a+=this._groupRowHtml(e[i],t,0,lt,s);else a=this._rowsHtml(e,s);U(r.children("tbody"),r,a,this.options.$angular),this._syncLockedContentHeight()}},_adjustRowsHeight:function(e,t){var n,i,o,r,a=e[0].rows,s=a.length,l=t[0].rows,c=e.add(t),d=c.length,h=[];for(n=0;s>n&&l[n];n++)a[n].style.height&&(a[n].style.height=l[n].style.height=""),i=a[n].offsetHeight,o=l[n].offsetHeight,r=0,i>o?r=i:o>i&&(r=o),h.push(r);for(n=0;d>n;n++)c[n].style.display="none";for(n=0;s>n;n++)h[n]&&(a[n].style.height=l[n].style.height=h[n]+1+"px");for(n=0;d>n;n++)c[n].style.display=""}});dt.ExcelMixin&&dt.ExcelMixin.extend(Sn.prototype),dt.PDFMixin&&(dt.PDFMixin.extend(Sn.prototype),Sn.prototype._drawPDF=function(n){function i(){d&&a!==t?(c.unbind("change",o),c.one("change",function(){s.resolve(r)}),c.page(a)):s.resolve(r)}function o(){l._drawPDFShadow({width:l.wrapper.width()}).done(function(e){var t=c.page(),o=d?c.totalPages():1,a={page:e,pageNumber:t,progress:t/o,totalPages:o};n.notify(a),r.append(a.page),o>t?c.page(t+1):i()}).fail(function(e){s.reject(e)})}var r,a,s=new e.Deferred,l=this,c=l.dataSource,d=l.options.pdf.allPages;return this._initPDFProgress(n),r=new dt.drawing.Group,a=c.page(),d?(c.bind("change",o),c.page(1)):o(),s.promise()},Sn.prototype._initPDFProgress=function(t){var n,i=e("<div class='k-loading-pdf-mask'><div class='k-loading-color'/></div>");i.prepend(this.wrapper.clone().css({position:"absolute",top:0,left:0})),this.wrapper.append(i),n=e("<div class='k-loading-pdf-progress'>").appendTo(i).kendoProgressBar({type:"chunk",chunkCount:10,min:0,max:1,value:0}).data("kendoProgressBar"),t.progress(function(e){n.value(e.progress)}).always(function(){dt.destroy(i),i.remove()})}),ht.plugin(Sn),ht.plugin(kn)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});;
/*
* Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.list.min","./kendo.mobile.scroller.min"],e)}(function(){return function(e,t){function n(e,t){var n;if(null===e&&null!==t||null!==e&&null===t)return!1;if(n=e.length,n!==t.length)return!1;for(;n--;)if(e[n]!==t[n])return!1;return!0}var i=window.kendo,o=i.ui,r=o.List,a=i.keys,s=i._activeElement,l=i.data.ObservableArray,c=e.proxy,d="id",h="li",u="accept",f="filter",p="rebind",g="open",m="close",v="change",_="progress",w="select",y="aria-disabled",b="aria-readonly",x="k-state-focused",k="k-loading-hidden",C="k-state-hover",S="k-state-disabled",T="disabled",D="readonly",A=".kendoMultiSelect",P="click"+A,E="keydown"+A,M="mouseenter"+A,I="mouseleave"+A,B=M+" "+I,z=/"/g,L=e.isArray,F=["font-family","font-size","font-stretch","font-style","font-weight","letter-spacing","text-transform","line-height"],R=r.extend({init:function(t,n){var o,a,s=this;s.ns=A,r.fn.init.call(s,t,n),s._optionsMap={},s._customOptions={},s._wrapper(),s._tagList(),s._input(),s._textContainer(),s._loader(),s._tabindex(s.input),t=s.element.attr("multiple","multiple").hide(),n=s.options,n.placeholder||(n.placeholder=t.data("placeholder")),o=t.attr(d),o&&(s._tagID=o+"_tag_active",o+="_taglist",s.tagList.attr(d,o)),s._aria(o),s._dataSource(),s._ignoreCase(),s._popup(),s._tagTemplate(),s._initList(),s._reset(),s._enable(),s._placeholder(),n.autoBind?s.dataSource.fetch():n.value&&s._preselect(n.value),a=e(s.element).parents("fieldset").is(":disabled"),a&&s.enable(!1),i.notify(s)},_preselect:function(t,n){var o=this;L(t)||t instanceof i.data.ObservableArray||(t=[t]),(e.isPlainObject(t[0])||t[0]instanceof i.data.ObservableObject||!o.options.dataValueField)&&(o.dataSource.data(t),o.value(n||o._initialValues),o._retrieveData=!0)},options:{name:"MultiSelect",tagMode:"multiple",enabled:!0,autoBind:!0,autoClose:!0,highlightFirst:!0,dataTextField:"",dataValueField:"",filter:"startswith",ignoreCase:!0,minLength:0,delay:100,value:null,maxSelectedItems:null,placeholder:"",height:200,animation:{},itemTemplate:"",tagTemplate:"",groupTemplate:"#:data#",fixedGroupTemplate:"#:data#"},events:[g,m,v,w,"filtering","dataBinding","dataBound"],setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.listView.setDataSource(this.dataSource),this.options.autoBind&&this.dataSource.fetch()},setOptions:function(e){var t=this._listOptions(e);r.fn.setOptions.call(this,e),this._normalizeOptions(t),this.listView.setOptions(t),this._accessors(),this._aria(this.tagList.attr(d)),this._tagTemplate()},currentTag:function(e){var n=this;return e===t?n._currentTag:(n._currentTag&&(n._currentTag.removeClass(x).removeAttr(d),n.input.removeAttr("aria-activedescendant")),e&&(e.addClass(x).attr(d,n._tagID),n.input.attr("aria-activedescendant",n._tagID)),n._currentTag=e,t)},dataItems:function(){return this.listView.selectedDataItems()},destroy:function(){var e=this,t=e.ns;clearTimeout(e._busy),clearTimeout(e._typingTimeout),e.wrapper.off(t),e.tagList.off(t),e.input.off(t),r.fn.destroy.call(e)},_activateItem:function(){r.fn._activateItem.call(this),this.currentTag(null)},_normalizeOptions:function(e){var t=this.options.itemTemplate||this.options.template,n=e.itemTemplate||t||e.template;n||(n="#:"+i.expr(e.dataTextField,"data")+"#"),e.template=n},_initList:function(){var t=this,n=t.options.virtual,o=!!n,r=c(t._listBound,t),a={autoBind:!1,selectable:"multiple",dataSource:t.dataSource,click:c(t._click,t),change:c(t._listChange,t),activate:c(t._activateItem,t),deactivate:c(t._deactivateItem,t),dataBinding:function(){t.trigger("dataBinding"),t._angularItems("cleanup")},dataBound:r,listBound:r,selectedItemChange:c(t._selectedItemChange,t)};a=e.extend(t._listOptions(),a,"object"==typeof n?n:{}),t._normalizeOptions(a),t.listView=o?new i.ui.VirtualList(t.ul,a):new i.ui.StaticList(t.ul,a),t.listView.value(t._initialValues||t.options.value)},_listChange:function(e){this._state===p&&(this._state="",e.added=[]),this._selectValue(e.added,e.removed)},_selectedItemChange:function(e){var t,n,i=e.items;for(n=0;i.length>n;n++)t=i[n],this.tagList.children().eq(t.index).children("span:first").html(this.tagTextTemplate(t.item))},_wrapperMousedown:function(t){var n=this,o="input"!==t.target.nodeName.toLowerCase(),r=e(t.target),a=r.hasClass("k-select")||r.hasClass("k-icon");a&&(a=!r.closest(".k-select").children(".k-i-arrow-s").length),!o||a&&i.support.mobileOS||t.preventDefault(),a||(n.input[0]!==s()&&o&&n.input.focus(),0===n.options.minLength&&n.open())},_inputFocus:function(){this._placeholder(!1),this.wrapper.addClass(x)},_inputFocusout:function(){var e=this;clearTimeout(e._typingTimeout),e.wrapper.removeClass(x),e._placeholder(!e.listView.selectedDataItems()[0],!0),e.close(),e._state===f&&(e._state=u,e.listView.filter(!1),e.listView.skipUpdate(!0)),e.element.blur()},_removeTag:function(e){var n,i=this,o=i._state,r=e.index(),a=i.listView,s=a.value()[r],l=i._customOptions[s];l!==t||o!==u&&o!==f||(l=i._optionsMap[s]),l!==t?(n=i.element[0].children[l],n.removeAttribute("selected"),n.selected=!1,a.removeAt(r),e.remove()):a.select(a.select()[r]),i.currentTag(null),i._change(),i._close()},_tagListClick:function(t){var n=e(t.currentTarget);n.children(".k-i-arrow-s").length||this._removeTag(n.closest(h))},_editable:function(t){var n=this,i=t.disable,o=t.readonly,r=n.wrapper.off(A),a=n.tagList.off(A),s=n.element.add(n.input.off(A));o||i?(i?r.addClass(S):r.removeClass(S),s.attr(T,i).attr(D,o).attr(y,i).attr(b,o)):(r.removeClass(S).on(B,n._toggleHover).on("mousedown"+A+" touchend"+A,c(n._wrapperMousedown,n)),n.input.on(E,c(n._keydown,n)).on("paste"+A,c(n._search,n)).on("focus"+A,c(n._inputFocus,n)).on("focusout"+A,c(n._inputFocusout,n)),s.removeAttr(T).removeAttr(D).attr(y,!1).attr(b,!1),a.on(M,h,function(){e(this).addClass(C)}).on(I,h,function(){e(this).removeClass(C)}).on(P,"li.k-button .k-select",c(n._tagListClick,n)))},_close:function(){var e=this;e.options.autoClose?e.close():e.popup.position()},close:function(){this.popup.close()},open:function(){var e=this;e._request&&(e._retrieveData=!1),e._retrieveData||!e.listView.isBound()||e._state===u?(e._open=!0,e._state=p,e._retrieveData=!1,e.listView.filter(!1),e.listView.skipUpdate(!0),e._filterSource()):e._allowSelection()&&(e.popup.open(),e._focusItem())},toggle:function(e){e=e!==t?e:!this.popup.visible(),this[e?g:m]()},refresh:function(){this.listView.refresh()},_listBound:function(){var e=this,n=e.dataSource.flatView(),i=e.dataSource.page(),o=n.length;e._angularItems("compile"),e._render(n),e._calculateGroupPadding(e._height(o)),e._open&&(e._open=!1,e.toggle(o)),e.popup.position(),!e.options.highlightFirst||i!==t&&1!==i||e.listView.first(),e._touchScroller&&e._touchScroller.reset(),e._hideBusy(),e._makeUnselectable(),e.trigger("dataBound")},search:function(e){var t,n,i=this,o=i.options,r=o.ignoreCase,a=o.filter,s=o.dataTextField,l=i.input.val();o.placeholder===l&&(l=""),clearTimeout(i._typingTimeout),e="string"==typeof e?e:l,n=e.length,(!n||n>=o.minLength)&&(i.listView.filter(!0),i._state=f,i._open=!0,t={value:r?e.toLowerCase():e,field:s,operator:a,ignoreCase:r},i._filterSource(t,i._retrieveData),i._retrieveData=!1)},value:function(e){var n=this,i=n.listView.value().slice(),o=n.options.maxSelectedItems;return e===t?i:(e=n._normalizeValues(e),null!==o&&e.length>o&&(e=e.slice(0,o)),n.listView.value(e),n._old=e,n._fetchData(),t)},_setOption:function(e,t){var n=this.element[0].children[this._optionsMap[e]];n&&(t?n.setAttribute("selected","selected"):n.removeAttribute("selected"),n.selected=t)},_fetchData:function(){var e=this,t=!!e.dataSource.view().length,n=0===e.listView.value().length;n||e._request||(e._retrieveData||!e._fetch&&!t)&&(e._fetch=!0,e._retrieveData=!1,e.dataSource.read().done(function(){e._fetch=!1}))},_dataSource:function(){var e=this,t=e.element,n=e.options,o=n.dataSource||{};o=L(o)?{data:o}:o,o.select=t,o.fields=[{field:n.dataTextField},{field:n.dataValueField}],e.dataSource&&e._refreshHandler?e._unbindDataSource():e._progressHandler=c(e._showBusy,e),e.dataSource=i.data.DataSource.create(o).bind(_,e._progressHandler)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),o=i?e("#"+i):n.closest("form");o[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(t._initialValues),t._placeholder()})},t._form=o.on("reset",t._resetHandler))},_initValue:function(){var e=this.options.value||this.element.val();this._old=this._initialValues=this._normalizeValues(e)},_normalizeValues:function(t){var n=this;return null===t?t=[]:t&&e.isPlainObject(t)?t=[n._value(t)]:t&&e.isPlainObject(t[0])?t=e.map(t,function(e){return n._value(e)}):L(t)||t instanceof l||(t=[t]),t},_change:function(){var e=this,t=e.value();n(t,e._old)||(e._old=t.slice(),e.trigger(v),e.element.trigger(v))},_click:function(e){var n=e.item;return this.trigger(w,{item:n})?(this._close(),t):(this._select(n),this._change(),this._close(),t)},_keydown:function(n){var o=this,r=n.keyCode,s=o._currentTag,l=o.listView.focus(),c=o.input.val(),d=i.support.isRtl(o.wrapper),h=o.popup.visible();if(r===a.DOWN){if(n.preventDefault(),!h)return o.open(),l||this.listView.first(),t;l?(this.listView.next(),this.listView.focus()||this.listView.last()):this.listView.first()}else if(r===a.UP)h&&(l&&this.listView.prev(),this.listView.focus()||o.close()),n.preventDefault();else if(r===a.LEFT&&!d||r===a.RIGHT&&d)c||(s=s?s.prev():e(o.tagList[0].lastChild),s[0]&&o.currentTag(s));else if(r===a.RIGHT&&!d||r===a.LEFT&&d)!c&&s&&(s=s.next(),o.currentTag(s[0]?s:null));else if(r===a.ENTER&&h){if(l){if(o.trigger(w,{item:l}))return o._close(),t;o._select(l)}o._change(),o._close(),n.preventDefault()}else r===a.ESC?(h?n.preventDefault():o.currentTag(null),o.close()):r===a.HOME?h?this.listView.first():c||(s=o.tagList[0].firstChild,s&&o.currentTag(e(s))):r===a.END?h?this.listView.last():c||(s=o.tagList[0].lastChild,s&&o.currentTag(e(s))):r!==a.DELETE&&r!==a.BACKSPACE||c?(clearTimeout(o._typingTimeout),setTimeout(function(){o._scale()}),o._search()):(r!==a.BACKSPACE||s||(s=e(o.tagList[0].lastChild)),s&&s[0]&&o._removeTag(s))},_hideBusy:function(){var e=this;clearTimeout(e._busy),e.input.attr("aria-busy",!1),e._loading.addClass(k),e._request=!1,e._busy=null},_showBusyHandler:function(){this.input.attr("aria-busy",!0),this._loading.removeClass(k)},_showBusy:function(){var e=this;e._request=!0,e._busy||(e._busy=setTimeout(c(e._showBusyHandler,e),100))},_placeholder:function(e,n){var o=this,r=o.input,a=s();e===t&&(e=!1,r[0]!==a&&(e=!o.listView.selectedDataItems()[0])),o._prev="",r.toggleClass("k-readonly",e).val(e?o.options.placeholder:""),r[0]!==a||n||i.caret(r[0],0,0),o._scale()},_scale:function(){var e,t=this,n=t.wrapper,i=n.width(),o=t._span.text(t.input.val());n.is(":visible")?e=o.width()+25:(o.appendTo(document.documentElement),i=e=o.width()+25,o.appendTo(n)),t.input.width(e>i?i:e)},_option:function(e,n,o){var r="<option";return e!==t&&(e+="",-1!==e.indexOf('"')&&(e=e.replace(z,"&quot;")),r+=' value="'+e+'"'),o&&(r+=" selected"),r+=">",n!==t&&(r+=i.htmlEncode(n)),r+="</option>"},_render:function(e){var t,n,i,o,r,a,s=this.listView.selectedDataItems(),l=this.listView.value(),c=e.length,d="";for(l.length!==s.length&&(s=this._buildSelectedItems(l)),r={},a={},o=0;c>o;o++)n=e[o],i=this._value(n),t=this._selectedItemIndex(i,s),-1!==t&&s.splice(t,1),a[i]=o,d+=this._option(i,this._text(n),-1!==t);if(s.length)for(o=0;s.length>o;o++)n=s[o],i=this._value(n),r[i]=c,a[i]=c,c+=1,d+=this._option(i,this._text(n),!0);this._customOptions=r,this._optionsMap=a,this.element.html(d)},_buildSelectedItems:function(e){var t,n,i=this.options.dataValueField,o=this.options.dataTextField,r=[];for(n=0;e.length>n;n++)t={},t[i]=e[n],t[o]=e[n],r.push(t);return r},_selectedItemIndex:function(e,t){for(var n=this._value,i=0;t.length>i;i++)if(e===n(t[i]))return i;return-1},_search:function(){var e=this;e._typingTimeout=setTimeout(function(){var t=e.input.val();e._prev!==t&&(e._prev=t,e.search(t))},e.options.delay)},_allowSelection:function(){var e=this.options.maxSelectedItems;return null===e||e>this.listView.value().length},_angularTagItems:function(t){var n=this;n.angular(t,function(){return{elements:n.tagList[0].children,data:e.map(n.dataItems(),function(e){return{dataItem:e}})}})},_selectValue:function(e,t){var n,i,o,r=this,a=r.value(),s=r.dataSource.total(),l=r.tagList,c=r._value;if(r._angularTagItems("cleanup"),"multiple"===r.options.tagMode){for(o=t.length-1;o>-1;o--)n=t[o],l[0].removeChild(l[0].children[n.position]),r._setOption(c(n.dataItem),!1);for(o=0;e.length>o;o++)i=e[o],l.append(r.tagTemplate(i.dataItem)),r._setOption(c(i.dataItem),!0)}else{for((!r._maxTotal||s>r._maxTotal)&&(r._maxTotal=s),l.html(""),a.length&&l.append(r.tagTemplate({values:a,dataItems:r.dataItems(),maxTotal:r._maxTotal,currentTotal:s})),o=t.length-1;o>-1;o--)r._setOption(c(t[o].dataItem),!1);for(o=0;e.length>o;o++)r._setOption(c(e[o].dataItem),!0)}r._angularTagItems("compile"),r._placeholder()},_select:function(e){var t=this;t._state===p&&(t._state=""),t._allowSelection()&&(this.listView.select(e),t._placeholder(),t._state===f&&(t._state=u,t.listView.filter(!1),t.listView.skipUpdate(!0)))},_input:function(){var t=this,n=t.element[0].accessKey,i=t._innerWrapper.children("input.k-input");i[0]||(i=e('<input class="k-input" style="width: 25px" />').appendTo(t._innerWrapper)),t.element.removeAttr("accesskey"),t._focused=t.input=i.attr({accesskey:n,autocomplete:"off",role:"listbox","aria-expanded":!1})},_tagList:function(){var t=this,n=t._innerWrapper.children("ul");n[0]||(n=e('<ul role="listbox" unselectable="on" class="k-reset"/>').appendTo(t._innerWrapper)),t.tagList=n},_tagTemplate:function(){var e,t=this,n=t.options,o=n.tagTemplate,r=n.dataSource,a="multiple"===n.tagMode;t.element[0].length&&!r&&(n.dataTextField=n.dataTextField||"text",n.dataValueField=n.dataValueField||"value"),e=a?i.template("#:"+i.expr(n.dataTextField,"data")+"#",{useWithBlock:!1}):i.template("#:values.length# item(s) selected"),t.tagTextTemplate=o=o?i.template(o):e,t.tagTemplate=function(e){return'<li class="k-button" unselectable="on"><span unselectable="on">'+o(e)+'</span><span unselectable="on" class="k-select"><span unselectable="on" class="k-icon '+(a?"k-i-close":"k-i-arrow-s")+'">'+(a?"delete":"open")+"</span></span></li>"}},_loader:function(){this._loading=e('<span class="k-icon k-loading '+k+'"></span>').insertAfter(this.input)},_textContainer:function(){var t=i.getComputedStyles(this.input[0],F);t.position="absolute",t.visibility="hidden",t.top=-3333,t.left=-3333,this._span=e("<span/>").css(t).appendTo(this.wrapper)},_wrapper:function(){var t=this,n=t.element,i=n.parent("span.k-multiselect");i[0]||(i=n.wrap('<div class="k-widget k-multiselect k-header" unselectable="on" />').parent(),i[0].style.cssText=n[0].style.cssText,i[0].title=n[0].title,e('<div class="k-multiselect-wrap k-floatwrap" unselectable="on" />').insertBefore(n)),t.wrapper=i.addClass(n[0].className).css("display",""),t._innerWrapper=e(i[0].firstChild)}});o.plugin(R)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});;
/*
* Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.core.min"],e)}(function(){return function(e,t){function n(t){t=e(t),t.children(v).children(".k-icon").remove(),t.filter(":has(.k-panel),:has(.k-content)").children(".k-link:not(:has([class*=k-i-arrow]))").each(function(){var t=e(this),n=t.parent();t.append("<span class='k-icon "+(n.hasClass(I)?"k-i-arrow-n k-panelbar-collapse":"k-i-arrow-s k-panelbar-expand")+"'/>")})}function i(t){t=e(t),t.filter(".k-first:not(:first-child)").removeClass(k),t.filter(".k-last:not(:last-child)").removeClass(g),t.filter(":first-child").addClass(k),t.filter(":last-child").addClass(g)}var o=window.kendo,r=o.ui,a=o.keys,s=e.extend,l=e.each,c=o.template,d=r.Widget,h=/^(ul|a|div)$/i,u=".kendoPanelBar",f="img",p="href",g="k-last",m="k-link",v="."+m,_="error",w=".k-item",y=".k-group",b=y+":visible",x="k-image",k="k-first",C="expand",S="select",T="k-content",D="activate",A="collapse",P="mouseenter",E="mouseleave",M="contentLoad",I="k-state-active",B="> .k-panel",z="> .k-content",L="k-state-focused",F="k-state-disabled",R="k-state-selected",O="."+R,H="k-state-highlight",N=w+":not(.k-state-disabled)",V="> "+N+" > "+v+", .k-panel > "+N+" > "+v,U=w+".k-state-disabled > .k-link",W="> li > "+O+", .k-panel > li > "+O,j="k-state-default",G="aria-disabled",q="aria-expanded",$="aria-hidden",Y="aria-selected",Q=":visible",X=":empty",K="single",Z={content:c("<div role='region' class='k-content'#= contentAttributes(data) #>#= content(item) #</div>"),group:c("<ul role='group' aria-hidden='true' class='#= groupCssClass(group) #'#= groupAttributes(group) #>#= renderItems(data) #</ul>"),itemWrapper:c("<#= tag(item) # class='#= textClass(item, group) #' #= contentUrl(item) ##= textAttributes(item) #>#= image(item) ##= sprite(item) ##= text(item) ##= arrow(data) #</#= tag(item) #>"),item:c("<li role='menuitem' #=aria(item)#class='#= wrapperCssClass(group, item) #'>#= itemWrapper(data) ## if (item.items) { ##= subGroup({ items: item.items, panelBar: panelBar, group: { expanded: item.expanded } }) ## } else if (item.content || item.contentUrl) { ##= renderContent(data) ## } #</li>"),image:c("<img class='k-image' alt='' src='#= imageUrl #' />"),arrow:c("<span class='#= arrowClass(item) #'></span>"),sprite:c("<span class='k-sprite #= spriteCssClass #'></span>"),empty:c("")},J={aria:function(e){var t="";return(e.items||e.content||e.contentUrl)&&(t+=q+"='"+(e.expanded?"true":"false")+"' "),e.enabled===!1&&(t+=G+"='true'"),t},wrapperCssClass:function(e,t){var n="k-item",i=t.index;return n+=t.enabled===!1?" "+F:t.expanded===!0?" "+I:" k-state-default",0===i&&(n+=" k-first"),i==e.length-1&&(n+=" k-last"),t.cssClass&&(n+=" "+t.cssClass),n},textClass:function(e,t){var n=m;return t.firstLevel&&(n+=" k-header"),n},textAttributes:function(e){return e.url?" href='"+e.url+"'":""},arrowClass:function(e){var t="k-icon";return t+=e.expanded?" k-i-arrow-n k-panelbar-collapse":" k-i-arrow-s k-panelbar-expand"},text:function(e){return e.encoded===!1?e.text:o.htmlEncode(e.text)},tag:function(e){return e.url||e.contentUrl?"a":"span"},groupAttributes:function(e){return e.expanded!==!0?" style='display:none'":""},groupCssClass:function(){return"k-group k-panel"},contentAttributes:function(e){return e.item.expanded!==!0?" style='display:none'":""},content:function(e){return e.content?e.content:e.contentUrl?"":"&nbsp;"},contentUrl:function(e){return e.contentUrl?'href="'+e.contentUrl+'"':""}},et=d.extend({init:function(t,n){var i,r=this;d.fn.init.call(r,t,n),t=r.wrapper=r.element.addClass("k-widget k-reset k-header k-panelbar"),n=r.options,t[0].id&&(r._itemId=t[0].id+"_pb_active"),r._tabindex(),r._initData(n),r._updateClasses(),r._animations(n),t.on("click"+u,V,function(t){r._click(e(t.currentTarget))&&t.preventDefault()}).on(P+u+" "+E+u,V,r._toggleHover).on("click"+u,U,!1).on("keydown"+u,e.proxy(r._keydown,r)).on("focus"+u,function(){var e=r.select();r._current(e[0]?e:r._first())}).on("blur"+u,function(){r._current(null)}).attr("role","menu"),i=t.find("li."+I+" > ."+T),i[0]&&r.expand(i.parent(),!1),o.notify(r)},events:[C,A,S,D,_,M],options:{name:"PanelBar",animation:{expand:{effects:"expand:vertical",duration:200},collapse:{duration:200}},expandMode:"multiple"},destroy:function(){d.fn.destroy.call(this),this.element.off(u),o.destroy(this.element)},_initData:function(e){var t=this;e.dataSource&&(t.element.empty(),t.append(e.dataSource,t.element))},setOptions:function(e){var t=this.options.animation;this._animations(e),e.animation=s(!0,t,e.animation),"dataSource"in e&&this._initData(e),d.fn.setOptions.call(this,e)},expand:function(t,n){var i=this,o={};return n=n!==!1,t=this.element.find(t),t.each(function(r,a){a=e(a);var s=a.find(B).add(a.find(z));if(!a.hasClass(F)&&s.length>0){if(i.options.expandMode==K&&i._collapseAllExpanded(a))return i;t.find("."+H).removeClass(H),a.addClass(H),n||(o=i.options.animation,i.options.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}}),i._triggerEvent(C,a)||i._toggleItem(a,!1),n||(i.options.animation=o)}}),i},collapse:function(t,n){var i=this,o={};return n=n!==!1,t=i.element.find(t),t.each(function(t,r){r=e(r);var a=r.find(B).add(r.find(z));!r.hasClass(F)&&a.is(Q)&&(r.removeClass(H),n||(o=i.options.animation,i.options.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}}),i._triggerEvent(A,r)||i._toggleItem(r,!0),n||(i.options.animation=o))}),i},_toggleDisabled:function(e,t){e=this.element.find(e),e.toggleClass(j,t).toggleClass(F,!t).attr(G,!t)},select:function(n){var i=this;return n===t?i.element.find(W).parent():(n=i.element.find(n),n.length?n.each(function(){var n=e(this),o=n.children(v);return n.hasClass(F)?i:(i._triggerEvent(S,n)||i._updateSelected(o),t)}):this._updateSelected(n),i)},clearSelection:function(){this.select(e())},enable:function(e,t){return this._toggleDisabled(e,t!==!1),this},disable:function(e){return this._toggleDisabled(e,!1),this},append:function(e,t){t=this.element.find(t);var o=this._insert(e,t,t.length?t.find(B):null);return l(o.items,function(){o.group.append(this),i(this)}),n(t),i(o.group.find(".k-first, .k-last")),o.group.height("auto"),this},insertBefore:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return l(n.items,function(){t.before(this),i(this)}),i(t),n.group.height("auto"),this},insertAfter:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return l(n.items,function(){t.after(this),i(this)}),i(t),n.group.height("auto"),this},remove:function(e){e=this.element.find(e);var t=this,o=e.parentsUntil(t.element,w),r=e.parent("ul");return e.remove(),!r||r.hasClass("k-panelbar")||r.children(w).length||r.remove(),o.length&&(o=o.eq(0),n(o),i(o)),t},reload:function(t){var n=this;t=n.element.find(t),t.each(function(){var t=e(this);n._ajaxRequest(t,t.children("."+T),!t.is(Q))})},_first:function(){return this.element.children(N).first()},_last:function(){var e=this.element.children(N).last(),t=e.children(b);return t[0]?t.children(N).last():e},_current:function(n){var i=this,o=i._focused,r=i._itemId;return n===t?o:(i.element.removeAttr("aria-activedescendant"),o&&o.length&&(o[0].id===r&&o.removeAttr("id"),o.children(v).removeClass(L)),e(n).length&&(r=n[0].id||r,n.attr("id",r).children(v).addClass(L),i.element.attr("aria-activedescendant",r)),i._focused=n,t)},_keydown:function(e){var t=this,n=e.keyCode,i=t._current();e.target==e.currentTarget&&(n==a.DOWN||n==a.RIGHT?(t._current(t._nextItem(i)),e.preventDefault()):n==a.UP||n==a.LEFT?(t._current(t._prevItem(i)),e.preventDefault()):n==a.ENTER||n==a.SPACEBAR?(t._click(i.children(v)),e.preventDefault()):n==a.HOME?(t._current(t._first()),e.preventDefault()):n==a.END&&(t._current(t._last()),e.preventDefault()))},_nextItem:function(e){if(!e)return this._first();var t=e.children(b),n=e.nextAll(":visible").first();return t[0]&&(n=t.children("."+k)),n[0]||(n=e.parent(b).parent(w).next()),n[0]||(n=this._first()),n.hasClass(F)&&(n=this._nextItem(n)),n},_prevItem:function(e){if(!e)return this._last();var t,n=e.prevAll(":visible").first();if(n[0])for(t=n;t[0];)t=t.children(b).children("."+g),t[0]&&(n=t);else n=e.parent(b).parent(w),n[0]||(n=this._last());return n.hasClass(F)&&(n=this._prevItem(n)),n},_insert:function(t,n,i){var r,a,l=this,c=e.isPlainObject(t),d=n&&n[0];return d||(i=l.element),a={firstLevel:i.hasClass("k-panelbar"),expanded:i.parent().hasClass(I),length:i.children().length},d&&!i.length&&(i=e(et.renderGroup({group:a})).appendTo(n)),t instanceof o.Observable&&(t=t.toJSON()),c||e.isArray(t)?(r=e.map(c?[t]:t,function(t,n){return e("string"==typeof t?t:et.renderItem({group:a,item:s(t,{index:n})}))}),d&&n.attr(q,!1)):(r="string"==typeof t&&"<"!=t.charAt(0)?l.element.find(t):e(t),l._updateItemsClasses(r)),{items:r,group:i}},_toggleHover:function(t){var n=e(t.currentTarget);n.parents("li."+F).length||n.toggleClass("k-state-hover",t.type==P)},_updateClasses:function(){var t,o,r=this;t=r.element.find("li > ul").not(function(){return e(this).parentsUntil(".k-panelbar","div").length}).addClass("k-group k-panel").attr("role","group"),t.parent().attr(q,!1).not("."+I).children("ul").attr($,!0).hide(),o=r.element.add(t).children(),r._updateItemsClasses(o),n(o),i(o)},_updateItemsClasses:function(e){for(var t=e.length,n=0;t>n;n++)this._updateItemClasses(e[n],n)},_updateItemClasses:function(t,n){var i,r,a=this._selected,s=this.options.contentUrls,l=s&&s[n],c=this.element[0];t=e(t).addClass("k-item").attr("role","menuitem"),o.support.browser.msie&&t.css("list-style-position","inside").css("list-style-position",""),t.children(f).addClass(x),r=t.children("a").addClass(m),r[0]&&(r.attr("href",l),r.children(f).addClass(x)),t.filter(":not([disabled]):not([class*=k-state])").addClass("k-state-default"),t.filter("li[disabled]").addClass("k-state-disabled").attr(G,!0).removeAttr("disabled"),t.children("div").addClass(T).attr("role","region").attr($,!0).hide().parent().attr(q,!1),r=t.children(O),r[0]&&(a&&a.removeAttr(Y).children(O).removeClass(R),r.addClass(R),this._selected=t.attr(Y,!0)),t.children(v)[0]||(i="<span class='"+m+"'/>",s&&s[n]&&t[0].parentNode==c&&(i='<a class="k-link k-header" href="'+s[n]+'"/>'),t.contents().filter(function(){return!(this.nodeName.match(h)||3==this.nodeType&&!e.trim(this.nodeValue))}).wrapAll(i)),t.parent(".k-panelbar")[0]&&t.children(v).addClass("k-header")},_click:function(e){var t,n,i,o,r,a,s,l=this,c=l.element;if(!e.parents("li."+F).length&&e.closest(".k-widget")[0]==c[0]){if(r=e.closest(v),a=r.closest(w),l._updateSelected(r),n=a.find(B).add(a.find(z)),i=r.attr(p),o=i&&("#"==i.charAt(i.length-1)||-1!=i.indexOf("#"+l.element[0].id+"-")),t=!(!o&&!n.length),n.data("animating"))return t;if(l._triggerEvent(S,a)&&(t=!0),t!==!1)return l.options.expandMode==K&&l._collapseAllExpanded(a)?t:(n.length&&(s=n.is(Q),l._triggerEvent(s?A:C,a)||(t=l._toggleItem(a,s))),t)}},_toggleItem:function(e,n){var i,o,r=this,a=e.find(B),s=e.find(v),l=s.attr(p);return a.length?(this._toggleGroup(a,n),i=!0):(o=e.children("."+T),o.length&&(i=!0,o.is(X)&&l!==t?r._ajaxRequest(e,o,n):r._toggleGroup(o,n))),i},_toggleGroup:function(e,t){var n=this,i=n.options.animation,o=i.expand,r=s({},i.collapse),a=r&&"effects"in r;e.is(Q)==t&&(e.parent().attr(q,!t).attr($,t).toggleClass(I,!t).find("> .k-link > .k-icon").toggleClass("k-i-arrow-n",!t).toggleClass("k-panelbar-collapse",!t).toggleClass("k-i-arrow-s",t).toggleClass("k-panelbar-expand",t),o=t?s(a?r:s({reverse:!0},o),{hide:!0}):s({complete:function(e){n._triggerEvent(D,e.closest(w))}},o),e.kendoStop(!0,!0).kendoAnimate(o))},_collapseAllExpanded:function(t){var n,i=this,o=!1,r=t.find(B).add(t.find(z));return r.is(Q)&&(o=!0),r.is(Q)||0===r.length||(n=t.siblings(),n.find(B).add(n.find(z)).filter(function(){return e(this).is(Q)}).each(function(t,n){n=e(n),o=i._triggerEvent(A,n.closest(w)),o||i._toggleGroup(n,!0)})),o},_ajaxRequest:function(t,n,i){var o=this,r=t.find(".k-panelbar-collapse, .k-panelbar-expand"),a=t.find(v),s=setTimeout(function(){r.addClass("k-loading")},100),l={},c=a.attr(p);e.ajax({type:"GET",cache:!1,url:c,dataType:"html",data:l,error:function(e,t){r.removeClass("k-loading"),o.trigger(_,{xhr:e,status:t})&&this.complete()},complete:function(){clearTimeout(s),r.removeClass("k-loading")},success:function(e){function r(){return{elements:n.get()}}try{o.angular("cleanup",r),n.html(e),o.angular("compile",r)}catch(a){var s=window.console;s&&s.error&&s.error(a.name+": "+a.message+" in "+c),this.error(this.xhr,"error")}o._toggleGroup(n,i),o.trigger(M,{item:t[0],contentElement:n[0]})}})},_triggerEvent:function(e,t){var n=this;return n.trigger(e,{item:t[0]})},_updateSelected:function(e){var t=this,n=t.element,i=e.parent(w),o=t._selected;o&&o.removeAttr(Y),t._selected=i.attr(Y,!0),n.find(W).removeClass(R),n.find("> ."+H+", .k-panel > ."+H).removeClass(H),e.addClass(R),e.parentsUntil(n,w).filter(":has(.k-header)").addClass(H),t._current(i[0]?i:null)},_animations:function(e){e&&"animation"in e&&!e.animation&&(e.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}})}});s(et,{renderItem:function(e){e=s({panelBar:{},group:{}},e);var t=Z.empty,n=e.item;return Z.item(s(e,{image:n.imageUrl?Z.image:t,sprite:n.spriteCssClass?Z.sprite:t,itemWrapper:Z.itemWrapper,renderContent:et.renderContent,arrow:n.items||n.content||n.contentUrl?Z.arrow:t,subGroup:et.renderGroup},J))},renderGroup:function(e){return Z.group(s({renderItems:function(e){for(var t="",n=0,i=e.items,o=i?i.length:0,r=s({length:o},e.group);o>n;n++)t+=et.renderItem(s(e,{group:r,item:s({index:n},i[n])}));return t}},e,J))},renderContent:function(e){return Z.content(s(e,J))}}),o.ui.plugin(et)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});;
/*
* Kendo UI v2015.2.902 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.core.min"],e)}(function(){return function(e,t){function n(t){return e.map(i(t),function(e){return e.name}).join(", ")}function i(e){var t=e[0];return t.files?o(t.files):[{name:s(t.value),extension:a(t.value),size:null}]}function o(t){return e.map(t,function(e){return r(e)})}function r(e){var t=e.name||e.fileName;return{name:y.htmlEncode(t),extension:a(t),size:e.size||e.fileSize,rawFile:e}}function a(e){var t=e.match(k);return t?t[0]:""}function s(e){var t=e.lastIndexOf("\\");return-1!=t?e.substr(t+1):e}function l(t,n){var i=y.guid();return e.map(t,function(e){return e.uid=n?y.guid():i,e})}function c(t){return!t.multiple&&e(".k-file",t.wrapper).length>1}function d(n,i,o){var r,a;return i._supportsRemove()?(r=n.data("fileNames"),a=e.map(r,function(e){return e.name}),i._submitRemove(a,o,function(e,t,o){i._removeFileEntry(n),i.trigger(A,{operation:"remove",files:r,response:e,XMLHttpRequest:o})},function(e){c(i)&&i._removeFileEntry(n),i.trigger(D,{operation:"remove",files:r,XMLHttpRequest:e}),x("Server response: "+e.responseText)}),t):(c(i)&&i._removeFileEntry(n),t)}function u(t,n,i){var o=!1,r="";try{r=e.parseJSON(h(t)),o=!0}catch(a){i()}o&&n(r)}function h(e){return(t===e||""===e)&&(e="{}"),e}function p(e){e.stopPropagation(),e.preventDefault()}function f(e,t,n,i){var o,r;e.on("dragenter"+t,function(){n(),r=new Date,o||(o=setInterval(function(){var e=new Date-r;e>100&&(i(),clearInterval(o),o=null)},100))}).on("dragover"+t,function(){r=new Date})}function g(e){return e.is(".k-file-progress, .k-file-success, .k-file-error")}function m(t){return e(t.target).closest(".k-file")}var v,_,y=window.kendo,w=y.ui.Widget,b=y.antiForgeryTokens,x=y.logToConsole,k=/\.([^\.]+)$/,C=".kendoUpload",S="select",T="upload",A="success",D="error",M="complete",E="cancel",P="progress",I="remove",z=w.extend({init:function(t,n){var i,o,r,a=this;w.fn.init.call(a,t,n),a.name=t.name,a.multiple=a.options.multiple,a.localization=a.options.localization,i=a.element,a.wrapper=i.closest(".k-upload"),0===a.wrapper.length&&(a.wrapper=a._wrapInput(i)),a._activeInput(i),a.toggle(a.options.enabled),o=a._ns=C+"-"+y.guid(),i.closest("form").on("submit"+o,e.proxy(a._onParentFormSubmit,a)).on("reset"+o,e.proxy(a._onParentFormReset,a)),a.options.async.saveUrl?(a._module=a._supportsFormData()?new _(a):new v(a),a._async=!0,r=a.options.files,r.length>0&&a._renderInitialFiles(r)):a._module=new B(a),a._supportsDrop()&&a._setupDropZone(),a.wrapper.on("click",".k-upload-action",e.proxy(a._onFileAction,a)).on("click",".k-upload-selected",e.proxy(a._onUploadSelected,a)),a.element.val()&&a._onInputChange({target:a.element})},events:[S,T,A,D,M,E,P,I],options:{name:"Upload",enabled:!0,multiple:!0,showFileList:!0,template:"",files:[],async:{removeVerb:"POST",autoUpload:!0,withCredentials:!0},localization:{select:"Select files...",cancel:"Cancel",retry:"Retry",remove:"Remove",uploadSelectedFiles:"Upload files",dropFilesHere:"drop files here to upload",statusUploading:"uploading",statusUploaded:"uploaded",statusWarning:"warning",statusFailed:"failed",headerStatusUploading:"Uploading...",headerStatusUploaded:"Done"}},setOptions:function(e){var t=this,n=t.element;w.fn.setOptions.call(t,e),t.multiple=t.options.multiple,n.attr("multiple",t._supportsMultiple()?t.multiple:!1),t.toggle(t.options.enabled)},enable:function(e){e=t===e?!0:e,this.toggle(e)},disable:function(){this.toggle(!1)},toggle:function(e){e=t===e?e:!e,this.wrapper.toggleClass("k-state-disabled",e),this.element.prop("disabled",e)},destroy:function(){var t=this;e(document).add(e(".k-dropzone",t.wrapper)).add(t.wrapper.closest("form")).off(t._ns),e(t.element).off(C),w.fn.destroy.call(t)},_addInput:function(t){if(t[0].nodeType){var n=this,i=t.clone().val("");i.insertAfter(n.element).data("kendoUpload",n),e(n.element).hide().attr("tabindex","-1").removeAttr("id").off(C),n._activeInput(i),n.element.focus()}},_activeInput:function(t){var n=this,i=n.wrapper;n.element=t,t.attr("multiple",n._supportsMultiple()?n.multiple:!1).attr("autocomplete","off").on("click"+C,function(e){i.hasClass("k-state-disabled")&&e.preventDefault()}).on("focus"+C,function(){e(this).parent().addClass("k-state-focused")}).on("blur"+C,function(){e(this).parent().removeClass("k-state-focused")}).on("change"+C,e.proxy(n._onInputChange,n)).on("keydown"+C,e.proxy(n._onInputKeyDown,n))},_onInputKeyDown:function(e){var t=this,n=t.wrapper.find(".k-upload-action:first");e.keyCode===y.keys.TAB&&n.length>0&&(e.preventDefault(),n.focus())},_onInputChange:function(t){var n=this,i=e(t.target),o=l(n._inputFiles(i),n._isAsyncNonBatch()),r=n.trigger(S,{files:o});r?(n._addInput(i),i.remove()):n._module.onSelect({target:i},o)},_onDrop:function(t){var n,i=t.originalEvent.dataTransfer,r=this,a=i.files,s=l(o(a),r._isAsyncNonBatch());p(t),a.length>0&&(!r.multiple&&s.length>1&&s.splice(1,s.length-1),n=r.trigger(S,{files:s}),n||r._module.onSelect({target:e(".k-dropzone",r.wrapper)},s))},_isAsyncNonBatch:function(){return this._async&&!this.options.async.batch||!1},_renderInitialFiles:function(t){var n,i,o=this,r=0;for(t=l(t,!0),r=0;t.length>r;r++)n=t[r],i=o._enqueueFile(n.name,{fileNames:[n]}),i.addClass("k-file-success").data("files",[t[r]]),e(".k-progress",i).width("100%"),o.options.template||e(".k-upload-status",i).prepend("<span class='k-upload-pct'>100%</span>"),o._supportsRemove()&&o._fileAction(i,I)},_prepareTemplateData:function(e,t){var n=t.fileNames,i={},o=0,r=0;for(r=0;n.length>r;r++)o+=n[r].size;return i.name=e,i.size=o,i.files=t.fileNames,i},_prepareDefaultFileEntryTemplate:function(t,n){var i="",o=e("<li class='k-file'><span class='k-progress'></span><span class='k-icon'></span><span class='k-filename' title='"+t+"'>"+t+"</span><strong class='k-upload-status'></strong></li>");return 1==n.fileNames.length&&n.fileNames[0].extension&&(i=n.fileNames[0].extension.substring(1),e(".k-icon",o).addClass("k-i-"+i)),o},_enqueueFile:function(t,n){var i,o,r,a,s=this,l=n.fileNames[0].uid,c=e(".k-upload-files",s.wrapper),d=s.options,u=d.template;return 0===c.length&&(c=e("<ul class='k-upload-files k-reset'></ul>").appendTo(s.wrapper),s.options.showFileList||c.hide(),s.wrapper.removeClass("k-upload-empty")),i=e(".k-file",c),u?(r=s._prepareTemplateData(t,n),u=y.template(u),o=e("<li class='k-file'>"+u(r)+"</li>"),o.find(".k-upload-action").addClass("k-button k-button-bare"),s.angular("compile",function(){return{elements:o,data:[r]}})):o=s._prepareDefaultFileEntryTemplate(t,n),o.attr(y.attr("uid"),l).appendTo(c).data(n),s._async||e(".k-progress",o).width("100%"),!s.multiple&&i.length>0&&(a={files:i.data("fileNames")},s.trigger(I,a)||s._module.onRemove({target:e(i,s.wrapper)},a.data)),o},_removeFileEntry:function(t){var n,i,o=this,r=t.closest(".k-upload-files");t.remove(),n=e(".k-file",r),i=e(".k-file-success, .k-file-error",r),i.length===n.length&&this._hideUploadButton(),0===n.length&&(r.remove(),o.wrapper.addClass("k-upload-empty"),o._hideHeaderUploadstatus())},_fileAction:function(e,t){var n={remove:"k-delete",cancel:"k-cancel",retry:"k-retry"},i={remove:"k-i-close",cancel:"k-i-close",retry:"k-i-refresh"};n.hasOwnProperty(t)&&(this._clearFileAction(e),this.options.template?e.find(".k-upload-action").addClass("k-button k-button-bare").append("<span class='k-icon "+i[t]+" "+n[t]+"' title='"+this.localization[t]+"'></span>").show():(e.find(".k-upload-status .k-upload-action").remove(),e.find(".k-upload-status").append(this._renderAction(n[t],this.localization[t],i[t]))))},_fileState:function(t,n){var i=this.localization,o={uploading:{text:i.statusUploading},uploaded:{text:i.statusUploaded},failed:{text:i.statusFailed}},r=o[n];r&&e(".k-icon:not(.k-delete, .k-cancel, .k-retry)",t).text(r.text)},_renderAction:function(t,n,i){return e(""!==t?"<button type='button' class='k-button k-button-bare k-upload-action'><span class='k-icon "+i+" "+t+"' title='"+n+"'></span></button>":"<button type='button' class='k-button'>"+n+"</button>")},_clearFileAction:function(t){e(".k-upload-action",t).empty().hide()},_onFileAction:function(t){var n,i,o,r,a=this;return a.wrapper.hasClass("k-state-disabled")||(n=e(t.target).closest(".k-upload-action"),i=n.find(".k-icon"),o=n.closest(".k-file"),r={files:o.data("fileNames")},i.hasClass("k-delete")?a.trigger(I,r)||a._module.onRemove({target:e(o,a.wrapper)},r.data):i.hasClass("k-cancel")?(a.trigger(E,r),a._module.onCancel({target:e(o,a.wrapper)}),this._checkAllComplete(),a._updateHeaderUploadStatus()):i.hasClass("k-retry")&&(e(".k-warning",o).remove(),a._module.onRetry({target:e(o,a.wrapper)}))),!1},_onUploadSelected:function(){var e=this,t=e.wrapper;return t.hasClass("k-state-disabled")||this._module.onSaveSelected(),!1},_onFileProgress:function(t,n){var i;this.options.template?e(".k-progress",t.target).width(n+"%"):(i=e(".k-upload-pct",t.target),0===i.length&&e(".k-upload-status",t.target).prepend("<span class='k-upload-pct'></span>"),e(".k-upload-pct",t.target).text(n+"%"),e(".k-progress",t.target).width(n+"%")),this.trigger(P,{files:m(t).data("fileNames"),percentComplete:n})},_onUploadSuccess:function(e,t,n){var i=m(e);this._fileState(i,"uploaded"),i.removeClass("k-file-progress").addClass("k-file-success"),this._updateHeaderUploadStatus(),this.trigger(A,{files:i.data("fileNames"),response:t,operation:"upload",XMLHttpRequest:n}),this._supportsRemove()?this._fileAction(i,I):this._clearFileAction(i),this._checkAllComplete()},_onUploadError:function(t,n){var i=m(t),o=e(".k-upload-pct",i);this._fileState(i,"failed"),i.removeClass("k-file-progress").addClass("k-file-error"),e(".k-progress",i).width("100%"),o.length>0?o.empty().removeClass("k-upload-pct").addClass("k-icon k-warning"):e(".k-upload-status",i).prepend("<span class='k-icon k-warning'></span>"),this._updateHeaderUploadStatus(),this._fileAction(i,"retry"),this.trigger(D,{operation:"upload",files:i.data("fileNames"),XMLHttpRequest:n}),x("Server response: "+n.responseText),this._checkAllComplete()},_showUploadButton:function(){var t=e(".k-upload-selected",this.wrapper);0===t.length&&(t=this._renderAction("",this.localization.uploadSelectedFiles).addClass("k-upload-selected")),this.wrapper.append(t)},_hideUploadButton:function(){e(".k-upload-selected",this.wrapper).remove()},_showHeaderUploadStatus:function(){var t=this.localization,n=e(".k-dropzone",this.wrapper),i=e(".k-upload-status-total",this.wrapper);0!==i.length&&i.remove(),i='<strong class="k-upload-status k-upload-status-total">'+t.headerStatusUploading+'<span class="k-icon k-loading">'+t.statusUploading+"</span></strong>",n.length>0?n.append(i):e(".k-upload-button",this.wrapper).after(i)},_updateHeaderUploadStatus:function(){var t,n,i,o=this,r=o.localization,a=e(".k-file",o.wrapper).not(".k-file-success, .k-file-error");0===a.length&&(t=e(".k-file.k-file-error",o.wrapper),n=e(".k-upload-status-total",o.wrapper),i=e(".k-icon",n).removeClass("k-loading").addClass(0!==t.length?"k-warning":"k-i-tick").text(0!==t.length?r.statusWarning:r.statusUploaded),n.text(o.localization.headerStatusUploaded).append(i))},_hideHeaderUploadstatus:function(){e(".k-upload-status-total",this.wrapper).remove()},_onParentFormSubmit:function(){var n,i=this,o=i.element;t!==this._module.onAbort&&this._module.onAbort(),o.value||(n=e(o),n.attr("disabled","disabled"),window.setTimeout(function(){n.removeAttr("disabled")},0))},_onParentFormReset:function(){e(".k-upload-files",this.wrapper).remove()},_supportsFormData:function(){return"undefined"!=typeof FormData},_supportsMultiple:function(){var e=this._userAgent().indexOf("Windows")>-1;return!(y.support.browser.opera||y.support.browser.safari&&e)},_supportsDrop:function(){var e=this._userAgent().toLowerCase(),t=/chrome/.test(e),n=!t&&/safari/.test(e),i=n&&/windows/.test(e);return!i&&this._supportsFormData()&&this.options.async.saveUrl},_userAgent:function(){return navigator.userAgent},_setupDropZone:function(){var t,n,i=this;e(".k-upload-button",this.wrapper).wrap("<div class='k-dropzone'></div>"),t=i._ns,n=e(".k-dropzone",i.wrapper).append(e("<em>"+i.localization.dropFilesHere+"</em>")).on("dragenter"+t,p).on("dragover"+t,function(e){e.preventDefault()}).on("drop"+t,e.proxy(this._onDrop,this)),f(n,t,function(){n.addClass("k-dropzone-hovered")},function(){n.removeClass("k-dropzone-hovered")}),f(e(document),t,function(){n.addClass("k-dropzone-active"),n.closest(".k-upload").removeClass("k-upload-empty")},function(){n.removeClass("k-dropzone-active"),0===e("li.k-file",n.closest(".k-upload")).length&&n.closest(".k-upload").addClass("k-upload-empty")})},_supportsRemove:function(){return!!this.options.async.removeUrl},_submitRemove:function(t,n,i,o){var r=this,a=r.options.async.removeField||"fileNames",s=e.extend(n,b());s[a]=t,jQuery.ajax({type:this.options.async.removeVerb,dataType:"json",dataFilter:h,url:this.options.async.removeUrl,traditional:!0,data:s,success:i,error:o,xhrFields:{withCredentials:this.options.async.withCredentials}})},_wrapInput:function(e){var t=this,n=t.options;return e.wrap("<div class='k-widget k-upload k-header'><div class='k-button k-upload-button'></div></div>"),n.async.saveUrl||e.closest(".k-upload").addClass("k-upload-sync"),e.closest(".k-upload").addClass("k-upload-empty"),e.closest(".k-button").append("<span>"+this.localization.select+"</span>"),e.closest(".k-upload")},_checkAllComplete:function(){0===e(".k-file.k-file-progress",this.wrapper).length&&this.trigger(M)},_inputFiles:function(e){return i(e)}}),B=function(e){this.name="syncUploadModule",this.element=e.wrapper,this.upload=e,this.element.closest("form").attr("enctype","multipart/form-data").attr("encoding","multipart/form-data")};B.prototype={onSelect:function(t,i){var o,r=this.upload,a=e(t.target);r._addInput(a),o=r._enqueueFile(n(a),{relatedInput:a,fileNames:i}),r._fileAction(o,I)},onRemove:function(e){var t=m(e);t.data("relatedInput").remove(),this.upload._removeFileEntry(t)}},v=function(e){this.name="iframeUploadModule",this.element=e.wrapper,this.upload=e,this.iframes=[]},z._frameId=0,v.prototype={onSelect:function(t,n){var i=this.upload,o=e(t.target),r=this.prepareUpload(o,n);i.options.async.autoUpload?this.performUpload(r):(i._supportsRemove()&&this.upload._fileAction(r,I),i._showUploadButton())},prepareUpload:function(t,i){var o,r,a,s=this.upload,l=e(s.element),c=s.options.async.saveField||t.attr("name");return s._addInput(t),t.attr("name",c),o=this.createFrame(s.name+"_"+z._frameId++),this.registerFrame(o),r=this.createForm(s.options.async.saveUrl,o.attr("name")).append(l),a=s._enqueueFile(n(t),{frame:o,relatedInput:l,fileNames:i}),o.data({form:r,file:a}),a},performUpload:function(t){var n,i,o,r={files:t.data("fileNames")},a=t.data("frame"),s=this.upload;if(s.trigger(T,r))s._removeFileEntry(a.data("file")),this.cleanupFrame(a),this.unregisterFrame(a);else{s._hideUploadButton(),s._showHeaderUploadStatus(),a.appendTo(document.body),n=a.data("form").attr("action",s.options.async.saveUrl).appendTo(document.body),r.data=e.extend({},r.data,b());for(i in r.data)o=n.find("input[name='"+i+"']"),0===o.length&&(o=e("<input>",{type:"hidden",name:i}).prependTo(n)),o.val(r.data[i]);s._fileAction(t,E),s._fileState(t,"uploading"),e(t).removeClass("k-file-error").addClass("k-file-progress"),a.one("load",e.proxy(this.onIframeLoad,this)),n[0].submit()}},onSaveSelected:function(){var t=this;e(".k-file",this.element).each(function(){var n=e(this),i=g(n);i||t.performUpload(n)})},onIframeLoad:function(t){var n,i=e(t.target);try{n=i.contents().text()}catch(o){n="Error trying to get server response: "+o}this.processResponse(i,n)},processResponse:function(t,n){var i=t.data("file"),o=this,r={responseText:n};u(n,function(n){e.extend(r,{statusText:"OK",status:"200"}),o.upload._onFileProgress({target:e(i,o.upload.wrapper)},100),o.upload._onUploadSuccess({target:e(i,o.upload.wrapper)},n,r),o.cleanupFrame(t),o.unregisterFrame(t)},function(){e.extend(r,{statusText:"error",status:"500"}),o.upload._onUploadError({target:e(i,o.upload.wrapper)},r)})},onCancel:function(t){var n=e(t.target).data("frame");this.stopFrameSubmit(n),this.cleanupFrame(n),this.unregisterFrame(n),this.upload._removeFileEntry(n.data("file"))},onRetry:function(e){var t=m(e);this.performUpload(t)},onRemove:function(e,t){var n=m(e),i=n.data("frame");i?(this.unregisterFrame(i),this.upload._removeFileEntry(n),this.cleanupFrame(i)):d(n,this.upload,t)},onAbort:function(){var t=this.element,n=this;e.each(this.iframes,function(){e("input",this.data("form")).appendTo(t),n.stopFrameSubmit(this[0]),this.data("form").remove(),this.remove()}),this.iframes=[]},createFrame:function(t){return e("<iframe name='"+t+"' id='"+t+"' style='display:none;' />")},createForm:function(t,n){return e("<form enctype='multipart/form-data' method='POST' action='"+t+"' target='"+n+"'/>")},stopFrameSubmit:function(e){t!==e.stop?e.stop():e.document&&e.document.execCommand("Stop")},registerFrame:function(e){this.iframes.push(e)},unregisterFrame:function(t){this.iframes=e.grep(this.iframes,function(e){return e.attr("name")!=t.attr("name")})},cleanupFrame:function(e){var t=e.data("form");e.data("file").data("frame",null),setTimeout(function(){t.remove(),e.remove()},1)}},_=function(e){this.name="formDataUploadModule",this.element=e.wrapper,this.upload=e},_.prototype={onSelect:function(t,n){var i=this.upload,o=this,r=e(t.target),a=this.prepareUpload(r,n);e.each(a,function(){i.options.async.autoUpload?o.performUpload(this):(i._supportsRemove()&&i._fileAction(this,I),i._showUploadButton())})},prepareUpload:function(t,n){var i=this.enqueueFiles(n);return t.is("input")&&(e.each(i,function(){e(this).data("relatedInput",t)}),t.data("relatedFileEntries",i),this.upload._addInput(t)),i},enqueueFiles:function(t){var n,i,o,r,a=this.upload,s=t.length,l=[];if(a.options.async.batch===!0)n=e.map(t,function(e){return e.name}).join(", "),r=a._enqueueFile(n,{fileNames:t}),r.data("files",t),l.push(r);else for(i=0;s>i;i++)o=t[i],n=o.name,r=a._enqueueFile(n,{fileNames:[o]}),r.data("files",[o]),l.push(r);return l},performUpload:function(t){var n,i=this.upload,o=this.createFormData(),r=this.createXHR(),a={files:t.data("fileNames"),XMLHttpRequest:r};if(i.trigger(T,a))this.removeFileEntry(t);else{if(i._fileAction(t,E),i._hideUploadButton(),i._showHeaderUploadStatus(),a.formData)o=a.formData;else{a.data=e.extend({},a.data,b());for(n in a.data)o.append(n,a.data[n]);this.populateFormData(o,t.data("files"))}i._fileState(t,"uploading"),e(t).removeClass("k-file-error").addClass("k-file-progress"),this.postFormData(i.options.async.saveUrl,o,t,r)}},onSaveSelected:function(){var t=this;e(".k-file",this.element).each(function(){var n=e(this),i=g(n);i||t.performUpload(n)})},onCancel:function(e){var t=m(e);this.stopUploadRequest(t),this.removeFileEntry(t)},onRetry:function(e){var t=m(e);this.performUpload(t)},onRemove:function(e,t){var n=m(e);n.hasClass("k-file-success")?d(n,this.upload,t):this.removeFileEntry(n)},createXHR:function(){return new XMLHttpRequest},postFormData:function(e,t,n,i){var o=this;n.data("request",i),i.addEventListener("load",function(e){o.onRequestSuccess.call(o,e,n)},!1),i.addEventListener(D,function(e){o.onRequestError.call(o,e,n)},!1),i.upload.addEventListener("progress",function(e){o.onRequestProgress.call(o,e,n)},!1),i.open("POST",e,!0),i.withCredentials=this.upload.options.async.withCredentials,i.send(t)},createFormData:function(){return new FormData},populateFormData:function(e,t){var n,i=this.upload,o=t.length;for(n=0;o>n;n++)e.append(i.options.async.saveField||i.name,t[n].rawFile);return e},onRequestSuccess:function(t,n){function i(){r.upload._onUploadError({target:e(n,r.upload.wrapper)},o)}var o=t.target,r=this;o.status>=200&&299>=o.status?u(o.responseText,function(t){r.upload._onFileProgress({target:e(n,r.upload.wrapper)},100),r.upload._onUploadSuccess({target:e(n,r.upload.wrapper)},t,o),r.cleanupFileEntry(n)},i):i()},onRequestError:function(t,n){var i=t.target;this.upload._onUploadError({target:e(n,this.upload.wrapper)},i)},cleanupFileEntry:function(t){var n=t.data("relatedInput"),i=!0;n&&(e.each(n.data("relatedFileEntries")||[],function(){this.parent().length>0&&this[0]!=t[0]&&(i=i&&this.hasClass("k-file-success"))}),i&&n.remove())},removeFileEntry:function(e){this.cleanupFileEntry(e),this.upload._removeFileEntry(e)},onRequestProgress:function(t,n){var i=Math.round(100*t.loaded/t.total);this.upload._onFileProgress({target:e(n,this.upload.wrapper)},i)},stopUploadRequest:function(e){e.data("request").abort()}},y.ui.plugin(z)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});;
/*!
 * modernizr v3.8.0
 * Build https://modernizr.com/download?-arrow-details-notification-objectfit-placeholder-progressbar_meter-svg-template-setclasses-dontmin
 *
 * Copyright (c)
 *  Faruk Ates
 *  Paul Irish
 *  Alex Sexton
 *  Ryan Seddon
 *  Patrick Kettner
 *  Stu Cox
 *  Richard Herrera
 *  Veeck

 * MIT License
 */

/*
 * Modernizr tests which native CSS3 and HTML5 features are available in the
 * current UA and makes the results available to you in two ways: as properties on
 * a global `Modernizr` object, and as classes on the `<html>` element. This
 * information allows you to progressively enhance your pages with a granular level
 * of control over the experience.
*/

;(function(window, document, undefined){

  var tests = [];
  

  /**
   * ModernizrProto is the constructor for Modernizr
   *
   * @class
   * @access public
   */
  var ModernizrProto = {
    // The current version, dummy
    _version: '3.8.0',

    // Any settings that don't work as separate modules
    // can go in here as configuration.
    _config: {
      'classPrefix': '',
      'enableClasses': true,
      'enableJSClass': true,
      'usePrefixes': true
    },

    // Queue of tests
    _q: [],

    // Stub these for people who are listening
    on: function(test, cb) {
      // I don't really think people should do this, but we can
      // safe guard it a bit.
      // -- NOTE:: this gets WAY overridden in src/addTest for actual async tests.
      // This is in case people listen to synchronous tests. I would leave it out,
      // but the code to *disallow* sync tests in the real version of this
      // function is actually larger than this.
      var self = this;
      setTimeout(function() {
        cb(self[test]);
      }, 0);
    },

    addTest: function(name, fn, options) {
      tests.push({name: name, fn: fn, options: options});
    },

    addAsyncTest: function(fn) {
      tests.push({name: null, fn: fn});
    }
  };

  

  // Fake some of Object.create so we can force non test results to be non "own" properties.
  var Modernizr = function() {};
  Modernizr.prototype = ModernizrProto;

  // Leak modernizr globally when you `require` it rather than force it here.
  // Overwrite name so constructor name is nicer :D
  Modernizr = new Modernizr();

  

  var classes = [];
  

  /**
   * is returns a boolean if the typeof an obj is exactly type.
   *
   * @access private
   * @function is
   * @param {*} obj - A thing we want to check the type of
   * @param {string} type - A string to compare the typeof against
   * @returns {boolean} true if the typeof the first parameter is exactly the specified type, false otherwise
   */
  function is(obj, type) {
    return typeof obj === type;
  }

  ;

  /**
   * Run through all tests and detect their support in the current UA.
   *
   * @access private
   * @returns {void}
   */
  function testRunner() {
    var featureNames;
    var feature;
    var aliasIdx;
    var result;
    var nameIdx;
    var featureName;
    var featureNameSplit;

    for (var featureIdx in tests) {
      if (tests.hasOwnProperty(featureIdx)) {
        featureNames = [];
        feature = tests[featureIdx];
        // run the test, throw the return value into the Modernizr,
        // then based on that boolean, define an appropriate className
        // and push it into an array of classes we'll join later.
        //
        // If there is no name, it's an 'async' test that is run,
        // but not directly added to the object. That should
        // be done with a post-run addTest call.
        if (feature.name) {
          featureNames.push(feature.name.toLowerCase());

          if (feature.options && feature.options.aliases && feature.options.aliases.length) {
            // Add all the aliases into the names list
            for (aliasIdx = 0; aliasIdx < feature.options.aliases.length; aliasIdx++) {
              featureNames.push(feature.options.aliases[aliasIdx].toLowerCase());
            }
          }
        }

        // Run the test, or use the raw value if it's not a function
        result = is(feature.fn, 'function') ? feature.fn() : feature.fn;

        // Set each of the names on the Modernizr object
        for (nameIdx = 0; nameIdx < featureNames.length; nameIdx++) {
          featureName = featureNames[nameIdx];
          // Support dot properties as sub tests. We don't do checking to make sure
          // that the implied parent tests have been added. You must call them in
          // order (either in the test, or make the parent test a dependency).
          //
          // Cap it to TWO to make the logic simple and because who needs that kind of subtesting
          // hashtag famous last words
          featureNameSplit = featureName.split('.');

          if (featureNameSplit.length === 1) {
            Modernizr[featureNameSplit[0]] = result;
          } else {
            // cast to a Boolean, if not one already or if it doesnt exist yet (like inputtypes)
            if (!Modernizr[featureNameSplit[0]] || Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {
              Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);
            }

            Modernizr[featureNameSplit[0]][featureNameSplit[1]] = result;
          }

          classes.push((result ? '' : 'no-') + featureNameSplit.join('-'));
        }
      }
    }
  }
  ;

  /**
   * docElement is a convenience wrapper to grab the root element of the document
   *
   * @access private
   * @returns {HTMLElement|SVGElement} The root element of the document
   */
  var docElement = document.documentElement;
  

  /**
   * A convenience helper to check if the document we are running in is an SVG document
   *
   * @access private
   * @returns {boolean}
   */
  var isSVG = docElement.nodeName.toLowerCase() === 'svg';

  

  /**
   * setClasses takes an array of class names and adds them to the root element
   *
   * @access private
   * @function setClasses
   * @param {string[]} classes - Array of class names
   */
  // Pass in an and array of class names, e.g.:
  //  ['no-webp', 'borderradius', ...]
  function setClasses(classes) {
    var className = docElement.className;
    var classPrefix = Modernizr._config.classPrefix || '';

    if (isSVG) {
      className = className.baseVal;
    }

    // Change `no-js` to `js` (independently of the `enableClasses` option)
    // Handle classPrefix on this too
    if (Modernizr._config.enableJSClass) {
      var reJS = new RegExp('(^|\\s)' + classPrefix + 'no-js(\\s|$)');
      className = className.replace(reJS, '$1' + classPrefix + 'js$2');
    }

    if (Modernizr._config.enableClasses) {
      // Add the new classes
      if (classes.length > 0) {
        className += ' ' + classPrefix + classes.join(' ' + classPrefix);
      }
      if (isSVG) {
        docElement.className.baseVal = className;
      } else {
        docElement.className = className;
      }
    }
  }

  ;
/*!
{
  "name": "ES6 Arrow Functions",
  "property": "arrow",
  "authors": ["Vincent Riemer"],
  "tags": ["es6"]
}
!*/
/* DOC
Check if browser implements ECMAScript 6 Arrow Functions per specification.
*/

  Modernizr.addTest('arrow', function() {
    try {
      // eslint-disable-next-line
      eval('()=>{}');
    } catch (e) {
      return false;
    }
    return true;
  });


  /**
   * createElement is a convenience wrapper around document.createElement. Since we
   * use createElement all over the place, this allows for (slightly) smaller code
   * as well as abstracting away issues with creating elements in contexts other than
   * HTML documents (e.g. SVG documents).
   *
   * @access private
   * @function createElement
   * @returns {HTMLElement|SVGElement} An HTML or SVG element
   */
  function createElement() {
    if (typeof document.createElement !== 'function') {
      // This is the case in IE7, where the type of createElement is "object".
      // For this reason, we cannot call apply() as Object is not a Function.
      return document.createElement(arguments[0]);
    } else if (isSVG) {
      return document.createElementNS.call(document, 'http://www.w3.org/2000/svg', arguments[0]);
    } else {
      return document.createElement.apply(document, arguments);
    }
  }

  ;
/*!
{
  "name": "progress Element",
  "caniuse": "progress",
  "property": ["progressbar", "meter"],
  "tags": ["elem"],
  "builderAliases": ["elem_progress_meter"],
  "authors": ["Stefan Wallin"]
}
!*/

  // Tests for progressbar-support. All browsers that don't support progressbar returns undefined =)
  Modernizr.addTest('progressbar', createElement('progress').max !== undefined);

  // Tests for meter-support. All browsers that don't support meters returns undefined =)
  Modernizr.addTest('meter', createElement('meter').max !== undefined);


  /**
   * getBody returns the body of a document, or an element that can stand in for
   * the body if a real body does not exist
   *
   * @access private
   * @function getBody
   * @returns {HTMLElement|SVGElement} Returns the real body of a document, or an
   * artificially created element that stands in for the body
   */
  function getBody() {
    // After page load injecting a fake body doesn't work so check if body exists
    var body = document.body;

    if (!body) {
      // Can't use the real body create a fake one.
      body = createElement(isSVG ? 'svg' : 'body');
      body.fake = true;
    }

    return body;
  }

  ;

  /**
   * injectElementWithStyles injects an element with style element and some CSS rules
   *
   * @access private
   * @function injectElementWithStyles
   * @param {string} rule - String representing a css rule
   * @param {Function} callback - A function that is used to test the injected element
   * @param {number} [nodes] - An integer representing the number of additional nodes you want injected
   * @param {string[]} [testnames] - An array of strings that are used as ids for the additional nodes
   * @returns {boolean} the result of the specified callback test
   */
  function injectElementWithStyles(rule, callback, nodes, testnames) {
    var mod = 'modernizr';
    var style;
    var ret;
    var node;
    var docOverflow;
    var div = createElement('div');
    var body = getBody();

    if (parseInt(nodes, 10)) {
      // In order not to give false positives we create a node for each test
      // This also allows the method to scale for unspecified uses
      while (nodes--) {
        node = createElement('div');
        node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
        div.appendChild(node);
      }
    }

    style = createElement('style');
    style.type = 'text/css';
    style.id = 's' + mod;

    // IE6 will false positive on some tests due to the style element inside the test div somehow interfering offsetHeight, so insert it into body or fakebody.
    // Opera will act all quirky when injecting elements in documentElement when page is served as xml, needs fakebody too. #270
    (!body.fake ? div : body).appendChild(style);
    body.appendChild(div);

    if (style.styleSheet) {
      style.styleSheet.cssText = rule;
    } else {
      style.appendChild(document.createTextNode(rule));
    }
    div.id = mod;

    if (body.fake) {
      //avoid crashing IE8, if background image is used
      body.style.background = '';
      //Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible
      body.style.overflow = 'hidden';
      docOverflow = docElement.style.overflow;
      docElement.style.overflow = 'hidden';
      docElement.appendChild(body);
    }

    ret = callback(div, rule);
    // If this is done after page load we don't want to remove the body so check if body exists
    if (body.fake) {
      body.parentNode.removeChild(body);
      docElement.style.overflow = docOverflow;
      // Trigger layout so kinetic scrolling isn't disabled in iOS6+
      // eslint-disable-next-line
      docElement.offsetHeight;
    } else {
      div.parentNode.removeChild(div);
    }

    return !!ret;
  }

  ;

  /**
   * testStyles injects an element with style element and some CSS rules
   *
   * @memberOf Modernizr
   * @name Modernizr.testStyles
   * @optionName Modernizr.testStyles()
   * @optionProp testStyles
   * @access public
   * @function testStyles
   * @param {string} rule - String representing a css rule
   * @param {function} callback - A function that is used to test the injected element
   * @param {number} [nodes] - An integer representing the number of additional nodes you want injected
   * @param {string[]} [testnames] - An array of strings that are used as ids for the additional nodes
   * @returns {boolean}
   * @example
   *
   * `Modernizr.testStyles` takes a CSS rule and injects it onto the current page
   * along with (possibly multiple) DOM elements. This lets you check for features
   * that can not be detected by simply checking the [IDL](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Interface_development_guide/IDL_interface_rules).
   *
   * ```js
   * Modernizr.testStyles('#modernizr { width: 9px; color: papayawhip; }', function(elem, rule) {
   *   // elem is the first DOM node in the page (by default #modernizr)
   *   // rule is the first argument you supplied - the CSS rule in string form
   *
   *   addTest('widthworks', elem.style.width === '9px')
   * });
   * ```
   *
   * If your test requires multiple nodes, you can include a third argument
   * indicating how many additional div elements to include on the page. The
   * additional nodes are injected as children of the `elem` that is returned as
   * the first argument to the callback.
   *
   * ```js
   * Modernizr.testStyles('#modernizr {width: 1px}; #modernizr2 {width: 2px}', function(elem) {
   *   document.getElementById('modernizr').style.width === '1px'; // true
   *   document.getElementById('modernizr2').style.width === '2px'; // true
   *   elem.firstChild === document.getElementById('modernizr2'); // true
   * }, 1);
   * ```
   *
   * By default, all of the additional elements have an ID of `modernizr[n]`, where
   * `n` is its index (e.g. the first additional, second overall is `#modernizr2`,
   * the second additional is `#modernizr3`, etc.).
   * If you want to have more meaningful IDs for your function, you can provide
   * them as the fourth argument, as an array of strings
   *
   * ```js
   * Modernizr.testStyles('#foo {width: 10px}; #bar {height: 20px}', function(elem) {
   *   elem.firstChild === document.getElementById('foo'); // true
   *   elem.lastChild === document.getElementById('bar'); // true
   * }, 2, ['foo', 'bar']);
   * ```
   */
  var testStyles = ModernizrProto.testStyles = injectElementWithStyles;
  
/*!
{
  "name": "details Element",
  "caniuse": "details",
  "property": "details",
  "tags": ["elem"],
  "builderAliases": ["elem_details"],
  "authors": ["@mathias"],
  "notes": [{
    "name": "Mathias' Original",
    "href": "https://mathiasbynens.be/notes/html5-details-jquery#comment-35"
  }]
}
!*/

  Modernizr.addTest('details', function() {
    var el = createElement('details');
    var diff;

    // return early if possible; thanks @aFarkas!
    if (!('open' in el)) {
      return false;
    }

    testStyles('#modernizr details{display:block}', function(node) {
      node.appendChild(el);
      el.innerHTML = '<summary>a</summary>b';
      diff = el.offsetHeight;
      el.open = true;
      diff = diff !== el.offsetHeight;
    });

    return diff;
  });

/*!
{
  "name": "SVG",
  "property": "svg",
  "caniuse": "svg",
  "tags": ["svg"],
  "authors": ["Erik Dahlstrom"],
  "polyfills": [
    "svgweb",
    "raphael",
    "amplesdk",
    "canvg",
    "svg-boilerplate",
    "sie",
    "dojogfx",
    "fabricjs"
  ]
}
!*/
/* DOC
Detects support for SVG in `<embed>` or `<object>` elements.
*/

  Modernizr.addTest('svg', !!document.createElementNS && !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect);

/*!
{
  "name": "Template Tag",
  "property": "template",
  "tags": ["elem"],
  "notes": [{
    "name": "HTML5Rocks Article",
    "href": "https://www.html5rocks.com/en/tutorials/webcomponents/template/"
  },{
    "name": "W3C Spec",
    "href": "https://web.archive.org/web/20171130222649/http://www.w3.org/TR/html5/scripting-1.html"
  }]
}
!*/

  Modernizr.addTest('template', 'content' in createElement('template'));

/*!
{
  "name": "placeholder attribute",
  "property": "placeholder",
  "tags": ["forms", "attribute"],
  "builderAliases": ["forms_placeholder"]
}
!*/
/* DOC
Tests for placeholder attribute in inputs and textareas
*/

  Modernizr.addTest('placeholder', ('placeholder' in createElement('input') && 'placeholder' in createElement('textarea')));

/*!
{
  "name": "Notification",
  "property": "notification",
  "caniuse": "notifications",
  "authors": ["Theodoor van Donge", "Hendrik Beskow"],
  "notes": [{
    "name": "HTML5 Rocks Tutorial",
    "href": "https://www.html5rocks.com/en/tutorials/notifications/quick/"
  },{
    "name": "W3C Spec",
    "href": "https://www.w3.org/TR/notifications/"
  }, {
    "name": "Changes in Chrome to Notifications API due to Service Worker Push Notifications",
    "href": "https://developers.google.com/web/updates/2015/05/Notifying-you-of-notificiation-changes"
  }],
  "knownBugs": ["Possibility of false-positive on Chrome for Android if permissions we're granted for a website prior to Chrome 44."],
  "polyfills": ["desktop-notify", "html5-notifications"]
}
!*/
/* DOC
Detects support for the Notifications API
*/

  Modernizr.addTest('notification', function() {
    if (!window.Notification || !window.Notification.requestPermission) {
      return false;
    }
    // if permission is already granted, assume support
    if (window.Notification.permission === 'granted') {
      return true;
    }

    try {
      new window.Notification('');
    } catch (e) {
      if (e.name === 'TypeError') {
        return false;
      }
    }

    return true;
  });


  /**
   * If the browsers follow the spec, then they would expose vendor-specific styles as:
   *   elem.style.WebkitBorderRadius
   * instead of something like the following (which is technically incorrect):
   *   elem.style.webkitBorderRadius

   * WebKit ghosts their properties in lowercase but Opera & Moz do not.
   * Microsoft uses a lowercase `ms` instead of the correct `Ms` in IE8+
   *   erik.eae.net/archives/2008/03/10/21.48.10/

   * More here: github.com/Modernizr/Modernizr/issues/issue/21
   *
   * @access private
   * @returns {string} The string representing the vendor-specific style properties
   */
  var omPrefixes = 'Moz O ms Webkit';
  

  var cssomPrefixes = (ModernizrProto._config.usePrefixes ? omPrefixes.split(' ') : []);
  ModernizrProto._cssomPrefixes = cssomPrefixes;
  

  /**
   * contains checks to see if a string contains another string
   *
   * @access private
   * @function contains
   * @param {string} str - The string we want to check for substrings
   * @param {string} substr - The substring we want to search the first string for
   * @returns {boolean} true if and only if the first string 'str' contains the second string 'substr'
   */
  function contains(str, substr) {
    return !!~('' + str).indexOf(substr);
  }

  ;

  /**
   * Create our "modernizr" element that we do most feature tests on.
   *
   * @access private
   */
  var modElem = {
    elem: createElement('modernizr')
  };

  // Clean up this element
  Modernizr._q.push(function() {
    delete modElem.elem;
  });

  

  var mStyle = {
    style: modElem.elem.style
  };

  // kill ref for gc, must happen before mod.elem is removed, so we unshift on to
  // the front of the queue.
  Modernizr._q.unshift(function() {
    delete mStyle.style;
  });

  

  /**
   * domToCSS takes a camelCase string and converts it to kebab-case
   * e.g. boxSizing -> box-sizing
   *
   * @access private
   * @function domToCSS
   * @param {string} name - String name of camelCase prop we want to convert
   * @returns {string} The kebab-case version of the supplied name
   */
  function domToCSS(name) {
    return name.replace(/([A-Z])/g, function(str, m1) {
      return '-' + m1.toLowerCase();
    }).replace(/^ms-/, '-ms-');
  }

  ;


  /**
   * wrapper around getComputedStyle, to fix issues with Firefox returning null when
   * called inside of a hidden iframe
   *
   * @access private
   * @function computedStyle
   * @param {HTMLElement|SVGElement} elem - The element we want to find the computed styles of
   * @param {string|null} [pseudo] - An optional pseudo element selector (e.g. :before), of null if none
   * @param {string} prop - A CSS property
   * @returns {CSSStyleDeclaration} the value of the specified CSS property
   */
  function computedStyle(elem, pseudo, prop) {
    var result;

    if ('getComputedStyle' in window) {
      result = getComputedStyle.call(window, elem, pseudo);
      var console = window.console;

      if (result !== null) {
        if (prop) {
          result = result.getPropertyValue(prop);
        }
      } else {
        if (console) {
          var method = console.error ? 'error' : 'log';
          console[method].call(console, 'getComputedStyle returning null, its possible modernizr test results are inaccurate');
        }
      }
    } else {
      result = !pseudo && elem.currentStyle && elem.currentStyle[prop];
    }

    return result;
  }

  ;

  /**
   * nativeTestProps allows for us to use native feature detection functionality if available.
   * some prefixed form, or false, in the case of an unsupported rule
   *
   * @access private
   * @function nativeTestProps
   * @param {array} props - An array of property names
   * @param {string} value - A string representing the value we want to check via @supports
   * @returns {boolean|undefined} A boolean when @supports exists, undefined otherwise
   */
  // Accepts a list of property names and a single value
  // Returns `undefined` if native detection not available
  function nativeTestProps(props, value) {
    var i = props.length;
    // Start with the JS API: https://www.w3.org/TR/css3-conditional/#the-css-interface
    if ('CSS' in window && 'supports' in window.CSS) {
      // Try every prefixed variant of the property
      while (i--) {
        if (window.CSS.supports(domToCSS(props[i]), value)) {
          return true;
        }
      }
      return false;
    }
    // Otherwise fall back to at-rule (for Opera 12.x)
    else if ('CSSSupportsRule' in window) {
      // Build a condition string for every prefixed variant
      var conditionText = [];
      while (i--) {
        conditionText.push('(' + domToCSS(props[i]) + ':' + value + ')');
      }
      conditionText = conditionText.join(' or ');
      return injectElementWithStyles('@supports (' + conditionText + ') { #modernizr { position: absolute; } }', function(node) {
        return computedStyle(node, null, 'position') === 'absolute';
      });
    }
    return undefined;
  }
  ;

  /**
   * cssToDOM takes a kebab-case string and converts it to camelCase
   * e.g. box-sizing -> boxSizing
   *
   * @access private
   * @function cssToDOM
   * @param {string} name - String name of kebab-case prop we want to convert
   * @returns {string} The camelCase version of the supplied name
   */
  function cssToDOM(name) {
    return name.replace(/([a-z])-([a-z])/g, function(str, m1, m2) {
      return m1 + m2.toUpperCase();
    }).replace(/^-/, '');
  }

  ;

  // testProps is a generic CSS / DOM property test.

  // In testing support for a given CSS property, it's legit to test:
  //    `elem.style[styleName] !== undefined`
  // If the property is supported it will return an empty string,
  // if unsupported it will return undefined.

  // We'll take advantage of this quick test and skip setting a style
  // on our modernizr element, but instead just testing undefined vs
  // empty string.

  // Property names can be provided in either camelCase or kebab-case.

  function testProps(props, prefixed, value, skipValueTest) {
    skipValueTest = is(skipValueTest, 'undefined') ? false : skipValueTest;

    // Try native detect first
    if (!is(value, 'undefined')) {
      var result = nativeTestProps(props, value);
      if (!is(result, 'undefined')) {
        return result;
      }
    }

    // Otherwise do it properly
    var afterInit, i, propsLength, prop, before;

    // If we don't have a style element, that means we're running async or after
    // the core tests, so we'll need to create our own elements to use.

    // Inside of an SVG element, in certain browsers, the `style` element is only
    // defined for valid tags. Therefore, if `modernizr` does not have one, we
    // fall back to a less used element and hope for the best.
    // For strict XHTML browsers the hardly used samp element is used.
    var elems = ['modernizr', 'tspan', 'samp'];
    while (!mStyle.style && elems.length) {
      afterInit = true;
      mStyle.modElem = createElement(elems.shift());
      mStyle.style = mStyle.modElem.style;
    }

    // Delete the objects if we created them.
    function cleanElems() {
      if (afterInit) {
        delete mStyle.style;
        delete mStyle.modElem;
      }
    }

    propsLength = props.length;
    for (i = 0; i < propsLength; i++) {
      prop = props[i];
      before = mStyle.style[prop];

      if (contains(prop, '-')) {
        prop = cssToDOM(prop);
      }

      if (mStyle.style[prop] !== undefined) {

        // If value to test has been passed in, do a set-and-check test.
        // 0 (integer) is a valid property value, so check that `value` isn't
        // undefined, rather than just checking it's truthy.
        if (!skipValueTest && !is(value, 'undefined')) {

          // Needs a try catch block because of old IE. This is slow, but will
          // be avoided in most cases because `skipValueTest` will be used.
          try {
            mStyle.style[prop] = value;
          } catch (e) {}

          // If the property value has changed, we assume the value used is
          // supported. If `value` is empty string, it'll fail here (because
          // it hasn't changed), which matches how browsers have implemented
          // CSS.supports()
          if (mStyle.style[prop] !== before) {
            cleanElems();
            return prefixed === 'pfx' ? prop : true;
          }
        }
        // Otherwise just return true, or the property name if this is a
        // `prefixed()` call
        else {
          cleanElems();
          return prefixed === 'pfx' ? prop : true;
        }
      }
    }
    cleanElems();
    return false;
  }

  ;

  /**
   * List of JavaScript DOM values used for tests
   *
   * @memberOf Modernizr
   * @name Modernizr._domPrefixes
   * @optionName Modernizr._domPrefixes
   * @optionProp domPrefixes
   * @access public
   * @example
   *
   * Modernizr._domPrefixes is exactly the same as [_prefixes](#modernizr-_prefixes), but rather
   * than kebab-case properties, all properties are their Capitalized variant
   *
   * ```js
   * Modernizr._domPrefixes === [ "Moz", "O", "ms", "Webkit" ];
   * ```
   */
  var domPrefixes = (ModernizrProto._config.usePrefixes ? omPrefixes.toLowerCase().split(' ') : []);
  ModernizrProto._domPrefixes = domPrefixes;
  

  /**
   * fnBind is a super small [bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) polyfill.
   *
   * @access private
   * @function fnBind
   * @param {Function} fn - a function you want to change `this` reference to
   * @param {Object} that - the `this` you want to call the function with
   * @returns {Function} The wrapped version of the supplied function
   */
  function fnBind(fn, that) {
    return function() {
      return fn.apply(that, arguments);
    };
  }

  ;

  /**
   * testDOMProps is a generic DOM property test; if a browser supports
   *   a certain property, it won't return undefined for it.
   *
   * @access private
   * @function testDOMProps
   * @param {Array<string>} props - An array of properties to test for
   * @param {Object} obj - An object or Element you want to use to test the parameters again
   * @param {boolean|Object} elem - An Element to bind the property lookup again. Use `false` to prevent the check
   * @returns {false|*} returns false if the prop is unsupported, otherwise the value that is supported
   */
  function testDOMProps(props, obj, elem) {
    var item;

    for (var i in props) {
      if (props[i] in obj) {

        // return the property name as a string
        if (elem === false) {
          return props[i];
        }

        item = obj[props[i]];

        // let's bind a function
        if (is(item, 'function')) {
          // bind to obj unless overridden
          return fnBind(item, elem || obj);
        }

        // return the unbound function or obj or value
        return item;
      }
    }
    return false;
  }

  ;

  /**
   * testPropsAll tests a list of DOM properties we want to check against.
   * We specify literally ALL possible (known and/or likely) properties on
   * the element including the non-vendor prefixed one, for forward-
   * compatibility.
   *
   * @access private
   * @function testPropsAll
   * @param {string} prop - A string of the property to test for
   * @param {string|Object} [prefixed] - An object to check the prefixed properties on. Use a string to skip
   * @param {HTMLElement|SVGElement} [elem] - An element used to test the property and value against
   * @param {string} [value] - A string of a css value
   * @param {boolean} [skipValueTest] - An boolean representing if you want to test if value sticks when set
   * @returns {false|string} returns the string version of the property, or false if it is unsupported
   */
  function testPropsAll(prop, prefixed, elem, value, skipValueTest) {

    var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1),
      props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');

    // did they call .prefixed('boxSizing') or are we just testing a prop?
    if (is(prefixed, 'string') || is(prefixed, 'undefined')) {
      return testProps(props, prefixed, value, skipValueTest);

      // otherwise, they called .prefixed('requestAnimationFrame', window[, elem])
    } else {
      props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
      return testDOMProps(props, prefixed, elem);
    }
  }

  // Modernizr.testAllProps() investigates whether a given style property,
  // or any of its vendor-prefixed variants, is recognized
  //
  // Note that the property names must be provided in the camelCase variant.
  // Modernizr.testAllProps('boxSizing')
  ModernizrProto.testAllProps = testPropsAll;

  

  /**
   * atRule returns a given CSS property at-rule (eg @keyframes), possibly in
   * some prefixed form, or false, in the case of an unsupported rule
   *
   * @memberOf Modernizr
   * @name Modernizr.atRule
   * @optionName Modernizr.atRule()
   * @optionProp atRule
   * @access public
   * @function atRule
   * @param {string} prop - String name of the @-rule to test for
   * @returns {string|boolean} The string representing the (possibly prefixed)
   * valid version of the @-rule, or `false` when it is unsupported.
   * @example
   * ```js
   *  var keyframes = Modernizr.atRule('@keyframes');
   *
   *  if (keyframes) {
   *    // keyframes are supported
   *    // could be `@-webkit-keyframes` or `@keyframes`
   *  } else {
   *    // keyframes === `false`
   *  }
   * ```
   */
  var atRule = function(prop) {
    var length = prefixes.length;
    var cssrule = window.CSSRule;
    var rule;

    if (typeof cssrule === 'undefined') {
      return undefined;
    }

    if (!prop) {
      return false;
    }

    // remove literal @ from beginning of provided property
    prop = prop.replace(/^@/, '');

    // CSSRules use underscores instead of dashes
    rule = prop.replace(/-/g, '_').toUpperCase() + '_RULE';

    if (rule in cssrule) {
      return '@' + prop;
    }

    for (var i = 0; i < length; i++) {
      // prefixes gives us something like -o-, and we want O_
      var prefix = prefixes[i];
      var thisRule = prefix.toUpperCase() + '_' + rule;

      if (thisRule in cssrule) {
        return '@-' + prefix.toLowerCase() + '-' + prop;
      }
    }

    return false;
  };

  ModernizrProto.atRule = atRule;

  

  /**
   * prefixed returns the prefixed or nonprefixed property name variant of your input
   *
   * @memberOf Modernizr
   * @name Modernizr.prefixed
   * @optionName Modernizr.prefixed()
   * @optionProp prefixed
   * @access public
   * @function prefixed
   * @param {string} prop - String name of the property to test for
   * @param {Object} [obj] - An object to test for the prefixed properties on
   * @param {HTMLElement} [elem] - An element used to test specific properties against
   * @returns {string|false} The string representing the (possibly prefixed) valid
   * version of the property, or `false` when it is unsupported.
   * @example
   *
   * Modernizr.prefixed takes a string css value in the DOM style camelCase (as
   * opposed to the css style kebab-case) form and returns the (possibly prefixed)
   * version of that property that the browser actually supports.
   *
   * For example, in older Firefox...
   * ```js
   * prefixed('boxSizing')
   * ```
   * returns 'MozBoxSizing'
   *
   * In newer Firefox, as well as any other browser that support the unprefixed
   * version would simply return `boxSizing`. Any browser that does not support
   * the property at all, it will return `false`.
   *
   * By default, prefixed is checked against a DOM element. If you want to check
   * for a property on another object, just pass it as a second argument
   *
   * ```js
   * var rAF = prefixed('requestAnimationFrame', window);
   *
   * raf(function() {
   *  renderFunction();
   * })
   * ```
   *
   * Note that this will return _the actual function_ - not the name of the function.
   * If you need the actual name of the property, pass in `false` as a third argument
   *
   * ```js
   * var rAFProp = prefixed('requestAnimationFrame', window, false);
   *
   * rafProp === 'WebkitRequestAnimationFrame' // in older webkit
   * ```
   *
   * One common use case for prefixed is if you're trying to determine which transition
   * end event to bind to, you might do something like...
   * ```js
   * var transEndEventNames = {
   *     'WebkitTransition' : 'webkitTransitionEnd', * Saf 6, Android Browser
   *     'MozTransition'    : 'transitionend',       * only for FF < 15
   *     'transition'       : 'transitionend'        * IE10, Opera, Chrome, FF 15+, Saf 7+
   * };
   *
   * var transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ];
   * ```
   *
   * If you want a similar lookup, but in kebab-case, you can use [prefixedCSS](#modernizr-prefixedcss).
   */
  var prefixed = ModernizrProto.prefixed = function(prop, obj, elem) {
    if (prop.indexOf('@') === 0) {
      return atRule(prop);
    }

    if (prop.indexOf('-') !== -1) {
      // Convert kebab-case to camelCase
      prop = cssToDOM(prop);
    }
    if (!obj) {
      return testPropsAll(prop, 'pfx');
    } else {
      // Testing DOM property e.g. Modernizr.prefixed('requestAnimationFrame', window) // 'mozRequestAnimationFrame'
      return testPropsAll(prop, obj, elem);
    }
  };

  
/*!
{
  "name": "CSS Object Fit",
  "caniuse": "object-fit",
  "property": "objectfit",
  "tags": ["css"],
  "builderAliases": ["css_objectfit"],
  "notes": [{
    "name": "Opera Article on Object Fit",
    "href": "https://dev.opera.com/articles/css3-object-fit-object-position/"
  }]
}
!*/

  Modernizr.addTest('objectfit', !!prefixed('objectFit'), {aliases: ['object-fit']});


  // Run each test
  testRunner();

  // Remove the "no-js" class if it exists
  setClasses(classes);

  delete ModernizrProto.addTest;
  delete ModernizrProto.addAsyncTest;

  // Run the things that are supposed to run after the tests
  for (var i = 0; i < Modernizr._q.length; i++) {
    Modernizr._q[i]();
  }

  // Leak Modernizr namespace
  window.Modernizr = Modernizr;


;

})(window, document);
;
(function (must) {
    //#region Base MUST params
    must.ie6 = $('html').hasClass('ie6');
    must.ie8 = $('html').hasClass('ie8');
    must.maxPhoneWidth = 480; // default max width for specific visual object on smartphone
    must.minTabletWidth = 700; // default minimum width for specific visual object on tablet
    must.maxTabletWidth = 1024; // default maximum width for specific visual object on tablet
    must.wMobilBreakpoint = 768; // value to switch in mobil mode
    must.wBreakpoint = 980;
    must.rumActivated = {
        global: false, // default value to track real user timing
        googleAnalytics: false // default value to track real user timing
    };
    must.impactSettings = {
        active: false, // enable cedexis impact monitoring
        logging: false,
        customerId: undefined,
        cookieDomain: undefined, // current cookie domain for cedexis impact
        category: undefined, // cedexis impact category for current page
        conversion: undefined // cedexis conversion value for current page, example: 'Booking Submitted'
    };
    //#endregion Base MUST params

    /* Akamai & local cache issue: increment number :) */
    must.sheldonTeam = 'Bazinga!!';

    // @BUGFIX RQM 23688 1/3 blur of last item of a dropdown had a side effect because it .trigger()-ed a click. Both events now call toggleDropdown()
    function toggleDropdown(e) {
        // $(this) is a link or input, not div.jq-dropdown
        var $dd = $(e.target).closest('.jq-dropdown');
        // (RQM 33126) In Notification Messages (page 14.02), last link of Alarm clock dropdown opens a Kendo calendar.
        // If this calendar is displayed and clicked, last link of dropdown lost focus (event blur)
        // Calendar shouldn't be destroyed+removed when clicked
        var isBlurredCalendarToggle = (e.type == 'focusout') && $(e.target).hasClass('k-calendar-toggle');
        //var isBlurredCalendarToggle = (e.type == 'blur') && $(e.target).hasClass('k-calendar-toggle');
        // console.log("-------------------------");
        // console.log("function = toggleDropdown");
        // console.log("class of clicked element: "+$(e.target).attr("class"));
        // console.info("isBlurredCalendarToggle = "+isBlurredCalendarToggle);
		/*	No toggle if it's disabled and not yet opened
			jq-dd-disabled	|	jq-dd-activated	|	result
			-----------------------------------------------
			false		|	false			|	true	(it's enabled)
			false		|	true			|	true	(it's enabled)
			true		|	false			|	false	(do NOT open)
			true		|	true			|	true	(we close it anyway)	*/
        // For the toggle to happen, it should *not* be the calendar toggle that loses focus
        if (!($dd.hasClass('jq-dd-disabled') && !$dd.hasClass('jq-dd-activated')) && !isBlurredCalendarToggle) {
            $dd.find('.jq-dd-list-container ul').stop(true, true).slideToggle(200, function () {
                $dd.toggleClass('jq-dd-activated').removeCalendar();
                $(e.target).closest('.dashboard').toggleClass('jq-dd-activated');
            });
        }
        return false;
    }

    $.validator.addMethod("maxbytelength", function (value, element, params) {
        var s = value.length;
        for (var i = value.length - 1; i >= 0; i--) {
            var code = value.charCodeAt(i);
            if (code > 0x7f && code <= 0x7ff) s++;
            else if (code > 0x7ff && code <= 0xffff) s += 2;
            if (code >= 0xDC00 && code <= 0xDFFF) i--; //trail surrogate
        }

        return s <= params;
    });

    $.validator.unobtrusive.adapters.add("maxbytelength", ["maxlength"], function (options) {
        options.rules['maxbytelength'] = options.params.maxlength;
        if (options.message) {
            options.messages['maxbytelength'] = options.message;
        }
    });

    var MUSTobjectFitPolyfill = function (targetElement) {
        // Applies a background to the container of all images styled with object-fit
        //!Modernizr.objectfit
       
       
            targetElement.each(function () {
                var img = $(this);
                img.css('background', 'url("' + img.prop('src') + '") no-repeat 50%/ cover');
                img.prop('src', 'data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'' + img.width() + '\' height=\'' + img.height() + '\'%3E%3C/svg%3E');
            });

    };

    $(document).ready(function () {
        if (!Modernizr.objectfit) {
            MUSTobjectFitPolyfill($('img.js-objectfit'))
        }
        //#region Time tracker - Ready
        must.tracktime.addEvent('Global Figures', 'Document Ready');
        //#endregion

        //#region Managing skip links at the beginning of HTML code (accessibility related)
        var $skipLinks = $('#skip-links .visually-hidden');
        $skipLinks.on('focus', function () {
            $(this).addClass('display');
        }).on('blur', function () {
            $(this).removeClass('display');
        });
        //#endregion

        //#region Header
        $('.list-selector').hide();
        $('.list-selector .icon').hide();

        $('#lang .current a').click(function () {
            $('#lang li').toggle();
            $('#lang li.current').show();
            $('#lang ul').toggleClass('lang-open');
        });
        //#endregion

        //#region Set default checked option
        $('.search-selector input:checked').prev().show();
        $('.search-selector input:checked').parent().addClass('selected');
        //#endregion

        //#region Quick search element
        var headerTimeout;
        $('#header-search-input').on('blur', function () {
            headerTimeout = setTimeout(function () {
                $('.list-selector').slideUp('fast', function () {
                    $('.search-selector').hide();
                });
            }, 250);
        });

        $('#header-search-input').on('focus', function () {
            $('.search-selector').show(10, function () {
                $('.list-selector').slideDown('fast');
            });
        });

        $('.list-selector').on('click', function () {
            $('#header-search-input').trigger('focus');
            clearTimeout(headerTimeout);
            $('.search-selector input').prev().hide();
            $('.search-selector input').parent().removeClass('selected');
            $('.search-selector input:checked').prev().show();
            $('.search-selector input:checked').parent().addClass('selected');
        });
        //#endregion

        //#region Menu
        $('.jq-nav-sub-open').on('click', function () {
            if (window.innerWidth > 767) {
                if ($(this).hasClass('jq-nav-sub-open')) {
                    //reset of other menu open
                    $('.jq-nav-to-close').stop(true, true).hide();
                    $('.jq-nav-sub-close').addClass('jq-nav-sub-open').removeClass('jq-nav-sub-close');

                    $(this).siblings('div').first('.jq-nav-to-open').stop(true, true).addClass('jq-nav-to-close').slideDown('fast').removeClass('jq-nav-to-open');
                    $(this).addClass('jq-nav-sub-close').removeClass('jq-nav-sub-open');
                }
                else {
                    $(this).siblings('div').first('.jq-nav-to-close').stop(true, true).hide().removeClass('jq-nav-to-close').addClass('jq-nav-to-open');
                    $(this).addClass('jq-nav-sub-open').removeClass('jq-nav-sub-close');
                }
            }

            return false;
        });

        $('.jq-nav-sub-close').on('click', function () {
            if (window.innerWidth > 767) {
                if ($(this).hasClass('jq-nav-sub-open')) {
                    $(this).siblings('div').nextAll().first('.jq-nav-to-open').stop(true, true).slideDown('fast').removeClass('jq-nav-to-open').addClass('jq-nav-to-close');
                    $(this).addClass('jq-nav-sub-close').removeClass('jq-nav-sub-open');
                }
                else {
                    $(this).siblings('div').nextAll().first('.jq-nav-to-close').stop(true, true).slideUp('fast').removeClass('jq-nav-to-close').addClass('jq-nav-to-open');
                    $(this).addClass('jq-nav-sub-open').removeClass('jq-nav-sub-close');
                }
            }

            return false;
        });

        $('.nav-open').click(function () {
            if (window.innerWidth > 767) { return; }
            $('#small-main-nav li').show().css('borderTopWidth', '1px');

            $('.return-menu').each(function () { $(this).children('i.return-icon').remove(); });
            $('.return-menu').each(function () { $(this).children('div.clear').remove(); });

            $('#small-main-nav li a').show().removeClass('return-menu');
            $('#small-main-nav ul').hide();
            $('#small-main-nav li a:not(#icon-home) i').each(function () {
                if ($(this).hasClass('gray4') || $(this).hasClass('gray7')) { }
                else { $(this).addClass('gray7').addClass('small').css('fontSize', '18px'); }
            });
        });

        // small menu
        $('#small-main-nav a').on('click', function () {
            if (window.innerWidth > 767) { return; }

            if ($(this).hasClass('return-menu')) {
                $(this).siblings('div').children('ul').hide('fast');
                $(this).siblings('ul').hide('fast');

                $(this).parent('li').siblings('li').show('fast');
                $(this).parent('li').parent('ul').siblings('ul').show('fast');

                $(this).parent('li').parent('ul').parent('li').show('fast');
                $(this).parent('li').parent('ul').parent('div').parent('li').children('a').show('fast');

                $(this).parent('li').parent('ul').removeClass('hidden-menu');
                $(this).parent('li').removeClass('current-menu');

                $(this).removeClass('return-menu');

                $(this).children('i.return-icon').remove();
                $(this).children('div.clear').remove();

                return false;
            }
            else {
                if ($(this).siblings().length > 0) {
                    // show childrens of the menu clicked
                    $(this).siblings('div').children('ul').show('fast');
                    $(this).siblings('ul').show('fast');

                    // hide brothers of menu clicked
                    $(this).parent('li').siblings('li').hide('fast');
                    $(this).parent('li').parent('ul').siblings('ul').hide('fast');

                    // hide the parents of menu clicked
                    $(this).parent('li').parent('ul').parent('li').hide('fast');
                    $(this).parent('li').parent('ul').parent('div').parent('li').children('a').hide('fast');

                    $(this).parent('li').parent('ul').addClass('hidden-menu');
                    $(this).parent('li').addClass('current-menu');

                    // add a class to style the return Menu item
                    $(this).addClass('return-menu');

                    // add return icon
                    $(this).prepend('<i class="icon gray4 bd-grayC return-icon" aria-hidden="true">&lt;<span class="visually-hidden">Return</span></i>');
                    $(this).append('<div class="clear"></div>');

                    return false;
                }
            }
        });

        // Main menu for MOBILE only
        if (window.innerWidth <= 767) {
            $('.small-main-nav, #search, .login-info, #social-network').hide();
            $('.context-navigation li:not(.current, .jq-tabstrip2-current), .corp-specifications li:not(.current, .jq-tabstrip2-current)').hide();
        }

        // Navigation
        $(document).on('click', '[data-rwdnav]', function (e) {
            $(this).siblings('[data-rwdnav]').each(function () {
                $('#' + $(this).data('rwdnav')).slideUp();
                $(this).removeClass('clicked');
            });
            $('#' + $(this).data('rwdnav')).slideToggle();
            $('#' + $(this).data('rwdnav')).css('overflow', 'visible');
            $(this).toggleClass('clicked');
            e.preventDefault();
        });

        // Context navigation
        $(document).on('click', '.c-nav-open', function (e) {
            e.preventDefault();
            if ($(this).hasClass('clicked')) {
                $('.context-navigation li:not(.current, .jq-tabstrip2-current), .corp-specifications li:not(.current, .jq-tabstrip2-current)').slideUp();
                $(this).removeClass('clicked');
            }
            else {
                $('.context-navigation li:not(.current, .jq-tabstrip2-current), .corp-specifications li:not(.current, .jq-tabstrip2-current)').slideDown();
                $('.context-navigation li:not(.current, .jq-tabstrip2-current)').css('display', 'block');
                $(this).addClass('clicked');
            }
        });
        //#endregion

        //#region Base MUST params Menu & language bar autoclose
        $(document).on('click', function (e) {
            if (window.innerWidth > 767 && !$(e.target).is($('#small-main-nav').find('*'))) {
                $('a.jq-nav-sub-close').siblings('div').first('.jq-nav-to-close').stop(true, true).hide().removeClass('jq-nav-to-close').addClass('jq-nav-to-open');
                $('a.jq-nav-sub-close').addClass('jq-nav-sub-open').removeClass('jq-nav-sub-close');
            }

            if (!$(e.target).is($('#lang').find('*'))) {
                if ($('#lang ul').hasClass('lang-open')) {
                    $('#lang li').toggle();
                    $('#lang li.current').show();
                    $('#lang ul').toggleClass('lang-open');
                }
            }
        });
        //#endregion

        //#region Dropdown
        // Show a block when a button is triggered
        // The button must have the class .jq-next-open
        // The element being shown must have the class .jq-to-open and be a following sibling of a block parent of the button
        // (i.e. from the button, search for the first block parent like a p, then search the first following sibling with class .jq-to-open)
        $('body').on('click', '.jq-next-open', function () {
            $(this).closest('p,div,section,article,aside,header,footer,h2,h3').nextAll().first('.jq-to-open').slideToggle('fast').toggleClass('jq-to-open jq-to-close');
            $(this).toggleClass('jq-next-close jq-next-open');
            var $eltVH = $(this).find('.icon > span');
            if ($eltVH.length) {
                var $eltVHTxt = $eltVH.html();
                $eltVH.parent().html(',<span>' + $eltVHTxt + '</span>');
            }
            return false;
        });
        $('body').on('click', '.jq-next-close', function () {
            $(this).closest('p,div,section,article,aside,header,footer,h2,h3').nextAll().first('.jq-to-close').slideToggle('fast').toggleClass('jq-to-open jq-to-close');
            $(this).toggleClass('jq-next-close jq-next-open');
            var $eltVH = $(this).find('.icon > span');
            if ($eltVH.length) {
                var $eltVHTxt = $eltVH.html();
                $eltVH.parent().html(';<span>' + $eltVHTxt + '</span>');
            }
            return false;
        });


        $('.jq-check-to-open').hide();

        // Dropdown
        $(document).on('click', '.jq-dropdown .jq-dd-action-link-container a',
            function (e) {
                return toggleDropdown(e);
            });

        // Keyboard accessibility of dropdown
        // Fix RQM 23688 - Now on IE8, using TAB keyboard just after last dropdown list item, the dropdownlist doesn't close.
        if (!must.ie8) {
            $(document).on('blur', '.jq-dropdown .jq-dd-list-container li:last-child a, .jq-dropdown .jq-dd-list-container li:last-child input:checkbox', function (e) {
                if (!$(e.target).hasClass('k-link')) {
                    toggleDropdown(e);
                }
            });
        }


        // If dropdown opened a Kendo calendar (RQM 42738, page 14.02, see alsasutra.js)
        // Calendar is hidden anyway when closing dropdown but when reopening the dropdown, we don't want it already displayed
        // Not called if var isBlurredCalendarToggle was true in toggleDropdown()
        $.fn.removeCalendar = function () {
            var $dd = $(this);
            // console.log("\tfunction = removeCalendar");
            if ($dd.hasClass('is-k-displayed')) {
                $dd.removeClass('is-k-displayed');
                var $kCalDd = $dd.find('.k-calendar');
                var kCalDdTest = $kCalDd.data("kendoCalendar");
                kCalDdTest.destroy();
                $kCalDd.remove();
                // console.log("\tremoveCalendar HAPPENS");
            } //else {
            // console.log("\tbut nothing happened");
            // }
        };

        // Dropdown autoclose
        $(document).on('click', function (e) {
            if (!$(e.target).is($('.jq-dropdown').find('*'))) {
                $('.jq-dropdown.jq-dd-activated').find('.jq-dd-list-container ul').stop(true, true).slideUp(200, function () {
                    $(this).closest('.jq-dropdown').toggleClass('jq-dd-activated').removeCalendar();
                    $(this).closest('.dashboard').toggleClass('jq-dd-activated');
                    // console.log("Hides dropdown if a click appears elsewhere on the page");
                });
            }
        });
        //#endregion

        //#region Dropdown medium size
        // SPECIFIC JQ-NEXT-OPEN VERSION FOR MEDIUM SCREENS ONLY
        $('.medium-jq-next-open').on('click', function () {
            if (window.innerWidth > must.wBreakpoint) {
                return;
            }
            if ($(this).hasClass('medium-jq-next-open')) {
                $(this).closest('p,div,section,article,aside,header,footer,h2').nextAll().first('.medium-jq-to-open').slideDown('fast').removeClass('medium-jq-to-open').addClass('medium-jq-to-close');
                $(this).addClass('medium-jq-next-close').removeClass('medium-jq-next-open');
            }
            else {
                $(this).closest('p,div,section,article,aside,header,footer,h2').nextAll().first('.medium-jq-to-close').slideUp('fast').removeClass('medium-jq-to-close').addClass('medium-jq-to-open');
                $(this).addClass('medium-jq-next-open').removeClass('medium-jq-next-close');
            }
            return false;
        });
        $('.medium-jq-next-close').on('click', function () {
            if (window.innerWidth > must.wBreakpoint) {
                return;
            }
            if ($(this).hasClass('medium-jq-next-open')) {
                $(this).closest('p,div,section,article,aside,header,footer,h2').nextAll().first('.medium-jq-to-open').slideDown('fast').removeClass('medium-jq-to-open').addClass('medium-jq-to-close');
                $(this).addClass('medium-jq-next-close').removeClass('medium-jq-next-open');
            }
            else {
                $(this).closest('p,div,section,article,aside,header,footer,h2').nextAll().first('.medium-jq-to-close').slideUp('fast').removeClass('medium-jq-to-close').addClass('medium-jq-to-open');
                $(this).addClass('medium-jq-next-open').removeClass('medium-jq-next-close');
            }
            return false;
        });
        //#endregion

        //#region hide/collapse for mobil screen
        $('.jq-toggle-small').on('click', function (e) {
            var elToggle = $(this);
            var elTarget = elToggle.parent().next('.jq-toggle-target')
            var elToggleIcon = elToggle.find('.icon'); // <i aria-hidden="true" class="icon gray4">;</i>

            if (elTarget.hasClass('toggle-small-opened')) {
                elTarget.removeClass('toggle-small-opened').addClass('toggle-small-closed');
                elToggleIcon.html(';');
            } else if (elTarget.hasClass('toggle-small-closed')) {
                elTarget.removeClass('toggle-small-closed').addClass('toggle-small-opened');
                elToggleIcon.html(',');
            }
            return false;
        });
        //#endregion

        //#region Checkbox
        // checkbox in table
        var $checkboxTable = $('table td.checkbox , table th.checkbox');
        $checkboxTable.prepend('<div class="jq-click-check"></div>').wrapInner('<div class="jq-wrap-check"></div>');

        var $checkboxTableSmall = $('.small-data-table .checkbox');
        $checkboxTableSmall.parent().before('<div class="jq-click-check"></div>').parent().wrapInner('<div class="jq-wrap-check"></div>');

        // checkboxes
        $(document).on('click', '.jq-click-check', function () {
            $(this).toggleClass('checked');
            var $checkboxElement = $(this).parent().find('input');

            if ($checkboxElement.attr('checked')) {
                $checkboxElement.attr('checked', false);
            }
            else {
                $checkboxElement.attr('checked', true);
            }

            $checkboxElement.trigger('click');
        });

        // T&J example of code to power the (dis)appearance of the insurance details
        $(document).on('click', '.jq-toggles .jq-toggle', function (e) {
            var elToggle = $(this);
            var elTarget = elToggle.parent().next('.jq-toggle-target');
            var elToggleIcon = elToggle.find('.icon');//<i aria-hidden="true" class="icon gray4">;</i>

            if (elTarget.hasClass('toggle-opened')) {
                elTarget.removeClass('toggle-opened').addClass('toggle-closed');
                elToggleIcon.html(';');
            } else if (elTarget.hasClass('toggle-closed')) {
                elTarget.removeClass('toggle-closed').addClass('toggle-opened');
                elToggleIcon.html(',');
            }
            return false;
        });
        //#endregion

        //#region Clic & rollover management for blocs
        $('.account-intro, .link-bipart-red, .link-bipart-gray, .corp-contacts .content').on('click', function (event) {
            if (!$(event.target).is('a')) {
                document.location.href = $('a', this).attr('href');
                return false;
            }
        });
        //#endregion

        //#region Filters
        $('.filter-mod').hide();

        $('.btn-open-filter').on('click', function () { // To open filters
            $(this).toggleClass('btn-arrowdown'); // Add an arrow
            $('.filter-mod').toggle();
        });
        //#endregion

        //apply the must validation settings
        must.validation.init();

        //Setting cookie against bots : Human_Search
        must.cookies.set(must.cookies.keys.humanSearch, '1');

        // kendo collapse/expand initialization
        $('.k-panelbar').kendoPanelBar();

        //#region Resize event (fires only every 100 milliseconds during the resize)
        // store in local cache some DOM lookups
        var $smallMainNav = $('.small-main-nav');
        var $window = $(window);

        var currentDesign = null; // '>767' or '<767'
        var resizeFunction = function resizeFunction() {
            var windowWidth = window.innerWidth;

            if (windowWidth > 767 && currentDesign !== '>767') {
                // collapse in small screen
                $('.small-jq-to-open').css('display', 'block');

                // reset the small menu to default
                $('.small-main-nav, #search, .login-info, .corp-specifications li:not(.jq-tabstrip2-current)').show();
                $('.context-navigation li, #social-network').css('display', 'inline-block');

                $('[data-rwdnav]').removeClass('clicked');

                // remove added inline styles
                $smallMainNav.find('> li, ul, a').removeClass('clicked').attr('style', '');
                $smallMainNav.find('i.return-icon').remove();

                currentDesign = '>767';
            }
            else if (windowWidth <= 767 && currentDesign !== '<767') {
                // collapse in small screen
                $('.small-main-nav, #search, .login-info, #social-network').hide();
                $('.context-navigation li, .corp-specifications li').not('.current, .jq-tabstrip2-current').hide();

                // 4 content of dropdown are hidden above. Here we also hide the triangle-arrows on resize
                $('[data-rwdnav]').removeClass('clicked');

                $('.small-jq-to-open').css('display', 'none');

                currentDesign = '<767';
            }
        };
        $window.resize(must.throttle(resizeFunction, 100));
        //#endregion

        //#region Time tracker - First Paint
        PT.getFirstPaintTime(function displayFirstPaint(firstPaintTime) {
            if (firstPaintTime !== null) {
                // bugs found in production: an IE7 user agent saying the page displayed after more than one year
                // did not found the reason, so preventing here crazy times (more than 5 minutes)
                if (firstPaintTime < 300000) {
                    must.tracktime.addEvent('Global Figures', 'First Paint', firstPaintTime);
                }
            }
        });
        //#endregion

        // Manage Booking / SI navigation
        $('[data-routename]').on('click', function () {

            // Get route name
            var routeName = $(this).data('routename');

            // Get Form
            var form = $('[data-rootForm]');
            var formUrl = form.attr("action");
            if (formUrl.indexOf("?") > 0) {
                formUrl = formUrl.substring(0, formUrl.indexOf("?"));
            }

            var newFormTarget = formUrl + "?routingName=" + routeName;

            form.attr("action", newFormTarget);
            form.find("#BtNext").trigger("click");
        });
        //#endregion

        //#region $lightboxLink
        var $lightboxLink = $('.is-lightboxed');
        if ($lightboxLink.length > 0) {
            // add overlay in the html
            $('body').append('<div class="lightbox"> \
			<figure class="lightbox--content"> \
				<div class="lightbox--illus"> \
				</div> \
				<figcatpion class="lightbox--legend"> \
					<div> \
					</div> \
				</figcatpion> \
			</figure> \
			<div class="lightbox--loader"> \
			</div> \
			<a href="#" class="lightbox--close"> \
				<i class="icon" aria-hidden="true">x</i> \
			</a> \
		</div>');
            var $lightboxPopin = jQuery('.lightbox');
            var $lightboxContent = jQuery('.lightbox--content');
            var $lightboxIllus = jQuery('.lightbox--illus');
            var $lightboxLegend = jQuery('.lightbox--legend > div');
            var $lightboxClose = jQuery('.lightbox--close');
            // for each link we fetch the values before the event
            $lightboxLink.each(function () {
                var $this = $(this);
                var thisUrl = $this.attr('href');
                var thisLegend = $this.attr('title');
                var thisIllus = '<img src="' + thisUrl + '" alt="' + thisLegend + '" />';
                // on click open the lightbox
                $this.on('click', function (e) {
                    e.preventDefault();
                    $('body').addClass('has-lightbox');
                    $lightboxPopin.addClass('is-loading');
                    // adding legend and image
                    $lightboxLegend.html(thisLegend);
                    $lightboxIllus.html(thisIllus);
                    // once the image is added and loaded
                    var $newImg = $lightboxIllus.find('img');
                    $newImg.on('load', function () {
                        // silly calculation to make sur the legend is as large as the image
                        var newWidth = $newImg.outerWidth();
                        $lightboxLegend.css('max-width', newWidth);
                        $lightboxPopin.removeClass('is-loading');
                        // silly calculation to make sure the image is vertically centered whatever the length of the legend
                        var imgOffset = $lightboxLegend.parent().outerHeight();
                        $newImg.css('margin-bottom', imgOffset);
                    });
                    $lightboxPopin.addClass('is-active');
                    // reveal popin
                    return false;
                });
            });
            // close the lightbox
            // on click on the overlay, we close the popin
            $lightboxClose.on('click', function (event) {
                $('body').removeClass('has-lightbox');
                $lightboxPopin.removeClass('is-active');
                return false;
            });
        }
        //#endregion

        //#region flexslider
        var $flexSlider = $('#flexslider-slider-1');
        var $flexSliderNav = $('#flexslider-carousel-1');
        // slider nav
        $flexSliderNav.flexslider({
            animation: "slide",
            animationLoop: false,
            controlNav: true,
            slideshow: false,
            itemWidth: 170,	// @TOPROD you have to change here images size for each responsive resolution
            itemMargin: 0,
            asNavFor: '#flexslider-slider-1'
        });
        // true slider
        $flexSlider.flexslider({
            animation: "slide",
            animationLoop: false,
            controlNav: false,
            slideshow: false,
            sync: "#flexslider-carousel-1",
            start: function () {
                $flexSlider.find('li img').each(function () {
                    var $this = $(this);
                    var description = $this.attr('alt');
                    var $wrapper = $this.parent();
                    $wrapper.append('<div class="flex-must-text font-verd"> \
							<!--<div class="flex-must-title">Title if needed</div>--> \
							<div class="flex-must-desc">'+ description + '</div> \
						</div>');
                });
            }
        });
        //#endregion
    });
    $(document).on('lazyloaded', function () {
        if (!Modernizr.objectfit) {
            MUSTobjectFitPolyfill($('img.js-objectfit.lazyloaded'));
        }
    });
}(this.must = this.must || {}));
;
(function (must) {
    // returns a function that will not be called more than 1 time per wait ms
    // see http://underscorejs.org/#throttle
	must.throttle = function (func, wait, options) {
		var context, args, result;
		var timeout = null;
		var previous = 0;
		if (!options) options = {};
		var later = function () {
			previous = options.leading === false ? 0 : +new Date();
			timeout = null;
			result = func.apply(context, args);
			if (!timeout) context = args = null;
		};
		return function () {
			var now = + new Date();
			if (!previous && options.leading === false) previous = now;
			var remaining = wait - (now - previous);
			context = this;
			args = arguments;
			if (remaining <= 0 || remaining > wait) {
				clearTimeout(timeout);
				timeout = null;
				previous = now;
				result = func.apply(context, args);
				if (!timeout) context = args = null;
			} else if (!timeout && options.trailing !== false) {
				timeout = setTimeout(later, remaining);
			}
			return result;
		};
	};

    // Returns a function, that, as long as it continues to be invoked, will not
    // be triggered. The function will be called after it stops being called for
    // N milliseconds. If `immediate` is passed, trigger the function on the
    // leading edge, instead of the trailing.
    must.throttle.debounce = function debounce(func, wait, immediate) {
        var timeout;
        return function () {
            var context = this,
				args = arguments;
            var later = function () {
                timeout = null;
                if (!immediate) func.apply(context, args);
            };
            var callNow = immediate && !timeout;
            clearTimeout(timeout);
            timeout = setTimeout(later, wait);
            if (callNow) func.apply(context, args);
        };
    };


    must.throttle.optimizedFor = function (options) {
        // for IE10, or if you include a decent setImmediate polyfill
        var setImmediate = window.setImmediate || function (callback) {
            setTimeout(callback, 0);
        },
			now = must.date.now
        /*Date.now || function() {
                return +new Date();
            }*/
        ;

        must.throttle.optimizedFor = function optimizedFor(options) {

            options = $.extend({
                nbIterations: 0, // number of time to check (or a function that returns true / false)
                each: $.noop, // method to execute each time. i will be given as an argument
                callback: $.noop,
                step: 40 // max number of milliseconds a loop can block the browser. step up = loop runs faster, browser is less fluid. 0 = max fluidity, task last longer
            }, options);
            // if (options)

            var i = 0,
				check;
            // allow the user to provide its own stop method
            if (typeof options.nbIterations === 'function') {
                check = options.nbIterations;
            } else {
                check = function (i) {
                    return i < options.nbIterations;
                };
            }

            (function mainLoop() {
                //
                for (var lastStart = now() ; check(i) ; i++) {
                    options.each(i);
                    //
                    if ((now() - lastStart) > 40) {
                        // let the browser breath
                        setImmediate(mainLoop);
                        // break the loop but do not forget to increment
                        i++;
                        return;
                    }
                }
                // final method (must be async too)
                setImmediate(options.callback);
            }());
        };
        must.throttle.optimizedFor(options);
    };
}(this.must = this.must || {}));
;
(function (must) {
	must.message = (function () {
		var $errorList = $('#ajax-messages'),
			animateSpeedIn = 'slow',
			animateSpeedOut = 'fast',
			timer = [],
			delai = 8000,
			i = 0,
			messageType = {
				error: 0,
				warning: 1,
				info: 2
			};

		// public function
		var show = function (msg, type) {
			var $newElement = $('<div></div>').addClass('msg'),
				$newSubElement = $('<span></span>').addClass('font-verd pa1').text(msg);

			if (type === messageType.warning) {
				$newSubElement.addClass('orange');
				$newElement.append($newSubElement);
				$newElement.append('<div class="pa1 bg-orange bd-left-5-white"><i class="icon white" aria-hidden="true">w</i></div>');
			}
			else if (type === messageType.info) {
				$newSubElement.addClass('blue1');
				$newElement.append($newSubElement);
				$newElement.append('<div class="pa1 bg-blue1 bd-left-5-white"><i class="icon white" aria-hidden="true">i</i></div>');
			}
			else {
				$newSubElement.addClass('red1');
				$newElement.append($newSubElement);
				$newElement.append('<div class="pa1 bg-red1 bd-left-5-white"><i class="icon white" aria-hidden="true">X</i></div>');
			}

			i = i + 1;
			$newElement.data('id', i);

			animateIn($newElement, function (el) {
				queueRemove(el);
			});
		},

		queueRemove = function (el) {
			timer[el.data('id')] = window.setTimeout(function () {
				removeMsg(el);
			}, delai);
		},

		removeMsg = function (el) {
			if (timer[el.data('id')]) {
				window.clearTimeout(timer[el]);
				timer[el.data('id')] = null;
			}

			animateOut(el, function () {
				detach(el);
			});
		},

		detach = function (el) {
			$errorList.find(el).remove();
		},

		animateIn = function (el, callback) {
			$errorList.append(el);
			el.fadeIn(animateSpeedIn, callback(el));
		},

		animateOut = function (el, callback) {
			el.fadeOut(animateSpeedOut, callback);
		};

		return {
			type: messageType,
			show: show
		};
	}());
}(this.must = this.must || {}));;
(function (must) {
	must.menu = (function () {
		var collapseActionList = function (e) {
			$(e).closest('.jq-dropdown').find('.jq-dd-list-container ul').stop(true, true).slideToggle(200, function () {
				$(e).closest('.jq-dropdown').toggleClass('jq-dd-activated');
			});
		};

		return {
			collapseActionList: collapseActionList
		};
	}());
}(this.must = this.must || {}));;
/*
 *  check ~/Samples/JsUnitTest/Index for better use
 * 
 */

(function (must) {
	must.storage = (function () {
		var self = this;
		self.storageType = 'localStorage';
		self.prefix = 'must';

		// If there is a prefix set in the config lets use that with an appended period for readability
		if (self.prefix.substr(-1) !== '.') {
			self.prefix = !!self.prefix ? self.prefix + '.' : '';
		}
		var deriveQualifiedKey = function (key) {
			return self.prefix + key;
		};

		var saveItem = function (item) {
			localStorage.setItem(item.key, JSON.stringify(item));
		};

		var removeItem = function (key) {
			localStorage.removeItem(key);
		};

		var getByKey = function (key) {
			return JSON.parse(localStorage.getItem(key));
		};

		var removeExpiredObject = function () {
			var count = 0;
			var tmpKey = [];
			for (var i = 0, len = localStorage.length; i < len; ++i) {
				var key = localStorage.key(i);
				var item = getByKey(key);
				if (item && item.expirationDate && kendo.parseDate(item.expirationDate) < new Date()) {
					tmpKey.push(key);

				}
			}
			for (i = 0; i < tmpKey.length; i++) {
				must.storage.removeItem(tmpKey[i]);
				count++;
			}
			return count;
		};

		var removeAllItems = function () {
			if (isLocalStorageAvailable()) {
				localStorage.clear();
			}
		};

		var removeItemsByKey = function (partialKey) {
			if (isLocalStorageAvailable() && partialKey) {
				var keysFound = [];
				for (var i = 0; i < localStorage.length; i++) {
					if (localStorage.key(i).indexOf(partialKey) !== -1) {
						keysFound.push(localStorage.key(i));
					}
				}

				for (var j = 0; j < keysFound.length; j++) {
					removeItem(keysFound[j]);
					consoleTrace('LS ' + keysFound[j] + ' removed');
				}
			}
		};

		var getKeys = function (partialKey) {
			var keys = [];
			if (isLocalStorageAvailable()) {
				for (var i = 0; i < localStorage.length; i++) {
					if (partialKey && localStorage.key(i).indexOf(partialKey) !== -1) {
						keys.push(localStorage.key(i));
					}
					else {
						keys.push(localStorage.key(i));
					}
				}
			}
			return keys;
		};

		var isLocalStorageAvailable = function () {

			return self.storageType in window && window[self.storageType] !== null;
		};

		// Check if the local storage is available
		var browserSupportsLocalStorage = function () {
			try {
				var supported = isLocalStorageAvailable();

				// When Safari (OS X or iOS) is in private browsing mode, it appears as though localStorage
				// is available, but trying to call .setItem throws an exception.
				//
				// "QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made to add something to storage
				// that exceeded the quota."
				var key = deriveQualifiedKey('__' + Math.round(Math.random() * 1e7));
				if (supported) {
					var webStorage = window[self.storageType];
					webStorage.setItem(key, '');
					webStorage.removeItem(key);
				}

				return supported;
			} catch (e) {
				//storageType = 'cookie';
				if (supported) {
					//try to get free space by removing expired items
					if (removeExpiredObject() > 0) {
						return browserSupportsLocalStorage();
					}
				}
				return false;
			}
		};

		var consoleTrace = function (value) {
			if (window.console) {
				console.info(value);
			}
		};

		//#region get/set locastorageitem

		/*
		 * provide the onsuccess function in order
		 *  to perform a callback when the result is available
		 */
		var getLocalStorageData = function (args) {
			var data,
			isIncache = false,
			defaults = {
				key: '',
				onsuccess: function () { },
				onerror: function () { },
				route: '',
				params: '',
				async: true,
				debug: false
			},
			consoleTrace = function (value) {
				if (args.debug && window.console) {
					console.info(value);
				}
			};

			//override default args by passed args
			args = $.extend({}, defaults, args);

			if (!args.key) {
				throw 'key not set';
			}

			//Check if the local storage is available
			if (browserSupportsLocalStorage()) {
				consoleTrace('ls supported and not full');
				//retrieve this item by key
				var lsItem = getByKey(args.key);
				if (lsItem) {
					consoleTrace('item found with key ' + args.key);
					//check if the item is a LocalStorageItem
					if (lsItem.key && lsItem.data) {
						consoleTrace('item has a key and a data ' + args.key);
						//check the expirationdate
						if (kendo.parseDate(lsItem.expirationDate) > new Date()) {
							consoleTrace('item not expired ' + args.key);
							data = lsItem.data;
							isIncache = true;
						}
						else {
							//remove the item from the cache if it has expired
							consoleTrace('item expired ' + args.key);
							must.storage.removeItem(args.key);
						}
					}
					else {
						//the item could be anything, return it without checking expiration
						consoleTrace('item is not a LocalStorageItem ' + args.key);
						data = lsItem;
						isIncache = true;
					}
				}
			}
			//no data from the localstorage, try to get it from an ajax call
			if (!isIncache && args.route) {
				consoleTrace('item not in cache or cache unavailable ' + args.key);
				$.ajax({
					url: args.route,
					type: 'GET',
					data: args.params,
					dataType: 'json',
					async: args.async
				})
				.success(function (response) {
					// pass param to anonymous function
					consoleTrace('ajax call successfull ' + args.key);
					args.onsuccess(response);
				})
				.fail(function (response) {
					consoleTrace('ajax call error ' + args.key);
					args.onerror(response);
				});
			}
			else {
				consoleTrace('item in cache, return it ' + args.key);

				if (args.async) {
					setTimeout(function () {
						args.onsuccess(data);
					}, 0);
				} else {
					args.onsuccess(data);
				}
			}
		};

		/*
		 * Item must be a LocalStorageItem or at least must have a key
		 */
		var setLocalStorageItem = function (item) {
			//Check if the local storage is available
			if (browserSupportsLocalStorage()) {
				//check if the item is a LocalStorageItem
				if (item instanceof LocalStorageItem) {
					must.storage.saveItem(item);
					return true;
				}
				else if (item.key) {
					var lsitem = new LocalStorageItem({
						key: item.key,
						data: item
					});
					must.storage.saveItem(lsitem);
					return true;
				}
				else {
					throw 'item is not a valid LocalStorageItem';
				}
			}
			return false;

		};

		/*
		 * prototype of the object to be stored in the localstorage
		 * key and data are mandatory
		 */
		var LocalStorageItem = function (options) {
			var params = {
				key: null,
				data: null,
				//must.date.addSec(60 * 5);
				expirationDate: null
			};

			$.extend(params, options);

			this.key = params.key;
			this.data = params.data;
			this.expirationDate = params.expirationDate;

			if (!this.key) {
				throw 'key not set';
			}

			if (!this.data) {
				throw 'null data';
			}
			//default expiration date 1 day
			if (!this.expirationDate) {
				this.expirationDate = must.date.addSec(60 * 60 * 24);
			}
		};

		//#endregion

		return {
			saveItem: saveItem,
			removeItem: removeItem,
			getByKey: getByKey,
			browserSupportsLocalStorage: browserSupportsLocalStorage,
			LocalStorageItem: LocalStorageItem,
			getLocalStorageData: getLocalStorageData,
			setLocalStorageItem: setLocalStorageItem,
			removeExpiredObject: removeExpiredObject,
			removeItemsByKey: removeItemsByKey,
			getKeys: getKeys
		};
	}());
}(this.must = this.must || {}));;
(function (must) {

	//TODO: move to a lib?
	var stringHash = function (value) {
		/// <summary>
		/// Create an unique hash from a string.
		/// </summary>
		/// <param name="value"></param>

		var hash = 0, i, chr, len;
		if (value.length === 0) {
			return hash;
		}
		for (i = 0, len = value.length; i < len; i++) {
			chr = value.charCodeAt(i);
			hash = ((hash << 5) - hash) + chr;
			hash |= 0; // Convert to 32bit integer
		}
		return Math.abs(hash);
	};

	must.table = (function () {
		var defaultPagination = 10,
			globaltid,
			globaloptions,
			minTemplateActive = false,
			responsive = {
				minimal : 767,
				essential: 954,
				optional: 1200
			},

		hackHiddenColumns = function (table) {
			table.css('display', 'inline-table');
			window.setTimeout(function () { table.css('display', ''); }, 0);
		},

		applyStyles = function (container, tableId, tid, ktable) {
			container.find('ul').html('');
			tableId.find('> thead th').each(function (i) {
				var th = $(this),
					id = th.attr('id'),
					classes = th.attr('class'),
					inlinestyle = th.attr('style');

				if (ktable) {
					if (th.hasClass('k-group-cell')) {
						return;
					}
				}

				if (!id) {
					id = tid + '-c-' + i;
					th.attr('id', id);
				}

				if (classes) {
					// remove k-* classes to apply on td
					var classlist = classes.split(' '),
						classfinallist = classes.split(' '),
						finali = 0,
						initi;
					for (initi = 0; initi < classlist.length; initi = initi + 1) {
						if (classlist[initi].indexOf('k-') === 0) {
							classfinallist.splice(finali, 1);
							finali = finali - 1;
						}
						finali = finali + 1;
					}
					if (classfinallist) {
						classes = classfinallist.join(' ');
					}
				}

				tableId.find('> tbody tr').each(function () {
					var cell = $(this).find('th, td').eq(i);
					cell.attr('headers', id);

					if (classes) {
						cell.addClass(classes);
					}

					// apply inline style (when override)
					if (inlinestyle !== undefined) {
						cell.attr('style', inlinestyle);
					}
				});

				var $col = tableId.find('> colgroup > col').eq(i);
				if ($col.length) {
					$col[0].id = 'g-' + id;
				}
				if (classes) {
					var classElements = classes.split(' ');
					var className;
					$.each(classElements, function (index, name) {
						if (name === 'persist' || name === 'minimal' || name === 'essential' || name === 'optional') {
							className = name;
						}
					});
					if (!className) {
						$col.addClass(className);
					}
				}

				if (!th.is('.persist')) {
					var toggle = $('<li><input type="checkbox" name="toggle-cols" id="toggle-' + id + '" value="' + id + '" /> <label for="toggle-' + id + '">' + th.text() + '</label></li>');
					container.find('ul').append(toggle);

					toggle.find('input').change(function () {
						if (must.ie8) {
							hackHiddenColumns(tableId);
						}

						var input = $(this),
							val = input.val(),
							cols = $('#' + val + ', [headers=' + val + ']'),
							colgroup = $('#g-' + val);

						cols.css('display', ''); // reset the display to avoid overriding the css on resize.
						if (input.is(':checked')) {
							if (!cols.is(':visible')) {
								cols.show();
							}
							if (colgroup.length) {
								colgroup.show();
							}
							input.parent().addClass('checked');
						}
						else {
							if (cols.is(':visible')) {
								cols.hide();
							}
							if (colgroup.length) {
								colgroup.hide();
							}
							input.parent().removeClass('checked');
						}
					}).bind('updateCheck', function () {
						if (must.ie8) {
							hackHiddenColumns(tableId);
						}

						if (th.css('display') === 'table-cell') {
							$(this).attr('checked', true);
							$(this).parent().addClass('checked');
						}
						else {
							$(this).attr('checked', false);
							$(this).parent().removeClass('checked');
						}
					}).trigger('updateCheck');
				}
			});
		},

		createToggleMenu = function ($tableId, contid, container) {
			var menuWrapper = $('<div class="right display_page_dd jq-dropdown jq-dd-secondary" />'),
				menuBtn = $('<p class="jq-dd-action-link-container"><a class="" href="#your-inner-display"><i aria-hidden="true" class="icon">z</i> ' + must.resources.table_action_display + ' <i aria-hidden="true" class="icon jq-select-arrow">,</i></a></p>');

			menuWrapper.append(menuBtn).append(container);

			if (contid) {
				$('#' + contid).before(menuWrapper);
			}
			else {
				$tableId.before(menuWrapper);
			}
		},

		createGuid = function (pageUrl, viewName) {
			var key = pageUrl;

			//append the user email if it exists
			var $userMail = $('#login-info div[data-tealeaf=UserEmail]');
			if ($userMail) {
				key = key + '|' + $.trim($userMail.text());
			}

			//append the view select if it exists
			if (viewName) {
				key = key + '|' + $.trim(viewName);
			}

			// create the hash
			return stringHash(key);
		},

		init = function (tid, options) {
			globaltid = tid;
			globaloptions = options;

			var $tableId = $('#' + tid),
				o = options || {},
				mwidth = o.minWidth || must.minTabletWidth,
				contid = o.containerId,
				ktable = (o.isKendoTable) ? $tableId.data('mustGrid') : false,
				ktemplate = o.kendoMinTemplate,
				kHtmltemplate = o.kendoMinHtmlTemplate,
				windowWidth = $(window).width(),
				container = $('<div class="jq-dd-list-container"><ul /></div>');

			$tableId.addClass('enhanced');

			if (!ktable) {
				createToggleMenu($tableId, contid, container);

				if (!minTemplateActive) {
					applyStyles(container, $tableId, tid, ktable);
				}

				$(window).bind('orientationchange resize', function () {
					must.throttle.debounce(function () {
						container.find('input').trigger('updateCheck');
					}, 100, false);
				});
			}
		},

		// Kendo default values for pagination
		pageable = function (size) {
			return {
				pageSize: size || defaultPagination,
				messages: {
					previous: must.resources.kpageable_m_previous,
					next: must.resources.kpageable_m_next,
					first: must.resources.kpageable_m_first,
					last: must.resources.kpageable_m_last,
					display: must.resources.kpageable_m_display,
					empty: ''
				}
			};
		},

		// Kendo default values for filters
		filterable = function () {
			if (must.ie6) {
				return false;
			}

			return {
				messages: {
					info: must.resources.kfilterable_m_info,
					and: must.resources.kfilterable_m_and,
					or: must.resources.kfilterable_m_or,
					filter: must.resources.kfilterable_m_filter,
					clear: must.resources.kfilterable_m_clear,
					isTrue: must.resources.kfilterable_m_istrue,
					isFalse: must.resources.kfilterable_m_isfalse,
					selectValue: must.resources.kfilterable_m_selectValue
				},
				operators: {
					string: {
						contains: must.resources.kfilterable_o_contains,
						doesnotcontain: must.resources.kfilterable_o_doesnotcontain,
						eq: must.resources.kfilterable_o_eq,
						neq: must.resources.kfilterable_o_neq,
						startswith: must.resources.kfilterable_o_startswith,
						endswith: must.resources.kfilterable_o_endswith
					},
					number: {
						eq: must.resources.kfilterable_o_eq,
						neq: must.resources.kfilterable_o_neq,
						gte: must.resources.kfilterable_o_n_gte,
						gt: must.resources.kfilterable_o_n_gt,
						lte: must.resources.kfilterable_o_n_lte,
						lt: must.resources.kfilterable_o_n_lt
					},
					date: {
						eq: must.resources.kfilterable_o_eq,
						neq: must.resources.kfilterable_o_neq,
						gt: must.resources.kfilterable_o_d_gt,
						lt: must.resources.kfilterable_o_d_lt,
						lte: must.resources.kfilterable_o_d_lte,
						gte: must.resources.kfilterable_o_d_gte
					},
					enums: {
						eq: must.resources.kfilterable_o_eq,
						neq: must.resources.kfilterable_o_neq
					}
				}
			};
		};

		groupable = function() {
			if (must.ie6) {
				return false;
			}

if(window.screen.width >= 768)
{
			return {
				messages: {
					empty: must.resources.kgroupable_m_empty
				}
			};
}
		};

		return {
			init: init,
			defaultPagination: defaultPagination,
			pageable: pageable,
			filterable: filterable,
			groupable: groupable,
			createGuid: createGuid,
			responsive: responsive
		};
	}());
}(this.must = this.must || {}));;
/// This declares to JSHint that 'kendo' is a global variable, and the false indicates that it should not be overridden.
// Prevent 'kendo' is not defined in Error message window
/*global kendo */
(function (must) {
	'use strict';
	must.table = must.table || {};

	/// <summary>
	/// Must table kendoGrid, wrap the kendo grid element with custo events and enable/disable must-specific functionnalities
	/// </summary>

	// private
	var MustGrid = function ($cont, kendoOptions, mustOptions) {
		/// <summary>
		/// MustGrid class, encapsulate kendo Grid properties and events to provide soft-dependency with the kendo api and define custom event handlers
		/// </summary>
		/// <param name="$cont">html element</param>
		/// <param name="kendoOptions">kendo-specific options</param>
		/// <param name="mustOptions">must custom options</param>

		var self = {
			guid: '', // unique id for the grid.
			$grid: null, // html grid container.
			kendoGrid: null, // kendo grid data item.
			gridOptions: {}, // kendo grid options, contain the init options for the grid.
			customOptions: {}, // must custom settings, use in separate features (must.table.*) if possible.
			colsHash: null, // list of column items as an hashtable, stored for performances. Do not access directly.
			events: null,

			//#region methods
			_getColumnType: function (gridOptions, columnName) {
				/// <summary>
				/// Return the column content type from the grid options and column name
				/// </summary>
				/// <param name='gridOptions'>kendo grid options</param>
				/// <param name='columnName'>column name</param>
				/// <returns type='string'>column content type</returns>

				if (!columnName) {
					return '';
				}

				var options = gridOptions.dataSource.options;
				if (!options || !options.schema || !options.schema.model || !options.schema.model.fields) {
					return '';
				}

				var field = options.schema.model.fields[columnName];
				if (!field) {
					return '';
				}

				return field.type;
			},

			_isTemplateGrid: function () {
				/// <summary>
				/// Return true iif the gris is using row templates. Kendo visibility has to be defined manually when using templating.
				/// </summary>

				if (self.gridOptions.rowTemplate || self.gridOptions.altRowTemplate) {
					return true;
				}

				return true;
			},

			_toggleMinScreenWidth: function (column) {
				/// <summary>
				/// Toggle the responsive mode for the column
				/// </summary>
				/// <param name="column">column to toggle</param>

				if (column.minScreenWidth) {
					column.dumMinScreenWidth = column.minScreenWidth;
					column.minScreenWidth = null;
				} else if (column.dumMinScreenWidth) {
					column.minScreenWidth = column.dumMinScreenWidth;
					column.dumMinScreenWidth = null;
				}
			},

			_setColumnStartVisibility: function (column, visible, isTemplateGrid) {
				/// <summary>
				/// Change the column initial visibility.
				/// </summary>
				/// <param name="column">column to change</param>
				/// <param name="visible">new column visibility</param>
				// headers are not yet mapped to the grid, show/hide them manually.

				// hide the column header manually.
				if (isTemplateGrid && column.$htmlHead) {
					column.$htmlHead.toggle(visible);
				}

				self._toggleMinScreenWidth(column);
				column.hidden = !visible;
			},

			_initColumnHeaders: function () {
				/// <summary>
				/// Initialize the column headers.
				/// </summary>

				var columns = self._getColHash();
				var isTemplateGrid = self._isTemplateGrid();

				for (var colKey in columns) {
					if (columns.hasOwnProperty(colKey)) {
						var column = columns[colKey];

						//Set the initial visibility for all hidden columns.
						if (column.hidden) {
							self._setColumnStartVisibility(column, false, isTemplateGrid);
						}
					}
				}
			},

			_calculateColumnsHash: function () {
				/// <summary>
				/// Create an hashtable of columns for each field and populate it
				/// </summary>

				var columnsHash = {};
				var columns = self.kendoGrid ? self.kendoGrid.columns : self.gridOptions.columns;
				var htmlHeaders = self.$grid.find('thead th'); // title and class are not accessible outside of the dom.

				if (!columns) {
					return columnsHash;
				}

				for (var i = 0; i < columns.length; i++) {
					var column = columns[i];

					// populate the column settings with options from the html headers
					var $htmlCol = $(htmlHeaders[i]);
					if ($htmlCol) {
						column.persistent = $htmlCol.is('.persist');
						column.title = $htmlCol.text();
						column.$htmlHead = $htmlCol;
					}

					// then append the column to the list
					var colKey = column.field;
					if (!colKey) {
						colKey = 'c' + i;
					}
					columnsHash[colKey] = column;
				}

				return columnsHash;
			},

			_getColHash: function () {
				/// <summary>
				/// return the grid hashed column list
				/// </summary>

				// calculate the columns hash. colsHash can be invalidated by some events like when updating the kendo rowTemplates
				if (!self.colsHash) {
					self.colsHash = self._calculateColumnsHash();
				}
				return self.colsHash;
			},

			_getId: function () {
				/// <summary>
				/// Return the grid Id
				/// </summary>

				if (!self.guid) {

					var viewName = '';
					var $viewPicker = $('.showing_dd .jq-dd-list-container li.selected a.showing-choices');
					if ($viewPicker) {
						var text = $viewPicker.clone().children().remove().end().text();
						viewName = $.trim(text);
					}

					self.guid = must.table.createGuid(location.pathname, viewName);
				}

				return self.guid;
			},

			_parseGridFilters: function (filterOrder) {
				/// <summary>
				/// We have to parse the filters if the field is not a string. Why Kendo, why?!
				/// </summary>
				/// <param name="filterOrder">filter list</param>

				if (filterOrder.filters) {
					$.each(filterOrder.filters, function () {
						if (this.value) {
							var fieldType = self._getColumnType(self.gridOptions, this.field);
							if (fieldType === 'number') {
								this.value = parseInt(this.value);
							} else if (fieldType === 'date') {
								this.value = kendo.parseDate(this.value);
							}
						}
					});
				}
			},
			//#endregion

			//#region init
			_setKendoGrid: function (event) {
				/// <summary>
				/// Set the kendo grid.
				/// </summary>
				/// <param name="grid">grid</param>

				if (!self.kendoGrid) {
					self.kendoGrid = event.sender;

					//bind the events
					if (self.kendoGrid.dataSource) {
						self.events.filterChange.bind(self.kendoGrid.dataSource);
						self.events.sortChange.bind(self.kendoGrid.dataSource);
					}

					// then invalidate the columns list
					self.colsHash = null;
				}
			},

			_initGridOptions: function (gridOptions) {
				/// <summary>
				/// init the kendo grid settings
				/// </summary>
				/// <param name="gridOptions">grid options to update</param>

				var i, col;
				var isOldIE = $('html').hasClass('oldie');

				// create a dummy datasource if it does not exists
				if (!gridOptions.dataSource) {
					gridOptions.dataSource = {};
				}

				if (gridOptions && gridOptions.columns) {
					var columns = gridOptions.columns;

					// for old IE browsers, remove the minScreenWidth property and set the visibility at start
					if (isOldIE) {
						var effectiveWidth = $('.inner').width();

						for (i = 0; i < columns.length; i++) {
							col = columns[i];

							if (col.minScreenWidth) {
								if (col.minScreenWidth > effectiveWidth) {
									col.hidden = true;
								}

								col.minScreenWidth = null;
							}
						}
					}

					// init the columns default hidden field
					for (i = 0; i < columns.length; i++) {
						col = columns[i];
						col.defaultHidden = col.hidden ? true : false;
					}
				}
			},

			_initEvents: function () {
				/// <summary>
				/// Create the custom event handlers
				/// </summary>

				var evtOptions = function () {
					return {
						$grid: self.$grid,
						gridOptions: self.gridOptions,
						kendoGrid: self.kendoGrid,
						getColTypeMethod: self._getColumnType
					};
				};

				var events = must.table.kendoGrid.events;
				self.events = {
					dataBinding: events.dataBind.init(evtOptions),
					dataBound: events.dataBound.init(evtOptions),
					filterChange: events.filterChange.init(evtOptions),
					sortChange: events.sortChange.init(evtOptions),
					columnShow: events.columnShow.init(evtOptions),
					columnHide: events.columnHide.init(evtOptions),
					filterMenu: events.filterMenu.init(evtOptions)
				};
			},

			_init: function ($grid, gridOptions, customOptions) {
				/// <summary>
				/// Initialize the MustGrid.
				/// </summary>

				// init the parameters
				self.$grid = $grid;
				self.gridOptions = gridOptions;
				self.customOptions = customOptions;

				// update the grid options
				self._initGridOptions(self.gridOptions);

				// init the columns headers
				self._initColumnHeaders();

				// create the event handlers
				self._initEvents();

				// attach an event to the databinding to init the kendoGrid
				self.events.dataBinding.attach(self._setKendoGrid);
			}
			//#endregion
		};

		//#region bind public methods
		for (var method in MustGrid.prototype) {
			if (MustGrid.prototype.hasOwnProperty(method)) {
				this[method] = $.proxy(MustGrid.prototype[method], self);
			}
		}
		//#endregion

		self._init($cont, kendoOptions, mustOptions);
	};

	// public
	MustGrid.prototype = {

		//#region sort and filters
		getSort: function () {
			/// <summary>
			/// Get the sort order from the grid
			/// </summary>

			return this.kendoGrid ? this.kendoGrid.dataSource.sort() : null;
		},

		setOptions: function (options) {
			if (this.kendoGrid) {
				 this.kendoGrid.setOptions(options);
			}
		},

		setSort: function (sortOrder) {
			/// <summary>
			/// set the initial sort order for the grid
			/// </summary>
			/// <param name="sortOrder">init sort order</param>

			if ($.isFunction(this.gridOptions.dataSource.sort)) {
				this.gridOptions.dataSource.sort(sortOrder);
			} else {
				this.gridOptions.dataSource.sort = sortOrder;
			}
		},

		setColumnSort: function (pos, sortable) {
			/// <summary>
			/// Enable/disable the sort for the column
			/// </summary>
			/// <param name="pos">position of the column</param>
			/// <param name="sortable">new sort value</param>

			var col;
			if (this.kendoGrid) {
				col = this.kendoGrid.columns[pos];
			} else {
				col = this.gridOptions.columns[pos];
			}
			if (col) {
				col.sortable = sortable;
			}
		},

		setFilter: function (filterOrder) {
			/// <summary>
			/// set the init filtering for the grid
			/// </summary>
			/// <param name="sortOrder">init filters</param>

			this._parseGridFilters(filterOrder);
			if ($.isFunction(this.gridOptions.dataSource.filter)) {
				this.gridOptions.dataSource.filter(filterOrder);
			} else {
				this.gridOptions.dataSource.filter = filterOrder;
			}
		},

		getFilter: function () {
			/// <summary>
			/// get the filters from the grid
			/// </summary>

			return this.kendoGrid ? this.kendoGrid.dataSource.filter() : null;
		},
		//#endregion

		//#region data
		getCount: function () {
			/// <summary>
			/// count and return the number of rows in the grid
			/// </summary>

			if (!this.kendoGrid || !this.kendoGrid.dataSource.total) {
				return 0;
			}

			return this.kendoGrid.dataSource.total();
		},

		getCell: function (pos) {
			/// <summary>
			/// get the cell from the grid
			/// </summary>
			/// <param name="pos">cell position to retrieve</param>

			if (!this.kendoGrid || !this.kendoGrid.data) {
				return null;
			}

			return this.kendoGrid.data()[pos];
		},

		getItem: function (id) {
			/// <summary>
			/// Get the item from the grid
			/// </summary>
			/// <param name="id">id of the item to retrieve</param>

			if (!this.kendoGrid) {
				return null;
			}

			return this.kendoGrid.dataSource.get(id);
		},

		query: function (q) {
			/// <summary>
			/// Run the query on the datasource
			/// </summary>
			/// <param name="q">query to execute</param>

			if (!this.kendoGrid) {
				return null;
			}

			return this.kendoGrid.dataSource.query(q);
		},

		getDataSource: function () {
			/// <summary>
			/// Get the table datasource
			/// </summary>

			if (!this.kendoGrid) {
				return this.gridOptions.dataSource;
			}

			return this.kendoGrid.dataSource;
		},

		changeDataSource: function (dataSource) {
			/// <summary>
			/// Replace the table datasource
			/// </summary>
			/// <param name="dataSource">new datasource</param>

			if (!this.kendoGrid) {
				return;
			}

			//check if there is an existing datasource
			var current = this.kendoGrid.dataSource;
			if (current) {
				this.events.filterChange.unbind(current);
				this.events.sortChange.unbind(current);
				dataSource.sort(current.sort());
				dataSource.filter(current.filter());
			}

			// bind the events
			this.kendoGrid.setDataSource(dataSource);
			this.events.filterChange.bind(dataSource);
			this.events.sortChange.bind(dataSource);
		},

		cancelEditRow: function (rowId) {
			/// <summary>
			/// cancel the edition for the row
			/// </summary>

			if (this.kendoGrid) {
				this.kendoGrid.cancelRow(rowId);
			}
		},
		//#endregion

		//#region events
		onFilterCreate: function (event) {
			/// <summary>
			/// on filter blur event, triggered on blur on the filter fields (before filter).
			/// </summary>
			/// <param name="event">event to attach</param>
			this.events.filterMenu.attachFilterCreate(event);
		},

		onFilterBlur: function (event) {
			/// <summary>
			/// on filter blur event, triggered on blur on the filter fields (before filter).
			/// </summary>
			/// <param name="event">event to attach</param>
			this.events.filterMenu.attachFilterBlur(event);
		},

		onFilterOpen: function (event) {
			/// <summary>
			/// on filter open event, triggered when a filter popup is opened (autocomplete, datepicker, ..).
			/// </summary>
			/// <param name="event">event to attach</param>
			this.events.filterMenu.attachFilterOpen(event);
		},

		onFilterClose: function (event) {
			/// <summary>
			/// on filter close event, triggered when a filter popup is closed (autocomplete, datepicker, ..).
			/// </summary>
			/// <param name="event">event to attach</param>
			this.events.filterMenu.attachFilterClose(event);
		},

		onFilterChange: function (event) {
			/// <summary>
			/// on filter change event, triggered when a filter is changed on the grid
			/// </summary>
			/// <param name="event">event to attach</param>
			this.events.filterChange.attach(event);
		},

		onSortChange: function (event) {
			/// <summary>
			/// on sort change event, triggered when the grid sort changes
			/// </summary>
			/// <param name="event"></param>
			this.events.sortChange.attach(event);
		},

		onDataBinding: function (event) {
			/// <summary>
			/// databind event, triggered when the data is loaded
			/// </summary>
			/// <param name="event"></param>
			this.events.dataBinding.attach(event);
		},

		onDataBound: function (event) {
			/// <summary>
			/// databound event, triggered when the data is loaded
			/// </summary>
			/// <param name="event"></param>
			this.events.dataBound.attach(event);
		},

		onColumnShow: function (event) {
			/// <summary>
			/// Columns show event, triggered when the user show a column on the grid
			/// </summary>
			/// <param name="event">event to attach</param>
			this.events.columnShow.attach(event);
		},

		onColumnHide: function (event) {
			/// <summary>
			/// Columns hide event, triggered when the user hides a column on the grid
			/// </summary>
			/// <param name="event">event to attach</param>
			this.events.columnHide.attach(event);
		},
		//#endregion

		//#region design
		getColStyles: function (colId) {
			/// <summary>
			/// Return the column styling, required for kendo rowTemplates
			/// </summary>

			var style = 'style=';

			var cols = this._getColHash();
			if (cols && cols[colId] && cols[colId].hidden) {
				style += 'display:none;';
			}

			return style;
		},

		getRowTemplate: function () {
			/// <summary>
			/// return an item containing the row and altRow templates for the grid
			/// </summary>

			var rowTemplate = { row: '', altRow: '' };

			if (this.kendoGrid && this.kendoGrid.options) {
				rowTemplate.row = this.kendoGrid.options.rowTemplate;
				rowTemplate.altRow = this.kendoGrid.options.altRowTemplate;
			} else {
				rowTemplate.row = this.gridOptions.rowTemplate;
				rowTemplate.altRow = this.gridOptions.altRowTemplate;
			}

			return rowTemplate;
		},

		setRowTemplate: function (template) {
			/// <summary>
			/// set the template for the row
			/// </summary>
			/// <param name="row">row template</param>
			/// <param name="altRow">alt row template</param>

			var row = template.row;
			var altRow = template.altRow ? template.altRow : row;

			if (this.kendoGrid) {
				// invalidate the column list before re-rendering
				this.colsHash = null;
				this.kendoGrid.setOptions({
					rowTemplate: row,
					altRowTemplate: altRow
				});
			} else {
				this.gridOptions.rowTemplate = row;
				this.gridOptions.altRowTemplate = altRow;
			}
		},

		getHtmlBody: function () {
			/// <summary>
			/// Get the html body of the grid
			/// </summary>

			return this.$grid.find('tbody');
		},

		setPageSize: function (size) {
			/// <summary>
			/// set the page size for the grid
			/// </summary>
			/// <param name="size">new page size</param>

			if (this.kendoGrid) {
				this.kendoGrid.dataSource.pageSize(size);
			} else {
				this.gridOptions.dataSource.pageSize = size;
			}
		},
		//#endregion

		//#region columns
		getColumns: function () {
			/// <summary>
			/// Return an hashtable of all the grid columns by their data field.
			/// </summary>

			return this._getColHash();
		},

		getColumnsCount: function () {
			/// <summary>
			/// count and return the number of visible columns in the grid
			/// </summary>

			var columns = this.kendoGrid ? this.kendoGrid.columns : this.gridOptions.columns;
			if (!columns) {
				return 0;
			}
			var cpt = 0;
			for (var i = 0; i < columns.length; i++) {
				if (!columns[i].hidden) {
					cpt++;
				}
			}
			return cpt;
		},

		getColumnType: function (field) {
			/// <summary>
			/// return the column type (number/date/default) for the column
			/// </summary>

			return this._getColumnType(this.gridOptions, field);
		},

		showColumn: function (field) {
			/// <summary>
			/// Show the grid column
			/// </summary>
			/// <param name="field">column field to display</param>

			var columns = this._getColHash();

			var col = columns[field];
			if (!col) {
				return;
			}

			if (!this.kendoGrid) {
				var isTemplateGrid = this._isTemplateGrid();
				this._setColumnStartVisibility(col, true, isTemplateGrid);
			} else {
				try {
					//flag as user event before triggering the column change
					this.events.columnShow.flagAsUserEvent(true);
					this.kendoGrid.showColumn(field);
				} finally {
					this.events.columnShow.flagAsUserEvent(false);
				}
				this._toggleMinScreenWidth(col);
			}
		},

		hideColumn: function (field) {
			/// <summary>
			/// Hide the grid column
			/// </summary>
			/// <param name="field">column field to display</param>

			var columns = this._getColHash();

			var col = columns[field];
			if (!col) {
				return;
			}

			if (!this.kendoGrid) {
				var isTemplateGrid = this._isTemplateGrid();
				this._setColumnStartVisibility(col, false, isTemplateGrid);
			} else {
				try {
					//flag as user event before triggering the column change
					this.events.columnHide.flagAsUserEvent(true);
					this.kendoGrid.hideColumn(field);
				} finally {
					this.events.columnHide.flagAsUserEvent(false);
				}
				this._toggleMinScreenWidth(col);
			}
		},
		//#endregion

		//#region general
		getGuid: function () {
			/// <summary>
			/// Get the guid for the grid
			/// </summary>

			return this._getId();
		},

		refresh: function () {
			/// <summary>
			/// Refresh the grid
			/// </summary>

			if (this.kendoGrid) {
				this.kendoGrid.refresh();
			}
		}
		//#endregion
	};

	must.table.kendoGrid = function (container, gridOptions, customOptions) {
		/// <summary>
		/// KendoGrid init method, apply the must-specific options for the grid then display it using the kendo grid plugin.
		/// </summary>
		/// <param name='container'>grid container</param>
		/// <param name='gridOptions'>kendo options</param>
		/// <param name="customOptions">custom options</param>
		var $container = $(container);

		// create the must object
		var grid = new MustGrid($container, gridOptions, customOptions);

		//#region custom options

		if (!customOptions) {
			customOptions = {};
		}

		//TODO: disabled for now, to check with Julien
		//if (customOptions.minTemplates) {
		//	must.table.minTemplate.init($container, grid, customOptions); // enable responsive row templates
		//}

		if (customOptions.savePreferences) {
			must.table.userPrefs.init(grid); // enable user preferences
		}

		if (!customOptions.filterByMenu) {
			must.table.customFilter.init(grid, gridOptions); // activate inline filtering
		}

		if (customOptions.noData) {
			must.table.noData.init(grid, customOptions.noData); // manage no data on filter
		}

		if (!customOptions.hideColMenu) {
			must.table.colmenu.init($container, grid); // show the columns show/hide menu.
		}

		if (!customOptions.disableTrim) {
			must.table.trimFilters.init(grid); // trim filters for all grids
		}

		//add new options here..

		//#endregion

		//#region attach the must grid data and launch the kendo grid
		$container.data('mustGrid', grid);
		$container.kendoGrid(gridOptions);
		//#endregion

		return grid;
	};

}(this.must = this.must || {}));;
(function (must) {
	'use strict';
	/// <summary>
	/// Must table kendoGrid dataBind event
	/// </summary>

	must.table = must.table || {};
	must.table.kendoGrid = must.table.kendoGrid || {};
	must.table.kendoGrid.events = must.table.kendoGrid.events || {};

	must.table.kendoGrid.events.dataBind = (function () {

		var DataBindEvent = function (opt) {
			/// <summary>
			/// On Databind event. Attach the events to the grid.
			/// </summary>
			/// <param name="opt">event parameters</param>

			var attached = false,
				options = opt,

				_onBind = function (e) {
					/// <summary>
					/// On bind method, call the events
					/// </summary>
					/// <param name="e">event handler settings</param>

					options().$grid.trigger('gridDataBinding', e);
				},

				_attachEvent = function (event) {
					/// <summary>
					/// Attach the event to the event list
					/// </summary>
					/// <param name="event">event to add</param>

					options().$grid.on('gridDataBinding', function (e, kendoEvent) {
						event(kendoEvent);
					});
				},

				_initializeBeforeRender = function (gridOptions) {
					/// <summary>
					/// init the events if triggered before rendering the grid
					/// </summary>

					// ensure this is the only event
					if (gridOptions.dataBinding && gridOptions.dataBinding !== _onBind) {
						_attachEvent(gridOptions.dataBinding);
					}

					// attach
					gridOptions.dataBinding = _onBind;
				},

				_initializeAfterRender = function (kendoGrid) {
					/// <summary>
					/// init the events if triggered after rendering the grid
					/// </summary>

					kendoGrid.unbind('dataBind'); // ensure this is the only event

					// attach
					kendoGrid.bind('dataBind', _onBind);
				},

				_initialize = function () {
					/// <summary>
					/// attach the events to the grid
					/// </summary>

					if (attached) {
						return;
					}

					if (options().kendoGrid) {
						_initializeAfterRender(options().kendoGrid);
					} else {
						_initializeBeforeRender(options().gridOptions);
					}

					attached = true;
				},

				attach = function (event) {
					/// <summary>
					/// public method, attach the events to the grid.
					/// </summary>
					/// <param name="event"></param>
					/// <returns type=""></returns>

					_initialize();
					_attachEvent(event);
				};

			return { attach: attach };
		},

		init = function (options) {
			var event = new DataBindEvent(options);

			return event;
		};

		return { init: init };
	})();

}(this.must = this.must || {}));;
(function (must) {
	'use strict';
	/// <summary>
	/// Must table kendoGrid dataBound event
	/// </summary>

	must.table = must.table || {};
	must.table.kendoGrid = must.table.kendoGrid || {};
	must.table.kendoGrid.events = must.table.kendoGrid.events || {};

	must.table.kendoGrid.events.dataBound = (function () {

		var DataBoundEvent = function (opt) {
			/// <summary>
			/// On Databound event. Attach the events to the grid.
			/// </summary>
			/// <param name="opt">event parameters</param>

			var attached = false,
				options = opt,

				_onBound = function (e) {
					/// <summary>
					/// On bound method, call the events
					/// </summary>
					/// <param name="e">event handler settings</param>

					options().$grid.trigger('gridDataBound', e);
				},

				_attachEvent = function (event) {
					/// <summary>
					/// Attach the event to the event list
					/// </summary>
					/// <param name="event">event to add</param>

					options().$grid.on('gridDataBound', function (e, kendoEvent) {
						event(kendoEvent);
					});
				},

				_initializeBeforeRender = function (gridOptions) {
					/// <summary>
					/// init the events if triggered before rendering the grid
					/// </summary>

					// ensure this is the only event
					if (gridOptions.dataBound && gridOptions.dataBound !== _onBound) {
						_attachEvent(gridOptions.dataBound);
					}

					// attach
					gridOptions.dataBound = _onBound;
				},

				_initializeAfterRender = function (kendoGrid) {
					/// <summary>
					/// init the events if triggered after rendering the grid
					/// </summary>

					kendoGrid.unbind('dataBound'); // ensure this is the only event

					// attach
					kendoGrid.bind('dataBound', _onBound);
				},

				_initialize = function () {
					/// <summary>
					/// attach the events to the grid
					/// </summary>

					if (attached) {
						return;
					}

					if (options().kendoGrid) {
						_initializeAfterRender(options().kendoGrid);
					} else {
						_initializeBeforeRender(options().gridOptions);
					}

					attached = true;
				},

				attach = function (event) {
					/// <summary>
					/// public method, attach the events to the grid.
					/// </summary>
					/// <param name="event"></param>
					/// <returns type=""></returns>

					_initialize();
					_attachEvent(event);
				};

			return { attach: attach };
		},

		init = function (options) {
			var event = new DataBoundEvent(options);

			return event;
		};

		return { init: init };
	})();

}(this.must = this.must || {}));;
(function (must) {
	'use strict';
	/// <summary>
	/// Must table kendoGrid filter change event
	/// </summary>

	must.table = must.table || {};
	must.table.kendoGrid = must.table.kendoGrid || {};
	must.table.kendoGrid.events = must.table.kendoGrid.events || {};

	must.table.kendoGrid.events.filterChange = (function () {

		var FilterChangeEvent = function (opt) {
			/// <summary>
			/// On Filter Change event. Attach the events to the grid.
			/// </summary>
			/// <param name="opt">event parameters</param>

			var attached = false,
				options = opt,
				hasEvents = false,
				filterFunction = null,

				_onFilterChange = function () {
					/// <summary>
					/// Custom event method, override the default kendo filter
					/// </summary>

					// call the base method
					var result = filterFunction.apply(this, arguments);

					// trigger the events on change
					if (arguments.length > 0) {
						options().$grid.trigger('gridFilterChange');
					}

					return result;
				},

				bind = function (dataSource) {
					/// <summary>
					/// bind the filter to the datasource
					/// </summary>
					/// <param name="dataSource">datasource to bind</param>

					if (attached || !hasEvents) {
						return;
					}

					filterFunction = dataSource.filter;
					dataSource.filter = _onFilterChange;

					attached = true;
				},

				unbind = function (dataSource) {
					/// <summary>
					/// unbind the filter from the datasource and restore its defaults
					/// </summary>
					/// <param name="dataSource">bound datasource</param>

					if (!attached) {
						return;
					}

					dataSource.filter = filterFunction;
					filterFunction = null;

					attached = false;
				},

				attach = function (event) {
					/// <summary>
					/// public method, attach the events to the grid.
					/// </summary>
					/// <param name="event">event to attach</param>

					options().$grid.on('gridFilterChange', event);
					hasEvents = true;
				};

			return {
				attach: attach,
				bind: bind,
				unbind: unbind
			};
		},

		init = function (options) {
			var event = new FilterChangeEvent(options);

			return event;
		};

		return { init: init };
	})();

}(this.must = this.must || {}));;
(function (must) {
	'use strict';
	/// <summary>
	/// Must table kendoGrid sort change event
	/// </summary>

	must.table = must.table || {};
	must.table.kendoGrid = must.table.kendoGrid || {};
	must.table.kendoGrid.events = must.table.kendoGrid.events || {};

	must.table.kendoGrid.events.sortChange = (function () {

		var SortChangeEvent = function (opt) {
			/// <summary>
			/// On Sort Change event. Attach the events to the grid.
			/// </summary>
			/// <param name="opt">event parameters</param>

			var attached = false,
				options = opt,
				hasEvents = false,
				sortFunction = null,

				_onSortChange = function () {
					/// <summary>
					/// Custom event method, override the default kendo sort
					/// </summary>

					// call the base method
					var result = sortFunction.apply(this, arguments);

					// trigger the events on change
					if (arguments.length > 0) {
						options().$grid.trigger('gridSortChange');
					}

					return result;
				},

				bind = function (dataSource) {
					/// <summary>
					/// bind the sort to the datasource
					/// </summary>
					/// <param name="dataSource">datasource to bind</param>

					if (attached || !hasEvents) {
						return;
					}

					sortFunction = dataSource.sort;
					dataSource.sort = _onSortChange;

					attached = true;
				},

				unbind = function (dataSource) {
					/// <summary>
					/// unbind the sort from the datasource and restore its defaults
					/// </summary>
					/// <param name="dataSource">bound datasource</param>

					if (!attached) {
						return;
					}

					dataSource.sort = sortFunction;
					sortFunction = null;

					attached = false;
				},

				attach = function (event) {
					/// <summary>
					/// public method, attach the events to the grid.
					/// </summary>
					/// <param name="event">event to attach</param>

					options().$grid.on('gridSortChange', event);
					hasEvents = true;
				};

			return {
				attach: attach,
				bind: bind,
				unbind: unbind
			};
		},

		init = function (options) {
			var event = new SortChangeEvent(options);

			return event;
		};

		return { init: init };
	})();

}(this.must = this.must || {}));;
(function (must) {
	'use strict';
	/// <summary>
	/// Must table kendoGrid column show event
	/// </summary>

	must.table = must.table || {};
	must.table.kendoGrid = must.table.kendoGrid || {};
	must.table.kendoGrid.events = must.table.kendoGrid.events || {};

	must.table.kendoGrid.events.columnShow = (function () {

		var ColumnShowEvent = function (opt) {
			/// <summary>
			/// On Column Show event. Attach the events to the grid.
			/// </summary>
			/// <param name="opt">event parameters</param>

			var attached = false,
				options = opt,
				isUserEvent = false,

				_onShow = function (e) {
					/// <summary>
					/// On show column method, call the events
					/// </summary>
					/// <param name="e">event handler settings</param>

					options().$grid.trigger('gridColumnShow', e);
				},

				_attachEvent = function (event) {
					/// <summary>
					/// Attach the event to the event list
					/// </summary>
					/// <param name="event">event to add</param>

					options().$grid.on('gridColumnShow', function (e, kendoEvent) {
						event(kendoEvent.column, isUserEvent);
					});
				},

				_initializeBeforeRender = function (gridOptions) {
					/// <summary>
					/// init the events if triggered before rendering the grid
					/// </summary>

					// ensure this is the only event
					if (gridOptions.columnShow && gridOptions.columnShow !== _onShow) {
						_attachEvent(gridOptions.columnShow);
					}

					// attach
					gridOptions.columnShow = _onShow;
				},

				_initializeAfterRender = function (kendoGrid) {
					/// <summary>
					/// init the events if triggered after rendering the grid
					/// </summary>

					kendoGrid.unbind('columnShow'); // ensure this is the only event

					// attach
					kendoGrid.bind('columnShow', _onShow);
				},

				_initialize = function () {
					/// <summary>
					/// attach the events to the grid
					/// </summary>

					if (attached) {
						return;
					}

					if (options().kendoGrid) {
						_initializeAfterRender(options().kendoGrid);
					} else {
						_initializeBeforeRender(options().gridOptions);
					}

					attached = true;
				},

				flagAsUserEvent = function (isUser) {
					/// <summary>
					/// Mark as an user event
					/// </summary>
					/// <param name="isUser">is an user event flag</param>

					isUserEvent = isUser;
				},

				attach = function (event) {
					/// <summary>
					/// public method, attach the events to the grid.
					/// </summary>
					/// <param name="event">event to attach</param>

					_initialize();
					_attachEvent(event);
				};

			return {
				attach: attach,
				flagAsUserEvent: flagAsUserEvent
			};
		},

		init = function (options) {
			var event = new ColumnShowEvent(options);

			return event;
		};

		return { init: init };
	})();

}(this.must = this.must || {}));;
(function (must) {
	'use strict';
	/// <summary>
	/// Must table kendoGrid column hide event
	/// </summary>

	must.table = must.table || {};
	must.table.kendoGrid = must.table.kendoGrid || {};
	must.table.kendoGrid.events = must.table.kendoGrid.events || {};

	must.table.kendoGrid.events.columnHide = (function () {

		var ColumnHideEvent = function (opt) {
			/// <summary>
			/// On Column Hide event. Attach the events to the grid.
			/// </summary>
			/// <param name="opt">event parameters</param>

			var attached = false,
				options = opt,
				isUserEvent = false,

				_onHide = function (e) {
					/// <summary>
					/// On hide column method, call the events
					/// </summary>
					/// <param name="e">event handler settings</param>

					options().$grid.trigger('gridColumnHide', e);
				},

				_attachEvent = function (event) {
					/// <summary>
					/// Attach the event to the event list
					/// </summary>
					/// <param name="event">event to add</param>

					options().$grid.on('gridColumnHide', function (e, kendoEvent) {
						event(kendoEvent.column, isUserEvent);
					});
				},

				_initializeBeforeRender = function (gridOptions) {
					/// <summary>
					/// init the events if triggered before rendering the grid
					/// </summary>

					// ensure this is the only event
					if (gridOptions.columnHide && gridOptions.columnHide !== _onHide) {
						_attachEvent(gridOptions.columnHide);
					}

					// attach
					gridOptions.columnHide = _onHide;
				},

				_initializeAfterRender = function (kendoGrid) {
					/// <summary>
					/// init the events if triggered after rendering the grid
					/// </summary>

					kendoGrid.unbind('columnHide'); // ensure this is the only event

					// attach
					kendoGrid.bind('columnHide', _onHide);
				},

				_initialize = function () {
					/// <summary>
					/// attach the events to the grid
					/// </summary>

					if (attached) {
						return;
					}

					if (options().kendoGrid) {
						_initializeAfterRender(options().kendoGrid);
					} else {
						_initializeBeforeRender(options().gridOptions);
					}

					attached = true;
				},

				flagAsUserEvent = function (isUser) {
					/// <summary>
					/// Mark as an user event
					/// </summary>
					/// <param name="isUser">is an user event flag</param>

					isUserEvent = isUser;
				},

				attach = function (event) {
					/// <summary>
					/// public method, attach the events to the grid.
					/// </summary>
					/// <param name="event">event to attach</param>

					_initialize();
					_attachEvent(event);
				};

			return {
				attach: attach,
				flagAsUserEvent: flagAsUserEvent
			};
		},

		init = function (options) {
			var event = new ColumnHideEvent(options);

			return event;
		};

		return { init: init };
	})();

}(this.must = this.must || {}));;
(function (must) {
	'use strict';
	/// <summary>
	/// Must table kendoGrid custom filter menu events
	/// </summary>

	must.table = must.table || {};
	must.table.kendoGrid = must.table.kendoGrid || {};
	must.table.kendoGrid.events = must.table.kendoGrid.events || {};

	must.table.kendoGrid.events.filterMenu = (function () {

		var FilterMenu = function (opt) {
			/// <summary>
			/// Filter menu object, create the custom menu and attach its events
			/// </summary>
			var attached = false,
				options = opt,

			_createEvents = function (element, filterField) {
				/// <summary>
				/// Create the events for the element
				/// </summary>
				/// <param name="element">menu element</param>

				var $grid = options().$grid;

				var handler = element.data('handler');
				if (handler) {
					// attach kendo events
					handler.bind('change', function () {
						$grid.trigger('gridMenuChanged', element);
					});

					handler.bind('open', function () {
						$grid.trigger('gridMenuOpening', element);
					});

					handler.bind('close', function () {
						$grid.trigger('gridMenuClosing', element);
					});

				} else {
					//attach jquery events
					element.change(function () {
						$grid.trigger('gridMenuChanged', element);
					});
				}

				//trigger the on create event now
				$grid.trigger('gridMenuCreation', [element, filterField]);
			},

			_defaultMenuFilter = function (element, type) {
				/// <summary>
				/// Create a default menu if no custom menu is set
				/// </summary>
				/// <param name="element">input element</param>
				/// <param name="type">data type</param>

				switch (type) {
					case 'number':
						element.kendoNumericTextBox();
						break;
					case 'date':
						element.kendoDatePicker();
						break;
					default:
						$(element).addClass('k-textbox'); // default kendo input
						break;
				}
			},

			_defaultColMenuFilter = function (element, col, type) {
				_defaultMenuFilter(element, type);
			},

			_defaultColRowFilter = function (params, col, type) {
				_defaultMenuFilter(params.element, type);
			},

			_applyColMenuFilter = function (gridOptions, col, colType) {
				/// <summary>
				/// Decorate the column filter menu
				/// </summary>
				/// <param name='gridOptions'>kendo grid options</param>
				/// <param name='col'>column options</param>
				/// <param name='colType'>column type</param>

				if (!col.filterable) {
					return;
				}

				// create the decorator method
				var rootFc = col.filterable.ui;
				if (rootFc) {
					if (!$.isFunction(rootFc)) {
						throw 'Columns.Filterable.UI is not supported as STRING by this extension. Please use a function instead';
					}
				} else {
					rootFc = _defaultColMenuFilter;
				}

				// override the filter creation method
				col.filterable.ui = function (element) {
					rootFc(element, col, colType);
					_createEvents(element, col.filterField);
				};
			},

			_applyColRowFilter = function (gridOptions, col, colType) {
				/// <summary>
				/// Decorate the column filter row
				/// </summary>
				/// <param name='gridOptions'>kendo grid options</param>
				/// <param name='col'>column options</param>
				/// <param name='colType'>column type</param>

				if (!col.filterable) {
					return;
				}

				// create the cell option if it does not exists
				if (!col.filterable.cell) {
					col.filterable.cell = {};
				}

				// create the decorator method
				var rootFc = col.filterable.cell.template;
				if (rootFc) {
					if (!$.isFunction(rootFc)) {
						throw 'Columns.Filterable.Cell.Template is not supported as STRING by this extension. Please use a function instead';
					}
				} else {
					rootFc = _defaultColRowFilter;
				}

				// override the filter creation method
				col.filterable.cell.template = function (args) {
					rootFc(args, col, colType);
					_createEvents(args.element, col.filterField);
				};
			},

			_initialize = function () {
				var gridOptions = options().gridOptions;

				if (!gridOptions.filterable || !gridOptions.columns || gridOptions.columns.length === 0) {
					return;
				}

				// grid shortcuts
				var filterable = gridOptions.filterable;
				var columns = gridOptions.columns;
				var isMenuFilter = true;
				var isRowFilter = false;

				// determine the grid filter options
				if (filterable.mode && filterable.mode.length > 0) {
					if (filterable.mode.indexOf('row') >= 0) {
						isMenuFilter = false;
						isRowFilter = true;
					}
					if (filterable.mode.indexOf('menu') >= 0) {
						isMenuFilter = true;
					}
				}

				// get the shared method to calculate a column type from the gridOptions
				var getColumnType = options().getColTypeMethod;

				// create the methods for the menu filters
				for (var i = 0; i < columns.length; i++) {

					var col = columns[i];
					if (!col || !col.field) { // RQM 32256 col can be null on IE8
						continue;
					}

					var colType = getColumnType(gridOptions, col.field);
					if (col.filterable == null || col.filterable === true || col.filterable === 'true') {
						col.filterable = {};
					}

					// apply the menu filter is applicable
					if (isMenuFilter) {
						_applyColMenuFilter(gridOptions, col, colType);
					}

					// apply the row filter if applicable
					if (isRowFilter) {
						_applyColRowFilter(gridOptions, col, colType);
					}
				}
			},

			attachFilterCreate = function (event) {
				/// <summary>
				/// public method, attach the filter create event to the grid.
				/// </summary>
				/// <param name="event">event to attach</param>

				if (!attached) {
					_initialize();
					attached = true;
				}

				options().$grid.on('gridMenuCreation', function (e, element, filterField) {
					event(element, filterField);
				});
			},

			attachFilterBlur = function (event) {
				/// <summary>
				/// public method, attach the filterBlur event to the grid.
				/// </summary>
				/// <param name="event">event to attach</param>

				if (!attached) {
					_initialize();
					attached = true;
				}

				options().$grid.on('gridMenuChanged', function (e, element) {
					event(element);
				});
			},

			attachFilterOpen = function (event) {
				/// <summary>
				/// public method, attach the filterOpen event to the grid.
				/// </summary>
				/// <param name="event">event to attach</param>

				if (!attached) {
					_initialize();
					attached = true;
				}

				options().$grid.on('gridMenuOpening', function (e, element) {
					event(element);
				});
			},

			attachFilterClose = function (event) {
				/// <summary>
				/// public method, attach the filterClose event to the grid.
				/// </summary>
				/// <param name="event">event to attach</param>

				if (!attached) {
					_initialize();
					attached = true;
				}

				options().$grid.on('gridMenuClosing', function (e, element) {
					event(element);
				});
			};

			return {
				attachFilterCreate: attachFilterCreate,
				attachFilterBlur: attachFilterBlur,
				attachFilterOpen: attachFilterOpen,
				attachFilterClose: attachFilterClose
			};
		},

		init = function (options) {
			var event = new FilterMenu(options);

			return event;
		};

		return { init: init };
	})();

}(this.must = this.must || {}));;
(function (must) {
	must.table.colmenu = (function () {
		/// <summary>
		/// must table responsive template feature, change the grid template according to the window resolution
		/// </summary>

		var ColumnMenu = function (mustGrid, $htmlGrid) {
			var grid = mustGrid,
				buttons = {},

			_toggleColumn = function () {
				/// <summary>
				/// Toggle column event, show/hide the column matching the input
				/// </summary>

				var $this = $(this);
				var field = $this.val();

				if ($this.is(':checked')) {
					grid.showColumn(field);
                    $('.'+field).attr("hidden",false);   
                    var tds = $('.'+field).closest('tr').find('td');
                    for(var i = 0; i < tds.length; i++) {
                       tds[i].style.display="";
                    }
				} else {
					grid.hideColumn(field);
                    $('.'+field).attr("hidden",true);  
				}
			},

			//TODO: replace by templating?
			_createColMenu = function ($html, columns) {
				/// <summary>
				/// Create the column html menus.
				/// </summary>
				/// <param name="$html">html wrapper</param>
				/// <param name="columns">columns list</param>

				// create the html menu
				var $container = $('<div class="jq-dd-list-container"><ul /></div>');
                var $menuWrapper = $('<div class="right display_page_dd jq-dropdown jq-dd-secondary xs-is-half" />');
				var $menuBtn = $('<p class="jq-dd-action-link-container"><a class="" href="#your-inner-display"><i aria-hidden="true" class="icon">z</i> ' + must.resources.table_action_display + ' <i aria-hidden="true" class="icon jq-select-arrow">,</i></a></p>');

				// create the html items
				var $menu = $container.find('ul');

				$.each(columns, function (field, column) {
					if (!column.persistent) {
						var $toggle = $('<li><input type="checkbox" name="toggle-cols" id="toggle-' + field + '" value="' + field + '" /> <label for="toggle-' + field + '">' + column.title + '</label></li>');
			    			var $input = $toggle.find('input');

						$input.attr('checked', !column.hidden);
						$input.change(_toggleColumn);

						if (!column.hidden) {
                            $('.'+field).attr("hidden",false);  
							$toggle.addClass('checked');
						}
                        else{
                         $('.'+field).attr("hidden",true);  
                         }

						$menu.append($toggle);
						buttons[field] = $toggle;
					}

				});

				// append the menu to the grid
				$menuWrapper.append($menuBtn).append($container);
				$html.before($menuWrapper);
			},

			_updateColumnMenu = function (column, visible) {
				/// <summary>
				/// Update the column menu when a show/hide event occurs.
				/// </summary>
				/// <param name="column">toggled column</param>
				/// <param name="visible">new state for the column</param>

				var $toggle = buttons[column.field];

				if ($toggle) {
					var $input = $toggle.find('input');
					$input.prop('checked', visible);

					if (visible) {
						$toggle.addClass('checked');
					} else {
						$toggle.removeClass('checked');
					}
				}
			},

			_showEvent = function (column) {
				/// <summary>
				/// column show event. Update the menu.
				/// </summary>
				/// <param name="column"></param>

				_updateColumnMenu(column, true);
			},

			_hideEvent = function (column) {
				/// <summary>
				/// column hide event. Update the menu.
				/// </summary>
				/// <param name="column"></param>

				_updateColumnMenu(column, false);
			},

			_init = function ($html) {
				/// <summary>
				/// Initialization method, create the column menu and bind the events
				/// </summary>
				/// <param name="$html">container for the grid</param>

				var columns = grid.getColumns();
				_createColMenu($html, columns);

				grid.onColumnShow(_showEvent);
				grid.onColumnHide(_hideEvent);
			};

			_init($htmlGrid);
		},

		init = function ($container, mustGrid) {
			/// <summary>
			/// Create the column toggle menu and attach it to the grid
			/// </summary>
			/// <param name="$container">grid container</param>
			/// <param name="mustGrid">mustGrid item</param>
			/// <returns type="">ColumnMenu</returns>

			// When a .mod isn't tall enough and has a dropdown, latter will be cut by overflow: hidden on .mod
			var $mod = $container.closest('.mod');
			if ($mod) {
				$mod.addClass('has-k-data-table');
			}

			var $html = $($container.parent());
			var result = new ColumnMenu(mustGrid, $html);
			return result;
		};

		return { init: init };

	}());
}(this.must = this.must || {}));;
(function (must) {
	must.table.customFilter = (function () {

		var gridDataSource = null,

		_hideHtmlTags = function (element) {
			/// <summary>
			/// Hide html in filter menus (grids created from html tables)
			/// TODO: Remove html-first kendo tables from MUST then remove the method
			/// </summary>
			/// <param name="element">input to parse</param>

			var handler = $(element).data('handler');
			if (!handler) {
				return;
			}

			var value = handler.value();
			if (typeof value !== 'string') {
				return;
			}

			var parsedValue = $('<span>' + value + '</span>').text(); // remove html tags (display).
			handler.value(parsedValue);
		},

		_addPopupClass = function (element) {
			/// <summary>
			/// Add a custom class to style popups inside grid filters
			/// </summary>
			/// <param name="element">element to style</param>

			var handler = $(element).data('handler');
			if (!handler || !handler.popup || !handler.popup.element) {
				return;
			}

			handler.popup.element.addClass('is-in-filter');
		},

		_applyCustomFilter = function (element, filterField) {
			/// <summary>
			/// Change the column filter to target another custom filter (fix for dates with time)
			/// </summary>
			/// <param name="element">element</param>
			/// <param name="filterField">filter to target</param>

			if (!filterField) {
				return;
			}

			var $filterItem = $(element).closest('.k-filtercell');
			if (!$filterItem) {
				return;
			}

			var filterCell = $filterItem.data('kendoFilterCell');
			if (filterCell && filterCell.options) {
				filterCell.options.field = filterField;
			}
		},

		_preventSubmit = function (element) {
			/// <summary>
			/// prevent submit for the inputs filters
			/// </summary>
			/// <param name="element">input element</param>

			$(element).on('keyup keypress', function (e) {

				var code = e.keyCode || e.which;
				if (code === 13) {
					e.preventDefault();
					return false;
				}

				return true;
			});
		},

		_isFilterableCol = function (col) {
			/// <summary>
			/// return true iif the column is filterable
			/// </summary>

			if (!col || !col.field) {
				return false;
			}

			// create the filterable option if it does not exists
			if (col.filterable == null || col.filterable === true || col.filterable === 'true') {
				col.filterable = {};
			}

			return col.filterable;
		},

		_uniqueData = function(items, dataTextField) {     
			/// <summary>
			/// retrieve the data for the filter dataSource and filter duplicates values.
			/// </summary>

			var getter = kendo.getter(dataTextField, true);
			var result = [],
				index = 0,
				seen = {};

			while (index < items.length) {
				var item = items[index++],
					text = getter(item);

				if(!seen.hasOwnProperty(text)){
					result.push(item);
					seen[text] = true;
				}
			}

			return result;
		},

		_createFilterDataSource = function(field) {
			/// <summary>
			/// create a custom dataSource for the autocomplete filter.
			/// TODO: To rework after Kendo 2016 Q3 release (see RTC 102056 for details).
			/// </summary>

			return {
				transport: {
					read: function (options) {
						var data = gridDataSource.data().toJSON();
						options.success(_uniqueData(data, field));
					}
				}
			};
		},

		_rowTemplate = function (params, col, type) {
			/// <summary>
			/// Default filter function, set the element ui according for columns filters.
			/// </summary>
			/// <param name='params'>caller method params</param>
			/// <param name='col'>column</param>
			/// <param name='type'>column type</param>

			var element = params.element;

			//IMPORTANT: do not add events here, use the kendogrid.events.filterMenu
			switch (type) {

				case 'number':
					// init numeric settings
					var opt = {};
					if (!col.isDecimal) {
						opt = {
							min: 0,
							format: '#'
						};
					}

					element.kendoNumericTextBox(opt);
					break;

				case 'date':
					element.kendoDatePicker();
					break;

				default:
					var dataSource = _createFilterDataSource(col.field);

					element.kendoAutoComplete({
						dataSource: dataSource,
						dataTextField: col.field,
						valuePrimitive: true,
						filter: 'contains',
						template: '#:$("<span>" +' + col.field + ' + "</span>").text()#' // remove html tags (dropdown list). // TODO: Remove html-first kendo tables from MUST then remove the template
					});
					break;
			}
		},

		_updateDataSource = function (e) {
			/// <summary>
			/// Grid Databind event, update the stored datasource with its latest value.
			/// </summary>

			gridDataSource = e.sender.dataSource;
		},

		_initRowTemplate = function (col) {
			/// <summary>
			/// Add the template method to the filtered row
			/// </summary>
			/// <param name="col">column to init</param>

			// create the filterable option if it does not exists
			if (col.filterable === true) {
				col.filterable = {};
			}
			if (!col.filterable.cell) {
				col.filterable.cell = {};
			}
			if (!col.filterable.cell.dataSource) {
				col.filterable.cell.dataSource = {};
			}

			// apply the template
			col.filterable.cell.template = _rowTemplate;

		},

		_initFilterHeader = function (col, mustGrid) {
			/// <summary>
			/// Add custom classes for filtered columns
			/// </summary>

			var $htmlHead = col.$htmlHead;
			if ($htmlHead) {
				$htmlHead.addClass('is-filter-cell');

				var colType = mustGrid.getColumnType(col.field);
				switch (colType) {
					case 'number':
						$htmlHead.addClass('is-filter-numeric');
						break;
					case 'date':
						$htmlHead.addClass('is-filter-date');
						break;
					default:
						break;
				}
			}
		},

		init = function (mustGrid, gridOptions) {

			if (!gridOptions.filterable || !gridOptions.columns) {
				return;
			}

			if (gridOptions.filterable === true) {
				// must.table should be intialized before must.table.kendogrid
				gridOptions.filterable = must.table.filterable();
			}

			// activate inline edit
			gridOptions.filterable.mode = 'row';

			var columns = gridOptions.columns;
			for (var i = 0; i < columns.length; i++) {

				var col = columns[i];
				if (!_isFilterableCol(col)) {
					continue;
				}

				// set a grid template
				_initRowTemplate(col);

				// add a css class to the column headers with filters
				_initFilterHeader(col, mustGrid);
			}

			// attach the events
			mustGrid.onFilterCreate(_preventSubmit);
			mustGrid.onFilterCreate(_applyCustomFilter);
			mustGrid.onFilterOpen(_addPopupClass);
			mustGrid.onFilterBlur(_hideHtmlTags);
			mustGrid.onDataBinding(_updateDataSource);

			// save a ref to the get datasource method.
			gridDataSource = mustGrid.getDataSource();
		};

		return { init: init };

	}());
}(this.must = this.must || {}));;
(function (must) {
	must.table.trimFilters = (function () {
		var _trimFilter = function (element) {
			/// <summary>
			/// Trim the filter field on blur to prevent searching for empty spaces
			/// </summary>
			/// <param name='element'>kendo field to trim</param>

			var $field = $(element);

			var trimmed = $.trim($field.val());
			$field.val(trimmed);
		},

		init = function (mustGrid) {

			// map the filter blur event
			mustGrid.onFilterBlur(_trimFilter);
		};

		return { init: init };

	}());
}(this.must = this.must || {}));;
(function (must) {
	must.table.userPrefs = (function () {
		/// <summary>
		/// must table user preference, save the user filters and sort options and restore them at page load
		/// </summary>

		var UserPreferences = function (storageKey, mustGrid) {

			var key = storageKey,
				grid = mustGrid,

			_getToggledColumns = function () {
				/// <summary>
				/// Get the list of the columns toggled by the user
				/// </summary>

				var toggled = {};

				var windowWidth = $(window).width();
				var columns = grid.getColumns();

				$.each(columns, function (field, column) {
					var isHidden = column.hidden;
					if (isHidden == null) {
						isHidden = false;
					}

					var minWidth = column.minScreenWidth ? column.minScreenWidth : column.dumMinScreenWidth;

					var defaultHidden = minWidth ? (windowWidth < minWidth) : column.defaultHidden;

					if (defaultHidden !== isHidden) {
						toggled[field] = !isHidden;
					}
				});

				return toggled;
			},

			_toggleColumns = function (toggled) {
				/// <summary>
				/// Show/hide the columns according to the stored user preferences
				/// </summary>
				/// <param name="toggled">user preferences</param>

				$.each(toggled, function (column, visible) {
					if (visible) {
						grid.showColumn(column);
					} else {
						grid.hideColumn(column);
					}
				});
			},

            _cleanFilters = function(filter) {
                /// <summary>
                /// Remove the tags from the filter values (html-first grids)
                /// TODO: Remove html-first kendo tables from MUST then remove the method
                /// </summary>

                var filters = filter.filters;
                if (!filters) {
                    return;
                }

                // loop and clear filters
                for (var i = 0; i < filters.length; i++) {

                    var filterItem = filters[i];
                    if (!filterItem.value || typeof filterItem.value !== 'string') {
                        continue;
                    }

                    filterItem.value = $('<span>' + filterItem.value + '</span>').text(); // remove html tags
                }
            },

			_createStorageItem = function () {
				/// <summary>
				/// Create a local storage item to save the user preferences for the grid
				/// </summary>
				/// <returns type="">return null if there are no customs on the page</returns>

				var userGrid = {};

				// create the grid options item
				if (grid) {
					
					// sort
					var sort = grid.getSort();
					if (sort && sort.length > 0) {
						userGrid.sort = sort;
					}

					//filter
					var filter = grid.getFilter();
					if (filter) {
					    _cleanFilters(filter);
						userGrid.filter = filter;
					}

					// visible columns
					var toggledColumns = _getToggledColumns();
					if (!$.isEmptyObject(toggledColumns)) {
						userGrid.toggledColumns = toggledColumns;
					}
				}

				// do not return an item if there is no custom on the page
				if ($.isEmptyObject(userGrid)) {
					return null;
				}

				// create the local storage item that will contain the data
				return new must.storage.LocalStorageItem({
					key: key,
					data: userGrid,
					expirationDate: new Date(2099, 0)
				});
			},

			_saveUserGrid = function () {
				/// <summary>
				/// get the current user grid options and save them to the localstorage
				/// </summary>
				/// <param name="toggledColumns">columns toggled by the user</param>

				var gridStorage = _createStorageItem();

				if (gridStorage) {
					must.storage.setLocalStorageItem(gridStorage);
				} else {
					must.storage.removeItem(key);
				}
			},

			_loadUserGrid = function () {
				/// <summary>
				/// Load the user grid optoons from the local storage and apply them to the grid
				/// </summary>

				must.storage.getLocalStorageData({
					key: key,
					async: false,
					onsuccess: function (userGrid) {

						// apply the filters
						if (userGrid) {
							if (userGrid.sort) {
								grid.setSort(userGrid.sort);
							}
							if (userGrid.filter) {
								grid.setFilter(userGrid.filter);
							}
							if (userGrid.toggledColumns) {
								_toggleColumns(userGrid.toggledColumns);
							}
						}
					}
				});
			},

			_onColumnToggle = function (column, isUserEvent) {
				/// <summary>
				/// On column toggle event, 
				/// </summary>
				/// <param name="column">toggled column</param>
				/// <param name="isUserEvent">true iif the event was triggered by the user (=not a resize event)</param>

				if (isUserEvent) {
					_saveUserGrid();
				}
			},

			_init = function () {
				// load the saved user options
				_loadUserGrid();

				// map the event handlers
				grid.onFilterChange(_saveUserGrid);
				grid.onSortChange(_saveUserGrid);
				grid.onColumnShow(_onColumnToggle);
				grid.onColumnHide(_onColumnToggle);
			};

			_init();
		},

		purgePreferences = function(gridGuid) {
			var key = 'gridFilters-' + gridGuid;

			must.storage.removeItemsByKey(key);
		},

		init = function (mustGrid) {

			// create the local storage key
			var key = 'gridFilters-' + mustGrid.getGuid();

			//create the userpreferences item
			var result = new UserPreferences(key, mustGrid);
			return result;
		};

		return {
			init: init,
			purgePreferences: purgePreferences
		};

	}());
}(this.must = this.must || {}));

;
(function (must) {
	must.table.minTemplate = (function () {
		/// <summary>
		/// must table responsive template feature, change the grid template according to the window resolution
		/// </summary>

		var ResponsiveTemplate = function (mustGrid, gridTemplates, $html) {
			var templates = gridTemplates,
				current = null,
				grid = mustGrid,
				$container = $html,

			_applyStyles = function () {
				/// <summary>
				/// Apply custom styles if a template with a maximum width is enabled
				/// </summary>

				if (current.maxWidth) {
					$container.addClass('k-grid-enhanced');
					$container.parent().find('.display_page_dd').addClass('visually-hidden');
				} else {
					$container.removeClass('k-grid-enhanced');
					$container.parent().find('.display_page_dd').removeClass('visually-hidden');
				}
			},

			_getTemplate = function (templates) {
				/// <summary>
				/// Find the first template matching the current resolution
				/// </summary>
				/// <param name="templates">template list</param>

				var windowWidth = $(window).width();

				var i = 0;
				while (i < templates.length
					&& templates[i].maxWidth
					&& templates[i].maxWidth <= windowWidth) {
					i++;
				}

				return templates[i];
			},

			_updateTemplate = function () {
				/// <summary>
				/// Check and update the current kendo template if necessary
				/// </summary>

				var newTemplate = _getTemplate(templates);

				if (current !== newTemplate) {
					current = newTemplate;
					grid.setRowTemplate(current);

					_applyStyles();
				}
			},

			_init = function () {
				current = grid.getRowTemplate();
				templates.push(current);

				_updateTemplate();
				$(window).resize(must.throttle.debounce(_updateTemplate, 50, false));
			};

			_init();
		},

		init = function ($container, mustGrid, customOptions) {
			/// <summary>
			/// Create and return the Responsive template item used to change the grid template dynamically
			/// </summary>
			/// <param name="$container">grid container</param>
			/// <param name="mustGrid">must grid</param>
			/// <param name="customOptions">custom must options</param>
			/// <returns type="">ResponsiveTemplate</returns>

			var $html = null;

			// get the grid parent
			if (customOptions.$gridContainer) {
				$html = customOptions.$gridContainer;
			} else {
				$html = $container;
			}

			// get the responsive templates
			var templates = customOptions.minTemplates;

			// then create the responsive template item
			var result = new ResponsiveTemplate(mustGrid, templates, $html);
			return result;
		};

		return { init: init };

	}());
}(this.must = this.must || {}));;
(function (must) {
	must.table.noData = (function () {

		var gridDataBound = function (grid, msgNoData) {

			var msg = msgNoData;

			if (grid.getCount() === 0) {
				var colCount = grid.getColumnsCount();
				$(grid.getHtmlBody()).html('<tr class="kendo-data-row"><td colspan="' + colCount + '" class="no-data">' + msg + '</td></tr>');
			}
		};

		var privateInit = function (mustGrid, msgNoData) {
			mustGrid.onDataBound(function () {
				gridDataBound(mustGrid, msgNoData);
			});
			mustGrid.onColumnShow(function () {
				gridDataBound(mustGrid, msgNoData);
			});
			mustGrid.onColumnHide(function () {
				gridDataBound(mustGrid, msgNoData);
			});
		};

		return { init: privateInit };

	}());
}(this.must = this.must || {}));;
(function (must) {
	must.favorite = (function () {
		var favoriteType,
			apiUri,

		/**
		* toggle and upadate favorite icon raw
		* @param  {undefined} [type] - undefined
		* @param  {string} [uri] - route url
		* @param  {bool} [single] - true
		* @param  {DOM element} [element] - current DOM element to init
		*/
		init = function (type, uri, single, element) {
			favoriteType = type;
			apiUri = uri;

			var target = element !== undefined ? $(element) : $('[data-favoritebutton]');

			if (single) {
				target.on('click', function () {
					var newText, newValue, element = $(this);
					if (element.data('value')) {
						newValue = false;
						newText = '0';
					}
					else {
						newValue = true;
						newText = '*';
					}
					addordelete(element, function () {
						// error callback handler
						var msgError, oldText, oldValue;
						if (newText === '0') {
							msgError = must.resources.msg_err_try_to_remove + ' ' + element.data('reference') + ' ' + must.resources.msg_err_as_favorite + '.';
							oldValue = true;
							oldText = '*';
						}
						else {
							msgError = must.resources.msg_err_try_to_add + ' ' + element.data('reference') + ' ' + must.resources.msg_err_as_favorite + '.';
							oldText = '0';
							oldValue = false;
						}
						must.message.show(msgError);
						element.find('i').text(oldText);
						element.data('value', oldValue);
						updateElementTitle(element, oldValue);
					});
					element.find('i').text(newText);
					element.data('value', newValue);
					updateElementTitle(element, newValue);
				});
			}
		},

		// manage title attribute check/uncheck favorite link
		updateElementTitle = function (element, isFavorite) {
			var str = element.data('webreference') !== null ? element.data('webreference') : element.data('reference');

			if (isFavorite) {
				element.prop('title', str + ' ' + must.resources.table_action_title_unmark_as_favorite);
				element.find('.visually-hidden').text(str + ' ' + must.resources.table_action_title_unmark_as_favorite);
			}
			else {
				element.prop('title', str + ' ' + must.resources.table_action_title_mark_as_favorite);
				element.find('.visually-hidden').text(str + ' ' + must.resources.table_action_title_mark_as_favorite);
			}
		},

		addordelete = function (element, errorCallback) {
			// if toggle fav then remove all fav items form localstorage
			if ('localStorage' in window && null !== localStorage) {
				var data = localStorage.getItem('must-scene');
				if (data !== null) {
					data = JSON.parse(data);
					for (var key in data) {
						if (data[key].hasOwnProperty('cacheRemove') && data[key].cacheRemove === 'fav') {
							delete data[key];
						}
					}
					localStorage.setItem('must-scene', JSON.stringify(data));
				}

				// clear all cache for dashboard
				must.views.clearCache();
			}

			if (element.data('type')) {
				favoriteType = element.data('type');
			}

			$.ajax({
				type: 'POST',
				url: apiUri,
				data: { TypeFavorite: favoriteType, WebReference: element.data('webreference'), Reference: element.data('reference') },
				success: function (data) {
					if (data !== true) {
						if (errorCallback && typeof (errorCallback) === 'function') {
							errorCallback();
						}
					}
				},
				error: function () {
					if (errorCallback && typeof (errorCallback) === 'function') {
						errorCallback();
					}
				}
			});
		},

		updateKendoTable = function (dataSource, ref, webref, text) {
			var item;
			if (ref.length) {
				item = dataSource.get(ref);
			}
			else {
				item = dataSource.get(webref);
			}
			item.set('Favorite', text);
		},

		addordeleteKendoTable = function (element, dataSource) {
			var newText;

			if (element.data('value')) {
				newText = '0';
			}
			else {
				newText = '*';
			}

			// call server
			addordelete(element, function () {
				// error callback handler
				var msgError, oldText;
				if (newText === '0') {
					msgError = must.resources.msg_err_try_to_remove + ' ' + element.data('reference') + ' ' + must.resources.msg_err_as_favorite + '.';
					oldText = '*';
				}
				else {
					msgError = must.resources.msg_err_try_to_add + ' ' + element.data('reference') + ' ' + must.resources.msg_err_as_favorite + '.';
					oldText = '0';
				}
				must.message.show(msgError);
				updateKendoTable(dataSource, element.data('reference'), element.data('webreference'), oldText);
			});

			// update datasource
			updateKendoTable(dataSource, element.data('reference'), element.data('webreference'), newText);
		};

		return {
			init: init,
			addordelete: addordelete,
			addordeleteKendoTable: addordeleteKendoTable
		};
	}());
}(this.must = this.must || {}));;
(function (must) {
	must.favorite2018 = (function () {
		var favoriteType,
			apiUri,

			/**
			* toggle and upadate favorite icon raw
			* @param  {undefined} [type] - undefined
			* @param  {string} [uri] - route url
			* @param  {bool} [single] - true
			* @param  {DOM element} [element] - current DOM element to init
			*/
			init = function (type, uri, single, element) {
				favoriteType = type;
				apiUri = uri;

				var target = element !== undefined ? $(element) : $('[data-favoriteCheck]');

				if (single) {
					target.on('click', function () {
						var newText, newValue, element = $(this);
						addordelete(element, function () {
							// error callback handler
							var msgError;
							if (element.context.checked === true) {
								msgError = must.resources.msg_err_try_to_remove + ' ' + must.resources.msg_err_as_favorite + '.';
							}
							else {
								msgError = must.resources.msg_err_try_to_add + ' ' + must.resources.msg_err_as_favorite + '.';
							}
							must.message.show(msgError);
							updateElementTitle(element);
						});
						updateElementTitle(element);
					});
				}
			},

			// manage title attribute check/uncheck favorite link
			updateElementTitle = function (element) {
				if (element.context.checked) {
					element.context.parentElement.title = must.resources.table_action_title_unmark_as_favorite;
				}
				else {
					element.context.parentElement.title = must.resources.table_action_title_mark_as_favorite;
				}
			},

			addordelete = function (element, errorCallback) {
				// if toggle fav then remove all fav items form localstorage
				if ('localStorage' in window && null !== localStorage) {
					var data = localStorage.getItem('must-scene');
					if (data !== null) {
						data = JSON.parse(data);
						for (var key in data) {
							if (data[key].hasOwnProperty('cacheRemove') && data[key].cacheRemove === 'fav') {
								delete data[key];
							}
						}
						localStorage.setItem('must-scene', JSON.stringify(data));
					}

					// clear all cache for dashboard
					must.views.clearCache();
				}

				if (element.data('type')) {
					favoriteType = element.data('type');
				}

				$.ajax({
					type: 'POST',
					url: apiUri,
					data: { TypeFavorite: favoriteType, WebReference: element.data('webreference'), Reference: element.data('reference') },
					success: function (data) {
						if (data !== true) {
							if (errorCallback && typeof (errorCallback) === 'function') {
								errorCallback();
							}
						}
					},
					error: function () {
						if (errorCallback && typeof (errorCallback) === 'function') {
							errorCallback();
						}
					}
				});
			};

		return {
			init: init,
			addordelete: addordelete
		};
	}());
}(this.must = this.must || {}));;
(function (must) {
	must.saveitem = (function () {
		var saveItemType,
		$element,
		apiUri,
		init = function (type, selectorId) {
			saveItemType = type;
			$element = $("#" + selectorId);
			apiUri = $element.attr("href");
			$element.on('click', function (event) {
				saveItem($element, function () {
					must.message.show($element.data('msgerr'));
				});
				event.preventDefault();
			});
		},
		saveItem = function (element, errorCallback) {
			$.ajax({
				type: 'POST',
				url: apiUri,
				data: { SavedItemTypeValue: saveItemType, Key: element.data('key'), Value: element.data('value') },
				success: function (data) {
					must.message.show(element.data('msginfo'), 2);
				},
				error: function () {
					if (errorCallback && typeof (errorCallback) === 'function') {
						errorCallback();
					}
				}
			});
		};
		return {
			init: init
		};
	}());
}(this.must = this.must || {}));;
(function (must) {
	must.validation = (function () {
		/// <summary>
		/// Must validation namespace, apply must-specific settings to the jquey validation
		/// </summary>

		//#region private
		var self = {
			getKendoWrapper: function (element) {
				/// <summary>
				/// Get the wrapper from the kendo element
				/// </summary>

				if (!element) {
					return null;
				}

				// get the handler
				var handler = $(element).data('handler');
				if (!handler) {
					return null;
				}

				// get the wrapper
				return handler.wrapper;
			},

			onHighlight: function (element) {
				/// <summary>
				/// On hightlight event, paint the element when the validation fails
				/// </summary>

				// apply a custom class to kendo wrappers
				var kendoWrapper = self.getKendoWrapper(element);
				if (kendoWrapper) {
					$(kendoWrapper).addClass('k-wrapper-invalid');
				}
			},

			onUnHighlight: function (element) {
				/// <summary>
				/// On Un-hightlight event, paint the element when the validation succeeds
				/// </summary>

				// apply a custom class to kendo wrappers
				var kendoWrapper = self.getKendoWrapper(element);
				if (kendoWrapper) {
					$(kendoWrapper).removeClass('k-wrapper-invalid');
				}
			},

			applyEvent: function (settings, eventName, event) {
				/// <summary>
				/// Apply the event to the settings
				/// </summary>

				var rootEvt = settings[eventName];
				settings[eventName] = function (element, errorClass, validClass) {

					event.call(this, element, errorClass, validClass);	// call the event

					// preserve the base action
					if (rootEvt) {
						rootEvt.call(this, element, errorClass, validClass);
					}
				};
			}
		},
		//#endregion

		//#region public
		//TODO: Should be a private method
		attachEvents = function (form) {
			/// <summary>
			/// attach the must custom events to the jQuery validation
			/// </summary>

			// get the validator
			var validator = $(form).data('validator');
			if (!validator || !validator.settings) {
				return;
			}

			// attach the events
			self.applyEvent(validator.settings, 'highlight', self.onHighlight);
			self.applyEvent(validator.settings, 'unhighlight', self.onUnHighlight);
		},

		init = function () {

			// attach the custom validation events to the jquery validate plugin
			var forms = $('form');
			$.each(forms, function () {
				attachEvents(this);
			});
		};

		return {
			init: init,
			attachEvents: attachEvents
		};
		//#endregion

	}());
}(this.must = this.must || {}));;
(function (must) {
	'use strict';

	must.selectviews = function () {
		
		var privateInit = function (options) {

			var o = options || {},
				idBase = o.idSelectBase || 'views',
				uriNewView = o.uriNewView || '#',
				selectBase = $('#' + idBase);

			if ($(selectBase).length) {
                    if (window.screen.width<768)
                          {var output = '<div class="showing_dd w230p jq-dropdown xs-w260p"><p class="jq-dd-action-link-container font-arial mt0">';}
                    else
                          {var output = '<div class="showing_dd w200p jq-dropdown xs-w260p"><p class="jq-dd-action-link-container font-arial mt0">';}
				
				output += '<a href="#your-choice"><i aria-hidden="true" class="icon small-hidden">' + $(selectBase).find('option:selected').data('icon') + '</i><i class="icon blue1 small-visible" aria-hidden="true">¤</i><span>' + $(selectBase).find('option:selected').text() + '</span> <i aria-hidden="true" class="icon jq-select-arrow small-hidden">,</i></a>';
				output += '</p><div class="jq-dd-list-container"><ul id="your-choice">';

				$(selectBase).find('option').each(function (i) {
					var customIcon = $(this).data('icon'),
						className = '';
					if ($(this).attr('selected')) {
						className = 'selected';
					}
					else {
						className = '';
					}
					output += '<li class="' + className + '"><a class="showing-choices k-link" data-index="' + i + '" href="#choice' + i + '"><i aria-hidden="true" class="icon">' + customIcon + '</i> ' + $(this).text() + '</a></li>';
				});

                if ($(selectBase).find('option.custom').length < 10 && uriNewView !== '#') {
                    output += '<li class="italic bd-top"><a href="' + uriNewView + '"><i aria-hidden="true" class="icon">+</i>' + must.resources.selectview_create_new_view + '</a></li>';
				}
				output += '</ul></div></div>';

				$(selectBase).after(output);

				$('.showing_dd .jq-dd-list-container').on('click', 'a.showing-choices', function () {
					var $prevSelect = $(this).closest('.showing_dd').prev('select'),
						$lineHtml = $(this).html();
					$prevSelect.find('option').removeAttr('selected');
					$prevSelect.find('option:eq(' + ($(this).data('index')) + ')').prop('selected', true);

					$(this).closest('ul').find('li').removeClass('selected');
					$(this).closest('li').addClass('selected');
					$(this).closest('.showing_dd').find('.jq-dd-action-link-container a').html($lineHtml + '<i class="icon jq-select-arrow" aria-hidden="true">,</i>');

					must.menu.collapseActionList(this);
					$prevSelect.trigger('change');
					return false;
				});

				$(selectBase).hide();
			}
		};

		return {
			init: privateInit
		};
	};
}(this.must = this.must || {}));;
/* global kendo */
(function (must) {
    must.views = (function () {
        /** Running queries / last queries */
        var templateQuery = null,
            dataQuery = null;

        var self = this;
        self.consoleEnabled = true;

        var consoleTrace = function (value) {
            if (self.consoleEnabled && window.console) {
                console.info(value);
            }
        };

        var display = function (options, viewName, externalData, callback, lsOptions) {
            var o = options || {},
                templateUri = o.templateUri,
                showCounter = (typeof o.showCounter === 'boolean') ? o.showCounter : true,
                dataUri = o.dataUri,
                autobind = (typeof o.autobind === 'boolean') ? o.autobind : true,
                dataBinding = o.dataBinding || {},
                tableElement = o.tableElement,
                globalContainerElement = o.globalContainerElement || 'contTable',
                tableContainerElement = o.tableContainerElement || 'items',
                refId = o.refId || 'Id',
                displayPageSize = o.displayPageSize || must.table.defaultPagination,
                isGroupable = o.groupable || false,
                countersTemplate = o.countersTemplate || 'countersTemplate',
                countersContainerElement = o.countersContainerElement || 'countersItems',
                scriptTemplate = (o.tableTemplateElement) ? kendo.template($('#' + o.tableTemplateElement).html()) : kendo.template($('#tableTemplate').html()),
                loadingTemplate = (o.loadingTemplateElement) ? kendo.template($('#' + o.loadingTemplateElement).html()) : kendo.template($('#loadingTemplate').html()),
                errorTemplate = (o.errorTemplateElement) ? kendo.template($('#' + o.errorTemplateElement).html()) : kendo.template($('#errorTemplate').html()),
                noresultTemplate = (o.noresultTemplateElement) ? kendo.template($('#' + o.noresultTemplateElement).html()) : kendo.template($('#noresultTemplate').html()),

                //RTC-121637-INV- [Invoice Dashboard] - Number of invoice displayed
                isPageable = o.pageable || false,
                isScrollable = o.scrollable || false,
                pagerSizes = o.pagerSizes,
                msgNoData = o.msgNoData || 'No Data';

            // LocalStorage options
            var lso = lsOptions || {},
                cacheByDashboard = (typeof lso.cacheEnable === 'boolean') ? lso.cacheEnable : false, // check if cache is enable on the dashboard
                keyLS = lso.key, // key from the dashboard
                ttlLS = lso.ttl, // ttl in minutes
                varyByDashViewLS = (typeof lso.varyByDashView === 'boolean') ? lso.varyByDashView : false, //
                varyByUrl = (typeof lso.varyByUrl === 'boolean') ? lso.varyByUrl : false, // manage filters dashboard from url
                hashUserIdLS = lso.hashUserId, // userid from model
                updateCurrentViewUri = lso.updateCurrentViewUri, // to update the currentview
                viewIdLS = lso.viewId, // current view id
                hashUrl = lso.hashUrl; // current filter used from url

            var start = new Date().getTime();

            var processData = function (viewData, template, dataTableModel) {
                if (viewData.Data.length) {
                    $('#' + globalContainerElement).html(scriptTemplate({}));
                    $('#' + tableElement).append(template.HeadTemplate);

                    externalData.dataSource = new kendo.data.DataSource({
                        data: viewData.Data,
                        pageSize: displayPageSize,
                        schema: {
                            model: dataTableModel
                        }
                    });

                    var responsive = must.table.responsive;
                    if (window.screen.width >= 1024)
                    {
                        for (var col = 0; col < template.Columns.length; col++) {
                            template.Columns[col].minScreenWidth = responsive.minimal;
                        }
                    }
                    else {
                        for (var col = 0; col < template.Columns.length; col++) {
                            template.Columns[col].minScreenWidth = null;
                        }

                    }

                    must.table.kendoGrid('#' + tableElement, {
                        // kendo options
                        columns: template.Columns,
                        dataSource: externalData.dataSource,
                        sortable: true,
                        groupable: isGroupable ? must.table.groupable() : false,

                        //RTC-121637-INV- [Invoice Dashboard] - Number of invoice displayed
                        pageable: isPageable ? {
                           alwaysVisible: true,
                            pageSizes: pagerSizes
                        }: must.table.pageable(),
                        navigatable: true,
                        filterable: must.table.filterable(),
                        //scrollable: isScrollable ? true : must.table.pageable(),
                        scrollable:false,
                        rowTemplate: $.proxy(kendo.template(template.RowTemplate.replace('k-alt', '')), externalData.dataSource),
                        altRowTemplate: $.proxy(kendo.template(template.RowTemplate), externalData.dataSource),
                        autobind: autobind
                    }, {
                            // custom options
                            savePreferences: true,
                            noData: msgNoData,
                            $gridContainer: $('#' + globalContainerElement),
                            minTemplates: [{ row: template.SmallRowTemplate, maxWidth: 700 }]
                        });

                    must.table.init(tableElement, {
                        containerId: tableContainerElement,
                        isKendoTable: true
                    });

                    if (showCounter) {
                        var counterTemplate = kendo.template($('#' + countersTemplate).html()),
                            counterLength = viewData.Counters.length,
                            currentTemplate = counterTemplate;
                        for (var j = 0; j < counterLength; j = j + 1) {
                            if (j % 2 === 1) {
                                currentTemplate = kendo.template($('#' + countersTemplate).html().replace('col-1-2 ', 'col-1-2 col-last col-contains-border '));
                            }
                            $('#' + countersContainerElement).append(currentTemplate(viewData.Counters[j]));
                        }
                    }

                    // Track load time
                    var stop = new Date().getTime();
                    must.tracktime.addEvent('Dashboard', viewName, stop - start, undefined, true);

                    if (callback && typeof (callback) === 'function') {
                        callback();
                    }
                }
                else {
                    $('#' + globalContainerElement).html(noresultTemplate({}));
                }
            };

            $('#' + globalContainerElement).html(loadingTemplate({ ViewName: viewName }));

            if (templateQuery) {
                templateQuery.abort();
            }
            if (dataQuery) {
                dataQuery.abort();
            }

            var $waitingMessages = $('.loading-data-news > div'),
                interval = 10000,
                autoPlay = true,
                currentSlide = 0;

            var nextMessage = function () {
                if (autoPlay && currentSlide <= $waitingMessages.length) {
                    var currentHeight = $($waitingMessages[currentSlide]).outerHeight();
                    var nextSlide = (currentSlide + 1) % $waitingMessages.length;

                    $($waitingMessages[currentSlide]).animate({ top: '-=' + currentHeight + 'px' }, function () {
                        $($waitingMessages[currentSlide]).hide();

                        var newElementHeight = $($waitingMessages[nextSlide]).outerHeight();
                        $($waitingMessages[nextSlide])
                            .css('top', newElementHeight + 'px')
                            .fadeIn({ duration: 400, queue: false })
                            .animate({ top: '-=' + newElementHeight + 'px' });

                        currentSlide = nextSlide;
                    });

                    setTimeout(nextMessage, interval);
                }
            };

            //#region Start Waiting Messages animation
            if ($waitingMessages.length) {
                setTimeout(function () {
                    $($waitingMessages[currentSlide]).fadeIn();
                    setTimeout(nextMessage, interval);
                }, 300);
            }
            //#endregion

			/** 
			* use data and template to display kendo dashboard
			*/
            var renderDashboard = function (data, template) {
                // stop animated messages
                autoPlay = false;

                var dataTableModel = kendo.data.Model.define({
                    id: refId,
                    fields: template.Fields
                });

                processData(data, template, dataTableModel);
            };

			/** 
			* call ajax to get data and template
			*/
            var getDataFromServer = function () {
                templateQuery = $.getJSON(templateUri);
                dataQuery = $.getJSON(dataUri);

                $.when(dataQuery, templateQuery)
                    .done(function (data, template) {
                        var cacheManager = must.views.cache({ cacheEnabled: cacheByDashboard, consoleEnabled: self.consoleEnabled });
                        if (cacheManager && cacheManager.isCacheEnabled()) {
                            // Update LocalStorage
                            var cacheItem = new cacheManager.dashCacheItem({
                                key: keyLS,
                                ttl: ttlLS,
                                dashData: data[0],
                                dashStruct: template[0],
                                varyByDashView: varyByDashViewLS,
                                varyByUrl: varyByUrl,
                                hashUserId: hashUserIdLS,
                                viewId: viewIdLS,
                                hashUrl: hashUrl
                            });
                            cacheManager.setItem(cacheItem);
                        }

                        renderDashboard(data[0], template[0]);
                    })
                    .fail(function (data, template) {
                        if (data.statusText !== 'abort') {
                            $('#' + globalContainerElement).html(errorTemplate({}));
                        }
                    });
            };

            // get data to display dashboard
            var cacheManager = must.views.cache({ cacheEnabled: cacheByDashboard, consoleEnabled: self.consoleEnabled });
            if (cacheManager && cacheManager.isCacheEnabled() && cacheByDashboard) {
                try {
                    // try to get dashData and dashStruct
                    cacheManager.getItem({
                        key: keyLS,
                        hashUserId: hashUserIdLS,
                        varyByDashView: varyByDashViewLS,
                        varyByUrl: varyByUrl,
                        viewId: viewIdLS,
                        hashUrl: hashUrl,
                        onCacheComplete: function (response) {
                            // if data from cache => render
                            if (response && response.isInCache && updateCurrentViewUri) {
                                $.ajax({
                                    type: 'POST',
                                    url: updateCurrentViewUri, // 'booking/update-currentview',
                                    data: { id: viewIdLS },
                                    success: function () {
                                        consoleTrace('LS');
                                        renderDashboard(response.dashData, response.dashStruct);
                                    },
                                    error: function () {
                                        consoleTrace('Server');
                                        getDataFromServer();
                                    }
                                });
                            }
                            else {
                                consoleTrace('Server');
                                getDataFromServer();
                            }
                        }
                    });
                } catch (e) {
                    consoleTrace('LS Exception ' + e);
                    getDataFromServer();
                }
            }
            else {
                consoleTrace('LS Disabled');
                getDataFromServer();
            }
        };

		/**
		* clear local cache views for specficied key
		*/
        var privateClearCache = function (lsOptions) {
            // LocalStorage options
            var lso = lsOptions || {},
                cacheByDashboard = (typeof lso.cacheEnable === 'boolean') ? lso.cacheEnable : true, // check if cache is enable on the dashboard
                keyLS = lso.key, // key from the dashboard ('bkg', 'si', 'shp')
                viewId = lso.viewId,
                varyByDashView = (typeof lso.varyByDashView === 'boolean') ? lso.varyByDashView : false;

            if (varyByDashView && viewId) {
                keyLS = keyLS + '|' + viewId;
            }

            var cacheManager = must.views.cache({ cacheEnabled: cacheByDashboard });
            if (cacheManager && cacheManager.isCacheEnabled()) {
                cacheManager.deleteAllDashCacheItems(keyLS);
            }
        };

        return {
            display: display,
            clearCache: privateClearCache
        };
    }());
}(this.must = this.must || {}));;
(function (must) {
	'use strict';

	must.views = must.views || {};

	// className
	must.views.cache = function (options) {
		var self = this;

		var defaults = {
			cacheEnabled: false,
			consoleEnabled: false
		};
		var settings = $.extend({}, defaults, options);

		// 
		self.cacheEnabled = (typeof settings.cacheEnabled === 'boolean') ? settings.cacheEnabled : false;
		self.consoleEnabled = (typeof settings.consoleEnabled === 'boolean') ? settings.consoleEnabled : false;

		self.separator = '|';
		self.prefix = 'must' + self.separator + 'dashboard' + self.separator;
		self.culture = $('html').attr('lang');

		var consoleTrace = function (value) {
			if (self.consoleEnabled && window.console) {
				console.info(value);
			}
		};

		var privateIsCacheEnabled = function () {
			return self.cacheEnabled;
		};

		/**
		* Object to setup the cache
		*/
		var PrivateDashCacheItem = function (options) {
			var defaults = {
				key: null, // Dashboard suffix (bkg, shp, si)
				ttl: 30, // time in minutes
				dashData: null, // data from ajax call dashboard-data
				dashStruct: null, // data from ajax call kendo-template
				varyByUserId: true, // true to enable, you have define hashUserId
				varyByDashView: false, // true to enable, you have define viewId
				varyByUrl: false, // true to enable, you have to define hashUrl
				hashUserId: null, // ccgid hash
				viewId: null, // current view id
				hashUrl: null,
				onCacheComplete: null, // method called after getItem
				debug: false // or self.consoleEnabled
			};

			this.culture = self.culture;

			var settings = $.extend({}, defaults, options);

			// calculate expiration date from TTL
			if (settings.ttl) {
				this.expirationDate = must.date.addSec(settings.ttl * 60);
			}

			// check args before sending query
			var isValid = true;
			if (!settings.key) {
				consoleTrace('LS error no key specified');
				isValid = false;
			}
			if (settings.varyByUserId && !settings.hashUserId) {
				consoleTrace('LS error no hashUserId specified');
				isValid = false;
			}
			if (settings.varyByDashView && !settings.viewId) {
				consoleTrace('LS error no viewId specified');
				isValid = false;
			}

			// to know if the object is valid and ready to use local storage
			this.isValid = isValid;

			// Mapping
			this.key = settings.key;
			this.ttl = settings.ttl;
			this.dashData = settings.dashData;
			this.dashStruct = settings.dashStruct;
			this.varyByUserId = settings.varyByUserId;
			this.varyByDashView = settings.varyByDashView;
			this.varyByUrl = settings.varyByUrl;
			this.hashUserId = settings.hashUserId;
			this.viewId = settings.viewId;
			this.hashUrl = settings.hashUrl;
			this.onCacheComplete = settings.onCacheComplete;

			// method called on localstorage callback
			this.onsuccess = function (response) { onCacheSuccess.call(this, response); };
		};

		/**
		* private method to know if the parameter is valid
		*/
		var checkFilterParam = function (allowedFilterParams, filterParam) {
			var exist = false;

			if (allowedFilterParams && allowedFilterParams.length > 0 && filterParam) {
				// check if filterParam is in allowedFilterParams
				for (var i = 0; i < allowedFilterParams.length; i++) {
					if (allowedFilterParams[i] === filterParam) {
						exist = true;
						break;
					}
				}
			}
			return exist;
		};

		/**
		* private method to check if data from localstorage are the same as asked. If not we consider data not in cache.
		*/
		var checkCacheValidity = function (response) {

			consoleTrace('LS loaded successfully, check data');

			var isInCache = true;

			if (response) {
				if (this.culture !== response.culture) {
					consoleTrace('LS check culture not OK');
					isInCache = false;
				}

				// Test Data
				if (this.hashUserId !== response.hashUserId) {
					consoleTrace('LS check hashUserId not OK');
					isInCache = false;
				}

				if (this.viewId !== response.viewId) {
					consoleTrace('LS check view not OK');
					isInCache = false;
				}

				if (this.hashUrl !== response.hashUrl) {
					consoleTrace('LS check hashUrl not OK');
					isInCache = false;
				}

				if (response) {
					response.isInCache = isInCache;
				}
			}
		};

		/**
		* private method to check data from cache success and send response
		*/
		var onCacheSuccess = function (response) {

			if (this && response) {
				checkCacheValidity.call(this, response);
			}

			// call complete method to send response
			this.onCacheComplete(response);
		};

		/**
		* call cache and send data
		*/
		var privateGetItem = function (args) {

			var cacheItem = null;
			if (self.cacheEnabled && args) {

				// Create an item object and check parameters
				if (args instanceof PrivateDashCacheItem) {
					cacheItem = args;
				}
				else if (args.key) {
					cacheItem = new PrivateDashCacheItem(args);
				}

				if (cacheItem && cacheItem.isValid) {

					// prepare key
					cacheItem.key = getKey(cacheItem);

					// try to call LocalStorage, response is in onsuccess method
					must.storage.getLocalStorageData(cacheItem);
				}
				else {
					cacheItem.onCacheComplete({
						response: { isInCache: false }
					});
				}
			}
			else {
				cacheItem.onCacheComplete({
					response: { isInCache: false }
				});
			}
		};

		/**
		* save the data in cache
		*/
		var privateSetItem = function (privateDashCacheItem) {

			// create LocalStorageItem with a key and data
			if (self.cacheEnabled && privateDashCacheItem && privateDashCacheItem.isValid) {
				var item = new must.storage.LocalStorageItem({
					key: getKey(privateDashCacheItem),
					data: {
						dashData: privateDashCacheItem.dashData,
						dashStruct: privateDashCacheItem.dashStruct,
						hashUserId: privateDashCacheItem.hashUserId,
						viewId: privateDashCacheItem.viewId,
						culture: privateDashCacheItem.culture,
						hashUrl: privateDashCacheItem.hashUrl
					},
					expirationDate: privateDashCacheItem.expirationDate
				});

				must.storage.setLocalStorageItem(item);

				consoleTrace('LS cached ' + item.key + ' until ' + privateDashCacheItem.expirationDate);
			}
		};

		// Delete Cache (for all, for a dashboard ?)
		var privateDeleteAllDashCacheItems = function (key) {
			var newKey = getKeyPrefix(key);
			must.storage.removeItemsByKey(newKey);

			consoleTrace('LS cleared ' + newKey);
		};

		// TODO: Delete a row from the cache (delete draft) ?
		var privateDeleteDashCacheItemByRef = function (key, reference) {

			if (self.cacheEnabled) {
				// get avalaible keys
				if (key && reference) {
					var newKey = getKeyPrefix(key);
					var keys = must.storage.getKeys();

					var cacheItem = null;
					cacheItem = {};
					cacheItem.onsuccess = function (response) {
						// get data
						if (response) {
							//console.log(response.key)
						}
						// TODO: find and remove row

						// TODO: set in ls
					};

					for (var i = 0; i < keys.length; i++) {
						// get items from cache
						if (cacheItem) {
							cacheItem.key = keys[i];
							// try to call LocalStorage, response is in onsuccess method
							must.storage.getLocalStorageData(cacheItem);
						}
					}
				}
			}
		};

		// TODO: Update cache for favorites ?

		/**
		* private method to create a prefix key for cache
		*/
		var getKeyPrefix = function (key) {
			if (key) {
				return self.prefix + key;
			} else {
				return self.prefix;
			}
		};

		/**
		* private method to create a key for cache from a privateDashCacheItem object
		*/
		var getKey = function (item) {

			var newKey = getKeyPrefix(item.key);

			// if view specified
			if (item.varyByDashView && item.viewId) {
				newKey = newKey + self.separator + item.viewId;
			}

			// if param from url specified
			if (item.varyByUrl && item.hashUrl) {
				newKey = newKey + self.separator + item.hashUrl;
			}

			return newKey;
		};

		// Public interface
		//e.g. must.namespace.className().init()
		return {
			dashCacheItem: PrivateDashCacheItem,
			getItem: privateGetItem,
			setItem: privateSetItem,
			isCacheEnabled: privateIsCacheEnabled,
			deleteAllDashCacheItems: privateDeleteAllDashCacheItems
		};
	};
}(this.must = this.must || {}));;
(function (must) {
	must.checkbox = (function () {
		var init = function (options) {
			var o = options || {},
				callBack = o.callBack;
				checkAllId = o.checkAllId || 'ch-all';

			$(document).on('click', '#' + checkAllId, function () {
				var parentIsChecked = ($(this).attr('checked') === 'checked');
				$('[data-type="tablecheckbox"]').each(function () {
					$(this).attr('checked', parentIsChecked);
					if (parentIsChecked) {
						$(this).siblings('.jq-click-check').addClass('checked');
					}
					else {
						$(this).siblings('.jq-click-check').removeClass('checked');
					}
				});

				if (callBack && typeof (callBack) === 'function') {
					callBack();
				}
			});

			$(document).on('click', '[data-type="tablecheckbox"]', function () {
				if ($('[data-type="tablecheckbox"]:checked').length === $('[data-type="tablecheckbox"]').length) {
					$('#' + checkAllId).prop('checked', true);
				}
				else {
					$('#' + checkAllId).prop('checked', false);
				}

				if (callBack && typeof (callBack) === 'function') {
					callBack();
				}
			});
		},

		resetCheckAll = function (options) {
			var o = options || {},
				checkAllId = o.checkAllId || 'ch-all',
				itemsContainer = o.itemsContainer || 'items';

			$('#' + checkAllId).attr('checked', false);
			$('#' + itemsContainer + ' td.checkbox, #' + itemsContainer + ' th.checkbox').each(function () {
				$(this).find('.jq-click-check').removeClass('checked');
			});
		};

		return {
			init: init,
			resetCheckAll: resetCheckAll
		};
	}());
}(this.must = this.must || {}));;
(function (must) {
	must.dropdown = (function () {
		var addOrRemoveDropdownLegend = function () {
			$('.jq-dropdown').each(function () {
				var $dd = $(this);
				if ($dd.hasClass('jq-dd-disabled')) {
					$dd.find('.jq-select-arrow').before('<span class="visually-hidden">' + must.resources.label_sdisabled + '</span>');
				} else {
					$dd.find('.visually-hidden').remove();
				}
			});

			return false;
		}

		return {
			addOrRemoveDropdownLegend: addOrRemoveDropdownLegend
		};
	}());
}(this.must = this.must || {}));;
(function (must) {
	must.taskControllerUri;
	must.removeJobUrl;
	must.progressBar = (function () {
		var GaugeBar = GaugeBar || {};
		var taskControllerUri;
		var timeoutId;

		//Init the progressbar
		var init = function () {
			taskStatust = {};
			GaugeBar.generate = function (data, viewModel) {
				if (typeof (data.PercentComplete) != "number")
					return;
				if (data.PercentComplete > 100 || data.PercentComplete < 0)
					return;
				viewModel.update(data);
				return;
			};
		};

		//Call the server to get the status of the given task and refresh the progress bar
		//callback to the client if the job is done
		var refreshProgressBar = function (taskId, viewModel, containerId, dlCallBack, refreshInterval, completeCallback) {
			var postData = { jobId: taskId };
			$.ajax({
				type: "POST",
				url: must.taskControllerUri,
				data: postData,
				success: function (data) {
					GaugeBar.generate(data, viewModel);
					if (data.PercentComplete == 100 && typeof (dlCallBack) === 'function') {
						dlCallBack(taskId, containerId, completeCallback);
					}
					else if (data.PercentComplete == -1) {
						//todo : resource error
					}
					else {
						timeoutId = setTimeout(function () { refreshProgressBar(taskId, viewModel, containerId, dlCallBack, refreshInterval, completeCallback); }, refreshInterval);
					}
				},
				error: function (xhr, ajaxOptions, thrownError) {
					must.message.show(ajaxOptions);
				},
				dataType: "json",
				traditional: true
			});

		};

		//Launch the progressbar
		var updateGaugeBar = function (taskId, viewModel, containerId, dlCallBack, refreshInterval, completeCallback, errorMessage) {

			errorMessage = errorMessage || 'an error occured';

			if (taskId !== '') {
				timeoutId = setTimeout(function () { refreshProgressBar(taskId, viewModel, containerId, dlCallBack, refreshInterval, completeCallback); }, refreshInterval);
			}
			else {
				viewModel.percentComplete(100);
				viewModel.totalItems(0);
				$("#" + containerId).html(errorMessage
                    //todo : resource error
                );
			}
		};

		var stopRefresh = function ()
		{
			clearTimeout(timeoutId);
		};

		return {
			init: init,
			updateGaugeBar: updateGaugeBar,
			stopRefresh: stopRefresh
		};
	}());

}(this.must = this.must || {}));


;
(function (must) {
    must.corporate = (function () {
        // Tabs
        var MUSTtabs = function() {
            var tabsWrappers = document.querySelectorAll(".tabs-wrapper");
            for (var w = 0; w < tabsWrappers.length; ++w) {
              let wrapper = tabsWrappers[w];
              // store tabs variable
              let myTabs = wrapper.querySelectorAll(".tabs-list > li");
          
              function myTabClicks(tabClickEvent) {
                for (var i = 0; i < myTabs.length; i++) {
                  myTabs[i].classList.remove("active");
                }
                var clickedTab = tabClickEvent.currentTarget;
                clickedTab.classList.add("active");
                tabClickEvent.preventDefault();
                var myContentPanes = wrapper.querySelectorAll(".tab-pane");
                for (i = 0; i < myContentPanes.length; i++) {
                  myContentPanes[i].classList.remove("active");
                }
                var anchorReference = clickedTab.getElementsByTagName('a')[0];
                var activePaneId = anchorReference.getAttribute("href");
                var activePane = wrapper.querySelector(activePaneId);
                activePane.classList.add("active");
              }
              for (i = 0; i < myTabs.length; i++) {
                myTabs[i].addEventListener("click", myTabClicks)
              }
            }
          };

        // Collpase / Expand
        var MUSTcollapseexpand = function() {
            $('.jq-banner').on('click', function (e) {
            var elToggle = $(this);
            var elTarget = $(elToggle.parent().get(0));
            for (var i = 0; i < elTarget.context.childNodes.length; i++) {
                if (elTarget.context.childNodes[i].className == "content") {
                elTarget = $(elTarget.context.childNodes[i]);
                break;
                }
            }
            elTarget = $(elTarget.children().get(1));
            var elToggleIcon = elToggle.find('.expand');
            elTarget.stop(false, true).slideToggle(300, function () {});
            if (elTarget.hasClass('to-open')) {
                elTarget.removeClass('to-open').addClass('to-close');
                elToggleIcon.parent().removeClass('prev-open').addClass('prev-close');
            } else if (elTarget.hasClass('to-close')) {
                elTarget.removeClass('to-close').addClass('to-open');
                elToggleIcon.parent().removeClass('prev-close').addClass('prev-open');
            }
            return false;
            });
        };
        
        // multi-form slider, handles swipe, carousel...
        var MUSTmslider = function() {

            const defaultBreakpoint = 760;
          
            var sliders = $('.mslider');
          
            sliders.each(function() {
              var slider = $(this);
              var slides = slider.find('.slide-entry');
              var slideCount = slides.length;
              if (slideCount > 0) {
                var dots;
                //get breakpoint
                var breakpoint = parseInt(slider.attr('data-swipebreakpoint')) || defaultBreakpoint;
                var windowbreakpoint = 0;
                if (slider[0].hasAttribute('data-swipewindowbreakpoint')) {
                  windowbreakpoint = parseInt(slider.attr('data-swipewindowbreakpoint'));
                }
          
                var currentSlide = slides.filter('.active').index();
                if (currentSlide == -1) {
                  currentSlide = 0;
                  slides.first().addClass('active');
                }
          
                var isCarousel = slider.hasClass("mslider-carousel");
                var isSwiper = slider.hasClass("mslider-swipe");
          
                //slider-dots
                if (isCarousel) {
                  let dots_container = $('<div class="mslider-dots" />');
                  let dots_list = $('<ol />')
                  let dotsHtml = '';
                  let i;
                  for (i = 0; i < slideCount; i++) {
                    dotsHtml += '<li class="mslider-dot"><a></a></li>';
                  }
                  dots = $(dotsHtml);
                  dots_list.append(dots)
                  dots_container.append(dots_list.append(dots));
                  slider.append(dots_container.append(dots_list.append(dots)));
                }
          
                //slide-nav
                var prevArrow = slider.find('.prev-slide');
                var nextArrow = slider.find('.next-slide');
                var initialX = null;
                var initialY = null;
          
                var originalHeightAttr;
                var swipeModeActive = false;
                var carouselModeActive = false;
          
          
                function enterSwipeMode() {
                  if ((isSwiper) && (!swipeModeActive)) {
                    swipeModeActive = true;
                    originalHeightAttr = slider.attr('height');
                    slider.addClass("mslider-swipe-active");
                    slider.removeClass("mslider-carousel-active");
                  }
                }
          
                function leaveSwipeMode() {
                  if (swipeModeActive) {
                    slider.removeClass("mslider-swipe-active");
                    if (originalHeightAttr == undefined) {
                      slider.css('height', '')
                    } else {
                      slider.attr('height', originalHeightAttr);
                    }
                    swipeModeActive = false;
                  }
                }
          
                function enterCarouselMode() {
                  if ((isCarousel) && (!carouselModeActive)) {
                    carouselModeActive = true;
                    originalHeightAttr = slider.attr('height');
                    slider.addClass("mslider-carousel-active");
                  }
                }
          
                function leaveCarouselMode() {
                  if (carouselModeActive) {
                    slider.removeClass("mslider-carousel-active");
                    if (originalHeightAttr == undefined) {
                      slider.css('height', '')
                    } else {
                      slider.attr('height', originalHeightAttr);
                    }
                    carouselModeActive = false;
                  }
                }
          
                function getSliderHeight() {
                  var height = 0;
                  if (carouselModeActive) {
                    //get highest of visible cards
                    for (var i=Math.max(0,currentSlide-1); i<Math.min(slideCount,currentSlide+2); i++)
                    {
                      height = Math.max(height, slides.eq(i).outerHeight(false));
                    }
                  } else if (swipeModeActive) {
                    height = slides.eq(currentSlide).outerHeight(false);
                  }
                  return height;
                }
          
                slides.on('transitionend', function () {
                  if (carouselModeActive || swipeModeActive)
                    slider.height(getSliderHeight());
                });
          
                function moveToSlide(n) {
                  if ((n >= 0) && (n < slideCount)) {
                    slides.removeClass('active-left');
                    slides.removeClass('active-right');
                    slides.removeClass('active');
                    slides.removeClass('left');
                    slides.removeClass('right');
          
                    if (isCarousel) {
                      dots.removeClass('active');
                      dots.eq(n).addClass("active");
                    }
          
                    var newSlide = slides.eq(n);
                    slides.each(function(index) {
                      className = '';
                      if (index < (n - 1)) {
                        className = 'left';
                      } else if (index == (n - 1)) {
                        className = 'active-left';
                      } else if (index == n) {
                        className = 'active';
                      } else if (index == (n + 1)) {
                        className = 'active-right';
                      } else {
                        className = 'right';
                      }
                      $(this).addClass(className);
                    });
          
                    //update arrows
                    prevArrow.prop("disabled", (n == 0));
                    nextArrow.prop("disabled", (n == (slideCount - 1)));
                    currentSlide = n;
                    //update height (swiper mode & carousel mode)
                    if (swipeModeActive || carouselModeActive) {
                      slider.height(getSliderHeight());
                    }
          
                  }
                }
          
                function nextSlide() {
                  moveToSlide(currentSlide + 1);
                };
          
                function prevSlide() {
                  moveToSlide(currentSlide - 1);
                };
          
                if (isCarousel) {
                  dots.click(function() {
                    moveToSlide(dots.index($(this)));
                    return false;
                  });
                }
          
                // Detect swipe events for touch devices, credit to Kirupa @ https://www.kirupa.com/html5/detecting_touch_swipe_gestures.htm
                function startTouch(e) {
                  initialX = e.originalEvent.touches[0].clientX;
                  initialY = e.originalEvent.touches[0].clientY;
                };
          
                function moveTouch(e) {
                  if (initialX === null) {
                    return;
                  }
                  if (initialY === null) {
                    return;
                  }
                  var currentX = e.originalEvent.touches[0].clientX;
                  var currentY = e.originalEvent.touches[0].clientY;
                  var diffX = initialX - currentX;
                  var diffY = initialY - currentY;
                  if (Math.abs(diffX) > Math.abs(diffY)) {
                    if (diffX > 5) {
                      // swiped left
                      moveToSlide(currentSlide + 1);
                    } else if (diffX < -5) {
                      // swiped right
                      moveToSlide(currentSlide - 1);
                    }
                  }
                  initialX = null;
                  initialY = null;
                  e.preventDefault();
                };
                slider.on("touchstart", startTouch);
                slider.on("touchmove", moveTouch);
          
                function isAboveBreakpoint() {
                  var above = (slider.parent().width() > breakpoint);
                  if (windowbreakpoint != 0) {
                    above &= (window.innerWidth > windowbreakpoint);
                  }
                  return above;
                }
          
                var aboveBreakpoint = isAboveBreakpoint();
          
                function onBreakpointChange() {
                  if (aboveBreakpoint) {
                    if (swipeModeActive) {
                      leaveSwipeMode();
                    }
                    if (isCarousel) {
                      enterCarouselMode();
                    }
                  } else {
                    if (carouselModeActive) {
                      leaveCarouselMode();
                    }
                    if (isSwiper) {
                      enterSwipeMode();
                    }
                  }
                }
          
                $(window).resize(function() {
                  if (isAboveBreakpoint()) {
                    if (!aboveBreakpoint) {
                      aboveBreakpoint = true;
                      onBreakpointChange()
                    }
                  } else {
          
                    if (aboveBreakpoint) {
                      aboveBreakpoint = false;
                      onBreakpointChange();
                    }
                  }
          
                  //resize slider if in carousel or swiper
                  if (swipeModeActive || carouselModeActive) {
                    slider.height(getSliderHeight());
                  }
                });

                  $(function () {
                      //resize slider if in carousel or swiper
                      if (swipeModeActive || carouselModeActive) {
                          slider.height(getSliderHeight());
                      }
                  });

                //initialize with currentSlide
                prevArrow.click(prevSlide);
                nextArrow.click(nextSlide);
          
                onBreakpointChange();
                moveToSlide(currentSlide);
          
              }
            });
          };

        var MUSTscroller = function() {
            var loadJS = function(url, implementationCode, location){
                //url is URL of external file, implementationCode is the code
                //to be called from the file, location is the location to
                //insert the <script> element
        
                var scriptTag = document.createElement('script');
                scriptTag.src = url;
        
                scriptTag.onload = implementationCode;
                scriptTag.onreadystatechange = implementationCode;
        
                location.appendChild(scriptTag);
            };
        
            function initScrollers() {
            var scrollers = $('.scrollbar-outer');
            scrollers.each(function() {
                var scroller = $(this);
                function onScroll(scrolly, scrollx) {
                var scroller_wrapper = scroller.parent();
                var scroller_x_visible = scroller_wrapper.find('.scroll-x').first().hasClass('scroll-scrollx_visible');
                var scroller_y_visible = scroller_wrapper.find('.scroll-y').first().hasClass('scroll-scrolly_visible');
                scroller_wrapper.toggleClass("scrolled_left", (!scroller_x_visible || (scrollx.scroll == 0)));
                scroller_wrapper.toggleClass("scrolled_right",  (!scroller_x_visible || (scrollx.scroll > (scrollx.maxScroll - 2))));
                scroller_wrapper.toggleClass("scrolled_top", (!scroller_y_visible || (scrolly.scroll == 0)));
                scroller_wrapper.toggleClass("scrolled_bottom", (!scroller_y_visible || (scrolly.scroll > (scrolly.maxScroll - 2))));
                }
        
                scroller.scrollbar({
                "onScroll": onScroll
                });
            });
            };
            loadJS("/Scripts/jquery.scrollbar.min.js", initScrollers, document.body);
        };

        // toggles the saerch options
        var MUSTtoplang = function() {
            const selToplang = '.langdropdown';
        
            $(document).on('click', selToplang + '--label', function(e){
            target = $(this).closest(selToplang);
            list = target.find('.langdropdown--list').first();
            if (!target.hasClass('is-active'))
            {
                target.addClass('is-active');
                list.stop(true, true).slideDown(300);
                $(document).on('click', function onDocClick() {
                target.removeClass('is-active');
                $(document).off('click', '', onDocClick);
                list.stop(true, true).slideUp(300);
                });
            }
            });
        };
        
        var privateInitTabStrip = function () {
            var ts2ParentSel = '.jq-tabstrip2';
            var $ts2Menu = $(ts2ParentSel);
            if ($ts2Menu) {
                var ts2TabsSel = ts2ParentSel + '-list',
                    $ts2Tabs = $(),
                    ts2ContentsSel = ts2ParentSel + '-content',
                    $ts2Contents = [],
                    ts2Nb = 0,
                    ts2IndexCurrent = [];

                $ts2Menu.each(function (i) {
                    // Filling array of parents of tabs
                    ++ts2Nb;
                    $ts2Tabs = $ts2Tabs.add($(this).find(ts2TabsSel).eq(0));
                    // Filling array of content panes of each Tabstrip i.e. the first one and its following siblings (we must avoid to fill with content panes from a tabstrip into a tabstrip as this could be the case in page 7.01)
                    $ts2Contents[i] = $(this).find(ts2ContentsSel).eq(0).nextAll().andSelf();
                });

                for (i = 0; i < ts2Nb; i++) {
                    // Init: for each Tabstrip, showing only content corresponding to .jq-tabstrip2-current tab (or the first one by default)
                    // Also storing, for each tab, to which Tabstrip they belong with .data() (we must know that when a click event will happen)
                    ts2IndexCurrent[i] = $ts2Tabs.eq(i).find('li.jq-tabstrip2-current').index();
                    if (ts2IndexCurrent[i] == -1) {
                        ts2IndexCurrent[i] = 0;
                    }
                    $.each($ts2Contents[i], function (j) {
                        if (ts2IndexCurrent[j] == j) {
                            $(this).addClass('jq-tabstrip2-content-current');
                        }
                        else {
                            $(this).hide();
                        }
                    });
                    $ts2Tabs.eq(i).find('li').data('tabstrip', i);

                    /* Managing click on tab: then showing only content corresponding to .current tab (with a blue left border) */
                    $ts2Tabs.eq(i).on('click', 'li', function (e) {
                        // Switch 'span' for 'a' on former current tab and vice versa on the new one
                        var $ts2TabCurrent = $(this).parent().find('.jq-tabstrip2-current').removeClass('jq-tabstrip2-current');
                        var ts2TabCurrentTxt = $ts2TabCurrent.children().html();
                        $ts2TabCurrent.html('<a href="#">' + ts2TabCurrentTxt + '</a>');
                        $(this).addClass('jq-tabstrip2-current').html('<span>' + $(this).children().html() + '</span>');
                        // Content
                        var ts2IndexTabstrip = $(this).data('tabstrip');
                        var ts2IndexCurrent = $(this).index();
                        $.each($ts2Contents[ts2IndexTabstrip], function () {
                            $(this).hide().removeClass('jq-tabstrip2-content-current');
                        });
                        $ts2Contents[ts2IndexTabstrip].eq(ts2IndexCurrent).show().addClass('jq-tabstrip2-content-current');
                        return false;
                    });
                }
            }
        },
            selectTabStrip = function (index) {

                var ts2ParentSel = '.jq-tabstrip2';
                var $ts2Menu = $(ts2ParentSel);
                if ($ts2Menu) {
                    var ts2TabsSel = ts2ParentSel + '-list',
                        $ts2Tabs = $(),
                        ts2ContentsSel = ts2ParentSel + '-content',
                        $ts2Contents = [],
                        ts2Nb = 0;

                    $ts2Menu.each(function (i) {
                        // Filling array of parents of tabs
                        ++ts2Nb;
                        $ts2Tabs = $ts2Tabs.add($(this).find(ts2TabsSel).eq(0));
                        // Filling array of content panes of each Tabstrip i.e. the first one and its following siblings (we must avoid to fill with content panes from a tabstrip into a tabstrip as this could be the case in page 7.01)
                        $ts2Contents[i] = $(this).find(ts2ContentsSel).eq(0).nextAll().andSelf();
                    });

                    var liSelected = $('#select-quarter-list li:not(.visually-hidden)')[index];
                    $(liSelected).parent().find('.jq-tabstrip2-current').removeClass('jq-tabstrip2-current');
                    $(liSelected).addClass('jq-tabstrip2-current').html('<span>' + $(liSelected).children().html() + '</span>');
                    // Content
                    var ts2IndexTabstrip = $(liSelected).data('tabstrip');
                    var ts2IndexCurrent = $(liSelected).index();
                    $.each($ts2Contents[ts2IndexTabstrip], function () {
                        $(this).hide().removeClass('jq-tabstrip2-content-current');
                    });
                    $ts2Contents[ts2IndexTabstrip].eq(ts2IndexCurrent).show().addClass('jq-tabstrip2-content-current');
                }

                return false;
            },

            init = function (options) {
                var o = options || {},
                    classContainer = o.classContainer || 'corp-content',
                    $mainContainers = $('.' + classContainer),
                    isFirstElement = true,
                    minScreenSize = o.minScreenSize || 767;

                // Autocollapse for H2
                // Temporary commented due to a regression on carroussel & previewcarroussel shortcodes
                // RTC: 115893
                // Will be reactivate with RTC 115894
                //$mainContainers.each(function () {
                //	if ($(this).find('h2').length) {
                //		var finalHtml = '', containH2 = false;
                //		$(this).children().each(function () {
                //			if (this.nodeName.toLowerCase() === 'h2') {
                //				$(this).addClass('small-jq-next-open small-bd-top');
                //				$(this).html($(this).html() + ' <a href="#" class="icon right small-visible"><i class="gray4" aria-hidden="true">></i> <span>Click to open/close</span></a>');

                //				if (isFirstElement) {
                //					isFirstElement = false;
                //				}
                //				else {
                //					finalHtml += '</div>';
                //				}
                //				finalHtml += outerHTML(this);
                //				finalHtml += '<div class="small-jq-to-open">';
                //				containH2 = true;
                //			}
                //			else {
                //				finalHtml += outerHTML(this);
                //			}
                //		});
                //		if (containH2) {
                //			finalHtml += '</div>';
                //		}
                //		$(this).html(finalHtml);
                //	}
                //});

                var currentDesign;
                $window = $(window);
                var resizeFunction = function resizeFunction() {
                    if ($window.width() > minScreenSize) {
                        $('.small-jq-to-open').css('display', 'block');
                        $mainContainers.find('.jq-tabstrip2-list > li:not(.jq-tabstrip2-current)').show();
                        currentDesign = '>767';
                    }
                    else if (currentDesign !== '<767') {
                        $('.small-jq-to-open').css('display', 'none');
                        $mainContainers.find('.jq-tabstrip2-list > li:not(.jq-tabstrip2-current)').hide();
                        currentDesign = '<767';
                    }
                };

                $window.resize(must.throttle(resizeFunction, 100));

                $('.small-jq-next-open').on('click', function () {
                    if ($window.width() > minScreenSize) { return; }
                    if ($(this).hasClass('small-jq-next-open')) {
                        $(this).closest('p,div,section,article,aside,header,footer,h2').nextAll().first('.small-jq-to-open').slideDown('fast').removeClass('small-jq-to-open').addClass('small-jq-to-close');
                        $(this).addClass('small-jq-next-close').removeClass('small-jq-next-open');
                    }
                    else {
                        $(this).closest('p,div,section,article,aside,header,footer,h2').nextAll().first('.small-jq-to-close').slideUp('fast').removeClass('small-jq-to-close').addClass('small-jq-to-open');
                        $(this).addClass('small-jq-next-open').removeClass('small-jq-next-close');
                    }
                    return false;
                });

                // Collapse/Expand
                $('.corp-inner .jq-to-close').parent().after('<p class="jq-banner"><a href="#" class="jq-prev-close">' + must.resources.label_collapse + ' <object type="image/svg+xml" data="Images/v3-1/icon/arrow_collapse_expand.svg" class="arrow_c-e"></object></a></p>');
                $('.corp-inner .jq-to-open').parent().after('<p class="jq-banner"><a href="#" class="jq-prev-open">' + must.resources.label_expand + ' <object type="image/svg+xml" data="Images/v3-1/icon/arrow_collapse_expand.svg" class="arrow_c-e"></object></a></p>');
                $('.corp-inner .jq-prev-open').on('click', function (e) {
                    if ($(this).hasClass('jq-prev-open')) {
                        $(this).parent('.jq-banner').prev().children('.jq-to-open').show().removeClass('jq-to-open').addClass('jq-to-close');
                        $(this).addClass('jq-prev-close').removeClass('jq-prev-open');
                        $(this).html(must.resources.label_collapse + ' <object type="image/svg+xml" data="Images/v3-1/icon/arrow_collapse_expand.svg" class="arrow_c-e"></object>');
                    }
                    else {
                        $(this).parent('.jq-banner').prev().children('.jq-to-close').hide().removeClass('jq-to-close').addClass('jq-to-open');
                        $(this).addClass('jq-prev-open').removeClass('jq-prev-close');
                        $(this).html(must.resources.label_expand + ' <object type="image/svg+xml" data="Images/v3-1/icon/arrow_collapse_expand.svg" class="arrow_c-e"></object>');
                    }
                    return false;
                });
                $('.corp-inner .jq-prev-close').on('click', function (e) {
                    if ($(this).hasClass('jq-prev-open')) {
                        $(this).parent('.jq-banner').prev().children('.jq-to-open').show().removeClass('jq-to-open').addClass('jq-to-close');
                        $(this).addClass('jq-prev-close').removeClass('jq-prev-open');
                        $(this).html(must.resources.label_collapse + ' <i class="icon icon-arrowdown gray4" aria-hidden="true">û</i>');
                    }
                    else {
                        $(this).parent('.jq-banner').prev().children('.jq-to-close').hide().removeClass('jq-to-close').addClass('jq-to-open');
                        $(this).addClass('jq-prev-open').removeClass('jq-prev-close');
                        $(this).html(must.resources.label_expand + ' <i class="icon icon-arrowdown gray4" aria-hidden="true">,</i>');
                    }
                    return false;
                });
                
                $('.flexslider-carrousel').flexslider({
                    animation: "slide",
                    animationLoop: false,
                    itemWidth: 166,
                    itemMargin: 10
                });

                $('.flexslider-preview').flexslider({
                    animation: 'slide',
                    controlNav: 'thumbnails'
                });

                // Eloqua for APL only
                if (typeof _elqQ !== 'undefined') {
                    var element = $('.icon-doc').children()[0];
                    var base_url = window.location.origin;
                    if (element && base_url) {
                        var link = element.attributes.href.value;
                        var full_url = base_url + link;
                        element.addEventListener('click', function (e) {
                                _elq.trackOutboundLink(this);
                            return false;
                        });
                    }
                }

                privateInitTabStrip();
                MUSTtabs();
                MUSTcollapseexpand();
                MUSTmslider();
                MUSTscroller();
                MUSTtoplang();
            },

            outerHTML = function outerHTML(node) {
                // if IE, Chrome take the internal method otherwise build one
                return node.outerHTML || (
                    function (n) {
                        var div = document.createElement('div'), h;
                        div.appendChild(n.cloneNode(true));
                        h = div.innerHTML;
                        div = null;
                        return h;
                    })(node);
            };

        return {
            init: init,
            initTabStrip: privateInitTabStrip,
            selectTabStrip: selectTabStrip,
            MUSTtabs:MUSTtabs,
            MUSTcollapseexpand: MUSTcollapseexpand,
            MUSTmslider: MUSTmslider,
            MUSTscroller: MUSTscroller,
            MUSTtoplang: MUSTtoplang
        };
    }());
}(this.must = this.must || {}));;
(function (a, f) {
	function g(c) { var b = a.cedexis.api.instance; return b ? (b.patch(c), !0) : !1 } function e(a) { var b = {}, d; for (d in a) a.hasOwnProperty(d) && (b[d] = a[d]); return b } function h() { var c = f.createElement("script"); c.async = !0; "crossOrigin" in c && (c.crossOrigin = "anonymous"); c.src = "//radar.cedexis.com/radar/" + (/radar-no-min/.test(a.location.search) ? "api.unmin.js" : "api.js"); var b = f.getElementsByTagName("script")[0]; b.parentNode.insertBefore(c, b) } a.cedexis = a.cedexis || {}; a.cedexis.api = a.cedexis.api || {}; a.cedexis.api.events =
	a.cedexis.api.events || []; a.cedexis.api.create = function (a) { return function (b) { b = e(b); b.impact = function (b) { g(this) ? this.impact(b) : a.push({ owner: this, event: "impact", data: e(b) }) }; b.impact.stub = !0; b.radar = function (b) { g(this) ? this.radar(b) : a.push({ owner: this, event: "radar", data: e(b) }) }; b.radar.stub = !0; return b } }(a.cedexis.api.events); /\bMSIE 6/.exec(a.navigator.userAgent) || (a.addEventListener ? a.addEventListener("load", h, !1) : a.attachEvent && a.attachEvent("onload", h))
})(window, document);
(function (must) {
	/**
	 *	usage :
	 * how many time for this event, since the user requested the page ?
	 *	must.tracktime.addEvent('generally the page name', 'generally the precise functionality you are monitoring')
	 *
	 * how much time for a precise task to execute (like a heavy calcul)
	 * var timer = must.tracktime.startTimer('Step 4 Bkg', 'Containers KO binding');
	 * …/… // heavy computation you want to measure
	 * timer.stop();
	 *
	 * how much time for an XHR to execute ?
	 * var timer = must.tracktime.startTimer('Step 1', 'XHR parties');
	 * $.ajax({
	 *		url:'http://URL',
	 *		success:function() {
	 *			timer.stop();
	 *			…/…
	 *		}
	 *});
	 *
	 * need to send yourself a time you calculated, here you go (1.2s = 1200 milliseconds) :
	 * must.tracktime.addEvent('page name', 'computing for functionality X', 1200)
	 *
	 * need to be more precise about the
	 */

	must.tracktime = (function () {
		var addEvent = function (category, subcategory, timing, label, overrideSampling) {
			if (!must.rumActivated.global)
				return;
			if (!timing && 'performance' in window && 'now' in window.performance) {
				// call performance.mark() - standard way to track time (for ex by WPT)
				if ('mark' in window.performance) {
					window.performance.mark(category + ' - ' + subcategory);
				}

				timing = window.performance.now();
				// more than 1 hour ? some weird browsers (maxthon, some versions of IE 11) report crazy times ( > 10 hours)
				// let ignore them
				if (timing > 3600000) {
					return false;
				}
			}

			if (!category || !subcategory) {
				throw 'invalid parameters';
			}

			if (isNaN(timing) || !timing)
				return;

			//console.log('timing', category, subcategory, Math.round(timing), label);
			//if (must.rumActivated.googleAnalytics || overrideSampling) {
			//	if ('ga' in window) {
			//		if (label) {
			//			window.ga('send', 'timing', category, subcategory, Math.round(timing), label);
			//		} else {
			//			window.ga('send', 'timing', category, subcategory, Math.round(timing));
			//		}
			//	}
			//}

			// dynatrace is injected https://community.compuwareapm.com/community/display/DOCDT60/JavaScript+ADK+and+JavaScript+Ajax+ADK#JavaScriptADKandJavaScriptAjaxADK-ReportingEvents,Warnings,Errors,Strings,andValues
			if ('dT_' in window && 'dynaTrace' in window) {
				var actionName = 'timing - ' + category + ' - ' + subcategory;
				if (label) {
					actionName = 'timing - ' + category + ' - ' + subcategory + ' - ' + label;
				}

				// JavaScript agent is present
				var actionId = window.dynaTrace.enterAction(actionName, 'user-timing');
				window.dynaTrace.leaveAction(actionId, new Date().getTime() + Math.round(timing));
			}
		};

		var timers = {};

		/**
		 * @param category
		 * @param subcategory
		 * @param label an ultimate precision in the monitoring
		 */
		var startTimer = function (category, subcategory, label) {
			var timeStart = must.date.now();
			if ('console' in this && 'time' in console) {
				console.time(category + subcategory + label);
			}
			// create the entry and send back a reference on ourselves to stop the timer and allow
			return timers[category + subcategory + label] = {
				stop: function () {
					var timeElapsed = must.date.now() - timeStart;
					//console.log('what',timeElapsed, timeStart)
					if (!isNaN(timeElapsed)) {
						addEvent(category, subcategory, timeElapsed, label);

						if ('console' in this && 'timeEnd' in console) {
							console.timeEnd(category + subcategory + label);
						}
					}
					// burn after reading
					delete timers[category + subcategory + label];
				}
			};
		};

		/**
		 * @deprecated, rather use var timer = startTimer('cat', 'subcat'); then timer.stop();
		 * @param category
		 * @param subcategory
		 * @param label an ultimate precision in the monitoring
		 */
		var stopTimer = function (category, subcategory, label) {
			if (timers[category + subcategory + label]) {
				timers[category + subcategory + label].stop();
				// burn after reading
				delete timers[category + subcategory + label];
			}
		};

		return {
			addEvent: addEvent,
			startTimer: startTimer,
			stopTimer: stopTimer // deprecated
		};
	}());
}(this.must = this.must || {}));

// for this lib to work in commonJS environments (like nodeJS)
if (typeof module === "object" && typeof module.exports === "object") {
	module.exports = this.must;
};
(function (must) {
	must.date = (function () {
		var days = {
			names: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
		};
		var months = {
			names: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""]
		};

		var addSec = function (TTL) {
			return new Date(Number(new Date()) + (TTL * 1000));
		};

		var formatDate = function (value, format) {
			if (value === undefined) {
				return '';
			}

			if ('Globalize' in window) {
				return Globalize.format(value, format);
			}
			else {
				switch (format) {
					case 'D':
						// dddd, MMMM dd, yyyy
						return days.names[value.getDay()] + ', ' + months.names[value.getMonth()] + ' ' + value.getDate() + ', ' + value.getFullYear();
					case 'd':
						// M/d/yyyy
						return (value.getMonth() + 1) + '/' + value.getDate() + '/' + value.getFullYear();
					default:
						return value.toString();
				}
			}

		};

		var parseDate = function (date) {
			if (!date) {
				return undefined;
			}

			if (date.indexOf('/Date(') > -1) {
				return new Date(parseInt(date.substring(6, date.length - 2)));
			}

			return date;
		};

		return {
			toString: formatDate,
			parse: parseDate,
			addSec: addSec,
			now: Date.now || function () {
				return +new Date();
			}
		};
	}());
}(this.must = this.must || {}));

// IE8 doesn't implement Date.toISOString()
if (!Date.prototype.toISOString) {
	(function () {

		function pad(number) {
			var r = String(number);
			if (r.length === 1) {
				r = '0' + r;
			}
			return r;
		}

		Date.prototype.toISOString = function () {
			return this.getUTCFullYear()
				+ '-' + pad(this.getUTCMonth() + 1)
				+ '-' + pad(this.getUTCDate())
				+ 'T' + pad(this.getUTCHours())
				+ ':' + pad(this.getUTCMinutes())
				+ ':' + pad(this.getUTCSeconds())
				+ '.' + String((this.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5)
				+ 'Z';
		};
	}());
};
(function (must) {
	must.number = (function () {
		/**
		* format number in current language
		* @param  {number} [value] - current number
		* @return {string} - number in current language
		*/
		var formatNumber = function (value, precision) {
			if ('Globalize' in window) {
				var separatorComma = Globalize.culture().numberFormat[','];
				var separatorDot = Globalize.culture().numberFormat['.'];

				if (separatorComma === ' ') {
					separatorComma = '\\s';
				}

				//remove thousands comma separator
				var regexComma = new RegExp('[' + separatorComma + ']+', 'g');
				var regexRemoveZero = new RegExp('0+$|[' + separatorDot + ']0+$', 'g');

				//value = Globalize.format(value, 'n3').replace(regexComma, '')
				value = Globalize.format(value, 'n3').replace(regexComma, '').replace(regexRemoveZero, '');
			} else {
				if (precision && value !== '' && typeof value === 'number') {
					return value.toFixed(precision);
				}
			}
			return value;
		};

		return {
			formatNumber: formatNumber
		};
	}());
}(this.must = this.must || {}));;
(function (must) {
	must.gatracking = (function () {

		var sendGaEventThenRedirectToLink = function(el, link, category, asset) {

			var hbrun = false; // tracker has not yet run

			/* HitCallback to open link in same window after tracker */
			var hitBack = function() {
				/* run once only */
				if (hbrun) return;
				hbrun = true;
				window.location.href = link;
			};

			var eventLabel = "[page: " + document.location.pathname + document.location.search + "]";
			if (asset !== undefined) eventLabel += " [asset: " + asset + "]";

			/* If target opens a new window then just track */
			//if (el.target && !el.target.match(/^_(self|parent|top)$/i)) {
			//	ga(
			//		"send", "event", category, link, eventLabel
			//	);
			//} else {
			//	/* send event with callback */
			//	ga(
			//		"send", "event", category, link, eventLabel, { "hitCallback": hitBack }
			//	);

			//	/* Run hitCallback if GA takes too long */
			//	setTimeout(hitBack, 1000);

			//	/* Prevent standard click */
			//	event.preventDefault ? event.preventDefault() : event.returnValue = !1;
			//}
		};

		var trackAllGaLinks = function(parentId, classname, category) {
			var parentElem = $("#"+parentId);
			if (parentElem.length !== 1) return;

			var elems = $("." + classname, parentElem);
			for (var i = 0; i < elems.length; i++) {
				$(elems[i]).on("click", function () {
					var link = this.href;
					sendGaEventThenRedirectToLink(this, link, category);
				});
			}
		};

		var init = function () {
			if (ga === undefined) return;
			trackAllGaLinks("social-network", "lnk-ga", "social network clicked");
		};

		return {
			init: init,
			sendGaEventThenRedirectToLink: sendGaEventThenRedirectToLink
		};
	}());
}(this.must = this.must || {}));;
/*
 * jQuery FlexSlider v2.1
 * http://www.woothemes.com/flexslider/
 *
 * Copyright 2012 WooThemes
 * Free to use under the GPLv2 license.
 * http://www.gnu.org/licenses/gpl-2.0.html
 *
 * Contributing author: Tyler Smith (@mbmufffin)
 */
(function(d){d.flexslider=function(j,l){var a=d(j),c=d.extend({},d.flexslider.defaults,l),e=c.namespace,q="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,u=q?"touchend":"click",m="vertical"===c.direction,n=c.reverse,h=0<c.itemWidth,s="fade"===c.animation,t=""!==c.asNavFor,f={};d.data(j,"flexslider",a);f={init:function(){a.animating=!1;a.currentSlide=c.startAt;a.animatingTo=a.currentSlide;a.atEnd=0===a.currentSlide||a.currentSlide===a.last;a.containerSelector=c.selector.substr(0,
c.selector.search(" "));a.slides=d(c.selector,a);a.container=d(a.containerSelector,a);a.count=a.slides.length;a.syncExists=0<d(c.sync).length;"slide"===c.animation&&(c.animation="swing");a.prop=m?"top":"marginLeft";a.args={};a.manualPause=!1;var b=a,g;if(g=!c.video)if(g=!s)if(g=c.useCSS)a:{g=document.createElement("div");var p=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"],e;for(e in p)if(void 0!==g.style[p[e]]){a.pfx=p[e].replace("Perspective","").toLowerCase();
a.prop="-"+a.pfx+"-transform";g=!0;break a}g=!1}b.transitions=g;""!==c.controlsContainer&&(a.controlsContainer=0<d(c.controlsContainer).length&&d(c.controlsContainer));""!==c.manualControls&&(a.manualControls=0<d(c.manualControls).length&&d(c.manualControls));c.randomize&&(a.slides.sort(function(){return Math.round(Math.random())-0.5}),a.container.empty().append(a.slides));a.doMath();t&&f.asNav.setup();a.setup("init");c.controlNav&&f.controlNav.setup();c.directionNav&&f.directionNav.setup();c.keyboard&&
(1===d(a.containerSelector).length||c.multipleKeyboard)&&d(document).bind("keyup",function(b){b=b.keyCode;if(!a.animating&&(39===b||37===b))b=39===b?a.getTarget("next"):37===b?a.getTarget("prev"):!1,a.flexAnimate(b,c.pauseOnAction)});c.mousewheel&&a.bind("mousewheel",function(b,g){b.preventDefault();var d=0>g?a.getTarget("next"):a.getTarget("prev");a.flexAnimate(d,c.pauseOnAction)});c.pausePlay&&f.pausePlay.setup();c.slideshow&&(c.pauseOnHover&&a.hover(function(){!a.manualPlay&&!a.manualPause&&a.pause()},
function(){!a.manualPause&&!a.manualPlay&&a.play()}),0<c.initDelay?setTimeout(a.play,c.initDelay):a.play());q&&c.touch&&f.touch();(!s||s&&c.smoothHeight)&&d(window).bind("resize focus",f.resize);setTimeout(function(){c.start(a)},200)},asNav:{setup:function(){a.asNav=!0;a.animatingTo=Math.floor(a.currentSlide/a.move);a.currentItem=a.currentSlide;a.slides.removeClass(e+"active-slide").eq(a.currentItem).addClass(e+"active-slide");a.slides.click(function(b){b.preventDefault();b=d(this);var g=b.index();
!d(c.asNavFor).data("flexslider").animating&&!b.hasClass("active")&&(a.direction=a.currentItem<g?"next":"prev",a.flexAnimate(g,c.pauseOnAction,!1,!0,!0))})}},controlNav:{setup:function(){a.manualControls?f.controlNav.setupManual():f.controlNav.setupPaging()},setupPaging:function(){var b=1,g;a.controlNavScaffold=d('<ol class="'+e+"control-nav "+e+("thumbnails"===c.controlNav?"control-thumbs":"control-paging")+'"></ol>');if(1<a.pagingCount)for(var p=0;p<a.pagingCount;p++)g="thumbnails"===c.controlNav?
'<img src="'+a.slides.eq(p).attr("data-thumb")+'"/>':"<a>"+b+"</a>",a.controlNavScaffold.append("<li>"+g+"</li>"),b++;a.controlsContainer?d(a.controlsContainer).append(a.controlNavScaffold):a.append(a.controlNavScaffold);f.controlNav.set();f.controlNav.active();a.controlNavScaffold.delegate("a, img",u,function(b){b.preventDefault();b=d(this);var g=a.controlNav.index(b);b.hasClass(e+"active")||(a.direction=g>a.currentSlide?"next":"prev",a.flexAnimate(g,c.pauseOnAction))});q&&a.controlNavScaffold.delegate("a",
"click touchstart",function(a){a.preventDefault()})},setupManual:function(){a.controlNav=a.manualControls;f.controlNav.active();a.controlNav.live(u,function(b){b.preventDefault();b=d(this);var g=a.controlNav.index(b);b.hasClass(e+"active")||(g>a.currentSlide?a.direction="next":a.direction="prev",a.flexAnimate(g,c.pauseOnAction))});q&&a.controlNav.live("click touchstart",function(a){a.preventDefault()})},set:function(){a.controlNav=d("."+e+"control-nav li "+("thumbnails"===c.controlNav?"img":"a"),
a.controlsContainer?a.controlsContainer:a)},active:function(){a.controlNav.removeClass(e+"active").eq(a.animatingTo).addClass(e+"active")},update:function(b,c){1<a.pagingCount&&"add"===b?a.controlNavScaffold.append(d("<li><a>"+a.count+"</a></li>")):1===a.pagingCount?a.controlNavScaffold.find("li").remove():a.controlNav.eq(c).closest("li").remove();f.controlNav.set();1<a.pagingCount&&a.pagingCount!==a.controlNav.length?a.update(c,b):f.controlNav.active()}},directionNav:{setup:function(){var b=d('<ul class="'+
e+'direction-nav"><li><a class="'+e+'prev" href="#">'+c.prevText+'</a></li><li><a class="'+e+'next" href="#">'+c.nextText+"</a></li></ul>");a.controlsContainer?(d(a.controlsContainer).append(b),a.directionNav=d("."+e+"direction-nav li a",a.controlsContainer)):(a.append(b),a.directionNav=d("."+e+"direction-nav li a",a));f.directionNav.update();a.directionNav.bind(u,function(b){b.preventDefault();b=d(this).hasClass(e+"next")?a.getTarget("next"):a.getTarget("prev");a.flexAnimate(b,c.pauseOnAction)});
q&&a.directionNav.bind("click touchstart",function(a){a.preventDefault()})},update:function(){var b=e+"disabled";1===a.pagingCount?a.directionNav.addClass(b):c.animationLoop?a.directionNav.removeClass(b):0===a.animatingTo?a.directionNav.removeClass(b).filter("."+e+"prev").addClass(b):a.animatingTo===a.last?a.directionNav.removeClass(b).filter("."+e+"next").addClass(b):a.directionNav.removeClass(b)}},pausePlay:{setup:function(){var b=d('<div class="'+e+'pauseplay"><a></a></div>');a.controlsContainer?
(a.controlsContainer.append(b),a.pausePlay=d("."+e+"pauseplay a",a.controlsContainer)):(a.append(b),a.pausePlay=d("."+e+"pauseplay a",a));f.pausePlay.update(c.slideshow?e+"pause":e+"play");a.pausePlay.bind(u,function(b){b.preventDefault();d(this).hasClass(e+"pause")?(a.manualPause=!0,a.manualPlay=!1,a.pause()):(a.manualPause=!1,a.manualPlay=!0,a.play())});q&&a.pausePlay.bind("click touchstart",function(a){a.preventDefault()})},update:function(b){"play"===b?a.pausePlay.removeClass(e+"pause").addClass(e+
"play").text(c.playText):a.pausePlay.removeClass(e+"play").addClass(e+"pause").text(c.pauseText)}},touch:function(){function b(b){k=m?d-b.touches[0].pageY:d-b.touches[0].pageX;q=m?Math.abs(k)<Math.abs(b.touches[0].pageX-e):Math.abs(k)<Math.abs(b.touches[0].pageY-e);if(!q||500<Number(new Date)-l)b.preventDefault(),!s&&a.transitions&&(c.animationLoop||(k/=0===a.currentSlide&&0>k||a.currentSlide===a.last&&0<k?Math.abs(k)/r+2:1),a.setProps(f+k,"setTouch"))}function g(){j.removeEventListener("touchmove",
b,!1);if(a.animatingTo===a.currentSlide&&!q&&null!==k){var h=n?-k:k,m=0<h?a.getTarget("next"):a.getTarget("prev");a.canAdvance(m)&&(550>Number(new Date)-l&&50<Math.abs(h)||Math.abs(h)>r/2)?a.flexAnimate(m,c.pauseOnAction):s||a.flexAnimate(a.currentSlide,c.pauseOnAction,!0)}j.removeEventListener("touchend",g,!1);f=k=e=d=null}var d,e,f,r,k,l,q=!1;j.addEventListener("touchstart",function(k){a.animating?k.preventDefault():1===k.touches.length&&(a.pause(),r=m?a.h:a.w,l=Number(new Date),f=h&&n&&a.animatingTo===
a.last?0:h&&n?a.limit-(a.itemW+c.itemMargin)*a.move*a.animatingTo:h&&a.currentSlide===a.last?a.limit:h?(a.itemW+c.itemMargin)*a.move*a.currentSlide:n?(a.last-a.currentSlide+a.cloneOffset)*r:(a.currentSlide+a.cloneOffset)*r,d=m?k.touches[0].pageY:k.touches[0].pageX,e=m?k.touches[0].pageX:k.touches[0].pageY,j.addEventListener("touchmove",b,!1),j.addEventListener("touchend",g,!1))},!1)},resize:function(){!a.animating&&a.is(":visible")&&(h||a.doMath(),s?f.smoothHeight():h?(a.slides.width(a.computedW),
a.update(a.pagingCount),a.setProps()):m?(a.viewport.height(a.h),a.setProps(a.h,"setTotal")):(c.smoothHeight&&f.smoothHeight(),a.newSlides.width(a.computedW),a.setProps(a.computedW,"setTotal")))},smoothHeight:function(b){if(!m||s){var c=s?a:a.viewport;b?c.animate({height:a.slides.eq(a.animatingTo).height()},b):c.height(a.slides.eq(a.animatingTo).height())}},sync:function(b){var g=d(c.sync).data("flexslider"),e=a.animatingTo;switch(b){case "animate":g.flexAnimate(e,c.pauseOnAction,!1,!0);break;case "play":!g.playing&&
!g.asNav&&g.play();break;case "pause":g.pause()}}};a.flexAnimate=function(b,g,p,j,l){t&&1===a.pagingCount&&(a.direction=a.currentItem<b?"next":"prev");if(!a.animating&&(a.canAdvance(b,l)||p)&&a.is(":visible")){if(t&&j)if(p=d(c.asNavFor).data("flexslider"),a.atEnd=0===b||b===a.count-1,p.flexAnimate(b,!0,!1,!0,l),a.direction=a.currentItem<b?"next":"prev",p.direction=a.direction,Math.ceil((b+1)/a.visible)-1!==a.currentSlide&&0!==b)a.currentItem=b,a.slides.removeClass(e+"active-slide").eq(b).addClass(e+
"active-slide"),b=Math.floor(b/a.visible);else return a.currentItem=b,a.slides.removeClass(e+"active-slide").eq(b).addClass(e+"active-slide"),!1;a.animating=!0;a.animatingTo=b;c.before(a);g&&a.pause();a.syncExists&&!l&&f.sync("animate");c.controlNav&&f.controlNav.active();h||a.slides.removeClass(e+"active-slide").eq(b).addClass(e+"active-slide");a.atEnd=0===b||b===a.last;c.directionNav&&f.directionNav.update();b===a.last&&(c.end(a),c.animationLoop||a.pause());if(s)q?(a.slides.eq(a.currentSlide).css({opacity:0,
zIndex:1}),a.slides.eq(b).css({opacity:1,zIndex:2}),a.slides.unbind("webkitTransitionEnd transitionend"),a.slides.eq(a.currentSlide).bind("webkitTransitionEnd transitionend",function(){c.after(a)}),a.animating=!1,a.currentSlide=a.animatingTo):(a.slides.eq(a.currentSlide).fadeOut(c.animationSpeed,c.easing),a.slides.eq(b).fadeIn(c.animationSpeed,c.easing,a.wrapup));else{var r=m?a.slides.filter(":first").height():a.computedW;h?(b=c.itemWidth>a.w?2*c.itemMargin:c.itemMargin,b=(a.itemW+b)*a.move*a.animatingTo,
b=b>a.limit&&1!==a.visible?a.limit:b):b=0===a.currentSlide&&b===a.count-1&&c.animationLoop&&"next"!==a.direction?n?(a.count+a.cloneOffset)*r:0:a.currentSlide===a.last&&0===b&&c.animationLoop&&"prev"!==a.direction?n?0:(a.count+1)*r:n?(a.count-1-b+a.cloneOffset)*r:(b+a.cloneOffset)*r;a.setProps(b,"",c.animationSpeed);if(a.transitions){if(!c.animationLoop||!a.atEnd)a.animating=!1,a.currentSlide=a.animatingTo;a.container.unbind("webkitTransitionEnd transitionend");a.container.bind("webkitTransitionEnd transitionend",
function(){a.wrapup(r)})}else a.container.animate(a.args,c.animationSpeed,c.easing,function(){a.wrapup(r)})}c.smoothHeight&&f.smoothHeight(c.animationSpeed)}};a.wrapup=function(b){!s&&!h&&(0===a.currentSlide&&a.animatingTo===a.last&&c.animationLoop?a.setProps(b,"jumpEnd"):a.currentSlide===a.last&&(0===a.animatingTo&&c.animationLoop)&&a.setProps(b,"jumpStart"));a.animating=!1;a.currentSlide=a.animatingTo;c.after(a)};a.animateSlides=function(){a.animating||a.flexAnimate(a.getTarget("next"))};a.pause=
function(){clearInterval(a.animatedSlides);a.playing=!1;c.pausePlay&&f.pausePlay.update("play");a.syncExists&&f.sync("pause")};a.play=function(){a.animatedSlides=setInterval(a.animateSlides,c.slideshowSpeed);a.playing=!0;c.pausePlay&&f.pausePlay.update("pause");a.syncExists&&f.sync("play")};a.canAdvance=function(b,g){var d=t?a.pagingCount-1:a.last;return g?!0:t&&a.currentItem===a.count-1&&0===b&&"prev"===a.direction?!0:t&&0===a.currentItem&&b===a.pagingCount-1&&"next"!==a.direction?!1:b===a.currentSlide&&
!t?!1:c.animationLoop?!0:a.atEnd&&0===a.currentSlide&&b===d&&"next"!==a.direction?!1:a.atEnd&&a.currentSlide===d&&0===b&&"next"===a.direction?!1:!0};a.getTarget=function(b){a.direction=b;return"next"===b?a.currentSlide===a.last?0:a.currentSlide+1:0===a.currentSlide?a.last:a.currentSlide-1};a.setProps=function(b,g,d){var e,f=b?b:(a.itemW+c.itemMargin)*a.move*a.animatingTo;e=-1*function(){if(h)return"setTouch"===g?b:n&&a.animatingTo===a.last?0:n?a.limit-(a.itemW+c.itemMargin)*a.move*a.animatingTo:a.animatingTo===
a.last?a.limit:f;switch(g){case "setTotal":return n?(a.count-1-a.currentSlide+a.cloneOffset)*b:(a.currentSlide+a.cloneOffset)*b;case "setTouch":return b;case "jumpEnd":return n?b:a.count*b;case "jumpStart":return n?a.count*b:b;default:return b}}()+"px";a.transitions&&(e=m?"translate3d(0,"+e+",0)":"translate3d("+e+",0,0)",d=void 0!==d?d/1E3+"s":"0s",a.container.css("-"+a.pfx+"-transition-duration",d));a.args[a.prop]=e;(a.transitions||void 0===d)&&a.container.css(a.args)};a.setup=function(b){if(s)a.slides.css({width:"100%",
"float":"left",marginRight:"-100%",position:"relative"}),"init"===b&&(q?a.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+c.animationSpeed/1E3+"s ease",zIndex:1}).eq(a.currentSlide).css({opacity:1,zIndex:2}):a.slides.eq(a.currentSlide).fadeIn(c.animationSpeed,c.easing)),c.smoothHeight&&f.smoothHeight();else{var g,p;"init"===b&&(a.viewport=d('<div class="'+e+'viewport"></div>').css({overflow:"hidden",position:"relative"}).appendTo(a).append(a.container),a.cloneCount=0,a.cloneOffset=
0,n&&(p=d.makeArray(a.slides).reverse(),a.slides=d(p),a.container.empty().append(a.slides)));c.animationLoop&&!h&&(a.cloneCount=2,a.cloneOffset=1,"init"!==b&&a.container.find(".clone").remove(),a.container.append(a.slides.first().clone().addClass("clone")).prepend(a.slides.last().clone().addClass("clone")));a.newSlides=d(c.selector,a);g=n?a.count-1-a.currentSlide+a.cloneOffset:a.currentSlide+a.cloneOffset;m&&!h?(a.container.height(200*(a.count+a.cloneCount)+"%").css("position","absolute").width("100%"),
setTimeout(function(){a.newSlides.css({display:"block"});a.doMath();a.viewport.height(a.h);a.setProps(g*a.h,"init")},"init"===b?100:0)):(a.container.width(200*(a.count+a.cloneCount)+"%"),a.setProps(g*a.computedW,"init"),setTimeout(function(){a.doMath();a.newSlides.css({width:a.computedW,"float":"left",display:"block"});c.smoothHeight&&f.smoothHeight()},"init"===b?100:0))}h||a.slides.removeClass(e+"active-slide").eq(a.currentSlide).addClass(e+"active-slide")};a.doMath=function(){var b=a.slides.first(),
d=c.itemMargin,e=c.minItems,f=c.maxItems;a.w=a.width();a.h=b.height();a.boxPadding=b.outerWidth()-b.width();h?(a.itemT=c.itemWidth+d,a.minW=e?e*a.itemT:a.w,a.maxW=f?f*a.itemT:a.w,a.itemW=a.minW>a.w?(a.w-d*e)/e:a.maxW<a.w?(a.w-d*f)/f:c.itemWidth>a.w?a.w:c.itemWidth,a.visible=Math.floor(a.w/(a.itemW+d)),a.move=0<c.move&&c.move<a.visible?c.move:a.visible,a.pagingCount=Math.ceil((a.count-a.visible)/a.move+1),a.last=a.pagingCount-1,a.limit=1===a.pagingCount?0:c.itemWidth>a.w?(a.itemW+2*d)*a.count-a.w-
d:(a.itemW+d)*a.count-a.w-d):(a.itemW=a.w,a.pagingCount=a.count,a.last=a.count-1);a.computedW=a.itemW-a.boxPadding};a.update=function(b,d){a.doMath();h||(b<a.currentSlide?a.currentSlide+=1:b<=a.currentSlide&&0!==b&&(a.currentSlide-=1),a.animatingTo=a.currentSlide);if(c.controlNav&&!a.manualControls)if("add"===d&&!h||a.pagingCount>a.controlNav.length)f.controlNav.update("add");else if("remove"===d&&!h||a.pagingCount<a.controlNav.length)h&&a.currentSlide>a.last&&(a.currentSlide-=1,a.animatingTo-=1),
f.controlNav.update("remove",a.last);c.directionNav&&f.directionNav.update()};a.addSlide=function(b,e){var f=d(b);a.count+=1;a.last=a.count-1;m&&n?void 0!==e?a.slides.eq(a.count-e).after(f):a.container.prepend(f):void 0!==e?a.slides.eq(e).before(f):a.container.append(f);a.update(e,"add");a.slides=d(c.selector+":not(.clone)",a);a.setup();c.added(a)};a.removeSlide=function(b){var e=isNaN(b)?a.slides.index(d(b)):b;a.count-=1;a.last=a.count-1;isNaN(b)?d(b,a.slides).remove():m&&n?a.slides.eq(a.last).remove():
a.slides.eq(b).remove();a.doMath();a.update(e,"remove");a.slides=d(c.selector+":not(.clone)",a);a.setup();c.removed(a)};f.init()};d.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7E3,animationSpeed:600,initDelay:0,randomize:!1,pauseOnAction:!0,pauseOnHover:!1,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",
keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:0,maxItems:0,move:0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}};d.fn.flexslider=function(j){void 0===j&&(j={});if("object"===typeof j)return this.each(function(){var a=d(this),c=a.find(j.selector?j.selector:".slides > li");1===c.length?(c.fadeIn(400),
j.start&&j.start(a)):void 0==a.data("flexslider")&&new d.flexslider(this,j)});var l=d(this).data("flexslider");switch(j){case "play":l.play();break;case "pause":l.pause();break;case "next":l.flexAnimate(l.getTarget("next"),!0);break;case "prev":case "previous":l.flexAnimate(l.getTarget("prev"),!0);break;default:"number"===typeof j&&l.flexAnimate(j,!0)}}})(jQuery);;
/**
 * jQuery CSS Customizable Scrollbar
 *
 * Copyright 2015, Yuriy Khabarov
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 * If you found bug, please contact me via email <13real008@gmail.com>
 *
 * Compressed by http://jscompress.com/
 *
 * @author Yuriy Khabarov aka Gromo
 * @version 0.2.11
 * @url https://github.com/gromo/jquery.scrollbar/
 *
 */
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],b):b("undefined"!=typeof exports?require("jquery"):a.jQuery)}(this,function(a){"use strict";function h(b){if(c.webkit&&!b)return{height:0,width:0};if(!c.data.outer){var d={border:"none","box-sizing":"content-box",height:"200px",margin:"0",padding:"0",width:"200px"};c.data.inner=a("<div>").css(a.extend({},d)),c.data.outer=a("<div>").css(a.extend({left:"-1000px",overflow:"scroll",position:"absolute",top:"-1000px"},d)).append(c.data.inner).appendTo("body")}return c.data.outer.scrollLeft(1e3).scrollTop(1e3),{height:Math.ceil(c.data.outer.offset().top-c.data.inner.offset().top||0),width:Math.ceil(c.data.outer.offset().left-c.data.inner.offset().left||0)}}function i(){var a=h(!0);return!(a.height||a.width)}function j(a){var b=a.originalEvent;return(!b.axis||b.axis!==b.HORIZONTAL_AXIS)&&!b.wheelDeltaX}var b=!1,c={data:{index:0,name:"scrollbar"},firefox:/firefox/i.test(navigator.userAgent),macosx:/mac/i.test(navigator.platform),msedge:/edge\/\d+/i.test(navigator.userAgent),msie:/(msie|trident)/i.test(navigator.userAgent),mobile:/android|webos|iphone|ipad|ipod|blackberry/i.test(navigator.userAgent),overlay:null,scroll:null,scrolls:[],webkit:/webkit/i.test(navigator.userAgent)&&!/edge\/\d+/i.test(navigator.userAgent)};c.scrolls.add=function(a){this.remove(a).push(a)},c.scrolls.remove=function(b){for(;a.inArray(b,this)>=0;)this.splice(a.inArray(b,this),1);return this};var d={autoScrollSize:!0,autoUpdate:!0,debug:!1,disableBodyScroll:!1,duration:200,ignoreMobile:!1,ignoreOverlay:!1,isRtl:!1,scrollStep:30,showArrows:!1,stepScrolling:!0,scrollx:null,scrolly:null,onDestroy:null,onFallback:null,onInit:null,onScroll:null,onUpdate:null},e=function(b){c.scroll||(c.overlay=i(),c.scroll=h(),g(),a(window).resize(function(){var a=!1;if(c.scroll&&(c.scroll.height||c.scroll.width)){var b=h();b.height===c.scroll.height&&b.width===c.scroll.width||(c.scroll=b,a=!0)}g(a)})),this.container=b,this.namespace=".scrollbar_"+c.data.index++,this.options=a.extend({},d,window.jQueryScrollbarOptions||{}),this.scrollTo=null,this.scrollx={},this.scrolly={},b.data(c.data.name,this),c.scrolls.add(this)};e.prototype={destroy:function(){if(this.wrapper){this.container.removeData(c.data.name),c.scrolls.remove(this);var b=this.container.scrollLeft(),d=this.container.scrollTop();this.container.insertBefore(this.wrapper).css({height:"",margin:"","max-height":""}).removeClass("scroll-content scroll-scrollx_visible scroll-scrolly_visible").off(this.namespace).scrollLeft(b).scrollTop(d),this.scrollx.scroll.removeClass("scroll-scrollx_visible").find("div").addBack().off(this.namespace),this.scrolly.scroll.removeClass("scroll-scrolly_visible").find("div").addBack().off(this.namespace),this.wrapper.remove(),a(document).add("body").off(this.namespace),a.isFunction(this.options.onDestroy)&&this.options.onDestroy.apply(this,[this.container])}},init:function(b){var d=this,e=this.container,f=this.containerWrapper||e,g=this.namespace,h=a.extend(this.options,b||{}),i={x:this.scrollx,y:this.scrolly},k=this.wrapper,l={},m={scrollLeft:e.scrollLeft(),scrollTop:e.scrollTop()};if(c.mobile&&h.ignoreMobile||c.overlay&&h.ignoreOverlay||c.macosx&&!c.webkit)return a.isFunction(h.onFallback)&&h.onFallback.apply(this,[e]),!1;if(k)l={height:"auto","margin-bottom":c.scroll.height*-1+"px","max-height":""},l[h.isRtl?"margin-left":"margin-right"]=c.scroll.width*-1+"px",f.css(l);else{if(this.wrapper=k=a("<div>").addClass("scroll-wrapper").addClass(e.attr("class")).css("position","absolute"===e.css("position")?"absolute":"relative").insertBefore(e).append(e),h.isRtl&&k.addClass("scroll--rtl"),e.is("textarea")&&(this.containerWrapper=f=a("<div>").insertBefore(e).append(e),k.addClass("scroll-textarea")),l={height:"auto","margin-bottom":c.scroll.height*-1+"px","max-height":""},l[h.isRtl?"margin-left":"margin-right"]=c.scroll.width*-1+"px",f.addClass("scroll-content").css(l),e.on("scroll"+g,function(b){var f=e.scrollLeft(),g=e.scrollTop();if(h.isRtl)switch(!0){case c.firefox:f=Math.abs(f);case c.msedge||c.msie:f=e[0].scrollWidth-e[0].clientWidth-f}a.isFunction(h.onScroll)&&h.onScroll.call(d,{maxScroll:i.y.maxScrollOffset,scroll:g,size:i.y.size,visible:i.y.visible},{maxScroll:i.x.maxScrollOffset,scroll:f,size:i.x.size,visible:i.x.visible}),i.x.isVisible&&i.x.scroll.bar.css("left",f*i.x.kx+"px"),i.y.isVisible&&i.y.scroll.bar.css("top",g*i.y.kx+"px")}),k.on("scroll"+g,function(){k.scrollTop(0).scrollLeft(0)}),h.disableBodyScroll){var n=function(a){j(a)?i.y.isVisible&&i.y.mousewheel(a):i.x.isVisible&&i.x.mousewheel(a)};k.on("MozMousePixelScroll"+g,n),k.on("mousewheel"+g,n),c.mobile&&k.on("touchstart"+g,function(b){var c=b.originalEvent.touches&&b.originalEvent.touches[0]||b,d={pageX:c.pageX,pageY:c.pageY},f={left:e.scrollLeft(),top:e.scrollTop()};a(document).on("touchmove"+g,function(a){var b=a.originalEvent.targetTouches&&a.originalEvent.targetTouches[0]||a;e.scrollLeft(f.left+d.pageX-b.pageX),e.scrollTop(f.top+d.pageY-b.pageY),a.preventDefault()}),a(document).on("touchend"+g,function(){a(document).off(g)})})}a.isFunction(h.onInit)&&h.onInit.apply(this,[e])}a.each(i,function(b,f){var k=null,l=1,m="x"===b?"scrollLeft":"scrollTop",n=h.scrollStep,o=function(){var a=e[m]();e[m](a+n),1==l&&a+n>=p&&(a=e[m]()),l==-1&&a+n<=p&&(a=e[m]()),e[m]()==a&&k&&k()},p=0;f.scroll||(f.scroll=d._getScroll(h["scroll"+b]).addClass("scroll-"+b),h.showArrows&&f.scroll.addClass("scroll-element_arrows_visible"),f.mousewheel=function(a){if(!f.isVisible||"x"===b&&j(a))return!0;if("y"===b&&!j(a))return i.x.mousewheel(a),!0;var c=a.originalEvent.wheelDelta*-1||a.originalEvent.detail,g=f.size-f.visible-f.offset;return c||("x"===b&&a.originalEvent.deltaX?c=40*a.originalEvent.deltaX:"y"===b&&a.originalEvent.deltaY&&(c=40*a.originalEvent.deltaY)),(c>0&&p<g||c<0&&p>0)&&(p+=c,p<0&&(p=0),p>g&&(p=g),d.scrollTo=d.scrollTo||{},d.scrollTo[m]=p,setTimeout(function(){d.scrollTo&&(e.stop().animate(d.scrollTo,240,"linear",function(){p=e[m]()}),d.scrollTo=null)},1)),a.preventDefault(),!1},f.scroll.on("MozMousePixelScroll"+g,f.mousewheel).on("mousewheel"+g,f.mousewheel).on("mouseenter"+g,function(){p=e[m]()}),f.scroll.find(".scroll-arrow, .scroll-element_track").on("mousedown"+g,function(g){if(1!=g.which)return!0;l=1;var i={eventOffset:g["x"===b?"pageX":"pageY"],maxScrollValue:f.size-f.visible-f.offset,scrollbarOffset:f.scroll.bar.offset()["x"===b?"left":"top"],scrollbarSize:f.scroll.bar["x"===b?"outerWidth":"outerHeight"]()},j=0,q=0;if(a(this).hasClass("scroll-arrow")){if(l=a(this).hasClass("scroll-arrow_more")?1:-1,n=h.scrollStep*l,p=l>0?i.maxScrollValue:0,h.isRtl)switch(!0){case c.firefox:p=l>0?0:i.maxScrollValue*-1;break;case c.msie||c.msedge:}}else l=i.eventOffset>i.scrollbarOffset+i.scrollbarSize?1:i.eventOffset<i.scrollbarOffset?-1:0,"x"===b&&h.isRtl&&(c.msie||c.msedge)&&(l*=-1),n=Math.round(.75*f.visible)*l,p=i.eventOffset-i.scrollbarOffset-(h.stepScrolling?1==l?i.scrollbarSize:0:Math.round(i.scrollbarSize/2)),p=e[m]()+p/f.kx;return d.scrollTo=d.scrollTo||{},d.scrollTo[m]=h.stepScrolling?e[m]()+n:p,h.stepScrolling&&(k=function(){p=e[m](),clearInterval(q),clearTimeout(j),j=0,q=0},j=setTimeout(function(){q=setInterval(o,40)},h.duration+100)),setTimeout(function(){d.scrollTo&&(e.animate(d.scrollTo,h.duration),d.scrollTo=null)},1),d._handleMouseDown(k,g)}),f.scroll.bar.on("mousedown"+g,function(i){if(1!=i.which)return!0;var j=i["x"===b?"pageX":"pageY"],k=e[m]();return f.scroll.addClass("scroll-draggable"),a(document).on("mousemove"+g,function(a){var d=parseInt((a["x"===b?"pageX":"pageY"]-j)/f.kx,10);"x"===b&&h.isRtl&&(c.msie||c.msedge)&&(d*=-1),e[m](k+d)}),d._handleMouseDown(function(){f.scroll.removeClass("scroll-draggable"),p=e[m]()},i)}))}),a.each(i,function(a,b){var c="scroll-scroll"+a+"_visible",d="x"==a?i.y:i.x;b.scroll.removeClass(c),d.scroll.removeClass(c),f.removeClass(c)}),a.each(i,function(b,c){a.extend(c,"x"==b?{offset:parseInt(e.css("left"),10)||0,size:e.prop("scrollWidth"),visible:k.width()}:{offset:parseInt(e.css("top"),10)||0,size:e.prop("scrollHeight"),visible:k.height()})}),this._updateScroll("x",this.scrollx),this._updateScroll("y",this.scrolly),a.isFunction(h.onUpdate)&&h.onUpdate.apply(this,[e]),a.each(i,function(a,b){var c="x"===a?"left":"top",d="x"===a?"outerWidth":"outerHeight",f="x"===a?"width":"height",g=parseInt(e.css(c),10)||0,i=b.size,j=b.visible+g,k=b.scroll.size[d]()+(parseInt(b.scroll.size.css(c),10)||0);h.autoScrollSize&&(b.scrollbarSize=parseInt(k*j/i,10),b.scroll.bar.css(f,b.scrollbarSize+"px")),b.scrollbarSize=b.scroll.bar[d](),b.kx=(k-b.scrollbarSize)/(i-j)||1,b.maxScrollOffset=i-j}),e.scrollLeft(m.scrollLeft).scrollTop(m.scrollTop).trigger("scroll")},_getScroll:function(b){var c={advanced:['<div class="scroll-element">','<div class="scroll-element_corner"></div>','<div class="scroll-arrow scroll-arrow_less"></div>','<div class="scroll-arrow scroll-arrow_more"></div>','<div class="scroll-element_outer">','<div class="scroll-element_size"></div>','<div class="scroll-element_inner-wrapper">','<div class="scroll-element_inner scroll-element_track">','<div class="scroll-element_inner-bottom"></div>',"</div>","</div>",'<div class="scroll-bar">','<div class="scroll-bar_body">','<div class="scroll-bar_body-inner"></div>',"</div>",'<div class="scroll-bar_bottom"></div>','<div class="scroll-bar_center"></div>',"</div>","</div>","</div>"].join(""),simple:['<div class="scroll-element">','<div class="scroll-element_outer">','<div class="scroll-element_size"></div>','<div class="scroll-element_track"></div>','<div class="scroll-bar"></div>',"</div>","</div>"].join("")};return c[b]&&(b=c[b]),b||(b=c.simple),b="string"==typeof b?a(b).appendTo(this.wrapper):a(b),a.extend(b,{bar:b.find(".scroll-bar"),size:b.find(".scroll-element_size"),track:b.find(".scroll-element_track")}),b},_handleMouseDown:function(b,c){var d=this.namespace;return a(document).on("blur"+d,function(){a(document).add("body").off(d),b&&b()}),a(document).on("dragstart"+d,function(a){return a.preventDefault(),!1}),a(document).on("mouseup"+d,function(){a(document).add("body").off(d),b&&b()}),a("body").on("selectstart"+d,function(a){return a.preventDefault(),!1}),c&&c.preventDefault(),!1},_updateScroll:function(b,d){var e=this.container,f=this.containerWrapper||e,g="scroll-scroll"+b+"_visible",h="x"===b?this.scrolly:this.scrollx,i=parseInt(this.container.css("x"===b?"left":"top"),10)||0,j=this.wrapper,k=d.size,l=d.visible+i;d.isVisible=k-l>1,d.isVisible?(d.scroll.addClass(g),h.scroll.addClass(g),f.addClass(g)):(d.scroll.removeClass(g),h.scroll.removeClass(g),f.removeClass(g)),"y"===b&&(e.is("textarea")||k<l?f.css({height:l+c.scroll.height+"px","max-height":"none"}):f.css({"max-height":l+c.scroll.height+"px"})),d.size==e.prop("scrollWidth")&&h.size==e.prop("scrollHeight")&&d.visible==j.width()&&h.visible==j.height()&&d.offset==(parseInt(e.css("left"),10)||0)&&h.offset==(parseInt(e.css("top"),10)||0)||(a.extend(this.scrollx,{offset:parseInt(e.css("left"),10)||0,size:e.prop("scrollWidth"),visible:j.width()}),a.extend(this.scrolly,{offset:parseInt(e.css("top"),10)||0,size:this.container.prop("scrollHeight"),visible:j.height()}),this._updateScroll("x"===b?"y":"x",h))}};var f=e;a.fn.scrollbar=function(b,d){return"string"!=typeof b&&(d=b,b="init"),"undefined"==typeof d&&(d=[]),a.isArray(d)||(d=[d]),this.not("body, .scroll-wrapper").each(function(){var e=a(this),g=e.data(c.data.name);(g||"init"===b)&&(g||(g=new f(e)),g[b]&&g[b].apply(g,d))}),this},a.fn.scrollbar.options=d;var g=function(){var a=0,d=0;return function(e){var f,h,i,j,k,l,m;for(f=0;f<c.scrolls.length;f++)j=c.scrolls[f],h=j.container,i=j.options,k=j.wrapper,l=j.scrollx,m=j.scrolly,(e||i.autoUpdate&&k&&k.is(":visible")&&(h.prop("scrollWidth")!=l.size||h.prop("scrollHeight")!=m.size||k.width()!=l.visible||k.height()!=m.visible))&&(j.init(),i.debug&&(window.console&&console.log({scrollHeight:h.prop("scrollHeight")+":"+j.scrolly.size,scrollWidth:h.prop("scrollWidth")+":"+j.scrollx.size,visibleHeight:k.height()+":"+j.scrolly.visible,visibleWidth:k.width()+":"+j.scrollx.visible},!0),d++));b&&d>10?(window.console&&console.log("Scroll updates exceed 10"),g=function(){}):(clearTimeout(a),a=setTimeout(g,300))}}();window.angular&&!function(a){a.module("jQueryScrollbar",[]).provider("jQueryScrollbar",function(){var b=d;return{setOptions:function(c){a.extend(b,c)},$get:function(){return{options:a.copy(b)}}}}).directive("jqueryScrollbar",["jQueryScrollbar","$parse",function(a,b){return{restrict:"AC",link:function(c,d,e){var f=b(e.jqueryScrollbar),g=f(c);d.scrollbar(g||a.options).on("$destroy",function(){d.scrollbar("destroy")})}}}])}(window.angular)});;
//https://github.com/js-cookie/js-cookie

(function (must) {

	must.cookies = (function () {

		function extend() {
			var i = 0;
			var result = {};
			for (; i < arguments.length; i++) {
				var attributes = arguments[i];
				for (var key in attributes) {
					result[key] = attributes[key];
				}
			}
			return result;
		}

		function init(converter) {

			function api(key, value, attributes) {
				var result;
				if (typeof document === 'undefined') {
					return;
				}

				// Write

				if (arguments.length > 1) {
					attributes = extend({
						path: '/'
					}, api.defaults, attributes);

					if (typeof attributes.expires === 'number') {
						var expires = new Date();
						expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);
						attributes.expires = expires;
					}

					try {
						result = JSON.stringify(value);
						if (/^[\{\[]/.test(result)) {
							value = result;
						}
					} catch (e) { }

					if (!converter.write) {
						value = encodeURIComponent(String(value))
							.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
					} else {
						value = converter.write(value, key);
					}

					key = encodeURIComponent(String(key));
					key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
					key = key.replace(/[\(\)]/g, escape);

					return (document.cookie = [
						key, '=', value,
						attributes.expires ? '; expires=' + attributes.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
						attributes.path ? '; path=' + attributes.path : '',
						attributes.domain ? '; domain=' + attributes.domain : '',
						attributes.secure ? '; secure' : ''
					].join(''));
				}

				// Read

				if (!key) {
					result = {};
				}

				// To prevent the for loop in the first place assign an empty array
				// in case there are no cookies at all. Also prevents odd result when
				// calling "get()"
				var cookies = document.cookie ? document.cookie.split('; ') : [];
				var rdecode = /(%[0-9A-Z]{2})+/g;
				var i = 0;

				for (; i < cookies.length; i++) {
					var parts = cookies[i].split('=');
					var cookie = parts.slice(1).join('=');

					if (cookie.charAt(0) === '"') {
						cookie = cookie.slice(1, -1);
					}

					try {
						var name = parts[0].replace(rdecode, decodeURIComponent);
						cookie = converter.read ?
							converter.read(cookie, name) : converter(cookie, name) ||
							cookie.replace(rdecode, decodeURIComponent);

						if (this.json) {
							try {
								cookie = JSON.parse(cookie);
							} catch (e) { }
						}

						if (key === name) {
							result = cookie;
							break;
						}

						if (!key) {
							result[name] = cookie;
						}
					} catch (e) { }
				}

				return result;
			}
			

			api.set = api;
			api.get = function (key) {
				return api(key);
			};
			api.getJSON = function () {
				return api.apply({
					json: true
				}, [].slice.call(arguments));
			};
			api.defaults = {};

			api.remove = function (key, attributes) {
				api(key, '', extend(attributes, {
					expires: -1
				}));
			};

			api.withConverter = init;

			//Keys
			api.keys = {
				humanSearch : "Human_Search"
			};

			return api;
		}

		return init(function () { });
	}());
}(this.must = this.must || {}));
;
(function (must) {
    "use strict";
    must.common = must.common || {};
    must.common.CustomizeCookies = function () {

        var params = {
            paramCurrentBrand: null,
            paramAPLEnumBrand: null,
            paramGoogleAnalyticsKeyId: null,
            paramGoogleAnalyticsKeyValue: null,
            paramUserAuthenticated: null,
            paramServerName: null,
            paramAnalyticsCookies: null,
            paramAnalyticsDomain: null,
            paramBrainsonicCookies: null,
            paramBrainsonicDomain: null,
            paramEloquaCookies: null,
            paramEloquaDomain: null
        };

        var privateInit = function (options) {

            $.extend(params, options);

            var expiryDate = new Date();
            var isBannerReq = true;

            // expiry date for consent tracking cookie:
            //13 months(Cookiename: webCookiePreference)
            expiryDate.setMonth(expiryDate.getMonth() + 12);

            //Default settings for cookie: webCookiePreference
            var setCookie = function () {
                var eloqua = params.paramCurrentBrand === params.paramAPLEnumBrand;
                must.cookies.set("webCookiePreference",
                    "analytics=true,brainsonic=true,eloqua=" + eloqua,
                    { expires: expiryDate });
            };

            //To delete specific cookies
            var deleteCookie = function (cookieListArray, domainListArray) {

                var cookieList = cookieListArray.split(";");
                var domainList = domainListArray.split(";");
                if (cookieList !== null && cookieList.length > 0 && domainList !== null && domainList.length > 0) {
                    $.each(cookieList,
                        function (key, value) {
                            var expiry = new Date();
                            expiry.setTime(expiry.getTime() - 1000 * 60 * 60 * 24);
                            var expires = "expires=" + expiry.toGMTString();

                            $.each(domainList, function (a, val) {
                                var domain = "domain=" + val;
                                window.document.cookie = value + "=" + "; " + expires + ";" + domain;
                            });

                        });
                }
            };

            //Function to customize cookies based on user consent.
            var customizeCookies = function () {

                if (!must.common.GetCookieConsent("analytics")) {
                    deleteCookie(params.paramAnalyticsCookies, params.paramAnalyticsDomain);
                }

                if (!must.common.GetCookieConsent("brainsonic")) {
                    deleteCookie(params.paramBrainsonicCookies, params.paramBrainsonicDomain);
                }

                if (params.paramCurrentBrand === params.paramAPLEnumBrand) {
                    if (!must.common.GetCookieConsent("eloqua")) {
                        deleteCookie(params.paramEloquaCookies, params.paramEloquaDomain);
                    }
                }
            };

            //Function to enable/disable analytical based on webCookiePreference
            //var gaEnableOrDisable = function () {
            //    if (must.cookies.get("webCookiePreference")) {
            //       var result = must.common.GetCookieConsent("analytics");

            //       if (result) {
            //           window["ga-disable-" + params.paramGoogleAnalyticsKeyId] = false;
            //       } else {
            //           window["ga-disable-" + params.paramGoogleAnalyticsKeyId] = true;
            //      }
            //   }

            //   if (window["ga-disable-" + params.paramGoogleAnalyticsKeyId] !== true) {
            //       ga("create",
            //           params.paramGoogleAnalyticsKeyId,
            //           params.paramGoogleAnalyticsKeyValue,
            //          { "siteSpeedSampleRate": 100 });
            //       ga("set", "dimension1", params.paramUserAuthenticated);
            //       ga("set", "dimension2", params.paramServerName);
            //       ga("send", "pageview");
            //   }
            //};

            $(document).ready(function () {
                if (!must.cookies.get("webCookiePreference")) {
                    must.cookies.set("webCookiePreference",
                        "analytics=Wait,brainsonic=Wait,eloqua=Wait",
                        { expires: expiryDate });
                }

                $.each(must.cookies.get("webCookiePreference").split(","),
                    function (key, value) {
                        var val = value.substr(value.indexOf("=") + 1);
                        if (val !== "Wait") {
                            isBannerReq = false;
                        }
                    });

                if (isBannerReq) {
                    $("#cookiesConsent").show();
                }

                //gaEnableOrDisable();
            });

            //Function to check if a cookie consent is sunmitted or not
            var isConsentSubmitted = function () {
                var consent = false;
                $.each(must.cookies.get("webCookiePreference").split(","),
                    function (key, value) {
                        var val = value.substr(value.indexOf("=") + 1);
                        if (val !== "Wait") {
                            consent = true;
                        }
                    });
                return consent;
            }

            //Function to check if a specific cookie is disabled or not
            var isCookieDisabled = function (cookieName) {
                var consent = false;
                if (must.cookies.get("webCookiePreference")) {
                    var consentArray = must.cookies.get("webCookiePreference").split(",");
                    consent = consentArray.indexOf(cookieName + "=false") > -1;
                }
                return consent;
            };

            //set cookies slide based on the webCookiePreference in the customize screen
            var setCustomizeOptions = function () {
                if (isCookieDisabled("analytics")) {
                    $("#chk_Analytics__on").prop("checked", false);
                }
                else {
                    $("#chk_Analytics__on").prop("checked", true);
                }

                if (isCookieDisabled("brainsonic")) {
                    $("#chk_Brainsonic__on").prop("checked", false);
                }
                else {
                    $("#chk_Brainsonic__on").prop("checked", true);
                }

                if (params.paramCurrentBrand === params.paramAPLEnumBrand) {
                    if (isCookieDisabled("eloqua")) {
                        $("#chk_Eloqua__on").prop("checked", false);
                    }
                    else {
                        $("#chk_Eloqua__on").prop("checked", true);
                    }
                }
            }

            // When the user clicks on <span> (x)
            //or accept all, close the modal
            $("#closeConsent, #acceptAll").on("click",
                function () {
                    $("#cookiesConsent").hide();
                    setCookie();
                    //gaEnableOrDisable();
                });

            //When the user chooses to save their cookie consent
            $("#saveCookies").on("click",
                function () {
                    var analyticsVal = $("#chk_Analytics__on").prop("checked");
                    var brainsonicVal = $("#chk_Brainsonic__on").prop("checked");
                    var eloquaVal = params.paramCurrentBrand === params.paramAPLEnumBrand ? $("#chk_Eloqua__on").prop("checked") : false;

                    $("#customizeCookies").hide();
                    $("#cookiesConsent").hide();
                    must.cookies.set("webCookiePreference", "analytics=" + analyticsVal +
                        ",brainsonic=" + brainsonicVal +
                        ",eloqua=" + eloquaVal, { expires: expiryDate });
                    //gaEnableOrDisable();
                    customizeCookies();
                });

            //When user clicks customize button
            $("#customize, #customizeFooter").on("click",
                function () {                    
                    setCustomizeOptions();
                    $("#customizeCookies").show();
                });
            
            //When user chooses to close the customize cookies popup
            $("#closeCustomizePopup").on("click",
                function () {
                    $("#customizeCookies").hide();
                });

            $(document).click(function (event) {
                //when the user click on anything except
                //the modal itself, close the modal
                if ($(event.target).context.tagName.toLowerCase() === "a" 
                    || $(event.target).context.tagName.toLowerCase() === "button" 
                    || $(event.target).context.tagName.toLowerCase() === "span") {
                    if (!$(event.target).closest("#closeConsent,#cookiesConsent").length
                        && !isConsentSubmitted()) {
                        $("#cookiesConsent").hide();
                        setCookie();
                    }
                }
            });
        };
        return {
            init: privateInit
        };
    };

    must.common.GetCookieConsent = function (cookieName) {
        var consent = false;
        if (must.cookies.get("webCookiePreference")) {
            var consentArray = must.cookies.get("webCookiePreference").split(",");
            consent = consentArray.indexOf(cookieName + "=true") > -1;
        }
        return consent;
    };
}(this.must = this.must || {}));;
(function (must) {
	'use strict';

	var params = {
		paramSitekey: null,
		paramActionMethod: null,
		paramIsRecaptchaEnabled: null,
		paramUserAuthenticated: null,
		paramSubmitButton: null,
		paramForm: null
	};

	must.common = must.common || {};
	must.recaptcha = function () {

		var init = function (parameter) {
			
			$.extend(params, parameter);

			$(function () {
				$(params.paramSubmitButton).click(function (event) {
					var isRecaptchaEnabled = (params.paramIsRecaptchaEnabled === 'True') ? true : false;
					var isUserAuthenticated = (params.paramUserAuthenticated === 'True') ? true : false;
					if (isRecaptchaEnabled && !isUserAuthenticated) {
						if (typeof grecaptcha !== 'undefined') {
							event.preventDefault();
							grecaptcha.ready(function () {
								grecaptcha.execute(params.paramSitekey, { action: params.paramActionMethod }).then(function (token) {
									$('#g-recaptcha-response').val(token);
									$(params.paramForm).submit();
								});
							});
						}
						else {
							$('#g-recaptcha-response').val('undefined');
							$(params.paramForm).submit();
						}
					}
				});
			});
		}
		return {
			validation: init
		};
	};
}(this.must = this.must || {}));;
(function (must) {
	must.resources = (function () {
		return {
			table_action_display: 'Display',
			table_action_title_mark_as_favorite: 'Is not favorite. Click to mark as favorite.',
			table_action_title_unmark_as_favorite: 'Is favorite. Click to unmark as favorite.',
			msg_err_as_favorite: 'as favorite',
			msg_err_try_to_add: 'Error when trying to add',
			msg_err_try_to_remove: 'Error when trying to remove',
			label_collapse: 'Collapse',
			label_expand: 'Expand',
			kfilterable_m_and: 'And',
			kfilterable_m_clear: 'Clear',
			kfilterable_m_filter: 'Filter',
			kfilterable_m_isfalse: 'is false',
			kfilterable_m_istrue: 'is true',
			kfilterable_m_or: 'Or',
			kfilterable_m_selectValue: 'Select Value',
			kfilterable_o_contains: 'Contains',
			kfilterable_o_d_gt: 'Is after',
			kfilterable_o_d_gte: 'Is after or equal to',
			kfilterable_o_d_lt: 'Is before',
			kfilterable_o_d_lte: 'Is before or equal to',
			kfilterable_o_doesnotcontain: 'Does not contain',
			kfilterable_o_endswith: 'Ends with',
			kfilterable_o_eq: 'Is equal to',
			kfilterable_o_n_gt: 'Is greater than',
			kfilterable_o_n_gte: 'Is greater than or equal to',
			kfilterable_o_n_lt: 'Is less than',
			kfilterable_o_n_lte: 'Is less than or equal to',
			kfilterable_o_neq: 'Is not equal to',
			kfilterable_o_startswith: 'Starts with',
			kfilterable_m_info: 'Show items with value that:',
			kpageable_m_display: '{0} - {1} of {2}',
			kpageable_m_first: 'First page',
			kpageable_m_last: 'Last page',
			kpageable_m_next: 'Next page',
			kpageable_m_previous: 'Previous page',
			label_sdisabled: 'Disabled',
			kgroupable_m_empty: 'Drag a column header and drop it here to group by that column',
            selectview_create_new_view: ' Create new view...'
		};
	}());
}(this.must = this.must || {}));;
/*!
 * Globalize
 *
 * http://github.com/jquery/globalize
 *
 * Copyright Software Freedom Conservancy, Inc.
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 */

(function( window, undefined ) {

var Globalize,
	// private variables
	regexHex,
	regexInfinity,
	regexParseFloat,
	regexTrim,
	// private JavaScript utility functions
	arrayIndexOf,
	endsWith,
	extend,
	isArray,
	isFunction,
	isObject,
	startsWith,
	trim,
	truncate,
	zeroPad,
	// private Globalization utility functions
	appendPreOrPostMatch,
	expandFormat,
	formatDate,
	formatNumber,
	getTokenRegExp,
	getEra,
	getEraYear,
	parseExact,
	parseNegativePattern;

// Global variable (Globalize) or CommonJS module (globalize)
Globalize = function( cultureSelector ) {
	return new Globalize.prototype.init( cultureSelector );
};

if ( typeof require !== "undefined" &&
	typeof exports !== "undefined" &&
	typeof module !== "undefined" ) {
	// Assume CommonJS
	module.exports = Globalize;
} else {
	// Export as global variable
	window.Globalize = Globalize;
}

Globalize.cultures = {};

Globalize.prototype = {
	constructor: Globalize,
	init: function( cultureSelector ) {
		this.cultures = Globalize.cultures;
		this.cultureSelector = cultureSelector;

		return this;
	}
};
Globalize.prototype.init.prototype = Globalize.prototype;

// 1. When defining a culture, all fields are required except the ones stated as optional.
// 2. Each culture should have a ".calendars" object with at least one calendar named "standard"
//    which serves as the default calendar in use by that culture.
// 3. Each culture should have a ".calendar" object which is the current calendar being used,
//    it may be dynamically changed at any time to one of the calendars in ".calendars".
Globalize.cultures[ "default" ] = {
	// A unique name for the culture in the form <language code>-<country/region code>
	name: "en",
	// the name of the culture in the english language
	englishName: "English",
	// the name of the culture in its own language
	nativeName: "English",
	// whether the culture uses right-to-left text
	isRTL: false,
	// "language" is used for so-called "specific" cultures.
	// For example, the culture "es-CL" means "Spanish, in Chili".
	// It represents the Spanish-speaking culture as it is in Chili,
	// which might have different formatting rules or even translations
	// than Spanish in Spain. A "neutral" culture is one that is not
	// specific to a region. For example, the culture "es" is the generic
	// Spanish culture, which may be a more generalized version of the language
	// that may or may not be what a specific culture expects.
	// For a specific culture like "es-CL", the "language" field refers to the
	// neutral, generic culture information for the language it is using.
	// This is not always a simple matter of the string before the dash.
	// For example, the "zh-Hans" culture is netural (Simplified Chinese).
	// And the "zh-SG" culture is Simplified Chinese in Singapore, whose lanugage
	// field is "zh-CHS", not "zh".
	// This field should be used to navigate from a specific culture to it's
	// more general, neutral culture. If a culture is already as general as it
	// can get, the language may refer to itself.
	language: "en",
	// numberFormat defines general number formatting rules, like the digits in
	// each grouping, the group separator, and how negative numbers are displayed.
	numberFormat: {
		// [negativePattern]
		// Note, numberFormat.pattern has no "positivePattern" unlike percent and currency,
		// but is still defined as an array for consistency with them.
		//   negativePattern: one of "(n)|-n|- n|n-|n -"
		pattern: [ "-n" ],
		// number of decimal places normally shown
		decimals: 2,
		// string that separates number groups, as in 1,000,000
		",": ",",
		// string that separates a number from the fractional portion, as in 1.99
		".": ".",
		// array of numbers indicating the size of each number group.
		// TODO: more detailed description and example
		groupSizes: [ 3 ],
		// symbol used for positive numbers
		"+": "+",
		// symbol used for negative numbers
		"-": "-",
		// symbol used for NaN (Not-A-Number)
		"NaN": "NaN",
		// symbol used for Negative Infinity
		negativeInfinity: "-Infinity",
		// symbol used for Positive Infinity
		positiveInfinity: "Infinity",
		percent: {
			// [negativePattern, positivePattern]
			//   negativePattern: one of "-n %|-n%|-%n|%-n|%n-|n-%|n%-|-% n|n %-|% n-|% -n|n- %"
			//   positivePattern: one of "n %|n%|%n|% n"
			pattern: [ "-n %", "n %" ],
			// number of decimal places normally shown
			decimals: 2,
			// array of numbers indicating the size of each number group.
			// TODO: more detailed description and example
			groupSizes: [ 3 ],
			// string that separates number groups, as in 1,000,000
			",": ",",
			// string that separates a number from the fractional portion, as in 1.99
			".": ".",
			// symbol used to represent a percentage
			symbol: "%"
		},
		currency: {
			// [negativePattern, positivePattern]
			//   negativePattern: one of "($n)|-$n|$-n|$n-|(n$)|-n$|n-$|n$-|-n $|-$ n|n $-|$ n-|$ -n|n- $|($ n)|(n $)"
			//   positivePattern: one of "$n|n$|$ n|n $"
			pattern: [ "($n)", "$n" ],
			// number of decimal places normally shown
			decimals: 2,
			// array of numbers indicating the size of each number group.
			// TODO: more detailed description and example
			groupSizes: [ 3 ],
			// string that separates number groups, as in 1,000,000
			",": ",",
			// string that separates a number from the fractional portion, as in 1.99
			".": ".",
			// symbol used to represent currency
			symbol: "$"
		}
	},
	// calendars defines all the possible calendars used by this culture.
	// There should be at least one defined with name "standard", and is the default
	// calendar used by the culture.
	// A calendar contains information about how dates are formatted, information about
	// the calendar's eras, a standard set of the date formats,
	// translations for day and month names, and if the calendar is not based on the Gregorian
	// calendar, conversion functions to and from the Gregorian calendar.
	calendars: {
		standard: {
			// name that identifies the type of calendar this is
			name: "Gregorian_USEnglish",
			// separator of parts of a date (e.g. "/" in 11/05/1955)
			"/": "/",
			// separator of parts of a time (e.g. ":" in 05:44 PM)
			":": ":",
			// the first day of the week (0 = Sunday, 1 = Monday, etc)
			firstDay: 0,
			days: {
				// full day names
				names: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
				// abbreviated day names
				namesAbbr: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ],
				// shortest day names
				namesShort: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ]
			},
			months: {
				// full month names (13 months for lunar calendards -- 13th month should be "" if not lunar)
				names: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" ],
				// abbreviated month names
				namesAbbr: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" ]
			},
			// AM and PM designators in one of these forms:
			// The usual view, and the upper and lower case versions
			//   [ standard, lowercase, uppercase ]
			// The culture does not use AM or PM (likely all standard date formats use 24 hour time)
			//   null
			AM: [ "AM", "am", "AM" ],
			PM: [ "PM", "pm", "PM" ],
			eras: [
				// eras in reverse chronological order.
				// name: the name of the era in this culture (e.g. A.D., C.E.)
				// start: when the era starts in ticks (gregorian, gmt), null if it is the earliest supported era.
				// offset: offset in years from gregorian calendar
				{
					"name": "A.D.",
					"start": null,
					"offset": 0
				}
			],
			// when a two digit year is given, it will never be parsed as a four digit
			// year greater than this year (in the appropriate era for the culture)
			// Set it as a full year (e.g. 2029) or use an offset format starting from
			// the current year: "+19" would correspond to 2029 if the current year 2010.
			twoDigitYearMax: 2029,
			// set of predefined date and time patterns used by the culture
			// these represent the format someone in this culture would expect
			// to see given the portions of the date that are shown.
			patterns: {
				// short date pattern
				d: "M/d/yyyy",
				// long date pattern
				D: "dddd, MMMM dd, yyyy",
				// short time pattern
				t: "h:mm tt",
				// long time pattern
				T: "h:mm:ss tt",
				// long date, short time pattern
				f: "dddd, MMMM dd, yyyy h:mm tt",
				// long date, long time pattern
				F: "dddd, MMMM dd, yyyy h:mm:ss tt",
				// month/day pattern
				M: "MMMM dd",
				// month/year pattern
				Y: "yyyy MMMM",
				// S is a sortable format that does not vary by culture
				S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss"
			}
			// optional fields for each calendar:
			/*
			monthsGenitive:
				Same as months but used when the day preceeds the month.
				Omit if the culture has no genitive distinction in month names.
				For an explaination of genitive months, see http://blogs.msdn.com/michkap/archive/2004/12/25/332259.aspx
			convert:
				Allows for the support of non-gregorian based calendars. This convert object is used to
				to convert a date to and from a gregorian calendar date to handle parsing and formatting.
				The two functions:
					fromGregorian( date )
						Given the date as a parameter, return an array with parts [ year, month, day ]
						corresponding to the non-gregorian based year, month, and day for the calendar.
					toGregorian( year, month, day )
						Given the non-gregorian year, month, and day, return a new Date() object
						set to the corresponding date in the gregorian calendar.
			*/
		}
	},
	// For localized strings
	messages: {}
};

Globalize.cultures[ "default" ].calendar = Globalize.cultures[ "default" ].calendars.standard;

Globalize.cultures.en = Globalize.cultures[ "default" ];

Globalize.cultureSelector = "en";

//
// private variables
//

regexHex = /^0x[a-f0-9]+$/i;
regexInfinity = /^[+\-]?infinity$/i;
regexParseFloat = /^[+\-]?\d*\.?\d*(e[+\-]?\d+)?$/;
regexTrim = /^\s+|\s+$/g;

//
// private JavaScript utility functions
//

arrayIndexOf = function( array, item ) {
	if ( array.indexOf ) {
		return array.indexOf( item );
	}
	for ( var i = 0, length = array.length; i < length; i++ ) {
		if ( array[i] === item ) {
			return i;
		}
	}
	return -1;
};

endsWith = function( value, pattern ) {
	return value.substr( value.length - pattern.length ) === pattern;
};

extend = function() {
	var options, name, src, copy, copyIsArray, clone,
		target = arguments[0] || {},
		i = 1,
		length = arguments.length,
		deep = false;

	// Handle a deep copy situation
	if ( typeof target === "boolean" ) {
		deep = target;
		target = arguments[1] || {};
		// skip the boolean and the target
		i = 2;
	}

	// Handle case when target is a string or something (possible in deep copy)
	if ( typeof target !== "object" && !isFunction(target) ) {
		target = {};
	}

	for ( ; i < length; i++ ) {
		// Only deal with non-null/undefined values
		if ( (options = arguments[ i ]) != null ) {
			// Extend the base object
			for ( name in options ) {
				src = target[ name ];
				copy = options[ name ];

				// Prevent never-ending loop
				if ( target === copy ) {
					continue;
				}

				// Recurse if we're merging plain objects or arrays
				if ( deep && copy && ( isObject(copy) || (copyIsArray = isArray(copy)) ) ) {
					if ( copyIsArray ) {
						copyIsArray = false;
						clone = src && isArray(src) ? src : [];

					} else {
						clone = src && isObject(src) ? src : {};
					}

					// Never move original objects, clone them
					target[ name ] = extend( deep, clone, copy );

				// Don't bring in undefined values
				} else if ( copy !== undefined ) {
					target[ name ] = copy;
				}
			}
		}
	}

	// Return the modified object
	return target;
};

isArray = Array.isArray || function( obj ) {
	return Object.prototype.toString.call( obj ) === "[object Array]";
};

isFunction = function( obj ) {
	return Object.prototype.toString.call( obj ) === "[object Function]";
};

isObject = function( obj ) {
	return Object.prototype.toString.call( obj ) === "[object Object]";
};

startsWith = function( value, pattern ) {
	return value.indexOf( pattern ) === 0;
};

trim = function( value ) {
	return ( value + "" ).replace( regexTrim, "" );
};

truncate = function( value ) {
	if ( isNaN( value ) ) {
		return NaN;
	}
	return Math[ value < 0 ? "ceil" : "floor" ]( value );
};

zeroPad = function( str, count, left ) {
	var l;
	for ( l = str.length; l < count; l += 1 ) {
		str = ( left ? ("0" + str) : (str + "0") );
	}
	return str;
};

//
// private Globalization utility functions
//

appendPreOrPostMatch = function( preMatch, strings ) {
	// appends pre- and post- token match strings while removing escaped characters.
	// Returns a single quote count which is used to determine if the token occurs
	// in a string literal.
	var quoteCount = 0,
		escaped = false;
	for ( var i = 0, il = preMatch.length; i < il; i++ ) {
		var c = preMatch.charAt( i );
		switch ( c ) {
			case "\'":
				if ( escaped ) {
					strings.push( "\'" );
				}
				else {
					quoteCount++;
				}
				escaped = false;
				break;
			case "\\":
				if ( escaped ) {
					strings.push( "\\" );
				}
				escaped = !escaped;
				break;
			default:
				strings.push( c );
				escaped = false;
				break;
		}
	}
	return quoteCount;
};

expandFormat = function( cal, format ) {
	// expands unspecified or single character date formats into the full pattern.
	format = format || "F";
	var pattern,
		patterns = cal.patterns,
		len = format.length;
	if ( len === 1 ) {
		pattern = patterns[ format ];
		if ( !pattern ) {
			throw "Invalid date format string \'" + format + "\'.";
		}
		format = pattern;
	}
	else if ( len === 2 && format.charAt(0) === "%" ) {
		// %X escape format -- intended as a custom format string that is only one character, not a built-in format.
		format = format.charAt( 1 );
	}
	return format;
};

formatDate = function( value, format, culture ) {
	var cal = culture.calendar,
		convert = cal.convert,
		ret;

	if ( !format || !format.length || format === "i" ) {
		if ( culture && culture.name.length ) {
			if ( convert ) {
				// non-gregorian calendar, so we cannot use built-in toLocaleString()
				ret = formatDate( value, cal.patterns.F, culture );
			}
			else {
				var eraDate = new Date( value.getTime() ),
					era = getEra( value, cal.eras );
				eraDate.setFullYear( getEraYear(value, cal, era) );
				ret = eraDate.toLocaleString();
			}
		}
		else {
			ret = value.toString();
		}
		return ret;
	}

	var eras = cal.eras,
		sortable = format === "s";
	format = expandFormat( cal, format );

	// Start with an empty string
	ret = [];
	var hour,
		zeros = [ "0", "00", "000" ],
		foundDay,
		checkedDay,
		dayPartRegExp = /([^d]|^)(d|dd)([^d]|$)/g,
		quoteCount = 0,
		tokenRegExp = getTokenRegExp(),
		converted;

	function padZeros( num, c ) {
		var r, s = num + "";
		if ( c > 1 && s.length < c ) {
			r = ( zeros[c - 2] + s);
			return r.substr( r.length - c, c );
		}
		else {
			r = s;
		}
		return r;
	}

	function hasDay() {
		if ( foundDay || checkedDay ) {
			return foundDay;
		}
		foundDay = dayPartRegExp.test( format );
		checkedDay = true;
		return foundDay;
	}

	function getPart( date, part ) {
		if ( converted ) {
			return converted[ part ];
		}
		switch ( part ) {
			case 0:
				return date.getFullYear();
			case 1:
				return date.getMonth();
			case 2:
				return date.getDate();
			default:
				throw "Invalid part value " + part;
		}
	}

	if ( !sortable && convert ) {
		converted = convert.fromGregorian( value );
	}

	for ( ; ; ) {
		// Save the current index
		var index = tokenRegExp.lastIndex,
			// Look for the next pattern
			ar = tokenRegExp.exec( format );

		// Append the text before the pattern (or the end of the string if not found)
		var preMatch = format.slice( index, ar ? ar.index : format.length );
		quoteCount += appendPreOrPostMatch( preMatch, ret );

		if ( !ar ) {
			break;
		}

		// do not replace any matches that occur inside a string literal.
		if ( quoteCount % 2 ) {
			ret.push( ar[0] );
			continue;
		}

		var current = ar[ 0 ],
			clength = current.length;

		switch ( current ) {
			case "ddd":
				//Day of the week, as a three-letter abbreviation
			case "dddd":
				// Day of the week, using the full name
				var names = ( clength === 3 ) ? cal.days.namesAbbr : cal.days.names;
				ret.push( names[value.getDay()] );
				break;
			case "d":
				// Day of month, without leading zero for single-digit days
			case "dd":
				// Day of month, with leading zero for single-digit days
				foundDay = true;
				ret.push(
					padZeros( getPart(value, 2), clength )
				);
				break;
			case "MMM":
				// Month, as a three-letter abbreviation
			case "MMMM":
				// Month, using the full name
				var part = getPart( value, 1 );
				ret.push(
					( cal.monthsGenitive && hasDay() ) ?
					( cal.monthsGenitive[ clength === 3 ? "namesAbbr" : "names" ][ part ] ) :
					( cal.months[ clength === 3 ? "namesAbbr" : "names" ][ part ] )
				);
				break;
			case "M":
				// Month, as digits, with no leading zero for single-digit months
			case "MM":
				// Month, as digits, with leading zero for single-digit months
				ret.push(
					padZeros( getPart(value, 1) + 1, clength )
				);
				break;
			case "y":
				// Year, as two digits, but with no leading zero for years less than 10
			case "yy":
				// Year, as two digits, with leading zero for years less than 10
			case "yyyy":
				// Year represented by four full digits
				part = converted ? converted[ 0 ] : getEraYear( value, cal, getEra(value, eras), sortable );
				if ( clength < 4 ) {
					part = part % 100;
				}
				ret.push(
					padZeros( part, clength )
				);
				break;
			case "h":
				// Hours with no leading zero for single-digit hours, using 12-hour clock
			case "hh":
				// Hours with leading zero for single-digit hours, using 12-hour clock
				hour = value.getHours() % 12;
				if ( hour === 0 ) hour = 12;
				ret.push(
					padZeros( hour, clength )
				);
				break;
			case "H":
				// Hours with no leading zero for single-digit hours, using 24-hour clock
			case "HH":
				// Hours with leading zero for single-digit hours, using 24-hour clock
				ret.push(
					padZeros( value.getHours(), clength )
				);
				break;
			case "m":
				// Minutes with no leading zero for single-digit minutes
			case "mm":
				// Minutes with leading zero for single-digit minutes
				ret.push(
					padZeros( value.getMinutes(), clength )
				);
				break;
			case "s":
				// Seconds with no leading zero for single-digit seconds
			case "ss":
				// Seconds with leading zero for single-digit seconds
				ret.push(
					padZeros( value.getSeconds(), clength )
				);
				break;
			case "t":
				// One character am/pm indicator ("a" or "p")
			case "tt":
				// Multicharacter am/pm indicator
				part = value.getHours() < 12 ? ( cal.AM ? cal.AM[0] : " " ) : ( cal.PM ? cal.PM[0] : " " );
				ret.push( clength === 1 ? part.charAt(0) : part );
				break;
			case "f":
				// Deciseconds
			case "ff":
				// Centiseconds
			case "fff":
				// Milliseconds
				ret.push(
					padZeros( value.getMilliseconds(), 3 ).substr( 0, clength )
				);
				break;
			case "z":
				// Time zone offset, no leading zero
			case "zz":
				// Time zone offset with leading zero
				hour = value.getTimezoneOffset() / 60;
				ret.push(
					( hour <= 0 ? "+" : "-" ) + padZeros( Math.floor(Math.abs(hour)), clength )
				);
				break;
			case "zzz":
				// Time zone offset with leading zero
				hour = value.getTimezoneOffset() / 60;
				ret.push(
					( hour <= 0 ? "+" : "-" ) + padZeros( Math.floor(Math.abs(hour)), 2 ) +
					// Hard coded ":" separator, rather than using cal.TimeSeparator
					// Repeated here for consistency, plus ":" was already assumed in date parsing.
					":" + padZeros( Math.abs(value.getTimezoneOffset() % 60), 2 )
				);
				break;
			case "g":
			case "gg":
				if ( cal.eras ) {
					ret.push(
						cal.eras[ getEra(value, eras) ].name
					);
				}
				break;
		case "/":
			ret.push( cal["/"] );
			break;
		default:
			throw "Invalid date format pattern \'" + current + "\'.";
		}
	}
	return ret.join( "" );
};

// formatNumber
(function() {
	var expandNumber;

	expandNumber = function( number, precision, formatInfo ) {
		var groupSizes = formatInfo.groupSizes,
			curSize = groupSizes[ 0 ],
			curGroupIndex = 1,
			factor = Math.pow( 10, precision ),
			rounded = Math.round( number * factor ) / factor;

		if ( !isFinite(rounded) ) {
			rounded = number;
		}
		number = rounded;

		var numberString = number+"",
			right = "",
			split = numberString.split( /e/i ),
			exponent = split.length > 1 ? parseInt( split[1], 10 ) : 0;
		numberString = split[ 0 ];
		split = numberString.split( "." );
		numberString = split[ 0 ];
		right = split.length > 1 ? split[ 1 ] : "";

		var l;
		if ( exponent > 0 ) {
			right = zeroPad( right, exponent, false );
			numberString += right.slice( 0, exponent );
			right = right.substr( exponent );
		}
		else if ( exponent < 0 ) {
			exponent = -exponent;
			numberString = zeroPad( numberString, exponent + 1, true );
			right = numberString.slice( -exponent, numberString.length ) + right;
			numberString = numberString.slice( 0, -exponent );
		}

		if ( precision > 0 ) {
			right = formatInfo[ "." ] +
				( (right.length > precision) ? right.slice(0, precision) : zeroPad(right, precision) );
		}
		else {
			right = "";
		}

		var stringIndex = numberString.length - 1,
			sep = formatInfo[ "," ],
			ret = "";

		while ( stringIndex >= 0 ) {
			if ( curSize === 0 || curSize > stringIndex ) {
				return numberString.slice( 0, stringIndex + 1 ) + ( ret.length ? (sep + ret + right) : right );
			}
			ret = numberString.slice( stringIndex - curSize + 1, stringIndex + 1 ) + ( ret.length ? (sep + ret) : "" );

			stringIndex -= curSize;

			if ( curGroupIndex < groupSizes.length ) {
				curSize = groupSizes[ curGroupIndex ];
				curGroupIndex++;
			}
		}

		return numberString.slice( 0, stringIndex + 1 ) + sep + ret + right;
	};

	formatNumber = function( value, format, culture ) {
		if ( !isFinite(value) ) {
			if ( value === Infinity ) {
				return culture.numberFormat.positiveInfinity;
			}
			if ( value === -Infinity ) {
				return culture.numberFormat.negativeInfinity;
			}
			return culture.numberFormat[ "NaN" ];
		}
		if ( !format || format === "i" ) {
			return culture.name.length ? value.toLocaleString() : value.toString();
		}
		format = format || "D";

		var nf = culture.numberFormat,
			number = Math.abs( value ),
			precision = -1,
			pattern;
		if ( format.length > 1 ) precision = parseInt( format.slice(1), 10 );

		var current = format.charAt( 0 ).toUpperCase(),
			formatInfo;

		switch ( current ) {
			case "D":
				pattern = "n";
				number = truncate( number );
				if ( precision !== -1 ) {
					number = zeroPad( "" + number, precision, true );
				}
				if ( value < 0 ) number = "-" + number;
				break;
			case "N":
				formatInfo = nf;
				/* falls through */
			case "C":
				formatInfo = formatInfo || nf.currency;
				/* falls through */
			case "P":
				formatInfo = formatInfo || nf.percent;
				pattern = value < 0 ? formatInfo.pattern[ 0 ] : ( formatInfo.pattern[1] || "n" );
				if ( precision === -1 ) precision = formatInfo.decimals;
				number = expandNumber( number * (current === "P" ? 100 : 1), precision, formatInfo );
				break;
			default:
				throw "Bad number format specifier: " + current;
		}

		var patternParts = /n|\$|-|%/g,
			ret = "";
		for ( ; ; ) {
			var index = patternParts.lastIndex,
				ar = patternParts.exec( pattern );

			ret += pattern.slice( index, ar ? ar.index : pattern.length );

			if ( !ar ) {
				break;
			}

			switch ( ar[0] ) {
				case "n":
					ret += number;
					break;
				case "$":
					ret += nf.currency.symbol;
					break;
				case "-":
					// don't make 0 negative
					if ( /[1-9]/.test(number) ) {
						ret += nf[ "-" ];
					}
					break;
				case "%":
					ret += nf.percent.symbol;
					break;
			}
		}

		return ret;
	};

}());

getTokenRegExp = function() {
	// regular expression for matching date and time tokens in format strings.
	return (/\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g);
};

getEra = function( date, eras ) {
	if ( !eras ) return 0;
	var start, ticks = date.getTime();
	for ( var i = 0, l = eras.length; i < l; i++ ) {
		start = eras[ i ].start;
		if ( start === null || ticks >= start ) {
			return i;
		}
	}
	return 0;
};

getEraYear = function( date, cal, era, sortable ) {
	var year = date.getFullYear();
	if ( !sortable && cal.eras ) {
		// convert normal gregorian year to era-shifted gregorian
		// year by subtracting the era offset
		year -= cal.eras[ era ].offset;
	}
	return year;
};

// parseExact
(function() {
	var expandYear,
		getDayIndex,
		getMonthIndex,
		getParseRegExp,
		outOfRange,
		toUpper,
		toUpperArray;

	expandYear = function( cal, year ) {
		// expands 2-digit year into 4 digits.
		if ( year < 100 ) {
			var now = new Date(),
				era = getEra( now ),
				curr = getEraYear( now, cal, era ),
				twoDigitYearMax = cal.twoDigitYearMax;
			twoDigitYearMax = typeof twoDigitYearMax === "string" ? new Date().getFullYear() % 100 + parseInt( twoDigitYearMax, 10 ) : twoDigitYearMax;
			year += curr - ( curr % 100 );
			if ( year > twoDigitYearMax ) {
				year -= 100;
			}
		}
		return year;
	};

	getDayIndex = function	( cal, value, abbr ) {
		var ret,
			days = cal.days,
			upperDays = cal._upperDays;
		if ( !upperDays ) {
			cal._upperDays = upperDays = [
				toUpperArray( days.names ),
				toUpperArray( days.namesAbbr ),
				toUpperArray( days.namesShort )
			];
		}
		value = toUpper( value );
		if ( abbr ) {
			ret = arrayIndexOf( upperDays[1], value );
			if ( ret === -1 ) {
				ret = arrayIndexOf( upperDays[2], value );
			}
		}
		else {
			ret = arrayIndexOf( upperDays[0], value );
		}
		return ret;
	};

	getMonthIndex = function( cal, value, abbr ) {
		var months = cal.months,
			monthsGen = cal.monthsGenitive || cal.months,
			upperMonths = cal._upperMonths,
			upperMonthsGen = cal._upperMonthsGen;
		if ( !upperMonths ) {
			cal._upperMonths = upperMonths = [
				toUpperArray( months.names ),
				toUpperArray( months.namesAbbr )
			];
			cal._upperMonthsGen = upperMonthsGen = [
				toUpperArray( monthsGen.names ),
				toUpperArray( monthsGen.namesAbbr )
			];
		}
		value = toUpper( value );
		var i = arrayIndexOf( abbr ? upperMonths[1] : upperMonths[0], value );
		if ( i < 0 ) {
			i = arrayIndexOf( abbr ? upperMonthsGen[1] : upperMonthsGen[0], value );
		}
		return i;
	};

	getParseRegExp = function( cal, format ) {
		// converts a format string into a regular expression with groups that
		// can be used to extract date fields from a date string.
		// check for a cached parse regex.
		var re = cal._parseRegExp;
		if ( !re ) {
			cal._parseRegExp = re = {};
		}
		else {
			var reFormat = re[ format ];
			if ( reFormat ) {
				return reFormat;
			}
		}

		// expand single digit formats, then escape regular expression characters.
		var expFormat = expandFormat( cal, format ).replace( /([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g, "\\\\$1" ),
			regexp = [ "^" ],
			groups = [],
			index = 0,
			quoteCount = 0,
			tokenRegExp = getTokenRegExp(),
			match;

		// iterate through each date token found.
		while ( (match = tokenRegExp.exec(expFormat)) !== null ) {
			var preMatch = expFormat.slice( index, match.index );
			index = tokenRegExp.lastIndex;

			// don't replace any matches that occur inside a string literal.
			quoteCount += appendPreOrPostMatch( preMatch, regexp );
			if ( quoteCount % 2 ) {
				regexp.push( match[0] );
				continue;
			}

			// add a regex group for the token.
			var m = match[ 0 ],
				len = m.length,
				add;
			switch ( m ) {
				case "dddd": case "ddd":
				case "MMMM": case "MMM":
				case "gg": case "g":
					add = "(\\D+)";
					break;
				case "tt": case "t":
					add = "(\\D*)";
					break;
				case "yyyy":
				case "fff":
				case "ff":
				case "f":
					add = "(\\d{" + len + "})";
					break;
				case "dd": case "d":
				case "MM": case "M":
				case "yy": case "y":
				case "HH": case "H":
				case "hh": case "h":
				case "mm": case "m":
				case "ss": case "s":
					add = "(\\d\\d?)";
					break;
				case "zzz":
					add = "([+-]?\\d\\d?:\\d{2})";
					break;
				case "zz": case "z":
					add = "([+-]?\\d\\d?)";
					break;
				case "/":
					add = "(\\/)";
					break;
				default:
					throw "Invalid date format pattern \'" + m + "\'.";
			}
			if ( add ) {
				regexp.push( add );
			}
			groups.push( match[0] );
		}
		appendPreOrPostMatch( expFormat.slice(index), regexp );
		regexp.push( "$" );

		// allow whitespace to differ when matching formats.
		var regexpStr = regexp.join( "" ).replace( /\s+/g, "\\s+" ),
			parseRegExp = { "regExp": regexpStr, "groups": groups };

		// cache the regex for this format.
		return re[ format ] = parseRegExp;
	};

	outOfRange = function( value, low, high ) {
		return value < low || value > high;
	};

	toUpper = function( value ) {
		// "he-IL" has non-breaking space in weekday names.
		return value.split( "\u00A0" ).join( " " ).toUpperCase();
	};

	toUpperArray = function( arr ) {
		var results = [];
		for ( var i = 0, l = arr.length; i < l; i++ ) {
			results[ i ] = toUpper( arr[i] );
		}
		return results;
	};

	parseExact = function( value, format, culture ) {
		// try to parse the date string by matching against the format string
		// while using the specified culture for date field names.
		value = trim( value );
		var cal = culture.calendar,
			// convert date formats into regular expressions with groupings.
			// use the regexp to determine the input format and extract the date fields.
			parseInfo = getParseRegExp( cal, format ),
			match = new RegExp( parseInfo.regExp ).exec( value );
		if ( match === null ) {
			return null;
		}
		// found a date format that matches the input.
		var groups = parseInfo.groups,
			era = null, year = null, month = null, date = null, weekDay = null,
			hour = 0, hourOffset, min = 0, sec = 0, msec = 0, tzMinOffset = null,
			pmHour = false;
		// iterate the format groups to extract and set the date fields.
		for ( var j = 0, jl = groups.length; j < jl; j++ ) {
			var matchGroup = match[ j + 1 ];
			if ( matchGroup ) {
				var current = groups[ j ],
					clength = current.length,
					matchInt = parseInt( matchGroup, 10 );
				switch ( current ) {
					case "dd": case "d":
						// Day of month.
						date = matchInt;
						// check that date is generally in valid range, also checking overflow below.
						if ( outOfRange(date, 1, 31) ) return null;
						break;
					case "MMM": case "MMMM":
						month = getMonthIndex( cal, matchGroup, clength === 3 );
						if ( outOfRange(month, 0, 11) ) return null;
						break;
					case "M": case "MM":
						// Month.
						month = matchInt - 1;
						if ( outOfRange(month, 0, 11) ) return null;
						break;
					case "y": case "yy":
					case "yyyy":
						year = clength < 4 ? expandYear( cal, matchInt ) : matchInt;
						if ( outOfRange(year, 0, 9999) ) return null;
						break;
					case "h": case "hh":
						// Hours (12-hour clock).
						hour = matchInt;
						if ( hour === 12 ) hour = 0;
						if ( outOfRange(hour, 0, 11) ) return null;
						break;
					case "H": case "HH":
						// Hours (24-hour clock).
						hour = matchInt;
						if ( outOfRange(hour, 0, 23) ) return null;
						break;
					case "m": case "mm":
						// Minutes.
						min = matchInt;
						if ( outOfRange(min, 0, 59) ) return null;
						break;
					case "s": case "ss":
						// Seconds.
						sec = matchInt;
						if ( outOfRange(sec, 0, 59) ) return null;
						break;
					case "tt": case "t":
						// AM/PM designator.
						// see if it is standard, upper, or lower case PM. If not, ensure it is at least one of
						// the AM tokens. If not, fail the parse for this format.
						pmHour = cal.PM && ( matchGroup === cal.PM[0] || matchGroup === cal.PM[1] || matchGroup === cal.PM[2] );
						if (
							!pmHour && (
								!cal.AM || ( matchGroup !== cal.AM[0] && matchGroup !== cal.AM[1] && matchGroup !== cal.AM[2] )
							)
						) return null;
						break;
					case "f":
						// Deciseconds.
					case "ff":
						// Centiseconds.
					case "fff":
						// Milliseconds.
						msec = matchInt * Math.pow( 10, 3 - clength );
						if ( outOfRange(msec, 0, 999) ) return null;
						break;
					case "ddd":
						// Day of week.
					case "dddd":
						// Day of week.
						weekDay = getDayIndex( cal, matchGroup, clength === 3 );
						if ( outOfRange(weekDay, 0, 6) ) return null;
						break;
					case "zzz":
						// Time zone offset in +/- hours:min.
						var offsets = matchGroup.split( /:/ );
						if ( offsets.length !== 2 ) return null;
						hourOffset = parseInt( offsets[0], 10 );
						if ( outOfRange(hourOffset, -12, 13) ) return null;
						var minOffset = parseInt( offsets[1], 10 );
						if ( outOfRange(minOffset, 0, 59) ) return null;
						tzMinOffset = ( hourOffset * 60 ) + ( startsWith(matchGroup, "-") ? -minOffset : minOffset );
						break;
					case "z": case "zz":
						// Time zone offset in +/- hours.
						hourOffset = matchInt;
						if ( outOfRange(hourOffset, -12, 13) ) return null;
						tzMinOffset = hourOffset * 60;
						break;
					case "g": case "gg":
						var eraName = matchGroup;
						if ( !eraName || !cal.eras ) return null;
						eraName = trim( eraName.toLowerCase() );
						for ( var i = 0, l = cal.eras.length; i < l; i++ ) {
							if ( eraName === cal.eras[i].name.toLowerCase() ) {
								era = i;
								break;
							}
						}
						// could not find an era with that name
						if ( era === null ) return null;
						break;
				}
			}
		}
		var result = new Date(), defaultYear, convert = cal.convert;
		defaultYear = convert ? convert.fromGregorian( result )[ 0 ] : result.getFullYear();
		if ( year === null ) {
			year = defaultYear;
		}
		else if ( cal.eras ) {
			// year must be shifted to normal gregorian year
			// but not if year was not specified, its already normal gregorian
			// per the main if clause above.
			year += cal.eras[( era || 0 )].offset;
		}
		// set default day and month to 1 and January, so if unspecified, these are the defaults
		// instead of the current day/month.
		if ( month === null ) {
			month = 0;
		}
		if ( date === null ) {
			date = 1;
		}
		// now have year, month, and date, but in the culture's calendar.
		// convert to gregorian if necessary
		if ( convert ) {
			result = convert.toGregorian( year, month, date );
			// conversion failed, must be an invalid match
			if ( result === null ) return null;
		}
		else {
			// have to set year, month and date together to avoid overflow based on current date.
			result.setFullYear( year, month, date );
			// check to see if date overflowed for specified month (only checked 1-31 above).
			if ( result.getDate() !== date ) return null;
			// invalid day of week.
			if ( weekDay !== null && result.getDay() !== weekDay ) {
				return null;
			}
		}
		// if pm designator token was found make sure the hours fit the 24-hour clock.
		if ( pmHour && hour < 12 ) {
			hour += 12;
		}
		result.setHours( hour, min, sec, msec );
		if ( tzMinOffset !== null ) {
			// adjust timezone to utc before applying local offset.
			var adjustedMin = result.getMinutes() - ( tzMinOffset + result.getTimezoneOffset() );
			// Safari limits hours and minutes to the range of -127 to 127.  We need to use setHours
			// to ensure both these fields will not exceed this range.	adjustedMin will range
			// somewhere between -1440 and 1500, so we only need to split this into hours.
			result.setHours( result.getHours() + parseInt(adjustedMin / 60, 10), adjustedMin % 60 );
		}
		return result;
	};
}());

parseNegativePattern = function( value, nf, negativePattern ) {
	var neg = nf[ "-" ],
		pos = nf[ "+" ],
		ret;
	switch ( negativePattern ) {
		case "n -":
			neg = " " + neg;
			pos = " " + pos;
			/* falls through */
		case "n-":
			if ( endsWith(value, neg) ) {
				ret = [ "-", value.substr(0, value.length - neg.length) ];
			}
			else if ( endsWith(value, pos) ) {
				ret = [ "+", value.substr(0, value.length - pos.length) ];
			}
			break;
		case "- n":
			neg += " ";
			pos += " ";
			/* falls through */
		case "-n":
			if ( startsWith(value, neg) ) {
				ret = [ "-", value.substr(neg.length) ];
			}
			else if ( startsWith(value, pos) ) {
				ret = [ "+", value.substr(pos.length) ];
			}
			break;
		case "(n)":
			if ( startsWith(value, "(") && endsWith(value, ")") ) {
				ret = [ "-", value.substr(1, value.length - 2) ];
			}
			break;
	}
	return ret || [ "", value ];
};

//
// public instance functions
//

Globalize.prototype.findClosestCulture = function( cultureSelector ) {
	return Globalize.findClosestCulture.call( this, cultureSelector );
};

Globalize.prototype.format = function( value, format, cultureSelector ) {
	return Globalize.format.call( this, value, format, cultureSelector );
};

Globalize.prototype.localize = function( key, cultureSelector ) {
	return Globalize.localize.call( this, key, cultureSelector );
};

Globalize.prototype.parseInt = function( value, radix, cultureSelector ) {
	return Globalize.parseInt.call( this, value, radix, cultureSelector );
};

Globalize.prototype.parseFloat = function( value, radix, cultureSelector ) {
	return Globalize.parseFloat.call( this, value, radix, cultureSelector );
};

Globalize.prototype.culture = function( cultureSelector ) {
	return Globalize.culture.call( this, cultureSelector );
};

//
// public singleton functions
//

Globalize.addCultureInfo = function( cultureName, baseCultureName, info ) {

	var base = {},
		isNew = false;

	if ( typeof cultureName !== "string" ) {
		// cultureName argument is optional string. If not specified, assume info is first
		// and only argument. Specified info deep-extends current culture.
		info = cultureName;
		cultureName = this.culture().name;
		base = this.cultures[ cultureName ];
	} else if ( typeof baseCultureName !== "string" ) {
		// baseCultureName argument is optional string. If not specified, assume info is second
		// argument. Specified info deep-extends specified culture.
		// If specified culture does not exist, create by deep-extending default
		info = baseCultureName;
		isNew = ( this.cultures[ cultureName ] == null );
		base = this.cultures[ cultureName ] || this.cultures[ "default" ];
	} else {
		// cultureName and baseCultureName specified. Assume a new culture is being created
		// by deep-extending an specified base culture
		isNew = true;
		base = this.cultures[ baseCultureName ];
	}

	this.cultures[ cultureName ] = extend(true, {},
		base,
		info
	);
	// Make the standard calendar the current culture if it's a new culture
	if ( isNew ) {
		this.cultures[ cultureName ].calendar = this.cultures[ cultureName ].calendars.standard;
	}
};

Globalize.findClosestCulture = function( name ) {
	var match;
	if ( !name ) {
		return this.findClosestCulture( this.cultureSelector ) || this.cultures[ "default" ];
	}
	if ( typeof name === "string" ) {
		name = name.split( "," );
	}
	if ( isArray(name) ) {
		var lang,
			cultures = this.cultures,
			list = name,
			i, l = list.length,
			prioritized = [];
		for ( i = 0; i < l; i++ ) {
			name = trim( list[i] );
			var pri, parts = name.split( ";" );
			lang = trim( parts[0] );
			if ( parts.length === 1 ) {
				pri = 1;
			}
			else {
				name = trim( parts[1] );
				if ( name.indexOf("q=") === 0 ) {
					name = name.substr( 2 );
					pri = parseFloat( name );
					pri = isNaN( pri ) ? 0 : pri;
				}
				else {
					pri = 1;
				}
			}
			prioritized.push({ lang: lang, pri: pri });
		}
		prioritized.sort(function( a, b ) {
			if ( a.pri < b.pri ) {
				return 1;
			} else if ( a.pri > b.pri ) {
				return -1;
			}
			return 0;
		});
		// exact match
		for ( i = 0; i < l; i++ ) {
			lang = prioritized[ i ].lang;
			match = cultures[ lang ];
			if ( match ) {
				return match;
			}
		}

		// neutral language match
		for ( i = 0; i < l; i++ ) {
			lang = prioritized[ i ].lang;
			do {
				var index = lang.lastIndexOf( "-" );
				if ( index === -1 ) {
					break;
				}
				// strip off the last part. e.g. en-US => en
				lang = lang.substr( 0, index );
				match = cultures[ lang ];
				if ( match ) {
					return match;
				}
			}
			while ( 1 );
		}

		// last resort: match first culture using that language
		for ( i = 0; i < l; i++ ) {
			lang = prioritized[ i ].lang;
			for ( var cultureKey in cultures ) {
				var culture = cultures[ cultureKey ];
				if ( culture.language == lang ) {
					return culture;
				}
			}
		}
	}
	else if ( typeof name === "object" ) {
		return name;
	}
	return match || null;
};

Globalize.format = function( value, format, cultureSelector ) {
	var culture = this.findClosestCulture( cultureSelector );
	if ( value instanceof Date ) {
		value = formatDate( value, format, culture );
	}
	else if ( typeof value === "number" ) {
		value = formatNumber( value, format, culture );
	}
	return value;
};

Globalize.localize = function( key, cultureSelector ) {
	return this.findClosestCulture( cultureSelector ).messages[ key ] ||
		this.cultures[ "default" ].messages[ key ];
};

Globalize.parseDate = function( value, formats, culture ) {
	culture = this.findClosestCulture( culture );

	var date, prop, patterns;
	if ( formats ) {
		if ( typeof formats === "string" ) {
			formats = [ formats ];
		}
		if ( formats.length ) {
			for ( var i = 0, l = formats.length; i < l; i++ ) {
				var format = formats[ i ];
				if ( format ) {
					date = parseExact( value, format, culture );
					if ( date ) {
						break;
					}
				}
			}
		}
	} else {
		patterns = culture.calendar.patterns;
		for ( prop in patterns ) {
			date = parseExact( value, patterns[prop], culture );
			if ( date ) {
				break;
			}
		}
	}

	return date || null;
};

Globalize.parseInt = function( value, radix, cultureSelector ) {
	return truncate( Globalize.parseFloat(value, radix, cultureSelector) );
};

Globalize.parseFloat = function( value, radix, cultureSelector ) {
	// radix argument is optional
	if ( typeof radix !== "number" ) {
		cultureSelector = radix;
		radix = 10;
	}

	var culture = this.findClosestCulture( cultureSelector );
	var ret = NaN,
		nf = culture.numberFormat;

	if ( value.indexOf(culture.numberFormat.currency.symbol) > -1 ) {
		// remove currency symbol
		value = value.replace( culture.numberFormat.currency.symbol, "" );
		// replace decimal seperator
		value = value.replace( culture.numberFormat.currency["."], culture.numberFormat["."] );
	}

	//Remove percentage character from number string before parsing
	if ( value.indexOf(culture.numberFormat.percent.symbol) > -1){
		value = value.replace( culture.numberFormat.percent.symbol, "" );
	}

	// remove spaces: leading, trailing and between - and number. Used for negative currency pt-BR
	value = value.replace( / /g, "" );

	// allow infinity or hexidecimal
	if ( regexInfinity.test(value) ) {
		ret = parseFloat( value );
	}
	else if ( !radix && regexHex.test(value) ) {
		ret = parseInt( value, 16 );
	}
	else {

		// determine sign and number
		var signInfo = parseNegativePattern( value, nf, nf.pattern[0] ),
			sign = signInfo[ 0 ],
			num = signInfo[ 1 ];

		// #44 - try parsing as "(n)"
		if ( sign === "" && nf.pattern[0] !== "(n)" ) {
			signInfo = parseNegativePattern( value, nf, "(n)" );
			sign = signInfo[ 0 ];
			num = signInfo[ 1 ];
		}

		// try parsing as "-n"
		if ( sign === "" && nf.pattern[0] !== "-n" ) {
			signInfo = parseNegativePattern( value, nf, "-n" );
			sign = signInfo[ 0 ];
			num = signInfo[ 1 ];
		}

		sign = sign || "+";

		// determine exponent and number
		var exponent,
			intAndFraction,
			exponentPos = num.indexOf( "e" );
		if ( exponentPos < 0 ) exponentPos = num.indexOf( "E" );
		if ( exponentPos < 0 ) {
			intAndFraction = num;
			exponent = null;
		}
		else {
			intAndFraction = num.substr( 0, exponentPos );
			exponent = num.substr( exponentPos + 1 );
		}
		// determine decimal position
		var integer,
			fraction,
			decSep = nf[ "." ],
			decimalPos = intAndFraction.indexOf( decSep );
		if ( decimalPos < 0 ) {
			integer = intAndFraction;
			fraction = null;
		}
		else {
			integer = intAndFraction.substr( 0, decimalPos );
			fraction = intAndFraction.substr( decimalPos + decSep.length );
		}
		// handle groups (e.g. 1,000,000)
		var groupSep = nf[ "," ];
		integer = integer.split( groupSep ).join( "" );
		var altGroupSep = groupSep.replace( /\u00A0/g, " " );
		if ( groupSep !== altGroupSep ) {
			integer = integer.split( altGroupSep ).join( "" );
		}
		// build a natively parsable number string
		var p = sign + integer;
		if ( fraction !== null ) {
			p += "." + fraction;
		}
		if ( exponent !== null ) {
			// exponent itself may have a number patternd
			var expSignInfo = parseNegativePattern( exponent, nf, "-n" );
			p += "e" + ( expSignInfo[0] || "+" ) + expSignInfo[ 1 ];
		}
		if ( regexParseFloat.test(p) ) {
			ret = parseFloat( p );
		}
	}
	return ret;
};

Globalize.culture = function( cultureSelector ) {
	// setter
	if ( typeof cultureSelector !== "undefined" ) {
		this.cultureSelector = cultureSelector;
	}
	// getter
	return this.findClosestCulture( cultureSelector ) || this.cultures[ "default" ];
};

}( this ));
;
