PageSourceSearch

https://app.beteal.ai/_next/static/chunks/206-087561cebf40ddb7.js

js beteal.ai collected 2026-10-05 14:14:17 UTC 16,990 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[206],{9117:function(e,r,a){a.d(r,{C:function(){return l}});var n=a(1527);a(959);var t=a(80),s=a(7800);let i=(0,t.j)("inline-flex items-center rounded-full px-2.5 py-0.5 text-sm font-semibold transition-colors focus:outline-hidden",{variants:{variant:{destructive:"bg-destructive text-destructive-foreground",success:"bg-success text-success-foreground",info:"bg-info text-info-foreground",dark:"bg-dark text-dark-foreground",default:"bg-primary text-primary-foreground"},appearance:{default:"",light:"",outline:""},disabled:{true:"opacity-50 pointer-events-none"}},compoundVariants:[{variant:"default",appearance:"light",className:"bg-primary-foreground text-primary"},{variant:"destructive",appearance:"light",className:"bg-destructive-foreground text-destructive"},{variant:"success",appearance:"light",className:"bg-success-foreground text-success"},{variant:"info",appearance:"light",className:"bg-info-foreground text-info"},{variant:"dark",appearance:"light",className:"bg-dark-foreground text-dark"},{variant:"default",appearance:"outline",className:"border border-primary-foreground bg-transparent text-primary-foreground"},{variant:"destructive",appearance:"outline",className:"border border-destructive-foreground bg-transparent text-destructive-foreground"},{variant:"success",appearance:"outline",className:"border border-success-foreground bg-transparent text-success-foreground"},{variant:"info",appearance:"outline",className:"border border-info-foreground bg-transparent text-info-foreground"},{variant:"dark",appearance:"outline",className:"border border-dark-foreground bg-transparent text-dark-foreground"}],defaultVariants:{variant:"default",apperance:"default",disabled:!1}});function l(e){let{className:r,appearance:a,disabled:t,variant:l,...o}=e;return(0,n.jsx)("div",{className:(0,s.cn)(i({variant:l,appearance:a,disabled:t}),r),...o})}},6011:function(e,r,a){a.d(r,{Z:function(){return t}});var n=a(1527);function t(e){let{title:r}=e;return(0,n.jsx)("h1",{className:"mr-6 font-heading text-2xl font-bold tracking-heading text-foreground",children:r})}},4560:function(e,r,a){var n=a(1527);a(959);var t=a(7800),s=a(6372);r.Z=e=>{let{details:r,location:a}=e;return r?(0,n.jsx)("ul",{className:"flex flex-row flex-wrap items-center gap-x-6 gap-y-2",children:r.map((e,r)=>{let a=s.P[e.icon]||null;return(0,n.jsx)("li",{children:(0,n.jsxs)("div",{className:"flex items-center gap-2 text-sm text-accent-foreground dark:text-muted-foreground",children:[(0,n.jsx)(a,{className:"size-4 shrink-0"}),(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{className:(0,t.cn)({"font-bold":e.bold}),children:e.primaryText})," ",e.secondaryText&&(0,n.jsx)("span",{children:e.secondaryText})]})]})},r)})}):null}},6950:function(e,r,a){a.d(r,{l0:function(){return u},NI:function(){return y},Wi:function(){return p},xJ:function(){return j},lX:function(){return g},zG:function(){return _}});var n=a(1527),t=a(959),s=a(5561),i=a(3950),l=a(7800),o=a(6574),d=a(80);let c=(0,d.j)("text-sm font-medium text-gray-700 dark:text-gray-300 leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),m=t.forwardRef((e,r)=>{let{className:a,...t}=e;return(0,n.jsx)(o.f,{ref:r,className:(0,l.cn)(c(),a),...t})});m.displayName=o.f.displayName;let u=i.RV,x=t.createContext({}),p=e=>{let{...r}=e;return(0,n.jsx)(x.Provider,{value:{name:r.name},children:(0,n.jsx)(i.Qr,{...r})})},h=()=>{let e=t.useContext(x),r=t.useContext(f),{getFieldState:a,formState:n}=(0,i.Gc)(),s=a(e.name,n);if(!e)throw Error("useFormField should be used within <FormField>");let{id:l}=r;return{id:l,name:e.name,formItemId:"".concat(l,"-form-item"),formDescriptionId:"".concat(l,"-form-item-description"),formMessageId:"".concat(l,"-form-item-message"),...s}},f=t.createContext({}),j=t.forwardRef((e,r)=>{let{className:a,...s}=e,i=t.useId();return(0,n.jsx)(f.Provider,{value:{id:i},children:(0,n.jsx)("div",{ref:r,className:(0,l.cn)("space-y-1",a),...s})})});j.displayName="FormItem";let g=t.forwardRef((e,r)=>{let{className:a,...t}=e,{error:s,formItemId:i}=h();return(0,n.jsx)(m,{ref:r,className:(0,l.cn)(s&&"text-destructive",a),htmlFor:i,...t})});g.displayName="FormLabel";let y=t.forwardRef((e,r)=>{let{...a}=e,{error:t,formItemId:i,formDescriptionId:l,formMessageId:o}=h();return(0,n.jsx)(s.g7,{ref:r,id:i,"aria-describedby":t?"".concat(l," ").concat(o):"".concat(l),"aria-invalid":!!t,...a})});y.displayName="FormControl";let v=t.forwardRef((e,r)=>{let{className:a,...t}=e,{formDescriptionId:s}=h();return(0,n.jsx)("p",{ref:r,id:s,className:(0,l.cn)("text-sm text-muted-foreground",a),...t})});v.displayName="FormDescription";let _=t.forwardRef((e,r)=>{let{className:a,children:t,...s}=e,{error:i,formMessageId:o}=h(),d=i?String(null==i?void 0:i.message):t;return d?(0,n.jsx)("p",{ref:r,id:o,className:(0,l.cn)("text-sm font-normal text-destructive",a),...s,children:d}):null});_.displayName="FormMessage"},2137:function(e,r,a){a.d(r,{Z:function(){return _}});var n=a(1527),t=a(959),s=a(8440),i=a(9217),l=a(3950),o=a(1615),d=a(258),c=a(7307),m=a(6950),u=a(6040);function x(e){let{children:r}=e;return(0,n.jsx)("div",{className:"w-full flex flex-row gap-14 mb-6",children:r})}var p=a(9359),h=a(5e3),f=a(1787),j=a(5006),g=a(6372),y=a(1970);let v=o.z.object({state:o.z.string().optional(),title:o.z.string().min(1,"Title is required"),location:o.z.string().min(1,"Location is required"),
1commitment_id:o.z.string().min(1,"Commitment is required"),work_type_id:o.z.string().min(1,"Work type is required"),description:o.z.string().min(1,"Description is required").max(4e4,"Description must be 40,000 characters or less"),department_id:o.z.number().min(1,"Department is required"),experience_years_min:o.z.number().min(0,"Minimum experience is required"),experience_years_max:o.z.number().min(0,"Maximum experience is required"),salary_min:o.z.number().min(1,"Minimum salary is required"),salary_max:o.z.number().min(1,"Maximum salary is required"),money_type_id:o.z.string().min(1,"Currency is required"),salary_rate_id:o.z.string().min(1,"Salary rate is required"),main_skills:o.z.string().min(1,"At least one main skill is required"),secondary_skills:o.z.string().min(1,"At least one secondary skill is required"),candidates:o.z.number().optional(),unevaluated_candidates:o.z.number().optional()}).refine(e=>e.experience_years_max>=e.experience_years_min,{message:"Max experience must be equal to or greater than min",path:["experience_years_max"]}).refine(e=>e.salary_max>=e.salary_min,{message:"Max salary must be equal to or greater than min salary",path:["salary_max"]}).refine(e=>e.experience_years_min<=e.experience_years_max,{message:"Min experience must be equal to or less than max",path:["experience_years_min"]}).refine(e=>e.salary_min<=e.salary_max,{message:"Min salary must be equal to or less than max salary",path:["salary_min"]});function _(e){var r,a,o;let{isOpen:_,onClose:b,title:N,type:k,description:w,onPositionUpdated:C,position:z,mutatePosition:S}=e,[I,q]=(0,t.useState)(!1),[W,G]=(0,t.useState)([]),[V,M]=(0,t.useState)([]),[E,F]=(0,t.useState)([]),[P,R]=(0,t.useState)([]),[J,D]=(0,t.useState)([]),{toast:T}=(0,j.pm)();(0,t.useEffect)(()=>{let e=async()=>{try{let[e,r,a,n,t]=await Promise.all([s.h.getWorkTypes(),s.h.getCommitmentTypes(),s.h.getMoneyTypes(),s.h.getDepartments(),s.h.getSalaryRates()]);G(e.data.data),M(r.data.data),F(a.data.data),R(n.data.data),D(t.data.data)}catch(e){console.error("Error fetching form data:",e),T({title:"Error",description:"Failed to load form data. Please try again.",variant:"destructive"})}};_&&e()},[T,_]);let Z=(0,l.cI)({resolver:(0,i.F)(v),defaultValues:{state:null==z?void 0:z.state,title:(null==z?void 0:z.title)||"",commitment_id:(null==z?void 0:z.commitment_id)||"",location:(null==z?void 0:z.location)||"",work_type_id:(null==z?void 0:z.work_type_id)||"",description:(null==z?void 0:z.description)||"",department_id:Number(null==z?void 0:z.department_id)||0,experience_years_min:Number(null==z?void 0:z.experience_years_min)||0,experience_years_max:Number(null==z?void 0:z.experience_years_max)||0,salary_min:Number(null==z?void 0:z.salary_min)||0,salary_max:Number(null==z?void 0:z.salary_max)||0,money_type_id:(null==z?void 0:z.money_type_id)||"",salary_rate_id:(null==z?void 0:z.salary_rate_id)||"",main_skills:null==z?void 0:z.main_skills.join(", "),secondary_skills:null==z?void 0:z.secondary_skills.join(", ")}}),B=async e=>{var r,a;q(!0);try{let{data:r}=await s.h.updateJobPosition(null==z?void 0:z.id,{...e,main_skills:e.main_skills.split(",").map(e=>e.trim()),secondary_skills:e.secondary_skills.split(",").map(e=>e.trim())});200===r.code&&(T({title:"Success",description:r.message||"Position updated successfully"}),await S(),b())}catch(n){let e=null===(a=n.response)||void 0===a?void 0:null===(r=a.data)||void 0===r?void 0:r.errors;e&&"object"==typeof e?Object.keys(e).forEach(r=>{Z.setError(r,{type:"manual",message:e[r].join(", ")})}):T({variant:"destructive",title:"Error",description:"Failed to create position"})}finally{q(!1)}};return(0,n.jsx)(c.Vq,{open:_,onOpenChange:b,children:(0,n.jsxs)(c.cZ,{className:"max-h-[90vh] overflow-y-auto sm:max-w-5xl",children:[(0,n.jsxs)(c.fK,{children:[(0,n.jsx)(c.$N,{children:N}),(0,n.jsx)(c.Be,{children:w})]}),(0,n.jsx)(m.l0,{...Z,children:(0,n.jsxs)("form",{onSubmit:Z.handleSubmit(B),className:"space-y-6",children:[(0,n.jsxs)(x,{children:[(0,n.jsx)(m.Wi,{control:Z.control,name:"title",render:e=>{let{field:r}=e;return(0,n.jsxs)(m.xJ,{className:"w-full",children:[(0,n.jsx)(m.NI,{children:(0,n.jsx)(p.x,{placeholder:"Title",...r})}),(0,n.jsx)(m.zG,{})]})}}),(0,n.jsx)(m.Wi,{control:Z.control,name:"commitment_id",render:e=>{let{field:r}=e;return(0,n.jsxs)(m.xJ,{className:"w-full",children:[(0,n.jsxs)(h.Ph,{onValueChange:r.onChange,defaultValue:r.value,children:[(0,n.jsx)(m.NI,{children:(0,n.jsx)(h.i4,{children:(0,n.jsx)(h.ki,{placeholder:"Commitment"})})}),(0,n.jsx)(h.Bw,{children:V.map(e=>(0,n.jsx)(h.Ql,{value:e.id,children:e.name},e.id))})]}),(0,n.jsx)(m.zG,{})]})}})]}),(0,n.jsxs)(x,{children:[(0,n.jsx)(m.Wi,{control:Z.control,name:"location",render:e=>{let{field:r}=e;return(0,n.jsxs)(m.xJ,{className:"w-full",children:[(0,n.jsx)(m.NI,{children:(0,n.jsx)(p.x,{placeholder:"Location",...r})}),(0,n.jsx)(m.zG,{})]})}}),(0,n.jsx)(m.Wi,{control:Z.control,name:"work_type_id",render:e=>{let{field:r}=e;return(0,n.jsxs)(m.xJ,{className:"w-full",children:[(0,n.jsxs)(h.Ph,{onValueChange:r.onChange,defaultValue:r.value,children:[(0,n.jsx)(m.NI,{children:(0,n.jsx)(h.i4,{children:(0,n.jsx)(h.ki,{placeholder:"Work Type"})})}),(0,n.jsx)(h.Bw,{children:W.map(e=>(0,n.jsx)(h.Ql,{value:e.id,children:e.name},e.id))})]}),(0,n.jsx)(m.zG,{})]})}})]}),(0,n.jsx)(m.Wi,{control:Z.control,name:"description",render:e=>{let{field:r}=e;return(0,n.jsxs)(m.xJ,{children:[(0,n.jsx)(m.NI,{children:(0,n.jsx)(f.g,{disabled:I,type:"description",placeholder:"Description",maxLength:4e4,...r})}),(0,n.jsx)(m.zG,{})]})}}),(0,n.jsxs)("div",{className:"flex flex-row gap-10",children:[(0,n.jsxs)("div",{className:"flex w-1/2 flex-col justify-end space-y-2",children:[(0,n.jsx)(y.Z,{title:"Department",description:"Enter the job position department"}),(0,n.jsx)("div",{className:"flex flex-row gap-2",children:(0,n.jsx)(m.Wi,{control:Z.control,name:"department_id",render:e=>{var r;let{field:a}=e;return(0,n.jsxs)(h.Ph,{onValueChange:e=>a.onChange(Number(e)),defaultValue:null===(r=a.value)||void 0===r?void 0:r.toString(),children:[(0,n.jsx)(m.NI,{children:(0,n.jsx)(h.i4,{children:(0,n.jsx)(h.ki,{placeholder:"Department"})})}),(0,n.jsx)(h.Bw,{className:"max-h-[200px] overflow-y-auto",children:P.map(e=>(0,n.jsx)(h.Ql,{value:e.id.toString(),children:e.name},e.id))})]})}})}),(0,n.jsx)(m.zG,{className:"mt-1",children:null===(r=Z.formState.errors.department_id)||void 0===r?void 0:r.message})]}),(0,n.jsxs)("div",{className:"w-1/2 space-y-2",children:[(0,n.jsx)(y.Z,{title:"Experience range",description:"Enter the experience range in years"}),(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)("div",{className:"flex flex-row gap-2",children:[(0,n.jsx)(m.Wi,{control:Z.control,name:"experience_years_min",render:e=>{let{field:r}=e;return(0,n.jsx)(m.NI,{children:(0,n.jsx)(p.x,{type:"number",min:0,placeholder:"Min",...r,onCh
1ange:e=>r.onChange(Number(e.target.value))})})}}),(0,n.jsx)(m.Wi,{control:Z.control,name:"experience_years_max",render:e=>{let{field:r}=e;return(0,n.jsx)(m.NI,{children:(0,n.jsx)(p.x,{type:"number",min:0,placeholder:"Max",...r,onChange:e=>r.onChange(Number(e.target.value))})})}})]}),(0,n.jsx)(m.zG,{className:"mt-1",children:null===(a=Z.formState.errors.experience_years_max)||void 0===a?void 0:a.message})]})]})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(y.Z,{title:"Salary",description:"Enter your salary range"}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-10",children:[(0,n.jsx)("div",{children:(0,n.jsxs)(m.xJ,{children:[(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(m.Wi,{control:Z.control,name:"salary_min",render:e=>{let{field:r}=e;return(0,n.jsx)(m.NI,{children:(0,n.jsx)(p.x,{type:"number",min:0,placeholder:"Min",...r,onChange:e=>r.onChange(Number(e.target.value))})})}}),(0,n.jsx)(m.Wi,{control:Z.control,name:"salary_max",render:e=>{let{field:r}=e;return(0,n.jsx)(m.NI,{children:(0,n.jsx)(p.x,{type:"number",min:0,placeholder:"Max",...r,onChange:e=>{let a=Number(e.target.value);r.onChange(a)}})})}})]}),(0,n.jsx)(m.zG,{children:null===(o=Z.formState.errors.salary_max)||void 0===o?void 0:o.message})]})}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,n.jsx)(m.Wi,{control:Z.control,name:"money_type_id",render:e=>{let{field:r}=e;return(0,n.jsxs)(m.xJ,{className:"w-full",children:[(0,n.jsxs)(h.Ph,{onValueChange:r.onChange,defaultValue:r.value,children:[(0,n.jsx)(m.NI,{children:(0,n.jsx)(h.i4,{children:(0,n.jsx)(h.ki,{placeholder:"Currency"})})}),(0,n.jsx)(h.Bw,{children:E.map(e=>(0,n.jsxs)(h.Ql,{value:e.id,children:[e.id," (",e.symbol,")"]},e.id))})]}),(0,n.jsx)(m.zG,{})]})}}),(0,n.jsx)(m.Wi,{control:Z.control,name:"salary_rate_id",render:e=>{let{field:r}=e;return(0,n.jsxs)(m.xJ,{className:"w-full",children:[(0,n.jsxs)(h.Ph,{onValueChange:r.onChange,defaultValue:r.value,children:[(0,n.jsx)(m.NI,{children:(0,n.jsx)(h.i4,{children:(0,n.jsx)(h.ki,{placeholder:"Salary Rate"})})}),(0,n.jsx)(h.Bw,{children:J.map(e=>(0,n.jsx)(h.Ql,{value:e.id,children:e.name},e.id))})]}),(0,n.jsx)(m.zG,{})]})}})]})]})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(y.Z,{title:"Main skills",description:"Enter skills separated by commas (e.g React, Node.js,..)"}),(0,n.jsx)(m.Wi,{control:Z.control,name:"main_skills",render:e=>{let{field:r}=e;return(0,n.jsxs)(m.xJ,{children:[(0,n.jsx)(m.NI,{children:(0,n.jsx)(u.I,{type:"skill",variant:"primary",placeholder:"Select your skills",initialSkills:r.value?r.value.split(","):[],onSkillsChange:e=>{r.onChange(e.join(",")),Z.setValue("main_skills",e.join(","))}})}),(0,n.jsx)(m.zG,{})]})}})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(y.Z,{title:"Secondary skills",description:"Enter skills separated by commas (e.g Git, Docker,..)"}),(0,n.jsx)(m.Wi,{control:Z.control,name:"secondary_skills",render:e=>{let{field:r}=e;return(0,n.jsxs)(m.xJ,{children:[(0,n.jsx)(m.NI,{children:(0,n.jsx)(u.I,{type:"skill",variant:"secondary",placeholder:"Select your skills",initialSkills:r.value?r.value.split(","):[],onSkillsChange:e=>{r.onChange(e.join(",")),Z.setValue("secondary_skills",e.join(","))}})}),(0,n.jsx)(m.zG,{})]})}})]}),(0,n.jsxs)("div",{className:"mt-6 flex flex-row gap-[5px]",children:[(0,n.jsx)(c.GG,{asChild:!0,children:(0,n.jsx)(d.z,{type:"button",variant:"outline",className:"border-primary bg-transparent text-primary",onClick:()=>{Z.reset(),b()},children:"Close"})}),(0,n.jsxs)(d.z,{type:"submit",disabled:I,children:[I&&(0,n.jsx)(g.P.spinner,{className:"mr-2 size-4 animate-spin"}),"Save"]})]})]})})]})})}},1970:function(e,r,a){a.d(r,{Z:function(){return t}});var n=a(1527);function t(e){let{title:r,description:a}=e;return(0,n.jsxs)("div",{className:"mb-0.5 mt-3 flex flex-col gap-y-0.5 text-xs",children:[(0,n.jsx)("p",{className:"text-[15px] font-bold",children:r}),(0,n.jsx)("p",{className:"text-[13px] text-muted-foreground",children:a})]})}},9359:function(e,r,a){a.d(r,{x:function(){return l}});var n=a(1527),t=a(959),s=a(7800),i=a(6040);let l=t.forwardRef((e,r)=>{let{className:a,type:t,...l}=e;return(0,n.jsx)("input",{ref:r,type:t,className:(0,s.cn)(i._,a),...l})});l.displayName="RegularInput"},1787:function(e,r,a){a.d(r,{g:function(){return i}});var n=a(1527),t=a(959),s=a(7800);let i=t.forwardRef((e,r)=>{let{className:a,...t}=e;return(0,n.jsx)("textarea",{className:(0,s.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-card px-3 py-2 text-sm font-normal ring-offset-background placeholder:text-muted-foreground focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50",a),ref:r,...t})});i.displayName="Textarea"}}]);

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.