@harpercollins/harpercollins-design-system 1.8.65 → 1.8.67

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 +1 @@
1
- export declare const NULL_DISPLAY_VALUE = "-";
1
+ export declare const NULL_DISPLAY_VALUE: string;
@@ -2,7 +2,7 @@
2
2
  * Format date to locale
3
3
  * @param dateString - The date string to format
4
4
  * @param format - The format to display the date in. Default is "dd MMM yyyy"
5
- * @returns - The formatted date
5
+ * @returns The formatted date
6
6
  */
7
7
  export declare const formatDate: (dateString: string | null | undefined, format?: string) => string;
8
8
  /**
@@ -12,7 +12,7 @@ export declare const formatDate: (dateString: string | null | undefined, format?
12
12
  */
13
13
  export declare const formatNumber: (number: number | string | null | undefined) => string;
14
14
  /**
15
- * Format text to display NULL_DISPLAY_VALUE if text is empty, null or undefined
15
+ * Format text
16
16
  * @param text
17
17
  * @returns The formatted text
18
18
  */
@@ -24,4 +24,4 @@ export declare const formatText: (text: string | null | undefined) => string;
24
24
  * @param currency - The currency to format the value to
25
25
  * @returns The formatted currency value
26
26
  * */
27
- export declare const formatCurrency: (value: number | string | null | undefined, locale?: string, currency?: string) => string;
27
+ export declare const formatCurrency: (value: number | string | null | undefined, locale?: string | undefined, options?: Intl.NumberFormatOptions) => string;
package/dist/esm/index.js CHANGED
@@ -443,10 +443,15 @@ object-assign
443
443
  function Qc(e,t){return e?function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(n=e)||"function"==typeof n||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(n)?r.createElement(e,t):e:null;var n}function Zc(e,t){const[n,r]=c((()=>{if("undefined"==typeof window)return t;try{const n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch(e){return console.log(e),t}}));return[n,t=>{try{const o=t instanceof Function?t(n):t;r(o),"undefined"!=typeof window&&window.localStorage.setItem(e,JSON.stringify(o))}catch(e){console.log(e)}}]}const eu=on.div`
444
444
  overflow-x: auto;
445
445
  width: 100%;
446
+ max-height: 90vh;
446
447
  `,tu=on.table`
447
448
  border-collapse: collapse;
448
449
  position: relative;
449
450
 
451
+ thead {
452
+ background-color: white;
453
+ }
454
+
450
455
  thead,
451
456
  tbody {
452
457
  display: table;
@@ -519,7 +524,8 @@ function Qc(e,t){return e?function(e){return"function"==typeof e&&(()=>{const t=
519
524
  padding: var(--spacing--small);
520
525
  display: table-cell;
521
526
  vertical-align: middle;
522
- word-wrap: break-word;
527
+ overflow: hidden;
528
+ text-overflow: ellipsis;
523
529
 
524
530
  &.name {
525
531
  font-weight: 500;
@@ -1289,5 +1295,5 @@ function af(e,t){const n=rf(e,t);return"production"!==process.env.NODE_ENV?(...t
1289
1295
  }
1290
1296
  `,Gw=on.div`
1291
1297
  position: relative;
1292
- `;let qw=1;const Yw=p((({children:n,side:r,size:i="md",open:l=!1,closeBlocked:s,onClose:c=(()=>{}),onCloseCompleted:d=(()=>{}),closeRequested:p=!1,...f},m)=>{const g=a(null);g.current||(g.current=`overlay-${qw}`,qw+=1);const h=a(null),[v,b]=o.useState(!1);o.useEffect((()=>{if(v){const e=setTimeout(d,200);return()=>{clearTimeout(e)}}return()=>{}})),u((()=>{p&&b(!0)}),[p]),g.current||(g.current=`modal-${qw}`,qw+=1),u((()=>{document.body.style.overflow=l?"hidden":"auto"}),[l]),u((()=>{const e=e=>{"Escape"===e.key&&(e.preventDefault(),c())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[c]);return e(zw,{open:l&&!v,anchor:r,className:`${r} ${l?"open":"closing"}`,size:i,...f,children:e(jw,{children:t(Vw,{ref:h,children:[s&&t(Ww,{role:"alert","aria-live":"assertive",children:[e(Ti,{name:["fas","exclamation-triangle"]}),t("p",{children:[e("strong",{children:"You have unsaved changes."})," Please save or cancel before closing."]})]}),e(Gw,{ref:m,children:e(Rw,{children:n})})]})})})}));function Uw(e){const[t,n]=c(e);return{value:t,toggle:f((()=>n((e=>!e))),[]),setTrue:f((()=>n(!0)),[]),setFalse:f((()=>n(!1)),[])}}const Kw=(e,t,n)=>{const[r,o]=c(null),[i,l]=c(!1),[s,d]=c(null),p=a(null);return u((()=>{if(!e)return()=>{};let r=!0;l(!0);return p.current&&clearTimeout(p.current),p.current=setTimeout((()=>{(async()=>{try{const n=await fetch(e,t);if(!n.ok)throw new Error(`Error: ${n.statusText}`);const a=await n.json();r&&(o(a),l(!1))}catch(e){r&&(d(e),l(!1))}})()}),n||0),()=>{r=!1,p.current&&clearTimeout(p.current)}}),[e,t,n]),{data:r,loading:i,error:s}};function Jw(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function Xw(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const Qw=6048e5,Zw=864e5,ex=6e4,tx=36e5;let nx={};function rx(){return nx}function ox(e,t){const n=rx(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Jw(e),a=o.getDay(),i=(a<r?7:0)+a-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function ax(e){return ox(e,{weekStartsOn:1})}function ix(e){const t=Jw(e),n=t.getFullYear(),r=Xw(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=ax(r),a=Xw(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const i=ax(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function lx(e){const t=Jw(e);return t.setHours(0,0,0,0),t}function sx(e){const t=Jw(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function cx(e){if(!(t=e,t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)||"number"==typeof e))return!1;var t;const n=Jw(e);return!isNaN(Number(n))}const ux={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 dx(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const px={date:dx({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:dx({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:dx({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},fx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function mx(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function gx(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const i=a[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(l)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(l,(e=>e.test(i))):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(l,(e=>e.test(i)));let c;c=e.valueCallback?e.valueCallback(s):s,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:t.slice(i.length)}}}var hx;const vx={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=ux[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:px,formatRelative:(e,t,n,r)=>fx[e],localize:{ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:mx({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:mx({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:mx({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:mx({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:mx({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:(hx={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(hx.matchPattern);if(!n)return null;const r=n[0],o=e.match(hx.parsePattern);if(!o)return null;let a=hx.valueCallback?hx.valueCallback(o[0]):o[0];return a=t.valueCallback?t.valueCallback(a):a,{value:a,rest:e.slice(r.length)}}),era:gx({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:gx({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:e=>e+1}),month:gx({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:gx({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:gx({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}};function bx(e){const t=Jw(e),n=function(e,t){const n=lx(e),r=lx(t),o=+n-sx(n),a=+r-sx(r);return Math.round((o-a)/Zw)}(t,function(e){const t=Jw(e),n=Xw(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(t));return n+1}function yx(e){const t=Jw(e),n=+ax(t)-+function(e){const t=ix(e),n=Xw(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),ax(n)}(t);return Math.round(n/Qw)+1}function wx(e,t){const n=Jw(e),r=n.getFullYear(),o=rx(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=Xw(e,0);i.setFullYear(r+1,0,a),i.setHours(0,0,0,0);const l=ox(i,t),s=Xw(e,0);s.setFullYear(r,0,a),s.setHours(0,0,0,0);const c=ox(s,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function xx(e,t){const n=Jw(e),r=+ox(n,t)-+function(e,t){const n=rx(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=wx(e,t),a=Xw(e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),ox(a,t)}(n,t);return Math.round(r/Qw)+1}function Sx(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const Cx={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Sx("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):Sx(n+1,2)},d:(e,t)=>Sx(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>Sx(e.getHours()%12||12,t.length),H:(e,t)=>Sx(e.getHours(),t.length),m:(e,t)=>Sx(e.getMinutes(),t.length),s:(e,t)=>Sx(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return Sx(Math.trunc(r*Math.pow(10,n-3)),t.length)}},kx="midnight",Ox="noon",Ex="morning",Ix="afternoon",Px="evening",Nx="night",$x={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return Cx.y(e,t)},Y:function(e,t,n,r){const o=wx(e,r),a=o>0?o:1-o;if("YY"===t){return Sx(a%100,2)}return"Yo"===t?n.ordinalNumber(a,{unit:"year"}):Sx(a,t.length)},R:function(e,t){return Sx(ix(e),t.length)},u:function(e,t){return Sx(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Sx(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Sx(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Cx.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Sx(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=xx(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):Sx(o,t.length)},I:function(e,t,n){const r=yx(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):Sx(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):Cx.d(e,t)},D:function(e,t,n){const r=bx(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):Sx(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Sx(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Sx(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return Sx(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(o=12===r?Ox:0===r?kx:r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(o=r>=17?Px:r>=12?Ix:r>=4?Ex:Nx,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return Cx.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):Cx.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):Sx(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):Sx(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Cx.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Cx.s(e,t)},S:function(e,t){return Cx.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return Rx(r);case"XXXX":case"XX":return Tx(r);default:return Tx(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Rx(r);case"xxxx":case"xx":return Tx(r);default:return Tx(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+zx(r,":");default:return"GMT"+Tx(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+zx(r,":");default:return"GMT"+Tx(r,":")}},t:function(e,t,n){return Sx(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return Sx(e.getTime(),t.length)}};function zx(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return 0===a?n+String(o):n+String(o)+t+Sx(a,2)}function Rx(e,t){if(e%60==0){return(e>0?"-":"+")+Sx(Math.abs(e)/60,2)}return Tx(e,t)}function Tx(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+Sx(Math.trunc(r/60),2)+t+Sx(r%60,2)}const Dx=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Ax=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Mx={p:Ax,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Dx(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",Dx(r,t)).replace("{{time}}",Ax(o,t))}},_x=/^D+$/,Lx=/^Y+$/,Fx=["D","DD","YY","YYYY"];const Vx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,jx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Bx=/^'([^]*?)'?$/,Hx=/''/g,Wx=/[a-zA-Z]/;function Gx(e,t,n){const r=rx(),o=r.locale??vx,a=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=Jw(e);if(!cx(l))throw new RangeError("Invalid time value");let s=t.match(jx).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,Mx[t])(e,o.formatLong)}return e})).join("").match(Vx).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:qx(e)};if($x[t])return{isToken:!0,value:e};if(t.match(Wx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(s=o.localize.preprocessor(l,s));const c={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return s.map((n=>{if(!n.isToken)return n.value;const r=n.value;(function(e){return Lx.test(e)}(r)||function(e){return _x.test(e)}(r))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(r),Fx.includes(e))throw new RangeError(r)}(r,t,String(e));return(0,$x[r[0]])(l,r,o.localize,c)})).join("")}function qx(e){const t=e.match(Bx);return t?t[1].replace(Hx,"'"):e}function Yx(e,t){const n=function(e){const t={},n=e.split(Ux.dateTimeDelimiter);let r;if(n.length>2)return t;/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],Ux.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Ux.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length)));if(r){const e=Ux.timezone.exec(r);e?(t.time=r.replace(e[1],""),t.timezone=e[1]):t.time=r}return t}(e);let r;if(n.date){const e=function(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const o=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:null===a?o:100*a,restDateString:e.slice((r[1]||r[2]).length)}}(n.date,2);r=function(e,t){if(null===t)return new Date(NaN);const n=e.match(Kx);if(!n)return new Date(NaN);const r=!!n[4],o=Qx(n[1]),a=Qx(n[2])-1,i=Qx(n[3]),l=Qx(n[4]),s=Qx(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,l,s)?function(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const o=r.getUTCDay()||7,a=7*(t-1)+n+1-o;return r.setUTCDate(r.getUTCDate()+a),r}(t,l,s):new Date(NaN);{const e=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(eS[t]||(tS(e)?29:28))}(t,a,i)&&function(e,t){return t>=1&&t<=(tS(e)?366:365)}(t,o)?(e.setUTCFullYear(t,a,Math.max(o,i)),e):new Date(NaN)}}(e.restDateString,e.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);const o=r.getTime();let a,i=0;if(n.time&&(i=function(e){const t=e.match(Jx);if(!t)return NaN;const n=Zx(t[1]),r=Zx(t[2]),o=Zx(t[3]);if(!function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,r,o))return NaN;return n*tx+r*ex+1e3*o}(n.time),isNaN(i)))return new Date(NaN);if(!n.timezone){const e=new Date(o+i),t=new Date(0);return t.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),t.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),t}return a=function(e){if("Z"===e)return 0;const t=e.match(Xx);if(!t)return 0;const n="+"===t[1]?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,o))return NaN;return n*(r*tx+o*ex)}(n.timezone),isNaN(a)?new Date(NaN):new Date(o+i+a)}const Ux={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Kx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Jx=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Xx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Qx(e){return e?parseInt(e):1}function Zx(e){return e&&parseFloat(e.replace(",","."))||0}const eS=[31,null,31,30,31,30,31,31,30,31,30,31];function tS(e){return e%400==0||e%4==0&&e%100!=0}const nS="-",rS=(e,t="dd MMM yyyy")=>{if(""===e||null==e)return nS;const n=Yx(e);return cx(n)?Gx(n,t):nS},oS=e=>""===e||null==e?nS:e.toLocaleString(),aS=e=>""===e||null==e?nS:e,iS=(e,t="en-GB",n="GBP")=>{let r=e;if(""===r||null==r)return nS;"string"==typeof e&&(r=Number(e));return new Intl.NumberFormat(t,{style:"currency",currency:n,minimumFractionDigits:0}).format(r)};export{Li as Accordion,Lu as AppBar,Ew as Autocomplete,Nw as AutocompleteSelectMultiple,Hi as Badge,nw as Box,Ah as Breadcrumb,ll as Button,Ub as Chip,Wi as Divider,Yw as Drawer,zu as DropDownMenu,cn as Heading,Ti as Icon,Lb as IconButton,$w as Input,zh as Layout,Kv as List,Fv as ListItem,nb as ListItemButton,Cw as ListItemDecorator,Ki as LoadingSpinner,Iu as Logo,wu as ProgressBar,Gi as ProgressCircle,dl as ReadMore,fl as RelativeTime,ec as StatusIcon,ru as Table,du as Tabs,hu as TextBlock,kw as TextField,Ou as ToastMessages,qs as Tooltip,iS as formatCurrency,rS as formatDate,oS as formatNumber,aS as formatText,Kw as useFetch,Zc as useLocalStorage,Uw as useToggle};
1298
+ `;let qw=1;const Yw=p((({children:n,side:r,size:i="md",open:l=!1,closeBlocked:s,onClose:c=(()=>{}),onCloseCompleted:d=(()=>{}),closeRequested:p=!1,...f},m)=>{const g=a(null);g.current||(g.current=`overlay-${qw}`,qw+=1);const h=a(null),[v,b]=o.useState(!1);o.useEffect((()=>{if(v){const e=setTimeout(d,200);return()=>{clearTimeout(e)}}return()=>{}})),u((()=>{p&&b(!0)}),[p]),g.current||(g.current=`modal-${qw}`,qw+=1),u((()=>{document.body.style.overflow=l?"hidden":"auto"}),[l]),u((()=>{const e=e=>{"Escape"===e.key&&(e.preventDefault(),c())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[c]);return e(zw,{open:l&&!v,anchor:r,className:`${r} ${l?"open":"closing"}`,size:i,...f,children:e(jw,{children:t(Vw,{ref:h,children:[s&&t(Ww,{role:"alert","aria-live":"assertive",children:[e(Ti,{name:["fas","exclamation-triangle"]}),t("p",{children:[e("strong",{children:"You have unsaved changes."})," Please save or cancel before closing."]})]}),e(Gw,{ref:m,children:e(Rw,{children:n})})]})})})}));function Uw(e){const[t,n]=c(e);return{value:t,toggle:f((()=>n((e=>!e))),[]),setTrue:f((()=>n(!0)),[]),setFalse:f((()=>n(!1)),[])}}const Kw=(e,t,n)=>{const[r,o]=c(null),[i,l]=c(!1),[s,d]=c(null),p=a(null);return u((()=>{if(!e)return()=>{};let r=!0;l(!0);return p.current&&clearTimeout(p.current),p.current=setTimeout((()=>{(async()=>{try{const n=await fetch(e,t);if(!n.ok)throw new Error(`Error: ${n.statusText}`);const a=await n.json();r&&(o(a),l(!1))}catch(e){r&&(d(e),l(!1))}})()}),n||0),()=>{r=!1,p.current&&clearTimeout(p.current)}}),[e,t,n]),{data:r,loading:i,error:s}};function Jw(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function Xw(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const Qw=6048e5,Zw=864e5,ex=6e4,tx=36e5;let nx={};function rx(){return nx}function ox(e,t){const n=rx(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Jw(e),a=o.getDay(),i=(a<r?7:0)+a-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function ax(e){return ox(e,{weekStartsOn:1})}function ix(e){const t=Jw(e),n=t.getFullYear(),r=Xw(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=ax(r),a=Xw(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const i=ax(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function lx(e){const t=Jw(e);return t.setHours(0,0,0,0),t}function sx(e){const t=Jw(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function cx(e){if(!(t=e,t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)||"number"==typeof e))return!1;var t;const n=Jw(e);return!isNaN(Number(n))}const ux={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 dx(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const px={date:dx({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:dx({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:dx({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},fx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function mx(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function gx(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const i=a[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(l)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(l,(e=>e.test(i))):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(l,(e=>e.test(i)));let c;c=e.valueCallback?e.valueCallback(s):s,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:t.slice(i.length)}}}var hx;const vx={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=ux[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:px,formatRelative:(e,t,n,r)=>fx[e],localize:{ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:mx({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:mx({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:mx({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:mx({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:mx({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:(hx={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(hx.matchPattern);if(!n)return null;const r=n[0],o=e.match(hx.parsePattern);if(!o)return null;let a=hx.valueCallback?hx.valueCallback(o[0]):o[0];return a=t.valueCallback?t.valueCallback(a):a,{value:a,rest:e.slice(r.length)}}),era:gx({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:gx({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:e=>e+1}),month:gx({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:gx({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:gx({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}};function bx(e){const t=Jw(e),n=function(e,t){const n=lx(e),r=lx(t),o=+n-sx(n),a=+r-sx(r);return Math.round((o-a)/Zw)}(t,function(e){const t=Jw(e),n=Xw(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(t));return n+1}function yx(e){const t=Jw(e),n=+ax(t)-+function(e){const t=ix(e),n=Xw(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),ax(n)}(t);return Math.round(n/Qw)+1}function wx(e,t){const n=Jw(e),r=n.getFullYear(),o=rx(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=Xw(e,0);i.setFullYear(r+1,0,a),i.setHours(0,0,0,0);const l=ox(i,t),s=Xw(e,0);s.setFullYear(r,0,a),s.setHours(0,0,0,0);const c=ox(s,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function xx(e,t){const n=Jw(e),r=+ox(n,t)-+function(e,t){const n=rx(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=wx(e,t),a=Xw(e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),ox(a,t)}(n,t);return Math.round(r/Qw)+1}function Sx(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const Cx={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Sx("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):Sx(n+1,2)},d:(e,t)=>Sx(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>Sx(e.getHours()%12||12,t.length),H:(e,t)=>Sx(e.getHours(),t.length),m:(e,t)=>Sx(e.getMinutes(),t.length),s:(e,t)=>Sx(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return Sx(Math.trunc(r*Math.pow(10,n-3)),t.length)}},kx="midnight",Ox="noon",Ex="morning",Ix="afternoon",Px="evening",Nx="night",$x={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return Cx.y(e,t)},Y:function(e,t,n,r){const o=wx(e,r),a=o>0?o:1-o;if("YY"===t){return Sx(a%100,2)}return"Yo"===t?n.ordinalNumber(a,{unit:"year"}):Sx(a,t.length)},R:function(e,t){return Sx(ix(e),t.length)},u:function(e,t){return Sx(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Sx(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Sx(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Cx.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Sx(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=xx(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):Sx(o,t.length)},I:function(e,t,n){const r=yx(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):Sx(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):Cx.d(e,t)},D:function(e,t,n){const r=bx(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):Sx(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Sx(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Sx(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return Sx(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(o=12===r?Ox:0===r?kx:r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(o=r>=17?Px:r>=12?Ix:r>=4?Ex:Nx,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return Cx.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):Cx.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):Sx(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):Sx(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Cx.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Cx.s(e,t)},S:function(e,t){return Cx.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return Rx(r);case"XXXX":case"XX":return Tx(r);default:return Tx(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Rx(r);case"xxxx":case"xx":return Tx(r);default:return Tx(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+zx(r,":");default:return"GMT"+Tx(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+zx(r,":");default:return"GMT"+Tx(r,":")}},t:function(e,t,n){return Sx(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return Sx(e.getTime(),t.length)}};function zx(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return 0===a?n+String(o):n+String(o)+t+Sx(a,2)}function Rx(e,t){if(e%60==0){return(e>0?"-":"+")+Sx(Math.abs(e)/60,2)}return Tx(e,t)}function Tx(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+Sx(Math.trunc(r/60),2)+t+Sx(r%60,2)}const Dx=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Ax=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Mx={p:Ax,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Dx(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",Dx(r,t)).replace("{{time}}",Ax(o,t))}},_x=/^D+$/,Lx=/^Y+$/,Fx=["D","DD","YY","YYYY"];const Vx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,jx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Bx=/^'([^]*?)'?$/,Hx=/''/g,Wx=/[a-zA-Z]/;function Gx(e,t,n){const r=rx(),o=r.locale??vx,a=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=Jw(e);if(!cx(l))throw new RangeError("Invalid time value");let s=t.match(jx).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,Mx[t])(e,o.formatLong)}return e})).join("").match(Vx).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:qx(e)};if($x[t])return{isToken:!0,value:e};if(t.match(Wx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(s=o.localize.preprocessor(l,s));const c={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return s.map((n=>{if(!n.isToken)return n.value;const r=n.value;(function(e){return Lx.test(e)}(r)||function(e){return _x.test(e)}(r))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(r),Fx.includes(e))throw new RangeError(r)}(r,t,String(e));return(0,$x[r[0]])(l,r,o.localize,c)})).join("")}function qx(e){const t=e.match(Bx);return t?t[1].replace(Hx,"'"):e}function Yx(e,t){const n=function(e){const t={},n=e.split(Ux.dateTimeDelimiter);let r;if(n.length>2)return t;/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],Ux.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Ux.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length)));if(r){const e=Ux.timezone.exec(r);e?(t.time=r.replace(e[1],""),t.timezone=e[1]):t.time=r}return t}(e);let r;if(n.date){const e=function(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const o=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:null===a?o:100*a,restDateString:e.slice((r[1]||r[2]).length)}}(n.date,2);r=function(e,t){if(null===t)return new Date(NaN);const n=e.match(Kx);if(!n)return new Date(NaN);const r=!!n[4],o=Qx(n[1]),a=Qx(n[2])-1,i=Qx(n[3]),l=Qx(n[4]),s=Qx(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,l,s)?function(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const o=r.getUTCDay()||7,a=7*(t-1)+n+1-o;return r.setUTCDate(r.getUTCDate()+a),r}(t,l,s):new Date(NaN);{const e=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(eS[t]||(tS(e)?29:28))}(t,a,i)&&function(e,t){return t>=1&&t<=(tS(e)?366:365)}(t,o)?(e.setUTCFullYear(t,a,Math.max(o,i)),e):new Date(NaN)}}(e.restDateString,e.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);const o=r.getTime();let a,i=0;if(n.time&&(i=function(e){const t=e.match(Jx);if(!t)return NaN;const n=Zx(t[1]),r=Zx(t[2]),o=Zx(t[3]);if(!function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,r,o))return NaN;return n*tx+r*ex+1e3*o}(n.time),isNaN(i)))return new Date(NaN);if(!n.timezone){const e=new Date(o+i),t=new Date(0);return t.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),t.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),t}return a=function(e){if("Z"===e)return 0;const t=e.match(Xx);if(!t)return 0;const n="+"===t[1]?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,o))return NaN;return n*(r*tx+o*ex)}(n.timezone),isNaN(a)?new Date(NaN):new Date(o+i+a)}const Ux={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Kx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Jx=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Xx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Qx(e){return e?parseInt(e):1}function Zx(e){return e&&parseFloat(e.replace(",","."))||0}const eS=[31,null,31,30,31,30,31,31,30,31,30,31];function tS(e){return e%400==0||e%4==0&&e%100!=0}const nS="-",rS=(e,t="dd MMM yyyy")=>{if(""===e||null==e)return nS;const n=Yx(e);return cx(n)?Gx(n,t):nS},oS=e=>""===e||null==e?nS:e.toLocaleString(),aS=e=>""===e||null==e?nS:e,iS={style:"currency",currency:"GBP",minimumFractionDigits:0,maximumFractionDigits:0},lS=(e,t="en-GB",n=iS)=>{let r=e;if(""===r||null==r)return nS;"string"==typeof e&&(r=Number(e));return new Intl.NumberFormat(t,{...iS,...n}).format(r)};export{Li as Accordion,Lu as AppBar,Ew as Autocomplete,Nw as AutocompleteSelectMultiple,Hi as Badge,nw as Box,Ah as Breadcrumb,ll as Button,Ub as Chip,Wi as Divider,Yw as Drawer,zu as DropDownMenu,cn as Heading,Ti as Icon,Lb as IconButton,$w as Input,zh as Layout,Kv as List,Fv as ListItem,nb as ListItemButton,Cw as ListItemDecorator,Ki as LoadingSpinner,Iu as Logo,wu as ProgressBar,Gi as ProgressCircle,dl as ReadMore,fl as RelativeTime,ec as StatusIcon,ru as Table,du as Tabs,hu as TextBlock,kw as TextField,Ou as ToastMessages,qs as Tooltip,lS as formatCurrency,rS as formatDate,oS as formatNumber,aS as formatText,Kw as useFetch,Zc as useLocalStorage,Uw as useToggle};
1293
1299
  //# sourceMappingURL=index.js.map