dynamic-mui 2.0.26 → 2.1.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/XmlShapeDeserializer-3yQdm0b0.mjs +237 -0
- package/dist/XmlShapeDeserializer-XKJAoqLc.js +1 -0
- package/dist/ai/client.d.ts +2 -0
- package/dist/ai/index.d.ts +4 -0
- package/dist/ai/mapping.d.ts +14 -0
- package/dist/ai/react/AIFill.d.ts +25 -0
- package/dist/ai/react/AIForm.d.ts +29 -0
- package/dist/ai/react/AIFormGenerator.d.ts +20 -0
- package/dist/ai/react/AISchemaReview.d.ts +18 -0
- package/dist/ai/react/AITextAssist.d.ts +35 -0
- package/dist/ai/react/AIVisionImport.d.ts +21 -0
- package/dist/ai/react/index.d.ts +6 -0
- package/dist/ai/types.d.ts +107 -0
- package/dist/components/FormGenerator.d.ts +14 -1
- package/dist/components/controls/AddressField/addressfield.d.ts +2 -0
- package/dist/components/controls/Alert/alert.d.ts +3 -0
- package/dist/components/controls/Button/button.d.ts +3 -0
- package/dist/components/controls/CascadeSelect/cascadeselect.d.ts +2 -0
- package/dist/components/controls/ChipSelect/chipselect.d.ts +3 -0
- package/dist/components/controls/ColorPicker/colorpicker.d.ts +3 -0
- package/dist/components/controls/Computed/computed.d.ts +7 -0
- package/dist/components/controls/ConsentField/consentfield.d.ts +3 -0
- package/dist/components/controls/CurrencyField/currencyfield.d.ts +2 -0
- package/dist/components/controls/DateRangePicker/daterangepicker.d.ts +3 -0
- package/dist/components/controls/FileUpload/fileupload.d.ts +3 -0
- package/dist/components/controls/FormWizard/formwizard.d.ts +2 -0
- package/dist/components/controls/GeoField/geofield.d.ts +6 -0
- package/dist/components/controls/KeyValueField/keyvaluefield.d.ts +2 -0
- package/dist/components/controls/MarkdownEditor/markdowneditor.d.ts +3 -0
- package/dist/components/controls/MatrixField/matrixfield.d.ts +3 -0
- package/dist/components/controls/NumberStepper/numberstepper.d.ts +2 -0
- package/dist/components/controls/OtpField/otpfield.d.ts +2 -0
- package/dist/components/controls/PasswordField/passwordfield.d.ts +2 -0
- package/dist/components/controls/PhoneField/phonefield.d.ts +2 -0
- package/dist/components/controls/Rating/rating.d.ts +3 -0
- package/dist/components/controls/Slider/slider.d.ts +3 -0
- package/dist/components/controls/SummaryField/summaryfield.d.ts +7 -0
- package/dist/components/controls/TagsInput/tagsinput.d.ts +3 -0
- package/dist/components/controls/ToggleButtons/togglebuttons.d.ts +3 -0
- package/dist/components/controls/index.d.ts +50 -0
- package/dist/date-utils-CFUUt6NL.js +4 -0
- package/dist/date-utils-pGzaKb0p.mjs +477 -0
- package/dist/dynamic-mui.cjs.js +469 -1
- package/dist/dynamic-mui.es.js +102548 -7
- package/dist/index-BW8_rRff.js +7 -0
- package/dist/index-BXFVK_GX.js +1 -0
- package/dist/index-CVqLvm8B.js +1 -0
- package/dist/index-Cr6Wp_S-.mjs +3141 -0
- package/dist/{index-BGfWFaIb.mjs → index-DA0XouZs.mjs} +16 -16
- package/dist/index-DKS5Sz9e.js +14 -0
- package/dist/index-DcWfyXJp.mjs +92 -0
- package/dist/index-MllWgTJ5.mjs +9372 -0
- package/dist/index.browser-BSu11T_q.mjs +363 -0
- package/dist/index.browser-By7-GABP.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/loadCognitoIdentity-DtYTy-DW.js +1 -0
- package/dist/loadCognitoIdentity-DzdR91GB.mjs +872 -0
- package/dist/loadSts-Cic6UToN.mjs +593 -0
- package/dist/loadSts-csbFP6zX.js +1 -0
- package/dist/noAuth-B8ui2kBg.mjs +71 -0
- package/dist/noAuth-JPA2o4dt.js +1 -0
- package/dist/playground/AIContext.d.ts +18 -0
- package/dist/playground/AIPanel.d.ts +10 -0
- package/dist/types.d.ts +81 -10
- package/dist/util/helper.d.ts +2 -30
- package/dist/util/premiumStyles.d.ts +27 -0
- package/dist/util/rules.d.ts +35 -0
- package/package.json +2 -2
- package/dist/index-BHROoqH4.js +0 -1
- package/dist/index-S6BQaF_5.js +0 -465
- package/dist/index-Wtsz8Yiv.mjs +0 -102315
- package/dist/loadCognitoIdentity-CiUaDv6q.mjs +0 -935
- package/dist/loadCognitoIdentity-DN_MCNUl.js +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ControlProps } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Read-only review panel that lists the current form's values as
|
|
4
|
+
* label -> value rows. Reads live values from the shared FormGenerator store
|
|
5
|
+
* via `guid`, or from an explicit `data` object (which takes precedence).
|
|
6
|
+
*/
|
|
7
|
+
export default function SummaryField({ attributes }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,6 +15,31 @@ import { default as Pie } from '../charts/Pie/pie';
|
|
|
15
15
|
import { default as MixChart } from '../charts/Mixchart/mixChart';
|
|
16
16
|
import { default as Divider } from './Divider/divider';
|
|
17
17
|
import { default as Chip } from './Chip/chip';
|
|
18
|
+
import { default as ChipSelect } from './ChipSelect/chipselect';
|
|
19
|
+
import { default as Button } from './Button/button';
|
|
20
|
+
import { default as DateRangePicker } from './DateRangePicker/daterangepicker';
|
|
21
|
+
import { default as Rating } from './Rating/rating';
|
|
22
|
+
import { default as Slider } from './Slider/slider';
|
|
23
|
+
import { default as TagsInput } from './TagsInput/tagsinput';
|
|
24
|
+
import { default as ToggleButtons } from './ToggleButtons/togglebuttons';
|
|
25
|
+
import { default as PasswordField } from './PasswordField/passwordfield';
|
|
26
|
+
import { default as OtpField } from './OtpField/otpfield';
|
|
27
|
+
import { default as PhoneField } from './PhoneField/phonefield';
|
|
28
|
+
import { default as CurrencyField } from './CurrencyField/currencyfield';
|
|
29
|
+
import { default as FileUpload } from './FileUpload/fileupload';
|
|
30
|
+
import { default as Alert } from './Alert/alert';
|
|
31
|
+
import { default as Computed } from './Computed/computed';
|
|
32
|
+
import { default as KeyValueField } from './KeyValueField/keyvaluefield';
|
|
33
|
+
import { default as NumberStepper } from './NumberStepper/numberstepper';
|
|
34
|
+
import { default as MatrixField } from './MatrixField/matrixfield';
|
|
35
|
+
import { default as ConsentField } from './ConsentField/consentfield';
|
|
36
|
+
import { default as ColorPicker } from './ColorPicker/colorpicker';
|
|
37
|
+
import { default as MarkdownEditor } from './MarkdownEditor/markdowneditor';
|
|
38
|
+
import { default as AddressField } from './AddressField/addressfield';
|
|
39
|
+
import { default as CascadeSelect } from './CascadeSelect/cascadeselect';
|
|
40
|
+
import { default as FormWizard } from './FormWizard/formwizard';
|
|
41
|
+
import { default as SummaryField } from './SummaryField/summaryfield';
|
|
42
|
+
import { default as GeoField } from './GeoField/geofield';
|
|
18
43
|
import { default as List } from './List/list';
|
|
19
44
|
import { default as NumberField } from './NumberField/numberfield';
|
|
20
45
|
import { default as MultiTextbox } from './MultiTextbox/multitextbox';
|
|
@@ -46,6 +71,31 @@ declare const Controls: {
|
|
|
46
71
|
MixChart: typeof MixChart;
|
|
47
72
|
Divider: typeof Divider;
|
|
48
73
|
Chip: typeof Chip;
|
|
74
|
+
ChipSelect: typeof ChipSelect;
|
|
75
|
+
Button: typeof Button;
|
|
76
|
+
DateRangePicker: typeof DateRangePicker;
|
|
77
|
+
Rating: typeof Rating;
|
|
78
|
+
Slider: typeof Slider;
|
|
79
|
+
TagsInput: typeof TagsInput;
|
|
80
|
+
ToggleButtons: typeof ToggleButtons;
|
|
81
|
+
PasswordField: typeof PasswordField;
|
|
82
|
+
OtpField: typeof OtpField;
|
|
83
|
+
PhoneField: typeof PhoneField;
|
|
84
|
+
CurrencyField: typeof CurrencyField;
|
|
85
|
+
FileUpload: typeof FileUpload;
|
|
86
|
+
Alert: typeof Alert;
|
|
87
|
+
Computed: typeof Computed;
|
|
88
|
+
KeyValueField: typeof KeyValueField;
|
|
89
|
+
NumberStepper: typeof NumberStepper;
|
|
90
|
+
MatrixField: typeof MatrixField;
|
|
91
|
+
ConsentField: typeof ConsentField;
|
|
92
|
+
ColorPicker: typeof ColorPicker;
|
|
93
|
+
MarkdownEditor: typeof MarkdownEditor;
|
|
94
|
+
AddressField: typeof AddressField;
|
|
95
|
+
CascadeSelect: typeof CascadeSelect;
|
|
96
|
+
FormWizard: typeof FormWizard;
|
|
97
|
+
SummaryField: typeof SummaryField;
|
|
98
|
+
GeoField: typeof GeoField;
|
|
49
99
|
List: typeof List;
|
|
50
100
|
NumberField: typeof NumberField;
|
|
51
101
|
MultiTextbox: typeof MultiTextbox;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";class C{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){const r=new C({...t,headers:{...t.headers}});return r.query&&(r.query=re(r.query)),r}static isInstance(t){if(!t)return!1;const r=t;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return C.clone(this)}}function re(e){return Object.keys(e).reduce((t,r)=>{const n=e[r];return{...t,[r]:Array.isArray(n)?[...n]:n}},{})}class D{statusCode;reason;headers;body;constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;const r=t;return typeof r.statusCode=="number"&&typeof r.headers=="object"}}const ne=e=>{if(typeof e=="function")return e;const t=Promise.resolve(e);return()=>t},G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",P=Object.entries(G).reduce((e,[t,r])=>(e[r]=Number(t),e),{}),oe=G.split(""),g=6,E=8,se=63,V=e=>{let t=e.length/4*3;e.slice(-2)==="=="?t-=2:e.slice(-1)==="="&&t--;const r=new ArrayBuffer(t),n=new DataView(r);for(let o=0;o<e.length;o+=4){let s=0,c=0;for(let i=o,d=o+3;i<=d;i++)if(e[i]!=="="){if(!(e[i]in P))throw new TypeError(`Invalid character ${e[i]} in base64 string.`);s|=P[e[i]]<<(d-i)*g,c+=g}else s>>=g;const a=o/4*3;s>>=c%E;const f=Math.floor(c/E);for(let i=0;i<f;i++){const d=(f-i-1)*E;n.setUint8(a+i,(s&255<<d)>>d)}}return new Uint8Array(r)},z=e=>new TextEncoder().encode(e),X=e=>{if(typeof e=="string")return e;if(typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(e)};function Z(e){let t;typeof e=="string"?t=z(e):t=e;const r=typeof t=="object"&&typeof t.length=="number",n=typeof t=="object"&&typeof t.byteOffset=="number"&&typeof t.byteLength=="number";if(!r&&!n)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let o="";for(let s=0;s<t.length;s+=3){let c=0,a=0;for(let i=s,d=Math.min(s+3,t.length);i<d;i++)c|=t[i]<<(d-i-1)*E,a+=E;const f=Math.ceil(a/g);c<<=f*g-a;for(let i=1;i<=f;i++){const d=(f-i)*g;o+=oe[(c&se<<d)>>d]}o+="==".slice(0,4-f)}return o}const N=e=>typeof ReadableStream=="function"&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream),A=e=>encodeURIComponent(e).replace(/[!'()*]/g,ie),ie=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function ce(e){const t=[];for(let r of Object.keys(e).sort()){const n=e[r];if(r=A(r),Array.isArray(n))for(let o=0,s=n.length;o<s;o++)t.push(`${r}=${A(n[o])}`);else{let o=r;(n||typeof n=="string")&&(o+=`=${A(n)}`),t.push(o)}}return t.join("&")}function k(e,t){return new Request(e,t)}function ae(e=0){return new Promise((t,r)=>{e&&setTimeout(()=>{const n=new Error(`Request did not complete within ${e} ms`);n.name="TimeoutError",r(n)},e)})}const I={supported:void 0};class O{config;configProvider;static create(t){return typeof t?.handle=="function"?t:new O(t)}constructor(t){typeof t=="function"?this.configProvider=t().then(r=>r||{}):(this.config=t??{},this.configProvider=Promise.resolve(this.config)),I.supported===void 0&&(I.supported=typeof Request<"u"&&"keepalive"in k("https://[::1]"))}destroy(){}async handle(t,{abortSignal:r,requestTimeout:n}={}){this.config||(this.config=await this.configProvider);const o=n??this.config.requestTimeout,s=this.config.keepAlive===!0,c=this.config.credentials;if(r?.aborted){const u=new Error("Request aborted");return u.name="AbortError",Promise.reject(u)}let a=t.path;const f=ce(t.query||{});f&&(a+=`?${f}`),t.fragment&&(a+=`#${t.fragment}`);let i="";if(t.username!=null||t.password!=null){const u=t.username??"",T=t.password??"";i=`${u}:${T}@`}const{port:d,method:y}=t,w=`${t.protocol}//${i}${t.hostname}${d?`:${d}`:""}${a}`,x=y==="GET"||y==="HEAD"?void 0:t.body,h={body:x,headers:new Headers(t.headers),method:y,credentials:c};this.config?.cache&&(h.cache=this.config.cache),x&&(h.duplex="half"),typeof AbortController<"u"&&(h.signal=r),I.supported&&(h.keepalive=s),typeof this.config.requestInit=="function"&&Object.assign(h,this.config.requestInit(t));let L=()=>{};const te=k(w,h),_=[fetch(te).then(u=>{const T=u.headers,m={};for(const R of T.entries())m[R[0]]=R[1];return u.body!=null?{response:new D({headers:m,reason:u.statusText,statusCode:u.status,body:u.body})}:u.blob().then(R=>({response:new D({headers:m,reason:u.statusText,statusCode:u.status,body:R})}))}),ae(o)];return r&&_.push(new Promise((u,T)=>{const m=()=>{const p=new Error("Request aborted");p.name="AbortError",T(p)};if(typeof r.addEventListener=="function"){const p=r;p.addEventListener("abort",m,{once:!0}),L=()=>p.removeEventListener("abort",m)}else r.onabort=m})),Promise.race(_).finally(L)}updateHttpClientConfig(t,r){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[t]=r,n))}httpHandlerConfigs(){return this.config??{}}}const Q=async e=>typeof Blob=="function"&&e instanceof Blob||e.constructor?.name==="Blob"?Blob.prototype.arrayBuffer!==void 0?new Uint8Array(await e.arrayBuffer()):fe(e):de(e);async function fe(e){const t=await ue(e),r=V(t);return new Uint8Array(r)}async function de(e){const t=[],r=e.getReader();let n=!1,o=0;for(;!n;){const{done:a,value:f}=await r.read();f&&(t.push(f),o+=f.length),n=a}const s=new Uint8Array(o);let c=0;for(const a of t)s.set(a,c),c+=a.length;return s}function ue(e){return new Promise((t,r)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));const o=n.result??"",s=o.indexOf(","),c=s>-1?s+1:o.length;t(o.substring(c))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(e)})}const K={},B={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),K[e]=t,B[t]=e}function he(e){if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2){const n=e.slice(r,r+2).toLowerCase();if(n in B)t[r/2]=B[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return t}function v(e){let t="";for(let r=0;r<e.byteLength;r++)t+=K[e[r]];return t}const j="The stream has already been transformed.",le=e=>{if(!J(e)&&!N(e)){const o=e?.__proto__?.constructor?.name||e;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${o}`)}let t=!1;const r=async()=>{if(t)throw new Error(j);return t=!0,await Q(e)},n=o=>{if(typeof o.stream!="function")throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
|
|
2
|
+
If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return o.stream()};return Object.assign(e,{transformToByteArray:r,transformToString:async o=>{const s=await r();if(o==="base64")return Z(s);if(o==="hex")return v(s);if(o===void 0||o==="utf8"||o==="utf-8")return X(s);if(typeof TextDecoder=="function")return new TextDecoder(o).decode(s);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw new Error(j);if(t=!0,J(e))return n(e);if(N(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},J=e=>typeof Blob=="function"&&e instanceof Blob,F=e=>{if(e!=null){if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&Se.warn(Ee(`Expected number but observed string: ${e}`)),t}if(typeof e=="number")return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},ye=Math.ceil(2**127*(2-2**-23)),W=e=>{const t=F(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>ye)throw new TypeError(`Expected 32-bit float, got ${e}`);return t},me=e=>{if(e!=null){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}},Y=e=>ee(e,16),q=e=>ee(e,8),ee=(e,t)=>{const r=me(e);if(r!==void 0&&pe(r,t)!==r)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return r},pe=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},ge=e=>F(typeof e=="string"?M(e):e),be=e=>W(typeof e=="string"?M(e):e),we=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,M=e=>{const t=e.match(we);if(t===null||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},$=e=>Y(typeof e=="string"?M(e):e),Te=e=>q(typeof e=="string"?M(e):e),Ee=e=>String(new TypeError(e).stack||e).split(`
|
|
3
|
+
`).slice(0,5).filter(t=>!t.includes("stackTraceWarning")).join(`
|
|
4
|
+
`),Se={warn:console.warn},$e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],H=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function xe(e){const t=e.getUTCFullYear(),r=e.getUTCMonth(),n=e.getUTCDay(),o=e.getUTCDate(),s=e.getUTCHours(),c=e.getUTCMinutes(),a=e.getUTCSeconds(),f=o<10?`0${o}`:`${o}`,i=s<10?`0${s}`:`${s}`,d=c<10?`0${c}`:`${c}`,y=a<10?`0${a}`:`${a}`;return`${$e[n]}, ${f} ${H[r]} ${t} ${i}:${d}:${y} GMT`}const Re=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Ae=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=Re.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,o,s,c,a,f,i]=t,d=$(b(n)),y=l(o,"month",1,12),w=l(s,"day",1,31);return S(d,y,w,{hours:c,minutes:a,seconds:f,fractionalMilliseconds:i})},Ce=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Me=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=Ce.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,o,s,c,a,f,i,d]=t,y=$(b(n)),w=l(o,"month",1,12),x=l(s,"day",1,31),h=S(y,w,x,{hours:c,minutes:a,seconds:f,fractionalMilliseconds:i});return d.toUpperCase()!="Z"&&h.setTime(h.getTime()-je(d)),h},Ie=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Ue=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),De=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),Ne=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=Ie.exec(e);if(t){const[r,n,o,s,c,a,f,i]=t;return S($(b(s)),U(o),l(n,"day",1,31),{hours:c,minutes:a,seconds:f,fractionalMilliseconds:i})}if(t=Ue.exec(e),t){const[r,n,o,s,c,a,f,i]=t;return He(S(Fe(s),U(o),l(n,"day",1,31),{hours:c,minutes:a,seconds:f,fractionalMilliseconds:i}))}if(t=De.exec(e),t){const[r,n,o,s,c,a,f,i]=t;return S($(b(i)),U(n),l(o.trimLeft(),"day",1,31),{hours:s,minutes:c,seconds:a,fractionalMilliseconds:f})}throw new TypeError("Invalid RFC-7231 date-time value")},Be=e=>{if(e==null)return;let t;if(typeof e=="number")t=e;else if(typeof e=="string")t=ge(e);else if(typeof e=="object"&&e.tag===1)t=e.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(t)||t===1/0||t===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(t*1e3))},S=(e,t,r,n)=>{const o=t-1;return _e(e,o,r),new Date(Date.UTC(e,o,r,l(n.hours,"hour",0,23),l(n.minutes,"minute",0,59),l(n.seconds,"seconds",0,60),ke(n.fractionalMilliseconds)))},Fe=e=>{const t=new Date().getUTCFullYear(),r=Math.floor(t/100)*100+$(b(e));return r<t?r+100:r},Oe=50*365*24*60*60*1e3,He=e=>e.getTime()-new Date().getTime()>Oe?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,U=e=>{const t=H.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},Le=[31,28,31,30,31,30,31,31,30,31,30,31],_e=(e,t,r)=>{let n=Le[t];if(t===1&&Pe(e)&&(n=29),r>n)throw new TypeError(`Invalid day for ${H[t]} in ${e}: ${r}`)},Pe=e=>e%4===0&&(e%100!==0||e%400===0),l=(e,t,r,n)=>{const o=Te(b(e));if(o<r||o>n)throw new TypeError(`${t} must be between ${r} and ${n}, inclusive`);return o},ke=e=>e==null?0:be("0."+e)*1e3,je=e=>{const t=e[0];let r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);const n=Number(e.substring(1,3)),o=Number(e.substring(4,6));return r*(n*60+o)*60*1e3},b=e=>{let t=0;for(;t<e.length-1&&e.charAt(t)==="0";)t++;return t===0?e:e.slice(t)};exports.FetchHttpHandler=O;exports.HttpRequest=C;exports.HttpResponse=D;exports.dateToUtcString=xe;exports.escapeUri=A;exports.fromBase64=V;exports.fromHex=he;exports.fromUtf8=z;exports.isReadableStream=N;exports.normalizeProvider=ne;exports.parseEpochTimestamp=Be;exports.parseRfc3339DateTime=Ae;exports.parseRfc3339DateTimeWithOffset=Me;exports.parseRfc7231DateTime=Ne;exports.sdkStreamMixin=le;exports.streamCollector=Q;exports.toBase64=Z;exports.toHex=v;exports.toUtf8=X;
|
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
class D {
|
|
2
|
+
method;
|
|
3
|
+
protocol;
|
|
4
|
+
hostname;
|
|
5
|
+
port;
|
|
6
|
+
path;
|
|
7
|
+
query;
|
|
8
|
+
headers;
|
|
9
|
+
username;
|
|
10
|
+
password;
|
|
11
|
+
fragment;
|
|
12
|
+
body;
|
|
13
|
+
constructor(t) {
|
|
14
|
+
this.method = t.method || "GET", this.hostname = t.hostname || "localhost", this.port = t.port, this.query = t.query || {}, this.headers = t.headers || {}, this.body = t.body, this.protocol = t.protocol ? t.protocol.slice(-1) !== ":" ? `${t.protocol}:` : t.protocol : "https:", this.path = t.path ? t.path.charAt(0) !== "/" ? `/${t.path}` : t.path : "/", this.username = t.username, this.password = t.password, this.fragment = t.fragment;
|
|
15
|
+
}
|
|
16
|
+
static clone(t) {
|
|
17
|
+
const r = new D({
|
|
18
|
+
...t,
|
|
19
|
+
headers: { ...t.headers }
|
|
20
|
+
});
|
|
21
|
+
return r.query && (r.query = Z(r.query)), r;
|
|
22
|
+
}
|
|
23
|
+
static isInstance(t) {
|
|
24
|
+
if (!t)
|
|
25
|
+
return !1;
|
|
26
|
+
const r = t;
|
|
27
|
+
return "method" in r && "protocol" in r && "hostname" in r && "path" in r && typeof r.query == "object" && typeof r.headers == "object";
|
|
28
|
+
}
|
|
29
|
+
clone() {
|
|
30
|
+
return D.clone(this);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function Z(e) {
|
|
34
|
+
return Object.keys(e).reduce((t, r) => {
|
|
35
|
+
const n = e[r];
|
|
36
|
+
return {
|
|
37
|
+
...t,
|
|
38
|
+
[r]: Array.isArray(n) ? [...n] : n
|
|
39
|
+
};
|
|
40
|
+
}, {});
|
|
41
|
+
}
|
|
42
|
+
class L {
|
|
43
|
+
statusCode;
|
|
44
|
+
reason;
|
|
45
|
+
headers;
|
|
46
|
+
body;
|
|
47
|
+
constructor(t) {
|
|
48
|
+
this.statusCode = t.statusCode, this.reason = t.reason, this.headers = t.headers || {}, this.body = t.body;
|
|
49
|
+
}
|
|
50
|
+
static isInstance(t) {
|
|
51
|
+
if (!t)
|
|
52
|
+
return !1;
|
|
53
|
+
const r = t;
|
|
54
|
+
return typeof r.statusCode == "number" && typeof r.headers == "object";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const Be = (e) => {
|
|
58
|
+
if (typeof e == "function")
|
|
59
|
+
return e;
|
|
60
|
+
const t = Promise.resolve(e);
|
|
61
|
+
return () => t;
|
|
62
|
+
}, q = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", _ = Object.entries(q).reduce((e, [t, r]) => (e[r] = Number(t), e), {}), Q = q.split(""), g = 6, E = 8, K = 63, v = (e) => {
|
|
63
|
+
let t = e.length / 4 * 3;
|
|
64
|
+
e.slice(-2) === "==" ? t -= 2 : e.slice(-1) === "=" && t--;
|
|
65
|
+
const r = new ArrayBuffer(t), n = new DataView(r);
|
|
66
|
+
for (let o = 0; o < e.length; o += 4) {
|
|
67
|
+
let s = 0, a = 0;
|
|
68
|
+
for (let i = o, d = o + 3; i <= d; i++)
|
|
69
|
+
if (e[i] !== "=") {
|
|
70
|
+
if (!(e[i] in _))
|
|
71
|
+
throw new TypeError(`Invalid character ${e[i]} in base64 string.`);
|
|
72
|
+
s |= _[e[i]] << (d - i) * g, a += g;
|
|
73
|
+
} else
|
|
74
|
+
s >>= g;
|
|
75
|
+
const c = o / 4 * 3;
|
|
76
|
+
s >>= a % E;
|
|
77
|
+
const f = Math.floor(a / E);
|
|
78
|
+
for (let i = 0; i < f; i++) {
|
|
79
|
+
const d = (f - i - 1) * E;
|
|
80
|
+
n.setUint8(c + i, (s & 255 << d) >> d);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return new Uint8Array(r);
|
|
84
|
+
}, ee = (e) => new TextEncoder().encode(e), te = (e) => {
|
|
85
|
+
if (typeof e == "string")
|
|
86
|
+
return e;
|
|
87
|
+
if (typeof e != "object" || typeof e.byteOffset != "number" || typeof e.byteLength != "number")
|
|
88
|
+
throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");
|
|
89
|
+
return new TextDecoder("utf-8").decode(e);
|
|
90
|
+
};
|
|
91
|
+
function re(e) {
|
|
92
|
+
let t;
|
|
93
|
+
typeof e == "string" ? t = ee(e) : t = e;
|
|
94
|
+
const r = typeof t == "object" && typeof t.length == "number", n = typeof t == "object" && typeof t.byteOffset == "number" && typeof t.byteLength == "number";
|
|
95
|
+
if (!r && !n)
|
|
96
|
+
throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");
|
|
97
|
+
let o = "";
|
|
98
|
+
for (let s = 0; s < t.length; s += 3) {
|
|
99
|
+
let a = 0, c = 0;
|
|
100
|
+
for (let i = s, d = Math.min(s + 3, t.length); i < d; i++)
|
|
101
|
+
a |= t[i] << (d - i - 1) * E, c += E;
|
|
102
|
+
const f = Math.ceil(c / g);
|
|
103
|
+
a <<= f * g - c;
|
|
104
|
+
for (let i = 1; i <= f; i++) {
|
|
105
|
+
const d = (f - i) * g;
|
|
106
|
+
o += Q[(a & K << d) >> d];
|
|
107
|
+
}
|
|
108
|
+
o += "==".slice(0, 4 - f);
|
|
109
|
+
}
|
|
110
|
+
return o;
|
|
111
|
+
}
|
|
112
|
+
const P = (e) => typeof ReadableStream == "function" && (e?.constructor?.name === ReadableStream.name || e instanceof ReadableStream), M = (e) => encodeURIComponent(e).replace(/[!'()*]/g, ne), ne = (e) => `%${e.charCodeAt(0).toString(16).toUpperCase()}`;
|
|
113
|
+
function oe(e) {
|
|
114
|
+
const t = [];
|
|
115
|
+
for (let r of Object.keys(e).sort()) {
|
|
116
|
+
const n = e[r];
|
|
117
|
+
if (r = M(r), Array.isArray(n))
|
|
118
|
+
for (let o = 0, s = n.length; o < s; o++)
|
|
119
|
+
t.push(`${r}=${M(n[o])}`);
|
|
120
|
+
else {
|
|
121
|
+
let o = r;
|
|
122
|
+
(n || typeof n == "string") && (o += `=${M(n)}`), t.push(o);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return t.join("&");
|
|
126
|
+
}
|
|
127
|
+
function k(e, t) {
|
|
128
|
+
return new Request(e, t);
|
|
129
|
+
}
|
|
130
|
+
function se(e = 0) {
|
|
131
|
+
return new Promise((t, r) => {
|
|
132
|
+
e && setTimeout(() => {
|
|
133
|
+
const n = new Error(`Request did not complete within ${e} ms`);
|
|
134
|
+
n.name = "TimeoutError", r(n);
|
|
135
|
+
}, e);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
const R = {
|
|
139
|
+
supported: void 0
|
|
140
|
+
};
|
|
141
|
+
class G {
|
|
142
|
+
config;
|
|
143
|
+
configProvider;
|
|
144
|
+
static create(t) {
|
|
145
|
+
return typeof t?.handle == "function" ? t : new G(t);
|
|
146
|
+
}
|
|
147
|
+
constructor(t) {
|
|
148
|
+
typeof t == "function" ? this.configProvider = t().then((r) => r || {}) : (this.config = t ?? {}, this.configProvider = Promise.resolve(this.config)), R.supported === void 0 && (R.supported = typeof Request < "u" && "keepalive" in k("https://[::1]"));
|
|
149
|
+
}
|
|
150
|
+
destroy() {
|
|
151
|
+
}
|
|
152
|
+
async handle(t, { abortSignal: r, requestTimeout: n } = {}) {
|
|
153
|
+
this.config || (this.config = await this.configProvider);
|
|
154
|
+
const o = n ?? this.config.requestTimeout, s = this.config.keepAlive === !0, a = this.config.credentials;
|
|
155
|
+
if (r?.aborted) {
|
|
156
|
+
const u = new Error("Request aborted");
|
|
157
|
+
return u.name = "AbortError", Promise.reject(u);
|
|
158
|
+
}
|
|
159
|
+
let c = t.path;
|
|
160
|
+
const f = oe(t.query || {});
|
|
161
|
+
f && (c += `?${f}`), t.fragment && (c += `#${t.fragment}`);
|
|
162
|
+
let i = "";
|
|
163
|
+
if (t.username != null || t.password != null) {
|
|
164
|
+
const u = t.username ?? "", T = t.password ?? "";
|
|
165
|
+
i = `${u}:${T}@`;
|
|
166
|
+
}
|
|
167
|
+
const { port: d, method: y } = t, w = `${t.protocol}//${i}${t.hostname}${d ? `:${d}` : ""}${c}`, x = y === "GET" || y === "HEAD" ? void 0 : t.body, h = {
|
|
168
|
+
body: x,
|
|
169
|
+
headers: new Headers(t.headers),
|
|
170
|
+
method: y,
|
|
171
|
+
credentials: a
|
|
172
|
+
};
|
|
173
|
+
this.config?.cache && (h.cache = this.config.cache), x && (h.duplex = "half"), typeof AbortController < "u" && (h.signal = r), R.supported && (h.keepalive = s), typeof this.config.requestInit == "function" && Object.assign(h, this.config.requestInit(t));
|
|
174
|
+
let B = () => {
|
|
175
|
+
};
|
|
176
|
+
const z = k(w, h), O = [
|
|
177
|
+
fetch(z).then((u) => {
|
|
178
|
+
const T = u.headers, m = {};
|
|
179
|
+
for (const A of T.entries())
|
|
180
|
+
m[A[0]] = A[1];
|
|
181
|
+
return u.body != null ? {
|
|
182
|
+
response: new L({
|
|
183
|
+
headers: m,
|
|
184
|
+
reason: u.statusText,
|
|
185
|
+
statusCode: u.status,
|
|
186
|
+
body: u.body
|
|
187
|
+
})
|
|
188
|
+
} : u.blob().then((A) => ({
|
|
189
|
+
response: new L({
|
|
190
|
+
headers: m,
|
|
191
|
+
reason: u.statusText,
|
|
192
|
+
statusCode: u.status,
|
|
193
|
+
body: A
|
|
194
|
+
})
|
|
195
|
+
}));
|
|
196
|
+
}),
|
|
197
|
+
se(o)
|
|
198
|
+
];
|
|
199
|
+
return r && O.push(new Promise((u, T) => {
|
|
200
|
+
const m = () => {
|
|
201
|
+
const p = new Error("Request aborted");
|
|
202
|
+
p.name = "AbortError", T(p);
|
|
203
|
+
};
|
|
204
|
+
if (typeof r.addEventListener == "function") {
|
|
205
|
+
const p = r;
|
|
206
|
+
p.addEventListener("abort", m, { once: !0 }), B = () => p.removeEventListener("abort", m);
|
|
207
|
+
} else
|
|
208
|
+
r.onabort = m;
|
|
209
|
+
})), Promise.race(O).finally(B);
|
|
210
|
+
}
|
|
211
|
+
updateHttpClientConfig(t, r) {
|
|
212
|
+
this.config = void 0, this.configProvider = this.configProvider.then((n) => (n[t] = r, n));
|
|
213
|
+
}
|
|
214
|
+
httpHandlerConfigs() {
|
|
215
|
+
return this.config ?? {};
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
const ie = async (e) => typeof Blob == "function" && e instanceof Blob || e.constructor?.name === "Blob" ? Blob.prototype.arrayBuffer !== void 0 ? new Uint8Array(await e.arrayBuffer()) : ae(e) : ce(e);
|
|
219
|
+
async function ae(e) {
|
|
220
|
+
const t = await fe(e), r = v(t);
|
|
221
|
+
return new Uint8Array(r);
|
|
222
|
+
}
|
|
223
|
+
async function ce(e) {
|
|
224
|
+
const t = [], r = e.getReader();
|
|
225
|
+
let n = !1, o = 0;
|
|
226
|
+
for (; !n; ) {
|
|
227
|
+
const { done: c, value: f } = await r.read();
|
|
228
|
+
f && (t.push(f), o += f.length), n = c;
|
|
229
|
+
}
|
|
230
|
+
const s = new Uint8Array(o);
|
|
231
|
+
let a = 0;
|
|
232
|
+
for (const c of t)
|
|
233
|
+
s.set(c, a), a += c.length;
|
|
234
|
+
return s;
|
|
235
|
+
}
|
|
236
|
+
function fe(e) {
|
|
237
|
+
return new Promise((t, r) => {
|
|
238
|
+
const n = new FileReader();
|
|
239
|
+
n.onloadend = () => {
|
|
240
|
+
if (n.readyState !== 2)
|
|
241
|
+
return r(new Error("Reader aborted too early"));
|
|
242
|
+
const o = n.result ?? "", s = o.indexOf(","), a = s > -1 ? s + 1 : o.length;
|
|
243
|
+
t(o.substring(a));
|
|
244
|
+
}, n.onabort = () => r(new Error("Read aborted")), n.onerror = () => r(n.error), n.readAsDataURL(e);
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
const V = {}, U = {};
|
|
248
|
+
for (let e = 0; e < 256; e++) {
|
|
249
|
+
let t = e.toString(16).toLowerCase();
|
|
250
|
+
t.length === 1 && (t = `0${t}`), V[e] = t, U[t] = e;
|
|
251
|
+
}
|
|
252
|
+
function Oe(e) {
|
|
253
|
+
if (e.length % 2 !== 0)
|
|
254
|
+
throw new Error("Hex encoded strings must have an even number length");
|
|
255
|
+
const t = new Uint8Array(e.length / 2);
|
|
256
|
+
for (let r = 0; r < e.length; r += 2) {
|
|
257
|
+
const n = e.slice(r, r + 2).toLowerCase();
|
|
258
|
+
if (n in U)
|
|
259
|
+
t[r / 2] = U[n];
|
|
260
|
+
else
|
|
261
|
+
throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`);
|
|
262
|
+
}
|
|
263
|
+
return t;
|
|
264
|
+
}
|
|
265
|
+
function de(e) {
|
|
266
|
+
let t = "";
|
|
267
|
+
for (let r = 0; r < e.byteLength; r++)
|
|
268
|
+
t += V[e[r]];
|
|
269
|
+
return t;
|
|
270
|
+
}
|
|
271
|
+
const H = "The stream has already been transformed.", Le = (e) => {
|
|
272
|
+
if (!j(e) && !P(e)) {
|
|
273
|
+
const o = e?.__proto__?.constructor?.name || e;
|
|
274
|
+
throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${o}`);
|
|
275
|
+
}
|
|
276
|
+
let t = !1;
|
|
277
|
+
const r = async () => {
|
|
278
|
+
if (t)
|
|
279
|
+
throw new Error(H);
|
|
280
|
+
return t = !0, await ie(e);
|
|
281
|
+
}, n = (o) => {
|
|
282
|
+
if (typeof o.stream != "function")
|
|
283
|
+
throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
|
|
284
|
+
If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);
|
|
285
|
+
return o.stream();
|
|
286
|
+
};
|
|
287
|
+
return Object.assign(e, {
|
|
288
|
+
transformToByteArray: r,
|
|
289
|
+
transformToString: async (o) => {
|
|
290
|
+
const s = await r();
|
|
291
|
+
if (o === "base64")
|
|
292
|
+
return re(s);
|
|
293
|
+
if (o === "hex")
|
|
294
|
+
return de(s);
|
|
295
|
+
if (o === void 0 || o === "utf8" || o === "utf-8")
|
|
296
|
+
return te(s);
|
|
297
|
+
if (typeof TextDecoder == "function")
|
|
298
|
+
return new TextDecoder(o).decode(s);
|
|
299
|
+
throw new Error("TextDecoder is not available, please make sure polyfill is provided.");
|
|
300
|
+
},
|
|
301
|
+
transformToWebStream: () => {
|
|
302
|
+
if (t)
|
|
303
|
+
throw new Error(H);
|
|
304
|
+
if (t = !0, j(e))
|
|
305
|
+
return n(e);
|
|
306
|
+
if (P(e))
|
|
307
|
+
return e;
|
|
308
|
+
throw new Error(`Cannot transform payload to web stream, got ${e}`);
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
}, j = (e) => typeof Blob == "function" && e instanceof Blob, N = (e) => {
|
|
312
|
+
if (e != null) {
|
|
313
|
+
if (typeof e == "string") {
|
|
314
|
+
const t = parseFloat(e);
|
|
315
|
+
if (!Number.isNaN(t))
|
|
316
|
+
return String(t) !== String(e) && we.warn(be(`Expected number but observed string: ${e}`)), t;
|
|
317
|
+
}
|
|
318
|
+
if (typeof e == "number")
|
|
319
|
+
return e;
|
|
320
|
+
throw new TypeError(`Expected number, got ${typeof e}: ${e}`);
|
|
321
|
+
}
|
|
322
|
+
}, ue = Math.ceil(2 ** 127 * (2 - 2 ** -23)), J = (e) => {
|
|
323
|
+
const t = N(e);
|
|
324
|
+
if (t !== void 0 && !Number.isNaN(t) && t !== 1 / 0 && t !== -1 / 0 && Math.abs(t) > ue)
|
|
325
|
+
throw new TypeError(`Expected 32-bit float, got ${e}`);
|
|
326
|
+
return t;
|
|
327
|
+
}, he = (e) => {
|
|
328
|
+
if (e != null) {
|
|
329
|
+
if (Number.isInteger(e) && !Number.isNaN(e))
|
|
330
|
+
return e;
|
|
331
|
+
throw new TypeError(`Expected integer, got ${typeof e}: ${e}`);
|
|
332
|
+
}
|
|
333
|
+
}, W = (e) => X(e, 16), Y = (e) => X(e, 8), X = (e, t) => {
|
|
334
|
+
const r = he(e);
|
|
335
|
+
if (r !== void 0 && le(r, t) !== r)
|
|
336
|
+
throw new TypeError(`Expected ${t}-bit integer, got ${e}`);
|
|
337
|
+
return r;
|
|
338
|
+
}, le = (e, t) => {
|
|
339
|
+
switch (t) {
|
|
340
|
+
case 32:
|
|
341
|
+
return Int32Array.of(e)[0];
|
|
342
|
+
case 16:
|
|
343
|
+
return Int16Array.of(e)[0];
|
|
344
|
+
case 8:
|
|
345
|
+
return Int8Array.of(e)[0];
|
|
346
|
+
}
|
|
347
|
+
}, ye = (e) => N(typeof e == "string" ? C(e) : e), me = (e) => J(typeof e == "string" ? C(e) : e), pe = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g, C = (e) => {
|
|
348
|
+
const t = e.match(pe);
|
|
349
|
+
if (t === null || t[0].length !== e.length)
|
|
350
|
+
throw new TypeError("Expected real number, got implicit NaN");
|
|
351
|
+
return parseFloat(e);
|
|
352
|
+
}, $ = (e) => W(typeof e == "string" ? C(e) : e), ge = (e) => Y(typeof e == "string" ? C(e) : e), be = (e) => String(new TypeError(e).stack || e).split(`
|
|
353
|
+
`).slice(0, 5).filter((t) => !t.includes("stackTraceWarning")).join(`
|
|
354
|
+
`), we = {
|
|
355
|
+
warn: console.warn
|
|
356
|
+
}, Te = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], F = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
357
|
+
function _e(e) {
|
|
358
|
+
const t = e.getUTCFullYear(), r = e.getUTCMonth(), n = e.getUTCDay(), o = e.getUTCDate(), s = e.getUTCHours(), a = e.getUTCMinutes(), c = e.getUTCSeconds(), f = o < 10 ? `0${o}` : `${o}`, i = s < 10 ? `0${s}` : `${s}`, d = a < 10 ? `0${a}` : `${a}`, y = c < 10 ? `0${c}` : `${c}`;
|
|
359
|
+
return `${Te[n]}, ${f} ${F[r]} ${t} ${i}:${d}:${y} GMT`;
|
|
360
|
+
}
|
|
361
|
+
const Ee = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/), Pe = (e) => {
|
|
362
|
+
if (e == null)
|
|
363
|
+
return;
|
|
364
|
+
if (typeof e != "string")
|
|
365
|
+
throw new TypeError("RFC-3339 date-times must be expressed as strings");
|
|
366
|
+
const t = Ee.exec(e);
|
|
367
|
+
if (!t)
|
|
368
|
+
throw new TypeError("Invalid RFC-3339 date-time value");
|
|
369
|
+
const [r, n, o, s, a, c, f, i] = t, d = $(b(n)), y = l(o, "month", 1, 12), w = l(s, "day", 1, 31);
|
|
370
|
+
return S(d, y, w, { hours: a, minutes: c, seconds: f, fractionalMilliseconds: i });
|
|
371
|
+
}, Se = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/), ke = (e) => {
|
|
372
|
+
if (e == null)
|
|
373
|
+
return;
|
|
374
|
+
if (typeof e != "string")
|
|
375
|
+
throw new TypeError("RFC-3339 date-times must be expressed as strings");
|
|
376
|
+
const t = Se.exec(e);
|
|
377
|
+
if (!t)
|
|
378
|
+
throw new TypeError("Invalid RFC-3339 date-time value");
|
|
379
|
+
const [r, n, o, s, a, c, f, i, d] = t, y = $(b(n)), w = l(o, "month", 1, 12), x = l(s, "day", 1, 31), h = S(y, w, x, { hours: a, minutes: c, seconds: f, fractionalMilliseconds: i });
|
|
380
|
+
return d.toUpperCase() != "Z" && h.setTime(h.getTime() - Fe(d)), h;
|
|
381
|
+
}, $e = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/), xe = new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/), Ae = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/), He = (e) => {
|
|
382
|
+
if (e == null)
|
|
383
|
+
return;
|
|
384
|
+
if (typeof e != "string")
|
|
385
|
+
throw new TypeError("RFC-7231 date-times must be expressed as strings");
|
|
386
|
+
let t = $e.exec(e);
|
|
387
|
+
if (t) {
|
|
388
|
+
const [r, n, o, s, a, c, f, i] = t;
|
|
389
|
+
return S($(b(s)), I(o), l(n, "day", 1, 31), { hours: a, minutes: c, seconds: f, fractionalMilliseconds: i });
|
|
390
|
+
}
|
|
391
|
+
if (t = xe.exec(e), t) {
|
|
392
|
+
const [r, n, o, s, a, c, f, i] = t;
|
|
393
|
+
return Re(S(Ce(s), I(o), l(n, "day", 1, 31), {
|
|
394
|
+
hours: a,
|
|
395
|
+
minutes: c,
|
|
396
|
+
seconds: f,
|
|
397
|
+
fractionalMilliseconds: i
|
|
398
|
+
}));
|
|
399
|
+
}
|
|
400
|
+
if (t = Ae.exec(e), t) {
|
|
401
|
+
const [r, n, o, s, a, c, f, i] = t;
|
|
402
|
+
return S($(b(i)), I(n), l(o.trimLeft(), "day", 1, 31), { hours: s, minutes: a, seconds: c, fractionalMilliseconds: f });
|
|
403
|
+
}
|
|
404
|
+
throw new TypeError("Invalid RFC-7231 date-time value");
|
|
405
|
+
}, je = (e) => {
|
|
406
|
+
if (e == null)
|
|
407
|
+
return;
|
|
408
|
+
let t;
|
|
409
|
+
if (typeof e == "number")
|
|
410
|
+
t = e;
|
|
411
|
+
else if (typeof e == "string")
|
|
412
|
+
t = ye(e);
|
|
413
|
+
else if (typeof e == "object" && e.tag === 1)
|
|
414
|
+
t = e.value;
|
|
415
|
+
else
|
|
416
|
+
throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");
|
|
417
|
+
if (Number.isNaN(t) || t === 1 / 0 || t === -1 / 0)
|
|
418
|
+
throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");
|
|
419
|
+
return new Date(Math.round(t * 1e3));
|
|
420
|
+
}, S = (e, t, r, n) => {
|
|
421
|
+
const o = t - 1;
|
|
422
|
+
return De(e, o, r), new Date(Date.UTC(e, o, r, l(n.hours, "hour", 0, 23), l(n.minutes, "minute", 0, 59), l(n.seconds, "seconds", 0, 60), Ne(n.fractionalMilliseconds)));
|
|
423
|
+
}, Ce = (e) => {
|
|
424
|
+
const t = (/* @__PURE__ */ new Date()).getUTCFullYear(), r = Math.floor(t / 100) * 100 + $(b(e));
|
|
425
|
+
return r < t ? r + 100 : r;
|
|
426
|
+
}, Me = 50 * 365 * 24 * 60 * 60 * 1e3, Re = (e) => e.getTime() - (/* @__PURE__ */ new Date()).getTime() > Me ? new Date(Date.UTC(e.getUTCFullYear() - 100, e.getUTCMonth(), e.getUTCDate(), e.getUTCHours(), e.getUTCMinutes(), e.getUTCSeconds(), e.getUTCMilliseconds())) : e, I = (e) => {
|
|
427
|
+
const t = F.indexOf(e);
|
|
428
|
+
if (t < 0)
|
|
429
|
+
throw new TypeError(`Invalid month: ${e}`);
|
|
430
|
+
return t + 1;
|
|
431
|
+
}, Ie = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], De = (e, t, r) => {
|
|
432
|
+
let n = Ie[t];
|
|
433
|
+
if (t === 1 && Ue(e) && (n = 29), r > n)
|
|
434
|
+
throw new TypeError(`Invalid day for ${F[t]} in ${e}: ${r}`);
|
|
435
|
+
}, Ue = (e) => e % 4 === 0 && (e % 100 !== 0 || e % 400 === 0), l = (e, t, r, n) => {
|
|
436
|
+
const o = ge(b(e));
|
|
437
|
+
if (o < r || o > n)
|
|
438
|
+
throw new TypeError(`${t} must be between ${r} and ${n}, inclusive`);
|
|
439
|
+
return o;
|
|
440
|
+
}, Ne = (e) => e == null ? 0 : me("0." + e) * 1e3, Fe = (e) => {
|
|
441
|
+
const t = e[0];
|
|
442
|
+
let r = 1;
|
|
443
|
+
if (t == "+")
|
|
444
|
+
r = 1;
|
|
445
|
+
else if (t == "-")
|
|
446
|
+
r = -1;
|
|
447
|
+
else
|
|
448
|
+
throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);
|
|
449
|
+
const n = Number(e.substring(1, 3)), o = Number(e.substring(4, 6));
|
|
450
|
+
return r * (n * 60 + o) * 60 * 1e3;
|
|
451
|
+
}, b = (e) => {
|
|
452
|
+
let t = 0;
|
|
453
|
+
for (; t < e.length - 1 && e.charAt(t) === "0"; )
|
|
454
|
+
t++;
|
|
455
|
+
return t === 0 ? e : e.slice(t);
|
|
456
|
+
};
|
|
457
|
+
export {
|
|
458
|
+
G as F,
|
|
459
|
+
D as H,
|
|
460
|
+
v as a,
|
|
461
|
+
je as b,
|
|
462
|
+
He as c,
|
|
463
|
+
ke as d,
|
|
464
|
+
re as e,
|
|
465
|
+
ee as f,
|
|
466
|
+
_e as g,
|
|
467
|
+
ie as h,
|
|
468
|
+
L as i,
|
|
469
|
+
de as j,
|
|
470
|
+
Oe as k,
|
|
471
|
+
M as l,
|
|
472
|
+
P as m,
|
|
473
|
+
Be as n,
|
|
474
|
+
Pe as p,
|
|
475
|
+
Le as s,
|
|
476
|
+
te as t
|
|
477
|
+
};
|