1const h=["working","weekend","holiday"],I=[{value:"effective",title:"Effective Hours",description:"Calculated as the total time in the office excluding break periods. OT can be consider all effective hours, or only work hours beyond effective hours."},{value:"gross",title:"Gross Hours",description:"Calculated as the total time in the office including break periods. OT can be configured to consider all gross hours, or only work hours beyond gross hours."}],C=[{value:"all",title:"All Additional Hours:",description:"All additional work hours beyond the shift duration are considered for compensation."},{value:"before_shift",title:"Before shift starts:",description:"Only additional hours worked before shift start time are considered as overtime."},{value:"after_shift",title:"After Shift End:",description:"Only additional hours worked after shift end time are considered as overtime."},{value:"pure_shift_end",title:"Pure Shift End Time:",description:"Every minute worked after the shift end time is overtime, even when the day started late."}],v=[5,10,15,30,60],_=[{value:"down",label:"Round Down"},{value:"nearest",label:"Round to Nearest"},{value:"up",label:"Round Up"}],E=/^[A-Za-z0-9][A-Za-z0-9_-]*$/,w=[{value:"total_ot",label:"Ignore if total OT is less than"},{value:"around_shift",label:"Ignore overtime around shift time"}],T=[{value:"business_days",label:"Business Days"},{value:"calendar_days",label:"Calendar Days"}];function b(){return{slotWiseEnabled:!1,flatPayCodeId:null,holidayPayCodeId:null,ignoreEnabled:!1,ignoreMode:"total_ot",ignoreMinutes:"30",ignoreInitialEnabled:!1,ignoreInitialMinutes:"0",deadlineEnabled:!1,deadlineValue:"2",deadlineUnit:"calendar_days",slots:[]}}function u(e){return e?{slotWiseEnabled:e.slotWiseEnabled,flatPayCodeId:e.flatPayCodeId,holidayPayCodeId:e.holidayPayCodeId,ignoreEnabled:e.ignoreEnabled,ignoreMode:e.ignoreMode,ignoreMinutes:String(e.ignoreMinutes),ignoreInitialEnabled:e.ignoreInitialEnabled,ignoreInitialMinutes:String(e.ignoreInitialMinutes),deadlineEnabled:e.deadlineEnabled,deadlineValue:String(e.deadlineValue),deadlineUnit:e.deadlineUnit,slots:e.slots.map(t=>({slotFrom:String(t.slotFrom),slotTo:String(t.slotTo),payCodeId:t.payCodeId}))}:b()}function y(e){return{working:u(e?.working),weekend:u(e?.weekend),holiday:u(e?.holiday)}}function M(e){return{code:e?.code??"",name:e?.name??"",description:e?.description??"",isDefault:e?.isDefault??!1,flexibleOvertime:e?.flexibleOvertime??!1,restrictToActualExtraHours:e?.restrictToActualExtraHours??!1,advanceRequestEnabled:e?.advanceRequestEnabled??!1,hoursBasis:e?.hoursBasis??"gross",eligibleHours:e?.eligibleHours??"all",multiplierEnabled:e?.multiplierEnabled??!1,multiplier:String(e?.multiplier??1),workingDayEnabled:e?.workingDayEnabled??!0,weekendEnabled:e?.weekendEnabled??!1,holidayEnabled:e?.holidayEnabled??!1,roundOffEnabled:e?.roundOffEnabled??!1,roundOffMinutes:e?.roundOffMinutes??15,roundOffMode:e?.roundOffMode??"down",dayConfigs:y(e?.dayConfigs)}}function f(e){const t=Number(e.slotFrom),n=Number(e.slotTo);return!Number.isFinite(t)||!Number.isFinite(n)||t<0||n<t?null:{slotFrom:t,slotTo:n,payCodeId:e.payCodeId}}function c(e){return{slotWiseEnabled:e.slotWiseEnabled,flatPayCodeId:e.flatPayCodeId,holidayPayCodeId:e.holidayPayCodeId,ignoreEnabled:e.ignoreEnabled,ignoreMode:e.ignoreMode,ignoreMinutes:Math.max(0,Number(e.ignoreMinutes)||0),ignoreInitialEnabled:e.ignoreInitialEnabled,ignoreInitialMinutes:Math.max(0,Number(e.ignoreInitialMinutes)||0),deadlineEnabled:e.deadlineEnabled,deadlineValue:Math.max(0,Number(e.deadlineValue)||0),deadlineUnit:e.deadlineUnit,slots:e.slots.map(f).filter(t=>t!==null)}}function A(e){const t={},n=e.code.trim();n?n.length>50?t.code="Use 50 characters or fewer.":E.test(n)||(t.code="Use letters, numbers, - and _ only."):t.code="Enter the policy code.";const a=e.name.trim();if(a?a.length>180&&(t.name="Use 180 characters or fewer."):t.name="Enter the policy name.",e.description.trim().length>1e3&&(t.description="Use 1000 characters or fewer."),e.multiplierEnabled){const i=Number(e.multiplier);(!e.multiplier.trim()||!Number.isFinite(i)||i<=0||i>10)&&(t.multiplier="Enter a multiplier above 0 and up to 10, such as 1.5.")}!e.workingDayEnabled&&!e.weekendEnabled&&!e.holidayEnabled&&(t.days="Turn on at least one day that overtime is paid for.");for(const i of h){const r=e.dayConfigs[i];if(!r.slotWiseEnabled)continue;const l=r.slots.map(f).filter(s=>s!==null);if(l.length===0){t[i]="Slot-wise pay is on but no slots are defined.";continue}const o=[...l].sort((s,m)=>s.slotFrom-m.slotFrom);for(let s=1;s<o.length;s+=1)if(o[s].slotFrom<=o[s-1].slotTo){t[i]=`Slot ${o[s].slotFrom}-${o[s].slotTo} overlaps the previous one.`;break}}return t}function D(e){const t=Number(e.multiplier);return{code:e.code.trim().toUpperCase()||null,name:e.name.trim(),description:e.description.trim()||null,isDefault:e.isDefault,flexibleOvertime:e.flexibleOvertime,restrictToActualExtraHours:e.restrictToActualExtraHours,advanceRequestEnabled:e.advanceRequestEnabled,hoursBasis:e.hoursBasis,eligibleHours:e.eligibleHours,multiplierEnabled:e.multiplierEnabled,multiplier:Number.isFinite(t)&&t>0?Math.round(t*100)/100:1,workingDayEnabled:e.workingDayEnabled,weekendEnabled:e.weekendEnabled,holidayEnabled:e.holidayEnabled,roundOffEnabled:e.roundOffEnabled,roundOffMinutes:e.roundOffMinutes,roundOffMode:e.roundOffMode,dayConfigs:{working:c(e.dayConfigs.working),weekend:c(e.dayConfigs.weekend),holiday:c(e.dayConfigs.holiday)}}}const k="auto";function P(e,t){const n=t.trim().toLowerCase();return n?e.filter(a=>a.code.toLowerCase().includes(n)||a.name.toLowerCase().includes(n)):e}function N(e){return`${e.activeCount}
1 Active / ${e.inactiveCount} Inactive`}function F(e,t){const n=e,a=n?.data??n?.error?.data??n?.response?.data,i=a?.message??a?.error??n?.message;return Array.isArray(i)?i.join(", "):typeof i=="string"&&i.trim()?i:t}function S(e){const t=e?.data?.details?.fieldErrors;return t&&typeof t=="object"?t:{}}const R=["Employee ID","Policy Code"],g=["employee id","employee code","emp id","emp code","employee_id","employee_code","empcode"],p=["policy code","overtime policy code","ot policy code","policy_code","code"];function U(e){const t=[];let n=[],a="",i=!1;const r=e.charCodeAt(0)===65279?e.slice(1):e;for(let l=0;l<r.length;l+=1){const o=r[l];i?o==='"'&&r[l+1]==='"'?(a+='"',l+=1):o==='"'?i=!1:a+=o:o==='"'?i=!0:o===","?(n.push(a),a=""):o===` 2`||o==="\r"?(o==="\r"&&r[l+1]===` 3`&&(l+=1),n.push(a),t.push(n),n=[],a=""):a+=o}return(a!==""||n.length)&&(n.push(a),t.push(n)),t.map(l=>l.map(o=>o.trim())).filter(l=>l.some(o=>o!==""))}function H(e){const[t=[],...n]=e,a=t.map(o=>o.trim().toLowerCase().replace(/\s+/g," ")),i=a.findIndex(o=>g.includes(o)),r=a.findIndex(o=>p.includes(o));if(i<0||r<0)return{rows:[],error:'The first row must have the columns "Employee ID" and "Policy Code".'};const l=n.map(o=>({employeeCode:(o[i]??"").trim(),policyCode:(o[r]??"").trim()})).filter(o=>o.employeeCode||o.policyCode);return l.length?l.length>2e3?{rows:[],error:"Import at most 2000 rows at a time."}:{rows:l,error:null}:{rows:[],error:"The file has no rows under the header."}}const L=["company","location","department","job_title","category","level"],x={company:"Company",location:"Location",department:"Department",job_title:"Job Title",category:"Employee Category",level:"Employee Level"},d=e=>`${e.category}:${e.id}`;function O(e,t){return e.some(n=>d(n)===d(t))}function $(e,t){return O(e,t)?e:[...e,t]}function B(e,t){return e.filter(n=>d(n)!==d(t))}function V(e){if(!e.matched)return"No working employee matches these filters yet.";const t=e.matched-e.alreadyOnPolicy,n=e.sample.length?` (${e.sample.join(", ")}${e.matched>e.sample.length?", â¦":""})`:"";return`${e.matched} employee(s) match${n}. ${t?`${t} will be moved onto this policy.`:"All are already on this policy."}`}export{k as A,T as D,C as E,I as H,w as I,_ as R,R as U,N as a,v as b,D as c,F as d,x as e,L as f,B as g,O as h,$ as i,V as j,P as k,S as o,U as p,H as r,M as t,A as v};
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.