PageSourceSearch

https://dashboard.maxeltracker.com/_next/static/chunks/2589-8ce7c06528d71bd2.js

js maxeltracker.com collected 2026-10-02 18:15:22 UTC 12,749 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2589],{72589:(e,t,r)=>{r.r(t),r.d(t,{default:()=>g});var a=r(95155),s=r(12115),l=r(22544),i=r(65537),n=r(22954),o=r(11186),d=r(59475),u=r(95102),c=r(15239),p=r(74233),x=r(65229),m=r(45996),h=r(15521),f=r(61543);let g=e=>{var t,r,g,b,y,v,j,C,k,N,w,E,B;let{rowData:P,refetchData:I,isEditModalOpen:S,setIsEditModal:A,type:R}=e,[q,z]=(0,s.useState)(!1),[G,T]=(0,s.useState)(null),[W,F]=(0,s.useState)(null),[J,U]=(0,s.useState)(!1),[L,O]=(0,s.useState)(!1),[D,_]=(0,s.useState)([]),[K,Z]=(0,s.useState)(""),[$,H]=(0,s.useState)(null),[Q,V]=(0,s.useState)(null),M=(0,m.O)(),X=(0,h.pv)(),{register:Y,handleSubmit:ee,setValue:et,getValues:er,watch:ea,formState:{errors:es},reset:el,trigger:ei}=(0,l.mN)({mode:"all",defaultValues:{domain:P.domain,icon:null,category:P.category,type:f.xW.find(e=>(null==e?void 0:e.value)===(null==P?void 0:P.type))}}),en=()=>{if(P){var e;if(et("domain",P.domain),P.type){let e=f.xW.find(e=>(null==e?void 0:e.value)===(null==P?void 0:P.type));et("type",null!=e?e:null)}et("category",P.category),P.icon?(F(P.icon.toString()),T(P.icon)):(F(null),T(null)),U(!1),O(!1),(null==P||null==(e=P.identifiers)?void 0:e.length)?(_([...P.identifiers]),et("identifiers",P.identifiers)):_([])}Z(""),H(null),V(null)};(0,s.useEffect)(()=>{P&&S&&en()},[P,S]);let eo=()=>{en(),el(),A(!1)};(0,s.useEffect)(()=>{if(!S)return;let e=e=>{"Escape"===e.key&&eo()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[S]);let ed=e=>{var t;let r=null==(t=e.target.files)?void 0:t[0];if(r){if(!["image/png","image/jpeg","image/webp"].includes(r.type))return void H("Invalid file type. Please upload a PNG, JPG, or WEBP image.");if(r.size>524288)return void H("File size exceeds the 500KB limit.");H(null),T(r),F(URL.createObjectURL(r)),U(!1),O(!1),ei("icon")}},eu=()=>{if(V(null),D.includes(K.trim()))return void V("Identifier already added!");let e=K.trim();if(e.length<2||e.length>50)return void V("Identifier must be between 2 and 50 characters.");e&&(_([...D,e]),Z(""))},ec=ea("category"),ep=ea("type"),ex=(()=>{var e,t;let r=(null!=ec?ec:"").trim()!==(null!=(e=P.category)?e:"").trim(),a=(null==ep?void 0:ep.value)!==P.type,s=null!=(t=P.identifiers)?t:[],l=D.length!==s.length||D.some((e,t)=>e!==s[t]),i=G!==P.icon;return r||a||l||i})(),em=async e=>{var t,r,a,s,l,i,o,d;z(!0);let u={...P,...e,domain:null==(t=e.domain)?void 0:t.trim(),category:null==(r=e.category)?void 0:r.trim(),identifiers:D.map(e=>e.trim()),type:null==(a=e.type)?void 0:a.value,recommendedType:null==(s=e.type)?void 0:s.value,selected:R,isGeneratedByAi:!1};if(!D.length){V("Identifiers are required!"),z(!1);return}if(G&&"string"!=typeof G){let e=new FormData;e.append("file",G);try{let t=await M.post("/upload",e,{headers:{Authorization:"Bearer ".concat(X)}});if(null==t||null==(i=t.data)||null==(l=i.data)?void 0:l.url)u.icon=null==t||null==(d=t.data)||null==(o=d.data)?void 0:o.url;else{n.oR.error("Failed To Upload The File."),z(!1);return}}catch(e){console.error("Error uploading file:",e),n.oR.error("Error Uploading File."),z(!1);return}}else u.icon=G;let c=await M.put("/categorize/update",JSON.stringify(u),{headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(X)}});z(!1),(null==c?void 0:c.status)===200?(n.oR.success("Website Updated Successfully."),eo(),I&&I()):n.oR.error("An Error Occurred.")};return(0,a.jsx)(a.Fragment,{children:S&&(0,a.jsx)(i.A,{isOpen:S,onClose:eo,headerText:"Edit Website",isCenter:!1,HeaderIcon:d.R1T,className:"max-w-[600px]",bodyClassName:"overflow-auto",Footer:()=>(0,a.jsxs)("div",{className:"flex w-full justify-end items-center gap-[10px]",children:[(0,a.jsx)("button",{disabled:q,className:"themeBtnWhiteOutline h-[40px] min-w-[80px]",onClick:eo,children:"Cancel"}),(0,a.jsx)("button",{disabled:q||!ex,className:"themeBtn h-[40px] min-w-[80px]",onClick:ee(em),children:q?"Saving ...":"Save"})]}),children:(0,a.jsxs)("div",{className:"w-full flex flex-col space-y-1 p-0 [&>label]:pb-[4px]",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-sm font-medium mb-[5px]",children:["Domain ",(0,a.jsx)("sup",{className:"text-Custom-Error-500 text-[16px] top-[-1px]",children:"*"})]}),(0,a.jsx)("input",{type:"text",placeholder:"Enter Website",disabled:!0,className:"h-[44px] w-full rounded-[8px] border-[1px] ".concat((null==es||null==(r=es.domain)||null==(t=r.message)?void 0:t.length)?"border-Custom-Error-500":"border-Custom-Grey-200"," bg-transparent px-[12px] pr-[40px] py-[10px] text-Custom-Black-900 outline-none transition focus:border-primary active:border-primary disabled:cursor-default disabled:bg-whiter dark:border-form-strokedark dark:bg-form-input dark:text-white dark:focus:border-primary placeholder:text-Custom-Black-500 text-[14px] font-light"),...Y("domain",{required:"Domain Name is required."})}),(0,a.jsx)("div",{className:"min-h-[20px] mt-[3px]",children:es.domain&&(0,a.jsxs)("span",{className:"validate-font flex text-Custom-Error-500 text-[12px] font-light items-start gap-[3px]",children:[(0,a.jsx)(u.IJR,{className:"mt-[1px] [&>svg]:w-[12px]"})," ",es.domain.message]})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium mb-[5px]",children:"Domain Icon"}),(0,a.jsx)("div",{className:"relative mb-5.5 block w-full  appearance-none rounded",children:W?(0,a.jsxs)("div",{className:"relative flex items-center justify-center border rounded-[6px] p-[24px] border-Custom-Grey-200",children:[(0,a.jsxs)("div",{className:"relative w-[100px] h-[100px] flex items-center justify-center",children:[!J&&!L&&(0,a.jsx)("div",{className:"absolute inset-0 rounded-lg bg-Custom-Black-25 animate-pulse"}),L?(0,a.jsx)("div",{className:"w-[100px] h-[100px] rounded-lg bg-Custom-Purple-200 text-Custom-Purple-900 flex items-center justify-center text-2xl font-semibold",children:(null==(y=P.domain)||null==(b=y.trim())||null==(g=b[0])?void 0:g.toUpperCase())||"?"}):(0,a.jsx)(c.default,{src:W,width:100,height:100,alt:"Uploaded Icon",unoptimized:!0,onLoad:()=>U(!0),onError:()=>O(!0),className:"rounded-lg transition-opacity duration-300 ".concat(J?"opacity-100":"opacity-0")})]}),(0,a.jsx)("button",{type:"button",onClick:()=>{F(null),T(null),et("icon",null),U(!1),O(!1)},className:"cursor-pointer absolute top-[13px] left-[95px] right-0 h-6 w-6 flex items-center justify-center rounded-full bg-Custom-Error-500 text-white text-[16px] m-auto",children:(0,a.jsx)(p.WQq,{})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{type:"file",accept:"image/png, image/jpeg",...Y("icon",{onChange:e=>{ed(e)}}),onChange:ed,className:"absolute inset-0 z-50 pl-[20px] pr-[20px] mt-[20px] w-full cursor-pointer p-0 opacity-0 outline-none"}),(0,a.jsxs)("div",{className:"flex flex-col rounded-[8px] ".concat($||(null==(v=es.icon)?void 0:v.message)?"border-Custom-Error-500":"border-Custom-Grey-200"," bg-transparent px-[12px] pr-[12px] py-[10px] items-center border-[1px] justify-center space-y-3 text-Custom-Black-900 outline-none transition focus:border-primary active:border-primary disabled:cursor-default disabled:bg-whiter dark:border-form-strokedark dark:bg-form-input dark:text-white dark:focus:border-primary placeholder:text-Custom-Black-500 text-[14px] font-light"),children:[(0,a.jsx)("span",{className:"flex h-10 w-10 items-center justify-center rounded-full  bg-Custom-Purple-900 dark:border-strokedark dark:bg-boxdark",children:(0,a.jsx)(u.fyU,{})}),(0,a.jsxs)("p",{className:"text-[14px] font-light",children:[(0,a.jsx)("span",{className:"text-light",children:"Click to upload"})," or drag and drop"]}),(0,a.jsxs)("p",{className:"text-[12px] font-light text-Custom-Black-700",children:[" ","PNG,JPG,Webp, (max,500KB)"]})]})]})}),(0,a.jsx)("div",{className:"min-h-[20px] mt-[3px]",children:($||(null==(j=es.icon)?void 0:j.message))&&(0,a.jsxs)("span",{className:"validate-font flex flex-row text-Custom-Error-500 text-[12px] font-light items-start gap-[3px]",children:[(0,a.jsx)(u.IJR,{className:"mt-[1px] [&>svg]:w-[12px]"})," ",$||(null==(C=es.icon)?void 0:C.message)]})})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-sm font-medium  mb-[5px]",children:["Identifiers ",(0,a.jsx)("sup",{className:"text-Custom-Error-500 text-[16px] top-[-1px]",children:"*"})]}),(0,a.jsxs)("div",{className:"outer ".concat((null==(k=es.identifiers)?void 0:k.message)||Q?"border-Custom-Error-500":"border-Custom-Grey-200"," border-[1px] rounded-[6px] flex flex-row justify-between"),children:[(0,a.jsx)("input",{type:"text",value:K,...Y("identifiers",{required:{value:0===D.length,message:"Identifiers are required."},pattern:{value:/^(?!.*\.\.)(?!.*-$)(?!.*^-)(https?:\/\/)?[a-zA-Z0-9][a-zA-Z0-9' .-]{2,49}$/,message:"Identifier must be 3-50 characters and can contain letters, numbers, space
1s, hyphens, apostrophes, or valid domain formats with http(s)."},onChange:e=>{(e=>{let t=e.target.value;t&&(t.length<2||t.length>50)?V("Identifier must be between 2 and 50 characters."):V(null),Z(t)})(e)}}),onKeyPress:e=>{"Enter"!==e.key||es.identifiers||eu()},placeholder:"Enter identifier",className:"px-[12px] rounded-[8px] w-full max-w-[95%] text-Custom-Black-900 outline-none transition focus:border-primary active:border-primary disabled:cursor-default disabled:bg-whiter dark:border-form-strokedark dark:bg-form-input dark:text-white dark:focus:border-primary placeholder:text-Custom-Black-500 text-[14px] font-light"}),(0,a.jsx)("button",{type:"button",onClick:eu,disabled:""===K.trim(),className:"px-4 h-10 bg-Custom-Purple-900 text-white rounded-r-[6px] ".concat(""===K.trim()?"":"hover:bg-Custom-Purple-700"," transition-colors font-light"),children:"Add"})]}),(0,a.jsx)("div",{className:"min-h-[20px] mt-[3px]",children:((null==(N=es.identifiers)?void 0:N.message)||Q)&&(0,a.jsxs)("span",{className:"validate-font flex flex-row text-Custom-Error-500 text-[12px] font-light items-start gap-[3px] mb-[8px]",children:[(0,a.jsx)(u.IJR,{className:"mt-[1px] [&>svg]:w-[12px]"})," ",(null==(w=es.identifiers)?void 0:w.message)||Q]})}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mb-[10px]",children:D.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center gap-2 border border-Custom-Purple-500 bg-Custom-Purple-100 rounded-[6px] px-3 py-1.5",children:[(0,a.jsx)("span",{className:"text-Custom-Black-900 text-sm",children:e}),(0,a.jsx)("button",{onClick:()=>{_(D.filter((e,r)=>r!==t))},className:"text-Custom-Purple-900 hover:text-Custom-error transition-colors",children:(0,a.jsx)(x.A,{size:16})})]},t))})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-sm font-medium mb-[5px]",children:["Type ",(0,a.jsx)("sup",{className:"text-Custom-Error-500 text-[16px] top-[-1px]",children:"*"})]}),(0,a.jsx)(o.A,{options:f.xW,error:!!es.type,...Y("type",{required:"Type is required."}),menuPortalTarget:document.body,menuPosition:"fixed",value:er("type"),onChange:e=>{et("type",Array.isArray(e)?null:e),ei("type")},placeholder:"Select Type"}),(0,a.jsx)("div",{className:"min-h-[20px] mt-[3px]",children:es.type&&(0,a.jsxs)("span",{className:"validate-font flex flex-row text-Custom-Error-500 text-[12px] font-light items-start gap-[3px]",children:[(0,a.jsx)(u.IJR,{className:"mt-[1px] [&>svg]:w-[12px]"})," ",es.type.message]})})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-sm font-medium mb-[5px]",children:["Category ",(0,a.jsx)("sup",{className:"text-Custom-Error-500 text-[16px] top-[-1px]",children:"*"})]}),(0,a.jsx)("input",{type:"text",placeholder:"Enter Category",className:"h-[44px] w-full rounded-[8px] border-[1px] ".concat((null==es||null==(B=es.category)||null==(E=B.message)?void 0:E.length)?"border-Custom-Error-500":"border-Custom-Grey-200"," bg-transparent px-[12px] pr-[40px] py-[10px] text-Custom-Black-900 outline-none transition focus:border-primary active:border-primary disabled:cursor-default disabled:bg-whiter dark:border-form-strokedark dark:bg-form-input dark:text-white dark:focus:border-primary placeholder:text-Custom-Black-500 text-[14px] font-light"),...Y("category",{required:"Category is required.",maxLength:{value:50,message:"Category cannot exceed 50 characters."},minLength:{value:3,message:"Category must be at least 3 characters long."},pattern:{value:/^[a-zA-Z0-9\s/]*$/,message:"Only alphanumeric characters, spaces, and '/' are allowed."},validate:{notEmpty:e=>e.trim().length>0||"Category is required."}})}),(0,a.jsx)("div",{className:"min-h-[20px] mt-[3px]",children:es.category&&(0,a.jsxs)("span",{className:"validate-font flex flex-row text-Custom-Error-500 text-[12px] font-light items-start gap-[3px]",children:[(0,a.jsx)(u.IJR,{className:"mt-[1px] [&>svg]:w-[12px]"})," ",es.category.message]})})]})]})})})}}}]);

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.