"use strict";function d(a){return a?a.kind==="semantic"?[a.kind,a.domainId,a.datasetId||"",a.datasetName].join(":"):a.kind==="physical"?[a.kind,a.connectionId,a.databaseName||"",a.schemaName||"",a.tableName].join(":"):[a.kind,a.connectionId,a.dialect||"",a.label||""].join(":"):""}function n(a,e){return!a||!e?a===e:a.kind!==e.kind?!1:a.kind==="semantic"&&e.kind==="semantic"?a.domainId!==e.domainId?!1:a.datasetId&&e.datasetId?a.datasetId===e.datasetId:a.datasetName===e.datasetName:d(a)===d(e)}function i(a,e){return a.kind!=="semantic"||e.kind!=="semantic"?a:{...a,datasetId:a.datasetId||e.datasetId,label:a.label||e.label,connectionId:a.connectionId||e.connectionId}}function t(a,e){return a.name===e.name&&n(a.source,e.source)}function o(a,e){return{...a,label:a.label||e.label,role:a.role||e.role,dataType:a.dataType||e.dataType,source:a.source&&e.source?i(a.source,e.source):a.source||e.source}}exports.preferSemaphorFieldRefMetadata=o;exports.preferSemaphorSourceMetadata=i;exports.semaphorFieldRefsMatch=t;exports.semaphorSourceIdentityKey=d;exports.semaphorSourcesReferToSameDataset=n;
