@justifi/webcomponents 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/cjs/{index-3947d225.js → index-ca2cd154.js} +391 -96
  3. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +1 -1
  4. package/dist/cjs/justifi-billing-form.cjs.entry.js +1 -1
  5. package/dist/cjs/justifi-card-form.cjs.entry.js +1 -1
  6. package/dist/cjs/justifi-payment-form.cjs.entry.js +17 -0
  7. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +84 -2
  8. package/dist/cjs/justifi-payments-list.cjs.entry.js +1 -1
  9. package/dist/cjs/loader.cjs.js +3 -4
  10. package/dist/cjs/select-input_2.cjs.entry.js +1 -1
  11. package/dist/cjs/webcomponents.cjs.js +3 -7
  12. package/dist/collection/collection-manifest.json +3 -2
  13. package/dist/collection/components/card-form/card-form.stories.js +132 -0
  14. package/dist/collection/components/payment-form/payment-form.js +31 -0
  15. package/dist/collection/components/payment-method-form/payment-method-form.js +3 -1
  16. package/dist/components/index.d.ts +1 -9
  17. package/dist/components/index.js +2 -1
  18. package/dist/components/justifi-payment-form.d.ts +11 -0
  19. package/dist/components/justifi-payment-form.js +32 -0
  20. package/dist/components/payment-method-form.js +83 -1
  21. package/dist/esm/{index-0bcf33c4.js → index-05706eb5.js} +392 -96
  22. package/dist/esm/justifi-bank-account-form.entry.js +1 -1
  23. package/dist/esm/justifi-billing-form.entry.js +1 -1
  24. package/dist/esm/justifi-card-form.entry.js +1 -1
  25. package/dist/esm/justifi-payment-form.entry.js +13 -0
  26. package/dist/esm/justifi-payment-method-form.entry.js +84 -2
  27. package/dist/esm/justifi-payments-list.entry.js +1 -1
  28. package/dist/esm/loader.js +3 -4
  29. package/dist/esm/polyfills/css-shim.js +1 -1
  30. package/dist/esm/select-input_2.entry.js +1 -1
  31. package/dist/esm/webcomponents.js +3 -4
  32. package/dist/types/api/Api.d.ts +1 -1
  33. package/dist/types/api/Payment.d.ts +1 -1
  34. package/dist/types/components/card-form/card-form.stories.d.ts +14 -0
  35. package/dist/types/components/payment-form/payment-form.d.ts +4 -0
  36. package/dist/types/components.d.ts +15 -0
  37. package/dist/types/stencil-public-runtime.d.ts +3 -59
  38. package/dist/webcomponents/{p-0cddfd4f.entry.js → p-3809130a.entry.js} +1 -1
  39. package/dist/webcomponents/{p-17badb93.entry.js → p-67be9585.entry.js} +1 -1
  40. package/dist/webcomponents/{p-d3dc4e0a.entry.js → p-787671b9.entry.js} +1 -1
  41. package/dist/webcomponents/{p-864e32fd.entry.js → p-87654bf4.entry.js} +1 -1
  42. package/dist/webcomponents/p-8ee06fd1.js +2 -0
  43. package/dist/webcomponents/p-94ef2d0e.entry.js +1 -0
  44. package/dist/webcomponents/p-c07191dc.entry.js +1 -0
  45. package/dist/webcomponents/{p-7fd07095.entry.js → p-e5b0f047.entry.js} +1 -1
  46. package/dist/webcomponents/webcomponents.esm.js +1 -1
  47. package/loader/index.d.ts +0 -9
  48. package/package.json +16 -3
  49. package/dist/webcomponents/p-cecf0fe8.entry.js +0 -1
  50. package/dist/webcomponents/p-e82c9746.js +0 -2
@@ -1 +1 @@
1
- import{r as t,h as e,H as r}from"./p-e82c9746.js";function n(t){this._maxSize=t,this.clear()}n.prototype.clear=function(){this._size=0,this._values=Object.create(null)},n.prototype.get=function(t){return this._values[t]},n.prototype.set=function(t,e){return this._size>=this._maxSize&&this.clear(),t in this._values||this._size++,this._values[t]=e};var a=/[^.^\]^[]+|(?=\[\]|\.\.)/g,s=/^\d+$/,i=/^\d/,u=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,l=/^\s*(['"]?)(.*?)(\1)\s*$/,o=new n(512),h=new n(512),f=new n(512),c={Cache:n,split:p,normalizePath:d,setter:function(t){var e=d(t);return h.get(t)||h.set(t,(function(t,r){for(var n=0,a=e.length,s=t;n<a-1;){var i=e[n];if("__proto__"===i||"constructor"===i||"prototype"===i)return t;s=s[e[n++]]}s[e[n]]=r}))},getter:function(t,e){var r=d(t);return f.get(t)||f.set(t,(function(t){for(var n=0,a=r.length;n<a;){if(null==t&&e)return;t=t[r[n++]]}return t}))},join:function(t){return t.reduce((function(t,e){return t+(b(e)||s.test(e)?"["+e+"]":(t?".":"")+e)}),"")},forEach:function(t,e,r){!function(t,e,r){var n,a,s,i,u=t.length;for(a=0;a<u;a++)(n=t[a])&&(v(n)&&(n='"'+n+'"'),s=!(i=b(n))&&/^\d+$/.test(n),e.call(r,n,i,s,a,t))}(Array.isArray(t)?t:p(t),e,r)}};function d(t){return o.get(t)||o.set(t,p(t).map((function(t){return t.replace(l,"$2")})))}function p(t){return t.match(a)||[""]}function b(t){return"string"==typeof t&&t&&-1!==["'",'"'].indexOf(t.charAt(0))}function v(t){return!b(t)&&(function(t){return t.match(i)&&!t.match(s)}(t)||function(t){return u.test(t)}(t))}const m=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,x=t=>t.match(m)||[];var F=t=>x(t).reduce(((t,e)=>`${t}${t?e[0].toUpperCase()+e.slice(1).toLowerCase():e.toLowerCase()}`),""),y=t=>((t,e)=>x(t).join(e).toLowerCase())(t,"_"),g=function(t){return $(function(t){for(var e=new Set,r=0,n=t.length;r<n;r++){var a=t[r];e.add(a[0]),e.add(a[1])}return Array.from(e)}(t),t)};function $(t,e){var r=t.length,n=new Array(r),a={},s=r,i=function(t){for(var e=new Map,r=0,n=t.length;r<n;r++){var a=t[r];e.has(a[0])||e.set(a[0],new Set),e.has(a[1])||e.set(a[1],new Set),e.get(a[0]).add(a[1])}return e}(e),u=function(t){for(var e=new Map,r=0,n=t.length;r<n;r++)e.set(t[r],r);return e}(t);for(e.forEach((function(t){if(!u.has(t[0])||!u.has(t[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")}));s--;)a[s]||l(t[s],s,new Set);return n;function l(t,e,s){if(s.has(t)){var o;try{o=", node was:"+JSON.stringify(t)}catch(t){o=""}throw new Error("Cyclic dependency"+o)}if(!u.has(t))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(t));if(!a[e]){a[e]=!0;var h=i.get(t)||new Set;if(e=(h=Array.from(h)).length){s.add(t);do{var f=h[--e];l(f,u.get(f),s)}while(e);s.delete(t)}n[--r]=t}}}g.array=$;const w=Object.prototype.toString,O=Error.prototype.toString,A=RegExp.prototype.toString,E="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",D=/^Symbol\((.*)\)(.*)$/;function j(t,e=!1){if(null==t||!0===t||!1===t)return""+t;const r=typeof t;if("number"===r)return function(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}(t);if("string"===r)return e?`"${t}"`:t;if("function"===r)return"[Function "+(t.name||"anonymous")+"]";if("symbol"===r)return E.call(t).replace(D,"Symbol($1)");const n=w.call(t).slice(8,-1);return"Date"===n?isNaN(t.getTime())?""+t:t.toISOString(t):"Error"===n||t instanceof Error?"["+O.call(t)+"]":"RegExp"===n?A.call(t):null}function _(t,e){let r=j(t,e);return null!==r?r:JSON.stringify(t,(function(t,r){let n=j(this[t],e);return null!==n?n:r}),2)}function S(t){return null==t?[]:[].concat(t)}let k=/\$\{\s*(\w+)\s*\}/g;class V extends Error{static formatError(t,e){const r=e.label||e.path||"this";return r!==e.path&&(e=Object.assign({},e,{path:r})),"string"==typeof t?t.replace(k,((t,r)=>_(e[r]))):"function"==typeof t?t(e):t}static isError(t){return t&&"ValidationError"===t.name}constructor(t,e,r,n){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this.name="ValidationError",this.value=e,this.path=r,this.type=n,this.errors=[],this.inner=[],S(t).forEach((t=>{V.isError(t)?(this.errors.push(...t.errors),this.inner=this.inner.concat(t.inner.length?t.inner:t)):this.errors.push(t)})),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,V)}}let M={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:t,type:e,value:r,originalValue:n})=>{const a=null!=n&&n!==r?` (cast from the value \`${_(n,!0)}\`).`:".";return"mixed"!==e?`${t} must be a \`${e}\` type, but the final value was: \`${_(r,!0)}\``+a:`${t} must match the configured type. The validated value was: \`${_(r,!0)}\``+a}},C={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},N={noUnknown:"${path} field has unspecified keys: ${unknown}"};Object.assign(Object.create(null),{mixed:M,string:C,number:{min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},date:{min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},object:N,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:{isValue:"${path} field must be ${value}"}});const T=t=>t&&t.__isYupSchema__;class z{static fromOptions(t,e){if(!e.then&&!e.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:n,otherwise:a}=e,s="function"==typeof r?r:(...t)=>t.every((t=>t===r));return new z(t,((t,e)=>{var r;let i=s(...t)?n:a;return null!=(r=null==i?void 0:i(e))?r:e}))}constructor(t,e){this.fn=void 0,this.refs=t,this.refs=t,this.fn=e}resolve(t,e){let r=this.refs.map((t=>t.getValue(null==e?void 0:e.value,null==e?void 0:e.parent,null==e?void 0:e.context))),n=this.fn(r,t,e);if(void 0===n||n===t)return t;if(!T(n))throw new TypeError("conditions must return a schema object");return n.resolve(e)}}class I{constructor(t,e={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof t)throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),""===t)throw new TypeError("ref must be a non-empty string");this.isContext="$"===this.key[0],this.isValue="."===this.key[0],this.isSibling=!this.isContext&&!this.isValue,this.path=this.key.slice((this.isContext?"$":this.isValue?".":"").length),this.getter=this.path&&c.getter(this.path,!0),this.map=e.map}getValue(t,e,r){let n=this.isContext?r:this.isValue?t:e;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(t,e){return this.getValue(t,null==e?void 0:e.parent,null==e?void 0:e.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}I.prototype.__isYupRef=!0;const P=t=>null==t;function Z(t){function e({value:e,path:r="",options:n,originalValue:a,schema:s},i,u){const{name:l,test:o,params:h,message:f,skipAbsent:c}=t;let{parent:d,context:p,abortEarly:b=s.spec.abortEarly}=n;function v(t){return I.isRef(t)?t.getValue(e,d,p):t}function m(t={}){const n=Object.assign({value:e,originalValue:a,label:s.spec.label,path:t.path||r,spec:s.spec},h,t.params);for(const t of Object.keys(n))n[t]=v(n[t]);const i=new V(V.formatError(t.message||f,n),e,n.path,t.type||l);return i.params=n,i}const x=b?i:u;let F={path:r,parent:d,type:l,from:n.from,createError:m,resolve:v,options:n,originalValue:a,schema:s};const y=t=>{V.isError(t)?x(t):t?u(null):x(m())},g=t=>{V.isError(t)?x(t):i(t)},$=c&&P(e);if(!n.sync){try{Promise.resolve(!!$||o.call(F,e,F)).then(y,g)}catch(t){g(t)}return}let w;try{var O;if(w=!!$||o.call(F,e,F),"function"==typeof(null==(O=w)?void 0:O.then))throw new Error(`Validation test of type: "${F.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(t){return void g(t)}y(w)}return e.OPTIONS=t,e}function R(t,e,r,n=r){let a,s,i;return e?(c.forEach(e,((u,l,o)=>{let h=l?u.slice(1,u.length-1):u,f="tuple"===(t=t.resolve({context:n,parent:a,value:r})).type,c=o?parseInt(h,10):0;if(t.innerType||f){if(f&&!o)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${i}" must contain an index to the tuple element, e.g. "${i}[0]"`);if(r&&c>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${u}, in the path: ${e}. because there is no value at that index. `);a=r,r=r&&r[c],t=f?t.spec.types[c]:t.innerType}if(!o){if(!t.fields||!t.fields[h])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${i} which is a type: "${t.type}")`);a=r,r=r&&r[h],t=t.fields[h]}s=h,i=l?"["+u+"]":"."+u})),{schema:t,parent:a,parentPath:s}):{parent:a,parentPath:e,schema:t}}class q extends Set{describe(){const t=[];for(const e of this.values())t.push(I.isRef(e)?e.describe():e);return t}resolveAll(t){let e=[];for(const r of this.values())e.push(t(r));return e}clone(){return new q(this.values())}merge(t,e){const r=this.clone();return t.forEach((t=>r.add(t))),e.forEach((t=>r.delete(t))),r}}function U(t,e=new Map){if(T(t)||!t||"object"!=typeof t)return t;if(e.has(t))return e.get(t);let r;if(t instanceof Date)r=new Date(t.getTime()),e.set(t,r);else if(t instanceof RegExp)r=new RegExp(t),e.set(t,r);else if(Array.isArray(t)){r=new Array(t.length),e.set(t,r);for(let n=0;n<t.length;n++)r[n]=U(t[n],e)}else if(t instanceof Map){r=new Map,e.set(t,r);for(const[n,a]of t.entries())r.set(n,U(a,e))}else if(t instanceof Set){r=new Set,e.set(t,r);for(const n of t)r.add(U(n,e))}else{if(!(t instanceof Object))throw Error(`Unable to clone ${t}`);r={},e.set(t,r);for(const[n,a]of Object.entries(t))r[n]=U(a,e)}return r}class L{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new q,this._blacklist=new q,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation((()=>{this.typeError(M.notType)})),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,optional:!0,coerce:!0},null==t?void 0:t.spec),this.withMutation((t=>{t.nonNullable()}))}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const e=Object.create(Object.getPrototypeOf(this));return e.type=this.type,e._typeCheck=this._typeCheck,e._whitelist=this._whitelist.clone(),e._blacklist=this._blacklist.clone(),e.internalTests=Object.assign({},this.internalTests),e.exclusiveTests=Object.assign({},this.exclusiveTests),e.deps=[...this.deps],e.conditions=[...this.conditions],e.tests=[...this.tests],e.transforms=[...this.transforms],e.spec=U(Object.assign({},this.spec,t)),e}label(t){let e=this.clone();return e.spec.label=t,e}meta(...t){if(0===t.length)return this.spec.meta;let e=this.clone();return e.spec.meta=Object.assign(e.spec.meta||{},t[0]),e}withMutation(t){let e=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=e,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let e=this,r=t.clone();const n=Object.assign({},e.spec,r.spec);return r.spec=n,r.internalTests=Object.assign({},e.internalTests,r.internalTests),r._whitelist=e._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=e._blacklist.merge(t._blacklist,t._whitelist),r.tests=e.tests,r.exclusiveTests=e.exclusiveTests,r.withMutation((e=>{t.tests.forEach((t=>{e.test(t.OPTIONS)}))})),r.transforms=[...e.transforms,...r.transforms],r}isType(t){return null==t?!(!this.spec.nullable||null!==t)||!(!this.spec.optional||void 0!==t):this._typeCheck(t)}resolve(t){let e=this;if(e.conditions.length){let r=e.conditions;e=e.clone(),e.conditions=[],e=r.reduce(((e,r)=>r.resolve(e,t)),e),e=e.resolve(t)}return e}resolveOptions(t){var e,r,n;return Object.assign({},t,{from:t.from||[],strict:null!=(e=t.strict)?e:this.spec.strict,abortEarly:null!=(r=t.abortEarly)?r:this.spec.abortEarly,recursive:null!=(n=t.recursive)?n:this.spec.recursive})}cast(t,e={}){let r=this.resolve(Object.assign({value:t},e)),n="ignore-optionality"===e.assert,a=r._cast(t,e);if(!1!==e.assert&&!r.isType(a)){if(n&&P(a))return a;let s=_(t),i=_(a);throw new TypeError(`The value of ${e.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}". \n\nattempted value: ${s} \n`+(i!==s?`result of cast: ${i}`:""))}return a}_cast(t,e){let r=void 0===t?t:this.transforms.reduce(((e,r)=>r.call(this,e,t,this)),t);return void 0===r&&(r=this.getDefault()),r}_validate(t,e={},r,n){let{path:a,originalValue:s=t,strict:i=this.spec.strict}=e,u=t;i||(u=this._cast(u,Object.assign({assert:!1},e)));let l=[];for(let t of Object.values(this.internalTests))t&&l.push(t);this.runTests({path:a,value:u,originalValue:s,options:e,tests:l},r,(t=>{if(t.length)return n(t,u);this.runTests({path:a,value:u,originalValue:s,options:e,tests:this.tests},r,n)}))}runTests(t,e,r){let n=!1,{tests:a,value:s,originalValue:i,path:u,options:l}=t,o=t=>{n||(n=!0,e(t,s))},h=t=>{n||(n=!0,r(t,s))},f=a.length,c=[];if(!f)return h([]);let d={value:s,originalValue:i,path:u,options:l,schema:this};for(let t=0;t<a.length;t++)(0,a[t])(d,o,(function(t){t&&(c=c.concat(t)),--f<=0&&h(c)}))}asNestedTest({key:t,index:e,parent:r,parentPath:n,originalParent:a,options:s}){const i=null!=t?t:e;if(null==i)throw TypeError("Must include `key` or `index` for nested validations");const u="number"==typeof i;let l=r[i];const o=Object.assign({},s,{strict:!0,parent:r,value:l,originalValue:a[i],key:void 0,[u?"index":"key"]:i,path:u||i.includes(".")?`${n||""}[${l?i:`"${i}"`}]`:(n?`${n}.`:"")+t});return(t,e,r)=>this.resolve(o)._validate(l,o,e,r)}validate(t,e){let r=this.resolve(Object.assign({},e,{value:t}));return new Promise(((n,a)=>r._validate(t,e,((t,e)=>{V.isError(t)&&(t.value=e),a(t)}),((t,e)=>{t.length?a(new V(t,e)):n(e)}))))}validateSync(t,e){let r;return this.resolve(Object.assign({},e,{value:t}))._validate(t,Object.assign({},e,{sync:!0}),((t,e)=>{throw V.isError(t)&&(t.value=e),t}),((e,n)=>{if(e.length)throw new V(e,t);r=n})),r}isValid(t,e){return this.validate(t,e).then((()=>!0),(t=>{if(V.isError(t))return!1;throw t}))}isValidSync(t,e){try{return this.validateSync(t,e),!0}catch(t){if(V.isError(t))return!1;throw t}}_getDefault(){let t=this.spec.default;return null==t?t:"function"==typeof t?t.call(this):U(t)}getDefault(t){return this.resolve(t||{})._getDefault()}default(t){return 0===arguments.length?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,e){const r=this.clone({nullable:t});return r.internalTests.nullable=Z({message:e,name:"nullable",test(t){return null!==t||this.schema.spec.nullable}}),r}optionality(t,e){const r=this.clone({optional:t});return r.internalTests.optionality=Z({message:e,name:"optionality",test(t){return void 0!==t||this.schema.spec.optional}}),r}optional(){return this.optionality(!0)}defined(t=M.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=M.notNull){return this.nullability(!1,t)}required(t=M.required){return this.clone().withMutation((e=>e.nonNullable(t).defined(t)))}notRequired(){return this.clone().withMutation((t=>t.nullable().optional()))}transform(t){let e=this.clone();return e.transforms.push(t),e}test(...t){let e;if(e=1===t.length?"function"==typeof t[0]?{test:t[0]}:t[0]:2===t.length?{name:t[0],test:t[1]}:{name:t[0],message:t[1],test:t[2]},void 0===e.message&&(e.message=M.default),"function"!=typeof e.test)throw new TypeError("`test` is a required parameters");let r=this.clone(),n=Z(e),a=e.exclusive||e.name&&!0===r.exclusiveTests[e.name];if(e.exclusive&&!e.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return e.name&&(r.exclusiveTests[e.name]=!!e.exclusive),r.tests=r.tests.filter((t=>{if(t.OPTIONS.name===e.name){if(a)return!1;if(t.OPTIONS.test===n.OPTIONS.test)return!1}return!0})),r.tests.push(n),r}when(t,e){Array.isArray(t)||"string"==typeof t||(e=t,t=".");let r=this.clone(),n=S(t).map((t=>new I(t)));return n.forEach((t=>{t.isSibling&&r.deps.push(t.key)})),r.conditions.push("function"==typeof e?new z(n,e):z.fromOptions(n,e)),r}typeError(t){let e=this.clone();return e.internalTests.typeError=Z({message:t,name:"typeError",test(t){return!(!P(t)&&!this.schema._typeCheck(t))||this.createError({params:{type:this.schema.type}})}}),e}oneOf(t,e=M.oneOf){let r=this.clone();return t.forEach((t=>{r._whitelist.add(t),r._blacklist.delete(t)})),r.internalTests.whiteList=Z({message:e,name:"oneOf",skipAbsent:!0,test(t){let e=this.schema._whitelist,r=e.resolveAll(this.resolve);return!!r.includes(t)||this.createError({params:{values:Array.from(e).join(", "),resolved:r}})}}),r}notOneOf(t,e=M.notOneOf){let r=this.clone();return t.forEach((t=>{r._blacklist.add(t),r._whitelist.delete(t)})),r.internalTests.blacklist=Z({message:e,name:"notOneOf",test(t){let e=this.schema._blacklist,r=e.resolveAll(this.resolve);return!r.includes(t)||this.createError({params:{values:Array.from(e).join(", "),resolved:r}})}}),r}strip(t=!0){let e=this.clone();return e.spec.strip=t,e}describe(t){const e=(t?this.resolve(t):this).clone(),{label:r,meta:n,optional:a,nullable:s}=e.spec;return{meta:n,label:r,optional:a,nullable:s,default:e.getDefault(t),type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map((t=>({name:t.OPTIONS.name,params:t.OPTIONS.params}))).filter(((t,e,r)=>r.findIndex((e=>e.name===t.name))===e))}}}L.prototype.__isYupSchema__=!0;for(const t of["validate","validateSync"])L.prototype[`${t}At`]=function(e,r,n={}){const{parent:a,parentPath:s,schema:i}=R(this,e,r,n.context);return i[t](a&&a[s],Object.assign({},n,{parent:a,path:e}))};for(const t of["equals","is"])L.prototype[t]=L.prototype.oneOf;for(const t of["not","nope"])L.prototype[t]=L.prototype.notOneOf;let W=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,H=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,K=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Y=t=>P(t)||t===t.trim(),J={}.toString();function G(){return new X}class X extends L{constructor(){super({type:"string",check:t=>(t instanceof String&&(t=t.valueOf()),"string"==typeof t)}),this.withMutation((()=>{this.transform(((t,e,r)=>{if(!r.spec.coerce||r.isType(t))return t;if(Array.isArray(t))return t;const n=null!=t&&t.toString?t.toString():t;return n===J?t:n}))}))}required(t){return super.required(t).withMutation((e=>e.test({message:t||M.required,name:"required",skipAbsent:!0,test:t=>!!t.length})))}notRequired(){return super.notRequired().withMutation((t=>(t.tests=t.tests.filter((t=>"required"!==t.OPTIONS.name)),t)))}length(t,e=C.length){return this.test({message:e,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(e){return e.length===this.resolve(t)}})}min(t,e=C.min){return this.test({message:e,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(e){return e.length>=this.resolve(t)}})}max(t,e=C.max){return this.test({name:"max",exclusive:!0,message:e,params:{max:t},skipAbsent:!0,test(e){return e.length<=this.resolve(t)}})}matches(t,e){let r,n,a=!1;return e&&("object"==typeof e?({excludeEmptyString:a=!1,message:r,name:n}=e):r=e),this.test({name:n||"matches",message:r||C.matches,params:{regex:t},skipAbsent:!0,test:e=>""===e&&a||-1!==e.search(t)})}email(t=C.email){return this.matches(W,{name:"email",message:t,excludeEmptyString:!0})}url(t=C.url){return this.matches(H,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=C.uuid){return this.matches(K,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform((t=>null===t?"":t))}trim(t=C.trim){return this.transform((t=>null!=t?t.trim():t)).test({message:t,name:"trim",test:Y})}lowercase(t=C.lowercase){return this.transform((t=>P(t)?t:t.toLowerCase())).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>P(t)||t===t.toLowerCase()})}uppercase(t=C.uppercase){return this.transform((t=>P(t)?t:t.toUpperCase())).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>P(t)||t===t.toUpperCase()})}}function B(t,e){let r=1/0;return t.some(((t,n)=>{var a;if(null!=(a=e.path)&&a.includes(t))return r=n,!0})),r}function Q(t){return(e,r)=>B(t,e)-B(t,r)}G.prototype=X.prototype;const tt=(t,e,r)=>{if("string"!=typeof t)return t;let n=t;try{n=JSON.parse(t)}catch(t){}return r.isType(n)?n:t};function et(t){if("fields"in t){const e={};for(const[r,n]of Object.entries(t.fields))e[r]=et(n);return t.setFields(e)}if("array"===t.type){const e=t.optional();return e.innerType&&(e.innerType=et(e.innerType)),e}return"tuple"===t.type?t.optional().clone({types:t.spec.types.map(et)}):"optional"in t?t.optional():t}let rt=t=>"[object Object]"===Object.prototype.toString.call(t);const nt=Q([]);function at(t){return new st(t)}class st extends L{constructor(t){super({type:"object",check:t=>rt(t)||"function"==typeof t}),this.fields=Object.create(null),this._sortErrors=nt,this._nodes=[],this._excludedEdges=[],this.withMutation((()=>{t&&this.shape(t)}))}_cast(t,e={}){var r;let n=super._cast(t,e);if(void 0===n)return this.getDefault();if(!this._typeCheck(n))return n;let a=this.fields,s=null!=(r=e.stripUnknown)?r:this.spec.noUnknown,i=[].concat(this._nodes,Object.keys(n).filter((t=>!this._nodes.includes(t)))),u={},l=Object.assign({},e,{parent:u,__validating:e.__validating||!1}),o=!1;for(const t of i){let r=a[t],i=t in n;if(r){let a,s=n[t];l.path=(e.path?`${e.path}.`:"")+t,r=r.resolve({value:s,context:e.context,parent:u});let i=r instanceof L?r.spec:void 0,h=null==i?void 0:i.strict;if(null!=i&&i.strip){o=o||t in n;continue}a=e.__validating&&h?n[t]:r.cast(n[t],l),void 0!==a&&(u[t]=a)}else i&&!s&&(u[t]=n[t]);i===t in u&&u[t]===n[t]||(o=!0)}return o?u:n}_validate(t,e={},r,n){let{from:a=[],originalValue:s=t,recursive:i=this.spec.recursive}=e;e.from=[{schema:this,value:s},...a],e.__validating=!0,e.originalValue=s,super._validate(t,e,r,((t,a)=>{if(!i||!rt(a))return void n(t,a);s=s||a;let u=[];for(let t of this._nodes){let r=this.fields[t];r&&!I.isRef(r)&&u.push(r.asNestedTest({options:e,key:t,parent:a,parentPath:e.path,originalParent:s}))}this.runTests({tests:u,value:a,originalValue:s,options:e},r,(e=>{n(e.sort(this._sortErrors).concat(t),a)}))}))}clone(t){const e=super.clone(t);return e.fields=Object.assign({},this.fields),e._nodes=this._nodes,e._excludedEdges=this._excludedEdges,e._sortErrors=this._sortErrors,e}concat(t){let e=super.concat(t),r=e.fields;for(let[t,e]of Object.entries(this.fields)){const n=r[t];r[t]=void 0===n?e:n}return e.withMutation((t=>t.setFields(r,this._excludedEdges)))}_getDefault(){if("default"in this.spec)return super._getDefault();if(!this._nodes.length)return;let t={};return this._nodes.forEach((e=>{const r=this.fields[e];t[e]=r&&"getDefault"in r?r.getDefault():void 0})),t}setFields(t,e){let r=this.clone();return r.fields=t,r._nodes=function(t,e=[]){let r=[],n=new Set,a=new Set(e.map((([t,e])=>`${t}-${e}`)));function s(t,e){let s=c.split(t)[0];n.add(s),a.has(`${e}-${s}`)||r.push([e,s])}for(const e of Object.keys(t)){let r=t[e];n.add(e),I.isRef(r)&&r.isSibling?s(r.path,e):T(r)&&"deps"in r&&r.deps.forEach((t=>s(t,e)))}return g.array(Array.from(n),r).reverse()}(t,e),r._sortErrors=Q(Object.keys(t)),e&&(r._excludedEdges=e),r}shape(t,e=[]){return this.clone().withMutation((r=>{let n=r._excludedEdges;return e.length&&(Array.isArray(e[0])||(e=[e]),n=[...r._excludedEdges,...e]),r.setFields(Object.assign(r.fields,t),n)}))}partial(){const t={};for(const[e,r]of Object.entries(this.fields))t[e]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return et(this)}pick(t){const e={};for(const r of t)this.fields[r]&&(e[r]=this.fields[r]);return this.setFields(e)}omit(t){const e=Object.assign({},this.fields);for(const r of t)delete e[r];return this.setFields(e)}from(t,e,r){let n=c.getter(t,!0);return this.transform((a=>{if(!a)return a;let s=a;return((t,e)=>{const r=[...c.normalizePath(e)];if(1===r.length)return r[0]in t;let n=r.pop(),a=c.getter(c.join(r),!0)(t);return!(!a||!(n in a))})(a,t)&&(s=Object.assign({},a),r||delete s[t],s[e]=n(a)),s}))}json(){return this.transform(tt)}noUnknown(t=!0,e=N.noUnknown){"boolean"!=typeof t&&(e=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:e,test(e){if(null==e)return!0;const r=function(t,e){let r=Object.keys(t.fields);return Object.keys(e).filter((t=>-1===r.indexOf(t)))}(this.schema,e);return!t||0===r.length||this.createError({params:{unknown:r.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,e=N.noUnknown){return this.noUnknown(!t,e)}transformKeys(t){return this.transform((e=>{if(!e)return e;const r={};for(const n of Object.keys(e))r[t(n)]=e[n];return r}))}camelCase(){return this.transformKeys(F)}snakeCase(){return this.transformKeys(y)}constantCase(){return this.transformKeys((t=>y(t).toUpperCase()))}describe(t){let e=super.describe(t);e.fields={};for(const[n,a]of Object.entries(this.fields)){var r;let s=t;null!=(r=s)&&r.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[n]})),e.fields[n]=a.describe(s)}return e}}at.prototype=st.prototype;const it=at({address_line1:G().required("Enter street address"),address_line2:G(),address_city:G().required("Enter city"),address_state:G().required("Choose state"),address_postal_code:G().required("Enter ZIP").matches(/^\d{5}/,"Enter a valid ZIP").min(5,"Enter a valid ZIP")}),ut=[{label:"Choose state",value:""},{label:"Alabama",value:"AL"},{label:"Alaska",value:"AK"},{label:"American Samoa",value:"AS"},{label:"Arizona",value:"AZ"},{label:"Arkansas",value:"AR"},{label:"California",value:"CA"},{label:"Colorado",value:"CO"},{label:"Connecticut",value:"CT"},{label:"Delaware",value:"DE"},{label:"District Of Columbia",value:"DC"},{label:"Federated States Of Micronesia",value:"FM"},{label:"Florida",value:"FL"},{label:"Georgia",value:"GA"},{label:"Guam",value:"GU"},{label:"Hawaii",value:"HI"},{label:"Idaho",value:"ID"},{label:"Illinois",value:"IL"},{label:"Indiana",value:"IN"},{label:"Iowa",value:"IA"},{label:"Kansas",value:"KS"},{label:"Kentucky",value:"KY"},{label:"Louisiana",value:"LA"},{label:"Maine",value:"ME"},{label:"Marshall Islands",value:"MH"},{label:"Maryland",value:"MD"},{label:"Massachusetts",value:"MA"},{label:"Michigan",value:"MI"},{label:"Minnesota",value:"MN"},{label:"Mississippi",value:"MS"},{label:"Missouri",value:"MO"},{label:"Montana",value:"MT"},{label:"Nebraska",value:"NE"},{label:"Nevada",value:"NV"},{label:"New Hampshire",value:"NH"},{label:"New Jersey",value:"NJ"},{label:"New Mexico",value:"NM"},{label:"New York",value:"NY"},{label:"North Carolina",value:"NC"},{label:"North Dakota",value:"ND"},{label:"Northern Mariana Islands",value:"MP"},{label:"Ohio",value:"OH"},{label:"Oklahoma",value:"OK"},{label:"Oregon",value:"OR"},{label:"Palau",value:"PW"},{label:"Pennsylvania",value:"PA"},{label:"Puerto Rico",value:"PR"},{label:"Rhode Island",value:"RI"},{label:"South Carolina",value:"SC"},{label:"South Dakota",value:"SD"},{label:"Tennessee",value:"TN"},{label:"Texas",value:"TX"},{label:"Utah",value:"UT"},{label:"Vermont",value:"VT"},{label:"Virgin Islands",value:"VI"},{label:"Virginia",value:"VA"},{label:"Washington",value:"WA"},{label:"West Virginia",value:"WV"},{label:"Wisconsin",value:"WI"},{label:"Wyoming",value:"WY"}],lt=class{constructor(e){t(this,e),this.billingFields={address_line1:"",address_line2:"",address_city:"",address_state:"",address_postal_code:""},this.billingFieldsErrors={}}setFormValue(t){const e=t.detail,r=Object.assign({},this.billingFields);e.name&&(r[e.name]=e.value,this.billingFields=r)}async validate(){const t={};let e=!0;try{await it.validate(this.billingFields,{abortEarly:!1})}catch(r){e=!1,r.inner.map((e=>{t[e.path]=e.message}))}return this.billingFieldsErrors=t,{isValid:e}}render(){return e(r,null,e("fieldset",null,e("text-input",{name:"address_line1",label:"Street Address",defaultValue:this.billingFields.address_line1,error:this.billingFieldsErrors.address_line1}),e("text-input",{name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:this.billingFields.address_line2,error:this.billingFieldsErrors.address_line2}),e("text-input",{name:"address_city",label:"City",defaultValue:this.billingFields.address_city,error:this.billingFieldsErrors.address_city}),e("select-input",{name:"address_state",label:"State",options:ut,defaultValue:this.billingFields.address_state,error:this.billingFieldsErrors.address_state}),e("text-input",{name:"address_postal_code",label:"ZIP",defaultValue:this.billingFields.address_postal_code,error:this.billingFieldsErrors.address_postal_code})))}};lt.style=":host{display:block}label{display:block}input{margin-bottom:8px}";export{lt as justifi_billing_form}
1
+ import{r as t,h as e,H as r}from"./p-8ee06fd1.js";function n(t){this._maxSize=t,this.clear()}n.prototype.clear=function(){this._size=0,this._values=Object.create(null)},n.prototype.get=function(t){return this._values[t]},n.prototype.set=function(t,e){return this._size>=this._maxSize&&this.clear(),t in this._values||this._size++,this._values[t]=e};var a=/[^.^\]^[]+|(?=\[\]|\.\.)/g,s=/^\d+$/,i=/^\d/,u=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,l=/^\s*(['"]?)(.*?)(\1)\s*$/,o=new n(512),h=new n(512),f=new n(512),c={Cache:n,split:p,normalizePath:d,setter:function(t){var e=d(t);return h.get(t)||h.set(t,(function(t,r){for(var n=0,a=e.length,s=t;n<a-1;){var i=e[n];if("__proto__"===i||"constructor"===i||"prototype"===i)return t;s=s[e[n++]]}s[e[n]]=r}))},getter:function(t,e){var r=d(t);return f.get(t)||f.set(t,(function(t){for(var n=0,a=r.length;n<a;){if(null==t&&e)return;t=t[r[n++]]}return t}))},join:function(t){return t.reduce((function(t,e){return t+(b(e)||s.test(e)?"["+e+"]":(t?".":"")+e)}),"")},forEach:function(t,e,r){!function(t,e,r){var n,a,s,i,u=t.length;for(a=0;a<u;a++)(n=t[a])&&(v(n)&&(n='"'+n+'"'),s=!(i=b(n))&&/^\d+$/.test(n),e.call(r,n,i,s,a,t))}(Array.isArray(t)?t:p(t),e,r)}};function d(t){return o.get(t)||o.set(t,p(t).map((function(t){return t.replace(l,"$2")})))}function p(t){return t.match(a)||[""]}function b(t){return"string"==typeof t&&t&&-1!==["'",'"'].indexOf(t.charAt(0))}function v(t){return!b(t)&&(function(t){return t.match(i)&&!t.match(s)}(t)||function(t){return u.test(t)}(t))}const m=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,x=t=>t.match(m)||[];var F=t=>x(t).reduce(((t,e)=>`${t}${t?e[0].toUpperCase()+e.slice(1).toLowerCase():e.toLowerCase()}`),""),y=t=>((t,e)=>x(t).join(e).toLowerCase())(t,"_"),g=function(t){return $(function(t){for(var e=new Set,r=0,n=t.length;r<n;r++){var a=t[r];e.add(a[0]),e.add(a[1])}return Array.from(e)}(t),t)};function $(t,e){var r=t.length,n=new Array(r),a={},s=r,i=function(t){for(var e=new Map,r=0,n=t.length;r<n;r++){var a=t[r];e.has(a[0])||e.set(a[0],new Set),e.has(a[1])||e.set(a[1],new Set),e.get(a[0]).add(a[1])}return e}(e),u=function(t){for(var e=new Map,r=0,n=t.length;r<n;r++)e.set(t[r],r);return e}(t);for(e.forEach((function(t){if(!u.has(t[0])||!u.has(t[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")}));s--;)a[s]||l(t[s],s,new Set);return n;function l(t,e,s){if(s.has(t)){var o;try{o=", node was:"+JSON.stringify(t)}catch(t){o=""}throw new Error("Cyclic dependency"+o)}if(!u.has(t))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(t));if(!a[e]){a[e]=!0;var h=i.get(t)||new Set;if(e=(h=Array.from(h)).length){s.add(t);do{var f=h[--e];l(f,u.get(f),s)}while(e);s.delete(t)}n[--r]=t}}}g.array=$;const w=Object.prototype.toString,O=Error.prototype.toString,A=RegExp.prototype.toString,E="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",D=/^Symbol\((.*)\)(.*)$/;function j(t,e=!1){if(null==t||!0===t||!1===t)return""+t;const r=typeof t;if("number"===r)return function(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}(t);if("string"===r)return e?`"${t}"`:t;if("function"===r)return"[Function "+(t.name||"anonymous")+"]";if("symbol"===r)return E.call(t).replace(D,"Symbol($1)");const n=w.call(t).slice(8,-1);return"Date"===n?isNaN(t.getTime())?""+t:t.toISOString(t):"Error"===n||t instanceof Error?"["+O.call(t)+"]":"RegExp"===n?A.call(t):null}function _(t,e){let r=j(t,e);return null!==r?r:JSON.stringify(t,(function(t,r){let n=j(this[t],e);return null!==n?n:r}),2)}function S(t){return null==t?[]:[].concat(t)}let k=/\$\{\s*(\w+)\s*\}/g;class V extends Error{static formatError(t,e){const r=e.label||e.path||"this";return r!==e.path&&(e=Object.assign({},e,{path:r})),"string"==typeof t?t.replace(k,((t,r)=>_(e[r]))):"function"==typeof t?t(e):t}static isError(t){return t&&"ValidationError"===t.name}constructor(t,e,r,n){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this.name="ValidationError",this.value=e,this.path=r,this.type=n,this.errors=[],this.inner=[],S(t).forEach((t=>{V.isError(t)?(this.errors.push(...t.errors),this.inner=this.inner.concat(t.inner.length?t.inner:t)):this.errors.push(t)})),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,V)}}let M={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:t,type:e,value:r,originalValue:n})=>{const a=null!=n&&n!==r?` (cast from the value \`${_(n,!0)}\`).`:".";return"mixed"!==e?`${t} must be a \`${e}\` type, but the final value was: \`${_(r,!0)}\``+a:`${t} must match the configured type. The validated value was: \`${_(r,!0)}\``+a}},C={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},N={noUnknown:"${path} field has unspecified keys: ${unknown}"};Object.assign(Object.create(null),{mixed:M,string:C,number:{min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},date:{min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},object:N,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:{isValue:"${path} field must be ${value}"}});const T=t=>t&&t.__isYupSchema__;class z{static fromOptions(t,e){if(!e.then&&!e.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:n,otherwise:a}=e,s="function"==typeof r?r:(...t)=>t.every((t=>t===r));return new z(t,((t,e)=>{var r;let i=s(...t)?n:a;return null!=(r=null==i?void 0:i(e))?r:e}))}constructor(t,e){this.fn=void 0,this.refs=t,this.refs=t,this.fn=e}resolve(t,e){let r=this.refs.map((t=>t.getValue(null==e?void 0:e.value,null==e?void 0:e.parent,null==e?void 0:e.context))),n=this.fn(r,t,e);if(void 0===n||n===t)return t;if(!T(n))throw new TypeError("conditions must return a schema object");return n.resolve(e)}}class I{constructor(t,e={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof t)throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),""===t)throw new TypeError("ref must be a non-empty string");this.isContext="$"===this.key[0],this.isValue="."===this.key[0],this.isSibling=!this.isContext&&!this.isValue,this.path=this.key.slice((this.isContext?"$":this.isValue?".":"").length),this.getter=this.path&&c.getter(this.path,!0),this.map=e.map}getValue(t,e,r){let n=this.isContext?r:this.isValue?t:e;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(t,e){return this.getValue(t,null==e?void 0:e.parent,null==e?void 0:e.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}I.prototype.__isYupRef=!0;const P=t=>null==t;function Z(t){function e({value:e,path:r="",options:n,originalValue:a,schema:s},i,u){const{name:l,test:o,params:h,message:f,skipAbsent:c}=t;let{parent:d,context:p,abortEarly:b=s.spec.abortEarly}=n;function v(t){return I.isRef(t)?t.getValue(e,d,p):t}function m(t={}){const n=Object.assign({value:e,originalValue:a,label:s.spec.label,path:t.path||r,spec:s.spec},h,t.params);for(const t of Object.keys(n))n[t]=v(n[t]);const i=new V(V.formatError(t.message||f,n),e,n.path,t.type||l);return i.params=n,i}const x=b?i:u;let F={path:r,parent:d,type:l,from:n.from,createError:m,resolve:v,options:n,originalValue:a,schema:s};const y=t=>{V.isError(t)?x(t):t?u(null):x(m())},g=t=>{V.isError(t)?x(t):i(t)},$=c&&P(e);if(!n.sync){try{Promise.resolve(!!$||o.call(F,e,F)).then(y,g)}catch(t){g(t)}return}let w;try{var O;if(w=!!$||o.call(F,e,F),"function"==typeof(null==(O=w)?void 0:O.then))throw new Error(`Validation test of type: "${F.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(t){return void g(t)}y(w)}return e.OPTIONS=t,e}function R(t,e,r,n=r){let a,s,i;return e?(c.forEach(e,((u,l,o)=>{let h=l?u.slice(1,u.length-1):u,f="tuple"===(t=t.resolve({context:n,parent:a,value:r})).type,c=o?parseInt(h,10):0;if(t.innerType||f){if(f&&!o)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${i}" must contain an index to the tuple element, e.g. "${i}[0]"`);if(r&&c>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${u}, in the path: ${e}. because there is no value at that index. `);a=r,r=r&&r[c],t=f?t.spec.types[c]:t.innerType}if(!o){if(!t.fields||!t.fields[h])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${i} which is a type: "${t.type}")`);a=r,r=r&&r[h],t=t.fields[h]}s=h,i=l?"["+u+"]":"."+u})),{schema:t,parent:a,parentPath:s}):{parent:a,parentPath:e,schema:t}}class q extends Set{describe(){const t=[];for(const e of this.values())t.push(I.isRef(e)?e.describe():e);return t}resolveAll(t){let e=[];for(const r of this.values())e.push(t(r));return e}clone(){return new q(this.values())}merge(t,e){const r=this.clone();return t.forEach((t=>r.add(t))),e.forEach((t=>r.delete(t))),r}}function U(t,e=new Map){if(T(t)||!t||"object"!=typeof t)return t;if(e.has(t))return e.get(t);let r;if(t instanceof Date)r=new Date(t.getTime()),e.set(t,r);else if(t instanceof RegExp)r=new RegExp(t),e.set(t,r);else if(Array.isArray(t)){r=new Array(t.length),e.set(t,r);for(let n=0;n<t.length;n++)r[n]=U(t[n],e)}else if(t instanceof Map){r=new Map,e.set(t,r);for(const[n,a]of t.entries())r.set(n,U(a,e))}else if(t instanceof Set){r=new Set,e.set(t,r);for(const n of t)r.add(U(n,e))}else{if(!(t instanceof Object))throw Error(`Unable to clone ${t}`);r={},e.set(t,r);for(const[n,a]of Object.entries(t))r[n]=U(a,e)}return r}class L{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new q,this._blacklist=new q,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation((()=>{this.typeError(M.notType)})),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,optional:!0,coerce:!0},null==t?void 0:t.spec),this.withMutation((t=>{t.nonNullable()}))}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const e=Object.create(Object.getPrototypeOf(this));return e.type=this.type,e._typeCheck=this._typeCheck,e._whitelist=this._whitelist.clone(),e._blacklist=this._blacklist.clone(),e.internalTests=Object.assign({},this.internalTests),e.exclusiveTests=Object.assign({},this.exclusiveTests),e.deps=[...this.deps],e.conditions=[...this.conditions],e.tests=[...this.tests],e.transforms=[...this.transforms],e.spec=U(Object.assign({},this.spec,t)),e}label(t){let e=this.clone();return e.spec.label=t,e}meta(...t){if(0===t.length)return this.spec.meta;let e=this.clone();return e.spec.meta=Object.assign(e.spec.meta||{},t[0]),e}withMutation(t){let e=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=e,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let e=this,r=t.clone();const n=Object.assign({},e.spec,r.spec);return r.spec=n,r.internalTests=Object.assign({},e.internalTests,r.internalTests),r._whitelist=e._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=e._blacklist.merge(t._blacklist,t._whitelist),r.tests=e.tests,r.exclusiveTests=e.exclusiveTests,r.withMutation((e=>{t.tests.forEach((t=>{e.test(t.OPTIONS)}))})),r.transforms=[...e.transforms,...r.transforms],r}isType(t){return null==t?!(!this.spec.nullable||null!==t)||!(!this.spec.optional||void 0!==t):this._typeCheck(t)}resolve(t){let e=this;if(e.conditions.length){let r=e.conditions;e=e.clone(),e.conditions=[],e=r.reduce(((e,r)=>r.resolve(e,t)),e),e=e.resolve(t)}return e}resolveOptions(t){var e,r,n;return Object.assign({},t,{from:t.from||[],strict:null!=(e=t.strict)?e:this.spec.strict,abortEarly:null!=(r=t.abortEarly)?r:this.spec.abortEarly,recursive:null!=(n=t.recursive)?n:this.spec.recursive})}cast(t,e={}){let r=this.resolve(Object.assign({value:t},e)),n="ignore-optionality"===e.assert,a=r._cast(t,e);if(!1!==e.assert&&!r.isType(a)){if(n&&P(a))return a;let s=_(t),i=_(a);throw new TypeError(`The value of ${e.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}". \n\nattempted value: ${s} \n`+(i!==s?`result of cast: ${i}`:""))}return a}_cast(t,e){let r=void 0===t?t:this.transforms.reduce(((e,r)=>r.call(this,e,t,this)),t);return void 0===r&&(r=this.getDefault()),r}_validate(t,e={},r,n){let{path:a,originalValue:s=t,strict:i=this.spec.strict}=e,u=t;i||(u=this._cast(u,Object.assign({assert:!1},e)));let l=[];for(let t of Object.values(this.internalTests))t&&l.push(t);this.runTests({path:a,value:u,originalValue:s,options:e,tests:l},r,(t=>{if(t.length)return n(t,u);this.runTests({path:a,value:u,originalValue:s,options:e,tests:this.tests},r,n)}))}runTests(t,e,r){let n=!1,{tests:a,value:s,originalValue:i,path:u,options:l}=t,o=t=>{n||(n=!0,e(t,s))},h=t=>{n||(n=!0,r(t,s))},f=a.length,c=[];if(!f)return h([]);let d={value:s,originalValue:i,path:u,options:l,schema:this};for(let t=0;t<a.length;t++)(0,a[t])(d,o,(function(t){t&&(c=c.concat(t)),--f<=0&&h(c)}))}asNestedTest({key:t,index:e,parent:r,parentPath:n,originalParent:a,options:s}){const i=null!=t?t:e;if(null==i)throw TypeError("Must include `key` or `index` for nested validations");const u="number"==typeof i;let l=r[i];const o=Object.assign({},s,{strict:!0,parent:r,value:l,originalValue:a[i],key:void 0,[u?"index":"key"]:i,path:u||i.includes(".")?`${n||""}[${l?i:`"${i}"`}]`:(n?`${n}.`:"")+t});return(t,e,r)=>this.resolve(o)._validate(l,o,e,r)}validate(t,e){let r=this.resolve(Object.assign({},e,{value:t}));return new Promise(((n,a)=>r._validate(t,e,((t,e)=>{V.isError(t)&&(t.value=e),a(t)}),((t,e)=>{t.length?a(new V(t,e)):n(e)}))))}validateSync(t,e){let r;return this.resolve(Object.assign({},e,{value:t}))._validate(t,Object.assign({},e,{sync:!0}),((t,e)=>{throw V.isError(t)&&(t.value=e),t}),((e,n)=>{if(e.length)throw new V(e,t);r=n})),r}isValid(t,e){return this.validate(t,e).then((()=>!0),(t=>{if(V.isError(t))return!1;throw t}))}isValidSync(t,e){try{return this.validateSync(t,e),!0}catch(t){if(V.isError(t))return!1;throw t}}_getDefault(){let t=this.spec.default;return null==t?t:"function"==typeof t?t.call(this):U(t)}getDefault(t){return this.resolve(t||{})._getDefault()}default(t){return 0===arguments.length?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,e){const r=this.clone({nullable:t});return r.internalTests.nullable=Z({message:e,name:"nullable",test(t){return null!==t||this.schema.spec.nullable}}),r}optionality(t,e){const r=this.clone({optional:t});return r.internalTests.optionality=Z({message:e,name:"optionality",test(t){return void 0!==t||this.schema.spec.optional}}),r}optional(){return this.optionality(!0)}defined(t=M.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=M.notNull){return this.nullability(!1,t)}required(t=M.required){return this.clone().withMutation((e=>e.nonNullable(t).defined(t)))}notRequired(){return this.clone().withMutation((t=>t.nullable().optional()))}transform(t){let e=this.clone();return e.transforms.push(t),e}test(...t){let e;if(e=1===t.length?"function"==typeof t[0]?{test:t[0]}:t[0]:2===t.length?{name:t[0],test:t[1]}:{name:t[0],message:t[1],test:t[2]},void 0===e.message&&(e.message=M.default),"function"!=typeof e.test)throw new TypeError("`test` is a required parameters");let r=this.clone(),n=Z(e),a=e.exclusive||e.name&&!0===r.exclusiveTests[e.name];if(e.exclusive&&!e.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return e.name&&(r.exclusiveTests[e.name]=!!e.exclusive),r.tests=r.tests.filter((t=>{if(t.OPTIONS.name===e.name){if(a)return!1;if(t.OPTIONS.test===n.OPTIONS.test)return!1}return!0})),r.tests.push(n),r}when(t,e){Array.isArray(t)||"string"==typeof t||(e=t,t=".");let r=this.clone(),n=S(t).map((t=>new I(t)));return n.forEach((t=>{t.isSibling&&r.deps.push(t.key)})),r.conditions.push("function"==typeof e?new z(n,e):z.fromOptions(n,e)),r}typeError(t){let e=this.clone();return e.internalTests.typeError=Z({message:t,name:"typeError",test(t){return!(!P(t)&&!this.schema._typeCheck(t))||this.createError({params:{type:this.schema.type}})}}),e}oneOf(t,e=M.oneOf){let r=this.clone();return t.forEach((t=>{r._whitelist.add(t),r._blacklist.delete(t)})),r.internalTests.whiteList=Z({message:e,name:"oneOf",skipAbsent:!0,test(t){let e=this.schema._whitelist,r=e.resolveAll(this.resolve);return!!r.includes(t)||this.createError({params:{values:Array.from(e).join(", "),resolved:r}})}}),r}notOneOf(t,e=M.notOneOf){let r=this.clone();return t.forEach((t=>{r._blacklist.add(t),r._whitelist.delete(t)})),r.internalTests.blacklist=Z({message:e,name:"notOneOf",test(t){let e=this.schema._blacklist,r=e.resolveAll(this.resolve);return!r.includes(t)||this.createError({params:{values:Array.from(e).join(", "),resolved:r}})}}),r}strip(t=!0){let e=this.clone();return e.spec.strip=t,e}describe(t){const e=(t?this.resolve(t):this).clone(),{label:r,meta:n,optional:a,nullable:s}=e.spec;return{meta:n,label:r,optional:a,nullable:s,default:e.getDefault(t),type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map((t=>({name:t.OPTIONS.name,params:t.OPTIONS.params}))).filter(((t,e,r)=>r.findIndex((e=>e.name===t.name))===e))}}}L.prototype.__isYupSchema__=!0;for(const t of["validate","validateSync"])L.prototype[`${t}At`]=function(e,r,n={}){const{parent:a,parentPath:s,schema:i}=R(this,e,r,n.context);return i[t](a&&a[s],Object.assign({},n,{parent:a,path:e}))};for(const t of["equals","is"])L.prototype[t]=L.prototype.oneOf;for(const t of["not","nope"])L.prototype[t]=L.prototype.notOneOf;let W=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,H=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,K=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Y=t=>P(t)||t===t.trim(),J={}.toString();function G(){return new X}class X extends L{constructor(){super({type:"string",check:t=>(t instanceof String&&(t=t.valueOf()),"string"==typeof t)}),this.withMutation((()=>{this.transform(((t,e,r)=>{if(!r.spec.coerce||r.isType(t))return t;if(Array.isArray(t))return t;const n=null!=t&&t.toString?t.toString():t;return n===J?t:n}))}))}required(t){return super.required(t).withMutation((e=>e.test({message:t||M.required,name:"required",skipAbsent:!0,test:t=>!!t.length})))}notRequired(){return super.notRequired().withMutation((t=>(t.tests=t.tests.filter((t=>"required"!==t.OPTIONS.name)),t)))}length(t,e=C.length){return this.test({message:e,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(e){return e.length===this.resolve(t)}})}min(t,e=C.min){return this.test({message:e,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(e){return e.length>=this.resolve(t)}})}max(t,e=C.max){return this.test({name:"max",exclusive:!0,message:e,params:{max:t},skipAbsent:!0,test(e){return e.length<=this.resolve(t)}})}matches(t,e){let r,n,a=!1;return e&&("object"==typeof e?({excludeEmptyString:a=!1,message:r,name:n}=e):r=e),this.test({name:n||"matches",message:r||C.matches,params:{regex:t},skipAbsent:!0,test:e=>""===e&&a||-1!==e.search(t)})}email(t=C.email){return this.matches(W,{name:"email",message:t,excludeEmptyString:!0})}url(t=C.url){return this.matches(H,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=C.uuid){return this.matches(K,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform((t=>null===t?"":t))}trim(t=C.trim){return this.transform((t=>null!=t?t.trim():t)).test({message:t,name:"trim",test:Y})}lowercase(t=C.lowercase){return this.transform((t=>P(t)?t:t.toLowerCase())).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>P(t)||t===t.toLowerCase()})}uppercase(t=C.uppercase){return this.transform((t=>P(t)?t:t.toUpperCase())).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>P(t)||t===t.toUpperCase()})}}function B(t,e){let r=1/0;return t.some(((t,n)=>{var a;if(null!=(a=e.path)&&a.includes(t))return r=n,!0})),r}function Q(t){return(e,r)=>B(t,e)-B(t,r)}G.prototype=X.prototype;const tt=(t,e,r)=>{if("string"!=typeof t)return t;let n=t;try{n=JSON.parse(t)}catch(t){}return r.isType(n)?n:t};function et(t){if("fields"in t){const e={};for(const[r,n]of Object.entries(t.fields))e[r]=et(n);return t.setFields(e)}if("array"===t.type){const e=t.optional();return e.innerType&&(e.innerType=et(e.innerType)),e}return"tuple"===t.type?t.optional().clone({types:t.spec.types.map(et)}):"optional"in t?t.optional():t}let rt=t=>"[object Object]"===Object.prototype.toString.call(t);const nt=Q([]);function at(t){return new st(t)}class st extends L{constructor(t){super({type:"object",check:t=>rt(t)||"function"==typeof t}),this.fields=Object.create(null),this._sortErrors=nt,this._nodes=[],this._excludedEdges=[],this.withMutation((()=>{t&&this.shape(t)}))}_cast(t,e={}){var r;let n=super._cast(t,e);if(void 0===n)return this.getDefault();if(!this._typeCheck(n))return n;let a=this.fields,s=null!=(r=e.stripUnknown)?r:this.spec.noUnknown,i=[].concat(this._nodes,Object.keys(n).filter((t=>!this._nodes.includes(t)))),u={},l=Object.assign({},e,{parent:u,__validating:e.__validating||!1}),o=!1;for(const t of i){let r=a[t],i=t in n;if(r){let a,s=n[t];l.path=(e.path?`${e.path}.`:"")+t,r=r.resolve({value:s,context:e.context,parent:u});let i=r instanceof L?r.spec:void 0,h=null==i?void 0:i.strict;if(null!=i&&i.strip){o=o||t in n;continue}a=e.__validating&&h?n[t]:r.cast(n[t],l),void 0!==a&&(u[t]=a)}else i&&!s&&(u[t]=n[t]);i===t in u&&u[t]===n[t]||(o=!0)}return o?u:n}_validate(t,e={},r,n){let{from:a=[],originalValue:s=t,recursive:i=this.spec.recursive}=e;e.from=[{schema:this,value:s},...a],e.__validating=!0,e.originalValue=s,super._validate(t,e,r,((t,a)=>{if(!i||!rt(a))return void n(t,a);s=s||a;let u=[];for(let t of this._nodes){let r=this.fields[t];r&&!I.isRef(r)&&u.push(r.asNestedTest({options:e,key:t,parent:a,parentPath:e.path,originalParent:s}))}this.runTests({tests:u,value:a,originalValue:s,options:e},r,(e=>{n(e.sort(this._sortErrors).concat(t),a)}))}))}clone(t){const e=super.clone(t);return e.fields=Object.assign({},this.fields),e._nodes=this._nodes,e._excludedEdges=this._excludedEdges,e._sortErrors=this._sortErrors,e}concat(t){let e=super.concat(t),r=e.fields;for(let[t,e]of Object.entries(this.fields)){const n=r[t];r[t]=void 0===n?e:n}return e.withMutation((t=>t.setFields(r,this._excludedEdges)))}_getDefault(){if("default"in this.spec)return super._getDefault();if(!this._nodes.length)return;let t={};return this._nodes.forEach((e=>{const r=this.fields[e];t[e]=r&&"getDefault"in r?r.getDefault():void 0})),t}setFields(t,e){let r=this.clone();return r.fields=t,r._nodes=function(t,e=[]){let r=[],n=new Set,a=new Set(e.map((([t,e])=>`${t}-${e}`)));function s(t,e){let s=c.split(t)[0];n.add(s),a.has(`${e}-${s}`)||r.push([e,s])}for(const e of Object.keys(t)){let r=t[e];n.add(e),I.isRef(r)&&r.isSibling?s(r.path,e):T(r)&&"deps"in r&&r.deps.forEach((t=>s(t,e)))}return g.array(Array.from(n),r).reverse()}(t,e),r._sortErrors=Q(Object.keys(t)),e&&(r._excludedEdges=e),r}shape(t,e=[]){return this.clone().withMutation((r=>{let n=r._excludedEdges;return e.length&&(Array.isArray(e[0])||(e=[e]),n=[...r._excludedEdges,...e]),r.setFields(Object.assign(r.fields,t),n)}))}partial(){const t={};for(const[e,r]of Object.entries(this.fields))t[e]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return et(this)}pick(t){const e={};for(const r of t)this.fields[r]&&(e[r]=this.fields[r]);return this.setFields(e)}omit(t){const e=Object.assign({},this.fields);for(const r of t)delete e[r];return this.setFields(e)}from(t,e,r){let n=c.getter(t,!0);return this.transform((a=>{if(!a)return a;let s=a;return((t,e)=>{const r=[...c.normalizePath(e)];if(1===r.length)return r[0]in t;let n=r.pop(),a=c.getter(c.join(r),!0)(t);return!(!a||!(n in a))})(a,t)&&(s=Object.assign({},a),r||delete s[t],s[e]=n(a)),s}))}json(){return this.transform(tt)}noUnknown(t=!0,e=N.noUnknown){"boolean"!=typeof t&&(e=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:e,test(e){if(null==e)return!0;const r=function(t,e){let r=Object.keys(t.fields);return Object.keys(e).filter((t=>-1===r.indexOf(t)))}(this.schema,e);return!t||0===r.length||this.createError({params:{unknown:r.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,e=N.noUnknown){return this.noUnknown(!t,e)}transformKeys(t){return this.transform((e=>{if(!e)return e;const r={};for(const n of Object.keys(e))r[t(n)]=e[n];return r}))}camelCase(){return this.transformKeys(F)}snakeCase(){return this.transformKeys(y)}constantCase(){return this.transformKeys((t=>y(t).toUpperCase()))}describe(t){let e=super.describe(t);e.fields={};for(const[n,a]of Object.entries(this.fields)){var r;let s=t;null!=(r=s)&&r.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[n]})),e.fields[n]=a.describe(s)}return e}}at.prototype=st.prototype;const it=at({address_line1:G().required("Enter street address"),address_line2:G(),address_city:G().required("Enter city"),address_state:G().required("Choose state"),address_postal_code:G().required("Enter ZIP").matches(/^\d{5}/,"Enter a valid ZIP").min(5,"Enter a valid ZIP")}),ut=[{label:"Choose state",value:""},{label:"Alabama",value:"AL"},{label:"Alaska",value:"AK"},{label:"American Samoa",value:"AS"},{label:"Arizona",value:"AZ"},{label:"Arkansas",value:"AR"},{label:"California",value:"CA"},{label:"Colorado",value:"CO"},{label:"Connecticut",value:"CT"},{label:"Delaware",value:"DE"},{label:"District Of Columbia",value:"DC"},{label:"Federated States Of Micronesia",value:"FM"},{label:"Florida",value:"FL"},{label:"Georgia",value:"GA"},{label:"Guam",value:"GU"},{label:"Hawaii",value:"HI"},{label:"Idaho",value:"ID"},{label:"Illinois",value:"IL"},{label:"Indiana",value:"IN"},{label:"Iowa",value:"IA"},{label:"Kansas",value:"KS"},{label:"Kentucky",value:"KY"},{label:"Louisiana",value:"LA"},{label:"Maine",value:"ME"},{label:"Marshall Islands",value:"MH"},{label:"Maryland",value:"MD"},{label:"Massachusetts",value:"MA"},{label:"Michigan",value:"MI"},{label:"Minnesota",value:"MN"},{label:"Mississippi",value:"MS"},{label:"Missouri",value:"MO"},{label:"Montana",value:"MT"},{label:"Nebraska",value:"NE"},{label:"Nevada",value:"NV"},{label:"New Hampshire",value:"NH"},{label:"New Jersey",value:"NJ"},{label:"New Mexico",value:"NM"},{label:"New York",value:"NY"},{label:"North Carolina",value:"NC"},{label:"North Dakota",value:"ND"},{label:"Northern Mariana Islands",value:"MP"},{label:"Ohio",value:"OH"},{label:"Oklahoma",value:"OK"},{label:"Oregon",value:"OR"},{label:"Palau",value:"PW"},{label:"Pennsylvania",value:"PA"},{label:"Puerto Rico",value:"PR"},{label:"Rhode Island",value:"RI"},{label:"South Carolina",value:"SC"},{label:"South Dakota",value:"SD"},{label:"Tennessee",value:"TN"},{label:"Texas",value:"TX"},{label:"Utah",value:"UT"},{label:"Vermont",value:"VT"},{label:"Virgin Islands",value:"VI"},{label:"Virginia",value:"VA"},{label:"Washington",value:"WA"},{label:"West Virginia",value:"WV"},{label:"Wisconsin",value:"WI"},{label:"Wyoming",value:"WY"}],lt=class{constructor(e){t(this,e),this.billingFields={address_line1:"",address_line2:"",address_city:"",address_state:"",address_postal_code:""},this.billingFieldsErrors={}}setFormValue(t){const e=t.detail,r=Object.assign({},this.billingFields);e.name&&(r[e.name]=e.value,this.billingFields=r)}async validate(){const t={};let e=!0;try{await it.validate(this.billingFields,{abortEarly:!1})}catch(r){e=!1,r.inner.map((e=>{t[e.path]=e.message}))}return this.billingFieldsErrors=t,{isValid:e}}render(){return e(r,null,e("fieldset",null,e("text-input",{name:"address_line1",label:"Street Address",defaultValue:this.billingFields.address_line1,error:this.billingFieldsErrors.address_line1}),e("text-input",{name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:this.billingFields.address_line2,error:this.billingFieldsErrors.address_line2}),e("text-input",{name:"address_city",label:"City",defaultValue:this.billingFields.address_city,error:this.billingFieldsErrors.address_city}),e("select-input",{name:"address_state",label:"State",options:ut,defaultValue:this.billingFields.address_state,error:this.billingFieldsErrors.address_state}),e("text-input",{name:"address_postal_code",label:"ZIP",defaultValue:this.billingFields.address_postal_code,error:this.billingFieldsErrors.address_postal_code})))}};lt.style=":host{display:block}label{display:block}input{margin-bottom:8px}";export{lt as justifi_billing_form}
@@ -0,0 +1,2 @@
1
+ let e,t,n,l=!1,o=!1,s=!1,c=!1;const i={},r=e=>"object"==(e=typeof e)||"function"===e,f=(e,t,...n)=>{let l=null,o=null,s=!1,c=!1;const i=[],f=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?f(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!r(l))&&(l+=""),s&&c?i[i.length-1].t+=l:i.push(s?u(null,l):l),c=s)};if(f(n),t){t.name&&(o=t.name);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const a=u(e,null);return a.l=t,i.length>0&&(a.o=i),a.i=o,a},u=(e,t)=>({u:0,$:e,t,h:null,o:null,l:null,i:null}),a={},$=(e,t,n)=>{const l=(e=>Q(e).m)(e);return{emit:e=>d(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},d=(e,t,n)=>{const l=ce.ce(t,n);return e.dispatchEvent(l),l},h=new WeakMap,y=e=>"sc-"+e.p,b=(e,t,n,l,o,s)=>{if(n!==l){let c=Z(e,t),i=t.toLowerCase();if("class"===t){const t=e.classList,o=p(n),s=p(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("ref"===t)l&&l(e);else if(c||"o"!==t[0]||"n"!==t[1]){const i=r(l);if((c||i&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?c=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!c||4&s||o)&&!i&&e.setAttribute(t,l=!0===l?"":l)}else t="-"===t[2]?t.slice(3):Z(oe,i)?i.slice(2):i[2]+t.slice(3),n&&ce.rel(e,t,n,!1),l&&ce.ael(e,t,l,!1)}},m=/\s/,p=e=>e?e.split(m):[],w=(e,t,n,l)=>{const o=11===t.h.nodeType&&t.h.host?t.h.host:t.h,s=e&&e.l||i,c=t.l||i;for(l in s)l in c||b(o,l,s[l],void 0,n,t.u);for(l in c)b(o,l,s[l],c[l],n,t.u)},S=(o,c,i,r)=>{const f=c.o[i];let u,a,$,d=0;if(l||(s=!0,"slot"===f.$&&(e&&r.classList.add(e+"-s"),f.u|=f.o?2:1)),null!==f.t)u=f.h=se.createTextNode(f.t);else if(1&f.u)u=f.h=se.createTextNode("");else if(u=f.h=se.createElement(2&f.u?"slot-fb":f.$),w(null,f,!1),null!=e&&u["s-si"]!==e&&u.classList.add(u["s-si"]=e),f.o)for(d=0;d<f.o.length;++d)a=S(o,f,d,u),a&&u.appendChild(a);return u["s-hn"]=n,3&f.u&&(u["s-sr"]=!0,u["s-cr"]=t,u["s-sn"]=f.i||"",$=o&&o.o&&o.o[i],$&&$.$===f.$&&o.h&&g(o.h,!1)),u},g=(e,t)=>{ce.u|=1;const l=e.childNodes;for(let e=l.length-1;e>=0;e--){const o=l[e];o["s-hn"]!==n&&o["s-ol"]&&(M(o).insertBefore(o,C(o)),o["s-ol"].remove(),o["s-ol"]=void 0,s=!0),t&&g(o,t)}ce.u&=-2},k=(e,t,l,o,s,c)=>{let i,r=e["s-cr"]&&e["s-cr"].parentNode||e;for(r.shadowRoot&&r.tagName===n&&(r=r.shadowRoot);s<=c;++s)o[s]&&(i=S(null,l,s,e),i&&(o[s].h=i,r.insertBefore(i,C(t))))},j=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.h,x(l),o=!0,s["s-ol"]?s["s-ol"].remove():g(s,!0),s.remove())},v=(e,t)=>e.$===t.$&&("slot"!==e.$||e.i===t.i),C=e=>e&&e["s-ol"]||e,M=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,O=(e,t)=>{const n=t.h=e.h,l=e.o,o=t.o,s=t.t;let c;null===s?("slot"===t.$||w(e,t,!1),null!==l&&null!==o?((e,t,n,l)=>{let o,s=0,c=0,i=t.length-1,r=t[0],f=t[i],u=l.length-1,a=l[0],$=l[u];for(;s<=i&&c<=u;)null==r?r=t[++s]:null==f?f=t[--i]:null==a?a=l[++c]:null==$?$=l[--u]:v(r,a)?(O(r,a),r=t[++s],a=l[++c]):v(f,$)?(O(f,$),f=t[--i],$=l[--u]):v(r,$)?("slot"!==r.$&&"slot"!==$.$||g(r.h.parentNode,!1),O(r,$),e.insertBefore(r.h,f.h.nextSibling),r=t[++s],$=l[--u]):v(f,a)?("slot"!==r.$&&"slot"!==$.$||g(f.h.parentNode,!1),O(f,a),e.insertBefore(f.h,r.h),f=t[--i],a=l[++c]):(o=S(t&&t[c],n,c,e),a=l[++c],o&&M(r.h).insertBefore(o,C(r.h)));s>i?k(e,null==l[u+1]?null:l[u+1].h,n,l,c,u):c>u&&j(t,s,i)})(n,l,t,o):null!==o?(null!==e.t&&(n.textContent=""),k(n,null,t,o,0,o.length-1)):null!==l&&j(l,0,l.length-1)):(c=n["s-cr"])?c.parentNode.textContent=s:e.t!==s&&(n.data=s)},P=e=>{const t=e.childNodes;let n,l,o,s,c,i;for(l=0,o=t.length;l<o;l++)if(n=t[l],1===n.nodeType){if(n["s-sr"])for(c=n["s-sn"],n.hidden=!1,s=0;s<o;s++)if(i=t[s].nodeType,t[s]["s-hn"]!==n["s-hn"]||""!==c){if(1===i&&c===t[s].getAttribute("slot")){n.hidden=!0;break}}else if(1===i||3===i&&""!==t[s].textContent.trim()){n.hidden=!0;break}P(n)}},R=[],T=e=>{let t,n,l,s,c,i,r=0;const f=e.childNodes,u=f.length;for(;r<u;r++){if(t=f[r],t["s-sr"]&&(n=t["s-cr"])&&n.parentNode)for(l=n.parentNode.childNodes,s=t["s-sn"],i=l.length-1;i>=0;i--)n=l[i],n["s-cn"]||n["s-nr"]||n["s-hn"]===t["s-hn"]||(N(n,s)?(c=R.find((e=>e.S===n)),o=!0,n["s-sn"]=n["s-sn"]||s,c?c.g=t:R.push({g:t,S:n}),n["s-sr"]&&R.map((e=>{N(e.S,n["s-sn"])&&(c=R.find((e=>e.S===n)),c&&!e.g&&(e.g=c.g))}))):R.some((e=>e.S===n))||R.push({S:n}));1===t.nodeType&&T(t)}},N=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,x=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(x)},E=(e,t)=>{t&&!e.k&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.k=t)))},L=(e,t)=>{if(e.u|=16,!(4&e.u))return E(e,e.j),ye((()=>W(e,t)));e.u|=512},W=(e,t)=>{const n=e.v;let l;return t&&(e.u|=256,e.C&&(e.C.map((([e,t])=>F(n,e,t))),e.C=null),l=F(n,"componentWillLoad")),V(l,(()=>A(e,n,t)))},A=async(e,t,n)=>{const l=e.m,o=l["s-rc"];n&&(e=>{const t=e.M,n=e.m,l=t.u,o=((e,t)=>{let n=y(t);const l=le.get(n);if(e=11===e.nodeType?e:se,l)if("string"==typeof l){let t,o=h.get(e=e.head||e);o||h.set(e,o=new Set),o.has(n)||(t=se.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);H(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>U(e);0===t.length?n():(Promise.all(t).then(n),e.u|=4,t.length=0)}},H=(c,i)=>{try{i=i.render(),c.u&=-17,c.u|=2,((c,i)=>{const r=c.m,$=c.M,d=c.O||u(null,null),h=(e=>e&&e.$===a)(i)?i:f(null,null,i);if(n=r.tagName,h.$=null,h.u|=4,c.O=h,h.h=d.h=r.shadowRoot||r,e=r["s-sc"],t=r["s-cr"],l=0!=(1&$.u),o=!1,O(d,h),ce.u|=1,s){let e,t,n,l,o,s;T(h.h);let c=0;for(;c<R.length;c++)e=R[c],t=e.S,t["s-ol"]||(n=se.createTextNode(""),n["s-nr"]=t,t.parentNode.insertBefore(t["s-ol"]=n,t));for(c=0;c<R.length;c++)if(e=R[c],t=e.S,e.g){for(l=e.g.parentNode,o=e.g.nextSibling,n=t["s-ol"];n=n.previousSibling;)if(s=n["s-nr"],s&&s["s-sn"]===t["s-sn"]&&l===s.parentNode&&(s=s.nextSibling,!s||!s["s-nr"])){o=s;break}(!o&&l!==t.parentNode||t.nextSibling!==o)&&t!==o&&(!t["s-hn"]&&t["s-ol"]&&(t["s-hn"]=t["s-ol"].parentNode.nodeName),l.insertBefore(t,o))}else 1===t.nodeType&&(t.hidden=!0)}o&&P(h.h),ce.u&=-2,R.length=0})(c,i)}catch(e){ee(e,c.m)}return null},U=e=>{const t=e.m,n=e.j;64&e.u||(e.u|=64,_(t),e.P(t),n||q()),e.R(t),e.k&&(e.k(),e.k=void 0),512&e.u&&he((()=>L(e,!1))),e.u&=-517},q=()=>{_(se.documentElement),he((()=>d(oe,"appload",{detail:{namespace:"webcomponents"}})))},F=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){ee(e)}},V=(e,t)=>e&&e.then?e.then(t):t(),_=e=>e.classList.add("hydrated"),z=(e,t,n)=>{if(t.T){e.watchers&&(t.N=e.watchers);const l=Object.entries(t.T),o=e.prototype;if(l.map((([e,[l]])=>{31&l||2&n&&32&l?Object.defineProperty(o,e,{get(){return((e,t)=>Q(this).L.get(t))(0,e)},set(n){((e,t,n,l)=>{const o=Q(e),s=o.m,c=o.L.get(t),i=o.u,f=o.v;if(n=((e,t)=>null==e||r(e)?e:1&t?e+"":e)(n,l.T[t][0]),(!(8&i)||void 0===c)&&n!==c&&(!Number.isNaN(c)||!Number.isNaN(n))&&(o.L.set(t,n),f)){if(l.N&&128&i){const e=l.N[t];e&&e.map((e=>{try{f[e](n,c,t)}catch(e){ee(e,s)}}))}if(2==(18&i)){if(f.componentShouldUpdate&&!1===f.componentShouldUpdate(n,c,t))return;L(o,!1)}}})(this,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&l&&Object.defineProperty(o,e,{value(...t){const n=Q(this);return n.W.then((()=>n.v[e](...t)))}})})),1&n){const t=new Map;o.attributeChangedCallback=function(e,n,l){ce.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(o.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},B=e=>{F(e,"connectedCallback")},D=(e,t={})=>{const n=[],l=t.exclude||[],o=oe.customElements,s=se.head,c=s.querySelector("meta[charset]"),i=se.createElement("style"),r=[];let f,u=!0;Object.assign(ce,t),ce.A=new URL(t.resourcesUrl||"./",se.baseURI).href,e.map((e=>{e[1].map((t=>{const s={u:t[0],p:t[1],T:t[2],H:t[3]};s.T=t[2],s.H=t[3],s.N={};const c=s.p,i=class extends HTMLElement{constructor(e){super(e),Y(e=this,s),1&s.u&&e.attachShadow({mode:"open"})}connectedCallback(){f&&(clearTimeout(f),f=null),u?r.push(this):ce.jmp((()=>(e=>{if(0==(1&ce.u)){const t=Q(e),n=t.M,l=()=>{};if(1&t.u)G(e,t,n.H),B(t.v);else{t.u|=1,12&n.u&&(e=>{const t=e["s-cr"]=se.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)})(e);{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){E(t,t.j=n);break}}n.T&&Object.entries(n.T).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,o)=>{if(0==(32&t.u)){{if(t.u|=32,(o=ne(n)).then){const e=()=>{};o=await o,e()}o.isProxied||(n.N=o.watchers,z(o,n,2),o.isProxied=!0);const e=()=>{};t.u|=8;try{new o(t)}catch(e){ee(e)}t.u&=-9,t.u|=128,e(),B(t.v)}if(o.style){let e=o.style;const t=y(n);if(!le.has(t)){const l=()=>{};((e,t,n)=>{let l=le.get(e);re&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,le.set(e,l)})(t,e,!!(1&n.u)),l()}}}const s=t.j,c=()=>L(t,!0);s&&s["s-rc"]?s["s-rc"].push(c):c()})(0,t,n)}l()}})(this)))}disconnectedCallback(){ce.jmp((()=>(()=>{if(0==(1&ce.u)){const e=Q(this),t=e.v;e.U&&(e.U.map((e=>e())),e.U=void 0),F(t,"disconnectedCallback")}})()))}componentOnReady(){return Q(this).q}};s.F=e[0],l.includes(c)||o.get(c)||(n.push(c),o.define(c,z(i,s,1)))}))})),i.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",i.setAttribute("data-styles",""),s.insertBefore(i,c?c.nextSibling:s.firstChild),u=!1,r.length?r.map((e=>e.connectedCallback())):ce.jmp((()=>f=setTimeout(q,30)))},G=(e,t,n)=>{n&&n.map((([n,l,o])=>{const s=e,c=I(t,o),i=J(n);ce.ael(s,l,c,i),(t.U=t.U||[]).push((()=>ce.rel(s,l,c,i)))}))},I=(e,t)=>n=>{try{256&e.u?e.v[t](n):(e.C=e.C||[]).push([t,n])}catch(e){ee(e)}},J=e=>0!=(2&e),K=new WeakMap,Q=e=>K.get(e),X=(e,t)=>K.set(t.v=e,t),Y=(e,t)=>{const n={u:0,m:e,M:t,L:new Map};return n.W=new Promise((e=>n.R=e)),n.q=new Promise((e=>n.P=e)),e["s-p"]=[],e["s-rc"]=[],G(e,n,t.H),K.set(e,n)},Z=(e,t)=>t in e,ee=(e,t)=>(0,console.error)(e,t),te=new Map,ne=e=>{const t=e.p.replace(/-/g,"_"),n=e.F,l=te.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(te.set(n,e),e[t])),ee)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},le=new Map,oe="undefined"!=typeof window?window:{},se=oe.document||{head:{}},ce={u:0,A:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},ie=e=>Promise.resolve(e),re=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),fe=[],ue=[],ae=(e,t)=>n=>{e.push(n),c||(c=!0,t&&4&ce.u?he(de):ce.raf(de))},$e=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){ee(e)}e.length=0},de=()=>{$e(fe),$e(ue),(c=fe.length>0)&&ce.raf(de)},he=e=>ie().then(e),ye=ae(ue,!0);export{a as H,D as b,$ as c,f as h,ie as p,X as r}
@@ -0,0 +1 @@
1
+ import{r as t,h as n,H as e}from"./p-8ee06fd1.js";let r;const i=new Uint8Array(16);function o(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}const a=[];for(let t=0;t<256;++t)a.push((t+256).toString(16).slice(1));const u={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function c(t,n,e){if(u.randomUUID&&!n&&!t)return u.randomUUID();const r=(t=t||{}).random||(t.rng||o)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,n){e=e||0;for(let t=0;t<16;++t)n[e+t]=r[t];return n}return function(t,n=0){return(a[t[n+0]]+a[t[n+1]]+a[t[n+2]]+a[t[n+3]]+"-"+a[t[n+4]]+a[t[n+5]]+"-"+a[t[n+6]]+a[t[n+7]]+"-"+a[t[n+8]]+a[t[n+9]]+"-"+a[t[n+10]]+a[t[n+11]]+a[t[n+12]]+a[t[n+13]]+a[t[n+14]]+a[t[n+15]]).toLowerCase()}(r)}var s,d,f,h;!function(t){t.automatic="automatic",t.manual="manual"}(s||(s={})),function(t){t.card="card",t.bankAccount="bank_account"}(d||(d={})),function(t){t.pending="pending",t.authorized="authorized",t.succeeded="succeeded",t.failed="failed",t.disputed="disputed",t.fully_refunded="fully_refunded",t.partially_refunded="partially_refunded"}(f||(f={})),function(t){t.lost="lost",t.open="open"}(h||(h={}));class l{constructor(t){this.id=t.id,this.account_id=t.account_id,this.amount=t.amount,this.amount_disputed=t.amount_disputed,this.amount_refundable=t.amount_refundable,this.amount_refunded=t.amount_refunded,this.balance=t.balance,this.captured=t.captured,this.capture_strategy=t.capture_strategy,this.currency=t.currency,this.description=t.description,this.disputed=t.disputed,this.disputes=t.disputes,this.error_code=t.error_code,this.error_description=t.error_description,this.fee_amount=t.fee_amount,this.is_test=t.is_test,this.metadata=t.metadata,this.payment_method=t.payment_method,this.payment_intent_id=t.payment_intent_id,this.refunded=t.refunded,this.status=t.status,this.created_at=t.created_at,this.updated_at=t.updated_at}get disputedStatus(){const t=this.disputes.some((t=>t.status===h.lost));return this.disputed?t?h.lost:h.open:null}}function m(t){if(null===t||!0===t||!1===t)return NaN;var n=Number(t);return isNaN(n)?n:n<0?Math.ceil(n):Math.floor(n)}function v(t,n){if(n.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+n.length+" present")}function w(t){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function y(t){v(1,arguments);var n=Object.prototype.toString.call(t);return t instanceof Date||"object"===w(t)&&"[object Date]"===n?new Date(t.getTime()):"number"==typeof t||"[object Number]"===n?new Date(t):("string"!=typeof t&&"[object String]"!==n||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function g(t,n){v(2,arguments);var e=y(t).getTime(),r=m(n);return new Date(e+r)}var b={};function p(){return b}function M(t){var n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),t.getTime()-n.getTime()}function S(t){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function E(t){return v(1,arguments),t instanceof Date||"object"===S(t)&&"[object Date]"===Object.prototype.toString.call(t)}function x(t){if(v(1,arguments),!E(t)&&"number"!=typeof t)return!1;var n=y(t);return!isNaN(Number(n))}function P(t,n){v(2,arguments);var e=m(n);return g(t,-e)}function D(t){v(1,arguments);var n=1,e=y(t),r=e.getUTCDay(),i=(r<n?7:0)+r-n;return e.setUTCDate(e.getUTCDate()-i),e.setUTCHours(0,0,0,0),e}function O(t){v(1,arguments);var n=y(t),e=n.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(e+1,0,4),r.setUTCHours(0,0,0,0);var i=D(r),o=new Date(0);o.setUTCFullYear(e,0,4),o.setUTCHours(0,0,0,0);var a=D(o);return n.getTime()>=i.getTime()?e+1:n.getTime()>=a.getTime()?e:e-1}function j(t){v(1,arguments);var n=O(t),e=new Date(0);e.setUTCFullYear(n,0,4),e.setUTCHours(0,0,0,0);var r=D(e);return r}function A(t,n){var e,r,i,o,a,u,c,s;v(1,arguments);var d=p(),f=m(null!==(e=null!==(r=null!==(i=null!==(o=null==n?void 0:n.weekStartsOn)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(u=a.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:d.weekStartsOn)&&void 0!==r?r:null===(c=d.locale)||void 0===c||null===(s=c.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==e?e:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=y(t),l=h.getUTCDay(),w=(l<f?7:0)+l-f;return h.setUTCDate(h.getUTCDate()-w),h.setUTCHours(0,0,0,0),h}function T(t,n){var e,r,i,o,a,u,c,s;v(1,arguments);var d=y(t),f=d.getUTCFullYear(),h=p(),l=m(null!==(e=null!==(r=null!==(i=null!==(o=null==n?void 0:n.firstWeekContainsDate)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(u=a.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==i?i:h.firstWeekContainsDate)&&void 0!==r?r:null===(c=h.locale)||void 0===c||null===(s=c.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==e?e:1);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=new Date(0);w.setUTCFullYear(f+1,0,l),w.setUTCHours(0,0,0,0);var g=A(w,n),b=new Date(0);b.setUTCFullYear(f,0,l),b.setUTCHours(0,0,0,0);var M=A(b,n);return d.getTime()>=g.getTime()?f+1:d.getTime()>=M.getTime()?f:f-1}function q(t,n){var e,r,i,o,a,u,c,s;v(1,arguments);var d=p(),f=m(null!==(e=null!==(r=null!==(i=null!==(o=null==n?void 0:n.firstWeekContainsDate)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(u=a.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==i?i:d.firstWeekContainsDate)&&void 0!==r?r:null===(c=d.locale)||void 0===c||null===(s=c.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==e?e:1),h=T(t,n),l=new Date(0);l.setUTCFullYear(h,0,f),l.setUTCHours(0,0,0,0);var w=A(l,n);return w}function W(t,n){for(var e=t<0?"-":"",r=Math.abs(t).toString();r.length<n;)r="0"+r;return e+r}var L={G:function(t,n,e){var r=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return e.era(r,{width:"abbreviated"});case"GGGGG":return e.era(r,{width:"narrow"});case"GGGG":default:return e.era(r,{width:"wide"})}},y:function(t,n,e){if("yo"===n){var r=t.getUTCFullYear();return e.ordinalNumber(r>0?r:1-r,{unit:"year"})}return function(t,n){var e=t.getUTCFullYear(),r=e>0?e:1-e;return W("yy"===n?r%100:r,n.length)}(t,n)},Y:function(t,n,e,r){var i=T(t,r),o=i>0?i:1-i;return"YY"===n?W(o%100,2):"Yo"===n?e.ordinalNumber(o,{unit:"year"}):W(o,n.length)},R:function(t,n){return W(O(t),n.length)},u:function(t,n){return W(t.getUTCFullYear(),n.length)},Q:function(t,n,e){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return W(r,2);case"Qo":return e.ordinalNumber(r,{unit:"quarter"});case"QQQ":return e.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,e){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return W(r,2);case"qo":return e.ordinalNumber(r,{unit:"quarter"});case"qqq":return e.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,e){var r=t.getUTCMonth();switch(n){case"M":case"MM":return function(t,n){var e=t.getUTCMonth();return"M"===n?String(e+1):W(e+1,2)}(t,n);case"Mo":return e.ordinalNumber(r+1,{unit:"month"});case"MMM":return e.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,e){var r=t.getUTCMonth();switch(n){case"L":return String(r+1);case"LL":return W(r+1,2);case"Lo":return e.ordinalNumber(r+1,{unit:"month"});case"LLL":return e.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,e,r){var i=function(t,n){v(1,arguments);var e=y(t),r=A(e,n).getTime()-q(e,n).getTime();return Math.round(r/6048e5)+1}(t,r);return"wo"===n?e.ordinalNumber(i,{unit:"week"}):W(i,n.length)},I:function(t,n,e){var r=function(t){v(1,arguments);var n=y(t),e=D(n).getTime()-j(n).getTime();return Math.round(e/6048e5)+1}(t);return"Io"===n?e.ordinalNumber(r,{unit:"week"}):W(r,n.length)},d:function(t,n,e){return"do"===n?e.ordinalNumber(t.getUTCDate(),{unit:"date"}):function(t,n){return W(t.getUTCDate(),n.length)}(t,n)},D:function(t,n,e){var r=function(t){v(1,arguments);var n=y(t),e=n.getTime();n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0);var r=n.getTime();return Math.floor((e-r)/864e5)+1}(t);return"Do"===n?e.ordinalNumber(r,{unit:"dayOfYear"}):W(r,n.length)},E:function(t,n,e){var r=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return e.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(r,{width:"short",context:"formatting"});case"EEEE":default:return e.day(r,{width:"wide",context:"formatting"})}},e:function(t,n,e,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return W(o,2);case"eo":return e.ordinalNumber(o,{unit:"day"});case"eee":return e.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(i,{width:"short",context:"formatting"});case"eeee":default:return e.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,e,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return W(o,n.length);case"co":return e.ordinalNumber(o,{unit:"day"});case"ccc":return e.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(i,{width:"narrow",context:"standalone"});case"cccccc":return e.day(i,{width:"short",context:"standalone"});case"cccc":default:return e.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,e){var r=t.getUTCDay(),i=0===r?7:r;switch(n){case"i":return String(i);case"ii":return W(i,n.length);case"io":return e.ordinalNumber(i,{unit:"day"});case"iii":return e.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(r,{width:"short",context:"formatting"});case"iiii":default:return e.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,e){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,n,e){var r,i=t.getUTCHours();switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",n){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,n,e){var r,i=t.getUTCHours();switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",n){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,n,e){if("ho"===n){var r=t.getUTCHours()%12;return 0===r&&(r=12),e.ordinalNumber(r,{unit:"hour"})}return function(t,n){return W(t.getUTCHours()%12||12,n.length)}(t,n)},H:function(t,n,e){return"Ho"===n?e.ordinalNumber(t.getUTCHours(),{unit:"hour"}):function(t,n){return W(t.getUTCHours(),n.length)}(t,n)},K:function(t,n,e){var r=t.getUTCHours()%12;return"Ko"===n?e.ordinalNumber(r,{unit:"hour"}):W(r,n.length)},k:function(t,n,e){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===n?e.ordinalNumber(r,{unit:"hour"}):W(r,n.length)},m:function(t,n,e){return"mo"===n?e.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):function(t,n){return W(t.getUTCMinutes(),n.length)}(t,n)},s:function(t,n,e){return"so"===n?e.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):function(t,n){return W(t.getUTCSeconds(),n.length)}(t,n)},S:function(t,n){return function(t,n){var e=n.length,r=t.getUTCMilliseconds();return W(Math.floor(r*Math.pow(10,e-3)),n.length)}(t,n)},X:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(n){case"X":return Y(i);case"XXXX":case"XX":return N(i);case"XXXXX":case"XXX":default:return N(i,":")}},x:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();switch(n){case"x":return Y(i);case"xxxx":case"xx":return N(i);case"xxxxx":case"xxx":default:return N(i,":")}},O:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+k(i,":");case"OOOO":default:return"GMT"+N(i,":")}},z:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+k(i,":");case"zzzz":default:return"GMT"+N(i,":")}},t:function(t,n,e,r){return W(Math.floor((r._originalDate||t).getTime()/1e3),n.length)},T:function(t,n,e,r){return W((r._originalDate||t).getTime(),n.length)}};function k(t,n){var e=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;if(0===o)return e+String(i);var a=n||"";return e+String(i)+a+W(o,2)}function Y(t,n){return t%60==0?(t>0?"-":"+")+W(Math.abs(t)/60,2):N(t,n)}function N(t,n){var e=n||"",r=t>0?"-":"+",i=Math.abs(t);return r+W(Math.floor(i/60),2)+e+W(i%60,2)}var R=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},F=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},G={p:F,P:function(t,n){var e,r=t.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return R(t,n);switch(i){case"P":e=n.dateTime({width:"short"});break;case"PP":e=n.dateTime({width:"medium"});break;case"PPP":e=n.dateTime({width:"long"});break;case"PPPP":default:e=n.dateTime({width:"full"})}return e.replace("{{date}}",R(i,n)).replace("{{time}}",F(o,n))}},X=["D","DD"],z=["YY","YYYY"];function Q(t){return-1!==X.indexOf(t)}function B(t){return-1!==z.indexOf(t)}function C(t,n,e){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(n,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(n,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(n,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(n,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var U={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function _(t){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.width?String(n.width):t.defaultWidth,r=t.formats[e]||t.formats[t.defaultWidth];return r}}var H={date:_({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:_({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:_({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function I(t){return function(n,e){var r;if("formatting"===(null!=e&&e.context?String(e.context):"standalone")&&t.formattingValues){var i=t.defaultFormattingWidth||t.defaultWidth,o=null!=e&&e.width?String(e.width):i;r=t.formattingValues[o]||t.formattingValues[i]}else{var a=t.defaultWidth,u=null!=e&&e.width?String(e.width):t.defaultWidth;r=t.values[u]||t.values[a]}return r[t.argumentCallback?t.argumentCallback(n):n]}}function J(t){return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=n.match(i);if(!o)return null;var a,u=o[0],c=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],s=Array.isArray(c)?V(c,(function(t){return t.test(u)})):Z(c,(function(t){return t.test(u)}));a=t.valueCallback?t.valueCallback(s):s,a=e.valueCallback?e.valueCallback(a):a;var d=n.slice(u.length);return{value:a,rest:d}}}function Z(t,n){for(var e in t)if(t.hasOwnProperty(e)&&n(t[e]))return e}function V(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return e}var K,tt={code:"en-US",formatDistance:function(t,n,e){var r,i=U[t];return r="string"==typeof i?i:1===n?i.one:i.other.replace("{{count}}",n.toString()),null!=e&&e.addSuffix?e.comparison&&e.comparison>0?"in "+r:r+" ago":r},formatLong:H,formatRelative:function(t){return $[t]},localize:{ordinalNumber:function(t){var n=Number(t),e=n%100;if(e>20||e<10)switch(e%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:I({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:I({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:I({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:I({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:I({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(K={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.match(K.matchPattern);if(!e)return null;var r=e[0],i=t.match(K.parsePattern);if(!i)return null;var o=K.valueCallback?K.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;var a=t.slice(r.length);return{value:o,rest:a}}),era:J({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:J({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:J({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:J({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:J({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},nt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,et=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rt=/^'([^]*?)'?$/,it=/''/g,ot=/[a-zA-Z]/;function at(t,n,e){var r,i,o,a,u,c,s,d,f,h,l,w,g,b,S,E,D,O;v(2,arguments);var j=String(n),A=p(),T=null!==(r=null!==(i=null==e?void 0:e.locale)&&void 0!==i?i:A.locale)&&void 0!==r?r:tt,q=m(null!==(o=null!==(a=null!==(u=null!==(c=null==e?void 0:e.firstWeekContainsDate)&&void 0!==c?c:null==e||null===(s=e.locale)||void 0===s||null===(d=s.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==u?u:A.firstWeekContainsDate)&&void 0!==a?a:null===(f=A.locale)||void 0===f||null===(h=f.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==o?o:1);if(!(q>=1&&q<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var W=m(null!==(l=null!==(w=null!==(g=null!==(b=null==e?void 0:e.weekStartsOn)&&void 0!==b?b:null==e||null===(S=e.locale)||void 0===S||null===(E=S.options)||void 0===E?void 0:E.weekStartsOn)&&void 0!==g?g:A.weekStartsOn)&&void 0!==w?w:null===(D=A.locale)||void 0===D||null===(O=D.options)||void 0===O?void 0:O.weekStartsOn)&&void 0!==l?l:0);if(!(W>=0&&W<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!T.localize)throw new RangeError("locale must contain localize property");if(!T.formatLong)throw new RangeError("locale must contain formatLong property");var k=y(t);if(!x(k))throw new RangeError("Invalid time value");var Y=M(k),N=P(k,Y),R={firstWeekContainsDate:q,weekStartsOn:W,locale:T,_originalDate:k},F=j.match(et).map((function(t){var n=t[0];return"p"===n||"P"===n?(0,G[n])(t,T.formatLong):t})).join("").match(nt).map((function(r){if("''"===r)return"'";var i=r[0];if("'"===i)return ut(r);var o=L[i];if(o)return null!=e&&e.useAdditionalWeekYearTokens||!B(r)||C(r,n,String(t)),null!=e&&e.useAdditionalDayOfYearTokens||!Q(r)||C(r,n,String(t)),o(N,r,T.localize,R);if(i.match(ot))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return r})).join("");return F}function ut(t){var n=t.match(rt);return n?n[1].replace(it,"'"):t}function ct(t){return(ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function st(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return dt(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?dt(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dt(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}var ft={normalizePrecision:function(t){var n=t.reduce((function(t,n){return Math.max(t.getPrecision(),n.getPrecision())}));return t.map((function(t){return t.getPrecision()!==n?t.convertPrecision(n):t}))},minimum:function(t){var n=st(t),e=n[0],r=n.slice(1),i=e;return r.forEach((function(t){i=i.lessThan(t)?i:t})),i},maximum:function(t){var n=st(t),e=n[0],r=n.slice(1),i=e;return r.forEach((function(t){i=i.greaterThan(t)?i:t})),i}};function ht(t){return!isNaN(parseInt(t))&&isFinite(t)}function lt(t){return t%2==0}function mt(t){return ht(t)&&!Number.isInteger(t)}function vt(t){return Math.abs(t)%1==.5}function wt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var e in n)t.setRequestHeader(e,n[e]);return t}function yt(t){return void 0===t}function gt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",e={};return Object.entries(t).forEach((function(t){if("object"===ct(t[1])){var r=gt(t[1]);Object.entries(r).forEach((function(r){e[t[0]+n+r[0]]=r[1]}))}else e[t[0]]=t[1]})),e}function bt(){var t={HALF_ODD:function(t){var n=Math.round(t);return vt(t)&&lt(n)?n-1:n},HALF_EVEN:function(t){var n=Math.round(t);return vt(t)?lt(n)?n:n-1:n},HALF_UP:function(t){return Math.round(t)},HALF_DOWN:function(t){return vt(t)?Math.floor(t):Math.round(t)},HALF_TOWARDS_ZERO:function(t){return vt(t)?Math.sign(t)*Math.floor(Math.abs(t)):Math.round(t)},HALF_AWAY_FROM_ZERO:function(t){return vt(t)?Math.sign(t)*Math.ceil(Math.abs(t)):Math.round(t)},DOWN:function(t){return Math.floor(t)}};return{add:function(t,n){return t+n},subtract:function(t,n){return t-n},multiply:function(t,n){return mt(t)||mt(n)?function(t,n){var e=function(t){return Math.pow(10,function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0).toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var n=t.split(".")[1];return n?n.length:0}(t))},r=Math.max(e(t),e(n));return Math.round(t*r)*Math.round(n*r)/(r*r)}(t,n):t*n},divide:function(t,n){return t/n},modulo:function(t,n){return t%n},round:function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN";return t[e](n)}}}var pt=bt();function Mt(t){var n=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(t);return{getMatches:function(){return null!==n?n.slice(1).filter((function(t){return!yt(t)})):[]},getMinimumFractionDigits:function(){var t=function(t){return"."===t};return yt(this.getMatches().find(t))?0:this.getMatches()[pt.add(this.getMatches().findIndex(t),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find((function(t){return"USD"===t||"dollar"===t||"$"===t}))]},getStyle:function(){return yt(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!yt(this.getMatches().find((function(t){return","===t})))}}}function St(t){var n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;for(var e in n)t=t.replace("{{".concat(e,"}}"),n[e]);return t};return{getExchangeRate:function(e,r){return(i=t.endpoint,!Boolean(i)||"object"!==ct(i)&&"function"!=typeof i||"function"!=typeof i.then?function(e,r){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(e,r){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===i.readyState&&(i.status>=200&&i.status<400?e(JSON.parse(i.responseText)):r(new Error(i.statusText)))},onerror:function(){r(new Error("Network error"))}});i.open("GET",t,!0),wt(i,n.headers),i.send()}))}(n(t.endpoint,{from:e,to:r}),{headers:t.headers})}(e,r):t.endpoint).then((function(i){return gt(i)[n(t.propertyPath,{from:e,to:r})]}));var i}}}function Et(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!t)throw new e(n)}function xt(t){Et(function(t){return ht(t)&&t<=100&&t>=0}(t),"You must provide a numeric value between 0 and 100.",RangeError)}function Pt(t){Et(Number.isInteger(t),"You must provide an integer.",TypeError)}var Dt=bt(),Ot=Object.assign((function t(n){var e=Object.assign({},{amount:t.defaultAmount,currency:t.defaultCurrency,precision:t.defaultPrecision},n),r=e.amount,i=e.currency,o=e.precision;Pt(r),Pt(o);var a=t.globalLocale,u=t.globalFormat,c=t.globalRoundingMode,s=t.globalFormatRoundingMode,d=Object.assign({},t.globalExchangeRatesApi),f=function(n){var e=Object.assign({},Object.assign({},{amount:r,currency:i,precision:o},n),Object.assign({},{locale:this.locale},n));return Object.assign(t({amount:e.amount,currency:e.currency,precision:e.precision}),{locale:e.locale})},h=function(t){Et(this.hasSameCurrency(t),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return i},getLocale:function(){return this.locale||a},setLocale:function(t){return f.call(this,{locale:t})},getPrecision:function(){return o},convertPrecision:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;Pt(t);var e=this.getPrecision(),r=t>e,i=r?Dt.multiply:Dt.divide,o=r?[t,e]:[e,t],a=Math.pow(10,Dt.subtract.apply(Dt,o));return f.call(this,{amount:Dt.round(i(this.getAmount(),a),n),precision:t})},add:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return f.call(this,{amount:Dt.add(e[0].getAmount(),e[1].getAmount()),precision:e[0].getPrecision()})},subtract:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return f.call(this,{amount:Dt.subtract(e[0].getAmount(),e[1].getAmount()),precision:e[0].getPrecision()})},multiply:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return f.call(this,{amount:Dt.round(Dt.multiply(this.getAmount(),t),n)})},divide:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return f.call(this,{amount:Dt.round(Dt.divide(this.getAmount(),t),n)})},percentage:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return xt(t),this.multiply(Dt.divide(t,100),n)},allocate:function(t){var n=this;!function(t){Et(function(t){return t.length>0&&t.every((function(t){return t>=0}))&&t.some((function(t){return t>0}))}(t),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(t);for(var e=t.reduce((function(t,n){return Dt.add(t,n)})),r=this.getAmount(),i=t.map((function(t){var i=Math.floor(Dt.divide(Dt.multiply(n.getAmount(),t),e));return r=Dt.subtract(r,i),f.call(n,{amount:i})})),o=0;r>0;)t[o]>0&&(i[o]=i[o].add(f.call(this,{amount:1})),r=Dt.subtract(r,1)),o+=1;return i},convert:function(t){var n=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.endpoint,i=void 0===r?d.endpoint:r,o=e.propertyPath,a=void 0===o?d.propertyPath||"rates.{{to}}":o,u=e.headers,s=void 0===u?d.headers:u,h=e.roundingMode,l=void 0===h?c:h,m=Object.assign({},{endpoint:i,propertyPath:a,headers:s,roundingMode:l});return St(m).getExchangeRate(this.getCurrency(),t).then((function(e){return Et(!yt(e),'No rate was found for the destination currency "'.concat(t,'".'),TypeError),f.call(n,{amount:Dt.round(Dt.multiply(n.getAmount(),parseFloat(e)),m.roundingMode),currency:t})}))},equalsTo:function(t){return this.hasSameAmount(t)&&this.hasSameCurrency(t)},lessThan:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()<e[1].getAmount()},lessThanOrEqual:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()<=e[1].getAmount()},greaterThan:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()>e[1].getAmount()},greaterThanOrEqual:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()>=e[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==Dt.modulo(this.getAmount(),Math.pow(10,o))},hasCents:function(){return 0!==Dt.modulo(this.getAmount(),Math.pow(10,o))},hasSameCurrency:function(t){return this.getCurrency()===t.getCurrency()},hasSameAmount:function(n){var e=t.normalizePrecision([this,n]);return e[0].getAmount()===e[1].getAmount()},toFormat:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,e=Mt(t);return this.toRoundedUnit(e.getMinimumFractionDigits(),n).toLocaleString(this.getLocale(),{currencyDisplay:e.getCurrencyDisplay(),useGrouping:e.getUseGrouping(),minimumFractionDigits:e.getMinimumFractionDigits(),style:e.getStyle(),currency:this.getCurrency()})},toUnit:function(){return Dt.divide(this.getAmount(),Math.pow(10,o))},toRoundedUnit:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,e=Math.pow(10,t);return Dt.divide(Dt.round(Dt.multiply(this.toUnit(),e),n),e)},toObject:function(){return{amount:r,currency:i,precision:o}},toJSON:function(){return this.toObject()}}}),{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},{globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}},ft);const jt=class{constructor(n){t(this,n),this.accountId=void 0,this.auth={},this.payments=[]}requestPropsChanged(){this.fetchData()}fetchData(){const t=`account/${this.accountId}/payments`;(t=>{async function n(){return{Authorization:`Bearer ${t}`,"Idempotency-Key":c(),"Content-Type":"application/json"}}async function e(t,e,r,i,o){const a=`http://localhost:3000/v1/${t}`,u=r?`${a}?${new URLSearchParams(r)}`:a,c=await fetch(u,{method:e,headers:await n(),body:i,signal:o});if(c)return 204===c.status?{}:c.json();!function(t){console.error(`Error fetching from ${t}`)}(u)}return{get:async function(t,n,r){return e(t,"GET",n,null,r)},post:async function(t,n,r,i){return e(t,"POST",r,n,i)},patch:async function(t,n,r,i){return e(t,"PATCH",r,n,i)},destroy:async function(t,n,r){return e(t,"DELETE",n,null,r)}}})(this.auth.token).get(t).then((t=>{const n=t.data.map((t=>new l(t)));this.payments=n}))}render(){return n(e,null,n("table",{class:"justifi-table"},n("thead",null,n("tr",null,n("th",{scope:"col",title:"The date and time each payment was made"},"Made on"),n("th",{scope:"col",title:"The dollar amount of each payment"},"Amount"),n("th",{scope:"col"},"Account"),n("th",{scope:"col"},"Description"),n("th",{scope:"col"},"Payment ID"),n("th",{scope:"col"},"Cardholder"),n("th",{scope:"col"},"Payment Method"),n("th",{scope:"col"},"Status"))),n("tbody",null,this.payments.map((t=>{var e,r,i,o,a;n("tr",null,n("td",null,n("div",null,(a=t.created_at)?at(new Date(a),"MMM d, yyyy"):""),n("div",null,function(t){return t?at(new Date(t),"h:mmaaa"):""}(t.created_at))),n("td",null,function(t,n=!0){function e(t){const e=n?"$0,0.00":"0,0.00";return Ot({amount:t,currency:"USD"}).toFormat(e)}return t||(t=0),t<0?`(${e(-t)})`:e(t)}(t.amount)),n("td",null,t.account_id),n("td",null,t.description),n("td",null,t.id),n("td",null,null===(r=null===(e=t.payment_method)||void 0===e?void 0:e.card)||void 0===r?void 0:r.name),n("td",null,null===(o=null===(i=t.payment_method)||void 0===i?void 0:i.card)||void 0===o?void 0:o.acct_last_four),n("td",null,t.status))})))))}static get watchers(){return{accountId:["requestPropsChanged"],auth:["requestPropsChanged"]}}};jt.style=":host{display:block}";export{jt as justifi_payments_list}
@@ -0,0 +1 @@
1
+ import{r,h as s,H as t}from"./p-8ee06fd1.js";const o=class{constructor(s){r(this,s),this.validationStrategy=void 0}render(){return s(t,null,s("form",null,s("slot",null)))}};export{o as justifi_payment_form}
@@ -1 +1 @@
1
- import{r as t,c as e,h as i}from"./p-e82c9746.js";const r=class{constructor(i){t(this,i),this.bankAccountFormReady=e(this,"bankAccountFormReady",7),this.bankAccountFormTokenize=e(this,"bankAccountFormTokenize",7),this.bankAccountFormValidate=e(this,"bankAccountFormValidate",7),this.validationStrategy=void 0,this.styleOverrides=void 0,this.internalStyleOverrides=void 0}readyHandler(t){this.bankAccountFormReady.emit(t)}tokenizeHandler(t){this.bankAccountFormTokenize.emit(t)}validateHandler(t){this.bankAccountFormValidate.emit(t)}componentWillLoad(){this.parseStyleOverrides()}parseStyleOverrides(){if(this.styleOverrides){const t=JSON.parse(this.styleOverrides);this.internalStyleOverrides=t}}async tokenize(...t){if(!this.childRef)throw new Error("Cannot call tokenize");return this.childRef.tokenize(...t)}async validate(){if(!this.childRef)throw new Error("Cannot call validate");return this.childRef.validate()}render(){return i("justifi-payment-method-form",{ref:t=>{t&&(this.childRef=t)},"payment-method-form-type":"bankAccount","payment-method-form-ready":this.bankAccountFormReady,"payment-method-form-tokenize":this.bankAccountFormTokenize,"payment-method-form-validation-strategy":this.validationStrategy||"onSubmit",paymentMethodStyleOverrides:this.internalStyleOverrides})}static get watchers(){return{styleOverrides:["parseStyleOverrides"]}}};export{r as justifi_bank_account_form}
1
+ import{r as t,c as e,h as i}from"./p-8ee06fd1.js";const r=class{constructor(i){t(this,i),this.bankAccountFormReady=e(this,"bankAccountFormReady",7),this.bankAccountFormTokenize=e(this,"bankAccountFormTokenize",7),this.bankAccountFormValidate=e(this,"bankAccountFormValidate",7),this.validationStrategy=void 0,this.styleOverrides=void 0,this.internalStyleOverrides=void 0}readyHandler(t){this.bankAccountFormReady.emit(t)}tokenizeHandler(t){this.bankAccountFormTokenize.emit(t)}validateHandler(t){this.bankAccountFormValidate.emit(t)}componentWillLoad(){this.parseStyleOverrides()}parseStyleOverrides(){if(this.styleOverrides){const t=JSON.parse(this.styleOverrides);this.internalStyleOverrides=t}}async tokenize(...t){if(!this.childRef)throw new Error("Cannot call tokenize");return this.childRef.tokenize(...t)}async validate(){if(!this.childRef)throw new Error("Cannot call validate");return this.childRef.validate()}render(){return i("justifi-payment-method-form",{ref:t=>{t&&(this.childRef=t)},"payment-method-form-type":"bankAccount","payment-method-form-ready":this.bankAccountFormReady,"payment-method-form-tokenize":this.bankAccountFormTokenize,"payment-method-form-validation-strategy":this.validationStrategy||"onSubmit",paymentMethodStyleOverrides:this.internalStyleOverrides})}static get watchers(){return{styleOverrides:["parseStyleOverrides"]}}};export{r as justifi_bank_account_form}
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-e82c9746.js";export{s as setNonce}from"./p-e82c9746.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t([["p-864e32fd",[[1,"justifi-billing-form",{billingFields:[32],billingFieldsErrors:[32],validate:[64]},[[0,"fieldReceivedInput","setFormValue"]]]]],["p-17badb93",[[0,"justifi-payment-method-form",{paymentMethodFormType:[1,"payment-method-form-type"],paymentMethodFormValidationStrategy:[1,"payment-method-form-validation-strategy"],paymentMethodStyleOverrides:[16],height:[32],tokenize:[64],validate:[64]}]]],["p-7fd07095",[[0,"justifi-bank-account-form",{validationStrategy:[1,"validation-strategy"],styleOverrides:[1,"style-overrides"],internalStyleOverrides:[32],tokenize:[64],validate:[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["p-d3dc4e0a",[[0,"justifi-card-form",{validationStrategy:[1,"validation-strategy"],styleOverrides:[1,"style-overrides"],internalStyleOverrides:[32],tokenize:[64],validate:[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["p-cecf0fe8",[[1,"justifi-payments-list",{accountId:[1,"account-id"],auth:[16],payments:[32]}]]],["p-0cddfd4f",[[1,"select-input",{name:[1],label:[1],defaultValue:[1,"default-value"],error:[1],options:[16],internalValue:[32]}],[1,"text-input",{name:[1],label:[1],defaultValue:[1,"default-value"],error:[1],internalValue:[32]}]]]],e)));
1
+ import{p as e,b as t}from"./p-8ee06fd1.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t([["p-87654bf4",[[1,"justifi-billing-form",{billingFields:[32],billingFieldsErrors:[32],validate:[64]},[[0,"fieldReceivedInput","setFormValue"]]]]],["p-e5b0f047",[[0,"justifi-bank-account-form",{validationStrategy:[1,"validation-strategy"],styleOverrides:[1,"style-overrides"],internalStyleOverrides:[32],tokenize:[64],validate:[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["p-787671b9",[[0,"justifi-card-form",{validationStrategy:[1,"validation-strategy"],styleOverrides:[1,"style-overrides"],internalStyleOverrides:[32],tokenize:[64],validate:[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["p-c07191dc",[[4,"justifi-payment-form",{validationStrategy:[1,"validation-strategy"]}]]],["p-94ef2d0e",[[1,"justifi-payments-list",{accountId:[1,"account-id"],auth:[16],payments:[32]}]]],["p-3809130a",[[1,"select-input",{name:[1],label:[1],defaultValue:[1,"default-value"],error:[1],options:[16],internalValue:[32]}],[1,"text-input",{name:[1],label:[1],defaultValue:[1,"default-value"],error:[1],internalValue:[32]}]]],["p-67be9585",[[0,"justifi-payment-method-form",{paymentMethodFormType:[1,"payment-method-form-type"],paymentMethodFormValidationStrategy:[1,"payment-method-form-validation-strategy"],paymentMethodStyleOverrides:[16],height:[32],tokenize:[64],validate:[64]}]]]],e)));
package/loader/index.d.ts CHANGED
@@ -10,12 +10,3 @@ export interface CustomElementsDefineOptions {
10
10
  }
11
11
  export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): Promise<void>;
12
12
  export declare function applyPolyfills(): Promise<void>;
13
-
14
- /**
15
- * Used to specify a nonce value that corresponds with an application's CSP.
16
- * When set, the nonce will be added to all dynamically created script and style tags at runtime.
17
- * Alternatively, the nonce value can be set on a meta tag in the DOM head
18
- * (<meta name="csp-nonce" content="{ nonce value here }" />) which
19
- * will result in the same behavior.
20
- */
21
- export declare function setNonce(nonce: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justifi/webcomponents",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "JustiFi Web Components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -25,10 +25,13 @@
25
25
  "auto-changelog": "auto-changelog",
26
26
  "release": "release-it --no-npm",
27
27
  "build": "stencil build --docs",
28
- "start": "stencil build --dev --watch --serve",
28
+ "start": "concurrently -c \"bgBlue.bold,bgMagenta.bold,bgGreen.bold\" \"yarn run start-stencil\" \"yarn run storybook\"",
29
+ "start-stencil": "stencil build --watch --serve --no-open",
29
30
  "test": "stencil test --spec --e2e",
30
31
  "test:watch": "stencil test --spec --e2e --watchAll",
31
- "generate": "stencil generate"
32
+ "generate": "stencil generate",
33
+ "storybook": "start-storybook -p 6006",
34
+ "build-storybook": "build-storybook"
32
35
  },
33
36
  "dependencies": {
34
37
  "@stencil/core": "^2.13.0",
@@ -39,8 +42,18 @@
39
42
  "yup": "^1.0.0"
40
43
  },
41
44
  "devDependencies": {
45
+ "@pxtrn/storybook-addon-docs-stencil": "^6.4.1",
46
+ "@storybook/addon-actions": "^6.5.16",
47
+ "@storybook/addon-essentials": "^6.5.16",
48
+ "@storybook/addon-interactions": "^6.5.16",
49
+ "@storybook/addon-links": "^6.5.16",
50
+ "@storybook/builder-webpack4": "^6.5.16",
51
+ "@storybook/html": "^6.5.16",
52
+ "@storybook/manager-webpack4": "^6.5.16",
53
+ "@storybook/testing-library": "^0.0.13",
42
54
  "@types/jest": "^27.0.3",
43
55
  "auto-changelog": "^2.4.0",
56
+ "concurrently": "^7.6.0",
44
57
  "jest": "^27.4.5",
45
58
  "jest-cli": "^27.4.5",
46
59
  "puppeteer": "^10.0.0",
@@ -1 +0,0 @@
1
- import{r as t,h as n,H as e}from"./p-e82c9746.js";let r;const i=new Uint8Array(16);function o(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}const a=[];for(let t=0;t<256;++t)a.push((t+256).toString(16).slice(1));const u={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function c(t,n,e){if(u.randomUUID&&!n&&!t)return u.randomUUID();const r=(t=t||{}).random||(t.rng||o)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,n){e=e||0;for(let t=0;t<16;++t)n[e+t]=r[t];return n}return function(t,n=0){return(a[t[n+0]]+a[t[n+1]]+a[t[n+2]]+a[t[n+3]]+"-"+a[t[n+4]]+a[t[n+5]]+"-"+a[t[n+6]]+a[t[n+7]]+"-"+a[t[n+8]]+a[t[n+9]]+"-"+a[t[n+10]]+a[t[n+11]]+a[t[n+12]]+a[t[n+13]]+a[t[n+14]]+a[t[n+15]]).toLowerCase()}(r)}var s,d,f,h;!function(t){t.automatic="automatic",t.manual="manual"}(s||(s={})),function(t){t.card="card",t.bankAccount="bank_account"}(d||(d={})),function(t){t.pending="pending",t.authorized="authorized",t.succeeded="succeeded",t.failed="failed",t.disputed="disputed",t.fully_refunded="fully_refunded",t.partially_refunded="partially_refunded"}(f||(f={})),function(t){t.lost="lost",t.open="open"}(h||(h={}));class l{constructor(t){this.id=t.id,this.account_id=t.account_id,this.amount=t.amount,this.amount_disputed=t.amount_disputed,this.amount_refundable=t.amount_refundable,this.amount_refunded=t.amount_refunded,this.balance=t.balance,this.captured=t.captured,this.capture_strategy=t.capture_strategy,this.currency=t.currency,this.description=t.description,this.disputed=t.disputed,this.disputes=t.disputes,this.error_code=t.error_code,this.error_description=t.error_description,this.fee_amount=t.fee_amount,this.is_test=t.is_test,this.metadata=t.metadata,this.payment_method=t.payment_method,this.payment_intent_id=t.payment_intent_id,this.refunded=t.refunded,this.status=t.status,this.created_at=t.created_at,this.updated_at=t.updated_at}get disputedStatus(){const t=this.disputes.some((t=>t.status===h.lost));return this.disputed?t?h.lost:h.open:null}}function m(t){if(null===t||!0===t||!1===t)return NaN;var n=Number(t);return isNaN(n)?n:n<0?Math.ceil(n):Math.floor(n)}function v(t,n){if(n.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+n.length+" present")}function w(t){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}function y(t){v(1,arguments);var n=Object.prototype.toString.call(t);return t instanceof Date||"object"===w(t)&&"[object Date]"===n?new Date(t.getTime()):"number"==typeof t||"[object Number]"===n?new Date(t):("string"!=typeof t&&"[object String]"!==n||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function g(t,n){v(2,arguments);var e=y(t).getTime(),r=m(n);return new Date(e+r)}var b={};function p(){return b}function M(t){var n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),t.getTime()-n.getTime()}function S(t){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function E(t){return v(1,arguments),t instanceof Date||"object"===S(t)&&"[object Date]"===Object.prototype.toString.call(t)}function D(t){if(v(1,arguments),!E(t)&&"number"!=typeof t)return!1;var n=y(t);return!isNaN(Number(n))}function x(t,n){v(2,arguments);var e=m(n);return g(t,-e)}var P=864e5;function O(t){v(1,arguments);var n=1,e=y(t),r=e.getUTCDay(),i=(r<n?7:0)+r-n;return e.setUTCDate(e.getUTCDate()-i),e.setUTCHours(0,0,0,0),e}function j(t){v(1,arguments);var n=y(t),e=n.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(e+1,0,4),r.setUTCHours(0,0,0,0);var i=O(r),o=new Date(0);o.setUTCFullYear(e,0,4),o.setUTCHours(0,0,0,0);var a=O(o);return n.getTime()>=i.getTime()?e+1:n.getTime()>=a.getTime()?e:e-1}function A(t){v(1,arguments);var n=j(t),e=new Date(0);e.setUTCFullYear(n,0,4),e.setUTCHours(0,0,0,0);var r=O(e);return r}var T=6048e5;function W(t,n){var e,r,i,o,a,u,c,s;v(1,arguments);var d=p(),f=m(null!==(e=null!==(r=null!==(i=null!==(o=null==n?void 0:n.weekStartsOn)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(u=a.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:d.weekStartsOn)&&void 0!==r?r:null===(c=d.locale)||void 0===c||null===(s=c.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==e?e:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=y(t),l=h.getUTCDay(),w=(l<f?7:0)+l-f;return h.setUTCDate(h.getUTCDate()-w),h.setUTCHours(0,0,0,0),h}function k(t,n){var e,r,i,o,a,u,c,s;v(1,arguments);var d=y(t),f=d.getUTCFullYear(),h=p(),l=m(null!==(e=null!==(r=null!==(i=null!==(o=null==n?void 0:n.firstWeekContainsDate)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(u=a.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==i?i:h.firstWeekContainsDate)&&void 0!==r?r:null===(c=h.locale)||void 0===c||null===(s=c.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==e?e:1);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=new Date(0);w.setUTCFullYear(f+1,0,l),w.setUTCHours(0,0,0,0);var g=W(w,n),b=new Date(0);b.setUTCFullYear(f,0,l),b.setUTCHours(0,0,0,0);var M=W(b,n);return d.getTime()>=g.getTime()?f+1:d.getTime()>=M.getTime()?f:f-1}function Y(t,n){var e,r,i,o,a,u,c,s;v(1,arguments);var d=p(),f=m(null!==(e=null!==(r=null!==(i=null!==(o=null==n?void 0:n.firstWeekContainsDate)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(u=a.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==i?i:d.firstWeekContainsDate)&&void 0!==r?r:null===(c=d.locale)||void 0===c||null===(s=c.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==e?e:1),h=k(t,n),l=new Date(0);l.setUTCFullYear(h,0,f),l.setUTCHours(0,0,0,0);var w=W(l,n);return w}var q=6048e5;function L(t,n){for(var e=t<0?"-":"",r=Math.abs(t).toString();r.length<n;)r="0"+r;return e+r}var N={G:function(t,n,e){var r=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return e.era(r,{width:"abbreviated"});case"GGGGG":return e.era(r,{width:"narrow"});default:return e.era(r,{width:"wide"})}},y:function(t,n,e){if("yo"===n){var r=t.getUTCFullYear();return e.ordinalNumber(r>0?r:1-r,{unit:"year"})}return function(t,n){var e=t.getUTCFullYear(),r=e>0?e:1-e;return L("yy"===n?r%100:r,n.length)}(t,n)},Y:function(t,n,e,r){var i=k(t,r),o=i>0?i:1-i;return"YY"===n?L(o%100,2):"Yo"===n?e.ordinalNumber(o,{unit:"year"}):L(o,n.length)},R:function(t,n){return L(j(t),n.length)},u:function(t,n){return L(t.getUTCFullYear(),n.length)},Q:function(t,n,e){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return L(r,2);case"Qo":return e.ordinalNumber(r,{unit:"quarter"});case"QQQ":return e.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(r,{width:"narrow",context:"formatting"});default:return e.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,e){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return L(r,2);case"qo":return e.ordinalNumber(r,{unit:"quarter"});case"qqq":return e.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(r,{width:"narrow",context:"standalone"});default:return e.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,e){var r=t.getUTCMonth();switch(n){case"M":case"MM":return function(t,n){var e=t.getUTCMonth();return"M"===n?String(e+1):L(e+1,2)}(t,n);case"Mo":return e.ordinalNumber(r+1,{unit:"month"});case"MMM":return e.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(r,{width:"narrow",context:"formatting"});default:return e.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,e){var r=t.getUTCMonth();switch(n){case"L":return String(r+1);case"LL":return L(r+1,2);case"Lo":return e.ordinalNumber(r+1,{unit:"month"});case"LLL":return e.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(r,{width:"narrow",context:"standalone"});default:return e.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,e,r){var i=function(t,n){v(1,arguments);var e=y(t),r=W(e,n).getTime()-Y(e,n).getTime();return Math.round(r/q)+1}(t,r);return"wo"===n?e.ordinalNumber(i,{unit:"week"}):L(i,n.length)},I:function(t,n,e){var r=function(t){v(1,arguments);var n=y(t),e=O(n).getTime()-A(n).getTime();return Math.round(e/T)+1}(t);return"Io"===n?e.ordinalNumber(r,{unit:"week"}):L(r,n.length)},d:function(t,n,e){return"do"===n?e.ordinalNumber(t.getUTCDate(),{unit:"date"}):function(t,n){return L(t.getUTCDate(),n.length)}(t,n)},D:function(t,n,e){var r=function(t){v(1,arguments);var n=y(t),e=n.getTime();n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0);var r=n.getTime();return Math.floor((e-r)/P)+1}(t);return"Do"===n?e.ordinalNumber(r,{unit:"dayOfYear"}):L(r,n.length)},E:function(t,n,e){var r=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return e.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},e:function(t,n,e,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return L(o,2);case"eo":return e.ordinalNumber(o,{unit:"day"});case"eee":return e.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,e,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return L(o,n.length);case"co":return e.ordinalNumber(o,{unit:"day"});case"ccc":return e.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(i,{width:"narrow",context:"standalone"});case"cccccc":return e.day(i,{width:"short",context:"standalone"});default:return e.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,e){var r=t.getUTCDay(),i=0===r?7:r;switch(n){case"i":return String(i);case"ii":return L(i,n.length);case"io":return e.ordinalNumber(i,{unit:"day"});case"iii":return e.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,e){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,n,e){var r,i=t.getUTCHours();switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",n){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,n,e){var r,i=t.getUTCHours();switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",n){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,n,e){if("ho"===n){var r=t.getUTCHours()%12;return 0===r&&(r=12),e.ordinalNumber(r,{unit:"hour"})}return function(t,n){return L(t.getUTCHours()%12||12,n.length)}(t,n)},H:function(t,n,e){return"Ho"===n?e.ordinalNumber(t.getUTCHours(),{unit:"hour"}):function(t,n){return L(t.getUTCHours(),n.length)}(t,n)},K:function(t,n,e){var r=t.getUTCHours()%12;return"Ko"===n?e.ordinalNumber(r,{unit:"hour"}):L(r,n.length)},k:function(t,n,e){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===n?e.ordinalNumber(r,{unit:"hour"}):L(r,n.length)},m:function(t,n,e){return"mo"===n?e.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):function(t,n){return L(t.getUTCMinutes(),n.length)}(t,n)},s:function(t,n,e){return"so"===n?e.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):function(t,n){return L(t.getUTCSeconds(),n.length)}(t,n)},S:function(t,n){return function(t,n){var e=n.length,r=t.getUTCMilliseconds();return L(Math.floor(r*Math.pow(10,e-3)),n.length)}(t,n)},X:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(n){case"X":return F(i);case"XXXX":case"XX":return C(i);default:return C(i,":")}},x:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();switch(n){case"x":return F(i);case"xxxx":case"xx":return C(i);default:return C(i,":")}},O:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+R(i,":");default:return"GMT"+C(i,":")}},z:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+R(i,":");default:return"GMT"+C(i,":")}},t:function(t,n,e,r){return L(Math.floor((r._originalDate||t).getTime()/1e3),n.length)},T:function(t,n,e,r){return L((r._originalDate||t).getTime(),n.length)}};function R(t,n){var e=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;if(0===o)return e+String(i);var a=n||"";return e+String(i)+a+L(o,2)}function F(t,n){return t%60==0?(t>0?"-":"+")+L(Math.abs(t)/60,2):C(t,n)}function C(t,n){var e=n||"",r=t>0?"-":"+",i=Math.abs(t);return r+L(Math.floor(i/60),2)+e+L(i%60,2)}var G=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});default:return n.date({width:"full"})}},U=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});default:return n.time({width:"full"})}},_={p:U,P:function(t,n){var e,r=t.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return G(t,n);switch(i){case"P":e=n.dateTime({width:"short"});break;case"PP":e=n.dateTime({width:"medium"});break;case"PPP":e=n.dateTime({width:"long"});break;default:e=n.dateTime({width:"full"})}return e.replace("{{date}}",G(i,n)).replace("{{time}}",U(o,n))}},z=["D","DD"],Q=["YY","YYYY"];function B(t){return-1!==z.indexOf(t)}function H(t){return-1!==Q.indexOf(t)}function X(t,n,e){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(n,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(n,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(n,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(n,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var $={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function I(t){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.width?String(n.width):t.defaultWidth,r=t.formats[e]||t.formats[t.defaultWidth];return r}}var J={date:I({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:I({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:I({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Z={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function V(t){return function(n,e){var r;if("formatting"===(null!=e&&e.context?String(e.context):"standalone")&&t.formattingValues){var i=t.defaultFormattingWidth||t.defaultWidth,o=null!=e&&e.width?String(e.width):i;r=t.formattingValues[o]||t.formattingValues[i]}else{var a=t.defaultWidth,u=null!=e&&e.width?String(e.width):t.defaultWidth;r=t.values[u]||t.values[a]}return r[t.argumentCallback?t.argumentCallback(n):n]}}function K(t){return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=n.match(i);if(!o)return null;var a,u=o[0],c=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],s=Array.isArray(c)?nt(c,(function(t){return t.test(u)})):tt(c,(function(t){return t.test(u)}));a=t.valueCallback?t.valueCallback(s):s,a=e.valueCallback?e.valueCallback(a):a;var d=n.slice(u.length);return{value:a,rest:d}}}function tt(t,n){for(var e in t)if(t.hasOwnProperty(e)&&n(t[e]))return e}function nt(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return e}var et,rt={code:"en-US",formatDistance:function(t,n,e){var r,i=$[t];return r="string"==typeof i?i:1===n?i.one:i.other.replace("{{count}}",n.toString()),null!=e&&e.addSuffix?e.comparison&&e.comparison>0?"in "+r:r+" ago":r},formatLong:J,formatRelative:function(t){return Z[t]},localize:{ordinalNumber:function(t){var n=Number(t),e=n%100;if(e>20||e<10)switch(e%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:V({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:V({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:V({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:V({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:V({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(et={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.match(et.matchPattern);if(!e)return null;var r=e[0],i=t.match(et.parsePattern);if(!i)return null;var o=et.valueCallback?et.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;var a=t.slice(r.length);return{value:o,rest:a}}),era:K({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:K({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:K({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:K({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:K({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},it=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ot=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,at=/^'([^]*?)'?$/,ut=/''/g,ct=/[a-zA-Z]/;function st(t,n,e){var r,i,o,a,u,c,s,d,f,h,l,w,g,b,S,E,P,O;v(2,arguments);var j=String(n),A=p(),T=null!==(r=null!==(i=null==e?void 0:e.locale)&&void 0!==i?i:A.locale)&&void 0!==r?r:rt,W=m(null!==(o=null!==(a=null!==(u=null!==(c=null==e?void 0:e.firstWeekContainsDate)&&void 0!==c?c:null==e||null===(s=e.locale)||void 0===s||null===(d=s.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==u?u:A.firstWeekContainsDate)&&void 0!==a?a:null===(f=A.locale)||void 0===f||null===(h=f.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==o?o:1);if(!(W>=1&&W<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=m(null!==(l=null!==(w=null!==(g=null!==(b=null==e?void 0:e.weekStartsOn)&&void 0!==b?b:null==e||null===(S=e.locale)||void 0===S||null===(E=S.options)||void 0===E?void 0:E.weekStartsOn)&&void 0!==g?g:A.weekStartsOn)&&void 0!==w?w:null===(P=A.locale)||void 0===P||null===(O=P.options)||void 0===O?void 0:O.weekStartsOn)&&void 0!==l?l:0);if(!(k>=0&&k<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!T.localize)throw new RangeError("locale must contain localize property");if(!T.formatLong)throw new RangeError("locale must contain formatLong property");var Y=y(t);if(!D(Y))throw new RangeError("Invalid time value");var q=M(Y),L=x(Y,q),R={firstWeekContainsDate:W,weekStartsOn:k,locale:T,_originalDate:Y},F=j.match(ot).map((function(t){var n=t[0];return"p"===n||"P"===n?(0,_[n])(t,T.formatLong):t})).join("").match(it).map((function(r){if("''"===r)return"'";var i=r[0];if("'"===i)return dt(r);var o=N[i];if(o)return null!=e&&e.useAdditionalWeekYearTokens||!H(r)||X(r,n,String(t)),null!=e&&e.useAdditionalDayOfYearTokens||!B(r)||X(r,n,String(t)),o(L,r,T.localize,R);if(i.match(ct))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return r})).join("");return F}function dt(t){var n=t.match(at);return n?n[1].replace(ut,"'"):t}function ft(t){return ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ft(t)}function ht(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return lt(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?lt(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lt(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}var mt={normalizePrecision:function(t){var n=t.reduce((function(t,n){return Math.max(t.getPrecision(),n.getPrecision())}));return t.map((function(t){return t.getPrecision()!==n?t.convertPrecision(n):t}))},minimum:function(t){var n=ht(t),e=n[0],r=n.slice(1),i=e;return r.forEach((function(t){i=i.lessThan(t)?i:t})),i},maximum:function(t){var n=ht(t),e=n[0],r=n.slice(1),i=e;return r.forEach((function(t){i=i.greaterThan(t)?i:t})),i}};function vt(t){return!isNaN(parseInt(t))&&isFinite(t)}function wt(t){return t%2==0}function yt(t){return vt(t)&&!Number.isInteger(t)}function gt(t){return Math.abs(t)%1==.5}function bt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var e in n)t.setRequestHeader(e,n[e]);return t}function pt(t){return void 0===t}function Mt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",e={};return Object.entries(t).forEach((function(t){if("object"===ft(t[1])){var r=Mt(t[1]);Object.entries(r).forEach((function(r){e[t[0]+n+r[0]]=r[1]}))}else e[t[0]]=t[1]})),e}function St(){var t={HALF_ODD:function(t){var n=Math.round(t);return gt(t)&&wt(n)?n-1:n},HALF_EVEN:function(t){var n=Math.round(t);return gt(t)?wt(n)?n:n-1:n},HALF_UP:function(t){return Math.round(t)},HALF_DOWN:function(t){return gt(t)?Math.floor(t):Math.round(t)},HALF_TOWARDS_ZERO:function(t){return gt(t)?Math.sign(t)*Math.floor(Math.abs(t)):Math.round(t)},HALF_AWAY_FROM_ZERO:function(t){return gt(t)?Math.sign(t)*Math.ceil(Math.abs(t)):Math.round(t)},DOWN:function(t){return Math.floor(t)}};return{add:function(t,n){return t+n},subtract:function(t,n){return t-n},multiply:function(t,n){return yt(t)||yt(n)?function(t,n){var e=function(t){return Math.pow(10,function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0).toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var n=t.split(".")[1];return n?n.length:0}(t))},r=Math.max(e(t),e(n));return Math.round(t*r)*Math.round(n*r)/(r*r)}(t,n):t*n},divide:function(t,n){return t/n},modulo:function(t,n){return t%n},round:function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN";return t[e](n)}}}var Et=St();function Dt(t){var n=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(t);return{getMatches:function(){return null!==n?n.slice(1).filter((function(t){return!pt(t)})):[]},getMinimumFractionDigits:function(){var t=function(t){return"."===t};return pt(this.getMatches().find(t))?0:this.getMatches()[Et.add(this.getMatches().findIndex(t),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find((function(t){return"USD"===t||"dollar"===t||"$"===t}))]},getStyle:function(){return pt(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!pt(this.getMatches().find((function(t){return","===t})))}}}function xt(t){var n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;for(var e in n)t=t.replace("{{".concat(e,"}}"),n[e]);return t};return{getExchangeRate:function(e,r){return(i=t.endpoint,!Boolean(i)||"object"!==ft(i)&&"function"!=typeof i||"function"!=typeof i.then?function(e,r){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(e,r){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===i.readyState&&(i.status>=200&&i.status<400?e(JSON.parse(i.responseText)):r(new Error(i.statusText)))},onerror:function(){r(new Error("Network error"))}});i.open("GET",t,!0),bt(i,n.headers),i.send()}))}(n(t.endpoint,{from:e,to:r}),{headers:t.headers})}(e,r):t.endpoint).then((function(i){return Mt(i)[n(t.propertyPath,{from:e,to:r})]}));var i}}}function Pt(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!t)throw new e(n)}function Ot(t){Pt(function(t){return vt(t)&&t<=100&&t>=0}(t),"You must provide a numeric value between 0 and 100.",RangeError)}function jt(t){Pt(Number.isInteger(t),"You must provide an integer.",TypeError)}var At=St(),Tt=Object.assign((function t(n){var e=Object.assign({},{amount:t.defaultAmount,currency:t.defaultCurrency,precision:t.defaultPrecision},n),r=e.amount,i=e.currency,o=e.precision;jt(r),jt(o);var a=t.globalLocale,u=t.globalFormat,c=t.globalRoundingMode,s=t.globalFormatRoundingMode,d=Object.assign({},t.globalExchangeRatesApi),f=function(n){var e=Object.assign({},Object.assign({},{amount:r,currency:i,precision:o},n),Object.assign({},{locale:this.locale},n));return Object.assign(t({amount:e.amount,currency:e.currency,precision:e.precision}),{locale:e.locale})},h=function(t){Pt(this.hasSameCurrency(t),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return i},getLocale:function(){return this.locale||a},setLocale:function(t){return f.call(this,{locale:t})},getPrecision:function(){return o},convertPrecision:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;jt(t);var e=this.getPrecision(),r=t>e,i=r?At.multiply:At.divide,o=r?[t,e]:[e,t],a=Math.pow(10,At.subtract.apply(At,o));return f.call(this,{amount:At.round(i(this.getAmount(),a),n),precision:t})},add:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return f.call(this,{amount:At.add(e[0].getAmount(),e[1].getAmount()),precision:e[0].getPrecision()})},subtract:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return f.call(this,{amount:At.subtract(e[0].getAmount(),e[1].getAmount()),precision:e[0].getPrecision()})},multiply:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return f.call(this,{amount:At.round(At.multiply(this.getAmount(),t),n)})},divide:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return f.call(this,{amount:At.round(At.divide(this.getAmount(),t),n)})},percentage:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return Ot(t),this.multiply(At.divide(t,100),n)},allocate:function(t){var n=this;!function(t){Pt(function(t){return t.length>0&&t.every((function(t){return t>=0}))&&t.some((function(t){return t>0}))}(t),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(t);for(var e=t.reduce((function(t,n){return At.add(t,n)})),r=this.getAmount(),i=t.map((function(t){var i=Math.floor(At.divide(At.multiply(n.getAmount(),t),e));return r=At.subtract(r,i),f.call(n,{amount:i})})),o=0;r>0;)t[o]>0&&(i[o]=i[o].add(f.call(this,{amount:1})),r=At.subtract(r,1)),o+=1;return i},convert:function(t){var n=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.endpoint,i=void 0===r?d.endpoint:r,o=e.propertyPath,a=void 0===o?d.propertyPath||"rates.{{to}}":o,u=e.headers,s=void 0===u?d.headers:u,h=e.roundingMode,l=void 0===h?c:h,m=Object.assign({},{endpoint:i,propertyPath:a,headers:s,roundingMode:l});return xt(m).getExchangeRate(this.getCurrency(),t).then((function(e){return Pt(!pt(e),'No rate was found for the destination currency "'.concat(t,'".'),TypeError),f.call(n,{amount:At.round(At.multiply(n.getAmount(),parseFloat(e)),m.roundingMode),currency:t})}))},equalsTo:function(t){return this.hasSameAmount(t)&&this.hasSameCurrency(t)},lessThan:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()<e[1].getAmount()},lessThanOrEqual:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()<=e[1].getAmount()},greaterThan:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()>e[1].getAmount()},greaterThanOrEqual:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()>=e[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==At.modulo(this.getAmount(),Math.pow(10,o))},hasCents:function(){return 0!==At.modulo(this.getAmount(),Math.pow(10,o))},hasSameCurrency:function(t){return this.getCurrency()===t.getCurrency()},hasSameAmount:function(n){var e=t.normalizePrecision([this,n]);return e[0].getAmount()===e[1].getAmount()},toFormat:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,e=Dt(t);return this.toRoundedUnit(e.getMinimumFractionDigits(),n).toLocaleString(this.getLocale(),{currencyDisplay:e.getCurrencyDisplay(),useGrouping:e.getUseGrouping(),minimumFractionDigits:e.getMinimumFractionDigits(),style:e.getStyle(),currency:this.getCurrency()})},toUnit:function(){return At.divide(this.getAmount(),Math.pow(10,o))},toRoundedUnit:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,e=Math.pow(10,t);return At.divide(At.round(At.multiply(this.toUnit(),e),n),e)},toObject:function(){return{amount:r,currency:i,precision:o}},toJSON:function(){return this.toObject()}}}),{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},{globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}},mt);const Wt=class{constructor(n){t(this,n),this.accountId=void 0,this.auth={},this.payments=[]}requestPropsChanged(){this.fetchData()}fetchData(){const t=`account/${this.accountId}/payments`;(t=>{async function n(){return{Authorization:`Bearer ${t}`,"Idempotency-Key":c(),"Content-Type":"application/json"}}async function e(t,e,r,i,o){const a=`http://localhost:3000/v1/${t}`,u=r?`${a}?${new URLSearchParams(r)}`:a,c=await fetch(u,{method:e,headers:await n(),body:i,signal:o});if(c)return 204===c.status?{}:c.json();!function(t){console.error(`Error fetching from ${t}`)}(u)}return{get:async function(t,n,r){return e(t,"GET",n,null,r)},post:async function(t,n,r,i){return e(t,"POST",r,n,i)},patch:async function(t,n,r,i){return e(t,"PATCH",r,n,i)},destroy:async function(t,n,r){return e(t,"DELETE",n,null,r)}}})(this.auth.token).get(t).then((t=>{const n=t.data.map((t=>new l(t)));this.payments=n}))}render(){return n(e,null,n("table",{class:"justifi-table"},n("thead",null,n("tr",null,n("th",{scope:"col",title:"The date and time each payment was made"},"Made on"),n("th",{scope:"col",title:"The dollar amount of each payment"},"Amount"),n("th",{scope:"col"},"Account"),n("th",{scope:"col"},"Description"),n("th",{scope:"col"},"Payment ID"),n("th",{scope:"col"},"Cardholder"),n("th",{scope:"col"},"Payment Method"),n("th",{scope:"col"},"Status"))),n("tbody",null,this.payments.map((t=>{var e,r,i,o,a;n("tr",null,n("td",null,n("div",null,(a=t.created_at)?st(new Date(a),"MMM d, yyyy"):""),n("div",null,function(t){return t?st(new Date(t),"h:mmaaa"):""}(t.created_at))),n("td",null,function(t,n=!0){function e(t){const e=n?"$0,0.00":"0,0.00";return Tt({amount:t,currency:"USD"}).toFormat(e)}return t||(t=0),t<0?`(${e(-t)})`:e(t)}(t.amount)),n("td",null,t.account_id),n("td",null,t.description),n("td",null,t.id),n("td",null,null===(r=null===(e=t.payment_method)||void 0===e?void 0:e.card)||void 0===r?void 0:r.name),n("td",null,null===(o=null===(i=t.payment_method)||void 0===i?void 0:i.card)||void 0===o?void 0:o.acct_last_four),n("td",null,t.status))})))))}static get watchers(){return{accountId:["requestPropsChanged"],auth:["requestPropsChanged"]}}};Wt.style=":host{display:block}";export{Wt as justifi_payments_list}
@@ -1,2 +0,0 @@
1
- let e,n,t=!1;const l={},o=e=>"object"==(e=typeof e)||"function"===e;function s(e){var n,t,l;return null!==(l=null===(t=null===(n=e.head)||void 0===n?void 0:n.querySelector('meta[name="csp-nonce"]'))||void 0===t?void 0:t.getAttribute("content"))&&void 0!==l?l:void 0}const c=(e,n,...t)=>{let l=null,s=!1,c=!1;const r=[],u=n=>{for(let t=0;t<n.length;t++)l=n[t],Array.isArray(l)?u(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!o(l))&&(l+=""),s&&c?r[r.length-1].t+=l:r.push(s?i(null,l):l),c=s)};if(u(t),n){const e=n.className||n.class;e&&(n.class="object"!=typeof e?e:Object.keys(e).filter((n=>e[n])).join(" "))}const a=i(e,null);return a.l=n,r.length>0&&(a.o=r),a},i=(e,n)=>({i:0,u:e,t:n,h:null,o:null,l:null}),r={},u=(e,n,t)=>{const l=(e=>V(e).m)(e);return{emit:e=>a(l,n,{bubbles:!!(4&t),composed:!!(2&t),cancelable:!!(1&t),detail:e})}},a=(e,n,t)=>{const l=X.ce(n,t);return e.dispatchEvent(l),l},f=new WeakMap,d=e=>"sc-"+e.$,h=(e,n,t,l,s,c)=>{if(t!==l){let i=B(e,n),r=n.toLowerCase();if("class"===n){const n=e.classList,o=y(t),s=y(l);n.remove(...o.filter((e=>e&&!s.includes(e)))),n.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===n){for(const n in t)l&&null!=l[n]||(n.includes("-")?e.style.removeProperty(n):e.style[n]="");for(const n in l)t&&l[n]===t[n]||(n.includes("-")?e.style.setProperty(n,l[n]):e.style[n]=l[n])}else if("ref"===n)l&&l(e);else if(i||"o"!==n[0]||"n"!==n[1]){const r=o(l);if((i||r&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[n]=l;else{const o=null==l?"":l;"list"===n?i=!1:null!=t&&e[n]==o||(e[n]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(n)||e.removeAttribute(n):(!i||4&c||s)&&!r&&e.setAttribute(n,l=!0===l?"":l)}else n="-"===n[2]?n.slice(3):B(K,r)?r.slice(2):r[2]+n.slice(3),t&&X.rel(e,n,t,!1),l&&X.ael(e,n,l,!1)}},m=/\s/,y=e=>e?e.split(m):[],$=(e,n,t,o)=>{const s=11===n.h.nodeType&&n.h.host?n.h.host:n.h,c=e&&e.l||l,i=n.l||l;for(o in c)o in i||h(s,o,c[o],void 0,t,n.i);for(o in i)h(s,o,c[o],i[o],t,n.i)},p=(n,t,l)=>{const o=t.o[l];let s,c,i=0;if(null!==o.t)s=o.h=Q.createTextNode(o.t);else if(s=o.h=Q.createElement(o.u),$(null,o,!1),null!=e&&s["s-si"]!==e&&s.classList.add(s["s-si"]=e),o.o)for(i=0;i<o.o.length;++i)c=p(n,o,i),c&&s.appendChild(c);return s},b=(e,t,l,o,s,c)=>{let i,r=e;for(r.shadowRoot&&r.tagName===n&&(r=r.shadowRoot);s<=c;++s)o[s]&&(i=p(null,l,s),i&&(o[s].h=i,r.insertBefore(i,t)))},w=(e,n,t,l,o)=>{for(;n<=t;++n)(l=e[n])&&(o=l.h,g(l),o.remove())},v=(e,n)=>e.u===n.u,S=(e,n)=>{const t=n.h=e.h,l=e.o,o=n.o,s=n.t;null===s?($(e,n,!1),null!==l&&null!==o?((e,n,t,l)=>{let o,s=0,c=0,i=n.length-1,r=n[0],u=n[i],a=l.length-1,f=l[0],d=l[a];for(;s<=i&&c<=a;)null==r?r=n[++s]:null==u?u=n[--i]:null==f?f=l[++c]:null==d?d=l[--a]:v(r,f)?(S(r,f),r=n[++s],f=l[++c]):v(u,d)?(S(u,d),u=n[--i],d=l[--a]):v(r,d)?(S(r,d),e.insertBefore(r.h,u.h.nextSibling),r=n[++s],d=l[--a]):v(u,f)?(S(u,f),e.insertBefore(u.h,r.h),u=n[--i],f=l[++c]):(o=p(n&&n[c],t,c),f=l[++c],o&&r.h.parentNode.insertBefore(o,r.h));s>i?b(e,null==l[a+1]?null:l[a+1].h,t,l,c,a):c>a&&w(n,s,i)})(t,l,n,o):null!==o?(null!==e.t&&(t.textContent=""),b(t,null,n,o,0,o.length-1)):null!==l&&w(l,0,l.length-1)):e.t!==s&&(t.data=s)},g=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(g)},j=(e,n)=>{n&&!e.p&&n["s-p"]&&n["s-p"].push(new Promise((n=>e.p=n)))},k=(e,n)=>{if(e.i|=16,!(4&e.i))return j(e,e.v),ce((()=>C(e,n)));e.i|=512},C=(e,n)=>{const t=e.S;let l;return n&&(e.i|=256,e.g&&(e.g.map((([e,n])=>E(t,e,n))),e.g=null),l=E(t,"componentWillLoad")),L(l,(()=>M(e,t,n)))},M=async(e,n,t)=>{const l=e.m,o=l["s-rc"];t&&(e=>{const n=e.j,t=e.m,l=n.i,o=((e,n)=>{var t;let l=d(n);const o=J.get(l);if(e=11===e.nodeType?e:Q,o)if("string"==typeof o){let n,c=f.get(e=e.head||e);if(c||f.set(e,c=new Set),!c.has(l)){{n=Q.createElement("style"),n.innerHTML=o;const l=null!==(t=X.k)&&void 0!==t?t:s(Q);null!=l&&n.setAttribute("nonce",l),e.insertBefore(n,e.querySelector("link"))}c&&c.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(t.shadowRoot?t.shadowRoot:t.getRootNode(),n);10&l&&(t["s-sc"]=o,t.classList.add(o+"-h"))})(e);O(e,n),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const n=l["s-p"],t=()=>P(e);0===n.length?t():(Promise.all(n).then(t),e.i|=4,n.length=0)}},O=(t,l)=>{try{l=l.render(),t.i&=-17,t.i|=2,((t,l)=>{const o=t.m,s=t.C||i(null,null),u=(e=>e&&e.u===r)(l)?l:c(null,null,l);n=o.tagName,u.u=null,u.i|=4,t.C=u,u.h=s.h=o.shadowRoot||o,e=o["s-sc"],S(s,u)})(t,l)}catch(e){D(e,t.m)}return null},P=e=>{const n=e.m,t=e.v;64&e.i||(e.i|=64,N(n),e.M(n),t||x()),e.O(n),e.p&&(e.p(),e.p=void 0),512&e.i&&se((()=>k(e,!1))),e.i&=-517},x=()=>{N(Q.documentElement),se((()=>a(K,"appload",{detail:{namespace:"webcomponents"}})))},E=(e,n,t)=>{if(e&&e[n])try{return e[n](t)}catch(e){D(e)}},L=(e,n)=>e&&e.then?e.then(n):n(),N=e=>e.classList.add("hydrated"),T=(e,n,t)=>{if(n.P){e.watchers&&(n.L=e.watchers);const l=Object.entries(n.P),s=e.prototype;if(l.map((([e,[l]])=>{31&l||2&t&&32&l?Object.defineProperty(s,e,{get(){return((e,n)=>V(this).N.get(n))(0,e)},set(t){((e,n,t,l)=>{const s=V(e),c=s.m,i=s.N.get(n),r=s.i,u=s.S;if(t=((e,n)=>null==e||o(e)?e:1&n?e+"":e)(t,l.P[n][0]),(!(8&r)||void 0===i)&&t!==i&&(!Number.isNaN(i)||!Number.isNaN(t))&&(s.N.set(n,t),u)){if(l.L&&128&r){const e=l.L[n];e&&e.map((e=>{try{u[e](t,i,n)}catch(e){D(e,c)}}))}if(2==(18&r)){if(u.componentShouldUpdate&&!1===u.componentShouldUpdate(t,i,n))return;k(s,!1)}}})(this,e,t,n)},configurable:!0,enumerable:!0}):1&t&&64&l&&Object.defineProperty(s,e,{value(...n){const t=V(this);return t.T.then((()=>t.S[e](...n)))}})})),1&t){const n=new Map;s.attributeChangedCallback=function(e,t,l){X.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,n])=>15&n[0])).map((([e,t])=>{const l=t[1]||e;return n.set(l,e),l}))}}return e},W=e=>{E(e,"connectedCallback")},A=(e,n={})=>{var t;const l=[],o=n.exclude||[],c=K.customElements,i=Q.head,r=i.querySelector("meta[charset]"),u=Q.createElement("style"),a=[];let f,h=!0;Object.assign(X,n),X.W=new URL(n.resourcesUrl||"./",Q.baseURI).href,e.map((e=>{e[1].map((n=>{const t={i:n[0],$:n[1],P:n[2],A:n[3]};t.P=n[2],t.A=n[3],t.L={};const s=t.$,i=class extends HTMLElement{constructor(e){super(e),z(e=this,t),1&t.i&&e.attachShadow({mode:"open"})}connectedCallback(){f&&(clearTimeout(f),f=null),h?a.push(this):X.jmp((()=>(e=>{if(0==(1&X.i)){const n=V(e),t=n.j,l=()=>{};if(1&n.i)H(e,n,t.A),W(n.S);else{n.i|=1;{let t=e;for(;t=t.parentNode||t.host;)if(t["s-p"]){j(n,n.v=t);break}}t.P&&Object.entries(t.P).map((([n,[t]])=>{if(31&t&&e.hasOwnProperty(n)){const t=e[n];delete e[n],e[n]=t}})),(async(e,n,t,l,o)=>{if(0==(32&n.i)){{if(n.i|=32,(o=I(t)).then){const e=()=>{};o=await o,e()}o.isProxied||(t.L=o.watchers,T(o,t,2),o.isProxied=!0);const e=()=>{};n.i|=8;try{new o(n)}catch(e){D(e)}n.i&=-9,n.i|=128,e(),W(n.S)}if(o.style){let e=o.style;const n=d(t);if(!J.has(n)){const l=()=>{};((e,n,t)=>{let l=J.get(e);Z&&t?(l=l||new CSSStyleSheet,"string"==typeof l?l=n:l.replaceSync(n)):l=n,J.set(e,l)})(n,e,!!(1&t.i)),l()}}}const s=n.v,c=()=>k(n,!0);s&&s["s-rc"]?s["s-rc"].push(c):c()})(0,n,t)}l()}})(this)))}disconnectedCallback(){X.jmp((()=>(()=>{if(0==(1&X.i)){const e=V(this),n=e.S;e.H&&(e.H.map((e=>e())),e.H=void 0),E(n,"disconnectedCallback")}})()))}componentOnReady(){return V(this).R}};t.U=e[0],o.includes(s)||c.get(s)||(l.push(s),c.define(s,T(i,t,1)))}))}));{u.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",u.setAttribute("data-styles","");const e=null!==(t=X.k)&&void 0!==t?t:s(Q);null!=e&&u.setAttribute("nonce",e),i.insertBefore(u,r?r.nextSibling:i.firstChild)}h=!1,a.length?a.map((e=>e.connectedCallback())):X.jmp((()=>f=setTimeout(x,30)))},H=(e,n,t)=>{t&&t.map((([t,l,o])=>{const s=e,c=R(n,o),i=U(t);X.ael(s,l,c,i),(n.H=n.H||[]).push((()=>X.rel(s,l,c,i)))}))},R=(e,n)=>t=>{try{256&e.i?e.S[n](t):(e.g=e.g||[]).push([n,t])}catch(e){D(e)}},U=e=>0!=(2&e),q=e=>X.k=e,F=new WeakMap,V=e=>F.get(e),_=(e,n)=>F.set(n.S=e,n),z=(e,n)=>{const t={i:0,m:e,j:n,N:new Map};return t.T=new Promise((e=>t.O=e)),t.R=new Promise((e=>t.M=e)),e["s-p"]=[],e["s-rc"]=[],H(e,t,n.A),F.set(e,t)},B=(e,n)=>n in e,D=(e,n)=>(0,console.error)(e,n),G=new Map,I=e=>{const n=e.$.replace(/-/g,"_"),t=e.U,l=G.get(t);return l?l[n]:import(`./${t}.entry.js`).then((e=>(G.set(t,e),e[n])),D)
2
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},J=new Map,K="undefined"!=typeof window?window:{},Q=K.document||{head:{}},X={i:0,W:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,n,t,l)=>e.addEventListener(n,t,l),rel:(e,n,t,l)=>e.removeEventListener(n,t,l),ce:(e,n)=>new CustomEvent(e,n)},Y=e=>Promise.resolve(e),Z=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),ee=[],ne=[],te=(e,n)=>l=>{e.push(l),t||(t=!0,n&&4&X.i?se(oe):X.raf(oe))},le=e=>{for(let n=0;n<e.length;n++)try{e[n](performance.now())}catch(e){D(e)}e.length=0},oe=()=>{le(ee),le(ne),(t=ee.length>0)&&X.raf(oe)},se=e=>Y().then(e),ce=te(ne,!0);export{r as H,A as b,u as c,c as h,Y as p,_ as r,q as s}