diff --git a/CHANGELOG.md b/CHANGELOG.md index 54de1334..a8215fbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +# [1.0.7](https://github.com/andrewhathaway/Winterfell/releases/tag/1.0.7) (2016-07-23) + +**Fixed bugs:** + +- CheckboxInputOptions stores values from all checkbox questions. [Commit](https://github.com/andrewhathaway/Winterfell/commit/f5854356c65ef0fc008cb71a4d53573ce4234d4c) [Issue](https://github.com/andrewhathaway/Winterfell/issues/45) +- Fix addValidationMethods. [PR](https://github.com/andrewhathaway/Winterfell/pull/61) +- Mistake in the default error message for isLength rule. [PR](https://github.com/andrewhathaway/Winterfell/pull/63) [Issue](https://github.com/andrewhathaway/Winterfell/issues/58) # [1.0.6](https://github.com/andrewhathaway/Winterfell/releases/tag/1.0.6) (2016-01-02) diff --git a/dist/inputTypes/checkboxOptionsInput.js b/dist/inputTypes/checkboxOptionsInput.js index f99666e3..b70782c0 100644 --- a/dist/inputTypes/checkboxOptionsInput.js +++ b/dist/inputTypes/checkboxOptionsInput.js @@ -10,6 +10,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== 'function' var React = require('react'); +var CloneArray = require('../lib/cloneArray'); + var CheckboxOptionsInput = (function (_React$Component) { _inherits(CheckboxOptionsInput, _React$Component); @@ -19,7 +21,7 @@ var CheckboxOptionsInput = (function (_React$Component) { _get(Object.getPrototypeOf(CheckboxOptionsInput.prototype), 'constructor', this).call(this, props); this.state = { - value: this.props.value + value: this.props.value.length > 0 ? cloneArray(this.props.value) : [] }; } diff --git a/dist/inputTypes/selectInput.js b/dist/inputTypes/selectInput.js index fa7154fe..25688667 100644 --- a/dist/inputTypes/selectInput.js +++ b/dist/inputTypes/selectInput.js @@ -85,4 +85,4 @@ SelectInput.defaultProps = { onBlur: function onBlur() {} }; -module.exports = SelectInput; +module.exports = SelectInput; \ No newline at end of file diff --git a/dist/lib/cloneArray.js b/dist/lib/cloneArray.js new file mode 100644 index 00000000..1f8aae71 --- /dev/null +++ b/dist/lib/cloneArray.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (array) { + return array.slice(0); +}; \ No newline at end of file diff --git a/dist/lib/errors.js b/dist/lib/errors.js index 7f0b2682..449c0528 100644 --- a/dist/lib/errors.js +++ b/dist/lib/errors.js @@ -18,7 +18,7 @@ var errorMessages = { break; case 2: - return 'Please enter a valiue between ' + validationItem.params[0] + ' and ' + validationItem.params[1] + ' characters long'; + return 'Please enter a value between ' + validationItem.params[0] + ' and ' + validationItem.params[1] + ' characters long'; break; default: @@ -117,7 +117,7 @@ var errorMessages = { /* * Mobile phone */ - isMobilePhone: 'Please enter a valid mobile phone', + isMobilePhone: 'Please enter a valid mobile number', /* * MongoId only diff --git a/dist/lib/validation.js b/dist/lib/validation.js index 8dea9e74..e61db363 100644 --- a/dist/lib/validation.js +++ b/dist/lib/validation.js @@ -195,7 +195,7 @@ var addValidationMethods = function addValidationMethods(methods) { } for (var methodName in methods) { - addValidationMethod[methodName] = methods[methodName]; + addValidationMethod(methodName, methods[methodName]); } }; diff --git a/dist/questionPanel.js b/dist/questionPanel.js index fc2f93b9..53343e06 100644 --- a/dist/questionPanel.js +++ b/dist/questionPanel.js @@ -270,4 +270,4 @@ QuestionPanel.defaultProps = { panelHistory: [] }; -module.exports = QuestionPanel; +module.exports = QuestionPanel; \ No newline at end of file diff --git a/dist/winterfell.min.js b/dist/winterfell.min.js index 7672e659..5cd49364 100644 --- a/dist/winterfell.min.js +++ b/dist/winterfell.min.js @@ -1,6 +1,6 @@ -var Winterfell=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var i=function(){function t(t,e){for(var n=0;ne.index});var o="undefined"!=typeof this.props.panelId?this.props.panelId:n.formPanels.length>0?n.formPanels[0].panelId:void 0,i="undefined"!=typeof n&&"undefined"!=typeof n.formPanels&&"undefined"!=typeof o?s.find(n.formPanels,function(t){return t.panelId==o}):void 0;if(!i)throw new Error("Winterfell: Could not find initial panel and failed to render.");this.state={schema:n,currentPanel:i,action:this.props.action,questionAnswers:this.props.questionAnswers}}return o(e,t),i(e,[{key:"componentWillReceiveProps",value:function(t){this.setState({action:t.action,schema:t.schema,questionAnswers:t.questionAnswers})}},{key:"handleAnswerChange",value:function(t,e){var n=s.chain(this.state.questionAnswers).set(t,e).value();this.setState({questionAnswers:n},this.props.onUpdate.bind(null,n))}},{key:"handleSwitchPanel",value:function(t,e){var n=s.find(this.props.schema.formPanels,{panelId:t});if(!n)throw new Error('Winterfell: Tried to switch to panel "'+t+'", which does not exist.');e||this.panelHistory.push(n.panelId),this.setState({currentPanel:n},this.props.onSwitchPanel.bind(null,n))}},{key:"handleBackButtonClick",value:function(){this.panelHistory.pop(),this.handleSwitchPanel.call(this,this.panelHistory[this.panelHistory.length-1],!0)}},{key:"handleSubmit",value:function(t){var e=this;return this.props.disableSubmit?void this.props.onSubmit(this.state.questionAnswers,t):void this.setState({action:t},function(){a.findDOMNode(e.refs[e.props.ref]).submit()})}},{key:"render",value:function(){var t=this,e=s.find(this.state.schema.questionPanels,function(e){return e.panelId==t.state.currentPanel.panelId});return a.createElement("form",{method:this.props.method,encType:this.props.encType,action:this.state.action,ref:this.props.ref,className:this.state.schema.classes.form},a.createElement("div",{className:this.state.schema.classes.questionPanels},a.createElement(l,{schema:this.state.schema,classes:this.state.schema.classes,panelId:e.panelId,panelIndex:e.panelIndex,panelHeader:e.panelHeader,panelText:e.panelText,action:e.action,button:e.button,backButton:e.backButton,questionSets:e.questionSets,questionAnswers:this.state.questionAnswers,panelHistory:this.panelHistory,renderError:this.props.renderError,renderRequiredAsterisk:this.props.renderRequiredAsterisk,onAnswerChange:this.handleAnswerChange.bind(this),onPanelBack:this.handleBackButtonClick.bind(this),onSwitchPanel:this.handleSwitchPanel.bind(this),onSubmit:this.handleSubmit.bind(this)})))}},{key:"componentDidMount",value:function(){this.panelHistory.push(this.state.currentPanel.panelId),this.props.onRender()}}]),e}(a.Component);c.defaultProps={schema:{formPanels:[],questionPanels:[],questionSets:[],classes:{}},questionAnswers:{},ref:"form",encType:"application/x-www-form-urlencoded",method:"POST",action:"",panelId:void 0,disableSubmit:!1,renderError:void 0,renderRequiredAsterisk:void 0,onSubmit:function(){},onUpdate:function(){},onSwitchPanel:function(){},onRender:function(){}},c.inputTypes=n(3),c.errorMessages=n(4),c.validation=n(5),c.addInputType=c.inputTypes.addInputType,c.addInputTypes=c.inputTypes.addInputTypes,c.addErrorMessage=c.errorMessages.addErrorMessage,c.addErrorMessages=c.errorMessages.addErrorMessages,c.addValidationMethod=c.validation.addValidationMethod,c.addValidationMethods=c.validation.addValidationMethods,t.exports=c},function(t,e){t.exports=React},function(t,e,n){var r;(function(t,o){(function(){function i(t,e){if(t!==e){var n=null===t,r=t===A,o=t===t,i=null===e,u=e===A,a=e===e;if(t>e&&!i||!o||n&&!u&&a||r&&a)return 1;if(e>t&&!n||!a||i&&!r&&o||u&&o)return-1}return 0}function u(t,e,n){for(var r=t.length,o=n?r:-1;n?o--:++o-1;);return n}function f(t,e){for(var n=t.length;n--&&e.indexOf(t.charAt(n))>-1;);return n}function p(t,e){return i(t.criteria,e.criteria)||t.index-e.index}function h(t,e,n){for(var r=-1,o=t.criteria,u=e.criteria,a=o.length,s=n.length;++r=s)return l;var c=n[r];return l*("asc"===c||c===!0?1:-1)}}return t.index-e.index}function d(t){return Qt[t]}function v(t){return zt[t]}function y(t,e,n){return e?t=Jt[t]:n&&(t=Gt[t]),"\\"+t}function g(t){return"\\"+Gt[t]}function _(t,e,n){for(var r=t.length,o=e+(n?0:-1);n?o--:++o=t&&t>=9&&13>=t||32==t||160==t||5760==t||6158==t||t>=8192&&(8202>=t||8232==t||8233==t||8239==t||8287==t||12288==t||65279==t)}function w(t,e){for(var n=-1,r=t.length,o=-1,i=[];++ne,o=n?t.length:0,i=Qn(0,o,this.__views__),u=i.start,a=i.end,s=a-u,l=r?a:u-1,c=this.__iteratees__,f=c.length,p=0,h=Ou(s,this.__takeCount__);if(!n||W>o||o==s&&h==s)return nn(r&&n?t.reverse():t,this.__actions__);var d=[];t:for(;s--&&h>p;){l+=e;for(var v=-1,y=t[l];++v=W?vn(e):null,l=e.length;s&&(i=Gt,u=!1,e=s);t:for(;++on&&(n=-n>o?0:o+n),r=r===A||r>o?o:+r||0,0>r&&(r+=o),o=n>r?0:r>>>0,n>>>=0;o>n;)t[n++]=e;return t}function Ae(t,e){var n=[];return Tu(t,function(t,r,o){e(t,r,o)&&n.push(t)}),n}function je(t,e,n,r){var o;return n(t,function(t,n,i){return e(t,n,i)?(o=r?n:t,!1):void 0}),o}function Ce(t,e,n,r){r||(r=[]);for(var o=-1,i=t.length;++or;)t=t[e[r++]];return r&&r==o?t:A}}function Be(t,e,n,r,o,i){return t===e?!0:null==t||null==e||!Bo(t)&&!b(e)?t!==t&&e!==e:Te(t,e,Be,n,r,o,i)}function Te(t,e,n,r,o,i,u){var a=Ca(t),s=Ca(e),l=V,c=V;a||(l=ru.call(t),l==z?l=et:l!=et&&(a=Ho(t))),s||(c=ru.call(e),c==z?c=et:c!=et&&(s=Ho(e)));var f=l==et,p=c==et,h=l==c;if(h&&!a&&!f)return $n(t,e,l);if(!o){var d=f&&eu.call(t,"__wrapped__"),v=p&&eu.call(e,"__wrapped__");if(d||v)return n(d?t.value():t,v?e.value():e,r,o,i,u)}if(!h)return!1;i||(i=[]),u||(u=[]);for(var y=i.length;y--;)if(i[y]==t)return u[y]==e;i.push(t),u.push(e);var g=(a?Rn:Mn)(t,e,n,r,o,i,u);return i.pop(),u.pop(),g}function Ne(t,e,n){var r=e.length,o=r,i=!n;if(null==t)return!o;for(t=fr(t);r--;){var u=e[r];if(i&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++re&&(e=-e>o?0:o+e),n=n===A||n>o?o:+n||0,0>n&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Li(o);++r=W,s=u?vn():null,l=[];s?(r=Gt,i=!1):(u=!1,s=e?[]:l);t:for(;++n=o){for(;o>r;){var i=r+o>>>1,u=t[i];(n?e>=u:e>u)&&null!==u?r=i+1:o=i}return o}return on(t,e,ji,n)}function on(t,e,n,r){e=n(e);for(var o=0,i=t?t.length:0,u=e!==e,a=null===e,s=e===A;i>o;){var l=_u((o+i)/2),c=n(t[l]),f=c!==A,p=c===c;if(u)var h=p||r;else h=a?p&&f&&(r||null!=c):s?p&&(r||f):null==c?!1:r?e>=c:e>c;h?o=l+1:i=l}return Ou(i,qu)}function un(t,e,n){if("function"!=typeof t)return ji;if(e===A)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,o){return t.call(e,n,r,o)};case 4:return function(n,r,o,i){return t.call(e,n,r,o,i)};case 5:return function(n,r,o,i,u){return t.call(e,n,r,o,i,u)}}return function(){return t.apply(e,arguments)}}function an(t){var e=new uu(t.byteLength),n=new du(e);return n.set(new du(t)),e}function sn(t,e,n){for(var r=n.length,o=-1,i=xu(t.length-r,0),u=-1,a=e.length,s=Li(a+i);++u2?n[o-2]:A,u=o>2?n[2]:A,a=o>1?n[o-1]:A;for("function"==typeof i?(i=un(i,a,5),o-=2):(i="function"==typeof a?a:A,o-=i?1:0),u&&Yn(n[0],n[1],u)&&(i=3>o?A:i,o=1);++r-1?n[i]:A}return je(n,r,t)}}function xn(t){return function(e,n,r){return e&&e.length?(n=Ln(n,r,3),u(e,n,t)):-1}}function On(t){return function(e,n,r){return n=Ln(n,r,3),je(e,n,t,!0)}}function En(t){return function(){for(var e,n=arguments.length,o=t?n:-1,i=0,u=Li(n);t?o--:++o=W)return e.plant(r).value();for(var o=0,i=n?u[o].apply(this,t):r;++o_){var E=a?te(a):A,k=xu(l-_,0),P=d?O:A,j=d?A:O,I=d?m:A,F=d?A:m;e|=d?D:B,e&=~(d?B:D),v||(e&=~(C|q));var S=[t,e,n,I,P,F,j,E,s,k],T=Fn.apply(A,S);return er(t)&&Uu(T,S),T.placeholder=x,T}}var N=p?n:this,R=h?N[t]:t;return a&&(m=sr(m,a)),f&&s=e||!mu(e))return"";var o=e-r;return n=null==n?" ":n+"",gi(n,yu(o/n.length)).slice(0,o)}function Dn(t,e,n,r){function o(){for(var e=-1,a=arguments.length,s=-1,l=r.length,c=Li(l+a);++ss))return!1;for(;++a-1&&t%1==0&&e>t}function Yn(t,e,n){if(!Bo(n))return!1;var r=typeof e;if("number"==r?Gn(n)&&Xn(e,n.length):"string"==r&&e in n){var o=n[e];return t===t?t===o:o!==o}return!1}function tr(t,e){var n=typeof t;if("string"==n&&At.test(t)||"number"==n)return!0;if(Ca(t))return!1;var r=!Pt.test(t);return r||null!=e&&t in fr(e)}function er(t){var n=Wn(t);if(!(n in o.prototype))return!1;var r=e[n];if(t===r)return!0;var i=Lu(r);return!!i&&t===i[0]}function nr(t){return"number"==typeof t&&t>-1&&t%1==0&&Fu>=t}function rr(t){return t===t&&!Bo(t)}function or(t,e){var n=t[1],r=e[1],o=n|r,i=T>o,u=r==T&&n==F||r==T&&n==N&&t[7].length<=e[8]||r==(T|N)&&n==F;if(!i&&!u)return t;r&C&&(t[2]=e[2],o|=n&C?0:I);var a=e[3];if(a){var s=t[3];t[3]=s?sn(s,a,e[4]):te(a),t[4]=s?w(t[3],Q):te(e[4])}return a=e[5],a&&(s=t[5],t[5]=s?ln(s,a,e[6]):te(a),t[6]=s?w(t[5],Q):te(e[6])),a=e[7],a&&(t[7]=te(a)),r&T&&(t[8]=null==t[8]?e[8]:Ou(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o,t}function ir(t,e){return t===A?e:qa(t,e,ir)}function ur(t,e){t=fr(t);for(var n=-1,r=e.length,o={};++nr;)u[++i]=Ve(t,r,r+=e);return u}function vr(t){for(var e=-1,n=t?t.length:0,r=-1,o=[];++ee?0:e)):[]}function gr(t,e,n){var r=t?t.length:0;return r?((n?Yn(t,e,n):null==e)&&(e=1),e=r-(+e||0),Ve(t,0,0>e?0:e)):[]}function _r(t,e,n){return t&&t.length?en(t,Ln(e,n,3),!0,!0):[]}function br(t,e,n){return t&&t.length?en(t,Ln(e,n,3),!0):[]}function mr(t,e,n,r){var o=t?t.length:0;return o?(n&&"number"!=typeof n&&Yn(t,e,n)&&(n=0,r=o),Pe(t,e,n,r)):[]}function wr(t){return t?t[0]:A}function xr(t,e,n){var r=t?t.length:0;return n&&Yn(t,e,n)&&(e=!1),r?Ce(t,e):[]}function Or(t){var e=t?t.length:0;return e?Ce(t,!0):[]}function Er(t,e,n){var r=t?t.length:0;if(!r)return-1;if("number"==typeof n)n=0>n?xu(r+n,0):n;else if(n){var o=rn(t,e);return r>o&&(e===e?e===t[o]:t[o]!==t[o])?o:-1}return a(t,e,n||0)}function kr(t){return gr(t,1)}function Pr(t){var e=t?t.length:0;return e?t[e-1]:A}function Ar(t,e,n){var r=t?t.length:0;if(!r)return-1;var o=r;if("number"==typeof n)o=(0>n?xu(r+n,0):Ou(n||0,r-1))+1;else if(n){o=rn(t,e,!0)-1;var i=t[o];return(e===e?e===i:i!==i)?o:-1}if(e!==e)return _(t,o,!0);for(;o--;)if(t[o]===e)return o;return-1}function jr(){var t=arguments,e=t[0];if(!e||!e.length)return e;for(var n=0,r=Un(),o=t.length;++n-1;)hu.call(e,i,1);return e}function Cr(t,e,n){var r=[];if(!t||!t.length)return r;var o=-1,i=[],u=t.length;for(e=Ln(e,n,3);++oe?0:e)):[]}function Sr(t,e,n){var r=t?t.length:0;return r?((n?Yn(t,e,n):null==e)&&(e=1),e=r-(+e||0),Ve(t,0>e?0:e)):[]}function Dr(t,e,n){return t&&t.length?en(t,Ln(e,n,3),!1,!0):[]}function Br(t,e,n){return t&&t.length?en(t,Ln(e,n,3)):[]}function Tr(t,e,n,r){var o=t?t.length:0;if(!o)return[];null!=e&&"boolean"!=typeof e&&(r=n,n=Yn(t,e,r)?A:e,e=!1);var i=Ln();return(null!=n||i!==me)&&(n=i(n,r,3)),e&&Un()==a?x(t,n):Ye(t,n)}function Nr(t){if(!t||!t.length)return[];var e=-1,n=0;t=ae(t,function(t){return Gn(t)?(n=xu(t.length,n),!0):void 0});for(var r=Li(n);++en?xu(o+n,0):n||0,"string"==typeof t||!Ca(t)&&Uo(t)?o>=n&&t.indexOf(e,n)>-1:!!o&&Un(t,e,n)>-1}function to(t,e,n){var r=Ca(t)?se:Re;return e=Ln(e,n,3),r(t,e)}function eo(t,e){return to(t,Di(e))}function no(t,e,n){var r=Ca(t)?ae:Ae;return e=Ln(e,n,3),r(t,function(t,n,r){return!e(t,n,r)})}function ro(t,e,n){if(n?Yn(t,e,n):null==e){t=cr(t);var r=t.length;return r>0?t[Qe(0,r-1)]:A}var o=-1,i=Vo(t),r=i.length,u=r-1;for(e=Ou(0>e?0:+e||0,r);++o0&&(n=e.apply(this,arguments)),1>=t&&(e=A),n}}function ho(t,e,n){function r(){h&&au(h),l&&au(l),v=0,l=h=d=A}function o(e,n){n&&au(n),l=h=d=A,e&&(v=va(),c=t.apply(p,s),h||l||(s=p=A))}function i(){var t=e-(va()-f);0>=t||t>e?o(d,l):h=pu(i,t)}function u(){o(g,h)}function a(){if(s=arguments,f=va(),p=this,d=g&&(h||!_),y===!1)var n=_&&!h;else{l||_||(v=f);var r=y-(f-v),o=0>=r||r>y;o?(l&&(l=au(l)),v=f,c=t.apply(p,s)):l||(l=pu(u,r))}return o&&h?h=au(h):h||e===y||(h=pu(i,e)),n&&(o=!0,c=t.apply(p,s)),!o||h||l||(s=p=A),c}var s,l,c,f,p,h,d,v=0,y=!1,g=!0;if("function"!=typeof t)throw new Ji(K);if(e=0>e?0:+e||0,n===!0){var _=!0;g=!1}else Bo(n)&&(_=!!n.leading,y="maxWait"in n&&xu(+n.maxWait||0,e),g="trailing"in n?!!n.trailing:g);return a.cancel=r, -a}function vo(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new Ji(K);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var u=t.apply(this,r);return n.cache=i.set(o,u),u};return n.cache=new vo.Cache,n}function yo(t){if("function"!=typeof t)throw new Ji(K);return function(){return!t.apply(this,arguments)}}function go(t){return po(2,t)}function _o(t,e){if("function"!=typeof t)throw new Ji(K);return e=xu(e===A?t.length-1:+e||0,0),function(){for(var n=arguments,r=-1,o=xu(n.length-e,0),i=Li(o);++re}function ko(t,e){return t>=e}function Po(t){return b(t)&&Gn(t)&&eu.call(t,"callee")&&!cu.call(t,"callee")}function Ao(t){return t===!0||t===!1||b(t)&&ru.call(t)==Z}function jo(t){return b(t)&&ru.call(t)==J}function Co(t){return!!t&&1===t.nodeType&&b(t)&&!Lo(t)}function qo(t){return null==t?!0:Gn(t)&&(Ca(t)||Uo(t)||Po(t)||b(t)&&Do(t.splice))?!t.length:!Ma(t).length}function Io(t,e,n,r){n="function"==typeof n?un(n,r,3):A;var o=n?n(t,e):A;return o===A?Be(t,e,n):!!o}function Fo(t){return b(t)&&"string"==typeof t.message&&ru.call(t)==G}function So(t){return"number"==typeof t&&mu(t)}function Do(t){return Bo(t)&&ru.call(t)==X}function Bo(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function To(t,e,n,r){return n="function"==typeof n?un(n,r,3):A,Ne(t,Hn(e),n)}function No(t){return Mo(t)&&t!=+t}function Ro(t){return null==t?!1:Do(t)?iu.test(tu.call(t)):b(t)&&Tt.test(t)}function $o(t){return null===t}function Mo(t){return"number"==typeof t||b(t)&&ru.call(t)==tt}function Lo(t){var e;if(!b(t)||ru.call(t)!=et||Po(t)||!eu.call(t,"constructor")&&(e=t.constructor,"function"==typeof e&&!(e instanceof e)))return!1;var n;return qe(t,function(t,e){n=e}),n===A||eu.call(t,n)}function Wo(t){return Bo(t)&&ru.call(t)==nt}function Uo(t){return"string"==typeof t||b(t)&&ru.call(t)==ot}function Ho(t){return b(t)&&nr(t.length)&&!!Ht[ru.call(t)]}function Ko(t){return t===A}function Qo(t,e){return e>t}function zo(t,e){return e>=t}function Vo(t){var e=t?Wu(t):0;return nr(e)?e?te(t):[]:ui(t)}function Zo(t){return be(t,ei(t))}function Jo(t,e,n){var r=Bu(t);return n&&Yn(t,e,n)&&(e=A),e?ge(r,e):r}function Go(t){return Se(t,ei(t))}function Xo(t,e,n){var r=null==t?A:De(t,pr(e),e+"");return r===A?n:r}function Yo(t,e){if(null==t)return!1;var n=eu.call(t,e);if(!n&&!tr(e)){if(e=pr(e),t=1==e.length?t:De(t,Ve(e,0,-1)),null==t)return!1;e=Pr(e),n=eu.call(t,e)}return n||nr(t.length)&&Xn(e,t.length)&&(Ca(t)||Po(t))}function ti(t,e,n){n&&Yn(t,e,n)&&(e=A);for(var r=-1,o=Ma(t),i=o.length,u={};++r0;++r=Ou(e,n)&&tn?0:+n||0,r),n-=e.length,n>=0&&t.indexOf(e,n)==n}function hi(t){return t=l(t),t&&xt.test(t)?t.replace(mt,v):t}function di(t){return t=l(t),t&&qt.test(t)?t.replace(Ct,y):t||"(?:)"}function vi(t,e,n){t=l(t),e=+e;var r=t.length;if(r>=e||!mu(e))return t;var o=(e-r)/2,i=_u(o),u=yu(o);return n=Sn("",u,n),n.slice(0,i)+t+n}function yi(t,e,n){return(n?Yn(t,e,n):null==e)?e=0:e&&(e=+e),t=mi(t),ku(t,e||(Bt.test(t)?16:10))}function gi(t,e){var n="";if(t=l(t),e=+e,1>e||!t||!mu(e))return n;do e%2&&(n+=t),e=_u(e/2),t+=t;while(e);return n}function _i(t,e,n){return t=l(t),n=null==n?0:Ou(0>n?0:+n||0,t.length),t.lastIndexOf(e,n)==n}function bi(t,n,r){var o=e.templateSettings;r&&Yn(t,n,r)&&(n=r=A),t=l(t),n=ye(ge({},r||n),o,ve);var i,u,a=ye(ge({},n.imports),o.imports,ve),s=Ma(a),c=tn(a,s),f=0,p=n.interpolate||$t,h="__p += '",d=Vi((n.escape||$t).source+"|"+p.source+"|"+(p===kt?St:$t).source+"|"+(n.evaluate||$t).source+"|$","g"),v="//# sourceURL="+("sourceURL"in n?n.sourceURL:"lodash.templateSources["+ ++Ut+"]")+"\n";t.replace(d,function(e,n,r,o,a,s){return r||(r=o),h+=t.slice(f,s).replace(Mt,g),n&&(i=!0,h+="' +\n__e("+n+") +\n'"),a&&(u=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),f=s+e.length,e}),h+="';\n";var y=n.variable;y||(h="with (obj) {\n"+h+"\n}\n"),h=(u?h.replace(yt,""):h).replace(gt,"$1").replace(_t,"$1;"),h="function("+(y||"obj")+") {\n"+(y?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var _=Ga(function(){return Hi(s,v+"return "+h).apply(A,c)});if(_.source=h,Fo(_))throw _;return _}function mi(t,e,n){var r=t;return(t=l(t))?(n?Yn(r,e,n):null==e)?t.slice(O(t),E(t)+1):(e+="",t.slice(c(t,e),f(t,e)+1)):t}function wi(t,e,n){var r=t;return t=l(t),t?(n?Yn(r,e,n):null==e)?t.slice(O(t)):t.slice(c(t,e+"")):t}function xi(t,e,n){var r=t;return t=l(t),t?(n?Yn(r,e,n):null==e)?t.slice(0,E(t)+1):t.slice(0,f(t,e+"")+1):t}function Oi(t,e,n){n&&Yn(t,e,n)&&(e=A);var r=R,o=$;if(null!=e)if(Bo(e)){var i="separator"in e?e.separator:i;r="length"in e?+e.length||0:r,o="omission"in e?l(e.omission):o}else r=+e||0;if(t=l(t),r>=t.length)return t;var u=r-o.length;if(1>u)return o;var a=t.slice(0,u);if(null==i)return a+o;if(Wo(i)){if(t.slice(u).search(i)){var s,c,f=t.slice(0,u);for(i.global||(i=Vi(i.source,(Dt.exec(i)||"")+"g")),i.lastIndex=0;s=i.exec(f);)c=s.index;a=a.slice(0,null==c?u:c)}}else if(t.indexOf(i,u)!=u){var p=a.lastIndexOf(i);p>-1&&(a=a.slice(0,p))}return a+o}function Ei(t){return t=l(t),t&&wt.test(t)?t.replace(bt,k):t}function ki(t,e,n){return n&&Yn(t,e,n)&&(e=A),t=l(t),t.match(e||Lt)||[]}function Pi(t,e,n){return n&&Yn(t,e,n)&&(e=A),b(t)?Ci(t):me(t,e)}function Ai(t){return function(){return t}}function ji(t){return t}function Ci(t){return $e(we(t,!0))}function qi(t,e){return Me(t,we(e,!0))}function Ii(t,e,n){if(null==n){var r=Bo(e),o=r?Ma(e):A,i=o&&o.length?Se(e,o):A;(i?i.length:r)||(i=!1,n=e,e=t,t=this)}i||(i=Se(e,Ma(e)));var u=!0,a=-1,s=Do(t),l=i.length;n===!1?u=!1:Bo(n)&&"chain"in n&&(u=n.chain);for(;++at||!mu(t))return[];var r=-1,o=Li(Ou(t,Cu));for(e=un(e,n,1);++rr?o[r]=e(r):e(r);return o}function Ri(t){var e=++nu;return l(t)+e}function $i(t,e){return(+t||0)+(+e||0)}function Mi(t,e,n){return n&&Yn(t,e,n)&&(e=A),e=Ln(e,n,3),1==e.length?he(Ca(t)?t:cr(t),e):Xe(t,e)}t=t?oe.defaults(re.Object(),t,oe.pick(re,Wt)):re;var Li=t.Array,Wi=t.Date,Ui=t.Error,Hi=t.Function,Ki=t.Math,Qi=t.Number,zi=t.Object,Vi=t.RegExp,Zi=t.String,Ji=t.TypeError,Gi=Li.prototype,Xi=zi.prototype,Yi=Zi.prototype,tu=Hi.prototype.toString,eu=Xi.hasOwnProperty,nu=0,ru=Xi.toString,ou=re._,iu=Vi("^"+tu.call(eu).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),uu=t.ArrayBuffer,au=t.clearTimeout,su=t.parseFloat,lu=Ki.pow,cu=Xi.propertyIsEnumerable,fu=Kn(t,"Set"),pu=t.setTimeout,hu=Gi.splice,du=t.Uint8Array,vu=Kn(t,"WeakMap"),yu=Ki.ceil,gu=Kn(zi,"create"),_u=Ki.floor,bu=Kn(Li,"isArray"),mu=t.isFinite,wu=Kn(zi,"keys"),xu=Ki.max,Ou=Ki.min,Eu=Kn(Wi,"now"),ku=t.parseInt,Pu=Ki.random,Au=Qi.NEGATIVE_INFINITY,ju=Qi.POSITIVE_INFINITY,Cu=4294967295,qu=Cu-1,Iu=Cu>>>1,Fu=9007199254740991,Su=vu&&new vu,Du={};e.support={};e.templateSettings={escape:Ot,evaluate:Et,interpolate:kt,variable:"",imports:{_:e}};var Bu=function(){function t(){}return function(e){if(Bo(e)){t.prototype=e;var n=new t;t.prototype=A}return n||{}}}(),Tu=pn(Ie),Nu=pn(Fe,!0),Ru=hn(),$u=hn(!0),Mu=Su?function(t,e){return Su.set(t,e),t}:ji,Lu=Su?function(t){return Su.get(t)}:Si,Wu=Ue("length"),Uu=function(){var t=0,e=0;return function(n,r){var o=va(),i=L-(o-e);if(e=o,i>0){if(++t>=M)return n}else t=0;return Mu(n,r)}}(),Hu=_o(function(t,e){return b(t)&&Gn(t)?Oe(t,Ce(e,!1,!0)):[]}),Ku=xn(),Qu=xn(!0),zu=_o(function(t){for(var e=t.length,n=e,r=Li(f),o=Un(),i=o==a,u=[];n--;){var s=t[n]=Gn(s=t[n])?s:[];r[n]=i&&s.length>=120?vn(n&&s):null}var l=t[0],c=-1,f=l?l.length:0,p=r[0];t:for(;++c2?t[e-2]:A,r=e>1?t[e-1]:A;return e>2&&"function"==typeof n?e-=2:(n=e>1&&"function"==typeof r?(--e,r):A,r=A),t.length=e,Rr(t,n,r)}),ea=_o(function(t){return t=Ce(t),this.thru(function(e){return Yt(Ca(e)?e:[fr(e)],t)})}),na=_o(function(t,e){return _e(t,Ce(e))}),ra=cn(function(t,e,n){eu.call(t,n)?++t[n]:t[n]=1}),oa=wn(Tu),ia=wn(Nu,!0),ua=kn(ee,Tu),aa=kn(ne,Nu),sa=cn(function(t,e,n){eu.call(t,n)?t[n].push(e):t[n]=[e]}),la=cn(function(t,e,n){t[n]=e}),ca=_o(function(t,e,n){var r=-1,o="function"==typeof e,i=tr(e),u=Gn(t)?Li(t.length):[];return Tu(t,function(t){var a=o?e:i&&null!=t?t[e]:A;u[++r]=a?a.apply(t,n):Jn(t,e,n)}),u}),fa=cn(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),pa=In(ce,Tu),ha=In(fe,Nu),da=_o(function(t,e){if(null==t)return[];var n=e[2];return n&&Yn(e[0],e[1],n)&&(e.length=1),Ge(t,Ce(e),[])}),va=Eu||function(){return(new Wi).getTime()},ya=_o(function(t,e,n){var r=C;if(n.length){var o=w(n,ya.placeholder);r|=D}return Nn(t,r,e,n,o)}),ga=_o(function(t,e){e=e.length?Ce(e):Go(t);for(var n=-1,r=e.length;++n0||0>e)?new o(n):(0>t?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==A&&(e=+e||0,n=0>e?n.dropRight(-e):n.take(e-t)),n)},o.prototype.takeRightWhile=function(t,e){return this.reverse().takeWhile(t,e).reverse()},o.prototype.toArray=function(){return this.take(ju)},Ie(o.prototype,function(t,n){var i=/^(?:filter|map|reject)|While$/.test(n),u=/^(?:first|last)$/.test(n),a=e[u?"take"+("last"==n?"Right":""):n];a&&(e.prototype[n]=function(){var e=u?[1]:arguments,n=this.__chain__,s=this.__wrapped__,l=!!this.__actions__.length,c=s instanceof o,f=e[0],p=c||Ca(s);p&&i&&"function"==typeof f&&1!=f.length&&(c=p=!1);var h=function(t){return u&&n?a(t,1)[0]:a.apply(A,le([t],e))},d={func:Ur,args:[h],thisArg:A},v=c&&!l;if(u&&!n)return v?(s=s.clone(),s.__actions__.push(d),t.call(s)):a.call(A,this.value())[0];if(!u&&p){s=v?s:new o(this);var y=t.apply(s,e);return y.__actions__.push(d),new r(y,n)}return this.thru(h)})}),ee(["join","pop","push","replace","shift","sort","splice","split","unshift"],function(t){var n=(/^(?:replace|split)$/.test(t)?Yi:Gi)[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",o=/^(?:join|pop|replace|shift)$/.test(t);e.prototype[t]=function(){var t=arguments;return o&&!this.__chain__?n.apply(this.value(),t):this[r](function(e){return n.apply(e,t)})}}),Ie(o.prototype,function(t,n){var r=e[n];if(r){var o=r.name,i=Du[o]||(Du[o]=[]);i.push({name:n,func:r})}}),Du[Fn(A,q).name]=[{name:"wrapper",func:A}],o.prototype.clone=m,o.prototype.reverse=Y,o.prototype.value=rt,e.prototype.chain=Hr,e.prototype.commit=Kr,e.prototype.concat=ea,e.prototype.plant=Qr,e.prototype.reverse=zr,e.prototype.toString=Vr,e.prototype.run=e.prototype.toJSON=e.prototype.valueOf=e.prototype.value=Zr,e.prototype.collect=e.prototype.map,e.prototype.head=e.prototype.first,e.prototype.select=e.prototype.filter,e.prototype.tail=e.prototype.rest,e}var A,j="3.10.1",C=1,q=2,I=4,F=8,S=16,D=32,B=64,T=128,N=256,R=30,$="...",M=150,L=16,W=200,U=1,H=2,K="Expected a function",Q="__lodash_placeholder__",z="[object Arguments]",V="[object Array]",Z="[object Boolean]",J="[object Date]",G="[object Error]",X="[object Function]",Y="[object Map]",tt="[object Number]",et="[object Object]",nt="[object RegExp]",rt="[object Set]",ot="[object String]",it="[object WeakMap]",ut="[object ArrayBuffer]",at="[object Float32Array]",st="[object Float64Array]",lt="[object Int8Array]",ct="[object Int16Array]",ft="[object Int32Array]",pt="[object Uint8Array]",ht="[object Uint8ClampedArray]",dt="[object Uint16Array]",vt="[object Uint32Array]",yt=/\b__p \+= '';/g,gt=/\b(__p \+=) '' \+/g,_t=/(__e\(.*?\)|\b__t\)) \+\n'';/g,bt=/&(?:amp|lt|gt|quot|#39|#96);/g,mt=/[&<>"'`]/g,wt=RegExp(bt.source),xt=RegExp(mt.source),Ot=/<%-([\s\S]+?)%>/g,Et=/<%([\s\S]+?)%>/g,kt=/<%=([\s\S]+?)%>/g,Pt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,At=/^\w*$/,jt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,Ct=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,qt=RegExp(Ct.source),It=/[\u0300-\u036f\ufe20-\ufe23]/g,Ft=/\\(\\)?/g,St=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Dt=/\w*$/,Bt=/^0[xX]/,Tt=/^\[object .+?Constructor\]$/,Nt=/^\d+$/,Rt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,$t=/($^)/,Mt=/['\n\r\u2028\u2029\\]/g,Lt=function(){var t="[A-Z\\xc0-\\xd6\\xd8-\\xde]",e="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(t+"+(?="+t+e+")|"+t+"?"+e+"|"+t+"+|[0-9]+","g")}(),Wt=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Ut=-1,Ht={};Ht[at]=Ht[st]=Ht[lt]=Ht[ct]=Ht[ft]=Ht[pt]=Ht[ht]=Ht[dt]=Ht[vt]=!0,Ht[z]=Ht[V]=Ht[ut]=Ht[Z]=Ht[J]=Ht[G]=Ht[X]=Ht[Y]=Ht[tt]=Ht[et]=Ht[nt]=Ht[rt]=Ht[ot]=Ht[it]=!1;var Kt={};Kt[z]=Kt[V]=Kt[ut]=Kt[Z]=Kt[J]=Kt[at]=Kt[st]=Kt[lt]=Kt[ct]=Kt[ft]=Kt[tt]=Kt[et]=Kt[nt]=Kt[ot]=Kt[pt]=Kt[ht]=Kt[dt]=Kt[vt]=!0,Kt[G]=Kt[X]=Kt[Y]=Kt[rt]=Kt[it]=!1;var Qt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},zt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Vt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Zt={"function":!0,object:!0},Jt={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Gt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Xt=Zt[typeof e]&&e&&!e.nodeType&&e,Yt=Zt[typeof t]&&t&&!t.nodeType&&t,te=Xt&&Yt&&"object"==typeof o&&o&&o.Object&&o,ee=Zt[typeof self]&&self&&self.Object&&self,ne=Zt[typeof window]&&window&&window.Object&&window,re=(Yt&&Yt.exports===Xt&&Xt,te||ne!==(this&&this.window)&&ne||ee||this),oe=P();re._=oe,r=function(){return oe}.call(e,n,e,t),!(r!==A&&(t.exports=r))}).call(this)}).call(e,n(23)(t),function(){return this}())},function(t,e,n){"use strict";var r=n(1),o={checkboxInput:n(7),checkboxOptionsInput:n(8),emailInput:n(9),fileInput:n(10),hiddenInput:n(11),passwordInput:n(12),radioOptionsInput:n(13),selectInput:n(14),textareaInput:n(16),textInput:n(15)};o.addInputType=function(t,e){if("string"!=typeof t)throw new Error("Winterfell: First parameter of addInputType must be of type string");if(!r.Component instanceof e.constructor)throw new Error('Winterfell: Cannot not assign "'+t+'" as an inputType. Second paramter expects a React component');o[t]=e},o.addInputTypes=function(t){if("object"!=typeof t)throw new Error("Winterfell: First parameter of addInputTypes must be of type object");for(var e in t)o.addInputType(e,t[e])},t.exports=o},function(t,e){"use strict";var n={"default":"Please correct the field below",isLength:function(t){switch(t.params.length){case 1:return"Please enter a value with at least "+t.params[0]+" character"+(1!=t.params[0]?"s":"");case 2:return"Please enter a valiue between "+t.params[0]+" and "+t.params[1]+" characters long";default:return n["default"]}return errorMessage},isEmail:"Please enter a valid email address",contains:function(t){return'Please enter a value that contains "'+t.params[0]+'"'},equals:function(t){return"Value must equal "+t.params[0]},isAlpha:"Please only enter letters",isAlphanumeric:"Please only enter letters and numbers",isCreditCard:"Please enter a valid credit card number",isCurrency:"Please enter a current value only",isDate:"Please enter a valid date",isDecimal:"Please enter a decimal value only",isFloat:"Please enter a float value only",isIP:"Please enter a valid IP address",isIn:"Please enter one of the allowed values",isAllIn:"Please enter one of the allowed values",isJSON:"Please enter a valid JSON string",isLowercase:"Please enter lowercase characters only",isUppercase:"Please enter uppercase characters only",isMobilePhone:"Please enter a valid mobile phone",isMongoId:"Please enter a valid MongoId",isNumeric:"Please enter numbers only",isURL:"Please enter a valid URL",isAccepted:"Please accept by clicking the checkbox"};n.addErrorMessage=function(t,e){if("string"!=typeof t)throw new Error("Winterfell: First parameter of addErrorMessage must be of type string");if("function"!=typeof e&&"string"!=typeof e)throw new Error("Winterfell: Second parameter of addErrorMessage must be of type function or string");r(t,e)},n.addErrorMessages=function(t){if("object"!=typeof t)throw new Error("Winterfell: First parameter of addErrorMessages must be of type object");for(var e in t)n.addErrorMessage(e,t[e])},n.getErrorMessage=function(t){var e="undefined"!=typeof t.message?t.message:"undefined"!=typeof n[t.type]?n[t.type]:n["default"];return"function"==typeof e?e(t):e};var r=function(t,e){n[t]=e};t.exports=n},function(t,e,n){"use strict";var r=n(2).noConflict(),o=n(22),i=n(17),u={isAccepted:function(t,e){return t==e},isAllIn:function(t,e){return t?r.every(t,function(t){return e.indexOf(t)>-1}):!1}},a=function(t,e,n){var r="undefined"!=typeof u[e.type]?u[e.type]:o.hasOwnProperty(e.type)&&"function"==typeof o[e.type]?o[e.type]:void 0;if(!r)throw new Error('Winterfell: Attempted to validate for undefined method "'+e.type+'"');var a=(e.params||[]).slice(0);return a=a.map(function(t){return"string"==typeof t?i(t,n):t}),a.unshift(t),r.apply(null,a)},s=function h(t,e,n){return n=n||[],t.forEach(function(t){n.push({questionId:t.questionId,validations:t.validations}),"undefined"!=typeof t.input.options&&0!==t.input.options.length&&t.input.options.forEach(function(r){"undefined"!=typeof r.conditionalQuestions&&0!=r.conditionalQuestions.length&&e[t.questionId]==r.value&&(n=h(r.conditionalQuestions,e,n))})}),n},l=function(t,e){var n=[];return t.forEach(function(t){return Array.prototype.push.apply(n,s(t.questions,e))}),n},c=function(t,e){var n=l(t,e).filter(function(t){return t.validations instanceof Array&&t.validations.length>0}),r={};return n.forEach(function(t){var n=t.questionId,o=t.validations;return[].forEach.bind(o,function(t){var o=a(e[n],t,e);o||("undefined"==typeof r[n]&&(r[n]=[]),r[n].push(t))})()}),r},f=function(t,e){if("string"!=typeof t)throw new Error("Winterfell: First parameter of addValidationMethod must be of type string");if("function"!=typeof e)throw new Error("Winterfell: Second parameter of addValidationMethod must be of type function");u[t]=e},p=function(t){if("object"!=typeof t)throw new Error("Winterfell: First parameter of addValidationMethods must be of type object");for(var e in t)f[e]=t[e]};t.exports={validateAnswer:a,getActiveQuestions:s,getActiveQuestionsFromQuestionSets:l,getQuestionPanelInvalidQuestions:c,addValidationMethod:f,addValidationMethods:p}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var i=function(){function t(t,e){for(var n=0;n-1,className:t.props.classes.checkbox,required:t.props.required?"required":void 0,onChange:t.handleChange.bind(t),onBlur:t.props.onBlur.bind(null,t.state.value)}),e.text))}))}}]),e}(a.Component);s.defaultProps={classes:{},name:void 0,value:[],options:[],onChange:function(){},onBlur:function(){}},t.exports=s},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var i=function(){function t(t,e){for(var n=0;n-1:t.props.value==e.value}).filter(function(t){return"undefined"!=typeof t.conditionalQuestions&&t.conditionalQuestions.length>0}).forEach(function(n){return[].forEach.bind(n.conditionalQuestions,function(n){r.push(s.createElement(e,{key:n.questionId,questionSetId:t.props.questionSetId,questionId:n.questionId,question:n.question,text:n.text,postText:n.postText,validateOn:n.validateOn,validations:n.validations,value:t.props.questionAnswers[n.questionId],input:n.input,classes:t.props.classes,renderError:t.props.renderError,questionAnswers:t.props.questionAnswers,validationErrors:t.props.validationErrors,onAnswerChange:t.props.onAnswerChange,onQuestionBlur:t.props.onQuestionBlur,onKeyDown:t.props.onKeyDown}))})()});var o="undefined"!=typeof this.props.value?this.props.value:"undefined"!=typeof this.props.input["default"]?this.props.input["default"]:void 0,u="undefined"!=typeof this.props.validationErrors[this.props.questionId]?this.props.validationErrors[this.props.questionId].map(function(e){return"function"==typeof t.props.renderError?t.props.renderError(e,t.props.questionId):s.createElement("div",{key:t.props.questionId+"Error"+e.type,className:t.props.classes.errorMessage},e.message)}):[],a={};this.props.input.props&&(a=this.props.input.props);var c=this.props.questionId+"-label";return s.createElement("div",{className:this.props.classes.question},this.props.question?s.createElement("label",{className:this.props.classes.label,id:c,htmlFor:this.props.questionId},this.props.question,"undefined"!=typeof this.props.renderRequiredAsterisk&&this.props.input.required?this.props.renderRequiredAsterisk():void 0):void 0,this.props.text?s.createElement("p",{className:this.props.classes.questionText},this.props.text):void 0,u,s.createElement(n,i({name:this.props.questionId,id:this.props.questionId,labelId:c,value:o,text:this.props.input.text,options:this.props.input.options,placeholder:this.props.input.placeholder,required:this.props.input.required,classes:this.props.classes,onChange:this.handleInputChange.bind(this,this.props.questionId),onBlur:this.handleInputBlur.bind(this,this.props.questionId),onKeyDown:this.props.onKeyDown},a)),this.props.postText?s.createElement("p",{className:this.props.classes.questionPostText},this.props.postText):void 0,r)}},{key:"componentDidMount",value:function(){"undefined"==typeof this.props.input["default"]||"checkboxInput"===this.props.input.type&&"undefined"==typeof this.props.questionAnswers[this.props.questionId]||this.handleInputChange.call(this,this.props.questionId,this.props.input["default"])}}]),e}(s.Component);c.defaultProps={questionSetId:void 0,questionId:void 0,question:"",validateOn:"blur",validations:[],text:void 0,postText:void 0,value:void 0,input:{"default":void 0,type:"textInput",limit:void 0,placeholder:void 0},classes:{},questionAnswers:{},validationErrors:{},onAnswerChange:function(){},onQuestionBlur:function(){},onKeyDown:function(){},renderError:void 0,renderRequiredAsterisk:void 0},t.exports=c},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var i=function(){function t(t,e){for(var n=0;n-1}).value(),i=c.getQuestionPanelInvalidQuestions(o,this.props.questionAnswers);if(Object.keys(i).length>0){var u=s.mapValues(i,function(t){return t.map(function(t){return{type:t.type,message:f.getErrorMessage(t)}})});return void this.setState({validationErrors:u})}switch(n.forEach(function(n){var r=t.props.questionAnswers[n.questionId];e=r==n.value?{action:n.action,target:n.target}:e}),e.action){case"GOTO":this.props.onSwitchPanel(e.target);break;case"SUBMIT":this.props.onSubmit(e.target)}}},{key:"handleBackButtonClick",value:function(){0!=this.props.panelHistory.length&&this.props.onPanelBack()}},{key:"handleAnswerChange",value:function(t,e,n,r){this.props.onAnswerChange(t,e),this.setState({validationErrors:s.chain(this.state.validationErrors).set(t,[]).value()}),"change"===r&&this.handleAnswerValidate(t,e,n)}},{key:"handleQuestionBlur",value:function(t,e,n,r){"blur"===r&&this.handleAnswerValidate(t,e,n)}},{key:"handleInputKeyDown",value:function(t){"enter"===l[t.keyCode]&&(t.preventDefault(),this.handleMainButtonClick.call(this))}},{key:"render",value:function(){var t=this,e=this.props.questionSets.map(function(e){var n=s.find(t.props.schema.questionSets,{questionSetId:e.questionSetId});return n?a.createElement(h,{key:n.questionSetId,id:n.questionSetId,name:n.name,questionSetHeader:n.questionSetHeader,questionSetText:n.questionSetText,questions:n.questions,classes:t.props.classes,questionAnswers:t.props.questionAnswers,renderError:t.props.renderError,renderRequiredAsterisk:t.props.renderRequiredAsterisk,validationErrors:t.state.validationErrors,onAnswerChange:t.handleAnswerChange.bind(t),onQuestionBlur:t.handleQuestionBlur.bind(t),onKeyDown:t.handleInputKeyDown.bind(t)}):void 0});return a.createElement("div",{className:this.props.classes.questionPanel},"undefined"!=typeof this.props.panelHeader||"undefined"!=typeof this.props.panelText?a.createElement("div",{className:this.props.classes.questionPanelHeaderContainer},"undefined"!=typeof this.props.panelHeader?a.createElement("h3",{className:this.props.classes.questionPanelHeaderText},this.props.panelHeader):void 0,"undefined"!=typeof this.props.panelText?a.createElement("p",{className:this.props.classes.questionPanelText},this.props.panelText):void 0):void 0,a.createElement("div",{className:this.props.classes.questionSets},e),a.createElement("div",{className:this.props.classes.buttonBar},this.props.panelHistory.length>1&&!this.props.backButton.disabled?a.createElement(p,{text:this.props.backButton.text||"Back",onClick:this.handleBackButtonClick.bind(this),className:this.props.classes.backButton}):void 0,this.props.button.disabled?void 0:a.createElement(p,{text:this.props.button.text,onClick:this.handleMainButtonClick.bind(this),className:this.props.classes.controlButton})))}}]),e}(a.Component);d.defaultProps={validationErrors:{},schema:{},classes:{},panelId:void 0,panelIndex:void 0,panelHeader:void 0,panelText:void 0,action:{"default":{},conditions:[]},button:{text:"Submit"},backButton:{text:"Back"},questionSets:[],questionAnswers:{},renderError:void 0,renderRequiredAsterisk:void 0,onAnswerChange:function(){},onSwitchPanel:function(){},onPanelBack:function(){},panelHistory:[]},t.exports=d},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var i=function(){function t(t,e){for(var n=0;ne.index});var o="undefined"!=typeof this.props.panelId?this.props.panelId:n.formPanels.length>0?n.formPanels[0].panelId:void 0,i="undefined"!=typeof n&&"undefined"!=typeof n.formPanels&&"undefined"!=typeof o?s.find(n.formPanels,function(t){return t.panelId==o}):void 0;if(!i)throw new Error("Winterfell: Could not find initial panel and failed to render.");this.state={schema:n,currentPanel:i,action:this.props.action,questionAnswers:this.props.questionAnswers}}return o(e,t),i(e,[{key:"componentWillReceiveProps",value:function(t){this.setState({action:t.action,schema:t.schema,questionAnswers:t.questionAnswers})}},{key:"handleAnswerChange",value:function(t,e){var n=s.chain(this.state.questionAnswers).set(t,e).value();this.setState({questionAnswers:n},this.props.onUpdate.bind(null,n))}},{key:"handleSwitchPanel",value:function(t,e){var n=s.find(this.props.schema.formPanels,{panelId:t});if(!n)throw new Error('Winterfell: Tried to switch to panel "'+t+'", which does not exist.');e||this.panelHistory.push(n.panelId),this.setState({currentPanel:n},this.props.onSwitchPanel.bind(null,n))}},{key:"handleBackButtonClick",value:function(){this.panelHistory.pop(),this.handleSwitchPanel.call(this,this.panelHistory[this.panelHistory.length-1],!0)}},{key:"handleSubmit",value:function(t){var e=this;return this.props.disableSubmit?void this.props.onSubmit(this.state.questionAnswers,t):void this.setState({action:t},function(){a.findDOMNode(e.refs[e.props.ref]).submit()})}},{key:"render",value:function(){var t=this,e=s.find(this.state.schema.questionPanels,function(e){return e.panelId==t.state.currentPanel.panelId});return a.createElement("form",{method:this.props.method,encType:this.props.encType,action:this.state.action,ref:this.props.ref,className:this.state.schema.classes.form},a.createElement("div",{className:this.state.schema.classes.questionPanels},a.createElement(l,{schema:this.state.schema,classes:this.state.schema.classes,panelId:e.panelId,panelIndex:e.panelIndex,panelHeader:e.panelHeader,panelText:e.panelText,action:e.action,button:e.button,backButton:e.backButton,questionSets:e.questionSets,questionAnswers:this.state.questionAnswers,panelHistory:this.panelHistory,renderError:this.props.renderError,renderRequiredAsterisk:this.props.renderRequiredAsterisk,onAnswerChange:this.handleAnswerChange.bind(this),onPanelBack:this.handleBackButtonClick.bind(this),onSwitchPanel:this.handleSwitchPanel.bind(this),onSubmit:this.handleSubmit.bind(this)})))}},{key:"componentDidMount",value:function(){this.panelHistory.push(this.state.currentPanel.panelId),this.props.onRender()}}]),e}(a.Component);c.defaultProps={schema:{formPanels:[],questionPanels:[],questionSets:[],classes:{}},questionAnswers:{},ref:"form",encType:"application/x-www-form-urlencoded",method:"POST",action:"",panelId:void 0,disableSubmit:!1,renderError:void 0,renderRequiredAsterisk:void 0,onSubmit:function(){},onUpdate:function(){},onSwitchPanel:function(){},onRender:function(){}},c.inputTypes=n(3),c.errorMessages=n(4),c.validation=n(5),c.addInputType=c.inputTypes.addInputType,c.addInputTypes=c.inputTypes.addInputTypes,c.addErrorMessage=c.errorMessages.addErrorMessage,c.addErrorMessages=c.errorMessages.addErrorMessages,c.addValidationMethod=c.validation.addValidationMethod,c.addValidationMethods=c.validation.addValidationMethods,t.exports=c},function(t,e){t.exports=React},function(t,e,n){var r;(function(t,o){(function(){function i(t,e){if(t!==e){var n=null===t,r=t===A,o=t===t,i=null===e,u=e===A,a=e===e;if(t>e&&!i||!o||n&&!u&&a||r&&a)return 1;if(e>t&&!n||!a||i&&!r&&o||u&&o)return-1}return 0}function u(t,e,n){for(var r=t.length,o=n?r:-1;n?o--:++o-1;);return n}function f(t,e){for(var n=t.length;n--&&e.indexOf(t.charAt(n))>-1;);return n}function p(t,e){return i(t.criteria,e.criteria)||t.index-e.index}function h(t,e,n){for(var r=-1,o=t.criteria,u=e.criteria,a=o.length,s=n.length;++r=s)return l;var c=n[r];return l*("asc"===c||c===!0?1:-1)}}return t.index-e.index}function d(t){return Qt[t]}function v(t){return zt[t]}function y(t,e,n){return e?t=Jt[t]:n&&(t=Gt[t]),"\\"+t}function g(t){return"\\"+Gt[t]}function _(t,e,n){for(var r=t.length,o=e+(n?0:-1);n?o--:++o=t&&t>=9&&13>=t||32==t||160==t||5760==t||6158==t||t>=8192&&(8202>=t||8232==t||8233==t||8239==t||8287==t||12288==t||65279==t)}function w(t,e){for(var n=-1,r=t.length,o=-1,i=[];++ne,o=n?t.length:0,i=Qn(0,o,this.__views__),u=i.start,a=i.end,s=a-u,l=r?a:u-1,c=this.__iteratees__,f=c.length,p=0,h=Ou(s,this.__takeCount__);if(!n||W>o||o==s&&h==s)return nn(r&&n?t.reverse():t,this.__actions__);var d=[];t:for(;s--&&h>p;){l+=e;for(var v=-1,y=t[l];++v=W?vn(e):null,l=e.length;s&&(i=Gt,u=!1,e=s);t:for(;++on&&(n=-n>o?0:o+n),r=r===A||r>o?o:+r||0,0>r&&(r+=o),o=n>r?0:r>>>0,n>>>=0;o>n;)t[n++]=e;return t}function Ae(t,e){var n=[];return Tu(t,function(t,r,o){e(t,r,o)&&n.push(t)}),n}function je(t,e,n,r){var o;return n(t,function(t,n,i){return e(t,n,i)?(o=r?n:t,!1):void 0}),o}function Ce(t,e,n,r){r||(r=[]);for(var o=-1,i=t.length;++or;)t=t[e[r++]];return r&&r==o?t:A}}function Be(t,e,n,r,o,i){return t===e?!0:null==t||null==e||!Bo(t)&&!b(e)?t!==t&&e!==e:Te(t,e,Be,n,r,o,i)}function Te(t,e,n,r,o,i,u){var a=Ca(t),s=Ca(e),l=V,c=V;a||(l=ru.call(t),l==z?l=et:l!=et&&(a=Ho(t))),s||(c=ru.call(e),c==z?c=et:c!=et&&(s=Ho(e)));var f=l==et,p=c==et,h=l==c;if(h&&!a&&!f)return $n(t,e,l);if(!o){var d=f&&eu.call(t,"__wrapped__"),v=p&&eu.call(e,"__wrapped__");if(d||v)return n(d?t.value():t,v?e.value():e,r,o,i,u)}if(!h)return!1;i||(i=[]),u||(u=[]);for(var y=i.length;y--;)if(i[y]==t)return u[y]==e;i.push(t),u.push(e);var g=(a?Rn:Mn)(t,e,n,r,o,i,u);return i.pop(),u.pop(),g}function Ne(t,e,n){var r=e.length,o=r,i=!n;if(null==t)return!o;for(t=fr(t);r--;){var u=e[r];if(i&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++re&&(e=-e>o?0:o+e),n=n===A||n>o?o:+n||0,0>n&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Li(o);++r=W,s=u?vn():null,l=[];s?(r=Gt,i=!1):(u=!1,s=e?[]:l);t:for(;++n=o){for(;o>r;){var i=r+o>>>1,u=t[i];(n?e>=u:e>u)&&null!==u?r=i+1:o=i}return o}return on(t,e,ji,n)}function on(t,e,n,r){e=n(e);for(var o=0,i=t?t.length:0,u=e!==e,a=null===e,s=e===A;i>o;){var l=_u((o+i)/2),c=n(t[l]),f=c!==A,p=c===c;if(u)var h=p||r;else h=a?p&&f&&(r||null!=c):s?p&&(r||f):null==c?!1:r?e>=c:e>c;h?o=l+1:i=l}return Ou(i,qu)}function un(t,e,n){if("function"!=typeof t)return ji;if(e===A)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,o){return t.call(e,n,r,o)};case 4:return function(n,r,o,i){return t.call(e,n,r,o,i)};case 5:return function(n,r,o,i,u){return t.call(e,n,r,o,i,u)}}return function(){return t.apply(e,arguments)}}function an(t){var e=new uu(t.byteLength),n=new du(e);return n.set(new du(t)),e}function sn(t,e,n){for(var r=n.length,o=-1,i=xu(t.length-r,0),u=-1,a=e.length,s=Li(a+i);++u2?n[o-2]:A,u=o>2?n[2]:A,a=o>1?n[o-1]:A;for("function"==typeof i?(i=un(i,a,5),o-=2):(i="function"==typeof a?a:A,o-=i?1:0),u&&Yn(n[0],n[1],u)&&(i=3>o?A:i,o=1);++r-1?n[i]:A}return je(n,r,t)}}function xn(t){return function(e,n,r){return e&&e.length?(n=Ln(n,r,3),u(e,n,t)):-1}}function On(t){return function(e,n,r){return n=Ln(n,r,3),je(e,n,t,!0)}}function En(t){return function(){for(var e,n=arguments.length,o=t?n:-1,i=0,u=Li(n);t?o--:++o=W)return e.plant(r).value();for(var o=0,i=n?u[o].apply(this,t):r;++o_){var E=a?te(a):A,k=xu(l-_,0),P=d?O:A,j=d?A:O,I=d?m:A,F=d?A:m;e|=d?D:B,e&=~(d?B:D),v||(e&=~(C|q));var S=[t,e,n,I,P,F,j,E,s,k],T=Fn.apply(A,S);return er(t)&&Uu(T,S),T.placeholder=x,T}}var N=p?n:this,R=h?N[t]:t;return a&&(m=sr(m,a)),f&&s=e||!mu(e))return"";var o=e-r;return n=null==n?" ":n+"",gi(n,yu(o/n.length)).slice(0,o)}function Dn(t,e,n,r){function o(){for(var e=-1,a=arguments.length,s=-1,l=r.length,c=Li(l+a);++ss))return!1;for(;++a-1&&t%1==0&&e>t}function Yn(t,e,n){if(!Bo(n))return!1;var r=typeof e;if("number"==r?Gn(n)&&Xn(e,n.length):"string"==r&&e in n){var o=n[e];return t===t?t===o:o!==o}return!1}function tr(t,e){var n=typeof t;if("string"==n&&At.test(t)||"number"==n)return!0;if(Ca(t))return!1;var r=!Pt.test(t);return r||null!=e&&t in fr(e)}function er(t){var n=Wn(t);if(!(n in o.prototype))return!1;var r=e[n];if(t===r)return!0;var i=Lu(r);return!!i&&t===i[0]}function nr(t){return"number"==typeof t&&t>-1&&t%1==0&&Fu>=t}function rr(t){return t===t&&!Bo(t)}function or(t,e){var n=t[1],r=e[1],o=n|r,i=T>o,u=r==T&&n==F||r==T&&n==N&&t[7].length<=e[8]||r==(T|N)&&n==F;if(!i&&!u)return t;r&C&&(t[2]=e[2],o|=n&C?0:I);var a=e[3];if(a){var s=t[3];t[3]=s?sn(s,a,e[4]):te(a),t[4]=s?w(t[3],Q):te(e[4])}return a=e[5],a&&(s=t[5],t[5]=s?ln(s,a,e[6]):te(a),t[6]=s?w(t[5],Q):te(e[6])),a=e[7],a&&(t[7]=te(a)),r&T&&(t[8]=null==t[8]?e[8]:Ou(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o,t}function ir(t,e){return t===A?e:qa(t,e,ir)}function ur(t,e){t=fr(t);for(var n=-1,r=e.length,o={};++nr;)u[++i]=Ve(t,r,r+=e);return u}function vr(t){for(var e=-1,n=t?t.length:0,r=-1,o=[];++ee?0:e)):[]}function gr(t,e,n){var r=t?t.length:0;return r?((n?Yn(t,e,n):null==e)&&(e=1),e=r-(+e||0),Ve(t,0,0>e?0:e)):[]}function _r(t,e,n){return t&&t.length?en(t,Ln(e,n,3),!0,!0):[]}function br(t,e,n){return t&&t.length?en(t,Ln(e,n,3),!0):[]}function mr(t,e,n,r){var o=t?t.length:0;return o?(n&&"number"!=typeof n&&Yn(t,e,n)&&(n=0,r=o),Pe(t,e,n,r)):[]}function wr(t){return t?t[0]:A}function xr(t,e,n){var r=t?t.length:0;return n&&Yn(t,e,n)&&(e=!1),r?Ce(t,e):[]}function Or(t){var e=t?t.length:0;return e?Ce(t,!0):[]}function Er(t,e,n){var r=t?t.length:0;if(!r)return-1;if("number"==typeof n)n=0>n?xu(r+n,0):n;else if(n){var o=rn(t,e);return r>o&&(e===e?e===t[o]:t[o]!==t[o])?o:-1}return a(t,e,n||0)}function kr(t){return gr(t,1)}function Pr(t){var e=t?t.length:0;return e?t[e-1]:A}function Ar(t,e,n){var r=t?t.length:0;if(!r)return-1;var o=r;if("number"==typeof n)o=(0>n?xu(r+n,0):Ou(n||0,r-1))+1;else if(n){o=rn(t,e,!0)-1;var i=t[o];return(e===e?e===i:i!==i)?o:-1}if(e!==e)return _(t,o,!0);for(;o--;)if(t[o]===e)return o;return-1}function jr(){var t=arguments,e=t[0];if(!e||!e.length)return e;for(var n=0,r=Un(),o=t.length;++n-1;)hu.call(e,i,1);return e}function Cr(t,e,n){var r=[];if(!t||!t.length)return r;var o=-1,i=[],u=t.length;for(e=Ln(e,n,3);++oe?0:e)):[]}function Sr(t,e,n){var r=t?t.length:0;return r?((n?Yn(t,e,n):null==e)&&(e=1),e=r-(+e||0),Ve(t,0>e?0:e)):[]}function Dr(t,e,n){return t&&t.length?en(t,Ln(e,n,3),!1,!0):[]}function Br(t,e,n){return t&&t.length?en(t,Ln(e,n,3)):[]}function Tr(t,e,n,r){var o=t?t.length:0;if(!o)return[];null!=e&&"boolean"!=typeof e&&(r=n,n=Yn(t,e,r)?A:e,e=!1);var i=Ln();return(null!=n||i!==me)&&(n=i(n,r,3)),e&&Un()==a?x(t,n):Ye(t,n)}function Nr(t){if(!t||!t.length)return[];var e=-1,n=0;t=ae(t,function(t){return Gn(t)?(n=xu(t.length,n),!0):void 0});for(var r=Li(n);++en?xu(o+n,0):n||0,"string"==typeof t||!Ca(t)&&Uo(t)?o>=n&&t.indexOf(e,n)>-1:!!o&&Un(t,e,n)>-1}function to(t,e,n){var r=Ca(t)?se:Re;return e=Ln(e,n,3),r(t,e)}function eo(t,e){return to(t,Di(e))}function no(t,e,n){var r=Ca(t)?ae:Ae;return e=Ln(e,n,3),r(t,function(t,n,r){return!e(t,n,r)})}function ro(t,e,n){if(n?Yn(t,e,n):null==e){t=cr(t);var r=t.length;return r>0?t[Qe(0,r-1)]:A}var o=-1,i=Vo(t),r=i.length,u=r-1;for(e=Ou(0>e?0:+e||0,r);++o0&&(n=e.apply(this,arguments)),1>=t&&(e=A),n}}function ho(t,e,n){function r(){h&&au(h),l&&au(l),v=0,l=h=d=A}function o(e,n){n&&au(n),l=h=d=A,e&&(v=va(),c=t.apply(p,s),h||l||(s=p=A))}function i(){var t=e-(va()-f);0>=t||t>e?o(d,l):h=pu(i,t)}function u(){o(g,h)}function a(){if(s=arguments,f=va(),p=this,d=g&&(h||!_),y===!1)var n=_&&!h;else{l||_||(v=f);var r=y-(f-v),o=0>=r||r>y;o?(l&&(l=au(l)),v=f,c=t.apply(p,s)):l||(l=pu(u,r))}return o&&h?h=au(h):h||e===y||(h=pu(i,e)),n&&(o=!0,c=t.apply(p,s)),!o||h||l||(s=p=A),c}var s,l,c,f,p,h,d,v=0,y=!1,g=!0;if("function"!=typeof t)throw new Ji(K);if(e=0>e?0:+e||0,n===!0){var _=!0;g=!1}else Bo(n)&&(_=!!n.leading,y="maxWait"in n&&xu(+n.maxWait||0,e),g="trailing"in n?!!n.trailing:g);return a.cancel=r, +a}function vo(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new Ji(K);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var u=t.apply(this,r);return n.cache=i.set(o,u),u};return n.cache=new vo.Cache,n}function yo(t){if("function"!=typeof t)throw new Ji(K);return function(){return!t.apply(this,arguments)}}function go(t){return po(2,t)}function _o(t,e){if("function"!=typeof t)throw new Ji(K);return e=xu(e===A?t.length-1:+e||0,0),function(){for(var n=arguments,r=-1,o=xu(n.length-e,0),i=Li(o);++re}function ko(t,e){return t>=e}function Po(t){return b(t)&&Gn(t)&&eu.call(t,"callee")&&!cu.call(t,"callee")}function Ao(t){return t===!0||t===!1||b(t)&&ru.call(t)==Z}function jo(t){return b(t)&&ru.call(t)==J}function Co(t){return!!t&&1===t.nodeType&&b(t)&&!Lo(t)}function qo(t){return null==t?!0:Gn(t)&&(Ca(t)||Uo(t)||Po(t)||b(t)&&Do(t.splice))?!t.length:!Ma(t).length}function Io(t,e,n,r){n="function"==typeof n?un(n,r,3):A;var o=n?n(t,e):A;return o===A?Be(t,e,n):!!o}function Fo(t){return b(t)&&"string"==typeof t.message&&ru.call(t)==G}function So(t){return"number"==typeof t&&mu(t)}function Do(t){return Bo(t)&&ru.call(t)==X}function Bo(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function To(t,e,n,r){return n="function"==typeof n?un(n,r,3):A,Ne(t,Hn(e),n)}function No(t){return Mo(t)&&t!=+t}function Ro(t){return null==t?!1:Do(t)?iu.test(tu.call(t)):b(t)&&Tt.test(t)}function $o(t){return null===t}function Mo(t){return"number"==typeof t||b(t)&&ru.call(t)==tt}function Lo(t){var e;if(!b(t)||ru.call(t)!=et||Po(t)||!eu.call(t,"constructor")&&(e=t.constructor,"function"==typeof e&&!(e instanceof e)))return!1;var n;return qe(t,function(t,e){n=e}),n===A||eu.call(t,n)}function Wo(t){return Bo(t)&&ru.call(t)==nt}function Uo(t){return"string"==typeof t||b(t)&&ru.call(t)==ot}function Ho(t){return b(t)&&nr(t.length)&&!!Ht[ru.call(t)]}function Ko(t){return t===A}function Qo(t,e){return e>t}function zo(t,e){return e>=t}function Vo(t){var e=t?Wu(t):0;return nr(e)?e?te(t):[]:ui(t)}function Zo(t){return be(t,ei(t))}function Jo(t,e,n){var r=Bu(t);return n&&Yn(t,e,n)&&(e=A),e?ge(r,e):r}function Go(t){return Se(t,ei(t))}function Xo(t,e,n){var r=null==t?A:De(t,pr(e),e+"");return r===A?n:r}function Yo(t,e){if(null==t)return!1;var n=eu.call(t,e);if(!n&&!tr(e)){if(e=pr(e),t=1==e.length?t:De(t,Ve(e,0,-1)),null==t)return!1;e=Pr(e),n=eu.call(t,e)}return n||nr(t.length)&&Xn(e,t.length)&&(Ca(t)||Po(t))}function ti(t,e,n){n&&Yn(t,e,n)&&(e=A);for(var r=-1,o=Ma(t),i=o.length,u={};++r0;++r=Ou(e,n)&&tn?0:+n||0,r),n-=e.length,n>=0&&t.indexOf(e,n)==n}function hi(t){return t=l(t),t&&xt.test(t)?t.replace(mt,v):t}function di(t){return t=l(t),t&&qt.test(t)?t.replace(Ct,y):t||"(?:)"}function vi(t,e,n){t=l(t),e=+e;var r=t.length;if(r>=e||!mu(e))return t;var o=(e-r)/2,i=_u(o),u=yu(o);return n=Sn("",u,n),n.slice(0,i)+t+n}function yi(t,e,n){return(n?Yn(t,e,n):null==e)?e=0:e&&(e=+e),t=mi(t),ku(t,e||(Bt.test(t)?16:10))}function gi(t,e){var n="";if(t=l(t),e=+e,1>e||!t||!mu(e))return n;do e%2&&(n+=t),e=_u(e/2),t+=t;while(e);return n}function _i(t,e,n){return t=l(t),n=null==n?0:Ou(0>n?0:+n||0,t.length),t.lastIndexOf(e,n)==n}function bi(t,n,r){var o=e.templateSettings;r&&Yn(t,n,r)&&(n=r=A),t=l(t),n=ye(ge({},r||n),o,ve);var i,u,a=ye(ge({},n.imports),o.imports,ve),s=Ma(a),c=tn(a,s),f=0,p=n.interpolate||$t,h="__p += '",d=Vi((n.escape||$t).source+"|"+p.source+"|"+(p===kt?St:$t).source+"|"+(n.evaluate||$t).source+"|$","g"),v="//# sourceURL="+("sourceURL"in n?n.sourceURL:"lodash.templateSources["+ ++Ut+"]")+"\n";t.replace(d,function(e,n,r,o,a,s){return r||(r=o),h+=t.slice(f,s).replace(Mt,g),n&&(i=!0,h+="' +\n__e("+n+") +\n'"),a&&(u=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),f=s+e.length,e}),h+="';\n";var y=n.variable;y||(h="with (obj) {\n"+h+"\n}\n"),h=(u?h.replace(yt,""):h).replace(gt,"$1").replace(_t,"$1;"),h="function("+(y||"obj")+") {\n"+(y?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var _=Ga(function(){return Hi(s,v+"return "+h).apply(A,c)});if(_.source=h,Fo(_))throw _;return _}function mi(t,e,n){var r=t;return(t=l(t))?(n?Yn(r,e,n):null==e)?t.slice(O(t),E(t)+1):(e+="",t.slice(c(t,e),f(t,e)+1)):t}function wi(t,e,n){var r=t;return t=l(t),t?(n?Yn(r,e,n):null==e)?t.slice(O(t)):t.slice(c(t,e+"")):t}function xi(t,e,n){var r=t;return t=l(t),t?(n?Yn(r,e,n):null==e)?t.slice(0,E(t)+1):t.slice(0,f(t,e+"")+1):t}function Oi(t,e,n){n&&Yn(t,e,n)&&(e=A);var r=R,o=$;if(null!=e)if(Bo(e)){var i="separator"in e?e.separator:i;r="length"in e?+e.length||0:r,o="omission"in e?l(e.omission):o}else r=+e||0;if(t=l(t),r>=t.length)return t;var u=r-o.length;if(1>u)return o;var a=t.slice(0,u);if(null==i)return a+o;if(Wo(i)){if(t.slice(u).search(i)){var s,c,f=t.slice(0,u);for(i.global||(i=Vi(i.source,(Dt.exec(i)||"")+"g")),i.lastIndex=0;s=i.exec(f);)c=s.index;a=a.slice(0,null==c?u:c)}}else if(t.indexOf(i,u)!=u){var p=a.lastIndexOf(i);p>-1&&(a=a.slice(0,p))}return a+o}function Ei(t){return t=l(t),t&&wt.test(t)?t.replace(bt,k):t}function ki(t,e,n){return n&&Yn(t,e,n)&&(e=A),t=l(t),t.match(e||Lt)||[]}function Pi(t,e,n){return n&&Yn(t,e,n)&&(e=A),b(t)?Ci(t):me(t,e)}function Ai(t){return function(){return t}}function ji(t){return t}function Ci(t){return $e(we(t,!0))}function qi(t,e){return Me(t,we(e,!0))}function Ii(t,e,n){if(null==n){var r=Bo(e),o=r?Ma(e):A,i=o&&o.length?Se(e,o):A;(i?i.length:r)||(i=!1,n=e,e=t,t=this)}i||(i=Se(e,Ma(e)));var u=!0,a=-1,s=Do(t),l=i.length;n===!1?u=!1:Bo(n)&&"chain"in n&&(u=n.chain);for(;++at||!mu(t))return[];var r=-1,o=Li(Ou(t,Cu));for(e=un(e,n,1);++rr?o[r]=e(r):e(r);return o}function Ri(t){var e=++nu;return l(t)+e}function $i(t,e){return(+t||0)+(+e||0)}function Mi(t,e,n){return n&&Yn(t,e,n)&&(e=A),e=Ln(e,n,3),1==e.length?he(Ca(t)?t:cr(t),e):Xe(t,e)}t=t?oe.defaults(re.Object(),t,oe.pick(re,Wt)):re;var Li=t.Array,Wi=t.Date,Ui=t.Error,Hi=t.Function,Ki=t.Math,Qi=t.Number,zi=t.Object,Vi=t.RegExp,Zi=t.String,Ji=t.TypeError,Gi=Li.prototype,Xi=zi.prototype,Yi=Zi.prototype,tu=Hi.prototype.toString,eu=Xi.hasOwnProperty,nu=0,ru=Xi.toString,ou=re._,iu=Vi("^"+tu.call(eu).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),uu=t.ArrayBuffer,au=t.clearTimeout,su=t.parseFloat,lu=Ki.pow,cu=Xi.propertyIsEnumerable,fu=Kn(t,"Set"),pu=t.setTimeout,hu=Gi.splice,du=t.Uint8Array,vu=Kn(t,"WeakMap"),yu=Ki.ceil,gu=Kn(zi,"create"),_u=Ki.floor,bu=Kn(Li,"isArray"),mu=t.isFinite,wu=Kn(zi,"keys"),xu=Ki.max,Ou=Ki.min,Eu=Kn(Wi,"now"),ku=t.parseInt,Pu=Ki.random,Au=Qi.NEGATIVE_INFINITY,ju=Qi.POSITIVE_INFINITY,Cu=4294967295,qu=Cu-1,Iu=Cu>>>1,Fu=9007199254740991,Su=vu&&new vu,Du={};e.support={};e.templateSettings={escape:Ot,evaluate:Et,interpolate:kt,variable:"",imports:{_:e}};var Bu=function(){function t(){}return function(e){if(Bo(e)){t.prototype=e;var n=new t;t.prototype=A}return n||{}}}(),Tu=pn(Ie),Nu=pn(Fe,!0),Ru=hn(),$u=hn(!0),Mu=Su?function(t,e){return Su.set(t,e),t}:ji,Lu=Su?function(t){return Su.get(t)}:Si,Wu=Ue("length"),Uu=function(){var t=0,e=0;return function(n,r){var o=va(),i=L-(o-e);if(e=o,i>0){if(++t>=M)return n}else t=0;return Mu(n,r)}}(),Hu=_o(function(t,e){return b(t)&&Gn(t)?Oe(t,Ce(e,!1,!0)):[]}),Ku=xn(),Qu=xn(!0),zu=_o(function(t){for(var e=t.length,n=e,r=Li(f),o=Un(),i=o==a,u=[];n--;){var s=t[n]=Gn(s=t[n])?s:[];r[n]=i&&s.length>=120?vn(n&&s):null}var l=t[0],c=-1,f=l?l.length:0,p=r[0];t:for(;++c2?t[e-2]:A,r=e>1?t[e-1]:A;return e>2&&"function"==typeof n?e-=2:(n=e>1&&"function"==typeof r?(--e,r):A,r=A),t.length=e,Rr(t,n,r)}),ea=_o(function(t){return t=Ce(t),this.thru(function(e){return Yt(Ca(e)?e:[fr(e)],t)})}),na=_o(function(t,e){return _e(t,Ce(e))}),ra=cn(function(t,e,n){eu.call(t,n)?++t[n]:t[n]=1}),oa=wn(Tu),ia=wn(Nu,!0),ua=kn(ee,Tu),aa=kn(ne,Nu),sa=cn(function(t,e,n){eu.call(t,n)?t[n].push(e):t[n]=[e]}),la=cn(function(t,e,n){t[n]=e}),ca=_o(function(t,e,n){var r=-1,o="function"==typeof e,i=tr(e),u=Gn(t)?Li(t.length):[];return Tu(t,function(t){var a=o?e:i&&null!=t?t[e]:A;u[++r]=a?a.apply(t,n):Jn(t,e,n)}),u}),fa=cn(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),pa=In(ce,Tu),ha=In(fe,Nu),da=_o(function(t,e){if(null==t)return[];var n=e[2];return n&&Yn(e[0],e[1],n)&&(e.length=1),Ge(t,Ce(e),[])}),va=Eu||function(){return(new Wi).getTime()},ya=_o(function(t,e,n){var r=C;if(n.length){var o=w(n,ya.placeholder);r|=D}return Nn(t,r,e,n,o)}),ga=_o(function(t,e){e=e.length?Ce(e):Go(t);for(var n=-1,r=e.length;++n0||0>e)?new o(n):(0>t?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==A&&(e=+e||0,n=0>e?n.dropRight(-e):n.take(e-t)),n)},o.prototype.takeRightWhile=function(t,e){return this.reverse().takeWhile(t,e).reverse()},o.prototype.toArray=function(){return this.take(ju)},Ie(o.prototype,function(t,n){var i=/^(?:filter|map|reject)|While$/.test(n),u=/^(?:first|last)$/.test(n),a=e[u?"take"+("last"==n?"Right":""):n];a&&(e.prototype[n]=function(){var e=u?[1]:arguments,n=this.__chain__,s=this.__wrapped__,l=!!this.__actions__.length,c=s instanceof o,f=e[0],p=c||Ca(s);p&&i&&"function"==typeof f&&1!=f.length&&(c=p=!1);var h=function(t){return u&&n?a(t,1)[0]:a.apply(A,le([t],e))},d={func:Ur,args:[h],thisArg:A},v=c&&!l;if(u&&!n)return v?(s=s.clone(),s.__actions__.push(d),t.call(s)):a.call(A,this.value())[0];if(!u&&p){s=v?s:new o(this);var y=t.apply(s,e);return y.__actions__.push(d),new r(y,n)}return this.thru(h)})}),ee(["join","pop","push","replace","shift","sort","splice","split","unshift"],function(t){var n=(/^(?:replace|split)$/.test(t)?Yi:Gi)[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",o=/^(?:join|pop|replace|shift)$/.test(t);e.prototype[t]=function(){var t=arguments;return o&&!this.__chain__?n.apply(this.value(),t):this[r](function(e){return n.apply(e,t)})}}),Ie(o.prototype,function(t,n){var r=e[n];if(r){var o=r.name,i=Du[o]||(Du[o]=[]);i.push({name:n,func:r})}}),Du[Fn(A,q).name]=[{name:"wrapper",func:A}],o.prototype.clone=m,o.prototype.reverse=Y,o.prototype.value=rt,e.prototype.chain=Hr,e.prototype.commit=Kr,e.prototype.concat=ea,e.prototype.plant=Qr,e.prototype.reverse=zr,e.prototype.toString=Vr,e.prototype.run=e.prototype.toJSON=e.prototype.valueOf=e.prototype.value=Zr,e.prototype.collect=e.prototype.map,e.prototype.head=e.prototype.first,e.prototype.select=e.prototype.filter,e.prototype.tail=e.prototype.rest,e}var A,j="3.10.1",C=1,q=2,I=4,F=8,S=16,D=32,B=64,T=128,N=256,R=30,$="...",M=150,L=16,W=200,U=1,H=2,K="Expected a function",Q="__lodash_placeholder__",z="[object Arguments]",V="[object Array]",Z="[object Boolean]",J="[object Date]",G="[object Error]",X="[object Function]",Y="[object Map]",tt="[object Number]",et="[object Object]",nt="[object RegExp]",rt="[object Set]",ot="[object String]",it="[object WeakMap]",ut="[object ArrayBuffer]",at="[object Float32Array]",st="[object Float64Array]",lt="[object Int8Array]",ct="[object Int16Array]",ft="[object Int32Array]",pt="[object Uint8Array]",ht="[object Uint8ClampedArray]",dt="[object Uint16Array]",vt="[object Uint32Array]",yt=/\b__p \+= '';/g,gt=/\b(__p \+=) '' \+/g,_t=/(__e\(.*?\)|\b__t\)) \+\n'';/g,bt=/&(?:amp|lt|gt|quot|#39|#96);/g,mt=/[&<>"'`]/g,wt=RegExp(bt.source),xt=RegExp(mt.source),Ot=/<%-([\s\S]+?)%>/g,Et=/<%([\s\S]+?)%>/g,kt=/<%=([\s\S]+?)%>/g,Pt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,At=/^\w*$/,jt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,Ct=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,qt=RegExp(Ct.source),It=/[\u0300-\u036f\ufe20-\ufe23]/g,Ft=/\\(\\)?/g,St=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Dt=/\w*$/,Bt=/^0[xX]/,Tt=/^\[object .+?Constructor\]$/,Nt=/^\d+$/,Rt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,$t=/($^)/,Mt=/['\n\r\u2028\u2029\\]/g,Lt=function(){var t="[A-Z\\xc0-\\xd6\\xd8-\\xde]",e="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(t+"+(?="+t+e+")|"+t+"?"+e+"|"+t+"+|[0-9]+","g")}(),Wt=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Ut=-1,Ht={};Ht[at]=Ht[st]=Ht[lt]=Ht[ct]=Ht[ft]=Ht[pt]=Ht[ht]=Ht[dt]=Ht[vt]=!0,Ht[z]=Ht[V]=Ht[ut]=Ht[Z]=Ht[J]=Ht[G]=Ht[X]=Ht[Y]=Ht[tt]=Ht[et]=Ht[nt]=Ht[rt]=Ht[ot]=Ht[it]=!1;var Kt={};Kt[z]=Kt[V]=Kt[ut]=Kt[Z]=Kt[J]=Kt[at]=Kt[st]=Kt[lt]=Kt[ct]=Kt[ft]=Kt[tt]=Kt[et]=Kt[nt]=Kt[ot]=Kt[pt]=Kt[ht]=Kt[dt]=Kt[vt]=!0,Kt[G]=Kt[X]=Kt[Y]=Kt[rt]=Kt[it]=!1;var Qt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},zt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Vt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Zt={"function":!0,object:!0},Jt={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Gt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Xt=Zt[typeof e]&&e&&!e.nodeType&&e,Yt=Zt[typeof t]&&t&&!t.nodeType&&t,te=Xt&&Yt&&"object"==typeof o&&o&&o.Object&&o,ee=Zt[typeof self]&&self&&self.Object&&self,ne=Zt[typeof window]&&window&&window.Object&&window,re=(Yt&&Yt.exports===Xt&&Xt,te||ne!==(this&&this.window)&&ne||ee||this),oe=P();re._=oe,r=function(){return oe}.call(e,n,e,t),!(r!==A&&(t.exports=r))}).call(this)}).call(e,n(24)(t),function(){return this}())},function(t,e,n){"use strict";var r=n(1),o={checkboxInput:n(7),checkboxOptionsInput:n(8),emailInput:n(9),fileInput:n(10),hiddenInput:n(11),passwordInput:n(12),radioOptionsInput:n(13),selectInput:n(14),textareaInput:n(16),textInput:n(15)};o.addInputType=function(t,e){if("string"!=typeof t)throw new Error("Winterfell: First parameter of addInputType must be of type string");if(!r.Component instanceof e.constructor)throw new Error('Winterfell: Cannot not assign "'+t+'" as an inputType. Second paramter expects a React component');o[t]=e},o.addInputTypes=function(t){if("object"!=typeof t)throw new Error("Winterfell: First parameter of addInputTypes must be of type object");for(var e in t)o.addInputType(e,t[e])},t.exports=o},function(t,e){"use strict";var n={"default":"Please correct the field below",isLength:function(t){switch(t.params.length){case 1:return"Please enter a value with at least "+t.params[0]+" character"+(1!=t.params[0]?"s":"");case 2:return"Please enter a value between "+t.params[0]+" and "+t.params[1]+" characters long";default:return n["default"]}return errorMessage},isEmail:"Please enter a valid email address",contains:function(t){return'Please enter a value that contains "'+t.params[0]+'"'},equals:function(t){return"Value must equal "+t.params[0]},isAlpha:"Please only enter letters",isAlphanumeric:"Please only enter letters and numbers",isCreditCard:"Please enter a valid credit card number",isCurrency:"Please enter a current value only",isDate:"Please enter a valid date",isDecimal:"Please enter a decimal value only",isFloat:"Please enter a float value only",isIP:"Please enter a valid IP address",isIn:"Please enter one of the allowed values",isAllIn:"Please enter one of the allowed values",isJSON:"Please enter a valid JSON string",isLowercase:"Please enter lowercase characters only",isUppercase:"Please enter uppercase characters only",isMobilePhone:"Please enter a valid mobile number",isMongoId:"Please enter a valid MongoId",isNumeric:"Please enter numbers only",isURL:"Please enter a valid URL",isAccepted:"Please accept by clicking the checkbox"};n.addErrorMessage=function(t,e){if("string"!=typeof t)throw new Error("Winterfell: First parameter of addErrorMessage must be of type string");if("function"!=typeof e&&"string"!=typeof e)throw new Error("Winterfell: Second parameter of addErrorMessage must be of type function or string");r(t,e)},n.addErrorMessages=function(t){if("object"!=typeof t)throw new Error("Winterfell: First parameter of addErrorMessages must be of type object");for(var e in t)n.addErrorMessage(e,t[e])},n.getErrorMessage=function(t){var e="undefined"!=typeof t.message?t.message:"undefined"!=typeof n[t.type]?n[t.type]:n["default"];return"function"==typeof e?e(t):e};var r=function(t,e){n[t]=e};t.exports=n},function(t,e,n){"use strict";var r=n(2).noConflict(),o=n(23),i=n(18),u={isAccepted:function(t,e){return t==e},isAllIn:function(t,e){return t?r.every(t,function(t){return e.indexOf(t)>-1}):!1}},a=function(t,e,n){var r="undefined"!=typeof u[e.type]?u[e.type]:o.hasOwnProperty(e.type)&&"function"==typeof o[e.type]?o[e.type]:void 0;if(!r)throw new Error('Winterfell: Attempted to validate for undefined method "'+e.type+'"');var a=(e.params||[]).slice(0);return a=a.map(function(t){return"string"==typeof t?i(t,n):t}),a.unshift(t),r.apply(null,a)},s=function h(t,e,n){return n=n||[],t.forEach(function(t){n.push({questionId:t.questionId,validations:t.validations}),"undefined"!=typeof t.input.options&&0!==t.input.options.length&&t.input.options.forEach(function(r){"undefined"!=typeof r.conditionalQuestions&&0!=r.conditionalQuestions.length&&e[t.questionId]==r.value&&(n=h(r.conditionalQuestions,e,n))})}),n},l=function(t,e){var n=[];return t.forEach(function(t){return Array.prototype.push.apply(n,s(t.questions,e))}),n},c=function(t,e){var n=l(t,e).filter(function(t){return t.validations instanceof Array&&t.validations.length>0}),r={};return n.forEach(function(t){var n=t.questionId,o=t.validations;return[].forEach.bind(o,function(t){var o=a(e[n],t,e);o||("undefined"==typeof r[n]&&(r[n]=[]),r[n].push(t))})()}),r},f=function(t,e){if("string"!=typeof t)throw new Error("Winterfell: First parameter of addValidationMethod must be of type string");if("function"!=typeof e)throw new Error("Winterfell: Second parameter of addValidationMethod must be of type function");u[t]=e},p=function(t){if("object"!=typeof t)throw new Error("Winterfell: First parameter of addValidationMethods must be of type object");for(var e in t)f(e,t[e])};t.exports={validateAnswer:a,getActiveQuestions:s,getActiveQuestionsFromQuestionSets:l,getQuestionPanelInvalidQuestions:c,addValidationMethod:f,addValidationMethods:p}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var i=function(){function t(t,e){for(var n=0;n0?cloneArray(this.props.value):[]}}return o(e,t),i(e,[{key:"handleChange",value:function(t){var e=this.state.value;t.target.checked?e.push(t.target.value):e=e.filter(function(e){return e!=t.target.value}),this.setState({value:e},this.props.onChange.bind(null,e))}},{key:"render",value:function(){var t=this;return a.createElement("ul",{className:this.props.classes.checkboxList},this.props.options.map(function(e){return a.createElement("li",{key:e.value,className:t.props.classes.checkboxListItem},a.createElement("label",{className:t.props.classes.checkboxLabel,id:t.props.labelId},a.createElement("input",{type:"checkbox",name:t.props.name,"aria-labelledby":t.props.labelId,value:e.value,checked:t.state.value.indexOf(e.value)>-1,className:t.props.classes.checkbox,required:t.props.required?"required":void 0,onChange:t.handleChange.bind(t),onBlur:t.props.onBlur.bind(null,t.state.value)}),e.text))}))}}]),e}(a.Component));s.defaultProps={classes:{},name:void 0,value:[],options:[],onChange:function(){},onBlur:function(){}},t.exports=s},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var i=function(){function t(t,e){for(var n=0;n-1:t.props.value==e.value}).filter(function(t){return"undefined"!=typeof t.conditionalQuestions&&t.conditionalQuestions.length>0}).forEach(function(n){return[].forEach.bind(n.conditionalQuestions,function(n){r.push(s.createElement(e,{key:n.questionId,questionSetId:t.props.questionSetId,questionId:n.questionId,question:n.question,text:n.text,postText:n.postText,validateOn:n.validateOn,validations:n.validations,value:t.props.questionAnswers[n.questionId],input:n.input,classes:t.props.classes,renderError:t.props.renderError,questionAnswers:t.props.questionAnswers,validationErrors:t.props.validationErrors,onAnswerChange:t.props.onAnswerChange,onQuestionBlur:t.props.onQuestionBlur,onKeyDown:t.props.onKeyDown}))})()});var o="undefined"!=typeof this.props.value?this.props.value:"undefined"!=typeof this.props.input["default"]?this.props.input["default"]:void 0,u="undefined"!=typeof this.props.validationErrors[this.props.questionId]?this.props.validationErrors[this.props.questionId].map(function(e){return"function"==typeof t.props.renderError?t.props.renderError(e,t.props.questionId):s.createElement("div",{key:t.props.questionId+"Error"+e.type,className:t.props.classes.errorMessage},e.message)}):[],a={};this.props.input.props&&(a=this.props.input.props);var c=this.props.questionId+"-label";return s.createElement("div",{className:this.props.classes.question},this.props.question?s.createElement("label",{className:this.props.classes.label,id:c,htmlFor:this.props.questionId},this.props.question,"undefined"!=typeof this.props.renderRequiredAsterisk&&this.props.input.required?this.props.renderRequiredAsterisk():void 0):void 0,this.props.text?s.createElement("p",{className:this.props.classes.questionText},this.props.text):void 0,u,s.createElement(n,i({name:this.props.questionId,id:this.props.questionId,labelId:c,value:o,text:this.props.input.text,options:this.props.input.options,placeholder:this.props.input.placeholder,required:this.props.input.required,classes:this.props.classes,onChange:this.handleInputChange.bind(this,this.props.questionId),onBlur:this.handleInputBlur.bind(this,this.props.questionId),onKeyDown:this.props.onKeyDown},a)),this.props.postText?s.createElement("p",{className:this.props.classes.questionPostText},this.props.postText):void 0,r)}},{key:"componentDidMount",value:function(){"undefined"==typeof this.props.input["default"]||"checkboxInput"===this.props.input.type&&"undefined"==typeof this.props.questionAnswers[this.props.questionId]||this.handleInputChange.call(this,this.props.questionId,this.props.input["default"])}}]),e}(s.Component);c.defaultProps={questionSetId:void 0,questionId:void 0,question:"",validateOn:"blur",validations:[],text:void 0,postText:void 0,value:void 0,input:{"default":void 0,type:"textInput",limit:void 0,placeholder:void 0},classes:{},questionAnswers:{},validationErrors:{},onAnswerChange:function(){},onQuestionBlur:function(){},onKeyDown:function(){},renderError:void 0,renderRequiredAsterisk:void 0},t.exports=c},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var i=function(){function t(t,e){for(var n=0;n-1}).value(),i=c.getQuestionPanelInvalidQuestions(o,this.props.questionAnswers);if(Object.keys(i).length>0){var u=s.mapValues(i,function(t){return t.map(function(t){return{type:t.type,message:f.getErrorMessage(t)}})});return void this.setState({validationErrors:u})}switch(n.forEach(function(n){var r=t.props.questionAnswers[n.questionId];e=r==n.value?{action:n.action,target:n.target}:e}),e.action){case"GOTO":this.props.onSwitchPanel(e.target);break;case"SUBMIT":this.props.onSubmit(e.target)}}},{key:"handleBackButtonClick",value:function(){0!=this.props.panelHistory.length&&this.props.onPanelBack()}},{key:"handleAnswerChange",value:function(t,e,n,r){this.props.onAnswerChange(t,e),this.setState({validationErrors:s.chain(this.state.validationErrors).set(t,[]).value()}),"change"===r&&this.handleAnswerValidate(t,e,n)}},{key:"handleQuestionBlur",value:function(t,e,n,r){"blur"===r&&this.handleAnswerValidate(t,e,n)}},{key:"handleInputKeyDown",value:function(t){"enter"===l[t.keyCode]&&(t.preventDefault(),this.handleMainButtonClick.call(this))}},{key:"render",value:function(){var t=this,e=this.props.questionSets.map(function(e){var n=s.find(t.props.schema.questionSets,{questionSetId:e.questionSetId});return n?a.createElement(h,{key:n.questionSetId,id:n.questionSetId,name:n.name,questionSetHeader:n.questionSetHeader,questionSetText:n.questionSetText,questions:n.questions,classes:t.props.classes,questionAnswers:t.props.questionAnswers,renderError:t.props.renderError,renderRequiredAsterisk:t.props.renderRequiredAsterisk,validationErrors:t.state.validationErrors,onAnswerChange:t.handleAnswerChange.bind(t),onQuestionBlur:t.handleQuestionBlur.bind(t),onKeyDown:t.handleInputKeyDown.bind(t)}):void 0});return a.createElement("div",{className:this.props.classes.questionPanel},"undefined"!=typeof this.props.panelHeader||"undefined"!=typeof this.props.panelText?a.createElement("div",{className:this.props.classes.questionPanelHeaderContainer},"undefined"!=typeof this.props.panelHeader?a.createElement("h3",{className:this.props.classes.questionPanelHeaderText},this.props.panelHeader):void 0,"undefined"!=typeof this.props.panelText?a.createElement("p",{className:this.props.classes.questionPanelText},this.props.panelText):void 0):void 0,a.createElement("div",{className:this.props.classes.questionSets},e),a.createElement("div",{className:this.props.classes.buttonBar},this.props.panelHistory.length>1&&!this.props.backButton.disabled?a.createElement(p,{text:this.props.backButton.text||"Back",onClick:this.handleBackButtonClick.bind(this),className:this.props.classes.backButton}):void 0,this.props.button.disabled?void 0:a.createElement(p,{text:this.props.button.text,onClick:this.handleMainButtonClick.bind(this),className:this.props.classes.controlButton})))}}]),e}(a.Component);d.defaultProps={validationErrors:{},schema:{},classes:{},panelId:void 0,panelIndex:void 0,panelHeader:void 0,panelText:void 0,action:{"default":{},conditions:[]},button:{text:"Submit"},backButton:{text:"Back"},questionSets:[],questionAnswers:{},renderError:void 0,renderRequiredAsterisk:void 0,onAnswerChange:function(){},onSwitchPanel:function(){},onPanelBack:function(){},panelHistory:[]},t.exports=d},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var i=function(){function t(t,e){for(var n=0;n * * Permission is hereby granted, free of charge, to any person obtaining diff --git a/package.json b/package.json index 5f2e4b6e..9f0cc532 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "winterfell", - "version": "1.0.6", + "version": "1.0.7", "description": "Generate complex, validated and extendable JSON-based forms in React", "main": "dist/index.js", "scripts": {