PageSourceSearch

https://glow.fieldstone.io/6435.44d54d2197025701.js

js fieldstone.io collected 2026-10-02 02:01:14 UTC 10,762 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[6435],{56435(B,M,d){d.d(M,{P:()=>V});var p=d(86330),m=d(99019),r=d(22281),u=d(50817),c=d(10036),v=d(13822),_=d(72730),w=d(38244),e=d(22618);const F=(a,s)=>s.id,g=(a,s)=>s.key;function b(a,s){if(1&a){const t=e.RV6();e.j41(0,"ion-segment",1),e.bIt("ionChange",function(n){r.eBV(t);const o=e.XpG(2);return r.Njj(o.onFilterSegmentChanged(n))}),e.j41(1,"ion-segment-button",2),e.EFF(2,"Crew"),e.k0s(),e.j41(3,"ion-segment-button",3),e.EFF(4,"Role"),e.k0s()()}if(2&a){const t=e.XpG(2);e.Y8G("value",t.sFilterSegment())}}function E(a,s){1&a&&(e.j41(0,"ion-item")(1,"ion-label",4),e.nrm(2,"ion-spinner",5)(3,"br"),e.EFF(4,"Loading crews... "),e.k0s()())}function R(a,s){if(1&a){const t=e.RV6();e.j41(0,"ion-item")(1,"ion-checkbox",6),e.bIt("ionChange",function(n){r.eBV(t);const o=e.XpG(4);return r.Njj(o.onCrewSelected(n))}),e.j41(2,"h3"),e.EFF(3),e.k0s(),e.j41(4,"p"),e.EFF(5),e.k0s()()()}if(2&a){const t=s.$implicit,i=e.XpG(4);e.R7$(),e.Y8G("value",t.id)("checked",i.mapCrewEnabled().has(t.id)),e.R7$(2),e.JRh(t.sName),e.R7$(2),e.JRh(t.sRosterLine())}}function A(a,s){if(1&a&&e.Z7z(0,R,6,4,"ion-item",null,F),2&a){const t=e.XpG(3);e.Dyx(t.arrDivisionCrew())}}function D(a,s){if(1&a&&(e.j41(0,"h2"),e.EFF(1,"Filter by Crew"),e.k0s(),e.j41(2,"ion-list"),e.nV
1h(3,E,5,0,"ion-item")(4,A,2,0),e.k0s()),2&a){const t=e.XpG(2);e.R7$(3),e.vxM(t.fFilterLoading()?3:4)}}function I(a,s){1&a&&(e.nrm(0,"br"),e.EFF(1,"Loading crews... "))}function P(a,s){if(1&a&&(e.j41(0,"ion-item")(1,"ion-label",4),e.nrm(2,"ion-spinner",5),e.nVh(3,I,2,0),e.k0s()()),2&a){const t=e.XpG(3);e.R7$(3),e.vxM(t.fLoadingCrews()?3:-1)}}function y(a,s){if(1&a){const t=e.RV6();e.j41(0,"ion-item")(1,"ion-checkbox",6),e.bIt("ionChange",function(n){r.eBV(t);const o=e.XpG(4);return r.Njj(o.onRoleSelected(n))}),e.EFF(2),e.k0s()()}if(2&a){const t=s.$implicit,i=e.XpG(4);e.R7$(),e.Y8G("value",t.key)("checked",i.mapRoleEnabled().has(t.key)),e.R7$(),e.SpI(" ",t.value," ")}}function x(a,s){if(1&a&&(e.Z7z(0,y,3,3,"ion-item",null,g),e.nI1(2,"keyvalue")),2&a){const t=e.XpG(3);e.Dyx(e.bMT(2,0,t.mapFilteredStaffPersonRole()))}}function L(a,s){if(1&a&&(e.j41(0,"h2"),e.EFF(1,"Filter by Role"),e.k0s(),e.j41(2,"ion-list"),e.nVh(3,P,4,1,"ion-item")(4,x,3,2),e.k0s()),2&a){const t=e.XpG(2);e.R7$(3),e.vxM(t.fFilterLoading()?3:4)}}function k(a,s){if(1&a&&(e.nVh(0,b,5,1,"ion-segment",0),e.nVh(1,D,5,1)(2,L,5,1)),2&a){const t=e.XpG();e.vxM(t.fShowCrewSegment()?0:-1),e.R7$(),e.vxM("crew"===t.sFilterSegment()&&t.fShowCrewSegment()?1:2)}}function T(a,s){1&a&&(e.j41(0,"ion-item")(1,"ion-label",4),e.nrm(2,"ion-spinner",5)(3,"br"),e.EFF(4,"Loading staff... "),e.k0s()())}function N(a,s){1&a&&(e.j41(0,"ion-item")(1,"ion-label",7),e.EFF(2,"No active crew members to 
1schedule."),e.k0s()())}function G(a,s){if(1&a){const t=e.RV6();e.j41(0,"ion-item")(1,"ion-checkbox",6),e.bIt("ionChange",function(n){r.eBV(t);const o=e.XpG(2);return r.Njj(o.onSelectedChanged(n))}),e.EFF(2),e.k0s()()}if(2&a){const t=s.$implicit,i=e.XpG(2);e.R7$(),e.Y8G("value",t.key)("checked",i.mapSelected().has(t.key)),e.R7$(),e.SpI(" ",t.value.getPreferredName()," ")}}function j(a,s){if(1&a&&(e.Z7z(0,G,3,3,"ion-item",null,g),e.nI1(2,"keyvalue")),2&a){const t=e.XpG();e.Dyx(e.bMT(2,0,t.mapFilteredStaff()))}}let V=(()=>{class a extends w.q{constructor(){super(),this.divisionId=m.hFB.required(),this.arrSelectedStaffPersonId=(0,m.hFB)([]),this.fEnableMultiSelect=(0,m.hFB)(!1),this.fIncludeAllStaff=(0,m.hFB)(!1),this.fEnableCrewFilter=(0,m.hFB)(!1),this.mapSelectedChanged=(0,m.CGW)(),this.mapRoleEnabled=(0,r.vPA)(new Map),this.sFilterSegment=(0,r.vPA)("role"),this.arrDivisionCrew=(0,r.vPA)([]),this.mapCrewEnabled=(0,r.vPA)(new Map),this.fMultiSelect=(0,r.vPA)(!1),this.mapStaff=(0,r.vPA)(new Map),this.mapFilteredStaff=(0,r.vPA)(new Map),this.mapStaffPersonRole=(0,r.vPA)(new Map),this.mapFilteredStaffPersonRole=(0,r.vPA)(new Map),this.mapSelected=(0,r.vPA)(new Map),this.fLoadingStaff=(0,r.vPA)(!1),this.fLoadingCrews=(0,r.vPA)(!1),this.iLoadGeneration=0,(0,u.QZ)(()=>{const t=this.divisionId(),i=this.fIncludeAllStaff();t&&this.initWithDivisionId(t,i)}),(0,u.QZ)(()=>{const t=this.arrSelectedStaffPersonId();this.fLoadingStaff()||this.fLoadingCrews()||this.applyIncomingStaffSelection(t)})}fShowCrewSegment(){return this.fEnableCrewFilter()&&!this.fIncludeAllStaff()&&this.arrDivisionCrew().length>0}fFilterLoading(){return this.fLoadingStaff()||this.fLoadingCrews()}applyIncomingStaffSelection(t){const i=t??this.arrSelectedStaffPersonId();if(!i?.length)return void(this.mapSelected().size>0&&(this.mapSelected.set(new Map),this.mapSelectedChanged.emit(this.mapSelected())));if(0===this.mapStaff().size)return;const n=new Map;for(const o of i){const l=this.findStaffPerson(o);l&&n.set(l.id,l)}this.mapsDiffer(this.mapSelected(),n)&&(this.mapSelected.set(n),this.syncMultiFlag(),this.mapSelectedChanged.emit(this.mapSelected()))}findStaffPerson(t){return this.mapStaff().get(t)??this.mapStaff().get(String(t))}mapsDiffer(t,i){if(t.size!==i.size)return!0;for(const[n,o]of t)if(!i.has(n)||i.get(n)!==o)return!0;return!1}initWithDivisionId(t,i){var n=this;return(0,p.A)(function*(){const o=++n.iLoadGeneration;n.fLoadingStaff.set(!0),n.mapFilteredStaff.set(new Map);try{const l=new Map;if(yield _._Au.fillStaffMap(l,n.repoSvc,t,!1,n.fileAttachmentsSvc),o!==n.iLoadGeneration)return;n.mapStaff.set(l),n.mapStaffPersonRole.set(_.yUn.mapStaff());const f=new Map;for(const S of n.mapStaff().values()){const C=S.arrAllRoleKeys();for(const h of C)f.has(h)||f.set(h,n.mapStaffPersonRole().get(h))}if(n.mapFilteredStaffPersonRole.set(f),i){n.mapRoleEnabled.set(new Map),n.mapCrewEnabled.set(new Map);const S=new Map;for(const[C,h]of n.mapStaff())h.fDeactivated()||S.set(String(C),h);n.mapFilteredStaff.set(S)}else{if(yield n.loadCrewsAndApplyFilterDefaults(t,o),o!==n.iLoadGeneration)return;n.updateFilteredStaffMap(),n.applyIncomingStaffSelection()}}finally{o===n.iLoadGeneration&&n.fLoadingStaff.set(!1)}})()}loadCrewsAndApplyFilterDefaults(t,i){var n=this;return(0,p.A)(function*(){let o=[];if(n.fEnableCrewFilter()){n.fLoadingCrews.set(!0);try{const l=yield n.repoSvc.liveCrewRepo.getAllAsync("*",[{fld:"division_id",cmp:"=",val:t,log:"AND"},{fld:"f_active",cmp:"=",val:!0,log:"AND"}],[{sFieldName:"s_name",sOrder:_.mFb.ASC}]);if(i!==n.iLoadGeneration||(yield _.u2E.loadRelations(l,n.repoSvc),i!==n.iLoadGeneration))return;o=l.filter(f=>f.fActive),n.arrDivisionCrew.set(o)}finally{i===n.iLoadGeneration&&n.fLoadingCrews.set(!1)}}else n.arrDivisionCrew.set([]),n.mapCrewEnabled.set(new Map);n.fEnableCrewFilter()&&o.length>0?(n.sFilterSegment.set("crew"),n.mapCrewEnabled.set(new Map([[o[0].id,o[0]]])),n.mapRoleEnabled.set(new Map)):(n.sFilterSegment.set("role"),n.mapCrewEnabled.set(new Map),n.mapRoleEnabled.set(new Map),n.setRoleEnabled(_.yUn.HVAC_SERVICE_TECHNICIAN))})()}setRoleEnabled(t){this.mapRoleEnabled.update(i=>new Map(i).set(t,t.toString()))}setRoleDisabled(t){this.mapRoleEnabled.update(i=>{const n=new Map(i);return n.delete(t),n})}updateFilteredStaffMap(t=!1){const i=new Map;if(this.fShowCrewSegment()&&"crew"===this.sFilterSegment())for(const o of this.mapCrewEnabled().values())for(const l of o.arrActiveMemberPerson())i.set(l.id,l);else for(const o of this.mapRoleEnabled().keys())for(const l of this.mapStaff().values())l.fHasRole(o)&&i.set(l.id,l);const n=this.mapSelected();this.mapSelected.update(o=>{const l=new Map(o);for(const[f]of o)i.has(f)||l.delete(f);return l}),this.mapFilteredStaff.set(i),t&&this.mapsDiffer(n,this.mapSelected())&&(this.syncMultiFlag(),this.mapSelectedChanged.emit(this.mapSelected()))}selectActiveMembersForCrews(t){this.mapSelected.update(i=>{const n=new Map(i);for(const o of t)for(const l of o.arrActiveMemberPerson())n.set(l.id,l);return n}),this.syncMultiFlag(),this.mapSelectedChanged.emit(this.mapSelected())}onFilterSegmentChanged(t){var i=this;return(0,p.A)(function*(){const n=t.detail.value;if(n&&n!==i.sFilterSegment())if(i.sFilterSegment.set(n),"crew"===n){i.mapRoleEnabled.set(new Map);const o=i.arrDivisionCrew();i.mapCrewEnabled.set(o.length>0?new Map([[o[0].id,o[0]]]):new Map),i.updateFilteredStaffMap(),i.selectActiveMembersForCrews(Array.from(i.mapCrewEnabled().values())
1)}else i.mapCrewEnabled.set(new Map),i.mapRoleEnabled.set(new Map),i.setRoleEnabled(_.yUn.HVAC_SERVICE_TECHNICIAN),i.mapSelected.set(new Map),i.updateFilteredStaffMap(),i.syncMultiFlag(),i.mapSelectedChanged.emit(i.mapSelected())})()}onRoleSelected(t){var i=this;return(0,p.A)(function*(){t.detail.checked?i.setRoleEnabled(t.detail.value):i.setRoleDisabled(t.detail.value),i.updateFilteredStaffMap()})()}onCrewSelected(t){var i=this;return(0,p.A)(function*(){const n=t.detail.value,o=i.arrDivisionCrew().find(l=>l.id===n);o&&(t.detail.checked?(i.mapCrewEnabled.update(l=>new Map(l).set(n,o)),i.updateFilteredStaffMap(),i.selectActiveMembersForCrews([o])):(i.mapCrewEnabled.update(l=>{const f=new Map(l);return f.delete(n),f}),i.updateFilteredStaffMap(!0)))})()}onSelectedChanged(t){var i=this;return(0,p.A)(function*(){t.detail.checked?i.addSelected(t.detail.value):i.removeSelected(t.detail.value)})()}addSelected(t){const i=this.mapFilteredStaff().get(t)??this.findStaffPerson(t);i&&(this.mapSelected.update(n=>new Map(n).set(t,i)),this.syncMultiFlag(),this.mapSelectedChanged.emit(this.mapSelected()))}removeSelected(t){let i=!1;this.mapSelected.update(n=>{const o=new Map(n);return i=o.delete(t),o}),i&&(this.syncMultiFlag(),this.mapSelectedChanged.emit(this.mapSelected()))}syncMultiFlag(){const i=this.mapSelected().size>=2;this.fMultiSelect()!==i&&this.fMultiSelect.set(i)}static{this.\u0275fac=function(i){return new(i||a)}}static{this.\u0275cmp=e.VBU({type:a,selectors:[["app-staff-chooser"]],inputs:{divisionId:[1,"divisionId"],arrSelectedStaffPersonId:[1,"arrSelectedStaffPersonId"],fEnableMultiSelect:[1,"fEnableMultiSelect"],fIncludeAllStaff:[1,"fIncludeAllStaff"],fEnableCrewFilter:[1,"fEnableCrewFilter"]},outputs:{mapSelectedChanged:"mapSelectedChanged"},features:[e.Vt3],decls:7,vars:2,consts:[[3,"value"],[3,"ionChange","value"],["value","crew"],["value","role"],[1,"ion-text-center"],["name","crescent"],["justify","start","labelPlacement","end",3,"ionChange","value","checked"],[1,"ion-text-center","ion-text-medium"]],template:function(i,n){1&i&&(e.nVh(0,k,3,2),e.j41(1,"h2"),e.EFF(2,"Choose"),e.k0s(),e.j41(3,"ion-list"),e.nV
1h(4,T,5,0,"ion-item")(5,N,3,0,"ion-item")(6,j,3,2),e.k0s()),2&i&&(e.vxM(n.fIncludeAllStaff()?-1:0),e.R7$(4),e.vxM(n.fLoadingStaff()?4:n.fShowCrewSegment()&&"crew"===n.sFilterSegment()&&0===n.mapFilteredStaff().size&&!n.fFilterLoading()?5:6))},dependencies:[c.IonList,c.IonItem,c.IonCheckbox,c.IonLabel,c.IonSpinner,c.IonSegment,c.IonSegmentButton,v.lG],encapsulation:2})}}return a})()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.