text: !function e(t,n,o){function r(s,a){if(!n[s]){if(!t[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(i)return i(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return r(n?n:e)},u,u.exports,e,t,n,o)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s<o.length;s++)r(o[s]);return r}({1:[function(e,t,n){function o(){u=!1,a.length?l=a.concat(l):p=-1,l.length&&r()}function r(){if(!u){var e=setTimeout(o);u=!0;for(var t=l.length;t;){for(a=l,l=[];++p<t;)a&&a[p].run();p=-1,t=l.length}a=null,u=!1,clearTimeout(e)}}function i(e,t){this.fun=e,this.array=t}function s(){}var a,c=t.exports={},l=[],u=!1,p=-1;c.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new i(e,t)),1!==l.length||u||setTimeout(r,0)},i.prototype.run=function(){this.fun.apply(null,this.array)},c.title="browser",c.browser=!0,c.env={},c.argv=[],c.version="",c.versions={},c.on=s,c.addListener=s,c.once=s,c.off=s,c.removeListener=s,c.removeAllListeners=s,c.emit=s,c.binding=function(e){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(e){throw new Error("process.chdir is not supported")},c.umask=function(){return 0}},{}],2:[function(e,t,n){t.exports={eachComponent:function o(e,t){e&&e.forEach(function(e){e.columns&&Array.isArray(e.columns)?e.columns.forEach(function(e){o(e.components,t)}):e.rows&&Array.isArray(e.rows)?[].concat.apply([],e.rows).forEach(function(e){o(e.components,t)}):e.components&&Array.isArray(e.components)?o(e.components,t):t(e),e.tree&&t(e)})},getComponent:function(e,n){var o;return t.exports.eachComponent(e,function(e){e.key===n&&(o=e)}),o},flattenComponents:function(e){var n={};return t.exports.eachComponent(e,function(e){n[e.key]=e}),n}}},{}],3:[function(e,t,n){(function(e){!function(e){"use strict";if("function"==typeof bootstrap)bootstrap("promise",e);else if("object"==typeof n&&"object"==typeof t)t.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeQ=e}else{if("undefined"==typeof window&&"undefined"==typeof self)throw new Error("This environment was not anticipated by Q. Please file a bug.");var o="undefined"!=typeof window?window:self,r=o.Q;o.Q=e(),o.Q.noConflict=function(){return o.Q=r,this}}}(function(){"use strict";function t(e){return function(){return Q.apply(e,arguments)}}function n(e){return e===Object(e)}function o(e){return"[object StopIteration]"===oe(e)||e instanceof H}function r(e,t){if(M&&t.stack&&"object"==typeof e&&null!==e&&e.stack&&-1===e.stack.indexOf(re)){for(var n=[],o=t;o;o=o.source)o.stack&&n.unshift(o.stack);n.unshift(e.stack);var r=n.join("\n"+re+"\n");e.stack=i(r)}}function i(e){for(var t=e.split("\n"),n=[],o=0;o<t.length;++o){var r=t[o];c(r)||s(r)||!r||n.push(r)}return n.join("\n")}function s(e){return-1!==e.indexOf("(module.js:")||-1!==e.indexOf("(node.js:")}function a(e){var t=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(e);if(t)return[t[1],Number(t[2])];var n=/at ([^ ]+):(\d+):(?:\d+)$/.exec(e);if(n)return[n[1],Number(n[2])];var o=/.*@(.+):(\d+)$/.exec(e);return o?[o[1],Number(o[2])]:void 0}function c(e){var t=a(e);if(!t)return!1;var n=t[0],o=t[1];return n===z&&o>=W&&le>=o}function l(){if(M)try{throw new Error}catch(e){var t=e.stack.split("\n"),n=t[0].indexOf("@")>0?t[1]:t[2],o=a(n);if(!o)return;return z=o[0],o[1]}}function u(e,t,n){return function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t+" is deprecated, use "+n+" instead.",new Error("").stack),e.apply(e,arguments)}}function p(e){return e instanceof h?e:b(e)?E(e):P(e)}function m(){function e(e){t=e,i.source=e,X(n,function(t,n){p.nextTick(function(){e.promiseDispatch.apply(e,n)})},void 0),n=void 0,o=void 0}var t,n=[],o=[],r=ee(m.prototype),i=ee(h.prototype);if(i.promiseDispatch=function(e,r,i){var s=Y(arguments);n?(n.push(s),"when"===r&&i[1]&&o.push(i[1])):p.nextTick(function(){t.promiseDispatch.apply(t,s)})},i.valueOf=function(){if(n)return i;var e=v(t);return y(e)&&(t=e),e},i.inspect=function(){return t?t.inspect():{state:"pending"}},p.longStackSupport&&M)try{throw new Error}catch(s){i.stack=s.stack.substring(s.stack.indexOf("\n")+1)}return r.promise=i,r.resolve=function(n){t||e(p(n))},r.fulfill=function(n){t||e(P(n))},r.reject=function(n){t||e(F(n))},r.notify=function(e){t||X(o,function(t,n){p.nextTick(function(){n(e)})},void 0)},r}function f(e){if("function"!=typeof e)throw new TypeError("resolver must be a function.");var t=m();try{e(t.resolve,t.reject,t.notify)}catch(n){t.reject(n)}return t.promise}function d(e){return f(function(t,n){for(var o=0,r=e.length;r>o;o++)p(e[o]).then(t,n)})}function h(e,t,n){void 0===t&&(t=function(e){return F(new Error("Promise does not support operation: "+e))}),void 0===n&&(n=function(){return{state:"unknown"}});var o=ee(h.prototype);if(o.promiseDispatch=function(n,r,i){var s;try{s=e[r]?e[r].apply(o,i):t.call(o,r,i)}catch(a){s=F(a)}n&&n(s)},o.inspect=n,n){var r=n();"rejected"===r.state&&(o.exception=r.reason),o.valueOf=function(){var e=n();return"pending"===e.state||"rejected"===e.state?o:e.value}}return o}function g(e,t,n,o){return p(e).then(t,n,o)}function v(e){if(y(e)){var t=e.inspect();if("fulfilled"===t.state)return t.value}return e}function y(e){return e instanceof h}function b(e){return n(e)&&"function"==typeof e.then}function k(e){return y(e)&&"pending"===e.inspect().state}function w(e){return!y(e)||"fulfilled"===e.inspect().state}function x(e){return y(e)&&"rejected"===e.inspect().state}function _(){ie.length=0,se.length=0,ce||(ce=!0)}function $(t,n){ce&&("object"==typeof e&&"function"==typeof e.emit&&p.nextTick.runAfter(function(){-1!==Z(se,t)&&(e.emit("unhandledRejection",n,t),ae.push(t))}),se.push(t),n&&"undefined"!=typeof n.stack?ie.push(n.stack):ie.push("(no stack) "+n))}function C(t){if(ce){var n=Z(se,t);-1!==n&&("object"==typeof e&&"function"==typeof e.emit&&p.nextTick.runAfter(function(){var o=Z(ae,t);-1!==o&&(e.emit("rejectionHandled",ie[n],t),ae.splice(o,1))}),se.splice(n,1),ie.splice(n,1))}}function F(e){var t=h({when:function(t){return t&&C(this),t?t(e):this}},function(){return this},function(){return{state:"rejected",reason:e}});return $(t,e),t}function P(e){return h({when:function(){return e},get:function(t){return e[t]},set:function(t,n){e[t]=n},"delete":function(t){delete e[t]},post:function(t,n){return null===t||void 0===t?e.apply(void 0,n):e[t].apply(e,n)},apply:function(t,n){return e.apply(t,n)},keys:function(){return ne(e)}},void 0,function(){return{state:"fulfilled",value:e}})}function E(e){var t=m();return p.nextTick(function(){try{e.then(t.resolve,t.reject,t.notify)}catch(n){t.reject(n)}}),t.promise}function U(e){return h({isDef:function(){}},function(t,n){return S(e,t,n)},function(){return p(e).inspect()})}function q(e,t,n){return p(e).spread(t,n)}function j(e){return function(){function t(e,t){var s;if("undefined"==typeof StopIteration){try{s=n[e](t)}catch(a){return F(a)}return s.done?p(s.value):g(s.value,r,i)}try{s=n[e](t)}catch(a){return o(a)?p(a.value):F(a)}return g(s,r,i)}var n=e.apply(this,arguments),r=t.bind(t,"next"),i=t.bind(t,"throw");return r()}}function O(e){p.done(p.async(e)())}function A(e){throw new H(e)}function T(e){return function(){return q([this,R(arguments)],function(t,n){return e.apply(t,n)})}}function S(e,t,n){return p(e).dispatch(t,n)}function R(e){return g(e,function(e){var t=0,n=m();return X(e,function(o,r,i){var s;y(r)&&"fulfilled"===(s=r.inspect()).state?e[i]=s.value:(++t,g(r,function(o){e[i]=o,0===--t&&n.resolve(e)},n.reject,function(e){n.notify({index:i,value:e})}))},void 0),0===t&&n.resolve(e),n.promise})}function I(e){if(0===e.length)return p.resolve();var t=p.defer(),n=0;return X(e,function(o,r,i){function s(e){t.resolve(e)}function a(){n--,0===n&&t.reject(new Error("Can't get fulfillment value from any promise, all promises were rejected."))}function c(e){t.notify({index:i,value:e})}var l=e[i];n++,g(l,s,a,c)},void 0),t.promise}function L(e){return g(e,function(e){return e=K(e,p),g(R(K(e,function(e){return g(e,G,G)})),function(){return e})})}function V(e){return p(e).allSettled()}function D(e,t){return p(e).then(void 0,void 0,t)}function N(e,t){return p(e).nodeify(t)}var M=!1;try{throw new Error}catch(B){M=!!B.stack}var z,H,W=l(),G=function(){},J=function(){function t(){for(var e,t;o.next;)o=o.next,e=o.task,o.task=void 0,t=o.domain,t&&(o.domain=void 0,t.enter()),n(e,t);for(;c.length;)e=c.pop(),n(e);i=!1}function n(e,n){try{e()}catch(o){if(a)throw n&&n.exit(),setTimeout(t,0),n&&n.enter(),o;setTimeout(function(){throw o},0)}n&&n.exit()}var o={task:void 0,next:null},r=o,i=!1,s=void 0,a=!1,c=[];if(J=function(t){r=r.next={task:t,domain:a&&e.domain,next:null},i||(i=!0,s())},"object"==typeof e&&"[object process]"===e.toString()&&e.nextTick)a=!0,s=function(){e.nextTick(t)};else if("function"==typeof setImmediate)s="undefined"!=typeof window?setImmediate.bind(window,t):function(){setImmediate(t)};else if("undefined"!=typeof MessageChannel){var l=new MessageChannel;l.port1.onmessage=function(){s=u,l.port1.onmessage=t,t()};var u=function(){l.port2.postMessage(0)};s=function(){setTimeout(t,0),u()}}else s=function(){setTimeout(t,0)};return J.runAfter=function(e){c.push(e),i||(i=!0,s())},J}(),Q=Function.call,Y=t(Array.prototype.slice),X=t(Array.prototype.reduce||function(e,t){var n=0,o=this.length;if(1===arguments.length)for(;;){if(n in this){t=this[n++];break}if(++n>=o)throw new TypeError}for(;o>n;n++)n in this&&(t=e(t,this[n],n));return t}),Z=t(Array.prototype.indexOf||function(e){for(var t=0;t<this.length;t++)if(this[t]===e)return t;return-1}),K=t(Array.prototype.map||function(e,t){var n=this,o=[];return X(n,function(r,i,s){o.push(e.call(t,i,s,n))},void 0),o}),ee=Object.create||function(e){function t(){}return t.prototype=e,new t},te=t(Object.prototype.hasOwnProperty),ne=Object.keys||function(e){var t=[];for(var n in e)te(e,n)&&t.push(n);return t},oe=t(Object.prototype.toString);H="undefined"!=typeof ReturnValue?ReturnValue:function(e){this.value=e};var re="From previous event:";p.resolve=p,p.nextTick=J,p.longStackSupport=!1,"object"==typeof e&&e&&e.env&&e.env.Q_DEBUG&&(p.longStackSupport=!0),p.defer=m,m.prototype.makeNodeResolver=function(){var e=this;return function(t,n){t?e.reject(t):arguments.length>2?e.resolve(Y(arguments,1)):e.resolve(n)}},p.Promise=f,p.promise=f,f.race=d,f.all=R,f.reject=F,f.resolve=p,p.passByCopy=function(e){return e},h.prototype.passByCopy=function(){return this},p.join=function(e,t){return p(e).join(t)},h.prototype.join=function(e){return p([this,e]).spread(function(e,t){if(e===t)return e;throw new Error("Can't join: not the same: "+e+" "+t)})},p.race=d,h.prototype.race=function(){return this.then(p.race)},p.makePromise=h,h.prototype.toString=function(){return"[object Promise]"},h.prototype.then=function(e,t,n){function o(t){try{return"function"==typeof e?e(t):t}catch(n){return F(n)}}function i(e){if("function"==typeof t){r(e,a);try{return t(e)}catch(n){return F(n)}}return F(e)}function s(e){return"function"==typeof n?n(e):e}var a=this,c=m(),l=!1;return p.nextTick(function(){a.promiseDispatch(function(e){l||(l=!0,c.resolve(o(e)))},"when",[function(e){l||(l=!0,c.resolve(i(e)))}])}),a.promiseDispatch(void 0,"when",[void 0,function(e){var t,n=!1;try{t=s(e)}catch(o){if(n=!0,!p.onerror)throw o;p.onerror(o)}n||c.notify(t)}]),c.promise},p.tap=function(e,t){return p(e).tap(t)},h.prototype.tap=function(e){return e=p(e),this.then(function(t){return e.fcall(t).thenResolve(t)})},p.when=g,h.prototype.thenResolve=function(e){return this.then(function(){return e})},p.thenResolve=function(e,t){return p(e).thenResolve(t)},h.prototype.thenReject=function(e){return this.then(function(){throw e})},p.thenReject=function(e,t){return p(e).thenReject(t)},p.nearer=v,p.isPromise=y,p.isPromiseAlike=b,p.isPending=k,h.prototype.isPending=function(){return"pending"===this.inspect().state},p.isFulfilled=w,h.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state},p.isRejected=x,h.prototype.isRejected=function(){return"rejected"===this.inspect().state};var ie=[],se=[],ae=[],ce=!0;p.resetUnhandledRejections=_,p.getUnhandledReasons=function(){return ie.slice()},p.stopUnhandledRejectionTracking=function(){_(),ce=!1},_(),p.reject=F,p.fulfill=P,p.master=U,p.spread=q,h.prototype.spread=function(e,t){return this.all().then(function(t){return e.apply(void 0,t)},t)},p.async=j,p.spawn=O,p["return"]=A,p.promised=T,p.dispatch=S,h.prototype.dispatch=function(e,t){var n=this,o=m();return p.nextTick(function(){n.promiseDispatch(o.resolve,e,t)}),o.promise},p.get=function(e,t){return p(e).dispatch("get",[t])},h.prototype.get=function(e){return this.dispatch("get",[e])},p.set=function(e,t,n){return p(e).dispatch("set",[t,n])},h.prototype.set=function(e,t){return this.dispatch("set",[e,t])},p.del=p["delete"]=function(e,t){return p(e).dispatch("delete",[t])},h.prototype.del=h.prototype["delete"]=function(e){return this.dispatch("delete",[e])},p.mapply=p.post=function(e,t,n){return p(e).dispatch("post",[t,n])},h.prototype.mapply=h.prototype.post=function(e,t){return this.dispatch("post",[e,t])},p.send=p.mcall=p.invoke=function(e,t){return p(e).dispatch("post",[t,Y(arguments,2)])},h.prototype.send=h.prototype.mcall=h.prototype.invoke=function(e){return this.dispatch("post",[e,Y(arguments,1)])},p.fapply=function(e,t){return p(e).dispatch("apply",[void 0,t])},h.prototype.fapply=function(e){return this.dispatch("apply",[void 0,e])},p["try"]=p.fcall=function(e){return p(e).dispatch("apply",[void 0,Y(arguments,1)])},h.prototype.fcall=function(){return this.dispatch("apply",[void 0,Y(arguments)])},p.fbind=function(e){var t=p(e),n=Y(arguments,1);return function(){return t.dispatch("apply",[this,n.concat(Y(arguments))])}},h.prototype.fbind=function(){var e=this,t=Y(arguments);return function(){return e.dispatch("apply",[this,t.concat(Y(arguments))])}},p.keys=function(e){return p(e).dispatch("keys",[])},h.prototype.keys=function(){return this.dispatch("keys",[])},p.all=R,h.prototype.all=function(){return R(this)},p.any=I,h.prototype.any=function(){return I(this)},p.allResolved=u(L,"allResolved","allSettled"),h.prototype.allResolved=function(){return L(this)},p.allSettled=V,h.prototype.allSettled=function(){return this.then(function(e){return R(K(e,function(e){function t(){return e.inspect()}return e=p(e),e.then(t,t)}))})},p.fail=p["catch"]=function(e,t){return p(e).then(void 0,t)},h.prototype.fail=h.prototype["catch"]=function(e){return this.then(void 0,e)},p.progress=D,h.prototype.progress=function(e){return this.then(void 0,void 0,e)},p.fin=p["finally"]=function(e,t){return p(e)["finally"](t)},h.prototype.fin=h.prototype["finally"]=function(e){return e=p(e),this.then(function(t){return e.fcall().then(function(){return t})},function(t){return e.fcall().then(function(){throw t})})},p.done=function(e,t,n,o){return p(e).done(t,n,o)},h.prototype.done=function(t,n,o){var i=function(e){p.nextTick(function(){if(r(e,s),!p.onerror)throw e;p.onerror(e)})},s=t||n||o?this.then(t,n,o):this;"object"==typeof e&&e&&e.domain&&(i=e.domain.bind(i)),s.then(void 0,i)},p.timeout=function(e,t,n){return p(e).timeout(t,n)},h.prototype.timeout=function(e,t){var n=m(),o=setTimeout(function(){t&&"string"!=typeof t||(t=new Error(t||"Timed out after "+e+" ms"),t.code="ETIMEDOUT"),n.reject(t)},e);return this.then(function(e){clearTimeout(o),n.resolve(e)},function(e){clearTimeout(o),n.reject(e)},n.notify),n.promise},p.delay=function(e,t){return void 0===t&&(t=e,e=void 0),p(e).delay(t)},h.prototype.delay=function(e){return this.then(function(t){var n=m();return setTimeout(function(){n.resolve(t)},e),n.promise})},p.nfapply=function(e,t){return p(e).nfapply(t)},h.prototype.nfapply=function(e){var t=m(),n=Y(e);return n.push(t.makeNodeResolver()),this.fapply(n).fail(t.reject),t.promise},p.nfcall=function(e){var t=Y(arguments,1);return p(e).nfapply(t)},h.prototype.nfcall=function(){var e=Y(arguments),t=m();return e.push(t.makeNodeResolver()),this.fapply(e).fail(t.reject),t.promise},p.nfbind=p.denodeify=function(e){var t=Y(arguments,1);return function(){var n=t.concat(Y(arguments)),o=m();return n.push(o.makeNodeResolver()),p(e).fapply(n).fail(o.reject),o.promise}},h.prototype.nfbind=h.prototype.denodeify=function(){var e=Y(arguments);return e.unshift(this),p.denodeify.apply(void 0,e)},p.nbind=function(e,t){var n=Y(arguments,2);return function(){function o(){return e.apply(t,arguments)}var r=n.concat(Y(arguments)),i=m();return r.push(i.makeNodeResolver()),p(o).fapply(r).fail(i.reject),i.promise}},h.prototype.nbind=function(){var e=Y(arguments,0);return e.unshift(this),p.nbind.apply(void 0,e)},p.nmapply=p.npost=function(e,t,n){return p(e).npost(t,n)},h.prototype.nmapply=h.prototype.npost=function(e,t){var n=Y(t||[]),o=m();return n.push(o.makeNodeResolver()),this.dispatch("post",[e,n]).fail(o.reject),o.promise},p.nsend=p.nmcall=p.ninvoke=function(e,t){var n=Y(arguments,2),o=m();return n.push(o.makeNodeResolver()),p(e).dispatch("post",[t,n]).fail(o.reject),o.promise},h.prototype.nsend=h.prototype.nmcall=h.prototype.ninvoke=function(e){var t=Y(arguments,1),n=m();return t.push(n.makeNodeResolver()),this.dispatch("post",[e,t]).fail(n.reject),n.promise},p.nodeify=N,h.prototype.nodeify=function(e){return e?void this.then(function(t){p.nextTick(function(){e(null,t)})},function(t){p.nextTick(function(){e(t)})}):this},p.noConflict=function(){throw new Error("Q.noConflict only works when Q is used as a global")};var le=l();return p})}).call(this,e("_process"))},{_process:1}],4:[function(e,t,n){!function(e){function t(){this._events={},this._conf&&o.call(this,this._conf)}function o(e){e&&(this._conf=e,e.delimiter&&(this.delimiter=e.delimiter),e.maxListeners&&(this._events.maxListeners=e.maxListeners),e.wildcard&&(this.wildcard=e.wildcard),e.newListener&&(this.newListener=e.newListener),this.wildcard&&(this.listenerTree={}))}function r(e){this._events={},this.newListener=!1,o.call(this,e)}function i(e,t,n,o){if(!n)return[];var r,s,a,c,l,u,p,m=[],f=t.length,d=t[o],h=t[o+1];if(o===f&&n._listeners){if("function"==typeof n._listeners)return e&&e.push(n._listeners),[n];for(r=0,s=n._listeners.length;s>r;r++)e&&e.push(n._listeners[r]);return[n]}if("*"===d||"**"===d||n[d]){if("*"===d){for(a in n)"_listeners"!==a&&n.hasOwnProperty(a)&&(m=m.concat(i(e,t,n[a],o+1)));return m}if("**"===d){p=o+1===f||o+2===f&&"*"===h,p&&n._listeners&&(m=m.concat(i(e,t,n,f)));for(a in n)"_listeners"!==a&&n.hasOwnProperty(a)&&("*"===a||"**"===a?(n[a]._listeners&&!p&&(m=m.concat(i(e,t,n[a],f))),m=m.concat(i(e,t,n[a],o))):m=a===h?m.concat(i(e,t,n[a],o+2)):m.concat(i(e,t,n[a],o)));return m}m=m.concat(i(e,t,n[d],o+1))}if(c=n["*"],c&&i(e,t,c,o+1),l=n["**"])if(f>o){l._listeners&&i(e,t,l,f);for(a in l)"_listeners"!==a&&l.hasOwnProperty(a)&&(a===h?i(e,t,l[a],o+2):a===d?i(e,t,l[a],o+1):(u={},u[a]=l[a],i(e,t,{"**":u},o+1)))}else l._listeners?i(e,t,l,f):l["*"]&&l["*"]._listeners&&i(e,t,l["*"],f);return m}function s(e,t){e="string"==typeof e?e.split(this.delimiter):e.slice();for(var n=0,o=e.length;o>n+1;n++)if("**"===e[n]&&"**"===e[n+1])return;for(var r=this.listenerTree,i=e.shift();i;){if(r[i]||(r[i]={}),r=r[i],0===e.length){if(r._listeners){if("function"==typeof r._listeners)r._listeners=[r._listeners,t];else if(a(r._listeners)&&(r._listeners.push(t),!r._listeners.warned)){var s=c;"undefined"!=typeof this._events.maxListeners&&(s=this._events.maxListeners),s>0&&r._listeners.length>s&&(r._listeners.warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",r._listeners.length),console.trace())}}else r._listeners=t;return!0}i=e.shift()}return!0}var a=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},c=10;r.prototype.delimiter=".",r.prototype.setMaxListeners=function(e){this._events||t.call(this),this._events.maxListeners=e,this._conf||(this._conf={}),this._conf.maxListeners=e},r.prototype.event="",r.prototype.once=function(e,t){return this.many(e,1,t),this},r.prototype.many=function(e,t,n){function o(){0===--t&&r.off(e,o),n.apply(this,arguments)}var r=this;if("function"!=typeof n)throw new Error("many only accepts instances of Function");return o._origin=n,this.on(e,o),r},r.prototype.emit=function(){this._events||t.call(this);var e=arguments[0];if("newListener"===e&&!this.newListener&&!this._events.newListener)return!1;if(this._all){for(var n=arguments.length,o=new Array(n-1),r=1;n>r;r++)o[r-1]=arguments[r];for(r=0,n=this._all.length;n>r;r++)this.event=e,this._all[r].apply(this,o)}if("error"===e&&!(this._all||this._events.error||this.wildcard&&this.listenerTree.error))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");var s;if(this.wildcard){s=[];var a="string"==typeof e?e.split(this.delimiter):e.slice();i.call(this,s,a,this.listenerTree,0)}else s=this._events[e];if("function"==typeof s){if(this.event=e,1===arguments.length)s.call(this);else if(arguments.length>1)switch(arguments.length){case 2:s.call(this,arguments[1]);break;case 3:s.call(this,arguments[1],arguments[2]);break;default:for(var n=arguments.length,o=new Array(n-1),r=1;n>r;r++)o[r-1]=arguments[r];s.apply(this,o)}return!0}if(s){for(var n=arguments.length,o=new Array(n-1),r=1;n>r;r++)o[r-1]=arguments[r];for(var c=s.slice(),r=0,n=c.length;n>r;r++)this.event=e,c[r].apply(this,o);return c.length>0||!!this._all}return!!this._all},r.prototype.on=function(e,n){if("function"==typeof e)return this.onAny(e),this;if("function"!=typeof n)throw new Error("on only accepts instances of Function");if(this._events||t.call(this),this.emit("newListener",e,n),this.wildcard)return s.call(this,e,n),this;if(this._events[e]){if("function"==typeof this._events[e])this._events[e]=[this._events[e],n];else if(a(this._events[e])&&(this._events[e].push(n),!this._events[e].warned)){var o=c;"undefined"!=typeof this._events.maxListeners&&(o=this._events.maxListeners),o>0&&this._events[e].length>o&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),console.trace())}}else this._events[e]=n;return this},r.prototype.onAny=function(e){if("function"!=typeof e)throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),this._all.push(e),this},r.prototype.addListener=r.prototype.on,r.prototype.off=function(e,t){if("function"!=typeof t)throw new Error("removeListener only takes instances of Function");var n,o=[];if(this.wildcard){var r="string"==typeof e?e.split(this.delimiter):e.slice();o=i.call(this,null,r,this.listenerTree,0)}else{if(!this._events[e])return this;n=this._events[e],o.push({_listeners:n})}for(var s=0;s<o.length;s++){var c=o[s];if(n=c._listeners,a(n)){for(var l=-1,u=0,p=n.length;p>u;u++)if(n[u]===t||n[u].listener&&n[u].listener===t||n[u]._origin&&n[u]._origin===t){l=u;break}if(0>l)continue;return this.wildcard?c._listeners.splice(l,1):this._events[e].splice(l,1),0===n.length&&(this.wildcard?delete c._listeners:delete this._events[e]),this}(n===t||n.listener&&n.listener===t||n._origin&&n._origin===t)&&(this.wildcard?delete c._listeners:delete this._events[e])}return this},r.prototype.offAny=function(e){var t,n=0,o=0;if(e&&this._all&&this._all.length>0){for(t=this._all,n=0,o=t.length;o>n;n++)if(e===t[n])return t.splice(n,1),this}else this._all=[];return this},r.prototype.removeListener=r.prototype.off,r.prototype.removeAllListeners=function(e){if(0===arguments.length)return!this._events||t.call(this),this;if(this.wildcard)for(var n="string"==typeof e?e.split(this.delimiter):e.slice(),o=i.call(this,null,n,this.listenerTree,0),r=0;r<o.length;r++){var s=o[r];s._listeners=null}else{if(!this._events[e])return this;this._events[e]=null}return this},r.prototype.listeners=function(e){if(this.wildcard){var n=[],o="string"==typeof e?e.split(this.delimiter):e.slice();return i.call(this,n,o,this.listenerTree,0),n}return this._events||t.call(this),this._events[e]||(this._events[e]=[]),a(this._events[e])||(this._events[e]=[this._events[e]]),this._events[e]},r.prototype.listenersAny=function(){return this._all?this._all:[]},"function"==typeof define&&define.amd?define(function(){return r}):"object"==typeof n?n.EventEmitter2=r:window.EventEmitter2=r}()},{}],5:[function(e,t,n){t.exports=function(e){if(!e||"object"!=typeof e)return e;var t;if(r(e)){var n=e.length;t=Array(n);for(var i=0;n>i;i++)t[i]=e[i]}else{var s=o(e);t={};for(var i=0,a=s.length;a>i;i++){var c=s[i];t[c]=e[c]}}return t};var o=Object.keys||function(e){var t=[];for(var n in e)({}).hasOwnProperty.call(e,n)&&t.push(n);return t},r=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)}},{}],6:[function(e,t,n){!function(){"use strict";function e(e){if("string"!=typeof e&&(e=e.toString()),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function t(e){return"string"!=typeof e&&(e=e.toString()),e}function n(e){this.map={},e instanceof n?e.forEach(function(e,t){this.append(t,e)},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function o(e){return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function r(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function i(e){var t=new FileReader;return t.readAsArrayBuffer(e),r(t)}function s(e){var t=new FileReader;return t.readAsText(e),r(t)}function a(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,"string"==typeof e)this._bodyText=e;else if(f.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(f.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else{if(e)throw new Error("unsupported BodyInit type");this._bodyText=""}},f.blob?(this.blob=function(){var e=o(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(i)},this.text=function(){var e=o(this);if(e)return e;if(this._bodyBlob)return s(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var e=o(this);return e?e:Promise.resolve(this._bodyText)},f.formData&&(this.formData=function(){return this.text().then(u)}),this.json=function(){return this.text().then(JSON.parse)},this}function c(e){var t=e.toUpperCase();return d.indexOf(t)>-1?t:e}function l(e,t){if(t=t||{},this.url=e,this.credentials=t.credentials||"omit",this.headers=new n(t.headers),this.method=c(t.method||"GET"),this.mode=t.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&t.body)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(t.body)}function u(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),o=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(o),decodeURIComponent(r))}}),t}function p(e){var t=new n,o=e.getAllResponseHeaders().trim().split("\n");return o.forEach(function(e){var n=e.trim().split(":"),o=n.shift().trim(),r=n.join(":").trim();t.append(o,r)}),t}function m(e,t){t||(t={}),this._initBody(e),this.type="default",this.url=null,this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof n?t.headers:new n(t.headers),this.url=t.url||""}if(!self.fetch){n.prototype.append=function(n,o){n=e(n),o=t(o);var r=this.map[n];r||(r=[],this.map[n]=r),r.push(o)},n.prototype["delete"]=function(t){delete this.map[e(t)]},n.prototype.get=function(t){var n=this.map[e(t)];return n?n[0]:null},n.prototype.getAll=function(t){return this.map[e(t)]||[]},n.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},n.prototype.set=function(n,o){this.map[e(n)]=[t(o)]},n.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach(function(n){this.map[n].forEach(function(o){e.call(t,o,n,this)},this)},this)};var f={blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self},d=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];a.call(l.prototype),a.call(m.prototype),self.Headers=n,self.Request=l,self.Response=m,self.fetch=function(e,t){var n;return n=l.prototype.isPrototypeOf(e)&&!t?e:new l(e,t),new Promise(function(e,t){function o(){return"responseURL"in r?r.responseURL:/^X-Request-URL:/m.test(r.getAllResponseHeaders())?r.getResponseHeader("X-Request-URL"):void 0}var r=new XMLHttpRequest;r.onload=function(){var n=1223===r.status?204:r.status;if(100>n||n>599)return void t(new TypeError("Network request failed"));var i={status:n,statusText:r.statusText,headers:p(r),url:o()},s="response"in r?r.response:r.responseText;e(new m(s,i))},r.onerror=function(){t(new TypeError("Network request failed"))},r.open(n.method,n.url,!0),"include"===n.credentials&&(r.withCredentials=!0),"responseType"in r&&f.blob&&(r.responseType="blob"),n.headers.forEach(function(e,t){r.setRequestHeader(t,e)}),r.send("undefined"==typeof n._bodyInit?null:n._bodyInit)})},self.fetch.polyfill=!0}}()},{}],7:[function(e,t,n){"use strict";e("whatwg-fetch");var o=e("Q"),r=e("eventemitter2").EventEmitter2,i=e("shallow-copy"),s="",a=[],c={},l=function(){},u=function(e){return e},p=function(e){var t=[].slice.call(arguments,1);return o.all(a.map(function(n){return(n[e]||l).apply(n,t)}))},m=function(e){var t=[].slice.call(arguments,0),n=function(e,r){var i=a[e];return i?o((i&&i[r]||l).apply(i,[].slice.call(arguments,2))).then(function(o){return null!==o&&void 0!==o?o:n.apply(null,[e+1].concat(t))}):o(null)};return n.apply(null,[0].concat(t))},f=function(e,t){var n=[].slice.call(arguments,2);return a.reduce(function(t,o){return(o[e]||u).apply(o,[t].concat(n))},t)},d=function(e){return e.match(/^(http[s]?:\/\/)([^\/]+)($|\/.*)/)},h=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")},g=function(e){if(!(this instanceof g))return new g(e);if(!e)return this.projectUrl=s+"/project",this.projectsUrl=s+"/project",this.projectId=!1,void(this.query="");this.projectsUrl="",this.projectUrl="",this.projectId="",this.formUrl="",this.formsUrl="",this.formId="",this.submissionsUrl="",this.submissionUrl="",this.submissionId="",this.actionsUrl="",this.actionId="",this.actionUrl="",this.query="",0!==e.indexOf("http")&&0!==e.indexOf("//")&&(s=s?s:window.location.href.match(/http[s]?:\/\/api./)[0],e=s+e);var t=d(e),n=[],o=t[1]+t[2];e=t.length>3?t[3]:"";var r=e.split("?");if(r.length>1&&(e=r[0],this.query="?"+r[1]),-1!==e.search(/(^|\/)(form|project)($|\/)/)){var i=function(t,o){this[t+"sUrl"]=o+"/"+t;var r=new RegExp("/"+t+"/([^/]+)");return-1!==e.search(r)&&(n=e.match(r),this[t+"Url"]=n?o+n[0]:"",this[t+"Id"]=n.length>1?n[1]:"",o+=n[0]),o}.bind(this),a=function(e,t,n){for(var o in e)if(e.hasOwnProperty(o)){var r=e[o];if(r instanceof Array)a(r,t,!0);else{var s=i(r,t);t=n?t:s}}};a(["project","form",["submission","action"]],o),this.projectId||t.length>2&&t[2].split(".").length>2&&(this.projectUrl=o,this.projectId=t[2].split(".")[0])}else{this.projectUrl=o,this.projectId=t.length>2?t[2].split(".")[0]:"";var c=new RegExp("/(submission|action)($|/.*)"),l=e.match(c);this.pathType=l&&l.length>1?l[1]:"",e=e.replace(c,""),e=e.replace(/\/$/,""),this.formsUrl=o+"/form",this.formUrl=o+e,this.formId=e.replace(/^\/+|\/+$/g,"");var u=["submission","action"];for(var p in u)if(u.hasOwnProperty(p)){var m=u[p];this[m+"sUrl"]=o+e+"/"+m,this.pathType===m&&l.length>2&&l[2]&&(this[m+"Id"]=l[2].replace(/^\/+|\/+$/g,""),
  this[m+"Url"]=o+e+l[0])}}},v=function(e){var t=e+"Id",n=e+"Url";return function(r,i){return r&&"object"==typeof r&&(r=h(r.params)),r=r?this.query?this.query+"&"+r:"?"+r:this.query,this[t]?this.makeRequest(e,this[n]+r,"get",null,i):o.reject("Missing "+t)}},y=function(e){var t=e+"Id",n=e+"Url";return function(o,r){var i=this[t]?"put":"post",s=this[t]?this[n]:this[e+"sUrl"];return c={},this.makeRequest(e,s+this.query,i,o,r)}},b=function(e){var t=e+"Id",n=e+"Url";return function(r){return this[t]||o.reject("Nothing to delete"),c={},this.makeRequest(e,this[n],"delete",null,r)}},k=function(e){var t=e+"Url";return function(n,o){return n=n||"",n&&"object"==typeof n&&(n="?"+h(n.params)),this.makeRequest(e,this[t]+n,"get",null,o)}};g.prototype.makeRequest=function(e,t,n,o,r){var i=this;n=(n||"GET").toUpperCase(),r&&"object"==typeof r||(r={});var s={formio:i,type:e,url:t,method:n,data:o,opts:r},a=p("preRequest",s).then(function(){return m("request",s).then(function(e){return null===e||void 0===e?g.request(t,n,o):e})});return f("wrapRequestPromise",a,s)},g.prototype.loadProject=v("project"),g.prototype.saveProject=y("project"),g.prototype.deleteProject=b("project"),g.prototype.loadForm=v("form"),g.prototype.saveForm=y("form"),g.prototype.deleteForm=b("form"),g.prototype.loadForms=k("forms"),g.prototype.loadSubmission=v("submission"),g.prototype.saveSubmission=y("submission"),g.prototype.deleteSubmission=b("submission"),g.prototype.loadSubmissions=k("submissions"),g.prototype.loadAction=v("action"),g.prototype.saveAction=y("action"),g.prototype.deleteAction=b("action"),g.prototype.loadActions=k("actions"),g.prototype.availableActions=function(){return this.makeRequest("availableActions",this.formUrl+"/actions")},g.prototype.actionInfo=function(e){return this.makeRequest("actionInfo",this.formUrl+"/actions/"+e)},g.makeStaticRequest=function(e,t,n){t=(t||"GET").toUpperCase();var o={url:e,method:t,data:n},r=p("preStaticRequest",o).then(function(){return m("staticRequest",o).then(function(o){return null===o||void 0===o?g.request(e,t,n):o})});return f("wrapStaticRequestPromise",r,o)},g.loadProjects=function(e){return e=e||"","object"==typeof e&&(e="?"+h(e.params)),this.makeStaticRequest(s+"/project"+e)},g.request=function(e,t,n){if(!e)return o.reject("No url provided");t=(t||"GET").toUpperCase();var r=btoa(e);return o().then(function(){return"GET"===t&&c.hasOwnProperty(r)?c[r]:o().then(function(){var o=new Headers({Accept:"application/json","Content-type":"application/json; charset=UTF-8"}),r=g.getToken();r&&o.append("x-jwt-token",r);var i={method:t,headers:o,mode:"cors"};return n&&(i.body=JSON.stringify(n)),fetch(e,i)})["catch"](function(e){throw e.message="Could not connect to API server ("+e.message+")",e.networkError=!0,e}).then(function(e){if(e.ok){var t=e.headers.get("x-jwt-token");return e.status>=200&&e.status<300&&t&&""!==t&&g.setToken(t),204===e.status?{}:(-1!==e.headers.get("content-type").indexOf("application/json")?e.json():e.text()).then(function(t){var n=e.headers.get("content-range");if(n&&"object"==typeof t){if(n=n.split("/"),"*"!==n[0]){var o=n[0].split("-");t.skip=Number(o[0]),t.limit=o[1]-o[0]+1}t.serverCount="*"===n[1]?n[1]:Number(n[1])}return t})}return 440===e.status&&g.setToken(null),(-1!==e.headers.get("content-type").indexOf("application/json")?e.json():e.text()).then(function(e){throw e})})["catch"](function(e){throw delete c[r],e})}).then(function(e){if("GET"===t&&(c[r]=o(e)),Array.isArray(e)){var n=e.map(i);return n.skip=e.skip,n.limit=e.limit,n.serverCount=e.serverCount,n}return i(e)})},g.setToken=function(e){if(e=e||"",e!==this.token){if(this.token=e,!e)return g.setUser(null),localStorage.removeItem("formioToken");localStorage.setItem("formioToken",e),g.currentUser()}},g.getToken=function(){if(this.token)return this.token;var e=localStorage.getItem("formioToken")||"";return this.token=e,e},g.setUser=function(e){return e?void localStorage.setItem("formioUser",JSON.stringify(e)):(this.setToken(null),localStorage.removeItem("formioUser"))},g.getUser=function(){return JSON.parse(localStorage.getItem("formioUser")||null)},g.setBaseUrl=function(e){s=e},g.getBaseUrl=function(){return s},g.clearCache=function(){c={}},g.currentUser=function(){var e=s+"/current",t=this.getUser();if(t)return f("wrapStaticRequestPromise",o(t),{url:e,method:"GET"});var n=this.getToken();return n?this.makeStaticRequest(e).then(function(e){return g.setUser(e),e}):f("wrapStaticRequestPromise",o(null),{url:e,method:"GET"})},g.logout=function(){return this.makeStaticRequest(s+"/logout")["finally"](function(){this.setToken(null),this.setUser(null),g.clearCache()}.bind(this))},g.fieldData=function(e,t){if(!e)return"";if(-1!==t.key.indexOf(".")){for(var n=e,o=t.key.split("."),r="",i=0;i<o.length;i++){if(r=o[i],n.hasOwnProperty("_id")&&(n=n.data),!n.hasOwnProperty(r))return;r===o[o.length-1]&&t.multiple&&!Array.isArray(n[r])&&(n[r]=[n[r]]),n=n[r]}return n}return t.multiple&&!Array.isArray(e[t.key])&&(e[t.key]=[e[t.key]]),e[t.key]},g.events=new r({wildcard:!1,maxListeners:0}),g.registerPlugin=function(e,t){a.push(e),a.sort(function(e,t){return(t.priority||0)-(e.priority||0)}),e.__name=t,(e.init||l).call(e,g)},g.getPlugin=function(e){return a.reduce(function(t,n){return t?t:n.__name===e?n:void 0},null)},g.deregisterPlugin=function(e){var t=a.length;return a=a.filter(function(t){return t!==e&&t.__name!==e?!0:((t.deregister||l).call(t,g),!1)}),t!==a.length},t.exports=g},{Q:3,eventemitter2:4,"shallow-copy":5,"whatwg-fetch":6}],8:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("address",{title:"Address",template:function(e){return e.component.multiple?"formio/components/address-multiple.html":"formio/components/address.html"},controller:function(e,t,n){t.address={},t.addresses=[],t.refreshAddress=function(e){var o={address:e,sensor:!1};return n.get("https://maps.googleapis.com/maps/api/geocode/json",{disableJWT:!0,params:o,headers:{Authorization:void 0,Pragma:void 0,"Cache-Control":void 0}}).then(function(e){t.addresses=e.data.results})}},tableView:function(e){return e?e.formatted_address:""},group:"advanced",settings:{input:!0,tableView:!0,label:"",key:"addressField",placeholder:"",multiple:!1,"protected":!1,unique:!1,persistent:!0,validate:{required:!1}}})}]),e.run(["$templateCache",function(e){e.put("formio/components/address.html",'<label ng-if="component.label && !component.hideLabel" for="{{ component.key }}" ng-class="{\'field-required\': component.validate.required}">{{ component.label }}</label>\n<span ng-if="!component.label && component.validate.required" class="glyphicon glyphicon-asterisk form-control-feedback field-required-inline" aria-hidden="true"></span>\n<ui-select ng-model="data[component.key]" safe-multiple-to-single ng-disabled="readOnly" ng-required="component.validate.required" id="{{ component.key }}" tabindex="{{ component.tabindex || 0 }}" theme="bootstrap">\n  <ui-select-match placeholder="{{ component.placeholder }}">{{$item.formatted_address || $select.selected.formatted_address}}</ui-select-match>\n  <ui-select-choices repeat="address in addresses" refresh="refreshAddress($select.search)" refresh-delay="500">\n    <div ng-bind-html="address.formatted_address | highlight: $select.search"></div>\n  </ui-select-choices>\n</ui-select>\n'),e.put("formio/components/address-multiple.html",e.get("formio/components/address.html").replace("<ui-select","<ui-select multiple"))}])}},{}],9:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("button",{title:"Button",template:"formio/components/button.html",settings:{input:!0,label:"Submit",tableView:!1,key:"submit",size:"md",leftIcon:"",rightIcon:"",block:!1,action:"submit",disableOnInvalid:!0,theme:"primary"},controller:function(e,t){t.onClick=function(){switch(e.action){case"submit":return;case"reset":t.resetForm();break;case"oauth":if(t.hasOwnProperty("form")){if(!e.oauth){t.showAlerts({type:"danger",message:"You must assign this button to an OAuth action before it will work."});break}if(e.oauth.error){t.showAlerts({type:"danger",message:e.oauth.error});break}t.openOAuth(e.oauth)}}},t.openOAuth=function(e){var n={response_type:"code",client_id:e.clientId,redirect_uri:window.location.origin||window.location.protocol+"//"+window.location.host,state:e.state,scope:e.scope};e.display&&(n.display=e.display),n=Object.keys(n).map(function(e){return e+"="+encodeURIComponent(n[e])}).join("&");var o=e.authURI+"?"+n,r=window.open(o,e.provider,"width=1020,height=618"),i=setInterval(function(){try{var n=r.location.host,o=window.location.host;if(r&&!r.closed&&n===o&&r.location.search){r.close();var s=r.location.search.substr(1).split("&").reduce(function(e,t){var n=t.split("=");return e[n[0]]=n[1],e},{});if(s.error)return void t.showAlerts({type:"danger",message:s.error_description||s.error});if(e.state!==s.state)return void t.showAlerts({type:"danger",message:"OAuth state does not match. Please try logging in again."});var a={data:{},oauth:{}};a.oauth[e.provider]=s,a.oauth[e.provider].redirectURI=window.location.origin||window.location.protocol+"//"+window.location.host,t.form.submitting=!0,t.formio.saveSubmission(a).then(function(e){t.$emit("formSubmission",e)})["catch"](function(e){t.showAlerts({type:"danger",message:e.message||e})})["finally"](function(){t.form.submitting=!1})}}catch(c){"SecurityError"!==c.name&&t.showAlerts({type:"danger",message:c.message||c})}(!r||r.closed||void 0===r.closed)&&clearInterval(i)},100)}}})}]),e.run(["$templateCache",function(e){e.put("formio/components/button.html",'<button type="{{component.action == \'submit\' || component.action == \'reset\' ? component.action : \'button\'}}"\nng-class="{\'btn-block\': component.block}"\nclass="btn btn-{{ component.theme }} btn-{{ component.size }}"\nng-disabled="readOnly || form.submitting || (component.disableOnInvalid && form.$invalid)"\ntabindex="{{ component.tabindex || 0 }}"\nng-click="onClick()">\n  <span ng-if="component.leftIcon" class="{{ component.leftIcon }}" aria-hidden="true"></span>\n  <span ng-if="component.leftIcon && component.label">&nbsp;</span>{{ component.label }}<span ng-if="component.rightIcon && component.label">&nbsp;</span>\n  <span ng-if="component.rightIcon" class="{{ component.rightIcon }}" aria-hidden="true"></span>\n   <i ng-if="component.action == \'submit\' && form.submitting" class="glyphicon glyphicon-refresh glyphicon-spin"></i>\n</button>\n')}])}},{}],10:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("checkbox",{title:"Check Box",template:"formio/components/checkbox.html",settings:{input:!0,inputType:"checkbox",tableView:!0,hideLabel:!0,label:"",key:"checkboxField",defaultValue:!1,"protected":!1,persistent:!0,validate:{required:!1}}})}]),e.run(["$templateCache","FormioUtils",function(e){e.put("formio/components/checkbox.html",'<div class="checkbox">\n  <label for="{{ component.key }}" ng-class="{\'field-required\': component.validate.required}">\n    <input type="{{ component.inputType }}"\n    id="{{ component.key }}"\n    name="{{ component.key }}"\n    value="{{ component.key }}"\n    tabindex="{{ component.tabindex || 0 }}"\n    ng-disabled="readOnly"\n    ng-model="data[component.key]"\n    ng-required="component.validate.required">\n    {{ component.label }}\n  </label>\n</div>\n')}])}},{}],11:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("columns",{title:"Columns",template:"formio/components/columns.html",group:"layout",settings:{input:!1,columns:[{components:[]},{components:[]}]}})}]),e.run(["$templateCache",function(e){e.put("formio/components/columns.html",'<div class="row">\n  <div class="col-xs-6" ng-repeat="column in component.columns">\n    <formio-component ng-repeat="component in column.components" component="component" data="data" formio="formio" read-only="readOnly"></formio-component>\n  </div>\n</div>\n')}])}},{}],12:[function(e,t,n){"use strict";t.exports=function(e){e.provider("formioComponents",function(){var e={},t={__component:{title:"Basic Components"},advanced:{title:"Special Components"},layout:{title:"Layout Components"}};return{addGroup:function(e,n){t[e]=n},register:function(t,n,o){e[t]?angular.extend(e[t],n):e[t]=n,e[t].group||(e[t].group=o||"__component"),e[t].settings.type=t},$get:function(){return{components:e,groups:t}}}}),e.directive("safeMultipleToSingle",[function(){return{require:"ngModel",restrict:"A",link:function(e,t,n,o){o.$formatters.push(function(t){return!e.component.multiple&&Array.isArray(t)?t[0]||"":t})}}}])}},{}],13:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("container",{title:"Container",template:"formio/components/container.html",group:"layout",icon:"fa fa-folder-open",settings:{input:!0,tree:!0,components:[],tableView:!0,label:"",key:"container","protected":!1,persistent:!0}})}]),e.controller("formioContainerComponent",["$scope",function(e){e.data[e.component.key]=e.data[e.component.key]||{},e.parentKey=e.component.key}]),e.run(["$templateCache","FormioUtils",function(e,t){e.put("formio/components/container.html",t.fieldWrap('<div ng-controller="formioContainerComponent" class="formio-container-component">\n  <formio-component ng-repeat="component in component.components" component="component" data="data[parentKey]" formio="formio" read-only="readOnly"></formio-component>\n</div>\n'))}])}},{}],14:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("content",{title:"Content",template:"formio/components/content.html",settings:{input:!1,html:""}})}]),e.run(["$templateCache",function(e){e.put("formio/components/content.html",'<div ng-bind-html="component.html | safehtml"></div>\n')}])}},{}],15:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("custom",{title:"Custom",template:"formio/components/custom.html",group:"advanced",settings:{}})}]),e.run(["$templateCache",function(e){e.put("formio/components/custom.html",'<div class="panel panel-default">\n  <div class="panel-body text-muted text-center">\n    Custom Component ({{ component.type }})\n  </div>\n</div>\n')}])}},{}],16:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("datagrid",{title:"Data Grid",template:"formio/components/datagrid.html",group:"layout",settings:{input:!0,tree:!0,components:[],tableView:!0,label:"",key:"datagrid","protected":!1,persistent:!0}})}]),e.controller("formioDataGrid",["$scope",function(e){e.data[e.component.key]=e.data[e.component.key]||[{}],e.addRow=function(){Array.isArray(e.data[e.component.key])||(e.data[e.component.key]=[]),e.data[e.component.key].push({})},e.removeRow=function(t){e.data[e.component.key].splice(t,1)}}]),e.run(["$templateCache","FormioUtils",function(e,t){e.put("formio/components/datagrid.html",t.fieldWrap('<div class="formio-data-grid" ng-controller="formioDataGrid" >\n  <table ng-class="{\'table-striped\': component.striped, \'table-bordered\': component.bordered, \'table-hover\': component.hover, \'table-condensed\': component.condensed}" class="table datagrid-table">\n    <tr>\n      <th ng-repeat="component in component.components">{{ component.label}}</th>\n      <th></th>\n    </tr>\n    <tr class="formio-data-grid-row" ng-repeat="rowData in data[component.key] track by $index">\n      <td ng-repeat="component in component.components" ng-init="component.hideLabel = true" >\n        <formio-component component="component" data="rowData" formio="formio" read-only="readOnly"></formio-component>\n      </td>\n      <td>\n        <a ng-click="removeRow($index)" class="btn btn-default">\n          <span class="glyphicon glyphicon-remove-circle"></span>\n        </a>\n      </td>\n    </tr>\n  </table>\n  <div class="datagrid-add">\n    <a ng-click="addRow()" class="btn btn-primary">\n      <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> {{ component.addAnother || "Add Another" }}\n    </a>\n  </div>\n</div>\n'))}])}},{}],17:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("datetime",{title:"Date / Time",template:"formio/components/datetime.html",tableView:function(e){return'<span>{{ "'+e+'" | date: "'+this.settings.format+'" }}</span>'},group:"advanced",settings:{input:!0,tableView:!0,label:"",key:"datetimeField",placeholder:"",format:"yyyy-MM-dd HH:mm",enableDate:!0,enableTime:!0,minDate:null,maxDate:null,datepickerMode:"day",datePicker:{showWeeks:!0,startingDay:0,initDate:"",minMode:"day",maxMode:"year",yearRange:"20"},timePicker:{hourStep:1,minuteStep:1,showMeridian:!0,readonlyInput:!1,mousewheel:!0,arrowkeys:!0},"protected":!1,persistent:!0,validate:{required:!1,custom:""}}})}]),e.run(["$templateCache","FormioUtils",function(e,t){e.put("formio/components/datetime.html",t.fieldWrap('<div class="input-group">\n  <input type="text" class="form-control"\n  ng-focus="calendarOpen = true"\n  ng-click="calendarOpen = true"\n  ng-init="calendarOpen = false"\n  ng-disabled="readOnly"\n  ng-required="component.validate.required"\n  is-open="calendarOpen"\n  datetime-picker="{{ component.format }}"\n  min-date="component.minDate"\n  max-date="component.maxDate"\n  datepicker-mode="component.datepickerMode"\n  enable-date="component.enableDate"\n  enable-time="component.enableTime"\n  ng-model="data[component.key]"\n  tabindex="{{ component.tabindex || 0 }}"\n  placeholder="{{ component.placeholder }}"\n  datepicker-options="component.datePicker"\n  timepicker-options="component.timePicker" />\n  <span class="input-group-btn">\n    <button type="button" ng-disabled="readOnly" class="btn btn-default" ng-click="calendarOpen = true">\n      <i ng-if="component.enableDate" class="glyphicon glyphicon-calendar"></i>\n      <i ng-if="!component.enableDate" class="glyphicon glyphicon-time"></i>\n    </button>\n  </span>\n</div>\n'))}])}},{}],18:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("email",{title:"Email",template:"formio/components/textfield.html",group:"advanced",settings:{input:!0,tableView:!0,inputType:"email",label:"",key:"emailField",placeholder:"",prefix:"",suffix:"",defaultValue:"","protected":!1,unique:!1,persistent:!0}})}])}},{}],19:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("fieldset",{title:"Field Set",template:"formio/components/fieldset.html",group:"layout",settings:{input:!1,tableView:!0,legend:"",components:[]}})}]),e.run(["$templateCache",function(e){e.put("formio/components/fieldset.html",'<fieldset>\n  <legend ng-if="component.legend">{{ component.legend }}</legend>\n  <formio-component ng-repeat="component in component.components" component="component" data="data" formio="formio" read-only="readOnly"></formio-component>\n</fieldset>\n')}])}},{}],20:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("file",{title:"File",template:"formio/components/file.html",group:"advanced",settings:{input:!0,tableView:!0,label:"",key:"file",placeholder:"",multiple:!1,defaultValue:"","protected":!1}})}]),e.directive("formioFileList",[function(){return{restrict:"E",replace:!0,scope:{files:"=",form:"=",readOnly:"="},templateUrl:"formio/components/formio-file-list.html",controller:["$scope",function(e){e.removeFile=function(t,n){t.preventDefault(),e.files.splice(n,1)},e.fileSize=function(e,t,n,o,r){return(t=Math,n=t.log,o=1024,r=n(e)/n(o)|0,e/t.pow(o,r)).toFixed(2)+" "+(r?"kMGTPEZY"[--r]+"B":"Bytes")}}]}}]),e.directive("formioFile",[function(){return{restrict:"E",replace:!0,scope:{file:"=",form:"="},template:'<a href="{{ file.url }}" ng-click="getFile($event)" target="_blank">{{ file.name }}</a>',controller:["$scope","FormioPlugins",function(e,t){e.getFile=function(n){var o=t("storage",e.file.storage);o&&o.downloadFile(n,e.file,e)}}]}}]),e.controller("formioFileUpload",["$scope","FormioPlugins",function(e,t){e.fileUploads={},e.removeUpload=function(t){delete e.fileUploads[t]},e.data&&""===e.data[e.component.key]&&(e.data[e.component.key]=[]),e.data&&""===e.data[e.component.key][0]&&e.data[e.component.key].splice(0,1),e.upload=function(n){if(e.component.storage&&n&&n.length){var o=t("storage",e.component.storage);angular.forEach(n,function(t){o?(e.fileUploads[t.name]={name:t.name,size:t.size,status:"info",message:"Starting upload"},o.uploadFile(t,e.fileUploads[t.name],e).then(function(n){delete e.fileUploads[t.name],n.storage=e.component.storage,e.data[e.component.key].push(n)})["catch"](function(n){e.fileUploads[t.name].status="error",e.fileUploads[t.name].message=n,delete e.fileUploads[t.name].progress})):e.fileUploads[t.name]={name:t.name,size:t.size,status:"error",message:"Storage plugin not found"}})}}}]),e.run(["$templateCache",function(e){e.put("formio/components/formio-file-list.html",'<table class="table table-striped table-bordered">\n  <thead>\n    <tr>\n      <td ng-if="!readOnly" style="width:1%;white-space:nowrap;"></td>\n      <th>File Name</th>\n      <th>Size</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr ng-repeat="file in files track by $index">\n      <td ng-if="!readOnly" style="width:1%;white-space:nowrap;"><a ng-if="!readOnly" href="#" ng-click="removeFile($event, $index)" style="padding: 2px 4px;" class="btn btn-sm btn-default"><span class="glyphicon glyphicon-remove"></span></a></td>\n      <td><formio-file file="file" form="form"></formio-file></td>\n      <td>{{ fileSize(file.size) }}</td>\n    </tr>\n  </tbody>\n</table>\n'),e.put("formio/components/file.html",'<label ng-if="component.label && !component.hideLabel" for="{{ component.key }}" class="control-label" ng-class="{\'field-required\': component.validate.required}">{{ component.label }}</label>\n<span ng-if="!component.label && component.validate.required" class="glyphicon glyphicon-asterisk form-control-feedback field-required-inline" aria-hidden="true"></span>\n<div ng-controller="formioFileUpload">\n  <formio-file-list files="data[component.key]" form="formio.formUrl"></formio-file-list>\n  <div ng-if="!readOnly">\n    <div ngf-drop="upload($files)" class="fileSelector" ngf-drag-over-class="\'fileDragOver\'" ngf-multiple="component.multiple"><span class="glyphicon glyphicon-cloud-upload"></span>Drop files to attach, or <a href="#" ngf-select="upload($files)" tabindex="{{ component.tabindex || 0 }}" ngf-multiple="component.multiple">browse</a>.</div>\n    <div ng-if="!component.storage" class="alert alert-warning">No storage has been set for this field. File uploads are disabled until storage is set up.</div>\n    <div ngf-no-file-drop>File Drag/Drop is not supported for this browser</div>\n  </div>\n  <div ng-repeat="fileUpload in fileUploads track by $index" ng-class="{\'has-error\': fileUpload.status === \'error\'}" class="file">\n    <div class="row">\n      <div class="fileName control-label col-sm-10">{{ fileUpload.name }} <span ng-click="removeUpload(fileUpload.name)" class="glyphicon glyphicon-remove"></span></div>\n      <div class="fileSize control-label col-sm-2 text-right">{{ fileSize(fileUpload.size) }}</div>\n    </div>\n    <div class="row">\n      <div class="col-sm-12">\n        <span ng-if="fileUpload.status === \'progress\'">\n          <div class="progress">\n            <div class="progress-bar" role="progressbar" aria-valuenow="{{fileUpload.progress}}" aria-valuemin="0" aria-valuemax="100" style="width:{{fileUpload.progress}}%">\n              <span class="sr-only">{{fileUpload.progress}}% Complete</span>\n            </div>\n          </div>\n        </span>\n        <div ng-if="!fileUpload.status !== \'progress\'" class="bg-{{ fileUpload.status }} control-label">{{ fileUpload.message }}</div>\n      </div>\n    </div>\n  </div>\n</div>\n')}])}},{}],21:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("hidden",{title:"Hidden",template:"formio/components/hidden.html",group:"advanced",settings:{input:!0,tableView:!0,key:"hiddenField",label:"","protected":!1,unique:!1,persistent:!0}})}]),e.run(["$templateCache",function(e){e.put("formio/components/hidden.html",'<input type="hidden" id="{{ component.key }}" name="{{ component.key }}" ng-model="data[component.key]">\n')}])}},{}],22:[function(e,t,n){"use strict";t.exports=function(e){e.directive("formioHtmlElement",["$sanitize",function(e){return{restrict:"E",scope:{component:"="},templateUrl:"formio/components/htmlelement-directive.html",link:function(t){var n=function(){var n=angular.element("<"+t.component.tag+"></"+t.component.tag+">");n.html(t.component.content),n.attr("class",t.component.className),angular.forEach(t.component.attrs,function(e){e.attr&&n.attr(e.attr,e.value)});try{t.html=e(n.prop("outerHTML")),t.parseError=null}catch(o){t.parseError=o.message.split("\n")[0].replace("[$sanitize:badparse]","")}};n(),t.$watch("component",n,!0)}}}]),e.config(["formioComponentsProvider",function(e){e.register("htmlelement",{title:"HTML Element",template:"formio/components/htmlelement.html",settings:{input:!1,tag:"p",attrs:[],className:"",content:""}})}]),e.run(["$templateCache",function(e){e.put("formio/components/htmlelement.html",'<formio-html-element component="component"></div>'),e.put("formio/components/htmlelement-directive.html",'<div class="alert alert-warning" ng-if="parseError">{{ parseError }}</div>\n<div ng-bind-html="html"></div>\n')}])}},{}],23:[function(e,t,n){"use strict";var o=angular.module("formio");e("./components")(o),e("./textfield")(o),e("./number")(o),e("./password")(o),e("./textarea")(o),e("./checkbox")(o),e("./selectboxes")(o),e("./select")(o),e("./radio")(o),e("./htmlelement")(o),e("./content")(o),e("./button")(o),e("./email")(o),e("./phonenumber")(o),e("./address")(o),e("./datetime")(o),e("./hidden")(o),e("./resource")(o),e("./file")(o),e("./signature")(o),e("./custom")(o),e("./columns")(o),e("./fieldset")(o),e("./container")(o),e("./datagrid")(o),e("./page")(o),e("./panel")(o),e("./table")(o),e("./well")(o)},{"./address":8,"./button":9,"./checkbox":10,"./columns":11,"./components":12,"./container":13,"./content":14,"./custom":15,"./datagrid":16,"./datetime":17,"./email":18,"./fieldset":19,"./file":20,"./hidden":21,"./htmlelement":22,"./number":24,"./page":25,"./panel":26,"./password":27,"./phonenumber":28,"./radio":29,"./resource":30,"./select":31,"./selectboxes":32,"./signature":33,"./table":34,"./textarea":35,"./textfield":36,"./well":37}],24:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("number",{title:"Number",template:"formio/components/number.html",settings:{input:!0,tableView:!0,inputType:"number",label:"",key:"numberField",placeholder:"",prefix:"",suffix:"",defaultValue:"","protected":!1,persistent:!0,validate:{required:!1,min:"",max:"",step:"any",integer:"",multiple:"",custom:""}}})}]),e.run(["$templateCache","FormioUtils",function(e,t){e.put("formio/components/number.html",t.fieldWrap('<input type="{{ component.inputType }}"\nclass="form-control"\nid="{{ component.key }}"\nname="{{ component.key }}"\ntabindex="{{ component.tabindex || 0 }}"\nng-model="data[component.key]"\nng-required="component.validate.required"\nng-disabled="readOnly"\nsafe-multiple-to-single\nmin="{{ component.validate.min }}"\nmax="{{ component.validate.max }}"\nstep="{{ component.validate.step }}"\nplaceholder="{{ component.placeholder }}"\ncustom-validator="component.validate.custom"\nui-mask="{{ component.inputMask }}"\nui-mask-placeholder=""\nui-options="uiMaskOptions"\n>\n'))}])}},{}],25:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("page",{template:"formio/components/page.html",settings:{input:!1,components:[]}})}]),e.run(["$templateCache",function(e){e.put("formio/components/page.html",'<formio-component ng-repeat="component in component.components" component="component" data="data" formio="formio"></formio-component>\n')}])}},{}],26:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("panel",{title:"Panel",template:"formio/components/panel.html",group:"layout",settings:{input:!1,title:"",theme:"default",components:[]}})}]),e.run(["$templateCache",function(e){e.put("formio/components/panel.html",'<div class="panel panel-{{ component.theme }}">\n  <div ng-if="component.title" class="panel-heading">\n    <h3 class="panel-title">{{ component.title }}</h3>\n  </div>\n  <div class="panel-body">\n    <formio-component ng-repeat="component in component.components" component="component" data="data" formio="formio" read-only="readOnly"></formio-component>\n  </div>\n</div>\n')}])}},{}],27:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("password",{title:"Password",template:"formio/components/textfield.html",tableView:function(){return"--- PROTECTED ---"},settings:{input:!0,tableView:!1,inputType:"password",label:"",key:"passwordField",placeholder:"",prefix:"",suffix:"","protected":!0,persistent:!0}})}])}},{}],28:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("phoneNumber",{title:"Phone Number",template:"formio/components/textfield.html",group:"advanced",settings:{input:!0,tableView:!0,inputMask:"(999) 999-9999",label:"",key:"phonenumberField",placeholder:"",prefix:"",suffix:"",multiple:!1,"protected":!1,unique:!1,persistent:!0,validate:{required:!1}}})}])}},{}],29:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("radio",{title:"Radio",template:"formio/components/radio.html",settings:{input:!0,tableView:!0,inputType:"radio",label:"",key:"radioField",values:[],defaultValue:"","protected":!1,persistent:!0,validate:{required:!1,custom:"",customPrivate:!1}}})}]),e.run(["$templateCache","FormioUtils",function(e,t){e.put("formio/components/radio.html",t.fieldWrap('<div ng-class="component.inline ? \'radio-inline\' : \'radio\'" ng-repeat="v in component.values track by $index">\n  <label class="control-label" for="{{ v.value }}">\n    <input type="{{ component.inputType }}"\n    id="{{ v.value }}"\n    name="{{ component.key }}"\n    value="{{ v.value }}"\n    tabindex="{{ component.tabindex || 0 }}"\n    ng-model="data[component.key]"\n    ng-required="component.validate.required"\n    ng-disabled="readOnly"\n    custom-validator="component.validate.custom">\n    {{ v.label }}\n  </label>\n</div>\n'))}])}},{}],30:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("resource",{title:"Resource",tableView:function(e){return e?e._id:""},template:function(e){return e.component.multiple?"formio/components/resource-multiple.html":"formio/components/resource.html"},controller:function(e,t,n,o){if(t.selectItems=[],e.multiple&&(e.defaultValue=[]),e.resource){var r=new o(t.formio.projectUrl+"/form/"+e.resource);t.refreshSubmissions=function(n){var o=e.params||{};e.selectFields&&(o.select=e.selectFields),e.searchFields&&n&&angular.forEach(e.searchFields,function(e,t){o[e]=n}),r.loadSubmissions({params:o}).then(function(e){t.selectItems=e||[]})},t.refreshSubmissions()}},group:"advanced",settings:{input:!0,tableView:!0,label:"",key:"resourceField",placeholder:"",resource:"",defaultValue:"",template:"<span>{{ item.data }}</span>",selectFields:"",searchFields:"",multiple:!1,"protected":!1,persistent:!0,validate:{required:!1},defaultPermission:""}})}]),e.run(["$templateCache",function(e){e.put("formio/components/resource.html",'<label ng-if="component.label && !component.hideLabel" for="{{ component.key }}" class="control-label" ng-class="{\'field-required\': component.validate.required}">{{ component.label }}</label>\n<span ng-if="!component.label && component.validate.required" class="glyphicon glyphicon-asterisk form-control-feedback field-required-inline" aria-hidden="true"></span>\n<ui-select ui-select-required safe-multiple-to-single ui-select-open-on-focus ng-model="data[component.key]" ng-disabled="readOnly" ng-required="component.validate.required" id="{{ component.key }}" name="{{ component.key }}" theme="bootstrap" tabindex="{{ component.tabindex || 0 }}">\n  <ui-select-match placeholder="{{ component.placeholder }}">\n    <formio-select-item template="component.template" item="$item || $select.selected" select="$select"></formio-select-item>\n  </ui-select-match>\n  <ui-select-choices repeat="item in selectItems | filter: $select.search" refresh="refreshSubmissions($select.search)" refresh-delay="250">\n    <formio-select-item template="component.template" item="item" select="$select"></formio-select-item>\n  </ui-select-choices>\n</ui-select>\n<formio-errors></formio-errors>\n'),
  e.put("formio/components/resource-multiple.html",e.get("formio/components/resource.html").replace("<ui-select","<ui-select multiple"))}])}},{}],31:[function(e,t,n){"use strict";t.exports=function(e){e.directive("formioSelectItem",["$compile",function(e){return{restrict:"E",scope:{template:"=",item:"=",select:"="},link:function(t,n){t.template&&n.html(e(angular.element(t.template))(t))}}}]),e.directive("uiSelectRequired",function(){return{require:"ngModel",link:function(e,t,n,o){var r=o.$isEmpty;o.$isEmpty=function(e){return Array.isArray(e)&&0===e.length||r(e)}}}}),e.directive("uiSelectOpenOnFocus",["$timeout",function(e){return{require:"uiSelect",restrict:"A",link:function(t,n,o,r){var i=!1;angular.element(r.focusser).on("focus",function(){i||r.activate()}),t.$on("uis:close",function(){i=!0,e(function(){i=!1})})}}}]),e.config(["formioComponentsProvider",function(e){e.register("select",{title:"Select",template:function(e){return e.component.multiple?"formio/components/select-multiple.html":"formio/components/select.html"},controller:function(e,t,n,o){t.nowrap=!0,t.selectItems=[];var r=t.component.valueProperty;switch(t.getSelectItem=function(t){return t?"values"===e.dataSrc?t.value:r?t[r]:t:""},e.multiple&&(e.defaultValue=[]),t.refreshItems=angular.noop,e.dataSrc){case"values":t.selectItems=e.data.values;break;case"json":try{t.selectItems=angular.fromJson(e.data.json)}catch(i){t.selectItems=[]}break;case"url":if(e.data.url){var s={cache:!0};"/"===e.data.url.substr(0,1)&&(e.data.url=o.getBaseUrl()+e.data.url),-1===e.data.url.indexOf(o.getBaseUrl())&&(s={disableJWT:!0,headers:{Authorization:void 0,Pragma:void 0,"Cache-Control":void 0}});var a=!1;t.refreshItems=function(o){var r=e.data.url;if(e.searchField&&o)r+=(-1===r.indexOf("?")?"?":"&")+encodeURIComponent(e.searchField)+"="+encodeURIComponent(o);else if(a)return;n.get(r,s).then(function(e){t.selectItems=e.data,a=!0})},t.refreshItems()}break;default:t.selectItems=[]}},settings:{input:!0,tableView:!0,label:"",key:"selectField",placeholder:"",data:{values:[],json:"",url:""},dataSrc:"values",valueProperty:"",defaultValue:"",template:"<span>{{ item.label }}</span>",multiple:!1,"protected":!1,unique:!1,persistent:!0,validate:{required:!1}}})}]),e.run(["$templateCache",function(e){e.put("formio/components/select.html",'<label ng-if="component.label && !component.hideLabel"  for="{{ component.key }}" class="control-label" ng-class="{\'field-required\': component.validate.required}">{{ component.label }}</label>\n<span ng-if="!component.label && component.validate.required" class="glyphicon glyphicon-asterisk form-control-feedback field-required-inline" aria-hidden="true"></span>\n<ui-select ui-select-required ui-select-open-on-focus ng-model="data[component.key]" safe-multiple-to-single name="{{ component.key }}" ng-disabled="readOnly" ng-required="component.validate.required" id="{{ component.key }}" theme="bootstrap" tabindex="{{ component.tabindex || 0 }}">\n  <ui-select-match placeholder="{{ component.placeholder }}">\n    <formio-select-item template="component.template" item="$item || $select.selected" select="$select"></formio-select-item>\n  </ui-select-match>\n  <ui-select-choices repeat="getSelectItem(item) as item in selectItems | filter: $select.search" refresh="refreshItems($select.search)" refresh-delay="250">\n    <formio-select-item template="component.template" item="item" select="$select"></formio-select-item>\n  </ui-select-choices>\n</ui-select>\n<formio-errors></formio-errors>\n'),e.put("formio/components/select-multiple.html",e.get("formio/components/select.html").replace("<ui-select","<ui-select multiple"))}])}},{}],32:[function(e,t,n){"use strict";t.exports=function(e){e.directive("formioSelectBoxes",[function(){return{restrict:"E",replace:!0,require:"ngModel",scope:{component:"=",readOnly:"=",model:"=ngModel"},templateUrl:"formio/components/selectboxes-directive.html",link:function(e,t,n,o){var r={};angular.forEach(e.component.values,function(e){r[e.value]=!!o.$viewValue[e.value]}),o.$setViewValue(r),o.$setPristine(!0),o.$isEmpty=function(e){return Object.keys(e).every(function(t){return!e[t]})},e.toggleCheckbox=function(e){var t=angular.copy(o.$viewValue);t[e]=!t[e],o.$setViewValue(t)}}}}]),e.config(["formioComponentsProvider",function(e){e.register("selectboxes",{title:"Select Boxes",template:"formio/components/selectboxes.html",tableView:function(e){return e?Object.keys(e).filter(function(t){return e[t]}).join(", "):""},settings:{input:!0,tableView:!0,label:"",key:"selectboxesField",values:[],defaultValue:{},inline:!1,"protected":!1,persistent:!0,validate:{required:!1}}})}]),e.run(["$templateCache","FormioUtils",function(e){e.put("formio/components/selectboxes-directive.html",'<div class="select-boxes">\n  <div ng-class="component.inline ? \'checkbox-inline\' : \'checkbox\'" ng-repeat="v in component.values track by $index">\n    <label class="control-label" for="{{ component.key }}-{{ v.value }}">\n      <input type="checkbox"\n      id="{{ component.key }}-{{ v.value }}"\n      name="{{ component.key }}-{{ v.value }}"\n      value="{{ v.value }}"\n      tabindex="{{ component.tabindex || 0 }}"\n      ng-disabled="readOnly"\n      ng-click="toggleCheckbox(v.value)"\n      ng-checked="model[v.value]"\n      >\n      {{ v.label }}\n    </label>\n  </div>\n</div>\n'),e.put("formio/components/selectboxes.html",'<label ng-if="component.label" for="{{ component.key }}" class="control-label" ng-class="{\'field-required\': component.validate.required}">{{ component.label }}</label>\n<formio-select-boxes\n  name="{{ component.key }}"\n  ng-model="data[component.key]"\n  ng-model-options="{allowInvalid: true}"\n  component="component"\n  read-only="readOnly"\n  ng-required="component.validate.required"\n  custom-validator="component.validate.custom"\n  ></formio-select-boxes>\n<formio-errors></formio-errors>\n')}])}},{}],33:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("signature",{title:"Signature",template:"formio/components/signature.html",tableView:function(e){return e?"Yes":"No"},group:"advanced",settings:{input:!0,tableView:!0,label:"",key:"signature",placeholder:"",footer:"Sign above",width:"100%",height:"150",penColor:"black",backgroundColor:"rgb(245,245,235)",minWidth:"0.5",maxWidth:"2.5","protected":!1,persistent:!0,validate:{required:!1}}})}]),e.directive("signature",function(){return{restrict:"A",scope:{component:"="},require:"?ngModel",link:function(e,t,n,o){function r(){e.component.validate.required&&s.isEmpty()?o.$setViewValue(""):o.$setViewValue(s.toDataURL())}if(o){e.component.label="Signature",e.component.hideLabel=!0;var i=function(n){if("%"===e.component[n].slice(-1)){var o=parseFloat(e.component[n].slice(0,-1))/100;t[0][n]=t.parent()[n]()*o}else t[0][n]=parseInt(e.component[n],10),e.component[n]=t[0][n]+"px"};i("width"),i("height");var s=new SignaturePad(t[0],{minWidth:e.component.minWidth,maxWidth:e.component.maxWidth,penColor:e.component.penColor,backgroundColor:e.component.backgroundColor});e.$watch("component.penColor",function(e){s.penColor=e}),e.$watch("component.backgroundColor",function(e){s.backgroundColor=e,s.clear()}),e.component.clearSignature=function(){s.clear(),r()},t.css({"border-radius":"4px","box-shadow":"0 0 5px rgba(0, 0, 0, 0.02) inset",border:"1px solid #f4f4f4"}),o.$render=function(){s.fromDataURL(o.$viewValue)},s.onEnd=function(){e.$evalAsync(r)},e.component.validate.required||r()}}}}),e.run(["$templateCache","FormioUtils",function(e,t){e.put("formio/components/signature.html",t.fieldWrap('<img ng-if="readOnly" ng-attr-src="{{data[component.key]}}" src="" />\n<div ng-if="!readOnly" style="width: {{ component.width }}; height: {{ component.height }};">\n  <a class="btn btn-xs btn-default" style="position:absolute; left: 0; top: 0; z-index: 1000" ng-click="component.clearSignature()">\n    <span class="glyphicon glyphicon-refresh"></span>\n  </a>\n  <canvas signature component="component" name="{{ component.key }}" ng-model="data[component.key]" ng-required="component.validate.required"></canvas>\n  <div class="formio-signature-footer" style="text-align: center;color:#C3C3C3;" ng-class="{\'field-required\': component.validate.required}">{{ component.footer }}</div>\n</div>\n'))}])}},{}],34:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("table",{title:"Table",template:"formio/components/table.html",group:"layout",settings:{input:!1,numRows:3,numCols:3,rows:[[{components:[]},{components:[]},{components:[]}],[{components:[]},{components:[]},{components:[]}],[{components:[]},{components:[]},{components:[]}]],header:[],caption:"",striped:!1,bordered:!1,hover:!1,condensed:!1}})}]),e.run(["$templateCache",function(e){var t="{'table-striped': component.striped, ";t+="'table-bordered': component.bordered, ",t+="'table-hover': component.hover, ",t+="'table-condensed': component.condensed}",e.put("formio/components/table.html",'<div class="table-responsive">\n  <table ng-class="{\'table-striped\': component.striped, \'table-bordered\': component.bordered, \'table-hover\': component.hover, \'table-condensed\': component.condensed}" class="table">\n    <thead ng-if="component.header.length">\n      <th ng-repeat="header in component.header">{{ header }}</th>\n    </thead>\n    <tbody>\n      <tr ng-repeat="row in component.rows track by $index">\n        <td ng-repeat="column in row track by $index">\n          <formio-component ng-repeat="component in column.components" component="component" data="data" formio="formio"></formio-component>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n</div>\n')}])}},{}],35:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("textarea",{title:"Text Area",template:"formio/components/textarea.html",settings:{input:!0,tableView:!0,label:"",key:"textareaField",placeholder:"",prefix:"",suffix:"",rows:3,multiple:!1,defaultValue:"","protected":!1,persistent:!0,validate:{required:!1,minLength:"",maxLength:"",pattern:"",custom:""}}})}]),e.run(["$templateCache","FormioUtils",function(e,t){e.put("formio/components/textarea.html",t.fieldWrap('<textarea\nclass="form-control"\nng-model="data[component.key]"\nng-disabled="readOnly"\nng-required="component.validate.required"\nsafe-multiple-to-single\nid="{{ component.key }}"\ntabindex="{{ component.tabindex || 0 }}"\nplaceholder="{{ component.placeholder }}"\ncustom-validator="component.validate.custom"\nrows="{{ component.rows }}"></textarea>\n'))}])}},{}],36:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("textfield",{title:"Text Field",template:"formio/components/textfield.html",icon:"fa fa-terminal",settings:{input:!0,tableView:!0,inputType:"text",inputMask:"",label:"",key:"textField",placeholder:"",prefix:"",suffix:"",multiple:!1,defaultValue:"","protected":!1,unique:!1,persistent:!0,validate:{required:!1,minLength:"",maxLength:"",pattern:"",custom:"",customPrivate:!1}}})}]),e.run(["$templateCache","FormioUtils",function(e,t){e.put("formio/components/textfield.html",t.fieldWrap('<input type="{{ component.inputType }}"\nclass="form-control"\nid="{{ component.key }}"\nname="{{ component.key }}"\ntabindex="{{ component.tabindex || 0 }}"\nng-disabled="readOnly"\nng-model="data[component.key]"\nng-model-options="{ debounce: 500 }"\nsafe-multiple-to-single\nng-required="component.validate.required"\nng-minlength="component.validate.minLength"\nng-maxlength="component.validate.maxLength"\nng-pattern="component.validate.pattern"\ncustom-validator="component.validate.custom"\nplaceholder="{{ component.placeholder }}"\nui-mask="{{ component.inputMask }}"\nui-mask-placeholder="" \' + // avoids regular placeholder mixing with mask placeholder\nui-options="uiMaskOptions"\n>\n'))}])}},{}],37:[function(e,t,n){"use strict";t.exports=function(e){e.config(["formioComponentsProvider",function(e){e.register("well",{title:"Well",template:"formio/components/well.html",group:"layout",settings:{input:!1,components:[]}})}]),e.run(["$templateCache",function(e){e.put("formio/components/well.html",'<div class="well">\n  <formio-component ng-repeat="component in component.components" component="component" data="data" formio="formio" read-only="readOnly"></formio-component>\n</div>\n')}])}},{}],38:[function(require,module,exports){"use strict";module.exports=function(){return{restrict:"A",require:"ngModel",link:function(scope,ele,attrs,ctrl){scope.component.validate&&scope.component.validate.custom&&(ctrl.$validators.custom=function(modelValue,viewValue){var valid=!0,input=modelValue||viewValue,custom=scope.component.validate.custom;return custom=custom.replace(/({{\s+(.*)\s+}})/,function(e,t,n){return scope.data[n]}),eval(custom),valid!==!0?(scope.component.customError=valid,!1):!0})}}}},{}],39:[function(e,t,n){"use strict";t.exports=function(){return{restrict:"E",replace:!0,scope:{src:"=",formAction:"=",form:"=",submission:"=",readOnly:"=",formioOptions:"="},controller:["$scope","$http","$element","FormioScope","Formio","FormioUtils",function(e,t,n,o,r,i){e.formioAlerts=[],this.showAlerts=e.showAlerts=function(t){e.formioAlerts=[].concat(t)},e._src=e.src,e._src&&-1===e._src.indexOf("live=")&&(e._src+=-1===e._src.indexOf("?")?"?":"&",e._src+="live=1"),e.formio=o.register(e,n,{form:!0,submission:!0}),e.onSubmit=function(s){if(e.formioForm.$valid&&!s.submitting){s.submitting=!0;var a={data:{}};e._submission._id&&(a._id=e._submission._id),e._submission.data._id&&(a._id=e._submission.data._id);var c=i.flattenComponents(e._form.components);angular.forEach(c,function(t){e._submission.data.hasOwnProperty(t.key)&&(a.data[t.key]=e._submission.data[t.key])}),angular.forEach(e._submission.data,function(e,t){e&&!e.hasOwnProperty("_id")&&(a.data[t]=e)});var l=function(e){if(!e)return[];e instanceof Array||(e=[e]);var t=[];return e.forEach(function(e){e&&e._id&&t.push(e._id)}),t},u={};angular.forEach(c,function(e){"resource"===e.type&&e.key&&e.defaultPermission&&(u[e.key]=e.defaultPermission)}),angular.forEach(e._submission.data,function(e,t){var n=u[t];if(n){a.access=a.access||[],e instanceof Array||(e=[e]);var o=!1;a.access.forEach(function(t){t.type===n&&(o=!0,t.resources=t.resources||[],t.resources.concat(l(e)))}),o||a.access.push({type:n,resources:l(e)})}});var p=function(t,n){e.showAlerts({type:"success",message:"Submission was "+("put"===t?"updated":"created")+"."}),s.submitting=!1,e.$emit("formSubmission",n)},m=e.$emit("formSubmit",a);if(!m.defaultPrevented)if(e.action){var f=a._id?"put":"post";t[f](e.action,a).success(function(e){r.clearCache(),p(f,e)}).error(o.onError(e,n))["finally"](function(){s.submitting=!1})}else e.formio?e.formio.saveSubmission(angular.copy(a),e.formioOptions).then(function(e){p(e.method,e)},o.onError(e,n))["finally"](function(){s.submitting=!1}):e.$emit("formSubmission",a)}}}],templateUrl:"formio.html"}}},{}],40:[function(e,t,n){"use strict";t.exports=["Formio","formioComponents",function(e,t){return{replace:!0,restrict:"E",require:"?^formio",scope:{component:"=",data:"=",formio:"=",form:"=",readOnly:"="},templateUrl:"formio/component.html",link:function(e,t,n,o){o?e.showAlerts=o.showAlerts.bind(o):e.showAlerts=function(){throw new Error("Cannot call $scope.showAlerts unless this component is inside a formio directive.")}},controller:["$scope","$http",function(n,o){if(n.uiMaskOptions={maskDefinitions:{9:/\d/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},clearOnBlur:!1,eventsToHandle:["input","keyup","click","focus"],silentEvents:["click","focus"]},n.resetForm=function(){for(var e in n.data)delete n.data[e]},n.data||n.resetForm(),n.component&&n.component.key){var r="";-1!==n.component.key.indexOf(".")&&(r=n.component.key.split(".").shift()),n.$watch("data",function(t){if(t&&!angular.equals({},t)&&(!r||t.hasOwnProperty(r)&&!angular.equals({},t[r]))){r&&t[r].hasOwnProperty("_id")&&(n.data[r+"._id"]=t[r]._id);var o=e.fieldData(t,n.component);void 0!==o&&(n.data[n.component.key]=o)}})}var i=t.components[n.component.type]||t.components.custom;if(angular.forEach(i.settings,function(e,t){n.component.hasOwnProperty(t)||(n.component[t]=angular.copy(e))}),n.addFieldValue=function(){n.data[n.component.key]=n.data[n.component.key]||[],n.data[n.component.key].push("")},n.removeFieldValue=function(e){n.data[n.component.key].splice(e,1)},"function"==typeof i.template?n.template=i.template(n):n.template=i.template,n.component.key&&-1!==n.component.key.indexOf("[")){var s=n.component.key.match(/([^\[]+)\[([^]+)\]/);3===s.length&&n.data.hasOwnProperty(s[1])&&(n.data=n.data[s[1]],n.component.key=s[2])}i.controller&&i.controller(n.component,n,o,e),n.data&&!n.data.hasOwnProperty(n.component.key)&&n.component.hasOwnProperty("defaultValue")?n.component.multiple&&!angular.isArray(n.component.defaultValue)?n.data[n.component.key]=[n.component.defaultValue]:n.data[n.component.key]=n.component.defaultValue:n.data&&!n.data.hasOwnProperty(n.component.key)&&n.component.multiple&&(n.data[n.component.key]=[])}]}}]},{}],41:[function(e,t,n){"use strict";t.exports=function(){return{restrict:"E",replace:!0,scope:{form:"=",submission:"=",src:"=",formAction:"=",resourceName:"="},templateUrl:"formio-delete.html",controller:["$scope","$element","FormioScope","Formio","$http",function(e,t,n,o,r){e.formioAlerts=[],e.showAlerts=function(t){e.formioAlerts=[].concat(t)};var i="resource",s="",a=n.register(e,t,{form:!0,submission:!0});if(a){i=a.submissionId?"submission":"form";var c=i.charAt(0).toUpperCase()+i.slice(1);s="delete"+c}e._resourceName=i,e.onDelete=function(){var i=e.resourceName||e._resourceName,c=i.charAt(0).toUpperCase()+i.slice(1),l=function(t){e.showAlerts({type:"success",message:c+" was deleted."}),o.clearCache(),e.$emit("delete",t)};if(e.action)r["delete"](e.action).success(l).error(n.onError(e,t));else if(a){if(!s)return;if("function"!=typeof a[s])return;a[s]().then(l,n.onError(e,t))}},e.onCancel=function(){e.$emit("cancel")}}]}}},{}],42:[function(e,t,n){"use strict";t.exports=["$compile","$templateCache",function(e,t){return{scope:!1,link:function(n,o){o.replaceWith(e(t.get(n.template))(n)),n.$emit("formElementRender",o)},controller:function(){}}}]},{}],43:[function(e,t,n){"use strict";t.exports=function(){return{scope:!1,restrict:"E",templateUrl:"formio/errors.html"}}},{}],44:[function(e,t,n){"use strict";t.exports=function(){return{replace:!0,restrict:"E",scope:{src:"=",form:"=",submissions:"=",perPage:"="},templateUrl:"formio/submissions.html",controller:["$scope","$element","FormioScope",function(e,t,n){e.formioAlerts=[],this.showAlerts=e.showAlerts=function(t){e.formioAlerts=[].concat(t)},e.perPage=void 0===e.perPage?10:e.perPage,e.formio=n.register(e,t,{form:!0,submissions:!0}),e.currentPage=1,e.pageChanged=function(t){e.skip=(t-1)*e.perPage,e.updateSubmissions()},e.tableView=function(e){return!e.hasOwnProperty("tableView")||e.tableView},e.$watch("_submissions",function(t){t&&t.length>0&&e.$emit("submissionLoad",e._submissions)})}]}}},{}],45:[function(e,t,n){"use strict";t.exports=["Formio","formioComponents",function(e,t){return{onError:function(e,t){return function(n){if("ValidationError"===n.name){t.find("#form-group-"+n.details[0].path).addClass("has-error");var o="ValidationError: "+n.details[0].message;e.showAlerts({type:"danger",message:o})}else n instanceof Error?n=n.toString():"object"==typeof n&&(n=JSON.stringify(n)),e.showAlerts({type:"danger",message:n});e.$emit("formError",n)}},register:function(n,o,r){var i=this,s=null;n._src=n._src||n.src||"",n._form=n.form||{},n._submission=n.submission||{data:{}},n._submissions=n.submissions||[],n.formLoading=!0;var a=0;n.$on("formElementRender",function(){a++,a===n._form.components.length&&setTimeout(function(){n.$emit("formRender",n._form)},1)});var c=function(t){return t?n.action?"":("/"===t.substr(0,1)&&(t=e.getBaseUrl()+t),t):""};n.action=c(n.formAction);var l={};return n.$on("addFormComponent",function(e,o){if(!l.hasOwnProperty(o.settings.key)){l[o.settings.key]=!0;var r=t.components[o.type];n._form.components.push(angular.extend(r.settings,o.settings))}}),n.$watch("form.action",function(e){if(e){var t=c(e);t&&(n.action=t)}}),n.fieldData=function(n,o){var r=e.fieldData(n,o),i=t.components[o.type];if(!i.tableView)return r;if(o.multiple&&r.length>0){var s=[];return angular.forEach(r,function(e){s.push(i.tableView(e,o))}),s}return i.tableView(r,o)},n.updateSubmissions=function(){n.formLoading=!0;var e={};n.perPage&&(e.limit=n.perPage),n.skip&&(e.skip=n.skip),s.loadSubmissions({params:e}).then(function(e){n._submissions=e,n.formLoading=!1,n.$emit("submissionsLoad",e)},i.onError(n))},n._src?(s=new e(n._src),r.form&&(n.formLoading=!0,s.loadForm().then(function(e){n._form=e,n.formLoading=!1,n.$emit("formLoad",e)},this.onError(n))),r.submission&&s.submissionId&&(n.formLoading=!0,s.loadSubmission().then(function(e){n._submission=e,n._submission.data||(n._submission.data={}),n.formLoading=!1,n.$emit("submissionLoad",e)},this.onError(n))),r.submissions&&n.updateSubmissions()):(n.formoLoaded=!0,n.formLoading=!1,n._form&&n.$emit("formLoad",n._form),n._submission&&n.$emit("submissionLoad",n._submission),n._submissions&&n.$emit("submissionsLoad",n._submissions)),s}}}]},{}],46:[function(e,t,n){"use strict";var o=e("formio-utils");t.exports=function(){return{flattenComponents:o.flattenComponents,eachComponent:o.eachComponent,getComponent:o.getComponent,fieldWrap:function(e){e+="<formio-errors></formio-errors>";var t=e.replace("data[component.key]","data[component.key][$index]"),n='<label ng-if="component.label && !component.hideLabel" for="{{ component.key }}" class="control-label" ng-class="{\'field-required\': component.validate.required}">{{ component.label }}</label>',o='<span ng-if="!component.label && component.validate.required" class="glyphicon glyphicon-asterisk form-control-feedback field-required-inline" aria-hidden="true"></span>',r='<div ng-if="!component.multiple">'+n+o+'<div class="input-group" ng-if="component.prefix || component.suffix"><div class="input-group-addon" ng-if="!!component.prefix">{{ component.prefix }}</div>'+e+'<div class="input-group-addon" ng-if="!!component.suffix">{{ component.suffix }}</div></div><div ng-if="!component.prefix && !component.suffix">'+e+'</div></div><div ng-if="component.multiple"><table class="table table-bordered">'+n+'<tr ng-repeat="value in data[component.key] track by $index"><td>'+o+'<div class="input-group" ng-if="component.prefix || component.suffix"><div class="input-group-addon" ng-if="!!component.prefix">{{ component.prefix }}</div>'+t+'<div class="input-group-addon" ng-if="!!component.suffix">{{ component.suffix }}</div></div><div ng-if="!component.prefix && !component.suffix">'+t+'</div></td><td><a ng-click="removeFieldValue($index)" class="btn btn-default"><span class="glyphicon glyphicon-remove-circle"></span></a></td></tr><tr><td colspan="2"><a ng-click="addFieldValue()" class="btn btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> {{ component.addAnother || "Add Another" }}</a></td></tr></table></div>';return r}}}},{"formio-utils":2}],47:[function(e,t,n){"use strict";t.exports=["$q","$rootScope","Formio",function(e,t,n){var o={response:function(e){var t=e.headers("x-jwt-token");return e.status>=200&&e.status<300&&t&&""!==t&&n.setToken(t),e},responseError:function(o){return 440===parseInt(o.status,10)?(o.loggedOut=!0,n.setToken(null),t.$broadcast("formio.sessionExpired",o.body)):401===parseInt(o.status,10)&&t.$broadcast("formio.unauthorized",o.body),e.reject(o)},request:function(e){if(e.disableJWT)return e;var t=n.getToken();return t&&(e.headers["x-jwt-token"]=t),e}};return o}]},{}],48:[function(e,t,n){"use strict";t.exports=["FormioUtils",function(e){return e.flattenComponents}]},{}],49:[function(e,t,n){"use strict";t.exports=["$sce",function(e){return function(t){return e.trustAsHtml(t)}}]},{}],50:[function(e,t,n){"use strict";var o=angular.module("formio",["ngSanitize","ui.bootstrap","ui.bootstrap.datetimepicker","ui.select","ui.mask","angularMoment","ngFileUpload"]);o.provider("Formio",e("./providers/Formio")),o.provider("FormioPlugins",e("./providers/FormioPlugins")),o.factory("FormioScope",e("./factories/FormioScope")),o.factory("FormioUtils",e("./factories/FormioUtils")),o.factory("formioInterceptor",e("./factories/formioInterceptor")),o.directive("formio",e("./directives/formio")),o.directive("formioDelete",e("./directives/formioDelete")),o.directive("formioErrors",e("./directives/formioErrors")),o.directive("customValidator",e("./directives/customValidator")),o.directive("formioSubmissions",e("./directives/formioSubmissions")),o.directive("formioComponent",e("./directives/formioComponent")),o.directive("formioElement",e("./directives/formioElement")),o.filter("flattenComponents",e("./filters/flattenComponents")),o.filter("safehtml",e("./filters/safehtml")),o.config(["$httpProvider",function(e){e.defaults.headers.get||(e.defaults.headers.get={}),e.defaults.headers.get["Cache-Control"]="no-cache",e.defaults.headers.get.Pragma="no-cache",e.interceptors.push("formioInterceptor")}]),e("./plugins")(o),o.run(["$templateCache",function(e){e.put("formio.html",'<form role="form" name="formioForm" ng-submit="onSubmit(formioForm)" novalidate>\n  <i style="font-size: 2em;" ng-if="formLoading" class="glyphicon glyphicon-refresh glyphicon-spin"></i>\n  <div ng-repeat="alert in formioAlerts" class="alert alert-{{ alert.type }}" role="alert">\n    {{ alert.message }}\n  </div>\n  <formio-component ng-repeat="component in _form.components track by $index" component="component" data="_submission.data" form="formioForm" formio="formio" read-only="readOnly"></formio-component>\n</form>\n'),e.put("formio-delete.html",'<form role="form">\n  <div ng-repeat="alert in formioAlerts" class="alert alert-{{ alert.type }}" role="alert">\n    {{ alert.message }}\n  </div>\n  <h3>Are you sure you wish to delete the {{ resourceName || _resourceName }}?</h3>\n  <div class="btn-toolbar">\n    <button ng-click="onDelete()" class="btn btn-danger">Yes</button>\n    <button ng-click="onCancel()" class="btn btn-default">No</button>\n  </div>\n</form>\n'),e.put("formio/submissions.html",'<div>\n  <div ng-repeat="alert in formioAlerts" class="alert alert-{{ alert.type }}" role="alert">\n    {{ alert.message }}\n  </div>\n  <table class="table">\n    <thead>\n      <tr>\n        <th ng-repeat="component in _form.components | flattenComponents" ng-if="tableView(component)">{{ component.label || component.key }}</th>\n        <th>Submitted</th>\n        <th>Updated</th>\n        <th>Operations</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr ng-repeat="submission in _submissions" class="formio-submission" ng-click="$emit(\'submissionView\', submission)">\n        <td ng-repeat="component in _form.components | flattenComponents" ng-if="tableView(component)">{{ fieldData(submission.data, component) }}</td>\n        <td>{{ submission.created | amDateFormat:\'l, h:mm:ss a\' }}</td>\n        <td>{{ submission.modified | amDateFormat:\'l, h:mm:ss a\' }}</td>\n        <td>\n          <div class="button-group" style="display:flex;">\n            <a ng-click="$emit(\'submissionView\', submission); $event.stopPropagation();" class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-eye-open"></span></a>&nbsp;\n            <a ng-click="$emit(\'submissionEdit\', submission); $event.stopPropagation();" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-edit"></span></a>&nbsp;\n            <a ng-click="$emit(\'submissionDelete\', submission); $event.stopPropagation();" class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-remove-circle"></span></a>\n          </div>\n        </td>\n      </tr>\n    </tbody>\n  </table>\n  <pagination\n    ng-if="_submissions.serverCount > perPage"\n    ng-model="currentPage"\n    ng-change="pageChanged(currentPage)"\n    total-items="_submissions.serverCount"\n    items-per-page="perPage"\n    direction-links="false"\n    boundary-links="true"\n    first-text="&laquo;"\n    last-text="&raquo;"\n    >\n  </pagination>\n</div>\n'),e.put("formio/component.html",'<ng-form name="formioFieldForm" class="formio-component-{{ component.key }}">\n  <div class="form-group has-feedback form-field-type-{{ component.type }} {{component.customClass}}" id="form-group-{{ component.key }}" ng-class="{\'has-error\': formioFieldForm[component.key].$invalid && !formioFieldForm[component.key].$pristine }" ng-style="component.style">\n    <formio-element></formio-element>\n  </div>\n</ng-form>\n'),e.put("formio/errors.html",'<div ng-show="formioFieldForm[component.key].$error && !formioFieldForm[component.key].$pristine">\n  <p class="help-block" ng-show="formioFieldForm[component.key].$error.email">{{ component.label || component.key }} must be a valid email.</p>\n  <p class="help-block" ng-show="formioFieldForm[component.key].$error.required">{{ component.label || component.key }} is required.</p>\n  <p class="help-block" ng-show="formioFieldForm[component.key].$error.number">{{ component.label || component.key }} must be a number.</p>\n  <p class="help-block" ng-show="formioFieldForm[component.key].$error.maxlength">{{ component.label || component.key }} must be shorter than {{ component.validate.maxLength + 1 }} characters.</p>\n  <p class="help-block" ng-show="formioFieldForm[component.key].$error.minlength">{{ component.label || component.key }} must be longer than {{ component.validate.minLength - 1 }} characters.</p>\n  <p class="help-block" ng-show="formioFieldForm[component.key].$error.min">{{ component.label || component.key }} must be higher than {{ component.validate.min - 1 }}.</p>\n  <p class="help-block" ng-show="formioFieldForm[component.key].$error.max">{{ component.label || component.key }} must be lower than {{ component.validate.max + 1 }}.</p>\n  <p class="help-block" ng-show="formioFieldForm[component.key].$error.custom">{{ component.customError }}</p>\n  <p class="help-block" ng-show="formioFieldForm[component.key].$error.pattern">{{ component.label || component.key }} does not match the pattern {{ component.validate.pattern }}</p>\n</div>\n')}]),e("./components")},{"./components":23,"./directives/customValidator":38,"./directives/formio":39,"./directives/formioComponent":40,"./directives/formioDelete":41,"./directives/formioElement":42,"./directives/formioErrors":43,"./directives/formioSubmissions":44,"./factories/FormioScope":45,"./factories/FormioUtils":46,"./factories/formioInterceptor":47,"./filters/flattenComponents":48,"./filters/safehtml":49,"./plugins":51,"./providers/Formio":55,"./providers/FormioPlugins":56}],51:[function(e,t,n){"use strict";t.exports=function(t){e("./storage/url")(t),e("./storage/s3")(t),e("./storage/dropbox")(t)}},{"./storage/dropbox":52,"./storage/s3":53,"./storage/url":54}],52:[function(e,t,n){"use strict";t.exports=function(e){e.config(["FormioPluginsProvider","FormioStorageDropboxProvider",function(e,t){e.register("storage","dropbox",t.$get())}]),e.factory("FormioStorageDropbox",["$q","$rootScope","$window","$http",function(e,t,n,o){var r=function(){var e;return t.user&&t.user.externalTokens&&angular.forEach(t.user.externalTokens,function(t){"dropbox"===t.type&&(e=t.token)}),e};return{title:"Dropbox",name:"dropbox",uploadFile:function(t,n,o){var i=e.defer(),s=o.component.dir||"",a=r();if(a){var c=new XMLHttpRequest,l=function(e){n.status="progress",n.progress=parseInt(100*e.loaded/e.total),delete n.message,o.$apply()};c.upload.onprogress=l,c.onload=function(){200===c.status?(i.resolve(JSON.parse(c.response)),o.$apply()):(i.reject(c.response||"Unable to upload file"),o.$apply())},c.open("POST","https://content.dropboxapi.com/2/files/upload"),c.setRequestHeader("Authorization","Bearer "+a),c.setRequestHeader("Content-Type","application/octet-stream"),c.setRequestHeader("Dropbox-API-Arg",JSON.stringify({path:"/"+s+t.name,
  mode:"add",autorename:!0,mute:!1})),c.send(t)}else i.reject("You must authenticate with dropbox before uploading files.");return i.promise},downloadFile:function(e,t){e.preventDefault();var i=r();o({method:"POST",url:"https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},data:{path:t.path_lower},disableJWT:!0}).then(function(e){n.open(e.data.url,"_blank")},function(e){alert(e.data)})}}}])}},{}],53:[function(e,t,n){"use strict";t.exports=function(e){e.config(["FormioPluginsProvider","FormioStorageS3Provider",function(e,t){e.register("storage","s3",t.$get())}]),e.factory("FormioStorageS3",["$q","$window","Formio","Upload",function(e,t,n,o){return{title:"S3",name:"s3",uploadFile:function(t,r,i){var s=e.defer();return n.request(i.formio.formUrl+"/storage/s3","POST",{name:t.name,size:t.size,type:t.type}).then(function(e){var n={url:e.url,method:"POST",data:e.data};n.data.file=t;var a=i.component.dir||"";n.data.key+=a+t.name;var c=o.upload(n);c.then(function(){s.resolve({name:t.name,bucket:e.bucket,key:n.data.key,url:e.url+n.data.key,acl:n.data.acl,size:t.size,type:t.type})},function(e){var t=new DOMParser,n=t.parseFromString(e.data,"text/xml"),o=n.getElementsByTagName("Message")[0].innerHTML;s.reject(o)},function(e){r.status="progress",r.progress=parseInt(100*e.loaded/e.total),delete r.message})}),s.promise},downloadFile:function(e,o,r){"public-read"!==o.acl&&(e.preventDefault(),n.request(r.form+"/storage/s3?bucket="+o.bucket+"&key="+o.key,"GET").then(function(e){t.open(e.url,"_blank")})["catch"](function(e){alert(e)}))}}}])}},{}],54:[function(e,t,n){"use strict";t.exports=function(e){e.config(["FormioPluginsProvider","FormioStorageUrlProvider",function(e,t){e.register("storage","url",t.$get())}]),e.factory("FormioStorageUrl",["$q","Upload",function(e,t){return{title:"Url",name:"url",uploadFile:function(n,o,r){var i=e.defer();return t.upload({url:r.component.url,data:{file:n}}).then(function(e){i.resolve(e)},function(e){i.reject(e.data)},function(e){o.status="progress",o.progress=parseInt(100*e.loaded/e.total),delete o.message}),i.promise},downloadFile:function(){}}}])}},{}],55:[function(e,t,n){"use strict";t.exports=function(){var t=e("formiojs/src/formio.js");return{setBaseUrl:t.setBaseUrl,getBaseUrl:t.getBaseUrl,registerPlugin:t.registerPlugin,getPlugin:t.getPlugin,setDomain:function(e){},$get:["$rootScope","$q",function(e,n){var o=function(t){return n.when(t)["catch"](function(t){throw"Unauthorized"===t?e.$broadcast("formio.unauthorized",t):"Login Timeout"===t&&e.$broadcast("formio.sessionExpired",t),t})};return t.registerPlugin({priority:-100,wrapRequestPromise:o,wrapStaticRequestPromise:o},"ngFormioPromiseWrapper"),t.events.onAny(function(){var t="formio."+this.event,n=[].splice.call(arguments,0);n.unshift(t),e.$apply(function(){e.$broadcast.apply(e,n)})}),t}]}}},{"formiojs/src/formio.js":7}],56:[function(e,t,n){"use strict";t.exports=function(){var e={};return{register:function(t,n,o){e[t]||(e[t]={}),e[t][n]=o},$get:[function(){return function(t,n){return t?n?e[t][n]||!1:e[t]||!1:e}}]}}},{}]},{},[50]);