1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[465],{123:function(e,r,t){"use strict";t.d(r,{E:function(){return f}});var n=t(63),i=t(3105),c=t(5505),a=t(3808),o=t(7294),s=t(8894);function l(){return(l=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function u(e,r){if(null==e)return{};var t,n,i={},c=Object.keys(e);for(n=0;n<c.length;n++)t=c[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}var d=o.forwardRef(((e,r)=>{var{htmlWidth:t,htmlHeight:n,alt:i}=e,c=u(e,["htmlWidth","htmlHeight","alt"]);return o.createElement("img",l({width:t,height:n,ref:r,alt:i},c))})),f=(0,n.G)(((e,r)=>{var{fallbackSrc:t,fallback:n,src:a,align:f,fit:p,loading:h,ignoreFallback:v,crossOrigin:m}=e,j=u(e,["fallbackSrc","fallback","src","align","fit","loading","ignoreFallback","crossOrigin"]),x=null!=h||v,b=(0,s.d)(l({},e,{ignoreFallback:x})),y=l({ref:r,objectFit:p,objectPosition:f},x?j:(0,c.CE)(j,["onError","onLoad"]));return"loaded"!==b?n||o.createElement(i.m$.img,l({as:d,className:"chakra-image__placeholder",src:t},y)):o.createElement(i.m$.img,l({as:d,src:a,crossOrigin:m,loading:h,className:"chakra-image"},y))}));a.Ts&&(f.displayName="Image")},1724:function(e,r,t){"use strict";t.d(r,{d:function(){return h}});var n=t(2809),i=t(219),c=t(980),a=t(9444),o=t(8017),s=t(58),l=t(9583),u=(t(7294),t(5893)),d=["children"];function f(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function p(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?f(Object(t),!0).forEach((function(r){(0,n.Z)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var h=function(e){var r=e.children,t=(0,i.Z)(e,d),n=(0,c.useTheme)();return(0,u.jsxs)(a.r,p(p({},t),{},{isExternal:!0,children:[(0,u.jsx)(o.xu,{as:"span",textDecoration:"underline ".concat(n.colors.gray[400]),_hover:{textDecoration:"underline ".concat(n.colors.gray[800])},children:r}),(0,u.jsx)(s.J,{as:l.CkN,ml:1})]}))}},9525:function(e,r,t){"use strict";t.r(r);var n=t(9056),i=t(2809),c=t(266),a=t(809),o=t.n(a),s=t(7294),l=t(9710),u=t(2465),d=t(196),f=t(1163),p=t(9428),h=t(1834),v=t(6034),m=t(8017),j=t(2572),x=t(3024),b=t(5315),y=t(123),g=t(7257),O=t(4753),w=t(8918),k=t(1424),P=t(1724),E=t(2605),S=t(3788),_=t(9583),F=t(5893);function A(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function D(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?A(Object(t),!0).forEach((function(r){(0,i.Z)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):A(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function N(e,r){var t="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,r){if(!e)return;if("string"===typeof e)return I(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return I(e,r)}(e))||r&&e&&"number"===typeof e.length){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,a=!0,o=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){o=!0,c=e},f:function(){try{a||null==t.return||t.return()}finally{if(o)throw c}}}}function I(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var q=["desc","asc"];r.default=function(){var e=(0,f.useRouter)(),r=(0,k.QT)().t,t=(0,u.bp)(),a=t.app,A=(t.loading,t.error,e.query.rid),I=e.query.id,C=null===a||void 0===a?void 0:a.schema[A],H=(0,s.use
1State)([S.v.createdField,"desc","createdAt"]),Z=H[0],T=H[1],K=(0,d.YS)(I,A,[Z[0],Z[1]]),R=K.resources,z=K.loading,M=(K.error,(0,d.gI)().fetch),$=(0,s.useState)({}),W=$[0],Y=$[1];return(0,s.useEffect)((function(){(0,c.Z)(o().mark((function e(){var r,t,n,c,s,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=N(R),e.prev=1,r.s();case 3:if((t=r.n()).done){e.next=24;break}if(n=t.value,!a||!C){e.next=22;break}c=N(C.fieldOrder),e.prev=7,l=o().mark((function e(){var r,t,c,l,u;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=s.value,t=C.fields[r],c=t.referTo,l=n[r],!c||!l||null!=W[l]){e.next=9;break}return e.next=7,M(I,c,l);case 7:u=e.sent,Y((function(e){return D(D({},e),{},(0,i.Z)({},l,u[a.schema[c].fieldOrder[0]]||l))}));case 9:case"end":return e.stop()}}),e)})),c.s();case 10:if((s=c.n()).done){e.next=14;break}return e.delegateYield(l(),"t0",12);case 12:e.next=10;break;case 14:e.next=19;break;case 16:e.prev=16,e.t1=e.catch(7),c.e(e.t1);case 19:return e.prev=19,c.f(),e.finish(19);case 22:e.next=3;break;case 24:e.next=29;break;case 26:e.prev=26,e.t2=e.catch(1),r.e(e.t2);case 29:return e.prev=29,r.f(),e.finish(29);case 32:case"end":return e.stop()}}),e,null,[[1,26,29,32],[7,16,19,22]])})))()}),[I,M,C,W,R,a]),(0,F.jsx)(l.R,{sidebar:(0,F.jsx)(p.Y,{}),breadcrumbs:[{title:r("home"),href:"/admin/apps/".concat(I)},{title:r("listOf",null===C||void 0===C?void 0:C.name)}],children:(0,F.jsx)(h.$,{title:(0,F.jsxs)(v.Kq,{children:[(0,F.jsxs)(v.Kq,{direction:"row",justifyContent:"space-between",children:[(0,F.jsx)(m.xu,{children:r("listOf",(null===C||void 0===C?void 0:C.name)||"")}),(0,F.jsxs)(v.Kq,{isInline:!0,children:[(0,F.jsx)(j.z,{variant:"outline",colorScheme:"cyan",onClick:function(){return e.push("/admin/apps/".concat(I,"/resources/").concat(A,"/new"))},children:r("create")}),(0,F.jsxs)(x.v2,{children:[(0,F.jsxs)(x.j2,{as:j.z,rightIcon:(0,F.jsx)(_.RiI,{}),children:[r(Z[2]),"(",r(Z[1]),")"]}),(0,F.jsx)(x.qy,{fontSize:"md",children:[[S.v.createdField,"createdAt"],[S.v.updatedField,"updatedAt"]].map((function(e,t){var i=(0,n.Z)(e,2),c=i[0],a=i[1];return(0,F.jsxs)(s.Fragment,{children:[!!t&&(0,F.jsx)(x.R,{}),q.map((function(e){return(0,F.jsxs)(x.sN,{onClick:function(){T([c,e,a])},children:[r(a),"(",r(e),")"]},e)}))]},c)}))})]})]})]}),(null===C||void 0===C?void 0:C.description)&&(0,F.jsx)(m.xu,{fontSize:"md",fontWeight:"normal",children:C.description})]}),children:(0,F.jsx)(v.Kq,{spacing:4,children:z?[0,1,2].map((function(e){return(0,F.jsxs)(g.H,{title:(0,F.jsx)(b.Od,{height:"20px",width:"200px"}),children:[(0,F.jsx)(b.Od,{height:"20px"}),(0,F.jsx)(b.Od,{height:"20px"})]},e)})):R.length?R.map((function(e){return(0,F.jsxs)(g.H,{title:e[null===C||void 0===C?void 0:C.fieldOrder[0]]||e.id,subtitle:!!e[null===C||void 0===C?void 0:C.fieldOrder[0]]&&"ID: ".concat(e.id),href:"/admin/apps/".concat(I,"/resources/").concat(A,"/").concat(e.id),children:[C?C.fieldOrder.map((function(r){var t;return(0,F.jsxs)(v.Kq,{direction:"row",children:[(0,F.jsx)(m.xu,{w:[20,40],children:C.fields[r].name}),(0,F.jsx)(m.xu,{flex:1,maxH:150,overflow:"auto",children:"richtext"===C.fields[r].type?null===(t=e[r])||void 0===t?void 0:t.replace(/<[^>]+>/g," "):"reference"===C.fields[r].type?W[e[r]]||e[r]:"file"===C.fields[r].type?(0,F.jsxs)(m.xu,{children:[(0,F.jsx)(y.E,{src:e[r],maxH:100,w:"auto"}),e[r]&&(0,F.jsx)(P.d,{href:e[r],children:"URL"})]}):e[r]})]},r)})):null,(0,F.jsxs)(v.Kq,{isInline:!0,fontSize:"sm",color:"gray.500",mt:2,children:[(0,F.jsxs)(m.xu,{children:[r("updatedAt"),":",e[S.v.updatedField]&&(0,E.Z)(e[S.v.updatedField],"yyyy-MM-dd H:mm")]}),(0,F.jsxs)(m.xu,{children:[r("createdAt"),":",e[S.v.createdField]&&(0,E.Z)(e[S.v.createdField],"yyyy-MM-dd H:mm")]})]})]},e.id)})):(0,F.jsx)(O.S,{children:r("emptyContent",{name:null===C||void 0===C?void 0:C.name,link:(0,F.jsx)(w.r,{href:"/admin/apps/".concat(I,"/resources/").concat(A,"/new"),children:r("createNew",null===C||void 0===C?void 0:C.name)})})})})})})}},7591:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/apps/[id]/resources/[rid]",function(){return t(9525)}])}},function(e){e.O(0,[774,445,154,610,662,514,879,888,179],(function(){return r=7591,e(e.s=r);var r}));var r=e.O();_N_E=r}]);
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.