-
Notifications
You must be signed in to change notification settings - Fork 0
/
component---src-pages-index-tsx-1f487855012881f0e85c.js
2 lines (2 loc) · 14.3 KB
/
component---src-pages-index-tsx-1f487855012881f0e85c.js
1
2
"use strict";(self.webpackChunkkyoungah_dev_blog=self.webpackChunkkyoungah_dev_blog||[]).push([[245],{5353:function(t,e,s){s.r(e),s.d(e,{Head:function(){return Y},default:function(){return X}});var r={};s.r(r),s.d(r,{danger:function(){return d},fill:function(){return p},outline:function(){return f},primary:function(){return m},secondary:function(){return g},success:function(){return y},warning:function(){return v}});var n=s(7736),i=s(4164),a=s(4848);var o=s(4194);var c="skeleton-module--skeleton-root--cfde2";function u(t){let{className:e,...s}=t;return(0,a.jsx)("div",{className:(0,i.$)(c,e),...s})}var l="posts-skeleton-module--posts-skeleton-content--7d82c";var h="button-module--button-root--13c8f",d="button-variants-module--danger--5f98f",p="button-variants-module--fill--ac28d",f="button-variants-module--outline--e1361",m="button-variants-module--primary--1e69c",g="button-variants-module--secondary--0fbcf",y="button-variants-module--success--9720d",v="button-variants-module--warning--b9b9e";function b(t){let{className:e,color:s,variant:n,...o}=t;return(0,a.jsx)("button",{className:(0,i.$)(h,n&&r[n],s&&r[s],e),...o})}const R=Object.assign((function(t){let{children:e,className:s,...r}=t;return(0,a.jsx)("div",{className:(0,i.$)("posts-module--posts-root--cf815",s),...r,children:e})}),{Empty:function(t){let{className:e,...s}=t;return(0,a.jsxs)("div",{className:(0,i.$)("posts-empty-module--posts-empty-root--d7de7",e),...s,children:[(0,a.jsx)("h3",{className:"posts-empty-module--posts-empty-coming-soon--25b24",children:"COMING SOON"}),(0,a.jsx)("br",{}),(0,a.jsxs)("span",{className:"posts-empty-module--posts-empty-text--1fd9e",children:["아직 등록된 포스트가 없어요",(0,a.jsx)("br",{}),"조금만 기다려주세요"]})]})},List:function(t){let{children:e,className:s,...r}=t;return(0,a.jsx)("ul",{className:(0,i.$)("post-list-module--post-list-root--37cc0",s),...r,children:e})},ListItem:function(t){let{className:e,excerpt:s,link:r,title:n}=t;return(0,a.jsx)("li",{className:(0,i.$)("post-list-item-module--post-list-item-root--713ea",e),children:(0,a.jsxs)(o.Link,{to:r,className:"post-list-item-module--post-list-item-link--765f4",children:[(0,a.jsx)("h3",{className:"post-list-item-module--post-list-item-title--8597e",children:n}),(0,a.jsx)("p",{className:"post-list-item-module--post-list-item-excerpt--d274e",children:s})]})})},MoreButton:function(t){let{onClick:e}=t;return(0,a.jsx)(b,{type:"button",className:"post-more-button-module--post-more-button-root--8933c",onClick:e,children:(0,a.jsx)("span",{className:"post-more-button-module--post-more-button-text--00283",children:"더보기"})})},Skeleton:function(){return(0,a.jsxs)("li",{children:[(0,a.jsx)(u,{className:"posts-skeleton-module--posts-skeleton-title--6bdc6"}),(0,a.jsx)(u,{className:l}),(0,a.jsx)(u,{className:l})]})}});var x=s(4880),j=s(6261),N=s(9658),P=s(6500),Q=s(8904),O=class extends P.Q{constructor(t,e){super(),this.options=e,this.#t=t,this.#e=null,this.bindMethods(),this.setOptions(e)}#t;#s=void 0;#r=void 0;#n=void 0;#i;#a;#e;#o;#c;#u;#l;#h;#d;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#s.addObserver(this),I(this.#s,this.options)?this.#f():this.updateResult(),this.#m())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return k(this.#s,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return k(this.#s,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#g(),this.#y(),this.#s.removeObserver(this)}setOptions(t,e){const s=this.options,r=this.#s;if(this.options=this.#t.defaultQueryOptions(t),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled)throw new Error("Expected enabled to be a boolean");this.#v(),(0,x.f8)(this.options,s)||this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#s,observer:this});const n=this.hasListeners();n&&C(this.#s,r,this.options,s)&&this.#f(),this.updateResult(e),!n||this.#s===r&&this.options.enabled===s.enabled&&this.options.staleTime===s.staleTime||this.#b();const i=this.#R();!n||this.#s===r&&this.options.enabled===s.enabled&&i===this.#d||this.#x(i)}getOptimisticResult(t){const e=this.#t.getQueryCache().build(this.#t,t),s=this.createResult(e,t);return function(t,e){if(!(0,x.f8)(t.getCurrentResult(),e))return!0;return!1}(this,s)&&(this.#n=s,this.#a=this.options,this.#i=this.#s.state),s}getCurrentResult(){return this.#n}trackResult(t){const e={};return Object.keys(t).forEach((s=>{Object.defineProperty(e,s,{configurable:!1,enumerable:!0,get:()=>(this.#p.add(s),t[s])})})),e}getCurrentQuery(){return this.#s}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#t.defaultQueryOptions(t),s=this.#t.getQueryCache().build(this.#t,e);return s.isFetchingOptimistic=!0,s.fetch().then((()=>this.createResult(s,e)))}fetch(t){return this.#f({...t,cancelRefetch:t.cancelRefetch??!0}).then((()=>(this.updateResult(),this.#n)))}#f(t){this.#v();let e=this.#s.fetch(this.options,t);return t?.throwOnError||(e=e.catch(x.lQ)),e}#b(){if(this.#g(),x.S$||this.#n.isStale||!(0,x.gn)(this.options.staleTime))return;const t=(0,x.j3)(this.#n.dataUpdatedAt,this.options.staleTime)+1;this.#l=setTimeout((()=>{this.#n.isStale||this.updateResult()}),t)}#R(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#s):this.options.refetchInterval)??!1}#x(t){this.#y(),this.#d=t,!x.S$&&!1!==this.options.enabled&&(0,x.gn)(this.#d)&&0!==this.#d&&(this.#h=setInterval((()=>{(this.options.refetchIntervalInBackground||N.m.isFocused())&&this.#f()}),this.#d))}#m(){this.#b(),this.#x(this.#R())}#g(){this.#l&&(clearTimeout(this.#l),this.#l=void 0)}#y(){this.#h&&(clearInterval(this.#h),this.#h=void 0)}createResult(t,e){const s=this.#s,r=this.options,n=this.#n,i=this.#i,a=this.#a,o=t!==s?t.state:this.#r,{state:c}=t;let u,{error:l,errorUpdatedAt:h,fetchStatus:d,status:p}=c,f=!1;if(e._optimisticResults){const n=this.hasListeners(),i=!n&&I(t,e),a=n&&C(t,s,e,r);(i||a)&&(d=(0,Q.v_)(t.options.networkMode)?"fetching":"paused",c.dataUpdatedAt||(p="pending")),"isRestoring"===e._optimisticResults&&(d="idle")}if(e.select&&void 0!==c.data)if(n&&c.data===i?.data&&e.select===this.#o)u=this.#c;else try{this.#o=e.select,u=e.select(c.data),u=(0,x.pl)(n?.data,u,e),this.#c=u,this.#e=null}catch(b){this.#e=b}else u=c.data;if(void 0!==e.placeholderData&&void 0===u&&"pending"===p){let t;if(n?.isPlaceholderData&&e.placeholderData===a?.placeholderData)t=n.data;else if(t="function"==typeof e.placeholderData?e.placeholderData(this.#u?.state.data,this.#u):e.placeholderData,e.select&&void 0!==t)try{t=e.select(t),this.#e=null}catch(b){this.#e=b}void 0!==t&&(p="success",u=(0,x.pl)(n?.data,t,e),f=!0)}this.#e&&(l=this.#e,u=this.#c,h=Date.now(),p="error");const m="fetching"===d,g="pending"===p,y="error"===p,v=g&&m;return{status:p,fetchStatus:d,isPending:g,isSuccess:"success"===p,isError:y,isInitialLoading:v,isLoading:v,data:u,dataUpdatedAt:c.dataUpdatedAt,error:l,errorUpdatedAt:h,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>o.dataUpdateCount||c.errorUpdateCount>o.errorUpdateCount,isFetching:m,isRefetching:m&&!g,isLoadingError:y&&0===c.dataUpdatedAt,isPaused:"paused"===d,isPlaceholderData:f,isRefetchError:y&&0!==c.dataUpdatedAt,isStale:S(t,e),refetch:this.refetch}}updateResult(t){const e=this.#n,s=this.createResult(this.#s,this.options);if(this.#i=this.#s.state,this.#a=this.options,void 0!==this.#i.data&&(this.#u=this.#s),(0,x.f8)(s,e))return;this.#n=s;const r={};!1!==t?.listeners&&(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,s="function"==typeof t?t():t;if("all"===s||!s&&!this.#p.size)return!0;const r=new Set(s??this.#p);return this.options.throwOnError&&r.add("error"),Object.keys(this.#n).some((t=>{const s=t;return this.#n[s]!==e[s]&&r.has(s)}))})()&&(r.listeners=!0),this.#j({...r,...t})}#v(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#s)return;const e=this.#s;this.#s=t,this.#r=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#m()}#j(t){j.j.batch((()=>{t.listeners&&this.listeners.forEach((t=>{t(this.#n)})),this.#t.getQueryCache().notify({query:this.#s,type:"observerResultsUpdated"})}))}};function I(t,e){return function(t,e){return!(!1===e.enabled||t.state.dataUpdatedAt||"error"===t.state.status&&!1===e.retryOnMount)}(t,e)||t.state.dataUpdatedAt>0&&k(t,e,e.refetchOnMount)}function k(t,e,s){if(!1!==e.enabled){const r="function"==typeof s?s(t):s;return"always"===r||!1!==r&&S(t,e)}return!1}function C(t,e,s,r){return!1!==s.enabled&&(t!==e||!1===r.enabled)&&(!s.suspense||"error"!==t.state.status)&&S(t,s)}function S(t,e){return t.isStaleByTime(e.staleTime)}var w=s(8959),E=class extends O{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t,e){super.setOptions({...t,behavior:(0,w.PL)()},e)}getOptimisticResult(t){return t.behavior=(0,w.PL)(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){const{state:s}=t,r=super.createResult(t,e),{isFetching:n,isRefetching:i}=r,a=n&&"forward"===s.fetchMeta?.fetchMore?.direction,o=n&&"backward"===s.fetchMeta?.fetchMore?.direction;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:(0,w.rB)(e,s.data),hasPreviousPage:(0,w.RQ)(e,s.data),isFetchingNextPage:a,isFetchingPreviousPage:o,isRefetching:i&&!a&&!o}}},F=s(6540);function T(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var U=F.createContext(T()),L=()=>F.useContext(U),M=s(7665),A=F.createContext(!1),D=()=>F.useContext(A);A.Provider;var $=(t,e)=>{(t.suspense||t.throwOnError)&&(e.isReset()||(t.retryOnMount=!1))},_=t=>{F.useEffect((()=>{t.clearReset()}),[t])},q=({result:t,errorResetBoundary:e,throwOnError:s,query:r})=>{return t.isError&&!e.isReset()&&!t.isFetching&&r&&(n=s,i=[t.error,r],"function"==typeof n?n(...i):!!n);var n,i},B=t=>{t.suspense&&"number"!=typeof t.staleTime&&(t.staleTime=1e3)},W=(t,e)=>t?.suspense&&e.isPending,H=(t,e,s)=>e.fetchOptimistic(t).catch((()=>{s.clearReset()}));function z(t,e){return function(t,e,s){const r=(0,M.jE)(s),n=D(),i=L(),a=r.defaultQueryOptions(t);a._optimisticResults=n?"isRestoring":"optimistic",B(a),$(a,i),_(i);const[o]=F.useState((()=>new e(r,a))),c=o.getOptimisticResult(a);if(F.useSyncExternalStore(F.useCallback((t=>{const e=n?()=>{}:o.subscribe(j.j.batchCalls(t));return o.updateResult(),e}),[o,n]),(()=>o.getCurrentResult()),(()=>o.getCurrentResult())),F.useEffect((()=>{o.setOptions(a,{listeners:!1})}),[a,o]),W(a,c))throw H(a,o,i);if(q({result:c,errorResetBoundary:i,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw c.error;return a.notifyOnChangeProps?c:o.trackResult(c)}(t,E,e)}async function G(t){let{pageParam:e}=t;const s=await fetch("./jsons/page"+e+".json");return await s.json()}var K=s(4506);function J(){const{data:t,hasNextPage:e,isLoading:s,fetchNextPage:r}=z({queryKey:["posts"],queryFn:G,initialPageParam:1,getNextPageParam:t=>{const{currentPage:e,limit:s,posts:r}=t;return r.length>=s?e+1:void 0}}),n=function(t){return t?t.reduce(((t,e)=>[].concat((0,K.A)(t),(0,K.A)(e.posts||[]))),[]):[]}(null==t?void 0:t.pages);return(0,a.jsxs)(R,{children:[t&&(0,a.jsxs)(a.Fragment,{children:[n.length<=0&&(0,a.jsx)(R.Empty,{}),n.length>0&&(0,a.jsxs)(R.List,{children:[n.map((t=>{let{excerpt:e,title:s,slug:r}=t;return(0,a.jsx)(R.ListItem,{excerpt:e,title:s,link:r})})),s&&(0,a.jsx)(R.Skeleton,{})]})]}),e&&(0,a.jsx)(R.MoreButton,{onClick:r})]})}var V=s(2877);var X=()=>(0,a.jsx)(n.i,{children:(0,a.jsx)(V.m,{children:(0,a.jsx)(J,{})})});const Y=()=>(0,a.jsx)("title",{children:"Home Page"})},2877:function(t,e,s){s.d(e,{m:function(){return a}});var r=s(4164),n="container-module--container-root--3b208",i=s(4848);function a(t){let{children:e,className:s,...a}=t;return(0,i.jsx)("div",{className:(0,r.$)(n,s),...a,children:e})}},2629:function(t,e,s){s.d(e,{$:function(){return a}});var r=s(4164),n="basic-layout-module--basic-layout-root--a11e0",i=s(4848);function a(t){let{children:e,className:s,...a}=t;return(0,i.jsx)("div",{className:(0,r.$)(n,s),...a,children:e})}},7736:function(t,e,s){s.d(e,{i:function(){return v}});var r=s(4194),n=s(4164),i="header-module--about--32ac9",a="header-module--header-logo--5bbdc",o="header-module--header-navigation--24bcb",c="header-module--header-navigation-item--ba248",u="header-module--header-navigation-item-link--d6da9",l="header-module--header-navigation-list--3815c",h="header-module--header-root--01ceb",d="header-module--tags--eb332",p=s(4848);function f(){return(0,p.jsxs)("header",{className:h,children:[(0,p.jsx)(r.Link,{to:"/",children:(0,p.jsx)("img",{src:"/images/logo.png",srcSet:"/images/logo-small.png 200w, /images/logo.png 300w",sizes:"(max-width: 360px) 200px, 300px",alt:"dev.kyoungah.me",className:a})}),(0,p.jsx)("nav",{className:o,children:(0,p.jsxs)("ul",{className:l,children:[(0,p.jsx)("li",{className:c,children:(0,p.jsx)(r.Link,{to:"/tags",children:(0,p.jsx)("span",{"aria-label":"tags",className:(0,n.$)(u,d)})})}),(0,p.jsx)("li",{className:c,children:(0,p.jsx)("a",{href:"/about",rel:"noopener",target:"_blank",children:(0,p.jsx)("span",{"aria-label":"about",className:(0,n.$)(u,i)})})})]})})]})}var m="footer-module--footer-root--795ff";function g(){return(0,p.jsxs)("footer",{className:m,children:[(0,p.jsx)("span",{children:"Powered by Gatsby, Hosted by GitHub Pages."}),(0,p.jsxs)("span",{children:["©",(0,p.jsx)("a",{href:"https://github.com/partykyoung",rel:"noreferrer",target:"_blank",children:"KyoungAh"}),", All rights reserved."]})]})}var y=s(2629);function v(t){let{children:e}=t;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(f,{}),(0,p.jsx)(y.$,{children:e}),(0,p.jsx)(g,{})]})}},4164:function(t,e,s){function r(t){var e,s,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(s=r(t[e]))&&(n&&(n+=" "),n+=s)}else for(s in t)t[s]&&(n&&(n+=" "),n+=s);return n}function n(){for(var t,e,s=0,n="",i=arguments.length;s<i;s++)(t=arguments[s])&&(e=r(t))&&(n&&(n+=" "),n+=e);return n}s.d(e,{$:function(){return n}})}}]);
//# sourceMappingURL=component---src-pages-index-tsx-1f487855012881f0e85c.js.map