vericred
Version:
Client library to interact with the Vericred API
2 lines • 42.7 kB
JavaScript
!function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return i(r?r:e)},l,l.exports,e,t,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(e,t,r){!function(e,n){"function"==typeof define&&define.amd?define([],n):"object"==typeof r?t.exports=n():e.returnExports=n()}(this,function(){function e(i,o){if("function"!=typeof o)throw new Error("Bad callback given: "+o);if(!i)throw new Error("No options given");var a=i.onResponse;if(i="string"==typeof i?{uri:i}:JSON.parse(JSON.stringify(i)),i.onResponse=a,i.verbose&&(e.log=n()),i.url&&(i.uri=i.url,delete i.url),!i.uri&&""!==i.uri)throw new Error("options.uri is a required argument");if("string"!=typeof i.uri)throw new Error("options.uri must be a string");for(var u=["proxy","_redirectsFollowed","maxRedirects","followRedirect"],c=0;c<u.length;c++)if(i[u[c]])throw new Error("options."+u[c]+" is not supported");if(i.callback=o,i.method=i.method||"GET",i.headers=i.headers||{},i.body=i.body||null,i.timeout=i.timeout||e.DEFAULT_TIMEOUT,i.headers.host)throw new Error("Options.headers.host is not supported");i.json&&(i.headers.accept=i.headers.accept||"application/json","GET"!==i.method&&(i.headers["content-type"]="application/json"),"boolean"!=typeof i.json?i.body=JSON.stringify(i.json):"string"!=typeof i.body&&(i.body=JSON.stringify(i.body)));var l=function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t.join("&")};if(i.qs){var f="string"==typeof i.qs?i.qs:l(i.qs);-1!==i.uri.indexOf("?")?i.uri=i.uri+"&"+f:i.uri=i.uri+"?"+f}var p=function(e){var t={};t.boundry="-------------------------------"+Math.floor(1e9*Math.random());var r=[];for(var n in e)e.hasOwnProperty(n)&&r.push("--"+t.boundry+'\nContent-Disposition: form-data; name="'+n+'"\n\n'+e[n]+"\n");return r.push("--"+t.boundry+"--"),t.body=r.join(""),t.length=t.body.length,t.type="multipart/form-data; boundary="+t.boundry,t};if(i.form){if("string"==typeof i.form)throw"form name unsupported";if("POST"===i.method){var h=(i.encoding||"application/x-www-form-urlencoded").toLowerCase();switch(i.headers["content-type"]=h,h){case"application/x-www-form-urlencoded":i.body=l(i.form).replace(/%20/g,"+");break;case"multipart/form-data":var d=p(i.form);i.body=d.body,i.headers["content-type"]=d.type;break;default:throw new Error("unsupported encoding:"+h)}}}return i.onResponse=i.onResponse||r,i.onResponse===!0&&(i.onResponse=o,i.callback=r),!i.headers.authorization&&i.auth&&(i.headers.authorization="Basic "+s(i.auth.username+":"+i.auth.password)),t(i)}function t(t){function r(){f=!0;var r=new Error("ETIMEDOUT");return r.code="ETIMEDOUT",r.duration=t.timeout,e.log.error("Timeout",{id:l._id,milliseconds:t.timeout}),t.callback(r,l)}function n(r){if(f)return e.log.debug("Ignoring timed out state change",{state:l.readyState,id:l.id});if(e.log.debug("State change",{state:l.readyState,id:l.id,timed_out:f}),l.readyState===a.OPENED){e.log.debug("Request started",{id:l.id});for(var n in t.headers)l.setRequestHeader(n,t.headers[n])}else l.readyState===a.HEADERS_RECEIVED?i():l.readyState===a.LOADING?(i(),s()):l.readyState===a.DONE&&(i(),s(),u())}function i(){if(!y.response){if(y.response=!0,e.log.debug("Got response",{id:l.id,status:l.status}),clearTimeout(l.timeoutTimer),l.statusCode=l.status,p&&0==l.statusCode){var r=new Error("CORS request rejected: "+t.uri);return r.cors="rejected",y.loading=!0,y.end=!0,t.callback(r,l)}t.onResponse(null,l)}}function s(){y.loading||(y.loading=!0,e.log.debug("Response body loading",{id:l.id}))}function u(){if(!y.end){if(y.end=!0,e.log.debug("Request done",{id:l.id}),l.body=l.responseText,t.json)try{l.body=JSON.parse(l.responseText)}catch(r){return t.callback(r,l)}t.callback(null,l,l.body)}}var l=new a,f=!1,p=o(t.uri),h="withCredentials"in l;if(c+=1,l.seq_id=c,l.id=c+": "+t.method+" "+t.uri,l._id=l.id,p&&!h){var d=new Error("Browser does not support cross-origin request: "+t.uri);return d.cors="unsupported",t.callback(d,l)}l.timeoutTimer=setTimeout(r,t.timeout);var y={response:!1,loading:!1,end:!1};return l.onreadystatechange=n,l.open(t.method,t.uri,!0),p&&(l.withCredentials=!!t.withCredentials),l.send(t.body),l}function r(){}function n(){var e,t,n={},o=["trace","debug","info","warn","error"];for(t=0;t<o.length;t++)e=o[t],n[e]=r,"undefined"!=typeof console&&console&&console[e]&&(n[e]=i(console,e));return n}function i(e,t){function r(r,n){return"object"==typeof n&&(r+=" "+JSON.stringify(n)),e[t].call(e,r)}return r}function o(e){var t,r=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/;try{t=location.href}catch(n){t=document.createElement("a"),t.href="",t=t.href}var i=r.exec(t.toLowerCase())||[],o=r.exec(e.toLowerCase()),s=!(!o||o[1]==i[1]&&o[2]==i[2]&&(o[3]||("http:"===o[1]?80:443))==(i[3]||("http:"===i[1]?80:443)));return s}function s(e){var t,r,n,i,o,s,a,u,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=0,f=0,p="",h=[];if(!e)return e;do t=e.charCodeAt(l++),r=e.charCodeAt(l++),n=e.charCodeAt(l++),u=t<<16|r<<8|n,i=u>>18&63,o=u>>12&63,s=u>>6&63,a=63&u,h[f++]=c.charAt(i)+c.charAt(o)+c.charAt(s)+c.charAt(a);while(l<e.length);switch(p=h.join(""),e.length%3){case 1:p=p.slice(0,-2)+"==";break;case 2:p=p.slice(0,-1)+"="}return p}var a=XMLHttpRequest;if(!a)throw new Error("missing XMLHttpRequest");e.log={trace:r,debug:r,info:r,warn:r,error:r};var u=18e4,c=0;e.withCredentials=!1,e.DEFAULT_TIMEOUT=u,e.defaults=function(t,r){var n=function(e){var r=function(r,n){r="string"==typeof r?{uri:r}:JSON.parse(JSON.stringify(r));for(var i in t)void 0===r[i]&&(r[i]=t[i]);return e(r,n)};return r},i=n(e);return i.get=n(e.get),i.post=n(e.post),i.put=n(e.put),i.head=n(e.head),i};var l=["get","put","post","head"];return l.forEach(function(t){var r=t.toUpperCase(),n=t.toLowerCase();e[n]=function(t){"string"==typeof t?t={method:r,uri:t}:(t=JSON.parse(JSON.stringify(t)),t.method=r);var n=[t].concat(Array.prototype.slice.apply(arguments,[1]));return e.apply(this,n)}}),e.couch=function(t,n){function i(e,t,r){if(e)return n(e,t,r);if((t.statusCode<200||t.statusCode>299)&&r.error){e=new Error("CouchDB error: "+(r.error.reason||r.error.error));for(var i in r)e[i]=r[i];return n(e,t,r)}return n(e,t,r)}"string"==typeof t&&(t={uri:t}),t.json=!0,t.body&&(t.json=t.body),delete t.body,n=n||r;var o=e(t,i);return o},e})},{}],2:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],3:[function(e,t,r){function n(){l=!1,a.length?c=a.concat(c):f=-1,c.length&&i()}function i(){if(!l){var e=setTimeout(n);l=!0;for(var t=c.length;t;){for(a=c,c=[];++f<t;)a&&a[f].run();f=-1,t=c.length}a=null,l=!1,clearTimeout(e)}}function o(e,t){this.fun=e,this.array=t}function s(){}var a,u=t.exports={},c=[],l=!1,f=-1;u.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new o(e,t)),1!==c.length||l||setTimeout(i,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={},u.on=s,u.addListener=s,u.once=s,u.off=s,u.removeListener=s,u.removeAllListeners=s,u.emit=s,u.binding=function(e){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(e){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},{}],4:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],5:[function(e,t,r){(function(t,n){function i(e,t){var n={seen:[],stylize:s};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(t)?n.showHidden=t:t&&r._extend(n,t),O(n.showHidden)&&(n.showHidden=!1),O(n.depth)&&(n.depth=2),O(n.colors)&&(n.colors=!1),O(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=o),u(n,e,n.depth)}function o(e,t){var r=i.styles[t];return r?"["+i.colors[r][0]+"m"+e+"["+i.colors[r][1]+"m":e}function s(e,t){return e}function a(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function u(e,t,n){if(e.customInspect&&t&&E(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return v(i)||(i=u(e,i,n)),i}var o=c(e,t);if(o)return o;var s=Object.keys(t),y=a(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),_(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(t);if(0===s.length){if(E(t)){var g=t.name?": "+t.name:"";return e.stylize("[Function"+g+"]","special")}if(x(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if($(t))return e.stylize(Date.prototype.toString.call(t),"date");if(_(t))return l(t)}var b="",m=!1,w=["{","}"];if(d(t)&&(m=!0,w=["[","]"]),E(t)){var O=t.name?": "+t.name:"";b=" [Function"+O+"]"}if(x(t)&&(b=" "+RegExp.prototype.toString.call(t)),$(t)&&(b=" "+Date.prototype.toUTCString.call(t)),_(t)&&(b=" "+l(t)),0===s.length&&(!m||0==t.length))return w[0]+b+w[1];if(0>n)return x(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var j;return j=m?f(e,t,n,y,s):s.map(function(r){return p(e,t,n,y,r,m)}),e.seen.pop(),h(j,b,w)}function c(e,t){if(O(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return m(t)?e.stylize(""+t,"number"):y(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,r,n,i){for(var o=[],s=0,a=t.length;a>s;++s)A(t,String(s))?o.push(p(e,t,r,n,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(p(e,t,r,n,i,!0))}),o}function p(e,t,r,n,i,o){var s,a,c;if(c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},c.get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),A(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(c.value)<0?(a=g(r)?u(e,c.value,null):u(e,c.value,r-1),a.indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),O(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function h(e,t,r){var n=0,i=e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function d(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function g(e){return null===e}function b(e){return null==e}function m(e){return"number"==typeof e}function v(e){return"string"==typeof e}function w(e){return"symbol"==typeof e}function O(e){return void 0===e}function x(e){return j(e)&&"[object RegExp]"===k(e)}function j(e){return"object"==typeof e&&null!==e}function $(e){return j(e)&&"[object Date]"===k(e)}function _(e){return j(e)&&("[object Error]"===k(e)||e instanceof Error)}function E(e){return"function"==typeof e}function C(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function k(e){return Object.prototype.toString.call(e)}function R(e){return 10>e?"0"+e.toString(10):e.toString(10)}function T(){var e=new Date,t=[R(e.getHours()),R(e.getMinutes()),R(e.getSeconds())].join(":");return[e.getDate(),N[e.getMonth()],t].join(" ")}function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var S=/%[sdj%]/g;r.format=function(e){if(!v(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(i(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,o=n.length,s=String(e).replace(S,function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return e}}),a=n[r];o>r;a=n[++r])s+=g(a)||!j(a)?" "+a:" "+i(a);return s},r.deprecate=function(e,i){function o(){if(!s){if(t.throwDeprecation)throw new Error(i);t.traceDeprecation?console.trace(i):console.error(i),s=!0}return e.apply(this,arguments)}if(O(n.process))return function(){return r.deprecate(e,i).apply(this,arguments)};if(t.noDeprecation===!0)return e;var s=!1;return o};var z,P={};r.debuglog=function(e){if(O(z)&&(z=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!P[e])if(new RegExp("\\b"+e+"\\b","i").test(z)){var n=t.pid;P[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,n,t)}}else P[e]=function(){};return P[e]},r.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=d,r.isBoolean=y,r.isNull=g,r.isNullOrUndefined=b,r.isNumber=m,r.isString=v,r.isSymbol=w,r.isUndefined=O,r.isRegExp=x,r.isObject=j,r.isDate=$,r.isError=_,r.isFunction=E,r.isPrimitive=C,r.isBuffer=e("./support/isBuffer");var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];r.log=function(){console.log("%s - %s",T(),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!j(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":4,_process:3,inherits:2}],6:[function(e,t,r){t.exports=e("./lib/Inflector")},{"./lib/Inflector":8}],7:[function(e,t,r){(function(r){"use strict";function n(){this.plurals=[],this.singulars=[],this.uncountables=[],this.humans=[],this.acronyms={},this.acronymRegex=/(?=a)b/}var i=e("./hasProp"),o=e("./remove"),s=e("./icPart");n.getInstance=function(e){return r.__Inflector_Inflections=r.__Inflector_Inflections||{},r.__Inflector_Inflections[e]=r.__Inflector_Inflections[e]||new n,r.__Inflector_Inflections[e]},n.prototype.acronym=function(e){this.acronyms[e.toLowerCase()]=e;var t=[];for(var r in this.acronyms)i(this.acronyms,r)&&t.push(this.acronyms[r]);this.acronymRegex=new RegExp(t.join("|"))},n.prototype.plural=function(e,t){"string"==typeof e&&o(this.uncountables,e),o(this.uncountables,t),this.plurals.unshift([e,t])},n.prototype.singular=function(e,t){"string"==typeof e&&o(this.uncountables,e),o(this.uncountables,t),this.singulars.unshift([e,t])},n.prototype.irregular=function(e,t){o(this.uncountables,e),o(this.uncountables,t);var r=e[0],n=e.substr(1),i=t[0],a=t.substr(1);if(r.toUpperCase()===i.toUpperCase())this.plural(new RegExp("("+r+")"+n+"$","i"),"$1"+a),this.plural(new RegExp("("+i+")"+a+"$","i"),"$1"+a),this.singular(new RegExp("("+r+")"+n+"$","i"),"$1"+n),this.singular(new RegExp("("+i+")"+a+"$","i"),"$1"+n);else{var u=s(n),c=s(a);this.plural(new RegExp(r.toUpperCase()+u+"$"),i.toUpperCase()+a),this.plural(new RegExp(r.toLowerCase()+u+"$"),i.toLowerCase()+a),this.plural(new RegExp(i.toUpperCase()+c+"$"),i.toUpperCase()+a),this.plural(new RegExp(i.toLowerCase()+c+"$"),i.toLowerCase()+a),this.singular(new RegExp(r.toUpperCase()+u+"$"),r.toUpperCase()+n),this.singular(new RegExp(r.toLowerCase()+u+"$"),r.toLowerCase()+n),this.singular(new RegExp(i.toUpperCase()+c+"$"),r.toUpperCase()+n),this.singular(new RegExp(i.toLowerCase()+c+"$"),r.toLowerCase()+n)}},n.prototype.uncountable=function(){var e=Array.prototype.slice.call(arguments,0);this.uncountables=this.uncountables.concat(e)},n.prototype.human=function(e,t){this.humans.unshift([e,t])},n.prototype.clear=function(e){e=e||"all","all"===e?(this.plurals=[],this.singulars=[],this.uncountables=[],this.humans=[]):this[e]=[]},t.exports=n}).call(this,e("_process"))},{"./hasProp":12,"./icPart":13,"./remove":15,_process:3}],8:[function(e,t,r){"use strict";var n=e("./Inflections"),i=e("./Transliterator"),o=e("./Methods"),s=e("./defaults"),a=e("./isFunc"),u=o;u.inflections=function(e,t){return a(e)&&(t=e,e=null),e=e||"en",t?void t(n.getInstance(e)):n.getInstance(e)},u.transliterations=function(e,t){return a(e)&&(t=e,e=null),e=e||"en",t?void t(i.getInstance(e)):i.getInstance(e)};for(var c in s)u.inflections(c,s[c]);t.exports=u},{"./Inflections":7,"./Methods":9,"./Transliterator":10,"./defaults":11,"./isFunc":14}],9:[function(e,t,r){"use strict";var n={pluralize:function(e,t){return t=t||"en",this._applyInflections(e,this.inflections(t).plurals)},singularize:function(e,t){return t=t||"en",this._applyInflections(e,this.inflections(t).singulars)},camelize:function(e,t){(null===t||void 0===t)&&(t=!0);var r=""+e,n=this;return r=t?r.replace(/^[a-z\d]*/,function(e){return n.inflections().acronyms[e]||n.capitalize(e)}):r.replace(new RegExp("^(?:"+this.inflections().acronymRegex.source+"(?=\\b|[A-Z_])|\\w)"),function(e){return e.toLowerCase()}),r=r.replace(/(?:_|(\/))([a-z\d]*)/gi,function(e,t,r,i,o){return t||(t=""),""+t+(n.inflections().acronyms[r]||n.capitalize(r))})},underscore:function(e){var t=""+e;return t=t.replace(new RegExp("(?:([A-Za-z\\d])|^)("+this.inflections().acronymRegex.source+")(?=\\b|[^a-z])","g"),function(e,t,r){return""+(t||"")+(t?"_":"")+r.toLowerCase()}),t=t.replace(/([A-Z\d]+)([A-Z][a-z])/g,"$1_$2"),t=t.replace(/([a-z\d])([A-Z])/g,"$1_$2"),t=t.replace(/-/g,"_"),t.toLowerCase()},humanize:function(e,t){var r,n,i,o=""+e,s=this.inflections().humans,a=this;t=t||{},(null===t.capitalize||void 0===t.capitalize)&&(t.capitalize=!0);for(var u=0,c=s.length;c>u;u++)if(r=s[u],n=r[0],i=r[1],n.test&&n.test(o)||o.indexOf(n)>-1){o=o.replace(n,i);break}return o=o.replace(/_id$/,""),o=o.replace(/_/g," "),o=o.replace(/([a-z\d]*)/gi,function(e){return a.inflections().acronyms[e]||e.toLowerCase()}),t.capitalize&&(o=o.replace(/^\w/,function(e){return e.toUpperCase()})),o},capitalize:function(e){var t=null===e||void 0===e?"":String(e);return t.charAt(0).toUpperCase()+t.slice(1)},titleize:function(e){return this.humanize(this.underscore(e)).replace(/(^|[\s¿\/]+)([a-z])/g,function(e,t,r,n,i){return e.replace(r,r.toUpperCase())})},tableize:function(e){return this.pluralize(this.underscore(e))},classify:function(e){return this.camelize(this.singularize(e.replace(/.*\./g,"")))},dasherize:function(e){return e.replace(/_/g,"-")},foreignKey:function(e,t){return(null===t||void 0===t)&&(t=!0),this.underscore(e)+(t?"_id":"id")},ordinal:function(e){var t=Math.abs(Number(e)),r=t%100;if(11===r||12===r||13===r)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},ordinalize:function(e){return""+e+this.ordinal(e)},transliterate:function(e,t){t=t||{};var r=t.locale||"en",n=t.replacement||"?";return this.transliterations(r).transliterate(e,n)},parameterize:function(e,t){t=t||{},void 0===t.separator&&(t.separator="-"),null===t.separator&&(t.separator="");var r=this.transliterate(e,t);if(r=r.replace(/[^a-z0-9\-_]+/gi,t.separator),t.separator.length){var n=new RegExp(t.separator);r=r.replace(new RegExp(n.source+"{2,}"),t.separator),r=r.replace(new RegExp("^"+n.source+"|"+n.source+"$","i"),"")}return r.toLowerCase()},_applyInflections:function(e,t){var r,n,i,o=""+e;if(0===o.length)return o;var s=o.toLowerCase().match(/\b\w+$/);if(s&&this.inflections().uncountables.indexOf(s[0])>-1)return o;for(var a=0,u=t.length;u>a;a++)if(r=t[a],n=r[0],i=r[1],o.match(n)){o=o.replace(n,i);break}return o}};t.exports=n},{}],10:[function(e,t,r){(function(e){"use strict";function r(){this.approximations={};for(var e in n)this.approximate(e,n[e])}var n={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","×":"x","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"Th","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","ĝ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"'n","Ŋ":"NG","ŋ":"ng","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z"},i="?";r.getInstance=function(t){return e.__Inflector_Transliterator=e.__Inflector_Transliterator||{},e.__Inflector_Transliterator[t]=e.__Inflector_Transliterator[t]||new r,e.__Inflector_Transliterator[t]},r.prototype.approximate=function(e,t){this.approximations[e]=t},r.prototype.transliterate=function(e,t){var r=this;return e.replace(/[^\u0000-\u007f]/g,function(e){return r.approximations[e]||t||i})},t.exports=r}).call(this,e("_process"))},{_process:3}],11:[function(e,t,r){"use strict";function n(e){e.plural(/$/,"s"),e.plural(/s$/i,"s"),e.plural(/^(ax|test)is$/i,"$1es"),e.plural(/(octop|vir)us$/i,"$1i"),e.plural(/(octop|vir)i$/i,"$1i"),e.plural(/(alias|status)$/i,"$1es"),e.plural(/(bu)s$/i,"$1ses"),e.plural(/(buffal|tomat)o$/i,"$1oes"),e.plural(/([ti])um$/i,"$1a"),e.plural(/([ti])a$/i,"$1a"),e.plural(/sis$/i,"ses"),e.plural(/(?:([^f])fe|([lr])f)$/i,"$1$2ves"),e.plural(/(hive)$/i,"$1s"),e.plural(/([^aeiouy]|qu)y$/i,"$1ies"),e.plural(/(x|ch|ss|sh)$/i,"$1es"),e.plural(/(matr|vert|ind)(?:ix|ex)$/i,"$1ices"),e.plural(/^(m|l)ouse$/i,"$1ice"),e.plural(/^(m|l)ice$/i,"$1ice"),e.plural(/^(ox)$/i,"$1en"),e.plural(/^(oxen)$/i,"$1"),e.plural(/(quiz)$/i,"$1zes"),e.singular(/s$/i,""),e.singular(/(ss)$/i,"$1"),e.singular(/(n)ews$/i,"$1ews"),e.singular(/([ti])a$/i,"$1um"),e.singular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i,"$1sis"),e.singular(/(^analy)(sis|ses)$/i,"$1sis"),e.singular(/([^f])ves$/i,"$1fe"),e.singular(/(hive)s$/i,"$1"),e.singular(/(tive)s$/i,"$1"),e.singular(/([lr])ves$/i,"$1f"),e.singular(/([^aeiouy]|qu)ies$/i,"$1y"),e.singular(/(s)eries$/i,"$1eries"),e.singular(/(m)ovies$/i,"$1ovie"),e.singular(/(x|ch|ss|sh)es$/i,"$1"),e.singular(/^(m|l)ice$/i,"$1ouse"),e.singular(/(bus)(es)?$/i,"$1"),e.singular(/(o)es$/i,"$1"),e.singular(/(shoe)s$/i,"$1"),e.singular(/(cris|test)(is|es)$/i,"$1is"),e.singular(/^(a)x[ie]s$/i,"$1xis"),e.singular(/(octop|vir)(us|i)$/i,"$1us"),e.singular(/(alias|status)(es)?$/i,"$1"),e.singular(/^(ox)en/i,"$1"),e.singular(/(vert|ind)ices$/i,"$1ex"),e.singular(/(matr)ices$/i,"$1ix"),e.singular(/(quiz)zes$/i,"$1"),e.singular(/(database)s$/i,"$1"),e.irregular("person","people"),e.irregular("man","men"),e.irregular("child","children"),e.irregular("sex","sexes"),e.irregular("move","moves"),e.irregular("zombie","zombies"),e.uncountable("equipment","information","rice","money","species","series","fish","sheep","jeans","police")}t.exports={en:n}},{}],12:[function(e,t,r){"use strict";function n(e,t){return i.call(e,t)}var i=Object.prototype.hasOwnProperty;t.exports=n},{}],13:[function(e,t,r){"use strict";function n(e){return e.split("").map(function(e){return"(?:"+[e.toUpperCase(),e.toLowerCase()].join("|")+")"}).join("")}t.exports=n},{}],14:[function(e,t,r){"use strict";function n(e){return"[object Function]"===i.call(e)}var i=Object.prototype.toString;t.exports=n},{}],15:[function(e,t,r){"use strict";function n(e,t){for(var r=e.length-1;r>=0;r--)e[r]===t&&i.call(e,r,1)}var i=Array.prototype.splice;t.exports=n},{}],16:[function(e,t,r){var n=e("./stringify"),i=e("./parse");t.exports={stringify:n,parse:i}},{"./parse":17,"./stringify":18}],17:[function(e,t,r){var n=e("./utils"),i={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3,strictNullHandling:!1,plainObjects:!1,allowPrototypes:!1,allowDots:!1};i.parseValues=function(e,t){for(var r={},i=e.split(t.delimiter,t.parameterLimit===1/0?void 0:t.parameterLimit),o=0,s=i.length;s>o;++o){var a=i[o],u=-1===a.indexOf("]=")?a.indexOf("="):a.indexOf("]=")+1;if(-1===u)r[n.decode(a)]="",t.strictNullHandling&&(r[n.decode(a)]=null);else{var c=n.decode(a.slice(0,u)),l=n.decode(a.slice(u+1));Object.prototype.hasOwnProperty.call(r,c)?r[c]=[].concat(r[c]).concat(l):r[c]=l}}return r},i.parseObject=function(e,t,r){if(!e.length)return t;var n,o=e.shift();if("[]"===o)n=[],n=n.concat(i.parseObject(e,t,r));else{n=r.plainObjects?Object.create(null):{};var s="["===o[0]&&"]"===o[o.length-1]?o.slice(1,o.length-1):o,a=parseInt(s,10),u=""+a;!isNaN(a)&&o!==s&&u===s&&a>=0&&r.parseArrays&&a<=r.arrayLimit?(n=[],n[a]=i.parseObject(e,t,r)):n[s]=i.parseObject(e,t,r)}return n},i.parseKeys=function(e,t,r){if(e){r.allowDots&&(e=e.replace(/\.([^\.\[]+)/g,"[$1]"));var n=/^([^\[\]]*)/,o=/(\[[^\[\]]*\])/g,s=n.exec(e),a=[];if(s[1]){if(!r.plainObjects&&Object.prototype.hasOwnProperty(s[1])&&!r.allowPrototypes)return;a.push(s[1])}for(var u=0;null!==(s=o.exec(e))&&u<r.depth;)++u,(r.plainObjects||!Object.prototype.hasOwnProperty(s[1].replace(/\[|\]/g,""))||r.allowPrototypes)&&a.push(s[1]);return s&&a.push("["+e.slice(s.index)+"]"),i.parseObject(a,t,r)}},t.exports=function(e,t){if(t=t||{},t.delimiter="string"==typeof t.delimiter||n.isRegExp(t.delimiter)?t.delimiter:i.delimiter,t.depth="number"==typeof t.depth?t.depth:i.depth,t.arrayLimit="number"==typeof t.arrayLimit?t.arrayLimit:i.arrayLimit,t.parseArrays=t.parseArrays!==!1,t.allowDots="boolean"==typeof t.allowDots?t.allowDots:i.allowDots,t.plainObjects="boolean"==typeof t.plainObjects?t.plainObjects:i.plainObjects,t.allowPrototypes="boolean"==typeof t.allowPrototypes?t.allowPrototypes:i.allowPrototypes,t.parameterLimit="number"==typeof t.parameterLimit?t.parameterLimit:i.parameterLimit,t.strictNullHandling="boolean"==typeof t.strictNullHandling?t.strictNullHandling:i.strictNullHandling,""===e||null===e||"undefined"==typeof e)return t.plainObjects?Object.create(null):{};for(var r="string"==typeof e?i.parseValues(e,t):e,o=t.plainObjects?Object.create(null):{},s=Object.keys(r),a=0,u=s.length;u>a;++a){var c=s[a],l=i.parseKeys(c,r[c],t);o=n.merge(o,l,t)}return n.compact(o)}},{"./utils":19}],18:[function(e,t,r){var n=e("./utils"),i={delimiter:"&",arrayPrefixGenerators:{brackets:function(e,t){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e,t){return e}},strictNullHandling:!1,skipNulls:!1,encode:!0};i.stringify=function(e,t,r,o,s,a,u,c){if("function"==typeof u)e=u(t,e);else if(n.isBuffer(e))e=e.toString();else if(e instanceof Date)e=e.toISOString();else if(null===e){if(o)return a?n.encode(t):t;e=""}if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return a?[n.encode(t)+"="+n.encode(e)]:[t+"="+e];var l=[];if("undefined"==typeof e)return l;var f;if(Array.isArray(u))f=u;else{var p=Object.keys(e);f=c?p.sort(c):p}for(var h=0,d=f.length;d>h;++h){var y=f[h];s&&null===e[y]||(l=Array.isArray(e)?l.concat(i.stringify(e[y],r(t,y),r,o,s,a,u)):l.concat(i.stringify(e[y],t+"["+y+"]",r,o,s,a,u)))}return l},t.exports=function(e,t){t=t||{};var r,n,o="undefined"==typeof t.delimiter?i.delimiter:t.delimiter,s="boolean"==typeof t.strictNullHandling?t.strictNullHandling:i.strictNullHandling,a="boolean"==typeof t.skipNulls?t.skipNulls:i.skipNulls,u="boolean"==typeof t.encode?t.encode:i.encode,c="function"==typeof t.sort?t.sort:null;"function"==typeof t.filter?(n=t.filter,e=n("",e)):Array.isArray(t.filter)&&(r=n=t.filter);var l=[];if("object"!=typeof e||null===e)return"";var f;f=t.arrayFormat in i.arrayPrefixGenerators?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":"indices";var p=i.arrayPrefixGenerators[f];r||(r=Object.keys(e)),c&&r.sort(c);for(var h=0,d=r.length;d>h;++h){var y=r[h];a&&null===e[y]||(l=l.concat(i.stringify(e[y],y,p,s,a,u,n,c)))}return l.join(o)}},{"./utils":19}],19:[function(e,t,r){var n={};n.hexTable=new Array(256);for(var i=0;256>i;++i)n.hexTable[i]="%"+((16>i?"0":"")+i.toString(16)).toUpperCase();r.arrayToObject=function(e,t){for(var r=t.plainObjects?Object.create(null):{},n=0,i=e.length;i>n;++n)"undefined"!=typeof e[n]&&(r[n]=e[n]);return r},r.merge=function(e,t,n){if(!t)return e;if("object"!=typeof t)return Array.isArray(e)?e.push(t):"object"==typeof e?e[t]=!0:e=[e,t],e;if("object"!=typeof e)return e=[e].concat(t);Array.isArray(e)&&!Array.isArray(t)&&(e=r.arrayToObject(e,n));for(var i=Object.keys(t),o=0,s=i.length;s>o;++o){var a=i[o],u=t[a];Object.prototype.hasOwnProperty.call(e,a)?e[a]=r.merge(e[a],u,n):e[a]=u}return e},r.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},r.encode=function(e){if(0===e.length)return e;"string"!=typeof e&&(e=""+e);for(var t="",r=0,i=e.length;i>r;++r){var o=e.charCodeAt(r);45===o||46===o||95===o||126===o||o>=48&&57>=o||o>=65&&90>=o||o>=97&&122>=o?t+=e[r]:128>o?t+=n.hexTable[o]:2048>o?t+=n.hexTable[192|o>>6]+n.hexTable[128|63&o]:55296>o||o>=57344?t+=n.hexTable[224|o>>12]+n.hexTable[128|o>>6&63]+n.hexTable[128|63&o]:(++r,o=65536+((1023&o)<<10|1023&e.charCodeAt(r)),t+=n.hexTable[240|o>>18]+n.hexTable[128|o>>12&63]+n.hexTable[128|o>>6&63]+n.hexTable[128|63&o])}return t},r.compact=function(e,t){if("object"!=typeof e||null===e)return e;t=t||[];var n=t.indexOf(e);if(-1!==n)return t[n];if(t.push(e),Array.isArray(e)){for(var i=[],o=0,s=e.length;s>o;++o)"undefined"!=typeof e[o]&&i.push(e[o]);return i}var a=Object.keys(e);for(o=0,s=a.length;s>o;++o){var u=a[o];e[u]=r.compact(e[u],t)}return e},r.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},r.isBuffer=function(e){return null===e||"undefined"==typeof e?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},{}],20:[function(e,t,r){"use strict";"undefined"==typeof Promise?t.exports=e("promise-polyfill"):t.exports=Promise},{"promise-polyfill":21}],21:[function(e,t,r){!function(e){function r(e,t){return function(){e.apply(t,arguments)}}function n(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],c(e,r(o,this),r(s,this))}function i(e){var t=this;return null===this._state?void this._deferreds.push(e):void l(function(){var r=t._state?e.onFulfilled:e.onRejected;if(null===r)return void(t._state?e.resolve:e.reject)(t._value);var n;try{n=r(t._value)}catch(i){return void e.reject(i)}e.resolve(n)})}function o(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void c(r(t,e),r(o,this),r(s,this))}this._state=!0,this._value=e,a.call(this)}catch(n){s.call(this,n)}}function s(e){this._state=!1,this._value=e,a.call(this)}function a(){for(var e=0,t=this._deferreds.length;t>e;e++)i.call(this,this._deferreds[e]);
this._deferreds=null}function u(e,t,r,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=r,this.reject=n}function c(e,t,r){var n=!1;try{e(function(e){n||(n=!0,t(e))},function(e){n||(n=!0,r(e))})}catch(i){if(n)return;n=!0,r(i)}}var l=n.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)},f=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};n.prototype["catch"]=function(e){return this.then(null,e)},n.prototype.then=function(e,t){var r=this;return new n(function(n,o){i.call(r,new u(e,t,n,o))})},n.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&f(arguments[0])?arguments[0]:arguments);return new n(function(t,r){function n(o,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,function(e){n(o,e)},r)}e[o]=s,0===--i&&t(e)}catch(u){r(u)}}if(0===e.length)return t([]);for(var i=e.length,o=0;o<e.length;o++)n(o,e[o])})},n.resolve=function(e){return e&&"object"==typeof e&&e.constructor===n?e:new n(function(t){t(e)})},n.reject=function(e){return new n(function(t,r){r(e)})},n.race=function(e){return new n(function(t,r){for(var n=0,i=e.length;i>n;n++)e[n].then(t,r)})},"undefined"!=typeof t&&t.exports?t.exports=n:e.Promise||(e.Promise=n)}(this)},{}],22:[function(e,t,r){"use strict";var n=(e("./vericred/api_resource"),e("./vericred/resources")),i=e("./vericred/config");i.requestLib=e("browser-request"),window.Vericred={config:i,County:n.County,Plan:n.Plan,Provider:n.Provider,State:n.State,ZipCode:n.ZipCode,ZipCounty:n.ZipCounty}},{"./vericred/api_resource":23,"./vericred/config":24,"./vericred/resources":29,"browser-request":1}],23:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./relationships/has_many"),s=e("./relationships/belongs_to"),a=e("./connection"),u=e("inflected"),c=function(){function e(t){n(this,e),this.data=t||{},this.defineMethods()}return i(e,null,[{key:"belongsTo",value:function(e,t){this.relationships.belongsTo.push(new s(e,this,t))}},{key:"hasMany",value:function(e,t){this.relationships.hasMany.push(new o(e,this,t))}},{key:"connection",get:function(){return this._connection=this._connection||new a},set:function(e){return this._connection=e}},{key:"relationships",get:function(){return this._relationships=this._relationships||{hasMany:[],belongsTo:[]},this._relationships}}]),i(e,[{key:"defineMethods",value:function(){for(var e in this.data){var t=u.camelize(e,!1);"undefined"==typeof this[t]&&this.defineMethod(t,e)}}},{key:"defineMethod",value:function(e,t){Object.defineProperty(this.constructor.prototype,e,{set:function(e){this.data[t]=e},get:function(){return this.data[t]}})}}],[{key:"buildUri",value:function(e){return"/"+this.path+"/"+(e||"")}},{key:"find",value:function(t){var r=this;return e.connection.get(this.buildUri(t)).then(function(e){return new r(e[r.key])})}},{key:"sideloadData",value:function(e,t){for(var r in this.relationships)this.relationships[r].forEach(function(r){r.sideloadData(e,t)})}},{key:"search",value:function(t){var r=this;return t=t||{},e.connection.get(this.buildUri(),t).then(function(e){return e[u.pluralize(r.key)].map(function(t){return r.sideloadData(t,e),new r(t)})})}},{key:"foreignKey",get:function(){return this.key+"_id"}},{key:"key",get:function(){return u.underscore(this.className)}},{key:"path",get:function(){return u.pluralize(u.underscore(this.className))}}]),e}();t.exports=c},{"./connection":25,"./relationships/belongs_to":27,"./relationships/has_many":28,inflected:6}],24:[function(e,t,r){"use strict";t.exports={apiKey:null,baseUrl:"https://api.vericred.com",requestLib:null}},{}],25:[function(e,t,r){"use strict";var n=e("require-promise"),i=e("qs"),o=(e("util"),e("../vericred/config")),s=function(e){this.request=e||Vericred.config.requestLib};s.prototype={buildQueryString:function(e){return i.stringify(e)},buildUrl:function(e,t){return o.baseUrl+e+"?"+this.buildQueryString(t||{})},defaultHeaders:function(){return{"Vericred-Api-Key":o.apiKey}},get:function(e,t){return this.makeRequest({uri:this.buildUrl(e,t),headers:this.defaultHeaders()})},makeRequest:function(e){var t=this;return new n(function(r,n){t.request(e,function(e,t,i){e?n(e):t.statusCode>=200&&t.statusCode<300?r(JSON.parse(i)):n(JSON.parse(i))})})}},t.exports=s},{"../vericred/config":24,qs:16,"require-promise":20,util:5}],26:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function e(t,r,i){n(this,e),this.klass=t,this.owner=r,this.opts=i||{}}return i(e,[{key:"populateRecord",value:function(e,t){e[this.recordKey]=this.buildRelatedData(t)}},{key:"relatedRecords",value:function(e,t){var r=t[this.relatedRecordKey],n=e[this.foreignKey];return r&&n?r.filter(this.filterFn.bind(this,n)):void 0}},{key:"sideloadData",value:function(e,t){var r=this.relatedRecords(e,t);r&&this.populateRecord(e,r)}},{key:"relatedRecordKey",get:function(){return this.klass.path}}]),e}();t.exports=o},{}],27:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=(e("inflected"),e("./base")),u=function(e){function t(){return n(this,t),i(this,Object.getPrototypeOf(t).apply(this,arguments))}return o(t,e),s(t,[{key:"buildRelatedData",value:function(e){return new this.klass(e[0])}},{key:"filterFn",value:function(e,t){return e==t.id}},{key:"recordKey",get:function(){return this.klass.key}},{key:"foreignKey",get:function(){return this.klass.foreignKey}}]),t}(a);t.exports=u},{"./base":26,inflected:6}],28:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("inflected"),u=e("./base"),c=function(e){function t(){return n(this,t),i(this,Object.getPrototypeOf(t).apply(this,arguments))}return o(t,e),s(t,[{key:"buildRelatedData",value:function(e){var t=this;return e.map(function(e){return new t.klass(e)})}},{key:"filterFn",value:function(e,t){return e.indexOf(t.id)>-1}},{key:"recordKey",get:function(){return a.pluralize(this.klass.key)}},{key:"foreignKey",get:function(){return this.klass.foreignKey+"s"}}]),t}(u);t.exports=c},{"./base":26,inflected:6}],29:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./api_resource"),u=function(e){function t(){return n(this,t),i(this,Object.getPrototypeOf(t).apply(this,arguments))}return o(t,e),s(t,null,[{key:"className",get:function(){return"County"}}]),t}(a),c=function(e){function t(){return n(this,t),i(this,Object.getPrototypeOf(t).apply(this,arguments))}return o(t,e),s(t,null,[{key:"className",get:function(){return"Plan"}}]),t}(a),l=function(e){function t(){return n(this,t),i(this,Object.getPrototypeOf(t).apply(this,arguments))}return o(t,e),s(t,null,[{key:"className",get:function(){return"Provider"}}]),t}(a),f=function(e){function t(){return n(this,t),i(this,Object.getPrototypeOf(t).apply(this,arguments))}return o(t,e),s(t,null,[{key:"className",get:function(){return"State"}}]),t}(a),p=function(e){function t(){return n(this,t),i(this,Object.getPrototypeOf(t).apply(this,arguments))}return o(t,e),s(t,null,[{key:"className",get:function(){return"ZipCode"}}]),t}(a),h=function(e){function t(){return n(this,t),i(this,Object.getPrototypeOf(t).apply(this,arguments))}return o(t,e),s(t,null,[{key:"className",get:function(){return"ZipCounty"}}]),t}(a);l.belongsTo(f),h.belongsTo(u),h.belongsTo(p),t.exports={County:u,Plan:c,Provider:l,State:f,ZipCode:p,ZipCounty:h}},{"./api_resource":23}]},{},[22]);