1"use strict";(self.webpackChunkv2_nl_react_front_end=self.webpackChunkv2_nl_react_front_end||[]).push([[451],{24817:function(e,n,t){t.r(n),t.d(n,{DocumentPage:function(){return D}});var r=t(47313),o=t(42171),c=t(52008),u=t(29439),a=t(34709),s=t(46417);function i(e){var n=e.document,t=(e.deferredLoadingComponent,(0,r.useState)(null)),o=(0,u.Z)(t,2),c=o[0],i=o[1],d=(0,r.useState)(0),l=(0,u.Z)(d,2),f=l[0],m=l[1];return(0,s.jsx)(a.Z,{post:n,showGallery:function(e){console.log("startSlideIndex",e),i(!0),m(e)},hideGallery:function(){i(!1)},displayGallery:c,startSlide:f})}var d,l=t(35323),f=t(91486),m=t(35381),_=t(87757),g=t.n(_),p=t(64276),h=t(30075);!function(e){e[e.RESPONSE_ERROR=1]="RESPONSE_ERROR",e[e.SLUG_NOT_FOUND=2]="SLUG_NOT_FOUND",e[e.SLUG_EMPTY=3]="SLUG_EMPTY",e[e.SLUG_HAS_NO_REPO=4]="SLUG_HAS_NO_REPO",e[e.GITHUB_RATE_LIMIT=5]="GITHUB_RATE_LIMIT"}(d||(d={}));var v=g().mark(E),x=g().mark(S);function E(){var e,n,t,r;return g().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,p.gw)(500);case 2:return o.next=4,(0,p.Ys)(R);case 4:if(0!==(e=o.sent).length){o.next=9;break}return o.next=8,(0,p.gz)(L.documentError(d.SLUG_EMPTY));case 8:return o.abrupt("return");case 9:return n="".concat("https://v2.nl","/wp-json/wp/v2/pages?slug=").concat(e,"&acf_format=standard&_embed"),o.prev=10,o.next=13,(0,p.RE)(h.W,n);case 13:if(!((null===(t=o.sent)||void 0===t?void 0:t.length)>0)){o.next=19;break}return o.next=17,(0,p.gz)(L.documentsLoaded(t));case 17:o.next=21;break;case 19:return o.next=21,(0,p.gz)(L.documentError(d.SLUG_HAS_NO_REPO));case 21:case 28:case 33:o.next=37;break;case 23:if(o.prev=23,o.t0=o.catch(10),404!==(null===(r=o.t0.response)||void 0===r?void 0:r.status)){o.next=30;break}return o.next=28,(0,p.gz)(L.documentError(d.SLUG_NOT_FOUND));case 30:if("Failed to fetch"!==o.t0.message){o.next=35;break}return o.next=33,(0,p.gz)(L.documentError(d.GITHUB_RATE_LIMIT));case 35:return o.next=37,(0,p.gz)(L.documentError(d.RESPONSE_ERROR));case 37:case"end":return o.stop()}}),v,null,[[10,23]])}function S(){return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.Fm)(L.loadDocuments.type,E);case 2:case"end":return e.stop()}}),x)}var O={slug:"",documentsitories:[],loading:!1,error:null},T=(0,f.o)({name:"documentWpObject",initialState:O,reducers:{changeSlug:function(e,n){e.slug=n.payload},loadDocuments:function(e){e.loading=!0,e.error=null,e.documentsitories=[]},documentsLoaded:function(e,n){var t=n.payload;e.documentsitories=t,e.loading=!1},documentError:function(e,n){e.error=n.payload,e.loading=!1}}}),L=T.actions,P=(T.reducer,function(e){return e.documentWpObject||O}),R=(0,l.P1)([P],(function(e){return e.slug})),U=((0,l.P1)([P],(function(e){return e.loading})),(0,l.P1)([P],(function(e){return e.error}))),G=(0,l.P1)([P],(function(e){return e.documentsitories})),I=t(6653),k=t(97890),w=t(94197);function N(e){var n,t=e.documentSlug,o=e.deferredLoadingComponent,u=void 0===o?(0,s.jsx)("div",{children:"This is the wpcontent default text"}):o,a=((0,m.v)({key:T.name,reducer:T.reducer}),(0,m.h)({key:T.name,saga:S}),{actions:T.actions}).actions,d=(0,c.v9)(R),l=(0,c.v9)(G),f=(0,c.v9)(U),_=(0,c.I0)();n=function(){d&&d.trim().length>0&&_(a.loadDocuments())},(0,r.useEffect)(n,[]),(0,r.useEffect)((function(){_(a.changeSlug(t)),_(a.loadDocuments())}),[a,_,t]);var g=(0,k.s0)();return(0,r.useEffect)((function(){f&&t===d&&g("/404/pages/".concat(t))}),[g,f,t,d]),(0,s.jsx)(y,{children:(null===l||void 0===l?void 0:l.length)>0?t===d?(0,s.jsx)(A,{children:l.map((function(e){return(0,s.jsx)(i,{document:e,deferredLoadingComponent:u},e.id)}))}):(0,s.jsx)(w.E,{}):f?(0,s.jsx)(j,{children:b(f)}):(0,s.jsx)(I.T,{})})}var b=function(e){switch(e){case d.SLUG_NOT_FOUND:return"There is no such document \ud83d\ude1e";case d.SLUG_EMPTY:return"Please provide a path";case d.SLUG_HAS_NO_REPO:return"This document does not exist \ud83e\udd7a";case d.GITHUB_RATE_LIMIT:return"The server API appears to be unreachable \ud83e\udd14";default:return"An error has occurred!"}},y=o.ZP.div.withConfig({componentId:"sc-1e5llcy-0"})([""]),j=o.ZP.span.withConfig({componentId:"sc-1e5llcy-1"})(["color:",";"],(function(e){return e.theme.text})),A=o.ZP.div.withConfig({componentId:"sc-1e5llcy-2"})([""]),C=t(53152);function D(e){var n=e.deferredLoadingComponent,t=void 0===n?(0,s.jsx)("div",{children:"A fake page thingy"}):n,r=(0,k.UO)().slug;return(0,C.Z)(),r?(0,s.jsx)(N,{documentSlug:r,deferredLoadingComponent:t}):null}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.