@dyedurham/search-and-file-widget 2.0.23 → 2.0.25
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.
- package/dnd-filing-shell.js +127 -70
- package/package.json +1 -1
package/dnd-filing-shell.js
CHANGED
|
@@ -83640,7 +83640,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
|
|
|
83640
83640
|
return [
|
|
83641
83641
|
{
|
|
83642
83642
|
type: FormType.Text,
|
|
83643
|
-
dynamicLabel: (form) => getAddressPreview(form),
|
|
83643
|
+
dynamicLabel: (form) => getAddressPreview(form.getRawValue()),
|
|
83644
83644
|
formControlName: "",
|
|
83645
83645
|
required: false,
|
|
83646
83646
|
class: "span-12"
|
|
@@ -83695,7 +83695,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
|
|
|
83695
83695
|
},
|
|
83696
83696
|
{
|
|
83697
83697
|
type: FormType.Text,
|
|
83698
|
-
dynamicLabel: (form, t) => `${t("Residential Address")}: ${getAddressPreview(form)}`,
|
|
83698
|
+
dynamicLabel: (form, t) => `${t("Residential Address")}: ${getAddressPreview(form.getRawValue())}`,
|
|
83699
83699
|
formControlName: FederalFormationFormControl.DateOfBirth,
|
|
83700
83700
|
class: "span-12"
|
|
83701
83701
|
},
|
|
@@ -84338,7 +84338,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
|
|
|
84338
84338
|
[FederalFormationFormControl.ConsentToProvideTheAboveEmailAddresses]: new FormControl(delta?.consentToProvideDirectorEmailAddressesForFullAccessManager ?? false)
|
|
84339
84339
|
});
|
|
84340
84340
|
config2[FederalFormationFormGroups.Contact] = new FormGroup({
|
|
84341
|
-
[FederalFormationFormControl.Contact]: new FormControl("", Validators.required)
|
|
84341
|
+
[FederalFormationFormControl.Contact]: new FormControl(delta?.contactUid ?? "", Validators.required)
|
|
84342
84342
|
});
|
|
84343
84343
|
return config2;
|
|
84344
84344
|
}
|
|
@@ -87756,17 +87756,20 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
|
|
|
87756
87756
|
function federalFormationTaskToECore(task, deltaData) {
|
|
87757
87757
|
const corporateNameDelta = deltaData.corporateName;
|
|
87758
87758
|
const significantControl = deltaData.individualsWithSignificantControl;
|
|
87759
|
+
const minDirectors = task.entity._articles?.min_directors;
|
|
87760
|
+
const maxDirectors = task.entity._articles?.max_directors;
|
|
87761
|
+
const isFixedDirectors = !!minDirectors && minDirectors === maxDirectors;
|
|
87759
87762
|
const isNumbered = task._ext._numbered_company === true;
|
|
87760
87763
|
const englishName = !isNumbered ? {
|
|
87761
87764
|
CorporationName: task.entity._profile.name || "",
|
|
87762
87765
|
ReservationDate: corporateNameDelta?.primaryNameReservationDate || "",
|
|
87763
87766
|
ReservationNumber: corporateNameDelta?.primaryNameReservationNumber || ""
|
|
87764
|
-
} :
|
|
87767
|
+
} : { CorporationName: "", ReservationDate: "", ReservationNumber: "" };
|
|
87765
87768
|
const frenchName = !isNumbered && task.entity._profile.secondary_name ? {
|
|
87766
87769
|
CorporationName: task.entity._profile.secondary_name || "",
|
|
87767
87770
|
ReservationDate: corporateNameDelta?.secondaryNameReservationDate || "",
|
|
87768
87771
|
ReservationNumber: corporateNameDelta?.secondaryNameReservationNumber || ""
|
|
87769
|
-
} :
|
|
87772
|
+
} : { CorporationName: "", ReservationDate: "", ReservationNumber: "" };
|
|
87770
87773
|
const legalEnding = corporateNameDelta?.legalElement;
|
|
87771
87774
|
const useDifferentMailingAddress = deltaData.registeredOfficeAddress?.useDifferentAddressForCorrespondence;
|
|
87772
87775
|
const mailingAddressUid = deltaData.registeredOfficeAddress?.mailingAddressForCorrespondenceUid;
|
|
@@ -87777,71 +87780,83 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
|
|
|
87777
87780
|
const requestedDate = task._ext._future_filing_date ? new Date(task._ext._future_filing_date).toISOString().split("T")[0] : (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
87778
87781
|
const officialBusinessEmail = registeredOfficeAddress?.communications?.find((c) => c.type === "Business Email")?.value;
|
|
87779
87782
|
const contact = task.entity.affiliations.find((a) => a._id === deltaData.contactUid);
|
|
87783
|
+
const contactPerson = contact?.participant;
|
|
87784
|
+
const signatory = pickSignatory(incorporators, contactPerson);
|
|
87785
|
+
const officerPhone = formatPhone(pickPhone(contactPerson) || signatory.phone || incorporators.map((i) => i.phone).find(Boolean) || pickPhone(directors[0]?.participant) || registeredOfficeAddress?.communications?.find((c) => /phone|tel/i.test(c.type))?.value);
|
|
87780
87786
|
const epl = getEPRegistrations(task);
|
|
87781
87787
|
const eplDelta = deltaData.extraProvincialLicenses;
|
|
87782
87788
|
const directorsDelta = deltaData.directors;
|
|
87783
87789
|
const individualsWithSignificantControlDelta = deltaData.individualsWithSignificantControl;
|
|
87784
87790
|
const consentToProvideEmails = deltaData.consentToProvideDirectorEmailAddressesForFullAccessManager;
|
|
87785
|
-
const isListIsc = Number(significantControl
|
|
87791
|
+
const isListIsc = Number(significantControl?.type) === ISCOptions.ListISC;
|
|
87786
87792
|
const isNonPreapproved = corporateNameDelta?.nameType === NameType2.NonPreapproved;
|
|
87787
87793
|
const payload = __spreadProps(__spreadValues({
|
|
87788
87794
|
IncorporationType: corporateNameDelta?.nameType,
|
|
87789
87795
|
LegalEnding: isNumbered ? legalEnding : "",
|
|
87790
87796
|
EnglishName: englishName,
|
|
87791
87797
|
FrenchName: frenchName,
|
|
87792
|
-
PreappClientNumber: corporateNameDelta?.preapprovalConfirmationNumber,
|
|
87793
|
-
PreappRequestNumber: corporateNameDelta?.preapprovalRequestId,
|
|
87794
|
-
RegisteredOffice: registeredOfficeAddress ?
|
|
87795
|
-
MailingAddressSameAsOffice: !useDifferentMailingAddress
|
|
87796
|
-
}) : void 0,
|
|
87798
|
+
PreappClientNumber: corporateNameDelta?.preapprovalConfirmationNumber || void 0,
|
|
87799
|
+
PreappRequestNumber: corporateNameDelta?.preapprovalRequestId || void 0,
|
|
87800
|
+
RegisteredOffice: registeredOfficeAddress ? mapAddress(registeredOfficeAddress) : void 0,
|
|
87797
87801
|
MailingAddress: mailingAddress ? __spreadProps(__spreadValues({}, mapAddress(mailingAddress)), {
|
|
87798
|
-
MailingAddressSameAsOffice:
|
|
87802
|
+
MailingAddressSameAsOffice: 0
|
|
87799
87803
|
}) : registeredOfficeAddress ? __spreadProps(__spreadValues({}, mapAddress(registeredOfficeAddress)), {
|
|
87800
|
-
MailingAddressSameAsOffice:
|
|
87804
|
+
MailingAddressSameAsOffice: 1
|
|
87801
87805
|
}) : void 0,
|
|
87802
87806
|
Directors: directors.map((d) => transformDirector(d, directorsDelta[d.participant._id], consentToProvideEmails)),
|
|
87803
87807
|
Incorporators: incorporators.map((i) => transformIncorporator(i)),
|
|
87804
|
-
CoverLetter: createCoverLetter2(officialBusinessEmail,
|
|
87805
|
-
DirectorNumberType:
|
|
87806
|
-
},
|
|
87807
|
-
MinimumNumberOfDirectors:
|
|
87808
|
-
MaximumNumberOfDirectors:
|
|
87808
|
+
CoverLetter: createCoverLetter2(officialBusinessEmail, contactPerson, officerPhone),
|
|
87809
|
+
DirectorNumberType: isFixedDirectors ? ECoreDirectorNumberType.Fixed : ECoreDirectorNumberType.Range
|
|
87810
|
+
}, isFixedDirectors ? { FixedNumberOfDirectors: minDirectors } : {
|
|
87811
|
+
MinimumNumberOfDirectors: minDirectors || 1,
|
|
87812
|
+
MaximumNumberOfDirectors: maxDirectors || 10
|
|
87809
87813
|
}), {
|
|
87810
87814
|
SignificantControlType: significantControl?.type,
|
|
87811
87815
|
ExclusionReason: significantControl?.exclusionReason ?? 0,
|
|
87812
87816
|
RestrictionsOnBusiness: task.entity._articles?.restrictions || "None",
|
|
87813
|
-
RestrictionsOnShareClasses: task.entity._articles?.
|
|
87817
|
+
RestrictionsOnShareClasses: task.entity._articles?.share_terms || "",
|
|
87814
87818
|
RestrictionsOnShareTransfers: task.entity._articles?.transfer_restrictions_text || "None",
|
|
87815
87819
|
OtherProvisions: task.entity._articles?.other_provisions || "None",
|
|
87816
87820
|
EffectiveType: determineEffectiveType(requestedDate),
|
|
87817
87821
|
EffectiveDate: requestedDate,
|
|
87818
|
-
|
|
87819
|
-
|
|
87820
|
-
|
|
87822
|
+
// Spec: the signature name must match an Incorporator.
|
|
87823
|
+
SignatureFirstName: signatory.firstName,
|
|
87824
|
+
SignatureLastName: signatory.lastName,
|
|
87825
|
+
OfficerPhoneNumber: officerPhone,
|
|
87821
87826
|
HasEPL: epl.length > 0 ? 1 : 0,
|
|
87822
|
-
ExtraProvincialLicences: epl.length ? epl.map((reg) => transformEPL(reg, eplDelta[reg.uid])) : void 0,
|
|
87827
|
+
ExtraProvincialLicences: epl.length ? epl.map((reg) => transformEPL(reg, eplDelta[reg.uid], requestedDate, task.entity._profile.entity_language, contact?.participant)) : void 0,
|
|
87823
87828
|
IndividualsWithSignificantControl: isListIsc ? (() => {
|
|
87824
|
-
const deltaMap = new Map((individualsWithSignificantControlDelta
|
|
87829
|
+
const deltaMap = new Map((individualsWithSignificantControlDelta?.individuals ?? []).map((d) => [
|
|
87825
87830
|
d.affiliationId,
|
|
87826
87831
|
d
|
|
87827
87832
|
]));
|
|
87828
87833
|
return task.entity.affiliations.filter((aff) => deltaMap.has(aff._id)).map((aff) => transformIndividualWithSignificantControl(aff, deltaMap.get(aff._id)));
|
|
87829
87834
|
})() : void 0,
|
|
87835
|
+
// Shape and field names follow the spec's AdditionalInformation sample.
|
|
87830
87836
|
AdditionalInformation: isNonPreapproved ? [
|
|
87837
|
+
{
|
|
87838
|
+
FieldSection: "Proposed business name",
|
|
87839
|
+
Sections: [
|
|
87840
|
+
{
|
|
87841
|
+
FieldName: "Business Name",
|
|
87842
|
+
FieldValue: task.entity._profile.name || ""
|
|
87843
|
+
}
|
|
87844
|
+
]
|
|
87845
|
+
},
|
|
87831
87846
|
{
|
|
87832
87847
|
FieldSection: "Additional information on business activities",
|
|
87833
87848
|
Sections: [
|
|
87834
87849
|
{
|
|
87835
|
-
FieldName: "
|
|
87850
|
+
FieldName: "What does you business do? Provide a brief description.",
|
|
87836
87851
|
FieldValue: corporateNameDelta?.businessActivity ?? ""
|
|
87837
87852
|
},
|
|
87838
87853
|
{
|
|
87839
|
-
FieldName: "
|
|
87840
|
-
FieldValue: corporateNameDelta?.
|
|
87854
|
+
FieldName: "Who are your clients? Provide a brief description.",
|
|
87855
|
+
FieldValue: corporateNameDelta?.typeOfClientele ?? ""
|
|
87841
87856
|
},
|
|
87842
87857
|
{
|
|
87843
|
-
FieldName: "
|
|
87844
|
-
FieldValue: corporateNameDelta?.
|
|
87858
|
+
FieldName: "Where will your business operate? (City, town, province etc.) Be specific.",
|
|
87859
|
+
FieldValue: corporateNameDelta?.locationOfOperations ?? ""
|
|
87845
87860
|
},
|
|
87846
87861
|
{
|
|
87847
87862
|
FieldName: "If the proposed name contains a family name belonging to someone other than the incorporator, state the person's relationship to the corporation.",
|
|
@@ -87851,7 +87866,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
|
|
|
87851
87866
|
FieldName: "Similar names or trademarks you've registered or searches you conducted.",
|
|
87852
87867
|
FieldValue: corporateNameDelta?.similarNamesSearchedOrRegistered ?? ""
|
|
87853
87868
|
}
|
|
87854
|
-
]
|
|
87869
|
+
].filter((section) => section.FieldValue)
|
|
87855
87870
|
}
|
|
87856
87871
|
] : void 0
|
|
87857
87872
|
// NOTE: Spec does not include these; kept commented for reference.
|
|
@@ -87870,16 +87885,17 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
|
|
|
87870
87885
|
}
|
|
87871
87886
|
function transformDirector(affiliation, deltaData, consentToProvideEmails) {
|
|
87872
87887
|
const address = affiliation.addresses[0] || affiliation.parent_affiliation?.addresses?.[0];
|
|
87873
|
-
return {
|
|
87888
|
+
return __spreadValues({
|
|
87874
87889
|
FirstName: affiliation.participant._profile.firstName,
|
|
87875
87890
|
MiddleName: affiliation.participant._profile.middleName,
|
|
87876
87891
|
LastName: affiliation.participant._profile.lastName,
|
|
87877
87892
|
IsResident: deltaData.residentCanadian ? 1 : 2,
|
|
87878
87893
|
Address: address ? mapAddress(address) : void 0,
|
|
87879
|
-
RequiresFullAccessManagerInvitation: deltaData.inviteForFullAccessManager
|
|
87880
|
-
|
|
87894
|
+
RequiresFullAccessManagerInvitation: !!deltaData.inviteForFullAccessManager
|
|
87895
|
+
}, deltaData.inviteForFullAccessManager ? {
|
|
87896
|
+
FullAccessManagerInvitationEmail: pickEmail(affiliation.participant),
|
|
87881
87897
|
FullAccessManagerEmailConsent: consentToProvideEmails
|
|
87882
|
-
};
|
|
87898
|
+
} : {});
|
|
87883
87899
|
}
|
|
87884
87900
|
function transformIndividualWithSignificantControl(affiliation, deltaData) {
|
|
87885
87901
|
const address = affiliation.addresses[0] || affiliation.parent_affiliation?.addresses?.[0];
|
|
@@ -87894,7 +87910,9 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
|
|
|
87894
87910
|
LastName: affiliation.participant._profile.lastName,
|
|
87895
87911
|
DateOfBirth: affiliation.participant._profile.date_of_birth,
|
|
87896
87912
|
CountriesOfCitizenship: (affiliation.participant?._profile?.["citizenships"] ?? []).map((c) => normalizeCountryCode(c)),
|
|
87897
|
-
CountriesOfResidence:
|
|
87913
|
+
CountriesOfResidence: [
|
|
87914
|
+
normalizeCountryCode(affiliation.participant?._profile?.tax_residency?.country)
|
|
87915
|
+
],
|
|
87898
87916
|
Address: address ? mapAddress(address) : void 0,
|
|
87899
87917
|
ServiceAddress: serviceAddress ? mapAddress(serviceAddress) : void 0,
|
|
87900
87918
|
TypeOfInterest: deltaData.typeOfInterest,
|
|
@@ -87911,8 +87929,12 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
|
|
|
87911
87929
|
FirstName: isIndividual ? incorporator.firstName : void 0,
|
|
87912
87930
|
MiddleName: isIndividual ? incorporator.middleName : void 0,
|
|
87913
87931
|
LastName: isIndividual ? incorporator.lastName : void 0,
|
|
87914
|
-
|
|
87915
|
-
|
|
87932
|
+
// Spec: BodyCorporate and Signature apply only to body-corporate incorporators.
|
|
87933
|
+
BodyCorporate: !isIndividual ? incorporator.incorporator_name : void 0,
|
|
87934
|
+
Signature: !isIndividual && (incorporator.signatory_first_name || incorporator.signatory_last_name) ? [
|
|
87935
|
+
`${incorporator.signatory_first_name ?? ""} ${incorporator.signatory_last_name ?? ""}`.trim(),
|
|
87936
|
+
incorporator.signatory_title
|
|
87937
|
+
].filter(Boolean).join(", ") : void 0,
|
|
87916
87938
|
Address: mapAddress(incorporator)
|
|
87917
87939
|
};
|
|
87918
87940
|
}
|
|
@@ -87920,20 +87942,21 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
|
|
|
87920
87942
|
const country = normalizeCountryCode(address?.country ?? "");
|
|
87921
87943
|
const provinceState = country === "CA" ? CANCodeToProvince(address?.province_state) : country === "US" ? USCodeToState(address?.province_state) : address?.province_state ?? "";
|
|
87922
87944
|
const addressRegion = country === "CA" ? CANProvinceToCode(provinceState) : country === "US" ? USStateToCode(provinceState) : provinceState;
|
|
87945
|
+
const street = resolveStreet(address);
|
|
87923
87946
|
return {
|
|
87924
|
-
|
|
87925
|
-
|
|
87926
|
-
|
|
87927
|
-
|
|
87928
|
-
|
|
87929
|
-
DeliveryCode: "",
|
|
87947
|
+
// Spec: CareOf min length 4 and UnitNumber/AddressLine2 min length 3 when present, so omit blanks.
|
|
87948
|
+
CareOf: address?.components?.find((c) => c.name === "Attention")?.value || void 0,
|
|
87949
|
+
StreetNumber: street.number,
|
|
87950
|
+
StreetName: street.name,
|
|
87951
|
+
UnitNumber: address?.components?.find((c) => c.name === "Suite/Apartment")?.value || void 0,
|
|
87952
|
+
DeliveryCode: "None",
|
|
87930
87953
|
City: address?.city ?? "",
|
|
87931
87954
|
ProvinceState: addressRegion,
|
|
87932
87955
|
Code: address?.postal_zip ?? "",
|
|
87933
87956
|
Country: normalizeCountryCode(address?.country)
|
|
87934
87957
|
};
|
|
87935
87958
|
}
|
|
87936
|
-
function transformEPL(registration, deltaData) {
|
|
87959
|
+
function transformEPL(registration, deltaData, incorporationEffectiveDate, entityLanguage, filingContact) {
|
|
87937
87960
|
const registeredOffice = [...registration.affiliations ?? []].find((aff) => aff.role.role_name === "Shared Address" && aff.role.static_title === "Registered Office");
|
|
87938
87961
|
const registeredOfficeAddress = registeredOffice?.addresses?.[0] || registeredOffice?.parent_affiliation?.addresses?.[0];
|
|
87939
87962
|
let operatingAddress;
|
|
@@ -87963,55 +87986,89 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
|
|
|
87963
87986
|
}
|
|
87964
87987
|
}
|
|
87965
87988
|
return {
|
|
87966
|
-
Jurisdiction: registration._compliance.home_jurisdiction,
|
|
87989
|
+
Jurisdiction: CANProvinceToCode(registration._compliance.home_jurisdiction),
|
|
87967
87990
|
epFiling: {
|
|
87968
|
-
EffectiveDate:
|
|
87969
|
-
|
|
87991
|
+
EffectiveDate: incorporationEffectiveDate,
|
|
87992
|
+
// Spec: "English" or "French".
|
|
87993
|
+
Language: entityLanguage?.toLowerCase().startsWith("fr") ? "French" : "English",
|
|
87970
87994
|
RegOffice: {
|
|
87995
|
+
Jurisdiction: CANProvinceToCode(registration._compliance.home_jurisdiction),
|
|
87971
87996
|
Address: registeredOfficeAddress ? mapAddress(registeredOfficeAddress) : {}
|
|
87972
87997
|
},
|
|
87973
|
-
OperatingAddress: {
|
|
87974
|
-
Address: operatingAddress ? mapAddress(operatingAddress) : {}
|
|
87975
|
-
},
|
|
87998
|
+
OperatingAddress: operatingAddress ? { Address: mapAddress(operatingAddress) } : void 0,
|
|
87976
87999
|
DeliveryAddress: contactAffiliation ? {
|
|
87977
88000
|
FirstName: contactAffiliation.participant._profile.firstName,
|
|
87978
88001
|
LastName: contactAffiliation.participant._profile.lastName,
|
|
87979
|
-
PhoneNumber: contactAffiliation.participant
|
|
87980
|
-
Email: contactAffiliation.participant
|
|
87981
|
-
Office: serviceAddress ?
|
|
87982
|
-
MailingAddressSameAsOffice: registeredOfficeAddress?.uid === deltaData.serviceAddressUid
|
|
87983
|
-
}) : {},
|
|
87984
|
-
PickupNumber: ""
|
|
88002
|
+
PhoneNumber: formatPhone(pickPhone(contactAffiliation.participant)),
|
|
88003
|
+
Email: pickEmail(contactAffiliation.participant),
|
|
88004
|
+
Office: serviceAddress ? mapAddress(serviceAddress) : void 0
|
|
87985
88005
|
} : void 0,
|
|
87986
|
-
ChiefManager: {
|
|
87987
|
-
FirstName: chiefManager
|
|
87988
|
-
MiddleName: chiefManager
|
|
87989
|
-
LastName: chiefManager
|
|
87990
|
-
Office: chiefManagerAddress ? mapAddress(chiefManagerAddress) :
|
|
88006
|
+
ChiefManager: chiefManager ? {
|
|
88007
|
+
FirstName: chiefManager.participant._profile.firstName,
|
|
88008
|
+
MiddleName: chiefManager.participant._profile.middleName,
|
|
88009
|
+
LastName: chiefManager.participant._profile.lastName,
|
|
88010
|
+
Office: chiefManagerAddress ? mapAddress(chiefManagerAddress) : void 0,
|
|
87991
88011
|
AddressEffectiveDate: chiefManagerAddress?.effective_date,
|
|
87992
|
-
|
|
87993
|
-
|
|
87994
|
-
|
|
88012
|
+
// Spec: must equal Incorporation.EffectiveDate.
|
|
88013
|
+
EffectiveDate: incorporationEffectiveDate,
|
|
88014
|
+
Email: pickEmail(chiefManager.participant),
|
|
88015
|
+
PhoneNumber: formatPhone(pickPhone(chiefManager.participant))
|
|
88016
|
+
} : void 0,
|
|
87995
88017
|
Signatory: {
|
|
87996
88018
|
FirstName: signatoryManager?.participant._profile.firstName,
|
|
87997
88019
|
MiddleName: signatoryManager?.participant._profile.middleName,
|
|
87998
88020
|
LastName: signatoryManager?.participant._profile.lastName,
|
|
87999
88021
|
SigningTitle: deltaData.signatoryRole
|
|
88000
88022
|
},
|
|
88001
|
-
|
|
88002
|
-
|
|
88023
|
+
// Spec: required. Fall back to the filing contact's email when the office has no Business Email.
|
|
88024
|
+
OfficialEmail: registeredOfficeAddress?.communications?.find((c) => c.type === "Business Email")?.value || pickEmail(filingContact),
|
|
88025
|
+
NAICSCode: deltaData.businessActivity?.toString(),
|
|
88003
88026
|
PrimaryActivity: NAICS_CODE_DESCRIPTIONS[deltaData.businessActivity?.toString()]
|
|
88004
88027
|
}
|
|
88005
88028
|
};
|
|
88006
88029
|
}
|
|
88007
|
-
function createCoverLetter2(officialBusinessEmail, contact) {
|
|
88030
|
+
function createCoverLetter2(officialBusinessEmail, contact, phone) {
|
|
88008
88031
|
return {
|
|
88009
88032
|
FirstName: contact?._profile?.firstName || "",
|
|
88010
88033
|
LastName: contact?._profile?.lastName || "",
|
|
88011
88034
|
MiddleName: contact?._profile?.middleName || "",
|
|
88012
|
-
Email: contact
|
|
88013
|
-
Phone:
|
|
88014
|
-
|
|
88035
|
+
Email: pickEmail(contact) || officialBusinessEmail || "",
|
|
88036
|
+
Phone: phone || ""
|
|
88037
|
+
};
|
|
88038
|
+
}
|
|
88039
|
+
function formatPhone(phone) {
|
|
88040
|
+
const digits = (phone ?? "").replace(/\D/g, "").slice(-10);
|
|
88041
|
+
return digits.length === 10 ? `${digits.slice(0, 3)}-${digits.slice(3, 6)}-${digits.slice(6)}` : phone ?? "";
|
|
88042
|
+
}
|
|
88043
|
+
function pickEmail(person) {
|
|
88044
|
+
const p = person;
|
|
88045
|
+
return p?.communicationEmail || p?.communications?.find((c) => /e-?mail/i.test(c.type))?.value || void 0;
|
|
88046
|
+
}
|
|
88047
|
+
function pickPhone(person) {
|
|
88048
|
+
const p = person;
|
|
88049
|
+
return p?.communicationPhone || p?.communications?.find((c) => /phone|mobile|cell|tel/i.test(c.type))?.value || void 0;
|
|
88050
|
+
}
|
|
88051
|
+
function resolveStreet(address) {
|
|
88052
|
+
const find = (name2) => address?.components?.find((c) => c.name === name2)?.value?.trim();
|
|
88053
|
+
const number = find("Street Number Only");
|
|
88054
|
+
const name = find("Street Only");
|
|
88055
|
+
if (number && name)
|
|
88056
|
+
return { number, name };
|
|
88057
|
+
const line = name || find("Street Address") || address?.street?.trim() || address?.display?.line1?.trim() || "";
|
|
88058
|
+
const match = /^(\d[\w-]*)\s+(.+)$/.exec(line);
|
|
88059
|
+
if (number)
|
|
88060
|
+
return { number, name: name || line };
|
|
88061
|
+
return match ? { number: match[1], name: match[2] } : { number: "", name: line };
|
|
88062
|
+
}
|
|
88063
|
+
function pickSignatory(incorporators, contact) {
|
|
88064
|
+
const contactId = contact?._id;
|
|
88065
|
+
const chosen = incorporators.find((i) => i.type === "person" && contactId && i.profileID === contactId) ?? incorporators.find((i) => i.type === "person") ?? incorporators[0];
|
|
88066
|
+
if (!chosen)
|
|
88067
|
+
return { firstName: "", lastName: "" };
|
|
88068
|
+
return chosen.type === "person" ? { firstName: chosen.firstName ?? "", lastName: chosen.lastName ?? "", phone: chosen.phone } : {
|
|
88069
|
+
firstName: chosen.signatory_first_name ?? "",
|
|
88070
|
+
lastName: chosen.signatory_last_name ?? "",
|
|
88071
|
+
phone: chosen.phone
|
|
88015
88072
|
};
|
|
88016
88073
|
}
|
|
88017
88074
|
var init_federal_formation_mapper = __esm({
|