1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3625],{33298:function(e,t,r){Promise.resolve().then(r.bind(r,1404))},39350:function(e,t,r){"use strict";r.d(t,{w_:function(){return i}});var n=r(2265),a={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},o=n.createContext&&n.createContext(a),l=function(){return(l=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},c=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)0>t.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r};function i(e){return function(t){return n.createElement(s,l({attr:l({},e.attr)},t),function e(t){return t&&t.map(function(t,r){return n.createElement(t.tag,l({key:r},t.attr),e(t.child))})}(e.child))}}function s(e){var t=function(t){var r,a=e.attr,o=e.size,i=e.title,s=c(e,["attr","size","title"]),u=o||t.size||"1em";return t.className&&(r=t.className),e.className&&(r=(r?r+" ":"")+e.className),n.createElement("svg",l({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,a,s,{className:r,style:l(l({color:e.color||t.color},t.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),i&&n.createElement("title",null,i),e.children)};return void 0!==o?n.createElement(o.Consumer,null,function(e){return t(e)}):t(a)}},1404:function(e,t,r){"use strict";r.r(t);var n=r(57437),a=r(2265),o=r(65118),l=r(57913),c=r(24485),i=r(14063),s=r(95956);let u=[{type:"complex",fields:[{label:"Availability",name:"availability"}]},{type:"normal",label:"Summary",name:"summary",value:""}];t.default=e=>{let{params:t}=e,[r,d]=(0,a.useState)(0),[f,h]=(0,a.useState)(u),{username:m}=t,{isLoading:p,isError:y,data:g}=(0,o.a)({queryKey:["feedReview",m],queryFn:()=>(0,c.RF)(m)});if(p||y)return(0,n.jsx)("div",{className:"flex items-center justify-center h-screen",children:(0,n.jsx)(i.lbL,{className:"animate-spin text-4xl text-gray-500"})});let x=async e=>{e.preventDefault();let t=null==g?void 0:g._id,n={scores:f.filter(e=>"complex"===e.type).map(()=>({availability:r,communication:r,leadership:r,ownership:r,technical:r})),summary:f.filter(e=>"normal"===e.type).map(e=>e.value||"").join(" "),candidateId:t};console.log(n,"final data");try{let e=await (0,c.qr)(n);if(console.log("API Response:",e),h(u),s.Am.success("Feedback added successfully",{position:"top-center",autoClose:3e3}),e.status>=200&&e.status<300){let t=e.data;console.log("Feedback added successfully:",t)}}catch(e){console.error("Error giving feedback:",e),s.Am.error("Something went wrong, please try again",{position:"top-center",autoClose:3e3})}};return(0,n.jsxs)("div",{className:"bg-stone-200 p-4 md:p-8 min-h-screen flex flex-col md:gap-2",children:[(0,n.jsx)("h1",{className:"text-3xl font-bold text-center",children:"Write a Review"}),(0,n.jsx)("div",{className:"flex flex-col grid p-2 gap-6 items-start w-full md:w-[50%] lg:w-[50%] mx-auto",children:(0,n.jsxs)("form",{onSubmit:e=>x(e),className:"flex flex-col mt-4",children:[f.map((e,t)=>(0,n.jsx)("div",{children:"complex"===e.type&&(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-2xl font-semibold mb-2",children:"Rate ".concat(null==g?void 0:g.fullName," for :")}),e.fields&&e.fields.map((e,t)=>(0,n.jsxs)("div",{className:"flex items-start mt-4 flex-col",children:[(0,n.jsx)("span",{className:"font-bold text-lg",children:e.label}),(0,n.jsx)("div",{className:"flex flex-row bg-white flex p-2 rounded-md w-full md:w-[100%] lg:w-[100%] ",children:(0,n.jsx)(l.Z,{initialValue:r,onClick:e=>d(e)})})]},t))]})},t)),f.map((e,t)=>(0,n.jsx)("div",{children:"normal"===e.type&&(0,n.jsxs)("div",{className:"flex flex-col mt-6",children:[(0,n.jsx)("span",{className:"text-2xl font-semibold mb-2",children:e.label}),(0,n.jsx)("textarea",{id:e.name,name:e.name,value:e.value,onChange:e=>h(r=>{let n=[...r];return n[t].value=e.target.value,n}),placeholder:"Enter your ".concat(e.label.toLowerCase(),"..."),className:"p-4 rounded-md border border-gray-300 focus:outline-none",rows:6})]})},t)),(0,n.jsx)("div",{className:"items-center",children:(0,n.jsx)("button",{type:"submit",className:"px-4 py-2 w-full bg-blue-500 text-white rounded-md",children:"Submit"})})]})})]})}},57913:function(e,t,r){"use strict";var n=r(57437),a=r(2265);t.Z=e=>{let{initialValue:t,onClick:r}=e,[o,l]=(0,a.useState)(t),c=Array.from({length:5},(e,t)=>t+1),i=e=>
1{let t=o===e?e-1:e;l(t),r(t)};return(0,n.jsx)("div",{children:c.map(e=>(0,n.jsx)("span",{onClick:()=>i(e),style:{cursor:"pointer",color:e<=o?"gold":"gray",fontSize:"1.5em",padding:3},children:"â
"},e))})}},58357:function(e,t,r){"use strict";r.d(t,{CT:function(){return n},bz:function(){return o},nL:function(){return a}});let n=(r(20357).env.NEXT_PUBLIC_CLOUD_API_URL||"https://excelrs-cloud-new-1069037816864.asia-south1.run.app").replace(/\/+$/,""),a="https://powr-api.lawazia.tech";function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=String(e||"").replace(/^\/+/,"");return t?"".concat(a,"/").concat(t):a}},28388:function(e,t,r){"use strict";r.d(t,{oD:function(){return a}});var n=r(20357);let a=120;n.env.STATIC_PROFILE_PARAM_LIMIT},24485:function(e,t,r){"use strict";r.d(t,{Q_:function(){return x},Ax:function(){return w},p8:function(){return h},XQ:function(){return g},RF:function(){return f},qm:function(){return y},Fe:function(){return v},qr:function(){return p}});var n=r(65399),a=r(2265),o=r(58357),l=(r(28388),r(38472));let c=()=>{try{let{useAuthStore:e}=r(96450);return e.getState().token}catch(t){var e;return console.warn("Store not available, falling back to localStorage"),null===(e=localStorage)||void 0===e?void 0:e.getItem("accessToken")}return""},i=l.Z.create({baseURL:"/api"});async function s(e){let t="".concat(o.CT,"/profiles/by-username/").concat(encodeURIComponent(e)),r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(404===r.status)return null;if(!r.ok){let e=await r.text();throw Error("Error fetching candidate: ".concat(r.statusText," - ").concat(e))}return r.json()}async function u(e,t){let r="".concat(o.CT,"/profiles/by-username/").concat(encodeURIComponent(e)),n=await fetch(r,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}});if(404===n.status)return null;if(!n.ok){let e=await n.text();throw Error("Error fetching candidate: ".concat(n.statusText," - ").concat(e))}return n.json()}i.interceptors.request.use(e=>{let t=c();return t&&(e.headers.Authorization="Bearer ".concat(t)),e}),l.Z.create({baseURL:"/api"}).interceptors.request.use(e=>{let t=c();return t&&(e.headers.Authorization="Bearer ".concat(t)),e}),(0,a.cache)(s);let d=(0,a.cache)(u),f=async(e,t)=>{let r=null!=t?t:"";if(!r){let t=await s(e);if(null===t)throw Error("Error fetching candidate: Not Found");return t}let n=await d(e,r);if(null===n)throw Error("Error fetching candidate: Not Found");return n},h=async e=>{try{let t=new URLSearchParams;e.skills&&t.set("skills",JSON.stringify(e.skills)),e.pageNo&&t.set("pageNo",e.pageNo.toString()),e.pageSize&&t.set("pageSize",e.pageSize.toString());let r="/candidate/getAll?".concat(t.toString()),{data:n}=await i.get(r);return console.log("Fetched data:",n),n}catch(e){throw e}},m=e=>{var t;let r=null===(t=e.response)||void 0===t?void 0:t.data;throw Error((null==r?void 0:r.message)||"An unexpected error occurred")},p=async e=>{try{return(await i.post("/api/candidate/feedback",e)).data}catch(e){m(e)}},y=async e=>{let t=await fetch("/api/candidate/".concat(e));if(!t.ok)throw Error("Error fetching candidate feedback: ".concat(t.statusText));return t.json()},g=async()=>{let e=await fetch("/api/candidate/skills");if(!e.ok)throw Error("Error fetching candidate skills: ".concat(e.statusText));return e.json()},x=async e=>{try{return(await i.post("/api/candidate",e)).data}catch(e){m(e)}},v=async()=>{try{return(await i.get("/api/filter/".concat(n.h))).data}catch(e){m(e)}},w=async(e,t)=>{try{let r=await fetch("".concat(o.CT,"/users/admins"),{method:"GET",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}});if(r.ok){let t=await r.json();return(Array.isArray(t.admins)?t.admins:[]).some(t=>t._id===e)}return!1}catch(e){return!1}}},96450:function(e,t,r){"use strict";r.r(t),r.d(t,{useAuthStore:function(){return o}});var n=r(10903),a=r(89291);let o=(0,n.U)()((0,a.tJ)((e,t)=>({user:null,token:null,refreshToken:null,isHydrated:!1,setAuthData:function(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;e({user:t,token:r,refreshToken:n,isHydrated:!0})},clearAuthData:()=>{let r=t();if(null!==r.user||null!==r.token||null!==r.refreshToken){e({user:null,token:null,refreshToken:null,isHydrated:!0});try{localStorage.removeItem("auth-store")}catch(e){console.warn("Failed to clear localStorage:",e)}}}}),{name:"auth-store",storage:(0,a.FL)(()=>localStorage),skipHydration:!0,onRehydrateStorage:()=>e=>{e&&(e.isHydrated=!0)}}));try{o.persist.rehydrate()}catch(e){console.warn("Failed to rehydrate auth store:",e)}}},function(e){e.O(0,[2420,251,8472,5956,1336,4080,2971,7023,1744],function(){return e(e.s=33298)}),_N_E=e.O()}]);
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.