@freshworks/crayons
Version:
Crayons Web Components library
1 lines • 96.7 kB
JavaScript
import{r as t,c as e,h as i,i as n,e as r}from"./p-c5706edf.js";import{g as a,a as o,h as s,r as h,f as c,w as l}from"./p-c9855591.js";import{F as d}from"./p-07dc799d.js";import{T as u,i as f}from"./p-965d32ba.js";function p(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function w(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function b(t){w(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function m(t,e){w(2,arguments);var i=b(t).getTime(),n=p(e);return new Date(i+n)}function g(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function x(t,e){w(2,arguments);var i=p(e);return m(t,6e4*i)}function v(t){return w(1,arguments),t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)}function y(t){if(w(1,arguments),!v(t)&&"number"!=typeof t)return!1;var e=b(t);return!isNaN(Number(e))}var k={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 D(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.width?String(e.width):t.defaultWidth,n=t.formats[i]||t.formats[t.defaultWidth];return n}}var M={date:D({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:D({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:D({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},T={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function E(t){return function(e,i){var n,r=i||{};if("formatting"===(r.context?String(r.context):"standalone")&&t.formattingValues){var a=t.defaultFormattingWidth||t.defaultWidth,o=r.width?String(r.width):a;n=t.formattingValues[o]||t.formattingValues[a]}else{var s=t.defaultWidth,h=r.width?String(r.width):t.defaultWidth;n=t.values[h]||t.values[s]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function S(t){return function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.width,r=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],a=e.match(r);if(!a)return null;var o,s=a[0],h=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(h)?z(h,(function(t){return t.test(s)})):N(h,(function(t){return t.test(s)}));o=t.valueCallback?t.valueCallback(c):c,o=i.valueCallback?i.valueCallback(o):o;var l=e.slice(s.length);return{value:o,rest:l}}}function N(t,e){for(var i in t)if(t.hasOwnProperty(i)&&e(t[i]))return i}function z(t,e){for(var i=0;i<t.length;i++)if(e(t[i]))return i}var q,I={code:"en-US",formatDistance:function(t,e,i){var n,r=k[t];return n="string"==typeof r?r:1===e?r.one:r.other.replace("{{count}}",e.toString()),null!=i&&i.addSuffix?i.comparison&&i.comparison>0?"in "+n:n+" ago":n},formatLong:M,formatRelative:function(t){return T[t]},localize:{ordinalNumber:function(t){var e=Number(t),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:E({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:E({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:E({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:E({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:E({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:(q={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.match(q.matchPattern);if(!i)return null;var n=i[0],r=t.match(q.parsePattern);if(!r)return null;var a=q.valueCallback?q.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;var o=t.slice(n.length);return{value:a,rest:o}}),era:S({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:S({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:S({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:S({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:S({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 C(t,e){w(2,arguments);var i=p(e);return m(t,-i)}function P(t){w(1,arguments);var e=1,i=b(t),n=i.getUTCDay(),r=(n<e?7:0)+n-e;return i.setUTCDate(i.getUTCDate()-r),i.setUTCHours(0,0,0,0),i}function L(t){w(1,arguments);var e=b(t),i=e.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(i+1,0,4),n.setUTCHours(0,0,0,0);var r=P(n),a=new Date(0);a.setUTCFullYear(i,0,4),a.setUTCHours(0,0,0,0);var o=P(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function R(t){w(1,arguments);var e=L(t),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var n=P(i);return n}function Q(t){w(1,arguments);var e=b(t),i=P(e).getTime()-R(e).getTime();return Math.round(i/6048e5)+1}function B(t,e){w(1,arguments);var i=e||{},n=i.locale,r=n&&n.options&&n.options.weekStartsOn,a=null==r?0:p(r),o=null==i.weekStartsOn?a:p(i.weekStartsOn);if(!(o>=0&&o<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=b(t),h=s.getUTCDay(),c=(h<o?7:0)+h-o;return s.setUTCDate(s.getUTCDate()-c),s.setUTCHours(0,0,0,0),s}function Y(t,e){w(1,arguments);var i=b(t),n=i.getUTCFullYear(),r=e||{},a=r.locale,o=a&&a.options&&a.options.firstWeekContainsDate,s=null==o?1:p(o),h=null==r.firstWeekContainsDate?s:p(r.firstWeekContainsDate);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(n+1,0,h),c.setUTCHours(0,0,0,0);var l=B(c,e),d=new Date(0);d.setUTCFullYear(n,0,h),d.setUTCHours(0,0,0,0);var u=B(d,e);return i.getTime()>=l.getTime()?n+1:i.getTime()>=u.getTime()?n:n-1}function X(t,e){w(1,arguments);var i=e||{},n=i.locale,r=n&&n.options&&n.options.firstWeekContainsDate,a=null==r?1:p(r),o=null==i.firstWeekContainsDate?a:p(i.firstWeekContainsDate),s=Y(t,e),h=new Date(0);h.setUTCFullYear(s,0,o),h.setUTCHours(0,0,0,0);var c=B(h,e);return c}function W(t,e){w(1,arguments);var i=b(t),n=B(i,e).getTime()-X(i,e).getTime();return Math.round(n/6048e5)+1}function A(t,e){for(var i=t<0?"-":"",n=Math.abs(t).toString();n.length<e;)n="0"+n;return i+n}var $={G:function(t,e,i){var n=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"});case"GGGGG":return i.era(n,{width:"narrow"});case"GGGG":default:return i.era(n,{width:"wide"})}},y:function(t,e,i){if("yo"===e){var n=t.getUTCFullYear();return i.ordinalNumber(n>0?n:1-n,{unit:"year"})}return function(t,e){var i=t.getUTCFullYear(),n=i>0?i:1-i;return A("yy"===e?n%100:n,e.length)}(t,e)},Y:function(t,e,i,n){var r=Y(t,n),a=r>0?r:1-r;return"YY"===e?A(a%100,2):"Yo"===e?i.ordinalNumber(a,{unit:"year"}):A(a,e.length)},R:function(t,e){return A(L(t),e.length)},u:function(t,e){return A(t.getUTCFullYear(),e.length)},Q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return A(n,2);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return A(n,2);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,i){var n=t.getUTCMonth();switch(e){case"M":case"MM":return function(t,e){var i=t.getUTCMonth();return"M"===e?String(i+1):A(i+1,2)}(t,e);case"Mo":return i.ordinalNumber(n+1,{unit:"month"});case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,i){var n=t.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return A(n+1,2);case"Lo":return i.ordinalNumber(n+1,{unit:"month"});case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,i,n){var r=W(t,n);return"wo"===e?i.ordinalNumber(r,{unit:"week"}):A(r,e.length)},I:function(t,e,i){var n=Q(t);return"Io"===e?i.ordinalNumber(n,{unit:"week"}):A(n,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):function(t,e){return A(t.getUTCDate(),e.length)}(t,e)},D:function(t,e,i){var n=function(t){w(1,arguments);var e=b(t),i=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var n=e.getTime();return Math.floor((i-n)/864e5)+1}(t);return"Do"===e?i.ordinalNumber(n,{unit:"dayOfYear"}):A(n,e.length)},E:function(t,e,i){var n=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"});case"EEEE":default:return i.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,i,n){var r=t.getUTCDay(),a=(r-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return A(a,2);case"eo":return i.ordinalNumber(a,{unit:"day"});case"eee":return i.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(r,{width:"short",context:"formatting"});case"eeee":default:return i.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,i,n){var r=t.getUTCDay(),a=(r-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return A(a,e.length);case"co":return i.ordinalNumber(a,{unit:"day"});case"ccc":return i.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(r,{width:"narrow",context:"standalone"});case"cccccc":return i.day(r,{width:"short",context:"standalone"});case"cccc":default:return i.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,i){var n=t.getUTCDay(),r=0===n?7:n;switch(e){case"i":return String(r);case"ii":return A(r,e.length);case"io":return i.ordinalNumber(r,{unit:"day"});case"iii":return i.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(n,{width:"short",context:"formatting"});case"iiii":default:return i.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,i){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,i){var n,r=t.getUTCHours();switch(n=12===r?"noon":0===r?"midnight":r/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(t,e,i){var n,r=t.getUTCHours();switch(n=r>=17?"evening":r>=12?"afternoon":r>=4?"morning":"night",e){case"B":case"BB":case"BBB":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){var n=t.getUTCHours()%12;return 0===n&&(n=12),i.ordinalNumber(n,{unit:"hour"})}return function(t,e){return A(t.getUTCHours()%12||12,e.length)}(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):function(t,e){return A(t.getUTCHours(),e.length)}(t,e)},K:function(t,e,i){var n=t.getUTCHours()%12;return"Ko"===e?i.ordinalNumber(n,{unit:"hour"}):A(n,e.length)},k:function(t,e,i){var n=t.getUTCHours();return 0===n&&(n=24),"ko"===e?i.ordinalNumber(n,{unit:"hour"}):A(n,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):function(t,e){return A(t.getUTCMinutes(),e.length)}(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):function(t,e){return A(t.getUTCSeconds(),e.length)}(t,e)},S:function(t,e){return function(t,e){var i=e.length,n=t.getUTCMilliseconds();return A(Math.floor(n*Math.pow(10,i-3)),e.length)}(t,e)},X:function(t,e,i,n){var r=(n._originalDate||t).getTimezoneOffset();if(0===r)return"Z";switch(e){case"X":return F(r);case"XXXX":case"XX":return G(r);case"XXXXX":case"XXX":default:return G(r,":")}},x:function(t,e,i,n){var r=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return F(r);case"xxxx":case"xx":return G(r);case"xxxxx":case"xxx":default:return G(r,":")}},O:function(t,e,i,n){var r=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+O(r,":");case"OOOO":default:return"GMT"+G(r,":")}},z:function(t,e,i,n){var r=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+O(r,":");case"zzzz":default:return"GMT"+G(r,":")}},t:function(t,e,i,n){return A(Math.floor((n._originalDate||t).getTime()/1e3),e.length)},T:function(t,e,i,n){return A((n._originalDate||t).getTime(),e.length)}};function O(t,e){var i=t>0?"-":"+",n=Math.abs(t),r=Math.floor(n/60),a=n%60;if(0===a)return i+String(r);var o=e||"";return i+String(r)+o+A(a,2)}function F(t,e){return t%60==0?(t>0?"-":"+")+A(Math.abs(t)/60,2):G(t,e)}function G(t,e){var i=e||"",n=t>0?"-":"+",r=Math.abs(t);return n+A(Math.floor(r/60),2)+i+A(r%60,2)}function j(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"})}}function H(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"})}}var U={p:H,P:function(t,e){var i,n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return j(t,e);switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",j(r,e)).replace("{{time}}",H(a,e))}},K=["D","DD"],_=["YY","YYYY"];function J(t){return-1!==K.indexOf(t)}function Z(t){return-1!==_.indexOf(t)}function V(t,e,i){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://git.io/fxCyr"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://git.io/fxCyr"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://git.io/fxCyr"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://git.io/fxCyr"))}var tt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,et=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,it=/^'([^]*?)'?$/,nt=/''/g,rt=/[a-zA-Z]/;function at(t,e,i){w(2,arguments);var n=String(e),r=i||{},a=r.locale||I,o=a.options&&a.options.firstWeekContainsDate,s=null==o?1:p(o),h=null==r.firstWeekContainsDate?s:p(r.firstWeekContainsDate);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=a.options&&a.options.weekStartsOn,l=null==c?0:p(c),d=null==r.weekStartsOn?l:p(r.weekStartsOn);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!a.localize)throw new RangeError("locale must contain localize property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var u=b(t);if(!y(u))throw new RangeError("Invalid time value");var f=g(u),m=C(u,f),x={firstWeekContainsDate:h,weekStartsOn:d,locale:a,_originalDate:u},v=n.match(et).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,U[e])(t,a.formatLong,x):t})).join("").match(tt).map((function(i){if("''"===i)return"'";var n=i[0];if("'"===n)return ot(i);var o=$[n];if(o)return!r.useAdditionalWeekYearTokens&&Z(i)&&V(i,e,t),!r.useAdditionalDayOfYearTokens&&J(i)&&V(i,e,t),o(m,i,a.localize,x);if(n.match(rt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return i})).join("");return v}function ot(t){return t.match(it)[1].replace(nt,"'")}function st(t,e){if(null==t)throw new TypeError("assign requires that input parameter not be null or undefined");for(var i in e=e||{})Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}function ht(t,e){w(1,arguments);var i=b(t);if(isNaN(i.getTime()))throw new RangeError("Invalid time value");var n=null!=e&&e.format?String(e.format):"extended",r=null!=e&&e.representation?String(e.representation):"complete";if("extended"!==n&&"basic"!==n)throw new RangeError("format must be 'extended' or 'basic'");if("date"!==r&&"time"!==r&&"complete"!==r)throw new RangeError("representation must be 'date', 'time', or 'complete'");var a="",o="",s="extended"===n?"-":"",h="extended"===n?":":"";if("time"!==r){var c=A(i.getDate(),2),l=A(i.getMonth()+1,2),d=A(i.getFullYear(),4);a="".concat(d).concat(s).concat(l).concat(s).concat(c)}if("date"!==r){var u=i.getTimezoneOffset();if(0!==u){var f=Math.abs(u),p=A(Math.floor(f/60),2),m=A(f%60,2),g=u<0?"+":"-";o="".concat(g).concat(p,":").concat(m)}else o="Z";var x=A(i.getHours(),2),v=A(i.getMinutes(),2),y=A(i.getSeconds(),2),k=""===a?"":"T",D=[x,v,y].join(h);a="".concat(a).concat(k).concat(D).concat(o)}return a}function ct(t){w(1,arguments);var e=b(t),i=e.getDate();return i}function lt(t){w(1,arguments);var e=b(t),i=e.getFullYear(),n=e.getMonth(),r=new Date(0);return r.setFullYear(i,n+1,0),r.setHours(0,0,0,0),r.getDate()}function dt(t){w(1,arguments);var e=b(t),i=e.getMonth();return i}function ut(t){return w(1,arguments),b(t).getFullYear()}function ft(t,e,i){w(2,arguments);var n=i||{},r=n.locale,a=r&&r.options&&r.options.weekStartsOn,o=null==a?0:p(a),s=null==n.weekStartsOn?o:p(n.weekStartsOn);if(!(s>=0&&s<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=b(t),c=p(e),l=h.getUTCDay(),d=c%7,u=(d+7)%7,f=(u<s?7:0)+c-l;return h.setUTCDate(h.getUTCDate()+f),h}var pt=/^(1[0-2]|0?\d)/,wt=/^(3[0-1]|[0-2]?\d)/,bt=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,mt=/^(5[0-3]|[0-4]?\d)/,gt=/^(2[0-3]|[0-1]?\d)/,xt=/^(2[0-4]|[0-1]?\d)/,vt=/^(1[0-1]|0?\d)/,yt=/^(1[0-2]|0?\d)/,kt=/^[0-5]?\d/,Dt=/^[0-5]?\d/,Mt=/^\d/,Tt=/^\d{1,2}/,Et=/^\d{1,3}/,St=/^\d{1,4}/,Nt=/^-?\d+/,zt=/^-?\d/,qt=/^-?\d{1,2}/,It=/^-?\d{1,3}/,Ct=/^-?\d{1,4}/,Pt=/^([+-])(\d{2})(\d{2})?|Z/,Lt=/^([+-])(\d{2})(\d{2})|Z/,Rt=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,Qt=/^([+-])(\d{2}):(\d{2})|Z/,Bt=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function Yt(t,e,i){var n=e.match(t);if(!n)return null;var r=parseInt(n[0],10);return{value:i?i(r):r,rest:e.slice(n[0].length)}}function Xt(t,e){var i=e.match(t);return i?"Z"===i[0]?{value:0,rest:e.slice(1)}:{value:("+"===i[1]?1:-1)*(36e5*(i[2]?parseInt(i[2],10):0)+6e4*(i[3]?parseInt(i[3],10):0)+1e3*(i[5]?parseInt(i[5],10):0)),rest:e.slice(i[0].length)}:null}function Wt(t,e){return Yt(Nt,t,e)}function At(t,e,i){switch(t){case 1:return Yt(Mt,e,i);case 2:return Yt(Tt,e,i);case 3:return Yt(Et,e,i);case 4:return Yt(St,e,i);default:return Yt(new RegExp("^\\d{1,"+t+"}"),e,i)}}function $t(t,e,i){switch(t){case 1:return Yt(zt,e,i);case 2:return Yt(qt,e,i);case 3:return Yt(It,e,i);case 4:return Yt(Ct,e,i);default:return Yt(new RegExp("^-?\\d{1,"+t+"}"),e,i)}}function Ot(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Ft(t,e){var i,n=e>0,r=n?e:1-e;if(r<=50)i=t||100;else{var a=r+50;i=t+100*Math.floor(a/100)-(t>=a%100?100:0)}return n?i:1-i}var Gt=[31,28,31,30,31,30,31,31,30,31,30,31],jt=[31,29,31,30,31,30,31,31,30,31,30,31];function Ht(t){return t%400==0||t%4==0&&t%100!=0}var Ut={G:{priority:140,parse:function(t,e,i){switch(e){case"G":case"GG":case"GGG":return i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"});case"GGGGG":return i.era(t,{width:"narrow"});case"GGGG":default:return i.era(t,{width:"wide"})||i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"})}},set:function(t,e,i){return e.era=i,t.setUTCFullYear(i,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["R","u","t","T"]},y:{priority:130,parse:function(t,e,i){var n=function(t){return{year:t,isTwoDigitYear:"yy"===e}};switch(e){case"y":return At(4,t,n);case"yo":return i.ordinalNumber(t,{unit:"year",valueCallback:n});default:return At(e.length,t,n)}},validate:function(t,e){return e.isTwoDigitYear||e.year>0},set:function(t,e,i){var n=t.getUTCFullYear();if(i.isTwoDigitYear){var r=Ft(i.year,n);return t.setUTCFullYear(r,0,1),t.setUTCHours(0,0,0,0),t}return t.setUTCFullYear("era"in e&&1!==e.era?1-i.year:i.year,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","u","w","I","i","e","c","t","T"]},Y:{priority:130,parse:function(t,e,i){var n=function(t){return{year:t,isTwoDigitYear:"YY"===e}};switch(e){case"Y":return At(4,t,n);case"Yo":return i.ordinalNumber(t,{unit:"year",valueCallback:n});default:return At(e.length,t,n)}},validate:function(t,e){return e.isTwoDigitYear||e.year>0},set:function(t,e,i,n){var r=Y(t,n);if(i.isTwoDigitYear){var a=Ft(i.year,r);return t.setUTCFullYear(a,0,n.firstWeekContainsDate),t.setUTCHours(0,0,0,0),B(t,n)}return t.setUTCFullYear("era"in e&&1!==e.era?1-i.year:i.year,0,n.firstWeekContainsDate),t.setUTCHours(0,0,0,0),B(t,n)},incompatibleTokens:["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:{priority:130,parse:function(t,e){return $t("R"===e?4:e.length,t)},set:function(t,e,i){var n=new Date(0);return n.setUTCFullYear(i,0,4),n.setUTCHours(0,0,0,0),P(n)},incompatibleTokens:["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:{priority:130,parse:function(t,e){return $t("u"===e?4:e.length,t)},set:function(t,e,i){return t.setUTCFullYear(i,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["G","y","Y","R","w","I","i","e","c","t","T"]},Q:{priority:120,parse:function(t,e,i){switch(e){case"Q":case"QQ":return At(e.length,t);case"Qo":return i.ordinalNumber(t,{unit:"quarter"});case"QQQ":return i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(t,{width:"wide",context:"formatting"})||i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"})}},validate:function(t,e){return e>=1&&e<=4},set:function(t,e,i){return t.setUTCMonth(3*(i-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:{priority:120,parse:function(t,e,i){switch(e){case"q":case"qq":return At(e.length,t);case"qo":return i.ordinalNumber(t,{unit:"quarter"});case"qqq":return i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(t,{width:"wide",context:"standalone"})||i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"})}},validate:function(t,e){return e>=1&&e<=4},set:function(t,e,i){return t.setUTCMonth(3*(i-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:{priority:110,parse:function(t,e,i){var n=function(t){return t-1};switch(e){case"M":return Yt(pt,t,n);case"MM":return At(2,t,n);case"Mo":return i.ordinalNumber(t,{unit:"month",valueCallback:n});case"MMM":return i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(t,{width:"wide",context:"formatting"})||i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"})}},validate:function(t,e){return e>=0&&e<=11},set:function(t,e,i){return t.setUTCMonth(i,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]},L:{priority:110,parse:function(t,e,i){var n=function(t){return t-1};switch(e){case"L":return Yt(pt,t,n);case"LL":return At(2,t,n);case"Lo":return i.ordinalNumber(t,{unit:"month",valueCallback:n});case"LLL":return i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(t,{width:"wide",context:"standalone"})||i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"})}},validate:function(t,e){return e>=0&&e<=11},set:function(t,e,i){return t.setUTCMonth(i,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:{priority:100,parse:function(t,e,i){switch(e){case"w":return Yt(mt,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return At(e.length,t)}},validate:function(t,e){return e>=1&&e<=53},set:function(t,e,i,n){return B(function(t,e,i){w(2,arguments);var n=b(t),r=p(e),a=W(n,i)-r;return n.setUTCDate(n.getUTCDate()-7*a),n}(t,i,n),n)},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:{priority:100,parse:function(t,e,i){switch(e){case"I":return Yt(mt,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return At(e.length,t)}},validate:function(t,e){return e>=1&&e<=53},set:function(t,e,i,n){return P(function(t,e){w(2,arguments);var i=b(t),n=p(e),r=Q(i)-n;return i.setUTCDate(i.getUTCDate()-7*r),i}(t,i,n),n)},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:{priority:90,subPriority:1,parse:function(t,e,i){switch(e){case"d":return Yt(wt,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return At(e.length,t)}},validate:function(t,e){var i=Ht(t.getUTCFullYear()),n=t.getUTCMonth();return i?e>=1&&e<=jt[n]:e>=1&&e<=Gt[n]},set:function(t,e,i){return t.setUTCDate(i),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:{priority:90,subPriority:1,parse:function(t,e,i){switch(e){case"D":case"DD":return Yt(bt,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return At(e.length,t)}},validate:function(t,e){return Ht(t.getUTCFullYear())?e>=1&&e<=366:e>=1&&e<=365},set:function(t,e,i){return t.setUTCMonth(0,i),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:{priority:90,parse:function(t,e,i){switch(e){case"E":case"EE":case"EEE":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e){return e>=0&&e<=6},set:function(t,e,i,n){return(t=ft(t,i,n)).setUTCHours(0,0,0,0),t},incompatibleTokens:["D","i","e","c","t","T"]},e:{priority:90,parse:function(t,e,i,n){var r=function(t){var e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return At(e.length,t,r);case"eo":return i.ordinalNumber(t,{unit:"day",valueCallback:r});case"eee":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeeee":return i.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e){return e>=0&&e<=6},set:function(t,e,i,n){return(t=ft(t,i,n)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:{priority:90,parse:function(t,e,i,n){var r=function(t){var e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return At(e.length,t,r);case"co":return i.ordinalNumber(t,{unit:"day",valueCallback:r});case"ccc":return i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"ccccc":return i.day(t,{width:"narrow",context:"standalone"});case"cccccc":return i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return i.day(t,{width:"wide",context:"standalone"})||i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"})}},validate:function(t,e){return e>=0&&e<=6},set:function(t,e,i,n){return(t=ft(t,i,n)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:{priority:90,parse:function(t,e,i){var n=function(t){return 0===t?7:t};switch(e){case"i":case"ii":return At(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return i.day(t,{width:"abbreviated",context:"formatting",valueCallback:n})||i.day(t,{width:"short",context:"formatting",valueCallback:n})||i.day(t,{width:"narrow",context:"formatting",valueCallback:n});case"iiiii":return i.day(t,{width:"narrow",context:"formatting",valueCallback:n});case"iiiiii":return i.day(t,{width:"short",context:"formatting",valueCallback:n})||i.day(t,{width:"narrow",context:"formatting",valueCallback:n});case"iiii":default:return i.day(t,{width:"wide",context:"formatting",valueCallback:n})||i.day(t,{width:"abbreviated",context:"formatting",valueCallback:n})||i.day(t,{width:"short",context:"formatting",valueCallback:n})||i.day(t,{width:"narrow",context:"formatting",valueCallback:n})}},validate:function(t,e){return e>=1&&e<=7},set:function(t,e,i,n){return(t=function(t,e){w(2,arguments);var i=p(e);i%7==0&&(i-=7);var n=1,r=b(t),a=r.getUTCDay(),o=((i%7+7)%7<n?7:0)+i-a;return r.setUTCDate(r.getUTCDate()+o),r}(t,i,n)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:{priority:80,parse:function(t,e,i){switch(e){case"a":case"aa":case"aaa":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,i){return t.setUTCHours(Ot(i),0,0,0),t},incompatibleTokens:["b","B","H","k","t","T"]},b:{priority:80,parse:function(t,e,i){switch(e){case"b":case"bb":case"bbb":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,i){return t.setUTCHours(Ot(i),0,0,0),t},incompatibleTokens:["a","B","H","k","t","T"]},B:{priority:80,parse:function(t,e,i){switch(e){case"B":case"BB":case"BBB":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,i){return t.setUTCHours(Ot(i),0,0,0),t},incompatibleTokens:["a","b","t","T"]},h:{priority:70,parse:function(t,e,i){switch(e){case"h":return Yt(yt,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return At(e.length,t)}},validate:function(t,e){return e>=1&&e<=12},set:function(t,e,i){var n=t.getUTCHours()>=12;return t.setUTCHours(n&&i<12?i+12:n||12!==i?i:0,0,0,0),t},incompatibleTokens:["H","K","k","t","T"]},H:{priority:70,parse:function(t,e,i){switch(e){case"H":return Yt(gt,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return At(e.length,t)}},validate:function(t,e){return e>=0&&e<=23},set:function(t,e,i){return t.setUTCHours(i,0,0,0),t},incompatibleTokens:["a","b","h","K","k","t","T"]},K:{priority:70,parse:function(t,e,i){switch(e){case"K":return Yt(vt,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return At(e.length,t)}},validate:function(t,e){return e>=0&&e<=11},set:function(t,e,i){var n=t.getUTCHours()>=12;return t.setUTCHours(n&&i<12?i+12:i,0,0,0),t},incompatibleTokens:["h","H","k","t","T"]},k:{priority:70,parse:function(t,e,i){switch(e){case"k":return Yt(xt,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return At(e.length,t)}},validate:function(t,e){return e>=1&&e<=24},set:function(t,e,i){return t.setUTCHours(i<=24?i%24:i,0,0,0),t},incompatibleTokens:["a","b","h","H","K","t","T"]},m:{priority:60,parse:function(t,e,i){switch(e){case"m":return Yt(kt,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return At(e.length,t)}},validate:function(t,e){return e>=0&&e<=59},set:function(t,e,i){return t.setUTCMinutes(i,0,0),t},incompatibleTokens:["t","T"]},s:{priority:50,parse:function(t,e,i){switch(e){case"s":return Yt(Dt,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return At(e.length,t)}},validate:function(t,e){return e>=0&&e<=59},set:function(t,e,i){return t.setUTCSeconds(i,0),t},incompatibleTokens:["t","T"]},S:{priority:30,parse:function(t,e){return At(e.length,t,(function(t){return Math.floor(t*Math.pow(10,3-e.length))}))},set:function(t,e,i){return t.setUTCMilliseconds(i),t},incompatibleTokens:["t","T"]},X:{priority:10,parse:function(t,e){switch(e){case"X":return Xt(Pt,t);case"XX":return Xt(Lt,t);case"XXXX":return Xt(Rt,t);case"XXXXX":return Xt(Bt,t);case"XXX":default:return Xt(Qt,t)}},set:function(t,e,i){return e.timestampIsSet?t:new Date(t.getTime()-i)},incompatibleTokens:["t","T","x"]},x:{priority:10,parse:function(t,e){switch(e){case"x":return Xt(Pt,t);case"xx":return Xt(Lt,t);case"xxxx":return Xt(Rt,t);case"xxxxx":return Xt(Bt,t);case"xxx":default:return Xt(Qt,t)}},set:function(t,e,i){return e.timestampIsSet?t:new Date(t.getTime()-i)},incompatibleTokens:["t","T","X"]},t:{priority:40,parse:function(t){return Wt(t)},set:function(t,e,i){return[new Date(1e3*i),{timestampIsSet:!0}]},incompatibleTokens:"*"},T:{priority:20,parse:function(t){return Wt(t)},set:function(t,e,i){return[new Date(i),{timestampIsSet:!0}]},incompatibleTokens:"*"}},Kt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_t=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Jt=/^'([^]*?)'?$/,Zt=/''/g,Vt=/\S/,te=/[a-zA-Z]/;function ee(t,e,i,n){w(3,arguments);var r=String(t),a=String(e),o=n||{},s=o.locale||I;if(!s.match)throw new RangeError("locale must contain match property");var h=s.options&&s.options.firstWeekContainsDate,c=null==h?1:p(h),l=null==o.firstWeekContainsDate?c:p(o.firstWeekContainsDate);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=s.options&&s.options.weekStartsOn,u=null==d?0:p(d),f=null==o.weekStartsOn?u:p(o.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===a)return""===r?b(i):new Date(NaN);var m,x={firstWeekContainsDate:l,weekStartsOn:f,locale:s},v=[{priority:10,subPriority:-1,set:ie,index:0}],y=a.match(_t).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,U[e])(t,s.formatLong,x):t})).join("").match(Kt),k=[];for(m=0;m<y.length;m++){var D=y[m];!o.useAdditionalWeekYearTokens&&Z(D)&&V(D,a,t),!o.useAdditionalDayOfYearTokens&&J(D)&&V(D,a,t);var M=D[0],T=Ut[M];if(T){var E=T.incompatibleTokens;if(Array.isArray(E)){for(var S=void 0,N=0;N<k.length;N++){var z=k[N].token;if(-1!==E.indexOf(z)||z===M){S=k[N];break}}if(S)throw new RangeError("The format string mustn't contain `".concat(S.fullToken,"` and `").concat(D,"` at the same time"))}else if("*"===T.incompatibleTokens&&k.length)throw new RangeError("The format string mustn't contain `".concat(D,"` and any other token at the same time"));k.push({token:M,fullToken:D});var q=T.parse(r,D,s.match,x);if(!q)return new Date(NaN);v.push({priority:T.priority,subPriority:T.subPriority||0,set:T.set,validate:T.validate,value:q.value,index:v.length}),r=q.rest}else{if(M.match(te))throw new RangeError("Format string contains an unescaped latin alphabet character `"+M+"`");if("''"===D?D="'":"'"===M&&(D=ne(D)),0!==r.indexOf(D))return new Date(NaN);r=r.slice(D.length)}}if(r.length>0&&Vt.test(r))return new Date(NaN);var P=v.map((function(t){return t.priority})).sort((function(t,e){return e-t})).filter((function(t,e,i){return i.indexOf(t)===e})).map((function(t){return v.filter((function(e){return e.priority===t})).sort((function(t,e){return e.subPriority-t.subPriority}))})).map((function(t){return t[0]})),L=b(i);if(isNaN(L))return new Date(NaN);var R=C(L,g(L)),Q={};for(m=0;m<P.length;m++){var B=P[m];if(B.validate&&!B.validate(R,B.value,x))return new Date(NaN);var Y=B.set(R,Q,B.value,x);Y[0]?(R=Y[0],st(Q,Y[1])):R=Y}return R}function ie(t,e){if(e.timestampIsSet)return t;var i=new Date(0);return i.setFullYear(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),i.setHours(t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()),i}function ne(t){return t.match(Jt)[1].replace(Zt,"'")}function re(t,e,i){return w(2,arguments),y(ee(t,e,new Date,i))}function ae(t,e){w(1,arguments);var i=e||{},n=null==i.additionalDigits?2:p(i.additionalDigits);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var r,a=le(t);if(a.date){var o=de(a.date,n);r=ue(o.restDateString,o.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var s,h=r.getTime(),c=0;if(a.time&&(c=pe(a.time),isNaN(c)))return new Date(NaN);if(!a.timezone){var l=new Date(h+c),d=new Date(0);return d.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),d.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),d}return s=be(a.timezone),isNaN(s)?new Date(NaN):new Date(h+c+s)}var oe={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},se=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,he=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ce=/^([+-])(\d{2})(?::?(\d{2}))?$/;function le(t){var e,i={},n=t.split(oe.dateTimeDelimiter);if(n.length>2)return i;if(/:/.test(n[0])?e=n[0]:(i.date=n[0],e=n[1],oe.timeZoneDelimiter.test(i.date)&&(i.date=t.split(oe.timeZoneDelimiter)[0],e=t.substr(i.date.length,t.length))),e){var r=oe.timezone.exec(e);r?(i.time=e.replace(r[1],""),i.timezone=r[1]):i.time=e}return i}function de(t,e){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(i);if(!n)return{year:NaN,restDateString:""};var r=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:null===a?r:100*a,restDateString:t.slice((n[1]||n[2]).length)}}function ue(t,e){if(null===e)return new Date(NaN);var i=t.match(se);if(!i)return new Date(NaN);var n=!!i[4],r=fe(i[1]),a=fe(i[2])-1,o=fe(i[3]),s=fe(i[4]),h=fe(i[5])-1;if(n)return function(t,e,i){return e>=1&&e<=53&&i>=0&&i<=6}(0,s,h)?function(t,e,i){var n=new Date(0);n.setUTCFullYear(t,0,4);var r=7*(e-1)+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+r),n}(e,s,h):new Date(NaN);var c=new Date(0);return function(t,e,i){return e>=0&&e<=11&&i>=1&&i<=(me[e]||(ge(t)?29:28))}(e,a,o)&&function(t,e){return e>=1&&e<=(ge(t)?366:365)}(e,r)?(c.setUTCFullYear(e,a,Math.max(r,o)),c):new Date(NaN)}function fe(t){return t?parseInt(t):1}function pe(t){var e=t.match(he);if(!e)return NaN;var i=we(e[1]),n=we(e[2]),r=we(e[3]);return function(t,e,i){return 24===t?0===e&&0===i:i>=0&&i<60&&e>=0&&e<60&&t>=0&&t<25}(i,n,r)?36e5*i+6e4*n+1e3*r:NaN}function we(t){return t&&parseFloat(t.replace(",","."))||0}function be(t){if("Z"===t)return 0;var e=t.match(ce);if(!e)return 0;var i="+"===e[1]?-1:1,n=parseInt(e[2]),r=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,r)?i*(36e5*n+6e4*r):NaN}var me=[31,null,31,30,31,30,31,31,30,31,30,31];function ge(t){return t%400==0||t%4==0&&t%100!=0}var xe=function(t,e,i,n){var r,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,i,o):r(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};const ve=["S","M","T","W","T","F","S"],ye=[{value:"Jan",text:"January"},{value:"Feb",text:"February"},{value:"Mar",text:"March"},{value:"Apr",text:"April"},{value:"May",text:"May"},{value:"Jun",text:"June"},{value:"Jul",text:"July"},{value:"Aug",text:"August"},{value:"Sep",text:"September"},{value:"Oct",text:"October"},{value:"Nov",text:"November"},{value:"Dec",text:"December"}],ke=t=>{if(!t)return{longMonthNames:ye.map((t=>t.text)),shortMonthNames:ye.map((t=>t.value))};const e=[],i=[];for(let n=0;n<=11;n++)e.push(t.localize.month(n,{width:"abbreviated"})),i.push(t.localize.month(n));return{longMonthNames:i,shortMonthNames:e}},De=t=>t?Array.from(Array(7)).map(((e,i)=>at(function(t,e){w(2,arguments);var i=b(t),n=p(e);return isNaN(n)?new Date(NaN):n?(i.setDate(i.getDate()+n),i):i}(function(t,e){w(1,arguments);var i=e||{},n=i.locale,r=n&&n.options&&n.options.weekStartsOn,a=null==r?0:p(r),o=null==i.weekStartsOn?a:p(i.weekStartsOn);if(!(o>=0&&o<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=b(t),h=s.getDay(),c=(h<o?7:0)+h-o;return s.setDate(s.getDate()-c),s.setHours(0,0,0,0),s}(new Date),i),"EEEEE",{locale:t}))):ve;let Me=class{constructor(i){t(this,i),this.fwChange=e(this,"fwChange",7),this.fwBlur=e(this,"fwBlur",7),this.firstFocusElement=null,this.lastFocusElement=null,this.hasHintTextSlot=!1,this.hasWarningTextSlot=!1,this.hasErrorTextSlot=!1,this.mode="single date",this.name="",this.updateText="",this.cancelText="",this.required=!1,this.state="normal",this.minYear=1970,this.maxYear=(new Date).getFullYear(),this.readonly=!1,this.showFooter=!0,this.clearInput=!1,this.hintText="",this.warningText="",this.errorText="",this.label="",this.escapeHandler=null,this.isDisplayFormatSet=!1,this.isPlaceholderSet=!1,this.getSupportedYears=()=>{const t=[];+this.maxYear<+this.minYear&&(this.maxYear=+this.minYear);let e=+this.minYear;for(;e<=+this.maxYear;)t.push(e.toString()),e++;return t},this.getDayDetails=t=>{const e=t.index-t.firstDay,i=t.index%7;let n=t.month-1,r=Number(t.year);n<0&&(n=11,r--);const a=lt(new Date(r,n))||0,o=(e<0?a+e:e%t.numberOfDays)+1;return{date:o,day:i,month:this._getValidDateInMonth(e,t),timestamp:new Date(t.year,t.month,o).valueOf()}},this.getMonthDetails=(t,e)=>{const i=new Date(t,e).getDay(),n=lt(new Date(t,e))||0,r=[];let a,o=0;for(let s=0;s<6;s++)for(let h=0;h<7;h++)a=this.getDayDetails({index:o,numberOfDays:n,firstDay:i,year:t,month:e}),r.push(a),o++;return r},this.setMonth=t=>{let e=Number(this.year),i=this.month+t;-1===i?(i=11,e--):12===i&&(i=0,e++),this.year=e.toString(),this.month=i,this.toMonth=11===this.month?0:this.month+1,this.toYear=0===this.toMonth?this.yearCalculation(this.year,1):this.year,this.monthDetails=this.getMonthDetails(e,i),this.nextMonthDetails=11===this.month?this.getMonthDetails(this.yearCalculation(this.year,1),0):this.getMonthDetails(this.year,this.month+1)},this.isCurrentDay=t=>t.timestamp===this.todayTimestamp,this.isSelectedDay=({date:t,timestamp:e})=>{if("range"!==this.mode){const i=ee(this.value,this.displayFormat,new Date,{locale:this.langModule});return y(i)?t===this.selectedDay&&dt(i)===dt(e)&&ut(i)===ut(e):t===this.selectedDay}return e===this.startDate||e===this.endDate},this.handleDateHover=t=>{this.startDate&&!this.endDate?(this.startDate>t.timestamp&&(this.endDate=this.startDate,this.startDate=void 0),this.dateHovered=t.timestamp):!this.startDate&&this.endDate&&(this.endDate<t.timestamp&&(this.startDate=this.endDate,this.endDate=void 0),this.dateHovered=t.timestamp)},this.isInRange=({timestamp:t})=>{const{endDate:e}=this,{startDate:i}=this;if(i!==e)return i&&e&&t>=i&&t<=e},this.onDateClick=(t,{date:e,timestamp:i})=>{this.showSingleDatePicker()?(this.selectedDay=e,this.showFooter||(this.updateValueAndEmitEvent(t),this.showDatePicker=!1,this.host.shadowRoot.querySelector("fw-popover").hide())):this.showDateRangePicker()&&(this.handleRangeSelection(i),this.showFooter||this.startDate&&this.endDate&&(this.updateValueAndEmitEvent(t),this.showDatePicker=!1,this.host.shadowRoot.querySelector("fw-popover").hide()),this.dateHovered="")},this.handleInputClear=t=>{this.clearInputValue(),this.emitEvent(t,void 0)},this.handlePopoverClose=t=>{var e,i;if("FW-SELECT"!==(null===(e=t.target)||void 0===e?void 0:e.tagName))if("range"===this.mode)if(this.value){let[t,e]=(null===(i=this.value)||void 0===i?void 0:i.split(u.t("datepicker.to")))||[];t=null==t?void 0:t.trim(),e=null==e?void 0:e.trim();const n=ct(new Date(this.startDate)),r=ct(new Date(this.endDate)),a=ct(ee(t,this.displayFormat,new Date,{locale:this.langModule})),o=ct(ee(e,this.displayFormat,new Date,{locale:this.langModule}));n!==a&&(this.startDate=ee(t,this.displayFormat,new Date,{locale:this.langModule}).valueOf()),r!==o&&(this.endDate=ee(e,this.displayFormat,new Date,{locale:this.langModule}).valueOf())}else this.startDate||this.endDate||(this.startDate=this.endDate=void 0);else if(this.value){const t=ct(ee(this.value,this.displayFormat,new Date,{locale:this.langModule}));this.selectedDay!==t&&(this.selectedDay=t)}else this.selectedDay=void 0},this.onBlur=async t=>{var e,i,n,r;t.stopImmediatePropagation(),"SPAN"!==(null===(r=null===(n=null===(i=null===(e=t)||void 0===e?void 0:e.detail)||void 0===i?void 0:i.event)||void 0===n?void 0:n.relatedTarget)||void 0===r?void 0:r.tagName)&&this.fwBlur.emit({event:t,name:this.name})}}makeDatePickerInert(){if(!this.madeInert){const t=a(this.host);t.length&&(this.firstFocusElement=t[0],this.lastFocusElement=t[t.length-1],this.lastFocusElement.addEventListener("keydown",(t=>{!t.shiftKey&&9===t.keyCode&&this.focusElement(this.firstFocusElement)})),this.firstFocusElement.addEventListener("keydown",(t=>{t.shiftKey&&9===t.keyCode&&this.focusElement(this.lastFocusElement)}))),this.firstFocusElement&&this.focusElement(this.firstFocusElement),this.madeInert=!0}this.escapeHandler=(t=>{27===t.keyCode&&(this.showDatePicker=!1,this.host.shadowRoot.querySelector("fw-popover").hide())}).bind(this),document.addEventListener("keydown",this.escapeHandler)}emitEvent(t,e){this.fwChange.emit({event:t,name:this.name,value:e})}focusElement(t){t.focus()}disconnectedCallback(){document.removeEventListener("keydown",this.escapeHandler)}formatDate(t){return t?ht(this.displayFormat?ee(t,this.displayFormat,new Date,{locale:this.langModule}):new Date(t)):t}async getValue(){return"range"===this.mode?{fromDate:this.startDate&&at(ee(this.startDate,this.displayFormat,new Date,{locale:this.langModule}),this.displayFormat,{locale:this.langModule})||void 0,toDate:this.endDate&&at(ee(this.endDate,this.displayFormat,new Date,{locale:this.langModule}),this.displayFormat,{locale:this.langModule})||void 0}:this.displayFormat?this.value&&at(ee(this.value,this.displayFormat,new Date,{locale:this.langModule}),this.displayFormat,{locale:this.langModule})||void 0:this.value&&ht(new Date(this.value))||void 0}async setFocus(){var t,e;this.nativeInput&&(null===(e=(t=this.nativeInput).setFocus)||void 0===e||e.call(t))}async clearValue(){this.clearInputValue()}handleKeyDown(t){switch(t.code){case"Enter":this.host.shadowRoot.querySelector("fw-popover").show();break;case"ArrowDown":t.preventDefault()}this.makeDatePickerInert()}displayDatePicker(){this.showDatePicker=!0}handleButtonClick(t){const e=t.composedPath()[0].classList.value.includes("update-range-value"),i=t.composedPath()[0].classList.value.includes("update-date-value");e?this.startDate&&this.endDate&&this.updateValueAndEmitEvent(t):i&&this.selectedDay&&this.updateValueAndEmitEvent(t),t.composedPath()[0].innerText!==this.cancelText||this.value||("range"===this.mode?this.startDate=this.endDate=void 0:this.selectedDay=void 0),t.composedPath()[0].innerText===this.cancelText&&this.handlePopoverClose(t),t.composedPath()[0].innerText!==this.updateText&&t.composedPath()[0].innerText!==this.cancelText||(this.showDatePicker=!1,this.host.shadowRoot.querySelector("fw-popover").hide())}handleInputChanges(t){if(t.stopImmediatePropagation(),t.composedPath()[0].classList.value.includes("range-date-input")){const e=t.composedPath()[0].value;e||(this.value=void 0);let[i,n]=(null==e?void 0:e.split(u.t("datepicker.to")))||[];if(i=null==i?void 0:i.trim(),n=null==n?void 0:n.trim(),!re(i,this.displayFormat,{locale:this.langModule})||!re(n,this.displayFormat,{locale:this.langModule}))return;const r=ee(i,this.displayFormat,new Date,{locale:this.langModule}),a=ee(n,this.displayFormat,new Date,{locale:this.langModule}),o=y(r),s=y(a);if(!o||!s)return;const h=ut(ee(i,this.displayFormat,new Date,{locale:this.langModule}));if(h<this.minYear||h>this.maxYear)return;this.year=h,this.month=dt(ee(i,this.displayFormat,new Date,{locale:this.langModule})),this.startDate=ee(i,this.displayFormat,new Date,{locale:this.langModule}).valueOf(),this.endDate=ee(n,this.displayFormat,new Date,{locale:this.langModule}).valueOf(),this.toMonth=11===this.month?0:this.month+1,this.toYear=0===this.toMonth?this.yearCalculation(this.year,1):this.year}else{const e=t.composedPath()[0].value;if(e||(this.value=void 0),!re(e,this.displayFormat,{locale:this.langModule}))return;if(!y(ee(e,this.displayFormat,new Date,{locale:this.langModule})))return;const i=ut(ee(e,this.displayFormat,new Date,{locale:this.langModule}));if(i<this.minYear||i>this.maxYear)return;this.year=i,this.month=dt(ee(e,this.displayFormat,new Date,{locale:this.langModule})),this.selectedDay=ct(ee(e,this.displayFormat,new Date,{locale:this.langModule})),this.value=at(new Date(this.year,this.month,this.selectedDay),this.displayFormat,{locale:this.langModule})}}handleMonthYearDropDownSelection(t){"FW-DATEPICKER"!==t.composedPath()[0].tagName&&t.stopImmediatePropagation();const e=t.detail&&t.detail.value;e&&("range"===this.mode?(this.handleDateRangeDropDownUpdate(t,e),this.nextMonthDetails=this.getMonthDetails(this.toYear,this.toMonth)):this.handleSingleDateDropDownUpdate(t,e),this.monthDetails=this.getMonthDetails(this.year,this.month))}handleSingleDateDropDownUpdate(t,e){const i=t.composedPath()[0].classList.value.includes("single-month-selector"),n=t.composedPath()[0].classList.value.includes("single-year-selector");i?this.month=this.shortMonthNames.indexOf(e):n&&(this.year=e)}handleDateRangeDropDownUpdate(t,e){const i=t.composedPath()[0].classList.value.includes("from-month-selector"),n=t.composedPath()[0].classList.value.includes("from-year-selector"),r=t.composedPath()[0].classList.value.includes("to-month-selector"),a=t.composedPath()[0].classList.value.includes("to-year-selector");i?(this.month=this.shortMonthNames.indexOf(e),11===this.month?(this.toMonth=0,this.toYear=this.yearCalculation(this.year,1)):this.toMonth=this.month+1):n?(this.year=e,this.toYear=11===this.month?this.yearCalculation(this.year,1):this.year):r?(this.toMonth=this.shortMonthNames.indexOf(e),0===this.toMonth?(this.month=11,this.year=this.yearCalculation(this.toYear,-1)):this.month=this.toMonth-1):a&&(this.toYear=e,this.year=0===this.toMonth?this.yearCalculation(this.toYear,-1):this.toYear)}yearCalculation(t,e){return(Number(t)+e).toString()}async handleLocaleChange(t){this.langModule=await u.getDateLangModule(t)}async componentWillLoad(){var t,e;if(this.langModule=await u.getDateLangModule(this.locale),this.displayFormat&&(this.isDisplayFormatSet=!0),this.placeholder&&(this.isPlaceholderSet=!0),this.checkSlotContent(),this.displayFormat=this.displayFormat||(null===(e=null===(t=this.langModule)||void 0===t?void 0:t.formatLong)||void 0===e?void 0:e.date({width:"short"})),this.placeholder=this.placeholder||this.displayFormat,u.onChange.bind(u)("lang",(async t=>{var e,i;this.langModule=await u.getDateLangModule(t),this.displayFormat=this.isDisplayFormatSet?this.displayFormat:null===(i=null===(e=this.langModule)||void 0===e?void 0:e.formatLong)||void 0===i?void 0:i.date({width:"short"}),this.placeholder=this.isPlaceholderSet?this.placeholder:this.displayFormat,"range"===this.mode&&(this.placeholder=this.isPlaceholderSet?this.placeholder:`${this.displayFormat} ${u.t("datepicker.to")} ${this.displayFormat}`);const n=ke(this.langModule);this.shortMonthNames=n.shortMonthNames,this.longMonthNames=n.longMonthNames,this.weekDays=De(this.langModule)})),"range"===this.mode){const t=new Date;if(this.fromDate&&!y(ae(this.fromDate))||this.toDate&&!y(ae(this.toDate)))this.year=ut(t),this.month=dt(t);else{const e=new Date(this.fromDate);this.year=ut(this.fromDate?e:t),this.month=dt(this.fromDate?e:t)}}else{const t=new Date;if(this.value&&!y(ae(this.value)))this.year=ut(t),this.month=dt(t),this.selectedDay=ct(t);else{const e=new Date(this.value);this.year=ut(this.value?e:t),this.month=dt(this.value?e:t),this.selectedDay=this.value&&ct(e)}}this.toMonth=11===this.month?0:this.month+1,this.toYear=0===this.toMonth?this.yearCalculation(this.year,1):this.year,this.monthDetails=this.getMonthDetails(this.year,this.month),this.todayTimestamp=function(t){w(1,arguments);var e=b(t);return e.setHours(0,0,0,0),e}(new Date).valueOf();const i=ke(this.langModule);this.shortMonthNames=i.shortMonthNames,this.longMonthNames=i.longMonthNames,this.weekDays=De(this.langModule),this.value=this.value?at(new Date(this.value),this.displayFormat,{locale:this.langModule}):this.value,this.setInitialValues()}setInitialValues(){if(this.nextMonthDetails=11===this.month?this.getMonthDetails(this.yearCalculation(this.year,1),0):this.getMonthDetails(this.year,this.month+1),"range"===this.mode&&(this.placeholder=this.isPlaceholderSet?this.placeholder:`${this.displayFormat} ${u.t("datepicker.to")} ${this.displayFormat}`),this.supportedYears=this.getSupportedYears(),this.startDate=void 0!==this.fromDate?ee(this.fromDate,this.displayFormat,new Date,{locale:this.langModule}).valueOf():void 0,this.endDate=void 0!==this.toDate?ee(this.toDate,this.displayFormat,new Date,{locale:this.langModule}).valueOf():void 0,"range"===this.mode&&this.startDate&&this.endDate){const t=at(new Date(this.startDate),this.displayFormat,{locale:this.langModule}),e=at(new Date(this.endDate),this.displayFormat,{locale:this.langModule});this.value=`${t} to ${e}`}}watchValueChanged(t){if(t)if("range"!==this.mode){const t=new Date;t.setMonth(this.month,1),t.setFullYear(this.year),t.setDate(this.selectedDay),this.value=at(t,this.displayFormat,{locale:this.langModule})}else{const t=at(new Date(this.startDate),this.displayFormat,{locale:this.langModule}),e=at(new Date(this.endDate),this.displayFormat,{locale:this.langModule});this.value=`${t} to ${e}`}else{this.startDate=void 0,this.endDate=void 0,this.selectedDay=void 0,this.value=void 0;const t=new Date;this.year=ut(t),this.month=dt(t),this.monthDetails=this.getMonthDetails(this.year,this.month)}}_getValidDateInMonth(t,e){if(void 0!==this.minDate&&void 0!==this.maxDate){if(t<0)return-1;const i=ae(this.minDate),n=ae(this.maxDate);if(!y(i)||!y(n))return;const r=new Date(e.year,e.month,t+1);return i.valueOf()<=r.valueOf()&&r.valueOf()<=n.valueOf()?t>=e.numberOfDays?1:0:-1}return t<0?-1:t>=e.numberOfDays?1:0}handleKeyUp(t,e){"Enter"===t.code&&(t.composedPath().find((t=>t.classList&&"mdp-range-container"===t.classList.value))?(this.onDateClick(t,e),this.startDateFormatted=at(new Date(this.startDate),this.displayFormat,{locale:this.langModule}),this.endDateFormatted=at(new Date(this.endDate),this.displayFormat,{locale:this.langModule}),this.startDate&&this.endDate&&(this.value=this.startDateFormatted+" to "+this.endDateFormatted,this.emitEvent(t,{fromDate:this.formatDate(this.startDateFormatted),toDate:this.formatDate(this.endDateFormatted)}),this.showDatePicker=!1,this.host.shadowRoot.querySelector("fw-popover").hide())):(this.onDateClick(t,e),this.value=at(new Date(this.year,this.month,this.selectedDay),this.displayFormat,{locale:this.langModule}),this.emitEvent(t,this.formatDate(this.value)),this.showDatePicker=!1,this.host.shadowRoot.querySelector("fw-popover").hide()))}isHoverInRange({timestamp:t}){const{startDate:e,endDate:i,dateHovered:n}=this;return e&&n&&t<=n&&t>=e||i&&n&&t>=n&&t<=i}updateValueAndEmitEvent(t){this.showSingleDatePicker()?(this.value=at(new Date(this.year,this.month,this.selectedDay),this.displayFormat,{locale:this.langModule}),this.emitEvent(t,this.formatDate(this.value))):this.showDateRangePicker()&&(this.startDateFormatted=at(this.startDate,this.displayFormat,{locale:this.langModule}),this.endDateFormatted=at(this.endDate,this.displayFormat,{locale:this.langModule}),this.fromDate=this.startDateFormatted,this.toDate=this.endDateFormatted,this.value=this.startDateFormatted+" to "+this.endDateFormatted,this.emitEvent(t,{fromDate:this.formatDate(this.startDateFormatted),toDate:this.formatDate(this.endDateFormatted)}))}clearInputValue(){"range"!==this.mode?this.selectedDay&&(this.selectedDay=void 0):this.startDate&&this.endDate&&(this.startDate=this.endDate=void 0),this.value=void 0}handleRangeSelection(t){this.startDate&&this.endDate?(this.endDate=void 0,this.startDate=t):this.startDate&&!this.endDate?t>=this.startDate?this.endDate=t:t<this.startDate&&(this.endDate=this.startDate,this.startDate=t):!this.startDate&&this.endDate?this.startDate=t:this.startDate||this.endDate||(this.startDate=t)}getCellStyle(t){let e="c-day-container";return 0!==t.month&&(e+=" disabled"),this.isCurrentDay(t)&&(e+=" highlight"),(this.isSelectedDay(t)||t.timestamp===this.dateHovered)&&(e+=" highlight-blue"),(this.isInRange(t)||this.isHoverInRange(t))&&(e+=" highlight-range"),t.timestamp===this.startDate&&(e+=" start-day"),t.timestamp===this.endDate&&(e+=" end-day"),this.startDate&&this.dateHovered<this.startDate&&t.timestamp===this.dateHovered||this.endDate&&this.dateHovered<this.endDate&&t.timestamp===this.dateHovered?e+=" start-day":this.startDate&&this.dateHovered>this.startDate&&t.timestamp===this.dateHovered&&(e+=" end-day"),e}renderCalendar(t){const e=t.map(((t,e)=>i("div",{class:this.getCellStyle(t),key:e},i("div",{class:"cdc-day"},i("span",{role:"button",tabindex:-1===t.month||1===t.month?"-1":"0",onClick:e=>this.onDateClick(e,t),onMouseOver:()=>this.handleDateHover(t),onFocus:()=>this.handleDateHover(t),onKeyDown:o((()=>this.handleDateHover(t))),onKeyUp:e=>this.handleKeyUp(e,t)},t.date)))));return i("div",{class:"c-container"},i("div",{class:"cc-head"},this.weekDays.map(((t,e)=>i("div",{key:e,class:"cch-name"},t)))),i("div",{class:"cc-body"},e))}showSingleDatePicker(){return this.showDatePicker&&"range"!==this.mode}showDateRangePicker(){return this.showDatePicker&&"range"===this.mode}checkSlotContent(){this.hasHintTextSlot=s(this.host,"hint-text"),this.hasWarningTextSlot=s(this.host,"warning-text"),this.hasErrorTextSlot=s(this.host,"error-text")}renderNavButtons(){return i("div",{class:"btns"},i("div",{class:"mdpch-button"},i("div",{role:"button",tabindex:"0",class:"mdpchb-inner",onClick:()=>this.setMonth(-1),onKeyDown:o((()=>this.setMonth(-1)))},i("span",{class:"mdpchbi-left-arrow"}))),i("div",{class:"mdpch-button-right"},i("div",{role:"button",tabindex:"0",class:"mdpchb-inner",onClick:()=>this.setMonth(1),onKeyDown:o((()=>this.setMonth(1)))},i("span",{class:"mdpchbi-right-arrow"}))))}renderSupportedYears(){return this.supportedYears.map(((t,e)=>i("fw-select-option",{value:t,key:e,selected:+t==+this.year},t)))}renderFooter(){return i("div",{class:"mdpc-footer"},i("fw-button",{color:"secondary",class:"close-date-picker"},this.cancelText),i("fw-button",{color:"primary",class:"range"===this.mode?"update-range-value":"update-date-value"},this.updateText))}render(){const{host:t,name:e,value:n}=this;return h(t,e,n),i(d,{inputId:this.name,label:this.label,labelId:`${this.label}-${this.name}`,state:this.state,hintTextId:`hint-${this.name}`,hintText:this.hintText,hasHintTextSlot:this.hasHintTextSlot,errorTextId:`error-${this.name}`,errorText:this.errorText,hasErrorTextSlot:this.hasErrorTextSlot,warningTextId:`warning-${this.name}`,warningText:this.warningText,hasWarningTextSlot:this.hasWarningTextSlot,required:this.required},i("fw-popover",{"same-width":"false",distance:"8",placement:"bottom-start",fallbackPlacements:["top-start"],"hide-on-tab":"false",onFwHide:this.handlePopoverClose},i("div",{role:"combobox","aria-controls":"datepicker","aria-expanded":this.showDatePicker,tabindex:"-1",onClick:()=>this.showDatePicker=!0,onKeyUp:()=>this.showDatePicker=!0,slot:"popover-trigger",style:{display:"inline-flex",alignItems:"center"}},i("fw-input",{value:this.value,name:this.name,class:("range"===this.mode?"range-":"")+"date-input",placeholder:this.placeholder,required:this.required,onFwBlur:this.onBlur,ref:t=>this.nativeInput=t,state:this.state,readonly:this.readonly,clearInput:this.clearInput,onFwInputClear:this.handleInputClear},i("div",{class:"icon-calendar",slot:"input-suffix"},i("div",{class:"separator",style:{borderLeftColor:"error"===this.state?"#d72d30":"#ebeff3"}}),i("span",{class:"date-icon"},i("fw-icon",{name:"calendar",style:{"--fw-icon-color":"error"===this.state&&"#d72d30"}}))))),this.showSingleDatePicker()?i("div",{id:"datepicker",class:"datepicker",slot:"popover-content"},i("div",{class:"mdp-container"},i("div",{class:"mdpc-head"},i("div",{class:"mdpch-container"},i("span",{class:"mdpchc-month"},i("fw-select",{class:"first single-month-selector",readonly:!0,value:this.shortMonthNames[this.month],"same-width":"false",variant:"button","options-placement":"bottom-start",options:this.longMonthNames.map(((t,e)=>({value:this.shortMonthNames[e],key:e,selected:t===this.longMonthNames[this.month],text:t}))),allowDeselect:!1})),i("span",{class:"mdpchc-year"},i("fw-select",{class:"last single-year-selector",readonly:!0,value:this.year,"same-width":"false","options-placement":"bottom",variant:"button","allow-deselect":"false"},this.renderSupportedYears()))),this.renderNavButtons()),i("div",{class:"mdpc-body"},this.renderCalendar(this.monthDetails))),this.showFooter&&this.renderFooter()):"",this.showDateRangePicker()?i("div",{id:"datepicker",class:"daterangepicker",slot:"popover-content"},i("div",{class:"mdp-range-container"},i("div",{class:"mdpc-head"},i("div",{class:"mdpch-container"},i("span",{class:"mdpchc-month"},i("fw-select",{class:"first from-month-selector",readonly:!0,value:this.shortMonthNames[this.month],"same-width":"false",variant:"button","options-placement":"bottom-start",options:this.longMonthNames.map(((t,e)=>({value:this.shortMonthNames[e],key:e,selected:t===this.longMonthNames[this.month],text:t}))),allowDeselect:!1})),i("span",{class:"mdpchc-year"},i("fw-select",{class:"last from-year-selector",readonly:!0,value:this.year,"same-width":"false","options-placement":"bottom",variant:"button","allow-deselect":"false"},this.renderSupportedYears()))),i("div",{class:"mdpch-container-right"},i("span",{class:"mdpchc-month"},i("fw-select",{class:"first to-month-selector",readonly:!0,"same-width":"false",variant:"button",value:this.shortMonthNames[this.toMonth],"options-placement":"bottom-start",options:this.longMonthNames.map(((t,e)=>({value:this.shortMonthNames[e],key:e,selected:t===this.longMonthNames[this.toMonth],text:t}))),allowDeselect:!1})),i("span",{class:"mdpchc-year"},i("fw-select",{class:"last to-year-selector",readonly:!0,value:this.toYear,"same-width":"false","options-placement":"bottom",variant:"button","allow-deselect":"false"},this.renderSupportedYears()))),this.renderNavButtons()),i("div",{class:"body-container"},i("div",{class:"mdpc-body"},this.renderCalendar(this.monthDetails)),i("div",{class:"mdpc-body mdpc-body-right"},this.renderCalendar(this.nextMonthDetails)))),this.showFooter&&this.renderFooter()):""))}get host(){return n(this)}static get watchers(){return{locale:["handleLocaleChange"],value:["watchValueChanged"]}}};xe([f({keyName:"datepicker.update"})],Me.prototype,"updateText",void 0),xe([f({keyName:"datepicker.cancel"})],Me.prototype,"cancelText",void 0),Me.style=':host{font-family:var(--fw-font-family, -apple-system, blinkmacsystemfont, "Segoe UI", roboto, oxygen, ubuntu, cantarell, "Open Sans", "Helvetica Neue", sans-serif);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-box-sizing:border-box;box-sizing:border-box}.field-control{position:relative}.field-control-label{display:block;font-size:12px;color:var(--fw-label-color, #475867);font-weight:600;margin-bottom:4px;padding-left:2px;line-height:20px}.field-control-label.required::after{content:"*";position:relative;display:inline-block;top:2px;font-size:14px;color:#d72d30;padding-left:2px;font-weight:700}.field-control-hint-text{font-family:-apple-system, blinkmacsystemfont, "Segoe UI", "Roboto", "Helvetica Neue", arial, sans-serif;font-size:12px;line-height:20px;margin-top:4px;margin-bottom:0;color:var(--fw-hint-color, #acb6be);position:inherit;display:block;padding-left:2px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.field-control-error-text{font-family:-apple-system, blinkmacsystemfont, "Segoe UI", "Roboto", "Helvetica Neue", arial, sans-serif;font-size:12px;line-height:20px;margin-top:4px;margin-bottom:0;color:var(--fw-error-color, #d72d30);position:inherit;display:block;padding-left:2px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.field-control-warning-text{font-family:-apple-system, blinkmacsystemfont, "Segoe UI", "Roboto", "Helvetica Neue", arial, sans-serif;font-size:12px;line-height:20px;margin-top:4px;margin-bottom:0;color:var(--fw-warning-color, #f8ab59);position:inherit;display:block;padding-left:2px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:host{display:block;position:relative;--fw-icon-size:14px}:host *{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mdp-container,.mdp-range-container{width:264px;background:#fff;-webkit-box-sizing:border-box;box-sizing:border-box;padding:16px;overflow:hidden}.mdpc-footer{padding:4px;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-pack:end;justify-content:flex-end;background:#f5f7f9}.mdpc-footer fw-button{margin:4px}.mdp-range-container{width:536px}.mdpc-head{--fw-select-margin-bottom:16px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mdpc-body{float:left;width:100%}.body-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:stretch;align-items:stretch;-ms-flex-pack:justify;justify-content:space-between}.body-container .mdpc-body{width:232px;padding:0 8px;position:relative}.body-container .mdpc-body-right{width:232px;padding:0 8px}.body-container .mdpc-body-right::after{content:"";position:absolute;top:0;right:251px;border-right:1px solid #ebeff3;height:100%}.btns{display:inherit;position:absolute;right:14px}.mdpch-button,.mdpch-button-right{width:12px;height:100%;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;bottom:6px;right:14px}.mdpchb-inner:hover,.mdpchb-inner:focus{cursor:pointer;background:#ebeff3}.mdpchb-inner{height:20px;width:20px;position:absolute;margin-top:-11px}.mdpch-button-right .mdpchb-inner{left:12px}.mdpchbi-left-arrow,.mdpchbi-left-arrows,.mdpchbi-left-arrows::after,.mdpchbi-right-arrow,.mdpchbi-right-arrows,.mdpchbi-right-arrows::after{display:block;width:6px;height:6px;border-left:2px solid #183247;border-bottom:2px solid #183247;position:absolute}.mdpchbi-left-arrow,.mdpchbi-left-arrows,.mdpchbi-right-arrow,.mdpchbi-right-arrows{-webkit-transform:rotate(45deg);transform:rotate(45deg);left:50%;top:50%;margin-left:-2px;margin-top:-4px}.mdpchbi-right-arrow,.mdpchbi-right-arrows{-webkit-transform:rotate(225deg);transform:rotate(225deg);margin-left:-4px}.mdpchbi-left-arrows::after,.mdpchbi-right-arrows::after{content:"";left:3px;top:-5px}.mdpchbi-left-arrows{margin-left:-5px}.mdpchbi-right-arrows{margin-left:-2px}.mdpch-container,.mdpch-container-right{min-width:50%}.mdpch-container-right{padding-left:16px}.mdpchc-year{--fw-button-min-width:74px;float:left;height:30px;font-size:16px;color:#475867;text-align:center;width:74px;--fw-popover-max-height:146px;--fw-popover-min-width:170px}.mdpchc-month{--fw-button-min-width:65px;float:left;font-size:16px;color:#475867;text-align:center;width:65px;--fw-popover-max-height:146px;--fw-popover-min-width:170px}.mdpchc-month fw-select .input-container-inner input{width:98%}.c-container,.c-day-container,.cc-body,.cc-head,.cch-name,.cdc-day,.cdc-day span{position:relative;display:block;float:left;-webkit-box-sizing:border-box;box-sizing:border-box}.c-container{width:100%;height:100%}.cc-head{height:30px;width:100%}.cch-name{width:14.285%;height:30px;line-height:30px;font-weight:700;color:#475867;font-size:13px;text-align:center}.cc-body{height:210px;width:100%}.c-day-container{width:14.285%;height:11.185%;margin-top:10px}.cdc-day{width:100%;height:100%;font-size:12px;font-weight:300;color:#475867;text-align:center}.cdc-day span:hover,.cdc-day span:focus{cursor:pointer;background:#ebeff3}.cdc-day span{width:24px;height:22px;font-size:14px;margin-top:-11px;margin-left:-13px;left:50%;top:50%;font-weight:400;border-radius:10%;line-height:20px;color:#12344d}.c-day-container.disabled{pointer-events:none}.date-input{width:200px}.icon-calendar{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin:4px 0px}.icon-calendar .separator{border-left-width:1px;border-left-style:solid;height:20px;margin:0px 4px}.date-icon{display:-ms-flexbox;display:flex;width:24px;height:24px;border-radius:4px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-color:#ebeff3}.range-date-input{width:235px}.c-day-container.disabled .cdc-day span{color:#92a2b1;background:#fff !important}.c-day-container.highlight:not(.disabled) .cdc-day span{border:1px solid #cfd7df}.c-day-container.highlight-blue:not(.disabled) .cdc-day span{background:#2c5cc5;color:#f5f7f9}.c-day-container.start-day .cdc-day{margin-left:10px}.c-day-container.start-day .cdc-day span{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.c-day-container.end-day .cdc-day{margin-left:-10px}.c-day-container.end-day .cdc-day span{-webkit-transform:translateX(10px);transform:translateX(10px)}.c-day-container.highlight-range:not(.disabled) .cdc-day{background:#e4f2fd}';let Te=class{constructor(i){t(this,i),this.fwSelect=e(this,"fwSelect",7),this.fwDeselect=e(this,"fwDeselect",7),this.fwFocus=e(this,"fwFocus",7),this.fwBlur=e(this,"fwBlur",7),this.fwChange=e(this,"fwChange",7),this.checked=!1,this.disabled=!1,this.description="",this.label="",this.value="",this.name="",this.state="normal"}componentDidLoad(){this.radio.checked=this.checked,this.radio.disabled=this.disabled}checkChanged(t){this.disabled||(t?this.fwSelect.emit({value:this.value,checked:!0}):this.fwDeselect.emit({value:this.value,checked:!1})),this.radio.checked=t}disabledChanged(t){this.radio.disabled=t}onFocus(){this.fwFocus.emit()}onBlur(t){this.fwBlur.emit({event:t,name:this.name})}toggle(t){this.disabled||(this.checked=!this.checked),this.fwChange.emit({event:t,name:this.name,value:this.checked?this.value:void 0})}async setFocus(){var t;null===(t=this.host)||void 0===t||t.focus()}render(){return i(r,{onClick:t=>this.toggle(t),role:"radio",tabIndex:"-1","aria-labelledby":"label","aria-describedby":"description","aria-disabled":this.disabled?"true":"false","aria-checked":this.checked?"true":"false",onFocus:()=>this.onFocus(),onBlur:t=>this.onBlur(t),"aria-invalid":"error"===this.state},i("div",{class:"radio-container"},i("input",{type:"radio",ref:t=>this.radio=t,name:this.name}),i("label",{class:{error:"error"===this.state}},i("span",{id:"label"},i("slot",null)),""!==this.description||""!==this.label?i("div",{id:"description"},this.description?this.description:this.label):"")))}get host(){return n(this)}static get watchers(){return{checked:["checkChanged"],disabled:["disabledChanged"]}}};Te.style=':host{font-family:var(--fw-font-family, -apple-system, blinkmacsystemfont, "Segoe UI", roboto, oxygen, ubuntu, cantarell, "Open Sans", "Helvetica Neue", sans-serif);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-box-sizing:border-box;box-sizing:border-box}.radio-container{display:inline-block;position:relative;padding-left:22px;margin-right:10px;max-width:80ch;word-wrap:break-word}:host(:focus) input[type=radio]+label::before{border:1px solid transparent;-webkit-box-shadow:0 0 0 2px #2c5cc5;box-shadow:0 0 0 2px #2c5cc5;border-color:#081824}:host(:focus) input[type=radio][disabled]+label::before{-webkit-box-shadow:none;box-shadow:none;border:1px solid #dadfe3}:host(:hover) input[type=radio]+label::before{-webkit-box-shadow:0 0 0 5px #ebeff3;box-shadow:0 0 0 5px #ebeff3;border-color:#081824}:host(:hover) input[type=radio][disabled]+label{cursor:not-allowed}:host(:hover) input[type=radio][disabled]+label::before{-webkit-box-shadow:none;box-shadow:none;border:1px solid #dadfe3}#description{font-size:12px;color:#475867;letter-spacing:0;line-height:20px;position:relative;font-weight:400}input[type=radio]{display:none}input[type=radio]+label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;margin-bottom:4px;vertical-align:middle;font-size:14px;line-height:20px;color:#12344d;font-weight:600}input[type=radio]+label::before,input[type=radio]+label::after{content:"";display:block;position:absolute;top:0;-webkit-box-sizing:border-box;box-sizing:border-box}@media screen and (prefers-reduced-motion: reduce){input[type=radio]+label::before{-webkit-transition:none;transition:none}}input[type=radio]+label::before{left:0;border:1px solid #cfd7df;border-radius:50px;top:4px;width:14px;height:14px;background:#fff;-webkit-transition:all 0.3s ease;transition:all 0.3s ease}@media screen and (prefers-reduced-motion: reduce){input[type=radio]+label.error::before{-webkit-transition:none;transition:none}}input[type=radio]+label.error::before{left:0;border:1px solid #d72d30;border-radius:50px;top:4px;width:14px;height:14px;background:#fff;-webkit-transition:all 0.3s ease;transition:all 0.3s ease}@media screen and (prefers-reduced-motion: reduce){input[type=radio]+label::after{-webkit-transition:none;transition:none}}input[type=radio]+label::after{left:3px;border-radius:100%;width:8px;height:8px;opacity:0;-webkit-transition:opacity 0.2s ease-in-out;transition:opacity 0.2s ease-in-out;-webkit-box-sizing:border-box;box-sizing:border-box}input[type=radio]:checked+label::before{background:#fff;border-color:#2c5cc5;-webkit-box-shadow:none;box-shadow:none}input[type=radio]:checked+label::after{border-radius:50%;background-color:#2c5cc5;opacity:1;top:7px}input[type=radio]:checked:focus+label::before{border-color:#3868d3;-webkit-box-shadow:0 0 4px 1px rgba(44, 92, 197, 0.6);box-shadow:0 0 4px 1px rgba(44, 92, 197, 0.6)}input[type=radio]:checked:focus+label::after{background-color:#3868d3}input[type=radio][disabled]+label{color:#92a2b1}input[type=radio][disabled]+label .label-field{color:#92a2b1}input[type=radio][disabled]+label::before{border-color:#dadfe3;background-color:#ebeff3}input[type=radio][disabled]+label::after{border-color:#ebeff3;background-color:#dadfe3}input[type=radio][disabled]:checked+label{color:#92a2b1}:host(.fw-radio-group__radio){margin-bottom:8px}:host(.fw-radio-group__radio--last){margin-bottom:0px}';let Ee=class{constructor(i){t(this,i),this.fwChange=e(this,"fwChange",7),this.selectedIndex=0,this.allowEmpty=!1,this.label="",this.name="",this.orientation="column",this.required=!1,this.hintText="",this.warningText="",this.errorText="",this.state="normal",this.hasHintTextSlot=!1,this.hasWarningTextSlot=!1,this.hasErrorTextSlot=!1,this.onSelect=t=>{const e=t.target;e&&(this.value=e.value)},this.onDeselect=async t=>{this.allowEmpty&&t.target.value===this.value&&(this.value=void 0),await this.updateRadios()}}async valueChanged(){await this.updateRadios()}handleKeydown(t){"ArrowDown"!==t.code&&"ArrowRight"!==t.code&&"ArrowLeft"!==t.code&&"ArrowUp"!==t.code&&"Space"!==t.code||t.preventDefault()}handleKeyup(t){const e=this.radios,i=this.selectedIndex;switch(t.code){case"ArrowDown":case"ArrowRight":e[i].setAttribute("tabindex","-1"),e[i].checked=!1,this.selectedIndex=++this.selectedIndex%e.length,e[this.selectedIndex].setAttribute("tabindex","0"),e[this.selectedIndex].checked=!0,e[this.selectedIndex].focus(),this.value=e[this.selectedIndex].value;break;case"ArrowUp":case"ArrowLeft":e[i].setAttribute("tabindex","-1"),e[i].checked=!1,this.selectedIndex=0===this.selectedIndex?e.length-1:--this.selectedIndex,e[this.selectedIndex].setAttribute("tabindex","0"),e[this.selectedIndex].checked=!0,e[this.selectedIndex].focus(),this.value=e[this.selectedIndex].value;break;case"Space":e[0].checked=!0,e[0].focus(),this.value=e[0].value}["ArrowDown","ArrowRight","ArrowUp","ArrowLeft","Space"].includes(t.code)&&this.fwChange.emit({event:t,name:this.name,value:this.value})}async connectedCallback(){const t=this.host;if(this.radios=Array.from(this.host.querySelectorAll("fw-radio")).filter((t=>!t.disabled)),void 0===this.value){const e=c(t,"fw-radio");void 0!==e&&(await e.componentOnReady(),void 0===this.value&&(this.value=e.value))}this.mutationO=l(t,"fw-radio",(async t=>{void 0!==t?t.componentOnReady().then((()=>{this.value=t.value})).catch():await this.updateRadios()}))}componentDidLoad(){const t=this.host.querySelector(".field-input");t&&(t.style.display="flex",t.style.flexDirection=this.orientation);const e=this.host.querySelectorAll("fw-radio");e.forEach(((t,i)=>{"column"===this.orientation&&(t.classList.add("fw-radio-group__radio"),t.classList.toggle("fw-radio-group__radio--last",i===e.length-1))}))}componentWillLoad(){this.checkSlotContent()}checkSlotContent(){this.hasHintTextSlot=s(this.host,"hint-text"),this.hasWarningTextSlot=s(this.host,"warning-text"),this.hasErrorTextSlot=s(this.host,"error-text")}disconnectedCallback(){this.mutationO&&(this.mutationO.disconnect(),this.mutationO=void 0)}async updateRadios(){const t=await this.radios,{value:e}=this;let i=!1;for(const[n,r]of t.entries())i||r.value!==e?(r.setAttribute("tabindex","-1"),r.checked=!1):(i=!0,r.checked=!0,r.setAttribute("tabindex","0"),this.selectedIndex=n);i||(0!==t.length&&t[0].setAttribute("tabindex","0"),this.selectedIndex=0,this.value=void 0)}getAriaDescribedBy(){return"normal"===this.state?`hint-${this.name}`:"error"===this.state?`error-${this.name}`:"warning"===this.state?`warning-${this.name}`:null}async setFocus(){var t,e;null===(e=null===(t=this.radios[0])||void 0===t?void 0:t.setFocus)||void 0===e||e.call(t)}render(){const{host:t,name:e,value:n}=this,a=!!this.label,o=!!this.hintText||this.hasHintTextSlot,s=!!this.errorText||this.hasErrorTextSlot,c=!!this.warningText||this.hasWarningTextSlot,l="normal"===this.state,d="error"===this.state,u="warning"===this.state,f=this.label&&this.name?`${this.label}-${this.name}`:this.label?this.label:this.name&&this.name,p=`hint-${this.name}`,w=`warning-${this.name}`,b=`error-${this.name}`;return h(t,e,n),i(r,{role:"radiogroup","aria-labelledby":f,onFwSelect:this.onSelect,onFwDeselect:this.onDeselect,"aria-describedby":this.getAriaDescribedBy()},i("div",{class:{"field-control":!0}},a&&i("label",{id:f,class:{"field-control-label":!0,required:this.required},"aria-hidden":a?"false":"true"},this.label),i("div",{class:"field-input"},i("slot",null)),l&&o&&i("div",{id:p,class:"field-control-hint-text","aria-hidden":o?"false":"true"},i("slot",{name:"hint-text"},this.hintText)),d&&s&&i("div",{id:b,class:"field-control-error-text","aria-hidden":s?"false":"true"},i("slot",{name:"error-text"},this.errorText)),u&&c&&i("div",{id:w,class:"field-control-warning-text","aria-hidden":c?"false":"true"},i("slot",{name:"warning-text"},this.warningText))))}get host(){return n(this)}static get watchers(){return{value:["valueChanged"]}}};Ee.style=':host{font-family:var(--fw-font-family, -apple-system, blinkmacsystemfont, "Segoe UI", roboto, oxygen, ubuntu, cantarell, "Open Sans", "Helvetica Neue", sans-serif);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-box-sizing:border-box;box-sizing:border-box}.field-control{position:relative}.field-control-label{display:block;font-size:12px;color:var(--fw-label-color, #475867);font-weight:600;margin-bottom:4px;padding-left:2px;line-height:20px}.field-control-label.required::after{content:"*";position:relative;display:inline-block;top:2px;font-size:14px;color:#d72d30;padding-left:2px;font-weight:700}.field-control-hint-text{font-family:-apple-system, blinkmacsystemfont, "Segoe UI", "Roboto", "Helvetica Neue", arial, sans-serif;font-size:12px;line-height:20px;margin-top:4px;margin-bottom:0;color:var(--fw-hint-color, #acb6be);position:inherit;display:block;padding-left:2px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.field-control-error-text{font-family:-apple-system, blinkmacsystemfont, "Segoe UI", "Roboto", "Helvetica Neue", arial, sans-serif;font-size:12px;line-height:20px;margin-top:4px;margin-bottom:0;color:var(--fw-error-color, #d72d30);position:inherit;display:block;padding-left:2px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.field-control-warning-text{font-family:-apple-system, blinkmacsystemfont, "Segoe UI", "Roboto", "Helvetica Neue", arial, sans-serif;font-size:12px;line-height:20px;margin-top:4px;margin-bottom:0;color:var(--fw-warning-color, #f8ab59);position:inherit;display:block;padding-left:2px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}';let Se=class{constructor(i){t(this,i),this.fwFocus=e(this,"fwFocus",7),this.fwBlur=e(this,"fwBlur",7),this.fwInput=e(this,"fwInput",7),this.hasFocus=!1,this.hasHintTextSlot=!1,this.hasWarningTextSlot=!1,this.hasErrorTextSlot=!1,this.label="",this.value="",this.name="",this.state="normal",this.wrap="soft",this.resize="both",this.readonly=!1,this.required=!1,this.disabled=!1,this.hintText="",this.warningText="",this.errorText="",this.onInput=t=>{const e=t.target;e&&(this.value=e.value||""),this.fwInput.emit({event:t,name:this.name,value:this.getValue()})},this.onFocus=()=>{this.hasFocus=!0,this.fwFocus.emit()},this.onBlur=t=>{this.hasFocus=!1,this.fwBlur.emit({event:t,name:this.name})}}getValue(){return this.value||""}hasValue(){return this.getValue().length>0}async setFocus(){this.nativeInput&&this.nativeInput.focus()}componentWillLoad(){this.checkSlotContent()}checkSlotContent(){this.hasHintTextSlot=s(this.host,"hint-text"),this.hasWarningTextSlot=s(this.host,"warning-text"),this.hasErrorTextSlot=s(this.host,"error-text")}getAriaDescribedBy(){return"normal"===this.state?`hint-${this.name}`:"error"===this.state?`error-${this.name}`:"warning"===this.state?`warning-${this.name}`:null}render(){const{host:t,name:e,value:n}=this,r={resize:this.resize};return h(t,e,n),i(d,{inputId:this.name,label:this.label,labelId:`${this.label}-${this.name}`,state:this.state,hintTextId:`hint-${this.name}`,hintText:this.hintText,hasHintTextSlot:this.hasHintTextSlot,errorTextId:`error-${this.name}`,errorText:this.errorText,hasErrorTextSlot:this.hasErrorTextSlot,warningTextId:`warning-${this.name}`,warningText:this.warningText,hasWarningTextSlot:this.hasWarningTextSlot,required:this.required},i("div",{"aria-disabled":this.disabled,class:{"has-value":this.hasValue(),"has-focus":this.hasFocus}},i("div",{class:"textarea-container"},i("div",{class:{"textarea-container-inner":!0,[this.state]:!0}},i("textarea",{class:{responsive:void 0===this.cols},style:r,ref:t=>this.nativeInput=t,disabled:this.disabled,name:this.name,placeholder:this.placeholder||"",minLength:this.minlength,maxLength:this.maxlength,readOnly:this.readonly,required:this.required,value:this.value,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,rows:this.rows,cols:this.cols,wrap:this.wrap,id:this.name,"aria-invalid":"error"===this.state,"aria-describedby":this.getAriaDescribedBy()})))))}get host(){return n(this)}};Se.style=':host{font-family:var(--fw-font-family, -apple-system, blinkmacsystemfont, "Segoe UI", roboto, oxygen, ubuntu, cantarell, "Open Sans", "Helvetica Neue", sans-serif);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-box-sizing:border-box;box-sizing:border-box}.field-control{position:relative}.field-control-label{display:block;font-size:12px;color:var(--fw-label-color, #475867);font-weight:600;margin-bottom:4px;padding-left:2px;line-height:20px}.field-control-label.required::after{content:"*";position:relative;display:inline-block;top:2px;font-size:14px;color:#d72d30;padding-left:2px;font-weight:700}.field-control-hint-text{font-family:-apple-system, blinkmacsystemfont, "Segoe UI", "Roboto", "Helvetica Neue", arial, sans-serif;font-size:12px;line-height:20px;margin-top:4px;margin-bottom:0;color:var(--fw-hint-color, #acb6be);position:inherit;display:block;padding-left:2px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.field-control-error-text{font-family:-apple-system, blinkmacsystemfont, "Segoe UI", "Roboto", "Helvetica Neue", arial, sans-serif;font-size:12px;line-height:20px;margin-top:4px;margin-bottom:0;color:var(--fw-error-color, #d72d30);position:inherit;display:block;padding-left:2px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.field-control-warning-text{font-family:-apple-system, blinkmacsystemfont, "Segoe UI", "Roboto", "Helvetica Neue", arial, sans-serif;font-size:12px;line-height:20px;margin-top:4px;margin-bottom:0;color:var(--fw-warning-color, #f8ab59);position:inherit;display:block;padding-left:2px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.textarea-container{margin-bottom:var(--fw-textarea-margin-bottom, 0px);width:inherit}.textarea-container-inner{display:block;width:100%;position:relative}.textarea-container-inner textarea{border:0;border:1px solid #cfd7df;border-radius:4px;padding:4px 12px 5px;background-color:#fff;-webkit-box-shadow:none;box-shadow:none;min-height:24px;font-size:14px;font-weight:500;letter-spacing:0;line-height:20px;font-family:inherit;cursor:text;display:inline-block;color:var(--fw-textarea-input-color, #12344d);}@media screen and (prefers-reduced-motion: reduce){.textarea-container-inner textarea:hover,.textarea-container-inner textarea:focus{-webkit-transition:none;transition:none}}.textarea-container-inner textarea:hover{border:1px #475867 solid;-webkit-transition:0.2s linear;transition:0.2s linear}.textarea-container-inner textarea:focus{outline:none;background:#fff;border:1px solid transparent;-webkit-box-shadow:0 0 0 2px #2c5cc5;box-shadow:0 0 0 2px #2c5cc5}.textarea-container-inner textarea[disabled]{color:#92a2b1;background-color:#f5f7f9;border-style:solid}.textarea-container-inner textarea[disabled]:hover,.textarea-container-inner textarea[disabled]:focus{border:1px solid #cfd7df;cursor:not-allowed}.textarea-container-inner+.help-block{font-size:12px;margin-top:3px;color:#92a2b1;position:inherit;margin-bottom:0;display:block;padding-left:2px}.textarea-container-inner.error>textarea{border-color:#d72d30}.textarea-container-inner.error>textarea:focus{-webkit-box-shadow:none;box-shadow:none;border-color:#d72d30}.textarea-container-inner.error>textarea:hover{border-color:#d72d30}.textarea-container-inner.error+.help-block{color:#d72d30}.textarea-container-inner.warning>textarea{border-color:#f8ab59}.textarea-container-inner.warning>textarea:focus{-webkit-box-shadow:none;box-shadow:none;border-color:#f8ab59}.textarea-container-inner.warning>textarea:hover{border-color:#f8ab59}.textarea-container-inner.warning+.help-block{color:#f8ab59}::-webkit-input-placeholder{color:#acb6be;opacity:1}::-moz-placeholder{color:#acb6be;opacity:1}:-ms-input-placeholder{color:#acb6be;opacity:1}::-ms-input-placeholder{color:#acb6be;opacity:1}::placeholder{color:#acb6be;opacity:1}:-ms-input-placeholder{color:#acb6be}::-ms-input-placeholder{color:#acb6be}.responsive{width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}';let Ne=class{constructor(i){t(this,i),this.fwChange=e(this,"fwChange",7),this.fwBlur=e(this,"fwBlur",7),this.fwFocus=e(this,"fwFocus",7),this.timeValues=[],this.format="hh:mm a",this.disabled=!1,this.isMeridianFormat="hh:mm a"===this.format,this.name="",this.interval=30,this.minTime=this.isMeridianFormat?"12:00 AM":"00:00",this.maxTime=this.isMeridianFormat?"11:30 PM":"23:30",this.required=!1,this.state="normal",this.hintText="",this.warningText="",this.errorText="",this.label="",this.optionsPlacement="bottom",this.caret=!0,this.isDefaultEndTime=["11:30 PM","23:30"].includes(this.maxTime),this.getTimeOptionsMeta=t=>{const e=this.format;return{interval:this.interval,startTime:at(ee(this.minTime,e,new Date),t,{locale:I}),endTime:at(ee(this.maxTime,e,new Date),t,{locale:I})}},this.setTimeValues=()=>{const t="HH:mm",{interval:e,startTime:i,endTime:n}=this.getTimeOptionsMeta(t);ee(i,t,new Date).valueOf();let r=ee(i,t,new Date).valueOf();const a=ee(n,t,new Date).valueOf();for(;r<=a;)this.timeValues.push({meridianFormat:at(r,"hh:mm a",{locale:I}),nonMeridianFormat:at(r,t,{locale:I})}),r=x(r,e).valueOf()},this.onBlur=t=>{this.fwBlur.emit({event:t,name:this.name})},this.onFocus=()=>{this.fwFocus.emit()}}currentTimeLabel(t){return this.isMeridianFormat?t.meridianFormat:t.nonMeridianFormat}currentTimeValue(t){return t.nonMeridianFormat}setTimeValue(t){const{value:e}=t.detail;e&&this.fwChange.emit({event:t,name:this.name,value:e})}setEndTime(){this.isDefaultEndTime&&(this.maxTime=this.isMeridianFormat?"11:59 PM":"23:59")}async setFocus(){this.nativeInput&&this.nativeInput.focus()}componentWillLoad(){30!==this.interval&&this.setEndTime(),this.setTimeValues()}render(){const{host:t,name:e,value:n}=this;return h(t,e,n),i("div",{class:"timepicker"},i("fw-select",{name:this.name,label:this.label,hintText:this.hintText,errorText:this.errorText,warningText:this.warningText,disabled:this.disabled,value:this.value,required:this.required,onFwChange:t=>this.setTimeValue(t),onFwBlur:this.onBlur,ref:t=>this.nativeInput=t,state:this.state,placeholder:this.placeholder,search:!1,optionsPlacement:this.optionsPlacement,caret:this.caret},this.timeValues.map((t=>i("fw-select-option",{value:this.currentTimeValue(t)},this.currentTimeLabel(t))))))}get host(){return n(this)}};Ne.style=':host{font-family:var(--fw-font-family, -apple-system, blinkmacsystemfont, "Segoe UI", roboto, oxygen, ubuntu, cantarell, "Open Sans", "Helvetica Neue", sans-serif);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-box-sizing:border-box;box-sizing:border-box}.timepicker{display:block}';export{Me as fw_datepicker,Te as fw_radio,Ee as fw_radio_group,Se as fw_textarea,Ne as fw_timepicker}