1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3052],{97658:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/privacy",function(){return n(28742)}])},97540:function(e,t,n){"use strict";n.d(t,{P9:function(){return i},om:function(){return r}});var r="\n mutation CreatePrivacyPolicy(\n $input: CreatePrivacyPolicyInput!\n $condition: ModelPrivacyPolicyConditionInput\n ) {\n createPrivacyPolicy(input: $input, condition: $condition) {\n id\n title\n content\n order\n createdAt\n updatedAt\n isDeleted\n }\n }\n",i="\n mutation UpdatePrivacyPolicy(\n $input: UpdatePrivacyPolicyInput!\n $condition: ModelPrivacyPolicyConditionInput\n ) {\n updatePrivacyPolicy(input: $input, condition: $condition) {\n id\n title\n content\n order\n createdAt\n updatedAt\n isDeleted\n }\n }\n"},13155:function(e){"use strict";e.exports={userRole:{admin:"owner",school:"school",teacher:"teacher"},isDeleted:{yes:1,no:0},bookType:{AUDIO:"AUDIO",EPUB:"EPUB",READALOUD:"READALOUD"},assignmentProgress:{notStarted:"NOT_STARTED",started:"STARTED",inProgress:"IN_PROGRESS",completed:"COMPLETED",pastDue:"PAST_DUE"},assignmentCompletedMinutes:15,subscriptionType:{paypal:"PAYPAL",authorizeNet:"AUTHORIZENET"},region:{region1:"Asia",region2:"Africa",region3:"North America",region4:"Caribbean",region5:"Europe",region6:"Other"},genre:{genre1:"Fiction",genre2:"Non-Fiction"},topic:{account:"How to Log-in to your iReadify account?",payments:"Subscription & payment",general:"General questions"},ireader:{url:"https://read.ireadify.com/ltigateway.htm",consumerKey:"bd2e37cdc25c42a0cc8397951afc8cf1",secretKey:"770a8908cbd043bdcb4a4e6aff6c75de",lisPersonContactEmailPrimary:"[email protected]"}}},28742:function(e,t,n){"use strict";n.r(t);var r=n(47568),i=n(26042),o=n(70655),a=n(85893),s=n(10552),c=n(44541),l=n(67294),d=n(43133),u=n(41664),p=n.n(u),h=n(30381),f=n.n(h),x=n(80958),m=n(97540),y=n(28723),b=n(13155),w=n(11163);t.default=function(){var e=(0,w.useRouter)().query.keyword,t=(0,l.useState)(),n=t[0],u=t[1],h=(0,l.useState)(!0),v=h[0],g=h[1],j=(0,l.useState)(""),N=j[0],P=j[1],A=(0,l.useState)(!1),D=A[0],E=A[1];(0,l.useEffect)((function(){e&&P(e),_(e)}),[e]);var _=function(){var e=(0,r.Z)((function(e){var t,n,r;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),g(!0),t={filter:{isDeleted:{eq:b.isDeleted.no}}},e&&(t={filter:{isDeleted:{eq:b.isDeleted.no},title:{matchPhrasePrefix:e}}},E(!0)),[4,s.b.graphql((0,c.wT)(y.oI,(0,i.Z)({sort:{direction:"asc",field:"order"}},t)))];case 1:return n=o.sent(),u(n.data.searchPrivacyPolicys.items),g(!1),[3,3];case 2:return r=o.sent(),console.log(r),[3,3];case 3:return[2]}}
1))}));return function(t){return e.apply(this,arguments)}}(),O=function(){var e=(0,r.Z)((function(){var e,t;return(0,o.__generator)(this,(function(n){return _(N),e="?keyword="+N,t=window.location.protocol+"//"+window.location.host+window.location.pathname+e,window.history.pushState({path:t},"",t),[2]}))}));return function(){return e.apply(this,arguments)}}(),S=function(){var e=(0,r.Z)((function(e,t){var r,i;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return 1!=confirm("Are you sure to delete '"+t+"' Privacy?")?[3,2]:(r={id:e,isDeleted:b.isDeleted.yes},[4,s.b.graphql((0,c.wT)(m.P9,{input:r}))]);case 1:o.sent(),i=n.filter((function(t){return t.id!==e})),u(i),o.label=2;case 2:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}();return(0,a.jsx)(d.Z,{children:(0,a.jsx)("div",{className:"flex flex-1 flex-col md:flex-row lg:flex-row mx-2",children:(0,a.jsxs)("div",{className:"mb-2 border-solid border-gray-300 rounded border shadow-sm w-full",children:[(0,a.jsx)("div",{className:"p-4",children:(0,a.jsxs)("div",{className:"bg-white shadow p-4 flex",children:[(0,a.jsx)("span",{className:"w-auto flex justify-end items-center text-gray-500 p-2",children:(0,a.jsx)("i",{className:"fa fa-search"})}),(0,a.jsx)("input",{className:"w-full rounded p-2 font-sans search-box mr-1",name:"keyword",value:N,onChange:function(e){P(e.target.value.trim())},type:"text",placeholder:"Search by name..."}),""===N?(0,a.jsx)("button",{disabled:!0,className:"bg-indigo-400 whitespace-nowrap inline-flex font-medium text-white rounded p-2 pl-4 pr-4",children:"Search"}):(0,a.jsxs)("div",{className:"flex flex-1",children:[(0,a.jsx)("button",{onClick:O,className:"whitespace-nowrap inline-flex bg-gradient-to-r from-purple-bright to-purple-bright font-medium text-white hover:from-purple-light hover:to-blue-bright rounded p-2 pl-4 pr-4 mr-1",children:"Search"}),D?(0,a.jsx)("button",{onClick:function(){P(""),E(!1),_(null);var e=window.location.protocol+"//"+window.location.host+window.location.pathname;window.history.pushState({path:e},"",e)},className:"bg-red-500 text-white py-2 px-4 hover:bg-red-400 focus:outline-none flex items-center justify-center",children:"Cancel"}):null]})]})}),(0,a.jsx)("div",{className:"bg-purple-bright text-white text-bold px-2 py-3 border-solid border-gray-200 border-b",children:"List Privacy Policy"}),(0,a.jsxs)("div",{className:"p-3",children:[(0,a.jsx)(p(),{href:"/admin/privacy/add",className:"flex align-baseline content-end justify-items-end m-1 p-1",children:(0,a.jsx)("button",{className:"bg-green-500 text-white py-2 px-4 mr-1 focus:outline-none flex items-center justify-center",children:"Add"})}),v?(0,a.jsx)(x.Z,{}):0===n.length?(0,a.jsx)("div",{children:(0,a.jsx)("p",{className:"text-center",children:"No Data"})}):(0,a.jsxs)("table",{className:"w-full rounded",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"border px-4 py-2",children:"Order"}),(0,a.jsx)("th",{className:"border px-4 py-2",children:"Title"}),(0,a.jsx)("th",{className:"border px-4 py-2",children:"Created At"}),(0,a.jsx)("th",{className:"border px-4 py-2",children:"Actions"})]})}),(0,a.jsx)("tbody",{children:n.map((function(e){return(0,a.jsxs)("tr",{className:"text-center",children:[(0,a.jsx)("td",{className:"border px-4 py-2",children:e.order}),(0,a.jsx)("td",{className:"border px-4 py-2",children:e.title}),(0,a.jsxs)("td",{className:"border px-4 py-2",children:[f()(e.createdAt).format("L"),(0,a.jsx)("br",{}),f()(e.createdAt).format("LTS")]}),(0,a.jsx)("td",{className:"border px-4 py-2 ",children:(0,a.jsxs)("div",{className:"flex flex-1 justify-center",children:[(0,a.jsx)("span",{title:"Edit",className:"text-red-500 block w-4 cursor-pointer mx-2 ",children:(0,a.jsx)(p(),{href:"/admin/privacy/edit/".concat(e.id),legacyBehavior:!0,children:(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:[(0,a.jsx)("path",{d:"M17.414 2.586a2 2 0 00-2.828 0L7 10.172V13h2.828l7.586-7.586a2 2 0 000-2.828z"}),(0,a.jsx)("path",{fillRule:"evenodd",d:"M2 6a2 2 0 012-2h4a1 1 0 010 2H4v10h10v-4a1 1 0 112 0v4a2 2 0 01-2 2H4a2 2 0 01-2-2V6z",clipRule:"evenodd"})]})})}),(0,a.jsx)("span",{title:"Delete",className:"text-red-500 block w-4 cursor-pointer mx-2",onClick:function(){return S(e.id,e.title)},children:(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"})})})]})})]},e.id)}))})]})]})]})})})}},99534:function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);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}n.d(t,{Z:function(){return r}})}},function(e){e.O(0,[1664,3654,3133,9774,2888,179],(function(){return t=97658,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.