"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[957],{24957:function(t,e,r){r.d(e,{Z:function(){return j}});var n=r(85893),s=r(67294),a=r(25675),i=r.n(a),c={src:"/_next/static/media/facebook.3cb5b555.svg",height:20,width:10},o={src:"/_next/static/media/twitter.56213f3c.svg",height:17,width:20},u={src:"/_next/static/media/linkedln.8986a596.svg",height:22,width:22},h=r(11163),l=r(32161),d=r(89886),p=r(30081),f=r(33989);class v extends f.l{constructor(t,e){super(),this.client=t,this.setOptions(e),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var e;let r=this.options;this.options=this.client.defaultMutationOptions(t),(0,l.VS)(r,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),null==(e=this.currentMutation)||e.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var t;null==(t=this.currentMutation)||t.removeObserver(this)}}onMutationUpdate(t){this.updateResult();let e={listeners:!0};"success"===t.type?e.onSuccess=!0:"error"===t.type&&(e.onError=!0),this.notify(e)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(t,e){return this.mutateOptions=e,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==t?t:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let t=this.currentMutation?this.currentMutation.state:(0,d.R)(),e={...t,isLoading:"loading"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset};this.currentResult=e}notify(t){p.V.batch(()=>{if(this.mutateOptions&&this.hasListeners()){var e,r,n,s,a,i,c,o;t.onSuccess?(null==(e=(r=this.mutateOptions).onSuccess)||e.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(n=(s=this.mutateOptions).onSettled)||n.call(s,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):t.onError&&(null==(a=(i=this.mutateOptions).onError)||a.call(i,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(c=(o=this.mutateOptions).onSettled)||c.call(o,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))}t.listeners&&this.listeners.forEach(({listener:t})=>{t(this.currentResult)})})}}var Y=r(464),m=r(85945),g=r(24798);function b(t,e,r){let n=(0,l.lV)(t,e,r),a=(0,m.NL)({context:n.context}),[i]=s.useState(()=>new v(a,n));s.useEffect(()=>{i.setOptions(n)},[i,n]);let c=(0,Y.$)(s.useCallback(t=>i.subscribe(p.V.batchCalls(t)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),o=s.useCallback((t,e)=>{i.mutate(t,e).catch(x)},[i]);if(c.error&&(0,g.L)(i.options.useErrorBoundary,[c.error]))throw c.error;return{...c,mutate:o,mutateAsync:c.mutate}}function x(){}var y=r(76009),k=r(84104),j=function(t){t.type;var e=(0,h.useRouter)();e.query.id,b(function(t){var e=t.id;return(0,y.at)(e)}).mutate,b(function(t){var e=t.id;return(0,k.qM)(e)}).mutate;var r="https://pocket.vn".concat(e.asPath);return(0,n.jsx)("div",{children:(0,n.jsx)("div",{className:"flex justify-end",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-base font-normal mb-3 text-right",children:"Share"}),(0,n.jsxs)("div",{className:"flex justify-center items-center",children:[(0,n.jsx)("div",{children:(0,n.jsx)("a",{href:"https://www.facebook.com/sharer/sharer.php?u=".concat(r),target:"_blank",children:(0,n.jsx)(i(),{src:c,alt:"Facebook"})})}),(0,n.jsx)("div",{className:"mx-3",children:(0,n.jsx)("a",{href:"https://twitter.com/share?url=".concat(r),target:"_blank",children:(0,n.jsx)(i(),{src:o,alt:"Facebook"})})}),(0,n.jsx)("div",{children:(0,n.jsx)("a",{href:"https://www.linkedin.com/shareArticle?mini=true&url=".concat(encodeURIComponent(r)),target:"_blank",children:(0,n.jsx)(i(),{src:u,alt:"Facebook"})})})]})]})})})}},51301:function(t,e,r){r.d(e,{$n:function(){return i},MK:function(){return n},tF:function(){return a},xS:function(){return s}});var n="https://prod-api.truyenhinhkhoinghiep.com/api",s="https://wallet.datgach.vn/assets/images",a="DD/MM/YYYY",i="HH:mm"},48191:function(t,e,r){r.d(e,{Oj:function(){return o}});var n=r(47568),s=r(97582);r(30381);var a,i=r(7268),c=r(6354);function o(t,e){var r=(""+t).length;if(r<=3)return t;var n=Math.pow;return e=n(10,e),r-=r%3,Math.round(t*e/n(10,r))/e+" KMGTPE"[r/3]}(0,n.Z)(function(t){var e;return(0,s.__generator)(this,function(e){switch(e.label){case 0:return[4,(0,i.j)().use(c.Z).process(t)];case 1:return[2,e.sent().toString()]}})})},69491:function(t,e,r){r.d(e,{Ap:function(){return l}});var n=r(47568),s=r(97582),a=r(31955),i=r(96245);r(48191);var c,o=r(51301),u=r(69084),h="_auth";(0,n.Z)(function(){var t,e,r,n;return(0,s.__generator)(this,function(s){switch(s.label){case 0:if(!(t=a.Z.get(h)))return[2,void 0];s.label=1;case 1:var c;return s.trys.push([1,3,,4]),[4,(c=t,(0,u._)("".concat(o.xS,"/auth/me"),{method:"GET",headers:{Authorization:"Bearer ".concat(c)}}))];case 2:if(!(e=s.sent()).status.success)return[2,void 0];return(r=(0,i.Z)(t))&&a.Z.set(h+"_state",JSON.stringify(e),{expires:r.exp}),[2,{jwt:t,user:e.data}];case 3:return n=s.sent(),console.error(n),[2,void 0];case 4:return[2]}})});var l=function(){return a.Z.get(h)||""}},69084:function(t,e,r){r.d(e,{_:function(){return u}});var n,s,a=r(47568),i=r(41799),c=r(69396),o=r(97582),u=(n=(0,a.Z)(function(t,e){var r;return(0,o.__generator)(this,function(n){switch(n.label){case 0:if(e)return[3,2];return[4,fetch(t,{headers:{"api-key":"APIKEYYYYY","Content-Type":"application/json"}})];case 1:return r=n.sent(),[3,4];case 2:return[4,fetch(t,(0,c.Z)((0,i.Z)({},e),{headers:(0,c.Z)((0,i.Z)({},e.headers),{"api-key":"APIKEYYYYY","Content-Type":"application/json"})}))];case 3:r=n.sent(),n.label=4;case 4:return[2,r.json()]}})}),function(t,e){return n.apply(this,arguments)});(0,a.Z)(function(t,e){var r;return(0,o.__generator)(this,function(n){switch(n.label){case 0:if(e)return[3,2];return[4,fetch(t)];case 1:return r=n.sent(),[3,4];case 2:return[4,fetch(t,(0,c.Z)((0,i.Z)({},e),{headers:(0,c.Z)((0,i.Z)({},e.headers),{"api-key":"APIKEYYYYY"})}))];case 3:r=n.sent(),n.label=4;case 4:return[2,r.json()]}})})},76009:function(t,e,r){r.d(e,{El:function(){return o},at:function(){return u},lh:function(){return a},n3:function(){return c},uF:function(){return i}});var n=r(51301);r(69491);var s=r(69084),a=function(){return(0,s._)("https://wallet.datgach.vn/api/pocket/blogs",{method:"GET",headers:{"api-key":"APIKEYYYYY"}})},i=function(t){return(0,s._)("https://wallet.datgach.vn/api/pocket/blog/".concat(t),{method:"GET",headers:{"api-key":"APIKEYYYYY"}})},c=function(t){return(0,s._)("https://wallet.datgach.vn/api/pocket/blog/search/".concat(t),{method:"GET",headers:{"api-key":"APIKEYYYYY"}})},o=function(t,e){return(0,s._)("https://wallet.datgach.vn/api/pocket/blog/category/search/".concat(t,"/").concat(e),{method:"GET",headers:{"api-key":"APIKEYYYYY"}})},u=function(t){return(0,s._)("".concat(n.MK,"/newses/").concat(t,"/shared-count"),{method:"POST",headers:{"api-key":"APIKEYYYYY"}})}},84104:function(t,e,r){r.d(e,{Rj:function(){return o},e5:function(){return c},mW:function(){return i},qM:function(){return u}});var n=r(51301),s=r(69491),a=r(69084),i=function(t,e,r){var i={"pagination[page]":t||1,"pagination[pageSize]":e||6,populate:"*"};(null==r?void 0:r.unapproved)&&(i.unapproved=!0),(null==r?void 0:r.approved)&&(i.approved=!0),(null==r?void 0:r.unexpired)&&(i.unexpired=!0),(null==r?void 0:r.user)&&(i.user=!0),(null==r?void 0:r.draft)&&(i.draft=!0),(null==r?void 0:r.isProject)&&(i.isProject=!0),(null==r?void 0:r.ProjectCategoryId)&&(i.ProjectCategoryId=r.ProjectCategoryId);var c=new URL("".concat(n.MK,"/projects?sort=createdAt%3Adesc"));return c.search=new URLSearchParams(i).toString(),(0,a._)(c.toString(),{method:"GET",headers:{"api-key":"APIKEYYYYY",Authorization:"Bearer ".concat((0,s.Ap)())}})},c=function(t){var e=(0,s.Ap)();return(0,a._)("".concat(n.MK,"/projects/").concat(t,"&populate=create"),{method:"GET",headers:{"api-key":"APIKEYYYYY",Authorization:"Bearer ".concat(e)}})},o=function(t,e,r){return(0,a._)("".concat(n.MK,"/projects?pagination[page]=").concat(e||1,"&pagination[pageSize]=").concat(r||6,"&sort=createdAt%3Adesc&search=").concat(t),{method:"GET",headers:{"api-key":"APIKEYYYYY"}})},u=function(t){return(0,a._)("".concat(n.MK,"/projects/").concat(t,"/shared-count"),{method:"POST",headers:{"api-key":"APIKEYYYYY"}})}}}]);