@kong-ui-public/core 1.11.10-pr.2694.d983d66d0.0 → 1.11.10-pr.2856.f0aa93e2a.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.es.js CHANGED
@@ -24,7 +24,7 @@ function ot() {
24
24
  }
25
25
  };
26
26
  }
27
- const p = 6048e5, J = 864e5, L = Symbol.for("constructDateFrom");
27
+ const p = 6048e5, J = 864e5, L = /* @__PURE__ */ Symbol.for("constructDateFrom");
28
28
  function P(t, e) {
29
29
  return typeof t == "function" ? t(e) : t && typeof t == "object" && L in t ? t[L](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
30
30
  }
@@ -585,7 +585,6 @@ const y = {
585
585
  return n;
586
586
  case "aaaaa":
587
587
  return n[0];
588
- case "aaaa":
589
588
  default:
590
589
  return n === "am" ? "a.m." : "p.m.";
591
590
  }
@@ -625,13 +624,14 @@ const y = {
625
624
  G: function(t, e, n) {
626
625
  const r = t.getFullYear() > 0 ? 1 : 0;
627
626
  switch (e) {
627
+ // AD, BC
628
628
  case "G":
629
629
  case "GG":
630
630
  case "GGG":
631
631
  return n.era(r, { width: "abbreviated" });
632
+ // A, B
632
633
  case "GGGGG":
633
634
  return n.era(r, { width: "narrow" });
634
- case "GGGG":
635
635
  default:
636
636
  return n.era(r, { width: "wide" });
637
637
  }
@@ -675,23 +675,27 @@ const y = {
675
675
  Q: function(t, e, n) {
676
676
  const r = Math.ceil((t.getMonth() + 1) / 3);
677
677
  switch (e) {
678
+ // 1, 2, 3, 4
678
679
  case "Q":
679
680
  return String(r);
681
+ // 01, 02, 03, 04
680
682
  case "QQ":
681
683
  return s(r, 2);
684
+ // 1st, 2nd, 3rd, 4th
682
685
  case "Qo":
683
686
  return n.ordinalNumber(r, { unit: "quarter" });
687
+ // Q1, Q2, Q3, Q4
684
688
  case "QQQ":
685
689
  return n.quarter(r, {
686
690
  width: "abbreviated",
687
691
  context: "formatting"
688
692
  });
693
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
689
694
  case "QQQQQ":
690
695
  return n.quarter(r, {
691
696
  width: "narrow",
692
697
  context: "formatting"
693
698
  });
694
- case "QQQQ":
695
699
  default:
696
700
  return n.quarter(r, {
697
701
  width: "wide",
@@ -703,23 +707,27 @@ const y = {
703
707
  q: function(t, e, n) {
704
708
  const r = Math.ceil((t.getMonth() + 1) / 3);
705
709
  switch (e) {
710
+ // 1, 2, 3, 4
706
711
  case "q":
707
712
  return String(r);
713
+ // 01, 02, 03, 04
708
714
  case "qq":
709
715
  return s(r, 2);
716
+ // 1st, 2nd, 3rd, 4th
710
717
  case "qo":
711
718
  return n.ordinalNumber(r, { unit: "quarter" });
719
+ // Q1, Q2, Q3, Q4
712
720
  case "qqq":
713
721
  return n.quarter(r, {
714
722
  width: "abbreviated",
715
723
  context: "standalone"
716
724
  });
725
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
717
726
  case "qqqqq":
718
727
  return n.quarter(r, {
719
728
  width: "narrow",
720
729
  context: "standalone"
721
730
  });
722
- case "qqqq":
723
731
  default:
724
732
  return n.quarter(r, {
725
733
  width: "wide",
@@ -734,19 +742,21 @@ const y = {
734
742
  case "M":
735
743
  case "MM":
736
744
  return y.M(t, e);
745
+ // 1st, 2nd, ..., 12th
737
746
  case "Mo":
738
747
  return n.ordinalNumber(r + 1, { unit: "month" });
748
+ // Jan, Feb, ..., Dec
739
749
  case "MMM":
740
750
  return n.month(r, {
741
751
  width: "abbreviated",
742
752
  context: "formatting"
743
753
  });
754
+ // J, F, ..., D
744
755
  case "MMMMM":
745
756
  return n.month(r, {
746
757
  width: "narrow",
747
758
  context: "formatting"
748
759
  });
749
- case "MMMM":
750
760
  default:
751
761
  return n.month(r, { width: "wide", context: "formatting" });
752
762
  }
@@ -755,23 +765,27 @@ const y = {
755
765
  L: function(t, e, n) {
756
766
  const r = t.getMonth();
757
767
  switch (e) {
768
+ // 1, 2, ..., 12
758
769
  case "L":
759
770
  return String(r + 1);
771
+ // 01, 02, ..., 12
760
772
  case "LL":
761
773
  return s(r + 1, 2);
774
+ // 1st, 2nd, ..., 12th
762
775
  case "Lo":
763
776
  return n.ordinalNumber(r + 1, { unit: "month" });
777
+ // Jan, Feb, ..., Dec
764
778
  case "LLL":
765
779
  return n.month(r, {
766
780
  width: "abbreviated",
767
781
  context: "standalone"
768
782
  });
783
+ // J, F, ..., D
769
784
  case "LLLLL":
770
785
  return n.month(r, {
771
786
  width: "narrow",
772
787
  context: "standalone"
773
788
  });
774
- case "LLLL":
775
789
  default:
776
790
  return n.month(r, { width: "wide", context: "standalone" });
777
791
  }
@@ -799,6 +813,7 @@ const y = {
799
813
  E: function(t, e, n) {
800
814
  const r = t.getDay();
801
815
  switch (e) {
816
+ // Tue
802
817
  case "E":
803
818
  case "EE":
804
819
  case "EEE":
@@ -806,17 +821,18 @@ const y = {
806
821
  width: "abbreviated",
807
822
  context: "formatting"
808
823
  });
824
+ // T
809
825
  case "EEEEE":
810
826
  return n.day(r, {
811
827
  width: "narrow",
812
828
  context: "formatting"
813
829
  });
830
+ // Tu
814
831
  case "EEEEEE":
815
832
  return n.day(r, {
816
833
  width: "short",
817
834
  context: "formatting"
818
835
  });
819
- case "EEEE":
820
836
  default:
821
837
  return n.day(r, {
822
838
  width: "wide",
@@ -828,10 +844,13 @@ const y = {
828
844
  e: function(t, e, n, r) {
829
845
  const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
830
846
  switch (e) {
847
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
831
848
  case "e":
832
849
  return String(i);
850
+ // Padded numerical value
833
851
  case "ee":
834
852
  return s(i, 2);
853
+ // 1st, 2nd, ..., 7th
835
854
  case "eo":
836
855
  return n.ordinalNumber(i, { unit: "day" });
837
856
  case "eee":
@@ -839,17 +858,18 @@ const y = {
839
858
  width: "abbreviated",
840
859
  context: "formatting"
841
860
  });
861
+ // T
842
862
  case "eeeee":
843
863
  return n.day(a, {
844
864
  width: "narrow",
845
865
  context: "formatting"
846
866
  });
867
+ // Tu
847
868
  case "eeeeee":
848
869
  return n.day(a, {
849
870
  width: "short",
850
871
  context: "formatting"
851
872
  });
852
- case "eeee":
853
873
  default:
854
874
  return n.day(a, {
855
875
  width: "wide",
@@ -861,10 +881,13 @@ const y = {
861
881
  c: function(t, e, n, r) {
862
882
  const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
863
883
  switch (e) {
884
+ // Numerical value (same as in `e`)
864
885
  case "c":
865
886
  return String(i);
887
+ // Padded numerical value
866
888
  case "cc":
867
889
  return s(i, e.length);
890
+ // 1st, 2nd, ..., 7th
868
891
  case "co":
869
892
  return n.ordinalNumber(i, { unit: "day" });
870
893
  case "ccc":
@@ -872,17 +895,18 @@ const y = {
872
895
  width: "abbreviated",
873
896
  context: "standalone"
874
897
  });
898
+ // T
875
899
  case "ccccc":
876
900
  return n.day(a, {
877
901
  width: "narrow",
878
902
  context: "standalone"
879
903
  });
904
+ // Tu
880
905
  case "cccccc":
881
906
  return n.day(a, {
882
907
  width: "short",
883
908
  context: "standalone"
884
909
  });
885
- case "cccc":
886
910
  default:
887
911
  return n.day(a, {
888
912
  width: "wide",
@@ -894,28 +918,33 @@ const y = {
894
918
  i: function(t, e, n) {
895
919
  const r = t.getDay(), a = r === 0 ? 7 : r;
896
920
  switch (e) {
921
+ // 2
897
922
  case "i":
898
923
  return String(a);
924
+ // 02
899
925
  case "ii":
900
926
  return s(a, e.length);
927
+ // 2nd
901
928
  case "io":
902
929
  return n.ordinalNumber(a, { unit: "day" });
930
+ // Tue
903
931
  case "iii":
904
932
  return n.day(r, {
905
933
  width: "abbreviated",
906
934
  context: "formatting"
907
935
  });
936
+ // T
908
937
  case "iiiii":
909
938
  return n.day(r, {
910
939
  width: "narrow",
911
940
  context: "formatting"
912
941
  });
942
+ // Tu
913
943
  case "iiiiii":
914
944
  return n.day(r, {
915
945
  width: "short",
916
946
  context: "formatting"
917
947
  });
918
- case "iiii":
919
948
  default:
920
949
  return n.day(r, {
921
950
  width: "wide",
@@ -943,7 +972,6 @@ const y = {
943
972
  width: "narrow",
944
973
  context: "formatting"
945
974
  });
946
- case "aaaa":
947
975
  default:
948
976
  return n.dayPeriod(a, {
949
977
  width: "wide",
@@ -972,7 +1000,6 @@ const y = {
972
1000
  width: "narrow",
973
1001
  context: "formatting"
974
1002
  });
975
- case "bbbb":
976
1003
  default:
977
1004
  return n.dayPeriod(a, {
978
1005
  width: "wide",
@@ -997,7 +1024,6 @@ const y = {
997
1024
  width: "narrow",
998
1025
  context: "formatting"
999
1026
  });
1000
- case "BBBB":
1001
1027
  default:
1002
1028
  return n.dayPeriod(a, {
1003
1029
  width: "wide",
@@ -1045,13 +1071,16 @@ const y = {
1045
1071
  if (r === 0)
1046
1072
  return "Z";
1047
1073
  switch (e) {
1074
+ // Hours and optional minutes
1048
1075
  case "X":
1049
1076
  return H(r);
1077
+ // Hours, minutes and optional seconds without `:` delimiter
1078
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1079
+ // so this token always has the same output as `XX`
1050
1080
  case "XXXX":
1051
1081
  case "XX":
1052
1082
  return v(r);
1053
- case "XXXXX":
1054
- case "XXX":
1083
+ // Hours and minutes with `:` delimiter
1055
1084
  default:
1056
1085
  return v(r, ":");
1057
1086
  }
@@ -1060,13 +1089,16 @@ const y = {
1060
1089
  x: function(t, e, n) {
1061
1090
  const r = t.getTimezoneOffset();
1062
1091
  switch (e) {
1092
+ // Hours and optional minutes
1063
1093
  case "x":
1064
1094
  return H(r);
1095
+ // Hours, minutes and optional seconds without `:` delimiter
1096
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1097
+ // so this token always has the same output as `xx`
1065
1098
  case "xxxx":
1066
1099
  case "xx":
1067
1100
  return v(r);
1068
- case "xxxxx":
1069
- case "xxx":
1101
+ // Hours and minutes with `:` delimiter
1070
1102
  default:
1071
1103
  return v(r, ":");
1072
1104
  }
@@ -1075,11 +1107,11 @@ const y = {
1075
1107
  O: function(t, e, n) {
1076
1108
  const r = t.getTimezoneOffset();
1077
1109
  switch (e) {
1110
+ // Short
1078
1111
  case "O":
1079
1112
  case "OO":
1080
1113
  case "OOO":
1081
1114
  return "GMT" + I(r, ":");
1082
- case "OOOO":
1083
1115
  default:
1084
1116
  return "GMT" + v(r, ":");
1085
1117
  }
@@ -1088,11 +1120,11 @@ const y = {
1088
1120
  z: function(t, e, n) {
1089
1121
  const r = t.getTimezoneOffset();
1090
1122
  switch (e) {
1123
+ // Short
1091
1124
  case "z":
1092
1125
  case "zz":
1093
1126
  case "zzz":
1094
1127
  return "GMT" + I(r, ":");
1095
- case "zzzz":
1096
1128
  default:
1097
1129
  return "GMT" + v(r, ":");
1098
1130
  }
@@ -1126,7 +1158,6 @@ const q = (t, e) => {
1126
1158
  return e.date({ width: "medium" });
1127
1159
  case "PPP":
1128
1160
  return e.date({ width: "long" });
1129
- case "PPPP":
1130
1161
  default:
1131
1162
  return e.date({ width: "full" });
1132
1163
  }
@@ -1138,7 +1169,6 @@ const q = (t, e) => {
1138
1169
  return e.time({ width: "medium" });
1139
1170
  case "ppp":
1140
1171
  return e.time({ width: "long" });
1141
- case "pppp":
1142
1172
  default:
1143
1173
  return e.time({ width: "full" });
1144
1174
  }
@@ -1157,7 +1187,6 @@ const q = (t, e) => {
1157
1187
  case "PPP":
1158
1188
  i = e.dateTime({ width: "long" });
1159
1189
  break;
1160
- case "PPPP":
1161
1190
  default:
1162
1191
  i = e.dateTime({ width: "full" });
1163
1192
  break;
package/dist/core.umd.js CHANGED
@@ -1 +1 @@
1
- (function(g,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("axios"),require("vue")):typeof define=="function"&&define.amd?define(["exports","axios","vue"],T):(g=typeof globalThis<"u"?globalThis:g||self,T(g["kong-ui-core"]={},g.axios,g.Vue))})(this,function(g,T,y){"use strict";function Q(){return{getAxiosInstance:(n={})=>{try{const r=y.inject("get-axios-instance",void 0);return typeof r=="function"?r(n):T.create({withCredentials:!0,timeout:3e4,...n})}catch(r){return console.warn("getAxiosInstance:",r.message||r),T.create({withCredentials:!0,timeout:3e4,...n})}},getTraceIdFromError:n=>{var r;return((r=n==null?void 0:n.response)==null?void 0:r.headers["x-datadog-trace-id"])||""}}}const L=6048e5,U=864e5,F=Symbol.for("constructDateFrom");function S(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&F in t?t[F](e):t instanceof Date?new t.constructor(e):new Date(e)}function P(t,e){return S(e||t,t)}let V={};function x(){return V}function E(t,e){var c,o,d,f;const n=x(),r=(e==null?void 0:e.weekStartsOn)??((o=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:o.weekStartsOn)??n.weekStartsOn??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,a=P(t,e==null?void 0:e.in),i=a.getDay(),u=(i<r?7:0)+i-r;return a.setDate(a.getDate()-u),a.setHours(0,0,0,0),a}function W(t,e){return E(t,{...e,weekStartsOn:1})}function _(t,e){const n=P(t,e==null?void 0:e.in),r=n.getFullYear(),a=S(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const i=W(a),u=S(n,0);u.setFullYear(r,0,4),u.setHours(0,0,0,0);const c=W(u);return n.getTime()>=i.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function N(t){const e=P(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function J(t,...e){const n=S.bind(null,e.find(r=>typeof r=="object"));return e.map(n)}function R(t,e){const n=P(t,e==null?void 0:e.in);return n.setHours(0,0,0,0),n}function $(t,e,n){const[r,a]=J(n==null?void 0:n.in,t,e),i=R(r),u=R(a),c=+i-N(i),o=+u-N(u);return Math.round((c-o)/U)}function z(t,e){const n=_(t,e),r=S(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),W(r)}function K(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Z(t){return!(!K(t)&&typeof t!="number"||isNaN(+P(t)))}function ee(t,e){const n=P(t,e==null?void 0:e.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const te={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"}},ne=(t,e,n)=>{let r;const a=te[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function C(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const re={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ae={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ie={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},oe={date:C({formats:re,defaultWidth:"full"}),time:C({formats:ae,defaultWidth:"full"}),dateTime:C({formats:ie,defaultWidth:"full"})},ue={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ce=(t,e,n,r)=>ue[t];function M(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const u=t.defaultFormattingWidth||t.defaultWidth,c=n!=null&&n.width?String(n.width):u;a=t.formattingValues[c]||t.formattingValues[u]}else{const u=t.defaultWidth,c=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[c]||t.values[u]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const se={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},de={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},fe={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"]},le={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"]},he={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"}},me={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"}},ge={ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:M({values:se,defaultWidth:"wide"}),quarter:M({values:de,defaultWidth:"wide",argumentCallback:t=>t-1}),month:M({values:fe,defaultWidth:"wide"}),day:M({values:le,defaultWidth:"wide"}),dayPeriod:M({values:he,defaultWidth:"wide",formattingValues:me,defaultFormattingWidth:"wide"})};function k(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const u=i[0],c=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],o=Array.isArray(c)?be(c,w=>w.test(u)):we(c,w=>w.test(u));let d;d=t.valueCallback?t.valueCallback(o):o,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(u.length);return{value:d,rest:f}}}function we(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function be(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function ye(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let u=t.valueCallback?t.valueCallback(i[0]):i[0];u=n.valueCallback?n.valueCallback(u):u;const c=e.slice(a.length);return{value:u,rest:c}}}const Pe=/^(\d+)(th|st|nd|rd)?/i,Se=/\d+/i,Oe={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},ve={any:[/^b/i,/^(a|c)/i]},Te={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},De={any:[/1/i,/2/i,/3/i,/4/i]},Ee={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},Me={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]},ke={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},xe={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]},We={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},Ae={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}},Ce={ordinalNumber:ye({matchPattern:Pe,parsePattern:Se,valueCallback:t=>parseInt(t,10)}),era:k({matchPatterns:Oe,defaultMatchWidth:"wide",parsePatterns:ve,defaultParseWidth:"any"}),quarter:k({matchPatterns:Te,defaultMatchWidth:"wide",parsePatterns:De,defaultParseWidth:"any",valueCallback:t=>t+1}),month:k({matchPatterns:Ee,defaultMatchWidth:"wide",parsePatterns:Me,defaultParseWidth:"any"}),day:k({matchPatterns:ke,defaultMatchWidth:"wide",parsePatterns:xe,defaultParseWidth:"any"}),dayPeriod:k({matchPatterns:We,defaultMatchWidth:"any",parsePatterns:Ae,defaultParseWidth:"any"})},Ye={code:"en-US",formatDistance:ne,formatLong:oe,formatRelative:ce,localize:ge,match:Ce,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Le(t,e){const n=P(t,e==null?void 0:e.in);return $(n,ee(n))+1}function Fe(t,e){const n=P(t,e==null?void 0:e.in),r=+W(n)-+z(n);return Math.round(r/L)+1}function I(t,e){var f,w,h,b;const n=P(t,e==null?void 0:e.in),r=n.getFullYear(),a=x(),i=(e==null?void 0:e.firstWeekContainsDate)??((w=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:w.firstWeekContainsDate)??a.firstWeekContainsDate??((b=(h=a.locale)==null?void 0:h.options)==null?void 0:b.firstWeekContainsDate)??1,u=S((e==null?void 0:e.in)||t,0);u.setFullYear(r+1,0,i),u.setHours(0,0,0,0);const c=E(u,e),o=S((e==null?void 0:e.in)||t,0);o.setFullYear(r,0,i),o.setHours(0,0,0,0);const d=E(o,e);return+n>=+c?r+1:+n>=+d?r:r-1}function _e(t,e){var c,o,d,f;const n=x(),r=(e==null?void 0:e.firstWeekContainsDate)??((o=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:o.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=I(t,e),i=S((e==null?void 0:e.in)||t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),E(i,e)}function Ne(t,e){const n=P(t,e==null?void 0:e.in),r=+E(n,e)-+_e(n,e);return Math.round(r/L)+1}function s(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const O={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return s(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):s(n+1,2)},d(t,e){return s(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return s(t.getHours()%12||12,e.length)},H(t,e){return s(t.getHours(),e.length)},m(t,e){return s(t.getMinutes(),e.length)},s(t,e){return s(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return s(a,e.length)}},D={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},H={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return O.y(t,e)},Y:function(t,e,n,r){const a=I(t,r),i=a>0?a:1-a;if(e==="YY"){const u=i%100;return s(u,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):s(i,e.length)},R:function(t,e){const n=_(t);return s(n,e.length)},u:function(t,e){const n=t.getFullYear();return s(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return s(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return s(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return O.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return s(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Ne(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):s(a,e.length)},I:function(t,e,n){const r=Fe(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):s(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):O.d(t,e)},D:function(t,e,n){const r=Le(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):s(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return s(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return s(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return s(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=D.noon:r===0?a=D.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=D.evening:r>=12?a=D.afternoon:r>=4?a=D.morning:a=D.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return O.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):O.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):s(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):s(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):O.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):O.s(t,e)},S:function(t,e){return O.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return G(r);case"XXXX":case"XX":return v(r);case"XXXXX":case"XXX":default:return v(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return G(r);case"xxxx":case"xx":return v(r);case"xxxxx":case"xxx":default:return v(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+q(r,":");case"OOOO":default:return"GMT"+v(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+q(r,":");case"zzzz":default:return"GMT"+v(r,":")}},t:function(t,e,n){const r=Math.trunc(+t/1e3);return s(r,e.length)},T:function(t,e,n){return s(+t,e.length)}};function q(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+s(i,2)}function G(t,e){return t%60===0?(t>0?"-":"+")+s(Math.abs(t)/60,2):v(t,e)}function v(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=s(Math.trunc(r/60),2),i=s(r%60,2);return n+a+e+i}const 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"})}},p=(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"})}},Re={p,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return j(t,e);let i;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"});break}return i.replace("{{date}}",j(r,e)).replace("{{time}}",p(a,e))}},Ie=/^D+$/,He=/^Y+$/,qe=["D","DD","YY","YYYY"];function Ge(t){return Ie.test(t)}function je(t){return He.test(t)}function pe(t,e,n){const r=Be(t,e,n);if(console.warn(r),qe.includes(t))throw new RangeError(r)}function Be(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Xe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Qe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ue=/^'([^]*?)'?$/,Ve=/''/g,Je=/[a-zA-Z]/;function $e(t,e,n){var f,w,h,b;const r=x(),a=r.locale??Ye,i=r.firstWeekContainsDate??((w=(f=r.locale)==null?void 0:f.options)==null?void 0:w.firstWeekContainsDate)??1,u=r.weekStartsOn??((b=(h=r.locale)==null?void 0:h.options)==null?void 0:b.weekStartsOn)??0,c=P(t,n==null?void 0:n.in);if(!Z(c))throw new RangeError("Invalid time value");let o=e.match(Qe).map(m=>{const l=m[0];if(l==="p"||l==="P"){const Y=Re[l];return Y(m,a.formatLong)}return m}).join("").match(Xe).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const l=m[0];if(l==="'")return{isToken:!1,value:ze(m)};if(H[l])return{isToken:!0,value:m};if(l.match(Je))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(o=a.localize.preprocessor(c,o));const d={firstWeekContainsDate:i,weekStartsOn:u,locale:a};return o.map(m=>{if(!m.isToken)return m.value;const l=m.value;(je(l)||Ge(l))&&pe(l,e,String(t));const Y=H[l[0]];return Y(c,l,a.localize,d)}).join("")}function ze(t){const e=t.match(Ue);return e?e[1].replace(Ve,"'"):t}function Ke(){return{formatDateBy:(n,r={})=>{if(isNaN(n))return null;try{return new Date(n*1e3).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",weekday:"short",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1,...r})}catch{return null}},formatUnixToDate:(n,r)=>{if(!n)return"";const a=r?"yyyy-MM-dd HH:mm:ss":"yyyy-MM-dd HH:mm:ss XX";try{const i=new Date(n*1e3);return $e(i,a)}catch{return""}}}}function Ze(){return{debounce:(e,n)=>{let r;return(...a)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...a)},n)}}}}function et({script:t,styles:e,onReady:n}){const r=y.ref(!0),a=y.ref(!0),i=async()=>{const{libName:o,url:d,type:f}=t;if((f!==void 0&&["umd","es"].includes(f)?f:"umd")==="es"){await import(d),typeof n=="function"&&await n();return}const h=o.startsWith("kong-ui-")?o:`kong-ui-${o}`;return window[h]||(window[h]=await new Promise((b,m)=>{const l=document.createElement("script");l.async=!0,l.addEventListener("load",async()=>{typeof n=="function"&&await n(),r.value=!1,b(window[h])}),l.addEventListener("error",()=>{m(new Error(`Could not load '${h}' from ${d}`))}),l.src=d,document.head.appendChild(l)})),window[h]},u=async(o,d)=>{var f;for(const w of o){const h=document.createElement("link");h.type="text/css",h.rel="stylesheet",h.href=w;const b=d?document.querySelector(d):null,m=d?(f=b==null?void 0:b.shadowRoot)==null?void 0:f.children[0]:null;if(b&&m)try{m.appendChild(h)}catch{document.head.appendChild(h)}else document.head.appendChild(h)}};return{importPackage:async()=>{var d,f;if(!t||!t.url||typeof window>"u"||typeof document>"u")return;const o=y.computed(()=>!!(e&&(e!=null&&e.urls)&&(e!=null&&e.urls.length)&&e.shadowRoot));if((!e||!(e!=null&&e.urls)||!((d=e==null?void 0:e.urls)!=null&&d.length))&&(a.value=!1),e!=null&&e.urls&&((f=e==null?void 0:e.urls)!=null&&f.length)&&!o.value&&(await u(e.urls),a.value=!1),(!t.type||t.type==="umd")&&!o.value)return await i();await i(),await y.nextTick(),r.value=!1,e!=null&&e.urls&&o.value&&(await u(e.urls,e==null?void 0:e.shadowRoot),await y.nextTick(),a.value=!1)},loadingPackage:y.readonly(r),loadingStyles:y.readonly(a)}}var B=(t=>(t.VALIDATING="VALIDATING",t.VALIDATING_HAS_DATA="VALIDATING_HAS_DATA",t.PENDING="PENDING",t.SUCCESS="SUCCESS",t.SUCCESS_HAS_DATA="SUCCESS_HAS_DATA",t.ERROR="ERROR",t.STALE_IF_ERROR="STALE_IF_ERROR",t))(B||{});const tt=t=>{var e,n,r,a,i;return t?!!((e=Object.keys(t))!=null&&e.length||(n=t.data)!=null&&n.length||(a=(r=t.data)==null?void 0:r.data)!=null&&a.length||!((i=t.data)!=null&&i.data)&&typeof t.data=="object"&&Object.keys(t==null?void 0:t.data).length):!1};function nt(t=y.ref({}),e,n,r=tt){const a=y.ref("PENDING");return y.watchEffect(()=>{const i=r(t.value);if(t.value&&i&&n.value){a.value="VALIDATING_HAS_DATA";return}if(t.value&&n.value){a.value="VALIDATING";return}if(t.value&&e.value){a.value="STALE_IF_ERROR";return}if(t.value===void 0&&!e.value){a.value="PENDING";return}if(t.value&&!e.value&&i){a.value="SUCCESS_HAS_DATA";return}if(t.value&&!e.value){a.value="SUCCESS";return}t.value===void 0&&e&&(a.value="ERROR")}),{state:a,swrvState:B}}const A="khcp-user-table-preferences",X={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnVisibility:{}};function rt(){const t=i=>{if(typeof i=="string")try{return JSON.parse(i)}catch(u){console.error("useTablePreferences(tryParseJson)",u);return}},e=()=>{const i=t(localStorage.getItem(A));return!i||!Object.keys(i).length?new Map:new Map(Object.entries(i))};return{setTablePreferences:(i,u)=>{try{const c=e();c.set(i,u),localStorage.setItem(A,JSON.stringify(Object.fromEntries(c.entries())))}catch(c){console.error("useTablePreferences(setTablePreferences)",c)}},getTablePreferences:(i,u)=>{const c=e();return(c==null?void 0:c.get(i))||void 0||u||X},deleteAllTablePreferences:()=>{localStorage.removeItem(A)}}}function at(){const t=()=>{var o;return((o=window==null?void 0:window.location)==null?void 0:o.search)||""};return{getLocationSearch:t,getLocationHostname:()=>{var o;return((o=window==null?void 0:window.location)==null?void 0:o.hostname)||""},getLocationHref:()=>{var o;return((o=window==null?void 0:window.location)==null?void 0:o.href)||""},getLocationPathname:()=>{var o;return((o=window==null?void 0:window.location)==null?void 0:o.pathname)||""},getLocationOrigin:()=>{var o;return((o=window==null?void 0:window.location)==null?void 0:o.origin)||""},getUrlSearchParams:()=>new URLSearchParams(t()),setLocationAssign:o=>{window.location.assign(o)},setLocationReplace:o=>{window.location.replace(o)}}}g.DEFAULT_USER_TABLE_PREFERENCES=X,g.USER_TABLE_PREFERENCES_LOCAL_STORAGE_KEY=A,g.useAxios=Q,g.useDate=Ke,g.useDebounce=Ze,g.usePackage=et,g.useSwrvState=nt,g.useTablePreferences=rt,g.useWindow=at,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
1
+ (function(g,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("axios"),require("vue")):typeof define=="function"&&define.amd?define(["exports","axios","vue"],T):(g=typeof globalThis<"u"?globalThis:g||self,T(g["kong-ui-core"]={},g.axios,g.Vue))})(this,(function(g,T,y){"use strict";function Q(){return{getAxiosInstance:(n={})=>{try{const r=y.inject("get-axios-instance",void 0);return typeof r=="function"?r(n):T.create({withCredentials:!0,timeout:3e4,...n})}catch(r){return console.warn("getAxiosInstance:",r.message||r),T.create({withCredentials:!0,timeout:3e4,...n})}},getTraceIdFromError:n=>{var r;return((r=n==null?void 0:n.response)==null?void 0:r.headers["x-datadog-trace-id"])||""}}}const L=6048e5,U=864e5,F=Symbol.for("constructDateFrom");function S(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&F in t?t[F](e):t instanceof Date?new t.constructor(e):new Date(e)}function P(t,e){return S(e||t,t)}let V={};function x(){return V}function E(t,e){var c,o,d,f;const n=x(),r=(e==null?void 0:e.weekStartsOn)??((o=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:o.weekStartsOn)??n.weekStartsOn??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,a=P(t,e==null?void 0:e.in),i=a.getDay(),u=(i<r?7:0)+i-r;return a.setDate(a.getDate()-u),a.setHours(0,0,0,0),a}function W(t,e){return E(t,{...e,weekStartsOn:1})}function _(t,e){const n=P(t,e==null?void 0:e.in),r=n.getFullYear(),a=S(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const i=W(a),u=S(n,0);u.setFullYear(r,0,4),u.setHours(0,0,0,0);const c=W(u);return n.getTime()>=i.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function N(t){const e=P(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function J(t,...e){const n=S.bind(null,e.find(r=>typeof r=="object"));return e.map(n)}function R(t,e){const n=P(t,e==null?void 0:e.in);return n.setHours(0,0,0,0),n}function $(t,e,n){const[r,a]=J(n==null?void 0:n.in,t,e),i=R(r),u=R(a),c=+i-N(i),o=+u-N(u);return Math.round((c-o)/U)}function z(t,e){const n=_(t,e),r=S(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),W(r)}function K(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Z(t){return!(!K(t)&&typeof t!="number"||isNaN(+P(t)))}function ee(t,e){const n=P(t,e==null?void 0:e.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const te={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"}},ne=(t,e,n)=>{let r;const a=te[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function C(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const re={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ae={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ie={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},oe={date:C({formats:re,defaultWidth:"full"}),time:C({formats:ae,defaultWidth:"full"}),dateTime:C({formats:ie,defaultWidth:"full"})},ue={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ce=(t,e,n,r)=>ue[t];function M(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const u=t.defaultFormattingWidth||t.defaultWidth,c=n!=null&&n.width?String(n.width):u;a=t.formattingValues[c]||t.formattingValues[u]}else{const u=t.defaultWidth,c=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[c]||t.values[u]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const se={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},de={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},fe={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"]},le={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"]},he={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"}},me={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"}},ge={ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:M({values:se,defaultWidth:"wide"}),quarter:M({values:de,defaultWidth:"wide",argumentCallback:t=>t-1}),month:M({values:fe,defaultWidth:"wide"}),day:M({values:le,defaultWidth:"wide"}),dayPeriod:M({values:he,defaultWidth:"wide",formattingValues:me,defaultFormattingWidth:"wide"})};function k(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const u=i[0],c=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],o=Array.isArray(c)?be(c,w=>w.test(u)):we(c,w=>w.test(u));let d;d=t.valueCallback?t.valueCallback(o):o,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(u.length);return{value:d,rest:f}}}function we(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function be(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function ye(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let u=t.valueCallback?t.valueCallback(i[0]):i[0];u=n.valueCallback?n.valueCallback(u):u;const c=e.slice(a.length);return{value:u,rest:c}}}const Pe=/^(\d+)(th|st|nd|rd)?/i,Se=/\d+/i,Oe={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},ve={any:[/^b/i,/^(a|c)/i]},Te={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},De={any:[/1/i,/2/i,/3/i,/4/i]},Ee={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},Me={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]},ke={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},xe={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]},We={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},Ae={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}},Ce={ordinalNumber:ye({matchPattern:Pe,parsePattern:Se,valueCallback:t=>parseInt(t,10)}),era:k({matchPatterns:Oe,defaultMatchWidth:"wide",parsePatterns:ve,defaultParseWidth:"any"}),quarter:k({matchPatterns:Te,defaultMatchWidth:"wide",parsePatterns:De,defaultParseWidth:"any",valueCallback:t=>t+1}),month:k({matchPatterns:Ee,defaultMatchWidth:"wide",parsePatterns:Me,defaultParseWidth:"any"}),day:k({matchPatterns:ke,defaultMatchWidth:"wide",parsePatterns:xe,defaultParseWidth:"any"}),dayPeriod:k({matchPatterns:We,defaultMatchWidth:"any",parsePatterns:Ae,defaultParseWidth:"any"})},Ye={code:"en-US",formatDistance:ne,formatLong:oe,formatRelative:ce,localize:ge,match:Ce,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Le(t,e){const n=P(t,e==null?void 0:e.in);return $(n,ee(n))+1}function Fe(t,e){const n=P(t,e==null?void 0:e.in),r=+W(n)-+z(n);return Math.round(r/L)+1}function I(t,e){var f,w,h,b;const n=P(t,e==null?void 0:e.in),r=n.getFullYear(),a=x(),i=(e==null?void 0:e.firstWeekContainsDate)??((w=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:w.firstWeekContainsDate)??a.firstWeekContainsDate??((b=(h=a.locale)==null?void 0:h.options)==null?void 0:b.firstWeekContainsDate)??1,u=S((e==null?void 0:e.in)||t,0);u.setFullYear(r+1,0,i),u.setHours(0,0,0,0);const c=E(u,e),o=S((e==null?void 0:e.in)||t,0);o.setFullYear(r,0,i),o.setHours(0,0,0,0);const d=E(o,e);return+n>=+c?r+1:+n>=+d?r:r-1}function _e(t,e){var c,o,d,f;const n=x(),r=(e==null?void 0:e.firstWeekContainsDate)??((o=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:o.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=I(t,e),i=S((e==null?void 0:e.in)||t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),E(i,e)}function Ne(t,e){const n=P(t,e==null?void 0:e.in),r=+E(n,e)-+_e(n,e);return Math.round(r/L)+1}function s(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const O={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return s(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):s(n+1,2)},d(t,e){return s(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(t,e){return s(t.getHours()%12||12,e.length)},H(t,e){return s(t.getHours(),e.length)},m(t,e){return s(t.getMinutes(),e.length)},s(t,e){return s(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return s(a,e.length)}},D={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},H={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return O.y(t,e)},Y:function(t,e,n,r){const a=I(t,r),i=a>0?a:1-a;if(e==="YY"){const u=i%100;return s(u,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):s(i,e.length)},R:function(t,e){const n=_(t);return s(n,e.length)},u:function(t,e){const n=t.getFullYear();return s(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return s(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return s(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return O.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return s(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Ne(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):s(a,e.length)},I:function(t,e,n){const r=Fe(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):s(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):O.d(t,e)},D:function(t,e,n){const r=Le(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):s(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return s(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return s(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return s(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=D.noon:r===0?a=D.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=D.evening:r>=12?a=D.afternoon:r>=4?a=D.morning:a=D.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return O.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):O.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):s(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):s(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):O.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):O.s(t,e)},S:function(t,e){return O.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return G(r);case"XXXX":case"XX":return v(r);default:return v(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return G(r);case"xxxx":case"xx":return v(r);default:return v(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+q(r,":");default:return"GMT"+v(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+q(r,":");default:return"GMT"+v(r,":")}},t:function(t,e,n){const r=Math.trunc(+t/1e3);return s(r,e.length)},T:function(t,e,n){return s(+t,e.length)}};function q(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+s(i,2)}function G(t,e){return t%60===0?(t>0?"-":"+")+s(Math.abs(t)/60,2):v(t,e)}function v(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=s(Math.trunc(r/60),2),i=s(r%60,2);return n+a+e+i}const 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"});default:return e.date({width:"full"})}},p=(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"});default:return e.time({width:"full"})}},Re={p,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return j(t,e);let i;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;default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",j(r,e)).replace("{{time}}",p(a,e))}},Ie=/^D+$/,He=/^Y+$/,qe=["D","DD","YY","YYYY"];function Ge(t){return Ie.test(t)}function je(t){return He.test(t)}function pe(t,e,n){const r=Be(t,e,n);if(console.warn(r),qe.includes(t))throw new RangeError(r)}function Be(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Xe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Qe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ue=/^'([^]*?)'?$/,Ve=/''/g,Je=/[a-zA-Z]/;function $e(t,e,n){var f,w,h,b;const r=x(),a=r.locale??Ye,i=r.firstWeekContainsDate??((w=(f=r.locale)==null?void 0:f.options)==null?void 0:w.firstWeekContainsDate)??1,u=r.weekStartsOn??((b=(h=r.locale)==null?void 0:h.options)==null?void 0:b.weekStartsOn)??0,c=P(t,n==null?void 0:n.in);if(!Z(c))throw new RangeError("Invalid time value");let o=e.match(Qe).map(m=>{const l=m[0];if(l==="p"||l==="P"){const Y=Re[l];return Y(m,a.formatLong)}return m}).join("").match(Xe).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const l=m[0];if(l==="'")return{isToken:!1,value:ze(m)};if(H[l])return{isToken:!0,value:m};if(l.match(Je))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(o=a.localize.preprocessor(c,o));const d={firstWeekContainsDate:i,weekStartsOn:u,locale:a};return o.map(m=>{if(!m.isToken)return m.value;const l=m.value;(je(l)||Ge(l))&&pe(l,e,String(t));const Y=H[l[0]];return Y(c,l,a.localize,d)}).join("")}function ze(t){const e=t.match(Ue);return e?e[1].replace(Ve,"'"):t}function Ke(){return{formatDateBy:(n,r={})=>{if(isNaN(n))return null;try{return new Date(n*1e3).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",weekday:"short",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1,...r})}catch{return null}},formatUnixToDate:(n,r)=>{if(!n)return"";const a=r?"yyyy-MM-dd HH:mm:ss":"yyyy-MM-dd HH:mm:ss XX";try{const i=new Date(n*1e3);return $e(i,a)}catch{return""}}}}function Ze(){return{debounce:(e,n)=>{let r;return(...a)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...a)},n)}}}}function et({script:t,styles:e,onReady:n}){const r=y.ref(!0),a=y.ref(!0),i=async()=>{const{libName:o,url:d,type:f}=t;if((f!==void 0&&["umd","es"].includes(f)?f:"umd")==="es"){await import(d),typeof n=="function"&&await n();return}const h=o.startsWith("kong-ui-")?o:`kong-ui-${o}`;return window[h]||(window[h]=await new Promise((b,m)=>{const l=document.createElement("script");l.async=!0,l.addEventListener("load",async()=>{typeof n=="function"&&await n(),r.value=!1,b(window[h])}),l.addEventListener("error",()=>{m(new Error(`Could not load '${h}' from ${d}`))}),l.src=d,document.head.appendChild(l)})),window[h]},u=async(o,d)=>{var f;for(const w of o){const h=document.createElement("link");h.type="text/css",h.rel="stylesheet",h.href=w;const b=d?document.querySelector(d):null,m=d?(f=b==null?void 0:b.shadowRoot)==null?void 0:f.children[0]:null;if(b&&m)try{m.appendChild(h)}catch{document.head.appendChild(h)}else document.head.appendChild(h)}};return{importPackage:async()=>{var d,f;if(!t||!t.url||typeof window>"u"||typeof document>"u")return;const o=y.computed(()=>!!(e&&(e!=null&&e.urls)&&(e!=null&&e.urls.length)&&e.shadowRoot));if((!e||!(e!=null&&e.urls)||!((d=e==null?void 0:e.urls)!=null&&d.length))&&(a.value=!1),e!=null&&e.urls&&((f=e==null?void 0:e.urls)!=null&&f.length)&&!o.value&&(await u(e.urls),a.value=!1),(!t.type||t.type==="umd")&&!o.value)return await i();await i(),await y.nextTick(),r.value=!1,e!=null&&e.urls&&o.value&&(await u(e.urls,e==null?void 0:e.shadowRoot),await y.nextTick(),a.value=!1)},loadingPackage:y.readonly(r),loadingStyles:y.readonly(a)}}var B=(t=>(t.VALIDATING="VALIDATING",t.VALIDATING_HAS_DATA="VALIDATING_HAS_DATA",t.PENDING="PENDING",t.SUCCESS="SUCCESS",t.SUCCESS_HAS_DATA="SUCCESS_HAS_DATA",t.ERROR="ERROR",t.STALE_IF_ERROR="STALE_IF_ERROR",t))(B||{});const tt=t=>{var e,n,r,a,i;return t?!!((e=Object.keys(t))!=null&&e.length||(n=t.data)!=null&&n.length||(a=(r=t.data)==null?void 0:r.data)!=null&&a.length||!((i=t.data)!=null&&i.data)&&typeof t.data=="object"&&Object.keys(t==null?void 0:t.data).length):!1};function nt(t=y.ref({}),e,n,r=tt){const a=y.ref("PENDING");return y.watchEffect(()=>{const i=r(t.value);if(t.value&&i&&n.value){a.value="VALIDATING_HAS_DATA";return}if(t.value&&n.value){a.value="VALIDATING";return}if(t.value&&e.value){a.value="STALE_IF_ERROR";return}if(t.value===void 0&&!e.value){a.value="PENDING";return}if(t.value&&!e.value&&i){a.value="SUCCESS_HAS_DATA";return}if(t.value&&!e.value){a.value="SUCCESS";return}t.value===void 0&&e&&(a.value="ERROR")}),{state:a,swrvState:B}}const A="khcp-user-table-preferences",X={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnVisibility:{}};function rt(){const t=i=>{if(typeof i=="string")try{return JSON.parse(i)}catch(u){console.error("useTablePreferences(tryParseJson)",u);return}},e=()=>{const i=t(localStorage.getItem(A));return!i||!Object.keys(i).length?new Map:new Map(Object.entries(i))};return{setTablePreferences:(i,u)=>{try{const c=e();c.set(i,u),localStorage.setItem(A,JSON.stringify(Object.fromEntries(c.entries())))}catch(c){console.error("useTablePreferences(setTablePreferences)",c)}},getTablePreferences:(i,u)=>{const c=e();return(c==null?void 0:c.get(i))||void 0||u||X},deleteAllTablePreferences:()=>{localStorage.removeItem(A)}}}function at(){const t=()=>{var o;return((o=window==null?void 0:window.location)==null?void 0:o.search)||""};return{getLocationSearch:t,getLocationHostname:()=>{var o;return((o=window==null?void 0:window.location)==null?void 0:o.hostname)||""},getLocationHref:()=>{var o;return((o=window==null?void 0:window.location)==null?void 0:o.href)||""},getLocationPathname:()=>{var o;return((o=window==null?void 0:window.location)==null?void 0:o.pathname)||""},getLocationOrigin:()=>{var o;return((o=window==null?void 0:window.location)==null?void 0:o.origin)||""},getUrlSearchParams:()=>new URLSearchParams(t()),setLocationAssign:o=>{window.location.assign(o)},setLocationReplace:o=>{window.location.replace(o)}}}g.DEFAULT_USER_TABLE_PREFERENCES=X,g.USER_TABLE_PREFERENCES_LOCAL_STORAGE_KEY=A,g.useAxios=Q,g.useDate=Ke,g.useDebounce=Ze,g.usePackage=et,g.useSwrvState=nt,g.useTablePreferences=rt,g.useWindow=at,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/core",
3
- "version": "1.11.10-pr.2694.d983d66d0.0",
3
+ "version": "1.11.10-pr.2856.f0aa93e2a.0",
4
4
  "type": "module",
5
5
  "main": "./dist/core.umd.js",
6
6
  "module": "./dist/core.es.js",
@@ -10,9 +10,9 @@
10
10
  ],
11
11
  "exports": {
12
12
  ".": {
13
+ "types": "./dist/types/index.d.ts",
13
14
  "import": "./dist/core.es.js",
14
- "require": "./dist/core.umd.js",
15
- "types": "./dist/types/index.d.ts"
15
+ "require": "./dist/core.umd.js"
16
16
  },
17
17
  "./package.json": "./package.json",
18
18
  "./dist/*": "./dist/*"