PageSourceSearch

https://pplsync.ai/_next/static/chunks/535.7218dc55d9e2c022.js

js pplsync.ai collected 2026-10-05 14:52:55 UTC 12,787 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[535],{20535:function(e,s,t){t.r(s),t.d(s,{default:function(){return g}});var a=t(57437),l=t(2265),i=t(49089),d=t(33145),c=t(99934),n=t(4979),r=t(61994),x=t(94295),o=t(24778),m=e=>{let{onClose:s,data:t}=e;return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",children:(0,a.jsxs)("div",{className:"relative bg-white rounded-lg shadow-lg w-[500px]",children:[(0,a.jsx)("button",{onClick:s,className:"absolute -top-6 -right-8 z-60 text-black bg-gray-200 rounded-full",children:(0,a.jsx)(x.abH,{className:"text-red-400",size:30})}),(0,a.jsxs)("form",{className:"p-6 max-w-full mx-auto max-h-[80vh] overflow-y-auto overflow-x-hidden",children:[(0,a.jsxs)("div",{className:"flex gap-5",children:[(0,a.jsx)("h1",{className:"text-lg font-bold mb-6 text-[#6720a9]",children:"Asset details"}),(0,a.jsx)("div",{className:"size-8 relative  overflow-hidden ",children:(0,a.jsx)(d.default,{src:t.image||o.Z,alt:"",fill:!0,className:"object-contain"})})]}),(0,a.jsxs)("div",{className:" ",children:[(0,a.jsxs)("div",{className:"flex gap-4 mb-6",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"text-sm text-[#1B1B1BA6] mb-1 block",children:"Asset type"}),(0,a.jsxs)("p",{className:"font-semibold",children:[" ",t.asset_type]})]}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"text-sm text-[#1B1B1BA6] mb-1 block",children:"Serial No"}),(0,a.jsx)("p",{className:"font-semibold",children:t.serial_number})]})]}),(0,a.jsxs)("div",{className:"flex gap-4 mb-6",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("label",{className:"text-sm text-[#1B1B1BA6] mb-1 block",children:["Condition"," "]}),(0,a.jsx)("p",{className:"font-semibold",children:t.condition})]}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"text-sm text-[#1B1B1BA6] mb-1 block",children:"Allocation Date"}),(0,a.jsx)("p",{className:"font-semibold",children:t.assigned_date})]})]}),(0,a.jsx)("div",{className:"flex gap-4 mb-6",children:(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("label",{className:"text-sm text-[#1B1B1BA6] mb-1 block",children:["Assigned By"," "]}),(0,a.jsx)("p",{className:"font-semibold",children:t.hr_name})]})})]})]})]})})})},h=t(29501),u=t(8268),b=t(9388),j=t(99376),p=t(94242),A=e=>{let{onClose:s,setrefreshtable:t,refreshtable:i}=e,{register:d,handleSubmit:c,formState:{errors:n}}=(0,h.cI)({mode:"onChange"}),[r,o]=(0,l.useState)(""),[m,A]=(0,l.useState)([]),f=(0,j.useSearchParams)().get("id");(0,l.useEffect)(()=>{N()},[]);let N=async()=>{try{let e=await (0,u.R1)("".concat(b.Z.employee_asset_inventory,"?&status=available&condition_status=good"));(null==e?void 0:e.status)===200&&A(e.data.assets)}catch(e){v(e)}},v=e=>{e.message&&p.Am.error(e.message)},g=async e=>{let a={user_id:f,asset_type:e.asset_type,available_asset:e.available_asset,note:e.note};try{var l;let e=await (0,u.sg)("".concat(b.Z.hr_employee_asset),a);(null==e?void 0:e.status)===201&&(null==e?void 0:null===(l=e.data)||void 0===l?void 0:l.message)?(p.Am.success(e.data.message),s(),t(!i)):p.Am.error("Unexpected response from API")}catch(e){v(e)}},y=[...new Set(m.map(e=>e.asset_type))],w=m.filter(e=>e.asset_type===r);return(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",children:(0,a.jsxs)("div",{className:"relative bg-white rounded-lg shadow-lg max-w-full w-[400px]",children:[(0,a.jsx)("button",{onClick:s,className:"absolute -top-6 -right-8 z-60 text-black bg-gray-200 rounded-full",children:(0,a.jsx)(x.abH,{className:"text-red-400",size:30})}),(0,a.jsxs)("form",{className:"p-6 max-h-[80vh] overflow-y-auto overflow-x-hidden",onSubmit:c(g),children:[(0,a.jsx)("h2",{className:"text-base font-semibold mb-2 text-[#6027a9]",children:"Request New Asset"}),(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Select Asset Type"}),(0,a.jsxs)("select",{...d("asset_type",{required:"Asset Type is required",onChange:e=>o(e.target.value)}),className:"border border-gray-300 rounded-md w-full p-1 mt-1",children:[(0,a.jsx)("option",{value:"",children:"Select Asset Type"}),y.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]}),n.asset_type&&(0,a.jsx)("p",{className:"text-red-500 text-sm",children:n.asset_type.message})]}),(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Available Asset"}),(0,a.jsxs)("select",{...d("available_asset",{required:"Asset availability is required"}),className:"border border-gray-300 rounded-md w-full p-1 mt-1",disabled:!w.length,children:[(0,a.jsx)("option",{value:"",children:"Select Available Asset"}),w.map((e,s)=>(0,a.jsx)("option",{value:e.id,children:e.asset_name},"".concat(e.id,"-").concat(s)))]}),n.available_asset&&(0,a.jsx)("p",{className:"text-red-500 text-sm",children:n.available_asset.message})]}),(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Note"}),(0,a.jsx)("textarea",{...d("note"),className:"border border-gray-300 rounded-md w-full p-1 mt-1"})]}),(0,a.jsxs)("div",{className:"flex justify-end gap-4 mt-4",children:[(0,a.jsx)("button",{type:"button",className:"bg-[#F6EFFD] font-semibold px-4 py-2 rounded-full border border-[#8E31EC] text-[#8E31EC]",onClick:s,children:"Cancel"}),(0,a.jsx)("button",{type:"submit",className:"bg-[#8E31EC] text-white px-4 py-2 rounded-full",children:"Approve"})]})]})]})})},f=t(32768),N=t(61273),v=t(18457),g=()=>{let[e,s]=(0,l.useState)(null),[t,x]=(0,l.useState)([]),[h,g]=(0,l.useState)(!1),[y,w]=(0,l.useState)(null),[C,_]=(0,l.useState)(""),[B,k]=(0,l.useState)(),[F,E]=(0,l.useState)(!1),[S,z]=(0,l.useState)(5),[D,R]=(0,l.useState)(1),q=(0,j.use
1SearchParams)(),Z=Math.ceil(B/S),M=q.get("id"),{data:U}=(0,v.Dc)(M);(0,l.useEffect)(()=>{V()},[D,S,F]);let V=async()=>{try{g(!0);let s=await (0,u.R1)(b.Z.employee_asset+"?page=".concat(D,"&per_page=").concat(S,"&search=").concat(C,"&user_id=").concat(M,"&is_returned=false"));if((null==s?void 0:s.status)===200){var e;x(null==s?void 0:null===(e=s.data)||void 0===e?void 0:e.assets),k(null==s?void 0:s.data.total_assets)}}catch(e){e.message&&p.Am.error(e.message)}finally{g(!1)}},H=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;s(e),w(t)},J=e=>{R(1),z(Number(e.target.value))},T=(null==U?void 0:U.status)==="Relived"||(null==U?void 0:U.status)==="Termination";return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("div",{children:(0,a.jsx)("h3",{className:"text-[#6720A9] font-semibold m-4",children:"List of Devices"})}),(0,a.jsx)("div",{children:(0,a.jsx)("button",{onClick:()=>H("create"),disabled:T,className:"px-4 py-1.5 rounded-lg text-sm bg-[#8E31EC] text-white disabled:bg-gray-400 disabled:text-gray-200 disabled:cursor-not-allowed",children:"Add Asset"})})]}),(0,a.jsx)("div",{className:"flex",children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 border border-[#5A189A] bg-[#5A189A] rounded-full",children:[(0,a.jsx)("input",{type:"text",name:"search",id:"search",placeholder:"Search",value:C,onChange:e=>{_(e.target.value)},className:"rounded-full outline-none py-1.5 px-4 placeholder:text-[#5A189A] text-sm text-[#5A189A] pr-10"}),C&&(0,a.jsx)(f.Lp2,{size:16,className:"text-[#5A189A] absolute right-14 cursor-pointer ",onClick:()=>{_("")}}),(0,a.jsx)("div",{className:"mr-3 ml-1",children:(0,a.jsx)(f.xue,{size:20,className:"text-white cursor-pointer ",onClick:V})})]})}),(0,a.jsxs)("table",{className:"w-full rounded-md mt-2 border-spacing-y-2 ",children:[(0,a.jsx)("thead",{className:"bg-[#8882CE] ",children:(0,a.jsxs)("tr",{children:[(0,a.jsxs)("th",{className:"text-white font-medium text-base py-3",children:["Asset Type"," "]}),(0,a.jsxs)("th",{className:"text-white font-medium text-base py-3",children:["Serial No"," "]}),(0,a.jsx)("th",{className:"text-white font-medium text-base py-3",children:"Allocation Date"}),(0,a.jsx)("th",{className:"text-white font-medium text-base py-3",children:"Assigned by"}),(0,a.jsx)("th",{className:"text-white font-medium text-base py-3",children:"Condition"}),(0,a.jsx)("th",{className:"text-white font-medium text-base py-3",children:"Note"}),(0,a.jsx)("th",{className:"text-white font-medium text-base py-3",children:"Action"})]})}),(0,a.jsx)("tbody",{className:"bg-[#F8F8F8] divide-y divide-gray-200",children:h?Array.from({length:5}).map((e,s)=>(0,a.jsx)("tr",{style:{background:s%2?"#D9D6FA":"#F0E4FF"},children:Array.from({length:8}).map((e,s)=>(0,a.jsx)("td",{className:"px-2 py-1 text-center",children:(0,a.jsx)("div",{className:"animate-pulse bg-purple-300 rounded h-4 w-full"})},s))},s)):t&&t.length>0?null==t?void 0:t.map((e,s)=>(0,a.jsxs)("tr",{style:{background:s%2?"#D9D6FA":"#F8F8F8"},children:[(0,a.jsx)("td",{className:"px-2 py-1 whitespace-nowrap font-medium",children:(0,a.jsxs)("div",{className:"flex items-center ",children:[(0,a.jsx)("div",{className:"size-7 relative aspect-square border-2 rounded-full overflow-hidden ",children:(0,a.jsx)(d.default,{src:e.image||o.Z,alt:"",fill:!0,className:"object-contain"})}),(0,a.jsx)("div",{className:"px-2",children:(0,a.jsx)("h5",{className:"text-[#5A189A] font-medium text-sm",children:e.asset_type})})]})}),(0,a.jsx)("td",{className:"py-2 text-center text-sm text-[#5A189A]",children:e.serial_number}),(0,a.jsx)("td",{className:"py-2 text-center text-sm text-[#5A189A]",children:e.assigned_date}),(0,a.jsx)("td",{className:"py-2 text-center text-sm text-[#5A189A]",children:e.hr_name}),(0,a.jsx)("td",{className:"py-2 text-center text-sm text-[#5A189A]",children:e.condition}),(0,a.jsx)("td",{className:"py-2 text-center text-base text-[#5A189A]",children:(0,a.jsx)(n.e,{showArrow:!0,content:e.note?e.note:"No note Available",className:"bg-[#EFDEFC] text-[#6C1DBA] p-3 rounded-md max-w-[15rem] text-sm",children:(0,a.jsx)("div",{children:(0,a.jsx)(i.DAO,{size:20,className:"text-[#6C1DBA] mx-auto"})})})}),(0,a.jsx)("td",{className:"text-center",children:(0,a.jsx)("div",{className:"flex justify-center space-x-2",children:(0,a.jsx)("button",{onClick:()=>H("view",e),children:(0,a.jsx)(d.default,{src:c.Z,alt:"",width:25,height:25})})})})]},s)):(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"9",className:"text-center py-4 text-[#5A189A] text-base",children:"No Asset Request available"})})})]}),(null==t?void 0:t.length)>0&&(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"text-[#1B1B1B] font-normal text-xs",children:"Rows Per page"}),(0,a.jsxs)("select",{value:S,onChange:e=>J(e),className:"text-[#741FC6] bg-white border border-[#741FC6] rounded-md p-1 text-xs",children:[(0,a.jsx)("option",{value:5,children:"5"}),(0,a.jsx)("option",{value:10,children:"10"}),(0,a.jsx)("option",{value:15,children:"15"}),(0,a.jsx)("option",{value:20,children:"20"}),(0,a.jsx)("option",{value:25,children:"25"}),(0,a.jsx)("option",{value:30,children:"30"})]})]}),(0,a.jsxs)("div",{className:"flex justify-end items-center mt-4 gap-2",children:[(0,a.jsx)(N.L$w,{onClick:()=>{D>1&&R(D-1)},disabled:1===D,size:23,className:(0,r.Z)("text-[#741FC6] cursor-pointer ",1===D?"opacity-50":"text-[#741FC6]")}),(0,a.jsx)("p",{className:"text-[#1B1B1B] font-medium text-xs",children:"Previous"}),(0,a.jsxs)("span",{className:"text-xs text-white bg-[#741FC6] rounded-md px-2 py-1",children:[D," / ",Z]}),(0,a.jsx)("p",{className:"text-[#1B1B1B] font-medium text-xs ",children:"Next"}),(0,a.jsx)(N.WsE,{onClick:()=>{D<Z&&R(D+1)},disabled:D===Z,size:23,className:(0,r.Z)("text-[#741FC6] cursor-pointer ",D===Z?"opacity-50":"text-[#741FC6]")})]})]}),"view"===e&&(0,a.jsx)(m,{onClose:()=>s(!1),data:y}),"create"===e&&(0,a.jsx)(A,{onClose:()=>s(!1),setrefreshtable:E,refreshtable:E})]})})}},99934:function(e,s){s.Z={src:"/_next/static/media/EmpEyeLeave.9b37f1dc.svg",height:45,width:45,blurWidth:0,blurHeight:0}},24778:function(e,s){s.Z={src:"/_next/static/media/folder.4d593c19.png",height:64,width:64,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAZlBMVEVMaXF6j7VbdaZnhbOyvdQAAEyBqc+JsNaXudk5V5OLtdkMM3nW3Oijsc2drsw0U5E+YJqvxt5skr6y1u6XpsXd6/dJdKx5mcFom8sVOoM2U5BVVaqjr80sTY3y8/je5PH////J1+s8IiyTAAAAHnRSTlMAiFPc5g3w8fE1+SjyqvrJ7ffq97n7rfbyRoMGyFz1RIhrAAAACXBIWXMAAAHYAAAB2AH6XKZyAAAAQ0lEQVR4nB3GRxKAIBAAwUHCAuacUf//SUv71OznFFQGrDouYxoC2+y99LfBHo94Fz0Ek1qRDrCquJzmk5dV8wey+gV1MQKu9D34uwAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:8}}}]);

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.