diff --git a/assets/index-DoUq2zRl.js b/assets/index-CNtespIQ.js similarity index 99% rename from assets/index-DoUq2zRl.js rename to assets/index-CNtespIQ.js index a26ec6f..f6adb8d 100644 --- a/assets/index-DoUq2zRl.js +++ b/assets/index-CNtespIQ.js @@ -65,7 +65,7 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Qo(){return Qo=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[o]=e[o]);return r}function I0(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function M0(e,t){return e.button===0&&(!t||t==="_self")&&!I0(e)}const A0=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],F0="6";try{window.__reactRouterVersion=F0}catch{}function z0(e,t){return Yg({basename:t==null?void 0:t.basename,future:Qo({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:wg({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||j0(),routes:e,mapRouteProperties:L0,unstable_dataStrategy:t==null?void 0:t.unstable_dataStrategy,window:t==null?void 0:t.window}).initialize()}function j0(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Qo({},t,{errors:U0(t.errors)})),t}function U0(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,o]of t)if(o&&o.__type==="RouteErrorResponse")r[n]=new zs(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let l=new i(o.message);l.stack="",r[n]=l}catch{}}if(r[n]==null){let i=new Error(o.message);i.stack="",r[n]=i}}else r[n]=o;return r}const $0=C.createContext({isTransitioning:!1}),B0=C.createContext(new Map),b0="startTransition",Af=am[b0],H0="flushSync",Ff=gg[H0];function W0(e){Af?Af(e):e()}function lo(e){Ff?Ff(e):e()}class V0{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function q0(e){let{fallbackElement:t,router:r,future:n}=e,[o,i]=C.useState(r.state),[l,a]=C.useState(),[u,s]=C.useState({isTransitioning:!1}),[c,p]=C.useState(),[f,w]=C.useState(),[g,S]=C.useState(),k=C.useRef(new Map),{v7_startTransition:y}=n||{},d=C.useCallback(m=>{y?W0(m):m()},[y]),h=C.useCallback((m,N)=>{let{deletedFetchers:I,unstable_flushSync:D,unstable_viewTransitionOpts:B}=N;I.forEach(Q=>k.current.delete(Q)),m.fetchers.forEach((Q,re)=>{Q.data!==void 0&&k.current.set(re,Q.data)});let Y=r.window==null||typeof r.window.document.startViewTransition!="function";if(!B||Y){D?lo(()=>i(m)):d(()=>i(m));return}if(D){lo(()=>{f&&(c&&c.resolve(),f.skipTransition()),s({isTransitioning:!0,flushSync:!0,currentLocation:B.currentLocation,nextLocation:B.nextLocation})});let Q=r.window.document.startViewTransition(()=>{lo(()=>i(m))});Q.finished.finally(()=>{lo(()=>{p(void 0),w(void 0),a(void 0),s({isTransitioning:!1})})}),lo(()=>w(Q));return}f?(c&&c.resolve(),f.skipTransition(),S({state:m,currentLocation:B.currentLocation,nextLocation:B.nextLocation})):(a(m),s({isTransitioning:!0,flushSync:!1,currentLocation:B.currentLocation,nextLocation:B.nextLocation}))},[r.window,f,c,k,d]);C.useLayoutEffect(()=>r.subscribe(h),[r,h]),C.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new V0)},[u]),C.useEffect(()=>{if(c&&l&&r.window){let m=l,N=c.promise,I=r.window.document.startViewTransition(async()=>{d(()=>i(m)),await N});I.finished.finally(()=>{p(void 0),w(void 0),a(void 0),s({isTransitioning:!1})}),w(I)}},[d,l,c,r.window]),C.useEffect(()=>{c&&l&&o.location.key===l.location.key&&c.resolve()},[c,f,o.location,l]),C.useEffect(()=>{!u.isTransitioning&&g&&(a(g.state),s({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),S(void 0))},[u.isTransitioning,g]),C.useEffect(()=>{},[]);let x=C.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:m=>r.navigate(m),push:(m,N,I)=>r.navigate(m,{state:N,preventScrollReset:I==null?void 0:I.preventScrollReset}),replace:(m,N,I)=>r.navigate(m,{replace:!0,state:N,preventScrollReset:I==null?void 0:I.preventScrollReset})}),[r]),_=r.basename||"/",L=C.useMemo(()=>({router:r,navigator:x,static:!1,basename:_}),[r,x,_]);return C.createElement(C.Fragment,null,C.createElement(jl.Provider,{value:L},C.createElement(Bh.Provider,{value:o},C.createElement(B0.Provider,{value:k.current},C.createElement($0.Provider,{value:u},C.createElement(N0,{basename:_,location:o.location,navigationType:o.historyAction,navigator:x,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},o.initialized||r.future.v7_partialHydration?C.createElement(Q0,{routes:r.routes,future:r.future,state:o}):t))))),null)}function Q0(e){let{routes:t,future:r,state:n}=e;return g0(t,void 0,n,r)}const K0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",G0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qh=C.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:i,replace:l,state:a,target:u,to:s,preventScrollReset:c,unstable_viewTransition:p}=t,f=D0(t,A0),{basename:w}=C.useContext(Yr),g,S=!1;if(typeof s=="string"&&G0.test(s)&&(g=s,K0))try{let h=new URL(window.location.href),x=s.startsWith("//")?new URL(h.protocol+s):new URL(s),_=$n(x.pathname,w);x.origin===h.origin&&_!=null?s=_+x.search+x.hash:S=!0}catch{}let k=h0(s,{relative:o}),y=Y0(s,{replace:l,state:a,target:u,preventScrollReset:c,relative:o,unstable_viewTransition:p});function d(h){n&&n(h),h.defaultPrevented||y(h)}return C.createElement("a",Qo({},f,{href:g||k,onClick:S||i?n:d,ref:r,target:u}))});var zf;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(zf||(zf={}));var jf;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(jf||(jf={}));function Y0(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:a}=t===void 0?{}:t,u=y0(),s=$l(),c=Wh(e,{relative:l});return C.useCallback(p=>{if(M0(p,r)){p.preventDefault();let f=n!==void 0?n:qr(s)===qr(c);u(e,{replace:f,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:a})}},[s,u,c,n,o,r,e,i,l,a])}const J0=()=>{const[e,t]=C.useState("");return C.useEffect(()=>{let r=0;const n=setInterval(()=>{r=(r+1)%4;let o="";for(let i=0;iclearInterval(n)},[]),H.jsxs("div",{className:"title-text h-screen font-mono disable-select -z-10",children:[H.jsx("div",{className:"h-1/2 relative -z-10",children:H.jsx("div",{className:"absolute bottom-0 text-2xl pl-7 pb-5",children:"I am pursuing a CS degree"})}),H.jsx("div",{className:"h-1/2 relative -z-10",children:H.jsxs("div",{className:"absolute text-5xl pl-5 sm:text-6xl md:text-7xl lg:text-8xl xl:text-9xl",children:["BUT HOW DO I ",e]})})]})},X0=[{title:"How Do I Implement Pagination in React",tags:["react","javascript"],id:0},{title:"How Do I Use Scroll, Blur and Opactiy",tags:["javascript","react"],id:1},{title:"How Do I Use setInterval() For Repeating A Content",tags:["javascript","react"],id:2},{title:"How Do I Fetch Raw HTML Content From GitHub",tags:["react"],id:3}],Z0=({title:e,tags:t})=>{const r=C.useMemo(()=>t.sort((n,o)=>n.localeCompare(o)),[t]);return H.jsx(Qh,{to:`/post/${e}`,children:H.jsxs("div",{className:` + */function Qo(){return Qo=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[o]=e[o]);return r}function I0(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function M0(e,t){return e.button===0&&(!t||t==="_self")&&!I0(e)}const A0=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],F0="6";try{window.__reactRouterVersion=F0}catch{}function z0(e,t){return Yg({basename:t==null?void 0:t.basename,future:Qo({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:wg({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||j0(),routes:e,mapRouteProperties:L0,unstable_dataStrategy:t==null?void 0:t.unstable_dataStrategy,window:t==null?void 0:t.window}).initialize()}function j0(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Qo({},t,{errors:U0(t.errors)})),t}function U0(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,o]of t)if(o&&o.__type==="RouteErrorResponse")r[n]=new zs(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let l=new i(o.message);l.stack="",r[n]=l}catch{}}if(r[n]==null){let i=new Error(o.message);i.stack="",r[n]=i}}else r[n]=o;return r}const $0=C.createContext({isTransitioning:!1}),B0=C.createContext(new Map),b0="startTransition",Af=am[b0],H0="flushSync",Ff=gg[H0];function W0(e){Af?Af(e):e()}function lo(e){Ff?Ff(e):e()}class V0{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function q0(e){let{fallbackElement:t,router:r,future:n}=e,[o,i]=C.useState(r.state),[l,a]=C.useState(),[u,s]=C.useState({isTransitioning:!1}),[c,p]=C.useState(),[f,w]=C.useState(),[g,S]=C.useState(),k=C.useRef(new Map),{v7_startTransition:y}=n||{},d=C.useCallback(m=>{y?W0(m):m()},[y]),h=C.useCallback((m,N)=>{let{deletedFetchers:I,unstable_flushSync:D,unstable_viewTransitionOpts:B}=N;I.forEach(Q=>k.current.delete(Q)),m.fetchers.forEach((Q,re)=>{Q.data!==void 0&&k.current.set(re,Q.data)});let Y=r.window==null||typeof r.window.document.startViewTransition!="function";if(!B||Y){D?lo(()=>i(m)):d(()=>i(m));return}if(D){lo(()=>{f&&(c&&c.resolve(),f.skipTransition()),s({isTransitioning:!0,flushSync:!0,currentLocation:B.currentLocation,nextLocation:B.nextLocation})});let Q=r.window.document.startViewTransition(()=>{lo(()=>i(m))});Q.finished.finally(()=>{lo(()=>{p(void 0),w(void 0),a(void 0),s({isTransitioning:!1})})}),lo(()=>w(Q));return}f?(c&&c.resolve(),f.skipTransition(),S({state:m,currentLocation:B.currentLocation,nextLocation:B.nextLocation})):(a(m),s({isTransitioning:!0,flushSync:!1,currentLocation:B.currentLocation,nextLocation:B.nextLocation}))},[r.window,f,c,k,d]);C.useLayoutEffect(()=>r.subscribe(h),[r,h]),C.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new V0)},[u]),C.useEffect(()=>{if(c&&l&&r.window){let m=l,N=c.promise,I=r.window.document.startViewTransition(async()=>{d(()=>i(m)),await N});I.finished.finally(()=>{p(void 0),w(void 0),a(void 0),s({isTransitioning:!1})}),w(I)}},[d,l,c,r.window]),C.useEffect(()=>{c&&l&&o.location.key===l.location.key&&c.resolve()},[c,f,o.location,l]),C.useEffect(()=>{!u.isTransitioning&&g&&(a(g.state),s({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),S(void 0))},[u.isTransitioning,g]),C.useEffect(()=>{},[]);let x=C.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:m=>r.navigate(m),push:(m,N,I)=>r.navigate(m,{state:N,preventScrollReset:I==null?void 0:I.preventScrollReset}),replace:(m,N,I)=>r.navigate(m,{replace:!0,state:N,preventScrollReset:I==null?void 0:I.preventScrollReset})}),[r]),_=r.basename||"/",L=C.useMemo(()=>({router:r,navigator:x,static:!1,basename:_}),[r,x,_]);return C.createElement(C.Fragment,null,C.createElement(jl.Provider,{value:L},C.createElement(Bh.Provider,{value:o},C.createElement(B0.Provider,{value:k.current},C.createElement($0.Provider,{value:u},C.createElement(N0,{basename:_,location:o.location,navigationType:o.historyAction,navigator:x,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},o.initialized||r.future.v7_partialHydration?C.createElement(Q0,{routes:r.routes,future:r.future,state:o}):t))))),null)}function Q0(e){let{routes:t,future:r,state:n}=e;return g0(t,void 0,n,r)}const K0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",G0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qh=C.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:i,replace:l,state:a,target:u,to:s,preventScrollReset:c,unstable_viewTransition:p}=t,f=D0(t,A0),{basename:w}=C.useContext(Yr),g,S=!1;if(typeof s=="string"&&G0.test(s)&&(g=s,K0))try{let h=new URL(window.location.href),x=s.startsWith("//")?new URL(h.protocol+s):new URL(s),_=$n(x.pathname,w);x.origin===h.origin&&_!=null?s=_+x.search+x.hash:S=!0}catch{}let k=h0(s,{relative:o}),y=Y0(s,{replace:l,state:a,target:u,preventScrollReset:c,relative:o,unstable_viewTransition:p});function d(h){n&&n(h),h.defaultPrevented||y(h)}return C.createElement("a",Qo({},f,{href:g||k,onClick:S||i?n:d,ref:r,target:u}))});var zf;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(zf||(zf={}));var jf;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(jf||(jf={}));function Y0(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:a}=t===void 0?{}:t,u=y0(),s=$l(),c=Wh(e,{relative:l});return C.useCallback(p=>{if(M0(p,r)){p.preventDefault();let f=n!==void 0?n:qr(s)===qr(c);u(e,{replace:f,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:a})}},[s,u,c,n,o,r,e,i,l,a])}const J0=()=>{const[e,t]=C.useState("");return C.useEffect(()=>{let r=0;const n=setInterval(()=>{r=(r+1)%4;let o="";for(let i=0;iclearInterval(n)},[]),H.jsxs("div",{className:"title-text h-screen font-mono disable-select -z-10",children:[H.jsx("div",{className:"h-1/2 relative -z-10",children:H.jsx("div",{className:"absolute bottom-0 text-2xl pl-7 pb-5",children:"I am pursuing a CS degree"})}),H.jsx("div",{className:"h-1/2 relative -z-10",children:H.jsxs("div",{className:"absolute text-5xl pl-5 sm:text-6xl md:text-7xl lg:text-8xl xl:text-9xl",children:["BUT HOW DO I ",e]})})]})},X0=[{title:"How Do I Implement Pagination in React",tags:["react","javascript"],id:0},{title:"How Do I Use Scroll, Blur and Opactiy",tags:["javascript","react"],id:1},{title:"How Do I Use setInterval() For Repeating A Content",tags:["javascript","react"],id:2},{title:"How Do I Fetch Raw HTML Content From GitHub",tags:["react"],id:3}],Z0=({title:e,tags:t})=>{const r=C.useMemo(()=>t.sort((n,o)=>n.localeCompare(o)),[t]);return H.jsx(Qh,{to:`/but-how-do-I/post/${e}`,children:H.jsxs("div",{className:` w-4/5 mx-auto rounded-lg @@ -189,7 +189,7 @@ Error generating stack: `+i.message+` `+t.prev+t.base;return r+Mt.call(e,","+r)+` `+t.prev}function Ri(e,t){var r=Mu(e),n=[];if(r){n.length=e.length;for(var o=0;o1;){var r=t.pop(),n=r.obj[r.prop];if(Nr(n)){for(var o=[],i=0;i=Na?l.slice(u,u+Na):l,c=[],p=0;p=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||i===Vw.RFC1738&&(f===40||f===41)){c[c.length]=s.charAt(p);continue}if(f<128){c[c.length]=Lt[f];continue}if(f<2048){c[c.length]=Lt[192|f>>6]+Lt[128|f&63];continue}if(f<55296||f>=57344){c[c.length]=Lt[224|f>>12]+Lt[128|f>>6&63]+Lt[128|f&63];continue}p+=1,f=65536+((f&1023)<<10|s.charCodeAt(p)&1023),c[c.length]=Lt[240|f>>18]+Lt[128|f>>12&63]+Lt[128|f>>6&63]+Lt[128|f&63]}a+=c.join("")}return a},Jw=function(t){for(var r=[{obj:{o:t},prop:"o"}],n=[],o=0;o"u"&&(_=0)}if(typeof c=="function"?h=c(r,h):h instanceof Date?h=w(h):n==="comma"&&It(h)&&(h=Hi.maybeMap(h,function(U){return U instanceof Date?w(U):U})),h===null){if(l)return s&&!k?s(r,we.encoder,y,"key",g):r;h=""}if(iS(h)||Hi.isBuffer(h)){if(s){var N=k?r:s(r,we.encoder,y,"key",g);return[S(N)+"="+S(s(h,we.encoder,y,"value",g))]}return[S(r)+"="+S(String(h))]}var I=[];if(typeof h>"u")return I;var D;if(n==="comma"&&It(h))k&&s&&(h=Hi.maybeMap(h,s)),D=[{value:h.length>0?h.join(",")||null:void 0}];else if(It(c))D=c;else{var B=Object.keys(h);D=p?B.sort(p):B}var Y=u?r.replace(/\./g,"%2E"):r,Q=o&&It(h)&&h.length===1?Y+"[]":Y;if(i&&It(h)&&h.length===0)return Q+"[]";for(var re=0;re"u"?t.encodeDotInKeys===!0?!0:we.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:we.addQueryPrefix,allowDots:a,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:we.allowEmptyArrays,arrayFormat:l,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:we.charsetSentinel,commaRoundTrip:t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?we.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:we.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:we.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:we.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:we.encodeValuesOnly,filter:i,format:n,formatter:o,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:we.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:we.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:we.strictNullHandling}},uS=function(e,t){var r=e,n=aS(t),o,i;typeof n.filter=="function"?(i=n.filter,r=i("",r)):It(n.filter)&&(i=n.filter,o=i);var l=[];if(typeof r!="object"||r===null)return"";var a=fy[n.arrayFormat],u=a==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);for(var s=cy(),c=0;c0?w+f:""},Fn=sy,Fu=Object.prototype.hasOwnProperty,sS=Array.isArray,he={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Fn.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},cS=function(e){return e.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},py=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},fS="utf8=%26%2310003%3B",dS="utf8=%E2%9C%93",pS=function(t,r){var n={__proto__:null},o=r.ignoreQueryPrefix?t.replace(/^\?/,""):t,i=r.parameterLimit===1/0?void 0:r.parameterLimit,l=o.split(r.delimiter,i),a=-1,u,s=r.charset;if(r.charsetSentinel)for(u=0;u-1&&(g=sS(g)?[g]:g);var S=Fu.call(n,w);S&&r.duplicates==="combine"?n[w]=Fn.combine(n[w],g):(!S||r.duplicates==="last")&&(n[w]=g)}return n},hS=function(e,t,r,n){for(var o=n?t:py(t,r),i=e.length-1;i>=0;--i){var l,a=e[i];if(a==="[]"&&r.parseArrays)l=r.allowEmptyArrays&&o===""?[]:[].concat(o);else{l=r.plainObjects?Object.create(null):{};var u=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,s=r.decodeDotInKeys?u.replace(/%2E/g,"."):u,c=parseInt(s,10);!r.parseArrays&&s===""?l={0:o}:!isNaN(c)&&a!==s&&String(c)===s&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(l=[],l[c]=o):s!=="__proto__"&&(l[s]=o)}o=l}return o},yS=function(t,r,n,o){if(t){var i=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,l=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,u=n.depth>0&&l.exec(i),s=u?i.slice(0,u.index):i,c=[];if(s){if(!n.plainObjects&&Fu.call(Object.prototype,s)&&!n.allowPrototypes)return;c.push(s)}for(var p=0;n.depth>0&&(u=a.exec(i))!==null&&p"u"?he.charset:t.charset,n=typeof t.duplicates>"u"?he.duplicates:t.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:he.allowDots:!!t.allowDots;return{allowDots:o,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:he.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:he.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:he.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:he.arrayLimit,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:he.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:he.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:he.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:he.decoder,delimiter:typeof t.delimiter=="string"||Fn.isRegExp(t.delimiter)?t.delimiter:he.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:he.depth,duplicates:n,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:he.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:he.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:he.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:he.strictNullHandling}},vS=function(e,t){var r=mS(t);if(e===""||e===null||typeof e>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof e=="string"?pS(e,r):e,o=r.plainObjects?Object.create(null):{},i=Object.keys(n),l=0;l-1};function Hn(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Ks(e){return typeof e!="string"&&(e=String(e)),e}function Gs(e){var t={next:function(){var r=e.shift();return{done:r===void 0,value:r}}};return Be.iterable&&(t[Symbol.iterator]=function(){return t}),t}function xe(e){this.map={},e instanceof xe?e.forEach(function(t,r){this.append(r,t)},this):Array.isArray(e)?e.forEach(function(t){if(t.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}xe.prototype.append=function(e,t){e=Hn(e),t=Ks(t);var r=this.map[e];this.map[e]=r?r+", "+t:t};xe.prototype.delete=function(e){delete this.map[Hn(e)]};xe.prototype.get=function(e){return e=Hn(e),this.has(e)?this.map[e]:null};xe.prototype.has=function(e){return this.map.hasOwnProperty(Hn(e))};xe.prototype.set=function(e,t){this.map[Hn(e)]=Ks(t)};xe.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)};xe.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),Gs(e)};xe.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),Gs(e)};xe.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),Gs(e)};Be.iterable&&(xe.prototype[Symbol.iterator]=xe.prototype.entries);function Da(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}}function yy(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function _S(e){var t=new FileReader,r=yy(t);return t.readAsArrayBuffer(e),r}function kS(e){var t=new FileReader,r=yy(t),n=/charset=([A-Za-z0-9_-]+)/.exec(e.type),o=n?n[1]:"utf-8";return t.readAsText(e,o),r}function CS(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n-1?t:e}function Qr(e,t){if(!(this instanceof Qr))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var r=t.body;if(e instanceof Qr){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new xe(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!r&&e._bodyInit!=null&&(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new xe(t.headers)),this.method=TS(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in Le){var i=new AbortController;return i.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var o=/\?/;this.url+=(o.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}Qr.prototype.clone=function(){return new Qr(this,{body:this._bodyInit})};function OS(e){var t=new FormData;return e.trim().split("&").forEach(function(r){if(r){var n=r.split("="),o=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(o),decodeURIComponent(i))}}),t}function NS(e){var t=new xe,r=e.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(` `)===0?n.substr(1,n.length):n}).forEach(function(n){var o=n.split(":"),i=o.shift().trim();if(i){var l=o.join(":").trim();try{t.append(i,l)}catch(a){console.warn("Response "+a.message)}}}),t}my.call(Qr.prototype);function Ut(e,t){if(!(this instanceof Ut))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new xe(t.headers),this.url=t.url||"",this._initBody(e)}my.call(Ut.prototype);Ut.prototype.clone=function(){return new Ut(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new xe(this.headers),url:this.url})};Ut.error=function(){var e=new Ut(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var LS=[301,302,303,307,308];Ut.redirect=function(e,t){if(LS.indexOf(t)===-1)throw new RangeError("Invalid status code");return new Ut(null,{status:t,headers:{location:e}})};var Lr=Le.DOMException;try{new Lr}catch{Lr=function(t,r){this.message=t,this.name=r;var n=Error(t);this.stack=n.stack},Lr.prototype=Object.create(Error.prototype),Lr.prototype.constructor=Lr}function vy(e,t){return new Promise(function(r,n){var o=new Qr(e,t);if(o.signal&&o.signal.aborted)return n(new Lr("Aborted","AbortError"));var i=new XMLHttpRequest;function l(){i.abort()}i.onload=function(){var s={statusText:i.statusText,headers:NS(i.getAllResponseHeaders()||"")};o.url.indexOf("file://")===0&&(i.status<200||i.status>599)?s.status=200:s.status=i.status,s.url="responseURL"in i?i.responseURL:s.headers.get("X-Request-URL");var c="response"in i?i.response:i.responseText;setTimeout(function(){r(new Ut(c,s))},0)},i.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},i.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request timed out"))},0)},i.onabort=function(){setTimeout(function(){n(new Lr("Aborted","AbortError"))},0)};function a(s){try{return s===""&&Le.location.href?Le.location.href:s}catch{return s}}if(i.open(o.method,a(o.url),!0),o.credentials==="include"?i.withCredentials=!0:o.credentials==="omit"&&(i.withCredentials=!1),"responseType"in i&&(Be.blob?i.responseType="blob":Be.arrayBuffer&&(i.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof xe||Le.Headers&&t.headers instanceof Le.Headers)){var u=[];Object.getOwnPropertyNames(t.headers).forEach(function(s){u.push(Hn(s)),i.setRequestHeader(s,Ks(t.headers[s]))}),o.headers.forEach(function(s,c){u.indexOf(c)===-1&&i.setRequestHeader(c,s)})}else o.headers.forEach(function(s,c){i.setRequestHeader(c,s)});o.signal&&(o.signal.addEventListener("abort",l),i.onreadystatechange=function(){i.readyState===4&&o.signal.removeEventListener("abort",l)}),i.send(typeof o._bodyInit>"u"?null:o._bodyInit)})}vy.polyfill=!0;Le.fetch||(Le.fetch=vy,Le.Headers=xe,Le.Request=Qr,Le.Response=Ut);self.fetch.bind(self);var gy={};function sd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Qe(e){for(var t=1;t"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 Wi(e,t,r){return Sy()?Wi=Reflect.construct:Wi=function(o,i,l){var a=[null];a.push.apply(a,i);var u=Function.bind.apply(o,a),s=new u;return l&&Go(s,l.prototype),s},Wi.apply(null,arguments)}function IS(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Sl(e){var t=typeof Map=="function"?new Map:void 0;return Sl=function(n){if(n===null||!IS(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,o)}function o(){return Wi(n,arguments,Ko(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Go(o,n)},Sl(e)}function MS(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AS(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return MS(e)}function Ey(e){var t=Sy();return function(){var n=Ko(e),o;if(t){var i=Ko(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return AS(this,o)}}function Ft(e){return FS(e)||zS(e)||jS(e)||US()}function FS(e){if(Array.isArray(e))return zu(e)}function zS(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jS(e,t){if(e){if(typeof e=="string")return zu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zu(e,t)}}function zu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:{global:!1,core:!1,defaultInstance:!1},o=!1,i=!1,l=!1;if(typeof n=="number"?(process,o=!0,i=!1):wr(n)==="object"&&n&&(i=n.global||!1,o=n.core||!1,l=n.defaultInstance||!1),i){e.globalMiddlewares.splice(e.globalMiddlewares.length-e.defaultGlobalMiddlewaresLength,0,r);return}if(o){e.coreMiddlewares.splice(e.coreMiddlewares.length-e.defaultCoreMiddlewaresLength,0,r);return}if(l){this.defaultMiddlewares.push(r);return}this.middlewares.push(r)}},{key:"execute",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=$S([].concat(Ft(this.middlewares),Ft(this.defaultMiddlewares),Ft(e.globalMiddlewares),Ft(e.coreMiddlewares)));return n(r)}}]),e}();Tt.globalMiddlewares=[];Tt.defaultGlobalMiddlewaresLength=0;Tt.coreMiddlewares=[];Tt.defaultCoreMiddlewaresLength=0;var BS=function(){function e(t){oi(this,e),this.cache=new Map,this.timer={},this.extendOptions(t)}return Ys(e,[{key:"extendOptions",value:function(r){this.maxCache=r.maxCache||0}},{key:"get",value:function(r){return this.cache.get(JSON.stringify(r))}},{key:"set",value:function(r,n){var o=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:6e4;if(this.maxCache>0&&this.cache.size>=this.maxCache){var l=Ft(this.cache.keys())[0];this.cache.delete(l),this.timer[l]&&clearTimeout(this.timer[l])}var a=JSON.stringify(r);this.cache.set(a,n),i>0&&(this.timer[a]=setTimeout(function(){o.cache.delete(a),delete o.timer[a]},i))}},{key:"delete",value:function(r){var n=JSON.stringify(r);return delete this.timer[n],this.cache.delete(n)}},{key:"clear",value:function(){return this.timer={},this.cache.clear()}}]),e}(),xy=function(e){wy(r,e);var t=Ey(r);function r(n,o){var i,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"RequestError";return oi(this,r),i=t.call(this,n),i.name="RequestError",i.request=o,i.type=l,i}return r}(Sl(Error)),po=function(e){wy(r,e);var t=Ey(r);function r(n,o,i,l){var a,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"ResponseError";return oi(this,r),a=t.call(this,o||n.statusText),a.name="ResponseError",a.data=i,a.response=n,a.request=l,a.type=u,a}return r}(Sl(Error));function bS(e){return new Promise(function(t,r){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=r,n.readAsText(e,"GBK")})}function fd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;try{return JSON.parse(e)}catch{if(t)throw new po(r,"JSON.parse fail",e,n,"ParseError")}return e}function HS(e,t,r){return new Promise(function(n,o){setTimeout(function(){o(new xy(t||"timeout of ".concat(e,"ms exceeded"),r,"Timeout"))},e)})}function dd(e){return new Promise(function(t,r){e.cancelToken&&e.cancelToken.promise.then(function(n){r(n)})})}var WS=Object.prototype.toString;function Py(){var e;return typeof process<"u"&&WS.call(process)==="[object process]"&&(e="NODE"),typeof XMLHttpRequest<"u"&&(e="BROWSER"),e}function ju(e){return wr(e)==="object"&&Object.prototype.toString.call(e)==="[object Array]"}function _y(e){return typeof URLSearchParams<"u"&&e instanceof URLSearchParams}function VS(e){return wr(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function pd(e){return e!==null&&wr(e)==="object"}function hd(e,t){if(e)if(wr(e)!=="object"&&(e=[e]),ju(e))for(var r=0;r1&&arguments[1]!==void 0?arguments[1]:{},n=r.prefix,o=r.suffix;return n&&(t="".concat(n).concat(t)),o&&(t="".concat(t).concat(o)),{url:t,options:r}};function QS(e,t){var r=t.method,n=r===void 0?"get":r;return n.toLowerCase()==="get"}function KS(e,t){if(!e)return t();var r=e.req;r=r===void 0?{}:r;var n=r.options,o=n===void 0?{}:n,i=r.url,l=i===void 0?"":i,a=e.cache,u=e.responseInterceptors,s=o.timeout,c=s===void 0?0:s,p=o.timeoutMessage,f=o.__umiRequestCoreType__,w=f===void 0?"normal":f,g=o.useCache,S=g===void 0?!1:g,k=o.method,y=k===void 0?"get":k,d=o.params,h=o.ttl,x=o.validateCache,_=x===void 0?QS:x;if(w!=="normal")return process,t();var L=fetch;if(!L)throw new Error("Global fetch not exist!");var m=Py()==="BROWSER",N=_(l,o)&&S&&m;if(N){var I=a.get({url:l,params:d,method:y});if(I)return I=I.clone(),I.useCache=!0,e.res=I,t()}var D;return c>0?D=Promise.race([dd(o),L(l,o),HS(c,p,e.req)]):D=Promise.race([dd(o),L(l,o)]),u.forEach(function(B){D=D.then(function(Y){var Q=typeof Y.clone=="function"?Y.clone():Y;return B(Q,o)})}),D.then(function(B){if(N&&B.status===200){var Y=B.clone();Y.useCache=!0,a.set({url:l,params:d,method:y},Y,h)}return e.res=B,t()})}function GS(e,t){var r;return t().then(function(){if(e){var n=e.res,o=n===void 0?{}:n,i=e.req,l=i===void 0?{}:i,a=l||{},u=a.options;u=u===void 0?{}:u;var s=u.responseType,c=s===void 0?"json":s,p=u.charset,f=p===void 0?"utf8":p;u.getResponse;var w=u.throwErrIfParseFail,g=w===void 0?!1:w,S=u.parseResponse,k=S===void 0?!0:S;if(k&&!(!o||!o.clone)){if(r=Py()==="BROWSER"?o.clone():o,r.useCache=o.useCache||!1,f==="gbk")try{return o.blob().then(bS).then(function(y){return fd(y,!1,r,l)})}catch(y){throw new po(r,y.message,null,l,"ParseError")}else if(c==="json")return o.text().then(function(y){return fd(y,g,r,l)});try{return o[c]()}catch{throw new po(r,"responseType not support",null,l,"ParseError")}}}}).then(function(n){if(e){e.res;var o=e.req,i=o===void 0?{}:o,l=i||{},a=l.options;a=a===void 0?{}:a;var u=a.getResponse,s=u===void 0?!1:u;if(r){if(r.status>=200&&r.status<300){if(s){e.res={data:n,response:r};return}e.res=n;return}throw new po(r,"http error",n,i,"HttpError")}}}).catch(function(n){if(n instanceof xy||n instanceof po)throw n;var o=e.req,i=e.res;throw n.request=n.request||o,n.response=n.response||i,n.type=n.type||n.name,n.data=n.data||void 0,n})}function YS(e,t){if(!e)return t();var r=e.req;r=r===void 0?{}:r;var n=r.options,o=n===void 0?{}:n,i=o.method,l=i===void 0?"get":i;if(["post","put","patch","delete"].indexOf(l.toLowerCase())===-1)return t();var a=o.requestType,u=a===void 0?"json":a,s=o.data;if(s){var c=Object.prototype.toString.call(s);c==="[object Object]"||c==="[object Array]"?u==="json"?(o.headers=Qe({Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},o.headers),o.body=JSON.stringify(s)):u==="form"&&(o.headers=Qe({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},o.headers),o.body=Uu(s)):(o.headers=Qe({Accept:"application/json"},o.headers),o.body=s)}return e.req.options=o,t()}function JS(e,t){var r,n;if(e)if(t)r=t(e);else if(_y(e))r=e.toString();else if(ju(e))n=[],hd(e,function(i){i===null||typeof i>"u"?n.push(i):n.push(pd(i)?JSON.stringify(i):i)}),r=Uu(n);else{n={},hd(e,function(i,l){var a=i;i===null||typeof i>"u"?n[l]=i:VS(i)?a=i.toISOString():ju(i)?a=i:pd(i)&&(a=JSON.stringify(i)),n[l]=a});var o=Uu(n);r=o}return r}function XS(e,t){if(!e)return t();var r=e.req;r=r===void 0?{}:r;var n=r.options,o=n===void 0?{}:n,i=o.paramsSerializer,l=o.params,a=e.req;a=a===void 0?{}:a;var u=a.url,s=u===void 0?"":u;o.method=o.method?o.method.toUpperCase():"GET",o.credentials=o.credentials||"same-origin";var c=JS(l,i);if(e.req.originUrl=s,c){var p=s.indexOf("?")!==-1?"&":"?";e.req.url="".concat(s).concat(p).concat(c)}return e.req.options=o,t()}var Cy=[YS,XS,GS],Ry=[KS];Tt.globalMiddlewares=Cy;Tt.defaultGlobalMiddlewaresLength=Cy.length;Tt.coreMiddlewares=Ry;Tt.defaultCoreMiddlewaresLength=Ry.length;var Ro=function(){function e(t){oi(this,e),this.onion=new Tt([]),this.fetchIndex=0,this.mapCache=new BS(t),this.initOptions=t,this.instanceRequestInterceptors=[],this.instanceResponseInterceptors=[]}return Ys(e,[{key:"use",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!1,core:!1};return this.onion.use(r,n),this}},{key:"extendOptions",value:function(r){this.initOptions=ky(this.initOptions,r),this.mapCache.extendOptions(r)}},{key:"dealRequestInterceptors",value:function(r){var n=function(l,a){return l.then(function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return r.req.url=u.url||r.req.url,r.req.options=u.options||r.req.options,a(r.req.url,r.req.options)})},o=[].concat(Ft(e.requestInterceptors),Ft(this.instanceRequestInterceptors));return o.reduce(n,Promise.resolve()).then(function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return r.req.url=i.url||r.req.url,r.req.options=i.options||r.req.options,Promise.resolve()})}},{key:"request",value:function(r,n){var o=this,i=this.onion,l={req:{url:r,options:Qe(Qe({},n),{},{url:r})},res:null,cache:this.mapCache,responseInterceptors:[].concat(Ft(e.responseInterceptors),Ft(this.instanceResponseInterceptors))};if(typeof r!="string")throw new Error("url MUST be a string");return new Promise(function(a,u){o.dealRequestInterceptors(l).then(function(){return i.execute(l)}).then(function(){a(l.res)}).catch(function(s){var c=l.req.options.errorHandler;if(c)try{var p=c(s);a(p)}catch(f){u(f)}else u(s)})})}}],[{key:"requestUse",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!0};if(typeof r!="function")throw new TypeError("Interceptor must be function!");n.global?e.requestInterceptors.push(r):this.instanceRequestInterceptors.push(r)}},{key:"responseUse",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!0};if(typeof r!="function")throw new TypeError("Interceptor must be function!");n.global?e.responseInterceptors.push(r):this.instanceResponseInterceptors.push(r)}}]),e}();Ro.requestInterceptors=[qS];Ro.responseInterceptors=[];function Bl(e){this.message=e}Bl.prototype.toString=function(){return this.message?"Cancel: ".concat(this.message):"Cancel"};Bl.prototype.__CANCEL__=!0;function El(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(o){t=o});var r=this;e(function(o){r.reason||(r.reason=new Bl(o),t(r.reason))})}El.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};El.source=function(){var t,r=new El(function(o){t=o});return{token:r,cancel:t}};function ZS(e){return!!(e&&e.__CANCEL__)}var Ty=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=new Ro(t),n=function(l){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=ky(r.initOptions,a);return r.request(l,u)};n.use=r.use.bind(r),n.fetchIndex=r.fetchIndex,n.interceptors={request:{use:Ro.requestUse.bind(r)},response:{use:Ro.responseUse.bind(r)}};var o=["get","post","delete","put","patch","head","options","rpc"];return o.forEach(function(i){n[i]=function(l,a){return n(l,Qe(Qe({},a),{},{method:i}))}}),n.Cancel=Bl,n.CancelToken=El,n.isCancel=ZS,n.extendOptions=r.extendOptions.bind(r),n.middlewares={instance:r.onion.middlewares,defaultInstance:r.onion.defaultMiddlewares,global:Tt.globalMiddlewares,core:Tt.coreMiddlewares},n};Ty({parseResponse:!1});var eE=Ty({});const tE=()=>{const{title:e}=v0(),[t,r]=C.useState(""),n=async o=>{const l=`https://raw.githubusercontent.com/nathanlao/but-how-do-I/master/src/posts/${encodeURIComponent(o)}.html`;try{return await eE(l,{method:"get",responseType:"text"})}catch(a){console.error("Error fetching the HTML content:",a)}};return C.useEffect(()=>{(async()=>{const i=await n(e);r(i)})()},[e]),H.jsxs("div",{children:[H.jsxs("div",{className:"relative w-4/5 sm:w-4/5 md:w-4/5 lg:w-3/5 xl:w-1/2 mx-auto py-20",children:[H.jsx("div",{className:"font-mono text-post text-5xl text-center pb-10 px-2 leading-tight",children:e}),H.jsx("div",{className:"px-2",dangerouslySetInnerHTML:{__html:t}})]}),H.jsx(Qh,{to:"/",children:H.jsx("div",{className:` +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $S(e){if(!Array.isArray(e))throw new TypeError("Middlewares must be an array!");for(var t=e.length,r=0;r1&&arguments[1]!==void 0?arguments[1]:{global:!1,core:!1,defaultInstance:!1},o=!1,i=!1,l=!1;if(typeof n=="number"?(process,o=!0,i=!1):wr(n)==="object"&&n&&(i=n.global||!1,o=n.core||!1,l=n.defaultInstance||!1),i){e.globalMiddlewares.splice(e.globalMiddlewares.length-e.defaultGlobalMiddlewaresLength,0,r);return}if(o){e.coreMiddlewares.splice(e.coreMiddlewares.length-e.defaultCoreMiddlewaresLength,0,r);return}if(l){this.defaultMiddlewares.push(r);return}this.middlewares.push(r)}},{key:"execute",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=$S([].concat(Ft(this.middlewares),Ft(this.defaultMiddlewares),Ft(e.globalMiddlewares),Ft(e.coreMiddlewares)));return n(r)}}]),e}();Tt.globalMiddlewares=[];Tt.defaultGlobalMiddlewaresLength=0;Tt.coreMiddlewares=[];Tt.defaultCoreMiddlewaresLength=0;var BS=function(){function e(t){oi(this,e),this.cache=new Map,this.timer={},this.extendOptions(t)}return Ys(e,[{key:"extendOptions",value:function(r){this.maxCache=r.maxCache||0}},{key:"get",value:function(r){return this.cache.get(JSON.stringify(r))}},{key:"set",value:function(r,n){var o=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:6e4;if(this.maxCache>0&&this.cache.size>=this.maxCache){var l=Ft(this.cache.keys())[0];this.cache.delete(l),this.timer[l]&&clearTimeout(this.timer[l])}var a=JSON.stringify(r);this.cache.set(a,n),i>0&&(this.timer[a]=setTimeout(function(){o.cache.delete(a),delete o.timer[a]},i))}},{key:"delete",value:function(r){var n=JSON.stringify(r);return delete this.timer[n],this.cache.delete(n)}},{key:"clear",value:function(){return this.timer={},this.cache.clear()}}]),e}(),xy=function(e){wy(r,e);var t=Ey(r);function r(n,o){var i,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"RequestError";return oi(this,r),i=t.call(this,n),i.name="RequestError",i.request=o,i.type=l,i}return r}(Sl(Error)),po=function(e){wy(r,e);var t=Ey(r);function r(n,o,i,l){var a,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"ResponseError";return oi(this,r),a=t.call(this,o||n.statusText),a.name="ResponseError",a.data=i,a.response=n,a.request=l,a.type=u,a}return r}(Sl(Error));function bS(e){return new Promise(function(t,r){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=r,n.readAsText(e,"GBK")})}function fd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;try{return JSON.parse(e)}catch{if(t)throw new po(r,"JSON.parse fail",e,n,"ParseError")}return e}function HS(e,t,r){return new Promise(function(n,o){setTimeout(function(){o(new xy(t||"timeout of ".concat(e,"ms exceeded"),r,"Timeout"))},e)})}function dd(e){return new Promise(function(t,r){e.cancelToken&&e.cancelToken.promise.then(function(n){r(n)})})}var WS=Object.prototype.toString;function Py(){var e;return typeof process<"u"&&WS.call(process)==="[object process]"&&(e="NODE"),typeof XMLHttpRequest<"u"&&(e="BROWSER"),e}function ju(e){return wr(e)==="object"&&Object.prototype.toString.call(e)==="[object Array]"}function _y(e){return typeof URLSearchParams<"u"&&e instanceof URLSearchParams}function VS(e){return wr(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function pd(e){return e!==null&&wr(e)==="object"}function hd(e,t){if(e)if(wr(e)!=="object"&&(e=[e]),ju(e))for(var r=0;r1&&arguments[1]!==void 0?arguments[1]:{},n=r.prefix,o=r.suffix;return n&&(t="".concat(n).concat(t)),o&&(t="".concat(t).concat(o)),{url:t,options:r}};function QS(e,t){var r=t.method,n=r===void 0?"get":r;return n.toLowerCase()==="get"}function KS(e,t){if(!e)return t();var r=e.req;r=r===void 0?{}:r;var n=r.options,o=n===void 0?{}:n,i=r.url,l=i===void 0?"":i,a=e.cache,u=e.responseInterceptors,s=o.timeout,c=s===void 0?0:s,p=o.timeoutMessage,f=o.__umiRequestCoreType__,w=f===void 0?"normal":f,g=o.useCache,S=g===void 0?!1:g,k=o.method,y=k===void 0?"get":k,d=o.params,h=o.ttl,x=o.validateCache,_=x===void 0?QS:x;if(w!=="normal")return process,t();var L=fetch;if(!L)throw new Error("Global fetch not exist!");var m=Py()==="BROWSER",N=_(l,o)&&S&&m;if(N){var I=a.get({url:l,params:d,method:y});if(I)return I=I.clone(),I.useCache=!0,e.res=I,t()}var D;return c>0?D=Promise.race([dd(o),L(l,o),HS(c,p,e.req)]):D=Promise.race([dd(o),L(l,o)]),u.forEach(function(B){D=D.then(function(Y){var Q=typeof Y.clone=="function"?Y.clone():Y;return B(Q,o)})}),D.then(function(B){if(N&&B.status===200){var Y=B.clone();Y.useCache=!0,a.set({url:l,params:d,method:y},Y,h)}return e.res=B,t()})}function GS(e,t){var r;return t().then(function(){if(e){var n=e.res,o=n===void 0?{}:n,i=e.req,l=i===void 0?{}:i,a=l||{},u=a.options;u=u===void 0?{}:u;var s=u.responseType,c=s===void 0?"json":s,p=u.charset,f=p===void 0?"utf8":p;u.getResponse;var w=u.throwErrIfParseFail,g=w===void 0?!1:w,S=u.parseResponse,k=S===void 0?!0:S;if(k&&!(!o||!o.clone)){if(r=Py()==="BROWSER"?o.clone():o,r.useCache=o.useCache||!1,f==="gbk")try{return o.blob().then(bS).then(function(y){return fd(y,!1,r,l)})}catch(y){throw new po(r,y.message,null,l,"ParseError")}else if(c==="json")return o.text().then(function(y){return fd(y,g,r,l)});try{return o[c]()}catch{throw new po(r,"responseType not support",null,l,"ParseError")}}}}).then(function(n){if(e){e.res;var o=e.req,i=o===void 0?{}:o,l=i||{},a=l.options;a=a===void 0?{}:a;var u=a.getResponse,s=u===void 0?!1:u;if(r){if(r.status>=200&&r.status<300){if(s){e.res={data:n,response:r};return}e.res=n;return}throw new po(r,"http error",n,i,"HttpError")}}}).catch(function(n){if(n instanceof xy||n instanceof po)throw n;var o=e.req,i=e.res;throw n.request=n.request||o,n.response=n.response||i,n.type=n.type||n.name,n.data=n.data||void 0,n})}function YS(e,t){if(!e)return t();var r=e.req;r=r===void 0?{}:r;var n=r.options,o=n===void 0?{}:n,i=o.method,l=i===void 0?"get":i;if(["post","put","patch","delete"].indexOf(l.toLowerCase())===-1)return t();var a=o.requestType,u=a===void 0?"json":a,s=o.data;if(s){var c=Object.prototype.toString.call(s);c==="[object Object]"||c==="[object Array]"?u==="json"?(o.headers=Qe({Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},o.headers),o.body=JSON.stringify(s)):u==="form"&&(o.headers=Qe({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},o.headers),o.body=Uu(s)):(o.headers=Qe({Accept:"application/json"},o.headers),o.body=s)}return e.req.options=o,t()}function JS(e,t){var r,n;if(e)if(t)r=t(e);else if(_y(e))r=e.toString();else if(ju(e))n=[],hd(e,function(i){i===null||typeof i>"u"?n.push(i):n.push(pd(i)?JSON.stringify(i):i)}),r=Uu(n);else{n={},hd(e,function(i,l){var a=i;i===null||typeof i>"u"?n[l]=i:VS(i)?a=i.toISOString():ju(i)?a=i:pd(i)&&(a=JSON.stringify(i)),n[l]=a});var o=Uu(n);r=o}return r}function XS(e,t){if(!e)return t();var r=e.req;r=r===void 0?{}:r;var n=r.options,o=n===void 0?{}:n,i=o.paramsSerializer,l=o.params,a=e.req;a=a===void 0?{}:a;var u=a.url,s=u===void 0?"":u;o.method=o.method?o.method.toUpperCase():"GET",o.credentials=o.credentials||"same-origin";var c=JS(l,i);if(e.req.originUrl=s,c){var p=s.indexOf("?")!==-1?"&":"?";e.req.url="".concat(s).concat(p).concat(c)}return e.req.options=o,t()}var Cy=[YS,XS,GS],Ry=[KS];Tt.globalMiddlewares=Cy;Tt.defaultGlobalMiddlewaresLength=Cy.length;Tt.coreMiddlewares=Ry;Tt.defaultCoreMiddlewaresLength=Ry.length;var Ro=function(){function e(t){oi(this,e),this.onion=new Tt([]),this.fetchIndex=0,this.mapCache=new BS(t),this.initOptions=t,this.instanceRequestInterceptors=[],this.instanceResponseInterceptors=[]}return Ys(e,[{key:"use",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!1,core:!1};return this.onion.use(r,n),this}},{key:"extendOptions",value:function(r){this.initOptions=ky(this.initOptions,r),this.mapCache.extendOptions(r)}},{key:"dealRequestInterceptors",value:function(r){var n=function(l,a){return l.then(function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return r.req.url=u.url||r.req.url,r.req.options=u.options||r.req.options,a(r.req.url,r.req.options)})},o=[].concat(Ft(e.requestInterceptors),Ft(this.instanceRequestInterceptors));return o.reduce(n,Promise.resolve()).then(function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return r.req.url=i.url||r.req.url,r.req.options=i.options||r.req.options,Promise.resolve()})}},{key:"request",value:function(r,n){var o=this,i=this.onion,l={req:{url:r,options:Qe(Qe({},n),{},{url:r})},res:null,cache:this.mapCache,responseInterceptors:[].concat(Ft(e.responseInterceptors),Ft(this.instanceResponseInterceptors))};if(typeof r!="string")throw new Error("url MUST be a string");return new Promise(function(a,u){o.dealRequestInterceptors(l).then(function(){return i.execute(l)}).then(function(){a(l.res)}).catch(function(s){var c=l.req.options.errorHandler;if(c)try{var p=c(s);a(p)}catch(f){u(f)}else u(s)})})}}],[{key:"requestUse",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!0};if(typeof r!="function")throw new TypeError("Interceptor must be function!");n.global?e.requestInterceptors.push(r):this.instanceRequestInterceptors.push(r)}},{key:"responseUse",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!0};if(typeof r!="function")throw new TypeError("Interceptor must be function!");n.global?e.responseInterceptors.push(r):this.instanceResponseInterceptors.push(r)}}]),e}();Ro.requestInterceptors=[qS];Ro.responseInterceptors=[];function Bl(e){this.message=e}Bl.prototype.toString=function(){return this.message?"Cancel: ".concat(this.message):"Cancel"};Bl.prototype.__CANCEL__=!0;function El(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(o){t=o});var r=this;e(function(o){r.reason||(r.reason=new Bl(o),t(r.reason))})}El.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};El.source=function(){var t,r=new El(function(o){t=o});return{token:r,cancel:t}};function ZS(e){return!!(e&&e.__CANCEL__)}var Ty=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=new Ro(t),n=function(l){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=ky(r.initOptions,a);return r.request(l,u)};n.use=r.use.bind(r),n.fetchIndex=r.fetchIndex,n.interceptors={request:{use:Ro.requestUse.bind(r)},response:{use:Ro.responseUse.bind(r)}};var o=["get","post","delete","put","patch","head","options","rpc"];return o.forEach(function(i){n[i]=function(l,a){return n(l,Qe(Qe({},a),{},{method:i}))}}),n.Cancel=Bl,n.CancelToken=El,n.isCancel=ZS,n.extendOptions=r.extendOptions.bind(r),n.middlewares={instance:r.onion.middlewares,defaultInstance:r.onion.defaultMiddlewares,global:Tt.globalMiddlewares,core:Tt.coreMiddlewares},n};Ty({parseResponse:!1});var eE=Ty({});const tE=()=>{const{title:e}=v0(),[t,r]=C.useState(""),n=async o=>{const l=`https://raw.githubusercontent.com/nathanlao/but-how-do-I/master/src/posts/${encodeURIComponent(o)}.html`;try{return await eE(l,{method:"get",responseType:"text"})}catch(a){console.error("Error fetching the HTML content:",a)}};return C.useEffect(()=>{(async()=>{const i=await n(e);r(i)})()},[e]),H.jsxs("div",{children:[H.jsxs("div",{className:"relative w-4/5 sm:w-4/5 md:w-4/5 lg:w-3/5 xl:w-1/2 mx-auto py-20",children:[H.jsx("div",{className:"font-mono text-post text-5xl text-center pb-10 px-2 leading-tight",children:e}),H.jsx("div",{className:"px-2",dangerouslySetInnerHTML:{__html:t}})]}),H.jsx(Qh,{to:"/but-how-do-I",children:H.jsx("div",{className:` fixed bottom-5 left-1/2 diff --git a/index.html b/index.html index c7a065d..880ed61 100644 --- a/index.html +++ b/index.html @@ -21,7 +21,7 @@ } })(window.location); - +