1import{getUserJoinDepts as h}from"./DuNvpYXI.js";import{D as y}from"./DwZmDrvN.js";const o={VOLUNTEER:"2",EMPLOYEE:"4",CLUB_STAFF:"16",KAN_LING:"17",ASSOCIATION:"18"},A=new Set([o.CLUB_STAFF,o.KAN_LING,o.ASSOCIATION]);function b(t){const e=t.userTypeList;return Array.isArray(e)?[...new Set(e.map(r=>String(r).trim()).filter(Boolean))]:[]}function T(t){const e=b(t);return e.length===1&&e[0]===o.VOLUNTEER}function E(t){const e=b(t);return e.length===0?!1:e.every(r=>A.has(r))}function N(t){if(t==null)return[];if(Array.isArray(t))return t;const e=t,r=e.code;if(r===0||r==="0"||r===200||r==="200"||r===void 0){const s=u(e.data);if(s.length>0)return s}const i=u(e.data);return i.length>0?i:u(e)}function u(t){if(t==null)return[];if(Array.isArray(t))return t;if(typeof t!="object")return[];const e=t;return Array.isArray(e.list)?e.list:Array.isArray(e.records)?e.records:[]}function D(t){if(!t||typeof t!="object")return"";const e=t;return typeof e.label=="string"&&e.label?e.label:e.data&&typeof e.data.label=="string"&&e.data.label?e.data.label:""}function f(t){if(t==null||t==="")return null;const e=String(t).trim();if(!e)return null;const r=e.includes("T")?e:e.replace(" ","T"),n=new Date(r);if(!Number.isNaN(n.getTime()))return n;const i=e.slice(0,10),s=new Date(i);return Number.isNaN(s.getTime())?null:s}function w(t){if(t==null||t==="")return"";const e=f(t);if(!e)return String(t).trim();const r=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0");return`${r}-${n}`}function l(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())}function m(t,e=new Date){var a;if(String((a=t.confirmStatus)!=null?a:"")!=="1")return"pending";const n=l(e),i=f(t.paymentValidity);if(!i||n<=l(i))return"active";const s=f(t.renewedMemberGraceEndDate);return!s||n>l(s)?"hidden":"expiring"}function L(t,e){const r=m(t,e);return r==="active"||r==="expiring"}function R(t){switch(t){case"active":return"active";case"expiring":return"expiring";default:return"be-confirmed"}}function U(t,e){return e?t==="pending"?e.pending:t==="active"?e.active:t==="expiring"?e.expiring:"":""}async function _(t,e,r){if(T(t))return null;const n=m(t);if(n!=="active"&&n!=="pending"&&n!=="expiring")return null;const i=E(t),s=U(n,r);if(s)return{...t,joinDeptDisplayKind:n,memberStatusStr:s,useOtherMemberCardBg:i};let a=String(t.memberStatus||t.confirmStatus||"");try{if(t.confirmStatus!="1"&&t.confirmStatus!=null&&t.confirmStatus!==""){const c=await e(y.MB_CONFIRM_STATUS,String(t.confirmStatus));a=D(c)||a}else if(t.memberStatus!=null&&t.memberStatus!==""){const c=await e(y.MB_MEMBER_STATUS,String(t.memberStatus));a=D(c)||a}}catch{}return{...t,joinDeptDisplayKind:n,memberStatusStr:a,useOtherMemberCardBg:i}}async function x(t,e,r){return t.length===0?[]:(await Promise.all(t.map(i=>_(i,e,r)))).filter(i=>i!==null)}function C(t){return t.filter(e=>m(e)==="active"&&!T(e))}function O(t){var i,s,a,c,p,d,S,g;const e=String((s=(i=t.unionsIds)!=null?i:t.id)!=null?s:""),r=String((c=(a=t.deptName)!=null?a:t.name)!=null?c:""),n=String((d=(p=t.deptcode)!=null?p:t.memberCode)!=null?d:"");return{...t,id:e,name:r,deptcode:n,deptName:(S=t.deptName)!=null?S:r,unionsIds:(g=t.unionsIds)!=null?g:e}}function I(t){return C(t).map(O)}async function F(){const t=await h(),e=N(t);return I(e)}export{o as U,w as a,m as b,L as c,F as f,R as g,x as m,b as n,f as p,N as u};
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.