@eway-crm/connector 1.0.207 → 1.0.209

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,80 +1,81 @@
1
1
  declare class GlobalSettingsNames {
2
- static acceptableBackwardWorkReportDays: string;
3
- static adminAppInactiveLogoutTime: string;
4
- static applyGeneralDataProtectionRules: string;
5
- static automaticallyCreateJournalAfterCallDuration: string;
6
- static bonusesCompletedState: string;
7
- static cartInvoicedState: string;
8
- static cartOrderCanceledState: string;
9
- static cartOrderInProcessState: string;
10
- static cartOrderProcessedState: string;
11
- static cartPaidState: string;
12
- static cartProposalInProcessState: string;
13
- static cartProposalProcessedState: string;
14
- static cartSalesVoucherIssuedState: string;
15
- static cartToBeInvoicedState: string;
16
- static cartVoidedState: string;
17
- static clickToCallScheme: string;
18
- static companyDuplicityCheckEnabled: string;
19
- static completedStateName: string;
20
- static contactDuplicityCheckEnabled: string;
21
- static createCompanyWhileImportingContactFromOutlook: string;
22
- static enableContactsTwoWaySyncWithM365: string;
23
- static deadStateName: string;
24
- static enableCompaniesSyncIntoMobileDeviceContacts: string;
25
- static enableContactsSyncIntoMobileDevice: string;
26
- static enableLeadsSyncIntoMobileDeviceContacts: string;
27
- static enableLlamaAiFeatures: string;
28
- static enableUsersSyncIntoMobileDeviceContacts: string;
29
- static emailsActiveProjectsLeadsFilter: string;
30
- static exchangeRatesAdminGroupName: string;
31
- static forcedEmailTrackingGroups: string;
32
- static ignoreEmailsFromDomainsOnEmailsTracking: string;
33
- static trackEmailsFromDomains: string;
34
- static groupsForAllUnpaidInvoicesNotification: string;
35
- static itemPreviewMaxHeight: string;
36
- static lastActivityAttributes: string;
37
- static leadsCompletedState: string;
38
- static leadDeadlineAlertGroups: string;
39
- static leadsDeadState: string;
40
- static marketingCompletedState: string;
41
- static marketingDeadState: string;
42
- static minimumPasswordLength: string;
43
- static nextStepAttributes: string;
44
- static notifyAboutInvoicedInvoiceInPohodaGroup: string;
45
- static notifyAboutLeadsDeadline: string;
46
- static notifyAboutPaidInvoiceInPohodaGroup: string;
47
- static notifyAboutProjectDeadline: string;
48
- static numberOfDecimalPlaces: string;
49
- static phoneListTaskSolverGroup: string;
50
- static projectDeadlineAlert: string;
51
- static serverUpdateProgressNotificationGroup: string;
52
- static sumarizeCartsPricesOnLeads: string;
53
- static sumarizeCartsPricesOnProjects: string;
54
- static sumarizePeopleExpensesOnProjects: string;
55
- static systemHealthNotificationGroup: string;
56
- static tasksCompletedState: string;
57
- static tasksDeferredState: string;
58
- static tasksInProgressState: string;
59
- static tasksNotStartedState: string;
60
- static tasksWaitOnSomeoneElseState: string;
61
- static trackDocumentVersions: string;
62
- static vacationCompletedState: string;
63
- static workReportApprovedState: string;
64
- static defaultLanguage: string;
65
- static defaultCurrency: string;
66
- static myCompanyCountry: string;
67
- static myCompanyName: string;
68
- static myCompanyStreet: string;
69
- static myCompanyCity: string;
70
- static myCompanyState: string;
71
- static myCompanyZip: string;
72
- static myCompanyId: string;
73
- static myCompanyVat: string;
74
- static mergeGoodsInCart: string;
75
- static cartRefreshLogic: string;
76
- static goodsDefaultQuantity: string;
77
- static goodsDefaultVAT: string;
78
- static goodsDefaultVATIncluded: string;
2
+ static readonly acceptableBackwardWorkReportDays = "AcceptableBackwardWorkReportDays";
3
+ static readonly adminAppInactiveLogoutTime = "AdminAppInactiveLogoutTime";
4
+ static readonly applyGeneralDataProtectionRules = "ApplyGeneralDataProtectionRules";
5
+ static readonly automaticallyCreateJournalAfterCallDuration = "AutomaticallyCreateJournalAfterCallDuration";
6
+ static readonly bonusesCompletedState = "BonusesCompletedState";
7
+ static readonly cartInvoicedState = "CartInvoicedState";
8
+ static readonly cartOrderCanceledState = "CartOrderCanceledState";
9
+ static readonly cartOrderInProcessState = "CartOrderInProcessState";
10
+ static readonly cartOrderProcessedState = "CartOrderProcessedState";
11
+ static readonly cartPaidState = "CartPaidState";
12
+ static readonly cartProposalInProcessState = "CartProposalInProcessState";
13
+ static readonly cartProposalProcessedState = "CartProposalProcessedState";
14
+ static readonly cartSalesVoucherIssuedState = "CartSalesVoucherIssuedState";
15
+ static readonly cartToBeInvoicedState = "CartToBeInvoicedState";
16
+ static readonly cartVoidedState = "CartVoidedState";
17
+ static readonly clickToCallScheme = "ClickToCallScheme";
18
+ static readonly companyDuplicityCheckEnabled = "CompanyDuplicityCheckEnabled";
19
+ static readonly completedStateName = "CompletedStateName";
20
+ static readonly contactDuplicityCheckEnabled = "ContactDuplicityCheckEnabled";
21
+ static readonly createCompanyWhileImportingContactFromOutlook = "CreateCompanyWhileImportingContactFromOutlook";
22
+ static readonly defaultProposalValidityPeriod = "DefaultProposalValidityPeriod";
23
+ static readonly enableContactsTwoWaySyncWithM365 = "EnableContactsTwoWaySyncWithM365";
24
+ static readonly deadStateName = "DeadStateName";
25
+ static readonly enableCompaniesSyncIntoMobileDeviceContacts = "EnableCompaniesSyncIntoMobileDeviceContacts";
26
+ static readonly enableContactsSyncIntoMobileDevice = "EnableContactsSyncIntoMobileDevice";
27
+ static readonly enableLeadsSyncIntoMobileDeviceContacts = "EnableLeadsSyncIntoMobileDeviceContacts";
28
+ static readonly enableLlamaAiFeatures = "EnableLlamaAiFeatures";
29
+ static readonly enableUsersSyncIntoMobileDeviceContacts = "EnableUsersSyncIntoMobileDeviceContacts";
30
+ static readonly emailsActiveProjectsLeadsFilter = "EmailsActiveProjectsLeadsFilter";
31
+ static readonly exchangeRatesAdminGroupName = "ExchangeRatesAdminGroupName";
32
+ static readonly forcedEmailTrackingGroups = "ForcedEmailTrackingGroups";
33
+ static readonly ignoreEmailsFromDomainsOnEmailsTracking = "IgnoreEmailsFromDomainsOnEmailsTracking";
34
+ static readonly trackEmailsFromDomains = "TrackEmailsFromDomains";
35
+ static readonly groupsForAllUnpaidInvoicesNotification = "GroupsForAllUnpaidInvoicesNotification";
36
+ static readonly itemPreviewMaxHeight = "ItemPreviewMaxHeight";
37
+ static readonly lastActivityAttributes = "LastActivityAttributes";
38
+ static readonly leadsCompletedState = "LeadsCompletedState";
39
+ static readonly leadDeadlineAlertGroups = "LeadDeadlineAlertGroups";
40
+ static readonly leadsDeadState = "LeadsDeadState";
41
+ static readonly marketingCompletedState = "MarketingCompletedState";
42
+ static readonly marketingDeadState = "MarketingDeadState";
43
+ static readonly minimumPasswordLength = "MinimumPasswordLength";
44
+ static readonly nextStepAttributes = "NextStepAttributes";
45
+ static readonly notifyAboutInvoicedInvoiceInPohodaGroup = "NotifyAboutInvoicedInvoiceInPohodaGroup";
46
+ static readonly notifyAboutLeadsDeadline = "NotifyAboutLeadsDeadline";
47
+ static readonly notifyAboutPaidInvoiceInPohodaGroup = "NotifyAboutPaidInvoiceInPohodaGroup";
48
+ static readonly notifyAboutProjectDeadline = "NotifyAboutProjectDeadline";
49
+ static readonly numberOfDecimalPlaces = "NumberOfDecimalPlaces";
50
+ static readonly phoneListTaskSolverGroup = "PhoneListTaskSolverGroup";
51
+ static readonly projectDeadlineAlert = "ProjectDeadlineAlert";
52
+ static readonly serverUpdateProgressNotificationGroup = "ServerUpdateProgressNotificationGroup";
53
+ static readonly sumarizeCartsPricesOnLeads = "SumarizeCartsPricesOnLeads";
54
+ static readonly sumarizeCartsPricesOnProjects = "SumarizeCartsPricesOnProjects";
55
+ static readonly sumarizePeopleExpensesOnProjects = "SumarizePeopleExpensesOnProjects";
56
+ static readonly systemHealthNotificationGroup = "SystemHealthNotificationGroup";
57
+ static readonly tasksCompletedState = "TasksCompletedState";
58
+ static readonly tasksDeferredState = "TasksDeferredState";
59
+ static readonly tasksInProgressState = "TasksInProgressState";
60
+ static readonly tasksNotStartedState = "TasksNotStartedState";
61
+ static readonly tasksWaitOnSomeoneElseState = "TasksWaitOnSomeoneElseState";
62
+ static readonly trackDocumentVersions = "TrackDocumentVersions";
63
+ static readonly vacationCompletedState = "VacationCompletedState";
64
+ static readonly workReportApprovedState = "WorkReportApprovedState";
65
+ static readonly defaultLanguage = "DefaultLanguage";
66
+ static readonly defaultCurrency = "DefaultCurrency";
67
+ static readonly myCompanyCountry = "MyCompanyCountry";
68
+ static readonly myCompanyName = "MyCompanyName";
69
+ static readonly myCompanyStreet = "MyCompanyStreet";
70
+ static readonly myCompanyCity = "MyCompanyCity";
71
+ static readonly myCompanyState = "MyCompanyState";
72
+ static readonly myCompanyZip = "MyCompanyZIP";
73
+ static readonly myCompanyId = "MyCompanyID";
74
+ static readonly myCompanyVat = "MyCompanyVAT";
75
+ static readonly mergeGoodsInCart = "MergeGoodsInCart";
76
+ static readonly cartRefreshLogic = "CartRefreshLogic";
77
+ static readonly goodsDefaultQuantity = "GoodsDefaultQuantity";
78
+ static readonly goodsDefaultVAT = "GoodsDefaultVAT";
79
+ static readonly goodsDefaultVATIncluded = "GoodsDefaultVATIncluded";
79
80
  }
80
81
  export default GlobalSettingsNames;
@@ -1,3 +1,4 @@
1
+ import type { IApiGoodInCart } from './IApiGoodInCart';
1
2
  import type { IApiItemBase } from './IApiItemBase';
2
3
  export interface IApiCart extends IApiItemBase {
3
4
  Id: number | null;
@@ -12,6 +13,7 @@ export interface IApiCart extends IApiItemBase {
12
13
  Vat: number | null;
13
14
  PriceTotalExcludingVat: number | null;
14
15
  GoodsInCartCount: number | null;
16
+ GoodsInCart: IApiGoodInCart[] | null;
15
17
  Note: string | null;
16
18
  PriceTotalDefaultCurrency: number | null;
17
19
  PriceTotalParentCurrency: number | null;
package/lib/cjs/index.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * @license Licensed under MIT license
6
6
  * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
7
7
  * @version v4.2.8+1e68dce6
8
- */class u{}u.rcSuccess="rcSuccess",u.rcBadSession="rcBadSession",u.rcDuplicateContact="rcDuplicateContact",u.rcWebServiceMoved="rcWebServiceMoved",u.rcAccessDenied="rcAccessDenied",u.rcLoginUserNameChanged="rcLoginUserNameChanged",u.rcLicenseExpired="rcLicenseExpired",exports.HttpMethod=void 0,(a=exports.HttpMethod||(exports.HttpMethod={})).get="get",a.post="post";class d{}d.absence="Absence",d.bonusType="BonusType",d.busyStatus="BusyStatus",d.cartType="CartType",d.companyType="CompanyType",d.contactType="ContactType",d.countryCode="CountryCode",d.currency="Currency",d.customFieldCategory="CustomFieldCategory",d.dayType="DayType",d.documentOfflineState="DocumentOfflineState",d.documentType="DocumentType",d.emailCampaignWorkflowStatus="EmailCampaignWorkflowStatus",d.emailOfflineState="EmailOfflineState",d.emailType="EmailType",d.familyStatus="FamilyStatus",d.firstContact="FirstContact",d.globalSettingsCategory="GlobalSettingsCategory",d.goalType="GoalType",d.groupColor="GroupColor",d.importance="Importance",d.journalType="JournalType",d.knowledgeLevel="KnowledgeLevel",d.knowledgeTitle="KnowledgeTitle",d.knowledgeType="KnowledgeType",d.leadType="LeadType",d.marketingType="MarketingType",d.paymentType="PaymentType",d.prefixType="PrefixType",d.productType="ProductType",d.projectOrigin="ProjectOrigin",d.projectType="ProjectType",d.reportCategory="ReportCategory",d.responseForm="ResponseForm",d.responseType="ResponseType",d.salaryDate="SalaryDate",d.salaryType="SalaryType",d.salePriceType="SalePriceType",d.sentimentTone="SentimentTone",d.suffixType="SuffixType",d.taskImportance="TaskImportance",d.tasksSnoozePeriod="TasksSnoozePeriod",d.taskStatus="TaskStatus",d.taskType="TaskType",d.trainingGrade="TrainingGrade",d.trainingTitle="TrainingTitle",d.translations="Translations",d.units="Units",d.userType="UserType",d.usStatesDistrictsTerritories="USStatesDistrictsTerritories",d.vacationType="VacationType",d.vat="VAT",d.workLoad="WorkLoad",d.workReportType="WorkReportType";class m{}m.isValidFolderName=e=>Object.values(m).includes(e),m.actions="Actions",m.additionalFields="AdditionalFields",m.bonuses="Bonuses",m.calendar="Calendar",m.capacityNotes="CapacityNotes",m.capacityNoteTypes="CapacityNoteTypes",m.carts="Carts",m.columnPermissions="ColumnPermissions",m.companies="Companies",m.contacts="Contacts",m.contactsSuggestions="ContactsSuggestions",m.currencyExchangeRates="CurrencyExchangeRates",m.documents="Documents",m.emails="Emails",m.enumTypes="EnumTypes",m.enumValues="EnumValues",m.enumValuesRelations="EnumValuesRelations",m.features="Features",m.flows="Flows",m.globalSettings="GlobalSettings",m.goals="Goals",m.goods="Goods",m.goodsInCart="GoodsInCart",m.goodsInSet="GoodsInSet",m.groups="Groups",m.history="History",m.holidays="Holidays",m.children="Children",m.individualDiscounts="IndividualDiscounts",m.invoiceItems="InvoiceItems",m.invoices="Invoices",m.itemCopyRelations="ItemCopyRelations",m.journal="Journal",m.knowledge="Knowledge",m.layouts="Layouts",m.layoutsModels="LayoutsModels",m.leads="Leads",m.ledger="Ledger",m.mappings="Mappings",m.marketing="Marketing",m.marketingList="MarketingList",m.marketingListSources="MarketingListSources",m.models="Models",m.modulePermissions="ModulePermissions",m.objectTypesOptions="ObjectTypesOptions",m.payments="Payments",m.priceListGroups="PriceListGroups",m.projectAssignments="ProjectAssignments",m.projectAssignmentsPerUserProject="ProjectAssignmentsPerUserProject",m.projectAssignmentsTotal="ProjectAssignmentsTotal",m.projectAssignmentsTotalUserProject="ProjectAssignmentsTotalUserProject",m.projectList="ProjectList",m.projects="Projects",m.projectUsersInCaPlan="ProjectUsersInCaPlan",m.relationData="RelationData",m.relations="Relations",m.reports="Reports",m.revisionsHistory="RevisionsHistory",m.salaries="Salaries",m.salePrices="SalePrices",m.prices="Prices",m.sqlObjects="SqlObjects",m.tasks="Tasks",m.recurrencePatterns="RecurrencePatterns",m.teamRoles="TeamRoles",m.templates="Templates",m.training="Training",m.unifiedRelations="UnifiedRelations",m.users="Users",m.userSettings="UserSettings",m.vacation="Vacation",m.webAccess2Options="WebAccess2Options",m.webAccessOptions="WebAccessOptions",m.workCommitments="WorkCommitments",m.workflowHistory="WorkflowHistory",m.workReports="WorkReports",m.wrongClientVersions="WrongClientVersions",m.xsltTransformations="XsltTransformations",m.xsltTransformationsModels="XsltTransformationsModels",m.getEnumTypeName=e=>e===m.bonuses?d.bonusType:e===m.carts?d.cartType:e===m.companies?d.companyType:e===m.contacts?d.contactType:e===m.documents?d.documentType:e===m.emails?d.emailType:e===m.goals?d.goalType:e===m.goods?d.productType:e===m.journal?d.journalType:e===m.knowledge?d.knowledgeType:e===m.leads?d.leadType:e===m.marketing?d.marketingType:e===m.projects?d.projectType:e===m.salaries?d.salaryType:e===m.salePrices?d.salePriceType:e===m.tasks?d.taskType:e===m.training?d.trainingTitle:e===m.users?d.userType:e===m.vacation?d.vacationType:e===m.workReports?d.workReportType:null,m.getFolderNameByEnumTypeName=e=>e===d.bonusType?m.bonuses:e===d.cartType?m.carts:e===d.companyType?m.companies:e===d.contactType?m.contacts:e===d.documentType?m.documents:e===d.emailType?m.emails:e===d.goalType?m.goals:e===d.journalType?m.journal:e===d.knowledgeType?m.knowledge:e===d.leadType?m.leads:e===d.marketingType?m.marketing:e===d.productType?m.goods:e===d.projectType?m.projects:e===d.salaryType?m.salaries:e===d.salePriceType?m.salePrices:e===d.taskType?m.tasks:e===d.trainingTitle?m.training:e===d.userType?m.users:e===d.vacationType?m.vacation:e===d.workReportType?m.workReports:null;class p{}p.getAllEmailAttachments="GetAllEmailAttachments",p.getCalendarsByItemGuids="GetCalendarsByItemGuids",p.getEmailAttachment="GetEmailAttachment",p.getItemPreview="GetItemPreview",p.getJournalsByItemGuids="GetJournalsByItemGuids",p.getMarketingCampaignsByItemGuids="GetMarketingCampaignsByItemGuids",p.getMarketingListsRecordsByItemGuids="GetMarketingListsRecordsByItemGuids",p.getRevisionHistoryRecordsByItemGuids="GetRevisionHistoryRecordsByItemGuids",p.getVacationsByItemGuids="GetVacationsByItemGuids",p.getWorkflowHistoryRecordsByItemGuids="GetWorkflowHistoryRecordsByItemGuids",p.getCompanyInformationFromTaxRegister="GetCompanyInformationFromTaxRegister",p.logIn="LogIn",p.logOut="LogOut",p.query="Query",p.queryAmount="QueryAmount",p.getServiceAuthSettings="GetServiceAuthSettings",p.getVersion="GetVersion",p.getBinaryAttachment="GetBinaryAttachment",p.getBinaryAttachmentLatestRevision="GetBinaryAttachmentLatestRevision",p.transformItem="TransformItem",p.canUnlinkItems="CanUnlinkItems",p.unlinkItems="UnlinkItems",p.getGoodsFinalPrices="GetGoodsFinalPrices",p.saveItemCopyRelation="SaveItemCopyRelation",p.getFolderNameForApiMethod=e=>{switch(e){case m.calendar:return"Calendars";case m.journal:return"Journals";case m.marketing:return"MarketingCampaigns";case m.marketingList:return"MarketingListsRecords";case m.revisionsHistory:return"RevisionHistoryRecords";case m.vacation:return"Vacations";case m.workflowHistory:return"WorkflowHistoryRecords";default:return e}},p.getGetFolderNameByItemGuidsMethodName=e=>`Get${p.getFolderNameForApiMethod(e)}ByItemGuids`,p.getGetFolderNameMethodName=e=>`Get${p.getFolderNameForApiMethod(e)}`,p.getSearchFolderNameMethodName=e=>`Search${p.getFolderNameForApiMethod(e)}`;class y{constructor(e,t,r,s,o,n){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{e.callWithoutSession(p.logIn,{userName:this.username,passwordHash:this.passwordHash,appVersion:this.appVersion,clientMachineIdentifier:this.clientMachineIdentifier,clientMachineName:this.clientMachineName,createSessionCookie:e.supportsGetItemPreviewMethod},(e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(r)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(e)}}),(e=>{const t=new Error("Unable to login. Error response follows.\n"+JSON.stringify(e));if(!this.errorCallback)throw t;this.errorCallback(t)}))},!e||!t)throw new Error("Non of the arguments 'username', 'passwordHash' can be empty.");this.username=e,this.passwordHash=t,this.appVersion=r,this.clientMachineIdentifier=s,this.clientMachineName=o,this.errorCallback=n}}class h{constructor(){this.getSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")},this.invalidateSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")}}}class C{static createAuthorizeUrl(e,t,r,s,o,n,i=!1){if(o&&!n||!o&&n)throw new Error("If codeChallenge is defined, codeChallengeMethod must also be defined and vice versa");let a=`https://login.eway-crm.${i?"dev":"com"}?scope=${encodeURIComponent(t.join(" "))}&prompt=login&response_type=code&redirect_uri=${encodeURIComponent(r)}&client_id=${e}`;return s&&(a+=`&state=${encodeURIComponent(s)}`),o&&n&&(a+=`&code_challenge=${encodeURIComponent(o)}&code_challenge_method=${encodeURIComponent(n)}`),a}}C.finishAuthorization=(e,t,r,s,o,n,i)=>{const a=new URLSearchParams;a.append("code_verifier",s),a.append("client_id",t),a.append("client_secret",r),a.append("code",o),a.append("redirect_uri",n),a.append("grant_type","authorization_code"),C.callTokenEndpoint(e,a,i)},C.refreshToken=(e,t,r,s,o)=>{const n=new URLSearchParams;n.append("client_id",t),n.append("client_secret",r),n.append("refresh_token",s),n.append("grant_type","refresh_token"),C.callTokenEndpoint(e,n,o)},C.getWebServiceUrl=e=>{const t=e.split(".");if(2!==t.length)throw new Error("Invalid token supplied");return n.decode(t[1])},C.getUserName=e=>C.decodeAccessToken(e).username,C.decodeAccessToken=e=>r(e),C.callTokenEndpoint=(t,r,s)=>{e.post(t+"/auth/connect/token",r,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((e=>{s(e.data)})).catch((e=>{e.response&&400==e.response.status?s(e.response.data):s({error:"Token request failed"})}))};class P extends Error{constructor(e,t){super(),this.returnCode=e,this.message=t}}class f{constructor(e,t,r,s,o){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{const r={userName:this.username,appVersion:this.appVersion,createSessionCookie:e.supportsGetItemPreviewMethod},s={Authorization:"Bearer "+this.accessToken};e.callWithoutSession(p.logIn,r,(e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(r)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(e)}}),(e=>{const t=new P(e.ReturnCode,"Unable to login. Error response follows.\n"+JSON.stringify(e));if(!this.errorCallback)throw t;this.errorCallback(t)}),s,void 0,(r=>{if(401!==(null==r?void 0:r.statusCode)){if(!this.errorCallback)throw r;this.errorCallback(r)}else this.getNewAccessTokenCallback(e,(r=>{this.accessToken=r.accessToken,r.error||this.getSessionId(e,t)}))}))},!e)throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");this.username=e,this.accessToken=t,this.appVersion=r,this.getNewAccessTokenCallback=s,this.errorCallback=o}}class g extends f{constructor(e,t,r,s,o,n,i,a){if(!(e&&s&&t&&r))throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");super(e,o,n,((e,t)=>{C.refreshToken(e.wsUrl,this.clientId,this.clientSecret,this.refreshToken,(e=>{try{this.refreshTokenCallback&&this.refreshTokenCallback(e)}catch(e){this.errorCallback&&this.errorCallback(new Error("Refresh token callback failed.\n"+JSON.stringify(e)))}void 0!==e.error?t({error:e.error}):t({accessToken:e.access_token})}))}),i),this.refreshToken=s,this.clientId=t,this.clientSecret=r,this.refreshTokenCallback=a}}class T extends Error{constructor(e,t){super(),this.statusCode=e,this.message=t}}class E{}E.stringifyError=e=>JSON.stringify(e,E.replaceErrors),E.replaceErrors=(e,t)=>{if(t instanceof Error){const e={};return Object.getOwnPropertyNames(t).forEach((r=>{e[r]=t[r]})),e}return t};class S{constructor(t,r,s,o){if(this.ensureLogin=()=>new Promise(((e,t)=>{if(this.sessionId)e();else{const r=r=>{r&&(this.sessionId=r,e()),t("Session Id cannot be empty")};this.sessionHandler.getSessionId(this,r)}})),this.createOpenLink=(e,t,r,s)=>{const o=n.encode(this.baseUri);let i="eway://"+t;r&&(i+="/"+(null==r?void 0:r.toLowerCase()));const a=e?"open.eway-crm.dev":"open.eway-crm.com";i=n.encode(i);let l="https://"+a+"/?ws="+o+"&l="+i;return s&&(l+="&n="+encodeURIComponent(s)),l},this.askUploadMethod=(e,t,r,s,o)=>new Promise(((n,i)=>{const a=o?e=>{throw i(e),e}:i;this.callUploadMethod(e,t,r,n,a,a,s)})),this.callUploadMethod=(t,r,s,o,n,i,a)=>{const l=()=>{this.sessionHandler.getSessionId(this,(e=>{this.sessionId=e,this.callUploadMethod(t,r,s,o,n,i,a)}))},c=this.sessionId;if(!c)return void l();const d=`${this.svcUri}/SaveBinaryAttachment?sessionId=${this.sessionId}&itemGuid=${t}&fileName=${encodeURIComponent(r)}`,m=e.post(d,s,a);S.handleCallPromise(m,o,(e=>{if(e.ReturnCode===u.rcBadSession)return this.sessionId=null,void this.sessionHandler.invalidateSessionId(c,l);if(n)n(e);else{const t=new Error("Unhandled connection return code "+e.ReturnCode+": "+e.Description);if(!this.errorCallback)throw t;this.errorCallback(t)}}),(e=>{let t=new Error("Unhandled connection error when calling "+d+": "+E.stringifyError(e));if("statusCode"in e&&413===e.statusCode&&(t=new Error("The file has exceeded the maximum allowed file size for uploading. You can contact your IT administrator or eWay-CRM support if you would like to increase the limit.")),i)i(t);else{if(!this.errorCallback)throw t;this.errorCallback(t)}}))},this.askMethod=(e,t,r,s)=>new Promise(((o,n)=>{const i=s?e=>{throw n(e),e}:n;this.callMethod(e,t,o,i,r,i)})),this.callMethod=(e,t,r,s,o,n)=>{o||(o=exports.HttpMethod.post);const i=()=>{this.sessionHandler.getSessionId(this,(i=>{this.sessionId=i,this.callMethod(e,t,r,s,o,n)}))},a=this.sessionId;if(!a)return void i();t.sessionId=a;const l=e!==p.logOut?r:e=>{this.sessionId=null,r(e)};this.callWithoutSession(e,t,l,(r=>{if(r.ReturnCode!==u.rcBadSession||(this.sessionId=null,e===p.logOut))if(s)s(r);else{const e=new Error("Unhandled connection return code "+r.ReturnCode+": "+r.Description);if(!this.errorCallback)throw e;this.errorCallback(e,t)}else this.sessionHandler.invalidateSessionId(a,i)}),null,o,n)},this.callWithoutSession=(t,r,s,o,n,i,a)=>{var l;i||(i=exports.HttpMethod.post);const c=this.svcUri+"/"+t;let u,d;switch(n&&(u={headers:n,withCredentials:null!==(l=this.supportGetItemPreviewMethod)&&void 0!==l?l:t==p.logIn}),i){case exports.HttpMethod.get:if(r)throw new Error("Calling api get method with data specified does not make any sense.");d=e.get(c,u);break;case exports.HttpMethod.post:d=e.post(c,r,u);break;default:throw new Error(`Unknown http method '${i}'.`)}S.handleCallPromise(d,s,o,(e=>{if(a)try{a(e)}catch(e){if(!this.errorCallback)throw e;this.errorCallback(e,r)}else{const t=new Error("Unhandled connection error when calling "+c+": "+E.stringifyError(e));if(!this.errorCallback)throw t;this.errorCallback(t,r)}}))},this.getItemPreviewGetMethodUrl=(e,t,r)=>this.svcUri+"/"+p.getItemPreview+"?folderName="+encodeURIComponent(e)+"&itemGuid="+encodeURIComponent(t)+(r||0===r?"&itemVersion="+encodeURIComponent(r.toString()):""),this.getEmailAttachmentGetMethodUrl=(e,t)=>this.svcUri+"/"+p.getEmailAttachment+"?itemGuid="+encodeURIComponent(e)+"&contentId="+encodeURIComponent(t),this.getAllEmailAttachmentsZipGetMethodUrl=e=>this.svcUri+"/"+p.getAllEmailAttachments+"?itemGuid="+encodeURIComponent(e),this.getBinaryAttachmentGetMethodUrl=(e,t)=>"number"==typeof t?this.svcUri+"/"+p.getBinaryAttachment+"?itemGuid="+encodeURIComponent(e)+`&revision=${t}`:this.svcUri+"/"+p.getBinaryAttachmentLatestRevision+"?itemGuid="+encodeURIComponent(e),this.getTransformItemMethodUrl=(e,t,r,s)=>`${this.svcUri}/${p.transformItem}?itemGuid=${encodeURIComponent(e)}&itemFolderName=${encodeURIComponent(t)}&transformationGuid=${encodeURIComponent(r)}&outputFormat=${s}`,this.getActiveSessionId=()=>this.sessionId,this.setActiveSessionId=e=>{this.sessionId=e},!t)throw new Error("The argument 'apiServiceUri' cannot be empty.");if(t.length<8||"https://"!==t.substr(0,8).toLowerCase()&&"http://"!==t.substr(0,7).toLowerCase())throw new Error("Api service uri must start either with 'https://' or with 'http://'.");if(".svc"===t.substr(t.length-4).toLowerCase()){this.svcUri=t;const e=["/API.svc","/InsecureAPI.svc","/WcfService/Service.svc"].find((e=>e.toLowerCase()===t.substr(t.length-e.length).toLowerCase()))||"";this.baseUri=t.substr(0,t.length-e.length)}else this.baseUri=S.normalizeWsUrl(t)||t,"https://"===t.substr(0,8).toLowerCase()?this.svcUri=this.baseUri+"/API.svc":this.svcUri=this.baseUri+"/InsecureAPI.svc";this.sessionHandler=r,this.errorCallback=s,this.sessionId=null,this.supportGetItemPreviewMethod=null!=o&&o}get supportsGetItemPreviewMethod(){return this.supportGetItemPreviewMethod}static create(e,t,r,s,o,n,i,a){return new S(e,new y(t,r,s,o,n,i),i,a)}static createAnonymous(e,t){return new S(e,new h,t)}static createUsingOAuth(e,t,r,s,o,n,i,a,l,c){return new S(e,new g(t,r,s,o,n,i,a,l),a,c)}static normalizeWsUrl(e){return e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),e}get wsUrl(){return this.baseUri}static handleCallPromise(e,t,r,s){e.then((e=>{200===e.status?e.data.ReturnCode===u.rcSuccess?t(e.data):r(e.data):s(new T(e.status,e.statusText))})).catch((e=>{e.response?s(new T(e.response.status,e.response.statusText)):s(e)}))}}class A{constructor(e,t,r,s,o,n,i){this.isEnabled=(e,t)=>{const r=()=>{this.url&&this.token?e(this.url,this.token):t()};this.url&&this.token?e(this.url,this.token):this.obtainToken(r)},this.callTokenizedApi=(e,t,r,s)=>{this.isEnabled(((o,n)=>{t.token=n,A.call(o,e,t,r,(o=>{if(o.ReturnCodeString!==this.invalidTokenReturnCode){if(s)s(o);else if(this.generalErrorCallback){const e=new Error("Unhandled tokenized service connection return code "+o.ReturnCodeString+".\nDescription: "+o.Description);this.generalErrorCallback(e)}}else this.obtainToken((()=>{this.callTokenizedApi(e,t,r,s)}))}),(e=>{if(this.generalErrorCallback){const t=new Error("Unhandled tokenized service connection communication error: "+JSON.stringify(e));this.generalErrorCallback(t)}}))}),(()=>{s&&s(null)}))},this.obtainToken=e=>{if(!this.isActive)return this.url=null,this.token=null,void e();const t=t=>{const r=this.urlAndTokenObtainer(t);r.url&&r.token?(this.url=r.url,this.token=r.token,this.isActive=!0,e()):(this.url=null,this.token=null,this.isActive=!1,e())},r=()=>{this.url=null,this.token=null,this.isActive=!1,e()};this.needsSession?this.connection.callMethod(this.obtainTokenMethodName,{},t,r,this.obtainTokenMethodType):this.connection.callWithoutSession(this.obtainTokenMethodName,null,t,r,null,this.obtainTokenMethodType)},this.obtainTokenMethodName=e,this.obtainTokenMethodType=t,this.needsSession=r,this.invalidTokenReturnCode=s,this.urlAndTokenObtainer=o,this.connection=n,this.generalErrorCallback=i||null,this.url=null,this.token=null,this.isActive=!0}static call(t,r,s,o,n,i){const a=t+"/"+r;e.post(a,s).then((e=>{200===e.status?"Success"===e.data.ReturnCodeString?o(e.data):n(e.data):i(new T(e.status,e.statusText))})).catch((e=>{e.response?i(new T(e.response.status,e.response.statusText)):i(e)}))}}const I=e=>({url:e.ServiceUrl,token:e.Token});class v{}v.acceptableBackwardWorkReportDays="AcceptableBackwardWorkReportDays",v.adminAppInactiveLogoutTime="AdminAppInactiveLogoutTime",v.applyGeneralDataProtectionRules="ApplyGeneralDataProtectionRules",v.automaticallyCreateJournalAfterCallDuration="AutomaticallyCreateJournalAfterCallDuration",v.bonusesCompletedState="BonusesCompletedState",v.cartInvoicedState="CartInvoicedState",v.cartOrderCanceledState="CartOrderCanceledState",v.cartOrderInProcessState="CartOrderInProcessState",v.cartOrderProcessedState="CartOrderProcessedState",v.cartPaidState="CartPaidState",v.cartProposalInProcessState="CartProposalInProcessState",v.cartProposalProcessedState="CartProposalProcessedState",v.cartSalesVoucherIssuedState="CartSalesVoucherIssuedState",v.cartToBeInvoicedState="CartToBeInvoicedState",v.cartVoidedState="CartVoidedState",v.clickToCallScheme="ClickToCallScheme",v.companyDuplicityCheckEnabled="CompanyDuplicityCheckEnabled",v.completedStateName="CompletedStateName",v.contactDuplicityCheckEnabled="ContactDuplicityCheckEnabled",v.createCompanyWhileImportingContactFromOutlook="CreateCompanyWhileImportingContactFromOutlook",v.enableContactsTwoWaySyncWithM365="EnableContactsTwoWaySyncWithM365",v.deadStateName="DeadStateName",v.enableCompaniesSyncIntoMobileDeviceContacts="EnableCompaniesSyncIntoMobileDeviceContacts",v.enableContactsSyncIntoMobileDevice="EnableContactsSyncIntoMobileDevice",v.enableLeadsSyncIntoMobileDeviceContacts="EnableLeadsSyncIntoMobileDeviceContacts",v.enableLlamaAiFeatures="EnableLlamaAiFeatures",v.enableUsersSyncIntoMobileDeviceContacts="EnableUsersSyncIntoMobileDeviceContacts",v.emailsActiveProjectsLeadsFilter="EmailsActiveProjectsLeadsFilter",v.exchangeRatesAdminGroupName="ExchangeRatesAdminGroupName",v.forcedEmailTrackingGroups="ForcedEmailTrackingGroups",v.ignoreEmailsFromDomainsOnEmailsTracking="IgnoreEmailsFromDomainsOnEmailsTracking",v.trackEmailsFromDomains="TrackEmailsFromDomains",v.groupsForAllUnpaidInvoicesNotification="GroupsForAllUnpaidInvoicesNotification",v.itemPreviewMaxHeight="ItemPreviewMaxHeight",v.lastActivityAttributes="LastActivityAttributes",v.leadsCompletedState="LeadsCompletedState",v.leadDeadlineAlertGroups="LeadDeadlineAlertGroups",v.leadsDeadState="LeadsDeadState",v.marketingCompletedState="MarketingCompletedState",v.marketingDeadState="MarketingDeadState",v.minimumPasswordLength="MinimumPasswordLength",v.nextStepAttributes="NextStepAttributes",v.notifyAboutInvoicedInvoiceInPohodaGroup="NotifyAboutInvoicedInvoiceInPohodaGroup",v.notifyAboutLeadsDeadline="NotifyAboutLeadsDeadline",v.notifyAboutPaidInvoiceInPohodaGroup="NotifyAboutPaidInvoiceInPohodaGroup",v.notifyAboutProjectDeadline="NotifyAboutProjectDeadline",v.numberOfDecimalPlaces="NumberOfDecimalPlaces",v.phoneListTaskSolverGroup="PhoneListTaskSolverGroup",v.projectDeadlineAlert="ProjectDeadlineAlert",v.serverUpdateProgressNotificationGroup="ServerUpdateProgressNotificationGroup",v.sumarizeCartsPricesOnLeads="SumarizeCartsPricesOnLeads",v.sumarizeCartsPricesOnProjects="SumarizeCartsPricesOnProjects",v.sumarizePeopleExpensesOnProjects="SumarizePeopleExpensesOnProjects",v.systemHealthNotificationGroup="SystemHealthNotificationGroup",v.tasksCompletedState="TasksCompletedState",v.tasksDeferredState="TasksDeferredState",v.tasksInProgressState="TasksInProgressState",v.tasksNotStartedState="TasksNotStartedState",v.tasksWaitOnSomeoneElseState="TasksWaitOnSomeoneElseState",v.trackDocumentVersions="TrackDocumentVersions",v.vacationCompletedState="VacationCompletedState",v.workReportApprovedState="WorkReportApprovedState",v.defaultLanguage="DefaultLanguage",v.defaultCurrency="DefaultCurrency",v.myCompanyCountry="MyCompanyCountry",v.myCompanyName="MyCompanyName",v.myCompanyStreet="MyCompanyStreet",v.myCompanyCity="MyCompanyCity",v.myCompanyState="MyCompanyState",v.myCompanyZip="MyCompanyZIP",v.myCompanyId="MyCompanyID",v.myCompanyVat="MyCompanyVAT",v.mergeGoodsInCart="MergeGoodsInCart",v.cartRefreshLogic="CartRefreshLogic",v.goodsDefaultQuantity="GoodsDefaultQuantity",v.goodsDefaultVAT="GoodsDefaultVAT",v.goodsDefaultVATIncluded="GoodsDefaultVATIncluded";class k{}k.ServerCommon={Server_ID:"Server_ID",Server_ItemCreated:"Server_ItemCreated",Server_ItemChanged:"Server_ItemChanged"},k.Common={CreatedByGUID:"CreatedByGUID",CurrencyEn:"CurrencyEn",DefaultCurrencySuffix:"DefaultCurrency",FileAs:"FileAs",ItemCreated:"ItemCreated",ItemChanged:"ItemChanged",ItemGUID:"ItemGUID",ItemVersion:"ItemVersion",ModifiedByGUID:"ModifiedByGUID",OwnerGUID:"OwnerGUID",ParentCurrencySuffix:"ParentCurrency"},k.Calendar={EndDate:"EndDate",Note:"Note"},k.Carts={SuperiorItem:"SuperiorItem",Customer:"Customer",Contact:"Contact",TypeEn:"TypeEn",StateEn:"StateEn",PriceTotal:"PriceTotal",PriceTotalExcludingVAT:"PriceTotalExcludingVAT",ForPayment:"ForPayment",Paid:"Paid",CurrencyEn:"CurrencyEn",EffectiveFrom:"EffectiveFrom",ValidUntil:"ValidUntil",Active:"Active",Note:"Note",ID:"ID",AccountingCaseDate:"AccountingCaseDate",TaxableSupplyDate:"TaxableSupplyDate",PaymentDate:"PaymentDate",VAT:"VAT",GoodsInCartCount:"GoodsInCartCount",PriceTotalDefaultCurrency:"PriceTotalDefaultCurrency",PriceTotalParentCurrency:"PriceTotalParentCurrency",ForPaymentDefaultCurrency:"ForPaymentDefaultCurrency",ForPaymentParentCurrency:"ForPaymentParentCurrency",PaidDefaultCurrency:"PaidDefaultCurrency",PaidParentCurrency:"PaidParentCurrency",PaidChanged:"PaidChanged",PriceTotalChanged:"PriceTotalChanged",PriceTotalExcludingVATDefaultCurrency:"PriceTotalExcludingVATDefaultCurrency",PriceTotalExcludingVATParentCurrency:"PriceTotalExcludingVATParentCurrency",VATDefaultCurrency:"VATDefaultCurrency",VATParentCurrency:"VATParentCurrency",PrevStateEn:"PrevStateEn",PurchaseExpenses:"PurchaseExpenses",PurchaseExpensesDefaultCurrency:"PurchaseExpensesDefaultCurrency",PurchaseExpensesParentCurrency:"PurchaseExpensesParentCurrency",PurchaseExpensesChanged:"PurchaseExpensesChanged",Profit:"Profit",ProfitDefaultCurrency:"ProfitDefaultCurrency",ProfitParentCurrency:"ProfitParentCurrency",ProfitChanged:"ProfitChanged"},k.Companies={ID:"ID",CompanyName:"CompanyName",Department:"Department",AccountNumber:"AccountNumber",IdentificationNumber:"IdentificationNumber",VatNumber:"VatNumber",Sales:"Reversal",EmployeesCount:"EmployeesCount",Purchaser:"Purchaser",Suppliers:"Suppliers",Competitor:"Competitor",Address1Street:"Address1Street",Address1City:"Address1City",Address1PostalCode:"Address1PostalCode",Address1CountryEn:"Address1CountryEn",Address1State:"Address1State",Address1POBox:"Address1POBox",Address2Street:"Address2Street",Address2City:"Address2City",Address2PostalCode:"Address2PostalCode",Address2CountryEn:"Address2CountryEn",Address2State:"Address2State",Address2POBox:"Address2POBox",Address3Street:"Address3Street",Address3City:"Address3City",Address3PostalCode:"Address3PostalCode",Address3CountryEn:"Address3CountryEn",Address3State:"Address3State",Address3POBox:"Address3POBox",InvoiceAddress:"InvoiceAddress",PostalAddress:"PostalAddress",Phone:"Phone",Mobile:"Mobile",Fax:"Fax",WebPage:"WebPage",TrackedDomains:"TrackedDomains",Email:"Email",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",ImportanceEn:"ImportanceEn",FirstContactEn:"FirstContactEn",LineOfBusiness:"LineOfBusiness",EmailOptOut:"EmailOptOut",MailingListOther:"MailingListOther",MailingListOtherValue:"MailingListOtherValue",Note:"Note",IsPrivate:"IsPrivate",NextStep:"NextStep",LastActivity:"LastActivity",AdditionalDiscount:"AdditionalDiscount"},k.Contacts={ProfilePicture:"ProfilePicture",Title:"Title",Email1Address:"Email1Address",Email2Address:"Email2Address",Email3Address:"Email3Address",DoNotSendNewsletter:"DoNotSendNewsletter",ImportanceEn:"ImportanceEn",PrefixEn:"PrefixEn",FirstName:"FirstName",MiddleName:"MiddleName",LastName:"LastName",SuffixEn:"SuffixEn",BusinessAddressStreet:"BusinessAddressStreet",BusinessAddressCity:"BusinessAddressCity",BusinessAddressPostalCode:"BusinessAddressPostalCode",BusinessAddressCountryEn:"BusinessAddressCountryEn",BusinessAddressState:"BusinessAddressState",BusinessAddressPoBox:"BusinessAddressPOBox",HomeAddressStreet:"HomeAddressStreet",HomeAddressCity:"HomeAddressCity",HomeAddressPostalCode:"HomeAddressPostalCode",HomeAddressCountryEn:"HomeAddressCountryEn",HomeAddressState:"HomeAddressState",HomeAddressPOBox:"HomeAddressPOBox",OtherAddressStreet:"OtherAddressStreet",OtherAddressCity:"OtherAddressCity",OtherAddressPostalCode:"OtherAddressPostalCode",OtherAddressCountryEn:"OtherAddressCountryEn",OtherAddressState:"OtherAddressState",OtherAddressPOBox:"OtherAddressPOBox",BusinessPhoneNumber:"TelephoneNumber1",BusinessPhoneNumber2:"TelephoneNumber5",BusinessFaxNumber:"TelephoneNumber6",MobilePhoneNumber:"TelephoneNumber3",HomePhoneNumber:"TelephoneNumber2",OtherPhoneNumber:"TelephoneNumber4",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",WebPage:"WebPage",Note:"Note",Department:"Department",Company:"Company",IsPrivate:"Private",NextStep:"NextStep",LastActivity:"LastActivity"},k.Leads={ID:"ID",FileAs:"FileAs",HumanID:"HID",Customer:"Customer",ContactPerson:"ContactPerson",Marketing:"Marketing",ReceiveDate:"ReceiveDate",Email:"Email",Phone:"Phone",Street:"Street",State:"State",CountryEn:"CountryEn",City:"City",POBox:"POBox",Zip:"Zip",Price:"Price",PriceChanged:"PriceChanged",CurrencyEn:k.Common.CurrencyEn,EstimatedEnd:"EstimatedEnd",Probability:"Probability",LeadOriginEn:"LeadOriginEn",PriceDefaultCurrency:"PriceDefaultCurrency",EstimatedValue:"EstimatedValue",EstimatedValueDefaultCurrency:"EstimatedValueDefaultCurrency",Note:"Note",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn",IsPrivate:"Private",EmailOptOut:"EmailOptOut",NextStep:"NextStep",LastActivity:"LastActivity",ItemVersion:"ItemVersion",EstimatedRevenue:"EstimatedRevenue",EstimatedRevenueDefaultCurrency:"EstimatedRevenueDefaultCurrency",CompletedDate:"CompletedDate",LostDate:"LostDate"},k.Documents={FileAs:"FileAs",DocName:"DocName",Preview:"Preview",PreviewWidth:"PreviewWidth",PreviewHeight:"PreviewHeight",DocTypeEn:"DocTypeEn",StateEn:"StateEn",ImportanceEn:"ImportanceEn",SuperiorItem:"SuperiorItem",SuperiorCompany:"Company",SuperiorContact:"Contact",DocSize:"DocSize",Extension:"Extension",CreationTime:"CreationTime",LastWriteTime:"LastWriteTime",IsPrivate:"Private",Note:"Note"},k.Emails={To:"To",From:"SenderEmailAddress",Cc:"Cc",Subject:"Subject",ImportanceEn:"ImportanceEn",SuperiorItem:"SuperiorItem",SentOn:"SentOn",ReceivedTime:"ReceivedTime",FileSize:"FileSize",AttachmentsCount:"AttachmentsCount",Note:"Note",SentimentTone:"SentimentTone",Summary:"Summary"},k.GoodsBase={Code:"Code",Structure:"Structure",Note:"Note",Description:"Description",TypeEn:"TypeEn",SaleCurrencyEn:"SaleCurrencyEn",PurchaseCurrencyEn:"PurchaseCurrencyEn",UnitEn:"UnitEn",PurchasePrice:"PurchasePrice",PurchasePriceDefaultCurrency:"PurchasePriceDefaultCurrency",PurchasePriceChanged:"PurchasePriceChanged",SalePrice:"SalePrice",SalePriceDefaultCurrency:"SalePriceDefaultCurrency",SalePriceChanged:"SalePriceChanged",IsPriceSum:"IsPriceSum",VATRate:"VATRate",VATIncluded:"VATIncluded"},k.Goods=Object.assign(Object.assign({},k.GoodsBase),{PriceListGroupGUID:"PriceListGroupGUID",InventoryQuantity:"InventoryQuantity"}),k.GoodsInCart=Object.assign(Object.assign({},k.GoodsBase),{Cart:"Cart",GoodsInfo:"GoodsInfo",SuperiorItem:"SuperiorItem",Quantity:"Quantity",PriceTotal:"PriceTotal",PriceTotalDefaultCurrency:"PriceTotalDefaultCurrency",PriceTotalParentCurrency:"PriceTotalParentCurrency",PriceTotalChanged:"PriceTotalChanged",PriceTotalExcludingVAT:"PriceTotalExcludingVAT",PriceTotalExcludingVATDefaultCurrency:"PriceTotalExcludingVATDefaultCurrency",PriceTotalExcludingVATParentCurrency:"PriceTotalExcludingVATParentCurrency",VATTotal:"VATTotal",VATTotalDefaultCurrency:"VATTotalDefaultCurrency",VATTotalParentCurrency:"VATTotalParentCurrency",SalePriceExcludingVAT:"SalePriceExcludingVAT",SalePriceExcludingVATDefaultCurrency:"SalePriceExcludingVATDefaultCurrency",SalePriceExcludingVATParentCurrency:"SalePriceExcludingVATParentCurrency",VAT:"VAT",VATDefaultCurrency:"VATDefaultCurrency",VATParentCurrency:"VATParentCurrency",PurchasePriceParentCurrency:"PurchasePriceParentCurrency",SalePriceParentCurrency:"SalePriceParentCurrency",ListPrice:"ListPrice",ListPriceDefaultCurrency:"ListPriceDefaultCurrency",ListPriceParentCurrency:"ListPriceParentCurrency",ListPriceChanged:"ListPriceChanged",Discount:"Discount",HierarchyInSet:"HierarchyInSet",IsFromSet:"IsFromSet",ParentGUID:"ParentGUID",Rank:"Rank",IncludeInCartPrice:"IncludeInCartPrice",ListPriceCustomized:"ListPriceCustomized",ChildItemsCount:"ChildItemsCount",JoinedToGUID:"JoinedToGUID",PurchasePriceTotal:"PurchasePriceTotal",PurchasePriceTotalDefaultCurrency:"PurchasePriceTotalDefaultCurrency",PurchasePriceTotalParentCurrency:"PurchasePriceTotalParentCurrency",PurchasePriceTotalChanged:"PurchasePriceTotalChanged"}),k.Journal={FileAs:"FileAs",Subject:"Subject",TypeEn:"TypeEn",StateEn:"StateEn",ImportanceEn:"ImportanceEn",EventStart:"EventStart",EventEnd:"EventEnd",SuperiorItem:"SuperiorItem",Company:"Company",Contact:"Contact",Marketing:"Marketing",IsSystem:"System",IsPrivate:"Private",Note:"Note",Phone:"Phone"},k.Vacation={StartDate:"StartDate",EndDate:"EndDate",User:"User",Duration:"Duration",Place:"Place",Note:"Note",AllDay:"AllDay",TypeEn:"TypeEn",StateEn:"StateEn",IsPrivate:"Private"},k.Marketing={HumanID:"HumanID",EstimatedStart:"EstimatedStart",EstimatedEnd:"EstimatedEnd",RealStart:"RealStart",RealEnd:"RealEnd",TargetGroup:"TargetGroup",EmailsSent:"EmailsSent",EmailsDelivered:"EmailsDelivered",EmailsViewed:"EmailsViewed",PeopleUnsubscribed:"PeopleUnsubscribed",FinalRevenues:"FinalRevenues",TypeEn:"TypeEn",StateEn:"StateEn"},k.Projects={HumanID:"HID",FileAs:"FileAs",ProjectName:"ProjectName",ProjectOriginEn:"ProjectOriginEn",TypeEn:"TypeEn",StateEn:"StateEn",PaymentTypeEn:"PaymentTypeEn",ProjectStart:"ProjectStart",ProjectRealEnd:"ProjectRealEnd",EstimatedEnd:"ProjectEnd",CurrencyEn:k.Common.CurrencyEn,DefaultCurrencyEn:"DefaultCurrencyEn",EstimatedMargin:"EstimatedMargin",EstimatedPeopleExpenses:"EstimatedPeopleExpenses",EstimatedPeopleExpensesDefaultCurrency:"EstimatedPeopleExpensesDefaultCurrency",EstimatedOtherExpenses:"EstimatedOtherExpenses",EstimatedOtherExpensesDefaultCurrency:"EstimatedOtherExpensesDefaultCurrency",EstimatedPrice:"EstimatedPrice",EstimatedPriceDefaultCurrency:"EstimatedPriceDefaultCurrency",EstimatedProfit:"EstimatedProfit",EstimatedProfitDefaultCurrency:"EstimatedProfitDefaultCurrency",EstimatedPriceChanged:"EstimatedPriceChanged",EstimatedPeopleExpensesChanged:"EstimatedPeopleExpensesChanged",EstimatedOtherExpensesChanged:"EstimatedOtherExpensesChanged",Delay:"Delay",EstimatedWorkHours:"EstimatedWorkHours",TotalWorkHours:"TotalWorkHours",PeopleExpenses:"PeopleExpenses",OtherExpenses:"OtherExpenses",PeopleExpensesDefaultCurrency:"PeopleExpensesDefaultCurrency",OtherExpensesDefaultCurrency:"OtherExpensesDefaultCurrency",PeopleExpensesChanged:"PeopleExpensesChanged",OtherExpensesChanged:"OtherExpensesChanged",Price:"Price",PriceDefaultCurrency:"PriceDefaultCurrency",Profit:"Profit",ProfitDefaultCurrency:"ProfitDefaultCurrency",Margin:"Margin",PriceChanged:"PriceChanged",SuperiorProject:"SuperiorProject",Customer:"Customer",ContactPerson:"ContactPerson",Users:"Users",ProjectManager:"ProjectManager",InvoicePaymentDate:"InvoicePaymentDate",PaymentMaturity:"PaymentMaturity",InvoiceIssueDate:"InvoiceIssueDate",LicensesCount:"LicensesCount",LicensePrice:"LicensePrice",LicensePriceDefaultCurrency:"LicensePriceDefaultCurrency",NextStep:"NextStep",LastActivity:"LastActivity",IsPrivate:"Private",LicensePriceChanged:"LicensePriceChanged",Note:"Note",CompletedDate:"CompletedDate",LostDate:"LostDate"},k.Tasks={FileAs:"FileAs",Subject:"Subject",RootItem:"RootItem",SuperiorItem:"SuperiorItem",Company:"Company",Contact:"Contact",StartDate:"StartDate",DueDate:"DueDate",Reminder:"Reminder",ReminderDate:"ReminderDate",ImportanceEn:"ImportanceEn",IsCompleted:"Complete",PercentComplete:"PercentComplete",PercentCompleteDecimal:"PercentCompleteDecimal",CompletedDate:"CompletedDate",Solver:"Solver",Delegator:"Delegator",Level:"Level",IsPrivate:"Private",ActualWorkHours:"ActualWorkHours",TotalWorkHours:"TotalWorkHours",Body:"Body",TypeEn:"TypeEn",StateEn:"StateEn"},k.Training={TitleEn:"TitleEn"},k.WorkReports={Task:"Task",ProjectName:"ProjectName",UserName:"UserName",Subject:"Subject",Date:"Date",FromTime:"FromTime",ToTime:"ToTime",Overtime:"Overtime",Month:"Month",Year:"Year",IsPrivate:"Private",Note:"Note",Duration:"Duration",WorkReportEn:"WorkReportEn",StateEn:"StateEn"},k.Users={ProfilePicture:"ProfilePicture",UserName:"UserName",JobTitle:"JobTitle",IDCardNumber:"IDCardNumber",Birthdate:"Birthdate",BirthPlace:"BirthPlace",PersonalIdentificationNumber:"PersonalIdentificationNumber",Active:"Active",FamilyStatusEn:"FamilyStatusEn",HomeAddressStreet:"HomeAddressStreet",HomeAddressCity:"HomeAddressCity",HomeAddressPostalCode:"HomeAddressPostalCode",HomeAddressCountryEn:"HomeAddressCountryEn",HomeAddressState:"HomeAddressState",HomeAddressPOBox:"HomeAddressPOBox",BankAccount:"BankAccount",BusinessPhoneNumber:"BusinessPhoneNumber",MobilePhoneNumber:"MobilePhoneNumber",Email1Address:"Email1Address",Email2Address:"Email2Address",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",IdentificationNumber:"IdentificationNumber",HealthInsurance:"HealthInsurance",HolidayLength:"HolidayLength",RemainingDaysOfHoliday:"RemainingDaysOfHoliday",SalaryDateEn:"SalaryDateEn",Supervisor:"Supervisor",TravelDistance:"TravelDistance",TimeAccessibility:"TimeAccessibility",TransportMode:"TransportMode",WorkdayStartTime:"WorkdayStartTime",Note:"Note",IsSystem:"IsSystem"},k.Groups={IsAdmin:"IsAdmin",GroupName:"GroupName",FileAs:"FileAs",Description:"Description",IsPM:"IsPM",System:"System",IsRole:"IsRole",IsCategory:"IsCategory",DisallowControlModulePermissions:"DisallowControlModulePermissions",DisallowControlColumnPermissions:"DisallowControlColumnPermissions",IsOutlookCategory:"IsOutlookCategory",DisallowControlUserAssignment:"DisallowControlUserAssignment",ColorEn:"ColorEn",Picture:"Picture"},k.PriceListGroups={Note:"Note"},k.Prices={SalePriceGUID:"SalePriceGUID",GoodsItemGUID:"GoodsItemGUID",Price:"Price",CurrencyEn:"CurrencyEn"},k.SalePrices={Note:"Note",Discount:"Discount",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn"},k.XsltTransformations={LangCode:"LangCode",Definition:"Definition",Namespace:"Namespace",ObjectTypeID:"ObjectTypeID",TransformationVersion:"TransformationVersion"},k.XsltTransformationsModels={ObjectTypeID:"ObjectTypeID",TransformationGUID:"TransformationGUID",ItemTypeGUID:"ItemTypeGUID"},k.allTypeEnNames=["TypeEn",k.Documents.DocTypeEn,k.WorkReports.WorkReportEn,"TitleEn"],k.getFolderFileAs=e=>{switch(e){case m.leads:return k.Leads.FileAs;case m.projects:return k.Projects.ProjectName;case m.documents:return k.Documents.DocName;case m.companies:return k.Companies.CompanyName;case m.contacts:case m.users:return k.Common.FileAs;case m.emails:return k.Emails.Subject;case m.journal:return k.Journal.FileAs;case m.tasks:return k.Tasks.Subject;case m.workReports:return k.WorkReports.Subject;case m.vacation:return k.Vacation.TypeEn;case m.carts:case m.goods:case m.goodsInCart:return k.Common.FileAs;case m.groups:return k.Groups.GroupName;case m.xsltTransformations:return k.Common.FileAs;default:return console.warn(`FileAs col name not defined for folderName ${e}`),k.Common.FileAs}};class b{}b.general="GENERAL",b.group="GROUP",b.contactPerson="CONTACTPERSON",b.contact="CONTACT",b.customer="CUSTOMER",b.company="COMPANY",b.outlookProject="OUTLOOKPROJECT",b.supervisor="SUPERVISOR",b.projectOrigin="PROJECT_ORIGIN",b.cart="CART",b.goodsInCart="GOODSINCART";class D{}D.all="All",D.own="Own",D.readonly="Readonly",D.invisible="Invisible",D.none="None";class w{}var x,F,O,N;w.mandatory="Mandatory",w.optional="Optional",w.unique="Unique",w.none="None",exports.Edition=void 0,(x=exports.Edition||(exports.Edition={})).Free="Free",x.Basic="Basic",x.Professional="Professional",x.Enterprise="Enterprise",exports.Feature=void 0,(F=exports.Feature||(exports.Feature={})).ContactsAndCompanies="ContactsAndCompanies",F.Sales="Sales",F.Projects="Projects",F.Marketing="Marketing",exports.SentimentTone=void 0,(O=exports.SentimentTone||(exports.SentimentTone={}))[O.Negative=0]="Negative",O[O.Neutral=1]="Neutral",O[O.Positive=2]="Positive";class R{}R.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",R.wordAddin="WordAddin",R.excelAddin="ExcelAddin",R.tasksRecurrentTasks="TasksRecurrentTasks",R.tasksSubtasks="TasksSubtasks",R.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",R.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",R.emailsAutomaticTracking="EmailsAutomaticTracking",R.convertEmailToProject="ConvertEmailToProject",R.duplicityChecker="DuplicityChecker",R.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",R.subProjects="SubProjects",R.resourceAndPlanning="ResourceAndPlanning",R.professionalEmailCampaigns="ProfessionalEmailCampaigns",R.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",R.wordEmailMerge="WordEmailMerge",R.printLabels="PrintLabels",R.printEnvelopes="PrintEnvelopes",R.userViews="UserViews",R.sharedUserViews="SharedUserViews",R.gridConditionalFormating="GridConditionalFormating",R.multipleCurrencies="MultipleCurrencies",R.historyTracking="HistoryTracking",R.privateItems="PrivateItems",R.itemTypes="ItemTypes",R.formLayoutCustomization="FormLayoutCustomization",R.workflowBasicDefinitions="WorkflowBasicDefinitions",R.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",R.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",R.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",R.workflowGroupLevelActions="WorkflowGroupLevelActions",R.customFields="CustomFields",R.importantFields="ImportantFields",R.mandatoryFields="MandatoryFields",R.uniqueFields="UniqueFields",R.readOnlyFields="ReadOnlyFields",R.transformationCustomTemplates="TransformationCustomTemplates",R.userRoles="UserRoles",R.modulePermissions="ModulePermissions",R.columnPermissions="ColumnPermissions",R.api="API",R.gate="Gate",R.threeCXIntegration="ThreeCXIntegration",R.tapiIntegration="TapiIntegration",R.pohodaIntegration="PohodaIntegration",R.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",R.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",R.quickBooksIntegration="QuickBooksIntegration",R.saveBinaryDataOnDisk="SaveBinaryDataOnDisk",R.activeDirectoryLogin="ActiveDirectoryLogin",R.callerIdentificationOnApple="CallerIdentificationOnApple",R.legacyAdministration="LegacyAdministration";class M{}M.customAdditionalFieldsCount="CustomAdditionalFieldsCount",M.customEnabledAdvancedWorkflowsCount="CustomEnabledAdvancedWorkflowsCount",M.customEnabledBasicWorkflowsCount="CustomEnabledBasicWorkflowsCount",M.customMandatoryFieldsCount="CustomMandatoryFieldsCount",M.customOptionalFieldsCount="CustomOptionalFieldsCount",M.customReadonlyFieldsCount="CustomReadonlyFieldsCount",M.customUniqueFieldsCount="CustomUniqueFieldsCount",M.customVisibleTypesCount="CustomVisibleTypesCount",M.visibleCurrenciesCount="VisibleCurrenciesCount";class _{}_.contactsAutomaticSynchronizationWithOutlook="ContactsAutomaticSynchronizationWithOutlook",_.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",_.contactsSynchronizationWithAndroid="ContactsSynchronizationWithAndroid",_.documentsRevisions="DocumentsRevisions",_.wordAddin="WordAddin",_.excelAddin="ExcelAddin",_.tasksReminders="TasksReminders",_.tasksRecurrentTasks="TasksRecurrentTasks",_.tasksSubtasks="TasksSubtasks",_.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",_.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",_.emailsManualTracking="EmailsManualTracking",_.emailsAutomaticTracking="EmailsAutomaticTracking",_.emailSummaryAndSentimentToneFromAi="EmailSummaryAndSentimentToneFromAi",_.convertEmailToContact="ConvertEmailToContact",_.convertEmailToDeal="ConvertEmailToDeal",_.convertEmailToProject="ConvertEmailToProject",_.convertEmailToTask="ConvertEmailToTask",_.convertFromSuggestedContact="ConvertFromSuggestedContact",_.gravatarIntegration="GravatarIntegration",_.logoboxIntegration="LogoboxIntegration",_.companiesBussinesRegisterApiIntegration="CompaniesBussinesRegisterApiIntegration",_.duplicityChecker="DuplicityChecker",_.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",_.subProjects="SubProjects",_.resourceAndPlanning="ResourceAndPlanning",_.professionalEmailCampaigns="ProfessionalEmailCampaigns",_.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",_.wordEmailMerge="WordEmailMerge",_.printLabels="PrintLabels",_.printEnvelopes="PrintEnvelopes",_.userViews="UserViews",_.sharedUserViews="SharedUserViews",_.gridRowSummary="GridRowSummary",_.gridConditionalFormating="GridConditionalFormating",_.multipleCurrencies="MultipleCurrencies",_.historyTracking="HistoryTracking",_.privateItems="PrivateItems",_.itemTypes="ItemTypes",_.formLayoutCustomization="FormLayoutCustomization",_.workflowBasicDefinitions="WorkflowBasicDefinitions",_.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",_.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",_.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",_.workflowGroupLevelActions="WorkflowGroupLevelActions",_.customFields="CustomFields",_.importantFields="ImportantFields",_.mandatoryFields="MandatoryFields",_.uniqueFields="UniqueFields",_.readOnlyFields="ReadOnlyFields",_.transformationCustomTemplates="TransformationCustomTemplates",_.userRoles="UserRoles",_.modulePermissions="ModulePermissions",_.columnPermissions="ColumnPermissions",_.commonDataAPI="CommonDataAPI",_.eWayCrmAPI="eWayCrmAPI",_.threeCXIntegration="ThreeCXIntegration",_.tapiIntegration="TapiIntegration",_.pohodaIntegration="PohodaIntegration",_.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",_.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",_.quickBooksIntegration="QuickBooksIntegration",_.shareByTeams="ShareByTeams",_.convertEmailToContactWithDataFromAi="ConvertEmailToContactWithDataFromAi",_.convertEmailToDealWithDataFromAi="ConvertEmailToDealWithDataFromAi",_.convertEmailToProjectWithDataFromAi="ConvertEmailToProjectWithDataFromAi",function(e){e.UnpaidImportantInvoices="UnpaidImportantInvoices",e.UncollectableSubscriptionPayment="UncollectableSubscriptionPayment",e.UncollectableSubscriptionPaymentWithExpiredCard="UncollectableSubscriptionPaymentWithExpiredCard",e.StandardSubscriptionPeriod="StandardSubscriptionPeriod"}(N||(N={}));var L,V=N;!function(e){e.License="License",e.CloudLicense="CloudLicense",e.MiscLicense="MiscLicense",e.Support="Support",e.Service="Service"}(L||(L={}));var G=L;class U{}U.getIsDebug=e=>{var t;return!!(null===(t=null==e?void 0:e.sessionHandler.lastSuccessfulLoginResponse)||void 0===t?void 0:t.Debug)},U.supportsFeaturesOf=(e,t)=>{var r;const s=null===(r=e.sessionHandler.lastSuccessfulLoginResponse)||void 0===r?void 0:r.WcfVersion;return!!s&&U.supportsVersionFeaturesOf(s,t)},U.supportsVersionFeaturesOf=(e,t)=>s.compare(e,t,">=")||s.compare(e,"1.0.0.0","=");class j{}j.textBox="TextBox",j.comboBox="ComboBox",j.numericBox="NumericBox",j.relation="Relation",j.checkBox="CheckBox",j.linkTextBox="LinkTextBox",j.dateEdit="DateEdit",j.memoBox="MemoBox",j.multiSelectComboBox="MultiSelectComboBox",j.workflowState="WorkflowState",j.image="Image",j.multiSelectRelation="MultiSelectRelation";const B={[m.relations]:0,[m.unifiedRelations]:1,[m.users]:2,[m.groups]:3,[m.enumTypes]:4,[m.enumValues]:5,[m.additionalFields]:6};var W,H,z,Q;exports.Version=void 0,(W=exports.Version||(exports.Version={})).Version75="7.5",W.Version76="7.6",W.Version77="7.7",W.Version81="8.1",W.Version82="8.2",W.Version83="8.3",W.Version90="9.0",W.Version91="9.1",W.Version92="9.2";class $ extends U{}$.is75OrLater=e=>U.supportsFeaturesOf(e,exports.Version.Version75),$.is76OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version76),$.is77OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version77),$.is81OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version81),$.is82OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version82),$.is83OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version83),$.is90OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version90),$.is91OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version91),$.is92OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version92),$.isFeatureSupported=(e,t)=>$.supportsFeaturesOf(e,t);class q{static createHubItemsCountsQuery(e,t,r){return{__type:"HubItemsCountsQuery:#EQ",ParentItemGuids:e,ItemTypes:t,ExcludeSystemItems:r}}static createRelatedTableQuery(e,t,r){return{__type:r?"RelatedTableQuery:#EQ":"TypelessRelatedTableQuery:#EQ",BaseItemID:e,ItemTypes:Array.isArray(t)?t:[t],RelationType:r}}static createMainTableQuery(e){return{__type:"MainTableQuery:#EQ",ItemTypes:Array.isArray(e)?e:[e]}}}q.column=e=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}),q.multiSelectComboColumnLegacy=(e,t,r)=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues]({0}, '${e}', '${t}'`,Alias:null!=r?r:e}),q.multiSelectComboColumn=(e,t,r,s,o)=>{if(!$.is77OrLater(e))return q.multiSelectComboColumnLegacy(r,s,o);return{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues_WithObjectTypeID]({0}, dbo.GetObjectTypeID('${t}'), '${r}', '${s}')`,Alias:null!=o?o:r}},q.joinColumn=(e,t,r,s,o)=>{const n={__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:e,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:t},TargetColumnName:o},Name:r};return s&&(n.Alias=s),n},q.singleVariatedColumn=(e,t,r)=>q.variatedColumn([q.columnVariation(e,t)],r),q.variatedColumn=(e,t)=>{const r={__type:"VariatedColumn:#EQ",Source:{__type:"MainTable:#EQ"},Variations:e};return t&&(r.Alias=t),r},q.columnVariation=(e,t,r)=>{const s={FolderName:t,Field:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}};return r&&(s.Field.Transformation=r),s},q.joinColumnVariation=(e,t,r,s)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:t,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:r}},Name:s}}),q.relationColumnVariation=(e,t,r,s)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:t,Direction:1,ItemTypes:r},Name:s}}),q.relatedColumn=(e,t,r,s)=>{const o={__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r};return s&&(o.Alias=s),o},q.relatedSubstituableColumn=(e,t,r,s,o)=>{const n={__type:"SubstituableColumn:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r,Substitute:s};return o&&(n.Alias=o),n},q.relatedColumnFolderNameToken=(e,t,r)=>({__type:"Token:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},TypeName:"ItemType",Alias:r}),q.folderNameToken=e=>({__type:"Token:#EQ",Source:{__type:"MainTable:#EQ"},TypeName:"ItemType",Alias:null!=e?e:"FolderName"}),q.equalsFilterExpression=(e,t)=>({__type:"EqualsFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.notEqualsExpression=(e,t)=>({__type:"NotFilterExpression:#EQ",Child:q.equalsFilterExpression(e,t)}),q.andFilterExpression=e=>({__type:"AndFilterExpressionOperator:#EQ",Children:e}),q.orFilterExpression=e=>({__type:"OrFilterExpressionOperator:#EQ",Children:e}),q.lessFilterExpression=(e,t)=>({__type:"LessFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.lessOrEqualFilterExpression=(e,t)=>({__type:"LessOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.greaterFilterExpression=(e,t)=>({__type:"GreaterFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.greaterOrEqualFilterExpression=(e,t)=>({__type:"GreaterOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.likeFilterExpression=(e,t)=>({__type:"LikeFilterExpressionPredicate:#EQ",Field:e,Value:`%${t}%`}),q.inFilterExpression=(e,t)=>({__type:"InFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.isNullOrEmptyFilterExpression=e=>q.orFilterExpression([q.equalsFilterExpression(q.column(e),null),q.equalsFilterExpression(q.column(e),"")]);class J{static toRfc3339String(e){const t=e=>e<10?`0${e}`:String(e);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}${(e=>{if(0===e)return"Z";const r=e>0?"-":"+";return e=Math.abs(e),`${r}${t(Math.floor(e/60))}:${t(e%60)}`})(e.getTimezoneOffset())}`}}J.isValid=e=>e instanceof Date&&!isNaN(e.getTime()),J.areDaysEqual=(e,t)=>{const r=J.clearTime(e),s=J.clearTime(t);return r.getTime()===s.getTime()},J.areTimesEqual=(e,t)=>e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes(),J.areDatesEqual=(e,t)=>!!e&&!!t&&J.areDaysEqual(e,t)&&J.areTimesEqual(e,t),J.clearTime=e=>{const t=new Date(e);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},J.isWithoutTime=e=>0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds(),J.getFormattedSqlDateTime=e=>e.toISOString().slice(0,19).replace("T"," "),J.getRfcWithoutTimezone=e=>e.slice(0,19),exports.TransformItemFormats=void 0,(H=exports.TransformItemFormats||(exports.TransformItemFormats={})).OpenXmlDocx="OpenXmlDocx",H.Pdf="Pdf",H.WordMlXml="WordMlXml";exports.EnumTypeEditMode=void 0,(z=exports.EnumTypeEditMode||(exports.EnumTypeEditMode={})).Readonly="Readonly",z.VisibleRankDefaultOnly="VisibleRankDefaultOnly",z.Editable="Editable",exports.ImportResult=void 0,(Q=exports.ImportResult||(exports.ImportResult={})).Success="Success",Q.Failure="Failed",Q.FailureDuplicityFound="Failed_DuplicityFound",Q.FailureItemAlreadyRemoved="Failed_ItemAlreadyRemoved",Q.FailureColumnsLockedWFAction="Failed_ColumnsLocked",Q.FailureItemLockedWFAction="Failed_ItemLocked",Q.FailureLicenceLimitReached="Failed_LicenseLimitReached",Q.FailureInssuficientModulePermission="Failed_InsufficientModulePermission",Q.FailureInssuficientColumnsPermission="Failed_InsufficientColumnsPermission",c.polyfill(),exports.ApiConnectionAsNonDefaultExport=S,exports.ApiMethods=p,exports.ColumnPermissionMandatoryRules=w,exports.ColumnPermissionPermissionRules=D,exports.CommonDataConnection=class{constructor(e,t){this.isCommonDataApiEnabled=(e,t)=>{this.tokenizedConnection.isEnabled(e,t)},this.callCommonDataApi=(e,t,r,s)=>{this.tokenizedConnection.callTokenizedApi(e,t,r,s)},this.tokenizedConnection=new A("ObtainCommonDataApiAccessToken",exports.HttpMethod.get,!1,"InvalidCommonDataToken",I,e,t)}},exports.CustomizationStatsItemKeys=M,exports.DateHelper=J,exports.EWItem=class{constructor(e,t){if(!e||!t)throw new Error("Both folderName and baseItem has to be defined!");this.folderName=e,this.baseItem=t}getEmailAddress(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return e.Email1Address||e.Email2Address||e.Email3Address}case m.leads:return this.baseItem.Email;case m.companies:return this.baseItem.Email;case m.users:{const e=this.baseItem;return e.Email1Address||e.Email2Address}default:return null}}getInitials(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}case m.users:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}default:return null}}getInitialsInternal(e,t){const r=((null==e?void 0:e.substr(0,1))||"")+((null==t?void 0:t.substr(0,1))||"");return""==r?null:r}getItemPreview(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}case m.users:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}default:return null}}},exports.EnumTypes=d,exports.ErrorHelper=E,exports.ExpirationReason=V,exports.FieldNames=k,exports.FieldTypes=j,exports.FolderNames=m,exports.Functionality=R,exports.GlobalSettingsNames=v,exports.HttpRequestError=T,exports.LicenseKeyInvoiceSeverity=G,exports.LicenseRestrictionKeys=_,exports.OAuthHelper=C,exports.OAuthSessionHandlerBase=f,exports.ObjectTypeIds=B,exports.QueryHelper=q,exports.RelationTypes=b,exports.ReturnCodes=u,exports.StringHelper=class{static trim(e,t,r=!1){if(null==e)return e;let s=e.trim();return s.length<=t||(s=s.substring(0,t-(r?3:0)),r&&(s+="...")),s}},exports.TokenizedServiceConnection=A,exports.VersionHelper=$,exports.VersionHelperBase=U,exports.default=S;
8
+ */class u{}u.rcSuccess="rcSuccess",u.rcBadSession="rcBadSession",u.rcDuplicateContact="rcDuplicateContact",u.rcWebServiceMoved="rcWebServiceMoved",u.rcAccessDenied="rcAccessDenied",u.rcLoginUserNameChanged="rcLoginUserNameChanged",u.rcLicenseExpired="rcLicenseExpired",exports.HttpMethod=void 0,(a=exports.HttpMethod||(exports.HttpMethod={})).get="get",a.post="post";class d{}d.absence="Absence",d.bonusType="BonusType",d.busyStatus="BusyStatus",d.cartType="CartType",d.companyType="CompanyType",d.contactType="ContactType",d.countryCode="CountryCode",d.currency="Currency",d.customFieldCategory="CustomFieldCategory",d.dayType="DayType",d.documentOfflineState="DocumentOfflineState",d.documentType="DocumentType",d.emailCampaignWorkflowStatus="EmailCampaignWorkflowStatus",d.emailOfflineState="EmailOfflineState",d.emailType="EmailType",d.familyStatus="FamilyStatus",d.firstContact="FirstContact",d.globalSettingsCategory="GlobalSettingsCategory",d.goalType="GoalType",d.groupColor="GroupColor",d.importance="Importance",d.journalType="JournalType",d.knowledgeLevel="KnowledgeLevel",d.knowledgeTitle="KnowledgeTitle",d.knowledgeType="KnowledgeType",d.leadType="LeadType",d.marketingType="MarketingType",d.paymentType="PaymentType",d.prefixType="PrefixType",d.productType="ProductType",d.projectOrigin="ProjectOrigin",d.projectType="ProjectType",d.reportCategory="ReportCategory",d.responseForm="ResponseForm",d.responseType="ResponseType",d.salaryDate="SalaryDate",d.salaryType="SalaryType",d.salePriceType="SalePriceType",d.sentimentTone="SentimentTone",d.suffixType="SuffixType",d.taskImportance="TaskImportance",d.tasksSnoozePeriod="TasksSnoozePeriod",d.taskStatus="TaskStatus",d.taskType="TaskType",d.trainingGrade="TrainingGrade",d.trainingTitle="TrainingTitle",d.translations="Translations",d.units="Units",d.userType="UserType",d.usStatesDistrictsTerritories="USStatesDistrictsTerritories",d.vacationType="VacationType",d.vat="VAT",d.workLoad="WorkLoad",d.workReportType="WorkReportType";class m{}m.isValidFolderName=e=>Object.values(m).includes(e),m.actions="Actions",m.additionalFields="AdditionalFields",m.bonuses="Bonuses",m.calendar="Calendar",m.capacityNotes="CapacityNotes",m.capacityNoteTypes="CapacityNoteTypes",m.carts="Carts",m.columnPermissions="ColumnPermissions",m.companies="Companies",m.contacts="Contacts",m.contactsSuggestions="ContactsSuggestions",m.currencyExchangeRates="CurrencyExchangeRates",m.documents="Documents",m.emails="Emails",m.enumTypes="EnumTypes",m.enumValues="EnumValues",m.enumValuesRelations="EnumValuesRelations",m.features="Features",m.flows="Flows",m.globalSettings="GlobalSettings",m.goals="Goals",m.goods="Goods",m.goodsInCart="GoodsInCart",m.goodsInSet="GoodsInSet",m.groups="Groups",m.history="History",m.holidays="Holidays",m.children="Children",m.individualDiscounts="IndividualDiscounts",m.invoiceItems="InvoiceItems",m.invoices="Invoices",m.itemCopyRelations="ItemCopyRelations",m.journal="Journal",m.knowledge="Knowledge",m.layouts="Layouts",m.layoutsModels="LayoutsModels",m.leads="Leads",m.ledger="Ledger",m.mappings="Mappings",m.marketing="Marketing",m.marketingList="MarketingList",m.marketingListSources="MarketingListSources",m.models="Models",m.modulePermissions="ModulePermissions",m.objectTypesOptions="ObjectTypesOptions",m.payments="Payments",m.priceListGroups="PriceListGroups",m.projectAssignments="ProjectAssignments",m.projectAssignmentsPerUserProject="ProjectAssignmentsPerUserProject",m.projectAssignmentsTotal="ProjectAssignmentsTotal",m.projectAssignmentsTotalUserProject="ProjectAssignmentsTotalUserProject",m.projectList="ProjectList",m.projects="Projects",m.projectUsersInCaPlan="ProjectUsersInCaPlan",m.relationData="RelationData",m.relations="Relations",m.reports="Reports",m.revisionsHistory="RevisionsHistory",m.salaries="Salaries",m.salePrices="SalePrices",m.prices="Prices",m.sqlObjects="SqlObjects",m.tasks="Tasks",m.recurrencePatterns="RecurrencePatterns",m.teamRoles="TeamRoles",m.templates="Templates",m.training="Training",m.unifiedRelations="UnifiedRelations",m.users="Users",m.userSettings="UserSettings",m.vacation="Vacation",m.webAccess2Options="WebAccess2Options",m.webAccessOptions="WebAccessOptions",m.workCommitments="WorkCommitments",m.workflowHistory="WorkflowHistory",m.workReports="WorkReports",m.wrongClientVersions="WrongClientVersions",m.xsltTransformations="XsltTransformations",m.xsltTransformationsModels="XsltTransformationsModels",m.getEnumTypeName=e=>e===m.bonuses?d.bonusType:e===m.carts?d.cartType:e===m.companies?d.companyType:e===m.contacts?d.contactType:e===m.documents?d.documentType:e===m.emails?d.emailType:e===m.goals?d.goalType:e===m.goods?d.productType:e===m.journal?d.journalType:e===m.knowledge?d.knowledgeType:e===m.leads?d.leadType:e===m.marketing?d.marketingType:e===m.projects?d.projectType:e===m.salaries?d.salaryType:e===m.salePrices?d.salePriceType:e===m.tasks?d.taskType:e===m.training?d.trainingTitle:e===m.users?d.userType:e===m.vacation?d.vacationType:e===m.workReports?d.workReportType:null,m.getFolderNameByEnumTypeName=e=>e===d.bonusType?m.bonuses:e===d.cartType?m.carts:e===d.companyType?m.companies:e===d.contactType?m.contacts:e===d.documentType?m.documents:e===d.emailType?m.emails:e===d.goalType?m.goals:e===d.journalType?m.journal:e===d.knowledgeType?m.knowledge:e===d.leadType?m.leads:e===d.marketingType?m.marketing:e===d.productType?m.goods:e===d.projectType?m.projects:e===d.salaryType?m.salaries:e===d.salePriceType?m.salePrices:e===d.taskType?m.tasks:e===d.trainingTitle?m.training:e===d.userType?m.users:e===d.vacationType?m.vacation:e===d.workReportType?m.workReports:null;class p{}p.getAllEmailAttachments="GetAllEmailAttachments",p.getCalendarsByItemGuids="GetCalendarsByItemGuids",p.getEmailAttachment="GetEmailAttachment",p.getItemPreview="GetItemPreview",p.getJournalsByItemGuids="GetJournalsByItemGuids",p.getMarketingCampaignsByItemGuids="GetMarketingCampaignsByItemGuids",p.getMarketingListsRecordsByItemGuids="GetMarketingListsRecordsByItemGuids",p.getRevisionHistoryRecordsByItemGuids="GetRevisionHistoryRecordsByItemGuids",p.getVacationsByItemGuids="GetVacationsByItemGuids",p.getWorkflowHistoryRecordsByItemGuids="GetWorkflowHistoryRecordsByItemGuids",p.getCompanyInformationFromTaxRegister="GetCompanyInformationFromTaxRegister",p.logIn="LogIn",p.logOut="LogOut",p.query="Query",p.queryAmount="QueryAmount",p.getServiceAuthSettings="GetServiceAuthSettings",p.getVersion="GetVersion",p.getBinaryAttachment="GetBinaryAttachment",p.getBinaryAttachmentLatestRevision="GetBinaryAttachmentLatestRevision",p.transformItem="TransformItem",p.canUnlinkItems="CanUnlinkItems",p.unlinkItems="UnlinkItems",p.getGoodsFinalPrices="GetGoodsFinalPrices",p.saveItemCopyRelation="SaveItemCopyRelation",p.getFolderNameForApiMethod=e=>{switch(e){case m.calendar:return"Calendars";case m.journal:return"Journals";case m.marketing:return"MarketingCampaigns";case m.marketingList:return"MarketingListsRecords";case m.revisionsHistory:return"RevisionHistoryRecords";case m.vacation:return"Vacations";case m.workflowHistory:return"WorkflowHistoryRecords";default:return e}},p.getGetFolderNameByItemGuidsMethodName=e=>`Get${p.getFolderNameForApiMethod(e)}ByItemGuids`,p.getGetFolderNameMethodName=e=>`Get${p.getFolderNameForApiMethod(e)}`,p.getSearchFolderNameMethodName=e=>`Search${p.getFolderNameForApiMethod(e)}`;class y{constructor(e,t,r,s,o,n){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{e.callWithoutSession(p.logIn,{userName:this.username,passwordHash:this.passwordHash,appVersion:this.appVersion,clientMachineIdentifier:this.clientMachineIdentifier,clientMachineName:this.clientMachineName,createSessionCookie:e.supportsGetItemPreviewMethod},(e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(r)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(e)}}),(e=>{const t=new Error("Unable to login. Error response follows.\n"+JSON.stringify(e));if(!this.errorCallback)throw t;this.errorCallback(t)}))},!e||!t)throw new Error("Non of the arguments 'username', 'passwordHash' can be empty.");this.username=e,this.passwordHash=t,this.appVersion=r,this.clientMachineIdentifier=s,this.clientMachineName=o,this.errorCallback=n}}class h{constructor(){this.getSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")},this.invalidateSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")}}}class C{static createAuthorizeUrl(e,t,r,s,o,n,i=!1){if(o&&!n||!o&&n)throw new Error("If codeChallenge is defined, codeChallengeMethod must also be defined and vice versa");let a=`https://login.eway-crm.${i?"dev":"com"}?scope=${encodeURIComponent(t.join(" "))}&prompt=login&response_type=code&redirect_uri=${encodeURIComponent(r)}&client_id=${e}`;return s&&(a+=`&state=${encodeURIComponent(s)}`),o&&n&&(a+=`&code_challenge=${encodeURIComponent(o)}&code_challenge_method=${encodeURIComponent(n)}`),a}}C.finishAuthorization=(e,t,r,s,o,n,i)=>{const a=new URLSearchParams;a.append("code_verifier",s),a.append("client_id",t),a.append("client_secret",r),a.append("code",o),a.append("redirect_uri",n),a.append("grant_type","authorization_code"),C.callTokenEndpoint(e,a,i)},C.refreshToken=(e,t,r,s,o)=>{const n=new URLSearchParams;n.append("client_id",t),n.append("client_secret",r),n.append("refresh_token",s),n.append("grant_type","refresh_token"),C.callTokenEndpoint(e,n,o)},C.getWebServiceUrl=e=>{const t=e.split(".");if(2!==t.length)throw new Error("Invalid token supplied");return n.decode(t[1])},C.getUserName=e=>C.decodeAccessToken(e).username,C.decodeAccessToken=e=>r(e),C.callTokenEndpoint=(t,r,s)=>{e.post(t+"/auth/connect/token",r,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((e=>{s(e.data)})).catch((e=>{e.response&&400==e.response.status?s(e.response.data):s({error:"Token request failed"})}))};class P extends Error{constructor(e,t){super(),this.returnCode=e,this.message=t}}class f{constructor(e,t,r,s,o){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{const r={userName:this.username,appVersion:this.appVersion,createSessionCookie:e.supportsGetItemPreviewMethod},s={Authorization:"Bearer "+this.accessToken};e.callWithoutSession(p.logIn,r,(e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(r)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(e)}}),(e=>{const t=new P(e.ReturnCode,"Unable to login. Error response follows.\n"+JSON.stringify(e));if(!this.errorCallback)throw t;this.errorCallback(t)}),s,void 0,(r=>{if(401!==(null==r?void 0:r.statusCode)){if(!this.errorCallback)throw r;this.errorCallback(r)}else this.getNewAccessTokenCallback(e,(r=>{this.accessToken=r.accessToken,r.error||this.getSessionId(e,t)}))}))},!e)throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");this.username=e,this.accessToken=t,this.appVersion=r,this.getNewAccessTokenCallback=s,this.errorCallback=o}}class g extends f{constructor(e,t,r,s,o,n,i,a){if(!(e&&s&&t&&r))throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");super(e,o,n,((e,t)=>{C.refreshToken(e.wsUrl,this.clientId,this.clientSecret,this.refreshToken,(e=>{try{this.refreshTokenCallback&&this.refreshTokenCallback(e)}catch(e){this.errorCallback&&this.errorCallback(new Error("Refresh token callback failed.\n"+JSON.stringify(e)))}void 0!==e.error?t({error:e.error}):t({accessToken:e.access_token})}))}),i),this.refreshToken=s,this.clientId=t,this.clientSecret=r,this.refreshTokenCallback=a}}class T extends Error{constructor(e,t){super(),this.statusCode=e,this.message=t}}class E{}E.stringifyError=e=>JSON.stringify(e,E.replaceErrors),E.replaceErrors=(e,t)=>{if(t instanceof Error){const e={};return Object.getOwnPropertyNames(t).forEach((r=>{e[r]=t[r]})),e}return t};class S{constructor(t,r,s,o){if(this.ensureLogin=()=>new Promise(((e,t)=>{if(this.sessionId)e();else{const r=r=>{r&&(this.sessionId=r,e()),t("Session Id cannot be empty")};this.sessionHandler.getSessionId(this,r)}})),this.createOpenLink=(e,t,r,s)=>{const o=n.encode(this.baseUri);let i="eway://"+t;r&&(i+="/"+(null==r?void 0:r.toLowerCase()));const a=e?"open.eway-crm.dev":"open.eway-crm.com";i=n.encode(i);let l="https://"+a+"/?ws="+o+"&l="+i;return s&&(l+="&n="+encodeURIComponent(s)),l},this.askUploadMethod=(e,t,r,s,o)=>new Promise(((n,i)=>{const a=o?e=>{throw i(e),e}:i;this.callUploadMethod(e,t,r,n,a,a,s)})),this.callUploadMethod=(t,r,s,o,n,i,a)=>{const l=()=>{this.sessionHandler.getSessionId(this,(e=>{this.sessionId=e,this.callUploadMethod(t,r,s,o,n,i,a)}))},c=this.sessionId;if(!c)return void l();const d=`${this.svcUri}/SaveBinaryAttachment?sessionId=${this.sessionId}&itemGuid=${t}&fileName=${encodeURIComponent(r)}`,m=e.post(d,s,a);S.handleCallPromise(m,o,(e=>{if(e.ReturnCode===u.rcBadSession)return this.sessionId=null,void this.sessionHandler.invalidateSessionId(c,l);if(n)n(e);else{const t=new Error("Unhandled connection return code "+e.ReturnCode+": "+e.Description);if(!this.errorCallback)throw t;this.errorCallback(t)}}),(e=>{let t=new Error("Unhandled connection error when calling "+d+": "+E.stringifyError(e));if("statusCode"in e&&413===e.statusCode&&(t=new Error("The file has exceeded the maximum allowed file size for uploading. You can contact your IT administrator or eWay-CRM support if you would like to increase the limit.")),i)i(t);else{if(!this.errorCallback)throw t;this.errorCallback(t)}}))},this.askMethod=(e,t,r,s)=>new Promise(((o,n)=>{const i=s?e=>{throw n(e),e}:n;this.callMethod(e,t,o,i,r,i)})),this.callMethod=(e,t,r,s,o,n)=>{o||(o=exports.HttpMethod.post);const i=()=>{this.sessionHandler.getSessionId(this,(i=>{this.sessionId=i,this.callMethod(e,t,r,s,o,n)}))},a=this.sessionId;if(!a)return void i();t.sessionId=a;const l=e!==p.logOut?r:e=>{this.sessionId=null,r(e)};this.callWithoutSession(e,t,l,(r=>{if(r.ReturnCode!==u.rcBadSession||(this.sessionId=null,e===p.logOut))if(s)s(r);else{const e=new Error("Unhandled connection return code "+r.ReturnCode+": "+r.Description);if(!this.errorCallback)throw e;this.errorCallback(e,t)}else this.sessionHandler.invalidateSessionId(a,i)}),null,o,n)},this.callWithoutSession=(t,r,s,o,n,i,a)=>{var l;i||(i=exports.HttpMethod.post);const c=this.svcUri+"/"+t;let u,d;switch(n&&(u={headers:n,withCredentials:null!==(l=this.supportGetItemPreviewMethod)&&void 0!==l?l:t==p.logIn}),i){case exports.HttpMethod.get:if(r)throw new Error("Calling api get method with data specified does not make any sense.");d=e.get(c,u);break;case exports.HttpMethod.post:d=e.post(c,r,u);break;default:throw new Error(`Unknown http method '${i}'.`)}S.handleCallPromise(d,s,o,(e=>{if(a)try{a(e)}catch(e){if(!this.errorCallback)throw e;this.errorCallback(e,r)}else{const t=new Error("Unhandled connection error when calling "+c+": "+E.stringifyError(e));if(!this.errorCallback)throw t;this.errorCallback(t,r)}}))},this.getItemPreviewGetMethodUrl=(e,t,r)=>this.svcUri+"/"+p.getItemPreview+"?folderName="+encodeURIComponent(e)+"&itemGuid="+encodeURIComponent(t)+(r||0===r?"&itemVersion="+encodeURIComponent(r.toString()):""),this.getEmailAttachmentGetMethodUrl=(e,t)=>this.svcUri+"/"+p.getEmailAttachment+"?itemGuid="+encodeURIComponent(e)+"&contentId="+encodeURIComponent(t),this.getAllEmailAttachmentsZipGetMethodUrl=e=>this.svcUri+"/"+p.getAllEmailAttachments+"?itemGuid="+encodeURIComponent(e),this.getBinaryAttachmentGetMethodUrl=(e,t)=>"number"==typeof t?this.svcUri+"/"+p.getBinaryAttachment+"?itemGuid="+encodeURIComponent(e)+`&revision=${t}`:this.svcUri+"/"+p.getBinaryAttachmentLatestRevision+"?itemGuid="+encodeURIComponent(e),this.getTransformItemMethodUrl=(e,t,r,s)=>`${this.svcUri}/${p.transformItem}?itemGuid=${encodeURIComponent(e)}&itemFolderName=${encodeURIComponent(t)}&transformationGuid=${encodeURIComponent(r)}&outputFormat=${s}`,this.getActiveSessionId=()=>this.sessionId,this.setActiveSessionId=e=>{this.sessionId=e},!t)throw new Error("The argument 'apiServiceUri' cannot be empty.");if(t.length<8||"https://"!==t.substr(0,8).toLowerCase()&&"http://"!==t.substr(0,7).toLowerCase())throw new Error("Api service uri must start either with 'https://' or with 'http://'.");if(".svc"===t.substr(t.length-4).toLowerCase()){this.svcUri=t;const e=["/API.svc","/InsecureAPI.svc","/WcfService/Service.svc"].find((e=>e.toLowerCase()===t.substr(t.length-e.length).toLowerCase()))||"";this.baseUri=t.substr(0,t.length-e.length)}else this.baseUri=S.normalizeWsUrl(t)||t,"https://"===t.substr(0,8).toLowerCase()?this.svcUri=this.baseUri+"/API.svc":this.svcUri=this.baseUri+"/InsecureAPI.svc";this.sessionHandler=r,this.errorCallback=s,this.sessionId=null,this.supportGetItemPreviewMethod=null!=o&&o}get supportsGetItemPreviewMethod(){return this.supportGetItemPreviewMethod}static create(e,t,r,s,o,n,i,a){return new S(e,new y(t,r,s,o,n,i),i,a)}static createAnonymous(e,t){return new S(e,new h,t)}static createUsingOAuth(e,t,r,s,o,n,i,a,l,c){return new S(e,new g(t,r,s,o,n,i,a,l),a,c)}static normalizeWsUrl(e){return e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),e}get wsUrl(){return this.baseUri}static handleCallPromise(e,t,r,s){e.then((e=>{200===e.status?e.data.ReturnCode===u.rcSuccess?t(e.data):r(e.data):s(new T(e.status,e.statusText))})).catch((e=>{e.response?s(new T(e.response.status,e.response.statusText)):s(e)}))}}class A{constructor(e,t,r,s,o,n,i){this.isEnabled=(e,t)=>{const r=()=>{this.url&&this.token?e(this.url,this.token):t()};this.url&&this.token?e(this.url,this.token):this.obtainToken(r)},this.callTokenizedApi=(e,t,r,s)=>{this.isEnabled(((o,n)=>{t.token=n,A.call(o,e,t,r,(o=>{if(o.ReturnCodeString!==this.invalidTokenReturnCode){if(s)s(o);else if(this.generalErrorCallback){const e=new Error("Unhandled tokenized service connection return code "+o.ReturnCodeString+".\nDescription: "+o.Description);this.generalErrorCallback(e)}}else this.obtainToken((()=>{this.callTokenizedApi(e,t,r,s)}))}),(e=>{if(this.generalErrorCallback){const t=new Error("Unhandled tokenized service connection communication error: "+JSON.stringify(e));this.generalErrorCallback(t)}}))}),(()=>{s&&s(null)}))},this.obtainToken=e=>{if(!this.isActive)return this.url=null,this.token=null,void e();const t=t=>{const r=this.urlAndTokenObtainer(t);r.url&&r.token?(this.url=r.url,this.token=r.token,this.isActive=!0,e()):(this.url=null,this.token=null,this.isActive=!1,e())},r=()=>{this.url=null,this.token=null,this.isActive=!1,e()};this.needsSession?this.connection.callMethod(this.obtainTokenMethodName,{},t,r,this.obtainTokenMethodType):this.connection.callWithoutSession(this.obtainTokenMethodName,null,t,r,null,this.obtainTokenMethodType)},this.obtainTokenMethodName=e,this.obtainTokenMethodType=t,this.needsSession=r,this.invalidTokenReturnCode=s,this.urlAndTokenObtainer=o,this.connection=n,this.generalErrorCallback=i||null,this.url=null,this.token=null,this.isActive=!0}static call(t,r,s,o,n,i){const a=t+"/"+r;e.post(a,s).then((e=>{200===e.status?"Success"===e.data.ReturnCodeString?o(e.data):n(e.data):i(new T(e.status,e.statusText))})).catch((e=>{e.response?i(new T(e.response.status,e.response.statusText)):i(e)}))}}const I=e=>({url:e.ServiceUrl,token:e.Token});class v{}v.acceptableBackwardWorkReportDays="AcceptableBackwardWorkReportDays",v.adminAppInactiveLogoutTime="AdminAppInactiveLogoutTime",v.applyGeneralDataProtectionRules="ApplyGeneralDataProtectionRules",v.automaticallyCreateJournalAfterCallDuration="AutomaticallyCreateJournalAfterCallDuration",v.bonusesCompletedState="BonusesCompletedState",v.cartInvoicedState="CartInvoicedState",v.cartOrderCanceledState="CartOrderCanceledState",v.cartOrderInProcessState="CartOrderInProcessState",v.cartOrderProcessedState="CartOrderProcessedState",v.cartPaidState="CartPaidState",v.cartProposalInProcessState="CartProposalInProcessState",v.cartProposalProcessedState="CartProposalProcessedState",v.cartSalesVoucherIssuedState="CartSalesVoucherIssuedState",v.cartToBeInvoicedState="CartToBeInvoicedState",v.cartVoidedState="CartVoidedState",v.clickToCallScheme="ClickToCallScheme",v.companyDuplicityCheckEnabled="CompanyDuplicityCheckEnabled",v.completedStateName="CompletedStateName",v.contactDuplicityCheckEnabled="ContactDuplicityCheckEnabled",v.createCompanyWhileImportingContactFromOutlook="CreateCompanyWhileImportingContactFromOutlook",v.defaultProposalValidityPeriod="DefaultProposalValidityPeriod",v.enableContactsTwoWaySyncWithM365="EnableContactsTwoWaySyncWithM365",v.deadStateName="DeadStateName",v.enableCompaniesSyncIntoMobileDeviceContacts="EnableCompaniesSyncIntoMobileDeviceContacts",v.enableContactsSyncIntoMobileDevice="EnableContactsSyncIntoMobileDevice",v.enableLeadsSyncIntoMobileDeviceContacts="EnableLeadsSyncIntoMobileDeviceContacts",v.enableLlamaAiFeatures="EnableLlamaAiFeatures",v.enableUsersSyncIntoMobileDeviceContacts="EnableUsersSyncIntoMobileDeviceContacts",v.emailsActiveProjectsLeadsFilter="EmailsActiveProjectsLeadsFilter",v.exchangeRatesAdminGroupName="ExchangeRatesAdminGroupName",v.forcedEmailTrackingGroups="ForcedEmailTrackingGroups",v.ignoreEmailsFromDomainsOnEmailsTracking="IgnoreEmailsFromDomainsOnEmailsTracking",v.trackEmailsFromDomains="TrackEmailsFromDomains",v.groupsForAllUnpaidInvoicesNotification="GroupsForAllUnpaidInvoicesNotification",v.itemPreviewMaxHeight="ItemPreviewMaxHeight",v.lastActivityAttributes="LastActivityAttributes",v.leadsCompletedState="LeadsCompletedState",v.leadDeadlineAlertGroups="LeadDeadlineAlertGroups",v.leadsDeadState="LeadsDeadState",v.marketingCompletedState="MarketingCompletedState",v.marketingDeadState="MarketingDeadState",v.minimumPasswordLength="MinimumPasswordLength",v.nextStepAttributes="NextStepAttributes",v.notifyAboutInvoicedInvoiceInPohodaGroup="NotifyAboutInvoicedInvoiceInPohodaGroup",v.notifyAboutLeadsDeadline="NotifyAboutLeadsDeadline",v.notifyAboutPaidInvoiceInPohodaGroup="NotifyAboutPaidInvoiceInPohodaGroup",v.notifyAboutProjectDeadline="NotifyAboutProjectDeadline",v.numberOfDecimalPlaces="NumberOfDecimalPlaces",v.phoneListTaskSolverGroup="PhoneListTaskSolverGroup",v.projectDeadlineAlert="ProjectDeadlineAlert",v.serverUpdateProgressNotificationGroup="ServerUpdateProgressNotificationGroup",v.sumarizeCartsPricesOnLeads="SumarizeCartsPricesOnLeads",v.sumarizeCartsPricesOnProjects="SumarizeCartsPricesOnProjects",v.sumarizePeopleExpensesOnProjects="SumarizePeopleExpensesOnProjects",v.systemHealthNotificationGroup="SystemHealthNotificationGroup",v.tasksCompletedState="TasksCompletedState",v.tasksDeferredState="TasksDeferredState",v.tasksInProgressState="TasksInProgressState",v.tasksNotStartedState="TasksNotStartedState",v.tasksWaitOnSomeoneElseState="TasksWaitOnSomeoneElseState",v.trackDocumentVersions="TrackDocumentVersions",v.vacationCompletedState="VacationCompletedState",v.workReportApprovedState="WorkReportApprovedState",v.defaultLanguage="DefaultLanguage",v.defaultCurrency="DefaultCurrency",v.myCompanyCountry="MyCompanyCountry",v.myCompanyName="MyCompanyName",v.myCompanyStreet="MyCompanyStreet",v.myCompanyCity="MyCompanyCity",v.myCompanyState="MyCompanyState",v.myCompanyZip="MyCompanyZIP",v.myCompanyId="MyCompanyID",v.myCompanyVat="MyCompanyVAT",v.mergeGoodsInCart="MergeGoodsInCart",v.cartRefreshLogic="CartRefreshLogic",v.goodsDefaultQuantity="GoodsDefaultQuantity",v.goodsDefaultVAT="GoodsDefaultVAT",v.goodsDefaultVATIncluded="GoodsDefaultVATIncluded";class k{}k.ServerCommon={Server_ID:"Server_ID",Server_ItemCreated:"Server_ItemCreated",Server_ItemChanged:"Server_ItemChanged"},k.Common={CreatedByGUID:"CreatedByGUID",CurrencyEn:"CurrencyEn",DefaultCurrencySuffix:"DefaultCurrency",FileAs:"FileAs",ItemCreated:"ItemCreated",ItemChanged:"ItemChanged",ItemGUID:"ItemGUID",ItemVersion:"ItemVersion",ModifiedByGUID:"ModifiedByGUID",OwnerGUID:"OwnerGUID",ParentCurrencySuffix:"ParentCurrency"},k.Calendar={EndDate:"EndDate",Note:"Note"},k.Carts={SuperiorItem:"SuperiorItem",Customer:"Customer",Contact:"Contact",TypeEn:"TypeEn",StateEn:"StateEn",PriceTotal:"PriceTotal",PriceTotalExcludingVAT:"PriceTotalExcludingVAT",ForPayment:"ForPayment",Paid:"Paid",CurrencyEn:"CurrencyEn",EffectiveFrom:"EffectiveFrom",ValidUntil:"ValidUntil",Active:"Active",Note:"Note",ID:"ID",AccountingCaseDate:"AccountingCaseDate",TaxableSupplyDate:"TaxableSupplyDate",PaymentDate:"PaymentDate",VAT:"VAT",GoodsInCartCount:"GoodsInCartCount",PriceTotalDefaultCurrency:"PriceTotalDefaultCurrency",PriceTotalParentCurrency:"PriceTotalParentCurrency",ForPaymentDefaultCurrency:"ForPaymentDefaultCurrency",ForPaymentParentCurrency:"ForPaymentParentCurrency",PaidDefaultCurrency:"PaidDefaultCurrency",PaidParentCurrency:"PaidParentCurrency",PaidChanged:"PaidChanged",PriceTotalChanged:"PriceTotalChanged",PriceTotalExcludingVATDefaultCurrency:"PriceTotalExcludingVATDefaultCurrency",PriceTotalExcludingVATParentCurrency:"PriceTotalExcludingVATParentCurrency",VATDefaultCurrency:"VATDefaultCurrency",VATParentCurrency:"VATParentCurrency",PrevStateEn:"PrevStateEn",PurchaseExpenses:"PurchaseExpenses",PurchaseExpensesDefaultCurrency:"PurchaseExpensesDefaultCurrency",PurchaseExpensesParentCurrency:"PurchaseExpensesParentCurrency",PurchaseExpensesChanged:"PurchaseExpensesChanged",Profit:"Profit",ProfitDefaultCurrency:"ProfitDefaultCurrency",ProfitParentCurrency:"ProfitParentCurrency",ProfitChanged:"ProfitChanged"},k.Companies={ID:"ID",CompanyName:"CompanyName",Department:"Department",AccountNumber:"AccountNumber",IdentificationNumber:"IdentificationNumber",VatNumber:"VatNumber",Sales:"Reversal",EmployeesCount:"EmployeesCount",Purchaser:"Purchaser",Suppliers:"Suppliers",Competitor:"Competitor",Address1Street:"Address1Street",Address1City:"Address1City",Address1PostalCode:"Address1PostalCode",Address1CountryEn:"Address1CountryEn",Address1State:"Address1State",Address1POBox:"Address1POBox",Address2Street:"Address2Street",Address2City:"Address2City",Address2PostalCode:"Address2PostalCode",Address2CountryEn:"Address2CountryEn",Address2State:"Address2State",Address2POBox:"Address2POBox",Address3Street:"Address3Street",Address3City:"Address3City",Address3PostalCode:"Address3PostalCode",Address3CountryEn:"Address3CountryEn",Address3State:"Address3State",Address3POBox:"Address3POBox",InvoiceAddress:"InvoiceAddress",PostalAddress:"PostalAddress",Phone:"Phone",Mobile:"Mobile",Fax:"Fax",WebPage:"WebPage",TrackedDomains:"TrackedDomains",Email:"Email",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",ImportanceEn:"ImportanceEn",FirstContactEn:"FirstContactEn",LineOfBusiness:"LineOfBusiness",EmailOptOut:"EmailOptOut",MailingListOther:"MailingListOther",MailingListOtherValue:"MailingListOtherValue",Note:"Note",IsPrivate:"IsPrivate",NextStep:"NextStep",LastActivity:"LastActivity",AdditionalDiscount:"AdditionalDiscount"},k.Contacts={ProfilePicture:"ProfilePicture",Title:"Title",Email1Address:"Email1Address",Email2Address:"Email2Address",Email3Address:"Email3Address",DoNotSendNewsletter:"DoNotSendNewsletter",ImportanceEn:"ImportanceEn",PrefixEn:"PrefixEn",FirstName:"FirstName",MiddleName:"MiddleName",LastName:"LastName",SuffixEn:"SuffixEn",BusinessAddressStreet:"BusinessAddressStreet",BusinessAddressCity:"BusinessAddressCity",BusinessAddressPostalCode:"BusinessAddressPostalCode",BusinessAddressCountryEn:"BusinessAddressCountryEn",BusinessAddressState:"BusinessAddressState",BusinessAddressPoBox:"BusinessAddressPOBox",HomeAddressStreet:"HomeAddressStreet",HomeAddressCity:"HomeAddressCity",HomeAddressPostalCode:"HomeAddressPostalCode",HomeAddressCountryEn:"HomeAddressCountryEn",HomeAddressState:"HomeAddressState",HomeAddressPOBox:"HomeAddressPOBox",OtherAddressStreet:"OtherAddressStreet",OtherAddressCity:"OtherAddressCity",OtherAddressPostalCode:"OtherAddressPostalCode",OtherAddressCountryEn:"OtherAddressCountryEn",OtherAddressState:"OtherAddressState",OtherAddressPOBox:"OtherAddressPOBox",BusinessPhoneNumber:"TelephoneNumber1",BusinessPhoneNumber2:"TelephoneNumber5",BusinessFaxNumber:"TelephoneNumber6",MobilePhoneNumber:"TelephoneNumber3",HomePhoneNumber:"TelephoneNumber2",OtherPhoneNumber:"TelephoneNumber4",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",WebPage:"WebPage",Note:"Note",Department:"Department",Company:"Company",IsPrivate:"Private",NextStep:"NextStep",LastActivity:"LastActivity"},k.Leads={ID:"ID",FileAs:"FileAs",HumanID:"HID",Customer:"Customer",ContactPerson:"ContactPerson",Marketing:"Marketing",ReceiveDate:"ReceiveDate",Email:"Email",Phone:"Phone",Street:"Street",State:"State",CountryEn:"CountryEn",City:"City",POBox:"POBox",Zip:"Zip",Price:"Price",PriceChanged:"PriceChanged",CurrencyEn:k.Common.CurrencyEn,EstimatedEnd:"EstimatedEnd",Probability:"Probability",LeadOriginEn:"LeadOriginEn",PriceDefaultCurrency:"PriceDefaultCurrency",EstimatedValue:"EstimatedValue",EstimatedValueDefaultCurrency:"EstimatedValueDefaultCurrency",Note:"Note",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn",IsPrivate:"Private",EmailOptOut:"EmailOptOut",NextStep:"NextStep",LastActivity:"LastActivity",ItemVersion:"ItemVersion",EstimatedRevenue:"EstimatedRevenue",EstimatedRevenueDefaultCurrency:"EstimatedRevenueDefaultCurrency",CompletedDate:"CompletedDate",LostDate:"LostDate"},k.Documents={FileAs:"FileAs",DocName:"DocName",Preview:"Preview",PreviewWidth:"PreviewWidth",PreviewHeight:"PreviewHeight",DocTypeEn:"DocTypeEn",StateEn:"StateEn",ImportanceEn:"ImportanceEn",SuperiorItem:"SuperiorItem",SuperiorCompany:"Company",SuperiorContact:"Contact",DocSize:"DocSize",Extension:"Extension",CreationTime:"CreationTime",LastWriteTime:"LastWriteTime",IsPrivate:"Private",Note:"Note"},k.Emails={To:"To",From:"SenderEmailAddress",Cc:"Cc",Subject:"Subject",ImportanceEn:"ImportanceEn",SuperiorItem:"SuperiorItem",SentOn:"SentOn",ReceivedTime:"ReceivedTime",FileSize:"FileSize",AttachmentsCount:"AttachmentsCount",Note:"Note",SentimentTone:"SentimentTone",Summary:"Summary"},k.GoodsBase={Code:"Code",Structure:"Structure",Note:"Note",Description:"Description",TypeEn:"TypeEn",SaleCurrencyEn:"SaleCurrencyEn",PurchaseCurrencyEn:"PurchaseCurrencyEn",UnitEn:"UnitEn",PurchasePrice:"PurchasePrice",PurchasePriceDefaultCurrency:"PurchasePriceDefaultCurrency",PurchasePriceChanged:"PurchasePriceChanged",SalePrice:"SalePrice",SalePriceDefaultCurrency:"SalePriceDefaultCurrency",SalePriceChanged:"SalePriceChanged",IsPriceSum:"IsPriceSum",VATRate:"VATRate",VATIncluded:"VATIncluded"},k.Goods=Object.assign(Object.assign({},k.GoodsBase),{PriceListGroupGUID:"PriceListGroupGUID",InventoryQuantity:"InventoryQuantity"}),k.GoodsInCart=Object.assign(Object.assign({},k.GoodsBase),{Cart:"Cart",GoodsInfo:"GoodsInfo",SuperiorItem:"SuperiorItem",Quantity:"Quantity",PriceTotal:"PriceTotal",PriceTotalDefaultCurrency:"PriceTotalDefaultCurrency",PriceTotalParentCurrency:"PriceTotalParentCurrency",PriceTotalChanged:"PriceTotalChanged",PriceTotalExcludingVAT:"PriceTotalExcludingVAT",PriceTotalExcludingVATDefaultCurrency:"PriceTotalExcludingVATDefaultCurrency",PriceTotalExcludingVATParentCurrency:"PriceTotalExcludingVATParentCurrency",VATTotal:"VATTotal",VATTotalDefaultCurrency:"VATTotalDefaultCurrency",VATTotalParentCurrency:"VATTotalParentCurrency",SalePriceExcludingVAT:"SalePriceExcludingVAT",SalePriceExcludingVATDefaultCurrency:"SalePriceExcludingVATDefaultCurrency",SalePriceExcludingVATParentCurrency:"SalePriceExcludingVATParentCurrency",VAT:"VAT",VATDefaultCurrency:"VATDefaultCurrency",VATParentCurrency:"VATParentCurrency",PurchasePriceParentCurrency:"PurchasePriceParentCurrency",SalePriceParentCurrency:"SalePriceParentCurrency",ListPrice:"ListPrice",ListPriceDefaultCurrency:"ListPriceDefaultCurrency",ListPriceParentCurrency:"ListPriceParentCurrency",ListPriceChanged:"ListPriceChanged",Discount:"Discount",HierarchyInSet:"HierarchyInSet",IsFromSet:"IsFromSet",ParentGUID:"ParentGUID",Rank:"Rank",IncludeInCartPrice:"IncludeInCartPrice",ListPriceCustomized:"ListPriceCustomized",ChildItemsCount:"ChildItemsCount",JoinedToGUID:"JoinedToGUID",PurchasePriceTotal:"PurchasePriceTotal",PurchasePriceTotalDefaultCurrency:"PurchasePriceTotalDefaultCurrency",PurchasePriceTotalParentCurrency:"PurchasePriceTotalParentCurrency",PurchasePriceTotalChanged:"PurchasePriceTotalChanged"}),k.Journal={FileAs:"FileAs",Subject:"Subject",TypeEn:"TypeEn",StateEn:"StateEn",ImportanceEn:"ImportanceEn",EventStart:"EventStart",EventEnd:"EventEnd",SuperiorItem:"SuperiorItem",Company:"Company",Contact:"Contact",Marketing:"Marketing",IsSystem:"System",IsPrivate:"Private",Note:"Note",Phone:"Phone"},k.Vacation={StartDate:"StartDate",EndDate:"EndDate",User:"User",Duration:"Duration",Place:"Place",Note:"Note",AllDay:"AllDay",TypeEn:"TypeEn",StateEn:"StateEn",IsPrivate:"Private"},k.Marketing={HumanID:"HumanID",EstimatedStart:"EstimatedStart",EstimatedEnd:"EstimatedEnd",RealStart:"RealStart",RealEnd:"RealEnd",TargetGroup:"TargetGroup",EmailsSent:"EmailsSent",EmailsDelivered:"EmailsDelivered",EmailsViewed:"EmailsViewed",PeopleUnsubscribed:"PeopleUnsubscribed",FinalRevenues:"FinalRevenues",TypeEn:"TypeEn",StateEn:"StateEn"},k.Projects={HumanID:"HID",FileAs:"FileAs",ProjectName:"ProjectName",ProjectOriginEn:"ProjectOriginEn",TypeEn:"TypeEn",StateEn:"StateEn",PaymentTypeEn:"PaymentTypeEn",ProjectStart:"ProjectStart",ProjectRealEnd:"ProjectRealEnd",EstimatedEnd:"ProjectEnd",CurrencyEn:k.Common.CurrencyEn,DefaultCurrencyEn:"DefaultCurrencyEn",EstimatedMargin:"EstimatedMargin",EstimatedPeopleExpenses:"EstimatedPeopleExpenses",EstimatedPeopleExpensesDefaultCurrency:"EstimatedPeopleExpensesDefaultCurrency",EstimatedOtherExpenses:"EstimatedOtherExpenses",EstimatedOtherExpensesDefaultCurrency:"EstimatedOtherExpensesDefaultCurrency",EstimatedPrice:"EstimatedPrice",EstimatedPriceDefaultCurrency:"EstimatedPriceDefaultCurrency",EstimatedProfit:"EstimatedProfit",EstimatedProfitDefaultCurrency:"EstimatedProfitDefaultCurrency",EstimatedPriceChanged:"EstimatedPriceChanged",EstimatedPeopleExpensesChanged:"EstimatedPeopleExpensesChanged",EstimatedOtherExpensesChanged:"EstimatedOtherExpensesChanged",Delay:"Delay",EstimatedWorkHours:"EstimatedWorkHours",TotalWorkHours:"TotalWorkHours",PeopleExpenses:"PeopleExpenses",OtherExpenses:"OtherExpenses",PeopleExpensesDefaultCurrency:"PeopleExpensesDefaultCurrency",OtherExpensesDefaultCurrency:"OtherExpensesDefaultCurrency",PeopleExpensesChanged:"PeopleExpensesChanged",OtherExpensesChanged:"OtherExpensesChanged",Price:"Price",PriceDefaultCurrency:"PriceDefaultCurrency",Profit:"Profit",ProfitDefaultCurrency:"ProfitDefaultCurrency",Margin:"Margin",PriceChanged:"PriceChanged",SuperiorProject:"SuperiorProject",Customer:"Customer",ContactPerson:"ContactPerson",Users:"Users",ProjectManager:"ProjectManager",InvoicePaymentDate:"InvoicePaymentDate",PaymentMaturity:"PaymentMaturity",InvoiceIssueDate:"InvoiceIssueDate",LicensesCount:"LicensesCount",LicensePrice:"LicensePrice",LicensePriceDefaultCurrency:"LicensePriceDefaultCurrency",NextStep:"NextStep",LastActivity:"LastActivity",IsPrivate:"Private",LicensePriceChanged:"LicensePriceChanged",Note:"Note",CompletedDate:"CompletedDate",LostDate:"LostDate"},k.Tasks={FileAs:"FileAs",Subject:"Subject",RootItem:"RootItem",SuperiorItem:"SuperiorItem",Company:"Company",Contact:"Contact",StartDate:"StartDate",DueDate:"DueDate",Reminder:"Reminder",ReminderDate:"ReminderDate",ImportanceEn:"ImportanceEn",IsCompleted:"Complete",PercentComplete:"PercentComplete",PercentCompleteDecimal:"PercentCompleteDecimal",CompletedDate:"CompletedDate",Solver:"Solver",Delegator:"Delegator",Level:"Level",IsPrivate:"Private",ActualWorkHours:"ActualWorkHours",TotalWorkHours:"TotalWorkHours",Body:"Body",TypeEn:"TypeEn",StateEn:"StateEn"},k.Training={TitleEn:"TitleEn"},k.WorkReports={Task:"Task",ProjectName:"ProjectName",UserName:"UserName",Subject:"Subject",Date:"Date",FromTime:"FromTime",ToTime:"ToTime",Overtime:"Overtime",Month:"Month",Year:"Year",IsPrivate:"Private",Note:"Note",Duration:"Duration",WorkReportEn:"WorkReportEn",StateEn:"StateEn"},k.Users={ProfilePicture:"ProfilePicture",UserName:"UserName",JobTitle:"JobTitle",IDCardNumber:"IDCardNumber",Birthdate:"Birthdate",BirthPlace:"BirthPlace",PersonalIdentificationNumber:"PersonalIdentificationNumber",Active:"Active",FamilyStatusEn:"FamilyStatusEn",HomeAddressStreet:"HomeAddressStreet",HomeAddressCity:"HomeAddressCity",HomeAddressPostalCode:"HomeAddressPostalCode",HomeAddressCountryEn:"HomeAddressCountryEn",HomeAddressState:"HomeAddressState",HomeAddressPOBox:"HomeAddressPOBox",BankAccount:"BankAccount",BusinessPhoneNumber:"BusinessPhoneNumber",MobilePhoneNumber:"MobilePhoneNumber",Email1Address:"Email1Address",Email2Address:"Email2Address",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",IdentificationNumber:"IdentificationNumber",HealthInsurance:"HealthInsurance",HolidayLength:"HolidayLength",RemainingDaysOfHoliday:"RemainingDaysOfHoliday",SalaryDateEn:"SalaryDateEn",Supervisor:"Supervisor",TravelDistance:"TravelDistance",TimeAccessibility:"TimeAccessibility",TransportMode:"TransportMode",WorkdayStartTime:"WorkdayStartTime",Note:"Note",IsSystem:"IsSystem"},k.Groups={IsAdmin:"IsAdmin",GroupName:"GroupName",FileAs:"FileAs",Description:"Description",IsPM:"IsPM",System:"System",IsRole:"IsRole",IsCategory:"IsCategory",DisallowControlModulePermissions:"DisallowControlModulePermissions",DisallowControlColumnPermissions:"DisallowControlColumnPermissions",IsOutlookCategory:"IsOutlookCategory",DisallowControlUserAssignment:"DisallowControlUserAssignment",ColorEn:"ColorEn",Picture:"Picture"},k.PriceListGroups={Note:"Note"},k.Prices={SalePriceGUID:"SalePriceGUID",GoodsItemGUID:"GoodsItemGUID",Price:"Price",CurrencyEn:"CurrencyEn"},k.SalePrices={Note:"Note",Discount:"Discount",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn"},k.XsltTransformations={LangCode:"LangCode",Definition:"Definition",Namespace:"Namespace",ObjectTypeID:"ObjectTypeID",TransformationVersion:"TransformationVersion"},k.XsltTransformationsModels={ObjectTypeID:"ObjectTypeID",TransformationGUID:"TransformationGUID",ItemTypeGUID:"ItemTypeGUID"},k.allTypeEnNames=["TypeEn",k.Documents.DocTypeEn,k.WorkReports.WorkReportEn,"TitleEn"],k.getFolderFileAs=e=>{switch(e){case m.leads:return k.Leads.FileAs;case m.projects:return k.Projects.ProjectName;case m.documents:return k.Documents.DocName;case m.companies:return k.Companies.CompanyName;case m.contacts:case m.users:return k.Common.FileAs;case m.emails:return k.Emails.Subject;case m.journal:return k.Journal.FileAs;case m.tasks:return k.Tasks.Subject;case m.workReports:return k.WorkReports.Subject;case m.vacation:return k.Vacation.TypeEn;case m.carts:case m.goods:case m.goodsInCart:return k.Common.FileAs;case m.groups:return k.Groups.GroupName;case m.xsltTransformations:return k.Common.FileAs;default:return console.warn(`FileAs col name not defined for folderName ${e}`),k.Common.FileAs}};class b{}b.general="GENERAL",b.group="GROUP",b.contactPerson="CONTACTPERSON",b.contact="CONTACT",b.customer="CUSTOMER",b.company="COMPANY",b.outlookProject="OUTLOOKPROJECT",b.supervisor="SUPERVISOR",b.projectOrigin="PROJECT_ORIGIN",b.cart="CART",b.goodsInCart="GOODSINCART";class D{}D.all="All",D.own="Own",D.readonly="Readonly",D.invisible="Invisible",D.none="None";class w{}var x,F,O,N;w.mandatory="Mandatory",w.optional="Optional",w.unique="Unique",w.none="None",exports.Edition=void 0,(x=exports.Edition||(exports.Edition={})).Free="Free",x.Basic="Basic",x.Professional="Professional",x.Enterprise="Enterprise",exports.Feature=void 0,(F=exports.Feature||(exports.Feature={})).ContactsAndCompanies="ContactsAndCompanies",F.Sales="Sales",F.Projects="Projects",F.Marketing="Marketing",exports.SentimentTone=void 0,(O=exports.SentimentTone||(exports.SentimentTone={}))[O.Negative=0]="Negative",O[O.Neutral=1]="Neutral",O[O.Positive=2]="Positive";class R{}R.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",R.wordAddin="WordAddin",R.excelAddin="ExcelAddin",R.tasksRecurrentTasks="TasksRecurrentTasks",R.tasksSubtasks="TasksSubtasks",R.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",R.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",R.emailsAutomaticTracking="EmailsAutomaticTracking",R.convertEmailToProject="ConvertEmailToProject",R.duplicityChecker="DuplicityChecker",R.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",R.subProjects="SubProjects",R.resourceAndPlanning="ResourceAndPlanning",R.professionalEmailCampaigns="ProfessionalEmailCampaigns",R.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",R.wordEmailMerge="WordEmailMerge",R.printLabels="PrintLabels",R.printEnvelopes="PrintEnvelopes",R.userViews="UserViews",R.sharedUserViews="SharedUserViews",R.gridConditionalFormating="GridConditionalFormating",R.multipleCurrencies="MultipleCurrencies",R.historyTracking="HistoryTracking",R.privateItems="PrivateItems",R.itemTypes="ItemTypes",R.formLayoutCustomization="FormLayoutCustomization",R.workflowBasicDefinitions="WorkflowBasicDefinitions",R.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",R.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",R.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",R.workflowGroupLevelActions="WorkflowGroupLevelActions",R.customFields="CustomFields",R.importantFields="ImportantFields",R.mandatoryFields="MandatoryFields",R.uniqueFields="UniqueFields",R.readOnlyFields="ReadOnlyFields",R.transformationCustomTemplates="TransformationCustomTemplates",R.userRoles="UserRoles",R.modulePermissions="ModulePermissions",R.columnPermissions="ColumnPermissions",R.api="API",R.gate="Gate",R.threeCXIntegration="ThreeCXIntegration",R.tapiIntegration="TapiIntegration",R.pohodaIntegration="PohodaIntegration",R.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",R.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",R.quickBooksIntegration="QuickBooksIntegration",R.saveBinaryDataOnDisk="SaveBinaryDataOnDisk",R.activeDirectoryLogin="ActiveDirectoryLogin",R.callerIdentificationOnApple="CallerIdentificationOnApple",R.legacyAdministration="LegacyAdministration";class M{}M.customAdditionalFieldsCount="CustomAdditionalFieldsCount",M.customEnabledAdvancedWorkflowsCount="CustomEnabledAdvancedWorkflowsCount",M.customEnabledBasicWorkflowsCount="CustomEnabledBasicWorkflowsCount",M.customMandatoryFieldsCount="CustomMandatoryFieldsCount",M.customOptionalFieldsCount="CustomOptionalFieldsCount",M.customReadonlyFieldsCount="CustomReadonlyFieldsCount",M.customUniqueFieldsCount="CustomUniqueFieldsCount",M.customVisibleTypesCount="CustomVisibleTypesCount",M.visibleCurrenciesCount="VisibleCurrenciesCount";class _{}_.contactsAutomaticSynchronizationWithOutlook="ContactsAutomaticSynchronizationWithOutlook",_.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",_.contactsSynchronizationWithAndroid="ContactsSynchronizationWithAndroid",_.documentsRevisions="DocumentsRevisions",_.wordAddin="WordAddin",_.excelAddin="ExcelAddin",_.tasksReminders="TasksReminders",_.tasksRecurrentTasks="TasksRecurrentTasks",_.tasksSubtasks="TasksSubtasks",_.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",_.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",_.emailsManualTracking="EmailsManualTracking",_.emailsAutomaticTracking="EmailsAutomaticTracking",_.emailSummaryAndSentimentToneFromAi="EmailSummaryAndSentimentToneFromAi",_.convertEmailToContact="ConvertEmailToContact",_.convertEmailToDeal="ConvertEmailToDeal",_.convertEmailToProject="ConvertEmailToProject",_.convertEmailToTask="ConvertEmailToTask",_.convertFromSuggestedContact="ConvertFromSuggestedContact",_.gravatarIntegration="GravatarIntegration",_.logoboxIntegration="LogoboxIntegration",_.companiesBussinesRegisterApiIntegration="CompaniesBussinesRegisterApiIntegration",_.duplicityChecker="DuplicityChecker",_.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",_.subProjects="SubProjects",_.resourceAndPlanning="ResourceAndPlanning",_.professionalEmailCampaigns="ProfessionalEmailCampaigns",_.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",_.wordEmailMerge="WordEmailMerge",_.printLabels="PrintLabels",_.printEnvelopes="PrintEnvelopes",_.userViews="UserViews",_.sharedUserViews="SharedUserViews",_.gridRowSummary="GridRowSummary",_.gridConditionalFormating="GridConditionalFormating",_.multipleCurrencies="MultipleCurrencies",_.historyTracking="HistoryTracking",_.privateItems="PrivateItems",_.itemTypes="ItemTypes",_.formLayoutCustomization="FormLayoutCustomization",_.workflowBasicDefinitions="WorkflowBasicDefinitions",_.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",_.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",_.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",_.workflowGroupLevelActions="WorkflowGroupLevelActions",_.customFields="CustomFields",_.importantFields="ImportantFields",_.mandatoryFields="MandatoryFields",_.uniqueFields="UniqueFields",_.readOnlyFields="ReadOnlyFields",_.transformationCustomTemplates="TransformationCustomTemplates",_.userRoles="UserRoles",_.modulePermissions="ModulePermissions",_.columnPermissions="ColumnPermissions",_.commonDataAPI="CommonDataAPI",_.eWayCrmAPI="eWayCrmAPI",_.threeCXIntegration="ThreeCXIntegration",_.tapiIntegration="TapiIntegration",_.pohodaIntegration="PohodaIntegration",_.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",_.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",_.quickBooksIntegration="QuickBooksIntegration",_.shareByTeams="ShareByTeams",_.convertEmailToContactWithDataFromAi="ConvertEmailToContactWithDataFromAi",_.convertEmailToDealWithDataFromAi="ConvertEmailToDealWithDataFromAi",_.convertEmailToProjectWithDataFromAi="ConvertEmailToProjectWithDataFromAi",function(e){e.UnpaidImportantInvoices="UnpaidImportantInvoices",e.UncollectableSubscriptionPayment="UncollectableSubscriptionPayment",e.UncollectableSubscriptionPaymentWithExpiredCard="UncollectableSubscriptionPaymentWithExpiredCard",e.StandardSubscriptionPeriod="StandardSubscriptionPeriod"}(N||(N={}));var L,V=N;!function(e){e.License="License",e.CloudLicense="CloudLicense",e.MiscLicense="MiscLicense",e.Support="Support",e.Service="Service"}(L||(L={}));var G=L;class U{}U.getIsDebug=e=>{var t;return!!(null===(t=null==e?void 0:e.sessionHandler.lastSuccessfulLoginResponse)||void 0===t?void 0:t.Debug)},U.supportsFeaturesOf=(e,t)=>{var r;const s=null===(r=e.sessionHandler.lastSuccessfulLoginResponse)||void 0===r?void 0:r.WcfVersion;return!!s&&U.supportsVersionFeaturesOf(s,t)},U.supportsVersionFeaturesOf=(e,t)=>s.compare(e,t,">=")||s.compare(e,"1.0.0.0","=");class j{}j.textBox="TextBox",j.comboBox="ComboBox",j.numericBox="NumericBox",j.relation="Relation",j.checkBox="CheckBox",j.linkTextBox="LinkTextBox",j.dateEdit="DateEdit",j.memoBox="MemoBox",j.multiSelectComboBox="MultiSelectComboBox",j.workflowState="WorkflowState",j.image="Image",j.multiSelectRelation="MultiSelectRelation";const B={[m.relations]:0,[m.unifiedRelations]:1,[m.users]:2,[m.groups]:3,[m.enumTypes]:4,[m.enumValues]:5,[m.additionalFields]:6};var W,H,z,Q;exports.Version=void 0,(W=exports.Version||(exports.Version={})).Version75="7.5",W.Version76="7.6",W.Version77="7.7",W.Version81="8.1",W.Version82="8.2",W.Version83="8.3",W.Version90="9.0",W.Version91="9.1",W.Version92="9.2";class $ extends U{}$.is75OrLater=e=>U.supportsFeaturesOf(e,exports.Version.Version75),$.is76OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version76),$.is77OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version77),$.is81OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version81),$.is82OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version82),$.is83OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version83),$.is90OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version90),$.is91OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version91),$.is92OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version92),$.isFeatureSupported=(e,t)=>$.supportsFeaturesOf(e,t);class q{static createHubItemsCountsQuery(e,t,r){return{__type:"HubItemsCountsQuery:#EQ",ParentItemGuids:e,ItemTypes:t,ExcludeSystemItems:r}}static createRelatedTableQuery(e,t,r){return{__type:r?"RelatedTableQuery:#EQ":"TypelessRelatedTableQuery:#EQ",BaseItemID:e,ItemTypes:Array.isArray(t)?t:[t],RelationType:r}}static createMainTableQuery(e){return{__type:"MainTableQuery:#EQ",ItemTypes:Array.isArray(e)?e:[e]}}}q.column=e=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}),q.multiSelectComboColumnLegacy=(e,t,r)=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues]({0}, '${e}', '${t}'`,Alias:null!=r?r:e}),q.multiSelectComboColumn=(e,t,r,s,o)=>{if(!$.is77OrLater(e))return q.multiSelectComboColumnLegacy(r,s,o);return{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues_WithObjectTypeID]({0}, dbo.GetObjectTypeID('${t}'), '${r}', '${s}')`,Alias:null!=o?o:r}},q.joinColumn=(e,t,r,s,o)=>{const n={__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:e,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:t},TargetColumnName:o},Name:r};return s&&(n.Alias=s),n},q.singleVariatedColumn=(e,t,r)=>q.variatedColumn([q.columnVariation(e,t)],r),q.variatedColumn=(e,t)=>{const r={__type:"VariatedColumn:#EQ",Source:{__type:"MainTable:#EQ"},Variations:e};return t&&(r.Alias=t),r},q.columnVariation=(e,t,r)=>{const s={FolderName:t,Field:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}};return r&&(s.Field.Transformation=r),s},q.joinColumnVariation=(e,t,r,s)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:t,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:r}},Name:s}}),q.relationColumnVariation=(e,t,r,s)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:t,Direction:1,ItemTypes:r},Name:s}}),q.relatedColumn=(e,t,r,s)=>{const o={__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r};return s&&(o.Alias=s),o},q.relatedSubstituableColumn=(e,t,r,s,o)=>{const n={__type:"SubstituableColumn:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r,Substitute:s};return o&&(n.Alias=o),n},q.relatedColumnFolderNameToken=(e,t,r)=>({__type:"Token:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},TypeName:"ItemType",Alias:r}),q.folderNameToken=e=>({__type:"Token:#EQ",Source:{__type:"MainTable:#EQ"},TypeName:"ItemType",Alias:null!=e?e:"FolderName"}),q.equalsFilterExpression=(e,t)=>({__type:"EqualsFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.notEqualsExpression=(e,t)=>({__type:"NotFilterExpression:#EQ",Child:q.equalsFilterExpression(e,t)}),q.andFilterExpression=e=>({__type:"AndFilterExpressionOperator:#EQ",Children:e}),q.orFilterExpression=e=>({__type:"OrFilterExpressionOperator:#EQ",Children:e}),q.lessFilterExpression=(e,t)=>({__type:"LessFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.lessOrEqualFilterExpression=(e,t)=>({__type:"LessOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.greaterFilterExpression=(e,t)=>({__type:"GreaterFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.greaterOrEqualFilterExpression=(e,t)=>({__type:"GreaterOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.likeFilterExpression=(e,t)=>({__type:"LikeFilterExpressionPredicate:#EQ",Field:e,Value:`%${t}%`}),q.inFilterExpression=(e,t)=>({__type:"InFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.isNullOrEmptyFilterExpression=e=>q.orFilterExpression([q.equalsFilterExpression(q.column(e),null),q.equalsFilterExpression(q.column(e),"")]);class J{static toRfc3339String(e){const t=e=>e<10?`0${e}`:String(e);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}${(e=>{if(0===e)return"Z";const r=e>0?"-":"+";return e=Math.abs(e),`${r}${t(Math.floor(e/60))}:${t(e%60)}`})(e.getTimezoneOffset())}`}}J.isValid=e=>e instanceof Date&&!isNaN(e.getTime()),J.areDaysEqual=(e,t)=>{const r=J.clearTime(e),s=J.clearTime(t);return r.getTime()===s.getTime()},J.areTimesEqual=(e,t)=>e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes(),J.areDatesEqual=(e,t)=>!!e&&!!t&&J.areDaysEqual(e,t)&&J.areTimesEqual(e,t),J.clearTime=e=>{const t=new Date(e);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},J.isWithoutTime=e=>0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds(),J.getFormattedSqlDateTime=e=>e.toISOString().slice(0,19).replace("T"," "),J.getRfcWithoutTimezone=e=>e.slice(0,19),exports.TransformItemFormats=void 0,(H=exports.TransformItemFormats||(exports.TransformItemFormats={})).OpenXmlDocx="OpenXmlDocx",H.Pdf="Pdf",H.WordMlXml="WordMlXml";exports.EnumTypeEditMode=void 0,(z=exports.EnumTypeEditMode||(exports.EnumTypeEditMode={})).Readonly="Readonly",z.VisibleRankDefaultOnly="VisibleRankDefaultOnly",z.Editable="Editable",exports.ImportResult=void 0,(Q=exports.ImportResult||(exports.ImportResult={})).Success="Success",Q.Failure="Failed",Q.FailureDuplicityFound="Failed_DuplicityFound",Q.FailureItemAlreadyRemoved="Failed_ItemAlreadyRemoved",Q.FailureColumnsLockedWFAction="Failed_ColumnsLocked",Q.FailureItemLockedWFAction="Failed_ItemLocked",Q.FailureLicenceLimitReached="Failed_LicenseLimitReached",Q.FailureInssuficientModulePermission="Failed_InsufficientModulePermission",Q.FailureInssuficientColumnsPermission="Failed_InsufficientColumnsPermission",c.polyfill(),exports.ApiConnectionAsNonDefaultExport=S,exports.ApiMethods=p,exports.ColumnPermissionMandatoryRules=w,exports.ColumnPermissionPermissionRules=D,exports.CommonDataConnection=class{constructor(e,t){this.isCommonDataApiEnabled=(e,t)=>{this.tokenizedConnection.isEnabled(e,t)},this.callCommonDataApi=(e,t,r,s)=>{this.tokenizedConnection.callTokenizedApi(e,t,r,s)},this.tokenizedConnection=new A("ObtainCommonDataApiAccessToken",exports.HttpMethod.get,!1,"InvalidCommonDataToken",I,e,t)}},exports.CustomizationStatsItemKeys=M,exports.DateHelper=J,exports.EWItem=class{constructor(e,t){if(!e||!t)throw new Error("Both folderName and baseItem has to be defined!");this.folderName=e,this.baseItem=t}getEmailAddress(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return e.Email1Address||e.Email2Address||e.Email3Address}case m.leads:return this.baseItem.Email;case m.companies:return this.baseItem.Email;case m.users:{const e=this.baseItem;return e.Email1Address||e.Email2Address}default:return null}}getInitials(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}case m.users:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}default:return null}}getInitialsInternal(e,t){const r=((null==e?void 0:e.substr(0,1))||"")+((null==t?void 0:t.substr(0,1))||"");return""==r?null:r}getItemPreview(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}case m.users:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}default:return null}}},exports.EnumTypes=d,exports.ErrorHelper=E,exports.ExpirationReason=V,exports.FieldNames=k,exports.FieldTypes=j,exports.FolderNames=m,exports.Functionality=R,exports.GlobalSettingsNames=v,exports.HttpRequestError=T,exports.LicenseKeyInvoiceSeverity=G,exports.LicenseRestrictionKeys=_,exports.OAuthHelper=C,exports.OAuthSessionHandlerBase=f,exports.ObjectTypeIds=B,exports.QueryHelper=q,exports.RelationTypes=b,exports.ReturnCodes=u,exports.StringHelper=class{static trim(e,t,r=!1){if(null==e)return e;let s=e.trim();return s.length<=t||(s=s.substring(0,t-(r?3:0)),r&&(s+="...")),s}},exports.TokenizedServiceConnection=A,exports.VersionHelper=$,exports.VersionHelperBase=U,exports.default=S;