text: !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("angular")):"function"==typeof define&&define.amd?define(["angular"],t):e.mobiscroll=t(e.angular)}(this,function(e){"use strict";function t(e){return"function"==typeof e}function s(e){return"object"===("undefined"==typeof e?"undefined":z(e))}function n(e){return"number"==typeof e.length}function a(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})}function i(e,t,s){for(var n in t)s&&(ie.isPlainObject(t[n])||ie.isArray(t[n]))?((ie.isPlainObject(t[n])&&!ie.isPlainObject(e[n])||ie.isArray(t[n])&&!ie.isArray(e[n]))&&(e[n]={}),i(e[n],t[n],s)):void 0!==t[n]&&(e[n]=t[n])}function r(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function o(e,t){return"number"!=typeof t||ee[r(e)]?t:t+"px"}function l(){me++,setTimeout(function(){me--},500)}function c(e,t,s){var n=e.originalEvent||e,a=(s?"page":"client")+t;return n.targetTouches&&n.targetTouches[0]?n.targetTouches[0][a]:n.changedTouches&&n.changedTouches[0]?n.changedTouches[0][a]:e[a]}function d(e,t,s,n,a,i){function r(e){f||(n&&e.preventDefault(),f=this,m=c(e,"X"),h=c(e,"Y"),p=!1,v=new Date)}function o(e){f&&!p&&(Math.abs(c(e,"X")-m)>a||Math.abs(c(e,"Y")-h)>a)&&(p=!0)}function d(t){f&&((i&&new Date-v<100||!p)&&(t.preventDefault(),s.call(f,t,e)),f=!1,l())}function u(){f=!1}var m,h,f,p,v,b=U.$,g=b(t);a=a||9,e.settings.tap&&g.on("touchstart.mbsc",r).on("touchcancel.mbsc",u).on("touchmove.mbsc",o).on("touchend.mbsc",d),g.on("click.mbsc",function(t){t.preventDefault(),s.call(this,t,e)})}function u(e){if(me&&!e.tap&&("TEXTAREA"!=e.target.nodeName||"mousedown"!=e.type))return e.stopPropagation(),e.preventDefault(),!1}function m(e){var t;for(t in e)if(void 0!==ye[e[t]])return!0;return!1}function h(){var e,t=["Webkit","Moz","O","ms"];for(e in t)if(m([t[e]+"Transform"]))return"-"+t[e].toLowerCase()+"-";return""}function f(e,t){var s=document.createElement("script"),n="mbscjsonp"+ ++Me;window[n]=function(e){s.parentNode.removeChild(s),delete window[n],e&&t(e)},s.src=e+(e.indexOf("?")>=0?"&":"?")+"callback="+n,document.body.appendChild(s)}function p(e,t){var s=new XMLHttpRequest;s.open("GET",e,!0),s.onload=function(){this.status>=200&&this.status<400&&t(JSON.parse(this.response))},s.onerror=function(){},s.send()}function v(e,t,s){"jsonp"==s?f(e,t):p(e,t)}function b(e,t,s,n,a,i,r){var o=new Date(e,t,s,n||0,a||0,i||0,r||0);return 23==o.getHours()&&0===(n||0)&&o.setHours(o.getHours()+2),o}function g(e,t){var s={},n=e.parent(),a=n.find(".mbsc-err-msg"),i=e.attr("data-icon-align")||"left",r=e.attr("data-icon");ns('<span class="mbsc-input-wrap"></span>').insertAfter(e).append(e),a&&n.find(".mbsc-input-wrap").append(a),r&&(r.indexOf("{")!==-1?s=JSON.parse(r):s[i]=r),(r||t)&&(ns.extend(s,t),n.addClass((s.right?"mbsc-ic-right ":"")+(s.left?" mbsc-ic-left":"")).find(".mbsc-input-wrap").append(s.left?'<span class="mbsc-input-ic mbsc-left-ic mbsc-ic mbsc-ic-'+s.left+'"></span>':"").append(s.right?'<span class="mbsc-input-ic mbsc-right-ic mbsc-ic mbsc-ic-'+s.right+'"></span>':""))}function y(e,t){var s={},n=t[0],a=t.parent(),i=t.attr("data-password-toggle"),r=t.attr("data-icon-show")||"eye",o=t.attr("data-icon-hide")||"eye-blocked";i&&(s.right="password"==n.type?r:o),g(t,s),i&&d(e,a.find(".mbsc-right-ic").addClass("mbsc-input-toggle"),function(){"text"==n.type?(n.type="password",ns(this).addClass("mbsc-ic-"+r).removeClass("mbsc-ic-"+o)):(n.type="text",ns(this).removeClass("mbsc-ic-"+r).addClass("mbsc-ic-"+o))})}function x(e,t){"button"!=t&&"submit"!=t&&"segmented"!=t&&(e.addClass("mbsc-control-w").find("label").addClass("mbsc-label"),e.contents().filter(function(){return 3==this.nodeType&&this.nodeValue&&/\S/.test(this.nodeValue)}).each(function(){ns('<span class="mbsc-label"></span>').insertAfter(this).append(this)}))}function w(e){var t=[Math.round(e.r).toString(16),Math.round(e.g).toString(16),Math.round(e.b).toString(16)];return fs.each(t,function(e,s){1==s.length&&(t[e]="0"+s)}),"#"+t.join("")}function _(e){return e=parseInt(e.indexOf("#")>-1?e.substring(1):e,16),{r:e>>16,g:(65280&e)>>8,b:255&e,toString:function(){return"rgb("+this.r+","+this.g+","+this.b+")"}}}function C(e){var t,s,n,a=e.h,i=255*e.s/100,r=255*e.v/100;if(0===i)t=s=n=r;else{var o=r,l=(255-i)*r/255,c=(o-l)*(a%60)/60;360==a&&(a=0),a<60?(t=o,n=l,s=l+c):a<120?(s=o,n=l,t=o-c):a<180?(s=o,t=l,n=l+c):a<240?(n=o,t=l,s=o-c):a<300?(n=o,s=l,t=l+c):a<360?(t=o,s=l,n=o-c):t=s=n=0}return{r:t,g:s,b:n,toString:function(){return"rgb("+this.r+","+this.g+","+this.b+")"}}}function T(e){var t,s,n=0,a=Math.min(e.r,e.g,e.b),i=Math.max(e.r,e.g,e.b),r=i-a;return s=i,t=i?255*r/i:0,n=t?e.r==i?(e.g-e.b)/r:e.g==i?2+(e.b-e.r)/r:4+(e.r-e.g)/r:-1,n*=60,n<0&&(n+=360),t*=100/255,s*=100/255,{h:n,s:t,v:s,toString:function(){return"hsv("+Math.round(this.h)+","+Math.round(this.s)+"%,"+Math.round(this.v)+"%)"}}}function M(e){var t,s,n=e.r/255,a=e.g/255,i=e.b/255,r=Math.max(n,a,i),o=Math.min(n,a,i),l=(r+o)/2;if(r==o)t=s=0;else{var c=r-o;switch(s=l>.5?c/(2-r-o):c/(r+o),r){case n:t=(a-i)/c+(a<i?6:0);break;case a:t=(i-n)/c+2;break;case i:t=(n-a)/c+4}t/=6}return{h:Math.round(360*t),s:Math.round(100*s),l:Math.round(100*l),toString:function(){return"hsl("+this.h+","+this.s+"%,"+this.l+"%)"}}}function D(e){var t,s,n,a,i,r,o=e.h,l=e.s,c=e.l;return isFinite(o)||(o=0),isFinite(l)||(l=0),isFinite(c)||(c=0),o/=60,o<0&&(o=6- -o%6),o%=6,l=Math.max(0,Math.min(1,l/100)),c=Math.max(0,Math.min(1,c/100)),i=(1-Math.abs(2*c-1))*l,r=i*(1-Math.abs(o%2-1)),o<1?(t=i,s=r,n=0):o<2?(t=r,s=i,n=0):o<3?(t=0,s=i,n=r):o<4?(t=0,s=r,n=i):o<5?(t=r,s=0,n=i):(t=i,s=0,n=r),a=c-i/2,{r:Math.round(255*(t+a)),g:Math.round(255*(s+a)),b:Math.round(255*(n+a)),toString:function(){return"rgb("+this.r+","+this.g+","+this.b+")"}}}function k(e){return M(_(e))}function S(e){return w(D(e))}function V(e){return w(C(e))}function $(e){return T(_(e))}function A(e){for(var t=0,s=1,n=0;e.length;)t>3?s=3600:t>1&&(s=60),n+=e.pop()*s*(t%2?10:1),t++;return n}function O(e){fn.length||e.show(),fn.push(e)}function I(e){var t=pn.length;pn.push(e),fn.length||(t?pn[0].hide():e.show())}function L(e,t,s,n){return bn({display:t.display||"center",cssClass:"mbsc-alert",okText:t.okText,cancelText:t.cancelText,context:t.context,theme:t.theme,closeOnOverlayTap:!1,onBeforeClose:function(){e.shift()},onBeforeShow:function(){U.activeInstance=null},onHide:function(e,n){s&&s(n._resolve),t.callback&&t.callback(n._resolve),n&&n.destroy(),fn.length?fn[0].show():pn.length&&pn[0].show()}},n)}function E(e){return(e.title?"<h2>"+e.title+"</h2>":"")+"<p>"+(e.message||"")+"</p>"}function N(e,t,s){var n=new cn(e,L(fn,t,s));O(n)}function H(e,t,s){var n=new cn(e,L(fn,t,s,{buttons:["ok","cancel"],onSet:function(){n._resolve=!0}}));n._resolve=!1,O(n)}function Y(e,t,s){var n=void 0,a=new cn(e,L(fn,t,s,{buttons:["ok","cancel"],onShow:function(){n=a._markup.find("input")[0],setTimeout(function(){n.focus()},300)},onSet:function(){a._resolve=n.value}}));a._resolve="",O(a)}function F(e,t,s,n,a){var i=void 0,r=new cn(e,L(pn,t,s,{display:"bottom",animate:a,cssClass:n||"mbsc-snackbar",scrollLock:!1,buttons:[],onShow:function(e,s){t.duration!==!1&&(i=setTimeout(function(){s&&s.hide()},t.duration||3e3)),t.button&&s.tap(vn(".mbsc-snackbar-btn",e.target),function(){s.hide(),t.button.action&&t.button.action.call(this)})},onClose:function(){clearTimeout(i)}}));I(r)}function P(e,t,s){F(e,t,s,"mbsc-toast","fade")}function W(e,t,s){var n=void 0;return hn?n=new Promise(function(n){e(t,s,n)}):e(t,s),n}function R(e){var t=e[0],s=e.attr("data-role"),n=e.attr("type")||t.nodeName.toLowerCase();return/(switch|range|segmented|stepper)/.test(s)&&(n=s),n}function j(e){var t=U.themes.form[e];return t&&t.addRipple?t:null}function q(){clearTimeout(En),En=setTimeout(function(){In("textarea.mbsc-control").each(function(){X(this)})},100)}function X(e){var t=void 0,s=void 0,n=void 0,a=In(e).attr("rows")||6;e.offsetHeight&&(e.style.height="",n=e.scrollHeight-e.offsetHeight,t=e.offsetHeight+(n>0?n:0),s=Math.round(t/24),s>a?(e.scrollTop=t,t=24*a+(t-24*s),In(e).addClass("mbsc-textarea-scroll")):In(e).removeClass("mbsc-textarea-scroll"),t&&(e.style.height=t+"px"))}function B(e){var t=In(e);if(!t.hasClass("mbsc-textarea-scroll")){var s=e.scrollHeight-e.offsetHeight,n=e.offsetHeight+s;e.scrollTop=0,e.style.height=n+"px"}}e="default"in e?e.default:e;var U=U||{},z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},K=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},G=function(){function e(e,t){for(var s=0;s<t.length;s++){var n=t[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,s,n){return s&&e(t.prototype,s),n&&e(t,n),t}}(),Z=function e(t,s,n){null===t&&(t=Function.prototype);var a=Object.getOwnPropertyDescriptor(t,s);if(void 0===a){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,s,n)}if("value"in a)return a.value;var r=a.get;if(void 0!==r)return r.call(n)},J=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},Q=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},ee={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},te={readonly:"readOnly"},se=[],ne=Array.prototype.slice,ae=function(){var e=function(e){var t=this,s=0;for(s=0;s<e.length;s++)t[s]=e[s];return t.length=e.length,i(this)},i=function s(n,a){var i=[],r=0;if(n&&!a&&n instanceof e)return n;if(t(n))return s(document).ready(n);if(n)if("string"==typeof n){var o,l,c;if(n=c=n.trim(),c.indexOf("<")>=0&&c.indexOf(">")>=0){var d="div";for(0===c.indexOf("<li")&&(d="ul"),0===c.indexOf("<tr")&&(d="tbody"),0!==c.indexOf("<td")&&0!==c.indexOf("<th")||(d="tr"),0===c.indexOf("<tbody")&&(d="table"),0===c.indexOf("<option")&&(d="select"),l=document.createElement(d),l.innerHTML=c,r=0;r<l.childNodes.length;r++)i.push(l.childNodes[r])}else for(a||"#"!==n[0]||n.match(/[ .<>:~]/)?(a instanceof e&&(a=a[0]),o=(a||document).querySelectorAll(n)):o=[document.getElementById(n.split("#")[1])],r=0;r<o.length;r++)o[r]&&i.push(o[r])}else if(n.nodeType||n===window||n===document)i.push(n);else if(n.length>0&&n[0].nodeType)for(r=0;r<n.length;r++)i.push(n[r]);else s.isArray(n)&&(i=n);return new e(i)};return e.prototype={ready:function(e){return(document.attachEvent?"complete"==document.readyState:"loading"!=document.readyState)?e(i):document.addEventListener("DOMContentLoaded",function(){e(i)},!1),this},concat:se.concat,empty:function(){return this.each(function(){this.innerHTML=""})},map:function(e){return i(i.map(this,function(t,s){return e.call(t,s,t)}))},slice:function(){return i(ne.apply(this,arguments))},addClass:function(e){if("undefined"==typeof e)return this;for(var t=e.split(" "),s=0;s<t.length;s++)for(var n=0;n<this.length;n++)"undefined"!=typeof this[n].classList&&""!==t[s]&&this[n].classList.add(t[s]);return this},removeClass:function(e){if("undefined"==typeof e)return this;for(var t=e.split(" "),s=0;s<t.length;s++)for(var n=0;n<this.length;n++)"undefined"!=typeof this[n].classList&&""!==t[s]&&this[n].classList.remove(t[s]);return this},hasClass:function(e){return!!this[0]&&this[0].classList.contains(e)},toggleClass:function(e){for(var t=e.split(" "),s=0;s<t.length;s++)for(var n=0;n<this.length;n++)"undefined"!=typeof this[n].classList&&this[n].classList.toggle(t[s]);return this},closest:function(e,t){var n=this[0],a=!1;for(s(e)&&(a=i(e));n&&!(a?a.indexOf(n)>=0:i.matches(n,e));)n=n!==t&&n.nodeType!==n.DOCUMENT_NODE&&n.parentNode;return i(n)},attr:function e(t,s){var e;if(1!==arguments.length||"string"!=typeof t){for(var n=0;n<this.length;n++)if(2===arguments.length)this[n].setAttribute(t,s);else for(var a in t)this[n][a]=t[a],this[n].setAttribute(a,t[a]);return this}if(this.length)return e=this[0].getAttribute(t),e||""===e?e:void 0},removeAttr:function(e){for(var t=0;t<this.length;t++)this[t].removeAttribute(e);return this},prop:function(e,t){if(e=te[e]||e,1===arguments.length&&"string"==typeof e)return this[0]?this[0][e]:void 0;for(var s=0;s<this.length;s++)this[s][e]=t;return this},val:function(e){if("undefined"==typeof e)return this.length&&this[0].multiple?i.map(this.find("option:checked"),function(e){return e.value}):this[0]?this[0].value:void 0;if(this.length&&this[0].multiple)i.each(this[0].options,function(){this.selected=e.indexOf(this.value)!=-1});else for(var t=0;t<this.length;t++)this[t].value=e;return this},on:function(e,s,n,a){function r(e){var t,a,r=e.target;if(i(r).is(s))n.call(r,e);else for(a=i(r).parents(),t=0;t<a.length;t++)i(a[t]).is(s)&&n.call(a[t],e)}function o(e,t,s,n){var a=t.split(".");e.DomNameSpaces||(e.DomNameSpaces=[]),e.DomNameSpaces.push({namespace:a[1],event:a[0],listener:s,capture:n}),e.addEventListener(a[0],s,n)}var l,c,d=e.split(" ");for(l=0;l<this.length;l++)if(t(s)||s===!1)for(t(s)&&(a=n||!1,n=s),c=0;c<d.length;c++)d[c].indexOf(".")!=-1?o(this[l],d[c],n,a):this[l].addEventListener(d[c],n,a);else for(c=0;c<d.length;c++)this[l].DomLiveListeners||(this[l].DomLiveListeners=[]),this[l].DomLiveListeners.push({listener:n,liveListener:r}),d[c].indexOf(".")!=-1?o(this[l],d[c],r,a):this[l].addEventListener(d[c],r,a);return this},off:function(e,s,n,a){function i(e){var t,s,n,a=e.split("."),i=a[0],r=a[1];for(t=0;t<d.length;++t)if(d[t].DomNameSpaces){for(s=0;s<d[t].DomNameSpaces.length;++s)n=d[t].DomNameSpaces[s],n.namespace!=r||n.event!=i&&i||(d[t].removeEventListener(n.event,n.listener,n.capture),n.removed=!0);for(s=d[t].DomNameSpaces.length-1;s>=0;--s)d[t].DomNameSpaces[s].removed&&d[t].DomNameSpaces.splice(s,1)}}var r,o,l,c,d=this;for(r=e.split(" "),o=0;o<r.length;o++)for(l=0;l<this.length;l++)if(t(s)||s===!1)t(s)&&(a=n||!1,n=s),0===r[o].indexOf(".")?i(r[o].substr(1),n,a):this[l].removeEventListener(r[o],n,a);else{if(this[l].DomLiveListeners)for(c=0;c<this[l].DomLiveListeners.length;c++)this[l].DomLiveListeners[c].listener===n&&this[l].removeEventListener(r[o],this[l].DomLiveListeners[c].liveListener,a);this[l].DomNameSpaces&&this[l].DomNameSpaces.length&&r[o]&&i(r[o])}return this},trigger:function(e,t){for(var s=e.split(" "),n=0;n<s.length;n++)for(var a=0;a<this.length;a++){var i;try{i=new CustomEvent(s[n],{detail:t,bubbles:!0,cancelable:!0})}catch(e){i=document.createEvent("Event"),i.initEvent(s[n],!0,!0),i.detail=t}this[a].dispatchEvent(i)}return this},width:function(e){return void 0!==e?this.css("width",e):this[0]===window?window.innerWidth:this[0]===document?document.documentElement.scrollWidth:this.length>0?parseFloat(this.css("width")):null},height:function(e){if(void 0!==e)return this.css("height",e);if(this[0]===window)return window.innerHeight;if(this[0]===document){var t=document.body,s=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,s.clientHeight,s.scrollHeight,s.offsetHeight)}return this.length>0?parseFloat(this.css("height")):null},innerWidth:function(){var e=this;if(this.length>0){if(this[0].innerWidth)return this[0].innerWidth;var t=this[0].offsetWidth,s=["left","right"];return s.forEach(function(s){t-=parseInt(e.css(a("border-"+s+"-width"))||0,10)}),t}},innerHeight:function(){var e=this;if(this.length>0){if(this[0].innerHeight)return this[0].innerHeight;var t=this[0].offsetHeight,s=["top","bottom"];return s.forEach(function(s){t-=parseInt(e.css(a("border-"+s+"-width"))||0,10)}),t}},offset:function(){if(this.length>0){var e=this[0],t=e.getBoundingClientRect(),s=document.documentElement;return{top:t.top+window.pageYOffset-s.clientTop,left:t.left+window.pageXOffset-s.clientLeft}}},hide:function(){for(var e=0;e<this.length;e++)this[e].style.display="none";return this},show:function(){for(var e=0;e<this.length;e++)"none"==this[e].style.display&&(this[e].style.display=""),"none"==getComputedStyle(this[e],"").getPropertyValue("display")&&(this[e].style.display="block");return this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},styles:function(){return this[0]?window.getComputedStyle(this[0],null):void 0},css:function e(t,s){var n,a,i=this[0],e="";if(arguments.length<2){if(!i)return;if("string"==typeof t)return i.style[t]||getComputedStyle(i,"").getPropertyValue(t)}if("string"==typeof t)s||0===s?e=r(t)+":"+o(t,s):this.each(function(){this.style.removeProperty(r(t))});else for(a in t)if(t[a]||0===t[a])e+=r(a)+":"+o(a,t[a])+";";else for(n=0;n<this.length;n++)this[n].style.removeProperty(r(a));return this.each(function(){this.style.cssText+=";"+e})},each:function(e){for(var t=0;t<this.length&&e.apply(this[t],[t,this[t]])!==!1;t++);return this},filter:function(s){for(var n=[],a=0;a<this.length;a++)t(s)?s.call(this[a],a,this[a])&&n.push(this[a]):i.matches(this[a],s)&&n.push(this[a]);return new e(n)},html:function(e){if("undefined"==typeof e)return this[0]?this[0].innerHTML:void 0;this.empty();for(var t=0;t<this.length;t++)this[t].innerHTML=e;return this},text:function(e){if("undefined"==typeof e)return this[0]?this[0].textContent.trim():null;for(var t=0;t<this.length;t++)this[t].textContent=e;return this},is:function(e){return this.length>0&&i.matches(this[0],e)},not:function(e){var a=[];if(t(e)&&void 0!==e.call)this.each(function(t){e.call(this,t)||a.push(this)});else{var r="string"==typeof e?this.filter(e):n(e)&&t(e.item)?ne.call(e):i(e);s(r)&&(r=i.map(r,function(e){return e})),this.each(function(e,t){r.indexOf(t)<0&&a.push(t)})}return i(a)},indexOf:function(e){for(var t=0;t<this.length;t++)if(this[t]===e)return t},index:function(e){return e?this.indexOf(i(e)[0]):this.parent().children().indexOf(this[0])},get:function(e){return void 0===e?ne.call(this):this[e>=0?e:e+this.length]},eq:function(t){if("undefined"==typeof t)return this;var s,n=this.length;return t>n-1?new e([]):t<0?(s=n+t,new e(s<0?[]:[this[s]])):new e([this[t]])},append:function(t){var s,n;for(s=0;s<this.length;s++)if("string"==typeof t){var a=document.createElement("div");for(a.innerHTML=t;a.firstChild;)this[s].appendChild(a.firstChild)}else if(t instanceof e)for(n=0;n<t.length;n++)this[s].appendChild(t[n]);else this[s].appendChild(t);return this},appendTo:function(e){return i(e).append(this),this},prepend:function(t){var s,n;for(s=0;s<this.length;s++)if("string"==typeof t){var a=document.createElement("div");for(a.innerHTML=t,n=a.childNodes.length-1;n>=0;n--)this[s].insertBefore(a.childNodes[n],this[s].childNodes[0])}else if(t instanceof e)for(n=0;n<t.length;n++)this[s].insertBefore(t[n],this[s].childNodes[0]);else this[s].insertBefore(t,this[s].childNodes[0]);return this},prependTo:function(e){return i(e).prepend(this),this},insertBefore:function(e){for(var t=i(e),s=0;s<this.length;s++)if(1===t.length)t[0].parentNode.insertBefore(this[s],t[0]);else if(t.length>1)for(var n=0;n<t.length;n++)t[n].parentNode.insertBefore(this[s].cloneNode(!0),t[n]);return this},insertAfter:function(e){for(var t=i(e),s=0;s<this.length;s++)if(1===t.length)t[0].parentNode.insertBefore(this[s],t[0].nextSibling);else if(t.length>1)for(var n=0;n<t.length;n++)t[n].parentNode.insertBefore(this[s].cloneNode(!0),t[n].nextSibling);return this},next:function(t){return new e(this.length>0?t?this[0].nextElementSibling&&i(this[0].nextElementSibling).is(t)?[this[0].nextElementSibling]:[]:this[0].nextElementSibling?[this[0].nextElementSibling]:[]:[])},nextAll:function(t){var s=[],n=this[0];if(!n)return new e([]);for(;n.nextElementSibling;){var a=n.nextElementSibling;t?i(a).is(t)&&s.push(a):s.push(a),n=a}return new e(s)},prev:function(t){return new e(this.length>0?t?this[0].previousElementSibling&&i(this[0].previousElementSibling).is(t)?[this[0].previousElementSibling]:[]:this[0].previousElementSibling?[this[0].previousElementSibling]:[]:[])},prevAll:function(t){var s=[],n=this[0];if(!n)return new e([]);for(;n.previousElementSibling;){var a=n.previousElementSibling;t?i(a).is(t)&&s.push(a):s.push(a),n=a}return new e(s)},parent:function(e){for(var t=[],s=0;s<this.length;s++)null!==this[s].parentNode&&(e?i(this[s].parentNode).is(e)&&t.push(this[s].parentNode):t.push(this[s].parentNode));return i(i.unique(t))},parents:function e(t){for(var e=[],s=0;s<this.length;s++)for(var n=this[s].parentNode;n;)t?i(n).is(t)&&e.push(n):e.push(n),n=n.parentNode;return i(i.unique(e))},find:function(t){for(var s=[],n=0;n<this.length;n++)for(var a=this[n].querySelectorAll(t),i=0;i<a.length;i++)s.push(a[i]);return new e(s)},children:function t(s){for(var t=[],n=0;n<this.length;n++)for(var a=this[n].childNodes,r=0;r<a.length;r++)s?1===a[r].nodeType&&i(a[r]).is(s)&&t.push(a[r]):1===a[r].nodeType&&t.push(a[r]);return new e(i.unique(t))},remove:function(){for(var e=0;e<this.length;e++)this[e].parentNode&&this[e].parentNode.removeChild(this[e]);return this},add:function(){var e,t,s=this;for(e=0;e<arguments.length;e++){var n=i(arguments[e]);for(t=0;t<n.length;t++)s[s.length]=n[t],s.length++}return s},before:function(e){return i(e).insertBefore(this),this},after:function(e){return i(e).insertAfter(this),this},scrollTop:function(e){if(this.length){var t="scrollTop"in this[0];return void 0===e?t?this[0].scrollTop:this[0].pageYOffset:this.each(t?function(){this.scrollTop=e}:function(){this.scrollTo(this.scrollX,e)})}},scrollLeft:function(e){if(this.length){var t="scrollLeft"in this[0];return void 0===e?t?this[0].scrollLeft:this[0].pageXOffset:this.each(t?function(){this.scrollLeft=e}:function(){this.scrollTo(e,this.scrollY)})}},contents:function(){return this.map(function(e,t){return ne.call(t.childNodes)})},nextUntil:function(e){for(var t=this,s=[];t.length&&!t.filter(e).length;)s.push(t[0]),t=t.next();return i(s)},prevUntil:function(e){for(var t=this,s=[];t.length&&!i(t).filter(e).length;)s.push(t[0]),t=t.prev();return i(s)},detach:function(){return this.remove()}},i.fn=e.prototype,i}(),ie=ae;U.$=ae,ie.inArray=function(e,t,s){return se.indexOf.call(t,e,s)},ie.extend=function(e){var t,s=ne.call(arguments,1);return"boolean"==typeof e&&(t=e,e=s.shift()),e=e||{},s.forEach(function(s){i(e,s,t)}),e},ie.isFunction=t,ie.isArray=function(e){return"[object Array]"===Object.prototype.toString.apply(e)},ie.isPlainObject=function(e){return s(e)&&null!==e&&e!==e.window&&Object.getPrototypeOf(e)==Object.prototype},ie.each=function(e,t){var n,a;if(s(e)&&t){if(ie.isArray(e)||e instanceof ae)for(n=0;n<e.length&&t.call(e[n],n,e[n])!==!1;n++);else for(a in e)if(e.hasOwnProperty(a)&&"length"!==a&&t.call(e[a],a,e[a])===!1)break;return this}},ie.unique=function(e){for(var t=[],s=0;s<e.length;s++)t.indexOf(e[s])===-1&&t.push(e[s]);return t},ie.map=function(e,t){var s,a,i,r=[];if(n(e))for(a=0;a<e.length;a++)s=t(e[a],a),null!==s&&r.push(s);else for(i in e)s=t(e[i],i),null!==s&&r.push(s);return r.length>0?ie.fn.concat.apply([],r):r},ie.matches=function(e,t){if(!t||!e||1!==e.nodeType)return!1;var s=e.matchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;return s.call(e,t)};var re,oe,le=[],ce=navigator.userAgent,de=ce.match(/Android|iPhone|iPad|iPod|Windows Phone|Windows|MSIE/i);/Android/i.test(de)?(re="android",oe=navigator.userAgent.match(/Android\s+([\d\.]+)/i),oe&&(le=oe[0].replace("Android ","").split("."))):/iPhone|iPad|iPod/i.test(de)?(re="ios",oe=navigator.userAgent.match(/OS\s+([\d\_]+)/i),oe&&(le=oe[0].replace(/_/g,".").replace("OS ","").split("."))):/Windows Phone/i.test(de)?re="wp":/Windows|MSIE/i.test(de)&&(re="windows");var ue={name:re,majorVersion:le[0],minorVersion:le[1]},me=0;["mouseover","mousedown","mouseup","click"].forEach(function(e){document.addEventListener(e,u,!0)}),"android"==ue.name&&ue.majorVersion<5&&document.addEventListener("change",function(e){me&&"checkbox"==e.target.type&&!e.target.mbscChange&&(e.stopPropagation(),e.preventDefault()),delete e.target.mbscChange},!0);var he,fe=function(){},pe=U.$,ve=+new Date,be={},ge=pe.extend,ye=document.createElement("modernizr").style,xe=h(),we=xe.replace(/^\-/,"").replace(/\-$/,"").replace("moz","Moz"),_e=void 0!==ye.animation?"animationend":"webkitAnimationEnd";he=ge(U,{$:pe,version:"3.2.0",util:{prefix:xe,jsPrefix:we,animEnd:_e,preventClick:l,testTouch:function(e,t){if("touchstart"==e.type)pe(t).attr("data-touch","1");else if(pe(t).attr("data-touch"))return pe(t).removeAttr("data-touch"),!1;return!0},objectToArray:function(e){var t,s=[];for(t in e)s.push(e[t]);return s},arrayToObject:function(e){var t,s={};if(e)for(t=0;t<e.length;t++)s[e[t]]=e[t];return s},isNumeric:function(e){return e-parseFloat(e)>=0},isString:function(e){return"string"==typeof e},getCoord:c,getPosition:function(e,t){var s,n,a=getComputedStyle(e[0]);return pe.each(["t","webkitT","MozT","OT","msT"],function(e,t){if(void 0!==a[t+"ransform"])return s=a[t+"ransform"],!1}),s=s.split(")")[0].split(", "),n=t?s[13]||s[5]:s[12]||s[4]},constrain:function(e,t,s){return Math.max(t,Math.min(e,s))},vibrate:function(e){"vibrate"in navigator&&navigator.vibrate(e||50)},throttle:function(e,t){var s,n;return t=t||100,function(){var a=this,i=+new Date,r=arguments;s&&i<s+t?(clearTimeout(n),n=setTimeout(function(){s=i,e.apply(a,r)},t)):(s=i,e.apply(a,r))}}},autoTheme:"mobiscroll",presets:{scroller:{},numpad:{},listview:{},menustrip:{}},themes:{form:{},page:{},frame:{},scroller:{},listview:{},menustrip:{},progress:{}},platform:ue,i18n:{},instances:be,classes:{},components:{},settings:{},setDefaults:function(e){ge(this.settings,e)},customTheme:function(e,t){var s,n=U.themes,a=["frame","scroller","listview","menustrip","form","progress"];for(s=0;s<a.length;s++)n[a[s]][e]=U.$.extend({},n[a[s]][t],{baseTheme:t})}}),he.presetShort=he.presetShort||function(){},he.classes.Base=function(e,t){function s(){pe(e).addClass("mbsc-comp"),e.id?be[e.id]&&be[e.id].destroy():e.id="mobiscroll"+ ++ve,be[e.id]=u,u.__ready=!0}var n,a,i,r,o,l,c,u=this;u.settings={},u._init=fe,u._destroy=fe,u._processSettings=fe,u.init=function(s){var d;for(d in u.settings)delete u.settings[d];i=u.settings,ge(t,s),u._hasDef&&(c=he.settings),ge(i,u._defaults,c,t),u._hasTheme&&(o=i.theme,"auto"!=o&&o||(o=he.autoTheme),"default"==o&&(o="mobiscroll"),t.theme=o,r=he.themes[u._class]?he.themes[u._class][o]:{}),u._hasLang&&(n=he.i18n[i.lang]),u._hasTheme&&l("onThemeLoad",{lang:n,settings:t}),ge(i,r,n,c,t),u._processSettings(),u._hasPreset&&(a=he.presets[u._class][i.preset],a&&(a=a.call(e,u),ge(i,a,t))),u._init(s),l("onInit")},u.destroy=function(){u&&(u._destroy(),l("onDestroy"),delete be[e.id],u=null)},u.tap=function(e,t,s,n,a){d(u,e,t,s,n,a)},u.trigger=function(s,n){var i,o,l,d=[c,r,a,t];for(o=0;o<4;o++)l=d[o],l&&l[s]&&(i=l[s].call(e,n||{},u));return i},u.option=function(e,t){var s={};"object"===("undefined"==typeof e?"undefined":z(e))?s=e:s[e]=t,u.init(s)},u.getInst=function(){return u},t=t||{},l=u.trigger,u.__ready||s()},U.ng={};var Ce=U.$,Te=U.instances;U.ng={getDDO:function(t,s,n,a,i,r,o,l){return i=i||U.ng.read,a=a||U.ng.render,r=r||U.ng.parse,o=o||U.ng.format,{restrict:"A",require:"?ngModel",priority:e.version&&1==e.version.major&&2==e.version.minor?1:void 0,link:function(c,d,u,m){var h,f=Ce(d[0]);U.ng.addWatch(t,c,m,f,u,s,a,i,r,o),h=new U.classes[n.component||"Scroller"](d[0],e.extend(U.ng.getOpt(c,u,s,m,l,f),n||{})),u.mobiscrollInstance&&t(u.mobiscrollInstance).assign(c,h)}}},getOpt:function(t,s,n,a,i,r){var o=t.$eval(s.mobiscrollOptions||"{}"),l=i?r.closest("[mbsc-form-opt]"):null;return i&&(o=e.extend({},U.ng.formOptions[l.attr("id")]||{},o)),a&&e.extend(o,t.$eval(s[n]||"{}")),o},read:function(e,t,s,n,a,i,r){var o,l=Te[s.attr("id")];l&&(o=r(s,l.getVal()),i?i.$setViewValue(o):a[t]&&e(a[t]).assign(n,o))},render:function(t,s){var n=Te[t.attr("id")];n&&!e.equals(n.getVal(),s)&&n.setVal(s,!0,!1)},parse:function(e){var t,s=Te[e.attr("id")];return s&&(t=s.getVal()),Ce.isArray(t)&&!t.length?null:t},format:function(e,t){return Ce.isArray(t)&&!t.length?null:t},addWatch:function(e,t,s,n,a,i,r,o,l,c){r=r||U.ng.render,o=o||U.ng.read,l=l||U.ng.parse,c=c||U.ng.format,s&&(s.$render=function(){},s.$parsers.unshift(function(e){return l(n,e)}),s.$formatters.push(function(e){return c(n,e)})),t.$watch(function(){return s?s.$modelValue:e(a[i])(t)},function(e){r(n,e)},!0),t.$on("$destroy",function(){var e=Te[n[0].id];e&&e.destroy()}),n.on("change",function(){t.$$phase?o(e,i,n,t,a,s,c):t.$apply(function(){o(e,i,n,t,a,s,c)})})},formOptions:{}};var Me=0;U.util.getJson=v;var De,ke,Se=U.$,Ve=U.platform,$e=U.util,Ae=U.classes,Oe=U.themes,Ie=$e.constrain,Le=$e.isString,Ee=$e.getCoord,Ne=$e.animEnd,He=/(iphone|ipod)/i.test(navigator.userAgent)&&Ve.majorVersion>=7,Ye="ios"==Ve.name&&8==Ve.majorVersion,Fe=function(){},Pe=function(e){e.preventDefault()},We=function(e,t,s){function n(e){M&&M.removeClass("mbsc-fr-btn-a"),M=Se(this),M.hasClass("mbsc-fr-btn-d")||M.hasClass("mbsc-fr-btn-nhl")||M.addClass("mbsc-fr-btn-a"),"mousedown"===e.type?Se(document).on("mouseup",a):"pointerdown"===e.type&&Se(document).on("pointerup",a)}function a(e){M&&(M.removeClass("mbsc-fr-btn-a"),M=null),"mouseup"===e.type?Se(document).off("mouseup",a):"pointerup"===e.type&&Se(document).off("pointerup",a)}function i(e){13==e.keyCode?K.select():27==e.keyCode&&K.cancel()}function r(e){e||N.focus(),K.ariaMessage(P.ariaMessage)}function o(e){var t=De,s=P.focusOnClose;K._markupRemove(),g.remove(),V&&(D.mbscModals--,P.scrollLock&&D.mbscLock--,D.mbscLock||b.removeClass("mbsc-fr-lock"),D.mbscModals||(b.removeClass("mbsc-fr-lock-ios mbsc-fr-lock-ctx"),E&&(p.css({top:"",left:""}),_.scrollLeft(W),_.scrollTop(j)),e||(t||(t=G),setTimeout(function(){void 0===s||s===!0?(ke=!0,t[0].focus()):s&&Se(s)[0].focus()},200)))),De=null,K._isVisible=!1,$=!1,X("onHide")}function l(e){clearTimeout(J[e.type]),J[e.type]=setTimeout(function(){var t,s="scroll"==e.type;s&&!R||(K.position(!s),"orientationchange"==e.type&&(H.style.display="none",t=H.offsetHeight,H.style.display=""))},200)}function c(e){e.target.nodeType&&!H.contains(e.target)&&H.focus()}function d(e,t){e&&e(),K.show()!==!1&&(De=t,setTimeout(function(){ke=!1},300))}function u(){K._fillValue(),X("onSet",{valueText:K._value})}function m(){X("onCancel",{valueText:K._value})}function h(){K.setVal(null,!0)}var f,p,v,b,g,y,x,w,_,C,T,M,D,k,S,V,$,A,O,I,L,E,N,H,Y,F,P,W,R,j,q,X,B,z,K=this,G=Se(e),Z=[],J={};Ae.Base.call(this,e,t,!0),K.position=function(e){var t,s,n,a,i,r,o,l,c,d,u,m,h,f,v,b,y={},T=0,M=0,k=0,E=0;!F&&$&&(K._position(g),m=A.offsetHeight,h=A.offsetWidth,B===h&&z===m&&e||(K._isFullScreen||/top|bottom/.test(P.display)?w.width(h):C.width(""),X("onPosition",{target:A,windowWidth:h,windowHeight:m})!==!1&&V&&(Se(".mbsc-comp",g).each(function(){var e=U.instances[this.id];e&&e!==K&&e.position&&e.position()}),!K._isFullScreen&&/center|bubble/.test(P.display)&&(Se(".mbsc-w-p",g).each(function(){f=this.getBoundingClientRect().width,E+=f,k=f>k?f:k}),C.css({width:K._isLiquid?Math.min(P.maxPopupWidth,h-16):Math.ceil(E>h?k:E),"white-space":E>h?"":"nowrap"})),O=H.offsetWidth,I=H.offsetHeight,R=I<=m&&O<=h,L&&(T=_.scrollLeft(),M=_.scrollTop()),"center"==P.display?(b=Math.max(0,T+(h-O)/2),v=Math.max(0,M+(m-I)/2)):"bubble"==P.display?(t=void 0===P.anchor?G:Se(P.anchor),o=Se(".mbsc-fr-arr-i",g)[0],a=t.offset(),i=a.top+(S?M-p.offset().top:0),r=a.left+(S?T-p.offset().left:0),s=t[0].offsetWidth,n=t[0].offsetHeight,l=o.offsetWidth,c=o.offsetHeight,b=Ie(r-(O-s)/2,T+8,T+h-O-8),v=i-I-c/2,v<M||i>M+m?(w.removeClass("mbsc-fr-bubble-top").addClass("mbsc-fr-bubble-bottom"),v=i+n+c/2):w.removeClass("mbsc-fr-bubble-bottom").addClass("mbsc-fr-bubble-top"),Se(".mbsc-fr-arr",g).css({left:Ie(r+s/2-(b+(O-l)/2),0,l)}),R=v>M&&b>T&&v+I<=M+m&&b+O<=T+h):(b=T,v="top"==P.display?M:Math.max(0,M+m-I)),L&&(d=Math.max(v+I,S?D.scrollHeight:Se(document).height()),u=Math.max(b+O,S?D.scrollWidth:Se(document).width()),
  x.css({width:u,height:d}),P.scroll&&"bubble"==P.display&&(v+I+8>M+m||i>M+m||i+n<M)&&(F=!0,setTimeout(function(){F=!1},300),_.scrollTop(Math.min(i,v+I-m+8,d-m)))),y.top=Math.floor(v),y.left=Math.floor(b),w.css(y),B=h,z=m)))},K.attachShow=function(e,t){var s,n=Se(e),a=n.prop("readonly");if("inline"!==P.display){if((P.showOnFocus||P.showOnTap)&&n.is("input,select")&&(n.prop("readonly",!0).on("mousedown.mbsc",function(e){e.preventDefault()}).on("focus.mbsc",function(){K._isVisible&&this.blur()}),s=Se('label[for="'+n.attr("id")+'"]'),s.length||(s=n.closest("label"))),n.is("select"))return;P.showOnFocus&&n.on("focus.mbsc",function(){ke||d(t,n)}),P.showOnTap&&(n.on("keydown.mbsc",function(e){32!=e.keyCode&&13!=e.keyCode||(e.preventDefault(),e.stopPropagation(),d(t,n))}),K.tap(n,function(){d(t,n)}),s&&s.length&&K.tap(s,function(){d(t,n)})),Z.push({readOnly:a,el:n,lbl:s})}},K.select=function(){V?K.hide(!1,"set",!1,u):u()},K.cancel=function(){V?K.hide(!1,"cancel",!1,m):m()},K.clear=function(){K._clearValue(),X("onClear"),V&&K._isVisible&&!K.live?K.hide(!1,"clear",!1,h):h()},K.enable=function(){P.disabled=!1,K._isInput&&G.prop("disabled",!1)},K.disable=function(){P.disabled=!0,K._isInput&&G.prop("disabled",!0)},K.show=function(e,t){function s(){g.off(Ne,s).removeClass("mbsc-anim-in mbsc-anim-trans mbsc-anim-trans-"+k).find(".mbsc-fr-popup").removeClass("mbsc-anim-"+k),r(t)}var o,d;if(!P.disabled&&!K._isVisible){if(K._readValue(),X("onBeforeShow")===!1)return!1;if(k=P.animate,T=P.buttons||[],L=S||"bubble"==P.display,E=He&&!L&&P.scrollLock,o=T.length>0,k!==!1&&("top"==P.display?k=k||"slidedown":"bottom"==P.display?k=k||"slideup":"center"!=P.display&&"bubble"!=P.display||(k=k||"pop")),V&&(j=Math.max(0,_.scrollTop()),W=Math.max(0,_.scrollLeft()),B=0,z=0,E&&!b.hasClass("mbsc-fr-lock-ios")&&p.css({top:-j+"px",left:-W+"px"}),b.addClass((P.scrollLock?"mbsc-fr-lock":"")+(E?" mbsc-fr-lock-ios":"")+(S?" mbsc-fr-lock-ctx":"")),Se(document.activeElement).is("input,textarea")&&document.activeElement.blur(),U.activeInstance&&U.activeInstance.hide(),U.activeInstance=K,D.mbscModals=D.mbscModals||0,D.mbscLock=D.mbscLock||0,D.mbscModals++,P.scrollLock&&D.mbscLock++),d='<div lang="'+P.lang+'" class="mbsc-fr mbsc-no-touch mbsc-'+P.theme+(P.baseTheme?" mbsc-"+P.baseTheme:"")+" mbsc-fr-"+P.display+" "+(P.cssClass||"")+" "+(P.compClass||"")+(K._isLiquid?" mbsc-fr-liq":"")+(E?" mbsc-platform-ios":"")+(o?T.length>=3?" mbsc-fr-btn-block ":"":" mbsc-fr-nobtn")+'">'+(V?'<div class="mbsc-fr-persp"><div class="mbsc-fr-overlay"></div><div role="dialog" tabindex="-1" class="mbsc-fr-scroll">':"")+'<div class="mbsc-fr-popup'+(P.rtl?" mbsc-rtl":" mbsc-ltr")+(P.headerText?" mbsc-fr-has-hdr":"")+'">'+("bubble"===P.display?'<div class="mbsc-fr-arr-w"><div class="mbsc-fr-arr-i"><div class="mbsc-fr-arr"></div></div></div>':"")+'<div class="mbsc-fr-w"><div aria-live="assertive" class="mbsc-fr-aria mbsc-fr-hdn"></div>'+(P.headerText?'<div class="mbsc-fr-hdr">'+(Le(P.headerText)?P.headerText:"")+"</div>":"")+'<div class="mbsc-fr-c">',d+=K._generateContent(),d+="</div>",o&&(d+='<div class="mbsc-fr-btn-cont">',Se.each(T,function(e,t){t=Le(t)?K.buttons[t]:t,"set"===t.handler&&(t.parentClass="mbsc-fr-btn-s"),"cancel"===t.handler&&(t.parentClass="mbsc-fr-btn-c"),d+="<div"+(P.btnWidth?' style="width:'+100/T.length+'%"':"")+' class="mbsc-fr-btn-w '+(t.parentClass||"")+'"><div tabindex="0" role="button" class="mbsc-fr-btn'+e+" mbsc-fr-btn-e "+(void 0===t.cssClass?P.btnClass:t.cssClass)+(t.icon?" mbsc-ic mbsc-ic-"+t.icon:"")+'">'+(t.text||"")+"</div></div>"}),d+="</div>"),d+="</div></div></div></div>"+(V?"</div></div>":""),g=Se(d),x=Se(".mbsc-fr-persp",g),y=Se(".mbsc-fr-scroll",g),C=Se(".mbsc-fr-w",g),v=Se(".mbsc-fr-hdr",g),w=Se(".mbsc-fr-popup",g),f=Se(".mbsc-fr-aria",g),A=g[0],N=y[0],H=w[0],K._markup=g,K._header=v,K._isVisible=!0,Y="orientationchange resize",K._markupReady(g),X("onMarkupReady",{target:A}),V){if(Se(window).on("keydown",i),P.scrollLock&&g.on("touchmove mousewheel wheel",function(e){R&&e.preventDefault()}),P.focusTrap&&_.on("focusin",c),P.closeOnOverlayTap){var u,m,h,M;y.on("touchstart mousedown",function(e){m||e.target!=y[0]||(m=!0,u=!1,h=Ee(e,"X"),M=Ee(e,"Y"))}).on("touchmove mousemove",function(e){m&&!u&&(Math.abs(Ee(e,"X")-h)>9||Math.abs(Ee(e,"Y")-M)>9)&&(u=!0)}).on("touchcancel",function(){m=!1}).on("touchend touchcancel mouseup",function(e){m&&!u&&(K.cancel(),"mouseup"!=e.type&&$e.preventClick()),m=!1})}L&&(Y+=" scroll")}setTimeout(function(){if(V)g.appendTo(p);else if(G.is("div")&&!K._hasContent)G.empty().append(g);else if(G.hasClass("mbsc-control")){var i=G.closest(".mbsc-control-w");g.insertAfter(i),i.hasClass("mbsc-select")&&i.addClass("mbsc-select-inline")}else g.insertAfter(G);$=!0,K._markupInserted(g),X("onMarkupInserted",{target:A}),g.on("selectstart mousedown",Pe).on("click",".mbsc-fr-btn-e",Pe).on("keydown",".mbsc-fr-btn-e",function(e){32==e.keyCode&&(e.preventDefault(),e.stopPropagation(),this.click())}).on("keydown",function(e){if(32==e.keyCode)e.preventDefault();else if(9==e.keyCode&&V&&P.focusTrap){var t=g.find('[tabindex="0"]').filter(function(){return this.offsetWidth>0||this.offsetHeight>0}),s=t.index(Se(":focus",g)),n=t.length-1,a=0;e.shiftKey&&(n=0,a=-1),s===n&&(t.eq(a)[0].focus(),e.preventDefault())}}).on("touchstart mousedown pointerdown",".mbsc-fr-btn-e",n).on("touchend",".mbsc-fr-btn-e",a),Se("input,select,textarea",g).on("selectstart mousedown",function(e){e.stopPropagation()}).on("keydown",function(e){32==e.keyCode&&e.stopPropagation()}),A.addEventListener("touchstart",function(){q||(q=!0,p.find(".mbsc-no-touch").removeClass("mbsc-no-touch"))},!0),Se.each(T,function(e,t){K.tap(Se(".mbsc-fr-btn"+e,g),function(e){t=Le(t)?K.buttons[t]:t,(Le(t.handler)?K.handlers[t.handler]:t.handler).call(this,e,K)},!0)}),K._attachEvents(g),K.position(),_.on(Y,l),V&&(k&&!e?g.addClass("mbsc-anim-in mbsc-anim-trans mbsc-anim-trans-"+k).on(Ne,s).find(".mbsc-fr-popup").addClass("mbsc-anim-"+k):r(t)),X("onShow",{target:A,valueText:K._tempValue})},E?100:0)}},K.hide=function(e,t,s,n){function a(){g.off(Ne,a),o(e)}return!(!K._isVisible||!s&&!K._isValid&&"set"==t||!s&&X("onBeforeClose",{valueText:K._tempValue,button:t})===!1)&&(V&&(Se(document.activeElement).is("input,textarea")&&H.contains(document.activeElement)&&document.activeElement.blur(),Se(window).off("keydown",i),delete U.activeInstance),g&&(V&&k&&!e?g.addClass("mbsc-anim-out mbsc-anim-trans mbsc-anim-trans-"+k).on(Ne,a).find(".mbsc-fr-popup").addClass("mbsc-anim-"+k):o(e),K._detachEvents(g),_.off(Y,l).off("focusin",c)),n&&n(),void X("onClose",{valueText:K._value}))},K.ariaMessage=function(e){f.html(""),setTimeout(function(){f.html(e)},100)},K.isVisible=function(){return K._isVisible},K.setVal=Fe,K.getVal=Fe,K._generateContent=Fe,K._attachEvents=Fe,K._detachEvents=Fe,K._readValue=Fe,K._clearValue=Fe,K._fillValue=Fe,K._markupReady=Fe,K._markupInserted=Fe,K._markupRemove=Fe,K._position=Fe,K.__processSettings=Fe,K.__init=Fe,K.__destroy=Fe,K._destroy=function(){K.hide(!0,!1,!0),G.off(".mbsc"),Se.each(Z,function(e,t){t.el.off(".mbsc").prop("readonly",t.readOnly),t.lbl&&t.lbl.off(".mbsc")}),K.__destroy()},K._processSettings=function(){var e,t;for(K.__processSettings(),P.buttons=P.buttons||("inline"!==P.display?["set","cancel"]:[]),P.headerText=void 0===P.headerText?"inline"!==P.display&&"{value}":P.headerText,T=P.buttons||[],V="inline"!==P.display,S="body"!=P.context,p=Se(P.context),b=S?p:Se("body,html"),D=p[0],K._window=_=Se(S?P.context:window),K.live=!0,t=0;t<T.length;t++)e=T[t],"ok"!=e&&"set"!=e&&"set"!=e.handler||(K.live=!1);K.buttons.set={text:P.setText,icon:P.setIcon,handler:"set"},K.buttons.cancel={text:P.cancelText,icon:P.cancelIcon,handler:"cancel"},K.buttons.close={text:P.closeText,icon:P.closeIcon,handler:"cancel"},K.buttons.clear={text:P.clearText,icon:P.clearIcon,handler:"clear"},K._isInput=G.is("input")},K._init=function(){K._isVisible&&K.hide(!0,!1,!0),G.off(".mbsc"),K.__init(),K._isLiquid="liquid"==P.layout,V?(K._readValue(),K._hasContent||K.attachShow(G)):K.show(),G.on("change.mbsc",function(){K._preventChange||K.setVal(G.val(),!0,!1),K._preventChange=!1})},K.buttons={},K.handlers={set:K.select,cancel:K.cancel,clear:K.clear},K._value=null,K._isValid=!0,K._isVisible=!1,P=K.settings,X=K.trigger,s||K.init(t)};We.prototype._defaults={lang:"en",setText:"Set",selectedText:"{count} selected",closeText:"Close",cancelText:"Cancel",clearText:"Clear",context:"body",maxPopupWidth:600,disabled:!1,closeOnOverlayTap:!0,showOnFocus:!1,showOnTap:!0,display:"center",scroll:!0,scrollLock:!0,tap:!0,btnClass:"mbsc-fr-btn",btnWidth:!0,focusTrap:!0,focusOnClose:!Ye},Ae.Frame=We,Oe.frame.mobiscroll={headerText:!1,btnWidth:!1},Oe.scroller.mobiscroll=Se.extend({},Oe.frame.mobiscroll,{rows:5,showLabel:!1,selectedLineBorder:1,weekDays:"min",checkIcon:"ion-ios7-checkmark-empty",btnPlusClass:"mbsc-ic mbsc-ic-arrow-down5",btnMinusClass:"mbsc-ic mbsc-ic-arrow-up5",btnCalPrevClass:"mbsc-ic mbsc-ic-arrow-left5",btnCalNextClass:"mbsc-ic mbsc-ic-arrow-right5"}),Se(window).on("focus",function(){De&&(ke=!0)});var Re=U.$,je=U.classes,qe=U.util,Xe=qe.constrain,Be=qe.jsPrefix,Ue=qe.prefix,ze=qe.getCoord,Ke=qe.getPosition,Ge=qe.testTouch,Ze=qe.isNumeric,Je=qe.isString,Qe=/(iphone|ipod|ipad)/i.test(navigator.userAgent),et=function(){},tt=window.requestAnimationFrame||function(e){e()},st=window.cancelAnimationFrame||et,nt=function(e,t,s){function n(e){X("onStart",{domEvent:e}),Z.stopProp&&e.stopPropagation(),(Z.prevDef||"mousedown"==e.type)&&e.preventDefault(),Z.readonly||Z.lock&&S||Ge(e,this)&&!k&&(d&&d.removeClass("mbsc-btn-a"),_=!1,S||(d=Re(e.target).closest(".mbsc-btn-e",this),d.length&&!d.hasClass("mbsc-btn-d")&&(_=!0,u=setTimeout(function(){d.addClass("mbsc-btn-a")},100))),k=!0,O=!1,V=!1,z.scrolled=S,F=ze(e,"X"),P=ze(e,"Y"),y=C=F,h=0,f=0,p=0,Y=new Date,H=+Ke(R,B)||0,S&&c(H,Qe?0:1),"mousedown"===e.type&&Re(document).on("mousemove",a).on("mouseup",r))}function a(e){k&&(Z.stopProp&&e.stopPropagation(),y=ze(e,"X"),x=ze(e,"Y"),h=y-F,f=x-P,p=B?f:h,_&&(Math.abs(f)>Z.thresholdY||Math.abs(h)>Z.thresholdX)&&(clearTimeout(u),d.removeClass("mbsc-btn-a"),_=!1),(z.scrolled||!V&&Math.abs(p)>q)&&(O||X("onGestureStart",w),z.scrolled=O=!0,A||(A=!0,$=tt(i))),B||Z.scrollLock?e.preventDefault():z.scrolled?e.preventDefault():Math.abs(f)>7&&(V=!0,z.scrolled=!0,J.trigger("touchend")))}function i(){M&&(p=Xe(p,-E*M,E*M)),c(Xe(H+p,D-g,T+g)),A=!1}function r(e){if(k){var t,s=new Date-Y;Z.stopProp&&e.stopPropagation(),st($),A=!1,!V&&z.scrolled&&(Z.momentum&&s<300&&(t=p/s,p=Math.max(Math.abs(p),t*t/Z.speedUnit)*(p<0?-1:1)),l(p)),_&&(clearTimeout(u),d.addClass("mbsc-btn-a"),setTimeout(function(){d.removeClass("mbsc-btn-a")},100),V||z.scrolled||X("onBtnTap",{target:d[0]})),"mouseup"==e.type&&Re(document).off("mousemove",a).off("mouseup",r),k=!1}}function o(e){if(e=e.originalEvent||e,p=B?e.deltaY||e.wheelDelta||e.detail:e.deltaX,X("onStart",{domEvent:e}),Z.stopProp&&e.stopPropagation(),p){if(e.preventDefault(),e.deltaMode&&1==e.deltaMode&&(p*=5),p=Xe(-p,-20,20),H=U,Z.readonly||H+p<D||H+p>T)return;O||(w={posX:B?0:U,posY:B?U:0,originX:B?0:H,originY:B?H:0,direction:p>0?B?270:360:B?90:180},X("onGestureStart",w)),A||(A=!0,$=tt(i)),O=!0,clearTimeout(I),I=setTimeout(function(){st($),A=!1,O=!1,l(p)},200)}}function l(e){var t,s,n;if(M&&(e=Xe(e,-E*M,E*M)),n=Xe(Math.round((H+e)/E)*E,D,T),K=Math.round(n/E),N){if(e<0){for(t=N.length-1;t>=0;t--)if(Math.abs(n)+m>=N[t].breakpoint){K=t,G=2,n=N[t].snap2;break}}else if(e>=0)for(t=0;t<N.length;t++)if(Math.abs(n)<=N[t].breakpoint){K=t,G=1,n=N[t].snap1;break}n=Xe(n,D,T)}s=Z.time||(U<D||U>T?1e3:Math.max(1e3,Math.abs(n-U)*Z.timeUnit)),w.destinationX=B?0:n,w.destinationY=B?n:0,w.duration=s,w.transitionTiming=b,X("onGestureEnd",w),c(n,s)}function c(e,t,s,n){var a=e!=U,i=t>1,r=function(){clearInterval(L),clearTimeout(j),S=!1,U=e,w.posX=B?0:e,w.posY=B?e:0,a&&X("onMove",w),i&&X("onAnimationEnd",w),n&&n()};w={posX:B?0:U,posY:B?U:0,originX:B?0:H,originY:B?H:0,direction:e-U>0?B?270:360:B?90:180},U=e,i&&(w.destinationX=B?0:e,w.destinationY=B?e:0,w.duration=t,w.transitionTiming=b,X("onAnimationStart",w)),W[Be+"Transition"]=t?Ue+"transform "+Math.round(t)+"ms "+b:"",W[Be+"Transform"]="translate3d("+(B?"0,"+e+"px,":e+"px,0,")+"0)",!a&&!S||!t||t<=1?r():t&&(S=!s,clearInterval(L),L=setInterval(function(){var t=+Ke(R,B)||0;w.posX=B?0:t,w.posY=B?t:0,X("onMove",w),Math.abs(t-e)<2&&r()},100),clearTimeout(j),j=setTimeout(function(){r()},t)),Z.sync&&Z.sync(e,t,b)}var d,u,m,h,f,p,v,b,g,y,x,w,_,C,T,M,D,k,S,V,$,A,O,I,L,E,N,H,Y,F,P,W,R,j,q,X,B,U,z=this,K=0,G=1,Z=t,J=Re(e);je.Base.call(this,e,t,!0),z.scrolled=!1,z.scroll=function(t,s,n,a){t=Ze(t)?Math.round(t/E)*E:Math.ceil((Re(t,e).length?Math.round(R.offset()[v]-Re(t,e).offset()[v]):U)/E)*E,t=Xe(t,D,T),K=Math.round(t/E),H=U,c(t,s,n,a)},z.refresh=function(e){var t;m=void 0===Z.contSize?B?J.height():J.width():Z.contSize,D=void 0===Z.minScroll?Math.min(0,B?m-R.height():m-R.width()):Z.minScroll,T=void 0===Z.maxScroll?0:Z.maxScroll,N=null,!B&&Z.rtl&&(t=T,T=-D,D=-t),Je(Z.snap)&&(N=[],R.find(Z.snap).each(function(){var e=B?this.offsetTop:this.offsetLeft,t=B?this.offsetHeight:this.offsetWidth;N.push({breakpoint:e+t/2,snap1:-e,snap2:m-e-t})})),E=Ze(Z.snap)?Z.snap:1,M=Z.snap?Z.maxSnapScroll:0,b=Z.easing,g=Z.elastic?Ze(Z.snap)?E:Ze(Z.elastic)?Z.elastic:0:0,void 0===U&&(U=Z.initialPos,K=Math.round(U/E)),e||z.scroll(Z.snap?N?N[K]["snap"+G]:K*E:U)},z._processSettings=function(){B="Y"==Z.axis,v=B?"top":"left",R=Z.moveElement||J.children().eq(0),W=R[0].style,q=B?Z.thresholdY:Z.thresholdX},z._init=function(){z.refresh(),J.on("touchstart mousedown",n).on("touchmove",a).on("touchend touchcancel",r),Z.mousewheel&&J.on("wheel mousewheel",o),e.addEventListener&&e.addEventListener("click",function(e){z.scrolled&&(z.scrolled=!1,e.stopPropagation(),e.preventDefault())},!0)},z._destroy=function(){clearInterval(L),J.off("touchstart mousedown",n).off("touchmove",a).off("touchend touchcancel",r).off("wheel mousewheel",o)},Z=z.settings,X=z.trigger,s||z.init(t)};nt.prototype={_class:"scrollview",_defaults:{speedUnit:.0022,timeUnit:3,initialPos:0,axis:"Y",thresholdX:10,thresholdY:5,easing:"cubic-bezier(0.190, 1.000, 0.220, 1.000)",stopProp:!0,momentum:!0,mousewheel:!0,elastic:!0}},je.ScrollView=nt,U.presetShort("scrollview","ScrollView",!1);var at=U.$,it=at.extend,rt=U.platform,ot=U.util,lt=ot.jsPrefix,ct=ot.prefix,dt=ot.getCoord,ut=ot.testTouch,mt=window.CSS,ht=mt&&mt.supports&&mt.supports("(transform-style: preserve-3d)"),ft=!ht||"wp"==rt.name||"android"==rt.name;U.presetShort("scroller","Scroller",!1);var pt=function(e,t,s){function n(e){var t=+at(this).attr("data-index");e.stopPropagation(),"mousedown"===e.type&&e.preventDefault(),ut(e,this)&&!b(t)&&(k=at(this).addClass("mbsc-sc-btn-a"),N=dt(e,"X"),H=dt(e,"Y"),L=!0,E=!1,setTimeout(function(){f(t,"inc"==k.attr("data-dir")?1:-1)},100),"mousedown"===e.type&&at(document).on("mousemove",a).on("mouseup",i))}function a(e){(Math.abs(N-dt(e,"X"))>7||Math.abs(H-dt(e,"Y"))>7)&&p(!0)}function i(e){p(),e.preventDefault(),"mouseup"===e.type&&at(document).off("mousemove",a).off("mouseup",i)}function r(e){var t,s,n=at(this).attr("data-index");38==e.keyCode?(t=!0,s=-1):40==e.keyCode?(t=!0,s=1):32==e.keyCode&&(t=!0,l(n,X[n]._$markup.find('.mbsc-sc-itm[data-val="'+Y[n]+'"]'))),t&&(e.stopPropagation(),e.preventDefault(),s&&!L&&(L=!0,E=!1,f(n,s)))}function o(){p()}function l(e,t){var s=X[e],n=t.attr("data-index"),a=h(s,n),i=K._tempSelected[e],r=ot.isNumeric(s.multiple)?s.multiple:1/0;j("onItemTap",{target:t[0],index:e,value:a,selected:t.hasClass("mbsc-sc-itm-sel")})!==!1&&(s.multiple&&!s._disabled[a]&&(void 0!==i[a]?(t.removeClass(A).removeAttr("aria-selected"),delete i[a]):(1==r&&(K._tempSelected[e]=i={},s._$markup.find(".mbsc-sc-itm-sel").removeClass(A).removeAttr("aria-selected")),ot.objectToArray(i).length<r&&(t.addClass(A).attr("aria-selected","true"),i[a]=a))),T(s,e,n,z,!0,!0,s.multiple),!K.live||s.multiple||R.setOnTap!==!0&&!R.setOnTap[e]||setTimeout(function(){K.select()},200))}function c(e,t){return(e._array?e._map[t]:e.getIndex(t,K))||0}function d(e,t){var s=e.data;if(t>=e.min&&t<=e.max)return e._array?e.circular?at(s).get(t%e._length):s[t]:at.isFunction(s)?s(t,K):""}function u(e){return at.isPlainObject(e)?void 0!==e.value?e.value:e.display:e}function m(e){var t=at.isPlainObject(e)?e.display:e;return void 0===t?"":t}function h(e,t){return u(d(e,t))}function f(e,t){E||v(e,t),L&&(clearInterval(I),I=setInterval(function(){v(e,t)},R.delay))}function p(e){clearInterval(I),E=e,L=!1,k&&k.removeClass("mbsc-sc-btn-a")}function v(e,t){var s=X[e];T(s,e,s._current+t,z,1==t?1:2)}function b(e){return at.isArray(R.readonly)?R.readonly[e]:R.readonly}function g(e,t,s){var n=e._index-e._batch;return e.data=e.data||[],e.key=void 0!==e.key?e.key:t,e.label=void 0!==e.label?e.label:t,e._map={},e._array=at.isArray(e.data),e._array&&(e._length=e.data.length,at.each(e.data,function(t,s){e._map[u(s)]=t})),e.circular=void 0===R.circular?void 0===e.circular?e._array&&e._length>R.rows:e.circular:at.isArray(R.circular)?R.circular[t]:R.circular,e.min=e._array?e.circular?-(1/0):0:void 0===e.min?-(1/0):e.min,e.max=e._array?e.circular?1/0:e._length-1:void 0===e.max?1/0:e.max,e._nr=t,e._index=c(e,Y[t]),e._disabled={},e._batch=0,e._current=e._index,e._first=e._index-U,e._last=e._index+U,e._offset=e._first,s?(e._offset-=e._margin/F+(e._index-n),e._margin+=(e._index-n)*F):e._margin=0,e._refresh=function(t){var s=-(e.min-e._offset+(e.multiple&&!$?Math.floor(R.rows/2):0))*F,n=Math.min(s,-(e.max-e._offset-(e.multiple&&!$?Math.floor(R.rows/2):0))*F);it(e._scroller.settings,{minScroll:n,maxScroll:s}),e._scroller.refresh(t)},B[e.key]=e,e}function y(e,t,s,n,a){var i,r,o,l,c,h,f,p,v="",b=K._tempSelected[t],g=e._disabled||{};for(i=s;i<=n;i++)o=d(e,i),c=m(o),l=u(o),r=o&&void 0!==o.cssClass?o.cssClass:"",h=o&&void 0!==o.label?o.label:"",f=o&&o.invalid,p=void 0!==l&&l==Y[t]&&!e.multiple,v+='<div role="option" aria-selected="'+!!b[l]+'" class="mbsc-sc-itm '+(a?"mbsc-sc-itm-3d ":"")+r+" "+(p?"mbsc-sc-itm-sel ":"")+(b[l]?A:"")+(void 0===l?" mbsc-sc-itm-ph":" mbsc-btn-e")+(f?" mbsc-sc-itm-inv-h mbsc-btn-d":"")+(g[l]?" mbsc-sc-itm-inv mbsc-btn-d":"")+'" data-index="'+i+'" data-val="'+l+'"'+(h?' aria-label="'+h+'"':"")+(p?' aria-selected="true"':"")+' style="height:'+F+"px;line-height:"+F+"px;"+(a?ct+"transform:rotateX("+(e._offset-i)*V%360+"deg) translateZ("+F*R.rows/2+"px);":"")+'">'+(q>1?'<div class="mbsc-sc-itm-ml" style="line-height:'+Math.round(F/q)+"px;font-size:"+Math.round(F/q*.8)+'px;">':"")+c+(q>1?"</div>":"")+"</div>";return v}function x(t){var s=R.headerText;return s?"function"==typeof s?s.call(e,t):s.replace(/\{value\}/i,t):""}function w(e,t,s){var n=Math.round(-s/F)+e._offset,a=n-e._current,i=e._first,r=e._last,o=i+U-S+1,l=r-U+S;a&&(e._first+=a,e._last+=a,e._current=n,a>0?(e._$scroller.append(y(e,t,Math.max(r+1,i+a),r+a)),at(".mbsc-sc-itm",e._$scroller).slice(0,Math.min(a,r-i+1)).remove(),$&&(e._$3d.append(y(e,t,Math.max(l+1,o+a),l+a,!0)),at(".mbsc-sc-itm",e._$3d).slice(0,Math.min(a,l-o+1)).attr("class","mbsc-sc-itm-del"))):a<0&&(e._$scroller.prepend(y(e,t,i+a,Math.min(i-1,r+a))),at(".mbsc-sc-itm",e._$scroller).slice(Math.max(a,i-r-1)).remove(),$&&(e._$3d.prepend(y(e,t,o+a,Math.min(o-1,l+a),!0)),at(".mbsc-sc-itm",e._$3d).slice(Math.max(a,o-l-1)).attr("class","mbsc-sc-itm-del"))),e._margin+=a*F,e._$scroller.css("margin-top",e._margin+"px"))}function _(e,t,s,n){var a,i=X[e],r=n||i._disabled,o=c(i,t),l=t,d=t,u=0,m=0;if(void 0===t&&(t=h(i,o)),r[t]===!0){for(a=0;o-u>=i.min&&r[l]&&a<100;)a++,u++,l=h(i,o-u);for(a=0;o+m<i.max&&r[d]&&a<100;)a++,m++,d=h(i,o+m);t=(m<u&&m&&2!==s||!u||o-u<0||1==s)&&!r[d]?d:l}return t}function C(t,s,n,a,i,r){var o,l,d,u,m=K._isVisible;W=!0,u=R.validate.call(e,{values:Y.slice(0),index:s,direction:n},K)||{},W=!1,u.valid&&(K._tempWheelArray=Y=u.valid.slice(0)),r||at.each(X,function(e,a){if(m&&a._$markup.find(".mbsc-sc-itm-inv").removeClass("mbsc-sc-itm-inv mbsc-btn-d"),a._disabled={},u.disabled&&u.disabled[e]&&at.each(u.disabled[e],function(e,t){a._disabled[t]=!0,m&&a._$markup.find('.mbsc-sc-itm[data-val="'+t+'"]').addClass("mbsc-sc-itm-inv mbsc-btn-d")}),Y[e]=a.multiple?Y[e]:_(e,Y[e],n),m){if(a.multiple&&void 0!==s||a._$markup.find(".mbsc-sc-itm-sel").removeClass(A).removeAttr("aria-selected"),a.multiple){if(void 0===s)for(var r in K._tempSelected[e])a._$markup.find('.mbsc-sc-itm[data-val="'+r+'"]').addClass(A).attr("aria-selected","true")}else a._$markup.find('.mbsc-sc-itm[data-val="'+Y[e]+'"]').addClass("mbsc-sc-itm-sel").attr("aria-selected","true");l=c(a,Y[e]),o=l-a._index+a._batch,Math.abs(o)>2*U+1&&(d=o+(2*U+1)*(o>0?-1:1),a._offset+=d,a._margin-=d*F,a._refresh()),a._index=l+a._batch,a._scroller.scroll(-(l-a._offset+a._batch)*F,s===e||void 0===s?t:z,i)}}),j("onValidated"),K._tempValue=R.formatValue(Y,K),m&&K._header.html(x(K._tempValue)),K.live&&(K._hasValue=a||K._hasValue,M(a,a,0,!0),a&&j("onSet",{valueText:K._value})),a&&j("onChange",{valueText:K._tempValue})}function T(e,t,s,n,a,i,r){var o=h(e,s);void 0!==o&&(Y[t]=o,e._batch=e._array?Math.floor(s/e._length)*e._length:0,setTimeout(function(){C(n,t,a,!0,i,r)},10))}function M(e,t,s,n,a){if(n?K._tempValue=R.formatValue(K._tempWheelArray,K):C(s),!a){K._wheelArray=[];for(var i=0;i<Y.length;i++)K._wheelArray[i]=X[i]&&X[i].multiple?Object.keys(K._tempSelected[i])[0]:Y[i];K._value=K._hasValue?K._tempValue:null,K._selected=it(!0,{},K._tempSelected)}e&&(K._isInput&&G.val(K._hasValue?K._tempValue:""),j("onFill",{valueText:K._hasValue?K._tempValue:"",change:t}),t&&(K._preventChange=!0,G.trigger("change")))}var D,k,S,V,$,A,O,I,L,E,N,H,Y,F,P,W,R,j,q,X,B,U=40,z=1e3,K=this,G=at(e);We.call(this,e,t,!0),K.setVal=K._setVal=function(t,s,n,a,i){K._hasValue=null!==t&&void 0!==t,K._tempWheelArray=Y=at.isArray(t)?t.slice(0):R.parseValue.call(e,t,K)||[],M(s,void 0===n?s:n,i,!1,a)},K.getVal=K._getVal=function(e){var t=K._hasValue||e?K[e?"_tempValue":"_value"]:null;return ot.isNumeric(t)?+t:t},K.setArrayVal=K.setVal,K.getArrayVal=function(e){return e?K._tempWheelArray:K._wheelArray},K.changeWheel=function(e,t,s){var n,a;at.each(e,function(e,t){a=B[e],n=a._nr,a&&(it(a,t),g(a,n,!0),K._isVisible&&($&&a._$3d.html(y(a,n,a._first+U-S+1,a._last-U+S,!0)),a._$scroller.html(y(a,n,a._first,a._last)).css("margin-top",a._margin+"px"),a._refresh(W)))}),!K._isVisible||K._isLiquid||W||K.position(),W||C(t,void 0,void 0,s)},K.getValidValue=_,K._generateContent=function(){var e,t=0,s="",n=$?ct+"transform: translateZ("+(F*R.rows/2+3)+"px);":"",a='<div class="mbsc-sc-whl-l" style="'+n+"height:"+F+"px;margin-top:-"+(F/2+(R.selectedLineBorder||0))+'px;"></div>',i=0;return at.each(R.wheels,function(r,o){s+='<div class="mbsc-w-p mbsc-sc-whl-gr-c'+(R.showLabel?" mbsc-sc-lbl-v":"")+'">'+a+'<div class="mbsc-sc-whl-gr'+($?" mbsc-sc-whl-gr-3d":"")+(O?" mbsc-sc-cp":"")+(R.width||R.maxWidth?'"':'" style="max-width:'+R.maxPopupWidth+'px;"')+">",at.each(o,function(r,o){K._tempSelected[i]=it({},K._selected[i]),X[i]=g(o,i),t+=R.maxWidth?R.maxWidth[i]||R.maxWidth:R.width?R.width[i]||R.width:0,e=void 0!==o.label?o.label:r,s+='<div class="mbsc-sc-whl-w '+(o.cssClass||"")+(o.multiple?" mbsc-sc-whl-multi":"")+'" style="'+(R.width?"width:"+(R.width[i]||R.width)+"px;":(R.minWidth?"min-width:"+(R.minWidth[i]||R.minWidth)+"px;":"")+(R.maxWidth?"max-width:"+(R.maxWidth[i]||R.maxWidth)+"px;":""))+'"><div class="mbsc-sc-whl-o" style="'+n+'"></div>'+a+'<div tabindex="0" aria-live="off" aria-label="'+e+'"'+(o.multiple?' aria-multiselectable="true"':"")+' role="listbox" data-index="'+i+'" class="mbsc-sc-whl" style="height:'+R.rows*F*($?1.1:1)+'px;">'+(O?'<div data-index="'+i+'" data-dir="inc" class="mbsc-sc-btn mbsc-sc-btn-plus '+(R.btnPlusClass||"")+'" style="height:'+F+"px;line-height:"+F+'px;"></div><div data-index="'+i+'" data-dir="dec" class="mbsc-sc-btn mbsc-sc-btn-minus '+(R.btnMinusClass||"")+'" style="height:'+F+"px;line-height:"+F+'px;"></div>':"")+'<div class="mbsc-sc-lbl">'+e+'</div><div class="mbsc-sc-whl-c" style="height:'+P+"px;margin-top:-"+(P/2+1)+"px;"+n+'"><div class="mbsc-sc-whl-sc" style="top:'+(P-F)/2+'px;">',s+=y(o,i,o._first,o._last)+"</div></div>",$&&(s+='<div class="mbsc-sc-whl-3d" style="height:'+F+"px;margin-top:-"+F/2+'px;">',s+=y(o,i,o._first+U-S+1,o._last-U+S,!0),s+="</div>"),s+="</div></div>",i++}),s+="</div></div>"}),t&&(R.maxPopupWidth=t),s},K._attachEvents=function(e){at(".mbsc-sc-btn",e).on("touchstart mousedown",n).on("touchmove",a).on("touchend touchcancel",i),at(".mbsc-sc-whl",e).on("keydown",r).on("keyup",o)},K._detachEvents=function(){for(var e=0;e<X.length;e++)X[e]._scroller.destroy()},K._markupReady=function(e){D=e,at(".mbsc-sc-whl",D).each(function(e){var t,s=at(this),n=X[e],a=-(n.min-n._offset+(n.multiple&&!$?Math.floor(R.rows/2):0))*F,i=Math.min(a,-(n.max-n._offset-(n.multiple&&!$?Math.floor(R.rows/2):0))*F);n._$markup=s,n._$scroller=at(".mbsc-sc-whl-sc",this),n._$3d=at(".mbsc-sc-whl-3d",this),n._scroller=new nt(this,{mousewheel:R.mousewheel,moveElement:n._$scroller,initialPos:(n._first-n._index)*F,contSize:0,snap:F,minScroll:i,maxScroll:a,maxSnapScroll:U,prevDef:!0,stopProp:!0,timeUnit:3,easing:"cubic-bezier(0.190, 1.000, 0.220, 1.000)",sync:function(e,t,s){$&&(n._$3d[0].style[lt+"Transition"]=t?ct+"transform "+Math.round(t)+"ms "+s:"",n._$3d[0].style[lt+"Transform"]="rotateX("+-e/F*V+"deg)")},onStart:function(t,s){s.settings.readonly=b(e)},onGestureStart:function(){s.addClass("mbsc-sc-whl-a mbsc-sc-whl-anim"),j("onWheelGestureStart",{index:e})},onGestureEnd:function(s){var a=90==s.direction?1:2,i=s.duration,r=s.destinationY;t=Math.round(-r/F)+n._offset,T(n,e,t,i,a)},onAnimationStart:function(){s.addClass("mbsc-sc-whl-anim")},onAnimationEnd:function(){s.removeClass("mbsc-sc-whl-a mbsc-sc-whl-anim"),j("onWheelAnimationEnd",{index:e}),n._$3d.find(".mbsc-sc-itm-del").remove()},onMove:function(t){w(n,e,t.posY)},onBtnTap:function(t){l(e,at(t.target))}})}),C()},K._fillValue=function(){K._hasValue=!0,M(!0,!0,0,!0)},K._clearValue=function(){at(".mbsc-sc-whl-multi .mbsc-sc-itm-sel",D).removeClass(A).removeAttr("aria-selected")},K._readValue=function(){var t=G.val()||"",s=0;""!==t&&(K._hasValue=!0),K._tempWheelArray=Y=K._hasValue&&K._wheelArray?K._wheelArray.slice(0):R.parseValue.call(e,t,K)||[],K._tempSelected=it(!0,{},K._selected),at.each(R.wheels,function(e,t){at.each(t,function(e,t){X[s]=g(t,s),s++})}),M(!1,!1,0,!0),j("onRead")},K.__processSettings=function(){R=K.settings,j=K.trigger,q=R.multiline,A="mbsc-sc-itm-sel mbsc-ic mbsc-ic-"+R.checkIcon,X=[],B={}},K.__init=function(){O=R.showScrollArrows,$=R.scroll3d&&!ft&&!O,F=R.height,P=$?2*Math.round((F-.03*(F*R.rows/2+3))/2):F,S=Math.round(1.8*R.rows),V=360/(2*S),O&&(R.rows=Math.max(3,R.rows)),R.cssClass=(R.cssClass||"")+" mbsc-sc"},K._getItemValue=u,K._tempSelected={},K._selected={},s||K.init(t)};pt.prototype={_hasDef:!0,_hasTheme:!0,_hasLang:!0,_hasPreset:!0,_class:"scroller",_defaults:it({},We.prototype._defaults,{minWidth:80,height:40,rows:3,multiline:1,delay:300,readonly:!1,showLabel:!0,setOnTap:!1,wheels:[],preset:"",speedUnit:.0012,timeUnit:.08,checkIcon:"checkmark",validate:function(){},formatValue:function(e){return e.join(" ")},parseValue:function(e,t){var s,n,a=[],i=[],r=0;return null!==e&&void 0!==e&&(a=(e+"").split(" ")),at.each(t.settings.wheels,function(e,o){at.each(o,function(e,o){n=o.data,s=t._getItemValue(n[0]),at.each(n,function(e,n){if(a[r]==t._getItemValue(n))return s=t._getItemValue(n),!1}),i.push(s),r++})}),i}})},U.classes.Scroller=pt;var vt=U.$,bt=U.util,gt=bt.isString,yt={inputClass:"",invalid:[],rtl:!1,showInput:!0,groupLabel:"Groups",dataHtml:"html",dataText:"text",dataValue:"value",dataGroup:"group",dataDisabled:"disabled",filterPlaceholderText:"Type to filter",filterEmptyText:"No results",filterClearIcon:"material-close"};U.presetShort("select"),U.presets.scroller.select=function(e){function t(e){var t,s,n,a,i,r,o=0,l=0,c={};if(N={},_={},D=[],w=[],Z.length=0,q)vt.each(p,function(o,d){i=d[I.dataText],s=d[I.dataHtml],r=d[I.dataValue],n=d[I.dataGroup],a={value:r,html:s,text:i,index:o},N[r]=a,e&&!u(i,e)||(D.push(a),X&&(void 0===c[n]?(t={text:n,value:l,options:[],index:l},_[l]=t,c[n]=l,w.push(t),l++):t=_[c[n]],z&&(a.index=t.options.length),a.group=c[n],t.options.push(a)),d[I.dataDisabled]&&Z.push(r))});else if(X){var d=!0;vt("optgroup",A).each(function(t){_[t]={text:this.label,value:t,options:[],index:t},d=!0,vt("option",this).each(function(s){a={value:this.value,text:this.text,index:z?s:o++,group:t},N[this.value]=a,e&&!u(this.text,e)||(d&&(w.push(_[t]),d=!1),D.push(a),_[t].options.push(a),this.disabled&&Z.push(this.value))})})}else vt("option",A).each(function(t){a={value:this.value,text:this.text,index:t},N[this.value]=a,e&&!u(this.text,e)||(D.push(a),this.disabled&&Z.push(this.value))});D.length&&(b=D[0].value),K&&(D=[],o=0,vt.each(_,function(e,t){t.options.length&&(r="__group"+e,a={text:t.text,value:r,group:e,index:o++,cssClass:"mbsc-sel-gr"},N[r]=a,D.push(a),Z.push(a.value),vt.each(t.options,function(e,t){t.index=o++,D.push(t)}))})),L&&(D.length?L.removeClass("mbsc-sel-empty-v"):L.addClass("mbsc-sel-empty-v"))}function s(e,t,s){var n,a=[];for(n=0;n<e.length;n++)a.push({value:e[n].value,display:e[n].html||e[n].text,cssClass:e[n].cssClass});return{circular:!1,multiple:t,data:a,label:s}}function n(){return s(w,!1,I.groupLabel)}function a(){return s(z?_[x].options:D,P,j)}function i(){var e,t,s=[[]];return U&&(e=n(),Y?s[0][C]=e:s[C]=[e]),t=a(),Y?s[0][k]=t:s[k]=[t],s}function r(e){F&&(e&&gt(e)&&(e=e.split(",")),vt.isArray(e)&&(e=e[0])),M=void 0!==e&&null!==e&&""!==e&&N[e]?e:b,U&&(x=N[M]?N[M].group:null)}function o(t,s){var n=t?e._tempWheelArray:e._hasValue?e._wheelArray:null;return n?I.group&&s?n:n[k]:null}function l(t){var s,n,a=[];if(P){for(s in e._tempSelected[k])a.push(V[s]||(N[s]?N[s].text:""));return a.join(", ")}return n=t[k],N[n]?N[n].text:""}function c(){var t=e.getVal(),s=e._tempValue;I.filter&&"inline"==I.display||f.val(s),A.val(t)}function d(){var t={};t[k]=a(),S=!0,e.changeWheel(t)}function u(e,t){return t=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),e.match(new RegExp(t,"ig"))}function m(e){return I.data.dataField?e[I.data.dataField]:I.data.processResponse?I.data.processResponse(e):e}function h(s){var o={};t(s),I.wheels=i(),r(M),o[k]=a(),e._tempWheelArray[k]=M,U&&(o[C]=n(),e._tempWheelArray[C]=x),e._isVisible&&e.changeWheel(o,0,!0)}var f,p,b,g,y,x,w,_,C,T,M,D,k,S,V={},$=1e3,A=vt(this),O=vt.extend({},e.settings),I=vt.extend(e.settings,yt,O),L=vt('<div class="mbsc-sel-empty">'+I.filterEmptyText+"</div>"),E=I.readonly,N={},H=I.layout||(/top|bottom|inline/.test(I.display)||I.filter?"liquid":""),Y="liquid"==H,F=bt.isNumeric(I.select)?I.select:"multiple"==I.select||A.prop("multiple"),P=F||!!I.filter&&1,W=this.id+"_dummy",R=vt('label[for="'+this.id+'"]').attr("for",W),j=void 0!==I.label?I.label:R.length?R.text():A.attr("name"),q=!!I.data,X=q?!!I.group:vt("optgroup",A).length,B=I.group,U=X&&B&&B.groupWheel!==!1,z=X&&B&&U&&B.clustered===!0,K=X&&(!B||B.header!==!1&&!z),G=A.val()||(F?[]:[""]),Z=[];return e.setVal=function(t,s,n,a,i){P&&(t&&!F&&(t=[t]),t&&gt(t)&&(t=t.split(",")),e._tempSelected[k]=bt.arrayToObject(t),a||(e._selected[k]=bt.arrayToObject(t)),t=t?t[0]:null),e._setVal(t,s,n,a,i)},e.getVal=function(t,s){if(P){var n=bt.objectToArray(t?e._tempSelected[k]:e._selected[k]);return F?n:n.length?n[0]:null}return o(t,s)},e.refresh=function(e,t){e?p=e:vt.isArray(I.data)&&(p=I.data),!e&&T&&void 0===t?v(I.data.url,function(e){p=m(e),h()},I.data.dataType):h(t)},I.invalid.length||(I.invalid=Z),U?(C=0,k=1):(C=-1,k=0),P&&(F&&A.prop("multiple",!0),G&&gt(G)&&(G=G.split(",")),e._selected[k]=bt.arrayToObject(G)),e._dummyInput&&e._dummyInput.remove(),A.next().is("input.mbsc-control")?f=A.off(".mbsc-form").next().removeAttr("tabindex"):(I.filter&&"inline"==I.display?e._dummyInput=vt('<div class="mbsc-sel-input-wrap"><input type="text" id="'+W+'" class="mbsc-control '+I.inputClass+'" readonly /></div>'):(f=vt('<input type="text" id="'+W+'" class="mbsc-control '+I.inputClass+'" readonly />'),e._dummyInput=f),
  I.showInput&&(e._dummyInput.insertBefore(A),f||(f=e._dummyInput.find("#"+W)))),e.attachShow(f.attr("placeholder",I.placeholder||"")),A.addClass("mbsc-sel-hdn").attr("tabindex",-1),I.filter&&(g=I.filter.minLength||0),T=I.data&&I.data.url,T?e.refresh():(q&&(p=I.data),t(),r(A.val())),{layout:H,headerText:!1,anchor:f,compClass:"mbsc-sel"+(U?" mbsc-sel-gr-whl":"")+(P?" mbsc-sel-multi":""),setOnTap:!U||[!1,!0],formatValue:l,parseValue:function(e){return r(void 0===e?A.val():e),U?[x,M]:[M]},validate:function(e){var t=e.index,s=[];return s[k]=I.invalid,z&&!S&&void 0===t&&d(),S=!1,{disabled:s}},onRead:c,onFill:c,onMarkupReady:function(e,t){if(I.filter){var s,n,a,i=vt(".mbsc-fr-w",e.target),r=vt('<span class="mbsc-sel-filter-clear mbsc-ic mbsc-ic-'+I.filterClearIcon+'"></span>');"inline"==I.display?(s=f,f.parent().find(".mbsc-sel-filter-clear").remove()):(i.prepend('<div class="mbsc-input mbsc-sel-filter-cont mbsc-control-w"><span class="mbsc-input-wrap"><input type="text" class="mbsc-sel-filter-input mbsc-control"/></span></div>'),s=i.find(".mbsc-sel-filter-input")),y="",a=s[0],s.prop("readonly",!1).attr("placeholder",I.filterPlaceholderText).parent().append(r),i.find(".mbsc-fr-c").prepend(L),t.tap(r,function(){a.value="",t.refresh(),r.removeClass("mbsc-sel-filter-show-clear")}),s.on("keydown",function(e){13!=e.keyCode&&27!=e.keyCode||(e.stopPropagation(),a.blur())}).on("keyup",function(){clearTimeout(n),a.value.length?r.addClass("mbsc-sel-filter-show-clear"):r.removeClass("mbsc-sel-filter-show-clear"),n=setTimeout(function(){y!==a.value&&t.trigger("onFilter",{filterText:a.value})!==!1&&(y=a.value,(y.length>=g||!y.length)&&(T&&I.data.remoteFilter?v(I.data.url+encodeURIComponent(y),function(e){t.refresh(m(e))},I.data.dataType):t.refresh(void 0,y)))},500)})}},onBeforeShow:function(){F&&I.counter&&(I.headerText=function(){var t=0;return vt.each(e._tempSelected[k],function(){t++}),(t>1?I.selectedPluralText||I.selectedText:I.selectedText).replace(/{count}/,t)}),r(A.val()),I.filter&&t(void 0),e.settings.wheels=i(),S=!0},onWheelGestureStart:function(e){e.index==C&&(I.readonly=[!1,!0])},onWheelAnimationEnd:function(t){var s=e.getArrayVal(!0);t.index==C?(I.readonly=E,s[C]!=x&&(x=s[C],M=_[x].options[0].value,s[k]=M,z?d():e.setArrayVal(s,!1,!1,!0,$))):t.index==k&&s[k]!=M&&(M=s[k],U&&N[M]&&N[M].group!=x&&(x=N[M].group,s[C]=x,e.setArrayVal(s,!1,!1,!0,$)))},onItemTap:function(e){if(e.index==k&&(V[e.value]=N[e.value].text,P&&!F&&e.selected))return!1},onClose:function(){T&&I.data.remoteFilter&&y&&e.refresh()},onDestroy:function(){e._dummyInput&&e._dummyInput.remove(),A.removeClass("mbsc-sel-hdn").removeAttr("tabindex")}}},function(){var t=["ng-repeat","ng:repeat","data-ng-repeat","x-ng-repeat","ng_repeat"],s=U.$;e.module("mobiscroll-select",[]).directive("mobiscrollSelectOption",function(){return{link:function(e,t,n){var a=s(t[0]).closest("select");e.$watch(n.ngValue,function(){e.$emit("mbscSelectRefresh",a)}),e.$on("$destroy",function(){e.$emit("mbscSelectRefresh",a)})}}}).directive("mobiscrollSelect",["$parse",function(n){var a=U.ng.getDDO(n,"mobiscrollSelect",{preset:"select"});return a.link=void 0,a.compile=function(a){var i,r,o=s(a[0]);return o.find("option").each(function(){for(r=0;r<t.length;r++)if(s(this).attr(t[r]))return s(this).attr("mobiscroll-select-option",""),i=!0,!1}),function(t,a,r,o){var l,c,d=s(a[0]),u=U.ng.getOpt(t,r,"mobiscrollSelect",o);e.extend(u,{preset:"select"}),r.mobiscrollData&&(e.extend(u,{data:t.$eval(r.mobiscrollData)||[]}),t.$watchCollection(r.mobiscrollData,function(){c&&c.refresh(t.$eval(r.mobiscrollData))})),U.ng.addWatch(n,t,o,d,r,"mobiscrollSelect"),i?t.$on("mbscSelectRefresh",function(e,s){d[0]==s[0]&&(clearTimeout(l),l=setTimeout(function(){c=new U.classes.Scroller(a[0],u),U.ng.render(d,o?o.$modelValue:n(r.mobiscrollSelect)(t)),r.mobiscrollInstance&&n(r.mobiscrollInstance).assign(t,c)},10))}):(c=new U.classes.Scroller(a[0],u),r.mobiscrollInstance&&n(r.mobiscrollInstance).assign(t,c))}},a}])}();var xt=U.$,wt={defaults:{shortYearCutoff:"+10",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["S","M","T","W","T","F","S"],amText:"am",pmText:"pm",getYear:function(e){return e.getFullYear()},getMonth:function(e){return e.getMonth()},getDay:function(e){return e.getDate()},getDate:b,getMaxDayOfMonth:function(e,t){return 32-new Date(e,t,32,12).getDate()},getWeekNumber:function(e){e=new Date(e),e.setHours(0,0,0),e.setDate(e.getDate()+4-(e.getDay()||7));var t=new Date(e.getFullYear(),0,1);return Math.ceil(((e-t)/864e5+1)/7)}},adjustedDate:b,formatDate:function(e,t,s){if(!t)return null;var n,a,i=xt.extend({},wt.defaults,s),r=function(t){for(var s=0;n+1<e.length&&e.charAt(n+1)==t;)s++,n++;return s},o=function(e,t,s){var n=""+t;if(r(e))for(;n.length<s;)n="0"+n;return n},l=function(e,t,s,n){return r(e)?n[t]:s[t]},c="",d=!1;for(n=0;n<e.length;n++)if(d)"'"!=e.charAt(n)||r("'")?c+=e.charAt(n):d=!1;else switch(e.charAt(n)){case"d":c+=o("d",i.getDay(t),2);break;case"D":c+=l("D",t.getDay(),i.dayNamesShort,i.dayNames);break;case"o":c+=o("o",(t.getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5,3);break;case"m":c+=o("m",i.getMonth(t)+1,2);break;case"M":c+=l("M",i.getMonth(t),i.monthNamesShort,i.monthNames);break;case"y":a=i.getYear(t),c+=r("y")?a:(a%100<10?"0":"")+a%100;break;case"h":var u=t.getHours();c+=o("h",u>12?u-12:0===u?12:u,2);break;case"H":c+=o("H",t.getHours(),2);break;case"i":c+=o("i",t.getMinutes(),2);break;case"s":c+=o("s",t.getSeconds(),2);break;case"a":c+=t.getHours()>11?i.pmText:i.amText;break;case"A":c+=t.getHours()>11?i.pmText.toUpperCase():i.amText.toUpperCase();break;case"'":r("'")?c+="'":d=!0;break;default:c+=e.charAt(n)}return c},parseDate:function(e,t,s){var n=xt.extend({},wt.defaults,s),a=n.defaultValue&&n.defaultValue.getTime?n.defaultValue:new Date;if(!e||!t)return a;if(t.getTime)return t;t="object"==("undefined"==typeof t?"undefined":z(t))?t.toString():t+"";var i,r=n.shortYearCutoff,o=n.getYear(a),l=n.getMonth(a)+1,c=n.getDay(a),d=-1,u=a.getHours(),m=a.getMinutes(),h=0,f=-1,p=!1,v=function(t){var s=i+1<e.length&&e.charAt(i+1)==t;return s&&i++,s},b=function(e){v(e);var s="@"==e?14:"!"==e?20:"y"==e?4:"o"==e?3:2,n=new RegExp("^\\d{1,"+s+"}"),a=t.substr(x).match(n);return a?(x+=a[0].length,parseInt(a[0],10)):0},g=function(e,s,n){var a,i=v(e)?n:s;for(a=0;a<i.length;a++)if(t.substr(x,i[a].length).toLowerCase()==i[a].toLowerCase())return x+=i[a].length,a+1;return 0},y=function(){x++},x=0;for(i=0;i<e.length;i++)if(p)"'"!=e.charAt(i)||v("'")?y():p=!1;else switch(e.charAt(i)){case"d":c=b("d");break;case"D":g("D",n.dayNamesShort,n.dayNames);break;case"o":d=b("o");break;case"m":l=b("m");break;case"M":l=g("M",n.monthNamesShort,n.monthNames);break;case"y":o=b("y");break;case"H":u=b("H");break;case"h":u=b("h");break;case"i":m=b("i");break;case"s":h=b("s");break;case"a":f=g("a",[n.amText,n.pmText],[n.amText,n.pmText])-1;break;case"A":f=g("A",[n.amText,n.pmText],[n.amText,n.pmText])-1;break;case"'":v("'")?y():p=!0;break;default:y()}if(o<100&&(o+=(new Date).getFullYear()-(new Date).getFullYear()%100+(o<=("string"!=typeof r?r:(new Date).getFullYear()%100+parseInt(r,10))?0:-100)),d>-1)for(l=1,c=d;;){var w=32-new Date(o,l-1,32,12).getDate();if(c<=w)break;l++,c-=w}u=f==-1?u:f&&u<12?u+12:f||12!=u?u:0;var _=n.getDate(o,l-1,c,u,m,h);return n.getYear(_)!=o||n.getMonth(_)+1!=l||n.getDay(_)!=c?a:_}};U.util.datetime=wt;var _t=U.$,Ct=wt.adjustedDate,Tt={separator:" ",dateFormat:"mm/dd/yy",dateDisplay:"MMddyy",timeFormat:"h:ii A",dayText:"Day",monthText:"Month",yearText:"Year",hourText:"Hours",minuteText:"Minutes",ampmText:"&nbsp;",secText:"Seconds",nowText:"Now",todayText:"Today"},Mt=function e(t){function s(e){return e<10?"0"+e:e}function n(e){var t,s,n,a=[];if(e){for(t=0;t<e.length;t++)if(s=e[t],s.start&&s.start.getTime)for(n=new Date(s.start);n<=s.end;)a.push(Ct(n.getFullYear(),n.getMonth(),n.getDate())),n.setDate(n.getDate()+1);else a.push(s);return a}return e}function a(e,t,s,n){return Math.min(n,Math.floor(e/t)*t+s)}function i(e,t,s){return Math.floor((s-t)/e)*e+t}function r(e){return F.getYear(e)}function o(e){return F.getMonth(e)}function l(e){return F.getDay(e)}function c(e){var t=e.getHours();return t=J&&t>=12?t-12:t,a(t,te,ie,le)}function d(e){return a(e.getMinutes(),se,re,ce)}function u(e){return a(e.getSeconds(),ne,oe,de)}function m(e){return e.getMilliseconds()}function h(e){return e.getHours()>11?1:0}function f(e){return e.getFullYear()+"-"+s(e.getMonth()+1)+"-"+s(e.getDate())}function p(e){return a(Math.round((e.getTime()-new Date(e).setHours(0,0,0,0))/1e3),A,0,86400)}function v(e,t,s,n){var a;return void 0===L[t]||(a=+e[L[t]],isNaN(a))?s?pe[t](s):void 0!==E[t]?E[t]:pe[t](n):a}function b(e){var t,s=new Date((new Date).setHours(0,0,0,0));if(null===e)return e;void 0!==L.dd&&(t=e[L.dd].split("-"),t=new Date(t[0],t[1]-1,t[2])),void 0!==L.tt&&(t=t||s,t=new Date(t.getTime()+e[L.tt]%86400*1e3));var n=v(e,"y",t,s),a=v(e,"m",t,s),i=Math.min(v(e,"d",t,s),F.getMaxDayOfMonth(n,a)),r=v(e,"h",t,s);return F.getDate(n,a,i,J&&v(e,"a",t,s)?r+12:r,v(e,"i",t,s),v(e,"s",t,s),v(e,"u",t,s))}function g(e,t){var s,n,a=["y","m","d","a","h","i","s","u","dd","tt"],i=[];if(null===e||void 0===e)return e;for(s=0;s<a.length;s++)n=a[s],void 0!==L[n]&&(i[L[n]]=pe[n](e)),t&&(E[n]=pe[n](e));return i}function y(e,t){return t?Math.floor(new Date(e)/864e5):e.getMonth()+12*(e.getFullYear()-1970)}function x(e){return{value:e,display:(/yy/i.test(B)?e:(e+"").substr(2,2))+(F.yearSuffix||"")}}function w(e){return e}function _(e){var t=/d/i.test(e);return{label:"",cssClass:"mbsc-dt-whl-date",min:K?y(f(K),t):void 0,max:G?y(f(G),t):void 0,data:function(s){var n=new Date((new Date).setHours(0,0,0,0)),a=t?new Date(864e5*s):new Date(1970,s,1);return t&&(a=new Date(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate())),{invalid:t&&!k(a,!0),value:f(a),display:n.getTime()==a.getTime()?F.todayText:wt.formatDate(e,a,F)}},getIndex:function(e){return y(e,t)}}}function C(e){var t,s,n,a=[];for(/s/i.test(e)?s=ne:/i/i.test(e)?s=60*se:/h/i.test(e)&&(s=3600*te),A=he.tt=s,t=0;t<86400;t+=s)n=new Date((new Date).setHours(0,0,0,0)+1e3*t),a.push({value:t,display:wt.formatDate(e,n,F)});return{label:"",cssClass:"mbsc-dt-whl-time",data:a}}function T(){var t,n,a,i,r,o,l,c,d=0,u=[],m=[],h=[];if(e.match(/date/i)){for(t=q.split(/\|/.test(q)?"|":""),i=0;i<t.length;i++)if(a=t[i],o=0,a.length)if(/y/i.test(a)&&o++,/m/i.test(a)&&o++,/d/i.test(a)&&o++,o>1&&void 0===L.dd)L.dd=d,d++,m.push(_(a)),h=m,O=!0;else if(/y/i.test(a)&&void 0===L.y)L.y=d,d++,m.push({cssClass:"mbsc-dt-whl-y",label:F.yearText,min:K?F.getYear(K):void 0,max:G?F.getYear(G):void 0,data:x,getIndex:w});else if(/m/i.test(a)&&void 0===L.m){for(L.m=d,l=[],d++,r=0;r<12;r++)c=B.replace(/[dy]/gi,"").replace(/mm/,s(r+1)+(F.monthSuffix||"")).replace(/m/,r+1+(F.monthSuffix||"")),l.push({value:r,display:/MM/.test(c)?c.replace(/MM/,'<span class="mbsc-dt-month">'+F.monthNames[r]+"</span>"):c.replace(/M/,'<span class="mbsc-dt-month">'+F.monthNamesShort[r]+"</span>")});m.push({cssClass:"mbsc-dt-whl-m",label:F.monthText,data:l})}else if(/d/i.test(a)&&void 0===L.d){for(L.d=d,l=[],d++,r=1;r<32;r++)l.push({value:r,display:(/dd/i.test(B)?s(r):r)+(F.daySuffix||"")});m.push({cssClass:"mbsc-dt-whl-d",label:F.dayText,data:l})}u.push(m)}if(e.match(/time/i)){for(n=X.split(/\|/.test(X)?"|":""),i=0;i<n.length;i++)if(a=n[i],o=0,a.length&&(/h/i.test(a)&&o++,/i/i.test(a)&&o++,/s/i.test(a)&&o++,/a/i.test(a)&&o++),o>1&&void 0===L.tt)L.tt=d,d++,h.push(C(a));else if(/h/i.test(a)&&void 0===L.h){for(l=[],L.h=d,d++,r=ie;r<(J?12:24);r+=te)l.push({value:r,display:J&&0===r?12:/hh/i.test(U)?s(r):r});h.push({cssClass:"mbsc-dt-whl-h",label:F.hourText,data:l})}else if(/i/i.test(a)&&void 0===L.i){for(l=[],L.i=d,d++,r=re;r<60;r+=se)l.push({value:r,display:/ii/i.test(U)?s(r):r});h.push({cssClass:"mbsc-dt-whl-i",label:F.minuteText,data:l})}else if(/s/i.test(a)&&void 0===L.s){for(l=[],L.s=d,d++,r=oe;r<60;r+=ne)l.push({value:r,display:/ss/i.test(U)?s(r):r});h.push({cssClass:"mbsc-dt-whl-s",label:F.secText,data:l})}else/a/i.test(a)&&void 0===L.a&&(L.a=d,d++,h.push({cssClass:"mbsc-dt-whl-a",label:F.ampmText,data:/A/.test(a)?[{value:0,display:F.amText.toUpperCase()},{value:1,display:F.pmText.toUpperCase()}]:[{value:0,display:F.amText},{value:1,display:F.pmText}]}));h!=m&&u.push(h)}return u}function M(e){var t,s,n,a={};if(e.is("input")){switch(e.attr("type")){case"date":t="yy-mm-dd";break;case"datetime":t="yy-mm-ddTHH:ii:ssZ";break;case"datetime-local":t="yy-mm-ddTHH:ii:ss";break;case"month":t="yy-mm",a.dateOrder="mmyy";break;case"time":t="HH:ii:ss"}a.format=t,s=e.attr("min"),n=e.attr("max"),s&&(a.min=wt.parseDate(t,s)),n&&(a.max=wt.parseDate(t,n))}return a}function D(e,t){var s,n,a=!1,i=!1,r=0,o=0,l=K?b(g(K)):-(1/0),c=G?b(g(G)):1/0;if(k(e))return e;if(e<l&&(e=l),e>c&&(e=c),s=e,n=e,2!==t)for(a=k(s);!a&&s<c;)s=new Date(s.getTime()+864e5),a=k(s),r++;if(1!==t)for(i=k(n);!i&&n>l;)n=new Date(n.getTime()-864e5),i=k(n),o++;return 1===t&&a?s:2===t&&i?n:o<=r&&i?n:s}function k(e,t){return!(!t&&e<K)&&(!(!t&&e>G)&&(!!S(e,W)||!S(e,P)))}function S(e,t){var s,n,a;if(t)for(n=0;n<t.length;n++)if(s=t[n],a=s+"",!s.start)if(s.getTime){if(e.getFullYear()==s.getFullYear()&&e.getMonth()==s.getMonth()&&e.getDate()==s.getDate())return!0}else if(a.match(/w/i)){if(a=+a.replace("w",""),a==e.getDay())return!0}else if(a=a.split("/"),a[1]){if(a[0]-1==e.getMonth()&&a[1]==e.getDate())return!0}else if(a[0]==e.getDate())return!0;return!1}function V(e,t,s,n,a,i,r){var o,l,c,d;if(e)for(l=0;l<e.length;l++)if(o=e[l],d=o+"",!o.start)if(o.getTime)F.getYear(o)==t&&F.getMonth(o)==s&&(i[F.getDay(o)]=r);else if(d.match(/w/i))for(d=+d.replace("w",""),c=d-n;c<a;c+=7)c>=0&&(i[c+1]=r);else d=d.split("/"),d[1]?d[0]-1==s&&(i[d[1]]=r):i[d[0]]=r}function $(e,t,s,n,i,r,o,l){var c,d,u,m,h,f,p,v,b,g,y,x,w,_,C,T,M,D,k,S,V={},$=F.getDate(n,i,r),O=["a","h","i","s"];if(e){for(p=0;p<e.length;p++)y=e[p],y.start&&(y.apply=!1,u=y.d,M=u+"",D=M.split("/"),u&&(u.getTime&&n==F.getYear(u)&&i==F.getMonth(u)&&r==F.getDay(u)||!M.match(/w/i)&&(D[1]&&r==D[1]&&i==D[0]-1||!D[1]&&r==D[0])||M.match(/w/i)&&$.getDay()==+M.replace("w",""))&&(y.apply=!0,V[$]=!0));for(p=0;p<e.length;p++)if(y=e[p],c=0,T=0,v=ue[s],b=me[s],_=!0,C=!0,d=!1,y.start&&(y.apply||!y.d&&!V[$])){for(x=y.start.split(":"),w=y.end.split(":"),g=0;g<3;g++)void 0===x[g]&&(x[g]=0),void 0===w[g]&&(w[g]=59),x[g]=+x[g],w[g]=+w[g];if("tt"==s)v=a(Math.round((new Date($).setHours(x[0],x[1],x[2])-new Date($).setHours(0,0,0,0))/1e3),A,0,86400),b=a(Math.round((new Date($).setHours(w[0],w[1],w[2])-new Date($).setHours(0,0,0,0))/1e3),A,0,86400);else{for(x.unshift(x[0]>11?1:0),w.unshift(w[0]>11?1:0),J&&(x[1]>=12&&(x[1]=x[1]-12),w[1]>=12&&(w[1]=w[1]-12)),g=0;g<t;g++)void 0!==N[g]&&(k=a(x[g],he[O[g]],ue[O[g]],me[O[g]]),S=a(w[g],he[O[g]],ue[O[g]],me[O[g]]),m=0,h=0,f=0,J&&1==g&&(m=x[0]?12:0,h=w[0]?12:0,f=N[0]?12:0),_||(k=0),C||(S=me[O[g]]),(_||C)&&k+m<N[g]+f&&N[g]+f<S+h&&(d=!0),N[g]!=k&&(_=!1),N[g]!=S&&(C=!1));if(!l)for(g=t+1;g<4;g++)x[g]>0&&(c=he[s]),w[g]<me[O[g]]&&(T=he[s]);d||(k=a(x[t],he[s],ue[s],me[s])+c,S=a(w[t],he[s],ue[s],me[s])-T,_&&(v=k),C&&(b=S))}if(_||C||d)for(g=v;g<=b;g+=he[s])o[g]=!l}}}var A,O,I,L={},E={},N=[],H=M(_t(this)),Y=_t.extend({},t.settings),F=_t.extend(t.settings,wt.defaults,Tt,H,Y),P=n(F.invalid),W=n(F.valid),e=F.preset,R="datetime"==e?F.dateFormat+F.separator+F.timeFormat:"time"==e?F.timeFormat:F.dateFormat,j=H.format||R,q=F.dateWheels||F.dateFormat,X=F.timeWheels||F.timeFormat,B=F.dateWheels||F.dateDisplay,U=X,z=F.baseTheme||F.theme,K=F.min,G=F.max,Z=/time/i.test(e),J=/h/.test(U),Q=/D/.test(B),ee=F.steps||{},te=ee.hour||F.stepHour||1,se=ee.minute||F.stepMinute||1,ne=ee.second||F.stepSecond||1,ae=ee.zeroBased,ie=ae||!K?0:K.getHours()%te,re=ae||!K?0:K.getMinutes()%se,oe=ae||!K?0:K.getSeconds()%ne,le=i(te,ie,J?11:23),ce=i(se,re,59),de=i(se,re,59),ue={y:K?K.getFullYear():-(1/0),m:0,d:1,h:ie,i:re,s:oe,a:0,tt:0},me={y:G?G.getFullYear():1/0,m:11,d:31,h:le,i:ce,s:de,a:1,tt:86400},he={y:1,m:1,d:1,h:te,i:se,s:ne,a:1,tt:1},fe={"android-holo":40,bootstrap:46,ios:50,jqm:46,material:46,mobiscroll:46,wp:50},pe={y:r,m:o,d:l,h:c,i:d,s:u,u:m,a:h,dd:f,tt:p};return t.getDate=t.getVal=function(e){return t._hasValue||e?b(t.getArrayVal(e)):null},t.setDate=function(e,s,n,a,i){t.setArrayVal(g(e),s,i,a,n)},I=T(),t.format=R,t.order=L,t.handlers.now=function(){t.setDate(new Date,t.live,1e3,!0,!0)},t.buttons.now={text:F.nowText,icon:F.nowIcon,handler:"now"},{minWidth:O&&Z?fe[z]:void 0,compClass:"mbsc-dt",wheels:I,headerText:!!F.headerText&&function(){return wt.formatDate(R,b(t.getArrayVal(!0)),F)},formatValue:function(e){return wt.formatDate(j,b(e),F)},parseValue:function(e){return e||(E={}),g(e?wt.parseDate(j,e,F):F.defaultValue&&F.defaultValue.getTime?F.defaultValue:new Date,!!e&&!!e.getTime)},validate:function(e){var s,n,a,i,r=e.values,o=e.index,l=e.direction,c=t.settings.wheels[0][L.d],d=D(b(r),l),u=g(d),m=[],h={},f=pe.y(d),p=pe.m(d),v=F.getMaxDayOfMonth(f,p),y=!0,x=!0;if(_t.each(["dd","y","m","d","tt","a","h","i","s"],function(e,t){if(void 0!==L[t]){var s=ue[t],a=me[t],i=pe[t](d);if(m[L[t]]=[],y&&K&&(s=pe[t](K)),x&&G&&(a=pe[t](G)),"y"!=t&&"dd"!=t)for(n=ue[t];n<=me[t];n+=he[t])(n<s||n>a)&&m[L[t]].push(n);if(i<s&&(i=s),i>a&&(i=a),y&&(y=i==s),x&&(x=i==a),"d"==t){var r=F.getDate(f,p,1).getDay(),o={};V(P,f,p,r,v,o,1),V(W,f,p,r,v,o,0),_t.each(o,function(e,s){s&&m[L[t]].push(e)})}}}),Z&&_t.each(["a","h","i","s","tt"],function(e,s){var n=pe[s](d),a=pe.d(d),i={};void 0!==L[s]&&($(P,e,s,f,p,a,i,0),$(W,e,s,f,p,a,i,1),_t.each(i,function(e,t){t&&m[L[s]].push(e)}),N[e]=t.getValidValue(L[s],n,l,i))}),c&&(c._length!==v||Q&&(void 0===o||o===L.y||o===L.m))){for(h[L.d]=c,c.data=[],s=1;s<=v;s++)i=F.getDate(f,p,s).getDay(),a=B.replace(/[my]/gi,"").replace(/dd/,(s<10?"0"+s:s)+(F.daySuffix||"")).replace(/d/,s+(F.daySuffix||"")),c.data.push({value:s,display:a.match(/DD/)?a.replace(/DD/,'<span class="mbsc-dt-day">'+F.dayNames[i]+"</span>"):a.replace(/D/,'<span class="mbsc-dt-day">'+F.dayNamesShort[i]+"</span>")});t._tempWheelArray[L.d]=u[L.d],t.changeWheel(h)}return{disabled:m,valid:u}}}};_t.each(["date","time","datetime"],function(e,t){U.presets.scroller[t]=Mt}),U.$.each(["date","time","datetime"],function(e,t){U.presetShort(t)}),e.module("mobiscroll-datetime",[]).directive("mobiscrollDatetime",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollDatetime",{preset:"datetime"})}]).directive("mobiscrollDate",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollDate",{preset:"date"})}]).directive("mobiscrollTime",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollTime",{preset:"time"})}]);var Dt=U.$,kt={inputClass:"",values:5,order:"desc",style:"icon",invalid:[],icon:{filled:"star3",empty:"star3"}};U.presetShort("rating"),U.presets.scroller.rating=function(e){var t,s,n,a,i,r,o,l,c,d,u=Dt.extend({},e.settings),m=Dt.extend(e.settings,kt,u),h=Dt(this),f=this.id+"_dummy",p=Dt('label[for="'+this.id+'"]').attr("for",f),v=void 0!==m.label?m.label:p.length?p.text():h.attr("name"),b=m.defaultValue,g=[[]],y={data:[],label:v,circular:!1},x={},w=[],_=!1,C="grade"===m.style?"circle":"icon";if(h.is("select")&&(m.values={},Dt("option",h).each(function(){m.values[Dt(this).val()]=Dt(this).text()}),Dt("#"+f).remove()),Dt.isArray(m.values))for(s=0;s<m.values.length;s++)l=+m.values[s],isNaN(l)&&(l=s+1,_=!0),w.push({order:l,key:m.values[s],value:m.values[s]});else if(Dt.isPlainObject(m.values)){s=1,_=!0;for(c in m.values)l=+c,isNaN(l)&&(l=s),w.push({order:l,key:c,value:m.values[c]}),s++}else for(s=1;s<=m.values;s++)w.push({order:s,key:s,value:s});for(void 0===m.showText&&_&&(m.showText=!0),void 0===m.icon.empty&&(m.icon.empty=m.icon.filled),w.sort(function(e,t){return"desc"==m.order?t.order-e.order:e.order-t.order}),d="desc"==m.order?w[0].order:w[w.length-1].order,s=0;s<w.length;s++){for(o=w[s].order,i=w[s].key,r=w[s].value,a="",n=1;n<o+1;n++)a+='<span class="mbsc-rating-'+C+("circle"===C?"":" mbsc-ic mbsc-ic-"+m.icon.filled)+' ">'+("circle"==C?n:" ")+"</span>";for(n=o+1;n<=d;n++)a+='<span class="mbsc-rating-'+C+("circle"===C?" mbsc-rating-circle-unf":" mbsc-ic mbsc-ic-"+(m.icon.empty?m.icon.empty+" mbsc-rating-icon-unf":"")+(m.icon.empty===m.icon.filled?" mbsc-rating-icon-same":""))+'"></span>';void 0===b&&(b=i),a+=m.showText?'<span class="mbsc-rating-txt">'+r+"</span>":"",y.data.push({value:i,display:a,label:r}),x[i]=r}return h.is("select")&&(t=Dt('<input type="text" id="'+f+'" value="'+x[h.val()]+'" class="'+m.inputClass+'" placeholder="'+(m.placeholder||"")+'" readonly />').insertBefore(h)),g[0].push(y),t&&e.attachShow(t),h.is("select")&&h.hide().closest(".ui-field-contain").trigger("create"),e.getVal=function(t){var s=e._hasValue?e[t?"_tempWheelArray":"_wheelArray"][0]:null;return U.util.isNumeric(s)?+s:s},{anchor:t,wheels:g,headerText:!1,compClass:"mbsc-rating",setOnTap:!0,formatValue:function(e){return x[e[0]]},parseValue:function(e){var s;for(s in x)if(t&&s==e||!t&&x[s]==e)return[s];return[b]},validate:function(){return{disabled:[m.invalid]}},onFill:function(s){t&&(t.val(s.valueText),h.val(e._tempWheelArray[0]))},onDestroy:function(){t&&t.remove(),h.show()}}},e.module("mobiscroll-rating",[]).directive("mobiscrollRating",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollRating",{preset:"rating"})}]);var St=U.$,Vt={invalid:[],showInput:!0,inputClass:""};U.presets.scroller.list=function(e){function t(e,t,n){for(var a=0,i=[];a<e;)i[a]=s(n,a,t),a++;return i}function s(e,t,s){for(var n,a=0,i=s,r=[];a<t;){var o=e[a];for(n in i)if(i[n].key==o){i=i[n].children;break}a++}for(a=0;a<i.length;)i[a].invalid&&r.push(i[a].key),a++;return r}function n(e,t){for(var s=[];e;)s[--e]=!0;return s[t]=!1,s}function a(e){var t,s=[];for(t=0;t<e;t++)s[t]=b.labels&&b.labels[t]?b.labels[t]:t;return s}function i(e,t,s){var n,a,i,l=0,c=[[]],d=D;if(t)for(n=0;n<t;n++)y?c[0][n]={}:c[n]=[{}];for(;l<e.length;){for(y?c[0][l]=o(d,k[l]):c[l]=[o(d,k[l])],n=0,i=void 0;n<d.length&&void 0===i;)d[n].key==e[l]&&(void 0!==s&&l<=s||void 0===s)&&(i=n),n++;if(void 0!==i&&d[i].children)l++,d=d[i].children;else{if(!(a=r(d))||!a.children)return c;l++,d=a.children}}return c}function r(e,t){if(!e)return!1;for(var s,n=0;n<e.length;)if(!(s=e[n++]).invalid)return t?n-1:s;return!1}function o(e,t){for(var s={data:[],label:t},n=0;n<e.length;)s.data.push({value:e[n].key,display:e[n].value}),n++;return s}function l(t){e._isVisible&&St(".mbsc-sc-whl-w",e._markup).css("display","").slice(t).hide()}function c(e){for(var t,s=[],n=e,a=!0,i=0;a;)t=r(n),s[i++]=t.key,a=t.children,a&&(n=a);return s}function d(e,t){var s,n,a,i=[],o=D,l=0,c=!1;if(void 0!==e[l]&&l<=t)for(s=0,n=e[l],a=void 0;s<o.length&&void 0===a;)o[s].key!=e[l]||o[s].invalid||(a=s),s++;else a=r(o,!0),n=o[a].key;for(c=void 0!==a&&o[a].children,i[l]=n;c;){if(o=o[a].children,l++,c=!1,a=void 0,void 0!==e[l]&&l<=t)for(s=0,n=e[l],a=void 0;s<o.length&&void 0===a;)o[s].key!=e[l]||o[s].invalid||(a=s),s++;else a=r(o,!0),a=a===!1?void 0:a,n=o[a].key;c=!(void 0===a||!r(o[a].children))&&o[a].children,i[l]=n}return{lvl:l+1,nVector:i}}function u(t){var s=[];return C=C>T++?C:T,t.children("li").each(function(t){var n=St(this),a=n.clone();a.children("ul,ol").remove();var i=e._processMarkup?e._processMarkup(a):a.html().replace(/^\s\s*/,"").replace(/\s\s*$/,""),r=!!n.attr("data-invalid"),o={key:void 0===n.attr("data-val")||null===n.attr("data-val")?t:n.attr("data-val"),value:i,invalid:r,children:null},l=n.children("ul,ol");l.length&&(o.children=u(l)),s.push(o)}),T--,s}function m(t,s,n){var a,r=(s||0)+1,o=[],c={},d={};for(c=i(t,null,s),a=0;a<t.length;a++)e._tempWheelArray[a]=t[a]=n.nVector[a]||0;for(;r<n.lvl;)d[r]=y?c[0][r]:c[r][0],o.push(r++);l(n.lvl),M=t.slice(0),o.length&&(f=!0,e.changeWheel(d))}var h,f,p,v=St.extend({},e.settings),b=St.extend(e.settings,Vt,v),g=b.layout||(/top|bottom/.test(b.display)?"liquid":""),y="liquid"==g,x=b.readonly,w=St(this),_=this.id+"_dummy",C=0,T=0,M=[],D=b.wheelArray||u(w),k=a(C),S=c(D),V=i(S,C);return St("#"+_).remove(),b.showInput&&(h=St('<input type="text" id="'+_+'" value="" class="'+b.inputClass+'" placeholder="'+(b.placeholder||"")+'" readonly />').insertBefore(w),b.anchor=h,e.attachShow(h)),b.wheelArray||w.hide(),{wheels:V,layout:g,headerText:!1,setOnTap:1==C,formatValue:function(e){return void 0===p&&(p=d(e,e.length).lvl),e.slice(0,p).join(" ")},parseValue:function(e){return e?(e+"").split(" "):(b.defaultValue||S).slice(0)},onBeforeShow:function(){var t=e.getArrayVal(!0);M=t.slice(0),b.wheels=i(t,C,C),f=!0},onWheelGestureStart:function(e){b.readonly=n(C,e.index)},onWheelAnimationEnd:function(t){var s=t.index,n=e.getArrayVal(!0),a=d(n,s);p=a.lvl,b.readonly=x,n[s]!=M[s]&&m(n,s,a)},onFill:function(e){p=void 0,h&&h.val(e.valueText)},validate:function(e){var s=e.values,n=e.index,a=d(s,s.length);return p=a.lvl,void 0===n&&(l(a.lvl),f||m(s,n,a)),f=!1,{disabled:t(p,D,s)}},onDestroy:function(){h&&h.remove(),w.show()}}};var $t=U.$,At=U.presets.scroller;U.presetShort("image"),At.image=function(e){return e.settings.enhance&&(e._processMarkup=function(e){var t=e.attr("data-icon");return e.children().each(function(e,t){t=$t(t),t.is("img")?$t('<div class="mbsc-img-c"></div>').insertAfter(t).append(t.addClass("mbsc-img")):t.is("p")&&t.addClass("mbsc-img-txt")}),t&&e.prepend('<div class="mbsc-ic mbsc-ic-'+t+'"></div'),e.html('<div class="mbsc-img-w">'+e.html()+"</div>"),e.html()}),At.list.call(this,e)},function(){var t=U.$,s="mobiscrollImage",n=["ng-repeat","ng:repeat","data-ng-repeat","x-ng-repeat","ng_repeat"],a=+new Date;e.module("mobiscroll-image",[]).directive("mobiscrollRepeatRender",function(){return function(e,t,s){function n(){e.$emit("mbscRepeatRender"+s.mobiscrollRepeatRender)}n(),e.$on("$destroy",n)}}).directive(s,["$parse",function(i){var r=U.ng.getDDO(i,s,{preset:"image"});return r.link=void 0,r.compile=function(r){var o,l,c=""+a++,d=t(r[0]);return d.find("li").each(function(){for(l=0;l<n.length;l++)if(t(this).attr(n[l]))return o=!0,!1}),o&&d.children().attr("mobiscroll-repeat-render",c),function(n,a,r,l){var d,u,m=t(a[0]),h=U.ng.getOpt(n,r,s,l);e.extend(h,{preset:"image"}),U.ng.addWatch(i,n,l,m,r,s),o?n.$on("mbscRepeatRender"+c,function(){clearTimeout(u),u=setTimeout(function(){d=new U.classes.Scroller(a[0],h),r.mobiscrollInstance&&i(r.mobiscrollInstance).assign(n,d)},1)}):m.children().length&&(d=new U.classes.Scroller(a[0],h),r.mobiscrollInstance&&i(r.mobiscrollInstance).assign(n,d))}},r}])}(),U.presets.scroller.treelist=U.presets.scroller.list,U.presetShort("list"),U.presetShort("treelist"),function(){var t=U.$,s="mobiscrollList",n=["ng-repeat","ng:repeat","data-ng-repeat","x-ng-repeat","ng_repeat"];e.module("mobiscroll-list",[]).directive("mobiscrollRepeatRender",function(){return function(e){e.$emit("mbscRepeatRender")}}).directive(s,["$parse",function(a){var i=U.ng.getDDO(a,s,{preset:"list"});return i.link=void 0,i.compile=function(i){var r,o,l=t(i[0]);return l.find("li").each(function(){for(o=0;o<n.length;o++)if(t(this).attr(n[o]))return r=!0,!1}),r&&l.children().attr("mobiscroll-repeat-render",""),function(n,i,o,l){var c,d,u=t(i[0]),m=U.ng.getOpt(n,o,s,l);e.extend(m,{preset:"treelist"}),U.ng.addWatch(a,n,l,u,o,s),r?n.$on("mbscRepeatRender",function(){clearTimeout(d),d=setTimeout(function(){c=new U.classes.Scroller(i[0],m),o.mobiscrollInstance&&a(o.mobiscrollInstance).assign(n,c)},1)}):u.children().length&&(c=new U.classes.Scroller(i[0],m),o.mobiscrollInstance&&a(o.mobiscrollInstance).assign(n,c))}},i}])}();var Ot=U.$,It=U.presets.scroller,Lt=U.classes,Et=U.util,Nt=Et.datetime.adjustedDate,Ht=Et.jsPrefix,Yt=Et.testTouch,Ft=Et.getCoord,Pt=Et.animEnd,Wt=new Date,Rt={min:new Date(Wt.getFullYear()-100,0,1),max:new Date(Wt.getFullYear()+1,11,31,23,59,59),controls:["calendar"],firstDay:0,weekDays:"short",maxMonthWidth:170,months:1,preMonths:1,highlight:!0,outerMonthChange:!0,quickNav:!0,yearChange:!0,todayClass:"mbsc-cal-today",btnCalPrevClass:"mbsc-ic mbsc-ic-arrow-left6",btnCalNextClass:"mbsc-ic mbsc-ic-arrow-right6",dateText:"Date",timeText:"Time",calendarText:"Calendar",todayText:"Today",prevMonthText:"Previous Month",nextMonthText:"Next Month",prevYearText:"Previous Year",nextYearText:"Next Year"};It.calbase=function(e){function t(e){var t;_e=Ot(this),Ce=!1,"keydown"!=e.type?(xe=Ft(e,"X"),we=Ft(e,"Y"),t=Yt(e,this)):t=32===e.keyCode,Te||!t||_e.hasClass("mbsc-fr-btn-d")||(Te=!0,setTimeout(a,100),"mousedown"==e.type&&Ot(document).on("mousemove",s).on("mouseup",n))}function s(e){(Math.abs(xe-Ft(e,"X"))>7||Math.abs(we-Ft(e,"Y"))>7)&&(Te=!1,_e.removeClass("mbsc-fr-btn-a"))}function n(e){"touchend"==e.type&&e.preventDefault(),_e&&!Ce&&a(),Te=!1,"mouseup"==e.type&&Ot(document).off("mousemove",s).off("mouseup",n)}function a(){Ce=!0,_e.hasClass("mbsc-cal-prev-m")?C():_e.hasClass("mbsc-cal-next-m")?_():_e.hasClass("mbsc-cal-prev-y")?M(_e):_e.hasClass("mbsc-cal-next-y")&&T(_e)}function i(e){return!(e<Nt(le.getFullYear(),le.getMonth(),le.getDate()))&&(!(e>ce)&&(void 0===ve[e]||void 0!==pe[e]))}function r(e,t,s){var n,a,i,r,o={},l=et+ke;return e&&Ot.each(e,function(e,c){if(n=c.d||c.start||c,a=n+"",c.start&&c.end)for(r=new Date(c.start);r<=c.end;)i=Nt(r.getFullYear(),r.getMonth(),r.getDate()),o[i]=o[i]||[],o[i].push(c),r.setDate(r.getDate()+1);else if(n.getTime)i=Nt(n.getFullYear(),n.getMonth(),n.getDate()),o[i]=o[i]||[],o[i].push(c);else if(a.match(/w/i)){var d=+a.replace("w",""),u=0,m=je.getDate(t,s-et-Se,1).getDay();for(je.firstDay-m+1>1&&(u=7),I=0;I<5*De;I++)i=je.getDate(t,s-et-Se,7*I-u-m+1+d),o[i]=o[i]||[],o[i].push(c)}else if(a=a.split("/"),a[1])s+l>=11&&(i=je.getDate(t+1,a[0]-1,a[1]),o[i]=o[i]||[],o[i].push(c)),s-l<=1&&(i=je.getDate(t-1,a[0]-1,a[1]),o[i]=o[i]||[],o[i].push(c)),i=je.getDate(t,a[0]-1,a[1]),o[i]=o[i]||[],o[i].push(c);else for(I=0;I<De;I++)i=je.getDate(t,s-et-Se+I,a[0]),je.getDay(i)==a[0]&&(o[i]=o[i]||[],o[i].push(c))}),o}function o(t,s){ve=r(je.invalid,t,s),pe=r(je.valid,t,s),e.onGenMonth(t,s)}function l(e,t,s,n,a,i,r){var o='<div class="mbsc-cal-h mbsc-cal-sc-c mbsc-cal-'+e+"-c "+(je.calendarClass||"")+'"><div class="mbsc-cal-sc"><div class="mbsc-cal-sc-p"><div class="mbsc-cal-sc-tbl"><div class="mbsc-cal-sc-row">';for(O=1;O<=t;O++)o+=O<=12||O>s?'<div class="mbsc-cal-sc-m-cell mbsc-cal-sc-cell mbsc-cal-sc-empty"><div class="mbsc-cal-sc-cell-i">&nbsp;</div></div>':'<div tabindex="0" role="button"'+(i?' aria-label="'+i[O-13]+'"':"")+' class="mbsc-fr-btn-e mbsc-fr-btn-nhl mbsc-cal-sc-m-cell mbsc-cal-sc-cell mbsc-cal-'+e+'-s" data-val='+(n+O-13)+'><div class="mbsc-cal-sc-cell-i mbsc-cal-sc-tbl"><div class="mbsc-cal-sc-cell">'+(r?r[O-13]:n+O-13+a)+"</div></div></div>",O<t&&(O%12===0?o+='</div></div></div><div class="mbsc-cal-sc-p" style="'+(Je?"top":Ke?"right":"left")+":"+100*Math.round(O/12)+'%"><div class="mbsc-cal-sc-tbl"><div class="mbsc-cal-sc-row">':O%3===0&&(o+='</div><div class="mbsc-cal-sc-row">'));return o+="</div></div></div></div></div>"}function c(t,s){var n,a,r,o,l,c,d,u,m,h,f,p,v,b,g,y,x=1,w=0,_=je.getDate(t,s,1),C=je.getYear(_),T=je.getMonth(_),M=null!==je.defaultValue||e._hasValue?e.getDate(!0):null,D=je.getDate(C,T,1).getDay(),k='<div class="mbsc-cal-table">',S='<div class="mbsc-cal-week-nr-c">';for(je.firstDay-D+1>1&&(w=7),y=0;y<42;y++)g=y+je.firstDay-w,n=je.getDate(C,T,g-D+1),r=n.getFullYear(),o=n.getMonth(),l=n.getDate(),c=je.getMonth(n),d=je.getDay(n),b=je.getMaxDayOfMonth(r,o),u=r+"-"+o+"-"+l,m=Ot.extend({valid:i(n),selected:M&&M.getFullYear()===r&&M.getMonth()===o&&M.getDate()===l},e.getDayProps(n,M)),h=m.valid,f=m.selected,a=m.cssClass,p=new Date(n).setHours(12,0,0,0)===(new Date).setHours(12,0,0,0),v=c!==T,Pe[u]=m,y%7===0&&(k+=(y?"</div>":"")+'<div class="mbsc-cal-row'+(je.highlight&&M&&M-n>=0&&M-n<6048e5?" mbsc-cal-week-hl":"")+'">'),Xe&&1==n.getDay()&&("month"==Xe&&v&&x>1?x=1==l?1:2:"year"==Xe&&(x=je.getWeekNumber(n)),S+='<div class="mbsc-cal-week-nr"><div class="mbsc-cal-week-nr-i">'+x+"</div></div>",
  x++),k+='<div role="button" tabindex="-1" aria-label="'+(p?je.todayText+", ":"")+je.dayNames[n.getDay()]+", "+je.monthNames[c]+" "+d+" "+(m.ariaLabel?", "+m.ariaLabel:"")+'"'+(v&&!$e?' aria-hidden="true"':"")+(f?' aria-selected="true"':"")+(h?"":' aria-disabled="true"')+' data-day="'+g%7+'" data-full="'+u+'"class="mbsc-cal-day '+(je.dayClass||"")+(f?" mbsc-cal-day-sel":"")+(p?" "+je.todayClass:"")+(a?" "+a:"")+(1==d?" mbsc-cal-day-first":"")+(d==b?" mbsc-cal-day-last":"")+(v?" mbsc-cal-day-diff":"")+(h?" mbsc-cal-day-v mbsc-fr-btn-e mbsc-fr-btn-nhl":" mbsc-cal-day-inv")+'"><div class="mbsc-cal-day-i '+(f?rt:"")+" "+(je.innerDayClass||"")+'"><div class="mbsc-cal-day-fg">'+d+"</div>"+(m.markup||"")+'<div class="mbsc-cal-day-frame"></div></div></div>';return k+="</div></div>"+S+"</div>"}function d(e,t,s){var n=je.getDate(e,t,1),a=je.getYear(n),i=je.getMonth(n),r=a+it;if(Qe){if(Ie&&Ie.removeClass("mbsc-cal-sc-sel").removeAttr("aria-selected").find(".mbsc-cal-sc-cell-i").removeClass(rt),Le&&Le.removeClass("mbsc-cal-sc-sel").removeAttr("aria-selected").find(".mbsc-cal-sc-cell-i").removeClass(rt),Ie=Ot('.mbsc-cal-year-s[data-val="'+a+'"]',N).addClass("mbsc-cal-sc-sel").attr("aria-selected","true"),Le=Ot('.mbsc-cal-month-s[data-val="'+i+'"]',N).addClass("mbsc-cal-sc-sel").attr("aria-selected","true"),Ie.find(".mbsc-cal-sc-cell-i").addClass(rt),Le.find(".mbsc-cal-sc-cell-i").addClass(rt),Oe&&Oe.scroll(Ie,s),Ot(".mbsc-cal-month-s",N).removeClass("mbsc-fr-btn-d"),a===se)for(O=0;O<ae;O++)Ot('.mbsc-cal-month-s[data-val="'+O+'"]',N).addClass("mbsc-fr-btn-d");if(a===ne)for(O=ie+1;O<=12;O++)Ot('.mbsc-cal-month-s[data-val="'+O+'"]',N).addClass("mbsc-fr-btn-d")}for(1==ee.length&&ee.attr("aria-label",a).html(r),O=0;O<Me;++O)n=je.getDate(e,t-Se+O,1),a=je.getYear(n),i=je.getMonth(n),r=a+it,Ot(J[O]).attr("aria-label",je.monthNames[i]+(tt?"":" "+a)).html((!tt&&te<Q?r+" ":"")+K[i]+(!tt&&te>Q?" "+r:"")),ee.length>1&&Ot(ee[O]).html(r);je.getDate(e,t-Se-1,1)<re?m(Ot(".mbsc-cal-prev-m",N)):u(Ot(".mbsc-cal-prev-m",N)),je.getDate(e,t+Me-Se,1)>oe?m(Ot(".mbsc-cal-next-m",N)):u(Ot(".mbsc-cal-next-m",N)),je.getDate(e,t,1).getFullYear()<=re.getFullYear()?m(Ot(".mbsc-cal-prev-y",N)):u(Ot(".mbsc-cal-prev-y",N)),je.getDate(e,t,1).getFullYear()>=oe.getFullYear()?m(Ot(".mbsc-cal-next-y",N)):u(Ot(".mbsc-cal-next-y",N))}function u(e){e.removeClass(ct).find(".mbsc-cal-btn-txt").removeAttr("aria-disabled")}function m(e){e.addClass(ct).find(".mbsc-cal-btn-txt").attr("aria-disabled","true")}function h(t){e.trigger("onDayHighlight",{date:t}),je.highlight&&(Ot(".mbsc-cal-day-sel .mbsc-cal-day-i",Y).removeClass(rt),Ot(".mbsc-cal-day-sel",Y).removeClass("mbsc-cal-day-sel").removeAttr("aria-selected"),Ot(".mbsc-cal-week-hl",Y).removeClass("mbsc-cal-week-hl"),(null!==je.defaultValue||e._hasValue)&&Ot('.mbsc-cal-day[data-full="'+t.getFullYear()+"-"+t.getMonth()+"-"+t.getDate()+'"]',Y).addClass("mbsc-cal-day-sel").attr("aria-selected","true").find(".mbsc-cal-day-i").addClass(rt).closest(".mbsc-cal-row").addClass("mbsc-cal-week-hl"))}function f(t,s){if(j&&("calendar"===ge||s)){var n,a,i=je.getDate(ue,me,1),r=Math.abs(12*(je.getYear(t)-je.getYear(i))+je.getMonth(t)-je.getMonth(i));e.needsSlide&&r&&(ue=je.getYear(t),me=je.getMonth(t),t>i?(a=r>et-Se+Me-1,me-=a?0:r-et,n="next"):t<i&&(a=r>et+Se,me+=a?0:r-et,n="prev"),g(ue,me,n,Math.min(r,et),a,!0)),s||(de=t,h(t)),e.needsSlide=!0}}function p(t,s,n){for(n||e.trigger("onMonthLoading",{year:t,month:s}),o(t,s),O=0;O<De;O++)He[O].html(c(t,s-Se-et+O));b(),Ve=void 0,e.trigger("onMonthLoaded",{year:t,month:s})}function v(e,t){for(var s=et,n=et;n&&je.getDate(e,t+n+Me-Se-1,1)>oe;)n--;for(;s&&je.getDate(e,t-s-Se,1)<re;)s--;Ot.extend(G.settings,{contSize:Me*P,snap:P,minScroll:W-(Ke?s:n)*P,maxScroll:W+(Ke?n:s)*P}),G.refresh()}function b(){Xe&&B.html(Ot(".mbsc-cal-week-nr-c",He[et]).html()),Ot(".mbsc-cal-slide-a .mbsc-cal-day",F).attr("tabindex",0)}function g(t,s,n,a,i,r,l){if(t&&Ye.push({y:t,m:s,dir:n,slideNr:a,load:i,active:r,callback:l}),!ye){var u,m=Ye.shift();if(t=m.y,s=m.m,n="next"===m.dir,a=m.slideNr,i=m.load,r=m.active,l=m.callback||We,u=je.getDate(t,s,1),t=je.getYear(u),s=je.getMonth(u),ye=!0,e.changing=!0,e.trigger("onMonthChange",{year:t,month:s}),e.trigger("onMonthLoading",{year:t,month:s}),o(t,s),i)for(O=0;O<Me;O++)He[n?De-Me+O:O].html(c(t,s-Se+O));r&&Ne.addClass("mbsc-cal-slide-a"),setTimeout(function(){e.ariaMessage(je.monthNames[s]+" "+t),d(t,s,200),W=n?W-P*a*Ge:W+P*a*Ge,G.scroll(W,r?200:0,!1,function(){var r;if(He.length){if(Ne.removeClass("mbsc-cal-slide-a").attr("aria-hidden","true"),n)for(r=He.splice(0,a),O=0;O<a;O++)He.push(r[O]),x(He[He.length-1],+He[He.length-2].attr("data-curr")+100*Ge);else for(r=He.splice(De-a,a),O=a-1;O>=0;O--)He.unshift(r[O]),x(He[0],+He[1].attr("data-curr")-100*Ge);for(O=0;O<a;O++)He[n?De-a+O:O].html(c(t,s-Se-et+O+(n?De-a:0))),i&&He[n?O:De-a+O].html(c(t,s-Se-et+O+(n?0:De-a)));for(O=0;O<Me;O++)He[et+O].addClass("mbsc-cal-slide-a").removeAttr("aria-hidden");v(t,s),ye=!1}Ye.length?setTimeout(function(){g()},10):(ue=t,me=s,e.changing=!1,Ot(".mbsc-cal-day",F).attr("tabindex",-1),b(),void 0!==Ve?p(t,s,Ve):e.trigger("onMonthLoaded",{year:t,month:s}),l())})},10)}}function y(){var t=Ot(this),s=e.live,n=e.getDate(!0),a=t.attr("data-full"),i=a.split("-"),r=Nt(i[0],i[1],i[2]),o=Nt(r.getFullYear(),r.getMonth(),r.getDate(),n.getHours(),n.getMinutes(),n.getSeconds()),l=t.hasClass("mbsc-cal-day-sel");!$e&&t.hasClass("mbsc-cal-day-diff")||e.trigger("onDayChange",Ot.extend(Pe[a],{date:o,target:this,selected:l}))!==!1&&(e.needsSlide=!1,R=!0,e.setDate(o,s,.2,!s,!0),je.outerMonthChange&&(Te=!0,r<je.getDate(ue,me-Se,1)?C():r>je.getDate(ue,me-Se+Me,0)&&_(),Te=!1),e.live&&e.trigger("onSet",{valueText:e._value}))}function x(e,t){e.attr("data-curr",t),e[0].style[Ht+"Transform"]="translate3d("+(Je?"0,"+t+"%,":t+"%,0,")+"0)"}function w(t){e.isVisible()&&j&&(e.changing?Ve=t:p(ue,me,t))}function _(){Te&&je.getDate(ue,me+Me-Se,1)<=oe&&g(ue,++me,"next",1,!1,!0,_)}function C(){Te&&je.getDate(ue,me-Se-1,1)>=re&&g(ue,--me,"prev",1,!1,!0,C)}function T(e){Te&&je.getDate(ue,me,1)<=je.getDate(je.getYear(oe)-1,je.getMonth(oe)-ke,1)?g(++ue,me,"next",et,!0,!0,function(){T(e)}):Te&&!e.hasClass("mbsc-fr-btn-d")&&g(je.getYear(oe),je.getMonth(oe)-ke,"next",et,!0,!0)}function M(e){Te&&je.getDate(ue,me,1)>=je.getDate(je.getYear(re)+1,je.getMonth(re)+Se,1)?g(--ue,me,"prev",et,!0,!0,function(){M(e)}):Te&&!e.hasClass("mbsc-fr-btn-d")&&g(je.getYear(re),je.getMonth(re)+Se,"prev",et,!0,!0)}function D(t,s){t.hasClass("mbsc-cal-v")||(t.addClass("mbsc-cal-v"+(s?"":" mbsc-cal-p-in")).removeClass("mbsc-cal-p-out mbsc-cal-h"),e.trigger("onSelectShow"))}function k(e,t){e.hasClass("mbsc-cal-v")&&e.removeClass("mbsc-cal-v mbsc-cal-p-in").addClass("mbsc-cal-h"+(t?"":" mbsc-cal-p-out"))}function S(e,t){(t||e).hasClass("mbsc-cal-v")?k(e):D(e)}function V(){Ot(this).removeClass("mbsc-cal-p-out mbsc-cal-p-in")}function $(e){return e[0].innerWidth||e.innerWidth()}var A,O,I,L,E,N,H,Y,F,P,W,R,j,q,X,B,U,z,K,G,Z,J,Q,ee,te,se,ne,ae,ie,re,oe,le,ce,de,ue,me,he,fe,pe,ve,be,ge,ye,xe,we,_e,Ce,Te,Me,De,ke,Se,Ve,$e,Ae,Oe,Ie,Le,Ee=this,Ne=[],He=[],Ye=[],Fe={},Pe={},We=function(){},Re=Ot.extend({},e.settings),je=Ot.extend(e.settings,Rt,Re),qe="full"==je.weekDays?"":"min"==je.weekDays?"Min":"Short",Xe=je.weekCounter,Be=je.layout||(/top|bottom|inline/.test(je.display)?"liquid":""),Ue="liquid"==Be&&"bubble"!==je.display,ze="center"==je.display,Ke=je.rtl,Ge=Ke?-1:1,Ze=Ue?null:je.calendarWidth,Je="vertical"==je.calendarScroll,Qe=je.quickNav,et=je.preMonths,tt=je.yearChange,st=je.controls.join(","),nt=(je.tabs===!0||je.tabs!==!1&&Ue)&&je.controls.length>1,at=!nt&&void 0===je.tabs&&!Ue&&je.controls.length>1,it=je.yearSuffix||"",rt=je.activeClass||"",ot="mbsc-cal-tab-sel "+(je.activeTabClass||""),lt=je.activeTabInnerClass||"",ct="mbsc-fr-btn-d "+(je.disabledClass||""),dt="",ut="";return st.match(/calendar/)?j=!0:Qe=!1,st.match(/date/)&&(Fe.date=1),st.match(/time/)&&(Fe.time=1),j&&Fe.date&&(nt=!0,at=!1),je.layout=Be,je.preset=(Fe.date||j?"date":"")+(Fe.time?"time":""),"inline"==je.display&&Ot(this).closest('[data-role="page"]').on("pageshow",function(){e.position()}),e.changing=!1,e.needsSlide=!0,e.getDayProps=We,e.onGenMonth=We,e.prepareObj=r,e.refresh=function(){w(!1)},e.redraw=function(){w(!0)},e.navigate=function(t,s){var n,a,i=e.isVisible();s&&i?f(t,!0):(n=je.getYear(t),a=je.getMonth(t),!i||n==ue&&a==me||(e.trigger("onMonthChange",{year:n,month:a}),d(n,a),p(n,a),v(t.getFullYear(),t.getMonth())),ue=n,me=a)},e.showMonthView=function(){Qe&&!z&&(k(ut,!0),k(dt,!0),D(U,!0),z=!0)},e.changeTab=function(t){e._isVisible&&Fe[t]&&ge!=t&&(ge=t,Ot(".mbsc-cal-pnl",N).removeClass("mbsc-cal-p-in").addClass("mbsc-cal-pnl-h"),Ot(".mbsc-cal-tab",N).removeClass(ot).removeAttr("aria-selected").find(".mbsc-cal-tab-i").removeClass(lt),Ot('.mbsc-cal-tab[data-control="'+t+'"]',N).addClass(ot).attr("aria-selected","true").find(".mbsc-cal-tab-i").addClass(lt),Fe[ge].removeClass("mbsc-cal-pnl-h").addClass("mbsc-cal-p-in"),"calendar"==ge&&(A=e.getDate(!0),A.getFullYear()===de.getFullYear()&&A.getMonth()===de.getMonth()&&A.getDate()===de.getDate()||f(A)),e.showMonthView(),e.trigger("onTabChange",{tab:ge}))},L=It.datetime.call(this,e),Q=(je.dateWheels||je.dateFormat).search(/m/i),te=(je.dateWheels||je.dateFormat).search(/y/i),Ot.extend(L,{ariaMessage:je.calendarText,onMarkupReady:function(a){var i,r,o="";if(N=Ot(a.target),H="inline"==je.display?Ot(this).is("div")?Ot(this):Ot(this).parent():e._window,de=e.getDate(!0),ue||(ue=je.getYear(de),me=je.getMonth(de)),W=0,X=!0,ye=!1,K=je.monthNames,ge="calendar",je.min&&(re=Nt(je.min.getFullYear(),je.min.getMonth(),1),le=je.min),je.max&&(oe=Nt(je.max.getFullYear(),je.max.getMonth(),1),ce=je.max),N.addClass("mbsc-calendar"),E=Ot(".mbsc-fr-popup",N),be=Ot(".mbsc-fr-c",N),Fe.date?Fe.date=Ot(".mbsc-sc-whl-gr-c",N).eq(0):j&&Ot(".mbsc-sc-whl-gr-c",N).eq(0).addClass("mbsc-cal-hdn"),Fe.time&&(Fe.time=Ot(".mbsc-sc-whl-gr-c",N).eq(1)),j){for(Me="auto"==je.months?Math.max(1,Math.min(3,Math.floor((Ze||$(H))/280))):je.months,De=Me+2*et,ke=Math.floor(Me/2),Se=Math.round(Me/2)-1,$e=void 0===je.showOuterDays?Me<2:je.showOuterDays,Je=Je&&Me<2,r='<div class="mbsc-cal-btnw"><div class="'+(Ke?"mbsc-cal-next-m":"mbsc-cal-prev-m")+' mbsc-cal-prev mbsc-cal-btn mbsc-fr-btn mbsc-fr-btn-e"><div role="button" tabindex="0" class="mbsc-cal-btn-txt '+(je.btnCalPrevClass||"")+'" aria-label="'+je.prevMonthText+'"></div></div>',O=0;O<Me;++O)r+='<div class="mbsc-cal-btnw-m" style="width: '+100/Me+'%"><span role="button" class="mbsc-cal-month"></span></div>';for(r+='<div class="'+(Ke?"mbsc-cal-prev-m":"mbsc-cal-next-m")+' mbsc-cal-next mbsc-cal-btn mbsc-fr-btn mbsc-fr-btn-e"><div role="button" tabindex="0" class="mbsc-cal-btn-txt '+(je.btnCalNextClass||"")+'" aria-label="'+je.nextMonthText+'"></div></div></div>',tt&&(o='<div class="mbsc-cal-btnw"><div class="'+(Ke?"mbsc-cal-next-y":"mbsc-cal-prev-y")+' mbsc-cal-prev mbsc-cal-btn mbsc-fr-btn mbsc-fr-btn-e"><div role="button" tabindex="0" class="mbsc-cal-btn-txt '+(je.btnCalPrevClass||"")+'" aria-label="'+je.prevYearText+'"></div></div><span role="button" class="mbsc-cal-year"></span><div class="'+(Ke?"mbsc-cal-prev-y":"mbsc-cal-next-y")+' mbsc-cal-next mbsc-cal-btn mbsc-fr-btn mbsc-fr-btn-e"><div role="button" tabindex="0" class="mbsc-cal-btn-txt '+(je.btnCalNextClass||"")+'" aria-label="'+je.nextYearText+'"></div></div></div>'),Qe&&(se=je.getYear(re),ne=je.getYear(oe),ae=je.getMonth(re),ie=je.getMonth(oe),fe=Math.ceil((ne-se+1)/12)+2,dt=l("month",36,24,0,"",je.monthNames,je.monthNamesShort),ut=l("year",12*fe,ne-se+13,se,it)),q='<div class="mbsc-w-p mbsc-cal-c"><div class="mbsc-cal mbsc-cal-hl-now '+(Me>1?" mbsc-cal-multi ":"")+(Xe?" mbsc-cal-weeks ":"")+(Je?" mbsc-cal-vertical":"")+($e?"":" mbsc-cal-hide-diff ")+(je.calendarClass||"")+'"><div class="mbsc-cal-header"><div class="mbsc-cal-btnc '+(tt?"mbsc-cal-btnc-ym":"mbsc-cal-btnc-m")+'">'+(te<Q||Me>1?o+r:r+o)+'</div></div><div class="mbsc-cal-body"><div class="mbsc-cal-m-c mbsc-cal-v"><div class="mbsc-cal-days-c">',I=0;I<Me;++I){for(q+='<div aria-hidden="true" class="mbsc-cal-days" style="width: '+100/Me+'%"><table cellpadding="0" cellspacing="0"><tr>',O=0;O<7;O++)q+="<th>"+je["dayNames"+qe][(O+je.firstDay)%7]+"</th>";q+="</tr></table></div>"}for(q+='</div><div class="mbsc-cal-week-nrs-c '+(je.weekNrClass||"")+'"><div class="mbsc-cal-week-nrs"></div></div><div class="mbsc-cal-anim-c '+(je.calendarClass||"")+'"><div class="mbsc-cal-anim">',O=0;O<Me+2*et;O++)q+='<div class="mbsc-cal-slide" aria-hidden="true"></div>';q+="</div></div></div>"+dt+ut+"</div></div></div>",Fe.calendar=Ot(q)}if(Ot.each(je.controls,function(e,t){Fe[t]=Ot('<div class="mbsc-cal-pnl" id="'+(Ee.id+"_dw_pnl_"+e)+'"></div>').append(Ot('<div class="mbsc-cal-pnl-i"></div>').append(Fe[t])).appendTo(be)}),i='<div class="mbsc-cal-tabs"><ul role="tablist">',Ot.each(je.controls,function(e,t){Fe[t]&&(i+='<li role="tab" aria-controls="'+(Ee.id+"_dw_pnl_"+e)+'" class="mbsc-cal-tab '+(e?"":ot)+'" data-control="'+t+'"><a href="#" class="mbsc-fr-btn-e mbsc-fr-btn-nhl mbsc-cal-tab-i '+(e?"":lt)+'">'+je[t+"Text"]+"</a></li>")}),i+="</ul></div>",be.before(i),Y=Ot(".mbsc-cal-anim-c",N),F=Ot(".mbsc-cal-anim",Y),B=Ot(".mbsc-cal-week-nrs",N),j){for(z=!0,Ne=Ot(".mbsc-cal-slide",F).each(function(e,t){He.push(Ot(t))}),Ne.slice(et,et+Me).addClass("mbsc-cal-slide-a").removeAttr("aria-hidden"),O=0;O<De;O++)x(He[O],100*(O-et)*Ge);p(ue,me),G=new Lt.ScrollView(Y[0],{axis:Je?"Y":"X",easing:"",contSize:0,snap:1,maxSnapScroll:et,moveElement:F,mousewheel:je.mousewheel,time:200,lock:!0,stopProp:!1,minScroll:-(1/0),maxScroll:1/0,onAnimationEnd:function(e){var t=Math.round(((Je?e.posY:e.posX)-W)/P)*Ge;t&&g(ue,me-t,t>0?"prev":"next",t>0?t:-t)}})}J=Ot(".mbsc-cal-month",N),ee=Ot(".mbsc-cal-year",N),U=Ot(".mbsc-cal-m-c",N),Qe&&(U.on(Pt,V),dt=Ot(".mbsc-cal-month-c",N).on(Pt,V),ut=Ot(".mbsc-cal-year-c",N).on(Pt,V),Ae=Ot(".mbsc-cal-sc-p",N),he={axis:Je?"Y":"X",contSize:0,snap:1,maxSnapScroll:1,rtl:je.rtl,mousewheel:je.mousewheel,time:200,stopProp:!1,minScroll:-(1/0),maxScroll:1/0},Oe=new Lt.ScrollView(ut[0],he),Z=new Lt.ScrollView(dt[0],he)),Ue?N.addClass("mbsc-cal-liq"):Ot(".mbsc-cal",N).width(Ze||280*Me),je.calendarHeight&&Ot(".mbsc-cal-anim-c",N).height(je.calendarHeight),e.tap(Y,function(e){var t=Ot(e.target);ye||G.scrolled||je.readonly===!0||(t=t.closest(".mbsc-cal-day",this),t.hasClass("mbsc-cal-day-v")&&y.call(t[0]))}),Ot(".mbsc-cal-btn",N).on("touchstart mousedown keydown",t).on("touchmove",s).on("touchend touchcancel keyup",n),Ot(".mbsc-cal-tab",N).on("touchstart click",function(t){Yt(t,this)&&e.changeTab(Ot(this).attr("data-control"))}),Qe&&(e.tap(Ot(".mbsc-cal-month",N),function(){ut.hasClass("mbsc-cal-v")||(S(U),z=U.hasClass("mbsc-cal-v")),S(dt),k(ut)}),e.tap(Ot(".mbsc-cal-year",N),function(){ut.hasClass("mbsc-cal-v")||Oe.scroll(Ie),dt.hasClass("mbsc-cal-v")||(S(U),z=U.hasClass("mbsc-cal-v")),S(ut),k(dt)}),e.tap(Ot(".mbsc-cal-month-s",N),function(){Z.scrolled||Ot(this).hasClass("mbsc-fr-btn-d")||e.navigate(je.getDate(ue,Ot(this).attr("data-val"),1))}),e.tap(Ot(".mbsc-cal-year-s",N),function(){Oe.scrolled||(A=je.getDate(Ot(this).attr("data-val"),me,1),e.navigate(new Date(Et.constrain(A,re,oe))))}),e.tap(ut,function(){Oe.scrolled||(k(ut),D(U),z=!0)}),e.tap(dt,function(){Z.scrolled||(k(dt),D(U),z=!0)}))},onShow:function(){j&&d(ue,me)},onPosition:function(t){var s,n,a,i,r,o,l=0,c=0,d=0,u=t.windowHeight;if(Ue&&(ze&&Y.height(""),be.height(""),F.width("")),P&&(r=P),j&&(P=Math.round(Math.round(Y[0][Je?"offsetHeight":"offsetWidth"])/Me)),P&&(N.removeClass("mbsc-cal-m mbsc-cal-l"),P>1024?N.addClass("mbsc-cal-l"):P>640&&N.addClass("mbsc-cal-m")),(nt&&(X||Ue)||at)&&(Ot(".mbsc-cal-pnl",N).removeClass("mbsc-cal-pnl-h"),Ot.each(Fe,function(e,t){s=t[0].offsetWidth,l=Math.max(l,s),c=Math.max(c,t[0].offsetHeight),d+=s}),nt||at&&d>$(H)?(n=!0,ge=Ot(".mbsc-cal-tabs .mbsc-cal-tab-sel",N).attr("data-control"),E.addClass("mbsc-cal-tabbed")):(ge="calendar",l="",c="",E.removeClass("mbsc-cal-tabbed"),be.css({width:"",height:""}))),Ue&&ze&&j&&(e._isFullScreen=!0,n&&be.height(Fe.calendar[0].offsetHeight),i=E[0].offsetHeight,u>=i&&Y.height(u-i+Y[0].offsetHeight),c=Math.max(c,Fe.calendar[0].offsetHeight)),n&&(be.css({width:Ue?"":l,height:c}),j&&(P=Math.round(Math.round(Y[0][Je?"offsetHeight":"offsetWidth"])/Me))),P){if(F[Je?"height":"width"](P),P!==r){if(tt)for(K=je.maxMonthWidth>Ot(".mbsc-cal-btnw-m",N).width()?je.monthNamesShort:je.monthNames,O=0;O<Me;++O)Ot(J[O]).text(K[je.getMonth(je.getDate(ue,me-Se+O,1))]);Qe&&(o=ut[0][Je?"offsetHeight":"offsetWidth"],Ot.extend(Oe.settings,{contSize:o,snap:o,minScroll:(2-fe)*o,maxScroll:-o}),Ot.extend(Z.settings,{contSize:o,snap:o,minScroll:-o,maxScroll:-o}),Oe.refresh(),Z.refresh(),ut.hasClass("mbsc-cal-v")&&Oe.scroll(Ie)),Ue&&!X&&r&&(a=W/r,W=a*P),v(ue,me)}}else P=r;n&&(Ot(".mbsc-cal-pnl",N).addClass("mbsc-cal-pnl-h"),Fe[ge].removeClass("mbsc-cal-pnl-h")),e.trigger("onCalResize"),X=!1},onHide:function(){Ye=[],He=[],ge=null,ue=null,me=null,ye=!0,P=0,G&&G.destroy(),Qe&&Oe&&Z&&(Oe.destroy(),Z.destroy())},onValidated:function(t){var s,n,a;if(n=e.getDate(!0),R)s="calendar";else for(a in e.order)a&&e.order[a]===t&&(s=/[mdy]/.test(a)?"date":"time");e.trigger("onSetDate",{date:n,control:s}),f(n),R=!1}}),L};var jt=U.$,qt=jt.extend,Xt=U.util,Bt=Xt.datetime,Ut=Bt.adjustedDate,zt=U.presets.scroller,Kt={};U.presetShort("calendar"),zt.calendar=function(e){function t(e){if(e){if(m[e])return m[e];var t=jt('<div style="background-color:'+e+';"></div>').appendTo("body"),s=window.getComputedStyle?getComputedStyle(t[0]):t[0].style,n=s.backgroundColor.replace(/rgb|rgba|\(|\)|\s/g,"").split(","),a=.299*n[0]+.587*n[1]+.114*n[2],i=a>130?"#000":"#fff";return t.remove(),m[e]=i,i}}function s(e){return Ut(e.getFullYear(),e.getMonth(),e.getDate())}function n(e){if(y={},e&&e.length)for(l=0;l<e.length;l++)y[s(e[l])]=e[l]}function a(){e.refresh()}var i,r,o,l,c,d,u,m={},h=qt({},e.settings),f=qt(e.settings,Kt,h),p=f.activeClass||"",v="multiple"==f.select||f.select>1||"week"==f.selectType,b=Xt.isNumeric(f.select)?f.select:1/0,g=!!f.events,y={};if(u=zt.calbase.call(this,e),i=qt({},u),o=void 0===f.firstSelectDay?f.firstDay:f.firstSelectDay,v&&f.defaultValue&&f.defaultValue.length)for(l=0;l<f.defaultValue.length;l++)y[s(f.defaultValue[l])]=f.defaultValue[l];return e.onGenMonth=function(t,s){c=e.prepareObj(f.events||f.marked,t,s)},e.getDayProps=function(e){var s,n=v?void 0!==y[e]:void 0,a=!!c[e]&&c[e],i=a&&a[0]&&a[0].text,r=a&&a[0]&&a[0].color,o=g&&i?t(r):"",l="",d="";if(a){for(s=0;s<a.length;s++)a[s].icon&&(l+='<span class="mbsc-ic mbsc-ic-'+a[s].icon+'"'+(a[s].text?"":a[s].color?' style="color:'+a[s].color+';"':"")+"></span>\n");for(d='<div class="mbsc-cal-day-m"><div class="mbsc-cal-day-m-t">',s=0;s<a.length;s++)d+='<div class="mbsc-cal-day-m-c"'+(a[s].color?' style="background:'+a[s].color+';"':"")+"></div>";d+="</div></div>"}return{marked:a,selected:n,cssClass:a?"mbsc-cal-day-marked":"",ariaLabel:g?i:"",markup:g&&i?'<div class="mbsc-cal-day-txt-c"><div class="mbsc-cal-day-txt" title="'+jt("<div>"+i+"</div>").text()+'"'+(r?' style="background:'+r+";color:"+o+';text-shadow:none;"':"")+">"+l+i+"</div></div>":g&&l?'<div class="mbsc-cal-day-ic-c">'+l+"</div>":a?d:""}},e.addValue=function(e){y[s(e)]=e,a()},e.removeValue=function(e){delete y[s(e)],a()},e.setVal=function(t,s,i,r,o){v&&(n(t),t=t?t[0]:null),e._setVal(t,s,i,r,o),a()},e.getVal=function(t){return v?Xt.objectToArray(y):e.getDate(t)},qt(u,{highlight:!v,outerMonthChange:!v,parseValue:function(t){var n,a;if(v&&t&&"string"==typeof t){for(y={},t=t.split(","),n=0;n<t.length;n++)a=Bt.parseDate(e.format,t[n].replace(/^\s+|\s+$/g,""),f),y[s(a)]=a;t=t[0]}return v&&f.defaultValue&&f.defaultValue.length&&(f.defaultValue=f.defaultValue[0]),i.parseValue.call(this,t)},formatValue:function(t){var s,n=[];if(v){for(s in y)n.push(Bt.formatDate(e.format,y[s],f));return n.join(", ")}return i.formatValue.call(this,t)},onClear:function(){v&&(y={},e.refresh())},onBeforeShow:function(){void 0!==f.setOnDayTap||f.buttons&&f.buttons.length||(f.setOnDayTap=!0),f.setOnDayTap&&"inline"!=f.display&&(f.outerMonthChange=!1),f.counter&&v&&(f.headerText=function(){var e=0,t="week"==f.selectType?7:1;return jt.each(y,function(){e++}),e=Math.round(e/t),(e>1?f.selectedPluralText||f.selectedText:f.selectedText).replace(/{count}/,e)})},onMarkupReady:function(e){i.onMarkupReady.call(this,e),r=jt(e.target),v&&(jt(".mbsc-fr-hdr",r).attr("aria-live","off"),d=qt({},y)),g&&jt(".mbsc-cal",r).addClass("mbsc-cal-ev")},onDayChange:function(t){var n=t.date,i=s(n),l=jt(t.target),c=t.selected;if(v)if("week"==f.selectType){var d,u,m=i.getDay()-o;for(m=m<0?7+m:m,"multiple"!=f.select&&(y={}),d=0;d<7;d++)u=Ut(i.getFullYear(),i.getMonth(),i.getDate()-m+d),c?delete y[u]:Xt.objectToArray(y).length/7<b&&(y[u]=u);a()}else{var h=jt('.mbsc-cal .mbsc-cal-day[data-full="'+l.attr("data-full")+'"]',r);c?(h.removeClass("mbsc-cal-day-sel").removeAttr("aria-selected").find(".mbsc-cal-day-i").removeClass(p),delete y[i]):Xt.objectToArray(y).length<b&&(h.addClass("mbsc-cal-day-sel").attr("aria-selected","true").find(".mbsc-cal-day-i").addClass(p),y[i]=i)}if(f.setOnDayTap&&"multiple"!=f.select&&"inline"!=f.display)return e.needsSlide=!1,e.setDate(n),e.select(),!1},onCancel:function(){!e.live&&v&&(y=qt({},d))}}),u},e.module("mobiscroll-calendar",[]).directive("mobiscrollCalendar",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollCalendar",{preset:"calendar"})}]);var Gt=U.$,Zt={wheelOrder:"hhiiss",useShortLabels:!1,min:0,max:1/0,labels:["Years","Months","Days","Hours","Minutes","Seconds"],labelsShort:["Yrs","Mths","Days","Hrs","Mins","Secs"]};U.presetShort("timespan"),U.presets.scroller.timespan=function(e){function t(e){var t={};return Gt(p).each(function(s,n){t[n]=y[n]?Math.floor(e/v[n].limit):0,e-=t[n]*v[n].limit}),t}function s(e){var t=!1,s=g[y[e]-1]||1,a=v[e],i=a.label,o=a.wheel;if(o.data=[],o.label=a.label,h.match(new RegExp(a.re+a.re,"i"))&&(t=!0),e==x)o.min=c[e],o.max=d[e],o.data=function(e){return{value:e*s,display:n(e*s,t,i)}},o.getIndex=function(e){return Math.round(e/s)};else for(r=0;r<=a.until;r+=s)o.data.push({value:r,display:n(r,t,i)})}function n(e,t,s){return(e<10&&t?"0":"")+e+'<span class="mbsc-ts-lbl">'+s+"</span>"}function a(e){var t=0,s=0;return Gt.each(b,function(n,a){isNaN(+e[t])||(s+=v[a.v].limit*e[n])}),s}function i(e,t){return Math.floor(e/t)*t}var r,o,l,c,d,u=Gt.extend({},e.settings),m=Gt.extend(e.settings,Zt,u),h=m.wheelOrder,f=m.useShortLabels?m.labelsShort:m.labels,p=["years","months","days","hours","minutes","seconds"],v={years:{ord:0,index:6,until:10,limit:31536e6,label:f[0],re:"y",wheel:{}},months:{ord:1,index:5,until:11,limit:2592e6,label:f[1],re:"m",wheel:{}},days:{ord:2,index:4,until:31,limit:864e5,label:f[2],re:"d",wheel:{}},hours:{ord:3,index:3,until:23,limit:36e5,label:f[3],re:"h",wheel:{}},minutes:{ord:4,index:2,until:59,limit:6e4,label:f[4],re:"i",wheel:{}},seconds:{ord:5,index:1,until:59,limit:1e3,label:f[5],re:"s",wheel:{}}},b=[],g=m.steps||[],y={},x="seconds",w=m.defaultValue||Math.max(m.min,Math.min(0,m.max)),_=[[]];return Gt(p).each(function(e,t){o=h.search(new RegExp(v[t].re,"i")),o>-1&&(b.push({o:o,v:t}),v[t].index>v[x].index&&(x=t))}),b.sort(function(e,t){return e.o>t.o?1:-1}),Gt.each(b,function(e,t){y[t.v]=e+1,_[0].push(v[t.v].wheel)}),c=t(m.min),d=t(m.max),Gt.each(b,function(e,t){s(t.v)}),e.getVal=function(t,s){return s?e._getVal(t):e._hasValue||t?a(e.getArrayVal(t)):null},{showLabel:!0,wheels:_,compClass:"mbsc-ts",parseValue:function(e){var s,n=[];return U.util.isNumeric(e)||!e?(l=t(e||w),Gt.each(b,function(e,t){n.push(l[t.v])})):Gt.each(b,function(t,a){s=new RegExp("(\\d+)\\s?("+m.labels[v[a.v].ord]+"|"+m.labelsShort[v[a.v].ord]+")","gi").exec(e),n.push(s?s[1]:0)}),Gt(n).each(function(e,t){n[e]=i(t,g[e]||1)}),n},formatValue:function(e){var t="";return Gt.each(b,function(s,n){t+=+e[s]?e[s]+" "+v[n.v].label+" ":""}),t?t.replace(/\s+$/g,""):0},validate:function(s){var n,i,r,o,l=s.values,u=s.direction,m=[],h=!0,f=!0;return Gt(p).each(function(s,p){if(void 0!==y[p]){if(r=y[p]-1,m[r]=[],o={},p!=x){if(h)for(i=d[p]+1;i<=v[p].until;i++)o[i]=!0;if(f)for(i=0;i<c[p];i++)o[i]=!0}l[r]=e.getValidValue(r,l[r],u,o),n=t(a(l)),h=h&&n[p]==d[p],f=f&&n[p]==c[p],Gt.each(o,function(e){m[r].push(e)})}}),{disabled:m}}}},e.module("mobiscroll-timespan",[]).directive("mobiscrollTimespan",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollTimespan",{preset:"timespan"})}]);var Jt=U.$,Qt={autostart:!1,step:1,useShortLabels:!1,labels:["Years","Months","Days","Hours","Minutes","Seconds",""],labelsShort:["Yrs","Mths","Days","Hrs","Mins","Secs",""],startText:"Start",stopText:"Stop",resetText:"Reset",lapText:"Lap",hideText:"Hide"};U.presetShort("timer"),U.presets.scroller.timer=function(e){function t(e){return new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())}function s(e){var s={};if(E&&T[O].index>T.days.index){var n,a,i,r,o=new Date,l=v?o:L,c=v?L:o;for(c=t(c),l=t(l),s.years=l.getFullYear()-c.getFullYear(),s.months=l.getMonth()-c.getMonth(),s.days=l.getDate()-c.getDate(),s.hours=l.getHours()-c.getHours(),s.minutes=l.getMinutes()-c.getMinutes(),s.seconds=l.getSeconds()-c.getSeconds(),s.fract=(l.getMilliseconds()-c.getMilliseconds())/10,n=C.length;n>0;n--)a=C[n-1],i=T[a],r=C[Jt.inArray(a,C)-1],T[r]&&s[a]<0&&(s[r]--,s[a]+="months"==r?32-new Date(l.getFullYear(),l.getMonth(),32).getDate():i.until+1);"months"==O&&(s.months+=12*s.years,delete s.years)}else Jt(C).each(function(t,n){T[n].index<=T[O].index&&(s[n]=Math.floor(e/T[n].limit),e-=s[n]*T[n].limit)});return s}function n(e){var t=1,s=T[e],n=s.wheel,i=s.prefix,r=0,o=s.until,c=T[C[Jt.inArray(e,C)-1]];if(s.index<=T[O].index&&(!c||c.limit>A))if(M[e]||N[0].push(n),M[e]=1,n.data=[],n.label=s.label||"",n.cssClass="mbsc-timer-whl-"+e,A>=s.limit&&(t=Math.max(Math.round(A/s.limit),1),d=t*s.limit),e==O)n.min=0,n.data=function(e){return{value:e,display:a(e,i,s.label)}},n.getIndex=function(e){return e};else for(l=r;l<=o;l+=t)n.data.push({value:l,display:a(l,i,s.label)})}function a(e,t,s){return(t||"")+(e<10?"0":"")+e+'<span class="mbsc-timer-lbl">'+s+"</span>"}function i(e){var t,n=[],a=s(e);return Jt(C).each(function(e,s){M[s]&&(t=Math.max(Math.round(A/T[s].limit),1),n.push(Math.round(a[s]/t)*t))}),n}function r(e){E?(f=L-new Date,f<0?(f*=-1,v=!0):v=!1,p=0,$=!0):void 0!==L?($=!1,f=1e3*L,v="countdown"!=x.mode,e&&(p=0)):(f=0,v="countdown"!=x.mode,$=v,e&&(p=0))}function o(){S?(Jt(".mbsc-fr-w",b).addClass("mbsc-timer-running mbsc-timer-locked"),Jt(".mbsc-timer-btn-toggle-c > div",b).text(x.stopText),e.buttons.start.icon&&Jt(".mbsc-timer-btn-toggle-c > div",b).removeClass("mbsc-ic-"+e.buttons.start.icon),e.buttons.stop.icon&&Jt(".mbsc-timer-btn-toggle-c > div",b).addClass("mbsc-ic-"+e.buttons.stop.icon),"stopwatch"==x.mode&&(Jt(".mbsc-timer-btn-resetlap-c > div",b).text(x.lapText),e.buttons.reset.icon&&Jt(".mbsc-timer-btn-resetlap-c > div",b).removeClass("mbsc-ic-"+e.buttons.reset.icon),e.buttons.lap.icon&&Jt(".mbsc-timer-btn-resetlap-c > div",b).addClass("mbsc-ic-"+e.buttons.lap.icon))):(Jt(".mbsc-fr-w",b).removeClass("mbsc-timer-running"),Jt(".mbsc-timer-btn-toggle-c > div",b).text(x.startText),e.buttons.start.icon&&Jt(".mbsc-timer-btn-toggle-c > div",b).addClass("mbsc-ic-"+e.buttons.start.icon),e.buttons.stop.icon&&Jt(".mbsc-timer-btn-toggle-c > div",b).removeClass("mbsc-ic-"+e.buttons.stop.icon),"stopwatch"==x.mode&&(Jt(".mbsc-timer-btn-resetlap-c > div",b).text(x.resetText),e.buttons.reset.icon&&Jt(".mbsc-timer-btn-resetlap-c > div",b).addClass("mbsc-ic-"+e.buttons.reset.icon),e.buttons.lap.icon&&Jt(".mbsc-timer-btn-resetlap-c > div",b).removeClass("mbsc-ic-"+e.buttons.lap.icon)))}var l,c,d,u,m,h,f,p,v,b,g,y=Jt.extend({},e.settings),x=Jt.extend(e.settings,Qt,y),w=x.useShortLabels?x.labelsShort:x.labels,_=["toggle","resetlap"],C=["years","months","days","hours","minutes","seconds","fract"],T={years:{index:6,until:10,limit:31536e6,label:w[0],wheel:{}},months:{index:5,until:11,limit:2592e6,label:w[1],wheel:{}},days:{index:4,until:31,limit:864e5,label:w[2],wheel:{}},hours:{index:3,until:23,limit:36e5,label:w[3],wheel:{}},minutes:{index:2,until:59,limit:6e4,label:w[4],wheel:{}},seconds:{index:1,until:59,limit:1e3,label:w[5],wheel:{}},fract:{index:0,until:99,limit:10,label:w[6],prefix:".",wheel:{}}},M={},D=[],k=0,S=!1,V=!0,$=!1,A=Math.max(10,1e3*x.step),O=x.maxWheel,I="stopwatch"==x.mode||E,L=x.targetTime,E=L&&void 0!==L.getTime,N=[[]];return e.start=function(){if(V&&e.reset(),!S){if(r(),!$&&p>=f)return;S=!0,V=!1,m=new Date,u=p,x.readonly=!0,e.setVal(i(v?p:f-p),!0,!0,!1,100),c=setInterval(function(){p=new Date-m+u,e.setVal(i(v?p:f-p),!0,!0,!1,Math.min(100,d-10)),!$&&p+d>=f&&(clearInterval(c),setTimeout(function(){e.stop(),p=f,e.setVal(i(v?p:0),!0,!0,!1,100),e.trigger("onFinish",{time:f}),V=!0},f-p))},d),o(),e.trigger("onStart")}},e.stop=function(){S&&(S=!1,clearInterval(c),p=new Date-m+u,o(),e.trigger("onStop",{ellapsed:p}))},e.toggle=function(){S?e.stop():e.start()},e.reset=function(){e.stop(),p=0,D=[],k=0,e.setVal(i(v?0:f),!0,!0,!1,100),e.settings.readonly=I,V=!0,I||Jt(".mbsc-fr-w",b).removeClass("mbsc-timer-locked"),e.trigger("onReset")},e.lap=function(){S&&(h=new Date-m+u,g=h-k,k=h,D.push(h),e.trigger("onLap",{ellapsed:h,lap:g,laps:D}))},e.resetlap=function(){S&&"stopwatch"==x.mode?e.lap():e.reset()},e.getTime=function(){return f},e.setTime=function(e){L=e/1e3,f=e},e.getEllapsedTime=function(){return S?new Date-m+u:0},e.setEllapsedTime=function(t,s){V||(u=p=t,m=new Date,e.setVal(i(v?p:f-p),!0,s,!1,100))},r(!0),O||f||(O="minutes"),"inline"!==x.display&&_.push("hide"),O||Jt(C).each(function(e,t){if(!O&&f>=T[t].limit)return O=t,!1}),Jt(C).each(function(e,t){n(t)}),d=Math.max(87,d),x.autostart&&setTimeout(function(){e.start()},0),e.handlers.toggle=e.toggle,e.handlers.start=e.start,e.handlers.stop=e.stop,e.handlers.resetlap=e.resetlap,e.handlers.reset=e.reset,e.handlers.lap=e.lap,e.buttons.toggle={parentClass:"mbsc-timer-btn-toggle-c",text:x.startText,icon:x.startIcon,handler:"toggle"},e.buttons.start={text:x.startText,icon:x.startIcon,handler:"start"},e.buttons.stop={text:x.stopText,icon:x.stopIcon,handler:"stop"},e.buttons.reset={text:x.resetText,icon:x.resetIcon,handler:"reset"},e.buttons.lap={text:x.lapText,icon:x.lapIcon,handler:"lap"},e.buttons.resetlap={parentClass:"mbsc-timer-btn-resetlap-c",text:x.resetText,icon:x.resetIcon,handler:"resetlap"},e.buttons.hide={parentClass:"mbsc-timer-btn-hide-c",text:x.hideText,icon:x.closeIcon,handler:"cancel"},{wheels:N,headerText:!1,readonly:I,buttons:_,mode:"countdown",compClass:"mbsc-timer",parseValue:function(){return i(v?0:f)},formatValue:function(e){var t="",s=0;return Jt(C).each(function(n,a){"fract"!=a&&M[a]&&(t+=e[s]+("seconds"==a&&M.fract?"."+e[s+1]:"")+" "+w[n]+" ",s++)}),t},validate:function(e){var t=e.values,s=e.index,n=0;V&&void 0!==s&&(L=0,Jt(C).each(function(e,s){M[s]&&(L+=T[s].limit*t[n],n++)}),L/=1e3,r(!0))},onBeforeShow:function(){x.showLabel=!0},onMarkupReady:function(e){b=Jt(e.target),o(),I&&Jt(".mbsc-fr-w",b).addClass("mbsc-timer-locked")},onPosition:function(e){Jt(".mbsc-fr-w",e.target).css("min-width",0).css("min-width",Jt(".mbsc-fr-btn-cont",e.target)[0].offsetWidth)},onDestroy:function(){clearInterval(c)}}},function(){function t(e,t,s,n,a,r){var o=i[s[0].id];o&&(r?r.$setViewValue(o.getEllapsedTime()):e(a[t]).assign(n,o.getEllapsedTime()))}function s(e,t){var s=i[e[0].id];s&&(s.setEllapsedTime(t,!1),a(e[0]).val(s._value))}function n(e){var t=i[e[0].id];if(t)return t.getEllapsedTime()}var a=U.$,i=U.instances;e.module("mobiscroll-timer",[]).directive("mobiscrollTimer",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollTimer",{preset:"timer"},s,t,n)}])}();var es=function(){},ts=U.$,ss=function(e,t,s){var n,a,i,r,o=this;U.classes.Base.call(this,e,t,!0),o.__init=es,o.__destroy=es,o._init=function(t){var s;r=o.settings,n=ts(e),s=!!a,a=o._$parent=s?a:n.parent(),i&&a.removeClass(i),
  i=o._css+" mbsc-progress-w mbsc-control-w mbsc-"+r.theme+(r.baseTheme?" mbsc-"+r.baseTheme:"")+(r.rtl?" mbsc-rtl":" mbsc-ltr"),a.addClass(i),n.addClass("mbsc-control"),o.__init(t),s||o._attachChange(),o.refresh()},o._destroy=function(){o.__destroy(),a.removeClass(i),n.removeClass("mbsc-control")},s||o.init(t)};ss.prototype={_class:"progressbase"};var ns=U.$,as=U.$,is=function(e,t,s){function n(){var e=a("value",m);e!==v&&i(e)}function a(e,t){var s=o.attr(e);return void 0===s||""===s?t:+s}function i(e,t,s,n){e=Math.min(h,Math.max(e,m)),c.css("width",100*(e-m)/(h-m)+"%"),void 0===s&&(s=!0),void 0===n&&(n=s),(e!==v||t)&&y._display(e),e!==v&&(v=e,s&&o.attr("value",v),n&&o.trigger("change"))}var r,o,l,c,d,u,m,h,f,p,v,b,y=this;ss.call(this,e,t,!0),y._display=function(e){b=p&&f.returnAffix?p.replace(/\{value\}/,e).replace(/\{max\}/,h):e,d&&d.html(b),r&&r.html(b)},y._attachChange=function(){o.on("change",n)},y.__init=function(t){var s,n,i,b;if(f=y.settings,o=as(e),b=!!l,l=y._$parent,m=y._min=void 0===t.min?a("min",f.min):t.min,h=y._max=void 0===t.max?a("max",f.max):t.max,v=a("value",m),s=o.attr("data-val")||f.val,i=o.attr("data-step-labels"),i=i?JSON.parse(i):f.stepLabels,p=o.attr("data-template")||(100!=h||f.template?f.template:"{value}%"),b?(s&&(r.remove(),l.removeClass("mbsc-progress-value-"+("right"==s?"right":"left"))),i&&as(".mbsc-progress-step-label",u).remove()):(x(l),g(o),l.find(".mbsc-input-wrap").append('<span class="mbsc-progress-cont"><span class="mbsc-progress-track mbsc-progress-anim"><span class="mbsc-progress-bar"></span></span></span>'),c=y._$progress=l.find(".mbsc-progress-bar"),u=y._$track=l.find(".mbsc-progress-track")),o.attr("min",m).attr("max",h),s&&(r=as('<span class="mbsc-progress-value"></span>'),l.addClass("mbsc-progress-value-"+("right"==s?"right":"left")).find(".mbsc-input-wrap").append(r)),i)for(n=0;n<i.length;++n)u.append('<span class="mbsc-progress-step-label" style="'+(f.rtl?"right":"left")+": "+100*(i[n]-m)/(h-m)+'%" >'+i[n]+"</span>");d=as(o.attr("data-target")||f.target)},y.__destroy=function(){l.find(".mbsc-progress-cont").remove(),l.find(".mbsc-input-wrap").before(o).remove(),o.off("change",n)},y.refresh=function(){i(a("value",m),!0,!1)},y.getVal=function(){return v},y.setVal=function(e,t,s){i(e,!0,t,s)},s||y.init(t)};is.prototype={_class:"progress",_css:"mbsc-progress",_hasTheme:!0,_hasLang:!0,_defaults:{min:0,max:100,returnAffix:!0}},U.classes.Progress=is,U.presetShort("progress","Progress");var rs=function(){},os=U.$,ls=U.util,cs=ls.getCoord,ds=ls.testTouch,us=function(e,t,s){function n(t){!ds(t,this)||C||e.disabled||(Y.stopProp&&t.stopPropagation(),C=!0,E=!1,T=!1,P=cs(t,"X"),W=cs(t,"Y"),S=P,_.removeClass("mbsc-progress-anim"),b=N?os(".mbsc-slider-handle",this):y,g&&g.removeClass("mbsc-handle-curr"),g=b.parent().addClass("mbsc-active mbsc-handle-curr"),$=+b.attr("data-index"),q=_[0].offsetWidth,k=_[0].getBoundingClientRect().left,"mousedown"===t.type&&(t.preventDefault(),os(document).on("mousemove",a).on("mouseup",i)))}function a(e){C&&(S=cs(e,"X"),V=cs(e,"Y"),M=S-P,D=V-W,(Math.abs(M)>5||E)&&(E=!0,Math.abs(U-new Date)>50&&(U=new Date,h(S,Y.round,O))),E?e.preventDefault():Math.abs(D)>7&&m(e))}function i(e){C&&(e.preventDefault(),N||_.addClass("mbsc-progress-anim"),h(S,!0,!0),E||T||("touchend"==e.type&&ls.preventClick(),B._onTap(X[$])),m())}function r(){C&&m()}function o(){var e=B._readValue(os(this)),t=+os(this).attr("data-index");e!==X[t]&&(X[t]=e,p(e,t))}function l(e){e.stopPropagation()}function c(e){e.preventDefault()}function d(t){var s;if(!e.disabled){switch(t.keyCode){case 38:case 39:s=1;break;case 40:case 37:s=-1}s&&(t.preventDefault(),j||($=+os(this).attr("data-index"),p(X[$]+H*s,$,!0),j=setInterval(function(){p(X[$]+H*s,$,!0)},200)))}}function u(e){e.preventDefault(),clearInterval(j),j=null}function m(){C=!1,g.removeClass("mbsc-active"),os(document).off("mousemove",a).off("mouseup",i)}function h(e,t,s){var n=t?Math.min(Math.round(Math.max(100*(e-k)/q,0)/F/H)*H*100/(I-L),100):Math.max(0,Math.min(100*(e-k)/q,100));A&&(n=100-n),p(Math.round((L+n/F)*R)/R,$,s,n)}function f(e){return 100*(e-L)/(I-L)}function p(e,t,s,n,a,i){var r=y.eq(t),o=r.parent();e=Math.min(I,Math.max(e,L)),void 0===i&&(i=s),B._update?B._update(e,X,t,n,N,a,o):o.css({left:A?"auto":(n||f(e))+"%",right:A?(n||f(e))+"%":"auto"}),e>L?o.removeClass("mbsc-slider-start"):(X[t]>L||a)&&o.addClass("mbsc-slider-start"),s&&X[t]!=e&&(T=!0,X[t]=e,B._fillValue(e,t,i)),r.attr("aria-valuenow",e)}var v,b,g,y,x,w,_,C,T,M,D,k,S,V,$,A,O,I,L,E,N,H,Y,F,P,W,R,j,q,X,B=this,U=new Date;ss.call(this,e,t,!0),B._onTap=rs,B.___init=rs,B.___destroy=rs,B._attachChange=function(){v.on(Y.changeEvent,o)},B.__init=function(e){var t;y&&(t=!0,y.parent().remove()),B.___init(e),w=B._$parent,_=B._$track,v=w.find("input"),Y=B.settings,L=B._min,I=B._max,H=B._step,O=B._live,R=H%1!==0?100/(100*+(H%1).toFixed(2)):1,F=100/(I-L)||100,N=v.length>1,A=Y.rtl,X=[],v.each(function(e){X[e]=B._readValue(os(this)),os(this).attr("data-index",e)}),y=w.find(".mbsc-slider-handle"),x=w.find(N?".mbsc-slider-handle-cont":".mbsc-progress-cont"),y.on("keydown",d).on("keyup",u).on("blur",u),x.on("touchstart mousedown",n).on("touchmove",a).on("touchend touchcancel",i).on("pointercancel",r),t||(v.on("click",l),w.on("click",c))},B.__destroy=function(){w.off("click",c),v.off(Y.changeEvent,o).off("click",l),y.off("keydown",d).off("keyup",u).off("blur",u),x.off("touchstart mousedown",n).off("touchmove",a).off("touchend touchcancel",i).off("pointercancel",r),B.___destroy()},B.refresh=function(){v.each(function(e){p(B._readValue(os(this)),e,!0,!1,!0,!1)})},B.getVal=function(){return N?X.slice(0):X[0]},B.setVal=B._setVal=function(e,t,s){os.isArray(e)||(e=[e]),os.each(e,function(e,t){p(t,e,!0,!1,!0,s)})},s||B.init(t)};us.prototype={_class:"sliderbase"};var ms=U.$,hs=function(e,t,s){function n(e){return 100*(e-p)/(f-p)}function a(e,t){var s=i.attr(e);return void 0===s||""===s?t:"true"===s}var i,r,o,l,c,d,u,m,h,f,p,v,b,g=this;is.call(this,e,t,!0);var y=g.__init,x=g.__destroy;us.call(this,e,t,!0);var w=g.__init,_=g.__destroy;g.__init=function(e){y(e),w(e)},g.__destroy=function(){x(),_()},g._update=function(e,t,s,a,i,r,c){m?0===s?(e=Math.min(e,t[1]),o.css({width:n(t[1])-n(e)+"%",left:h?"auto":n(e)+"%",right:h?n(e)+"%":"auto"})):(e=Math.max(e,t[0]),o.css({width:n(e)-n(t[0])+"%"})):i||!d?c.css({left:h?"auto":(a||n(e))+"%",right:h?(a||n(e))+"%":"auto"}):o.css("width",(a||n(e))+"%"),u&&l.eq(s).html(e),i||t[s]==e&&!r||g._display(e)},g._readValue=function(e){return+e.val()},g._fillValue=function(e,t,s){i.eq(t).val(e),s&&i.eq(t).trigger("change")},g.___init=function(e){var t,s;if(r&&(r.removeClass("mbsc-slider-has-tooltip"),1!=v&&ms(".mbsc-slider-step",c).remove()),r=g._$parent,c=g._$track,o=g._$progress,i=r.find("input"),b=g.settings,p=g._min,f=g._max,g._step=v=void 0===e.step?+i.attr("step")||b.step:e.step,g._live=a("data-live",b.live),u=a("data-tooltip",b.tooltip),d=a("data-highlight",b.highlight)&&i.length<3,m=d&&2==i.length,h=b.rtl,u&&r.addClass("mbsc-slider-has-tooltip"),1!=v)for(s=(f-p)/v,t=0;t<=s;++t)c.append('<span class="mbsc-slider-step" style="'+(h?"right":"left")+":"+100/s*t+'%"></span>');i.each(function(e){"range"==this.type&&ms(this).attr("min",p).attr("max",f).attr("step",v),(d?o:c).append('<span class="mbsc-slider-handle-cont'+(m&&!e?" mbsc-slider-handle-left":"")+'"><span tabindex="0" class="mbsc-slider-handle" aria-valuemin="'+p+'" aria-valuemax="'+f+'" data-index="'+e+'"></span>'+(u?'<span class="mbsc-slider-tooltip"></span>':"")+"</span>")}),l=r.find(".mbsc-slider-tooltip")},s||g.init(t)};hs.prototype={_class:"progress",_css:"mbsc-progress mbsc-slider",_hasTheme:!0,_hasLang:!0,_defaults:{changeEvent:"change",stopProp:!0,min:0,max:100,step:1,live:!0,highlight:!0,round:!0,returnAffix:!0}},U.classes.Slider=hs,U.presetShort("slider","Slider");var fs=U.$,ps=U.util,vs=function(){},bs=U.classes;bs.Color=function(e,t,s){function n(e,t,s,n,a){if(!a){Z._value=Z._hasValue?Z._tempValue.slice(0):null;for(var i=0;i<x.length;++i)x[i].tempChangedColor&&Z._value&&Z._value.indexOf(x[i].tempChangedColor)!=-1&&(x[i].changedColor=x[i].tempChangedColor),delete x[i].tempChangedColor}e&&(Z._isInput&&J.val(Z._hasValue?Z._tempValue:""),T("onFill",{valueText:Z._hasValue?Z._tempValue:"",change:t}),t&&(ee=fs.extend(!0,{},te),Z._preventChange=!0,J.trigger("change"),m(Z._value)))}function a(e,t){return t=void 0!==t?t:r(e),'<div class="mbsc-color-input-item" data-color="'+(void 0!==t?t:e)+'" style="background: '+e+';">'+(j?"":'<div class="mbsc-color-input-item-close mbsc-ic mbsc-ic-material-close"></div>')+"</div>"}function i(e){H[0].style.background=e?ps.prefix+"linear-gradient(left, "+(g.rtl?"#000000":"#FFFFFF")+" 0%, "+e+" 50%, "+(g.rtl?"#FFFFFF":"#000000")+" 100%)":""}function r(e){if(Object.keys(te).length&&!isNaN(e))return e;for(var t in x)if(e==x[t].color||e==x[t].changedColor)return t}function o(){if(R){var e,t="";if(B.empty(),Z._value){if(j)t+=a(Z._value,W);else for(e=0;e<Z._value.length;++e)t+=a(Z._value[e],Object.keys(te).length&&te[e].colorIndex?te[e].colorIndex:r(Z._value[e]));B.append(t),Z.tap(fs(".mbsc-color-input-item",B),function(e){if(fs(e.target).hasClass("mbsc-color-input-item-close")){var t=fs(this).index();e.stopPropagation(),e.preventDefault(),void 0===W&&(W=fs(e.target).parent().attr("data-color")),N&&(Q=x[W].previewInd,z.eq(Q).parent().removeClass("mbsc-color-active"),ee[t]={},te[t]={}),Z._value.splice(t,1),Z.setVal(Z._value,!0,!0)}else Y&&"inline"!==g.display&&(L=!0,W=fs(e.target).attr("data-color"),isNaN(W)&&(W=r(W)),W&&(x[W].selected=!0,Q=x[W].previewInd,setTimeout(function(){M.scroll(U.eq(W),400),N&&D.scroll(z.eq(Q),400)},200)))})}}}function l(e,t){var s,n=e.match(/\d+/gim);switch(!0){case e.indexOf("rgb")>-1:s=w({r:n[0],g:n[1],b:n[2]});break;case e.indexOf("hsl")>-1:s=S({h:n[0],s:n[1],l:n[2]});break;case e.indexOf("hsv")>-1:s=V({h:n[0],s:n[1],v:n[2]});break;case e.indexOf("#")>-1:s=e}return c(s,t||g.format)}function c(e,t){switch(t){case"rgb":return _(e);case"hsl":return k(e);case"hsv":return $(e);default:return e}}function d(){var e;for(e=0;e<g.select;++e)if(void 0===te[e].colorIndex)return e}function u(e,t){fs(".mbsc-color-active",t).removeClass("mbsc-color-active"),Y&&(e.parent().addClass("mbsc-color-active"),N&&e&&void 0!==Q&&z.eq(Q).parent().addClass("mbsc-color-active"))}function m(e,t){var s,n,a=[],i=0,r=fs.map(x,function(e){return e.changedColor||e.color});if(j){if(e=fs.isArray(e)?e[0]:e,n=r.indexOf(e),n>-1&&a.push(n),e&&!a.length){var l=+fs(".mbsc-color-input-item",B).attr("data-color");isNaN(l)||a.push(l),W=l}}else if(e)if(N&&Y)for(var c in ee)void 0!==ee[c].colorIndex&&a.push(+ee[c].colorIndex);else for(s=0;s<e.length;++s)n=r.indexOf(e[s]),n>-1&&(a.push(n),r[n]="temp"+s);for(s=0;s<a.length;++s)h(!0,a[s],i++,x[a[s]].changedColor||x[a[s]].color,!0);for(s=0;s<x.length;++s)a.indexOf(s)==-1&&h(!1,s,void 0,x[s].changedColor||x[s].color,!1);if(N)for(s=i;s<g.select;++s)te[s]={},z&&z.eq(s).addClass("mbsc-color-preview-item-empty").css({background:"transparent"});ee=fs.extend(!0,{},te),t!==!1&&o()}function h(e,t,s,n,a,i){if(N&&a&&(te[s].colorIndex=e?t:void 0,te[s].color=e?n:void 0,z)){var r=z.eq(s);r.removeClass("mbsc-color-preview-item-empty").css({background:e?n:"transparent"}),e||r.addClass("mbsc-color-preview-item-empty").parent().removeClass("mbsc-color-active")}i&&(e?Z._tempValue.splice(s,0,n):Z._tempValue.splice(Z._tempValue.indexOf(n),1)),U&&(e?U.eq(t).addClass("mbsc-color-selected"):U.eq(t).removeClass("mbsc-color-selected").parent().removeClass("mbsc-color-active")),x[t].previewInd=e?s:void 0,x[t].selected=e}function f(e,t){void 0!==e&&(j||x[e].selected)?(W=e,O=x[e].changedColor||x[e].color,K=U.eq(e),Y&&(u(U.eq(e),t||""),I=l(x[e].color,"hsl"),I.l=l(O,"hsl").l,i(x[e].color),P.setVal(100-I.l,!1,!1))):Y&&i()}function p(){var e,t=[];for(e=0;e<x.length;++e)x[e].selected&&t.push(x[e]);return t}function v(e,t){var s=fs(e.target).index();W=te[s].colorIndex,K=U.eq(W),Q=s,f(W,t),M.scroll(K,250),T("onPreviewItemTap",{target:e.target,value:te[s].color,index:s})}function b(e,t){var s=!1,n=fs(".mbsc-color-selected",t);return K=fs(e.target),K.hasClass("mbsc-color-clear-item")?(O="",void Z.clear()):void((j||q>+n.length||K.hasClass("mbsc-color-selected"))&&(W=K.attr("data-index"),N&&(Q=void 0!==x[W].previewInd?x[W].previewInd:d(),s=Y&&K.hasClass("mbsc-color-selected")&&!K.parent().hasClass("mbsc-color-active"),z.length>6&&D.scroll(z.eq(Q))),O=x[W].changedColor||x[W].color,j?(n.removeClass("mbsc-color-selected"),Z._tempValue=O,O&&K.toggleClass("mbsc-color-selected"),u(K,t)):(u(K,t),s||h(!x[W].selected,W,Q,O,!0,!0)),f(W,t),Z.live&&(Z._fillValue(),T("onSet",{value:Z._value})),T("onItemTap",{target:e.target,value:O,selected:x[W].selected,index:W})))}var g,y,x,C,T,M,D,A,O,I,L,E,N,H,Y,F,P,W,R,j,q,X,B,U,z,K,G,Z=this,J=fs(e),Q=0,ee={},te={};bs.Frame.call(this,e,t,!0),Z.setVal=Z._setVal=function(e,t,s,a){Z._hasValue=null!==e&&void 0!==e,Z._tempValue=j?fs.isArray(e)?e[0]:e:fs.isArray(e)?e:[e],n(t,!0,void 0===s?t:s,a)},Z.getVal=Z._getVal=function(e){return Z._hasValue||e?X?p():Z[e?"_tempValue":"_value"]:null},Z._readValue=function(){var e=J.val()||"";Z._hasValue=!1,0!==e.length&&""!==e&&(Z._hasValue=!0),Z._hasValue?(Z._tempValue=j?e:"hex"==g.format?e.split(","):e.match(/[a-z]{3}\((\d+\.?\d{0,}?),\s*([\d.]+)%{0,},\s*([\d.]+)%{0,}\)/gim),n(!0)):Z._tempValue=[],m(Z._tempValue,Z._hasValue)},Z._fillValue=function(){Z._hasValue=!0,n(!0,!0,0,!0)},Z._generateContent=function(){var e,t,s,n=A?1:0;for(F=E?Math.ceil((x.length+n)/g.rows):g.rows,t='<div class="mbsc-color-scroll-cont mbsc-w-p '+(E?"":"mbsc-color-vertical")+'"><div class="mbsc-color-cont">'+(E?'<div class="mbsc-color-row">':""),e=0;e<x.length;++e)s=x[e].changedColor||x[e].color,A&&0===e&&(t+='<div class="mbsc-color-item-c"><div tabindex="0" class="mbsc-color-clear-item mbsc-btn-e mbsc-color-selected"><div class="mbsc-color-clear-cross"></div></div></div>'),0!==e&&(e+n)%F===0&&(t+=E?'</div><div class="mbsc-color-row">':""),t+='<div class="mbsc-color-item-c"><div tabindex="0" data-index="'+e+'" class="mbsc-color-item mbsc-btn-e mbsc-ic mbsc-ic-material-check mbsc-color-btn-e '+(x[e].selected?"mbsc-color-selected":"")+'"  style="background:'+s+'"></div></div>';if(t+="</div></div>"+(E?"</div>":""),Y&&(t+='<div class="mbsc-color-slider-cont"><input class="mbsc-color-slider" type="range" data-highlight="false" value="50" min="0" max="100"/></div>'),N){t+='<div class="mbsc-color-preview-cont"><div class="mbsc-color-refine-preview">';for(var a in ee)t+='<div class="mbsc-color-preview-item-c mbsc-btn-e mbsc-color-btn-e" tabindex="0"><div class="mbsc-color-preview-item '+(ee[a].color?"":"mbsc-color-preview-item-empty")+'" style="background: '+(ee[a].color||"initial")+';"></div></div>';t+="</div></div>"}return t},Z._position=function(e){var t,s;E||(t=e.find(".mbsc-color-cont"),s=Math.ceil(t.find(".mbsc-color-item-c")[0].offsetWidth),t.width(Math.min(Math.floor(e.find(".mbsc-fr-c").width()/s),Math.round(x.length/g.rows))*s+1)),M&&M.refresh(),D&&D.refresh()},Z._markupInserted=function(e){E||e.find(".mbsc-color-scroll-cont").css("max-height",e.find(".mbsc-color-item-c")[0].offsetHeight*g.rows),M=new bs.ScrollView(e.find(".mbsc-color-scroll-cont")[0],{axis:E?"X":"Y",rtl:g.rtl,elastic:60,stopProp:!1,mousewheel:g.mousewheel,onBtnTap:function(t){b(t,e)}})},Z._attachEvents=function(e){var t;U=fs(".mbsc-color-item",e),e.on("keydown",".mbsc-color-btn-e",function(t){t.stopPropagation(),32==t.keyCode&&(t.target.classList.contains("mbsc-color-item")?b(t,e):v(t,e))}),N&&(z=fs(".mbsc-color-preview-item",e)),Y&&(e.addClass("mbsc-color-refine"),G=fs(".mbsc-color-slider",e),P=new bs.Slider(G[0],{theme:g.theme,rtl:g.rtl}),H=e.find(".mbsc-progress-track"),W&&Z._value&&f(W,e),G.on("change",function(){void 0!==W&&(j||x[W].selected)&&(I.l=100-this.value,t=l(I.toString()).toString(),j?Z._tempValue=t:Z._tempValue[void 0!==Q?Q:Z._tempValue.length]=t,x[W].tempChangedColor=t,U.eq(W).css("background",t),N&&(te[Q].color=t,z.eq(Q).removeClass("mbsc-color-preview-item-empty").css({background:t})),Z.live&&ps.throttle(Z._fillValue()))})),N&&(D=new bs.ScrollView(e.find(".mbsc-color-preview-cont")[0],{axis:"X",rtl:g.rtl,mousewheel:g.mousewheel,onBtnTap:function(t){v(t,e)}}))},Z._detachEvents=function(){M.destroy(),P&&P.destroy(),D&&D.destroy()},Z.__processSettings=function(){var t,s;if(g=Z.settings,C=g.format,T=Z.trigger,E="horizontal"==g.navigation,Z._value=[],Z._tempValue=[],j="single"==g.select,A=void 0!==g.clear?g.clear:j,s=g.data||[],!s.length)switch(g.format){case"rgb":s=["rgb(255,235,60)","rgb(255,153,0)","rgb(244,68,55)","rgb(234,30,99)","rgb(156,38,176)","rgb(104,58,183)","rgb(63,81,181)","rgb(33,150,243)","rgb(0,151,136)","rgb(75,175,79)","rgb(126,93,78)","rgb(158,158,158)"],A&&s.splice(10,0,"rgb(83, 71, 65)");break;case"hsl":s=["hsl(54,100%,62%)","hsl(36,100%,50%)","hsl(4,90%,59%)","hsl(340,83%,52%)","hsl(291,64%,42%)","hsl(262,52%,47%)","hsl(231,48%,48%)","hsl(207,90%,54%)","hsl(174,100%,30%)","hsl(122,40%,49%)","hsl(19,24%,40%)","hsl(0,0%,62%)"],A&&s.splice(10,0,"hsl(20, 12%, 29%)");break;default:s=["#ffeb3c","#ff9900","#f44437","#ea1e63","#9c26b0","#683ab7","#3f51b5","#2196f3","#009788","#4baf4f","#7e5d4e","#9e9e9e"],A&&s.splice(10,0,"#534741")}if(Y="refine"==g.mode,N=!isNaN(g.select),q=isNaN(g.select)?j?2:s.length:g.select,X=fs.isPlainObject(s[0]),N&&!Object.keys(ee).length)for(t=0;t<g.select;++t)ee[t]={},te[t]={};if(!x)for(x=s.slice(0),t=0;t<x.length;++t)fs.isPlainObject(s[t])?x[t].color=s[t].color:(s[t]=s[t].toLowerCase(),x[t]={key:t,name:s[t],color:s[t]});y=g.defaultValue||x[0].color,O=y,I=l(O,"hsl"),R=g.enhance&&J.is("input"),R&&(J.hasClass("mbsc-color-input-hdn")?B=J.prev():(B=fs("<div "+(e.placeholder?'data-placeholder="'+e.placeholder+'"':"")+' class="mbsc-control mbsc-color-input '+(g.inputClass||"")+'" readonly ></div>'),B.insertBefore(J),J.addClass("mbsc-color-input-hdn").attr("tabindex",-1)),g.anchor=B,Z.attachShow(B))},Z.__init=function(){g.cssClass=(g.cssClass||"")+" mbsc-color"},Z.__destroy=function(){R&&(J.removeClass("mbsc-color-input-hdn"),B.remove())},s||Z.init(t)},bs.Color.prototype={_hasDef:!0,_hasTheme:!0,_hasLang:!0,_class:"color",_defaults:fs.extend({},bs.Frame.prototype._defaults,{headerText:!1,validate:vs,parseValue:vs,enhance:!0,rows:2,select:"single",format:"hex",navigation:"horizontal"})},U.themes.color=U.themes.frame,U.presetShort("color","Color",!1),ps.color={hsv2hex:V,hsv2rgb:C,rgb2hsv:T,rgb2hex:w,rgb2hsl:M,hex2rgb:_,hex2hsv:$,hex2hsl:k},e.module("mobiscroll-color",[]).directive("mobiscrollColor",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollColor",{component:"Color"})}]);var gs=U.$,ys=U.presets.scroller,xs=U.util.datetime,ws=U.util,_s=ws.testTouch,Cs={autoCorrect:!0,showSelector:!0,minRange:1,rangeTap:!0,fromText:"Start",toText:"End"};U.presetShort("range"),ys.range=function(e){function t(e,t){e&&(e.setFullYear(t.getFullYear()),e.setMonth(t.getMonth()),e.setDate(t.getDate()))}function s(t){e._startDate=D=g,e._endDate=k=x,A.startInput&&(gs(A.startInput).val(v),t&&gs(A.startInput).trigger("change")),A.endInput&&(gs(A.endInput).val(b),t&&gs(A.endInput).trigger("change"))}function n(e,t){var s=!0;return e&&g&&x&&(x-g>A.maxRange-1&&(S?g=new Date(x-A.maxRange+1):x=new Date(+g+A.maxRange-1)),x-g<A.minRange-1&&(S?g=new Date(x-A.minRange+1):x=new Date(+g+A.minRange-1))),g&&x||(s=!1),t&&o(),s}function a(){return g&&x?Math.max(1,Math.round((new Date(x).setHours(0,0,0,0)-new Date(g).setHours(0,0,0,0))/864e5)+1):0}function i(e){e.addClass("mbsc-range-btn-sel").attr("aria-checked","true").find(".mbsc-range-btn").addClass(L)}function r(){M&&d&&(gs(".mbsc-range-btn-c",d).removeClass("mbsc-range-btn-sel").removeAttr("aria-checked").find(".mbsc-range-btn",d).removeClass(L),i(gs(".mbsc-range-btn-c",d).eq(S)))}function o(){var e,t,s,n,a,i=0,r=I||!S?" mbsc-cal-day-hl mbsc-cal-sel-start":" mbsc-cal-sel-start",o=I||S?" mbsc-cal-day-hl mbsc-cal-sel-end":" mbsc-cal-sel-end";if(v=g?xs.formatDate(m,g,A):"",b=x?xs.formatDate(m,x,A):"",d&&(gs(".mbsc-range-btn-v-start",d).html(v||"&nbsp;"),gs(".mbsc-range-btn-v-end",d).html(b||"&nbsp;"),e=g?new Date(g):null,s=x?new Date(x):null,!e&&s&&(e=new Date(s)),!s&&e&&(s=new Date(e)),a=S?s:e,gs(".mbsc-cal-table .mbsc-cal-day-sel .mbsc-cal-day-i",d).removeClass(L),gs(".mbsc-cal-table .mbsc-cal-day-hl",d).removeClass(N),gs(".mbsc-cal-table .mbsc-cal-day-sel",d).removeClass("mbsc-cal-day-sel mbsc-cal-sel-start mbsc-cal-sel-end").removeAttr("aria-selected"),e&&s))for(t=e.setHours(0,0,0,0),n=s.setHours(0,0,0,0);s>=e&&i<84;)gs('.mbsc-cal-day[data-full="'+a.getFullYear()+"-"+a.getMonth()+"-"+a.getDate()+'"]',d).addClass("mbsc-cal-day-sel"+(a.getTime()===t?r:"")+(a.getTime()===n?o:"")).attr("aria-selected","true").find(".mbsc-cal-day-i ").addClass(L),a.setDate(a.getDate()+(S?-1:1)),i++}function l(e,t){return{h:e?e.getHours():t?23:0,i:e?e.getMinutes():t?59:0,s:e?e.getSeconds():t?59:0}}var c,d,u,m,h,f,p,v,b,g,y,x,w,_,C,T,M,D=e._startDate,k=e._endDate,S=0,V=new Date,$=gs.extend({},e.settings),A=gs.extend(e.settings,Cs,$),O=A.anchor,I=A.rangeTap,L=A.activeClass||"",E="mbsc-fr-btn-d "+(A.disabledClass||""),N="mbsc-cal-day-hl",H=null===A.defaultValue?[]:A.defaultValue||[new Date(V.setHours(0,0,0,0)),new Date(V.getFullYear(),V.getMonth(),V.getDate()+6,23,59,59,999)];return I&&(A.tabs=!0),h=ys.calbase.call(this,e),c=gs.extend({},h),m=e.format,_="time"===A.controls.join(""),M=1!=A.controls.length||"calendar"!=A.controls[0]||A.showSelector,A.startInput&&(C=gs(A.startInput).prop("readonly"),e.attachShow(gs(A.startInput).prop("readonly",!0),function(){S=0,A.anchor=O||gs(A.startInput)})),A.endInput&&(T=gs(A.endInput).prop("readonly"),e.attachShow(gs(A.endInput).prop("readonly",!0),function(){S=1,A.anchor=O||gs(A.endInput)})),e.setVal=function(t,s,n,a,i){var r=t||[],o=t;(void 0===r[0]||null===r[0]||r[0].getTime)&&(p=!0,g=r[0]||null,v=g?xs.formatDate(m,g,A):"",S||(o=c.parseValue(v,e))),(void 0===r[1]||null===r[1]||r[1].getTime)&&(p=!0,x=r[1]||null,b=x?xs.formatDate(m,x,A):"",S&&(o=c.parseValue(b,e))),a||(e._startDate=D=g,e._endDate=k=x),e._setVal(o,s,n,a,i)},e.getVal=function(t){return t?[g,x]:e._hasValue?[D,k]:null},e.getDayProps=function(e){var t=g?new Date(g.getFullYear(),g.getMonth(),g.getDate()):null,s=x?new Date(x.getFullYear(),x.getMonth(),x.getDate()):null;return{selected:t&&s&&e>=t&&e<=x,cssClass:((I||!S)&&t&&t.getTime()===e.getTime()||(I||S)&&s&&s.getTime()===e.getTime()?N:"")+(t&&t.getTime()===e.getTime()?" mbsc-cal-sel-start":"")+(s&&s.getTime()===e.getTime()?" mbsc-cal-sel-end":"")}},e.setActiveDate=function(t){var s;S="start"==t?0:1,s="start"==t?g:x,e.isVisible()&&(r(),I||(gs(".mbsc-cal-table .mbsc-cal-day-hl",d).removeClass(N),s&&gs('.mbsc-cal-day[data-full="'+s.getFullYear()+"-"+s.getMonth()+"-"+s.getDate()+'"]',d).addClass(N)),s&&(f=!0,e.setDate(s,!1,1e3,!0)))},e.getValue=e.getVal,gs.extend(h,{highlight:!1,outerMonthChange:!1,formatValue:function(){return v+(A.endInput?"":b?" - "+b:"")},parseValue:function(t){var s=t?t.split(" - "):[];return A.defaultValue=H[1],k=A.endInput?gs(A.endInput).val()?xs.parseDate(m,gs(A.endInput).val(),A):H[1]:s[1]?xs.parseDate(m,s[1],A):H[1],A.defaultValue=H[0],D=A.startInput?gs(A.startInput).val()?xs.parseDate(m,gs(A.startInput).val(),A):H[0]:s[0]?xs.parseDate(m,s[0],A):H[0],A.defaultValue=H[S],v=D?xs.formatDate(m,D,A):"",b=k?xs.formatDate(m,k,A):"",e._startDate=D,e._endDate=k,c.parseValue(S?b:v,e)},onFill:function(e){s(e.change)},onBeforeClose:function(t){if("set"===t.button&&!n(!0,!0))return e.setActiveDate(S?"start":"end"),!1},onHide:function(){c.onHide.call(e),S=0,d=null,A.anchor=O},onClear:function(){I&&(S=0)},onBeforeShow:function(){A.headerText=!1,g=D,x=k,y=l(g,0),w=l(x,1),A.counter&&(A.headerText=function(){var e=a();return(e>1?A.selectedPluralText||A.selectedText:A.selectedText).replace(/{count}/,e)}),p=!0},onMarkupReady:function(t){var s;g&&(f=!0,e.setDate(g,!1,0,!0),g=e.getDate(!0)),x&&(f=!0,e.setDate(x,!1,0,!0),x=e.getDate(!0)),(S&&x||!S&&g)&&(f=!0,e.setDate(S?x:g,!1,0,!0)),o(),c.onMarkupReady.call(this,t),d=gs(t.target),d.addClass("mbsc-range"),M&&(s='<div class="mbsc-range-btn-t" role="radiogroup"><div class="mbsc-range-btn-c mbsc-range-btn-start"><div role="radio" class="mbsc-fr-btn-e mbsc-fr-btn-nhl mbsc-range-btn">'+A.fromText+'<div class="mbsc-range-btn-v mbsc-range-btn-v-start">'+(v||"&nbsp;")+'</div></div></div><div class="mbsc-range-btn-c mbsc-range-btn-end"><div role="radio" class="mbsc-fr-btn-e mbsc-fr-btn-nhl mbsc-range-btn">'+A.toText+'<div class="mbsc-range-btn-v mbsc-range-btn-v-end">'+(b||"&nbsp;")+"</div></div></div></div>",gs(".mbsc-cal-tabs",d).before(s),r()),gs(".mbsc-range-btn-c",d).on("touchstart click",function(t){_s(t,this)&&(e.showMonthView(),e.setActiveDate(gs(this).index()?"end":"start"))})},onDayChange:function(e){e.active=S?"end":"start",u=!0},onSetDate:function(s){var a=s.date,i=e.order;f||(void 0===i.h&&a.setHours(S?23:0),void 0===i.i&&a.setMinutes(S?59:0),void 0===i.s&&a.setSeconds(S?59:0),a.setMilliseconds(S?999:0),p&&!u||(I&&u&&(1==S&&a<g&&(S=0),S?a.setHours(w.h,w.i,w.s,999):a.setHours(y.h,y.i,y.s,0)),S?(x=new Date(a),w=l(x)):(g=new Date(a),y=l(g)),_&&(t(g,a),t(x,a)),I&&u&&!S&&(x=null))),e._isValid=n(p||u||A.autoCorrect,!f),s.active=S?"end":"start",!f&&I&&(u&&(S=S?0:1),r()),e.isVisible()&&(e._isValid?gs(".mbsc-fr-btn-s .mbsc-fr-btn",e._markup).removeClass(E):gs(".mbsc-fr-btn-s .mbsc-fr-btn",e._markup).addClass(E)),u=!1,p=!1,f=!1},onTabChange:function(t){"calendar"!=t.tab&&e.setDate(S?x:g,!1,1e3,!0),n(!0,!0)},onDestroy:function(){gs(A.startInput).prop("readonly",C),gs(A.endInput).prop("readonly",T)}}),h},e.module("mobiscroll-range",[]).directive("mobiscrollRange",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollRange",{preset:"range"})}]),e.module("mobiscroll-scroller",[]).directive("mobiscrollScroller",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollScroller",{})}]);var Ts,Ms=U.$,Ds=Ms.extend,ks=U.classes,Ss=U.util,Vs=Ss.prefix,$s=Ss.jsPrefix,As=Ss.getCoord,Os=Ss.testTouch,Is=Ss.vibrate,Ls=Ss.animEnd,Es=1,Ns=function(){},Hs=window.requestAnimationFrame||function(e){e()},Ys=window.cancelAnimationFrame||Ns,Fs="transparent",Ps=function(e,t){function s(){ct=!1,tt=!1,B=0,gt=0,yt=new Date,He=ee.width(),ne=$(ee),Pe=ne.index(Ye),Fe=Ye[0].offsetHeight,Rt=Ye[0].offsetTop,Vt=$t[Ye.attr("data-type")||"defaults"],bt=Vt.stages}function n(e){var t;"touchstart"===e.type&&(st=!0,clearTimeout(nt)),!Os(e,this)||j||Pt||Ts||Bt||(j=!0,K=!0,xt=As(e,"X"),wt=As(e,"Y"),ce=0,de=0,Ye=Ms(this),t=Ye,s(),Dt=mt.onItemTap||Vt.tap||Ye.hasClass("mbsc-lv-parent")||Ye.hasClass("mbsc-lv-back"),Be=Ft.offset().top,je=Ye.offset().top,Dt&&(X=setTimeout(function(){t.addClass("mbsc-lv-item-active"),ge("onItemActivate",{target:t[0],domEvent:e})},120)),Ht.sortable&&!Ye.hasClass("mbsc-lv-back")&&(Ht.sortable.group||(Qe=Ye.nextUntil(".mbsc-lv-gr-title").filter(".mbsc-lv-item"),at=Ye.prevUntil(".mbsc-lv-gr-title").filter(".mbsc-lv-item")),ze=(Ht.sortable.group?ee.children(Re).eq(0):at.length?at.eq(-1):Ye)[0].offsetTop-Rt,Ue=(Ht.sortable.group?ee.children(Re).eq(-1):Qe.length?Qe.eq(-1):Ye)[0].offsetTop-Rt,Ht.sortable.handle?Ms(e.target).hasClass("mbsc-lv-handle")&&(clearTimeout(X),"Moz"===$s?(e.preventDefault(),c()):St=setTimeout(function(){c()},100)):St=setTimeout(function(){ye.appendTo(Ye),ye[0].style[$s+"Animation"]="mbsc-lv-fill "+(mt.sortDelay-100)+"ms linear",clearTimeout(pe),clearTimeout(X),K=!1,St=setTimeout(function(){ye[0].style[$s+"Animation"]="",c()},mt.sortDelay-80)},80)),"mousedown"==e.type&&Ms(document).on("mousemove",a).on("mouseup",i))}function a(e){var t=!1,s=!0;if(j)if(ve=As(e,"X"),be=As(e,"Y"),ce=ve-xt,de=be-wt,clearTimeout(pe),he||Ct||ht||Ye.hasClass("mbsc-lv-back")||(Math.abs(de)>10?(ht=!0,i(Ds({},e,{type:"mousemove"==e.type?"mouseup":"touchend"})),clearTimeout(X)):Math.abs(ce)>7&&r()),Ct)e.preventDefault(),B=ce/He*100,o();else if(he){e.preventDefault();var n,a=It.scrollTop(),l=Math.max(ze,Math.min(de+Et,Ue)),c=Te?je-Nt+a-Et:je;Lt+a<c+l+Fe?(It.scrollTop(c+l-Lt+Fe),n=!0):c+l<a&&(It.scrollTop(c+l),n=!0),n&&(Et+=It.scrollTop()-a),Ze&&(Ht.sortable.multiLevel&&Ge.hasClass("mbsc-lv-parent")?Rt+Fe/4+l>Ze?t=!0:Rt+Fe-Fe/4+l>Ze&&(ue=Ge.addClass("mbsc-lv-item-hl"),s=!1):Rt+Fe/2+l>Ze&&(Ge.hasClass("mbsc-lv-back")?Ht.sortable.multiLevel&&(me=Ge.addClass("mbsc-lv-item-hl"),s=!1):t=!0),t&&(it.insertAfter(Ge),rt=Ge,Ge=I(Ge,"next"),ot=Ze,Ze=Ge.length&&Ge[0].offsetTop,Q++)),!t&&ot&&(Ht.sortable.multiLevel&&rt.hasClass("mbsc-lv-parent")?Rt+Fe-Fe/4+l<ot?t=!0:Rt+Fe/4+l<ot&&(ue=rt.addClass("mbsc-lv-item-hl"),s=!1):Rt+Fe/2+l<ot&&(rt.hasClass("mbsc-lv-back")?Ht.sortable.multiLevel&&(me=rt.addClass("mbsc-lv-item-hl"),s=!1):t=!0),t&&(it.insertBefore(rt),Ge=rt,rt=I(rt,"prev"),Ze=ot,ot=rt.length&&rt[0].offsetTop+rt[0].offsetHeight,Q--)),s&&(ue&&(ue.removeClass("mbsc-lv-item-hl"),ue=!1),me&&(me.removeClass("mbsc-lv-item-hl"),me=!1)),t&&ge("onSortChange",[Ye,Q]),w(Ye,l),ge("onSort",[Ye,Q])}else(Math.abs(ce)>5||Math.abs(de)>5)&&_()}function i(e){var t,s,n,r,o=Ye;j&&(j=!1,_(),"mouseup"==e.type&&Ms(document).off("mousemove",a).off("mouseup",i),ht||(nt=setTimeout(function(){st=!1},300)),(Ct||ht||he)&&(tt=!0),Ct?l():he?(n=ee,ue?(D(Ye.detach()),s=Xt[ue.attr("data-ref")],Q=$(s.child).length,ue.removeClass("mbsc-lv-item-hl"),mt.navigateOnDrop?F(ue,function(){Ht.add(null,Ye,null,null,ue,!0),H(Ye),d(Ye,Pe,n,!0)}):(Ht.add(null,Ye,null,null,ue,!0),d(Ye,Pe,n,!0))):me?(D(Ye.detach()),s=Xt[me.attr("data-back")],Q=$(s.parent).index(s.item)+1,me.removeClass("mbsc-lv-item-hl"),mt.navigateOnDrop?F(me,function(){Ht.add(null,Ye,Q,null,ee,!0),H(Ye),d(Ye,Pe,n,!0)}):(Ht.add(null,Ye,Q,null,s.parent,!0),d(Ye,Pe,n,!0))):(t=it[0].offsetTop-Rt,w(Ye,t,6*Math.abs(t-Math.max(ze,Math.min(de+Et,Ue))),function(){D(Ye),Ye.insertBefore(it),d(Ye,Pe,n,Q!==Pe)})),he=!1):!ht&&Math.abs(ce)<5&&Math.abs(de)<5&&(Vt.tap&&(r=Vt.tap.call(Yt,{target:Ye,index:Pe,domEvent:e},Ht)),Dt&&("touchend"===e.type&&Ss.preventClick(),Ye.addClass("mbsc-lv-item-active"),ge("onItemActivate",{target:Ye[0],domEvent:e})),r=ge("onItemTap",{target:Ye[0],index:Pe,domEvent:e}),r!==!1&&F(Ye)),clearTimeout(X),setTimeout(function(){o.removeClass("mbsc-lv-item-active"),ge("onItemDeactivate",{target:o[0]})},100),ht=!1,ae=null)}function r(){Ct=k(Vt.swipe,{target:Ye[0],index:Pe,direction:ce>0?"right":"left"}),Ct&&(_(),clearTimeout(X),Vt.actions?(q=N(Vt,ce),Ke.html(Vt.icons).show().children().css("width",q+"%"),Ee.hide(),Ms(".mbsc-lv-ic-m",Ne).removeClass("mbsc-lv-ic-disabled"),Ms(Vt.leftMenu).each(p),Ms(Vt.rightMenu).each(p)):(Ee.show(),Ke.hide(),ie=Vt.start+(ce>0?0:1),lt=bt[ie-1],Je=bt[ie]),Ye.addClass("mbsc-lv-item-swiping").removeClass("mbsc-lv-item-active"),kt.css("line-height",Fe+"px"),Ne.css({top:Rt,height:Fe,backgroundColor:L(ce)}).addClass("mbsc-lv-stage-c-v").appendTo(ee.parent()),mt.iconSlide&&Ye.append(Ee),ge("onSlideStart",{target:Ye[0],index:Pe}))}function o(){var e=!1;ut||(Vt.actions?Ne.attr("class","mbsc-lv-stage-c-v mbsc-lv-stage-c mbsc-lv-"+(B<0?"right":"left")):(lt&&B<=lt.percent?(ie--,Je=lt,lt=bt[ie],e=!0):Je&&B>=Je.percent&&(ie++,lt=Je,Je=bt[ie],e=!0),e&&(ae=B>0?lt:Je,ae&&(C(ae,mt.iconSlide),ge("onStageChange",{target:Ye[0],index:Pe,stage:ae})))),ft||(ut=!0,dt=Hs(g)))}function l(e){var t,s,n,a=!1,i=!0;Ys(dt),ut=!1,ft||g(),Vt.actions?Math.abs(B)>10&&q&&(x(Ye,B<0?-q:q,200),a=!0,Ts=!0,G=Ye,Z=Pe,Ms(document).on("touchstart.mbsc-lv-conf mousedown.mbsc-lv-conf",function(t){t.preventDefault(),y(Ye,!0,e)})):B&&(mt.quickSwipe&&!ft&&(n=new Date-yt,t=n<300&&ce<-50,s=n<300&&ce>50,t?(ct=!0,ae=Vt.left,C(ae,mt.iconSlide)):s&&(ct=!0,ae=Vt.right,C(ae,mt.iconSlide))),ae&&ae.action&&(le=k(ae.disabled,{target:Ye[0],index:Pe}),le||(a=!0,Ts=ft||k(ae.confirm,{target:Ye[0],index:Pe}),Ts?(x(Ye,(B<0?-1:1)*Ee[0].offsetWidth*100/He,200,!0),b(ae,Ye,Pe,!1,e)):v(ae,Ye,Pe,e)))),a||y(Ye,i,e),Ct=!1}function c(){he=!0,ue=!1,me=!1,Et=0,Q=Pe,mt.vibrate&&Is(),Ge=I(Ye,"next"),Ze=Ge.length&&Ge[0].offsetTop,rt=I(Ye,"prev"),ot=rt.length&&rt[0].offsetTop+rt[0].offsetHeight,it.height(Fe).insertAfter(Ye),Ye.css({top:Rt}).addClass("mbsc-lv-item-dragging").removeClass("mbsc-lv-item-active").appendTo(fe),
  ge("onSortStart",{target:Ye[0],index:Q})}function d(e,t,s,n){e.removeClass("mbsc-lv-item-dragging"),it.remove(),ge("onSortEnd",{target:e[0],index:Q}),mt.vibrate&&Is(),n&&(Ht.addUndoAction(function(n){Ht.move(e,t,null,n,s,!0)},!0),ge("onSortUpdate",{target:e[0],index:Q}))}function u(){st||(clearTimeout(Ae),Ts&&Ms(document).trigger("touchstart"),Se&&(Ht.close(ke,Ve),Se=!1,ke=null))}function m(){clearTimeout(re),re=setTimeout(function(){Lt=It[0].innerHeight||It.innerHeight(),Nt=Te?It.offset().top:0,j&&(Rt=Ye[0].offsetTop,Fe=Ye[0].offsetHeight,Ne.css({top:Rt,height:Fe}))},200)}function h(e){tt&&(e.stopPropagation(),e.preventDefault(),tt=!1)}function f(){if(he||!j){var e,t=It.scrollTop(),s=Ft.offset().top,n=Ft[0].offsetHeight,a=Te?It.offset().top:t;Ms(".mbsc-lv-gr-title",Ft).each(function(t,s){Ms(s).offset().top<a&&(e=s)}),s<a&&s+n>a?we.show().empty().append(Ms(e).clone()):we.hide()}}function p(e,t){k(t.disabled,{target:Ye[0],index:Pe})&&Ms(".mbsc-ic-"+t.icon,Ne).addClass("mbsc-lv-ic-disabled")}function v(e,t,s,n){var a,i={icon:"undo2",text:mt.undoText,color:"#b1b1b1",action:function(){Ht.undo()}};e.undo&&(Ht.startActionTrack(),Ms.isFunction(e.undo)&&Ht.addUndoAction(function(){e.undo.call(Yt,{target:t[0],index:s},Ht)}),At=t.attr("data-ref")),a=e.action.call(Yt,{target:t[0],index:s},Ht),e.undo?(Ht.endActionTrack(),a!==!1&&x(t,+t.attr("data-pos")<0?-100:100,200),it.height(Fe).insertAfter(t),t.css("top",Rt).addClass("mbsc-lv-item-undo"),Ke.hide(),Ee.show(),Ne.append(Ee),C(i),b(i,t,s,!0,n)):y(t,a,n)}function b(e,t,s,n,a){var i,r;Ts=!0,Ms(document).off(".mbsc-lv-conf").on("touchstart.mbsc-lv-conf mousedown.mbsc-lv-conf",function(e){e.preventDefault(),n&&M(t),y(t,!0,a)}),oe||Ee.off(".mbsc-lv-conf").on("touchstart.mbsc-lv-conf mousedown.mbsc-lv-conf",function(e){e.stopPropagation(),i=As(e,"X"),r=As(e,"Y")}).on("touchend.mbsc-lv-conf mouseup.mbsc-lv-conf",function(o){o.preventDefault(),"touchend"===o.type&&Ss.preventClick(),Math.abs(As(o,"X")-i)<10&&Math.abs(As(o,"Y")-r)<10&&(v(e,t,s,a),n&&(Ot=null,M(t)))})}function g(){x(Ye,gt+100*ce/He),ut=!1}function y(e,t,s){Ms(document).off(".mbsc-lv-conf"),Ee.off(".mbsc-lv-conf"),t!==!1?x(e,0,"0"!==e.attr("data-pos")?200:0,!1,function(){T(e,s),D(e)}):T(e,s),Ts=!1}function x(e,t,s,n,a){t=Math.max("right"==Ct?0:-100,Math.min(t,"left"==Ct?0:100)),_t=e[0].style,e.attr("data-pos",t),_t[$s+"Transform"]="translate3d("+(n?He*t/100+"px":t+"%")+",0,0)",_t[$s+"Transition"]=Vs+"transform "+(s||0)+"ms",a&&(Pt++,setTimeout(function(){a(),Pt--},s)),B=t}function w(e,t,s,n){t=Math.max(ze,Math.min(t,Ue)),_t=e[0].style,_t[$s+"Transform"]="translate3d(0,"+t+"px,0)",_t[$s+"Transition"]=Vs+"transform "+(s||0)+"ms ease-out",n&&(Pt++,setTimeout(function(){n(),Pt--},s))}function _(){clearTimeout(St),!K&&Ht.sortable&&(K=!0,ye.remove())}function C(e,t){var s=k(e.text,{target:Ye[0],index:Pe})||"";k(e.disabled,{target:Ye[0],index:Pe})?Ne.addClass("mbsc-lv-ic-disabled"):Ne.removeClass("mbsc-lv-ic-disabled"),Ne.css("background-color",e.color||(0===e.percent?L(B):Fs)),Ee.attr("class","mbsc-lv-ic-c mbsc-lv-ic-"+(t?"move-":"")+(B<0?"right":"left")),Le.attr("class"," mbsc-lv-ic-s mbsc-lv-ic mbsc-ic mbsc-ic-"+(e.icon||"none")),kt.attr("class","mbsc-lv-ic-text"+(e.icon?"":" mbsc-lv-ic-text-only")+(s?"":" mbsc-lv-ic-only")).html(s||"&nbsp;"),mt.animateIcons&&(ct?Le.addClass("mbsc-lv-ic-v"):setTimeout(function(){Le.addClass("mbsc-lv-ic-a")},10))}function T(e,t){j||(Le.attr("class","mbsc-lv-ic-s mbsc-lv-ic mbsc-ic mbsc-ic-none"),Ne.attr("style","").removeClass("mbsc-lv-stage-c-v"),kt.html("")),Ne.removeClass("mbsc-lv-left mbsc-lv-right"),e&&(ge("onSlideEnd",{target:e[0],index:Pe}),t&&t())}function M(e){e.css("top","").removeClass("mbsc-lv-item-undo"),Ot?Ht.animate(it,"collapse",function(){it.remove()}):it.remove(),T(),At=null,Ot=null}function D(e){_t=e[0].style,_t[$s+"Transform"]="",_t[$s+"Transition"]="",_t.top="",e.removeClass("mbsc-lv-item-swiping")}function k(e,t){return Ms.isFunction(e)?e.call(this,t,Ht):e}function S(e){var t;if(e.attr("data-ref")||(t=Es++,e.attr("data-ref",t),Xt[t]={item:e,child:e.children(Xe),parent:e.parent(),ref:e.parent()[0]===Yt?null:e.parent().parent().attr("data-ref")}),e.addClass("mbsc-lv-item"),Ht.sortable.handle&&"list-divider"!=e.attr("data-role")&&!e.children(".mbsc-lv-handle-c").length&&e.append(Me),mt.enhance&&!e.hasClass("mbsc-lv-item-enhanced")){var s=e.attr("data-icon"),n=e.find("img").eq(0).addClass("mbsc-lv-img");n.is(":first-child")?e.addClass("mbsc-lv-img-"+(mt.rtl?"right":"left")):n.length&&e.addClass("mbsc-lv-img-"+(mt.rtl?"left":"right")),e.addClass("mbsc-lv-item-enhanced").children().each(function(e,t){t=Ms(t),t.is("p, h1, h2, h3, h4, h5, h6")&&t.addClass("mbsc-lv-txt")}),s&&e.addClass("mbsc-lv-item-ic-"+(e.attr("data-icon-align")||(mt.rtl?"right":"left"))).append('<div class="mbsc-lv-item-ic mbsc-ic mbsc-ic-'+s+'"></div>')}}function V(e){Ms(Re,e).not(".mbsc-lv-item").each(function(){S(Ms(this))}),Ms(Re+'[data-role="list-divider"]',e).removeClass("mbsc-lv-item").addClass("mbsc-lv-gr-title"),Ms(Xe,e).not(".mbsc-lv").addClass("mbsc-lv").prepend(Oe).parent().addClass("mbsc-lv-parent").prepend(Ie),Ms(".mbsc-lv-back",e).each(function(){Ms(this).attr("data-back",Ms(this).parent().parent().attr("data-ref"))})}function $(e){return e.children(Re).not(".mbsc-lv-back").not(".mbsc-lv-removed").not(".mbsc-lv-ph")}function A(e){return"object"!==("undefined"==typeof e?"undefined":z(e))&&(e=Ms(Re+'[data-id="'+e+'"]',J)),Ms(e)}function O(e){for(var t=0,s=Xt[e.attr("data-ref")];s&&s.ref;)t++,s=Xt[s.ref];return t}function I(e,t){for(e=e[t]();e.length&&(!e.hasClass("mbsc-lv-item")||e.hasClass("mbsc-lv-ph")||e.hasClass("mbsc-lv-item-dragging"));){if(!Ht.sortable.group&&e.hasClass("mbsc-lv-gr-title"))return!1;e=e[t]()}return e}function L(e){return(e>0?Vt.right:Vt.left).color||Fs}function E(e){return Ss.isNumeric(e)?e+"":0}function N(e,t){return+(t<0?E((e.actionsWidth||0).right)||E(e.actionsWidth)||E(mt.actionsWidth.right)||E(mt.actionsWidth):E((e.actionsWidth||0).left)||E(e.actionsWidth)||E(mt.actionsWidth.left)||E(mt.actionsWidth))}function H(e,t){if(e){var s=It.scrollTop(),n=e.is(".mbsc-lv-item")?e[0].offsetHeight:0,a=e.offset().top+(Te?s-Nt:0);t?(a<s||a+n>s+Lt)&&It.scrollTop(a):a<s?It.scrollTop(a):a+n>s+Lt&&It.scrollTop(Math.min(a,a+n-Lt/2))}}function Y(e,t,s,n,a){var i=t.parent(),r=t.prev();n=n||Ns,r[0]===Ee[0]&&(r=Ee.prev()),ee[0]!==t[0]?(ge("onNavStart",{level:Wt,direction:e,list:t[0]}),pt.prepend(t.addClass("mbsc-lv-v mbsc-lv-sl-new")),H(J),P(pt,"mbsc-lv-sl-"+e,function(){ee.removeClass("mbsc-lv-sl-curr"),t.removeClass("mbsc-lv-sl-new").addClass("mbsc-lv-sl-curr"),te&&te.length?ee.removeClass("mbsc-lv-v").insertAfter(te):se.append(ee.removeClass("mbsc-lv-v")),te=r,se=i,ee=t,H(s,a),n.call(Yt,s),ge("onNavEnd",{level:Wt,direction:e,list:t[0]})})):(H(s,a),n.call(Yt,s))}function F(e,t){Pt||(e.hasClass("mbsc-lv-parent")?(Wt++,Y("r",Xt[e.attr("data-ref")].child,null,t)):e.hasClass("mbsc-lv-back")&&(Wt--,Y("l",Xt[e.attr("data-back")].parent,Xt[e.attr("data-back")].item,t)))}function P(e,t,s){function n(){clearTimeout(a),Pt--,e.off(Ls,n).removeClass(t),s.call(Yt,e)}var a;s=s||Ns,mt.animation&&"mbsc-lv-item-none"!==t?(Pt++,e.on(Ls,n).addClass(t),a=setTimeout(n,500)):s.call(Yt,e)}function W(e,t){var s,n=e.attr("data-ref");s=qt[n]=qt[n]||[],t&&s.push(t),e.attr("data-action")||(t=s.shift(),e.attr("data-action",1),t(function(){e.removeAttr("data-action"),s.length?W(e):delete qt[n]}))}function R(e,t,s){var n,a;e&&e.length&&(n=100/(e.length+2),Ms.each(e,function(i,r){void 0===r.key&&(r.key=vt++),void 0===r.percent&&(r.percent=t*n*(i+1),s&&(a=Ds({},r),a.key=vt++,a.percent=-n*(i+1),e.push(a),jt[a.key]=a)),jt[r.key]=r}))}var j,q,X,B,K,G,Z,J,Q,ee,te,se,ne,ae,ie,re,oe,le,ce,de,ue,me,he,fe,pe,ve,be,ge,ye,xe,we,_e,Ce,Te,Me,De,ke,Se,Ve,$e,Ae,Oe,Ie,Le,Ee,Ne,He,Ye,Fe,Pe,We,Re,je,qe,Xe,Be,Ue,ze,Ke,Ge,Ze,Je,Qe,et,tt,st,nt,at,it,rt,ot,lt,ct,dt,ut,mt,ht,ft,pt,vt,bt,gt,yt,xt,wt,_t,Ct,Tt,Mt,Dt,kt,St,Vt,$t,At,Ot,It,Lt,Et,Nt,Ht=this,Yt=e,Ft=Ms(Yt),Pt=0,Wt=0,Rt=0,jt={},qt={},Xt={};ks.Base.call(this,e,t,!0),Ht.animate=function(e,t,s){P(e,"mbsc-lv-item-"+t,s)},Ht.add=function(e,t,s,n,a,i){var r,o,l,c,d,u,m="",h=void 0===a?Ft:A(a),f=h,p="object"!==("undefined"==typeof t?"undefined":z(t))?Ms("<"+We+' data-ref="'+Es++ +'" data-id="'+e+'">'+t+"</"+We+">"):t,v=p.attr("data-pos")<0?"left":"right",b=p.attr("data-ref");n=n||Ns,b||(b=Es++,p.addClass("mbsc-lv-item").attr("data-ref",b)),S(p),i||Ht.addUndoAction(function(e){c?Ht.navigate(h,function(){f.remove(),h.removeClass("mbsc-lv-parent").children(".mbsc-lv-arr").remove(),d.child=h.children(Xe),Ht.remove(p,null,e,!0)}):Ht.remove(p,null,e,!0)},!0),W(p,function(e){D(p.css("top","").removeClass("mbsc-lv-item-undo")),h.is(Re)?(u=h.attr("data-ref"),h.children(Xe).length||(c=!0,h.append("<"+qe+"></"+qe+">"))):u=h.children(".mbsc-lv-back").attr("data-back"),d=Xt[u],d&&(d.child.length?f=d.child:(h.addClass("mbsc-lv-parent").prepend(Ie),f=h.children(Xe).prepend(Oe).addClass("mbsc-lv"),d.child=f,Ms(".mbsc-lv-back",h).attr("data-back",u))),Xt[b]={item:p,child:p.children(Xe),parent:f,ref:u},l=$(f),o=l.length,void 0!==s&&null!==s||(s=o),i&&(m="mbsc-lv-item-new-"+(i?v:"")),V(p.addClass(m)),s!==!1&&(o?s<o?p.insertBefore(l.eq(s)):p.insertAfter(l.eq(o-1)):(r=Ms(".mbsc-lv-back",f),r.length?p.insertAfter(r):f.append(p))),f.hasClass("mbsc-lv-v")?Ht.animate(p.height(p[0].offsetHeight),i&&At===b?"none":"expand",function(t){Ht.animate(t.height(""),i?"add-"+v:"pop-in",function(t){n.call(Yt,t.removeClass(m)),e()})}):(n.call(Yt,p.removeClass(m)),e()),J.trigger("mbsc-refresh"),ge("onItemAdd",{target:p[0]})})},Ht.swipe=function(e,t,n,a,i){e=A(e),Ye=e,oe=a,ft=!0,j=!0,n=void 0===n?300:n,ce=t>0?1:-1,s(),r(),x(e,t,n),clearTimeout(Mt),clearInterval(Tt),Tt=setInterval(function(){B=Ss.getPosition(e)/He*100,o()},10),Mt=setTimeout(function(){clearInterval(Tt),B=t,o(),l(i),oe=!1,ft=!1,j=!1},n)},Ht.openStage=function(e,t,s,n){jt[t]&&Ht.swipe(e,jt[t].percent,s,n)},Ht.openActions=function(e,t,s,n){e=A(e);var a=N($t[e.attr("data-type")||"defaults"],"left"==t?-1:1);Ht.swipe(e,"left"==t?-a:a,s,n)},Ht.close=function(e,t){Ht.swipe(e,0,t)},Ht.remove=function(e,t,s,n){var a,i,r;s=s||Ns,e=A(e),e.length&&(i=e.parent(),a=$(i).index(e),r=e[0].style,n||(e.attr("data-ref")===At&&(Ot=!0),Ht.addUndoAction(function(t){Ht.add(null,e,a,t,i,!0)},!0)),W(e,function(a){t=t||(e.attr("data-pos")<0?"left":"right"),i.hasClass("mbsc-lv-v")?Ht.animate(e.addClass("mbsc-lv-removed"),n?"pop-out":"remove-"+t,function(e){r.height=e[0].offsetHeight+"px",Ht.animate(e,"collapse",function(e){r.height="",D(e.removeClass("mbsc-lv-removed")),s.call(Yt,e)!==!1&&e.remove(),a()})}):(s.call(Yt,e)!==!1&&e.remove(),a()),ge("onItemRemove",{target:e[0]})}))},Ht.move=function(e,t,s,n,a,i){e=A(e),i||Ht.startActionTrack(),Ne.append(Ee),Ht.remove(e,s,null,i),Ht.add(null,e,t,n,a,i),i||Ht.endActionTrack()},Ht.navigate=function(e,t){var s,n;e=A(e),s=Xt[e.attr("data-ref")],n=O(e),s&&(Y(n>=Wt?"r":"l",s.parent,e,t,!0),Wt=n)},Ht._processSettings=function(){Ft.is("[mbsc-enhance]")&&(_e=!0,Ft.removeAttr("mbsc-enhance"))},Ht._init=function(){var e,t,s,r=Ft.find(Xe).length?"left":"right",o=0,l="",c="",d="";qe=mt.listNode,Xe=mt.listSelector,We=mt.itemNode,Re=mt.itemSelector,s=mt.sort||mt.sortable||!1,"group"===s&&(s={group:!1,multiLevel:!0}),s===!0&&(s={group:!0,multiLevel:!0,handle:mt.sortHandle}),s&&void 0===s.handle&&(s.handle=mt.sortHandle),s.handle&&(Ce=s.handle===!0?r:s.handle,Me='<div class="mbsc-lv-handle-c mbsc-lv-item-h-'+Ce+' mbsc-lv-handle"><div class="'+mt.handleClass+' mbsc-lv-handle-bar-c mbsc-lv-handle">'+mt.handleMarkup+"</div></div>"),Oe="<"+We+' class="mbsc-lv-item mbsc-lv-back">'+mt.backText+'<div class="mbsc-lv-arr mbsc-lv-ic mbsc-ic '+mt.leftArrowClass+'"></div></'+We+">",Ie='<div class="mbsc-lv-arr mbsc-lv-ic mbsc-ic '+mt.rightArrowClass+'"></div>',e="mbsc-lv-cont mbsc-lv-"+mt.theme+(mt.rtl?" mbsc-lv-rtl":"")+(mt.baseTheme?" mbsc-lv-"+mt.baseTheme:"")+(mt.animateIcons?" mbsc-lv-ic-anim":"")+(mt.striped?" mbsc-lv-alt-row":"")+(mt.fixedHeader?" mbsc-lv-has-fixed-header":"")+(s.handle?" mbsc-lv-handle-"+Ce:""),Ht.sortable=s||!1,J?(J.attr("class",e),s.handle&&Ms(".mbsc-lv-handle-c",Ft).remove(),Ms(Re+":not(.mbsc-lv-back)",Ft).removeClass("mbsc-lv-item")):(l+='<div class="mbsc-lv-multi-c"></div>',l+='<div class="mbsc-lv-ic-c"><div class="mbsc-lv-ic-s mbsc-lv-ic mbsc-ic mbsc-ic-none"></div><div class="mbsc-lv-ic-text"></div></div>',Ft.addClass("mbsc-lv mbsc-lv-v mbsc-lv-root").show(),Ne=Ms('<div class="mbsc-lv-stage-c">'+l+"</div>"),Ee=Ms(".mbsc-lv-ic-c",Ne),Ke=Ms(".mbsc-lv-multi-c",Ne),Le=Ms(".mbsc-lv-ic-s",Ne),kt=Ms(".mbsc-lv-ic-text",Ne),it=Ms("<"+We+' class="mbsc-lv-item mbsc-lv-ph"></'+We+">"),ye=Ms('<div class="mbsc-lv-fill-item"></div>'),J=Ms('<div class="'+e+'"><'+qe+' class="mbsc-lv mbsc-lv-dummy"></'+qe+'><div class="mbsc-lv-sl-c"></div></div>'),Te="body"!==mt.context,It=Ms(Te?mt.context:window),fe=Ms(".mbsc-lv-dummy",J),J.insertAfter(Ft),It.on("orientationchange resize",m),m(),J.on("touchstart mousedown",".mbsc-lv-item",n).on("touchmove",".mbsc-lv-item",a).on("touchend touchcancel",".mbsc-lv-item",i),Yt.addEventListener("click",h,!0),J.on("touchstart mousedown",".mbsc-lv-ic-m",function(e){oe||(e.stopPropagation(),e.preventDefault()),xt=As(e,"X"),wt=As(e,"Y")}).on("touchend mouseup",".mbsc-lv-ic-m",function(e){oe||("touchend"===e.type&&Ss.preventClick(),Ts&&!Ms(this).hasClass("mbsc-lv-ic-disabled")&&Math.abs(As(e,"X")-xt)<10&&Math.abs(As(e,"Y")-wt)<10&&v((B<0?Vt.rightMenu:Vt.leftMenu)[Ms(this).index()],G,Z))}),pt=Ms(".mbsc-lv-sl-c",J).append(Ft.addClass("mbsc-lv-sl-curr")).attr("data-ref",Es++),ee=Ft,se=J),V(Ft),vt=0,$t=mt.itemGroups||{},$t.defaults={swipeleft:mt.swipeleft,swiperight:mt.swiperight,stages:mt.stages,actions:mt.actions,actionsWidth:mt.actionsWidth},Ms.each($t,function(e,t){if(t.swipe=void 0!==t.swipe?t.swipe:mt.swipe,t.stages=t.stages||[],R(t.stages,1,!0),R(t.stages.left,1),R(t.stages.right,-1),(t.stages.left||t.stages.right)&&(t.stages=[].concat(t.stages.left||[],t.stages.right||[])),xe=!1,t.stages.length||(t.swipeleft&&t.stages.push({percent:-30,action:t.swipeleft}),t.swiperight&&t.stages.push({percent:30,action:t.swiperight})),Ms.each(t.stages,function(e,t){if(0===t.percent)return xe=!0,!1}),xe||t.stages.push({percent:0}),t.stages.sort(function(e,t){return e.percent-t.percent}),Ms.each(t.stages,function(e,s){if(0===s.percent)return t.start=e,!1}),xe?t.left=t.right=t.stages[t.start]:(t.left=t.stages[t.start-1]||{},t.right=t.stages[t.start+1]||{}),t.actions){for(t.leftMenu=t.actions.left||t.actions,t.rightMenu=t.actions.right||t.leftMenu,c="",d="",o=0;o<t.leftMenu.length;o++)c+="<div "+(t.leftMenu[o].color?'style="background-color: '+t.leftMenu[o].color+'"':"")+' class="mbsc-lv-ic-m mbsc-lv-ic mbsc-ic mbsc-ic-'+t.leftMenu[o].icon+'">'+(t.leftMenu[o].text||"")+"</div>";for(o=0;o<t.rightMenu.length;++o)d+="<div "+(t.rightMenu[o].color?'style="background-color: '+t.rightMenu[o].color+'"':"")+' class="mbsc-lv-ic-m mbsc-lv-ic mbsc-ic mbsc-ic-'+t.rightMenu[o].icon+'">'+(t.rightMenu[o].text||"")+"</div>";t.actions.left&&(t.swipe=t.actions.right?t.swipe:"right"),t.actions.right&&(t.swipe=t.actions.left?t.swipe:"left"),t.icons='<div class="mbsc-lv-multi mbsc-lv-multi-ic-left">'+c+'</div><div class="mbsc-lv-multi mbsc-lv-multi-ic-right">'+d+"</div>"}}),mt.fixedHeader&&(t="mbsc-lv-fixed-header"+(Te?" mbsc-lv-fixed-header-ctx mbsc-lv-"+mt.theme+(mt.baseTheme?" mbsc-lv-"+mt.baseTheme:""):""),we?we.attr("class",t):(we=Ms('<div class="'+t+'"></div>'),Te?It.before(we):J.prepend(we),et=Ss.throttle(f,200),It.on("scroll touchmove",et))),mt.hover&&(Ve||J.on("mouseover.mbsc-lv",".mbsc-lv-item",function(){ke&&ke[0]==this||(u(),ke=Ms(this),$t[ke.attr("data-type")||"defaults"].actions&&(Ae=setTimeout(function(){st?ke=null:(Se=!0,Ht.openActions(ke,De,Ve,!1))},$e)))}).on("mouseleave.mbsc-lv",u),Ve=mt.hover.time||200,$e=mt.hover.timeout||200,De=mt.hover.direction||mt.hover||"right"),_e&&J.attr("mbsc-enhance",""),J.trigger("mbsc-enhance",[{theme:mt.theme,lang:mt.lang}])},Ht._destroy=function(){var e;se.append(ee),Te&&we&&we.remove(),_e&&(Ft.attr("mbsc-enhance",""),e=U.instances[J[0].id],e&&e.destroy()),Yt.removeEventListener("click",h,!0),J.find(".mbsc-lv-txt,.mbsc-lv-img").removeClass("mbsc-lv-txt mbsc-lv-img"),J.find(Xe).removeClass("mbsc-lv mbsc-lv-v mbsc-lv-root mbsc-lv-sl-curr").find(Re).removeClass("mbsc-lv-gr-title mbsc-lv-item mbsc-lv-item-enhanced mbsc-lv-parent mbsc-lv-img-left mbsc-lv-img-right mbsc-lv-item-ic-left mbsc-lv-item-ic-right").removeAttr("data-ref"),Ms(".mbsc-lv-back,.mbsc-lv-handle-c,.mbsc-lv-arr,.mbsc-lv-item-ic",J).remove(),Ft.insertAfter(J),J.remove(),Ne.remove(),It.off("orientationchange resize",m),et&&It.off("scroll touchmove",et)};var Bt,Ut=[],zt=[],Kt=[],Gt=0;Ht.startActionTrack=function(){Gt||(Kt=[]),Gt++},Ht.endActionTrack=function(){Gt--,Gt||zt.push(Kt)},Ht.addUndoAction=function(e,t){var s={action:e,async:t};Gt?Kt.push(s):(zt.push([s]),zt.length>mt.undoLimit&&zt.shift())},Ht.undo=function(){function e(){n<0?(Bt=!1,t()):(s=a[n],n--,s.async?s.action(e):(s.action(),e()))}function t(){a=Ut.shift(),a&&(Bt=!0,n=a.length-1,e())}var s,n,a;zt.length&&Ut.push(zt.pop()),Bt||t()},mt=Ht.settings,ge=Ht.trigger,Ht.init(t)};Ps.prototype={_class:"listview",_hasDef:!0,_hasTheme:!0,_hasLang:!0,_defaults:{context:"body",actionsWidth:90,sortDelay:250,undoLimit:10,swipe:!0,quickSwipe:!0,animateIcons:!0,animation:!0,revert:!0,vibrate:!0,handleClass:"",handleMarkup:'<div class="mbsc-lv-handle-bar mbsc-lv-handle"></div><div class="mbsc-lv-handle-bar mbsc-lv-handle"></div><div class="mbsc-lv-handle-bar mbsc-lv-handle"></div>',listNode:"ul",listSelector:"ul,ol",itemNode:"li",itemSelector:"li",leftArrowClass:"mbsc-ic-arrow-left4",rightArrowClass:"mbsc-ic-arrow-right4",backText:"Back",undoText:"Undo",stages:[]}},ks.ListView=Ps,U.themes.listview.mobiscroll={leftArrowClass:"mbsc-ic-arrow-left5",rightArrowClass:"mbsc-ic-arrow-right5"},U.presetShort("listview","ListView"),function(t){function s(e,t,s){var n;return e=i(i.parseHTML?i.parseHTML(e):e),1==e.length&&e.is("li")||i(e[0]).is("li")?(n=e.clone(),i(n[0]).attr("ng-repeat-start","item in "+t),i(n).filter("li").eq(-1).attr("ng-repeat-end","").attr("mobiscroll-listview-item",s)):(n=i("<li></li>").append(e.clone()),n.attr("ng-repeat","item in "+t).attr("mobiscroll-listview-item",s)),n}function n(e){var t,s=0;if(!e)return s;for(t=0;t<e.length;t++)s++,e[t].children&&e[t].children.length&&(s+=n(e[t].children));return s}var a,i=U.$,r=+new Date,o=[],l={},c={};try{a=e.module("ngAnimate")}catch(e){}a&&o.push("ngAnimate"),e.module("mobiscroll-listview",o).directive("mobiscrollListviewItem",["$compile","$timeout",function(e,s){return{link:function(n,a,r){var o,c,d,u=i(a[0]),m=u.parent("ul"),h=r.mobiscrollListviewItem,f=l[h],p=u.parents(".mbsc-lv-cont").length;f.nodesLeft--,m&&(p||0===f.nodesLeft)&&(p?(c=m.children("li").not(".mbsc-lv-back").index(u),u.addClass("mbsc-lv-item").hide(),s(m.hasClass("mbsc-lv-root")?function(){o=U.instances[m[0].id],o.add(null,u.show(),c,t,m)}:function(){m.prepend(m.children(".mbsc-lv-back")),d=m.parent("li"),o=U.instances[f.rootNode[0].id],o.add(null,u.show(),c,t,d.length?d:m)})):n.$emit("mbscLvLastItemAdded",f.rootNode)),u.append(e('<div style="display:none;"><ul><li mobiscroll-listview-hitem="'+h+'" ng-repeat="item in item.children"></li></ul></div>')(n)[0])}}}]).directive("mobiscrollListviewHitem",["$compile","$timeout",function(e){return{link:function(t,n,a){var r=i(n[0]),o=r.parent(),l=o.parent().hasClass("mbsc-lv-ng-init"),d=a.mobiscrollListviewHitem;o.children("li").not(".mbsc-lv-back").length<=1&&!l&&o.parent().addClass("mbsc-lv-ng-init").parent().append(e(i("<ul></ul>").append(s(c[d],"item.children",d)))(t.$parent)[0]),t.$on("$destroy",function(){o&&(o.children("li").length||(o=o.parent().parent().children("ul"),o.remove()))})}}}]).directive("mobiscrollListview",["$compile","$parse","$timeout",function(e,t,a){return{restrict:"A",require:"?ngModel",compile:function(o){var d,u=r++,m=o.html().replace(/(mbsc-ng-)|(ms-ng-)/g,"ng-").trim();return function(r,o,h,f){var p,v,b,g=i(o[0]);f||h.mobiscrollData?(p=r.$eval(h.mobiscrollListview||"{}"),b=h.mobiscrollData||h.ngModel):(p=r.$eval(h.mobiscrollOptions||"{}"),b=h.mobiscrollListview);var y=n(r.$eval(b));l[u]={rootNode:g,allNodes:y,nodesLeft:y},c[u]=m,d=i("<div></div>").append(s(m,b,u)),g.empty().append(i(e(d)(r)[0]).contents()),r.$on("mbscLvLastItemAdded",function(e,s){g[0]==s[0]&&a(function(){v=new U.classes.ListView(g[0],p),h.mobiscrollInstance&&t(h.mobiscrollInstance).assign(r,v)})}),r.$on("$destroy",function(){v&&(v.destroy(),v=null)}),0===y&&r.$emit("mbscLvLastItemAdded",g)}}}}]),a&&e.module("mobiscroll-listview").animation(".mbsc-lv-item",function(){return{leave:function(e,s){var n=i(e[0]),a=U.instances[n.closest(".mbsc-lv-cont").find(".mbsc-lv-root")[0].id];a.remove(n,t,s)}}})}();var Ws=U.$,Rs={batch:50,min:0,max:100,defaultUnit:"",units:null,unitNames:null,invalid:[],sign:!1,step:.05,scale:2,convert:function(e){return e},signText:"&nbsp;",wholeText:"Whole",fractionText:"Fraction",unitText:"Unit"};U.presets.scroller.measurement=function(e){function t(e){return Math.max(y,Math.min(x,H?e<0?Math.ceil(e):Math.floor(e):i(Math.round(e-j),W)+j))}function s(e){return H?i((Math.abs(e)-Math.abs(t(e)))*P-q,W)+q:0}function n(e){var n=t(e),a=s(e),i=e<0?"-":"+";return a>=P&&(e<0?n--:n++,a=0),[i,n,a]}function a(e){var t=+e[p],s=H?e[f]/P*(t<0?-1:1):0;return(I&&"-"==e[0]?-1:1)*(t+s)}function i(e,t){return Math.round(e/t)*t}function r(e,t){for(e+="";e.length<t;)e="0"+e;return e}function o(e,t,s){return t!==s&&D.convert?D.convert.call(this,e,t,s):e}function l(e,t,s){return e=e>s?s:e,e=e<t?t:e}function c(e){var t,n;b=o(D.min,E,e),g=o(D.max,E,e),H?(y=b<0?Math.ceil(b):Math.floor(b),x=g<0?Math.ceil(g):Math.floor(g),w=s(b),_=s(g)):(y=Math.round(b),x=Math.round(g),x=y+Math.floor((x-y)/W)*W,j=y%W),t=y,n=x,I&&(n=Math.abs(t)>Math.abs(n)?Math.abs(t):Math.abs(n),t=t<0?0:t),$.min=t<0?Math.ceil(t/Y):Math.floor(t/Y),$.max=n<0?Math.ceil(n/Y):Math.floor(n/Y)}function d(e){return a(e).toFixed(H?F:0)+(L?" "+N[e[v]]:"")}var u,m,h,f,p,v,b,g,y,x,w,_,C,T,M=Ws.extend({},e.settings),D=Ws.extend(e.settings,Rs,M),k={},S=[[]],V={},$={},A={},O=[],I=D.sign,L=D.units&&D.units.length,E=L?D.defaultUnit||D.units[0]:"",N=[],H=D.step<1,Y=D.step>1?D.step:1,F=H?Math.max(D.scale,(D.step+"").split(".")[1].length):1,P=Math.pow(10,F),W=Math.round(H?D.step*P:D.step),R=-1,j=0,q=0,X=0;if(e.setVal=function(t,s,n,a,i){e._setVal(Ws.isArray(t)?d(t):t,s,n,a,i)},D.units)for(T=0;T<D.units.length;++T)C=D.units[T],N.push(D.unitNames?D.unitNames[C]||C:C);if(I)if(I=!1,L)for(T=0;T<D.units.length;T++)o(D.min,E,D.units[T])<0&&(I=!0);else I=D.min<0;if(I&&(S[0].push({data:["-","+"],label:D.signText}),R=X++),$={label:D.wholeText,data:function(e){return y%Y+e*Y},getIndex:function(e){return Math.round((e-y%Y)/Y)}},S[0].push($),p=X++,c(E),H){for(S[0].push(A),A.data=[],A.label=D.fractionText,T=q;T<P;T+=W)O.push(T),A.data.push({value:T,display:"."+r(T,F)});f=X++,u=Math.ceil(100/W),D.invalid&&D.invalid.length&&(Ws.each(D.invalid,function(e,t){var s=t>0?Math.floor(t):Math.ceil(t);0===s&&(s=t<=0?-.001:.001),V[s]=(V[s]||0)+1,0===t&&(s=.001,V[s]=(V[s]||0)+1)}),Ws.each(V,function(e,t){t<u?delete V[e]:V[e]=e}))}if(L){for(k={data:[],label:D.unitText,cssClass:"mbsc-msr-whl-unit",circular:!1},T=0;T<D.units.length;T++)k.data.push({value:T,display:N[T]});S[0].push(k)}return v=X,{wheels:S,minWidth:I&&H?70:80,showLabel:!1,formatValue:d,compClass:"mbsc-msr",parseValue:function(e){var t,s=("number"==typeof e?e+"":e)||D.defaultValue,a=(s+"").split(" "),i=+a[0],r=[],o="";return L&&(o=Ws.inArray(a[1],N),o=o==-1?Ws.inArray(E,D.units):o,o=o==-1?0:o),h=L?D.units[o]:"",c(h),i=isNaN(i)?0:i,i=l(i,b,g),t=n(i),t[1]=l(t[1],y,x),m=i,I&&(r[0]=t[0],t[1]=Math.abs(t[1])),r[p]=t[1],H&&(r[f]=t[2]),L&&(r[v]=o),r},onCancel:function(){m=void 0},validate:function(t){var s,r,d,u,C,T=t.values,M=t.index,k=t.direction,S={},A=[],N={},F=L?D.units[T[v]]:"";if(I&&0===M&&(m=Math.abs(m)*("-"==T[0]?-1:1)),(M===p||M===f&&H||void 0===m||void 0===M)&&(m=a(T),h=F),(L&&M===v&&h!==F||void 0===M)&&(c(F),m=o(m,h,F),h=F,r=n(m),void 0!==M&&(N[p]=$,e.changeWheel(N)),I&&(T[0]=r[0])),A[p]=[],I)for(A[0]=[],b>0&&(A[0].push("-"),T[0]="+"),g<0&&(A[0].push("+"),T[0]="-"),C=Math.abs("-"==T[0]?y:x),X=C+Y;X<C+20*Y;X+=Y)A[p].push(X),S[X]=!0;if(m=l(m,b,g),r=n(m),d=I?Math.abs(r[1]):r[1],s=I?"-"==T[0]:m<0,T[p]=d,s&&(r[0]="-"),H&&(T[f]=r[2]),Ws.each(H?V:D.invalid,function(e,t){if(I&&s){if(!(t<=0))return;t=Math.abs(t)}t=i(o(t,E,F),H?1:W),S[t]=!0,A[p].push(t)}),T[p]=e.getValidValue(p,d,k,S),r[1]=T[p]*(I&&s?-1:1),H){A[f]=[];var P=I?T[0]+T[1]:(m<0?"-":"+")+Math.abs(r[1]),R=(b<0?"-":"+")+Math.abs(y),j=(g<0?"-":"+")+Math.abs(x);P===R&&Ws(O).each(function(e,t){(s?t>w:t<w)&&A[f].push(t)}),P===j&&Ws(O).each(function(e,t){(s?t<_:t>_)&&A[f].push(t)}),Ws.each(D.invalid,function(e,t){u=n(o(t,E,F)),(r[0]===u[0]||0===r[1]&&0===u[1]&&0===u[2])&&r[1]===u[1]&&A[f].push(u[2])})}return{disabled:A,valid:T}}}},U.presetShort("measurement"),U.presets.scroller.number=U.presets.scroller.measurement,U.presetShort("number"),e.module("mobiscroll-number",[]).directive("mobiscrollNumber",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollNumber",{preset:"number"})}]);var js=U.$,qs=U.util,Xs=U.presets.numpad,Bs=qs.testTouch,Us=qs.getCoord,zs=qs.isNumeric,Ks=function(){},Gs=function(e,t,s){function n(t){var s,n=g.validate.call(e,{values:S.slice(0),variables:H},L)||[],i=n&&n.disabled||[];if(L._isValid=!n.invalid,L._tempValue=g.formatValue.call(e,S.slice(0),H,L),b=S.length,V=n.length||A,L._isVisible){if(js(".mbsc-np-ph",f).each(function(e){js(this).html("ltr"==g.fill?e>=b?v:y||S[e]:e>=A-V?e+b<A?v:y||S[e+b-A]:"")}),js(".mbsc-np-cph",f).each(function(){js(this).html(H[js(this).attr("data-var")]||js(this).attr("data-ph"))}),b===A)for(s=0;s<=9;s++)i.push(s);for(js(".mbsc-np-btn",f).removeClass(p),s=0;s<i.length;s++)js('.mbsc-np-btn[data-val="'+i[s]+'"]',f).addClass(p);L._isValid?js(".mbsc-fr-btn-s .mbsc-fr-btn",f).removeClass(p):js(".mbsc-fr-btn-s .mbsc-fr-btn",f).addClass(p),L.live&&(L._hasValue=t||L._hasValue,a(t,!1,t),t&&$("onSet",{valueText:L._value}))}}function a(e,t,s,a){t&&n(),a||(O=S.slice(0),Y=js.extend({},H),E=N.slice(0),L._value=L._hasValue?L._tempValue:null),e&&(L._isInput&&I.val(L._hasValue&&L._isValid?L._value:""),$("onFill",{valueText:L._hasValue?L._tempValue:"",change:s}),s&&(L._preventChange=!0,I.trigger("change")))}function i(e){var t,s,n=e||[],a=[];for(N=[],H={},t=0;t<n.length;t++)/:/.test(n[t])?(s=n[t].split(":"),H[s[0]]=s[1],N.push(s[0])):(a.push(n[t]),N.push("digit"));return a}function r(e,t){!(b||t||g.allowLeadingZero)||e.hasClass("mbsc-fr-btn-d")||e.hasClass("mbsc-np-btn-empty")||b<A&&(N.push("digit"),S.push(t),n(!0))}function o(e){var t,s,a=e.attr("data-val"),i="false"!==e.attr("data-track"),r=e.attr("data-var");if(!e.hasClass("mbsc-fr-btn-d")){if(r&&(s=r.split(":"),i&&N.push(s[0]),H[s[0]]=void 0===s[2]?s[1]:H[s[0]]==s[1]?s[2]:s[1]),a.length+b<=V)for(t=0;t<a.length;++t)s=zs(a[t])?+a[t]:a[t],(g.allowLeadingZero||b||s)&&(N.push("digit"),S.push(s),b=S.length);n(!0)}}function l(){var e,t,s=N.pop();if(b||"digit"!==s){if("digit"!==s&&H[s])for(delete H[s],t=N.slice(0),N=[],e=0;e<t.length;e++)t[e]!==s&&N.push(t[e]);else S.pop();n(!0)}}function c(e){D=!0,x=Us(e,"X"),w=Us(e,"Y"),clearInterval(k),clearTimeout(k),l(),k=setInterval(function(){l()},150)}function d(){clearInterval(k),D=!1}function u(e){Bs(e,this)&&(c(e),"mousedown"===e.type&&js(document).on("mousemove",m).on("mouseup",h))}function m(e){D&&(_=Us(e,"X"),C=Us(e,"Y"),T=_-x,M=C-w,(Math.abs(T)>7||Math.abs(M)>7)&&d())}function h(e){D&&(e.preventDefault(),d(),"mouseup"===e.type&&js(document).off("mousemove",m).off("mouseup",h))}var f,p,v,b,g,y,x,w,_,C,T,M,D,k,S,V,$,A,O,I=js(e),L=this,E=[],N=[],H={},Y={},F={107:"+",109:"-"},P={48:0,49:1,50:2,51:3,52:4,53:5,54:6,55:7,56:8,57:9,96:0,97:1,98:2,99:3,100:4,101:5,102:6,103:7,104:8,105:9};We.call(this,e,t,!0),L.setVal=L._setVal=function(t,s,n,r){L._hasValue=null!==t&&void 0!==t,S=i(js.isArray(t)?t.slice(0):g.parseValue.call(e,t,L)),a(s,!0,void 0===n?s:n,r)},L.getVal=L._getVal=function(e){return L._hasValue||e?L[e?"_tempValue":"_value"]:null},L.setArrayVal=L.setVal,L.getArrayVal=function(e){return e?S.slice(0):L._hasValue?O.slice(0):null},L._readValue=function(){var t=I.val()||"";""!==t&&(L._hasValue=!0),y?(H={},N=[],S=[]):(H=L._hasValue?Y:{},N=L._hasValue?E:[],S=L._hasValue&&O?O.slice(0):i(g.parseValue.call(e,t,L)),a(!1,!0))},L._fillValue=function(){L._hasValue=!0,a(!0,!1,!0)},L._generateContent=function(){var e,t,s,n=1,a="",i="";for(i+='<div class="mbsc-np-hdr"><div role="button" tabindex="0" aria-label="'+g.deleteText+'" class="mbsc-np-del mbsc-fr-btn-e mbsc-ic mbsc-ic-'+g.deleteIcon+'"></div><div class="mbsc-np-dsp">',a=g.template.replace(/d/g,'<span class="mbsc-np-ph">'+v+"</span>").replace(/&#100;/g,"d"),a=a.replace(/{([a-zA-Z0-9]*)\:?([a-zA-Z0-9\-\_]*)}/g,'<span class="mbsc-np-cph" data-var="$1" data-ph="$2">$2</span>'),i+=a,i+="</div></div>",i+='<div class="mbsc-np-tbl-c mbsc-w-p"><div class="mbsc-np-tbl">',e=0;e<4;e++){for(i+='<div class="mbsc-np-row">',t=0;t<3;t++)s=n,10==n||12==n?s="":11==n&&(s=0),i+=""===s?10==n&&g.leftKey?'<div role="button" tabindex="0" class="mbsc-np-btn mbsc-np-btn-custom mbsc-fr-btn-e" '+(g.leftKey.variable?'data-var="'+g.leftKey.variable+'"':"")+' data-val="'+(g.leftKey.value||"")+'" '+(void 0!==g.leftKey.track?' data-track="'+g.leftKey.track+'"':"")+">"+g.leftKey.text+"</div>":12==n&&g.rightKey?'<div role="button" tabindex="0" class="mbsc-np-btn mbsc-np-btn-custom mbsc-fr-btn-e" '+(g.rightKey.variable?'data-var="'+g.rightKey.variable+'"':"")+' data-val="'+(g.rightKey.value||"")+'" '+(void 0!==g.rightKey.track?' data-track="'+g.rightKey.track+'"':"")+" >"+g.rightKey.text+"</div>":'<div class="mbsc-np-btn mbsc-np-btn-empty"></div>':'<div tabindex="0" role="button" class="mbsc-np-btn mbsc-fr-btn-e" data-val="'+s+'">'+s+"</div>",n++;i+="</div>"}return i+="</div></div>"},L._markupReady=function(){f=L._markup,n()},L._attachEvents=function(e){e.on("keydown",function(t){var s;void 0!==F[t.keyCode]?(s=js('.mbsc-np-btn[data-var="sign:-:"]',e),s.length&&(H.sign=107==t.keyCode?"-":"",o(s))):void 0!==P[t.keyCode]?r(js('.mbsc-np-btn[data-val="'+P[t.keyCode]+'"]',e),P[t.keyCode]):8==t.keyCode&&(t.preventDefault(),l())}),L.tap(js(".mbsc-np-btn",e),function(){var e=js(this);e.hasClass("mbsc-np-btn-custom")?o(e):r(e,+e.attr("data-val"))},!1,30,!0),js(".mbsc-np-del",e).on("touchstart mousedown keydown",u).on("touchmove mousemove",m).on("keyup mouseup touchend",h)},L.__init=function(){g=L.settings,g.cssClass=(g.cssClass||"")+" mbsc-np",g.template=g.template.replace(/\\d/,"&#100;"),v=g.placeholder,A=(g.template.match(/d/g)||[]).length,p="mbsc-fr-btn-d "+(g.disabledClass||""),y=g.mask,$=L.trigger,y&&I.is("input")&&I.attr("type","password")},L._indexOf=function(e,t){var s;for(s=0;s<e.length;++s)if(e[s].toString()===t.toString())return s;return-1},s||L.init(t)};Gs.prototype={_hasDef:!0,_hasTheme:!0,_hasLang:!0,_hasPreset:!0,_class:"numpad",_defaults:js.extend({},We.prototype._defaults,{template:"dd.dd",placeholder:"0",deleteIcon:"backspace",allowLeadingZero:!1,headerText:!1,fill:"rtl",deleteText:"Delete",decimalSeparator:".",thousandsSeparator:",",validate:Ks,parseValue:Ks,formatValue:function(e,t,s){var n,a=1,i=s.settings,r=i.placeholder,o=i.template,l=e.length,c=o.length,d="";for(n=0;n<c;n++)"d"==o[c-n-1]?(d=a<=l?e[l-a]+d:r+d,a++):d=o[c-n-1]+d;return js.each(t,function(e,t){d=d.replace("{"+e+"}",t)}),js("<div>"+d+"</div>").text()}})},U.classes.Numpad=Gs,U.themes.numpad=U.themes.frame,U.presetShort("numpad","Numpad",!1);var Zs={min:0,max:99.99,scale:2,prefix:"",suffix:"",returnAffix:!1};Xs.decimal=function(e){function t(e,t){for(var s,n=e.slice(0),i=0;n.length;)i=10*i+n.shift();for(s=0;s<a.scale;s++)i/=10;return t?i*-1:i}function s(e){var s=t(e).toFixed(a.scale).replace(".",a.decimalSeparator).replace(/\B(?=(\d{3})+(?!\d))/g,a.thousandsSeparator);return s}var n=js.extend({},e.settings),a=js.extend(e.settings,Zs,n),i=a.min<0;
  return e.getVal=function(t){var s=e._getVal(t),n=(s+"").replace(a.decimalSeparator,".").replace(a.thousandsSeparator,"");return qs.isNumeric(n)?+n:s},{template:(i?"{sign}":"")+a.prefix.replace(/d/g,"\\d")+Array((Math.floor(Math.max(a.max,Math.abs(a.min)))+"").length+1).join("d")+(a.scale?"."+Array(a.scale+1).join("d"):"")+a.suffix.replace(/d/g,"\\d"),leftKey:i?{text:"-/+",variable:"sign:-:",track:!1}:void 0,parseValue:function(e){var t,s,n=e||a.defaultValue,i=[];if(n&&(n=(n+"").replace(a.decimalSeparator,".").replace(a.thousandsSeparator,""),s=n.match(/\d+\.?\d*/g)))for(s=(+s[0]).toFixed(a.scale),t=0;t<s.length;t++)"."!=s[t]&&(+s[t]?i.push(+s[t]):i.length&&i.push(0));return e<0&&i.push("sign:-"),i},formatValue:function(e,n){var i=s(e),r=t(e,n&&"-"==n.sign);return(r<0?"-":"")+(a.returnAffix?a.prefix+i+a.suffix:i)},validate:function(n){var i=n.values,r=s(i),o=t(i,n.variables&&"-"==n.variables.sign),l=[];return i.length||a.allowLeadingZero||l.push(0),e.isVisible()&&js(".mbsc-np-dsp",e._markup).html((n.variables.sign||"")+a.prefix+r+a.suffix),{disabled:l,invalid:o>a.max||o<a.min||!!a.invalid&&e._indexOf(a.invalid,o)!=-1}}}};var Js=["h","m","s"],Qs={min:0,max:362439,defaultValue:0,hourTextShort:"h",minuteTextShort:"m",secTextShort:"s"};Xs.timespan=function(e){function t(e){var t,s="",n=3600;return js(Js).each(function(i,r){t=Math.floor(e/n),e-=t*n,n/=60,(t>0||"s"==r&&!s)&&(s=s+(s?" ":"")+t+a[r])}),s}var s=js.extend({},e.settings),n=js.extend(e.settings,Qs,s),a={h:n.hourTextShort.replace(/d/g,"\\d"),m:n.minuteTextShort.replace(/d/g,"\\d"),s:n.secTextShort.replace(/d/g,"\\d")},i='d<span class="mbsc-np-sup mbsc-np-time">'+a.s+"</span>";return n.max>9&&(i="d"+i),n.max>99&&(i='<span class="mbsc-np-ts-m">'+(n.max>639?"d":"")+'d</span><span class="mbsc-np-sup mbsc-np-time">'+a.m+"</span>"+i),n.max>6039&&(i='<span class="mbsc-np-ts-h">'+(n.max>38439?"d":"")+'d</span><span class="mbsc-np-sup mbsc-np-time">'+a.h+"</span>"+i),e.setVal=function(s,n,a,i){return qs.isNumeric(s)&&(s=t(s)),e._setVal(s,n,a,i)},e.getVal=function(t){return e._hasValue||t?A(e.getArrayVal(t)):null},{template:i,parseValue:function(e){var s,i=e||t(n.defaultValue),r=[];return i&&js(Js).each(function(e,t){s=new RegExp("(\\d+)"+a[t],"gi").exec(i),s?(s=+s[1],s>9?(r.push(Math.floor(s/10)),r.push(s%10)):(r.length&&r.push(0),(s||r.length)&&r.push(s))):r.length&&(r.push(0),r.push(0))}),r},formatValue:function(e){return t(A(e))},validate:function(t){var s=t.values,a=A(s.slice(0)),i=[];return s.length||i.push(0),{disabled:i,invalid:a>n.max||a<n.min||!!n.invalid&&e._indexOf(n.invalid,+a)!=-1}}}};var en={timeFormat:"hh:ii A",amText:"am",pmText:"pm"};Xs.time=function(e){function t(e,t){var s,n="";for(s=0;s<e.length;++s)n+=e[s]+(s%2==(e.length%2==1?0:1)&&s!=e.length-1?":":"");return js.each(t,function(e,t){n+=" "+t}),n}function s(e){var t,s,n,o,l,v,b,g,y,x,w=[],_=2*i.length;if(c=_,e.length||(r&&(w.push(0),w.push(a.leftKey.value)),w.push(a.rightKey.value)),!r&&(_-e.length<2||1!=e[0]&&(e[0]>2||e[1]>3)&&_-e.length<=2)&&(w.push("30"),w.push("00")),(r?e[0]>1||e[1]>2:1!=e[0]&&(e[0]>2||e[1]>3))&&e[0]&&(e.unshift(0),c=_-1),e.length==_)for(t=0;t<=9;++t)w.push(t);else if(1==e.length&&r&&1==e[0]||e.length&&e.length%2===0||!r&&2==e[0]&&e[1]>3&&e.length%2==1)for(t=6;t<=9;++t)w.push(t);if(y=void 0!==e[1]?""+e[0]+e[1]:"",x=+h==+(void 0!==e[3]?""+e[2]+e[3]:""),a.invalid)for(t=0;t<a.invalid.length;++t)if(v=a.invalid[t].getHours(),b=a.invalid[t].getMinutes(),g=a.invalid[t].getSeconds(),v==+y){if(2==i.length&&(b<10?0:+(""+b)[0])==+e[2]){w.push(b<10?b:+(""+b)[1]);break}if((g<10?0:+(""+g)[0])==+e[4]){w.push(g<10?g:+(""+g)[1]);break}}if(a.min||a.max){if(s=+d==+y,n=+u==+y,l=n&&x,o=s&&x,0===e.length){for(t=r?2:d>19?d[0]:3;t<=(1==d[0]?9:d[0]-1);++t)w.push(t);if(d>=10&&(w.push(0),2==d[0]))for(t=3;t<=9;++t)w.push(t);if(u&&u<10||d&&d>=10)for(t=u&&u<10?+u[0]+1:0;t<(d&&d>=10?d[0]:10);++t)w.push(t)}if(1==e.length){if(0===e[0])for(t=0;t<d[0];++t)w.push(t);if(d&&0!==e[0]&&(r?1==e[0]:2==e[0]))for(t=r?3:4;t<=9;++t)w.push(t);if(e[0]==d[0])for(t=0;t<d[1];++t)w.push(t);if(e[0]==u[0]&&!r)for(t=+u[1]+1;t<=9;++t)w.push(t)}if(2==e.length&&(s||n))for(t=n?+h[0]+1:0;t<(s?+m[0]:10);++t)w.push(t);if(3==e.length&&(n&&e[2]==h[0]||s&&e[2]==m[0]))for(t=n&&e[2]==h[0]?+h[1]+1:0;t<(s&&e[2]==m[0]?+m[1]:10);++t)w.push(t);if(4==e.length&&(o||l))for(t=l?+p[0]+1:0;t<(o?+f[0]:10);++t)w.push(t);if(5==e.length&&(o&&e[4]==f[0]||l&&e[4]==p[0]))for(t=l&&e[4]==p[0]?+p[1]+1:0;t<(o&&e[4]==f[0]?+f[1]:10);++t)w.push(t)}return w}var n=js.extend({},e.settings),a=js.extend(e.settings,en,n),i=a.timeFormat.split(":"),r=a.timeFormat.match(/a/i),o=r?"a"==r[0]?a.amText:a.amText.toUpperCase():"",l=r?"a"==r[0]?a.pmText:a.pmText.toUpperCase():"",c=0,d=a.min?""+a.min.getHours():"",u=a.max?""+a.max.getHours():"",m=a.min?""+(a.min.getMinutes()<10?"0"+a.min.getMinutes():a.min.getMinutes()):"",h=a.max?""+(a.max.getMinutes()<10?"0"+a.max.getMinutes():a.max.getMinutes()):"",f=a.min?""+(a.min.getSeconds()<10?"0"+a.min.getSeconds():a.min.getSeconds()):"",p=a.max?""+(a.max.getSeconds()<10?"0"+a.max.getSeconds():a.max.getSeconds()):"";return a.min?a.min.setFullYear(2014,7,20):"",a.max?a.max.setFullYear(2014,7,20):"",{placeholder:"-",allowLeadingZero:!0,template:(3==i.length?"dd:dd:dd":2==i.length?"dd:dd":"dd")+(r?'<span class="mbsc-np-sup">{ampm:--}</span>':""),leftKey:r?{text:o,variable:"ampm:"+o,value:"00"}:{text:":00",value:"00"},rightKey:r?{text:l,variable:"ampm:"+l,value:"00"}:{text:":30",value:"30"},parseValue:function(e){var t,s,n=e||a.defaultValue,i=[];if(n){if(n+="",s=n.match(/\d/g))for(t=0;t<s.length;t++)i.push(+s[t]);r&&i.push("ampm:"+(n.match(new RegExp(a.pmText,"gi"))?l:o))}return i},formatValue:function(e,s){return t(e,s)},validate:function(n){var i=n.values,o=n.variables,l=t(i,o),d=i.length>=3?new Date(2014,7,20,""+i[0]+(i.length%2===0?i[1]:""),""+i[i.length%2===0?2:1]+i[i.length%2===0?3:2]):"";return{disabled:s(i),length:c,invalid:(r?!new RegExp("^(0?[1-9]|1[012])(:[0-5]\\d)?(:[0-5][0-9]) (?:"+a.amText+"|"+a.pmText+")$","i").test(l):!/^([0-1]?[0-9]|2[0-4]):([0-5][0-9])(:[0-5][0-9])?$/.test(l))||!!a.invalid&&e._indexOf(a.invalid,d)!=-1||!((!a.min||a.min<=d)&&(!a.max||d<=a.max))}}}};var tn={dateOrder:"mdy",dateFormat:"mm/dd/yy",delimiter:"/"};Xs.date=function(e){function t(e){return e%4===0&&e%100!==0||e%400===0}function s(e){var s,n,o,l,c,u=[],g=void 0!==e[a+3]?""+e[a]+e[a+1]+e[a+2]+e[a+3]:"",y=void 0!==e[i+1]?""+e[i]+e[i+1]:"",x=void 0!==e[r+1]?""+e[r]+e[r+1]:"",w=""+d.getMaxDayOfMonth(g||2012,y-1||0),_=v===g&&+m===+y,C=b===g&&+h===+y;if(d.invalid)for(s=0;s<d.invalid.length;++s){if(o=d.getYear(d.invalid[s]),l=d.getMonth(d.invalid[s]),c=d.getDay(d.invalid[s]),o==+g&&l+1==+y&&(c<10?0:+(""+c)[0])==+e[r]){u.push(c<10?c:+(""+c)[1]);break}if(l+1==+y&&c==+x&&(""+o).substring(0,3)==""+e[a]+e[a+1]+e[a+2]){u.push((""+o)[3]);break}if(o==+g&&c==+x&&(l<10?0:+(""+(l+1))[0])==+e[i]){u.push(l<10?l:+(""+(l+1))[1]);break}}if("31"!=x||e.length!=i&&e.length!=i+1||(1!=e[i]?u.push(2,4,6,9,11):u.push(1)),"30"==x&&0===e[i]&&e.length<=i+1&&u.push(2),e.length==i){for(s=b===g&&+h<10?1:2;s<=9;++s)u.push(s);v===g&&+m>=10&&u.push(0)}if(e.length==i+1){if(1==e[i]){for(s=b===g?+h[1]+1:3;s<=9;++s)u.push(s);if(v==g)for(s=0;s<+m[1];++s)u.push(s)}if(0===e[i]&&(u.push(0),b===g||v===g))for(s=b===g?+x>+p?+h:+h+1:0;s<=(v===g?+x<+f?+m-1:+m-1:9);++s)u.push(s)}if(e.length==r){for(s=C?(+p>10?+p[0]:0)+1:+w[0]+1;s<=9;++s)u.push(s);if(_)for(s=0;s<(+f<10?0:f[0]);++s)u.push(s)}if(e.length==r+1){if(e[r]>=3||"02"==y)for(s=+w[1]+1;s<=9;++s)u.push(s);if(C&&+p[0]==e[r])for(s=+p[1]+1;s<=9;++s)u.push(s);if(_&&f[0]==e[r])for(s=0;s<+f[1];++s)u.push(s);if(0===e[r]&&(u.push(0),C||_))for(s=C?+p+1:1;s<=(_?+f-1:9);++s)u.push(s)}if(void 0!==e[a+2]&&"02"==y&&"29"==x)for(n=+(""+e[a]+e[a+1]+e[a+2]+0);n<=+(""+e[a]+e[a+1]+e[a+2]+9);++n)u.push(t(n)?"":n%10);if(e.length==a){if(d.min)for(s=0;s<+v[0];++s)u.push(s);if(d.max)for(s=+b[0]+1;s<=9;++s)u.push(s);u.push(0)}if(d.min||d.max)for(n=1;n<4;++n)if(e.length==a+n){if(e[a+n-1]==+v[n-1]&&(3!=n||e[a+n-2]==+v[n-2]))for(s=0;s<+v[n]+(3==n&&e[i+1]&&+m>+y?1:0);++s)u.push(s);if(e[a+n-1]==+b[n-1]&&(3!=n||e[a+n-2]==+b[n-2]))for(s=+b[n]+(3==n&&+h<+y?0:1);s<=9;++s)u.push(s)}return u}function n(e){return new Date(+(""+e[a]+e[a+1]+e[a+2]+e[a+3]),+(""+e[i]+e[i+1])-1,+(""+e[r]+e[r+1]))}var a,i,r,o,l=[],c=js.extend({},e.settings),d=js.extend(e.settings,wt.defaults,tn,c),u=d.dateOrder,m=d.min?""+(d.getMonth(d.min)+1):0,h=d.max?""+(d.getMonth(d.max)+1):0,f=d.min?""+d.getDay(d.min):0,p=d.max?""+d.getDay(d.max):0,v=d.min?""+d.getYear(d.min):0,b=d.max?""+d.getYear(d.max):0;for(u=u.replace(/y+/gi,"yyyy"),u=u.replace(/m+/gi,"mm"),u=u.replace(/d+/gi,"dd"),a=u.toUpperCase().indexOf("Y"),i=u.toUpperCase().indexOf("M"),r=u.toUpperCase().indexOf("D"),u="",l.push({val:a,n:"yyyy"},{val:i,n:"mm"},{val:r,n:"dd"}),l.sort(function(e,t){return e.val-t.val}),js.each(l,function(e,t){u+=t.n}),a=u.indexOf("y"),i=u.indexOf("m"),r=u.indexOf("d"),u="",o=0;o<8;++o)u+="d",o+1!=a&&o+1!=i&&o+1!=r||(u+=d.delimiter);return e.getVal=function(t){return e._hasValue||t?n(e.getArrayVal(t)):null},{placeholder:"-",fill:"ltr",allowLeadingZero:!0,template:u,parseValue:function(e){var t,s=[],n=e||d.defaultValue,a=wt.parseDate(d.dateFormat,n,d);if(n)for(t=0;t<l.length;++t)s=/m/i.test(l[t].n)?s.concat(((d.getMonth(a)<9?"0":"")+(d.getMonth(a)+1)).split("")):/d/i.test(l[t].n)?s.concat(((d.getDay(a)<10?"0":"")+d.getDay(a)).split("")):s.concat((d.getYear(a)+"").split(""));return s},formatValue:function(e){return wt.formatDate(d.dateFormat,n(e),d)},validate:function(t){var a=t.values,i=n(a);return{disabled:s(a),invalid:!("Invalid Date"!=i&&(!d.min||d.min<=i)&&(!d.max||i<=d.max))||!!d.invalid&&e._indexOf(d.invalid,i)!=-1}}}},e.module("mobiscroll-numpad",[]).directive("mobiscrollNumpad",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollNumpad",{component:"Numpad"})}]);var sn=U.$,nn=sn.extend,an=U.classes,rn=1,on=function(e,t){function s(e){clearTimeout(w),w=setTimeout(function(){c("load"!==e.type)},200)}function n(e,t){if(e.length){var s=e.offset().left,n=e[0].offsetLeft,r=e[0].offsetWidth,o=u.offset().left;d=e,void 0===t&&(t=!y),C&&t&&(y?e.attr("data-selected")?i(e):a(e):(i(sn(".mbsc-ms-item-sel",L)),a(e))),_&&(n=S-n-r),"a"==D?s<o?M.scroll(_?n+r-v:-n,O,!0):s+r>o+v&&M.scroll(_?n:v-n-r,O,!0):M.scroll(v/2-n-r/2,O,!0),t&&$("onItemTap",{target:e[0]})}}function a(e){e.addClass(T).attr("data-selected","true").attr("aria-selected","true")}function i(e){e.removeClass(T).removeAttr("data-selected").removeAttr("aria-selected")}function r(e){return"object"!==("undefined"==typeof e?"undefined":z(e))&&(e=L.children('[data-id="'+e+'"]')),sn(e)}function o(){b&&"inline"!=b&&m.find(".mbsc-page").css("padding-"+b,"")}function l(){var e,t;L.find(".mbsc-ripple").remove(),L.children().each(function(s){var n,a=sn(this),i=C&&"true"==a.attr("data-selected"),r="true"==a.attr("data-disabled"),o=a.attr("data-icon"),l=a.attr("data-ref");l||(l=rn++),0===s&&(h=a),C&&!y&&i&&(d=a),o&&(e=!0),a.text()&&(t=!0),n="mbsc-ms-item "+(k.itemClass||"")+(k.tapHighlight?" mbsc-btn-e":"")+(i?T:"")+(r?" mbsc-btn-d "+(k.disabledClass||""):"")+(o?" mbsc-ms-ic mbsc-ic mbsc-ic-"+o:""),a.attr("data-ref",l).attr("data-role","button").attr("aria-selected",i?"true":"false").attr("aria-disabled",r?"true":"false").removeClass(A[l]).addClass(n),A[l]=n}),e?u.addClass("mbsc-ms-icons"):u.removeClass("mbsc-ms-icons"),t?u.addClass("mbsc-ms-txt"):u.removeClass("mbsc-ms-txt")}function c(t,s){var n=k.itemWidth,a=k.layout;I.contWidth=v=u.width(),t&&x===v||!v||(x=v,U.util.isNumeric(a)&&(g=v?v/a:n,g<n&&(a="liquid")),n&&("liquid"==a?g=v?v/Math.min(Math.floor(v/n),L.children().length):n:"fixed"==a&&(g=n)),g&&L.children().css("width",g+"px"),"inline"!=b&&m.find(".mbsc-page").css("padding-"+b,e.offsetHeight+"px"),I.totalWidth=S=e.offsetWidth,nn(M.settings,{contSize:v,maxSnapScroll:!!k.paging&&1,maxScroll:0,minScroll:S>v?v-S:0,snap:k.paging?v:!!k.snap&&(g||".mbsc-ms-item"),elastic:S>v&&(g||v)}),M.refresh(s))}var d,u,m,h,f,p,v,b,g,y,x,w,_,C,T,M,D,k,S,V,$,A={},O=1e3,I=this,L=sn(e);an.Base.call(this,e,t,!0),I.navigate=function(e,t){n(r(e),t)},I.next=function(e){var t=d?d.next():h;t.length&&(d=t,n(d,e))},I.prev=function(e){var t=d?d.prev():h;t.length&&(d=t,n(d,e))},I.select=function(e){y||i(sn(".mbsc-ms-item-sel",L)),a(r(e))},I.deselect=function(e){i(r(e))},I.enable=function(e){r(e).removeClass("mbsc-btn-d").removeAttr("data-disabled").removeAttr("aria-disabled")},I.disable=function(e){r(e).addClass("mbsc-btn-d").attr("data-disabled","true").attr("aria-disabled","true")},I.refresh=I.position=function(e){l(),c(!1,e)},I._init=function(){m=sn(k.context),f=sn("body"==k.context?window:k.context),"tabs"==k.type?(k.select=k.select||"single",k.variant=k.variant||"b"):"options"==k.type?(k.select=k.select||"multiple",k.variant=k.variant||"a"):"menu"==k.type&&(k.select=k.select||"off",k.variant=k.variant||"a"),k.itemWidth&&void 0===k.snap&&(k.snap=!0),o(),b=k.display,_=k.rtl,D=k.variant,C="off"!=k.select,y="multiple"==k.select,T=" mbsc-ms-item-sel "+(k.activeClass||""),p="mbsc-ms-c mbsc-no-touch mbsc-ms-"+D+" mbsc-ms-"+b+" mbsc-"+k.theme+" "+(k.baseTheme?" mbsc-"+k.baseTheme:"")+" "+(k.cssClass||"")+" "+(k.wrapperClass||"")+(_?" mbsc-ms-rtl":" mbsc-ms-ltr")+(k.itemWidth?" mbsc-ms-hasw":"")+("body"==k.context?"":" mbsc-ms-ctx")+(C?"":" mbsc-ms-nosel"),u?(u.attr("class",p),L.off(".mbsc-ripple")):(u=sn('<div class="'+p+'"><div class="mbsc-ms-sc"></div></div>').insertAfter(L),u.find(".mbsc-ms-sc").append(L),M=new nt(u[0],{axis:"X",contSize:0,maxScroll:0,maxSnapScroll:1,minScroll:0,snap:1,elastic:1,rtl:_,mousewheel:k.mousewheel,thresholdX:k.threshold,onStart:function(e){V||"touchstart"!=e.domEvent.type||(V=!0,m.find(".mbsc-no-touch").removeClass("mbsc-no-touch"))},onBtnTap:function(e){n(sn(e.target),!0)},onGestureStart:function(e){$("onGestureStart",e)},onGestureEnd:function(e){$("onGestureEnd",e)},onMove:function(e){$("onMove",e)},onAnimationStart:function(e){$("onAnimationStart",e)},onAnimationEnd:function(e){$("onAnimationEnd",e)}})),L.css("display","").addClass("mbsc-ms "+(k.groupClass||"")),l(),$("onMarkupReady",{target:u[0]}),c(),u.find("img").on("load",s),f.on("orientationchange resize",s)},I._destroy=function(){o(),f.off("orientationchange resize",s),L.removeClass("mbsc-ms mbsc-ms-a mbsc-ms-b").insertAfter(u).find(".mbsc-ms-item").each(function(){var e=sn(this);e.width("").removeClass(A[e.attr("data-ref")])}),u.remove(),M.destroy()},k=I.settings,$=I.trigger,I.init(t)};on.prototype={_class:"menustrip",_hasDef:!0,_hasTheme:!0,_hasLang:!0,_defaults:{context:"body",type:"options",display:"inline",layout:"liquid",tapHighlight:!0}},an.MenuStrip=on,U.presetShort("menustrip","MenuStrip"),function(){var t=U.$,s="mobiscrollMenustrip",n=["ng-repeat","ng:repeat","data-ng-repeat","x-ng-repeat","ng_repeat"];e.module("mobiscroll-menustrip",[]).directive("mobiscrollRepeatRender",function(){return function(e){e.$emit("mbscRepeatRender")}}).directive(s,["$parse","$timeout",function(e,a){var i=U.ng.getDDO(e,s,{component:"MenuStrip"},function(){},function(){});return i.compile=function(i){var r,o,l=t(i[0]);return l.find("li").each(function(){for(o=0;o<n.length;o++)if(t(this).attr(n[o]))return r=!0,!1}),r&&l.children().attr("mobiscroll-repeat-render",""),function(n,i,o){var l,c,d=t(i[0]),u=n.$eval(o[s]||"{}");r?n.$on("mbscRepeatRender",function(){clearTimeout(c),c=setTimeout(function(){l=new U.classes.MenuStrip(i[0],u),o.mobiscrollInstance&&e(o.mobiscrollInstance).assign(n,l)},1)}):d.children().length&&a(function(){l=new U.classes.MenuStrip(i[0],u),o.mobiscrollInstance&&e(o.mobiscrollInstance).assign(n,l)}),n.$on("$destroy",function(){l&&(l.destroy(),l=null)})}},i}])}();var ln=U.$,cn=function(e,t,s){function n(e){ln(".mbsc-fr-c",e).hasClass("mbsc-wdg-c")||(ln(".mbsc-fr-c",e).addClass("mbsc-wdg-c").append(o.show()),ln(".mbsc-w-p",e).length||ln(".mbsc-fr-c",e).addClass("mbsc-w-p"))}var a,i,r,o=ln(e),l=this;We.call(this,e,t,!0),l._generateContent=function(){return""},l._markupReady=function(e){"inline"!=a.display&&n(e)},l._markupInserted=function(e){"inline"==a.display&&n(e),e.trigger("mbsc-enhance",[{theme:a.theme,lang:a.lang}])},l._markupRemove=function(){o.hide(),i?i.prepend(o):r.after(o)},l.__processSettings=function(){a=l.settings,l.buttons.ok={text:a.okText,icon:a.okIcon,handler:"set"},a.buttons=a.buttons||("inline"==a.display?[]:["ok"]),i||r||(r=o.prev(),r.length||(i=o.parent())),o.hide()},l.__init=function(){a.cssClass=(a.cssClass||"")+" mbsc-wdg"},s||l.init(t)};cn.prototype={_hasDef:!0,_hasTheme:!0,_hasContent:!0,_class:"widget",_defaults:ln.extend({},We.prototype._defaults,{okText:"OK",headerText:!1})},U.classes.Widget=cn,U.themes.widget=U.themes.frame,U.presetShort("widget","Widget",!1),e.module("mobiscroll-widget",[]).directive("mobiscrollWidget",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollWidget",{component:"Widget"})}]);var dn=U.$,un=U.classes,mn=function(e,t){var s="",n=dn(e),a=this,i=a.settings;un.Base.call(this,e,t,!0),a._init=function(){var e=i.context,t=dn(e),a=t.find(".mbsc-ms-top .mbsc-ms"),r=t.find(".mbsc-ms-bottom .mbsc-ms"),o={};"body"==e?dn("body,html").addClass("mbsc-page-ctx"):t.addClass("mbsc-page-ctx"),s&&n.removeClass(s),a.length&&(o.paddingTop=a[0].offsetHeight),r.length&&(o.paddingBottom=r[0].offsetHeight),s="mbsc-page mbsc-"+i.theme+(i.baseTheme?" mbsc-"+i.baseTheme:"")+(i.rtl?" mbsc-rtl":" mbsc-ltr"),n.addClass(s).css(o)},a._destroy=function(){n.removeClass(s)},i=a.settings,a.init(t)};mn.prototype={_hasDef:!0,_hasTheme:!0,_hasLang:!0,_class:"page",_defaults:{context:"body"}},un.Page=mn,U.themes.page.mobiscroll={},U.presetShort("page","Page"),dn(function(){var e="[mbsc-page]";dn(e).each(function(){new un.Page(this)}),dn(document).on("mbsc-enhance",function(t,s){dn(t.target).is(e)?new un.Page(t.target,s):dn(e,t.target).each(function(){new un.Page(this,s)})})}),e.module("mobiscroll-page",[]).directive("mobiscrollPage",["$parse",function(e){return{restrict:"A",link:function(t,s,n){var a=new U.classes.Page(s[0],U.ng.getOpt(t,n,"mobiscrollPage",!0));n.mobiscrollInstance&&e(n.mobiscrollInstance).assign(t,a),t.$on("$destroy",function(){a.destroy()})}}}]);var hn=!!window.Promise,fn=[],pn=[],vn=U.$,bn=vn.extend;U.alert=function(e){var t=document.createElement("div");return t.innerHTML=E(e),W(N,t,e)},U.confirm=function(e){var t=document.createElement("div");return t.innerHTML=E(e),W(H,t,e)},U.prompt=function(e){var t=document.createElement("div");return t.innerHTML=E(e)+'<label class="mbsc-input">'+(e.label?'<span class="mbsc-label">'+e.label+"</span>":"")+'<input type="'+(e.inputType||"text")+'" placeholder="'+(e.placeholder||"")+'" value="'+(e.value||"")+'"></label>',W(Y,t,e)},U.snackbar=function(e){var t=document.createElement("div");return t.innerHTML='<div class="mbsc-snackbar-cont"><div class="mbsc-snackbar-msg">'+(e.message||"")+"</div>"+(e.button?'<button class="mbsc-snackbar-btn mbsc-btn mbsc-btn-flat">'+(e.button.text||"")+"</button>":"")+"</div>",W(F,t,e)},U.toast=function(e){var t=document.createElement("div");return t.innerHTML='<div class="mbsc-toast-msg">'+(e.message||"")+"</div>",W(P,t,e)};var gn=U.$,yn=gn.extend,xn=U.util,wn=xn.getCoord,_n=xn.testTouch,Cn=["touchstart","touchmove","touchend","touchcancel","mousedown","mousemove","mouseup","mouseleave"],Tn={tap:!0},Mn=void 0,Dn=function(){function e(t,s){var n=this;K(this,e);var a=yn({},Tn,s),i=gn(t),r=i.parent(),o=i.next().hasClass("mbsc-fr")?i.next():null,l=R(i);o&&o.insertAfter(r),x(r,l),i.addClass("mbsc-control"),Cn.forEach(function(e){t.addEventListener(e,n)}),this.settings=a,this._type=l,this._elm=t,this._$elm=i,this._$parent=r,this._$frame=o,this._ripple=j(a.theme)}return G(e,[{key:"destroy",value:function(){var e=this;this._$elm.removeClass("mbsc-control"),Cn.forEach(function(t){e._elm.removeEventListener(t,e)})}},{key:"option",value:function(e){yn(this.settings,e),this._ripple=j(this.settings.theme)}},{key:"handleEvent",value:function(e){switch(e.type){case"touchstart":case"mousedown":this._onStart(e);break;case"touchmove":case"mousemove":this._onMove(e);break;case"touchend":case"touchcancel":case"mouseup":case"mouseleave":this._onEnd(e)}}},{key:"_addRipple",value:function(e){this._ripple&&this._$rippleElm&&this._ripple.addRipple(this._$rippleElm,e)}},{key:"_removeRipple",value:function(){this._ripple&&this._$rippleElm&&this._ripple.removeRipple()}},{key:"_onStart",value:function(e){var t=this._elm;_n(e,t)&&(this._startX=wn(e,"X"),this._startY=wn(e,"Y"),Mn&&Mn.removeClass("mbsc-active"),t.disabled||(this._isActive=!0,Mn=this._$elm,Mn.addClass("mbsc-active"),this._addRipple(e)))}},{key:"_onMove",value:function(e){(this._isActive&&Math.abs(wn(e,"X")-this._startX)>9||Math.abs(wn(e,"Y")-this._startY)>9)&&(this._$elm.removeClass("mbsc-active"),this._removeRipple(),this._isActive=!1)}},{key:"_onEnd",value:function(e){var t=this,s=this._elm,n=this._type;if(this._isActive&&this.settings.tap&&"touchend"==e.type&&!s.readOnly&&(s.focus(),/(button|submit|checkbox|switch|radio)/.test(n)&&e.preventDefault(),!/select/.test(n))){var a=(e.originalEvent||e).changedTouches[0],i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!0,window,1,a.screenX,a.screenY,a.clientX,a.clientY,!1,!1,!1,!1,0,null),i.tap=!0,s.mbscChange=!0,s.dispatchEvent(i),xn.preventClick()}this._isActive&&setTimeout(function(){t._$elm.removeClass("mbsc-active"),t._removeRipple()},100),this._isActive=!1,Mn=null}}]),e}(),kn=function(e){function t(e){K(this,t);var s=Q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return y(s,s._$elm),s._$parent.addClass("mbsc-input"),s}return J(t,e),G(t,[{key:"destroy",value:function(){Z(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this),this._$parent.find(".mbsc-input-wrap").before(this._$elm).remove()}}]),t}(Dn),Sn=function(e){function t(e,s){K(this,t);var n=Q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,s)),a=n._$elm,i=a.attr("data-icon");return a.addClass("mbsc-btn").find(".mbsc-btn-ic").remove(),i&&(a.prepend('<span class="mbsc-btn-ic mbsc-ic mbsc-ic-'+i+'"></span>'),""===a.text()&&a.addClass("mbsc-btn-icon-only")),n._$rippleElm=a,n}return J(t,e),t}(Dn),Vn=function(e){function t(e){K(this,t);var s=Q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return s._$parent.prepend(s._$elm).addClass("mbsc-checkbox mbsc-control-w").find(".mbsc-checkbox-box").remove(),s._$elm.after('<span class="mbsc-checkbox-box"></span>'),s}return J(t,e),t}(Dn),$n=function(e){function t(e){K(this,t);var s=Q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return s._$parent.addClass("mbsc-radio mbsc-control-w").find(".mbsc-radio-box").remove(),s._$elm.after('<span class="mbsc-radio-box"><span></span></span>'),s}return J(t,e),t}(Dn),An=U.$,On=function(e){function t(e){K(this,t);var s=Q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=s._$elm,a=s._$parent,i=a.find("input.mbsc-control"),r=i.length?i:An('<input tabindex="-1" class="mbsc-control" readonly>');return s._$input=r,a.addClass("mbsc-select"+(s._$frame?" mbsc-select-inline":"")),n.after(r),r.after('<span class="mbsc-select-ic mbsc-ic mbsc-ic-arrow-down5"></span>'),r.hasClass("mbsc-comp")||(e.addEventListener("change",s),s._setText()),s}return J(t,e),G(t,[{key:"destroy",value:function(){Z(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this),this._$elm.after(this._$input),this._elm.removeEventListener("change",this)}},{key:"handleEvent",value:function(e){Z(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"handleEvent",this).call(this,e),"change"==e.type&&this._setText()}},{key:"_setText",value:function(){var e=this._elm;this._$input.val(e.selectedIndex!=-1?e.options[e.selectedIndex].text:"")}}]),t}(kn),In=U.$,Ln=["keydown","input","scroll"],En=void 0;In(window).on("resize orientationchange",q);var Nn=function(e){function t(e){K(this,t);var s=Q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return s._$parent.addClass("mbsc-textarea"),Ln.forEach(function(e){s._elm.addEventListener(e,s)}),X(e),s}return J(t,e),G(t,[{key:"destroy",value:function(){var e=this;Z(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this),Ln.forEach(function(t){e._elm.removeEventListener(t,e)})}},{key:"handleEvent",value:function(e){switch(Z(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"handleEvent",this).call(this,e),e.type){case"keydown":case"input":this._onInput(e);break;case"scroll":B(this._elm)}}},{key:"_onInput",value:function(){var e=this;clearTimeout(this._debounce),this._debounce=setTimeout(function(){X(e._elm)},100)}}]),t}(kn),Hn=U.$,Yn=function(e){function t(e,s){K(this,t);var n=Q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,s)),a=void 0,i=void 0,r=n._$elm,o=n._$parent;return o.hasClass("mbsc-segmented-item")||(a=Hn('<div class="mbsc-segmented"></div>'),o.after(a),o.parent().find('input[name="'+r.attr("name")+'"]').each(function(){var e=Hn(this);i=e.parent().addClass("mbsc-segmented-item"),Hn('<span class="mbsc-segmented-content">'+(e.attr("data-icon")?' <span class="mbsc-ic mbsc-ic-'+e.attr("data-icon")+'"></span> ':"")+"</span>").append(i.contents()).appendTo(i),i.prepend(e),a.append(i)})),n._$rippleElm=r.next(),n}return J(t,e),t}(Dn),Fn=U.$,Pn=U.util,Wn=Pn.getCoord,Rn=Pn.testTouch,jn=function(e,t){function s(t){32==t.keyCode&&(t.preventDefault(),v||e.disabled||(m=Fn(this).addClass("mbsc-active"),c(t)))}function n(e){v&&(e.preventDefault(),d(!0))}function a(t){Rn(t,this)&&!e.disabled&&(m=Fn(this).addClass("mbsc-active").trigger("focus"),D&&!m.hasClass("mbsc-step-disabled")&&D.addRipple(m.find(".mbsc-segmented-content"),t),c(t),"mousedown"===t.type&&Fn(document).on("mousemove",r).on("mouseup",i))}function i(e){v&&(e.preventDefault(),d(!0,e),"mouseup"===e.type&&Fn(document).off("mousemove",r).off("mouseup",i))}function r(e){v&&(w=Wn(e,"X"),_=Wn(e,"Y"),g=w-V,y=_-$,(Math.abs(g)>7||Math.abs(y)>7)&&d())}function o(){var t;e.disabled||(t=parseFloat(Fn(this).val()),l(isNaN(t)?O:t))}function l(e,t,s){H=O,void 0===t&&(t=!0),void 0===s&&(s=t),O=void 0!==e?Math.min(T,Math.max(Math.round(e/k)*k,M)):Math.min(T,Math.max(O+(m.hasClass("mbsc-stepper-minus")?-k:k),M)),b=!0,p.removeClass("mbsc-step-disabled"),t&&N.val(O),O==M?f.addClass("mbsc-step-disabled"):O==T&&h.addClass("mbsc-step-disabled"),O!==H&&s&&N.trigger("change")}function c(e){v||(v=!0,b=!1,V=Wn(e,"X"),$=Wn(e,"Y"),clearInterval(C),clearTimeout(C),C=setTimeout(function(){l(),C=setInterval(function(){l()},150)},300))}function d(e){clearInterval(C),clearTimeout(C),!b&&e&&l(),v=!1,b=!1,m.removeClass("mbsc-active"),D&&setTimeout(function(){D.removeRipple()},100)}function u(e,t){var s=N.attr(e);return void 0===s||""===s?t:+s}var m,h,f,p,v,b,g,y,x,w,_,C,T,M,D,k,S,V,$,A,O,I,L,E=this,N=Fn(e),H=O;U.classes.Base.call(this,e,t,!0),E.getVal=function(){var e=parseFloat(N.val());return e=isNaN(e)?O:e,Math.min(T,Math.max(Math.round(e/k)*k,M))},E.setVal=function(e,t,s){e=parseFloat(e),l(isNaN(e)?O:e,t,s)},E._init=function(l){I=N.parent().hasClass("mbsc-stepper"),L=I?N.closest(".mbsc-stepper-cont"):N.parent(),S=E.settings,M=void 0===l.min?u("min",S.min):l.min,T=void 0===l.max?u("max",S.max):l.max,k=void 0===l.step?u("step",S.step):l.step,x=N.attr("data-val")||S.val,O=Math.min(T,Math.max(Math.round(+e.value/k)*k||0,M)),A=U.themes.form[t.theme],D=A&&A.addRipple?A:null,I||L.addClass("mbsc-stepper-cont mbsc-control-w").append('<span class="mbsc-segmented mbsc-stepper"></span>').find(".mbsc-stepper").append('<span class="mbsc-segmented-item mbsc-stepper-control mbsc-stepper-minus '+(O==M?"mbsc-step-disabled":"")+'"  tabindex="0"><span class="mbsc-segmented-content"><span class="mbsc-ic mbsc-ic-minus"></span></span></span>').append('<span class="mbsc-segmented-item mbsc-stepper-control mbsc-stepper-plus '+(O==T?"mbsc-step-disabled":"")+'"  tabindex="0"><span class="mbsc-segmented-content"> <span class="mbsc-ic mbsc-ic-plus"></span> </span></span>').prepend(N),f=Fn(".mbsc-stepper-minus",L),h=Fn(".mbsc-stepper-plus",L),I||("left"==x?(L.addClass("mbsc-stepper-val-left"),N.after('<span class="mbsc-segmented-item"><span class="mbsc-segmented-content"></span></span>')):"right"==x?(L.addClass("mbsc-stepper-val-right"),h.after('<span class="mbsc-segmented-item"><span class="mbsc-segmented-content"></span></span>')):f.after('<span class="mbsc-segmented-item"><span class="mbsc-segmented-content mbsc-stepper-val"></span></span>')),N.val(O).attr("data-role","stepper").attr("min",M).attr("max",T).attr("step",k).on("change",o),p=Fn(".mbsc-stepper-control",L).on("keydown",s).on("keyup",n).on("mousedown touchstart",a).on("touchmove",r).on("touchend touchcancel",i),N.addClass("mbsc-stepper-ready mbsc-control")},E._destroy=function(){N.removeClass("mbsc-control").off("change",o),p.off("keydown",s).off("keyup",n).off("mousedown touchstart",a).off("touchmove",r).off("touchend touchcancel",i)},E.init(t)};jn.prototype={_class:"stepper",_defaults:{min:0,max:100,step:1}},U.classes.Stepper=jn,U.presetShort("stepper","Stepper");var qn=U.$,Xn=function(e,t){var s,n,a,i,r=this;t=t||{},qn.extend(t,{changeEvent:"click",round:!1}),us.call(this,e,t,!0),r._readValue=function(){return e.checked?1:0},r._fillValue=function(e,t,n){s.prop("checked",!!e),n&&s.trigger("change")},r._onTap=function(e){r._setVal(e?0:1)},r.___init=function(){a=r.settings,s=qn(e),n=s.parent(),n.find(".mbsc-switch-track").remove(),n.prepend(s),s.attr("data-role","switch").after('<span class="mbsc-progress-cont mbsc-switch-track"><span class="mbsc-progress-track mbsc-progress-anim"><span class="mbsc-slider-handle-cont"><span class="mbsc-slider-handle mbsc-switch-handle" data-index="0"><span class="mbsc-switch-txt-off">'+a.offText+'</span><span class="mbsc-switch-txt-on">'+a.onText+"</span></span></span></span></span>"),i=new Dn(e),r._$track=n.find(".mbsc-progress-track"),r._min=0,r._max=1,r._step=1},r.___destroy=function(){i.destroy()},r.getVal=function(){return e.checked},r.setVal=function(e,t,s){r._setVal(e?1:0,t,s)},r.init(t)};Xn.prototype={_class:"switch",_css:"mbsc-switch",_hasTheme:!0,_hasLang:!0,_defaults:{stopProp:!0,offText:"Off",onText:"On"}},U.classes.Switch=Xn,U.presetShort("switch","Switch");var Bn=0,Un=U.$,zn=U.classes,Kn=U.instances,Gn=function(e,t){function s(){r.removeClass("mbsc-no-touch")}var n,a,i="",r=Un(e),o={},l=this;zn.Base.call(this,e,t,!0),l.refresh=function(e){Un("input,select,textarea,progress,button",r).each(function(){var e=this,t=Un(e),s=R(t);if("false"!=t.attr("data-enhance"))if(t.hasClass("mbsc-control"))o[e.id]&&o[e.id].option({theme:n.theme,lang:n.lang,rtl:n.rtl,onText:n.onText,offText:n.offText,stopProp:n.stopProp});else switch(e.id||(e.id="mbsc-form-control-"+ ++Bn),s){case"button":case"submit":o[e.id]=new Sn(e,{theme:n.theme,tap:n.tap});break;case"switch":o[e.id]=new Xn(e,{theme:n.theme,lang:n.lang,rtl:n.rtl,onText:n.onText,offText:n.offText,stopProp:n.stopProp});break;case"checkbox":o[e.id]=new Vn(e,{tap:n.tap});break;case"range":Un(e).parent().hasClass("mbsc-slider")||(o[e.id]=new hs(e,{theme:n.theme,lang:n.lang,rtl:n.rtl,stopProp:n.stopProp}));break;case"progress":o[e.id]=new is(e,{theme:n.theme,lang:n.lang,rtl:n.rtl});break;case"radio":o[e.id]=new $n(e,{tap:n.tap});break;case"select":case"select-one":case"select-multiple":o[e.id]=new On(e,{tap:n.tap});break;case"textarea":o[e.id]=new Nn(e,{tap:n.tap});break;case"segmented":o[e.id]=new Yn(e,{theme:n.theme,tap:n.tap});break;case"stepper":o[e.id]=new jn(e,{theme:n.theme});break;case"hidden":return;default:o[e.id]=new kn(e,{tap:n.tap})}}),e||q()},l._init=function(){U.themes.form[n.theme]||(n.theme="mobiscroll"),r.hasClass("mbsc-form")||r.on("touchstart",s).show(),i&&r.removeClass(i),i="mbsc-form mbsc-no-touch mbsc-"+n.theme+(n.baseTheme?" mbsc-"+n.baseTheme:"")+(n.rtl?" mbsc-rtl":" mbsc-ltr"),r.addClass(i),l.refresh()},l._destroy=function(){r.removeClass(i).off("touchstart",s);for(var e in o)o[e].destroy()},n=l.settings,a=l.trigger,l.init(t)};Gn.prototype={_hasDef:!0,_hasTheme:!0,_hasLang:!0,_class:"form",_defaults:{tap:!0,stopProp:!0,lang:"en"}},U.themes.form.mobiscroll={},
  U.classes.Form=Gn,U.presetShort("form","Form"),Un(function(){var e="[mbsc-enhance],[mbsc-form]";Un(e).each(function(){new Gn(this)}),Un(document).on("mbsc-enhance",function(t,s){Un(t.target).is(e)?new Gn(t.target,s):Un(e,t.target).each(function(){new Gn(this,s)})}),Un(document).on("mbsc-refresh",function(t){var s;Un(t.target).is(e)?(s=Kn[t.target.id],s&&s.refresh()):Un(e,t.target).each(function(){s=Kn[this.id],s&&s.refresh()})})});var Zn=+new Date;e.module("mobiscroll-form",[]).directive("mobiscrollForm",["$parse",function(e){return{restrict:"A",compile:function(){return{pre:function(e,t,s){var n=U.ng.getOpt(e,s,"mobiscrollForm",!0),a=s.id;a||(a="mbsc-form-"+Zn++,t.attr("id",a)),t.attr("mbsc-form-opt",""),U.ng.formOptions[a]={theme:n.theme,lang:n.lang}},post:function(t,s,n){var a=new U.classes.Form(s[0],U.ng.getOpt(t,n,"mobiscrollForm",!0));n.mobiscrollInstance&&e(n.mobiscrollInstance).assign(t,a),t.$on("mbscFormRefresh",function(){a.refresh()}),t.$on("$destroy",function(){a.destroy(),a=null})}}}}}]).directive("mobiscrollSwitch",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollSwitch",{component:"Switch"},void 0,void 0,void 0,void 0,!0)}]).directive("mobiscrollStepper",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollStepper",{component:"Stepper"})}]),e.module("mobiscroll-progress",[]).directive("mobiscrollProgress",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollProgress",{component:"Progress"},void 0,void 0,void 0,void 0,!0)}]),e.module("mobiscroll-slider",[]).directive("mobiscrollSlider",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollSlider",{component:"Slider"},void 0,void 0,void 0,void 0,!0)}]);var Jn=U.$,Qn=Jn.extend,ea=U.util,ta=ea.datetime,sa=ta.adjustedDate,na=U.presets.scroller,aa={labelsShort:["Yrs","Mths","Days","Hrs","Mins","Secs"],eventText:"event",eventsText:"events"};U.presetShort("eventcalendar"),na.eventcalendar=function(e){function t(e){if(e){if(w[e])return w[e];var t=Jn('<div style="background-color:'+e+';"></div>').appendTo("body"),s=window.getComputedStyle?getComputedStyle(t[0]):t[0].style,n=s.backgroundColor.replace(/rgb|rgba|\(|\)|\s/g,"").split(","),a=.299*n[0]+.587*n[1]+.114*n[2],i=a>130?"#000":"#fff";return t.remove(),w[e]=i,i}}function s(e){var t=C.labelsShort,s=Math.abs(e)/1e3,n=s/60,a=n/60,i=a/24,r=i/365;return s<45&&Math.round(s)+" "+t[5].toLowerCase()||n<45&&Math.round(n)+" "+t[4].toLowerCase()||a<24&&Math.round(a)+" "+t[3].toLowerCase()||i<30&&Math.round(i)+" "+t[2].toLowerCase()||i<365&&Math.round(i/30)+" "+t[1].toLowerCase()||Math.round(r)+" "+t[0].toLowerCase()}function n(e){return e.sort(function(e,t){var s=e.d||e.start,n=t.d||t.start,a=s.getTime?e.start&&e.end&&e.start.toDateString()!==e.end.toDateString()?1:s.getTime():0,i=n.getTime?t.start&&t.end&&t.start.toDateString()!==t.end.toDateString()?1:n.getTime():0;return a-i})}function a(e){var t,s=Jn(".mbsc-cal-c",d)[0].offsetHeight,n=e[0].offsetHeight,a=e[0].offsetWidth,i=e.offset().top-Jn(".mbsc-cal-c",d).offset().top,r=e.closest(".mbsc-cal-row").index()<2;t=u.addClass("mbsc-cal-events-t").css({top:r?i+n:"0",bottom:r?"0":s-i}).addClass("mbsc-cal-events-v").height(),u.css(r?"bottom":"top","auto").removeClass("mbsc-cal-events-t"),p.css("max-height",t),f.refresh(),f.scroll(0),r?u.addClass("mbsc-cal-events-b"):u.removeClass("mbsc-cal-events-b"),Jn(".mbsc-cal-events-arr",u).css("left",e.offset().left-u.offset().left+a/2)}function i(i,r){var o=h[i];if(o){var l,c,d,p,y,x,w='<ul class="mbsc-cal-event-list">';g=0,m=r,r.addClass(T).find(".mbsc-cal-day-i").addClass(D),r.hasClass(M)&&r.attr("data-hl","true").removeClass(M),n(o),Jn.each(o,function(e,n){p=n.d||n.start,y=n.start&&n.end&&n.start.toDateString()!==n.end.toDateString(),d=n.color,x=t(d),l="",c="",p.getTime&&(l=ta.formatDate((y?"MM d yy ":"")+C.timeFormat,p)),n.end&&(c=ta.formatDate((y?"MM d yy ":"")+C.timeFormat,n.end)),w+='<li role="button" aria-label="'+n.text+(l?", "+C.fromText+" "+l:"")+(c?", "+C.toText+" "+c:"")+'" class="mbsc-cal-event"><div class="mbsc-cal-event-color" style="'+(d?"background:"+d+";":"")+'"></div><div class="mbsc-cal-event-text">'+(p.getTime&&!y?'<div class="mbsc-cal-event-time">'+ta.formatDate(C.timeFormat,p)+"</div>":"")+n.text+"</div>"+(n.start&&n.end?'<div class="mbsc-cal-event-dur">'+s(n.end-n.start)+"</div>":"")+"</li>"}),w+="</ul>",v.html(w),e.trigger("onEventBubbleShow",{target:m[0],eventList:u[0]}),a(m),e.tap(Jn(".mbsc-cal-event",v),function(t){f.scrolled||e.trigger("onEventSelect",{domEvent:t,event:o[Jn(this).index()],date:i})}),b=!0}}function r(){u&&u.removeClass("mbsc-cal-events-v"),m&&(m.removeClass(T).find(".mbsc-cal-day-i").removeClass(D),m.attr("data-hl")&&m.removeAttr("data-hl").addClass(M)),b=!1}function o(){r(),e.redraw()}function l(e){return sa(e.getFullYear(),e.getMonth(),e.getDate())}var c,d,u,m,h,f,p,v,b,g,y,x,w={},_=Qn({},e.settings),C=Qn(e.settings,aa,_),T="mbsc-cal-day-sel mbsc-cal-day-ev",M="mbsc-cal-day-hl",D=C.activeClass||"",k=C.showEventCount,S=0,V=Qn(!0,[],C.data);return y=na.calbase.call(this,e),c=Qn({},y),Jn.each(V,function(e,t){void 0===t._id&&(t._id=S++)}),e.onGenMonth=function(t,s){h=e.prepareObj(V,t,s)},e.getDayProps=function(e){var s,n=!!h[e]&&h[e],a=n?h[e].length+" "+(h[e].length>1?C.eventsText:C.eventText):0,i=n&&n[0]&&n[0].color,r=k&&a?t(i):"",o="",l="";if(n){for(s=0;s<n.length;s++)n[s].icon&&(o+='<span class="mbsc-ic mbsc-ic-'+n[s].icon+'"'+(n[s].text?"":n[s].color?' style="color:'+n[s].color+';"':"")+"></span>\n");for(l='<div class="mbsc-cal-day-m"><div class="mbsc-cal-day-m-t">',s=0;s<n.length;s++)l+='<div class="mbsc-cal-day-m-c"'+(n[s].color?' style="background:'+n[s].color+';"':"")+"></div>";l+="</div></div>"}return{marked:n,selected:!1,cssClass:n?"mbsc-cal-day-marked":"",ariaLabel:k?a:"",markup:k&&a?'<div class="mbsc-cal-day-txt-c"><div class="mbsc-cal-day-txt" title="'+Jn("<div>"+a+"</div>").text()+'"'+(i?' style="background:'+i+";color:"+r+';text-shadow:none;"':"")+">"+o+a+"</div></div>":k&&o?'<div class="mbsc-cal-day-ic-c">'+o+"</div>":n?l:""}},e.addEvent=function(e){var t=[];return e=Qn(!0,[],Jn.isArray(e)?e:[e]),Jn.each(e,function(e,s){void 0===s._id&&(s._id=S++),V.push(s),t.push(s._id)}),o(),t},e.removeEvent=function(e){e=Jn.isArray(e)?e:[e],Jn.each(e,function(e,t){Jn.each(V,function(e,s){if(s._id===t)return V.splice(e,1),!1})}),o()},e.getEvents=function(t){var s;return t?(t.setHours(0,0,0,0),s=e.prepareObj(V,t.getFullYear(),t.getMonth()),s[t]?n(s[t]):[]):Qn(!0,[],V)},e.setEvents=function(e){var t=[];return V=Qn(!0,[],e),Jn.each(V,function(e,s){void 0===s._id&&(s._id=S++),t.push(s._id)}),o(),t},Qn(y,{highlight:!1,outerMonthChange:!1,headerText:!1,buttons:"inline"!==C.display?["close"]:C.buttons,onMarkupReady:function(t){c.onMarkupReady.call(this,t),d=Jn(t.target),k&&Jn(".mbsc-cal",d).addClass("mbsc-cal-ev"),d.addClass("mbsc-cal-em"),u=Jn('<div class="mbsc-cal-events '+(C.eventBubbleClass||"")+'"><div class="mbsc-cal-events-arr"></div><div class="mbsc-cal-events-i"><div class="mbsc-cal-events-sc"></div></div></div>').appendTo(Jn(".mbsc-cal-c",d)),p=Jn(".mbsc-cal-events-i",u),v=Jn(".mbsc-cal-events-sc",u),f=new U.classes.ScrollView(p[0]),b=!1,e.tap(p,function(){f.scrolled||r()})},onMonthChange:function(){r()},onSelectShow:function(){r()},onMonthLoaded:function(){x&&(i(x.d,Jn('.mbsc-cal-day-v[data-full="'+x.full+'"]:not(.mbsc-cal-day-diff)',d)),x=!1)},onDayChange:function(t){var s=t.date,n=l(s),a=Jn(t.target);return r(),a.hasClass("mbsc-cal-day-ev")||setTimeout(function(){e.changing?x={d:n,full:a.attr("data-full")}:i(n,a)},10),!1},onCalResize:function(){b&&a(m)},onHide:function(){c.onHide.call(e),f&&f.destroy()}}),y},e.module("mobiscroll-eventcalendar",[]).directive("mobiscrollEventcalendar",["$parse",function(t){return{restrict:"A",link:function(s,n,a){var i=new U.classes.Scroller(n[0],e.extend({},s.$eval(a.mobiscrollEventcalendar||"{}"),{preset:"eventcalendar",data:[]}));a.mobiscrollInstance&&t(a.mobiscrollInstance).assign(s,i),s.$watch(function(){return t(a.mobiscrollData)(s)},function(t){void 0===t||e.equals(i.getEvents(),t)||i.setEvents(t)},!0),s.$on("$destroy",function(){i.destroy()})}}}]);var ia=U.$,ra=U.presets.scroller,oa={min:0,max:100,defaultUnit:"km",units:["m","km","in","ft","yd","mi"]},la={mm:.001,cm:.01,dm:.1,m:1,dam:10,hm:100,km:1e3,in:.0254,ft:.3048,yd:.9144,ch:20.1168,fur:201.168,mi:1609.344,lea:4828.032};U.presetShort("distance"),ra.distance=function(e){var t=ia.extend({},oa,e.settings);return ia.extend(e.settings,t,{sign:!1,convert:function(e,t,s){return e*la[t]/la[s]}}),ra.measurement.call(this,e)};var ca=U.$,da=U.presets.scroller,ua={min:0,max:100,defaultUnit:"N",units:["N","kp","lbf","pdl"]},ma={N:1,kp:9.80665,lbf:4.448222,pdl:.138255};U.presetShort("force"),da.force=function(e){var t=ca.extend({},ua,e.settings);return ca.extend(e.settings,t,{sign:!1,convert:function(e,t,s){return e*ma[t]/ma[s]}}),da.measurement.call(this,e)};var ha=U.$,fa=U.presets.scroller,pa={min:0,max:1e3,defaultUnit:"kg",units:["g","kg","oz","lb"],unitNames:{tlong:"t (long)",tshort:"t (short)"}},va={mg:.001,cg:.01,dg:.1,g:1,dag:10,hg:100,kg:1e3,t:1e6,drc:1.7718452,oz:28.3495,lb:453.59237,st:6350.29318,qtr:12700.58636,cwt:50802.34544,tlong:1016046.9088,tshort:907184.74};U.presetShort("mass"),fa.mass=function(e){var t=ha.extend({},pa,e.settings);return ha.extend(e.settings,t,{sign:!1,convert:function(e,t,s){return e*va[t]/va[s]}}),fa.measurement.call(this,e)};var ba=U.$,ga=U.presets.scroller,ya={min:0,max:100,defaultUnit:"kph",units:["kph","mph","mps","fps","knot"],unitNames:{kph:"km/h",mph:"mi/h",mps:"m/s",fps:"ft/s",knot:"knot"}},xa={kph:1,mph:1.60934,mps:3.6,fps:1.09728,knot:1.852};U.presetShort("speed"),ga.speed=function(e){var t=ba.extend({},ya,e.settings);return ba.extend(e.settings,t,{sign:!1,convert:function(e,t,s){return e*xa[t]/xa[s]}}),ga.measurement.call(this,e)};var wa=U.$,_a=U.presets.scroller,Ca={min:-20,max:40,defaultUnit:"c",units:["c","k","f","r"],unitNames:{c:"°C",k:"K",f:"°F",r:"°R"}},Ta={c2k:function(e){return e+273.15},c2f:function(e){return 9*e/5+32},c2r:function(e){return 9*(e+273.15)/5},k2c:function(e){return e-273.15},k2f:function(e){return 9*e/5-459.67},k2r:function(e){return 9*e/5},f2c:function(e){return 5*(e-32)/9},f2k:function(e){return 5*(e+459.67)/9},f2r:function(e){return e+459.67},r2c:function(e){return 5*(e-491.67)/9},r2k:function(e){return 5*e/9},r2f:function(e){return e-459.67}};U.presetShort("temperature"),_a.temperature=function(e){var t=wa.extend({},Ca,e.settings);return wa.extend(e.settings,t,{sign:!0,convert:function(e,t,s){return Ta[t+"2"+s](e)}}),_a.measurement.call(this,e)},e.module("mobiscroll-measurement",[]).directive("mobiscrollMeasurement",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollMeasurement",{preset:"measurement"})}]).directive("mobiscrollTemperature",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollTemperature",{preset:"temperature"})}]).directive("mobiscrollSpeed",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollSpeed",{preset:"speed"})}]).directive("mobiscrollMass",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollMass",{preset:"mass"})}]).directive("mobiscrollForce",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollForce",{preset:"force"})}]).directive("mobiscrollDistance",["$parse",function(e){return U.ng.getDDO(e,"mobiscrollDistance",{preset:"distance"})}]),U.i18n.ja={setText:"セット",cancelText:"キャンセル",clearText:"クリア",selectedText:"{count} 選択",dateFormat:"yy年mm月dd日",dayNames:["日","月","火","水","木","金","土"],dayNamesShort:["日","月","火","水","木","金","土"],dayNamesMin:["日","月","火","水","木","金","土"],dayText:"日",hourText:"時",minuteText:"分",monthNames:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthNamesShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthText:"月",secText:"秒",timeFormat:"HH:ii",yearText:"年",nowText:"今",pmText:"午後",amText:"午前",yearSuffix:"年",monthSuffix:"月",daySuffix:"日",todayText:"今日",dateText:"日付",timeText:"時間",calendarText:"カレンダー",closeText:"クローズ",fromText:"開始",toText:"終わり",wholeText:"全数",fractionText:"分数",unitText:"単位",labels:["年間","月間","日間","時間","分","秒",""],labelsShort:["年間","月間","日間","時間","分","秒",""],startText:"開始",stopText:"停止",resetText:"リセット",lapText:"ラップ",hideText:"隠す",backText:"バック",undoText:"アンドゥ"},U.customTheme("mobiscroll-dark","mobiscroll");var Ma=U.themes,Da=U.$,ka=void 0;return"android"==ue.name?ka=ue.majorVersion>=5?"material":"android-holo":"ios"==ue.name?ka="ios":"wp"==ue.name&&(ka="wp"),U.setAutoTheme=function(){Da.each(Ma.frame,function(e,t){return ka&&t.baseTheme==ka&&"android-holo-light"!=e&&"material-dark"!=e&&"wp-light"!=e&&"ios-dark"!=e?(U.autoTheme=e,!1):void(e==ka&&(U.autoTheme=e))})},U.setAutoTheme(),U.uid="7430dcd5",U});
  