text: webshims.register("form-native-extend",function(e,t,n,i){"use strict";var a=n.Modernizr;if(a.inputtypes,a.formvalidation&&!t.bugs.bustedValidity){var r=t.inputTypes,o=!1,s={},l=function(){var t,n=function(){e(this).prop("validity")},i=function(){e("input").each(n)};return function(){clearTimeout(t),t=setTimeout(i,9)}}();t.addInputType=function(n,i){r[n]=i,o=!0,e.isDOMReady&&a.formvalidation&&!t.bugs.bustedValidity&&l()},t.addValidityRule=function(e,t){s[e]=t},e.each({typeMismatch:"mismatch",badInput:"bad"},function(e,n){t.addValidityRule(e,function(t,i,a,o){if(""===i)return!1;var s=o[e];return"type"in a||(a.type=(t[0].getAttribute("type")||"").toLowerCase()),r[a.type]&&r[a.type][n]&&(s=r[a.type][n](i,t)),s||!1})});var u=t.modules["form-number-date-api"],c=u.loaded&&!u.test(),d=["customError","badInput","typeMismatch","rangeUnderflow","rangeOverflow","stepMismatch","tooLong","patternMismatch","valueMissing","valid"],p=["value"],f=[],h=function(t){if(t||o){var n=(t.getAttribute&&t.getAttribute("type")||t.type||"").toLowerCase();r[n]&&e.prop(t,"validity")}},m={};if(["input","textarea","select"].forEach(function(n){var i=t.defineNodeNameProperty(n,"setCustomValidity",{prop:{value:function(a){a+="";var r="input"==n?e(this).getNativeElement()[0]:this;i.prop._supvalue.call(r,a),c&&(t.data(r,"hasCustomError",!!a),h(r))}}});m[n]=i.prop._supvalue}),c&&(p.push("min"),p.push("max"),p.push("step"),f.push("input")),c){var v;if(f.forEach(function(n){var i=t.defineNodeNameProperty(n,"validity",{prop:{get:function(){if(!v){var a="input"==n?e(this).getNativeElement()[0]:this,o=i.prop._supget.call(a);if(!o)return o;var l={};if(d.forEach(function(e){l[e]=o[e]}),!e.prop(a,"willValidate"))return l;v=!0;var u,c=e(a),p={type:(a.getAttribute&&a.getAttribute("type")||a.type||"").toLowerCase(),nodeName:(a.nodeName||"").toLowerCase()},f=c.val(),h=!!t.data(a,"hasCustomError");if(v=!1,l.customError=h,l.valid&&l.customError)l.valid=!1;else if(!l.valid){var g=!0;e.each(l,function(e,t){return t?(g=!1,!1):undefined}),g&&(l.valid=!0)}return e.each(s,function(e,i){l[e]=i(c,f,p,l),l[e]&&(l.valid||!u)&&r[p.type]&&(m[n].call(a,t.createValidationMessage(a,e)),l.valid=!1,u=!0)}),l.valid&&(m[n].call(a,""),t.data(a,"hasCustomError",!1)),l}},writeable:!1}})}),p.forEach(function(e){t.onNodeNamesPropertyModify(f,e,function(){h(this)})}),i.addEventListener){var g,y=function(e){"form"in e.target&&(clearTimeout(g),h(e.target))};i.addEventListener("change",y,!0),i.addEventListener("input",function(e){clearTimeout(g),g=setTimeout(function(){h(e.target)},290)},!0)}var b=f.join(",");t.addReady(function(t,n){o&&e(b,t).add(n.filter(b)).each(function(){h(this)})})}t.defineNodeNameProperty("input","type",{prop:{get:function(){var e=this,n=(e.getAttribute&&e.getAttribute("type")||"").toLowerCase();return t.inputTypes[n]?n:e.type}}})}}),webshims.register("form-number-date-api",function(e,t,n,i){"use strict";t.addInputType||t.error("you can not call forms-ext feature after calling forms feature. call both at once instead: $.webshims.polyfill('forms forms-ext')"),t.getStep||(t.getStep=function(t,n){var i=e.attr(t,"step");return"any"===i?i:(n=n||l(t),r[n]&&r[n].step?(i=v.number.asNumber(i),(!isNaN(i)&&i>0?i:r[n].step)*(r[n].stepScaleFactor||1)):i)}),t.addMinMaxNumberToCache||(t.addMinMaxNumberToCache=function(e,t,n){e+"AsNumber"in n||(n[e+"AsNumber"]=r[n.type].asNumber(t.attr(e)),isNaN(n[e+"AsNumber"])&&e+"Default"in r[n.type]&&(n[e+"AsNumber"]=r[n.type][e+"Default"]))});var a=parseInt("NaN",10),r=t.inputTypes,o=function(e){return"number"==typeof e||e&&e==1*e},s=function(t){return e('<input type="'+t+'" />').prop("type")===t},l=function(e){return(e.getAttribute("type")||"").toLowerCase()},u=function(e){return e&&!isNaN(1*e)},c=t.addMinMaxNumberToCache,d=function(e,t){e=""+e,t-=e.length;for(var n=0;t>n;n++)e="0"+e;return e},p=1e-7,f=t.bugs.bustedValidity;t.addValidityRule("stepMismatch",function(e,n,i,a){if(""===n)return!1;if("type"in i||(i.type=l(e[0])),"week"==i.type)return!1;var o,s=(a||{}).stepMismatch||!1;if(r[i.type]&&r[i.type].step){if("step"in i||(i.step=t.getStep(e[0],i.type)),"any"==i.step)return!1;if("valueAsNumber"in i||(i.valueAsNumber=r[i.type].asNumber(n)),isNaN(i.valueAsNumber))return!1;c("min",e,i),o=i.minAsNumber,isNaN(o)&&(o=r[i.type].stepBase||0),s=Math.abs((i.valueAsNumber-o)%i.step),s=!(p>=s||p>=Math.abs(s-i.step))}return s}),[{name:"rangeOverflow",attr:"max",factor:1},{name:"rangeUnderflow",attr:"min",factor:-1}].forEach(function(e){t.addValidityRule(e.name,function(t,n,i,a){var o=(a||{})[e.name]||!1;if(""===n)return o;if("type"in i||(i.type=l(t[0])),r[i.type]&&r[i.type].asNumber){if("valueAsNumber"in i||(i.valueAsNumber=r[i.type].asNumber(n)),isNaN(i.valueAsNumber))return!1;if(c(e.attr,t,i),isNaN(i[e.attr+"AsNumber"]))return o;o=i[e.attr+"AsNumber"]*e.factor<i.valueAsNumber*e.factor-p}return o})}),t.reflectProperties(["input"],["max","min","step"]);var h=t.defineNodeNameProperty("input","valueAsNumber",{prop:{get:function(){var t=this,n=l(t),i=r[n]&&r[n].asNumber?r[n].asNumber(e.prop(t,"value")):h.prop._supget&&h.prop._supget.apply(t,arguments);return null==i&&(i=a),i},set:function(n){var i=this,a=l(i);if(r[a]&&r[a].numberToString){if(isNaN(n))return e.prop(i,"value",""),undefined;var o=r[a].numberToString(n);o!==!1?e.prop(i,"value",o):t.error("INVALID_STATE_ERR: DOM Exception 11")}else h.prop._supset&&h.prop._supset.apply(i,arguments)}}}),m=t.defineNodeNameProperty("input","valueAsDate",{prop:{get:function(){var t=this,n=l(t);return r[n]&&r[n].asDate&&!r[n].noAsDate?r[n].asDate(e.prop(t,"value")):m.prop._supget&&m.prop._supget.call(t)||null},set:function(n){var i=this,a=l(i);if(!r[a]||!r[a].dateToString||r[a].noAsDate)return m.prop._supset&&m.prop._supset.apply(i,arguments)||null;if(null===n)return e.prop(i,"value",""),"";var o=r[a].dateToString(n);return o!==!1?(e.prop(i,"value",o),o):(t.error("INVALID_STATE_ERR: DOM Exception 11"),undefined)}}});e.each({stepUp:1,stepDown:-1},function(n,i){var a=t.defineNodeNameProperty("input",n,{prop:{value:function(n){var o,s,u,c,d,f,h=l(this);if(!r[h]||!r[h].asNumber){if(a.prop&&a.prop.value)return a.prop.value.apply(this,arguments);throw t.info("no step method for type: "+h),"invalid state error"}if(f={type:h},n||(n=1,t.info("you should always use a factor for stepUp/stepDown")),n*=i,s=e.prop(this,"valueAsNumber"),isNaN(s))throw t.info("valueAsNumber is NaN can't apply stepUp/stepDown "),"invalid state error";if(o=t.getStep(this,h),"any"==o)throw t.info("step is 'any' can't apply stepUp/stepDown"),"invalid state error";if(t.addMinMaxNumberToCache("min",e(this),f),t.addMinMaxNumberToCache("max",e(this),f),o*=n,s=1*(s+o).toFixed(5),c=(s-(f.minAsNumber||0))%o,c&&Math.abs(c)>p&&(d=s-c,d+=c>0?o:-o,s=1*d.toFixed(5)),!isNaN(f.maxAsNumber)&&s>f.maxAsNumber||!isNaN(f.minAsNumber)&&f.minAsNumber>s)throw t.info("max/min overflow can't apply stepUp/stepDown"),"invalid state error";u?e.prop(this,"valueAsDate",u):e.prop(this,"valueAsNumber",s)}}})});var v={number:{bad:function(e){return!o(e)},step:1,stepScaleFactor:1,asNumber:function(e){return o(e)?1*e:a},numberToString:function(e){return o(e)?e:!1}},range:{minDefault:0,maxDefault:100},color:{bad:function(){var e=/^\u0023[a-f0-9]{6}$/;return function(t){return!t||7!=t.length||!e.test(t)}}()},date:{bad:function(e){if(!e||!e.split||!/\d$/.test(e))return!0;var t,n=e.split(/\u002D/);if(3!==n.length)return!0;var i=!1;if(4>n[0].length||2!=n[1].length||n[1]>12||2!=n[2].length||n[2]>33)i=!0;else for(t=0;3>t;t++)if(!u(n[t])){i=!0;break}return i||e!==this.dateToString(this.asDate(e,!0))},step:1,stepScaleFactor:864e5,asDate:function(e,t){return!t&&this.bad(e)?null:new Date(this.asNumber(e,!0))},asNumber:function(e,t){var n=a;return(t||!this.bad(e))&&(e=e.split(/\u002D/),n=Date.UTC(e[0],e[1]-1,e[2])),n},numberToString:function(e){return o(e)?this.dateToString(new Date(1*e)):!1},dateToString:function(e){return e&&e.getFullYear?d(e.getUTCFullYear(),4)+"-"+d(e.getUTCMonth()+1,2)+"-"+d(e.getUTCDate(),2):!1}},time:{bad:function(t,n){if(!t||!t.split||!/\d$/.test(t))return!0;if(t=t.split(/\u003A/),2>t.length||t.length>3)return!0;var i,a=!1;return t[2]&&(t[2]=t[2].split(/\u002E/),i=parseInt(t[2][1],10),t[2]=t[2][0]),e.each(t,function(e,t){return u(t)&&2===t.length?undefined:(a=!0,!1)}),a?!0:t[0]>23||0>t[0]||t[1]>59||0>t[1]?!0:t[2]&&(t[2]>59||0>t[2])?!0:i&&isNaN(i)?!0:(i&&(100>i?i*=100:10>i&&(i*=10)),n===!0?[t,i]:!1)},step:60,stepBase:0,stepScaleFactor:1e3,asDate:function(e){return e=new Date(this.asNumber(e)),isNaN(e)?null:e},asNumber:function(e){var t=a;return e=this.bad(e,!0),e!==!0&&(t=Date.UTC("1970",0,1,e[0][0],e[0][1],e[0][2]||0),e[1]&&(t+=e[1])),t},dateToString:function(e){if(e&&e.getUTCHours){var t=d(e.getUTCHours(),2)+":"+d(e.getUTCMinutes(),2),n=e.getSeconds();return"0"!=n&&(t+=":"+d(n,2)),n=e.getUTCMilliseconds(),"0"!=n&&(t+="."+d(n,3)),t}return!1}},month:{bad:function(e){return v.date.bad(e+"-01")},step:1,stepScaleFactor:!1,asDate:function(e){return new Date(v.date.asNumber(e+"-01"))},asNumber:function(e){var t=a;return e&&!this.bad(e)&&(e=e.split(/\u002D/),e[0]=1*e[0]-1970,e[1]=1*e[1]-1,t=12*e[0]+e[1]),t},numberToString:function(e){var t,n=!1;return o(e)&&(t=e%12,e=(e-t)/12+1970,t+=1,1>t&&(e-=1,t+=12),n=d(e,4)+"-"+d(t,2)),n},dateToString:function(e){if(e&&e.getUTCHours){var t=v.date.dateToString(e);return t.split&&(t=t.split(/\u002D/))?t[0]+"-"+t[1]:!1}return!1}},"datetime-local":{bad:function(e,t){return e&&e.split&&2===(e+"special").split(/\u0054/).length?(e=e.split(/\u0054/),v.date.bad(e[0])||v.time.bad(e[1],t)):!0},noAsDate:!0,asDate:function(e){return e=new Date(this.asNumber(e)),isNaN(e)?null:e},asNumber:function(e){var t=a,n=this.bad(e,!0);return n!==!0&&(e=e.split(/\u0054/)[0].split(/\u002D/),t=Date.UTC(e[0],e[1]-1,e[2],n[0][0],n[0][1],n[0][2]||0),n[1]&&(t+=n[1])),t},dateToString:function(e,t){return v.date.dateToString(e)+"T"+v.time.dateToString(e,t)}}};!f&&s("range")&&s("time")&&s("month")&&s("datetime-local")||(v.range=e.extend({},v.number,v.range),v.time=e.extend({},v.date,v.time),v.month=e.extend({},v.date,v.month),v["datetime-local"]=e.extend({},v.date,v.time,v["datetime-local"])),["number","month","range","date","time","color","datetime-local"].forEach(function(e){(f||!s(e))&&t.addInputType(e,v[e])}),null==e("<input />").prop("labels")&&t.defineNodeNamesProperty("button, input, keygen, meter, output, progress, select, textarea","labels",{prop:{get:function(){if("hidden"==this.type)return null;var t=this.id,n=e(this).closest("label").filter(function(){var e=this.attributes["for"]||{};return!e.specified||e.value==t});return t&&(n=n.add('label[for="'+t+'"]')),n.get()},writeable:!1}})}),function(e){var t=function(e){return"number"==typeof e||e&&e==1*e},n=function(e,t){return"number"==typeof e||e&&e==1*e?1*e:t},i=["step","min","max","readonly","title","disabled","tabindex"],a={_create:function(){var t;for(this.element.addClass("ws-range").attr({role:"slider"}).append('<span class="ws-range-min" /><span class="ws-range-rail"><span class="ws-range-thumb" /></span>'),this.trail=e(".ws-range-rail",this.element),this.range=e(".ws-range-min",this.element),this.thumb=e(".ws-range-thumb",this.trail),this.updateMetrics(),this.orig=this.options.orig,t=0;i.length>t;t++)this[i[t]](this.options[i[t]]);this.value=this._value,this.value(this.options.value),this.initDataList(),this.element.data("rangeUi",this),this.addBindings(),this._init=!0},value:e.noop,_value:function(t,n,i){var a,r,o=this.options,s=t,l={},u={};n||parseFloat(t,10)==t||(t=o.min+(o.max-o.min)/2),n||(t=this.normalizeVal(t)),a=100*((t-o.min)/(o.max-o.min)),this._init&&t==o.value&&s==t||(this.options.value=t,this.thumb.stop(),this.range.stop(),u[this.dirs.width]=a+"%",this.vertical&&(a=Math.abs(a-100)),l[this.dirs.left]=a+"%",i?(i="object"!=typeof i?{}:e.extend({},i),i.duration||(r=Math.abs(a-parseInt(this.thumb[0].style[this.dirs.left]||50,10)),i.duration=Math.max(Math.min(999,5*r),99)),this.thumb.animate(l,i),this.range.animate(u,i)):(this.thumb.css(l),this.range.css(u)),this.orig&&(s!=t||!this._init&&this.orig.value!=t)&&this.options._change(t),this.element.attr({"aria-valuenow":this.options.value,"aria-valuetext":this.options.textValue?this.options.textValue(this.options.value):this.options.options[this.options.value]||this.options.value}))},initDataList:function(){if(this.orig){var t,n=this,i=function(){e(n.orig).jProp("list").off("updateDatalist",i).on("updateDatalist",i),clearTimeout(t),t=setTimeout(function(){n.list&&n.list()},9)};e(this.orig).on("listdatalistchange",i),this.list()}},list:function(){var n=this.options,i=n.min,a=n.max,r=this.trail,o=this;this.element.attr({"aria-valuetext":n.options[n.value]||n.value}),e(".ws-range-ticks",r).remove(),e(this.orig).jProp("list").find("option:not([disabled])").each(function(){n.options[e.prop(this,"value")]=e.prop(this,"label")||""}),e.each(n.options,function(s,l){if(!(!t(s)||i>s||s>a)){var u=100*((s-i)/(a-i)),c=n.showLabels&&l?' title="'+l+'"':"";o.vertical&&(u=Math.abs(u-100)),o.posCenter(e('<span class="ws-range-ticks"'+c+' data-label="'+l+'" style="'+o.dirs.left+": "+u+'%;" />').appendTo(r))}})},readonly:function(e){e=!!e,this.options.readonly=e,this.element.attr("aria-readonly",""+e),this._init&&this.updateMetrics()},disabled:function(e){e=!!e,this.options.disabled=e,e?this.element.attr({tabindex:-1,"aria-disabled":"true"}):this.element.attr({tabindex:this.options.tabindex,"aria-disabled":"false"}),this._init&&this.updateMetrics()},tabindex:function(e){this.options.tabindex=e,this.options.disabled||this.element.attr({tabindex:e})},title:function(e){this.element.prop("title",e)},min:function(e){this.options.min=n(e,0),this.value(this.options.value,!0)},max:function(e){this.options.max=n(e,100),this.value(this.options.value,!0)},step:function(e){var t=this.options,i="any"==e?"any":n(e,1);t.stepping&&("any"!=i&&t.stepping%i?webshims.error("wrong stepping value for type range:"+t.stepping%i):i=t.stepping),t.step=i,this.value(this.options.value)},normalizeVal:function(e){var t,n,i,a=this.options;return a.min>=e?e=a.min:e>=a.max?e=a.max:"any"!=a.step&&(i=a.step,t=(e-a.min)%i,n=e-t,2*Math.abs(t)>=i&&(n+=t>0?i:-i),e=1*n.toFixed(5)),e},doStep:function(e,t){var i=n(this.options.step,1);"any"==this.options.step&&(i=Math.min(i,(this.options.max-this.options.min)/10)),this.value(this.options.value+i*e,!1,t)},getStepedValueFromPos:function(e){var t,n,i,a;return 0>=e?t=this.options[this.dirs.min]:e>100?t=this.options[this.dirs.max]:(this.vertical&&(e=Math.abs(e-100)),t=(this.options.max-this.options.min)*(e/100)+this.options.min,a=this.options.step,"any"!=a&&(n=(t-this.options.min)%a,i=t-n,2*Math.abs(n)>=a&&(i+=n>0?a:-a),t=1*i.toFixed(5))),t},addRemoveClass:function(e,t){var n,i=-1!=this.element.prop("className").indexOf(e);!t&&i?(n="removeClass",this.element.removeClass(e),this.updateMetrics()):t&&!i&&(n="addClass"),n&&(this.element[n](e),this._init&&this.updateMetrics())},addBindings:function(){var t,n,i,a=this,r=this.options,o=function(){var t={};return{init:function(n,i,r){t[n]||(t[n]={fn:r},a.orig&&e(a.orig).on(n,function(){t[n].val=e.prop(a.orig,"value")})),t[n].val=i},call:function(e,n){t[e].val!=n&&(clearTimeout(t[e].timer),t[e].val=n,t[e].timer=setTimeout(function(){t[e].fn(n,a)},0))}}}(),s=function(e,i){var s=a.getStepedValueFromPos((e[a.dirs.mouse]-t)*n);s!=r.value&&(a.value(s,!1,i),o.call("input",s)),e&&"mousemove"==e.type&&e.preventDefault()},l=function(t){t&&"mouseup"==t.type&&(o.call("input",r.value),o.call("change",r.value)),a.addRemoveClass("ws-active"),e(document).off("mousemove",s).off("mouseup",l),e(window).off("blur",u)},u=function(e){e.target==window&&l()},c=function(i){var o;if(i.preventDefault(),e(document).off("mousemove",s).off("mouseup",l),e(window).off("blur",u),!r.readonly&&!r.disabled){if(a.element.focus(),a.addRemoveClass("ws-active",!0),t=a.element.focus().offset(),n=a.element[a.dirs.innerWidth](),!n||!t)return;o=a.thumb[a.dirs.outerWidth](),t=t[a.dirs.pos],n=100/n,s(i,r.animate),e(document).on({mouseup:l,mousemove:s}),e(window).on("blur",u),i.stopPropagation()}},d={mousedown:c,focus:function(){r.disabled||(o.init("input",r.value),o.init("change",r.value),a.addRemoveClass("ws-focus",!0),a.updateMetrics()),i=!0},blur:function(){a.element.removeClass("ws-focus ws-active"),a.updateMetrics(),i=!1,o.init("input",r.value),o.call("change",r.value)},keyup:function(){a.addRemoveClass("ws-active"),o.call("input",r.value),o.call("change",r.value)},keydown:function(e){var t=!0,n=e.keyCode;r.readonly||r.disabled||(39==n||38==n?a.doStep(1):37==n||40==n?a.doStep(-1):33==n?a.doStep(10,r.animate):34==n?a.doStep(-10,r.animate):36==n?a.value(a.options.max,!1,r.animate):35==n?a.value(a.options.min,!1,r.animate):t=!1,t&&(a.addRemoveClass("ws-active",!0),o.call("input",r.value),e.preventDefault()))}};o.init("input",r.value,this.options.input),o.init("change",r.value,this.options.change),d[e.fn.mwheelIntent?"mwheelIntent":"mousewheel"]=function(e,t){t&&i&&!r.readonly&&!r.disabled&&(a.doStep(t),e.preventDefault(),o.call("input",r.value))},this.element.on(d),this.thumb.on({mousedown:c}),window.webshims&&webshims.ready("WINDOWLOAD",function(){webshims.ready("dom-support",function(){e.fn.onWSOff&&a.element.onWSOff("updateshadowdom",function(){a.updateMetrics()})}),!e.fn.onWSOff&&webshims._polyfill&&webshims._polyfill(["dom-support"])})},posCenter:function(e,t){var n;!this.options.calcCenter||this._init&&!this.element[0].offsetWidth||(e||(e=this.thumb),t||(t=e[this.dirs.outerWidth]()),t/=-2,e.css(this.dirs.marginLeft,t),this.options.calcTrail&&e[0]==this.thumb[0]&&(n=this.element[this.dirs.innerHeight](),e.css(this.dirs.marginTop,(e[this.dirs.outerHeight]()-n)/-2),this.range.css(this.dirs.marginTop,(this.range[this.dirs.outerHeight]()-n)/-2),t*=-1,this.trail.css(this.dirs.left,t).css(this.dirs.right,t)))},updateMetrics:function(){var e=this.element.innerWidth();this.vertical=e&&this.element.innerHeight()-e>10,this.dirs=this.vertical?{mouse:"pageY",pos:"top",min:"max",max:"min",left:"top",right:"bottom",width:"height",innerWidth:"innerHeight",innerHeight:"innerWidth",outerWidth:"outerHeight",outerHeight:"outerWidth",marginTop:"marginLeft",marginLeft:"marginTop"}:{mouse:"pageX",pos:"left",min:"min",max:"max",left:"left",right:"right",width:"width",innerWidth:"innerWidth",innerHeight:"innerHeight",outerWidth:"outerWidth",outerHeight:"outerHeight",marginTop:"marginTop",marginLeft:"marginLeft"},this.element[this.vertical?"addClass":"removeClass"]("vertical-range")[this.vertical?"addClass":"removeClass"]("horizontal-range"),this.posCenter()}},r=function(e){function t(){}return t.prototype=e,new t};e.fn.rangeUI=function(t){return t=e.extend({readonly:!1,disabled:!1,tabindex:0,min:0,step:1,max:100,value:50,input:e.noop,change:e.noop,_change:e.noop,showLabels:!0,options:{},calcCenter:!0,calcTrail:!0},t),this.each(function(){var n=e.extend(r(a),{element:e(this)});n.options=t,n._create.call(n)})},window.webshims&&webshims.isReady&&(webshims.ready("es5",function(){webshims.isReady("range-ui",!0)}),webshims._polyfill&&webshims._polyfill(["es5"]))}(window.webshims?webshims.$:jQuery),webshims.register("form-number-date-ui",function(e,t,n,i,a,r){"use strict";var o,s=t.formcfg,l=["01","02","03","04","05","06","07","08","09","10","11","12"],u=function(e){e.stopImmediatePropagation()},c=function(){var t;return function(){return t||(t="<option></option>"+e.map(l,function(e){return"<option>"+e+"</option>"}).join("")),t}}(),d=function(t){if(!o.patterns[t+"Obj"]){var n={};e.each(o.patterns[t].split(o[t+"Format"]),function(e,t){n[t]=e}),o.patterns[t+"Obj"]=n}},p={date:{_create:function(t){var n={splits:[e('<input type="text" class="yy" size="4" inputmode="numeric" />')[0]]};return t.monthSelect?n.splits.push(e('<select class="mm">'+c()+"</select>")[0]):n.splits.push(e('<input type="text" class="mm" inputmode="numeric" maxlength="2" size="2" />')[0]),n.splits.push(e('<input type="text" class="dd ws-spin" inputmode="numeric" maxlength="2" size="2" />')[0]),n.elements=[n.splits[0],e('<span class="ws-input-seperator" />')[0],n.splits[1],e('<span class="ws-input-seperator" />')[0],n.splits[2]],n},sort:function(t){d("d");var n=0,i=e(".ws-input-seperator",t).html(o.dFormat),a=e("input, select",t);e.each(o.patterns.dObj,function(e){var r=a.filter("."+e);r[0]&&(r.appendTo(t),i.length>n&&i.eq(n).insertAfter(r),n++)})}},month:{_create:function(t){var n={splits:[e('<input type="text" class="yy" inputmode="numeric" size="4" />')[0]]};return t.monthSelect?n.splits.push(e('<select class="mm ws-spin">'+c()+"</select>")[0]):(n.splits.push(e('<input type="text" class="mm ws-spin" />')[0]),t.onlyMonthDigits&&e(n.splits[1]).attr({inputmode:"numeric",size:2,maxlength:2})),n.elements=[n.splits[0],e('<span class="ws-input-seperator" />')[0],n.splits[1]],n},sort:function(t){var n,i=e(".ws-input-seperator",t).html(o.dFormat),a=e("input.mm, select.mm",t);o.date.showMonthAfterYear?(a.appendTo(t),n="insertBefore"):(a.prependTo(t),n="insertAfter"),i[n](a)}}},f=new Date((new Date).getTime()-1e3*60*(new Date).getTimezoneOffset());f=new Date(f.getFullYear(),f.getMonth(),f.getDate(),f.getHours()).getTime();var h={number:{step:1},"datetime-local":{step:60,start:new Date(f).getTime()},time:{step:60},month:{step:1,start:new Date(f)},date:{step:1,start:new Date(f)}},m=function(){var n=function(){return t.getID(this)};return function(t,i,a){e(t).attr({"aria-labelledby":i.map(n).get().join(" ")}),a||i.on("click",function(e){return t.getShadowFocusElement().focus(),e.preventDefault(),!1})}}(),v=function(e){return e?(e+="",1==e.length?"0"+e:e):""};(function(){s.de=e.extend(!0,{numberFormat:{",":".",".":","},timeSigns:":. ",numberSigns:",",dateSigns:".",dFormat:".",patterns:{d:"dd.mm.yy"},month:{currentText:"Aktueller Monat"},date:{close:"schlie\u00dfen",clear:"L\u00f6schen",prevText:"Zur\u00fcck",nextText:"Vor",currentText:"Heute",monthNames:["Januar","Februar","M\u00e4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthNamesShort:["Jan","Feb","M\u00e4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],dayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayNamesShort:["So","Mo","Di","Mi","Do","Fr","Sa"],dayNamesMin:["So","Mo","Di","Mi","Do","Fr","Sa"],weekHeader:"KW",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""}},s.de||{}),s.en=e.extend(!0,{numberFormat:{".":".",",":","},numberSigns:".",dateSigns:"/",timeSigns:":. ",dFormat:"/",patterns:{d:"mm/dd/yy"},meridian:["AM","PM"],month:{currentText:"This month"},date:{closeText:"Done",clear:"Clear",prevText:"Prev",nextText:"Next",currentText:"Today",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:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""}},s.en||{}),s["en-US"]||(s["en-US"]=e.extend(!0,{},s.en)),s["en-GB"]||(s["en-GB"]=e.extend(!0,{},s.en,{date:{firstDay:1},patterns:{d:"dd/mm/yy"}})),s["en-AU"]||(s["en-AU"]=e.extend(!0,{},s["en-GB"])),s[""]||(s[""]=s["en-US"]),o=s[""];var n=function(t){if(!t.date.monthkeys){var n=function(e,n){var i,a=e+1;i=10>a?"0"+a:""+a,t.date.monthkeys[a]=i,t.date.monthkeys[n]=i,t.date.monthkeys[n.toLowerCase()]=i};t.date.monthkeys={},t.date.monthDigits=l,t.numberSigns+="-",t.meridian&&(t.timeSigns+=t.meridian[0]+t.meridian[1]),e.each(t.date.monthNames,n),e.each(t.date.monthNamesShort,n)}t.colorSigns||(t.colorSigns="#abcdefABCDEF"),t["datetime-localSigns"]||(t["datetime-localSigns"]=t.dateSigns+t.timeSigns)},r=function(){n(o),e(i).triggerHandler("wslocalechange")};r(),t.activeLang({register:"form-core",callback:function(){e.each(arguments,function(e,t){return s[t]?(s[t]!=o&&(o=s[t],r()),!1):a})}}),t.activeLang({langObj:s,module:"form-core",callback:function(e){o!=e&&(o=e,r())}})})(),function(){var n=function(t){e(this)["mousepressstart"==t.type?"addClass":"removeClass"]("mousepress-ui")},i=function(e,t){return"number"==typeof e||e&&e==1*e?1*e:t},r={number:function(e){return(e+"").replace(/\,/g,"").replace(/\./,o.numberFormat["."])},time:function(t){var n;return t&&o.meridian&&(t=t.split(":"),n=1*t[0],n&&n>=12?(t[0]=v(n-12+""),n=1):n=0,t=e.trim(t.join(":"))+" "+o.meridian[n]),t},"datetime-local":function(t,n){var i=e.trim(t||"").split("T");return 2==i.length&&(t=this.date(i[0],n)+" "+this.time(i[1],n)),t},month:function(e,t){var n,i=e.split("-");return i[0]&&i[1]?(n=o.date[t.formatMonthNames]||o.date[t.monthNames]||o.date.monthNames,i[1]=n[1*i[1]-1],t&&t.splitInput?e=[i[0]||"",i[1]||""]:i[1]&&(e=o.date.showMonthAfterYear?i.join(" "):i[1]+" "+i[0])):t&&t.splitInput&&(e=[i[0]||"",i[1]||""]),e},date:function(e,t){var n=(e+"").split("-");return n[2]&&n[1]&&n[0]?t&&t.splitInput?e=n:(e=o.patterns.d.replace("yy",n[0]||""),e=e.replace("mm",n[1]||""),e=e.replace("dd",n[2]||"")):t&&t.splitInput&&(e=[n[0]||"",n[1]||"",n[2]||""]),e},color:function(e){var t="#000000";return e&&(e=e.toLowerCase(),7==e.length&&c("color").isValid(e)&&(t=e)),t}},s={number:function(e){return(e+"").replace(o.numberFormat[","],"").replace(o.numberFormat["."],".")},"datetime-local":function(t,n){var i,a=e.trim(t||"").split(/\s+/);return 2==a.length?(-1!=a[0].indexOf(":")&&-1==a[1].indexOf(":")&&(i=a[1],a[1]=a[0],a[0]=i),t=this.date(a[0],n)+"T"+this.time(a[1],n)):3==a.length&&(t=this.date(a[0],n)+"T"+this.time(a[1]+a[2],n)),t},time:function(t){var n;return t&&o.meridian&&(-1!=t.indexOf(o.meridian[1])&&(t=t.split(":"),n=1*t[0],isNaN(n)||(t[0]=n+12),t=t.join(":")),t=e.trim(t.replace(o.meridian[0],"").replace(o.meridian[1],""))),t},month:function(e,t,n){var i=t.splitInput?e:e.trim().split(/[\.\s-\/\\]+/);return 2==i.length&&i[0]&&i[1]?(i[0]=!n&&o.date.monthkeys[i[0]]||i[0],i[1]=!n&&o.date.monthkeys[i[1]]||i[1],e=2==i[1].length&&i[0].length>3?i[0]+"-"+i[1]:2==i[0].length&&i[1].length>3?i[1]+"-"+i[0]:""):t.splitInput&&(e=""),e},date:function(e,t,n){d("d");var i;return t.splitInput?i={yy:0,mm:1,dd:2}:(i=o.patterns.dObj,e=e.split(o.dFormat)),3==e.length&&e[0]&&e[1]&&e[2]&&(!n||e[i.yy].length>3&&2==e[i.mm].length&&2==e[i.dd].length)?[v(e[i.yy]),v(e[i.mm]),v(e[i.dd])].join("-"):""},color:function(e){var t="#000000";return e&&(e=e.toLowerCase(),0!==e.indexOf("#")&&(e="#"+e),4==e.length&&(e="#"+e.charAt(1)+e.charAt(1)+e.charAt(2)+e.charAt(2)+e.charAt(3)+e.charAt(3)),7==e.length&&c("color").isValid(e)&&(t=e)),t}},l={date:function(e,t){var n=(e||"").split("-");return n=3==n.length?t.splitInput?n:o.patterns.d.replace("yy",n[0]).replace("mm",n[1]).replace("dd",n[2]):t.splitInput?[e,e,e]:e},month:function(e,t){var n=(e||"").split("-");return n=2==n.length?t.splitInput?n:o.patterns.d.replace("yy",n[0]).replace("mm",n[1]):t.splitInput?[e,e]:e}},c=function(){var t={};return function(n){var i;return t[n]||(i=e('<input type="'+n+'" step="any" />'),t[n]={asNumber:function(e){var t="object"==typeof e?"valueAsDate":"value";return i.prop(t,e).prop("valueAsNumber")},asValue:function(e){var t="object"==typeof e?"valueAsDate":"valueAsNumber";return i.prop(t,e).prop("value")},isValid:function(t,n){return n&&(n.nodeName||n.jquery)&&(n={min:e(n).prop("min")||"",max:e(n).prop("max")||"",step:e(n).prop("step")||"any"}),n=e.extend({step:"any",min:"",max:""},n||{}),i.attr(n).prop("value",t).is(":valid")&&i.prop("value")==t}}),t[n]}}();h.range=h.number;var f={_create:function(){var n,i,a,r=this.options,o=this.createOpts;for(this.type=r.type,this.orig=r.orig,this.buttonWrapper=e('<span class="input-buttons '+this.type+'-input-buttons"></span>').insertAfter(this.element),this.options.containerElements.push(this.buttonWrapper[0]),r.mirrorValidity=r.mirrorValidity&&this.orig&&Modernizr.formvalidation&&!t.bugs.bustedValidity,r.splitInput&&this._addSplitInputs?(r.monthSelect&&this.element.addClass("ws-month-select"),this._addSplitInputs()):this.inputElements=this.element,h[this.type]&&"object"==typeof h[this.type].start&&(h[this.type].start=this.asNumber(h[this.type].start)),t.picker[this.type]||(r.buttonOnly=!1),n=0;o.length>n;n++)null!=r[o[n]]&&this[o[n]](r[o[n]],r[o[n]]);"color"==this.type&&this.inputElements.prop("maxLength",7),this.addBindings(),e(this.element).data("wsWidget"+r.type,this),r.buttonOnly&&this.inputElements.prop({readOnly:!0}),this._init=!0,r.mirrorValidity&&(i=this,a=function(){clearTimeout(a._timerDealy),a._timerDealy=setTimeout(a._wsexec,9)},a._wsexec=function(){clearTimeout(a._timerDealy),i.mirrorValidity(!0)},a(),e(this.orig).on("change input",function(e){"input"==e.type?a():a._wsexec()}))},mirrorValidity:function(t){if(this._init&&this.options.mirrorValidity){t||e.prop(this.orig,"validity");var n=e(this.orig).getErrorMessage();n!==this.lastErrorMessage&&(this.inputElements.prop("setCustomValidity",function(e,t){t._supvalue&&t._supvalue.call(this,n)}),this.lastErrorMessage=n)}},addBindings:function(){var t,i=this,r=this.options,s=function(){var t={};return{init:function(n,a,r){t[n]||(t[n]={fn:r},e(i.orig).on(n,function(){t[n].val=e.prop(i.orig,"value")})),t[n].val=a},call:function(e,n){t[e]&&t[e].val!=n&&(clearTimeout(t[e].timer),t[e].val=n,t[e].timer=setTimeout(function(){t[e].fn(n,i)},9))}}}(),c=function(){s.init("input",e.prop(i.orig,"value"),i.options.input),s.init("change",e.prop(i.orig,"value"),i.options.change)},d={},p=function(e){return p.prevent?(e.preventDefault(),(t||i.element.getShadowFocusElement()).focus(),u(e),!0):a};(function(){var t,n=function(n){var a;clearTimeout(t),a=i.parseValue(),"color"==i.type&&i.inputElements.val(a),e.prop(i.orig,"value",a),s.call("input",a),n&&"wsupdatevalue"==n.type||s.call("change",a)},a=function(){clearTimeout(t)},o=function(e){clearTimeout(t),t=setTimeout(n,0),"change"==e.type&&(u(e),r.splitInput||n())};i.element.on("wsupdatevalue",n),i.inputElements.add(i.buttonWrapper).add(i.element).on({"focus focusin":a,"blur focusout change":o}),setTimeout(function(){i.popover&&(i.popover.element.on("wspopoverhide",o),e("> *",i.popover.element).on({focusin:a,focusout:o}))},0)})();var f={},m=r.splitInput?this.inputElements.filter(".ws-spin"):this.inputElements.eq(0),v={blur:function(e){p(e)||r.disabled||r.readonly||p.prevent||(t=!1),u(e)},focus:function(){t||(c(),t=this)},keypress:function(e){if(!e.isDefaultPrevented()){var t,n=!0,a=e.keyCode;e.ctrlKey||e.metaKey||!o[i.type+"Signs"]?n=!1:(t=String.fromCharCode(null==e.charCode?a:e.charCode),n=!(" ">t||(o[i.type+"Signs"]+"0123456789").indexOf(t)>-1)),n&&e.preventDefault()}},input:"color"==this.type&&this.isValid?e.noop:function(){var e,t=function(){var e=i.parseValue(!0);e&&i.isValid(e)&&i.setInput(e)};return function(){clearTimeout(e),e=setTimeout(t,200)}}(),"input keydown keypress":function(){var t,n=!1,i=function(){n===!0?(n="semi",t=setTimeout(i,250)):n=!1},a=function(){n=!0,clearTimeout(t),t=setTimeout(i,300)},o=function(){var e=this;setTimeout(function(){e.focus(),e.select()},4),a()};return function(t){if(r.splitInput&&r.jumpInputs)if("input"==t.type){if(e.prop(this,"value").length===e.prop(this,"maxLength"))try{e(this).next().next("input, select").each(o)}catch(i){}}else t.shiftKey||t.crtlKey||9!=t.keyCode||n!==!0&&(!n||e.prop(this,"value"))||t.preventDefault()}}()},g=function(){return r.disabled||t||i.element.getShadowFocusElement().focus(),p.set(),!1};p.set=function(){var e,t=function(){p.prevent=!1};return function(){clearTimeout(e),p.prevent=!0,setTimeout(t,9)}}(),this.buttonWrapper.on("mousedown",g),this.setInput=function(e){i.value(e),s.call("input",e)},this.setChange=function(e){i.setInput(e),s.call("change",e)},this.inputElements.on(v),h[this.type]&&(["stepUp","stepDown"].forEach(function(e){d[e]=function(n){if(!r.disabled&&!r.readonly){t||g();var a=!1;n||(n=1);try{i.elemHelper[e](n),a=i.elemHelper.prop("value"),i.value(a),s.call("input",a)}catch(o){}return a}}}),r.noSpinbtn||(f[e.fn.mwheelIntent?"mwheelIntent":"mousewheel"]=function(e,n){n&&t&&!r.disabled&&(d[n>0?"stepUp":"stepDown"](),e.preventDefault())
  },f.keydown=function(t){if(!(r.list||t.isDefaultPrevented()||t.altKey&&40==t.keyCode||e.attr(this,"list"))){var n=!0,i=t.keyCode;38==i?d.stepUp():40==i?d.stepDown():n=!1,n&&t.preventDefault()}},m.attr({autocomplete:"off",role:"spinbutton"}).on(f)),e(this.buttonWrapper).on("mousepressstart mousepressend",".step-up, .step-down",n).on("mousedown mousepress",".step-up",function(){d.stepUp()}).on("mousedown mousepress",".step-down",function(){d.stepDown()})),"color"!=this.type&&function(){var t;r.splitInput?(t=function(){i.reorderInputs()},i.reorderInputs()):t=function(){r.value&&i.value(r.value,!0),l[i.type]&&r.placeholder&&i.placeholder(r.placeholder)},e(i.orig).onWSOff("wslocalechange",t)}(),c()},value:function(e,t){(!this._init||t||e!==this.options.value)&&(this.element.val(this.formatValue(e)),this.options.value=e,this._propertyChange("value"),this.mirrorValidity())},required:function(e,t){this.inputElements.attr({"aria-required":""+t}),this.mirrorValidity()},parseValue:function(t){var n=this.inputElements.map(function(){return e.prop(this,"value")}).get();return this.options.splitInput||(n=n[0]),s[this.type](n,this.options,t)},formatValue:function(e,t){return r[this.type](e,t===!1?!1:this.options)},createOpts:["readonly","title","disabled","tabindex","placeholder","value","required"],placeholder:function(t){var n=this.options;n.placeholder=t;var i=t;l[this.type]&&(i=l[this.type](t,this.options)),n.splitInput&&"object"==typeof i?e.each(this.splits,function(t,n){e.prop(n,"placeholder",i[t])}):this.element.prop("placeholder",i)},initDataList:function(){var t,n=this,i=function(){e(n.orig).jProp("list").off("updateDatalist",i).on("updateDatalist",i),clearTimeout(t),t=setTimeout(function(){n.list&&n.list()},9)};e(this.orig).onTrigger("listdatalistchange",i)},getOptions:function(){var t={},n=e(this.orig).jProp("list");return n.find("option").each(function(){t[e.prop(this,"value")]=e.prop(this,"label")}),[t,n.data("label")]},list:function(t){"number"==this.type&&this.element.attr("list",e.attr(this.orig,"list")),this.options.list=t,this._propertyChange("list")},_propertyChange:e.noop,tabindex:function(t){this.options.tabindex=t,this.inputElements.prop("tabindex",this.options.tabindex),e("button",this.buttonWrapper).prop("tabindex",this.options.tabindex)},title:function(t){!t&&this.orig&&null==e.attr(this.orig,"title")&&(t=null),this.options.title=t,null==t?this.inputElements.removeAttr("title"):this.inputElements.prop("title",this.options.title)}};["readonly","disabled"].forEach(function(t){var n="disabled"==t;f[t]=function(i,a){var r=this.options;r[t]==a&&this._init||(r[t]=!!a,!n&&r.buttonOnly?this.inputElements.attr({"aria-readonly":r[t]}):this.inputElements.prop(t,r[t]),this.buttonWrapper[r[t]?"addClass":"removeClass"]("ws-"+t),n&&e("button",this.buttonWrapper).prop("disabled",r[t]))}});var m=e.extend({},f,{_create:function(){var t=this.options,n=c(t.type);this.elemHelper=e('<input type="'+t.type+'" />'),this.asNumber=n.asNumber,this.asValue=n.asValue,this.isValid=n.isValid,f._create.apply(this,arguments),this._init=!1,this.buttonWrapper.html('<span unselectable="on" class="step-controls"><span class="step-up"></span><span class="step-down"></span></span>'),"number"==this.type&&this.inputElements.attr("inputmode","numeric"),t.min||"number"!=typeof t.relMin||(t.min=this.asValue(this.getRelNumber(t.relMin)),e.prop(this.orig,"min",t.min)),t.max||"number"!=typeof t.relMax||(t.max=this.asValue(this.getRelNumber(t.relMax)),e.prop(this.orig,"max",t.max)),this._init=!0},createOpts:["step","min","max","readonly","title","disabled","tabindex","placeholder","value","required"],_addSplitInputs:function(){if(!this.inputElements){var t=p[this.type]._create(this.options);this.splits=t.splits,this.inputElements=e(t.elements).prependTo(this.element).filter("input, select")}},getRelNumber:function(e){var t=h[this.type].start||0;return e&&(t+=e),t},addZero:v,_setStartInRange:function(){var e=this.getRelNumber(this.options.relDefaultValue);!isNaN(this.minAsNumber)&&this.minAsNumber>e?e=this.minAsNumber:!isNaN(this.maxAsNumber)&&e>this.maxAsNumber&&(e=this.maxAsNumber),this.elemHelper.prop("valueAsNumber",e),this.options.defValue=this.elemHelper.prop("value")},reorderInputs:function(){if(p[this.type]){var e=this.element;p[this.type].sort(e,this.options),setTimeout(function(){var n=t.data(e);n&&n.shadowData&&(n.shadowData.shadowFocusElement=e.find("input, select")[0]||e[0])},9)}},value:function(t,n){(!this._init||n||this.options.value!==t)&&(this.valueAsNumber=this.asNumber(t),this.options.value=t,isNaN(this.valueAsNumber)||!isNaN(this.minAsNumber)&&this.valueAsNumber<this.minAsNumber||!isNaN(this.maxAsNumber)&&this.valueAsNumber>this.maxAsNumber?this._setStartInRange():(this.elemHelper.prop("value",t),this.options.defValue=""),t=r[this.type](t,this.options),this.options.splitInput?e.each(this.splits,function(n,i){e.prop(i,"value",t[n])}):this.element.prop("value",t),this._propertyChange("value"),this.mirrorValidity())},step:function(e){var t=h[this.type];this.options.step=e,this.elemHelper.prop("step",i(e,t.step)),this.mirrorValidity()}});e.each({min:1,max:-1},function(e,t){var n=e+"AsNumber";m[e]=function(i){this.elemHelper.prop(e,i),this[n]=this.asNumber(i),null!=this.valueAsNumber&&(isNaN(this.valueAsNumber)||!isNaN(this[n])&&this.valueAsNumber*t<this[n]*t)&&this._setStartInRange(),this.options[e]=i,this._propertyChange(e),this.mirrorValidity()}}),e.fn.wsBaseWidget=function(t){return t=e.extend({},t),this.each(function(){e.webshims.objectCreate(f,{element:{value:e(this)}},t)})},e.fn.spinbtnUI=function(t){return t=e.extend({monthNames:"monthNames",size:1,startView:0},t),this.each(function(){e.webshims.objectCreate(m,{element:{value:e(this)}},t)})}}(),function(){var n={},a=function(e,n){return e=("color"==e?"color":"forms")+"-picker",a[n+"Loaded"+e]||(a[n+"Loaded"+e]=!0,t.ready(n,function(){t.loader.loadList([e])})),e};r.addZero=v,t.loader.addModule("forms-picker",{noAutoCallback:!0,options:r}),t.loader.addModule("color-picker",{noAutoCallback:!0,css:"jpicker/jpicker.css",options:r}),t.inlinePopover={_create:function(){this.element=e('<div class="ws-inline-picker"><div class="ws-po-box" /></div>').data("wspopover",this),this.contentElement=e(".ws-po-box",this.element),this.element.insertAfter(this.options.prepareFor)},show:e.noop,hide:e.noop,preventBlur:e.noop,isVisible:!0},n._genericSetFocus=function(t,n){if(t=e(t||this.activeButton),!this.popover.openedByFocus&&!n){var i=this,a=function(e){clearTimeout(i.timer),i.timer=setTimeout(function(){t[0]&&(t[0].focus(),e===!0||t.is(":focus")||a(!0))},i.popover.isVisible?99:360)};this.popover.activateElement(t),a()}},n._actions={changeInput:function(e,t,i){i.options.noChangeDismiss||n._actions.cancel(e,t,i),i.setChange(e)},cancel:function(e,t,n){n.options.inlinePicker||(t.stopOpen=!0,n.element.getShadowFocusElement().focus(),setTimeout(function(){t.stopOpen=!1},9),t.hide())}},n.commonInit=function(t,n){var a;n.isDirty=!0,n.element.on("updatepickercontent pickerchange",function(){a=!1}),t.options.inlinePicker||n.contentElement.on({keydown:function(i){if(9==i.keyCode){a||(a=e('input:not(:disabled), [tabindex="0"]:not(:disabled)',this).filter(":visible"));var r=a.index(i.target);if(i.shiftKey&&0>=r)return a.last().focus(),!1;if(!i.shiftKey&&r>=a.length-1)return a.first().focus(),!1}else if(27==i.keyCode)return t.element.getShadowFocusElement().focus(),n.hide(),!1}}),t._propertyChange=function(){var e,i=function(){n.isVisible&&n.element.triggerHandler("updatepickercontent")};return function(a){("value"!=a||t.options.inlinePicker)&&(n.isDirty=!0,n.isVisible&&(clearTimeout(e),e=setTimeout(i,9)))}}(),n.activeElement=e([]),n.activateElement=function(t){t=e(t),t[0]!=n.activeElement[0]&&(n.activeElement.removeClass("ws-focus"),t.addClass("ws-focus")),n.activeElement=t},n.element.on({wspopoverbeforeshow:function(){t.element.triggerHandler("wsupdatevalue"),n.element.triggerHandler("updatepickercontent")}}),e(t.orig).on("remove",function(n){n.originalEvent||e(i).off("wslocalechange",t._propertyChange)})},n._common=function(i){var r=i.options,o=t.objectCreate(r.inlinePicker?t.inlinePopover:t.wsPopover,{},{prepareFor:r.inlinePicker?i.buttonWrapper:i.element,position:r.widgetPosition}),s=e('<button type="button" class="ws-popover-opener"><span /></button>').appendTo(i.buttonWrapper),l=function(){(n[i.type].showPickerContent||n.showPickerContent)(i,o)},c=function(){var e=a(i.type,"DOM");r.disabled||r.readonly||!r.inlinePicker&&o.isVisible||(t.ready(e,l),o.show(i.element))},d=function(){(r.inlinePicker||o.isVisible)&&o.activeElement&&(o.openedByFocus=!1,o.activeElement.focus()),c()};r.containerElements.push(o.element[0]),"color"!=i.type&&(r.yearButtons&&(r.startView=2),r.startView||(r.startView=0),"time"==i.type&&(r.minView=3,r.startView=3),r.minView||(r.minView=0),r.startView<r.minView&&(r.startView=r.minView,t.warn("wrong config for minView/startView.")),r.size||(r.size=1)),o.element.addClass(i.type+"-popover input-picker").attr({role:"application"}).on({wspopoverhide:function(){o.openedByFocus=!1},focusin:function(e){o.activateElement&&(o.openedByFocus=!1,o.activateElement(e.target))},focusout:function(){o.activeElement&&o.activeElement.removeClass("ws-focus"),r.inlinePicker&&(o.openedByFocus=!0)}}),m(o.element.children("div.ws-po-outerbox").attr({role:"group"}),r.labels,!0),m(s,r.labels,!0),null!=r.tabindex&&s.attr({tabindex:r.tabindex}),r.disabled&&s.prop({disabled:!0}),s.on({click:d}),r.inlinePicker?o.openedByFocus=!0:(s.on({mousedown:function(){u.apply(this,arguments),o.preventBlur()},focus:function(){o.preventBlur()}}),function(){var e=!1,t=function(){e=!1};i.inputElements.on({keydown:function(e){40==e.keyCode&&e.altKey&&d()},focus:function(){!o.stopOpen&&(r.buttonOnly||r.openOnFocus||e&&r.openOnMouseFocus)?(o.openedByFocus=r.buttonOnly?!1:!r.noInput,c()):o.preventBlur()},mousedown:function(){e=!0,setTimeout(t,9),r.buttonOnly&&o.isVisible&&o.activeElement&&(o.openedByFocus=!1,setTimeout(function(){o.openedByFocus=!1,o.activeElement.focus()},4)),i.element.is(":focus")&&(o.openedByFocus=r.buttonOnly?!1:!r.noInput,c()),o.preventBlur()}})}()),i.popover=o,i.opener=s,e(i.orig).on("remove",function(e){e.originalEvent||setTimeout(function(){s.remove(),o.element.remove()},4)}),r.inlinePicker&&c(),a(i.type,"WINDOWLOAD")},n.month=n._common,n.date=n._common,n.time=n._common,n["datetime-local"]=n._common,n.color=function(t){var i=n._common.apply(this,arguments),a=e(t.orig).data("alphacontrol"),r=t.opener.prepend('<span class="ws-color-indicator-bg"><span class="ws-color-indicator" /></span>').find(".ws-color-indicator"),o=function(){r.css({backgroundColor:e.prop(this,"value")||"#000"})},s=function(){var e,n=function(){try{var e=t.alpha.prop("valueAsNumber")/(t.alpha.prop("max")||1);isNaN(e)||r.css({opacity:e})}catch(n){}};return function(t){clearTimeout(e),e=setTimeout(n,t&&"change"!=t.type?40:4)}}();return t.alpha=a?e("#"+a):e([]),e(t.orig).on("wsupdatevalue change",o).each(o),t.alpha.on("wsupdatevalue change input",s).each(s),i},t.picker=n}(),function(){var n,a,o=Modernizr.inputtypes,s={},l=["disabled","readonly","value","min","max","step","title","required","placeholder"],c=["data-placeholder","tabindex"];if(e.each(l.concat(c),function(e,i){var a=i.replace(/^data\-/,"");t.onNodeNamesPropertyModify("input",i,function(e,i){if(!n){var r=t.data(this,"shadowData");r&&r.data&&r.nativeElement===this&&r.data[a]&&r.data[a](e,i)}})}),r.replaceUI&&"valueAsNumber"in i.createElement("input")){var d=function(){t.data(this,"hasShadow")&&e.prop(this,"value",e.prop(this,"value"))};t.onNodeNamesPropertyModify("input","valueAsNumber",d),t.onNodeNamesPropertyModify("input","valueAsDate",d)}var f=function(){return function(t,n){s[t]=n,n.attrs=e.merge([],c,n.attrs),n.props=e.merge([],l,n.props)}}(),v=function(){return"none"!=e.css(this,"display")},g=function(t){var n,i=function(){e(t.orig).removeClass("ws-important-hide"),e.style(t.orig,"display","");var i,a,r,o=.6;(!n||t.orig.offsetWidth)&&(i=t.buttonWrapper&&t.buttonWrapper.filter(v).length,a=e.css(t.orig,"marginRight"),t.element.css({marginLeft:e.css(t.orig,"marginLeft"),marginRight:i?0:a}),i&&(r=parseInt(t.buttonWrapper.css("marginLeft"),10)||0,t.element.css({paddingRight:""}),0>r?(a=(parseInt(a,10)||0)+-1*(t.buttonWrapper.outerWidth()+r),t.buttonWrapper.css("marginRight",a),t.element.css({paddingRight:""}).css({paddingRight:(parseInt(t.element.css("paddingRight"),10)||0)+t.buttonWrapper.outerWidth()})):(t.buttonWrapper.css("marginRight",a),o=t.buttonWrapper.outerWidth(!0)+.6)),t.element.outerWidth(e(t.orig).outerWidth()-o)),n=!0,e(t.orig).addClass("ws-important-hide")};t.element.onWSOff("updateshadowdom",i,!0)},y=function(){var i,o,d,p,f,h=e.prop(this,"type");if(s[h]&&t.implement(this,"inputwidgets")){for(d={},p=h,f=e(this).jProp("labels"),o=e.extend({},r.widgets,r[h],e(e.prop(this,"form")).data(h)||{},e(this).data(h)||{},{orig:this,type:h,labels:f,options:{},input:function(e){o._change(e,"input")},change:function(e){o._change(e,"change")},_change:function(t,i){n=!0,e.prop(o.orig,"value",t),n=!1,i&&e(o.orig).trigger(i)},containerElements:[]}),i=0;l.length>i;i++)o[l[i]]=e.prop(this,l[i]);for(i=0;c.length>i;i++)p=c[i].replace(/^data\-/,""),"placeholder"!=p&&o[p]||(o[p]=e.attr(this,c[i])||o[p]);o.monthSelect&&(o.onlyMonthDigits=!0),o.onlyMonthDigits&&(o.formatMonthNames="monthDigits"),d.shim=s[h]._create(o),t.addShadowDom(this,d.shim.element,{data:d.shim||{}}),d.shim.options.containerElements.push(d.shim.element[0]),m(e(this).getShadowFocusElement(),f),e(this).on("change",function(){n||d.shim.value(e.prop(this,"value"))}),function(){var t,n={focusin:!0,focus:!0},i=!1,a=!1;e(d.shim.options.containerElements).on({"focusin focus focusout blur":function(r){r.stopImmediatePropagation(),a=n[r.type],clearTimeout(t),t=setTimeout(function(){a!=i&&(i=a,e(o.orig).triggerHandler(a?"focus":"blur"),e(o.orig).trigger(a?"focusin":"focusout")),i=a},0)}})}(),d.shim.element.on("change input",u),Modernizr.formvalidation&&e(o.orig).on("firstinvalid",function(n){(t.fromSubmit||!a)&&e(o.orig).off("invalid.replacedwidgetbubble").on("invalid.replacedwidgetbubble",function(i){n.isInvalidUIPrevented()||i.isDefaultPrevented()||(t.validityAlert.showFor(n.target),n.preventDefault(),i.preventDefault()),e(o.orig).off("invalid.replacedwidgetbubble")})}),d.shim.buttonWrapper&&d.shim.buttonWrapper.filter(v).length&&d.shim.element.addClass("has-input-buttons"),d.shim.element.addClass(e.prop(this,"className")),o.calculateWidth?g(d.shim):e(this).addClass("ws-important-hide")}};Modernizr.formvalidation&&["input","form"].forEach(function(e){var n=t.defineNodeNameProperty(e,"checkValidity",{prop:{value:function(){a=!0;var e=n.prop._supvalue.apply(this,arguments);return a=!1,e}}})}),(!o.range||r.replaceUI)&&f("range",{_create:function(t){var n=e("<span />").insertAfter(t.orig).rangeUI(t).data("rangeUi");return n}});var b=o.number&&-1==navigator.userAgent.indexOf("Touch")&&(/MSIE 1[0|1]\.\d/.test(navigator.userAgent)||/Trident\/7\.0/.test(navigator.userAgent));["number","time","month","date","color","datetime-local"].forEach(function(n){(!o[n]||r.replaceUI||"number"==n&&b)&&f(n,{_create:function(i){i.monthSelect&&(i.splitInput=!0),i.splitInput&&!p[n]&&(t.warn("splitInput not supported for "+n),i.splitInput=!1);var a=i.splitInput?'<span class="ws-'+n+' ws-input" role="group"></span>':'<input class="ws-'+n+'" type="text" />',r=e(a).insertAfter(i.orig);return r=h[n]?r.spinbtnUI(i).data("wsWidget"+n):r.wsBaseWidget(i).data("wsWidget"+n),t.picker&&t.picker[n]&&t.picker[n](r),r.buttonWrapper.addClass("input-button-size-"+r.buttonWrapper.children().filter(v).length),r}})}),t.addReady(function(t,n){e("input",t).add(n.filter("input")).each(y)})}()});