@learncard/learn-card-plugin 1.2.21 → 1.2.23

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.
@@ -1,2 +1,2 @@
1
- "use strict";var $=Object.defineProperty;var Ee=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var Fe=Object.prototype.hasOwnProperty;var n=(r,t)=>$(r,"name",{value:t,configurable:!0});var qe=(r,t)=>{for(var e in t)$(r,e,{get:t[e],enumerable:!0})},Le=(r,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of _e(t))!Fe.call(r,o)&&o!==e&&$(r,o,{get:()=>t[o],enumerable:!(a=Ee(t,o))||a.enumerable});return r};var Ne=r=>Le($({},"__esModule",{value:!0}),r);var Ht={};qe(Ht,{getLearnCardPlugin:()=>At});module.exports=Ne(Ht);var Q=require("@learncard/types");function P(r){"@babel/helpers - typeof";return P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(r)}n(P,"_typeof");function x(r){if(r===null||r===!0||r===!1)return NaN;var t=Number(r);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}n(x,"toInteger");function d(r,t){if(t.length<r)throw new TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+t.length+" present")}n(d,"requiredArgs");function m(r){d(1,arguments);var t=Object.prototype.toString.call(r);return r instanceof Date||P(r)==="object"&&t==="[object Date]"?new Date(r.getTime()):typeof r=="number"||t==="[object Number]"?new Date(r):((typeof r=="string"||t==="[object String]")&&typeof console<"u"&&(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))}n(m,"toDate");function G(r,t){d(2,arguments);var e=m(r).getTime(),a=x(t);return new Date(e+a)}n(G,"addMilliseconds");var Ae={};function T(){return Ae}n(T,"getDefaultOptions");function J(r){var t=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return t.setUTCFullYear(r.getFullYear()),r.getTime()-t.getTime()}n(J,"getTimezoneOffsetInMilliseconds");function z(r){return d(1,arguments),r instanceof Date||P(r)==="object"&&Object.prototype.toString.call(r)==="[object Date]"}n(z,"isDate");function K(r){if(d(1,arguments),!z(r)&&typeof r!="number")return!1;var t=m(r);return!isNaN(Number(t))}n(K,"isValid");function Z(r,t){d(2,arguments);var e=x(t);return G(r,-e)}n(Z,"subMilliseconds");var He=864e5;function ee(r){d(1,arguments);var t=m(r),e=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var a=t.getTime(),o=e-a;return Math.floor(o/He)+1}n(ee,"getUTCDayOfYear");function C(r){d(1,arguments);var t=1,e=m(r),a=e.getUTCDay(),o=(a<t?7:0)+a-t;return e.setUTCDate(e.getUTCDate()-o),e.setUTCHours(0,0,0,0),e}n(C,"startOfUTCISOWeek");function F(r){d(1,arguments);var t=m(r),e=t.getUTCFullYear(),a=new Date(0);a.setUTCFullYear(e+1,0,4),a.setUTCHours(0,0,0,0);var o=C(a),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var s=C(i);return t.getTime()>=o.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}n(F,"getUTCISOWeekYear");function te(r){d(1,arguments);var t=F(r),e=new Date(0);e.setUTCFullYear(t,0,4),e.setUTCHours(0,0,0,0);var a=C(e);return a}n(te,"startOfUTCISOWeekYear");var $e=6048e5;function re(r){d(1,arguments);var t=m(r),e=C(t).getTime()-te(t).getTime();return Math.round(e/$e)+1}n(re,"getUTCISOWeek");function D(r,t){var e,a,o,i,s,f,c,l;d(1,arguments);var h=T(),p=x((e=(a=(o=(i=t?.weekStartsOn)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(f=s.options)===null||f===void 0?void 0:f.weekStartsOn)!==null&&o!==void 0?o:h.weekStartsOn)!==null&&a!==void 0?a:(c=h.locale)===null||c===void 0||(l=c.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&e!==void 0?e:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=m(r),v=g.getUTCDay(),w=(v<p?7:0)+v-p;return g.setUTCDate(g.getUTCDate()-w),g.setUTCHours(0,0,0,0),g}n(D,"startOfUTCWeek");function q(r,t){var e,a,o,i,s,f,c,l;d(1,arguments);var h=m(r),p=h.getUTCFullYear(),g=T(),v=x((e=(a=(o=(i=t?.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(f=s.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&o!==void 0?o:g.firstWeekContainsDate)!==null&&a!==void 0?a:(c=g.locale)===null||c===void 0||(l=c.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&e!==void 0?e:1);if(!(v>=1&&v<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=new Date(0);w.setUTCFullYear(p+1,0,v),w.setUTCHours(0,0,0,0);var I=D(w,t),S=new Date(0);S.setUTCFullYear(p,0,v),S.setUTCHours(0,0,0,0);var U=D(S,t);return h.getTime()>=I.getTime()?p+1:h.getTime()>=U.getTime()?p:p-1}n(q,"getUTCWeekYear");function ae(r,t){var e,a,o,i,s,f,c,l;d(1,arguments);var h=T(),p=x((e=(a=(o=(i=t?.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(f=s.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&o!==void 0?o:h.firstWeekContainsDate)!==null&&a!==void 0?a:(c=h.locale)===null||c===void 0||(l=c.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&e!==void 0?e:1),g=q(r,t),v=new Date(0);v.setUTCFullYear(g,0,p),v.setUTCHours(0,0,0,0);var w=D(v,t);return w}n(ae,"startOfUTCWeekYear");var Qe=6048e5;function oe(r,t){d(1,arguments);var e=m(r),a=D(e,t).getTime()-ae(e,t).getTime();return Math.round(a/Qe)+1}n(oe,"getUTCWeek");function u(r,t){for(var e=r<0?"-":"",a=Math.abs(r).toString();a.length<t;)a="0"+a;return e+a}n(u,"addLeadingZeros");var Ve={y:n(function(t,e){var a=t.getUTCFullYear(),o=a>0?a:1-a;return u(e==="yy"?o%100:o,e.length)},"y"),M:n(function(t,e){var a=t.getUTCMonth();return e==="M"?String(a+1):u(a+1,2)},"M"),d:n(function(t,e){return u(t.getUTCDate(),e.length)},"d"),a:n(function(t,e){var a=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},"a"),h:n(function(t,e){return u(t.getUTCHours()%12||12,e.length)},"h"),H:n(function(t,e){return u(t.getUTCHours(),e.length)},"H"),m:n(function(t,e){return u(t.getUTCMinutes(),e.length)},"m"),s:n(function(t,e){return u(t.getUTCSeconds(),e.length)},"s"),S:n(function(t,e){var a=e.length,o=t.getUTCMilliseconds(),i=Math.floor(o*Math.pow(10,a-3));return u(i,e.length)},"S")},O=Ve;var Y={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Re={G:n(function(t,e,a){var o=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return a.era(o,{width:"abbreviated"});case"GGGGG":return a.era(o,{width:"narrow"});case"GGGG":default:return a.era(o,{width:"wide"})}},"G"),y:n(function(t,e,a){if(e==="yo"){var o=t.getUTCFullYear(),i=o>0?o:1-o;return a.ordinalNumber(i,{unit:"year"})}return O.y(t,e)},"y"),Y:n(function(t,e,a,o){var i=q(t,o),s=i>0?i:1-i;if(e==="YY"){var f=s%100;return u(f,2)}return e==="Yo"?a.ordinalNumber(s,{unit:"year"}):u(s,e.length)},"Y"),R:n(function(t,e){var a=F(t);return u(a,e.length)},"R"),u:n(function(t,e){var a=t.getUTCFullYear();return u(a,e.length)},"u"),Q:n(function(t,e,a){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(o);case"QQ":return u(o,2);case"Qo":return a.ordinalNumber(o,{unit:"quarter"});case"QQQ":return a.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(o,{width:"wide",context:"formatting"})}},"Q"),q:n(function(t,e,a){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(o);case"qq":return u(o,2);case"qo":return a.ordinalNumber(o,{unit:"quarter"});case"qqq":return a.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(o,{width:"wide",context:"standalone"})}},"q"),M:n(function(t,e,a){var o=t.getUTCMonth();switch(e){case"M":case"MM":return O.M(t,e);case"Mo":return a.ordinalNumber(o+1,{unit:"month"});case"MMM":return a.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(o,{width:"wide",context:"formatting"})}},"M"),L:n(function(t,e,a){var o=t.getUTCMonth();switch(e){case"L":return String(o+1);case"LL":return u(o+1,2);case"Lo":return a.ordinalNumber(o+1,{unit:"month"});case"LLL":return a.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(o,{width:"wide",context:"standalone"})}},"L"),w:n(function(t,e,a,o){var i=oe(t,o);return e==="wo"?a.ordinalNumber(i,{unit:"week"}):u(i,e.length)},"w"),I:n(function(t,e,a){var o=re(t);return e==="Io"?a.ordinalNumber(o,{unit:"week"}):u(o,e.length)},"I"),d:n(function(t,e,a){return e==="do"?a.ordinalNumber(t.getUTCDate(),{unit:"date"}):O.d(t,e)},"d"),D:n(function(t,e,a){var o=ee(t);return e==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):u(o,e.length)},"D"),E:n(function(t,e,a){var o=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return a.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(o,{width:"short",context:"formatting"});case"EEEE":default:return a.day(o,{width:"wide",context:"formatting"})}},"E"),e:n(function(t,e,a,o){var i=t.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return u(s,2);case"eo":return a.ordinalNumber(s,{unit:"day"});case"eee":return a.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(i,{width:"short",context:"formatting"});case"eeee":default:return a.day(i,{width:"wide",context:"formatting"})}},"e"),c:n(function(t,e,a,o){var i=t.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return u(s,e.length);case"co":return a.ordinalNumber(s,{unit:"day"});case"ccc":return a.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(i,{width:"narrow",context:"standalone"});case"cccccc":return a.day(i,{width:"short",context:"standalone"});case"cccc":default:return a.day(i,{width:"wide",context:"standalone"})}},"c"),i:n(function(t,e,a){var o=t.getUTCDay(),i=o===0?7:o;switch(e){case"i":return String(i);case"ii":return u(i,e.length);case"io":return a.ordinalNumber(i,{unit:"day"});case"iii":return a.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(o,{width:"short",context:"formatting"});case"iiii":default:return a.day(o,{width:"wide",context:"formatting"})}},"i"),a:n(function(t,e,a){var o=t.getUTCHours(),i=o/12>=1?"pm":"am";switch(e){case"a":case"aa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},"a"),b:n(function(t,e,a){var o=t.getUTCHours(),i;switch(o===12?i=Y.noon:o===0?i=Y.midnight:i=o/12>=1?"pm":"am",e){case"b":case"bb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},"b"),B:n(function(t,e,a){var o=t.getUTCHours(),i;switch(o>=17?i=Y.evening:o>=12?i=Y.afternoon:o>=4?i=Y.morning:i=Y.night,e){case"B":case"BB":case"BBB":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},"B"),h:n(function(t,e,a){if(e==="ho"){var o=t.getUTCHours()%12;return o===0&&(o=12),a.ordinalNumber(o,{unit:"hour"})}return O.h(t,e)},"h"),H:n(function(t,e,a){return e==="Ho"?a.ordinalNumber(t.getUTCHours(),{unit:"hour"}):O.H(t,e)},"H"),K:n(function(t,e,a){var o=t.getUTCHours()%12;return e==="Ko"?a.ordinalNumber(o,{unit:"hour"}):u(o,e.length)},"K"),k:n(function(t,e,a){var o=t.getUTCHours();return o===0&&(o=24),e==="ko"?a.ordinalNumber(o,{unit:"hour"}):u(o,e.length)},"k"),m:n(function(t,e,a){return e==="mo"?a.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):O.m(t,e)},"m"),s:n(function(t,e,a){return e==="so"?a.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):O.s(t,e)},"s"),S:n(function(t,e){return O.S(t,e)},"S"),X:n(function(t,e,a,o){var i=o._originalDate||t,s=i.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return fe(s);case"XXXX":case"XX":return k(s);case"XXXXX":case"XXX":default:return k(s,":")}},"X"),x:n(function(t,e,a,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(e){case"x":return fe(s);case"xxxx":case"xx":return k(s);case"xxxxx":case"xxx":default:return k(s,":")}},"x"),O:n(function(t,e,a,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+se(s,":");case"OOOO":default:return"GMT"+k(s,":")}},"O"),z:n(function(t,e,a,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+se(s,":");case"zzzz":default:return"GMT"+k(s,":")}},"z"),t:n(function(t,e,a,o){var i=o._originalDate||t,s=Math.floor(i.getTime()/1e3);return u(s,e.length)},"t"),T:n(function(t,e,a,o){var i=o._originalDate||t,s=i.getTime();return u(s,e.length)},"T")};function se(r,t){var e=r>0?"-":"+",a=Math.abs(r),o=Math.floor(a/60),i=a%60;if(i===0)return e+String(o);var s=t||"";return e+String(o)+s+u(i,2)}n(se,"formatTimezoneShort");function fe(r,t){if(r%60===0){var e=r>0?"-":"+";return e+u(Math.abs(r)/60,2)}return k(r,t)}n(fe,"formatTimezoneWithOptionalMinutes");function k(r,t){var e=t||"",a=r>0?"-":"+",o=Math.abs(r),i=u(Math.floor(o/60),2),s=u(o%60,2);return a+i+e+s}n(k,"formatTimezone");var ue=Re;var de=n(function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},"dateLongFormatter"),le=n(function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},"timeLongFormatter"),Be=n(function(t,e){var a=t.match(/(P+)(p+)?/)||[],o=a[1],i=a[2];if(!i)return de(t,e);var s;switch(o){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",de(o,e)).replace("{{time}}",le(i,e))},"dateTimeLongFormatter"),Xe={p:le,P:Be},me=Xe;var je=["D","DD"],Ge=["YY","YYYY"];function ce(r){return je.indexOf(r)!==-1}n(ce,"isProtectedDayOfYearToken");function pe(r){return Ge.indexOf(r)!==-1}n(pe,"isProtectedWeekYearToken");function ne(r,t,e){if(r==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(r==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(r==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) 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(r==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}n(ne,"throwProtectedError");var Je={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"}},ze=n(function(t,e,a){var o,i=Je[t];return typeof i=="string"?o=i:e===1?o=i.one:o=i.other.replace("{{count}}",e.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"in "+o:o+" ago":o},"formatDistance"),he=ze;function L(r){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.width?String(t.width):r.defaultWidth,a=r.formats[e]||r.formats[r.defaultWidth];return a}}n(L,"buildFormatLongFn");var Ke={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ze={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},et={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},tt={date:L({formats:Ke,defaultWidth:"full"}),time:L({formats:Ze,defaultWidth:"full"}),dateTime:L({formats:et,defaultWidth:"full"})},ve=tt;var rt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},at=n(function(t,e,a,o){return rt[t]},"formatRelative"),ge=at;function M(r){return function(t,e){var a=e!=null&&e.context?String(e.context):"standalone",o;if(a==="formatting"&&r.formattingValues){var i=r.defaultFormattingWidth||r.defaultWidth,s=e!=null&&e.width?String(e.width):i;o=r.formattingValues[s]||r.formattingValues[i]}else{var f=r.defaultWidth,c=e!=null&&e.width?String(e.width):r.defaultWidth;o=r.values[c]||r.values[f]}var l=r.argumentCallback?r.argumentCallback(t):t;return o[l]}}n(M,"buildLocalizeFn");var ot={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},nt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},it={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"]},st={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"]},ft={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"}},ut={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"}},dt=n(function(t,e){var a=Number(t),o=a%100;if(o>20||o<10)switch(o%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},"ordinalNumber"),lt={ordinalNumber:dt,era:M({values:ot,defaultWidth:"wide"}),quarter:M({values:nt,defaultWidth:"wide",argumentCallback:n(function(t){return t-1},"argumentCallback")}),month:M({values:it,defaultWidth:"wide"}),day:M({values:st,defaultWidth:"wide"}),dayPeriod:M({values:ft,defaultWidth:"wide",formattingValues:ut,defaultFormattingWidth:"wide"})},xe=lt;function W(r){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=e.width,o=a&&r.matchPatterns[a]||r.matchPatterns[r.defaultMatchWidth],i=t.match(o);if(!i)return null;var s=i[0],f=a&&r.parsePatterns[a]||r.parsePatterns[r.defaultParseWidth],c=Array.isArray(f)?ct(f,function(p){return p.test(s)}):mt(f,function(p){return p.test(s)}),l;l=r.valueCallback?r.valueCallback(c):c,l=e.valueCallback?e.valueCallback(l):l;var h=t.slice(s.length);return{value:l,rest:h}}}n(W,"buildMatchFn");function mt(r,t){for(var e in r)if(r.hasOwnProperty(e)&&t(r[e]))return e}n(mt,"findKey");function ct(r,t){for(var e=0;e<r.length;e++)if(t(r[e]))return e}n(ct,"findIndex");function ie(r){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=t.match(r.matchPattern);if(!a)return null;var o=a[0],i=t.match(r.parsePattern);if(!i)return null;var s=r.valueCallback?r.valueCallback(i[0]):i[0];s=e.valueCallback?e.valueCallback(s):s;var f=t.slice(o.length);return{value:s,rest:f}}}n(ie,"buildMatchPatternFn");var pt=/^(\d+)(th|st|nd|rd)?/i,ht=/\d+/i,vt={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},gt={any:[/^b/i,/^(a|c)/i]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},yt={any:[/1/i,/2/i,/3/i,/4/i]},wt={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},Ot={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]},bt={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},Tt={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]},Ct={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},Dt={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}},St={ordinalNumber:ie({matchPattern:pt,parsePattern:ht,valueCallback:n(function(t){return parseInt(t,10)},"valueCallback")}),era:W({matchPatterns:vt,defaultMatchWidth:"wide",parsePatterns:gt,defaultParseWidth:"any"}),quarter:W({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:yt,defaultParseWidth:"any",valueCallback:n(function(t){return t+1},"valueCallback")}),month:W({matchPatterns:wt,defaultMatchWidth:"wide",parsePatterns:Ot,defaultParseWidth:"any"}),day:W({matchPatterns:bt,defaultMatchWidth:"wide",parsePatterns:Tt,defaultParseWidth:"any"}),dayPeriod:W({matchPatterns:Ct,defaultMatchWidth:"any",parsePatterns:Dt,defaultParseWidth:"any"})},ye=St;var kt={code:"en-US",formatDistance:he,formatLong:ve,formatRelative:ge,localize:xe,match:ye,options:{weekStartsOn:0,firstWeekContainsDate:1}},we=kt;var Oe=we;var Mt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Wt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Pt=/^'([^]*?)'?$/,Yt=/''/g,It=/[a-zA-Z]/;function N(r,t,e){var a,o,i,s,f,c,l,h,p,g,v,w,I,S,U,V,R,B;d(2,arguments);var We=String(t),E=T(),_=(a=(o=e?.locale)!==null&&o!==void 0?o:E.locale)!==null&&a!==void 0?a:Oe,X=x((i=(s=(f=(c=e?.firstWeekContainsDate)!==null&&c!==void 0?c:e==null||(l=e.locale)===null||l===void 0||(h=l.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&f!==void 0?f:E.firstWeekContainsDate)!==null&&s!==void 0?s:(p=E.locale)===null||p===void 0||(g=p.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(X>=1&&X<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=x((v=(w=(I=(S=e?.weekStartsOn)!==null&&S!==void 0?S:e==null||(U=e.locale)===null||U===void 0||(V=U.options)===null||V===void 0?void 0:V.weekStartsOn)!==null&&I!==void 0?I:E.weekStartsOn)!==null&&w!==void 0?w:(R=E.locale)===null||R===void 0||(B=R.options)===null||B===void 0?void 0:B.weekStartsOn)!==null&&v!==void 0?v:0);if(!(j>=0&&j<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!_.localize)throw new RangeError("locale must contain localize property");if(!_.formatLong)throw new RangeError("locale must contain formatLong property");var A=m(r);if(!K(A))throw new RangeError("Invalid time value");var Pe=J(A),Ye=Z(A,Pe),Ie={firstWeekContainsDate:X,weekStartsOn:j,locale:_,_originalDate:A},Ue=We.match(Wt).map(function(y){var b=y[0];if(b==="p"||b==="P"){var H=me[b];return H(y,_.formatLong)}return y}).join("").match(Mt).map(function(y){if(y==="''")return"'";var b=y[0];if(b==="'")return Ut(y);var H=ue[b];if(H)return!(e!=null&&e.useAdditionalWeekYearTokens)&&pe(y)&&ne(y,t,String(r)),!(e!=null&&e.useAdditionalDayOfYearTokens)&&ce(y)&&ne(y,t,String(r)),H(Ye,y,_.localize,Ie);if(b.match(It))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return y}).join("");return Ue}n(N,"format");function Ut(r){var t=r.match(Pt);return t?t[1].replace(Yt,"'"):r}n(Ut,"cleanEscapedString");var Et=new Set(["status","credentialStatus"]),Te=n(r=>Et.has(r),"isStatusCheck"),Ce=n(r=>{switch(r){case"revocation":return"Revocation";case"suspension":return"Suspension";default:return r.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase())}},"getStatusPurposeLabel"),_t=n(r=>{switch(r){case"revocation":return"Not Revoked";case"suspension":return"Not Suspended";default:return`${Ce(r)} Clear`}},"getClearStatusMessage"),De=n(r=>{switch(r){case"revocation":return"Revoked";case"suspension":return"Suspended";default:return`${Ce(r)} Set`}},"getSetStatusMessage"),be=n(r=>[...new Set(r.map(t=>t.statusPurpose))],"getUniqueStatusPurposes"),Se=n((r=[])=>{let t=r.filter(a=>a.isSet);if(t.length>0)return be(t).map(De).join(", ");let e=be(r);return e.length===1?_t(e[0]):"Active"},"transformStatusCheckMessage"),ke=n((r,t)=>{if(/credential is revoked/i.test(r))return"Status: Revoked";if(/credential is suspended/i.test(r))return"Status: Suspended";let e=r.match(/credential status is set for purpose:\s*([^.]+)/i)?.[1];if(e)return`Status: ${De(e.trim())}`;if(!/status/i.test(r))return;let a=t?.status?.filter(o=>o.isSet)??[];if(a.length>0)return`Status: ${Se(a)}`},"getStatusErrorMessage"),Ft=n((r,t,e)=>ke(r,e)?"status":r.split(" error")[0]||r,"transformErrorCheck"),qt=n((r,t,e)=>{let a=ke(r,e);return a||(r.startsWith("expiration")?t.expirationDate?`Expired ${N(new Date(t.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Expired":r)},"transformErrorMessage"),Lt=n((r,t)=>r.includes("Boost Authenticity")?"Boost Authenticity":r.split(" warning")[0]||r,"transformWarningCheck"),Nt=n((r,t,e)=>Te(r)?Se(e.status):{proof:"Valid",expiration:t.expirationDate?`Expires ${N(new Date(t.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Does Not Expire"}[r]||r,"transformCheckMessage"),Me=n(r=>async(t,e,a,o=!1)=>{let i=await r.invoke.verifyCredential(e,a);if(!o)return i;let s=[];return i.errors.forEach(f=>{s.push({status:Q.VerificationStatusEnum.Failed,check:Ft(f,e,i),details:qt(f,e,i)})}),i.warnings.forEach(f=>{s.push({status:Q.VerificationStatusEnum.Error,check:Lt(f,e),message:f})}),i.checks.forEach(f=>{s.push({status:Q.VerificationStatusEnum.Success,check:Te(f)?"status":f,message:Nt(f,e,i)})}),s},"verifyCredential");var At=n(r=>({name:"LearnCard",displayName:"LearnCard",description:"Adds opinionated logic to a LearnCard",methods:{verifyCredential:Me(r)}}),"getLearnCardPlugin");
1
+ "use strict";var H=Object.defineProperty;var Ne=Object.getOwnPropertyDescriptor;var Ve=Object.getOwnPropertyNames;var Ae=Object.prototype.hasOwnProperty;var n=(e,r)=>H(e,"name",{value:r,configurable:!0});var He=(e,r)=>{for(var t in r)H(e,t,{get:r[t],enumerable:!0})},$e=(e,r,t,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Ve(r))!Ae.call(e,o)&&o!==t&&H(e,o,{get:()=>r[o],enumerable:!(a=Ne(r,o))||a.enumerable});return e};var Re=e=>$e(H({},"__esModule",{value:!0}),e);var Jt={};He(Jt,{getLearnCardPlugin:()=>zt,prettifyVerificationItem:()=>Ye,prettifyVerificationItems:()=>Gt});module.exports=Re(Jt);var $=require("@learncard/types");function I(e){"@babel/helpers - typeof";return I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},I(e)}n(I,"_typeof");function x(e){if(e===null||e===!0||e===!1)return NaN;var r=Number(e);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}n(x,"toInteger");function d(e,r){if(r.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+r.length+" present")}n(d,"requiredArgs");function m(e){d(1,arguments);var r=Object.prototype.toString.call(e);return e instanceof Date||I(e)==="object"&&r==="[object Date]"?new Date(e.getTime()):typeof e=="number"||r==="[object Number]"?new Date(e):((typeof e=="string"||r==="[object String]")&&typeof console<"u"&&(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))}n(m,"toDate");function G(e,r){d(2,arguments);var t=m(e).getTime(),a=x(r);return new Date(t+a)}n(G,"addMilliseconds");var Qe={};function k(){return Qe}n(k,"getDefaultOptions");function z(e){var r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),e.getTime()-r.getTime()}n(z,"getTimezoneOffsetInMilliseconds");function J(e){return d(1,arguments),e instanceof Date||I(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}n(J,"isDate");function K(e){if(d(1,arguments),!J(e)&&typeof e!="number")return!1;var r=m(e);return!isNaN(Number(r))}n(K,"isValid");function Z(e,r){d(2,arguments);var t=x(r);return G(e,-t)}n(Z,"subMilliseconds");var Be=864e5;function ee(e){d(1,arguments);var r=m(e),t=r.getTime();r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0);var a=r.getTime(),o=t-a;return Math.floor(o/Be)+1}n(ee,"getUTCDayOfYear");function T(e){d(1,arguments);var r=1,t=m(e),a=t.getUTCDay(),o=(a<r?7:0)+a-r;return t.setUTCDate(t.getUTCDate()-o),t.setUTCHours(0,0,0,0),t}n(T,"startOfUTCISOWeek");function F(e){d(1,arguments);var r=m(e),t=r.getUTCFullYear(),a=new Date(0);a.setUTCFullYear(t+1,0,4),a.setUTCHours(0,0,0,0);var o=T(a),i=new Date(0);i.setUTCFullYear(t,0,4),i.setUTCHours(0,0,0,0);var s=T(i);return r.getTime()>=o.getTime()?t+1:r.getTime()>=s.getTime()?t:t-1}n(F,"getUTCISOWeekYear");function te(e){d(1,arguments);var r=F(e),t=new Date(0);t.setUTCFullYear(r,0,4),t.setUTCHours(0,0,0,0);var a=T(t);return a}n(te,"startOfUTCISOWeekYear");var Xe=6048e5;function re(e){d(1,arguments);var r=m(e),t=T(r).getTime()-te(r).getTime();return Math.round(t/Xe)+1}n(re,"getUTCISOWeek");function S(e,r){var t,a,o,i,s,u,c,l;d(1,arguments);var h=k(),p=x((t=(a=(o=(i=r?.weekStartsOn)!==null&&i!==void 0?i:r==null||(s=r.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&o!==void 0?o:h.weekStartsOn)!==null&&a!==void 0?a:(c=h.locale)===null||c===void 0||(l=c.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&t!==void 0?t:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var v=m(e),g=v.getUTCDay(),w=(g<p?7:0)+g-p;return v.setUTCDate(v.getUTCDate()-w),v.setUTCHours(0,0,0,0),v}n(S,"startOfUTCWeek");function L(e,r){var t,a,o,i,s,u,c,l;d(1,arguments);var h=m(e),p=h.getUTCFullYear(),v=k(),g=x((t=(a=(o=(i=r?.firstWeekContainsDate)!==null&&i!==void 0?i:r==null||(s=r.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:v.firstWeekContainsDate)!==null&&a!==void 0?a:(c=v.locale)===null||c===void 0||(l=c.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(g>=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=new Date(0);w.setUTCFullYear(p+1,0,g),w.setUTCHours(0,0,0,0);var P=S(w,r),C=new Date(0);C.setUTCFullYear(p,0,g),C.setUTCHours(0,0,0,0);var Y=S(C,r);return h.getTime()>=P.getTime()?p+1:h.getTime()>=Y.getTime()?p:p-1}n(L,"getUTCWeekYear");function ae(e,r){var t,a,o,i,s,u,c,l;d(1,arguments);var h=k(),p=x((t=(a=(o=(i=r?.firstWeekContainsDate)!==null&&i!==void 0?i:r==null||(s=r.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:h.firstWeekContainsDate)!==null&&a!==void 0?a:(c=h.locale)===null||c===void 0||(l=c.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&t!==void 0?t:1),v=L(e,r),g=new Date(0);g.setUTCFullYear(v,0,p),g.setUTCHours(0,0,0,0);var w=S(g,r);return w}n(ae,"startOfUTCWeekYear");var je=6048e5;function oe(e,r){d(1,arguments);var t=m(e),a=S(t,r).getTime()-ae(t,r).getTime();return Math.round(a/je)+1}n(oe,"getUTCWeek");function f(e,r){for(var t=e<0?"-":"",a=Math.abs(e).toString();a.length<r;)a="0"+a;return t+a}n(f,"addLeadingZeros");var Ge={y:n(function(r,t){var a=r.getUTCFullYear(),o=a>0?a:1-a;return f(t==="yy"?o%100:o,t.length)},"y"),M:n(function(r,t){var a=r.getUTCMonth();return t==="M"?String(a+1):f(a+1,2)},"M"),d:n(function(r,t){return f(r.getUTCDate(),t.length)},"d"),a:n(function(r,t){var a=r.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},"a"),h:n(function(r,t){return f(r.getUTCHours()%12||12,t.length)},"h"),H:n(function(r,t){return f(r.getUTCHours(),t.length)},"H"),m:n(function(r,t){return f(r.getUTCMinutes(),t.length)},"m"),s:n(function(r,t){return f(r.getUTCSeconds(),t.length)},"s"),S:n(function(r,t){var a=t.length,o=r.getUTCMilliseconds(),i=Math.floor(o*Math.pow(10,a-3));return f(i,t.length)},"S")},b=Ge;var _={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ze={G:n(function(r,t,a){var o=r.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return a.era(o,{width:"abbreviated"});case"GGGGG":return a.era(o,{width:"narrow"});case"GGGG":default:return a.era(o,{width:"wide"})}},"G"),y:n(function(r,t,a){if(t==="yo"){var o=r.getUTCFullYear(),i=o>0?o:1-o;return a.ordinalNumber(i,{unit:"year"})}return b.y(r,t)},"y"),Y:n(function(r,t,a,o){var i=L(r,o),s=i>0?i:1-i;if(t==="YY"){var u=s%100;return f(u,2)}return t==="Yo"?a.ordinalNumber(s,{unit:"year"}):f(s,t.length)},"Y"),R:n(function(r,t){var a=F(r);return f(a,t.length)},"R"),u:n(function(r,t){var a=r.getUTCFullYear();return f(a,t.length)},"u"),Q:n(function(r,t,a){var o=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"Q":return String(o);case"QQ":return f(o,2);case"Qo":return a.ordinalNumber(o,{unit:"quarter"});case"QQQ":return a.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(o,{width:"wide",context:"formatting"})}},"Q"),q:n(function(r,t,a){var o=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"q":return String(o);case"qq":return f(o,2);case"qo":return a.ordinalNumber(o,{unit:"quarter"});case"qqq":return a.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(o,{width:"wide",context:"standalone"})}},"q"),M:n(function(r,t,a){var o=r.getUTCMonth();switch(t){case"M":case"MM":return b.M(r,t);case"Mo":return a.ordinalNumber(o+1,{unit:"month"});case"MMM":return a.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(o,{width:"wide",context:"formatting"})}},"M"),L:n(function(r,t,a){var o=r.getUTCMonth();switch(t){case"L":return String(o+1);case"LL":return f(o+1,2);case"Lo":return a.ordinalNumber(o+1,{unit:"month"});case"LLL":return a.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(o,{width:"wide",context:"standalone"})}},"L"),w:n(function(r,t,a,o){var i=oe(r,o);return t==="wo"?a.ordinalNumber(i,{unit:"week"}):f(i,t.length)},"w"),I:n(function(r,t,a){var o=re(r);return t==="Io"?a.ordinalNumber(o,{unit:"week"}):f(o,t.length)},"I"),d:n(function(r,t,a){return t==="do"?a.ordinalNumber(r.getUTCDate(),{unit:"date"}):b.d(r,t)},"d"),D:n(function(r,t,a){var o=ee(r);return t==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):f(o,t.length)},"D"),E:n(function(r,t,a){var o=r.getUTCDay();switch(t){case"E":case"EE":case"EEE":return a.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(o,{width:"short",context:"formatting"});case"EEEE":default:return a.day(o,{width:"wide",context:"formatting"})}},"E"),e:n(function(r,t,a,o){var i=r.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return f(s,2);case"eo":return a.ordinalNumber(s,{unit:"day"});case"eee":return a.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(i,{width:"short",context:"formatting"});case"eeee":default:return a.day(i,{width:"wide",context:"formatting"})}},"e"),c:n(function(r,t,a,o){var i=r.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return f(s,t.length);case"co":return a.ordinalNumber(s,{unit:"day"});case"ccc":return a.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(i,{width:"narrow",context:"standalone"});case"cccccc":return a.day(i,{width:"short",context:"standalone"});case"cccc":default:return a.day(i,{width:"wide",context:"standalone"})}},"c"),i:n(function(r,t,a){var o=r.getUTCDay(),i=o===0?7:o;switch(t){case"i":return String(i);case"ii":return f(i,t.length);case"io":return a.ordinalNumber(i,{unit:"day"});case"iii":return a.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(o,{width:"short",context:"formatting"});case"iiii":default:return a.day(o,{width:"wide",context:"formatting"})}},"i"),a:n(function(r,t,a){var o=r.getUTCHours(),i=o/12>=1?"pm":"am";switch(t){case"a":case"aa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},"a"),b:n(function(r,t,a){var o=r.getUTCHours(),i;switch(o===12?i=_.noon:o===0?i=_.midnight:i=o/12>=1?"pm":"am",t){case"b":case"bb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},"b"),B:n(function(r,t,a){var o=r.getUTCHours(),i;switch(o>=17?i=_.evening:o>=12?i=_.afternoon:o>=4?i=_.morning:i=_.night,t){case"B":case"BB":case"BBB":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},"B"),h:n(function(r,t,a){if(t==="ho"){var o=r.getUTCHours()%12;return o===0&&(o=12),a.ordinalNumber(o,{unit:"hour"})}return b.h(r,t)},"h"),H:n(function(r,t,a){return t==="Ho"?a.ordinalNumber(r.getUTCHours(),{unit:"hour"}):b.H(r,t)},"H"),K:n(function(r,t,a){var o=r.getUTCHours()%12;return t==="Ko"?a.ordinalNumber(o,{unit:"hour"}):f(o,t.length)},"K"),k:n(function(r,t,a){var o=r.getUTCHours();return o===0&&(o=24),t==="ko"?a.ordinalNumber(o,{unit:"hour"}):f(o,t.length)},"k"),m:n(function(r,t,a){return t==="mo"?a.ordinalNumber(r.getUTCMinutes(),{unit:"minute"}):b.m(r,t)},"m"),s:n(function(r,t,a){return t==="so"?a.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):b.s(r,t)},"s"),S:n(function(r,t){return b.S(r,t)},"S"),X:n(function(r,t,a,o){var i=o._originalDate||r,s=i.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return fe(s);case"XXXX":case"XX":return D(s);case"XXXXX":case"XXX":default:return D(s,":")}},"X"),x:n(function(r,t,a,o){var i=o._originalDate||r,s=i.getTimezoneOffset();switch(t){case"x":return fe(s);case"xxxx":case"xx":return D(s);case"xxxxx":case"xxx":default:return D(s,":")}},"x"),O:n(function(r,t,a,o){var i=o._originalDate||r,s=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ue(s,":");case"OOOO":default:return"GMT"+D(s,":")}},"O"),z:n(function(r,t,a,o){var i=o._originalDate||r,s=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ue(s,":");case"zzzz":default:return"GMT"+D(s,":")}},"z"),t:n(function(r,t,a,o){var i=o._originalDate||r,s=Math.floor(i.getTime()/1e3);return f(s,t.length)},"t"),T:n(function(r,t,a,o){var i=o._originalDate||r,s=i.getTime();return f(s,t.length)},"T")};function ue(e,r){var t=e>0?"-":"+",a=Math.abs(e),o=Math.floor(a/60),i=a%60;if(i===0)return t+String(o);var s=r||"";return t+String(o)+s+f(i,2)}n(ue,"formatTimezoneShort");function fe(e,r){if(e%60===0){var t=e>0?"-":"+";return t+f(Math.abs(e)/60,2)}return D(e,r)}n(fe,"formatTimezoneWithOptionalMinutes");function D(e,r){var t=r||"",a=e>0?"-":"+",o=Math.abs(e),i=f(Math.floor(o/60),2),s=f(o%60,2);return a+i+t+s}n(D,"formatTimezone");var de=ze;var le=n(function(r,t){switch(r){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},"dateLongFormatter"),me=n(function(r,t){switch(r){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},"timeLongFormatter"),Je=n(function(r,t){var a=r.match(/(P+)(p+)?/)||[],o=a[1],i=a[2];if(!i)return le(r,t);var s;switch(o){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",le(o,t)).replace("{{time}}",me(i,t))},"dateTimeLongFormatter"),Ke={p:me,P:Je},ce=Ke;var Ze=["D","DD"],et=["YY","YYYY"];function pe(e){return Ze.indexOf(e)!==-1}n(pe,"isProtectedDayOfYearToken");function he(e){return et.indexOf(e)!==-1}n(he,"isProtectedWeekYearToken");function ne(e,r,t){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(r,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(r,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(r,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(r,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}n(ne,"throwProtectedError");var tt={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"}},rt=n(function(r,t,a){var o,i=tt[r];return typeof i=="string"?o=i:t===1?o=i.one:o=i.other.replace("{{count}}",t.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"in "+o:o+" ago":o},"formatDistance"),ge=rt;function q(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.width?String(r.width):e.defaultWidth,a=e.formats[t]||e.formats[e.defaultWidth];return a}}n(q,"buildFormatLongFn");var at={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ot={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},nt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},it={date:q({formats:at,defaultWidth:"full"}),time:q({formats:ot,defaultWidth:"full"}),dateTime:q({formats:nt,defaultWidth:"full"})},ve=it;var st={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ut=n(function(r,t,a,o){return st[r]},"formatRelative"),xe=ut;function M(e){return function(r,t){var a=t!=null&&t.context?String(t.context):"standalone",o;if(a==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,s=t!=null&&t.width?String(t.width):i;o=e.formattingValues[s]||e.formattingValues[i]}else{var u=e.defaultWidth,c=t!=null&&t.width?String(t.width):e.defaultWidth;o=e.values[c]||e.values[u]}var l=e.argumentCallback?e.argumentCallback(r):r;return o[l]}}n(M,"buildLocalizeFn");var ft={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},dt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lt={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"]},mt={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"]},ct={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"}},pt={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"}},ht=n(function(r,t){var a=Number(r),o=a%100;if(o>20||o<10)switch(o%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},"ordinalNumber"),gt={ordinalNumber:ht,era:M({values:ft,defaultWidth:"wide"}),quarter:M({values:dt,defaultWidth:"wide",argumentCallback:n(function(r){return r-1},"argumentCallback")}),month:M({values:lt,defaultWidth:"wide"}),day:M({values:mt,defaultWidth:"wide"}),dayPeriod:M({values:ct,defaultWidth:"wide",formattingValues:pt,defaultFormattingWidth:"wide"})},ye=gt;function W(e){return function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=t.width,o=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],i=r.match(o);if(!i)return null;var s=i[0],u=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(u)?xt(u,function(p){return p.test(s)}):vt(u,function(p){return p.test(s)}),l;l=e.valueCallback?e.valueCallback(c):c,l=t.valueCallback?t.valueCallback(l):l;var h=r.slice(s.length);return{value:l,rest:h}}}n(W,"buildMatchFn");function vt(e,r){for(var t in e)if(e.hasOwnProperty(t)&&r(e[t]))return t}n(vt,"findKey");function xt(e,r){for(var t=0;t<e.length;t++)if(r(e[t]))return t}n(xt,"findIndex");function ie(e){return function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.match(e.matchPattern);if(!a)return null;var o=a[0],i=r.match(e.parsePattern);if(!i)return null;var s=e.valueCallback?e.valueCallback(i[0]):i[0];s=t.valueCallback?t.valueCallback(s):s;var u=r.slice(o.length);return{value:s,rest:u}}}n(ie,"buildMatchPatternFn");var yt=/^(\d+)(th|st|nd|rd)?/i,wt=/\d+/i,bt={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},Ot={any:[/^b/i,/^(a|c)/i]},kt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Tt={any:[/1/i,/2/i,/3/i,/4/i]},St={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},Ct={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]},Dt={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},Mt={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]},Wt={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},It={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}},_t={ordinalNumber:ie({matchPattern:yt,parsePattern:wt,valueCallback:n(function(r){return parseInt(r,10)},"valueCallback")}),era:W({matchPatterns:bt,defaultMatchWidth:"wide",parsePatterns:Ot,defaultParseWidth:"any"}),quarter:W({matchPatterns:kt,defaultMatchWidth:"wide",parsePatterns:Tt,defaultParseWidth:"any",valueCallback:n(function(r){return r+1},"valueCallback")}),month:W({matchPatterns:St,defaultMatchWidth:"wide",parsePatterns:Ct,defaultParseWidth:"any"}),day:W({matchPatterns:Dt,defaultMatchWidth:"wide",parsePatterns:Mt,defaultParseWidth:"any"}),dayPeriod:W({matchPatterns:Wt,defaultMatchWidth:"any",parsePatterns:It,defaultParseWidth:"any"})},we=_t;var Pt={code:"en-US",formatDistance:ge,formatLong:ve,formatRelative:xe,localize:ye,match:we,options:{weekStartsOn:0,firstWeekContainsDate:1}},be=Pt;var Oe=be;var Yt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ut=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Et=/^'([^]*?)'?$/,Ft=/''/g,Lt=/[a-zA-Z]/;function N(e,r,t){var a,o,i,s,u,c,l,h,p,v,g,w,P,C,Y,R,Q,B;d(2,arguments);var Ue=String(r),U=k(),E=(a=(o=t?.locale)!==null&&o!==void 0?o:U.locale)!==null&&a!==void 0?a:Oe,X=x((i=(s=(u=(c=t?.firstWeekContainsDate)!==null&&c!==void 0?c:t==null||(l=t.locale)===null||l===void 0||(h=l.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&u!==void 0?u:U.firstWeekContainsDate)!==null&&s!==void 0?s:(p=U.locale)===null||p===void 0||(v=p.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(X>=1&&X<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=x((g=(w=(P=(C=t?.weekStartsOn)!==null&&C!==void 0?C:t==null||(Y=t.locale)===null||Y===void 0||(R=Y.options)===null||R===void 0?void 0:R.weekStartsOn)!==null&&P!==void 0?P:U.weekStartsOn)!==null&&w!==void 0?w:(Q=U.locale)===null||Q===void 0||(B=Q.options)===null||B===void 0?void 0:B.weekStartsOn)!==null&&g!==void 0?g:0);if(!(j>=0&&j<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!E.localize)throw new RangeError("locale must contain localize property");if(!E.formatLong)throw new RangeError("locale must contain formatLong property");var V=m(e);if(!K(V))throw new RangeError("Invalid time value");var Ee=z(V),Fe=Z(V,Ee),Le={firstWeekContainsDate:X,weekStartsOn:j,locale:E,_originalDate:V},qe=Ue.match(Ut).map(function(y){var O=y[0];if(O==="p"||O==="P"){var A=ce[O];return A(y,E.formatLong)}return y}).join("").match(Yt).map(function(y){if(y==="''")return"'";var O=y[0];if(O==="'")return qt(y);var A=de[O];if(A)return!(t!=null&&t.useAdditionalWeekYearTokens)&&he(y)&&ne(y,r,String(e)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&pe(y)&&ne(y,r,String(e)),A(Fe,y,E.localize,Le);if(O.match(Lt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+O+"`");return y}).join("");return qe}n(N,"format");function qt(e){var r=e.match(Et);return r?r[1].replace(Ft,"'"):e}n(qt,"cleanEscapedString");var Nt=new Set(["status","credentialStatus"]),Te=n(e=>Nt.has(e),"isStatusCheck"),Se=n(e=>{switch(e){case"revocation":return"Revocation";case"suspension":return"Suspension";default:return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,r=>r.toUpperCase())}},"getStatusPurposeLabel"),Vt=n(e=>{switch(e){case"revocation":return"Not Revoked";case"suspension":return"Not Suspended";default:return`${Se(e)} Clear`}},"getClearStatusMessage"),Ce=n(e=>{switch(e){case"revocation":return"Revoked";case"suspension":return"Suspended";default:return`${Se(e)} Set`}},"getSetStatusMessage"),ke=n(e=>[...new Set(e.map(r=>r.statusPurpose))],"getUniqueStatusPurposes"),De=n((e=[])=>{let r=e.filter(a=>a.isSet);if(r.length>0)return ke(r).map(Ce).join(", ");let t=ke(e);return t.length===1?Vt(t[0]):"Active"},"transformStatusCheckMessage"),Me=n((e,r)=>{if(/credential is revoked/i.test(e))return"Status: Revoked";if(/credential is suspended/i.test(e))return"Status: Suspended";let t=e.match(/credential status is set for purpose:\s*([^.]+)/i)?.[1];if(t)return`Status: ${Ce(t.trim())}`;if(!/status/i.test(e))return;let a=r?.status?.filter(o=>o.isSet)??[];if(a.length>0)return`Status: ${De(a)}`},"getStatusErrorMessage"),At=n((e,r,t)=>Me(e,t)?"status":e.split(" error")[0]||e,"transformErrorCheck"),Ht=n((e,r,t)=>{let a=Me(e,t);return a||(e.startsWith("expiration")?r.expirationDate?`Expired ${N(new Date(r.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Expired":e)},"transformErrorMessage"),$t=n((e,r)=>e.includes("Boost Authenticity")?"Boost Authenticity":e.split(" warning")[0]||e,"transformWarningCheck"),Rt=n((e,r,t)=>Te(e)?De(t.status):{proof:"Valid",expiration:r.expirationDate?`Expires ${N(new Date(r.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Does Not Expire"}[e]||e,"transformCheckMessage"),We=n(e=>async(r,t,a,o=!1)=>{let i=await e.invoke.verifyCredential(t,a);if(!o)return i;let s=[];return i.errors.forEach(u=>{s.push({status:$.VerificationStatusEnum.Failed,check:At(u,t,i),details:Ht(u,t,i)})}),i.warnings.forEach(u=>{s.push({status:$.VerificationStatusEnum.Error,check:$t(u,t),message:u})}),i.checks.forEach(u=>{s.push({status:$.VerificationStatusEnum.Success,check:Te(u)?"status":u,message:Rt(u,t,i)})}),s},"verifyCredential");var _e=require("@learncard/types");var Qt={parse:{check:"Format",message:"Valid"},disclosure_hash_integrity:{check:"Selective Disclosure",message:"Claims verified"},issuer_resolved:{check:"Issuer",message:"Identified"},issuer_signature:{check:"Signature",message:"Valid"},expiration:{check:"Expiration",message:"Does Not Expire"},vct:{check:"Credential Type",message:"Verified"},proof:{check:"Proof",message:"Valid"},credentialStatus:{check:"Status",message:"Active"},status:{check:"Status",message:"Active"},credentialSchema:{check:"Schema",message:"Valid"}},Pe={invalid_compact_form:{check:"Format",message:"Invalid"},invalid_jwt:{check:"Format",message:"Invalid"},invalid_typ:{check:"Format",message:"Invalid type"},missing_iss:{check:"Issuer",message:"Missing"},missing_vct:{check:"Credential Type",message:"Missing"},missing_alg:{check:"Signature",message:"Algorithm missing"},unsupported_alg:{check:"Signature",message:"Unsupported algorithm"},unsupported_sd_alg:{check:"Selective Disclosure",message:"Unsupported algorithm"},invalid_disclosure:{check:"Selective Disclosure",message:"Invalid"},disclosure_hash_mismatch:{check:"Selective Disclosure",message:"Tampered"},issuer_resolution_failed:{check:"Issuer",message:"Could not be found"},verification_method_not_found:{check:"Issuer",message:"Key not found"},verification_method_not_authorized:{check:"Issuer",message:"Key not authorized"},signature_invalid:{check:"Signature",message:"Invalid"},expired:{check:"Expiration",message:"Expired"},not_yet_valid:{check:"Expiration",message:"Not yet valid"},vct_mismatch:{check:"Credential Type",message:"Mismatch"},status_check_failed:{check:"Status",message:"Revoked or suspended"},kb_jwt_invalid:{check:"Key Binding",message:"Invalid"},presentation_verification_failed:{check:"Presentation",message:"Invalid"},key_binding_mismatch:{check:"Holder Key",message:"Mismatch"},unsupported_cnf_confirmation_type:{check:"Holder Key",message:"Unsupported type"},internal_error:{check:"Verification",message:"Something went wrong"}},Bt=n(e=>e?/^[A-Z]/.test(e)||/\s/.test(e):!0,"isAlreadyPrettified"),Ie=n(e=>e?e.match(/^([a-z][a-z0-9_]*):/)?.[1]:void 0,"extractErrorCode"),Xt=n(e=>{if(!e)return;let r=e.split(/[:\s]/)[0];return/^[a-z][a-z0-9_]*$/.test(r)?r:void 0},"codeFromCheck"),jt=n(e=>[Ie(e.message),Ie(e.details),Xt(e.check)].find(t=>t!==void 0&&t in Pe),"resolveErrorCode"),se=n((e,r)=>!!(!e||e===r||/^[a-z][a-z0-9_]*$/.test(e)||e.startsWith(`${r}:`)),"isMessageRaw"),Ye=n(e=>{if(e.status===_e.VerificationStatusEnum.Failed){let a=jt(e);if(!a)return e;let o=Pe[a],i=!!e.details&&!se(e.details,e.check),s=!!e.message&&!se(e.message,e.check),u;return s?u=e.message:i?u=void 0:u=o.message,{...e,check:o.check,message:u}}if(Bt(e.check))return e;let t=Qt[e.check];return t?{...e,check:t.check,message:se(e.message,e.check)?t.message:e.message}:e},"prettifyVerificationItem"),Gt=n(e=>e.map(Ye),"prettifyVerificationItems");var zt=n(e=>({name:"LearnCard",displayName:"LearnCard",description:"Adds opinionated logic to a LearnCard",methods:{verifyCredential:We(e)}}),"getLearnCardPlugin");
2
2
  //# sourceMappingURL=learn-card-plugin.cjs.production.min.cjs.map