@stlite/desktop 0.81.6 → 0.83.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/bin/dump_artifacts.js +15 -15
- package/build/assets/ErrorOutline.esm-w3SotGgg.js +1 -0
- package/build/assets/{FileDownload.esm-Bpf_IJaz.js → FileDownload.esm-DNaG7mhy.js} +1 -1
- package/build/assets/{FileHelper-BEtUZCB8.js → FileHelper-DoUfoupm.js} +4 -4
- package/build/assets/{FormClearHelper--a7FEpt-.js → FormClearHelper-DI9KwuTl.js} +1 -1
- package/build/assets/{Hooks-2PqJRMDp.js → Hooks-BRr-mPDr.js} +1 -1
- package/build/assets/{InputInstructions-GAhfSEnF.js → InputInstructions-mpv25B9R.js} +1 -1
- package/build/assets/MaterialSymbols-Rounded.DsbC8sYI.woff2 +0 -0
- package/build/assets/{ProgressBar-Col3VLE4.js → ProgressBar-DalMRT-4.js} +2 -2
- package/build/assets/{RenderInPortalIfExists-qnP8SYNG.js → RenderInPortalIfExists-CfX3LXlx.js} +1 -1
- package/build/assets/Toolbar-1r13KE9d.js +1 -0
- package/build/assets/{base-input-BHEia47e.js → base-input-BJ4WO1K3.js} +4 -4
- package/build/assets/{checkbox-Cddx6i3F.js → checkbox-COr-UunX.js} +1 -1
- package/build/assets/{createSuper-RDzkTe3c.js → createSuper-BD8Om4of.js} +1 -1
- package/build/assets/{data-grid-overlay-editor-D6T-ER_q.js → data-grid-overlay-editor-DUKLRWRf.js} +1 -1
- package/build/assets/{downloader-DaEpMxPx.js → downloader-K2yu2VBv.js} +1 -1
- package/build/assets/{es6-CcuZyssh.js → es6-CqFPgbyx.js} +2 -2
- package/build/assets/{iframeResizer.contentWindow-DHS7Pu0i.js → iframeResizer.contentWindow-CYxwXEKD.js} +1 -1
- package/build/assets/{index-YQk3COsD.js → index-B7nFcP4b.js} +1 -1
- package/build/assets/index-BBSx627c.js +12 -0
- package/build/assets/index-BTWAYrEA.js +1 -0
- package/build/assets/index-BVYhtbL7.js +1 -0
- package/build/assets/{index-BWOzAKM3.js → index-BY2_5dEP.js} +1 -1
- package/build/assets/index-Bga7N97D.js +1 -0
- package/build/assets/index-CBHSzhtV.js +1 -0
- package/build/assets/index-CG0w2Shn.js +3 -0
- package/build/assets/index-CJj5-jL6.js +2 -0
- package/build/assets/index-CTKSPDuj.js +3 -0
- package/build/assets/{index-NYCOzVlX.js → index-CVPZJuoC.js} +144 -144
- package/build/assets/{index-D07bwkWY.js → index-CbGVTpRX.js} +1 -1
- package/build/assets/{index-C-2rT3oM.js → index-CgIf_789.js} +260 -233
- package/build/assets/index-CgaLKbNA.js +1 -0
- package/build/assets/index-Chg_Z_Ai.js +1 -0
- package/build/assets/{index-DHl89CCF.js → index-Cy3sYumn.js} +1 -1
- package/build/assets/{index-85lABG_-.js → index-D4DI0i3_.js} +2 -2
- package/build/assets/index-DAFr20lD.js +1 -0
- package/build/assets/{index-ma8H1oet.js → index-DAyJZph2.js} +1 -1
- package/build/assets/{index-LZMzKd6i.js → index-DHvjd_NM.js} +8 -8
- package/build/assets/{index-DcrwU5E6.js → index-DIR2fiU3.js} +1 -1
- package/build/assets/{index-DW287fpb.js → index-DJ9ENWJ6.js} +1 -1
- package/build/assets/{index-CunpKDCO.js → index-DZGNB9Z2.js} +2 -2
- package/build/assets/{index-BSeIgN9k.js → index-D_aTbShm.js} +1 -1
- package/build/assets/{index-qBaGcpp3.js → index-DbWqdg_N.js} +2 -2
- package/build/assets/index-DhpOSNWU.js +1 -0
- package/build/assets/{index-Pc9U3GV3.js → index-Dkkplt7E.js} +1 -1
- package/build/assets/{index-CvsR1I3L.js → index-FQnDjdgN.js} +1 -1
- package/build/assets/index-GeTKqk0L.js +1 -0
- package/build/assets/{index-qZBF_Zup.js → index-QxKGd3KZ.js} +1 -1
- package/build/assets/{index-Oz9-OY6E.js → index-TIqCq-vm.js} +1 -1
- package/build/assets/{index-DpOOTQ4a.js → index-WJi2gbUd.js} +1 -1
- package/build/assets/index-bXFpQSEH.js +1 -0
- package/build/assets/index-dOLNZa0u.js +1 -0
- package/build/assets/index-h6PFbOmO.js +188 -0
- package/build/assets/{index-CngYL5q1.js → index-oIFkiM-w.js} +1 -1
- package/build/assets/index-qPiigGKE.js +1 -0
- package/build/assets/index-xsH4HHeE.js +6 -0
- package/build/assets/{index.5L7agjmb.css → index.Bqb_jNud.css} +1 -1
- package/build/assets/{inherits-DMADb7u9.js → inherits-DtR6i4OG.js} +1 -1
- package/build/assets/{input-DdxVQNZ7.js → input-9qldoJOB.js} +2 -2
- package/build/assets/{memory-_2PWlQG6.js → memory-Cy3-iIgx.js} +1 -1
- package/build/assets/mergeWith-DdD-5zWL.js +1 -0
- package/build/assets/{number-overlay-editor-D5Yhw2y2.js → number-overlay-editor-DmP64vrs.js} +1 -1
- package/build/assets/{sandbox-D8Np0x1K.js → sandbox-DzhFXmWd.js} +1 -1
- package/build/assets/{slicedToArray-CiQSSrYz.js → slicedToArray-CNrowD0v.js} +2 -2
- package/build/assets/{textarea-r4-zB_B9.js → textarea-Bql4j-_M.js} +2 -2
- package/build/assets/{timepicker-Dz1EXIQj.js → timepicker-sEhIITXf.js} +2 -2
- package/build/assets/{uniqueId-C8rYCZew.js → uniqueId-DfRnwW3q.js} +1 -1
- package/build/assets/{useBasicWidgetState-vUy8Wspy.js → useBasicWidgetState-DJ8kXLgn.js} +1 -1
- package/build/assets/{useOnInputChange-Cl7V3cFN.js → useOnInputChange-CZX_IkMh.js} +1 -1
- package/build/assets/withFullScreenWrapper-DBlEST2L.js +1 -0
- package/build/assets/{worker-BlovaCIP.js → worker-CXcujS1W.js} +10 -10
- package/build/electron/worker.js +8 -8
- package/build/index.html +2 -2
- package/build/pyodide/pyodide-lock.json +1 -1
- package/build/pyodide/pyodide.asm.js +1 -1
- package/build/pyodide/pyodide.asm.wasm +0 -0
- package/build/pyodide/pyodide.mjs +3 -3
- package/build/pyodide/python_stdlib.zip +0 -0
- package/package.json +9 -8
- package/wheels/streamlit-1.45.1-cp312-none-any.whl +0 -0
- package/build/assets/MaterialSymbols-Rounded.BFCIvovZ.woff2 +0 -0
- package/build/assets/Toolbar-Ce_uRMJw.js +0 -1
- package/build/assets/index-7eIEqW6S.js +0 -1
- package/build/assets/index-BQjJjeMH.js +0 -1
- package/build/assets/index-BXlqmLSw.js +0 -188
- package/build/assets/index-BimHN13b.js +0 -2
- package/build/assets/index-C2JTCZRI.js +0 -1
- package/build/assets/index-C4IBAvYi.js +0 -1
- package/build/assets/index-C7q_Bsxr.js +0 -3
- package/build/assets/index-CZyeXUIr.js +0 -12
- package/build/assets/index-CreZOv_n.js +0 -1
- package/build/assets/index-CyYl-5F4.js +0 -1
- package/build/assets/index-DDA7JyBJ.js +0 -1
- package/build/assets/index-DF2Bv2Iu.js +0 -1
- package/build/assets/index-DN8Z5yj8.js +0 -1
- package/build/assets/index-LZAWp2JT.js +0 -3
- package/build/assets/index-VB1U8aCl.js +0 -1
- package/build/assets/index-qnESYKH3.js +0 -1
- package/build/assets/index-t--hEgTQ.js +0 -6
- package/build/assets/index-vdtOYA7b.js +0 -1
- package/build/assets/mergeWith-THRzgcPq.js +0 -1
- package/build/assets/withFullScreenWrapper-D7Ouz6kJ.js +0 -1
- package/wheels/streamlit-1.44.1-cp312-none-any.whl +0 -0
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{r as g,cm as ur,cn as cr,co as pr,cp as dr,e as rn,cq as nn,g as on,c0 as K,cj as xe,ck as Ie,cr as an,ci as fr,c1 as V,B as hr,cs as sn,ct as yr,cu as gr,cv as ln,c2 as Re,cw as un,cx as cn,cy as pn,C as mr,H as dn,A as vr,b6 as fn,Q as ot,L as hn,j as Le,bY as yn,bZ as gn,cb as mn,b_ as vn,bH as bn}from"./index-NYCOzVlX.js";import{a as Dn}from"./useBasicWidgetState-vUy8Wspy.js";import{D as Me,a as Pe,T as Sn}from"./timepicker-Dz1EXIQj.js";import{I as On}from"./input-DdxVQNZ7.js";import{I as wn}from"./base-input-BHEia47e.js";import"./FormClearHelper--a7FEpt-.js";import"./inherits-DMADb7u9.js";import"./createSuper-RDzkTe3c.js";var kn=["title","size","color","overrides"];function at(){return at=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},at.apply(this,arguments)}function Cn(e,r){if(e==null)return{};var n=Mn(e,r),o,t;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(t=0;t<a.length;t++)o=a[t],!(r.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function Mn(e,r){if(e==null)return{};var n={},o=Object.keys(e),t,a;for(a=0;a<o.length;a++)t=o[a],!(r.indexOf(t)>=0)&&(n[t]=e[t]);return n}function Pn(e,r){return Hn(e)||An(e,r)||En(e,r)||jn()}function jn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function En(e,r){if(e){if(typeof e=="string")return br(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return br(e,r)}}function br(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=new Array(r);n<r;n++)o[n]=e[n];return o}function An(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],t=!0,a=!1,i,l;try{for(n=n.call(e);!(t=(i=n.next()).done)&&(o.push(i.value),!(r&&o.length===r));t=!0);}catch(p){a=!0,l=p}finally{try{!t&&n.return!=null&&n.return()}finally{if(a)throw l}}return o}}function Hn(e){if(Array.isArray(e))return e}function xn(e,r){var n=ur(),o=Pn(n,2),t=o[1],a=e.title,i=a===void 0?"Left":a,l=e.size,p=e.color,u=e.overrides,b=u===void 0?{}:u,c=Cn(e,kn),D=cr({component:t.icons&&t.icons.ChevronLeft?t.icons.ChevronLeft:null},b&&b.Svg?pr(b.Svg):{});return g.createElement(dr,at({viewBox:"0 0 24 24",ref:r,title:i,size:l,color:p,overrides:{Svg:D}},c),g.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 12C9 12.2652 9.10536 12.5196 9.29289 12.7071L13.2929 16.7071C13.6834 17.0976 14.3166 17.0976 14.7071 16.7071C15.0976 16.3166 15.0976 15.6834 14.7071 15.2929L11.4142 12L14.7071 8.70711C15.0976 8.31658 15.0976 7.68342 14.7071 7.29289C14.3166 6.90237 13.6834 6.90237 13.2929 7.29289L9.29289 11.2929C9.10536 11.4804 9 11.7348 9 12Z"}))}const Dr=g.forwardRef(xn);var In=["title","size","color","overrides"];function it(){return it=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},it.apply(this,arguments)}function Rn(e,r){if(e==null)return{};var n=Ln(e,r),o,t;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(t=0;t<a.length;t++)o=a[t],!(r.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function Ln(e,r){if(e==null)return{};var n={},o=Object.keys(e),t,a;for(a=0;a<o.length;a++)t=o[a],!(r.indexOf(t)>=0)&&(n[t]=e[t]);return n}function Bn(e,r){return Wn(e)||Fn(e,r)||$n(e,r)||Tn()}function Tn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $n(e,r){if(e){if(typeof e=="string")return Sr(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sr(e,r)}}function Sr(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=new Array(r);n<r;n++)o[n]=e[n];return o}function Fn(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],t=!0,a=!1,i,l;try{for(n=n.call(e);!(t=(i=n.next()).done)&&(o.push(i.value),!(r&&o.length===r));t=!0);}catch(p){a=!0,l=p}finally{try{!t&&n.return!=null&&n.return()}finally{if(a)throw l}}return o}}function Wn(e){if(Array.isArray(e))return e}function Nn(e,r){var n=ur(),o=Bn(n,2),t=o[1],a=e.title,i=a===void 0?"Right":a,l=e.size,p=e.color,u=e.overrides,b=u===void 0?{}:u,c=Rn(e,In),D=cr({component:t.icons&&t.icons.ChevronRight?t.icons.ChevronRight:null},b&&b.Svg?pr(b.Svg):{});return g.createElement(dr,it({viewBox:"0 0 24 24",ref:r,title:i,size:l,color:p,overrides:{Svg:D}},c),g.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29289 7.29289C8.90237 7.68342 8.90237 8.31658 9.29289 8.70711L12.5858 12L9.29289 15.2929C8.90237 15.6834 8.90237 16.3166 9.29289 16.7071C9.68342 17.0976 10.3166 17.0976 10.7071 16.7071L14.7071 12.7071C14.8946 12.5196 15 12.2652 15 12C15 11.7348 14.8946 11.4804 14.7071 11.2929L10.7071 7.29289C10.3166 6.90237 9.68342 6.90237 9.29289 7.29289Z"}))}const Or=g.forwardRef(Nn);var wr={exports:{}},st,kr;function Yn(){if(kr)return st;kr=1;function e(d){return d&&typeof d=="object"&&"default"in d?d.default:d}var r=e(rn()),n=nn();function o(d,m){for(var O=Object.getOwnPropertyNames(m),h=0;h<O.length;h++){var s=O[h],j=Object.getOwnPropertyDescriptor(m,s);j&&j.configurable&&d[s]===void 0&&Object.defineProperty(d,s,j)}return d}function t(){return(t=Object.assign||function(d){for(var m=1;m<arguments.length;m++){var O=arguments[m];for(var h in O)Object.prototype.hasOwnProperty.call(O,h)&&(d[h]=O[h])}return d}).apply(this,arguments)}function a(d,m){d.prototype=Object.create(m.prototype),o(d.prototype.constructor=d,m)}function i(d,m){if(d==null)return{};var O,h,s={},j=Object.keys(d);for(h=0;h<j.length;h++)O=j[h],0<=m.indexOf(O)||(s[O]=d[O]);return s}function l(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}var p=function(d,m,O,h,s,j,_,G){if(!d){var L;if(m===void 0)L=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var $=[O,h,s,j,_,G],Y=0;(L=new Error(m.replace(/%s/g,function(){return $[Y++]}))).name="Invariant Violation"}throw L.framesToPop=1,L}},u=p;function b(d,m,O){if("selectionStart"in d&&"selectionEnd"in d)d.selectionStart=m,d.selectionEnd=O;else{var h=d.createTextRange();h.collapse(!0),h.moveStart("character",m),h.moveEnd("character",O-m),h.select()}}function c(d){var m=0,O=0;if("selectionStart"in d&&"selectionEnd"in d)m=d.selectionStart,O=d.selectionEnd;else{var h=document.selection.createRange();h.parentElement()===d&&(m=-h.moveStart("character",-d.value.length),O=-h.moveEnd("character",-d.value.length))}return{start:m,end:O,length:O-m}}var D={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},y="_";function f(d,m,O){var h="",s="",j=null,_=[];if(m===void 0&&(m=y),O==null&&(O=D),!d||typeof d!="string")return{maskChar:m,formatChars:O,mask:null,prefix:null,lastEditablePosition:null,permanents:[]};var G=!1;return d.split("").forEach(function(L){G=!G&&L==="\\"||(G||!O[L]?(_.push(h.length),h.length===_.length-1&&(s+=L)):j=h.length+1,h+=L,!1)}),{maskChar:m,formatChars:O,prefix:s,mask:h,lastEditablePosition:j,permanents:_}}function v(d,m){return d.permanents.indexOf(m)!==-1}function S(d,m,O){var h=d.mask,s=d.formatChars;if(!O)return!1;if(v(d,m))return h[m]===O;var j=s[h[m]];return new RegExp(j).test(O)}function k(d,m){return m.split("").every(function(O,h){return v(d,h)||!S(d,h,O)})}function w(d,m){var O=d.maskChar,h=d.prefix;if(!O){for(;m.length>h.length&&v(d,m.length-1);)m=m.slice(0,m.length-1);return m.length}for(var s=h.length,j=m.length;j>=h.length;j--){var _=m[j];if(!v(d,j)&&S(d,j,_)){s=j+1;break}}return s}function C(d,m){return w(d,m)===d.mask.length}function M(d,m){var O=d.maskChar,h=d.mask,s=d.prefix;if(!O){for((m=B(d,"",m,0)).length<s.length&&(m=s);m.length<h.length&&v(d,m.length);)m+=h[m.length];return m}if(m)return B(d,M(d,""),m,0);for(var j=0;j<h.length;j++)v(d,j)?m+=h[j]:m+=O;return m}function N(d,m,O,h){var s=O+h,j=d.maskChar,_=d.mask,G=d.prefix,L=m.split("");if(j)return L.map(function(Y,ee){return ee<O||s<=ee?Y:v(d,ee)?_[ee]:j}).join("");for(var $=s;$<L.length;$++)v(d,$)&&(L[$]="");return O=Math.max(G.length,O),L.splice(O,s-O),m=L.join(""),M(d,m)}function B(d,m,O,h){var s=d.mask,j=d.maskChar,_=d.prefix,G=O.split(""),L=C(d,m);return!j&&h>m.length&&(m+=s.slice(m.length,h)),G.every(function($){for(;ae=$,v(d,U=h)&&ae!==s[U];){if(h>=m.length&&(m+=s[h]),Y=$,ee=h,j&&v(d,ee)&&Y===j)return!0;if(++h>=s.length)return!1}var Y,ee,U,ae;return!S(d,h,$)&&$!==j||(h<m.length?m=j||L||h<_.length?m.slice(0,h)+$+m.slice(h+1):(m=m.slice(0,h)+$+m.slice(h),M(d,m)):j||(m+=$),++h<s.length)}),m}function T(d,m,O,h){var s=d.mask,j=d.maskChar,_=O.split(""),G=h;return _.every(function(L){for(;Y=L,v(d,$=h)&&Y!==s[$];)if(++h>=s.length)return!1;var $,Y;return(S(d,h,L)||L===j)&&h++,h<s.length}),h-G}function x(d,m){for(var O=m;0<=O;--O)if(!v(d,O))return O;return null}function A(d,m){for(var O=d.mask,h=m;h<O.length;++h)if(!v(d,h))return h;return null}function H(d){return d||d===0?d+"":""}function I(d,m,O,h,s){var j=d.mask,_=d.prefix,G=d.lastEditablePosition,L=m,$="",Y=0,ee=0,U=Math.min(s.start,O.start);return O.end>s.start?ee=(Y=T(d,h,$=L.slice(s.start,O.end),U))?s.length:0:L.length<h.length&&(ee=h.length-L.length),L=h,ee&&(ee===1&&!s.length&&(U=s.start===O.start?A(d,O.start):x(d,O.start)),L=N(d,L,U,ee)),L=B(d,L,$,U),(U+=Y)>=j.length?U=j.length:U<_.length&&!Y?U=_.length:U>=_.length&&U<G&&Y&&(U=A(d,U)),$||($=null),{value:L=M(d,L),enteredString:$,selection:{start:U,end:U}}}function E(){var d=new RegExp("windows","i"),m=new RegExp("phone","i"),O=navigator.userAgent;return d.test(O)&&m.test(O)}function R(d){return typeof d=="function"}function he(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame}function oe(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame}function we(d){return(oe()?he():function(){return setTimeout(d,1e3/60)})(d)}function W(d){(oe()||clearTimeout)(d)}var Ae=function(d){function m(h){var s=d.call(this,h)||this;s.focused=!1,s.mounted=!1,s.previousSelection=null,s.selectionDeferId=null,s.saveSelectionLoopDeferId=null,s.saveSelectionLoop=function(){s.previousSelection=s.getSelection(),s.saveSelectionLoopDeferId=we(s.saveSelectionLoop)},s.runSaveSelectionLoop=function(){s.saveSelectionLoopDeferId===null&&s.saveSelectionLoop()},s.stopSaveSelectionLoop=function(){s.saveSelectionLoopDeferId!==null&&(W(s.saveSelectionLoopDeferId),s.saveSelectionLoopDeferId=null,s.previousSelection=null)},s.getInputDOMNode=function(){if(!s.mounted)return null;var P=n.findDOMNode(l(l(s))),F=typeof window<"u"&&P instanceof window.Element;if(P&&!F)return null;if(P.nodeName!=="INPUT"&&(P=P.querySelector("input")),!P)throw new Error("react-input-mask: inputComponent doesn't contain input node");return P},s.getInputValue=function(){var P=s.getInputDOMNode();return P?P.value:null},s.setInputValue=function(P){var F=s.getInputDOMNode();F&&(s.value=P,F.value=P)},s.setCursorToEnd=function(){var P=w(s.maskOptions,s.value),F=A(s.maskOptions,P);F!==null&&s.setCursorPosition(F)},s.setSelection=function(P,F,q){q===void 0&&(q={});var z=s.getInputDOMNode(),Q=s.isFocused();z&&Q&&(q.deferred||b(z,P,F),s.selectionDeferId!==null&&W(s.selectionDeferId),s.selectionDeferId=we(function(){s.selectionDeferId=null,b(z,P,F)}),s.previousSelection={start:P,end:F,length:Math.abs(F-P)})},s.getSelection=function(){return c(s.getInputDOMNode())},s.getCursorPosition=function(){return s.getSelection().start},s.setCursorPosition=function(P){s.setSelection(P,P)},s.isFocused=function(){return s.focused},s.getBeforeMaskedValueChangeConfig=function(){var P=s.maskOptions,F=P.mask,q=P.maskChar,z=P.permanents,Q=P.formatChars;return{mask:F,maskChar:q,permanents:z,alwaysShowMask:!!s.props.alwaysShowMask,formatChars:Q}},s.isInputAutofilled=function(P,F,q,z){var Q=s.getInputDOMNode();try{if(Q.matches(":-webkit-autofill"))return!0}catch{}return!s.focused||z.end<q.length&&F.end===P.length},s.onChange=function(P){var F=l(l(s)).beforePasteState,q=l(l(s)).previousSelection,z=s.props.beforeMaskedValueChange,Q=s.getInputValue(),fe=s.value,pe=s.getSelection();s.isInputAutofilled(Q,pe,fe,q)&&(fe=M(s.maskOptions,""),q={start:0,end:0,length:0}),F&&(q=F.selection,fe=F.value,pe={start:q.start+Q.length,end:q.start+Q.length,length:0},Q=fe.slice(0,q.start)+Q+fe.slice(q.end),s.beforePasteState=null);var Oe=I(s.maskOptions,Q,pe,fe,q),ze=Oe.enteredString,ge=Oe.selection,Ce=Oe.value;if(R(z)){var He=z({value:Ce,selection:ge},{value:fe,selection:q},ze,s.getBeforeMaskedValueChangeConfig());Ce=He.value,ge=He.selection}s.setInputValue(Ce),R(s.props.onChange)&&s.props.onChange(P),s.isWindowsPhoneBrowser?s.setSelection(ge.start,ge.end,{deferred:!0}):s.setSelection(ge.start,ge.end)},s.onFocus=function(P){var F=s.props.beforeMaskedValueChange,q=s.maskOptions,z=q.mask,Q=q.prefix;if(s.focused=!0,s.mounted=!0,z){if(s.value)w(s.maskOptions,s.value)<s.maskOptions.mask.length&&s.setCursorToEnd();else{var fe=M(s.maskOptions,Q),pe=M(s.maskOptions,fe),Oe=w(s.maskOptions,pe),ze=A(s.maskOptions,Oe),ge={start:ze,end:ze};if(R(F)){var Ce=F({value:pe,selection:ge},{value:s.value,selection:null},null,s.getBeforeMaskedValueChangeConfig());pe=Ce.value,ge=Ce.selection}var He=pe!==s.getInputValue();He&&s.setInputValue(pe),He&&R(s.props.onChange)&&s.props.onChange(P),s.setSelection(ge.start,ge.end)}s.runSaveSelectionLoop()}R(s.props.onFocus)&&s.props.onFocus(P)},s.onBlur=function(P){var F=s.props.beforeMaskedValueChange,q=s.maskOptions.mask;if(s.stopSaveSelectionLoop(),s.focused=!1,q&&!s.props.alwaysShowMask&&k(s.maskOptions,s.value)){var z="";R(F)&&(z=F({value:z,selection:null},{value:s.value,selection:s.previousSelection},null,s.getBeforeMaskedValueChangeConfig()).value);var Q=z!==s.getInputValue();Q&&s.setInputValue(z),Q&&R(s.props.onChange)&&s.props.onChange(P)}R(s.props.onBlur)&&s.props.onBlur(P)},s.onMouseDown=function(P){if(!s.focused&&document.addEventListener){s.mouseDownX=P.clientX,s.mouseDownY=P.clientY,s.mouseDownTime=new Date().getTime();var F=function q(z){if(document.removeEventListener("mouseup",q),s.focused){var Q=Math.abs(z.clientX-s.mouseDownX),fe=Math.abs(z.clientY-s.mouseDownY),pe=Math.max(Q,fe),Oe=new Date().getTime()-s.mouseDownTime;(pe<=10&&Oe<=200||pe<=5&&Oe<=300)&&s.setCursorToEnd()}};document.addEventListener("mouseup",F)}R(s.props.onMouseDown)&&s.props.onMouseDown(P)},s.onPaste=function(P){R(s.props.onPaste)&&s.props.onPaste(P),P.defaultPrevented||(s.beforePasteState={value:s.getInputValue(),selection:s.getSelection()},s.setInputValue(""))},s.handleRef=function(P){s.props.children==null&&R(s.props.inputRef)&&s.props.inputRef(P)};var j=h.mask,_=h.maskChar,G=h.formatChars,L=h.alwaysShowMask,$=h.beforeMaskedValueChange,Y=h.defaultValue,ee=h.value;s.maskOptions=f(j,_,G),Y==null&&(Y=""),ee==null&&(ee=Y);var U=H(ee);if(s.maskOptions.mask&&(L||U)&&(U=M(s.maskOptions,U),R($))){var ae=h.value;h.value==null&&(ae=Y),U=$({value:U,selection:null},{value:ae=H(ae),selection:null},null,s.getBeforeMaskedValueChangeConfig()).value}return s.value=U,s}a(m,d);var O=m.prototype;return O.componentDidMount=function(){this.mounted=!0,this.getInputDOMNode()&&(this.isWindowsPhoneBrowser=E(),this.maskOptions.mask&&this.getInputValue()!==this.value&&this.setInputValue(this.value))},O.componentDidUpdate=function(){var h=this.previousSelection,s=this.props,j=s.beforeMaskedValueChange,_=s.alwaysShowMask,G=s.mask,L=s.maskChar,$=s.formatChars,Y=this.maskOptions,ee=_||this.isFocused(),U=this.props.value!=null,ae=U?H(this.props.value):this.value,P=h?h.start:null;if(this.maskOptions=f(G,L,$),this.maskOptions.mask){!Y.mask&&this.isFocused()&&this.runSaveSelectionLoop();var F=this.maskOptions.mask&&this.maskOptions.mask!==Y.mask;if(Y.mask||U||(ae=this.getInputValue()),(F||this.maskOptions.mask&&(ae||ee))&&(ae=M(this.maskOptions,ae)),F){var q=w(this.maskOptions,ae);(P===null||q<P)&&(P=C(this.maskOptions,ae)?q:A(this.maskOptions,q))}!this.maskOptions.mask||!k(this.maskOptions,ae)||ee||U&&this.props.value||(ae="");var z={start:P,end:P};if(R(j)){var Q=j({value:ae,selection:z},{value:this.value,selection:this.previousSelection},null,this.getBeforeMaskedValueChangeConfig());ae=Q.value,z=Q.selection}this.value=ae;var fe=this.getInputValue()!==this.value;fe?(this.setInputValue(this.value),this.forceUpdate()):F&&this.forceUpdate();var pe=!1;z.start!=null&&z.end!=null&&(pe=!h||h.start!==z.start||h.end!==z.end),(pe||fe)&&this.setSelection(z.start,z.end)}else Y.mask&&(this.stopSaveSelectionLoop(),this.forceUpdate())},O.componentWillUnmount=function(){this.mounted=!1,this.selectionDeferId!==null&&W(this.selectionDeferId),this.stopSaveSelectionLoop()},O.render=function(){var h,s=this.props,j=(s.mask,s.alwaysShowMask,s.maskChar,s.formatChars,s.inputRef,s.beforeMaskedValueChange,s.children),_=i(s,["mask","alwaysShowMask","maskChar","formatChars","inputRef","beforeMaskedValueChange","children"]);if(j){R(j)||u(!1);var G=["onChange","onPaste","onMouseDown","onFocus","onBlur","value","disabled","readOnly"],L=t({},_);G.forEach(function(Y){return delete L[Y]}),h=j(L),G.filter(function(Y){return h.props[Y]!=null&&h.props[Y]!==_[Y]}).length&&u(!1)}else h=r.createElement("input",t({ref:this.handleRef},_));var $={onFocus:this.onFocus,onBlur:this.onBlur};return this.maskOptions.mask&&(_.disabled||_.readOnly||($.onChange=this.onChange,$.onPaste=this.onPaste,$.onMouseDown=this.onMouseDown),_.value!=null&&($.value=this.value)),h=r.cloneElement(h,$)},m}(r.Component);return st=Ae,st}var Cr;function Vn(){return Cr||(Cr=1,wr.exports=Yn()),wr.exports}var zn=Vn();const _n=on(zn);var Un=["startEnhancer","endEnhancer","error","positive","onChange","onFocus","onBlur","value","disabled","readOnly"],qn=["Input"],Kn=["mask","maskChar","overrides"];function Mr(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function lt(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Mr(Object(n),!0).forEach(function(o){Xn(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mr(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Xn(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function _e(e){"@babel/helpers - typeof";return _e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_e(e)}function Be(){return Be=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Be.apply(this,arguments)}function ut(e,r){if(e==null)return{};var n=Qn(e,r),o,t;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(t=0;t<a.length;t++)o=a[t],!(r.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function Qn(e,r){if(e==null)return{};var n={},o=Object.keys(e),t,a;for(a=0;a<o.length;a++)t=o[a],!(r.indexOf(t)>=0)&&(n[t]=e[t]);return n}var Pr=g.forwardRef(function(e,r){e.startEnhancer,e.endEnhancer,e.error,e.positive;var n=e.onChange,o=e.onFocus,t=e.onBlur,a=e.value,i=e.disabled,l=e.readOnly,p=ut(e,Un);return g.createElement(_n,Be({onChange:n,onFocus:o,onBlur:t,value:a,disabled:i,readOnly:l},p),function(u){return g.createElement(wn,Be({ref:r,onChange:n,onFocus:o,onBlur:t,value:a,disabled:i,readOnly:l},u))})});Pr.displayName="MaskOverride";function jr(e){var r=e.mask,n=e.maskChar,o=e.overrides;o=o===void 0?{}:o;var t=o.Input,a=t===void 0?{}:t,i=ut(o,qn),l=ut(e,Kn),p=Pr,u={},b={};typeof a=="function"?p=a:_e(a)==="object"&&(p=a.component||p,u=a.props||{},b=a.style||{}),_e(u)==="object"&&(u=lt(lt({},u),{},{mask:u.mask||r,maskChar:u.maskChar||n}));var c=lt({Input:{component:p,props:u,style:b}},i);return g.createElement(On,Be({},l,{overrides:c}))}jr.defaultProps={maskChar:" "};var ct=Object.freeze({horizontal:"horizontal",vertical:"vertical"}),Er=[0,1,2,3,4,5,6],Jn=[0,1,2,3,4,5,6,7,8,9,10,11],re={high:"high",default:"default"},Se={startDate:"startDate",endDate:"endDate"},Zn={locked:"locked"};function Ar(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function je(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ar(Object(n),!0).forEach(function(o){Gn(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ar(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Gn(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var pt=K("label",function(e){var r=e.$disabled,n=e.$theme,o=n.colors,t=n.typography;return je(je({},t.font250),{},{width:"100%",color:r?o.contentSecondary:o.contentPrimary,display:"block",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0})});pt.displayName="Label",pt.displayName="Label";var dt=K("span",function(e){var r=e.$theme.sizing;return{display:"flex",width:"100%",marginTop:r.scale300,marginRight:0,marginBottom:r.scale300,marginLeft:0}});dt.displayName="LabelContainer",dt.displayName="LabelContainer";var ft=K("span",function(e){var r=e.$disabled,n=e.$counterError,o=e.$theme,t=o.colors,a=o.typography;return je(je({},a.font100),{},{flex:0,width:"100%",color:n?t.negative400:r?t.contentSecondary:t.contentPrimary})});ft.displayName="LabelEndEnhancer",ft.displayName="LabelEndEnhancer";var ht=K("div",function(e){var r=e.$error,n=e.$positive,o=e.$theme,t=o.colors,a=o.sizing,i=o.typography,l=t.contentSecondary;return r?l=t.negative400:n&&(l=t.positive400),je(je({},i.font100),{},{color:l,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,marginTop:a.scale300,marginRight:0,marginBottom:a.scale300,marginLeft:0})});ht.displayName="Caption",ht.displayName="Caption";var yt=K("div",function(e){var r=e.$theme.sizing;return{width:"100%",marginBottom:r.scale600}});yt.displayName="ControlContainer",yt.displayName="ControlContainer";function ke(){return ke=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},ke.apply(this,arguments)}function Ue(e){"@babel/helpers - typeof";return Ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ue(e)}function eo(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function to(e,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function ro(e,r,n){return r&&to(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function no(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&>(e,r)}function gt(e,r){return gt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},gt(e,r)}function oo(e){var r=so();return function(){var n=qe(e),o;if(r){var t=qe(this).constructor;o=Reflect.construct(n,arguments,t)}else o=n.apply(this,arguments);return ao(this,o)}}function ao(e,r){if(r&&(Ue(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return io(e)}function io(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function so(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qe(e){return qe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qe(e)}function lo(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function uo(e,r,n,o){return r&&typeof r!="boolean"?typeof r=="function"?r(o):r:n&&typeof n!="boolean"?typeof n=="function"?n(o):n:e?typeof e=="function"?e(o):e:null}var mt=function(e){no(n,e);var r=oo(n);function n(){return eo(this,n),r.apply(this,arguments)}return ro(n,[{key:"render",value:function(){var o=this.props,t=o.overrides,a=t.Label,i=t.LabelEndEnhancer,l=t.LabelContainer,p=t.Caption,u=t.ControlContainer,b=o.label,c=o.caption,D=o.disabled,y=o.error,f=o.positive,v=o.htmlFor,S=o.children,k=o.counter,w=g.Children.only(S).props,C={$disabled:!!D,$error:!!y,$positive:!!f},M=xe(a)||pt,N=xe(i)||ft,B=xe(l)||dt,T=xe(p)||ht,x=xe(u)||yt,A=uo(c,y,f,C),H=this.props.labelEndEnhancer;if(k){var I=null,E=null,R=null;Ue(k)==="object"&&(E=k.length,I=k.maxLength,R=k.error),I=I||w.maxLength,E==null&&typeof w.value=="string"&&(E=w.value.length),E==null&&(E=0),C.$length=E,I==null?H||(H="".concat(E)):(C.$maxLength=E,H||(H="".concat(E,"/").concat(I)),E>I&&R==null&&(R=!0)),R&&(C.$error=!0,C.$counterError=!0)}return g.createElement(g.Fragment,null,b&&g.createElement(B,ke({},C,Ie(l)),g.createElement(M,ke({"data-baseweb":"form-control-label",htmlFor:v||w.id},C,Ie(a)),typeof b=="function"?b(C):b),!!H&&g.createElement(N,ke({},C,Ie(i)),typeof H=="function"?H(C):H)),g.createElement(an,null,function(he){return g.createElement(x,ke({"data-baseweb":"form-control-container"},C,Ie(u)),g.Children.map(S,function(oe,we){if(oe){var W=oe.key||String(we);return g.cloneElement(oe,{key:W,"aria-errormessage":y?he:null,"aria-describedby":c||f?he:null,disabled:w.disabled||D,error:typeof w.error<"u"?w.error:C.$error,positive:typeof w.positive<"u"?w.positive:C.$positive})}}),(!!c||!!y||f)&&g.createElement(T,ke({"data-baseweb":"form-control-caption",id:he},C,Ie(p)),A))}))}}]),n}(g.Component);lo(mt,"defaultProps",{overrides:{},label:null,caption:null,disabled:!1,counter:!1});function Hr(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function xr(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Hr(Object(n),!0).forEach(function(o){co(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hr(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function co(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var po=function(e){return Jn.map(function(r){return{id:r.toString(),label:e(r)}})},fo=function(e,r){return e.map(function(n){return r.includes(Number(n.id))?n:xr(xr({},n),{},{disabled:!0})})},ho=function(e){var r=e.filterMonthsList,n=e.formatMonthLabel,o=po(n);return r&&(o=fo(o,r)),o};function yo(e){var r=e.$range,n=r===void 0?!1:r,o=e.$disabled,t=o===void 0?!1:o,a=e.$isHighlighted,i=a===void 0?!1:a,l=e.$isHovered,p=l===void 0?!1:l,u=e.$selected,b=u===void 0?!1:u,c=e.$hasRangeSelected,D=c===void 0?!1:c,y=e.$startDate,f=y===void 0?!1:y,v=e.$endDate,S=v===void 0?!1:v,k=e.$pseudoSelected,w=k===void 0?!1:k,C=e.$hasRangeHighlighted,M=C===void 0?!1:C,N=e.$pseudoHighlighted,B=N===void 0?!1:N,T=e.$hasRangeOnRight,x=T===void 0?!1:T,A=e.$startOfMonth,H=A===void 0?!1:A,I=e.$endOfMonth,E=I===void 0?!1:I,R=e.$outsideMonth,he=R===void 0?!1:R;return"".concat(+n).concat(+t).concat(+(i||p)).concat(+b).concat(+D).concat(+f).concat(+S).concat(+w).concat(+M).concat(+B).concat(+(M&&!B&&x)).concat(+(M&&!B&&!x)).concat(+H).concat(+E).concat(+he)}function go(e,r){return Do(e)||bo(e,r)||vo(e,r)||mo()}function mo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vo(e,r){if(e){if(typeof e=="string")return Ir(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ir(e,r)}}function Ir(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=new Array(r);n<r;n++)o[n]=e[n];return o}function bo(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],t=!0,a=!1,i,l;try{for(n=n.call(e);!(t=(i=n.next()).done)&&(o.push(i.value),!(r&&o.length===r));t=!0);}catch(p){a=!0,l=p}finally{try{!t&&n.return!=null&&n.return()}finally{if(a)throw l}}return o}}function Do(e){if(Array.isArray(e))return e}function Rr(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function te(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Rr(Object(n),!0).forEach(function(o){Te(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rr(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Te(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var vt=K("div",function(e){var r=e.$separateRangeInputs;return te({width:"100%"},r?{display:"flex",justifyContent:"center"}:{})});vt.displayName="StyledInputWrapper",vt.displayName="StyledInputWrapper";var bt=K("div",function(e){var r=e.$theme;return te(te({},r.typography.LabelMedium),{},{marginBottom:r.sizing.scale300})});bt.displayName="StyledInputLabel",bt.displayName="StyledInputLabel";var Dt=K("div",function(e){var r=e.$theme;return{width:"100%",marginRight:r.sizing.scale300}});Dt.displayName="StyledStartDate",Dt.displayName="StyledStartDate";var St=K("div",function(e){return e.$theme,{width:"100%"}});St.displayName="StyledEndDate",St.displayName="StyledEndDate";var Ot=K("div",function(e){var r=e.$theme,n=r.typography,o=r.colors,t=r.borders;return te(te({},n.font200),{},{color:o.calendarForeground,backgroundColor:o.calendarBackground,textAlign:"center",borderTopLeftRadius:t.surfaceBorderRadius,borderTopRightRadius:t.surfaceBorderRadius,borderBottomRightRadius:t.surfaceBorderRadius,borderBottomLeftRadius:t.surfaceBorderRadius,display:"inline-block"})});Ot.displayName="StyledRoot",Ot.displayName="StyledRoot";var wt=K("div",function(e){var r=e.$orientation;return{display:"flex",flexDirection:r===ct.vertical?"column":"row"}});wt.displayName="StyledMonthContainer",wt.displayName="StyledMonthContainer";var kt=K("div",function(e){var r=e.$theme.sizing,n=e.$density;return{paddingTop:r.scale300,paddingBottom:n===re.high?r.scale400:r.scale300,paddingLeft:r.scale500,paddingRight:r.scale500}});kt.displayName="StyledCalendarContainer",kt.displayName="StyledCalendarContainer";var Ke=K("div",function(e){var r=e.$theme,n=r.direction==="rtl"?"right":"left";return{marginBottom:r.sizing.scale600,paddingLeft:r.sizing.scale600,paddingRight:r.sizing.scale600,textAlign:n}});Ke.displayName="StyledSelectorContainer",Ke.displayName="StyledSelectorContainer";var Ct=K("div",function(e){var r=e.$theme,n=r.typography,o=r.borders,t=r.colors,a=r.sizing,i=e.$density;return te(te({},i===re.high?n.LabelMedium:n.LabelLarge),{},{color:t.calendarHeaderForeground,display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:a.scale600,paddingBottom:a.scale300,paddingLeft:a.scale600,paddingRight:a.scale600,backgroundColor:t.calendarHeaderBackground,borderTopLeftRadius:o.surfaceBorderRadius,borderTopRightRadius:o.surfaceBorderRadius,borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:i===re.high?"calc(".concat(a.scale800," + ").concat(a.scale0,")"):a.scale950})});Ct.displayName="StyledCalendarHeader",Ct.displayName="StyledCalendarHeader";var Mt=K("div",function(e){return{color:e.$theme.colors.calendarHeaderForeground,backgroundColor:e.$theme.colors.calendarHeaderBackground,whiteSpace:"nowrap"}});Mt.displayName="StyledMonthHeader",Mt.displayName="StyledMonthHeader";var Pt=K("button",function(e){var r=e.$theme,n=r.typography,o=r.colors,t=e.$isFocusVisible,a=e.$density;return te(te({},a===re.high?n.LabelMedium:n.LabelLarge),{},{alignItems:"center",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,color:o.calendarHeaderForeground,cursor:"pointer",display:"flex",outline:"none",":focus":{boxShadow:t?"0 0 0 3px ".concat(o.accent):"none"}})});Pt.displayName="StyledMonthYearSelectButton",Pt.displayName="StyledMonthYearSelectButton";var jt=K("span",function(e){var r=e.$theme.direction==="rtl"?"marginRight":"marginLeft";return Te({alignItems:"center",display:"flex"},r,e.$theme.sizing.scale500)});jt.displayName="StyledMonthYearSelectIconContainer",jt.displayName="StyledMonthYearSelectIconContainer";function Lr(e){var r=e.$theme,n=e.$disabled,o=e.$isFocusVisible;return{boxSizing:"border-box",display:"flex",color:n?r.colors.calendarHeaderForegroundDisabled:r.colors.calendarHeaderForeground,cursor:n?"default":"pointer",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0",marginBottom:0,marginTop:0,outline:"none",":focus":n?{}:{boxShadow:o?"0 0 0 3px ".concat(r.colors.accent):"none"}}}var Et=K("button",Lr);Et.displayName="StyledPrevButton",Et.displayName="StyledPrevButton";var At=K("button",Lr);At.displayName="StyledNextButton",At.displayName="StyledNextButton";var Ht=K("div",function(e){return{display:"inline-block"}});Ht.displayName="StyledMonth",Ht.displayName="StyledMonth";var xt=K("div",function(e){var r=e.$theme.sizing;return{whiteSpace:"nowrap",display:"flex",marginBottom:r.scale0}});xt.displayName="StyledWeek",xt.displayName="StyledWeek";function X(e,r){var n,o=e.substr(0,12)+"1"+e.substr(13),t=e.substr(0,13)+"1"+e.substr(14);return n={},Te(n,e,r),Te(n,o,r),Te(n,t,r),n}function It(e,r){var n=r.colors,o={":before":{content:null},":after":{content:null}},t=o,a={color:n.calendarForegroundDisabled,":before":{content:null},":after":{content:null}},i={color:n.calendarForegroundDisabled,":before":{borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",backgroundColor:"transparent"},":after":{borderTopLeftRadius:"0%",borderTopRightRadius:"0%",borderBottomLeftRadius:"0%",borderBottomRightRadius:"0%",borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent",borderLeftColor:"transparent"}},l={":before":{content:null}},p=1;e&&e[p]==="1"&&(t=a);var u=Object.assign({},X("001000000000000",{color:n.calendarDayForegroundPseudoSelected}),X("000100000000000",{color:n.calendarDayForegroundSelected}),X("001100000000000",{color:n.calendarDayForegroundSelectedHighlighted}),{"010000000000000":{color:n.calendarForegroundDisabled,":after":{content:null}}},{"011000000000000":{color:n.calendarForegroundDisabled,":after":{content:null}}},X("000000000000001",i),X("101000000000000",l),X("101010000000000",l),X("100100000000000",{color:n.calendarDayForegroundSelected}),X("101100000000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),X("100111100000000",{color:n.calendarDayForegroundSelected,":before":{content:null}}),X("101111100000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),X("100111000000000",{color:n.calendarDayForegroundSelected}),X("100110100000000",{color:n.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),X("100100001010000",{color:n.calendarDayForegroundSelected}),X("100100001001000",{color:n.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),X("101000001010000",{":before":{left:null,right:"50%"}}),{"101000001001000":{}},{"101000001001100":{}},{"101000001001010":{}},X("100010010000000",{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),{"101000001100000":{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}},X("100000001100000",{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),X("101111000000000",{color:n.calendarDayForegroundSelectedHighlighted}),X("101110100000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{left:null,right:"50%"}}),X("101010010000000",{color:n.calendarDayForegroundPseudoSelectedHighlighted,":before":{left:"0",width:"100%"}}),X("100000000000001",i),X("100000001010001",i),X("100000001001001",i),X("100010000000001",i));return u[e]||t}var Rt=K("div",function(e){var r=e.$disabled,n=e.$isFocusVisible,o=e.$isHighlighted,t=e.$peekNextMonth,a=e.$pseudoSelected,i=e.$range,l=e.$selected,p=e.$outsideMonth,u=e.$outsideMonthWithinRange,b=e.$hasDateLabel,c=e.$density,D=e.$hasLockedBehavior,y=e.$selectedInput,f=e.$value,v=e.$theme,S=v.colors,k=v.typography,w=v.sizing,C=yo(e),M;b?c===re.high?M="60px":M="70px":c===re.high?M="40px":M="48px";var N=Array.isArray(f)?f:[f,null],B=go(N,2),T=B[0],x=B[1],A=y===Se.startDate?x!==null&&typeof x<"u":T!==null&&typeof T<"u",H=i&&!(D&&!A);return te(te(te({},c===re.high?k.ParagraphSmall:k.ParagraphMedium),{},{boxSizing:"border-box",position:"relative",cursor:r||!t&&p?"default":"pointer",color:S.calendarForeground,display:"inline-block",width:c===re.high?"42px":"50px",height:M,lineHeight:c===re.high?w.scale700:w.scale900,textAlign:"center",paddingTop:w.scale300,paddingBottom:w.scale300,paddingLeft:w.scale300,paddingRight:w.scale300,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,outline:"none",backgroundColor:"transparent",transform:"scale(1)"},It(C,e.$theme)),{},{":after":te(te({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",boxShadow:n&&(!p||t)?"0 0 0 3px ".concat(S.accent):"none",backgroundColor:l?S.calendarDayBackgroundSelectedHighlighted:a&&o?S.calendarDayBackgroundPseudoSelectedHighlighted:S.calendarBackground,height:b?"100%":c===re.high?"42px":"50px",width:"100%",position:"absolute",top:b?0:"-1px",left:0,paddingTop:w.scale200,paddingBottom:w.scale200,borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderTopColor:S.borderSelected,borderBottomColor:S.borderSelected,borderRightColor:S.borderSelected,borderLeftColor:S.borderSelected,borderTopLeftRadius:b?w.scale800:"100%",borderTopRightRadius:b?w.scale800:"100%",borderBottomLeftRadius:b?w.scale800:"100%",borderBottomRightRadius:b?w.scale800:"100%"},It(C,e.$theme)[":after"]||{}),u?{content:null}:{})},H?{":before":te(te({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",backgroundColor:S.mono300,position:"absolute",height:"100%",width:"50%",top:0,left:"50%",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftWidth:"0",borderRightWidth:"0",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopColor:"transparent",borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},It(C,e.$theme)[":before"]||{}),u?{backgroundColor:S.mono300,left:"0",width:"100%",content:'""'}:{})}:{})});Rt.displayName="StyledDay",Rt.displayName="StyledDay";var Lt=K("div",function(e){var r=e.$theme,n=r.typography,o=r.colors,t=e.$selected;return te(te({},n.ParagraphXSmall),{},{color:t?o.contentInverseTertiary:o.contentTertiary})});Lt.displayName="StyledDayLabel",Lt.displayName="StyledDayLabel";var Bt=K("div",function(e){var r=e.$theme,n=r.typography,o=r.colors,t=r.sizing,a=e.$density;return te(te({},n.LabelMedium),{},{color:o.contentTertiary,boxSizing:"border-box",position:"relative",cursor:"default",display:"inline-block",width:a===re.high?"42px":"50px",height:a===re.high?"40px":"48px",textAlign:"center",lineHeight:t.scale900,paddingTop:t.scale300,paddingBottom:t.scale300,paddingLeft:t.scale200,paddingRight:t.scale200,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,backgroundColor:"transparent"})});Bt.displayName="StyledWeekdayHeader",Bt.displayName="StyledWeekdayHeader";function Tt(e){"@babel/helpers - typeof";return Tt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Tt(e)}function de(){return de=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},de.apply(this,arguments)}function me(e,r){return ko(e)||wo(e,r)||Oo(e,r)||So()}function So(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
5
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oo(e,r){if(e){if(typeof e=="string")return Br(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Br(e,r)}}function Br(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=new Array(r);n<r;n++)o[n]=e[n];return o}function wo(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],t=!0,a=!1,i,l;try{for(n=n.call(e);!(t=(i=n.next()).done)&&(o.push(i.value),!(r&&o.length===r));t=!0);}catch(p){a=!0,l=p}finally{try{!t&&n.return!=null&&n.return()}finally{if(a)throw l}}return o}}function ko(e){if(Array.isArray(e))return e}function Tr(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function Xe(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Tr(Object(n),!0).forEach(function(o){ne(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tr(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Co(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Mo(e,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Po(e,r,n){return r&&Mo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function jo(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&$t(e,r)}function $t(e,r){return $t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},$t(e,r)}function Eo(e){var r=Ho();return function(){var n=Qe(e),o;if(r){var t=Qe(this).constructor;o=Reflect.construct(n,arguments,t)}else o=n.apply(this,arguments);return Ao(this,o)}}function Ao(e,r){if(r&&(Tt(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ie(e)}function ie(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ho(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Qe(e){return Qe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Qe(e)}function ne(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var $r=function(e){return e.$theme,{cursor:"pointer"}},Ft=2e3,Wt=2030,Fr=0,Wr=11,Nt={NEXT:"next",PREVIOUS:"previous"};function Nr(e){return e.split("-").map(Number)}var Yr=function(e){jo(n,e);var r=Eo(n);function n(o){var t;return Co(this,n),t=r.call(this,o),ne(ie(t),"dateHelpers",void 0),ne(ie(t),"monthItems",void 0),ne(ie(t),"yearItems",void 0),ne(ie(t),"state",{isMonthDropdownOpen:!1,isYearDropdownOpen:!1,isFocusVisible:!1}),ne(ie(t),"getDateProp",function(){return t.props.date||t.dateHelpers.date()}),ne(ie(t),"getYearItems",function(){var a=t.getDateProp(),i=t.props.maxDate,l=t.props.minDate,p=i?t.dateHelpers.getYear(i):Wt,u=l?t.dateHelpers.getYear(l):Ft,b=t.dateHelpers.getMonth(a);t.yearItems=Array.from({length:p-u+1},function(S,k){return u+k}).map(function(S){return{id:S.toString(),label:S.toString()}});var c=i?t.dateHelpers.getMonth(i):Wr,D=l?t.dateHelpers.getMonth(l):Fr,y=Array.from({length:c+1},function(S,k){return k}),f=Array.from({length:12-D},function(S,k){return k+D});if(b>y[y.length-1]){var v=t.yearItems.length-1;t.yearItems[v]=Xe(Xe({},t.yearItems[v]),{},{disabled:!0})}b<f[0]&&(t.yearItems[0]=Xe(Xe({},t.yearItems[0]),{},{disabled:!0}))}),ne(ie(t),"getMonthItems",function(){var a=t.getDateProp(),i=t.dateHelpers.getYear(a),l=t.props.maxDate,p=t.props.minDate,u=l?t.dateHelpers.getYear(l):Wt,b=p?t.dateHelpers.getYear(p):Ft,c=l?t.dateHelpers.getMonth(l):Wr,D=Array.from({length:c+1},function(w,C){return C}),y=p?t.dateHelpers.getMonth(p):Fr,f=Array.from({length:12-y},function(w,C){return C+y}),v=D.filter(function(w){return f.includes(w)}),S=i===u&&i===b?v:i===u?D:i===b?f:null,k=function(w){return t.dateHelpers.getMonthInLocale(w,t.props.locale)};t.monthItems=ho({filterMonthsList:S,formatMonthLabel:k})}),ne(ie(t),"increaseMonth",function(){t.props.onMonthChange&&t.props.onMonthChange({date:t.dateHelpers.addMonths(t.getDateProp(),1-t.props.order)})}),ne(ie(t),"decreaseMonth",function(){t.props.onMonthChange&&t.props.onMonthChange({date:t.dateHelpers.subMonths(t.getDateProp(),1)})}),ne(ie(t),"isMultiMonthHorizontal",function(){var a=t.props,i=a.monthsShown,l=a.orientation;return i?l===ct.horizontal&&i>1:!1}),ne(ie(t),"isHiddenPaginationButton",function(a){var i=t.props,l=i.monthsShown,p=i.order;if(l&&t.isMultiMonthHorizontal())if(a===Nt.NEXT){var u=p===l-1;return!u}else{var b=p===0;return!b}return!1}),ne(ie(t),"handleFocus",function(a){fr(a)&&t.setState({isFocusVisible:!0})}),ne(ie(t),"handleBlur",function(a){t.state.isFocusVisible!==!1&&t.setState({isFocusVisible:!1})}),ne(ie(t),"renderPreviousMonthButton",function(a){var i=a.locale,l=a.theme,p=t.getDateProp(),u=t.props,b=u.overrides,c=b===void 0?{}:b,D=u.density,y=t.dateHelpers.monthDisabledBefore(p,t.props),f=!1;y&&(f=!0);var v=t.dateHelpers.subMonths(p,1),S=t.props.minDate?t.dateHelpers.getYear(t.props.minDate):Ft;t.dateHelpers.getYear(v)<S&&(f=!0);var k=t.isHiddenPaginationButton(Nt.PREVIOUS);k&&(f=!0);var w=V(c.PrevButton,Et),C=me(w,2),M=C[0],N=C[1],B=V(c.PrevButtonIcon,l.direction==="rtl"?Or:Dr),T=me(B,2),x=T[0],A=T[1],H=t.decreaseMonth;return y&&(H=null),g.createElement(M,de({"aria-label":i.datepicker.previousMonth,tabIndex:0,onClick:H,disabled:f,$isFocusVisible:t.state.isFocusVisible,type:"button",$disabled:f,$order:t.props.order},N),k?null:g.createElement(x,de({size:D===re.high?24:36,overrides:{Svg:{style:$r}}},A)))}),ne(ie(t),"renderNextMonthButton",function(a){var i=a.locale,l=a.theme,p=t.getDateProp(),u=t.props,b=u.overrides,c=b===void 0?{}:b,D=u.density,y=t.dateHelpers.monthDisabledAfter(p,t.props),f=!1;y&&(f=!0);var v=t.dateHelpers.addMonths(p,1),S=t.props.maxDate?t.dateHelpers.getYear(t.props.maxDate):Wt;t.dateHelpers.getYear(v)>S&&(f=!0);var k=t.isHiddenPaginationButton(Nt.NEXT);k&&(f=!0);var w=V(c.NextButton,At),C=me(w,2),M=C[0],N=C[1],B=V(c.NextButtonIcon,l.direction==="rtl"?Dr:Or),T=me(B,2),x=T[0],A=T[1],H=t.increaseMonth;return y&&(H=null),g.createElement(M,de({"aria-label":i.datepicker.nextMonth,tabIndex:0,onClick:H,disabled:f,type:"button",$disabled:f,$isFocusVisible:t.state.isFocusVisible,$order:t.props.order},N),k?null:g.createElement(x,de({size:D===re.high?24:36,overrides:{Svg:{style:$r}}},A)))}),ne(ie(t),"canArrowsOpenDropdown",function(a){return!t.state.isMonthDropdownOpen&&!t.state.isYearDropdownOpen&&(a.key==="ArrowUp"||a.key==="ArrowDown")}),ne(ie(t),"renderMonthYearDropdown",function(){var a=t.getDateProp(),i=t.dateHelpers.getMonth(a),l=t.dateHelpers.getYear(a),p=t.props,u=p.locale,b=p.overrides,c=b===void 0?{}:b,D=p.density,y=V(c.MonthYearSelectButton,Pt),f=me(y,2),v=f[0],S=f[1],k=V(c.MonthYearSelectIconContainer,jt),w=me(k,2),C=w[0],M=w[1],N=V(c.MonthYearSelectPopover,hr),B=me(N,2),T=B[0],x=B[1],A=V(c.MonthYearSelectStatefulMenu,sn),H=me(A,2),I=H[0],E=H[1];E.overrides=yr({List:{style:{height:"auto",maxHeight:"257px"}}},E&&E.overrides);var R=t.monthItems.findIndex(function(W){return W.id===t.dateHelpers.getMonth(a).toString()}),he=t.yearItems.findIndex(function(W){return W.id===t.dateHelpers.getYear(a).toString()}),oe="".concat(t.dateHelpers.getMonthInLocale(t.dateHelpers.getMonth(a),u)),we="".concat(t.dateHelpers.getYear(a));return t.isMultiMonthHorizontal()?g.createElement("div",null,"".concat(oe," ").concat(we)):g.createElement(g.Fragment,null,g.createElement(T,de({placement:"bottom",autoFocus:!0,focusLock:!0,isOpen:t.state.isMonthDropdownOpen,onClick:function(){t.setState(function(W){return{isMonthDropdownOpen:!W.isMonthDropdownOpen}})},onClickOutside:function(){return t.setState({isMonthDropdownOpen:!1})},onEsc:function(){return t.setState({isMonthDropdownOpen:!1})},content:function(){return g.createElement(I,de({initialState:{highlightedIndex:R,isFocused:!0},items:t.monthItems,onItemSelect:function(W){var Ae=W.item,d=W.event;d.preventDefault();var m=Nr(Ae.id),O=t.dateHelpers.set(a,{year:l,month:m});t.props.onMonthChange&&t.props.onMonthChange({date:O}),t.setState({isMonthDropdownOpen:!1})}},E))}},x),g.createElement(v,de({"aria-live":"polite",type:"button",$isFocusVisible:t.state.isFocusVisible,$density:D,onKeyUp:function(W){t.canArrowsOpenDropdown(W)&&t.setState({isMonthDropdownOpen:!0})},onKeyDown:function(W){t.canArrowsOpenDropdown(W)&&W.preventDefault(),W.key==="Tab"&&t.setState({isMonthDropdownOpen:!1})}},S),oe,g.createElement(C,M,g.createElement(gr,{title:"",overrides:{Svg:{props:{role:"presentation"}}},size:D===re.high?16:24})))),g.createElement(T,de({placement:"bottom",focusLock:!0,isOpen:t.state.isYearDropdownOpen,onClick:function(){t.setState(function(W){return{isYearDropdownOpen:!W.isYearDropdownOpen}})},onClickOutside:function(){return t.setState({isYearDropdownOpen:!1})},onEsc:function(){return t.setState({isYearDropdownOpen:!1})},content:function(){return g.createElement(I,de({initialState:{highlightedIndex:he,isFocused:!0},items:t.yearItems,onItemSelect:function(W){var Ae=W.item,d=W.event;d.preventDefault();var m=Nr(Ae.id),O=t.dateHelpers.set(a,{year:m,month:i});t.props.onYearChange&&t.props.onYearChange({date:O}),t.setState({isYearDropdownOpen:!1})}},E))}},x),g.createElement(v,de({"aria-live":"polite",type:"button",$isFocusVisible:t.state.isFocusVisible,$density:D,onKeyUp:function(W){t.canArrowsOpenDropdown(W)&&t.setState({isYearDropdownOpen:!0})},onKeyDown:function(W){t.canArrowsOpenDropdown(W)&&W.preventDefault(),W.key==="Tab"&&t.setState({isYearDropdownOpen:!1})}},S),we,g.createElement(C,M,g.createElement(gr,{title:"",overrides:{Svg:{props:{role:"presentation"}}},size:D===re.high?16:24})))))}),t.dateHelpers=new Me(o.adapter),t.monthItems=[],t.yearItems=[],t}return Po(n,[{key:"componentDidMount",value:function(){this.getYearItems(),this.getMonthItems()}},{key:"componentDidUpdate",value:function(o){var t=this.dateHelpers.getMonth(this.props.date)!==this.dateHelpers.getMonth(o.date),a=this.dateHelpers.getYear(this.props.date)!==this.dateHelpers.getYear(o.date);t&&this.getYearItems(),a&&this.getMonthItems()}},{key:"render",value:function(){var o=this,t=this.props,a=t.overrides,i=a===void 0?{}:a,l=t.density,p=V(i.CalendarHeader,Ct),u=me(p,2),b=u[0],c=u[1],D=V(i.MonthHeader,Mt),y=me(D,2),f=y[0],v=y[1],S=V(i.WeekdayHeader,Bt),k=me(S,2),w=k[0],C=k[1],M=this.dateHelpers.getStartOfWeek(this.getDateProp(),this.props.locale);return g.createElement(ln.Consumer,null,function(N){return g.createElement(Re.Consumer,null,function(B){return g.createElement(g.Fragment,null,g.createElement(b,de({},c,{$density:o.props.density,onFocus:cn(c,o.handleFocus),onBlur:un(c,o.handleBlur)}),o.renderPreviousMonthButton({locale:B,theme:N}),o.renderMonthYearDropdown(),o.renderNextMonthButton({locale:B,theme:N})),g.createElement(f,de({role:"presentation"},v),Er.map(function(T){var x=o.dateHelpers.addDays(M,T);return g.createElement(w,de({key:T,alt:o.dateHelpers.getWeekdayInLocale(x,o.props.locale)},C,{$density:l}),o.dateHelpers.getWeekdayMinInLocale(x,o.props.locale))})))})})}}]),n}(g.Component);ne(Yr,"defaultProps",{adapter:Pe,locale:null,maxDate:null,minDate:null,onYearChange:function(){},overrides:{}});function Yt(e){"@babel/helpers - typeof";return Yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Yt(e)}function $e(){return $e=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},$e.apply(this,arguments)}function Fe(e,r){return Lo(e)||Ro(e,r)||Io(e,r)||xo()}function xo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
6
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Io(e,r){if(e){if(typeof e=="string")return Vr(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vr(e,r)}}function Vr(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=new Array(r);n<r;n++)o[n]=e[n];return o}function Ro(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],t=!0,a=!1,i,l;try{for(n=n.call(e);!(t=(i=n.next()).done)&&(o.push(i.value),!(r&&o.length===r));t=!0);}catch(p){a=!0,l=p}finally{try{!t&&n.return!=null&&n.return()}finally{if(a)throw l}}return o}}function Lo(e){if(Array.isArray(e))return e}function Bo(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function To(e,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function $o(e,r,n){return r&&To(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fo(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&Vt(e,r)}function Vt(e,r){return Vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Vt(e,r)}function Wo(e){var r=Yo();return function(){var n=Je(e),o;if(r){var t=Je(this).constructor;o=Reflect.construct(n,arguments,t)}else o=n.apply(this,arguments);return No(this,o)}}function No(e,r){if(r&&(Yt(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return se(e)}function se(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Je(e){return Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Je(e)}function le(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var zr=function(e){Fo(n,e);var r=Wo(n);function n(o){var t;return Bo(this,n),t=r.call(this,o),le(se(t),"dayElm",void 0),le(se(t),"state",{isHovered:!1,isFocusVisible:!1}),le(se(t),"dateHelpers",void 0),le(se(t),"getDateProp",function(){return t.props.date===void 0?t.dateHelpers.date():t.props.date}),le(se(t),"getMonthProp",function(){return t.props.month===void 0||t.props.month===null?t.dateHelpers.getMonth(t.getDateProp()):t.props.month}),le(se(t),"onSelect",function(a){var i=t.props,l=i.range,p=i.value,u;if(Array.isArray(p)&&l&&t.props.hasLockedBehavior){var b=t.props.value,c=null,D=null;t.props.selectedInput===Se.startDate?(c=a,D=Array.isArray(b)&&b[1]?b[1]:null):t.props.selectedInput===Se.endDate&&(c=Array.isArray(b)&&b[0]?b[0]:null,D=a),u=[c],D&&u.push(D)}else if(Array.isArray(p)&&l&&!t.props.hasLockedBehavior){var y=Fe(p,2),f=y[0],v=y[1];!f&&!v||f&&v?u=[a,null]:!f&&v&&t.dateHelpers.isAfter(v,a)?u=[a,v]:!f&&v&&t.dateHelpers.isAfter(a,v)?u=[v,a]:f&&!v&&t.dateHelpers.isAfter(a,f)?u=[f,a]:u=[a,f]}else u=a;t.props.onSelect({date:u})}),le(se(t),"onKeyDown",function(a){var i=t.getDateProp(),l=t.props,p=l.highlighted,u=l.disabled;a.key==="Enter"&&p&&!u&&(a.preventDefault(),t.onSelect(i))}),le(se(t),"onClick",function(a){var i=t.getDateProp(),l=t.props.disabled;l||(t.props.onClick({event:a,date:i}),t.onSelect(i))}),le(se(t),"onFocus",function(a){fr(a)&&t.setState({isFocusVisible:!0}),t.props.onFocus({event:a,date:t.getDateProp()})}),le(se(t),"onBlur",function(a){t.state.isFocusVisible!==!1&&t.setState({isFocusVisible:!1}),t.props.onBlur({event:a,date:t.getDateProp()})}),le(se(t),"onMouseOver",function(a){t.setState({isHovered:!0}),t.props.onMouseOver({event:a,date:t.getDateProp()})}),le(se(t),"onMouseLeave",function(a){t.setState({isHovered:!1}),t.props.onMouseLeave({event:a,date:t.getDateProp()})}),le(se(t),"isOutsideMonth",function(){var a=t.getMonthProp();return a!==void 0&&a!==t.dateHelpers.getMonth(t.getDateProp())}),le(se(t),"getOrderedDates",function(){var a=t.props,i=a.highlightedDate,l=a.value;if(!l||!Array.isArray(l)||!l[0]||!l[1]&&!i)return[];var p=l[0],u=l.length>1&&l[1]?l[1]:i;if(!p||!u)return[];var b=t.clampToDayStart(p),c=t.clampToDayStart(u);return t.dateHelpers.isAfter(b,c)?[c,b]:[b,c]}),le(se(t),"isOutsideOfMonthButWithinRange",function(){var a=t.clampToDayStart(t.getDateProp()),i=t.getOrderedDates();if(i.length<2||t.dateHelpers.isSameDay(i[0],i[1]))return!1;var l=t.dateHelpers.getDate(a);if(l>15){var p=t.clampToDayStart(t.dateHelpers.addDays(t.dateHelpers.getEndOfMonth(a),1));return t.dateHelpers.isOnOrBeforeDay(i[0],t.dateHelpers.getEndOfMonth(a))&&t.dateHelpers.isOnOrAfterDay(i[1],p)}else{var u=t.clampToDayStart(t.dateHelpers.subDays(t.dateHelpers.getStartOfMonth(a),1));return t.dateHelpers.isOnOrAfterDay(i[1],t.dateHelpers.getStartOfMonth(a))&&t.dateHelpers.isOnOrBeforeDay(i[0],u)}}),le(se(t),"clampToDayStart",function(a){var i=t.dateHelpers,l=i.setSeconds,p=i.setMinutes,u=i.setHours;return l(p(u(a,0),0),0)}),t.dateHelpers=new Me(o.adapter),t}return $o(n,[{key:"componentDidMount",value:function(){this.dayElm&&this.props.focusedCalendar&&(this.props.highlighted||!this.props.highlightedDate&&this.isSelected())&&this.dayElm.focus()}},{key:"componentDidUpdate",value:function(o){this.dayElm&&this.props.focusedCalendar&&(this.props.highlighted||!this.props.highlightedDate&&this.isSelected())&&this.dayElm.focus()}},{key:"isSelected",value:function(){var o=this.getDateProp(),t=this.props.value;return Array.isArray(t)?this.dateHelpers.isSameDay(o,t[0])||this.dateHelpers.isSameDay(o,t[1]):this.dateHelpers.isSameDay(o,t)}},{key:"isPseudoSelected",value:function(){var o=this.getDateProp(),t=this.props.value;if(Array.isArray(t)){var a=Fe(t,2),i=a[0],l=a[1];if(!i&&!l)return!1;if(i&&l)return this.dateHelpers.isDayInRange(this.clampToDayStart(o),this.clampToDayStart(i),this.clampToDayStart(l))}}},{key:"isPseudoHighlighted",value:function(){var o=this.getDateProp(),t=this.props,a=t.value,i=t.highlightedDate;if(Array.isArray(a)){var l=Fe(a,2),p=l[0],u=l[1];if(!p&&!u)return!1;if(i&&p&&!u)return this.dateHelpers.isAfter(i,p)?this.dateHelpers.isDayInRange(this.clampToDayStart(o),this.clampToDayStart(p),this.clampToDayStart(i)):this.dateHelpers.isDayInRange(this.clampToDayStart(o),this.clampToDayStart(i),this.clampToDayStart(p));if(i&&!p&&u)return this.dateHelpers.isAfter(i,u)?this.dateHelpers.isDayInRange(this.clampToDayStart(o),this.clampToDayStart(u),this.clampToDayStart(i)):this.dateHelpers.isDayInRange(this.clampToDayStart(o),this.clampToDayStart(i),this.clampToDayStart(u))}}},{key:"getSharedProps",value:function(){var o=this.getDateProp(),t=this.props,a=t.value,i=t.highlightedDate,l=t.range,p=t.highlighted,u=t.peekNextMonth,b=p,c=this.isSelected(),D=!!(Array.isArray(a)&&l&&i&&(a[0]&&!a[1]&&!this.dateHelpers.isSameDay(a[0],i)||!a[0]&&a[1]&&!this.dateHelpers.isSameDay(a[1],i))),y=!u&&this.isOutsideMonth(),f=!!(Array.isArray(a)&&l&&y&&!u&&this.isOutsideOfMonthButWithinRange());return{$date:o,$density:this.props.density,$disabled:this.props.disabled,$endDate:Array.isArray(a)&&!!(a[0]&&a[1])&&l&&c&&this.dateHelpers.isSameDay(o,a[1])||!1,$hasDateLabel:!!this.props.dateLabel,$hasRangeHighlighted:D,$hasRangeOnRight:Array.isArray(a)&&D&&i&&(a[0]&&this.dateHelpers.isAfter(i,a[0])||a[1]&&this.dateHelpers.isAfter(i,a[1])),$hasRangeSelected:Array.isArray(a)?!!(a[0]&&a[1]):!1,$highlightedDate:i,$isHighlighted:b,$isHovered:this.state.isHovered,$isFocusVisible:this.state.isFocusVisible,$startOfMonth:this.dateHelpers.isStartOfMonth(o),$endOfMonth:this.dateHelpers.isEndOfMonth(o),$month:this.getMonthProp(),$outsideMonth:y,$outsideMonthWithinRange:f,$peekNextMonth:u,$pseudoHighlighted:l&&!b&&!c?this.isPseudoHighlighted():!1,$pseudoSelected:l&&!c?this.isPseudoSelected():!1,$range:l,$selected:c,$startDate:Array.isArray(a)&&a[0]&&a[1]&&l&&c?this.dateHelpers.isSameDay(o,a[0]):!1,$hasLockedBehavior:this.props.hasLockedBehavior,$selectedInput:this.props.selectedInput,$value:this.props.value}}},{key:"getAriaLabel",value:function(o,t){var a=this.getDateProp();return"".concat(o.$selected?o.$range?o.$endDate?t.datepicker.selectedEndDateLabel:t.datepicker.selectedStartDateLabel:t.datepicker.selectedLabel:o.$disabled?t.datepicker.dateNotAvailableLabel:t.datepicker.chooseLabel," ").concat(this.dateHelpers.format(a,"fullOrdinalWeek",this.props.locale),". ").concat(o.$disabled?"":t.datepicker.dateAvailableLabel)}},{key:"render",value:function(){var o=this,t=this.getDateProp(),a=this.props,i=a.peekNextMonth,l=a.overrides,p=l===void 0?{}:l,u=this.getSharedProps(),b=V(p.Day,Rt),c=Fe(b,2),D=c[0],y=c[1],f=V(p.DayLabel,Lt),v=Fe(f,2),S=v[0],k=v[1],w=this.props.dateLabel&&this.props.dateLabel(t);return!i&&u.$outsideMonth?g.createElement(D,$e({role:"gridcell"},u,y,{onFocus:this.onFocus,onBlur:this.onBlur})):g.createElement(Re.Consumer,null,function(C){return g.createElement(D,$e({"aria-label":o.getAriaLabel(u,C),ref:function(M){o.dayElm=M},role:"gridcell","aria-roledescription":"button",tabIndex:o.props.highlighted||!o.props.highlightedDate&&o.isSelected()?0:-1},u,y,{onFocus:o.onFocus,onBlur:o.onBlur,onClick:o.onClick,onKeyDown:o.onKeyDown,onMouseOver:o.onMouseOver,onMouseLeave:o.onMouseLeave}),g.createElement("div",null,o.dateHelpers.getDate(t)),w?g.createElement(S,$e({},u,k),w):null)})}}]),n}(g.Component);le(zr,"defaultProps",{disabled:!1,highlighted:!1,range:!1,adapter:Pe,onClick:function(){},onSelect:function(){},onFocus:function(){},onBlur:function(){},onMouseOver:function(){},onMouseLeave:function(){},overrides:{},peekNextMonth:!0,value:null});function zt(e){"@babel/helpers - typeof";return zt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},zt(e)}function _t(){return _t=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_t.apply(this,arguments)}function Vo(e,r){return qo(e)||Uo(e,r)||_o(e,r)||zo()}function zo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
7
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _o(e,r){if(e){if(typeof e=="string")return _r(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _r(e,r)}}function _r(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=new Array(r);n<r;n++)o[n]=e[n];return o}function Uo(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],t=!0,a=!1,i,l;try{for(n=n.call(e);!(t=(i=n.next()).done)&&(o.push(i.value),!(r&&o.length===r));t=!0);}catch(p){a=!0,l=p}finally{try{!t&&n.return!=null&&n.return()}finally{if(a)throw l}}return o}}function qo(e){if(Array.isArray(e))return e}function Ko(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Xo(e,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Qo(e,r,n){return r&&Xo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jo(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&Ut(e,r)}function Ut(e,r){return Ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Ut(e,r)}function Zo(e){var r=ea();return function(){var n=Ze(e),o;if(r){var t=Ze(this).constructor;o=Reflect.construct(n,arguments,t)}else o=n.apply(this,arguments);return Go(this,o)}}function Go(e,r){if(r&&(zt(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qt(e)}function qt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ea(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ze(e){return Ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ze(e)}function Kt(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var Ur=function(e){Jo(n,e);var r=Zo(n);function n(o){var t;return Ko(this,n),t=r.call(this,o),Kt(qt(t),"dateHelpers",void 0),Kt(qt(t),"renderDays",function(){var a=t.dateHelpers.getStartOfWeek(t.props.date||t.dateHelpers.date(),t.props.locale),i=[];return i.concat(Er.map(function(l){var p=t.dateHelpers.addDays(a,l);return g.createElement(zr,{adapter:t.props.adapter,date:p,dateLabel:t.props.dateLabel,density:t.props.density,disabled:t.dateHelpers.isDayDisabled(p,t.props),excludeDates:t.props.excludeDates,filterDate:t.props.filterDate,highlightedDate:t.props.highlightedDate,highlighted:t.dateHelpers.isSameDay(p,t.props.highlightedDate),includeDates:t.props.includeDates,focusedCalendar:t.props.focusedCalendar,range:t.props.range,key:l,locale:t.props.locale,minDate:t.props.minDate,maxDate:t.props.maxDate,month:t.props.month,onSelect:t.props.onChange,onBlur:t.props.onDayBlur,onFocus:t.props.onDayFocus,onClick:t.props.onDayClick,onMouseOver:t.props.onDayMouseOver,onMouseLeave:t.props.onDayMouseLeave,overrides:t.props.overrides,peekNextMonth:t.props.peekNextMonth,value:t.props.value,hasLockedBehavior:t.props.hasLockedBehavior,selectedInput:t.props.selectedInput})}))}),t.dateHelpers=new Me(o.adapter),t}return Qo(n,[{key:"render",value:function(){var o=this.props.overrides,t=o===void 0?{}:o,a=V(t.Week,xt),i=Vo(a,2),l=i[0],p=i[1];return g.createElement(l,_t({role:"row"},p),this.renderDays())}}]),n}(g.Component);Kt(Ur,"defaultProps",{adapter:Pe,highlightedDate:null,onDayClick:function(){},onDayFocus:function(){},onDayBlur:function(){},onDayMouseOver:function(){},onDayMouseLeave:function(){},onChange:function(){},overrides:{},peekNextMonth:!1});function Xt(e){"@babel/helpers - typeof";return Xt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Xt(e)}function ta(e,r){return aa(e)||oa(e,r)||na(e,r)||ra()}function ra(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
8
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function na(e,r){if(e){if(typeof e=="string")return qr(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qr(e,r)}}function qr(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=new Array(r);n<r;n++)o[n]=e[n];return o}function oa(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],t=!0,a=!1,i,l;try{for(n=n.call(e);!(t=(i=n.next()).done)&&(o.push(i.value),!(r&&o.length===r));t=!0);}catch(p){a=!0,l=p}finally{try{!t&&n.return!=null&&n.return()}finally{if(a)throw l}}return o}}function aa(e){if(Array.isArray(e))return e}function ia(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function sa(e,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function la(e,r,n){return r&&sa(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ua(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&Qt(e,r)}function Qt(e,r){return Qt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Qt(e,r)}function ca(e){var r=da();return function(){var n=Ge(e),o;if(r){var t=Ge(this).constructor;o=Reflect.construct(n,arguments,t)}else o=n.apply(this,arguments);return pa(this,o)}}function pa(e,r){if(r&&(Xt(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return We(e)}function We(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function da(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ge(e){return Ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ge(e)}function Ne(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var fa={dateLabel:null,density:re.high,excludeDates:null,filterDate:null,highlightDates:null,includeDates:null,locale:null,maxDate:null,minDate:null,month:null,adapter:Pe,onDayClick:function(){},onDayFocus:function(){},onDayBlur:function(){},onDayMouseOver:function(){},onDayMouseLeave:function(){},overrides:{},peekNextMonth:!1,value:null},ha=6,Kr=function(e){ua(n,e);var r=ca(n);function n(o){var t;return ia(this,n),t=r.call(this,o),Ne(We(t),"dateHelpers",void 0),Ne(We(t),"getDateProp",function(){return t.props.date||t.dateHelpers.date()}),Ne(We(t),"isWeekInMonth",function(a){var i=t.getDateProp(),l=t.dateHelpers.addDays(a,6);return t.dateHelpers.isSameMonth(a,i)||t.dateHelpers.isSameMonth(l,i)}),Ne(We(t),"renderWeeks",function(){for(var a=[],i=t.dateHelpers.getStartOfWeek(t.dateHelpers.getStartOfMonth(t.getDateProp()),t.props.locale),l=0,p=!0;p||t.props.fixedHeight&&t.props.peekNextMonth&&l<ha;)a.push(g.createElement(Ur,{adapter:t.props.adapter,date:i,dateLabel:t.props.dateLabel,density:t.props.density,excludeDates:t.props.excludeDates,filterDate:t.props.filterDate,highlightedDate:t.props.highlightedDate,includeDates:t.props.includeDates,focusedCalendar:t.props.focusedCalendar,range:t.props.range,key:l,locale:t.props.locale,minDate:t.props.minDate,maxDate:t.props.maxDate,month:t.dateHelpers.getMonth(t.getDateProp()),onDayBlur:t.props.onDayBlur,onDayFocus:t.props.onDayFocus,onDayClick:t.props.onDayClick,onDayMouseOver:t.props.onDayMouseOver,onDayMouseLeave:t.props.onDayMouseLeave,onChange:t.props.onChange,overrides:t.props.overrides,peekNextMonth:t.props.peekNextMonth,value:t.props.value,hasLockedBehavior:t.props.hasLockedBehavior,selectedInput:t.props.selectedInput})),l++,i=t.dateHelpers.addWeeks(i,1),p=t.isWeekInMonth(i);return a}),t.dateHelpers=new Me(o.adapter),t}return la(n,[{key:"render",value:function(){var o=this.props.overrides,t=o===void 0?{}:o,a=V(t.Month,Ht),i=ta(a,2),l=i[0],p=i[1];return g.createElement(l,p,this.renderWeeks())}}]),n}(g.Component);Ne(Kr,"defaultProps",fa);function Jt(e){"@babel/helpers - typeof";return Jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Jt(e)}var ya=["overrides"];function ga(e,r){if(e==null)return{};var n=ma(e,r),o,t;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(t=0;t<a.length;t++)o=a[t],!(r.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function ma(e,r){if(e==null)return{};var n={},o=Object.keys(e),t,a;for(a=0;a<o.length;a++)t=o[a],!(r.indexOf(t)>=0)&&(n[t]=e[t]);return n}function be(e,r){return Da(e)||ba(e,r)||Xr(e,r)||va()}function va(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
9
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ba(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],t=!0,a=!1,i,l;try{for(n=n.call(e);!(t=(i=n.next()).done)&&(o.push(i.value),!(r&&o.length===r));t=!0);}catch(p){a=!0,l=p}finally{try{!t&&n.return!=null&&n.return()}finally{if(a)throw l}}return o}}function Da(e){if(Array.isArray(e))return e}function Zt(e){return wa(e)||Oa(e)||Xr(e)||Sa()}function Sa(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
10
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xr(e,r){if(e){if(typeof e=="string")return Gt(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gt(e,r)}}function Oa(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wa(e){if(Array.isArray(e))return Gt(e)}function Gt(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=new Array(r);n<r;n++)o[n]=e[n];return o}function De(){return De=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},De.apply(this,arguments)}function ka(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Ca(e,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Ma(e,r,n){return r&&Ca(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pa(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&er(e,r)}function er(e,r){return er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},er(e,r)}function ja(e){var r=Aa();return function(){var n=et(e),o;if(r){var t=et(this).constructor;o=Reflect.construct(n,arguments,t)}else o=n.apply(this,arguments);return Ea(this,o)}}function Ea(e,r){if(r&&(Jt(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return J(e)}function J(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Aa(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function et(e){return et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},et(e)}function Z(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var Qr=function(e){Pa(n,e);var r=ja(n);function n(o){var t;ka(this,n),t=r.call(this,o),Z(J(t),"dateHelpers",void 0),Z(J(t),"calendar",void 0),Z(J(t),"getDateInView",function(){var c=t.props,D=c.highlightedDate,y=c.value,f=t.dateHelpers.getEffectiveMinDate(t.props),v=t.dateHelpers.getEffectiveMaxDate(t.props),S=t.dateHelpers.date(),k=t.getSingleDate(y)||D;return k||(f&&t.dateHelpers.isBefore(S,f)?f:v&&t.dateHelpers.isAfter(S,v)?v:S)}),Z(J(t),"handleMonthChange",function(c){t.setHighlightedDate(t.dateHelpers.getStartOfMonth(c)),t.props.onMonthChange&&t.props.onMonthChange({date:c})}),Z(J(t),"handleYearChange",function(c){t.setHighlightedDate(c),t.props.onYearChange&&t.props.onYearChange({date:c})}),Z(J(t),"changeMonth",function(c){var D=c.date;t.setState({date:D},function(){return t.handleMonthChange(t.state.date)})}),Z(J(t),"changeYear",function(c){var D=c.date;t.setState({date:D},function(){return t.handleYearChange(t.state.date)})}),Z(J(t),"renderCalendarHeader",function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:t.state.date,D=arguments.length>1?arguments[1]:void 0;return g.createElement(Yr,De({},t.props,{key:"month-header-".concat(D),date:c,order:D,onMonthChange:t.changeMonth,onYearChange:t.changeYear}))}),Z(J(t),"onKeyDown",function(c){switch(c.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"Home":case"End":case"PageUp":case"PageDown":t.handleArrowKey(c.key),c.preventDefault(),c.stopPropagation();break}}),Z(J(t),"handleArrowKey",function(c){var D=t.state.highlightedDate,y=D,f=t.dateHelpers.date();switch(c){case"ArrowLeft":y=t.dateHelpers.subDays(y||f,1);break;case"ArrowRight":y=t.dateHelpers.addDays(y||f,1);break;case"ArrowUp":y=t.dateHelpers.subWeeks(y||f,1);break;case"ArrowDown":y=t.dateHelpers.addWeeks(y||f,1);break;case"Home":y=t.dateHelpers.getStartOfWeek(y||f);break;case"End":y=t.dateHelpers.getEndOfWeek(y||f);break;case"PageUp":y=t.dateHelpers.subMonths(y||f,1);break;case"PageDown":y=t.dateHelpers.addMonths(y||f,1);break}t.setState({highlightedDate:y,date:y})}),Z(J(t),"focusCalendar",function(){t.state.focused||t.setState({focused:!0})}),Z(J(t),"blurCalendar",function(){if(typeof document<"u"){var c=document.activeElement;t.calendar&&!t.calendar.contains(c)&&t.setState({focused:!1})}}),Z(J(t),"handleTabbing",function(c){if(typeof document<"u"&&c.keyCode===9){var D=document.activeElement,y=t.state.rootElement?t.state.rootElement.querySelectorAll('[tabindex="0"]'):null,f=y?y.length:0;c.shiftKey?y&&D===y[0]&&(c.preventDefault(),y[f-1].focus()):y&&D===y[f-1]&&(c.preventDefault(),y[0].focus())}}),Z(J(t),"onDayFocus",function(c){var D=c.date;t.setState({highlightedDate:D}),t.focusCalendar(),t.props.onDayFocus&&t.props.onDayFocus(c)}),Z(J(t),"onDayMouseOver",function(c){var D=c.date;t.setState({highlightedDate:D}),t.props.onDayMouseOver&&t.props.onDayMouseOver(c)}),Z(J(t),"onDayMouseLeave",function(c){var D=c.date,y=t.props.value,f=t.getSingleDate(y);t.setState({highlightedDate:f||D}),t.props.onDayMouseLeave&&t.props.onDayMouseLeave(c)}),Z(J(t),"handleDateChange",function(c){var D=t.props.onChange,y=D===void 0?function(C){}:D,f=c.date;if(Array.isArray(c.date)){var v=Zt(t.state.time),S=c.date[0]?t.dateHelpers.applyDateToTime(v[0],c.date[0]):null,k=c.date[1]?t.dateHelpers.applyDateToTime(v[1],c.date[1]):null;v[0]=S,k?(f=[S,k],v[1]=k):f=[S],t.setState({time:v})}else if(!Array.isArray(t.props.value)&&c.date){var w=t.dateHelpers.applyDateToTime(t.state.time[0],c.date);f=w,t.setState({time:[w]})}y({date:f})}),Z(J(t),"handleTimeChange",function(c,D){var y=t.props.onChange,f=y===void 0?function(w){}:y,v=Zt(t.state.time);if(v[D]=t.dateHelpers.applyTimeToDate(v[D],c),t.setState({time:v}),Array.isArray(t.props.value)){var S=t.props.value.map(function(w,C){return w&&D===C?t.dateHelpers.applyTimeToDate(w,c):w});f({date:[S[0],S[1]]})}else{var k=t.dateHelpers.applyTimeToDate(t.props.value,c);f({date:k})}}),Z(J(t),"renderMonths",function(c){for(var D=t.props,y=D.overrides,f=y===void 0?{}:y,v=D.orientation,S=[],k=V(f.CalendarContainer,kt),w=be(k,2),C=w[0],M=w[1],N=V(f.MonthContainer,wt),B=be(N,2),T=B[0],x=B[1],A=0;A<(t.props.monthsShown||1);++A){var H=[],I=t.dateHelpers.addMonths(t.state.date,A),E="month-".concat(A);H.push(t.renderCalendarHeader(I,A)),H.push(g.createElement(C,De({key:E,ref:function(R){t.calendar=R},role:"grid","aria-roledescription":c.ariaRoleDescCalMonth,"aria-multiselectable":t.props.range||null,onKeyDown:t.onKeyDown},M,{$density:t.props.density}),g.createElement(Kr,{adapter:t.props.adapter,date:I,dateLabel:t.props.dateLabel,density:t.props.density,excludeDates:t.props.excludeDates,filterDate:t.props.filterDate,highlightedDate:t.state.highlightedDate,includeDates:t.props.includeDates,focusedCalendar:t.state.focused,range:t.props.range,locale:t.props.locale,maxDate:t.props.maxDate,minDate:t.props.minDate,month:t.dateHelpers.getMonth(t.state.date),onDayBlur:t.blurCalendar,onDayFocus:t.onDayFocus,onDayClick:t.props.onDayClick,onDayMouseOver:t.onDayMouseOver,onDayMouseLeave:t.onDayMouseLeave,onChange:t.handleDateChange,overrides:f,value:t.props.value,peekNextMonth:t.props.peekNextMonth,fixedHeight:t.props.fixedHeight,hasLockedBehavior:!!t.props.hasLockedBehavior,selectedInput:t.props.selectedInput}))),S.push(g.createElement("div",{key:"month-component-".concat(A)},H))}return g.createElement(T,De({$orientation:v},x),S)}),Z(J(t),"renderTimeSelect",function(c,D,y){var f=t.props.overrides,v=f===void 0?{}:f,S=V(v.TimeSelectContainer,Ke),k=be(S,2),w=k[0],C=k[1],M=V(v.TimeSelectFormControl,mt),N=be(M,2),B=N[0],T=N[1],x=V(v.TimeSelect,Sn),A=be(x,2),H=A[0],I=A[1];return g.createElement(w,C,g.createElement(B,De({label:y},T),g.createElement(H,De({value:c&&t.dateHelpers.date(c),onChange:D,nullable:!0},I))))}),Z(J(t),"renderQuickSelect",function(){var c=t.props.overrides,D=c===void 0?{}:c,y=V(D.QuickSelectContainer,Ke),f=be(y,2),v=f[0],S=f[1],k=V(D.QuickSelectFormControl,mt),w=be(k,2),C=w[0],M=w[1],N=V(D.QuickSelect,pn),B=be(N,2),T=B[0],x=B[1],A=x.overrides,H=ga(x,ya);if(!t.props.quickSelect)return null;var I=t.dateHelpers.set(t.dateHelpers.date(),{hours:12,minutes:0,seconds:0});return g.createElement(Re.Consumer,null,function(E){return g.createElement(v,S,g.createElement(C,De({label:E.datepicker.quickSelectLabel},M),g.createElement(T,De({"aria-label":E.datepicker.quickSelectAriaLabel,labelKey:"id",onChange:function(R){R.option?(t.setState({quickSelectId:R.option.id}),t.props.onChange&&(t.props.range?t.props.onChange({date:[R.option.beginDate,R.option.endDate||I]}):t.props.onChange({date:R.option.beginDate}))):(t.setState({quickSelectId:null}),t.props.onChange&&t.props.onChange({date:[]})),t.props.onQuickSelectChange&&t.props.onQuickSelectChange(R.option)},options:t.props.quickSelectOptions||[{id:E.datepicker.pastWeek,beginDate:t.dateHelpers.subWeeks(I,1)},{id:E.datepicker.pastMonth,beginDate:t.dateHelpers.subMonths(I,1)},{id:E.datepicker.pastThreeMonths,beginDate:t.dateHelpers.subMonths(I,3)},{id:E.datepicker.pastSixMonths,beginDate:t.dateHelpers.subMonths(I,6)},{id:E.datepicker.pastYear,beginDate:t.dateHelpers.subYears(I,1)},{id:E.datepicker.pastTwoYears,beginDate:t.dateHelpers.subYears(I,2)}],placeholder:E.datepicker.quickSelectPlaceholder,value:t.state.quickSelectId&&[{id:t.state.quickSelectId}],overrides:yr({Dropdown:{style:{textAlign:"start"}}},A)},H))))})});var a=t.props,i=a.highlightedDate,l=a.value,p=a.adapter;t.dateHelpers=new Me(p);var u=t.getDateInView(),b=[];return Array.isArray(l)?b=Zt(l):l&&(b=[l]),t.state={highlightedDate:t.getSingleDate(l)||(i&&t.dateHelpers.isSameMonth(u,i)?i:t.dateHelpers.date()),focused:!1,date:u,quickSelectId:null,rootElement:null,time:b},t}return Ma(n,[{key:"componentDidMount",value:function(){this.props.autoFocusCalendar&&this.focusCalendar()}},{key:"componentDidUpdate",value:function(o){if(this.props.highlightedDate&&!this.dateHelpers.isSameDay(this.props.highlightedDate,o.highlightedDate)&&this.setState({date:this.props.highlightedDate}),this.props.autoFocusCalendar&&this.props.autoFocusCalendar!==o.autoFocusCalendar&&this.focusCalendar(),o.value!==this.props.value){var t=this.getDateInView();this.isInView(t)||this.setState({date:t})}}},{key:"isInView",value:function(o){var t=this.state.date,a=this.dateHelpers.getYear(o)-this.dateHelpers.getYear(t),i=a*12+this.dateHelpers.getMonth(o)-this.dateHelpers.getMonth(t);return i>=0&&i<(this.props.monthsShown||1)}},{key:"getSingleDate",value:function(o){return Array.isArray(o)?o[0]||null:o}},{key:"setHighlightedDate",value:function(o){var t=this.props.value,a=this.getSingleDate(t),i;a&&this.dateHelpers.isSameMonth(a,o)&&this.dateHelpers.isSameYear(a,o)?i={highlightedDate:a}:i={highlightedDate:o},this.setState(i)}},{key:"render",value:function(){var o=this,t=this.props.overrides,a=t===void 0?{}:t,i=V(a.Root,Ot),l=be(i,2),p=l[0],u=l[1],b=[].concat(this.props.value),c=be(b,2),D=c[0],y=c[1];return g.createElement(Re.Consumer,null,function(f){return g.createElement(p,De({$density:o.props.density,"data-baseweb":"calendar",role:"application","aria-roledescription":"datepicker",ref:function(v){v&&v instanceof HTMLElement&&!o.state.rootElement&&o.setState({rootElement:v})},"aria-label":f.datepicker.ariaLabelCalendar,onKeyDown:o.props.trapTabbing?o.handleTabbing:null},u),o.renderMonths({ariaRoleDescCalMonth:f.datepicker.ariaRoleDescriptionCalendarMonth}),o.props.timeSelectStart&&o.renderTimeSelect(D,function(v){return o.handleTimeChange(v,0)},f.datepicker.timeSelectStartLabel),o.props.timeSelectEnd&&o.props.range&&o.renderTimeSelect(y,function(v){return o.handleTimeChange(v,1)},f.datepicker.timeSelectEndLabel),o.renderQuickSelect())})}}]),n}(g.Component);Z(Qr,"defaultProps",{autoFocusCalendar:!1,dateLabel:null,density:re.default,excludeDates:null,filterDate:null,highlightedDate:null,includeDates:null,range:!1,locale:null,maxDate:null,minDate:null,onDayClick:function(){},onDayFocus:function(){},onDayMouseOver:function(){},onDayMouseLeave:function(){},onMonthChange:function(){},onYearChange:function(){},onChange:function(){},orientation:ct.horizontal,overrides:{},peekNextMonth:!1,adapter:Pe,value:null,trapTabbing:!1});function tr(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.replace(/\${(.*?)}/g,function(n,o){return r[o]===void 0?"${"+o+"}":r[o]})}function rr(e){"@babel/helpers - typeof";return rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},rr(e)}function Ee(){return Ee=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ee.apply(this,arguments)}function Jr(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function Zr(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Jr(Object(n),!0).forEach(function(o){ue(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jr(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function nr(e){return Ia(e)||xa(e)||Gr(e)||Ha()}function Ha(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
11
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xa(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ia(e){if(Array.isArray(e))return ar(e)}function Ra(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function La(e,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Ba(e,r,n){return r&&La(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ta(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&or(e,r)}function or(e,r){return or=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},or(e,r)}function $a(e){var r=Wa();return function(){var n=tt(e),o;if(r){var t=tt(this).constructor;o=Reflect.construct(n,arguments,t)}else o=n.apply(this,arguments);return Fa(this,o)}}function Fa(e,r){if(r&&(rr(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ce(e)}function ce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wa(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function tt(e){return tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},tt(e)}function ue(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function ve(e,r){return Va(e)||Ya(e,r)||Gr(e,r)||Na()}function Na(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
12
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gr(e,r){if(e){if(typeof e=="string")return ar(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ar(e,r)}}function ar(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=new Array(r);n<r;n++)o[n]=e[n];return o}function Ya(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],t=!0,a=!1,i,l;try{for(n=n.call(e);!(t=(i=n.next()).done)&&(o.push(i.value),!(r&&o.length===r));t=!0);}catch(p){a=!0,l=p}finally{try{!t&&n.return!=null&&n.return()}finally{if(a)throw l}}return o}}function Va(e){if(Array.isArray(e))return e}var rt="yyyy/MM/dd",ye="\u2013",za=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,o=e,t=r.split(" ".concat(ye," ")),a=ve(t,2),i=a[0],l=i===void 0?"":i,p=a[1],u=p===void 0?"":p;return n===Se.startDate&&u&&(o="".concat(o," ").concat(ye," ").concat(u)),n===Se.endDate&&(o="".concat(l," ").concat(ye," ").concat(o)),o},en=function(e){Ta(n,e);var r=$a(n);function n(o){var t;return Ra(this,n),t=r.call(this,o),ue(ce(t),"calendar",void 0),ue(ce(t),"dateHelpers",void 0),ue(ce(t),"handleChange",function(a){var i=t.props.onChange,l=t.props.onRangeChange;Array.isArray(a)?(i&&a.every(Boolean)&&i({date:a}),l&&l({date:nr(a)})):(i&&i({date:a}),l&&l({date:a}))}),ue(ce(t),"onCalendarSelect",function(a){var i=!1,l=!1,p=!1,u=a.date;if(Array.isArray(u)&&t.props.range){if(!u[0]||!u[1])i=!0,l=!0,p=null;else if(u[0]&&u[1]){var b=u,c=ve(b,2),D=c[0],y=c[1];t.dateHelpers.isAfter(D,y)?t.hasLockedBehavior()?(u=t.props.value,i=!0):u=[D,D]:t.dateHelpers.dateRangeIncludesDates(u,t.props.excludeDates)&&(u=t.props.value,i=!0),t.state.lastActiveElm&&t.state.lastActiveElm.focus()}}else t.state.lastActiveElm&&t.state.lastActiveElm.focus();var f=function(S,k){if(!S||!k)return!1;var w=t.dateHelpers.format(S,"keyboardDate"),C=t.dateHelpers.format(k,"keyboardDate");return w===C?t.dateHelpers.getHours(S)!==t.dateHelpers.getHours(k)||t.dateHelpers.getMinutes(S)!==t.dateHelpers.getMinutes(k):!1},v=t.props.value;Array.isArray(u)&&Array.isArray(v)?u.some(function(S,k){return f(v[k],S)})&&(i=!0):!Array.isArray(u)&&!Array.isArray(v)&&f(v,u)&&(i=!0),t.setState(Zr(Zr({isOpen:i,isPseudoFocused:l},p===null?{}:{calendarFocused:p}),{},{inputValue:t.formatDisplayValue(u)})),t.handleChange(u)}),ue(ce(t),"formatDisplayValue",function(a){var i=t.props,l=i.displayValueAtRangeIndex,p=i.formatDisplayValue;i.range;var u=t.normalizeDashes(t.props.formatString);if(typeof l=="number"&&a&&Array.isArray(a)){var b=a[l];return p?p(b,u):t.formatDate(b,u)}return p?p(a,u):t.formatDate(a,u)}),ue(ce(t),"open",function(a){t.setState({isOpen:!0,isPseudoFocused:!0,calendarFocused:!1,selectedInput:a},t.props.onOpen)}),ue(ce(t),"close",function(){var a=!1;t.setState({isOpen:!1,selectedInput:null,isPseudoFocused:a,calendarFocused:!1},t.props.onClose)}),ue(ce(t),"handleEsc",function(){t.state.lastActiveElm&&t.state.lastActiveElm.focus(),t.close()}),ue(ce(t),"handleInputBlur",function(){t.state.isPseudoFocused||t.close()}),ue(ce(t),"getMask",function(){var a=t.props,i=a.formatString,l=a.mask,p=a.range,u=a.separateRangeInputs;return l===null||l===void 0&&i!==rt?null:l?t.normalizeDashes(l):p&&!u?"9999/99/99 ".concat(ye," 9999/99/99"):"9999/99/99"}),ue(ce(t),"handleInputChange",function(a,i){var l=t.props.range&&t.props.separateRangeInputs?za(a.currentTarget.value,t.state.inputValue,i):a.currentTarget.value,p=t.getMask(),u=t.normalizeDashes(t.props.formatString);(typeof p=="string"&&l===p.replace(/9/g," ")||l.length===0)&&(t.props.range?t.handleChange([]):t.handleChange(null)),t.setState({inputValue:l});var b=function(R){return u===rt?t.dateHelpers.parse(R,"slashDate",t.props.locale):t.dateHelpers.parseString(R,u,t.props.locale)};if(t.props.range&&typeof t.props.displayValueAtRangeIndex!="number"){var c=t.normalizeDashes(l).split(" ".concat(ye," ")),D=ve(c,2),y=D[0],f=D[1],v=t.dateHelpers.date(y),S=t.dateHelpers.date(f);u&&(v=b(y),S=b(f));var k=t.dateHelpers.isValid(v)&&t.dateHelpers.isValid(S),w=t.dateHelpers.isAfter(S,v)||t.dateHelpers.isEqual(v,S);k&&w&&t.handleChange([v,S])}else{var C=t.normalizeDashes(l),M=t.dateHelpers.date(C),N=t.props.formatString;C.replace(/(\s)*/g,"").length<N.replace(/(\s)*/g,"").length?M=null:M=b(C);var B=t.props,T=B.displayValueAtRangeIndex,x=B.range,A=B.value;if(M&&t.dateHelpers.isValid(M))if(x&&Array.isArray(A)&&typeof T=="number"){var H=ve(A,2),I=H[0],E=H[1];T===0?(I=M,E?t.dateHelpers.isAfter(E,I)||t.dateHelpers.isEqual(I,E)?t.handleChange([I,E]):t.handleChange(nr(A)):t.handleChange([I])):T===1&&(E=M,I?t.dateHelpers.isAfter(E,I)||t.dateHelpers.isEqual(I,E)?t.handleChange([I,E]):t.handleChange(nr(A)):t.handleChange([E,E]))}else t.handleChange(M)}}),ue(ce(t),"handleKeyDown",function(a){!t.state.isOpen&&a.keyCode===40?t.open():t.state.isOpen&&a.key==="ArrowDown"?(a.preventDefault(),t.focusCalendar()):t.state.isOpen&&a.keyCode===9&&t.close()}),ue(ce(t),"focusCalendar",function(){if(typeof document<"u"){var a=document.activeElement;t.setState({calendarFocused:!0,lastActiveElm:a})}}),ue(ce(t),"normalizeDashes",function(a){return a.replace(/-/g,ye).replace(/—/g,ye)}),ue(ce(t),"hasLockedBehavior",function(){return t.props.rangedCalendarBehavior===Zn.locked&&t.props.range&&t.props.separateRangeInputs}),t.dateHelpers=new Me(o.adapter),t.state={calendarFocused:!1,isOpen:!1,selectedInput:null,isPseudoFocused:!1,lastActiveElm:null,inputValue:t.formatDisplayValue(o.value)||""},t}return Ba(n,[{key:"getNullDatePlaceholder",value:function(o){return(this.getMask()||o).split(ye)[0].replace(/[0-9]|[a-z]/g," ")}},{key:"formatDate",value:function(o,t){var a=this,i=function(u){return t===rt?a.dateHelpers.format(u,"slashDate",a.props.locale):a.dateHelpers.formatDate(u,t,a.props.locale)};if(o){if(Array.isArray(o)&&!o[0]&&!o[1])return"";if(Array.isArray(o)&&!o[0]&&o[1]){var l=i(o[1]),p=this.getNullDatePlaceholder(t);return[p,l].join(" ".concat(ye," "))}else return Array.isArray(o)?o.map(function(u){return u?i(u):""}).join(" ".concat(ye," ")):i(o)}else return""}},{key:"componentDidUpdate",value:function(o){o.value!==this.props.value&&this.setState({inputValue:this.formatDisplayValue(this.props.value)})}},{key:"renderInputComponent",value:function(o,t){var a=this,i=this.props.overrides,l=i===void 0?{}:i,p=V(l.Input,jr),u=ve(p,2),b=u[0],c=u[1],D=this.props.placeholder||this.props.placeholder===""?this.props.placeholder:this.props.range&&!this.props.separateRangeInputs?"YYYY/MM/DD ".concat(ye," YYYY/MM/DD"):"YYYY/MM/DD",y=(this.state.inputValue||"").split(" ".concat(ye," ")),f=ve(y,2),v=f[0],S=v===void 0?"":v,k=f[1],w=k===void 0?"":k,C=t===Se.startDate?S:t===Se.endDate?w:this.state.inputValue;return g.createElement(b,Ee({"aria-disabled":this.props.disabled,"aria-label":this.props["aria-label"]||(this.props.range?o.datepicker.ariaLabelRange:o.datepicker.ariaLabel),error:this.props.error,positive:this.props.positive,"aria-describedby":this.props["aria-describedby"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":this.props.required||null,disabled:this.props.disabled,size:this.props.size,value:C,onFocus:function(){return a.open(t)},onBlur:this.handleInputBlur,onKeyDown:this.handleKeyDown,onChange:function(M){return a.handleInputChange(M,t)},placeholder:D,mask:this.getMask(),required:this.props.required,clearable:this.props.clearable},c))}},{key:"render",value:function(){var o=this,t=this.props,a=t.overrides,i=a===void 0?{}:a,l=t.startDateLabel,p=l===void 0?"Start Date":l,u=t.endDateLabel,b=u===void 0?"End Date":u,c=V(i.Popover,hr),D=ve(c,2),y=D[0],f=D[1],v=V(i.InputWrapper,vt),S=ve(v,2),k=S[0],w=S[1],C=V(i.StartDate,Dt),M=ve(C,2),N=M[0],B=M[1],T=V(i.EndDate,St),x=ve(T,2),A=x[0],H=x[1],I=V(i.InputLabel,bt),E=ve(I,2),R=E[0],he=E[1];return g.createElement(Re.Consumer,null,function(oe){return g.createElement(g.Fragment,null,g.createElement(y,Ee({accessibilityType:dn.none,focusLock:!1,autoFocus:!1,mountNode:o.props.mountNode,placement:mr.bottom,isOpen:o.state.isOpen,onClickOutside:o.close,onEsc:o.handleEsc,content:g.createElement(Qr,Ee({adapter:o.props.adapter,autoFocusCalendar:o.state.calendarFocused,trapTabbing:!0,value:o.props.value},o.props,{onChange:o.onCalendarSelect,selectedInput:o.state.selectedInput,hasLockedBehavior:o.hasLockedBehavior()}))},f),g.createElement(k,Ee({},w,{$separateRangeInputs:o.props.range&&o.props.separateRangeInputs}),o.props.range&&o.props.separateRangeInputs?g.createElement(g.Fragment,null,g.createElement(N,B,g.createElement(R,he,p),o.renderInputComponent(oe,Se.startDate)),g.createElement(A,H,g.createElement(R,he,b),o.renderInputComponent(oe,Se.endDate))):g.createElement(g.Fragment,null,o.renderInputComponent(oe)))),g.createElement("p",{id:o.props["aria-describedby"],style:{position:"fixed",width:"0px",height:"0px",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,padding:0,overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(100%)"}},oe.datepicker.screenReaderMessageInput),g.createElement("p",{"aria-live":"assertive",style:{position:"fixed",width:"0px",height:"0px",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,padding:0,overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(100%)"}},!o.props.value||Array.isArray(o.props.value)&&!o.props.value[0]&&!o.props.value[1]?"":Array.isArray(o.props.value)?o.props.value[0]&&o.props.value[1]?tr(oe.datepicker.selectedDateRange,{startDate:o.formatDisplayValue(o.props.value[0]),endDate:o.formatDisplayValue(o.props.value[1])}):"".concat(tr(oe.datepicker.selectedDate,{date:o.formatDisplayValue(o.props.value[0])})," ").concat(oe.datepicker.selectSecondDatePrompt):tr(oe.datepicker.selectedDate,{date:o.state.inputValue||""})))})}}]),n}(g.Component);ue(en,"defaultProps",{"aria-describedby":"datepicker--screenreader--message--input",value:null,formatString:rt,adapter:Pe});const _a={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"}},Ua=(e,r,n)=>{let o;const t=_a[e];return typeof t=="string"?o=t:r===1?o=t.one:o=t.other.replace("{{count}}",r.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+o:o+" ago":o};function ir(e){return(r={})=>{const n=r.width?String(r.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const qa={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ka={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Xa={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Qa={date:ir({formats:qa,defaultWidth:"full"}),time:ir({formats:Ka,defaultWidth:"full"}),dateTime:ir({formats:Xa,defaultWidth:"full"})},Ja={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Za=(e,r,n,o)=>Ja[e];function Ye(e){return(r,n)=>{const o=n!=null&&n.context?String(n.context):"standalone";let t;if(o==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):i;t=e.formattingValues[l]||e.formattingValues[i]}else{const i=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;t=e.values[l]||e.values[i]}const a=e.argumentCallback?e.argumentCallback(r):r;return t[a]}}const Ga={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ei={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ti={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"]},ri={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"]},ni={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"}},oi={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"}},ai=(e,r)=>{const n=Number(e),o=n%100;if(o>20||o<10)switch(o%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ii={ordinalNumber:ai,era:Ye({values:Ga,defaultWidth:"wide"}),quarter:Ye({values:ei,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ye({values:ti,defaultWidth:"wide"}),day:Ye({values:ri,defaultWidth:"wide"}),dayPeriod:Ye({values:ni,defaultWidth:"wide",formattingValues:oi,defaultFormattingWidth:"wide"})};function Ve(e){return(r,n={})=>{const o=n.width,t=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],a=r.match(t);if(!a)return null;const i=a[0],l=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],p=Array.isArray(l)?li(l,c=>c.test(i)):si(l,c=>c.test(i));let u;u=e.valueCallback?e.valueCallback(p):p,u=n.valueCallback?n.valueCallback(u):u;const b=r.slice(i.length);return{value:u,rest:b}}}function si(e,r){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&r(e[n]))return n}function li(e,r){for(let n=0;n<e.length;n++)if(r(e[n]))return n}function ui(e){return(r,n={})=>{const o=r.match(e.matchPattern);if(!o)return null;const t=o[0],a=r.match(e.parsePattern);if(!a)return null;let i=e.valueCallback?e.valueCallback(a[0]):a[0];i=n.valueCallback?n.valueCallback(i):i;const l=r.slice(t.length);return{value:i,rest:l}}}const ci=/^(\d+)(th|st|nd|rd)?/i,pi=/\d+/i,di={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},fi={any:[/^b/i,/^(a|c)/i]},hi={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},yi={any:[/1/i,/2/i,/3/i,/4/i]},gi={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},mi={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]},vi={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},bi={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]},Di={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},Si={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}},Oi={ordinalNumber:ui({matchPattern:ci,parsePattern:pi,valueCallback:e=>parseInt(e,10)}),era:Ve({matchPatterns:di,defaultMatchWidth:"wide",parsePatterns:fi,defaultParseWidth:"any"}),quarter:Ve({matchPatterns:hi,defaultMatchWidth:"wide",parsePatterns:yi,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ve({matchPatterns:gi,defaultMatchWidth:"wide",parsePatterns:mi,defaultParseWidth:"any"}),day:Ve({matchPatterns:vi,defaultMatchWidth:"wide",parsePatterns:bi,defaultParseWidth:"any"}),dayPeriod:Ve({matchPatterns:Di,defaultMatchWidth:"any",parsePatterns:Si,defaultParseWidth:"any"})},sr={code:"en-US",formatDistance:Ua,formatLong:Qa,formatRelative:Za,localize:ii,match:Oi,options:{weekStartsOn:0,firstWeekContainsDate:1}},tn=e=>{var r;return((r=e==null?void 0:e.getWeekInfo)==null?void 0:r.call(e))??(e==null?void 0:e.weekInfo)??null},wi=e=>{const r=g.useMemo(()=>{try{return tn(new Intl.Locale(e))}catch{return tn(new Intl.Locale("en-US"))}},[e]);if(!r)return sr;const n=r.firstDay===7?0:r.firstDay;return{...sr,options:{...sr.options,weekStartsOn:n}}},lr="YYYY/MM/DD";function nt(e){return e.map(r=>new Date(r))}function ki(e){return e?e.map(r=>ot(r).format(lr)):[]}function Ci({disabled:e,element:r,widgetMgr:n,fragmentId:o}){var t;const a=vr(),[i,l]=Dn({getStateFromWidgetMgr:Mi,getDefaultStateFromProto:Pi,getCurrStateFromProto:ji,updateWidgetMgrState:Ei,element:r,widgetMgr:n,fragmentId:o}),[p,u]=g.useState(!1),{colors:b,fontSizes:c,lineHeights:D,spacing:y,sizes:f}=vr(),{locale:v}=g.useContext(fn),S=wi(v),k=ot(r.min,lr).toDate(),w=Ai(r),C=r.default.length===0&&!e,M=g.useMemo(()=>r.format.replaceAll(/[a-zA-Z]/g,"9"),[r.format]),N=g.useMemo(()=>r.format.replaceAll("Y","y").replaceAll("D","d"),[r.format]),B=g.useCallback(({date:x})=>{if(hn(x)){l({value:[],fromUi:!0}),u(!0);return}const A=[];Array.isArray(x)?x.forEach(H=>{H&&A.push(H)}):A.push(x),l({value:A,fromUi:!0}),u(!A)},[l]),T=g.useCallback(()=>{if(!p)return;const x=nt(r.default);l({value:x,fromUi:!0}),u(!x)},[p,r,l]);return Le.jsxs("div",{className:"stDateInput","data-testid":"stDateInput",children:[Le.jsx(yn,{label:r.label,disabled:e,labelVisibility:gn((t=r.labelVisibility)==null?void 0:t.value),children:r.help&&Le.jsx(mn,{children:Le.jsx(vn,{content:r.help,placement:bn.TOP_RIGHT})})}),Le.jsx(en,{locale:S,density:re.high,formatString:N,mask:r.isRange?`${M} \u2013 ${M}`:M,placeholder:r.isRange?`${r.format} \u2013 ${r.format}`:r.format,disabled:e,onChange:B,onClose:T,overrides:{Popover:{props:{placement:mr.bottomLeft,overrides:{Body:{style:{marginTop:a.spacing.px}}}}},CalendarContainer:{style:{fontSize:c.sm,paddingRight:y.sm,paddingLeft:y.sm,paddingBottom:y.sm,paddingTop:y.sm}},Week:{style:{fontSize:c.sm}},Day:{style:({$pseudoHighlighted:x,$pseudoSelected:A,$selected:H,$isHovered:I})=>({fontSize:c.sm,lineHeight:D.base,"::before":{backgroundColor:H||A||x||I?`${b.darkenedBgMix15} !important`:b.transparent},"::after":{borderColor:b.transparent}})},PrevButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:b.transparent},":focus":{backgroundColor:b.transparent,outline:0}})},NextButton:{style:{display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:b.transparent},":focus":{backgroundColor:b.transparent,outline:0}}},Input:{props:{maskChar:null,overrides:{Root:{style:{borderLeftWidth:f.borderWidth,borderRightWidth:f.borderWidth,borderTopWidth:f.borderWidth,borderBottomWidth:f.borderWidth,paddingRight:y.twoXS}},ClearIcon:{props:{overrides:{Svg:{style:{color:b.darkGray,padding:y.threeXS,height:f.clearIconSize,width:f.clearIconSize,":hover":{fill:b.bodyText}}}}}},Input:{style:{paddingRight:y.sm,paddingLeft:y.md,paddingBottom:y.sm,paddingTop:y.sm,lineHeight:D.inputWidget},props:{"data-testid":"stDateInputField"}}}}}},value:i,minDate:k,maxDate:w,range:r.isRange,clearable:C})]})}function Mi(e,r){const n=e.getStringArrayValue(r),o=n!==void 0?n:r.default||[];return nt(o)}function Pi(e){return nt(e.default)??[]}function ji(e){return nt(e.value)??[]}function Ei(e,r,n,o){r.setStringArrayValue(e,ki(n.value),{fromUi:n.fromUi},o)}function Ai(e){const r=e.max;return r&&r.length>0?ot(r,lr).toDate():void 0}const Hi=g.memo(Ci);export{Hi as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c,r as b,bz as j,j as t,b5 as C,l as E}from"./index-NYCOzVlX.js";import{w as v,u as L,E as T}from"./withFullScreenWrapper-D7Ouz6kJ.js";import{S as p,T as W}from"./Toolbar-Ce_uRMJw.js";const y=c("div",{target:"e115fcil2"})(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:e.spacing.lg,maxWidth:"100%",width:"fit-content"}),""),F=c("div",{target:"e115fcil1"})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0,">img":{borderRadius:e.radii.default}}),""),M=c("div",{target:"e115fcil0"})(({theme:e})=>({textAlign:"center",marginTop:e.spacing.xs,wordWrap:"break-word",padding:e.spacing.threeXS}),""),S=E.getLogger("ImageList");function D({element:e,endpoints:g,disableFullscreenMode:h}){const x=j(e.imgs),{expanded:o,width:f,height:n,expand:u,collapse:w}=L(T),m=f||0;let s;const r=e.width;if([-1,-3,-4].includes(r))s=void 0;else if([-2,-5].includes(r))s=m;else if(r>0)s=r;else throw Error(`Invalid image width: ${r}`);const i={};n&&o?(i.maxHeight=n,i.objectFit="contain"):(i.width=s,i.maxWidth="100%");const I=d=>{const a=d.currentTarget.src;S.error(`Client Error: Image source error - ${a}`),g.sendClientErrorToHost("Image","Image source failed to load","onerror triggered",a)};return t.jsxs(p,{width:m,height:n,useContainerWidth:o,topCentered:!0,children:[t.jsx(W,{target:p,isFullScreen:o,onExpand:u,onCollapse:w,disableFullscreenMode:h}),t.jsx(y,{className:"stImage","data-testid":"stImage",children:x.map((d,a)=>{const l=d;return t.jsxs(F,{"data-testid":"stImageContainer",children:[t.jsx("img",{style:i,src:g.buildMediaURL(l.url),alt:a.toString(),onError:I}),l.caption&&t.jsx(M,{"data-testid":"stImageCaption",style:i,children:t.jsx(C,{source:l.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]},a)})})]})}const G=v(D),H=b.memo(G);export{H as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,j as s,cl as d,bZ as n}from"./index-NYCOzVlX.js";import{a as b}from"./useBasicWidgetState-vUy8Wspy.js";import"./FormClearHelper--a7FEpt-.js";const f=(e,l)=>e.getStringValue(l),p=e=>e.default??null,v=e=>e.value??null,S=(e,l,a,t)=>{l.setStringValue(e,a.value,{fromUi:a.fromUi},t)},c=({element:e,disabled:l,widgetMgr:a,fragmentId:t})=>{var r;const[g,i]=b({getStateFromWidgetMgr:f,getDefaultStateFromProto:p,getCurrStateFromProto:v,updateWidgetMgrState:S,element:e,widgetMgr:a,fragmentId:t}),m=o.useCallback(u=>{i({value:u,fromUi:!0})},[i]);return s.jsx(d,{label:e.label,labelVisibility:n((r=e.labelVisibility)==null?void 0:r.value),help:e.help,onChange:m,disabled:l,value:g})},h=o.memo(c);export{h as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,bO as k,A as w,cY as x,j as s,bY as D,bZ as E,cb as U,b_ as _,bH as A}from"./index-NYCOzVlX.js";import{u as B}from"./uniqueId-C8rYCZew.js";import{u as L,a as M,b as P}from"./useOnInputChange-Cl7V3cFN.js";import{I as O}from"./InputInstructions-GAhfSEnF.js";import{a as Y}from"./useBasicWidgetState-vUy8Wspy.js";import{T as G}from"./textarea-r4-zB_B9.js";import"./inputUtils-CQWz5UKz.js";import"./FormClearHelper--a7FEpt-.js";import"./base-input-BHEia47e.js";const W=(a,e)=>a.getStringValue(e)??e.default??null,K=a=>a.default??null,N=a=>a.value??null,Z=(a,e,i,d)=>{e.setStringValue(a,i.value,{fromUi:i.fromUi},d)},$=({disabled:a,element:e,widgetMgr:i,fragmentId:d})=>{var h;const b=r.useRef(B("text_area_")).current,[S,v]=k(),[l,m]=r.useState(!1),[I,c]=r.useState(!1),[o,n]=r.useState(()=>W(i,e)??null),C=r.useCallback(()=>{n(e.default??null),m(!0)},[e]),[T,u]=Y({getStateFromWidgetMgr:W,getDefaultStateFromProto:K,getCurrStateFromProto:N,updateWidgetMgrState:Z,element:e,widgetMgr:i,fragmentId:d,onFormCleared:C});L(T,o,n,l);const t=w(),g=r.useCallback(()=>{m(!1),u({value:o,fromUi:!0})},[o,u]),y=r.useCallback(()=>{l&&g(),c(!1)},[l,g]),F=r.useCallback(()=>{c(!0)},[]),j=M({formId:e.formId,maxChars:e.maxChars,setDirty:m,setUiValue:n,setValueWithSource:u}),z=P(e.formId,g,l,i,d,!0),{height:f,placeholder:H,formId:p}=e,R=x({formId:p})?i.allowFormEnterToSubmit(p):l,V=I&&S>t.breakpoints.hideWidgetDetails;return s.jsxs("div",{className:"stTextArea","data-testid":"stTextArea",ref:v,children:[s.jsx(D,{label:e.label,disabled:a,labelVisibility:E((h=e.labelVisibility)==null?void 0:h.value),htmlFor:b,children:e.help&&s.jsx(U,{children:s.jsx(_,{content:e.help,placement:A.TOP_RIGHT})})}),s.jsx(G,{value:o??"",placeholder:H,onBlur:y,onFocus:F,onChange:j,onKeyDown:z,"aria-label":e.label,disabled:a,id:b,overrides:{Input:{style:{lineHeight:t.lineHeights.inputWidget,height:f?`${f}px`:"",minHeight:t.sizes.largestElementHeight,resize:"vertical","::placeholder":{opacity:"0.7"},paddingRight:t.spacing.md,paddingLeft:t.spacing.md,paddingBottom:t.spacing.md,paddingTop:t.spacing.md}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:{borderLeftWidth:t.sizes.borderWidth,borderRightWidth:t.sizes.borderWidth,borderTopWidth:t.sizes.borderWidth,borderBottomWidth:t.sizes.borderWidth}}}}),V&&s.jsx(O,{dirty:l,value:o??"",maxLength:e.maxChars,type:"multiline",inForm:x({formId:p}),allowEnterToSubmit:R})]})},q=r.memo($);export{q as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,L as f,j as c,cE as v,bZ as h}from"./index-NYCOzVlX.js";import{a as S}from"./useBasicWidgetState-vUy8Wspy.js";import"./FormClearHelper--a7FEpt-.js";const V=(e,l)=>e.getIntValue(l),I=e=>e.default??null,M=e=>e.value??null,U=(e,l,t,a)=>{l.setIntValue(e,t.value,{fromUi:t.fromUi},a)},j=({disabled:e,element:l,widgetMgr:t,fragmentId:a})=>{const{options:s,help:u,label:d,labelVisibility:r,placeholder:m}=l,[n,o]=S({getStateFromWidgetMgr:V,getDefaultStateFromProto:I,getCurrStateFromProto:M,updateWidgetMgrState:U,element:l,widgetMgr:t,fragmentId:a}),g=i.useCallback(p=>{o({value:p,fromUi:!0})},[o]),b=f(l.default)&&!e;return c.jsx(v,{label:d,labelVisibility:h(r==null?void 0:r.value),options:s,disabled:e,onChange:g,value:n,help:u,placeholder:m,clearable:b})},x=i.memo(j);export{x as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as w,E as R,_ as E,c as x,I as q,j as h,b$ as Q,bH as z,bV as J,bC as Y,bW as O,c7 as _,e as Z,g as K,be as ee,A as te,c8 as re,c9 as ie,ca as se,R as ne,l as oe,b3 as ae,L as P,bS as le,bR as de,bY as ce,bZ as ue,cb as he,b_ as pe}from"./index-NYCOzVlX.js";import{a as V}from"./index-t--hEgTQ.js";import{F as ge}from"./FormClearHelper--a7FEpt-.js";import{U as L}from"./UploadFileInfo-C-jY39rj.js";import{P as fe,S as me}from"./ProgressBar-Col3VLE4.js";var D=w.forwardRef(function(i,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return w.createElement(R,E({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},i,{ref:l}),w.createElement("path",{d:"M.5 1c-.28 0-.5.23-.5.5v4c0 .28.23.5.5.5h5c.28 0 .5-.22.5-.5V4l1 1h1V2H7L6 3V1.5c0-.28-.22-.5-.5-.5h-5z"}))});D.displayName="Video";var W=w.forwardRef(function(i,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return w.createElement(R,E({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},i,{ref:l}),w.createElement("path",{d:"M1.41 0L0 1.41l.72.72L2.5 3.94.72 5.72 0 6.41l1.41 1.44.72-.72 1.81-1.81 1.78 1.81.69.72 1.44-1.44-.72-.69-1.81-1.78 1.81-1.81.72-.72L6.41 0l-.69.72L3.94 2.5 2.13.72 1.41 0z"}))});W.displayName="X";var $=w.forwardRef(function(i,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return w.createElement(R,E({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},i,{ref:l}),w.createElement("rect",{width:24,height:24,fill:"none"}),w.createElement("path",{d:"M20 5h-3.17l-1.24-1.35A1.99 1.99 0 0014.12 3H9.88c-.56 0-1.1.24-1.48.65L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-1.35 8.35l-2.79 2.79c-.32.32-.86.1-.86-.35v-1.75H9v1.75c0 .45-.54.67-.85.35l-2.79-2.79c-.2-.2-.2-.51 0-.71l2.79-2.79a.5.5 0 01.85.36v1.83h6v-1.83c0-.45.54-.67.85-.35l2.79 2.79c.2.19.2.51.01.7z"}))});$.displayName="SwitchCamera";function ve(i,l){switch(i){case"xsmall":return{padding:`${l.spacing.twoXS} ${l.spacing.sm}`,fontSize:l.fontSizes.sm};case"small":return{padding:`${l.spacing.twoXS} ${l.spacing.md}`};case"large":return{padding:`${l.spacing.md} ${l.spacing.md}`};default:return{padding:`${l.spacing.xs} ${l.spacing.md}`}}}const H=x("div",{target:"etz5kuj9"})({name:"b6gpc",styles:"position:relative;overflow:hidden;width:100%;object-fit:contain"}),T=x("div",{target:"etz5kuj8"})(({theme:i,width:l})=>({backgroundColor:i.colors.secondaryBg,borderRadius:`${i.radii.default} ${i.radii.default} 0 0`,width:"100%",height:l*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),""),ye=x("p",{target:"etz5kuj7"})(({theme:i})=>({marginTop:i.spacing.sm,textAlign:"center"}),""),Se=x("img",{target:"etz5kuj6"})(({theme:i,opacity:l})=>({borderRadius:`${i.radii.default} ${i.radii.default} 0 0`,objectFit:"contain",opacity:l}),""),be=x("a",{target:"etz5kuj5"})(({theme:i})=>({color:i.colors.primary,display:"block",textDecoration:"none"}),""),we=x("span",{target:"etz5kuj4"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),Me=x("div",{target:"etz5kuj3"})(({theme:i})=>({position:"absolute",top:i.spacing.lg,right:i.spacing.lg,zIndex:i.zIndices.priority,color:i.colors.fadedText40,mixBlendMode:"difference",opacity:.6}),""),Ue=x("div",{target:"etz5kuj1"})({name:"1yoks5w",styles:"height:fit-content;width:100%;position:absolute;bottom:0"}),Ce=x("button",{target:"etz5kuj0"})(({theme:i})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:i.colors.lightenedBg05,border:`${i.sizes.borderWidth} solid ${i.colors.borderColor}`,borderRadius:`0 0 ${i.radii.default} ${i.radii.default}`,"&:hover":{borderColor:i.colors.primary,color:i.colors.primary},"&:active":{color:i.colors.white,borderColor:i.colors.primary,backgroundColor:i.colors.primary},"&:focus:not(:active)":{borderColor:i.colors.primary,color:i.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:i.colors.fadedText40},fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,margin:i.spacing.none,lineHeight:i.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${q(i.colors.primary,.5)}`},...ve("medium",i)}),"");function A({disabled:i,onClick:l,children:e,progress:n}){return h.jsxs(Ce,{disabled:i||!1,onClick:l||(()=>{}),progress:n||null,"data-testid":"stCameraInputButton",children:[e,n?h.jsx(Ue,{children:h.jsx(fe,{value:n,size:me.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})}):null]})}var F=(i=>(i.USER="user",i.ENVIRONMENT="environment",i))(F||{});const xe=({switchFacingMode:i})=>h.jsx(Me,{"data-testid":"stCameraInputSwitchButton",children:h.jsx(Q,{content:"Switch camera",placement:z.TOP_RIGHT,children:h.jsx(J,{kind:Y.MINIMAL,onClick:i,children:h.jsx(O,{content:$,size:"twoXL",color:_.white})})})});var k={exports:{}},Ie=k.exports,N;function je(){return N||(N=1,function(i,l){(function(e,n){i.exports=n(Z())})(Ie,function(e){return function(n){var o={};function s(a){if(o[a])return o[a].exports;var p=o[a]={i:a,l:!1,exports:{}};return n[a].call(p.exports,p,p.exports,s),p.l=!0,p.exports}return s.m=n,s.c=o,s.d=function(a,p,y){s.o(a,p)||Object.defineProperty(a,p,{enumerable:!0,get:y})},s.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},s.t=function(a,p){if(p&1&&(a=s(a)),p&8||p&4&&typeof a=="object"&&a&&a.__esModule)return a;var y=Object.create(null);if(s.r(y),Object.defineProperty(y,"default",{enumerable:!0,value:a}),p&2&&typeof a!="string")for(var C in a)s.d(y,C,(function(U){return a[U]}).bind(null,C));return y},s.n=function(a){var p=a&&a.__esModule?function(){return a.default}:function(){return a};return s.d(p,"a",p),p},s.o=function(a,p){return Object.prototype.hasOwnProperty.call(a,p)},s.p="",s(s.s="./src/react-webcam.tsx")}({"./src/react-webcam.tsx":function(n,o,s){s.r(o);var a=s("react"),p=function(){var g=function(u,t){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,c){r.__proto__=c}||function(r,c){for(var d in c)c.hasOwnProperty(d)&&(r[d]=c[d])},g(u,t)};return function(u,t){g(u,t);function r(){this.constructor=u}u.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),y=function(){return y=Object.assign||function(g){for(var u,t=1,r=arguments.length;t<r;t++){u=arguments[t];for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&(g[c]=u[c])}return g},y.apply(this,arguments)},C=function(g,u){var t={};for(var r in g)Object.prototype.hasOwnProperty.call(g,r)&&u.indexOf(r)<0&&(t[r]=g[r]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,r=Object.getOwnPropertySymbols(g);c<r.length;c++)u.indexOf(r[c])<0&&Object.prototype.propertyIsEnumerable.call(g,r[c])&&(t[r[c]]=g[r[c]]);return t};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(g){var u=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return u?new Promise(function(t,r){u.call(navigator,g,t,r)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function U(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var I=function(g){p(u,g);function u(t){var r=g.call(this,t)||this;return r.canvas=null,r.ctx=null,r.requestUserMediaId=0,r.unmounted=!1,r.state={hasUserMedia:!1},r}return u.prototype.componentDidMount=function(){var t=this,r=t.state,c=t.props;if(this.unmounted=!1,!U()){c.onUserMediaError("getUserMedia not supported");return}r.hasUserMedia||this.requestUserMedia(),c.children&&typeof c.children!="function"&&console.warn("children must be a function")},u.prototype.componentDidUpdate=function(t){var r=this.props;if(!U()){r.onUserMediaError("getUserMedia not supported");return}var c=JSON.stringify(t.audioConstraints)!==JSON.stringify(r.audioConstraints),d=JSON.stringify(t.videoConstraints)!==JSON.stringify(r.videoConstraints),b=t.minScreenshotWidth!==r.minScreenshotWidth,v=t.minScreenshotHeight!==r.minScreenshotHeight;(d||b||v)&&(this.canvas=null,this.ctx=null),(c||d)&&(this.stopAndCleanup(),this.requestUserMedia())},u.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},u.stopMediaStream=function(t){t&&(t.getVideoTracks&&t.getAudioTracks?(t.getVideoTracks().map(function(r){t.removeTrack(r),r.stop()}),t.getAudioTracks().map(function(r){t.removeTrack(r),r.stop()})):t.stop())},u.prototype.stopAndCleanup=function(){var t=this.state;t.hasUserMedia&&(u.stopMediaStream(this.stream),t.src&&window.URL.revokeObjectURL(t.src))},u.prototype.getScreenshot=function(t){var r=this,c=r.state,d=r.props;if(!c.hasUserMedia)return null;var b=this.getCanvas(t);return b&&b.toDataURL(d.screenshotFormat,d.screenshotQuality)},u.prototype.getCanvas=function(t){var r=this,c=r.state,d=r.props;if(!this.video||!c.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var b=this.video.videoWidth,v=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var m=b/v;b=d.minScreenshotWidth||this.video.clientWidth,v=b/m,d.minScreenshotHeight&&v<d.minScreenshotHeight&&(v=d.minScreenshotHeight,b=v*m)}this.canvas=document.createElement("canvas"),this.canvas.width=(t==null?void 0:t.width)||b,this.canvas.height=(t==null?void 0:t.height)||v,this.ctx=this.canvas.getContext("2d")}var M=this,S=M.ctx,f=M.canvas;return S&&f&&(f.width=(t==null?void 0:t.width)||f.width,f.height=(t==null?void 0:t.height)||f.height,d.mirrored&&(S.translate(f.width,0),S.scale(-1,1)),S.imageSmoothingEnabled=d.imageSmoothing,S.drawImage(this.video,0,0,(t==null?void 0:t.width)||f.width,(t==null?void 0:t.height)||f.height),d.mirrored&&(S.scale(-1,1),S.translate(-f.width,0))),f},u.prototype.requestUserMedia=function(){var t=this,r=this.props,c=function(v,m){var M={video:typeof m<"u"?m:!0};r.audio&&(M.audio=typeof v<"u"?v:!0),t.requestUserMediaId++;var S=t.requestUserMediaId;navigator.mediaDevices.getUserMedia(M).then(function(f){t.unmounted||S!==t.requestUserMediaId?u.stopMediaStream(f):t.handleUserMedia(null,f)}).catch(function(f){t.handleUserMedia(f)})};if("mediaDevices"in navigator)c(r.audioConstraints,r.videoConstraints);else{var d=function(v){return{optional:[{sourceId:v}]}},b=function(v){var m=v.deviceId;return typeof m=="string"?m:Array.isArray(m)&&m.length>0?m[0]:typeof m=="object"&&m.ideal?m.ideal:null};MediaStreamTrack.getSources(function(v){var m=null,M=null;v.forEach(function(j){j.kind==="audio"?m=j.id:j.kind==="video"&&(M=j.id)});var S=b(r.audioConstraints);S&&(m=S);var f=b(r.videoConstraints);f&&(M=f),c(d(m),d(M))})}},u.prototype.handleUserMedia=function(t,r){var c=this.props;if(t||!r){this.setState({hasUserMedia:!1}),c.onUserMediaError(t);return}this.stream=r;try{this.video&&(this.video.srcObject=r),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(r)})}c.onUserMedia(r)},u.prototype.render=function(){var t=this,r=this,c=r.state,d=r.props,b=d.audio;d.forceScreenshotSourceSize;var v=d.disablePictureInPicture;d.onUserMedia,d.onUserMediaError,d.screenshotFormat,d.screenshotQuality,d.minScreenshotWidth,d.minScreenshotHeight,d.audioConstraints,d.videoConstraints,d.imageSmoothing;var m=d.mirrored,M=d.style,S=M===void 0?{}:M,f=d.children,j=C(d,["audio","forceScreenshotSourceSize","disablePictureInPicture","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),B=m?y(y({},S),{transform:(S.transform||"")+" scaleX(-1)"}):S,G={getScreenshot:this.getScreenshot.bind(this)};return a.createElement(a.Fragment,null,a.createElement("video",y({autoPlay:!0,disablePictureInPicture:v,src:c.src,muted:!b,playsInline:!0,ref:function(X){t.video=X},style:B},j)),f&&f(G))},u.defaultProps={audio:!1,disablePictureInPicture:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},u}(a.Component);o.default=I},react:function(n,o){n.exports=e}}).default})}(k)),k.exports}var Pe=je();const Fe=K(Pe),Re=({width:i})=>h.jsxs(T,{width:i,children:[h.jsx(O,{size:"threeXL",color:_.gray60,content:D}),h.jsxs(ye,{children:["This app would like to use your camera.",h.jsx(be,{href:ie,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),Ee=({handleCapture:i,width:l,disabled:e,clearPhotoInProgress:n,setClearPhotoInProgress:o,facingMode:s,setFacingMode:a,testOverride:p})=>{const[y,C]=w.useState(p||"pending"),U=w.useRef(null),[I,g]=w.useState(l),u=w.useCallback(ee(1e3,g),[]);w.useEffect(()=>{u(l)},[l,u]);function t(){if(U.current!==null){const c=U.current.getScreenshot();i(c)}}const r=te();return h.jsxs(H,{"data-testid":"stCameraInputWebcamComponent",children:[y!=="success"&&!e&&!n?h.jsx(Re,{width:I}):re.isMobile&&h.jsx(xe,{switchFacingMode:a}),h.jsx(T,{"data-testid":"stCameraInputWebcamStyledBox",hidden:y!=="success"&&!e&&!n,width:I,children:!e&&h.jsx(Fe,{audio:!1,ref:U,screenshotFormat:"image/jpeg",screenshotQuality:1,width:I,height:I*9/16,style:{borderRadius:`${r.radii.default} ${r.radii.default} 0 0`},onUserMediaError:()=>{C("error")},onUserMedia:()=>{C("success"),o(!1)},videoConstraints:{width:{ideal:I},facingMode:s}})}),h.jsx(A,{onClick:t,disabled:y!=="success"||e||n,children:"Take Photo"})]})},Oe=150,Te=oe.getLogger("CameraInput");class ke extends ne.PureComponent{constructor(l){super(l),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new ge,this.getProgress=()=>{if(this.state.files.length>0&&this.state.files[this.state.files.length-1].status.type==="uploading")return this.state.files[this.state.files.length-1].status.progress},this.setClearPhotoInProgress=e=>{this.setState({clearPhotoInProgress:e})},this.setFacingMode=()=>{this.setState(e=>({facingMode:e.facingMode===F.USER?F.ENVIRONMENT:F.USER}))},this.handleCapture=e=>{if(e===null)return Promise.resolve();this.setState({imgSrc:e,shutter:!0,minShutterEffectPassed:!1});const n=o=>new Promise(s=>setTimeout(s,o));return ze(e,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(o=>this.props.uploadClient.fetchFileURLs([o]).then(s=>({file:o,fileUrls:s[0]}))).then(({file:o,fileUrls:s})=>this.uploadFile(s,o)).then(()=>n(Oe)).then(()=>{this.setState((o,s)=>({imgSrc:e,shutter:o.shutter,minShutterEffectPassed:!0}))}).catch(o=>{Te.error(o)})},this.removeCapture=()=>{this.state.files.length!==0&&(this.state.files.forEach(e=>this.deleteFile(e.id)),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if(this.status!=="ready")return;const e=this.createWidgetValue(),{element:n,widgetMgr:o,fragmentId:s}=this.props,a=o.getFileUploaderStateValue(n);ae(e,a)||o.setFileUploaderStateValue(n,e,{fromUi:!0},s)},this.onFormCleared=()=>{this.setState({files:[]},()=>{const e=this.createWidgetValue();if(P(e))return;this.setState({imgSrc:null});const{widgetMgr:n,element:o,fragmentId:s}=this.props;n.setFileUploaderStateValue(o,e,{fromUi:!0},s)})},this.deleteFile=e=>{const n=this.getFile(e);P(n)||(n.status.type==="uploading"&&n.status.cancelToken.cancel(),n.status.type==="uploaded"&&n.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(n.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState(n=>({files:[...n.files,e]}))},this.removeFile=e=>{this.setState(n=>({files:n.files.filter(o=>o.id!==e)}))},this.getFile=e=>this.state.files.find(n=>n.id===e),this.updateFile=(e,n)=>{this.setState(o=>({files:o.files.map(s=>s.id===e?n:s)}))},this.onUploadComplete=(e,n)=>{this.setState(()=>({shutter:!1}));const o=this.getFile(e);P(o)||o.status.type!=="uploading"||this.updateFile(o.id,o.setStatus({type:"uploaded",fileId:n.fileId,fileUrls:n}))},this.onUploadProgress=(e,n)=>{const o=this.getFile(n);if(P(o)||o.status.type!=="uploading")return;const s=Math.round(e.loaded*100/e.total);o.status.progress!==s&&this.updateFile(n,o.setStatus({type:"uploading",cancelToken:o.status.cancelToken,progress:s}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(e,n)=>{const o=V.CancelToken.source(),s=new L(n.name,n.size,this.nextLocalFileId(),{type:"uploading",cancelToken:o,progress:1});this.addFile(s),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,n,a=>this.onUploadProgress(a,s.id),o.token).then(()=>this.onUploadComplete(s.id,e)).catch(a=>{V.isCancel(a)||this.updateFile(s.id,s.setStatus({type:"error",errorMessage:a?a.toString():"Unknown error"}))})},this.state=this.initialValue}get initialValue(){const l={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:F.USER},{widgetMgr:e,element:n}=this.props,o=e.getFileUploaderStateValue(n);if(P(o))return l;const{uploadedFileInfo:s}=o;return P(s)||s.length===0?l:{files:s.map(a=>{const p=a.name,y=a.size,C=a.fileId,U=a.fileUrls;return new L(p,y,this.nextLocalFileId(),{type:"uploaded",fileId:C,fileUrls:U})}),imgSrc:s.length===0?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:F.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){const l=e=>e.status.type==="uploading";return this.state.files.some(l)?"updating":"ready"}componentDidMount(){const l=this.createWidgetValue(),{element:e,widgetMgr:n,fragmentId:o}=this.props;n.getFileUploaderStateValue(e)===void 0&&n.setFileUploaderStateValue(e,l,{fromUi:!1},o)}createWidgetValue(){const l=this.state.files.filter(e=>e.status.type==="uploaded").map(e=>{const{name:n,size:o,status:s}=e;return new le({fileId:s.fileId,fileUrls:s.fileUrls,name:n,size:o})});return new de({uploadedFileInfo:l})}render(){var l;const{element:e,widgetMgr:n,disabled:o,width:s}=this.props;return this.formClearHelper.manageFormClearListener(n,e.formId,this.onFormCleared),h.jsxs(H,{className:"stCameraInput","data-testid":"stCameraInput",children:[h.jsx(ce,{label:e.label,disabled:o,labelVisibility:ue((l=e.labelVisibility)==null?void 0:l.value),children:e.help&&h.jsx(he,{children:h.jsx(pe,{content:e.help,placement:z.TOP_RIGHT})})}),this.state.imgSrc?h.jsxs(h.Fragment,{children:[h.jsx(T,{width:s,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&h.jsx(Se,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:s,height:s*9/16})}),h.jsx(A,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||o,children:this.getProgress()?"Uploading...":h.jsxs(we,{children:[h.jsx(O,{content:W,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):h.jsx(Ee,{handleCapture:this.handleCapture,width:s,disabled:o,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}function ze(i,l){return fetch(i).then(e=>e.arrayBuffer()).then(e=>new File([e],l,{type:"image/jpeg"}))}const _e=se(ke);export{_e as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{c0 as w,ci as be,c1 as O,r as c,A as me,j as m,bY as ge,c4 as ye,b_ as ve,bH as we,b5 as te,bZ as Oe}from"./index-NYCOzVlX.js";import{a as Re}from"./useBasicWidgetState-vUy8Wspy.js";import"./FormClearHelper--a7FEpt-.js";var re={vertical:"vertical",horizontal:"horizontal"};function oe(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),o.push.apply(o,r)}return o}function L(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?oe(Object(o),!0).forEach(function(r){R(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):oe(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}function R(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var P=0,x=1,E=2;function I(e){return e.$isActive?E:e.$isHovered?x:P}function ke(e){var t=e.$theme.colors,o=e.$disabled,r=e.$checked,n=e.$isFocusVisible,i=e.$error;if(o)return t.tickFillDisabled;if(r)if(i)switch(I(e)){case P:return t.tickFillErrorSelected;case x:return t.tickFillErrorSelectedHover;case E:return t.tickFillErrorSelectedHoverActive}else switch(I(e)){case P:return t.tickFillSelected;case x:return t.tickFillSelectedHover;case E:return t.tickFillSelectedHoverActive}else return n?t.borderSelected:i?t.tickBorderError:t.tickBorder;return null}function je(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(I(e)){case P:return t.tickFillError;case x:return t.tickFillErrorHover;case E:return t.tickFillErrorHoverActive}else switch(I(e)){case P:return t.tickFill;case x:return t.tickFillHover;case E:return t.tickFillActive}}function $e(e){var t=e.$labelPlacement,o=t===void 0?"":t,r=e.$theme,n;switch(o){case"top":n="Bottom";break;case"bottom":n="Top";break;case"left":n=r.direction==="rtl"?"Left":"Right";break;default:case"right":n=r.direction==="rtl"?"Right":"Left";break}var i=r.sizing,a=i.scale300;return R({},"padding".concat(n),a)}function Se(e){var t=e.$disabled,o=e.$theme,r=o.colors;return t?r.contentSecondary:r.contentPrimary}var H=w("div",function(e){var t=e.$disabled,o=e.$align;return{display:"flex",flexWrap:"wrap",flexDirection:o==="horizontal"?"row":"column",alignItems:o==="horizontal"?"center":"flex-start",cursor:t?"not-allowed":"pointer","-webkit-tap-highlight-color":"transparent"}});H.displayName="RadioGroupRoot",H.displayName="RadioGroupRoot";var V=w("label",function(e){var t,o=e.$disabled,r=e.$hasDescription,n=e.$labelPlacement,i=e.$theme,a=e.$align,s=i.sizing,u=a==="horizontal",d=i.direction==="rtl"?"Left":"Right";return t={flexDirection:n==="top"||n==="bottom"?"column":"row",display:"flex",alignItems:"center",cursor:o?"not-allowed":"pointer",marginTop:s.scale200},R(t,"margin".concat(d),u?s.scale200:null),R(t,"marginBottom",r&&!u?null:s.scale200),t});V.displayName="Root",V.displayName="Root";var _=w("div",function(e){var t=e.$theme,o=t.animation,r=t.sizing;return{backgroundColor:je(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",height:e.$checked?r.scale200:r.scale550,transitionDuration:o.timing200,transitionTimingFunction:o.easeOutCurve,width:e.$checked?r.scale200:r.scale550}});_.displayName="RadioMarkInner",_.displayName="RadioMarkInner";var N=w("div",function(e){var t=e.$theme,o=t.animation,r=t.sizing;return{alignItems:"center",backgroundColor:ke(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible&&e.$checked?"0 0 0 3px ".concat(e.$theme.colors.accent):"none",display:"flex",height:r.scale700,justifyContent:"center",marginTop:r.scale0,marginRight:r.scale0,marginBottom:r.scale0,marginLeft:r.scale0,outline:"none",verticalAlign:"middle",width:r.scale700,flexShrink:0,transitionDuration:o.timing200,transitionTimingFunction:o.easeOutCurve}});N.displayName="RadioMarkOuter",N.displayName="RadioMarkOuter";var U=w("div",function(e){var t=e.$theme.typography;return L(L({verticalAlign:"middle"},$e(e)),{},{color:Se(e)},t.LabelMedium)});U.displayName="Label",U.displayName="Label";var q=w("input",{width:0,height:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,clip:"rect(0 0 0 0)",position:"absolute"});q.displayName="Input",q.displayName="Input";var G=w("div",function(e){var t,o=e.$theme,r=e.$align,n=r==="horizontal",i=o.direction==="rtl"?"Right":"Left",a=o.direction==="rtl"?"Left":"Right";return L(L({},o.typography.ParagraphSmall),{},(t={color:o.colors.contentSecondary,cursor:"auto"},R(t,"margin".concat(i),r==="horizontal"?null:o.sizing.scale900),R(t,"margin".concat(a),n?o.sizing.scale200:null),R(t,"maxWidth","240px"),t))});G.displayName="Description",G.displayName="Description";function W(e){"@babel/helpers - typeof";return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(e)}function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},X.apply(this,arguments)}function Me(e,t){return Ee(e)||xe(e,t)||Pe(e,t)||Fe()}function Fe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pe(e,t){if(e){if(typeof e=="string")return ne(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(e);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return ne(e,t)}}function ne(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function xe(e,t){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var r=[],n=!0,i=!1,a,s;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!(t&&r.length===t));n=!0);}catch(u){i=!0,s=u}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}return r}}function Ee(e){if(Array.isArray(e))return e}function Le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ie(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ce(e,t,o){return t&&Ie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Te(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Y(e,t)}function Y(e,t){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},Y(e,t)}function Ae(e){var t=De();return function(){var o=T(e),r;if(t){var n=T(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return Be(this,r)}}function Be(e,t){if(t&&(W(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return C(e)}function C(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function De(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function T(e){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},T(e)}function A(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var ie=function(e){Te(o,e);var t=Ae(o);function o(){var r;Le(this,o);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),A(C(r),"state",{isFocusVisible:!1,focusedRadioIndex:-1}),A(C(r),"handleFocus",function(s,u){be(s)&&r.setState({isFocusVisible:!0}),r.setState({focusedRadioIndex:u}),r.props.onFocus&&r.props.onFocus(s)}),A(C(r),"handleBlur",function(s,u){r.state.isFocusVisible!==!1&&r.setState({isFocusVisible:!1}),r.setState({focusedRadioIndex:-1}),r.props.onBlur&&r.props.onBlur(s)}),r}return Ce(o,[{key:"render",value:function(){var r=this,n=this.props.overrides,i=n===void 0?{}:n,a=O(i.RadioGroupRoot,H),s=Me(a,2),u=s[0],d=s[1];return c.createElement(u,X({id:this.props.id,role:"radiogroup","aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props.error||null,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],$align:this.props.align,$disabled:this.props.disabled,$error:this.props.error,$required:this.props.required},d),c.Children.map(this.props.children,function(p,h){if(!c.isValidElement(p))return null;var l=r.props.value===p.props.value;return c.cloneElement(p,{align:r.props.align,autoFocus:r.props.autoFocus,checked:l,disabled:r.props.disabled||p.props.disabled,error:r.props.error,isFocused:r.state.focusedRadioIndex===h,isFocusVisible:r.state.isFocusVisible,tabIndex:h===0&&!r.props.value||l?"0":"-1",labelPlacement:r.props.labelPlacement,name:r.props.name,onBlur:function(f){return r.handleBlur(f,h)},onFocus:function(f){return r.handleFocus(f,h)},onChange:r.props.onChange,onMouseEnter:r.props.onMouseEnter,onMouseLeave:r.props.onMouseLeave})}))}}]),o}(c.Component);A(ie,"defaultProps",{name:"",value:"",disabled:!1,autoFocus:!1,labelPlacement:"right",align:"vertical",error:!1,required:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onFocus:function(){},onBlur:function(){},overrides:{}});function Z(e){"@babel/helpers - typeof";return Z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z(e)}function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},v.apply(this,arguments)}function $(e,t){return _e(e)||Ve(e,t)||He(e,t)||ze()}function ze(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function He(e,t){if(e){if(typeof e=="string")return ae(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(e);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return ae(e,t)}}function ae(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function Ve(e,t){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var r=[],n=!0,i=!1,a,s;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!(t&&r.length===t));n=!0);}catch(u){i=!0,s=u}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}return r}}function _e(e){if(Array.isArray(e))return e}function Ne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ue(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qe(e,t,o){return t&&Ue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ge(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&J(e,t)}function J(e,t){return J=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},J(e,t)}function We(e){var t=Ye();return function(){var o=B(e),r;if(t){var n=B(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return Xe(this,r)}}function Xe(e,t){if(t&&(Z(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return S(e)}function S(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ye(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function B(e){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},B(e)}function M(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function Ze(e){return e==="top"||e==="left"}function Je(e){return e==="bottom"||e==="right"}var Ke=function(e){return e.stopPropagation()},se=function(e){Ge(o,e);var t=We(o);function o(){var r;Ne(this,o);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),M(S(r),"state",{isActive:!1,isHovered:!1}),M(S(r),"onMouseEnter",function(s){r.setState({isHovered:!0}),r.props.onMouseEnter&&r.props.onMouseEnter(s)}),M(S(r),"onMouseLeave",function(s){r.setState({isHovered:!1}),r.props.onMouseLeave&&r.props.onMouseLeave(s)}),M(S(r),"onMouseDown",function(s){r.setState({isActive:!0}),r.props.onMouseDown&&r.props.onMouseDown(s)}),M(S(r),"onMouseUp",function(s){r.setState({isActive:!1}),r.props.onMouseUp&&r.props.onMouseUp(s)}),r}return qe(o,[{key:"componentDidMount",value:function(){var r;this.props.autoFocus&&(r=this.props.inputRef)!==null&&r!==void 0&&r.current&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var r=this.props.overrides,n=r===void 0?{}:r,i=O(n.Root,V),a=$(i,2),s=a[0],u=a[1],d=O(n.Label,U),p=$(d,2),h=p[0],l=p[1],f=O(n.Input,q),F=$(f,2),D=F[0],k=F[1],z=O(n.Description,G),b=$(z,2),g=b[0],y=b[1],le=O(n.RadioMarkInner,_),K=$(le,2),ce=K[0],ue=K[1],pe=O(n.RadioMarkOuter,N),Q=$(pe,2),fe=Q[0],de=Q[1],j={$align:this.props.align,$checked:this.props.checked,$disabled:this.props.disabled,$hasDescription:!!this.props.description,$isActive:this.state.isActive,$error:this.props.error,$isFocused:this.props.isFocused,$isFocusVisible:this.props.isFocused&&this.props.isFocusVisible,$isHovered:this.state.isHovered,$labelPlacement:this.props.labelPlacement,$required:this.props.required,$value:this.props.value},ee=c.createElement(h,v({},j,l),this.props.containsInteractiveElement?c.createElement("div",{onClick:function(he){return he.preventDefault()}},this.props.children):this.props.children);return c.createElement(c.Fragment,null,c.createElement(s,v({"data-baseweb":"radio",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},j,u),Ze(this.props.labelPlacement)&&ee,c.createElement(fe,v({},j,de),c.createElement(ce,v({},j,ue))),c.createElement(D,v({"aria-invalid":this.props.error||null,checked:this.props.checked,disabled:this.props.disabled,name:this.props.name,onBlur:this.props.onBlur,onFocus:this.props.onFocus,onClick:Ke,onChange:this.props.onChange,ref:this.props.inputRef,required:this.props.required,tabIndex:this.props.tabIndex,type:"radio",value:this.props.value},j,k)),Je(this.props.labelPlacement)&&ee),!!this.props.description&&c.createElement(g,v({},j,y),this.props.description))}}]),o}(c.Component);M(se,"defaultProps",{overrides:{},containsInteractiveElement:!1,checked:!1,disabled:!1,autoFocus:!1,inputRef:c.createRef(),align:"vertical",error:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});function Qe({disabled:e,horizontal:t,value:o,onChange:r,options:n,captions:i,label:a,labelVisibility:s,help:u}){const[d,p]=c.useState(o??null);c.useEffect(()=>{o!==d&&p(o??null)},[o]);const h=c.useCallback(b=>{const g=parseInt(b.target.value,10);p(g),r(g)},[r]),l=me(),f=i.length>0,F=n.length>0,D=F?n:["No options to select."],k=e||!F,z=b=>b==""&&t&&f?" ":b;return m.jsxs("div",{className:"stRadio","data-testid":"stRadio",children:[m.jsx(ge,{label:a,disabled:k,labelVisibility:s,children:u&&m.jsx(ye,{children:m.jsx(ve,{content:u,placement:we.TOP_RIGHT})})}),m.jsx(ie,{onChange:h,value:d!==null?d.toString():void 0,disabled:k,align:t?re.horizontal:re.vertical,"aria-label":a,"data-testid":"stRadioGroup",overrides:{RadioGroupRoot:{style:{gap:f?l.spacing.sm:l.spacing.none,minHeight:l.sizes.minElementHeight}}},children:D.map((b,g)=>m.jsxs(se,{value:g.toString(),overrides:{Root:{style:({$isFocusVisible:y})=>({marginBottom:l.spacing.none,marginTop:l.spacing.none,marginRight:f?l.spacing.sm:l.spacing.lg,paddingLeft:l.spacing.none,alignItems:"start",paddingRight:l.spacing.threeXS,backgroundColor:y?l.colors.darkenedBgMix25:""})},RadioMarkOuter:{style:({$checked:y})=>({width:l.sizes.checkbox,height:l.sizes.checkbox,marginTop:"0.35rem",marginRight:l.spacing.none,marginLeft:l.spacing.none,backgroundColor:y&&!k?l.colors.primary:l.colors.fadedText40})},RadioMarkInner:{style:({$checked:y})=>({height:y?"37.5%":`calc(${l.sizes.checkbox} - ${l.spacing.threeXS})`,width:y?"37.5%":`calc(${l.sizes.checkbox} - ${l.spacing.threeXS})`})},Label:{style:{color:k?l.colors.fadedText40:l.colors.bodyText,position:"relative",top:l.spacing.px}}},children:[m.jsx(te,{source:b,allowHTML:!1,isLabel:!0,largerLabel:!0}),f&&m.jsx(te,{source:z(i[g]),allowHTML:!1,isCaption:!0,isLabel:!0})]},g))})]})}const et=c.memo(Qe);function tt({disabled:e,element:t,widgetMgr:o,fragmentId:r}){const[n,i]=Re({getStateFromWidgetMgr:rt,getDefaultStateFromProto:ot,getCurrStateFromProto:nt,updateWidgetMgrState:it,element:t,widgetMgr:o,fragmentId:r}),a=c.useCallback(f=>{i({value:f,fromUi:!0})},[i]),{horizontal:s,options:u,captions:d,label:p,labelVisibility:h,help:l}=t;return m.jsx(et,{label:p,onChange:a,options:u,captions:d,disabled:e,horizontal:s,labelVisibility:Oe(h==null?void 0:h.value),value:n??null,help:l})}function rt(e,t){return e.getIntValue(t)}function ot(e){return e.default??null}function nt(e){return e.value??null}function it(e,t,o,r){t.setIntValue(e,o.value??null,{fromUi:o.fromUi},r)}const at=c.memo(tt);export{at as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as z,r as i,bO as H,A as P,cY as x,j as s,bY as D,bZ as E,cb as M,b_ as U,bH as _,cZ as B}from"./index-NYCOzVlX.js";import{u as L}from"./uniqueId-C8rYCZew.js";import{u as O,a as A,b as Y}from"./useOnInputChange-Cl7V3cFN.js";import{a as Z}from"./useBasicWidgetState-vUy8Wspy.js";import{I as G}from"./InputInstructions-GAhfSEnF.js";import{I as K}from"./input-DdxVQNZ7.js";import"./inputUtils-CQWz5UKz.js";import"./FormClearHelper--a7FEpt-.js";import"./base-input-BHEia47e.js";const N=z("div",{target:"e11y4ecf0"})({name:"bjn8wh",styles:"position:relative"});function q({disabled:t,element:e,widgetMgr:r,fragmentId:d}){var g;const[l,u]=i.useState(()=>S(r,e)??null),[W,y]=H(),[o,m]=i.useState(!1),I=i.useCallback(()=>{u(e.default??null),m(!0)},[e.default]),[v,p]=Z({getStateFromWidgetMgr:S,getDefaultStateFromProto:J,getCurrStateFromProto:Q,updateWidgetMgrState:X,element:e,widgetMgr:r,fragmentId:d,onFormCleared:I});O(v,l,u,o);const[C,b]=i.useState(!1),a=P(),[h]=i.useState(()=>L("text_input_")),{placeholder:T,formId:n,maxChars:f}=e,c=i.useCallback(()=>{m(!1),p({value:l,fromUi:!0})},[l,p]),j=x({formId:n})?r.allowFormEnterToSubmit(n):o,F=C&&W>a.breakpoints.hideWidgetDetails,w=i.useCallback(()=>{o&&c(),b(!1)},[o,c]),R=i.useCallback(()=>{b(!0)},[]),V=A({formId:n,maxChars:f,setDirty:m,setUiValue:u,setValueWithSource:p}),k=Y(n,c,o,r,d);return s.jsxs(N,{className:"stTextInput","data-testid":"stTextInput",ref:y,children:[s.jsx(D,{label:e.label,disabled:t,labelVisibility:E((g=e.labelVisibility)==null?void 0:g.value),htmlFor:h,children:e.help&&s.jsx(M,{children:s.jsx(U,{content:e.help,placement:_.TOP_RIGHT})})}),s.jsx(K,{value:l??"",placeholder:T,onBlur:w,onFocus:R,onChange:V,onKeyPress:k,"aria-label":e.label,disabled:t,id:h,type:$(e),autoComplete:e.autocomplete,overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:a.lineHeights.inputWidget,paddingRight:a.spacing.sm,paddingLeft:a.spacing.md,paddingBottom:a.spacing.sm,paddingTop:a.spacing.sm}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:a.sizes.minElementHeight,borderLeftWidth:a.sizes.borderWidth,borderRightWidth:a.sizes.borderWidth,borderTopWidth:a.sizes.borderWidth,borderBottomWidth:a.sizes.borderWidth}}}}),F&&s.jsx(G,{dirty:o,value:l??"",maxLength:f,inForm:x({formId:n}),allowEnterToSubmit:j})]})}function S(t,e){return t.getStringValue(e)??null}function J(t){return t.default??null}function Q(t){return t.value??null}function X(t,e,r,d){e.setStringValue(t,r.value,{fromUi:r.fromUi},d)}function $(t){return t.type===B.Type.PASSWORD?"password":"text"}const ee=i.memo(q);export{ee as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as w,r as l,A as C,cz as M,cA as W,j as n,bY as T,bZ as j,cb as k,b_ as A,bH as L,cy as B,cB as V,cu as $,cC as H,c8 as N}from"./index-NYCOzVlX.js";import{a as P}from"./useBasicWidgetState-vUy8Wspy.js";import"./FormClearHelper--a7FEpt-.js";const O=w("div",{target:"e6zijwc0"})(({theme:i})=>({"span[aria-disabled='true']":{background:i.colors.fadedText05}}),""),E=(i,a)=>i.getIntArrayValue(a),F=i=>i.default??null,G=i=>i.value??null,U=(i,a,t,p)=>{a.setIntArrayValue(i,t.value,{fromUi:t.fromUi},p)},D=i=>{var a;const{element:t,widgetMgr:p,fragmentId:S}=i,e=C(),[r,m]=P({getStateFromWidgetMgr:E,getDefaultStateFromProto:F,getCurrStateFromProto:G,updateWidgetMgrState:U,element:t,widgetMgr:p,fragmentId:S}),u=t.maxSelections>0&&r.length>=t.maxSelections,f=l.useMemo(()=>{if(t.maxSelections===0)return"No results";if(r.length===t.maxSelections){const o=t.maxSelections!==1?"options":"option";return`You can only select up to ${t.maxSelections} ${o}. Remove an option first.`}return"No results"},[t.maxSelections,r.length]),v=l.useMemo(()=>r.map(o=>{const s=t.options[o];return{value:o.toString(),label:s}}),[t.options,r]),h=l.useCallback(o=>{const s=()=>{var c;const g=(c=o.option)==null?void 0:c.value;return parseInt(g,10)};switch(o.type){case"remove":return M(r,s());case"clear":return[];case"select":return r.concat([s()]);default:throw new Error(`State transition is unknown: ${o.type}`)}},[r]),y=l.useCallback(o=>{t.maxSelections&&o.type==="select"&&r.length>=t.maxSelections||m({value:h(o),fromUi:!0})},[t.maxSelections,h,m,r.length]),x=l.useCallback((o,s)=>{if(u)return[];const c=o.filter(g=>!r.includes(Number(g.value)));return W(c,s)},[u,r]),{options:d}=t,b=d.length===0?!0:i.disabled,z=d.length===0?"No options to select.":t.placeholder,R=d.map((o,s)=>({label:o,value:s.toString()})),I=d.length>10;return n.jsxs("div",{className:"stMultiSelect","data-testid":"stMultiSelect",children:[n.jsx(T,{label:t.label,disabled:b,labelVisibility:j((a=t.labelVisibility)==null?void 0:a.value),children:t.help&&n.jsx(k,{children:n.jsx(A,{content:t.help,placement:L.TOP_RIGHT})})}),n.jsx(O,{children:n.jsx(B,{options:R,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:z,type:H.select,multi:!0,onChange:y,value:v,disabled:b,size:"compact",noResultsMsg:f,filterOptions:x,closeOnSelect:!1,overrides:{Popover:{props:{overrides:{Body:{style:()=>({marginTop:e.spacing.px})}}}},SelectArrow:{component:$,props:{overrides:{Svg:{style:()=>({width:e.iconSizes.xl,height:e.iconSizes.xl})}}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ControlContainer:{style:{minHeight:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}},Placeholder:{style:()=>({flex:"inherit",opacity:"0.7"})},ValueContainer:{style:()=>({paddingLeft:e.spacing.sm,paddingTop:e.spacing.none,paddingBottom:e.spacing.none,paddingRight:e.spacing.none})},ClearIcon:{props:{overrides:{Svg:{style:{color:e.colors.darkGray,padding:e.spacing.threeXS,height:e.sizes.clearIconSize,width:e.sizes.clearIconSize,cursor:"pointer",":hover":{fill:e.colors.bodyText}}}}}},SearchIcon:{style:{color:e.colors.darkGray}},Tag:{props:{overrides:{Root:{style:{borderTopLeftRadius:e.radii.md,borderTopRightRadius:e.radii.md,borderBottomRightRadius:e.radii.md,borderBottomLeftRadius:e.radii.md,fontSize:e.fontSizes.md,paddingLeft:e.spacing.sm,marginLeft:e.spacing.none,marginRight:e.spacing.sm,height:`calc(${e.sizes.minElementHeight} - 2 * ${e.spacing.xs})`,maxWidth:`calc(100% - ${e.spacing.lg})`,cursor:"default !important"}},Action:{style:{paddingLeft:0}},ActionIcon:{props:{overrides:{Svg:{style:{width:"0.625em",height:"0.625em"}}}}}}}},MultiValue:{props:{overrides:{Root:{style:{fontSize:e.fontSizes.sm}}}}},Input:{props:{readOnly:N.isMobile&&I===!1?"readonly":null}},Dropdown:{component:V}}})})]})},K=l.memo(D);export{K as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
function de(e,t){return function(){return e.apply(t,arguments)}}const{toString:Xe}=Object.prototype,{getPrototypeOf:Y}=Object,I=(e=>t=>{const n=Xe.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),A=e=>(e=e.toLowerCase(),t=>I(t)===e),z=e=>t=>typeof t===e,{isArray:F}=Array,B=z("undefined");function Ge(e){return e!==null&&!B(e)&&e.constructor!==null&&!B(e.constructor)&&T(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const pe=A("ArrayBuffer");function Qe(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&pe(e.buffer),t}const Ze=z("string"),T=z("function"),he=z("number"),H=e=>e!==null&&typeof e=="object",Ye=e=>e===!0||e===!1,J=e=>{if(I(e)!=="object")return!1;const t=Y(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},et=A("Date"),tt=A("File"),nt=A("Blob"),rt=A("FileList"),ot=e=>H(e)&&T(e.pipe),st=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||T(e.append)&&((t=I(e))==="formdata"||t==="object"&&T(e.toString)&&e.toString()==="[object FormData]"))},it=A("URLSearchParams"),[at,ct,lt,ut]=["ReadableStream","Request","Response","Headers"].map(A),ft=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function k(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),F(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(r=0;r<s;r++)l=i[r],t.call(null,e[l],l,e)}}function me(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const j=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,be=e=>!B(e)&&e!==j;function ee(){const{caseless:e}=be(this)&&this||{},t={},n=(r,o)=>{const i=e&&me(t,o)||o;J(t[i])&&J(r)?t[i]=ee(t[i],r):J(r)?t[i]=ee({},r):F(r)?t[i]=r.slice():t[i]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&k(arguments[r],n);return t}const dt=(e,t,n,{allOwnKeys:r}={})=>(k(t,(o,i)=>{n&&T(o)?e[i]=de(o,n):e[i]=o},{allOwnKeys:r}),e),pt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ht=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},mt=(e,t,n,r)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!r||r(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=n!==!1&&Y(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},bt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},gt=e=>{if(!e)return null;if(F(e))return e;let t=e.length;if(!he(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},yt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Y(Uint8Array)),wt=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const o=r.value;t.call(e,o[0],o[1])}},Et=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Rt=A("HTMLFormElement"),Ot=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,r){return n.toUpperCase()+r}),ge=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),St=A("RegExp"),ye=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};k(n,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(r[i]=s||o)}),Object.defineProperties(e,r)},Tt=e=>{ye(e,(t,n)=>{if(T(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(T(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},At=(e,t)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return F(e)?r(e):r(String(e).split(t)),n},xt=()=>{},Ct=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Nt(e){return!!(e&&T(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const jt=e=>{const t=new Array(10),n=(r,o)=>{if(H(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const i=F(r)?[]:{};return k(r,(s,l)=>{const p=n(s,o+1);!B(p)&&(i[l]=p)}),t[o]=void 0,i}}return r};return n(e,0)},vt=A("AsyncFunction"),Pt=e=>e&&(H(e)||T(e))&&T(e.then)&&T(e.catch),we=((e,t)=>e?setImmediate:t?((n,r)=>(j.addEventListener("message",({source:o,data:i})=>{o===j&&i===n&&r.length&&r.shift()()},!1),o=>{r.push(o),j.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",T(j.postMessage)),Ut=typeof queueMicrotask<"u"?queueMicrotask.bind(j):typeof process<"u"&&process.nextTick||we,a={isArray:F,isArrayBuffer:pe,isBuffer:Ge,isFormData:st,isArrayBufferView:Qe,isString:Ze,isNumber:he,isBoolean:Ye,isObject:H,isPlainObject:J,isReadableStream:at,isRequest:ct,isResponse:lt,isHeaders:ut,isUndefined:B,isDate:et,isFile:tt,isBlob:nt,isRegExp:St,isFunction:T,isStream:ot,isURLSearchParams:it,isTypedArray:yt,isFileList:rt,forEach:k,merge:ee,extend:dt,trim:ft,stripBOM:pt,inherits:ht,toFlatObject:mt,kindOf:I,kindOfTest:A,endsWith:bt,toArray:gt,forEachEntry:wt,matchAll:Et,isHTMLForm:Rt,hasOwnProperty:ge,hasOwnProp:ge,reduceDescriptors:ye,freezeMethods:Tt,toObjectSet:At,toCamelCase:Ot,noop:xt,toFiniteNumber:Ct,findKey:me,global:j,isContextDefined:be,isSpecCompliantForm:Nt,toJSONObject:jt,isAsyncFn:vt,isThenable:Pt,setImmediate:we,asap:Ut};function h(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}a.inherits(h,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const Ee=h.prototype,Re={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Re[e]={value:e}}),Object.defineProperties(h,Re),Object.defineProperty(Ee,"isAxiosError",{value:!0}),h.from=(e,t,n,r,o,i)=>{const s=Object.create(Ee);return a.toFlatObject(e,s,function(l){return l!==Error.prototype},l=>l!=="isAxiosError"),h.call(s,e.message,t,n,r,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const Ft=null;function te(e){return a.isPlainObject(e)||a.isArray(e)}function Oe(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Se(e,t,n){return e?e.concat(t).map(function(r,o){return r=Oe(r),!n&&o?"["+r+"]":r}).join(n?".":""):t}function _t(e){return a.isArray(e)&&!e.some(te)}const Lt=a.toFlatObject(a,{},null,function(e){return/^is[A-Z]/.test(e)});function W(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,b){return!a.isUndefined(b[f])});const r=n.metaTokens,o=n.visitor||c,i=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(o))throw new TypeError("visitor must be a function");function p(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(!l&&a.isBlob(f))throw new h("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?l&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function c(f,b,d){let O=f;if(f&&!d&&typeof f=="object"){if(a.endsWith(b,"{}"))b=r?b:b.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&_t(f)||(a.isFileList(f)||a.endsWith(b,"[]"))&&(O=a.toArray(f)))return b=Oe(b),O.forEach(function(E,y){!(a.isUndefined(E)||E===null)&&t.append(s===!0?Se([b],y,i):s===null?b:b+"[]",p(E))}),!1}return te(f)?!0:(t.append(Se(d,b,i),p(f)),!1)}const u=[],m=Object.assign(Lt,{defaultVisitor:c,convertValue:p,isVisitable:te});function g(f,b){if(!a.isUndefined(f)){if(u.indexOf(f)!==-1)throw Error("Circular reference detected in "+b.join("."));u.push(f),a.forEach(f,function(d,O){(!(a.isUndefined(d)||d===null)&&o.call(t,d,a.isString(O)?O.trim():O,b,m))===!0&&g(d,b?b.concat(O):[O])}),u.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Te(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function ne(e,t){this._pairs=[],e&&W(e,this,t)}const Ae=ne.prototype;Ae.append=function(e,t){this._pairs.push([e,t])},Ae.toString=function(e){const t=e?function(n){return e.call(this,n,Te)}:Te;return this._pairs.map(function(n){return t(n[0])+"="+t(n[1])},"").join("&")};function Bt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function xe(e,t,n){if(!t)return e;const r=n&&n.encode||Bt;a.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(o?i=o(t,n):i=a.isURLSearchParams(t)?t.toString():new ne(t,n).toString(r),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ce{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ne={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},kt=typeof URLSearchParams<"u"?URLSearchParams:ne,Dt=typeof FormData<"u"?FormData:null,qt=typeof Blob<"u"?Blob:null,Mt={isBrowser:!0,classes:{URLSearchParams:kt,FormData:Dt,Blob:qt},protocols:["http","https","file","blob","url","data"]},re=typeof window<"u"&&typeof document<"u",oe=typeof navigator=="object"&&navigator||void 0,It=re&&(!oe||["ReactNative","NativeScript","NS"].indexOf(oe.product)<0),zt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ht=re&&window.location.href||"http://localhost",Jt=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:re,hasStandardBrowserEnv:It,hasStandardBrowserWebWorkerEnv:zt,navigator:oe,origin:Ht},Symbol.toStringTag,{value:"Module"})),R={...Jt,...Mt};function Wt(e,t){return W(e,new R.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,i){return R.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Kt(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Vt(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}function je(e){function t(n,r,o,i){let s=n[i++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),p=i>=n.length;return s=!s&&a.isArray(o)?o.length:s,p?(a.hasOwnProp(o,s)?o[s]=[o[s],r]:o[s]=r,!l):((!o[s]||!a.isObject(o[s]))&&(o[s]=[]),t(n,r,o[s],i)&&a.isArray(o[s])&&(o[s]=Vt(o[s])),!l)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,o)=>{t(Kt(r),o,n,0)}),n}return null}function $t(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const D={transitional:Ne,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=a.isObject(e);if(o&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return r?JSON.stringify(je(e)):e;if(a.isArrayBuffer(e)||a.isBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e)||a.isReadableStream(e))return e;if(a.isArrayBufferView(e))return e.buffer;if(a.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Wt(e,this.formSerializer).toString();if((i=a.isFileList(e))||n.indexOf("multipart/form-data")>-1){const s=this.env&&this.env.FormData;return W(i?{"files[]":e}:e,s&&new s,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),$t(e)):e}],transformResponse:[function(e){const t=this.transitional||D.transitional,n=t&&t.forcedJSONParsing,r=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(n&&!this.responseType||r)){const o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(i){if(o)throw i.name==="SyntaxError"?h.from(i,h.ERR_BAD_RESPONSE,this,null,this.response):i}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:R.classes.FormData,Blob:R.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{D.headers[e]={}});const Xt=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Gt=e=>{const t={};let n,r,o;return e&&e.split(`
|
|
2
|
-
`).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||t[n]&&Xt[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ve=Symbol("internals");function q(e){return e&&String(e).trim().toLowerCase()}function K(e){return e===!1||e==null?e:a.isArray(e)?e.map(K):String(e)}function Qt(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Zt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function se(e,t,n,r,o){if(a.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function Yt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function en(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,i,s){return this[r].call(this,t,o,i,s)},configurable:!0})})}let S=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(s,l,p){const c=q(l);if(!c)throw new Error("header name must be a non-empty string");const u=a.findKey(r,c);(!u||r[u]===void 0||p===!0||p===void 0&&r[u]!==!1)&&(r[u||l]=K(s))}const i=(s,l)=>a.forEach(s,(p,c)=>o(p,c,l));if(a.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(a.isString(e)&&(e=e.trim())&&!Zt(e))i(Gt(e),t);else if(a.isHeaders(e))for(const[s,l]of e.entries())o(l,s,n);else e!=null&&o(t,e,n);return this}get(e,t){if(e=q(e),e){const n=a.findKey(this,e);if(n){const r=this[n];if(!t)return r;if(t===!0)return Qt(r);if(a.isFunction(t))return t.call(this,r,n);if(a.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=q(e),e){const n=a.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||se(this,this[n],n,t)))}return!1}delete(e,t){const n=this;let r=!1;function o(i){if(i=q(i),i){const s=a.findKey(n,i);s&&(!t||se(n,n[s],s,t))&&(delete n[s],r=!0)}}return a.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];(!e||se(this,this[o],o,e,!0))&&(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return a.forEach(this,(r,o)=>{const i=a.findKey(n,o);if(i){t[i]=K(r),delete t[o];return}const s=e?Yt(o):String(o).trim();s!==o&&delete t[o],t[s]=K(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return a.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&a.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
|
|
3
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(r=>n.set(r)),n}static accessor(e){const t=(this[ve]=this[ve]={accessors:{}}).accessors,n=this.prototype;function r(o){const i=q(o);t[i]||(en(n,o),t[i]=!0)}return a.isArray(e)?e.forEach(r):r(e),this}};S.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(S.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(S);function ie(e,t){const n=this||D,r=t||n,o=S.from(r.headers);let i=r.data;return a.forEach(e,function(s){i=s.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Pe(e){return!!(e&&e.__CANCEL__)}function _(e,t,n){h.call(this,e??"canceled",h.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(_,h,{__CANCEL__:!0});function Ue(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new h("Request failed with status code "+n.status,[h.ERR_BAD_REQUEST,h.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function tn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function nn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(l){const p=Date.now(),c=r[i];s||(s=p),n[o]=l,r[o]=p;let u=i,m=0;for(;u!==o;)m+=n[u++],u=u%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),p-s<t)return;const g=c&&p-c;return g?Math.round(m*1e3/g):void 0}}function rn(e,t){let n=0,r=1e3/t,o,i;const s=(l,p=Date.now())=>{n=p,o=null,i&&(clearTimeout(i),i=null),e.apply(null,l)};return[(...l)=>{const p=Date.now(),c=p-n;c>=r?s(l,p):(o=l,i||(i=setTimeout(()=>{i=null,s(o)},r-c)))},()=>o&&s(o)]}const V=(e,t,n=3)=>{let r=0;const o=nn(50,250);return rn(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,p=s-r,c=o(p),u=s<=l;r=s;const m={loaded:s,total:l,progress:l?s/l:void 0,bytes:p,rate:c||void 0,estimated:c&&l&&u?(l-s)/c:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(m)},n)},Fe=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},_e=e=>(...t)=>a.asap(()=>e(...t)),on=R.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,R.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(R.origin),R.navigator&&/(msie|trident)/i.test(R.navigator.userAgent)):()=>!0,sn=R.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),a.isString(r)&&s.push("path="+r),a.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function an(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function cn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Le(e,t,n){let r=!an(t);return e&&(r||n==!1)?cn(e,t):t}const Be=e=>e instanceof S?{...e}:e;function v(e,t){t=t||{};const n={};function r(c,u,m,g){return a.isPlainObject(c)&&a.isPlainObject(u)?a.merge.call({caseless:g},c,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function o(c,u,m,g){if(a.isUndefined(u)){if(!a.isUndefined(c))return r(void 0,c,m,g)}else return r(c,u,m,g)}function i(c,u){if(!a.isUndefined(u))return r(void 0,u)}function s(c,u){if(a.isUndefined(u)){if(!a.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function l(c,u,m){if(m in t)return r(c,u);if(m in e)return r(void 0,c)}const p={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(c,u,m)=>o(Be(c),Be(u),m,!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(c){const u=p[c]||o,m=u(e[c],t[c],c);a.isUndefined(m)&&u!==l||(n[c]=m)}),n}const ke=e=>{const t=v({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:l}=t;t.headers=s=S.from(s),t.url=xe(Le(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let p;if(a.isFormData(n)){if(R.hasStandardBrowserEnv||R.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((p=s.getContentType())!==!1){const[c,...u]=p?p.split(";").map(m=>m.trim()).filter(Boolean):[];s.setContentType([c||"multipart/form-data",...u].join("; "))}}if(R.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&on(t.url))){const c=o&&i&&sn.read(i);c&&s.set(o,c)}return t},ln=typeof XMLHttpRequest<"u",un=ln&&function(e){return new Promise(function(t,n){const r=ke(e);let o=r.data;const i=S.from(r.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:p}=r,c,u,m,g,f;function b(){g&&g(),f&&f(),r.cancelToken&&r.cancelToken.unsubscribe(c),r.signal&&r.signal.removeEventListener("abort",c)}let d=new XMLHttpRequest;d.open(r.method.toUpperCase(),r.url,!0),d.timeout=r.timeout;function O(){if(!d)return;const y=S.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),C={data:!s||s==="text"||s==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:y,config:e,request:d};Ue(function(L){t(L),b()},function(L){n(L),b()},C),d=null}"onloadend"in d?d.onloadend=O:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(O)},d.onabort=function(){d&&(n(new h("Request aborted",h.ECONNABORTED,e,d)),d=null)},d.onerror=function(){n(new h("Network Error",h.ERR_NETWORK,e,d)),d=null},d.ontimeout=function(){let y=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const C=r.transitional||Ne;r.timeoutErrorMessage&&(y=r.timeoutErrorMessage),n(new h(y,C.clarifyTimeoutError?h.ETIMEDOUT:h.ECONNABORTED,e,d)),d=null},o===void 0&&i.setContentType(null),"setRequestHeader"in d&&a.forEach(i.toJSON(),function(y,C){d.setRequestHeader(C,y)}),a.isUndefined(r.withCredentials)||(d.withCredentials=!!r.withCredentials),s&&s!=="json"&&(d.responseType=r.responseType),p&&([m,f]=V(p,!0),d.addEventListener("progress",m)),l&&d.upload&&([u,g]=V(l),d.upload.addEventListener("progress",u),d.upload.addEventListener("loadend",g)),(r.cancelToken||r.signal)&&(c=y=>{d&&(n(!y||y.type?new _(null,e,d):y),d.abort(),d=null)},r.cancelToken&&r.cancelToken.subscribe(c),r.signal&&(r.signal.aborted?c():r.signal.addEventListener("abort",c)));const E=tn(r.url);if(E&&R.protocols.indexOf(E)===-1){n(new h("Unsupported protocol "+E+":",h.ERR_BAD_REQUEST,e));return}d.send(o||null)})},fn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const i=function(c){if(!o){o=!0,l();const u=c instanceof Error?c:this.reason;r.abort(u instanceof h?u:new _(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new h(`timeout ${t} of ms exceeded`,h.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),e=null)};e.forEach(c=>c.addEventListener("abort",i));const{signal:p}=r;return p.unsubscribe=()=>a.asap(l),p}},dn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},pn=async function*(e,t){for await(const n of hn(e))yield*dn(n,t)},hn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},De=(e,t,n,r)=>{const o=pn(e,t);let i=0,s,l=p=>{s||(s=!0,r&&r(p))};return new ReadableStream({async pull(p){try{const{done:c,value:u}=await o.next();if(c){l(),p.close();return}let m=u.byteLength;if(n){let g=i+=m;n(g)}p.enqueue(new Uint8Array(u))}catch(c){throw l(c),c}},cancel(p){return l(p),o.return()}},{highWaterMark:2})},$=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",qe=$&&typeof ReadableStream=="function",mn=$&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Me=(e,...t)=>{try{return!!e(...t)}catch{return!1}},bn=qe&&Me(()=>{let e=!1;const t=new Request(R.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Ie=64*1024,ae=qe&&Me(()=>a.isReadableStream(new Response("").body)),X={stream:ae&&(e=>e.body)};$&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!X[t]&&(X[t]=a.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new h(`Response type '${t}' is not supported`,h.ERR_NOT_SUPPORT,r)})})})(new Response);const gn=async e=>{if(e==null)return 0;if(a.isBlob(e))return e.size;if(a.isSpecCompliantForm(e))return(await new Request(R.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(a.isArrayBufferView(e)||a.isArrayBuffer(e))return e.byteLength;if(a.isURLSearchParams(e)&&(e=e+""),a.isString(e))return(await mn(e)).byteLength},yn=async(e,t)=>a.toFiniteNumber(e.getContentLength())??gn(t),wn=$&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:s,onDownloadProgress:l,onUploadProgress:p,responseType:c,headers:u,withCredentials:m="same-origin",fetchOptions:g}=ke(e);c=c?(c+"").toLowerCase():"text";let f=fn([o,i&&i.toAbortSignal()],s),b;const d=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let O;try{if(p&&bn&&n!=="get"&&n!=="head"&&(O=await yn(u,r))!==0){let N=new Request(t,{method:"POST",body:r,duplex:"half"}),U;if(a.isFormData(r)&&(U=N.headers.get("content-type"))&&u.setContentType(U),N.body){const[Z,M]=Fe(O,V(_e(p)));r=De(N.body,Ie,Z,M)}}a.isString(m)||(m=m?"include":"omit");const E="credentials"in Request.prototype;b=new Request(t,{...g,signal:f,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:E?m:void 0});let y=await fetch(b);const C=ae&&(c==="stream"||c==="response");if(ae&&(l||C&&d)){const N={};["status","statusText","headers"].forEach(fe=>{N[fe]=y[fe]});const U=a.toFiniteNumber(y.headers.get("content-length")),[Z,M]=l&&Fe(U,V(_e(l),!0))||[];y=new Response(De(y.body,Ie,Z,()=>{M&&M(),d&&d()}),N)}c=c||"text";let L=await X[a.findKey(X,c)||"text"](y,e);return!C&&d&&d(),await new Promise((N,U)=>{Ue(N,U,{data:L,headers:S.from(y.headers),status:y.status,statusText:y.statusText,config:e,request:b})})}catch(E){throw d&&d(),E&&E.name==="TypeError"&&/fetch/i.test(E.message)?Object.assign(new h("Network Error",h.ERR_NETWORK,e,b),{cause:E.cause||E}):h.from(E,E&&E.code,e,b)}}),ce={http:Ft,xhr:un,fetch:wn};a.forEach(ce,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ze=e=>`- ${e}`,En=e=>a.isFunction(e)||e===null||e===!1,He={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){n=e[i];let s;if(r=n,!En(n)&&(r=ce[(s=String(n)).toLowerCase()],r===void 0))throw new h(`Unknown adapter '${s}'`);if(r)break;o[s||"#"+i]=r}if(!r){const i=Object.entries(o).map(([l,p])=>`adapter ${l} `+(p===!1?"is not supported by the environment":"is not available in the build"));let s=t?i.length>1?`since :
|
|
4
|
-
`+i.map(ze).join(`
|
|
5
|
-
`):" "+ze(i[0]):"as no adapter specified";throw new h("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:ce};function le(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new _(null,e)}function Je(e){return le(e),e.headers=S.from(e.headers),e.data=ie.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),He.getAdapter(e.adapter||D.adapter)(e).then(function(t){return le(e),t.data=ie.call(e,e.transformResponse,t),t.headers=S.from(t.headers),t},function(t){return Pe(t)||(le(e),t&&t.response&&(t.response.data=ie.call(e,e.transformResponse,t.response),t.response.headers=S.from(t.response.headers))),Promise.reject(t)})}const We="1.8.4",G={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{G[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ke={};G.transitional=function(e,t,n){function r(o,i){return"[Axios v"+We+"] Transitional option '"+o+"'"+i+(n?". "+n:"")}return(o,i,s)=>{if(e===!1)throw new h(r(i," has been removed"+(t?" in "+t:"")),h.ERR_DEPRECATED);return t&&!Ke[i]&&(Ke[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(o,i,s):!0}},G.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function Rn(e,t,n){if(typeof e!="object")throw new h("options must be an object",h.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const l=e[i],p=l===void 0||s(l,i,e);if(p!==!0)throw new h("option "+i+" must be "+p,h.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new h("Unknown option "+i,h.ERR_BAD_OPTION)}}const Q={assertOptions:Rn,validators:G},x=Q.validators;let P=class{constructor(e){this.defaults=e,this.interceptors={request:new Ce,response:new Ce}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const o=r.stack?r.stack.replace(/^.+\n/,""):"";try{n.stack?o&&!String(n.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
6
|
-
`+o):n.stack=o}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=v(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;n!==void 0&&Q.assertOptions(n,{silentJSONParsing:x.transitional(x.boolean),forcedJSONParsing:x.transitional(x.boolean),clarifyTimeoutError:x.transitional(x.boolean)},!1),r!=null&&(a.isFunction(r)?t.paramsSerializer={serialize:r}:Q.assertOptions(r,{encode:x.function,serialize:x.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Q.assertOptions(t,{baseUrl:x.spelling("baseURL"),withXsrfToken:x.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[t.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete o[f]}),t.headers=S.concat(i,o);const s=[];let l=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(t)===!1||(l=l&&f.synchronous,s.unshift(f.fulfilled,f.rejected))});const p=[];this.interceptors.response.forEach(function(f){p.push(f.fulfilled,f.rejected)});let c,u=0,m;if(!l){const f=[Je.bind(this),void 0];for(f.unshift.apply(f,s),f.push.apply(f,p),m=f.length,c=Promise.resolve(t);u<m;)c=c.then(f[u++],f[u++]);return c}m=s.length;let g=t;for(u=0;u<m;){const f=s[u++],b=s[u++];try{g=f(g)}catch(d){b.call(this,d);break}}try{c=Je.call(this,g)}catch(f){return Promise.reject(f)}for(u=0,m=p.length;u<m;)c=c.then(p[u++],p[u++]);return c}getUri(e){e=v(this.defaults,e);const t=Le(e.baseURL,e.url,e.allowAbsoluteUrls);return xe(t,e.params,e.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(e){P.prototype[e]=function(t,n){return this.request(v(n||{},{method:e,url:t,data:(n||{}).data}))}}),a.forEach(["post","put","patch"],function(e){function t(n){return function(r,o,i){return this.request(v(i||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}P.prototype[e]=t(),P.prototype[e+"Form"]=t(!0)});let On=class $e{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{r.subscribe(l),i=l}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},t(function(o,i,s){r.reason||(r.reason=new _(o,i,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new $e(function(n){t=n}),cancel:t}}};function Sn(e){return function(t){return e.apply(null,t)}}function Tn(e){return a.isObject(e)&&e.isAxiosError===!0}const ue={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ue).forEach(([e,t])=>{ue[t]=e});function Ve(e){const t=new P(e),n=de(P.prototype.request,t);return a.extend(n,P.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Ve(v(e,r))},n}const w=Ve(D);w.Axios=P,w.CanceledError=_,w.CancelToken=On,w.isCancel=Pe,w.VERSION=We,w.toFormData=W,w.AxiosError=h,w.Cancel=w.CanceledError,w.all=function(e){return Promise.all(e)},w.spread=Sn,w.isAxiosError=Tn,w.mergeConfig=v,w.AxiosHeaders=S,w.formToJSON=e=>je(a.isHTMLForm(e)?new FormData(e):e),w.getAdapter=He.getAdapter,w.HttpStatusCode=ue,w.default=w;const{Axios:An,AxiosError:xn,CanceledError:Cn,isCancel:Nn,CancelToken:jn,VERSION:vn,all:Pn,Cancel:Un,isAxiosError:Fn,spread:_n,toFormData:Ln,AxiosHeaders:Bn,HttpStatusCode:kn,formToJSON:Dn,getAdapter:qn,mergeConfig:Mn}=w;export{w as a};
|