@genesislcap/design-system-configurator 14.340.2 → 14.341.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{106.106.c8964e685ade2534f453.js → 106.106.62c238ee809120e9bd33.js} +1 -1
- package/dist/151.151.f932791b17a4022bebeb.js +2 -0
- package/dist/{151.df7f6c518aba4dc761325e73decb24ee.js.map → 151.1c400c0081d407f15ca7e500e0bfd9f4.js.map} +1 -1
- package/dist/{347.ce7d37ed743704b61b89a37e6a239b4e.js.map → 347.2c67ff1178c3fd5dd7387589be14fa6c.js.map} +1 -1
- package/dist/347.347.3c6382a789bc4ac7cc88.js +2 -0
- package/dist/{445.445.8d9405f328db4b26d1f0.js → 445.445.2eb3e2f686752994510e.js} +4 -4
- package/dist/{445.fe951b981b2d12d1debe0fbf6bc57a21.js.map → 445.c99dbb2be2664c375152de2e9cf7c59c.js.map} +1 -1
- package/dist/{600.600.f6401b62b74ce9d79e3f.js → 600.600.7541a60320c6022cff9a.js} +2 -2
- package/dist/{600.8ed6d8423a74ccac16c90f8f0a2a8cdb.js.map → 600.9262661d7a599088d60604b1e4f3aac5.js.map} +1 -1
- package/dist/637.0b92a2ac48e083ece30e9231697630ba.js.map +1 -0
- package/dist/{637.637.a17b4ce90cb5008ca033.js → 637.637.b47d76698589ec5e1e7c.js} +5 -5
- package/dist/{665.665.5dbe1dfebc48ba8d7b20.js → 665.665.3835e0af04be5b1c3d26.js} +1 -1
- package/dist/{72.72.77f9ca403a5a6adc5436.js → 72.72.037cc7fbe94b7e97091c.js} +2 -2
- package/dist/{72.cf4df3b8552bf588c7de36a87fe52087.js.map → 72.bffdc13493c9976f93238976002176bb.js.map} +1 -1
- package/dist/906.3221bf6023775101176e8202dcf22584.js.map +1 -0
- package/dist/{906.906.feb2f9f0514b83354b74.js → 906.906.8cadd045e2867b73c84a.js} +6 -5
- package/dist/{designSystemConfigurator.5ca7a72e2bdba48d5df630e24c283bfa.js.map → designSystemConfigurator.1b9e7bbe952399e127597a55022c089b.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/main.14d9670c34ca0a2e4810.js +2 -0
- package/dist/{main.4b8baa26a51376786664527be6c66783.js.map → main.af7d055d0fd17a73c358f4cf5ccc6b3d.js.map} +1 -1
- package/dist/remoteEntry.js +2 -2
- package/package.json +13 -13
- package/dist/151.151.a74c5a9f2213a4b7f629.js +0 -2
- package/dist/347.347.cd11caccfe9e2bf3e577.js +0 -2
- package/dist/637.25818b58679b0410ab3d91543f0d3bb2.js.map +0 -1
- package/dist/906.970aa827fd5339b669d225b758968a98.js.map +0 -1
- package/dist/main.bd356ca02fc28b2fa571.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[347],{5709:(e,t,s)=>{s.d(t,{S5:()=>d});var i=s(55823),r=s(92277),n=s(33681),o=s(84674),a=s(97156);class c{constructor(){this.isConfigured=!1,this.isConnecting=!1,this.isConnected=!1,this.isReconnecting=!1,this.reconnectionLimitReached=!1,this.isConnectedSubject=new a.t(this.isConnected)}get hasValidSession(){return this.user.isAuthenticated}get isDisconnected(){return!this.isConnected}get isDisconnectedByServer(){return void 0!==this.closedClean&&!this.closedClean}isConnectedChanged(){var e;this.isConnected&&this.resetClosedState(),this.isConnecting=!1,this.isReconnecting=!1,null===(e=this.isConnectedSubject)||void 0===e||e.next(this.isConnected)}isReconnectingChanged(){this.isReconnecting&&(this.reconnectionLimitReached=!1)}resetClosedState(){this.closedCode=void 0,this.closedReason=void 0,this.closedClean=void 0}serialize(){return{isConfigured:this.isConfigured,isConnecting:this.isConnecting,isConnected:this.isConnected,isDisconnected:this.isDisconnected,isDisconnectedByServer:this.isDisconnectedByServer,isReconnecting:this.isReconnecting,reconnectionLimitReached:this.reconnectionLimitReached,hasValidSession:this.hasValidSession,closedCode:this.closedCode,closedReason:this.closedReason,closedClean:this.closedClean}}onClose(e){this.isConnected=!1,this.closedCode=e.code,this.closedReason=e.reason,this.closedClean=e.wasClean}}(0,i.Cg)([n.observable],c.prototype,"isConfigured",void 0),(0,i.Cg)([n.observable],c.prototype,"isConnecting",void 0),(0,i.Cg)([n.observable],c.prototype,"isConnected",void 0),(0,i.Cg)([n.observable],c.prototype,"isReconnecting",void 0),(0,i.Cg)([n.observable],c.prototype,"reconnectionLimitReached",void 0),(0,i.Cg)([n.observable],c.prototype,"closedCode",void 0),(0,i.Cg)([n.observable],c.prototype,"closedReason",void 0),(0,i.Cg)([n.observable],c.prototype,"closedClean",void 0),(0,i.Cg)([r.KJ],c.prototype,"user",void 0);const d=o.DI.createInterface(e=>e.singleton(c))},6884:(e,t,s)=>{s.d(t,{aB:()=>a,OD:()=>n});var i=s(84674);var r=s(34193);class n{}n.MAX_ROWS_250=250,n.MAX_VIEW_1000=1e3,n.REQ_REP_POLLING_INTERVAL_MS=1e4,n.DATASERVER_ROW_ID="ROW_REF",n.REQUEST_SERVER_ROW_ID="RECORD_ID",n.DEFAULT_PAGINATION_PAGE_SIZE=25,n.DEFAULT_REQ_REP_OFFSET=0;const o={options:{criteria:"",isSnapshot:!1,maxRows:n.MAX_ROWS_250,maxView:n.MAX_VIEW_1000,pollingInterval:n.REQ_REP_POLLING_INTERVAL_MS,movingView:!1,orderBy:"",resourceName:"",reverse:!1,pollTriggerEvents:[]},criteriaToFields:function(e){const t=e.split("&&").map(e=>e.trim()),s={};return t.forEach(e=>{if(e.startsWith("Expr"))switch(e.match(/Expr\.(\w+)\(/)[1]){case"dateIsToday":{const t=/Expr\.dateIsToday\((\w+)\)/,[,i]=e.match(t),r=new Date;s[`${i}_FROM`]=`${r.toISOString().replace(/-/g,"").split("T")[0]}-00:00`,r.setDate(r.getDate()+1),s[`${i}_TO`]=`${r.toISOString().replace(/-/g,"").split("T")[0]}-00:00`}break;case"dateTimeIsGreaterEqual":{const t=/Expr\.dateTimeIsGreaterEqual\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[`${i}_FROM`]=r}break;case"dateTimeIsLessEqual":{const t=/Expr\.dateTimeIsLessEqual\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[`${i}_TO`]=r}break;case"dateIsGreaterEqual":{const t=/Expr\.dateIsGreaterEqual\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[`${i}_FROM`]=r}break;case"dateIsLessEqual":{const t=/Expr\.dateIsLessEqual\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[`${i}_TO`]=r}break;case"containsIgnoreCase":{const t=/Expr\.containsIgnoreCase\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[i]=`*${r}*`}}else{const t=e.substr(0,e.indexOf("=")).trim().replace(/["']/g,""),i=e.substr(e.lastIndexOf("=")+1,e.length).trim().replace(/["']/g,"");s[t]=i}}),s},dataServerResultFilter:r.d},a=i.DI.createInterface(e=>e.instance(o))},9033:(e,t,s)=>{s.d(t,{yW:()=>M});var i=s(55823),r=s(33681),n=s(84674),o=s(50049),a=s(8790),c=s(1762),d=s(51046),h=s(66640),l=s(84190),u=s(65052),E=s(40113),g=s(26347),S=s(24669),v=s(48707),R=s(17465),m=s(79780);const p={throwWhenUnavailable:!0,throwWhenUnknown:!1},T=n.DI.createInterface(e=>e.instance(p)),_=(0,m.Es)("genesis-resources");let O=class{constructor(e,t){this.connect=e,this.config=t}isValidResource(e){return(0,i.sH)(this,void 0,void 0,function*(){if(!(e=null==e?void 0:e.trim()))return!1;yield this.fetchResources();return!!this.resources.find(t=>t.RESOURCE_NAME===e)})}getResourceTypeFor(e){return(0,i.sH)(this,void 0,void 0,function*(){yield this.fetchResources();const t=this.resources.find(t=>t.RESOURCE_NAME===e);if(t)return t.RESOURCE_TYPE;const s=`${e} resource does not exist.`;if(R.v.error(s),this.config.throwWhenUnknown)throw new Error(s)})}getAllResources(){return(0,i.sH)(this,void 0,void 0,function*(){return this.resources||(yield this.fetchResources()),this.resources})}destroy(){this.resources=void 0,this.resourcesPromise=void 0}fetchResources(){return(0,i.sH)(this,void 0,void 0,function*(){var e;if(this.resources)return Promise.resolve();if(this.resourcesPromise)yield this.resourcesPromise;else{this.resourcesPromise=this.connect.getAvailableResources();const t=yield this.resourcesPromise;if(this.resources=null==t?void 0:t.RESOURCES,!(null===(e=this.resources)||void 0===e?void 0:e.length)){const e="Genesis resources unavailable.";if(R.v.error(e),this.config.throwWhenUnavailable)throw new Error(e)}this.postLoadedMessage(),this.resourcesPromise=void 0}})}postLoadedMessage(){const e=n.DI.getOrCreateDOMContainer().get(_);e.postMessage("resources-loaded",this.resources),e.close()}};O=(0,i.Cg)([(0,i.Qj)(0,g.dm),(0,i.Qj)(1,T)],O);const A=n.DI.createInterface(e=>e.singleton(O));var f=s(6884),I=s(39087);let C=class{get initialized(){var e;return!!(null===(e=this.status)||void 0===e?void 0:e.isInitialized)}constructor(e,t,s,i,r){this.connect=e,this.auth=t,this.resources=s,this.config=i,this.connectEvents=r,this.fetchMetadataRequired=!0,this.startStreamRequired=!0,this.originalFieldDef=[],this.fieldMetadata=[],this.requestFields=[],this.customRequestFields=[],this.availableIndexes=[],this.criteriaOnlyRequest=!1,this.loadMoreCount=0,this.readOnly=!0,this._allParams=null,this.pollTrigger$=new o.B}triggerPoll(){this.pollTrigger$.next()}validResourceName(e){return R.v.deprecated("Datasource.validResourceName","Use `GenesisResources.isValidResource` instead."),!!e&&!!e.trim().length}init(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=this.fetchMetadataRequired,s=this.startStreamRequired){this.fetchMetadataRequired=t,this.options=Object.assign(Object.assign({},this.config.options),e),this.invalidateCache();const i=this.options.resourceName;if(!(this.connect.isConnected||(yield this.connect.connect())))return R.v.error(`Unable to connect to ${this.connect.host} to get ${i} datasource`),this.reportStatus(),!1;return(yield this.resources.isValidResource(i))?(this.resourceType=yield this.resources.getResourceTypeFor(i),this.resourceType?(this.fetchMetadataRequired&&(yield this.fetchAndApplyMetadata(this.options.resourceName),this._allParams=null),R.v.debug(`Initializing ${i} datasource from ${this.connect.host}`),!this.options.isSnapshot&&s&&(this.stream=yield this.createStream()),R.v.debug(`${i} datasource initialization ${this.initialized?"was successful.":"has failed."}`),this.reportStatus(),this.initialized):(R.v.error(`Unable to get the resource type for ${i} datasource from ${this.connect.host}`),this.reportStatus(),!1)):(R.v.error(`${i} datasource does not exist on ${this.connect.host}`),this.reportStatus(),!1)})}startStream(){return(0,i.sH)(this,void 0,void 0,function*(){this.options.isSnapshot||void 0!==this.stream||(this.stream=yield this.createStream())})}destroy(){var e,t;R.v.debug("Datasource.destroy",null===(e=this.options)||void 0===e?void 0:e.resourceName),this.commitResponseUnsubscribe&&(this.commitResponseUnsubscribe(),this.commitResponseUnsubscribe=void 0),null===(t=this.pollTrigger$)||void 0===t||t.complete(),this.status=void 0,this.fetchMetadataRequired=!0,this.options={},this.resourceType=void 0,this.availableIndexes=[],this.originalFieldDef=[],this.fieldMetadata=[],this.requestFields=[],this.criteriaOnlyRequest=!1,this.loadMoreCount=0,this.stream=void 0}get allResourceParams(){var e;if(this._allParams)return this._allParams;let t;if(this.options.orderBy)if(this.criteriaOnlyRequest||(null===(e=this.availableIndexes)||void 0===e?void 0:e.findIndex(e=>e.NAME===this.options.orderBy))>-1)t=this.options.orderBy;else{const e=this.availableIndexes.map(e=>e.NAME);R.v.warn("Specified [orderBy] index is not valid and will not be used. See https://learn.genesis.global/docs/database/data-types/index-entities/ - Available indexes:",e)}return this._allParams={CRITERIA_MATCH:this.options.criteria,MAX_ROWS:this.options.maxRows,ORDER_BY:t,VIEW_NUMBER:this.options.viewNumber,FIELDS:this.options.fields,MAX_VIEW:this.options.maxView,MOVING_VIEW:this.options.movingView,REVERSE:this.options.reverse,DISABLE_POLLING:this.options.disablePolling,OFFSET:this.options.offset,POLLING_INTERVAL:this.options.pollingInterval,REQUEST:this.options.request},R.v.debug("Getting configured params:",this._allParams),this._allParams}get dataserverOnlyParams(){return{CRITERIA_MATCH:this.allResourceParams.CRITERIA_MATCH,MAX_ROWS:this.allResourceParams.MAX_ROWS,VIEW_NUMBER:this.allResourceParams.VIEW_NUMBER,FIELDS:this.allResourceParams.FIELDS,MAX_VIEW:this.allResourceParams.MAX_VIEW,MOVING_VIEW:this.allResourceParams.MOVING_VIEW,ORDER_BY:this.allResourceParams.ORDER_BY,REVERSE:this.allResourceParams.REVERSE}}get requestOnlyParams(){const e=this.allResourceParams,{REQUEST:t}=e,s=(0,i.Tt)(e,["REQUEST"]);return{DETAILS:{CRITERIA_MATCH:this.options.requestAutoSetup?void 0:s.CRITERIA_MATCH,MAX_ROWS:s.MAX_ROWS,OFFSET:s.OFFSET,ORDER_BY:s.ORDER_BY,VIEW_NUMBER:s.VIEW_NUMBER},REQUEST:this.criteriaOnlyRequest?{}:null!=t?t:this.buildRequestFields()}}buildRequestFields(){if(!this.options.requestAutoSetup)return{};const e=Object.assign({},Object.fromEntries(this.requestFields.map(e=>[e.NAME,"*"]))),t=this.options.criteria?this.config.criteriaToFields(this.options.criteria):{};return Object.assign(Object.assign({},e),t)}updateLoadMoreCount(e){this.loadMoreCount=e}snapshot(e){return(0,i.sH)(this,void 0,void 0,function*(){switch(R.v.debug(`Requesting snapshot for ${this.options.resourceName} (${this.resourceType}).`),this.resourceType){case I.v.DATASERVER:return this.connect.snapshot(this.options.resourceName,Object.assign(Object.assign({},this.dataserverOnlyParams),e));case I.v.REQUEST_SERVER:return this.connect.request(this.options.resourceName,Object.assign(Object.assign({},this.requestOnlyParams),e));default:throw new Error(`Snapshot not supported for selected resource type: ${this.resourceType}`)}})}snapshotFiltered(){return(0,i.sH)(this,arguments,void 0,function*(e="ROW_REF"){const t=yield this.snapshot();return Array.isArray(t)?t:t.REPLY?t.REPLY:t.ROW?this.config.dataServerResultFilter(t,e).inserts:void 0})}createStream(){return(0,i.sH)(this,void 0,void 0,function*(){if(![I.v.DATASERVER,I.v.REQUEST_SERVER].includes(this.resourceType))throw new Error(`Streaming not supported for selected resource type: ${this.resourceType}`);return this.resourceType===I.v.DATASERVER?this.createDataserverStream():(R.v.debug(`Creating fake stream by polling ${this.options.resourceName} REQUEST_SERVER`),this.createReqRepStream())})}createDataserverStream(){return(0,i.sH)(this,void 0,void 0,function*(){return this.connect.stream(this.options.resourceName,e=>{},e=>R.v.error(e),this.dataserverOnlyParams)})}createReqRepStream(){this.commitResponseUnsubscribe=this.connectEvents.addCommitResponseListener(e=>{var t;const{eventName:s,response:i}=e.detail;this.options.pollTriggerEvents&&this.options.pollTriggerEvents.includes(s)&&(null===(t=i.MESSAGE_TYPE)||void 0===t?void 0:t.endsWith("_ACK"))&&(R.v.debug(`Received commit response for ${s}, triggering poll.`),this.triggerPoll())});const e=this.allResourceParams.DISABLE_POLLING?void 0:this.allResourceParams.POLLING_INTERVAL,t=()=>{const e=this.requestOnlyParams;if(this.resourceType===I.v.REQUEST_SERVER&&this.loadMoreCount>0){const t=25,s=(this.options.maxRows||t)*(this.loadMoreCount+1);e.DETAILS.MAX_ROWS=s}return(0,a.z)([this.connect.isConnected$,this.auth.isLoggedIn$]).pipe((0,h.v)(()=>this.connect.isConnected&&this.auth.isLoggedIn),(0,l.n)(()=>(0,c.H)(this.snapshot(e))))};return e?this.pollTrigger$.pipe((0,u.Z)(0),(0,l.n)(()=>(0,d.O)(0,e).pipe((0,l.n)(t)))):this.pollTrigger$.pipe((0,u.Z)(0),(0,l.n)(t))}fetchAndApplyMetadata(e){return(0,i.sH)(this,void 0,void 0,function*(){var t,s;try{R.v.debug(`Requesting metadata for ${this.options.resourceName} Datasource`);const e=yield this.connect.getMetadata(this.options.resourceName);e&&(this.availableIndexes=null!==(t=e.INDEXES)&&void 0!==t?t:[],this.originalFieldDef=(0,v.a)(e),this.fieldMetadata=(0,v.X)(this.originalFieldDef),this.requestFields=e.REQUEST_FIELD||[],this.customRequestFields=e.FIELD||[],this.criteriaOnlyRequest=e.CRITERIA_ONLY_REQUEST||!1,this.fetchMetadataRequired=!1),this.status=this.normaliseStatus({isInitialized:!0,metadataRequired:!0,hasMetadata:(null===(s=this.fieldMetadata)||void 0===s?void 0:s.length)>0})}catch(t){R.v.error(`Metadata Fetch failed for ${e}:`,t),this.status=this.normaliseStatus({isInitialized:!1,metadataRequired:!0,hasMetadata:!1})}})}reportStatus(e={}){var t;const s=null!==(t=this.config.eventEmitter)&&void 0!==t?t:document;this.status=this.normaliseStatus(e),R.v.debug(`Dispatching '${I.w}'`,this.status),null==s||s.dispatchEvent(new CustomEvent(I.w,{detail:this.status,bubbles:s!==document,composed:!0}))}normaliseStatus(e){var t,s,i,r,n;const o=null!==(t=e.isInitialized)&&void 0!==t?t:this.initialized,a=null!==(s=e.metadataRequired)&&void 0!==s?s:this.fetchMetadataRequired,c=null!==(i=e.hasMetadata)&&void 0!==i?i:(null===(r=this.fieldMetadata)||void 0===r?void 0:r.length)>0;return{name:null===(n=this.options)||void 0===n?void 0:n.resourceName,type:this.resourceType,isInitialized:o,metadataRequired:a,hasMetadata:c}}invalidateCache(){this._allParams=null}};(0,i.Cg)([r.observable],C.prototype,"status",void 0),(0,i.Cg)([r.observable],C.prototype,"fetchMetadataRequired",void 0),(0,i.Cg)([r.observable],C.prototype,"startStreamRequired",void 0),(0,i.Cg)([r.observable],C.prototype,"originalFieldDef",void 0),(0,i.Cg)([r.observable],C.prototype,"fieldMetadata",void 0),(0,i.Cg)([r.observable],C.prototype,"requestFields",void 0),(0,i.Cg)([r.observable],C.prototype,"customRequestFields",void 0),(0,i.Cg)([r.observable],C.prototype,"availableIndexes",void 0),(0,i.Cg)([r.observable],C.prototype,"criteriaOnlyRequest",void 0),(0,i.Cg)([r.observable],C.prototype,"loadMoreCount",void 0),(0,i.Cg)([r.observable],C.prototype,"readOnly",void 0),(0,i.Cg)([r.observable],C.prototype,"stream",void 0),C=(0,i.Cg)([(0,i.Qj)(0,g.dm),(0,i.Qj)(1,E.N),(0,i.Qj)(2,A),(0,i.Qj)(3,f.aB),(0,i.Qj)(4,S.a4)],C);const M=n.DI.createInterface(e=>e.transient(C))},12066:(e,t,s)=>{s.d(t,{CL:()=>r,Ey:()=>a,zT:()=>o});const i=10;function r(e){return!e||isNaN(e)?null:new Date(e).toISOString().slice(0,i)}const n=19;function o(e){return!e||isNaN(e)?null:new Date(e).toISOString().slice(0,n).replace("T"," ")}function a(e,t){return t?o(e):r(e)}},17190:(e,t,s)=>{s.d(t,{j:()=>r,r:()=>i});const i=()=>{let e=[];return{subscribe:t=>(e.push(t),()=>e=e.filter(e=>e!==t)),publish(t){e.forEach(e=>e(t))}}},r=(e,t)=>{const s={root:document.documentElement};new IntersectionObserver(e=>{e.forEach(e=>{t(e.intersectionRatio>0)})},s).observe(e)}},17465:(e,t,s)=>{s.d(t,{v:()=>r});var i=s(9709);const r=(0,i.createLogger)("foundation-comms")},21281:(e,t,s)=>{s.d(t,{Go:()=>i,Gp:()=>r,lT:()=>E,x6:()=>n,z2:()=>l});var i,r,n,o=s(55823),a=s(32808),c=s(84674),d=s(56653),h=s(98316);!function(e){e.LOGON_ACK="LOGON_ACK",e.LOGON_NACK="LOGON_NACK",e.LOGOFF_ACK="LOGOFF_ACK",e.LOGOFF_NACK="LOGOFF_NACK",e.HEARTBEAT_PING="HEARTBEAT_PING",e.HEARTBEAT_PONG="HEARTBEAT_PONG",e.MORE_ROWS="MORE_ROWS",e.MORE_COLUMNS="MORE_COLUMNS",e.MORE_COLUMNS_ACK="MORE_COLUMNS_ACK",e.MSG_ACK="MSG_ACK",e.MSG_NACK="MSG_NACK",e.LOGOUT_ACK="LOGOUT_ACK",e.LOGOUT_NACK="LOGOUT_NACK",e.QUERY_UPDATE="QUERY_UPDATE"}(i||(i={})),function(e){e.EVENT_LOGIN_AUTH="EVENT_LOGIN_AUTH",e.EVENT_LOGIN_AUTH_ACK="EVENT_LOGIN_AUTH_ACK",e.EVENT_LOGIN_AUTH_NACK="EVENT_LOGIN_AUTH_NACK",e.EVENT_LOGOUT="EVENT_LOGOUT",e.DATA_LOGON="DATA_LOGON",e.DATA_LOGOFF="DATA_LOGOFF",e.META_REQUEST="META_REQUEST",e.JSON_SCHEMA_REQUEST="JSON_SCHEMA_REQUEST",e.RESOURCES_REQUEST="RESOURCES_REQUEST",e.RESOURCES_REQUEST_ACK="RESOURCES_REQUEST_ACK",e.RESOURCES_REQUEST_NACK="RESOURCES_REQUEST_NACK",e.EVENT_CHANGE_USER_PASSWORD="EVENT_CHANGE_USER_PASSWORD",e.EVENT_SELF_SERVICE_PASSWORD_RESET="EVENT_SELF_SERVICE_PASSWORD_RESET",e.EVENT_PASSWORD_RESET_ACTION="EVENT_PASSWORD_RESET_ACTION"}(r||(r={})),function(e){e.SESSION_NOT_FOUND="SESSION_NOT_FOUND",e.UNKNOWN_MESSAGE_TYPE="UNKNOWN_MESSAGE_TYPE"}(n||(n={}));const l=(e,t)=>!!Array.isArray(null==e?void 0:e.ERROR)&&(null==e?void 0:e.ERROR.some(e=>{var s,i;return(null===(s=e.CODE)||void 0===s?void 0:s.includes(`${t}`))||(null===(i=e.STATUS_CODE)||void 0===i?void 0:i.includes(`${t}`))}));let u=class{constructor(e,t){this.session=e,this.uuid=t}createLoginMessage(e){let t;switch(e.type){case d.h.BASIC:t={USER_NAME:e.username,PASSWORD:e.password,MFA_CODE:e.mfaToken};break;case d.h.REFRESH:t={USER_NAME:e.username,REFRESH_AUTH_TOKEN:e.refreshToken,MFA_CODE:e.mfaToken};break;case d.h.SSO:t={SSO_TOKEN:e.ssoToken};break;case d.h.JWT:t={JWT:e.jwt,DOMAIN:e.domain}}return{DETAILS:t,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_LOGIN_AUTH}}createLogoutMessage(e){var t,s;return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_LOGOUT,SESSION_AUTH_TOKEN:null!==(t=e.authToken)&&void 0!==t?t:this.session.getSessionStorageItem("authToken"),SESSION_ID:null!==(s=e.sessionId)&&void 0!==s?s:this.session.getSessionStorageItem("sessionId")}}createDataLogonMessage(e,t){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.DATA_LOGON,DETAILS:Object.assign({DATASOURCE_NAME:e},t),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createDataLogoffMessage(e){return{SOURCE_REF:e,MESSAGE_TYPE:r.DATA_LOGOFF,SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createRequestMessage(e,t){return Object.assign({SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:e.startsWith("REQ_")?e:`REQ_${e}`},t)}createResourcesMessage(e){return Object.assign({SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:r.RESOURCES_REQUEST},e)}createMetaRequestMessage(e,t=r.META_REQUEST){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:t,DETAILS:{FEATURE:e},SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createCommitMessage(e,t){return Object.assign({SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:e},t)}createRefreshTokenMessage(){return{SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:r.EVENT_LOGIN_AUTH,DETAILS:{REFRESH_AUTH_TOKEN:this.session.getSessionStorageItem("refreshToken"),MFA_CODE:this.session.getSessionStorageItem("mfaToken")}}}createChangePasswordMessage(e,t,s){return{USER_NAME:e,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_CHANGE_USER_PASSWORD,DETAILS:{OLD_PASSWORD:t,NEW_PASSWORD:s}}}createForgotPasswordMessage(e,t,s=e){return{USER_NAME:s,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_SELF_SERVICE_PASSWORD_RESET,DETAILS:{USER_NAME:e,RETURN_URL:t}}}createForgotPasswordTokenMessage(e,t,s,i=e){return{USER_NAME:i,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_PASSWORD_RESET_ACTION,DETAILS:{USER_NAME:e,RESET_TOKEN:t,NEW_PASSWORD:s}}}createMoreRowsMessage(e,t){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:i.MORE_ROWS,DETAILS:{SOURCE_REF:e,VIEW_NUMBER:t},SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createMoreColumnsMessage(e){return Object.assign(Object.assign({},this.createMoreRowsMessage(e)),{MESSAGE_TYPE:i.MORE_COLUMNS})}createHTTPHeadersFromMessage(e,t="application/json; charset=UTF-8"){const s={"Content-type":t};return e.SOURCE_REF&&(s["source-ref"]=e.SOURCE_REF,s.SOURCE_REF=e.SOURCE_REF),e.SESSION_AUTH_TOKEN&&(s["SESSION-AUTH-TOKEN"]=e.SESSION_AUTH_TOKEN),e.MESSAGE_TYPE===r.EVENT_LOGOUT&&(s["SESSION-ID"]=e.SESSION_ID),s}createHeartbeatPingMessage(e=!1){return{MESSAGE_TYPE:i.HEARTBEAT_PING,SOURCE_REF:this.uuid.createId(),VERBOSE:e,DETAILS:{},SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}};u=(0,o.Cg)([(0,o.Qj)(0,h.N),(0,o.Qj)(1,a.k)],u);const E=c.DI.createInterface(e=>e.singleton(u))},24669:(e,t,s)=>{s.d(t,{EQ:()=>a,a4:()=>o});var i=s(17190),r=s(84674);class n{constructor(){this.streamListeners=(0,i.r)(),this.streamCompleteListeners=(0,i.r)(),this.streamErrorListeners=(0,i.r)(),this.commitListeners=(0,i.r)(),this.metadataListeners=(0,i.r)(),this.commitResponseListeners=(0,i.r)()}addStreamListener(e,t,s){var i,r,n;const o=null===(i=this.streamListeners)||void 0===i?void 0:i.subscribe(e),a=null===(r=this.streamCompleteListeners)||void 0===r?void 0:r.subscribe(t),c=null===(n=this.streamErrorListeners)||void 0===n?void 0:n.subscribe(s);return()=>{o(),a(),c()}}onStreamEvent(e,t,s,i){var r;null===(r=this.streamListeners)||void 0===r||r.publish(new CustomEvent("connect-stream-event",{detail:{functions:i,message:t,resourceName:e,stream:s}}))}onStreamErrorEvent(e,t,s){var i;null===(i=this.streamErrorListeners)||void 0===i||i.publish(new CustomEvent("connect-stream-error-event",{detail:{resourceName:e,stream:t,error:s}}))}onStreamCompleteEvent(e,t){var s;null===(s=this.streamCompleteListeners)||void 0===s||s.publish(new CustomEvent("connect-stream-complete-event",{detail:{resourceName:e,stream:t}}))}addCommitListener(e){var t;return null===(t=this.commitListeners)||void 0===t?void 0:t.subscribe(e)}onCommitEvent(e,t){var s;null===(s=this.commitListeners)||void 0===s||s.publish(new CustomEvent("connect-commit-event",{detail:{eventName:e,message:t}}))}addMetadataListener(e){var t;return null===(t=this.metadataListeners)||void 0===t?void 0:t.subscribe(e)}onMetadataEvent(e,t,s){var i;null===(i=this.metadataListeners)||void 0===i||i.publish(new CustomEvent("connect-metadata-event",{detail:{resourceName:e,message:t,error:s}}))}addCommitResponseListener(e){var t;return null===(t=this.commitResponseListeners)||void 0===t?void 0:t.subscribe(e)}onCommitResponseEvent(e,t){var s;null===(s=this.commitResponseListeners)||void 0===s||s.publish(new CustomEvent("connect-commit-response-event",{detail:{eventName:e,response:t}}))}}const o=r.DI.createInterface(e=>e.singleton(n)),a=r.DI.createInterface(e=>e.aliasTo(o))},26347:(e,t,s)=>{s.d(t,{dm:()=>D,tn:()=>w});var i=s(55823),r=s(84686),n=s(33681),o=s(84674),a=s(77909);class c{constructor(){this.cachedMetadata=new Map,this.cachedJsonSchema=new Map}getMetadataFor(e){return this.cachedMetadata.get(e)}getJsonSchemaFor(e){return this.cachedJsonSchema.get(e)}hasMetadataFor(e){return this.cachedMetadata.has(e)}hasJsonSchemaFor(e){return this.cachedJsonSchema.has(e)}setMetadataFor(e,t){this.cachedMetadata.set(e,t)}setJsonSchemaFor(e,t){this.cachedJsonSchema.set(e,t)}}const d=o.DI.createInterface(e=>e.singleton(c));var h=s(17465),l=s(24669),u=s(49587),E=s(49229),g=s(97156),S=s(7827),v=s(1762),R=s(84190),m=s(78213),p=s(66640),T=s(16220),_=s(98316),O=s(32748);const A={polling:Object.assign({POLLING_MAP:{EVENT_AMEND_USER:{TEMP_FREQUENCY:500,AMOUNT_OF_POLLS:5,QUERIES:["ALL_USERS"]}},POLLING_INTERVAL_MAP:{ALL_TRADES:5e3,ALL_USERS:5e3,ALL_PROCESSES_STATUS:1e4},POLLING_FREQUENCY:5e3},{})},f=o.DI.createInterface(e=>e.instance(A));var I=s(21281);const C=(e,t)=>((null==t?void 0:t.ROW)&&e&&e.length>0?t.ROW.forEach(t=>{const s=t;if(s&&s.DETAILS){const i=s.DETAILS.ROW_REF,r=s.DETAILS.OPERATION;"INSERT"===r&&(e.find(e=>{var t;return(null===(t=e.DETAILS)||void 0===t?void 0:t.ROW_REF)===i})||e.unshift(s)),"DELETE"===r&&(e=e.filter(e=>{var s,i;return(null===(s=t.DETAILS)||void 0===s?void 0:s.ROW_REF)!==(null===(i=e.DETAILS)||void 0===i?void 0:i.ROW_REF)})),"MODIFY"===r&&(e=e.map(e=>{var t;return(null===(t=e.DETAILS)||void 0===t?void 0:t.ROW_REF)===i?Object.assign(Object.assign({},e),s):e}))}}):!t||e&&0!==e.length||(e=[...new Set(t.ROW)]),e);var M;let b=M=class{get isConnected(){return this._isConnected}set isConnected(e){this._isConnected=e,this.isConnectedSubject.next(this._isConnected)}constructor(e,t,s,i,r,n){var o;this.http=e,this.messageBuilder=t,this.session=s,this.metaCache=i,this.serializer=r,this.config=n,this.isWorking=!1,this._isConnected=!1,this.isConnectedSubject=new g.t(this._isConnected),this.isConnected$=null===(o=this.isConnectedSubject)||void 0===o?void 0:o.asObservable(),this.ongoingTurbo={},this.streams=new Map}checkHost(){return(0,i.sH)(this,void 0,void 0,function*(){try{return this.getMessage({MESSAGE_TYPE:I.Go.HEARTBEAT_PING,SOURCE_REF:"host check"}).then(e=>e.MESSAGE_TYPE===I.Go.HEARTBEAT_PONG)}catch(e){return h.v.error(e),!1}})}send(e,t){return this.http.post(M.getUrl(this.host,e),{body:M.getBody(e),headers:this.messageBuilder.createHTTPHeadersFromMessage(e)})}httpMode(){return!0}setValidSession(e){h.v.deprecated("setValidSession","Please refrain from calling this API as this state is managed internally.","15.0.0")}connect(e){return(0,i.sH)(this,void 0,void 0,function*(){return this.host=e,this.host.endsWith("/")||(this.host=this.host.concat("/")),this.checkHost().then(e=>(this.isConnected=e,this.session.setSessionStorageItem("hostUrl",this.host),e))})}disconnect(){this.isConnected=!1,this.streams.clear(),this.ongoingTurbo={},this.host=void 0}snapshot(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createDataLogonMessage(e,t);return h.v.debug(`HTTP MODE - ${s.MESSAGE_TYPE} (snapshot) message created -> `,s),this.send(s).then(e=>(this.dataLogoff(s.SOURCE_REF).catch(e=>h.v.error(e)),e))})}stream(e,t,s,i){const r=this.messageBuilder.createDataLogonMessage(e,i);h.v.debug(`HTTP MODE - ${r.MESSAGE_TYPE} (stream) message created -> `,r);const n=r.SOURCE_REF;this.streams.set(n,{SOURCE_REF:n,POLLING_FREQUENCY:new g.t(this.config.polling.POLLING_FREQUENCY),RESOURCE_NAME:e});const o=this.streams.get(n).POLLING_FREQUENCY,a=(0,S.x)((0,v.H)(this.send(r)),o.pipe((0,R.n)(e=>(0,m.Y)(e))).pipe((0,R.n)(()=>(0,v.H)(this.getMessage(r))))).pipe((0,p.v)(()=>this.streams.has(n)),(0,T.j)(()=>{h.v.debug(`Terminating stream for ${e} - ${n}`),this.dataLogoff(n)}));return this.streams.get(n).STREAM=a,a}streamState(e,t=()=>{},s=()=>{},i,r=[]){return this.stream(e,t,s,i).pipe((0,a.S)(C,r))}streamWithoutAutoTeardown(e,t,s,i){return h.v.deprecated("streamWithoutAutoTeardown","Please use 'stream' api instead.","15.0.0"),this.stream(e,t,s,i)}getMessage(e){return(0,i.sH)(this,void 0,void 0,function*(){return this.http.get(M.getUrl(this.host,e),{headers:this.messageBuilder.createHTTPHeadersFromMessage(e)})})}getMoreRows(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMoreRowsMessage(e);return h.v.debug(`HTTP MODE - ${t.MESSAGE_TYPE} message created -> `,t),this.send(t)})}getMoreColumns(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMoreColumnsMessage(e);return this.send(t)})}dataLogoff(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createDataLogoffMessage(e);return this.send(t).then(t=>(this.streams.has(e)&&(h.v.debug(`Removing stream ${e}`),this.streams.delete(e)),t))})}getMetadata(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=!0){const s=this.messageBuilder.createMetaRequestMessage(e);return h.v.debug(`HTTP MODE - ${s.MESSAGE_TYPE} (metadata) message created -> `,s),this.send(s).then(e=>e.DETAILS)})}getJSONSchema(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMetaRequestMessage(e,I.Gp.JSON_SCHEMA_REQUEST);return h.v.debug(`HTTP MODE! - ${t.MESSAGE_TYPE} (json schema) message created -> `,t),this.send(t)})}request(e,t){const s=this.messageBuilder.createRequestMessage(e,t);return h.v.debug(`HTTP MODE! - ${s.MESSAGE_TYPE} (request server) message created -> `,s),this.send(s)}getAvailableResources(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createResourcesMessage(e);return h.v.debug(`HTTP MODE! - ${t.MESSAGE_TYPE} (getResources) message created -> `,t),this.send(t)})}commitEvent(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createCommitMessage(e,t);return h.v.debug(`HTTP MODE! - ${s.MESSAGE_TYPE} (commit) message created -> `,s),this.send(s).then(t=>(this.maybeTurbo(e,t),t))})}maybeTurbo(e,t){var s;if(!(null===(s=null==t?void 0:t.MESSAGE_TYPE)||void 0===s?void 0:s.endsWith("_ACK")))return;if(this.ongoingTurbo[e])return void h.v.debug(`${e} polling frequency is already accelerated.`);const i=this.config.polling.POLLING_MAP[e];if(!(null==i?void 0:i.TEMP_FREQUENCY)||!i.AMOUNT_OF_POLLS)return;const r=i.TEMP_FREQUENCY,n=r*i.AMOUNT_OF_POLLS,o=JSON.parse(JSON.stringify(this.config.polling.POLLING_INTERVAL_MAP)),a=JSON.parse(JSON.stringify(this.config.polling.POLLING_INTERVAL_MAP));for(const e of i.QUERIES)a[e]=r,o[e]||(o[e]=this.config.polling.POLLING_FREQUENCY);h.v.debug(`${e} TRIGGERED -> ENFORCING TURBO | FREQUENCY=${r}ms DURATION=${n}`),this.ongoingTurbo[e]=!0,this.updateIntervals({polling:{POLLING_INTERVAL_MAP:a}}),setTimeout(()=>{h.v.debug(`RESTORED ORIGINAL POLLING INTERVALS FOR ${e}`),this.updateIntervals({polling:{POLLING_INTERVAL_MAP:o}}),this.ongoingTurbo[e]=!1},n)}updateIntervals(e){const{POLLING_INTERVAL_MAP:t}=e.polling;t&&(this.config.polling.POLLING_INTERVAL_MAP=t,this.handlePollingIntervalMapUpdate(t))}handlePollingIntervalMapUpdate(e){if(e)for(const t in e){if(!e.hasOwnProperty(t))continue;const s=e[t];this.config.polling.POLLING_INTERVAL_MAP[t]=s,h.v.debug(`Setting polling frequency for ${t} = ${s}`),[...this.streams.values()].filter(e=>e.RESOURCE_NAME===t).forEach(e=>{var t;return null===(t=null==e?void 0:e.POLLING_FREQUENCY)||void 0===t?void 0:t.next(s)})}}static getBody(e){return JSON.stringify(e)}static getUrl(e,t){const s=t.MESSAGE_TYPE;let i=t.MESSAGE_TYPE.replace(/_/g,"-").toLowerCase();return s===I.Gp.DATA_LOGON&&(i=t.DETAILS.DATASOURCE_NAME.replace(/_/g,"-").toLowerCase()),`${e}${i}`}};(0,i.Cg)([n.observable],b.prototype,"host",void 0),(0,i.Cg)([n.observable],b.prototype,"isWorking",void 0),(0,i.Cg)([n.observable],b.prototype,"_isConnected",void 0),(0,i.Cg)([n.volatile],b.prototype,"isConnected",null),b=M=(0,i.Cg)([(0,i.Qj)(0,O.l),(0,i.Qj)(1,I.lT),(0,i.Qj)(2,_.N),(0,i.Qj)(3,d),(0,i.Qj)(4,E.b_),(0,i.Qj)(5,f)],b);const N=o.DI.createInterface(e=>e.singleton(b));var L=s(45230);let U=class{get isConnected(){return this.socket.isConnected}get isConnectedSubject(){return this.socket.isConnectedSubject}get isConnected$(){var e;return null===(e=this.socket.isConnectedSubject)||void 0===e?void 0:e.asObservable()}get host(){return this.socket.host}constructor(e,t,s,i,r){this.socket=e,this.messageBuilder=t,this.metaCache=s,this.events=i,this.config=r,this.isWorking=!1}httpMode(){return!1}setValidSession(e){h.v.deprecated("setValidSession","Please refrain from calling this API as this state is managed internally.","15.0.0")}send(e,t){return this.socket.send(e,t)}connect(){return(0,i.sH)(this,arguments,void 0,function*(e=r.vN){return this.socket.reset(),this.socket.connect(e,this.config.connect,this.config.reconnect)})}disconnect(){this.socket.reset()}snapshot(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createDataLogonMessage(e,t);return h.v.debug(`${s.MESSAGE_TYPE} (snapshot) message created -> `,s),this.socket.send(s)})}stream(e,t,s,i){const r=this.messageBuilder.createDataLogonMessage(e,i);h.v.debug(`${r.MESSAGE_TYPE} (stream) message created -> `,r);const n=this.socket.sendForStream(r,t,t=>{s(t),this.events.onStreamErrorEvent(e,n,t)},()=>{this.events.onStreamCompleteEvent(e,n)});return this.events.onStreamEvent(e,r,n,{onMessage:t,onError:s}),n}streamState(e,t=()=>{},s=()=>{},i,r=[]){return this.stream(e,t,s,i).pipe((0,a.S)(C,r))}streamWithoutAutoTeardown(e,t,s,i){h.v.deprecated("streamWithoutAutoTeardown","Please use 'stream' api instead.","15.0.0");const r=this.messageBuilder.createDataLogonMessage(e,i);h.v.debug(`${r.MESSAGE_TYPE} (stream without auto-teardown) message created -> `,r);const n=this.socket.sendForStreamWithoutTeardown(r,t,t=>{s(t),this.events.onStreamErrorEvent(e,n,t)});return this.events.onStreamEvent(e,r,n,{onMessage:t,onError:s}),n}getMoreRows(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createMoreRowsMessage(e,t);return h.v.debug(`${s.MESSAGE_TYPE} message created -> `,s),this.socket.send(s,!1)})}getMoreColumns(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMoreColumnsMessage(e);return this.socket.send(t)})}dataLogoff(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createDataLogoffMessage(e);return h.v.debug(`${t.MESSAGE_TYPE} message created -> `,t),this.socket.send(t)})}getMetadata(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=!0){var s;if(t&&this.metaCache.hasMetadataFor(e))return h.v.debug(`Cached metadata retrieved for ${e}`),this.metaCache.getMetadataFor(e);const i=this.messageBuilder.createMetaRequestMessage(e);let r,n;h.v.debug(`${i.MESSAGE_TYPE} (metadata) message created -> `,i);try{this.isWorking=!0;const t=yield this.socket.send(i);r=null!==(s=null==t?void 0:t.DETAILS)&&void 0!==s?s:{},Object.keys(r).length&&this.metaCache.setMetadataFor(e,r)}catch(e){throw n=e,h.v.error(e),n}finally{this.events.onMetadataEvent(e,i,n),this.isWorking=!1}return r})}getJSONSchema(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=!0){var s;if(t&&this.metaCache.hasJsonSchemaFor(e))return h.v.debug(`Cached JsonSchema retrieved for ${e}`),this.metaCache.getJsonSchemaFor(e);const i=this.messageBuilder.createMetaRequestMessage(e,I.Gp.JSON_SCHEMA_REQUEST);let r;h.v.debug(`${i.MESSAGE_TYPE} (json schema) message created -> `,i);try{this.isWorking=!0,r=null!==(s=yield this.socket.send(i))&&void 0!==s?s:{},Object.keys(r).length&&this.metaCache.setJsonSchemaFor(e,r)}catch(e){h.v.error(e)}finally{this.isWorking=!1}return r})}request(e,t){const s=this.messageBuilder.createRequestMessage(e,t);return h.v.debug(`${s.MESSAGE_TYPE} (request server) message created -> `,s),this.socket.send(s)}getAvailableResources(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createResourcesMessage(e);return h.v.debug(`${t.MESSAGE_TYPE} (resources) message created -> `,t),this.socket.send(t)})}commitEvent(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createCommitMessage(e,t);h.v.debug(`${s.MESSAGE_TYPE} (commit) message created -> `,s);const i=this.socket.send(s);return this.events.onCommitEvent(e,s),i.then(t=>(this.events.onCommitResponseEvent(e,t),t))})}};(0,i.Cg)([n.observable],U.prototype,"isWorking",void 0),U=(0,i.Cg)([(0,i.Qj)(0,L.yQ),(0,i.Qj)(1,I.lT),(0,i.Qj)(2,d),(0,i.Qj)(3,l.EQ),(0,i.Qj)(4,u.R)],U);const y="true"===r.PF||!1,P=o.DI.createInterface(e=>e.singleton(U)),D=o.DI.createInterface(e=>y?e.aliasTo(N):e.aliasTo(P));function w(){return o.DI.getOrCreateDOMContainer().get(D)}},32748:(e,t,s)=>{s.d(t,{l:()=>a});var i=s(55823),r=s(49229),n=s(84674);let o=class{constructor(e){this.serializer=e}get(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=yield fetch(e,Object.assign(Object.assign({credentials:"include",headers:{"Content-type":"application/json; charset=UTF-8"}},t),{method:"GET"}));return(t.serializer||this.serializer).deserialize(s)})}post(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=yield fetch(e,Object.assign(Object.assign({credentials:"include",headers:{"Content-type":"application/json; charset=UTF-8"}},t),{method:"POST"}));return(t.serializer||this.serializer).deserialize(s)})}};o=(0,i.Cg)([(0,i.Qj)(0,r.b_)],o);const a=n.DI.createInterface(e=>e.singleton(o))},32808:(e,t,s)=>{s.d(t,{k:()=>c});var i=s(55823),r=s(84674),n=s(31261),o=s(28745);class a{constructor(){}createId(e=!1){const t=(0,n.A)();return e&&o.v.debug(`UUID.createID ${t}`),t}createRemoteId(){return(0,i.sH)(this,arguments,void 0,function*(e=!1){const t=(0,n.A)();return e&&o.v.debug(`UUID.createRemoteID ${t}`),t})}}const c=r.DI.createInterface(e=>e.singleton(a))},34193:(e,t,s)=>{s.d(t,{d:()=>r});var i=s(17465);function r(e,t="ROW_REF"){const s=e=>{const s=Object.assign(Object.assign({},e),{[t]:e.DETAILS[t]});return delete s.DETAILS,s},r=[],n=[],o=[];for(const t of e.ROW)if(t.DETAILS)switch(t.DETAILS.OPERATION){case"INSERT":r.push(s(t));break;case"MODIFY":o.push(s(t));break;case"DELETE":n.push(s(t));break;default:i.v.error(`Unsupported operation type: '${t.DETAILS.OPERATION}'`)}return{inserts:r,deletes:n,updates:o,SOURCE_REF:e.SOURCE_REF}}},39087:(e,t,s)=>{var i;s.d(t,{v:()=>i,w:()=>r}),function(e){e.DATASERVER="DATASERVER",e.EVENT_HANDLER="EVENT_HANDLER",e.REQUEST_SERVER="REQUEST_SERVER"}(i||(i={}));const r="datasource-status-changed"},40113:(e,t,s)=>{s.d(t,{N:()=>L});var i=s(55823),r=s(92277),n=s(33681),o=s(84674),a=s(97156),c=s(26347),d=s(21281),h=s(10447),l=s(56653),u=s(98316),E=s(17465);const g=o.DI.createInterface();function S(){return(null===navigator||void 0===navigator?void 0:navigator.credentials)?"PasswordCredential"in window||(E.v.warn("PasswordCredential not available in this browser."),!1):(E.v.warn("CredentialsContainer not available in this browser."),!1)}const v=":";function R(e="",t=v,s){return e.split(t,s).map(e=>e.trim()).filter(e=>""!==e)}function m(e,t=v){const s="string"==typeof e&&e.trim();return!!s&&s.includes(t)}function p(e,t=v){return"string"==typeof e&&e.trim()?(e.match(new RegExp(t,"g"))||[]).length:0}function T(e,t=v){for(const s of e)if(m(s,t))return s;return e.find(e=>"string"==typeof e&&!!e.trim())}function _(e,t,s){const i="string"==typeof e&&e.trim();return!i||s&&!i.includes(s)||p(i)>1?s&&t&&s!==t?`${t}:${s}`:t||s:i}function O(e="credential"){E.v.warn(`Unable to migrate legacy ${e} to latest format. Please remove from your browser.`)}const A={password:!0,mediation:"optional"},f={cookie:{path:"/",name:"credentials",expires:7300,storePasswords:!1}};let I=class{constructor(e,t=f){this.session=e,this.config=t}createBasicCredentials(e){return{type:l.h.BASIC,username:e.username,password:e.password,mfaToken:this.getMFAToken()}}createRefreshCredentials(e){var t,s,i;return{type:l.h.REFRESH,username:null!==(t=null==e?void 0:e.username)&&void 0!==t?t:this.getUsername(),refreshToken:null!==(s=null==e?void 0:e.refreshToken)&&void 0!==s?s:this.getRefreshToken(),mfaToken:null!==(i=null==e?void 0:e.mfaToken)&&void 0!==i?i:this.getMFAToken()}}createSSOCredentials(e){var t;return{type:l.h.SSO,ssoToken:null!==(t=null==e?void 0:e.ssoToken)&&void 0!==t?t:this.getSSOToken()}}validateBasicCredentials(e){return e&&!!e.username&&!!e.password}validateRefreshCredentials(e){return e&&!!e.refreshToken&&!!e.username}validateSSOCredentials(e){return e&&!!e.ssoToken}validateUserCredentialData(e,t){const s=e&&!!e.id&&!!e.name&&!e.name.includes(v)&&p(e.id)<=1;return t?s&&!!e.password:s}normaliseLegacyCredentialData(e,t){if(this.validateUserCredentialData(e,!0))return[e,!0];if(this.validateUserCredentialData(t))return[t,!1];if(e)try{const t=e,[s]=R(t.name||t.id),[i,r]=R(T([t.id,t.name]));return[{id:_(t.id||t.name,s,r),name:s,password:t.password||""},!0]}catch(e){O("PasswordCredential")}if(t)try{const e=t,[s]=R(e.name||e.username||e.organisation),[i,r]=R(T([e.organisation||e.username||e.name]));return[{id:_(e.id||e.username||e.name,s,r),name:s,password:e.password||""},!1]}catch(e){O("cookie")}return[void 0,!1]}storeCredentialsInContainer(e){return(0,i.sH)(this,void 0,void 0,function*(){if(!S())return;const t=new PasswordCredential(e);return E.v.debug("Storing credentials in CredentialsContainer"),navigator.credentials.store(t)})}getCredentialsFromContainer(){return(0,i.sH)(this,arguments,void 0,function*(e=A){if(S())return E.v.debug("Getting credentials from CredentialsContainer"),yield navigator.credentials.get(e)})}storeCredentialsInCookie(e){const{password:t}=e,s=(0,i.Tt)(e,["password"]),r=this.config.cookie.storePasswords?e:s;return E.v.debug("Storing credentials in cookie"),!!h.A.set(this.config.cookie.name,JSON.stringify(r),{expires:this.config.cookie.expires,domain:location.hostname,path:this.config.cookie.path,secure:!0})}getCredentialsFromCookie(){E.v.debug("Getting credentials from cookie");const e=h.A.get(this.config.cookie.name);return e?JSON.parse(e):void 0}storeCredentials(e){return(0,i.sH)(this,void 0,void 0,function*(){if(S()){const t=yield this.storeCredentialsInContainer(e);return Promise.resolve(!!t)}return Promise.resolve(this.storeCredentialsInCookie(e))})}getCredentials(e){return(0,i.sH)(this,void 0,void 0,function*(){return S()?this.getCredentialsFromContainer(e):Promise.resolve(this.getCredentialsFromCookie())})}getSSOToken(){return this.session.getSessionStorageItem("ssoToken")}getUsername(){return this.session.getSessionStorageItem("username")||this.session.getLocalStorageItem("username")}getRefreshToken(){return this.session.getSessionStorageItem("refreshToken")||this.session.getLocalStorageItem("refreshToken")}getMFAToken(){return this.session.getSessionStorageItem("mfaToken")}removeCookie(){h.A.remove(this.config.cookie.name,{domain:location.hostname,path:this.config.cookie.path})}removeSSOToken(){this.session.removeSessionStorageItem("ssoToken")}removeUsername(){this.session.removeSessionStorageItem("username"),this.session.removeLocalStorageItem("username")}removeRefreshToken(){this.session.removeSessionStorageItem("refreshToken"),this.session.removeLocalStorageItem("refreshToken")}removeMFAToken(){this.session.removeSessionStorageItem("mfaToken")}removeAll(){this.removeCookie(),this.removeSSOToken(),this.removeUsername(),this.removeRefreshToken(),this.removeMFAToken()}preventSilentAccess(){return S()&&navigator.credentials.preventSilentAccess()}};I=(0,i.Cg)([(0,i.Qj)(0,u.N),(0,i.Qj)(1,(0,o.optional)(g))],I);const C=o.DI.createInterface(e=>e.singleton(I)),M=e=>Array.isArray(e)?e.map(e=>null!=e?e:""):[],b=e=>{try{if("EVENT_LOGIN_AUTH_ACK"===(null==e?void 0:e.MESSAGE_TYPE)){const{DETAILS:i}=e;return{messageType:e.MESSAGE_TYPE,sourceRef:e.SOURCE_REF,userName:e.USER_NAME,updateQueue:e.UPDATE_QUEUE,zeroMqProxyModeEnabled:e.ZERO_MQ_PROXY_MODE_ENABLED,zeroMqProxyInboundPort:e.ZERO_MQ_PROXY_INBOUND_PORT,zeroMqProxyOutboundPort:e.ZERO_MQ_PROXY_OUTBOUND_PORT,userKVs:e.USER,details:i?{system:(s=i.SYSTEM,s?{date:s.DATE}:null),heartbeatIntervalSecs:i.HEARTBEAT_INTERVAL_SECS,failedLoginAttempts:i.FAILED_LOGIN_ATTEMPTS,rejectedLoginAttempts:i.REJECTED_LOGIN_ATTEMPTS,lastLoginDatetime:i.LAST_LOGIN_DATETIME,daysToPasswordExpiry:i.DAYS_TO_PASSWORD_EXPIRY,product:(t=i.PRODUCT,t?t.map(e=>({name:e.NAME,version:e.VERSION})):[])}:null,permission:M(e.PERMISSION),profile:M(e.PROFILE)}}throw new Error("No Entity mapping implementation for provided DTO")}catch(e){throw E.v.error(e),e}var t,s};let N=class{loggedUserResultChanged(){var e;null===(e=this.isLoggedInSubject)||void 0===e||e.next(this.isLoggedIn)}get isLoggedIn$(){return this.isLoggedInSubject.asObservable()}get isLoggedIn(){return this.currentUser.isAuthenticated}constructor(e,t,s,i,r){this.session=e,this.connect=t,this.messageBuilder=s,this.credentialManager=i,this.currentUser=r,this.isWorking=!1,this.isLoggedInSubject=new a.t(this.isLoggedIn),this.currentUser.addAuthenticationChangeListener(e=>{var t;null===(t=this.isLoggedInSubject)||void 0===t||t.next(e.detail)})}login(e){return(0,i.sH)(this,void 0,void 0,function*(){var t;this.isWorking=!0;try{const s=this.messageBuilder.createLoginMessage(e),i=yield this.connect.send(s);if(!i||i.ERROR||(null===(t=i.DETAILS)||void 0===t?void 0:t.ERROR))throw new l.l(s,i);this.applyAuthResults({authToken:i.SESSION_AUTH_TOKEN,refreshToken:i.REFRESH_AUTH_TOKEN,profiles:i.PROFILE,username:i.USER_NAME,permissions:i.PERMISSION,sessionId:i.SESSION_ID}),this.currentUser.set(b(i)),this.session.setAuthResult(i),E.v.debug("Login Authentication Result:",i)}catch(e){if(E.v.error("Login Authentication Error:",e),!(e instanceof l.l&&e.isIgnorableError()))throw this.removeAuthResults(),this.currentUser.unset(),e;E.v.warn("Ignoring authentication error as it is a known edge case.")}finally{this.isWorking=!1}return this.loggedUserResult})}logout(){return(0,i.sH)(this,void 0,void 0,function*(){var e;this.isWorking=!0;let t={success:!1};try{const s=this.messageBuilder.createLogoutMessage(this.loggedUserResult);this.session.deleteUserFromSessionStorage();const{CODE:i,DETAILS:r,ERROR:n,MESSAGE_TYPE:o,OIDC_LOGOUT_URL:a}=yield this.connect.send(s),c=null!==(e=null==r?void 0:r.ERROR)&&void 0!==e?e:n,h=o===d.Go.LOGOUT_NACK;h&&E.v.warn("Unexpected Logout NACK received during logout.",c),t={success:o===d.Go.LOGOUT_ACK||i===d.x6.SESSION_NOT_FOUND||!h,error:c},a&&window.open(a,"_self")}catch(e){const s=new l.l(e.sentMessage,e.receivedMessage);if(E.v.error("Logout Authentication Error:",s),!s.isIgnorableError())throw e;E.v.warn("Ignoring authentication error as it is a known edge case."),t.success=!0}finally{this.removeAuthResults(),this.currentUser.unset(),this.isWorking=!1}return t})}reAuthFromSession(){return(0,i.sH)(this,void 0,void 0,function*(){const e=yield this.ensureConnection(),t=this.credentialManager.createRefreshCredentials();if(e&&this.credentialManager.validateRefreshCredentials(t)){const e=this.messageBuilder.createRefreshTokenMessage(),t=yield this.connect.send(e);if((null==t?void 0:t.MESSAGE_TYPE)===d.Gp.EVENT_LOGIN_AUTH_ACK)return this.session.setAuthResult(t),this.currentUser.set(b(t)),this.applyAuthResults(this.getLoggedUserFromMessage(t)),!0}return this.session.deleteUserFromSessionStorage(),this.currentUser.unset(),!1})}ensureConnection(){return(0,i.sH)(this,void 0,void 0,function*(){if(this.connect.isConnected)return!0;const e=this.session.getSessionStorageItem("hostUrl");return!!e&&this.connect.connect(e)})}getLoggedUserFromMessage(e){const t=e.USER_NAME,s=e.SESSION_AUTH_TOKEN,i=e.REFRESH_AUTH_TOKEN;return t&&s&&i?{username:t,authToken:s,refreshToken:i,profiles:e.PROFILE,permissions:e.PERMISSION,sessionId:e.SESSION_ID}:null}applyAuthResults(e){e?this.loggedUserResult={authToken:e.authToken,refreshToken:e.refreshToken,profiles:e.profiles,username:e.username,permissions:e.permissions,sessionId:e.sessionId}:this.removeAuthResults()}removeAuthResults(){this.loggedUserResult=null}};(0,i.Cg)([n.observable],N.prototype,"isWorking",void 0),(0,i.Cg)([n.observable],N.prototype,"loggedUserResult",void 0),N=(0,i.Cg)([(0,i.Qj)(0,u.N),(0,i.Qj)(1,c.dm),(0,i.Qj)(2,d.lT),(0,i.Qj)(3,C),(0,i.Qj)(4,r.KJ)],N);const L=o.DI.createInterface(e=>e.singleton(N))},40370:(e,t,s)=>{s.d(t,{C:()=>a});var i=s(55823),r=s(33681),n=s(17465),o=s(39087);const a=e=>{class t extends e{constructor(){super(),this.hasOwnProperty("onDatasourceStatusChanged")||(this.onDatasourceStatusChanged=e=>{var t;this.resourceName||n.v.warn("Target classes must have a resourceName property to use the DatasourceEventHandler mixin.");const s=e.detail;if(s.name===this.resourceName){const e=null!==(t=this.datasourceStatus)&&void 0!==t?t:{isInitialized:!1,hasMetadata:!1};(e.isInitialized!==s.isInitialized||s.metadataRequired&&e.hasMetadata!==s.hasMetadata)&&(this.datasourceStatus=s)}})}datasourceStatusChanged(e,t){n.v.debug("Target classes should override the datasourceStatusChanged method of the DatasourceEventHandler mixin to respond to changes in the target datasource.")}connectedCallback(){super.connectedCallback(),document.addEventListener(o.w,this.onDatasourceStatusChanged,{passive:!0,capture:!0})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(o.w,this.onDatasourceStatusChanged,{capture:!0})}}return(0,i.Cg)([r.observable],t.prototype,"datasourceStatus",void 0),t}},40729:(e,t,s)=>{s.d(t,{O:()=>d});var i=s(33681);const r=new Map([["FAST-TEXT-AREA","input"],["FAST-TEXT-FIELD","input"],["FOUNDATION-TEXT-AREA","input"],["FOUNDATION-TEXT-FIELD","input"],["INPUT","input"],["ZERO-TEXT-FIELD","input"]]);function n(e){this.keyAttr||(this.target[this.targetName]=e)}function o(e,t){this.keyAttr&&(this.updateTarget=n),this.originalBind.call(this,e,t),this.target.addEventListener(this.changeEvent,this.changeHandler)}function a(){this.originalUnbind.call(this),this.target.removeEventListener(this.changeEvent,this.changeHandler)}class c extends i.HTMLBindingDirective{constructor(e,t,s,i){super(e),this.keyAttr=i,this.conversionType=t,this.eventName=s}createBehavior(e){const t=super.createBehavior(e);return t.originalBind=t.bind,t.originalUnbind=t.unbind,t.keyAttr=this.keyAttr,t.bind=o,t.unbind=a,t.changeEvent=function(e,t){var s;const i=e.tagName;return"default"===t?null!==(s=r.get(i))&&void 0!==s?s:"change":t}(e,this.eventName),t.changeHandler=()=>{const e="boolean"===this.conversionType?t.target.checked:t.target.value;if(this.keyAttr){const s=t.bindingObserver.last,i=t.target[this.keyAttr];s.propertySource[s.propertyName][i]=this.convert(e)}else{const s=t.bindingObserver.last;s.propertySource[s.propertyName]=this.convert(e)}},t}convert(e){if(null==e)return e;switch(this.conversionType){case"time":const t=new Date(e).getTime();return isNaN(t)?void 0:t;case"number":return e.length?Number(e):void 0;case"string":return String(e);case"boolean":return Boolean(e);default:return e}}}function d(e,t="string",s="default",i){return new c(e,t,s,i)}},41119:(e,t,s)=>{var i;s.d(t,{v:()=>r,w:()=>i}),function(e){e.STRING="STRING",e.NUMBER="NUMBER",e.BOOLEAN="BOOLEAN",e.ENUM="ENUM",e.DATE="DATE",e.DATETIME="DATETIME",e.CUSTOM="CUSTOM",e.NANO_TIMESTAMP="NANO_TIMESTAMP"}(i||(i={}));const r={STRING:i.STRING,ENUM:i.ENUM,BOOLEAN:i.BOOLEAN,INT:i.NUMBER,LONG:i.NUMBER,DOUBLE:i.NUMBER,BIGDECIMAL:i.NUMBER,DATE:i.DATE,DATETIME:i.DATETIME,NANO_TIMESTAMP:i.NANO_TIMESTAMP}},45230:(e,t,s)=>{s.d(t,{yQ:()=>G,Ol:()=>F});var i=s(55823),r=s(92277),n=s(84686),o=s(49229),a=s(32808),c=s(33681),d=s(84674),h=s(50049),l=s(37970),u=s(75841),E=s(26274),g=s(53193),S=s(84190),v=s(82834),R=s(66640),m=s(53940),p=s(48653),T=s(98316),_=s(17465),O=s(49587),A=s(32748),f=s(21281);const I=1e4,C=6e4;var M;!function(e){e.Linear="linear",e.Exponential="exponential"}(M||(M={}));const b=(e,t)=>{const{reconnectInterval:s=I}=e,i=s>C?C:s,r=Math.round(Math.log2(C/i));return i*Math.pow(2,t%r)},N=e=>{const{reconnectInterval:t=I}=e;return t>C?C:t};var L,U=s(5709);class y{constructor(e){this.interval=e}get workerScript(){return`\n const startTime = Date.now();\n setInterval(function() {\n self.postMessage(Date.now() - startTime);\n }, ${this.interval});\n `}start(e){this.stop(),this.runWorker(e)}stop(){this.worker&&(this.worker.terminate(),delete this.worker)}runWorker(e){this.worker||(this.worker=new Worker(URL.createObjectURL(new Blob([this.workerScript],{type:"text/javascript"}))),this.worker.onmessage=t=>e(t.data))}}class P extends h.B{constructor(){super()}}l.c;class D{constructor(e,t,s,i){this._message=e,this._onMessage=t,this._onError=s,this._isSubscription=i}get sentMessage(){return this._message}get onReceivedMessage(){return this._onMessage}get onReceivedError(){return this._onError}get isSubscription(){return this._isSubscription}}let w=L=class{get isConfigured(){return this.status.isConfigured}get isConnecting(){return this.status.isConnecting}get isConnected(){return this.status.isConnected}get isConnectedSubject(){return this.status.isConnectedSubject}get isDisconnected(){return this.status.isDisconnected}get isDisconnectedByServer(){return this.status.isDisconnectedByServer}get isReconnecting(){return this.status.isReconnecting}get hasValidSession(){return _.v.deprecated("get hasValidSession","Use `User.isAuthenticated` from `@genesislcap/foundation-user` instead.","15.0.0"),this.user.isAuthenticated}set hasValidSession(e){_.v.deprecated("set hasValidSession","Please refrain from calling this API as this state is managed internally.","15.0.0")}get host(){var e;return null!==(e=this.url)&&void 0!==e?e:n.vN}constructor(e,t,s,i,r,n,o){this.messageBuilder=e,this.session=t,this.serializer=s,this.uuid=i,this.status=r,this.user=n,this.config=o,this.defaultInterval=1e4,this.secondsMultiplier=1e3,this.heartbeatIsEnabled=!0,this.heartbeatInterval=this.defaultInterval,this.socketMessages=()=>this.wsMessages}get heartbeatLoggingIsEnabled(){var e,t;return null!==(t=null===(e=this.connectOptions)||void 0===e?void 0:e.enableHeartbeatLogging)&&void 0!==t&&t}get messageLoggingIsEnabled(){var e,t;return null!==(t=null===(e=this.connectOptions)||void 0===e?void 0:e.enableMessageLogging)&&void 0!==t&&t}connect(e=n.vN,t,s){var r;return this.url=e,this.connectOptions=null!=t?t:this.config.connect,this.reconnectOptions=null!=s?s:this.config.reconnect,(null===(r=this.config.isWebSocketExpression)||void 0===r?void 0:r.test(this.host))?new Promise(e=>{var t,s,r,n;_.v.info(`${this.isReconnecting?"Reconnecting":"Connecting"} to ${this.url}`),this.status.isConnecting=!this.isReconnecting;(!this.isReconnecting||!(null===(t=this.reconnectOptions)||void 0===t?void 0:t.reconnectStreams))&&this.cleanMessages(),null===(s=this.socketSubscription)||void 0===s||s.unsubscribe(),this.websocket=new p.Q({url:this.url,openObserver:{next:()=>{this.session.setSessionStorageItem("hostUrl",this.url),this.status.isConnected=!0,this.prepareHeartbeat(),_.v.info("WebSocket connection is now open"),e(this.isConnected)}},closeObserver:{next:t=>{this.status.onClose(t),this.isDisconnectedByServer&&_.v.info(`WebSocket connection was closed due an error - Code: ${t.code} ${t.reason?" | Reason: "+t.reason:""}`),e(this.isConnected)}},serializer:e=>this.serializer.serialize(e),deserializer:e=>this.serializer.deserialize(e)});this.socketSubscription=this.websocket.subscribe(null!==(n=null===(r=this.connectOptions)||void 0===r?void 0:r.connectObserver)&&void 0!==n?n:{next:e=>(0,i.sH)(this,void 0,void 0,function*(){var t;const s=`Response Message received for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,s);const{SOURCE_REF:i,MESSAGE_TYPE:r}=e,n=this.getMessageHandler(i,r);if(!n)return void(e.MESSAGE_TYPE===f.Go.MSG_NACK&&e.ERROR&&e.ERROR.forEach(t=>{_.v.error(`MessageType: ${e.MESSAGE_TYPE} | Error Details:`,t)}));let o=!1;switch(e.MESSAGE_TYPE){case f.Gp.EVENT_LOGIN_AUTH_ACK:{const s=e.DETAILS;s.HEARTBEAT_INTERVAL_SECS&&void 0===(null===(t=this.connectOptions)||void 0===t?void 0:t.heartbeatInterval)&&(this.heartbeatInterval=s.HEARTBEAT_INTERVAL_SECS*this.secondsMultiplier,this.prepareHeartbeat());break}case f.Go.LOGOUT_ACK:return n.onReceivedMessage.call(this,e),void this.cleanMessages();case f.Go.LOGON_ACK:return;case f.Go.LOGOFF_ACK:break;case f.Go.QUERY_UPDATE:n.isSubscription||this.sendDataLogoff(i);break;case f.Go.MSG_NACK:case f.Go.LOGON_NACK:o=!0}o?n.onReceivedError.call(this,{receivedMessage:e,sentMessage:n.sentMessage}):n.onReceivedMessage.call(this,e),this.wsMessages.next(e),n.isSubscription||this.removeMessageHandler(i)}),error:e=>{_.v.debug("Error found: ",e),this.reconnect()},complete:()=>{var e;this.isDisconnectedByServer&&(null===(e=this.connectOptions)||void 0===e?void 0:e.alwaysOn)?this.reconnect():_.v.info("Connection is now closed")}}),this.status.isConfigured=!0}):(_.v.error(`Specified host (${this.host}) is not valid WebSocket url. Connection will not proceed.`),void _.v.warn("Make sure the host url starts with wss:// or ws://"))}handleExpiredSession(){return(0,i.sH)(this,void 0,void 0,function*(){if(this.session.getSessionStorageItem("refreshToken")){const e=this.messageBuilder.createRefreshTokenMessage(),t=yield this.send(e);this.session.setAuthResult(t),this.updateSessionAndSubscriptions(t)}else yield this.handleCookieBasedReauth()})}handleCookieBasedReauth(){return(0,i.sH)(this,void 0,void 0,function*(){const e=parseInt(localStorage.getItem(L.REAUTH_ACTION_LOCK_KEY)||"0");if(Date.now()-e>3e4&&localStorage.removeItem(L.REAUTH_ACTION_LOCK_KEY),localStorage.getItem(L.REAUTH_ACTION_LOCK_KEY))window.addEventListener("storage",this.onStorageEvent.bind(this));else{localStorage.setItem(L.REAUTH_ACTION_LOCK_KEY,Date.now().toString());const e=yield fetch(n.Be,{credentials:"include"});if("EVENT_LOGIN_DETAILS_ACK"!==(yield e.json()).MESSAGE_TYPE){(yield fetch(n.aW,{credentials:"include",headers:{"Content-type":"application/json; charset=UTF-8"},method:"POST",body:JSON.stringify({DETAILS:{},MESSAGE_TYPE:"EVENT_LOGIN_AUTH"})})).ok||window.location.reload()}localStorage.removeItem(L.REAUTH_ACTION_LOCK_KEY),yield this.connect()}})}onStorageEvent(e){e.key===L.REAUTH_ACTION_LOCK_KEY&&null===e.newValue&&(this.connect(),window.removeEventListener("storage",this.onStorageEvent))}updateSessionAndSubscriptions(e){(null==e?void 0:e.MESSAGE_TYPE)===f.Gp.EVENT_LOGIN_AUTH_ACK&&this.wsMessageHandlers.forEach(t=>{t.isSubscription&&(t.sentMessage.SESSION_AUTH_TOKEN=e.SESSION_AUTH_TOKEN,this.websocket.next(t.sentMessage))})}prepareHeartbeat(){var e,t,s,r;this.heartbeatTicker&&this.heartbeatTicker.stop();const n=()=>(0,i.sH)(this,void 0,void 0,function*(){var e,t,s;if(!this.isConnected)return;const i=this.messageBuilder.createHeartbeatPingMessage(null===(e=this.connectOptions)||void 0===e?void 0:e.verboseHeartbeat);(null===(t=this.connectOptions)||void 0===t?void 0:t.heartbeatPingCallback)&&this.connectOptions.heartbeatPingCallback(i);const r=yield this.send(i);this.user.isAuthenticated&&!r.IS_AUTHENTICATED&&this.handleExpiredSession(),(null===(s=this.connectOptions)||void 0===s?void 0:s.heartbeatPongCallback)&&this.connectOptions.heartbeatPongCallback(r),this.heartbeatIsEnabled=r.MESSAGE_TYPE===f.Go.HEARTBEAT_PONG&&r.SOURCE_REF===i.SOURCE_REF});if(null!==(t=null===(e=this.connectOptions)||void 0===e?void 0:e.enableHeartbeat)&&void 0!==t?t:this.heartbeatIsEnabled){const e=null!==(r=null===(s=this.connectOptions)||void 0===s?void 0:s.heartbeatInterval)&&void 0!==r?r:this.heartbeatInterval;this.heartbeatTicker=new y(e),this.heartbeatTicker.start(()=>{this.websocket&&this.isConnected&&(n(),this.heartbeatLoggingIsEnabled&&_.v.debug(`Sending a heartbeat ping every ${e} ms`))})}}reconnect(){var e,t,s,i,r;const n=!(null===(e=this.connectOptions)||void 0===e?void 0:e.alwaysOn)&&!1===(null===(t=this.connectOptions)||void 0===t?void 0:t.enableHeartbeat);if(this.isReconnecting||n)return;this.status.isReconnecting=!0;const o=(null===(s=this.reconnectOptions)||void 0===s?void 0:s.reconnectStrategy)===M.Exponential?b:N,a=this.isConnectedSubject.asObservable().pipe((0,S.n)(e=>e?(0,u.of)(-1):((e,t)=>new l.c(s=>{let i,r=0;return function n(){s.next(r),clearTimeout(i),i=setTimeout(n,t(e,r)),r+=1}(),()=>{clearTimeout(i)}}))(this.reconnectOptions,o).pipe((0,v.Z)(e=>{var t,s,i;let r;return r=(null===(t=this.connectOptions)||void 0===t?void 0:t.alwaysOn)?e+1:null!==(i=null===(s=this.reconnectOptions)||void 0===s?void 0:s.reconnectAttempts)&&void 0!==i?i:10,e<r?(0,u.of)(e):(this.status.reconnectionLimitReached=!0,(0,E.$)(()=>new Error(`Max reconnect attempts ${r} reached.`)))}))),(0,R.v)(()=>this.websocket&&!this.isConnected));a.subscribe(null!==(r=null===(i=this.reconnectOptions)||void 0===i?void 0:i.reconnectObserver)&&void 0!==r?r:{next:e=>{_.v.debug(`Attempt no. ${e+1} to reconnect`),this.websocket.complete(),this.connect(this.url,this.connectOptions,this.reconnectOptions)},error:e=>{var t;_.v.debug(e),null===(t=this.socketSubscription)||void 0===t||t.unsubscribe(),this.status.isReconnecting=!1},complete:()=>{_.v.info(this.isConnected?"Reconnected":"Disconnected"),this.status.isReconnecting=!1,this.wsMessageHandlers.forEach(e=>{e.isSubscription&&this.websocket.next(e.sentMessage)})}})}reset(){this.status.isConnected=!1,this.status.isConfigured=!1,this.websocket&&this.websocket.complete(),this.websocket=null,this.cleanMessages()}cleanMessages(){this.wsMessages&&this.wsMessages.complete(),this.wsMessages=new P,this.wsMessageHandlers=new Map}send(e,t=!0){if(!this.isConnected)return Promise.reject(new Error("WebSocket connection is closed"));const s=`Sending Message for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,s),new Promise((s,i)=>{const r=e=>{s(e)},n=e=>{i(e)};t&&this.setMessageHandler(e,r,n),this.websocket.next(e)})}sendForStream(e,t,s,i){if(!this.isConnected)return(0,E.$)(()=>new Error("WebSocket connection is closed"));const r=`Sending Message (stream) for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,r),this.setMessageHandler(e,t,s,!0),c.DOM.queueUpdate(()=>this.websocket.next(e)),new l.c(t=>{const s=new h.B;return this.wsMessages.pipe((0,m.p)(t=>t.SOURCE_REF===e.SOURCE_REF),(0,g.Q)(s)).subscribe({next:e=>{t.next(e)},error:e=>{t.error(e)},complete:()=>{t.complete()}}),()=>{s.complete(),this.sendDataLogoff(e.SOURCE_REF),this.removeMessageHandler(e.SOURCE_REF),i&&i()}})}sendForStreamWithoutTeardown(e,t,s){if(!this.isConnected)return(0,E.$)(()=>new Error("WebSocket connection is closed"));const i=`Sending Message (stream) for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,i),this.setMessageHandler(e,t,s,!0),this.websocket.next(e),this.wsMessages.pipe((0,m.p)(t=>t.SOURCE_REF===e.SOURCE_REF))}setMessageHandler(e,t,s,i=!1){const r=`Setting Message Handler for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.debug,r),this.wsMessageHandlers.set(e.SOURCE_REF,new D(e,t,s,i))}sendDataLogoff(e){this.send(this.messageBuilder.createDataLogoffMessage(e),!1)}removeMessageHandler(e){this.wsMessageHandlers.delete(e)}getMessageHandler(e,t){const s=`Getting Message Handler for SourceRef: ${e} | MessageType: ${t}`;return this.logMessageTypeFlow(t,_.v.debug,s),this.wsMessageHandlers.get(e)}logMessageTypeFlow(e,t,s){switch(e){case f.Gp.DATA_LOGOFF:t(s);break;case f.Go.HEARTBEAT_PING:case f.Go.HEARTBEAT_PONG:this.heartbeatLoggingIsEnabled&&t(s);break;default:this.messageLoggingIsEnabled&&t(s)}}};w.REAUTH_ACTION_LOCK_KEY="reauthActionLock",(0,i.Cg)([c.observable],w.prototype,"websocket",void 0),(0,i.Cg)([c.observable],w.prototype,"wsMessages",void 0),(0,i.Cg)([c.observable],w.prototype,"wsMessageHandlers",void 0),(0,i.Cg)([A.l],w.prototype,"http",void 0),(0,i.Cg)([c.observable],w.prototype,"heartbeatIsEnabled",void 0),w=L=(0,i.Cg)([(0,i.Qj)(0,f.lT),(0,i.Qj)(1,T.N),(0,i.Qj)(2,o.b_),(0,i.Qj)(3,a.k),(0,i.Qj)(4,U.S5),(0,i.Qj)(5,r.KJ),(0,i.Qj)(6,O.R)],w);const G=d.DI.createInterface(e=>e.singleton(w));function F(){return d.DI.getOrCreateDOMContainer().get(G)}},48707:(e,t,s)=>{s.d(t,{X:()=>o,a:()=>a});var i=s(39087),r=s(17465),n=s(41119);const o=e=>e?e.map(e=>{const t={name:e.NAME,type:n.v[e.TYPE]||n.w.STRING};if(e.TYPE===n.w.ENUM&&e.VALID_VALUES)try{t.enumOptions=Array.isArray(e.VALID_VALUES)?e.VALID_VALUES:e.VALID_VALUES.split("|")}catch(e){r.v.error(e),t.enumOptions=[]}return t}):null,a=e=>{var t;const s=null==e?void 0:e.TYPE;if(s===i.v.DATASERVER)return e.FIELD||[];if(s===i.v.REQUEST_SERVER)return e.REPLY_FIELD||(null===(t=e.REPLY)||void 0===t?void 0:t.FIELD)||[];throw new Error(`Unsupported resource type: ${s}`)}},49229:(e,t,s)=>{s.d(t,{b_:()=>h});var i=s(55823),r=s(84674),n=s(61455);const o=r.DI.createInterface();function a(e){return Number.isSafeInteger(+e)?Number(e):(0,n.Fq)(e)?BigInt.asIntN(64,e):parseFloat(e)}const c={parse:e=>(0,n.qg)(e,null,a),stringify:e=>(0,n.As)(e)};let d=class{constructor(e=c){this.config=e,this.serialize=e=>this.config.stringify(e)}deserialize(e){return e?"string"==typeof e?this.config.parse(e):e&&e.ok?e.text().then(e=>this.config.parse(e)):(e&&e.data&&(e=e.data),this.config.parse(e)):Promise.resolve({})}};d=(0,i.Cg)([(0,i.Qj)(0,(0,r.optional)(o))],d);const h=r.DI.createInterface(e=>e.singleton(d))},49587:(e,t,s)=>{s.d(t,{R:()=>n});var i=s(84674);const r={connect:{alwaysOn:!1,enableHeartbeat:!0,enableHeartbeatLogging:!1,heartbeatInterval:1e4,verboseHeartbeat:!1,enableMessageLogging:!1},reconnect:{reconnectAttempts:10,reconnectInterval:1e4,reconnectStreams:!0},isWebSocketExpression:new RegExp(/wss?:\/\/[-a-zA-Z0-9@:%._\+~#=]{1,256}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)\b\/*$/,"i")},n=i.DI.createInterface(e=>e.instance(r))},56653:(e,t,s)=>{var i;s.d(t,{h:()=>i,l:()=>r}),function(e){e.BASIC="BASIC",e.SSO="SSO",e.JWT="JWT",e.REFRESH="REFRESH"}(i||(i={}));class r extends Error{constructor(e,t,s="Auth Failed \n"){super(s),this.sent=e,this.received=t,Object.setPrototypeOf(this,r.prototype)}isIgnorableError(){var e,t,s,i,r,n,o,a;return!!(null===(i=null===(s=null===(t=null===(e=this.received)||void 0===e?void 0:e.DETAILS)||void 0===t?void 0:t.ERROR)||void 0===s?void 0:s.toLowerCase())||void 0===i?void 0:i.includes("request needs the user to be logged"))||!!(null===(a=null===(o=null===(n=null===(r=this.received)||void 0===r?void 0:r.DETAILS)||void 0===n?void 0:n.ERROR)||void 0===o?void 0:o.toLowerCase())||void 0===a?void 0:a.includes("is not logged in"))}getMessageError(){var e,t;return Array.isArray(null===(e=this.received)||void 0===e?void 0:e.ERROR)?null===(t=this.received)||void 0===t?void 0:t.ERROR.map(e=>this.errorDetailFormatter(e)).join("\n"):""}getDetailsError(){var e,t,s,i;return Array.isArray(null===(t=null===(e=this.received)||void 0===e?void 0:e.DETAILS)||void 0===t?void 0:t.ERROR)?null===(i=null===(s=this.received)||void 0===s?void 0:s.DETAILS)||void 0===i?void 0:i.ERROR.map(e=>this.errorDetailFormatter(e)).join("\n"):""}hasPasswordExpiredError(){return this.hasErrorCode("PASSWORD_EXPIRED")}hasMFAError(){return this.hasErrorCode("MFA_REQUIRED")||this.hasErrorCode("MFA_FAILED")}requiresTermsAndConditions(){return this.hasErrorCode("TERMS_ACCEPTANCE_REQUIRED")}hasErrorCode(e){var t,s;return!!Array.isArray(null===(t=this.received)||void 0===t?void 0:t.ERROR)&&(null===(s=this.received)||void 0===s?void 0:s.ERROR.some(t=>t.CODE===e))}errorDetailFormatter(e){return`\n ${e.CODE}: \n ${e.TEXT}`}}},68424:(e,t,s)=>{s.d(t,{DW:()=>n,JH:()=>o});var i=s(52945),r=s(28745);function n(e,t){let s=e;for(;s;){const e=s.tagName.toLowerCase();if(e.endsWith("-design-system-provider")){const t=e.split("-design-system-provider")[0];if(t)return r.v.debug(`Found provider by ancestor search: ${e}, prefix: ${t}`),{element:s,prefix:t}}s=s.parentElement?s.parentElement:s.getRootNode&&s.getRootNode()instanceof ShadowRoot?s.getRootNode().host:null}const n=document.querySelectorAll('[class*="-design-system-provider"],[id*="-design-system-provider"]'),o=Array.from(n),a=(0,i.fI)(document).filter(e=>{var t;const s=null===(t=e.tagName)||void 0===t?void 0:t.toLowerCase();return(null==s?void 0:s.endsWith("-design-system-provider"))||!1});if(o.push(...a),o.length>0){const e=o[0],t=e.tagName.toLowerCase(),s=t.split("-design-system-provider")[0];if(s)return r.v.debug(`Found provider by document search: ${t}, prefix: ${s}`),{element:e,prefix:s}}return r.v.debug(`No provider found. Falling back to ${t}.`),{element:null,prefix:t}}function o(e,t){return n(e,t).prefix}},79780:(e,t,s)=>{s.d(t,{Es:()=>n});var i=s(84674);class r extends BroadcastChannel{constructor(){super(...arguments),this.postMessage=(...e)=>{const[t,s]=e;super.postMessage({type:t,detail:s})},this.isMessageType=(e,t)=>{var s;return(null===(s=t.data)||void 0===s?void 0:s.type)===e}}}const n=e=>{class t extends r{constructor(){super(e)}}return i.DI.createInterface(e=>e.transient(t))}},84686:(e,t,s)=>{s.d(t,{Be:()=>S,H6:()=>O,OB:()=>r,PF:()=>n,aW:()=>E,vN:()=>a});let i="webpack";try{i="webpack"}catch(e){}let r="/";try{r="auto".replace(/\/$/,"")}catch(e){}let n,o="gwf";try{"undefined"!=typeof SOCKET_EXT&&(o=SOCKET_EXT)}catch(e){}try{n=FORCE_HTTP}catch(e){}const a=`${location.protocol.replace("http","ws")}//${location.host}${r}/${o}/`;"true"===n?location.protocol:location.protocol.replace("http","ws");let c,d,h,l,u=null;try{"undefined"!=typeof API_HOST&&(u=API_HOST)}catch(e){}try{c=""}catch(e){}try{d=DEFAULT_ORGANISATION}catch(e){}try{h=DEFAULT_PASSWORD}catch(e){}try{l=DEFAULT_USER}catch(e){}let E="gwf/event-login-auth";"undefined"!=typeof GENX_LOGIN_URL&&(E=GENX_LOGIN_URL);let g="gwf/event-login-auth";"undefined"!=typeof GENX_LOGIN_REFRESH_URL&&(g=GENX_LOGIN_REFRESH_URL);let S="gwf/event-login-details";"undefined"!=typeof GENX_LOGIN_DETAILS_URL&&(S=GENX_LOGIN_DETAILS_URL);let v="gwf/event-logout";"undefined"!=typeof GENX_LOGOUT_URL&&(v=GENX_LOGOUT_URL);let R="gwf/event-change-user-password";"undefined"!=typeof GENX_CHANGE_PASSWORD_URL&&(R=GENX_CHANGE_PASSWORD_URL);let m="gwf/event-self-service-password-reset";"undefined"!=typeof GENX_FORGOT_PASSWORD_URL&&(m=GENX_FORGOT_PASSWORD_URL);let p="gwf/event-password-reset-action";"undefined"!=typeof GENX_RESET_PASSWORD_URL&&(p=GENX_RESET_PASSWORD_URL);let T="gwf/sso/list";"undefined"!=typeof GENX_SSO_LIST_URL&&(T=GENX_SSO_LIST_URL);let _="gwf/{type}/login?idp={id}";"undefined"!=typeof GENX_SSO_LOGIN_URL&&(_=GENX_SSO_LOGIN_URL);let O="default";"undefined"!=typeof GENX_ENVIRONMENT_LEVEL&&(O=GENX_ENVIRONMENT_LEVEL);let A="gwf/auth/accept-terms";"undefined"!=typeof GENX_ACCEPT_TERMS_URL&&(A=GENX_ACCEPT_TERMS_URL)},92277:(e,t,s)=>{s.d(t,{KJ:()=>E});var i=s(55823),r=s(17190),n=s(33681),o=s(84674),a=s(79780);const c=(0,s(9709).createLogger)("foundation-user"),d={trackActionExclusions:[],trackPathExclusions:[""],setUser(e,t){if(e.isAuthenticated)throw new Error("User already set. If this is intentional, please call User.unset first.");return c.debug("setUser",t),e.rawProperties=structuredClone(t),e.userKVs=t.userKVs,e.details=t.details,e.permission=t.permission,e.profile=t.profile,e.sourceRef=t.sourceRef,e.userName=t.userName,e.isAuthenticated=!0,e},unsetUser:e=>(c.debug("unsetUser"),e.rawProperties=void 0,e.userKVs=void 0,e.details=void 0,e.permission=void 0,e.profile=void 0,e.sourceRef=void 0,e.userName=void 0,e.isAuthenticated=!1,e)},h=o.DI.createInterface(e=>e.instance(d)),l=(0,a.Es)("genesis-user");class u{constructor(){this.pathHistory=[],this.actionHistory=[],this.isAuthenticated=!1,this.authenticationChangeListeners=(0,r.r)()}set(e){return this.config.setUser(this,e)}unset(){return this.config.unsetUser(this)}get isAnonymous(){return!this.isAuthenticated}isAdmin(){return this.hasProfile("ADMIN")}isBanned(){return this.hasProfile("BANNED")}hasPermission(e){return this.hasKey(this.permission,e)}hasProfile(e){return this.hasKey(this.profile,e)}trackPath(){const{pathname:e,search:t,hash:s}=location,i=`${`${"/"!==e?e:""}`}${t}${s}`;if(!this.config.trackPathExclusions.includes(i))return this.pathHistory.push(i),i}clearPaths(){this.pathHistory=[]}lastPath(){const e=this.pathHistory.length;return e>0?this.pathHistory[e-1]:void 0}trackAction(e){this.config.trackActionExclusions.includes(e)||this.actionHistory.push(e)}clearActions(){this.actionHistory=[]}lastAction(){const e=this.actionHistory.length;return e>0?this.actionHistory[e-1]:void 0}clearTrackingHistory(){this.clearPaths(),this.clearActions()}hasKey(e,t){return!!(e&&e.length&&t)&&(Array.isArray(t)||(t=[t]),t.some(t=>e.includes(t)))}addAuthenticationChangeListener(e){var t;return null===(t=this.authenticationChangeListeners)||void 0===t?void 0:t.subscribe(e)}isAuthenticatedChanged(){var e;null===(e=this.authenticationChangeListeners)||void 0===e||e.publish(new CustomEvent("user-authentication-change",{detail:this.isAuthenticated}));const t=o.DI.getOrCreateDOMContainer().get(l);t.postMessage("user-authentication-change",this.isAuthenticated),t.close()}userNameChanged(){n.Observable.notify(this,"username")}get username(){return n.Observable.track(this,"username"),this.userName}permissionChanged(){n.Observable.notify(this,"permissions")}get permissions(){return n.Observable.track(this,"permissions"),this.permission}profileChanged(){n.Observable.notify(this,"profiles")}get profiles(){return n.Observable.track(this,"profiles"),this.profile}hasAdminProfile(){return this.isAdmin()}}(0,i.Cg)([h],u.prototype,"config",void 0),(0,i.Cg)([n.observable],u.prototype,"pathHistory",void 0),(0,i.Cg)([n.observable],u.prototype,"actionHistory",void 0),(0,i.Cg)([n.observable],u.prototype,"isAuthenticated",void 0),(0,i.Cg)([n.observable],u.prototype,"userKVs",void 0),(0,i.Cg)([n.observable],u.prototype,"details",void 0),(0,i.Cg)([n.observable],u.prototype,"permission",void 0),(0,i.Cg)([n.observable],u.prototype,"profile",void 0),(0,i.Cg)([n.observable],u.prototype,"sourceRef",void 0),(0,i.Cg)([n.observable],u.prototype,"userName",void 0),(0,i.Cg)([n.observable],u.prototype,"rawProperties",void 0);const E=o.DI.createInterface(e=>e.singleton(u))},96730:(e,t,s)=>{function i(e,t=";"){return e?e.split(t).map(e=>e.trim()).sort((e,t)=>e.localeCompare(t)).join(t):e}s.d(t,{Q:()=>i})},98316:(e,t,s)=>{s.d(t,{N:()=>n});var i=s(84674);class r{constructor(){this.storageKeyPrefix="",this.returnUrl=this.getSessionStorageItem("returnUrl")||""}deleteUserFromSessionStorage(){["authToken","refreshToken","sessionId","ssoToken"].forEach(e=>this.removeSessionStorageItem(e)),this.removeLocalStorageItem("refreshToken")}setStorageKeyPrefix(e){this.storageKeyPrefix=`${e.replace(/\s/g,"")}/`}setAuthResult(e){var t;this.setSessionStorageItem("authToken",e.SESSION_AUTH_TOKEN),this.setSessionStorageItem("refreshToken",e.REFRESH_AUTH_TOKEN),this.setSessionStorageItem("username",e.USER_NAME),this.setSessionStorageItem("sessionId",e.SESSION_ID),(null===(t=e.DETAILS)||void 0===t?void 0:t.MFA_CODE)&&this.setSessionStorageItem("mfaToken",e.DETAILS.MFA_CODE)}captureReturnUrl(){const{pathname:e,search:t,hash:s}=location;if(e&&(e.includes("/login")||e.includes("/auth")))return;const i=`${"/"!==e?e:""}`;this.returnUrl=`${i}${t}${s}`,this.setSessionStorageItem("returnUrl",this.returnUrl)}setItem(e,t,s){"local"===s?localStorage.setItem(this.storageKeyPrefix+e,t):sessionStorage.setItem(this.storageKeyPrefix+e,t)}getItem(e,t){return"local"===t?localStorage.getItem(this.storageKeyPrefix+e):sessionStorage.getItem(this.storageKeyPrefix+e)}removeItem(e,t){"local"===t?localStorage.removeItem(this.storageKeyPrefix+e):sessionStorage.removeItem(this.storageKeyPrefix+e)}setLocalStorageItem(e,t){this.setItem(e,t,"local")}setSessionStorageItem(e,t){this.setItem(e,t,"session")}getLocalStorageItem(e){return this.getItem(e,"local")}getSessionStorageItem(e){return this.getItem(e,"session")}removeLocalStorageItem(e){this.removeItem(e,"local")}removeSessionStorageItem(e){this.removeItem(e,"session")}}const n=i.DI.createInterface(e=>e.singleton(r))}}]);
|
|
2
|
+
//# sourceMappingURL=347.2c67ff1178c3fd5dd7387589be14fa6c.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[445],{1510:(a,e,r)=>{r.d(e,{v:()=>o});var t=r(
|
|
1
|
+
"use strict";(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[445],{1510:(a,e,r)=>{r.d(e,{v:()=>o});var t=r(9709);const o=(0,t.createLogger)("grid-pro")},3299:(a,e,r)=>{r.d(e,{x:()=>o});var t=r(33681);const o=t.html`
|
|
2
2
|
<template>
|
|
3
3
|
<slot ${(0,t.slotted)("slottedRenderer")} @slotchange="${a=>a.slottedAgRendererChanged()}"></slot>
|
|
4
4
|
</template>
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
date-countdown-completed-message="${a=>{var e;return null===(e=a.params)||void 0===e?void 0:e.dateCountdownCompletedMessage}}"
|
|
25
25
|
>
|
|
26
26
|
</${a}-status-pill>
|
|
27
|
-
`;class l extends i.FoundationElement{init(a){this.params=a}getGui(){return this}refresh(a){return this.params=a,!0}destroy(){}}(0,t.Cg)([o.observable],l.prototype,"params",void 0);const d=l.compose({baseName:"status-pill-renderer",template:g(),styles:n})},21409:(a,e,r)=>{r.d(e,{S:()=>o});var t=r(55823);const o=a=>{var e,r,o,n,g,l,d,s,c;return c=class extends a{constructor(...a){super(a),e.add(this),r.set(this,{_key:"dom"}),o.set(this,""),n.set(this,!1),g.set(this,void 0),l.set(this,!1)}cloneNode(a){const e=this.deepClone();return a&&Array.from(this.childNodes).forEach(a=>{e.appendChild(a.cloneNode(!0))}),e}deepClone(){const a=document.createElement(this.tagName.toLowerCase());return this.getAttributeNames().forEach(e=>a.setAttribute(e,this.getAttribute(e))),a}get shouldRunDisconnect(){return!!(0,t.gn)(this,l,"f")||("dom"===(0,t.gn)(this,r,"f")._key||"foundation-layout-cache"!==(0,t.gn)(this,r,"f")._key&&!((0,t.gn)(this,r,"f").dragging||!(0,t.gn)(this,r,"f").hasFirstLoaded||(0,t.gn)(this,e,"m",d).call(this,"disconnect")))}get shouldRunConnect(){if((0,t.gn)(this,l,"f"))return!0;if("dom"===(0,t.gn)(this,r,"f")._key)return!0;if("foundation-layout-cache"===(0,t.gn)(this,r,"f")._key)return!1;let a="reconnect";return!1===(0,t.gn)(this,n,"f")&&((0,t.GG)(this,n,!0,"f"),a="connect"),!((0,t.gn)(this,r,"f").dragging||!(0,t.gn)(this,r,"f").hasFirstLoaded||(0,t.gn)(this,e,"m",d).call(this,a))}connectedCallback(){super.connectedCallback(),"foundation-layout"!==(0,t.gn)(this,r,"f")._key&&(0,t.GG)(this,r,(0,t.gn)(this,e,"m",s).call(this,this),"f")}},r=new WeakMap,o=new WeakMap,n=new WeakMap,g=new WeakMap,l=new WeakMap,e=new WeakSet,d=function(a){var e,i;if("foundation-layout"!==(0,t.gn)(this,r,"f")._key)throw new Error("LifecycleMixin: should not be checking a token change if container not in the layout");const n=(0,t.gn)(this,o,"f")!==(0,t.gn)(this,r,"f").lifecycleUpdateToken;let d=!1;return"connect"===a?(0,t.GG)(this,o,null!==(e=(0,t.gn)(this,r,"f").lifecycleUpdateToken)&&void 0!==e?e:"","f"):"disconnect"===a?(d=n,(0,t.GG)(this,g,setTimeout(()=>{(0,t.GG)(this,l,d,"f"),(0,t.gn)(this,l,"f")&&this.disconnectedCallback()},1e4),"f")):"reconnect"===a&&(d=n,(0,t.GG)(this,o,null!==(i=(0,t.gn)(this,r,"f").lifecycleUpdateToken)&&void 0!==i?i:"","f"),clearTimeout((0,t.gn)(this,g,"f"))),d},s=function a(r){var o;if(!0===r.getRootNode()[i])return{_key:"foundation-layout-cache"};if(r.getRootNode()instanceof Document||!(null===(o=r.getRootNode())||void 0===o?void 0:o.host))return{_key:"dom"};const n=r.getRootNode().host;if("FoundationLayoutMain"===n.class){const a=n;return a._key="foundation-layout",a}return(0,t.gn)(this,e,"m",a).call(this,n)},c},i=Symbol("layout-cache-document")},23201:(a,e,r)=>{function t(a){return{colId:a.field||a.colId||"",hide:a.hide||!1,width:a.width||null,pinned:a.pinned||null,sort:a.sort||null,sortIndex:a.sortIndex||null,aggFunc:a.aggFunc||null,rowGroup:a.rowGroup||!1,rowGroupIndex:a.rowGroupIndex||null,pivot:a.pivot||!1,pivotIndex:a.pivotIndex||null,flex:a.flex||null}}function o(a){return a.map(t)}function i(a,e){const r={},t=[],o="field",i="colId";return e.forEach(e=>{const n=a.find(a=>a[o]===e[i]||a[i]&&a[i]===e[i]);if(n){const a=Object.assign(Object.assign({},n),e);r[n[o]]=a,t.push(a)}}),a.forEach(a=>{if(!r.hasOwnProperty(a[o])){const e=Object.assign({},a);r[a[o]]=e,t.push(e)}}),t}r.d(e,{pr:()=>t,rG:()=>o,yS:()=>i})},24638:(a,e,r)=>{r.d(e,{X:()=>D});var t=r(55823),o=r(44210),i=r(96730),n=r(48707),g=r(21281),l=r(34193),d=r(39087),s=r(21409),c=r(52945),p=r(33681),u=r(90509),h=r(1510),v=r(35610),m=r(41119);function f(a){switch(a){case m.w.BOOLEAN:return{buttons:["reset","apply"],closeOnApply:!0,closeOnClear:!0,maxNumConditions:1,filterOptions:["contains",{displayKey:"true",displayName:"True",predicate:(a,e)=>"true"===e||!0===e,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(a,e)=>"false"===e||!1===e,numberOfInputs:0},{displayKey:"true-false",displayName:"True/False",predicate:(a,e)=>"true"===e||!0===e||"false"===e||!1===e,numberOfInputs:0}]};case m.w.DATE:case m.w.DATETIME:return{comparator:(a,e)=>{if(!e)return-1;const r=new Date(e).setHours(0,0,0,0),t=a.getTime();return r===t?0:r<t?-1:r>t?1:void 0},buttons:["reset","apply"],closeOnApply:!0,closeOnClear:!0,maxNumConditions:1,browserDatePicker:!0,filterOptions:["equals","lessThan","greaterThan","inRange",{displayKey:"isToday",displayName:"Is today",numberOfInputs:0,predicate:()=>!0},"blank","notBlank"]};case m.w.NUMBER:return{buttons:["reset","apply"],closeOnApply:!0,closeOnClear:!0,maxNumConditions:1,filterOptions:["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"]};default:return{buttons:["reset","apply"],closeOnApply:!0,closeOnClear:!0,maxNumConditions:1,filterOptions:["contains","equals","notEqual",{displayKey:"wordStartsWith",displayName:"Word starts with",numberOfInputs:1,predicate:()=>!0},"blank","notBlank"]}}}var w=r(17465),b=r(49874),y=r(40113),z=r(26347),x=r(32808);class k{constructor(a){var e;this.rowData=new Map,this.serverRowsCount=0,this.clientRowsCount=0,this.moreRows=!1,this.calculatedRowsCount=0,this.currentSequenceId=null,this.reloadResourceDataFunc=a.reloadResourceDataFunc,this.errorHandlerFunc=a.errorHandlerFunc,this.resourceName=a.resourceName,this.resourceParams=a.resourceParams,this.originalCriteriaMatch=a.resourceParams.CRITERIA_MATCH,this.resourceIndexes=a.resourceIndexes,this.resourceColDefs=a.resourceColDefs,this.maxRows=a.maxRows,this.maxView=a.maxView,this.rowId=a.rowId,this.pagination=a.pagination,this.zeroBasedViewNumber=a.zeroBasedViewNumber,this.pagingMode=a.pagingMode,this.criteriaOnlyRequest=null!==(e=a.criteriaOnlyRequest)&&void 0!==e&&e}getRows(a){throw new Error("Method not implemented.")}setupFiltering(a){return(0,t.sH)(this,void 0,void 0,function*(){const e=a.request.filterModel,r=Object.keys(e).length>0,t=0===Object.keys(e).length,o=JSON.stringify(e)!==JSON.stringify(this.currentFilterModel);if(o||r){if(t&&this.currentFilterModel)return this.currentFilterModel=null,this.resourceParams.CRITERIA_MATCH=this.originalCriteriaMatch,void(yield this.refreshDatasource(a));if(o&&r)return this.currentFilterModel=e,this.resourceParams.CRITERIA_MATCH=this.buildCriteriaMatchFromFilters(),void(yield this.refreshDatasource(a))}})}setupFilteringAndSorting(a){return(0,t.sH)(this,void 0,void 0,function*(){yield this.setupFiltering(a),yield this.setupSorting(a)})}destroy(){this.rowData=new Map,this.clientRowsCount=0,this.calculatedRowsCount=0,this.serverRowsCount=0,this.currentSequenceId=0,this.moreRows=!1,this.sourceRef=void 0,this.lastSuccessRowData=void 0}refreshDatasource(a){return(0,t.sH)(this,void 0,void 0,function*(){yield this.destroy(),yield this.reloadResourceDataFunc({criteria:this.resourceParams.CRITERIA_MATCH,orderBy:this.resourceParams.ORDER_BY,reverse:this.resourceParams.REVERSE})})}getOrderByAndToBeSortedColIds(a,e){for(const[r,t]of a.entries()){const a=t.findIndex(a=>a===e);if(-1!==a){return{orderBy:r,toBeSorted:[...t].splice(a,1)}}}}buildCriteriaMatchFromFilters(){this.resourceParams.CRITERIA_MATCH=this.originalCriteriaMatch,this.resourceParams.CRITERIA_MATCH&&"string"==typeof this.resourceParams.CRITERIA_MATCH&&(this.resourceParams.CRITERIA_MATCH=this.resourceParams.CRITERIA_MATCH.split(";")),this.resourceParams.CRITERIA_MATCH||(this.resourceParams.CRITERIA_MATCH=[]);return this.resourceParams.CRITERIA_MATCH.concat(this.criteriaFromFilters()).join(" && ")}criteriaFromFilters(){const a=[];return this.getFiltersByType("text").forEach(e=>{if(this.currentFilterModel[e].filter||"false"!==this.currentFilterModel[e].type&&"true"!==this.currentFilterModel[e].type)switch(this.currentFilterModel[e].type){case"blank":a.push(`${e} == ''`);break;case"contains":a.push(`Expr.containsIgnoreCase(${e}, '${this.currentFilterModel[e].filter}')`);break;case"equals":a.push(`${e} == '${this.currentFilterModel[e].filter}'`);break;case"notBlank":a.push(`${e} != ''`);break;case"notEqual":a.push(`${e} != '${this.currentFilterModel[e].filter}'`);break;case"wordStartsWith":a.push(`Expr.containsWordsStartingWithIgnoreCase(${e}, '${this.currentFilterModel[e].filter}')`)}else a.push(`${e} == ${this.currentFilterModel[e].type}`)}),this.getFiltersByType("number").forEach(e=>{const r=this.currentFilterModel[e].filter,t=this.currentFilterModel[e].filterTo;switch(this.currentFilterModel[e].type){case"equals":!isNaN(r)&&a.push(`${e} == ${r}`);break;case"notEqual":!isNaN(r)&&a.push(`${e} != ${r}`);break;case"greaterThan":!isNaN(r)&&a.push(`${e} > ${r}`);break;case"greaterThanOrEqual":!isNaN(r)&&a.push(`${e} >= ${r}`);break;case"lessThan":!isNaN(r)&&a.push(`${e} < ${r}`);break;case"lessThanOrEqual":!isNaN(r)&&a.push(`${e} <= ${r}`);break;case"inRange":!isNaN(r)&&!isNaN(t)&&a.push(`${e} >= ${r} && ${e} <= ${t}`);break;case"blank":a.push(`${e} == 0`);break;case"notBlank":a.push(`${e} != 0`)}}),this.getFiltersByType("date").forEach(e=>{var r,t;const o=null===(r=this.currentFilterModel[e].dateFrom)||void 0===r?void 0:r.replace(/-/g,"").replace("T","-").split(" ")[0],i=null===(t=this.currentFilterModel[e].dateTo)||void 0===t?void 0:t.replace(/-/g,"").replace("T","-").split(" ")[0];switch(this.currentFilterModel[e].type){case"equals":a.push(`Expr.dateIsEqual(${e}, '${o}')`);break;case"lessThan":a.push(`Expr.dateIsBefore(${e}, '${o}')`);break;case"greaterThan":a.push(`Expr.dateIsAfter(${e}, '${o}')`);break;case"inRange":a.push(`Expr.dateIsAfter(${e}, '${o}') && Expr.dateIsBefore(${e}, '${i}')`);break;case"isToday":const r=new Date,t=`${r.getFullYear()}-${(r.getMonth()+1).toString().padStart(2,"0")}-${r.getDate().toString().padStart(2,"0")} 00:00:00`;a.push(`Expr.dateIsEqual(${e}, '${t}')`);break;case"blank":a.push(`${e} == null`);break;case"notBlank":a.push(`${e} != null`)}}),a}getFiltersByType(a){return Object.keys(this.currentFilterModel).filter(a=>-1!==this.resourceColDefs.findIndex(e=>e.NAME===a)).filter(e=>this.currentFilterModel[e].filterType===a)}getPageNumber(a,e,r,t=!0){void 0!==r&&a>r&&(a=Math.floor((r-1)/e)*e+1);const o=Math.ceil(a/e);return t?o:o+1}getCorrectRowCount(a){const e=a.request.endRow;this.calculatedRowsCount=this.clientRowsCount||e;const r=Math.min(this.serverRowsCount,this.maxView);let t;return this.pagination?(t=this.resourceParams.CRITERIA_MATCH?void 0:Math.min(this.serverRowsCount,this.maxView),this.resourceParams.CRITERIA_MATCH&&(t=r),t):(e===this.serverRowsCount?t=this.serverRowsCount:e>this.maxView||e>this.calculatedRowsCount?t=Math.min(r,this.calculatedRowsCount):!this.moreRows&&this.serverRowsCount>this.calculatedRowsCount&&(t=this.calculatedRowsCount),t)}get isNotFirstViewNumber(){return this.zeroBasedViewNumber?this.currentSequenceId>0:this.currentSequenceId>1}getEffectivePagingMode(){return this.pagingMode?"offsetBased"!==this.pagingMode||this.criteriaOnlyRequest?this.pagingMode:(w.v.warn("offsetBased paging mode requires criteriaOnlyRequest support. Falling back to viewBased mode."),"viewBased"):this.criteriaOnlyRequest?"offsetBased":"viewBased"}}(0,t.Cg)([y.N],k.prototype,"auth",void 0),(0,t.Cg)([z.dm],k.prototype,"connect",void 0),(0,t.Cg)([x.k],k.prototype,"uuid",void 0);class C extends k{constructor(a){super(a),this.createDataserverStreamFunc=a.createDataserverStreamFunc}refreshDatasource(a){const e=Object.create(null,{refreshDatasource:{get:()=>super.refreshDatasource}});return(0,t.sH)(this,void 0,void 0,function*(){var r;null===(r=this.dataserverStreamSubscription)||void 0===r||r.unsubscribe(),this.dataserverStreamSubscription=void 0,yield e.refreshDatasource.call(this,a)})}getRows(a){return(0,t.sH)(this,void 0,void 0,function*(){if(yield this.setupFiltering(a),yield this.setupSorting(a),this.pagination&&!this.isNewPageSize&&this.currentSequenceId>0)return void a.success(this.lastSuccessRowData);this.dataserverStream||(this.dataserverStream=yield this.createDataserverStreamFunc(this.resourceParams)),this.currentSequenceId>=1&&(this.moreRows||a.request.startRow>=Number(this.maxRows)||0===a.request.startRow)&&(this.pagination&&(this.resourceParams.VIEW_NUMBER=this.getPageNumber(a.request.startRow,this.maxRows,this.maxView,this.zeroBasedViewNumber)),this.connect.getMoreRows(this.sourceRef,this.resourceParams.VIEW_NUMBER));let e=!0;this.dataserverStreamSubscription=this.dataserverStream.subscribe(r=>{e&&p.DOM.queueUpdate(()=>(0,t.sH)(this,void 0,void 0,function*(){if(this.resourceParams.CRITERIA_MATCH&&this.pagination){const a=yield this.connect.snapshot(this.resourceName,{MAX_ROWS:this.maxView,MAX_VIEW:this.maxView,CRITERIA_MATCH:this.resourceParams.CRITERIA_MATCH});a.ROW||a.ROWS_COUNT?this.serverRowsCount=this.resourceParams.CRITERIA_MATCH?a.ROW.length:a.ROWS_COUNT:(w.v.warn("No data returned when criteria is applied."),this.serverRowsCount=0,this.clientRowsCount=0)}this.applyServerSideData(a,r),e=!1}))})})}applyServerSideData(a,e){var r;const t=e.MESSAGE_TYPE;if(t&&(t===g.Go.LOGOFF_ACK||t===g.Go.MSG_NACK)){if(this.errorHandlerFunc){const a=t===g.Go.LOGOFF_ACK?`Connection lost to ${this.resourceName}`:`Authentication failed for ${this.resourceName}`;this.errorHandlerFunc(a,"connection")}return void a.fail()}if(this.moreRows=e.MORE_ROWS,!e.ROW){this.rowData=new Map;const e={rowData:[],rowCount:0};return void a.success(e)}{const a=(0,l.d)(e);this.handleCurrentStreamLoad(a)}this.currentSequenceId=e.SEQUENCE_ID,1===this.currentSequenceId&&(this.sourceRef=e.SOURCE_REF,0===this.serverRowsCount&&(this.serverRowsCount=null!==(r=e.ROWS_COUNT)&&void 0!==r?r:this.rowData.size));const o={rowData:Array.from(this.rowData.values())};o.rowCount=this.getCorrectRowCount(a),this.lastSuccessRowData=o,a.success(o)}setupSorting(a){return(0,t.sH)(this,void 0,void 0,function*(){var e;const r=a.request.sortModel;if((null===(e=this.currentSortModel)||void 0===e?void 0:e.length)!==r.length||r.length>0){if(0===r.length&&this.currentSortModel)return this.calculatedRowsCount=0,this.currentSortModel=null,this.resourceParams.ORDER_BY=null,this.resourceParams.REVERSE=null,void(yield this.refreshDatasource(a));if(r.length>0){const e=r[0].colId,t=r[0].sort,o=this.getOrderByAndToBeSortedColIds(this.resourceIndexes,e);if(!o){this.calculatedRowsCount=0;const r=(0,b.i)(this.resourceIndexes),t=(0,b.P)(this.resourceIndexes);return w.v.warn(`The FIELD/column (${e}) being sorted is not part of an INDEX, required for the [orderBy] operation. See https://learn.genesis.global/docs/database/data-types/index-entities/`),w.v.debug("Available indexes:",r),w.v.debug("Columns that can be sorted with the available indexes:",t),void a.fail()}if(JSON.stringify(r)!==JSON.stringify(this.currentSortModel))return this.currentSortModel=r,this.resourceParams.ORDER_BY=o.orderBy,this.resourceParams.REVERSE="desc"===t,void(yield this.refreshDatasource(a))}}})}destroy(){const a=Object.create(null,{destroy:{get:()=>super.destroy}});return(0,t.sH)(this,void 0,void 0,function*(){var e;this.dataserverStream=void 0,null===(e=this.dataserverStreamSubscription)||void 0===e||e.unsubscribe(),this.dataserverStreamSubscription=void 0,yield a.destroy.call(this)})}handleCurrentStreamLoad(a){var e,r;if(!a)return;const t=new Map;null===(e=a.inserts)||void 0===e||e.forEach(a=>{t.set(a[this.rowId],a)}),this.clientRowsCount+=null!==(r=a.inserts.length)&&void 0!==r?r:0,this.rowData=t}}class A extends k{constructor(a){var e;super(a),this.discoveredTotalRowCount=null,this.currentNextOffset=0,this.createReqRepRequestFunc=a.createReqRepRequestFunc;"viewBased"===this.getEffectivePagingMode()?(null===(e=a.resourceParams)||void 0===e?void 0:e.VIEW_NUMBER)||(this.resourceParams.VIEW_NUMBER=this.zeroBasedViewNumber?0:1):a.resourceParams.OFFSET||(this.resourceParams.OFFSET=0)}getRows(a){return(0,t.sH)(this,void 0,void 0,function*(){var e;if(yield this.setupFiltering(a),yield this.setupSorting(a),this.pagination&&!this.isNewPageSize&&this.currentSequenceId>0)return void a.success(this.lastSuccessRowData);const r=this.getEffectivePagingMode();"viewBased"===r?null!==this.currentSequenceId&&this.currentSequenceId>=0&&this.moreRows&&(this.pagination?this.resourceParams.VIEW_NUMBER=this.getPageNumber(a.request.startRow,this.maxRows,void 0,this.zeroBasedViewNumber):this.resourceParams.VIEW_NUMBER+=1):this.currentNextOffset>0&&this.currentNextOffset!==a.request.startRow?this.resourceParams.OFFSET=this.currentNextOffset:this.resourceParams.OFFSET=a.request.startRow;const t={DETAILS:this.buildRequestDetails(r)},o=yield this.createReqRepRequestFunc(t),i="MORE_ROWS"in o;let n=!1;if("viewBased"===r){if(i)n=!o.MORE_ROWS;else if(-1!==o.NEXT_VIEW){const a=Object.assign(Object.assign({},t),{DETAILS:Object.assign(Object.assign({},t.DETAILS),{VIEW_NUMBER:o.NEXT_VIEW})}),r=yield this.createReqRepRequestFunc(a);n=-1===r.NEXT_VIEW&&0===(null===(e=r.REPLY)||void 0===e?void 0:e.length)}}else n=i&&!o.MORE_ROWS,"NEXT_OFFSET"in o&&-1!==o.NEXT_OFFSET?this.currentNextOffset=o.NEXT_OFFSET:this.currentNextOffset=0;let g=!0;g&&(this.applyServerSideData(a,o,n),g=!1)})}applyServerSideData(a,e,r){var t,o;const i=e.MESSAGE_TYPE;if(i&&(i===g.Go.LOGOFF_ACK||i===g.Go.MSG_NACK)){if(this.errorHandlerFunc){const a=i===g.Go.LOGOFF_ACK?`Connection lost to ${this.resourceName}`:`Authentication failed for ${this.resourceName}`;this.errorHandlerFunc(a,"connection")}return void a.fail()}const n=this.getEffectivePagingMode();if(this.moreRows="MORE_ROWS"in e?e.MORE_ROWS:"viewBased"===n?!r&&-1!==e.NEXT_VIEW&&e.NEXT_VIEW>this.resourceParams.VIEW_NUMBER:!r&&-1!==e.NEXT_OFFSET&&e.NEXT_OFFSET>this.resourceParams.OFFSET,!e.REPLY){this.rowData=new Map;const e={rowData:[],rowCount:0};return void a.success(e)}if(this.handleCurrentStreamLoad(e.REPLY),this.currentSequenceId="viewBased"===n?this.resourceParams.VIEW_NUMBER:Math.floor(this.resourceParams.OFFSET/this.maxRows),this.sourceRef=e.SOURCE_REF,!this.moreRows){const e=this.rowData.size;this.discoveredTotalRowCount=a.request.startRow+e}this.pagination?this.serverRowsCount=null!==(t=e.ROWS_COUNT)&&void 0!==t?t:this.rowData.size:this.serverRowsCount+=null!==(o=e.ROWS_COUNT)&&void 0!==o?o:this.rowData.size;const l={rowData:Array.from(this.rowData.values())};l.rowCount=this.getCorrectRowCount(a),this.lastSuccessRowData=l,a.success(l)}getCorrectRowCount(a){let e;return this.pagination,e=this.moreRows?-1:this.discoveredTotalRowCount||a.request.startRow+this.rowData.size,e}handleCurrentStreamLoad(a){if(!a||0==a.length)return;const e=new Map;a.forEach(a=>{const r=a[this.rowId];if(r)return void e.set(r,a);const t=`The specified rowId (${this.rowId}) is not present in the data. Since this is a snapshot (isSnapshot=true), an auto-generated UUID will be used. For custom identifiers, use the 'row-id' attribute.`;h.v.error(t);const o=this.uuid.createId();a[this.rowId]=o,e.set(o,a)}),this.rowData=e}setupSorting(a){return(0,t.sH)(this,void 0,void 0,function*(){var e;const r=a.request.sortModel;if((null===(e=this.currentSortModel)||void 0===e?void 0:e.length)!==r.length||r.length>0){if(0===r.length&&this.currentSortModel)return this.calculatedRowsCount=0,this.currentSortModel=null,this.resourceParams.ORDER_BY=void 0,void(yield this.refreshDatasource(a));if(r.length>0){const e=r[0].colId,t=r[0].sort;if(JSON.stringify(r)!==JSON.stringify(this.currentSortModel))return this.currentSortModel=r,this.resourceParams.ORDER_BY=e+("desc"===t?" DESC":" ASC"),void(yield this.refreshDatasource(a))}}})}refreshDatasource(a){const e=Object.create(null,{refreshDatasource:{get:()=>super.refreshDatasource}});return(0,t.sH)(this,void 0,void 0,function*(){this.discoveredTotalRowCount=null,this.currentNextOffset=0,this.resourceParams.VIEW_NUMBER=this.zeroBasedViewNumber?0:1,this.resourceParams.OFFSET=0,yield e.refreshDatasource.call(this,a)})}buildRequestDetails(a){const e={CRITERIA_MATCH:this.resourceParams.CRITERIA_MATCH,MAX_ROWS:this.resourceParams.MAX_ROWS,ORDER_BY:this.resourceParams.ORDER_BY};return"viewBased"===a?Object.assign(Object.assign({},e),{VIEW_NUMBER:this.resourceParams.VIEW_NUMBER}):Object.assign(Object.assign({},e),{OFFSET:this.resourceParams.OFFSET})}}let D=class extends((0,s.S)(v.ML)){constructor(){super(...arguments),this.applyFuncName="applyServerSideTransaction",this.applyAsyncFuncName="applyServerSideTransactionAsync",this.zeroBasedViewNumber=!1,this.liveUpdates=!1,this.request={},this.sortIndicatorCSSDestroy=null}resourceNameChanged(a,e){a&&a!==e&&p.DOM.queueUpdate(()=>(0,t.sH)(this,void 0,void 0,function*(){yield this.restart()}))}criteriaChanged(a,e){const r=a!==(0,i.Q)(e,";");this.ssrmDatasource&&r&&p.DOM.queueUpdate(()=>(0,t.sH)(this,void 0,void 0,function*(){yield this.restart()}))}connectedCallback(){super.connectedCallback();const a=this.shouldRunConnect;p.DOM.queueUpdate(()=>{a&&(this.init(),this.subscribeToConnection())})}disconnectedCallback(){super.disconnectedCallback();const a=this.shouldRunDisconnect;p.DOM.queueUpdate(()=>(0,t.sH)(this,void 0,void 0,function*(){a&&(yield this.destroy(),this.unsubscribeFromConnection())}))}deepClone(){const a=super.deepClone();return a.deferredGridOptions=structuredClone(this.deferredGridOptions),a.deferredColumnStates=structuredClone(this.deferredColumnStates),a}reloadResourceData(a){return(0,t.sH)(this,void 0,void 0,function*(){var e,r,t,o,i,n,g;if(this.datasource.destroy(),null===(e=this.liveUpdatesStream)||void 0===e||e.unsubscribe(),this.liveUpdatesStream=void 0,yield null===(r=this.agGrid)||void 0===r?void 0:r.cacheFilterConfig(),this.clearRowData(null),this.setDisconnected(!1),null===(t=this.agGrid.gridApi)||void 0===t||t.refreshServerSide({purge:!0}),a){const e=Object.assign(Object.assign({},this.datasourceOptions()),a);(yield this.initializeDatasource(e,!0,!1))||(null===(o=this.agGrid.gridApi)||void 0===o||o.setServerSideDatasource(null),h.v.error("Genesis Datasource re-init failed on filtering/sorting."))}else this.ssrmDatasource&&(yield this.ssrmDatasource.destroy(),this.ssrmDatasource=void 0),null===(i=this.agGrid.gridApi)||void 0===i||i.setServerSideDatasource(null),null===(g=null===(n=this.agGrid)||void 0===n?void 0:n.gridApi)||void 0===g||g.showLoadingOverlay(),yield this.init()})}applyServerSideSortIndicatorStyling(){var a,e;if(this.removeServerSideSortIndicatorStyling(),null===(a=this.agGrid)||void 0===a?void 0:a.gridApi){const a=(null===(e=this.agGrid.gridSlot)||void 0===e?void 0:e.parentElement)||this.agGrid;a&&a.classList.add("grid-pro-server-side")}this.sortIndicatorCSSDestroy=(0,c.O5)('\n .grid-pro-server-side .ag-header-cell-sortable .ag-sort-indicator-container {\n opacity: 1 !important;\n visibility: visible !important;\n }\n \n .grid-pro-server-side .ag-header-cell-sortable:not(.ag-header-cell-sorted) .ag-sort-indicator-container {\n opacity: 0.4 !important;\n }\n \n .grid-pro-server-side .ag-header-cell-sorted .ag-sort-indicator-container {\n opacity: 1 !important;\n }\n \n .grid-pro-server-side .ag-sort-ascending-icon::before,\n .grid-pro-server-side .ag-sort-descending-icon::before,\n .grid-pro-server-side .ag-header-cell-sortable:not(.ag-header-cell-sorted) .ag-sort-indicator-icon::before {\n font-family: var(--ag-icon-font-family, agGridAlpine) !important;\n font-size: var(--ag-icon-size, 16px) !important;\n color: var(--ag-header-foreground-color, var(--ag-foreground-color)) !important;\n }\n \n .grid-pro-server-side .ag-sort-ascending-icon::before {\n content: "\\e90d" !important; /* AG Grid sort up icon */\n }\n \n .grid-pro-server-side .ag-sort-descending-icon::before {\n content: "\\e90c" !important; /* AG Grid sort down icon */\n }\n \n .grid-pro-server-side .ag-header-cell-sortable:not(.ag-header-cell-sorted) .ag-sort-indicator-icon::before {\n content: "\\e90b" !important; /* AG Grid sort icon */\n opacity: 0.6 !important;\n }\n \n /* Ensure the sort indicator is always visible for sortable columns in server-side mode */\n .grid-pro-server-side .ag-header-cell-sortable .ag-sort-indicator-icon {\n display: inline-block !important;\n }\n',"grid-pro-server-side-sort")}removeServerSideSortIndicatorStyling(){var a,e;const r=(null===(e=null===(a=this.agGrid)||void 0===a?void 0:a.gridSlot)||void 0===e?void 0:e.parentElement)||this.agGrid;r&&r.classList.remove("grid-pro-server-side"),this.sortIndicatorCSSDestroy&&(this.sortIndicatorCSSDestroy(),this.sortIndicatorCSSDestroy=null)}init(){return(0,t.sH)(this,void 0,void 0,function*(){if(this.agGrid){const a=Object.assign(Object.assign({getRowId:a=>a.data?String(a.data[this.rowId]):null,getRowStyle(a){var e,r;if(null===(r=null===(e=a.data)||void 0===e?void 0:e.ROW_REF)||void 0===r?void 0:r.includes("_deleted"))return{color:"grey"}},cacheBlockSize:this.maxRows,defaultColDef:{filter:!0,resizable:!0,sortable:!1,unSortIcon:!0},rowBuffer:0,rowModelType:"serverSide",suppressServerSideInfiniteScroll:!1,suppressMultiSort:!0,onFilterChanged:a=>{},onSortChanged:a=>{},onPaginationChanged:a=>this.onPaginationChanged(a)},this.agGrid.agGridOptions),this.deferredGridOptions);return this.agGrid.gridOptions=a,this.agGrid.initGrid(),void this.agGrid.addEventListener(o.sVA.EVENT_GRID_READY,()=>(0,t.sH)(this,void 0,void 0,function*(){if(!(yield this.initializeDatasource(this.datasourceOptions(),!0,!1)))return h.v.debug(`Genesis Datasource init failed for ${this.resourceName}`),this.clearRowData(),void this.setDisconnected(!0);this.$emit(u.V.dataInit),this.setDisconnected(!1),this.indexes=this.getResourceIndexes(this.datasource.availableIndexes);const a=(0,n.X)(this.datasource.originalFieldDef),e=yield this.getAgColumnDefs(a);this.agGrid.gridApi.setColumnDefs(e),this.isRequestServer?this.ssrmDatasource=new A({createReqRepRequestFunc:this.createReqRepRequest.bind(this),reloadResourceDataFunc:this.reloadResourceData.bind(this),errorHandlerFunc:this.handleErrors.bind(this),resourceName:this.resourceName,resourceParams:this.datasource.dataserverOnlyParams,resourceIndexes:this.indexes,resourceColDefs:this.datasource.originalFieldDef,maxRows:+this.maxRows,maxView:+this.maxView,rowId:this.rowId,pagination:this.pagination,zeroBasedViewNumber:this.zeroBasedViewNumber,pagingMode:this.pagingMode,criteriaOnlyRequest:this.datasource.criteriaOnlyRequest}):this.ssrmDatasource=new C({createDataserverStreamFunc:this.createDataserverStream.bind(this),reloadResourceDataFunc:this.reloadResourceData.bind(this),errorHandlerFunc:this.handleErrors.bind(this),resourceName:this.resourceName,resourceParams:this.datasource.requestOnlyParams,resourceIndexes:this.indexes,resourceColDefs:this.datasource.originalFieldDef,maxRows:+this.maxRows,maxView:+this.maxView,rowId:this.rowId,pagination:this.pagination,zeroBasedViewNumber:this.zeroBasedViewNumber}),this.agGrid.gridApi.setServerSideDatasource(this.ssrmDatasource),this.agGrid.restoreCachedFilterConfig(),this.applyServerSideSortIndicatorStyling()}),{once:!0})}this.handleErrors("Application not connected or invalid resource name, datasource will not work.","unknown")})}onPaginationChanged(a){var e;this.agGrid.gridApi&&this.ssrmDatasource&&(this.ssrmDatasource.isNewPageSize=null!==(e=a.newPage)&&void 0!==e&&e)}destroy(){return(0,t.sH)(this,void 0,void 0,function*(){var a,e,r;this.datasource.destroy(),null===(a=this.liveUpdatesStream)||void 0===a||a.unsubscribe(),this.liveUpdatesStream=void 0,this.clearRowData(),this.ssrmDatasource&&(yield this.ssrmDatasource.destroy(),this.ssrmDatasource=void 0),this.removeServerSideSortIndicatorStyling(),null===(e=this.agGrid.gridApi)||void 0===e||e.setServerSideDatasource(null),null===(r=this.agGrid.gridApi)||void 0===r||r.refreshServerSide({purge:!0})})}restart(){return(0,t.sH)(this,void 0,void 0,function*(){yield this.destroy(),yield this.init()})}clearRowData(a=!0){var e,r,t,o;this.rowData=new Map,a&&(null===(r=null===(e=this.agGrid)||void 0===e?void 0:e.gridApi)||void 0===r||r.setColumnDefs([])),this.agTransaction={remove:[]},null===(t=this.agGrid.gridApi)||void 0===t||t.forEachNode(a=>{this.agTransaction.remove.push(a.data)}),null===(o=this.agGrid.gridApi)||void 0===o||o.applyServerSideTransaction(this.agTransaction),this.agTransaction=void 0}getResourceIndexes(a){const e=new Map;return null==a||a.forEach(a=>{e.set(a.NAME,a.FIELDS.split(" "))}),e}get rowModel(){return this.agGrid.gridApi.getModel()}createReqRepRequest(){return(0,t.sH)(this,arguments,void 0,function*(a=null){return yield this.datasource.snapshot(a)})}createDataserverStream(){return(0,t.sH)(this,arguments,void 0,function*(a=null){if(this.liveUpdates){const e=a=>(0,t.sH)(this,void 0,void 0,function*(){var e,r,t,o,i,n,d,s;if(a.MESSAGE_TYPE===g.Go.QUERY_UPDATE&&a.ROW){if(!this.ssrmDatasource)return;const g=(0,l.d)(a);if(this.agTransaction={add:[],remove:[],update:[]},this.handleStreamInserts(g.inserts),this.handleStreamUpdates(g.updates),this.handleStreamDeletes(g.deletes),a.SEQUENCE_ID>1){const a=(null!==(r=null===(e=g.inserts)||void 0===e?void 0:e.length)&&void 0!==r?r:0)-(null!==(o=null===(t=g.deletes)||void 0===t?void 0:t.length)&&void 0!==o?o:0);this.ssrmDatasource.serverRowsCount+=a;const l=null!==(n=null===(i=g.deletes)||void 0===i?void 0:i.filter(a=>{const e=a[this.rowId];return null!=this.agGrid.gridApi.getRowNode(e)}))&&void 0!==n?n:[],c=(null!==(s=null===(d=g.inserts)||void 0===d?void 0:d.length)&&void 0!==s?s:0)-l.length;this.ssrmDatasource.clientRowsCount+=c,this.applyAllAgTransactions()}}}),r=a=>{var e;h.v.error(a),this.handleErrors((null===(e=a.receivedMessage)||void 0===e?void 0:e.ERROR)||a.message,"stream")};this.liveUpdatesStream=this.connect.stream(this.resourceName,()=>{},r,null!=a?a:this.datasource.dataserverOnlyParams).subscribe(a=>e(a))}return yield this.datasource.startStream(),this.datasource.stream})}getAgColumnDefs(a){return(0,t.sH)(this,void 0,void 0,function*(){const e=this.generateColumnDefsFromMetadata(a,f);this.datasource.resourceType===d.v.DATASERVER?e.forEach(a=>{a.sortable=[].concat(...this.indexes.values()).includes(a.field)}):e.forEach(a=>{a.sortable=!0});return yield this.agGrid.mergeAllColumnDefsAndStates(e,!0)})}applyTransaction(a){return this.agGrid.gridApi.applyServerSideTransaction(a)}applyTransactionAsync(a,e){this.agGrid.gridApi.applyServerSideTransactionAsync(a,e)}loadMore(){throw new Error("loadMore() method is not supported for server-side datasource")}};(0,t.Cg)([(0,p.attr)({mode:"boolean",attribute:"zero-based-view-number"})],D.prototype,"zeroBasedViewNumber",void 0),(0,t.Cg)([(0,p.attr)({mode:"boolean",attribute:"live-updates"})],D.prototype,"liveUpdates",void 0),(0,t.Cg)([(0,p.attr)({attribute:"paging-mode"})],D.prototype,"pagingMode",void 0),(0,t.Cg)([p.observable],D.prototype,"request",void 0),D=(0,t.Cg)([(0,p.customElement)({name:"grid-pro-server-side-datasource"})],D)},26062:(a,e,r)=>{r.d(e,{D:()=>k});var t=r(55823),o=r(44210),i=r(96730),n=r(39087),g=r(21281),l=r(34193),d=r(21409),s=r(33681),c=r(97156),p=r(56607),u=r(10629),h=r(41392),v=r(92453),m=r(2773),f=r(35610),w=r(41119);function b(a){switch(a){case w.w.DATE:case w.w.DATETIME:return{comparator:function(a,e){if(!e)return-1;const r=new Date(e).setHours(0,0,0,0),t=a.getTime();return r===t?0:r<t?-1:r>t?1:void 0},buttons:["reset","apply"],closeOnApply:!0,closeOnClear:!0,maxNumConditions:1,browserDatePicker:!0}}}var y=r(55365),z=r(1510),x=r(90509);let k=class extends((0,d.S)(f.ML)){constructor(){super(...arguments),this.applyFuncName="applyTransaction",this.applyAsyncFuncName="applyTransactionAsync",this.cachedRowArray=[],this.keepColDefsOnClearRowData=!1,this.requiresFullRowDataAndColDefs=!0,this._lastMoreRows=!1,this._isMoreRowsResult=!1,this._nextOffset=0,this._loadMoreCount=0}criteriaChanged(a,e){return(0,t.sH)(this,void 0,void 0,function*(){const r=a!==(0,i.Q)(e,f.NC);this.datasource.initialized&&r&&(yield this.reloadResourceData())})}requestChanged(a,e){const r=a!==e;this.datasource.initialized&&r&&this.reloadResourceData()}resourceNameChanged(a,e){a&&a!==e&&this.restart()}connectedCallback(){super.connectedCallback();const a=this.shouldRunConnect;s.DOM.queueUpdate(()=>{a&&(this.init(),this.subscribeToConnection())})}disconnectedCallback(){super.disconnectedCallback();const a=this.shouldRunDisconnect;s.DOM.queueUpdate(()=>{a&&(this.destroy(),this.unsubscribeFromConnection())})}deepClone(){const a=super.deepClone();return a.deferredGridOptions={},this.deferredGridOptions&&Object.keys(this.deferredGridOptions).forEach(e=>{"function"==typeof this.deferredGridOptions[e]?a.deferredGridOptions[e]=this.deferredGridOptions[e].bind(a):"columnDefs"===e&&this.deferredGridOptions[e].length?a.deferredGridOptions[e]=this.colDefsDeepClone(e,a):a.deferredGridOptions[e]=structuredClone(this.deferredGridOptions[e])}),a.deferredColumnStates=structuredClone(this.deferredColumnStates),a.request=structuredClone(this.request),a}colDefsDeepClone(a,e){return this.deferredGridOptions[a].map(a=>{const r={};return Object.keys(a).forEach(t=>{"function"==typeof a[t]?r[t]=a[t].bind(e):r[t]=structuredClone(a[t])}),r})}init(a,e){return(0,t.sH)(this,void 0,void 0,function*(){if(this.agGrid){const r=Object.assign(Object.assign(Object.assign({getRowId:a=>a.data[this.rowId]},this.agGrid.agGridOptions),a&&{columnDefs:a}),this.deferredGridOptions);this.agGrid.gridOptions=Object.assign({},r),this.agGrid.initGrid(),this.agGrid.addEventListener(o.sVA.EVENT_GRID_READY,()=>(0,t.sH)(this,void 0,void 0,function*(){e&&this.agGrid.columnApi.applyColumnState({state:e}),yield this.loadResourceData()}),{once:!0});const i=600;return void(this.updateSub=this.update.pipe((0,u.i)(1),(0,h.B)(i),(0,v.M)(a=>z.v.debug("filters (debounced): ",a))).subscribe(a=>{this.reloadResourceData()}))}this.handleErrors("Application not connected or invalid resource name, datasource will not work.","unknown")})}destroy(){var a;z.v.debug("GridProGenesisDatasource.destroy()",this.resourceName),this.dataSub&&(this.dataSub.unsubscribe(),this.dataSub=void 0),this.updateSub&&(this.updateSub.unsubscribe(),this.updateSub=void 0),this.connectionSub&&(this.connectionSub.unsubscribe(),this.connectionSub=void 0),this._sourceRef=void 0,this.clearRowData(),this._lastMoreRows=!1,this._isMoreRowsResult=!1,this._nextOffset=0,this._loadMoreCount=0,this.agGrid.clearLocalGridOptions(),this.requiresFullRowDataAndColDefs=!0,this.dataSubWasLoggedOff=!1,this.criteriaFromFilters=new Map,null===(a=this.update)||void 0===a||a.unsubscribe(),this.update=new c.t(new Map),this.setDisconnected(!1),this.datasource.destroy()}deinit(){z.v.debug("GridProGenesisDatasource.deinit()",this.resourceName),this.destroy()}reset(){z.v.debug("GridProGenesisDatasource.reset()",this.resourceName),this.destroy()}restart(){return(0,t.sH)(this,void 0,void 0,function*(){let a,e;this.keepColDefsOnClearRowData&&(a=this.agGrid.gridApi.getColumnDefs(),e=this.agGrid.columnApi.getColumnState()),this.destroy(),yield this.init(a,e)})}refreshRows(){this.updateCachedRowArray(),this.setRowData(this.cachedRowArray)}clearRowData(a=!0){var e,r,t,o,i,n,g,l;(this.agGrid.asyncAdd||this.agGrid.asyncUpdate||this.agGrid.asyncRemove)&&(null===(r=null===(e=this.agGrid)||void 0===e?void 0:e.gridApi)||void 0===r||r.flushAsyncTransactions()),this.rowData=new Map,this.cachedRowArray=[],this.agTransaction=void 0,a&&!this.keepColDefsOnClearRowData&&(null===(o=null===(t=this.agGrid)||void 0===t?void 0:t.gridApi)||void 0===o||o.setColumnDefs([])),null===(n=null===(i=this.agGrid)||void 0===i?void 0:i.gridApi)||void 0===n||n.setRowData([]),null===(l=null===(g=this.agGrid)||void 0===g?void 0:g.gridApi)||void 0===l||l.refreshCells({force:!0})}setRowData(a){return(0,t.sH)(this,void 0,void 0,function*(){var e;const r=null===(e=this.agGrid.gridApi)||void 0===e?void 0:e.getColumnDefs();if(!r||0===r.length){const a=yield this.getAgColumnDefs(this.datasource.fieldMetadata);a&&(a.forEach(a=>{a.rowGroup||(a.rowGroup=null),a.pivot||(a.pivot=null)}),this.agGrid.gridApi.setColumnDefs(a))}const t=this.rowDataMapper?this.rowDataMapper(a):a;this.agGrid.restoreCachedFilterConfig(),this.agTransaction={add:t?[...t]:[],remove:[],update:[],addIndex:0},this.applyAllAgTransactions(),this.updateCachedRowArray(),this.requiresFullRowDataAndColDefs=!1})}updateCachedRowArray(){this.cachedRowArray=Array.from(this.rowData.values())}reloadResourceData(){return(0,t.sH)(this,void 0,void 0,function*(){var a,e,r;z.v.debug("GridProGenesisDatasource.reloadResourceData()",this.resourceName),this.dataSub&&(this.dataSub.unsubscribe(),this.dataSub=void 0),this._nextOffset=0,this._loadMoreCount=0,this.datasource.updateLoadMoreCount(0),this.datasource.stream=void 0,yield null===(a=this.agGrid)||void 0===a?void 0:a.cacheFilterConfig(),this.clearRowData(null),null===(r=null===(e=this.agGrid)||void 0===e?void 0:e.gridApi)||void 0===r||r.showLoadingOverlay(),this.setDisconnected(!1),yield this.loadResourceData(null)})}loadResourceData(){return(0,t.sH)(this,arguments,void 0,function*(a=!0){const e=a||!this.datasource.initialized;try{if(!(yield this.initializeDatasource(this.datasourceOptions(),e,!1)))return z.v.debug(`Genesis Datasource init failed for ${this.resourceName}`),void this.clearRowData();if(this.$emit(x.V.dataInit),this.isSnapshot){const a=yield this.datasource.snapshot();if(a){const e=this.handleSnapshot(a);this.setRowData(e)}return}z.v.debug(`starting stream for ${this.resourceName}`),yield this.datasource.startStream(),this.dataSub=this.datasource.stream.pipe((0,m.W)(a=>{var e;return this.handleErrors((null===(e=null==a?void 0:a.receivedMessage)||void 0===e?void 0:e.ERROR)||(null==a?void 0:a.message)||a,"stream"),p.w})).subscribe(a=>{this._sourceRef=a.SOURCE_REF;const e="MORE_ROWS"in a,r="ROWS_COUNT"in a,t=this.datasource.resourceType===n.v.REQUEST_SERVER&&"NEXT_OFFSET"in a;this._isMoreRowsResult=e&&!r,t&&(this._nextOffset=a.NEXT_OFFSET),(null==a?void 0:a.ERROR)&&this.handleErrors(a.ERROR,"criteria");const o=a.MESSAGE_TYPE;if(o&&o===g.Go.LOGOFF_ACK)return this.handleErrors(`Genesis datasource for ${this.resourceName} disconnected.`,"connection"),void(this.dataSubWasLoggedOff=!0);if(this.dataSubWasLoggedOff=!1,e&&this.updateLoadMoreStatus(a.MORE_ROWS,a.SOURCE_REF),a.ROW){const r=(0,l.d)(a);if(this.handleStreamResult(r),e&&a.MORE_ROWS!==this._lastMoreRows){const e={moreRows:a.MORE_ROWS,sourceRef:a.SOURCE_REF};this.$emit(x.V.moreRowsChanged,e),this._lastMoreRows=a.MORE_ROWS}}else this.handleStreamResult(a)})}catch(a){let{message:e}=a;a.receivedMessage&&(e=a.receivedMessage.ERROR),z.v.error(e),this.handleErrors(e,"unknown")}})}handleSnapshot(a){return Array.isArray(a)?a:a.REPLY?a.REPLY:a.ROW?(0,l.d)(a).inserts:a.inserts}handleStreamResult(a){a&&(this.isRequestServer?this.applyRequestServerData(a):this.applyDataserverData(a))}updateLoadMoreStatus(a,e){var r,t,o;if(!(null===(r=this.agGrid)||void 0===r?void 0:r.gridApi))return;const i=this.agGrid.gridApi.getStatusPanel(y.k7.loadMore);i&&(null===(o=(t=i).updateParams)||void 0===o||o.call(t,{moreRows:a,sourceRef:e}))}applyRequestServerData(a){var e;const r=this.rowData.size,t=a.REPLY;if(!Array.isArray(t)||!(null===(e=a.MESSAGE_TYPE)||void 0===e?void 0:e.startsWith("REP_")))return void z.v.error("received invalid RequestServerResult",a);if(this.requiresFullRowDataAndColDefs){let a=!1;for(const e of t||[]){const r=e[this.rowId];if(!r){if(!a){const e=`The specified rowId (${this.rowId}) is not present in the data. Since this is not a snapshot (isSnapshot=false), the data will not be loaded. Please provide a valid 'row-id' attribute.`;z.v.error(e),a=!0}break}this.rowData.set(r,e)}if(a)return void this.destroy();this.updateCachedRowArray();const e=this.rowData.size>0?this.cachedRowArray:t;return this.handleSizeChanged(r,this.rowData.size),void this.setRowData(e)}const o=[];this.updateCachedRowArray();const i=this.cachedRowArray.filter(a=>{const e=t.find(e=>e[this.rowId]===a[this.rowId]);return!e||(o.push(e),!1)}),n=t.filter(a=>!this.rowData.has(a[this.rowId]));this.agTransaction={add:[],remove:[],update:[]},this.handleStreamInserts(n),this.handleStreamDeletes(i),this.handleStreamUpdates(o),this.applyAllAgTransactions(),this.handleSizeChanged(r,this.rowData.size)}applyDataserverData(a){var e;const r=this.rowData.size;if(this.requiresFullRowDataAndColDefs)return null===(e=a.inserts)||void 0===e||e.forEach(a=>{this.rowData.set(a[this.rowId],a)}),this.updateCachedRowArray(),this.setRowData(this.cachedRowArray),void this.handleSizeChanged(r,this.rowData.size);this.agTransaction={add:[],remove:[],update:[]},this.handleStreamInserts(a.inserts),this.handleStreamDeletes(a.deletes),this.handleStreamUpdates(a.updates),this.applyAllAgTransactions(),this.handleSizeChanged(r,this.rowData.size)}getAgColumnDefs(a){return(0,t.sH)(this,void 0,void 0,function*(){const e=this.generateColumnDefsFromMetadata(a,b);return yield this.agGrid.mergeAllColumnDefsAndStates(e,!0)})}setFilter(a,e){this.criteriaFromFilters.set(a,e),this.update.next(this.criteriaFromFilters)}removeFilter(a){this.criteriaFromFilters.delete(a),this.update.next(this.criteriaFromFilters)}applyTransaction(a){return this.agGrid.gridApi.applyTransaction(a)}applyTransactionAsync(a,e){this.agGrid.gridApi.applyTransactionAsync(a,e)}handleSizeChanged(a,e){a!==e&&this.$emit(x.V.sizeChanged,{value:e,oldValue:a})}handleStreamInserts(a=[]){super.handleStreamInserts(a,this._isMoreRowsResult?this.cachedRowArray.length:0),this.updateCachedRowArray()}handleStreamUpdates(a=[]){super.handleStreamUpdates(a),this.updateCachedRowArray()}handleStreamDeletes(a=[]){super.handleStreamDeletes(a),this.updateCachedRowArray()}loadMore(){switch(this.datasource.resourceType){case n.v.DATASERVER:let a;this.viewNumber?(this._loadMoreCount=+this.viewNumber+1,a=this._loadMoreCount):this._loadMoreCount+=1,this.connect.getMoreRows(this._sourceRef,a);break;case n.v.REQUEST_SERVER:this._loadMoreCount+=1}this.datasource.updateLoadMoreCount(this._loadMoreCount)}};(0,t.Cg)([(0,s.attr)({mode:"boolean",attribute:"keep-col-defs-on-clear-row-data"})],k.prototype,"keepColDefsOnClearRowData",void 0),k=(0,t.Cg)([(0,s.customElement)({name:"grid-pro-genesis-datasource"})],k)},28745:(a,e,r)=>{r.d(e,{v:()=>o});var t=r(48915);const o=(0,t.createLogger)("foundation-utils")},30335:(a,e,r)=>{r.d(e,{B:()=>i,P:()=>n});var t=r(33681),o=r(68858);const i=t.css`
|
|
27
|
+
`;class l extends i.FoundationElement{init(a){this.params=a}getGui(){return this}refresh(a){return this.params=a,!0}destroy(){}}(0,t.Cg)([o.observable],l.prototype,"params",void 0);const d=l.compose({baseName:"status-pill-renderer",template:g(),styles:n})},21409:(a,e,r)=>{r.d(e,{S:()=>o});var t=r(55823);const o=a=>{var e,r,o,n,g,l,d,s,c;return c=class extends a{constructor(...a){super(a),e.add(this),r.set(this,{_key:"dom"}),o.set(this,""),n.set(this,!1),g.set(this,void 0),l.set(this,!1)}cloneNode(a){const e=this.deepClone();return a&&Array.from(this.childNodes).forEach(a=>{e.appendChild(a.cloneNode(!0))}),e}deepClone(){const a=document.createElement(this.tagName.toLowerCase());return this.getAttributeNames().forEach(e=>a.setAttribute(e,this.getAttribute(e))),a}get shouldRunDisconnect(){return!!(0,t.gn)(this,l,"f")||("dom"===(0,t.gn)(this,r,"f")._key||"foundation-layout-cache"!==(0,t.gn)(this,r,"f")._key&&!((0,t.gn)(this,r,"f").dragging||!(0,t.gn)(this,r,"f").hasFirstLoaded||(0,t.gn)(this,e,"m",d).call(this,"disconnect")))}get shouldRunConnect(){if((0,t.gn)(this,l,"f"))return!0;if("dom"===(0,t.gn)(this,r,"f")._key)return!0;if("foundation-layout-cache"===(0,t.gn)(this,r,"f")._key)return!1;let a="reconnect";return!1===(0,t.gn)(this,n,"f")&&((0,t.GG)(this,n,!0,"f"),a="connect"),!((0,t.gn)(this,r,"f").dragging||!(0,t.gn)(this,r,"f").hasFirstLoaded||(0,t.gn)(this,e,"m",d).call(this,a))}connectedCallback(){super.connectedCallback(),"foundation-layout"!==(0,t.gn)(this,r,"f")._key&&(0,t.GG)(this,r,(0,t.gn)(this,e,"m",s).call(this,this),"f")}},r=new WeakMap,o=new WeakMap,n=new WeakMap,g=new WeakMap,l=new WeakMap,e=new WeakSet,d=function(a){var e,i;if("foundation-layout"!==(0,t.gn)(this,r,"f")._key)throw new Error("LifecycleMixin: should not be checking a token change if container not in the layout");const n=(0,t.gn)(this,o,"f")!==(0,t.gn)(this,r,"f").lifecycleUpdateToken;let d=!1;return"connect"===a?(0,t.GG)(this,o,null!==(e=(0,t.gn)(this,r,"f").lifecycleUpdateToken)&&void 0!==e?e:"","f"):"disconnect"===a?(d=n,(0,t.GG)(this,g,setTimeout(()=>{(0,t.GG)(this,l,d,"f"),(0,t.gn)(this,l,"f")&&this.disconnectedCallback()},1e4),"f")):"reconnect"===a&&(d=n,(0,t.GG)(this,o,null!==(i=(0,t.gn)(this,r,"f").lifecycleUpdateToken)&&void 0!==i?i:"","f"),clearTimeout((0,t.gn)(this,g,"f"))),d},s=function a(r){var o;if(!0===r.getRootNode()[i])return{_key:"foundation-layout-cache"};if(r.getRootNode()instanceof Document||!(null===(o=r.getRootNode())||void 0===o?void 0:o.host))return{_key:"dom"};const n=r.getRootNode().host;if("FoundationLayoutMain"===n.class){const a=n;return a._key="foundation-layout",a}return(0,t.gn)(this,e,"m",a).call(this,n)},c},i=Symbol("layout-cache-document")},23201:(a,e,r)=>{function t(a){return{colId:a.field||a.colId||"",hide:a.hide||!1,width:a.width||null,pinned:a.pinned||null,sort:a.sort||null,sortIndex:a.sortIndex||null,aggFunc:a.aggFunc||null,rowGroup:a.rowGroup||!1,rowGroupIndex:a.rowGroupIndex||null,pivot:a.pivot||!1,pivotIndex:a.pivotIndex||null,flex:a.flex||null}}function o(a){return a.map(t)}function i(a,e){const r={},t=[],o="field",i="colId";return e.forEach(e=>{const n=a.find(a=>a[o]===e[i]||a[i]&&a[i]===e[i]);if(n){const a=Object.assign(Object.assign({},n),e);r[n[o]]=a,t.push(a)}}),a.forEach(a=>{if(!r.hasOwnProperty(a[o])){const e=Object.assign({},a);r[a[o]]=e,t.push(e)}}),t}r.d(e,{pr:()=>t,rG:()=>o,yS:()=>i})},24638:(a,e,r)=>{r.d(e,{X:()=>D});var t=r(55823),o=r(44210),i=r(96730),n=r(48707),g=r(21281),l=r(34193),d=r(39087),s=r(21409),c=r(52945),p=r(33681),u=r(90509),h=r(1510),v=r(35610),m=r(41119);function f(a){switch(a){case m.w.BOOLEAN:return{buttons:["reset","apply"],closeOnApply:!0,closeOnClear:!0,maxNumConditions:1,filterOptions:["contains",{displayKey:"true",displayName:"True",predicate:(a,e)=>"true"===e||!0===e,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(a,e)=>"false"===e||!1===e,numberOfInputs:0},{displayKey:"true-false",displayName:"True/False",predicate:(a,e)=>"true"===e||!0===e||"false"===e||!1===e,numberOfInputs:0}]};case m.w.DATE:case m.w.DATETIME:return{comparator:(a,e)=>{if(!e)return-1;const r=new Date(e).setHours(0,0,0,0),t=a.getTime();return r===t?0:r<t?-1:r>t?1:void 0},buttons:["reset","apply"],closeOnApply:!0,closeOnClear:!0,maxNumConditions:1,browserDatePicker:!0,filterOptions:["equals","lessThan","greaterThan","inRange",{displayKey:"isToday",displayName:"Is today",numberOfInputs:0,predicate:()=>!0},"blank","notBlank"]};case m.w.NUMBER:return{buttons:["reset","apply"],closeOnApply:!0,closeOnClear:!0,maxNumConditions:1,filterOptions:["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"]};default:return{buttons:["reset","apply"],closeOnApply:!0,closeOnClear:!0,maxNumConditions:1,filterOptions:["contains","equals","notEqual",{displayKey:"wordStartsWith",displayName:"Word starts with",numberOfInputs:1,predicate:()=>!0},"blank","notBlank"]}}}var w=r(17465),b=r(49874),y=r(40113),z=r(26347),x=r(32808);class k{constructor(a){var e;this.rowData=new Map,this.serverRowsCount=0,this.clientRowsCount=0,this.moreRows=!1,this.calculatedRowsCount=0,this.currentSequenceId=null,this.reloadResourceDataFunc=a.reloadResourceDataFunc,this.errorHandlerFunc=a.errorHandlerFunc,this.resourceName=a.resourceName,this.resourceParams=a.resourceParams,this.originalCriteriaMatch=a.resourceParams.CRITERIA_MATCH,this.resourceIndexes=a.resourceIndexes,this.resourceColDefs=a.resourceColDefs,this.maxRows=a.maxRows,this.maxView=a.maxView,this.rowId=a.rowId,this.pagination=a.pagination,this.zeroBasedViewNumber=a.zeroBasedViewNumber,this.pagingMode=a.pagingMode,this.criteriaOnlyRequest=null!==(e=a.criteriaOnlyRequest)&&void 0!==e&&e}getRows(a){throw new Error("Method not implemented.")}setupFiltering(a){return(0,t.sH)(this,void 0,void 0,function*(){const e=a.request.filterModel,r=Object.keys(e).length>0,t=0===Object.keys(e).length,o=JSON.stringify(e)!==JSON.stringify(this.currentFilterModel);if(o||r){if(t&&this.currentFilterModel)return this.currentFilterModel=null,this.resourceParams.CRITERIA_MATCH=this.originalCriteriaMatch,void(yield this.refreshDatasource(a));if(o&&r)return this.currentFilterModel=e,this.resourceParams.CRITERIA_MATCH=this.buildCriteriaMatchFromFilters(),void(yield this.refreshDatasource(a))}})}setupFilteringAndSorting(a){return(0,t.sH)(this,void 0,void 0,function*(){yield this.setupFiltering(a),yield this.setupSorting(a)})}destroy(){this.rowData=new Map,this.clientRowsCount=0,this.calculatedRowsCount=0,this.serverRowsCount=0,this.currentSequenceId=0,this.moreRows=!1,this.sourceRef=void 0,this.lastSuccessRowData=void 0}refreshDatasource(a){return(0,t.sH)(this,void 0,void 0,function*(){yield this.destroy(),yield this.reloadResourceDataFunc({criteria:this.resourceParams.CRITERIA_MATCH,orderBy:this.resourceParams.ORDER_BY,reverse:this.resourceParams.REVERSE})})}getOrderByAndToBeSortedColIds(a,e){for(const[r,t]of a.entries()){const a=t.findIndex(a=>a===e);if(-1!==a){return{orderBy:r,toBeSorted:[...t].splice(a,1)}}}}buildCriteriaMatchFromFilters(){this.resourceParams.CRITERIA_MATCH=this.originalCriteriaMatch,this.resourceParams.CRITERIA_MATCH&&"string"==typeof this.resourceParams.CRITERIA_MATCH&&(this.resourceParams.CRITERIA_MATCH=this.resourceParams.CRITERIA_MATCH.split(";")),this.resourceParams.CRITERIA_MATCH||(this.resourceParams.CRITERIA_MATCH=[]);return this.resourceParams.CRITERIA_MATCH.concat(this.criteriaFromFilters()).join(" && ")}criteriaFromFilters(){const a=[];return this.getFiltersByType("text").forEach(e=>{if(this.currentFilterModel[e].filter||"false"!==this.currentFilterModel[e].type&&"true"!==this.currentFilterModel[e].type)switch(this.currentFilterModel[e].type){case"blank":a.push(`${e} == ''`);break;case"contains":a.push(`Expr.containsIgnoreCase(${e}, '${this.currentFilterModel[e].filter}')`);break;case"equals":a.push(`${e} == '${this.currentFilterModel[e].filter}'`);break;case"notBlank":a.push(`${e} != ''`);break;case"notEqual":a.push(`${e} != '${this.currentFilterModel[e].filter}'`);break;case"wordStartsWith":a.push(`Expr.containsWordsStartingWithIgnoreCase(${e}, '${this.currentFilterModel[e].filter}')`)}else a.push(`${e} == ${this.currentFilterModel[e].type}`)}),this.getFiltersByType("number").forEach(e=>{const r=this.currentFilterModel[e].filter,t=this.currentFilterModel[e].filterTo;switch(this.currentFilterModel[e].type){case"equals":!isNaN(r)&&a.push(`${e} == ${r}`);break;case"notEqual":!isNaN(r)&&a.push(`${e} != ${r}`);break;case"greaterThan":!isNaN(r)&&a.push(`${e} > ${r}`);break;case"greaterThanOrEqual":!isNaN(r)&&a.push(`${e} >= ${r}`);break;case"lessThan":!isNaN(r)&&a.push(`${e} < ${r}`);break;case"lessThanOrEqual":!isNaN(r)&&a.push(`${e} <= ${r}`);break;case"inRange":!isNaN(r)&&!isNaN(t)&&a.push(`${e} >= ${r} && ${e} <= ${t}`);break;case"blank":a.push(`${e} == 0`);break;case"notBlank":a.push(`${e} != 0`)}}),this.getFiltersByType("date").forEach(e=>{var r,t;const o=null===(r=this.currentFilterModel[e].dateFrom)||void 0===r?void 0:r.replace(/-/g,"").replace("T","-").split(" ")[0],i=null===(t=this.currentFilterModel[e].dateTo)||void 0===t?void 0:t.replace(/-/g,"").replace("T","-").split(" ")[0];switch(this.currentFilterModel[e].type){case"equals":a.push(`Expr.dateIsEqual(${e}, '${o}')`);break;case"lessThan":a.push(`Expr.dateIsBefore(${e}, '${o}')`);break;case"greaterThan":a.push(`Expr.dateIsAfter(${e}, '${o}')`);break;case"inRange":a.push(`Expr.dateIsAfter(${e}, '${o}') && Expr.dateIsBefore(${e}, '${i}')`);break;case"isToday":const r=new Date,t=`${r.getFullYear()}-${(r.getMonth()+1).toString().padStart(2,"0")}-${r.getDate().toString().padStart(2,"0")} 00:00:00`;a.push(`Expr.dateIsEqual(${e}, '${t}')`);break;case"blank":a.push(`${e} == null`);break;case"notBlank":a.push(`${e} != null`)}}),a}getFiltersByType(a){return Object.keys(this.currentFilterModel).filter(a=>-1!==this.resourceColDefs.findIndex(e=>e.NAME===a)).filter(e=>this.currentFilterModel[e].filterType===a)}getPageNumber(a,e,r,t=!0){void 0!==r&&a>r&&(a=Math.floor((r-1)/e)*e+1);const o=Math.ceil(a/e);return t?o:o+1}getCorrectRowCount(a){const e=a.request.endRow;this.calculatedRowsCount=this.clientRowsCount||e;const r=Math.min(this.serverRowsCount,this.maxView);let t;return this.pagination?(t=this.resourceParams.CRITERIA_MATCH?void 0:Math.min(this.serverRowsCount,this.maxView),this.resourceParams.CRITERIA_MATCH&&(t=r),t):(e===this.serverRowsCount?t=this.serverRowsCount:e>this.maxView||e>this.calculatedRowsCount?t=Math.min(r,this.calculatedRowsCount):!this.moreRows&&this.serverRowsCount>this.calculatedRowsCount&&(t=this.calculatedRowsCount),t)}get isNotFirstViewNumber(){return this.zeroBasedViewNumber?this.currentSequenceId>0:this.currentSequenceId>1}getEffectivePagingMode(){return this.pagingMode?"offsetBased"!==this.pagingMode||this.criteriaOnlyRequest?this.pagingMode:(w.v.warn("offsetBased paging mode requires criteriaOnlyRequest support. Falling back to viewBased mode."),"viewBased"):this.criteriaOnlyRequest?"offsetBased":"viewBased"}}(0,t.Cg)([y.N],k.prototype,"auth",void 0),(0,t.Cg)([z.dm],k.prototype,"connect",void 0),(0,t.Cg)([x.k],k.prototype,"uuid",void 0);class C extends k{constructor(a){super(a),this.createDataserverStreamFunc=a.createDataserverStreamFunc}refreshDatasource(a){const e=Object.create(null,{refreshDatasource:{get:()=>super.refreshDatasource}});return(0,t.sH)(this,void 0,void 0,function*(){var r;null===(r=this.dataserverStreamSubscription)||void 0===r||r.unsubscribe(),this.dataserverStreamSubscription=void 0,yield e.refreshDatasource.call(this,a)})}getRows(a){return(0,t.sH)(this,void 0,void 0,function*(){if(yield this.setupFiltering(a),yield this.setupSorting(a),this.pagination&&!this.isNewPageSize&&this.currentSequenceId>0)return void a.success(this.lastSuccessRowData);this.dataserverStream||(this.dataserverStream=yield this.createDataserverStreamFunc(this.resourceParams)),this.currentSequenceId>=1&&(this.moreRows||a.request.startRow>=Number(this.maxRows)||0===a.request.startRow)&&(this.pagination&&(this.resourceParams.VIEW_NUMBER=this.getPageNumber(a.request.startRow,this.maxRows,this.maxView,this.zeroBasedViewNumber)),this.connect.getMoreRows(this.sourceRef,this.resourceParams.VIEW_NUMBER));let e=!0;this.dataserverStreamSubscription=this.dataserverStream.subscribe(r=>{e&&p.DOM.queueUpdate(()=>(0,t.sH)(this,void 0,void 0,function*(){if(this.resourceParams.CRITERIA_MATCH&&this.pagination){const a=yield this.connect.snapshot(this.resourceName,{MAX_ROWS:this.maxView,MAX_VIEW:this.maxView,CRITERIA_MATCH:this.resourceParams.CRITERIA_MATCH});a.ROW||a.ROWS_COUNT?this.serverRowsCount=this.resourceParams.CRITERIA_MATCH?a.ROW.length:a.ROWS_COUNT:(w.v.warn("No data returned when criteria is applied."),this.serverRowsCount=0,this.clientRowsCount=0)}this.applyServerSideData(a,r),e=!1}))})})}applyServerSideData(a,e){var r;const t=e.MESSAGE_TYPE;if(t&&(t===g.Go.LOGOFF_ACK||t===g.Go.MSG_NACK)){if(this.errorHandlerFunc){const a=t===g.Go.LOGOFF_ACK?`Connection lost to ${this.resourceName}`:`Authentication failed for ${this.resourceName}`;this.errorHandlerFunc(a,"connection")}return void a.fail()}if(this.moreRows=e.MORE_ROWS,!e.ROW){this.rowData=new Map;const e={rowData:[],rowCount:0};return void a.success(e)}{const a=(0,l.d)(e);this.handleCurrentStreamLoad(a)}this.currentSequenceId=e.SEQUENCE_ID,1===this.currentSequenceId&&(this.sourceRef=e.SOURCE_REF,0===this.serverRowsCount&&(this.serverRowsCount=null!==(r=e.ROWS_COUNT)&&void 0!==r?r:this.rowData.size));const o={rowData:Array.from(this.rowData.values())};o.rowCount=this.getCorrectRowCount(a),this.lastSuccessRowData=o,a.success(o)}setupSorting(a){return(0,t.sH)(this,void 0,void 0,function*(){var e;const r=a.request.sortModel;if((null===(e=this.currentSortModel)||void 0===e?void 0:e.length)!==r.length||r.length>0){if(0===r.length&&this.currentSortModel)return this.calculatedRowsCount=0,this.currentSortModel=null,this.resourceParams.ORDER_BY=null,this.resourceParams.REVERSE=null,void(yield this.refreshDatasource(a));if(r.length>0){const e=r[0].colId,t=r[0].sort,o=this.getOrderByAndToBeSortedColIds(this.resourceIndexes,e);if(!o){this.calculatedRowsCount=0;const r=(0,b.i)(this.resourceIndexes),t=(0,b.P)(this.resourceIndexes);return w.v.warn(`The FIELD/column (${e}) being sorted is not part of an INDEX, required for the [orderBy] operation. See https://learn.genesis.global/docs/database/data-types/index-entities/`),w.v.debug("Available indexes:",r),w.v.debug("Columns that can be sorted with the available indexes:",t),void a.fail()}if(JSON.stringify(r)!==JSON.stringify(this.currentSortModel))return this.currentSortModel=r,this.resourceParams.ORDER_BY=o.orderBy,this.resourceParams.REVERSE="desc"===t,void(yield this.refreshDatasource(a))}}})}destroy(){const a=Object.create(null,{destroy:{get:()=>super.destroy}});return(0,t.sH)(this,void 0,void 0,function*(){var e;this.dataserverStream=void 0,null===(e=this.dataserverStreamSubscription)||void 0===e||e.unsubscribe(),this.dataserverStreamSubscription=void 0,yield a.destroy.call(this)})}handleCurrentStreamLoad(a){var e,r;if(!a)return;const t=new Map;null===(e=a.inserts)||void 0===e||e.forEach(a=>{t.set(a[this.rowId],a)}),this.clientRowsCount+=null!==(r=a.inserts.length)&&void 0!==r?r:0,this.rowData=t}}class A extends k{constructor(a){var e;super(a),this.discoveredTotalRowCount=null,this.currentNextOffset=0,this.createReqRepRequestFunc=a.createReqRepRequestFunc;"viewBased"===this.getEffectivePagingMode()?(null===(e=a.resourceParams)||void 0===e?void 0:e.VIEW_NUMBER)||(this.resourceParams.VIEW_NUMBER=this.zeroBasedViewNumber?0:1):a.resourceParams.OFFSET||(this.resourceParams.OFFSET=0)}getRows(a){return(0,t.sH)(this,void 0,void 0,function*(){var e;if(yield this.setupFiltering(a),yield this.setupSorting(a),this.pagination&&!this.isNewPageSize&&this.currentSequenceId>0)return void a.success(this.lastSuccessRowData);const r=this.getEffectivePagingMode();"viewBased"===r?null!==this.currentSequenceId&&this.currentSequenceId>=0&&this.moreRows&&(this.pagination?this.resourceParams.VIEW_NUMBER=this.getPageNumber(a.request.startRow,this.maxRows,void 0,this.zeroBasedViewNumber):this.resourceParams.VIEW_NUMBER+=1):this.currentNextOffset>0&&this.currentNextOffset!==a.request.startRow?this.resourceParams.OFFSET=this.currentNextOffset:this.resourceParams.OFFSET=a.request.startRow;const t={DETAILS:this.buildRequestDetails(r)},o=yield this.createReqRepRequestFunc(t),i="MORE_ROWS"in o;let n=!1;if("viewBased"===r){if(i)n=!o.MORE_ROWS;else if(-1!==o.NEXT_VIEW){const a=Object.assign(Object.assign({},t),{DETAILS:Object.assign(Object.assign({},t.DETAILS),{VIEW_NUMBER:o.NEXT_VIEW})}),r=yield this.createReqRepRequestFunc(a);n=-1===r.NEXT_VIEW&&0===(null===(e=r.REPLY)||void 0===e?void 0:e.length)}}else n=i&&!o.MORE_ROWS,"NEXT_OFFSET"in o&&-1!==o.NEXT_OFFSET?this.currentNextOffset=o.NEXT_OFFSET:this.currentNextOffset=0;let g=!0;g&&(this.applyServerSideData(a,o,n),g=!1)})}applyServerSideData(a,e,r){var t,o;const i=e.MESSAGE_TYPE;if(i&&(i===g.Go.LOGOFF_ACK||i===g.Go.MSG_NACK)){if(this.errorHandlerFunc){const a=i===g.Go.LOGOFF_ACK?`Connection lost to ${this.resourceName}`:`Authentication failed for ${this.resourceName}`;this.errorHandlerFunc(a,"connection")}return void a.fail()}const n=this.getEffectivePagingMode();if(this.moreRows="MORE_ROWS"in e?e.MORE_ROWS:"viewBased"===n?!r&&-1!==e.NEXT_VIEW&&e.NEXT_VIEW>this.resourceParams.VIEW_NUMBER:!r&&-1!==e.NEXT_OFFSET&&e.NEXT_OFFSET>this.resourceParams.OFFSET,!e.REPLY){this.rowData=new Map;const e={rowData:[],rowCount:0};return void a.success(e)}if(this.handleCurrentStreamLoad(e.REPLY),this.currentSequenceId="viewBased"===n?this.resourceParams.VIEW_NUMBER:Math.floor(this.resourceParams.OFFSET/this.maxRows),this.sourceRef=e.SOURCE_REF,!this.moreRows){const e=this.rowData.size;this.discoveredTotalRowCount=a.request.startRow+e}this.pagination?this.serverRowsCount=null!==(t=e.ROWS_COUNT)&&void 0!==t?t:this.rowData.size:this.serverRowsCount+=null!==(o=e.ROWS_COUNT)&&void 0!==o?o:this.rowData.size;const l={rowData:Array.from(this.rowData.values())};l.rowCount=this.getCorrectRowCount(a),this.lastSuccessRowData=l,a.success(l)}getCorrectRowCount(a){let e;return this.pagination,e=this.moreRows?-1:this.discoveredTotalRowCount||a.request.startRow+this.rowData.size,e}handleCurrentStreamLoad(a){if(!a||0==a.length)return;const e=new Map;a.forEach(a=>{const r=a[this.rowId];if(r)return void e.set(r,a);const t=`The specified rowId (${this.rowId}) is not present in the data. Since this is a snapshot (isSnapshot=true), an auto-generated UUID will be used. For custom identifiers, use the 'row-id' attribute.`;h.v.error(t);const o=this.uuid.createId();a[this.rowId]=o,e.set(o,a)}),this.rowData=e}setupSorting(a){return(0,t.sH)(this,void 0,void 0,function*(){var e;const r=a.request.sortModel;if((null===(e=this.currentSortModel)||void 0===e?void 0:e.length)!==r.length||r.length>0){if(0===r.length&&this.currentSortModel)return this.calculatedRowsCount=0,this.currentSortModel=null,this.resourceParams.ORDER_BY=void 0,void(yield this.refreshDatasource(a));if(r.length>0){const e=r[0].colId,t=r[0].sort;if(JSON.stringify(r)!==JSON.stringify(this.currentSortModel))return this.currentSortModel=r,this.resourceParams.ORDER_BY=e+("desc"===t?" DESC":" ASC"),void(yield this.refreshDatasource(a))}}})}refreshDatasource(a){const e=Object.create(null,{refreshDatasource:{get:()=>super.refreshDatasource}});return(0,t.sH)(this,void 0,void 0,function*(){this.discoveredTotalRowCount=null,this.currentNextOffset=0,this.resourceParams.VIEW_NUMBER=this.zeroBasedViewNumber?0:1,this.resourceParams.OFFSET=0,yield e.refreshDatasource.call(this,a)})}buildRequestDetails(a){const e={CRITERIA_MATCH:this.resourceParams.CRITERIA_MATCH,MAX_ROWS:this.resourceParams.MAX_ROWS,ORDER_BY:this.resourceParams.ORDER_BY};return"viewBased"===a?Object.assign(Object.assign({},e),{VIEW_NUMBER:this.resourceParams.VIEW_NUMBER}):Object.assign(Object.assign({},e),{OFFSET:this.resourceParams.OFFSET})}}let D=class extends((0,s.S)(v.ML)){constructor(){super(...arguments),this.applyFuncName="applyServerSideTransaction",this.applyAsyncFuncName="applyServerSideTransactionAsync",this.zeroBasedViewNumber=!1,this.liveUpdates=!1,this.request={},this.sortIndicatorCSSDestroy=null}resourceNameChanged(a,e){a&&a!==e&&p.DOM.queueUpdate(()=>(0,t.sH)(this,void 0,void 0,function*(){yield this.restart()}))}criteriaChanged(a,e){const r=a!==(0,i.Q)(e,";");this.ssrmDatasource&&r&&p.DOM.queueUpdate(()=>(0,t.sH)(this,void 0,void 0,function*(){yield this.restart()}))}connectedCallback(){super.connectedCallback();const a=this.shouldRunConnect;p.DOM.queueUpdate(()=>{a&&(this.init(),this.subscribeToConnection())})}disconnectedCallback(){super.disconnectedCallback();const a=this.shouldRunDisconnect;p.DOM.queueUpdate(()=>(0,t.sH)(this,void 0,void 0,function*(){a&&(yield this.destroy(),this.unsubscribeFromConnection())}))}deepClone(){const a=super.deepClone();return a.deferredGridOptions=structuredClone(this.deferredGridOptions),a.deferredColumnStates=structuredClone(this.deferredColumnStates),a}reloadResourceData(a){return(0,t.sH)(this,void 0,void 0,function*(){var e,r,t,o,i,n,g;if(this.datasource.destroy(),null===(e=this.liveUpdatesStream)||void 0===e||e.unsubscribe(),this.liveUpdatesStream=void 0,yield null===(r=this.agGrid)||void 0===r?void 0:r.cacheFilterConfig(),this.clearRowData(null),this.setDisconnected(!1),null===(t=this.agGrid.gridApi)||void 0===t||t.refreshServerSide({purge:!0}),a){const e=Object.assign(Object.assign({},this.datasourceOptions()),a);(yield this.initializeDatasource(e,!0,!1))||(null===(o=this.agGrid.gridApi)||void 0===o||o.setServerSideDatasource(null),h.v.error("Genesis Datasource re-init failed on filtering/sorting."))}else this.ssrmDatasource&&(yield this.ssrmDatasource.destroy(),this.ssrmDatasource=void 0),null===(i=this.agGrid.gridApi)||void 0===i||i.setServerSideDatasource(null),null===(g=null===(n=this.agGrid)||void 0===n?void 0:n.gridApi)||void 0===g||g.showLoadingOverlay(),yield this.init()})}applyServerSideSortIndicatorStyling(){var a,e;if(this.removeServerSideSortIndicatorStyling(),null===(a=this.agGrid)||void 0===a?void 0:a.gridApi){const a=(null===(e=this.agGrid.gridSlot)||void 0===e?void 0:e.parentElement)||this.agGrid;a&&a.classList.add("grid-pro-server-side")}this.sortIndicatorCSSDestroy=(0,c.O5)('\n .grid-pro-server-side .ag-header-cell-sortable .ag-sort-indicator-container {\n opacity: 1 !important;\n visibility: visible !important;\n }\n \n .grid-pro-server-side .ag-header-cell-sortable:not(.ag-header-cell-sorted) .ag-sort-indicator-container {\n opacity: 0.4 !important;\n }\n \n .grid-pro-server-side .ag-header-cell-sorted .ag-sort-indicator-container {\n opacity: 1 !important;\n }\n \n .grid-pro-server-side .ag-sort-ascending-icon::before,\n .grid-pro-server-side .ag-sort-descending-icon::before,\n .grid-pro-server-side .ag-header-cell-sortable:not(.ag-header-cell-sorted) .ag-sort-indicator-icon::before {\n font-family: var(--ag-icon-font-family, agGridAlpine) !important;\n font-size: var(--ag-icon-size, 16px) !important;\n color: var(--ag-header-foreground-color, var(--ag-foreground-color)) !important;\n }\n \n .grid-pro-server-side .ag-sort-ascending-icon::before {\n content: "\\e90d" !important; /* AG Grid sort up icon */\n }\n \n .grid-pro-server-side .ag-sort-descending-icon::before {\n content: "\\e90c" !important; /* AG Grid sort down icon */\n }\n \n .grid-pro-server-side .ag-header-cell-sortable:not(.ag-header-cell-sorted) .ag-sort-indicator-icon::before {\n content: "\\e90b" !important; /* AG Grid sort icon */\n opacity: 0.6 !important;\n }\n \n /* Ensure the sort indicator is always visible for sortable columns in server-side mode */\n .grid-pro-server-side .ag-header-cell-sortable .ag-sort-indicator-icon {\n display: inline-block !important;\n }\n',"grid-pro-server-side-sort")}removeServerSideSortIndicatorStyling(){var a,e;const r=(null===(e=null===(a=this.agGrid)||void 0===a?void 0:a.gridSlot)||void 0===e?void 0:e.parentElement)||this.agGrid;r&&r.classList.remove("grid-pro-server-side"),this.sortIndicatorCSSDestroy&&(this.sortIndicatorCSSDestroy(),this.sortIndicatorCSSDestroy=null)}init(){return(0,t.sH)(this,void 0,void 0,function*(){if(this.agGrid){const a=Object.assign(Object.assign({getRowId:a=>a.data?String(a.data[this.rowId]):null,getRowStyle(a){var e,r;if(null===(r=null===(e=a.data)||void 0===e?void 0:e.ROW_REF)||void 0===r?void 0:r.includes("_deleted"))return{color:"grey"}},cacheBlockSize:this.maxRows,defaultColDef:{filter:!0,resizable:!0,sortable:!1,unSortIcon:!0},rowBuffer:0,rowModelType:"serverSide",suppressServerSideInfiniteScroll:!1,suppressMultiSort:!0,onFilterChanged:a=>{},onSortChanged:a=>{},onPaginationChanged:a=>this.onPaginationChanged(a)},this.agGrid.agGridOptions),this.deferredGridOptions);return this.agGrid.gridOptions=a,this.agGrid.initGrid(),void this.agGrid.addEventListener(o.sVA.EVENT_GRID_READY,()=>(0,t.sH)(this,void 0,void 0,function*(){if(!(yield this.initializeDatasource(this.datasourceOptions(),!0,!1)))return h.v.debug(`Genesis Datasource init failed for ${this.resourceName}`),this.clearRowData(),void this.setDisconnected(!0);this.$emit(u.V.dataInit),this.setDisconnected(!1),this.indexes=this.getResourceIndexes(this.datasource.availableIndexes);const a=(0,n.X)(this.datasource.originalFieldDef),e=yield this.getAgColumnDefs(a);this.agGrid.gridApi.setColumnDefs(e),this.isRequestServer?this.ssrmDatasource=new A({createReqRepRequestFunc:this.createReqRepRequest.bind(this),reloadResourceDataFunc:this.reloadResourceData.bind(this),errorHandlerFunc:this.handleErrors.bind(this),resourceName:this.resourceName,resourceParams:this.datasource.dataserverOnlyParams,resourceIndexes:this.indexes,resourceColDefs:this.datasource.originalFieldDef,maxRows:+this.maxRows,maxView:+this.maxView,rowId:this.rowId,pagination:this.pagination,zeroBasedViewNumber:this.zeroBasedViewNumber,pagingMode:this.pagingMode,criteriaOnlyRequest:this.datasource.criteriaOnlyRequest}):this.ssrmDatasource=new C({createDataserverStreamFunc:this.createDataserverStream.bind(this),reloadResourceDataFunc:this.reloadResourceData.bind(this),errorHandlerFunc:this.handleErrors.bind(this),resourceName:this.resourceName,resourceParams:this.datasource.requestOnlyParams,resourceIndexes:this.indexes,resourceColDefs:this.datasource.originalFieldDef,maxRows:+this.maxRows,maxView:+this.maxView,rowId:this.rowId,pagination:this.pagination,zeroBasedViewNumber:this.zeroBasedViewNumber}),this.agGrid.gridApi.setServerSideDatasource(this.ssrmDatasource),this.agGrid.restoreCachedFilterConfig(),this.applyServerSideSortIndicatorStyling()}),{once:!0})}this.handleErrors("Application not connected or invalid resource name, datasource will not work.","unknown")})}onPaginationChanged(a){var e;this.agGrid.gridApi&&this.ssrmDatasource&&(this.ssrmDatasource.isNewPageSize=null!==(e=a.newPage)&&void 0!==e&&e)}destroy(){return(0,t.sH)(this,void 0,void 0,function*(){var a,e,r;this.datasource.destroy(),null===(a=this.liveUpdatesStream)||void 0===a||a.unsubscribe(),this.liveUpdatesStream=void 0,this.clearRowData(),this.ssrmDatasource&&(yield this.ssrmDatasource.destroy(),this.ssrmDatasource=void 0),this.removeServerSideSortIndicatorStyling(),null===(e=this.agGrid.gridApi)||void 0===e||e.setServerSideDatasource(null),null===(r=this.agGrid.gridApi)||void 0===r||r.refreshServerSide({purge:!0})})}restart(){return(0,t.sH)(this,void 0,void 0,function*(){yield this.destroy(),yield this.init()})}clearRowData(a=!0){var e,r,t,o;this.rowData=new Map,a&&(null===(r=null===(e=this.agGrid)||void 0===e?void 0:e.gridApi)||void 0===r||r.setColumnDefs([])),this.agTransaction={remove:[]},null===(t=this.agGrid.gridApi)||void 0===t||t.forEachNode(a=>{this.agTransaction.remove.push(a.data)}),null===(o=this.agGrid.gridApi)||void 0===o||o.applyServerSideTransaction(this.agTransaction),this.agTransaction=void 0}getResourceIndexes(a){const e=new Map;return null==a||a.forEach(a=>{e.set(a.NAME,a.FIELDS.split(" "))}),e}get rowModel(){return this.agGrid.gridApi.getModel()}createReqRepRequest(){return(0,t.sH)(this,arguments,void 0,function*(a=null){return yield this.datasource.snapshot(a)})}createDataserverStream(){return(0,t.sH)(this,arguments,void 0,function*(a=null){if(this.liveUpdates){const e=a=>(0,t.sH)(this,void 0,void 0,function*(){var e,r,t,o,i,n,d,s;if(a.MESSAGE_TYPE===g.Go.QUERY_UPDATE&&a.ROW){if(!this.ssrmDatasource)return;const g=(0,l.d)(a);if(this.agTransaction={add:[],remove:[],update:[]},this.handleStreamInserts(g.inserts),this.handleStreamUpdates(g.updates),this.handleStreamDeletes(g.deletes),a.SEQUENCE_ID>1){const a=(null!==(r=null===(e=g.inserts)||void 0===e?void 0:e.length)&&void 0!==r?r:0)-(null!==(o=null===(t=g.deletes)||void 0===t?void 0:t.length)&&void 0!==o?o:0);this.ssrmDatasource.serverRowsCount+=a;const l=null!==(n=null===(i=g.deletes)||void 0===i?void 0:i.filter(a=>{const e=a[this.rowId];return null!=this.agGrid.gridApi.getRowNode(e)}))&&void 0!==n?n:[],c=(null!==(s=null===(d=g.inserts)||void 0===d?void 0:d.length)&&void 0!==s?s:0)-l.length;this.ssrmDatasource.clientRowsCount+=c,this.applyAllAgTransactions()}}}),r=a=>{var e;h.v.error(a),this.handleErrors((null===(e=a.receivedMessage)||void 0===e?void 0:e.ERROR)||a.message,"stream")};this.liveUpdatesStream=this.connect.stream(this.resourceName,()=>{},r,null!=a?a:this.datasource.dataserverOnlyParams).subscribe(a=>e(a))}return yield this.datasource.startStream(),this.datasource.stream})}getAgColumnDefs(a){return(0,t.sH)(this,void 0,void 0,function*(){const e=this.generateColumnDefsFromMetadata(a,f);this.datasource.resourceType===d.v.DATASERVER?e.forEach(a=>{a.sortable=[].concat(...this.indexes.values()).includes(a.field)}):e.forEach(a=>{a.sortable=!0});return yield this.agGrid.mergeAllColumnDefsAndStates(e,!0)})}applyTransaction(a){return this.agGrid.gridApi.applyServerSideTransaction(a)}applyTransactionAsync(a,e){this.agGrid.gridApi.applyServerSideTransactionAsync(a,e)}loadMore(){throw new Error("loadMore() method is not supported for server-side datasource")}};(0,t.Cg)([(0,p.attr)({mode:"boolean",attribute:"zero-based-view-number"})],D.prototype,"zeroBasedViewNumber",void 0),(0,t.Cg)([(0,p.attr)({mode:"boolean",attribute:"live-updates"})],D.prototype,"liveUpdates",void 0),(0,t.Cg)([(0,p.attr)({attribute:"paging-mode"})],D.prototype,"pagingMode",void 0),(0,t.Cg)([p.observable],D.prototype,"request",void 0),D=(0,t.Cg)([(0,p.customElement)({name:"grid-pro-server-side-datasource"})],D)},26062:(a,e,r)=>{r.d(e,{D:()=>k});var t=r(55823),o=r(44210),i=r(96730),n=r(39087),g=r(21281),l=r(34193),d=r(21409),s=r(33681),c=r(97156),p=r(56607),u=r(10629),h=r(41392),v=r(92453),m=r(2773),f=r(35610),w=r(41119);function b(a){switch(a){case w.w.DATE:case w.w.DATETIME:return{comparator:function(a,e){if(!e)return-1;const r=new Date(e).setHours(0,0,0,0),t=a.getTime();return r===t?0:r<t?-1:r>t?1:void 0},buttons:["reset","apply"],closeOnApply:!0,closeOnClear:!0,maxNumConditions:1,browserDatePicker:!0}}}var y=r(55365),z=r(1510),x=r(90509);let k=class extends((0,d.S)(f.ML)){constructor(){super(...arguments),this.applyFuncName="applyTransaction",this.applyAsyncFuncName="applyTransactionAsync",this.cachedRowArray=[],this.keepColDefsOnClearRowData=!1,this.requiresFullRowDataAndColDefs=!0,this._lastMoreRows=!1,this._isMoreRowsResult=!1,this._nextOffset=0,this._loadMoreCount=0}criteriaChanged(a,e){return(0,t.sH)(this,void 0,void 0,function*(){const r=a!==(0,i.Q)(e,f.NC);this.datasource.initialized&&r&&(yield this.reloadResourceData())})}requestChanged(a,e){const r=a!==e;this.datasource.initialized&&r&&this.reloadResourceData()}resourceNameChanged(a,e){a&&a!==e&&this.restart()}connectedCallback(){super.connectedCallback();const a=this.shouldRunConnect;s.DOM.queueUpdate(()=>{a&&(this.init(),this.subscribeToConnection())})}disconnectedCallback(){super.disconnectedCallback();const a=this.shouldRunDisconnect;s.DOM.queueUpdate(()=>{a&&(this.destroy(),this.unsubscribeFromConnection())})}deepClone(){const a=super.deepClone();return a.deferredGridOptions={},this.deferredGridOptions&&Object.keys(this.deferredGridOptions).forEach(e=>{"function"==typeof this.deferredGridOptions[e]?a.deferredGridOptions[e]=this.deferredGridOptions[e].bind(a):"columnDefs"===e&&this.deferredGridOptions[e].length?a.deferredGridOptions[e]=this.colDefsDeepClone(e,a):a.deferredGridOptions[e]=structuredClone(this.deferredGridOptions[e])}),a.deferredColumnStates=structuredClone(this.deferredColumnStates),a.request=structuredClone(this.request),a}colDefsDeepClone(a,e){return this.deferredGridOptions[a].map(a=>{const r={};return Object.keys(a).forEach(t=>{"function"==typeof a[t]?r[t]=a[t].bind(e):r[t]=structuredClone(a[t])}),r})}init(a,e){return(0,t.sH)(this,void 0,void 0,function*(){if(this.agGrid){const r=Object.assign(Object.assign(Object.assign({getRowId:a=>a.data[this.rowId]},this.agGrid.agGridOptions),a&&{columnDefs:a}),this.deferredGridOptions);this.agGrid.gridOptions=Object.assign({},r),this.agGrid.initGrid(),this.agGrid.addEventListener(o.sVA.EVENT_GRID_READY,()=>(0,t.sH)(this,void 0,void 0,function*(){e&&this.agGrid.columnApi.applyColumnState({state:e}),yield this.loadResourceData()}),{once:!0});const i=600;return void(this.updateSub=this.update.pipe((0,u.i)(1),(0,h.B)(i),(0,v.M)(a=>z.v.debug("filters (debounced): ",a))).subscribe(a=>{this.reloadResourceData()}))}this.handleErrors("Application not connected or invalid resource name, datasource will not work.","unknown")})}destroy(){var a;z.v.debug("GridProGenesisDatasource.destroy()",this.resourceName),this.dataSub&&(this.dataSub.unsubscribe(),this.dataSub=void 0),this.updateSub&&(this.updateSub.unsubscribe(),this.updateSub=void 0),this.connectionSub&&(this.connectionSub.unsubscribe(),this.connectionSub=void 0),this._sourceRef=void 0,this.clearRowData(),this._lastMoreRows=!1,this._isMoreRowsResult=!1,this._nextOffset=0,this._loadMoreCount=0,this.agGrid.clearLocalGridOptions(),this.requiresFullRowDataAndColDefs=!0,this.dataSubWasLoggedOff=!1,this.criteriaFromFilters=new Map,null===(a=this.update)||void 0===a||a.unsubscribe(),this.update=new c.t(new Map),this.setDisconnected(!1),this.datasource.destroy()}deinit(){z.v.debug("GridProGenesisDatasource.deinit()",this.resourceName),this.destroy()}reset(){z.v.debug("GridProGenesisDatasource.reset()",this.resourceName),this.destroy()}restart(){return(0,t.sH)(this,void 0,void 0,function*(){let a,e;this.keepColDefsOnClearRowData&&(a=this.agGrid.gridApi.getColumnDefs(),e=this.agGrid.columnApi.getColumnState()),this.destroy(),yield this.init(a,e)})}refreshRows(){this.updateCachedRowArray(),this.setRowData(this.cachedRowArray)}clearRowData(a=!0){var e,r,t,o,i,n,g,l;(this.agGrid.asyncAdd||this.agGrid.asyncUpdate||this.agGrid.asyncRemove)&&(null===(r=null===(e=this.agGrid)||void 0===e?void 0:e.gridApi)||void 0===r||r.flushAsyncTransactions()),this.rowData=new Map,this.cachedRowArray=[],this.agTransaction=void 0,a&&!this.keepColDefsOnClearRowData&&(null===(o=null===(t=this.agGrid)||void 0===t?void 0:t.gridApi)||void 0===o||o.setColumnDefs([])),null===(n=null===(i=this.agGrid)||void 0===i?void 0:i.gridApi)||void 0===n||n.setRowData([]),null===(l=null===(g=this.agGrid)||void 0===g?void 0:g.gridApi)||void 0===l||l.refreshCells({force:!0})}setRowData(a){return(0,t.sH)(this,void 0,void 0,function*(){var e;const r=null===(e=this.agGrid.gridApi)||void 0===e?void 0:e.getColumnDefs();if(!r||0===r.length){const a=yield this.getAgColumnDefs(this.datasource.fieldMetadata);a&&(a.forEach(a=>{a.rowGroup||(a.rowGroup=null),a.pivot||(a.pivot=null)}),this.agGrid.gridApi.setColumnDefs(a))}const t=this.rowDataMapper?this.rowDataMapper(a):a;this.agGrid.restoreCachedFilterConfig(),this.agTransaction={add:t?[...t]:[],remove:[],update:[],addIndex:0},this.applyAllAgTransactions(),this.updateCachedRowArray(),this.requiresFullRowDataAndColDefs=!1})}updateCachedRowArray(){this.cachedRowArray=Array.from(this.rowData.values())}reloadResourceData(){return(0,t.sH)(this,void 0,void 0,function*(){var a,e,r;z.v.debug("GridProGenesisDatasource.reloadResourceData()",this.resourceName),this.dataSub&&(this.dataSub.unsubscribe(),this.dataSub=void 0),this._nextOffset=0,this._loadMoreCount=0,this.datasource.updateLoadMoreCount(0),this.datasource.stream=void 0,yield null===(a=this.agGrid)||void 0===a?void 0:a.cacheFilterConfig(),this.clearRowData(null),null===(r=null===(e=this.agGrid)||void 0===e?void 0:e.gridApi)||void 0===r||r.showLoadingOverlay(),this.setDisconnected(!1),yield this.loadResourceData(null)})}loadResourceData(){return(0,t.sH)(this,arguments,void 0,function*(a=!0){const e=a||!this.datasource.initialized;try{if(!(yield this.initializeDatasource(this.datasourceOptions(),e,!1)))return z.v.debug(`Genesis Datasource init failed for ${this.resourceName}`),void this.clearRowData();if(this.$emit(x.V.dataInit),this.isSnapshot){const a=yield this.datasource.snapshot();if(a){const e=this.handleSnapshot(a);this.setRowData(e)}return}z.v.debug(`starting stream for ${this.resourceName}`),yield this.datasource.startStream(),this.dataSub=this.datasource.stream.pipe((0,m.W)(a=>{var e;return this.handleErrors((null===(e=null==a?void 0:a.receivedMessage)||void 0===e?void 0:e.ERROR)||(null==a?void 0:a.message)||a,"stream"),p.w})).subscribe(a=>{this._sourceRef=a.SOURCE_REF;const e="MORE_ROWS"in a,r="ROWS_COUNT"in a,t=this.datasource.resourceType===n.v.REQUEST_SERVER&&"NEXT_OFFSET"in a;this._isMoreRowsResult=e&&!r,t&&(this._nextOffset=a.NEXT_OFFSET),(null==a?void 0:a.ERROR)&&this.handleErrors(a.ERROR,"criteria");const o=a.MESSAGE_TYPE;if(o&&o===g.Go.LOGOFF_ACK)return this.handleErrors(`Genesis datasource for ${this.resourceName} disconnected.`,"connection"),void(this.dataSubWasLoggedOff=!0);if(this.dataSubWasLoggedOff=!1,e&&this.updateLoadMoreStatus(a.MORE_ROWS,a.SOURCE_REF),a.ROW){const r=(0,l.d)(a);if(this.handleStreamResult(r),e&&a.MORE_ROWS!==this._lastMoreRows){const e={moreRows:a.MORE_ROWS,sourceRef:a.SOURCE_REF};this.$emit(x.V.moreRowsChanged,e),this._lastMoreRows=a.MORE_ROWS}}else this.handleStreamResult(a)})}catch(a){let{message:e}=a;a.receivedMessage&&(e=a.receivedMessage.ERROR),z.v.error(e),this.handleErrors(e,"unknown")}})}handleSnapshot(a){return Array.isArray(a)?a:a.REPLY?a.REPLY:a.ROW?(0,l.d)(a).inserts:a.inserts}handleStreamResult(a){a&&(this.isRequestServer?this.applyRequestServerData(a):this.applyDataserverData(a))}updateLoadMoreStatus(a,e){var r,t,o;if(!(null===(r=this.agGrid)||void 0===r?void 0:r.gridApi))return;const i=this.agGrid.gridApi.getStatusPanel(y.k7.loadMore);i&&(null===(o=(t=i).updateParams)||void 0===o||o.call(t,{moreRows:a,sourceRef:e}))}applyRequestServerData(a){var e;const r=this.rowData.size,t=a.REPLY;if(!Array.isArray(t)||!(null===(e=a.MESSAGE_TYPE)||void 0===e?void 0:e.startsWith("REP_")))return void z.v.error("received invalid RequestServerResult",a);if(this.requiresFullRowDataAndColDefs){let a=!1;for(const e of t||[]){const r=e[this.rowId];if(!r){if(!a){const e=`The specified rowId (${this.rowId}) is not present in the data. Since this is not a snapshot (isSnapshot=false), the data will not be loaded. Please provide a valid 'row-id' attribute.`;z.v.error(e),a=!0}break}this.rowData.set(r,e)}if(a)return void this.destroy();this.updateCachedRowArray();const e=this.rowData.size>0?this.cachedRowArray:t;return this.handleSizeChanged(r,this.rowData.size),void this.setRowData(e)}const o=[];this.updateCachedRowArray();const i=this.cachedRowArray.filter(a=>{const e=t.find(e=>e[this.rowId]===a[this.rowId]);return!e||(o.push(e),!1)}),n=t.filter(a=>!this.rowData.has(a[this.rowId]));this.agTransaction={add:[],remove:[],update:[]},this.handleStreamInserts(n),this.handleStreamDeletes(i),this.handleStreamUpdates(o),this.applyAllAgTransactions(),this.handleSizeChanged(r,this.rowData.size)}applyDataserverData(a){var e;const r=this.rowData.size;if(this.requiresFullRowDataAndColDefs)return null===(e=a.inserts)||void 0===e||e.forEach(a=>{this.rowData.set(a[this.rowId],a)}),this.updateCachedRowArray(),this.setRowData(this.cachedRowArray),void this.handleSizeChanged(r,this.rowData.size);this.agTransaction={add:[],remove:[],update:[]},this.handleStreamInserts(a.inserts),this.handleStreamDeletes(a.deletes),this.handleStreamUpdates(a.updates),this.applyAllAgTransactions(),this.handleSizeChanged(r,this.rowData.size)}getAgColumnDefs(a){return(0,t.sH)(this,void 0,void 0,function*(){const e=this.generateColumnDefsFromMetadata(a,b);return yield this.agGrid.mergeAllColumnDefsAndStates(e,!0)})}setFilter(a,e){this.criteriaFromFilters.set(a,e),this.update.next(this.criteriaFromFilters)}removeFilter(a){this.criteriaFromFilters.delete(a),this.update.next(this.criteriaFromFilters)}applyTransaction(a){return this.agGrid.gridApi.applyTransaction(a)}applyTransactionAsync(a,e){this.agGrid.gridApi.applyTransactionAsync(a,e)}handleSizeChanged(a,e){a!==e&&this.$emit(x.V.sizeChanged,{value:e,oldValue:a})}handleStreamInserts(a=[]){super.handleStreamInserts(a,this._isMoreRowsResult?this.cachedRowArray.length:0),this.updateCachedRowArray()}handleStreamUpdates(a=[]){super.handleStreamUpdates(a),this.updateCachedRowArray()}handleStreamDeletes(a=[]){super.handleStreamDeletes(a),this.updateCachedRowArray()}loadMore(){switch(this.datasource.resourceType){case n.v.DATASERVER:let a;this.viewNumber?(this._loadMoreCount=+this.viewNumber+1,a=this._loadMoreCount):this._loadMoreCount+=1,this.connect.getMoreRows(this._sourceRef,a);break;case n.v.REQUEST_SERVER:this._loadMoreCount+=1}this.datasource.updateLoadMoreCount(this._loadMoreCount)}};(0,t.Cg)([(0,s.attr)({mode:"boolean",attribute:"keep-col-defs-on-clear-row-data"})],k.prototype,"keepColDefsOnClearRowData",void 0),k=(0,t.Cg)([(0,s.customElement)({name:"grid-pro-genesis-datasource"})],k)},28745:(a,e,r)=>{r.d(e,{v:()=>o});var t=r(9709);const o=(0,t.createLogger)("foundation-utils")},30335:(a,e,r)=>{r.d(e,{B:()=>i,P:()=>n});var t=r(33681),o=r(68858);const i=t.css`
|
|
28
28
|
.overlay {
|
|
29
29
|
position: absolute;
|
|
30
30
|
inset: 0;
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
@input=${(a,e)=>a.changeHandler(e.event)}
|
|
200
200
|
style="width: ${a=>a.actualWidth}px"
|
|
201
201
|
></${a}-text-field>
|
|
202
|
-
`,h=c.compose({baseName:"date-editor",styles:p,template:u()})},49874:(a,e,r)=>{function t(a){const e=[];for(const[r]of a)r&&e.push(r);return e}function o(a){const e=[];function r(a){for(const r of a)null!==r&&e.push(r)}for(const[e,t]of a)null!==e&&null!==t&&r(t);return e}r.d(e,{P:()=>o,i:()=>t})},50103:(a,e,r)=>{r.d(e,{w:()=>t});const t=a=>a.replace(/([a-z])([A-Z])|\s+/g,"$1-$2").toLowerCase()},51266:(a,e,r)=>{r.d(e,{LU:()=>Z,RB:()=>_,Z$:()=>$,cF:()=>X,zI:()=>K});var t=r(55823),o=r(29310),i=r(44210),n=r(84646),g=r(6884),l=r(21409),d=r(17190),s=r(52945),c=r(33681),p=r(84674),u=r(31679),h=r(98682),v=r(62051),m=r.n(v),f=r(56943),w=r(49255),b=r(56182),y=r(48072),z=r(48075),x=r(43352),k=r(67489),C=r(39604),A=r(60905),D=r(46255),M=r(19511),T=r(80879),S=r(64315),N=r(63296),R=r(24638),E=r(18070),O=r(46374),I=r(90509),L=r(26062),j=r(32610),P=r(98884),F=r(82128),B=r(55365),G=r(53397),U=r(49104),Y=r(19060),Q=r(52540),V=r(88863),W=r(73203),q=r(23201),H=r(1510),J=r(50103);L.D,N.L,R.X,f.O,S.G,i.syG.registerModules([n.n7,o.Q]);const K=i.kNx.ALL_PROPERTIES.filter(a=>"rowData"!==a);class X extends((0,l.S)(p.FoundationElement)){rowDataChanged(a,e){this.initialised&&this.gridApi.setRowData(e)}themeChanged(a,e){if(!e)return this.classNames="",void this.destroyFontFace();this.classNames=(0,u.x)((0,B.eL)(e),e),this.insertFontFace(e)}getfilterModel(){return(0,t.sH)(this,void 0,void 0,function*(){if(!this.persistFilterModelKey)return this._filterConfig;return yield this.statePersistence.getFilterModel(this.persistFilterModelKey)})}setFilterModel(a){return(0,t.sH)(this,void 0,void 0,function*(){this.persistFilterModelKey?yield this.statePersistence.saveFilterModel(this.persistFilterModelKey,a):this._filterConfig=a})}constructor(){super(),this.cachedTotalColumnWidth=null,this.columnCount=0,this.gridErrorItems=[],this.autoCellRendererByType=!1,this.onlyTemplateColDefs=!1,this.gridAutosizingEnabled=!1,this.sizeColumnsToContent=!1,this.sizeColumnsToFit=!1,this.addIndex=0,this.asyncAdd=!1,this.asyncRemove=!1,this.asyncUpdate=!0,this.enableCellFlashing=!1,this.enabledRowFlashing=!1,this.enableRowFlashing=!1,this.defaultColumnConfig=[],this.gridFontFace=O.qh,this.columnComponentName="grid-pro-column",this.theme=B.mJ.alpine,this.pagination=!1,this.statusBarConfig=B.o2,this.withStatusBar=!1,this.rehydrationAttempted=!1,this.rootEventsListeners=[],this.gridEventsQueue=[],this.registeredGridEvents=new Set,this._filterConfig=void 0,this.agAttributes={},this.agPropertiesMap=K.reduce((a,e)=>(a[e.toLowerCase()]=e,a[(0,J.w)(e)]=e,a),{});const a=this.hideDatasourceError.bind(this);this.rootEventsListeners.push({key:I.V.dataInit,action:a},{key:j.yY.datasourceErrorClose,action:a},{key:E.L.error,action:this.handleBaseDatasourceError.bind(this)},{key:E.L.connected,action:a})}addEventListener(a,e,r){super.addEventListener(a,e,r),i.kNx.PUBLIC_EVENTS.includes(a)&&(this.gridApi?this.addGridEventListener(a):this.gridEventsQueue.includes(a)||this.gridEventsQueue.push(a))}addGridEventListener(a){this.registeredGridEvents.has(a)||(this.registeredGridEvents.add(a),this.gridApi.addEventListener(a,e=>{this.$emit(a,e)}))}handleError(a,e){this.gridErrorItems=[...this.gridErrorItems,{detail:e.detail,type:a}]}handleBaseDatasourceError(a){const e={detail:{message:a.detail.message},type:j.Ie.datasource};this.gridErrorItems=[...this.gridErrorItems,{detail:e.detail,type:e.type}]}hideDatasourceError(){this.gridErrorItems=this.gridErrorItems.filter(a=>a.type!==j.Ie.datasource)}connectedCallback(){super.connectedCallback(),this.gridAutosizingEnabled&&(0,d.j)(this,a=>{a&&this.debouncedColumnAutosize.bind(this)()}),this.rehydrationAttempted=!1,this.shouldRunConnect&&(K.forEach(a=>{Object.defineProperty(this,a,{set:e=>{this.agAttributeChangedCallback((0,J.w)(a),void 0,e)},enumerable:!0,configurable:!0})}),this.rootEventsListeners.forEach(({key:a,action:e})=>{this.addEventListener(a,e)}),this.paginationPageSize=this.isServerSide?this.gridProDatasource.maxRows:g.OD.DEFAULT_PAGINATION_PAGE_SIZE)}disconnectedCallback(){super.disconnectedCallback(),this.rehydrationAttempted=!1;const a=this.shouldRunDisconnect;this.rootEventsListeners.forEach(({key:a,action:e})=>{this.removeEventListener(a,e)}),c.DOM.queueUpdate(()=>{var e;a&&(this.initialised=!1,null===(e=this.gridApi)||void 0===e||e.destroy(),this.invalidateColumnWidthCache(),this.registeredGridEvents.clear())})}combineAllGridComponents(a){const e={[B.IX.action]:k.eA,[B.IX.actionsMenu]:C.cN,[B.IX.boolean]:A._Y,[B.IX.editable]:D.YM,[B.IX.statusPill]:M.N7,[B.IX.select]:T.gs,[B.IX.selectEditor]:z._Q,[B.IX.numberEditor]:y.Z0,[B.IX.multiselectEditor]:b.pZ,[B.IX.dateEditor]:w.S8,[B.IX.stringEditor]:x.XJ,[B.k7.labelValue]:Q.k,[B.k7.loadMore]:U.s,[B.k7.pagination]:Y.h,[B.k7.reload]:V.W};return Object.assign(Object.assign(Object.assign({},e),a),this.gridComponents)}statePersistanceEnabled(){return!(!this.persistColumnStateKey||0===this.persistColumnStateKey.length)}getSelectedRows(){var a,e,r,t;try{if(!this.initialised||!this.gridApi)return[];const o=null===(a=this.gridOptions)||void 0===a?void 0:a.rowSelection;if("single"===o||"multiple"===o)return this.gridApi.getSelectedRows&&this.gridApi.getSelectedRows().length>0?this.gridApi.getSelectedRows():[];if((null===(e=this.gridApi)||void 0===e?void 0:e.getCellRanges)&&this.gridApi.getCellRanges().length>0)return this.getCellRangeRowData();if(!(null===(r=this.gridOptions)||void 0===r?void 0:r.enableRangeSelection)){const a=null===(t=this.gridApi)||void 0===t?void 0:t.getFocusedCell();if(a){const e=this.gridApi.getDisplayedRowAtIndex(a.rowIndex);if(null==e?void 0:e.data)return[e.data]}}return[]}catch(a){return H.v.error("Grid Pro: Error getting selected rows:",a),[]}}getCellRangeRowData(){var a;if(!(null===(a=this.gridApi)||void 0===a?void 0:a.getCellRanges))return[];const e=this.gridApi.getCellRanges();if(0===e.length)return[];const r=[];return e.forEach(a=>{const e=a.startRow.rowIndex,t=a.endRow.rowIndex;for(let a=e;a<=t;a+=1){const e=this.gridApi.getDisplayedRowAtIndex(a);(null==e?void 0:e.data)&&!r.some(a=>a===e.data)&&r.push(e.data)}}),r}hasSelectedRows(){return this.getSelectedRows().length>0}debouncedColumnAutosize(){this.gridAutosizingEnabled&&(this.debounced&&(clearTimeout(this.debounced),this.debounced=null),this.debounced=setTimeout(()=>{var a;null===(a=this.gridApi)||void 0===a||a.sizeColumnsToFit()},j.BW))}removeConfigWidthsToAutosize(a){return a.map(a=>Object.assign(Object.assign({},a),{width:null}))}saveColumnState(){return(0,t.sH)(this,void 0,void 0,function*(){if(this.rehydrationAttempted&&this.statePersistanceEnabled()){let a=this.columnApi.getColumnState();a=this.gridAutosizingEnabled?this.removeConfigWidthsToAutosize(a):a;const e=0===a.filter(a=>{if(a.hide)return!1;const e=this.columnApi.getColumn(a.colId);return Boolean(e.getColDef().headerName)}).length;if(0===a.length||JSON.stringify(a)===JSON.stringify(this.columnState)||e)return;yield this.statePersistence.saveColumnState(this.persistColumnStateKey,a),this.columnState=a}})}getSavedColumnState(){return(0,t.sH)(this,void 0,void 0,function*(){return this.columnState=[],this.statePersistanceEnabled()&&(this.columnState=yield this.statePersistence.getColumnState(this.persistColumnStateKey)),this.columnState})}deleteColumnState(){return(0,t.sH)(this,arguments,void 0,function*(a=!0){var e;if(this.statePersistanceEnabled()&&(yield this.statePersistence.deleteColumnState(this.persistColumnStateKey),this.columnState=[]),a&&this.columnApi){if((null===(e=this.defaultColumnConfig)||void 0===e?void 0:e.length)>0){const a=(0,q.rG)(this.defaultColumnConfig);this.columnApi.applyColumnState({state:a,applyOrder:!0})}else this.columnApi.resetColumnState();this.handleColumnSizing()}})}restoreColumnState(){return(0,t.sH)(this,void 0,void 0,function*(){var a;this.rehydrationAttempted=!0;const e=yield this.getSavedColumnState();e&&e.length>0&&(null===(a=this.columnApi)||void 0===a||a.applyColumnState({state:e,applyOrder:!0}))})}cacheFilterConfig(){var a;this.setFilterModel((null===(a=this.gridApi)||void 0===a?void 0:a.getFilterModel())||void 0)}restoreCachedFilterConfig(){return(0,t.sH)(this,void 0,void 0,function*(){var a,e;const r=yield this.getfilterModel();void 0!==r&&(null===(a=this.gridApi)||void 0===a||a.setFilterModel(r),null===(e=this.gridApi)||void 0===e||e.onFilterChanged())})}get gridOptions(){return this.agGridOptions}get isServerSide(){return this.gridProDatasource instanceof R.X}get gridParams(){return{globalEventListener:this.globalEventListener.bind(this)}}get gridProDatasource(){return this.querySelector("grid-pro-genesis-datasource")||this.querySelector("grid-pro-client-side-datasource")||this.querySelector("grid-pro-server-side-datasource")}set gridOptions(a){const e=m()(this.saveColumnState.bind(this),400),r=m()(this.cacheFilterConfig.bind(this),400),o=()=>{e(),this.debouncedColumnAutosize.bind(this)(),this.invalidateColumnWidthCache()};Array.from(this.attributes).forEach(a=>{const e=this.agPropertiesMap[a.name];e&&(this.agAttributes[e]=a.value)});const{columnDefs:n,components:g,defaultColDef:l,getRowId:d,onGridReady:s,onFilterChanged:c,onFirstDataRendered:p}=a,u=(0,t.Tt)(a,["columnDefs","components","defaultColDef","getRowId","onGridReady","onFilterChanged","onFirstDataRendered"]),h=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.gridOptionsConfig),{defaultColDef:Object.assign({enableCellChangeFlash:this.enableCellFlashing,filter:!0,resizable:!0,sortable:!0},l),components:this.combineAllGridComponents(g),suppressDragLeaveHidesColumns:!0}),this.eventsAndCallbacks),{onGridReady:a=>{this.gridApi=a.api,this.columnApi=a.columnApi,this.gridEventsQueue.length&&this.gridEventsQueue.forEach(a=>{this.addGridEventListener(a)}),this.rowData&&this.gridApi.setRowData(this.rowData),s&&s(a),this.$emit(i.sVA.EVENT_GRID_READY,{event:a,gridId:this.id}),this.$emit(B.mr,{event:a,gridId:this.id}),this.restoreColumnState.bind(this)(),this.restoreCachedFilterConfig.bind(this)(),this.debouncedColumnAutosize.bind(this)()},onFirstDataRendered:a=>{this.handleColumnSizing(),p&&p(a)},onColumnPinned:o,onColumnResized:o,onColumnMoved:o,onDisplayedColumnsChanged:o,onFilterChanged:a=>{r(),c&&c(a)},onGridSizeChanged:o,onSortChanged:o}),u);this.gridProDatasource?(h.columnDefs=n,h.getRowId=d,this.setupPaginationAndStatusBar(h),this.setLocalGridOptions(h)):this.mergeAllColumnDefsAndStates(n).then(a=>{h.columnDefs=a,h.getRowId=d,this.setupPaginationAndStatusBar(h),this.setLocalGridOptions(h),this.initGrid()})}setLocalGridOptions(a){this.agGridOptions=Object.assign(Object.assign({},this.agGridOptions),i.kNx.copyAttributesToGridOptions(a,this.agAttributes))}clearLocalGridOptions(){this.agGridOptions=void 0}initGrid(){c.DOM.queueUpdate(()=>{this.initialised&&this.gridSlot.firstChild&&this.gridSlot.removeChild(this.gridSlot.firstChild),this.agGrid=new i.xA9(this.gridSlot,this.agGridOptions,this.gridParams),this.initialised=!0})}applyTemplateDefinitions(a,e=!1){return H.v.deprecated("applyTemplateDefinitions","Use `mergeAllColumnDefsAndStates` instead."),this.mergeAllColumnDefsAndStates(a,e)}mergeAllColumnDefsAndStates(a){return(0,t.sH)(this,arguments,void 0,function*(a,e=!1){var r;const t=a||[];t.forEach(a=>{if(this.headerCaseType&&a.field&&!a.headerName){const e=h[this.headerCaseType];e?a.headerName=e(a.field):H.v.warn(`Invalid header-case-type attribute value: ${this.headerCaseType}. Please use one of the following: camelCase, capitalCase, dotCase, headerCase, noCase, paramCase, pascalCase, pathCase, sentenceCase, snakeCase.`)}});const o=Array.from(this.querySelectorAll(this.columnComponentName)).map(a=>a.definition).map(a=>{this.enableCellFlashing&&void 0===a.enableCellChangeFlash&&(a.enableCellChangeFlash=!0),a.editable&&(a.cellRenderer||a.cellRendererSelector||(a.cellRendererSelector=e=>{if(null==e?void 0:e.data)return e.data[B.A7]===a.field?{component:B.IX.editable}:void 0}),a.tooltipComponent||a.tooltipValueGetter||(a.tooltipComponent=W.y,a.tooltipValueGetter=e=>{if(!(null==e?void 0:e.data))return;const r=e.data[B.h1];return r&&r.column===a.field?r.message:void 0}),a.cellClassRules||(a.cellClassRules={error:a=>{var e;return!(!(null==a?void 0:a.colDef)||!(null==a?void 0:a.data))&&(null===(e=a.data[B.h1])||void 0===e?void 0:e.column)===a.colDef.field}}));const e=t.find(e=>a.field===e.field);return Object.assign(Object.assign({},e),a)}),i=o.map(a=>a.field),n=[...o,...this.onlyTemplateColDefs?[]:t.filter(a=>!i.includes(a.field))];if(this.gridProDatasource&&e){const a=yield this.getSavedColumnState();if((null==a?void 0:a.length)>0)return(0,q.yS)(n,a);if((null===(r=this.gridProDatasource.deferredColumnStates)||void 0===r?void 0:r.length)>0)return(0,q.yS)(n,this.gridProDatasource.deferredColumnStates)}return n})}panelExists(a,e){return e.some(e=>e.statusPanel===a)}addRowCountPanel(a){if(!this.isServerSide&&this.statusBarConfig&&!0===this.statusBarConfig.rows){const e="agTotalAndFilteredRowCountComponent";this.panelExists(e,a)||a.push({statusPanel:e,align:"left"})}}addMaxRowsPanel(a){this.statusBarConfig&&!0===this.statusBarConfig.maxRows&&(this.panelExists(B.k7.labelValue,a)||a.push({statusPanel:B.k7.labelValue,statusPanelParams:{label:"Max Rows",value:this.gridProDatasource.maxRows||g.OD.MAX_ROWS_250,hide:!1},align:"left"}))}addAggregationPanel(a){this.statusBarConfig&&!0===this.statusBarConfig.aggregation&&(this.panelExists("agAggregationComponent",a)||a.push({statusPanel:"agAggregationComponent",align:"right"}))}addDatasourcePanels(a){if(this.gridProDatasource){const e=this.gridProDatasource.getDatasourceStatusBarPanels(this.isServerSide).filter(e=>!this.panelExists(e.statusPanel,a));a.push(...e)}}addPaginationPanel(a){this._pagination&&(this.panelExists(B.k7.pagination,a)||a.push({statusPanel:B.k7.pagination,align:"right"}))}setupPaginationAndStatusBar(a){var e,r;if(this._pagination&&(a.pagination=!0,a.suppressScrollOnNewData=!0,a.paginationPageSize=this.paginationPageSize),this.withStatusBar&&this.statusBarConfig){const t=[...(null===(e=a.statusBar)||void 0===e?void 0:e.statusPanels)||[]];this.addRowCountPanel(t),this.addMaxRowsPanel(t),this.addAggregationPanel(t),this.addDatasourcePanels(t),this._pagination&&(a.suppressPaginationPanel=!0,this.addPaginationPanel(t));const o=((null===(r=a.statusBar)||void 0===r?void 0:r.statusPanels)||[]).filter(a=>!this.panelExists(a.statusPanel,t));t.push(...o),a.statusBar={statusPanels:t}}}handleColumnSizing(){(this.sizeColumnsToContent||this.sizeColumnsToFit)&&(this.sizeColumnsToContent&&this.sizeColumnsToFit&&this.columnApi&&this.gridApi?this.handleBothSizingModes():this.handleIndividualSizingModes())}handleBothSizingModes(){if(this.calculateTotalColumnWidth()>this.getGridWidth()){if(!this.columnApi)return;this.columnApi.autoSizeAllColumns()}else{if(!this.gridApi)return;this.gridApi.sizeColumnsToFit()}}handleIndividualSizingModes(){this.sizeColumnsToContent&&this.columnApi&&this.columnApi.autoSizeAllColumns(),this.sizeColumnsToFit&&this.gridApi&&this.gridApi.sizeColumnsToFit()}calculateTotalColumnWidth(){if(!this.columnApi)return 0;const a=this.columnApi.getAllGridColumns(),e=a.length;return null!==this.cachedTotalColumnWidth&&this.columnCount===e||(this.cachedTotalColumnWidth=a.reduce((a,e)=>a+(e.getActualWidth()||0),0),this.columnCount=e),this.cachedTotalColumnWidth}invalidateColumnWidthCache(){this.cachedTotalColumnWidth=null,this.columnCount=0}getGridWidth(){const a=this;let e=(null==a?void 0:a.clientWidth)||0;return 0===e&&this.gridSlot&&(e=this.gridSlot.clientWidth||0),0===e&&(e=this.clientWidth||0),e}get observedAttributes(){const a=K.map(a=>a.toLowerCase()),e=K.map(a=>(0,J.w)(a));return a.concat(e)}agAttributeChangedCallback(a,e,r){if(e===r)return;const t=this.agPropertiesMap[a];if(t&&(this.agAttributes[t]=r,this.initialised)){const a={};a[t]={currentValue:r},i.kNx.processOnChange(a,this.gridApi)}}globalEventListener(a,e){const r=a.toLowerCase(),t=new Event(r);t.agGridDetails=e,this.dispatchEvent(t);const o="on"+r;"function"==typeof this[o]&&this[o](t)}insertFontFace(a){const e=O.KE[a]||this.gridFontFace;this.destroyFontFace();const r=(0,s.O5)(e,(0,B.b7)(a));r&&(this.fontFaceDestroy=r)}destroyFontFace(){this.fontFaceDestroy&&(this.fontFaceDestroy(),this.fontFaceDestroy=null)}}(0,t.Cg)([c.observable],X.prototype,"columnApi",void 0),(0,t.Cg)([c.observable],X.prototype,"gridApi",void 0),(0,t.Cg)([c.observable],X.prototype,"gridErrorItems",void 0),(0,t.Cg)([G.l],X.prototype,"statePersistence",void 0),(0,t.Cg)([(0,c.attr)({attribute:"auto-cell-renderer-by-type",mode:"boolean"})],X.prototype,"autoCellRendererByType",void 0),(0,t.Cg)([(0,c.attr)({attribute:"only-template-col-defs",mode:"boolean"})],X.prototype,"onlyTemplateColDefs",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"grid-autosizing"})],X.prototype,"gridAutosizingEnabled",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"size-columns-to-content"})],X.prototype,"sizeColumnsToContent",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"size-columns-to-fit"})],X.prototype,"sizeColumnsToFit",void 0),(0,t.Cg)([(0,c.attr)({attribute:"add-index"})],X.prototype,"addIndex",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"async-add"})],X.prototype,"asyncAdd",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"async-remove"})],X.prototype,"asyncRemove",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"async-update"})],X.prototype,"asyncUpdate",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"enable-cell-flashing"})],X.prototype,"enableCellFlashing",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"enabled-row-flashing"})],X.prototype,"enabledRowFlashing",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"enable-row-flashing"})],X.prototype,"enableRowFlashing",void 0),(0,t.Cg)([(0,c.attr)({attribute:"persist-column-state-key"})],X.prototype,"persistColumnStateKey",void 0),(0,t.Cg)([(0,c.attr)({attribute:"persist-filter-model-key"})],X.prototype,"persistFilterModelKey",void 0),(0,t.Cg)([(0,c.attr)({attribute:"default-column-config"})],X.prototype,"defaultColumnConfig",void 0),(0,t.Cg)([(0,c.attr)({attribute:"header-case-type"})],X.prototype,"headerCaseType",void 0),(0,t.Cg)([c.observable],X.prototype,"rowData",void 0),(0,t.Cg)([c.observable],X.prototype,"gridFontFace",void 0),(0,t.Cg)([c.attr],X.prototype,"columnComponentName",void 0),(0,t.Cg)([c.observable],X.prototype,"eventsAndCallbacks",void 0),(0,t.Cg)([c.attr],X.prototype,"headerHeight",void 0),(0,t.Cg)([c.attr],X.prototype,"rowHeight",void 0),(0,t.Cg)([c.attr],X.prototype,"theme",void 0),(0,t.Cg)([c.observable],X.prototype,"classNames",void 0),(0,t.Cg)([c.observable],X.prototype,"agGrid",void 0),(0,t.Cg)([c.observable],X.prototype,"gridSlot",void 0),(0,t.Cg)([c.observable],X.prototype,"gridComponents",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean"})],X.prototype,"pagination",void 0),(0,t.Cg)([(0,c.attr)({attribute:"pagination-page-size"})],X.prototype,"paginationPageSize",void 0),(0,t.Cg)([c.observable],X.prototype,"statusBarConfig",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"with-status-bar"})],X.prototype,"withStatusBar",void 0),(0,t.Cg)([c.observable],X.prototype,"customErrorHandlerTemplate",void 0),(0,t.Cg)([B.lz],X.prototype,"gridOptionsConfig",void 0);const Z=void 0,$={shadowOptions:void 0},_=X.compose(Object.assign({baseName:"grid-pro",styles:P.X,template:F.a,shadowOptions:Z},$))},52540:(a,e,r)=>{r.d(e,{k:()=>t});class t{init(a){this.element=document.createElement("div"),this.element.classList.add("ag-status-name-value","ag-status-panel"),this.element.setAttribute("data-test-id","grid-label-value-panel"),this.element.setAttribute("role","status"),this.currentParams=a,this.updateDisplay()}updateParams(a){this.currentParams=Object.assign(Object.assign({},this.currentParams),a),this.updateDisplay()}updateDisplay(){this.element&&(this.currentParams.hide?this.element.style.display="none":(this.element.style.display="",this.element.setAttribute("aria-label",`${this.currentParams.label}: ${this.currentParams.value}`),this.labelElement||(this.labelElement=document.createElement("span"),this.labelElement.setAttribute("data-test-id","grid-label-value-label"),this.labelElement.setAttribute("aria-hidden","true"),this.element.appendChild(this.labelElement)),this.labelElement.innerHTML=`${this.currentParams.label}: `,this.valueElement||(this.valueElement=document.createElement("span"),this.valueElement.classList.add("ag-status-name-value-value"),this.valueElement.setAttribute("data-test-id","grid-label-value-value"),this.valueElement.setAttribute("aria-hidden","true"),this.element.appendChild(this.valueElement)),this.valueElement.innerHTML=this.currentParams.value))}getGui(){return this.element}destroy(){}}},52945:(a,e,r)=>{r.d(e,{O5:()=>o,fI:()=>i});var t=r(28745);const o=(a,e)=>{var r;let o=document.getElementById(e);if(o)return void t.v.debug(`\n An element with the id of '${e}' already exists and likely has the css rules applied.\n `);const i=null!==(r=document.head)&&void 0!==r?r:document.getElementsByTagName("head")[0];o=document.createElement("style"),o.id=e,i.appendChild(o);if((a.match(/}/g)||[]).length>1)return o.textContent=a,()=>{o&&i.removeChild(o)};{const e=o.sheet.insertRule(a);return()=>{o&&(o.sheet.deleteRule(e),i.removeChild(o))}}};function i(a){const e=[],r=new Set;return function a(t){const o=Array.from(t.querySelectorAll("*"));e.push(...o),o.forEach(e=>{e.shadowRoot&&!r.has(e.shadowRoot)&&(r.add(e.shadowRoot),a(e.shadowRoot))})}(a),e}},53397:(a,e,r)=>{r.d(e,{l:()=>i});var t=r(84674),o=r(11749);const i=t.DI.createInterface(a=>a.singleton(o.H))},55365:(a,e,r)=>{r.d(e,{A7:()=>h,IX:()=>c,Kb:()=>s,W3:()=>t,YO:()=>m,b7:()=>d,eL:()=>l,h1:()=>v,k7:()=>p,lz:()=>f,mJ:()=>o,mr:()=>u,o2:()=>b,uA:()=>w});var t,o,i=r(90683),n=r(33681),g=r(84674);!function(a){a.foregroundColor="--ag-foreground-color",a.dataColor="--ag-data-color",a.secondaryForegroundColor="--ag-secondary-foreground-color",a.headerForegroundColor="--ag-header-foreground-color",a.disabledForegroundColor="--ag-disabled-foreground-color",a.backgroundColor="--ag-background-color",a.headerBackgroundColor="--ag-header-background-color",a.subheaderBackgroundColor="--ag-subheader-background-color",a.subheaderToolbarBackgroundColor="--ag-subheader-toolbar-background-color",a.controlPanelBackgroundColor="--ag-control-panel-background-color",a.selectedRowBackgroundColor="--ag-selected-row-background-color",a.oddRowBackgroundColor="--ag-odd-row-background-color",a.rowHoverColor="--ag-row-hover-color",a.rangeSelectionBorderColor="--ag-range-selection-border-color",a.rangeSelectionBackgroundColor="--ag-range-selection-background-color",a.selectedTabUnderlineColor="--ag-selected-tab-underline-color",a.rangeSelectionChartCategoryBackgroundColor="--ag-range-selection-chart-category-background-color",a.rangeSelectionChartBackgroundColor="--ag-range-selection-chart-background-color",a.headerCellHoverBackgroundColor="--ag-header-cell-hover-background-color",a.headerCellMovingBackgroundColor="--ag-header-cell-moving-background-color",a.chipBackgroundColor="--ag-chip-background-color",a.borderColor="--ag-border-color",a.secondaryBorderColor="--ag-secondary-border-color",a.rowBorderColor="--ag-row-border-color",a.headerColumnSeparatorColor="--ag-header-column-separator-color",a.headerColumnResizeHandleColor="--ag-header-column-resize-handle-color",a.inputBorderColor="--ag-input-border-color",a.inputDisabledBorderColor="--ag-input-disabled-border-color",a.inputDisabledBackgroundColor="--ag-input-disabled-background-color",a.checkboxBackgroundColor="--ag-checkbox-background-color",a.checkboxCheckedColor="--ag-checkbox-checked-color",a.checkboxUncheckedColor="--ag-checkbox-unchecked-color",a.checkboxIndeterminateColor="--ag-checkbox-indeterminate-color",a.toggleButtonOffBorderColor="--ag-toggle-button-off-border-color",a.toggleButtonOffBackgroundColor="--ag-toggle-button-off-background-color",a.toggleButtonOnBorderColor="--ag-toggle-button-on-border-color",a.toggleButtonOnBackgroundColor="--ag-toggle-button-on-background-color",a.toggleButtonSwitchBackgroundColor="--ag-toggle-button-switch-background-color",a.toggleButtonSwitchBorderColor="--ag-toggle-button-switch-border-color",a.minichartSelectedChartColor="--ag-minichart-selected-chart-color",a.minichartSelectedPageColor="--ag-minichart-selected-page-color",a.modalOverlayBackgroundColor="--ag-modal-overlay-background-color",a.inputFocusBoxShadow="--ag-input-focus-box-shadow",a.inputFocusBorderColor="--ag-input-focus-border-color"}(t||(t={})),function(a){a.alpine="ag-theme-alpine",a.alpineDark="ag-theme-alpine-dark",a.balham="ag-theme-balham",a.balhamDark="ag-theme-balham-dark",a.material="ag-theme-material"}(o||(o={}));const l=a=>`${a}-token-map`,d=a=>`${a}-fonts`,s=(a,e)=>n.css`
|
|
202
|
+
`,h=c.compose({baseName:"date-editor",styles:p,template:u()})},49874:(a,e,r)=>{function t(a){const e=[];for(const[r]of a)r&&e.push(r);return e}function o(a){const e=[];function r(a){for(const r of a)null!==r&&e.push(r)}for(const[e,t]of a)null!==e&&null!==t&&r(t);return e}r.d(e,{P:()=>o,i:()=>t})},50103:(a,e,r)=>{r.d(e,{w:()=>t});const t=a=>a.replace(/([a-z])([A-Z])|\s+/g,"$1-$2").toLowerCase()},51266:(a,e,r)=>{r.d(e,{LU:()=>Z,RB:()=>_,Z$:()=>$,cF:()=>X,zI:()=>K});var t=r(55823),o=r(29310),i=r(44210),n=r(84646),g=r(6884),l=r(21409),d=r(17190),s=r(52945),c=r(33681),p=r(84674),u=r(31679),h=r(98682),v=r(62051),m=r.n(v),f=r(56943),w=r(49255),b=r(56182),y=r(48072),z=r(48075),x=r(43352),k=r(67489),C=r(39604),A=r(60905),D=r(46255),M=r(19511),T=r(80879),S=r(64315),N=r(63296),R=r(24638),E=r(18070),O=r(46374),I=r(90509),L=r(26062),j=r(32610),P=r(98884),F=r(82128),B=r(55365),G=r(53397),U=r(49104),Y=r(19060),Q=r(52540),V=r(88863),W=r(73203),q=r(23201),H=r(1510),J=r(50103);L.D,N.L,R.X,f.O,S.G,i.syG.registerModules([n.n7,o.Q]);const K=i.kNx.ALL_PROPERTIES.filter(a=>"rowData"!==a);class X extends((0,l.S)(p.FoundationElement)){rowDataChanged(a,e){this.initialised&&this.gridApi.setRowData(e)}themeChanged(a,e){if(!e)return this.classNames="",void this.destroyFontFace();this.classNames=(0,u.x)((0,B.eL)(e),e),this.insertFontFace(e)}getfilterModel(){return(0,t.sH)(this,void 0,void 0,function*(){if(!this.persistFilterModelKey)return this._filterConfig;return yield this.statePersistence.getFilterModel(this.persistFilterModelKey)})}setFilterModel(a){return(0,t.sH)(this,void 0,void 0,function*(){this.persistFilterModelKey?yield this.statePersistence.saveFilterModel(this.persistFilterModelKey,a):this._filterConfig=a})}constructor(){super(),this.cachedTotalColumnWidth=null,this.columnCount=0,this.gridErrorItems=[],this.autoCellRendererByType=!1,this.onlyTemplateColDefs=!1,this.gridAutosizingEnabled=!1,this.sizeColumnsToContent=!1,this.sizeColumnsToFit=!1,this.addIndex=0,this.asyncAdd=!1,this.asyncRemove=!1,this.asyncUpdate=!0,this.enableCellFlashing=!1,this.enabledRowFlashing=!1,this.enableRowFlashing=!1,this.defaultColumnConfig=[],this.gridFontFace=O.qh,this.columnComponentName="grid-pro-column",this.theme=B.mJ.alpine,this.pagination=!1,this.statusBarConfig=B.o2,this.withStatusBar=!1,this.rehydrationAttempted=!1,this.rootEventsListeners=[],this.gridEventsQueue=[],this.registeredGridEvents=new Set,this._filterConfig=void 0,this.agAttributes={},this.agPropertiesMap=K.reduce((a,e)=>(a[e.toLowerCase()]=e,a[(0,J.w)(e)]=e,a),{});const a=this.hideDatasourceError.bind(this);this.rootEventsListeners.push({key:I.V.dataInit,action:a},{key:j.yY.datasourceErrorClose,action:a},{key:E.L.error,action:this.handleBaseDatasourceError.bind(this)},{key:E.L.connected,action:a})}addEventListener(a,e,r){super.addEventListener(a,e,r),i.kNx.PUBLIC_EVENTS.includes(a)&&(this.gridApi?this.addGridEventListener(a):this.gridEventsQueue.includes(a)||this.gridEventsQueue.push(a))}addGridEventListener(a){this.registeredGridEvents.has(a)||(this.registeredGridEvents.add(a),this.gridApi.addEventListener(a,e=>{this.$emit(a,e)}))}handleError(a,e){this.gridErrorItems=[...this.gridErrorItems,{detail:e.detail,type:a}]}handleBaseDatasourceError(a){const e={detail:{message:a.detail.message},type:j.Ie.datasource};this.gridErrorItems=[...this.gridErrorItems,{detail:e.detail,type:e.type}]}hideDatasourceError(){this.gridErrorItems=this.gridErrorItems.filter(a=>a.type!==j.Ie.datasource)}connectedCallback(){super.connectedCallback(),this.gridAutosizingEnabled&&(0,d.j)(this,a=>{a&&this.debouncedColumnAutosize.bind(this)()}),this.rehydrationAttempted=!1,this.shouldRunConnect&&(K.forEach(a=>{Object.defineProperty(this,a,{set:e=>{this.agAttributeChangedCallback((0,J.w)(a),void 0,e)},enumerable:!0,configurable:!0})}),this.rootEventsListeners.forEach(({key:a,action:e})=>{this.addEventListener(a,e)}),this.paginationPageSize=this.isServerSide?this.gridProDatasource.maxRows:g.OD.DEFAULT_PAGINATION_PAGE_SIZE)}disconnectedCallback(){super.disconnectedCallback(),this.rehydrationAttempted=!1;const a=this.shouldRunDisconnect;this.rootEventsListeners.forEach(({key:a,action:e})=>{this.removeEventListener(a,e)}),c.DOM.queueUpdate(()=>{var e;a&&(this.initialised=!1,null===(e=this.gridApi)||void 0===e||e.destroy(),this.invalidateColumnWidthCache(),this.registeredGridEvents.clear())})}combineAllGridComponents(a){const e={[B.IX.action]:k.eA,[B.IX.actionsMenu]:C.cN,[B.IX.boolean]:A._Y,[B.IX.editable]:D.YM,[B.IX.statusPill]:M.N7,[B.IX.select]:T.gs,[B.IX.selectEditor]:z._Q,[B.IX.numberEditor]:y.Z0,[B.IX.multiselectEditor]:b.pZ,[B.IX.dateEditor]:w.S8,[B.IX.stringEditor]:x.XJ,[B.k7.labelValue]:Q.k,[B.k7.loadMore]:U.s,[B.k7.pagination]:Y.h,[B.k7.reload]:V.W};return Object.assign(Object.assign(Object.assign({},e),a),this.gridComponents)}statePersistanceEnabled(){return!(!this.persistColumnStateKey||0===this.persistColumnStateKey.length)}getSelectedRows(){var a,e,r,t;try{if(!this.initialised||!this.gridApi)return[];const o=null===(a=this.gridOptions)||void 0===a?void 0:a.rowSelection;if("single"===o||"multiple"===o)return this.gridApi.getSelectedRows&&this.gridApi.getSelectedRows().length>0?this.gridApi.getSelectedRows():[];if((null===(e=this.gridApi)||void 0===e?void 0:e.getCellRanges)&&this.gridApi.getCellRanges().length>0)return this.getCellRangeRowData();if(!(null===(r=this.gridOptions)||void 0===r?void 0:r.enableRangeSelection)){const a=null===(t=this.gridApi)||void 0===t?void 0:t.getFocusedCell();if(a){const e=this.gridApi.getDisplayedRowAtIndex(a.rowIndex);if(null==e?void 0:e.data)return[e.data]}}return[]}catch(a){return H.v.error("Grid Pro: Error getting selected rows:",a),[]}}getCellRangeRowData(){var a;if(!(null===(a=this.gridApi)||void 0===a?void 0:a.getCellRanges))return[];const e=this.gridApi.getCellRanges();if(0===e.length)return[];const r=[];return e.forEach(a=>{const e=a.startRow.rowIndex,t=a.endRow.rowIndex;for(let a=e;a<=t;a+=1){const e=this.gridApi.getDisplayedRowAtIndex(a);(null==e?void 0:e.data)&&!r.some(a=>a===e.data)&&r.push(e.data)}}),r}hasSelectedRows(){return this.getSelectedRows().length>0}debouncedColumnAutosize(){this.gridAutosizingEnabled&&(this.debounced&&(clearTimeout(this.debounced),this.debounced=null),this.debounced=setTimeout(()=>{var a;null===(a=this.gridApi)||void 0===a||a.sizeColumnsToFit()},j.BW))}removeConfigWidthsToAutosize(a){return a.map(a=>Object.assign(Object.assign({},a),{width:null}))}saveColumnState(){return(0,t.sH)(this,void 0,void 0,function*(){if(this.rehydrationAttempted&&this.statePersistanceEnabled()){let a=this.columnApi.getColumnState();a=this.gridAutosizingEnabled?this.removeConfigWidthsToAutosize(a):a;const e=0===a.filter(a=>{if(a.hide)return!1;const e=this.columnApi.getColumn(a.colId);return Boolean(e.getColDef().headerName)}).length;if(0===a.length||JSON.stringify(a)===JSON.stringify(this.columnState)||e)return;yield this.statePersistence.saveColumnState(this.persistColumnStateKey,a),this.columnState=a}})}getSavedColumnState(){return(0,t.sH)(this,void 0,void 0,function*(){return this.columnState=[],this.statePersistanceEnabled()&&(this.columnState=yield this.statePersistence.getColumnState(this.persistColumnStateKey)),this.columnState})}deleteColumnState(){return(0,t.sH)(this,arguments,void 0,function*(a=!0){var e;if(this.statePersistanceEnabled()&&(yield this.statePersistence.deleteColumnState(this.persistColumnStateKey),this.columnState=[]),a&&this.columnApi){if((null===(e=this.defaultColumnConfig)||void 0===e?void 0:e.length)>0){const a=(0,q.rG)(this.defaultColumnConfig);this.columnApi.applyColumnState({state:a,applyOrder:!0})}else this.columnApi.resetColumnState();this.handleColumnSizing()}})}restoreColumnState(){return(0,t.sH)(this,void 0,void 0,function*(){var a;this.rehydrationAttempted=!0;const e=yield this.getSavedColumnState();e&&e.length>0&&(null===(a=this.columnApi)||void 0===a||a.applyColumnState({state:e,applyOrder:!0}))})}cacheFilterConfig(){var a;this.setFilterModel((null===(a=this.gridApi)||void 0===a?void 0:a.getFilterModel())||void 0)}restoreCachedFilterConfig(){return(0,t.sH)(this,void 0,void 0,function*(){var a,e;const r=yield this.getfilterModel();void 0!==r&&(null===(a=this.gridApi)||void 0===a||a.setFilterModel(r),null===(e=this.gridApi)||void 0===e||e.onFilterChanged())})}get gridOptions(){return this.agGridOptions}get isServerSide(){return this.gridProDatasource instanceof R.X}get gridParams(){return{globalEventListener:this.globalEventListener.bind(this)}}get gridProDatasource(){return this.querySelector("grid-pro-genesis-datasource")||this.querySelector("grid-pro-client-side-datasource")||this.querySelector("grid-pro-server-side-datasource")}set gridOptions(a){const e=m()(this.saveColumnState.bind(this),400),r=m()(this.cacheFilterConfig.bind(this),400),o=()=>{e(),this.debouncedColumnAutosize.bind(this)(),this.invalidateColumnWidthCache()};Array.from(this.attributes).forEach(a=>{const e=this.agPropertiesMap[a.name];e&&(this.agAttributes[e]=a.value)});const{columnDefs:n,components:g,defaultColDef:l,getRowId:d,onGridReady:s,onFilterChanged:c,onFirstDataRendered:p}=a,u=(0,t.Tt)(a,["columnDefs","components","defaultColDef","getRowId","onGridReady","onFilterChanged","onFirstDataRendered"]),h=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.gridOptionsConfig),{defaultColDef:Object.assign({enableCellChangeFlash:this.enableCellFlashing,filter:!0,resizable:!0,sortable:!0},l),components:this.combineAllGridComponents(g),suppressDragLeaveHidesColumns:!0}),this.eventsAndCallbacks),{onGridReady:a=>{this.gridApi=a.api,this.columnApi=a.columnApi,this.gridEventsQueue.length&&this.gridEventsQueue.forEach(a=>{this.addGridEventListener(a)}),this.rowData&&this.gridApi.setRowData(this.rowData),s&&s(a),this.$emit(i.sVA.EVENT_GRID_READY,{event:a,gridId:this.id}),this.$emit(B.mr,{event:a,gridId:this.id}),this.restoreColumnState.bind(this)(),this.restoreCachedFilterConfig.bind(this)(),this.debouncedColumnAutosize.bind(this)()},onFirstDataRendered:a=>{this.handleColumnSizing(),p&&p(a)},onColumnPinned:o,onColumnResized:o,onColumnMoved:o,onDisplayedColumnsChanged:o,onFilterChanged:a=>{r(),c&&c(a)},onGridSizeChanged:o,onSortChanged:o}),u);this.gridProDatasource?(h.columnDefs=n,h.getRowId=d,this.setupPaginationAndStatusBar(h),this.setLocalGridOptions(h)):this.mergeAllColumnDefsAndStates(n).then(a=>{h.columnDefs=a,h.getRowId=d,this.setupPaginationAndStatusBar(h),this.setLocalGridOptions(h),this.initGrid()})}setLocalGridOptions(a){this.agGridOptions=Object.assign(Object.assign({},this.agGridOptions),i.kNx.copyAttributesToGridOptions(a,this.agAttributes))}clearLocalGridOptions(){this.agGridOptions=void 0}initGrid(){c.DOM.queueUpdate(()=>{this.initialised&&this.gridSlot.firstChild&&this.gridSlot.removeChild(this.gridSlot.firstChild),this.agGrid=new i.xA9(this.gridSlot,this.agGridOptions,this.gridParams),this.initialised=!0})}applyTemplateDefinitions(a,e=!1){return H.v.deprecated("applyTemplateDefinitions","Use `mergeAllColumnDefsAndStates` instead."),this.mergeAllColumnDefsAndStates(a,e)}mergeAllColumnDefsAndStates(a){return(0,t.sH)(this,arguments,void 0,function*(a,e=!1){var r;const t=a||[];t.forEach(a=>{if(this.headerCaseType&&a.field&&!a.headerName){const e=h[this.headerCaseType];e?a.headerName=e(a.field):H.v.warn(`Invalid header-case-type attribute value: ${this.headerCaseType}. Please use one of the following: camelCase, capitalCase, dotCase, headerCase, noCase, paramCase, pascalCase, pathCase, sentenceCase, snakeCase.`)}});const o=Array.from(this.querySelectorAll(this.columnComponentName)).map(a=>a.definition).map(a=>{this.enableCellFlashing&&void 0===a.enableCellChangeFlash&&(a.enableCellChangeFlash=!0),a.editable&&(a.cellRenderer||a.cellRendererSelector||(a.cellRendererSelector=e=>{if(null==e?void 0:e.data)return e.data[B.A7]===a.field?{component:B.IX.editable}:void 0}),a.tooltipComponent||a.tooltipValueGetter||(a.tooltipComponent=W.y,a.tooltipValueGetter=e=>{if(!(null==e?void 0:e.data))return;const r=e.data[B.h1];return r&&r.column===a.field?r.message:void 0}),a.cellClassRules||(a.cellClassRules={error:a=>{var e;return!(!(null==a?void 0:a.colDef)||!(null==a?void 0:a.data))&&(null===(e=a.data[B.h1])||void 0===e?void 0:e.column)===a.colDef.field}}));const e=t.find(e=>a.field===e.field);return Object.assign(Object.assign({},e),a)}),i=o.map(a=>a.field),n=[...o,...this.onlyTemplateColDefs?[]:t.filter(a=>!i.includes(a.field))];if(this.gridProDatasource&&e){const a=yield this.getSavedColumnState();if((null==a?void 0:a.length)>0)return(0,q.yS)(n,a);if((null===(r=this.gridProDatasource.deferredColumnStates)||void 0===r?void 0:r.length)>0)return(0,q.yS)(n,this.gridProDatasource.deferredColumnStates)}return n})}panelExists(a,e){return e.some(e=>e.statusPanel===a)}addRowCountPanel(a){if(!this.isServerSide&&this.statusBarConfig&&!0===this.statusBarConfig.rows){const e="agTotalAndFilteredRowCountComponent";this.panelExists(e,a)||a.push({statusPanel:e,align:"left"})}}addMaxRowsPanel(a){this.statusBarConfig&&!0===this.statusBarConfig.maxRows&&(this.panelExists(B.k7.labelValue,a)||a.push({statusPanel:B.k7.labelValue,statusPanelParams:{label:"Max Rows",value:this.gridProDatasource.maxRows||g.OD.MAX_ROWS_250,hide:!1},align:"left"}))}addAggregationPanel(a){this.statusBarConfig&&!0===this.statusBarConfig.aggregation&&(this.panelExists("agAggregationComponent",a)||a.push({statusPanel:"agAggregationComponent",align:"right"}))}addDatasourcePanels(a){if(this.gridProDatasource){const e=this.gridProDatasource.getDatasourceStatusBarPanels(this.isServerSide).filter(e=>!this.panelExists(e.statusPanel,a));a.push(...e)}}addPaginationPanel(a){this._pagination&&(this.panelExists(B.k7.pagination,a)||a.push({statusPanel:B.k7.pagination,align:"right"}))}setupPaginationAndStatusBar(a){var e,r;if(this._pagination&&(a.pagination=!0,a.suppressScrollOnNewData=!0,a.paginationPageSize=this.paginationPageSize),this.withStatusBar&&this.statusBarConfig){const t=[...(null===(e=a.statusBar)||void 0===e?void 0:e.statusPanels)||[]];this.addRowCountPanel(t),this.addMaxRowsPanel(t),this.addAggregationPanel(t),this.addDatasourcePanels(t),this._pagination&&(a.suppressPaginationPanel=!0,this.addPaginationPanel(t));const o=((null===(r=a.statusBar)||void 0===r?void 0:r.statusPanels)||[]).filter(a=>!this.panelExists(a.statusPanel,t));t.push(...o),a.statusBar={statusPanels:t}}}handleColumnSizing(){(this.sizeColumnsToContent||this.sizeColumnsToFit)&&(this.sizeColumnsToContent&&this.sizeColumnsToFit&&this.columnApi&&this.gridApi?this.handleBothSizingModes():this.handleIndividualSizingModes())}handleBothSizingModes(){if(this.calculateTotalColumnWidth()>this.getGridWidth()){if(!this.columnApi)return;this.columnApi.autoSizeAllColumns()}else{if(!this.gridApi)return;this.gridApi.sizeColumnsToFit()}}handleIndividualSizingModes(){this.sizeColumnsToContent&&this.columnApi&&this.columnApi.autoSizeAllColumns(),this.sizeColumnsToFit&&this.gridApi&&this.gridApi.sizeColumnsToFit()}calculateTotalColumnWidth(){if(!this.columnApi)return 0;const a=this.columnApi.getAllGridColumns(),e=a.length;return null!==this.cachedTotalColumnWidth&&this.columnCount===e||(this.cachedTotalColumnWidth=a.reduce((a,e)=>a+(e.getActualWidth()||0),0),this.columnCount=e),this.cachedTotalColumnWidth}invalidateColumnWidthCache(){this.cachedTotalColumnWidth=null,this.columnCount=0}getGridWidth(){const a=this;let e=(null==a?void 0:a.clientWidth)||0;return 0===e&&this.gridSlot&&(e=this.gridSlot.clientWidth||0),0===e&&(e=this.clientWidth||0),e}get observedAttributes(){const a=K.map(a=>a.toLowerCase()),e=K.map(a=>(0,J.w)(a));return a.concat(e)}agAttributeChangedCallback(a,e,r){if(e===r)return;const t=this.agPropertiesMap[a];if(t&&(this.agAttributes[t]=r,this.initialised)){const a={};a[t]={currentValue:r},i.kNx.processOnChange(a,this.gridApi)}}globalEventListener(a,e){const r=a.toLowerCase(),t=new Event(r);t.agGridDetails=e,this.dispatchEvent(t);const o="on"+r;"function"==typeof this[o]&&this[o](t)}insertFontFace(a){const e=O.KE[a]||this.gridFontFace;this.destroyFontFace();const r=(0,s.O5)(e,(0,B.b7)(a));r&&(this.fontFaceDestroy=r)}destroyFontFace(){this.fontFaceDestroy&&(this.fontFaceDestroy(),this.fontFaceDestroy=null)}}(0,t.Cg)([c.observable],X.prototype,"columnApi",void 0),(0,t.Cg)([c.observable],X.prototype,"gridApi",void 0),(0,t.Cg)([c.observable],X.prototype,"gridErrorItems",void 0),(0,t.Cg)([G.l],X.prototype,"statePersistence",void 0),(0,t.Cg)([(0,c.attr)({attribute:"auto-cell-renderer-by-type",mode:"boolean"})],X.prototype,"autoCellRendererByType",void 0),(0,t.Cg)([(0,c.attr)({attribute:"only-template-col-defs",mode:"boolean"})],X.prototype,"onlyTemplateColDefs",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"grid-autosizing"})],X.prototype,"gridAutosizingEnabled",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"size-columns-to-content"})],X.prototype,"sizeColumnsToContent",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"size-columns-to-fit"})],X.prototype,"sizeColumnsToFit",void 0),(0,t.Cg)([(0,c.attr)({attribute:"add-index"})],X.prototype,"addIndex",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"async-add"})],X.prototype,"asyncAdd",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"async-remove"})],X.prototype,"asyncRemove",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"async-update"})],X.prototype,"asyncUpdate",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"enable-cell-flashing"})],X.prototype,"enableCellFlashing",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"enabled-row-flashing"})],X.prototype,"enabledRowFlashing",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"enable-row-flashing"})],X.prototype,"enableRowFlashing",void 0),(0,t.Cg)([(0,c.attr)({attribute:"persist-column-state-key"})],X.prototype,"persistColumnStateKey",void 0),(0,t.Cg)([(0,c.attr)({attribute:"persist-filter-model-key"})],X.prototype,"persistFilterModelKey",void 0),(0,t.Cg)([(0,c.attr)({attribute:"default-column-config"})],X.prototype,"defaultColumnConfig",void 0),(0,t.Cg)([(0,c.attr)({attribute:"header-case-type"})],X.prototype,"headerCaseType",void 0),(0,t.Cg)([c.observable],X.prototype,"rowData",void 0),(0,t.Cg)([c.observable],X.prototype,"gridFontFace",void 0),(0,t.Cg)([c.attr],X.prototype,"columnComponentName",void 0),(0,t.Cg)([c.observable],X.prototype,"eventsAndCallbacks",void 0),(0,t.Cg)([c.attr],X.prototype,"headerHeight",void 0),(0,t.Cg)([c.attr],X.prototype,"rowHeight",void 0),(0,t.Cg)([c.attr],X.prototype,"theme",void 0),(0,t.Cg)([c.observable],X.prototype,"classNames",void 0),(0,t.Cg)([c.observable],X.prototype,"agGrid",void 0),(0,t.Cg)([c.observable],X.prototype,"gridSlot",void 0),(0,t.Cg)([c.observable],X.prototype,"gridComponents",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean"})],X.prototype,"pagination",void 0),(0,t.Cg)([(0,c.attr)({attribute:"pagination-page-size"})],X.prototype,"paginationPageSize",void 0),(0,t.Cg)([c.observable],X.prototype,"statusBarConfig",void 0),(0,t.Cg)([(0,c.attr)({mode:"boolean",attribute:"with-status-bar"})],X.prototype,"withStatusBar",void 0),(0,t.Cg)([c.observable],X.prototype,"customErrorHandlerTemplate",void 0),(0,t.Cg)([B.lz],X.prototype,"gridOptionsConfig",void 0);const Z=void 0,$={shadowOptions:void 0},_=X.compose(Object.assign({baseName:"grid-pro",styles:P.X,template:F.a,shadowOptions:Z},$))},52540:(a,e,r)=>{r.d(e,{k:()=>t});class t{init(a){this.element=document.createElement("div"),this.element.classList.add("ag-status-name-value","ag-status-panel"),this.element.setAttribute("data-test-id","grid-label-value-panel"),this.element.setAttribute("role","status"),this.currentParams=a,this.updateDisplay()}updateParams(a){this.currentParams=Object.assign(Object.assign({},this.currentParams),a),this.updateDisplay()}updateDisplay(){this.element&&(this.currentParams.hide?this.element.style.display="none":(this.element.style.display="",this.element.setAttribute("aria-label",`${this.currentParams.label}: ${this.currentParams.value}`),this.labelElement||(this.labelElement=document.createElement("span"),this.labelElement.setAttribute("data-test-id","grid-label-value-label"),this.labelElement.setAttribute("aria-hidden","true"),this.element.appendChild(this.labelElement)),this.labelElement.innerHTML=`${this.currentParams.label}: `,this.valueElement||(this.valueElement=document.createElement("span"),this.valueElement.classList.add("ag-status-name-value-value"),this.valueElement.setAttribute("data-test-id","grid-label-value-value"),this.valueElement.setAttribute("aria-hidden","true"),this.element.appendChild(this.valueElement)),this.valueElement.innerHTML=this.currentParams.value))}getGui(){return this.element}destroy(){}}},52945:(a,e,r)=>{r.d(e,{O5:()=>o,fI:()=>i});var t=r(28745);const o=(a,e)=>{var r;let o=document.getElementById(e);if(o)return void t.v.debug(`\n An element with the id of '${e}' already exists and likely has the css rules applied.\n `);const i=null!==(r=document.head)&&void 0!==r?r:document.getElementsByTagName("head")[0];o=document.createElement("style"),o.id=e,i.appendChild(o);if((a.match(/}/g)||[]).length>1)return o.textContent=a,()=>{o&&i.removeChild(o)};{const e=o.sheet.insertRule(a);return()=>{o&&(o.sheet.deleteRule(e),i.removeChild(o))}}};function i(a){const e=[],r=new Set;return function a(t){const o=Array.from(t.querySelectorAll("*"));e.push(...o),o.forEach(e=>{e.shadowRoot&&!r.has(e.shadowRoot)&&(r.add(e.shadowRoot),a(e.shadowRoot))})}(a),e}},53397:(a,e,r)=>{r.d(e,{l:()=>i});var t=r(84674),o=r(11749);const i=t.DI.createInterface(a=>a.singleton(o.H))},55365:(a,e,r)=>{r.d(e,{A7:()=>h,IX:()=>c,Kb:()=>s,W3:()=>t,YO:()=>m,b7:()=>d,eL:()=>l,h1:()=>v,k7:()=>p,lz:()=>f,mJ:()=>o,mr:()=>u,o2:()=>b,uA:()=>w});var t,o,i=r(66265),n=r(33681),g=r(84674);!function(a){a.foregroundColor="--ag-foreground-color",a.dataColor="--ag-data-color",a.secondaryForegroundColor="--ag-secondary-foreground-color",a.headerForegroundColor="--ag-header-foreground-color",a.disabledForegroundColor="--ag-disabled-foreground-color",a.backgroundColor="--ag-background-color",a.headerBackgroundColor="--ag-header-background-color",a.subheaderBackgroundColor="--ag-subheader-background-color",a.subheaderToolbarBackgroundColor="--ag-subheader-toolbar-background-color",a.controlPanelBackgroundColor="--ag-control-panel-background-color",a.selectedRowBackgroundColor="--ag-selected-row-background-color",a.oddRowBackgroundColor="--ag-odd-row-background-color",a.rowHoverColor="--ag-row-hover-color",a.rangeSelectionBorderColor="--ag-range-selection-border-color",a.rangeSelectionBackgroundColor="--ag-range-selection-background-color",a.selectedTabUnderlineColor="--ag-selected-tab-underline-color",a.rangeSelectionChartCategoryBackgroundColor="--ag-range-selection-chart-category-background-color",a.rangeSelectionChartBackgroundColor="--ag-range-selection-chart-background-color",a.headerCellHoverBackgroundColor="--ag-header-cell-hover-background-color",a.headerCellMovingBackgroundColor="--ag-header-cell-moving-background-color",a.chipBackgroundColor="--ag-chip-background-color",a.borderColor="--ag-border-color",a.secondaryBorderColor="--ag-secondary-border-color",a.rowBorderColor="--ag-row-border-color",a.headerColumnSeparatorColor="--ag-header-column-separator-color",a.headerColumnResizeHandleColor="--ag-header-column-resize-handle-color",a.inputBorderColor="--ag-input-border-color",a.inputDisabledBorderColor="--ag-input-disabled-border-color",a.inputDisabledBackgroundColor="--ag-input-disabled-background-color",a.checkboxBackgroundColor="--ag-checkbox-background-color",a.checkboxCheckedColor="--ag-checkbox-checked-color",a.checkboxUncheckedColor="--ag-checkbox-unchecked-color",a.checkboxIndeterminateColor="--ag-checkbox-indeterminate-color",a.toggleButtonOffBorderColor="--ag-toggle-button-off-border-color",a.toggleButtonOffBackgroundColor="--ag-toggle-button-off-background-color",a.toggleButtonOnBorderColor="--ag-toggle-button-on-border-color",a.toggleButtonOnBackgroundColor="--ag-toggle-button-on-background-color",a.toggleButtonSwitchBackgroundColor="--ag-toggle-button-switch-background-color",a.toggleButtonSwitchBorderColor="--ag-toggle-button-switch-border-color",a.minichartSelectedChartColor="--ag-minichart-selected-chart-color",a.minichartSelectedPageColor="--ag-minichart-selected-page-color",a.modalOverlayBackgroundColor="--ag-modal-overlay-background-color",a.inputFocusBoxShadow="--ag-input-focus-box-shadow",a.inputFocusBorderColor="--ag-input-focus-border-color"}(t||(t={})),function(a){a.alpine="ag-theme-alpine",a.alpineDark="ag-theme-alpine-dark",a.balham="ag-theme-balham",a.balhamDark="ag-theme-balham-dark",a.material="ag-theme-material"}(o||(o={}));const l=a=>`${a}-token-map`,d=a=>`${a}-fonts`,s=(a,e)=>n.css`
|
|
203
203
|
.${l(a)} {
|
|
204
204
|
${new i.CSSVarsTokenMapper(e)}
|
|
205
205
|
}
|
|
@@ -8581,4 +8581,4 @@
|
|
|
8581
8581
|
transition: transform 0.2s ease;
|
|
8582
8582
|
}
|
|
8583
8583
|
`}}]);
|
|
8584
|
-
//# sourceMappingURL=445.
|
|
8584
|
+
//# sourceMappingURL=445.c99dbb2be2664c375152de2e9cf7c59c.js.map
|