arpeggi-framer-components 0.0.28 → 0.0.30

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.umd.js CHANGED
@@ -45,7 +45,7 @@ Valid keys: `+JSON.stringify(Object.keys(R),null," "));var b=Ee(P,N,$,K,M+"."+N
45
45
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ts(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ns(e){if(Array.isArray(e))return Ln(e)}function or(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),i.push.apply(i,n)}return i}function ar(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?or(Object(i),!0).forEach(function(n){sr(e,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):or(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}function sr(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function jt(e,t){return os(e)||rs(e,t)||cr(e,t)||is()}function is(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
46
46
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cr(e,t){if(e){if(typeof e=="string")return Ln(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Ln(e,t)}}function Ln(e,t){(t==null||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function rs(e,t){var i=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(i!=null){var n=[],r=!0,o=!1,a,s;try{for(i=i.call(e);!(r=(a=i.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(c){o=!0,s=c}finally{try{!r&&i.return!=null&&i.return()}finally{if(o)throw s}}return n}}function os(e){if(Array.isArray(e))return e}var as=typeof Bn=="function"?Bn:Bn.default,ss="file-invalid-type",cs="file-too-large",ls="file-too-small",ps="too-many-files",us=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",i=t.split(","),n=i.length>1?"one of ".concat(i.join(", ")):i[0];return{code:ss,message:"File type must be ".concat(n)}},lr=function(t){return{code:cs,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},pr=function(t){return{code:ls,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},ds={code:ps,message:"Too many files"};function ur(e,t){var i=e.type==="application/x-moz-file"||as(e,t);return[i,i?null:us(t)]}function dr(e,t,i){if(ot(e.size))if(ot(t)&&ot(i)){if(e.size>i)return[!1,lr(i)];if(e.size<t)return[!1,pr(t)]}else{if(ot(t)&&e.size<t)return[!1,pr(t)];if(ot(i)&&e.size>i)return[!1,lr(i)]}return[!0,null]}function ot(e){return e!=null}function fs(e){var t=e.files,i=e.accept,n=e.minSize,r=e.maxSize,o=e.multiple,a=e.maxFiles,s=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(c){var p=ur(c,i),l=jt(p,1),u=l[0],f=dr(c,n,r),x=jt(f,1),h=x[0],g=s?s(c):null;return u&&h&&!g})}function Qt(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function en(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function fr(e){e.preventDefault()}function ms(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function xs(e){return e.indexOf("Edge/")!==-1}function vs(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return ms(e)||xs(e)}function We(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return t.some(function(s){return!Qt(n)&&s&&s.apply(void 0,[n].concat(o)),Qt(n)})}}function gs(){return"showOpenFilePicker"in window}function hs(e){if(ot(e)){var t=Object.entries(e).filter(function(i){var n=jt(i,2),r=n[0],o=n[1],a=!0;return mr(r)||(console.warn('Skipped "'.concat(r,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),a=!1),(!Array.isArray(o)||!o.every(xr))&&(console.warn('Skipped "'.concat(r,'" because an invalid file extension was provided.')),a=!1),a}).reduce(function(i,n){var r=jt(n,2),o=r[0],a=r[1];return ar(ar({},i),{},sr({},o,a))},{});return[{description:"Files",accept:t}]}return e}function ys(e){if(ot(e))return Object.entries(e).reduce(function(t,i){var n=jt(i,2),r=n[0],o=n[1];return[].concat(rr(t),[r],rr(o))},[]).filter(function(t){return mr(t)||xr(t)}).join(",")}function bs(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function ws(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function mr(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function xr(e){return/^.*\.[\w]+$/.test(e)}var Es=["children"],Ss=["open"],Rs=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Ts=["refKey","onChange","onClick"];function ks(e){return _s(e)||Cs(e)||vr(e)||Os()}function Os(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
47
47
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cs(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _s(e){if(Array.isArray(e))return Mn(e)}function zn(e,t){return Ds(e)||js(e,t)||vr(e,t)||As()}function As(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
48
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vr(e,t){if(e){if(typeof e=="string")return Mn(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Mn(e,t)}}function Mn(e,t){(t==null||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function js(e,t){var i=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(i!=null){var n=[],r=!0,o=!1,a,s;try{for(i=i.call(e);!(r=(a=i.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(c){o=!0,s=c}finally{try{!r&&i.return!=null&&i.return()}finally{if(o)throw s}}return n}}function Ds(e){if(Array.isArray(e))return e}function gr(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),i.push.apply(i,n)}return i}function Te(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?gr(Object(i),!0).forEach(function(n){$n(e,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):gr(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}function $n(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function tn(e,t){if(e==null)return{};var i=Fs(e,t),n,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Fs(e,t){if(e==null)return{};var i={},n=Object.keys(e),r,o;for(o=0;o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&(i[r]=e[r]);return i}var Nn=w.forwardRef(function(e,t){var i=e.children,n=tn(e,Es),r=yr(n),o=r.open,a=tn(r,Ss);return w.useImperativeHandle(t,function(){return{open:o}},[o]),w.createElement(w.Fragment,null,i(Te(Te({},a),{},{open:o})))});Nn.displayName="Dropzone";var hr={disabled:!1,getFilesFromEvent:Wa,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};Nn.defaultProps=hr,Nn.propTypes={children:be.func,accept:be.objectOf(be.arrayOf(be.string)),multiple:be.bool,preventDropOnDocument:be.bool,noClick:be.bool,noKeyboard:be.bool,noDrag:be.bool,noDragEventsBubbling:be.bool,minSize:be.number,maxSize:be.number,maxFiles:be.number,disabled:be.bool,getFilesFromEvent:be.func,onFileDialogCancel:be.func,onFileDialogOpen:be.func,useFsAccessApi:be.bool,autoFocus:be.bool,onDragEnter:be.func,onDragLeave:be.func,onDragOver:be.func,onDrop:be.func,onDropAccepted:be.func,onDropRejected:be.func,onError:be.func,validator:be.func};var qn={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function yr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Te(Te({},hr),e),i=t.accept,n=t.disabled,r=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,c=t.maxFiles,p=t.onDragEnter,l=t.onDragLeave,u=t.onDragOver,f=t.onDrop,x=t.onDropAccepted,h=t.onDropRejected,g=t.onFileDialogCancel,E=t.onFileDialogOpen,m=t.useFsAccessApi,O=t.autoFocus,A=t.preventDropOnDocument,k=t.noClick,v=t.noKeyboard,C=t.noDrag,L=t.noDragEventsBubbling,j=t.onError,G=t.validator,Y=w.useMemo(function(){return ys(i)},[i]),ie=w.useMemo(function(){return hs(i)},[i]),re=w.useMemo(function(){return typeof E=="function"?E:br},[E]),Z=w.useMemo(function(){return typeof g=="function"?g:br},[g]),W=w.useRef(null),le=w.useRef(null),xe=w.useReducer(Ps,qn),we=zn(xe,2),ce=we[0],he=we[1],R=ce.isFocused,_=ce.isFileDialogActive,z=w.useRef(typeof window<"u"&&window.isSecureContext&&m&&gs()),q=function(){!z.current&&_&&setTimeout(function(){if(le.current){var D=le.current.files;D.length||(he({type:"closeDialog"}),Z())}},300)};w.useEffect(function(){return window.addEventListener("focus",q,!1),function(){window.removeEventListener("focus",q,!1)}},[le,_,Z,z]);var $=w.useRef([]),K=function(D){W.current&&W.current.contains(D.target)||(D.preventDefault(),$.current=[])};w.useEffect(function(){return A&&(document.addEventListener("dragover",fr,!1),document.addEventListener("drop",K,!1)),function(){A&&(document.removeEventListener("dragover",fr),document.removeEventListener("drop",K))}},[W,A]),w.useEffect(function(){return!n&&O&&W.current&&W.current.focus(),function(){}},[W,O,n]);var M=w.useCallback(function(S){j?j(S):console.error(S)},[j]),P=w.useCallback(function(S){S.preventDefault(),S.persist(),Re(S),$.current=[].concat(ks($.current),[S.target]),en(S)&&Promise.resolve(r(S)).then(function(D){if(!(Qt(S)&&!L)){var pe=D.length,ye=pe>0&&fs({files:D,accept:Y,minSize:a,maxSize:o,multiple:s,maxFiles:c,validator:G}),Oe=pe>0&&!ye;he({isDragAccept:ye,isDragReject:Oe,isDragActive:!0,type:"setDraggedFiles"}),p&&p(S)}}).catch(function(D){return M(D)})},[r,p,M,L,Y,a,o,s,c,G]),H=w.useCallback(function(S){S.preventDefault(),S.persist(),Re(S);var D=en(S);if(D&&S.dataTransfer)try{S.dataTransfer.dropEffect="copy"}catch{}return D&&u&&u(S),!1},[u,L]),J=w.useCallback(function(S){S.preventDefault(),S.persist(),Re(S);var D=$.current.filter(function(ye){return W.current&&W.current.contains(ye)}),pe=D.indexOf(S.target);pe!==-1&&D.splice(pe,1),$.current=D,!(D.length>0)&&(he({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),en(S)&&l&&l(S))},[W,l,L]),N=w.useCallback(function(S,D){var pe=[],ye=[];S.forEach(function(Oe){var et=ur(Oe,Y),Je=zn(et,2),dt=Je[0],Mt=Je[1],$t=dr(Oe,a,o),St=zn($t,2),Nt=St[0],qt=St[1],Wt=G?G(Oe):null;if(dt&&Nt&&!Wt)pe.push(Oe);else{var Ut=[Mt,qt];Wt&&(Ut=Ut.concat(Wt)),ye.push({file:Oe,errors:Ut.filter(function(Vt){return Vt})})}}),(!s&&pe.length>1||s&&c>=1&&pe.length>c)&&(pe.forEach(function(Oe){ye.push({file:Oe,errors:[ds]})}),pe.splice(0)),he({acceptedFiles:pe,fileRejections:ye,isDragReject:ye.length>0,type:"setFiles"}),f&&f(pe,ye,D),ye.length>0&&h&&h(ye,D),pe.length>0&&x&&x(pe,D)},[he,s,Y,a,o,c,f,x,h,G]),Ee=w.useCallback(function(S){S.preventDefault(),S.persist(),Re(S),$.current=[],en(S)&&Promise.resolve(r(S)).then(function(D){Qt(S)&&!L||N(D,S)}).catch(function(D){return M(D)}),he({type:"reset"})},[r,N,M,L]),b=w.useCallback(function(){if(z.current){he({type:"openDialog"}),re();var S={multiple:s,types:ie};window.showOpenFilePicker(S).then(function(D){return r(D)}).then(function(D){N(D,null),he({type:"closeDialog"})}).catch(function(D){bs(D)?(Z(D),he({type:"closeDialog"})):ws(D)?(z.current=!1,le.current?(le.current.value=null,le.current.click()):M(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):M(D)});return}le.current&&(he({type:"openDialog"}),re(),le.current.value=null,le.current.click())},[he,re,Z,m,N,M,ie,s]),I=w.useCallback(function(S){!W.current||!W.current.isEqualNode(S.target)||(S.key===" "||S.key==="Enter"||S.keyCode===32||S.keyCode===13)&&(S.preventDefault(),b())},[W,b]),Q=w.useCallback(function(){he({type:"focus"})},[]),U=w.useCallback(function(){he({type:"blur"})},[]),ve=w.useCallback(function(){k||(vs()?setTimeout(b,0):b())},[k,b]),ke=function(D){return n?null:D},te=function(D){return v?null:ke(D)},ne=function(D){return C?null:ke(D)},Re=function(D){L&&D.stopPropagation()},Ye=w.useMemo(function(){return function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=S.refKey,pe=D===void 0?"ref":D,ye=S.role,Oe=S.onKeyDown,et=S.onFocus,Je=S.onBlur,dt=S.onClick,Mt=S.onDragEnter,$t=S.onDragOver,St=S.onDragLeave,Nt=S.onDrop,qt=tn(S,Rs);return Te(Te($n({onKeyDown:te(We(Oe,I)),onFocus:te(We(et,Q)),onBlur:te(We(Je,U)),onClick:ke(We(dt,ve)),onDragEnter:ne(We(Mt,P)),onDragOver:ne(We($t,H)),onDragLeave:ne(We(St,J)),onDrop:ne(We(Nt,Ee)),role:typeof ye=="string"&&ye!==""?ye:"presentation"},pe,W),!n&&!v?{tabIndex:0}:{}),qt)}},[W,I,Q,U,ve,P,H,J,Ee,v,C,n]),qe=w.useCallback(function(S){S.stopPropagation()},[]),Ke=w.useMemo(function(){return function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=S.refKey,pe=D===void 0?"ref":D,ye=S.onChange,Oe=S.onClick,et=tn(S,Ts),Je=$n({accept:Y,multiple:s,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ke(We(ye,Ee)),onClick:ke(We(Oe,qe)),tabIndex:-1},pe,le);return Te(Te({},Je),et)}},[le,i,s,Ee,n]);return Te(Te({},ce),{},{isFocused:R&&!n,getRootProps:Ye,getInputProps:Ke,rootRef:W,inputRef:le,open:ke(b)})}function Ps(e,t){switch(t.type){case"focus":return Te(Te({},e),{},{isFocused:!0});case"blur":return Te(Te({},e),{},{isFocused:!1});case"openDialog":return Te(Te({},qn),{},{isFileDialogActive:!0});case"closeDialog":return Te(Te({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Te(Te({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Te(Te({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return Te({},qn);default:return e}}function br(){}const Is={WAV_MIME_TYPES:["audio/wav","audio/x-wav","audio/wave","audio/x-pn-wav"],MP3_MIME_TYPES:["audio/mpeg","audio/mp3","audio/x-mpeg","audio/x-mp3","audio/x-mpeg-3"],FLAC_MIME_TYPES:["audio/flac"]},Bs=10*1e3,wr="[Audio.getDurationSeconds]",Ls=async(e,{throwError:t}={})=>new Promise((i,n)=>{if(typeof window>"u")return n(new Error("getDurationSeconds is only usable in the browser"));const r=URL.createObjectURL(e),o=new Audio,a=()=>{o.src="",URL.revokeObjectURL(r)},s=setTimeout(()=>{a(),console.error(wr,"Timeout",e.name,e.size,e.type),i(0)},Bs);o.addEventListener("loadedmetadata",()=>{const c=o.duration;clearTimeout(s),a(),i(c)},{once:!0}),o.addEventListener("error",c=>{clearTimeout(s),a(),t?(console.error(wr,"Error",e.name,e.size,e.type,c),n(e)):i(0)},{once:!0}),o.src=r}),zs=e=>{const t=new Map;return e.forEach(i=>{t.set(`${i.name}-${i.size}`,i)}),Array.from(t.values())},Ms=e=>new Promise(t=>{const i=new FileReader;i.onloadend=n=>{var a;const r=new Uint8Array((a=n.target)==null?void 0:a.result),o=ja.filetypemime(r);t(o)},i.readAsArrayBuffer(e)}),$s=async e=>{try{const t=await Ls(e),i=e;return i.duration=t,i}catch{throw new Error(`Failed to get audio duration for ${e.name}`)}},Ns=e=>{for(const[t,i]of Object.entries(Is)){const n=t.toLowerCase().split("_")[0];if(i.includes(e))return n}},qs=async e=>{var s;const t=await Ms(e),i=((s=e==null?void 0:e.name)==null?void 0:s.split(".").pop())||"",n=t[0]||e.type,r=Ns(n);if(r===i||!n||!r)return e;const o=`${e.name.split(".").slice(0,-1).join(".")}.${r}`;return new File([e],o,{type:n})};class Ws extends Error{constructor(){super("Max file size exceeded")}}class Us extends Error{constructor(){super("Min file size exceeded")}}class Er extends Error{constructor(){super("File duration too long")}}class Vs extends Error{constructor(){super("Invalid file type")}}const Hs=e=>({handleDurationError:t=>{var i;console.log("handleDurationError",t),(i=e.onError)==null||i.call(e,new Er)},handleMaxSizeError:t=>{var i;console.log("handleMaxSizeError",t),(i=e.onError)==null||i.call(e,new Ws)},handleMinSizeError:t=>{var i;console.log("handleMinSizeError",t),(i=e.onError)==null||i.call(e,new Us)},handleUnknownError:t=>{var i;console.log("handleUnknownError",t),(i=e.onError)==null||i.call(e,new Error("Unknown error"))},handleInvalidTypeError:t=>{var i;console.log("handleInvalidTypeError",t),(i=e.onError)==null||i.call(e,new Vs)}}),Gs=e=>{const{handleDurationError:t,handleMaxSizeError:i,handleMinSizeError:n,handleUnknownError:r,handleInvalidTypeError:o}=Hs(e),[a,s]=w.useState(null);return{dropzone:yr({accept:{"audio/wav":[".wav"],"audio/mp3":[".mp3"],"audio/flac":[".flac"]},noClick:!0,minSize:e.minSizeBytes,maxSize:e.maxSizeBytes,onDropAccepted:async p=>{const l=await Promise.all(p.map(u=>qs(u)));try{const f=(await Promise.all(l.map($s))).filter(E=>E.duration<=(e.maxDurationS??1/0)?!0:(s(new Er),t(E),!1)),x=e.files??[],h=zs([...x,...f]),g=h.slice(0,e.maxFileCount??h.length);e.onFileAccepted(g)}catch(u){r(u)}},onDropRejected:p=>{p.forEach(l=>{for(const u of l.errors)u.code==="file-too-large"&&i(l.file),u.code==="file-too-small"&&n(l.file),u.code==="file-invalid-type"&&o(l.file)})}}),error:a,...e}},Sr=w.createContext({}),Ys=()=>w.useContext(Sr),Ks=$e(gt,{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",gap:"8px",height:"100%"}),Rr=({children:e,...t})=>{const i=Gs(t),{files:n,onFileAccepted:r,onDelete:o,maxFileCount:a,maxSizeBytes:s,minSizeBytes:c,maxDurationS:p,onError:l,...u}=t;return se.jsx(Sr.Provider,{value:i,children:se.jsxs(Ks,{...u,...i.dropzone.getRootProps(),children:[se.jsx("input",{...i.dropzone.getInputProps()}),e]})})},Js=$e(gt,{width:"100%",height:"100%",display:"flex",overflow:"hidden",borderRadius:"16px",background:"#ffffff10",flexDirection:"column",alignItems:"stretch",maxHeight:"500px",justifyContent:"center"}),Xs=$e(gt,{paddingTop:"32px",display:"flex",justifyContent:"center"}),Zs=$e(gt,{flex:1,gap:"16px",display:"flex",alignItems:"center",justifyContent:"center",padding:"16px"}),Qs=$e(gt,{flexWrap:"wrap",borderTop:"1px solid #ffffff10",display:"flex",alignItems:"stretch",minHeight:"96px"}),ec=$e(gt,{height:"252px",width:"222px",borderRadius:"8px",border:"1px solid #ffffff10",background:"#ffffff10",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),tc={Root:Js,Header:Xs,Content:Zs,Footer:Qs,Card:ec};function Tr(e,t){return function(){return e.apply(t,arguments)}}const{toString:nc}=Object.prototype,{getPrototypeOf:Wn}=Object,nn=(e=>t=>{const i=nc.call(t);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Ne=e=>(e=e.toLowerCase(),t=>nn(t)===e),rn=e=>t=>typeof t===e,{isArray:yt}=Array,Dt=rn("undefined");function ic(e){return e!==null&&!Dt(e)&&e.constructor!==null&&!Dt(e.constructor)&&Be(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const kr=Ne("ArrayBuffer");function rc(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&kr(e.buffer),t}const oc=rn("string"),Be=rn("function"),Or=rn("number"),on=e=>e!==null&&typeof e=="object",ac=e=>e===!0||e===!1,an=e=>{if(nn(e)!=="object")return!1;const t=Wn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},sc=Ne("Date"),cc=Ne("File"),lc=Ne("Blob"),pc=Ne("FileList"),uc=e=>on(e)&&Be(e.pipe),dc=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Be(e.append)&&((t=nn(e))==="formdata"||t==="object"&&Be(e.toString)&&e.toString()==="[object FormData]"))},fc=Ne("URLSearchParams"),[mc,xc,vc,gc]=["ReadableStream","Request","Response","Headers"].map(Ne),hc=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ft(e,t,{allOwnKeys:i=!1}={}){if(e===null||typeof e>"u")return;let n,r;if(typeof e!="object"&&(e=[e]),yt(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{const o=i?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let s;for(n=0;n<a;n++)s=o[n],t.call(null,e[s],s,e)}}function Cr(e,t){t=t.toLowerCase();const i=Object.keys(e);let n=i.length,r;for(;n-- >0;)if(r=i[n],t===r.toLowerCase())return r;return null}const at=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,_r=e=>!Dt(e)&&e!==at;function Un(){const{caseless:e}=_r(this)&&this||{},t={},i=(n,r)=>{const o=e&&Cr(t,r)||r;an(t[o])&&an(n)?t[o]=Un(t[o],n):an(n)?t[o]=Un({},n):yt(n)?t[o]=n.slice():t[o]=n};for(let n=0,r=arguments.length;n<r;n++)arguments[n]&&Ft(arguments[n],i);return t}const yc=(e,t,i,{allOwnKeys:n}={})=>(Ft(t,(r,o)=>{i&&Be(r)?e[o]=Tr(r,i):e[o]=r},{allOwnKeys:n}),e),bc=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),wc=(e,t,i,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),i&&Object.assign(e.prototype,i)},Ec=(e,t,i,n)=>{let r,o,a;const s={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),o=r.length;o-- >0;)a=r[o],(!n||n(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=i!==!1&&Wn(e)}while(e&&(!i||i(e,t))&&e!==Object.prototype);return t},Sc=(e,t,i)=>{e=String(e),(i===void 0||i>e.length)&&(i=e.length),i-=t.length;const n=e.indexOf(t,i);return n!==-1&&n===i},Rc=e=>{if(!e)return null;if(yt(e))return e;let t=e.length;if(!Or(t))return null;const i=new Array(t);for(;t-- >0;)i[t]=e[t];return i},Tc=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Wn(Uint8Array)),kc=(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])}},Oc=(e,t)=>{let i;const n=[];for(;(i=e.exec(t))!==null;)n.push(i);return n},Cc=Ne("HTMLFormElement"),_c=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,n,r){return n.toUpperCase()+r}),Ar=(({hasOwnProperty:e})=>(t,i)=>e.call(t,i))(Object.prototype),Ac=Ne("RegExp"),jr=(e,t)=>{const i=Object.getOwnPropertyDescriptors(e),n={};Ft(i,(r,o)=>{let a;(a=t(r,o,e))!==!1&&(n[o]=a||r)}),Object.defineProperties(e,n)},jc=e=>{jr(e,(t,i)=>{if(Be(e)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const n=e[i];if(Be(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},Dc=(e,t)=>{const i={},n=r=>{r.forEach(o=>{i[o]=!0})};return yt(e)?n(e):n(String(e).split(t)),i},Fc=()=>{},Pc=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Vn="abcdefghijklmnopqrstuvwxyz",Dr="0123456789",Fr={DIGIT:Dr,ALPHA:Vn,ALPHA_DIGIT:Vn+Vn.toUpperCase()+Dr},Ic=(e=16,t=Fr.ALPHA_DIGIT)=>{let i="";const{length:n}=t;for(;e--;)i+=t[Math.random()*n|0];return i};function Bc(e){return!!(e&&Be(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Lc=e=>{const t=new Array(10),i=(n,r)=>{if(on(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[r]=n;const o=yt(n)?[]:{};return Ft(n,(a,s)=>{const c=i(a,r+1);!Dt(c)&&(o[s]=c)}),t[r]=void 0,o}}return n};return i(e,0)},zc=Ne("AsyncFunction"),Mc=e=>e&&(on(e)||Be(e))&&Be(e.then)&&Be(e.catch),Pr=((e,t)=>e?setImmediate:t?((i,n)=>(at.addEventListener("message",({source:r,data:o})=>{r===at&&o===i&&n.length&&n.shift()()},!1),r=>{n.push(r),at.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",Be(at.postMessage)),$c=typeof queueMicrotask<"u"?queueMicrotask.bind(at):typeof process<"u"&&process.nextTick||Pr,y={isArray:yt,isArrayBuffer:kr,isBuffer:ic,isFormData:dc,isArrayBufferView:rc,isString:oc,isNumber:Or,isBoolean:ac,isObject:on,isPlainObject:an,isReadableStream:mc,isRequest:xc,isResponse:vc,isHeaders:gc,isUndefined:Dt,isDate:sc,isFile:cc,isBlob:lc,isRegExp:Ac,isFunction:Be,isStream:uc,isURLSearchParams:fc,isTypedArray:Tc,isFileList:pc,forEach:Ft,merge:Un,extend:yc,trim:hc,stripBOM:bc,inherits:wc,toFlatObject:Ec,kindOf:nn,kindOfTest:Ne,endsWith:Sc,toArray:Rc,forEachEntry:kc,matchAll:Oc,isHTMLForm:Cc,hasOwnProperty:Ar,hasOwnProp:Ar,reduceDescriptors:jr,freezeMethods:jc,toObjectSet:Dc,toCamelCase:_c,noop:Fc,toFiniteNumber:Pc,findKey:Cr,global:at,isContextDefined:_r,ALPHABET:Fr,generateString:Ic,isSpecCompliantForm:Bc,toJSONObject:Lc,isAsyncFn:zc,isThenable:Mc,setImmediate:Pr,asap:$c};function ee(e,t,i,n,r){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),i&&(this.config=i),n&&(this.request=n),r&&(this.response=r,this.status=r.status?r.status:null)}y.inherits(ee,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:y.toJSONObject(this.config),code:this.code,status:this.status}}});const Ir=ee.prototype,Br={};["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=>{Br[e]={value:e}}),Object.defineProperties(ee,Br),Object.defineProperty(Ir,"isAxiosError",{value:!0}),ee.from=(e,t,i,n,r,o)=>{const a=Object.create(Ir);return y.toFlatObject(e,a,function(c){return c!==Error.prototype},s=>s!=="isAxiosError"),ee.call(a,e.message,t,i,n,r),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const Nc=null;function Hn(e){return y.isPlainObject(e)||y.isArray(e)}function Lr(e){return y.endsWith(e,"[]")?e.slice(0,-2):e}function zr(e,t,i){return e?e.concat(t).map(function(r,o){return r=Lr(r),!i&&o?"["+r+"]":r}).join(i?".":""):t}function qc(e){return y.isArray(e)&&!e.some(Hn)}const Wc=y.toFlatObject(y,{},null,function(t){return/^is[A-Z]/.test(t)});function sn(e,t,i){if(!y.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,i=y.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,E){return!y.isUndefined(E[g])});const n=i.metaTokens,r=i.visitor||l,o=i.dots,a=i.indexes,c=(i.Blob||typeof Blob<"u"&&Blob)&&y.isSpecCompliantForm(t);if(!y.isFunction(r))throw new TypeError("visitor must be a function");function p(h){if(h===null)return"";if(y.isDate(h))return h.toISOString();if(!c&&y.isBlob(h))throw new ee("Blob is not supported. Use a Buffer instead.");return y.isArrayBuffer(h)||y.isTypedArray(h)?c&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function l(h,g,E){let m=h;if(h&&!E&&typeof h=="object"){if(y.endsWith(g,"{}"))g=n?g:g.slice(0,-2),h=JSON.stringify(h);else if(y.isArray(h)&&qc(h)||(y.isFileList(h)||y.endsWith(g,"[]"))&&(m=y.toArray(h)))return g=Lr(g),m.forEach(function(A,k){!(y.isUndefined(A)||A===null)&&t.append(a===!0?zr([g],k,o):a===null?g:g+"[]",p(A))}),!1}return Hn(h)?!0:(t.append(zr(E,g,o),p(h)),!1)}const u=[],f=Object.assign(Wc,{defaultVisitor:l,convertValue:p,isVisitable:Hn});function x(h,g){if(!y.isUndefined(h)){if(u.indexOf(h)!==-1)throw Error("Circular reference detected in "+g.join("."));u.push(h),y.forEach(h,function(m,O){(!(y.isUndefined(m)||m===null)&&r.call(t,m,y.isString(O)?O.trim():O,g,f))===!0&&x(m,g?g.concat(O):[O])}),u.pop()}}if(!y.isObject(e))throw new TypeError("data must be an object");return x(e),t}function Mr(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Gn(e,t){this._pairs=[],e&&sn(e,this,t)}const $r=Gn.prototype;$r.append=function(t,i){this._pairs.push([t,i])},$r.toString=function(t){const i=t?function(n){return t.call(this,n,Mr)}:Mr;return this._pairs.map(function(r){return i(r[0])+"="+i(r[1])},"").join("&")};function Uc(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Nr(e,t,i){if(!t)return e;const n=i&&i.encode||Uc;y.isFunction(i)&&(i={serialize:i});const r=i&&i.serialize;let o;if(r?o=r(t,i):o=y.isURLSearchParams(t)?t.toString():new Gn(t,i).toString(n),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class qr{constructor(){this.handlers=[]}use(t,i,n){return this.handlers.push({fulfilled:t,rejected:i,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){y.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Wr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Vc={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Gn,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Yn=typeof window<"u"&&typeof document<"u",Kn=typeof navigator=="object"&&navigator||void 0,Hc=Yn&&(!Kn||["ReactNative","NativeScript","NS"].indexOf(Kn.product)<0),Gc=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Yc=Yn&&window.location.href||"http://localhost",De={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Yn,hasStandardBrowserEnv:Hc,hasStandardBrowserWebWorkerEnv:Gc,navigator:Kn,origin:Yc},Symbol.toStringTag,{value:"Module"})),...Vc};function Kc(e,t){return sn(e,new De.classes.URLSearchParams,Object.assign({visitor:function(i,n,r,o){return De.isNode&&y.isBuffer(i)?(this.append(n,i.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Jc(e){return y.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Xc(e){const t={},i=Object.keys(e);let n;const r=i.length;let o;for(n=0;n<r;n++)o=i[n],t[o]=e[o];return t}function Ur(e){function t(i,n,r,o){let a=i[o++];if(a==="__proto__")return!0;const s=Number.isFinite(+a),c=o>=i.length;return a=!a&&y.isArray(r)?r.length:a,c?(y.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!s):((!r[a]||!y.isObject(r[a]))&&(r[a]=[]),t(i,n,r[a],o)&&y.isArray(r[a])&&(r[a]=Xc(r[a])),!s)}if(y.isFormData(e)&&y.isFunction(e.entries)){const i={};return y.forEachEntry(e,(n,r)=>{t(Jc(n),r,i,0)}),i}return null}function Zc(e,t,i){if(y.isString(e))try{return(t||JSON.parse)(e),y.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(0,JSON.stringify)(e)}const Pt={transitional:Wr,adapter:["xhr","http","fetch"],transformRequest:[function(t,i){const n=i.getContentType()||"",r=n.indexOf("application/json")>-1,o=y.isObject(t);if(o&&y.isHTMLForm(t)&&(t=new FormData(t)),y.isFormData(t))return r?JSON.stringify(Ur(t)):t;if(y.isArrayBuffer(t)||y.isBuffer(t)||y.isStream(t)||y.isFile(t)||y.isBlob(t)||y.isReadableStream(t))return t;if(y.isArrayBufferView(t))return t.buffer;if(y.isURLSearchParams(t))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Kc(t,this.formSerializer).toString();if((s=y.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return sn(s?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||r?(i.setContentType("application/json",!1),Zc(t)):t}],transformResponse:[function(t){const i=this.transitional||Pt.transitional,n=i&&i.forcedJSONParsing,r=this.responseType==="json";if(y.isResponse(t)||y.isReadableStream(t))return t;if(t&&y.isString(t)&&(n&&!this.responseType||r)){const a=!(i&&i.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(s){if(a)throw s.name==="SyntaxError"?ee.from(s,ee.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:De.classes.FormData,Blob:De.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};y.forEach(["delete","get","head","post","put","patch"],e=>{Pt.headers[e]={}});const Qc=y.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"]),el=e=>{const t={};let i,n,r;return e&&e.split(`
48
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vr(e,t){if(e){if(typeof e=="string")return Mn(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Mn(e,t)}}function Mn(e,t){(t==null||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function js(e,t){var i=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(i!=null){var n=[],r=!0,o=!1,a,s;try{for(i=i.call(e);!(r=(a=i.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(c){o=!0,s=c}finally{try{!r&&i.return!=null&&i.return()}finally{if(o)throw s}}return n}}function Ds(e){if(Array.isArray(e))return e}function gr(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),i.push.apply(i,n)}return i}function Te(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?gr(Object(i),!0).forEach(function(n){$n(e,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):gr(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}function $n(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function tn(e,t){if(e==null)return{};var i=Fs(e,t),n,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Fs(e,t){if(e==null)return{};var i={},n=Object.keys(e),r,o;for(o=0;o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&(i[r]=e[r]);return i}var Nn=w.forwardRef(function(e,t){var i=e.children,n=tn(e,Es),r=yr(n),o=r.open,a=tn(r,Ss);return w.useImperativeHandle(t,function(){return{open:o}},[o]),w.createElement(w.Fragment,null,i(Te(Te({},a),{},{open:o})))});Nn.displayName="Dropzone";var hr={disabled:!1,getFilesFromEvent:Wa,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};Nn.defaultProps=hr,Nn.propTypes={children:be.func,accept:be.objectOf(be.arrayOf(be.string)),multiple:be.bool,preventDropOnDocument:be.bool,noClick:be.bool,noKeyboard:be.bool,noDrag:be.bool,noDragEventsBubbling:be.bool,minSize:be.number,maxSize:be.number,maxFiles:be.number,disabled:be.bool,getFilesFromEvent:be.func,onFileDialogCancel:be.func,onFileDialogOpen:be.func,useFsAccessApi:be.bool,autoFocus:be.bool,onDragEnter:be.func,onDragLeave:be.func,onDragOver:be.func,onDrop:be.func,onDropAccepted:be.func,onDropRejected:be.func,onError:be.func,validator:be.func};var qn={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function yr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Te(Te({},hr),e),i=t.accept,n=t.disabled,r=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,c=t.maxFiles,p=t.onDragEnter,l=t.onDragLeave,u=t.onDragOver,f=t.onDrop,x=t.onDropAccepted,h=t.onDropRejected,g=t.onFileDialogCancel,E=t.onFileDialogOpen,m=t.useFsAccessApi,O=t.autoFocus,A=t.preventDropOnDocument,k=t.noClick,v=t.noKeyboard,C=t.noDrag,L=t.noDragEventsBubbling,j=t.onError,G=t.validator,Y=w.useMemo(function(){return ys(i)},[i]),ie=w.useMemo(function(){return hs(i)},[i]),re=w.useMemo(function(){return typeof E=="function"?E:br},[E]),Z=w.useMemo(function(){return typeof g=="function"?g:br},[g]),W=w.useRef(null),le=w.useRef(null),xe=w.useReducer(Ps,qn),we=zn(xe,2),ce=we[0],he=we[1],R=ce.isFocused,_=ce.isFileDialogActive,z=w.useRef(typeof window<"u"&&window.isSecureContext&&m&&gs()),q=function(){!z.current&&_&&setTimeout(function(){if(le.current){var D=le.current.files;D.length||(he({type:"closeDialog"}),Z())}},300)};w.useEffect(function(){return window.addEventListener("focus",q,!1),function(){window.removeEventListener("focus",q,!1)}},[le,_,Z,z]);var $=w.useRef([]),K=function(D){W.current&&W.current.contains(D.target)||(D.preventDefault(),$.current=[])};w.useEffect(function(){return A&&(document.addEventListener("dragover",fr,!1),document.addEventListener("drop",K,!1)),function(){A&&(document.removeEventListener("dragover",fr),document.removeEventListener("drop",K))}},[W,A]),w.useEffect(function(){return!n&&O&&W.current&&W.current.focus(),function(){}},[W,O,n]);var M=w.useCallback(function(S){j?j(S):console.error(S)},[j]),P=w.useCallback(function(S){S.preventDefault(),S.persist(),Re(S),$.current=[].concat(ks($.current),[S.target]),en(S)&&Promise.resolve(r(S)).then(function(D){if(!(Qt(S)&&!L)){var pe=D.length,ye=pe>0&&fs({files:D,accept:Y,minSize:a,maxSize:o,multiple:s,maxFiles:c,validator:G}),Oe=pe>0&&!ye;he({isDragAccept:ye,isDragReject:Oe,isDragActive:!0,type:"setDraggedFiles"}),p&&p(S)}}).catch(function(D){return M(D)})},[r,p,M,L,Y,a,o,s,c,G]),H=w.useCallback(function(S){S.preventDefault(),S.persist(),Re(S);var D=en(S);if(D&&S.dataTransfer)try{S.dataTransfer.dropEffect="copy"}catch{}return D&&u&&u(S),!1},[u,L]),J=w.useCallback(function(S){S.preventDefault(),S.persist(),Re(S);var D=$.current.filter(function(ye){return W.current&&W.current.contains(ye)}),pe=D.indexOf(S.target);pe!==-1&&D.splice(pe,1),$.current=D,!(D.length>0)&&(he({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),en(S)&&l&&l(S))},[W,l,L]),N=w.useCallback(function(S,D){var pe=[],ye=[];S.forEach(function(Oe){var et=ur(Oe,Y),Je=zn(et,2),dt=Je[0],Mt=Je[1],$t=dr(Oe,a,o),St=zn($t,2),Nt=St[0],qt=St[1],Wt=G?G(Oe):null;if(dt&&Nt&&!Wt)pe.push(Oe);else{var Ut=[Mt,qt];Wt&&(Ut=Ut.concat(Wt)),ye.push({file:Oe,errors:Ut.filter(function(Vt){return Vt})})}}),(!s&&pe.length>1||s&&c>=1&&pe.length>c)&&(pe.forEach(function(Oe){ye.push({file:Oe,errors:[ds]})}),pe.splice(0)),he({acceptedFiles:pe,fileRejections:ye,isDragReject:ye.length>0,type:"setFiles"}),f&&f(pe,ye,D),ye.length>0&&h&&h(ye,D),pe.length>0&&x&&x(pe,D)},[he,s,Y,a,o,c,f,x,h,G]),Ee=w.useCallback(function(S){S.preventDefault(),S.persist(),Re(S),$.current=[],en(S)&&Promise.resolve(r(S)).then(function(D){Qt(S)&&!L||N(D,S)}).catch(function(D){return M(D)}),he({type:"reset"})},[r,N,M,L]),b=w.useCallback(function(){if(z.current){he({type:"openDialog"}),re();var S={multiple:s,types:ie};window.showOpenFilePicker(S).then(function(D){return r(D)}).then(function(D){N(D,null),he({type:"closeDialog"})}).catch(function(D){bs(D)?(Z(D),he({type:"closeDialog"})):ws(D)?(z.current=!1,le.current?(le.current.value=null,le.current.click()):M(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):M(D)});return}le.current&&(he({type:"openDialog"}),re(),le.current.value=null,le.current.click())},[he,re,Z,m,N,M,ie,s]),I=w.useCallback(function(S){!W.current||!W.current.isEqualNode(S.target)||(S.key===" "||S.key==="Enter"||S.keyCode===32||S.keyCode===13)&&(S.preventDefault(),b())},[W,b]),Q=w.useCallback(function(){he({type:"focus"})},[]),U=w.useCallback(function(){he({type:"blur"})},[]),ve=w.useCallback(function(){k||(vs()?setTimeout(b,0):b())},[k,b]),ke=function(D){return n?null:D},te=function(D){return v?null:ke(D)},ne=function(D){return C?null:ke(D)},Re=function(D){L&&D.stopPropagation()},Ye=w.useMemo(function(){return function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=S.refKey,pe=D===void 0?"ref":D,ye=S.role,Oe=S.onKeyDown,et=S.onFocus,Je=S.onBlur,dt=S.onClick,Mt=S.onDragEnter,$t=S.onDragOver,St=S.onDragLeave,Nt=S.onDrop,qt=tn(S,Rs);return Te(Te($n({onKeyDown:te(We(Oe,I)),onFocus:te(We(et,Q)),onBlur:te(We(Je,U)),onClick:ke(We(dt,ve)),onDragEnter:ne(We(Mt,P)),onDragOver:ne(We($t,H)),onDragLeave:ne(We(St,J)),onDrop:ne(We(Nt,Ee)),role:typeof ye=="string"&&ye!==""?ye:"presentation"},pe,W),!n&&!v?{tabIndex:0}:{}),qt)}},[W,I,Q,U,ve,P,H,J,Ee,v,C,n]),qe=w.useCallback(function(S){S.stopPropagation()},[]),Ke=w.useMemo(function(){return function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=S.refKey,pe=D===void 0?"ref":D,ye=S.onChange,Oe=S.onClick,et=tn(S,Ts),Je=$n({accept:Y,multiple:s,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ke(We(ye,Ee)),onClick:ke(We(Oe,qe)),tabIndex:-1},pe,le);return Te(Te({},Je),et)}},[le,i,s,Ee,n]);return Te(Te({},ce),{},{isFocused:R&&!n,getRootProps:Ye,getInputProps:Ke,rootRef:W,inputRef:le,open:ke(b)})}function Ps(e,t){switch(t.type){case"focus":return Te(Te({},e),{},{isFocused:!0});case"blur":return Te(Te({},e),{},{isFocused:!1});case"openDialog":return Te(Te({},qn),{},{isFileDialogActive:!0});case"closeDialog":return Te(Te({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Te(Te({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Te(Te({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return Te({},qn);default:return e}}function br(){}const Is={WAV_MIME_TYPES:["audio/wav","audio/x-wav","audio/wave","audio/x-pn-wav"],MP3_MIME_TYPES:["audio/mpeg","audio/mp3","audio/x-mpeg","audio/x-mp3","audio/x-mpeg-3"],FLAC_MIME_TYPES:["audio/flac"]},Bs=10*1e3,wr="[Audio.getDurationSeconds]",Ls=async(e,{throwError:t}={})=>new Promise((i,n)=>{if(typeof window>"u")return n(new Error("getDurationSeconds is only usable in the browser"));const r=URL.createObjectURL(e),o=new Audio,a=()=>{o.src="",URL.revokeObjectURL(r)},s=setTimeout(()=>{a(),console.error(wr,"Timeout",e.name,e.size,e.type),i(0)},Bs);o.addEventListener("loadedmetadata",()=>{const c=o.duration;clearTimeout(s),a(),i(c)},{once:!0}),o.addEventListener("error",c=>{clearTimeout(s),a(),t?(console.error(wr,"Error",e.name,e.size,e.type,c),n(e)):i(0)},{once:!0}),o.src=r}),zs=e=>{const t=new Map;return e.forEach(i=>{t.set(`${i.name}-${i.size}`,i)}),Array.from(t.values())},Ms=e=>new Promise(t=>{const i=new FileReader;i.onloadend=n=>{var a;const r=new Uint8Array((a=n.target)==null?void 0:a.result),o=ja.filetypemime(r);t(o)},i.readAsArrayBuffer(e)}),$s=async e=>{try{const t=await Ls(e),i=e;return i.duration=t,i}catch{throw new Error(`Failed to get audio duration for ${e.name}`)}},Ns=e=>{for(const[t,i]of Object.entries(Is)){const n=t.toLowerCase().split("_")[0];if(i.includes(e))return n}},qs=async e=>{var s;const t=await Ms(e),i=((s=e==null?void 0:e.name)==null?void 0:s.split(".").pop())||"",n=t[0]||e.type,r=Ns(n);if(r===i||!n||!r)return e;const o=`${e.name.split(".").slice(0,-1).join(".")}.${r}`;return new File([e],o,{type:n})};class Ws extends Error{constructor(){super("Max file size exceeded")}}class Us extends Error{constructor(){super("Min file size exceeded")}}class Er extends Error{constructor(){super("File duration too long")}}class Vs extends Error{constructor(){super("Invalid file type")}}const Hs=e=>({handleDurationError:t=>{var i;console.log("handleDurationError",t),(i=e.onError)==null||i.call(e,new Er)},handleMaxSizeError:t=>{var i;console.log("handleMaxSizeError",t),(i=e.onError)==null||i.call(e,new Ws)},handleMinSizeError:t=>{var i;console.log("handleMinSizeError",t),(i=e.onError)==null||i.call(e,new Us)},handleUnknownError:t=>{var i;console.log("handleUnknownError",t),(i=e.onError)==null||i.call(e,new Error("Unknown error"))},handleInvalidTypeError:t=>{var i;console.log("handleInvalidTypeError",t),(i=e.onError)==null||i.call(e,new Vs)}}),Gs=e=>{const{handleDurationError:t,handleMaxSizeError:i,handleMinSizeError:n,handleUnknownError:r,handleInvalidTypeError:o}=Hs(e),[a,s]=w.useState(null);return{dropzone:yr({accept:{"audio/wav":[".wav"],"audio/mp3":[".mp3"],"audio/flac":[".flac"]},noClick:!0,minSize:e.minSizeBytes,maxSize:e.maxSizeBytes,onDropAccepted:async p=>{const l=await Promise.all(p.map(u=>qs(u)));try{const f=(await Promise.all(l.map($s))).filter(E=>E.duration<=(e.maxDurationS??1/0)?!0:(s(new Er),t(E),!1)),x=e.files??[],h=zs([...x,...f]),g=h.slice(0,e.maxFileCount??h.length);e.onFileAccepted(g)}catch(u){r(u)}},onDropRejected:p=>{p.forEach(l=>{for(const u of l.errors)u.code==="file-too-large"&&i(l.file),u.code==="file-too-small"&&n(l.file),u.code==="file-invalid-type"&&o(l.file)})}}),error:a,...e}},Sr=w.createContext({}),Ys=()=>w.useContext(Sr),Ks=$e(gt,{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",gap:"8px",height:"100%"}),Rr=({children:e,...t})=>{const i=Gs(t),{files:n,onFileAccepted:r,onDelete:o,maxFileCount:a,maxSizeBytes:s,minSizeBytes:c,maxDurationS:p,onError:l,...u}=t;return se.jsx(Sr.Provider,{value:i,children:se.jsxs(Ks,{...u,...i.dropzone.getRootProps(),children:[se.jsx("input",{...i.dropzone.getInputProps()}),e]})})},Js=$e(gt,{width:"100%",height:"100%",display:"flex",overflow:"hidden",borderRadius:"16px",background:"#ffffff10",flexDirection:"column",alignItems:"stretch",justifyContent:"center"}),Xs=$e(gt,{paddingTop:"32px",display:"flex",justifyContent:"center"}),Zs=$e(gt,{flex:1,gap:"16px",display:"flex",alignItems:"center",justifyContent:"center",padding:"16px"}),Qs=$e(gt,{flexWrap:"wrap",borderTop:"1px solid #ffffff10",display:"flex",alignItems:"stretch"}),ec=$e(gt,{height:"252px",width:"222px",borderRadius:"8px",border:"1px solid #ffffff10",background:"#ffffff10",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),tc={Root:Js,Header:Xs,Content:Zs,Footer:Qs,Card:ec};function Tr(e,t){return function(){return e.apply(t,arguments)}}const{toString:nc}=Object.prototype,{getPrototypeOf:Wn}=Object,nn=(e=>t=>{const i=nc.call(t);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Ne=e=>(e=e.toLowerCase(),t=>nn(t)===e),rn=e=>t=>typeof t===e,{isArray:yt}=Array,Dt=rn("undefined");function ic(e){return e!==null&&!Dt(e)&&e.constructor!==null&&!Dt(e.constructor)&&Be(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const kr=Ne("ArrayBuffer");function rc(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&kr(e.buffer),t}const oc=rn("string"),Be=rn("function"),Or=rn("number"),on=e=>e!==null&&typeof e=="object",ac=e=>e===!0||e===!1,an=e=>{if(nn(e)!=="object")return!1;const t=Wn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},sc=Ne("Date"),cc=Ne("File"),lc=Ne("Blob"),pc=Ne("FileList"),uc=e=>on(e)&&Be(e.pipe),dc=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Be(e.append)&&((t=nn(e))==="formdata"||t==="object"&&Be(e.toString)&&e.toString()==="[object FormData]"))},fc=Ne("URLSearchParams"),[mc,xc,vc,gc]=["ReadableStream","Request","Response","Headers"].map(Ne),hc=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ft(e,t,{allOwnKeys:i=!1}={}){if(e===null||typeof e>"u")return;let n,r;if(typeof e!="object"&&(e=[e]),yt(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{const o=i?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let s;for(n=0;n<a;n++)s=o[n],t.call(null,e[s],s,e)}}function Cr(e,t){t=t.toLowerCase();const i=Object.keys(e);let n=i.length,r;for(;n-- >0;)if(r=i[n],t===r.toLowerCase())return r;return null}const at=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,_r=e=>!Dt(e)&&e!==at;function Un(){const{caseless:e}=_r(this)&&this||{},t={},i=(n,r)=>{const o=e&&Cr(t,r)||r;an(t[o])&&an(n)?t[o]=Un(t[o],n):an(n)?t[o]=Un({},n):yt(n)?t[o]=n.slice():t[o]=n};for(let n=0,r=arguments.length;n<r;n++)arguments[n]&&Ft(arguments[n],i);return t}const yc=(e,t,i,{allOwnKeys:n}={})=>(Ft(t,(r,o)=>{i&&Be(r)?e[o]=Tr(r,i):e[o]=r},{allOwnKeys:n}),e),bc=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),wc=(e,t,i,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),i&&Object.assign(e.prototype,i)},Ec=(e,t,i,n)=>{let r,o,a;const s={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),o=r.length;o-- >0;)a=r[o],(!n||n(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=i!==!1&&Wn(e)}while(e&&(!i||i(e,t))&&e!==Object.prototype);return t},Sc=(e,t,i)=>{e=String(e),(i===void 0||i>e.length)&&(i=e.length),i-=t.length;const n=e.indexOf(t,i);return n!==-1&&n===i},Rc=e=>{if(!e)return null;if(yt(e))return e;let t=e.length;if(!Or(t))return null;const i=new Array(t);for(;t-- >0;)i[t]=e[t];return i},Tc=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Wn(Uint8Array)),kc=(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])}},Oc=(e,t)=>{let i;const n=[];for(;(i=e.exec(t))!==null;)n.push(i);return n},Cc=Ne("HTMLFormElement"),_c=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,n,r){return n.toUpperCase()+r}),Ar=(({hasOwnProperty:e})=>(t,i)=>e.call(t,i))(Object.prototype),Ac=Ne("RegExp"),jr=(e,t)=>{const i=Object.getOwnPropertyDescriptors(e),n={};Ft(i,(r,o)=>{let a;(a=t(r,o,e))!==!1&&(n[o]=a||r)}),Object.defineProperties(e,n)},jc=e=>{jr(e,(t,i)=>{if(Be(e)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const n=e[i];if(Be(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},Dc=(e,t)=>{const i={},n=r=>{r.forEach(o=>{i[o]=!0})};return yt(e)?n(e):n(String(e).split(t)),i},Fc=()=>{},Pc=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Vn="abcdefghijklmnopqrstuvwxyz",Dr="0123456789",Fr={DIGIT:Dr,ALPHA:Vn,ALPHA_DIGIT:Vn+Vn.toUpperCase()+Dr},Ic=(e=16,t=Fr.ALPHA_DIGIT)=>{let i="";const{length:n}=t;for(;e--;)i+=t[Math.random()*n|0];return i};function Bc(e){return!!(e&&Be(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Lc=e=>{const t=new Array(10),i=(n,r)=>{if(on(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[r]=n;const o=yt(n)?[]:{};return Ft(n,(a,s)=>{const c=i(a,r+1);!Dt(c)&&(o[s]=c)}),t[r]=void 0,o}}return n};return i(e,0)},zc=Ne("AsyncFunction"),Mc=e=>e&&(on(e)||Be(e))&&Be(e.then)&&Be(e.catch),Pr=((e,t)=>e?setImmediate:t?((i,n)=>(at.addEventListener("message",({source:r,data:o})=>{r===at&&o===i&&n.length&&n.shift()()},!1),r=>{n.push(r),at.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",Be(at.postMessage)),$c=typeof queueMicrotask<"u"?queueMicrotask.bind(at):typeof process<"u"&&process.nextTick||Pr,y={isArray:yt,isArrayBuffer:kr,isBuffer:ic,isFormData:dc,isArrayBufferView:rc,isString:oc,isNumber:Or,isBoolean:ac,isObject:on,isPlainObject:an,isReadableStream:mc,isRequest:xc,isResponse:vc,isHeaders:gc,isUndefined:Dt,isDate:sc,isFile:cc,isBlob:lc,isRegExp:Ac,isFunction:Be,isStream:uc,isURLSearchParams:fc,isTypedArray:Tc,isFileList:pc,forEach:Ft,merge:Un,extend:yc,trim:hc,stripBOM:bc,inherits:wc,toFlatObject:Ec,kindOf:nn,kindOfTest:Ne,endsWith:Sc,toArray:Rc,forEachEntry:kc,matchAll:Oc,isHTMLForm:Cc,hasOwnProperty:Ar,hasOwnProp:Ar,reduceDescriptors:jr,freezeMethods:jc,toObjectSet:Dc,toCamelCase:_c,noop:Fc,toFiniteNumber:Pc,findKey:Cr,global:at,isContextDefined:_r,ALPHABET:Fr,generateString:Ic,isSpecCompliantForm:Bc,toJSONObject:Lc,isAsyncFn:zc,isThenable:Mc,setImmediate:Pr,asap:$c};function ee(e,t,i,n,r){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),i&&(this.config=i),n&&(this.request=n),r&&(this.response=r,this.status=r.status?r.status:null)}y.inherits(ee,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:y.toJSONObject(this.config),code:this.code,status:this.status}}});const Ir=ee.prototype,Br={};["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=>{Br[e]={value:e}}),Object.defineProperties(ee,Br),Object.defineProperty(Ir,"isAxiosError",{value:!0}),ee.from=(e,t,i,n,r,o)=>{const a=Object.create(Ir);return y.toFlatObject(e,a,function(c){return c!==Error.prototype},s=>s!=="isAxiosError"),ee.call(a,e.message,t,i,n,r),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const Nc=null;function Hn(e){return y.isPlainObject(e)||y.isArray(e)}function Lr(e){return y.endsWith(e,"[]")?e.slice(0,-2):e}function zr(e,t,i){return e?e.concat(t).map(function(r,o){return r=Lr(r),!i&&o?"["+r+"]":r}).join(i?".":""):t}function qc(e){return y.isArray(e)&&!e.some(Hn)}const Wc=y.toFlatObject(y,{},null,function(t){return/^is[A-Z]/.test(t)});function sn(e,t,i){if(!y.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,i=y.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,E){return!y.isUndefined(E[g])});const n=i.metaTokens,r=i.visitor||l,o=i.dots,a=i.indexes,c=(i.Blob||typeof Blob<"u"&&Blob)&&y.isSpecCompliantForm(t);if(!y.isFunction(r))throw new TypeError("visitor must be a function");function p(h){if(h===null)return"";if(y.isDate(h))return h.toISOString();if(!c&&y.isBlob(h))throw new ee("Blob is not supported. Use a Buffer instead.");return y.isArrayBuffer(h)||y.isTypedArray(h)?c&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function l(h,g,E){let m=h;if(h&&!E&&typeof h=="object"){if(y.endsWith(g,"{}"))g=n?g:g.slice(0,-2),h=JSON.stringify(h);else if(y.isArray(h)&&qc(h)||(y.isFileList(h)||y.endsWith(g,"[]"))&&(m=y.toArray(h)))return g=Lr(g),m.forEach(function(A,k){!(y.isUndefined(A)||A===null)&&t.append(a===!0?zr([g],k,o):a===null?g:g+"[]",p(A))}),!1}return Hn(h)?!0:(t.append(zr(E,g,o),p(h)),!1)}const u=[],f=Object.assign(Wc,{defaultVisitor:l,convertValue:p,isVisitable:Hn});function x(h,g){if(!y.isUndefined(h)){if(u.indexOf(h)!==-1)throw Error("Circular reference detected in "+g.join("."));u.push(h),y.forEach(h,function(m,O){(!(y.isUndefined(m)||m===null)&&r.call(t,m,y.isString(O)?O.trim():O,g,f))===!0&&x(m,g?g.concat(O):[O])}),u.pop()}}if(!y.isObject(e))throw new TypeError("data must be an object");return x(e),t}function Mr(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Gn(e,t){this._pairs=[],e&&sn(e,this,t)}const $r=Gn.prototype;$r.append=function(t,i){this._pairs.push([t,i])},$r.toString=function(t){const i=t?function(n){return t.call(this,n,Mr)}:Mr;return this._pairs.map(function(r){return i(r[0])+"="+i(r[1])},"").join("&")};function Uc(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Nr(e,t,i){if(!t)return e;const n=i&&i.encode||Uc;y.isFunction(i)&&(i={serialize:i});const r=i&&i.serialize;let o;if(r?o=r(t,i):o=y.isURLSearchParams(t)?t.toString():new Gn(t,i).toString(n),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class qr{constructor(){this.handlers=[]}use(t,i,n){return this.handlers.push({fulfilled:t,rejected:i,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){y.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Wr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Vc={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Gn,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Yn=typeof window<"u"&&typeof document<"u",Kn=typeof navigator=="object"&&navigator||void 0,Hc=Yn&&(!Kn||["ReactNative","NativeScript","NS"].indexOf(Kn.product)<0),Gc=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Yc=Yn&&window.location.href||"http://localhost",De={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Yn,hasStandardBrowserEnv:Hc,hasStandardBrowserWebWorkerEnv:Gc,navigator:Kn,origin:Yc},Symbol.toStringTag,{value:"Module"})),...Vc};function Kc(e,t){return sn(e,new De.classes.URLSearchParams,Object.assign({visitor:function(i,n,r,o){return De.isNode&&y.isBuffer(i)?(this.append(n,i.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Jc(e){return y.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Xc(e){const t={},i=Object.keys(e);let n;const r=i.length;let o;for(n=0;n<r;n++)o=i[n],t[o]=e[o];return t}function Ur(e){function t(i,n,r,o){let a=i[o++];if(a==="__proto__")return!0;const s=Number.isFinite(+a),c=o>=i.length;return a=!a&&y.isArray(r)?r.length:a,c?(y.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!s):((!r[a]||!y.isObject(r[a]))&&(r[a]=[]),t(i,n,r[a],o)&&y.isArray(r[a])&&(r[a]=Xc(r[a])),!s)}if(y.isFormData(e)&&y.isFunction(e.entries)){const i={};return y.forEachEntry(e,(n,r)=>{t(Jc(n),r,i,0)}),i}return null}function Zc(e,t,i){if(y.isString(e))try{return(t||JSON.parse)(e),y.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(0,JSON.stringify)(e)}const Pt={transitional:Wr,adapter:["xhr","http","fetch"],transformRequest:[function(t,i){const n=i.getContentType()||"",r=n.indexOf("application/json")>-1,o=y.isObject(t);if(o&&y.isHTMLForm(t)&&(t=new FormData(t)),y.isFormData(t))return r?JSON.stringify(Ur(t)):t;if(y.isArrayBuffer(t)||y.isBuffer(t)||y.isStream(t)||y.isFile(t)||y.isBlob(t)||y.isReadableStream(t))return t;if(y.isArrayBufferView(t))return t.buffer;if(y.isURLSearchParams(t))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Kc(t,this.formSerializer).toString();if((s=y.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return sn(s?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||r?(i.setContentType("application/json",!1),Zc(t)):t}],transformResponse:[function(t){const i=this.transitional||Pt.transitional,n=i&&i.forcedJSONParsing,r=this.responseType==="json";if(y.isResponse(t)||y.isReadableStream(t))return t;if(t&&y.isString(t)&&(n&&!this.responseType||r)){const a=!(i&&i.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(s){if(a)throw s.name==="SyntaxError"?ee.from(s,ee.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:De.classes.FormData,Blob:De.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};y.forEach(["delete","get","head","post","put","patch"],e=>{Pt.headers[e]={}});const Qc=y.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"]),el=e=>{const t={};let i,n,r;return e&&e.split(`
49
49
  `).forEach(function(a){r=a.indexOf(":"),i=a.substring(0,r).trim().toLowerCase(),n=a.substring(r+1).trim(),!(!i||t[i]&&Qc[i])&&(i==="set-cookie"?t[i]?t[i].push(n):t[i]=[n]:t[i]=t[i]?t[i]+", "+n:n)}),t},Vr=Symbol("internals");function It(e){return e&&String(e).trim().toLowerCase()}function cn(e){return e===!1||e==null?e:y.isArray(e)?e.map(cn):String(e)}function tl(e){const t=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=i.exec(e);)t[n[1]]=n[2];return t}const nl=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Jn(e,t,i,n,r){if(y.isFunction(n))return n.call(this,t,i);if(r&&(t=i),!!y.isString(t)){if(y.isString(n))return t.indexOf(n)!==-1;if(y.isRegExp(n))return n.test(t)}}function il(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,i,n)=>i.toUpperCase()+n)}function rl(e,t){const i=y.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+i,{value:function(r,o,a){return this[n].call(this,t,r,o,a)},configurable:!0})})}class Ie{constructor(t){t&&this.set(t)}set(t,i,n){const r=this;function o(s,c,p){const l=It(c);if(!l)throw new Error("header name must be a non-empty string");const u=y.findKey(r,l);(!u||r[u]===void 0||p===!0||p===void 0&&r[u]!==!1)&&(r[u||c]=cn(s))}const a=(s,c)=>y.forEach(s,(p,l)=>o(p,l,c));if(y.isPlainObject(t)||t instanceof this.constructor)a(t,i);else if(y.isString(t)&&(t=t.trim())&&!nl(t))a(el(t),i);else if(y.isHeaders(t))for(const[s,c]of t.entries())o(c,s,n);else t!=null&&o(i,t,n);return this}get(t,i){if(t=It(t),t){const n=y.findKey(this,t);if(n){const r=this[n];if(!i)return r;if(i===!0)return tl(r);if(y.isFunction(i))return i.call(this,r,n);if(y.isRegExp(i))return i.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,i){if(t=It(t),t){const n=y.findKey(this,t);return!!(n&&this[n]!==void 0&&(!i||Jn(this,this[n],n,i)))}return!1}delete(t,i){const n=this;let r=!1;function o(a){if(a=It(a),a){const s=y.findKey(n,a);s&&(!i||Jn(n,n[s],s,i))&&(delete n[s],r=!0)}}return y.isArray(t)?t.forEach(o):o(t),r}clear(t){const i=Object.keys(this);let n=i.length,r=!1;for(;n--;){const o=i[n];(!t||Jn(this,this[o],o,t,!0))&&(delete this[o],r=!0)}return r}normalize(t){const i=this,n={};return y.forEach(this,(r,o)=>{const a=y.findKey(n,o);if(a){i[a]=cn(r),delete i[o];return}const s=t?il(o):String(o).trim();s!==o&&delete i[o],i[s]=cn(r),n[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const i=Object.create(null);return y.forEach(this,(n,r)=>{n!=null&&n!==!1&&(i[r]=t&&y.isArray(n)?n.join(", "):n)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,i])=>t+": "+i).join(`
50
50
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...i){const n=new this(t);return i.forEach(r=>n.set(r)),n}static accessor(t){const n=(this[Vr]=this[Vr]={accessors:{}}).accessors,r=this.prototype;function o(a){const s=It(a);n[s]||(rl(r,a),n[s]=!0)}return y.isArray(t)?t.forEach(o):o(t),this}}Ie.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),y.reduceDescriptors(Ie.prototype,({value:e},t)=>{let i=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[i]=n}}}),y.freezeMethods(Ie);function Xn(e,t){const i=this||Pt,n=t||i,r=Ie.from(n.headers);let o=n.data;return y.forEach(e,function(s){o=s.call(i,o,r.normalize(),t?t.status:void 0)}),r.normalize(),o}function Hr(e){return!!(e&&e.__CANCEL__)}function bt(e,t,i){ee.call(this,e??"canceled",ee.ERR_CANCELED,t,i),this.name="CanceledError"}y.inherits(bt,ee,{__CANCEL__:!0});function Gr(e,t,i){const n=i.config.validateStatus;!i.status||!n||n(i.status)?e(i):t(new ee("Request failed with status code "+i.status,[ee.ERR_BAD_REQUEST,ee.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function ol(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function al(e,t){e=e||10;const i=new Array(e),n=new Array(e);let r=0,o=0,a;return t=t!==void 0?t:1e3,function(c){const p=Date.now(),l=n[o];a||(a=p),i[r]=c,n[r]=p;let u=o,f=0;for(;u!==r;)f+=i[u++],u=u%e;if(r=(r+1)%e,r===o&&(o=(o+1)%e),p-a<t)return;const x=l&&p-l;return x?Math.round(f*1e3/x):void 0}}function sl(e,t){let i=0,n=1e3/t,r,o;const a=(p,l=Date.now())=>{i=l,r=null,o&&(clearTimeout(o),o=null),e.apply(null,p)};return[(...p)=>{const l=Date.now(),u=l-i;u>=n?a(p,l):(r=p,o||(o=setTimeout(()=>{o=null,a(r)},n-u)))},()=>r&&a(r)]}const ln=(e,t,i=3)=>{let n=0;const r=al(50,250);return sl(o=>{const a=o.loaded,s=o.lengthComputable?o.total:void 0,c=a-n,p=r(c),l=a<=s;n=a;const u={loaded:a,total:s,progress:s?a/s:void 0,bytes:c,rate:p||void 0,estimated:p&&s&&l?(s-a)/p:void 0,event:o,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(u)},i)},Yr=(e,t)=>{const i=e!=null;return[n=>t[0]({lengthComputable:i,total:e,loaded:n}),t[1]]},Kr=e=>(...t)=>y.asap(()=>e(...t)),cl=De.hasStandardBrowserEnv?((e,t)=>i=>(i=new URL(i,De.origin),e.protocol===i.protocol&&e.host===i.host&&(t||e.port===i.port)))(new URL(De.origin),De.navigator&&/(msie|trident)/i.test(De.navigator.userAgent)):()=>!0,ll=De.hasStandardBrowserEnv?{write(e,t,i,n,r,o){const a=[e+"="+encodeURIComponent(t)];y.isNumber(i)&&a.push("expires="+new Date(i).toGMTString()),y.isString(n)&&a.push("path="+n),y.isString(r)&&a.push("domain="+r),o===!0&&a.push("secure"),document.cookie=a.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 pl(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ul(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Jr(e,t){return e&&!pl(t)?ul(e,t):t}const Xr=e=>e instanceof Ie?{...e}:e;function st(e,t){t=t||{};const i={};function n(p,l,u,f){return y.isPlainObject(p)&&y.isPlainObject(l)?y.merge.call({caseless:f},p,l):y.isPlainObject(l)?y.merge({},l):y.isArray(l)?l.slice():l}function r(p,l,u,f){if(y.isUndefined(l)){if(!y.isUndefined(p))return n(void 0,p,u,f)}else return n(p,l,u,f)}function o(p,l){if(!y.isUndefined(l))return n(void 0,l)}function a(p,l){if(y.isUndefined(l)){if(!y.isUndefined(p))return n(void 0,p)}else return n(void 0,l)}function s(p,l,u){if(u in t)return n(p,l);if(u in e)return n(void 0,p)}const c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(p,l,u)=>r(Xr(p),Xr(l),u,!0)};return y.forEach(Object.keys(Object.assign({},e,t)),function(l){const u=c[l]||r,f=u(e[l],t[l],l);y.isUndefined(f)&&u!==s||(i[l]=f)}),i}const Zr=e=>{const t=st({},e);let{data:i,withXSRFToken:n,xsrfHeaderName:r,xsrfCookieName:o,headers:a,auth:s}=t;t.headers=a=Ie.from(a),t.url=Nr(Jr(t.baseURL,t.url),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let c;if(y.isFormData(i)){if(De.hasStandardBrowserEnv||De.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((c=a.getContentType())!==!1){const[p,...l]=c?c.split(";").map(u=>u.trim()).filter(Boolean):[];a.setContentType([p||"multipart/form-data",...l].join("; "))}}if(De.hasStandardBrowserEnv&&(n&&y.isFunction(n)&&(n=n(t)),n||n!==!1&&cl(t.url))){const p=r&&o&&ll.read(o);p&&a.set(r,p)}return t},dl=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(i,n){const r=Zr(e);let o=r.data;const a=Ie.from(r.headers).normalize();let{responseType:s,onUploadProgress:c,onDownloadProgress:p}=r,l,u,f,x,h;function g(){x&&x(),h&&h(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener("abort",l)}let E=new XMLHttpRequest;E.open(r.method.toUpperCase(),r.url,!0),E.timeout=r.timeout;function m(){if(!E)return;const A=Ie.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),v={data:!s||s==="text"||s==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:A,config:e,request:E};Gr(function(L){i(L),g()},function(L){n(L),g()},v),E=null}"onloadend"in E?E.onloadend=m:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(m)},E.onabort=function(){E&&(n(new ee("Request aborted",ee.ECONNABORTED,e,E)),E=null)},E.onerror=function(){n(new ee("Network Error",ee.ERR_NETWORK,e,E)),E=null},E.ontimeout=function(){let k=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const v=r.transitional||Wr;r.timeoutErrorMessage&&(k=r.timeoutErrorMessage),n(new ee(k,v.clarifyTimeoutError?ee.ETIMEDOUT:ee.ECONNABORTED,e,E)),E=null},o===void 0&&a.setContentType(null),"setRequestHeader"in E&&y.forEach(a.toJSON(),function(k,v){E.setRequestHeader(v,k)}),y.isUndefined(r.withCredentials)||(E.withCredentials=!!r.withCredentials),s&&s!=="json"&&(E.responseType=r.responseType),p&&([f,h]=ln(p,!0),E.addEventListener("progress",f)),c&&E.upload&&([u,x]=ln(c),E.upload.addEventListener("progress",u),E.upload.addEventListener("loadend",x)),(r.cancelToken||r.signal)&&(l=A=>{E&&(n(!A||A.type?new bt(null,e,E):A),E.abort(),E=null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener("abort",l)));const O=ol(r.url);if(O&&De.protocols.indexOf(O)===-1){n(new ee("Unsupported protocol "+O+":",ee.ERR_BAD_REQUEST,e));return}E.send(o||null)})},fl=(e,t)=>{const{length:i}=e=e?e.filter(Boolean):[];if(t||i){let n=new AbortController,r;const o=function(p){if(!r){r=!0,s();const l=p instanceof Error?p:this.reason;n.abort(l instanceof ee?l:new bt(l instanceof Error?l.message:l))}};let a=t&&setTimeout(()=>{a=null,o(new ee(`timeout ${t} of ms exceeded`,ee.ETIMEDOUT))},t);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(p=>{p.unsubscribe?p.unsubscribe(o):p.removeEventListener("abort",o)}),e=null)};e.forEach(p=>p.addEventListener("abort",o));const{signal:c}=n;return c.unsubscribe=()=>y.asap(s),c}},ml=function*(e,t){let i=e.byteLength;if(i<t){yield e;return}let n=0,r;for(;n<i;)r=n+t,yield e.slice(n,r),n=r},xl=async function*(e,t){for await(const i of vl(e))yield*ml(i,t)},vl=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:i,value:n}=await t.read();if(i)break;yield n}}finally{await t.cancel()}},Qr=(e,t,i,n)=>{const r=xl(e,t);let o=0,a,s=c=>{a||(a=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:p,value:l}=await r.next();if(p){s(),c.close();return}let u=l.byteLength;if(i){let f=o+=u;i(f)}c.enqueue(new Uint8Array(l))}catch(p){throw s(p),p}},cancel(c){return s(c),r.return()}},{highWaterMark:2})},pn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",eo=pn&&typeof ReadableStream=="function",gl=pn&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),to=(e,...t)=>{try{return!!e(...t)}catch{return!1}},hl=eo&&to(()=>{let e=!1;const t=new Request(De.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),no=64*1024,Zn=eo&&to(()=>y.isReadableStream(new Response("").body)),un={stream:Zn&&(e=>e.body)};pn&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!un[t]&&(un[t]=y.isFunction(e[t])?i=>i[t]():(i,n)=>{throw new ee(`Response type '${t}' is not supported`,ee.ERR_NOT_SUPPORT,n)})})})(new Response);const yl=async e=>{if(e==null)return 0;if(y.isBlob(e))return e.size;if(y.isSpecCompliantForm(e))return(await new Request(De.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(y.isArrayBufferView(e)||y.isArrayBuffer(e))return e.byteLength;if(y.isURLSearchParams(e)&&(e=e+""),y.isString(e))return(await gl(e)).byteLength},bl=async(e,t)=>{const i=y.toFiniteNumber(e.getContentLength());return i??yl(t)},Qn={http:Nc,xhr:dl,fetch:pn&&(async e=>{let{url:t,method:i,data:n,signal:r,cancelToken:o,timeout:a,onDownloadProgress:s,onUploadProgress:c,responseType:p,headers:l,withCredentials:u="same-origin",fetchOptions:f}=Zr(e);p=p?(p+"").toLowerCase():"text";let x=fl([r,o&&o.toAbortSignal()],a),h;const g=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let E;try{if(c&&hl&&i!=="get"&&i!=="head"&&(E=await bl(l,n))!==0){let v=new Request(t,{method:"POST",body:n,duplex:"half"}),C;if(y.isFormData(n)&&(C=v.headers.get("content-type"))&&l.setContentType(C),v.body){const[L,j]=Yr(E,ln(Kr(c)));n=Qr(v.body,no,L,j)}}y.isString(u)||(u=u?"include":"omit");const m="credentials"in Request.prototype;h=new Request(t,{...f,signal:x,method:i.toUpperCase(),headers:l.normalize().toJSON(),body:n,duplex:"half",credentials:m?u:void 0});let O=await fetch(h);const A=Zn&&(p==="stream"||p==="response");if(Zn&&(s||A&&g)){const v={};["status","statusText","headers"].forEach(G=>{v[G]=O[G]});const C=y.toFiniteNumber(O.headers.get("content-length")),[L,j]=s&&Yr(C,ln(Kr(s),!0))||[];O=new Response(Qr(O.body,no,L,()=>{j&&j(),g&&g()}),v)}p=p||"text";let k=await un[y.findKey(un,p)||"text"](O,e);return!A&&g&&g(),await new Promise((v,C)=>{Gr(v,C,{data:k,headers:Ie.from(O.headers),status:O.status,statusText:O.statusText,config:e,request:h})})}catch(m){throw g&&g(),m&&m.name==="TypeError"&&/fetch/i.test(m.message)?Object.assign(new ee("Network Error",ee.ERR_NETWORK,e,h),{cause:m.cause||m}):ee.from(m,m&&m.code,e,h)}})};y.forEach(Qn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const io=e=>`- ${e}`,wl=e=>y.isFunction(e)||e===null||e===!1,ro={getAdapter:e=>{e=y.isArray(e)?e:[e];const{length:t}=e;let i,n;const r={};for(let o=0;o<t;o++){i=e[o];let a;if(n=i,!wl(i)&&(n=Qn[(a=String(i)).toLowerCase()],n===void 0))throw new ee(`Unknown adapter '${a}'`);if(n)break;r[a||"#"+o]=n}if(!n){const o=Object.entries(r).map(([s,c])=>`adapter ${s} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since :
51
51
  `+o.map(io).join(`