@realtek/core-theme 0.0.366 → 0.0.367

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  const e=require("./rolldown-runtime-Chgba0Kb.cjs"),t=require("./authApi-D0LZjLV6.cjs"),n=require("./diceCandidateMapper-BjMhHno3.cjs"),r=require("./formGroupsCache-Bbz-28ws.cjs");let i=require("react");i=e.n(i,1);let a=require("antd"),o=require("@ant-design/icons"),s=require("react/jsx-runtime"),c=require("dayjs");c=e.n(c,1);let l=require("dayjs/plugin/utc");l=e.n(l,1);let u=require("dayjs/plugin/timezone");u=e.n(u,1);let d=require("react-router-dom"),f=require("@tiptap/react"),p=require("@tiptap/starter-kit");p=e.n(p,1);let m=require("@tiptap/extension-link");m=e.n(m,1);let h=require("@tiptap/extension-underline");h=e.n(h,1);let g=require("@tiptap/extension-table"),_=require("prop-types");_=e.n(_,1);let v=require("dompurify");v=e.n(v,1);async function y(e,{method:n=`POST`,params:r={},body:i={}}={}){let a={"Content-Type":`application/json`,Authorization:`Bearer ${await t.a()}`},o=new URLSearchParams({moduleName:e});Object.entries(r).forEach(([e,t])=>{t!=null&&t!==``&&o.append(e,String(t))});let s={method:n,headers:a};(n===`POST`||n===`PUT`)&&(s.body=JSON.stringify(i??{}));let c=await fetch(`${t.S}/dashboard/cards?${o.toString()}`,s);if(!c.ok)throw Error(`API ${c.status}: ${c.statusText}`);return c.json()}async function b(e={}){let n=await t.a(),r=await fetch(`${t.S}/dynamic-common-count`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${n}`},body:JSON.stringify(e)});if(!r.ok)throw Error(`API ${r.status}: ${r.statusText}`);return r.json()}async function x(e={}){let n=await t.a(),r=await fetch(`${t.S}/dashboard-calendar`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${n}`},body:JSON.stringify(e)});if(!r.ok)throw Error(`API ${r.status}: ${r.statusText}`);return r.json()}async function S(){return t.t(t.S,`/users/hierarchy-tree`)}var C=`/admin/field-config`,w=[{key:`clients`,apiModule:`clients`},{key:`job`,apiModule:`jobs`},{key:`candidate`,apiModule:`candidates`},{key:`submissions`,apiModule:`submissions`},{key:`onboarding`,apiModule:`onboarding`},{key:`billing`,apiModule:`billing`},{key:`payroll`,apiModule:`payroll`}];function T(...e){return e.find(Array.isArray)??[]}function E(e,t,n){return t.map(t=>e?.[t]).find(e=>e!=null&&e!==``)??n}function D(e,t){return e?.total??e?.totalCount??e?.count??e?.recordsTotal??e?.meta?.total??e?.pagination?.total??t.length}function O(e,t){let n=E(e,[`label`,`Label`,`fieldName`,`field_name`,`name`,`fieldLabel`,`value`],`Field ${t+1}`),r=E(e,[`field`,`Field`,`fieldKey`,`field_key`,`key`,`value`,`fieldName`,`name`],n),i=E(e,[`isVisible`,`is_visible`,`visible`,`show`,`is_show`,`isShow`,`enabled`],!0),a=E(e,[`ismandatory`,`isMandatory`,`is_mandatory`,`mandatory`,`required`,`req`],!1),o=E(e,[`order`,`Order`,`sortOrder`,`position`],t);return{...e,fieldKey:r,fieldName:n,type:E(e,[`type`,`Type`],`text`),isVisible:typeof i==`string`?![`false`,`0`,`hide`,`hidden`,`no`].includes(i.toLowerCase()):!!i,ismandatory:typeof a==`string`?[`true`,`1`,`yes`,`required`].includes(a.toLowerCase()):!!a,order:typeof o==`number`?o:t,isLink:!!e.isLink,linkTemplate:e.linkTemplate??``,linkType:e.linkType??`internal`,linkTarget:e.linkTarget??`_self`,action:e.action??`navigate`,secondaryField:e.secondaryField??``,secondaryLabel:e.secondaryLabel??``,secondaryFields:Array.isArray(e.secondaryFields)?e.secondaryFields:[],secondarySeparator:e.secondarySeparator??``,lookup:e.lookup?{...e.lookup,projectFields:Array.isArray(e.lookup.projectFields)?e.lookup.projectFields:[]}:null,derived:e.derived??null,computed:e.computed?{...e.computed,operands:Array.isArray(e.computed.operands)?e.computed.operands:[]}:null,actionButtons:Array.isArray(e.actionButtons)?e.actionButtons:[],renderType:e.renderType??``,columnWidth:Number(e.columnWidth)>0?Math.round(Number(e.columnWidth)):0,renderConfig:e.renderConfig?{...e.renderConfig,treatZeroAsEmpty:!!e.renderConfig.treatZeroAsEmpty,cleanEmptyTemplateSeparators:!!e.renderConfig.cleanEmptyTemplateSeparators}:null,valueStyles:Array.isArray(e.valueStyles)?e.valueStyles:[],commonStyle:e.commonStyle??null,displayTemplate:e.displayTemplate??``,defaultValue:e.defaultValue??``,dataSource:e.dataSource??`module`,groupName:e.groupName??``,filterGroupFields:Array.isArray(e.filterGroupFields)?e.filterGroupFields:[],filterGroupSeparator:e.filterGroupSeparator??` `}}function k(e){if(typeof e==`string`)return{key:e,apiModule:e};let t=E(e,[`key`,`moduleKey`,`value`,`module`,`apiModule`,`name`,`modulename`,`menuName`],``);return t?{key:t,apiModule:E(e,[`apiModule`,`api_module`,`module`,`value`,`key`,`name`,`modulename`,`menuName`],t)}:null}function A(e=w){let t=Array.isArray(e)&&e.length?e:w,n=new Set;return t.map(k).filter(Boolean).filter(e=>!n.has(e.key)&&(n.add(e.key),!0))}var ee=`/admin/modules`;async function te(){let e=await t.o(t.S,ee),n=e?.data;return Array.isArray(n)?n:Array.isArray(e)?e:[]}async function ne(e){let n=await t.o(t.S,`${ee}/${encodeURIComponent(e)}/automations`),r=n?.data??n??{};return{gateway:r.gateway??null,strategies:r.strategies??null}}async function re(e){let n=await t.o(t.S,`/admin/platform/${e}`),r=n?.data??n;return Array.isArray(r)?r:[]}async function ie(e,n){return t.o(t.S,`/admin/platform/${e}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)})}async function ae(e,n){return t.o(t.S,`/admin/platform/${e}/${encodeURIComponent(n)}`,{method:`DELETE`})}async function oe(e,{gateway:n,strategies:r}){return t.o(t.S,`${ee}/${encodeURIComponent(e)}/automations`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({gateway:n,strategies:r})})}async function se(){let e=[];try{e=await Et()}catch{e=[]}let t=(Array.isArray(e)?e:[]).filter(e=>e?.isDeleted!==!0&&String(e?.status??`active`).toLowerCase()!==`inactive`&&String(e?.status??`active`).toLowerCase()!==`disabled`);return t.length>0?t:te()}async function ce(){let e;try{e=await te()}catch{return{}}let t={},n=(e,n,r)=>{let i=String(e??``).trim().toLowerCase();!i||!n||(r||t[i]===void 0)&&(t[i]=n)};for(let t of Array.isArray(e)?e:[]){let e=String(t?.collectionName??``).trim();e&&n(t?.key,e,!0)}for(let t of Array.isArray(e)?e:[]){let e=String(t?.collectionName??``).trim(),r=String(t?.key??``).trim().toLowerCase();!e||!r||(r.endsWith(`s`)?n(r.slice(0,-1),e,!1):n(`${r}s`,e,!1))}return t}var le=`/admin/form-groups`,j=`/admin/config-defaults`,ue=`000000000000000000000000`;function de(e){let t=String(e??``).trim();return t===``||t===ue}function fe(e={}){let t=new URLSearchParams;e.module&&t.set(`module`,e.module),e.clientId&&t.set(`clientId`,e.clientId),e.region&&t.set(`region`,e.region);let n=t.toString();return n?`?${n}`:``}async function pe(e=``,n={}){let r=`${le}${fe({...n,module:e||n.module||``})}`,i=await t.o(t.S,r),a=i?.data;return Array.isArray(a)?a:a&&Array.isArray(a.groups)?a.groups:Array.isArray(i)?i:i&&Array.isArray(i.groups)?i.groups:[]}async function me({offset:e=0,limit:n=100,sortBy:r=`new`,searchvalue:i=``}={}){let a=new URLSearchParams({offset:String(e),limit:String(n),sortBy:r,searchvalue:i}),o=localStorage.getItem(`tenantId`)||``,s=localStorage.getItem(`businessId`)||``,c=localStorage.getItem(`businessUnitId`)||``;o&&a.set(`tenantId`,o),s&&a.set(`businessId`,s),c&&a.set(`businessUnitId`,c);let l=await t.o(t.S,`/client/view?${a.toString()}`),u=l?.data??l;return u?.clients??u?.Clients??u?.items??[]}async function he(e){let n=await t.o(t.S,`/filter-dropdown-fields?module=${encodeURIComponent(e)}`),r=n?.data??n;return Array.isArray(r)?r:[]}async function ge(e,n={}){return t.o(t.S,`${le}${fe(n)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}async function _e(e,n,r={}){return t.o(t.S,`${le}/${e}${fe(r)}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)})}async function ve(e,n={}){return t.o(t.S,`${le}/${e}${fe(n)}`,{method:`DELETE`})}async function ye(e,n){return t.o(t.S,`${j}/request-otp`,{method:`POST`,body:JSON.stringify({scope:e,action:n})})}async function be(e,n,r){return t.o(t.S,`${j}/apply`,{method:`POST`,body:JSON.stringify({scope:e,action:n,otp:r})})}var xe=`/admin/detail-config`;async function Se(e,n={}){let r=fe({module:e,clientId:n.clientId}),i=await t.o(t.S,`${xe}${r}`),a=i?.data??i??{};return{module:a.module??e,clientId:de(a.clientId)?``:String(a.clientId),groups:Array.isArray(a.groups)?a.groups:[],fields:Array.isArray(a.fields)?a.fields:[],merges:Array.isArray(a.merges)?a.merges:[],sourceFields:Array.isArray(a.sourceFields)?a.sourceFields:[],header:a.header&&typeof a.header==`object`?a.header:null,computedFields:Array.isArray(a.computedFields)?a.computedFields:[]}}async function Ce({module:e,groups:n=[],fields:r=[],merges:i=[],sourceFields:a=[],clientId:o=``,header:s}){return t.o(t.S,xe,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({module:e,groups:n,fields:r,merges:i,sourceFields:a,...o?{clientId:o}:{},...s===void 0?{}:{header:s??{}}})})}async function we({module:e,clientId:n=``,otp:r}){return t.o(t.S,`${xe}/discover-fields`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({module:e,otp:r,...n?{clientId:n}:{}})})}var Te=`/admin/detail-defaults`;async function Ee(){let e=await t.o(t.S,Te);return e?.data??e??{}}async function De(e){return t.o(t.S,Te,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}var Oe=`/admin/ai-service-config`;async function ke(){let e=await t.o(t.S,Oe);return e?.data??e??[]}async function Ae(e){return t.o(t.S,Oe,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}async function je(e){return t.o(t.S,`${Oe}?serviceKey=${encodeURIComponent(e)}`,{method:`DELETE`})}var Me=`/admin/bgc-integration-config`;async function Ne(){let e=await t.o(t.S,Me);return e?.data??e??{updateMethod:`MANUAL`,enabled:!0}}async function Pe(e){return t.o(t.S,Me,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}async function Fe(){let e=await t.o(t.S,`/integration-config/bgc/summary`);return e?.data??e??{updateMethod:`MANUAL`,enabled:!0}}var Ie=`/admin/integration-config`;async function Le(){let e=await t.o(t.S,Ie);return e?.data??e??[]}async function Re(e){let n=await t.o(t.S,`${Ie}/${encodeURIComponent(e)}`);return n?.data??n}async function ze(e){let n=e?.integrationKey,r=n?`${Ie}/${encodeURIComponent(n)}`:Ie;return t.o(t.S,r,{method:n?`PUT`:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}async function Be(e){return t.o(t.S,`${Ie}/${encodeURIComponent(e)}`,{method:`DELETE`})}async function Ve(e){let n=await t.o(t.S,`${Ie}/test`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});return n?.data??n}async function He(e){let n=await t.o(t.S,`/integration-config/${encodeURIComponent(e)}/summary`);return n?.data??n}async function Ue(e,n,r){let i=await t.o(t.S,`/integration-config/${encodeURIComponent(e)}/apply-status/${encodeURIComponent(n)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)});return i?.data??i}async function We(e,n,r={}){let i=r.clientId?`&clientId=${encodeURIComponent(r.clientId)}`:``,a=`${le}?module=${encodeURIComponent(e)}&id=${encodeURIComponent(n)}&view=detail${i}`,o=await t.o(t.S,a),s=o?.data??o;return Array.isArray(s)?s:[]}function Ge(e){return{key:e.role_id??e.id,roleId:e.role_id??e.id,roleName:e.role_name??`N/A`,description:e.role_description??`N/A`,userCount:e.user_count??0,roleType:e.role_type??0,raw:e}}function Ke(e){return e?.raw?.role_id??e?.roleId??e?.key}async function qe(){let e=await t.o(t.S,`/get-roles`),n=e.data??e,r=T(n?.zinnext_default).map(Ge),i=T(n?.custom_roles).map(Ge),a=[...r,...i];return{roles:a,total:a.length}}function Je(e){return{key:e.teamId,teamId:e.teamId,teamName:e.teamName??`N/A`,manager:e.reportingManager??`N/A`,managerId:e.reportingManagerId??0,memberCount:e.noOfTeamMembers??0,members:T(e.teamMembers),memberIds:T(e.teamMembersIds),raw:e}}function M(e){return e?.raw?.teamId??e?.teamId??e?.key}async function Ye({offset:e=0,limit:n=10,sortBy:r=`new`,search:i=``}={}){let a=new URLSearchParams({searchquery:i,sortBy:r,limit:String(n),offset:String(e)}),o=await t.o(t.S,`/get-teams?${a}`),s=o.data??o,c=T(s?.teams,s,o?.teams),l=s?.totalCount??s?.total??c.length;return{teams:c.map(Je),total:l}}async function Xe(e,{teamName:n,managerId:r,memberIds:i=[]}){let a=M(e);return t.o(t.S,`/team/edit?teamId=${a}`,{method:`PUT`,body:JSON.stringify({team_name:n,team_manager:r,other_team_members:i,reporting_team_member:[]})})}async function Ze(e,n,r,i=`listView`,a=!1){let o=new URLSearchParams({module:e,userId:`0`,[n]:String(r),configType:i});a&&(!i||i===`listView`)&&o.set(`includeMeta`,`1`);let s=await t.o(t.S,`${C}?${o}`),c=s.data??s,l=T(c,c?.visibleFields,s?.visibleFields);return a?{fields:l,dataVisibilityMode:c?.dataVisibilityMode??s?.dataVisibilityMode??`all`,dataOwnerField:c?.dataOwnerField??s?.dataOwnerField??`createdBy`}:l}async function Qe(e,t=`listView`,n=w){let r=Ke(e),i=A(n),a=await Promise.all(i.map(async({key:e,apiModule:n})=>[e,(await Ze(n,`roleId`,r,t)).map((t,i)=>({...O(t,i),module:e,apiModule:n,roleId:r}))]));return Object.fromEntries(a)}async function $e(e,t=`listView`,n=w){let r=Ke(e),i=A(n),a=await Promise.all(i.map(async({key:e,apiModule:n})=>{let i=await Ze(n,`roleId`,r,t,!0);return[e,{fields:i.fields.map((t,i)=>({...O(t,i),module:e,apiModule:n,roleId:r})),dataVisibilityMode:i.dataVisibilityMode??`all`,dataOwnerField:i.dataOwnerField??`createdBy`}]}));return Object.fromEntries(a)}async function et(e,t=`listView`){let n=M(e),r=await Promise.all(w.map(async({key:e,apiModule:r})=>[e,(await Ze(r,`teamId`,n,t)).map((t,i)=>({...O(t,i),module:e,apiModule:r,teamId:n}))]));return Object.fromEntries(r)}function tt(e){if(!e?.lookup)return null;let t={...e.lookup},n=String(t.localField??``).trim()||String(e.fieldKey??``).trim(),r=String(t.valueField??t.foreignField??``).trim()||`_id`,i=String(t.displayField??t.projectField??``).trim(),a=String(t.displayField2??``).trim(),o=Array.isArray(t.projectFields)?t.projectFields.map(e=>String(e??``).trim()).filter(Boolean):[];return o.length===0&&(o=[i,a].filter(Boolean)),{...t,localField:n,valueField:r,displayField:i,...a?{displayField2:a}:{},projectFields:o}}function nt(e){if(!e||typeof e!=`object`)return null;let t=String(e.asc??``).trim(),n=String(e.desc??``).trim();if(!t&&!n)return null;let r=String(e.default??``).trim().toLowerCase();return{asc:t,desc:n,default:r===`asc`||r===`desc`?r:``}}function rt(e,t){let n=!t||t===`listView`;return e.map((e,r)=>{let i={label:e.fieldName,field:e.fieldKey,isVisible:e.isVisible,type:e.type??`text`,order:e.order??r};return n?Object.assign(i,{isLink:e.isLink??!1,linkTemplate:e.linkTemplate??``,linkType:e.linkType??`internal`,linkTarget:e.linkTarget??`_self`,action:e.action??`navigate`,secondaryField:e.secondaryField??``,secondaryLabel:e.secondaryLabel??``,secondaryFields:Array.isArray(e.secondaryFields)?e.secondaryFields:[],secondarySeparator:e.secondarySeparator??``,lookup:tt(e),actionButtons:e.actionButtons??[],derived:e.derived??null,computed:e.computed??null,renderType:e.renderType??``,valueStyles:Array.isArray(e.valueStyles)?e.valueStyles:[],commonStyle:e.commonStyle??null,displayTemplate:e.displayTemplate??``,defaultValue:e.defaultValue??``,sortMenu:nt(e.sortMenu),columnWidth:Number(e.columnWidth)>0?Math.round(Number(e.columnWidth)):0,renderConfig:e.renderConfig?{...e.renderConfig,treatZeroAsEmpty:!!e.renderConfig.treatZeroAsEmpty,cleanEmptyTemplateSeparators:!!e.renderConfig.cleanEmptyTemplateSeparators}:null}):(i.isEditable=e.isEditable??!1,i.ismandatory=e.ismandatory??e.isMandatory??!1,t===`filter`?(i.filterInputType=e.filterInputType??`dropdown`,i.isDefaultFilter=!!e.isDefaultFilter,i.dataSource=e.dataSource??`module`,e.dataSource===`group`&&(i.groupName=e.groupName??``),i.filterGroupFields=Array.isArray(e.filterGroupFields)?e.filterGroupFields:[],i.filterGroupSeparator=e.filterGroupSeparator??` `,e.lookup&&(i.lookup=e.lookup)):[`select`,`radio`,`checkbox`].includes(e.type)&&(i.dataSource=e.dataSource??`module`,e.dataSource===`group`&&(i.groupName=e.groupName??``))),i})}async function it(e,n,r,i=`listView`,a=w,o=``,s=`createdBy`){let c=Ke(e),l=A(a).find(e=>e.key===n)?.apiModule??n;return t.o(t.S,`${C}/role`,{method:`PUT`,body:JSON.stringify({module:l,roleId:c,configType:i,visibleFields:rt(r,i),...(!i||i===`listView`)&&o?{dataVisibilityMode:o,dataOwnerField:String(s||`createdBy`).trim()||`createdBy`}:{}})})}async function at(e,n,r=0){let i=new URLSearchParams({module:e,view:n,roleId:String(r??0),configType:`listView`}),a=await t.o(t.S,`${C}?${i}`),o=a.data??a;return{fields:T(o,o?.visibleFields,a?.visibleFields).map((e,t)=>O(e,t)),stored:!!o?.stored,view:o?.view??n,roleId:Number(o?.roleId??r)||0}}async function ot(e,n,r,i){return t.o(t.S,C,{method:`POST`,body:JSON.stringify({module:e,view:n,roleId:Number(r)||0,userId:0,configType:`listView`,visibleFields:rt(i,`listView`)})})}async function st(e){let n=await t.o(t.S,`${C}/computed?module=${encodeURIComponent(e)}`),r=n.data??n;return Array.isArray(r?.fields)?r.fields:[]}var ct=`/admin/role-form-permissions`;function N(e){return`__group__:${e}`}async function lt(e,n,r={}){let i=Ke(e),a=new URLSearchParams({module:n,roleId:String(i??``)});r.clientId&&a.set(`clientId`,r.clientId),r.region&&a.set(`region`,r.region);let o=await t.o(t.S,`${ct}?${a}`),s=o?.data??o;return Array.isArray(s)?s:[]}async function ut(e,n,r){let i=Ke(e),a=[],o=0;for(let e of r){e.locked||a.push({label:e.label,field:N(e.name),isVisible:e.enabled,isEditable:e.editable!==!1,order:o++});for(let t of e.fields??[])t.locked||a.push({label:t.label,field:t.field,isVisible:t.enabled,isEditable:t.editable!==!1,order:o++})}return t.o(t.S,`${C}/role`,{method:`PUT`,body:JSON.stringify({module:n,roleId:i,configType:`form`,visibleFields:a})})}async function dt(e,n,r,i=`listView`){let a=M(e),o=w.find(e=>e.key===n)?.apiModule??n;return t.o(t.S,`${C}/team`,{method:`PUT`,body:JSON.stringify({module:o,teamId:a,configType:i,visibleFields:rt(r,i)})})}async function ft({offset:e=0,limit:n=10,sortBy:r=`new`,searchQuery:i=``}={}){let a=new URLSearchParams({offset:String(e),limit:String(n),sortBy:r});i&&a.set(`searchquery`,i);let o=await t.o(t.S,`/get-all-users?${a}`),s=o.data??o,c=T(s,o.users,o.rows,o.items,o.records,s?.users,s?.data,s?.rows,s?.items,s?.records,s?.docs,s?.result,s?.results);return{users:c,total:D({...o,...s},c)}}async function pt(e=[]){return t.o(t.S,`${C}/seed`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({collections:e})})}async function mt(){let e=await t.o(t.S,`${C}/seed-status`),n=e?.data??e??{};return{modules:Array.isArray(n.modules)?n.modules:[],seededModules:n.seededModules??{}}}async function ht(e){let n=localStorage.getItem(`authToken`),r=new FormData;r.append(`icon`,e);let i=await fetch(`${t.S}/admin/field-config/action-icon`,{method:`POST`,headers:{Authorization:`Bearer ${n}`},body:r});if(!i.ok){let e=Error(`Upload failed: ${i.status}`);throw e.status=i.status,e}let a=await i.json();return a.data??a}async function gt(){let[e,t,n]=await Promise.all([se().catch(()=>[]),F().catch(()=>[]),L().catch(()=>[])]),r=Array.isArray(e)?e:[],i=n.map(e=>String(e?.module??``).trim()).filter(Boolean);return[...r,...Array.isArray(t)?t:[],...i]}async function _t(e,{page:n=1,limit:r=100}={}){let i=new URLSearchParams({module:e,page:String(n),limit:String(r)}),a=await t.o(t.S,`/module/list?${i}`),o=a?.data??a??{};return{items:Array.isArray(o.data)?o.data:[],total:o.pagination?.total??0}}async function vt(e,n){return t.o(t.S,`/module/create?module=${encodeURIComponent(e)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)})}async function yt(e,n,r){return t.o(t.S,`/module/update/${encodeURIComponent(n)}?module=${encodeURIComponent(e)}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)})}async function P(e,n){return t.o(t.S,`/module/delete/${encodeURIComponent(n)}?module=${encodeURIComponent(e)}`,{method:`DELETE`})}async function bt(e=``,n=50){let r=new URLSearchParams({search:e,limit:String(n),offset:`0`}),i=await t.o(t.S,`/admin/location-dropdown-values?${r}`),a=i?.data??i??[];return(Array.isArray(a)?a:[]).map(e=>{let t=typeof e==`string`?e:e.label??e.value??``;return{label:t,value:t}}).filter(e=>e.label)}async function xt(e,n,r=`_id`){let i=new URLSearchParams({collection:String(e),displayField:String(n),valueField:String(r)}),a=await t.o(t.S,`/admin/lookup-dropdown-values?${i}`),o=a?.data??a??[];return(Array.isArray(o)?o:[]).map(e=>({label:e.label??e.displayValue??e[n]??String(e.value??``),value:String(e.value??e._id??e.id??``)})).filter(e=>e.value&&e.label)}async function St(e){let n=await t.o(t.S,`/admin/default-fields?module=${encodeURIComponent(e)}`),r=n?.data??n??{};return Array.isArray(r.fields)?r.fields:[]}async function Ct(e,n,r){return t.o(t.S,`/admin/default-fields`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({module:e,fields:n,otp:r})})}async function wt(e){let n=await t.o(t.S,`/email-verify`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({email:e})}),r=n?.data??n??{};return{valid:!!r.valid,reason:r.reason??``,result:r.result??``,mailboxConfirmed:!!r.mailboxConfirmed,catchAll:!!r.catchAll,disposable:!!r.disposable,roleAddress:!!r.roleAddress,risk:r.risk??``,checks:Array.isArray(r.checks)?r.checks:[]}}async function F(){let e=await t.o(t.S,`/admin/lookup/collections`),n=e.data??e;return Array.isArray(n)?n:[]}async function Tt(e){let n=await t.o(t.S,`/admin/lookup/collection-fields?collection=${encodeURIComponent(e)}`),r=n.data??n;return Array.isArray(r)?r:[]}async function I(e,n){let r=await t.o(t.S,`/admin/field-array-subfields?module=${encodeURIComponent(e)}&field=${encodeURIComponent(n)}`),i=r.data??r;return Array.isArray(i?.fields)?i.fields:[]}async function Et(){let e=await t.o(t.S,`/admin/menu-modules`);return T(e.data,e)}async function Dt({menuName:e,apiUrl:n=``,menuType:r=`menu`,parentMenuId:i=0,displayOrder:a=0}){let o=await t.o(t.S,`/admin/menu-modules`,{method:`POST`,body:JSON.stringify({menuName:e,apiUrl:n,menuType:r,parentMenuId:i,displayOrder:a})});return o.data??o}async function Ot(e,{menuName:n}){let r=await t.o(t.S,`/admin/menu-modules/${e}`,{method:`PUT`,body:JSON.stringify({menuName:n})});return r.data??r}async function kt(e){let n=await t.o(t.S,`/admin/menu-modules/${e}`,{method:`DELETE`});return n.data??n}async function At(){let e=await t.o(t.S,`/admin/menu-actions`);return T(e.data,e)}async function jt({permissionName:e,permissionKey:n}){let r=await t.o(t.S,`/admin/menu-actions`,{method:`POST`,body:JSON.stringify({permissionName:e,permissionKey:n})});return r.data??r}async function Mt(e,{permissionName:n}){let r=await t.o(t.S,`/admin/menu-actions/${e}`,{method:`PUT`,body:JSON.stringify({permissionName:n})});return r.data??r}async function Nt(e){let n=await t.o(t.S,`/admin/menu-actions/${e}`,{method:`DELETE`});return n.data??n}function Pt(e){if(e&&typeof e==`object`&&!Array.isArray(e))return Pt(e.value??e.access_value??e.accessValue??e.permissionValue??e.enabled);if(e===!0||e===1||e===`1`)return`1`;let t=String(e??``).trim().toLowerCase();return t===`true`||t===`yes`||t===`active`?`1`:`0`}function Ft(e={}){return!e||typeof e!=`object`||Array.isArray(e)?e:Object.fromEntries(Object.entries(e).map(([e,t])=>{let n=Object.fromEntries(Object.entries(t?.permissions??{}).map(([e,t])=>[e,{...t&&typeof t==`object`&&!Array.isArray(t)?t:{},id:t?.id??t?.permission_id??t?.permissionId??0,value:Pt(t)}]));return[e,{...t,menuId:t?.menuId??t?.menu_id??0,permissions:n}]}))}async function It(e){let n=await t.o(t.S,`/get-role-details?roleid=${e}`);return n?.data??n??{}}async function Lt(e,n){let r=await t.o(t.S,`/edit-role-details`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({roleId:e,menus:Ft(n)})});return typeof window<`u`&&window.dispatchEvent(new CustomEvent(`permissions:changed`,{detail:{roleId:e}})),r}async function Rt(){let e=await t.o(t.S,`/me/permissions`);return e?.data??e??{}}var zt=`/admin/custom-forms`;async function Bt(e=``,n=``,r=``){let i=new URLSearchParams;e&&i.append(`module`,e),n&&i.append(`formType`,n),r&&i.append(`action`,r);let a=`${zt}?${i.toString()}`,o=await t.o(t.S,a),s=o?.data;return Array.isArray(s)?s:Array.isArray(o)?o:[]}async function Vt(e){return t.o(t.S,zt,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}async function Ht(e,n){return t.o(t.S,`${zt}/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)})}async function Ut(e){return t.o(t.S,`${zt}/${e}`,{method:`DELETE`})}var Wt=`/admin/row-action-config`;function Gt(e){return String(e??``).trim().toLowerCase()}async function L(e=``){let n=Gt(e),r=n?`${Wt}?module=${encodeURIComponent(n)}`:Wt,i=await t.o(t.S,r),a=i?.data;return Array.isArray(a)?a:Array.isArray(i)?i:[]}async function R({module:e,roleId:n=0,rowActions:r=[]}){let i=Gt(e);return t.o(t.S,Wt,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({module:i,roleId:n,rowActions:r})})}async function Kt(e,n=[]){return t.o(t.S,`${Wt}/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({rowActions:n})})}async function qt(e){return t.o(t.S,`${Wt}/${e}`,{method:`DELETE`})}var Jt=`/admin/module-action-rules`;async function Yt(e){let n=await t.o(t.S,`${Jt}?module=${encodeURIComponent(e)}`),r=n?.data;return Array.isArray(r)?r:Array.isArray(n)?n:[]}async function Xt({module:e,name:n,description:r=``,conditions:i=[],blockedActions:a=[],disabledActions:o=[],allowedActions:s=[],primaryAction:c=``,appliesTo:l=[],isActive:u=!0}){return t.o(t.S,Jt,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({module:e,name:n,description:r,conditions:i,blockedActions:a,disabledActions:o,allowedActions:s,primaryAction:c,appliesTo:l,isActive:u})})}async function Zt(e,{name:n,description:r=``,conditions:i=[],blockedActions:a=[],disabledActions:o=[],allowedActions:s=[],primaryAction:c=``,appliesTo:l=[],isActive:u=!0}){return t.o(t.S,`${Jt}/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:n,description:r,conditions:i,blockedActions:a,disabledActions:o,allowedActions:s,primaryAction:c,appliesTo:l,isActive:u})})}async function Qt(e){return t.o(t.S,`${Jt}/${e}`,{method:`DELETE`})}async function $t(){let e=await t.o(t.S,`/admin/po-msa-config`);return e?.data??e??{}}async function en(e){let n=await t.o(t.S,`/admin/po-msa-config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});return n?.data??n??{}}var tn=Object.freeze({s3BaseUrl:`https://zinnext-devlopment-ap-south-1.s3.ap-south-1.amazonaws.com`.replace(/\/+$/,``),dateFormat:`DD MMM YYYY`,dateTimeFormat:`MMM DD, YYYY | hh:mm A`,timeFormat:`hh:mm A`,showTimeZoneLabel:!0,timeZone:``,timeZoneAliases:{},region:``,booleanTrueLabel:`Yes`,booleanFalseLabel:`No`,emptyPlaceholder:`-`,emptyTexts:{},separator:` - `,documentNameOrder:[`name`,`documentName`,`uploadName`,`uploadedFileName`,`uniqueName`],phoneFormat:`3-3-4`,phoneCountryCode:``}),nn={...tn},rn=null;function an(){return nn}function on(e){if(!e||typeof e!=`object`)return{};let t={};if(e.s3BaseUrl&&(t.s3BaseUrl=String(e.s3BaseUrl).replace(/\/+$/,``)),e.dateFormat&&(t.dateFormat=e.dateFormat),e.dateTimeFormat&&(t.dateTimeFormat=e.dateTimeFormat),e.timeFormat&&(t.timeFormat=e.timeFormat),typeof e.showTimeZoneLabel==`boolean`&&(t.showTimeZoneLabel=e.showTimeZoneLabel),typeof e.timeZone==`string`&&(t.timeZone=e.timeZone.trim()),typeof e.region==`string`&&(t.region=e.region.trim()),e.timeZoneAliases&&typeof e.timeZoneAliases==`object`&&!Array.isArray(e.timeZoneAliases)&&(t.timeZoneAliases={...nn.timeZoneAliases,...e.timeZoneAliases}),e.booleanTrueLabel&&(t.booleanTrueLabel=e.booleanTrueLabel),e.booleanFalseLabel&&(t.booleanFalseLabel=e.booleanFalseLabel),e.emptyPlaceholder&&(t.emptyPlaceholder=e.emptyPlaceholder),e.emptyTexts&&typeof e.emptyTexts==`object`&&!Array.isArray(e.emptyTexts)){let n={};Object.entries(e.emptyTexts).forEach(([e,t])=>{typeof t==`string`&&t.trim()!==``&&(n[e]=t.trim())}),Object.keys(n).length&&(t.emptyTexts={...nn.emptyTexts,...n})}return typeof e.separator==`string`&&e.separator!==``&&(t.separator=e.separator),typeof e.phoneFormat==`string`&&e.phoneFormat.trim()!==``&&(t.phoneFormat=e.phoneFormat.trim()),typeof e.phoneCountryCode==`string`&&(t.phoneCountryCode=e.phoneCountryCode.trim()),typeof e.phoneCountryCode==`string`&&(t.phoneCountryCode=e.phoneCountryCode.trim()),Array.isArray(e.documentNameOrder)&&e.documentNameOrder.length&&(t.documentNameOrder=e.documentNameOrder),t}function sn(e=cn()){let t=(String(e).match(/\d+/g)??[`3`,`3`,`4`]).map(Number).filter(e=>e>0),n=String(e).match(/\D+/)?.[0]??`-`,r=t.length?t:[3,3,4];return{groups:r,sep:n,total:r.reduce((e,t)=>e+t,0)}}function cn(){return nn.phoneFormat||tn.phoneFormat}function ln(){return nn.phoneCountryCode??tn.phoneCountryCode}function un(e,t=cn()){let{total:n}=sn(t);return String(e??``).replace(/\D/g,``).slice(0,n)}function dn(e,t=cn()){let{groups:n,sep:r}=sn(t),i=un(e,t);if(!i)return``;let a=[],o=0;for(let e of n){if(o>=i.length)break;a.push(i.slice(o,o+e)),o+=e}return a.join(r)}function fn(e){return nn={...nn,...on(e)},nn}function pn(e=!1){return rn&&!e||(rn=Ee().then(e=>fn(e)).catch(()=>nn)),rn}c.default.extend(l.default),c.default.extend(u.default);var mn=null;function hn(){if(mn===null)try{mn=c.default.tz.guess()||`UTC`}catch{mn=`UTC`}return mn}function gn(e){let t=String(e??``).trim();if(!t||t!==`UTC`&&!t.includes(`/`))return!1;try{return new Intl.DateTimeFormat(`en-US`,{timeZone:t}),!0}catch{return!1}}function z(e=an()){let t=String(e?.timeZone??``).trim();return gn(t)?t:hn()}function _n(e){return(0,c.default)().tz(z(e))}function vn(e,t){let n=(0,c.default)(e?.$date??e);return n.isValid()?n.tz(z(t)):n}function yn(e,t,n=an()){let r=vn(e,n);return r.isValid()?r.format(t||n?.dateFormat||`DD MMM YYYY`):``}function bn(e=an(),t){let n=z(e),r=On(n,e);if(r&&r.includes(`/`)){let e=xn(n,t);if(e)return r.split(`/`).map(e=>e.trim()).find(t=>t.toUpperCase()===e.toUpperCase())||e}return r||xn(n,t)||n}function xn(e,t){try{let n=t===void 0?new Date:new Date((0,c.default)(t?.$date??t).valueOf());if(Number.isNaN(n.valueOf()))return``;let r=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`short`}).formatToParts(n).find(e=>e.type===`timeZoneName`)?.value??``;return/^[A-Za-z]+$/.test(r)?r:``}catch{return``}}function Sn(e,t=an()){let n=yn(e,t?.dateTimeFormat||`MMM DD, YYYY | hh:mm A`,t);if(!n)return``;if(t?.showTimeZoneLabel===!1)return n;let r=bn(t,e);return r?`${n} ${r}`:n}function Cn(e){if(!e)return!1;if(e.tzAware===!0)return!0;if(e.tzAware===!1)return!1;let t=String(e.type??``).toLowerCase();return t===`datetime`||t===`time`||t===`datetime-local`}function wn(e,t){if(e==null||e===``)return null;let n=(0,c.default)(e);if(!n.isValid())return null;let r=z(t);return c.default.tz(n.format(`YYYY-MM-DDTHH:mm:ss`),r)}function Tn(e=z()){try{let t=(0,c.default)().tz(e).utcOffset(),n=t<0?`-`:`+`,r=Math.abs(t);return`UTC${n}${String(Math.floor(r/60)).padStart(2,`0`)}:${String(r%60).padStart(2,`0`)}`}catch{return``}}function En(e=an()){let t=z(e);return`${On(t,e)||t} (${Tn(t)})`}var Dn=Object.freeze({UTC:`UTC`,"Asia/Kolkata":`IST`,"Asia/Calcutta":`IST`,"Asia/Dubai":`GST`,"America/New_York":`EST/EDT`,"America/Chicago":`CST/CDT`,"America/Denver":`MST/MDT`,"America/Los_Angeles":`PST/PDT`,"Europe/London":`GMT/BST`,"Europe/Berlin":`CET/CEST`,"Asia/Singapore":`SGT`,"Asia/Tokyo":`JST`,"Australia/Sydney":`AEST/AEDT`});function On(e,t=an()){return(t?.timeZoneAliases??{})[e]??Dn[e]??``}function kn(e=an()){let t=[];try{t=Intl.supportedValuesOf(`timeZone`)??[]}catch{t=[]}let n=[`UTC`,...Object.keys(Dn),...Object.keys(e?.timeZoneAliases??{})];return[...new Set([...n,...t])].filter(gn).map(t=>{let n=0;try{n=(0,c.default)().tz(t).utcOffset()}catch{return null}let r=On(t,e),i=Tn(t);return{value:t,alias:r,offsetLabel:i,offsetMinutes:n,label:`${r?`${r} — `:``}${t} (${i})`}}).filter(Boolean).sort((e,t)=>e.offsetMinutes-t.offsetMinutes||e.value.localeCompare(t.value))}function An(e){return e!=null}function jn(e){let t=String(e);return t.charAt(0).toUpperCase()+t.slice(1)}function Mn(e,t){if(!e||typeof e!=`object`)return null;let n=e.key??e.value??e.id??String(t),r=e.title??e.tabTitle??e.label??e.name,i=e.count??e.countValue;return!n||!r?null:{...e,key:String(n),label:(0,s.jsxs)(a.Space,{size:6,children:[(0,s.jsx)(`span`,{children:jn(r)}),An(i)&&(0,s.jsx)(a.Badge,{className:`dynamic-tabs-count`,count:i,showZero:!0,overflowCount:2**53-1})]})}}function Nn({tabs:e=[],activeKey:t,onChange:n,className:r,extra:i}){let o=e.map(Mn).filter(Boolean);if(!o.length)return null;let c=o.some(e=>e.key===t)?t:o[0].key;return(0,s.jsx)(a.Tabs,{activeKey:c,className:r,items:o,onChange:n,tabBarExtraContent:i})}var B={brand:`#0053a5`,brandDark:`#1d4ed8`,brandDarker:`#1e40af`,brandHover:`#004f85`,brandSoft:`#dfedf7`,brandSofter:`#e7f2fa`,brandSubtle:`#edf8fe`,textPrimary:`#111827`,textSecondary:`#4b5563`,textMuted:`#6b7280`,textSubtle:`#010306`,textHeading:`#142235`,textDark:`#232a31`,textPlaceholder:`#a7b0bb`,textInverse:`#ffffff`,textLink:`#0053a5`,surfacePage:`#f5f6fa`,surfaceSoft:`#f8fafc`,surfaceSofter:`#f3f8fb`,surfaceCard:`#ffffff`,surfaceHover:`#eff6ff`,surfaceHoverLight:`#f8fcff`,surfaceHoverSoft:`#f5fbff`,surfaceSelected:`#dbeafe`,surfaceControl:`#f4f8fb`,surfaceRowAlt:`#fbfdff`,border:`#e6f0ff`,borderLight:`#eef3f8`,borderSofter:`#f0f0f0`,borderMuted:`#d8e4ef`,borderInput:`#d5dde5`,borderFocus:`#7dbce6`,borderHover:`#99c7e8`,controlBorder:`#77abd0`,controlBorderMuted:`#e7edf3`,controlAccent:`#4f9ac7`,iconMuted:`#d1d5db`,iconSubtle:`#9aa6b2`,iconNeutral:`#8c8c8c`,iconSoft:`#bbbbbb`,scrollbarThumb:`#c4ccd8`,scrollbarThumbLight:`#d1d5db`,danger:`#dc2626`,dangerSoft:`#ef4444`,dangerStrong:`#e11d24`,success:`#15803d`,successSoft:`#16a34a`,warning:`#f97316`,info:`#3b82f6`,transparent:`transparent`,statusNeutralBg:`#f1f3ee`,statusNeutralText:`#717b36`,statusProcessingBg:`#f6f4f7`,statusProcessingText:`#273048`,statusProcessingBorder:`#d4d8dd`,statusWarningBg:`#fff7ea`,statusWarningText:`#bf7328`,shadowMenu:`rgba(15, 35, 55, 0.08)`,shadowBadge:`rgba(26, 95, 145, 0.08)`,shadowTag:`rgba(39, 51, 70, 0.05)`,shadowAvatar:`rgba(57, 77, 103, 0.12)`,shadowDropdown:`0 6px 16px 0 rgba(0, 0, 0, .08), 0 3px 6px -4px rgba(0, 0, 0, .12), 0 9px 28px 8px rgba(0, 0, 0, .05)`,avatarBlueBg:`#eaf3ff`,avatarBlueText:`#142235`,avatarPurpleBg:`#f2eaff`,avatarMoreBg:`#eef6ff`,avatarMoreText:`#0053a5`,avatarNeutralBg:`#d9d9d9`,avatarNeutralText:`#555555`,avatarIndigo:`#6366f1`,avatarPurple:`#8b5cf6`,avatarBlue:`#3b82f6`,avatarGreen:`#10b981`,linkedIn:`#0077b5`};B.textPrimary,B.textSecondary,B.textMuted,B.textSubtle,B.textInverse,B.textLink,B.danger,B.success,B.danger,B.textLink,B.surfaceSoft,B.textSecondary,B.success,B.warning;var Pn={brand:`var(--color-brand)`,brandDark:`var(--color-brand-dark)`,brandDarker:`var(--color-brand-darker)`,brandHover:`var(--color-brand-hover)`,brandSoft:`var(--color-brand-soft)`,brandSofter:`var(--color-brand-softer)`,brandSubtle:`var(--color-brand-subtle)`,textPrimary:`var(--color-text-primary)`,textSecondary:`var(--color-text-secondary)`,textMuted:`var(--color-text-muted)`,textSubtle:`var(--color-text-subtle)`,textHeading:`var(--color-text-heading)`,textDark:`var(--color-text-dark)`,textPlaceholder:`var(--color-text-placeholder)`,textInverse:`var(--color-text-inverse)`,textLink:`var(--color-text-link)`,surfacePage:`var(--color-surface-page)`,surfaceSoft:`var(--color-surface-soft)`,surfaceSofter:`var(--color-surface-softer)`,surfaceCard:`var(--color-surface-card)`,surfaceHover:`var(--color-surface-hover)`,surfaceHoverLight:`var(--color-surface-hover-light)`,surfaceHoverSoft:`var(--color-surface-hover-soft)`,surfaceSelected:`var(--color-surface-selected)`,surfaceControl:`var(--color-surface-control)`,surfaceRowAlt:`var(--color-surface-row-alt)`,border:`var(--color-border)`,borderLight:`var(--color-border-light)`,borderSofter:`var(--color-border-softer)`,borderMuted:`var(--color-border-muted)`,borderInput:`var(--color-border-input)`,borderFocus:`var(--color-border-focus)`,borderHover:`var(--color-border-hover)`,controlBorder:`var(--color-control-border)`,controlBorderMuted:`var(--color-control-border-muted)`,controlAccent:`var(--color-control-accent)`,iconMuted:`var(--color-icon-muted)`,iconSubtle:`var(--color-icon-subtle)`,iconNeutral:`var(--color-icon-neutral)`,iconSoft:`var(--color-icon-soft)`,scrollbarThumb:`var(--color-scrollbar-thumb)`,scrollbarThumbLight:`var(--color-scrollbar-thumb-light)`,danger:`var(--color-danger)`,dangerSoft:`var(--color-danger-soft)`,dangerStrong:`var(--color-danger-strong)`,success:`var(--color-success)`,successSoft:`var(--color-success-soft)`,warning:`var(--color-warning)`,info:`var(--color-info)`,transparent:`var(--color-transparent)`,linkedIn:`var(--color-linkedin)`,statusNeutralBg:`var(--color-status-neutral-bg)`,statusNeutralText:`var(--color-status-neutral-text)`,statusProcessingBg:`var(--color-status-processing-bg)`,statusProcessingText:`var(--color-status-processing-text)`,statusProcessingBorder:`var(--color-status-processing-border)`,statusWarningBg:`var(--color-status-warning-bg)`,statusWarningText:`var(--color-status-warning-text)`,shadowMenu:`var(--color-shadow-menu)`,shadowBadge:`var(--color-shadow-badge)`,shadowTag:`var(--color-shadow-tag)`,shadowAvatar:`var(--color-shadow-avatar)`,shadowDropdown:`var(--color-shadow-dropdown)`,avatarBlueBg:`var(--color-avatar-blue-bg)`,avatarBlueText:`var(--color-avatar-blue-text)`,avatarPurpleBg:`var(--color-avatar-purple-bg)`,avatarMoreBg:`var(--color-avatar-more-bg)`,avatarMoreText:`var(--color-avatar-more-text)`},{Text:Fn,Title:In,Paragraph:Ln,Link:Rn}=a.Typography,zn={display:`h1`,h1:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,h5:`h5`,"section-title":`h3`,"card-title":`h4`,subtitle:`span`,body:`span`,"body-strong":`span`,label:`span`,caption:`span`,meta:`span`,metric:`span`,helper:`span`,link:`a`},Bn={xs:`var(--font-size-xs)`,sm:`var(--font-size-sm)`,md:`var(--font-size-md)`,lg:`var(--font-size-lg)`,xl:`var(--font-size-xl)`,"2xl":`var(--font-size-2xl)`,"3xl":`var(--font-size-3xl)`,"4xl":`var(--font-size-4xl)`},Vn={regular:`var(--font-weight-regular)`,medium:`var(--font-weight-medium)`,semibold:`var(--font-weight-semibold)`,bold:`var(--font-weight-bold)`,extrabold:`var(--font-weight-extrabold)`},Hn={tight:`var(--line-height-tight)`,snug:`var(--line-height-snug)`,normal:`var(--line-height-normal)`,relaxed:`var(--line-height-relaxed)`},Un={primary:Pn.textPrimary,secondary:Pn.textSecondary,muted:Pn.textMuted,subtle:Pn.textSubtle,inverse:Pn.textInverse,link:Pn.textLink,danger:Pn.danger,success:Pn.success};function Wn(...e){return e.filter(Boolean).join(` `)}function Gn(e,t){if(e!=null)return t[e]||e}function Kn(e,t){return t===`link`||e===`a`?Rn:e===`p`?Ln:[`h1`,`h2`,`h3`,`h4`,`h5`].includes(e)?In:Fn}function qn(e,t){let n=e||zn[t];if(n?.startsWith(`h`))return Number(n.slice(1))}function V({as:e,tag:t,variant:n=`body`,color:r,size:i,weight:a,lineHeight:o,align:c,truncate:l=!1,display:u,className:d,style:f,children:p,...m}){let h=t||e||zn[n]||`span`,g=Kn(h,n),_=qn(h,n),v={color:Gn(r,Un),fontSize:Gn(i,Bn),fontWeight:Gn(a,Vn),lineHeight:Gn(o,Hn),display:u,...f};return(0,s.jsx)(g,{..._?{level:_}:{},className:Wn(`app-typography`,`app-typography--${n}`,r&&Un[r]&&`app-typography--${r}`,c&&`app-typography--${c}`,l&&`app-typography--truncate`,d),style:v,...m,children:p})}var Jn=[10,12,25,50,100];function Yn(){if(typeof window>`u`)return null;let e=window.__CORE_THEME_CONFIG__?.LIST_PAGINATION;return e&&typeof e==`object`?e:null}var Xn=(e,t)=>String(e).replace(/\{(\w+)\}/g,(e,n)=>t[n]??``).replace(/\s+/g,` `).trim();function Zn({start:e,end:t,total:n,pageSize:r,summary:i,noun:a,pageSizeOptions:o,pageSizeLabel:s}){let c=e=>Number(e||0).toLocaleString(`en-IN`),l={start:c(e),end:c(t),total:c(n),noun:a??``},u=typeof i==`function`?i({start:e,end:t,total:n,noun:a}):i?Xn(i,l):`Showing ${e} - ${t} of ${n}`,d=Array.isArray(o)&&o.length?o.map(Number).filter(e=>Number.isFinite(e)&&e>0):Jn;return{summary:u,options:(d.includes(Number(r))?d:[...d,Number(r)].sort((e,t)=>e-t)).map(e=>({value:e,label:s?Xn(s,{size:e}):String(e)}))}}function Qn({current:e,pageSize:t,total:n,onChange:r,onPageSizeChange:i,summary:o,noun:c,pageSizeOptions:l,pageSizeLabel:u,showLessItems:d}){let f=Math.min((e-1)*t+1,n),p=Math.min(e*t,n),m=Yn(),h=Zn({start:f,end:p,total:n,pageSize:t,summary:o??m?.summary,noun:c??m?.noun,pageSizeOptions:l??m?.pageSizeOptions,pageSizeLabel:u??m?.pageSizeLabel}),g=!!(u??m?.pageSizeLabel);return(0,s.jsxs)(a.Flex,{align:`center`,justify:`space-between`,className:`custom-pagination`,style:{color:Pn.textSecondary},children:[(0,s.jsxs)(a.Space,{size:5,align:`center`,className:`custom-pagination__size`,children:[(0,s.jsx)(V,{variant:`body`,color:`secondary`,children:`Show`}),(0,s.jsx)(a.Select,{value:t,size:`small`,style:{width:g?void 0:72,minWidth:72},popupMatchSelectWidth:!g&&72,classNames:{popup:{root:`custom-pagination__size-popup`}},onChange:e=>{i(e),r(1)},options:h.options}),(0,s.jsx)(V,{variant:`body`,color:`secondary`,children:`/ page`})]}),(0,s.jsxs)(a.Space,{size:16,align:`center`,className:`custom-pagination__pages`,children:[(0,s.jsx)(V,{variant:`body`,color:`secondary`,className:`custom-pagination__summary`,children:h.summary}),(0,s.jsx)(a.Pagination,{current:e,pageSize:t,total:n,showSizeChanger:!1,showQuickJumper:!1,showLessItems:d??m?.showLessItems??!0,onChange:r})]})]})}var $n=(e=``)=>e.trim().replace(/^\*\*(.*?)\*\*$/s,`$1`).replace(/^__(.*?)__$/s,`$1`),er=(e=[])=>e.length>0&&e.every(e=>/^:?-{3,}:?$/.test(String(e).trim())),tr=(e=``)=>{let t=String(e||``).replace(/\r\n?/g,`
2
2
  `).trim();if(!t)return null;let n=t.split(`
3
3
  `).filter(e=>e.trim().length>0);if(n.length<2)return null;if(n.some(e=>e.includes(` `))){let e=n.map(e=>e.split(` `).map($n)),t=Math.max(...e.map(e=>e.length));return t<2?null:{rows:e.map(e=>[...e,...Array(t-e.length).fill(``)]),hasHeaderRow:!0}}let r=n.filter(e=>e.includes(`|`)).map(e=>{let t=e.trim();return t.startsWith(`|`)&&(t=t.slice(1)),t.endsWith(`|`)&&(t=t.slice(0,-1)),t.split(`|`).map($n)});if(r.length<2)return null;let i=r.findIndex(er),a=r.filter((e,t)=>t!==i),o=Math.max(...a.map(e=>e.length));return a.length<2||o<2?null:{rows:a.map(e=>[...e,...Array(o-e.length).fill(``)]),hasHeaderRow:i===1}},H=(e,t,n)=>{let{table:r,tableRow:i,tableHeader:a,tableCell:o,paragraph:s}=e.nodes;if(!r||!i||!o||!s)return null;let c=t.map((t,r)=>{let c=n&&r===0&&a?a:o,l=t.map(t=>{let n=String(t??``),r=n?e.text(n):void 0;return c.create(null,s.create(null,r))});return i.create(null,l)});return r.create(null,c)};function U({onClick:e,active:t,disabled:n,title:r,children:i}){return(0,s.jsx)(`button`,{type:`button`,title:r,disabled:n,className:`tte-btn${t?` tte-btn--active`:``}`,onMouseDown:t=>{t.preventDefault(),e?.()},children:i})}function nr({editor:e,disabled:t}){return e?(0,s.jsxs)(`div`,{className:`tte-toolbar${t?` tte-toolbar--disabled`:``}`,children:[(0,s.jsxs)(`div`,{className:`tte-toolbar-group`,children:[(0,s.jsx)(U,{title:`Bold`,disabled:t,active:e.isActive(`bold`),onClick:()=>e.chain().focus().toggleBold().run(),children:(0,s.jsx)(`strong`,{children:`B`})}),(0,s.jsx)(U,{title:`Italic`,disabled:t,active:e.isActive(`italic`),onClick:()=>e.chain().focus().toggleItalic().run(),children:(0,s.jsx)(`em`,{children:`I`})}),(0,s.jsx)(U,{title:`Underline`,disabled:t,active:e.isActive(`underline`),onClick:()=>e.chain().focus().toggleUnderline().run(),children:(0,s.jsx)(`span`,{style:{textDecoration:`underline`},children:`U`})}),(0,s.jsx)(U,{title:`Strikethrough`,disabled:t,active:e.isActive(`strike`),onClick:()=>e.chain().focus().toggleStrike().run(),children:(0,s.jsx)(`s`,{children:`S`})})]}),(0,s.jsx)(`div`,{className:`tte-toolbar-divider`}),(0,s.jsxs)(`div`,{className:`tte-toolbar-group`,children:[(0,s.jsx)(U,{title:`Bullet List`,disabled:t,active:e.isActive(`bulletList`),onClick:()=>e.chain().focus().toggleBulletList().run(),children:`≡`}),(0,s.jsx)(U,{title:`Ordered List`,disabled:t,active:e.isActive(`orderedList`),onClick:()=>e.chain().focus().toggleOrderedList().run(),children:`1.`})]}),(0,s.jsx)(`div`,{className:`tte-toolbar-divider`}),(0,s.jsx)(`div`,{className:`tte-toolbar-group`,children:(0,s.jsx)(U,{title:`Link`,disabled:t,active:e.isActive(`link`),onClick:()=>{let t=window.prompt(`Enter URL`);if(!t){e.chain().focus().unsetLink().run();return}e.chain().focus().setLink({href:t}).run()},children:`🔗`})}),(0,s.jsx)(`div`,{className:`tte-toolbar-divider`}),(0,s.jsxs)(`div`,{className:`tte-toolbar-group tte-table-tools`,children:[(0,s.jsx)(U,{title:`Insert 3 × 3 table`,disabled:t,active:e.isActive(`table`),onClick:()=>e.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),children:`▦`}),e.isActive(`table`)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(U,{title:`Add column`,disabled:t||!e.can().addColumnAfter(),onClick:()=>e.chain().focus().addColumnAfter().run(),children:`C+`}),(0,s.jsx)(U,{title:`Delete column`,disabled:t||!e.can().deleteColumn(),onClick:()=>e.chain().focus().deleteColumn().run(),children:`C−`}),(0,s.jsx)(U,{title:`Add row`,disabled:t||!e.can().addRowAfter(),onClick:()=>e.chain().focus().addRowAfter().run(),children:`R+`}),(0,s.jsx)(U,{title:`Delete row`,disabled:t||!e.can().deleteRow(),onClick:()=>e.chain().focus().deleteRow().run(),children:`R−`}),(0,s.jsx)(U,{title:`Toggle header row`,disabled:t||!e.can().toggleHeaderRow(),onClick:()=>e.chain().focus().toggleHeaderRow().run(),children:`H`}),(0,s.jsx)(U,{title:`Delete table`,disabled:t||!e.can().deleteTable(),onClick:()=>e.chain().focus().deleteTable().run(),children:`🗑`})]})]}),(0,s.jsx)(`div`,{className:`tte-toolbar-divider`}),(0,s.jsx)(`div`,{className:`tte-toolbar-group`,children:(0,s.jsx)(U,{title:`Clear formatting`,disabled:t,onClick:()=>e.chain().focus().clearNodes().unsetAllMarks().run(),children:`✕`})})]}):null}function rr({value:e=``,onChange:t,disabled:n=!1,placeholder:r=``}){let a=(0,i.useRef)(e??``),o=(0,f.useEditor)({extensions:[p.default,h.default,m.default.configure({openOnClick:!1,HTMLAttributes:{rel:`noopener noreferrer`}}),g.Table.configure({resizable:!0,HTMLAttributes:{class:`email-template-table`}}),g.TableRow,g.TableHeader,g.TableCell],content:e,editable:!n,editorProps:{attributes:{class:`tte-content`},handlePaste:(e,t)=>{let n=tr(t.clipboardData?.getData(`text/plain`)||``);if(!n)return!1;let r=H(e.state.schema,n.rows,n.hasHeaderRow);if(!r)return!1;t.preventDefault();let i=e.state.tr.replaceSelectionWith(r,!1).scrollIntoView();return e.dispatch(i),!0}},onUpdate:({editor:e})=>{let n=e.getHTML(),r=n===`<p></p>`?``:n;a.current=r,t?.(r)}});return(0,i.useEffect)(()=>{if(!o||o.isDestroyed)return;let t=e||``;t!==(a.current||``)&&(a.current=t,o.commands.setContent(t,!1))},[e,o]),(0,i.useEffect)(()=>{o&&o.setEditable(!n)},[n,o]),(0,s.jsxs)(`div`,{className:`tte-wrapper${n?` tte-wrapper--disabled`:``}`,children:[(0,s.jsx)(nr,{editor:o,disabled:n}),(0,s.jsx)(f.EditorContent,{editor:o}),!e&&!o?.isFocused&&r&&(0,s.jsx)(`div`,{className:`tte-placeholder`,children:r})]})}function ir(e){let t=String(e??``).trim();if(!t)return{baseModule:``,nestedPath:``};let[n,...r]=t.split(`.`);return{baseModule:n.trim(),nestedPath:r.map(e=>e.trim()).filter(Boolean).join(`.`)}}function ar(e){return ir(e).baseModule}var or=`test-flows`,sr=`lms-flows`;function cr(e){let t=(Array.isArray(e)?e:[e]).flat().map(e=>e&&typeof e==`object`?e.value??e.label??e.name??``:e).map(e=>String(e??``).trim().toLowerCase()).filter(Boolean);return t.includes(`dice`)?`dice`:t.includes(`internal`)?`internal`:t[0]||``}function lr(...e){for(let t of e){let e=Number(t);if(Number.isFinite(e))return e}}function ur(e,t,n,r=``){let i=e?.count,a=t?.count,o=String(r??``).trim().toLowerCase();if(i&&typeof i==`object`){let e=lr(o?i[o]:void 0,i.total,i.searchCount,i.count);if(e!==void 0)return e}if(a&&typeof a==`object`){let e=lr(o?a[o]:void 0,a.total,a.searchCount,a.count);if(e!==void 0)return e}return lr(e?.total,typeof i==`object`?void 0:i,e?.totalCount,t?.total,typeof a==`object`?void 0:a,t?.totalCount,n.length)??0}function dr(e,t){let n={};return[e?.count,t?.count].forEach(e=>{!e||typeof e!=`object`||Object.entries(e).forEach(([e,t])=>{let r=Number(t);Number.isFinite(r)&&(n[String(e).trim().toLowerCase()]=r)})}),n}async function fr(e,n,r=``,i=50,a=0,o={}){let s=new URLSearchParams({module:ar(e),field:n,value:r,limit:String(i),offset:String(a)});return o.dataSource&&s.set(`dataSource`,o.dataSource),o.masterName&&s.set(`masterName`,o.masterName),o.groupName&&s.set(`groupName`,o.groupName),t.t(t.S,`/filter-dropdown-values?${s}`)}async function pr(e,n=10,r=0,i={}){let{scope:a=``,sort:o=``,sortDir:s=``,filters:c=[]}=i;if(e===or){let{getTestFlows:e}=await Promise.resolve().then(()=>require("./index.cjs")).then(e=>e.t),t=await e({limit:n,offset:r}),i=Array.isArray(t?.items)?t.items:[],a=Number(t?.total)||0;return{items:i,total:a,limit:n,offset:r,tabs:[{key:`all`,title:`Test Cases`,count:a}]}}if(e===sr){let{getLmsFlows:e}=await Promise.resolve().then(()=>require("./index.cjs")).then(e=>e.t),t=await e({limit:n,offset:r}),i=Array.isArray(t?.items)?t.items:[],a=Number(t?.total)||0;return{items:i,total:a,limit:n,offset:r,tabs:[{key:`all`,title:`LMS Cases`,count:a}]}}let l=new URLSearchParams({module:ar(e),limit:String(n),offset:String(r)}),u=String(a??``).trim();return u&&l.set(`scope`,u),o&&l.set(`sort`,o),s&&l.set(`sortDir`,s),Array.isArray(c)&&c.some(e=>e?.field)&&l.set(`filters`,JSON.stringify(c)),t.o(t.S,`/module-data-list?${l.toString()}`)}async function mr(e,n={},r={},i={}){let{limit:a=10,offset:o=0}=r,{sort:s=``,sortDir:c=``,scope:l=``,filters:u=[]}=i,d=cr(l||String(n.selectedSource??``).split(`,`)),f=new URLSearchParams;f.append(`module`,ar(e)),f.append(`limit`,String(a)),f.append(`offset`,String(o)),d&&(f.set(`scope`,d),console.log(`[searchModuleData] Adding scope to query:`,d)),s&&f.set(`sort`,s),c&&f.set(`sortDir`,c),Array.isArray(u)&&u.some(e=>e?.field)&&f.set(`filters`,JSON.stringify(u)),console.log(`[searchModuleData] Final query string:`,f.toString()),Object.entries(n).forEach(([e,t])=>{if(t==null||t===``)return;let n=t;n=typeof t==`object`?t.value??t.label??t.name??String(t):String(t),f.append(e,n)});let p=await t.o(t.S,`/module-data-list?${f.toString()}`),m=p?.data??p,h=Array.isArray(m)?m:m?.rows??m?.records??m?.items??m?.list??m?.data??[],g=ur(p,m,h,d),_=dr(p,m);d&&_[d]===void 0&&Number.isFinite(g)&&(_[d]=g);let v=h.some(e=>[e?.sourceType,e?.profileSource,e?.selectedSource,e?.customFields?.sourceType,e?.customFields?.profileSource].flat().some(e=>String(e??``).trim().toLowerCase()===`dice`)||!!e?.customFields?.diceProfileData),y=h;if(v)try{let{transformDiceResponseToInternalFormat:e}=await Promise.resolve().then(()=>require("./diceCandidateMapper-BjMhHno3.cjs")).then(e=>e.t);y=e(p,p)?.data?.data??h}catch(e){console.error(`[searchModuleData] Dice transformation failed:`,e),y=h.map(gr)}else y=Array.isArray(h)?h.map(gr):[];return{rows:y,total:Number(g)||0,counts:_,tabs:p?.tabs??p?.tabList??m?.tabs??m?.tabList??[],fields:p?.fields??p?.fieldConfig??m?.fields??m?.fieldConfig??[],tabField:p?.tabField??m?.tabField??``,actionRules:m?.actionRules??[],actions:m?.actions??[],columnActions:m?.columnActions??[]}}function hr(e,t){return String(t).split(`.`).reduce((e,t)=>e?.[t],e)}function W(e,t,n){let r=String(t).split(`.`).filter(Boolean);if(!r.length)return e;let i={...e},a=i,o=e;return r.slice(0,-1).forEach(e=>{let t=o?.[e],n=t&&typeof t==`object`&&!Array.isArray(t)?{...t}:{};a[e]=n,a=n,o=t}),a[r[r.length-1]]=n,i}function gr(e){if(!e||typeof e!=`object`)return e;let t=[`skills`,`technicalSkills`,`primarySkills`,`keySkills`,`customFields.diceProfileData.skills`],r=e,i=null;if(t.forEach(e=>{let t=hr(r,e);if(t==null)return;let a=n.n(t);a.length===0&&Array.isArray(t)&&t.length>0||(i??=a,r=W(r,e,a))}),i&&hr(r,`skills`)===void 0&&(r=W(r,`skills`,i)),[r?.sourceType,r?.profileSource,r?.selectedSource,r?.customFields?.sourceType,r?.customFields?.profileSource].flat().some(e=>String(e??``).trim().toLowerCase()===`dice`)||r?.customFields?.diceProfileData){let e=n.r(r),t=r?.candidateId??r?.customFields?.diceProfileData?.candidateId??``;r={...r,id:r?.id??e,diceId:e,candidateId:t}}return r}function _r(e){return String(e??``).replace(/^__mw__.*?__/,``).replace(/\[\d+\]$/,``).trim()||`file`}async function vr(e,n,r=[],i={}){if(!e)throw Error(`moduleName is required to upload documents`);if(!n)throw Error(`refId (created record id) is required to upload documents`);if(!r.length)return{data:[],total:0};let a=r.filter(e=>!e?.skipDocumentRegistry);if(!a.length)return{data:[],total:0};let o=await t.a(),s=new Map;a.forEach(t=>{let n=String(t?.documentModule||e).trim()||e;s.has(n)||s.set(n,[]),s.get(n).push(t)});let c=async(e,r)=>{let a=new FormData;r.forEach(({formKey:e,file:t})=>{let n=t?.name??void 0;a.append(_r(e),t,n)}),i&&Object.keys(i).length>0&&a.append(`metadata`,JSON.stringify(i));let s=new URLSearchParams({module:e,refId:String(n)}),c=await fetch(`${t.S}/documents/upload?${s.toString()}`,{method:`POST`,headers:{Authorization:`Bearer ${o}`},body:a}),l=(c.headers.get(`content-type`)||``).includes(`application/json`)?await c.json():await c.text();if(!c.ok){let e=Error(l?.error||l?.message||`API ${c.status}: ${c.statusText}`);throw e.status=c.status,e.data=l,e}return l?.data??l},l=await Promise.all(Array.from(s,([e,t])=>c(e,t)));return l.length===1?l[0]:{data:l.flatMap(e=>Array.isArray(e)?e:Array.isArray(e?.data)?e.data:[]),total:l.reduce((e,t)=>e+Number(t?.total??(Array.isArray(t)?t.length:t?.data?.length)??0),0)}}async function yr(e,n,r=``){if(!e)throw Error(`moduleName is required to fetch documents`);if(!n)throw Error(`refId is required to fetch documents`);let i=new URLSearchParams({module:e,refId:String(n)});r&&i.set(`fieldName`,r);let a=await t.o(t.S,`/documents?${i.toString()}`),o=a?.data??a??{};return{data:Array.isArray(o?.data)?o.data:Array.isArray(o)?o:[],total:o?.total??0}}var br={job:{fetchUrl:e=>`${t.w}/edit/detailed-view/${encodeURIComponent(e)}`},candidate:{fetchUrl:e=>`${t.C}/edit/detailed-view?_id=${encodeURIComponent(e)}`},candidates:{fetchUrl:e=>`${t.C}/edit/detailed-view?_id=${encodeURIComponent(e)}`},submission:{fetchUrl:e=>`${t.E}/edit/detailed-view?_id=${encodeURIComponent(e)}`}};async function xr(e,n){let r=String(e??``).trim().toLowerCase();if(r===`job`||r===`jobs`){let{getJobDetailView:e}=await Promise.resolve().then(()=>require("./index.cjs")).then(e=>e.r);return e(n)}if(r===`candidate`||r===`candidates`)return Cr(r===`candidate`?`candidate`:`candidates`,n);let i=new URLSearchParams({module:String(e??``),id:String(n)});return t.o(t.S,`/module-data-detail?${i.toString()}`)}async function Sr(e){let n=await t.o(t.S,`/module-actions?module=${encodeURIComponent(e)}`),r=n?.data??n??{};return{actions:Array.isArray(r.actions)?r.actions:[],actionRules:Array.isArray(r.actionRules)?r.actionRules:[]}}async function Cr(e,n){if(!e)throw Error(`module is required`);if(!n)throw Error(`id is required`);let r=br[e];if(!r)throw Error(`No edit config for module: ${e}`);let i=await t.a(),a=await fetch(r.fetchUrl(n),{method:`GET`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${i}`}});if(!a.ok)throw Error(`API ${a.status}: ${a.statusText}`);let o=await a.json();return o.data??o}async function wr(e,n,r,i=[]){if(!e)throw Error(`module is required`);if(!n)throw Error(`id is required`);let a=await t.a(),o=new FormData;o.append(`json`,JSON.stringify(r)),(i??[]).forEach(({formKey:e,file:t})=>o.append(e,t));let s=await fetch(`${t.S}/module/update/${encodeURIComponent(n)}?module=${encodeURIComponent(e)}`,{method:`PUT`,headers:{Authorization:`Bearer ${a}`},body:o});if(!s.ok){let e=await s.text();console.error(`[updateRecord] Error response:`,e);let t=Error(Er(e)||`API ${s.status}: ${s.statusText}`);throw t.status=s.status,t.response=Tr(e),t}let{invalidateFormGroupsCache:c}=await Promise.resolve().then(()=>require("./formGroupsCache-Bbz-28ws.cjs")).then(e=>e.n);c();let l=await s.json();return l.data??l}function Tr(e){let t=String(e??``).trim();if(!t.startsWith(`{`))return null;try{return JSON.parse(t)}catch{return null}}function Er(e){let t=String(e??``).trim();if(!t.startsWith(`{`))return t;try{let e=JSON.parse(t),n=e?.error??e?.message;return typeof n==`string`&&n.trim()?n.trim():t}catch{return t}}var Dr=e=>e?.data??e;async function Or(e,n){if(!e||!n)return[];let r=new URLSearchParams({module:e,id:String(n)}),i=Dr(await t.o(t.S,`/module-activity?${r.toString()}`));return Array.isArray(i)?i:[]}async function kr(e){if(!e)return[];let n=Dr(await t.o(t.S,`/notes?relatedId=${encodeURIComponent(e)}`));return Array.isArray(n)?n:[]}async function Ar({relatedId:e,notes:n,title:r,notesFor:i}){return Dr(await t.o(t.S,`/notes`,{method:`POST`,body:JSON.stringify({relatedId:e,notes:n,title:r,notesFor:i})}))}function jr(e,t){if(!e)return!0;let n=e.find(e=>e.name===t);return!n||n.enabled!==!1}function Mr(e,t,n){if(!e)return!0;let r=e.find(e=>e.name===t);if(!r)return!0;let i=r.fields?.find(e=>e.field===n);return!i||i.enabled!==!1}function Nr(e,t,n){if(!e)return!0;let r=e.find(e=>e.name===t);if(!r)return!0;if(r.editable===!1)return!1;let i=r.fields?.find(e=>e.field===n);return!i||i.editable!==!1}var Pr=[`p`,`br`,`strong`,`b`,`em`,`i`,`u`,`s`,`ul`,`ol`,`li`,`blockquote`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`a`,`code`,`pre`],Fr=[`href`,`title`,`target`,`rel`],Ir=/[\u200B-\u200D\u2060\uFEFF]/g,Lr=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,Rr=/^[\p{L}\p{M}\p{N} .'-]+$/u,zr=/^\+?[0-9 ()-]+$/,Br=/^-?(?:\d+|\d*\.\d+)$/,Vr=[{re:/<\s*\/?\s*(?:script|iframe|object|embed|svg|img|form|input|style|link|meta)\b/i,message:`HTML/script content is not allowed`},{re:/\b(?:javascript|vbscript)\s*:|\bdata\s*:\s*text\/html/i,message:`Unsafe URL protocol is not allowed`},{re:/\bon[a-z]+\s*=/i,message:`HTML event handlers are not allowed`},{re:/\bunion\s+(?:all\s+)?select\b|\b(?:drop\s+table|delete\s+from|insert\s+into|xp_cmdshell)\b/i,message:`Database command patterns are not allowed`},{re:/(?:['"]\s*)?\b(?:or|and)\s+\d+\s*=\s*\d+/i,message:`Injection patterns are not allowed`},{re:/["']?\$(?:where|gt|gte|lt|lte|ne|regex|or|and|expr|function)\b/i,message:`MongoDB operators are not allowed in input values`},{re:/(?:\.\.[/\\])|(?:%2e|%2f|%5c)/i,message:`Path traversal patterns are not allowed`},{re:/&&|\|\||\$\(|\$\{|`|\b(?:rm\s+-rf|cat\s+\/etc\/|whoami\b|curl\s+https?:\/\/|wget\s+https?:\/\/)/i,message:`Command execution patterns are not allowed`},{re:/<\/?[a-zA-Z][a-zA-Z0-9]*(?:\s[^<>]*)?>/,message:`HTML tags are not allowed`}],Hr=/[&<\r\0]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/,Ur=null;function Wr(e){if(typeof document>`u`||!Hr.test(e))return e;(!Ur||Ur.ownerDocument!==document)&&(Ur=document.createElement(`textarea`)),Ur.innerHTML=e;let t=Ur.value;return Ur.textContent=``,t}function Gr(e){let t=String(e??``);for(let e=0;e<2;e+=1)try{let e=decodeURIComponent(t);if(e===t)break;t=e}catch{break}return t=Wr(t).replace(/\\x([0-9a-f]{2})/gi,(e,t)=>String.fromCharCode(Number.parseInt(t,16))).replace(/\\u([0-9a-f]{4})/gi,(e,t)=>String.fromCharCode(Number.parseInt(t,16))),t.normalize(`NFC`)}function Kr(e){return v.default.sanitize(String(e??``),{ALLOWED_TAGS:Pr,ALLOWED_ATTR:Fr,ALLOW_DATA_ATTR:!1,FORBID_TAGS:[`script`,`style`,`iframe`,`object`,`embed`,`svg`,`img`,`form`,`input`],FORBID_ATTR:[`style`,`src`,`srcset`]})}function qr(e){let t=(e.validations??[]).find(e=>e?.type===`max`),n=Number(e.validator?.maxLength??t?.value??e.maxLength);return Number.isFinite(n)&&n>0?n:e.type===`email`||e.formatter===`email`?255:e.formatter===`phone`||e.formatter===`digits`?32:e.formatter===`name`?100:e.type===`text-editor`?5e4:(e.type,5e3)}function Jr(e){return e.type===`textarea`||e.type===`text-editor`}function Yr(e,t={}){if(typeof e!=`string`)return e;if(t.type===`text-editor`)return Kr(e.normalize(`NFC`));let n=e.normalize(`NFC`).replace(Ir,``).replace(/\u00A0/g,` `).replace(Lr,``);return n=Jr(t)?n.replace(/\r\n?/g,`
4
- `).replace(/[ \t]{2,}/g,` `).trim():n.replace(/\s+/g,` `).trim(),n}function Xr(e,t={}){if(typeof e!=`string`||e===``)return null;let n=t.label||t.field||`Field`,r=Gr(e);if(r.includes(`\0`)||r.includes(`\0`))return`${n} contains a null byte`;if(t.type!==`text-editor`){let e=Vr.find(({re:e})=>e.test(r));if(e)return`${n}: ${e.message}`}else{let e=Vr.slice(0,3).find(({re:e})=>e.test(r));if(e)return`${n}: ${e.message}`}let i=Yr(e,t);return[...i].length>qr(t)?`${n} is too long`:t.formatter===`name`&&i&&!Rr.test(i)?`${n} allows only letters, numbers, spaces, apostrophes, hyphens and periods`:(t.formatter===`phone`||t.formatter===`digits`)&&i&&!zr.test(i)?`${n} contains invalid phone characters`:t.type===`number`&&i&&!Br.test(i)?`${n} must contain only a valid number`:(t.type===`url`||t.formatter===`url`)&&i&&!/^https?:\/\//i.test(i)?`${n} must use http:// or https://`:null}function Zr(e){return{validator:(t,n)=>{let r=(Array.isArray(n)?n:[n]).map(t=>Xr(t,e)).find(Boolean);return r?Promise.reject(Error(r)):Promise.resolve()}}}function Qr(e=[]){let t=new Map;return e.forEach(e=>{(e.fields??[]).forEach(n=>{if(n.type===`file`)return;let r=n.payloadKey||n.field;if(!r)return;let i=e.addRow?`${e.payloadKey||e.name}[].${r}`:r;t.set(i,n)})}),t}function $r(e,t=[]){let n=Qr(t),r=(e,t=``)=>{if(typeof e==`string`){let r=n.get(t)??{},i=Xr(e,r);if(i)throw Error(i);return Yr(e,r)}return Array.isArray(e)?e.map(e=>r(e,`${t}[]`)):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>{if(e.startsWith(`$`)||e.includes(`.`)||e.includes(`\0`))throw Error(`Unsafe object key: ${e}`);let i=t?`${t}.${e}`:e;return[e,r(n,i)]})):e};return r(e)}var ei=e=>e===!0||e===1||e===`1`||e===`true`;function ti(e){let t=e?.overrideCheckbox;return!t||typeof t!=`object`?null:ri(e).size>0?t:null}function ni(e){return String(e?.overrideCheckbox?.field??``).trim()||`${String(e?.field??``).replace(/\./g,`_`)}__override`}function ri(e){let t=e?.overrideCheckbox?.skipValidations,n=Array.isArray(t)?t:String(t??``).split(`,`);return new Set(n.map(e=>String(e??``).trim()).filter(Boolean))}function ii(e){return e?.overrideCheckbox?.store!==!1}function ai(e,t,n){let r=ni(e);if(typeof n==`function`){let e=n(r);if(Array.isArray(e)&&e.length)return[...e,r]}return Array.isArray(t)&&t.length>=3&&typeof t[1]==`number`?[t[0],t[1],r]:[r]}function oi(e,t){return n=>{let r=!1;try{r=ei(n?.getFieldValue?.(t))}catch{r=!1}return r?{}:e}}function si(e,t,n,r){if(!ti(e))return r;let i=ri(e),a=ai(e,t,n);return e=>{let t=r(e),n=typeof e==`string`?e:e?.type;return i.has(n)?oi(t,a):t}}function ci(e){let t=ti(e)??{},n=e?.label??e?.field??`this field`;return{tone:t.tone??`overwrite`,title:t.confirmTitle||`Remove the validation on this field?`,body:t.confirmBody||`The check that keeps ${n} within its allowed limit will be turned off for this record, and a value above that limit will be accepted. The override is recorded against the record. Do you want to continue?`,okText:t.confirmOkText||`Yes, remove the limit`,cancelText:t.confirmCancelText||`Keep the limit`}}function li(e){return String(e??``).normalize(`NFKD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().replace(/[^a-z0-9]+/g,``)}function ui(e){let t=new Map,n=(e,n)=>{let r=li(e);r&&!t.has(r)&&t.set(r,n)};return(Array.isArray(e?.options)?e.options:[]).forEach(e=>{if(e==null)return;let t=typeof e==`object`?e.value:e;t!=null&&t!==``&&(n(t,t),typeof e==`object`&&e.label!==void 0&&n(e.label,t))}),Object.entries(e?.optionAliases??{}).forEach(([e,r])=>{let i=t.get(li(r));i!==void 0&&n(e,i)}),t}var di=e=>Array.isArray(e?.options)&&e.options.length>0;function fi(e,t){if(t==null||t===``||typeof t==`object`)return t;let n=e.get(li(t));return n===void 0?t:n}function pi(e,t){if(!di(e))return t;let n=ui(e);return n.size===0?t:Array.isArray(t)?t.map(e=>fi(n,e)):fi(n,t)}var mi=e=>e==null||e===``||Array.isArray(e)&&e.length===0,hi=e=>e===!0||e===1||e===`1`,G=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&!gi(e);function gi(e){return e&&typeof e==`object`&&typeof e.format==`function`&&typeof e.isValid==`function`}function _i(e){return gi(e)||e instanceof Date}function vi(e){return e instanceof Date?e.toISOString():gi(e)?e.isValid()?e.toISOString():null:e}function yi(e,t){if(!Cn(t))return vi(e);let n=wn(e);return n?n.toISOString():vi(e)}function bi(e,t){if(!t)return;let n=String(t).split(`.`),r=e;for(let e of n){if(r==null)return;r=r[e]}return r}function xi(e,t){return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:bi(e,t)}function Si(e,t){return e&&Object.prototype.hasOwnProperty.call(e,t)?!0:bi(e,t)!==void 0}function Ci(e,t,n){let r=String(t).split(`.`),i=e;for(let e=0;e<r.length-1;e+=1){let t=r[e];G(i[t])||(i[t]={}),i=i[t]}return i[r[r.length-1]]=n,e}function wi(e,t,n){let r=String(t).split(`.`),i=e;for(let e=0;e<r.length-1;e+=1){let t=r[e];G(i[t])||(i[t]={}),i=i[t]}let a=r[r.length-1];return i[a]=G(i[a])&&G(n)?{...n,...i[a]}:n,e}function Ti(e){let t=Array.isArray(e)?e:e==null?[]:[e];if(!t.length||t.some(e=>e?.originFileObj))return;let n=t.map(e=>e?.stored).filter(e=>e!=null);if(n.length)return n.length===1&&t.length===1?n[0]:n}function Ei(e,t){return Object.entries(t??{}).forEach(([t,n])=>{G(n)&&G(e[t])?Ei(e[t],n):e[t]=n}),e}function Di(e,t){let n=e.options??e.values??[];for(let e of n)if(typeof e==`string`){if(e===t)return e}else if((e.value??e.id??e.name??e.label)===t)return e.label??e.name??e.value}function Oi(e,t){if(G(e)){let n=(t.valueKey&&e[t.valueKey])??e.value??e.id??e._id??e.key??e.code;return{value:n,label:(t.displayKey&&e[t.displayKey])??e.label??e.name??e.text??e.title??n}}return{value:e,label:Di(t,e)??e}}function ki(e={}){if(e.dataType&&e.dataType!==`auto`)return e.dataType;if(e.multiSelect||e.mode===`multiple`||e.addRow)return`array`;switch(e.type){case`number`:return`number`;case`date`:case`time`:return`date`;default:return`auto`}}function Ai(e,t,n={}){if(_i(e)){if(t===`string`)return yi(e,n);if(t===`number`){let t=gi(e)?e.valueOf():e.getTime();return Number.isNaN(t)?null:t}if(t===`date`||t===`auto`||!t)return yi(e,n)}switch(t){case`string`:return e==null?``:String(e);case`number`:{if(mi(e))return null;let t=Number(e);return Number.isNaN(t)?null:t}case`boolean`:return e===!0||e===1||e===`1`||e===`true`;case`array`:{let t;return t=Array.isArray(e)?e:mi(e)?[]:typeof e==`string`&&e.includes(`,`)?e.split(`,`).map(e=>e.trim()).filter(Boolean):[e],n.elementType?t.map(e=>Ai(e,n.elementType,{})).filter(e=>e!=null&&e!==``):t}case`object`:return G(e),e;case`date`:return yi(e,n);case`custom`:case`auto`:case void 0:default:return e}}var ji={firstChecked:e=>Array.isArray(e)?e[0]:e,csvToArray:e=>typeof e==`string`?e.split(`,`).map(e=>e.trim()).filter(Boolean):e,arrayToCsv:e=>Array.isArray(e)?e.join(`,`):e,trim:e=>typeof e==`string`?e.trim():e,upper:e=>typeof e==`string`?e.toUpperCase():e,lower:e=>typeof e==`string`?e.toLowerCase():e};function Mi(e,t){if(!t)return e;let n=t;if(typeof n==`string`){if(ji[n])return ji[n](e);try{n=JSON.parse(n)}catch{return e}}let r=e;if(n.name&&ji[n.name]&&(r=ji[n.name](r)),n.map&&typeof n.map==`object`){let e=String(Array.isArray(r)?r[0]:r);Object.prototype.hasOwnProperty.call(n.map,e)?r=n.map[e]:n.default!==void 0&&(r=n.default)}return r}var Ni=/\{\{\s*([\w.]+)\s*\}\}/g;function Pi(e,t){let[n,...r]=e.split(`.`),i;if(n===`value`)i=t.value;else if(n===`label`)i=t.label;else if(n===`raw`)i=t.raw;else return;return r.length?bi(i,r.join(`.`)):i}function Fi(e,t){if(typeof e==`string`){let n=e.match(/^\{\{\s*([\w.]+)\s*\}\}$/);return n?Pi(n[1],t):e.replace(Ni,(e,n)=>{let r=Pi(n,t);return r==null?``:String(r)})}if(Array.isArray(e))return e.map(e=>Fi(e,t));if(G(e)){let n={};return Object.entries(e).forEach(([e,r])=>{n[e]=Fi(r,t)}),n}return e}function Ii(e){if(!e)return null;if(typeof e==`string`)try{return JSON.parse(e)}catch{return null}return e}function Li(e,t){let n=e.payloadMode||`auto`,r=ki(e),{value:i,label:a}=Oi(t,e);switch(n){case`value`:return{kind:`scalar`,out:Ai(i,r,e)};case`label`:return{kind:`scalar`,out:Ai(a,e.dataType||`string`,e)};case`object`:{let t=e.valueKey||`id`,n=e.displayKey||`name`;return{kind:`scalar`,out:{[t]:Ai(i,e.elementType||`auto`,{}),[n]:a}}}case`custom`:case`template`:{let n=Ii(e.payloadTemplate);if(!n)return{kind:`scalar`,out:Ai(i,r,e)};let o=Fi(n,{value:Ai(i,e.elementType||`auto`,{}),label:a,raw:t});return{kind:e.payloadKey?`scalar`:`spread`,out:o}}default:return{kind:`scalar`,out:Ai(i,r,e)}}}function Ri(e,t){if(e.payloadMode===`skip`)return{kind:`skip`};let n=t;return mi(n)&&e.defaultValue!==void 0&&e.defaultValue!==``&&(n=e.defaultValue),n=Mi(n,e.transformRule),mi(n)&&e.omitEmpty?{kind:`skip`}:Array.isArray(n)&&(ki(e)===`array`||e.payloadMode===`object`)&&e.payloadMode&&e.payloadMode!==`value`&&e.payloadMode!==`auto`?{kind:`scalar`,out:n.map(t=>Li(e,t).out)}:Li(e,n)}function zi(e={}){return!!e.richValue||[`label`,`object`,`custom`,`template`].includes(e.payloadMode)}function Bi(e,t,n=[]){if(!zi(e)||t==null)return t;let r=e=>{if(G(e)&&e.value!==void 0)return e;let t=n.find(t=>String(t?.value??``)===String(e)||String(t?.label??``)===String(e));return{value:t?.value??e,label:t?.label??String(e)}};return Array.isArray(t)?t.map(r):r(t)}function Vi(e,t,n){if(!e?.field)return!0;let r=Si(t,e.field)?xi(t,e.field):xi(n??t,e.field),i=()=>String(e.value??``).split(`,`).map(e=>e.trim());switch(e.operator){case`eq`:return String(r??``)===String(e.value??``);case`neq`:return String(r??``)!==String(e.value??``);case`truthy`:return r!=null&&r!==``&&r!==!1;case`falsy`:return r==null||r===``||r===!1;case`notEmpty`:return Array.isArray(r)?r.length>0:!!r;case`in`:return i().includes(String(r??``));case`notIn`:return!i().includes(String(r??``));default:return!0}}function Hi(e){let t=[];return e?.field&&t.push(e.field),Array.isArray(e?.conditions)&&e.conditions.forEach(e=>{e?.field&&t.push(e.field)}),t}function Ui(e,t,n){if(!e)return!0;let r=Array.isArray(e.conditions)?e.conditions.filter(e=>e?.field):[];if(r.length){let i=r.map(e=>Vi(e,t,n)),a=String(e.logic??`and`).toLowerCase()===`or`,o=a?i.some(Boolean):i.every(Boolean);if(e.field){let r=Vi(e,t,n);o=a?o||r:o&&r}return o}return Vi(e,t,n)}function Wi(e,t,n,r,i=new Set){let a=Hi(e?.showIf);return!a.length||i.has(e.field)?!0:(i.add(e.field),Ui(e.showIf,t,n)?a.every(e=>{let a=r?.get?.(e);return!a||Wi(a,t,n,r,i)}):!1)}function Gi(e=[]){let t=new Map;return e.forEach(e=>(e.fields??[]).forEach(e=>{e?.field&&!t.has(e.field)&&t.set(e.field,e)})),t}function Ki(e={},{editing:t=!1}={}){let n={};return(e.fields??[]).forEach(e=>{!e.field||Yi(e)||t&&!e.defaultOnEdit||e.defaultValue!==void 0&&e.defaultValue!==``&&(n[e.field]=e.defaultValue)}),n}function qi(e=[]){let t=[];return e.forEach(e=>{(e.fields??[]).forEach(n=>{t.push({field:n,group:e})})}),t}var Ji=[`file`,`document`,`image`,`upload`,`attachment`];function Yi(e){return Ji.includes(String(e?.type??``).trim().toLowerCase())}function Xi(e=[]){return qi(e).map(({field:e})=>e).filter(Yi)}function Zi(e){return String(e??``).trim().toLowerCase()}function Qi(e,t){return!!t&&Zi(e.moduleName)===t}function $i(e,t){if(Zi(e?.moduleName)!==`documents`)return``;let n=(e.fields??[]).find(e=>!Yi(e)&&String(e.payloadKey||e.field||``).trim()===`module`);if(!n?.field)return``;let r=Ri(n,xi(t,n.field));if(r.kind!==`scalar`)return``;let i=r.out;if(Array.isArray(i)){if(i.length!==1)return``;[i]=i}return G(i)&&(i=i.value??i.id??i._id??i.key??i.code),i==null?``:String(i).trim()}function ea(e,t,n){if(!Qi(e,n))return!1;let r=String(t?.fileNameKey??``).trim(),i=String(t?.fileUrlKey??``).trim();return!!(r&&i)}function ta(e,t=[],n={}){let r=[],i=n.scope??`all`,a=Zi(n.module),o=(e,t,n=``,i=!1)=>{t!=null&&(Array.isArray(t)?t:[t]).forEach(t=>{let a=t?.originFileObj||t,o={formKey:e,file:a};n&&(o.documentModule=n),i&&(o.skipDocumentRegistry=!0),(typeof File<`u`&&a instanceof File||typeof Blob<`u`&&a instanceof Blob)&&r.push(o)})};return(t??[]).forEach(t=>{let r=(t.fields??[]).filter(Yi);if(!r.length)return;let s=t.moduleName&&!Qi(t,a),c=e=>s?`__mw__${t.moduleName}__${e}`:e;if(t.addRow){if(i===`flat`)return;let s=e[t.name];if(!Array.isArray(s))return;r.forEach(e=>{let r=e.fileKey??String(e.field).split(`.`)[0],i=ea(t,e,a);s.forEach((a,s)=>{let l=c(n.indexed?`${r}[${s}]`:r);o(l,xi(a,e.field),$i(t,a),i)})});return}i!==`addRow`&&r.forEach(n=>{let r=c(n.fileKey??String(n.field).split(`.`)[0]),i=ea(t,n,a);o(r,xi(e,n.field),$i(t,e),i)})}),r}function na(e,t,n={}){let r=G(n.base)?structuredClone(n.base):{};Xi(t).forEach(e=>{(e.payloadKey||e.field)&&(aa(r,e.payloadKey||e.field),aa(r,e.field))});let i=Zi(n.module),a=Gi(t),o=new Map,s=e=>!e.moduleName||Qi(e,i)?r:(o.has(e.moduleName)||o.set(e.moduleName,{}),o.get(e.moduleName));return(t??[]).forEach(t=>{let n=s(t),r=t.fields??[],i=t.toggleEnabled&&t.toggleField&&Si(e,t.toggleField)?!!xi(e,t.toggleField):!1;if(t.toggleEnabled&&t.toggleField&&Si(e,t.toggleField)&&(Ci(n,t.toggleField,i),i&&t.addRow)){Ci(n,t.payloadKey||t.name,[]);return}if(t.addRow){let i=e[t.name];if(!Array.isArray(i))return;Ci(n,t.payloadKey||t.name,i.map(t=>ia(r,t,e,a)).filter(e=>e&&Object.keys(e).length>0));return}r.forEach(t=>ra(t,e,n,e,a))}),o.size>0&&(r.moduleWrites=Array.from(o,([e,t])=>({moduleName:e,data:t}))),$r(r,t)}function ra(e,t,n,r,i){if(ti(e)&&ii(e)){let r=ni(e);Si(t,r)&&Ci(n,r,!!xi(t,r))}if(Yi(e)){let i=xi(t,e.field),a=(Array.isArray(i)?i:[i]).flatMap(e=>{let t=e?.originFileObj||e,n=typeof File<`u`&&t instanceof File||typeof Blob<`u`&&t instanceof Blob?String(t?.name??e?.name??``).trim():``;return n?[n]:[]});e.fileNameKey&&a.length&&Ci(n,e.fileNameKey,hi(e.multiple)||a.length>1?a:a[0]);let o=Ti(xi(t,e.field));if(o!==void 0){let i=r!==void 0&&r!==t;wi(n,e.payloadKey||(i?e.field:e.fileKey||e.field),o)}return}if(Hi(e.showIf).length&&!Wi(e,t,r,i)){(r===void 0||r===t)&&Si(t,e.field)&&Ci(n,e.payloadKey||e.field,null);return}if(Array.isArray(e.subFields)&&e.subFields.length>0){if(!Si(t,e.field))return;let a=xi(t,e.field);if(!Array.isArray(a))return;let o=a.map(t=>ia(e.subFields,t,r,i)).filter(e=>e&&Object.keys(e).length>0);Ci(n,e.payloadKey||e.field,o);return}if(!Si(t,e.field))return;if(hi(e.addRow)&&(!Array.isArray(e.subFields)||e.subFields.length===0)){let r=xi(t,e.field),i=Array.isArray(r)?r:mi(r)?[]:[r],a=ca(e),o=i.map(e=>Ri(a,e)).filter(e=>e.kind!==`skip`).map(e=>e.out);Ci(n,e.payloadKey||e.field,o);return}let a=Ri(e,xi(t,e.field));if(a.kind!==`skip`){if(a.kind===`spread`&&G(a.out)){Ei(n,a.out);return}Ci(n,e.payloadKey||e.field,a.out)}}function ia(e,t,n,r){let i={};return e.forEach(e=>ra(e,t,i,n??t,r)),i}function aa(e,t){let n=String(t).split(`.`),r=e;for(let e=0;e<n.length-1;e+=1){if(!G(r[n[e]]))return;r=r[n[e]]}delete r[n[n.length-1]]}var oa=new Set([`text`,`textarea`,`email`,`phone`,`tel`,`number`,`date`,`time`,`datetime`,`password`]);function sa(e,t){let n=t=>(Array.isArray(e.emptyValues)?e.emptyValues:[]).some(e=>String(e)===String(t)),r=()=>e.defaultOnEdit&&e.defaultValue!==void 0&&e.defaultValue!==``?e.defaultValue:void 0;if(t==null)return r()??t;if(n(t))return r();if(mi(t)&&e.defaultOnEdit&&e.defaultValue!==void 0&&e.defaultValue!==``)return e.defaultValue;if(oa.has(e.type)&&G(t)){let n=String(e.payloadKey||e.field||``).split(`.`).pop(),r=n?t[n]:void 0;if(r===void 0||G(r))return;t=r}if(e.type===`date`||e.type===`time`){if(!t||t===`0001-01-01T00:00:00Z`)return null;let e=(0,c.default)(t);return e.isValid()?e:null}t=pi(e,t);let i=t=>G(t)?(e.valueKey&&t[e.valueKey])??t.id??t._id??t.value??t.userId??t.recruiterId:t,a=e.type!==`radio`&&ki(e)===`array`,o=t=>{if(t==null||t===``||!Array.isArray(e.options))return t;let n=e.options.find(e=>String(e?.value??``).toLowerCase()===String(t).toLowerCase());return n?n.value:t};if(e.type===`select`||e.type===`radio`||e.type===`checkbox`){if(a)return(Array.isArray(t)?t:[t]).map(i).map(o).filter(e=>e!=null&&e!==``&&!n(e));let e=o(i(Array.isArray(t)?t[0]:t));return n(e)?r():e}return t}function ca(e={}){return{...e,addRow:!1,multiSelect:!1,mode:void 0,dataType:void 0}}function la(e,t){let n=Math.max(0,Number(e.minRows??0)||0),r=e.initialRows!==void 0&&e.initialRows!==``?Math.max(n,Math.max(0,Number(e.initialRows)||0)):n;if(Array.isArray(e.subFields)&&e.subFields.length>0){let i=[];Array.isArray(t)&&(i=t.map(t=>{let n={};return e.subFields.forEach(e=>{if(!e.field||Yi(e))return;let r=bi(t??{},e.field)??(t??{})[e.field];r!=null&&(n[e.field]=sa(e,r))}),n}));let a=i.length>0?n:Math.max(n,r);for(;i.length<a;)i.push({});return i}let i=ca(e),a=[];if(Array.isArray(t))a=t.map(e=>sa(i,e)).filter(e=>e!=null&&e!==``);else if(t!=null&&t!==``){let e=sa(i,t);e!=null&&e!==``&&(a=[e])}let o=a.length>0?n:Math.max(n,r);for(;a.length<o;)a.push(void 0);return a}var ua=e=>e===!0||e===1||e===`1`;function da(e=[]){let t=new Map;e.forEach(e=>{let n=e?.linkGroup;!ua(e?.addRow)||!n||(t.has(n)||t.set(n,[]),t.get(n).push(e.name))});let n=new Map;return t.forEach((e,t)=>{e.length<2||n.set(t,{leaderName:e[0],memberNames:e})}),n}function fa(e,t){for(let n of e.values())if(n.memberNames.includes(t))return n;return null}function pa(e,t={}){let n={...t};return e.forEach(({memberNames:e})=>{let t=Math.max(...e.map(e=>(n[e]??[]).length));e.forEach(e=>{let r=n[e]??[];r.length<t&&(n[e]=[...r,...Array.from({length:t-r.length},()=>({}))])})}),n}var ma={duplicate:{className:`fdd-tone-amber`,Icon:o.UserOutlined},overwrite:{className:`fdd-tone-amber`,Icon:o.ExclamationCircleFilled},suggestion:{className:`fdd-tone-blue`,Icon:o.InfoCircleFilled},file:{className:`fdd-tone-blue`,Icon:o.FileTextOutlined}};function ha({tone:e=`suggestion`,title:t,body:n,facts:r=[],okText:i=`Continue`,cancelText:o=`Cancel`,danger:c=!1,footnote:l}={}){let{className:u,Icon:d}=ma[e]??ma.suggestion,f=r.filter(e=>e&&e.value!==void 0&&e.value!==null&&String(e.value).trim()!==``);return new Promise(e=>{a.Modal.confirm({icon:null,centered:!0,width:480,className:`fdd-modal ${u}`,okText:i,cancelText:o,okButtonProps:{danger:c,size:`large`},cancelButtonProps:{size:`large`},content:(0,s.jsxs)(`div`,{className:`fdd`,children:[(0,s.jsxs)(`div`,{className:`fdd-head`,children:[(0,s.jsx)(`span`,{className:`fdd-icon`,"aria-hidden":`true`,children:(0,s.jsx)(d,{})}),(0,s.jsx)(`h3`,{className:`fdd-title`,children:t})]}),f.length>0&&(0,s.jsx)(`dl`,{className:`fdd-facts`,children:f.map(e=>(0,s.jsxs)(`div`,{className:`fdd-fact`,children:[(0,s.jsx)(`dt`,{children:e.label}),(0,s.jsx)(`dd`,{children:e.value})]},e.label))}),n&&(0,s.jsx)(`p`,{className:`fdd-body`,children:n}),l&&(0,s.jsx)(`p`,{className:`fdd-footnote`,children:l})]}),onOk:()=>e(!0),onCancel:()=>e(!1)})})}function ga({tone:e=`duplicate`,title:t,body:n,facts:r=[],okText:i=`Go back`}={}){let{className:o,Icon:c}=ma[e]??ma.suggestion,l=r.filter(e=>e&&String(e.value??``).trim()!==``);return new Promise(e=>{a.Modal.warning({icon:null,centered:!0,width:480,className:`fdd-modal ${o}`,okText:i,okButtonProps:{size:`large`},content:(0,s.jsxs)(`div`,{className:`fdd`,children:[(0,s.jsxs)(`div`,{className:`fdd-head`,children:[(0,s.jsx)(`span`,{className:`fdd-icon`,"aria-hidden":`true`,children:(0,s.jsx)(c,{})}),(0,s.jsx)(`h3`,{className:`fdd-title`,children:t})]}),l.length>0&&(0,s.jsx)(`dl`,{className:`fdd-facts`,children:l.map(e=>(0,s.jsxs)(`div`,{className:`fdd-fact`,children:[(0,s.jsx)(`dt`,{children:e.label}),(0,s.jsx)(`dd`,{children:e.value})]},e.label))}),n&&(0,s.jsx)(`p`,{className:`fdd-body`,children:n})]}),onOk:()=>e(!0)})})}async function _a({module:e,group:n,field:r,actionKey:i,inputs:a={},files:o={}}){if(!e||!n||!r||!i)throw Error(`module, group, field and actionKey are required to run an AI action`);let s=await t.a(),c=new FormData;c.append(`json`,JSON.stringify({inputs:a})),Object.entries(o).forEach(([e,t])=>{t&&c.append(e,t)});let l=new URLSearchParams({module:e,group:n,field:r,action:i}),u=await fetch(`${t.S}/ai-action?${l.toString()}`,{method:`POST`,headers:{Authorization:`Bearer ${s}`},body:c}),{logout:d}=await Promise.resolve().then(()=>require("./authApi-D0LZjLV6.cjs")).then(e=>e.n);u.status===401&&d();let f=(u.headers.get(`content-type`)||``).includes(`application/json`)?await u.json():await u.text();if(!u.ok){let e=Error(f?.error||f?.message||`API ${u.status}: ${u.statusText}`);throw e.status=u.status,e.data=f,e}return f?.data??f}var va=e=>e==null||e===``;function ya(e,t){return String(t??``).split(`.`).filter(Boolean).reduce((e,t)=>e?.[t],e)}function ba(e){let t=String(e??``).trim().replace(/[\s()-]/g,``);if(!t)return``;let n=t.replace(/^\+/,``);return/^\d{1,4}$/.test(n)?`+${n}`:``}function xa(e){let t=String(e?.field??``).trim(),n=t.replace(/(number|no|phone|mobile|contact)$/i,``);return[...t?[`${t}CountryCode`,`${t}Code`]:[],...n&&n!==t?[`${n}CountryCode`]:[],`countryCode`,`phoneCountryCode`,`mobileCountryCode`,`contactCountryCode`,`dialCode`,`isdCode`]}function Sa(e,t,n=``){let r=e?.renderOptions?.countryCodeField??e?.countryCodeField,i=r?[r,...xa(e)]:xa(e);for(let e of i){let n=ba(ya(t,e));if(n)return n}return ba(n)}function Ca(e){let t=String(e??``).trim(),n=t.match(/^(\+\d{1,4})[\s-]*(.*)$/);return n?{code:n[1],rest:n[2]}:{code:``,rest:t}}function wa(e,t=``){if(va(e))return``;let{code:n,rest:r}=Ca(e),i=n||ba(t),a=dn(r)||r;return`${i?`${i} `:``}${a}`.trim()}function Ta(e,t,n){return wa(t,Sa(e,n,ln()))}var Ea=[{value:`auto`,label:`Default (auto)`},{value:`text`,label:`Text`},{value:`tag`,label:`Tag`},{value:`tags`,label:`Multi Tag (Skills)`},{value:`badge`,label:`Badge`},{value:`chip`,label:`Chip`},{value:`document`,label:`Document`},{value:`link`,label:`Link`},{value:`email`,label:`Email`},{value:`phone`,label:`Phone`},{value:`date`,label:`Date`},{value:`currency`,label:`Currency`},{value:`budget`,label:`Budget`},{value:`html`,label:`HTML`}],Da=[{value:`preview`,label:`Preview (viewer)`},{value:`download`,label:`Download button`},{value:`link`,label:`Link (filename)`},{value:`tag`,label:`Tag`},{value:`text`,label:`Text (filename)`}],Oa=[{value:`none`,label:`None`},{value:`upper`,label:`UPPERCASE`},{value:`lower`,label:`lowercase`},{value:`title`,label:`Title Case`}],ka=[`location`,`path`,`url`,`key`],Aa=[`location`,`filepath`,`path`,`url`,`key`],ja=[`uploadedfilename`,`uploadname`,`originalname`,`displayname`,`documentname`,`filename`],Ma=[`name`],Na=e=>String(e).toLowerCase(),Pa=e=>e==null||e===``;function Fa(e,t){for(let n of t){let t=e[n];if(typeof t==`string`&&t)return t}return``}function Ia(e,t){for(let n of t)for(let[t,r]of Object.entries(e))if(typeof r==`string`&&r&&Na(t).endsWith(n))return r;return``}function La(e){if(!e)return``;let t=String(e).split(`?`)[0].split(`#`)[0];return decodeURIComponent(t.split(`/`).pop()||``)}function Ra(e){if(!e)return``;let t=String(e);if(/^https?:\/\//i.test(t))return t;let n=an().s3BaseUrl||``;return n?`${n}/${t.replace(/^\/+/,``)}`:``}function za(e){return typeof e==`string`?e.includes(`/`)?e:``:!e||typeof e!=`object`?``:Fa(e,ka)||Ia(e,Aa)}function Ba(e){return e?typeof e==`string`?La(e)||e:typeof e==`object`&&(Fa(e,an().documentNameOrder??[])||Ia(e,ja)||La(za(e))||Ia(e,Ma))||`Document`:`Document`}function Va(e){if(Pa(e))return[];let t=Array.isArray(e)?e:[e],n=[];for(let e of t)if(!Pa(e)){if(typeof e==`string`){let t=e.includes(`/`)?e:``;n.push({location:t,name:La(e)||e,url:Ra(t)})}else if(typeof e==`object`){let t=za(e),r=e.fileUrl||e.downloadUrl||e.signedUrl||``;n.push({location:t,name:Ba(e),url:r||Ra(t)})}}return n}var Ha=e=>e===!0||e===1||e===`1`,Ua=e=>e==null||e===``;function Wa(e){return String(e??``).split(`.`).map(e=>e.trim()).filter(Boolean)}function Ga(e,t,n){let r=Array.isArray(t)?t:Wa(t);if(!r.length)return e;let i=e;for(let e=0;e<r.length-1;e+=1){let t=r[e];(!i[t]||typeof i[t]!=`object`||Array.isArray(i[t]))&&(i[t]={}),i=i[t]}return i[r[r.length-1]]=n,e}function Ka(e,t=[]){if(!(!e||typeof e!=`object`))for(let n of t){if(!n)continue;let t=bi(e,n);if(!Ua(t))return t}}function qa(e,t){if(!e||typeof e!=`object`)return;let n=Object.entries(e),r=n.find(([e,n])=>t.test(e)&&!Ua(n));if(r)return r[1];for(let[,e]of n)if(e&&typeof e==`object`&&!Array.isArray(e)){let n=qa(e,t);if(!Ua(n))return n}}function Ja(e,t){let n=Array.isArray(e)?e:e?[e]:[];if(!n.length)return;let r=n.map((e,n)=>{if(typeof e==`string`){let r=e.includes(`/`)?Ra(e):``;return{uid:`${t.field}-${n}`,name:La(e)||e,status:`done`,existing:!0,url:r||void 0}}if(!e||typeof e!=`object`)return null;let r=Ka(e,[t.fileUrlKey,t.locationKey])??qa(e,/(location|url|path)$/i)??``,i=Ka(e,[t.fileNameKey])??qa(e,/(uploadName|uploadedFileName|fileName|name)$/i)??``;if(!r&&!i)return null;let a=r&&!String(r).startsWith(`http`)?Ra(r):r;return{uid:String(e.id??e._id??e.uniqueName??e.documentCopyUniqueName??`${t.field}-${n}`),name:i||`file`,status:`done`,existing:!0,url:a||void 0,stored:e}}).filter(Boolean);return r.length?r:void 0}function Ya(e,t){if(!e||typeof e!=`object`)return;let n=Ka(e,[t.fileNameKey,t.field])??qa(e,/(uploadName|uploadedFileName|fileName|name)$/i),r=Ka(e,[t.fileUrlKey,t.locationKey])??qa(e,/(location|url|path)$/i)??``;if(!n&&!r)return;let i=r&&!String(r).startsWith(`http`)?Ra(r):r,a=e.documentCopyUniqueName??e.uniqueName??n??`${t.field}-0`;return[{uid:String(a),name:n??`file`,status:`done`,existing:!0,url:i||void 0}]}function Xa(e,t,n,r){(e.fields??[]).forEach(e=>{e?.verifyAction&&[e.verifyResultField,e.verifyTimestampField,...String(e.verifyLockedWhenFields??``).split(/[,\s]+/)].map(e=>String(e??``).trim()).filter(Boolean).forEach(e=>{if(bi(n,e)!==void 0)return;let i=r(t,{field:e});i!=null&&Ga(n,e,i)})})}function Za(e,{editing:t=!1}={}){let n=t&&e.padRowsOnEdit===!1,r=!n&&Array.isArray(e.rows)?e.rows:null,i=Math.max(0,Number(e.minRows??0)||0),a=(t,n,r)=>{let i={};return(e.fields??[]).forEach(e=>{if(!e.field)return;if(e.type===`file`){let r=n(t,e);r&&Ga(i,e.field,r);return}let a=r(t,e);if(a==null){e.defaultOnEdit&&e.defaultValue!==void 0&&e.defaultValue!==``&&Ga(i,e.field,e.defaultValue);return}Ga(i,e.field,Ha(e.addRow)?la(e,a):sa(e,a))}),Xa(e,t,i,r),i},o=Ki(e,{editing:!0});if(r&&r.length>0){let e=r.map(e=>a(e,(e,t)=>Ya(e,t),(e,t)=>bi(e,t.field)));for(;e.length<i;)e.push({...o});return e}let s=a(e,(e,t)=>Ja(t.value,t),(e,t)=>t.value),c=Object.keys(s).length>0?[s]:[];if(!n)for(;c.length<i;)c.push({...o});return c}function Qa(e,t=[]){let n={};return t.forEach(e=>{e.toggleEnabled&&e.toggleField&&Ga(n,e.toggleField,!!e.toggleValue),!e.addRow&&(e.fields??[]).forEach(e=>{if(!e.field||e.addRow)return;let t=e.value,r=e.field;if(e.type===`file`){let i=Ja(t,e);i&&Ga(n,r,i);return}if(t==null)return;if(e.type===`checkbox`&&Array.isArray(e.options)&&e.options.length>0){let i=e.transformRule?.map;if(i){let e=Object.entries(i).find(([,e])=>String(e)===String(t));Ga(n,r,e?[e[0]]:[])}else Ga(n,r,pi(e,Array.isArray(t)?t:[t]));return}let i=e.splitDialCodeInto;if(i&&typeof t==`string`){let{code:a,rest:o}=Ca(t),s=ba(a);s&&Ga(n,i,s),Ga(n,r,sa(e,o||t));return}Ga(n,r,sa(e,t))})}),Object.keys(n).length>0&&e.setFieldsValue(n),n}function $a(e){let t=document.createElement(`div`);return t.innerHTML=String(e??``),t.textContent||t.innerText||``}function eo(e,t){return t&&t===`stripHtml`?$a(e):e}function to(e){return String(e??``).trim().split(/\s+/).filter(Boolean).length}function no(e){return Object.values(e||{}).some(e=>e!=null&&e!==``)}function ro(e,t){if(e.kind===`file`)return Array.isArray(t)?t.length>0:!!t;let n=eo(t,e.transform),r=String(n??``).trim();if(!r)return!1;let i=Number(e.minWords)||0;return i>0?to(r)>=i:!0}function io(e,t){let n=e.inputs||[];if(n.length===0)return!0;let r=new Map;n.forEach((e,t)=>{let n=e.group||`__solo_${t}`;r.has(n)||r.set(n,[]),r.get(n).push(e)});for(let e of r.values())if(e.some(e=>e.required||Number(e.minWords)>0)&&!e.some(e=>ro(e,t(e.sourceField))))return!1;return!0}function ao(e=[]){let t=[];return e.forEach(e=>{if(e?.addRow){e.name&&t.push(e.name);return}(e?.fields??[]).forEach(e=>{let n=e?.field??e?.name;n&&t.push(n)})}),t}function oo(e,t){return ao(t).some(t=>{let n=e.getFieldValue(t);return Array.isArray(n)?n.some(no):n!=null&&n!==``})}function so(e,t=[]){let n=e.getFieldsValue(!0)??{},r=new Set([t].flat().filter(Boolean)),i=typeof e.isFieldTouched==`function`?t=>e.isFieldTouched(t):()=>!0,a=0;return Object.entries(n).forEach(([e,t])=>{if(!(r.has(e)||!i(e)||!co(t))){if(Array.isArray(t)){a+=t.filter(e=>e&&typeof e==`object`?no(e):!!e).length;return}a+=1}}),a}function co(e){return e==null||e===``?!1:Array.isArray(e)?e.some(e=>e&&typeof e==`object`?no(e):!!e):typeof e!=`object`||Object.values(e).some(e=>e!=null&&e!==``)}function lo(e,t=[]){let n=e.getFieldsValue(!0)??{},r=new Set([t].flat().filter(Boolean)),i=Object.keys(n).filter(e=>!r.has(e));return typeof e.isFieldTouched==`function`?i.some(t=>e.isFieldTouched(t)&&co(n[t])):i.some(e=>co(n[e]))}function uo(e=[]){let t={};return(e??[]).forEach(e=>{e?.addRow||(e?.fields??[]).forEach(e=>{let n=e?.field??e?.name;if(!n)return;let r=e?.value;r!=null&&r!==``&&(t[n]=r)})}),t}function fo(e,t,n){let r=e?.confirmWhen??`never`;return r===`never`?!1:r===`always`||oo(t,n)}var po=[`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`],mo=`bottom-left`;function ho(e=[]){let t={};return e.forEach(e=>{let n=po.includes(e.position)?e.position:mo;(t[n]??=[]).push(e)}),t}function go({form:e,groups:t,module:n,onApplied:r,onParsed:o}){let[s,c]=(0,i.useState)(null),[l,u]=(0,i.useState)(``),d=a.Form.useWatch(e=>e,e),f=(0,i.useCallback)(e=>io(e,e=>(d||{})[e]),[d]),p=(0,i.useCallback)(t=>{if(!Array.isArray(t)||t.length===0)return!1;let n=Qa(e,t.filter(e=>!e.addRow)),r=Object.keys(n).length>0;return t.forEach(t=>{if(!t.addRow||!Array.isArray(t.rows)||t.rows.length===0)return;let n=Za(t);if(n.length===0)return;r=!0;let i=()=>e.setFieldsValue({[t.name]:n}),a=(e.getFieldValue(t.name)||[]).filter(no);if(a.length){let e=t.label||t.name;ha({tone:`overwrite`,title:`Replace what's in ${e}?`,facts:[{label:`Section`,value:e},{label:`Rows you filled in`,value:a.length},{label:`Rows in the file`,value:n.length}],body:`Everything currently in ${e} will be removed and replaced with what the file says. The rest of the form is not affected.`,okText:`Replace them`,cancelText:`Keep mine`,danger:!0}).then(e=>{e&&i()})}else i()}),r},[e]);return{runAction:(0,i.useCallback)(async(t,i,s,l)=>{let d=s?.confirmWhen??`never`;if(s?.trigger===`upload`&&d!==`never`&&(d===`always`||lo(e,[i?.field]))){let t=s.confirmMessages??{},n=l?.name||e.getFieldValue(i?.field)?.slice?.(-1)?.[0]?.name,r=so(e,[i?.field]);if(!await ha({tone:`overwrite`,title:t.title||`Read this file and fill the form in?`,facts:[{label:`File`,value:n},{label:`You have filled in`,value:r?`${r} ${r===1?`answer`:`answers`}`:void 0}],body:t.body||`We can read the details out of this file and fill the form in for you. Where the file has an answer, it replaces what is currently in that box. Anything the file does not mention is left as you typed it.`,okText:t.ok||`Read it and fill in`,cancelText:t.cancel||`Keep what I typed`}))return}c(s.key),u(s.loadingText||`Reading ${s.label||`the file`}…`);try{let c={},u={};(s.inputs||[]).forEach(t=>{if(t.kind===`file`){let n=e.getFieldValue(t.sourceField),r=l??n?.[n.length-1]?.originFileObj;r&&(u[t.param]=r)}else{let n=e.getFieldValue(t.sourceField);n!=null&&n!==``&&(c[t.param]=eo(n,t.transform))}}),(s.inputs||[]).forEach(e=>{!e.group||e.kind!==`text`||(s.inputs||[]).some(t=>t.group===e.group&&t.kind===`file`&&u[t.param])&&delete c[e.param]});let d=await _a({module:n,group:t,field:i.field,actionKey:s.key,inputs:c,files:u}),f=s.label||`AI action`,m=d?.groups;if(s?.trigger!==`upload`&&fo(s,e,m)){let e=s.confirmMessages??{},t=ao(m).length;if(!await ha({tone:`overwrite`,title:e.title||`Fill the form in from ${f}?`,facts:[{label:`Source`,value:f},{label:`Boxes it would fill`,value:t||void 0}],body:e.body||`We found details you can use. Applying them will replace what you have already entered in those boxes.`,okText:e.ok||`Use these details`,cancelText:e.cancel||`Keep what I typed`}))return a.message.info(`${f} cancelled — your entries were kept.`),d}if(o){let e=await o({action:s,field:i,groupName:t,responseGroups:m,payload:uo(m)});if(e===!1||e===`abort`)return d}let h=p(m);return h?a.message.success(`${f} completed successfully.`):a.message.info(`${f} completed, but no matching details were found.`),h&&r&&await r({action:s,field:i,groupName:t}),d}catch(e){a.message.error(e?.message||`${s.label||`AI action`} failed`);return}finally{c(null),u(``)}},[e,n,p,r,o]),loadingKey:s,loadingText:l,busy:s!==null,isActionEnabled:f}}function _o({position:e,actions:t,aiActions:n,groupName:r,field:i}){if(!t||t.length===0)return null;let o=e.endsWith(`center`)?`center`:e.endsWith(`right`)?`flex-end`:`flex-start`;return(0,s.jsx)(a.Space,{size:8,className:`v1-ai-action-buttons`,style:{width:`100%`,justifyContent:o},children:t.map(e=>(0,s.jsx)(a.Button,{size:`small`,loading:n.loadingKey===e.key,disabled:n.busy||!n.isActionEnabled(e),onClick:()=>n.runAction(r,i,e),children:e.label},e.key))})}function vo(e){let t=String(e??``).trim(),n=/^([^\s@]+)@([^\s@]+)\.([A-Za-z]{2,})$/.exec(t);if(!n)return!1;let[,r,i]=n;return/[A-Za-z]/.test(r)&&/[A-Za-z]/.test(i)}function yo(e=`Email`,t){return{validator:(n,r)=>r==null||r===``||vo(r)?Promise.resolve():Promise.reject(Error(t??`Enter a valid ${e}; numeric-only email addresses are not allowed`))}}var bo=[{label:`Only Numbers`,value:`onlyNumber`},{label:`Only Letters`,value:`onlyLetter`},{label:`Only Letters & Spaces`,value:`onlyLettersAndSpace`},{label:`Only Alphanumeric`,value:`onlyAlphanumeric`},{label:`Alphanumeric & Spaces`,value:`alphanumericSpace`},{label:`Letters, Numbers & Hyphen`,value:`onlyLettersNumberAndHyphen`},{label:`Letters, Numbers, Hyphen & Dot`,value:`onlyLettersNumberHyphenAndDot`},{label:`Contact Number (digits, (), -)`,value:`contactNumber`},{label:`Email (reject numeric-only address)`,value:`email`},{label:`Job Title (letters, nums, symbols)`,value:`jobTitle`},{label:`MSP / Ref ID (alphanumeric only)`,value:`mspRefId`},{label:`Location (letters, nums, , . -)`,value:`locationValidation`},{label:`Decimal / Range (number + dot)`,value:`decimalRange`},{label:`Budget (numbers, must be > 0)`,value:`budgetValidation`},{label:`Experience (numbers only)`,value:`experience`},{label:`Numeric — 2 digits max`,value:`numericTwoDigits`},{label:`Job Description (character count)`,value:`jobDescription`},{label:`Website URL`,value:`websiteUrl`}],xo={onlyNumber:/^[0-9]$/,experience:/^[0-9]$/,numericTwoDigits:/^[0-9]$/,budgetValidation:/^[0-9]$/,onlyLetter:/^[a-zA-Z\s]$/,onlyLettersAndSpace:/^[a-zA-Z\s]$/,onlyAlphanumeric:/^[a-zA-Z0-9]$/,alphanumericSpace:/^[a-zA-Z0-9\s]$/,mspRefId:/^[a-zA-Z0-9]$/,onlyLettersNumberAndHyphen:/^[a-zA-Z0-9\s-]$/,locationValidation:/^[a-zA-Z0-9\s\-.,]$/,jobTitle:/^[a-zA-Z0-9\s\-.,/&+()*'"#@]$/,decimalRange:/^[0-9.]$/,contactNumber:/^[0-9()\-+\s]$/};function So(e){return xo[e]??null}var Co=/^https?:\/\/(localhost|(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|1?\d?\d)|(?:[a-z\d](?:[a-z\d-]*[a-z\d])?\.)+[a-z]{2,63})(?::(\d{1,5}))?(?:[/?#][^\s]*)?$/i;function wo(e){let t=Co.exec(e);return t?t[2]===void 0||Number(t[2])<=65535:!1}function To(e,t={},n=`change`){if(!t?.type||e==null)return{cleaned:e??``,error:null};let r=String(e),{type:i,maxLength:a,maxChars:o}=t,s=t.title||`Field`,c,l=null,u=e=>n===`blur`?e.trim():e.replace(/^\s+/,``);switch(i){case`onlyNumber`:case`experience`:case`numericTwoDigits`:{let e=Number(a??(i===`numericTwoDigits`?2:10));c=r.replace(/[^0-9]/g,``),r!==c&&(l=`${s} allows only numbers.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyLetter`:{let e=Number(a??50);c=r.replace(/[^a-zA-Z]/g,``),r!==c&&(l=`${s} allows only letters.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyLettersAndSpace`:{let e=Number(a??55);c=u(r.replace(/[^a-zA-Z\s]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters and spaces.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyAlphanumeric`:case`mspRefId`:{let e=Number(a??50);c=u(r.replace(/[^a-zA-Z0-9]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters and numbers.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`alphanumericSpace`:{let e=Number(a??100);c=u(r.replace(/[^a-zA-Z0-9\s]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters, numbers and spaces.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyLettersNumberAndHyphen`:{let e=Number(a??55);c=u(r.replace(/[^a-zA-Z0-9\s-]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters, numbers and hyphens.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyLettersNumberHyphenAndDot`:{let e=Number(a??100);c=r.replace(/[^a-zA-Z0-9\-./#+[\]{}()\s]/g,``).slice(0,e),r!==c&&(l=`${s} allows only letters, numbers, hyphens and dots.`);break}case`contactNumber`:{let e=Number(a??15);c=r.replace(/[^0-9()\-+\s]/g,``).slice(0,e),r===c?c&&!/^(\+?[0-9]{1,3}[- ]?)?(\(?\d{1,4}\)?[- ]?)?[\d\-\s]{3,15}$/.test(c)&&(l=`${s} is not a valid phone number format.`):l=`${s} allows only digits, parentheses () and hyphens.`;break}case`locationValidation`:{let e=Number(a??100);c=u(r.replace(/[^a-zA-Z0-9\s\-.,]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters, numbers, spaces, commas, dots and hyphens.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`jobTitle`:{let e=Number(a??80);c=u(r.replace(/[^a-zA-Z0-9\s\-/&.,()+#@'"*]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters, numbers, spaces and common symbols.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`decimalRange`:{let e=r.replace(/[^0-9.]/g,``);if((e.match(/\./g)||[]).length>1){let t=e.indexOf(`.`);e=e.slice(0,t+1)+e.slice(t+1).replace(/\./g,``),l=`${s} can have only one decimal point.`}let t=e.replace(/\./g,``),n=Number(a??10);t.length>n&&(e=e.slice(0,n+ +!!e.includes(`.`)),l=`${s} cannot exceed ${n} digits.`),c=e,!l&&r!==c&&(l=`${s} allows only numbers and one dot.`);break}case`budgetValidation`:{let e=Number(a??10);c=r.replace(/[^0-9]/g,``).slice(0,e);let t=Number(c);r===c?c&&t<=0&&(l=`${s} must be greater than 0.`):l=`${s} allows only numbers.`;break}case`jobDescription`:{let e=Number(o??a??1500);r.replace(/<[^>]+>/g,` `).replace(/&nbsp;/g,` `).replace(/\s+/g,` `).trim().length>e&&(l=`${s} cannot exceed ${e} characters.`),c=r;break}case`email`:c=n===`blur`?r.trim():r,c&&!vo(c)&&(l=`${s} must be a valid email address; numeric-only email addresses are not allowed.`);break;case`websiteUrl`:c=n===`blur`?r.trim():r,c&&(c.length>2048||!wo(c)&&!/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})[/\w .-]*\/?$/i.test(c))&&(l=`${s} must be a valid URL.`);break;default:c=r}return{cleaned:c,error:l}}var Eo=`This value is already present`;function Do(e){return typeof e==`string`?e:e?.type??e?.rule??e?.name}function Oo(e){if(Do(e)!==`unique`)return null;if(typeof e==`string`)return{message:Eo,normalizer:`trim`,skipBlank:!0,validateOn:`blur`};let t=e.value&&typeof e.value==`object`?e.value:e,n=String(t.validateOn??`blur`).toLowerCase();return{message:typeof e.message==`string`&&e.message.trim()?e.message.trim():Eo,collectionField:t.collectionField??``,normalizer:String(t.normalizer??`trim`),skipBlank:t.skipBlank!==!1,validateOn:[`blur`,`change`,`submit`].includes(n)?n:`blur`}}function ko(e){let t=e?.validations??e?.validation??e?.rules??[];if(!Array.isArray(t))return null;for(let e of t){let t=Oo(e);if(t)return t}return null}function Ao(e=[]){let t=[];return(Array.isArray(e)?e:[]).forEach(e=>{(e?.fields??[]).forEach(e=>{let n=ko(e);!n||!e?.field||t.push({field:e.field,label:e.label??e.field,rule:n})})}),t}function jo(e){return e==null?!0:typeof e==`number`?Number.isNaN(e):typeof e==`boolean`?!1:Array.isArray(e)?e.length===0:String(e).trim()===``}function Mo(e,t=`trim`){if(e==null)return``;let n=String(e);switch(String(t)){case`exact`:return n;case`lower`:case`trimLower`:case`email`:return n.trim().toLowerCase();case`digitsOnly`:return n.replace(/\D+/g,``);default:return n.trim()}}function No(e,t){return!(!e||e.skipBlank!==!1&&jo(t))}function Po(e){return!e||e.validateOn===`submit`?[]:e.validateOn===`change`?[`onChange`,`onBlur`]:[`onBlur`]}var Fo={SKIPPED:`skipped`,AVAILABLE:`available`,DUPLICATE:`duplicate`,STALE:`stale`,ERROR:`error`};function Io({module:e,field:t,recordId:n,normalized:r}){return`${e}${t}${n??``}${r}`}function Lo({checkFieldUnique:e,onPendingChange:t}={}){let n=new Map,r=new Map,i=0,a=0;function o(e){a=e,typeof t==`function`&&t(a)}async function s({module:t,field:s,rule:c,value:l,recordId:u,clientId:d,region:f}={}){if(!c||!t||!s||typeof e!=`function`||!No(c,l))return{status:Fo.SKIPPED};let p=Io({module:t,field:s,recordId:u,normalized:Mo(l,c.normalizer)});if(n.has(p))return n.get(p);i+=1;let m=i;r.set(s,m),o(a+1);try{let i=await e({module:t,field:s,value:l,recordId:u,clientId:d,region:f});if(r.get(s)!==m)return{status:Fo.STALE};let a=i?.available===!1?{status:Fo.DUPLICATE,message:Ro(i)||c.message||Eo}:{status:Fo.AVAILABLE};return n.set(p,a),a}catch(e){return r.get(s)===m?{status:Fo.ERROR,error:e}:{status:Fo.STALE}}finally{o(Math.max(0,a-1))}}return{check:s,isPending:()=>a>0,pendingCount:()=>a,reset:()=>{n.clear(),r.clear()}}}function Ro(e){return(e?.errors??[]).find(e=>e?.message)?.message||e?.message||``}var zo=`__uniqueRule`;function Bo({field:e,validation:t,context:n}){let r=Oo(t);if(!r)return{validator:()=>Promise.resolve()};let i=e?.field??``;return!n?.checker||!n?.module||!i?{validator:()=>Promise.resolve()}:{[zo]:r,validateTrigger:Po(r),validator:async(e,t)=>{let a=await n.checker.check({module:n.module,field:i,rule:r,value:t,recordId:n.recordId,clientId:n.clientId,region:n.region});return a.status===Fo.DUPLICATE?Promise.reject(Error(a.message||r.message)):Promise.resolve()}}}function Vo(e=[]){let t=Array.isArray(e)?e:[];if(!t.some(e=>e&&e[zo]))return t;let n=t.filter(e=>e&&!e[zo]);return t.map(e=>{if(!e||!e[zo])return e;let t=e.validator;return{...e,validator:async(e,r)=>await Ho(n,r,e)?Promise.resolve():t(e,r)}})}async function Ho(e=[],t,n={}){for(let r of e)if(!(!r||typeof r==`string`)){if(r.required&&jo(t)||!jo(t)&&(r.pattern instanceof RegExp&&!new RegExp(r.pattern.source,r.pattern.flags).test(String(t))||r.len!=null&&String(t).length!==Number(r.len)))return!0;if(typeof r.validator==`function`)try{await r.validator(n,t)}catch{return!0}}return!1}function Uo(e){let t=String(e??``).trim();if(!t.startsWith(`{`))return null;try{return JSON.parse(t)}catch{return null}}function Wo(e){if(!e)return null;if(typeof e==`string`)return Uo(e);let t=[e.data,e.response,e,Uo(e.message)];for(let e of t)if(!(!e||typeof e!=`object`)&&(Array.isArray(e.errors)||e.code===`DUPLICATE_VALUE`))return e;return null}function Go({field:e,group:t,rowIndex:n}){let r=String(e??``),i=Number(n);return t&&Number.isInteger(i)&&i>=0?[String(t),i,...r.split(`.`)]:r}function Ko(e,{uniqueRules:t=[]}={}){let n=Wo(e);if(n){let e=(Array.isArray(n.errors)?n.errors:[]).filter(e=>e?.field).map(e=>{let t={field:e.field,name:Go(e),message:e.message||n.message||Eo};return Array.isArray(t.name)&&(t.group=String(e.group),t.rowIndex=Number(e.rowIndex)),t});if(e.length)return e}let r=String((n&&(n.message||n.error))??(typeof e==`string`?e:e?.message)??``).trim();if(!r)return[];let i=e?.status===409||n?.code===`DUPLICATE_VALUE`,a=t.filter(e=>String(e?.rule?.message??``).trim().toLowerCase()===r.toLowerCase());return a.length&&(i||a.length===1)?a.map(e=>({field:e.field,name:e.field,message:r})):[]}async function qo({module:e,field:n,value:r,recordId:i,clientId:a,region:o,signal:s}={}){if(!e||!n)throw Error(`module and field are required to check uniqueness`);let c={field:n,value:r??``};i&&(c.recordId=String(i)),a&&(c.clientId=String(a)),o&&(c.region=String(o));try{let n=await t.o(t.S,`/module/validate-unique?module=${encodeURIComponent(e)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(c),...s?{signal:s}:{}}),r=n?.available!==!1;return{available:r,duplicate:!r,message:n?.message??``,errors:Array.isArray(n?.errors)?n.errors:[],response:n}}catch(e){if(e?.status===409){let t=e.response??e.data??{};return{available:!1,duplicate:!0,message:t?.message??e.message??``,errors:Array.isArray(t?.errors)?t.errors:[],response:t}}throw e}}var Jo=Object.freeze({});function Yo(e){let t=Number(e);return Number.isFinite(t)&&t>0?t:0}function Xo(e,t){let n=Yo(t);if(!n)return Jo;let r=ko(e);return!r||r.validateOn===`submit`?Jo:{validateDebounce:n}}function Zo(e=qo){let t=new Map;return async function(n={}){let r=String(n?.field??``);if(typeof AbortController!=`function`)return e(n);t.get(r)?.abort();let i=new AbortController;t.set(r,i);try{return await e({...n,signal:i.signal})}finally{t.get(r)===i&&t.delete(r)}}}async function Qo({module:e,payload:n,excludeId:r}={}){if(!e||!n)return{duplicate:!1};try{let i=await t.o(t.S,`/module/duplicate-check?module=${encodeURIComponent(e)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({payload:n,...r?{excludeId:r}:{}})});return i?.data??i??{duplicate:!1}}catch{return{duplicate:!1}}}var $o=[`jpg`,`jpeg`,`png`,`gif`,`webp`,`bmp`,`svg`,`avif`],es=[`mp4`,`webm`,`ogg`,`ogv`,`mov`,`m4v`],ts=[`pdf`,`doc`,`docx`],ns=[{label:`Any file`,value:`any`},{label:`Documents & Images (pdf, doc, images)`,value:`documents`},{label:`Images only`,value:`images`},{label:`Videos only`,value:`videos`},{label:`Images & Videos`,value:`imagesAndVideos`}],rs={documents:{exts:[...ts,...$o],hint:`PDF, DOC or image files`,error:`Only document (PDF/DOC) or image files are allowed`},images:{exts:$o,hint:`Image files`,error:`Only image files are allowed`},videos:{exts:es,hint:`Video files`,error:`Only video files are allowed`},imagesAndVideos:{exts:[...$o,...es],hint:`Image or video files`,error:`Only image or video files are allowed`}};function is(e){return rs[String(e?.accept??``).trim()]??null}var as=new Set([`of`,`and`,`the`,`to`,`for`,`in`,`a`,`an`]),os={addresses:`address`,branches:`branch`,batches:`batch`,categories:`category`,companies:`company`,countries:`country`,entries:`entry`,people:`person`,statuses:`status`};function ss(e){let t=String(e??``).trim();if(!t)return``;if(t.length>1&&t===t.toUpperCase()&&/[A-Z]/.test(t))return t;let n=t.toLowerCase();return os[n]?os[n]:/[^aeiou]ies$/i.test(t)?t.slice(0,-3)+`y`:/(s|x|z|ch|sh)es$/i.test(t)?t.slice(0,-2):/[^s]s$/i.test(t)?t.slice(0,-1):t}function cs(e){let t=String(e??``).trim();if(!t)return``;let n=t.replace(/([A-Z]+)([A-Z][a-z])/g,`$1 $2`).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_\-.]+/g,` `).split(/\s+/).filter(Boolean);if(!n.length)return``;let r=ss(n[n.length-1]);return[...n.slice(0,-1),r].map((e,t)=>{let n=e.toLowerCase();return e.length>1&&e===e.toUpperCase()?e:t>0&&as.has(n)?n:n.charAt(0).toUpperCase()+n.slice(1)}).join(` `)}function ls(e,t){let n=String(e?.quickCreateLabel??``).trim();if(n&&n.toLowerCase()!==`add more`)return n;let r=cs(e?.quickCreateModule||t);return r?`Add New ${r}`:`Add New`}function us(e,t){let n=String(e?.quickEditLabel??``).trim();if(n&&n.toLowerCase()!==`add more`)return n;let r=cs(e?.quickEditModule||t);return r?`Edit ${r}`:`Edit`}function ds(e,t,n){let r=cs((e===`create`?t?.quickCreateModule:t?.quickEditModule)||n);return e===`create`?String(t?.quickCreateTitle??``).trim()||(r?`Add New ${r}`:ls(t,n)):String(t?.quickEditTitle??``).trim()||(r?`Edit ${r}`:us(t,n))}function fs({children:e,className:t=``,icon:n,to:r,variant:i=`default`,...o}){let c=(0,s.jsx)(a.Button,{className:`app-button app-button--${i} ${t}`.trim(),icon:n,...o,children:e});return r?(0,s.jsx)(d.Link,{className:`app-button-link`,to:r,children:c}):c}function ps(e){return!e||typeof e!=`object`?``:[e.firstName??e.first_name??e.FIRST_NAME,e.lastName??e.last_name??e.LAST_NAME].filter(Boolean).join(` `).trim()||e.name||e.userName||e.user_name||e.username||e.email||``}function ms(e){return e==null||e===``?``:typeof e==`object`?String(e.$oid??e.id??e._id??``).trim():String(e).trim()}function hs(e={}){return[e.legacyUserId,e.userId,e.user_id,e._id,e.id].map(ms).filter(Boolean)}function gs(e){let t={};return(Array.isArray(e)?e:[]).forEach(e=>{let n=ps(e);n&&hs(e).forEach(e=>{t[e]===void 0&&(t[e]=n)})}),t}var _s;function vs(){return _s||=t.o(t.S,`/module/list?module=users`).then(e=>{let t=e?.data?.data??e?.data??[];return Array.isArray(t)?t:[]}).catch(()=>[]),_s}var ys=new Map;function bs(e){let t=ms(e);if(!t)return Promise.resolve(``);if(ys.has(t))return ys.get(t);let n=vs().then(e=>ps(e.find(e=>ms(e?.legacyUserId)===t||ms(e?.userId)===t||ms(e?.user_id)===t)||e.find(e=>ms(e?._id)===t||ms(e?.id)===t))).catch(()=>``);return ys.set(t,n),n}var xs=e=>e==null?``:String(e).trim();function Ss(e){let t=e?.quickCreateNotice;return!t||typeof t!=`object`||t.enabled===!1?null:{enabled:!0,title:xs(t.title)||`New record created`,message:xs(t.message)||`A new client has been created successfully. Please contact your Organization Admin to configure the required forms, workflows, permissions, and client-specific details before proceeding with further operations.`,showCreator:t.showCreator!==!1,showRecordName:t.showRecordName!==!1,recordNameField:xs(t.recordNameField),recordLabel:xs(t.recordLabel)||`Record name`,creatorLabel:xs(t.creatorLabel)||`Created by`}}var Cs=[`clientName`,`companyName`,`name`,`title`,`fullName`,`displayName`,`label`,`employerName`,`vendorName`],ws=(e,t)=>{if(!(!e||!t))return String(t).split(`.`).reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e)},Ts=e=>typeof e==`string`||typeof e==`number`?xs(e):e&&typeof e==`object`?xs(e.label??e.name??e.title??``):``;function Es(e,{recordNameField:t=``,displayField:n=``}={}){if(!e||typeof e!=`object`)return``;for(let r of[t,n,...Cs]){if(!r)continue;let t=Ts(ws(e,r));if(t)return t}let r=Object.keys(e).find(t=>/name$/i.test(t)&&typeof e[t]==`string`&&e[t].trim());return r?xs(e[r]):``}function Ds(e){if(!e||typeof e!=`object`)return``;let t=[e.createdBy,e.created_by,e.createdById,e.createdUserId,e.recordMeta?.createdBy,e.ownerId];for(let e of t){if(e==null||e===``)continue;if(typeof e==`object`){let t=xs(e.$oid??e.userId??e._id??e.id);if(t)return t;continue}let t=xs(e);if(t)return t}return``}function Os(e=t.d){try{return ps(e())||``}catch{return``}}var ks=(e,n)=>t.o(t.S,`/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(n)}`).then(e=>{let t=e?.data?.data??e?.data??[];return Array.isArray(t)?t[0]:t});async function As({module:e,recordId:n,notice:r,displayField:i=``,deps:a={}}={}){let{fetchRecord:o=ks,fetchUserNameFn:s=bs,getUser:c=t.d}=a,l=null;if(e&&n)try{l=await o(e,n)}catch{l=null}let u=r?.showRecordName===!1?``:Es(l,{recordNameField:r?.recordNameField,displayField:i}),d=``;if(r?.showCreator!==!1){let e=Ds(l);if(e)try{d=xs(await s(e))}catch{d=``}d||=Os(c)}return{recordName:u,creatorName:d}}var js=(0,i.lazy)(()=>Promise.resolve().then(()=>require("./AddFormV1-CI0IyNmL.cjs")).then(e=>e.n)),Ms=(0,i.lazy)(()=>Promise.resolve().then(()=>require("./index.cjs")).then(e=>e.n)),Ns=e=>e==null||e===``,Ps=e=>typeof e==`string`&&e.includes(`.`)?e.split(`.`):[e];function Fs(e,t,n,r,i){let a=e.quickEditIdFrom;if(a){let e=Array.isArray(n)&&n.length>=3&&typeof n[1]==`number`?[...n.slice(0,2),...Ps(a)]:Ps(a),i=t?.getFieldValue?.(e);return Ns(i)&&(i=r?.[a]),Ns(i)?null:i}return i&&typeof i==`object`?i.value??null:Ns(i)?null:i}function Is({field:e,form:t,name:n,moduleName:r,scopeValues:c,ownValue:l,onDone:u}){let[d,f]=(0,i.useState)(null),[p,m]=(0,i.useState)(null),h=!!e?.quickCreate,g=!!e?.quickEdit,_=e?.quickCreateModule||e?.lookupCollection||``,v=e?.quickEditModule||e?.lookupCollection||``,y=(0,i.useMemo)(()=>g?Fs(e,t,n,c,l):null,[g,e,t,n,c,l]);if(!h&&!g)return{footer:null,modal:null};let b=()=>f(null),x=()=>{if(e?.quickCreateOnClick){e.quickCreateOnClick(),document.activeElement?.blur?.();return}if(e?.quickCreateRoute){window.open(e.quickCreateRoute,`_blank`,`noopener,noreferrer`);return}_&&f({mode:`create`,module:_})},S=()=>v&&y&&f({mode:`edit`,module:v,recordId:String(y)}),C=t=>{let n=Ss(e);n&&(m({...n,recordName:``,creatorName:``}),As({module:_,recordId:t,notice:n,displayField:e?.displayField||``}).then(({recordName:e,creatorName:t})=>{m(n=>n&&{...n,recordName:e,creatorName:t})}).catch(()=>{}))},w=(0,s.jsx)(`div`,{className:`v1-quick-actions`,role:`presentation`,onMouseDown:e=>e.preventDefault(),style:{display:`flex`,gap:8,padding:`6px 8px`,borderTop:`1px solid rgba(0,0,0,0.06)`},children:(0,s.jsxs)(a.Space,{size:8,children:[h&&(0,s.jsx)(a.Button,{type:`link`,size:`small`,icon:(0,s.jsx)(o.PlusOutlined,{}),onClick:x,style:{paddingLeft:0},children:ls(e,_)}),g&&(0,s.jsx)(a.Button,{type:`link`,size:`small`,icon:(0,s.jsx)(o.EditOutlined,{}),onClick:S,disabled:!y,title:y?void 0:`Choose a ${cs(v)||`record`} above first, then edit it here`,children:us(e,v)})]})}),T=d?(0,s.jsx)(a.Modal,{open:!0,title:ds(d.mode,e,d.mode===`create`?_:v),width:`min(1080px, 96vw)`,footer:null,destroyOnClose:!0,maskClosable:!1,onCancel:b,styles:{body:{maxHeight:`78vh`,overflowY:`auto`}},children:(0,s.jsx)(i.Suspense,{fallback:(0,s.jsx)(`div`,{style:{padding:48,textAlign:`center`},children:(0,s.jsx)(a.Spin,{})}),children:d.mode===`create`?(0,s.jsx)(js,{moduleName:d.module,embedded:!0,breadcrumbItems:[],onCancel:b,onSuccess:e=>{b(),C(e),u?.(`create`,e)}}):(0,s.jsx)(Ms,{moduleName:d.module,recordId:d.recordId,embedded:!0,breadcrumbItems:[],onCancel:b,onSuccess:e=>{b(),u?.(`edit`,e)}})})}):null,E=p?(0,s.jsxs)(a.Modal,{open:!0,title:(0,s.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:8},children:[(0,s.jsx)(o.ExclamationCircleFilled,{style:{color:`#faad14`}}),p.title]}),width:`min(520px, 94vw)`,maskClosable:!1,onCancel:()=>m(null),footer:(0,s.jsx)(fs,{variant:`primary`,type:`primary`,onClick:()=>m(null),children:`OK`}),children:[(0,s.jsx)(`p`,{style:{marginTop:0,marginBottom:16},children:p.message}),(p.recordName||p.creatorName)&&(0,s.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`auto 1fr`,gap:`6px 12px`,padding:`10px 12px`,borderRadius:6,background:`rgba(0,0,0,0.03)`},children:[p.recordName&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{style:{color:`rgba(0,0,0,0.55)`},children:p.recordLabel}),(0,s.jsx)(`strong`,{children:p.recordName})]}),p.creatorName&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{style:{color:`rgba(0,0,0,0.55)`},children:p.creatorLabel}),(0,s.jsx)(`strong`,{children:p.creatorName})]})]})]}):null;return{footer:w,modal:T||E?(0,s.jsxs)(s.Fragment,{children:[T,E]}):null}}var Ls=e=>e==null||e===``||Array.isArray(e)&&e.length===0;function Rs(e,t,n){let r=String(t??``).includes(`.`)?String(t).split(`.`):[t];if(typeof n==`function`){let e=n(t);return Array.isArray(e)&&e.length?[...e,...r]:r}return Array.isArray(e)&&e.length>1?[...e.slice(0,-1),...r]:r}function zs({label:e,message:t,rule:n={},value:r,form:i,name:a,prefixFor:o}){let s=n.field??n.compareField??r;return{validator:async(n,r)=>{if(!s||Ls(r))return Promise.resolve();let c=i?.getFieldValue?.(Rs(a,s,o));if(Ls(c))return Promise.resolve();let l=Number(c),u=Number(r);return Number.isNaN(l)||Number.isNaN(u)||u<=l?Promise.resolve():Promise.reject(Error(t??`${e} must not exceed ${s}`))}}}function Bs(e={},t,n){let r=e.field??e.compareField??e.value;return r?Rs(t,r,n):null}function Vs(e,t){let n=String(t).split(`.`).filter(Boolean);if(!Array.isArray(e))return n.length>1?n:t;if(n.length>1){if(e.length>=3&&typeof e[1]==`number`){let t=e.slice(0,2),r=n[0]===String(e[0])?n.slice(1):n;return[...t,...r]}return n}let r=[...e];return r[r.length-1]=n[0],r}function Hs(e,t,n){let r=e?.getFieldValue?.(Vs(t,n));return r!=null&&r!==``?r:e?.getFieldValue?.(n)}function Us(e){return String(e??``).split(`,`).map(e=>e.trim()).filter(Boolean)}function Ws(e,t){for(let n of e??[]){let e=t(n);if(e==null||e===``)continue;let r=Number(e);if(!(!Number.isFinite(r)||r<=0))return{field:n,maximum:r}}return null}function Gs({input:e,compareFields:t,readValue:n}){let r={ok:!0,field:null,maximum:null};if(e==null||e===``)return r;let i=Ws(t,n);if(!i)return r;let a=Number(e);return Number.isFinite(a)?{ok:a<=i.maximum,field:i.field,maximum:i.maximum}:r}var Ks={candidates:[`applicantId`]};function qs(e){let t=String(e??``).trim();if(!t)return[];let n=t.endsWith(`s`)?t.slice(0,-1):t;return[...new Set([`${n}Id`,`${t}Id`,...Ks[t]??[]])]}function Js(e,t){if(!t)return``;let n=e=>e&&typeof e==`object`?e.id??e.value??``:e??``;for(let r of qs(e)){let e=String(n(t[r])||``);if(e)return e}return``}function Ys(e,t){let n=new Set;return(e??[]).forEach(e=>(e.fields??[]).forEach(e=>{e?.prefillFromModule&&n.add(t(e.prefillFromModule))})),[...n]}function Xs(e){return e?.payloadMode===`skip`}function Zs(e){return Array.isArray(e)?e:Array.isArray(e?.groups)?e.groups:Array.isArray(e?.data)?e.data:Array.isArray(e?.data?.groups)?e.data.groups:[]}function Qs(e){let t={};return(e??[]).forEach(e=>{e?.addRow||(e?.fields??[]).forEach(e=>{!e?.field||e.value===void 0||e.value===null||(t[e.field]=e.value,e.payloadKey&&e.payloadKey!==e.field&&(t[e.payloadKey]=e.value))})}),t}function $s(e,t){if(!(!e||!t))for(let n of[t.prefillFrom,t.field,t.payloadKey]){if(!n)continue;let t=e[n];if(t??=bi(e,n),t!=null)return t}}function ec(e,t){return!Array.isArray(e)||!t||typeof t!=`object`?e:e.map(e=>{if(e?.addRow){let n=t[e.payloadKey]??t[e.name];return Array.isArray(n)?{...e,rows:n}:e}return{...e,fields:(e?.fields??[]).map(e=>{let n=$s(t,{field:e?.field,payloadKey:e?.payloadKey});return n===void 0?e:{...e,value:n}})}})}function tc({form:e,field:t,flagPath:n,fieldPath:r,disabled:i}){let o=ti(t),c=a.Form.useWatch(n,e);if(!o)return null;let l=o.label||`Allow beyond the limit`,u=()=>{setTimeout(()=>{e?.validateFields?.([r]).catch(()=>{})})},d=async r=>{if(!r.target.checked){e.setFieldValue(n,!1),u();return}let i=await ha(ci(t));e.setFieldValue(n,!!i),u()},f=o.help?`${l} — ${o.help}`:l;return(0,s.jsx)(a.Tooltip,{title:f,children:(0,s.jsx)(`span`,{className:`v1-override-wrap`,children:(0,s.jsx)(a.Checkbox,{className:`v1-override-checkbox`,checked:!!c,disabled:i,onChange:d,"aria-label":f})})})}var nc=e=>String(e??``);function rc(e){let t=new Set,n=[];return(Array.isArray(e)?e:[]).forEach(e=>{let r=e?.field;!r||t.has(r)||(t.add(r),n.push(r))}),n}function ic(e,t,n,r){return rc(e).map(e=>({field:e,path:n(t,e,r)}))}function ac(e,t={}){return!e||!e.field?!1:nc(t[e.field])===nc(e.value)}function oc({rules:e,watched:t={},current:n,lastApplied:r,clearOnMismatch:i=!0,initial:a=!1}={}){let o=(Array.isArray(e)?e:[]).find(e=>ac(e,t));return o?o.clearValue?a?{action:`none`}:{action:`clear`}:{action:`set`,value:o.setValue}:i&&r!==void 0&&nc(n)===nc(r)?{action:`clear`}:{action:`none`}}var sc=e=>String(e??``).trim().toLowerCase();function cc(e){let t=Array.isArray(e)?e:[e],n=[];return t.forEach(e=>{if(e!=null&&e!==``){if(typeof e==`object`){[e.value,e.id,e._id,e.label,e.name].forEach(e=>{e!=null&&e!==``&&n.push(sc(e))});return}n.push(sc(e))}}),n}function lc(e=[],t){let n=cc(t);if(!n.length||!Array.isArray(e)||e.length===0)return e;let r=new Set(n),i=e.filter(e=>e==null?!1:typeof e==`object`?r.has(sc(e.value))||r.has(sc(e.label)):r.has(sc(e)));return i.length>0?i:e}function uc(e){let t=[];return[e?.setValue,e?.setValueLabel].forEach(e=>{e!=null&&e!==``&&t.push(sc(e))}),t}function dc(e,t={}){let n=Array.isArray(e)?e:[],r=new Set,i=new Set;return n.forEach(e=>{if(!e||e.clearValue)return;let n=uc(e);if(!n.length)return;let a=ac(e,t)?i:r;n.forEach(e=>a.add(e))}),i.forEach(e=>r.delete(e)),[...r]}function fc(e=[],t,n){let r=dc(t,n);if(!r.length||!Array.isArray(e)||e.length===0)return e;let i=new Set(r);return e.filter(e=>e==null?!0:typeof e==`object`?!(i.has(sc(e.value))||i.has(sc(e.label))):!i.has(sc(e)))}var pc=64;function mc(e){if(String(e??``).trim()!==`currentUserId`)return``;try{return typeof localStorage>`u`?``:String(localStorage.getItem(`userId`)??``).trim()}catch{return``}}var hc=e=>String(e??``).trim().toLowerCase(),gc=e=>e!=null&&String(e).trim()!==``;function _c(e){let t=Array.isArray(e)?e:String(e??``).split(`,`);return new Set(t.map(hc).filter(e=>e!==``))}function vc(e,t){return!t||!Array.isArray(e)||e.length===0?!1:e.some(e=>gc(e?.extraData?.[t]))}function yc(e,t,n){let r=e?.extraData?.[t];if(!gc(n))return r===!0;let i=_c(n);return i.size===0?r===!0:i.has(hc(r))}function bc(e,t){let n=new Map;return(Array.isArray(e)?e:[]).forEach(e=>{let r=hc(e?.value);r&&n.set(r,hc(e?.extraData?.[t]))}),n}function xc(e,t,n){let r=hc(n);if(!r)return!1;let i=new Set,a=hc(e);if(!a)return!1;i.add(a);for(let e=0;e<pc;e+=1){let e=t.get(a);if(!e)return!1;if(e===r)return!0;if(i.has(e))return!1;i.add(e),a=e}return!1}function Sc(e={}){let t=[],n=e=>{let n=String(e??``).trim();n&&!t.includes(n)&&t.push(n)};return(Array.isArray(e.extraFields)?e.extraFields:[]).forEach(n),n(e.optionsRequireExtraField),n(e.optionsHierarchyParentField),t}function Cc(e,t={},n={}){if(!Array.isArray(e)||e.length===0)return e;let r=n.source?`[${n.source}]`:`[optionRowFilters]`,i=t.field??t.label??`(unnamed field)`,a=typeof n.warn==`function`?n.warn:e=>{typeof console<`u`&&console.warn(e)},o=e,s=String(t.optionsRequireExtraField??``).trim();s&&(vc(o,s)?o=o.filter(e=>yc(e,s,t.optionsRequireExtraValue)):a(`${r} "${i}": option filter SKIPPED — no option carried extraData["${s}"], so the value filter could not be applied (the lookup API returned no such extra field). Showing the unfiltered list; this is NOT "nothing matched".`));let c=String(t.optionsHierarchyParentField??``).trim();if(c){let n=String(t.optionsHierarchySelfFrom??``).trim()||`currentUserId`,s=mc(n);if(!s)a(`${r} "${i}": hierarchy filter SKIPPED — identity "${n}" could not be resolved (no signed-in user id available). Showing the list unrestricted by reporting line.`);else if(!vc(e,c))a(`${r} "${i}": hierarchy filter SKIPPED — no option carried extraData["${c}"], so the reporting chain could not be walked (the lookup API returned no such extra field). Showing the list unrestricted by reporting line; this is NOT "nobody reports to you".`);else{let t=bc(e,c);o=o.filter(e=>xc(e?.value,t,s))}}return o}var wc=`coursemodules.moduleTitle`,Tc=e=>String(e??``).trim(),Ec=e=>Tc(e).toLowerCase();function Dc(e={}){return Tc(e.lookupCollection)===`course_module`&&Tc(e.displayField)===`coursemodules.lessons.lessonTitle`&&Tc(e.lookupFilterField)===`coursemodules.moduleTitle`}function Oc(e,t=[]){let n=Array.isArray(t)?[...t]:[];return Dc(e)&&!n.includes(`coursemodules.moduleTitle`)&&n.push(wc),n}function kc(e,t,n,r={}){if(!Dc(t)||!Array.isArray(e)||e.length===0||!e.some(e=>Array.isArray(e?.value)))return e;let i=Ec(n);if(!i)return[];let a=e.filter(e=>Ec(e?.extraData?.[wc])===i);if(a.length===0){let e=r.source?`[${r.source}]`:`[courseModuleLessonLookup]`;return typeof console<`u`&&console.warn(`${e} Lesson lookup received grouped arrays but no row was tagged with selected module "${Tc(n)}". The request must include extraFields=${wc}. Returning no lessons instead of showing lessons from the wrong module.`),[]}let o=[],s=new Set;for(let e of a){let t=Array.isArray(e?.value)?e.value:[];for(let e of t){let t=Tc(e);if(!t)continue;let n=t.toLowerCase();s.has(n)||(s.add(n),o.push({label:t,value:t}))}}return o}var Ac=e=>e==null||String(e).trim()===``,jc=e=>e===!0||e===1||e===`1`||e===`true`;function Mc(e){return Ac(e?.tooltip)?jc(e?.infoEnabled)&&!Ac(e?.infoText)?String(e.infoText):``:String(e.tooltip)}var Nc=Symbol(`parentFilterUnseen`),Pc=e=>e==null||e===``,Fc=(e,t)=>String(e??``)===String(t??``);function Ic({previous:e,next:t,currentValue:n,scoped:r=!0}){return!(!r||e===Nc||Fc(e,t)||Pc(e)||Pc(n))}function Lc(e){return e==null?!0:typeof e==`object`?Lc(e.permission??e.allowed??e.value):e!==!1&&e!==0&&e!==`0`}function Rc(e,t,n){if(!t||typeof e!=`function`)return!0;let[r,i]=String(t).split(`.`);return e(i?r:n||r,i??r)}function zc(e,t){if(!e)return!0;try{let n=JSON.parse(localStorage.getItem(`menuPermission`)||`{}`),[r,i]=String(e).split(`.`);return Lc((n[r||String(t||``).replace(/s$/i,``)]??n[String(t||``)]??n[String(t||``).replace(/s$/i,``)]??{})[i])}catch{return!0}}function Bc(e){return(e??[]).filter(e=>e?.afterSubmit?.mode).sort((e,t)=>(e.order??0)-(t.order??0))[0]?.afterSubmit??null}function Vc(e,t,n){let r=String(e??``).trim();return!r||!r.startsWith(`/`)||r.startsWith(`//`)||/^[a-z][a-z0-9+.-]*:/i.test(r)?null:r.replace(/:([A-Za-z_][\w]*)/g,(e,r)=>{let i=r===`id`?t:n?.[r];return encodeURIComponent(i??``)})}function Hc(e=typeof window<`u`?window:void 0){let t=e?.history?.state?.idx;return typeof t==`number`&&t>0}function Uc({cancelPath:e,cancelPathPriority:t=!1,fallbackPath:n=`/`,win:r=typeof window<`u`?window:void 0}={}){return t&&e?{path:e}:Hc(r)?{back:!0}:e?{path:e}:{path:n}}function Wc(e,t={}){let n=Uc(t);return n.back?e(-1):e(n.path),n}var{Text:Gc,Title:Kc}=a.Typography;function qc(e,t,n=new Map,r=new Set){if(e?.mergeInto&&!r.has(e.mergeInto)){let t=n.get(e.mergeInto);if(t){let i=new Set(r);return i.add(e.mergeInto),qc(t.group,t.index,n,i)}}return String((e?.linkGroup?`linked:${e.linkGroup}`:``)||e?.wizardStepKey||e?.name||e?.id||t)}function Jc(e=[]){let t=[],n=new Map,r=new Map(e.map((e,t)=>[e?.name,{group:e,index:t}])),i=(e,i)=>{let a=qc(e,i,r),o=n.get(a);o||(o={key:a,title:e?.wizardStepTitle||e?.label||`Step ${t.length+1}`,description:e?.wizardStepDescription||``,content:e?.wizardContent||{type:`form`},groups:[]},n.set(a,o),t.push(o)),o.groups.push(e)};return e.forEach((e,t)=>{(!e?.mergeInto||!r.has(e.mergeInto))&&i(e,t)}),e.forEach((e,t)=>{e?.mergeInto&&r.has(e.mergeInto)&&i(e,t)}),t}function Yc(e=[]){let t=e.filter(e=>!e?.mergeInto);return t.length<2||!t.some(e=>!e?.showIf?.field)||t.map(e=>String(e?.wizardStepKey??``).trim()).some(e=>!e)?!1:Jc(e).length>=2}function Xc(e=[]){return Yc(e)&&e.filter(e=>!e?.mergeInto).every(e=>e?.wizardEnabled===!0)}function Zc(e,t,n){return e.findIndex(e=>e.groups.includes(t)||e.groups.some((e,r)=>qc(e,r)===qc(t,n)))}function Qc(e){if(!e)return[];let t=[];e.groups.forEach(e=>{if(e?.addRow){e.name&&t.push([e.name]);return}(e?.fields??[]).forEach(e=>{!e?.field||e.show===0||e.show===!1||t.push(String(e.field).split(`.`).filter(Boolean))})});let n=String(e?.content?.selectionField??``).trim();return n&&t.push(n.split(`.`).filter(Boolean)),t}function $c(e,t){let n=(Array.isArray(t)?t:[t]).map(String),r=n.join(`.`);return e.findIndex(e=>String(e?.content?.selectionField??``)===r||e.groups.some(e=>e?.addRow&&String(e.name)===n[0]?!0:(e?.fields??[]).some(e=>{let t=String(e?.field??``);return t===r||t===n[0]})))}var el=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null);function tl(e,t){let n={...e};return Object.keys(t).forEach(e=>{let r=t[e];n[e]=el(r)&&el(n[e])?tl(n[e],r):r}),n}function nl(e,t){return tl(el(e)?e:{},el(t)?t:{})}function rl(){try{return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}catch{return!1}}function il(e,t){if(!e||!t||!(e.scrollWidth>e.clientWidth))return;let n=Math.max(0,t.offsetLeft-(e.clientWidth-t.offsetWidth)/2);typeof e.scrollTo==`function`?e.scrollTo({left:n,behavior:rl()?`auto`:`smooth`}):e.scrollLeft=n}function al({steps:e,current:t,onSelectCompleted:n,errorStep:r=-1}){let c=e[t],l=(0,i.useRef)(null),u=(0,i.useRef)(null),d=(0,i.useRef)(t);return(0,i.useEffect)(()=>{d.current!==t&&l.current?.focus(),d.current=t},[t]),(0,i.useEffect)(()=>{let e=u.current;il(e,e?.children?.[t])},[t,e.length]),e.length?(0,s.jsxs)(`section`,{className:`v1-form-wizard`,"aria-label":`Form progress`,children:[(0,s.jsx)(`ol`,{ref:u,className:`v1-form-wizard__steps`,children:e.map((i,c)=>{let l=c<t,u=c===t,d=c===r;return(0,s.jsx)(`li`,{className:`v1-form-wizard__step${u?` is-active`:``}${l?` is-complete`:``}${d?` is-error`:``}`,children:(0,s.jsxs)(a.Button,{type:`text`,className:`v1-form-wizard__step-button`,"aria-current":u?`step`:void 0,"aria-label":`${i.title}, step ${c+1} of ${e.length}${d?`, needs attention`:``}`,disabled:!l||!n,onClick:()=>l&&n?.(c),children:[(0,s.jsx)(`span`,{className:`v1-form-wizard__marker`,"aria-hidden":`true`,children:d?(0,s.jsx)(o.ExclamationOutlined,{}):l?(0,s.jsx)(o.CheckOutlined,{}):c+1}),(0,s.jsx)(`span`,{className:`v1-form-wizard__label`,children:i.title})]})},i.key)})}),(0,s.jsxs)(`div`,{ref:l,className:`v1-form-wizard__heading`,tabIndex:-1,children:[(0,s.jsxs)(Gc,{type:`secondary`,children:[`Step `,t+1,` of `,e.length]}),(0,s.jsx)(Kc,{level:3,children:c?.title}),c?.description&&(0,s.jsx)(Gc,{type:`secondary`,children:c.description})]},c?.key??t)]}):null}function ol(e){return(0,s.jsx)(a.Button,{icon:(0,s.jsx)(o.LeftOutlined,{}),...e,children:`Back`})}function sl(e){return(0,s.jsxs)(a.Button,{type:`primary`,...e,children:[`Next `,(0,s.jsx)(o.RightOutlined,{})]})}var cl=`test-flows`,ll=[{value:`module`,label:`Module`,isVisible:!0,type:`text`},{value:`flow`,label:`Flow`,isVisible:!0,type:`text`},{value:`step_order`,label:`Step Order`,isVisible:!0,type:`number`},{value:`keyword`,label:`Action`,isVisible:!0,type:`text`},{value:`description`,label:`Description`,isVisible:!0,type:`text`},{value:`target`,label:`Key`,isVisible:!0,type:`text`},{value:`tags`,label:`Tags`,isVisible:!0,type:`text`},{value:`value`,label:`Value`,isVisible:!0,type:`text`},{value:`expected`,label:`Expected`,isVisible:!0,type:`text`}],ul=`lms-flows`,dl=[{value:`module`,label:`Module`,isVisible:!0,type:`text`},{value:`flow`,label:`Flow`,isVisible:!0,type:`text`},{value:`step_order`,label:`Step Order`,isVisible:!0,type:`number`},{value:`keyword`,label:`Action`,isVisible:!0,type:`text`},{value:`description`,label:`Description`,isVisible:!0,type:`text`},{value:`target`,label:`Key`,isVisible:!0,type:`text`},{value:`tags`,label:`Tags`,isVisible:!0,type:`text`},{value:`value`,label:`Value`,isVisible:!0,type:`text`},{value:`expected`,label:`Expected`,isVisible:!0,type:`text`}];async function fl({jobId:e,limit:n=10,offset:r=0,sortBy:i=`new`,type:a=`myVendor`}){return await xl(t.w,`/vendor/hotlist`,{method:`POST`,body:JSON.stringify({jobId:e,limit:n,offset:r,sortBy:i,type:a})})}async function pl(e){let n=await xl(t.C,`/get-bulkmail-details?jobId=${encodeURIComponent(e)}`);return n.data??n}async function ml(e,n=``){let r=String(e??``).trim();if(!r)return``;let i=await xl(t.T,`/format-mail-content`,{method:`POST`,body:JSON.stringify({contents:r,subject:String(n??``)})});if(i?.status===!1)throw Error(i?.error||`Unable to format mail content`);return String(i?.html??i?.contents??i?.data?.html??i?.data?.contents??``).trim()}async function hl({jobId:e,leadId:n,toMail:r,ccMail:i,bccMail:a,subject:o,contents:s,attachments:c=[]}){let l=!!n&&!e,u=localStorage.getItem(`tenantId`)||`93c782a4aa626175e5d11afa`,d=localStorage.getItem(`businessId`)||`83c782a4aa626175e5d11afa`,f=localStorage.getItem(`businessUnitId`)||`63b57588fd768a839dbc0f63`,p=new FormData;p.append(`json`,JSON.stringify(l?{leadId:n,toMail:r,ccMail:i,bccMail:a,contents:s,subject:o}:{schemaVersion:1,tenantId:u,businessId:d,businessUnitId:f,jobId:e,toMail:r,ccMail:i,bccMail:a,contents:s,subject:o})),(c??[]).forEach(e=>{e instanceof File&&p.append(l?`attachment`:`attachments`,e,e.name)});let{"Content-Type":m,...h}=await bl(),g=String(l?t.S:t.C);if(!g)throw Error(`${l?`VITE_AUTH_URL`:`VITE_CANDIDATES_URL`} is not configured`);let _=await fetch(`${g}/send-bulkmail`,{method:`POST`,headers:h,body:p});_.status===401&&gl();let v=await _.text(),y={};try{y=v?JSON.parse(v):{}}catch{}if(!_.ok||l&&y?.status===!1)throw Error(y?.error||(typeof y?.data==`string`?y.data:``)||`API ${_.status}: ${_.statusText}`);return y}function gl(){t.g()}function _l(e=``){let t=String(e??``).trim();return t===`myJobs`||t===`allJobs`||t===`fulfilled`?t:``}function vl(e){let t=String(ar(e)??``).trim().toLowerCase();return t===`job`||t===`jobs`}async function yl(){return t.a()}async function bl(){return{"Content-Type":`application/json`,Authorization:`Bearer ${await yl()}`}}async function xl(e,n,r={}){return t.o(e,n,r)}async function Sl(e,t){let n=await xl(e,t);return n.data??n}async function Cl(e){return Sl(t.E,e)}async function wl(e){return Sl(t.S,e)}async function Tl(e){return e===cl?ll:e===ul?dl:Cl(`/filter-dropdown-fields?module=${encodeURIComponent(ar(e))}`)}async function El(e,{configType:t,userId:n,roleId:r,view:i}={}){if(e===cl)return ll;if(e===ul)return dl;let a=new URLSearchParams({module:ar(e)});return t&&a.set(`configType`,t),i&&a.set(`view`,String(i)),n!=null&&a.set(`userId`,String(n)),r!=null&&a.set(`roleId`,String(r)),wl(`/admin/field-config?${a}`)}async function Dl({limit:e=10,offset:t=0,search:n=``,module:r=``,keyword:i=``,tags:a=``,active:o}={}){let s=new URLSearchParams({limit:String(e),offset:String(t)});return n&&s.append(`search`,n),r&&s.append(`module`,r),i&&s.append(`keyword`,i),a&&s.append(`tags`,a),o!=null&&o!==``&&s.append(`active`,String(o)),wl(`/test-flows?${s.toString()}`)}async function Ol({limit:e=10,offset:t=0,search:n=``,module:r=``,keyword:i=``,tags:a=``,active:o}={}){let s=new URLSearchParams({limit:String(e),offset:String(t)});return n&&s.append(`search`,n),r&&s.append(`module`,r),i&&s.append(`keyword`,i),a&&s.append(`tags`,a),o!=null&&o!==``&&s.append(`active`,String(o)),wl(`/lms-flows?${s.toString()}`)}async function kl(e,n=10,r=0,i={}){let{scope:a=``,sort:o=``,sortDir:s=``,search:c=``,filters:l=[],queryParams:u={},scopeConditions:d=[]}=i;if(e===cl){let e=await Dl({limit:n,offset:r}),t=Array.isArray(e?.items)?e.items:[],i=Number(e?.total)||0;return{items:t,total:i,limit:n,offset:r,tabs:[{key:`all`,title:`Test Cases`,count:i}]}}if(e===ul){let e=await Ol({limit:n,offset:r}),t=Array.isArray(e?.items)?e.items:[],i=Number(e?.total)||0;return{items:t,total:i,limit:n,offset:r,tabs:[{key:`all`,title:`LMS Cases`,count:i}]}}let f=new URLSearchParams({module:ar(e),limit:String(n),offset:String(r)}),p=vl(e)?_l(a):String(a??``).trim();p&&f.set(`scope`,p),o&&f.set(`sort`,o),s&&f.set(`sortDir`,s),String(c??``).trim()&&f.set(`search`,String(c).trim());let m=[...Fl(l.filter(e=>e?.field)),...Array.isArray(d)?d.filter(e=>e?.field):[]];m.length&&f.set(`filters`,JSON.stringify(m)),Object.entries(u??{}).forEach(([e,t])=>{t!=null&&String(t).trim()!==``&&f.set(e,String(t))});let h=await xl(t.S,`/module-data-list?${f.toString()}`),g=Al(h),_=g.some(e=>Nl(e)),v=g.some(e=>Pl(e));if(_||v)try{let{transformDiceResponseToInternalFormat:e}=await Promise.resolve().then(()=>require("./diceCandidateMapper-BjMhHno3.cjs")).then(e=>e.t),t=e(h,h),i=t?.data?.data??[];return{items:i,total:Ml(h,p)||Ml(t,p)||i.length,limit:n,offset:r,tabs:t?.data?.tabs??h?.tabs??h?.data?.tabs??[],fields:t?.data?.fields??h?.fields??h?.data?.fields??[],tabField:t?.data?.tabField??h?.tabField??h?.data?.tabField??``,actionRules:t?.data?.actionRules??h?.data?.actionRules??[],actions:t?.data?.actions??h?.data?.actions??[],columnActions:t?.data?.columnActions??h?.data?.columnActions??[]}}catch(e){console.error(`[getModuleDataList] Dice transformation failed:`,e)}return h}function Al(e){let t=e?.data??e,n=Array.isArray(t)?t:t?.rows??t?.records??t?.items??t?.list??t?.data??e?.items??e?.records??[];return Array.isArray(n)?n:[]}function jl(...e){for(let t of e){let e=Number(t);if(Number.isFinite(e))return e}}function Ml(e,t=``){let n=e?.data??e,r=Al(e),i=e?.count,a=n?.count,o=String(t??``).trim().toLowerCase();if(i&&typeof i==`object`){let e=jl(o?i[o]:void 0,i.total,i.searchCount,i.count);if(e!==void 0)return e}if(a&&typeof a==`object`){let e=jl(o?a[o]:void 0,a.total,a.searchCount,a.count);if(e!==void 0)return e}return jl(e?.total,typeof i==`object`?void 0:i,e?.totalCount,n?.total,typeof a==`object`?void 0:a,n?.totalCount,r.length)??0}function Nl(e){let t=e?.skills??e?.technicalSkills??e?.primarySkills;return!Array.isArray(t)||t.length===0?!1:t.some(e=>e&&typeof e==`object`&&(`skill`in e||`lastUsed`in e))}function Pl(e){return[e?.sourceType,e?.profileSource,e?.selectedSource,e?.customFields?.sourceType,e?.customFields?.profileSource].flat().some(e=>String(e??``).trim().toLowerCase()===`dice`)||!!e?.customFields?.diceProfileData}function Fl(e){let t=[];for(let n of e){if(!n.field)continue;let e=n.operator===`or`?`or`:`and`;if(n.operator===`isEmpty`){t.push({field:n.field,op:`isEmpty`,operator:`and`});continue}if(n.operator===`notEmpty`){t.push({field:n.field,op:`notEmpty`,operator:`and`});continue}if(n.filterInputType===`text`){let r=typeof n.value==`string`?n.value.trim():``;r&&t.push({field:n.field,op:`contains`,value:r,operator:e});continue}if(n.from||n.to){n.from&&t.push({field:n.field,op:`gte`,value:String(n.from),operator:e}),n.to&&t.push({field:n.field,op:`lte`,value:String(n.to),operator:`and`});continue}Array.isArray(n.values)&&n.values.length>0&&t.push({field:n.field,op:`in`,values:n.values.map(String),operator:e,...Array.isArray(n.groupFields)&&n.groupFields.length>1?{groupFields:n.groupFields}:{}})}return t}async function Il(e,t,n=``,r={}){let{limit:i=50,offset:a=0,dataSource:o,groupName:s,lookup:c,groupFields:l=[],groupSeparator:u=` `,scopeConditions:d=[]}=r,f=new URLSearchParams({module:ar(e),field:t,value:n,limit:String(i),offset:String(a)});o&&f.set(`dataSource`,o),Array.isArray(l)&&l.length>1&&(f.set(`groupFields`,l.join(`,`)),f.set(`groupSeparator`,u??` `)),o===`group`&&s&&f.set(`groupName`,s),o===`lookup`&&c?.collection&&(f.set(`lookupCollection`,c.collection),c.displayField&&f.set(`lookupField`,c.displayField));let p=Array.isArray(d)?d.filter(e=>e?.field):[];return p.length&&f.set(`filters`,JSON.stringify(p)),Cl(`/filter-dropdown-values?${f}`)}function Ll(e){let t=e?.data??e,n=Array.isArray(t)?t:Array.isArray(t?.groups)?t.groups:Array.isArray(e?.groups)?e.groups:[],r=t?.recordMeta??e?.recordMeta;r&&typeof r==`object`&&(n.recordMeta=r);let i=t?.detailHeader??e?.detailHeader;return i&&typeof i==`object`&&(n.detailHeader=i),n}async function Rl({module:e,id:n,view:i}={}){if(!e)throw Error(`module is required to fetch form groups`);let a=await bl(),o=new URLSearchParams({module:e});n&&o.set(`id`,String(n)),i&&o.set(`view`,String(i));let s=`${t.S}/admin/form-groups?${o.toString()}`;return Ll(await r.t(s,async()=>{let e=await fetch(s,{method:`GET`,headers:a});if(!e.ok)throw Error(`API ${e.status}: ${e.statusText}`);return e.json()}))}async function zl({searchQuery:e,candidateId:n}){let r=localStorage.getItem(`tenantId`)||`93c782a4aa626175e5d11afa`,i=localStorage.getItem(`businessId`)||`83c782a4aa626175e5d11afa`,a=localStorage.getItem(`businessUnitId`)||`63b57588fd768a839dbc0f63`,o=Number(localStorage.getItem(`userId`))||1;return xl(t.w,`/joblist`,{method:`POST`,body:JSON.stringify({tenantId:r,businessId:i,businessUnitId:a,searchQuery:e,userId:o,candidateId:Array.isArray(n)?n:[n]})})}async function Bl(e=``){let n=e?`?search=${encodeURIComponent(e)}`:``;return Sl(t.w,`/users/any${n}`)}function Vl(e){if(!e||typeof e!=`string`)return null;try{let t=e.split(`.`)[1];if(!t)return null;let n=t.replace(/-/g,`+`).replace(/_/g,`/`),r=n.padEnd(Math.ceil(n.length/4)*4,`=`);return JSON.parse(atob(r))}catch{return null}}function Hl(){return Vl(localStorage.getItem(`access_token`)||localStorage.getItem(`authToken`))??{}}function Ul(){let e=Hl();return{userId:e.userId??e.user_id??e.USER_ID,roleId:e.roleId??e.role_id??e.ROLE_ID}}function Wl(){let e=Ul();return{userId:e.userId??localStorage.getItem(`userId`)??void 0,roleId:e.roleId??localStorage.getItem(`roleId`)??void 0}}function Gl(e){let[t,n]=(0,i.useState)([]),[r,a]=(0,i.useState)(!1),[o,s]=(0,i.useState)(null);return(0,i.useEffect)(()=>{if(!e)return;let t=!1;return a(!0),s(null),Tl(e).then(e=>{t||n(Array.isArray(e)?e:[])}).catch(e=>{t||s(e.message)}).finally(()=>{t||a(!1)}),()=>{t=!0}},[e]),{fields:t,loading:r,error:o}}function Kl(e){let[t,n]=(0,i.useState)(null),[r,a]=(0,i.useState)(!1),[o,s]=(0,i.useState)(null);return(0,i.useEffect)(()=>{if(!e)return;let t=!1;return a(!0),s(null),El(e).then(e=>{t||n(Array.isArray(e)?e:null)}).catch(e=>{t||s(e.message)}).finally(()=>{t||a(!1)}),()=>{t=!0}},[e]),{config:t,loading:r,error:o}}function ql(e,{view:t=``}={}){let[n,r]=(0,i.useState)([]),[a,o]=(0,i.useState)(!1),[s,c]=(0,i.useState)(null);return(0,i.useEffect)(()=>{if(!e)return;let n=!1;o(!0),c(null);let{userId:i,roleId:a}=Wl(),s=e=>{let t=e?.isVisible??e?.is_visible??e?.visible;return t==null?!0:typeof t==`boolean`?t:typeof t==`string`?![`false`,`0`,`no`,`hide`,`hidden`].includes(t.toLowerCase()):!!t},l=typeof t==`string`?t.trim():``;return(l?El(e,{configType:`filter`,roleId:a,view:l}).catch(()=>El(e,{configType:`filter`,userId:i,roleId:a})):El(e,{configType:`filter`,userId:i,roleId:a})).then(async t=>{let n=(Array.isArray(t)?t:t?.visibleFields??[]).filter(s);if(n.length>0)return n;let r=await Tl(e);return Array.isArray(r)?r.filter(s):[]}).then(e=>{n||r(Array.isArray(e)?e:[])}).catch(e=>{n||c(e.message)}).finally(()=>{n||o(!1)}),()=>{n=!0}},[e,t]),{fields:n,loading:a,error:s}}var Jl=(0,i.createContext)({permissions:{},loading:!0});function Yl(e){return!!e?.[`*`]?.[`*`]}function Xl(e){return!e||typeof e!=`object`||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(([e])=>e!==`*`).map(([e,t])=>[e,Object.fromEntries(Object.entries(t??{}).map(([e,t])=>[e,+!!t]))]))}function Zl(e){if(!Yl(e))try{localStorage.setItem(`menuPermission`,JSON.stringify(Xl(e))),window.dispatchEvent(new Event(`menu:updated`))}catch{}}function Ql({children:e}){let[n,r]=(0,i.useState)({}),[a,o]=(0,i.useState)(!0),c=(0,i.useCallback)(()=>{let e=!1;try{e=!!t.u()}catch{e=!1}if(!e){r({}),o(!1);return}o(!0),Rt().then(e=>{let t=e??{};r(t),Zl(t)}).catch(()=>r({})).finally(()=>o(!1))},[]);return(0,i.useEffect)(()=>(c(),window.addEventListener(`auth:login`,c),window.addEventListener(`auth:logout`,c),window.addEventListener(`auth:token-refreshed`,c),window.addEventListener(`permissions:changed`,c),window.addEventListener(`storage`,c),()=>{window.removeEventListener(`auth:login`,c),window.removeEventListener(`auth:logout`,c),window.removeEventListener(`auth:token-refreshed`,c),window.removeEventListener(`permissions:changed`,c),window.removeEventListener(`storage`,c)}),[c]),(0,s.jsx)(Jl.Provider,{value:{permissions:n,loading:a,refresh:c},children:e})}Ql.propTypes={children:_.default.node};var $l={campaign:`campaingns`,campaigns:`campaingns`};function eu(e){return String(e??``).trim().toLowerCase()}function tu(e,t){let n=eu(e),r=eu(t);return!n||!r?!1:n===r||`${n}s`===r||`${r}s`===n}function nu(e){try{let t=localStorage.getItem(`menu`);if(!t)return null;let n=JSON.parse(t);if(!Array.isArray(n))return null;let r=n.find(t=>{let n=eu(t?.key);return n&&tu(e,n)});return r?eu(r.key):null}catch{return null}}function ru(e,t,n){if(!e||typeof e!=`object`||Array.isArray(e)||!t)return{found:!1,permissions:{}};let r=eu(t),i=$l[r]??r,a=nu(r),o=[...(n?.[r]??[]).map(eu),i,a,r].filter(Boolean),s=Object.keys(e),c=s.find(e=>o.some(t=>eu(e)===t))??s.find(e=>o.some(t=>tu(t,e)));return{found:!!c,permissions:c?e[c]??{}:{}}}function iu(e,t){try{let n=localStorage.getItem(`menuPermission`);return n?ru(JSON.parse(n),e,t).permissions:{}}catch{return{}}}function au(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`value`)?e.value:e}function ou(e){let t=au(e);return t==null||t===!0||t===1||t===`1`||String(t).trim().toLowerCase()===`true`}function su(e){let t=au(e);return t==null?!1:t===!0||t===1||t===`1`||String(t).trim().toLowerCase()===`true`}function cu(e,t){if(!e||typeof e!=`object`)return;if(Object.prototype.hasOwnProperty.call(e,t))return e[t];let n=eu(t),r=Object.keys(e).find(e=>eu(e)===n);return r?e[r]:void 0}function lu(e,t,n,r){if(!n||e?.[`*`]?.[`*`])return!0;let i=r?.aliases,a=ru(e,n,i),o=!t&&a.found?a.permissions:iu(n,i);return r?.strict?su(cu(o,`view`)):ou(cu(o,`view`))}function uu(e){let{permissions:t,loading:n}=(0,i.useContext)(Jl),r=e?.strict===!0,a=e?.aliases;return(0,i.useCallback)(e=>lu(t,n,e,{strict:r,aliases:a}),[t,n,r,a])}function du(e,t){let{permissions:n,loading:r}=(0,i.useContext)(Jl),a=t?.strict===!0,o=t?.aliases;return(0,i.useMemo)(()=>{let t=!!n?.[`*`]?.[`*`],i=ru(n,e,o),s=!r&&i.found?i.permissions:iu(e,o);if(t)return{canView:!0,canAdd:!0,canEdit:!0,canDelete:!0,canApprove:!0,canReject:!0,canReApprove:!0,canSendApprove:!0};let c=a?su:ou;return{canView:c(cu(s,`view`)),canAdd:c(cu(s,`add`)),canEdit:c(cu(s,`edit`)),canDelete:c(cu(s,`delete`)),canApprove:c(cu(s,`approve`)),canReject:c(cu(s,`reject`)),canReApprove:su(cu(s,`reApprove`)),canSendApprove:su(cu(s,`sendApprove`))}},[e,n,r,a,o])}function fu(e){return String(e??``).trim().toLowerCase()}function pu(e,t){let n=fu(e),r=fu(t);return!n||!r?!1:n===r||`${n}s`===r||`${r}s`===n}function mu(e,t){if(!e||typeof e!=`object`||Array.isArray(e))return null;let n=Object.keys(e).find(e=>pu(e,t));return n?e[n]:null}function hu(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`value`)?e.value:e}function gu(e,t=!1){let n=hu(e);return n==null?t:n===!0||n===1||n===`1`||String(n).trim().toLowerCase()===`true`}function _u(e,t){if(!e||typeof e!=`object`)return;if(Object.prototype.hasOwnProperty.call(e,t))return e[t];let n=fu(t),r=Object.keys(e).find(e=>fu(e)===n);return r?e[r]:void 0}function vu(e,t){try{return gu(_u(mu(JSON.parse(localStorage.getItem(`menuPermission`)||`{}`),e),t),!0)}catch{return!0}}function yu(){let{permissions:e,loading:t}=(0,i.useContext)(Jl);return{can:(0,i.useCallback)((n,r)=>{if(e?.[`*`]?.[`*`])return!0;let i=mu(e,n);return i?gu(_u(i,r),!1):(t||Object.keys(e??{}).length,vu(n,r))},[e,t]),permissions:e,loading:t}}function bu(e){return[e?.key,e?.label,e?.name].filter(Boolean).join(` `).trim().toLowerCase()}function xu(e){let t=String(e?.permissionKey??``).trim().toLowerCase();if([`add`,`edit`,`delete`].includes(t))return t;if(e?.danger)return`delete`;let n=bu(e);return/(^|[\s_-])edit([\s_-]|$)/.test(n)?`edit`:/(^|[\s_-])(add|create)([\s_-]|$)/.test(n)?`add`:null}function Su(e,t){if(e!=null)return t.length===0?e:Array.isArray(e)?e.map(e=>Su(e,t)).filter(e=>e!=null).flat():Su(e[t[0]],t.slice(1))}function Cu(e,t){if(!t||typeof t!=`string`||!e)return;if(t in e)return e[t];let n=Su(e,t.split(`.`));if(n!==void 0&&!(Array.isArray(n)&&n.length===0))return n;let r=t.split(`.`).pop();return r===t?void 0:e[r]}function wu(){try{return typeof localStorage<`u`?localStorage.getItem(`userId`)??``:``}catch{return``}}var Tu={"{currentuserid}":wu,"{currentuser}":wu,"{me}":wu};function Eu(e){let t=Tu[String(e??``).trim().toLowerCase()];return t?t():e}function Du(e){return String(e??``).trim().toLowerCase()}function Ou(e){return Du(e).replace(/[^a-z0-9]/g,``)}function ku(e,t){return e===t||Ou(e)===Ou(t)}function Au(e){return e==null||e===``||Array.isArray(e)&&e.length===0}function ju(e){return(Array.isArray(e)?e:String(e??``).split(/[,|\n]/)).map(Du).filter(e=>e!==``)}var Mu={list:`list`,detail:`detail`,quickView:`quickView`};function Nu(e){let t=Ou(e);return t===`list`?`list`:t===`detail`?`detail`:t===`quickview`?`quickView`:``}function Pu(e,t){let n=Array.isArray(e?.appliesTo)?e.appliesTo.map(Nu).filter(Boolean):[];return n.length===0||n.includes(Nu(t))}function Fu(e,t,n){let r=e?.operator,i=r===`scope`?n:Cu(t,e?.field),a=Eu(e?.value),o=Du(i),s=Du(a);if(r===`eq`||r===`scope`)return ku(o,s);if(r===`ne`)return!ku(o,s);if(r===`isEmpty`)return Au(i);if(r===`notEmpty`)return!Au(i);if(r===`fieldEq`)return ku(o,Du(Cu(t,e?.compareField)));if(r===`includes`||r===`notIncludes`){let e=(Array.isArray(i)?i:[i]).some(e=>ku(Du(e),s))&&s!==``;return r===`includes`?e:!e}if(r===`in`||r===`notIn`){let e=ju(a),t=Array.isArray(i)?i:[i],n=e.length>0&&t.some(t=>e.some(e=>ku(Du(t),e)));return r===`in`?n:!n}return r===`contains`?Array.isArray(i)?i.some(e=>Du(e).includes(s)):o.includes(s):!1}function Iu(e,t,n,r){if(!e||e.isActive===!1||!Pu(e,r))return!1;let i=e.conditions??[];return i.length?i.every(e=>Fu(e,t,n)):!1}function Lu(e){let t=e?.allowedActions;return!Array.isArray(t)||t.length===0?null:t.map(String)}function Ru(e,t,n,r,i){let a=Array.isArray(n)?n:[];if(!a.length)return!1;let o=String(e);return a.some(e=>{if(!Iu(e,t,r,i))return!1;let n=Lu(e);return n&&!n.some(e=>ku(e,o))?!0:(e?.blockedActions??[]).map(String).includes(o)})}function zu(e,t,n,r,i){let a=(Array.isArray(n)?n:[]).find(n=>(n?.disabledActions??[]).map(String).includes(String(e))&&Iu(n,t,r,i));return a?a.description||`${e} is temporarily unavailable`:null}function Bu(e,t,n,r){let i=(Array.isArray(t)?t:[]).find(t=>String(t?.primaryAction??``).trim()&&Iu(t,e,n,r));return i?String(i.primaryAction).trim():null}function Vu(e,t,n){let r=e?.doneWhen;return!r||!r.field||!Fu(r,t,n)?null:{label:e.doneLabel||e.label,tone:e.doneTone||`success`}}function Hu(e,t,n,r){let i=Array.isArray(t)?t:[];return i.length?i.some(t=>Ru(e,t,n,r)):!1}var Uu=e.t({actionRules:()=>Yu,actions:()=>Xu,columnActions:()=>Zu,default:()=>Qu,fields:()=>qu,rows:()=>Wu,synthesizeFieldsFromRows:()=>!0,tabField:()=>Ju,tabs:()=>Ku,total:()=>Gu,visibilityFlag:()=>null}),Wu={sources:[`payload`],paths:[`rows`,`records`,`items`,`list`,`data`]},Gu={sources:[`response`,`payload`],paths:[`total`,`count`,`totalCount`]},Ku={sources:[`response`,`payload`],paths:[`tabs`,`tabList`]},qu={sources:[`response`,`payload`],paths:[`fields`,`fieldConfig`]},Ju={sources:[`payload`],paths:[`tabField`]},Yu={sources:[`payload`],paths:[`actionRules`]},Xu={sources:[`payload`],paths:[`actions`]},Zu={sources:[`payload`],paths:[`columnActions`]},Qu={rows:Wu,total:Gu,tabs:Ku,fields:qu,tabField:Ju,actionRules:Yu,actions:Xu,columnActions:Zu,synthesizeFieldsFromRows:!0,visibilityFlag:null},$u=Object.assign({"../../config/responseMappings/default.json":Uu});function ed(e){if(!e)return null;for(let t of Object.keys($u))if(t.split(`/`).pop().replace(/\.json$/,``)===e){let e=$u[t];return e.default??e}return null}function td(e){let t=ed(e);return t?{...Qu,...t}:Qu}function nd(e,t){return String(t).split(`.`).reduce((e,t)=>e?.[t],e)}function rd(e,t,n){if(!n)return;let r={response:e,payload:t};for(let e of n.sources)for(let t of n.paths){let n=nd(r[e],t);if(n!==void 0)return n}}function id(...e){for(let t of e){let e=Number(t);if(Number.isFinite(e))return e}}function ad(e){return e.replace(/([A-Z])/g,` $1`).replace(/^./,e=>e.toUpperCase())}var od=/token|password|passwd|secret|apikey|api_key|auth|credential|salary|ssn|ein\b/i;function sd(e){return od.test(e)}function cd(e){let t=e[0];return t?Object.keys(t).filter(e=>!e.startsWith(`_`)&&!sd(e)&&typeof t[e]!=`object`).map(e=>({value:e,field:e,label:ad(e),isVisible:!0})):[]}function ld(e,t){return t?e.filter(e=>e[t]===1||e[t]===!0||e[t]===void 0).map(e=>({...e,isVisible:!0})):e}var ud=5e3,dd=300,fd=100,pd=100,md=300,hd=100;function gd(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function _d(e,t){return Array.isArray(e)?e.slice(0,t):[]}function vd(e,t){return _d(e,t).filter(gd)}function yd(e,t){return vd(e,t).filter(e=>typeof e.value==`string`||typeof e.field==`string`)}var bd=/^\s*(javascript|data|vbscript|file):/i,xd=[`url`,`href`,`routeUrl`,`routeURL`];function Sd(e){let t={...e};for(let e of xd)typeof t[e]==`string`&&bd.test(t[e])&&delete t[e];return t}function Cd(e,t){return vd(e,t).map(Sd)}function wd(e,t){return e.flatMap(e=>{let n=nd(e,t);return n==null?[]:(Array.isArray(n)?n:[n]).filter(e=>e!=null).map(e=>gd(e)?e:{value:e})})}function Td(e,t){if(!Array.isArray(t)||Array.isArray(e)||!gd(e))return;let n=[`actions`,`actionRules`,`columnActions`,`tabField`].filter(t=>e[t]!==void 0);n.length!==0&&console.warn(`[mapListResponse] response.data is an array, so ${n.join(`, `)} cannot be resolved from it. Send rows under "items" instead of "data", or pass the full envelope rather than the unwrapped payload.`)}function Ed(e,t){let{baseModule:n,nestedPath:r}=ir(t),i=td(n),a=e?.data??e;Td(e,a);let o=_d(Array.isArray(a)?a:rd(e,a,i.rows),ud);r&&(o=_d(wd(o,r),ud),console.log(`[mapListResponse] module "${n}" → nested path "${r}": ${o.length} row(s)`));let s=rd(e,a,i.total),c=gd(s)?id(s.total,s.searchCount,s.count):s,l=Number(c??o.length)||0,u=vd(rd(e,a,i.tabs),fd),d=r?[]:rd(e,a,i.fields),f=Array.isArray(d)?d:[];f.length===0&&(r||i.synthesizeFieldsFromRows)&&(f=cd(o)),f=yd(f,dd),i.visibilityFlag&&(f=ld(f,i.visibilityFlag));let p=rd(e,a,i.tabField);return{rows:o,total:l,tabs:u,fields:f,tabField:typeof p==`string`?p:``,actionRules:Cd(rd(e,a,i.actionRules),md),actions:Cd(rd(e,a,i.actions),pd),columnActions:Cd(rd(e,a,i.columnActions),hd)}}function Dd({items:e=[]}){let t=e.map((t,n)=>({title:n===e.length-1?(0,s.jsx)(V,{variant:`body`,weight:`medium`,color:`link`,children:t.label}):(0,s.jsxs)(d.Link,{to:t.href,children:[(0,s.jsx)(V,{variant:`body`,color:`secondary`,children:t.label}),t.dropdown&&(0,s.jsx)(o.DownOutlined,{})]})}));return(0,s.jsx)(a.Breadcrumb,{items:t})}var Od={jobs:{module:`jobs`,keys:[`jobRecruitmentStatus`,`jobStatus`],dateField:`createdAt`},candidates:{module:`candidates`,keys:[`candidateSummary`],items:[{key:`created`,label:`Created`,collection:`candidates`,countType:`documents`,dateField:`createdAt`},{key:`submitted`,label:`Submitted`,collection:`submissions`,countType:`distinct`,distinctField:`applicantId`,dateField:`submittedAt`},{key:`onboarded`,label:`Onboarded`,collection:`onboarding`,countType:`distinct`,distinctField:`candidateId`,dateField:`onboardingActivity.activityTime`,filters:{onboardingObStage:[`Completed`]}}]},submissions:{module:`submission`,keys:[`internalSubmissionStatus.internalSubmissionStatusText`,`clientSubmissionStatus.clientSubmissionStatusText`],dateField:`createdAt`}},kd={jobSummary:[{label:`Open`,field:`jobStatus`,keys:[`open`,`active`]},{label:`Partially Fulfilled`,field:`jobRecruitmentStatus`,keys:[`partially fulfilled`,`partiallyFulfilled`]},{label:`Fulfilled`,field:`jobRecruitmentStatus`,keys:[`fulfilled`]},{label:`In-active / Closed`,field:`jobStatus`,keys:[`closed`,`inactive`,`in-active`]}]};function Ad(e){return String(e??``).trim().toLowerCase()}function jd(e,t){return{label:e,count:Number.isFinite(Number(t))?Number(t):0}}function Md(e){return Array.isArray(e?.counts)?e.counts:[]}function Nd(e,t){return e?.key===t?e:(Array.isArray(e?.fields)?e.fields:[]).find(e=>e?.key===t)??{}}function Pd(e,t){let n=Array.isArray(t)?t:[t],r=Array.isArray(e?.counts)?e.counts:[],i=n.filter(Boolean).map(Ad),a=r.find(e=>[e?.key,e?.label].map(Ad).some(e=>i.includes(e)));if(a)return Number(a.count)||0;for(let t of n){let n=e?.[t];if(Number.isFinite(Number(n)))return Number(n)}return 0}function Fd(e,t){let n=(Array.isArray(t)?t:[t].filter(Boolean)).map(Ad);return Md(e).reduce((e,t)=>{let r=Ad(t?.key??t?.label);return n.includes(r)?e+(Number(t?.count)||0):e},0)}function Id(e){let t=Ad(e);return t.includes(`candidate`)?Od.candidates:t.includes(`submission`)?Od.submissions:t.includes(`job`)?Od.jobs:null}function Ld(e){return kd[e]??null}function Rd(e){return Array.isArray(e?.counts)||e?.openCount!==void 0||e?.myAssignedCount!==void 0?[jd(`Open`,Pd(e,[`openCount`,`open`])),jd(`Partially Fulfilled`,Pd(e,[`partiallyFulfilledCount`,`partially fulfilled`])),jd(`Fulfilled`,Pd(e,[`fulfilledCount`,`fulfilled`])),jd(`In-active / Closed`,Pd(e,[`closedCount`,`closed`,`inactive`,`in active`]))]:(Ld(`jobSummary`)??[]).map(t=>{let n=Nd(e,t.field);return jd(t.label,Fd(n,t.keys??[]))})}function zd(e){return Md(e).map(({label:e,key:t,count:n})=>jd(e||t,n))}function Bd(e){let t=Array.isArray(e?.fields)?e.fields:[],n=t.find(e=>e.key===`clientSubmissionStatus.clientSubmissionStatusText`)??{},r=t.find(e=>e.key===`internalSubmissionStatus.internalSubmissionStatusText`)??{},i=e=>Array.isArray(e.counts)?e.counts.map(({label:e,count:t})=>jd(e,t)):[],a=Number(n.total)||0,o=Number(r.total)||0;return{total:a+o,clientCount:a,internalCount:o,clientBreakdown:i(n),internalBreakdown:i(r)}}var{RangePicker:Vd}=a.DatePicker,Hd=[{value:`today`,label:`Today`},{value:`yesterday`,label:`Yesterday`},{value:`last-7-days`,label:`Last 7 Days`},{value:`last-30-days`,label:`Last 30 Days`},{value:`this-month`,label:`This Month`},{value:`last-month`,label:`Last Month`},{value:`custom-range`,label:`Custom Range`}];function Ud(e){return e.closest(`.view-summary-card`)??document.body}function Wd(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function Gd(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function Kd(e){let t=new Date,n=new Date(t.getFullYear(),t.getMonth(),1),r=new Date(t.getFullYear(),t.getMonth()-1,1),i=new Date(t.getFullYear(),t.getMonth(),0);if(e===`today`)return{startDate:t,endDate:t};if(e===`yesterday`){let e=Gd(t,-1);return{startDate:e,endDate:e}}return e===`last-30-days`?{startDate:Gd(t,-29),endDate:t}:e===`this-month`?{startDate:n,endDate:t}:e===`last-month`?{startDate:r,endDate:i}:{startDate:Gd(t,-6),endDate:t}}function qd(e,t){if(e===`custom-range`){let[e,n]=t??[];return!e||!n?null:{startDate:e.format(`YYYY-MM-DD`),endDate:n.format(`YYYY-MM-DD`)}}let n=Kd(e);return{startDate:Wd(n.startDate),endDate:Wd(n.endDate)}}function Jd(e){return String(e??``).trim().toLowerCase()}function Yd(e){return String(e??``).replace(/[-_]+/g,` `).replace(/\s+/g,` `).trim().replace(/\b\w/g,e=>e.toUpperCase())}function Xd(e){let t=Jd(e);return t.includes(`candidate`)?`Candidate`:t.includes(`submission`)?`Submission`:t.includes(`job`)?`Job`:Yd(e||`List`)}function Zd(e){return e?.data??e}function Qd(e,t){let n={module:e.module,dateRange:{startDate:t.startDate,endDate:t.endDate}};return e.summary&&(n.summary=e.summary),Array.isArray(e.items)&&e.items.length>0&&(n.items=e.items),Array.isArray(e.keys)&&e.keys.length>0&&(n.keys=e.keys),e.dateField&&(n.dateRange.key=e.dateField),n}function $d({moduleName:e,open:t,onClose:n}){let r=Xd(e),c=Jd(e),l=c.includes(`submission`),u=c.includes(`job`),d=c.includes(`candidate`),f=Id(e),p=l?`last-30-days`:`last-7-days`,[m,h]=(0,i.useState)(p),[g,_]=(0,i.useState)(null),[v,y]=(0,i.useState)(null),[x,S]=(0,i.useState)(null),[C,w]=(0,i.useState)(null),[T,E]=(0,i.useState)(``),D=Rd(v),O=zd(x),k=Bd(C),A=Math.max(k.total,1),ee=Math.round(k.internalCount/A*100),te=Math.max(0,100-ee),ne=m===`custom-range`;return(0,i.useEffect)(()=>{t&&(h(p),_(null))},[p,t]),(0,i.useEffect)(()=>{if(!t||!f)return;let e=qd(m,g);if(!e)return;let n=!1;return E(``),b(Qd(f,e)).then(e=>{if(n)return;let t=Zd(e);if(u){y(t),S(null),w(null);return}if(d){S(t),y(null),w(null);return}w(t),y(null),S(null)}).catch(e=>{n||(y(null),S(null),w(null),E(e.message||`Could not load summary`))}),()=>{n=!0}},[g,d,u,l,t,m,f]),t?(0,s.jsxs)(`div`,{className:`view-summary-layer`,role:`presentation`,children:[(0,s.jsx)(`div`,{className:`view-summary-scrim`}),(0,s.jsxs)(a.Card,{"aria-label":`${r} summary`,bordered:!1,className:`view-summary-card view-summary-card--${l?`submission`:`simple`}`,children:[(0,s.jsx)(a.Button,{"aria-label":`Close summary`,className:`view-summary-close`,icon:(0,s.jsx)(o.CloseOutlined,{}),type:`text`,onClick:n}),(0,s.jsxs)(`header`,{className:`view-summary-header`,children:[(0,s.jsxs)(V,{className:`view-summary-title`,color:`primary`,size:`md`,tag:`h2`,variant:`h2`,weight:`medium`,children:[r,` Summary`]}),(0,s.jsx)(a.Select,{"aria-label":`Summary date range`,className:`view-summary-range`,popupClassName:`view-summary-range-dropdown`,getPopupContainer:Ud,popupMatchSelectWidth:!1,value:m,options:Hd,onChange:e=>{h(e),e!==`custom-range`&&_(null)}})]}),l?(0,s.jsxs)(s.Fragment,{children:[ne&&(0,s.jsx)(Vd,{allowClear:!0,className:`view-summary-custom-range view-summary-custom-range--full`,format:`MMM DD, YYYY`,getPopupContainer:Ud,placeholder:[`Start date`,`End date`],value:g,onChange:_}),(0,s.jsxs)(`section`,{className:`view-summary-submission-top`,"aria-label":`Submission totals`,children:[(0,s.jsxs)(`div`,{className:`view-summary-donut`,style:{"--summary-internal":`${ee}%`,"--summary-client":`${te}%`},children:[(0,s.jsx)(V,{color:`success`,size:`2xl`,tag:`span`,variant:`metric`,weight:`semibold`,children:k.total}),(0,s.jsx)(V,{color:`success`,size:`xs`,tag:`span`,variant:`caption`,weight:`semibold`,children:`Total`})]}),(0,s.jsxs)(`div`,{className:`view-summary-legend`,children:[(0,s.jsxs)(V,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,weight:`regular`,children:[(0,s.jsx)(`i`,{className:`view-summary-dot view-summary-dot--internal`}),`Internal`,(0,s.jsx)(V,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,weight:`regular`,children:k.internalCount})]}),(0,s.jsxs)(V,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,weight:`regular`,children:[(0,s.jsx)(`i`,{className:`view-summary-dot view-summary-dot--client`}),`Client`,(0,s.jsx)(V,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,weight:`regular`,children:k.clientCount})]})]})]}),(0,s.jsx)(`div`,{className:`view-summary-divider`}),(0,s.jsxs)(`section`,{className:`view-summary-breakdown`,children:[(0,s.jsx)(V,{className:`view-summary-subtitle`,color:`primary`,size:`md`,tag:`h3`,variant:`h4`,weight:`medium`,children:`Internal Breakdown`}),k.internalBreakdown.length>0?k.internalBreakdown.map(e=>(0,s.jsxs)(`div`,{className:`view-summary-row view-summary-row--bullet`,children:[(0,s.jsxs)(V,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,weight:`regular`,children:[(0,s.jsx)(`i`,{className:`view-summary-dot view-summary-dot--internal`}),e.label]}),(0,s.jsx)(V,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,weight:`regular`,children:e.count})]},`internal-${e.label}`)):(0,s.jsx)(V,{color:`muted`,size:`sm`,tag:`p`,variant:`body`,weight:`regular`,children:`No internal data found`}),(0,s.jsx)(V,{className:`view-summary-subtitle`,color:`primary`,size:`md`,tag:`h3`,variant:`h4`,weight:`medium`,children:`Client Breakdown`}),k.clientBreakdown.length>0?k.clientBreakdown.map(e=>(0,s.jsxs)(`div`,{className:`view-summary-row view-summary-row--bullet`,children:[(0,s.jsxs)(V,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,weight:`regular`,children:[(0,s.jsx)(`i`,{className:`view-summary-dot view-summary-dot--client`}),e.label]}),(0,s.jsx)(V,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,weight:`regular`,children:e.count})]},`client-${e.label}`)):(0,s.jsx)(V,{color:`muted`,size:`sm`,tag:`p`,variant:`body`,weight:`regular`,children:`No client data found`}),T&&(0,s.jsx)(V,{color:`danger`,size:`xs`,tag:`p`,variant:`caption`,children:T})]})]}):(0,s.jsxs)(`section`,{className:`view-summary-breakdown`,children:[(0,s.jsxs)(`div`,{className:`view-summary-section-head`,children:[(0,s.jsxs)(V,{className:`view-summary-section-title`,color:`primary`,size:`md`,tag:`h3`,variant:`h3`,weight:`medium`,children:[`All `,r]}),ne&&(0,s.jsx)(Vd,{allowClear:!0,className:`view-summary-custom-range`,format:`MMM DD, YYYY`,getPopupContainer:Ud,placeholder:[`Start date`,`End date`],value:g,onChange:_})]}),(0,s.jsx)(`div`,{className:`view-summary-divider`}),c.includes(`job`)&&(0,s.jsx)(V,{className:`view-summary-breakdown-title`,color:`primary`,size:`sm`,tag:`h4`,variant:`h4`,weight:`regular`,children:`Breakdown`}),(d?O:D).map(e=>(0,s.jsxs)(`div`,{className:`view-summary-row`,children:[(0,s.jsx)(V,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,children:e.label}),(0,s.jsx)(V,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,children:e.count})]},e.label)),T&&(0,s.jsx)(V,{color:`danger`,size:`xs`,tag:`p`,variant:`caption`,children:T})]})]})]}):null}function ef(e){let[t,n]=(0,i.useState)({}),[r,a]=(0,i.useState)(new Set),o=(0,i.useRef)({}),s=(e,t)=>{a(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})};return{valuesByField:t,loadingFields:r,fetchValues:(0,i.useCallback)((t,r=``,i={})=>{if(!t||!e)return;o.current[t]&&clearTimeout(o.current[t]);let a=r?300:0;o.current[t]=setTimeout(async()=>{s(t,!0);try{let a=await Il(e,t,r,i),o=Array.isArray(a)?a.map(e=>({label:String(e.label),value:e.value})):[];n(e=>({...e,[t]:o}))}catch{}finally{s(t,!1)}},a)},[e])}}var tf=[{label:`Last 7 days`,getDates:()=>[(0,c.default)().subtract(6,`day`),(0,c.default)()]},{label:`This month`,getDates:()=>[(0,c.default)().startOf(`month`),(0,c.default)()]},{label:`Overdue`,getDates:()=>[null,(0,c.default)().subtract(1,`day`)]}];function nf({value:e,onChange:t,disabled:n}){return(0,s.jsxs)(a.Flex,{vertical:!0,gap:4,children:[(0,s.jsx)(a.DatePicker.RangePicker,{value:e,onChange:t,disabled:n,style:{width:`100%`},allowEmpty:[!0,!0],disabledDate:e=>e&&e.isAfter((0,c.default)(),`day`)}),!n&&(0,s.jsx)(a.Space,{size:4,wrap:!0,children:tf.map(({label:e,getDates:n})=>(0,s.jsx)(a.Tag,{className:`filter-date-shortcut`,onClick:()=>t?.(n()),children:e},e))})]})}var rf=[{label:`AND`,value:`and`},{label:`OR`,value:`or`},{label:`Is Empty`,value:`isEmpty`},{label:`Not Empty`,value:`notEmpty`}],af=[{label:`Yes`,value:`true`},{label:`No`,value:`false`}];function of({value:e,onChange:t,disabled:n}){let[r,i]=Array.isArray(e)?e:[void 0,void 0];return(0,s.jsxs)(a.Flex,{gap:8,children:[(0,s.jsx)(a.InputNumber,{disabled:n,placeholder:`Min`,value:r,onChange:e=>t?.([e,i]),style:{flex:1}}),(0,s.jsx)(a.InputNumber,{disabled:n,placeholder:`Max`,value:i,onChange:e=>t?.([r,e]),style:{flex:1}})]})}var sf={operator:`and`,field:void 0,values:[]};function cf({filterInputType:e,fieldType:t,disabled:n,loading:r,valueOptions:i,onSearch:o,onOpen:c}){let l=e||(t===`boolean`?`boolean`:null)||(t===`date`?`datepicker`:null)||(t===`number`?`number-range`:null)||`dropdown`;return l===`boolean`?(0,s.jsx)(a.Select,{allowClear:!0,disabled:n,mode:`multiple`,options:af,placeholder:`Select value`}):l===`text`?(0,s.jsx)(a.Input,{disabled:n,placeholder:`Type keyword...`,allowClear:!0}):l===`datepicker`?(0,s.jsx)(nf,{disabled:n}):l===`number-range`?(0,s.jsx)(of,{disabled:n}):l===`checkbox`?(0,s.jsx)(a.Spin,{spinning:r,children:(0,s.jsx)(a.Checkbox.Group,{disabled:n,options:i,style:{display:`flex`,flexWrap:`wrap`,gap:`4px 16px`}})}):l===`radio`?(0,s.jsx)(a.Spin,{spinning:r,children:(0,s.jsx)(a.Radio.Group,{disabled:n,options:i,style:{display:`flex`,flexWrap:`wrap`,gap:`4px 16px`}})}):(0,s.jsx)(a.Select,{allowClear:!0,disabled:n,loading:r,mode:`multiple`,options:i,placeholder:n?`Select field first`:`Select values`,showSearch:!0,filterOption:!1,onSearch:o,onDropdownVisibleChange:c})}function lf(e){return e.label??e.fieldLabel??e.name??e.fieldName??e.value}function uf(e){return e.value??e.field??e.fieldName??e.name??e.label}function df(e,t){let n=t.find(t=>t.value===e.field),r=e.filterInputType??n?.filterInputType,i=r===`datepicker`||!r&&n?.type===`date`,a=r===`text`,o=e.values??[];return a?o=e.value??``:i&&(o=[e.from?(0,c.default)(e.from):null,e.to?(0,c.default)(e.to):null]),{field:e.field,operator:e.operator??`and`,values:o,locked:n?.isDefaultFilter??!1}}function ff({moduleName:e,open:t=!1,filters:n=[],onClose:r,onApply:c,onReset:l}){let[u]=a.Form.useForm(),d=a.Form.useWatch(`filters`,u)??[],{fields:f,loading:p,error:m}=ql(t?e:null),h=(0,i.useMemo)(()=>(f??[]).map(e=>({label:lf(e),value:uf(e),type:e.type,filterInputType:e.filterInputType,dataSource:e.dataSource,groupName:e.groupName,filterGroupFields:Array.isArray(e.filterGroupFields)?e.filterGroupFields:[],filterGroupSeparator:e.filterGroupSeparator??` `,lookup:e.lookup??null,isDefaultFilter:e.isDefaultFilter===1||e.isDefaultFilter===`1`||e.isDefaultFilter===!0})).filter(e=>e.label&&e.value),[f]),g=(0,i.useMemo)(()=>h.filter(e=>e.isDefaultFilter),[h]),_=(0,i.useMemo)(()=>g.map(e=>String(e.value)).sort().join(`|`),[g]),v=h,{valuesByField:y,loadingFields:b,fetchValues:x}=ef(e);function S(e){let t=h.find(t=>t.value===e),n=t?.filterInputType;if(!(!e||n===`datepicker`||n===`number-range`||n===`text`||!n&&[`boolean`,`date`,`number`].includes(t?.type))){let n=!!t?.lookup?.collection;x(e,``,{dataSource:n?`lookup`:t?.dataSource,groupName:t?.groupName,lookup:t?.lookup,groupFields:t?.filterGroupFields,groupSeparator:t?.filterGroupSeparator})}}function C(){return g.length>0?g.map(e=>({operator:`and`,field:e.value,values:[],locked:e.isDefaultFilter})):[sf]}function w(e=[]){let t=e.filter(e=>e?.field),n=new Set(t.map(e=>String(e.field))),r=[...g.filter(e=>!n.has(String(e.value))).map(e=>({operator:`and`,field:e.value,values:[],locked:!0})),...t].map(e=>({...e,locked:g.some(t=>String(t.value)===String(e.field))}));return r.length>0?r:[sf]}let T=(0,i.useRef)(!1),E=(0,i.useRef)(n);(0,i.useEffect)(()=>{if(n===E.current)return;if(E.current=n,T.current){T.current=!1;return}let e=w((n??[]).filter(e=>e.field).map(e=>df(e,h)));u.setFieldsValue({filters:e}),e.forEach(e=>S(e.field))},[n,h]);let D=(0,i.useRef)(!1),O=(0,i.useRef)(``),k=(0,i.useRef)(e),A=(0,i.useRef)(!1);(0,i.useEffect)(()=>{e!==k.current&&(k.current=e,D.current=!1,O.current=``,A.current=!1)},[e]),(0,i.useEffect)(()=>{if(!t)return;let e=O.current!==_;if(D.current&&!e)return;let n=A.current&&!p,r=!p&&h.length>0;if(A.current=p,!n&&!r)return;let i=D.current;D.current=!0,O.current=_;let a=u.getFieldValue(`filters`)??[],o=w(i||a.length>0?a:C());u.setFieldsValue({filters:o}),o.forEach(e=>S(e.field))},[t,p,h,_]);function ee(){T.current=!0;let t=C();u.setFieldsValue({filters:t}),t.forEach(e=>S(e.field)),c?.({moduleName:e,filters:[]}),l?.(),r?.()}function te(){T.current=!0;let t=(u.getFieldsValue().filters??[]).filter(e=>!ne(e)).map(e=>{let t={...e};delete t.locked;let n=h.find(e=>e.value===t.field),r=n?.label??t.field,i=n?.filterInputType,a=i===`datepicker`||n?.type===`date`,o=i===`number-range`||!i&&n?.type===`number`,s=i===`text`;if(a){let[e,n]=Array.isArray(t.values)?t.values:[],a=e=>e?typeof e.format==`function`?e.format(`YYYY-MM-DD`):typeof e.toISOString==`function`||e instanceof Date?e.toISOString().substring(0,10):null:null,o=a(e),s=a(n);return{...t,values:[o,s].filter(Boolean),from:o??void 0,to:s??void 0,fieldLabel:r,filterInputType:i}}if(o){let[e,n]=Array.isArray(t.values)?t.values:[];return{...t,values:[e,n].filter(e=>e!=null),from:e==null?void 0:String(e),to:n==null?void 0:String(n),fieldLabel:r,filterInputType:i}}if(s){let e=typeof t.values==`string`?t.values.trim():``;return{...t,value:e,values:[],fieldLabel:r,filterInputType:i}}return{...t,values:t.values??[],fieldLabel:r,filterInputType:i,groupFields:n?.filterGroupFields??[]}});c?.({moduleName:e,filters:t}),r?.()}function ne(e){if(!e?.field)return!0;if(e.operator===`isEmpty`||e.operator===`notEmpty`)return!1;let{values:t}=e;return typeof t==`string`?t.trim()===``:!Array.isArray(t)||t.length===0||t.every(e=>e==null||e===``)}let re=d.length===0||d.every(ne);function ie(e,t){let n=u.getFieldValue(`filters`)??[];u.setFieldValue(`filters`,n.map((t,n)=>n===e?{...t,values:[]}:t));let r=h.find(e=>e.value===t),i=r?.filterInputType;if(!(!t||i===`datepicker`||i===`number-range`||i===`text`||!i&&[`boolean`,`date`,`number`].includes(r?.type))){let e=!!r?.lookup?.collection;x(t,``,{dataSource:e?`lookup`:r?.dataSource,groupName:r?.groupName,lookup:r?.lookup,groupFields:r?.filterGroupFields,groupSeparator:r?.filterGroupSeparator})}}return(0,s.jsxs)(a.Drawer,{title:(0,s.jsx)(V,{variant:`card-title`,color:`primary`,children:`Filters`}),placement:`right`,width:720,open:t,onClose:r,rootClassName:`dynamic-field-filter`,maskClosable:!1,footer:(0,s.jsxs)(a.Space,{className:`dynamic-field-filter__footer`,children:[(0,s.jsx)(fs,{onClick:ee,children:`Reset`}),(0,s.jsx)(fs,{variant:`primary`,onClick:te,disabled:re,children:`Apply`})]}),children:[m&&(0,s.jsx)(a.Alert,{type:`error`,message:`Could not load filter fields`,description:m,style:{marginBottom:16},showIcon:!0}),(0,s.jsx)(a.Spin,{spinning:p,tip:`Loading fields…`,children:(0,s.jsx)(a.Form,{form:u,layout:`vertical`,className:`dynamic-field-filter__form`,initialValues:{filters:[sf]},children:(0,s.jsx)(a.Form.List,{name:`filters`,children:(e,{add:t,remove:n})=>(0,s.jsxs)(a.Space,{direction:`vertical`,className:`dynamic-field-filter__rows`,children:[e.map((t,r)=>{let i=d[r]?.field,c=d[r]?.operator,l=h.find(e=>e.value===i),u=l?.isDefaultFilter===!0,f=!i||c===`isEmpty`||c===`notEmpty`,m=l?.type??`text`,g=l?.filterInputType,_=y[i]??[],S=b.has(i),C=new Set(d.filter((e,t)=>t!==r).map(e=>e?.field).filter(Boolean).map(String)),w=u?h.filter(e=>e.value===i):v.filter(e=>!C.has(String(e.value)));return(0,s.jsxs)(a.Space,{direction:`vertical`,className:`dynamic-field-filter__row`,children:[e.length>1&&!u&&(0,s.jsx)(fs,{variant:`danger`,htmlType:`button`,icon:(0,s.jsx)(o.DeleteOutlined,{}),"aria-label":`Remove filter row`,className:`dynamic-field-filter__remove`,onClick:()=>n(t.name)}),r>0&&(0,s.jsx)(a.Flex,{justify:`center`,children:(0,s.jsx)(a.Form.Item,{name:[t.name,`operator`],rules:[{required:!0,message:`Select condition`}],className:`dynamic-field-filter__operator`,children:(0,s.jsx)(a.Select,{options:rf,placeholder:`Condition`})})}),(0,s.jsxs)(a.Flex,{align:`end`,gap:`middle`,wrap:!0,children:[(0,s.jsx)(a.Form.Item,{label:(0,s.jsx)(V,{variant:`label`,color:`secondary`,children:`Field`}),style:{flex:1,minWidth:220},children:u?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(V,{variant:`body`,className:`dynamic-field-filter__locked-field`,children:l?.label??i}),(0,s.jsx)(a.Form.Item,{name:[t.name,`field`],noStyle:!0,children:(0,s.jsx)(a.Input,{type:`hidden`})})]}):(0,s.jsx)(a.Form.Item,{name:[t.name,`field`],rules:[{required:!0,message:`Select field`}],noStyle:!0,children:(0,s.jsx)(a.Select,{allowClear:!0,showSearch:!0,placeholder:`Select field`,options:w,optionFilterProp:`label`,loading:p,onChange:e=>ie(t.name,e)})})}),(0,s.jsx)(a.Form.Item,{label:(0,s.jsx)(V,{variant:`label`,color:`secondary`,children:`Values`}),name:[t.name,`values`],style:{flex:1,minWidth:220},children:cf({filterInputType:g,fieldType:m,disabled:f,loading:S,valueOptions:_,onSearch:e=>{if(i){let t=!!l?.lookup?.collection;x(i,e,{dataSource:t?`lookup`:l?.dataSource,groupName:l?.groupName,lookup:l?.lookup,groupFields:l?.filterGroupFields,groupSeparator:l?.filterGroupSeparator})}},onOpen:e=>{if(e&&i){let e=!!l?.lookup?.collection;x(i,``,{dataSource:e?`lookup`:l?.dataSource,groupName:l?.groupName,lookup:l?.lookup,groupFields:l?.filterGroupFields,groupSeparator:l?.filterGroupSeparator})}}})})]})]},t.key)}),(0,s.jsx)(fs,{htmlType:`button`,variant:`soft`,icon:(0,s.jsx)(o.PlusOutlined,{}),disabled:v.length>0&&d.filter(e=>e?.field).length>=v.length,onClick:()=>t(sf),children:`Add Row`})]})})})})]})}var pf=`data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.00035%204.69941C4.74567%204.69941%203.72701%205.71807%203.72701%206.97275C3.72701%208.22745%204.74567%209.24609%206.00035%209.24609C7.25503%209.24609%208.2737%208.22745%208.2737%206.97275C8.2737%205.71807%207.25503%204.69941%206.00035%204.69941ZM6.00035%205.87128C6.60827%205.87128%207.10182%206.36485%207.10182%206.97275C7.10182%207.58067%206.60827%208.07422%206.00035%208.07422C5.39243%208.07422%204.89888%207.58067%204.89888%206.97275C4.89888%206.36485%205.39243%205.87128%206.00035%205.87128ZM2.06843%206.41445C2.85434%204.9331%204.16742%203.92578%206.00035%203.92578C7.83328%203.92578%209.14637%204.9331%209.93227%206.41445C10.0838%206.70013%2010.4388%206.80902%2010.7245%206.65745C11.0102%206.50587%2011.1191%206.15091%2010.9675%205.86523C9.97758%203.9994%208.30902%202.75391%206.00035%202.75391C3.69169%202.75391%202.02312%203.9994%201.03322%205.86523C0.881648%206.15091%200.990538%206.50587%201.27619%206.65745C1.56187%206.80902%201.91686%206.70013%202.06843%206.41445Z'%20fill='%23586888'/%3e%3c/svg%3e`,mf=`data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.6279%206.78121C12.6857%206.88148%2012.7014%207.00057%2012.6715%207.11239C12.6417%207.22422%2012.5688%207.31967%2012.4688%207.37785L7.21875%2010.4403C7.15185%2010.4794%207.0758%2010.4999%206.99836%2010.4999C6.92092%2010.4999%206.84487%2010.4794%206.77797%2010.4403L1.52797%207.37785C1.42936%207.31859%201.35806%207.22289%201.32951%207.11145C1.30095%207.00001%201.31744%206.88181%201.37539%206.78244C1.43335%206.68306%201.52811%206.61052%201.63916%206.5805C1.75022%206.55048%201.86863%206.56542%201.96875%206.62207L7%209.55605L12.0312%206.62207C12.1315%206.56428%2012.2506%206.54858%2012.3624%206.57841C12.4743%206.60824%2012.5697%206.68116%2012.6279%206.78121ZM1.3125%204.37496C1.31267%204.29833%201.33297%204.22309%201.37136%204.15677C1.40975%204.09045%201.46489%204.03538%201.53125%203.99707L6.78125%200.934566C6.84815%200.895555%206.9242%200.875%207.00164%200.875C7.07908%200.875%207.15513%200.895555%207.22203%200.934566L12.472%203.99707C12.5381%204.0356%2012.5929%204.09076%2012.6309%204.15707C12.669%204.22337%2012.6891%204.2985%2012.6891%204.37496C12.6891%204.45142%2012.669%204.52654%2012.6309%204.59285C12.5929%204.65915%2012.5381%204.71432%2012.472%204.75285L7.22203%207.81535C7.15513%207.85436%207.07908%207.87491%207.00164%207.87491C6.9242%207.87491%206.84815%207.85436%206.78125%207.81535L1.53125%204.75285C1.46489%204.71453%201.40975%204.65946%201.37136%204.59314C1.33297%204.52682%201.31267%204.45159%201.3125%204.37496ZM2.61844%204.37496L7%206.93105L11.3816%204.37496L7%201.81886L2.61844%204.37496ZM7.65625%2011.7993L7%2012.1821L1.96875%209.24707C1.86913%209.19747%201.75436%209.18769%201.64779%209.21973C1.54122%209.25177%201.45087%209.32322%201.39512%209.41953C1.33937%209.51583%201.32241%209.62977%201.3477%209.73814C1.37299%209.84651%201.43863%209.94117%201.53125%2010.0028L6.78125%2013.0653C6.84815%2013.1044%206.9242%2013.1249%207.00164%2013.1249C7.07908%2013.1249%207.15513%2013.1044%207.22203%2013.0653L8.09703%2012.5551C8.14746%2012.5266%208.19171%2012.4883%208.22723%2012.4426C8.26275%2012.3968%208.28882%2012.3444%208.30394%2012.2885C8.31906%2012.2326%208.32291%2012.1742%208.31529%2012.1167C8.30766%2012.0593%208.28871%2012.004%208.25952%2011.9539C8.23033%2011.9039%208.19149%2011.8601%208.14526%2011.8252C8.09903%2011.7903%208.04632%2011.7649%207.9902%2011.7505C7.93408%2011.7361%207.87566%2011.7331%207.81833%2011.7414C7.761%2011.7498%207.70591%2011.7695%207.65625%2011.7993Z'%20fill='%236B7280'/%3e%3cpath%20d='M10.6036%2011.3825L13.4607%209.4477C13.5813%209.36599%2013.614%209.20256%2013.5341%209.08069L13.0105%208.282C12.9303%208.15966%2012.7665%208.12478%2012.6434%208.20383L9.54053%2010.1964L8.94939%2011.4054C8.84904%2011.6106%209.03632%2011.8387%209.25715%2011.7803L10.4338%2011.469C10.4561%2011.4631%2010.4776%2011.4543%2010.4977%2011.4429L10.6036%2011.3825ZM9.54053%2010.1964L10.6036%2011.3825'%20stroke='%236B7280'%20stroke-width='0.6'/%3e%3c/svg%3e`,hf=`data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='path-1-inside-1_8856_23533'%20fill='white'%3e%3crect%20x='1.40039'%20y='1.40039'%20width='5.09086'%20height='5.09086'%20rx='0.727266'/%3e%3c/mask%3e%3crect%20x='1.40039'%20y='1.40039'%20width='5.09086'%20height='5.09086'%20rx='0.727266'%20stroke='%23586888'%20stroke-width='1.5'%20mask='url(%23path-1-inside-1_8856_23533)'/%3e%3cmask%20id='path-2-inside-2_8856_23533'%20fill='white'%3e%3crect%20x='1.40039'%20y='7.50781'%20width='5.09086'%20height='5.09086'%20rx='0.727266'/%3e%3c/mask%3e%3crect%20x='1.40039'%20y='7.50781'%20width='5.09086'%20height='5.09086'%20rx='0.727266'%20stroke='%23586888'%20stroke-width='1.5'%20mask='url(%23path-2-inside-2_8856_23533)'/%3e%3cline%20x1='7.375'%20y1='2.93555'%20x2='12.225'%20y2='2.93555'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='5.83398'%20x2='12.225'%20y2='5.83398'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='8.87305'%20x2='12.225'%20y2='8.87305'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='11.7227'%20x2='12.225'%20y2='11.7227'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3c/svg%3e`,gf=/^[a-z0-9][a-z0-9-_]*$/i,_f=/^(\/|https?:|data:image\/(png|svg\+xml|jpeg|webp);)/i;function vf(){if(typeof window>`u`)return{};let e=window.__CORE_THEME_CONFIG__?.actionIcons;if(!e||typeof e!=`object`||Array.isArray(e))return{};let t={};return Object.entries(e).forEach(([e,n])=>{let r=typeof n==`string`?n:n?.src;!gf.test(e)||typeof r!=`string`||!_f.test(r.trim())||(t[e]={src:r.trim(),label:String(typeof n==`object`&&n?.label||e)})}),t}function yf(e){return!e||typeof e!=`string`?null:vf()[e.trim()]??null}var bf=(0,i.createContext)(null);function xf(e){let t=String(e?.listPlacement??``).trim().toLowerCase();return t===`toolbar`||t===`row`?t:``}var Sf=[`desc`,`asc`];function Cf(e=[]){let t=[];return(Array.isArray(e)?e:[]).forEach(e=>{let n=e?.sortMenu,r=e?.key??e?.field;!n||typeof n!=`object`||!r||Sf.forEach(e=>{let i=String(n[e]??``).trim();i&&t.push({value:`${r}|${e}`,field:r,dir:e,label:i})})}),t}function wf(e=[]){for(let t of Array.isArray(e)?e:[]){let e=String(t?.sortMenu?.default??``).trim().toLowerCase();if(e===`asc`||e===`desc`)return{field:t.key??t.field,dir:e}}return null}var Tf=e=>e!=null&&String(e).trim()!==``;function Ef(e,t){let n=String(e??``);if([...n.matchAll(/\{([A-Za-z0-9_.]+)\}/g)].map(e=>e[1]).length===0)return n.trim();let r=!1,i=n.replace(/\{([A-Za-z0-9_.]+)\}/g,(e,n)=>{let i=t(n);return Tf(i)?(r=!0,String(i)):``});return r?i.trim():``}function Df(e){return e>=80?`high`:e>=70?`good`:e>=60?`fair`:`low`}function Of(e){if(e==null||e===``)return null;let t=typeof e==`object`&&e.$date?e.$date:e,n=t instanceof Date?t:new Date(t);return Number.isNaN(n.getTime())?null:n}var kf=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate();function Af(e,{relative:t=!1,now:n=new Date}={}){let r=Of(e);if(!r)return null;let i=r.toLocaleDateString(`en-GB`,{day:`2-digit`,month:`short`,year:`numeric`});if(t){let e=new Date(n);e.setDate(n.getDate()+1);let t=new Date(n);t.setDate(n.getDate()-1),kf(r,n)?i=`Today`:kf(r,e)?i=`Tomorrow`:kf(r,t)&&(i=`Yesterday`)}return{day:i,time:r.toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!0})}}var jf=5e3;function Mf(e=[],t=[],n=()=>``){let r=e=>{let t=e==null?``:String(e);return/^[=+\-@\t\r]/.test(t)&&(t=`'${t}`),/[",\r\n]/.test(t)?`"${t.replace(/"/g,`""`)}"`:t},i=[e.map(e=>r(e.label)).join(`,`)];return t.forEach(t=>i.push(e.map(e=>r(n(t,e))).join(`,`))),`\uFEFF${i.join(`\r
4
+ `).replace(/[ \t]{2,}/g,` `).trim():n.replace(/\s+/g,` `).trim(),n}function Xr(e,t={}){if(typeof e!=`string`||e===``)return null;let n=t.label||t.field||`Field`,r=Gr(e);if(r.includes(`\0`)||r.includes(`\0`))return`${n} contains a null byte`;if(t.type!==`text-editor`){let e=Vr.find(({re:e})=>e.test(r));if(e)return`${n}: ${e.message}`}else{let e=Vr.slice(0,3).find(({re:e})=>e.test(r));if(e)return`${n}: ${e.message}`}let i=Yr(e,t);return[...i].length>qr(t)?`${n} is too long`:t.formatter===`name`&&i&&!Rr.test(i)?`${n} allows only letters, numbers, spaces, apostrophes, hyphens and periods`:(t.formatter===`phone`||t.formatter===`digits`)&&i&&!zr.test(i)?`${n} contains invalid phone characters`:t.type===`number`&&i&&!Br.test(i)?`${n} must contain only a valid number`:(t.type===`url`||t.formatter===`url`)&&i&&!/^https?:\/\//i.test(i)?`${n} must use http:// or https://`:null}function Zr(e){return{validator:(t,n)=>{let r=(Array.isArray(n)?n:[n]).map(t=>Xr(t,e)).find(Boolean);return r?Promise.reject(Error(r)):Promise.resolve()}}}function Qr(e=[]){let t=new Map;return e.forEach(e=>{(e.fields??[]).forEach(n=>{if(n.type===`file`)return;let r=n.payloadKey||n.field;if(!r)return;let i=e.addRow?`${e.payloadKey||e.name}[].${r}`:r;t.set(i,n)})}),t}function $r(e,t=[]){let n=Qr(t),r=(e,t=``)=>{if(typeof e==`string`){let r=n.get(t)??{},i=Xr(e,r);if(i)throw Error(i);return Yr(e,r)}return Array.isArray(e)?e.map(e=>r(e,`${t}[]`)):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>{if(e.startsWith(`$`)||e.includes(`.`)||e.includes(`\0`))throw Error(`Unsafe object key: ${e}`);let i=t?`${t}.${e}`:e;return[e,r(n,i)]})):e};return r(e)}var ei=e=>e===!0||e===1||e===`1`||e===`true`;function ti(e){let t=e?.overrideCheckbox;return!t||typeof t!=`object`?null:ri(e).size>0?t:null}function ni(e){return String(e?.overrideCheckbox?.field??``).trim()||`${String(e?.field??``).replace(/\./g,`_`)}__override`}function ri(e){let t=e?.overrideCheckbox?.skipValidations,n=Array.isArray(t)?t:String(t??``).split(`,`);return new Set(n.map(e=>String(e??``).trim()).filter(Boolean))}function ii(e){return e?.overrideCheckbox?.store!==!1}function ai(e,t,n){let r=ni(e);if(typeof n==`function`){let e=n(r);if(Array.isArray(e)&&e.length)return[...e,r]}return Array.isArray(t)&&t.length>=3&&typeof t[1]==`number`?[t[0],t[1],r]:[r]}function oi(e,t){return n=>{let r=!1;try{r=ei(n?.getFieldValue?.(t))}catch{r=!1}return r?{}:e}}function si(e,t,n,r){if(!ti(e))return r;let i=ri(e),a=ai(e,t,n);return e=>{let t=r(e),n=typeof e==`string`?e:e?.type;return i.has(n)?oi(t,a):t}}function ci(e){let t=ti(e)??{},n=e?.label??e?.field??`this field`;return{tone:t.tone??`overwrite`,title:t.confirmTitle||`Remove the validation on this field?`,body:t.confirmBody||`The check that keeps ${n} within its allowed limit will be turned off for this record, and a value above that limit will be accepted. The override is recorded against the record. Do you want to continue?`,okText:t.confirmOkText||`Yes, remove the limit`,cancelText:t.confirmCancelText||`Keep the limit`}}function li(e){return String(e??``).normalize(`NFKD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().replace(/[^a-z0-9]+/g,``)}function ui(e){let t=new Map,n=(e,n)=>{let r=li(e);r&&!t.has(r)&&t.set(r,n)};return(Array.isArray(e?.options)?e.options:[]).forEach(e=>{if(e==null)return;let t=typeof e==`object`?e.value:e;t!=null&&t!==``&&(n(t,t),typeof e==`object`&&e.label!==void 0&&n(e.label,t))}),Object.entries(e?.optionAliases??{}).forEach(([e,r])=>{let i=t.get(li(r));i!==void 0&&n(e,i)}),t}var di=e=>Array.isArray(e?.options)&&e.options.length>0;function fi(e,t){if(t==null||t===``||typeof t==`object`)return t;let n=e.get(li(t));return n===void 0?t:n}function pi(e,t){if(!di(e))return t;let n=ui(e);return n.size===0?t:Array.isArray(t)?t.map(e=>fi(n,e)):fi(n,t)}var mi=e=>e==null||e===``||Array.isArray(e)&&e.length===0,hi=e=>e===!0||e===1||e===`1`,G=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&!gi(e);function gi(e){return e&&typeof e==`object`&&typeof e.format==`function`&&typeof e.isValid==`function`}function _i(e){return gi(e)||e instanceof Date}function vi(e){return e instanceof Date?e.toISOString():gi(e)?e.isValid()?e.toISOString():null:e}function yi(e,t){if(!Cn(t))return vi(e);let n=wn(e);return n?n.toISOString():vi(e)}function bi(e,t){if(!t)return;let n=String(t).split(`.`),r=e;for(let e of n){if(r==null)return;r=r[e]}return r}function xi(e,t){return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:bi(e,t)}function Si(e,t){return e&&Object.prototype.hasOwnProperty.call(e,t)?!0:bi(e,t)!==void 0}function Ci(e,t,n){let r=String(t).split(`.`),i=e;for(let e=0;e<r.length-1;e+=1){let t=r[e];G(i[t])||(i[t]={}),i=i[t]}return i[r[r.length-1]]=n,e}function wi(e,t,n){let r=String(t).split(`.`),i=e;for(let e=0;e<r.length-1;e+=1){let t=r[e];G(i[t])||(i[t]={}),i=i[t]}let a=r[r.length-1];return i[a]=G(i[a])&&G(n)?{...n,...i[a]}:n,e}function Ti(e){let t=Array.isArray(e)?e:e==null?[]:[e];if(!t.length||t.some(e=>e?.originFileObj))return;let n=t.map(e=>e?.stored).filter(e=>e!=null);if(n.length)return n.length===1&&t.length===1?n[0]:n}function Ei(e,t){return Object.entries(t??{}).forEach(([t,n])=>{G(n)&&G(e[t])?Ei(e[t],n):e[t]=n}),e}function Di(e,t){let n=e.options??e.values??[];for(let e of n)if(typeof e==`string`){if(e===t)return e}else if((e.value??e.id??e.name??e.label)===t)return e.label??e.name??e.value}function Oi(e,t){if(G(e)){let n=(t.valueKey&&e[t.valueKey])??e.value??e.id??e._id??e.key??e.code;return{value:n,label:(t.displayKey&&e[t.displayKey])??e.label??e.name??e.text??e.title??n}}return{value:e,label:Di(t,e)??e}}function ki(e={}){if(e.dataType&&e.dataType!==`auto`)return e.dataType;if(e.multiSelect||e.mode===`multiple`||e.addRow)return`array`;switch(e.type){case`number`:return`number`;case`date`:case`time`:return`date`;default:return`auto`}}function Ai(e,t,n={}){if(_i(e)){if(t===`string`)return yi(e,n);if(t===`number`){let t=gi(e)?e.valueOf():e.getTime();return Number.isNaN(t)?null:t}if(t===`date`||t===`auto`||!t)return yi(e,n)}switch(t){case`string`:return e==null?``:String(e);case`number`:{if(mi(e))return null;let t=Number(e);return Number.isNaN(t)?null:t}case`boolean`:return e===!0||e===1||e===`1`||e===`true`;case`array`:{let t;return t=Array.isArray(e)?e:mi(e)?[]:typeof e==`string`&&e.includes(`,`)?e.split(`,`).map(e=>e.trim()).filter(Boolean):[e],n.elementType?t.map(e=>Ai(e,n.elementType,{})).filter(e=>e!=null&&e!==``):t}case`object`:return G(e),e;case`date`:return yi(e,n);case`custom`:case`auto`:case void 0:default:return e}}var ji={firstChecked:e=>Array.isArray(e)?e[0]:e,csvToArray:e=>typeof e==`string`?e.split(`,`).map(e=>e.trim()).filter(Boolean):e,arrayToCsv:e=>Array.isArray(e)?e.join(`,`):e,trim:e=>typeof e==`string`?e.trim():e,upper:e=>typeof e==`string`?e.toUpperCase():e,lower:e=>typeof e==`string`?e.toLowerCase():e};function Mi(e,t){if(!t)return e;let n=t;if(typeof n==`string`){if(ji[n])return ji[n](e);try{n=JSON.parse(n)}catch{return e}}let r=e;if(n.name&&ji[n.name]&&(r=ji[n.name](r)),n.map&&typeof n.map==`object`){let e=String(Array.isArray(r)?r[0]:r);Object.prototype.hasOwnProperty.call(n.map,e)?r=n.map[e]:n.default!==void 0&&(r=n.default)}return r}var Ni=/\{\{\s*([\w.]+)\s*\}\}/g;function Pi(e,t){let[n,...r]=e.split(`.`),i;if(n===`value`)i=t.value;else if(n===`label`)i=t.label;else if(n===`raw`)i=t.raw;else return;return r.length?bi(i,r.join(`.`)):i}function Fi(e,t){if(typeof e==`string`){let n=e.match(/^\{\{\s*([\w.]+)\s*\}\}$/);return n?Pi(n[1],t):e.replace(Ni,(e,n)=>{let r=Pi(n,t);return r==null?``:String(r)})}if(Array.isArray(e))return e.map(e=>Fi(e,t));if(G(e)){let n={};return Object.entries(e).forEach(([e,r])=>{n[e]=Fi(r,t)}),n}return e}function Ii(e){if(!e)return null;if(typeof e==`string`)try{return JSON.parse(e)}catch{return null}return e}function Li(e,t){let n=e.payloadMode||`auto`,r=ki(e),{value:i,label:a}=Oi(t,e);switch(n){case`value`:return{kind:`scalar`,out:Ai(i,r,e)};case`label`:return{kind:`scalar`,out:Ai(a,e.dataType||`string`,e)};case`object`:{let t=e.valueKey||`id`,n=e.displayKey||`name`;return{kind:`scalar`,out:{[t]:Ai(i,e.elementType||`auto`,{}),[n]:a}}}case`custom`:case`template`:{let n=Ii(e.payloadTemplate);if(!n)return{kind:`scalar`,out:Ai(i,r,e)};let o=Fi(n,{value:Ai(i,e.elementType||`auto`,{}),label:a,raw:t});return{kind:e.payloadKey?`scalar`:`spread`,out:o}}default:return{kind:`scalar`,out:Ai(i,r,e)}}}function Ri(e,t){if(e.payloadMode===`skip`)return{kind:`skip`};let n=t;return mi(n)&&e.defaultValue!==void 0&&e.defaultValue!==``&&(n=e.defaultValue),n=Mi(n,e.transformRule),mi(n)&&e.omitEmpty?{kind:`skip`}:Array.isArray(n)&&(ki(e)===`array`||e.payloadMode===`object`)&&e.payloadMode&&e.payloadMode!==`value`&&e.payloadMode!==`auto`?{kind:`scalar`,out:n.map(t=>Li(e,t).out)}:Li(e,n)}function zi(e={}){return!!e.richValue||[`label`,`object`,`custom`,`template`].includes(e.payloadMode)}function Bi(e,t,n=[]){if(!zi(e)||t==null)return t;let r=e=>{if(G(e)&&e.value!==void 0)return e;let t=n.find(t=>String(t?.value??``)===String(e)||String(t?.label??``)===String(e));return{value:t?.value??e,label:t?.label??String(e)}};return Array.isArray(t)?t.map(r):r(t)}function Vi(e,t,n){if(!e?.field)return!0;let r=Si(t,e.field)?xi(t,e.field):xi(n??t,e.field),i=()=>String(e.value??``).split(`,`).map(e=>e.trim());switch(e.operator){case`eq`:return String(r??``)===String(e.value??``);case`neq`:return String(r??``)!==String(e.value??``);case`truthy`:return r!=null&&r!==``&&r!==!1;case`falsy`:return r==null||r===``||r===!1;case`notEmpty`:return Array.isArray(r)?r.length>0:!!r;case`in`:return i().includes(String(r??``));case`notIn`:return!i().includes(String(r??``));default:return!0}}function Hi(e){let t=[];return e?.field&&t.push(e.field),Array.isArray(e?.conditions)&&e.conditions.forEach(e=>{e?.field&&t.push(e.field)}),t}function Ui(e,t,n){if(!e)return!0;let r=Array.isArray(e.conditions)?e.conditions.filter(e=>e?.field):[];if(r.length){let i=r.map(e=>Vi(e,t,n)),a=String(e.logic??`and`).toLowerCase()===`or`,o=a?i.some(Boolean):i.every(Boolean);if(e.field){let r=Vi(e,t,n);o=a?o||r:o&&r}return o}return Vi(e,t,n)}function Wi(e,t,n,r,i=new Set){let a=Hi(e?.showIf);return!a.length||i.has(e.field)?!0:(i.add(e.field),Ui(e.showIf,t,n)?a.every(e=>{let a=r?.get?.(e);return!a||Wi(a,t,n,r,i)}):!1)}function Gi(e=[]){let t=new Map;return e.forEach(e=>(e.fields??[]).forEach(e=>{e?.field&&!t.has(e.field)&&t.set(e.field,e)})),t}function Ki(e={},{editing:t=!1}={}){let n={};return(e.fields??[]).forEach(e=>{!e.field||Yi(e)||t&&!e.defaultOnEdit||e.defaultValue!==void 0&&e.defaultValue!==``&&(n[e.field]=e.defaultValue)}),n}function qi(e=[]){let t=[];return e.forEach(e=>{(e.fields??[]).forEach(n=>{t.push({field:n,group:e})})}),t}var Ji=[`file`,`document`,`image`,`upload`,`attachment`];function Yi(e){return Ji.includes(String(e?.type??``).trim().toLowerCase())}function Xi(e=[]){return qi(e).map(({field:e})=>e).filter(Yi)}function Zi(e){return String(e??``).trim().toLowerCase()}function Qi(e,t){return!!t&&Zi(e.moduleName)===t}function $i(e,t){if(Zi(e?.moduleName)!==`documents`)return``;let n=(e.fields??[]).find(e=>!Yi(e)&&String(e.payloadKey||e.field||``).trim()===`module`);if(!n?.field)return``;let r=Ri(n,xi(t,n.field));if(r.kind!==`scalar`)return``;let i=r.out;if(Array.isArray(i)){if(i.length!==1)return``;[i]=i}return G(i)&&(i=i.value??i.id??i._id??i.key??i.code),i==null?``:String(i).trim()}function ea(e,t,n){if(!Qi(e,n))return!1;let r=String(t?.fileNameKey??``).trim(),i=String(t?.fileUrlKey??``).trim();return!!(r&&i)}function ta(e,t=[],n={}){let r=[],i=n.scope??`all`,a=Zi(n.module),o=(e,t,n=``,i=!1)=>{t!=null&&(Array.isArray(t)?t:[t]).forEach(t=>{let a=t?.originFileObj||t,o={formKey:e,file:a};n&&(o.documentModule=n),i&&(o.skipDocumentRegistry=!0),(typeof File<`u`&&a instanceof File||typeof Blob<`u`&&a instanceof Blob)&&r.push(o)})};return(t??[]).forEach(t=>{let r=(t.fields??[]).filter(Yi);if(!r.length)return;let s=t.moduleName&&!Qi(t,a),c=e=>s?`__mw__${t.moduleName}__${e}`:e;if(t.addRow){if(i===`flat`)return;let s=e[t.name];if(!Array.isArray(s))return;r.forEach(e=>{let r=e.fileKey??String(e.field).split(`.`)[0],i=ea(t,e,a);s.forEach((a,s)=>{let l=c(n.indexed?`${r}[${s}]`:r);o(l,xi(a,e.field),$i(t,a),i)})});return}i!==`addRow`&&r.forEach(n=>{let r=c(n.fileKey??String(n.field).split(`.`)[0]),i=ea(t,n,a);o(r,xi(e,n.field),$i(t,e),i)})}),r}function na(e,t,n={}){let r=G(n.base)?structuredClone(n.base):{};Xi(t).forEach(e=>{(e.payloadKey||e.field)&&(aa(r,e.payloadKey||e.field),aa(r,e.field))});let i=Zi(n.module),a=Gi(t),o=new Map,s=e=>!e.moduleName||Qi(e,i)?r:(o.has(e.moduleName)||o.set(e.moduleName,{}),o.get(e.moduleName));return(t??[]).forEach(t=>{let n=s(t),r=t.fields??[],i=t.toggleEnabled&&t.toggleField&&Si(e,t.toggleField)?!!xi(e,t.toggleField):!1;if(t.toggleEnabled&&t.toggleField&&Si(e,t.toggleField)&&(Ci(n,t.toggleField,i),i&&t.addRow)){Ci(n,t.payloadKey||t.name,[]);return}if(t.addRow){let i=e[t.name];if(!Array.isArray(i))return;Ci(n,t.payloadKey||t.name,i.map(t=>ia(r,t,e,a)).filter(e=>e&&Object.keys(e).length>0));return}r.forEach(t=>ra(t,e,n,e,a))}),o.size>0&&(r.moduleWrites=Array.from(o,([e,t])=>({moduleName:e,data:t}))),$r(r,t)}function ra(e,t,n,r,i){if(ti(e)&&ii(e)){let r=ni(e);Si(t,r)&&Ci(n,r,!!xi(t,r))}if(Yi(e)){let i=xi(t,e.field),a=(Array.isArray(i)?i:[i]).flatMap(e=>{let t=e?.originFileObj||e,n=typeof File<`u`&&t instanceof File||typeof Blob<`u`&&t instanceof Blob?String(t?.name??e?.name??``).trim():``;return n?[n]:[]});e.fileNameKey&&a.length&&Ci(n,e.fileNameKey,hi(e.multiple)||a.length>1?a:a[0]);let o=Ti(xi(t,e.field));if(o!==void 0){let i=r!==void 0&&r!==t;wi(n,e.payloadKey||(i?e.field:e.fileKey||e.field),o)}return}if(Hi(e.showIf).length&&!Wi(e,t,r,i)){(r===void 0||r===t)&&Si(t,e.field)&&Ci(n,e.payloadKey||e.field,null);return}if(Array.isArray(e.subFields)&&e.subFields.length>0){if(!Si(t,e.field))return;let a=xi(t,e.field);if(!Array.isArray(a))return;let o=a.map(t=>ia(e.subFields,t,r,i)).filter(e=>e&&Object.keys(e).length>0);Ci(n,e.payloadKey||e.field,o);return}if(!Si(t,e.field))return;if(hi(e.addRow)&&(!Array.isArray(e.subFields)||e.subFields.length===0)){let r=xi(t,e.field),i=Array.isArray(r)?r:mi(r)?[]:[r],a=ca(e),o=i.map(e=>Ri(a,e)).filter(e=>e.kind!==`skip`).map(e=>e.out);Ci(n,e.payloadKey||e.field,o);return}let a=Ri(e,xi(t,e.field));if(a.kind!==`skip`){if(a.kind===`spread`&&G(a.out)){Ei(n,a.out);return}Ci(n,e.payloadKey||e.field,a.out)}}function ia(e,t,n,r){let i={};return e.forEach(e=>ra(e,t,i,n??t,r)),i}function aa(e,t){let n=String(t).split(`.`),r=e;for(let e=0;e<n.length-1;e+=1){if(!G(r[n[e]]))return;r=r[n[e]]}delete r[n[n.length-1]]}var oa=new Set([`text`,`textarea`,`email`,`phone`,`tel`,`number`,`date`,`time`,`datetime`,`password`]);function sa(e,t){let n=t=>(Array.isArray(e.emptyValues)?e.emptyValues:[]).some(e=>String(e)===String(t)),r=()=>e.defaultOnEdit&&e.defaultValue!==void 0&&e.defaultValue!==``?e.defaultValue:void 0;if(t==null)return r()??t;if(n(t))return r();if(mi(t)&&e.defaultOnEdit&&e.defaultValue!==void 0&&e.defaultValue!==``)return e.defaultValue;if(oa.has(e.type)&&G(t)){let n=String(e.payloadKey||e.field||``).split(`.`).pop(),r=n?t[n]:void 0;if(r===void 0||G(r))return;t=r}if(e.type===`date`||e.type===`time`){if(!t||t===`0001-01-01T00:00:00Z`)return null;let e=(0,c.default)(t);return e.isValid()?e:null}t=pi(e,t);let i=t=>G(t)?(e.valueKey&&t[e.valueKey])??t.id??t._id??t.value??t.userId??t.recruiterId:t,a=e.type!==`radio`&&ki(e)===`array`,o=t=>{if(t==null||t===``||!Array.isArray(e.options))return t;let n=e.options.find(e=>String(e?.value??``).toLowerCase()===String(t).toLowerCase());return n?n.value:t};if(e.type===`select`||e.type===`radio`||e.type===`checkbox`){if(a)return(Array.isArray(t)?t:[t]).map(i).map(o).filter(e=>e!=null&&e!==``&&!n(e));let e=o(i(Array.isArray(t)?t[0]:t));return n(e)?r():e}return t}function ca(e={}){return{...e,addRow:!1,multiSelect:!1,mode:void 0,dataType:void 0}}function la(e,t){let n=Math.max(0,Number(e.minRows??0)||0),r=e.initialRows!==void 0&&e.initialRows!==``?Math.max(n,Math.max(0,Number(e.initialRows)||0)):n;if(Array.isArray(e.subFields)&&e.subFields.length>0){let i=[];Array.isArray(t)&&(i=t.map(t=>{let n={};return e.subFields.forEach(e=>{if(!e.field||Yi(e))return;let r=bi(t??{},e.field)??(t??{})[e.field];r!=null&&(n[e.field]=sa(e,r))}),n}));let a=i.length>0?n:Math.max(n,r);for(;i.length<a;)i.push({});return i}let i=ca(e),a=[];if(Array.isArray(t))a=t.map(e=>sa(i,e)).filter(e=>e!=null&&e!==``);else if(t!=null&&t!==``){let e=sa(i,t);e!=null&&e!==``&&(a=[e])}let o=a.length>0?n:Math.max(n,r);for(;a.length<o;)a.push(void 0);return a}var ua=e=>e===!0||e===1||e===`1`;function da(e=[]){let t=new Map;e.forEach(e=>{let n=e?.linkGroup;!ua(e?.addRow)||!n||(t.has(n)||t.set(n,[]),t.get(n).push(e.name))});let n=new Map;return t.forEach((e,t)=>{e.length<2||n.set(t,{leaderName:e[0],memberNames:e})}),n}function fa(e,t){for(let n of e.values())if(n.memberNames.includes(t))return n;return null}function pa(e,t={}){let n={...t};return e.forEach(({memberNames:e})=>{let t=Math.max(...e.map(e=>(n[e]??[]).length));e.forEach(e=>{let r=n[e]??[];r.length<t&&(n[e]=[...r,...Array.from({length:t-r.length},()=>({}))])})}),n}var ma={duplicate:{className:`fdd-tone-amber`,Icon:o.UserOutlined},overwrite:{className:`fdd-tone-amber`,Icon:o.ExclamationCircleFilled},suggestion:{className:`fdd-tone-blue`,Icon:o.InfoCircleFilled},file:{className:`fdd-tone-blue`,Icon:o.FileTextOutlined}};function ha({tone:e=`suggestion`,title:t,body:n,facts:r=[],okText:i=`Continue`,cancelText:o=`Cancel`,danger:c=!1,footnote:l}={}){let{className:u,Icon:d}=ma[e]??ma.suggestion,f=r.filter(e=>e&&e.value!==void 0&&e.value!==null&&String(e.value).trim()!==``);return new Promise(e=>{a.Modal.confirm({icon:null,centered:!0,width:480,className:`fdd-modal ${u}`,okText:i,cancelText:o,okButtonProps:{danger:c,size:`large`},cancelButtonProps:{size:`large`},content:(0,s.jsxs)(`div`,{className:`fdd`,children:[(0,s.jsxs)(`div`,{className:`fdd-head`,children:[(0,s.jsx)(`span`,{className:`fdd-icon`,"aria-hidden":`true`,children:(0,s.jsx)(d,{})}),(0,s.jsx)(`h3`,{className:`fdd-title`,children:t})]}),f.length>0&&(0,s.jsx)(`dl`,{className:`fdd-facts`,children:f.map(e=>(0,s.jsxs)(`div`,{className:`fdd-fact`,children:[(0,s.jsx)(`dt`,{children:e.label}),(0,s.jsx)(`dd`,{children:e.value})]},e.label))}),n&&(0,s.jsx)(`p`,{className:`fdd-body`,children:n}),l&&(0,s.jsx)(`p`,{className:`fdd-footnote`,children:l})]}),onOk:()=>e(!0),onCancel:()=>e(!1)})})}function ga({tone:e=`duplicate`,title:t,body:n,facts:r=[],okText:i=`Go back`}={}){let{className:o,Icon:c}=ma[e]??ma.suggestion,l=r.filter(e=>e&&String(e.value??``).trim()!==``);return new Promise(e=>{a.Modal.warning({icon:null,centered:!0,width:480,className:`fdd-modal ${o}`,okText:i,okButtonProps:{size:`large`},content:(0,s.jsxs)(`div`,{className:`fdd`,children:[(0,s.jsxs)(`div`,{className:`fdd-head`,children:[(0,s.jsx)(`span`,{className:`fdd-icon`,"aria-hidden":`true`,children:(0,s.jsx)(c,{})}),(0,s.jsx)(`h3`,{className:`fdd-title`,children:t})]}),l.length>0&&(0,s.jsx)(`dl`,{className:`fdd-facts`,children:l.map(e=>(0,s.jsxs)(`div`,{className:`fdd-fact`,children:[(0,s.jsx)(`dt`,{children:e.label}),(0,s.jsx)(`dd`,{children:e.value})]},e.label))}),n&&(0,s.jsx)(`p`,{className:`fdd-body`,children:n})]}),onOk:()=>e(!0)})})}async function _a({module:e,group:n,field:r,actionKey:i,inputs:a={},files:o={}}){if(!e||!n||!r||!i)throw Error(`module, group, field and actionKey are required to run an AI action`);let s=await t.a(),c=new FormData;c.append(`json`,JSON.stringify({inputs:a})),Object.entries(o).forEach(([e,t])=>{t&&c.append(e,t)});let l=new URLSearchParams({module:e,group:n,field:r,action:i}),u=await fetch(`${t.S}/ai-action?${l.toString()}`,{method:`POST`,headers:{Authorization:`Bearer ${s}`},body:c}),{logout:d}=await Promise.resolve().then(()=>require("./authApi-D0LZjLV6.cjs")).then(e=>e.n);u.status===401&&d();let f=(u.headers.get(`content-type`)||``).includes(`application/json`)?await u.json():await u.text();if(!u.ok){let e=Error(f?.error||f?.message||`API ${u.status}: ${u.statusText}`);throw e.status=u.status,e.data=f,e}return f?.data??f}var va=e=>e==null||e===``;function ya(e,t){return String(t??``).split(`.`).filter(Boolean).reduce((e,t)=>e?.[t],e)}function ba(e){let t=String(e??``).trim().replace(/[\s()-]/g,``);if(!t)return``;let n=t.replace(/^\+/,``);return/^\d{1,4}$/.test(n)?`+${n}`:``}function xa(e){let t=String(e?.field??``).trim(),n=t.replace(/(number|no|phone|mobile|contact)$/i,``);return[...t?[`${t}CountryCode`,`${t}Code`]:[],...n&&n!==t?[`${n}CountryCode`]:[],`countryCode`,`phoneCountryCode`,`mobileCountryCode`,`contactCountryCode`,`dialCode`,`isdCode`]}function Sa(e,t,n=``){let r=e?.renderOptions?.countryCodeField??e?.countryCodeField,i=r?[r,...xa(e)]:xa(e);for(let e of i){let n=ba(ya(t,e));if(n)return n}return ba(n)}function Ca(e){let t=String(e??``).trim(),n=t.match(/^(\+\d{1,4})[\s-]*(.*)$/);return n?{code:n[1],rest:n[2]}:{code:``,rest:t}}function wa(e,t=``){if(va(e))return``;let{code:n,rest:r}=Ca(e),i=n||ba(t),a=dn(r)||r;return`${i?`${i} `:``}${a}`.trim()}function Ta(e,t,n){return wa(t,Sa(e,n,ln()))}var Ea=[{value:`auto`,label:`Default (auto)`},{value:`text`,label:`Text`},{value:`tag`,label:`Tag`},{value:`tags`,label:`Multi Tag (Skills)`},{value:`badge`,label:`Badge`},{value:`chip`,label:`Chip`},{value:`document`,label:`Document`},{value:`link`,label:`Link`},{value:`email`,label:`Email`},{value:`phone`,label:`Phone`},{value:`date`,label:`Date`},{value:`currency`,label:`Currency`},{value:`budget`,label:`Budget`},{value:`html`,label:`HTML`}],Da=[{value:`preview`,label:`Preview (viewer)`},{value:`download`,label:`Download button`},{value:`link`,label:`Link (filename)`},{value:`tag`,label:`Tag`},{value:`text`,label:`Text (filename)`}],Oa=[{value:`none`,label:`None`},{value:`upper`,label:`UPPERCASE`},{value:`lower`,label:`lowercase`},{value:`title`,label:`Title Case`}],ka=[`location`,`path`,`url`,`key`],Aa=[`location`,`filepath`,`path`,`url`,`key`],ja=[`uploadedfilename`,`uploadname`,`originalname`,`displayname`,`documentname`,`filename`],Ma=[`name`],Na=e=>String(e).toLowerCase(),Pa=e=>e==null||e===``;function Fa(e,t){for(let n of t){let t=e[n];if(typeof t==`string`&&t)return t}return``}function Ia(e,t){for(let n of t)for(let[t,r]of Object.entries(e))if(typeof r==`string`&&r&&Na(t).endsWith(n))return r;return``}function La(e){if(!e)return``;let t=String(e).split(`?`)[0].split(`#`)[0];return decodeURIComponent(t.split(`/`).pop()||``)}function Ra(e){if(!e)return``;let t=String(e);if(/^https?:\/\//i.test(t))return t;let n=an().s3BaseUrl||``;return n?`${n}/${t.replace(/^\/+/,``)}`:``}function za(e){return typeof e==`string`?e.includes(`/`)?e:``:!e||typeof e!=`object`?``:Fa(e,ka)||Ia(e,Aa)}function Ba(e){return e?typeof e==`string`?La(e)||e:typeof e==`object`&&(Fa(e,an().documentNameOrder??[])||Ia(e,ja)||La(za(e))||Ia(e,Ma))||`Document`:`Document`}function Va(e){if(Pa(e))return[];let t=Array.isArray(e)?e:[e],n=[];for(let e of t)if(!Pa(e)){if(typeof e==`string`){let t=e.includes(`/`)?e:``;n.push({location:t,name:La(e)||e,url:Ra(t)})}else if(typeof e==`object`){let t=za(e),r=e.fileUrl||e.downloadUrl||e.signedUrl||``;n.push({location:t,name:Ba(e),url:r||Ra(t)})}}return n}var Ha=e=>e===!0||e===1||e===`1`,Ua=e=>e==null||e===``;function Wa(e){return String(e??``).split(`.`).map(e=>e.trim()).filter(Boolean)}function Ga(e,t,n){let r=Array.isArray(t)?t:Wa(t);if(!r.length)return e;let i=e;for(let e=0;e<r.length-1;e+=1){let t=r[e];(!i[t]||typeof i[t]!=`object`||Array.isArray(i[t]))&&(i[t]={}),i=i[t]}return i[r[r.length-1]]=n,e}function Ka(e,t=[]){if(!(!e||typeof e!=`object`))for(let n of t){if(!n)continue;let t=bi(e,n);if(!Ua(t))return t}}function qa(e,t){if(!e||typeof e!=`object`)return;let n=Object.entries(e),r=n.find(([e,n])=>t.test(e)&&!Ua(n));if(r)return r[1];for(let[,e]of n)if(e&&typeof e==`object`&&!Array.isArray(e)){let n=qa(e,t);if(!Ua(n))return n}}function Ja(e,t){let n=Array.isArray(e)?e:e?[e]:[];if(!n.length)return;let r=n.map((e,n)=>{if(typeof e==`string`){let r=e.includes(`/`)?Ra(e):``;return{uid:`${t.field}-${n}`,name:La(e)||e,status:`done`,existing:!0,url:r||void 0}}if(!e||typeof e!=`object`)return null;let r=Ka(e,[t.fileUrlKey,t.locationKey])??qa(e,/(location|url|path)$/i)??``,i=Ka(e,[t.fileNameKey])??qa(e,/(uploadName|uploadedFileName|fileName|name)$/i)??``;if(!r&&!i)return null;let a=r&&!String(r).startsWith(`http`)?Ra(r):r;return{uid:String(e.id??e._id??e.uniqueName??e.documentCopyUniqueName??`${t.field}-${n}`),name:i||`file`,status:`done`,existing:!0,url:a||void 0,stored:e}}).filter(Boolean);return r.length?r:void 0}function Ya(e,t){if(!e||typeof e!=`object`)return;let n=Ka(e,[t.fileNameKey,t.field])??qa(e,/(uploadName|uploadedFileName|fileName|name)$/i),r=Ka(e,[t.fileUrlKey,t.locationKey])??qa(e,/(location|url|path)$/i)??``;if(!n&&!r)return;let i=r&&!String(r).startsWith(`http`)?Ra(r):r,a=e.documentCopyUniqueName??e.uniqueName??n??`${t.field}-0`;return[{uid:String(a),name:n??`file`,status:`done`,existing:!0,url:i||void 0}]}function Xa(e,t,n,r){(e.fields??[]).forEach(e=>{e?.verifyAction&&[e.verifyResultField,e.verifyTimestampField,...String(e.verifyLockedWhenFields??``).split(/[,\s]+/)].map(e=>String(e??``).trim()).filter(Boolean).forEach(e=>{if(bi(n,e)!==void 0)return;let i=r(t,{field:e});i!=null&&Ga(n,e,i)})})}function Za(e,{editing:t=!1}={}){let n=t&&e.padRowsOnEdit===!1,r=!n&&Array.isArray(e.rows)?e.rows:null,i=Math.max(0,Number(e.minRows??0)||0),a=(t,n,r)=>{let i={};return(e.fields??[]).forEach(e=>{if(!e.field)return;if(e.type===`file`){let r=n(t,e);r&&Ga(i,e.field,r);return}let a=r(t,e);if(a==null){e.defaultOnEdit&&e.defaultValue!==void 0&&e.defaultValue!==``&&Ga(i,e.field,e.defaultValue);return}Ga(i,e.field,Ha(e.addRow)?la(e,a):sa(e,a))}),Xa(e,t,i,r),i},o=Ki(e,{editing:!0});if(r&&r.length>0){let e=r.map(e=>a(e,(e,t)=>Ya(e,t),(e,t)=>bi(e,t.field)));for(;e.length<i;)e.push({...o});return e}let s=a(e,(e,t)=>Ja(t.value,t),(e,t)=>t.value),c=Object.keys(s).length>0?[s]:[];if(!n)for(;c.length<i;)c.push({...o});return c}function Qa(e,t=[]){let n={};return t.forEach(e=>{e.toggleEnabled&&e.toggleField&&Ga(n,e.toggleField,!!e.toggleValue),!e.addRow&&(e.fields??[]).forEach(e=>{if(!e.field||e.addRow)return;let t=e.value,r=e.field;if(e.type===`file`){let i=Ja(t,e);i&&Ga(n,r,i);return}if(t==null)return;if(e.type===`checkbox`&&Array.isArray(e.options)&&e.options.length>0){let i=e.transformRule?.map;if(i){let e=Object.entries(i).find(([,e])=>String(e)===String(t));Ga(n,r,e?[e[0]]:[])}else Ga(n,r,pi(e,Array.isArray(t)?t:[t]));return}let i=e.splitDialCodeInto;if(i&&typeof t==`string`){let{code:a,rest:o}=Ca(t),s=ba(a);s&&Ga(n,i,s),Ga(n,r,sa(e,o||t));return}Ga(n,r,sa(e,t))})}),Object.keys(n).length>0&&e.setFieldsValue(n),n}function $a(e){let t=document.createElement(`div`);return t.innerHTML=String(e??``),t.textContent||t.innerText||``}function eo(e,t){return t&&t===`stripHtml`?$a(e):e}function to(e){return String(e??``).trim().split(/\s+/).filter(Boolean).length}function no(e){return Object.values(e||{}).some(e=>e!=null&&e!==``)}function ro(e,t){if(e.kind===`file`)return Array.isArray(t)?t.length>0:!!t;let n=eo(t,e.transform),r=String(n??``).trim();if(!r)return!1;let i=Number(e.minWords)||0;return i>0?to(r)>=i:!0}function io(e,t){let n=e.inputs||[];if(n.length===0)return!0;let r=new Map;n.forEach((e,t)=>{let n=e.group||`__solo_${t}`;r.has(n)||r.set(n,[]),r.get(n).push(e)});for(let e of r.values())if(e.some(e=>e.required||Number(e.minWords)>0)&&!e.some(e=>ro(e,t(e.sourceField))))return!1;return!0}function ao(e=[]){let t=[];return e.forEach(e=>{if(e?.addRow){e.name&&t.push(e.name);return}(e?.fields??[]).forEach(e=>{let n=e?.field??e?.name;n&&t.push(n)})}),t}function oo(e,t){return ao(t).some(t=>{let n=e.getFieldValue(t);return Array.isArray(n)?n.some(no):n!=null&&n!==``})}function so(e,t=[]){let n=e.getFieldsValue(!0)??{},r=new Set([t].flat().filter(Boolean)),i=typeof e.isFieldTouched==`function`?t=>e.isFieldTouched(t):()=>!0,a=0;return Object.entries(n).forEach(([e,t])=>{if(!(r.has(e)||!i(e)||!co(t))){if(Array.isArray(t)){a+=t.filter(e=>e&&typeof e==`object`?no(e):!!e).length;return}a+=1}}),a}function co(e){return e==null||e===``?!1:Array.isArray(e)?e.some(e=>e&&typeof e==`object`?no(e):!!e):typeof e!=`object`||Object.values(e).some(e=>e!=null&&e!==``)}function lo(e,t=[]){let n=e.getFieldsValue(!0)??{},r=new Set([t].flat().filter(Boolean)),i=Object.keys(n).filter(e=>!r.has(e));return typeof e.isFieldTouched==`function`?i.some(t=>e.isFieldTouched(t)&&co(n[t])):i.some(e=>co(n[e]))}function uo(e=[]){let t={};return(e??[]).forEach(e=>{e?.addRow||(e?.fields??[]).forEach(e=>{let n=e?.field??e?.name;if(!n)return;let r=e?.value;r!=null&&r!==``&&(t[n]=r)})}),t}function fo(e,t,n){let r=e?.confirmWhen??`never`;return r===`never`?!1:r===`always`||oo(t,n)}var po=[`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`],mo=`bottom-left`;function ho(e=[]){let t={};return e.forEach(e=>{let n=po.includes(e.position)?e.position:mo;(t[n]??=[]).push(e)}),t}function go({form:e,groups:t,module:n,onApplied:r,onParsed:o}){let[s,c]=(0,i.useState)(null),[l,u]=(0,i.useState)(``),d=a.Form.useWatch(e=>e,e),f=(0,i.useCallback)(e=>io(e,e=>(d||{})[e]),[d]),p=(0,i.useCallback)(t=>{if(!Array.isArray(t)||t.length===0)return!1;let n=Qa(e,t.filter(e=>!e.addRow)),r=Object.keys(n).length>0;return t.forEach(t=>{if(!t.addRow||!Array.isArray(t.rows)||t.rows.length===0)return;let n=Za(t);if(n.length===0)return;r=!0;let i=()=>e.setFieldsValue({[t.name]:n}),a=(e.getFieldValue(t.name)||[]).filter(no);if(a.length){let e=t.label||t.name;ha({tone:`overwrite`,title:`Replace what's in ${e}?`,facts:[{label:`Section`,value:e},{label:`Rows you filled in`,value:a.length},{label:`Rows in the file`,value:n.length}],body:`Everything currently in ${e} will be removed and replaced with what the file says. The rest of the form is not affected.`,okText:`Replace them`,cancelText:`Keep mine`,danger:!0}).then(e=>{e&&i()})}else i()}),r},[e]);return{runAction:(0,i.useCallback)(async(t,i,s,l)=>{let d=s?.confirmWhen??`never`;if(s?.trigger===`upload`&&d!==`never`&&(d===`always`||lo(e,[i?.field]))){let t=s.confirmMessages??{},n=l?.name||e.getFieldValue(i?.field)?.slice?.(-1)?.[0]?.name,r=so(e,[i?.field]);if(!await ha({tone:`overwrite`,title:t.title||`Read this file and fill the form in?`,facts:[{label:`File`,value:n},{label:`You have filled in`,value:r?`${r} ${r===1?`answer`:`answers`}`:void 0}],body:t.body||`We can read the details out of this file and fill the form in for you. Where the file has an answer, it replaces what is currently in that box. Anything the file does not mention is left as you typed it.`,okText:t.ok||`Read it and fill in`,cancelText:t.cancel||`Keep what I typed`}))return}c(s.key),u(s.loadingText||`Reading ${s.label||`the file`}…`);try{let c={},u={};(s.inputs||[]).forEach(t=>{if(t.kind===`file`){let n=e.getFieldValue(t.sourceField),r=l??n?.[n.length-1]?.originFileObj;r&&(u[t.param]=r)}else{let n=e.getFieldValue(t.sourceField);n!=null&&n!==``&&(c[t.param]=eo(n,t.transform))}}),(s.inputs||[]).forEach(e=>{!e.group||e.kind!==`text`||(s.inputs||[]).some(t=>t.group===e.group&&t.kind===`file`&&u[t.param])&&delete c[e.param]});let d=await _a({module:n,group:t,field:i.field,actionKey:s.key,inputs:c,files:u}),f=s.label||`AI action`,m=d?.groups;if(s?.trigger!==`upload`&&fo(s,e,m)){let e=s.confirmMessages??{},t=ao(m).length;if(!await ha({tone:`overwrite`,title:e.title||`Fill the form in from ${f}?`,facts:[{label:`Source`,value:f},{label:`Boxes it would fill`,value:t||void 0}],body:e.body||`We found details you can use. Applying them will replace what you have already entered in those boxes.`,okText:e.ok||`Use these details`,cancelText:e.cancel||`Keep what I typed`}))return a.message.info(`${f} cancelled — your entries were kept.`),d}if(o){let e=await o({action:s,field:i,groupName:t,responseGroups:m,payload:uo(m)});if(e===!1||e===`abort`)return d}let h=p(m);return h?a.message.success(`${f} completed successfully.`):a.message.info(`${f} completed, but no matching details were found.`),h&&r&&await r({action:s,field:i,groupName:t}),d}catch(e){a.message.error(e?.message||`${s.label||`AI action`} failed`);return}finally{c(null),u(``)}},[e,n,p,r,o]),loadingKey:s,loadingText:l,busy:s!==null,isActionEnabled:f}}function _o({position:e,actions:t,aiActions:n,groupName:r,field:i}){if(!t||t.length===0)return null;let o=e.endsWith(`center`)?`center`:e.endsWith(`right`)?`flex-end`:`flex-start`;return(0,s.jsx)(a.Space,{size:8,className:`v1-ai-action-buttons`,style:{width:`100%`,justifyContent:o},children:t.map(e=>(0,s.jsx)(a.Button,{size:`small`,loading:n.loadingKey===e.key,disabled:n.busy||!n.isActionEnabled(e),onClick:()=>n.runAction(r,i,e),children:e.label},e.key))})}function vo(e){let t=String(e??``).trim(),n=/^([^\s@]+)@([^\s@]+)\.([A-Za-z]{2,})$/.exec(t);if(!n)return!1;let[,r,i]=n;return/[A-Za-z]/.test(r)&&/[A-Za-z]/.test(i)}function yo(e=`Email`,t){return{validator:(n,r)=>r==null||r===``||vo(r)?Promise.resolve():Promise.reject(Error(t??`Enter a valid ${e}; numeric-only email addresses are not allowed`))}}var bo=[{label:`Only Numbers`,value:`onlyNumber`},{label:`Only Letters`,value:`onlyLetter`},{label:`Only Letters & Spaces`,value:`onlyLettersAndSpace`},{label:`Only Alphanumeric`,value:`onlyAlphanumeric`},{label:`Alphanumeric & Spaces`,value:`alphanumericSpace`},{label:`Letters, Numbers & Hyphen`,value:`onlyLettersNumberAndHyphen`},{label:`Letters, Numbers, Hyphen & Dot`,value:`onlyLettersNumberHyphenAndDot`},{label:`Contact Number (digits, (), -)`,value:`contactNumber`},{label:`Email (reject numeric-only address)`,value:`email`},{label:`Job Title (letters, nums, symbols)`,value:`jobTitle`},{label:`MSP / Ref ID (alphanumeric only)`,value:`mspRefId`},{label:`Location (letters, nums, , . -)`,value:`locationValidation`},{label:`Decimal / Range (number + dot)`,value:`decimalRange`},{label:`Budget (numbers, must be > 0)`,value:`budgetValidation`},{label:`Experience (numbers only)`,value:`experience`},{label:`Numeric — 2 digits max`,value:`numericTwoDigits`},{label:`Job Description (character count)`,value:`jobDescription`},{label:`Website URL`,value:`websiteUrl`}],xo={onlyNumber:/^[0-9]$/,experience:/^[0-9]$/,numericTwoDigits:/^[0-9]$/,budgetValidation:/^[0-9]$/,onlyLetter:/^[a-zA-Z\s]$/,onlyLettersAndSpace:/^[a-zA-Z\s]$/,onlyAlphanumeric:/^[a-zA-Z0-9]$/,alphanumericSpace:/^[a-zA-Z0-9\s]$/,mspRefId:/^[a-zA-Z0-9]$/,onlyLettersNumberAndHyphen:/^[a-zA-Z0-9\s-]$/,locationValidation:/^[a-zA-Z0-9\s\-.,]$/,jobTitle:/^[a-zA-Z0-9\s\-.,/&+()*'"#@]$/,decimalRange:/^[0-9.]$/,contactNumber:/^[0-9()\-+\s]$/};function So(e){return xo[e]??null}var Co=/^https?:\/\/(localhost|(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|1?\d?\d)|(?:[a-z\d](?:[a-z\d-]*[a-z\d])?\.)+[a-z]{2,63})(?::(\d{1,5}))?(?:[/?#][^\s]*)?$/i;function wo(e){let t=Co.exec(e);return t?t[2]===void 0||Number(t[2])<=65535:!1}function To(e,t={},n=`change`){if(!t?.type||e==null)return{cleaned:e??``,error:null};let r=String(e),{type:i,maxLength:a,maxChars:o}=t,s=t.title||`Field`,c,l=null,u=e=>n===`blur`?e.trim():e.replace(/^\s+/,``);switch(i){case`onlyNumber`:case`experience`:case`numericTwoDigits`:{let e=Number(a??(i===`numericTwoDigits`?2:10));c=r.replace(/[^0-9]/g,``),r!==c&&(l=`${s} allows only numbers.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyLetter`:{let e=Number(a??50);c=r.replace(/[^a-zA-Z]/g,``),r!==c&&(l=`${s} allows only letters.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyLettersAndSpace`:{let e=Number(a??55);c=u(r.replace(/[^a-zA-Z\s]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters and spaces.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyAlphanumeric`:case`mspRefId`:{let e=Number(a??50);c=u(r.replace(/[^a-zA-Z0-9]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters and numbers.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`alphanumericSpace`:{let e=Number(a??100);c=u(r.replace(/[^a-zA-Z0-9\s]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters, numbers and spaces.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyLettersNumberAndHyphen`:{let e=Number(a??55);c=u(r.replace(/[^a-zA-Z0-9\s-]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters, numbers and hyphens.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`onlyLettersNumberHyphenAndDot`:{let e=Number(a??100);c=r.replace(/[^a-zA-Z0-9\-./#+[\]{}()\s]/g,``).slice(0,e),r!==c&&(l=`${s} allows only letters, numbers, hyphens and dots.`);break}case`contactNumber`:{let e=Number(a??15);c=r.replace(/[^0-9()\-+\s]/g,``).slice(0,e),r===c?c&&!/^(\+?[0-9]{1,3}[- ]?)?(\(?\d{1,4}\)?[- ]?)?[\d\-\s]{3,15}$/.test(c)&&(l=`${s} is not a valid phone number format.`):l=`${s} allows only digits, parentheses () and hyphens.`;break}case`locationValidation`:{let e=Number(a??100);c=u(r.replace(/[^a-zA-Z0-9\s\-.,]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters, numbers, spaces, commas, dots and hyphens.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`jobTitle`:{let e=Number(a??80);c=u(r.replace(/[^a-zA-Z0-9\s\-/&.,()+#@'"*]/g,``)),r.replace(/^\s+/,``)!==c&&(l=`${s} allows only letters, numbers, spaces and common symbols.`),c.length>e&&(l=`${s} cannot exceed ${e} characters.`,c=c.slice(0,e));break}case`decimalRange`:{let e=r.replace(/[^0-9.]/g,``);if((e.match(/\./g)||[]).length>1){let t=e.indexOf(`.`);e=e.slice(0,t+1)+e.slice(t+1).replace(/\./g,``),l=`${s} can have only one decimal point.`}let t=e.replace(/\./g,``),n=Number(a??10);t.length>n&&(e=e.slice(0,n+ +!!e.includes(`.`)),l=`${s} cannot exceed ${n} digits.`),c=e,!l&&r!==c&&(l=`${s} allows only numbers and one dot.`);break}case`budgetValidation`:{let e=Number(a??10);c=r.replace(/[^0-9]/g,``).slice(0,e);let t=Number(c);r===c?c&&t<=0&&(l=`${s} must be greater than 0.`):l=`${s} allows only numbers.`;break}case`jobDescription`:{let e=Number(o??a??1500);r.replace(/<[^>]+>/g,` `).replace(/&nbsp;/g,` `).replace(/\s+/g,` `).trim().length>e&&(l=`${s} cannot exceed ${e} characters.`),c=r;break}case`email`:c=n===`blur`?r.trim():r,c&&!vo(c)&&(l=`${s} must be a valid email address; numeric-only email addresses are not allowed.`);break;case`websiteUrl`:c=n===`blur`?r.trim():r,c&&(c.length>2048||!wo(c)&&!/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})[/\w .-]*\/?$/i.test(c))&&(l=`${s} must be a valid URL.`);break;default:c=r}return{cleaned:c,error:l}}var Eo=`This value is already present`;function Do(e){return typeof e==`string`?e:e?.type??e?.rule??e?.name}function Oo(e){if(Do(e)!==`unique`)return null;if(typeof e==`string`)return{message:Eo,normalizer:`trim`,skipBlank:!0,validateOn:`blur`};let t=e.value&&typeof e.value==`object`?e.value:e,n=String(t.validateOn??`blur`).toLowerCase();return{message:typeof e.message==`string`&&e.message.trim()?e.message.trim():Eo,collectionField:t.collectionField??``,normalizer:String(t.normalizer??`trim`),skipBlank:t.skipBlank!==!1,validateOn:[`blur`,`change`,`submit`].includes(n)?n:`blur`}}function ko(e){let t=e?.validations??e?.validation??e?.rules??[];if(!Array.isArray(t))return null;for(let e of t){let t=Oo(e);if(t)return t}return null}function Ao(e=[]){let t=[];return(Array.isArray(e)?e:[]).forEach(e=>{(e?.fields??[]).forEach(e=>{let n=ko(e);!n||!e?.field||t.push({field:e.field,label:e.label??e.field,rule:n})})}),t}function jo(e){return e==null?!0:typeof e==`number`?Number.isNaN(e):typeof e==`boolean`?!1:Array.isArray(e)?e.length===0:String(e).trim()===``}function Mo(e,t=`trim`){if(e==null)return``;let n=String(e);switch(String(t)){case`exact`:return n;case`lower`:case`trimLower`:case`email`:return n.trim().toLowerCase();case`digitsOnly`:return n.replace(/\D+/g,``);default:return n.trim()}}function No(e,t){return!(!e||e.skipBlank!==!1&&jo(t))}function Po(e){return!e||e.validateOn===`submit`?[]:e.validateOn===`change`?[`onChange`,`onBlur`]:[`onBlur`]}var Fo={SKIPPED:`skipped`,AVAILABLE:`available`,DUPLICATE:`duplicate`,STALE:`stale`,ERROR:`error`};function Io({module:e,field:t,recordId:n,normalized:r}){return`${e}${t}${n??``}${r}`}function Lo({checkFieldUnique:e,onPendingChange:t}={}){let n=new Map,r=new Map,i=0,a=0;function o(e){a=e,typeof t==`function`&&t(a)}async function s({module:t,field:s,rule:c,value:l,recordId:u,clientId:d,region:f}={}){if(!c||!t||!s||typeof e!=`function`||!No(c,l))return{status:Fo.SKIPPED};let p=Io({module:t,field:s,recordId:u,normalized:Mo(l,c.normalizer)});if(n.has(p))return n.get(p);i+=1;let m=i;r.set(s,m),o(a+1);try{let i=await e({module:t,field:s,value:l,recordId:u,clientId:d,region:f});if(r.get(s)!==m)return{status:Fo.STALE};let a=i?.available===!1?{status:Fo.DUPLICATE,message:Ro(i)||c.message||Eo}:{status:Fo.AVAILABLE};return n.set(p,a),a}catch(e){return r.get(s)===m?{status:Fo.ERROR,error:e}:{status:Fo.STALE}}finally{o(Math.max(0,a-1))}}return{check:s,isPending:()=>a>0,pendingCount:()=>a,reset:()=>{n.clear(),r.clear()}}}function Ro(e){return(e?.errors??[]).find(e=>e?.message)?.message||e?.message||``}var zo=`__uniqueRule`;function Bo({field:e,validation:t,context:n}){let r=Oo(t);if(!r)return{validator:()=>Promise.resolve()};let i=e?.field??``;return!n?.checker||!n?.module||!i?{validator:()=>Promise.resolve()}:{[zo]:r,validateTrigger:Po(r),validator:async(e,t)=>{let a=await n.checker.check({module:n.module,field:i,rule:r,value:t,recordId:n.recordId,clientId:n.clientId,region:n.region});return a.status===Fo.DUPLICATE?Promise.reject(Error(a.message||r.message)):Promise.resolve()}}}function Vo(e=[]){let t=Array.isArray(e)?e:[];if(!t.some(e=>e&&e[zo]))return t;let n=t.filter(e=>e&&!e[zo]);return t.map(e=>{if(!e||!e[zo])return e;let t=e.validator;return{...e,validator:async(e,r)=>await Ho(n,r,e)?Promise.resolve():t(e,r)}})}async function Ho(e=[],t,n={}){for(let r of e)if(!(!r||typeof r==`string`)){if(r.required&&jo(t)||!jo(t)&&(r.pattern instanceof RegExp&&!new RegExp(r.pattern.source,r.pattern.flags).test(String(t))||r.len!=null&&String(t).length!==Number(r.len)))return!0;if(typeof r.validator==`function`)try{await r.validator(n,t)}catch{return!0}}return!1}function Uo(e){let t=String(e??``).trim();if(!t.startsWith(`{`))return null;try{return JSON.parse(t)}catch{return null}}function Wo(e){if(!e)return null;if(typeof e==`string`)return Uo(e);let t=[e.data,e.response,e,Uo(e.message)];for(let e of t)if(!(!e||typeof e!=`object`)&&(Array.isArray(e.errors)||e.code===`DUPLICATE_VALUE`))return e;return null}function Go({field:e,group:t,rowIndex:n}){let r=String(e??``),i=Number(n);return t&&Number.isInteger(i)&&i>=0?[String(t),i,...r.split(`.`)]:r}function Ko(e,{uniqueRules:t=[]}={}){let n=Wo(e);if(n){let e=(Array.isArray(n.errors)?n.errors:[]).filter(e=>e?.field).map(e=>{let t={field:e.field,name:Go(e),message:e.message||n.message||Eo};return Array.isArray(t.name)&&(t.group=String(e.group),t.rowIndex=Number(e.rowIndex)),t});if(e.length)return e}let r=String((n&&(n.message||n.error))??(typeof e==`string`?e:e?.message)??``).trim();if(!r)return[];let i=e?.status===409||n?.code===`DUPLICATE_VALUE`,a=t.filter(e=>String(e?.rule?.message??``).trim().toLowerCase()===r.toLowerCase());return a.length&&(i||a.length===1)?a.map(e=>({field:e.field,name:e.field,message:r})):[]}async function qo({module:e,field:n,value:r,recordId:i,clientId:a,region:o,signal:s}={}){if(!e||!n)throw Error(`module and field are required to check uniqueness`);let c={field:n,value:r??``};i&&(c.recordId=String(i)),a&&(c.clientId=String(a)),o&&(c.region=String(o));try{let n=await t.o(t.S,`/module/validate-unique?module=${encodeURIComponent(e)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(c),...s?{signal:s}:{}}),r=n?.available!==!1;return{available:r,duplicate:!r,message:n?.message??``,errors:Array.isArray(n?.errors)?n.errors:[],response:n}}catch(e){if(e?.status===409){let t=e.response??e.data??{};return{available:!1,duplicate:!0,message:t?.message??e.message??``,errors:Array.isArray(t?.errors)?t.errors:[],response:t}}throw e}}var Jo=Object.freeze({});function Yo(e){let t=Number(e);return Number.isFinite(t)&&t>0?t:0}function Xo(e,t){let n=Yo(t);if(!n)return Jo;let r=ko(e);return!r||r.validateOn===`submit`?Jo:{validateDebounce:n}}function Zo(e=qo){let t=new Map;return async function(n={}){let r=String(n?.field??``);if(typeof AbortController!=`function`)return e(n);t.get(r)?.abort();let i=new AbortController;t.set(r,i);try{return await e({...n,signal:i.signal})}finally{t.get(r)===i&&t.delete(r)}}}async function Qo({module:e,payload:n,excludeId:r}={}){if(!e||!n)return{duplicate:!1};try{let i=await t.o(t.S,`/module/duplicate-check?module=${encodeURIComponent(e)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({payload:n,...r?{excludeId:r}:{}})});return i?.data??i??{duplicate:!1}}catch{return{duplicate:!1}}}var $o=[`jpg`,`jpeg`,`png`,`gif`,`webp`,`bmp`,`svg`,`avif`],es=[`mp4`,`webm`,`ogg`,`ogv`,`mov`,`m4v`],ts=[`pdf`,`doc`,`docx`],ns=[{label:`Any file`,value:`any`},{label:`Documents & Images (pdf, doc, images)`,value:`documents`},{label:`Images only`,value:`images`},{label:`Videos only`,value:`videos`},{label:`Images & Videos`,value:`imagesAndVideos`}],rs={documents:{exts:[...ts,...$o],hint:`PDF, DOC or image files`,error:`Only document (PDF/DOC) or image files are allowed`},images:{exts:$o,hint:`Image files`,error:`Only image files are allowed`},videos:{exts:es,hint:`Video files`,error:`Only video files are allowed`},imagesAndVideos:{exts:[...$o,...es],hint:`Image or video files`,error:`Only image or video files are allowed`}};function is(e){return rs[String(e?.accept??``).trim()]??null}var as=new Set([`of`,`and`,`the`,`to`,`for`,`in`,`a`,`an`]),os={addresses:`address`,branches:`branch`,batches:`batch`,categories:`category`,companies:`company`,countries:`country`,entries:`entry`,people:`person`,statuses:`status`};function ss(e){let t=String(e??``).trim();if(!t)return``;if(t.length>1&&t===t.toUpperCase()&&/[A-Z]/.test(t))return t;let n=t.toLowerCase();return os[n]?os[n]:/[^aeiou]ies$/i.test(t)?t.slice(0,-3)+`y`:/(s|x|z|ch|sh)es$/i.test(t)?t.slice(0,-2):/[^s]s$/i.test(t)?t.slice(0,-1):t}function cs(e){let t=String(e??``).trim();if(!t)return``;let n=t.replace(/([A-Z]+)([A-Z][a-z])/g,`$1 $2`).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_\-.]+/g,` `).split(/\s+/).filter(Boolean);if(!n.length)return``;let r=ss(n[n.length-1]);return[...n.slice(0,-1),r].map((e,t)=>{let n=e.toLowerCase();return e.length>1&&e===e.toUpperCase()?e:t>0&&as.has(n)?n:n.charAt(0).toUpperCase()+n.slice(1)}).join(` `)}function ls(e,t){let n=String(e?.quickCreateLabel??``).trim();if(n&&n.toLowerCase()!==`add more`)return n;let r=cs(e?.quickCreateModule||t);return r?`Add New ${r}`:`Add New`}function us(e,t){let n=String(e?.quickEditLabel??``).trim();if(n&&n.toLowerCase()!==`add more`)return n;let r=cs(e?.quickEditModule||t);return r?`Edit ${r}`:`Edit`}function ds(e,t,n){let r=cs((e===`create`?t?.quickCreateModule:t?.quickEditModule)||n);return e===`create`?String(t?.quickCreateTitle??``).trim()||(r?`Add New ${r}`:ls(t,n)):String(t?.quickEditTitle??``).trim()||(r?`Edit ${r}`:us(t,n))}function fs({children:e,className:t=``,icon:n,to:r,variant:i=`default`,...o}){let c=(0,s.jsx)(a.Button,{className:`app-button app-button--${i} ${t}`.trim(),icon:n,...o,children:e});return r?(0,s.jsx)(d.Link,{className:`app-button-link`,to:r,children:c}):c}function ps(e){return!e||typeof e!=`object`?``:[e.firstName??e.first_name??e.FIRST_NAME,e.lastName??e.last_name??e.LAST_NAME].filter(Boolean).join(` `).trim()||e.name||e.userName||e.user_name||e.username||e.email||``}function ms(e){return e==null||e===``?``:typeof e==`object`?String(e.$oid??e.id??e._id??``).trim():String(e).trim()}function hs(e={}){return[e.legacyUserId,e.userId,e.user_id,e._id,e.id].map(ms).filter(Boolean)}function gs(e){let t={};return(Array.isArray(e)?e:[]).forEach(e=>{let n=ps(e);n&&hs(e).forEach(e=>{t[e]===void 0&&(t[e]=n)})}),t}var _s;function vs(){return _s||=t.o(t.S,`/module/list?module=users`).then(e=>{let t=e?.data?.data??e?.data??[];return Array.isArray(t)?t:[]}).catch(()=>[]),_s}var ys=new Map;function bs(e){let t=ms(e);if(!t)return Promise.resolve(``);if(ys.has(t))return ys.get(t);let n=vs().then(e=>ps(e.find(e=>ms(e?.legacyUserId)===t||ms(e?.userId)===t||ms(e?.user_id)===t)||e.find(e=>ms(e?._id)===t||ms(e?.id)===t))).catch(()=>``);return ys.set(t,n),n}var xs=e=>e==null?``:String(e).trim();function Ss(e){let t=e?.quickCreateNotice;return!t||typeof t!=`object`||t.enabled===!1?null:{enabled:!0,title:xs(t.title)||`New record created`,message:xs(t.message)||`A new client has been created successfully. Please contact your Organization Admin to configure the required forms, workflows, permissions, and client-specific details before proceeding with further operations.`,showCreator:t.showCreator!==!1,showRecordName:t.showRecordName!==!1,recordNameField:xs(t.recordNameField),recordLabel:xs(t.recordLabel)||`Record name`,creatorLabel:xs(t.creatorLabel)||`Created by`}}var Cs=[`clientName`,`companyName`,`name`,`title`,`fullName`,`displayName`,`label`,`employerName`,`vendorName`],ws=(e,t)=>{if(!(!e||!t))return String(t).split(`.`).reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e)},Ts=e=>typeof e==`string`||typeof e==`number`?xs(e):e&&typeof e==`object`?xs(e.label??e.name??e.title??``):``;function Es(e,{recordNameField:t=``,displayField:n=``}={}){if(!e||typeof e!=`object`)return``;for(let r of[t,n,...Cs]){if(!r)continue;let t=Ts(ws(e,r));if(t)return t}let r=Object.keys(e).find(t=>/name$/i.test(t)&&typeof e[t]==`string`&&e[t].trim());return r?xs(e[r]):``}function Ds(e){if(!e||typeof e!=`object`)return``;let t=[e.createdBy,e.created_by,e.createdById,e.createdUserId,e.recordMeta?.createdBy,e.ownerId];for(let e of t){if(e==null||e===``)continue;if(typeof e==`object`){let t=xs(e.$oid??e.userId??e._id??e.id);if(t)return t;continue}let t=xs(e);if(t)return t}return``}function Os(e=t.d){try{return ps(e())||``}catch{return``}}var ks=(e,n)=>t.o(t.S,`/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(n)}`).then(e=>{let t=e?.data?.data??e?.data??[];return Array.isArray(t)?t[0]:t});async function As({module:e,recordId:n,notice:r,displayField:i=``,deps:a={}}={}){let{fetchRecord:o=ks,fetchUserNameFn:s=bs,getUser:c=t.d}=a,l=null;if(e&&n)try{l=await o(e,n)}catch{l=null}let u=r?.showRecordName===!1?``:Es(l,{recordNameField:r?.recordNameField,displayField:i}),d=``;if(r?.showCreator!==!1){let e=Ds(l);if(e)try{d=xs(await s(e))}catch{d=``}d||=Os(c)}return{recordName:u,creatorName:d}}var js=(0,i.lazy)(()=>Promise.resolve().then(()=>require("./AddFormV1-C8L2lNYb.cjs")).then(e=>e.n)),Ms=(0,i.lazy)(()=>Promise.resolve().then(()=>require("./index.cjs")).then(e=>e.n)),Ns=e=>e==null||e===``,Ps=e=>typeof e==`string`&&e.includes(`.`)?e.split(`.`):[e];function Fs(e,t,n,r,i){let a=e.quickEditIdFrom;if(a){let e=Array.isArray(n)&&n.length>=3&&typeof n[1]==`number`?[...n.slice(0,2),...Ps(a)]:Ps(a),i=t?.getFieldValue?.(e);return Ns(i)&&(i=r?.[a]),Ns(i)?null:i}return i&&typeof i==`object`?i.value??null:Ns(i)?null:i}function Is({field:e,form:t,name:n,moduleName:r,scopeValues:c,ownValue:l,onDone:u}){let[d,f]=(0,i.useState)(null),[p,m]=(0,i.useState)(null),h=!!e?.quickCreate,g=!!e?.quickEdit,_=e?.quickCreateModule||e?.lookupCollection||``,v=e?.quickEditModule||e?.lookupCollection||``,y=(0,i.useMemo)(()=>g?Fs(e,t,n,c,l):null,[g,e,t,n,c,l]);if(!h&&!g)return{footer:null,modal:null};let b=()=>f(null),x=()=>{if(e?.quickCreateOnClick){e.quickCreateOnClick(),document.activeElement?.blur?.();return}if(e?.quickCreateRoute){window.open(e.quickCreateRoute,`_blank`,`noopener,noreferrer`);return}_&&f({mode:`create`,module:_})},S=()=>v&&y&&f({mode:`edit`,module:v,recordId:String(y)}),C=t=>{let n=Ss(e);n&&(m({...n,recordName:``,creatorName:``}),As({module:_,recordId:t,notice:n,displayField:e?.displayField||``}).then(({recordName:e,creatorName:t})=>{m(n=>n&&{...n,recordName:e,creatorName:t})}).catch(()=>{}))},w=(0,s.jsx)(`div`,{className:`v1-quick-actions`,role:`presentation`,onMouseDown:e=>e.preventDefault(),style:{display:`flex`,gap:8,padding:`6px 8px`,borderTop:`1px solid rgba(0,0,0,0.06)`},children:(0,s.jsxs)(a.Space,{size:8,children:[h&&(0,s.jsx)(a.Button,{type:`link`,size:`small`,icon:(0,s.jsx)(o.PlusOutlined,{}),onClick:x,style:{paddingLeft:0},children:ls(e,_)}),g&&(0,s.jsx)(a.Button,{type:`link`,size:`small`,icon:(0,s.jsx)(o.EditOutlined,{}),onClick:S,disabled:!y,title:y?void 0:`Choose a ${cs(v)||`record`} above first, then edit it here`,children:us(e,v)})]})}),T=d?(0,s.jsx)(a.Modal,{open:!0,title:ds(d.mode,e,d.mode===`create`?_:v),width:`min(1080px, 96vw)`,footer:null,destroyOnClose:!0,maskClosable:!1,onCancel:b,styles:{body:{maxHeight:`78vh`,overflowY:`auto`}},children:(0,s.jsx)(i.Suspense,{fallback:(0,s.jsx)(`div`,{style:{padding:48,textAlign:`center`},children:(0,s.jsx)(a.Spin,{})}),children:d.mode===`create`?(0,s.jsx)(js,{moduleName:d.module,embedded:!0,breadcrumbItems:[],onCancel:b,onSuccess:e=>{b(),C(e),u?.(`create`,e)}}):(0,s.jsx)(Ms,{moduleName:d.module,recordId:d.recordId,embedded:!0,breadcrumbItems:[],onCancel:b,onSuccess:e=>{b(),u?.(`edit`,e)}})})}):null,E=p?(0,s.jsxs)(a.Modal,{open:!0,title:(0,s.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:8},children:[(0,s.jsx)(o.ExclamationCircleFilled,{style:{color:`#faad14`}}),p.title]}),width:`min(520px, 94vw)`,maskClosable:!1,onCancel:()=>m(null),footer:(0,s.jsx)(fs,{variant:`primary`,type:`primary`,onClick:()=>m(null),children:`OK`}),children:[(0,s.jsx)(`p`,{style:{marginTop:0,marginBottom:16},children:p.message}),(p.recordName||p.creatorName)&&(0,s.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`auto 1fr`,gap:`6px 12px`,padding:`10px 12px`,borderRadius:6,background:`rgba(0,0,0,0.03)`},children:[p.recordName&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{style:{color:`rgba(0,0,0,0.55)`},children:p.recordLabel}),(0,s.jsx)(`strong`,{children:p.recordName})]}),p.creatorName&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{style:{color:`rgba(0,0,0,0.55)`},children:p.creatorLabel}),(0,s.jsx)(`strong`,{children:p.creatorName})]})]})]}):null;return{footer:w,modal:T||E?(0,s.jsxs)(s.Fragment,{children:[T,E]}):null}}var Ls=e=>e==null||e===``||Array.isArray(e)&&e.length===0;function Rs(e,t,n){let r=String(t??``).includes(`.`)?String(t).split(`.`):[t];if(typeof n==`function`){let e=n(t);return Array.isArray(e)&&e.length?[...e,...r]:r}return Array.isArray(e)&&e.length>1?[...e.slice(0,-1),...r]:r}function zs({label:e,message:t,rule:n={},value:r,form:i,name:a,prefixFor:o}){let s=n.field??n.compareField??r;return{validator:async(n,r)=>{if(!s||Ls(r))return Promise.resolve();let c=i?.getFieldValue?.(Rs(a,s,o));if(Ls(c))return Promise.resolve();let l=Number(c),u=Number(r);return Number.isNaN(l)||Number.isNaN(u)||u<=l?Promise.resolve():Promise.reject(Error(t??`${e} must not exceed ${s}`))}}}function Bs(e={},t,n){let r=e.field??e.compareField??e.value;return r?Rs(t,r,n):null}function Vs(e,t){let n=String(t).split(`.`).filter(Boolean);if(!Array.isArray(e))return n.length>1?n:t;if(n.length>1){if(e.length>=3&&typeof e[1]==`number`){let t=e.slice(0,2),r=n[0]===String(e[0])?n.slice(1):n;return[...t,...r]}return n}let r=[...e];return r[r.length-1]=n[0],r}function Hs(e,t,n){let r=e?.getFieldValue?.(Vs(t,n));return r!=null&&r!==``?r:e?.getFieldValue?.(n)}function Us(e){return String(e??``).split(`,`).map(e=>e.trim()).filter(Boolean)}function Ws(e,t){for(let n of e??[]){let e=t(n);if(e==null||e===``)continue;let r=Number(e);if(!(!Number.isFinite(r)||r<=0))return{field:n,maximum:r}}return null}function Gs({input:e,compareFields:t,readValue:n}){let r={ok:!0,field:null,maximum:null};if(e==null||e===``)return r;let i=Ws(t,n);if(!i)return r;let a=Number(e);return Number.isFinite(a)?{ok:a<=i.maximum,field:i.field,maximum:i.maximum}:r}var Ks={candidates:[`applicantId`]};function qs(e){let t=String(e??``).trim();if(!t)return[];let n=t.endsWith(`s`)?t.slice(0,-1):t;return[...new Set([`${n}Id`,`${t}Id`,...Ks[t]??[]])]}function Js(e,t){if(!t)return``;let n=e=>e&&typeof e==`object`?e.id??e.value??``:e??``;for(let r of qs(e)){let e=String(n(t[r])||``);if(e)return e}return``}function Ys(e,t){let n=new Set;return(e??[]).forEach(e=>(e.fields??[]).forEach(e=>{e?.prefillFromModule&&n.add(t(e.prefillFromModule))})),[...n]}function Xs(e){return e?.payloadMode===`skip`}function Zs(e){return Array.isArray(e)?e:Array.isArray(e?.groups)?e.groups:Array.isArray(e?.data)?e.data:Array.isArray(e?.data?.groups)?e.data.groups:[]}function Qs(e){let t={};return(e??[]).forEach(e=>{e?.addRow||(e?.fields??[]).forEach(e=>{!e?.field||e.value===void 0||e.value===null||(t[e.field]=e.value,e.payloadKey&&e.payloadKey!==e.field&&(t[e.payloadKey]=e.value))})}),t}function $s(e,t){if(!(!e||!t))for(let n of[t.prefillFrom,t.field,t.payloadKey]){if(!n)continue;let t=e[n];if(t??=bi(e,n),t!=null)return t}}function ec(e,t){return!Array.isArray(e)||!t||typeof t!=`object`?e:e.map(e=>{if(e?.addRow){let n=t[e.payloadKey]??t[e.name];return Array.isArray(n)?{...e,rows:n}:e}return{...e,fields:(e?.fields??[]).map(e=>{let n=$s(t,{field:e?.field,payloadKey:e?.payloadKey});return n===void 0?e:{...e,value:n}})}})}function tc({form:e,field:t,flagPath:n,fieldPath:r,disabled:i}){let o=ti(t),c=a.Form.useWatch(n,e);if(!o)return null;let l=o.label||`Allow beyond the limit`,u=()=>{setTimeout(()=>{e?.validateFields?.([r]).catch(()=>{})})},d=async r=>{if(!r.target.checked){e.setFieldValue(n,!1),u();return}let i=await ha(ci(t));e.setFieldValue(n,!!i),u()},f=o.help?`${l} — ${o.help}`:l;return(0,s.jsx)(a.Tooltip,{title:f,children:(0,s.jsx)(`span`,{className:`v1-override-wrap`,children:(0,s.jsx)(a.Checkbox,{className:`v1-override-checkbox`,checked:!!c,disabled:i,onChange:d,"aria-label":f})})})}var nc=e=>String(e??``);function rc(e){let t=new Set,n=[];return(Array.isArray(e)?e:[]).forEach(e=>{let r=e?.field;!r||t.has(r)||(t.add(r),n.push(r))}),n}function ic(e,t,n,r){return rc(e).map(e=>({field:e,path:n(t,e,r)}))}function ac(e,t={}){return!e||!e.field?!1:nc(t[e.field])===nc(e.value)}function oc({rules:e,watched:t={},current:n,lastApplied:r,clearOnMismatch:i=!0,initial:a=!1}={}){let o=(Array.isArray(e)?e:[]).find(e=>ac(e,t));return o?o.clearValue?a?{action:`none`}:{action:`clear`}:{action:`set`,value:o.setValue}:i&&r!==void 0&&nc(n)===nc(r)?{action:`clear`}:{action:`none`}}var sc=e=>String(e??``).trim().toLowerCase();function cc(e){let t=Array.isArray(e)?e:[e],n=[];return t.forEach(e=>{if(e!=null&&e!==``){if(typeof e==`object`){[e.value,e.id,e._id,e.label,e.name].forEach(e=>{e!=null&&e!==``&&n.push(sc(e))});return}n.push(sc(e))}}),n}function lc(e=[],t){let n=cc(t);if(!n.length||!Array.isArray(e)||e.length===0)return e;let r=new Set(n),i=e.filter(e=>e==null?!1:typeof e==`object`?r.has(sc(e.value))||r.has(sc(e.label)):r.has(sc(e)));return i.length>0?i:e}function uc(e){let t=[];return[e?.setValue,e?.setValueLabel].forEach(e=>{e!=null&&e!==``&&t.push(sc(e))}),t}function dc(e,t={}){let n=Array.isArray(e)?e:[],r=new Set,i=new Set;return n.forEach(e=>{if(!e||e.clearValue)return;let n=uc(e);if(!n.length)return;let a=ac(e,t)?i:r;n.forEach(e=>a.add(e))}),i.forEach(e=>r.delete(e)),[...r]}function fc(e=[],t,n){let r=dc(t,n);if(!r.length||!Array.isArray(e)||e.length===0)return e;let i=new Set(r);return e.filter(e=>e==null?!0:typeof e==`object`?!(i.has(sc(e.value))||i.has(sc(e.label))):!i.has(sc(e)))}var pc=64;function mc(e){if(String(e??``).trim()!==`currentUserId`)return``;try{return typeof localStorage>`u`?``:String(localStorage.getItem(`userId`)??``).trim()}catch{return``}}var hc=e=>String(e??``).trim().toLowerCase(),gc=e=>e!=null&&String(e).trim()!==``;function _c(e){let t=Array.isArray(e)?e:String(e??``).split(`,`);return new Set(t.map(hc).filter(e=>e!==``))}function vc(e,t){return!t||!Array.isArray(e)||e.length===0?!1:e.some(e=>gc(e?.extraData?.[t]))}function yc(e,t,n){let r=e?.extraData?.[t];if(!gc(n))return r===!0;let i=_c(n);return i.size===0?r===!0:i.has(hc(r))}function bc(e,t){let n=new Map;return(Array.isArray(e)?e:[]).forEach(e=>{let r=hc(e?.value);r&&n.set(r,hc(e?.extraData?.[t]))}),n}function xc(e,t,n){let r=hc(n);if(!r)return!1;let i=new Set,a=hc(e);if(!a)return!1;i.add(a);for(let e=0;e<pc;e+=1){let e=t.get(a);if(!e)return!1;if(e===r)return!0;if(i.has(e))return!1;i.add(e),a=e}return!1}function Sc(e={}){let t=[],n=e=>{let n=String(e??``).trim();n&&!t.includes(n)&&t.push(n)};return(Array.isArray(e.extraFields)?e.extraFields:[]).forEach(n),n(e.optionsRequireExtraField),n(e.optionsHierarchyParentField),t}function Cc(e,t={},n={}){if(!Array.isArray(e)||e.length===0)return e;let r=n.source?`[${n.source}]`:`[optionRowFilters]`,i=t.field??t.label??`(unnamed field)`,a=typeof n.warn==`function`?n.warn:e=>{typeof console<`u`&&console.warn(e)},o=e,s=String(t.optionsRequireExtraField??``).trim();s&&(vc(o,s)?o=o.filter(e=>yc(e,s,t.optionsRequireExtraValue)):a(`${r} "${i}": option filter SKIPPED — no option carried extraData["${s}"], so the value filter could not be applied (the lookup API returned no such extra field). Showing the unfiltered list; this is NOT "nothing matched".`));let c=String(t.optionsHierarchyParentField??``).trim();if(c){let n=String(t.optionsHierarchySelfFrom??``).trim()||`currentUserId`,s=mc(n);if(!s)a(`${r} "${i}": hierarchy filter SKIPPED — identity "${n}" could not be resolved (no signed-in user id available). Showing the list unrestricted by reporting line.`);else if(!vc(e,c))a(`${r} "${i}": hierarchy filter SKIPPED — no option carried extraData["${c}"], so the reporting chain could not be walked (the lookup API returned no such extra field). Showing the list unrestricted by reporting line; this is NOT "nobody reports to you".`);else{let t=bc(e,c);o=o.filter(e=>xc(e?.value,t,s))}}return o}var wc=`coursemodules.moduleTitle`,Tc=e=>String(e??``).trim(),Ec=e=>Tc(e).toLowerCase();function Dc(e={}){return Tc(e.lookupCollection)===`course_module`&&Tc(e.displayField)===`coursemodules.lessons.lessonTitle`&&Tc(e.lookupFilterField)===`coursemodules.moduleTitle`}function Oc(e,t=[]){let n=Array.isArray(t)?[...t]:[];return Dc(e)&&!n.includes(`coursemodules.moduleTitle`)&&n.push(wc),n}function kc(e,t,n,r={}){if(!Dc(t)||!Array.isArray(e)||e.length===0||!e.some(e=>Array.isArray(e?.value)))return e;let i=Ec(n);if(!i)return[];let a=e.filter(e=>Ec(e?.extraData?.[wc])===i);if(a.length===0){let e=r.source?`[${r.source}]`:`[courseModuleLessonLookup]`;return typeof console<`u`&&console.warn(`${e} Lesson lookup received grouped arrays but no row was tagged with selected module "${Tc(n)}". The request must include extraFields=${wc}. Returning no lessons instead of showing lessons from the wrong module.`),[]}let o=[],s=new Set;for(let e of a){let t=Array.isArray(e?.value)?e.value:[];for(let e of t){let t=Tc(e);if(!t)continue;let n=t.toLowerCase();s.has(n)||(s.add(n),o.push({label:t,value:t}))}}return o}var Ac=e=>e==null||String(e).trim()===``,jc=e=>e===!0||e===1||e===`1`||e===`true`;function Mc(e){return Ac(e?.tooltip)?jc(e?.infoEnabled)&&!Ac(e?.infoText)?String(e.infoText):``:String(e.tooltip)}var Nc=Symbol(`parentFilterUnseen`),Pc=e=>e==null||e===``,Fc=(e,t)=>String(e??``)===String(t??``);function Ic({previous:e,next:t,currentValue:n,scoped:r=!0}){return!(!r||e===Nc||Fc(e,t)||Pc(e)||Pc(n))}function Lc(e){return e==null?!0:typeof e==`object`?Lc(e.permission??e.allowed??e.value):e!==!1&&e!==0&&e!==`0`}function Rc(e,t,n){if(!t||typeof e!=`function`)return!0;let[r,i]=String(t).split(`.`);return e(i?r:n||r,i??r)}function zc(e,t){if(!e)return!0;try{let n=JSON.parse(localStorage.getItem(`menuPermission`)||`{}`),[r,i]=String(e).split(`.`);return Lc((n[r||String(t||``).replace(/s$/i,``)]??n[String(t||``)]??n[String(t||``).replace(/s$/i,``)]??{})[i])}catch{return!0}}function Bc(e){return(e??[]).filter(e=>e?.afterSubmit?.mode).sort((e,t)=>(e.order??0)-(t.order??0))[0]?.afterSubmit??null}function Vc(e,t,n){let r=String(e??``).trim();return!r||!r.startsWith(`/`)||r.startsWith(`//`)||/^[a-z][a-z0-9+.-]*:/i.test(r)?null:r.replace(/:([A-Za-z_][\w]*)/g,(e,r)=>{let i=r===`id`?t:n?.[r];return encodeURIComponent(i??``)})}function Hc(e=typeof window<`u`?window:void 0){let t=e?.history?.state?.idx;return typeof t==`number`&&t>0}function Uc({cancelPath:e,cancelPathPriority:t=!1,fallbackPath:n=`/`,win:r=typeof window<`u`?window:void 0}={}){return t&&e?{path:e}:Hc(r)?{back:!0}:e?{path:e}:{path:n}}function Wc(e,t={}){let n=Uc(t);return n.back?e(-1):e(n.path),n}var{Text:Gc,Title:Kc}=a.Typography;function qc(e,t,n=new Map,r=new Set){if(e?.mergeInto&&!r.has(e.mergeInto)){let t=n.get(e.mergeInto);if(t){let i=new Set(r);return i.add(e.mergeInto),qc(t.group,t.index,n,i)}}return String((e?.linkGroup?`linked:${e.linkGroup}`:``)||e?.wizardStepKey||e?.name||e?.id||t)}function Jc(e=[]){let t=[],n=new Map,r=new Map(e.map((e,t)=>[e?.name,{group:e,index:t}])),i=(e,i)=>{let a=qc(e,i,r),o=n.get(a);o||(o={key:a,title:e?.wizardStepTitle||e?.label||`Step ${t.length+1}`,description:e?.wizardStepDescription||``,content:e?.wizardContent||{type:`form`},groups:[]},n.set(a,o),t.push(o)),o.groups.push(e)};return e.forEach((e,t)=>{(!e?.mergeInto||!r.has(e.mergeInto))&&i(e,t)}),e.forEach((e,t)=>{e?.mergeInto&&r.has(e.mergeInto)&&i(e,t)}),t}function Yc(e=[]){let t=e.filter(e=>!e?.mergeInto);return t.length<2||!t.some(e=>!e?.showIf?.field)||t.map(e=>String(e?.wizardStepKey??``).trim()).some(e=>!e)?!1:Jc(e).length>=2}function Xc(e=[]){return Yc(e)&&e.filter(e=>!e?.mergeInto).every(e=>e?.wizardEnabled===!0)}function Zc(e,t,n){return e.findIndex(e=>e.groups.includes(t)||e.groups.some((e,r)=>qc(e,r)===qc(t,n)))}function Qc(e){if(!e)return[];let t=[];e.groups.forEach(e=>{if(e?.addRow){e.name&&t.push([e.name]);return}(e?.fields??[]).forEach(e=>{!e?.field||e.show===0||e.show===!1||t.push(String(e.field).split(`.`).filter(Boolean))})});let n=String(e?.content?.selectionField??``).trim();return n&&t.push(n.split(`.`).filter(Boolean)),t}function $c(e,t){let n=(Array.isArray(t)?t:[t]).map(String),r=n.join(`.`);return e.findIndex(e=>String(e?.content?.selectionField??``)===r||e.groups.some(e=>e?.addRow&&String(e.name)===n[0]?!0:(e?.fields??[]).some(e=>{let t=String(e?.field??``);return t===r||t===n[0]})))}var el=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null);function tl(e,t){let n={...e};return Object.keys(t).forEach(e=>{let r=t[e];n[e]=el(r)&&el(n[e])?tl(n[e],r):r}),n}function nl(e,t){return tl(el(e)?e:{},el(t)?t:{})}function rl(){try{return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}catch{return!1}}function il(e,t){if(!e||!t||!(e.scrollWidth>e.clientWidth))return;let n=Math.max(0,t.offsetLeft-(e.clientWidth-t.offsetWidth)/2);typeof e.scrollTo==`function`?e.scrollTo({left:n,behavior:rl()?`auto`:`smooth`}):e.scrollLeft=n}function al({steps:e,current:t,onSelectCompleted:n,errorStep:r=-1}){let c=e[t],l=(0,i.useRef)(null),u=(0,i.useRef)(null),d=(0,i.useRef)(t);return(0,i.useEffect)(()=>{d.current!==t&&l.current?.focus(),d.current=t},[t]),(0,i.useEffect)(()=>{let e=u.current;il(e,e?.children?.[t])},[t,e.length]),e.length?(0,s.jsxs)(`section`,{className:`v1-form-wizard`,"aria-label":`Form progress`,children:[(0,s.jsx)(`ol`,{ref:u,className:`v1-form-wizard__steps`,children:e.map((i,c)=>{let l=c<t,u=c===t,d=c===r;return(0,s.jsx)(`li`,{className:`v1-form-wizard__step${u?` is-active`:``}${l?` is-complete`:``}${d?` is-error`:``}`,children:(0,s.jsxs)(a.Button,{type:`text`,className:`v1-form-wizard__step-button`,"aria-current":u?`step`:void 0,"aria-label":`${i.title}, step ${c+1} of ${e.length}${d?`, needs attention`:``}`,disabled:!l||!n,onClick:()=>l&&n?.(c),children:[(0,s.jsx)(`span`,{className:`v1-form-wizard__marker`,"aria-hidden":`true`,children:d?(0,s.jsx)(o.ExclamationOutlined,{}):l?(0,s.jsx)(o.CheckOutlined,{}):c+1}),(0,s.jsx)(`span`,{className:`v1-form-wizard__label`,children:i.title})]})},i.key)})}),(0,s.jsxs)(`div`,{ref:l,className:`v1-form-wizard__heading`,tabIndex:-1,children:[(0,s.jsxs)(Gc,{type:`secondary`,children:[`Step `,t+1,` of `,e.length]}),(0,s.jsx)(Kc,{level:3,children:c?.title}),c?.description&&(0,s.jsx)(Gc,{type:`secondary`,children:c.description})]},c?.key??t)]}):null}function ol(e){return(0,s.jsx)(a.Button,{icon:(0,s.jsx)(o.LeftOutlined,{}),...e,children:`Back`})}function sl(e){return(0,s.jsxs)(a.Button,{type:`primary`,...e,children:[`Next `,(0,s.jsx)(o.RightOutlined,{})]})}var cl=`test-flows`,ll=[{value:`module`,label:`Module`,isVisible:!0,type:`text`},{value:`flow`,label:`Flow`,isVisible:!0,type:`text`},{value:`step_order`,label:`Step Order`,isVisible:!0,type:`number`},{value:`keyword`,label:`Action`,isVisible:!0,type:`text`},{value:`description`,label:`Description`,isVisible:!0,type:`text`},{value:`target`,label:`Key`,isVisible:!0,type:`text`},{value:`tags`,label:`Tags`,isVisible:!0,type:`text`},{value:`value`,label:`Value`,isVisible:!0,type:`text`},{value:`expected`,label:`Expected`,isVisible:!0,type:`text`}],ul=`lms-flows`,dl=[{value:`module`,label:`Module`,isVisible:!0,type:`text`},{value:`flow`,label:`Flow`,isVisible:!0,type:`text`},{value:`step_order`,label:`Step Order`,isVisible:!0,type:`number`},{value:`keyword`,label:`Action`,isVisible:!0,type:`text`},{value:`description`,label:`Description`,isVisible:!0,type:`text`},{value:`target`,label:`Key`,isVisible:!0,type:`text`},{value:`tags`,label:`Tags`,isVisible:!0,type:`text`},{value:`value`,label:`Value`,isVisible:!0,type:`text`},{value:`expected`,label:`Expected`,isVisible:!0,type:`text`}];async function fl({jobId:e,limit:n=10,offset:r=0,sortBy:i=`new`,type:a=`myVendor`}){return await xl(t.w,`/vendor/hotlist`,{method:`POST`,body:JSON.stringify({jobId:e,limit:n,offset:r,sortBy:i,type:a})})}async function pl(e){let n=await xl(t.C,`/get-bulkmail-details?jobId=${encodeURIComponent(e)}`);return n.data??n}async function ml(e,n=``){let r=String(e??``).trim();if(!r)return``;let i=await xl(t.T,`/format-mail-content`,{method:`POST`,body:JSON.stringify({contents:r,subject:String(n??``)})});if(i?.status===!1)throw Error(i?.error||`Unable to format mail content`);return String(i?.html??i?.contents??i?.data?.html??i?.data?.contents??``).trim()}async function hl({jobId:e,leadId:n,toMail:r,ccMail:i,bccMail:a,subject:o,contents:s,attachments:c=[]}){let l=!!n&&!e,u=localStorage.getItem(`tenantId`)||`93c782a4aa626175e5d11afa`,d=localStorage.getItem(`businessId`)||`83c782a4aa626175e5d11afa`,f=localStorage.getItem(`businessUnitId`)||`63b57588fd768a839dbc0f63`,p=new FormData;p.append(`json`,JSON.stringify(l?{leadId:n,toMail:r,ccMail:i,bccMail:a,contents:s,subject:o}:{schemaVersion:1,tenantId:u,businessId:d,businessUnitId:f,jobId:e,toMail:r,ccMail:i,bccMail:a,contents:s,subject:o})),(c??[]).forEach(e=>{e instanceof File&&p.append(l?`attachment`:`attachments`,e,e.name)});let{"Content-Type":m,...h}=await bl(),g=String(l?t.S:t.C);if(!g)throw Error(`${l?`VITE_AUTH_URL`:`VITE_CANDIDATES_URL`} is not configured`);let _=await fetch(`${g}/send-bulkmail`,{method:`POST`,headers:h,body:p});_.status===401&&gl();let v=await _.text(),y={};try{y=v?JSON.parse(v):{}}catch{}if(!_.ok||l&&y?.status===!1)throw Error(y?.error||(typeof y?.data==`string`?y.data:``)||`API ${_.status}: ${_.statusText}`);return y}function gl(){t.g()}function _l(e=``){let t=String(e??``).trim();return t===`myJobs`||t===`allJobs`||t===`fulfilled`?t:``}function vl(e){let t=String(ar(e)??``).trim().toLowerCase();return t===`job`||t===`jobs`}async function yl(){return t.a()}async function bl(){return{"Content-Type":`application/json`,Authorization:`Bearer ${await yl()}`}}async function xl(e,n,r={}){return t.o(e,n,r)}async function Sl(e,t){let n=await xl(e,t);return n.data??n}async function Cl(e){return Sl(t.E,e)}async function wl(e){return Sl(t.S,e)}async function Tl(e){return e===cl?ll:e===ul?dl:Cl(`/filter-dropdown-fields?module=${encodeURIComponent(ar(e))}`)}async function El(e,{configType:t,userId:n,roleId:r,view:i}={}){if(e===cl)return ll;if(e===ul)return dl;let a=new URLSearchParams({module:ar(e)});return t&&a.set(`configType`,t),i&&a.set(`view`,String(i)),n!=null&&a.set(`userId`,String(n)),r!=null&&a.set(`roleId`,String(r)),wl(`/admin/field-config?${a}`)}async function Dl({limit:e=10,offset:t=0,search:n=``,module:r=``,keyword:i=``,tags:a=``,active:o}={}){let s=new URLSearchParams({limit:String(e),offset:String(t)});return n&&s.append(`search`,n),r&&s.append(`module`,r),i&&s.append(`keyword`,i),a&&s.append(`tags`,a),o!=null&&o!==``&&s.append(`active`,String(o)),wl(`/test-flows?${s.toString()}`)}async function Ol({limit:e=10,offset:t=0,search:n=``,module:r=``,keyword:i=``,tags:a=``,active:o}={}){let s=new URLSearchParams({limit:String(e),offset:String(t)});return n&&s.append(`search`,n),r&&s.append(`module`,r),i&&s.append(`keyword`,i),a&&s.append(`tags`,a),o!=null&&o!==``&&s.append(`active`,String(o)),wl(`/lms-flows?${s.toString()}`)}async function kl(e,n=10,r=0,i={}){let{scope:a=``,sort:o=``,sortDir:s=``,search:c=``,filters:l=[],queryParams:u={},scopeConditions:d=[]}=i;if(e===cl){let e=await Dl({limit:n,offset:r}),t=Array.isArray(e?.items)?e.items:[],i=Number(e?.total)||0;return{items:t,total:i,limit:n,offset:r,tabs:[{key:`all`,title:`Test Cases`,count:i}]}}if(e===ul){let e=await Ol({limit:n,offset:r}),t=Array.isArray(e?.items)?e.items:[],i=Number(e?.total)||0;return{items:t,total:i,limit:n,offset:r,tabs:[{key:`all`,title:`LMS Cases`,count:i}]}}let f=new URLSearchParams({module:ar(e),limit:String(n),offset:String(r)}),p=vl(e)?_l(a):String(a??``).trim();p&&f.set(`scope`,p),o&&f.set(`sort`,o),s&&f.set(`sortDir`,s),String(c??``).trim()&&f.set(`search`,String(c).trim());let m=[...Fl(l.filter(e=>e?.field)),...Array.isArray(d)?d.filter(e=>e?.field):[]];m.length&&f.set(`filters`,JSON.stringify(m)),Object.entries(u??{}).forEach(([e,t])=>{t!=null&&String(t).trim()!==``&&f.set(e,String(t))});let h=await xl(t.S,`/module-data-list?${f.toString()}`),g=Al(h),_=g.some(e=>Nl(e)),v=g.some(e=>Pl(e));if(_||v)try{let{transformDiceResponseToInternalFormat:e}=await Promise.resolve().then(()=>require("./diceCandidateMapper-BjMhHno3.cjs")).then(e=>e.t),t=e(h,h),i=t?.data?.data??[];return{items:i,total:Ml(h,p)||Ml(t,p)||i.length,limit:n,offset:r,tabs:t?.data?.tabs??h?.tabs??h?.data?.tabs??[],fields:t?.data?.fields??h?.fields??h?.data?.fields??[],tabField:t?.data?.tabField??h?.tabField??h?.data?.tabField??``,actionRules:t?.data?.actionRules??h?.data?.actionRules??[],actions:t?.data?.actions??h?.data?.actions??[],columnActions:t?.data?.columnActions??h?.data?.columnActions??[]}}catch(e){console.error(`[getModuleDataList] Dice transformation failed:`,e)}return h}function Al(e){let t=e?.data??e,n=Array.isArray(t)?t:t?.rows??t?.records??t?.items??t?.list??t?.data??e?.items??e?.records??[];return Array.isArray(n)?n:[]}function jl(...e){for(let t of e){let e=Number(t);if(Number.isFinite(e))return e}}function Ml(e,t=``){let n=e?.data??e,r=Al(e),i=e?.count,a=n?.count,o=String(t??``).trim().toLowerCase();if(i&&typeof i==`object`){let e=jl(o?i[o]:void 0,i.total,i.searchCount,i.count);if(e!==void 0)return e}if(a&&typeof a==`object`){let e=jl(o?a[o]:void 0,a.total,a.searchCount,a.count);if(e!==void 0)return e}return jl(e?.total,typeof i==`object`?void 0:i,e?.totalCount,n?.total,typeof a==`object`?void 0:a,n?.totalCount,r.length)??0}function Nl(e){let t=e?.skills??e?.technicalSkills??e?.primarySkills;return!Array.isArray(t)||t.length===0?!1:t.some(e=>e&&typeof e==`object`&&(`skill`in e||`lastUsed`in e))}function Pl(e){return[e?.sourceType,e?.profileSource,e?.selectedSource,e?.customFields?.sourceType,e?.customFields?.profileSource].flat().some(e=>String(e??``).trim().toLowerCase()===`dice`)||!!e?.customFields?.diceProfileData}function Fl(e){let t=[];for(let n of e){if(!n.field)continue;let e=n.operator===`or`?`or`:`and`;if(n.operator===`isEmpty`){t.push({field:n.field,op:`isEmpty`,operator:`and`});continue}if(n.operator===`notEmpty`){t.push({field:n.field,op:`notEmpty`,operator:`and`});continue}if(n.filterInputType===`text`){let r=typeof n.value==`string`?n.value.trim():``;r&&t.push({field:n.field,op:`contains`,value:r,operator:e});continue}if(n.from||n.to){n.from&&t.push({field:n.field,op:`gte`,value:String(n.from),operator:e}),n.to&&t.push({field:n.field,op:`lte`,value:String(n.to),operator:`and`});continue}Array.isArray(n.values)&&n.values.length>0&&t.push({field:n.field,op:`in`,values:n.values.map(String),operator:e,...Array.isArray(n.groupFields)&&n.groupFields.length>1?{groupFields:n.groupFields}:{}})}return t}async function Il(e,t,n=``,r={}){let{limit:i=50,offset:a=0,dataSource:o,groupName:s,lookup:c,groupFields:l=[],groupSeparator:u=` `,scopeConditions:d=[]}=r,f=new URLSearchParams({module:ar(e),field:t,value:n,limit:String(i),offset:String(a)});o&&f.set(`dataSource`,o),Array.isArray(l)&&l.length>1&&(f.set(`groupFields`,l.join(`,`)),f.set(`groupSeparator`,u??` `)),o===`group`&&s&&f.set(`groupName`,s),o===`lookup`&&c?.collection&&(f.set(`lookupCollection`,c.collection),c.displayField&&f.set(`lookupField`,c.displayField));let p=Array.isArray(d)?d.filter(e=>e?.field):[];return p.length&&f.set(`filters`,JSON.stringify(p)),Cl(`/filter-dropdown-values?${f}`)}function Ll(e){let t=e?.data??e,n=Array.isArray(t)?t:Array.isArray(t?.groups)?t.groups:Array.isArray(e?.groups)?e.groups:[],r=t?.recordMeta??e?.recordMeta;r&&typeof r==`object`&&(n.recordMeta=r);let i=t?.detailHeader??e?.detailHeader;return i&&typeof i==`object`&&(n.detailHeader=i),n}async function Rl({module:e,id:n,view:i}={}){if(!e)throw Error(`module is required to fetch form groups`);let a=await bl(),o=new URLSearchParams({module:e});n&&o.set(`id`,String(n)),i&&o.set(`view`,String(i));let s=`${t.S}/admin/form-groups?${o.toString()}`;return Ll(await r.t(s,async()=>{let e=await fetch(s,{method:`GET`,headers:a});if(!e.ok)throw Error(`API ${e.status}: ${e.statusText}`);return e.json()}))}async function zl({searchQuery:e,candidateId:n}){let r=localStorage.getItem(`tenantId`)||`93c782a4aa626175e5d11afa`,i=localStorage.getItem(`businessId`)||`83c782a4aa626175e5d11afa`,a=localStorage.getItem(`businessUnitId`)||`63b57588fd768a839dbc0f63`,o=Number(localStorage.getItem(`userId`))||1;return xl(t.w,`/joblist`,{method:`POST`,body:JSON.stringify({tenantId:r,businessId:i,businessUnitId:a,searchQuery:e,userId:o,candidateId:Array.isArray(n)?n:[n]})})}async function Bl(e=``){let n=e?`?search=${encodeURIComponent(e)}`:``;return Sl(t.w,`/users/any${n}`)}function Vl(e){if(!e||typeof e!=`string`)return null;try{let t=e.split(`.`)[1];if(!t)return null;let n=t.replace(/-/g,`+`).replace(/_/g,`/`),r=n.padEnd(Math.ceil(n.length/4)*4,`=`);return JSON.parse(atob(r))}catch{return null}}function Hl(){return Vl(localStorage.getItem(`access_token`)||localStorage.getItem(`authToken`))??{}}function Ul(){let e=Hl();return{userId:e.userId??e.user_id??e.USER_ID,roleId:e.roleId??e.role_id??e.ROLE_ID}}function Wl(){let e=Ul();return{userId:e.userId??localStorage.getItem(`userId`)??void 0,roleId:e.roleId??localStorage.getItem(`roleId`)??void 0}}function Gl(e){let[t,n]=(0,i.useState)([]),[r,a]=(0,i.useState)(!1),[o,s]=(0,i.useState)(null);return(0,i.useEffect)(()=>{if(!e)return;let t=!1;return a(!0),s(null),Tl(e).then(e=>{t||n(Array.isArray(e)?e:[])}).catch(e=>{t||s(e.message)}).finally(()=>{t||a(!1)}),()=>{t=!0}},[e]),{fields:t,loading:r,error:o}}function Kl(e){let[t,n]=(0,i.useState)(null),[r,a]=(0,i.useState)(!1),[o,s]=(0,i.useState)(null);return(0,i.useEffect)(()=>{if(!e)return;let t=!1;return a(!0),s(null),El(e).then(e=>{t||n(Array.isArray(e)?e:null)}).catch(e=>{t||s(e.message)}).finally(()=>{t||a(!1)}),()=>{t=!0}},[e]),{config:t,loading:r,error:o}}function ql(e,{view:t=``}={}){let[n,r]=(0,i.useState)([]),[a,o]=(0,i.useState)(!1),[s,c]=(0,i.useState)(null);return(0,i.useEffect)(()=>{if(!e)return;let n=!1;o(!0),c(null);let{userId:i,roleId:a}=Wl(),s=e=>{let t=e?.isVisible??e?.is_visible??e?.visible;return t==null?!0:typeof t==`boolean`?t:typeof t==`string`?![`false`,`0`,`no`,`hide`,`hidden`].includes(t.toLowerCase()):!!t},l=typeof t==`string`?t.trim():``;return(l?El(e,{configType:`filter`,roleId:a,view:l}).catch(()=>El(e,{configType:`filter`,userId:i,roleId:a})):El(e,{configType:`filter`,userId:i,roleId:a})).then(async t=>{let n=(Array.isArray(t)?t:t?.visibleFields??[]).filter(s);if(n.length>0)return n;let r=await Tl(e);return Array.isArray(r)?r.filter(s):[]}).then(e=>{n||r(Array.isArray(e)?e:[])}).catch(e=>{n||c(e.message)}).finally(()=>{n||o(!1)}),()=>{n=!0}},[e,t]),{fields:n,loading:a,error:s}}var Jl=(0,i.createContext)({permissions:{},loading:!0});function Yl(e){return!!e?.[`*`]?.[`*`]}function Xl(e){return!e||typeof e!=`object`||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(([e])=>e!==`*`).map(([e,t])=>[e,Object.fromEntries(Object.entries(t??{}).map(([e,t])=>[e,+!!t]))]))}function Zl(e){if(!Yl(e))try{localStorage.setItem(`menuPermission`,JSON.stringify(Xl(e))),window.dispatchEvent(new Event(`menu:updated`))}catch{}}function Ql({children:e}){let[n,r]=(0,i.useState)({}),[a,o]=(0,i.useState)(!0),c=(0,i.useCallback)(()=>{let e=!1;try{e=!!t.u()}catch{e=!1}if(!e){r({}),o(!1);return}o(!0),Rt().then(e=>{let t=e??{};r(t),Zl(t)}).catch(()=>r({})).finally(()=>o(!1))},[]);return(0,i.useEffect)(()=>(c(),window.addEventListener(`auth:login`,c),window.addEventListener(`auth:logout`,c),window.addEventListener(`auth:token-refreshed`,c),window.addEventListener(`permissions:changed`,c),window.addEventListener(`storage`,c),()=>{window.removeEventListener(`auth:login`,c),window.removeEventListener(`auth:logout`,c),window.removeEventListener(`auth:token-refreshed`,c),window.removeEventListener(`permissions:changed`,c),window.removeEventListener(`storage`,c)}),[c]),(0,s.jsx)(Jl.Provider,{value:{permissions:n,loading:a,refresh:c},children:e})}Ql.propTypes={children:_.default.node};var $l={campaign:`campaingns`,campaigns:`campaingns`};function eu(e){return String(e??``).trim().toLowerCase()}function tu(e,t){let n=eu(e),r=eu(t);return!n||!r?!1:n===r||`${n}s`===r||`${r}s`===n}function nu(e){try{let t=localStorage.getItem(`menu`);if(!t)return null;let n=JSON.parse(t);if(!Array.isArray(n))return null;let r=n.find(t=>{let n=eu(t?.key);return n&&tu(e,n)});return r?eu(r.key):null}catch{return null}}function ru(e,t,n){if(!e||typeof e!=`object`||Array.isArray(e)||!t)return{found:!1,permissions:{}};let r=eu(t),i=$l[r]??r,a=nu(r),o=[...(n?.[r]??[]).map(eu),i,a,r].filter(Boolean),s=Object.keys(e),c=s.find(e=>o.some(t=>eu(e)===t))??s.find(e=>o.some(t=>tu(t,e)));return{found:!!c,permissions:c?e[c]??{}:{}}}function iu(e,t){try{let n=localStorage.getItem(`menuPermission`);return n?ru(JSON.parse(n),e,t).permissions:{}}catch{return{}}}function au(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`value`)?e.value:e}function ou(e){let t=au(e);return t==null||t===!0||t===1||t===`1`||String(t).trim().toLowerCase()===`true`}function su(e){let t=au(e);return t==null?!1:t===!0||t===1||t===`1`||String(t).trim().toLowerCase()===`true`}function cu(e,t){if(!e||typeof e!=`object`)return;if(Object.prototype.hasOwnProperty.call(e,t))return e[t];let n=eu(t),r=Object.keys(e).find(e=>eu(e)===n);return r?e[r]:void 0}function lu(e,t,n,r){if(!n||e?.[`*`]?.[`*`])return!0;let i=r?.aliases,a=ru(e,n,i),o=!t&&a.found?a.permissions:iu(n,i);return r?.strict?su(cu(o,`view`)):ou(cu(o,`view`))}function uu(e){let{permissions:t,loading:n}=(0,i.useContext)(Jl),r=e?.strict===!0,a=e?.aliases;return(0,i.useCallback)(e=>lu(t,n,e,{strict:r,aliases:a}),[t,n,r,a])}function du(e,t){let{permissions:n,loading:r}=(0,i.useContext)(Jl),a=t?.strict===!0,o=t?.aliases;return(0,i.useMemo)(()=>{let t=!!n?.[`*`]?.[`*`],i=ru(n,e,o),s=!r&&i.found?i.permissions:iu(e,o);if(t)return{canView:!0,canAdd:!0,canEdit:!0,canDelete:!0,canApprove:!0,canReject:!0,canReApprove:!0,canSendApprove:!0};let c=a?su:ou;return{canView:c(cu(s,`view`)),canAdd:c(cu(s,`add`)),canEdit:c(cu(s,`edit`)),canDelete:c(cu(s,`delete`)),canApprove:c(cu(s,`approve`)),canReject:c(cu(s,`reject`)),canReApprove:su(cu(s,`reApprove`)),canSendApprove:su(cu(s,`sendApprove`))}},[e,n,r,a,o])}function fu(e){return String(e??``).trim().toLowerCase()}function pu(e,t){let n=fu(e),r=fu(t);return!n||!r?!1:n===r||`${n}s`===r||`${r}s`===n}function mu(e,t){if(!e||typeof e!=`object`||Array.isArray(e))return null;let n=Object.keys(e).find(e=>pu(e,t));return n?e[n]:null}function hu(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`value`)?e.value:e}function gu(e,t=!1){let n=hu(e);return n==null?t:n===!0||n===1||n===`1`||String(n).trim().toLowerCase()===`true`}function _u(e,t){if(!e||typeof e!=`object`)return;if(Object.prototype.hasOwnProperty.call(e,t))return e[t];let n=fu(t),r=Object.keys(e).find(e=>fu(e)===n);return r?e[r]:void 0}function vu(e,t){try{return gu(_u(mu(JSON.parse(localStorage.getItem(`menuPermission`)||`{}`),e),t),!0)}catch{return!0}}function yu(){let{permissions:e,loading:t}=(0,i.useContext)(Jl);return{can:(0,i.useCallback)((n,r)=>{if(e?.[`*`]?.[`*`])return!0;let i=mu(e,n);return i?gu(_u(i,r),!1):(t||Object.keys(e??{}).length,vu(n,r))},[e,t]),permissions:e,loading:t}}function bu(e){return[e?.key,e?.label,e?.name].filter(Boolean).join(` `).trim().toLowerCase()}function xu(e){let t=String(e?.permissionKey??``).trim().toLowerCase();if([`add`,`edit`,`delete`].includes(t))return t;if(e?.danger)return`delete`;let n=bu(e);return/(^|[\s_-])edit([\s_-]|$)/.test(n)?`edit`:/(^|[\s_-])(add|create)([\s_-]|$)/.test(n)?`add`:null}function Su(e,t){if(e!=null)return t.length===0?e:Array.isArray(e)?e.map(e=>Su(e,t)).filter(e=>e!=null).flat():Su(e[t[0]],t.slice(1))}function Cu(e,t){if(!t||typeof t!=`string`||!e)return;if(t in e)return e[t];let n=Su(e,t.split(`.`));if(n!==void 0&&!(Array.isArray(n)&&n.length===0))return n;let r=t.split(`.`).pop();return r===t?void 0:e[r]}function wu(){try{return typeof localStorage<`u`?localStorage.getItem(`userId`)??``:``}catch{return``}}var Tu={"{currentuserid}":wu,"{currentuser}":wu,"{me}":wu};function Eu(e){let t=Tu[String(e??``).trim().toLowerCase()];return t?t():e}function Du(e){return String(e??``).trim().toLowerCase()}function Ou(e){return Du(e).replace(/[^a-z0-9]/g,``)}function ku(e,t){return e===t||Ou(e)===Ou(t)}function Au(e){return e==null||e===``||Array.isArray(e)&&e.length===0}function ju(e){return(Array.isArray(e)?e:String(e??``).split(/[,|\n]/)).map(Du).filter(e=>e!==``)}var Mu={list:`list`,detail:`detail`,quickView:`quickView`};function Nu(e){let t=Ou(e);return t===`list`?`list`:t===`detail`?`detail`:t===`quickview`?`quickView`:``}function Pu(e,t){let n=Array.isArray(e?.appliesTo)?e.appliesTo.map(Nu).filter(Boolean):[];return n.length===0||n.includes(Nu(t))}function Fu(e,t,n){let r=e?.operator,i=r===`scope`?n:Cu(t,e?.field),a=Eu(e?.value),o=Du(i),s=Du(a);if(r===`eq`||r===`scope`)return ku(o,s);if(r===`ne`)return!ku(o,s);if(r===`isEmpty`)return Au(i);if(r===`notEmpty`)return!Au(i);if(r===`fieldEq`)return ku(o,Du(Cu(t,e?.compareField)));if(r===`includes`||r===`notIncludes`){let e=(Array.isArray(i)?i:[i]).some(e=>ku(Du(e),s))&&s!==``;return r===`includes`?e:!e}if(r===`in`||r===`notIn`){let e=ju(a),t=Array.isArray(i)?i:[i],n=e.length>0&&t.some(t=>e.some(e=>ku(Du(t),e)));return r===`in`?n:!n}return r===`contains`?Array.isArray(i)?i.some(e=>Du(e).includes(s)):o.includes(s):!1}function Iu(e,t,n,r){if(!e||e.isActive===!1||!Pu(e,r))return!1;let i=e.conditions??[];return i.length?i.every(e=>Fu(e,t,n)):!1}function Lu(e){let t=e?.allowedActions;return!Array.isArray(t)||t.length===0?null:t.map(String)}function Ru(e,t,n,r,i){let a=Array.isArray(n)?n:[];if(!a.length)return!1;let o=String(e);return a.some(e=>{if(!Iu(e,t,r,i))return!1;let n=Lu(e);return n&&!n.some(e=>ku(e,o))?!0:(e?.blockedActions??[]).map(String).includes(o)})}function zu(e,t,n,r,i){let a=(Array.isArray(n)?n:[]).find(n=>(n?.disabledActions??[]).map(String).includes(String(e))&&Iu(n,t,r,i));return a?a.description||`${e} is temporarily unavailable`:null}function Bu(e,t,n,r){let i=(Array.isArray(t)?t:[]).find(t=>String(t?.primaryAction??``).trim()&&Iu(t,e,n,r));return i?String(i.primaryAction).trim():null}function Vu(e,t,n){let r=e?.doneWhen;return!r||!r.field||!Fu(r,t,n)?null:{label:e.doneLabel||e.label,tone:e.doneTone||`success`}}function Hu(e,t,n,r){let i=Array.isArray(t)?t:[];return i.length?i.some(t=>Ru(e,t,n,r)):!1}var Uu=e.t({actionRules:()=>Yu,actions:()=>Xu,columnActions:()=>Zu,default:()=>Qu,fields:()=>qu,rows:()=>Wu,synthesizeFieldsFromRows:()=>!0,tabField:()=>Ju,tabs:()=>Ku,total:()=>Gu,visibilityFlag:()=>null}),Wu={sources:[`payload`],paths:[`rows`,`records`,`items`,`list`,`data`]},Gu={sources:[`response`,`payload`],paths:[`total`,`count`,`totalCount`]},Ku={sources:[`response`,`payload`],paths:[`tabs`,`tabList`]},qu={sources:[`response`,`payload`],paths:[`fields`,`fieldConfig`]},Ju={sources:[`payload`],paths:[`tabField`]},Yu={sources:[`payload`],paths:[`actionRules`]},Xu={sources:[`payload`],paths:[`actions`]},Zu={sources:[`payload`],paths:[`columnActions`]},Qu={rows:Wu,total:Gu,tabs:Ku,fields:qu,tabField:Ju,actionRules:Yu,actions:Xu,columnActions:Zu,synthesizeFieldsFromRows:!0,visibilityFlag:null},$u=Object.assign({"../../config/responseMappings/default.json":Uu});function ed(e){if(!e)return null;for(let t of Object.keys($u))if(t.split(`/`).pop().replace(/\.json$/,``)===e){let e=$u[t];return e.default??e}return null}function td(e){let t=ed(e);return t?{...Qu,...t}:Qu}function nd(e,t){return String(t).split(`.`).reduce((e,t)=>e?.[t],e)}function rd(e,t,n){if(!n)return;let r={response:e,payload:t};for(let e of n.sources)for(let t of n.paths){let n=nd(r[e],t);if(n!==void 0)return n}}function id(...e){for(let t of e){let e=Number(t);if(Number.isFinite(e))return e}}function ad(e){return e.replace(/([A-Z])/g,` $1`).replace(/^./,e=>e.toUpperCase())}var od=/token|password|passwd|secret|apikey|api_key|auth|credential|salary|ssn|ein\b/i;function sd(e){return od.test(e)}function cd(e){let t=e[0];return t?Object.keys(t).filter(e=>!e.startsWith(`_`)&&!sd(e)&&typeof t[e]!=`object`).map(e=>({value:e,field:e,label:ad(e),isVisible:!0})):[]}function ld(e,t){return t?e.filter(e=>e[t]===1||e[t]===!0||e[t]===void 0).map(e=>({...e,isVisible:!0})):e}var ud=5e3,dd=300,fd=100,pd=100,md=300,hd=100;function gd(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function _d(e,t){return Array.isArray(e)?e.slice(0,t):[]}function vd(e,t){return _d(e,t).filter(gd)}function yd(e,t){return vd(e,t).filter(e=>typeof e.value==`string`||typeof e.field==`string`)}var bd=/^\s*(javascript|data|vbscript|file):/i,xd=[`url`,`href`,`routeUrl`,`routeURL`];function Sd(e){let t={...e};for(let e of xd)typeof t[e]==`string`&&bd.test(t[e])&&delete t[e];return t}function Cd(e,t){return vd(e,t).map(Sd)}function wd(e,t){return e.flatMap(e=>{let n=nd(e,t);return n==null?[]:(Array.isArray(n)?n:[n]).filter(e=>e!=null).map(e=>gd(e)?e:{value:e})})}function Td(e,t){if(!Array.isArray(t)||Array.isArray(e)||!gd(e))return;let n=[`actions`,`actionRules`,`columnActions`,`tabField`].filter(t=>e[t]!==void 0);n.length!==0&&console.warn(`[mapListResponse] response.data is an array, so ${n.join(`, `)} cannot be resolved from it. Send rows under "items" instead of "data", or pass the full envelope rather than the unwrapped payload.`)}function Ed(e,t){let{baseModule:n,nestedPath:r}=ir(t),i=td(n),a=e?.data??e;Td(e,a);let o=_d(Array.isArray(a)?a:rd(e,a,i.rows),ud);r&&(o=_d(wd(o,r),ud),console.log(`[mapListResponse] module "${n}" → nested path "${r}": ${o.length} row(s)`));let s=rd(e,a,i.total),c=gd(s)?id(s.total,s.searchCount,s.count):s,l=Number(c??o.length)||0,u=vd(rd(e,a,i.tabs),fd),d=r?[]:rd(e,a,i.fields),f=Array.isArray(d)?d:[];f.length===0&&(r||i.synthesizeFieldsFromRows)&&(f=cd(o)),f=yd(f,dd),i.visibilityFlag&&(f=ld(f,i.visibilityFlag));let p=rd(e,a,i.tabField);return{rows:o,total:l,tabs:u,fields:f,tabField:typeof p==`string`?p:``,actionRules:Cd(rd(e,a,i.actionRules),md),actions:Cd(rd(e,a,i.actions),pd),columnActions:Cd(rd(e,a,i.columnActions),hd)}}function Dd({items:e=[]}){let t=e.map((t,n)=>({title:n===e.length-1?(0,s.jsx)(V,{variant:`body`,weight:`medium`,color:`link`,children:t.label}):(0,s.jsxs)(d.Link,{to:t.href,children:[(0,s.jsx)(V,{variant:`body`,color:`secondary`,children:t.label}),t.dropdown&&(0,s.jsx)(o.DownOutlined,{})]})}));return(0,s.jsx)(a.Breadcrumb,{items:t})}var Od={jobs:{module:`jobs`,keys:[`jobRecruitmentStatus`,`jobStatus`],dateField:`createdAt`},candidates:{module:`candidates`,keys:[`candidateSummary`],items:[{key:`created`,label:`Created`,collection:`candidates`,countType:`documents`,dateField:`createdAt`},{key:`submitted`,label:`Submitted`,collection:`submissions`,countType:`distinct`,distinctField:`applicantId`,dateField:`submittedAt`},{key:`onboarded`,label:`Onboarded`,collection:`onboarding`,countType:`distinct`,distinctField:`candidateId`,dateField:`onboardingActivity.activityTime`,filters:{onboardingObStage:[`Completed`]}}]},submissions:{module:`submission`,keys:[`internalSubmissionStatus.internalSubmissionStatusText`,`clientSubmissionStatus.clientSubmissionStatusText`],dateField:`createdAt`}},kd={jobSummary:[{label:`Open`,field:`jobStatus`,keys:[`open`,`active`]},{label:`Partially Fulfilled`,field:`jobRecruitmentStatus`,keys:[`partially fulfilled`,`partiallyFulfilled`]},{label:`Fulfilled`,field:`jobRecruitmentStatus`,keys:[`fulfilled`]},{label:`In-active / Closed`,field:`jobStatus`,keys:[`closed`,`inactive`,`in-active`]}]};function Ad(e){return String(e??``).trim().toLowerCase()}function jd(e,t){return{label:e,count:Number.isFinite(Number(t))?Number(t):0}}function Md(e){return Array.isArray(e?.counts)?e.counts:[]}function Nd(e,t){return e?.key===t?e:(Array.isArray(e?.fields)?e.fields:[]).find(e=>e?.key===t)??{}}function Pd(e,t){let n=Array.isArray(t)?t:[t],r=Array.isArray(e?.counts)?e.counts:[],i=n.filter(Boolean).map(Ad),a=r.find(e=>[e?.key,e?.label].map(Ad).some(e=>i.includes(e)));if(a)return Number(a.count)||0;for(let t of n){let n=e?.[t];if(Number.isFinite(Number(n)))return Number(n)}return 0}function Fd(e,t){let n=(Array.isArray(t)?t:[t].filter(Boolean)).map(Ad);return Md(e).reduce((e,t)=>{let r=Ad(t?.key??t?.label);return n.includes(r)?e+(Number(t?.count)||0):e},0)}function Id(e){let t=Ad(e);return t.includes(`candidate`)?Od.candidates:t.includes(`submission`)?Od.submissions:t.includes(`job`)?Od.jobs:null}function Ld(e){return kd[e]??null}function Rd(e){return Array.isArray(e?.counts)||e?.openCount!==void 0||e?.myAssignedCount!==void 0?[jd(`Open`,Pd(e,[`openCount`,`open`])),jd(`Partially Fulfilled`,Pd(e,[`partiallyFulfilledCount`,`partially fulfilled`])),jd(`Fulfilled`,Pd(e,[`fulfilledCount`,`fulfilled`])),jd(`In-active / Closed`,Pd(e,[`closedCount`,`closed`,`inactive`,`in active`]))]:(Ld(`jobSummary`)??[]).map(t=>{let n=Nd(e,t.field);return jd(t.label,Fd(n,t.keys??[]))})}function zd(e){return Md(e).map(({label:e,key:t,count:n})=>jd(e||t,n))}function Bd(e){let t=Array.isArray(e?.fields)?e.fields:[],n=t.find(e=>e.key===`clientSubmissionStatus.clientSubmissionStatusText`)??{},r=t.find(e=>e.key===`internalSubmissionStatus.internalSubmissionStatusText`)??{},i=e=>Array.isArray(e.counts)?e.counts.map(({label:e,count:t})=>jd(e,t)):[],a=Number(n.total)||0,o=Number(r.total)||0;return{total:a+o,clientCount:a,internalCount:o,clientBreakdown:i(n),internalBreakdown:i(r)}}var{RangePicker:Vd}=a.DatePicker,Hd=[{value:`today`,label:`Today`},{value:`yesterday`,label:`Yesterday`},{value:`last-7-days`,label:`Last 7 Days`},{value:`last-30-days`,label:`Last 30 Days`},{value:`this-month`,label:`This Month`},{value:`last-month`,label:`Last Month`},{value:`custom-range`,label:`Custom Range`}];function Ud(e){return e.closest(`.view-summary-card`)??document.body}function Wd(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function Gd(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function Kd(e){let t=new Date,n=new Date(t.getFullYear(),t.getMonth(),1),r=new Date(t.getFullYear(),t.getMonth()-1,1),i=new Date(t.getFullYear(),t.getMonth(),0);if(e===`today`)return{startDate:t,endDate:t};if(e===`yesterday`){let e=Gd(t,-1);return{startDate:e,endDate:e}}return e===`last-30-days`?{startDate:Gd(t,-29),endDate:t}:e===`this-month`?{startDate:n,endDate:t}:e===`last-month`?{startDate:r,endDate:i}:{startDate:Gd(t,-6),endDate:t}}function qd(e,t){if(e===`custom-range`){let[e,n]=t??[];return!e||!n?null:{startDate:e.format(`YYYY-MM-DD`),endDate:n.format(`YYYY-MM-DD`)}}let n=Kd(e);return{startDate:Wd(n.startDate),endDate:Wd(n.endDate)}}function Jd(e){return String(e??``).trim().toLowerCase()}function Yd(e){return String(e??``).replace(/[-_]+/g,` `).replace(/\s+/g,` `).trim().replace(/\b\w/g,e=>e.toUpperCase())}function Xd(e){let t=Jd(e);return t.includes(`candidate`)?`Candidate`:t.includes(`submission`)?`Submission`:t.includes(`job`)?`Job`:Yd(e||`List`)}function Zd(e){return e?.data??e}function Qd(e,t){let n={module:e.module,dateRange:{startDate:t.startDate,endDate:t.endDate}};return e.summary&&(n.summary=e.summary),Array.isArray(e.items)&&e.items.length>0&&(n.items=e.items),Array.isArray(e.keys)&&e.keys.length>0&&(n.keys=e.keys),e.dateField&&(n.dateRange.key=e.dateField),n}function $d({moduleName:e,open:t,onClose:n}){let r=Xd(e),c=Jd(e),l=c.includes(`submission`),u=c.includes(`job`),d=c.includes(`candidate`),f=Id(e),p=l?`last-30-days`:`last-7-days`,[m,h]=(0,i.useState)(p),[g,_]=(0,i.useState)(null),[v,y]=(0,i.useState)(null),[x,S]=(0,i.useState)(null),[C,w]=(0,i.useState)(null),[T,E]=(0,i.useState)(``),D=Rd(v),O=zd(x),k=Bd(C),A=Math.max(k.total,1),ee=Math.round(k.internalCount/A*100),te=Math.max(0,100-ee),ne=m===`custom-range`;return(0,i.useEffect)(()=>{t&&(h(p),_(null))},[p,t]),(0,i.useEffect)(()=>{if(!t||!f)return;let e=qd(m,g);if(!e)return;let n=!1;return E(``),b(Qd(f,e)).then(e=>{if(n)return;let t=Zd(e);if(u){y(t),S(null),w(null);return}if(d){S(t),y(null),w(null);return}w(t),y(null),S(null)}).catch(e=>{n||(y(null),S(null),w(null),E(e.message||`Could not load summary`))}),()=>{n=!0}},[g,d,u,l,t,m,f]),t?(0,s.jsxs)(`div`,{className:`view-summary-layer`,role:`presentation`,children:[(0,s.jsx)(`div`,{className:`view-summary-scrim`}),(0,s.jsxs)(a.Card,{"aria-label":`${r} summary`,bordered:!1,className:`view-summary-card view-summary-card--${l?`submission`:`simple`}`,children:[(0,s.jsx)(a.Button,{"aria-label":`Close summary`,className:`view-summary-close`,icon:(0,s.jsx)(o.CloseOutlined,{}),type:`text`,onClick:n}),(0,s.jsxs)(`header`,{className:`view-summary-header`,children:[(0,s.jsxs)(V,{className:`view-summary-title`,color:`primary`,size:`md`,tag:`h2`,variant:`h2`,weight:`medium`,children:[r,` Summary`]}),(0,s.jsx)(a.Select,{"aria-label":`Summary date range`,className:`view-summary-range`,popupClassName:`view-summary-range-dropdown`,getPopupContainer:Ud,popupMatchSelectWidth:!1,value:m,options:Hd,onChange:e=>{h(e),e!==`custom-range`&&_(null)}})]}),l?(0,s.jsxs)(s.Fragment,{children:[ne&&(0,s.jsx)(Vd,{allowClear:!0,className:`view-summary-custom-range view-summary-custom-range--full`,format:`MMM DD, YYYY`,getPopupContainer:Ud,placeholder:[`Start date`,`End date`],value:g,onChange:_}),(0,s.jsxs)(`section`,{className:`view-summary-submission-top`,"aria-label":`Submission totals`,children:[(0,s.jsxs)(`div`,{className:`view-summary-donut`,style:{"--summary-internal":`${ee}%`,"--summary-client":`${te}%`},children:[(0,s.jsx)(V,{color:`success`,size:`2xl`,tag:`span`,variant:`metric`,weight:`semibold`,children:k.total}),(0,s.jsx)(V,{color:`success`,size:`xs`,tag:`span`,variant:`caption`,weight:`semibold`,children:`Total`})]}),(0,s.jsxs)(`div`,{className:`view-summary-legend`,children:[(0,s.jsxs)(V,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,weight:`regular`,children:[(0,s.jsx)(`i`,{className:`view-summary-dot view-summary-dot--internal`}),`Internal`,(0,s.jsx)(V,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,weight:`regular`,children:k.internalCount})]}),(0,s.jsxs)(V,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,weight:`regular`,children:[(0,s.jsx)(`i`,{className:`view-summary-dot view-summary-dot--client`}),`Client`,(0,s.jsx)(V,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,weight:`regular`,children:k.clientCount})]})]})]}),(0,s.jsx)(`div`,{className:`view-summary-divider`}),(0,s.jsxs)(`section`,{className:`view-summary-breakdown`,children:[(0,s.jsx)(V,{className:`view-summary-subtitle`,color:`primary`,size:`md`,tag:`h3`,variant:`h4`,weight:`medium`,children:`Internal Breakdown`}),k.internalBreakdown.length>0?k.internalBreakdown.map(e=>(0,s.jsxs)(`div`,{className:`view-summary-row view-summary-row--bullet`,children:[(0,s.jsxs)(V,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,weight:`regular`,children:[(0,s.jsx)(`i`,{className:`view-summary-dot view-summary-dot--internal`}),e.label]}),(0,s.jsx)(V,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,weight:`regular`,children:e.count})]},`internal-${e.label}`)):(0,s.jsx)(V,{color:`muted`,size:`sm`,tag:`p`,variant:`body`,weight:`regular`,children:`No internal data found`}),(0,s.jsx)(V,{className:`view-summary-subtitle`,color:`primary`,size:`md`,tag:`h3`,variant:`h4`,weight:`medium`,children:`Client Breakdown`}),k.clientBreakdown.length>0?k.clientBreakdown.map(e=>(0,s.jsxs)(`div`,{className:`view-summary-row view-summary-row--bullet`,children:[(0,s.jsxs)(V,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,weight:`regular`,children:[(0,s.jsx)(`i`,{className:`view-summary-dot view-summary-dot--client`}),e.label]}),(0,s.jsx)(V,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,weight:`regular`,children:e.count})]},`client-${e.label}`)):(0,s.jsx)(V,{color:`muted`,size:`sm`,tag:`p`,variant:`body`,weight:`regular`,children:`No client data found`}),T&&(0,s.jsx)(V,{color:`danger`,size:`xs`,tag:`p`,variant:`caption`,children:T})]})]}):(0,s.jsxs)(`section`,{className:`view-summary-breakdown`,children:[(0,s.jsxs)(`div`,{className:`view-summary-section-head`,children:[(0,s.jsxs)(V,{className:`view-summary-section-title`,color:`primary`,size:`md`,tag:`h3`,variant:`h3`,weight:`medium`,children:[`All `,r]}),ne&&(0,s.jsx)(Vd,{allowClear:!0,className:`view-summary-custom-range`,format:`MMM DD, YYYY`,getPopupContainer:Ud,placeholder:[`Start date`,`End date`],value:g,onChange:_})]}),(0,s.jsx)(`div`,{className:`view-summary-divider`}),c.includes(`job`)&&(0,s.jsx)(V,{className:`view-summary-breakdown-title`,color:`primary`,size:`sm`,tag:`h4`,variant:`h4`,weight:`regular`,children:`Breakdown`}),(d?O:D).map(e=>(0,s.jsxs)(`div`,{className:`view-summary-row`,children:[(0,s.jsx)(V,{color:`muted`,size:`sm`,tag:`span`,variant:`body`,children:e.label}),(0,s.jsx)(V,{color:`primary`,size:`sm`,tag:`b`,variant:`body`,children:e.count})]},e.label)),T&&(0,s.jsx)(V,{color:`danger`,size:`xs`,tag:`p`,variant:`caption`,children:T})]})]})]}):null}function ef(e){let[t,n]=(0,i.useState)({}),[r,a]=(0,i.useState)(new Set),o=(0,i.useRef)({}),s=(e,t)=>{a(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})};return{valuesByField:t,loadingFields:r,fetchValues:(0,i.useCallback)((t,r=``,i={})=>{if(!t||!e)return;o.current[t]&&clearTimeout(o.current[t]);let a=r?300:0;o.current[t]=setTimeout(async()=>{s(t,!0);try{let a=await Il(e,t,r,i),o=Array.isArray(a)?a.map(e=>({label:String(e.label),value:e.value})):[];n(e=>({...e,[t]:o}))}catch{}finally{s(t,!1)}},a)},[e])}}var tf=[{label:`Last 7 days`,getDates:()=>[(0,c.default)().subtract(6,`day`),(0,c.default)()]},{label:`This month`,getDates:()=>[(0,c.default)().startOf(`month`),(0,c.default)()]},{label:`Overdue`,getDates:()=>[null,(0,c.default)().subtract(1,`day`)]}];function nf({value:e,onChange:t,disabled:n}){return(0,s.jsxs)(a.Flex,{vertical:!0,gap:4,children:[(0,s.jsx)(a.DatePicker.RangePicker,{value:e,onChange:t,disabled:n,style:{width:`100%`},allowEmpty:[!0,!0],disabledDate:e=>e&&e.isAfter((0,c.default)(),`day`)}),!n&&(0,s.jsx)(a.Space,{size:4,wrap:!0,children:tf.map(({label:e,getDates:n})=>(0,s.jsx)(a.Tag,{className:`filter-date-shortcut`,onClick:()=>t?.(n()),children:e},e))})]})}var rf=[{label:`AND`,value:`and`},{label:`OR`,value:`or`},{label:`Is Empty`,value:`isEmpty`},{label:`Not Empty`,value:`notEmpty`}],af=[{label:`Yes`,value:`true`},{label:`No`,value:`false`}];function of({value:e,onChange:t,disabled:n}){let[r,i]=Array.isArray(e)?e:[void 0,void 0];return(0,s.jsxs)(a.Flex,{gap:8,children:[(0,s.jsx)(a.InputNumber,{disabled:n,placeholder:`Min`,value:r,onChange:e=>t?.([e,i]),style:{flex:1}}),(0,s.jsx)(a.InputNumber,{disabled:n,placeholder:`Max`,value:i,onChange:e=>t?.([r,e]),style:{flex:1}})]})}var sf={operator:`and`,field:void 0,values:[]};function cf({filterInputType:e,fieldType:t,disabled:n,loading:r,valueOptions:i,onSearch:o,onOpen:c}){let l=e||(t===`boolean`?`boolean`:null)||(t===`date`?`datepicker`:null)||(t===`number`?`number-range`:null)||`dropdown`;return l===`boolean`?(0,s.jsx)(a.Select,{allowClear:!0,disabled:n,mode:`multiple`,options:af,placeholder:`Select value`}):l===`text`?(0,s.jsx)(a.Input,{disabled:n,placeholder:`Type keyword...`,allowClear:!0}):l===`datepicker`?(0,s.jsx)(nf,{disabled:n}):l===`number-range`?(0,s.jsx)(of,{disabled:n}):l===`checkbox`?(0,s.jsx)(a.Spin,{spinning:r,children:(0,s.jsx)(a.Checkbox.Group,{disabled:n,options:i,style:{display:`flex`,flexWrap:`wrap`,gap:`4px 16px`}})}):l===`radio`?(0,s.jsx)(a.Spin,{spinning:r,children:(0,s.jsx)(a.Radio.Group,{disabled:n,options:i,style:{display:`flex`,flexWrap:`wrap`,gap:`4px 16px`}})}):(0,s.jsx)(a.Select,{allowClear:!0,disabled:n,loading:r,mode:`multiple`,options:i,placeholder:n?`Select field first`:`Select values`,showSearch:!0,filterOption:!1,onSearch:o,onDropdownVisibleChange:c})}function lf(e){return e.label??e.fieldLabel??e.name??e.fieldName??e.value}function uf(e){return e.value??e.field??e.fieldName??e.name??e.label}function df(e,t){let n=t.find(t=>t.value===e.field),r=e.filterInputType??n?.filterInputType,i=r===`datepicker`||!r&&n?.type===`date`,a=r===`text`,o=e.values??[];return a?o=e.value??``:i&&(o=[e.from?(0,c.default)(e.from):null,e.to?(0,c.default)(e.to):null]),{field:e.field,operator:e.operator??`and`,values:o,locked:n?.isDefaultFilter??!1}}function ff({moduleName:e,open:t=!1,filters:n=[],onClose:r,onApply:c,onReset:l}){let[u]=a.Form.useForm(),d=a.Form.useWatch(`filters`,u)??[],{fields:f,loading:p,error:m}=ql(t?e:null),h=(0,i.useMemo)(()=>(f??[]).map(e=>({label:lf(e),value:uf(e),type:e.type,filterInputType:e.filterInputType,dataSource:e.dataSource,groupName:e.groupName,filterGroupFields:Array.isArray(e.filterGroupFields)?e.filterGroupFields:[],filterGroupSeparator:e.filterGroupSeparator??` `,lookup:e.lookup??null,isDefaultFilter:e.isDefaultFilter===1||e.isDefaultFilter===`1`||e.isDefaultFilter===!0})).filter(e=>e.label&&e.value),[f]),g=(0,i.useMemo)(()=>h.filter(e=>e.isDefaultFilter),[h]),_=(0,i.useMemo)(()=>g.map(e=>String(e.value)).sort().join(`|`),[g]),v=h,{valuesByField:y,loadingFields:b,fetchValues:x}=ef(e);function S(e){let t=h.find(t=>t.value===e),n=t?.filterInputType;if(!(!e||n===`datepicker`||n===`number-range`||n===`text`||!n&&[`boolean`,`date`,`number`].includes(t?.type))){let n=!!t?.lookup?.collection;x(e,``,{dataSource:n?`lookup`:t?.dataSource,groupName:t?.groupName,lookup:t?.lookup,groupFields:t?.filterGroupFields,groupSeparator:t?.filterGroupSeparator})}}function C(){return g.length>0?g.map(e=>({operator:`and`,field:e.value,values:[],locked:e.isDefaultFilter})):[sf]}function w(e=[]){let t=e.filter(e=>e?.field),n=new Set(t.map(e=>String(e.field))),r=[...g.filter(e=>!n.has(String(e.value))).map(e=>({operator:`and`,field:e.value,values:[],locked:!0})),...t].map(e=>({...e,locked:g.some(t=>String(t.value)===String(e.field))}));return r.length>0?r:[sf]}let T=(0,i.useRef)(!1),E=(0,i.useRef)(n);(0,i.useEffect)(()=>{if(n===E.current)return;if(E.current=n,T.current){T.current=!1;return}let e=w((n??[]).filter(e=>e.field).map(e=>df(e,h)));u.setFieldsValue({filters:e}),e.forEach(e=>S(e.field))},[n,h]);let D=(0,i.useRef)(!1),O=(0,i.useRef)(``),k=(0,i.useRef)(e),A=(0,i.useRef)(!1);(0,i.useEffect)(()=>{e!==k.current&&(k.current=e,D.current=!1,O.current=``,A.current=!1)},[e]),(0,i.useEffect)(()=>{if(!t)return;let e=O.current!==_;if(D.current&&!e)return;let n=A.current&&!p,r=!p&&h.length>0;if(A.current=p,!n&&!r)return;let i=D.current;D.current=!0,O.current=_;let a=u.getFieldValue(`filters`)??[],o=w(i||a.length>0?a:C());u.setFieldsValue({filters:o}),o.forEach(e=>S(e.field))},[t,p,h,_]);function ee(){T.current=!0;let t=C();u.setFieldsValue({filters:t}),t.forEach(e=>S(e.field)),c?.({moduleName:e,filters:[]}),l?.(),r?.()}function te(){T.current=!0;let t=(u.getFieldsValue().filters??[]).filter(e=>!ne(e)).map(e=>{let t={...e};delete t.locked;let n=h.find(e=>e.value===t.field),r=n?.label??t.field,i=n?.filterInputType,a=i===`datepicker`||n?.type===`date`,o=i===`number-range`||!i&&n?.type===`number`,s=i===`text`;if(a){let[e,n]=Array.isArray(t.values)?t.values:[],a=e=>e?typeof e.format==`function`?e.format(`YYYY-MM-DD`):typeof e.toISOString==`function`||e instanceof Date?e.toISOString().substring(0,10):null:null,o=a(e),s=a(n);return{...t,values:[o,s].filter(Boolean),from:o??void 0,to:s??void 0,fieldLabel:r,filterInputType:i}}if(o){let[e,n]=Array.isArray(t.values)?t.values:[];return{...t,values:[e,n].filter(e=>e!=null),from:e==null?void 0:String(e),to:n==null?void 0:String(n),fieldLabel:r,filterInputType:i}}if(s){let e=typeof t.values==`string`?t.values.trim():``;return{...t,value:e,values:[],fieldLabel:r,filterInputType:i}}return{...t,values:t.values??[],fieldLabel:r,filterInputType:i,groupFields:n?.filterGroupFields??[]}});c?.({moduleName:e,filters:t}),r?.()}function ne(e){if(!e?.field)return!0;if(e.operator===`isEmpty`||e.operator===`notEmpty`)return!1;let{values:t}=e;return typeof t==`string`?t.trim()===``:!Array.isArray(t)||t.length===0||t.every(e=>e==null||e===``)}let re=d.length===0||d.every(ne);function ie(e,t){let n=u.getFieldValue(`filters`)??[];u.setFieldValue(`filters`,n.map((t,n)=>n===e?{...t,values:[]}:t));let r=h.find(e=>e.value===t),i=r?.filterInputType;if(!(!t||i===`datepicker`||i===`number-range`||i===`text`||!i&&[`boolean`,`date`,`number`].includes(r?.type))){let e=!!r?.lookup?.collection;x(t,``,{dataSource:e?`lookup`:r?.dataSource,groupName:r?.groupName,lookup:r?.lookup,groupFields:r?.filterGroupFields,groupSeparator:r?.filterGroupSeparator})}}return(0,s.jsxs)(a.Drawer,{title:(0,s.jsx)(V,{variant:`card-title`,color:`primary`,children:`Filters`}),placement:`right`,width:720,open:t,onClose:r,rootClassName:`dynamic-field-filter`,maskClosable:!1,footer:(0,s.jsxs)(a.Space,{className:`dynamic-field-filter__footer`,children:[(0,s.jsx)(fs,{onClick:ee,children:`Reset`}),(0,s.jsx)(fs,{variant:`primary`,onClick:te,disabled:re,children:`Apply`})]}),children:[m&&(0,s.jsx)(a.Alert,{type:`error`,message:`Could not load filter fields`,description:m,style:{marginBottom:16},showIcon:!0}),(0,s.jsx)(a.Spin,{spinning:p,tip:`Loading fields…`,children:(0,s.jsx)(a.Form,{form:u,layout:`vertical`,className:`dynamic-field-filter__form`,initialValues:{filters:[sf]},children:(0,s.jsx)(a.Form.List,{name:`filters`,children:(e,{add:t,remove:n})=>(0,s.jsxs)(a.Space,{direction:`vertical`,className:`dynamic-field-filter__rows`,children:[e.map((t,r)=>{let i=d[r]?.field,c=d[r]?.operator,l=h.find(e=>e.value===i),u=l?.isDefaultFilter===!0,f=!i||c===`isEmpty`||c===`notEmpty`,m=l?.type??`text`,g=l?.filterInputType,_=y[i]??[],S=b.has(i),C=new Set(d.filter((e,t)=>t!==r).map(e=>e?.field).filter(Boolean).map(String)),w=u?h.filter(e=>e.value===i):v.filter(e=>!C.has(String(e.value)));return(0,s.jsxs)(a.Space,{direction:`vertical`,className:`dynamic-field-filter__row`,children:[e.length>1&&!u&&(0,s.jsx)(fs,{variant:`danger`,htmlType:`button`,icon:(0,s.jsx)(o.DeleteOutlined,{}),"aria-label":`Remove filter row`,className:`dynamic-field-filter__remove`,onClick:()=>n(t.name)}),r>0&&(0,s.jsx)(a.Flex,{justify:`center`,children:(0,s.jsx)(a.Form.Item,{name:[t.name,`operator`],rules:[{required:!0,message:`Select condition`}],className:`dynamic-field-filter__operator`,children:(0,s.jsx)(a.Select,{options:rf,placeholder:`Condition`})})}),(0,s.jsxs)(a.Flex,{align:`end`,gap:`middle`,wrap:!0,children:[(0,s.jsx)(a.Form.Item,{label:(0,s.jsx)(V,{variant:`label`,color:`secondary`,children:`Field`}),style:{flex:1,minWidth:220},children:u?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(V,{variant:`body`,className:`dynamic-field-filter__locked-field`,children:l?.label??i}),(0,s.jsx)(a.Form.Item,{name:[t.name,`field`],noStyle:!0,children:(0,s.jsx)(a.Input,{type:`hidden`})})]}):(0,s.jsx)(a.Form.Item,{name:[t.name,`field`],rules:[{required:!0,message:`Select field`}],noStyle:!0,children:(0,s.jsx)(a.Select,{allowClear:!0,showSearch:!0,placeholder:`Select field`,options:w,optionFilterProp:`label`,loading:p,onChange:e=>ie(t.name,e)})})}),(0,s.jsx)(a.Form.Item,{label:(0,s.jsx)(V,{variant:`label`,color:`secondary`,children:`Values`}),name:[t.name,`values`],style:{flex:1,minWidth:220},children:cf({filterInputType:g,fieldType:m,disabled:f,loading:S,valueOptions:_,onSearch:e=>{if(i){let t=!!l?.lookup?.collection;x(i,e,{dataSource:t?`lookup`:l?.dataSource,groupName:l?.groupName,lookup:l?.lookup,groupFields:l?.filterGroupFields,groupSeparator:l?.filterGroupSeparator})}},onOpen:e=>{if(e&&i){let e=!!l?.lookup?.collection;x(i,``,{dataSource:e?`lookup`:l?.dataSource,groupName:l?.groupName,lookup:l?.lookup,groupFields:l?.filterGroupFields,groupSeparator:l?.filterGroupSeparator})}}})})]})]},t.key)}),(0,s.jsx)(fs,{htmlType:`button`,variant:`soft`,icon:(0,s.jsx)(o.PlusOutlined,{}),disabled:v.length>0&&d.filter(e=>e?.field).length>=v.length,onClick:()=>t(sf),children:`Add Row`})]})})})})]})}var pf=`data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.00035%204.69941C4.74567%204.69941%203.72701%205.71807%203.72701%206.97275C3.72701%208.22745%204.74567%209.24609%206.00035%209.24609C7.25503%209.24609%208.2737%208.22745%208.2737%206.97275C8.2737%205.71807%207.25503%204.69941%206.00035%204.69941ZM6.00035%205.87128C6.60827%205.87128%207.10182%206.36485%207.10182%206.97275C7.10182%207.58067%206.60827%208.07422%206.00035%208.07422C5.39243%208.07422%204.89888%207.58067%204.89888%206.97275C4.89888%206.36485%205.39243%205.87128%206.00035%205.87128ZM2.06843%206.41445C2.85434%204.9331%204.16742%203.92578%206.00035%203.92578C7.83328%203.92578%209.14637%204.9331%209.93227%206.41445C10.0838%206.70013%2010.4388%206.80902%2010.7245%206.65745C11.0102%206.50587%2011.1191%206.15091%2010.9675%205.86523C9.97758%203.9994%208.30902%202.75391%206.00035%202.75391C3.69169%202.75391%202.02312%203.9994%201.03322%205.86523C0.881648%206.15091%200.990538%206.50587%201.27619%206.65745C1.56187%206.80902%201.91686%206.70013%202.06843%206.41445Z'%20fill='%23586888'/%3e%3c/svg%3e`,mf=`data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.6279%206.78121C12.6857%206.88148%2012.7014%207.00057%2012.6715%207.11239C12.6417%207.22422%2012.5688%207.31967%2012.4688%207.37785L7.21875%2010.4403C7.15185%2010.4794%207.0758%2010.4999%206.99836%2010.4999C6.92092%2010.4999%206.84487%2010.4794%206.77797%2010.4403L1.52797%207.37785C1.42936%207.31859%201.35806%207.22289%201.32951%207.11145C1.30095%207.00001%201.31744%206.88181%201.37539%206.78244C1.43335%206.68306%201.52811%206.61052%201.63916%206.5805C1.75022%206.55048%201.86863%206.56542%201.96875%206.62207L7%209.55605L12.0312%206.62207C12.1315%206.56428%2012.2506%206.54858%2012.3624%206.57841C12.4743%206.60824%2012.5697%206.68116%2012.6279%206.78121ZM1.3125%204.37496C1.31267%204.29833%201.33297%204.22309%201.37136%204.15677C1.40975%204.09045%201.46489%204.03538%201.53125%203.99707L6.78125%200.934566C6.84815%200.895555%206.9242%200.875%207.00164%200.875C7.07908%200.875%207.15513%200.895555%207.22203%200.934566L12.472%203.99707C12.5381%204.0356%2012.5929%204.09076%2012.6309%204.15707C12.669%204.22337%2012.6891%204.2985%2012.6891%204.37496C12.6891%204.45142%2012.669%204.52654%2012.6309%204.59285C12.5929%204.65915%2012.5381%204.71432%2012.472%204.75285L7.22203%207.81535C7.15513%207.85436%207.07908%207.87491%207.00164%207.87491C6.9242%207.87491%206.84815%207.85436%206.78125%207.81535L1.53125%204.75285C1.46489%204.71453%201.40975%204.65946%201.37136%204.59314C1.33297%204.52682%201.31267%204.45159%201.3125%204.37496ZM2.61844%204.37496L7%206.93105L11.3816%204.37496L7%201.81886L2.61844%204.37496ZM7.65625%2011.7993L7%2012.1821L1.96875%209.24707C1.86913%209.19747%201.75436%209.18769%201.64779%209.21973C1.54122%209.25177%201.45087%209.32322%201.39512%209.41953C1.33937%209.51583%201.32241%209.62977%201.3477%209.73814C1.37299%209.84651%201.43863%209.94117%201.53125%2010.0028L6.78125%2013.0653C6.84815%2013.1044%206.9242%2013.1249%207.00164%2013.1249C7.07908%2013.1249%207.15513%2013.1044%207.22203%2013.0653L8.09703%2012.5551C8.14746%2012.5266%208.19171%2012.4883%208.22723%2012.4426C8.26275%2012.3968%208.28882%2012.3444%208.30394%2012.2885C8.31906%2012.2326%208.32291%2012.1742%208.31529%2012.1167C8.30766%2012.0593%208.28871%2012.004%208.25952%2011.9539C8.23033%2011.9039%208.19149%2011.8601%208.14526%2011.8252C8.09903%2011.7903%208.04632%2011.7649%207.9902%2011.7505C7.93408%2011.7361%207.87566%2011.7331%207.81833%2011.7414C7.761%2011.7498%207.70591%2011.7695%207.65625%2011.7993Z'%20fill='%236B7280'/%3e%3cpath%20d='M10.6036%2011.3825L13.4607%209.4477C13.5813%209.36599%2013.614%209.20256%2013.5341%209.08069L13.0105%208.282C12.9303%208.15966%2012.7665%208.12478%2012.6434%208.20383L9.54053%2010.1964L8.94939%2011.4054C8.84904%2011.6106%209.03632%2011.8387%209.25715%2011.7803L10.4338%2011.469C10.4561%2011.4631%2010.4776%2011.4543%2010.4977%2011.4429L10.6036%2011.3825ZM9.54053%2010.1964L10.6036%2011.3825'%20stroke='%236B7280'%20stroke-width='0.6'/%3e%3c/svg%3e`,hf=`data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='path-1-inside-1_8856_23533'%20fill='white'%3e%3crect%20x='1.40039'%20y='1.40039'%20width='5.09086'%20height='5.09086'%20rx='0.727266'/%3e%3c/mask%3e%3crect%20x='1.40039'%20y='1.40039'%20width='5.09086'%20height='5.09086'%20rx='0.727266'%20stroke='%23586888'%20stroke-width='1.5'%20mask='url(%23path-1-inside-1_8856_23533)'/%3e%3cmask%20id='path-2-inside-2_8856_23533'%20fill='white'%3e%3crect%20x='1.40039'%20y='7.50781'%20width='5.09086'%20height='5.09086'%20rx='0.727266'/%3e%3c/mask%3e%3crect%20x='1.40039'%20y='7.50781'%20width='5.09086'%20height='5.09086'%20rx='0.727266'%20stroke='%23586888'%20stroke-width='1.5'%20mask='url(%23path-2-inside-2_8856_23533)'/%3e%3cline%20x1='7.375'%20y1='2.93555'%20x2='12.225'%20y2='2.93555'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='5.83398'%20x2='12.225'%20y2='5.83398'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='8.87305'%20x2='12.225'%20y2='8.87305'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='11.7227'%20x2='12.225'%20y2='11.7227'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3c/svg%3e`,gf=/^[a-z0-9][a-z0-9-_]*$/i,_f=/^(\/|https?:|data:image\/(png|svg\+xml|jpeg|webp);)/i;function vf(){if(typeof window>`u`)return{};let e=window.__CORE_THEME_CONFIG__?.actionIcons;if(!e||typeof e!=`object`||Array.isArray(e))return{};let t={};return Object.entries(e).forEach(([e,n])=>{let r=typeof n==`string`?n:n?.src;!gf.test(e)||typeof r!=`string`||!_f.test(r.trim())||(t[e]={src:r.trim(),label:String(typeof n==`object`&&n?.label||e)})}),t}function yf(e){return!e||typeof e!=`string`?null:vf()[e.trim()]??null}var bf=(0,i.createContext)(null);function xf(e){let t=String(e?.listPlacement??``).trim().toLowerCase();return t===`toolbar`||t===`row`?t:``}var Sf=[`desc`,`asc`];function Cf(e=[]){let t=[];return(Array.isArray(e)?e:[]).forEach(e=>{let n=e?.sortMenu,r=e?.key??e?.field;!n||typeof n!=`object`||!r||Sf.forEach(e=>{let i=String(n[e]??``).trim();i&&t.push({value:`${r}|${e}`,field:r,dir:e,label:i})})}),t}function wf(e=[]){for(let t of Array.isArray(e)?e:[]){let e=String(t?.sortMenu?.default??``).trim().toLowerCase();if(e===`asc`||e===`desc`)return{field:t.key??t.field,dir:e}}return null}var Tf=e=>e!=null&&String(e).trim()!==``;function Ef(e,t){let n=String(e??``);if([...n.matchAll(/\{([A-Za-z0-9_.]+)\}/g)].map(e=>e[1]).length===0)return n.trim();let r=!1,i=n.replace(/\{([A-Za-z0-9_.]+)\}/g,(e,n)=>{let i=t(n);return Tf(i)?(r=!0,String(i)):``});return r?i.trim():``}function Df(e){return e>=80?`high`:e>=70?`good`:e>=60?`fair`:`low`}function Of(e){if(e==null||e===``)return null;let t=typeof e==`object`&&e.$date?e.$date:e,n=t instanceof Date?t:new Date(t);return Number.isNaN(n.getTime())?null:n}var kf=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate();function Af(e,{relative:t=!1,now:n=new Date}={}){let r=Of(e);if(!r)return null;let i=r.toLocaleDateString(`en-GB`,{day:`2-digit`,month:`short`,year:`numeric`});if(t){let e=new Date(n);e.setDate(n.getDate()+1);let t=new Date(n);t.setDate(n.getDate()-1),kf(r,n)?i=`Today`:kf(r,e)?i=`Tomorrow`:kf(r,t)&&(i=`Yesterday`)}return{day:i,time:r.toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!0})}}var jf=5e3;function Mf(e=[],t=[],n=()=>``){let r=e=>{let t=e==null?``:String(e);return/^[=+\-@\t\r]/.test(t)&&(t=`'${t}`),/[",\r\n]/.test(t)?`"${t.replace(/"/g,`""`)}"`:t},i=[e.map(e=>r(e.label)).join(`,`)];return t.forEach(t=>i.push(e.map(e=>r(n(t,e))).join(`,`))),`\uFEFF${i.join(`\r
5
5
  `)}`}function Nf(e,t=new Date){let n=String(e||`export`).toLowerCase().replace(/[^a-z0-9-]+/g,`-`).replace(/^-+|-+$/g,``)||`export`,r=e=>String(e).padStart(2,`0`);return`${n}-${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())}.csv`}var Pf=[`success`,`warning`,`danger`,`info`,`neutral`,`brand`];function Ff(e,t){if(!e||typeof e!=`object`||!Tf(t))return;let n=String(t).trim();if(Object.prototype.hasOwnProperty.call(e,n))return e[n];let r=n.toLowerCase(),i=Object.keys(e).find(e=>e.trim().toLowerCase()===r);return i===void 0?void 0:e[i]}function If(e,t={}){let n=String(Ff(t.tones,e)??t.defaultTone??`neutral`).trim().toLowerCase();return Pf.includes(n)?n:`neutral`}function Lf(e,{currency:t=`₹`,locale:n=`en-IN`,decimals:r}={}){if(!Tf(e))return``;let i=String(e).replace(/[^0-9.-]/g,``);if(!/[0-9]/.test(i))return``;let a=Number(i);if(!Number.isFinite(a))return``;let o=Number.isInteger(r)?{minimumFractionDigits:r,maximumFractionDigits:r}:{maximumFractionDigits:2},s;try{s=a.toLocaleString(n,o)}catch{s=a.toLocaleString(`en-IN`,o)}return`${t??``}${s}`}function Rf(e,{suffix:t=``,now:n=new Date}={}){let r=Of(e);if(!r)return``;let i=kf(r,n)?r.toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!0}):r.toLocaleDateString(`en-GB`,{day:`2-digit`,month:`short`});return Tf(t)?`${i} ${String(t).trim()}`:i}function zf(e){let t=String(e??``).match(/^\s*(\d+)\s*(?:of|\/)\s*(\d+)\s*$/i);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);return r>0?{done:n,total:r,percent:Math.max(0,Math.min(100,Math.round(n/r*100)))}:null}function Bf(e){return Object.entries(e&&typeof e==`object`?e:{}).map(([e,t])=>`${e} = ${t}`).join(`
6
6
  `)}function Vf(e){let t={};return String(e??``).split(`
7
- `).forEach(e=>{let n=e.indexOf(`=`);if(n<1)return;let r=e.slice(0,n).trim(),i=e.slice(n+1).trim();r&&i&&(t[r]=i)}),t}function Hf(e=[]){let t=e=>String(e?.actionType??``).toLowerCase()===`export`?2:String(e?.listStyle??``).toLowerCase()===`primary`?0:1;return(Array.isArray(e)?e:[]).map((e,t)=>({a:e,i:t})).sort((e,n)=>t(e.a)-t(n.a)||e.i-n.i).map(({a:e})=>e)}function Uf(e,t){let n=Of(e);if(!n)return``;let r=Of(t),i=e=>e.toLocaleDateString(`en-GB`,{day:`2-digit`,month:`short`,year:`numeric`});return r?n.getFullYear()===r.getFullYear()?`${n.toLocaleDateString(`en-GB`,{day:`2-digit`,month:`short`})} – ${i(r)}`:`${i(n)} – ${i(r)}`:i(n)}function Wf(e,t){let n=(Array.isArray(e)?e:Tf(e)?String(e).split(`,`):[]).map(e=>e&&typeof e==`object`?e.label??e.name??e.value:e).filter(Tf).map(e=>String(e).trim()),r=Number.isInteger(t)&&t>0?t:n.length;return{shown:n.slice(0,r),more:Math.max(0,n.length-r)}}function Gf(e){let t=String(e??``).trim();return/^https?:\/\//i.test(t)?t:``}function Kf(e={},t,n){let r=e=>Tf(e)&&typeof t==`function`?t(e):void 0;return[{key:`view`,label:e.viewLabel||`View`,href:Gf(Tf(e.viewField)?r(e.viewField):n),name:Tf(e.nameField)?String(r(e.nameField)??``).trim():``},{key:`download`,label:e.downloadLabel||`Download`,href:Gf(r(e.downloadField)),download:!0}].filter(e=>e.href)}var K=e=>e!=null&&String(e).trim()!==``,qf=e=>String(e??``).trim().split(/\s+/).slice(0,2).map(e=>e[0]??``).join(``).toUpperCase(),Jf={high:`#2b9c64`,good:`#edbb22`,fair:`#ef7042`,low:`#909aae`},Yf=e=>t=>{t.stopPropagation(),e(t)};function Xf({label:e}){return(0,s.jsx)(`span`,{className:`lv-cell-empty`,style:{color:`#909aae`},children:K(e)?e:`-`})}function Zf({field:e,value:t,read:n,link:r=null}){let i=e?.renderConfig??{};if(!K(t))return(0,s.jsx)(Xf,{label:i.emptyLabel});let o=(Array.isArray(i.lines)?i.lines:[]).map(e=>Ef(e,n)).filter(K);return(0,s.jsxs)(`span`,{className:`lv-cell-person`,style:{display:`flex`,alignItems:`center`,gap:10,minWidth:0},children:[(0,s.jsx)(a.Avatar,{className:`lv-cell-person__avatar`,style:{flex:`none`},children:qf(t)}),(0,s.jsxs)(`span`,{className:`lv-cell-person__text`,style:{display:`flex`,flexDirection:`column`,minWidth:0,lineHeight:1.35},children:[(0,s.jsxs)(`span`,{className:`lv-cell-person__name`,style:{display:`inline-flex`,alignItems:`center`,gap:4,fontWeight:600,whiteSpace:`nowrap`},children:[String(t),r]}),o.map((e,t)=>(0,s.jsx)(`span`,{className:`lv-cell-sub`,style:{display:`block`,whiteSpace:`nowrap`},children:e},`${t}-${e}`))]})]})}function Qf({field:e,value:t}){let n=e?.renderConfig??{},r=K(t)?Number(String(t).replace(`%`,``)):NaN;if(!Number.isFinite(r))return(0,s.jsx)(`span`,{className:`lv-cell-score lv-cell-score--empty`,children:K(n.emptyLabel)?n.emptyLabel:`-`});let i=Math.max(0,Math.min(100,Math.round(r))),o=Df(i);return(0,s.jsx)(a.Progress,{className:`lv-cell-score lv-cell-score--${o}`,type:`circle`,percent:i,size:36,strokeWidth:8,strokeColor:Jf[o],format:e=>`${e}%`})}function $f({field:e,value:t,relative:n=!1,read:r}){let i=e?.renderConfig??{},a=Af(t,{relative:n});if(!a)return(0,s.jsx)(Xf,{label:i.emptyLabel});let o=K(i.subField)&&typeof r==`function`?Rf(r(i.subField),{suffix:i.subSuffix}):``;return(0,s.jsxs)(`span`,{className:`lv-cell-date${i.inline?` lv-cell-date--inline`:``}`,style:{display:`flex`,flexDirection:`column`,lineHeight:1.35},children:[i.inline?(0,s.jsx)(`span`,{className:`lv-cell-date__day`,children:`${a.day}, ${a.time}`}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{className:`lv-cell-date__day`,children:a.day}),(0,s.jsx)(`span`,{className:`lv-cell-sub`,children:a.time})]}),K(o)&&(0,s.jsx)(`span`,{className:`lv-cell-sub lv-cell-date__sub`,children:o})]})}function ep({field:e,value:t}){let n=e?.renderConfig??{};if(!K(t))return(0,s.jsx)(Xf,{label:n.emptyLabel});let r=If(t,n);return(0,s.jsx)(`span`,{className:`lv-cell-chip lv-cell-chip--${r}`,"data-tone":r,style:{display:`inline-flex`,alignItems:`center`,padding:`1px 8px`,borderRadius:4,whiteSpace:`nowrap`,lineHeight:1.5},children:String(t)})}function tp({field:e,value:t}){let n=e?.renderConfig??{};if(!K(t))return(0,s.jsx)(Xf,{label:n.emptyLabel});let r=If(t,n);return(0,s.jsx)(`span`,{className:`lv-cell-tone lv-cell-tone--${r}`,"data-tone":r,children:String(t)})}function np({field:e,value:t}){let n=e?.renderConfig??{};if(!K(t))return(0,s.jsx)(Xf,{label:n.emptyLabel});let r=String(t),i=Ff(n.icons,t),o=K(i)?(0,s.jsx)(ip,{name:i}):null;return o?(0,s.jsx)(a.Tooltip,{title:r,children:(0,s.jsxs)(`span`,{className:`lv-cell-type`,role:`img`,"aria-label":r,style:{display:`inline-flex`,alignItems:`center`,gap:6},children:[o,n.showLabel?(0,s.jsx)(`span`,{className:`lv-cell-type__label`,children:r}):null]})}):(0,s.jsx)(`span`,{className:`lv-cell-type lv-cell-type--text`,children:r})}function rp({field:e,value:t}){let n=e?.renderConfig??{},r=Lf(t,n);return K(r)?(0,s.jsx)(`span`,{className:`lv-cell-money`,style:{whiteSpace:`nowrap`},children:r}):(0,s.jsx)(Xf,{label:n.emptyLabel})}function ip({name:e,fallback:t=null}){let n=yf(e);return n?(0,s.jsx)(`img`,{className:`lv-action-icon`,src:n.src,alt:``,width:14,height:14}):t}function ap({inline:e=[],menu:t=[],onRun:n,links:r=[]}){return!e.length&&!t.length&&!r.length?(0,s.jsx)(Xf,{}):(0,s.jsxs)(`span`,{className:`lv-cell-actions`,style:{display:`inline-flex`,alignItems:`center`,gap:6,flexWrap:`nowrap`},children:[r.length>0&&(0,s.jsx)(dp,{links:r}),e.map(e=>{let t=String(e.listStyle??``).toLowerCase()===`button`,r=e.label||e.key,i=e.__disabledReason||(t?``:r),o=t?(0,s.jsx)(a.Button,{size:`small`,className:`lv-row-action lv-row-action--button`,icon:(0,s.jsx)(ip,{name:e.icon}),disabled:!!e.__disabledReason,onClick:Yf(()=>n(e)),children:r}):(0,s.jsx)(`button`,{type:`button`,className:`lv-row-action lv-row-action--icon`,"aria-label":r,disabled:!!e.__disabledReason,onClick:Yf(()=>n(e)),style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:24,height:24,padding:0,border:0,borderRadius:`50%`,cursor:`pointer`},children:(0,s.jsx)(ip,{name:e.icon,fallback:(0,s.jsx)(`span`,{style:{fontSize:10},children:r.slice(0,2)})})});return i?(0,s.jsx)(a.Tooltip,{title:i,children:o},e.key):(0,s.jsx)(`span`,{children:o},e.key)}),t.length>0&&(0,s.jsx)(a.Dropdown,{trigger:[`click`],menu:{items:t,onClick:({key:e,domEvent:t})=>{t?.stopPropagation?.(),n({key:e})}},children:(0,s.jsx)(a.Button,{type:`text`,size:`small`,className:`lv-row-action lv-row-action--more`,"aria-label":`More actions`,icon:(0,s.jsx)(o.MoreOutlined,{}),onClick:e=>e.stopPropagation()})})]})}function op({field:e,value:t,read:n}){let r=e?.renderConfig??{};if(!K(t))return(0,s.jsx)(Xf,{label:r.emptyLabel});let i=zf(t);if(!i)return(0,s.jsx)(`span`,{className:`lv-cell-fraction lv-cell-fraction--text`,children:String(t)});let a=typeof n==`function`?(Array.isArray(r.lines)?r.lines:[]).map(e=>Ef(e,n)).filter(K):[];return(0,s.jsxs)(`span`,{className:`lv-cell-fraction`,style:{display:`inline-flex`,flexDirection:`column`,gap:2,minWidth:28},children:[(0,s.jsx)(`span`,{className:`lv-cell-fraction__text`,children:`${i.done} of ${i.total}`}),(0,s.jsx)(`span`,{className:`lv-cell-fraction__bar`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":i.total,"aria-valuenow":i.done,"aria-label":`${i.done} of ${i.total}`,style:{display:`block`,height:3,borderRadius:2,background:`#e5ebf0`,overflow:`hidden`},children:(0,s.jsx)(`span`,{className:`lv-cell-fraction__fill`,style:{display:`block`,height:`100%`,width:`${i.percent}%`,background:`currentColor`}})}),a.map((e,t)=>(0,s.jsx)(`span`,{className:`lv-cell-sub`,style:{display:`block`,whiteSpace:`nowrap`},children:e},`${t}-${e}`))]})}function sp({field:e,value:t,read:n,link:r=null}){let i=e?.renderConfig??{},a=K(t)?String(t):``;if(K(i.endField)&&typeof n==`function`?a=Uf(t,n(i.endField)):i.dateDisplay===`date`&&(a=Uf(t,null)),!K(a))return(0,s.jsx)(Xf,{label:i.emptyLabel});let o=(Array.isArray(i.lines)?i.lines:[]).map(e=>typeof n==`function`?Ef(e,n):``).filter(K);return(0,s.jsxs)(`span`,{className:`lv-cell-stack`,style:{display:`flex`,flexDirection:`column`,minWidth:0,lineHeight:1.35},children:[(0,s.jsxs)(`span`,{className:`lv-cell-stack__head`,style:{display:`inline-flex`,alignItems:`center`,gap:4,whiteSpace:`nowrap`},children:[a,r]}),o.map((e,t)=>(0,s.jsx)(`span`,{className:`lv-cell-sub`,style:{display:`block`,whiteSpace:`nowrap`},children:e},`${t}-${e}`))]})}function cp({field:e,value:t}){let n=e?.renderConfig??{},{shown:r,more:i}=Wf(t,n.maxVisible);return r.length?(0,s.jsxs)(`span`,{className:`lv-cell-chips`,style:{display:`inline-flex`,flexWrap:`wrap`,alignItems:`center`,gap:4},children:[r.map((e,t)=>{let r=If(e,n);return(0,s.jsx)(`span`,{className:`lv-cell-chip lv-cell-chip--${r}`,"data-tone":r,style:{display:`inline-flex`,alignItems:`center`,padding:`1px 8px`,borderRadius:4,whiteSpace:`nowrap`,lineHeight:1.5},children:e},`${t}-${e}`)}),i>0&&(0,s.jsx)(`span`,{className:`lv-cell-chips__more lv-cell-sub`,children:`+${i}`})]}):(0,s.jsx)(Xf,{label:n.emptyLabel})}var lp={pdf:o.FilePdfOutlined,image:o.FileImageOutlined};function up({field:e,value:t,read:n}){let r=e?.renderConfig??{};if(!K(t))return(0,s.jsx)(Xf,{label:r.emptyLabel});let i=K(r.kindField)&&typeof n==`function`?String(n(r.kindField)??``).trim().toLowerCase():``,a=lp[i]??o.FileTextOutlined,c=(Array.isArray(r.lines)?r.lines:[]).map(e=>typeof n==`function`?Ef(e,n):``).filter(K);return(0,s.jsxs)(`span`,{className:`lv-cell-file`,style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[(0,s.jsx)(a,{className:`lv-cell-file__icon lv-cell-file__icon--${lp[i]?i:`file`}`,"aria-hidden":`true`,style:{flex:`none`,fontSize:18}}),(0,s.jsxs)(`span`,{style:{display:`flex`,flexDirection:`column`,minWidth:0,lineHeight:1.35},children:[(0,s.jsx)(`span`,{className:`lv-cell-file__name`,style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:String(t)}),c.map((e,t)=>(0,s.jsx)(`span`,{className:`lv-cell-sub`,style:{display:`block`,whiteSpace:`nowrap`},children:e},`${t}-${e}`))]})]})}function dp({links:e}){let t=(0,i.useContext)(bf),n={display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:28,height:28,borderRadius:6};return e.map(e=>{let r=`lv-cell-filelinks__link lv-cell-filelinks__link--${e.key}`,i=e.key===`download`?(0,s.jsx)(o.DownloadOutlined,{}):(0,s.jsx)(o.EyeOutlined,{}),c=e.key===`view`&&typeof t==`function`?(0,s.jsx)(`button`,{type:`button`,className:r,"aria-label":e.label,onClick:Yf(()=>t({url:e.href,name:e.name||void 0})),style:{...n,padding:0,cursor:`pointer`},children:i}):(0,s.jsx)(`a`,{className:r,href:e.href,target:`_blank`,rel:`noopener noreferrer`,download:e.download?``:void 0,"aria-label":e.label,onClick:e=>e.stopPropagation(),style:n,children:i});return(0,s.jsx)(a.Tooltip,{title:e.label,children:c},e.key)})}function fp({field:e,value:t,read:n}){let r=e?.renderConfig??{},i=Kf(r,n,t);return i.length?(0,s.jsx)(`span`,{className:`lv-cell-filelinks`,style:{display:`inline-flex`,alignItems:`center`,gap:4},children:(0,s.jsx)(dp,{links:i})}):(0,s.jsx)(Xf,{label:r.emptyLabel})}function pp({sortOptions:e=[],sortValue:t,onSort:n,sortLabel:r=`Sort by`,showSelectAll:i=!1,allSelected:c=!1,someSelected:l=!1,onToggleAll:u,selectAllLabel:d=`Select All`,buttons:f=[],maxButtons:p=3,hasSelection:m=!1,selectFirstText:h=`Select rows first`,onRun:g,note:_=``,steady:v=!1}){let y=Hf(f),b=y.slice(0,Math.max(0,p)),x=y.slice(Math.max(0,p)),S=e=>!!e.__disabledReason||e.requireSelection&&!m,C=e=>e.__disabledReason||(e.requireSelection&&!m?h:``),w=typeof _==`string`?_.trim()!==``:!!_,T=e.length>0||v;return!T&&!i&&!f.length&&!w?null:(0,s.jsxs)(a.Flex,{className:`lv-toolbar`,align:`center`,justify:`space-between`,gap:12,wrap:`wrap`,children:[(0,s.jsxs)(a.Flex,{className:`lv-toolbar__left`,align:`center`,gap:12,wrap:`wrap`,children:[T&&(0,s.jsxs)(`label`,{className:`lv-toolbar__sort`,style:{display:`inline-flex`,flexDirection:`column`},children:[(0,s.jsx)(`span`,{className:`lv-toolbar__sort-label`,style:{fontSize:11},children:r}),(0,s.jsx)(a.Select,{size:`small`,className:`lv-toolbar__sort-select`,variant:`borderless`,popupMatchSelectWidth:!1,"aria-label":r,value:t||void 0,disabled:!e.length,placeholder:`—`,options:e.map(e=>({value:e.value,label:e.label})),onChange:t=>{let r=e.find(e=>e.value===t);r&&n?.(r.field,r.dir)}})]}),w&&(0,s.jsx)(`span`,{className:`lv-toolbar__note`,children:_}),i&&(0,s.jsx)(a.Checkbox,{className:`lv-toolbar__select-all`,checked:c,indeterminate:l,onChange:()=>u?.(),children:d})]}),f.length>0&&(0,s.jsxs)(a.Flex,{className:`lv-toolbar__actions`,align:`center`,gap:8,wrap:`wrap`,children:[b.map(e=>{let t=String(e.listStyle??``).toLowerCase()===`primary`,n=(0,s.jsx)(a.Button,{size:`small`,type:t?`primary`:`default`,danger:!!e.danger,className:`lv-toolbar__button${t?` lv-toolbar__button--primary`:``}`,icon:(0,s.jsx)(ip,{name:e.icon}),disabled:S(e),onClick:()=>g?.(e),children:e.label||e.key});return C(e)?(0,s.jsx)(a.Tooltip,{title:C(e),children:(0,s.jsx)(`span`,{children:n})},e.key):(0,s.jsx)(`span`,{children:n},e.key)}),x.length>0&&(0,s.jsx)(a.Dropdown,{trigger:[`click`],menu:{items:x.map(e=>({key:e.key,label:e.label||e.key,disabled:S(e),danger:!!e.danger})),onClick:({key:e})=>{let t=x.find(t=>String(t.key)===String(e));t&&!S(t)&&g?.(t)}},children:(0,s.jsx)(a.Button,{size:`small`,className:`lv-toolbar__more`,"aria-label":`More actions`,icon:(0,s.jsx)(o.MoreOutlined,{})})})]})]})}var mp=(e,t)=>String(t).split(`.`).reduce((e,t)=>e?.[t],e);function hp(e){return e==null?``:Array.isArray(e)?e.map(hp).filter(Boolean).join(`, `):typeof e==`object`?hp(e.label??e.name??e.title??e.value??``):String(e)}function gp(e){let t=e?.confirm;if(!t||typeof t!=`object`||t.enabled!==!0)return null;let n=String(e?.label??e?.key??``).trim(),r=e=>typeof e==`string`&&e.trim()?e.trim():``;return{title:r(t.title)||(n?`${n}?`:`Are you sure?`),message:r(t.message)||(n?`Do you want to {action} for this record?`:``),okLabel:r(t.okLabel)||`Yes`,cancelLabel:r(t.cancelLabel)||`No`,icon:r(t.icon),note:r(t.note)}}var _p={send:o.SendOutlined,"user-x":o.UserDeleteOutlined,"mail-x":o.MailOutlined,check:o.CheckCircleOutlined,info:o.InfoCircleOutlined,warning:o.ExclamationCircleOutlined},vp=Object.keys(_p);function yp(e,t=`cc-confirm-hero__icon`){let n=_p[e]?e:`info`;return(0,i.createElement)(`span`,{className:t,"data-icon":n,"aria-hidden":!0},(0,i.createElement)(_p[n]))}function bp(e){let t=String(e??``);return t.includes(`**`)?t.split(`**`).map((e,t)=>t%2?(0,i.createElement)(`strong`,{key:t},e):e):t}function xp(e,t){return(0,i.createElement)(`div`,{className:`cc-confirm-hero__body`},e?(0,i.createElement)(`p`,{className:`cc-confirm-hero__message`},bp(e)):null,t?(0,i.createElement)(`div`,{className:`cc-confirm-hero__note`,role:`note`},(0,i.createElement)(o.InfoCircleOutlined,{"aria-hidden":!0}),(0,i.createElement)(`span`,null,bp(t))):null)}function Sp(e,t,{action:n,tab:r,count:i}={}){let a=String(n?.label??n?.key??``).trim();return String(e??``).replace(/\{([A-Za-z0-9_.]+)\}/g,(e,n)=>n===`action`?a:hp(n===`tab`?r:n===`count`?i??1:mp(t??{},n))).replace(/\s{2,}/g,` `).replace(/\s+([?.!,:;])/g,`$1`).trim()}function Cp(e,t,{tab:n,count:r,confirm:i=a.Modal.confirm}={}){let o=gp(e);return o?new Promise(a=>{let s=!1,c=e=>{s||(s=!0,a(e))},l=i=>Sp(i,t,{action:e,tab:n,count:r}),u=l(o.message),d=!!o.icon;i({title:l(o.title),content:d?xp(u,l(o.note)):u?bp(u):void 0,...d?{icon:yp(o.icon),width:440,closable:!0}:{},okText:o.okLabel,cancelText:o.cancelLabel,okButtonProps:{...e?.danger?{danger:!0}:{},...d?{icon:yp(o.icon,`cc-confirm-hero__btn-icon`)}:{}},className:d?`cc-action-confirm cc-action-confirm--hero`:`cc-action-confirm`,centered:!0,maskClosable:!1,onOk:()=>c(!0),onCancel:()=>c(!1),afterClose:()=>c(!1)})}):Promise.resolve(!0)}var wp=[`confirmEnabled`,`confirmTitle`,`confirmMessage`,`confirmOkLabel`,`confirmCancelLabel`,`confirmIcon`,`confirmNote`];function Tp(e){let t=e&&typeof e==`object`?e:{};return{confirmEnabled:t.enabled===!0,confirmTitle:typeof t.title==`string`?t.title:``,confirmMessage:typeof t.message==`string`?t.message:``,confirmOkLabel:typeof t.okLabel==`string`?t.okLabel:``,confirmCancelLabel:typeof t.cancelLabel==`string`?t.cancelLabel:``,confirmIcon:typeof t.icon==`string`?t.icon:``,confirmNote:typeof t.note==`string`?t.note:``}}function Ep(e={}){let t=e=>typeof e==`string`?e.trim():``,n={title:t(e.confirmTitle),message:t(e.confirmMessage),okLabel:t(e.confirmOkLabel),cancelLabel:t(e.confirmCancelLabel),icon:t(e.confirmIcon),note:t(e.confirmNote)},r=e.confirmEnabled===!0,i=Object.fromEntries(Object.entries(n).filter(([,e])=>e));if(!(!r&&Object.keys(i).length===0))return{enabled:r,...i}}var Dp=`cc:new-record-marks`,Op=e=>String(e??``).trim().toLowerCase(),kp=e=>String(e?.$oid??e??``).trim();function Ap(){try{return`cc:new-records:${window.localStorage.getItem(`userId`)||window.localStorage.getItem(`mongoId`)||`anon`}`}catch{return`cc:new-records:anon`}}function jp(e=Date.now()){try{let t=JSON.parse(window.localStorage.getItem(Ap())||`{}`),n={};return Object.entries(t&&typeof t==`object`?t:{}).forEach(([t,r])=>{Number.isFinite(r)&&e-r<6048e5&&(n[t]=r)}),n}catch{return{}}}function Mp(e){try{window.localStorage.setItem(Ap(),JSON.stringify(e))}catch{}try{window.dispatchEvent(new CustomEvent(Dp))}catch{}}var Np=(e,t)=>`${Op(e)}|${kp(t)}`;function Pp(e,t,n=Date.now()){!Op(e)||!kp(t)||Mp({...jp(n),[Np(e,t)]:n})}function Fp(e,t){let n=Np(e,t),r=jp();n in r&&(delete r[n],Mp(r))}var Ip=new Map,Lp=6e5;function Rp(e,t,n=Date.now()){let r=kp(t);r&&(Ip.set(r,n),Fp(e,t))}function zp(e,t=Lp,n=Date.now()){let r=Ip.get(kp(e));return Number.isFinite(r)&&n-r<t}var Bp=new Map;function Vp(e,t,n=Date.now()){if(!(!Op(e)||!kp(t))){Bp.set(Np(e,t),n);try{window.dispatchEvent(new CustomEvent(Dp))}catch{}}}function Hp(e,t=Date.now()){let n=`${Op(e)}|`,r={};return Bp.forEach((e,i)=>{if(t-e>=4e3){Bp.delete(i);return}i.startsWith(n)&&(r[i.slice(n.length)]=e)}),r}function Up(e,t=Date.now()){let n=`${Op(e)}|`,r={};return Object.entries(jp(t)).forEach(([e,t])=>{e.startsWith(n)&&(r[e.slice(n.length)]=t)}),r}function Wp(e,{enabled:t=!0}={}){let n=t&&e?Op(e):``,r=e=>({key:e,marks:e?Up(e):{},updates:e?Hp(e):{}}),[a,o]=(0,i.useState)(()=>r(n));a.key!==n&&o(r(n)),(0,i.useEffect)(()=>{if(!n)return;let e=()=>o(r(n));return window.addEventListener(Dp,e),window.addEventListener(`storage`,e),()=>{window.removeEventListener(Dp,e),window.removeEventListener(`storage`,e)}},[n]);let s=a.key===n?a.marks:{},c=a.key===n?a.updates??{}:{};return{has:e=>!!s[kp(e)],arrived:e=>{let t=s[kp(e)];return!!t&&Date.now()-t<15e3},updated:e=>{let t=c[kp(e)];return!!t&&Date.now()-t<4e3},count:Object.keys(s).length+Object.keys(c).length}}var Gp=(0,i.lazy)(()=>Promise.resolve().then(()=>require("./DocumentViewer-Dv2kBoJ2.cjs")).then(e=>e.n)),{Text:Kp}=a.Typography;function qp(e){return Yp(e?.label,e?.fieldLabel,e?.name,e?.fieldName,e?.value,e?.field)}function Jp(e){return Yp(e?.value,e?.field,e?.fieldName,e?.name,e?.label)}function Yp(...e){return e.find(e=>e!=null&&String(e).trim()!==``)}function Xp(e){return String(e??``).replace(/\[(\-?\d+)\]/g,`.$1`).split(`.`).filter(Boolean)}function Zp(e,t){if(!(!t||typeof t!=`string`))return Xp(t).reduce((e,t)=>{if(e!=null){if(/^-?\d+$/.test(t)){if(!Array.isArray(e))return;let n=Number(t);return e[n<0?e.length+n:n]}return e?.[t]}},e)}function q(e,t){return t===`id`?e?.id??e?._id:e?.[t]??Zp(e,t)}function Qp(e,t){if(!Array.isArray(e)||e.length===0||!t)return;let n=e[e.length-1];if(n!=null)return typeof n==`object`?Zp(n,t):n}function $p(e){if(Array.isArray(e))return e.some($p);if(e==null)return!1;let t=String(e).trim().toLowerCase();return t?![`all`,`internal`].includes(t):!1}function em(e){let t=Object.keys(e??{}).find(e=>/^customFields\.[^.]*profiledata\./i.test(e)&&!/^customFields\.internalprofiledata\./i.test(e));if(t)return t.replace(/^customFields\./i,``).replace(/profiledata\..*$/i,``);let n=e?.customFields;if(!n||typeof n!=`object`)return``;let r=Object.keys(n).find(e=>/profiledata$/i.test(e)&&!/^internalprofiledata$/i.test(e)&&n[e]&&typeof n[e]==`object`);return r?r.replace(/profiledata$/i,``):``}function tm(e){if(typeof e?.isVisible==`boolean`&&!e.isVisible||typeof e?.isVisible==`string`&&e.isVisible.toLowerCase()===`false`)return!1;let t=Jp(e);return!t||typeof t!=`string`?!1:/^customFields\.[^.]*profiledata\./i.test(t)&&!/^customFields\.internalprofiledata\./i.test(t)}function nm(e){return[e?.sourceType,e?.profileSource,e?.selectedSource,e?.customFields?.sourceType,e?.customFields?.profileSource].some($p)||!!em(e)}function rm(e,t){let n=q(e,t);return n==null||n===``?`-`:Array.isArray(n)?n.join(`, `):typeof n==`object`?Object.values(n).join(` `):n}function im(e){let t=e?.defaultValue;return t==null?``:String(t).trim()}function am(e){return!!e?.renderConfig?.treatZeroAsEmpty}function om(e,t=null){return e==null||e===``||e===`-`||am(t)&&(e===0||e===`0`)?!0:Array.isArray(e)?e.length===0:typeof e==`object`&&Object.keys(e).length===0}function sm(e,t){let n=im(e);return n&&om(t,e)?n:t}function cm(e){if(!e)return``;let t=e instanceof Date?e:new Date(e);if(Number.isNaN(t.getTime()))return String(e);let n=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`2-digit`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!0}).formatToParts(t),r=e=>n.find(t=>t.type===e)?.value??``;return`${`${r(`month`)} ${r(`day`)},${r(`year`)}`} | ${`${r(`hour`)}:${r(`minute`)} ${r(`dayPeriod`)}`}`}function lm(e){return String(e||`U`).trim().charAt(0).toUpperCase()||`U`}function um(e,t){let n=t.find(t=>{let n=q(e,t);return n!=null&&n!==``});return n?rm(e,n):``}function dm(e,t){let n=q(t,e.key),r=Array.isArray(n)?n:n?[n]:[],i=e.renderConfig??{},a=[i.nameField,i.labelField,`recruiterName`,`name`,`fullName`,`displayName`,`userName`,`email`,`recruiterEmail`].filter(Boolean),o=[i.metaField,i.dateField,i.assignedDateField,`assignedDateTime`,`assignedDate`,`createdAt`].filter(Boolean);return r.map((e,t)=>{let n=typeof e==`object`&&e?e:{value:e},r=um(n,a)||String(e||`User`),i=um(n,o);return{key:um(n,[`recruiterId`,`id`,`_id`,`email`,`recruiterEmail`])||`${r}-${t}`,name:r,initial:lm(r),meta:cm(i)}})}function fm({item:e}){return(0,s.jsxs)(`div`,{className:`job-avatar-tooltip`,children:[(0,s.jsx)(`div`,{className:`job-avatar-tooltip-name`,children:e.name}),e.meta&&(0,s.jsx)(`div`,{className:`job-avatar-tooltip-meta`,children:e.meta})]})}function pm({items:e}){return(0,s.jsx)(`div`,{className:`job-avatar-more-tooltip`,children:e.map(e=>(0,s.jsx)(fm,{item:e},e.key))})}function mm(e){return typeof e==`boolean`?e:typeof e==`string`?e.toLowerCase()===`true`:!!e}function hm(e){return e==null?``:Array.isArray(e)?e.join(`,`):typeof e==`object`?Object.values(e).join(` `):String(e)}function gm(e,t){return e?String(e).replace(/\{([^}]+)\}/g,(e,n)=>encodeURIComponent(hm(q(t,n)))).replace(/:([A-Za-z_][\w.]*)/g,(e,n)=>encodeURIComponent(hm(q(t,n)))):``}function _m(e){return/^(https?:\/\/|\/)/i.test(String(e))}function vm(e,t){let n=String(e??``).trim().toLowerCase();if(n===`blank`||n===`_blank`)return`_blank`;if(n===`self`||n===`_self`)return`_self`;if(n)return e;if(/^https?:\/\//i.test(String(t)))return`_blank`}function ym(e){return/^https?:\/\//i.test(String(e))}function bm(e,t,n){let r=e.routeUrl??e.routeURL??e.linkTemplate??e.linkUrl??e.href??e.url??e.action;return r?gm(r,t):_m(n)?String(n):``}function xm(e,t){if(!t||t.length<3||!e||typeof e!=`string`||e===`-`)return e;let n=e.toLowerCase(),r=t.toLowerCase(),i=[],a=0;for(;a<=e.length;){let o=n.indexOf(r,a);if(o===-1){i.push(e.slice(a));break}o>a&&i.push(e.slice(a,o)),i.push((0,s.jsx)(`mark`,{className:`search-highlight`,style:{backgroundColor:`#ffff00`,color:`inherit`,padding:0,borderRadius:2},children:e.slice(o,o+t.length)},o)),a=o+t.length}return i}function Sm(e,t,n,r=``){let i=bm(e,t,n),o=vm(e.linkTarget,i),c=xm(n,r);return ym(i)?(0,s.jsx)(a.Tooltip,{title:n===`-`?void 0:n,children:(0,s.jsx)(`a`,{className:`job-cell-link job-cell-value`,href:i,rel:o===`_blank`?`noreferrer`:void 0,target:o,children:c})}):(0,s.jsx)(a.Tooltip,{title:n===`-`?void 0:n,children:(0,s.jsx)(d.Link,{className:`job-cell-link job-cell-value`,target:o,to:i||`#`,children:c})})}function Cm(e){let t=[e?.props,e?.props?.format,e?.props?.display,e?.props?.dateDisplay,e?.renderConfig?.format,e?.renderConfig?.display,e?.renderConfig?.dateDisplay,e?.dateDisplay].map(e=>typeof e==`string`?e.trim().toLowerCase():``).find(Boolean);return t===`datetime`||t===`time`?t:`date`}function wm(e,t){if(e==null||e===``)return`-`;let n=e instanceof Date?e:new Date(e);if(Number.isNaN(n.getTime()))return rm({value:e},`value`);let r=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`2-digit`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!0,timeZone:`UTC`}).formatToParts(n),i=e=>r.find(t=>t.type===e)?.value??``,a=`${i(`month`)}, ${i(`day`)}, ${i(`year`)}`,o=`${i(`hour`)}:${i(`minute`)} ${i(`dayPeriod`)}`,s=Cm(t);return s===`time`?o:s===`datetime`?`${a} | ${o}`:a}function Tm(e){return/date/i.test(`${e.key??``} ${e.label??``} ${e.type??``}`)}function Em(e){return e==null||e===``?`-`:Array.isArray(e)?e.join(`, `):typeof e==`object`?Object.values(e).join(` `):e}function Dm(e,t,n){let r=String(t??``).trim();if(!r)return`-`;let i=r.replace(/^record\./,``);if(n?.renderConfig?.lastItemField??n?.renderConfig?.arrayDisplayField){let t=Xp(i);for(let n=t.length-1;n>=1;--n){let r=q(e,t.slice(0,n).join(`.`));if(!Array.isArray(r))continue;let i=r[r.length-1];return i==null?`-`:Em(Zp(i,t.slice(n).join(`.`)))}let r=n?.key,a=r?q(e,r):void 0;if(r&&Array.isArray(a)){let e=a[a.length-1];if(i===r)return Em(e);let t=`${r}.`;if(i.startsWith(t))return Em(Zp(e,i.slice(t.length)))}}return rm(e,i)}function Om(e){return String(e??``).replace(/\s+/g,` `).replace(/^\s*[-–—/:|·,]+\s*/,``).replace(/\s*[-–—/:|·,]+\s*$/,``).replace(/\s*([-–—/:|·,])\s*([-–—/:|·,])\s*/g,` $2 `).replace(/\s+[-–—]\s+(?=[A-Za-z$€£₹])/g,` `).replace(/\s+/g,` `).trim()}function km(e,t,n){if(typeof e!=`string`||e.trim()===``)return``;let r=!1,i=e.replace(/\{\{\s*([^}]+?)\s*\}\}/g,(e,i)=>{let a=Dm(t,i,n);return om(a,n)?``:(r=!0,String(a))});if(!r)return``;let a=i.replace(/\s+/g,` `).trim();return n?.renderConfig?.cleanEmptyTemplateSeparators?Om(a):a}function Am(e,t){let n=q(t,e.key),r=km(e.displayTemplate,t,e),i=e.renderConfig?.lastItemField??e.renderConfig?.arrayDisplayField;if(r)return r;if(i){let t=Qp(n,i);return om(t,e)?sm(e,`-`):Array.isArray(t)?sm(e,t.join(`, `)):typeof t==`object`?sm(e,Object.values(t).join(` `)):t}return Tm(e)?sm(e,wm(n,e)):sm(e,rm(t,e.key))}function jm(e,t){if(!im(e)||km(e.displayTemplate,t,e))return!1;let n=q(t,e.key),r=e.renderConfig?.lastItemField??e.renderConfig?.arrayDisplayField;return r?om(Qp(n,r),e):Tm(e)?om(wm(n,e),e):om(rm(t,e.key),e)}function Mm(e){return e===`-`||typeof e!=`string`||!e.trim()?e:e.replace(/\b([A-Za-z])([A-Za-z]*)\b/g,(e,t,n)=>e.length>1&&e===e.toUpperCase()?e:`${t.toUpperCase()}${n.toLowerCase()}`)}function Nm(e){return typeof e!=`string`||!e.includes(`-`)?e:e.replace(/(^|\s)-\s*(\d+)(?=\s*[A-Za-z])/,`$10-$2`).replace(/(\d+)\s*-\s*(?=[A-Za-z])/,`$1-0 `)}function Pm(e){let t=e.map((e,t)=>({field:e,index:t}));return t.some(({field:e})=>e.order!==void 0&&e.order!==null&&e.order!==``)?[...t].sort((e,t)=>{let n=Number(e.field.order),r=Number(t.field.order),i=Number.isFinite(n),a=Number.isFinite(r);return i&&a&&n!==r?n-r:i===a?e.index-t.index:i?-1:1}).map(({field:e})=>e):e}function Fm(e){return e.iconUrl??e.iconURL??e.icon??e.iconPath}function Im(e){return Array.isArray(e)?e.map((e,t)=>({...e,key:e.key??e.name??e.label??e.routeUrl??e.type??String(t),label:e.label??e.name??e.title??e.type??`Action`,iconUrl:Fm(e)})).filter(e=>e.iconUrl):[]}function Lm(e,t,n=[],r){if(Ru(e.key,t,n,r)||Array.isArray(e.conditions)&&e.conditions.length>0&&!e.conditions.every(e=>Fu(e,t,r)))return!1;let i=e?.showIfField??e?.visibleWhenField;return!i||Fu({field:i,operator:e?.showIfOperator||`eq`,value:e?.showIfValue??e?.visibleWhenValue??``},t,r)}function Rm(e,t={}){let n=xu(e);return n===`add`?t.canAdd!==!1:n===`edit`?t.canEdit!==!1:n!==`delete`||t.canDelete!==!1}function zm(e,t,n){let r=gm(e.routeUrl??e.routeURL??e.route??e.url??e.href,t),i=J(e.type??e.actionType),o=typeof e.label==`function`?e.label(t):e.label,c=(0,s.jsx)(`img`,{src:e.iconUrl,alt:o,className:`job-field-action-icon`}),l=`job-field-action-button`,u=e.__done,f=e.__disabledReason;return u||f?(0,s.jsx)(a.Tooltip,{title:u?u.label:f,children:(0,s.jsx)(`button`,{"aria-label":u?u.label:`${o} (unavailable)`,className:`${l} job-field-action-button--done`,type:`button`,disabled:!0,children:c})},e.key):typeof e.onClick==`function`?(0,s.jsx)(a.Tooltip,{title:o,children:(0,s.jsx)(`button`,{"aria-label":o,className:l,type:`button`,onClick:n=>{n.stopPropagation(),e.onClick(t)},children:c})},e.key):(i===`popup`||i===`modal`||e.popupKey)&&r?(0,s.jsx)(a.Tooltip,{title:o,children:(0,s.jsx)(`button`,{"aria-label":o,className:l,type:`button`,onClick:i=>{i.stopPropagation(),n?.(r,t,e)},children:c})},e.key):r&&(i===`page`||r.startsWith(`/`))?(0,s.jsx)(a.Tooltip,{title:o,children:(0,s.jsx)(d.Link,{"aria-label":o,className:l,to:r,children:c})},e.key):r?(0,s.jsx)(a.Tooltip,{title:o,children:(0,s.jsx)(`a`,{"aria-label":o,className:l,href:r,rel:`noreferrer`,target:`_blank`,children:c})},e.key):(0,s.jsx)(a.Tooltip,{title:o,children:(0,s.jsx)(`button`,{"aria-label":o,className:l,type:`button`,children:c})},e.key)}function Bm(e){let t=Array.isArray(e.secondaryFields)?e.secondaryFields:[],n=e.secondaryField?[e.secondaryField]:[];return[...t,...n].filter((e,t,n)=>e&&n.indexOf(e)===t)}function Vm(e,t){let n=e.secondarySeparator??` `,r=Bm(e).map(e=>rm(t,e)).filter(e=>e!==`-`);return r.length?r.join(` ${n} `):``}function Hm(e){return Mm(Nm(e))}function Um(e,t){if(!Array.isArray(e.valueStyles))return null;let n=J(t);return e.valueStyles.find(e=>J(e?.value)===n||J(e?.label)===n)??null}function Wm(e){let t=e?.color,n=e?.bg??e?.background??e?.backgroundColor;return{...t?{"--job-cell-badge-color":t}:{},...n?{"--job-cell-badge-bg":n}:{}}}function Gm(e){return J(e?.varient??e?.variant).replace(/[^a-z0-9-]/g,`-`)}function Km(e,t){let n=Um(e,t),r=n??e.commonStyle??{},i=n?.label??t,o=(typeof i==`string`?i.trim():i)||`-`,c=Gm(r),l=[`job-cell-badge`,`job-cell-value`,c?`job-cell-badge--${c}`:``].filter(Boolean).join(` `),u=!n&&typeof o==`string`&&o.includes(`,`)?o.split(`,`).map(e=>e.trim()).filter(Boolean):null,d=u&&u.length>1?`${u.slice(0,1).join(`, `)} +${u.length-1}`:o,f=Wm(r);return(0,s.jsx)(a.Tooltip,{title:o===`-`?void 0:o,children:(0,s.jsx)(a.Tag,{className:l,style:f,children:d})})}function qm(e,t){let n=dm(e,t),r=n.slice(0,2),i=n.slice(2);if(!n.length){let t=im(e)||`-`;return(0,s.jsx)(Kp,{className:`job-cell-primary job-cell-value`,children:t})}return(0,s.jsxs)(`span`,{className:`job-avatar-group`,children:[r.map((e,t)=>(0,s.jsx)(a.Tooltip,{overlayClassName:`job-avatar-tooltip-overlay`,title:(0,s.jsx)(fm,{item:e}),children:(0,s.jsx)(a.Avatar,{className:`job-avatar job-avatar--${t+1}`,children:e.initial})},e.key)),i.length>0&&(0,s.jsx)(a.Tooltip,{overlayClassName:`job-avatar-tooltip-overlay job-avatar-more-tooltip-overlay`,title:(0,s.jsx)(pm,{items:i}),children:(0,s.jsxs)(a.Avatar,{className:`job-avatar job-avatar--more`,children:[`+`,i.length]})})]})}function Jm(e,t){let n=e.renderConfig??{},r=q(t,e.key),i=r==null||r===``?NaN:Number(String(r).replace(`%`,``));if(!Number.isFinite(i))return(0,s.jsx)(Kp,{className:`job-cell-primary job-cell-value`,children:n.emptyText??`-`});let o=Number(n.max)>0?Number(n.max):100,c=Math.max(0,Math.min(100,Math.round(i/o*100))),l=n.progressType===`circle`;return(0,s.jsx)(a.Progress,{type:l?`circle`:`line`,percent:c,size:n.size??(l?40:`small`),showInfo:n.showInfo!==!1,strokeColor:n.strokeColor,format:e=>`${e}${n.suffix??`%`}`})}function Ym(e,t){let n=J(e.renderType);if(![`person`,`score`,`datetime`,`relativedate`,`chip`,`tonetext`,`typeicon`,`money`,`fraction`,`stack`,`chips`,`file`,`filelinks`].includes(n))return null;let r=q(t,e.key),i=e=>q(t,e);if(n===`score`)return(0,s.jsx)(Qf,{field:e,value:r});if(n===`chip`)return(0,s.jsx)(ep,{field:e,value:r});if(n===`tonetext`)return(0,s.jsx)(tp,{field:e,value:r});if(n===`typeicon`)return(0,s.jsx)(np,{field:e,value:r});if(n===`money`)return(0,s.jsx)(rp,{field:e,value:r});if(n===`fraction`)return(0,s.jsx)(op,{field:e,value:r,read:i});if(n===`chips`)return(0,s.jsx)(cp,{field:e,value:r});if(n===`file`)return(0,s.jsx)(up,{field:e,value:r,read:i});if(n===`filelinks`)return(0,s.jsx)(fp,{field:e,value:r,read:i});if(n===`datetime`||n===`relativedate`)return(0,s.jsx)($f,{field:e,value:r,relative:n===`relativedate`,read:e=>q(t,e)});let a=mm(e.isLink)?bm(e,t,r):``,c=a?vm(e.linkTarget,a):void 0,l=(0,s.jsx)(o.ExportOutlined,{className:`lv-cell-person__open`,style:{fontSize:11,opacity:.7}}),u=a?ym(a)?(0,s.jsx)(`a`,{href:a,target:c,rel:`noopener noreferrer`,"aria-label":`Open`,onClick:e=>e.stopPropagation(),children:l}):(0,s.jsx)(d.Link,{to:a,target:c,"aria-label":`Open`,onClick:e=>e.stopPropagation(),children:l}):null;return n===`stack`?(0,s.jsx)(sp,{field:e,value:r,read:i,link:u}):(0,s.jsx)(Zf,{field:e,value:Hm(Am(e,t))===`-`?``:r,read:i,link:u})}function Xm(e,t,n=``,r,i={},o=[],c){if(typeof e.render==`function`)return e.render(q(t,e.key),t);if(J(e.renderType)===`progress`)return Jm(e,t);if(J(e.renderType)===`avatar`)return qm(e,t);let l=Ym(e,t);if(l)return l;let u=jm(e,t),d=Hm(Am(e,t)),f=Im(e.actionButtons).filter(e=>Lm(e,t,o,c)).filter(e=>Rm(e,i)).map(e=>({...e,__done:Vu(e,t,c),__disabledReason:zu(e.key,t,o,c)})),p=Hm(Vm(e,t)),m=J(e.renderType)===`badge`&&d!==`-`?Km(e,d):!mm(e.isLink)||d===`-`||u?(0,s.jsx)(a.Tooltip,{title:d===`-`?void 0:d,children:(0,s.jsx)(Kp,{className:`job-cell-primary job-cell-value`,children:xm(d,n)})}):Sm(e,t,d,n);return(0,s.jsxs)(`span`,{className:`job-cell-content`,children:[(0,s.jsxs)(`span`,{className:`job-cell-main-line`,children:[m,f.length>0&&(0,s.jsx)(`span`,{className:`job-field-actions`,children:f.filter(e=>typeof e.hiddenIf!=`function`||!e.hiddenIf(t)).map(e=>zm(e,t,r))})]}),p&&(0,s.jsx)(a.Tooltip,{title:p,children:(0,s.jsx)(`span`,{className:`job-cell-secondary`,children:xm(p,n)})})]})}var Zm=130,Qm=230,$m=7.2,eh=26,th=8,nh=44,rh=20;function ih(e,t){if(Number(e.columnWidth)>0)return Math.round(Number(e.columnWidth));let n=String(e.label??``).length*th+nh;if(J(e.renderType)===`avatar`)return Math.max(Math.round(n),120);if(J(e.renderType)===`progress`)return Math.max(Math.round(n),e.renderConfig?.progressType===`circle`?90:150);let r=0;for(let n of t){let t=String(Hm(Am(e,n))??``),i=String(Hm(Vm(e,n))??``);r=Math.max(r,t.length,i.length)}let i=J(e.renderType)===`badge`?24:0,a=r*$m+eh+i;return Math.round(Math.min(Math.max(n,a,Zm),Qm))}function J(e){return String(e??``).trim().toLowerCase()}function ah(e,t){return e?.key??e?.value??e?.id??(t===void 0?void 0:String(t))}function Y(e){return J(e)}function oh(e){return[`all`,``].includes(Y(e))}function sh(e,t,n,r,i){if(oh(t))return!0;let a=J(n?.filterValue??n?.status??n?.title??n?.tabTitle??n?.name??(typeof n?.label==`string`?n.label:void 0)??n?.value??n?.key??t),o=n?.field??n?.fieldName??n?.filterField??n?.dataIndex??i;if(o)return J(rm(e,o))===a;let s=r.filter(e=>{let t=J(e.key),n=J(e.label);return t.includes(`status`)||n.includes(`status`)});return(s.length?s:r).some(t=>J(rm(e,t.key))===a)}function ch(e,t,n){return typeof n==`function`?n(e,t):typeof n==`string`?e?.[n]:e.id??e._id??e.key??t}function lh(e){return!!e?.closest?.(`a,button,input,textarea,select,label,[role="button"],[role="menuitem"],.ant-checkbox,.ant-radio,.ant-dropdown,.ant-dropdown-trigger,.ant-table-selection-column,.job-field-actions,.job-row-eye-button`)}function uh(e){return e.label??e.name??e.title??e.value}function dh(e,t){return e.key??e.value??e.route??e.name??String(t)}var fh={delete:(0,s.jsx)(o.DeleteOutlined,{}),edit:(0,s.jsx)(o.EditOutlined,{}),mail:(0,s.jsx)(o.MailOutlined,{}),shareAlt:(0,s.jsx)(o.ShareAltOutlined,{}),swap:(0,s.jsx)(o.RightOutlined,{}),thunderbolt:(0,s.jsx)(o.ThunderboltOutlined,{}),userAdd:(0,s.jsx)(o.UserAddOutlined,{}),userSwitch:(0,s.jsx)(o.UserSwitchOutlined,{})};function ph(e,t,n){let r={key:e.key,label:t?t.label:e.label,icon:fh[e.icon]??void 0,danger:t?void 0:e.danger||void 0,disabled:!!t||!!n||void 0,title:t?t.label:n||void 0};return e.children?.length&&(r.children=e.children.map(e=>ph(e))),r}function mh(e,t,n,r){if(!t?.length)return null;for(let i of t){let t=zu(e.key,i,n,r);if(t)return t}return null}function hh(e,t,n){return!e?.doneWhen?.field||!t?.length?null:t.every(t=>Vu(e,t,n))?Vu(e,t[0],n):null}function gh(e,t){return e.filter(t).map(e=>e.children?.length?{...e,children:gh(e.children,t)}:e)}function _h(e){let t=[];for(let n of e)t.push(n),n.children?.length&&t.push(..._h(n.children));return t}function vh(e){return Array.isArray(e)?e.map((e,t)=>{let n=uh(e),r=dh(e,t);return!n||!r?null:{...e,key:String(r),label:n,route:e.route||e.routeTemplate||(e.actionType===`modal`&&(e.popupKey||r)?`/popup/${e.popupKey||r}`:``),children:e.children?.length?vh(e.children):void 0}}).filter(Boolean):[]}function yh(e){let t=String(e?.key??``).trim().toLowerCase(),n=String(e?.label??``).trim().toLowerCase(),r=String(e?.popupKey??``).trim().toLowerCase(),i=String(e?.route??e?.routeTemplate??``).trim().toLowerCase();return t===`change-status`||t===`changestatus`||n===`change status`||r===`change-status`||i.includes(`/popup/change-status`)}function bh(e){let t=e?.clientSubmissionStatus,n=t&&typeof t==`object`?t:null;return{id:Number(n?.clientSubmissionStatusId??n?.id??n?.uniqueId??e?.clientSubmissionStatusId??e?.clientStatusId??e?.[`clientSubmissionStatus.clientSubmissionStatusId`]??0)||0,text:J(String(n?.clientSubmissionStatusText??n?.name??(typeof t==`string`?t:void 0)??e?.clientSubmissionStatusText??e?.clientStatusText??e?.clientStatus??e?.[`clientSubmissionStatus.clientSubmissionStatusText`]??``).trim())}}function xh(e,t,n){let r=bh(e);return r.id>0&&t.has(r.id)?!0:!!(r.text&&n.has(r.text))}function Sh(e,t,n){return e?.length?e.some(e=>xh(e,t,n)):!1}function Ch(e,t){return!e.permissionKey||!t.length||t.every(t=>Lc(Zp(t,`actionPermission.${e.permissionKey}`)))}function wh(e,t){return t?e===`asc`?`desc`:e===`desc`?``:`asc`:`asc`}function Th(e){return e===`asc`?`Ascending`:e===`desc`?`Descending`:`Neutral`}function Eh({label:e,sortDir:t,sortable:n,onSort:r}){if(!n)return(0,s.jsx)(`span`,{className:`job-table-header-label`,children:e});let i=Th(t);return(0,s.jsxs)(`div`,{className:`job-table-header-content`,children:[(0,s.jsx)(`span`,{className:`job-table-header-label`,title:typeof e==`string`?e:void 0,children:e}),(0,s.jsx)(a.Tooltip,{title:i,mouseEnterDelay:.08,overlayClassName:`job-sort-tooltip`,children:(0,s.jsx)(`button`,{type:`button`,className:`job-table-sort-trigger${t?` job-table-sort-trigger--active`:``}`,"aria-label":`Sort ${typeof e==`string`?e:`column`}, ${i}`,onClick:e=>{e.preventDefault(),e.stopPropagation(),r?.()},children:(0,s.jsxs)(`span`,{className:`job-table-sort-icon-stack`,children:[(0,s.jsx)(o.CaretUpOutlined,{className:`job-table-sort-icon job-table-sort-icon--up${t===`asc`?` job-table-sort-icon--active`:``}`}),(0,s.jsx)(o.CaretDownOutlined,{className:`job-table-sort-icon job-table-sort-icon--down${t===`desc`?` job-table-sort-icon--active`:``}`})]})})})]})}function Dh({moduleName:e,activeTabScope:t,pageSize:n,sort:r,sortDir:i,queryParams:a,dataKey:o=``}){return[o??``,e??``,t??``,n,r??``,i??``,a?JSON.stringify(a):``].join(`|`)}function Oh(e){let t=Number(e);return Number.isInteger(t)&&t>0?t:1}function kh(e){for(let t of e.keys()){let e=/^p(\d+)$/.exec(t);if(e)return Oh(e[1])}return 1}function Ah(e){[...e.keys()].forEach(t=>{(/^p\d+$/.test(t)||t===`page`)&&e.delete(t)})}var jh=[],Mh={};function Nh({record:e,fields:t,selected:n,onSelect:r,onPreview:i,onRecordClick:o,isControlled:c,selectionMode:l=`checkbox`,selectionType:u=`checkbox`,selectionDisabled:d=!1,onPopupAction:f,permissions:p}){let m=t.find(e=>e.cardRole===`name`),h=t.find(e=>e.cardRole===`action`),g=t.find(e=>e.cardRole===`headerAction`),_=t.filter(e=>e!==m&&e!==h&&e!==g),v=m?rm(e,Jp(m)):``,y=h?.render?h.render(q(e,Jp(h)),e):null,b=g?.render?g.render(q(e,Jp(g)),e):null;return(0,s.jsxs)(`div`,{className:`param-card${n?` param-card--selected`:``}`,"aria-selected":n,onClick:e=>{lh(e.target)||o?.()},role:o?`button`:void 0,tabIndex:o?0:void 0,onKeyDown:e=>{!o||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),o())},children:[(0,s.jsx)(`div`,{className:`param-card__header`,children:(0,s.jsxs)(`div`,{className:`param-card__name-row`,children:[l===`checkbox`&&(u===`radio`?(0,s.jsx)(a.Radio,{checked:n,disabled:d,onChange:r,onClick:e=>e.stopPropagation(),className:`param-card__checkbox param-card__radio`}):(0,s.jsx)(a.Checkbox,{checked:n,disabled:d,onChange:r,onClick:e=>e.stopPropagation(),className:`param-card__checkbox`})),i&&(0,s.jsx)(`button`,{type:`button`,className:`job-row-eye-button`,"aria-label":`Preview`,onClick:e=>{e.stopPropagation(),i()},children:(0,s.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.00035%204.69941C4.74567%204.69941%203.72701%205.71807%203.72701%206.97275C3.72701%208.22745%204.74567%209.24609%206.00035%209.24609C7.25503%209.24609%208.2737%208.22745%208.2737%206.97275C8.2737%205.71807%207.25503%204.69941%206.00035%204.69941ZM6.00035%205.87128C6.60827%205.87128%207.10182%206.36485%207.10182%206.97275C7.10182%207.58067%206.60827%208.07422%206.00035%208.07422C5.39243%208.07422%204.89888%207.58067%204.89888%206.97275C4.89888%206.36485%205.39243%205.87128%206.00035%205.87128ZM2.06843%206.41445C2.85434%204.9331%204.16742%203.92578%206.00035%203.92578C7.83328%203.92578%209.14637%204.9331%209.93227%206.41445C10.0838%206.70013%2010.4388%206.80902%2010.7245%206.65745C11.0102%206.50587%2011.1191%206.15091%2010.9675%205.86523C9.97758%203.9994%208.30902%202.75391%206.00035%202.75391C3.69169%202.75391%202.02312%203.9994%201.03322%205.86523C0.881648%206.15091%200.990538%206.50587%201.27619%206.65745C1.56187%206.80902%201.91686%206.70013%202.06843%206.41445Z'%20fill='%23586888'/%3e%3c/svg%3e`,alt:``,className:`job-row-eye-icon`})}),(0,s.jsx)(Kp,{className:`param-card__name`,children:v}),b&&(0,s.jsx)(`div`,{className:`param-card__header-actions`,children:b})]})}),_.length>0&&(0,s.jsx)(`div`,{className:`param-card__body-fields`,children:_.map(t=>{let n=Jp(t),r=q(e,n),i=c&&typeof t.render==`function`?t.render(r,e):Xm(t,e,``,f,p);return(0,s.jsxs)(`div`,{className:`param-card__field-row`,children:[(0,s.jsx)(Kp,{className:`param-card__field-label`,children:qp(t)}),(0,s.jsx)(`div`,{className:`param-card__field-value`,children:i})]},n)})}),(0,s.jsx)(`div`,{className:`param-card__divider`}),(0,s.jsxs)(`div`,{className:`param-card__footer`,children:[(0,s.jsx)(`div`,{className:`param-card__footer-left`}),(0,s.jsx)(`div`,{className:`param-card__footer-right`,children:y})]})]})}function Ph(e){return!!(e.operator===`isEmpty`||e.operator===`notEmpty`||e.value||e.from||e.to||Array.isArray(e.values)&&e.values.length>0)}function Fh(e){return e.fieldLabel?e.fieldLabel:(e.field??``).replace(/([A-Z])/g,` $1`).replace(/^(.)/,e=>e.toUpperCase()).trim()}function Ih(e){if(e.operator===`isEmpty`)return`Is Empty`;if(e.operator===`notEmpty`)return`Not Empty`;if(e.value)return`"${e.value}"`;if(e.from&&e.to)return`${e.from} to ${e.to}`;if(e.from)return`from ${e.from}`;if(e.to)return`to ${e.to}`;if(Array.isArray(e.values)&&e.values.length>0){let t=e.values.slice(0,2).join(`, `);return e.values.length>2?`${t} +${e.values.length-2}`:t}return``}function Lh({filters:e,onRemove:t,onClearAll:n}){let r=(e??[]).map((e,t)=>({row:e,originalIdx:t})).filter(({row:e})=>e.field&&Ph(e));return r.length===0?null:(0,s.jsxs)(a.Flex,{gap:6,wrap:`wrap`,align:`center`,className:`filter-chips-bar`,children:[(0,s.jsx)(Kp,{className:`filter-chips-bar__label`,children:`Filters:`}),r.map(({row:e,originalIdx:n})=>(0,s.jsxs)(a.Tag,{closable:!0,onClose:()=>t(n),className:`filter-chip`,children:[(0,s.jsx)(`span`,{className:`filter-chip__field`,children:Fh(e)}),(0,s.jsx)(`span`,{className:`filter-chip__sep`,children:`: `}),(0,s.jsx)(`span`,{className:`filter-chip__value`,children:Ih(e)})]},`${e.field}-${n}`)),r.length>1&&(0,s.jsx)(a.Button,{type:`link`,size:`small`,onClick:n,className:`filter-chips-clear`,children:`Clear all`})]})}function Rh({moduleName:e,authToken:n,actions:r=[],actionRules:c=[],breadcrumbItems:l=[],dataSource:u=[],className:f=``,initialPageSize:p=10,onAction:m,onSummaryClick:h,rowKey:g,showSummaryButton:_=!1,summaryButtonLabel:v=`View Summary`,summaryRoute:y,showFieldButton:b=!0,showFilterButton:x=!0,hideFilterButton:S=!1,showRowIcons:C=!0,fieldButtonLabel:w=`View Field`,fieldButtonRoute:T,tabs:E,tabTitleOverrides:D=null,tableClassName:O=`job-list-table`,fields:k=jh,fieldOverrides:A=null,extraFields:ee=jh,listName:te=``,loading:ne=!1,total:re,current:ie,pageSize:ae,onPageChange:oe,onPageSizeChange:se,onSearch:ce,toolbarExtra:le=null,listToolbar:j=null,dataKey:ue=``,dataPending:de=!1,showSearch:fe=!0,searchPlaceholder:pe=`Min 3 Chars, press Enter to search`,searchFields:me=jh,showViewToggle:he=!1,activeView:ge=`list`,onViewChange:_e,autoCardForExternalRows:ve=!0,createAction:ye,onRecordClick:be,selectedRecordId:xe,selectionMode:Se=`checkbox`,selectionLimit:Ce,selectionType:we=`checkbox`,compact:Te=!1,onSelectionChange:Ee,selectedSource:De,onTabChange:Oe,fetchData:ke=kl,responseMapper:Ae=Ed,queryParams:je=Mh,defaultVisibleColumnCount:Me=6,showAdd:Ne=!0,redirectOnViewDenied:Pe=!0,lockOuterPageScroll:Fe=!1,deferFieldConfig:Ie=!1,expandRow:Le=null,actionContext:Re=null,highlightNew:ze=!1,rowActionsInMenu:Be=!1,paginationProps:Ve=null,highlightUpdates:He=!1,subtitle:Ue=``,addLabel:We=``,selectedRowKeys:Ge,loadingSkeleton:Ke=!1}){let qe=(0,d.useNavigate)(),Je=(0,d.useLocation)(),M=ar(e),[Ye,Xe]=(0,i.useState)(()=>new Set),[Ze,Qe]=(0,i.useState)(()=>new Set);(0,i.useEffect)(()=>{if(J(M)!==`submissions`){Xe(new Set),Qe(new Set);return}let e=!1,n=new URLSearchParams({masterName:`clientSubmissions`,offset:`0`,limit:`100`});return t.x&&n.set(`app_id`,t.x),t.o(t.S,`/masters/dropdown?${n.toString()}`).then(t=>{if(e)return;let n=(Array.isArray(t?.data)?t.data:[]).filter(e=>e?.isTerminalStatus===!0);Xe(new Set(n.map(e=>Number(e?.id??e?.uniqueId??0)).filter(e=>e>0))),Qe(new Set(n.map(e=>J(e?.name)).filter(Boolean)))}).catch(()=>{e||(Xe(new Set),Qe(new Set))}),()=>{e=!0}},[M]);let $e=!!Fe,{canView:et,canAdd:tt,canEdit:nt,canDelete:rt}=du(M),{can:it}=yu(),at=JSON.stringify(je??Mh),ot=(0,i.useMemo)(()=>je??Mh,[at]),[st]=(0,d.useSearchParams)(),ct=kh(st),[N,lt]=(0,i.useState)(()=>String(De??``).trim()||`all`),[ut,dt]=(0,i.useState)(``),[ft,pt]=(0,i.useState)(``),[mt,ht]=(0,i.useState)(!1),[gt,_t]=(0,i.useState)([]),vt=Array.isArray(Ge),yt=vt?JSON.stringify(Ge.map(String)):``,[P,bt]=(0,i.useState)(()=>vt?Ge.map(String):[]),[xt,St]=(0,i.useState)([]),[Ct,wt]=(0,i.useState)(0),[F,Tt]=(0,i.useState)({current:ct,pageSize:p}),[I,Et]=(0,i.useState)({sort:``,sortDir:``}),[Dt,Ot]=(0,i.useState)([]),[kt,At]=(0,i.useState)(!1),[jt,Mt]=(0,i.useState)(()=>vt?Ge.map(String):[]),[Nt,Pt]=(0,i.useState)(yt);if(vt&&Nt!==yt){let e=JSON.parse(yt);Pt(yt),bt(e),Mt(e),St(t=>t.filter((t,n)=>e.includes(String(ch(t,n,g)))))}(0,i.useEffect)(()=>(n&&t._(n),()=>{n&&t.r()}),[n]),(0,i.useEffect)(()=>{if($e)return document.documentElement.classList.add(`listview-page-scroll-lock`),document.body.classList.add(`listview-page-scroll-lock`),()=>{document.documentElement.classList.remove(`listview-page-scroll-lock`),document.body.classList.remove(`listview-page-scroll-lock`)}},[$e]);let Ft=(0,i.useRef)(null),[It,Lt]=(0,i.useState)(0),Rt=(0,i.useRef)(),zt=(0,i.useRef)(``);(0,i.useEffect)(()=>{let e=Ft.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(e=>{let t=e[0]?.contentRect?.width;typeof t==`number`&&Lt(t)});return t.observe(e),()=>t.disconnect()},[]);let Bt=(e,t)=>String(ch(e,t,g)),Vt=Wp(e,{enabled:!!(ze||He)}),Ht=(e,t)=>{let n=[];if(xe!=null&&Ut(e,t)&&n.push(`list-view-row--active`),(ze||He)&&Vt.count>0){let r=Bt(e,t);ze&&Vt.has(r)?n.push(Vt.arrived(r)?`lv-row--new lv-row--arrived`:`lv-row--new`):He&&Vt.updated(r)&&n.push(`lv-row--updated`)}return n.join(` `)},Ut=(e,t)=>String(Bt(e,t))===String(xe??``),Wt=(e,t)=>{let n=Bt(e,t);n&&be?.(e,n)},Gt=we===`radio`,L=Gt?1:Number(Ce)>0?Number(Ce):null,R=(e,t)=>{let n=L?e.slice(0,L):e,r=(t??[]).filter(e=>e!=null),i=L?r.slice(0,L):r;bt(n),St(i),Ee?.(n,i)},[Kt,qt]=(0,i.useState)(u),[Jt,Yt]=(0,i.useState)(u.length),[Xt,Zt]=(0,i.useState)([]),[Qt,$t]=(0,i.useState)([]),[en,tn]=(0,i.useState)(``),[nn,rn]=(0,i.useState)([]),[an,on]=(0,i.useState)([]),[sn,cn]=(0,i.useState)(!1),[ln,un]=(0,i.useState)(!1),[dn,fn]=(0,i.useState)(null),[pn,mn]=(0,i.useState)(null),[hn,gn]=(0,i.useState)(!1),z=!!(oe||se||ce),_n=z?u:Kt,vn=z?re??0:Jt,yn=z?k:Qt,bn=(0,i.useMemo)(()=>_n.some(e=>nm(e)),[_n]),xn=(0,i.useMemo)(()=>yn.some(e=>tm(e)),[yn]),Sn=ve&&(bn||xn)?`card`:ge,Cn=r.length>0?r:nn,wn=c.length>0?c:an,Tn=(0,i.useMemo)(()=>vh(Cn),[Cn]),En=(0,i.useMemo)(()=>new Map(_h(Tn).map(e=>[e.key,e])),[Tn]),Dn=(0,i.useMemo)(()=>gh(Tn,e=>{let t=xu(e);return t===`add`&&!tt||t===`edit`&&!nt||t===`delete`&&!rt||!Rc(it,e.permission,M)||e.showInList===!1?!1:!e.allowedTabs||e.allowedTabs.some(e=>J(e)===J(N))}),[Tn,N,it,tt,nt,rt,M]),On=(0,i.useMemo)(()=>gh(Dn,e=>(P.length===1||e.allowMultiple||e.danger)&&Ch(e,xt)&&!(J(M)===`submissions`&&yh(e)&&Sh(xt,Ye,Ze))&&!Hu(e.key,xt,wn,N)),[N,M,wn,P.length,xt,Ye,Ze,Dn]),kn=typeof e==`string`?e.trim().length>0:!!e,An=kn?`/${M}-create${ye?`?action=${encodeURIComponent(ye)}`:``}`:``;(0,i.useEffect)(()=>{Pe&&kn&&!et&&qe(`/`,{replace:!0})},[et,kn,qe,Pe]);let jn=(e,{replace:t=!1}={})=>{let n=new URLSearchParams(st);Ah(n);let r=[n.toString(),e>1?`p${e}`:``].filter(Boolean).join(`&`);r!==Je.search.replace(/^\?/,``)&&qe({pathname:Je.pathname,search:r?`?${r}`:``},{replace:t})},Mn=(e,t)=>{Tt(t=>({...t,current:e})),jn(e,t)},B=()=>{Mn(1,{replace:!0})},{config:Pn,loading:Fn,error:In}=Kl(!z&&kn&&(!Ie||ln&&!sn&&!dn&&Qt.length===0)?e:null),Ln=(0,i.useCallback)(e=>{let t=I.sort===e,n=wh(I.sortDir,t),r=n?String(e):``;Et({sort:r,sortDir:n}),typeof ce==`function`&&ce(r,n),B()},[ce,B,I.sort,I.sortDir]),Rn=(e,t)=>{Et({sort:String(e),sortDir:t}),typeof ce==`function`&&ce(String(e),t),B()};(0,i.useEffect)(()=>{Tt(e=>e.current===ct?e:{...e,current:ct})},[ct]),(0,i.useEffect)(()=>{z&&Tt(e=>{let t=Oh(ie??e.current),n=Number(ae)>0?Number(ae):e.pageSize;return e.current===t&&e.pageSize===n?e:{current:t,pageSize:n}})},[ie,ae,z]);let zn=Je.state?.refreshTimestamp;(0,i.useEffect)(()=>{zn&&(R([],[]),wt(e=>e+1))},[zn]);let Bn=(0,i.useMemo)(()=>{let e=[...Array.isArray(E)?E:[],...Xt],t=Y(N);return e.find((e,n)=>Y(ah(e,n))===t)},[N,Xt,E]),Vn=Bn?.field??Bn?.fieldName??Bn?.filterField??Bn?.dataIndex??en,Hn=oh(N)?``:N,Un=!Hn&&!oh(N)&&J(Vn).length>0,Wn=ft.trim().length>=3,Gn=Wn?ft.trim():``,Kn=gt.some(e=>e.field),qn=Dh({moduleName:e,activeTabScope:Hn,pageSize:F.pageSize,sort:I.sort,sortDir:I.sortDir,queryParams:ot,dataKey:ue}),V=(0,i.useRef)(ue);(0,i.useEffect)(()=>{V.current!==ue&&(V.current=ue,qt([]),Yt(0),cn(!0))},[ue]);let[Jn,Yn]=(0,i.useState)(ue),Xn=!z&&!!(ue||de)&&(Jn!==ue||!!de),Zn=(0,i.useRef)(0);(0,i.useLayoutEffect)(()=>{let e=Ft.current;if(!e||!(ue||de))return;if(Xn){Zn.current>0&&(e.style.minHeight=`${Zn.current}px`);return}e.style.minHeight=``;let t=e.parentElement?.getBoundingClientRect().bottom??0,n=Math.max(0,t-e.getBoundingClientRect().bottom);Zn.current=e.offsetHeight+n});let $n=F.current===1&&pn?.key===qn,er=Number(pn?.total),tr=Wn?Number.isFinite(er)&&er>0?er:Jt:0;(0,i.useEffect)(()=>{if(z)return;if(!kn){qt([]),Yt(0),Zt([]),$t([]),tn(``),rn([]),on([]),fn(null);return}let t=Y(Hn);if(zt.current&&zt.current===t){zt.current=``;return}let n=!1,r=Wn&&tr>F.pageSize,i=r?tr:F.pageSize,o=r?0:(F.current-1)*F.pageSize;return cn(!(!Wn&&!Kn&&F.current===1&&$n)),fn(null),ke(e,i,o,{scope:Hn,sort:I.sort,sortDir:I.sortDir,search:Gn,filters:gt,queryParams:ot}).then(t=>{if(n)return;let{rows:r,total:i,tabs:a,fields:o,tabField:s,actions:c,actionRules:l}=Ae(t,e),u=!De&&oh(N)&&Array.isArray(a)&&a.length>0&&!a.some((e,t)=>oh(ah(e,t)))?ah(a[0],0):``,d=Dh({dataKey:ue,moduleName:e,activeTabScope:u?String(u):Hn,pageSize:F.pageSize,sort:I.sort,sortDir:I.sortDir,queryParams:ot});qt(r),Yt(i),Yn(ue),Zt(a),$t(o),tn(s),rn(c),on(l),u&&Y(N)!==Y(u)&&(zt.current=Y(u),lt(String(u))),!Wn&&!Kn&&F.current===1&&mn({key:d,rows:r,total:i,tabs:a,fields:o,tabField:s,actions:c,actionRules:l})}).catch(e=>{n||(qt([]),Yt(0),Yn(ue),Zt([]),$t([]),tn(``),rn([]),on([]),fn(e.message),kn&&a.message.error(`Invalid module name or data could not be loaded.`))}).finally(()=>{n||(cn(!1),un(!0))}),()=>{n=!0}},[Gn,N,Hn,gt,ue,ke,Kn,Wn,kn,z,e,F.current,F.pageSize,Ct,Ae,tr,De,I.sort,I.sortDir,ot]);let H=(0,i.useMemo)(()=>{let e=z&&Array.isArray(k)&&k.length,t=!z&&Array.isArray(Qt)&&Qt.length,n=!In&&Array.isArray(Pn)&&Pn.length,r=e?k:t?Qt:n?Pn:[],i=new Map(Qt.map(e=>[Jp(e),e]).filter(([e])=>e)),a=r.map(e=>{let t=Jp(e),n=i.get(t)??{},r=t&&A&&typeof A==`object`?A[t]:null,a=r?.renderConfig?{...n.renderConfig??e.renderConfig??{},...r.renderConfig}:e.renderConfig??n.renderConfig??null;return{...n,...e,...r??{},...a?{renderConfig:a}:{},key:t,label:qp(r??e)??qp(e)??qp(n)}}).filter(e=>e.key&&e.label),o=(Array.isArray(ee)?ee:[]).map((e,t)=>{let n=Jp(e);return n?{...e,key:n,label:qp(e)??`Field ${t+1}`,isVirtual:e.isVirtual??!0,isVisible:typeof e.isVisible!=`boolean`||e.isVisible}:null}).filter(Boolean);return Pm([...a,...o])},[Pn,In,k,ee,A,z,Qt]),U=H.find(e=>J(e.renderType)===`rowactions`),nr=j&&j.actions!==!1?Dn.filter(e=>xf(e)===`toolbar`):jh,rr=U&&!Be?Dn.filter(e=>xf(e)===`row`):jh,ir=new Set([...nr,...rr].map(e=>String(e.key))),or=ir.size?gh(On,e=>!ir.has(String(e.key))):On,sr=U?Dn.filter(e=>!ir.has(String(e.key))&&e.actionType!==`export`):jh,cr=(0,i.useMemo)(()=>H.filter(e=>typeof e.isVisible==`boolean`?e.isVisible:typeof e.isVisible!=`string`||e.isVisible.toLowerCase()===`true`).map(e=>({key:e.key,label:e.label})),[H]),lr=cr.map(e=>e.key),ur=Dt.filter(e=>lr.includes(e)),dr=ur.length?ur:cr.slice(0,Me).map(e=>e.key),fr=Math.min(Me,cr.length),pr=dr.length>Me,mr=(0,i.useMemo)(()=>H.filter(e=>!e.cardHidden&&(e.tableHidden||dr.includes(e.key))),[H,dr]),hr=(0,i.useMemo)(()=>{let e=ut.toLowerCase(),t=_n,n=Un?t.filter(e=>sh(e,N,Bn,H,Vn)):t,r=me.length?H.filter(e=>me.includes(e.key)):H;return!e||e.length<3?n:n.filter(t=>r.some(n=>String(rm(t,n.key)).toLowerCase().includes(e)||Bm(n).some(n=>String(rm(t,n)).toLowerCase().includes(e))))},[N,Bn,Vn,Un,_n,H,ut,me]),W=(0,i.useMemo)(()=>{if(!Wn)return hr;let e=(F.current-1)*F.pageSize;return hr.slice(e,e+F.pageSize)},[hr,Wn,F.current,F.pageSize]),gr=Wn?hr.length:vn,_r=ft.trim().length>=3,vr=String(hr.length).padStart(2,`0`),yr=vn>0||_n.length>0,[br,xr]=(0,i.useState)(null),Sr=(0,i.useCallback)(e=>{e&&e.url&&xr({url:e.url,...e.name?{name:e.name}:{}})},[]),Cr=(0,i.useCallback)(()=>xr(null),[]),wr=!!(j&&j.steady),Tr=wr||yr||ut.trim().length>0||ft.trim().length>0,Er=kn?dn?`Invalid module name or data could not be loaded.`:In?`Field configuration failed to load.`:`No data found.`:`Please provide a module name to view data.`,Dr=(0,i.useMemo)(()=>!D||typeof D!=`object`?null:Object.entries(D).reduce((e,[t,n])=>(n==null||(e[String(t)]=String(n)),e),{}),[D]),Or=(0,i.useMemo)(()=>{let t=Array.isArray(E)?E:[],n=!t.length,r=t.length?t:Xt.length?Xt:[{key:`all`,title:e??`List`,count:gr}],i=!!(Dr&&Object.keys(Dr).length);return!n&&!i?r:r.map((e,t)=>{if(!e||typeof e!=`object`)return e;let r=i?Dr[String(ah(e,t))]:void 0;if(!r&&!n)return e;let a={...e};if(r&&(a.title=r),n){if(ln){let t=Number(e.count??e.countValue);a.count=Number.isFinite(t)?t:0}else delete a.count,delete a.countValue}return a})},[ln,e,Xt,Dr,gr,E]);(0,i.useEffect)(()=>{if(!Or.length||!((Xt?.length??0)>0||Array.isArray(E)&&E.length>0))return;let e=Y(N);if(!Or.some((t,n)=>Y(ah(t,n))===e)){let e=ah(Or[0],0);e&&lt(String(e))}},[N,Or,Xt,E]),(0,i.useEffect)(()=>{if(De===void 0||!Or.length)return;let e=Or.find((e,t)=>Y(ah(e,t))===Y(De));if(!e)return;let t=String(ah(e,Or.indexOf(e)));(De!==Rt.current||Y(N)!==Y(t))&&(Rt.current=De,lt(e=>Y(e)===Y(t)?e:t))},[N,Or,De]);let kr=e=>{let t=H.map(e=>{let t={};return Object.entries(e).forEach(([e,n])=>{typeof n!=`function`&&(t[e]=n)}),t});qe(`/popup/preview`,{state:{background:Je,moduleName:M,record:e,fields:t}})},Ar=(e,t,n={})=>{let r=gm(e,t),i=r.startsWith(`/`)?r:`/${r}`,a=t?._id??t?.id;qe(i,{state:{background:Je,selectedIds:a===void 0?[]:[a],selectedRecords:[t],moduleName:M,popupContext:n.popupState??{},popupAction:{key:n.key,apiMethod:n.apiMethod,apiPath:n.apiPath,defaultTemplateId:n.defaultTemplateId,requireJobId:n.requireJobId,popupKey:n.popupKey,actionType:n.actionType??n.type,popupFieldOverrides:n.popupFieldOverrides},requireJobId:n.requireJobId,...n.popupState}})},jr=(0,i.useMemo)(()=>{let e={dataIndex:`icons`,key:`icons`,visibilityKey:`jobsGroup`,fixed:`left`,width:25,render:(e,t)=>(0,s.jsxs)(a.Space,{size:4,className:`job-row-icons`,children:[(0,s.jsx)(`button`,{type:`button`,className:`job-row-eye-button`,"aria-label":`Preview job`,onClick:()=>kr(t),children:(0,s.jsx)(`img`,{src:pf,alt:``,className:`job-row-eye-icon`})}),t.hasLinkedIn&&(0,s.jsx)(a.Tooltip,{title:`LinkedIn`,children:(0,s.jsx)(o.LinkedinFilled,{className:`job-row-linkedin-icon`})})]})},t=H.filter(e=>dr.includes(e.key)).map((e,t)=>{let n=I.sort===e.key?I.sortDir:``;return{title:Eh({label:e.label,sortDir:n,sortable:yr,onSort:()=>Ln(e.key)}),dataIndex:e.key,key:e.key,fixed:t===0?`left`:void 0,ellipsis:{showTitle:!1},width:ih(e,W),render:(t,n,r)=>{let i=J(e.renderType);if(i===`rowactions`)return Ir(n,r,e);if(i===`rownumber`){let e=Math.max(1,Number(F.current)||1),t=Math.max(1,Number(F.pageSize)||10);return(0,s.jsx)(`span`,{className:`lv-cell-index`,children:(e-1)*t+r+1})}return Xm(e,n,ft,Ar,{canAdd:tt,canEdit:nt,canDelete:rt},wn,Hn)}}});if(!(pr||z)&&It>0&&t.length>0){let n=(C?e.width:0)+(yr&&Se===`checkbox`?48:0)+(Le&&typeof Le.render==`function`?40:0)+rh,r=t.reduce((e,t)=>e+t.width,0),i=It-n-r;i>0&&r>0&&t.forEach(e=>{e.width=Math.floor(e.width+i*(e.width/r))})}return[...C?[e]:[],...t]},[C,N,tt,rt,nt,ft,wn,Ln,pr,yr,z,Je,e,qe,H,W,Se,I.sort,I.sortDir,It,Dn,dr,rr,sr,Le]),Mr=(0,i.useCallback)(e=>{let t=Or.find((t,n)=>Y(ah(t,n))===Y(e)),n=String(t?ah(t,Or.indexOf(t)):e);if(lt(n),vt||(bt([]),St([])),B(),typeof Oe==`function`){let e=t?.key??t?.value??t?.id??n;Rt.current=e,Oe(e)}},[Oe,Or,B]);function Nr(t,n,r){let i=En.get(String(t));if(!i||i.actionType===`group`)return;let a=Array.isArray(r)?r:[],o=()=>{(n??[]).forEach(t=>Rp(e,t)),Pr(t,n,r)};if(!gp(i)){o();return}Cp(i,a.length===1?a[0]:{},{tab:Re?.tab??``,count:a.length||(n?.length??0)}).then(e=>{e&&o()})}function Pr(e,n,r){let i=En.get(String(e));if(i&&i.actionType!==`group`){if(typeof m==`function`&&m({key:i.key,label:i.label,selectedIds:n,selectedRecords:r}),typeof i.onClick==`function`){i.onClick({action:i,selectedIds:n,selectedRecords:r});return}if(i.actionType===`export`){Lr(i,r);return}if(i.actionType===`copy`){let e=r.map(e=>Zp(e,i.copyField||`id`)??e?._id).filter(e=>e!=null);navigator.clipboard.writeText(e.join(`
8
- `)).then(()=>a.message.success(`Copied to clipboard`)).catch(()=>a.message.error(`Could not copy to clipboard`));return}if(i.actionType===`api`&&i.apiPath){let e=r[0]??{},o=gm(i.apiPath,e);t.o(t.S,o.startsWith(`/`)?o:`/${o}`,{method:i.apiMethod||`POST`,body:[`GET`,`DELETE`].includes(String(i.apiMethod).toUpperCase())?void 0:JSON.stringify({ids:n,records:r})}).then(()=>{a.message.success(`${i.label} completed`),wt(e=>e+1)}).catch(e=>a.message.error(e.message||`${i.label} failed`));return}if(i.route){let e=r[0]??{},t=gm(i.route,e),a=t.startsWith(`/`)?t:`/${t}`;if(i.route.startsWith(`/popup/`)||i.route.startsWith(`popup/`)){let t=i.popupKey||i.route?.replace(/^\/popup\//i,``)||``,o=/(?:^|\/)(?:quick(?:-|_)?submit|submit)(?:$|\/)/i.test(t),s=new URLSearchParams(Je.search).get(`jobId`),c=i.popupState?.jobId??i.popupState?.jobID??i.popupState?.jobId??e.jobId??e.job?.id??e.job?._id??s,l=i.popupState?.candidateId??i.popupState?.applicantId??e.id??e._id??e.applicantId??e.candidateId;if(o&&c&&l){let e=new URLSearchParams;e.set(`candidateId`,String(l)),e.set(`isFromSubmission`,`false`),qe(`/submission-create/${encodeURIComponent(String(c))}?${e.toString()}`);return}qe(a,{state:{background:Je,selectedIds:n,selectedRecords:r,moduleName:M,popupContext:i.popupState??{},popupAction:{key:i.key,apiMethod:i.apiMethod,apiPath:i.apiPath,defaultTemplateId:i.defaultTemplateId,requireJobId:i.requireJobId,popupFieldOverrides:i.popupFieldOverrides},...i.popupState}});return}qe(a)}}}function Fr({key:e}){let t=_h(On).find(t=>String(t.key)===String(e));t&&hh(t,xt,N)||Nr(e,P,xt)}function Ir(e,t,n){let r=Mu.list,i=t=>Ch(t,[e])&&!Ru(t.key,e,wn,Hn,r),a=rr.filter(i).map(t=>({...t,__disabledReason:zu(t.key,e,wn,Hn,r)||(Vu(t,e,Hn)?t.doneLabel||`Done`:``)})),o=sr.filter(i).map(t=>ph(t,Vu(t,e,Hn),zu(t.key,e,wn,Hn,r))),c=n?.renderConfig??{},l=c.viewField||c.downloadField?Kf({...c,viewField:c.viewField||void 0},t=>q(e,t),void 0):[];return(0,s.jsx)(ap,{inline:a,menu:o,links:l,onRun:({key:n})=>Nr(n,[Bt(e,t)],[e])})}async function Lr(t,n){let r=H.filter(e=>dr.includes(e.key)&&J(e.renderType)!==`rowactions`),i=n;if(!i.length){let t=a.message.loading(`Preparing export…`,0);try{i=Ae(await ke(e,5e3,0,{scope:Hn,sort:I.sort,sortDir:I.sortDir,search:Gn,filters:gt,queryParams:ot}),e).rows??[]}catch(e){a.message.error(e?.message||`Export failed`);return}finally{t()}}if(!i.length){a.message.info(`Nothing to export`);return}let o=Mf(r,i,(e,t)=>{let n=Hm(Am(t,e));return n===`-`?``:n}),s=URL.createObjectURL(new Blob([o],{type:`text/csv;charset=utf-8`})),c=document.createElement(`a`);c.href=s,c.download=Nf(j?.exportName||t.label||e),document.body.appendChild(c),c.click(),c.remove(),setTimeout(()=>URL.revokeObjectURL(s),0),a.message.success(i.length>=5e3?`Exported the first ${jf} rows`:`Exported ${i.length} rows`)}let Rr=dr.length===cr.length,zr=dr.length>0&&!Rr,Br=(e,t)=>{Ot(n=>{let r=cr.slice(0,Me).map(e=>e.key),i=n.length?n:r;return t?i.includes(e)?i:[...i,e]:i.length<=fr?i:i.filter(t=>t!==e)})},Vr=()=>{if(typeof h==`function`){h();return}if(y){qe(y);return}gn(!0)},Hr=()=>{T&&qe(T)};(0,i.useEffect)(()=>{if(!hn)return;let e=e=>{e.key===`Escape`&&gn(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[hn]);let Ur=()=>{$n&&(qt(pn.rows),Yt(pn.total),Yn(ue),Zt(pn.tabs),$t(pn.fields),tn(pn.tabField),rn(pn.actions??[]),on(pn.actionRules??[]),fn(null),cn(!1))},Wr=e=>{let t=e.target.value,n=t.trim().length<3,r=gt.some(e=>e.field);n&&(pt(``),r||Ur()),dt(t),B()},Gr=()=>{let e=ut.trim();e.length>=3&&(pt(e),B())},Kr=()=>{Ur(),_t([]),vt||R([],[]),B()};(0,i.useEffect)(()=>{Sn===`card`&&!vt&&(Mt([]),R([],[]))},[F.current,F.pageSize,N,Sn]);let qr=e=>{if(Gt){let t=jt.includes(e)?[]:[e];Mt(t),R(t,W.filter((e,n)=>t.includes(String(ch(e,n,g)))));return}L&&jt.length>=L&&!jt.includes(e)||Mt(t=>{let n=t.includes(e)?t.filter(t=>t!==e):L?[...t,e].slice(0,L):[...t,e],r=W.filter((e,t)=>n.includes(String(ch(e,t,g))));return R(n,r),n})},Jr=(0,s.jsxs)(`div`,{className:`column-visibility-menu`,onClick:e=>e.stopPropagation(),children:[(0,s.jsx)(a.Checkbox,{checked:Rr,indeterminate:zr,onChange:e=>{Ot(e.target.checked?cr.map(e=>e.key):cr.slice(0,Me).map(e=>e.key))},children:`Select All`}),(0,s.jsx)(`div`,{className:`column-visibility-menu__list`,children:cr.map(e=>(0,s.jsx)(a.Checkbox,{checked:dr.includes(e.key),disabled:dr.includes(e.key)&&dr.length<=fr,onChange:t=>Br(e.key,t.target.checked),children:e.label},e.key))})]});return(0,s.jsxs)(bf.Provider,{value:Sr,children:[(0,s.jsxs)(`div`,{className:`antd dynamic-list-view${Te?` list-view--compact`:``}${$e?` list-view--page-scroll-lock`:``} ${f}`.trim(),children:[l.length>0&&(0,s.jsx)(`div`,{className:`job-list-header`,children:(0,s.jsx)(Dd,{items:l})}),(0,s.jsx)(a.Card,{className:`job-tabs-card`,children:(0,s.jsxs)(a.Flex,{align:`center`,justify:`space-between`,children:[Ue?(0,s.jsxs)(a.Flex,{vertical:!0,className:`lv-list-head`,style:{minWidth:0},children:[(0,s.jsx)(Nn,{activeKey:N,tabs:Or,onChange:Mr}),(0,s.jsx)(`span`,{className:`lv-list-subtitle`,children:Ue})]}):(0,s.jsx)(Nn,{activeKey:N,tabs:Or,onChange:Mr}),(0,s.jsxs)(a.Flex,{align:`center`,gap:8,children:[le,Tr&&(0,s.jsx)(a.Input,{prefix:(0,s.jsx)(o.SearchOutlined,{className:`job-search-icon`}),placeholder:pe,value:ut,onChange:Wr,onPressEnter:Gr,allowClear:!0,className:`job-search-input`}),!z&&tt&&Ne&&(We?(0,s.jsx)(a.Button,{type:`primary`,className:`job-toolbar-add-button`,icon:(0,s.jsx)(o.PlusOutlined,{}),onClick:()=>{An&&qe(An)},children:We}):(0,s.jsx)(a.Tooltip,{title:`Add`,children:(0,s.jsx)(a.Button,{"aria-label":`Add`,className:`job-toolbar-icon-button`,icon:(0,s.jsx)(o.PlusOutlined,{}),onClick:()=>{An&&qe(An)}})})),yr&&!S&&(0,s.jsx)(a.Tooltip,{title:`Filter`,children:(0,s.jsx)(a.Badge,{count:gt.filter(e=>e.field&&Ph(e)).length,size:`small`,offset:[-2,2],children:(0,s.jsx)(a.Button,{"aria-label":`Filter`,className:`job-toolbar-icon-button`,icon:(0,s.jsx)(o.FilterOutlined,{}),onClick:()=>ht(!0)})})}),he&&yr&&(0,s.jsxs)(a.Flex,{align:`center`,gap:6,children:[(0,s.jsx)(a.Tooltip,{title:`List View`,children:(0,s.jsx)(a.Button,{className:`job-toolbar-icon-button param-view-toggle-btn${Sn===`list`?` param-view-toggle-btn--active`:``}`,icon:(0,s.jsx)(o.UnorderedListOutlined,{}),onClick:()=>{_e?.(`list`),vt||(Mt([]),R([],[]))}})}),(0,s.jsx)(a.Tooltip,{title:`Card View`,children:(0,s.jsx)(a.Button,{className:`job-toolbar-icon-button param-view-toggle-btn${Sn===`card`?` param-view-toggle-btn--active`:``}`,icon:(0,s.jsx)(o.AppstoreOutlined,{}),onClick:()=>{_e?.(`card`),vt||(Mt([]),R([],[]))}})})]}),_&&(0,s.jsx)(a.Button,{className:`job-summary-button`,type:`primary`,onClick:Vr,children:v}),b&&T&&(0,s.jsx)(a.Button,{className:`job-summary-button`,type:`primary`,onClick:Hr,children:w})]})]})}),j&&(yr||wr)&&(()=>{let e=j.sortMenu===!1?[]:Cf(H),t=wf(H),n=I.sort?`${I.sort}|${I.sortDir||`asc`}`:t?`${t.field}|${t.dir}`:void 0,r=W.map((e,t)=>String(ch(e,t,g))),i=r.length>0&&r.every(e=>P.map(String).includes(e)),o=P.length>0&&!i,c=[...(Array.isArray(j.hostButtons)?j.hostButtons:[]).filter(e=>e&&e.key!=null).map(e=>({key:`host:${e.key}`,label:e.label,icon:e.icon,listStyle:e.primary?`primary`:``,actionType:e.export?`export`:``,requireSelection:!!e.requireSelection,__disabledReason:typeof e.disabled==`string`?e.disabled:``,__host:e})),...nr.map(e=>({...e,__disabledReason:xt.length&&mh(e,xt,wn,N)||``}))];return(0,s.jsx)(a.Card,{className:`job-toolbar-card lv-toolbar-card`,children:(0,s.jsx)(pp,{steady:wr&&j.sortMenu!==!1,sortOptions:e,sortValue:e.some(e=>e.value===n)?n:void 0,onSort:Rn,showSelectAll:j.selectAll!==!1&&Se===`checkbox`&&!L,allSelected:i,someSelected:o,onToggleAll:()=>{i||o?R([],[]):R(r,[...W])},buttons:c,maxButtons:Number.isFinite(j.maxButtons)?j.maxButtons:3,hasSelection:P.length>0,onRun:e=>{if(!e.__host){Nr(e.key,P,xt);return}if(e.__host.export){Lr({key:e.key,label:e.label,actionType:`export`},xt);return}e.__host.onClick?.(xt,P)},note:j.note??``})})})(),yr&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(a.Card,{className:`job-toolbar-card`,children:(0,s.jsxs)(a.Flex,{className:`p-flex`,align:`center`,justify:`space-between`,children:[(0,s.jsxs)(a.Flex,{align:`center`,gap:3,children:[Sn===`card`&&!L&&(0,s.jsx)(a.Checkbox,{checked:W.length>0&&jt.length>=W.length,indeterminate:jt.length>0&&jt.length<W.length,className:`param-card-view__select-all`,onChange:()=>{if(vt){let e=W.map((e,t)=>String(ch(e,t,g))),t=e.some(e=>jt.includes(e)),n=jt.filter(t=>!e.includes(t)),r=t?n:[...n,...e];Mt(r),R(r,W.filter((e,t)=>r.includes(String(ch(e,t,g)))));return}if(jt.length>0)Mt([]),R([],[]);else{let e=W.map((e,t)=>String(ch(e,t,g)));Mt(e),R(e,[...W])}},children:`Select All`}),(0,s.jsx)(a.Dropdown,{open:kt,onOpenChange:At,trigger:[`click`],dropdownRender:()=>Jr,placement:`bottomLeft`,overlayClassName:`column-visibility-dropdown`,children:(0,s.jsx)(a.Button,{"aria-label":`Display columns`,type:`text`,icon:(0,s.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='path-1-inside-1_8856_23533'%20fill='white'%3e%3crect%20x='1.40039'%20y='1.40039'%20width='5.09086'%20height='5.09086'%20rx='0.727266'/%3e%3c/mask%3e%3crect%20x='1.40039'%20y='1.40039'%20width='5.09086'%20height='5.09086'%20rx='0.727266'%20stroke='%23586888'%20stroke-width='1.5'%20mask='url(%23path-1-inside-1_8856_23533)'/%3e%3cmask%20id='path-2-inside-2_8856_23533'%20fill='white'%3e%3crect%20x='1.40039'%20y='7.50781'%20width='5.09086'%20height='5.09086'%20rx='0.727266'/%3e%3c/mask%3e%3crect%20x='1.40039'%20y='7.50781'%20width='5.09086'%20height='5.09086'%20rx='0.727266'%20stroke='%23586888'%20stroke-width='1.5'%20mask='url(%23path-2-inside-2_8856_23533)'/%3e%3cline%20x1='7.375'%20y1='2.93555'%20x2='12.225'%20y2='2.93555'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='5.83398'%20x2='12.225'%20y2='5.83398'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='8.87305'%20x2='12.225'%20y2='8.87305'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='11.7227'%20x2='12.225'%20y2='11.7227'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3c/svg%3e`,alt:``,className:`job-action-list-icon`}),size:`small`,className:`job-actions-button job-column-display-button`,children:(0,s.jsx)(o.DownOutlined,{className:`job-actions-caret`})})}),or.length>0&&P.length>0&&(0,s.jsx)(a.Dropdown,{menu:{items:or.map(e=>ph(e,hh(e,xt,N),mh(e,xt,wn,N))),onClick:Fr},trigger:[`click`],children:(0,s.jsxs)(a.Button,{type:`text`,size:`small`,className:`job-actions-button job-actions-menu-button`,children:[(0,s.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.6279%206.78121C12.6857%206.88148%2012.7014%207.00057%2012.6715%207.11239C12.6417%207.22422%2012.5688%207.31967%2012.4688%207.37785L7.21875%2010.4403C7.15185%2010.4794%207.0758%2010.4999%206.99836%2010.4999C6.92092%2010.4999%206.84487%2010.4794%206.77797%2010.4403L1.52797%207.37785C1.42936%207.31859%201.35806%207.22289%201.32951%207.11145C1.30095%207.00001%201.31744%206.88181%201.37539%206.78244C1.43335%206.68306%201.52811%206.61052%201.63916%206.5805C1.75022%206.55048%201.86863%206.56542%201.96875%206.62207L7%209.55605L12.0312%206.62207C12.1315%206.56428%2012.2506%206.54858%2012.3624%206.57841C12.4743%206.60824%2012.5697%206.68116%2012.6279%206.78121ZM1.3125%204.37496C1.31267%204.29833%201.33297%204.22309%201.37136%204.15677C1.40975%204.09045%201.46489%204.03538%201.53125%203.99707L6.78125%200.934566C6.84815%200.895555%206.9242%200.875%207.00164%200.875C7.07908%200.875%207.15513%200.895555%207.22203%200.934566L12.472%203.99707C12.5381%204.0356%2012.5929%204.09076%2012.6309%204.15707C12.669%204.22337%2012.6891%204.2985%2012.6891%204.37496C12.6891%204.45142%2012.669%204.52654%2012.6309%204.59285C12.5929%204.65915%2012.5381%204.71432%2012.472%204.75285L7.22203%207.81535C7.15513%207.85436%207.07908%207.87491%207.00164%207.87491C6.9242%207.87491%206.84815%207.85436%206.78125%207.81535L1.53125%204.75285C1.46489%204.71453%201.40975%204.65946%201.37136%204.59314C1.33297%204.52682%201.31267%204.45159%201.3125%204.37496ZM2.61844%204.37496L7%206.93105L11.3816%204.37496L7%201.81886L2.61844%204.37496ZM7.65625%2011.7993L7%2012.1821L1.96875%209.24707C1.86913%209.19747%201.75436%209.18769%201.64779%209.21973C1.54122%209.25177%201.45087%209.32322%201.39512%209.41953C1.33937%209.51583%201.32241%209.62977%201.3477%209.73814C1.37299%209.84651%201.43863%209.94117%201.53125%2010.0028L6.78125%2013.0653C6.84815%2013.1044%206.9242%2013.1249%207.00164%2013.1249C7.07908%2013.1249%207.15513%2013.1044%207.22203%2013.0653L8.09703%2012.5551C8.14746%2012.5266%208.19171%2012.4883%208.22723%2012.4426C8.26275%2012.3968%208.28882%2012.3444%208.30394%2012.2885C8.31906%2012.2326%208.32291%2012.1742%208.31529%2012.1167C8.30766%2012.0593%208.28871%2012.004%208.25952%2011.9539C8.23033%2011.9039%208.19149%2011.8601%208.14526%2011.8252C8.09903%2011.7903%208.04632%2011.7649%207.9902%2011.7505C7.93408%2011.7361%207.87566%2011.7331%207.81833%2011.7414C7.761%2011.7498%207.70591%2011.7695%207.65625%2011.7993Z'%20fill='%236B7280'/%3e%3cpath%20d='M10.6036%2011.3825L13.4607%209.4477C13.5813%209.36599%2013.614%209.20256%2013.5341%209.08069L13.0105%208.282C12.9303%208.15966%2012.7665%208.12478%2012.6434%208.20383L9.54053%2010.1964L8.94939%2011.4054C8.84904%2011.6106%209.03632%2011.8387%209.25715%2011.7803L10.4338%2011.469C10.4561%2011.4631%2010.4776%2011.4543%2010.4977%2011.4429L10.6036%2011.3825ZM9.54053%2010.1964L10.6036%2011.3825'%20stroke='%236B7280'%20stroke-width='0.6'/%3e%3c/svg%3e`,alt:``,className:`job-actions-frame-icon`}),`Actions `,(0,s.jsx)(o.DownOutlined,{className:`job-actions-caret`})]})}),P.length>0&&(0,s.jsxs)(Kp,{className:`job-selected-count`,children:[`Selected (`,P.length,`)`]})]}),_r&&(0,s.jsxs)(Kp,{className:`job-search-results-count`,children:[`Search Results (`,vr,`)`]})]})})}),Kn&&(0,s.jsx)(Lh,{filters:gt,onRemove:e=>{let t=gt.filter((t,n)=>n!==e);_t(t),B()},onClearAll:Kr}),(0,s.jsx)(`div`,{ref:Ft,className:`job-table-measure`,children:(0,s.jsx)(a.Spin,{spinning:z?ne:Fn||sn||Xn,children:Ke&&!z&&(Fn||sn)&&W.length===0?(0,s.jsx)(`div`,{className:`list-view-skeleton`,"aria-busy":`true`,children:(0,s.jsx)(a.Skeleton,{active:!0,title:!1,paragraph:{rows:6}})}):Xn?(0,s.jsx)(`div`,{className:`list-view-switching`,"aria-busy":`true`,style:{minHeight:160}}):Sn===`card`?W.length===0?(0,s.jsx)(a.Empty,{image:a.Empty.PRESENTED_IMAGE_SIMPLE,description:Er,className:`param-card-view__empty`,children:!z&&tt&&Ne&&An&&!dn&&(0,s.jsx)(a.Button,{type:`primary`,icon:(0,s.jsx)(o.PlusOutlined,{}),onClick:()=>qe(An),children:`Add New`})}):(0,s.jsx)(`div`,{className:`param-card-view__grid`,children:W.map((e,t)=>{let n=String(ch(e,t,g));return(0,s.jsx)(Nh,{record:e,fields:mr,selected:Se===`checkbox`?jt.includes(n):Ut(e,t),selectionDisabled:!!(!Gt&&L&&jt.length>=L&&!jt.includes(n)),isControlled:z,onPreview:()=>kr(e),onSelect:()=>qr(n),onPopupAction:Ar,onRecordClick:be?()=>Wt(e,t):void 0,selectionMode:Se,selectionType:we,permissions:{canAdd:tt,canEdit:nt,canDelete:rt}},n)})}):(0,s.jsx)(a.Table,{rowSelection:yr&&Se===`checkbox`?{type:Gt?`radio`:`checkbox`,fixed:!0,columnWidth:48,selectedRowKeys:P,...vt?{preserveSelectedRowKeys:!0}:{},getCheckboxProps:e=>{let t=String(ch(e,W.indexOf(e),g));return{disabled:!!(!Gt&&L&&P.length>=L&&!P.map(String).includes(t))}},onChange:(e,t)=>{R(e,t)},columnTitle:(()=>{if(L)return null;let e=W.length,t=e>0&&P.length>=e,n=P.length>0&&!t;return(0,s.jsx)(a.Checkbox,{checked:t,indeterminate:n,onChange:()=>{let e=W.map((e,t)=>String(ch(e,t,g)));if(vt){let r=P.map(String).filter(t=>!e.includes(t)),i=xt.filter((t,n)=>!e.includes(String(ch(t,n,g))));n||t?R(r,i):R([...r,...e],[...i,...W]);return}if(n||t)R([],[]);else{let e=W.map((e,t)=>ch(e,t,g));R(e,[...W])}}})})()}:void 0,columns:jr,dataSource:W,size:`middle`,tableLayout:`fixed`,scroll:{x:pr||z?`max-content`:void 0,y:`calc(100vh - 300px)`},pagination:!1,locale:{emptyText:(0,s.jsx)(a.Empty,{image:a.Empty.PRESENTED_IMAGE_SIMPLE,description:Er})},className:`${O} ${Te?`list-view-table--compact`:``}`.trim(),onRow:be?(e,t)=>({onClick:n=>{lh(n.target)||Wt(e,t)},"aria-selected":Ut(e,t)}):void 0,rowClassName:xe!=null||ze||He?Ht:void 0,rowKey:(e,t)=>ch(e,t,g),expandable:Le&&typeof Le.render==`function`?{expandedRowRender:e=>Le.render(e),rowExpandable:typeof Le.rowExpandable==`function`?e=>!!Le.rowExpandable(e):void 0,columnWidth:40,...Le.iconAtEnd?{expandIconColumnIndex:jr.length+(yr&&Se===`checkbox`?1:0),expandIcon:({expanded:e,onExpand:t,record:n,expandable:r})=>r?(0,s.jsx)(a.Button,{type:`text`,size:`small`,className:`lv-row-expand`,"aria-label":e?`Collapse row`:`Expand row`,"aria-expanded":e,icon:e?(0,s.jsx)(o.UpOutlined,{}):(0,s.jsx)(o.DownOutlined,{}),onClick:e=>{e.stopPropagation(),t(n,e)}}):null}:{}}:void 0})})}),yr&&!Xn?(0,s.jsx)(Qn,{...Ve&&typeof Ve==`object`?Ve:{},current:F.current,pageSize:F.pageSize,total:gr,onChange:(e,t)=>{if(z&&typeof oe==`function`){oe(e,t??F.pageSize);return}Mn(e)},onPageSizeChange:e=>{if(z&&typeof se==`function`){se(e);return}Tt({current:1,pageSize:e}),jn(1,{replace:!0})}}):void 0,(0,s.jsx)(ff,{moduleName:M,open:mt,filters:gt,onClose:()=>ht(!1),onApply:({filters:e})=>{_t(e),B()},onReset:Kr}),(0,s.jsx)($d,{moduleName:M,open:hn,rows:Kt,tabs:Or,total:gr,onClose:()=>gn(!1)})]}),br&&(0,s.jsx)(i.Suspense,{fallback:null,children:(0,s.jsx)(Gp,{documents:[br],open:!0,onClose:Cr})})]})}var zh=Object.freeze([`form`,`list`,`choiceCards`,`accessMatrix`,`permissionMatrix`,`activity`,`declaration`,`review`,`success`,`preview`]),Bh=/^[a-zA-Z][a-zA-Z0-9]*([.-][a-zA-Z0-9]+)*$/,Vh=new Map,Hh=new Map,Uh=e=>typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`;function Wh(e){typeof console<`u`&&console.warn(`[core-theme wizard] ${e}`)}function Gh(e,t,n,r){let i=String(n??``).trim();return Bh.test(i)?Uh(r)?(e.set(i,r),()=>{e.get(i)===r&&e.delete(i)}):(Wh(`${t} "${i}" needs a React component.`),null):(Wh(`${t} id "${i}" is not valid; use letters and digits, separated by dots.`),null)}function Kh(e,t){return zh.includes(String(e??``).trim())?(Wh(`step type "${e}" is built in and cannot be replaced.`),null):Gh(Vh,`Step type`,e,t)}function qh(e,t){return Gh(Hh,`Preview`,e,t)}function Jh(e){return Vh.get(String(e??``).trim())??null}function Yh(e){return Hh.get(String(e??``).trim())??null}function Xh(){return[...Vh.keys()]}var Zh=e=>(Array.isArray(e)?e.map(String):String(e??``).split(`.`)).filter(e=>e!==``);function Qh(e,t){return Zh(t).reduce((e,t)=>e?.[t],e)}var $h=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null);function eg(e,t,n){let r=Zh(t);if(!r.length)return e;let i=$h(e)?{...e}:{},a=i;return r.slice(0,-1).forEach(e=>{a[e]=$h(a[e])?{...a[e]}:{},a=a[e]}),a[r[r.length-1]]=n,i}var tg=e=>e?.content?.type||`form`;function ng(e){return(Array.isArray(e)?e:e==null||e===``?[]:[e]).map(e=>typeof e==`object`&&e?e._id??e.id??e.value:e).filter(e=>e!=null&&e!==``).map(String)}function rg(e={},t={}){if(e?.selectionMode===`single`)return{limit:1,source:`single`,field:``};let n=String(e?.selectionLimitField??``).trim();if(n){let e=Number(Qh(t,n));if(Number.isInteger(e)&&e>0)return{limit:e,source:`field`,field:n}}let r=Number(e?.selectionLimit);return e?.selectionLimit!==``&&e?.selectionLimit!==null&&Number.isInteger(r)&&r>0?{limit:r,source:`config`,field:``}:{limit:null,source:n?`fieldMissing`:null,field:n}}var ig=e=>String(e?.selectionLabel??``).trim()||`items`;function ag(e={},t={}){let n=ng(Qh(t,e?.selectionField)),{limit:r,source:i,field:a}=rg(e,t),o=n.length,s=!!r&&o>r,c=!!r&&o>=r,l=r?`${o} of ${r} selected`:`${o} selected`,u=``;return s?u=`Too many selected: the limit is ${r}. Remove ${o-r} to continue.`:c&&r===1?u=`Only one can be chosen. Remove it to choose another.`:c?u=`Limit reached (${r}). Remove one to choose another.`:i===`fieldMissing`&&(u=`The limit is set by "${a}", which has no value yet.`),{ids:n,count:o,limit:r,locked:c,over:s,text:l,reason:u}}function og(e={},t=()=>({})){let n=ig(e);return{validator:async()=>{let{count:r,limit:i,over:a}=ag(e,t()??{});if(e?.required&&r===0){let t=i&&i>1?`Select 1–${i} ${n} to continue.`:`Choose at least one option to continue.`;throw Error(e.requiredMessage||t)}if(a)throw Error(`You selected ${r} ${n}, but the limit is ${i}. Remove ${r-i} to continue.`)}}}function sg(e){let t=(e?.errorFields??[]).flatMap(e=>e?.errors??[]),n=[...new Set(t.map(e=>String(e??``).trim()).filter(Boolean))];return!n.length&&e instanceof Error&&e.message?[e.message]:n}function cg(e=[],t={}){let n={};return e.forEach(e=>{let r=e?.content?.selectionField;r&&(n[String(e.key)]=ng(Qh(t,r)))}),n}function lg(e=[],t=[]){let n=new Set,r=e=>{let t=Zh(e).join(`.`);t&&n.add(t)};return(e??[]).forEach(e=>{e?.addRow&&e.name&&r(e.name),(e?.fields??[]).forEach(e=>{r(e?.field),e?.payloadKey&&r(e.payloadKey)})}),(t??[]).forEach(e=>{let t=e?.content??{};r(t.selectionField),r(t.selectionRecordField),r(t.signature?.field),r(t.signature?.dateField),(t.declarationItems??[]).forEach(e=>r(e?.key)),(e.groups??[]).forEach(e=>(e?.fields??[]).forEach(e=>r(e?.field)))}),n}function ug(e={},t=[],n=new Set){let r=$h(e)?e:{},i=[],a=[];return(t??[]).forEach(e=>{(Array.isArray(e?.content?.payloadMap)?e.content.payloadMap:[]).forEach(t=>{let o=String(t?.from??``).trim(),s=Zh(t?.to).join(`.`);if(!o||!s){a.push({step:e.key,from:o,to:s,reason:`incomplete`});return}if(!n.has(s)){a.push({step:e.key,from:o,to:s,reason:`undeclared`});return}let c=o===`selection`?e?.content?.selectionField:o;if(!c){a.push({step:e.key,from:o,to:s,reason:`noSelectionField`});return}let l=Qh(r,c);if(l===void 0){a.push({step:e.key,from:o,to:s,reason:`noValue`});return}r=eg(r,s,l),i.push({step:e.key,from:o,to:s})})}),{values:r,applied:i,skipped:a}}var dg=e=>typeof File<`u`&&e instanceof File||typeof Blob<`u`&&e instanceof Blob;function fg(e){if(!(dg(e)||typeof e==`function`)){if(Array.isArray(e))return e.map(fg).filter(e=>e!==void 0);if($h(e)){let t={};return Object.entries(e).forEach(([e,n])=>{if(e===`originFileObj`)return;let r=fg(n);r!==void 0&&(t[e]=r)}),t}return e}}function pg(e=[]){for(let t=e.length-1;t>=0;--t)if(tg(e[t])!==`success`)return t;return-1}function mg(e,t){let n=e?.content?.actions;return!n||typeof n!=`object`?``:String(n[t]??``).trim()}function hg(e,t=[]){let n=e?.wizardContent?.addRowView;return n===`table`||n===`cards`?n:e?.mergeInto&&(t??[]).find(t=>t!==e&&String(t?.name)===String(e.mergeInto))?.wizardContent?.addRowView===`table`?`table`:`cards`}var gg=/^[A-Za-z][A-Za-z0-9_]{0,63}$/,_g=/^[A-Za-z_][A-Za-z0-9_.]{0,127}$/,vg=Object.freeze([`module`,`limit`,`offset`,`scope`,`search`,`sort`,`sortDir`,`filters`,`view`,`listSource`,`selected`,`recordId`,`tabs`,`tabField`,`tabValue`,`booleanQuery`,`include`,`includeHidden`,`includeRaw`,`raw`,`allFields`,`extraFields`,`actionView`]),yg=new Set(vg.map(e=>e.toLowerCase()));function bg(e){let t=String(e??``);return gg.test(t)&&!yg.has(t.toLowerCase())}function xg(e){if(e==null||typeof e==`function`)return;if(e instanceof Date)return Number.isNaN(e.getTime())?void 0:e.toISOString();if(typeof e==`object`){if(typeof e.toISOString==`function`){if(typeof e.isValid==`function`&&!e.isValid())return;try{return e.toISOString()}catch{return}}let t=e.value??e._id??e.id;return typeof t==`object`&&t?void 0:xg(t)}let t=String(e);return t.trim()===``?void 0:t}function Sg(e){if(Array.isArray(e)){let t=e.map(xg).filter(e=>e!==void 0);return t.length?t.join(`,`):void 0}return xg(e)}function Cg(e,t={}){let n={};return $h(e)&&Object.entries(e).forEach(([e,r])=>{if(!bg(e)||!_g.test(String(r??``)))return;let i=Sg(Qh(t,r));i!==void 0&&(n[e]=i)}),n}function wg(e={},t={},{recordId:n=``,selectedIds:r=[]}={}){let i={};$h(e)&&Object.entries(e).forEach(([e,t])=>{bg(e)&&typeof t==`string`&&t!==``&&(i[e]=t)});let a=String(t?.listSource??``).trim(),o=String(t?.listView??``).trim();if(a&&(i.listSource=a),o&&(i.view=o),a){let e=ng(r);e.length&&(i.selected=e.join(`,`));let t=String(n??``).trim();t&&(i.recordId=t)}return i}function Tg(e=[]){return(e??[]).some(e=>e?.content?.saveVia===`action`)}function Eg(e=[]){let t=pg(e);if(t>=0&&mg(e[t],`onFinish`))return t;for(let t=(e??[]).length-1;t>=0;--t)if(mg(e[t],`onFinish`))return t;return-1}var Dg=e=>String(e??``).split(`.`).filter(Boolean),X=(e,t)=>{let n=Dg(t);return n.length?n.reduce((e,t)=>e?.[t],e):void 0},Og=e=>String(e?._id??e?.id??e?.value??``),Z=e=>Array.isArray(e)?e:e==null||e===``?[]:[e];function kg(e){if(Array.isArray(e))return e;for(let t of[e?.data,e?.records,e?.items,e?.data?.records,e?.data?.data])if(Array.isArray(t))return t;return[]}function Q(e){return e==null||e===``?`Not provided`:typeof e==`boolean`?e?`Yes`:`No`:Array.isArray(e)?e.map(Q).join(`, `):typeof e==`object`?e.name||e.label||e.title||JSON.stringify(e):String(e)}function Ag(e,t){if(t==null||t===``)return Q(t);if(Array.isArray(t))return t.map(t=>Ag(e,t)).join(`, `);if(e?.type===`date`)return yn(t)||Q(t);let n=Z(e?.options).find(e=>String(e?.value??e)===String(t));return Q(n?n.label??n:t)}function jg(e){let t=String(e??``).split(`.`).pop().replace(/[_-]+/g,` `).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).trim().toLowerCase();return t?t.charAt(0).toUpperCase()+t.slice(1):``}function Mg(e){let t=String(e??``).trim();return!t.startsWith(`/`)||t[1]===`/`||t[1]===`\\`||/[\u0000-\u001F\u007F]/.test(t)?``:t}function Ng(e,t=100,n=``){let r=String(n??``).trim(),a=`${e??``}|${t}|${r}`,[o,s]=(0,i.useState)({requestKey:``,loading:!1,rows:[],error:``});return(0,i.useEffect)(()=>{let n=!1;if(e)return(r?kl(e,t,0,{queryParams:{listSource:r}}):pr(e,t,0)).then(e=>{n||s({requestKey:a,loading:!1,rows:kg(e),error:``})}).catch(e=>{n||s({requestKey:a,loading:!1,rows:[],error:e?.message||`Could not load this information.`})}),()=>{n=!0}},[t,e,r,a]),e?o.requestKey===a?o:{loading:!0,rows:[],error:``}:{loading:!1,rows:[],error:``}}var{Paragraph:Pg,Text:Fg,Title:Ig}=a.Typography,Lg=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function Rg({result:e,caption:t}){if(e==null)return(0,s.jsx)(a.Empty,{description:`There is nothing to preview yet.`});if(typeof e!=`object`)return(0,s.jsx)(Pg,{children:String(e)});let n=Array.isArray(e)?e:Z(e.rows);if(!n.length)return(0,s.jsx)(a.Empty,{description:`There is nothing to preview yet.`});let r=Array.isArray(e.columns)?e.columns:null,i=r?r.map(e=>Lg(e)?e.key:e).filter(Boolean).map(String):[...new Set(n.flatMap(e=>Lg(e)?Object.keys(e):[]))].filter(e=>!e.startsWith(`_`)),o=e=>{let t=r?.find(t=>Lg(t)?String(t.key)===e:String(t)===e);return Lg(t)&&t.label||jg(e)};return(0,s.jsx)(a.Table,{className:`v1-wizard-result-table`,size:`small`,rowKey:`__v1RowKey`,dataSource:n.filter(Lg).map((e,t)=>({...e,__v1RowKey:String(e._id??e.id??t)})),pagination:n.length>20&&{pageSize:20,showSizeChanger:!1},scroll:{x:`max-content`},title:t?()=>t:void 0,columns:i.map(e=>({key:e,dataIndex:e,title:o(e),render:e=>Q(e)}))})}function zg(e){let{config:t={},step:n,actionResult:r=null,stepBusy:o=!1}=e,c=String(t.preview??``).trim(),l=c?Yh(c):null;return l?(0,i.createElement)(l,e):r==null?o?(0,s.jsx)(a.Skeleton,{active:!0,paragraph:{rows:5}}):c?(0,s.jsx)(a.Alert,{showIcon:!0,type:`error`,role:`alert`,message:`The preview "${c}" is not available in this app.`,description:`Register it in the host app with registerWizardPreview, or give this step an action that returns the preview data.`}):mg(n,`onEnter`)?(0,s.jsx)(a.Empty,{description:`There is nothing to preview yet.`}):(0,s.jsx)(a.Alert,{showIcon:!0,type:`info`,message:`Choose a preview, or an action that returns preview data, for this step in Admin.`}):(0,s.jsx)(Rg,{result:r})}var Bg=e=>String(e?.key??e?.module??e?.moduleName??e?.name??Og(e)),Vg=e=>Q(e?.label??e?.title??e?.name??e?.module??Bg(e));function Hg(e){return Lg(e)?Object.values(e).reduce((e,t)=>e+(Lg(t)?Object.values(t).filter(e=>e===!0).length:0),0):0}function Ug({config:e={},form:t,moduleName:n=``}){let r=Lg(e.permissionMatrix)?e.permissionMatrix:{},i=String(r.rowsSource??``).trim(),o=Z(r.actions).map(e=>String(e??``).trim()).filter(Boolean),c=Dg(e.selectionField),l=a.Form.useWatch(c.length?c:[`__v1WizardMatrixOff__`],{form:t,preserve:!0}),u=Lg(l)?l:{},{rows:d,loading:f,error:p}=Ng(c.length&&i&&o.length&&n?n:``,Number(e.fetchLimit)||200,i);if(!c.length)return(0,s.jsx)(a.Alert,{showIcon:!0,type:`error`,role:`alert`,message:`This permission table has no "Save the choice in" field. Set one in Admin.`});if(!i)return(0,s.jsx)(a.Alert,{showIcon:!0,type:`info`,message:`Choose the rows source for this permission table in Admin.`});if(!o.length)return(0,s.jsx)(a.Alert,{showIcon:!0,type:`info`,message:`Add at least one action column for this permission table in Admin.`});if(!n)return(0,s.jsx)(a.Alert,{showIcon:!0,type:`error`,role:`alert`,message:`This permission table needs the form's module to load its rows.`});let m=e=>{t?.setFieldValue(c,e),t?.validateFields([c]).catch(()=>{})},h=(e,t,n)=>{let r=Lg(u[e])?u[e]:{};m({...u,[e]:{...r,[t]:n}})},g=(e,t)=>{let n=Lg(u[e])?u[e]:{};m({...u,[e]:{...n,...Object.fromEntries(o.map(e=>[e,t]))}})},_=[{key:`__row`,title:e.selectionLabel||`Module`,render:(e,t)=>(0,s.jsx)(Fg,{strong:!0,children:Vg(t)})},...r.allColumn===!0?[{key:`__all`,title:`All`,align:`center`,render:(e,t)=>{let n=Bg(t),r=o.filter(e=>u[n]?.[e]===!0).length;return(0,s.jsx)(a.Checkbox,{checked:r===o.length,indeterminate:r>0&&r<o.length,onChange:e=>g(n,e.target.checked),"aria-label":`All actions for ${Vg(t)}`})}}]:[],...o.map(e=>({key:e,title:jg(e),align:`center`,render:(t,n)=>{let r=Bg(n);return(0,s.jsx)(a.Checkbox,{checked:u[r]?.[e]===!0,onChange:t=>h(r,e,t.target.checked),"aria-label":`${jg(e)} for ${Vg(n)}`})}}))];return(0,s.jsxs)(`section`,{className:`v1-wizard-matrix`,"aria-label":e.selectionLabel||`Permissions`,children:[(0,s.jsx)(a.Form.Item,{name:c,hidden:!0,noStyle:!0,rules:e.required===!0?[{validator:async(t,n)=>{if(Hg(n)===0)throw Error(e.requiredMessage||`Tick at least one permission to continue.`)}}]:[],children:(0,s.jsx)(a.Input,{})}),f?(0,s.jsx)(a.Skeleton,{active:!0,paragraph:{rows:5}}):p?(0,s.jsx)(a.Alert,{showIcon:!0,type:`error`,message:p}):d.length?(0,s.jsx)(a.Table,{size:`small`,className:`v1-wizard-matrix__table`,rowKey:Bg,dataSource:d,columns:_,pagination:!1,scroll:{x:`max-content`}}):(0,s.jsx)(a.Empty,{description:`There are no rows to configure.`}),(0,s.jsxs)(Fg,{type:`secondary`,className:`v1-wizard-matrix__note`,children:[Hg(u),` permission`,Hg(u)===1?``:`s`,` selected. The server checks every permission when it is used.`]})]})}function Wg(){let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function Gg({items:e=[]}){let t=Z(e).filter(e=>Lg(e)&&Dg(e.key).length&&String(e.label??``).trim());return t.length?(0,s.jsx)(`div`,{className:`v1-wizard-declaration__items`,children:t.map(e=>{let t=Mg(e.linkRoute),n=e.required!==!1;return(0,s.jsx)(a.Form.Item,{className:`v1-wizard-declaration__item`,required:n,children:(0,s.jsxs)(`div`,{className:`v1-wizard-declaration__item-row`,children:[(0,s.jsx)(a.Form.Item,{noStyle:!0,name:Dg(e.key),valuePropName:`checked`,rules:n?[{validator:(t,n)=>n?Promise.resolve():Promise.reject(Error(`Tick "${e.label}" to continue.`))}]:[],children:(0,s.jsx)(a.Checkbox,{children:e.label})}),t&&(0,s.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:`v1-wizard-declaration__link`,children:e.linkLabel||`Read more`})]})},e.key)})}):null}function Kg({signature:e,form:t,required:n=!0}){if(!Lg(e))return null;let r=Dg(e.field),i=Dg(e.dateField);return r.length?(0,s.jsxs)(`div`,{className:`v1-wizard-signature`,children:[(0,s.jsx)(a.Form.Item,{name:r,label:`Signature`,extra:`Type your full name to sign.`,rules:n?[{required:!0,whitespace:!0,message:`Type your full name to sign.`}]:[],children:(0,s.jsx)(a.Input,{className:`v1-wizard-signature__input`,autoComplete:`name`,onChange:e=>{if(!i.length||!t)return;let n=String(e?.target?.value??``).trim(),r=t.getFieldValue(i);n&&!r&&t.setFieldValue(i,Wg()),n||t.setFieldValue(i,null)},placeholder:`Full name`})}),i.length>0&&(0,s.jsx)(a.Form.Item,{name:i,label:`Date`,children:(0,s.jsx)(a.Input,{readOnly:!0,className:`v1-wizard-signature__date`,placeholder:`Filled in when you sign`})})]}):null}function qg({route:e,label:t,type:n}){let r=(0,d.useNavigate)();return(0,s.jsx)(a.Button,{type:n,onClick:()=>r(e),children:t})}function Jg({route:e,label:t,type:n=`primary`}){let r=(0,d.useInRouterContext)(),i=Mg(e);if(!i||!String(t??``).trim())return null;let o=[`primary`,`default`,`link`].includes(n)?n:`default`;return r?(0,s.jsx)(qg,{route:i,label:t,type:o}):(0,s.jsx)(a.Button,{type:o,href:i,children:t})}var Yg=/^[^\s@<>"']+@[^\s@<>"']+\.[^\s@<>"']+$/,Xg=/^[+\d][\d\s().-]{2,}$/;function Zg(e=[]){let t=new Map;return e.forEach(e=>(e?.groups??[]).forEach(e=>(e?.fields??[]).forEach(e=>{e?.field&&!t.has(e.field)&&t.set(String(e.field),e.label||e.field)}))),t}function Qg({config:e={},steps:t=[],savedRecord:n=null}){let r=Lg(e.success)?e.success:{},c=Zg(t),l=n?.values??{},u=Z(r.summaryFields).map(String).filter(Boolean).map(e=>({key:e,label:c.get(e)||jg(e),value:X(l,e)})),d=Z(r.steps).map(e=>String(e??``).trim()).filter(Boolean),f=Z(r.actions).filter(Lg),p=f.length?f:e.successActionLabel?[{label:e.successActionLabel,route:e.successActionRoute,type:`primary`}]:[],m=Lg(r.contact)?r.contact:{},h=Yg.test(String(m.email??``).trim())?String(m.email).trim():``,g=Xg.test(String(m.phone??``).trim())?String(m.phone).trim():``,[_]=(0,i.useState)(()=>`v1-wizard-success-${Math.random().toString(36).slice(2,9)}`);return(0,s.jsxs)(`section`,{className:`v1-wizard-success`,"aria-labelledby":_,children:[(0,s.jsx)(a.Result,{status:`success`,icon:(0,s.jsx)(o.CheckCircleOutlined,{}),title:(0,s.jsx)(`span`,{id:_,children:r.title||e.successTitle||`Completed successfully`}),subTitle:r.message||e.successMessage||`Your information has been saved.`}),u.length>0&&(0,s.jsxs)(`div`,{className:`v1-wizard-success__summary`,children:[(0,s.jsx)(Ig,{level:5,children:`Summary`}),(0,s.jsx)(`dl`,{className:`v1-wizard-preview__fields`,children:u.map(e=>(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`dt`,{children:e.label}),(0,s.jsx)(`dd`,{children:Q(e.value)})]},e.key))})]}),d.length>0&&(0,s.jsxs)(`div`,{className:`v1-wizard-success__steps`,children:[(0,s.jsx)(Ig,{level:5,children:`What happens next`}),(0,s.jsx)(`ol`,{children:d.map((e,t)=>(0,s.jsx)(`li`,{children:e},`${t}-${e}`))})]}),p.length>0&&(0,s.jsx)(`div`,{className:`v1-wizard-success__actions`,children:p.map((e,t)=>(0,s.jsx)(Jg,{route:e.route,label:e.label,type:e.type||(t===0?`primary`:`default`)},`${e.label}-${t}`))}),(m.label||h||g)&&(0,s.jsxs)(`div`,{className:`v1-wizard-success__contact`,children:[m.label&&(0,s.jsx)(Fg,{type:`secondary`,children:m.label}),h&&(0,s.jsxs)(`a`,{href:`mailto:${h}`,children:[(0,s.jsx)(o.MailOutlined,{"aria-hidden":`true`}),` `,h]}),g&&(0,s.jsxs)(`a`,{href:`tel:${g.replace(/[^\d+]/g,``)}`,children:[(0,s.jsx)(o.PhoneOutlined,{"aria-hidden":`true`}),` `,g]})]})]})}var{Paragraph:$g,Text:e_,Title:t_}=a.Typography,$=Object.freeze({FORM:`form`,LIST:`list`,ACTIVITY:`activity`,CHOICE_CARDS:`choiceCards`,ACCESS_MATRIX:`accessMatrix`,PERMISSION_MATRIX:`permissionMatrix`,DECLARATION:`declaration`,REVIEW:`review`,SUCCESS:`success`,PREVIEW:`preview`}),n_=new Set(Object.values($)),r_=e=>e?.content?.type||$.FORM,i_=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function a_(e){let t=e.selectionMode===`single`||String(e.selectionLimitField??``).trim()!==``||Number(e.selectionLimit)>0;return!e.required&&!t?[]:[t=>og(e,()=>t.getFieldsValue(!0))]}function o_({config:e}){let t=e.selectionField;return t?(0,s.jsx)(a.Form.Item,{name:Dg(t),hidden:!0,noStyle:!0,rules:a_(e),children:(0,s.jsx)(a.Input,{})}):null}function s_(e,t,n){if(!t)return n;let r=X(t,e.primaryField||`name`)??t.label??t.title??t.fullName??t.name;return r==null||r===``?n:Q(r)}function c_({config:e,form:t,recordId:n=``}){let r=Z(e.sourceModules).filter(Boolean),[c,l]=(0,i.useState)(r[0]),u=r.includes(c)?c:r[0],d=Dg(e.selectionField),f=Dg(e.selectionLimitField),p={form:t,preserve:!0},m=a.Form.useWatch(d.length?d:[`__v1WizardSelectionOff__`],p),h=a.Form.useWatch(f.length?f:[`__v1WizardLimitOff__`],p),g=a.Form.useWatch(Dg(e.selectionRecordField).length?Dg(e.selectionRecordField):[`__v1WizardRecordsOff__`],p),_={};d.length&&(_=l_(_,d,m)),f.length&&(_=l_(_,f,h));let v=ag(e,_),[y,b]=(0,i.useState)({}),x=e=>y[e]??Z(g).find(t=>t&&Og(t)===e),S=e.listParams;a.Form.useWatch(e=>JSON.stringify(Cg(S,e??{})),p);let C=t?.getFieldsValue?.(!0)??{},w=JSON.stringify(Cg(S,C)),T=`${e.listSource??``}|${e.listView??``}|${w}|${n??``}`,E=d.length?ng(X(C,e.selectionField)).join(`,`):``,[D,O]=(0,i.useState)({key:T,selected:E});D.key!==T&&O({key:T,selected:E});let k=D.key===T?D.selected:E,A=wg(JSON.parse(w),{listSource:e.listSource,listView:e.listView},{recordId:n,selectedIds:k?k.split(`,`):[]}),ee=Object.keys(A).length>0,te=(n,r={})=>{if(d.length&&(t.setFieldValue(d,e.selectionMode===`single`?n[0]:n),e.selectionRecordField)){let i=n.map(e=>r[e]??x(e)).filter(Boolean);t.setFieldValue(Dg(e.selectionRecordField),e.selectionMode===`single`?i[0]:i)}},ne=(t,n)=>{if(!e.selectionField)return;let r={};(n??[]).forEach(e=>{e&&Og(e)&&(r[Og(e)]=e)}),Object.keys(r).length&&b(e=>({...e,...r})),te(Z(t).map(String),r)},re=e=>te(v.ids.filter(t=>t!==e));if(!r.length)return(0,s.jsx)(a.Alert,{showIcon:!0,type:`info`,message:`Choose a list source in Admin to display records here.`});let ie=e.selectionMode!==`none`&&d.length>0;return(0,s.jsxs)(`section`,{className:`v1-wizard-content__list`,"aria-label":e.title||`Available records`,children:[(0,s.jsx)(o_,{config:e}),ie&&(0,s.jsxs)(`div`,{className:`v1-wizard-selection`,"aria-live":`polite`,children:[(0,s.jsxs)(`div`,{className:`v1-wizard-selection__summary`,children:[(0,s.jsx)(e_,{strong:!0,children:v.text}),v.reason&&(0,s.jsx)(e_,{type:v.over?`danger`:`secondary`,className:`v1-wizard-selection__reason`,children:v.reason})]}),v.ids.length>0&&(0,s.jsx)(`ul`,{className:`v1-wizard-selection__chips`,"aria-label":e.selectionLabel||`Selected`,children:v.ids.map(t=>{let n=s_(e,x(t),t);return(0,s.jsxs)(`li`,{className:`v1-wizard-selection__chip`,children:[(0,s.jsx)(`span`,{children:n}),(0,s.jsx)(a.Button,{type:`text`,size:`small`,icon:(0,s.jsx)(o.CloseOutlined,{}),className:`v1-wizard-selection__remove`,"aria-label":`Remove ${n}`,onClick:()=>re(t)})]},t)})})]}),r.length>1&&(0,s.jsx)(a.Tabs,{activeKey:u,onChange:l,items:r.map(t=>({key:t,label:e.sourceLabels?.[t]||t}))}),(0,s.jsx)(Rh,{moduleName:u,compact:!0,initialPageSize:Number(e.pageSize)||10,selectionMode:e.selectionMode===`none`?`none`:`checkbox`,selectionLimit:v.limit||void 0,selectionType:e.selectionMode===`single`&&e.selectionControl===`radio`?`radio`:`checkbox`,onSelectionChange:ne,...ie?{selectedRowKeys:v.ids}:{},...ee?{queryParams:A}:{},loadingSkeleton:!0,showAdd:e.allowAdd!==!1,showSummaryButton:!1,redirectOnViewDenied:!1,lockOuterPageScroll:!1,subtitle:e.listDescription||``},u)]})}function l_(e,t,n){if(!t.length)return e;let[r,...i]=t;return{...e,[r]:i.length?l_(i_(e[r])?e[r]:{},i,n):n}}function u_(e,t,n){if(!t)return;let r=X(e,t);if(i_(r)&&r[n]!==void 0)return r[n];let i=X(e,`${t}${n===`yearly`?`Yearly`:`Monthly`}`);return i===void 0?r:i}function d_({config:e,form:t,matrix:n=!1}){let r=Z(e.sourceModules)[0],{rows:o,loading:c,error:l}=Ng(r,Number(e.fetchLimit)||100,e.listSource),u=Dg(e.selectionField),d=a.Form.useWatch(u,t),f=!n&&i_(e.choice)?e.choice:{},[p,m]=(0,i.useState)(`monthly`),h=f.billingToggle===!0,g=Z(f.compareFields).map(String).filter(Boolean),_=Z(d).map(String),v=e.selectionMode===`single`?`single`:`multiple`,y=(e,n)=>{let r=v===`single`?e:n?[...new Set([..._,e])]:_.filter(t=>t!==e);t.setFieldValue(u,r),t.validateFields([u]).catch(()=>{})};if(!r)return(0,s.jsx)(a.Alert,{showIcon:!0,type:`info`,message:`Choose where these options should be loaded from in Admin.`});if(c)return(0,s.jsx)(a.Skeleton,{active:!0,paragraph:{rows:4}});if(l)return(0,s.jsx)(a.Alert,{showIcon:!0,type:`error`,message:l});if(!o.length)return(0,s.jsx)(a.Empty,{description:`No options are available yet.`});let b=t=>{let r=Og(t),i=_.includes(r),o=Q(X(t,e.primaryField||`name`)),c=X(t,e.secondaryField),l=X(t,e.descriptionField),u=h?u_(t,e.priceField,p):X(t,e.priceField),d=f.badgeField?X(t,f.badgeField):void 0,m=Z(X(t,e.featuresField)).filter(e=>e!=null&&e!==``);return(0,s.jsxs)(a.Card,{size:`small`,className:`v1-wizard-choice${i?` is-selected`:``}`,onClick:()=>y(r,v===`single`||!i),children:[(0,s.jsxs)(`div`,{className:`v1-wizard-choice__top`,children:[(0,s.jsxs)(`div`,{children:[d!=null&&d!==``&&d!==!1&&(0,s.jsx)(a.Tag,{className:`v1-wizard-choice__badge`,children:d===!0?jg(f.badgeField):Q(d)}),(0,s.jsx)(t_,{level:5,children:o}),c!=null&&c!==``&&(0,s.jsx)(e_,{type:`secondary`,children:Q(c)})]}),n?(0,s.jsx)(a.Switch,{checked:i,onClick:(e,t)=>t?.stopPropagation(),onChange:e=>y(r,e),"aria-label":`Enable ${o}`}):v===`single`?(0,s.jsx)(a.Radio,{checked:i,onClick:e=>e.stopPropagation(),onChange:()=>y(r,!0),"aria-label":`Choose ${o}`}):(0,s.jsx)(a.Checkbox,{checked:i,onClick:e=>e.stopPropagation(),onChange:e=>y(r,e.target.checked),"aria-label":`Choose ${o}`})]}),u!=null&&u!==``&&(0,s.jsxs)(`div`,{className:`v1-wizard-choice__price`,children:[Q(u),h&&(0,s.jsx)(e_,{type:`secondary`,className:`v1-wizard-choice__cycle`,children:p===`yearly`?` / year`:` / month`})]}),l!=null&&l!==``&&(0,s.jsx)($g,{type:`secondary`,children:Q(l)}),m.length>0&&(0,s.jsx)(`ul`,{className:`v1-wizard-choice__features`,children:m.map((e,t)=>(0,s.jsx)(`li`,{children:Q(e)},`${r}-feature-${t}`))}),g.length>0&&(0,s.jsx)(`dl`,{className:`v1-wizard-choice__compare`,children:g.map(e=>(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`dt`,{children:jg(e)}),(0,s.jsx)(`dd`,{children:Q(X(t,e))})]},e))})]},r)},x=n&&e.groupByField?Object.entries(o.reduce((t,n)=>{let r=Q(X(n,e.groupByField));return t[r]=[...t[r]||[],n],t},{})):null;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o_,{config:e}),h&&(0,s.jsx)(`div`,{className:`v1-wizard-choice__billing`,children:(0,s.jsx)(a.Segmented,{"aria-label":`Billing period`,value:p,onChange:m,options:[{label:`Monthly`,value:`monthly`},{label:`Yearly`,value:`yearly`}]})}),x?x.map(([e,t])=>(0,s.jsxs)(`section`,{className:`v1-wizard-access-group`,children:[(0,s.jsx)(t_,{level:5,children:e}),(0,s.jsx)(`div`,{className:`v1-wizard-access-grid`,children:t.map(b)})]},e)):(0,s.jsx)(`div`,{className:n?`v1-wizard-access-grid`:`v1-wizard-choice-grid`,children:o.map(b)})]})}function f_(e){return(0,s.jsx)(d_,{...e})}function p_(e){return(0,s.jsx)(d_,{...e,matrix:!0})}function m_({config:e}){let t=Z(e.sourceModules)[0],{rows:n,loading:r,error:i}=Ng(t,Number(e.fetchLimit)||50,e.listSource);return t?r?(0,s.jsx)(a.Skeleton,{active:!0,paragraph:{rows:4}}):i?(0,s.jsx)(a.Alert,{showIcon:!0,type:`error`,message:i}):n.length?(0,s.jsx)(a.Timeline,{className:`v1-wizard-activity`,items:n.map(t=>({children:(0,s.jsxs)(`div`,{children:[(0,s.jsx)(e_,{strong:!0,children:Q(X(t,e.primaryField||`title`))}),e.secondaryField&&(0,s.jsx)(`div`,{children:(0,s.jsx)(e_,{type:`secondary`,children:Q(X(t,e.secondaryField))})}),e.descriptionField&&(0,s.jsx)($g,{children:Q(X(t,e.descriptionField))})]})}))}):(0,s.jsx)(a.Empty,{description:`There is no activity to show.`}):(0,s.jsx)(a.Alert,{showIcon:!0,type:`info`,message:`Choose an activity source in Admin.`})}function h_({config:e,form:t}){let n=Dg(e.selectionField||`declarationAccepted`),r=Z(e.declarationItems).filter(i_),i=!r.length||!!(e.confirmationLabel||e.selectionField);return(0,s.jsxs)(a.Card,{className:`v1-wizard-declaration`,variant:`borderless`,children:[(0,s.jsx)(t_,{level:4,children:e.declarationTitle||`Declaration`}),(0,s.jsx)($g,{children:e.declarationText||`Please review the information above and confirm that it is correct.`}),(0,s.jsx)(Gg,{items:r}),i&&(0,s.jsx)(a.Form.Item,{name:n,valuePropName:`checked`,rules:e.required===!1?[]:[{validator:(t,n)=>n?Promise.resolve():Promise.reject(Error(e.requiredMessage||`Confirm this declaration to continue.`))}],children:(0,s.jsx)(a.Checkbox,{children:e.confirmationLabel||`I confirm that the information provided is complete and accurate.`})}),(0,s.jsx)(Kg,{signature:e.signature,form:t,required:e.required!==!1})]})}function g_(e,t){return(e.groups||[]).flatMap((e,n)=>{let r=e.name||e.payloadKey||n,i=(e.fields||[]).filter(e=>e?.field&&e.show!==0&&e.show!==!1&&e.payloadMode!==`skip`);if(!Ui(e.showIf,t,t))return[];if(!e.addRow)return i.filter(e=>Ui(e.showIf,t,t)).map(e=>({id:`${r}.${e.field}`,key:e.field,label:e.label||e.field,field:e,value:X(t,e.field)}));let a=Z(X(t,e.payloadKey||e.name));return a.flatMap((e,n)=>i.filter(n=>Ui(n.showIf,e,t)).map(t=>{let i=t.label||t.field;return{id:`${r}.${n}.${t.field}`,key:t.field,label:a.length>1?`${i} (${n+1})`:i,field:t,value:X(e,t.field)}}))})}function __({config:e,field:t,fieldKey:n,value:r}){let i=e?.type===$.PERMISSION_MATRIX&&e?.selectionField===n,a=!i&&e?.selectionField===n?Z(e.sourceModules)[0]:``,{rows:o}=Ng(a,Number(e?.fetchLimit)||100,e?.listSource);if(i){let e=i_(r)?Object.entries(r).flatMap(([e,t])=>i_(t)?Object.entries(t).filter(([,e])=>e===!0).map(([t])=>`${jg(e)}: ${jg(t)}`):[]):[];return e.length?e.join(`, `):`None selected`}if(!a||!o.length)return Ag(t,r);let s=Z(r).map(String),c=o.filter(e=>s.includes(Og(e))).map(t=>Q(X(t,e.primaryField||`name`)));return c.length?c.join(`, `):Q(r)}function v_({steps:e,form:t,current:n,onGoToStep:r}){let i=a.Form.useWatch([],t),c={...t.getFieldsValue(!0),...i||{}},l=e.filter((e,t)=>t<n&&![$.REVIEW,$.SUCCESS].includes(r_(e)));return l.length?(0,s.jsx)(`div`,{className:`v1-wizard-preview`,children:l.map((e,t)=>{let n=g_(e,c),i=e.content||{};return i.selectionField&&!n.some(e=>e.key===i.selectionField)&&n.push({id:i.selectionField,key:i.selectionField,label:i.selectionLabel||`Selection`,value:X(c,i.selectionField)}),(0,s.jsx)(a.Card,{title:e.title,extra:r&&(0,s.jsx)(a.Button,{type:`text`,icon:(0,s.jsx)(o.EditOutlined,{}),"aria-label":`Edit ${e.title}`,onClick:()=>r(t),children:`Edit`}),children:n.length?(0,s.jsx)(`dl`,{className:`v1-wizard-preview__fields`,children:n.map(e=>(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`dt`,{children:e.label}),(0,s.jsx)(`dd`,{children:(0,s.jsx)(__,{config:i,field:e.field,fieldKey:e.key,value:e.value})})]},e.id))}):(0,s.jsx)(e_,{type:`secondary`,children:`This step has no stored form values to preview.`})},e.key)})}):(0,s.jsx)(a.Empty,{description:`Complete an earlier step to preview it here.`})}function y_({route:e,label:t}){let n=(0,d.useNavigate)();return(0,s.jsx)(a.Button,{type:`primary`,onClick:()=>n(e),children:t})}function b_({route:e,label:t}){return(0,d.useInRouterContext)()?(0,s.jsx)(y_,{route:e,label:t}):(0,s.jsx)(a.Button,{type:`primary`,href:e,children:t})}function x_({config:e,steps:t,savedRecord:n}){if(i_(e.success))return(0,s.jsx)(Qg,{config:e,steps:t,savedRecord:n});let r=Mg(e.successActionRoute);return(0,s.jsx)(a.Result,{status:`success`,icon:(0,s.jsx)(o.CheckCircleOutlined,{}),title:e.successTitle||`Completed successfully`,subTitle:e.successMessage||`Your information has been saved.`,extra:e.successActionLabel&&r?(0,s.jsx)(b_,{route:r,label:e.successActionLabel}):void 0})}function S_({type:e}){let t=Xh(),n=[...Object.values($),...t];return(0,s.jsx)(a.Alert,{showIcon:!0,type:`error`,role:`alert`,message:`This step uses an unknown content type: "${String(e)}".`,description:`Choose a supported step content type in Admin (${n.join(`, `)}).`})}function C_({config:e,steps:t,current:n,form:r}){return e.rightContent===`summary`?(0,s.jsx)(v_,{steps:t,form:r,current:Math.min(t.length,n+1)}):e.rightContent===`progress`?(0,s.jsxs)(`div`,{className:`v1-wizard-context__progress`,children:[(0,s.jsx)(e_,{type:`secondary`,children:`Form progress`}),(0,s.jsxs)(t_,{level:4,children:[n+1,` of `,t.length,` steps`]}),(0,s.jsx)(a.Space,{direction:`vertical`,size:8,children:t.map((e,t)=>(0,s.jsx)(a.Tag,{color:t<n?`success`:t===n?`processing`:`default`,children:e.title},e.key))})]}):(0,s.jsxs)(`div`,{className:`v1-wizard-context__help`,children:[(0,s.jsx)(o.InfoCircleOutlined,{"aria-hidden":`true`}),(0,s.jsx)(t_,{level:4,children:e.helpTitle||`Helpful information`}),(0,s.jsx)($g,{children:e.helpText||`Add guidance for this step in Admin.`})]})}function w_(e,t,n){if(e===$.LIST)return(0,s.jsx)(c_,{...t});if(e===$.PERMISSION_MATRIX)return(0,s.jsx)(Ug,{...t});if(e===$.PREVIEW)return(0,s.jsx)(zg,{...t});if(e===$.ACTIVITY)return(0,s.jsx)(m_,{...t});if(e===$.CHOICE_CARDS)return(0,s.jsx)(f_,{...t});if(e===$.ACCESS_MATRIX)return(0,s.jsx)(p_,{...t});if(e===$.DECLARATION)return(0,s.jsx)(h_,{...t});if(e===$.REVIEW)return(0,s.jsx)(v_,{...t});if(e===$.SUCCESS)return(0,s.jsx)(x_,{...t});if(e===$.FORM)return n;let r=Jh(e);return r?(0,i.createElement)(r,t):(0,s.jsx)(S_,{type:e})}function T_({step:e,steps:t,current:n,form:r,onGoToStep:i,formContent:o,notice:c=null,moduleName:l=``,actionResult:u=null,savedRecord:d=null,stepBusy:f=!1,recordId:p=``}){let m=e?.content||{},h=r_(e),g={config:m,step:e,steps:t,current:n,form:r,onGoToStep:i,moduleName:l,actionResult:u,savedRecord:d,stepBusy:f,recordId:p},_=n_.has(h),v=!_&&!!Jh(h),y=w_(h,g,o),b=c?(0,s.jsxs)(s.Fragment,{children:[c,y]}):y,x=h!==$.FORM&&o!=null?(0,s.jsxs)(s.Fragment,{children:[b,(0,s.jsx)(`div`,{hidden:!0,className:`v1-wizard-content__retained-form`,children:o})]}):b,S=_?h:v?`registered`:`unknown`,C=m.layout===`split`,w=Math.min(75,Math.max(25,Number(m.leftWidth)||70)),T=m.mainPosition===`right`;if(!C)return(0,s.jsx)(`div`,{className:`v1-wizard-content v1-wizard-content--${S}`,children:x});let E=Math.round(w/100*24),D=24-E;return(0,s.jsxs)(a.Row,{gutter:[24,24],className:`v1-wizard-content v1-wizard-content--${S} v1-wizard-content--split`,children:[(0,s.jsx)(a.Col,{xs:24,lg:T?D:E,order:T?2:1,children:T?(0,s.jsx)(C_,{...g}):x}),(0,s.jsx)(a.Col,{xs:24,lg:T?E:D,order:T?1:2,children:T?x:(0,s.jsx)(C_,{...g})})]})}var E_=1,D_=`/wizard/actions`;Object.freeze([`onEnter`,`onNext`,`onFinish`]);var O_=/^[a-z][a-zA-Z0-9]*(\.[a-zA-Z0-9]+)*$/,k_=class extends Error{constructor(e,{actionId:t=``,status:n=0,code:r=`failed`,cause:i}={}){super(e),this.name=`WizardActionError`,this.actionId=t,this.status=n,this.code=r,i&&(this.cause=i)}},A_=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function j_(e){let t=A_(e?.data)?e.data:A_(e)?e:{},n=t.recordId??t.id??t._id;return{recordId:n==null||n===``?``:String(n),values:A_(t.values)?t.values:null,result:t.result===void 0?null:t.result,message:typeof t.message==`string`?t.message:``}}function M_(e,t){let n=Number(t?.status)||0,r=String(t?.message??``).trim();return n===404?new k_(`The server does not know the wizard action "${e}". Check the action id on this step in Admin → Form Groups, or deploy that action on the server.`,{actionId:e,status:n,code:`not_found`,cause:t}):n===403?new k_(r||`You do not have permission to run "${e}".`,{actionId:e,status:n,code:`forbidden`,cause:t}):n===422?new k_(r||`The server did not accept these values for "${e}".`,{actionId:e,status:n,code:`invalid`,cause:t}):new k_(r||`The step action "${e}" did not complete.`,{actionId:e,status:n,code:n?`failed`:`network`,cause:t})}async function N_(e,n={},{baseUrl:r=t.S,fetcher:i=t.o}={}){let a=String(e??``).trim();if(!O_.test(a))throw new k_(`"${a}" is not a valid wizard action id. Fix it on this step in Admin → Form Groups.`,{actionId:a,code:`invalid_id`});let o={contractVersion:1,module:String(n.module??``),stepKey:String(n.stepKey??``),hook:n.hook,values:A_(n.values)?n.values:{},selection:A_(n.selection)?n.selection:{}};n.recordId!==void 0&&n.recordId!==null&&String(n.recordId)!==``&&(o.recordId=String(n.recordId)),n.stepRole&&(o.stepRole=String(n.stepRole));try{let e=await i(r,`${D_}/${encodeURIComponent(a)}`,{method:`POST`,body:JSON.stringify(o)});if(e?.status===!1||e?.success===!1){let t=Error(String(e?.error??e?.message??``));throw t.status=422,t}return j_(e)}catch(e){throw e instanceof k_?e:M_(a,e)}}function P_(){try{return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}catch{return!1}}function F_(e){if(e){try{e.scrollIntoView?.({block:`center`,behavior:P_()?`auto`:`smooth`})}catch{}e.focus?.({preventScroll:!0})}}var I_=`Fix the highlighted fields to continue.`;function L_(e,t){let n=[`list`,`choiceCards`,`accessMatrix`,`permissionMatrix`].includes(tg(t))?String(t?.content?.selectionField??``).trim():``,r=[],i=!1;(e?.errorFields??[]).forEach(e=>{let t=(Array.isArray(e?.name)?e.name:[e?.name]).join(`.`);n&&t===n?r.push(...e.errors??[]):(e?.errors??[]).length&&(i=!0)}),!e?.errorFields&&e instanceof Error&&r.push(...sg(e));let a=[...new Set(r.map(e=>String(e??``).trim()).filter(Boolean))];return i&&a.push(I_),a.length?a:[`Complete this step to continue.`]}function R_({enabled:e=!1,steps:t=[],current:n=0,setCurrent:r,form:a,moduleName:o=``,recordId:s=``,groups:c=[],validationNames:l,onValidationFailed:u,runAction:d=N_}={}){let[f,p]=(0,i.useState)({blocked:null,actionError:null}),[m,h]=(0,i.useState)(``),g=(0,i.useRef)(!1),[_,v]=(0,i.useState)(``),[y,b]=(0,i.useState)({}),[x,S]=(0,i.useState)(null),C=(0,i.useRef)(!0);(0,i.useEffect)(()=>(C.current=!0,()=>{C.current=!1}),[]);let w=String(s||_||``),T=t[n],E=(0,i.useMemo)(()=>lg(c,t),[c,t]),D=(0,i.useCallback)(n=>e?ug(n,t,E).values:n,[e,t,E]),O=(0,i.useCallback)(async(e,n,r={})=>{let i=t[n],c=mg(i,e);if(!c)return null;let l=a?.getFieldsValue?.(!0)??{},u=fg(D(r.values??l)),f=await d(c,{module:o,recordId:r.recordId??w,stepKey:i?.key,stepRole:i?.content?.stepRole,hook:e,values:u,selection:cg(t,r.values??l)});return C.current?(f?.values&&a?.setFieldsValue&&a.setFieldsValue(f.values),f?.recordId&&!s&&v(f.recordId),f?.result!==null&&f?.result!==void 0&&b(e=>({...e,[String(i?.key)]:f.result})),f):f},[t,a,D,d,o,w,s]),k=(0,i.useCallback)(async(e,t)=>{if(!g.current){g.current=!0,h(e);try{return await t()}finally{g.current=!1,C.current&&h(``)}}},[]),A=(0,i.useCallback)((e,n,r,i)=>{p(a=>({...a,actionError:{stepIndex:e,hook:n,actionId:r?.actionId||mg(t[e],n),code:r?.code||`failed`,message:r?.message||`This step could not be completed.`,resume:i,token:(a.actionError?.token??0)+1}}))},[t]),ee=(0,i.useCallback)(()=>k(`next`,async()=>{if(!e||!T)return!1;let i=n;p({blocked:null,actionError:null});try{let e=l?l(T):void 0;await a.validateFields(e,{recursive:!0})}catch(e){let t=L_(e,T),n=tg(T)!==`form`;return p(e=>({blocked:{stepIndex:i,messages:t,focus:n,token:(e.blocked?.token??0)+1},actionError:null})),n||u?.(e),!1}if(mg(T,`onNext`))try{await O(`onNext`,i)}catch(e){return A(i,`onNext`,e),!1}return r?.(Math.min(i+1,t.length-1)),!0}),[e,T,n,k,l,a,u,O,A,r,t.length]),te=(0,i.useRef)(-1),ne=e?mg(T,`onEnter`):``,re=(0,i.useCallback)(e=>k(`enter`,async()=>{try{if(await O(`onEnter`,e),!C.current)return;p(t=>t.actionError?.stepIndex===e?{...t,actionError:null}:t)}catch(t){if(!C.current)return;A(e,`onEnter`,t)}}),[k,O,A]);(0,i.useEffect)(()=>{if(!e){te.current=-1;return}te.current!==n&&(te.current=n,ne&&re(n))},[e,n,ne]);let ie=(0,i.useCallback)(async(n,r,i)=>{if(!e)return!0;let a=pg(t);if(a<0||!mg(t[a],`onFinish`))return!0;let o=async()=>{try{return await O(`onFinish`,a,{recordId:n||w,values:r}),C.current&&p({blocked:null,actionError:null}),!0}catch(e){return A(a,`onFinish`,{actionId:e?.actionId,code:e?.code,message:`Your details were saved, but the final step did not complete. ${e?.message??``}`.trim()},()=>k(`finish`,async()=>{await o()&&await i?.()})),!1}};return o()},[e,t,O,w,A,k]),ae=e&&Tg(t),oe=(0,i.useCallback)(async(r,i)=>{if(!e)return!1;let a=Eg(t),o=n;if(a<0)return A(o,`onFinish`,{code:`not_configured`,message:`This wizard is set to save through a server action ("Final save: Server action only"), but no step names an action on Finish. Nothing was saved. Set the Finish action in Admin → Form Groups, or switch Final save back to Generic form save.`}),!1;let s=async()=>{let e;try{e=await O(`onFinish`,a,{values:r})}catch(e){return A(o,`onFinish`,{actionId:e?.actionId,code:e?.code,message:`Your details were not saved. ${e?.message??``}`.trim()},()=>k(`finish`,s)),!1}C.current&&p({blocked:null,actionError:null});let t=String(e?.recordId||w||``);return S({id:t,values:r??{}}),await i?.(t,e),!0};return s()},[e,t,n,O,w,A,k]),se=(0,i.useCallback)((r,i)=>{if(!e)return;let a=i>=0?i:n,o=L_(r,t[a]),s=tg(t[a])!==`form`;p(e=>({blocked:{stepIndex:a,messages:o,focus:s,token:(e.blocked?.token??0)+1},actionError:null}))},[e,n,t]),ce=(0,i.useCallback)((e,t)=>{S({id:e?String(e):``,values:t??{}})},[]),le=(0,i.useCallback)(()=>p({blocked:null,actionError:null}),[]),j=(0,i.useCallback)(()=>{let e=f.actionError;if(e)return e.hook===`onNext`?ee():e.hook===`onEnter`?re(e.stepIndex):e.resume?.()},[f.actionError,ee,re]),ue=f.actionError?.stepIndex??f.blocked?.stepIndex??-1;return{enabled:e,busy:m,recordId:w,draftRecordId:_,results:y,actionResult:T?y[String(T.key)]??null:null,savedRecord:x,notice:f,errorStep:ue,next:ee,retry:j,afterSave:ie,saveViaAction:ae,saveThroughAction:oe,prepareSubmitValues:D,onSubmitFailed:se,markSaved:ce,clearNotice:le}}function z_({runtime:e,current:t}){let n=e?.notice?.blocked?.stepIndex===t?e.notice.blocked:null,r=e?.notice?.actionError?.stepIndex===t?e.notice.actionError:null,o=(0,i.useRef)(null),c=(0,i.useRef)(null);(0,i.useEffect)(()=>{n?.focus&&F_(o.current)},[n?.token,n?.focus]),(0,i.useEffect)(()=>{r&&F_(c.current)},[r?.token]);let l=e?.busy===`enter`;if(!n&&!r&&!l)return null;let u=n?.messages?.length===1&&n.messages[0]===I_;return(0,s.jsxs)(`div`,{className:`v1-wizard-notice`,children:[l&&(0,s.jsxs)(`div`,{className:`v1-wizard-notice__busy`,role:`status`,"aria-live":`polite`,children:[(0,s.jsx)(a.Spin,{size:`small`}),` `,(0,s.jsx)(`span`,{children:`Preparing this step…`})]}),n&&(0,s.jsx)(`div`,{ref:o,tabIndex:-1,className:`v1-wizard-notice__focus${u?` v1-wizard-notice__focus--fields`:``}`,children:(0,s.jsx)(a.Alert,{type:`warning`,showIcon:!0,role:`alert`,message:n.messages.length===1?n.messages[0]:`This step needs attention before you continue.`,description:n.messages.length>1?(0,s.jsx)(`ul`,{className:`v1-wizard-notice__list`,children:n.messages.map(e=>(0,s.jsx)(`li`,{children:e},e))}):void 0})}),r&&(0,s.jsx)(`div`,{ref:c,tabIndex:-1,className:`v1-wizard-notice__focus`,children:(0,s.jsx)(a.Alert,{type:`error`,showIcon:!0,role:`alert`,message:r.message,description:r.code===`not_found`&&r.actionId?`Action id: ${r.actionId}`:void 0,action:e?.retry?(0,s.jsx)(a.Button,{size:`small`,onClick:()=>e.retry(),loading:!!e?.busy&&e.busy!==`enter`,disabled:!!e?.busy,children:`Try again`}):void 0})})]})}var B_=e=>e==null?``:String(e).trim();function V_(e,t){let n=e?.regionRules;if(!n||typeof n!=`object`)return e??{};let r=B_(t),i=n[r]??n[r.toUpperCase()]??n.default;return!i||typeof i!=`object`?e??{}:{...e,...i}}function H_(e){return e?.allowInProgress!==!1}function U_(e){return H_(e)?``:K_(e)?e?.inProgressWarningMessage||e?.inProgressMessage||`In this region an unfinished qualification is not usually accepted when a candidate is put forward for a role. You can still record it here — just be aware it will have to be completed before they can be submitted.`:e?.inProgressMessage||`This one needs to be finished before the application can go ahead. Please untick “still ongoing”, or remove the row.`}function W_(e){return H_(e)?`allow`:B_(e?.inProgressSeverity).toLowerCase()===`warn`?`warn`:`block`}function G_(e){return W_(e)===`block`}function K_(e){return W_(e)===`warn`}function q_(e){if(!G_(e))return null;let t=U_(e);return{validator:(e,n)=>n===!0?Promise.reject(Error(t)):Promise.resolve()}}function J_(e,t={}){let n=t.tieBreak??`endDate`,r=t.field??`startDate`;for(let t of[n,r]){let n=e?.[t];if(n==null||n===``)continue;let r=(0,c.default)(n);if(r.isValid())return r.valueOf()}return null}function Y_(e,t={}){let n=t.inProgressField??`currentStudyingHere`;return!!e?.[n]}function X_(e=[],t={}){let n=(t.direction??`desc`)===`desc`;return e.map((e,n)=>({index:n,key:J_(e,t),ongoing:t.inProgressFirst!==!1&&Y_(e,t)})).slice().sort((e,t)=>e.ongoing===t.ongoing?e.key===null&&t.key===null?e.index-t.index:e.key===null?1:t.key===null?-1:e.key===t.key?e.index-t.index:n?t.key-e.key:e.key-t.key:e.ongoing?-1:1).map(e=>e.index)}function Z_(e,t,n={}){if(!Array.isArray(e)||e.length<2||t==null||t<0||t>=e.length)return null;let r=X_(e,n).indexOf(t);return r===-1||r===t?null:{from:t,to:r,reason:Y_(e[t],n)?`inProgress`:`outOfOrder`}}var Q_=Object.freeze({inProgress:`You’ve marked this one as still ongoing, so it’s the most recent. Shall we move it to the top? This list reads best newest first.`,outOfOrder:`These dates make this the most recent one. Shall we move it to the top? This list reads best newest first.`,ok:`Yes, move it up`,keep:`No, leave it here`});function $_(e,t={}){let n={...Q_,...t.messages??{}};return n[e]??n.outOfOrder}function ev(e,t={}){let n=t.levelField??`qualification`,r=B_(e?.[n]);if(!r)return null;let i=t.levels??{},a=i[r]??i[r.toLowerCase()]??i[r.toUpperCase()];return Number.isFinite(Number(a))?Number(a):tv(r,t)}function tv(e,t){let n=Array.isArray(t?.levelPatterns)?t.levelPatterns:[],r=e.toLowerCase();for(let e of n){let t=B_(e?.match);if(!t)continue;let n;try{n=new RegExp(t,`i`)}catch{continue}if(n.test(r)&&Number.isFinite(Number(e.level)))return Number(e.level)}return null}function nv(e,t={}){return B_((t?.levelLabels??{})[e])||B_(e)}function rv(e=[],t={}){if(!t||t.requireBelow===!1)return[];let n=t.levels??{},r=t.requiredLevels??[];if(!r.length)return[];let i=e.map(e=>ev(e,t)).filter(e=>e!==null);if(!i.length)return[];let a=Math.max(...i),o=[];return r.forEach(e=>{let t=typeof e==`object`?e.label:e,r=typeof e==`object`&&Number.isFinite(Number(e.level))?Number(e.level):Number(n[t]);Number.isFinite(r)&&(r>=a||i.includes(r)||o.push(t))}),o}function iv(e,t={}){let n=rv(e,t);if(!n.length)return``;let r=n.map(e=>nv(e,t)).join(`, `);return(t.message||`You’ve added a higher qualification but not the {missing} below it. Please add that too.`).replace(`{missing}`,r)}async function av({group:e,rows:t,rowIndex:n,move:r,confirm:i}){let a=e?.orderBy;if(!a||a.confirmMove===!1||typeof r!=`function`)return!1;let o=Z_(t,n,a);if(!o)return!1;let s={...Q_,...a.messages??{}};return await i({reason:o.reason,title:o.reason===`inProgress`?`This looks like the most recent one`:`These dates make this the most recent one`,body:$_(o.reason,a),okText:s.ok,cancelText:s.keep,from:o.from,to:o.to})?(r(o.from,o.to),!0):!1}function ov(e,t){let n=V_(e,t),r=n?.orderBy?.inProgressField;return r?{name:n.name,label:n.label??n.name,rowsKey:n.payloadKey||n.name,inProgressField:r,severity:W_(n),message:U_(n)}:null}function sv(e=[],t,n){if(!n)return{severity:`allow`,message:``,group:null};let r=null;for(let i of e){let e=ov(i,t);if(!(!e||e.severity===`allow`)&&cv(n,e.rowsKey).some(t=>Y_(t,e))){if(e.severity===`block`)return{severity:`block`,message:e.message,group:e};r??={severity:`warn`,message:e.message,group:e}}}return r??{severity:`allow`,message:``,group:null}}function cv(e,t){let n=e?.[t];return Array.isArray(n)?n:Array.isArray(n?.rows)?n.rows:[]}function lv(e){return String(e?.severity??``).toLowerCase()===`block`?`block`:`warn`}function uv(e=[],t={}){let n=null;for(let r of e){let e=r?.levelRule;if(!e)continue;let i=dv(t,r);if(!i.length)continue;let a=iv(i,e);if(a){if(lv(e)===`block`)return{severity:`block`,message:a,group:r};n??={severity:`warn`,message:a,group:r}}}return n??{severity:`allow`,message:``,group:null}}function dv(e,t){for(let n of[t?.name,t?.payloadKey]){if(!n)continue;let t=e?.[n];if(Array.isArray(t))return t}return[]}function fv(e,t){return Array.isArray(e)&&e.length>1?[...e.slice(0,-1),t]:[t]}function pv(e,t){let n=e?.field,r=[];e?.clearGroupOnChange&&(t instanceof Set?[...t]:t??[]).forEach(e=>{e&&e!==n&&r.push(e)});let i=e?.linkedClearField;return Array.isArray(i)?i.forEach(e=>{e&&e!==n&&r.push(e)}):typeof i==`string`&&i.trim()&&i.trim()!==n&&r.push(i.trim()),[...new Set(r)]}function mv(e,t,n,r){let i=pv(t,r).map(e=>fv(n,e));return i.forEach(t=>e.setFieldValue(t,null)),i}function hv(e){return(Array.isArray(e)?e:[e]).map(e=>e&&typeof e==`object`?e.value??e.key??e.id:e).filter(e=>e!=null&&e!==``)}function gv(e,t=[]){let n=new Set((t??[]).map(e=>String(e?.value))),r=[];for(let t of hv(e)){let e=String(t);!n.has(e)&&!r.includes(e)&&r.push(e)}return r}async function _v(e,n){if(!e?.lookupCollection||!n?.length)return[];let r=new URLSearchParams({collection:e.lookupCollection,displayField:e.displayField??``,valueField:e.valueField??`_id`,values:n.join(`,`)});e.displayField2&&r.set(`displayField2`,e.displayField2);let i=await t.o(t.S,`/admin/lookup-dropdown-values?${r}`),a=i?.data??i??[];return Array.isArray(a)?a:[]}function vv(e=[],t=[]){if(!t.length)return e;let n=new Set((e??[]).map(e=>String(e?.value))),r=t.filter(e=>!n.has(String(e?.value))).map(e=>({...e,resolvedOnly:!0}));return r.length?[...e,...r]:e}var yv=e=>e==null||e===``;function bv(e){if(!e)return null;if(typeof e.valueOf==`function`){let t=e.valueOf();return Number.isNaN(t)?null:t}let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function xv(e){if(!e)return null;let t=(0,c.default)(e);return t.isValid()?t.startOf(`day`).valueOf():null}function Sv(e){if(!e)return null;let t=(0,c.default)(e);return t.isValid()?t.hour()*60+t.minute():null}var Cv={d:`day`,day:`day`,days:`day`,w:`week`,week:`week`,weeks:`week`,m:`month`,mo:`month`,month:`month`,months:`month`,y:`year`,yr:`year`,year:`year`,years:`year`};function wv(e){if(e==null||e===``)return null;if(typeof e==`object`&&!Array.isArray(e)){let t=Number(e.value??e.count??e.amount);return!Number.isFinite(t)||t<=0?null:{value:t,unit:Cv[String(e.unit??`month`).toLowerCase()]??`month`}}let t=String(e).trim().toLowerCase();if(!t)return null;let n=t.match(/^(\d+(?:\.\d+)?)\s*([a-z]*)$/);if(!n)return null;let r=Number(n[1]);return!Number.isFinite(r)||r<=0?null:{value:r,unit:Cv[n[2]]??`month`}}function Tv(e,t){let n=e?.minGapFrom??e?.gapFrom;if(n&&typeof t==`function`){let e=wv(t(n));if(e)return e}return wv(e?.minGap)}function Ev(e,t,n,r){if(t===null)return null;let i=Tv(n,r),a=(0,c.default)(t);return i&&(a=e===`dateAfterField`?a.add(i.value,i.unit):a.subtract(i.value,i.unit)),a.startOf(`day`).valueOf()}function Dv(e,t,n,r,i){if(t===null||n===null)return!1;let a=Ev(e,n,r,i);if(a===null)return!1;let o=!!r?.strict&&!Tv(r,i);return e===`dateAfterField`?o?t<=a:t<a:o?t>=a:t>a}function Ov(e,t,n,r){if(n?.message)return n.message;let i=n?.value??n?.compareField??n?.field??`the paired date`,a=Tv(n,r);if(a){let n=a.value===1?a.unit:`${a.unit}s`;return e===`dateAfterField`?`${t} must be at least ${a.value} ${n} after ${i}`:`${t} must be at least ${a.value} ${n} before ${i}`}return n?.strict?e===`dateAfterField`?`${t} must be after ${i}`:`${t} must be before ${i}`:e===`dateAfterField`?`${t} must be on or after ${i}`:`${t} must be on or before ${i}`}function kv({type:e,label:t,rule:n,readSibling:r}){return{validator:async(i,a)=>{let o=n?.value??n?.compareField??n?.field;if(!o||yv(a))return Promise.resolve();let s=r(o);if(yv(s))return Promise.resolve();let c=xv(a),l=xv(s);return c===null||l===null?Promise.resolve():Dv(e,c,l,n,r)?Promise.reject(Error(Ov(e,t,n,r))):Promise.resolve()}}}function Av(e,t,{rows:n,rowIndex:r}={}){if(e===null||!t||!Array.isArray(n)||r==null||(t.mode??`newestFirst`)!==`newestFirst`)return!1;let i=t.startField??`startDate`,a=t.endField??`endDate`,o=n[r-1];if(o){let t=xv(o[i]);if(t!==null&&e>=t)return!0}let s=n[r+1];if(s){let t=xv(s[a])??xv(s[i]);if(t!==null&&e<=t)return!0}return!1}function jv(e,t=`above`){let n=e?.messages??{};return t===`below`?n.below||`This starts before the entry below it finished. Entries are listed newest first, so they cannot overlap.`:n.above||`This overlaps the entry above it. Entries are listed newest first, so this one must finish before that one started.`}function Mv({field:e,readSibling:t,rows:n,rowIndex:r,now:i=_n}){let a=e?.validations??e?.validation??e?.rules??[],o=[];for(let e of a){let n=typeof e==`string`?{type:e}:e,r=n?.type;if(r===`noPastDate`&&o.push(e=>e?xv(e)<i().startOf(`day`).valueOf():!1),r===`noFutureDate`&&o.push(e=>e?xv(e)>i().startOf(`day`).valueOf():!1),r===`minAge`){let e=Number(n?.value??18);o.push(t=>t?xv(t)>i().subtract(e,`year`).startOf(`day`).valueOf():!1)}if(r===`dateAfterField`||r===`dateBeforeField`){let e=n?.value??n?.compareField??n?.field;if(!e)continue;o.push(i=>{if(!i)return!1;let a=t(e);return!yv(a)&&Dv(r,xv(i),xv(a),n,t)})}}return e?.rowHierarchy&&Array.isArray(n)&&r!=null&&o.push(t=>t?Av(xv(t),e.rowHierarchy,{rows:n,rowIndex:r}):!1),o.length?e=>o.some(t=>t(e)):void 0}function Nv(e,t=_n){let n=e?.validations??e?.validation??e?.rules??[];for(let e of n){let n=typeof e==`string`?{type:e}:e;if(n?.type===`minAge`)return t().subtract(Number(n?.value??18),`year`);if(n?.type===`noFutureDate`||n?.type===`noPastDate`)return t()}}function Pv({field:e,rows:t,rowIndex:n}){let r=e?.rowHierarchy;return{validator:async(e,i)=>{if(!r||yv(i)||!Array.isArray(t)||n==null)return Promise.resolve();let a=xv(i);if(a===null||!Av(a,r,{rows:t,rowIndex:n}))return Promise.resolve();let o=r.startField??`startDate`,s=t[n-1],c=s?xv(s[o]):null,l=c!==null&&a>=c?`above`:`below`;return Promise.reject(Error(jv(r,l)))}}}function Fv(e){return(e??[]).filter(e=>e?.submitMessages&&typeof e.submitMessages==`object`).sort((e,t)=>(e.order??0)-(t.order??0))[0]?.submitMessages??null}function Iv(e){let t=String(e??``).trim();return t?t.charAt(0).toUpperCase()+t.slice(1):`Record`}function Lv(e,t){return String(e).replaceAll("${module}",Iv(t)).replaceAll("${moduleName}",Iv(t))}function Rv(e,t,n){let r=Fv(e);if(r?.suppress)return null;let i=n===`edit`?r?.editSuccess:r?.addSuccess;return i&&String(i).trim()?Lv(i,t):n===`edit`?`${Iv(t)} has Updated successfully`:`${Iv(t)} has added successfully`}function zv(e,t,n,r){let i=Fv(e),a=n===`edit`?i?.editError:i?.addError;return a&&String(a).trim()?Lv(a,t):r&&String(r).trim()?String(r):n===`edit`?`Failed to update ${Iv(t)}`:`Failed to create ${Iv(t)}`}function Bv({errorFields:e}={},t,{root:n=document}={}){if(!e?.length)return;let r=e[0]?.name;setTimeout(()=>{if(t?.scrollToField&&r!==void 0)try{t.scrollToField(r,{behavior:`smooth`,block:`center`})}catch{}let e=(n??document).querySelector(`.ant-form-item-has-error`);if(!e)return;let i=e.querySelector(`input, textarea, select, .ProseMirror`),a=i??e;a.scrollIntoView({behavior:`smooth`,block:`center`}),setTimeout(()=>{i?.focus?.({preventScroll:!0}),a.style.boxShadow=`0 0 0 3px rgba(255, 77, 79, 0.3)`,setTimeout(()=>{a.style.boxShadow=``},1200)},350)},60)}function Vv(e){return Array.isArray(e)?e.map(e=>String(e??``).trim()):String(e??``).split(`,`).map(e=>e.trim())}function Hv(e,t){if(!e?.field)return!1;switch(e.operator??`eq`){case`eq`:return String(t??``)===String(e.value??``);case`neq`:return String(t??``)!==String(e.value??``);case`truthy`:return t!=null&&t!==``&&t!==!1;case`falsy`:return t==null||t===``||t===!1;case`notEmpty`:return Array.isArray(t)?t.length>0:!!t;case`in`:return Vv(e.value).includes(String(t??``));case`notIn`:return!Vv(e.value).includes(String(t??``));default:return!1}}function Uv(e,t,n=!1){let r=n?e?.combineLabel??e?.label:e?.label,i=e?.labelWhen;return Hv(i,t)&&i?.label?i.label:r}function Wv(e){return e?[...e.field?[e]:[],...(e.conditions??[]).filter(e=>e?.field)]:[]}function Gv(e,t){let n=Wv(e);if(!n.length)return!0;let r=n.map(e=>Hv(e,t(e.field)));return e.logic===`or`?r.some(Boolean):r.every(Boolean)}function Kv(e){let t=e?.colWhen;return t?(Array.isArray(t)?t:[t]).filter(e=>e?.field&&Number(e?.col)>0):[]}function qv(e,t,n){for(let t of Kv(e))if(Hv(t,n(t)))return Number(t.col);return t}function Jv(e,t){return e?.field?t==null?[e.field]:[...Array.isArray(t)?t:[t],e.field]:[`__noop_conditional_label__`]}Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return hg}}),Object.defineProperty(exports,"$a",{enumerable:!0,get:function(){return yt}}),Object.defineProperty(exports,"$i",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"$n",{enumerable:!0,get:function(){return Yo}}),Object.defineProperty(exports,"$r",{enumerable:!0,get:function(){return Cr}}),Object.defineProperty(exports,"$t",{enumerable:!0,get:function(){return hl}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return z_}}),Object.defineProperty(exports,"Aa",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"Ai",{enumerable:!0,get:function(){return jt}}),Object.defineProperty(exports,"An",{enumerable:!0,get:function(){return ec}}),Object.defineProperty(exports,"Ar",{enumerable:!0,get:function(){return sa}}),Object.defineProperty(exports,"At",{enumerable:!0,get:function(){return Vu}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return f_}}),Object.defineProperty(exports,"Ba",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,"Bi",{enumerable:!0,get:function(){return kt}}),Object.defineProperty(exports,"Bn",{enumerable:!0,get:function(){return zs}}),Object.defineProperty(exports,"Br",{enumerable:!0,get:function(){return zi}}),Object.defineProperty(exports,"Bt",{enumerable:!0,get:function(){return Ql}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return H_}}),Object.defineProperty(exports,"Ca",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"Ci",{enumerable:!0,get:function(){return pn}}),Object.defineProperty(exports,"Cn",{enumerable:!0,get:function(){return fc}}),Object.defineProperty(exports,"Cr",{enumerable:!0,get:function(){return xa}}),Object.defineProperty(exports,"Ct",{enumerable:!0,get:function(){return hf}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return uv}}),Object.defineProperty(exports,"Da",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,"Di",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,"Dn",{enumerable:!0,get:function(){return tc}}),Object.defineProperty(exports,"Dr",{enumerable:!0,get:function(){return da}}),Object.defineProperty(exports,"Dt",{enumerable:!0,get:function(){return Dd}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return sv}}),Object.defineProperty(exports,"Ea",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(exports,"Ei",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"En",{enumerable:!0,get:function(){return oc}}),Object.defineProperty(exports,"Er",{enumerable:!0,get:function(){return ga}}),Object.defineProperty(exports,"Et",{enumerable:!0,get:function(){return $d}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return k_}}),Object.defineProperty(exports,"Fa",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,"Fi",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"Fn",{enumerable:!0,get:function(){return Gs}}),Object.defineProperty(exports,"Fr",{enumerable:!0,get:function(){return bi}}),Object.defineProperty(exports,"Ft",{enumerable:!0,get:function(){return Bu}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return x_}}),Object.defineProperty(exports,"Ga",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"Gi",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"Gn",{enumerable:!0,get:function(){return fs}}),Object.defineProperty(exports,"Gr",{enumerable:!0,get:function(){return Mr}}),Object.defineProperty(exports,"Gt",{enumerable:!0,get:function(){return ml}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return c_}}),Object.defineProperty(exports,"Ha",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(exports,"Hi",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"Hn",{enumerable:!0,get:function(){return Is}}),Object.defineProperty(exports,"Hr",{enumerable:!0,get:function(){return ai}}),Object.defineProperty(exports,"Ht",{enumerable:!0,get:function(){return Kl}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return N_}}),Object.defineProperty(exports,"Ia",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,"Ii",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"In",{enumerable:!0,get:function(){return Us}}),Object.defineProperty(exports,"Ir",{enumerable:!0,get:function(){return Yi}}),Object.defineProperty(exports,"It",{enumerable:!0,get:function(){return xu}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return zg}}),Object.defineProperty(exports,"Ja",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"Ji",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(exports,"Jn",{enumerable:!0,get:function(){return ns}}),Object.defineProperty(exports,"Jr",{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(exports,"Jt",{enumerable:!0,get:function(){return Rl}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return S_}}),Object.defineProperty(exports,"Ka",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(exports,"Ki",{enumerable:!0,get:function(){return gt}}),Object.defineProperty(exports,"Kn",{enumerable:!0,get:function(){return ls}}),Object.defineProperty(exports,"Kr",{enumerable:!0,get:function(){return Nr}}),Object.defineProperty(exports,"Kt",{enumerable:!0,get:function(){return pl}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"La",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"Li",{enumerable:!0,get:function(){return Ut}}),Object.defineProperty(exports,"Ln",{enumerable:!0,get:function(){return Hs}}),Object.defineProperty(exports,"Lr",{enumerable:!0,get:function(){return Ki}}),Object.defineProperty(exports,"Lt",{enumerable:!0,get:function(){return lu}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return R_}}),Object.defineProperty(exports,"Ma",{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,"Mi",{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(exports,"Mn",{enumerable:!0,get:function(){return Qs}}),Object.defineProperty(exports,"Mr",{enumerable:!0,get:function(){return la}}),Object.defineProperty(exports,"Mt",{enumerable:!0,get:function(){return Ru}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return E_}}),Object.defineProperty(exports,"Na",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"Ni",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(exports,"Nn",{enumerable:!0,get:function(){return Xs}}),Object.defineProperty(exports,"Nr",{enumerable:!0,get:function(){return ta}}),Object.defineProperty(exports,"Nt",{enumerable:!0,get:function(){return zu}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return av}}),Object.defineProperty(exports,"Oa",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,"Oi",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"On",{enumerable:!0,get:function(){return Ys}}),Object.defineProperty(exports,"Or",{enumerable:!0,get:function(){return fa}}),Object.defineProperty(exports,"Ot",{enumerable:!0,get:function(){return Ed}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return D_}}),Object.defineProperty(exports,"Pa",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"Pi",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"Pn",{enumerable:!0,get:function(){return $s}}),Object.defineProperty(exports,"Pr",{enumerable:!0,get:function(){return ki}}),Object.defineProperty(exports,"Pt",{enumerable:!0,get:function(){return Pu}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return vg}}),Object.defineProperty(exports,"Qa",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(exports,"Qi",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(exports,"Qn",{enumerable:!0,get:function(){return Zo}}),Object.defineProperty(exports,"Qr",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(exports,"Qt",{enumerable:!0,get:function(){return kl}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return p_}}),Object.defineProperty(exports,"Ra",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"Ri",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"Rn",{enumerable:!0,get:function(){return Vs}}),Object.defineProperty(exports,"Rr",{enumerable:!0,get:function(){return ca}}),Object.defineProperty(exports,"Rt",{enumerable:!0,get:function(){return du}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return ov}}),Object.defineProperty(exports,"Sa",{enumerable:!0,get:function(){return We}}),Object.defineProperty(exports,"Si",{enumerable:!0,get:function(){return an}}),Object.defineProperty(exports,"Sn",{enumerable:!0,get:function(){return lc}}),Object.defineProperty(exports,"Sr",{enumerable:!0,get:function(){return Va}}),Object.defineProperty(exports,"St",{enumerable:!0,get:function(){return vf}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return U_}}),Object.defineProperty(exports,"Ta",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"Ti",{enumerable:!0,get:function(){return un}}),Object.defineProperty(exports,"Tn",{enumerable:!0,get:function(){return ic}}),Object.defineProperty(exports,"Tr",{enumerable:!0,get:function(){return ha}}),Object.defineProperty(exports,"Tt",{enumerable:!0,get:function(){return ef}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return v_}}),Object.defineProperty(exports,"Ua",{enumerable:!0,get:function(){return en}}),Object.defineProperty(exports,"Ui",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"Un",{enumerable:!0,get:function(){return bs}}),Object.defineProperty(exports,"Ur",{enumerable:!0,get:function(){return si}}),Object.defineProperty(exports,"Ut",{enumerable:!0,get:function(){return ql}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return h_}}),Object.defineProperty(exports,"Va",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"Vi",{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(exports,"Vn",{enumerable:!0,get:function(){return Rs}}),Object.defineProperty(exports,"Vr",{enumerable:!0,get:function(){return ti}}),Object.defineProperty(exports,"Vt",{enumerable:!0,get:function(){return Gl}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return T_}}),Object.defineProperty(exports,"Wa",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"Wi",{enumerable:!0,get:function(){return qt}}),Object.defineProperty(exports,"Wn",{enumerable:!0,get:function(){return gs}}),Object.defineProperty(exports,"Wr",{enumerable:!0,get:function(){return Zr}}),Object.defineProperty(exports,"Wt",{enumerable:!0,get:function(){return xl}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return gg}}),Object.defineProperty(exports,"Xa",{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(exports,"Xi",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,"Xn",{enumerable:!0,get:function(){return Qo}}),Object.defineProperty(exports,"Xr",{enumerable:!0,get:function(){return Sr}}),Object.defineProperty(exports,"Xt",{enumerable:!0,get:function(){return zl}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return Mg}}),Object.defineProperty(exports,"Ya",{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(exports,"Yi",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"Yn",{enumerable:!0,get:function(){return is}}),Object.defineProperty(exports,"Yr",{enumerable:!0,get:function(){return Or}}),Object.defineProperty(exports,"Yt",{enumerable:!0,get:function(){return fl}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return _g}}),Object.defineProperty(exports,"Za",{enumerable:!0,get:function(){return Ot}}),Object.defineProperty(exports,"Zi",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,"Zn",{enumerable:!0,get:function(){return qo}}),Object.defineProperty(exports,"Zr",{enumerable:!0,get:function(){return xr}}),Object.defineProperty(exports,"Zt",{enumerable:!0,get:function(){return Bl}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return _v}}),Object.defineProperty(exports,"_a",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(exports,"_i",{enumerable:!0,get:function(){return En}}),Object.defineProperty(exports,"_n",{enumerable:!0,get:function(){return Mc}}),Object.defineProperty(exports,"_r",{enumerable:!0,get:function(){return Ga}}),Object.defineProperty(exports,"_t",{enumerable:!0,get:function(){return xp}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Gv}}),Object.defineProperty(exports,"aa",{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,"ai",{enumerable:!0,get:function(){return mr}}),Object.defineProperty(exports,"an",{enumerable:!0,get:function(){return Yc}}),Object.defineProperty(exports,"ao",{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,"ar",{enumerable:!0,get:function(){return Ko}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return Fp}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return mv}}),Object.defineProperty(exports,"ba",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"bi",{enumerable:!0,get:function(){return fn}}),Object.defineProperty(exports,"bn",{enumerable:!0,get:function(){return Cc}}),Object.defineProperty(exports,"br",{enumerable:!0,get:function(){return Oa}}),Object.defineProperty(exports,"bt",{enumerable:!0,get:function(){return Vf}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Bv}}),Object.defineProperty(exports,"ca",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"ci",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"cn",{enumerable:!0,get:function(){return $c}}),Object.defineProperty(exports,"co",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"cr",{enumerable:!0,get:function(){return So}}),Object.defineProperty(exports,"ct",{enumerable:!0,get:function(){return Up}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Mv}}),Object.defineProperty(exports,"da",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"di",{enumerable:!0,get:function(){return _n}}),Object.defineProperty(exports,"dn",{enumerable:!0,get:function(){return Bc}}),Object.defineProperty(exports,"dr",{enumerable:!0,get:function(){return _o}}),Object.defineProperty(exports,"dt",{enumerable:!0,get:function(){return wp}}),Object.defineProperty(exports,"ea",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"ei",{enumerable:!0,get:function(){return wr}}),Object.defineProperty(exports,"en",{enumerable:!0,get:function(){return al}}),Object.defineProperty(exports,"eo",{enumerable:!0,get:function(){return it}}),Object.defineProperty(exports,"er",{enumerable:!0,get:function(){return Xo}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return zh}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return kv}}),Object.defineProperty(exports,"fa",{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,"fi",{enumerable:!0,get:function(){return yn}}),Object.defineProperty(exports,"fn",{enumerable:!0,get:function(){return Vc}}),Object.defineProperty(exports,"fr",{enumerable:!0,get:function(){return ho}}),Object.defineProperty(exports,"ft",{enumerable:!0,get:function(){return vp}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return Sv}}),Object.defineProperty(exports,"ga",{enumerable:!0,get:function(){return At}}),Object.defineProperty(exports,"gi",{enumerable:!0,get:function(){return vn}}),Object.defineProperty(exports,"gn",{enumerable:!0,get:function(){return Ic}}),Object.defineProperty(exports,"gr",{enumerable:!0,get:function(){return Wa}}),Object.defineProperty(exports,"gt",{enumerable:!0,get:function(){return Ep}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return bv}}),Object.defineProperty(exports,"ha",{enumerable:!0,get:function(){return xt}}),Object.defineProperty(exports,"hi",{enumerable:!0,get:function(){return kn}}),Object.defineProperty(exports,"hn",{enumerable:!0,get:function(){return Nc}}),Object.defineProperty(exports,"hr",{enumerable:!0,get:function(){return Za}}),Object.defineProperty(exports,"ht",{enumerable:!0,get:function(){return Sp}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Uv}}),Object.defineProperty(exports,"ia",{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(exports,"ii",{enumerable:!0,get:function(){return pr}}),Object.defineProperty(exports,"in",{enumerable:!0,get:function(){return Xc}}),Object.defineProperty(exports,"io",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"ir",{enumerable:!0,get:function(){return Lo}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return zp}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return F_}}),Object.defineProperty(exports,"ja",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"ji",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(exports,"jn",{enumerable:!0,get:function(){return Zs}}),Object.defineProperty(exports,"jr",{enumerable:!0,get:function(){return na}}),Object.defineProperty(exports,"jt",{enumerable:!0,get:function(){return Fu}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return V_}}),Object.defineProperty(exports,"ka",{enumerable:!0,get:function(){return It}}),Object.defineProperty(exports,"ki",{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(exports,"kn",{enumerable:!0,get:function(){return Js}}),Object.defineProperty(exports,"kr",{enumerable:!0,get:function(){return pa}}),Object.defineProperty(exports,"kt",{enumerable:!0,get:function(){return Mu}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return zv}}),Object.defineProperty(exports,"la",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(exports,"li",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"ln",{enumerable:!0,get:function(){return Qc}}),Object.defineProperty(exports,"lo",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"lr",{enumerable:!0,get:function(){return yo}}),Object.defineProperty(exports,"lt",{enumerable:!0,get:function(){return Rp}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return Nv}}),Object.defineProperty(exports,"ma",{enumerable:!0,get:function(){return bt}}),Object.defineProperty(exports,"mi",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"mn",{enumerable:!0,get:function(){return zc}}),Object.defineProperty(exports,"mr",{enumerable:!0,get:function(){return Qa}}),Object.defineProperty(exports,"mt",{enumerable:!0,get:function(){return Tp}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Jv}}),Object.defineProperty(exports,"na",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"ni",{enumerable:!0,get:function(){return vr}}),Object.defineProperty(exports,"nn",{enumerable:!0,get:function(){return sl}}),Object.defineProperty(exports,"no",{enumerable:!0,get:function(){return Kt}}),Object.defineProperty(exports,"nr",{enumerable:!0,get:function(){return Bo}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return Kh}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return qv}}),Object.defineProperty(exports,"oa",{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(exports,"oi",{enumerable:!0,get:function(){return rr}}),Object.defineProperty(exports,"on",{enumerable:!0,get:function(){return nl}}),Object.defineProperty(exports,"oo",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(exports,"or",{enumerable:!0,get:function(){return bo}}),Object.defineProperty(exports,"ot",{enumerable:!0,get:function(){return Pp}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Pv}}),Object.defineProperty(exports,"pa",{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,"pi",{enumerable:!0,get:function(){return Sn}}),Object.defineProperty(exports,"pn",{enumerable:!0,get:function(){return Lc}}),Object.defineProperty(exports,"pr",{enumerable:!0,get:function(){return go}}),Object.defineProperty(exports,"pt",{enumerable:!0,get:function(){return Cp}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return Ug}}),Object.defineProperty(exports,"qa",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"qi",{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,"qn",{enumerable:!0,get:function(){return us}}),Object.defineProperty(exports,"qr",{enumerable:!0,get:function(){return jr}}),Object.defineProperty(exports,"qt",{enumerable:!0,get:function(){return Il}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Hv}}),Object.defineProperty(exports,"ra",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"ri",{enumerable:!0,get:function(){return fr}}),Object.defineProperty(exports,"rn",{enumerable:!0,get:function(){return Jc}}),Object.defineProperty(exports,"ro",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,"rr",{enumerable:!0,get:function(){return Ao}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return Rh}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return Wv}}),Object.defineProperty(exports,"sa",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"si",{enumerable:!0,get:function(){return Qn}}),Object.defineProperty(exports,"sn",{enumerable:!0,get:function(){return Zc}}),Object.defineProperty(exports,"so",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"sr",{enumerable:!0,get:function(){return To}}),Object.defineProperty(exports,"st",{enumerable:!0,get:function(){return Vp}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Kv}}),Object.defineProperty(exports,"ta",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"ti",{enumerable:!0,get:function(){return yr}}),Object.defineProperty(exports,"tn",{enumerable:!0,get:function(){return ol}}),Object.defineProperty(exports,"to",{enumerable:!0,get:function(){return Lt}}),Object.defineProperty(exports,"tr",{enumerable:!0,get:function(){return Vo}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return qh}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return Rv}}),Object.defineProperty(exports,"ua",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"ui",{enumerable:!0,get:function(){return Nn}}),Object.defineProperty(exports,"un",{enumerable:!0,get:function(){return Wc}}),Object.defineProperty(exports,"uo",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"ur",{enumerable:!0,get:function(){return vo}}),Object.defineProperty(exports,"ut",{enumerable:!0,get:function(){return Wp}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return vv}}),Object.defineProperty(exports,"va",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(exports,"vi",{enumerable:!0,get:function(){return bn}}),Object.defineProperty(exports,"vn",{enumerable:!0,get:function(){return kc}}),Object.defineProperty(exports,"vr",{enumerable:!0,get:function(){return Da}}),Object.defineProperty(exports,"vt",{enumerable:!0,get:function(){return yp}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return G_}}),Object.defineProperty(exports,"wa",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(exports,"wi",{enumerable:!0,get:function(){return sn}}),Object.defineProperty(exports,"wn",{enumerable:!0,get:function(){return rc}}),Object.defineProperty(exports,"wr",{enumerable:!0,get:function(){return Ta}}),Object.defineProperty(exports,"wt",{enumerable:!0,get:function(){return mf}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return q_}}),Object.defineProperty(exports,"xa",{enumerable:!0,get:function(){return St}}),Object.defineProperty(exports,"xi",{enumerable:!0,get:function(){return dn}}),Object.defineProperty(exports,"xn",{enumerable:!0,get:function(){return Sc}}),Object.defineProperty(exports,"xr",{enumerable:!0,get:function(){return Ra}}),Object.defineProperty(exports,"xt",{enumerable:!0,get:function(){return Bf}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return gv}}),Object.defineProperty(exports,"ya",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"yi",{enumerable:!0,get:function(){return tn}}),Object.defineProperty(exports,"yn",{enumerable:!0,get:function(){return Oc}}),Object.defineProperty(exports,"yr",{enumerable:!0,get:function(){return Ea}}),Object.defineProperty(exports,"yt",{enumerable:!0,get:function(){return gp}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return m_}}),Object.defineProperty(exports,"za",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"zi",{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(exports,"zn",{enumerable:!0,get:function(){return Bs}}),Object.defineProperty(exports,"zr",{enumerable:!0,get:function(){return Bi}}),Object.defineProperty(exports,"zt",{enumerable:!0,get:function(){return uu}});
9
- //# sourceMappingURL=conditionalFieldLabel-DOZto4Ei.cjs.map
7
+ `).forEach(e=>{let n=e.indexOf(`=`);if(n<1)return;let r=e.slice(0,n).trim(),i=e.slice(n+1).trim();r&&i&&(t[r]=i)}),t}function Hf(e=[]){let t=e=>String(e?.actionType??``).toLowerCase()===`export`?2:String(e?.listStyle??``).toLowerCase()===`primary`?0:1;return(Array.isArray(e)?e:[]).map((e,t)=>({a:e,i:t})).sort((e,n)=>t(e.a)-t(n.a)||e.i-n.i).map(({a:e})=>e)}function Uf(e,t){let n=Of(e);if(!n)return``;let r=Of(t),i=e=>e.toLocaleDateString(`en-GB`,{day:`2-digit`,month:`short`,year:`numeric`});return r?n.getFullYear()===r.getFullYear()?`${n.toLocaleDateString(`en-GB`,{day:`2-digit`,month:`short`})} – ${i(r)}`:`${i(n)} – ${i(r)}`:i(n)}function Wf(e,t){let n=(Array.isArray(e)?e:Tf(e)?String(e).split(`,`):[]).map(e=>e&&typeof e==`object`?e.label??e.name??e.value:e).filter(Tf).map(e=>String(e).trim()),r=Number.isInteger(t)&&t>0?t:n.length;return{shown:n.slice(0,r),more:Math.max(0,n.length-r)}}function Gf(e){let t=String(e??``).trim();return/^https?:\/\//i.test(t)?t:``}function Kf(e={},t,n){let r=e=>Tf(e)&&typeof t==`function`?t(e):void 0;return[{key:`view`,label:e.viewLabel||`View`,href:Gf(Tf(e.viewField)?r(e.viewField):n),name:Tf(e.nameField)?String(r(e.nameField)??``).trim():``},{key:`download`,label:e.downloadLabel||`Download`,href:Gf(r(e.downloadField)),download:!0}].filter(e=>e.href)}var K=e=>e!=null&&String(e).trim()!==``,qf=e=>String(e??``).trim().split(/\s+/).slice(0,2).map(e=>e[0]??``).join(``).toUpperCase(),Jf={high:`#2b9c64`,good:`#edbb22`,fair:`#ef7042`,low:`#909aae`},Yf=e=>t=>{t.stopPropagation(),e(t)};function Xf({label:e}){return(0,s.jsx)(`span`,{className:`lv-cell-empty`,style:{color:`#909aae`},children:K(e)?e:`-`})}function Zf({field:e,value:t,read:n,link:r=null}){let i=e?.renderConfig??{};if(!K(t))return(0,s.jsx)(Xf,{label:i.emptyLabel});let o=(Array.isArray(i.lines)?i.lines:[]).map(e=>Ef(e,n)).filter(K);return(0,s.jsxs)(`span`,{className:`lv-cell-person`,style:{display:`flex`,alignItems:`center`,gap:10,minWidth:0},children:[(0,s.jsx)(a.Avatar,{className:`lv-cell-person__avatar`,style:{flex:`none`},children:qf(t)}),(0,s.jsxs)(`span`,{className:`lv-cell-person__text`,style:{display:`flex`,flexDirection:`column`,minWidth:0,lineHeight:1.35},children:[(0,s.jsxs)(`span`,{className:`lv-cell-person__name`,style:{display:`inline-flex`,alignItems:`center`,gap:4,fontWeight:600,whiteSpace:`nowrap`},children:[String(t),r]}),o.map((e,t)=>(0,s.jsx)(`span`,{className:`lv-cell-sub`,style:{display:`block`,whiteSpace:`nowrap`},children:e},`${t}-${e}`))]})]})}function Qf({field:e,value:t}){let n=e?.renderConfig??{},r=K(t)?Number(String(t).replace(`%`,``)):NaN;if(!Number.isFinite(r))return(0,s.jsx)(`span`,{className:`lv-cell-score lv-cell-score--empty`,children:K(n.emptyLabel)?n.emptyLabel:`-`});let i=Math.max(0,Math.min(100,Math.round(r))),o=Df(i);return(0,s.jsx)(a.Progress,{className:`lv-cell-score lv-cell-score--${o}`,type:`circle`,percent:i,size:36,strokeWidth:8,strokeColor:Jf[o],format:e=>`${e}%`})}function $f({field:e,value:t,relative:n=!1,read:r}){let i=e?.renderConfig??{},a=Af(t,{relative:n});if(!a)return(0,s.jsx)(Xf,{label:i.emptyLabel});let o=K(i.subField)&&typeof r==`function`?Rf(r(i.subField),{suffix:i.subSuffix}):``;return(0,s.jsxs)(`span`,{className:`lv-cell-date${i.inline?` lv-cell-date--inline`:``}`,style:{display:`flex`,flexDirection:`column`,lineHeight:1.35},children:[i.inline?(0,s.jsx)(`span`,{className:`lv-cell-date__day`,children:`${a.day}, ${a.time}`}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{className:`lv-cell-date__day`,children:a.day}),(0,s.jsx)(`span`,{className:`lv-cell-sub`,children:a.time})]}),K(o)&&(0,s.jsx)(`span`,{className:`lv-cell-sub lv-cell-date__sub`,children:o})]})}function ep({field:e,value:t}){let n=e?.renderConfig??{};if(!K(t))return(0,s.jsx)(Xf,{label:n.emptyLabel});let r=If(t,n);return(0,s.jsx)(`span`,{className:`lv-cell-chip lv-cell-chip--${r}`,"data-tone":r,style:{display:`inline-flex`,alignItems:`center`,padding:`1px 8px`,borderRadius:4,whiteSpace:`nowrap`,lineHeight:1.5},children:String(t)})}function tp({field:e,value:t}){let n=e?.renderConfig??{};if(!K(t))return(0,s.jsx)(Xf,{label:n.emptyLabel});let r=If(t,n);return(0,s.jsx)(`span`,{className:`lv-cell-tone lv-cell-tone--${r}`,"data-tone":r,children:String(t)})}function np({field:e,value:t}){let n=e?.renderConfig??{};if(!K(t))return(0,s.jsx)(Xf,{label:n.emptyLabel});let r=String(t),i=Ff(n.icons,t),o=K(i)?(0,s.jsx)(ip,{name:i}):null;return o?(0,s.jsx)(a.Tooltip,{title:r,children:(0,s.jsxs)(`span`,{className:`lv-cell-type`,role:`img`,"aria-label":r,style:{display:`inline-flex`,alignItems:`center`,gap:6},children:[o,n.showLabel?(0,s.jsx)(`span`,{className:`lv-cell-type__label`,children:r}):null]})}):(0,s.jsx)(`span`,{className:`lv-cell-type lv-cell-type--text`,children:r})}function rp({field:e,value:t}){let n=e?.renderConfig??{},r=Lf(t,n);return K(r)?(0,s.jsx)(`span`,{className:`lv-cell-money`,style:{whiteSpace:`nowrap`},children:r}):(0,s.jsx)(Xf,{label:n.emptyLabel})}function ip({name:e,fallback:t=null}){let n=yf(e);return n?(0,s.jsx)(`img`,{className:`lv-action-icon`,src:n.src,alt:``,width:14,height:14}):t}function ap({inline:e=[],menu:t=[],onRun:n,links:r=[]}){return!e.length&&!t.length&&!r.length?(0,s.jsx)(Xf,{}):(0,s.jsxs)(`span`,{className:`lv-cell-actions`,style:{display:`inline-flex`,alignItems:`center`,gap:6,flexWrap:`nowrap`},children:[r.length>0&&(0,s.jsx)(dp,{links:r}),e.map(e=>{let t=String(e.listStyle??``).toLowerCase()===`button`,r=e.label||e.key,i=e.__disabledReason||(t?``:r),o=t?(0,s.jsx)(a.Button,{size:`small`,className:`lv-row-action lv-row-action--button`,icon:(0,s.jsx)(ip,{name:e.icon}),disabled:!!e.__disabledReason,onClick:Yf(()=>n(e)),children:r}):(0,s.jsx)(`button`,{type:`button`,className:`lv-row-action lv-row-action--icon`,"aria-label":r,disabled:!!e.__disabledReason,onClick:Yf(()=>n(e)),style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:24,height:24,padding:0,border:0,borderRadius:`50%`,cursor:`pointer`},children:(0,s.jsx)(ip,{name:e.icon,fallback:(0,s.jsx)(`span`,{style:{fontSize:10},children:r.slice(0,2)})})});return i?(0,s.jsx)(a.Tooltip,{title:i,children:o},e.key):(0,s.jsx)(`span`,{children:o},e.key)}),t.length>0&&(0,s.jsx)(a.Dropdown,{trigger:[`click`],menu:{items:t,onClick:({key:e,domEvent:t})=>{t?.stopPropagation?.(),n({key:e})}},children:(0,s.jsx)(a.Button,{type:`text`,size:`small`,className:`lv-row-action lv-row-action--more`,"aria-label":`More actions`,icon:(0,s.jsx)(o.MoreOutlined,{}),onClick:e=>e.stopPropagation()})})]})}function op({field:e,value:t,read:n}){let r=e?.renderConfig??{};if(!K(t))return(0,s.jsx)(Xf,{label:r.emptyLabel});let i=zf(t);if(!i)return(0,s.jsx)(`span`,{className:`lv-cell-fraction lv-cell-fraction--text`,children:String(t)});let a=typeof n==`function`?(Array.isArray(r.lines)?r.lines:[]).map(e=>Ef(e,n)).filter(K):[];return(0,s.jsxs)(`span`,{className:`lv-cell-fraction`,style:{display:`inline-flex`,flexDirection:`column`,gap:2,minWidth:28},children:[(0,s.jsx)(`span`,{className:`lv-cell-fraction__text`,children:`${i.done} of ${i.total}`}),(0,s.jsx)(`span`,{className:`lv-cell-fraction__bar`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":i.total,"aria-valuenow":i.done,"aria-label":`${i.done} of ${i.total}`,style:{display:`block`,height:3,borderRadius:2,background:`#e5ebf0`,overflow:`hidden`},children:(0,s.jsx)(`span`,{className:`lv-cell-fraction__fill`,style:{display:`block`,height:`100%`,width:`${i.percent}%`,background:`currentColor`}})}),a.map((e,t)=>(0,s.jsx)(`span`,{className:`lv-cell-sub`,style:{display:`block`,whiteSpace:`nowrap`},children:e},`${t}-${e}`))]})}function sp({field:e,value:t,read:n,link:r=null}){let i=e?.renderConfig??{},a=K(t)?String(t):``;if(K(i.endField)&&typeof n==`function`?a=Uf(t,n(i.endField)):i.dateDisplay===`date`&&(a=Uf(t,null)),!K(a))return(0,s.jsx)(Xf,{label:i.emptyLabel});let o=(Array.isArray(i.lines)?i.lines:[]).map(e=>typeof n==`function`?Ef(e,n):``).filter(K);return(0,s.jsxs)(`span`,{className:`lv-cell-stack`,style:{display:`flex`,flexDirection:`column`,minWidth:0,lineHeight:1.35},children:[(0,s.jsxs)(`span`,{className:`lv-cell-stack__head`,style:{display:`inline-flex`,alignItems:`center`,gap:4,whiteSpace:`nowrap`},children:[a,r]}),o.map((e,t)=>(0,s.jsx)(`span`,{className:`lv-cell-sub`,style:{display:`block`,whiteSpace:`nowrap`},children:e},`${t}-${e}`))]})}function cp({field:e,value:t}){let n=e?.renderConfig??{},{shown:r,more:i}=Wf(t,n.maxVisible);return r.length?(0,s.jsxs)(`span`,{className:`lv-cell-chips`,style:{display:`inline-flex`,flexWrap:`wrap`,alignItems:`center`,gap:4},children:[r.map((e,t)=>{let r=If(e,n);return(0,s.jsx)(`span`,{className:`lv-cell-chip lv-cell-chip--${r}`,"data-tone":r,style:{display:`inline-flex`,alignItems:`center`,padding:`1px 8px`,borderRadius:4,whiteSpace:`nowrap`,lineHeight:1.5},children:e},`${t}-${e}`)}),i>0&&(0,s.jsx)(`span`,{className:`lv-cell-chips__more lv-cell-sub`,children:`+${i}`})]}):(0,s.jsx)(Xf,{label:n.emptyLabel})}var lp={pdf:o.FilePdfOutlined,image:o.FileImageOutlined};function up({field:e,value:t,read:n}){let r=e?.renderConfig??{};if(!K(t))return(0,s.jsx)(Xf,{label:r.emptyLabel});let i=K(r.kindField)&&typeof n==`function`?String(n(r.kindField)??``).trim().toLowerCase():``,a=lp[i]??o.FileTextOutlined,c=(Array.isArray(r.lines)?r.lines:[]).map(e=>typeof n==`function`?Ef(e,n):``).filter(K);return(0,s.jsxs)(`span`,{className:`lv-cell-file`,style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[(0,s.jsx)(a,{className:`lv-cell-file__icon lv-cell-file__icon--${lp[i]?i:`file`}`,"aria-hidden":`true`,style:{flex:`none`,fontSize:18}}),(0,s.jsxs)(`span`,{style:{display:`flex`,flexDirection:`column`,minWidth:0,lineHeight:1.35},children:[(0,s.jsx)(`span`,{className:`lv-cell-file__name`,style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:String(t)}),c.map((e,t)=>(0,s.jsx)(`span`,{className:`lv-cell-sub`,style:{display:`block`,whiteSpace:`nowrap`},children:e},`${t}-${e}`))]})]})}function dp({links:e}){let t=(0,i.useContext)(bf),n={display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:28,height:28,borderRadius:6};return e.map(e=>{let r=`lv-cell-filelinks__link lv-cell-filelinks__link--${e.key}`,i=e.key===`download`?(0,s.jsx)(o.DownloadOutlined,{}):(0,s.jsx)(o.EyeOutlined,{}),c=e.key===`view`&&typeof t==`function`?(0,s.jsx)(`button`,{type:`button`,className:r,"aria-label":e.label,onClick:Yf(()=>t({url:e.href,name:e.name||void 0})),style:{...n,padding:0,cursor:`pointer`},children:i}):(0,s.jsx)(`a`,{className:r,href:e.href,target:`_blank`,rel:`noopener noreferrer`,download:e.download?``:void 0,"aria-label":e.label,onClick:e=>e.stopPropagation(),style:n,children:i});return(0,s.jsx)(a.Tooltip,{title:e.label,children:c},e.key)})}function fp({field:e,value:t,read:n}){let r=e?.renderConfig??{},i=Kf(r,n,t);return i.length?(0,s.jsx)(`span`,{className:`lv-cell-filelinks`,style:{display:`inline-flex`,alignItems:`center`,gap:4},children:(0,s.jsx)(dp,{links:i})}):(0,s.jsx)(Xf,{label:r.emptyLabel})}function pp({sortOptions:e=[],sortValue:t,onSort:n,sortLabel:r=`Sort by`,showSelectAll:i=!1,allSelected:c=!1,someSelected:l=!1,onToggleAll:u,selectAllLabel:d=`Select All`,buttons:f=[],maxButtons:p=3,hasSelection:m=!1,selectFirstText:h=`Select rows first`,onRun:g,note:_=``,steady:v=!1}){let y=Hf(f),b=y.slice(0,Math.max(0,p)),x=y.slice(Math.max(0,p)),S=e=>!!e.__disabledReason||e.requireSelection&&!m,C=e=>e.__disabledReason||(e.requireSelection&&!m?h:``),w=typeof _==`string`?_.trim()!==``:!!_,T=e.length>0||v;return!T&&!i&&!f.length&&!w?null:(0,s.jsxs)(a.Flex,{className:`lv-toolbar`,align:`center`,justify:`space-between`,gap:12,wrap:`wrap`,children:[(0,s.jsxs)(a.Flex,{className:`lv-toolbar__left`,align:`center`,gap:12,wrap:`wrap`,children:[T&&(0,s.jsxs)(`label`,{className:`lv-toolbar__sort`,style:{display:`inline-flex`,flexDirection:`column`},children:[(0,s.jsx)(`span`,{className:`lv-toolbar__sort-label`,style:{fontSize:11},children:r}),(0,s.jsx)(a.Select,{size:`small`,className:`lv-toolbar__sort-select`,variant:`borderless`,popupMatchSelectWidth:!1,"aria-label":r,value:t||void 0,disabled:!e.length,placeholder:`—`,options:e.map(e=>({value:e.value,label:e.label})),onChange:t=>{let r=e.find(e=>e.value===t);r&&n?.(r.field,r.dir)}})]}),w&&(0,s.jsx)(`span`,{className:`lv-toolbar__note`,children:_}),i&&(0,s.jsx)(a.Checkbox,{className:`lv-toolbar__select-all`,checked:c,indeterminate:l,onChange:()=>u?.(),children:d})]}),f.length>0&&(0,s.jsxs)(a.Flex,{className:`lv-toolbar__actions`,align:`center`,gap:8,wrap:`wrap`,children:[b.map(e=>{let t=String(e.listStyle??``).toLowerCase()===`primary`,n=(0,s.jsx)(a.Button,{size:`small`,type:t?`primary`:`default`,danger:!!e.danger,className:`lv-toolbar__button${t?` lv-toolbar__button--primary`:``}`,icon:(0,s.jsx)(ip,{name:e.icon}),disabled:S(e),onClick:()=>g?.(e),children:e.label||e.key});return C(e)?(0,s.jsx)(a.Tooltip,{title:C(e),children:(0,s.jsx)(`span`,{children:n})},e.key):(0,s.jsx)(`span`,{children:n},e.key)}),x.length>0&&(0,s.jsx)(a.Dropdown,{trigger:[`click`],menu:{items:x.map(e=>({key:e.key,label:e.label||e.key,disabled:S(e),danger:!!e.danger})),onClick:({key:e})=>{let t=x.find(t=>String(t.key)===String(e));t&&!S(t)&&g?.(t)}},children:(0,s.jsx)(a.Button,{size:`small`,className:`lv-toolbar__more`,"aria-label":`More actions`,icon:(0,s.jsx)(o.MoreOutlined,{})})})]})]})}var mp=(e,t)=>String(t).split(`.`).reduce((e,t)=>e?.[t],e);function hp(e){return e==null?``:Array.isArray(e)?e.map(hp).filter(Boolean).join(`, `):typeof e==`object`?hp(e.label??e.name??e.title??e.value??``):String(e)}function gp(e){let t=e?.confirm;if(!t||typeof t!=`object`||t.enabled!==!0)return null;let n=String(e?.label??e?.key??``).trim(),r=e=>typeof e==`string`&&e.trim()?e.trim():``;return{title:r(t.title)||(n?`${n}?`:`Are you sure?`),message:r(t.message)||(n?`Do you want to {action} for this record?`:``),okLabel:r(t.okLabel)||`Yes`,cancelLabel:r(t.cancelLabel)||`No`,icon:r(t.icon),note:r(t.note)}}var _p={send:o.SendOutlined,"user-x":o.UserDeleteOutlined,"mail-x":o.MailOutlined,check:o.CheckCircleOutlined,info:o.InfoCircleOutlined,warning:o.ExclamationCircleOutlined},vp=Object.keys(_p);function yp(e,t=`cc-confirm-hero__icon`){let n=_p[e]?e:`info`;return(0,i.createElement)(`span`,{className:t,"data-icon":n,"aria-hidden":!0},(0,i.createElement)(_p[n]))}function bp(e){let t=String(e??``);return t.includes(`**`)?t.split(`**`).map((e,t)=>t%2?(0,i.createElement)(`strong`,{key:t},e):e):t}function xp(e,t){return(0,i.createElement)(`div`,{className:`cc-confirm-hero__body`},e?(0,i.createElement)(`p`,{className:`cc-confirm-hero__message`},bp(e)):null,t?(0,i.createElement)(`div`,{className:`cc-confirm-hero__note`,role:`note`},(0,i.createElement)(o.InfoCircleOutlined,{"aria-hidden":!0}),(0,i.createElement)(`span`,null,bp(t))):null)}function Sp(e,t,{action:n,tab:r,count:i}={}){let a=String(n?.label??n?.key??``).trim();return String(e??``).replace(/\{([A-Za-z0-9_.]+)\}/g,(e,n)=>n===`action`?a:hp(n===`tab`?r:n===`count`?i??1:mp(t??{},n))).replace(/\s{2,}/g,` `).replace(/\s+([?.!,:;])/g,`$1`).trim()}function Cp(e,t,{tab:n,count:r,confirm:i=a.Modal.confirm}={}){let o=gp(e);return o?new Promise(a=>{let s=!1,c=e=>{s||(s=!0,a(e))},l=i=>Sp(i,t,{action:e,tab:n,count:r}),u=l(o.message),d=!!o.icon;i({title:l(o.title),content:d?xp(u,l(o.note)):u?bp(u):void 0,...d?{icon:yp(o.icon),width:440,closable:!0}:{},okText:o.okLabel,cancelText:o.cancelLabel,okButtonProps:{...e?.danger?{danger:!0}:{},...d?{icon:yp(o.icon,`cc-confirm-hero__btn-icon`)}:{}},className:d?`cc-action-confirm cc-action-confirm--hero`:`cc-action-confirm`,centered:!0,maskClosable:!1,onOk:()=>c(!0),onCancel:()=>c(!1),afterClose:()=>c(!1)})}):Promise.resolve(!0)}var wp=[`confirmEnabled`,`confirmTitle`,`confirmMessage`,`confirmOkLabel`,`confirmCancelLabel`,`confirmIcon`,`confirmNote`];function Tp(e){let t=e&&typeof e==`object`?e:{};return{confirmEnabled:t.enabled===!0,confirmTitle:typeof t.title==`string`?t.title:``,confirmMessage:typeof t.message==`string`?t.message:``,confirmOkLabel:typeof t.okLabel==`string`?t.okLabel:``,confirmCancelLabel:typeof t.cancelLabel==`string`?t.cancelLabel:``,confirmIcon:typeof t.icon==`string`?t.icon:``,confirmNote:typeof t.note==`string`?t.note:``}}function Ep(e={}){let t=e=>typeof e==`string`?e.trim():``,n={title:t(e.confirmTitle),message:t(e.confirmMessage),okLabel:t(e.confirmOkLabel),cancelLabel:t(e.confirmCancelLabel),icon:t(e.confirmIcon),note:t(e.confirmNote)},r=e.confirmEnabled===!0,i=Object.fromEntries(Object.entries(n).filter(([,e])=>e));if(!(!r&&Object.keys(i).length===0))return{enabled:r,...i}}var Dp=`cc:new-record-marks`,Op=e=>String(e??``).trim().toLowerCase(),kp=e=>String(e?.$oid??e??``).trim();function Ap(){try{return`cc:new-records:${window.localStorage.getItem(`userId`)||window.localStorage.getItem(`mongoId`)||`anon`}`}catch{return`cc:new-records:anon`}}function jp(e=Date.now()){try{let t=JSON.parse(window.localStorage.getItem(Ap())||`{}`),n={};return Object.entries(t&&typeof t==`object`?t:{}).forEach(([t,r])=>{Number.isFinite(r)&&e-r<6048e5&&(n[t]=r)}),n}catch{return{}}}function Mp(e){try{window.localStorage.setItem(Ap(),JSON.stringify(e))}catch{}try{window.dispatchEvent(new CustomEvent(Dp))}catch{}}var Np=(e,t)=>`${Op(e)}|${kp(t)}`;function Pp(e,t,n=Date.now()){!Op(e)||!kp(t)||Mp({...jp(n),[Np(e,t)]:n})}function Fp(e,t){let n=Np(e,t),r=jp();n in r&&(delete r[n],Mp(r))}var Ip=new Map,Lp=6e5;function Rp(e,t,n=Date.now()){let r=kp(t);r&&(Ip.set(r,n),Fp(e,t))}function zp(e,t=Lp,n=Date.now()){let r=Ip.get(kp(e));return Number.isFinite(r)&&n-r<t}var Bp=new Map;function Vp(e,t,n=Date.now()){if(!(!Op(e)||!kp(t))){Bp.set(Np(e,t),n);try{window.dispatchEvent(new CustomEvent(Dp))}catch{}}}function Hp(e,t=Date.now()){let n=`${Op(e)}|`,r={};return Bp.forEach((e,i)=>{if(t-e>=4e3){Bp.delete(i);return}i.startsWith(n)&&(r[i.slice(n.length)]=e)}),r}function Up(e,t=Date.now()){let n=`${Op(e)}|`,r={};return Object.entries(jp(t)).forEach(([e,t])=>{e.startsWith(n)&&(r[e.slice(n.length)]=t)}),r}function Wp(e,{enabled:t=!0}={}){let n=t&&e?Op(e):``,r=e=>({key:e,marks:e?Up(e):{},updates:e?Hp(e):{}}),[a,o]=(0,i.useState)(()=>r(n));a.key!==n&&o(r(n)),(0,i.useEffect)(()=>{if(!n)return;let e=()=>o(r(n));return window.addEventListener(Dp,e),window.addEventListener(`storage`,e),()=>{window.removeEventListener(Dp,e),window.removeEventListener(`storage`,e)}},[n]);let s=a.key===n?a.marks:{},c=a.key===n?a.updates??{}:{};return{has:e=>!!s[kp(e)],arrived:e=>{let t=s[kp(e)];return!!t&&Date.now()-t<15e3},updated:e=>{let t=c[kp(e)];return!!t&&Date.now()-t<4e3},count:Object.keys(s).length+Object.keys(c).length}}var Gp=(0,i.lazy)(()=>Promise.resolve().then(()=>require("./DocumentViewer-Dv2kBoJ2.cjs")).then(e=>e.n)),{Text:Kp}=a.Typography;function qp(e){return Yp(e?.label,e?.fieldLabel,e?.name,e?.fieldName,e?.value,e?.field)}function Jp(e){return Yp(e?.value,e?.field,e?.fieldName,e?.name,e?.label)}function Yp(...e){return e.find(e=>e!=null&&String(e).trim()!==``)}function Xp(e){return String(e??``).replace(/\[(\-?\d+)\]/g,`.$1`).split(`.`).filter(Boolean)}function Zp(e,t){if(!(!t||typeof t!=`string`))return Xp(t).reduce((e,t)=>{if(e!=null){if(/^-?\d+$/.test(t)){if(!Array.isArray(e))return;let n=Number(t);return e[n<0?e.length+n:n]}return e?.[t]}},e)}function q(e,t){return t===`id`?e?.id??e?._id:e?.[t]??Zp(e,t)}function Qp(e,t){if(!Array.isArray(e)||e.length===0||!t)return;let n=e[e.length-1];if(n!=null)return typeof n==`object`?Zp(n,t):n}function $p(e){if(Array.isArray(e))return e.some($p);if(e==null)return!1;let t=String(e).trim().toLowerCase();return t?![`all`,`internal`].includes(t):!1}function em(e){let t=Object.keys(e??{}).find(e=>/^customFields\.[^.]*profiledata\./i.test(e)&&!/^customFields\.internalprofiledata\./i.test(e));if(t)return t.replace(/^customFields\./i,``).replace(/profiledata\..*$/i,``);let n=e?.customFields;if(!n||typeof n!=`object`)return``;let r=Object.keys(n).find(e=>/profiledata$/i.test(e)&&!/^internalprofiledata$/i.test(e)&&n[e]&&typeof n[e]==`object`);return r?r.replace(/profiledata$/i,``):``}function tm(e){if(typeof e?.isVisible==`boolean`&&!e.isVisible||typeof e?.isVisible==`string`&&e.isVisible.toLowerCase()===`false`)return!1;let t=Jp(e);return!t||typeof t!=`string`?!1:/^customFields\.[^.]*profiledata\./i.test(t)&&!/^customFields\.internalprofiledata\./i.test(t)}function nm(e){return[e?.sourceType,e?.profileSource,e?.selectedSource,e?.customFields?.sourceType,e?.customFields?.profileSource].some($p)||!!em(e)}function rm(e,t){let n=q(e,t);return n==null||n===``?`-`:Array.isArray(n)?n.join(`, `):typeof n==`object`?Object.values(n).join(` `):n}function im(e){let t=e?.defaultValue;return t==null?``:String(t).trim()}function am(e){return!!e?.renderConfig?.treatZeroAsEmpty}function om(e,t=null){return e==null||e===``||e===`-`||am(t)&&(e===0||e===`0`)?!0:Array.isArray(e)?e.length===0:typeof e==`object`&&Object.keys(e).length===0}function sm(e,t){let n=im(e);return n&&om(t,e)?n:t}function cm(e){if(!e)return``;let t=e instanceof Date?e:new Date(e);if(Number.isNaN(t.getTime()))return String(e);let n=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`2-digit`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!0}).formatToParts(t),r=e=>n.find(t=>t.type===e)?.value??``;return`${`${r(`month`)} ${r(`day`)},${r(`year`)}`} | ${`${r(`hour`)}:${r(`minute`)} ${r(`dayPeriod`)}`}`}function lm(e){return String(e||`U`).trim().charAt(0).toUpperCase()||`U`}function um(e,t){let n=t.find(t=>{let n=q(e,t);return n!=null&&n!==``});return n?rm(e,n):``}function dm(e,t){let n=q(t,e.key),r=Array.isArray(n)?n:n?[n]:[],i=e.renderConfig??{},a=[i.nameField,i.labelField,`recruiterName`,`name`,`fullName`,`displayName`,`userName`,`email`,`recruiterEmail`].filter(Boolean),o=[i.metaField,i.dateField,i.assignedDateField,`assignedDateTime`,`assignedDate`,`createdAt`].filter(Boolean);return r.map((e,t)=>{let n=typeof e==`object`&&e?e:{value:e},r=um(n,a)||String(e||`User`),i=um(n,o);return{key:um(n,[`recruiterId`,`id`,`_id`,`email`,`recruiterEmail`])||`${r}-${t}`,name:r,initial:lm(r),meta:cm(i)}})}function fm({item:e}){return(0,s.jsxs)(`div`,{className:`job-avatar-tooltip`,children:[(0,s.jsx)(`div`,{className:`job-avatar-tooltip-name`,children:e.name}),e.meta&&(0,s.jsx)(`div`,{className:`job-avatar-tooltip-meta`,children:e.meta})]})}function pm({items:e}){return(0,s.jsx)(`div`,{className:`job-avatar-more-tooltip`,children:e.map(e=>(0,s.jsx)(fm,{item:e},e.key))})}function mm(e){return typeof e==`boolean`?e:typeof e==`string`?e.toLowerCase()===`true`:!!e}function hm(e){return e==null?``:Array.isArray(e)?e.join(`,`):typeof e==`object`?Object.values(e).join(` `):String(e)}function gm(e,t){return e?String(e).replace(/\{([^}]+)\}/g,(e,n)=>encodeURIComponent(hm(q(t,n)))).replace(/:([A-Za-z_][\w.]*)/g,(e,n)=>encodeURIComponent(hm(q(t,n)))):``}function _m(e){return/^(https?:\/\/|\/)/i.test(String(e))}function vm(e,t){let n=String(e??``).trim().toLowerCase();if(n===`blank`||n===`_blank`)return`_blank`;if(n===`self`||n===`_self`)return`_self`;if(n)return e;if(/^https?:\/\//i.test(String(t)))return`_blank`}function ym(e){return/^https?:\/\//i.test(String(e))}function bm(e,t,n){let r=e.routeUrl??e.routeURL??e.linkTemplate??e.linkUrl??e.href??e.url??e.action;return r?gm(r,t):_m(n)?String(n):``}function xm(e,t){if(!t||t.length<3||!e||typeof e!=`string`||e===`-`)return e;let n=e.toLowerCase(),r=t.toLowerCase(),i=[],a=0;for(;a<=e.length;){let o=n.indexOf(r,a);if(o===-1){i.push(e.slice(a));break}o>a&&i.push(e.slice(a,o)),i.push((0,s.jsx)(`mark`,{className:`search-highlight`,style:{backgroundColor:`#ffff00`,color:`inherit`,padding:0,borderRadius:2},children:e.slice(o,o+t.length)},o)),a=o+t.length}return i}function Sm(e,t,n,r=``){let i=bm(e,t,n),o=vm(e.linkTarget,i),c=xm(n,r);return ym(i)?(0,s.jsx)(a.Tooltip,{title:n===`-`?void 0:n,children:(0,s.jsx)(`a`,{className:`job-cell-link job-cell-value`,href:i,rel:o===`_blank`?`noreferrer`:void 0,target:o,children:c})}):(0,s.jsx)(a.Tooltip,{title:n===`-`?void 0:n,children:(0,s.jsx)(d.Link,{className:`job-cell-link job-cell-value`,target:o,to:i||`#`,children:c})})}function Cm(e){let t=[e?.props,e?.props?.format,e?.props?.display,e?.props?.dateDisplay,e?.renderConfig?.format,e?.renderConfig?.display,e?.renderConfig?.dateDisplay,e?.dateDisplay].map(e=>typeof e==`string`?e.trim().toLowerCase():``).find(Boolean);return t===`datetime`||t===`time`?t:`date`}function wm(e,t){if(e==null||e===``)return`-`;let n=e instanceof Date?e:new Date(e);if(Number.isNaN(n.getTime()))return rm({value:e},`value`);let r=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`2-digit`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!0,timeZone:`UTC`}).formatToParts(n),i=e=>r.find(t=>t.type===e)?.value??``,a=`${i(`month`)}, ${i(`day`)}, ${i(`year`)}`,o=`${i(`hour`)}:${i(`minute`)} ${i(`dayPeriod`)}`,s=Cm(t);return s===`time`?o:s===`datetime`?`${a} | ${o}`:a}function Tm(e){return/date/i.test(`${e.key??``} ${e.label??``} ${e.type??``}`)}function Em(e){return e==null||e===``?`-`:Array.isArray(e)?e.join(`, `):typeof e==`object`?Object.values(e).join(` `):e}function Dm(e,t,n){let r=String(t??``).trim();if(!r)return`-`;let i=r.replace(/^record\./,``);if(n?.renderConfig?.lastItemField??n?.renderConfig?.arrayDisplayField){let t=Xp(i);for(let n=t.length-1;n>=1;--n){let r=q(e,t.slice(0,n).join(`.`));if(!Array.isArray(r))continue;let i=r[r.length-1];return i==null?`-`:Em(Zp(i,t.slice(n).join(`.`)))}let r=n?.key,a=r?q(e,r):void 0;if(r&&Array.isArray(a)){let e=a[a.length-1];if(i===r)return Em(e);let t=`${r}.`;if(i.startsWith(t))return Em(Zp(e,i.slice(t.length)))}}return rm(e,i)}function Om(e){return String(e??``).replace(/\s+/g,` `).replace(/^\s*[-–—/:|·,]+\s*/,``).replace(/\s*[-–—/:|·,]+\s*$/,``).replace(/\s*([-–—/:|·,])\s*([-–—/:|·,])\s*/g,` $2 `).replace(/\s+[-–—]\s+(?=[A-Za-z$€£₹])/g,` `).replace(/\s+/g,` `).trim()}function km(e,t,n){if(typeof e!=`string`||e.trim()===``)return``;let r=!1,i=e.replace(/\{\{\s*([^}]+?)\s*\}\}/g,(e,i)=>{let a=Dm(t,i,n);return om(a,n)?``:(r=!0,String(a))});if(!r)return``;let a=i.replace(/\s+/g,` `).trim();return n?.renderConfig?.cleanEmptyTemplateSeparators?Om(a):a}function Am(e,t){let n=q(t,e.key),r=km(e.displayTemplate,t,e),i=e.renderConfig?.lastItemField??e.renderConfig?.arrayDisplayField;if(r)return r;if(i){let t=Qp(n,i);return om(t,e)?sm(e,`-`):Array.isArray(t)?sm(e,t.join(`, `)):typeof t==`object`?sm(e,Object.values(t).join(` `)):t}return Tm(e)?sm(e,wm(n,e)):sm(e,rm(t,e.key))}function jm(e,t){if(!im(e)||km(e.displayTemplate,t,e))return!1;let n=q(t,e.key),r=e.renderConfig?.lastItemField??e.renderConfig?.arrayDisplayField;return r?om(Qp(n,r),e):Tm(e)?om(wm(n,e),e):om(rm(t,e.key),e)}function Mm(e){return e===`-`||typeof e!=`string`||!e.trim()?e:e.replace(/\b([A-Za-z])([A-Za-z]*)\b/g,(e,t,n)=>e.length>1&&e===e.toUpperCase()?e:`${t.toUpperCase()}${n.toLowerCase()}`)}function Nm(e){return typeof e!=`string`||!e.includes(`-`)?e:e.replace(/(^|\s)-\s*(\d+)(?=\s*[A-Za-z])/,`$10-$2`).replace(/(\d+)\s*-\s*(?=[A-Za-z])/,`$1-0 `)}function Pm(e){let t=e.map((e,t)=>({field:e,index:t}));return t.some(({field:e})=>e.order!==void 0&&e.order!==null&&e.order!==``)?[...t].sort((e,t)=>{let n=Number(e.field.order),r=Number(t.field.order),i=Number.isFinite(n),a=Number.isFinite(r);return i&&a&&n!==r?n-r:i===a?e.index-t.index:i?-1:1}).map(({field:e})=>e):e}function Fm(e){return e.iconUrl??e.iconURL??e.icon??e.iconPath}function Im(e){return Array.isArray(e)?e.map((e,t)=>({...e,key:e.key??e.name??e.label??e.routeUrl??e.type??String(t),label:e.label??e.name??e.title??e.type??`Action`,iconUrl:Fm(e)})).filter(e=>e.iconUrl):[]}function Lm(e,t,n=[],r){if(Ru(e.key,t,n,r)||Array.isArray(e.conditions)&&e.conditions.length>0&&!e.conditions.every(e=>Fu(e,t,r)))return!1;let i=e?.showIfField??e?.visibleWhenField;return!i||Fu({field:i,operator:e?.showIfOperator||`eq`,value:e?.showIfValue??e?.visibleWhenValue??``},t,r)}function Rm(e,t={}){let n=xu(e);return n===`add`?t.canAdd!==!1:n===`edit`?t.canEdit!==!1:n!==`delete`||t.canDelete!==!1}function zm(e,t,n){let r=gm(e.routeUrl??e.routeURL??e.route??e.url??e.href,t),i=J(e.type??e.actionType),o=typeof e.label==`function`?e.label(t):e.label,c=(0,s.jsx)(`img`,{src:e.iconUrl,alt:o,className:`job-field-action-icon`}),l=`job-field-action-button`,u=e.__done,f=e.__disabledReason;return u||f?(0,s.jsx)(a.Tooltip,{title:u?u.label:f,children:(0,s.jsx)(`button`,{"aria-label":u?u.label:`${o} (unavailable)`,className:`${l} job-field-action-button--done`,type:`button`,disabled:!0,children:c})},e.key):typeof e.onClick==`function`?(0,s.jsx)(a.Tooltip,{title:o,children:(0,s.jsx)(`button`,{"aria-label":o,className:l,type:`button`,onClick:n=>{n.stopPropagation(),e.onClick(t)},children:c})},e.key):(i===`popup`||i===`modal`||e.popupKey)&&r?(0,s.jsx)(a.Tooltip,{title:o,children:(0,s.jsx)(`button`,{"aria-label":o,className:l,type:`button`,onClick:i=>{i.stopPropagation(),n?.(r,t,e)},children:c})},e.key):r&&(i===`page`||r.startsWith(`/`))?(0,s.jsx)(a.Tooltip,{title:o,children:(0,s.jsx)(d.Link,{"aria-label":o,className:l,to:r,children:c})},e.key):r?(0,s.jsx)(a.Tooltip,{title:o,children:(0,s.jsx)(`a`,{"aria-label":o,className:l,href:r,rel:`noreferrer`,target:`_blank`,children:c})},e.key):(0,s.jsx)(a.Tooltip,{title:o,children:(0,s.jsx)(`button`,{"aria-label":o,className:l,type:`button`,children:c})},e.key)}function Bm(e){let t=Array.isArray(e.secondaryFields)?e.secondaryFields:[],n=e.secondaryField?[e.secondaryField]:[];return[...t,...n].filter((e,t,n)=>e&&n.indexOf(e)===t)}function Vm(e,t){let n=e.secondarySeparator??` `,r=Bm(e).map(e=>rm(t,e)).filter(e=>e!==`-`);return r.length?r.join(` ${n} `):``}function Hm(e){return Mm(Nm(e))}function Um(e,t){if(!Array.isArray(e.valueStyles))return null;let n=J(t);return e.valueStyles.find(e=>J(e?.value)===n||J(e?.label)===n)??null}function Wm(e){let t=e?.color,n=e?.bg??e?.background??e?.backgroundColor;return{...t?{"--job-cell-badge-color":t}:{},...n?{"--job-cell-badge-bg":n}:{}}}function Gm(e){return J(e?.varient??e?.variant).replace(/[^a-z0-9-]/g,`-`)}function Km(e,t){let n=Um(e,t),r=n??e.commonStyle??{},i=n?.label??t,o=(typeof i==`string`?i.trim():i)||`-`,c=Gm(r),l=[`job-cell-badge`,`job-cell-value`,c?`job-cell-badge--${c}`:``].filter(Boolean).join(` `),u=!n&&typeof o==`string`&&o.includes(`,`)?o.split(`,`).map(e=>e.trim()).filter(Boolean):null,d=u&&u.length>1?`${u.slice(0,1).join(`, `)} +${u.length-1}`:o,f=Wm(r);return(0,s.jsx)(a.Tooltip,{title:o===`-`?void 0:o,children:(0,s.jsx)(a.Tag,{className:l,style:f,children:d})})}function qm(e,t){let n=dm(e,t),r=n.slice(0,2),i=n.slice(2);if(!n.length){let t=im(e)||`-`;return(0,s.jsx)(Kp,{className:`job-cell-primary job-cell-value`,children:t})}return(0,s.jsxs)(`span`,{className:`job-avatar-group`,children:[r.map((e,t)=>(0,s.jsx)(a.Tooltip,{overlayClassName:`job-avatar-tooltip-overlay`,title:(0,s.jsx)(fm,{item:e}),children:(0,s.jsx)(a.Avatar,{className:`job-avatar job-avatar--${t+1}`,children:e.initial})},e.key)),i.length>0&&(0,s.jsx)(a.Tooltip,{overlayClassName:`job-avatar-tooltip-overlay job-avatar-more-tooltip-overlay`,title:(0,s.jsx)(pm,{items:i}),children:(0,s.jsxs)(a.Avatar,{className:`job-avatar job-avatar--more`,children:[`+`,i.length]})})]})}function Jm(e,t){let n=e.renderConfig??{},r=q(t,e.key),i=r==null||r===``?NaN:Number(String(r).replace(`%`,``));if(!Number.isFinite(i))return(0,s.jsx)(Kp,{className:`job-cell-primary job-cell-value`,children:n.emptyText??`-`});let o=Number(n.max)>0?Number(n.max):100,c=Math.max(0,Math.min(100,Math.round(i/o*100))),l=n.progressType===`circle`;return(0,s.jsx)(a.Progress,{type:l?`circle`:`line`,percent:c,size:n.size??(l?40:`small`),showInfo:n.showInfo!==!1,strokeColor:n.strokeColor,format:e=>`${e}${n.suffix??`%`}`})}function Ym(e,t){let n=J(e.renderType);if(![`person`,`score`,`datetime`,`relativedate`,`chip`,`tonetext`,`typeicon`,`money`,`fraction`,`stack`,`chips`,`file`,`filelinks`].includes(n))return null;let r=q(t,e.key),i=e=>q(t,e);if(n===`score`)return(0,s.jsx)(Qf,{field:e,value:r});if(n===`chip`)return(0,s.jsx)(ep,{field:e,value:r});if(n===`tonetext`)return(0,s.jsx)(tp,{field:e,value:r});if(n===`typeicon`)return(0,s.jsx)(np,{field:e,value:r});if(n===`money`)return(0,s.jsx)(rp,{field:e,value:r});if(n===`fraction`)return(0,s.jsx)(op,{field:e,value:r,read:i});if(n===`chips`)return(0,s.jsx)(cp,{field:e,value:r});if(n===`file`)return(0,s.jsx)(up,{field:e,value:r,read:i});if(n===`filelinks`)return(0,s.jsx)(fp,{field:e,value:r,read:i});if(n===`datetime`||n===`relativedate`)return(0,s.jsx)($f,{field:e,value:r,relative:n===`relativedate`,read:e=>q(t,e)});let a=mm(e.isLink)?bm(e,t,r):``,c=a?vm(e.linkTarget,a):void 0,l=(0,s.jsx)(o.ExportOutlined,{className:`lv-cell-person__open`,style:{fontSize:11,opacity:.7}}),u=a?ym(a)?(0,s.jsx)(`a`,{href:a,target:c,rel:`noopener noreferrer`,"aria-label":`Open`,onClick:e=>e.stopPropagation(),children:l}):(0,s.jsx)(d.Link,{to:a,target:c,"aria-label":`Open`,onClick:e=>e.stopPropagation(),children:l}):null;return n===`stack`?(0,s.jsx)(sp,{field:e,value:r,read:i,link:u}):(0,s.jsx)(Zf,{field:e,value:Hm(Am(e,t))===`-`?``:r,read:i,link:u})}function Xm(e,t,n=``,r,i={},o=[],c){if(typeof e.render==`function`)return e.render(q(t,e.key),t);if(J(e.renderType)===`progress`)return Jm(e,t);if(J(e.renderType)===`avatar`)return qm(e,t);let l=Ym(e,t);if(l)return l;let u=jm(e,t),d=Hm(Am(e,t)),f=Im(e.actionButtons).filter(e=>Lm(e,t,o,c)).filter(e=>Rm(e,i)).map(e=>({...e,__done:Vu(e,t,c),__disabledReason:zu(e.key,t,o,c)})),p=Hm(Vm(e,t)),m=J(e.renderType)===`badge`&&d!==`-`?Km(e,d):!mm(e.isLink)||d===`-`||u?(0,s.jsx)(a.Tooltip,{title:d===`-`?void 0:d,children:(0,s.jsx)(Kp,{className:`job-cell-primary job-cell-value`,children:xm(d,n)})}):Sm(e,t,d,n);return(0,s.jsxs)(`span`,{className:`job-cell-content`,children:[(0,s.jsxs)(`span`,{className:`job-cell-main-line`,children:[m,f.length>0&&(0,s.jsx)(`span`,{className:`job-field-actions`,children:f.filter(e=>typeof e.hiddenIf!=`function`||!e.hiddenIf(t)).map(e=>zm(e,t,r))})]}),p&&(0,s.jsx)(a.Tooltip,{title:p,children:(0,s.jsx)(`span`,{className:`job-cell-secondary`,children:xm(p,n)})})]})}var Zm=130,Qm=230,$m=7.2,eh=26,th=8,nh=44,rh=20;function ih(e,t){if(Number(e.columnWidth)>0)return Math.round(Number(e.columnWidth));let n=String(e.label??``).length*th+nh;if(J(e.renderType)===`avatar`)return Math.max(Math.round(n),120);if(J(e.renderType)===`progress`)return Math.max(Math.round(n),e.renderConfig?.progressType===`circle`?90:150);let r=0;for(let n of t){let t=String(Hm(Am(e,n))??``),i=String(Hm(Vm(e,n))??``);r=Math.max(r,t.length,i.length)}let i=J(e.renderType)===`badge`?24:0,a=r*$m+eh+i;return Math.round(Math.min(Math.max(n,a,Zm),Qm))}function J(e){return String(e??``).trim().toLowerCase()}function ah(e,t){return e?.key??e?.value??e?.id??(t===void 0?void 0:String(t))}function Y(e){return J(e)}function oh(e){return[`all`,``].includes(Y(e))}function sh(e,t,n,r,i){if(oh(t))return!0;let a=J(n?.filterValue??n?.status??n?.title??n?.tabTitle??n?.name??(typeof n?.label==`string`?n.label:void 0)??n?.value??n?.key??t),o=n?.field??n?.fieldName??n?.filterField??n?.dataIndex??i;if(o)return J(rm(e,o))===a;let s=r.filter(e=>{let t=J(e.key),n=J(e.label);return t.includes(`status`)||n.includes(`status`)});return(s.length?s:r).some(t=>J(rm(e,t.key))===a)}function ch(e,t,n){return typeof n==`function`?n(e,t):typeof n==`string`?e?.[n]:e.id??e._id??e.key??t}function lh(e){return!!e?.closest?.(`a,button,input,textarea,select,label,[role="button"],[role="menuitem"],.ant-checkbox,.ant-radio,.ant-dropdown,.ant-dropdown-trigger,.ant-table-selection-column,.job-field-actions,.job-row-eye-button`)}function uh(e){return e.label??e.name??e.title??e.value}function dh(e,t){return e.key??e.value??e.route??e.name??String(t)}var fh={delete:(0,s.jsx)(o.DeleteOutlined,{}),edit:(0,s.jsx)(o.EditOutlined,{}),mail:(0,s.jsx)(o.MailOutlined,{}),shareAlt:(0,s.jsx)(o.ShareAltOutlined,{}),swap:(0,s.jsx)(o.RightOutlined,{}),thunderbolt:(0,s.jsx)(o.ThunderboltOutlined,{}),userAdd:(0,s.jsx)(o.UserAddOutlined,{}),userSwitch:(0,s.jsx)(o.UserSwitchOutlined,{})};function ph(e,t,n){let r={key:e.key,label:t?t.label:e.label,icon:fh[e.icon]??void 0,danger:t?void 0:e.danger||void 0,disabled:!!t||!!n||void 0,title:t?t.label:n||void 0};return e.children?.length&&(r.children=e.children.map(e=>ph(e))),r}function mh(e,t,n,r){if(!t?.length)return null;for(let i of t){let t=zu(e.key,i,n,r);if(t)return t}return null}function hh(e,t,n){return!e?.doneWhen?.field||!t?.length?null:t.every(t=>Vu(e,t,n))?Vu(e,t[0],n):null}function gh(e,t){return e.filter(t).map(e=>e.children?.length?{...e,children:gh(e.children,t)}:e)}function _h(e){let t=[];for(let n of e)t.push(n),n.children?.length&&t.push(..._h(n.children));return t}function vh(e){return Array.isArray(e)?e.map((e,t)=>{let n=uh(e),r=dh(e,t);return!n||!r?null:{...e,key:String(r),label:n,route:e.route||e.routeTemplate||(e.actionType===`modal`&&(e.popupKey||r)?`/popup/${e.popupKey||r}`:``),children:e.children?.length?vh(e.children):void 0}}).filter(Boolean):[]}function yh(e){let t=String(e?.key??``).trim().toLowerCase(),n=String(e?.label??``).trim().toLowerCase(),r=String(e?.popupKey??``).trim().toLowerCase(),i=String(e?.route??e?.routeTemplate??``).trim().toLowerCase();return t===`change-status`||t===`changestatus`||n===`change status`||r===`change-status`||i.includes(`/popup/change-status`)}function bh(e){let t=e?.clientSubmissionStatus,n=t&&typeof t==`object`?t:null;return{id:Number(n?.clientSubmissionStatusId??n?.id??n?.uniqueId??e?.clientSubmissionStatusId??e?.clientStatusId??e?.[`clientSubmissionStatus.clientSubmissionStatusId`]??0)||0,text:J(String(n?.clientSubmissionStatusText??n?.name??(typeof t==`string`?t:void 0)??e?.clientSubmissionStatusText??e?.clientStatusText??e?.clientStatus??e?.[`clientSubmissionStatus.clientSubmissionStatusText`]??``).trim())}}function xh(e,t,n){let r=bh(e);return r.id>0&&t.has(r.id)?!0:!!(r.text&&n.has(r.text))}function Sh(e,t,n){return e?.length?e.some(e=>xh(e,t,n)):!1}function Ch(e,t){return!e.permissionKey||!t.length||t.every(t=>Lc(Zp(t,`actionPermission.${e.permissionKey}`)))}function wh(e,t){return t?e===`asc`?`desc`:e===`desc`?``:`asc`:`asc`}function Th(e){return e===`asc`?`Ascending`:e===`desc`?`Descending`:`Neutral`}function Eh({label:e,sortDir:t,sortable:n,onSort:r}){if(!n)return(0,s.jsx)(`span`,{className:`job-table-header-label`,children:e});let i=Th(t);return(0,s.jsxs)(`div`,{className:`job-table-header-content`,children:[(0,s.jsx)(`span`,{className:`job-table-header-label`,title:typeof e==`string`?e:void 0,children:e}),(0,s.jsx)(a.Tooltip,{title:i,mouseEnterDelay:.08,overlayClassName:`job-sort-tooltip`,children:(0,s.jsx)(`button`,{type:`button`,className:`job-table-sort-trigger${t?` job-table-sort-trigger--active`:``}`,"aria-label":`Sort ${typeof e==`string`?e:`column`}, ${i}`,onClick:e=>{e.preventDefault(),e.stopPropagation(),r?.()},children:(0,s.jsxs)(`span`,{className:`job-table-sort-icon-stack`,children:[(0,s.jsx)(o.CaretUpOutlined,{className:`job-table-sort-icon job-table-sort-icon--up${t===`asc`?` job-table-sort-icon--active`:``}`}),(0,s.jsx)(o.CaretDownOutlined,{className:`job-table-sort-icon job-table-sort-icon--down${t===`desc`?` job-table-sort-icon--active`:``}`})]})})})]})}function Dh({moduleName:e,activeTabScope:t,pageSize:n,sort:r,sortDir:i,queryParams:a,dataKey:o=``}){return[o??``,e??``,t??``,n,r??``,i??``,a?JSON.stringify(a):``].join(`|`)}function Oh(e){let t=Number(e);return Number.isInteger(t)&&t>0?t:1}function kh(e){for(let t of e.keys()){let e=/^p(\d+)$/.exec(t);if(e)return Oh(e[1])}return 1}function Ah(e){[...e.keys()].forEach(t=>{(/^p\d+$/.test(t)||t===`page`)&&e.delete(t)})}var jh=[],Mh={};function Nh({record:e,fields:t,selected:n,onSelect:r,onPreview:i,onRecordClick:o,isControlled:c,selectionMode:l=`checkbox`,selectionType:u=`checkbox`,selectionDisabled:d=!1,onPopupAction:f,permissions:p}){let m=t.find(e=>e.cardRole===`name`),h=t.find(e=>e.cardRole===`action`),g=t.find(e=>e.cardRole===`headerAction`),_=t.filter(e=>e!==m&&e!==h&&e!==g),v=m?rm(e,Jp(m)):``,y=h?.render?h.render(q(e,Jp(h)),e):null,b=g?.render?g.render(q(e,Jp(g)),e):null;return(0,s.jsxs)(`div`,{className:`param-card${n?` param-card--selected`:``}`,"aria-selected":n,onClick:e=>{lh(e.target)||o?.()},role:o?`button`:void 0,tabIndex:o?0:void 0,onKeyDown:e=>{!o||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),o())},children:[(0,s.jsx)(`div`,{className:`param-card__header`,children:(0,s.jsxs)(`div`,{className:`param-card__name-row`,children:[l===`checkbox`&&(u===`radio`?(0,s.jsx)(a.Radio,{checked:n,disabled:d,onChange:r,onClick:e=>e.stopPropagation(),className:`param-card__checkbox param-card__radio`}):(0,s.jsx)(a.Checkbox,{checked:n,disabled:d,onChange:r,onClick:e=>e.stopPropagation(),className:`param-card__checkbox`})),i&&(0,s.jsx)(`button`,{type:`button`,className:`job-row-eye-button`,"aria-label":`Preview`,onClick:e=>{e.stopPropagation(),i()},children:(0,s.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.00035%204.69941C4.74567%204.69941%203.72701%205.71807%203.72701%206.97275C3.72701%208.22745%204.74567%209.24609%206.00035%209.24609C7.25503%209.24609%208.2737%208.22745%208.2737%206.97275C8.2737%205.71807%207.25503%204.69941%206.00035%204.69941ZM6.00035%205.87128C6.60827%205.87128%207.10182%206.36485%207.10182%206.97275C7.10182%207.58067%206.60827%208.07422%206.00035%208.07422C5.39243%208.07422%204.89888%207.58067%204.89888%206.97275C4.89888%206.36485%205.39243%205.87128%206.00035%205.87128ZM2.06843%206.41445C2.85434%204.9331%204.16742%203.92578%206.00035%203.92578C7.83328%203.92578%209.14637%204.9331%209.93227%206.41445C10.0838%206.70013%2010.4388%206.80902%2010.7245%206.65745C11.0102%206.50587%2011.1191%206.15091%2010.9675%205.86523C9.97758%203.9994%208.30902%202.75391%206.00035%202.75391C3.69169%202.75391%202.02312%203.9994%201.03322%205.86523C0.881648%206.15091%200.990538%206.50587%201.27619%206.65745C1.56187%206.80902%201.91686%206.70013%202.06843%206.41445Z'%20fill='%23586888'/%3e%3c/svg%3e`,alt:``,className:`job-row-eye-icon`})}),(0,s.jsx)(Kp,{className:`param-card__name`,children:v}),b&&(0,s.jsx)(`div`,{className:`param-card__header-actions`,children:b})]})}),_.length>0&&(0,s.jsx)(`div`,{className:`param-card__body-fields`,children:_.map(t=>{let n=Jp(t),r=q(e,n),i=c&&typeof t.render==`function`?t.render(r,e):Xm(t,e,``,f,p);return(0,s.jsxs)(`div`,{className:`param-card__field-row`,children:[(0,s.jsx)(Kp,{className:`param-card__field-label`,children:qp(t)}),(0,s.jsx)(`div`,{className:`param-card__field-value`,children:i})]},n)})}),(0,s.jsx)(`div`,{className:`param-card__divider`}),(0,s.jsxs)(`div`,{className:`param-card__footer`,children:[(0,s.jsx)(`div`,{className:`param-card__footer-left`}),(0,s.jsx)(`div`,{className:`param-card__footer-right`,children:y})]})]})}function Ph(e){return!!(e.operator===`isEmpty`||e.operator===`notEmpty`||e.value||e.from||e.to||Array.isArray(e.values)&&e.values.length>0)}function Fh(e){return e.fieldLabel?e.fieldLabel:(e.field??``).replace(/([A-Z])/g,` $1`).replace(/^(.)/,e=>e.toUpperCase()).trim()}function Ih(e){if(e.operator===`isEmpty`)return`Is Empty`;if(e.operator===`notEmpty`)return`Not Empty`;if(e.value)return`"${e.value}"`;if(e.from&&e.to)return`${e.from} to ${e.to}`;if(e.from)return`from ${e.from}`;if(e.to)return`to ${e.to}`;if(Array.isArray(e.values)&&e.values.length>0){let t=e.values.slice(0,2).join(`, `);return e.values.length>2?`${t} +${e.values.length-2}`:t}return``}function Lh({filters:e,onRemove:t,onClearAll:n}){let r=(e??[]).map((e,t)=>({row:e,originalIdx:t})).filter(({row:e})=>e.field&&Ph(e));return r.length===0?null:(0,s.jsxs)(a.Flex,{gap:6,wrap:`wrap`,align:`center`,className:`filter-chips-bar`,children:[(0,s.jsx)(Kp,{className:`filter-chips-bar__label`,children:`Filters:`}),r.map(({row:e,originalIdx:n})=>(0,s.jsxs)(a.Tag,{closable:!0,onClose:()=>t(n),className:`filter-chip`,children:[(0,s.jsx)(`span`,{className:`filter-chip__field`,children:Fh(e)}),(0,s.jsx)(`span`,{className:`filter-chip__sep`,children:`: `}),(0,s.jsx)(`span`,{className:`filter-chip__value`,children:Ih(e)})]},`${e.field}-${n}`)),r.length>1&&(0,s.jsx)(a.Button,{type:`link`,size:`small`,onClick:n,className:`filter-chips-clear`,children:`Clear all`})]})}function Rh({moduleName:e,authToken:n,actions:r=[],actionRules:c=[],breadcrumbItems:l=[],dataSource:u=[],className:f=``,initialPageSize:p=10,onAction:m,onSummaryClick:h,rowKey:g,showSummaryButton:_=!1,summaryButtonLabel:v=`View Summary`,summaryRoute:y,showFieldButton:b=!0,showFilterButton:x=!0,hideFilterButton:S=!1,showRowIcons:C=!0,fieldButtonLabel:w=`View Field`,fieldButtonRoute:T,tabs:E,tabTitleOverrides:D=null,tableClassName:O=`job-list-table`,fields:k=jh,fieldOverrides:A=null,extraFields:ee=jh,listName:te=``,loading:ne=!1,total:re,current:ie,pageSize:ae,onPageChange:oe,onPageSizeChange:se,onSearch:ce,toolbarExtra:le=null,listToolbar:j=null,dataKey:ue=``,dataPending:de=!1,showSearch:fe=!0,searchPlaceholder:pe=`Min 3 Chars, press Enter to search`,searchFields:me=jh,showViewToggle:he=!1,activeView:ge=`list`,onViewChange:_e,autoCardForExternalRows:ve=!0,createAction:ye,onRecordClick:be,selectedRecordId:xe,selectionMode:Se=`checkbox`,selectionLimit:Ce,selectionType:we=`checkbox`,compact:Te=!1,onSelectionChange:Ee,selectedSource:De,onTabChange:Oe,fetchData:ke=kl,responseMapper:Ae=Ed,queryParams:je=Mh,defaultVisibleColumnCount:Me=6,showAdd:Ne=!0,redirectOnViewDenied:Pe=!0,lockOuterPageScroll:Fe=!1,deferFieldConfig:Ie=!1,expandRow:Le=null,actionContext:Re=null,highlightNew:ze=!1,rowActionsInMenu:Be=!1,paginationProps:Ve=null,highlightUpdates:He=!1,subtitle:Ue=``,addLabel:We=``,selectedRowKeys:Ge,loadingSkeleton:Ke=!1}){let qe=(0,d.useNavigate)(),Je=(0,d.useLocation)(),M=ar(e),[Ye,Xe]=(0,i.useState)(()=>new Set),[Ze,Qe]=(0,i.useState)(()=>new Set);(0,i.useEffect)(()=>{if(J(M)!==`submissions`){Xe(new Set),Qe(new Set);return}let e=!1,n=new URLSearchParams({masterName:`clientSubmissions`,offset:`0`,limit:`100`});return t.x&&n.set(`app_id`,t.x),t.o(t.S,`/masters/dropdown?${n.toString()}`).then(t=>{if(e)return;let n=(Array.isArray(t?.data)?t.data:[]).filter(e=>e?.isTerminalStatus===!0);Xe(new Set(n.map(e=>Number(e?.id??e?.uniqueId??0)).filter(e=>e>0))),Qe(new Set(n.map(e=>J(e?.name)).filter(Boolean)))}).catch(()=>{e||(Xe(new Set),Qe(new Set))}),()=>{e=!0}},[M]);let $e=!!Fe,{canView:et,canAdd:tt,canEdit:nt,canDelete:rt}=du(M),{can:it}=yu(),at=JSON.stringify(je??Mh),ot=(0,i.useMemo)(()=>je??Mh,[at]),[st]=(0,d.useSearchParams)(),ct=kh(st),[N,lt]=(0,i.useState)(()=>String(De??``).trim()||`all`),[ut,dt]=(0,i.useState)(``),[ft,pt]=(0,i.useState)(``),[mt,ht]=(0,i.useState)(!1),[gt,_t]=(0,i.useState)([]),vt=Array.isArray(Ge),yt=vt?JSON.stringify(Ge.map(String)):``,[P,bt]=(0,i.useState)(()=>vt?Ge.map(String):[]),[xt,St]=(0,i.useState)([]),[Ct,wt]=(0,i.useState)(0),[F,Tt]=(0,i.useState)({current:ct,pageSize:p}),[I,Et]=(0,i.useState)({sort:``,sortDir:``}),[Dt,Ot]=(0,i.useState)([]),[kt,At]=(0,i.useState)(!1),[jt,Mt]=(0,i.useState)(()=>vt?Ge.map(String):[]),[Nt,Pt]=(0,i.useState)(yt);if(vt&&Nt!==yt){let e=JSON.parse(yt);Pt(yt),bt(e),Mt(e),St(t=>t.filter((t,n)=>e.includes(String(ch(t,n,g)))))}(0,i.useEffect)(()=>(n&&t._(n),()=>{n&&t.r()}),[n]),(0,i.useEffect)(()=>{if($e)return document.documentElement.classList.add(`listview-page-scroll-lock`),document.body.classList.add(`listview-page-scroll-lock`),()=>{document.documentElement.classList.remove(`listview-page-scroll-lock`),document.body.classList.remove(`listview-page-scroll-lock`)}},[$e]);let Ft=(0,i.useRef)(null),[It,Lt]=(0,i.useState)(0),Rt=(0,i.useRef)(),zt=(0,i.useRef)(``);(0,i.useEffect)(()=>{let e=Ft.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(e=>{let t=e[0]?.contentRect?.width;typeof t==`number`&&Lt(t)});return t.observe(e),()=>t.disconnect()},[]);let Bt=(e,t)=>String(ch(e,t,g)),Vt=Wp(e,{enabled:!!(ze||He)}),Ht=(e,t)=>{let n=[];if(xe!=null&&Ut(e,t)&&n.push(`list-view-row--active`),(ze||He)&&Vt.count>0){let r=Bt(e,t);ze&&Vt.has(r)?n.push(Vt.arrived(r)?`lv-row--new lv-row--arrived`:`lv-row--new`):He&&Vt.updated(r)&&n.push(`lv-row--updated`)}return n.join(` `)},Ut=(e,t)=>String(Bt(e,t))===String(xe??``),Wt=(e,t)=>{let n=Bt(e,t);n&&be?.(e,n)},Gt=we===`radio`,L=Gt?1:Number(Ce)>0?Number(Ce):null,R=(e,t)=>{let n=L?e.slice(0,L):e,r=(t??[]).filter(e=>e!=null),i=L?r.slice(0,L):r;bt(n),St(i),Ee?.(n,i)},[Kt,qt]=(0,i.useState)(u),[Jt,Yt]=(0,i.useState)(u.length),[Xt,Zt]=(0,i.useState)([]),[Qt,$t]=(0,i.useState)([]),[en,tn]=(0,i.useState)(``),[nn,rn]=(0,i.useState)([]),[an,on]=(0,i.useState)([]),[sn,cn]=(0,i.useState)(!1),[ln,un]=(0,i.useState)(!1),[dn,fn]=(0,i.useState)(null),[pn,mn]=(0,i.useState)(null),[hn,gn]=(0,i.useState)(!1),z=!!(oe||se||ce),_n=z?u:Kt,vn=z?re??0:Jt,yn=z?k:Qt,bn=(0,i.useMemo)(()=>_n.some(e=>nm(e)),[_n]),xn=(0,i.useMemo)(()=>yn.some(e=>tm(e)),[yn]),Sn=ve&&(bn||xn)?`card`:ge,Cn=r.length>0?r:nn,wn=c.length>0?c:an,Tn=(0,i.useMemo)(()=>vh(Cn),[Cn]),En=(0,i.useMemo)(()=>new Map(_h(Tn).map(e=>[e.key,e])),[Tn]),Dn=(0,i.useMemo)(()=>gh(Tn,e=>{let t=xu(e);return t===`add`&&!tt||t===`edit`&&!nt||t===`delete`&&!rt||!Rc(it,e.permission,M)||e.showInList===!1?!1:!e.allowedTabs||e.allowedTabs.some(e=>J(e)===J(N))}),[Tn,N,it,tt,nt,rt,M]),On=(0,i.useMemo)(()=>gh(Dn,e=>(P.length===1||e.allowMultiple||e.danger)&&Ch(e,xt)&&!(J(M)===`submissions`&&yh(e)&&Sh(xt,Ye,Ze))&&!Hu(e.key,xt,wn,N)),[N,M,wn,P.length,xt,Ye,Ze,Dn]),kn=typeof e==`string`?e.trim().length>0:!!e,An=kn?`/${M}-create${ye?`?action=${encodeURIComponent(ye)}`:``}`:``;(0,i.useEffect)(()=>{Pe&&kn&&!et&&qe(`/`,{replace:!0})},[et,kn,qe,Pe]);let jn=(e,{replace:t=!1}={})=>{let n=new URLSearchParams(st);Ah(n);let r=[n.toString(),e>1?`p${e}`:``].filter(Boolean).join(`&`);r!==Je.search.replace(/^\?/,``)&&qe({pathname:Je.pathname,search:r?`?${r}`:``},{replace:t})},Mn=(e,t)=>{Tt(t=>({...t,current:e})),jn(e,t)},B=()=>{Mn(1,{replace:!0})},{config:Pn,loading:Fn,error:In}=Kl(!z&&kn&&(!Ie||ln&&!sn&&!dn&&Qt.length===0)?e:null),Ln=(0,i.useCallback)(e=>{let t=I.sort===e,n=wh(I.sortDir,t),r=n?String(e):``;Et({sort:r,sortDir:n}),typeof ce==`function`&&ce(r,n),B()},[ce,B,I.sort,I.sortDir]),Rn=(e,t)=>{Et({sort:String(e),sortDir:t}),typeof ce==`function`&&ce(String(e),t),B()};(0,i.useEffect)(()=>{Tt(e=>e.current===ct?e:{...e,current:ct})},[ct]),(0,i.useEffect)(()=>{z&&Tt(e=>{let t=Oh(ie??e.current),n=Number(ae)>0?Number(ae):e.pageSize;return e.current===t&&e.pageSize===n?e:{current:t,pageSize:n}})},[ie,ae,z]);let zn=Je.state?.refreshTimestamp;(0,i.useEffect)(()=>{zn&&(R([],[]),wt(e=>e+1))},[zn]);let Bn=(0,i.useMemo)(()=>{let e=[...Array.isArray(E)?E:[],...Xt],t=Y(N);return e.find((e,n)=>Y(ah(e,n))===t)},[N,Xt,E]),Vn=Bn?.field??Bn?.fieldName??Bn?.filterField??Bn?.dataIndex??en,Hn=oh(N)?``:N,Un=!Hn&&!oh(N)&&J(Vn).length>0,Wn=ft.trim().length>=3,Gn=Wn?ft.trim():``,Kn=gt.some(e=>e.field),qn=Dh({moduleName:e,activeTabScope:Hn,pageSize:F.pageSize,sort:I.sort,sortDir:I.sortDir,queryParams:ot,dataKey:ue}),V=(0,i.useRef)(ue);(0,i.useEffect)(()=>{V.current!==ue&&(V.current=ue,qt([]),Yt(0),cn(!0))},[ue]);let[Jn,Yn]=(0,i.useState)(ue),Xn=!z&&!!(ue||de)&&(Jn!==ue||!!de),Zn=(0,i.useRef)(0);(0,i.useLayoutEffect)(()=>{let e=Ft.current;if(!e||!(ue||de))return;if(Xn){Zn.current>0&&(e.style.minHeight=`${Zn.current}px`);return}e.style.minHeight=``;let t=e.parentElement?.getBoundingClientRect().bottom??0,n=Math.max(0,t-e.getBoundingClientRect().bottom);Zn.current=e.offsetHeight+n});let $n=F.current===1&&pn?.key===qn,er=Number(pn?.total),tr=Wn?Number.isFinite(er)&&er>0?er:Jt:0;(0,i.useEffect)(()=>{if(z)return;if(!kn){qt([]),Yt(0),Zt([]),$t([]),tn(``),rn([]),on([]),fn(null);return}let t=Y(Hn);if(zt.current&&zt.current===t){zt.current=``;return}let n=!1,r=Wn&&tr>F.pageSize,i=r?tr:F.pageSize,o=r?0:(F.current-1)*F.pageSize;return cn(!(!Wn&&!Kn&&F.current===1&&$n)),fn(null),ke(e,i,o,{scope:Hn,sort:I.sort,sortDir:I.sortDir,search:Gn,filters:gt,queryParams:ot}).then(t=>{if(n)return;let{rows:r,total:i,tabs:a,fields:o,tabField:s,actions:c,actionRules:l}=Ae(t,e),u=!De&&oh(N)&&Array.isArray(a)&&a.length>0&&!a.some((e,t)=>oh(ah(e,t)))?ah(a[0],0):``,d=Dh({dataKey:ue,moduleName:e,activeTabScope:u?String(u):Hn,pageSize:F.pageSize,sort:I.sort,sortDir:I.sortDir,queryParams:ot});qt(r),Yt(i),Yn(ue),Zt(a),$t(o),tn(s),rn(c),on(l),u&&Y(N)!==Y(u)&&(zt.current=Y(u),lt(String(u))),!Wn&&!Kn&&F.current===1&&mn({key:d,rows:r,total:i,tabs:a,fields:o,tabField:s,actions:c,actionRules:l})}).catch(e=>{n||(qt([]),Yt(0),Yn(ue),Zt([]),$t([]),tn(``),rn([]),on([]),fn(e.message),kn&&a.message.error(`Invalid module name or data could not be loaded.`))}).finally(()=>{n||(cn(!1),un(!0))}),()=>{n=!0}},[Gn,N,Hn,gt,ue,ke,Kn,Wn,kn,z,e,F.current,F.pageSize,Ct,Ae,tr,De,I.sort,I.sortDir,ot]);let H=(0,i.useMemo)(()=>{let e=z&&Array.isArray(k)&&k.length,t=!z&&Array.isArray(Qt)&&Qt.length,n=!In&&Array.isArray(Pn)&&Pn.length,r=e?k:t?Qt:n?Pn:[],i=new Map(Qt.map(e=>[Jp(e),e]).filter(([e])=>e)),a=r.map(e=>{let t=Jp(e),n=i.get(t)??{},r=t&&A&&typeof A==`object`?A[t]:null,a=r?.renderConfig?{...n.renderConfig??e.renderConfig??{},...r.renderConfig}:e.renderConfig??n.renderConfig??null;return{...n,...e,...r??{},...a?{renderConfig:a}:{},key:t,label:qp(r??e)??qp(e)??qp(n)}}).filter(e=>e.key&&e.label),o=(Array.isArray(ee)?ee:[]).map((e,t)=>{let n=Jp(e);return n?{...e,key:n,label:qp(e)??`Field ${t+1}`,isVirtual:e.isVirtual??!0,isVisible:typeof e.isVisible!=`boolean`||e.isVisible}:null}).filter(Boolean);return Pm([...a,...o])},[Pn,In,k,ee,A,z,Qt]),U=H.find(e=>J(e.renderType)===`rowactions`),nr=j&&j.actions!==!1?Dn.filter(e=>xf(e)===`toolbar`):jh,rr=U&&!Be?Dn.filter(e=>xf(e)===`row`):jh,ir=new Set([...nr,...rr].map(e=>String(e.key))),or=ir.size?gh(On,e=>!ir.has(String(e.key))):On,sr=U?Dn.filter(e=>!ir.has(String(e.key))&&e.actionType!==`export`):jh,cr=(0,i.useMemo)(()=>H.filter(e=>typeof e.isVisible==`boolean`?e.isVisible:typeof e.isVisible!=`string`||e.isVisible.toLowerCase()===`true`).map(e=>({key:e.key,label:e.label})),[H]),lr=cr.map(e=>e.key),ur=Dt.filter(e=>lr.includes(e)),dr=ur.length?ur:cr.slice(0,Me).map(e=>e.key),fr=Math.min(Me,cr.length),pr=dr.length>Me,mr=(0,i.useMemo)(()=>H.filter(e=>!e.cardHidden&&(e.tableHidden||dr.includes(e.key))),[H,dr]),hr=(0,i.useMemo)(()=>{let e=ut.toLowerCase(),t=_n,n=Un?t.filter(e=>sh(e,N,Bn,H,Vn)):t,r=me.length?H.filter(e=>me.includes(e.key)):H;return!e||e.length<3?n:n.filter(t=>r.some(n=>String(rm(t,n.key)).toLowerCase().includes(e)||Bm(n).some(n=>String(rm(t,n)).toLowerCase().includes(e))))},[N,Bn,Vn,Un,_n,H,ut,me]),W=(0,i.useMemo)(()=>{if(!Wn)return hr;let e=(F.current-1)*F.pageSize;return hr.slice(e,e+F.pageSize)},[hr,Wn,F.current,F.pageSize]),gr=Wn?hr.length:vn,_r=ft.trim().length>=3,vr=String(hr.length).padStart(2,`0`),yr=vn>0||_n.length>0,[br,xr]=(0,i.useState)(null),Sr=(0,i.useCallback)(e=>{e&&e.url&&xr({url:e.url,...e.name?{name:e.name}:{}})},[]),Cr=(0,i.useCallback)(()=>xr(null),[]),wr=!!(j&&j.steady),Tr=wr||yr||ut.trim().length>0||ft.trim().length>0,Er=kn?dn?`Invalid module name or data could not be loaded.`:In?`Field configuration failed to load.`:`No data found.`:`Please provide a module name to view data.`,Dr=(0,i.useMemo)(()=>!D||typeof D!=`object`?null:Object.entries(D).reduce((e,[t,n])=>(n==null||(e[String(t)]=String(n)),e),{}),[D]),Or=(0,i.useMemo)(()=>{let t=Array.isArray(E)?E:[],n=!t.length,r=t.length?t:Xt.length?Xt:[{key:`all`,title:e??`List`,count:gr}],i=!!(Dr&&Object.keys(Dr).length);return!n&&!i?r:r.map((e,t)=>{if(!e||typeof e!=`object`)return e;let r=i?Dr[String(ah(e,t))]:void 0;if(!r&&!n)return e;let a={...e};if(r&&(a.title=r),n){if(ln){let t=Number(e.count??e.countValue);a.count=Number.isFinite(t)?t:0}else delete a.count,delete a.countValue}return a})},[ln,e,Xt,Dr,gr,E]);(0,i.useEffect)(()=>{if(!Or.length||!((Xt?.length??0)>0||Array.isArray(E)&&E.length>0))return;let e=Y(N);if(!Or.some((t,n)=>Y(ah(t,n))===e)){let e=ah(Or[0],0);e&&lt(String(e))}},[N,Or,Xt,E]),(0,i.useEffect)(()=>{if(De===void 0||!Or.length)return;let e=Or.find((e,t)=>Y(ah(e,t))===Y(De));if(!e)return;let t=String(ah(e,Or.indexOf(e)));(De!==Rt.current||Y(N)!==Y(t))&&(Rt.current=De,lt(e=>Y(e)===Y(t)?e:t))},[N,Or,De]);let kr=e=>{let t=H.map(e=>{let t={};return Object.entries(e).forEach(([e,n])=>{typeof n!=`function`&&(t[e]=n)}),t});qe(`/popup/preview`,{state:{background:Je,moduleName:M,record:e,fields:t}})},Ar=(e,t,n={})=>{let r=gm(e,t),i=r.startsWith(`/`)?r:`/${r}`,a=t?._id??t?.id;qe(i,{state:{background:Je,selectedIds:a===void 0?[]:[a],selectedRecords:[t],moduleName:M,popupContext:n.popupState??{},popupAction:{key:n.key,apiMethod:n.apiMethod,apiPath:n.apiPath,defaultTemplateId:n.defaultTemplateId,requireJobId:n.requireJobId,popupKey:n.popupKey,actionType:n.actionType??n.type,popupFieldOverrides:n.popupFieldOverrides},requireJobId:n.requireJobId,...n.popupState}})},jr=(0,i.useMemo)(()=>{let e={dataIndex:`icons`,key:`icons`,visibilityKey:`jobsGroup`,fixed:`left`,width:25,render:(e,t)=>(0,s.jsxs)(a.Space,{size:4,className:`job-row-icons`,children:[(0,s.jsx)(`button`,{type:`button`,className:`job-row-eye-button`,"aria-label":`Preview job`,onClick:()=>kr(t),children:(0,s.jsx)(`img`,{src:pf,alt:``,className:`job-row-eye-icon`})}),t.hasLinkedIn&&(0,s.jsx)(a.Tooltip,{title:`LinkedIn`,children:(0,s.jsx)(o.LinkedinFilled,{className:`job-row-linkedin-icon`})})]})},t=H.filter(e=>dr.includes(e.key)).map((e,t)=>{let n=I.sort===e.key?I.sortDir:``;return{title:Eh({label:e.label,sortDir:n,sortable:yr,onSort:()=>Ln(e.key)}),dataIndex:e.key,key:e.key,fixed:t===0?`left`:void 0,ellipsis:{showTitle:!1},width:ih(e,W),render:(t,n,r)=>{let i=J(e.renderType);if(i===`rowactions`)return Lr(n,r,e);if(i===`rownumber`){let e=Math.max(1,Number(F.current)||1),t=Math.max(1,Number(F.pageSize)||10);return(0,s.jsx)(`span`,{className:`lv-cell-index`,children:(e-1)*t+r+1})}return Xm(e,n,ft,Ar,{canAdd:tt,canEdit:nt,canDelete:rt},wn,Hn)}}});if(!(pr||z)&&It>0&&t.length>0){let n=(C?e.width:0)+(yr&&Se===`checkbox`?48:0)+(Le&&typeof Le.render==`function`?40:0)+rh,r=t.reduce((e,t)=>e+t.width,0),i=It-n-r;i>0&&r>0&&t.forEach(e=>{e.width=Math.floor(e.width+i*(e.width/r))})}return[...C?[e]:[],...t]},[C,N,tt,rt,nt,ft,wn,Ln,pr,yr,z,Je,e,qe,H,W,Se,I.sort,I.sortDir,It,Dn,dr,rr,sr,Le]),Mr=It>0&&jr.reduce((e,t)=>e+(Number(t.width)||0),0)+(yr&&Se===`checkbox`?48:0)+(Le&&typeof Le.render==`function`?40:0)+rh>It,Nr=(0,i.useCallback)(e=>{let t=Or.find((t,n)=>Y(ah(t,n))===Y(e)),n=String(t?ah(t,Or.indexOf(t)):e);if(lt(n),vt||(bt([]),St([])),B(),typeof Oe==`function`){let e=t?.key??t?.value??t?.id??n;Rt.current=e,Oe(e)}},[Oe,Or,B]);function Pr(t,n,r){let i=En.get(String(t));if(!i||i.actionType===`group`)return;let a=Array.isArray(r)?r:[],o=()=>{(n??[]).forEach(t=>Rp(e,t)),Fr(t,n,r)};if(!gp(i)){o();return}Cp(i,a.length===1?a[0]:{},{tab:Re?.tab??``,count:a.length||(n?.length??0)}).then(e=>{e&&o()})}function Fr(e,n,r){let i=En.get(String(e));if(i&&i.actionType!==`group`){if(typeof m==`function`&&m({key:i.key,label:i.label,selectedIds:n,selectedRecords:r}),typeof i.onClick==`function`){i.onClick({action:i,selectedIds:n,selectedRecords:r});return}if(i.actionType===`export`){Rr(i,r);return}if(i.actionType===`copy`){let e=r.map(e=>Zp(e,i.copyField||`id`)??e?._id).filter(e=>e!=null);navigator.clipboard.writeText(e.join(`
8
+ `)).then(()=>a.message.success(`Copied to clipboard`)).catch(()=>a.message.error(`Could not copy to clipboard`));return}if(i.actionType===`api`&&i.apiPath){let e=r[0]??{},o=gm(i.apiPath,e);t.o(t.S,o.startsWith(`/`)?o:`/${o}`,{method:i.apiMethod||`POST`,body:[`GET`,`DELETE`].includes(String(i.apiMethod).toUpperCase())?void 0:JSON.stringify({ids:n,records:r})}).then(()=>{a.message.success(`${i.label} completed`),wt(e=>e+1)}).catch(e=>a.message.error(e.message||`${i.label} failed`));return}if(i.route){let e=r[0]??{},t=gm(i.route,e),a=t.startsWith(`/`)?t:`/${t}`;if(i.route.startsWith(`/popup/`)||i.route.startsWith(`popup/`)){let t=i.popupKey||i.route?.replace(/^\/popup\//i,``)||``,o=/(?:^|\/)(?:quick(?:-|_)?submit|submit)(?:$|\/)/i.test(t),s=new URLSearchParams(Je.search).get(`jobId`),c=i.popupState?.jobId??i.popupState?.jobID??i.popupState?.jobId??e.jobId??e.job?.id??e.job?._id??s,l=i.popupState?.candidateId??i.popupState?.applicantId??e.id??e._id??e.applicantId??e.candidateId;if(o&&c&&l){let e=new URLSearchParams;e.set(`candidateId`,String(l)),e.set(`isFromSubmission`,`false`),qe(`/submission-create/${encodeURIComponent(String(c))}?${e.toString()}`);return}qe(a,{state:{background:Je,selectedIds:n,selectedRecords:r,moduleName:M,popupContext:i.popupState??{},popupAction:{key:i.key,apiMethod:i.apiMethod,apiPath:i.apiPath,defaultTemplateId:i.defaultTemplateId,requireJobId:i.requireJobId,popupFieldOverrides:i.popupFieldOverrides},...i.popupState}});return}qe(a)}}}function Ir({key:e}){let t=_h(On).find(t=>String(t.key)===String(e));t&&hh(t,xt,N)||Pr(e,P,xt)}function Lr(e,t,n){let r=Mu.list,i=t=>Ch(t,[e])&&!Ru(t.key,e,wn,Hn,r),a=rr.filter(i).map(t=>({...t,__disabledReason:zu(t.key,e,wn,Hn,r)||(Vu(t,e,Hn)?t.doneLabel||`Done`:``)})),o=sr.filter(i).map(t=>ph(t,Vu(t,e,Hn),zu(t.key,e,wn,Hn,r))),c=n?.renderConfig??{},l=c.viewField||c.downloadField?Kf({...c,viewField:c.viewField||void 0},t=>q(e,t),void 0):[];return(0,s.jsx)(ap,{inline:a,menu:o,links:l,onRun:({key:n})=>Pr(n,[Bt(e,t)],[e])})}async function Rr(t,n){let r=H.filter(e=>dr.includes(e.key)&&J(e.renderType)!==`rowactions`),i=n;if(!i.length){let t=a.message.loading(`Preparing export…`,0);try{i=Ae(await ke(e,5e3,0,{scope:Hn,sort:I.sort,sortDir:I.sortDir,search:Gn,filters:gt,queryParams:ot}),e).rows??[]}catch(e){a.message.error(e?.message||`Export failed`);return}finally{t()}}if(!i.length){a.message.info(`Nothing to export`);return}let o=Mf(r,i,(e,t)=>{let n=Hm(Am(t,e));return n===`-`?``:n}),s=URL.createObjectURL(new Blob([o],{type:`text/csv;charset=utf-8`})),c=document.createElement(`a`);c.href=s,c.download=Nf(j?.exportName||t.label||e),document.body.appendChild(c),c.click(),c.remove(),setTimeout(()=>URL.revokeObjectURL(s),0),a.message.success(i.length>=5e3?`Exported the first ${jf} rows`:`Exported ${i.length} rows`)}let zr=dr.length===cr.length,Br=dr.length>0&&!zr,Vr=(e,t)=>{Ot(n=>{let r=cr.slice(0,Me).map(e=>e.key),i=n.length?n:r;return t?i.includes(e)?i:[...i,e]:i.length<=fr?i:i.filter(t=>t!==e)})},Hr=()=>{if(typeof h==`function`){h();return}if(y){qe(y);return}gn(!0)},Ur=()=>{T&&qe(T)};(0,i.useEffect)(()=>{if(!hn)return;let e=e=>{e.key===`Escape`&&gn(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[hn]);let Wr=()=>{$n&&(qt(pn.rows),Yt(pn.total),Yn(ue),Zt(pn.tabs),$t(pn.fields),tn(pn.tabField),rn(pn.actions??[]),on(pn.actionRules??[]),fn(null),cn(!1))},Gr=e=>{let t=e.target.value,n=t.trim().length<3,r=gt.some(e=>e.field);n&&(pt(``),r||Wr()),dt(t),B()},Kr=()=>{let e=ut.trim();e.length>=3&&(pt(e),B())},qr=()=>{Wr(),_t([]),vt||R([],[]),B()};(0,i.useEffect)(()=>{Sn===`card`&&!vt&&(Mt([]),R([],[]))},[F.current,F.pageSize,N,Sn]);let Jr=e=>{if(Gt){let t=jt.includes(e)?[]:[e];Mt(t),R(t,W.filter((e,n)=>t.includes(String(ch(e,n,g)))));return}L&&jt.length>=L&&!jt.includes(e)||Mt(t=>{let n=t.includes(e)?t.filter(t=>t!==e):L?[...t,e].slice(0,L):[...t,e],r=W.filter((e,t)=>n.includes(String(ch(e,t,g))));return R(n,r),n})},Yr=(0,s.jsxs)(`div`,{className:`column-visibility-menu`,onClick:e=>e.stopPropagation(),children:[(0,s.jsx)(a.Checkbox,{checked:zr,indeterminate:Br,onChange:e=>{Ot(e.target.checked?cr.map(e=>e.key):cr.slice(0,Me).map(e=>e.key))},children:`Select All`}),(0,s.jsx)(`div`,{className:`column-visibility-menu__list`,children:cr.map(e=>(0,s.jsx)(a.Checkbox,{checked:dr.includes(e.key),disabled:dr.includes(e.key)&&dr.length<=fr,onChange:t=>Vr(e.key,t.target.checked),children:e.label},e.key))})]});return(0,s.jsxs)(bf.Provider,{value:Sr,children:[(0,s.jsxs)(`div`,{className:`antd dynamic-list-view${Te?` list-view--compact`:``}${$e?` list-view--page-scroll-lock`:``} ${f}`.trim(),children:[l.length>0&&(0,s.jsx)(`div`,{className:`job-list-header`,children:(0,s.jsx)(Dd,{items:l})}),(0,s.jsx)(a.Card,{className:`job-tabs-card`,children:(0,s.jsxs)(a.Flex,{align:`center`,justify:`space-between`,children:[Ue?(0,s.jsxs)(a.Flex,{vertical:!0,className:`lv-list-head`,style:{minWidth:0},children:[(0,s.jsx)(Nn,{activeKey:N,tabs:Or,onChange:Nr}),(0,s.jsx)(`span`,{className:`lv-list-subtitle`,children:Ue})]}):(0,s.jsx)(Nn,{activeKey:N,tabs:Or,onChange:Nr}),(0,s.jsxs)(a.Flex,{align:`center`,gap:8,children:[le,Tr&&(0,s.jsx)(a.Input,{prefix:(0,s.jsx)(o.SearchOutlined,{className:`job-search-icon`}),placeholder:pe,value:ut,onChange:Gr,onPressEnter:Kr,allowClear:!0,className:`job-search-input`}),!z&&tt&&Ne&&(We?(0,s.jsx)(a.Button,{type:`primary`,className:`job-toolbar-add-button`,icon:(0,s.jsx)(o.PlusOutlined,{}),onClick:()=>{An&&qe(An)},children:We}):(0,s.jsx)(a.Tooltip,{title:`Add`,children:(0,s.jsx)(a.Button,{"aria-label":`Add`,className:`job-toolbar-icon-button`,icon:(0,s.jsx)(o.PlusOutlined,{}),onClick:()=>{An&&qe(An)}})})),yr&&!S&&(0,s.jsx)(a.Tooltip,{title:`Filter`,children:(0,s.jsx)(a.Badge,{count:gt.filter(e=>e.field&&Ph(e)).length,size:`small`,offset:[-2,2],children:(0,s.jsx)(a.Button,{"aria-label":`Filter`,className:`job-toolbar-icon-button`,icon:(0,s.jsx)(o.FilterOutlined,{}),onClick:()=>ht(!0)})})}),he&&yr&&(0,s.jsxs)(a.Flex,{align:`center`,gap:6,children:[(0,s.jsx)(a.Tooltip,{title:`List View`,children:(0,s.jsx)(a.Button,{className:`job-toolbar-icon-button param-view-toggle-btn${Sn===`list`?` param-view-toggle-btn--active`:``}`,icon:(0,s.jsx)(o.UnorderedListOutlined,{}),onClick:()=>{_e?.(`list`),vt||(Mt([]),R([],[]))}})}),(0,s.jsx)(a.Tooltip,{title:`Card View`,children:(0,s.jsx)(a.Button,{className:`job-toolbar-icon-button param-view-toggle-btn${Sn===`card`?` param-view-toggle-btn--active`:``}`,icon:(0,s.jsx)(o.AppstoreOutlined,{}),onClick:()=>{_e?.(`card`),vt||(Mt([]),R([],[]))}})})]}),_&&(0,s.jsx)(a.Button,{className:`job-summary-button`,type:`primary`,onClick:Hr,children:v}),b&&T&&(0,s.jsx)(a.Button,{className:`job-summary-button`,type:`primary`,onClick:Ur,children:w})]})]})}),j&&(yr||wr)&&(()=>{let e=j.sortMenu===!1?[]:Cf(H),t=wf(H),n=I.sort?`${I.sort}|${I.sortDir||`asc`}`:t?`${t.field}|${t.dir}`:void 0,r=W.map((e,t)=>String(ch(e,t,g))),i=r.length>0&&r.every(e=>P.map(String).includes(e)),o=P.length>0&&!i,c=[...(Array.isArray(j.hostButtons)?j.hostButtons:[]).filter(e=>e&&e.key!=null).map(e=>({key:`host:${e.key}`,label:e.label,icon:e.icon,listStyle:e.primary?`primary`:``,actionType:e.export?`export`:``,requireSelection:!!e.requireSelection,__disabledReason:typeof e.disabled==`string`?e.disabled:``,__host:e})),...nr.map(e=>({...e,__disabledReason:xt.length&&mh(e,xt,wn,N)||``}))];return(0,s.jsx)(a.Card,{className:`job-toolbar-card lv-toolbar-card`,children:(0,s.jsx)(pp,{steady:wr&&j.sortMenu!==!1,sortOptions:e,sortValue:e.some(e=>e.value===n)?n:void 0,onSort:Rn,showSelectAll:j.selectAll!==!1&&Se===`checkbox`&&!L,allSelected:i,someSelected:o,onToggleAll:()=>{i||o?R([],[]):R(r,[...W])},buttons:c,maxButtons:Number.isFinite(j.maxButtons)?j.maxButtons:3,hasSelection:P.length>0,onRun:e=>{if(!e.__host){Pr(e.key,P,xt);return}if(e.__host.export){Rr({key:e.key,label:e.label,actionType:`export`},xt);return}e.__host.onClick?.(xt,P)},note:j.note??``})})})(),yr&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(a.Card,{className:`job-toolbar-card`,children:(0,s.jsxs)(a.Flex,{className:`p-flex`,align:`center`,justify:`space-between`,children:[(0,s.jsxs)(a.Flex,{align:`center`,gap:3,children:[Sn===`card`&&!L&&(0,s.jsx)(a.Checkbox,{checked:W.length>0&&jt.length>=W.length,indeterminate:jt.length>0&&jt.length<W.length,className:`param-card-view__select-all`,onChange:()=>{if(vt){let e=W.map((e,t)=>String(ch(e,t,g))),t=e.some(e=>jt.includes(e)),n=jt.filter(t=>!e.includes(t)),r=t?n:[...n,...e];Mt(r),R(r,W.filter((e,t)=>r.includes(String(ch(e,t,g)))));return}if(jt.length>0)Mt([]),R([],[]);else{let e=W.map((e,t)=>String(ch(e,t,g)));Mt(e),R(e,[...W])}},children:`Select All`}),(0,s.jsx)(a.Dropdown,{open:kt,onOpenChange:At,trigger:[`click`],dropdownRender:()=>Yr,placement:`bottomLeft`,overlayClassName:`column-visibility-dropdown`,children:(0,s.jsx)(a.Button,{"aria-label":`Display columns`,type:`text`,icon:(0,s.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='path-1-inside-1_8856_23533'%20fill='white'%3e%3crect%20x='1.40039'%20y='1.40039'%20width='5.09086'%20height='5.09086'%20rx='0.727266'/%3e%3c/mask%3e%3crect%20x='1.40039'%20y='1.40039'%20width='5.09086'%20height='5.09086'%20rx='0.727266'%20stroke='%23586888'%20stroke-width='1.5'%20mask='url(%23path-1-inside-1_8856_23533)'/%3e%3cmask%20id='path-2-inside-2_8856_23533'%20fill='white'%3e%3crect%20x='1.40039'%20y='7.50781'%20width='5.09086'%20height='5.09086'%20rx='0.727266'/%3e%3c/mask%3e%3crect%20x='1.40039'%20y='7.50781'%20width='5.09086'%20height='5.09086'%20rx='0.727266'%20stroke='%23586888'%20stroke-width='1.5'%20mask='url(%23path-2-inside-2_8856_23533)'/%3e%3cline%20x1='7.375'%20y1='2.93555'%20x2='12.225'%20y2='2.93555'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='5.83398'%20x2='12.225'%20y2='5.83398'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='8.87305'%20x2='12.225'%20y2='8.87305'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3cline%20x1='7.375'%20y1='11.7227'%20x2='12.225'%20y2='11.7227'%20stroke='%23586888'%20stroke-width='0.75'%20stroke-linecap='round'/%3e%3c/svg%3e`,alt:``,className:`job-action-list-icon`}),size:`small`,className:`job-actions-button job-column-display-button`,children:(0,s.jsx)(o.DownOutlined,{className:`job-actions-caret`})})}),or.length>0&&P.length>0&&(0,s.jsx)(a.Dropdown,{menu:{items:or.map(e=>ph(e,hh(e,xt,N),mh(e,xt,wn,N))),onClick:Ir},trigger:[`click`],children:(0,s.jsxs)(a.Button,{type:`text`,size:`small`,className:`job-actions-button job-actions-menu-button`,children:[(0,s.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.6279%206.78121C12.6857%206.88148%2012.7014%207.00057%2012.6715%207.11239C12.6417%207.22422%2012.5688%207.31967%2012.4688%207.37785L7.21875%2010.4403C7.15185%2010.4794%207.0758%2010.4999%206.99836%2010.4999C6.92092%2010.4999%206.84487%2010.4794%206.77797%2010.4403L1.52797%207.37785C1.42936%207.31859%201.35806%207.22289%201.32951%207.11145C1.30095%207.00001%201.31744%206.88181%201.37539%206.78244C1.43335%206.68306%201.52811%206.61052%201.63916%206.5805C1.75022%206.55048%201.86863%206.56542%201.96875%206.62207L7%209.55605L12.0312%206.62207C12.1315%206.56428%2012.2506%206.54858%2012.3624%206.57841C12.4743%206.60824%2012.5697%206.68116%2012.6279%206.78121ZM1.3125%204.37496C1.31267%204.29833%201.33297%204.22309%201.37136%204.15677C1.40975%204.09045%201.46489%204.03538%201.53125%203.99707L6.78125%200.934566C6.84815%200.895555%206.9242%200.875%207.00164%200.875C7.07908%200.875%207.15513%200.895555%207.22203%200.934566L12.472%203.99707C12.5381%204.0356%2012.5929%204.09076%2012.6309%204.15707C12.669%204.22337%2012.6891%204.2985%2012.6891%204.37496C12.6891%204.45142%2012.669%204.52654%2012.6309%204.59285C12.5929%204.65915%2012.5381%204.71432%2012.472%204.75285L7.22203%207.81535C7.15513%207.85436%207.07908%207.87491%207.00164%207.87491C6.9242%207.87491%206.84815%207.85436%206.78125%207.81535L1.53125%204.75285C1.46489%204.71453%201.40975%204.65946%201.37136%204.59314C1.33297%204.52682%201.31267%204.45159%201.3125%204.37496ZM2.61844%204.37496L7%206.93105L11.3816%204.37496L7%201.81886L2.61844%204.37496ZM7.65625%2011.7993L7%2012.1821L1.96875%209.24707C1.86913%209.19747%201.75436%209.18769%201.64779%209.21973C1.54122%209.25177%201.45087%209.32322%201.39512%209.41953C1.33937%209.51583%201.32241%209.62977%201.3477%209.73814C1.37299%209.84651%201.43863%209.94117%201.53125%2010.0028L6.78125%2013.0653C6.84815%2013.1044%206.9242%2013.1249%207.00164%2013.1249C7.07908%2013.1249%207.15513%2013.1044%207.22203%2013.0653L8.09703%2012.5551C8.14746%2012.5266%208.19171%2012.4883%208.22723%2012.4426C8.26275%2012.3968%208.28882%2012.3444%208.30394%2012.2885C8.31906%2012.2326%208.32291%2012.1742%208.31529%2012.1167C8.30766%2012.0593%208.28871%2012.004%208.25952%2011.9539C8.23033%2011.9039%208.19149%2011.8601%208.14526%2011.8252C8.09903%2011.7903%208.04632%2011.7649%207.9902%2011.7505C7.93408%2011.7361%207.87566%2011.7331%207.81833%2011.7414C7.761%2011.7498%207.70591%2011.7695%207.65625%2011.7993Z'%20fill='%236B7280'/%3e%3cpath%20d='M10.6036%2011.3825L13.4607%209.4477C13.5813%209.36599%2013.614%209.20256%2013.5341%209.08069L13.0105%208.282C12.9303%208.15966%2012.7665%208.12478%2012.6434%208.20383L9.54053%2010.1964L8.94939%2011.4054C8.84904%2011.6106%209.03632%2011.8387%209.25715%2011.7803L10.4338%2011.469C10.4561%2011.4631%2010.4776%2011.4543%2010.4977%2011.4429L10.6036%2011.3825ZM9.54053%2010.1964L10.6036%2011.3825'%20stroke='%236B7280'%20stroke-width='0.6'/%3e%3c/svg%3e`,alt:``,className:`job-actions-frame-icon`}),`Actions `,(0,s.jsx)(o.DownOutlined,{className:`job-actions-caret`})]})}),P.length>0&&(0,s.jsxs)(Kp,{className:`job-selected-count`,children:[`Selected (`,P.length,`)`]})]}),_r&&(0,s.jsxs)(Kp,{className:`job-search-results-count`,children:[`Search Results (`,vr,`)`]})]})})}),Kn&&(0,s.jsx)(Lh,{filters:gt,onRemove:e=>{let t=gt.filter((t,n)=>n!==e);_t(t),B()},onClearAll:qr}),(0,s.jsx)(`div`,{ref:Ft,className:`job-table-measure`,children:(0,s.jsx)(a.Spin,{spinning:z?ne:Fn||sn||Xn,children:Ke&&!z&&(Fn||sn)&&W.length===0?(0,s.jsx)(`div`,{className:`list-view-skeleton`,"aria-busy":`true`,children:(0,s.jsx)(a.Skeleton,{active:!0,title:!1,paragraph:{rows:6}})}):Xn?(0,s.jsx)(`div`,{className:`list-view-switching`,"aria-busy":`true`,style:{minHeight:160}}):Sn===`card`?W.length===0?(0,s.jsx)(a.Empty,{image:a.Empty.PRESENTED_IMAGE_SIMPLE,description:Er,className:`param-card-view__empty`,children:!z&&tt&&Ne&&An&&!dn&&(0,s.jsx)(a.Button,{type:`primary`,icon:(0,s.jsx)(o.PlusOutlined,{}),onClick:()=>qe(An),children:`Add New`})}):(0,s.jsx)(`div`,{className:`param-card-view__grid`,children:W.map((e,t)=>{let n=String(ch(e,t,g));return(0,s.jsx)(Nh,{record:e,fields:mr,selected:Se===`checkbox`?jt.includes(n):Ut(e,t),selectionDisabled:!!(!Gt&&L&&jt.length>=L&&!jt.includes(n)),isControlled:z,onPreview:()=>kr(e),onSelect:()=>Jr(n),onPopupAction:Ar,onRecordClick:be?()=>Wt(e,t):void 0,selectionMode:Se,selectionType:we,permissions:{canAdd:tt,canEdit:nt,canDelete:rt}},n)})}):(0,s.jsx)(a.Table,{rowSelection:yr&&Se===`checkbox`?{type:Gt?`radio`:`checkbox`,fixed:!0,columnWidth:48,selectedRowKeys:P,...vt?{preserveSelectedRowKeys:!0}:{},getCheckboxProps:e=>{let t=String(ch(e,W.indexOf(e),g));return{disabled:!!(!Gt&&L&&P.length>=L&&!P.map(String).includes(t))}},onChange:(e,t)=>{R(e,t)},columnTitle:(()=>{if(L)return null;let e=W.length,t=e>0&&P.length>=e,n=P.length>0&&!t;return(0,s.jsx)(a.Checkbox,{checked:t,indeterminate:n,onChange:()=>{let e=W.map((e,t)=>String(ch(e,t,g)));if(vt){let r=P.map(String).filter(t=>!e.includes(t)),i=xt.filter((t,n)=>!e.includes(String(ch(t,n,g))));n||t?R(r,i):R([...r,...e],[...i,...W]);return}if(n||t)R([],[]);else{let e=W.map((e,t)=>ch(e,t,g));R(e,[...W])}}})})()}:void 0,columns:jr,dataSource:W,size:`middle`,tableLayout:`fixed`,scroll:{x:pr||z||Mr?`max-content`:void 0,y:`calc(100vh - 300px)`},pagination:!1,locale:{emptyText:(0,s.jsx)(a.Empty,{image:a.Empty.PRESENTED_IMAGE_SIMPLE,description:Er})},className:`${O} ${Te?`list-view-table--compact`:``}`.trim(),onRow:be?(e,t)=>({onClick:n=>{lh(n.target)||Wt(e,t)},"aria-selected":Ut(e,t)}):void 0,rowClassName:xe!=null||ze||He?Ht:void 0,rowKey:(e,t)=>ch(e,t,g),expandable:Le&&typeof Le.render==`function`?{expandedRowRender:e=>Le.render(e),rowExpandable:typeof Le.rowExpandable==`function`?e=>!!Le.rowExpandable(e):void 0,columnWidth:40,...Le.iconAtEnd?{expandIconColumnIndex:jr.length+(yr&&Se===`checkbox`?1:0),expandIcon:({expanded:e,onExpand:t,record:n,expandable:r})=>r?(0,s.jsx)(a.Button,{type:`text`,size:`small`,className:`lv-row-expand`,"aria-label":e?`Collapse row`:`Expand row`,"aria-expanded":e,icon:e?(0,s.jsx)(o.UpOutlined,{}):(0,s.jsx)(o.DownOutlined,{}),onClick:e=>{e.stopPropagation(),t(n,e)}}):null}:{}}:void 0})})}),yr&&!Xn?(0,s.jsx)(Qn,{...Ve&&typeof Ve==`object`?Ve:{},current:F.current,pageSize:F.pageSize,total:gr,onChange:(e,t)=>{if(z&&typeof oe==`function`){oe(e,t??F.pageSize);return}Mn(e)},onPageSizeChange:e=>{if(z&&typeof se==`function`){se(e);return}Tt({current:1,pageSize:e}),jn(1,{replace:!0})}}):void 0,(0,s.jsx)(ff,{moduleName:M,open:mt,filters:gt,onClose:()=>ht(!1),onApply:({filters:e})=>{_t(e),B()},onReset:qr}),(0,s.jsx)($d,{moduleName:M,open:hn,rows:Kt,tabs:Or,total:gr,onClose:()=>gn(!1)})]}),br&&(0,s.jsx)(i.Suspense,{fallback:null,children:(0,s.jsx)(Gp,{documents:[br],open:!0,onClose:Cr})})]})}var zh=Object.freeze([`form`,`list`,`choiceCards`,`accessMatrix`,`permissionMatrix`,`activity`,`declaration`,`review`,`success`,`preview`]),Bh=/^[a-zA-Z][a-zA-Z0-9]*([.-][a-zA-Z0-9]+)*$/,Vh=new Map,Hh=new Map,Uh=e=>typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`;function Wh(e){typeof console<`u`&&console.warn(`[core-theme wizard] ${e}`)}function Gh(e,t,n,r){let i=String(n??``).trim();return Bh.test(i)?Uh(r)?(e.set(i,r),()=>{e.get(i)===r&&e.delete(i)}):(Wh(`${t} "${i}" needs a React component.`),null):(Wh(`${t} id "${i}" is not valid; use letters and digits, separated by dots.`),null)}function Kh(e,t){return zh.includes(String(e??``).trim())?(Wh(`step type "${e}" is built in and cannot be replaced.`),null):Gh(Vh,`Step type`,e,t)}function qh(e,t){return Gh(Hh,`Preview`,e,t)}function Jh(e){return Vh.get(String(e??``).trim())??null}function Yh(e){return Hh.get(String(e??``).trim())??null}function Xh(){return[...Vh.keys()]}var Zh=e=>(Array.isArray(e)?e.map(String):String(e??``).split(`.`)).filter(e=>e!==``);function Qh(e,t){return Zh(t).reduce((e,t)=>e?.[t],e)}var $h=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null);function eg(e,t,n){let r=Zh(t);if(!r.length)return e;let i=$h(e)?{...e}:{},a=i;return r.slice(0,-1).forEach(e=>{a[e]=$h(a[e])?{...a[e]}:{},a=a[e]}),a[r[r.length-1]]=n,i}var tg=e=>e?.content?.type||`form`;function ng(e){return(Array.isArray(e)?e:e==null||e===``?[]:[e]).map(e=>typeof e==`object`&&e?e._id??e.id??e.value:e).filter(e=>e!=null&&e!==``).map(String)}function rg(e={},t={}){if(e?.selectionMode===`single`)return{limit:1,source:`single`,field:``};let n=String(e?.selectionLimitField??``).trim();if(n){let e=Number(Qh(t,n));if(Number.isInteger(e)&&e>0)return{limit:e,source:`field`,field:n}}let r=Number(e?.selectionLimit);return e?.selectionLimit!==``&&e?.selectionLimit!==null&&Number.isInteger(r)&&r>0?{limit:r,source:`config`,field:``}:{limit:null,source:n?`fieldMissing`:null,field:n}}var ig=e=>String(e?.selectionLabel??``).trim()||`items`;function ag(e={},t={}){let n=ng(Qh(t,e?.selectionField)),{limit:r,source:i,field:a}=rg(e,t),o=n.length,s=!!r&&o>r,c=!!r&&o>=r,l=r?`${o} of ${r} selected`:`${o} selected`,u=``;return s?u=`Too many selected: the limit is ${r}. Remove ${o-r} to continue.`:c&&r===1?u=`Only one can be chosen. Remove it to choose another.`:c?u=`Limit reached (${r}). Remove one to choose another.`:i===`fieldMissing`&&(u=`The limit is set by "${a}", which has no value yet.`),{ids:n,count:o,limit:r,locked:c,over:s,text:l,reason:u}}function og(e={},t=()=>({})){let n=ig(e);return{validator:async()=>{let{count:r,limit:i,over:a}=ag(e,t()??{});if(e?.required&&r===0){let t=i&&i>1?`Select 1–${i} ${n} to continue.`:`Choose at least one option to continue.`;throw Error(e.requiredMessage||t)}if(a)throw Error(`You selected ${r} ${n}, but the limit is ${i}. Remove ${r-i} to continue.`)}}}function sg(e){let t=(e?.errorFields??[]).flatMap(e=>e?.errors??[]),n=[...new Set(t.map(e=>String(e??``).trim()).filter(Boolean))];return!n.length&&e instanceof Error&&e.message?[e.message]:n}function cg(e=[],t={}){let n={};return e.forEach(e=>{let r=e?.content?.selectionField;r&&(n[String(e.key)]=ng(Qh(t,r)))}),n}function lg(e=[],t=[]){let n=new Set,r=e=>{let t=Zh(e).join(`.`);t&&n.add(t)};return(e??[]).forEach(e=>{e?.addRow&&e.name&&r(e.name),(e?.fields??[]).forEach(e=>{r(e?.field),e?.payloadKey&&r(e.payloadKey)})}),(t??[]).forEach(e=>{let t=e?.content??{};r(t.selectionField),r(t.selectionRecordField),r(t.signature?.field),r(t.signature?.dateField),(t.declarationItems??[]).forEach(e=>r(e?.key)),(e.groups??[]).forEach(e=>(e?.fields??[]).forEach(e=>r(e?.field)))}),n}function ug(e={},t=[],n=new Set){let r=$h(e)?e:{},i=[],a=[];return(t??[]).forEach(e=>{(Array.isArray(e?.content?.payloadMap)?e.content.payloadMap:[]).forEach(t=>{let o=String(t?.from??``).trim(),s=Zh(t?.to).join(`.`);if(!o||!s){a.push({step:e.key,from:o,to:s,reason:`incomplete`});return}if(!n.has(s)){a.push({step:e.key,from:o,to:s,reason:`undeclared`});return}let c=o===`selection`?e?.content?.selectionField:o;if(!c){a.push({step:e.key,from:o,to:s,reason:`noSelectionField`});return}let l=Qh(r,c);if(l===void 0){a.push({step:e.key,from:o,to:s,reason:`noValue`});return}r=eg(r,s,l),i.push({step:e.key,from:o,to:s})})}),{values:r,applied:i,skipped:a}}var dg=e=>typeof File<`u`&&e instanceof File||typeof Blob<`u`&&e instanceof Blob;function fg(e){if(!(dg(e)||typeof e==`function`)){if(Array.isArray(e))return e.map(fg).filter(e=>e!==void 0);if($h(e)){let t={};return Object.entries(e).forEach(([e,n])=>{if(e===`originFileObj`)return;let r=fg(n);r!==void 0&&(t[e]=r)}),t}return e}}function pg(e=[]){for(let t=e.length-1;t>=0;--t)if(tg(e[t])!==`success`)return t;return-1}function mg(e,t){let n=e?.content?.actions;return!n||typeof n!=`object`?``:String(n[t]??``).trim()}function hg(e,t=[]){let n=e?.wizardContent?.addRowView;return n===`table`||n===`cards`?n:e?.mergeInto&&(t??[]).find(t=>t!==e&&String(t?.name)===String(e.mergeInto))?.wizardContent?.addRowView===`table`?`table`:`cards`}var gg=/^[A-Za-z][A-Za-z0-9_]{0,63}$/,_g=/^[A-Za-z_][A-Za-z0-9_.]{0,127}$/,vg=Object.freeze([`module`,`limit`,`offset`,`scope`,`search`,`sort`,`sortDir`,`filters`,`view`,`listSource`,`selected`,`recordId`,`tabs`,`tabField`,`tabValue`,`booleanQuery`,`include`,`includeHidden`,`includeRaw`,`raw`,`allFields`,`extraFields`,`actionView`]),yg=new Set(vg.map(e=>e.toLowerCase()));function bg(e){let t=String(e??``);return gg.test(t)&&!yg.has(t.toLowerCase())}function xg(e){if(e==null||typeof e==`function`)return;if(e instanceof Date)return Number.isNaN(e.getTime())?void 0:e.toISOString();if(typeof e==`object`){if(typeof e.toISOString==`function`){if(typeof e.isValid==`function`&&!e.isValid())return;try{return e.toISOString()}catch{return}}let t=e.value??e._id??e.id;return typeof t==`object`&&t?void 0:xg(t)}let t=String(e);return t.trim()===``?void 0:t}function Sg(e){if(Array.isArray(e)){let t=e.map(xg).filter(e=>e!==void 0);return t.length?t.join(`,`):void 0}return xg(e)}function Cg(e,t={}){let n={};return $h(e)&&Object.entries(e).forEach(([e,r])=>{if(!bg(e)||!_g.test(String(r??``)))return;let i=Sg(Qh(t,r));i!==void 0&&(n[e]=i)}),n}function wg(e={},t={},{recordId:n=``,selectedIds:r=[]}={}){let i={};$h(e)&&Object.entries(e).forEach(([e,t])=>{bg(e)&&typeof t==`string`&&t!==``&&(i[e]=t)});let a=String(t?.listSource??``).trim(),o=String(t?.listView??``).trim();if(a&&(i.listSource=a),o&&(i.view=o),a){let e=ng(r);e.length&&(i.selected=e.join(`,`));let t=String(n??``).trim();t&&(i.recordId=t)}return i}function Tg(e=[]){return(e??[]).some(e=>e?.content?.saveVia===`action`)}function Eg(e=[]){let t=pg(e);if(t>=0&&mg(e[t],`onFinish`))return t;for(let t=(e??[]).length-1;t>=0;--t)if(mg(e[t],`onFinish`))return t;return-1}var Dg=e=>String(e??``).split(`.`).filter(Boolean),X=(e,t)=>{let n=Dg(t);return n.length?n.reduce((e,t)=>e?.[t],e):void 0},Og=e=>String(e?._id??e?.id??e?.value??``),Z=e=>Array.isArray(e)?e:e==null||e===``?[]:[e];function kg(e){if(Array.isArray(e))return e;for(let t of[e?.data,e?.records,e?.items,e?.data?.records,e?.data?.data])if(Array.isArray(t))return t;return[]}function Q(e){return e==null||e===``?`Not provided`:typeof e==`boolean`?e?`Yes`:`No`:Array.isArray(e)?e.map(Q).join(`, `):typeof e==`object`?e.name||e.label||e.title||JSON.stringify(e):String(e)}function Ag(e,t){if(t==null||t===``)return Q(t);if(Array.isArray(t))return t.map(t=>Ag(e,t)).join(`, `);if(e?.type===`date`)return yn(t)||Q(t);let n=Z(e?.options).find(e=>String(e?.value??e)===String(t));return Q(n?n.label??n:t)}function jg(e){let t=String(e??``).split(`.`).pop().replace(/[_-]+/g,` `).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).trim().toLowerCase();return t?t.charAt(0).toUpperCase()+t.slice(1):``}function Mg(e){let t=String(e??``).trim();return!t.startsWith(`/`)||t[1]===`/`||t[1]===`\\`||/[\u0000-\u001F\u007F]/.test(t)?``:t}function Ng(e,t=100,n=``){let r=String(n??``).trim(),a=`${e??``}|${t}|${r}`,[o,s]=(0,i.useState)({requestKey:``,loading:!1,rows:[],error:``});return(0,i.useEffect)(()=>{let n=!1;if(e)return(r?kl(e,t,0,{queryParams:{listSource:r}}):pr(e,t,0)).then(e=>{n||s({requestKey:a,loading:!1,rows:kg(e),error:``})}).catch(e=>{n||s({requestKey:a,loading:!1,rows:[],error:e?.message||`Could not load this information.`})}),()=>{n=!0}},[t,e,r,a]),e?o.requestKey===a?o:{loading:!0,rows:[],error:``}:{loading:!1,rows:[],error:``}}var{Paragraph:Pg,Text:Fg,Title:Ig}=a.Typography,Lg=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function Rg({result:e,caption:t}){if(e==null)return(0,s.jsx)(a.Empty,{description:`There is nothing to preview yet.`});if(typeof e!=`object`)return(0,s.jsx)(Pg,{children:String(e)});let n=Array.isArray(e)?e:Z(e.rows);if(!n.length)return(0,s.jsx)(a.Empty,{description:`There is nothing to preview yet.`});let r=Array.isArray(e.columns)?e.columns:null,i=r?r.map(e=>Lg(e)?e.key:e).filter(Boolean).map(String):[...new Set(n.flatMap(e=>Lg(e)?Object.keys(e):[]))].filter(e=>!e.startsWith(`_`)),o=e=>{let t=r?.find(t=>Lg(t)?String(t.key)===e:String(t)===e);return Lg(t)&&t.label||jg(e)};return(0,s.jsx)(a.Table,{className:`v1-wizard-result-table`,size:`small`,rowKey:`__v1RowKey`,dataSource:n.filter(Lg).map((e,t)=>({...e,__v1RowKey:String(e._id??e.id??t)})),pagination:n.length>20&&{pageSize:20,showSizeChanger:!1},scroll:{x:`max-content`},title:t?()=>t:void 0,columns:i.map(e=>({key:e,dataIndex:e,title:o(e),render:e=>Q(e)}))})}function zg(e){let{config:t={},step:n,actionResult:r=null,stepBusy:o=!1}=e,c=String(t.preview??``).trim(),l=c?Yh(c):null;return l?(0,i.createElement)(l,e):r==null?o?(0,s.jsx)(a.Skeleton,{active:!0,paragraph:{rows:5}}):c?(0,s.jsx)(a.Alert,{showIcon:!0,type:`error`,role:`alert`,message:`The preview "${c}" is not available in this app.`,description:`Register it in the host app with registerWizardPreview, or give this step an action that returns the preview data.`}):mg(n,`onEnter`)?(0,s.jsx)(a.Empty,{description:`There is nothing to preview yet.`}):(0,s.jsx)(a.Alert,{showIcon:!0,type:`info`,message:`Choose a preview, or an action that returns preview data, for this step in Admin.`}):(0,s.jsx)(Rg,{result:r})}var Bg=e=>String(e?.key??e?.module??e?.moduleName??e?.name??Og(e)),Vg=e=>Q(e?.label??e?.title??e?.name??e?.module??Bg(e));function Hg(e){return Lg(e)?Object.values(e).reduce((e,t)=>e+(Lg(t)?Object.values(t).filter(e=>e===!0).length:0),0):0}function Ug({config:e={},form:t,moduleName:n=``}){let r=Lg(e.permissionMatrix)?e.permissionMatrix:{},i=String(r.rowsSource??``).trim(),o=Z(r.actions).map(e=>String(e??``).trim()).filter(Boolean),c=Dg(e.selectionField),l=a.Form.useWatch(c.length?c:[`__v1WizardMatrixOff__`],{form:t,preserve:!0}),u=Lg(l)?l:{},{rows:d,loading:f,error:p}=Ng(c.length&&i&&o.length&&n?n:``,Number(e.fetchLimit)||200,i);if(!c.length)return(0,s.jsx)(a.Alert,{showIcon:!0,type:`error`,role:`alert`,message:`This permission table has no "Save the choice in" field. Set one in Admin.`});if(!i)return(0,s.jsx)(a.Alert,{showIcon:!0,type:`info`,message:`Choose the rows source for this permission table in Admin.`});if(!o.length)return(0,s.jsx)(a.Alert,{showIcon:!0,type:`info`,message:`Add at least one action column for this permission table in Admin.`});if(!n)return(0,s.jsx)(a.Alert,{showIcon:!0,type:`error`,role:`alert`,message:`This permission table needs the form's module to load its rows.`});let m=e=>{t?.setFieldValue(c,e),t?.validateFields([c]).catch(()=>{})},h=(e,t,n)=>{let r=Lg(u[e])?u[e]:{};m({...u,[e]:{...r,[t]:n}})},g=(e,t)=>{let n=Lg(u[e])?u[e]:{};m({...u,[e]:{...n,...Object.fromEntries(o.map(e=>[e,t]))}})},_=[{key:`__row`,title:e.selectionLabel||`Module`,render:(e,t)=>(0,s.jsx)(Fg,{strong:!0,children:Vg(t)})},...r.allColumn===!0?[{key:`__all`,title:`All`,align:`center`,render:(e,t)=>{let n=Bg(t),r=o.filter(e=>u[n]?.[e]===!0).length;return(0,s.jsx)(a.Checkbox,{checked:r===o.length,indeterminate:r>0&&r<o.length,onChange:e=>g(n,e.target.checked),"aria-label":`All actions for ${Vg(t)}`})}}]:[],...o.map(e=>({key:e,title:jg(e),align:`center`,render:(t,n)=>{let r=Bg(n);return(0,s.jsx)(a.Checkbox,{checked:u[r]?.[e]===!0,onChange:t=>h(r,e,t.target.checked),"aria-label":`${jg(e)} for ${Vg(n)}`})}}))];return(0,s.jsxs)(`section`,{className:`v1-wizard-matrix`,"aria-label":e.selectionLabel||`Permissions`,children:[(0,s.jsx)(a.Form.Item,{name:c,hidden:!0,noStyle:!0,rules:e.required===!0?[{validator:async(t,n)=>{if(Hg(n)===0)throw Error(e.requiredMessage||`Tick at least one permission to continue.`)}}]:[],children:(0,s.jsx)(a.Input,{})}),f?(0,s.jsx)(a.Skeleton,{active:!0,paragraph:{rows:5}}):p?(0,s.jsx)(a.Alert,{showIcon:!0,type:`error`,message:p}):d.length?(0,s.jsx)(a.Table,{size:`small`,className:`v1-wizard-matrix__table`,rowKey:Bg,dataSource:d,columns:_,pagination:!1,scroll:{x:`max-content`}}):(0,s.jsx)(a.Empty,{description:`There are no rows to configure.`}),(0,s.jsxs)(Fg,{type:`secondary`,className:`v1-wizard-matrix__note`,children:[Hg(u),` permission`,Hg(u)===1?``:`s`,` selected. The server checks every permission when it is used.`]})]})}function Wg(){let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function Gg({items:e=[]}){let t=Z(e).filter(e=>Lg(e)&&Dg(e.key).length&&String(e.label??``).trim());return t.length?(0,s.jsx)(`div`,{className:`v1-wizard-declaration__items`,children:t.map(e=>{let t=Mg(e.linkRoute),n=e.required!==!1;return(0,s.jsx)(a.Form.Item,{className:`v1-wizard-declaration__item`,required:n,children:(0,s.jsxs)(`div`,{className:`v1-wizard-declaration__item-row`,children:[(0,s.jsx)(a.Form.Item,{noStyle:!0,name:Dg(e.key),valuePropName:`checked`,rules:n?[{validator:(t,n)=>n?Promise.resolve():Promise.reject(Error(`Tick "${e.label}" to continue.`))}]:[],children:(0,s.jsx)(a.Checkbox,{children:e.label})}),t&&(0,s.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:`v1-wizard-declaration__link`,children:e.linkLabel||`Read more`})]})},e.key)})}):null}function Kg({signature:e,form:t,required:n=!0}){if(!Lg(e))return null;let r=Dg(e.field),i=Dg(e.dateField);return r.length?(0,s.jsxs)(`div`,{className:`v1-wizard-signature`,children:[(0,s.jsx)(a.Form.Item,{name:r,label:`Signature`,extra:`Type your full name to sign.`,rules:n?[{required:!0,whitespace:!0,message:`Type your full name to sign.`}]:[],children:(0,s.jsx)(a.Input,{className:`v1-wizard-signature__input`,autoComplete:`name`,onChange:e=>{if(!i.length||!t)return;let n=String(e?.target?.value??``).trim(),r=t.getFieldValue(i);n&&!r&&t.setFieldValue(i,Wg()),n||t.setFieldValue(i,null)},placeholder:`Full name`})}),i.length>0&&(0,s.jsx)(a.Form.Item,{name:i,label:`Date`,children:(0,s.jsx)(a.Input,{readOnly:!0,className:`v1-wizard-signature__date`,placeholder:`Filled in when you sign`})})]}):null}function qg({route:e,label:t,type:n}){let r=(0,d.useNavigate)();return(0,s.jsx)(a.Button,{type:n,onClick:()=>r(e),children:t})}function Jg({route:e,label:t,type:n=`primary`}){let r=(0,d.useInRouterContext)(),i=Mg(e);if(!i||!String(t??``).trim())return null;let o=[`primary`,`default`,`link`].includes(n)?n:`default`;return r?(0,s.jsx)(qg,{route:i,label:t,type:o}):(0,s.jsx)(a.Button,{type:o,href:i,children:t})}var Yg=/^[^\s@<>"']+@[^\s@<>"']+\.[^\s@<>"']+$/,Xg=/^[+\d][\d\s().-]{2,}$/;function Zg(e=[]){let t=new Map;return e.forEach(e=>(e?.groups??[]).forEach(e=>(e?.fields??[]).forEach(e=>{e?.field&&!t.has(e.field)&&t.set(String(e.field),e.label||e.field)}))),t}function Qg({config:e={},steps:t=[],savedRecord:n=null}){let r=Lg(e.success)?e.success:{},c=Zg(t),l=n?.values??{},u=Z(r.summaryFields).map(String).filter(Boolean).map(e=>({key:e,label:c.get(e)||jg(e),value:X(l,e)})),d=Z(r.steps).map(e=>String(e??``).trim()).filter(Boolean),f=Z(r.actions).filter(Lg),p=f.length?f:e.successActionLabel?[{label:e.successActionLabel,route:e.successActionRoute,type:`primary`}]:[],m=Lg(r.contact)?r.contact:{},h=Yg.test(String(m.email??``).trim())?String(m.email).trim():``,g=Xg.test(String(m.phone??``).trim())?String(m.phone).trim():``,[_]=(0,i.useState)(()=>`v1-wizard-success-${Math.random().toString(36).slice(2,9)}`);return(0,s.jsxs)(`section`,{className:`v1-wizard-success`,"aria-labelledby":_,children:[(0,s.jsx)(a.Result,{status:`success`,icon:(0,s.jsx)(o.CheckCircleOutlined,{}),title:(0,s.jsx)(`span`,{id:_,children:r.title||e.successTitle||`Completed successfully`}),subTitle:r.message||e.successMessage||`Your information has been saved.`}),u.length>0&&(0,s.jsxs)(`div`,{className:`v1-wizard-success__summary`,children:[(0,s.jsx)(Ig,{level:5,children:`Summary`}),(0,s.jsx)(`dl`,{className:`v1-wizard-preview__fields`,children:u.map(e=>(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`dt`,{children:e.label}),(0,s.jsx)(`dd`,{children:Q(e.value)})]},e.key))})]}),d.length>0&&(0,s.jsxs)(`div`,{className:`v1-wizard-success__steps`,children:[(0,s.jsx)(Ig,{level:5,children:`What happens next`}),(0,s.jsx)(`ol`,{children:d.map((e,t)=>(0,s.jsx)(`li`,{children:e},`${t}-${e}`))})]}),p.length>0&&(0,s.jsx)(`div`,{className:`v1-wizard-success__actions`,children:p.map((e,t)=>(0,s.jsx)(Jg,{route:e.route,label:e.label,type:e.type||(t===0?`primary`:`default`)},`${e.label}-${t}`))}),(m.label||h||g)&&(0,s.jsxs)(`div`,{className:`v1-wizard-success__contact`,children:[m.label&&(0,s.jsx)(Fg,{type:`secondary`,children:m.label}),h&&(0,s.jsxs)(`a`,{href:`mailto:${h}`,children:[(0,s.jsx)(o.MailOutlined,{"aria-hidden":`true`}),` `,h]}),g&&(0,s.jsxs)(`a`,{href:`tel:${g.replace(/[^\d+]/g,``)}`,children:[(0,s.jsx)(o.PhoneOutlined,{"aria-hidden":`true`}),` `,g]})]})]})}var{Paragraph:$g,Text:e_,Title:t_}=a.Typography,$=Object.freeze({FORM:`form`,LIST:`list`,ACTIVITY:`activity`,CHOICE_CARDS:`choiceCards`,ACCESS_MATRIX:`accessMatrix`,PERMISSION_MATRIX:`permissionMatrix`,DECLARATION:`declaration`,REVIEW:`review`,SUCCESS:`success`,PREVIEW:`preview`}),n_=new Set(Object.values($)),r_=e=>e?.content?.type||$.FORM,i_=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function a_(e){let t=e.selectionMode===`single`||String(e.selectionLimitField??``).trim()!==``||Number(e.selectionLimit)>0;return!e.required&&!t?[]:[t=>og(e,()=>t.getFieldsValue(!0))]}function o_({config:e}){let t=e.selectionField;return t?(0,s.jsx)(a.Form.Item,{name:Dg(t),hidden:!0,noStyle:!0,rules:a_(e),children:(0,s.jsx)(a.Input,{})}):null}function s_(e,t,n){if(!t)return n;let r=X(t,e.primaryField||`name`)??t.label??t.title??t.fullName??t.name;return r==null||r===``?n:Q(r)}function c_({config:e,form:t,recordId:n=``}){let r=Z(e.sourceModules).filter(Boolean),[c,l]=(0,i.useState)(r[0]),u=r.includes(c)?c:r[0],d=Dg(e.selectionField),f=Dg(e.selectionLimitField),p={form:t,preserve:!0},m=a.Form.useWatch(d.length?d:[`__v1WizardSelectionOff__`],p),h=a.Form.useWatch(f.length?f:[`__v1WizardLimitOff__`],p),g=a.Form.useWatch(Dg(e.selectionRecordField).length?Dg(e.selectionRecordField):[`__v1WizardRecordsOff__`],p),_={};d.length&&(_=l_(_,d,m)),f.length&&(_=l_(_,f,h));let v=ag(e,_),[y,b]=(0,i.useState)({}),x=e=>y[e]??Z(g).find(t=>t&&Og(t)===e),S=e.listParams;a.Form.useWatch(e=>JSON.stringify(Cg(S,e??{})),p);let C=t?.getFieldsValue?.(!0)??{},w=JSON.stringify(Cg(S,C)),T=`${e.listSource??``}|${e.listView??``}|${w}|${n??``}`,E=d.length?ng(X(C,e.selectionField)).join(`,`):``,[D,O]=(0,i.useState)({key:T,selected:E});D.key!==T&&O({key:T,selected:E});let k=D.key===T?D.selected:E,A=wg(JSON.parse(w),{listSource:e.listSource,listView:e.listView},{recordId:n,selectedIds:k?k.split(`,`):[]}),ee=Object.keys(A).length>0,te=(n,r={})=>{if(d.length&&(t.setFieldValue(d,e.selectionMode===`single`?n[0]:n),e.selectionRecordField)){let i=n.map(e=>r[e]??x(e)).filter(Boolean);t.setFieldValue(Dg(e.selectionRecordField),e.selectionMode===`single`?i[0]:i)}},ne=(t,n)=>{if(!e.selectionField)return;let r={};(n??[]).forEach(e=>{e&&Og(e)&&(r[Og(e)]=e)}),Object.keys(r).length&&b(e=>({...e,...r})),te(Z(t).map(String),r)},re=e=>te(v.ids.filter(t=>t!==e));if(!r.length)return(0,s.jsx)(a.Alert,{showIcon:!0,type:`info`,message:`Choose a list source in Admin to display records here.`});let ie=e.selectionMode!==`none`&&d.length>0;return(0,s.jsxs)(`section`,{className:`v1-wizard-content__list`,"aria-label":e.title||`Available records`,children:[(0,s.jsx)(o_,{config:e}),ie&&(0,s.jsxs)(`div`,{className:`v1-wizard-selection`,"aria-live":`polite`,children:[(0,s.jsxs)(`div`,{className:`v1-wizard-selection__summary`,children:[(0,s.jsx)(e_,{strong:!0,children:v.text}),v.reason&&(0,s.jsx)(e_,{type:v.over?`danger`:`secondary`,className:`v1-wizard-selection__reason`,children:v.reason})]}),v.ids.length>0&&(0,s.jsx)(`ul`,{className:`v1-wizard-selection__chips`,"aria-label":e.selectionLabel||`Selected`,children:v.ids.map(t=>{let n=s_(e,x(t),t);return(0,s.jsxs)(`li`,{className:`v1-wizard-selection__chip`,children:[(0,s.jsx)(`span`,{children:n}),(0,s.jsx)(a.Button,{type:`text`,size:`small`,icon:(0,s.jsx)(o.CloseOutlined,{}),className:`v1-wizard-selection__remove`,"aria-label":`Remove ${n}`,onClick:()=>re(t)})]},t)})})]}),r.length>1&&(0,s.jsx)(a.Tabs,{activeKey:u,onChange:l,items:r.map(t=>({key:t,label:e.sourceLabels?.[t]||t}))}),(0,s.jsx)(Rh,{moduleName:u,compact:!0,initialPageSize:Number(e.pageSize)||10,selectionMode:e.selectionMode===`none`?`none`:`checkbox`,selectionLimit:v.limit||void 0,selectionType:e.selectionMode===`single`&&e.selectionControl===`radio`?`radio`:`checkbox`,onSelectionChange:ne,...ie?{selectedRowKeys:v.ids}:{},...ee?{queryParams:A}:{},loadingSkeleton:!0,showAdd:e.allowAdd!==!1,showSummaryButton:!1,redirectOnViewDenied:!1,lockOuterPageScroll:!1,subtitle:e.listDescription||``},u)]})}function l_(e,t,n){if(!t.length)return e;let[r,...i]=t;return{...e,[r]:i.length?l_(i_(e[r])?e[r]:{},i,n):n}}function u_(e,t,n){if(!t)return;let r=X(e,t);if(i_(r)&&r[n]!==void 0)return r[n];let i=X(e,`${t}${n===`yearly`?`Yearly`:`Monthly`}`);return i===void 0?r:i}function d_({config:e,form:t,matrix:n=!1}){let r=Z(e.sourceModules)[0],{rows:o,loading:c,error:l}=Ng(r,Number(e.fetchLimit)||100,e.listSource),u=Dg(e.selectionField),d=a.Form.useWatch(u,t),f=!n&&i_(e.choice)?e.choice:{},[p,m]=(0,i.useState)(`monthly`),h=f.billingToggle===!0,g=Z(f.compareFields).map(String).filter(Boolean),_=Z(d).map(String),v=e.selectionMode===`single`?`single`:`multiple`,y=(e,n)=>{let r=v===`single`?e:n?[...new Set([..._,e])]:_.filter(t=>t!==e);t.setFieldValue(u,r),t.validateFields([u]).catch(()=>{})};if(!r)return(0,s.jsx)(a.Alert,{showIcon:!0,type:`info`,message:`Choose where these options should be loaded from in Admin.`});if(c)return(0,s.jsx)(a.Skeleton,{active:!0,paragraph:{rows:4}});if(l)return(0,s.jsx)(a.Alert,{showIcon:!0,type:`error`,message:l});if(!o.length)return(0,s.jsx)(a.Empty,{description:`No options are available yet.`});let b=t=>{let r=Og(t),i=_.includes(r),o=Q(X(t,e.primaryField||`name`)),c=X(t,e.secondaryField),l=X(t,e.descriptionField),u=h?u_(t,e.priceField,p):X(t,e.priceField),d=f.badgeField?X(t,f.badgeField):void 0,m=Z(X(t,e.featuresField)).filter(e=>e!=null&&e!==``);return(0,s.jsxs)(a.Card,{size:`small`,className:`v1-wizard-choice${i?` is-selected`:``}`,onClick:()=>y(r,v===`single`||!i),children:[(0,s.jsxs)(`div`,{className:`v1-wizard-choice__top`,children:[(0,s.jsxs)(`div`,{children:[d!=null&&d!==``&&d!==!1&&(0,s.jsx)(a.Tag,{className:`v1-wizard-choice__badge`,children:d===!0?jg(f.badgeField):Q(d)}),(0,s.jsx)(t_,{level:5,children:o}),c!=null&&c!==``&&(0,s.jsx)(e_,{type:`secondary`,children:Q(c)})]}),n?(0,s.jsx)(a.Switch,{checked:i,onClick:(e,t)=>t?.stopPropagation(),onChange:e=>y(r,e),"aria-label":`Enable ${o}`}):v===`single`?(0,s.jsx)(a.Radio,{checked:i,onClick:e=>e.stopPropagation(),onChange:()=>y(r,!0),"aria-label":`Choose ${o}`}):(0,s.jsx)(a.Checkbox,{checked:i,onClick:e=>e.stopPropagation(),onChange:e=>y(r,e.target.checked),"aria-label":`Choose ${o}`})]}),u!=null&&u!==``&&(0,s.jsxs)(`div`,{className:`v1-wizard-choice__price`,children:[Q(u),h&&(0,s.jsx)(e_,{type:`secondary`,className:`v1-wizard-choice__cycle`,children:p===`yearly`?` / year`:` / month`})]}),l!=null&&l!==``&&(0,s.jsx)($g,{type:`secondary`,children:Q(l)}),m.length>0&&(0,s.jsx)(`ul`,{className:`v1-wizard-choice__features`,children:m.map((e,t)=>(0,s.jsx)(`li`,{children:Q(e)},`${r}-feature-${t}`))}),g.length>0&&(0,s.jsx)(`dl`,{className:`v1-wizard-choice__compare`,children:g.map(e=>(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`dt`,{children:jg(e)}),(0,s.jsx)(`dd`,{children:Q(X(t,e))})]},e))})]},r)},x=n&&e.groupByField?Object.entries(o.reduce((t,n)=>{let r=Q(X(n,e.groupByField));return t[r]=[...t[r]||[],n],t},{})):null;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o_,{config:e}),h&&(0,s.jsx)(`div`,{className:`v1-wizard-choice__billing`,children:(0,s.jsx)(a.Segmented,{"aria-label":`Billing period`,value:p,onChange:m,options:[{label:`Monthly`,value:`monthly`},{label:`Yearly`,value:`yearly`}]})}),x?x.map(([e,t])=>(0,s.jsxs)(`section`,{className:`v1-wizard-access-group`,children:[(0,s.jsx)(t_,{level:5,children:e}),(0,s.jsx)(`div`,{className:`v1-wizard-access-grid`,children:t.map(b)})]},e)):(0,s.jsx)(`div`,{className:n?`v1-wizard-access-grid`:`v1-wizard-choice-grid`,children:o.map(b)})]})}function f_(e){return(0,s.jsx)(d_,{...e})}function p_(e){return(0,s.jsx)(d_,{...e,matrix:!0})}function m_({config:e}){let t=Z(e.sourceModules)[0],{rows:n,loading:r,error:i}=Ng(t,Number(e.fetchLimit)||50,e.listSource);return t?r?(0,s.jsx)(a.Skeleton,{active:!0,paragraph:{rows:4}}):i?(0,s.jsx)(a.Alert,{showIcon:!0,type:`error`,message:i}):n.length?(0,s.jsx)(a.Timeline,{className:`v1-wizard-activity`,items:n.map(t=>({children:(0,s.jsxs)(`div`,{children:[(0,s.jsx)(e_,{strong:!0,children:Q(X(t,e.primaryField||`title`))}),e.secondaryField&&(0,s.jsx)(`div`,{children:(0,s.jsx)(e_,{type:`secondary`,children:Q(X(t,e.secondaryField))})}),e.descriptionField&&(0,s.jsx)($g,{children:Q(X(t,e.descriptionField))})]})}))}):(0,s.jsx)(a.Empty,{description:`There is no activity to show.`}):(0,s.jsx)(a.Alert,{showIcon:!0,type:`info`,message:`Choose an activity source in Admin.`})}function h_({config:e,form:t}){let n=Dg(e.selectionField||`declarationAccepted`),r=Z(e.declarationItems).filter(i_),i=!r.length||!!(e.confirmationLabel||e.selectionField);return(0,s.jsxs)(a.Card,{className:`v1-wizard-declaration`,variant:`borderless`,children:[(0,s.jsx)(t_,{level:4,children:e.declarationTitle||`Declaration`}),(0,s.jsx)($g,{children:e.declarationText||`Please review the information above and confirm that it is correct.`}),(0,s.jsx)(Gg,{items:r}),i&&(0,s.jsx)(a.Form.Item,{name:n,valuePropName:`checked`,rules:e.required===!1?[]:[{validator:(t,n)=>n?Promise.resolve():Promise.reject(Error(e.requiredMessage||`Confirm this declaration to continue.`))}],children:(0,s.jsx)(a.Checkbox,{children:e.confirmationLabel||`I confirm that the information provided is complete and accurate.`})}),(0,s.jsx)(Kg,{signature:e.signature,form:t,required:e.required!==!1})]})}function g_(e,t){return(e.groups||[]).flatMap((e,n)=>{let r=e.name||e.payloadKey||n,i=(e.fields||[]).filter(e=>e?.field&&e.show!==0&&e.show!==!1&&e.payloadMode!==`skip`);if(!Ui(e.showIf,t,t))return[];if(!e.addRow)return i.filter(e=>Ui(e.showIf,t,t)).map(e=>({id:`${r}.${e.field}`,key:e.field,label:e.label||e.field,field:e,value:X(t,e.field)}));let a=Z(X(t,e.payloadKey||e.name));return a.flatMap((e,n)=>i.filter(n=>Ui(n.showIf,e,t)).map(t=>{let i=t.label||t.field;return{id:`${r}.${n}.${t.field}`,key:t.field,label:a.length>1?`${i} (${n+1})`:i,field:t,value:X(e,t.field)}}))})}function __({config:e,field:t,fieldKey:n,value:r}){let i=e?.type===$.PERMISSION_MATRIX&&e?.selectionField===n,a=!i&&e?.selectionField===n?Z(e.sourceModules)[0]:``,{rows:o}=Ng(a,Number(e?.fetchLimit)||100,e?.listSource);if(i){let e=i_(r)?Object.entries(r).flatMap(([e,t])=>i_(t)?Object.entries(t).filter(([,e])=>e===!0).map(([t])=>`${jg(e)}: ${jg(t)}`):[]):[];return e.length?e.join(`, `):`None selected`}if(!a||!o.length)return Ag(t,r);let s=Z(r).map(String),c=o.filter(e=>s.includes(Og(e))).map(t=>Q(X(t,e.primaryField||`name`)));return c.length?c.join(`, `):Q(r)}function v_({steps:e,form:t,current:n,onGoToStep:r}){let i=a.Form.useWatch([],t),c={...t.getFieldsValue(!0),...i||{}},l=e.filter((e,t)=>t<n&&![$.REVIEW,$.SUCCESS].includes(r_(e)));return l.length?(0,s.jsx)(`div`,{className:`v1-wizard-preview`,children:l.map((e,t)=>{let n=g_(e,c),i=e.content||{};return i.selectionField&&!n.some(e=>e.key===i.selectionField)&&n.push({id:i.selectionField,key:i.selectionField,label:i.selectionLabel||`Selection`,value:X(c,i.selectionField)}),(0,s.jsx)(a.Card,{title:e.title,extra:r&&(0,s.jsx)(a.Button,{type:`text`,icon:(0,s.jsx)(o.EditOutlined,{}),"aria-label":`Edit ${e.title}`,onClick:()=>r(t),children:`Edit`}),children:n.length?(0,s.jsx)(`dl`,{className:`v1-wizard-preview__fields`,children:n.map(e=>(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`dt`,{children:e.label}),(0,s.jsx)(`dd`,{children:(0,s.jsx)(__,{config:i,field:e.field,fieldKey:e.key,value:e.value})})]},e.id))}):(0,s.jsx)(e_,{type:`secondary`,children:`This step has no stored form values to preview.`})},e.key)})}):(0,s.jsx)(a.Empty,{description:`Complete an earlier step to preview it here.`})}function y_({route:e,label:t}){let n=(0,d.useNavigate)();return(0,s.jsx)(a.Button,{type:`primary`,onClick:()=>n(e),children:t})}function b_({route:e,label:t}){return(0,d.useInRouterContext)()?(0,s.jsx)(y_,{route:e,label:t}):(0,s.jsx)(a.Button,{type:`primary`,href:e,children:t})}function x_({config:e,steps:t,savedRecord:n}){if(i_(e.success))return(0,s.jsx)(Qg,{config:e,steps:t,savedRecord:n});let r=Mg(e.successActionRoute);return(0,s.jsx)(a.Result,{status:`success`,icon:(0,s.jsx)(o.CheckCircleOutlined,{}),title:e.successTitle||`Completed successfully`,subTitle:e.successMessage||`Your information has been saved.`,extra:e.successActionLabel&&r?(0,s.jsx)(b_,{route:r,label:e.successActionLabel}):void 0})}function S_({type:e}){let t=Xh(),n=[...Object.values($),...t];return(0,s.jsx)(a.Alert,{showIcon:!0,type:`error`,role:`alert`,message:`This step uses an unknown content type: "${String(e)}".`,description:`Choose a supported step content type in Admin (${n.join(`, `)}).`})}function C_({config:e,steps:t,current:n,form:r}){return e.rightContent===`summary`?(0,s.jsx)(v_,{steps:t,form:r,current:Math.min(t.length,n+1)}):e.rightContent===`progress`?(0,s.jsxs)(`div`,{className:`v1-wizard-context__progress`,children:[(0,s.jsx)(e_,{type:`secondary`,children:`Form progress`}),(0,s.jsxs)(t_,{level:4,children:[n+1,` of `,t.length,` steps`]}),(0,s.jsx)(a.Space,{direction:`vertical`,size:8,children:t.map((e,t)=>(0,s.jsx)(a.Tag,{color:t<n?`success`:t===n?`processing`:`default`,children:e.title},e.key))})]}):(0,s.jsxs)(`div`,{className:`v1-wizard-context__help`,children:[(0,s.jsx)(o.InfoCircleOutlined,{"aria-hidden":`true`}),(0,s.jsx)(t_,{level:4,children:e.helpTitle||`Helpful information`}),(0,s.jsx)($g,{children:e.helpText||`Add guidance for this step in Admin.`})]})}function w_(e,t,n){if(e===$.LIST)return(0,s.jsx)(c_,{...t});if(e===$.PERMISSION_MATRIX)return(0,s.jsx)(Ug,{...t});if(e===$.PREVIEW)return(0,s.jsx)(zg,{...t});if(e===$.ACTIVITY)return(0,s.jsx)(m_,{...t});if(e===$.CHOICE_CARDS)return(0,s.jsx)(f_,{...t});if(e===$.ACCESS_MATRIX)return(0,s.jsx)(p_,{...t});if(e===$.DECLARATION)return(0,s.jsx)(h_,{...t});if(e===$.REVIEW)return(0,s.jsx)(v_,{...t});if(e===$.SUCCESS)return(0,s.jsx)(x_,{...t});if(e===$.FORM)return n;let r=Jh(e);return r?(0,i.createElement)(r,t):(0,s.jsx)(S_,{type:e})}function T_({step:e,steps:t,current:n,form:r,onGoToStep:i,formContent:o,notice:c=null,moduleName:l=``,actionResult:u=null,savedRecord:d=null,stepBusy:f=!1,recordId:p=``}){let m=e?.content||{},h=r_(e),g={config:m,step:e,steps:t,current:n,form:r,onGoToStep:i,moduleName:l,actionResult:u,savedRecord:d,stepBusy:f,recordId:p},_=n_.has(h),v=!_&&!!Jh(h),y=w_(h,g,o),b=c?(0,s.jsxs)(s.Fragment,{children:[c,y]}):y,x=h!==$.FORM&&o!=null?(0,s.jsxs)(s.Fragment,{children:[b,(0,s.jsx)(`div`,{hidden:!0,className:`v1-wizard-content__retained-form`,children:o})]}):b,S=_?h:v?`registered`:`unknown`,C=m.layout===`split`,w=Math.min(75,Math.max(25,Number(m.leftWidth)||70)),T=m.mainPosition===`right`;if(!C)return(0,s.jsx)(`div`,{className:`v1-wizard-content v1-wizard-content--${S}`,children:x});let E=Math.round(w/100*24),D=24-E;return(0,s.jsxs)(a.Row,{gutter:[24,24],className:`v1-wizard-content v1-wizard-content--${S} v1-wizard-content--split`,children:[(0,s.jsx)(a.Col,{xs:24,lg:T?D:E,order:T?2:1,children:T?(0,s.jsx)(C_,{...g}):x}),(0,s.jsx)(a.Col,{xs:24,lg:T?E:D,order:T?1:2,children:T?x:(0,s.jsx)(C_,{...g})})]})}var E_=1,D_=`/wizard/actions`;Object.freeze([`onEnter`,`onNext`,`onFinish`]);var O_=/^[a-z][a-zA-Z0-9]*(\.[a-zA-Z0-9]+)*$/,k_=class extends Error{constructor(e,{actionId:t=``,status:n=0,code:r=`failed`,cause:i}={}){super(e),this.name=`WizardActionError`,this.actionId=t,this.status=n,this.code=r,i&&(this.cause=i)}},A_=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function j_(e){let t=A_(e?.data)?e.data:A_(e)?e:{},n=t.recordId??t.id??t._id;return{recordId:n==null||n===``?``:String(n),values:A_(t.values)?t.values:null,result:t.result===void 0?null:t.result,message:typeof t.message==`string`?t.message:``}}function M_(e,t){let n=Number(t?.status)||0,r=String(t?.message??``).trim();return n===404?new k_(`The server does not know the wizard action "${e}". Check the action id on this step in Admin → Form Groups, or deploy that action on the server.`,{actionId:e,status:n,code:`not_found`,cause:t}):n===403?new k_(r||`You do not have permission to run "${e}".`,{actionId:e,status:n,code:`forbidden`,cause:t}):n===422?new k_(r||`The server did not accept these values for "${e}".`,{actionId:e,status:n,code:`invalid`,cause:t}):new k_(r||`The step action "${e}" did not complete.`,{actionId:e,status:n,code:n?`failed`:`network`,cause:t})}async function N_(e,n={},{baseUrl:r=t.S,fetcher:i=t.o}={}){let a=String(e??``).trim();if(!O_.test(a))throw new k_(`"${a}" is not a valid wizard action id. Fix it on this step in Admin → Form Groups.`,{actionId:a,code:`invalid_id`});let o={contractVersion:1,module:String(n.module??``),stepKey:String(n.stepKey??``),hook:n.hook,values:A_(n.values)?n.values:{},selection:A_(n.selection)?n.selection:{}};n.recordId!==void 0&&n.recordId!==null&&String(n.recordId)!==``&&(o.recordId=String(n.recordId)),n.stepRole&&(o.stepRole=String(n.stepRole));try{let e=await i(r,`${D_}/${encodeURIComponent(a)}`,{method:`POST`,body:JSON.stringify(o)});if(e?.status===!1||e?.success===!1){let t=Error(String(e?.error??e?.message??``));throw t.status=422,t}return j_(e)}catch(e){throw e instanceof k_?e:M_(a,e)}}function P_(){try{return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}catch{return!1}}function F_(e){if(e){try{e.scrollIntoView?.({block:`center`,behavior:P_()?`auto`:`smooth`})}catch{}e.focus?.({preventScroll:!0})}}var I_=`Fix the highlighted fields to continue.`;function L_(e,t){let n=[`list`,`choiceCards`,`accessMatrix`,`permissionMatrix`].includes(tg(t))?String(t?.content?.selectionField??``).trim():``,r=[],i=!1;(e?.errorFields??[]).forEach(e=>{let t=(Array.isArray(e?.name)?e.name:[e?.name]).join(`.`);n&&t===n?r.push(...e.errors??[]):(e?.errors??[]).length&&(i=!0)}),!e?.errorFields&&e instanceof Error&&r.push(...sg(e));let a=[...new Set(r.map(e=>String(e??``).trim()).filter(Boolean))];return i&&a.push(I_),a.length?a:[`Complete this step to continue.`]}function R_({enabled:e=!1,steps:t=[],current:n=0,setCurrent:r,form:a,moduleName:o=``,recordId:s=``,groups:c=[],validationNames:l,onValidationFailed:u,runAction:d=N_}={}){let[f,p]=(0,i.useState)({blocked:null,actionError:null}),[m,h]=(0,i.useState)(``),g=(0,i.useRef)(!1),[_,v]=(0,i.useState)(``),[y,b]=(0,i.useState)({}),[x,S]=(0,i.useState)(null),C=(0,i.useRef)(!0);(0,i.useEffect)(()=>(C.current=!0,()=>{C.current=!1}),[]);let w=String(s||_||``),T=t[n],E=(0,i.useMemo)(()=>lg(c,t),[c,t]),D=(0,i.useCallback)(n=>e?ug(n,t,E).values:n,[e,t,E]),O=(0,i.useCallback)(async(e,n,r={})=>{let i=t[n],c=mg(i,e);if(!c)return null;let l=a?.getFieldsValue?.(!0)??{},u=fg(D(r.values??l)),f=await d(c,{module:o,recordId:r.recordId??w,stepKey:i?.key,stepRole:i?.content?.stepRole,hook:e,values:u,selection:cg(t,r.values??l)});return C.current?(f?.values&&a?.setFieldsValue&&a.setFieldsValue(f.values),f?.recordId&&!s&&v(f.recordId),f?.result!==null&&f?.result!==void 0&&b(e=>({...e,[String(i?.key)]:f.result})),f):f},[t,a,D,d,o,w,s]),k=(0,i.useCallback)(async(e,t)=>{if(!g.current){g.current=!0,h(e);try{return await t()}finally{g.current=!1,C.current&&h(``)}}},[]),A=(0,i.useCallback)((e,n,r,i)=>{p(a=>({...a,actionError:{stepIndex:e,hook:n,actionId:r?.actionId||mg(t[e],n),code:r?.code||`failed`,message:r?.message||`This step could not be completed.`,resume:i,token:(a.actionError?.token??0)+1}}))},[t]),ee=(0,i.useCallback)(()=>k(`next`,async()=>{if(!e||!T)return!1;let i=n;p({blocked:null,actionError:null});try{let e=l?l(T):void 0;await a.validateFields(e,{recursive:!0})}catch(e){let t=L_(e,T),n=tg(T)!==`form`;return p(e=>({blocked:{stepIndex:i,messages:t,focus:n,token:(e.blocked?.token??0)+1},actionError:null})),n||u?.(e),!1}if(mg(T,`onNext`))try{await O(`onNext`,i)}catch(e){return A(i,`onNext`,e),!1}return r?.(Math.min(i+1,t.length-1)),!0}),[e,T,n,k,l,a,u,O,A,r,t.length]),te=(0,i.useRef)(-1),ne=e?mg(T,`onEnter`):``,re=(0,i.useCallback)(e=>k(`enter`,async()=>{try{if(await O(`onEnter`,e),!C.current)return;p(t=>t.actionError?.stepIndex===e?{...t,actionError:null}:t)}catch(t){if(!C.current)return;A(e,`onEnter`,t)}}),[k,O,A]);(0,i.useEffect)(()=>{if(!e){te.current=-1;return}te.current!==n&&(te.current=n,ne&&re(n))},[e,n,ne]);let ie=(0,i.useCallback)(async(n,r,i)=>{if(!e)return!0;let a=pg(t);if(a<0||!mg(t[a],`onFinish`))return!0;let o=async()=>{try{return await O(`onFinish`,a,{recordId:n||w,values:r}),C.current&&p({blocked:null,actionError:null}),!0}catch(e){return A(a,`onFinish`,{actionId:e?.actionId,code:e?.code,message:`Your details were saved, but the final step did not complete. ${e?.message??``}`.trim()},()=>k(`finish`,async()=>{await o()&&await i?.()})),!1}};return o()},[e,t,O,w,A,k]),ae=e&&Tg(t),oe=(0,i.useCallback)(async(r,i)=>{if(!e)return!1;let a=Eg(t),o=n;if(a<0)return A(o,`onFinish`,{code:`not_configured`,message:`This wizard is set to save through a server action ("Final save: Server action only"), but no step names an action on Finish. Nothing was saved. Set the Finish action in Admin → Form Groups, or switch Final save back to Generic form save.`}),!1;let s=async()=>{let e;try{e=await O(`onFinish`,a,{values:r})}catch(e){return A(o,`onFinish`,{actionId:e?.actionId,code:e?.code,message:`Your details were not saved. ${e?.message??``}`.trim()},()=>k(`finish`,s)),!1}C.current&&p({blocked:null,actionError:null});let t=String(e?.recordId||w||``);return S({id:t,values:r??{}}),await i?.(t,e),!0};return s()},[e,t,n,O,w,A,k]),se=(0,i.useCallback)((r,i)=>{if(!e)return;let a=i>=0?i:n,o=L_(r,t[a]),s=tg(t[a])!==`form`;p(e=>({blocked:{stepIndex:a,messages:o,focus:s,token:(e.blocked?.token??0)+1},actionError:null}))},[e,n,t]),ce=(0,i.useCallback)((e,t)=>{S({id:e?String(e):``,values:t??{}})},[]),le=(0,i.useCallback)(()=>p({blocked:null,actionError:null}),[]),j=(0,i.useCallback)(()=>{let e=f.actionError;if(e)return e.hook===`onNext`?ee():e.hook===`onEnter`?re(e.stepIndex):e.resume?.()},[f.actionError,ee,re]),ue=f.actionError?.stepIndex??f.blocked?.stepIndex??-1;return{enabled:e,busy:m,recordId:w,draftRecordId:_,results:y,actionResult:T?y[String(T.key)]??null:null,savedRecord:x,notice:f,errorStep:ue,next:ee,retry:j,afterSave:ie,saveViaAction:ae,saveThroughAction:oe,prepareSubmitValues:D,onSubmitFailed:se,markSaved:ce,clearNotice:le}}function z_({runtime:e,current:t}){let n=e?.notice?.blocked?.stepIndex===t?e.notice.blocked:null,r=e?.notice?.actionError?.stepIndex===t?e.notice.actionError:null,o=(0,i.useRef)(null),c=(0,i.useRef)(null);(0,i.useEffect)(()=>{n?.focus&&F_(o.current)},[n?.token,n?.focus]),(0,i.useEffect)(()=>{r&&F_(c.current)},[r?.token]);let l=e?.busy===`enter`;if(!n&&!r&&!l)return null;let u=n?.messages?.length===1&&n.messages[0]===I_;return(0,s.jsxs)(`div`,{className:`v1-wizard-notice`,children:[l&&(0,s.jsxs)(`div`,{className:`v1-wizard-notice__busy`,role:`status`,"aria-live":`polite`,children:[(0,s.jsx)(a.Spin,{size:`small`}),` `,(0,s.jsx)(`span`,{children:`Preparing this step…`})]}),n&&(0,s.jsx)(`div`,{ref:o,tabIndex:-1,className:`v1-wizard-notice__focus${u?` v1-wizard-notice__focus--fields`:``}`,children:(0,s.jsx)(a.Alert,{type:`warning`,showIcon:!0,role:`alert`,message:n.messages.length===1?n.messages[0]:`This step needs attention before you continue.`,description:n.messages.length>1?(0,s.jsx)(`ul`,{className:`v1-wizard-notice__list`,children:n.messages.map(e=>(0,s.jsx)(`li`,{children:e},e))}):void 0})}),r&&(0,s.jsx)(`div`,{ref:c,tabIndex:-1,className:`v1-wizard-notice__focus`,children:(0,s.jsx)(a.Alert,{type:`error`,showIcon:!0,role:`alert`,message:r.message,description:r.code===`not_found`&&r.actionId?`Action id: ${r.actionId}`:void 0,action:e?.retry?(0,s.jsx)(a.Button,{size:`small`,onClick:()=>e.retry(),loading:!!e?.busy&&e.busy!==`enter`,disabled:!!e?.busy,children:`Try again`}):void 0})})]})}var B_=e=>e==null?``:String(e).trim();function V_(e,t){let n=e?.regionRules;if(!n||typeof n!=`object`)return e??{};let r=B_(t),i=n[r]??n[r.toUpperCase()]??n.default;return!i||typeof i!=`object`?e??{}:{...e,...i}}function H_(e){return e?.allowInProgress!==!1}function U_(e){return H_(e)?``:K_(e)?e?.inProgressWarningMessage||e?.inProgressMessage||`In this region an unfinished qualification is not usually accepted when a candidate is put forward for a role. You can still record it here — just be aware it will have to be completed before they can be submitted.`:e?.inProgressMessage||`This one needs to be finished before the application can go ahead. Please untick “still ongoing”, or remove the row.`}function W_(e){return H_(e)?`allow`:B_(e?.inProgressSeverity).toLowerCase()===`warn`?`warn`:`block`}function G_(e){return W_(e)===`block`}function K_(e){return W_(e)===`warn`}function q_(e){if(!G_(e))return null;let t=U_(e);return{validator:(e,n)=>n===!0?Promise.reject(Error(t)):Promise.resolve()}}function J_(e,t={}){let n=t.tieBreak??`endDate`,r=t.field??`startDate`;for(let t of[n,r]){let n=e?.[t];if(n==null||n===``)continue;let r=(0,c.default)(n);if(r.isValid())return r.valueOf()}return null}function Y_(e,t={}){let n=t.inProgressField??`currentStudyingHere`;return!!e?.[n]}function X_(e=[],t={}){let n=(t.direction??`desc`)===`desc`;return e.map((e,n)=>({index:n,key:J_(e,t),ongoing:t.inProgressFirst!==!1&&Y_(e,t)})).slice().sort((e,t)=>e.ongoing===t.ongoing?e.key===null&&t.key===null?e.index-t.index:e.key===null?1:t.key===null?-1:e.key===t.key?e.index-t.index:n?t.key-e.key:e.key-t.key:e.ongoing?-1:1).map(e=>e.index)}function Z_(e,t,n={}){if(!Array.isArray(e)||e.length<2||t==null||t<0||t>=e.length)return null;let r=X_(e,n).indexOf(t);return r===-1||r===t?null:{from:t,to:r,reason:Y_(e[t],n)?`inProgress`:`outOfOrder`}}var Q_=Object.freeze({inProgress:`You’ve marked this one as still ongoing, so it’s the most recent. Shall we move it to the top? This list reads best newest first.`,outOfOrder:`These dates make this the most recent one. Shall we move it to the top? This list reads best newest first.`,ok:`Yes, move it up`,keep:`No, leave it here`});function $_(e,t={}){let n={...Q_,...t.messages??{}};return n[e]??n.outOfOrder}function ev(e,t={}){let n=t.levelField??`qualification`,r=B_(e?.[n]);if(!r)return null;let i=t.levels??{},a=i[r]??i[r.toLowerCase()]??i[r.toUpperCase()];return Number.isFinite(Number(a))?Number(a):tv(r,t)}function tv(e,t){let n=Array.isArray(t?.levelPatterns)?t.levelPatterns:[],r=e.toLowerCase();for(let e of n){let t=B_(e?.match);if(!t)continue;let n;try{n=new RegExp(t,`i`)}catch{continue}if(n.test(r)&&Number.isFinite(Number(e.level)))return Number(e.level)}return null}function nv(e,t={}){return B_((t?.levelLabels??{})[e])||B_(e)}function rv(e=[],t={}){if(!t||t.requireBelow===!1)return[];let n=t.levels??{},r=t.requiredLevels??[];if(!r.length)return[];let i=e.map(e=>ev(e,t)).filter(e=>e!==null);if(!i.length)return[];let a=Math.max(...i),o=[];return r.forEach(e=>{let t=typeof e==`object`?e.label:e,r=typeof e==`object`&&Number.isFinite(Number(e.level))?Number(e.level):Number(n[t]);Number.isFinite(r)&&(r>=a||i.includes(r)||o.push(t))}),o}function iv(e,t={}){let n=rv(e,t);if(!n.length)return``;let r=n.map(e=>nv(e,t)).join(`, `);return(t.message||`You’ve added a higher qualification but not the {missing} below it. Please add that too.`).replace(`{missing}`,r)}async function av({group:e,rows:t,rowIndex:n,move:r,confirm:i}){let a=e?.orderBy;if(!a||a.confirmMove===!1||typeof r!=`function`)return!1;let o=Z_(t,n,a);if(!o)return!1;let s={...Q_,...a.messages??{}};return await i({reason:o.reason,title:o.reason===`inProgress`?`This looks like the most recent one`:`These dates make this the most recent one`,body:$_(o.reason,a),okText:s.ok,cancelText:s.keep,from:o.from,to:o.to})?(r(o.from,o.to),!0):!1}function ov(e,t){let n=V_(e,t),r=n?.orderBy?.inProgressField;return r?{name:n.name,label:n.label??n.name,rowsKey:n.payloadKey||n.name,inProgressField:r,severity:W_(n),message:U_(n)}:null}function sv(e=[],t,n){if(!n)return{severity:`allow`,message:``,group:null};let r=null;for(let i of e){let e=ov(i,t);if(!(!e||e.severity===`allow`)&&cv(n,e.rowsKey).some(t=>Y_(t,e))){if(e.severity===`block`)return{severity:`block`,message:e.message,group:e};r??={severity:`warn`,message:e.message,group:e}}}return r??{severity:`allow`,message:``,group:null}}function cv(e,t){let n=e?.[t];return Array.isArray(n)?n:Array.isArray(n?.rows)?n.rows:[]}function lv(e){return String(e?.severity??``).toLowerCase()===`block`?`block`:`warn`}function uv(e=[],t={}){let n=null;for(let r of e){let e=r?.levelRule;if(!e)continue;let i=dv(t,r);if(!i.length)continue;let a=iv(i,e);if(a){if(lv(e)===`block`)return{severity:`block`,message:a,group:r};n??={severity:`warn`,message:a,group:r}}}return n??{severity:`allow`,message:``,group:null}}function dv(e,t){for(let n of[t?.name,t?.payloadKey]){if(!n)continue;let t=e?.[n];if(Array.isArray(t))return t}return[]}function fv(e,t){return Array.isArray(e)&&e.length>1?[...e.slice(0,-1),t]:[t]}function pv(e,t){let n=e?.field,r=[];e?.clearGroupOnChange&&(t instanceof Set?[...t]:t??[]).forEach(e=>{e&&e!==n&&r.push(e)});let i=e?.linkedClearField;return Array.isArray(i)?i.forEach(e=>{e&&e!==n&&r.push(e)}):typeof i==`string`&&i.trim()&&i.trim()!==n&&r.push(i.trim()),[...new Set(r)]}function mv(e,t,n,r){let i=pv(t,r).map(e=>fv(n,e));return i.forEach(t=>e.setFieldValue(t,null)),i}function hv(e){return(Array.isArray(e)?e:[e]).map(e=>e&&typeof e==`object`?e.value??e.key??e.id:e).filter(e=>e!=null&&e!==``)}function gv(e,t=[]){let n=new Set((t??[]).map(e=>String(e?.value))),r=[];for(let t of hv(e)){let e=String(t);!n.has(e)&&!r.includes(e)&&r.push(e)}return r}async function _v(e,n){if(!e?.lookupCollection||!n?.length)return[];let r=new URLSearchParams({collection:e.lookupCollection,displayField:e.displayField??``,valueField:e.valueField??`_id`,values:n.join(`,`)});e.displayField2&&r.set(`displayField2`,e.displayField2);let i=await t.o(t.S,`/admin/lookup-dropdown-values?${r}`),a=i?.data??i??[];return Array.isArray(a)?a:[]}function vv(e=[],t=[]){if(!t.length)return e;let n=new Set((e??[]).map(e=>String(e?.value))),r=t.filter(e=>!n.has(String(e?.value))).map(e=>({...e,resolvedOnly:!0}));return r.length?[...e,...r]:e}var yv=e=>e==null||e===``;function bv(e){if(!e)return null;if(typeof e.valueOf==`function`){let t=e.valueOf();return Number.isNaN(t)?null:t}let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function xv(e){if(!e)return null;let t=(0,c.default)(e);return t.isValid()?t.startOf(`day`).valueOf():null}function Sv(e){if(!e)return null;let t=(0,c.default)(e);return t.isValid()?t.hour()*60+t.minute():null}var Cv={d:`day`,day:`day`,days:`day`,w:`week`,week:`week`,weeks:`week`,m:`month`,mo:`month`,month:`month`,months:`month`,y:`year`,yr:`year`,year:`year`,years:`year`};function wv(e){if(e==null||e===``)return null;if(typeof e==`object`&&!Array.isArray(e)){let t=Number(e.value??e.count??e.amount);return!Number.isFinite(t)||t<=0?null:{value:t,unit:Cv[String(e.unit??`month`).toLowerCase()]??`month`}}let t=String(e).trim().toLowerCase();if(!t)return null;let n=t.match(/^(\d+(?:\.\d+)?)\s*([a-z]*)$/);if(!n)return null;let r=Number(n[1]);return!Number.isFinite(r)||r<=0?null:{value:r,unit:Cv[n[2]]??`month`}}function Tv(e,t){let n=e?.minGapFrom??e?.gapFrom;if(n&&typeof t==`function`){let e=wv(t(n));if(e)return e}return wv(e?.minGap)}function Ev(e,t,n,r){if(t===null)return null;let i=Tv(n,r),a=(0,c.default)(t);return i&&(a=e===`dateAfterField`?a.add(i.value,i.unit):a.subtract(i.value,i.unit)),a.startOf(`day`).valueOf()}function Dv(e,t,n,r,i){if(t===null||n===null)return!1;let a=Ev(e,n,r,i);if(a===null)return!1;let o=!!r?.strict&&!Tv(r,i);return e===`dateAfterField`?o?t<=a:t<a:o?t>=a:t>a}function Ov(e,t,n,r){if(n?.message)return n.message;let i=n?.value??n?.compareField??n?.field??`the paired date`,a=Tv(n,r);if(a){let n=a.value===1?a.unit:`${a.unit}s`;return e===`dateAfterField`?`${t} must be at least ${a.value} ${n} after ${i}`:`${t} must be at least ${a.value} ${n} before ${i}`}return n?.strict?e===`dateAfterField`?`${t} must be after ${i}`:`${t} must be before ${i}`:e===`dateAfterField`?`${t} must be on or after ${i}`:`${t} must be on or before ${i}`}function kv({type:e,label:t,rule:n,readSibling:r}){return{validator:async(i,a)=>{let o=n?.value??n?.compareField??n?.field;if(!o||yv(a))return Promise.resolve();let s=r(o);if(yv(s))return Promise.resolve();let c=xv(a),l=xv(s);return c===null||l===null?Promise.resolve():Dv(e,c,l,n,r)?Promise.reject(Error(Ov(e,t,n,r))):Promise.resolve()}}}function Av(e,t,{rows:n,rowIndex:r}={}){if(e===null||!t||!Array.isArray(n)||r==null||(t.mode??`newestFirst`)!==`newestFirst`)return!1;let i=t.startField??`startDate`,a=t.endField??`endDate`,o=n[r-1];if(o){let t=xv(o[i]);if(t!==null&&e>=t)return!0}let s=n[r+1];if(s){let t=xv(s[a])??xv(s[i]);if(t!==null&&e<=t)return!0}return!1}function jv(e,t=`above`){let n=e?.messages??{};return t===`below`?n.below||`This starts before the entry below it finished. Entries are listed newest first, so they cannot overlap.`:n.above||`This overlaps the entry above it. Entries are listed newest first, so this one must finish before that one started.`}function Mv({field:e,readSibling:t,rows:n,rowIndex:r,now:i=_n}){let a=e?.validations??e?.validation??e?.rules??[],o=[];for(let e of a){let n=typeof e==`string`?{type:e}:e,r=n?.type;if(r===`noPastDate`&&o.push(e=>e?xv(e)<i().startOf(`day`).valueOf():!1),r===`noFutureDate`&&o.push(e=>e?xv(e)>i().startOf(`day`).valueOf():!1),r===`minAge`){let e=Number(n?.value??18);o.push(t=>t?xv(t)>i().subtract(e,`year`).startOf(`day`).valueOf():!1)}if(r===`dateAfterField`||r===`dateBeforeField`){let e=n?.value??n?.compareField??n?.field;if(!e)continue;o.push(i=>{if(!i)return!1;let a=t(e);return!yv(a)&&Dv(r,xv(i),xv(a),n,t)})}}return e?.rowHierarchy&&Array.isArray(n)&&r!=null&&o.push(t=>t?Av(xv(t),e.rowHierarchy,{rows:n,rowIndex:r}):!1),o.length?e=>o.some(t=>t(e)):void 0}function Nv(e,t=_n){let n=e?.validations??e?.validation??e?.rules??[];for(let e of n){let n=typeof e==`string`?{type:e}:e;if(n?.type===`minAge`)return t().subtract(Number(n?.value??18),`year`);if(n?.type===`noFutureDate`||n?.type===`noPastDate`)return t()}}function Pv({field:e,rows:t,rowIndex:n}){let r=e?.rowHierarchy;return{validator:async(e,i)=>{if(!r||yv(i)||!Array.isArray(t)||n==null)return Promise.resolve();let a=xv(i);if(a===null||!Av(a,r,{rows:t,rowIndex:n}))return Promise.resolve();let o=r.startField??`startDate`,s=t[n-1],c=s?xv(s[o]):null,l=c!==null&&a>=c?`above`:`below`;return Promise.reject(Error(jv(r,l)))}}}function Fv(e){return(e??[]).filter(e=>e?.submitMessages&&typeof e.submitMessages==`object`).sort((e,t)=>(e.order??0)-(t.order??0))[0]?.submitMessages??null}function Iv(e){let t=String(e??``).trim();return t?t.charAt(0).toUpperCase()+t.slice(1):`Record`}function Lv(e,t){return String(e).replaceAll("${module}",Iv(t)).replaceAll("${moduleName}",Iv(t))}function Rv(e,t,n){let r=Fv(e);if(r?.suppress)return null;let i=n===`edit`?r?.editSuccess:r?.addSuccess;return i&&String(i).trim()?Lv(i,t):n===`edit`?`${Iv(t)} has Updated successfully`:`${Iv(t)} has added successfully`}function zv(e,t,n,r){let i=Fv(e),a=n===`edit`?i?.editError:i?.addError;return a&&String(a).trim()?Lv(a,t):r&&String(r).trim()?String(r):n===`edit`?`Failed to update ${Iv(t)}`:`Failed to create ${Iv(t)}`}function Bv({errorFields:e}={},t,{root:n=document}={}){if(!e?.length)return;let r=e[0]?.name;setTimeout(()=>{if(t?.scrollToField&&r!==void 0)try{t.scrollToField(r,{behavior:`smooth`,block:`center`})}catch{}let e=(n??document).querySelector(`.ant-form-item-has-error`);if(!e)return;let i=e.querySelector(`input, textarea, select, .ProseMirror`),a=i??e;a.scrollIntoView({behavior:`smooth`,block:`center`}),setTimeout(()=>{i?.focus?.({preventScroll:!0}),a.style.boxShadow=`0 0 0 3px rgba(255, 77, 79, 0.3)`,setTimeout(()=>{a.style.boxShadow=``},1200)},350)},60)}function Vv(e){return Array.isArray(e)?e.map(e=>String(e??``).trim()):String(e??``).split(`,`).map(e=>e.trim())}function Hv(e,t){if(!e?.field)return!1;switch(e.operator??`eq`){case`eq`:return String(t??``)===String(e.value??``);case`neq`:return String(t??``)!==String(e.value??``);case`truthy`:return t!=null&&t!==``&&t!==!1;case`falsy`:return t==null||t===``||t===!1;case`notEmpty`:return Array.isArray(t)?t.length>0:!!t;case`in`:return Vv(e.value).includes(String(t??``));case`notIn`:return!Vv(e.value).includes(String(t??``));default:return!1}}function Uv(e,t,n=!1){let r=n?e?.combineLabel??e?.label:e?.label,i=e?.labelWhen;return Hv(i,t)&&i?.label?i.label:r}function Wv(e){return e?[...e.field?[e]:[],...(e.conditions??[]).filter(e=>e?.field)]:[]}function Gv(e,t){let n=Wv(e);if(!n.length)return!0;let r=n.map(e=>Hv(e,t(e.field)));return e.logic===`or`?r.some(Boolean):r.every(Boolean)}function Kv(e){let t=e?.colWhen;return t?(Array.isArray(t)?t:[t]).filter(e=>e?.field&&Number(e?.col)>0):[]}function qv(e,t,n){for(let t of Kv(e))if(Hv(t,n(t)))return Number(t.col);return t}function Jv(e,t){return e?.field?t==null?[e.field]:[...Array.isArray(t)?t:[t],e.field]:[`__noop_conditional_label__`]}Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return hg}}),Object.defineProperty(exports,"$a",{enumerable:!0,get:function(){return yt}}),Object.defineProperty(exports,"$i",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"$n",{enumerable:!0,get:function(){return Yo}}),Object.defineProperty(exports,"$r",{enumerable:!0,get:function(){return Cr}}),Object.defineProperty(exports,"$t",{enumerable:!0,get:function(){return hl}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return z_}}),Object.defineProperty(exports,"Aa",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"Ai",{enumerable:!0,get:function(){return jt}}),Object.defineProperty(exports,"An",{enumerable:!0,get:function(){return ec}}),Object.defineProperty(exports,"Ar",{enumerable:!0,get:function(){return sa}}),Object.defineProperty(exports,"At",{enumerable:!0,get:function(){return Vu}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return f_}}),Object.defineProperty(exports,"Ba",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,"Bi",{enumerable:!0,get:function(){return kt}}),Object.defineProperty(exports,"Bn",{enumerable:!0,get:function(){return zs}}),Object.defineProperty(exports,"Br",{enumerable:!0,get:function(){return zi}}),Object.defineProperty(exports,"Bt",{enumerable:!0,get:function(){return Ql}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return H_}}),Object.defineProperty(exports,"Ca",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"Ci",{enumerable:!0,get:function(){return pn}}),Object.defineProperty(exports,"Cn",{enumerable:!0,get:function(){return fc}}),Object.defineProperty(exports,"Cr",{enumerable:!0,get:function(){return xa}}),Object.defineProperty(exports,"Ct",{enumerable:!0,get:function(){return hf}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return uv}}),Object.defineProperty(exports,"Da",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,"Di",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,"Dn",{enumerable:!0,get:function(){return tc}}),Object.defineProperty(exports,"Dr",{enumerable:!0,get:function(){return da}}),Object.defineProperty(exports,"Dt",{enumerable:!0,get:function(){return Dd}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return sv}}),Object.defineProperty(exports,"Ea",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(exports,"Ei",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"En",{enumerable:!0,get:function(){return oc}}),Object.defineProperty(exports,"Er",{enumerable:!0,get:function(){return ga}}),Object.defineProperty(exports,"Et",{enumerable:!0,get:function(){return $d}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return k_}}),Object.defineProperty(exports,"Fa",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,"Fi",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"Fn",{enumerable:!0,get:function(){return Gs}}),Object.defineProperty(exports,"Fr",{enumerable:!0,get:function(){return bi}}),Object.defineProperty(exports,"Ft",{enumerable:!0,get:function(){return Bu}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return x_}}),Object.defineProperty(exports,"Ga",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"Gi",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"Gn",{enumerable:!0,get:function(){return fs}}),Object.defineProperty(exports,"Gr",{enumerable:!0,get:function(){return Mr}}),Object.defineProperty(exports,"Gt",{enumerable:!0,get:function(){return ml}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return c_}}),Object.defineProperty(exports,"Ha",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(exports,"Hi",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"Hn",{enumerable:!0,get:function(){return Is}}),Object.defineProperty(exports,"Hr",{enumerable:!0,get:function(){return ai}}),Object.defineProperty(exports,"Ht",{enumerable:!0,get:function(){return Kl}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return N_}}),Object.defineProperty(exports,"Ia",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,"Ii",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"In",{enumerable:!0,get:function(){return Us}}),Object.defineProperty(exports,"Ir",{enumerable:!0,get:function(){return Yi}}),Object.defineProperty(exports,"It",{enumerable:!0,get:function(){return xu}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return zg}}),Object.defineProperty(exports,"Ja",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"Ji",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(exports,"Jn",{enumerable:!0,get:function(){return ns}}),Object.defineProperty(exports,"Jr",{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(exports,"Jt",{enumerable:!0,get:function(){return Rl}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return S_}}),Object.defineProperty(exports,"Ka",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(exports,"Ki",{enumerable:!0,get:function(){return gt}}),Object.defineProperty(exports,"Kn",{enumerable:!0,get:function(){return ls}}),Object.defineProperty(exports,"Kr",{enumerable:!0,get:function(){return Nr}}),Object.defineProperty(exports,"Kt",{enumerable:!0,get:function(){return pl}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"La",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"Li",{enumerable:!0,get:function(){return Ut}}),Object.defineProperty(exports,"Ln",{enumerable:!0,get:function(){return Hs}}),Object.defineProperty(exports,"Lr",{enumerable:!0,get:function(){return Ki}}),Object.defineProperty(exports,"Lt",{enumerable:!0,get:function(){return lu}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return R_}}),Object.defineProperty(exports,"Ma",{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,"Mi",{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(exports,"Mn",{enumerable:!0,get:function(){return Qs}}),Object.defineProperty(exports,"Mr",{enumerable:!0,get:function(){return la}}),Object.defineProperty(exports,"Mt",{enumerable:!0,get:function(){return Ru}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return E_}}),Object.defineProperty(exports,"Na",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"Ni",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(exports,"Nn",{enumerable:!0,get:function(){return Xs}}),Object.defineProperty(exports,"Nr",{enumerable:!0,get:function(){return ta}}),Object.defineProperty(exports,"Nt",{enumerable:!0,get:function(){return zu}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return av}}),Object.defineProperty(exports,"Oa",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,"Oi",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"On",{enumerable:!0,get:function(){return Ys}}),Object.defineProperty(exports,"Or",{enumerable:!0,get:function(){return fa}}),Object.defineProperty(exports,"Ot",{enumerable:!0,get:function(){return Ed}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return D_}}),Object.defineProperty(exports,"Pa",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"Pi",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"Pn",{enumerable:!0,get:function(){return $s}}),Object.defineProperty(exports,"Pr",{enumerable:!0,get:function(){return ki}}),Object.defineProperty(exports,"Pt",{enumerable:!0,get:function(){return Pu}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return vg}}),Object.defineProperty(exports,"Qa",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(exports,"Qi",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(exports,"Qn",{enumerable:!0,get:function(){return Zo}}),Object.defineProperty(exports,"Qr",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(exports,"Qt",{enumerable:!0,get:function(){return kl}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return p_}}),Object.defineProperty(exports,"Ra",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"Ri",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"Rn",{enumerable:!0,get:function(){return Vs}}),Object.defineProperty(exports,"Rr",{enumerable:!0,get:function(){return ca}}),Object.defineProperty(exports,"Rt",{enumerable:!0,get:function(){return du}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return ov}}),Object.defineProperty(exports,"Sa",{enumerable:!0,get:function(){return We}}),Object.defineProperty(exports,"Si",{enumerable:!0,get:function(){return an}}),Object.defineProperty(exports,"Sn",{enumerable:!0,get:function(){return lc}}),Object.defineProperty(exports,"Sr",{enumerable:!0,get:function(){return Va}}),Object.defineProperty(exports,"St",{enumerable:!0,get:function(){return vf}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return U_}}),Object.defineProperty(exports,"Ta",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"Ti",{enumerable:!0,get:function(){return un}}),Object.defineProperty(exports,"Tn",{enumerable:!0,get:function(){return ic}}),Object.defineProperty(exports,"Tr",{enumerable:!0,get:function(){return ha}}),Object.defineProperty(exports,"Tt",{enumerable:!0,get:function(){return ef}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return v_}}),Object.defineProperty(exports,"Ua",{enumerable:!0,get:function(){return en}}),Object.defineProperty(exports,"Ui",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"Un",{enumerable:!0,get:function(){return bs}}),Object.defineProperty(exports,"Ur",{enumerable:!0,get:function(){return si}}),Object.defineProperty(exports,"Ut",{enumerable:!0,get:function(){return ql}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return h_}}),Object.defineProperty(exports,"Va",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"Vi",{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(exports,"Vn",{enumerable:!0,get:function(){return Rs}}),Object.defineProperty(exports,"Vr",{enumerable:!0,get:function(){return ti}}),Object.defineProperty(exports,"Vt",{enumerable:!0,get:function(){return Gl}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return T_}}),Object.defineProperty(exports,"Wa",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"Wi",{enumerable:!0,get:function(){return qt}}),Object.defineProperty(exports,"Wn",{enumerable:!0,get:function(){return gs}}),Object.defineProperty(exports,"Wr",{enumerable:!0,get:function(){return Zr}}),Object.defineProperty(exports,"Wt",{enumerable:!0,get:function(){return xl}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return gg}}),Object.defineProperty(exports,"Xa",{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(exports,"Xi",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,"Xn",{enumerable:!0,get:function(){return Qo}}),Object.defineProperty(exports,"Xr",{enumerable:!0,get:function(){return Sr}}),Object.defineProperty(exports,"Xt",{enumerable:!0,get:function(){return zl}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return Mg}}),Object.defineProperty(exports,"Ya",{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(exports,"Yi",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"Yn",{enumerable:!0,get:function(){return is}}),Object.defineProperty(exports,"Yr",{enumerable:!0,get:function(){return Or}}),Object.defineProperty(exports,"Yt",{enumerable:!0,get:function(){return fl}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return _g}}),Object.defineProperty(exports,"Za",{enumerable:!0,get:function(){return Ot}}),Object.defineProperty(exports,"Zi",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,"Zn",{enumerable:!0,get:function(){return qo}}),Object.defineProperty(exports,"Zr",{enumerable:!0,get:function(){return xr}}),Object.defineProperty(exports,"Zt",{enumerable:!0,get:function(){return Bl}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return _v}}),Object.defineProperty(exports,"_a",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(exports,"_i",{enumerable:!0,get:function(){return En}}),Object.defineProperty(exports,"_n",{enumerable:!0,get:function(){return Mc}}),Object.defineProperty(exports,"_r",{enumerable:!0,get:function(){return Ga}}),Object.defineProperty(exports,"_t",{enumerable:!0,get:function(){return xp}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Gv}}),Object.defineProperty(exports,"aa",{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,"ai",{enumerable:!0,get:function(){return mr}}),Object.defineProperty(exports,"an",{enumerable:!0,get:function(){return Yc}}),Object.defineProperty(exports,"ao",{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,"ar",{enumerable:!0,get:function(){return Ko}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return Fp}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return mv}}),Object.defineProperty(exports,"ba",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"bi",{enumerable:!0,get:function(){return fn}}),Object.defineProperty(exports,"bn",{enumerable:!0,get:function(){return Cc}}),Object.defineProperty(exports,"br",{enumerable:!0,get:function(){return Oa}}),Object.defineProperty(exports,"bt",{enumerable:!0,get:function(){return Vf}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Bv}}),Object.defineProperty(exports,"ca",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"ci",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"cn",{enumerable:!0,get:function(){return $c}}),Object.defineProperty(exports,"co",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"cr",{enumerable:!0,get:function(){return So}}),Object.defineProperty(exports,"ct",{enumerable:!0,get:function(){return Up}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Mv}}),Object.defineProperty(exports,"da",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"di",{enumerable:!0,get:function(){return _n}}),Object.defineProperty(exports,"dn",{enumerable:!0,get:function(){return Bc}}),Object.defineProperty(exports,"dr",{enumerable:!0,get:function(){return _o}}),Object.defineProperty(exports,"dt",{enumerable:!0,get:function(){return wp}}),Object.defineProperty(exports,"ea",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"ei",{enumerable:!0,get:function(){return wr}}),Object.defineProperty(exports,"en",{enumerable:!0,get:function(){return al}}),Object.defineProperty(exports,"eo",{enumerable:!0,get:function(){return it}}),Object.defineProperty(exports,"er",{enumerable:!0,get:function(){return Xo}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return zh}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return kv}}),Object.defineProperty(exports,"fa",{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,"fi",{enumerable:!0,get:function(){return yn}}),Object.defineProperty(exports,"fn",{enumerable:!0,get:function(){return Vc}}),Object.defineProperty(exports,"fr",{enumerable:!0,get:function(){return ho}}),Object.defineProperty(exports,"ft",{enumerable:!0,get:function(){return vp}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return Sv}}),Object.defineProperty(exports,"ga",{enumerable:!0,get:function(){return At}}),Object.defineProperty(exports,"gi",{enumerable:!0,get:function(){return vn}}),Object.defineProperty(exports,"gn",{enumerable:!0,get:function(){return Ic}}),Object.defineProperty(exports,"gr",{enumerable:!0,get:function(){return Wa}}),Object.defineProperty(exports,"gt",{enumerable:!0,get:function(){return Ep}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return bv}}),Object.defineProperty(exports,"ha",{enumerable:!0,get:function(){return xt}}),Object.defineProperty(exports,"hi",{enumerable:!0,get:function(){return kn}}),Object.defineProperty(exports,"hn",{enumerable:!0,get:function(){return Nc}}),Object.defineProperty(exports,"hr",{enumerable:!0,get:function(){return Za}}),Object.defineProperty(exports,"ht",{enumerable:!0,get:function(){return Sp}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Uv}}),Object.defineProperty(exports,"ia",{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(exports,"ii",{enumerable:!0,get:function(){return pr}}),Object.defineProperty(exports,"in",{enumerable:!0,get:function(){return Xc}}),Object.defineProperty(exports,"io",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"ir",{enumerable:!0,get:function(){return Lo}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return zp}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return F_}}),Object.defineProperty(exports,"ja",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"ji",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(exports,"jn",{enumerable:!0,get:function(){return Zs}}),Object.defineProperty(exports,"jr",{enumerable:!0,get:function(){return na}}),Object.defineProperty(exports,"jt",{enumerable:!0,get:function(){return Fu}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return V_}}),Object.defineProperty(exports,"ka",{enumerable:!0,get:function(){return It}}),Object.defineProperty(exports,"ki",{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(exports,"kn",{enumerable:!0,get:function(){return Js}}),Object.defineProperty(exports,"kr",{enumerable:!0,get:function(){return pa}}),Object.defineProperty(exports,"kt",{enumerable:!0,get:function(){return Mu}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return zv}}),Object.defineProperty(exports,"la",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(exports,"li",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"ln",{enumerable:!0,get:function(){return Qc}}),Object.defineProperty(exports,"lo",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"lr",{enumerable:!0,get:function(){return yo}}),Object.defineProperty(exports,"lt",{enumerable:!0,get:function(){return Rp}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return Nv}}),Object.defineProperty(exports,"ma",{enumerable:!0,get:function(){return bt}}),Object.defineProperty(exports,"mi",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"mn",{enumerable:!0,get:function(){return zc}}),Object.defineProperty(exports,"mr",{enumerable:!0,get:function(){return Qa}}),Object.defineProperty(exports,"mt",{enumerable:!0,get:function(){return Tp}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Jv}}),Object.defineProperty(exports,"na",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"ni",{enumerable:!0,get:function(){return vr}}),Object.defineProperty(exports,"nn",{enumerable:!0,get:function(){return sl}}),Object.defineProperty(exports,"no",{enumerable:!0,get:function(){return Kt}}),Object.defineProperty(exports,"nr",{enumerable:!0,get:function(){return Bo}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return Kh}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return qv}}),Object.defineProperty(exports,"oa",{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(exports,"oi",{enumerable:!0,get:function(){return rr}}),Object.defineProperty(exports,"on",{enumerable:!0,get:function(){return nl}}),Object.defineProperty(exports,"oo",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(exports,"or",{enumerable:!0,get:function(){return bo}}),Object.defineProperty(exports,"ot",{enumerable:!0,get:function(){return Pp}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Pv}}),Object.defineProperty(exports,"pa",{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,"pi",{enumerable:!0,get:function(){return Sn}}),Object.defineProperty(exports,"pn",{enumerable:!0,get:function(){return Lc}}),Object.defineProperty(exports,"pr",{enumerable:!0,get:function(){return go}}),Object.defineProperty(exports,"pt",{enumerable:!0,get:function(){return Cp}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return Ug}}),Object.defineProperty(exports,"qa",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"qi",{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,"qn",{enumerable:!0,get:function(){return us}}),Object.defineProperty(exports,"qr",{enumerable:!0,get:function(){return jr}}),Object.defineProperty(exports,"qt",{enumerable:!0,get:function(){return Il}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Hv}}),Object.defineProperty(exports,"ra",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"ri",{enumerable:!0,get:function(){return fr}}),Object.defineProperty(exports,"rn",{enumerable:!0,get:function(){return Jc}}),Object.defineProperty(exports,"ro",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,"rr",{enumerable:!0,get:function(){return Ao}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return Rh}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return Wv}}),Object.defineProperty(exports,"sa",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"si",{enumerable:!0,get:function(){return Qn}}),Object.defineProperty(exports,"sn",{enumerable:!0,get:function(){return Zc}}),Object.defineProperty(exports,"so",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"sr",{enumerable:!0,get:function(){return To}}),Object.defineProperty(exports,"st",{enumerable:!0,get:function(){return Vp}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Kv}}),Object.defineProperty(exports,"ta",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"ti",{enumerable:!0,get:function(){return yr}}),Object.defineProperty(exports,"tn",{enumerable:!0,get:function(){return ol}}),Object.defineProperty(exports,"to",{enumerable:!0,get:function(){return Lt}}),Object.defineProperty(exports,"tr",{enumerable:!0,get:function(){return Vo}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return qh}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return Rv}}),Object.defineProperty(exports,"ua",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"ui",{enumerable:!0,get:function(){return Nn}}),Object.defineProperty(exports,"un",{enumerable:!0,get:function(){return Wc}}),Object.defineProperty(exports,"uo",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"ur",{enumerable:!0,get:function(){return vo}}),Object.defineProperty(exports,"ut",{enumerable:!0,get:function(){return Wp}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return vv}}),Object.defineProperty(exports,"va",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(exports,"vi",{enumerable:!0,get:function(){return bn}}),Object.defineProperty(exports,"vn",{enumerable:!0,get:function(){return kc}}),Object.defineProperty(exports,"vr",{enumerable:!0,get:function(){return Da}}),Object.defineProperty(exports,"vt",{enumerable:!0,get:function(){return yp}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return G_}}),Object.defineProperty(exports,"wa",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(exports,"wi",{enumerable:!0,get:function(){return sn}}),Object.defineProperty(exports,"wn",{enumerable:!0,get:function(){return rc}}),Object.defineProperty(exports,"wr",{enumerable:!0,get:function(){return Ta}}),Object.defineProperty(exports,"wt",{enumerable:!0,get:function(){return mf}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return q_}}),Object.defineProperty(exports,"xa",{enumerable:!0,get:function(){return St}}),Object.defineProperty(exports,"xi",{enumerable:!0,get:function(){return dn}}),Object.defineProperty(exports,"xn",{enumerable:!0,get:function(){return Sc}}),Object.defineProperty(exports,"xr",{enumerable:!0,get:function(){return Ra}}),Object.defineProperty(exports,"xt",{enumerable:!0,get:function(){return Bf}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return gv}}),Object.defineProperty(exports,"ya",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"yi",{enumerable:!0,get:function(){return tn}}),Object.defineProperty(exports,"yn",{enumerable:!0,get:function(){return Oc}}),Object.defineProperty(exports,"yr",{enumerable:!0,get:function(){return Ea}}),Object.defineProperty(exports,"yt",{enumerable:!0,get:function(){return gp}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return m_}}),Object.defineProperty(exports,"za",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"zi",{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(exports,"zn",{enumerable:!0,get:function(){return Bs}}),Object.defineProperty(exports,"zr",{enumerable:!0,get:function(){return Bi}}),Object.defineProperty(exports,"zt",{enumerable:!0,get:function(){return uu}});
9
+ //# sourceMappingURL=conditionalFieldLabel-080sIUgv.cjs.map