scimgateway 5.2.1 → 5.2.2
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/README.md +19 -4
- package/bun.lock +9 -9
- package/config/plugin-ldap.json +4 -0
- package/lib/plugin-ldap.ts +31 -6
- package/lib/scim-stream.js +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -735,7 +735,7 @@ Example using general OAuth:
|
|
|
735
735
|
Please see code editor method HelperRest doRequest() IntelliSense for type and option details
|
|
736
736
|
|
|
737
737
|
### Configuration notes - Remote real-time log subscription
|
|
738
|
-
|
|
738
|
+
Using remote real-time log subscription we may implement custom logic like monitoring and centralized logging
|
|
739
739
|
|
|
740
740
|
- using browser and url: https://host/logger
|
|
741
741
|
- curl -N https://host/logger -u gwread:password
|
|
@@ -778,7 +778,7 @@ push log level may be customized by configuration
|
|
|
778
778
|
}
|
|
779
779
|
}
|
|
780
780
|
|
|
781
|
-
Example code
|
|
781
|
+
Example code implementing subscriber for real-time log messages collection
|
|
782
782
|
|
|
783
783
|
let headers = new Headers()
|
|
784
784
|
headers.append('Authorization', 'Basic ' + btoa('gwadmin' + ':' + 'password'))
|
|
@@ -800,11 +800,11 @@ Example code using custom subscriber API for log collection and monitoring
|
|
|
800
800
|
})
|
|
801
801
|
|
|
802
802
|
const reader = resp.body.pipeThrough(new TextDecoderStream()).getReader()
|
|
803
|
-
console.log('Now awaiting log events
|
|
803
|
+
console.log('Now awaiting log events...\n')
|
|
804
804
|
|
|
805
805
|
while (true) {
|
|
806
806
|
const { value, done } = await reader.read()
|
|
807
|
-
if (done) break
|
|
807
|
+
if (done) break
|
|
808
808
|
if (value.at(-1) !== '\n') continue
|
|
809
809
|
const message = value.slice(0, -1)
|
|
810
810
|
messageHandler(message)
|
|
@@ -1401,6 +1401,21 @@ MIT © [Jarle Elshaug](https://www.elshaug.xyz)
|
|
|
1401
1401
|
|
|
1402
1402
|
## Change log
|
|
1403
1403
|
|
|
1404
|
+
### v5.2.2
|
|
1405
|
+
|
|
1406
|
+
[Fixed]
|
|
1407
|
+
|
|
1408
|
+
- plugin-ldap, tls configuration now supported for Bun > v1.2.4, previously environments had to be used
|
|
1409
|
+
|
|
1410
|
+
"tls": {
|
|
1411
|
+
"ca": "ca-file-name", // located in config/certs
|
|
1412
|
+
"rejectUnauthorized": true
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
[Improved]
|
|
1416
|
+
|
|
1417
|
+
- Dependencies bump
|
|
1418
|
+
|
|
1404
1419
|
### v5.2.1
|
|
1405
1420
|
|
|
1406
1421
|
[Fixed]
|
package/bun.lock
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
"name": "scimgateway",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@ldapjs/asn1": "^2.0.0",
|
|
8
|
-
"@nats-io/jetstream": "^3.0.0
|
|
9
|
-
"@nats-io/nats-core": "^3.0.0
|
|
10
|
-
"@nats-io/transport-node": "^3.0.0
|
|
8
|
+
"@nats-io/jetstream": "^3.0.0",
|
|
9
|
+
"@nats-io/nats-core": "^3.0.0",
|
|
10
|
+
"@nats-io/transport-node": "^3.0.0",
|
|
11
11
|
"@types/ldapjs": "^3.0.6",
|
|
12
12
|
"@types/lokijs": "^1.5.14",
|
|
13
13
|
"@types/tedious": "^18.0.0",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"jsonwebtoken": "^9.0.2",
|
|
19
19
|
"ldapjs": "^3.0.7",
|
|
20
20
|
"lokijs": "^1.5.12",
|
|
21
|
-
"mongodb": "^6.
|
|
21
|
+
"mongodb": "^6.15.0",
|
|
22
22
|
"node-machine-id": "1.1.12",
|
|
23
23
|
"nodemailer": "^6.10.0",
|
|
24
24
|
"passport": "^0.7.0",
|
|
@@ -120,15 +120,15 @@
|
|
|
120
120
|
|
|
121
121
|
"@mongodb-js/saslprep": ["@mongodb-js/saslprep@1.1.9", "", { "dependencies": { "sparse-bitfield": "^3.0.3" } }, "sha512-tVkljjeEaAhCqTzajSdgbQ6gE6f3oneVwa3iXR6csiEwXXOFsiC6Uh9iAjAhXPtqa/XMDHWjjeNH/77m/Yq2dw=="],
|
|
122
122
|
|
|
123
|
-
"@nats-io/jetstream": ["@nats-io/jetstream@3.0.0
|
|
123
|
+
"@nats-io/jetstream": ["@nats-io/jetstream@3.0.0", "", { "dependencies": { "@nats-io/nats-core": "3.0.0" } }, "sha512-pNJDQJfRmRoDsBYSysvk+kPr9cSj1XnLnAxSC7KHVTsu2YqMEWSqgs5YzIULbq1S12oFhM/vvlOiEj/9jY39lg=="],
|
|
124
124
|
|
|
125
|
-
"@nats-io/nats-core": ["@nats-io/nats-core@3.0.0
|
|
125
|
+
"@nats-io/nats-core": ["@nats-io/nats-core@3.0.0", "", { "dependencies": { "@nats-io/nkeys": "2.0.3", "@nats-io/nuid": "2.0.3" } }, "sha512-Ma2VrFkSew35cIRxMvnbQ2VOE2crP7BCIIsGoCqVwvn6Jwmk2ypcHjj9pWn+bPXqmFlamLUrYGH6ncMDb4eXsQ=="],
|
|
126
126
|
|
|
127
|
-
"@nats-io/nkeys": ["@nats-io/nkeys@2.0.
|
|
127
|
+
"@nats-io/nkeys": ["@nats-io/nkeys@2.0.3", "", { "dependencies": { "tweetnacl": "^1.0.3" } }, "sha512-JVt56GuE6Z89KUkI4TXUbSI9fmIfAmk6PMPknijmuL72GcD+UgIomTcRWiNvvJKxA01sBbmIPStqJs5cMRBC3A=="],
|
|
128
128
|
|
|
129
129
|
"@nats-io/nuid": ["@nats-io/nuid@2.0.3", "", {}, "sha512-TpA3HEBna/qMVudy+3HZr5M3mo/L1JPofpVT4t0HkFGkz2Cn9wrlrQC8tvR8Md5Oa9//GtGG26eN0qEWF5Vqew=="],
|
|
130
130
|
|
|
131
|
-
"@nats-io/transport-node": ["@nats-io/transport-node@3.0.0
|
|
131
|
+
"@nats-io/transport-node": ["@nats-io/transport-node@3.0.0", "", { "dependencies": { "@nats-io/nats-core": "3.0.0", "@nats-io/nkeys": "2.0.3", "@nats-io/nuid": "2.0.3" } }, "sha512-s4qeJDz3KYxE1R19uxKtFgAiBg2l3n12o9H0mxyOwWfqJ5dLbZf+m54Py0s9VqZN7M76t5E+eeUSx58/vS2oxQ=="],
|
|
132
132
|
|
|
133
133
|
"@nodelib/fs.scandir": ["@nodelib/fs.scandir@2.1.5", "", { "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g=="],
|
|
134
134
|
|
|
@@ -448,7 +448,7 @@
|
|
|
448
448
|
|
|
449
449
|
"moment": ["moment@2.30.1", "", {}, "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how=="],
|
|
450
450
|
|
|
451
|
-
"mongodb": ["mongodb@6.
|
|
451
|
+
"mongodb": ["mongodb@6.15.0", "", { "dependencies": { "@mongodb-js/saslprep": "^1.1.9", "bson": "^6.10.3", "mongodb-connection-string-url": "^3.0.0" }, "peerDependencies": { "@aws-sdk/credential-providers": "^3.188.0", "@mongodb-js/zstd": "^1.1.0 || ^2.0.0", "gcp-metadata": "^5.2.0", "kerberos": "^2.0.1", "mongodb-client-encryption": ">=6.0.0 <7", "snappy": "^7.2.2", "socks": "^2.7.1" }, "optionalPeers": ["@aws-sdk/credential-providers", "@mongodb-js/zstd", "gcp-metadata", "kerberos", "mongodb-client-encryption", "snappy", "socks"] }, "sha512-ifBhQ0rRzHDzqp9jAQP6OwHSH7dbYIQjD3SbJs9YYk9AikKEettW/9s/tbSFDTpXcRbF+u1aLrhHxDFaYtZpFQ=="],
|
|
452
452
|
|
|
453
453
|
"mongodb-connection-string-url": ["mongodb-connection-string-url@3.0.1", "", { "dependencies": { "@types/whatwg-url": "^11.0.2", "whatwg-url": "^13.0.0" } }, "sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg=="],
|
|
454
454
|
|
package/config/plugin-ldap.json
CHANGED
package/lib/plugin-ldap.ts
CHANGED
|
@@ -37,11 +37,16 @@
|
|
|
37
37
|
//
|
|
38
38
|
// Configuration allowModifyDN=true allows DN being changed based on modified mapping or namingAttribute
|
|
39
39
|
//
|
|
40
|
-
// Note,
|
|
40
|
+
// Note, using Bun version < 1.2.5 and ldaps/TLS, environment must be set before started e.g.:
|
|
41
41
|
// export NODE_EXTRA_CA_CERTS=/package-path/config/certs/ca.pem
|
|
42
42
|
// or
|
|
43
43
|
// export NODE_TLS_REJECT_UNAUTHORIZED=0
|
|
44
44
|
//
|
|
45
|
+
// Bun version >= 1.2.5 supports configuration
|
|
46
|
+
// "tls": {
|
|
47
|
+
// "ca": ca-file-name, // located in confg/certs
|
|
48
|
+
// "rejectUnauthorized": true
|
|
49
|
+
// }
|
|
45
50
|
//
|
|
46
51
|
// Attributes according to map definition in the configuration file plugin-ldap.json:
|
|
47
52
|
//
|
|
@@ -82,6 +87,7 @@
|
|
|
82
87
|
import ldap from 'ldapjs'
|
|
83
88
|
// @ts-expect-error missing type definitions
|
|
84
89
|
import { BerReader } from '@ldapjs/asn1'
|
|
90
|
+
import fs from 'node:fs'
|
|
85
91
|
|
|
86
92
|
// for supporting nodejs running scimgateway package directly, using dynamic import instead of: import { ScimGateway } from 'scimgateway'
|
|
87
93
|
// scimgateway also inclues HelperRest: import { ScimGateway, HelperRest } from 'scimgateway'
|
|
@@ -1339,19 +1345,38 @@ const getCtxAuth = (ctx: any) => {
|
|
|
1339
1345
|
//
|
|
1340
1346
|
const getServiceClient = async (baseEntity: string, ctx: any) => {
|
|
1341
1347
|
const action = 'getServiceClient'
|
|
1342
|
-
// TODO if (!config.entity[baseEntity].passwordDecrypted) config.entity[baseEntity].passwordDecrypted = scimgateway.getPassword(`endpoint.entity.${baseEntity}.password`, configFile)
|
|
1343
|
-
if (!config.entity[baseEntity].baseUrl) config.entity[baseEntity].baseUrl = config.entity[baseEntity].baseUrls[0] // failover logic also updates baseUrl
|
|
1344
1348
|
|
|
1349
|
+
if (!config.entity[baseEntity].baseUrl) config.entity[baseEntity].baseUrl = config.entity[baseEntity].baseUrls[0] // failover logic also updates baseUrl
|
|
1345
1350
|
if (!_serviceClient[baseEntity]) _serviceClient[baseEntity] = {}
|
|
1351
|
+
if (!_serviceClient[baseEntity].tlsOptions) {
|
|
1352
|
+
const tlsOptions: Record<string, any> = {
|
|
1353
|
+
rejectUnauthorized: config.entity[baseEntity]?.tls?.rejectUnauthorized || false,
|
|
1354
|
+
ca: undefined,
|
|
1355
|
+
}
|
|
1356
|
+
if (config.entity[baseEntity]?.tls?.ca) {
|
|
1357
|
+
if (Array.isArray(config.entity[baseEntity].tls.ca)) {
|
|
1358
|
+
tlsOptions.ca = []
|
|
1359
|
+
for (let i = 0; i < config.entity[baseEntity].tls.ca.length; i++) {
|
|
1360
|
+
tlsOptions.ca.append(fs.readFileSync(config.entity[baseEntity].tls.ca[i]))
|
|
1361
|
+
}
|
|
1362
|
+
} else tlsOptions.ca = fs.readFileSync(config.entity[baseEntity].tls.ca)
|
|
1363
|
+
tlsOptions.rejectUnauthorized = true
|
|
1364
|
+
}
|
|
1365
|
+
if (process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0') tlsOptions.rejectUnauthorized = false
|
|
1366
|
+
else if (process.env.NODE_TLS_REJECT_UNAUTHORIZED === '1') tlsOptions.rejectUnauthorized = true
|
|
1367
|
+
if (process.env.NODE_EXTRA_CA_CERTS) {
|
|
1368
|
+
tlsOptions.ca = fs.readFileSync(process.env.NODE_EXTRA_CA_CERTS)
|
|
1369
|
+
tlsOptions.rejectUnauthorized = true
|
|
1370
|
+
}
|
|
1371
|
+
_serviceClient[baseEntity].tlsOptions = tlsOptions
|
|
1372
|
+
}
|
|
1346
1373
|
|
|
1347
1374
|
for (let i = -1; i < config.entity[baseEntity].baseUrls.length; i++) {
|
|
1348
1375
|
try {
|
|
1349
1376
|
const cli = await ldap.createClient({
|
|
1350
1377
|
url: config.entity[baseEntity].baseUrl,
|
|
1351
1378
|
connectTimeout: 5000,
|
|
1352
|
-
tlsOptions:
|
|
1353
|
-
rejectUnauthorized: false,
|
|
1354
|
-
},
|
|
1379
|
+
tlsOptions: _serviceClient[baseEntity].tlsOptions,
|
|
1355
1380
|
strictDN: false, // false => allows none standard ldap base dn e.g. <SID=...> / <GUID=...> ref. objectSid/objectGUID
|
|
1356
1381
|
})
|
|
1357
1382
|
await new Promise((resolve, reject) => {
|
package/lib/scim-stream.js
CHANGED
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
// for details see: https://elshaug.xyz/docs/scim-stream
|
|
12
12
|
//
|
|
13
13
|
// ================================================================
|
|
14
|
-
'use strict';function a0_0x170e(){const _0x334f16=['publisher\x20error:\x20none\x20JSON\x20formatted\x20response:\x20','server_name','configDir','errName','\x20Delete\x20User\x20userName=','onCreate','&attributes=','origin','doRequest',']\x20error:\x20missing\x20entity\x20configuration\x20for\x20baseEntity=','content-type','DELETE\x20api','\x20-\x20will\x20do\x20auto\x20reconnect\x20when\x20connection\x20becomes\x20available','}\x20message\x20response:\x20','error','parse','stringify','firstn','SCIM\x20Stream','503','auth','typeId','password','randomUUID','drain','\x20Create\x20userName=','replace','getHandlerServiceProviderConfig','{\x22error\x22:\x22','response','isArray','normalize','/approles',']\x20onChainingHandler\x20error:\x20configuration\x20scimgateway.chainingBaseUrl\x20missing','groups','DELETE','getServer','NOT_FOUND','body','\x20error:\x20','DELETE\x20users','/Users','\x20handling\x20message:\x20',']\x20publisher[','1600976cPxSCM','putApiHandler','DELETE\x20groups','\x20message:\x20user\x20not\x20created\x20because\x20of\x20active=false','write','path','split',']\x20initialization\x20error:\x20missing\x20configuration\x20nats','attribute','subscribe','helperRest','username','modifyUser',']\x20client\x20error\x20','PUT\x20api','authenticator','\x20group\x20removal\x20error:\x20','skipConvertRolesToGroups','usePutSoftSync','operation','consumers','join','type','getUsers','deleteApiHandler','false','Resources','GET\x20users','\x20roles\x20converted\x20to\x20groups:\x20','}\x20message\x20error\x20response:\x20','User','add','ctx','application/scim+json;\x20charset=utf-8','startsWith',']\x20initialization\x20error:\x20missing\x20configuration\x20nats.subject','getHandlerId',']\x20initialization\x20certificate\x20error:\x20',']\x20error:\x20client\x20have\x20not\x20been\x20initialized','publisher\x20response\x20error:\x20','8QZvCjS','close','url','getGroups','Explicit','status','Basic\x20','/certs/','POST','baseEntity','constructor','readFileSync','putHandler','createWriteStream','POST\x20api','?attributes=','elementnumber','14iupSmQ',']\x20client\x20reconnected\x20','pingInterval','\x20missing\x20user\x20object\x20in\x20message:\x20','getHandler','jwt','forEach','newHelperRest','207042pbUGyI','config','\x20Delete\x20User\x20id=','6tdjoHr','\x20convertedScim20\x20error:\x20','active','GET','approles','\x20createUser()\x20obj=','tenant','routeObj','deleteUser','pluginName','internal\x20stream\x20policy\x20have\x20been\x20changed\x20-\x20central\x20SCIM\x20Stream\x20must\x20be\x20stopped\x20and\x20corresponding\x20./jetstream\x20folder\x20deleted\x20before\x20startup\x20allowing\x20new\x20policy','value','activityOperation','utf-8','message','reconnect','fsExistsSync','getEncrypted','\x20message\x20json\x20parsing\x20error:\x20','statusCode','userName','1754361vwhkuH','\x20error:\x20missing\x20id}',']\x20client\x20has\x20a\x20stale\x20connection\x20','gwName','GET\x20serviceplans','POST\x20users','set','_autogenerated.cfg','\x20error:\x20missing\x20result',']\x20client\x20is\x20attempting\x20to\x20reconnect\x20','replaceAll','\x22,\x22errName\x22:\x22','UnableConnectingHost','PUT\x20groups','382640wwZSgC','\x20missing\x20mandatory\x20user.userName\x20in\x20message:\x20',']\x20initialization\x20error:\x20nats.subject\x20root\x20topic\x20must\x20be\x20\x27GW\x27,\x20nats.subject\x20example:\x20GW.APP1',']\x20connect\x20error:\x20','respond','PUT\x20users','base64','true','getHandlerSchemas','Msg-Id','\x20done','debug',']\x20closed\x20with\x20error:\x20','indexOf','\x20message:\x20',']\x20initialization\x20error:\x20missing\x20configuration\x20stream.baseUrls','sub','publish','data','toString','postApiHandler','GET\x20serviceproviderconfigs','reconnecting','PATCH\x20users','\x20=>\x20subscriber\x20not\x20activated','info','certificate','charAt','rejectUnauthorized','from','delete','bearerToken',']\x20client\x20consumer\x20reinitiated\x20because\x20of\x20','patchHandler','nats',',\x20id=','copyObj','closed','Operations','trim','undefined','\x20message:\x20user\x20not\x20deleted\x20because\x20of\x20configuration\x20modifyOnly=true','basic',']\x20approle\x20uuid\x20file\x20created:\x20','waitOnFirstConnect','name','display','ENOTFOUND','\x20message:\x20user\x20does\x20not\x20exist','isClosed','\x20Create\x20User\x20userName=','tls','scimgateway','Users','all','\x20message\x20handled:\x20','headers','getUsers()\x20getObj=','token','roles',']\x20subscriber[','consume','substring','publisher[','call','passThrough','filter_subject','\x20subscriber\x20error:\x20scimgateway\x20endpoint\x20connect\x20problem\x20-\x20will\x20do\x20auto\x20retry\x20until\x20connected','users','All','290613uAxRZa','GET\x20groups','modifyOnly','logger','deleteHandler',']\x20client\x20disconnected\x20','file-not-configured','obj','\x20-\x20','lowercase','\x20message:\x20user\x20not\x20created\x20because\x20of\x20configuration\x20modifyOnly=true','getAppRoles','encode','request','append','generateUserPassword','staleConnection','streamChaining\x20error:\x20','authorization','servers',']\x20error:\x20','createRandomPassword','chainingBaseUrl',']\x20onChainingHandler\x20error:\x20','replaceUsrGrp()\x20error:\x20stream\x20replaceUsrGrp\x20must\x20be\x20type\x20\x22Users\x22','string','toUpperCase','replaceDomains','displayName','/Users/','getuniquevalue','subject','get',']\x20onChainingHandler\x20error:\x20configuration\x20scimgateway.chainingBaseUrl\x20must\x20use\x20correct\x20syntax\x20\x27http(s)://host:port\x27\x20error:\x20','push','streamChaining\x20called\x20but\x20missing\x20chainingBaseUrl','reconnectTimeWait','baseUrls','396054HSlofK','\x20(count=','modifyGroup',',false',']\x20subscriber\x20stopped\x20error:\x20','foldReplacing','Application','GET\x20serviceproviderconfig','ack','PATCH\x20groups','toLowerCase','ETIMEDOUT','uppercase',']\x20error:\x20no\x20subscribers/responders\x20to\x20subject\x20','postHandler','secret','operator','45727xzVFUv','then','length','##doIncrement','schemas','func','\x20error:\x20more\x20than\x20one\x20user\x20were\x20found}','disconnect','replaceUsrGrp','\x20Replace\x20User\x20id=','existsSync','increment','SCIM\x20Stream\x20-\x20Autogenerated',']\x20initialization\x20error:\x20missing\x20configuration\x20nats.tenant','maxReconnectAttempts','includes','durable_','POST\x20groups','update','hasOwnProperty','810uMZZBl',',\x20obj=','?filter=externalId\x20eq\x20\x22','\x20-\x20will\x20do\x20auto\x20connect\x20when\x20available\x20-\x20however,\x20please\x20verify\x20stream\x20configuration','_info','method',']\x20handling\x20\x22','SIGTERM','\x20role\x20removal\x20error:\x20','maxPingOut','deliver_policy'];a0_0x170e=function(){return _0x334f16;};return a0_0x170e();}(function(_0x372b67,_0x2f5acf){const _0x304ab2=a0_0x34a9,_0x3e462a=_0x372b67();while(!![]){try{const _0x91bfc3=parseInt(_0x304ab2(0x179))/0x1+parseInt(_0x304ab2(0x219))/0x2*(-parseInt(_0x304ab2(0x153))/0x3)+-parseInt(_0x304ab2(0x1d5))/0x4+parseInt(_0x304ab2(0x10d))/0x5+-parseInt(_0x304ab2(0x216))/0x6*(-parseInt(_0x304ab2(0x20e))/0x7)+-parseInt(_0x304ab2(0x1fd))/0x8*(-parseInt(_0x304ab2(0x22e))/0x9)+parseInt(_0x304ab2(0x19e))/0xa*(parseInt(_0x304ab2(0x18a))/0xb);if(_0x91bfc3===_0x2f5acf)break;else _0x3e462a['push'](_0x3e462a['shift']());}catch(_0x44eeb1){_0x3e462a['push'](_0x3e462a['shift']());}}}(a0_0x170e,0x5d5b1));import{jwtAuthenticator,headers}from'@nats-io/nats-core';import{jetstream,jetstreamManager,DeliverPolicy,AckPolicy}from'@nats-io/jetstream';import{connect as a0_0xa30659}from'@nats-io/transport-node';import a0_0x3ae810 from'fold-to-ascii';import a0_0x1d49b8 from'node:fs';import a0_0x486815 from'node:path';import a0_0x7ebed9 from'node:crypto';import*as a0_0x197b83 from'./utils.ts';import*as a0_0x2ff7a4 from'./utils-scim.ts';function a0_0x34a9(_0xcc8408,_0x14e51a){const _0x170e8d=a0_0x170e();return a0_0x34a9=function(_0x34a991,_0x4742cb){_0x34a991=_0x34a991-0x103;let _0x46beb9=_0x170e8d[_0x34a991];return _0x46beb9;},a0_0x34a9(_0xcc8408,_0x14e51a);}export class Subscriber{constructor(_0x3e80b4,_0x273e9f){const _0x47219f=a0_0x34a9,_0x441b67=_0x3e80b4,_0x5f661d={},_0x591fdb=_0x441b67['config'][_0x47219f(0x141)]['chainingBaseUrl'];let _0x56f56b='';if(_0x591fdb){if(_0x441b67[_0x47219f(0x217)][_0x47219f(0x141)]?.[_0x47219f(0x1bd)]?.['bearerToken']&&Array[_0x47219f(0x1c7)](_0x441b67[_0x47219f(0x217)][_0x47219f(0x141)][_0x47219f(0x1bd)][_0x47219f(0x12c)])&&_0x441b67[_0x47219f(0x217)][_0x47219f(0x141)][_0x47219f(0x1bd)][_0x47219f(0x12c)][_0x47219f(0x18c)]>0x0){const _0x245b9f=_0x441b67['config']['scimgateway'][_0x47219f(0x1bd)][_0x47219f(0x12c)];if(_0x245b9f[0x0][_0x47219f(0x147)]){const _0x5a911a=Buffer[_0x47219f(0x12a)](_0x245b9f[0x0][_0x47219f(0x147)])[_0x47219f(0x120)](_0x47219f(0x113));_0x56f56b='Bearer\x20'+_0x5a911a;}}if(!_0x56f56b&&_0x441b67[_0x47219f(0x217)][_0x47219f(0x141)]?.[_0x47219f(0x1bd)]?.[_0x47219f(0x137)]&&Array[_0x47219f(0x1c7)](_0x441b67[_0x47219f(0x217)]['scimgateway'][_0x47219f(0x1bd)][_0x47219f(0x137)])&&_0x441b67[_0x47219f(0x217)][_0x47219f(0x141)][_0x47219f(0x1bd)][_0x47219f(0x137)][_0x47219f(0x18c)]>0x0){const _0x1554bd=_0x441b67['config'][_0x47219f(0x141)][_0x47219f(0x1bd)]['basic'];if(_0x1554bd[0x0][_0x47219f(0x1e0)]&&_0x1554bd[0x0]['password']){const _0xb9adcf=Buffer[_0x47219f(0x12a)](_0x1554bd[0x0][_0x47219f(0x1e0)]+':'+_0x1554bd[0x0][_0x47219f(0x1bf)])['toString'](_0x47219f(0x113));_0x56f56b=_0x47219f(0x203)+_0xb9adcf;}}}const _0x321a66=async(_0x142435,_0x513f05)=>{const _0x5eedde=_0x47219f,_0x4e3063=_0x5f661d[_0x142435][_0x5eedde(0x217)]?.[_0x5eedde(0x12f)]?.['subject'];let _0x24f2b3;try{_0x24f2b3=await a0_0xa30659(_0x513f05);if(_0x24f2b3[_0x5eedde(0x126)][_0x5eedde(0x1aa)]!==_0x5eedde(0x1bb)){_0x24f2b3['close']();return;}_0x5f661d[_0x142435]['nc']=_0x24f2b3,_0x49faf8(_0x142435,_0x24f2b3),_0x5a2539(_0x142435,_0x24f2b3);}catch(_0x3f0fb1){_0x441b67['logger'][_0x5eedde(0x1b7)](_0x441b67[_0x5eedde(0x231)]+'['+_0x441b67[_0x5eedde(0x222)]+']\x20subscriber['+_0x142435+']['+_0x4e3063+_0x5eedde(0x110)+_0x3f0fb1[_0x5eedde(0x227)]+_0x5eedde(0x1a1)),_0x513f05[_0x5eedde(0x139)]=!![];try{_0x24f2b3=await a0_0xa30659(_0x513f05);if(_0x24f2b3[_0x5eedde(0x126)][_0x5eedde(0x1aa)]!==_0x5eedde(0x1bb)){_0x24f2b3[_0x5eedde(0x1fe)]();return;}_0x5f661d[_0x142435]['nc']=_0x24f2b3,_0x49faf8(_0x142435,_0x24f2b3),_0x5a2539(_0x142435,_0x24f2b3);}catch(_0x14f157){_0x441b67[_0x5eedde(0x156)][_0x5eedde(0x1b7)](_0x441b67['gwName']+'['+_0x441b67['pluginName']+_0x5eedde(0x149)+_0x142435+']['+_0x4e3063+_0x5eedde(0x110)+_0x14f157['message']);return;}}_0x441b67[_0x5eedde(0x156)][_0x5eedde(0x118)](_0x441b67['gwName']+'['+_0x441b67['pluginName']+_0x5eedde(0x149)+_0x142435+']['+_0x4e3063+']\x20connected\x20'+(_0x513f05['tls']['ca']?_0x5eedde(0x140):'')+'\x20'+_0x24f2b3['getServer']()),_0x24f2b3[_0x5eedde(0x132)]()['then'](_0x18960d=>{const _0x36f5ec=_0x5eedde;_0x18960d&&_0x441b67[_0x36f5ec(0x156)][_0x36f5ec(0x1b7)](_0x441b67[_0x36f5ec(0x231)]+'['+_0x441b67[_0x36f5ec(0x222)]+']\x20subscriber['+_0x142435+']['+_0x4e3063+_0x36f5ec(0x119)+_0x18960d['message']);});};this[_0x47219f(0x1f4)]=async(_0x24a14c,_0x1526f0)=>{const _0x52dd7b=_0x47219f;if(!_0x1526f0?.[_0x52dd7b(0x12f)]){_0x441b67[_0x52dd7b(0x156)][_0x52dd7b(0x1b7)](_0x441b67['gwName']+'['+_0x441b67['pluginName']+']\x20subscriber['+_0x24a14c+_0x52dd7b(0x1dc));return;}if(!_0x1526f0?.[_0x52dd7b(0x12f)]?.[_0x52dd7b(0x21f)]){_0x441b67[_0x52dd7b(0x156)]['error'](_0x441b67[_0x52dd7b(0x231)]+'['+_0x441b67[_0x52dd7b(0x222)]+_0x52dd7b(0x149)+_0x24a14c+_0x52dd7b(0x197));return;}if(!_0x1526f0?.[_0x52dd7b(0x12f)]?.[_0x52dd7b(0x172)]){_0x441b67[_0x52dd7b(0x156)][_0x52dd7b(0x1b7)](_0x441b67[_0x52dd7b(0x231)]+'['+_0x441b67[_0x52dd7b(0x222)]+_0x52dd7b(0x149)+_0x24a14c+_0x52dd7b(0x1f8));return;}if(!_0x1526f0?.['certificate']?.['ca']){_0x441b67[_0x52dd7b(0x156)][_0x52dd7b(0x1b7)](_0x441b67[_0x52dd7b(0x231)]+'['+_0x441b67['pluginName']+']\x20subscriber['+_0x24a14c+']\x20initialization\x20error:\x20missing\x20certificate\x20configuration');return;}if(!_0x1526f0[_0x52dd7b(0x178)]||!Array['isArray'](_0x1526f0[_0x52dd7b(0x178)])||_0x1526f0[_0x52dd7b(0x178)][_0x52dd7b(0x18c)]<0x1){_0x441b67[_0x52dd7b(0x156)][_0x52dd7b(0x1b7)](_0x441b67[_0x52dd7b(0x231)]+'['+_0x441b67['pluginName']+']\x20subscriber['+_0x24a14c+_0x52dd7b(0x11c));return;}if(!_0x1526f0[_0x52dd7b(0x1e7)]){const _0x461622=_0x1526f0?.[_0x52dd7b(0x12f)]?.[_0x52dd7b(0x172)]['toUpperCase']();if(_0x461622[_0x52dd7b(0x1f7)]('HR.'))_0x1526f0[_0x52dd7b(0x1e7)]=!![];}const _0x8b3f9a={};try{let _0x5cf0ac=a0_0x486815[_0x52dd7b(0x1ea)](_0x441b67[_0x52dd7b(0x1ab)],_0x52dd7b(0x204),_0x1526f0?.['certificate']?.['ca']||_0x52dd7b(0x159));(_0x1526f0?.[_0x52dd7b(0x127)]?.['ca']?.[_0x52dd7b(0x1f7)]('/')||_0x1526f0?.[_0x52dd7b(0x127)]?.['ca']?.[_0x52dd7b(0x199)]('\x5c'))&&(_0x5cf0ac=_0x1526f0['certificate']['ca']),_0x8b3f9a['ca']=[a0_0x1d49b8[_0x52dd7b(0x208)](_0x5cf0ac)],_0x8b3f9a[_0x52dd7b(0x129)]=!![];}catch(_0x2f935c){_0x441b67[_0x52dd7b(0x156)]['error'](_0x441b67['gwName']+'['+_0x441b67[_0x52dd7b(0x222)]+_0x52dd7b(0x149)+_0x24a14c+']\x20initialization\x20certificate\x20error:\x20'+_0x2f935c[_0x52dd7b(0x227)]);return;}const _0x51aa88={},_0x5b7e88=new TextEncoder()['encode'](_0x1526f0?.[_0x52dd7b(0x12f)]?.[_0x52dd7b(0x188)]),_0x10d55d=_0x1526f0?.[_0x52dd7b(0x12f)]?.[_0x52dd7b(0x213)];_0x51aa88['authenticator']=jwtAuthenticator(_0x10d55d,_0x5b7e88),_0x51aa88['servers']=_0x1526f0['baseUrls'],_0x51aa88[_0x52dd7b(0x140)]=_0x8b3f9a,_0x51aa88['waitOnFirstConnect']=![],_0x51aa88[_0x52dd7b(0x228)]=!![],_0x51aa88['reconnectTimeWait']=0x3e8*0xa,_0x51aa88[_0x52dd7b(0x198)]=-0x1,_0x51aa88[_0x52dd7b(0x210)]=0x2*0x3c*0x3e8,_0x51aa88[_0x52dd7b(0x1a7)]=0x5,_0x51aa88['debug']=![],_0x5f661d[_0x24a14c]={},_0x5f661d[_0x24a14c][_0x52dd7b(0x217)]=_0x1526f0,_0x5f661d[_0x24a14c]['nc']=undefined,_0x5f661d[_0x24a14c][_0x52dd7b(0x11d)]=undefined,_0x321a66(_0x24a14c,_0x51aa88);};const _0x5a2539=async(_0xd3c5e0,_0x47792e)=>{const _0x2e2d2b=_0x47219f,_0x2d242c=_0x5f661d[_0xd3c5e0]['config'],_0xb4fa13=_0x2d242c?.[_0x2e2d2b(0x12f)]?.[_0x2e2d2b(0x172)];if(!_0x47792e){_0x441b67['logger'][_0x2e2d2b(0x1b7)](_0x441b67[_0x2e2d2b(0x231)]+'['+_0x441b67[_0x2e2d2b(0x222)]+_0x2e2d2b(0x149)+_0xd3c5e0+']['+_0xb4fa13+_0x2e2d2b(0x1fb));return;}const _0x5d1900=async(_0x4c414f,_0x32e65c)=>{const _0x55aad7=_0x2e2d2b;try{_0x441b67[_0x55aad7(0x156)]['info'](_0x4c414f+_0x55aad7(0x1d3)+_0x32e65c);let _0x1821df;try{if(_0x2d242c[_0x55aad7(0x16e)]&&Array[_0x55aad7(0x1c7)](_0x2d242c[_0x55aad7(0x16e)]))for(let _0x392f72=0x0;_0x392f72<_0x2d242c['replaceDomains'][_0x55aad7(0x18c)];_0x392f72++){const _0x32be52=_0x2d242c[_0x55aad7(0x16e)][_0x392f72];if(!_0x32be52['from']||!_0x32be52[_0x55aad7(0x12a)][_0x55aad7(0x199)]('.')||!_0x32be52['to']||!_0x32be52['to'][_0x55aad7(0x199)]('.'))continue;const _0x5789e3=new RegExp('@'+_0x32be52[_0x55aad7(0x12a)]+'\x22','gi');_0x32e65c=_0x32e65c[_0x55aad7(0x1c3)](_0x5789e3,'@'+_0x32be52['to']+'\x22');}_0x1821df=JSON[_0x55aad7(0x1b8)](_0x32e65c);}catch(_0x5a914e){_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x1b7)](_0x4c414f+_0x55aad7(0x22b)+_0x5a914e[_0x55aad7(0x227)]+_0x55aad7(0x11b)+_0x32e65c),_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x118)](_0x4c414f+_0x55aad7(0x117));return;}const _0x34d1b3=_0x1821df['user'];if(!_0x34d1b3){_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x1b7)](_0x4c414f+_0x55aad7(0x211)+JSON[_0x55aad7(0x1b9)](_0x1821df)),_0x441b67[_0x55aad7(0x156)]['debug'](_0x4c414f+_0x55aad7(0x117));return;}if(!_0x34d1b3[_0x55aad7(0x22d)]){_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x1b7)](_0x4c414f+_0x55aad7(0x10e)+JSON[_0x55aad7(0x1b9)](_0x1821df)),_0x441b67[_0x55aad7(0x156)]['debug'](_0x4c414f+_0x55aad7(0x117));return;}delete _0x34d1b3[_0x55aad7(0x18e)];let _0x11fd23;_0x34d1b3['id']&&(_0x11fd23=_0x34d1b3['id'],delete _0x34d1b3['id']);let _0x27fbe3;_0x34d1b3['onCreate']&&(_0x27fbe3=a0_0x197b83[_0x55aad7(0x131)](_0x34d1b3[_0x55aad7(0x1ae)]),delete _0x34d1b3[_0x55aad7(0x1ae)]);await _0x47e534(_0xd3c5e0,_0x34d1b3);const _0x1cbf3a=_0x34d1b3[_0x55aad7(0x22d)];let _0x29cde1,_0x135954;try{_0x29cde1=await _0x3f85b2(_0xd3c5e0,_0x55aad7(0x22d),_0x1cbf3a);}catch(_0x1fa588){_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x1b7)](_0x4c414f+'\x20getUserId()\x20error:\x20'+_0x1fa588[_0x55aad7(0x227)]),_0x441b67['logger'][_0x55aad7(0x118)](_0x4c414f+_0x55aad7(0x117));const _0x15f1e3=[_0x55aad7(0x10b),'UnableConnectingService','ECONNREFUSED',_0x55aad7(0x13c),_0x55aad7(0x184),'timeout'];for(const _0x261606 in _0x15f1e3){if(_0x1fa588['message'][_0x55aad7(0x199)](_0x261606))return!![];}return;}if(!_0x2d242c[_0x55aad7(0x1e6)]){let _0x3c2f35=![];if(_0x1821df['Operations']&&Array['isArray'](_0x1821df['Operations']))for(let _0x6d4843=0x0;_0x6d4843<_0x1821df[_0x55aad7(0x133)]['length'];_0x6d4843++){const _0xe5c2b5=_0x1821df[_0x55aad7(0x133)][_0x6d4843];_0xe5c2b5[_0x55aad7(0x1da)][_0x55aad7(0x1f7)](_0x55aad7(0x148))&&(_0xe5c2b5['path']=_0x55aad7(0x1cb),Array[_0x55aad7(0x1c7)](_0xe5c2b5[_0x55aad7(0x224)])?(_0xe5c2b5['value'][0x0]['id']=_0xe5c2b5[_0x55aad7(0x224)][0x0][_0x55aad7(0x224)],_0xe5c2b5[_0x55aad7(0x224)][0x0]['display']=_0xe5c2b5[_0x55aad7(0x224)][0x0][_0x55aad7(0x1eb)]+_0x55aad7(0x15b)+_0xe5c2b5[_0x55aad7(0x224)][0x0]['value'],delete _0xe5c2b5[_0x55aad7(0x224)][0x0]['value'],delete _0xe5c2b5[_0x55aad7(0x224)][0x0][_0x55aad7(0x1eb)]):_0xe5c2b5[_0x55aad7(0x224)]=[{'id':_0xe5c2b5[_0x55aad7(0x224)],'display':_0xe5c2b5['value']}],delete _0xe5c2b5[_0x55aad7(0x1be)],_0x3c2f35=!![]);}if(_0x34d1b3['roles']&&Array[_0x55aad7(0x1c7)](_0x34d1b3[_0x55aad7(0x148)])&&_0x34d1b3[_0x55aad7(0x148)][_0x55aad7(0x18c)]>0x0){if(!_0x34d1b3['groups'])_0x34d1b3[_0x55aad7(0x1cb)]=[];if(!Array[_0x55aad7(0x1c7)](_0x34d1b3['groups']))_0x34d1b3[_0x55aad7(0x1cb)]=[];for(let _0x1eda0a=0x0;_0x1eda0a<_0x34d1b3[_0x55aad7(0x148)][_0x55aad7(0x18c)];_0x1eda0a++){const _0x366d9f={},_0x534b73=_0x34d1b3[_0x55aad7(0x148)][_0x1eda0a];_0x366d9f[_0x55aad7(0x224)]=_0x534b73[_0x55aad7(0x224)],_0x366d9f[_0x55aad7(0x13b)]=_0x534b73[_0x55aad7(0x1eb)]+_0x55aad7(0x15b)+_0x534b73[_0x55aad7(0x13b)],_0x34d1b3[_0x55aad7(0x1cb)]['push'](_0x366d9f);}delete _0x34d1b3[_0x55aad7(0x148)],_0x3c2f35=!![];}if(_0x3c2f35)_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x118)](_0x4c414f+_0x55aad7(0x1f1)+JSON[_0x55aad7(0x1b9)](_0x1821df));}if(!_0x29cde1){if(_0x1821df[_0x55aad7(0x225)]==='deleteUser'){_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x118)](_0x4c414f+_0x55aad7(0x1ad)+_0x1cbf3a+_0x55aad7(0x13d)),_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x118)](_0x4c414f+_0x55aad7(0x117));return;}if(_0x2d242c[_0x55aad7(0x155)]&&_0x2d242c[_0x55aad7(0x155)]===!![]){_0x441b67[_0x55aad7(0x156)]['debug'](_0x4c414f+_0x55aad7(0x1c2)+_0x1cbf3a+_0x55aad7(0x15d)),_0x441b67['logger'][_0x55aad7(0x118)](_0x4c414f+'\x20done');return;}if(Object['prototype'][_0x55aad7(0x19d)][_0x55aad7(0x14d)](_0x34d1b3,_0x55aad7(0x21b))){if(typeof _0x34d1b3[_0x55aad7(0x21b)]===_0x55aad7(0x16c)){const _0x22c0ff=_0x34d1b3['active'][_0x55aad7(0x183)]();if(_0x22c0ff==='true')_0x34d1b3[_0x55aad7(0x21b)]=!![];else{if(_0x22c0ff===_0x55aad7(0x1ee))_0x34d1b3['active']=![];}}if(_0x34d1b3[_0x55aad7(0x21b)]===![]){_0x441b67[_0x55aad7(0x156)]['debug'](_0x4c414f+_0x55aad7(0x1c2)+_0x1cbf3a+_0x55aad7(0x1d8)),_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x118)](_0x4c414f+_0x55aad7(0x117));return;}}_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x118)](_0x4c414f+_0x55aad7(0x13f)+_0x1cbf3a);const _0x1ad06e=a0_0x197b83['copyObj'](_0x34d1b3);try{delete _0x1ad06e['groups'];!_0x1ad06e['password']&&_0x2d242c['generateUserPassword']&&_0x2d242c[_0x55aad7(0x162)]===!![]&&(_0x1ad06e[_0x55aad7(0x1bf)]=a0_0x197b83[_0x55aad7(0x168)](0xf));if(_0x27fbe3||_0x11fd23){if(_0x27fbe3)for(const _0x39a58b in _0x27fbe3){_0x1ad06e[_0x39a58b]=_0x27fbe3[_0x39a58b];}if(_0x11fd23)_0x1ad06e['id']=_0x11fd23;await _0x47e534(_0xd3c5e0,_0x1ad06e);}await _0x286a0c(_0xd3c5e0,_0x1ad06e),_0x34d1b3[_0x55aad7(0x1cb)]&&Array[_0x55aad7(0x1c7)](_0x34d1b3[_0x55aad7(0x1cb)])&&_0x34d1b3[_0x55aad7(0x1cb)][_0x55aad7(0x18c)]>0x0&&(_0x135954=await _0x3f85b2(_0xd3c5e0,_0x55aad7(0x22d),_0x1cbf3a));}catch(_0x207bca){_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x1b7)](_0x4c414f+_0x55aad7(0x21e)+JSON[_0x55aad7(0x1b9)](_0x1ad06e)+_0x55aad7(0x1d0)+_0x207bca['message']+'}'),_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x118)](_0x4c414f+_0x55aad7(0x117));return;}}if(_0x29cde1||_0x135954){if(_0x1821df['activityOperation']===_0x55aad7(0x221)){if(_0x2d242c[_0x55aad7(0x155)]&&_0x2d242c[_0x55aad7(0x155)]===!![]){_0x441b67['logger'][_0x55aad7(0x118)](_0x4c414f+'\x20Delete\x20User\x20id='+_0x29cde1+_0x55aad7(0x136)),_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x118)](_0x4c414f+'\x20done');return;}_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x118)](_0x4c414f+_0x55aad7(0x218)+_0x29cde1);try{await _0x3ad46f(_0xd3c5e0,_0x29cde1);}catch(_0x13b8a8){_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x1b7)](_0x4c414f+'\x20Delete\x20User\x20id='+_0x29cde1+_0x55aad7(0x1d0)+_0x13b8a8['message']+'}'),_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x118)](_0x4c414f+_0x55aad7(0x117));return;}}else{if(_0x135954)_0x29cde1=_0x135954;_0x441b67[_0x55aad7(0x156)]['debug'](_0x4c414f+'\x20Replace\x20User\x20id='+_0x29cde1);try{await _0x9718bd(_0x55aad7(0x142),_0xd3c5e0,_0x29cde1,_0x34d1b3,_0x2d242c[_0x55aad7(0x1e7)]);}catch(_0x317fc0){_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x1b7)](_0x4c414f+_0x55aad7(0x193)+_0x29cde1+_0x55aad7(0x1d0)+_0x317fc0['message']),_0x441b67[_0x55aad7(0x156)]['debug'](_0x4c414f+'\x20done');return;}if(_0x2d242c[_0x55aad7(0x1e7)]){const [_0x1636f5,_0xdfee74]=a0_0x2ff7a4['convertedScim20']({'Operations':_0x1821df[_0x55aad7(0x133)]});if(_0xdfee74){_0x441b67['logger'][_0x55aad7(0x1b7)](_0x4c414f+'\x20Replace\x20User\x20id='+_0x29cde1+_0x55aad7(0x21a)+_0xdfee74[_0x55aad7(0x227)]),_0x441b67[_0x55aad7(0x156)]['debug'](_0x4c414f+'\x20done');return;}const _0x4b9ca1=[];if(_0x1636f5['roles']&&Array['isArray'](_0x1636f5[_0x55aad7(0x148)]))for(let _0x4d7139=0x0;_0x4d7139<_0x1636f5[_0x55aad7(0x148)][_0x55aad7(0x18c)];_0x4d7139++){_0x1636f5[_0x55aad7(0x148)][_0x4d7139][_0x55aad7(0x1e8)]&&_0x1636f5[_0x55aad7(0x148)][_0x4d7139]['operation']==='delete'&&_0x4b9ca1['push'](_0x1636f5['roles'][_0x4d7139]);}if(_0x4b9ca1[_0x55aad7(0x18c)]>0x0)try{await _0x441b67[_0x55aad7(0x1e1)](_0xd3c5e0,_0x29cde1,{'roles':_0x4b9ca1});}catch(_0x9b7612){_0x441b67['logger'][_0x55aad7(0x1b7)](_0x4c414f+_0x55aad7(0x193)+_0x29cde1+_0x55aad7(0x1a6)+_0x9b7612[_0x55aad7(0x227)]);}const _0x53902b=[];if(_0x1636f5[_0x55aad7(0x1cb)]&&Array[_0x55aad7(0x1c7)](_0x1636f5['groups']))for(let _0x78b387=0x0;_0x78b387<_0x1636f5[_0x55aad7(0x1cb)][_0x55aad7(0x18c)];_0x78b387++){_0x1636f5['groups'][_0x78b387][_0x55aad7(0x1e8)]&&_0x1636f5[_0x55aad7(0x1cb)][_0x78b387][_0x55aad7(0x1e8)]==='delete'&&_0x53902b['push'](_0x1636f5['groups'][_0x78b387]);}if(_0x53902b['length']>0x0)for(let _0x5badf6=0x0;_0x5badf6<_0x53902b[_0x55aad7(0x18c)];_0x5badf6++){try{await _0x441b67[_0x55aad7(0x17b)](_0xd3c5e0,_0x53902b[_0x5badf6]['id'],{'members':[{'operation':_0x55aad7(0x12b),'value':_0x29cde1}]});}catch(_0x3f2104){_0x441b67['logger'][_0x55aad7(0x1b7)](_0x4c414f+_0x55aad7(0x193)+_0x29cde1+_0x55aad7(0x1e5)+_0x3f2104[_0x55aad7(0x227)]);}}}if(_0x2d242c['deleteUserOnLastGroupRoleRemoval']&&_0x1821df[_0x55aad7(0x225)]===_0x55aad7(0x1e1)){if(_0x34d1b3[_0x55aad7(0x1cb)]&&Array[_0x55aad7(0x1c7)](_0x34d1b3['groups'])&&_0x34d1b3[_0x55aad7(0x1cb)][_0x55aad7(0x18c)]===0x0){if(_0x34d1b3[_0x55aad7(0x148)]&&Array[_0x55aad7(0x1c7)](_0x34d1b3[_0x55aad7(0x148)])&&_0x34d1b3['roles'][_0x55aad7(0x18c)]===0x0){if(_0x1821df[_0x55aad7(0x133)]&&Array[_0x55aad7(0x1c7)](_0x1821df[_0x55aad7(0x133)])&&_0x1821df[_0x55aad7(0x133)][_0x55aad7(0x18c)]>0x0){let _0x4a5105=![];for(let _0xfb8ad0=0x0;_0xfb8ad0<_0x1821df['Operations'][_0x55aad7(0x18c)];_0xfb8ad0++){const _0x30f659=_0x1821df['Operations'][_0xfb8ad0];if(_0x30f659['op']==='remove'){if(_0x30f659[_0x55aad7(0x1da)]){if(_0x30f659[_0x55aad7(0x1da)][_0x55aad7(0x1f7)](_0x55aad7(0x148))&&_0x30f659['typeId']){_0x4a5105=!![];break;}else{if(_0x30f659[_0x55aad7(0x1da)]===_0x55aad7(0x1cb)){_0x4a5105=!![];break;}}}}}if(_0x4a5105){_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x118)](_0x4c414f+_0x55aad7(0x218)+_0x29cde1);try{await _0x3ad46f(_0xd3c5e0,_0x29cde1);}catch(_0x111537){_0x441b67['logger']['error'](_0x4c414f+_0x55aad7(0x218)+_0x29cde1+_0x55aad7(0x1d0)+_0x111537[_0x55aad7(0x227)]+'}'),_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x118)](_0x4c414f+_0x55aad7(0x117));return;}}}}}}}}_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x118)](_0x4c414f+_0x55aad7(0x117));}catch(_0x31b565){_0x441b67[_0x55aad7(0x156)][_0x55aad7(0x1b7)](_0x441b67['gwName']+'['+_0x441b67[_0x55aad7(0x222)]+_0x55aad7(0x149)+_0xd3c5e0+']['+_0xb4fa13+_0x55aad7(0x167)+_0x31b565['message']+_0x55aad7(0x125));}},_0x35ee19=jetstream(_0x47792e),_0x330474=(_0x2e2d2b(0x19a)+_0x441b67['pluginName']+'_'+_0xd3c5e0)[_0x2e2d2b(0x109)]('*','#')[_0x2e2d2b(0x109)]('>','##')[_0x2e2d2b(0x109)]('.','_'),_0x286a9b=_0xb4fa13[_0x2e2d2b(0x1db)]('.')[0x0]['toUpperCase']()==='GW',_0x479278=async()=>{const _0x2cd471=_0x2e2d2b;try{let _0x28a074;const _0x5af6f7=''+_0x2d242c?.[_0x2cd471(0x12f)]?.['tenant'],_0x52b1a7=await jetstreamManager(_0x47792e),_0x5a7199=async()=>{const _0xa29b83=_0x2cd471;let _0x3b4728;try{_0x3b4728=await _0x35ee19['consumers'][_0xa29b83(0x173)](_0x5af6f7,_0x330474);}catch(_0x57f617){const _0x31dfd8={'durable_name':_0x330474,'deliver_policy':DeliverPolicy[_0xa29b83(0x152)],'ack_policy':AckPolicy[_0xa29b83(0x201)],'filter_subject':_0xb4fa13};await _0x52b1a7[_0xa29b83(0x1e9)][_0xa29b83(0x1f4)](_0x5af6f7,_0x31dfd8),_0x3b4728=await _0x35ee19[_0xa29b83(0x1e9)]['get'](_0x5af6f7,_0x330474);}if(_0x3b4728?.[_0xa29b83(0x1a2)]?.[_0xa29b83(0x217)]?.[_0xa29b83(0x1a8)]!==_0xa29b83(0x143))throw new Error(_0xa29b83(0x223));_0x3b4728?.[_0xa29b83(0x1a2)]?.[_0xa29b83(0x217)]?.[_0xa29b83(0x14f)]!==_0xb4fa13&&(await _0x52b1a7[_0xa29b83(0x1e9)][_0xa29b83(0x19c)](_0x5af6f7,_0x330474,{'filter_subject':_0xb4fa13}),_0x3b4728=await _0x35ee19[_0xa29b83(0x1e9)][_0xa29b83(0x173)](_0x5af6f7,_0x330474)),_0x28a074=await _0x3b4728[_0xa29b83(0x14a)]({'max_messages':0x64}),_0x199c99(_0x28a074);},_0x199c99=async _0xabefb6=>{const _0x15d0ec=_0x2cd471;for await(const _0x588888 of await _0xabefb6['status']()){switch(_0x588888[_0x15d0ec(0x1eb)]){case'consumer_not_found':_0x441b67['logger'][_0x15d0ec(0x126)](_0x441b67[_0x15d0ec(0x231)]+'['+_0x441b67[_0x15d0ec(0x222)]+_0x15d0ec(0x149)+_0xd3c5e0+']['+_0xb4fa13+_0x15d0ec(0x12d)+_0x588888[_0x15d0ec(0x1eb)]),_0x5a7199();return;}}};await _0x5a7199();let _0x3af101=-0x1;do{for await(const _0x312d82 of _0x28a074){if(!_0x312d82[_0x2cd471(0x145)]||!_0x312d82[_0x2cd471(0x145)][_0x2cd471(0x173)](_0x2cd471(0x116))){_0x312d82[_0x2cd471(0x181)]();continue;}_0x3af101=_0x28a074['getProcessed']();const _0x175520=_0x441b67[_0x2cd471(0x231)]+'['+_0x441b67[_0x2cd471(0x222)]+_0x2cd471(0x149)+_0xd3c5e0+']['+_0x312d82[_0x2cd471(0x172)]+']['+_0x3af101+']['+(_0x312d82['headers']?_0x312d82['headers'][_0x2cd471(0x173)]('Msg-Id'):'')+']',_0x1df6ed=_0x312d82[_0x2cd471(0x16c)](),_0x2b5063=await _0x5d1900(_0x175520,_0x1df6ed);if(!_0x2b5063||_0x2b5063!==!![])_0x312d82['ack']();else _0x441b67[_0x2cd471(0x156)][_0x2cd471(0x1b7)](_0x175520+_0x2cd471(0x150));if(_0x3af101<0x1)break;}}while(_0x3af101===0x0);}catch(_0x1df911){_0x441b67[_0x2cd471(0x156)]['error'](_0x441b67[_0x2cd471(0x231)]+'['+_0x441b67[_0x2cd471(0x222)]+']\x20subscriber['+_0xd3c5e0+']['+_0xb4fa13+_0x2cd471(0x17d)+_0x1df911[_0x2cd471(0x227)]);}},_0x744171=async()=>{const _0x4cb41b=_0x2e2d2b,_0x52cdb6=_0x47792e[_0x4cb41b(0x1de)](_0xb4fa13,{'max':0x64});for await(const _0x19b281 of _0x52cdb6){const _0xd22acb=_0x19b281[_0x4cb41b(0x145)][_0x4cb41b(0x173)](_0x4cb41b(0x116));if(!_0x19b281['headers']||!_0xd22acb)continue;const _0x14fa3f=_0x441b67[_0x4cb41b(0x231)]+'['+_0x441b67[_0x4cb41b(0x222)]+']\x20subscriber['+_0xd3c5e0+']['+_0x19b281['subject']+']['+(_0x19b281['headers']?_0xd22acb:'')+']';_0x441b67[_0x4cb41b(0x156)][_0x4cb41b(0x118)](_0x14fa3f+'\x20processing\x20incoming\x20message');const _0x3e5a70={'func':'','id':'','obj':''};let _0x25c255;try{try{_0x25c255=JSON['parse'](_0x19b281[_0x4cb41b(0x16c)]());}catch(_0x32c58d){const _0x1602b8='subscriber\x20message\x20error:\x20message\x20not\x20JSON\x20formatted';_0x441b67[_0x4cb41b(0x156)][_0x4cb41b(0x1b7)](_0x441b67[_0x4cb41b(0x231)]+'['+_0x441b67['pluginName']+']\x20subscriber['+_0xd3c5e0+']['+_0xb4fa13+']\x20'+_0x1602b8+':\x20'+_0x19b281[_0x4cb41b(0x16c)]());throw new Error(_0x1602b8);}const _0x397edd=_0x25c255['ctx'];if(_0x397edd?.[_0x4cb41b(0x220)]?.['id'])_0x3e5a70['id']=_0x397edd[_0x4cb41b(0x220)]['id'];if(_0x397edd?.[_0x4cb41b(0x160)]?.[_0x4cb41b(0x1cf)])_0x3e5a70[_0x4cb41b(0x15a)]=a0_0x197b83[_0x4cb41b(0x131)](_0x397edd[_0x4cb41b(0x160)][_0x4cb41b(0x1cf)]);if(_0x397edd?.['request']?.['headers']?.['authorization']){const _0x4b2c2c=_0x397edd[_0x4cb41b(0x160)][_0x4cb41b(0x145)]['authorization'];if(_0x4b2c2c)_0x397edd[_0x4cb41b(0x160)][_0x4cb41b(0x145)][_0x4cb41b(0x165)]=a0_0x197b83[_0x4cb41b(0x22a)](_0x4b2c2c,_0xd22acb);}if(_0x397edd?.[_0x4cb41b(0x14e)]?.['headers']?.[_0x4cb41b(0x165)]){const _0x353189=_0x397edd[_0x4cb41b(0x14e)][_0x4cb41b(0x145)]['authorization'];if(_0x353189)_0x397edd['passThrough'][_0x4cb41b(0x145)][_0x4cb41b(0x165)]=a0_0x197b83[_0x4cb41b(0x22a)](_0x353189,_0xd22acb);}if(_0x441b67[_0x4cb41b(0x217)]['scimgateway'][_0x4cb41b(0x169)])await _0x31b666(_0x397edd);else{const _0x5957f0=_0x397edd?.['routeObj']?.['method']+'\x20'+_0x397edd?.[_0x4cb41b(0x220)]?.['handle'];_0x3e5a70[_0x4cb41b(0x18f)]=_0x5957f0;switch(_0x5957f0){case _0x4cb41b(0x1f0):case _0x4cb41b(0x154):case _0x4cb41b(0x103):if(_0x397edd['routeObj']['id'])await _0x273e9f[_0x4cb41b(0x1f9)](_0x397edd);else await _0x273e9f[_0x4cb41b(0x212)](_0x397edd);break;case'GET\x20api':await _0x273e9f['getApiHandler'](_0x397edd);break;case'GET\x20schemas':await _0x273e9f[_0x4cb41b(0x115)](_0x397edd);break;case _0x4cb41b(0x180):case _0x4cb41b(0x122):await _0x273e9f[_0x4cb41b(0x1c4)](_0x397edd);break;case _0x4cb41b(0x124):case _0x4cb41b(0x182):await _0x273e9f[_0x4cb41b(0x12e)](_0x397edd);break;case'PATCH\x20api':await _0x273e9f['patchApiHandler'](_0x397edd);break;case _0x4cb41b(0x112):case _0x4cb41b(0x10c):await _0x273e9f[_0x4cb41b(0x209)](_0x397edd);break;case _0x4cb41b(0x1e3):await _0x273e9f[_0x4cb41b(0x1d6)](_0x397edd);break;case _0x4cb41b(0x104):case _0x4cb41b(0x19b):await _0x273e9f[_0x4cb41b(0x187)](_0x397edd);break;case _0x4cb41b(0x20b):await _0x273e9f[_0x4cb41b(0x121)](_0x397edd);break;case _0x4cb41b(0x1d1):case _0x4cb41b(0x1d7):await _0x273e9f[_0x4cb41b(0x157)](_0x397edd);break;case _0x4cb41b(0x1b4):await _0x273e9f[_0x4cb41b(0x1ed)](_0x397edd);break;default:_0x397edd['response']=new Response(_0x4cb41b(0x1ce),{'status':0x194});}}if(!_0x397edd['response'])_0x397edd[_0x4cb41b(0x1c6)]=null;const _0x1ad2e4=JSON[_0x4cb41b(0x1b9)](_0x397edd['response']);_0x19b281['respond'](_0x1ad2e4),_0x441b67[_0x4cb41b(0x156)][_0x4cb41b(0x126)](_0x14fa3f+_0x4cb41b(0x144)+_0x3e5a70[_0x4cb41b(0x18f)]+',\x20obj='+(_0x3e5a70[_0x4cb41b(0x15a)]?JSON[_0x4cb41b(0x1b9)](_0x3e5a70[_0x4cb41b(0x15a)]):'')+_0x4cb41b(0x130)+(_0x3e5a70['id']?_0x3e5a70['id']:'')+_0x4cb41b(0x1b6)+_0x1ad2e4);}catch(_0x44b971){const _0x13afca=_0x4cb41b(0x1c5)+_0x44b971[_0x4cb41b(0x227)]+_0x4cb41b(0x10a)+_0x44b971[_0x4cb41b(0x13a)]+'\x22}';_0x19b281[_0x4cb41b(0x111)](_0x13afca),_0x441b67['logger'][_0x4cb41b(0x126)]((_0x14fa3f||'')+_0x4cb41b(0x144)+_0x3e5a70['func']+_0x4cb41b(0x19f)+(_0x3e5a70[_0x4cb41b(0x15a)]?JSON['stringify'](_0x3e5a70['obj']):'')+_0x4cb41b(0x130)+(_0x3e5a70['id']?_0x3e5a70['id']:'')+_0x4cb41b(0x1f2)+_0x13afca);}}};if(_0x286a9b)_0x744171();else _0x479278();},_0x49faf8=async(_0x2d4ea4,_0x5d55b0)=>{const _0x38d514=_0x47219f,_0x513e13=_0x5f661d[_0x2d4ea4][_0x38d514(0x217)]?.[_0x38d514(0x12f)]?.[_0x38d514(0x172)];let _0xbb792a=0x0;for await(const _0x55036a of _0x5d55b0[_0x38d514(0x202)]()){switch(_0x55036a[_0x38d514(0x1eb)]){case _0x38d514(0x191):_0x441b67[_0x38d514(0x156)]['error'](_0x441b67[_0x38d514(0x231)]+'['+_0x441b67[_0x38d514(0x222)]+_0x38d514(0x149)+_0x2d4ea4+']['+_0x513e13+_0x38d514(0x158)+_0x55036a[_0x38d514(0x11f)]+_0x38d514(0x1b5)),_0xbb792a=0x0;break;case'reconnect':_0x441b67['logger'][_0x38d514(0x126)](_0x441b67[_0x38d514(0x231)]+'['+_0x441b67['pluginName']+']\x20subscriber['+_0x2d4ea4+']['+_0x513e13+_0x38d514(0x20f)+_0x55036a[_0x38d514(0x11f)]);break;case _0x38d514(0x1b7):_0x441b67[_0x38d514(0x156)][_0x38d514(0x1b7)](_0x441b67['gwName']+'['+_0x441b67[_0x38d514(0x222)]+_0x38d514(0x149)+_0x2d4ea4+']['+_0x513e13+_0x38d514(0x1e2)+_0x55036a[_0x38d514(0x11f)]);break;case'reconnecting':_0xbb792a+=0x1;_0xbb792a%0x1e===0x0&&_0x441b67[_0x38d514(0x156)][_0x38d514(0x118)](_0x441b67['gwName']+'['+_0x441b67['pluginName']+_0x38d514(0x149)+_0x2d4ea4+']['+_0x513e13+']\x20client\x20is\x20attempting\x20to\x20reconnect\x20'+_0x55036a[_0x38d514(0x11f)]+_0x38d514(0x17a)+_0xbb792a+')');break;case _0x38d514(0x163):_0x441b67[_0x38d514(0x156)]['debug'](_0x441b67[_0x38d514(0x231)]+'['+_0x441b67['pluginName']+_0x38d514(0x149)+_0x2d4ea4+']['+_0x513e13+_0x38d514(0x230)+_0x55036a[_0x38d514(0x11f)]);break;}}};process['on'](_0x47219f(0x1a5),async()=>{const _0x1ea7c8=_0x47219f;for(const _0x178020 in _0x5f661d){_0x5f661d[_0x178020]['nc']&&!_0x5f661d[_0x178020]['nc'][_0x1ea7c8(0x13e)]()&&await _0x5f661d[_0x178020]['nc']['drain']();}}),process['on']('SIGINT',async()=>{const _0x5a6bb1=_0x47219f;for(const _0x237409 in _0x5f661d){_0x5f661d[_0x237409]['nc']&&!_0x5f661d[_0x237409]['nc'][_0x5a6bb1(0x13e)]()&&await _0x5f661d[_0x237409]['nc'][_0x5a6bb1(0x1c1)]();}});const _0x3f85b2=async(_0x502ca1,_0xf679c9,_0x560038)=>{const _0x53de9a=_0x47219f,_0x1a0583={'attribute':_0xf679c9,'operator':'eq','value':_0x560038,'rawFilter':undefined,'startIndex':undefined,'count':undefined},_0x364979=[_0xf679c9];if(_0xf679c9!=='id')_0x364979[_0x53de9a(0x175)]('id');try{const _0x492c57=await _0x2938b3(_0x502ca1,_0x1a0583,_0x364979);if(!_0x492c57||!_0x492c57['Resources']||!Array[_0x53de9a(0x1c7)](_0x492c57['Resources']))throw new Error(_0x53de9a(0x146)+JSON[_0x53de9a(0x1b9)](_0x1a0583)+_0x53de9a(0x107));if(_0x492c57[_0x53de9a(0x1ef)][_0x53de9a(0x18c)]===0x0)return null;else{if(_0x492c57[_0x53de9a(0x1ef)][_0x53de9a(0x18c)]>0x2)throw new Error('getUsers()\x20getObj='+JSON[_0x53de9a(0x1b9)](_0x1a0583)+_0x53de9a(0x190));else{const _0x7cabca=_0x492c57[_0x53de9a(0x1ef)][0x0];if(!_0x7cabca['id'])throw new Error(_0x53de9a(0x146)+JSON['stringify'](_0x1a0583)+'\x20result='+JSON['stringify'](_0x7cabca)+_0x53de9a(0x22f));return decodeURIComponent(_0x7cabca['id']);}}}catch(_0x2ab195){throw new Error(_0x53de9a(0x146)+JSON[_0x53de9a(0x1b9)](_0x1a0583)+'\x20error:\x20'+_0x2ab195[_0x53de9a(0x227)]+'}');}},_0x2938b3=async(_0x4a23d8,_0x46ec00,_0x16bcc4)=>{const _0x2f28b6=_0x47219f;if(!_0x591fdb)return await _0x441b67[_0x2f28b6(0x1ec)](_0x4a23d8,_0x46ec00,_0x16bcc4);if(!_0x46ec00?.[_0x2f28b6(0x189)]||_0x46ec00[_0x2f28b6(0x189)]!=='eq')throw new Error('getUsers()\x20error:\x20unsupported\x20operator\x20for\x20getObj:\x20'+JSON[_0x2f28b6(0x1b9)](_0x46ec00));if(_0x4a23d8==='undefined')_0x4a23d8=undefined;let _0x7e3fca=_0x4a23d8?'/'+_0x4a23d8+_0x2f28b6(0x1d2):'/Users';if(_0x46ec00['attribute']==='id'){_0x7e3fca+='/'+_0x46ec00[_0x2f28b6(0x224)];if(_0x16bcc4&&_0x16bcc4[_0x2f28b6(0x18c)]>0x0)_0x7e3fca+=_0x2f28b6(0x20c)+_0x16bcc4['join'](',');}else{if(_0x46ec00['attribute']===_0x2f28b6(0x22d)){_0x7e3fca+='?filter=userName\x20eq\x20\x22'+_0x46ec00[_0x2f28b6(0x224)]+'\x22';if(_0x16bcc4&&_0x16bcc4[_0x2f28b6(0x18c)]>0x0)_0x7e3fca+=_0x2f28b6(0x1af)+_0x16bcc4[_0x2f28b6(0x1ea)](',');}else{if(_0x46ec00[_0x2f28b6(0x1dd)]==='externalId'){_0x7e3fca+=_0x2f28b6(0x1a0)+_0x46ec00[_0x2f28b6(0x224)]+'\x22';if(_0x16bcc4&&_0x16bcc4[_0x2f28b6(0x18c)]>0x0)_0x7e3fca+=_0x2f28b6(0x1af)+_0x16bcc4[_0x2f28b6(0x1ea)](',');}else throw new Error('getUsers()\x20error:\x20unsupported\x20operator\x20for\x20getObj:\x20'+JSON['stringify'](_0x46ec00));}}return await _0x2ffa50(_0x4a23d8,_0x2f28b6(0x21c),_0x7e3fca);},_0x286a0c=async(_0x4a0011,_0x8cf4af)=>{const _0x478360=_0x47219f;if(!_0x591fdb)return await _0x441b67['createUser'](_0x4a0011,_0x8cf4af);if(_0x4a0011===_0x478360(0x135))_0x4a0011=undefined;const _0x331656=_0x4a0011?'/'+_0x4a0011+'/Users':_0x478360(0x1d2);return await _0x2ffa50(_0x4a0011,_0x478360(0x205),_0x331656,_0x8cf4af);},_0x9718bd=async(_0x56a312,_0x3146b7,_0x27474c,_0x486567,_0x2d5bcd)=>{const _0x54168f=_0x47219f;if(!_0x56a312||_0x56a312[_0x54168f(0x183)]()!==_0x54168f(0x151))throw new Error(_0x54168f(0x16b));if(!_0x591fdb)return await _0x273e9f[_0x54168f(0x192)]('Users',_0x3146b7,_0x27474c,_0x486567,_0x2d5bcd);if(_0x3146b7===_0x54168f(0x135))_0x3146b7=undefined;const _0x1f77f5=_0x3146b7?'/'+_0x3146b7+_0x54168f(0x170)+_0x27474c:_0x54168f(0x170)+_0x27474c;return await _0x2ffa50(_0x3146b7,'PUT',_0x1f77f5,_0x486567);},_0x3ad46f=async(_0x43fe5d,_0x47a753)=>{const _0x3bfc38=_0x47219f;!_0x591fdb&&await _0x441b67[_0x3bfc38(0x221)](_0x43fe5d,_0x47a753);if(_0x43fe5d===_0x3bfc38(0x135))_0x43fe5d=undefined;const _0x5eddfa=_0x43fe5d?'/'+_0x43fe5d+_0x3bfc38(0x170)+_0x47a753:_0x3bfc38(0x170)+_0x47a753;return await _0x2ffa50(_0x43fe5d,_0x3bfc38(0x1cc),_0x5eddfa);},_0x21e23a=_0x5e0b11=>{const _0x395bba=_0x47219f;if(!_0x5e0b11||typeof _0x5e0b11!==_0x395bba(0x16c))return[null,null];_0x5e0b11=_0x5e0b11[_0x395bba(0x134)]();const _0x5f5db6=_0x5e0b11[_0x395bba(0x11a)]('(');if(_0x5f5db6<0x1)return[null,null];if(_0x5e0b11[_0x395bba(0x14b)](_0x5e0b11[_0x395bba(0x18c)]-0x1)!==')')return[null,null];if(_0x491ad9(_0x5e0b11,'(')!==_0x491ad9(_0x5e0b11,')'))return[null,null];const _0x56ad4b=_0x5e0b11[_0x395bba(0x14b)](0x0,_0x5f5db6),_0x4d69df=_0x5e0b11[_0x395bba(0x14b)](_0x5f5db6+0x1,_0x5e0b11[_0x395bba(0x18c)]-0x1);let _0x44b29b=[];const _0x6fb05d=_0x4d69df[_0x395bba(0x1db)](',');let _0x584ca8='';for(let _0x1249bd=0x0;_0x1249bd<_0x6fb05d[_0x395bba(0x18c)];_0x1249bd++){const _0x1a434b=_0x584ca8?_0x584ca8+','+_0x6fb05d[_0x1249bd]:_0x6fb05d[_0x1249bd],_0xbb1d1f=_0x491ad9(_0x1a434b,'('),_0x40cff4=_0x491ad9(_0x1a434b,')');if(_0xbb1d1f===_0x40cff4)_0x44b29b[_0x395bba(0x175)](_0xf40172(_0x1a434b,'\x22')),_0x584ca8='';else{if(_0x584ca8)_0x584ca8+=','+_0x6fb05d[_0x1249bd];else _0x584ca8+=_0x6fb05d[_0x1249bd];}}if(_0x44b29b[_0x395bba(0x18c)]===0x0)_0x44b29b=null;return[_0x56ad4b,_0x44b29b];};function _0x491ad9(_0x4de6b3,_0x5bebed){const _0xdaeb7d=_0x47219f;let _0x13c27a=0x0;for(let _0x1d3598=0x0;_0x1d3598<_0x4de6b3[_0xdaeb7d(0x18c)];_0x1d3598++){_0x4de6b3[_0xdaeb7d(0x128)](_0x1d3598)===_0x5bebed&&(_0x13c27a+=0x1);}return _0x13c27a;}const _0xf40172=(_0x23508b,_0x25a70a)=>{const _0x4bff2a=_0x47219f;if(typeof _0x23508b!=='string'||typeof _0x25a70a!==_0x4bff2a(0x16c))return _0x23508b;if(_0x23508b['length']===0x1)return _0x23508b;if(_0x25a70a[_0x4bff2a(0x18c)]!==0x1)return _0x23508b;return _0x23508b=_0x23508b[_0x4bff2a(0x134)](),_0x23508b[_0x4bff2a(0x14b)](0x0,0x1)===_0x25a70a&&(_0x23508b=_0x23508b[_0x4bff2a(0x14b)](0x1)),_0x23508b[_0x4bff2a(0x14b)](_0x23508b['length']-0x1)===_0x25a70a&&(_0x23508b=_0x23508b[_0x4bff2a(0x14b)](0x0,_0x23508b[_0x4bff2a(0x18c)]-0x1)),_0x23508b;},_0x1fe768=async(_0x17cc03,_0x364119,_0x42a811,_0x13cea3)=>{const _0x5d6d08=_0x47219f;if(!_0x364119||!_0x42a811||!_0x13cea3)return null;const [_0x3460f3,_0x1d5aa3]=_0x21e23a(_0x13cea3);if(!_0x3460f3||!_0x1d5aa3){const _0x1f9f18=_0x13cea3[_0x5d6d08(0x1db)]('(');if(_0x1f9f18[_0x5d6d08(0x18c)]>0x1){const _0x16760f=[_0x5d6d08(0x15c),_0x5d6d08(0x185),_0x5d6d08(0x1ba),_0x5d6d08(0x20d),_0x5d6d08(0x1ea),_0x5d6d08(0x1c3),_0x5d6d08(0x1c8),_0x5d6d08(0x195),_0x5d6d08(0x171)],_0x237e6f=_0x1f9f18[0x0][_0x5d6d08(0x183)]();if(_0x16760f[_0x5d6d08(0x199)](_0x237e6f))return null;}return _0x13cea3;}for(let _0xd773e6=0x0;_0xd773e6<_0x1d5aa3['length'];_0xd773e6++){if(_0x1d5aa3[_0xd773e6][_0x5d6d08(0x14b)](0x0,0x1)==='['){const _0x5797f8=_0x1d5aa3[_0xd773e6][_0x5d6d08(0x11a)](']');if(_0x5797f8<0x0)return null;const _0x438c6f=_0x1d5aa3[_0xd773e6][_0x5d6d08(0x14b)](0x1,_0x5797f8),_0x5d142a=_0x438c6f['split']('.');let _0xb886bc;for(let _0x34a18c=0x0;_0x34a18c<_0x5d142a[_0x5d6d08(0x18c)];_0x34a18c++){if(_0x34a18c===0x0)_0xb886bc=_0x364119[_0x5d142a[_0x34a18c]];else{if(!_0xb886bc)return null;_0xb886bc=_0xb886bc[_0x5d142a[_0x34a18c]];}}if(!_0xb886bc)return null;_0x1d5aa3[_0xd773e6]=_0xb886bc;}}for(let _0x5db66c=0x0;_0x5db66c<_0x1d5aa3[_0x5d6d08(0x18c)];_0x5db66c++){const [_0x2a1215]=_0x21e23a(_0x1d5aa3[_0x5db66c]);_0x2a1215&&(_0x1d5aa3[_0x5db66c]=await _0x1fe768(_0x17cc03,_0x364119,_0x42a811,_0x1d5aa3[_0x5db66c]));}if(_0x1d5aa3[0x0]===null)return null;switch(_0x3460f3[_0x5d6d08(0x183)]()){case'lowercase':{if(_0x1d5aa3[_0x5d6d08(0x18c)]!==0x1)return null;const [_0x3d034e]=_0x21e23a(_0x1d5aa3[0x0]);if(_0x3d034e)_0x1d5aa3[0x0]=await _0x1fe768(_0x17cc03,_0x364119,_0x42a811,_0x3d034e);if(_0x1d5aa3[0x0]===null)return null;return _0x1d5aa3[0x0][_0x5d6d08(0x183)]();}case _0x5d6d08(0x185):{if(_0x1d5aa3[_0x5d6d08(0x18c)]!==0x1)return null;const [_0x158f21]=_0x21e23a(_0x1d5aa3[0x0]);if(_0x158f21)_0x1d5aa3[0x0]=await _0x1fe768(_0x17cc03,_0x364119,_0x42a811,_0x158f21);if(_0x1d5aa3[0x0]===null)return null;return _0x1d5aa3[0x0][_0x5d6d08(0x16d)]();}case'firstn':{if(_0x1d5aa3[_0x5d6d08(0x18c)]!==0x2)return null;const [_0x313be7]=_0x21e23a(_0x1d5aa3[0x0]);if(_0x313be7)_0x1d5aa3[0x0]=await _0x1fe768(_0x17cc03,_0x364119,_0x42a811,_0x313be7);if(_0x1d5aa3[0x0]===null)return null;if(isNaN(_0x1d5aa3[0x1]))return null;return _0x1d5aa3[0x0][_0x5d6d08(0x14b)](0x0,_0x1d5aa3[0x1]);}case'elementnumber':{const [_0x13f07e]=_0x21e23a(_0x1d5aa3[0x0]);if(_0x1d5aa3[_0x5d6d08(0x18c)]<0x2)return null;if(_0x13f07e)_0x1d5aa3[0x0]=await _0x1fe768(_0x17cc03,_0x364119,_0x42a811,_0x13f07e);if(_0x1d5aa3[0x0]===null)return null;const _0xf4fbd1=_0x1d5aa3[0x1];if(isNaN(_0xf4fbd1))return null;let _0x4eada0;if(_0x1d5aa3[_0x5d6d08(0x18c)]===0x3)_0x4eada0=_0x1d5aa3[0x0][_0x5d6d08(0x1db)](_0x1d5aa3[0x2]);else _0x4eada0=_0x4eada0=_0x1d5aa3[0x0][_0x5d6d08(0x1db)]('\x20');if(_0xf4fbd1<=_0x4eada0[_0x5d6d08(0x18c)])return _0x4eada0[_0xf4fbd1-0x1];else return'';}case'replace':{const [_0x133152]=_0x21e23a(_0x1d5aa3[0x0]);if(_0x133152)_0x1d5aa3[0x0]=await _0x1fe768(_0x17cc03,_0x364119,_0x42a811,_0x133152);if(_0x1d5aa3[0x0]===null)return null;if(_0x1d5aa3['length']!==0x3)return null;return _0x1d5aa3[0x0][_0x5d6d08(0x109)](_0x1d5aa3[0x1],_0x1d5aa3[0x2]);}case'normalize':{if(_0x1d5aa3[_0x5d6d08(0x18c)]!==0x1)return null;const [_0x7c1f1c]=_0x21e23a(_0x1d5aa3[0x0]);if(_0x7c1f1c)_0x1d5aa3[0x0]=await _0x1fe768(_0x17cc03,_0x364119,_0x42a811,_0x7c1f1c);if(_0x1d5aa3[0x0]===null)return null;return a0_0x3ae810[_0x5d6d08(0x17e)](_0x1d5aa3[0x0]);}case _0x5d6d08(0x1ea):{let _0x1b08e4='';for(let _0x3aa763=0x0;_0x3aa763<_0x1d5aa3[_0x5d6d08(0x18c)];_0x3aa763++){const [_0x31487a]=_0x21e23a(_0x1d5aa3[_0x3aa763]);if(_0x31487a)_0x1d5aa3[_0x3aa763]=await _0x1fe768(_0x17cc03,_0x364119,_0x42a811,_0x31487a);if(_0x1d5aa3[_0x3aa763]===null)return null;_0x1b08e4+=_0x1d5aa3[_0x3aa763];}return _0x1b08e4;}case _0x5d6d08(0x195):{if(_0x1d5aa3['length']>0x2)return null;const [_0x1c16fa]=_0x21e23a(_0x1d5aa3[0x0]);if(_0x1c16fa)_0x1d5aa3[0x0]=await _0x1fe768(_0x17cc03,_0x364119,_0x42a811,_0x1c16fa);if(_0x1d5aa3[0x0]===null)return null;const _0x36de28=parseInt(_0x1d5aa3[0x0]);if(isNaN(_0x36de28))return null;let _0x58cbf0=_0x5d6d08(0x18d);_0x58cbf0+=','+_0x1d5aa3[0x0];if(_0x1d5aa3[_0x5d6d08(0x18c)]===0x2&&_0x1d5aa3[0x1][_0x5d6d08(0x183)]()===_0x5d6d08(0x114))_0x58cbf0+=',true';else _0x58cbf0+=_0x5d6d08(0x17c);return _0x58cbf0+='##',_0x58cbf0;}case _0x5d6d08(0x171):{if(_0x1d5aa3[_0x5d6d08(0x18c)]!==0x1)return null;const [_0x2e9e3a]=_0x21e23a(_0x1d5aa3[0x0]);if(_0x2e9e3a)_0x1d5aa3[0x0]=await _0x1fe768(_0x17cc03,_0x364119,_0x42a811,_0x2e9e3a);if(_0x1d5aa3[0x0]===null)return null;let _0x3e97c0,_0x55252e=![],_0x257973='';const _0x3d75e2=_0x1d5aa3[0x0]['split']('##');if(_0x3d75e2[_0x5d6d08(0x18c)]>0x2)for(let _0x5b628d=0x0;_0x5b628d<_0x3d75e2[_0x5d6d08(0x18c)];_0x5b628d++){if(_0x3d75e2[_0x5b628d][_0x5d6d08(0x1f7)]('doIncrement')){const _0x4ec8b4=_0x3d75e2[_0x5b628d][_0x5d6d08(0x1db)](',');if(_0x4ec8b4[_0x5d6d08(0x18c)]<0x2)return null;const _0x4a724f=parseInt(_0x4ec8b4[0x1]);if(isNaN(_0x4a724f))return null;_0x257973='##'+_0x3d75e2[_0x5b628d]+'##',_0x3e97c0=_0x4ec8b4[0x1],_0x4ec8b4[_0x5d6d08(0x18c)]>0x2&&(_0x55252e=_0x4ec8b4[0x2][_0x5d6d08(0x183)]()===_0x5d6d08(0x114));}}let _0x12d69d,_0x1cca43=0x0,_0x2d60dd=0x0;if(_0x3e97c0){_0x2d60dd=_0x3e97c0[_0x5d6d08(0x18c)],_0x1cca43=0xa;for(let _0x13e2aa=0x1;_0x13e2aa<_0x2d60dd;_0x13e2aa++){_0x1cca43*=0xa;}_0x1cca43-=0x1,_0x12d69d=parseInt(_0x3e97c0);if(isNaN(_0x12d69d))return null;_0x12d69d-=0x1;}else _0x12d69d=0x0;do{_0x12d69d+=0x1;let _0x57e5f4=_0x1d5aa3[0x0];if(_0x3e97c0!==undefined&&_0x257973){let _0x48586f=_0x12d69d[_0x5d6d08(0x120)]();while(_0x48586f['length']<_0x2d60dd){_0x48586f='0'+_0x48586f;}_0x55252e?_0x57e5f4=_0x57e5f4[_0x5d6d08(0x1c3)](_0x257973,_0x48586f):(_0x57e5f4=_0x57e5f4['replace'](_0x257973,''),_0x55252e=!![],_0x12d69d-=0x1);}try{const _0x329018=await _0x3f85b2(_0x17cc03,_0x42a811,_0x57e5f4);if(!_0x329018)return _0x57e5f4;}catch(_0x497207){return _0x441b67[_0x5d6d08(0x156)][_0x5d6d08(0x1b7)](_0x441b67[_0x5d6d08(0x231)]+'['+_0x441b67[_0x5d6d08(0x222)]+']\x20'+_0x3460f3+'\x20getUserId()\x20error:\x20'+_0x497207['message']),null;}}while(_0x12d69d<_0x1cca43);return null;}default:}return null;},_0x47e534=async(_0x37bedf,_0x375bec)=>{const _0x37104b=_0x47219f;for(const _0x5b7fe6 in _0x375bec){const _0x1497bb=_0x375bec[_0x5b7fe6],[_0x32552a,_0x5741c3]=_0x21e23a(_0x1497bb);if(_0x32552a){const _0x3dc929=''+_0x5b7fe6,_0x162157=_0x32552a+'('+_0x5741c3['join'](',')+')',_0x5180bc=await _0x1fe768(_0x37bedf,_0x375bec,_0x3dc929,_0x162157);if(_0x5180bc===null)delete _0x375bec[_0x5b7fe6];else _0x375bec[_0x5b7fe6]=_0x5180bc;}for(const _0x3a532d in _0x1497bb){const _0x4b77a3=_0x1497bb[_0x3a532d],[_0x7adc90,_0x3f4e82]=_0x21e23a(_0x4b77a3);if(_0x7adc90){const _0x138308=_0x5b7fe6+'.'+_0x3a532d,_0x3588ea=_0x7adc90+'('+_0x3f4e82[_0x37104b(0x1ea)](',')+')',_0x26dfa6=await _0x1fe768(_0x37bedf,_0x375bec,_0x138308,_0x3588ea);if(_0x26dfa6===null)delete _0x1497bb[_0x3a532d];else _0x1497bb[_0x3a532d]=_0x26dfa6;}}}return _0x375bec;},_0x2ffa50=async(_0x5b81f1,_0x32ea05,_0x4a11d7,_0x12741d)=>{const _0x4286dd=_0x47219f;if(!_0x591fdb)throw new Error(_0x4286dd(0x176));if(!_0x56f56b)throw new Error('subscriber\x20using\x20remote\x20gateway\x20through\x20chainingBaseUrl\x20requires\x20either\x20auth.tokenBearer\x20or\x20auth.basic\x20to\x20be\x20configured');try{if(!_0x441b67[_0x4286dd(0x1df)])_0x441b67[_0x4286dd(0x1df)]=_0x441b67[_0x4286dd(0x215)]();const _0x262db6={'headers':{'Authorization':_0x56f56b}},_0x17748b=await _0x441b67[_0x4286dd(0x1df)]['doRequest'](undefined,_0x32ea05,_0x591fdb+_0x4a11d7,_0x12741d,undefined,_0x262db6);return _0x17748b[_0x4286dd(0x1cf)];}catch(_0x46656a){try{const _0x16c391=JSON[_0x4286dd(0x1b8)](_0x46656a['message']);if(_0x16c391['body'])throw new Error(JSON[_0x4286dd(0x1b9)](_0x16c391['body']));throw new Error(_0x46656a['message']);}catch(_0x3db80d){throw new Error(_0x4286dd(0x164)+_0x3db80d[_0x4286dd(0x227)]);}}},_0x31b666=async _0x4e00c6=>{const _0x23af70=_0x47219f,_0x5e5cc5=_0x441b67[_0x23af70(0x217)][_0x23af70(0x141)][_0x23af70(0x169)];if(!_0x5e5cc5){_0x4e00c6[_0x23af70(0x1c6)]['status']=0x1f4,_0x441b67[_0x23af70(0x156)][_0x23af70(0x1b7)](_0x441b67['gwName']+'['+_0x441b67[_0x23af70(0x222)]+_0x23af70(0x1ca));return;}try{new URL(_0x5e5cc5);}catch(_0x988289){_0x4e00c6['response'][_0x23af70(0x202)]=0x1f4,_0x441b67[_0x23af70(0x156)]['error'](_0x441b67['gwName']+'['+_0x441b67[_0x23af70(0x222)]+_0x23af70(0x174)+_0x988289['message']);return;}try{if(!_0x441b67[_0x23af70(0x1df)])_0x441b67['helperRest']=_0x441b67[_0x23af70(0x215)]();const _0x5b6ed1=new URL(_0x4e00c6[_0x23af70(0x160)][_0x23af70(0x1ff)]),_0x2066a3=_0x4e00c6[_0x23af70(0x160)][_0x23af70(0x1a3)],_0x3a7919=_0x4e00c6['request'][_0x23af70(0x1ff)]['replace'](_0x5b6ed1[_0x23af70(0x1b0)],_0x5e5cc5),_0x6b29f9=_0x4e00c6[_0x23af70(0x160)][_0x23af70(0x1cf)],_0x4da6e8={'headers':{'Authorization':_0x4e00c6[_0x23af70(0x160)]['headers']['authorization']}},_0x3eedda=await _0x441b67[_0x23af70(0x1df)][_0x23af70(0x1b1)](_0x23af70(0x135),_0x2066a3,_0x3a7919,_0x6b29f9,undefined,_0x4da6e8);_0x4e00c6['response'][_0x23af70(0x202)]=_0x3eedda[_0x23af70(0x22c)];try{_0x4e00c6[_0x23af70(0x1c6)][_0x23af70(0x1cf)]=JSON['stringify'](_0x3eedda[_0x23af70(0x1cf)]);}catch(_0x5d2d26){_0x4e00c6[_0x23af70(0x1c6)][_0x23af70(0x1cf)]=_0x3eedda['body'];}}catch(_0x5ec733){try{const _0xd0add5=JSON[_0x23af70(0x1b8)](_0x5ec733[_0x23af70(0x227)]);_0x4e00c6['response'][_0x23af70(0x202)]=_0xd0add5?.[_0x23af70(0x1cf)]?.['status']||_0xd0add5?.[_0x23af70(0x22c)]||0x1f4,_0x4e00c6[_0x23af70(0x1c6)]['body']=_0xd0add5[_0x23af70(0x1cf)]?JSON[_0x23af70(0x1b9)](_0xd0add5[_0x23af70(0x1cf)]):_0x5ec733[_0x23af70(0x227)];}catch(_0x1796fe){_0x4e00c6[_0x23af70(0x1c6)][_0x23af70(0x202)]=0x1f4,_0x441b67[_0x23af70(0x156)]['error'](_0x441b67[_0x23af70(0x231)]+'['+_0x441b67[_0x23af70(0x222)]+_0x23af70(0x16a)+_0x5ec733['message']);}}};}}export class Publisher{constructor(_0x34a17d){const _0x2821b2=a0_0x34a9,_0xdf5cee=_0x34a17d,_0x1135bc={},_0x57c9e7=async(_0x238fd1,_0x520cd1)=>{const _0x532dfc=a0_0x34a9,_0x42536e=_0x1135bc[_0x238fd1]['config']?.[_0x532dfc(0x12f)]?.['subject'];let _0x1b2219=0x0;for await(const _0x257a56 of _0x520cd1[_0x532dfc(0x202)]()){switch(_0x257a56[_0x532dfc(0x1eb)]){case'disconnect':_0xdf5cee[_0x532dfc(0x156)]['error'](_0xdf5cee['gwName']+'['+_0xdf5cee['pluginName']+_0x532dfc(0x1d4)+_0x238fd1+']['+_0x42536e+_0x532dfc(0x158)+_0x257a56[_0x532dfc(0x11f)]+_0x532dfc(0x1b5)),_0x1b2219=0x0;break;case'reconnect':_0xdf5cee['logger'][_0x532dfc(0x126)](_0xdf5cee['gwName']+'['+_0xdf5cee['pluginName']+_0x532dfc(0x1d4)+_0x238fd1+']['+_0x42536e+_0x532dfc(0x20f)+_0x257a56['data']);break;case _0x532dfc(0x1b7):_0xdf5cee['logger'][_0x532dfc(0x1b7)](_0xdf5cee['gwName']+'['+_0xdf5cee[_0x532dfc(0x222)]+_0x532dfc(0x1d4)+_0x238fd1+']['+_0x42536e+']\x20client\x20error\x20'+_0x257a56[_0x532dfc(0x11f)]);break;case _0x532dfc(0x123):_0x1b2219+=0x1;_0x1b2219%0x1e===0x0&&_0xdf5cee[_0x532dfc(0x156)]['debug'](_0xdf5cee[_0x532dfc(0x231)]+'['+_0xdf5cee[_0x532dfc(0x222)]+_0x532dfc(0x1d4)+_0x238fd1+']['+_0x42536e+_0x532dfc(0x108)+_0x257a56[_0x532dfc(0x11f)]+_0x532dfc(0x17a)+_0x1b2219+')');break;case _0x532dfc(0x163):_0xdf5cee['logger'][_0x532dfc(0x118)](_0xdf5cee[_0x532dfc(0x231)]+'['+_0xdf5cee[_0x532dfc(0x222)]+']\x20publisher['+_0x238fd1+']['+_0x42536e+_0x532dfc(0x230)+_0x257a56[_0x532dfc(0x11f)]);break;}}},_0x58b20e=async(_0x164c19,_0x3918c0)=>{const _0x2b2ff1=a0_0x34a9,_0x180dc2=_0x1135bc[_0x164c19]['config']?.[_0x2b2ff1(0x12f)]?.[_0x2b2ff1(0x172)];let _0xc2c572;try{_0xc2c572=await a0_0xa30659(_0x3918c0);if(_0xc2c572[_0x2b2ff1(0x126)][_0x2b2ff1(0x1aa)]!==_0x2b2ff1(0x1bb)){_0xc2c572[_0x2b2ff1(0x1fe)]();return;}_0x1135bc[_0x164c19]['nc']=_0xc2c572,_0x57c9e7(_0x164c19,_0xc2c572);}catch(_0x5626b5){_0xdf5cee[_0x2b2ff1(0x156)][_0x2b2ff1(0x1b7)](_0xdf5cee[_0x2b2ff1(0x231)]+'['+_0xdf5cee[_0x2b2ff1(0x222)]+_0x2b2ff1(0x1d4)+_0x164c19+']['+_0x180dc2+_0x2b2ff1(0x110)+_0x5626b5['message']+_0x2b2ff1(0x1a1)),_0x3918c0[_0x2b2ff1(0x139)]=!![];try{_0xc2c572=await a0_0xa30659(_0x3918c0);if(_0xc2c572[_0x2b2ff1(0x126)][_0x2b2ff1(0x1aa)]!==_0x2b2ff1(0x1bb)){_0xc2c572[_0x2b2ff1(0x1fe)]();return;}_0x1135bc[_0x164c19]['nc']=_0xc2c572,_0x57c9e7(_0x164c19,_0xc2c572);}catch(_0x2521e){_0xdf5cee[_0x2b2ff1(0x156)][_0x2b2ff1(0x1b7)](_0xdf5cee[_0x2b2ff1(0x231)]+'['+_0xdf5cee[_0x2b2ff1(0x222)]+']\x20publisher['+_0x164c19+']['+_0x180dc2+_0x2b2ff1(0x110)+_0x2521e[_0x2b2ff1(0x227)]);return;}}_0xdf5cee[_0x2b2ff1(0x156)][_0x2b2ff1(0x118)](_0xdf5cee[_0x2b2ff1(0x231)]+'['+_0xdf5cee[_0x2b2ff1(0x222)]+']\x20publisher['+_0x164c19+']['+_0x180dc2+']\x20connected\x20'+(_0x3918c0[_0x2b2ff1(0x140)]['ca']?_0x2b2ff1(0x140):'')+'\x20'+_0xc2c572[_0x2b2ff1(0x1cd)]()),_0xc2c572[_0x2b2ff1(0x132)]()[_0x2b2ff1(0x18b)](_0x51a041=>{const _0x1d5c7c=_0x2b2ff1;_0x51a041&&_0xdf5cee[_0x1d5c7c(0x156)]['error'](_0xdf5cee[_0x1d5c7c(0x231)]+'['+_0xdf5cee[_0x1d5c7c(0x222)]+_0x1d5c7c(0x1d4)+_0x164c19+']['+_0x180dc2+_0x1d5c7c(0x119)+_0x51a041[_0x1d5c7c(0x227)]);});};this[_0x2821b2(0x1f4)]=async(_0x4731e4,_0x20c1b6)=>{const _0x2e16a3=_0x2821b2;if(!_0x20c1b6?.[_0x2e16a3(0x12f)]){_0xdf5cee[_0x2e16a3(0x156)][_0x2e16a3(0x1b7)](_0xdf5cee[_0x2e16a3(0x231)]+'['+_0xdf5cee[_0x2e16a3(0x222)]+_0x2e16a3(0x1d4)+_0x4731e4+_0x2e16a3(0x1dc));return;}if(!_0x20c1b6?.[_0x2e16a3(0x12f)]?.[_0x2e16a3(0x21f)]){_0xdf5cee[_0x2e16a3(0x156)][_0x2e16a3(0x1b7)](_0xdf5cee[_0x2e16a3(0x231)]+'['+_0xdf5cee[_0x2e16a3(0x222)]+_0x2e16a3(0x1d4)+_0x4731e4+_0x2e16a3(0x197));return;}if(!_0x20c1b6?.[_0x2e16a3(0x12f)]?.[_0x2e16a3(0x172)]){_0xdf5cee[_0x2e16a3(0x156)][_0x2e16a3(0x1b7)](_0xdf5cee[_0x2e16a3(0x231)]+'['+_0xdf5cee['pluginName']+_0x2e16a3(0x1d4)+_0x4731e4+_0x2e16a3(0x1f8));return;}if(!_0x20c1b6?.[_0x2e16a3(0x12f)]?.[_0x2e16a3(0x172)][_0x2e16a3(0x1f7)]('GW.')){_0xdf5cee[_0x2e16a3(0x156)][_0x2e16a3(0x1b7)](_0xdf5cee['gwName']+'['+_0xdf5cee[_0x2e16a3(0x222)]+_0x2e16a3(0x1d4)+_0x4731e4+_0x2e16a3(0x10f));return;}if(!_0x20c1b6[_0x2e16a3(0x178)]||!Array[_0x2e16a3(0x1c7)](_0x20c1b6[_0x2e16a3(0x178)])||_0x20c1b6['baseUrls']['length']<0x1){_0xdf5cee[_0x2e16a3(0x156)][_0x2e16a3(0x1b7)](_0xdf5cee[_0x2e16a3(0x231)]+'['+_0xdf5cee[_0x2e16a3(0x222)]+']\x20publisher['+_0x4731e4+']\x20initialization\x20error:\x20missing\x20configuration\x20stream.baseUrls');return;}if(!_0x20c1b6?.[_0x2e16a3(0x127)]?.['ca']){_0xdf5cee[_0x2e16a3(0x156)][_0x2e16a3(0x1b7)](_0xdf5cee[_0x2e16a3(0x231)]+'['+_0xdf5cee[_0x2e16a3(0x222)]+_0x2e16a3(0x1d4)+_0x4731e4+']\x20initialization\x20error:\x20missing\x20certificate\x20configuration');return;}const _0x2ee33f={};try{let _0x521168=a0_0x486815[_0x2e16a3(0x1ea)](_0xdf5cee[_0x2e16a3(0x1ab)],_0x2e16a3(0x204),_0x20c1b6?.[_0x2e16a3(0x127)]?.['ca']||_0x2e16a3(0x159));(_0x20c1b6?.[_0x2e16a3(0x127)]?.['ca']?.[_0x2e16a3(0x1f7)]('/')||_0x20c1b6?.[_0x2e16a3(0x127)]?.['ca']?.['includes']('\x5c'))&&(_0x521168=_0x20c1b6[_0x2e16a3(0x127)]['ca']),_0x2ee33f['ca']=[a0_0x1d49b8[_0x2e16a3(0x208)](_0x521168)],_0x2ee33f[_0x2e16a3(0x129)]=!![];}catch(_0x134a57){_0xdf5cee[_0x2e16a3(0x156)][_0x2e16a3(0x1b7)](_0xdf5cee[_0x2e16a3(0x231)]+'['+_0xdf5cee[_0x2e16a3(0x222)]+_0x2e16a3(0x1d4)+_0x4731e4+_0x2e16a3(0x1fa)+_0x134a57[_0x2e16a3(0x227)]);return;}const _0xfc3920={},_0x20281d=new TextEncoder()[_0x2e16a3(0x15f)](_0x20c1b6?.[_0x2e16a3(0x12f)]?.['secret']),_0x123e16=_0x20c1b6?.[_0x2e16a3(0x12f)]?.['jwt'];_0xfc3920[_0x2e16a3(0x1e4)]=jwtAuthenticator(_0x123e16,_0x20281d),_0xfc3920[_0x2e16a3(0x166)]=_0x20c1b6[_0x2e16a3(0x178)],_0xfc3920[_0x2e16a3(0x140)]=_0x2ee33f,_0xfc3920[_0x2e16a3(0x139)]=![],_0xfc3920[_0x2e16a3(0x228)]=!![],_0xfc3920[_0x2e16a3(0x177)]=0x3e8*0xa,_0xfc3920[_0x2e16a3(0x198)]=-0x1,_0xfc3920[_0x2e16a3(0x210)]=0x2*0x3c*0x3e8,_0xfc3920['maxPingOut']=0x5,_0xfc3920[_0x2e16a3(0x118)]=![],_0x1135bc[_0x4731e4]={},_0x1135bc[_0x4731e4][_0x2e16a3(0x217)]=_0x20c1b6,_0x1135bc[_0x4731e4]['nc']=undefined,_0x58b20e(_0x4731e4,_0xfc3920);},this[_0x2821b2(0x11e)]=async _0x592ec3=>{const _0x3c4775=_0x2821b2;let _0x9877b9;const _0x5dc394=a0_0x7ebed9[_0x3c4775(0x1c0)]();try{if(_0x592ec3[_0x3c4775(0x207)]===Object){_0x9877b9=_0x592ec3[_0x3c4775(0x206)];if(!_0x9877b9)_0x592ec3['baseEntity']=_0x3c4775(0x135);if(_0x592ec3?.[_0x3c4775(0x1f5)]?.[_0x3c4775(0x160)]?.[_0x3c4775(0x145)]){const _0x3e19e9=_0x592ec3[_0x3c4775(0x1f5)][_0x3c4775(0x160)]['headers'][_0x3c4775(0x173)](_0x3c4775(0x165));if(_0x3e19e9)_0x592ec3['ctx'][_0x3c4775(0x160)][_0x3c4775(0x145)][_0x3c4775(0x105)](_0x3c4775(0x165),a0_0x197b83[_0x3c4775(0x22a)](_0x3e19e9,_0x5dc394));}if(_0x592ec3?.['ctx']?.['passThrough']?.[_0x3c4775(0x145)]){const _0x53e597=_0x592ec3[_0x3c4775(0x1f5)][_0x3c4775(0x14e)]['headers'][_0x3c4775(0x173)](_0x3c4775(0x165));if(_0x53e597)_0x592ec3[_0x3c4775(0x1f5)][_0x3c4775(0x14e)][_0x3c4775(0x145)][_0x3c4775(0x105)](_0x3c4775(0x165),a0_0x197b83['getEncrypted'](_0x53e597,_0x5dc394));}_0x592ec3=JSON[_0x3c4775(0x1b9)](_0x592ec3);}else{const _0x5b5f40=JSON[_0x3c4775(0x1b8)](_0x592ec3);_0x9877b9=_0x5b5f40[_0x3c4775(0x206)];}}catch(_0xcbedbe){throw new Error('publisher['+_0x9877b9+']\x20error:\x20message\x20must\x20be\x20JSON\x20formatted');}if(!_0x1135bc[_0x9877b9])throw new Error(_0x3c4775(0x14c)+_0x9877b9+_0x3c4775(0x1b2)+_0x9877b9);const _0x579dee=headers();_0x579dee[_0x3c4775(0x161)](_0x3c4775(0x116),_0x5dc394);let _0x530bd2;try{if(!_0x1135bc[_0x9877b9]['nc'])throw new Error('publisher\x20not\x20initialized/connected');_0x530bd2=await _0x1135bc[_0x9877b9]['nc']['request'](_0x1135bc[_0x9877b9][_0x3c4775(0x217)]?.[_0x3c4775(0x12f)]?.[_0x3c4775(0x172)],_0x592ec3,{'headers':_0x579dee});}catch(_0x4a9429){if(_0x4a9429['message']===_0x3c4775(0x1bc))throw new Error(_0x3c4775(0x14c)+_0x9877b9+_0x3c4775(0x186)+_0x1135bc[_0x9877b9][_0x3c4775(0x217)]?.[_0x3c4775(0x12f)]?.[_0x3c4775(0x172)]);else throw new Error(_0x3c4775(0x14c)+_0x9877b9+_0x3c4775(0x167)+_0x4a9429[_0x3c4775(0x227)]);}let _0x4a9268;try{_0x4a9268=JSON['parse'](_0x530bd2[_0x3c4775(0x16c)]());try{JSON['parse'](_0x4a9268[_0x3c4775(0x1cf)]);if(!_0x4a9268['headers'])_0x4a9268[_0x3c4775(0x145)]={};if(!_0x4a9268[_0x3c4775(0x145)][_0x3c4775(0x1b3)])_0x4a9268[_0x3c4775(0x145)][_0x3c4775(0x1b3)]=_0x3c4775(0x1f6);}catch(_0x48291b){void 0x0;}}catch(_0x193e75){throw new Error(_0x3c4775(0x1a9)+_0x530bd2[_0x3c4775(0x16c)]());}if(_0x4a9268?.[_0x3c4775(0x1b7)]){const _0x3421ff=new Error(_0x3c4775(0x1fc)+_0x4a9268[_0x3c4775(0x1b7)]);_0x3421ff['name']=_0x4a9268[_0x3c4775(0x1ac)];throw _0x3421ff;}return _0x4a9268;},process['on']('SIGTERM',async()=>{const _0x2567ca=_0x2821b2;for(const _0x15fd82 in _0x1135bc){_0x1135bc[_0x15fd82]['nc']&&!_0x1135bc[_0x15fd82]['nc'][_0x2567ca(0x13e)]()&&await _0x1135bc[_0x15fd82]['nc'][_0x2567ca(0x1c1)]();}}),process['on']('SIGINT',async()=>{const _0x2f5349=_0x2821b2;for(const _0x18ee49 in _0x1135bc){_0x1135bc[_0x18ee49]['nc']&&!_0x1135bc[_0x18ee49]['nc']['isClosed']()&&await _0x1135bc[_0x18ee49]['nc'][_0x2f5349(0x1c1)]();}});}}export const getAppRoles=async(_0x2975d2,_0x49aff4)=>{const _0x2fc120=a0_0x34a9,_0x28a463=_0x2fc120(0x15e),_0x3b55c6=_0x2975d2;_0x3b55c6[_0x2fc120(0x156)][_0x2fc120(0x118)](_0x3b55c6[_0x2fc120(0x231)]+'['+_0x3b55c6[_0x2fc120(0x222)]+_0x2fc120(0x1a4)+_0x28a463+'\x22');try{if(!a0_0x1d49b8[_0x2fc120(0x194)](_0x3b55c6['configDir']+_0x2fc120(0x1c9)))a0_0x1d49b8['mkdirSync'](_0x3b55c6[_0x2fc120(0x1ab)]+_0x2fc120(0x1c9));}catch(_0x4b5733){void 0x0;}const _0x5cddf1=a0_0x486815[_0x2fc120(0x1ea)](''+_0x3b55c6[_0x2fc120(0x1ab)],_0x2fc120(0x21d),'approles_'+_0x3b55c6[_0x2fc120(0x222)]+_0x2fc120(0x106)),_0x971eb={};a0_0x197b83[_0x2fc120(0x229)](_0x5cddf1)&&a0_0x1d49b8['readFileSync'](_0x5cddf1,_0x2fc120(0x226))['split'](/\r?\n/)[_0x2fc120(0x214)](_0xef7148=>{const _0xe9cf16=_0x2fc120,_0x4d19d4=_0xef7148['split']('\x20');_0x4d19d4[_0xe9cf16(0x18c)]===0x2&&(_0x971eb[_0x4d19d4[0x0]]=_0x4d19d4[0x1]);});const _0x4855eb=a0_0x1d49b8[_0x2fc120(0x20a)](_0x5cddf1,{'flags':'w','encoding':'utf8','mode':0x1b6,'autoClose':!![]}),_0x29fafc=[],_0x104564=await _0x3b55c6[_0x2fc120(0x200)](_0x49aff4,{'attribute':undefined,'operator':undefined,'value':undefined},['id',_0x2fc120(0x16f)]);return _0x104564['Resources'][_0x2fc120(0x214)](_0x1dacc1=>{const _0x27720f=_0x2fc120;if(_0x1dacc1['id']){let _0x457b54=a0_0x7ebed9['randomUUID']();if(_0x971eb[_0x1dacc1['id']])_0x457b54=_0x971eb[_0x1dacc1['id']];const _0x55b443={'allowedMemberTypes':[_0x27720f(0x1f3)],'description':_0x27720f(0x196),'displayName':_0x1dacc1['displayName']||_0x1dacc1['id'],'id':_0x457b54,'isEnabled':!![],'lang':null,'origin':_0x27720f(0x17f),'value':decodeURIComponent(_0x1dacc1['id'])};_0x29fafc[_0x27720f(0x175)](_0x55b443),_0x4855eb[_0x27720f(0x1d9)](_0x1dacc1['id']+'\x20'+_0x457b54+'\x0a');}}),_0x4855eb[_0x2fc120(0x1fe)](),_0x3b55c6[_0x2fc120(0x156)][_0x2fc120(0x118)](_0x3b55c6['gwName']+'['+_0x3b55c6[_0x2fc120(0x222)]+_0x2fc120(0x138)+_0x5cddf1),{'Resources':[{'appRoles':_0x29fafc}]};};
|
|
14
|
+
'use strict';(function(_0x3fb99c,_0x33584e){const _0x2a378e=a0_0xab49,_0xcc2341=_0x3fb99c();while(!![]){try{const _0x50162b=parseInt(_0x2a378e(0x71))/0x1+parseInt(_0x2a378e(0x118))/0x2*(-parseInt(_0x2a378e(0x11d))/0x3)+parseInt(_0x2a378e(0x96))/0x4*(parseInt(_0x2a378e(0x133))/0x5)+parseInt(_0x2a378e(0x6c))/0x6*(-parseInt(_0x2a378e(0x11c))/0x7)+-parseInt(_0x2a378e(0xa4))/0x8*(parseInt(_0x2a378e(0x188))/0x9)+-parseInt(_0x2a378e(0x127))/0xa+parseInt(_0x2a378e(0xf5))/0xb;if(_0x50162b===_0x33584e)break;else _0xcc2341['push'](_0xcc2341['shift']());}catch(_0x2cfb02){_0xcc2341['push'](_0xcc2341['shift']());}}}(a0_0x40c3,0xc84c6));import{jwtAuthenticator,headers}from'@nats-io/nats-core';import{jetstream,jetstreamManager,DeliverPolicy,AckPolicy}from'@nats-io/jetstream';import{connect as a0_0x2cc5a3}from'@nats-io/transport-node';function a0_0xab49(_0x3379b6,_0x52db9f){const _0x40c392=a0_0x40c3();return a0_0xab49=function(_0xab49a0,_0x5477ed){_0xab49a0=_0xab49a0-0x67;let _0x51d573=_0x40c392[_0xab49a0];return _0x51d573;},a0_0xab49(_0x3379b6,_0x52db9f);}import a0_0x38a5e6 from'fold-to-ascii';import a0_0x4b3d48 from'node:fs';function a0_0x40c3(){const _0x4470bd=['replaceAll','POST',']\x20handling\x20\x22','?filter=userName\x20eq\x20\x22','readFileSync','publisher\x20not\x20initialized/connected','routeObj',',\x20obj=','Msg-Id','subscribe','tls','data','close',']\x20connected\x20','typeId',']\x20initialization\x20error:\x20missing\x20configuration\x20nats.tenant','DELETE\x20users','newHelperRest','?attributes=','ctx','POST\x20groups','_autogenerated.cfg','generateUserPassword','set','modifyUser','errName','/Users/','\x20error:\x20missing\x20id}',']\x20initialization\x20error:\x20missing\x20configuration\x20stream.baseUrls','write','##doIncrement','firstn','lowercase','POST\x20users','encode','url','username','publisher\x20response\x20error:\x20','putHandler','\x20subscriber\x20error:\x20scimgateway\x20endpoint\x20connect\x20problem\x20-\x20will\x20do\x20auto\x20retry\x20until\x20connected','statusCode','value','secret','externalId',']\x20error:\x20client\x20have\x20not\x20been\x20initialized','nats','type','gwName','\x20message:\x20','ack','info','server_name','\x20Replace\x20User\x20id=','{\x22error\x22:\x22','PUT\x20api','}\x20message\x20response:\x20','headers','from','\x20missing\x20mandatory\x20user.userName\x20in\x20message:\x20','DELETE\x20groups','authenticator','consumers','onCreate','elementnumber','\x20Delete\x20User\x20id=','user','Users','foldReplacing','23784332vhFiKX','trim','Explicit','constructor',']\x20initialization\x20certificate\x20error:\x20','userName','PATCH\x20users','activityOperation','getApiHandler','Operations','maxReconnectAttempts','publisher\x20error:\x20none\x20JSON\x20formatted\x20response:\x20','then','substring','GET\x20serviceproviderconfigs','name','&attributes=','startsWith',']\x20onChainingHandler\x20error:\x20configuration\x20scimgateway.chainingBaseUrl\x20must\x20use\x20correct\x20syntax\x20\x27http(s)://host:port\x27\x20error:\x20','length','error','split','rejectUnauthorized','forEach','GET\x20api','deleteUser','getHandlerId',',\x20id=','getUsers()\x20error:\x20unsupported\x20operator\x20for\x20getObj:\x20','application/scim+json;\x20charset=utf-8','patchApiHandler','certificate','baseUrls','handle','passThrough','13814ORfZJa','roles','scimgateway','includes','228557dzOwUl','378rBadZb','operation','}\x20message\x20error\x20response:\x20',']\x20client\x20has\x20a\x20stale\x20connection\x20','basic',']\x20initialization\x20error:\x20missing\x20certificate\x20configuration','jwt','DELETE\x20api','replaceUsrGrp','GET\x20schemas','13462210UnVPYp',']\x20initialization\x20error:\x20missing\x20configuration\x20nats','false','utf-8','getEncrypted','active','password','base64','chainingBaseUrl',']\x20initialization\x20error:\x20nats.subject\x20root\x20topic\x20must\x20be\x20\x27GW\x27,\x20nats.subject\x20example:\x20GW.APP1','convertedScim20','randomUUID','1867475SeepDC','display','SCIM-Stream',']\x20closed\x20with\x20error:\x20',']\x20initialization\x20error:\x20missing\x20configuration\x20nats.subject','logger','method','approles_','respond','\x20handling\x20message:\x20','isClosed','config','\x20message\x20json\x20parsing\x20error:\x20','path','staleConnection','join','message','pluginName',']\x20onChainingHandler\x20error:\x20configuration\x20scimgateway.chainingBaseUrl\x20missing','toString','delete','auth','pingInterval','toUpperCase','baseEntity','debug','stringify',']\x20approle\x20uuid\x20file\x20created:\x20','\x20error:\x20more\x20than\x20one\x20user\x20were\x20found}','/approles','\x20(count=',']\x20error:\x20missing\x20entity\x20configuration\x20for\x20baseEntity=','getServer','GET\x20serviceplans',']\x20connect\x20error:\x20','\x20=>\x20subscriber\x20not\x20activated','doRequest','\x20role\x20removal\x20error:\x20','disconnect','?filter=externalId\x20eq\x20\x22','charAt','/Users','subscriber\x20using\x20remote\x20gateway\x20through\x20chainingBaseUrl\x20requires\x20either\x20auth.tokenBearer\x20or\x20auth.basic\x20to\x20be\x20configured','doIncrement','response','PATCH\x20api','internal\x20stream\x20policy\x20have\x20been\x20changed\x20-\x20central\x20SCIM\x20Stream\x20must\x20be\x20stopped\x20and\x20corresponding\x20./jetstream\x20folder\x20deleted\x20before\x20startup\x20allowing\x20new\x20policy','\x20message:\x20user\x20does\x20not\x20exist','\x20done','reconnectTimeWait','modifyOnly','publish','HR.','publisher[','usePutSoftSync','replace','all','helperRest',']\x20publisher[','origin','PUT\x20users',']\x20client\x20error\x20','POST\x20api',']\x20error:\x20','get','getHandler','prototype','filter_subject','obj','reconnecting','GET\x20users','\x20message\x20handled:\x20','remove','streamChaining\x20error:\x20','toLowerCase','Resources','UnableConnectingHost','PUT\x20groups','fsExistsSync','getuniquevalue','SIGINT','parse','closed','\x20-\x20will\x20do\x20auto\x20reconnect\x20when\x20connection\x20becomes\x20available','getGroups','63aLpULJ','deleteApiHandler','normalize',']\x20client\x20reconnected\x20',',true','servers','content-type','waitOnFirstConnect','42wpgpyG','drain','groups','\x20getUserId()\x20error:\x20','subject','1620462dmlTvv',']\x20error:\x20message\x20must\x20be\x20JSON\x20formatted','mkdirSync','maxPingOut','durable_','/certs/','\x20processing\x20incoming\x20message','\x20message:\x20user\x20not\x20created\x20because\x20of\x20configuration\x20modifyOnly=true','add',']\x20error:\x20no\x20subscribers/responders\x20to\x20subject\x20','patchHandler','undefined','request','consumer_not_found','append','PATCH\x20groups','attribute','createWriteStream','SIGTERM','string','\x20Create\x20User\x20userName=','ETIMEDOUT','Application','configDir','_info','replaceDomains','bearerToken','streamChaining\x20called\x20but\x20missing\x20chainingBaseUrl','\x20error:\x20missing\x20result',']\x20client\x20is\x20attempting\x20to\x20reconnect\x20','authorization','status','\x20Create\x20userName=','func','uppercase','Bearer\x20','getUsers','4woMOIe','\x20message:\x20user\x20not\x20created\x20because\x20of\x20active=false','\x20-\x20','getHandlerSchemas',']\x20subscriber[','sub','tenant','indexOf','reconnect','copyObj',']\x20onChainingHandler\x20error:\x20','isArray','displayName','\x20error:\x20','1017928prYiOs','503','token','All','PUT',']\x20client\x20disconnected\x20','true','file-not-configured','push','skipConvertRolesToGroups','timeout','getUsers()\x20getObj=','body'];a0_0x40c3=function(){return _0x4470bd;};return a0_0x40c3();}import a0_0x3f43f4 from'node:path';import a0_0xc5a644 from'node:crypto';import*as a0_0x5892aa from'./utils.ts';import*as a0_0x502367 from'./utils-scim.ts';export class Subscriber{constructor(_0x174530,_0x5d2fa5){const _0x2fe9b2=a0_0xab49,_0x2730d1=_0x174530,_0x25503f={},_0x4e0537=_0x2730d1[_0x2fe9b2(0x13e)][_0x2fe9b2(0x11a)]['chainingBaseUrl'];let _0x2a68a4='';if(_0x4e0537){if(_0x2730d1['config']['scimgateway']?.[_0x2fe9b2(0x148)]?.['bearerToken']&&Array['isArray'](_0x2730d1[_0x2fe9b2(0x13e)][_0x2fe9b2(0x11a)][_0x2fe9b2(0x148)][_0x2fe9b2(0x8b)])&&_0x2730d1[_0x2fe9b2(0x13e)][_0x2fe9b2(0x11a)]['auth'][_0x2fe9b2(0x8b)][_0x2fe9b2(0x108)]>0x0){const _0x353b91=_0x2730d1['config']['scimgateway']['auth'][_0x2fe9b2(0x8b)];if(_0x353b91[0x0][_0x2fe9b2(0xa6)]){const _0x25fc28=Buffer[_0x2fe9b2(0xea)](_0x353b91[0x0]['token'])[_0x2fe9b2(0x146)](_0x2fe9b2(0x12e));_0x2a68a4=_0x2fe9b2(0x94)+_0x25fc28;}}if(!_0x2a68a4&&_0x2730d1[_0x2fe9b2(0x13e)][_0x2fe9b2(0x11a)]?.[_0x2fe9b2(0x148)]?.[_0x2fe9b2(0x121)]&&Array['isArray'](_0x2730d1[_0x2fe9b2(0x13e)][_0x2fe9b2(0x11a)][_0x2fe9b2(0x148)][_0x2fe9b2(0x121)])&&_0x2730d1[_0x2fe9b2(0x13e)][_0x2fe9b2(0x11a)][_0x2fe9b2(0x148)][_0x2fe9b2(0x121)][_0x2fe9b2(0x108)]>0x0){const _0x234899=_0x2730d1[_0x2fe9b2(0x13e)][_0x2fe9b2(0x11a)][_0x2fe9b2(0x148)][_0x2fe9b2(0x121)];if(_0x234899[0x0][_0x2fe9b2(0xd5)]&&_0x234899[0x0][_0x2fe9b2(0x12d)]){const _0x23a5ee=Buffer[_0x2fe9b2(0xea)](_0x234899[0x0]['username']+':'+_0x234899[0x0][_0x2fe9b2(0x12d)])[_0x2fe9b2(0x146)]('base64');_0x2a68a4='Basic\x20'+_0x23a5ee;}}}const _0xfc3216=async(_0x6148eb,_0x2ba0c4)=>{const _0x466898=_0x2fe9b2,_0x5efcbe=_0x25503f[_0x6148eb][_0x466898(0x13e)]?.['nats']?.[_0x466898(0x70)];let _0x10268b;try{_0x10268b=await a0_0x2cc5a3(_0x2ba0c4);if(_0x10268b[_0x466898(0xe3)][_0x466898(0xe4)]!==_0x466898(0x135)){_0x10268b['close']();return;}_0x25503f[_0x6148eb]['nc']=_0x10268b,_0x10b2ac(_0x6148eb,_0x10268b),_0x1cdc48(_0x6148eb,_0x10268b);}catch(_0x20086a){_0x2730d1['logger']['error'](_0x2730d1[_0x466898(0xe0)]+'['+_0x2730d1[_0x466898(0x144)]+']\x20subscriber['+_0x6148eb+']['+_0x5efcbe+_0x466898(0x155)+_0x20086a[_0x466898(0x143)]+'\x20-\x20will\x20do\x20auto\x20connect\x20when\x20available\x20-\x20however,\x20please\x20verify\x20stream\x20configuration'),_0x2ba0c4[_0x466898(0x6b)]=!![];try{_0x10268b=await a0_0x2cc5a3(_0x2ba0c4);if(_0x10268b[_0x466898(0xe3)][_0x466898(0xe4)]!==_0x466898(0x135)){_0x10268b[_0x466898(0xbd)]();return;}_0x25503f[_0x6148eb]['nc']=_0x10268b,_0x10b2ac(_0x6148eb,_0x10268b),_0x1cdc48(_0x6148eb,_0x10268b);}catch(_0x309db4){_0x2730d1[_0x466898(0x138)][_0x466898(0x109)](_0x2730d1[_0x466898(0xe0)]+'['+_0x2730d1['pluginName']+_0x466898(0x9a)+_0x6148eb+']['+_0x5efcbe+']\x20connect\x20error:\x20'+_0x309db4[_0x466898(0x143)]);return;}}_0x2730d1['logger']['debug'](_0x2730d1[_0x466898(0xe0)]+'['+_0x2730d1[_0x466898(0x144)]+_0x466898(0x9a)+_0x6148eb+']['+_0x5efcbe+_0x466898(0xbe)+(_0x2ba0c4[_0x466898(0xbb)]['ca']?_0x466898(0xbb):'')+'\x20'+_0x10268b['getServer']()),_0x10268b['closed']()['then'](_0x177849=>{const _0x4d5d27=_0x466898;_0x177849&&_0x2730d1[_0x4d5d27(0x138)][_0x4d5d27(0x109)](_0x2730d1[_0x4d5d27(0xe0)]+'['+_0x2730d1[_0x4d5d27(0x144)]+_0x4d5d27(0x9a)+_0x6148eb+']['+_0x5efcbe+_0x4d5d27(0x136)+_0x177849[_0x4d5d27(0x143)]);});};this[_0x2fe9b2(0x79)]=async(_0x337936,_0x3eb117)=>{const _0x327f25=_0x2fe9b2;if(!_0x3eb117?.['nats']){_0x2730d1[_0x327f25(0x138)][_0x327f25(0x109)](_0x2730d1[_0x327f25(0xe0)]+'['+_0x2730d1[_0x327f25(0x144)]+_0x327f25(0x9a)+_0x337936+_0x327f25(0x128));return;}if(!_0x3eb117?.[_0x327f25(0xde)]?.['tenant']){_0x2730d1[_0x327f25(0x138)]['error'](_0x2730d1[_0x327f25(0xe0)]+'['+_0x2730d1[_0x327f25(0x144)]+']\x20subscriber['+_0x337936+_0x327f25(0xc0));return;}if(!_0x3eb117?.[_0x327f25(0xde)]?.['subject']){_0x2730d1[_0x327f25(0x138)][_0x327f25(0x109)](_0x2730d1[_0x327f25(0xe0)]+'['+_0x2730d1[_0x327f25(0x144)]+_0x327f25(0x9a)+_0x337936+_0x327f25(0x137));return;}if(!_0x3eb117?.[_0x327f25(0x114)]?.['ca']){_0x2730d1[_0x327f25(0x138)][_0x327f25(0x109)](_0x2730d1[_0x327f25(0xe0)]+'['+_0x2730d1['pluginName']+']\x20subscriber['+_0x337936+']\x20initialization\x20error:\x20missing\x20certificate\x20configuration');return;}if(!_0x3eb117[_0x327f25(0x115)]||!Array[_0x327f25(0xa1)](_0x3eb117['baseUrls'])||_0x3eb117['baseUrls'][_0x327f25(0x108)]<0x1){_0x2730d1['logger'][_0x327f25(0x109)](_0x2730d1[_0x327f25(0xe0)]+'['+_0x2730d1[_0x327f25(0x144)]+']\x20subscriber['+_0x337936+_0x327f25(0xcd));return;}if(!_0x3eb117['usePutSoftSync']){const _0x50f97b=_0x3eb117?.[_0x327f25(0xde)]?.[_0x327f25(0x70)][_0x327f25(0x14a)]();if(_0x50f97b['startsWith'](_0x327f25(0x167)))_0x3eb117['usePutSoftSync']=!![];}const _0x289e4e={};try{let _0x375d54=a0_0x3f43f4[_0x327f25(0x142)](_0x2730d1['configDir'],_0x327f25(0x76),_0x3eb117?.[_0x327f25(0x114)]?.['ca']||_0x327f25(0xab));(_0x3eb117?.['certificate']?.['ca']?.['startsWith']('/')||_0x3eb117?.[_0x327f25(0x114)]?.['ca']?.[_0x327f25(0x11b)]('\x5c'))&&(_0x375d54=_0x3eb117['certificate']['ca']),_0x289e4e['ca']=[a0_0x4b3d48['readFileSync'](_0x375d54)],_0x289e4e[_0x327f25(0x10b)]=!![];}catch(_0x24d7a6){_0x2730d1[_0x327f25(0x138)][_0x327f25(0x109)](_0x2730d1['gwName']+'['+_0x2730d1[_0x327f25(0x144)]+_0x327f25(0x9a)+_0x337936+_0x327f25(0xf9)+_0x24d7a6[_0x327f25(0x143)]);return;}const _0x3bb403={},_0x560010=new TextEncoder()[_0x327f25(0xd3)](_0x3eb117?.[_0x327f25(0xde)]?.['secret']),_0x2e9f53=_0x3eb117?.['nats']?.[_0x327f25(0x123)];_0x3bb403[_0x327f25(0xed)]=jwtAuthenticator(_0x2e9f53,_0x560010),_0x3bb403[_0x327f25(0x69)]=_0x3eb117['baseUrls'],_0x3bb403[_0x327f25(0xbb)]=_0x289e4e,_0x3bb403[_0x327f25(0x6b)]=![],_0x3bb403['reconnect']=!![],_0x3bb403[_0x327f25(0x164)]=0x3e8*0xa,_0x3bb403[_0x327f25(0xff)]=-0x1,_0x3bb403[_0x327f25(0x149)]=0x2*0x3c*0x3e8,_0x3bb403[_0x327f25(0x74)]=0x5,_0x3bb403['debug']=![],_0x25503f[_0x337936]={},_0x25503f[_0x337936][_0x327f25(0x13e)]=_0x3eb117,_0x25503f[_0x337936]['nc']=undefined,_0x25503f[_0x337936][_0x327f25(0x9b)]=undefined,_0xfc3216(_0x337936,_0x3bb403);};const _0x1cdc48=async(_0x5b9749,_0x2c09e0)=>{const _0x5c75a6=_0x2fe9b2,_0x56cd96=_0x25503f[_0x5b9749][_0x5c75a6(0x13e)],_0xba9185=_0x56cd96?.['nats']?.[_0x5c75a6(0x70)];if(!_0x2c09e0){_0x2730d1[_0x5c75a6(0x138)][_0x5c75a6(0x109)](_0x2730d1[_0x5c75a6(0xe0)]+'['+_0x2730d1[_0x5c75a6(0x144)]+_0x5c75a6(0x9a)+_0x5b9749+']['+_0xba9185+_0x5c75a6(0xdd));return;}const _0xe41422=async(_0x1d7ddc,_0x55f6b4)=>{const _0x467783=_0x5c75a6;try{_0x2730d1[_0x467783(0x138)][_0x467783(0xe3)](_0x1d7ddc+_0x467783(0x13c)+_0x55f6b4);let _0x5b8452;try{if(_0x56cd96[_0x467783(0x8a)]&&Array['isArray'](_0x56cd96['replaceDomains']))for(let _0x577e75=0x0;_0x577e75<_0x56cd96['replaceDomains'][_0x467783(0x108)];_0x577e75++){const _0xae1965=_0x56cd96[_0x467783(0x8a)][_0x577e75];if(!_0xae1965[_0x467783(0xea)]||!_0xae1965[_0x467783(0xea)][_0x467783(0x11b)]('.')||!_0xae1965['to']||!_0xae1965['to'][_0x467783(0x11b)]('.'))continue;const _0x3e811b=new RegExp('@'+_0xae1965['from']+'\x22','gi');_0x55f6b4=_0x55f6b4[_0x467783(0x16a)](_0x3e811b,'@'+_0xae1965['to']+'\x22');}_0x5b8452=JSON['parse'](_0x55f6b4);}catch(_0x2ddaa4){_0x2730d1[_0x467783(0x138)][_0x467783(0x109)](_0x1d7ddc+_0x467783(0x13f)+_0x2ddaa4[_0x467783(0x143)]+_0x467783(0xe1)+_0x55f6b4),_0x2730d1[_0x467783(0x138)]['debug'](_0x1d7ddc+_0x467783(0x163));return;}const _0x329483=_0x5b8452[_0x467783(0xf2)];if(!_0x329483){_0x2730d1[_0x467783(0x138)]['error'](_0x1d7ddc+'\x20missing\x20user\x20object\x20in\x20message:\x20'+JSON[_0x467783(0x14d)](_0x5b8452)),_0x2730d1[_0x467783(0x138)][_0x467783(0x14c)](_0x1d7ddc+_0x467783(0x163));return;}if(!_0x329483['userName']){_0x2730d1[_0x467783(0x138)]['error'](_0x1d7ddc+_0x467783(0xeb)+JSON[_0x467783(0x14d)](_0x5b8452)),_0x2730d1[_0x467783(0x138)][_0x467783(0x14c)](_0x1d7ddc+_0x467783(0x163));return;}delete _0x329483['schemas'];let _0x566aac;_0x329483['id']&&(_0x566aac=_0x329483['id'],delete _0x329483['id']);let _0x5ea082;_0x329483[_0x467783(0xef)]&&(_0x5ea082=a0_0x5892aa['copyObj'](_0x329483[_0x467783(0xef)]),delete _0x329483[_0x467783(0xef)]);await _0x557960(_0x5b9749,_0x329483);const _0x398e73=_0x329483[_0x467783(0xfa)];let _0x170ea7,_0x12820c;try{_0x170ea7=await _0x4711f7(_0x5b9749,'userName',_0x398e73);}catch(_0x46c1c9){_0x2730d1['logger'][_0x467783(0x109)](_0x1d7ddc+'\x20getUserId()\x20error:\x20'+_0x46c1c9[_0x467783(0x143)]),_0x2730d1[_0x467783(0x138)][_0x467783(0x14c)](_0x1d7ddc+_0x467783(0x163));const _0x25558a=[_0x467783(0x17f),'UnableConnectingService','ECONNREFUSED','ENOTFOUND',_0x467783(0x86),_0x467783(0xae)];for(const _0x1657ba in _0x25558a){if(_0x46c1c9[_0x467783(0x143)][_0x467783(0x11b)](_0x1657ba))return!![];}return;}if(!_0x56cd96[_0x467783(0xad)]){let _0xd88d=![];if(_0x5b8452[_0x467783(0xfe)]&&Array[_0x467783(0xa1)](_0x5b8452[_0x467783(0xfe)]))for(let _0x4b7c62=0x0;_0x4b7c62<_0x5b8452[_0x467783(0xfe)]['length'];_0x4b7c62++){const _0x12d827=_0x5b8452[_0x467783(0xfe)][_0x4b7c62];_0x12d827['path']['startsWith']('roles')&&(_0x12d827[_0x467783(0x140)]='groups',Array[_0x467783(0xa1)](_0x12d827['value'])?(_0x12d827[_0x467783(0xda)][0x0]['id']=_0x12d827['value'][0x0][_0x467783(0xda)],_0x12d827[_0x467783(0xda)][0x0][_0x467783(0x134)]=_0x12d827[_0x467783(0xda)][0x0][_0x467783(0xdf)]+_0x467783(0x98)+_0x12d827['value'][0x0][_0x467783(0xda)],delete _0x12d827[_0x467783(0xda)][0x0][_0x467783(0xda)],delete _0x12d827['value'][0x0][_0x467783(0xdf)]):_0x12d827[_0x467783(0xda)]=[{'id':_0x12d827[_0x467783(0xda)],'display':_0x12d827[_0x467783(0xda)]}],delete _0x12d827[_0x467783(0xbf)],_0xd88d=!![]);}if(_0x329483[_0x467783(0x119)]&&Array[_0x467783(0xa1)](_0x329483['roles'])&&_0x329483[_0x467783(0x119)][_0x467783(0x108)]>0x0){if(!_0x329483[_0x467783(0x6e)])_0x329483[_0x467783(0x6e)]=[];if(!Array[_0x467783(0xa1)](_0x329483[_0x467783(0x6e)]))_0x329483[_0x467783(0x6e)]=[];for(let _0x149def=0x0;_0x149def<_0x329483[_0x467783(0x119)][_0x467783(0x108)];_0x149def++){const _0x3e0797={},_0x5def1d=_0x329483[_0x467783(0x119)][_0x149def];_0x3e0797['value']=_0x5def1d[_0x467783(0xda)],_0x3e0797[_0x467783(0x134)]=_0x5def1d['type']+'\x20-\x20'+_0x5def1d['display'],_0x329483[_0x467783(0x6e)]['push'](_0x3e0797);}delete _0x329483[_0x467783(0x119)],_0xd88d=!![];}if(_0xd88d)_0x2730d1[_0x467783(0x138)]['debug'](_0x1d7ddc+'\x20roles\x20converted\x20to\x20groups:\x20'+JSON[_0x467783(0x14d)](_0x5b8452));}if(!_0x170ea7){if(_0x5b8452[_0x467783(0xfc)]==='deleteUser'){_0x2730d1[_0x467783(0x138)][_0x467783(0x14c)](_0x1d7ddc+'\x20Delete\x20User\x20userName='+_0x398e73+_0x467783(0x162)),_0x2730d1[_0x467783(0x138)]['debug'](_0x1d7ddc+_0x467783(0x163));return;}if(_0x56cd96[_0x467783(0x165)]&&_0x56cd96[_0x467783(0x165)]===!![]){_0x2730d1[_0x467783(0x138)][_0x467783(0x14c)](_0x1d7ddc+_0x467783(0x91)+_0x398e73+_0x467783(0x78)),_0x2730d1[_0x467783(0x138)]['debug'](_0x1d7ddc+_0x467783(0x163));return;}if(Object[_0x467783(0x175)]['hasOwnProperty']['call'](_0x329483,'active')){if(typeof _0x329483[_0x467783(0x12c)]===_0x467783(0x84)){const _0x355d07=_0x329483[_0x467783(0x12c)][_0x467783(0x17d)]();if(_0x355d07===_0x467783(0xaa))_0x329483[_0x467783(0x12c)]=!![];else{if(_0x355d07===_0x467783(0x129))_0x329483[_0x467783(0x12c)]=![];}}if(_0x329483[_0x467783(0x12c)]===![]){_0x2730d1[_0x467783(0x138)][_0x467783(0x14c)](_0x1d7ddc+_0x467783(0x91)+_0x398e73+_0x467783(0x97)),_0x2730d1['logger'][_0x467783(0x14c)](_0x1d7ddc+_0x467783(0x163));return;}}_0x2730d1[_0x467783(0x138)][_0x467783(0x14c)](_0x1d7ddc+_0x467783(0x85)+_0x398e73);const _0x5cfbba=a0_0x5892aa[_0x467783(0x9f)](_0x329483);try{delete _0x5cfbba[_0x467783(0x6e)];!_0x5cfbba['password']&&_0x56cd96[_0x467783(0xc7)]&&_0x56cd96[_0x467783(0xc7)]===!![]&&(_0x5cfbba[_0x467783(0x12d)]=a0_0x5892aa['createRandomPassword'](0xf));if(_0x5ea082||_0x566aac){if(_0x5ea082)for(const _0x43c3f3 in _0x5ea082){_0x5cfbba[_0x43c3f3]=_0x5ea082[_0x43c3f3];}if(_0x566aac)_0x5cfbba['id']=_0x566aac;await _0x557960(_0x5b9749,_0x5cfbba);}await _0x2313a6(_0x5b9749,_0x5cfbba),_0x329483['groups']&&Array[_0x467783(0xa1)](_0x329483[_0x467783(0x6e)])&&_0x329483[_0x467783(0x6e)]['length']>0x0&&(_0x12820c=await _0x4711f7(_0x5b9749,'userName',_0x398e73));}catch(_0x51868f){_0x2730d1[_0x467783(0x138)][_0x467783(0x109)](_0x1d7ddc+'\x20createUser()\x20obj='+JSON[_0x467783(0x14d)](_0x5cfbba)+_0x467783(0xa3)+_0x51868f['message']+'}'),_0x2730d1[_0x467783(0x138)][_0x467783(0x14c)](_0x1d7ddc+_0x467783(0x163));return;}}if(_0x170ea7||_0x12820c){if(_0x5b8452[_0x467783(0xfc)]===_0x467783(0x10e)){if(_0x56cd96[_0x467783(0x165)]&&_0x56cd96['modifyOnly']===!![]){_0x2730d1[_0x467783(0x138)][_0x467783(0x14c)](_0x1d7ddc+_0x467783(0xf1)+_0x170ea7+'\x20message:\x20user\x20not\x20deleted\x20because\x20of\x20configuration\x20modifyOnly=true'),_0x2730d1[_0x467783(0x138)][_0x467783(0x14c)](_0x1d7ddc+_0x467783(0x163));return;}_0x2730d1[_0x467783(0x138)][_0x467783(0x14c)](_0x1d7ddc+_0x467783(0xf1)+_0x170ea7);try{await _0x214cda(_0x5b9749,_0x170ea7);}catch(_0x154879){_0x2730d1[_0x467783(0x138)][_0x467783(0x109)](_0x1d7ddc+_0x467783(0xf1)+_0x170ea7+_0x467783(0xa3)+_0x154879['message']+'}'),_0x2730d1[_0x467783(0x138)][_0x467783(0x14c)](_0x1d7ddc+'\x20done');return;}}else{if(_0x12820c)_0x170ea7=_0x12820c;_0x2730d1[_0x467783(0x138)]['debug'](_0x1d7ddc+_0x467783(0xe5)+_0x170ea7);try{await _0x1a4ddc('Users',_0x5b9749,_0x170ea7,_0x329483,_0x56cd96[_0x467783(0x169)]);}catch(_0x53b38a){_0x2730d1[_0x467783(0x138)]['error'](_0x1d7ddc+'\x20Replace\x20User\x20id='+_0x170ea7+_0x467783(0xa3)+_0x53b38a[_0x467783(0x143)]),_0x2730d1['logger'][_0x467783(0x14c)](_0x1d7ddc+'\x20done');return;}if(_0x56cd96[_0x467783(0x169)]){const [_0x3c7030,_0x315a7b]=a0_0x502367[_0x467783(0x131)]({'Operations':_0x5b8452[_0x467783(0xfe)]});if(_0x315a7b){_0x2730d1['logger'][_0x467783(0x109)](_0x1d7ddc+_0x467783(0xe5)+_0x170ea7+'\x20convertedScim20\x20error:\x20'+_0x315a7b[_0x467783(0x143)]),_0x2730d1[_0x467783(0x138)][_0x467783(0x14c)](_0x1d7ddc+'\x20done');return;}const _0x4cdeb2=[];if(_0x3c7030[_0x467783(0x119)]&&Array[_0x467783(0xa1)](_0x3c7030[_0x467783(0x119)]))for(let _0x14c3a5=0x0;_0x14c3a5<_0x3c7030[_0x467783(0x119)][_0x467783(0x108)];_0x14c3a5++){_0x3c7030[_0x467783(0x119)][_0x14c3a5][_0x467783(0x11e)]&&_0x3c7030[_0x467783(0x119)][_0x14c3a5]['operation']==='delete'&&_0x4cdeb2[_0x467783(0xac)](_0x3c7030[_0x467783(0x119)][_0x14c3a5]);}if(_0x4cdeb2[_0x467783(0x108)]>0x0)try{await _0x2730d1[_0x467783(0xc9)](_0x5b9749,_0x170ea7,{'roles':_0x4cdeb2});}catch(_0x309018){_0x2730d1[_0x467783(0x138)][_0x467783(0x109)](_0x1d7ddc+_0x467783(0xe5)+_0x170ea7+_0x467783(0x158)+_0x309018[_0x467783(0x143)]);}const _0x242f9d=[];if(_0x3c7030[_0x467783(0x6e)]&&Array[_0x467783(0xa1)](_0x3c7030[_0x467783(0x6e)]))for(let _0x361247=0x0;_0x361247<_0x3c7030[_0x467783(0x6e)][_0x467783(0x108)];_0x361247++){_0x3c7030['groups'][_0x361247][_0x467783(0x11e)]&&_0x3c7030[_0x467783(0x6e)][_0x361247][_0x467783(0x11e)]===_0x467783(0x147)&&_0x242f9d[_0x467783(0xac)](_0x3c7030[_0x467783(0x6e)][_0x361247]);}if(_0x242f9d[_0x467783(0x108)]>0x0)for(let _0xe9980=0x0;_0xe9980<_0x242f9d['length'];_0xe9980++){try{await _0x2730d1['modifyGroup'](_0x5b9749,_0x242f9d[_0xe9980]['id'],{'members':[{'operation':_0x467783(0x147),'value':_0x170ea7}]});}catch(_0x365d1c){_0x2730d1[_0x467783(0x138)][_0x467783(0x109)](_0x1d7ddc+_0x467783(0xe5)+_0x170ea7+'\x20group\x20removal\x20error:\x20'+_0x365d1c[_0x467783(0x143)]);}}}if(_0x56cd96['deleteUserOnLastGroupRoleRemoval']&&_0x5b8452[_0x467783(0xfc)]===_0x467783(0xc9)){if(_0x329483[_0x467783(0x6e)]&&Array[_0x467783(0xa1)](_0x329483['groups'])&&_0x329483[_0x467783(0x6e)]['length']===0x0){if(_0x329483[_0x467783(0x119)]&&Array[_0x467783(0xa1)](_0x329483[_0x467783(0x119)])&&_0x329483[_0x467783(0x119)]['length']===0x0){if(_0x5b8452[_0x467783(0xfe)]&&Array['isArray'](_0x5b8452[_0x467783(0xfe)])&&_0x5b8452[_0x467783(0xfe)][_0x467783(0x108)]>0x0){let _0x3d831a=![];for(let _0x304300=0x0;_0x304300<_0x5b8452[_0x467783(0xfe)]['length'];_0x304300++){const _0x5090c9=_0x5b8452['Operations'][_0x304300];if(_0x5090c9['op']===_0x467783(0x17b)){if(_0x5090c9[_0x467783(0x140)]){if(_0x5090c9[_0x467783(0x140)]['startsWith'](_0x467783(0x119))&&_0x5090c9[_0x467783(0xbf)]){_0x3d831a=!![];break;}else{if(_0x5090c9[_0x467783(0x140)]===_0x467783(0x6e)){_0x3d831a=!![];break;}}}}}if(_0x3d831a){_0x2730d1['logger'][_0x467783(0x14c)](_0x1d7ddc+_0x467783(0xf1)+_0x170ea7);try{await _0x214cda(_0x5b9749,_0x170ea7);}catch(_0x59c92e){_0x2730d1[_0x467783(0x138)][_0x467783(0x109)](_0x1d7ddc+'\x20Delete\x20User\x20id='+_0x170ea7+_0x467783(0xa3)+_0x59c92e[_0x467783(0x143)]+'}'),_0x2730d1['logger'][_0x467783(0x14c)](_0x1d7ddc+_0x467783(0x163));return;}}}}}}}}_0x2730d1[_0x467783(0x138)]['debug'](_0x1d7ddc+_0x467783(0x163));}catch(_0x2e9f2e){_0x2730d1[_0x467783(0x138)][_0x467783(0x109)](_0x2730d1[_0x467783(0xe0)]+'['+_0x2730d1[_0x467783(0x144)]+_0x467783(0x9a)+_0x5b9749+']['+_0xba9185+_0x467783(0x172)+_0x2e9f2e['message']+_0x467783(0x156));}},_0xe0ea44=jetstream(_0x2c09e0),_0x38b913=(_0x5c75a6(0x75)+_0x2730d1[_0x5c75a6(0x144)]+'_'+_0x5b9749)['replaceAll']('*','#')['replaceAll']('>','##')['replaceAll']('.','_'),_0x1d15b=_0xba9185[_0x5c75a6(0x10a)]('.')[0x0][_0x5c75a6(0x14a)]()==='GW',_0x30df98=async()=>{const _0x3a40ba=_0x5c75a6;try{let _0x29001d;const _0x32de5e=''+_0x56cd96?.[_0x3a40ba(0xde)]?.[_0x3a40ba(0x9c)],_0x4af91e=await jetstreamManager(_0x2c09e0),_0x5055d2=async()=>{const _0x56af9c=_0x3a40ba;let _0x36b016;try{_0x36b016=await _0xe0ea44[_0x56af9c(0xee)][_0x56af9c(0x173)](_0x32de5e,_0x38b913);}catch(_0x1db7b5){const _0x101815={'durable_name':_0x38b913,'deliver_policy':DeliverPolicy[_0x56af9c(0xa7)],'ack_policy':AckPolicy[_0x56af9c(0xf7)],'filter_subject':_0xba9185};await _0x4af91e[_0x56af9c(0xee)][_0x56af9c(0x79)](_0x32de5e,_0x101815),_0x36b016=await _0xe0ea44[_0x56af9c(0xee)]['get'](_0x32de5e,_0x38b913);}if(_0x36b016?.[_0x56af9c(0x89)]?.[_0x56af9c(0x13e)]?.['deliver_policy']!==_0x56af9c(0x16b))throw new Error(_0x56af9c(0x161));_0x36b016?.[_0x56af9c(0x89)]?.[_0x56af9c(0x13e)]?.[_0x56af9c(0x176)]!==_0xba9185&&(await _0x4af91e[_0x56af9c(0xee)]['update'](_0x32de5e,_0x38b913,{'filter_subject':_0xba9185}),_0x36b016=await _0xe0ea44['consumers'][_0x56af9c(0x173)](_0x32de5e,_0x38b913)),_0x29001d=await _0x36b016['consume']({'max_messages':0x64}),_0x3732e8(_0x29001d);},_0x3732e8=async _0x356bd0=>{const _0x44db9f=_0x3a40ba;for await(const _0xa528c4 of await _0x356bd0[_0x44db9f(0x90)]()){switch(_0xa528c4[_0x44db9f(0xdf)]){case _0x44db9f(0x7e):_0x2730d1[_0x44db9f(0x138)][_0x44db9f(0xe3)](_0x2730d1[_0x44db9f(0xe0)]+'['+_0x2730d1['pluginName']+_0x44db9f(0x9a)+_0x5b9749+']['+_0xba9185+']\x20client\x20consumer\x20reinitiated\x20because\x20of\x20'+_0xa528c4[_0x44db9f(0xdf)]),_0x5055d2();return;}}};await _0x5055d2();let _0x443c1b=-0x1;do{for await(const _0x3000f8 of _0x29001d){if(!_0x3000f8[_0x3a40ba(0xe9)]||!_0x3000f8['headers']['get'](_0x3a40ba(0xb9))){_0x3000f8['ack']();continue;}_0x443c1b=_0x29001d['getProcessed']();const _0x4c2be6=_0x2730d1['gwName']+'['+_0x2730d1[_0x3a40ba(0x144)]+_0x3a40ba(0x9a)+_0x5b9749+']['+_0x3000f8[_0x3a40ba(0x70)]+']['+_0x443c1b+']['+(_0x3000f8[_0x3a40ba(0xe9)]?_0x3000f8['headers']['get']('Msg-Id'):'')+']',_0x5041d9=_0x3000f8[_0x3a40ba(0x84)](),_0x19c5fb=await _0xe41422(_0x4c2be6,_0x5041d9);if(!_0x19c5fb||_0x19c5fb!==!![])_0x3000f8[_0x3a40ba(0xe2)]();else _0x2730d1['logger'][_0x3a40ba(0x109)](_0x4c2be6+_0x3a40ba(0xd8));if(_0x443c1b<0x1)break;}}while(_0x443c1b===0x0);}catch(_0x4d72dd){_0x2730d1[_0x3a40ba(0x138)][_0x3a40ba(0x109)](_0x2730d1[_0x3a40ba(0xe0)]+'['+_0x2730d1['pluginName']+_0x3a40ba(0x9a)+_0x5b9749+']['+_0xba9185+']\x20subscriber\x20stopped\x20error:\x20'+_0x4d72dd[_0x3a40ba(0x143)]);}},_0x569123=async()=>{const _0x2e1f96=_0x5c75a6,_0x2bb45e=_0x2c09e0[_0x2e1f96(0xba)](_0xba9185,{'max':0x64});for await(const _0x1f749b of _0x2bb45e){const _0x552876=_0x1f749b[_0x2e1f96(0xe9)]['get'](_0x2e1f96(0xb9));if(!_0x1f749b[_0x2e1f96(0xe9)]||!_0x552876)continue;const _0x301032=_0x2730d1[_0x2e1f96(0xe0)]+'['+_0x2730d1[_0x2e1f96(0x144)]+_0x2e1f96(0x9a)+_0x5b9749+']['+_0x1f749b['subject']+']['+(_0x1f749b[_0x2e1f96(0xe9)]?_0x552876:'')+']';_0x2730d1[_0x2e1f96(0x138)][_0x2e1f96(0x14c)](_0x301032+_0x2e1f96(0x77));const _0x37bd5b={'func':'','id':'','obj':''};let _0xd3e3b0;try{try{_0xd3e3b0=JSON[_0x2e1f96(0x184)](_0x1f749b[_0x2e1f96(0x84)]());}catch(_0x3ec169){const _0x5770a9='subscriber\x20message\x20error:\x20message\x20not\x20JSON\x20formatted';_0x2730d1[_0x2e1f96(0x138)]['error'](_0x2730d1['gwName']+'['+_0x2730d1[_0x2e1f96(0x144)]+_0x2e1f96(0x9a)+_0x5b9749+']['+_0xba9185+']\x20'+_0x5770a9+':\x20'+_0x1f749b[_0x2e1f96(0x84)]());throw new Error(_0x5770a9);}const _0x458353=_0xd3e3b0['ctx'];if(_0x458353?.['routeObj']?.['id'])_0x37bd5b['id']=_0x458353['routeObj']['id'];if(_0x458353?.[_0x2e1f96(0x7d)]?.['body'])_0x37bd5b[_0x2e1f96(0x177)]=a0_0x5892aa[_0x2e1f96(0x9f)](_0x458353['request'][_0x2e1f96(0xb0)]);if(_0x458353?.[_0x2e1f96(0x7d)]?.[_0x2e1f96(0xe9)]?.[_0x2e1f96(0x8f)]){const _0x357860=_0x458353['request']['headers'][_0x2e1f96(0x8f)];if(_0x357860)_0x458353[_0x2e1f96(0x7d)][_0x2e1f96(0xe9)][_0x2e1f96(0x8f)]=a0_0x5892aa[_0x2e1f96(0x12b)](_0x357860,_0x552876);}if(_0x458353?.['passThrough']?.[_0x2e1f96(0xe9)]?.[_0x2e1f96(0x8f)]){const _0x2b5d86=_0x458353[_0x2e1f96(0x117)][_0x2e1f96(0xe9)][_0x2e1f96(0x8f)];if(_0x2b5d86)_0x458353[_0x2e1f96(0x117)][_0x2e1f96(0xe9)][_0x2e1f96(0x8f)]=a0_0x5892aa['getEncrypted'](_0x2b5d86,_0x552876);}if(_0x2730d1[_0x2e1f96(0x13e)][_0x2e1f96(0x11a)][_0x2e1f96(0x12f)])await _0x2850f9(_0x458353);else{const _0x38f08e=_0x458353?.[_0x2e1f96(0xb7)]?.[_0x2e1f96(0x139)]+'\x20'+_0x458353?.[_0x2e1f96(0xb7)]?.[_0x2e1f96(0x116)];_0x37bd5b[_0x2e1f96(0x92)]=_0x38f08e;switch(_0x38f08e){case _0x2e1f96(0x179):case'GET\x20groups':case _0x2e1f96(0x154):if(_0x458353['routeObj']['id'])await _0x5d2fa5[_0x2e1f96(0x10f)](_0x458353);else await _0x5d2fa5[_0x2e1f96(0x174)](_0x458353);break;case _0x2e1f96(0x10d):await _0x5d2fa5[_0x2e1f96(0xfd)](_0x458353);break;case _0x2e1f96(0x126):await _0x5d2fa5[_0x2e1f96(0x99)](_0x458353);break;case'GET\x20serviceproviderconfig':case _0x2e1f96(0x103):await _0x5d2fa5['getHandlerServiceProviderConfig'](_0x458353);break;case _0x2e1f96(0xfb):case _0x2e1f96(0x80):await _0x5d2fa5[_0x2e1f96(0x7b)](_0x458353);break;case _0x2e1f96(0x160):await _0x5d2fa5[_0x2e1f96(0x113)](_0x458353);break;case _0x2e1f96(0x16f):case _0x2e1f96(0x180):await _0x5d2fa5[_0x2e1f96(0xd7)](_0x458353);break;case _0x2e1f96(0xe7):await _0x5d2fa5['putApiHandler'](_0x458353);break;case _0x2e1f96(0xd2):case _0x2e1f96(0xc5):await _0x5d2fa5['postHandler'](_0x458353);break;case _0x2e1f96(0x171):await _0x5d2fa5['postApiHandler'](_0x458353);break;case _0x2e1f96(0xc1):case _0x2e1f96(0xec):await _0x5d2fa5['deleteHandler'](_0x458353);break;case _0x2e1f96(0x124):await _0x5d2fa5[_0x2e1f96(0x189)](_0x458353);break;default:_0x458353[_0x2e1f96(0x15f)]=new Response('NOT_FOUND',{'status':0x194});}}if(!_0x458353[_0x2e1f96(0x15f)])_0x458353[_0x2e1f96(0x15f)]=null;const _0xb29a17=JSON[_0x2e1f96(0x14d)](_0x458353[_0x2e1f96(0x15f)]);_0x1f749b[_0x2e1f96(0x13b)](_0xb29a17),_0x2730d1[_0x2e1f96(0x138)][_0x2e1f96(0xe3)](_0x301032+_0x2e1f96(0x17a)+_0x37bd5b[_0x2e1f96(0x92)]+',\x20obj='+(_0x37bd5b[_0x2e1f96(0x177)]?JSON['stringify'](_0x37bd5b[_0x2e1f96(0x177)]):'')+_0x2e1f96(0x110)+(_0x37bd5b['id']?_0x37bd5b['id']:'')+_0x2e1f96(0xe8)+_0xb29a17);}catch(_0x2a45e9){const _0x5c4abd=_0x2e1f96(0xe6)+_0x2a45e9[_0x2e1f96(0x143)]+'\x22,\x22errName\x22:\x22'+_0x2a45e9[_0x2e1f96(0x104)]+'\x22}';_0x1f749b['respond'](_0x5c4abd),_0x2730d1[_0x2e1f96(0x138)][_0x2e1f96(0xe3)]((_0x301032||'')+_0x2e1f96(0x17a)+_0x37bd5b['func']+_0x2e1f96(0xb8)+(_0x37bd5b[_0x2e1f96(0x177)]?JSON[_0x2e1f96(0x14d)](_0x37bd5b[_0x2e1f96(0x177)]):'')+',\x20id='+(_0x37bd5b['id']?_0x37bd5b['id']:'')+_0x2e1f96(0x11f)+_0x5c4abd);}}};if(_0x1d15b)_0x569123();else _0x30df98();},_0x10b2ac=async(_0x266364,_0x4fe08b)=>{const _0x3312a7=_0x2fe9b2,_0x2f02d5=_0x25503f[_0x266364]['config']?.[_0x3312a7(0xde)]?.['subject'];let _0x1432e0=0x0;for await(const _0x146785 of _0x4fe08b[_0x3312a7(0x90)]()){switch(_0x146785[_0x3312a7(0xdf)]){case _0x3312a7(0x159):_0x2730d1[_0x3312a7(0x138)][_0x3312a7(0x109)](_0x2730d1[_0x3312a7(0xe0)]+'['+_0x2730d1[_0x3312a7(0x144)]+_0x3312a7(0x9a)+_0x266364+']['+_0x2f02d5+_0x3312a7(0xa9)+_0x146785['data']+'\x20-\x20will\x20do\x20auto\x20reconnect\x20when\x20connection\x20becomes\x20available'),_0x1432e0=0x0;break;case'reconnect':_0x2730d1['logger'][_0x3312a7(0xe3)](_0x2730d1[_0x3312a7(0xe0)]+'['+_0x2730d1['pluginName']+_0x3312a7(0x9a)+_0x266364+']['+_0x2f02d5+']\x20client\x20reconnected\x20'+_0x146785[_0x3312a7(0xbc)]);break;case _0x3312a7(0x109):_0x2730d1['logger'][_0x3312a7(0x109)](_0x2730d1[_0x3312a7(0xe0)]+'['+_0x2730d1['pluginName']+_0x3312a7(0x9a)+_0x266364+']['+_0x2f02d5+_0x3312a7(0x170)+_0x146785[_0x3312a7(0xbc)]);break;case _0x3312a7(0x178):_0x1432e0+=0x1;_0x1432e0%0x1e===0x0&&_0x2730d1[_0x3312a7(0x138)][_0x3312a7(0x14c)](_0x2730d1[_0x3312a7(0xe0)]+'['+_0x2730d1['pluginName']+_0x3312a7(0x9a)+_0x266364+']['+_0x2f02d5+']\x20client\x20is\x20attempting\x20to\x20reconnect\x20'+_0x146785['data']+_0x3312a7(0x151)+_0x1432e0+')');break;case _0x3312a7(0x141):_0x2730d1[_0x3312a7(0x138)]['debug'](_0x2730d1[_0x3312a7(0xe0)]+'['+_0x2730d1[_0x3312a7(0x144)]+_0x3312a7(0x9a)+_0x266364+']['+_0x2f02d5+']\x20client\x20has\x20a\x20stale\x20connection\x20'+_0x146785[_0x3312a7(0xbc)]);break;}}};process['on'](_0x2fe9b2(0x83),async()=>{const _0x16a4c2=_0x2fe9b2;for(const _0x2b5c40 in _0x25503f){_0x25503f[_0x2b5c40]['nc']&&!_0x25503f[_0x2b5c40]['nc'][_0x16a4c2(0x13d)]()&&await _0x25503f[_0x2b5c40]['nc'][_0x16a4c2(0x6d)]();}}),process['on'](_0x2fe9b2(0x183),async()=>{const _0x276ae4=_0x2fe9b2;for(const _0x448dbf in _0x25503f){_0x25503f[_0x448dbf]['nc']&&!_0x25503f[_0x448dbf]['nc'][_0x276ae4(0x13d)]()&&await _0x25503f[_0x448dbf]['nc'][_0x276ae4(0x6d)]();}});const _0x4711f7=async(_0x2be8b4,_0x81c7aa,_0xf0e164)=>{const _0x29bcdf=_0x2fe9b2,_0x1e0d09={'attribute':_0x81c7aa,'operator':'eq','value':_0xf0e164,'rawFilter':undefined,'startIndex':undefined,'count':undefined},_0x2b4c78=[_0x81c7aa];if(_0x81c7aa!=='id')_0x2b4c78[_0x29bcdf(0xac)]('id');try{const _0x173c40=await _0x3dc962(_0x2be8b4,_0x1e0d09,_0x2b4c78);if(!_0x173c40||!_0x173c40['Resources']||!Array[_0x29bcdf(0xa1)](_0x173c40[_0x29bcdf(0x17e)]))throw new Error(_0x29bcdf(0xaf)+JSON[_0x29bcdf(0x14d)](_0x1e0d09)+_0x29bcdf(0x8d));if(_0x173c40[_0x29bcdf(0x17e)][_0x29bcdf(0x108)]===0x0)return null;else{if(_0x173c40['Resources'][_0x29bcdf(0x108)]>0x2)throw new Error('getUsers()\x20getObj='+JSON[_0x29bcdf(0x14d)](_0x1e0d09)+_0x29bcdf(0x14f));else{const _0x107ef6=_0x173c40['Resources'][0x0];if(!_0x107ef6['id'])throw new Error(_0x29bcdf(0xaf)+JSON[_0x29bcdf(0x14d)](_0x1e0d09)+'\x20result='+JSON[_0x29bcdf(0x14d)](_0x107ef6)+_0x29bcdf(0xcc));return decodeURIComponent(_0x107ef6['id']);}}}catch(_0x519c15){throw new Error(_0x29bcdf(0xaf)+JSON[_0x29bcdf(0x14d)](_0x1e0d09)+'\x20error:\x20'+_0x519c15[_0x29bcdf(0x143)]+'}');}},_0x3dc962=async(_0x46140,_0x2a2fb2,_0x276db4)=>{const _0x5df62d=_0x2fe9b2;if(!_0x4e0537)return await _0x2730d1[_0x5df62d(0x95)](_0x46140,_0x2a2fb2,_0x276db4);if(!_0x2a2fb2?.['operator']||_0x2a2fb2['operator']!=='eq')throw new Error('getUsers()\x20error:\x20unsupported\x20operator\x20for\x20getObj:\x20'+JSON['stringify'](_0x2a2fb2));if(_0x46140===_0x5df62d(0x7c))_0x46140=undefined;let _0x540fae=_0x46140?'/'+_0x46140+'/Users':_0x5df62d(0x15c);if(_0x2a2fb2[_0x5df62d(0x81)]==='id'){_0x540fae+='/'+_0x2a2fb2['value'];if(_0x276db4&&_0x276db4[_0x5df62d(0x108)]>0x0)_0x540fae+=_0x5df62d(0xc3)+_0x276db4[_0x5df62d(0x142)](',');}else{if(_0x2a2fb2[_0x5df62d(0x81)]===_0x5df62d(0xfa)){_0x540fae+=_0x5df62d(0xb4)+_0x2a2fb2['value']+'\x22';if(_0x276db4&&_0x276db4[_0x5df62d(0x108)]>0x0)_0x540fae+=_0x5df62d(0x105)+_0x276db4[_0x5df62d(0x142)](',');}else{if(_0x2a2fb2[_0x5df62d(0x81)]===_0x5df62d(0xdc)){_0x540fae+=_0x5df62d(0x15a)+_0x2a2fb2[_0x5df62d(0xda)]+'\x22';if(_0x276db4&&_0x276db4['length']>0x0)_0x540fae+=_0x5df62d(0x105)+_0x276db4[_0x5df62d(0x142)](',');}else throw new Error(_0x5df62d(0x111)+JSON[_0x5df62d(0x14d)](_0x2a2fb2));}}return await _0x4d7f62(_0x46140,'GET',_0x540fae);},_0x2313a6=async(_0x5b2605,_0x804271)=>{const _0x2896a5=_0x2fe9b2;if(!_0x4e0537)return await _0x2730d1['createUser'](_0x5b2605,_0x804271);if(_0x5b2605==='undefined')_0x5b2605=undefined;const _0x23fc9d=_0x5b2605?'/'+_0x5b2605+_0x2896a5(0x15c):_0x2896a5(0x15c);return await _0x4d7f62(_0x5b2605,_0x2896a5(0xb2),_0x23fc9d,_0x804271);},_0x1a4ddc=async(_0x4652ca,_0x2feed3,_0x12c7a4,_0xb97478,_0x53716b)=>{const _0x34ed9f=_0x2fe9b2;if(!_0x4652ca||_0x4652ca[_0x34ed9f(0x17d)]()!=='users')throw new Error('replaceUsrGrp()\x20error:\x20stream\x20replaceUsrGrp\x20must\x20be\x20type\x20\x22Users\x22');if(!_0x4e0537)return await _0x5d2fa5[_0x34ed9f(0x125)](_0x34ed9f(0xf3),_0x2feed3,_0x12c7a4,_0xb97478,_0x53716b);if(_0x2feed3===_0x34ed9f(0x7c))_0x2feed3=undefined;const _0x5313b7=_0x2feed3?'/'+_0x2feed3+_0x34ed9f(0xcb)+_0x12c7a4:_0x34ed9f(0xcb)+_0x12c7a4;return await _0x4d7f62(_0x2feed3,_0x34ed9f(0xa8),_0x5313b7,_0xb97478);},_0x214cda=async(_0x545386,_0x20d42f)=>{const _0x1e5283=_0x2fe9b2;!_0x4e0537&&await _0x2730d1[_0x1e5283(0x10e)](_0x545386,_0x20d42f);if(_0x545386===_0x1e5283(0x7c))_0x545386=undefined;const _0x433af=_0x545386?'/'+_0x545386+'/Users/'+_0x20d42f:'/Users/'+_0x20d42f;return await _0x4d7f62(_0x545386,'DELETE',_0x433af);},_0x6c74c7=_0x5136cd=>{const _0x3733b7=_0x2fe9b2;if(!_0x5136cd||typeof _0x5136cd!=='string')return[null,null];_0x5136cd=_0x5136cd[_0x3733b7(0xf6)]();const _0x52a80b=_0x5136cd[_0x3733b7(0x9d)]('(');if(_0x52a80b<0x1)return[null,null];if(_0x5136cd[_0x3733b7(0x102)](_0x5136cd[_0x3733b7(0x108)]-0x1)!==')')return[null,null];if(_0x44fb79(_0x5136cd,'(')!==_0x44fb79(_0x5136cd,')'))return[null,null];const _0x3e5b8b=_0x5136cd['substring'](0x0,_0x52a80b),_0x389cba=_0x5136cd[_0x3733b7(0x102)](_0x52a80b+0x1,_0x5136cd[_0x3733b7(0x108)]-0x1);let _0x4a73c5=[];const _0x387dd7=_0x389cba[_0x3733b7(0x10a)](',');let _0x3cfdba='';for(let _0x3b608e=0x0;_0x3b608e<_0x387dd7['length'];_0x3b608e++){const _0x17a7f4=_0x3cfdba?_0x3cfdba+','+_0x387dd7[_0x3b608e]:_0x387dd7[_0x3b608e],_0x46714b=_0x44fb79(_0x17a7f4,'('),_0x7bdfc8=_0x44fb79(_0x17a7f4,')');if(_0x46714b===_0x7bdfc8)_0x4a73c5[_0x3733b7(0xac)](_0x39fe17(_0x17a7f4,'\x22')),_0x3cfdba='';else{if(_0x3cfdba)_0x3cfdba+=','+_0x387dd7[_0x3b608e];else _0x3cfdba+=_0x387dd7[_0x3b608e];}}if(_0x4a73c5[_0x3733b7(0x108)]===0x0)_0x4a73c5=null;return[_0x3e5b8b,_0x4a73c5];};function _0x44fb79(_0x1614fe,_0x3295a2){const _0xb69b5d=_0x2fe9b2;let _0x335d79=0x0;for(let _0x2c439c=0x0;_0x2c439c<_0x1614fe['length'];_0x2c439c++){_0x1614fe[_0xb69b5d(0x15b)](_0x2c439c)===_0x3295a2&&(_0x335d79+=0x1);}return _0x335d79;}const _0x39fe17=(_0x49ba5f,_0x255364)=>{const _0x349639=_0x2fe9b2;if(typeof _0x49ba5f!==_0x349639(0x84)||typeof _0x255364!==_0x349639(0x84))return _0x49ba5f;if(_0x49ba5f['length']===0x1)return _0x49ba5f;if(_0x255364['length']!==0x1)return _0x49ba5f;return _0x49ba5f=_0x49ba5f['trim'](),_0x49ba5f['substring'](0x0,0x1)===_0x255364&&(_0x49ba5f=_0x49ba5f[_0x349639(0x102)](0x1)),_0x49ba5f[_0x349639(0x102)](_0x49ba5f[_0x349639(0x108)]-0x1)===_0x255364&&(_0x49ba5f=_0x49ba5f[_0x349639(0x102)](0x0,_0x49ba5f[_0x349639(0x108)]-0x1)),_0x49ba5f;},_0x38e199=async(_0x526755,_0x143c9f,_0x5a3eaf,_0x216bb5)=>{const _0x13a8bf=_0x2fe9b2;if(!_0x143c9f||!_0x5a3eaf||!_0x216bb5)return null;const [_0x2d71d9,_0x3fea78]=_0x6c74c7(_0x216bb5);if(!_0x2d71d9||!_0x3fea78){const _0x247ffa=_0x216bb5[_0x13a8bf(0x10a)]('(');if(_0x247ffa['length']>0x1){const _0x1488d0=[_0x13a8bf(0xd1),_0x13a8bf(0x93),_0x13a8bf(0xd0),'elementnumber',_0x13a8bf(0x142),_0x13a8bf(0x16a),'normalize','increment',_0x13a8bf(0x182)],_0x168f41=_0x247ffa[0x0][_0x13a8bf(0x17d)]();if(_0x1488d0[_0x13a8bf(0x11b)](_0x168f41))return null;}return _0x216bb5;}for(let _0x1d27d7=0x0;_0x1d27d7<_0x3fea78[_0x13a8bf(0x108)];_0x1d27d7++){if(_0x3fea78[_0x1d27d7][_0x13a8bf(0x102)](0x0,0x1)==='['){const _0x71f61d=_0x3fea78[_0x1d27d7][_0x13a8bf(0x9d)](']');if(_0x71f61d<0x0)return null;const _0x15b5d7=_0x3fea78[_0x1d27d7][_0x13a8bf(0x102)](0x1,_0x71f61d),_0x1060a2=_0x15b5d7[_0x13a8bf(0x10a)]('.');let _0x46918b;for(let _0x4b95bb=0x0;_0x4b95bb<_0x1060a2[_0x13a8bf(0x108)];_0x4b95bb++){if(_0x4b95bb===0x0)_0x46918b=_0x143c9f[_0x1060a2[_0x4b95bb]];else{if(!_0x46918b)return null;_0x46918b=_0x46918b[_0x1060a2[_0x4b95bb]];}}if(!_0x46918b)return null;_0x3fea78[_0x1d27d7]=_0x46918b;}}for(let _0x34d1bc=0x0;_0x34d1bc<_0x3fea78['length'];_0x34d1bc++){const [_0x1bbcbe]=_0x6c74c7(_0x3fea78[_0x34d1bc]);_0x1bbcbe&&(_0x3fea78[_0x34d1bc]=await _0x38e199(_0x526755,_0x143c9f,_0x5a3eaf,_0x3fea78[_0x34d1bc]));}if(_0x3fea78[0x0]===null)return null;switch(_0x2d71d9[_0x13a8bf(0x17d)]()){case _0x13a8bf(0xd1):{if(_0x3fea78[_0x13a8bf(0x108)]!==0x1)return null;const [_0x19391b]=_0x6c74c7(_0x3fea78[0x0]);if(_0x19391b)_0x3fea78[0x0]=await _0x38e199(_0x526755,_0x143c9f,_0x5a3eaf,_0x19391b);if(_0x3fea78[0x0]===null)return null;return _0x3fea78[0x0][_0x13a8bf(0x17d)]();}case _0x13a8bf(0x93):{if(_0x3fea78['length']!==0x1)return null;const [_0x42cca0]=_0x6c74c7(_0x3fea78[0x0]);if(_0x42cca0)_0x3fea78[0x0]=await _0x38e199(_0x526755,_0x143c9f,_0x5a3eaf,_0x42cca0);if(_0x3fea78[0x0]===null)return null;return _0x3fea78[0x0]['toUpperCase']();}case'firstn':{if(_0x3fea78[_0x13a8bf(0x108)]!==0x2)return null;const [_0x58a682]=_0x6c74c7(_0x3fea78[0x0]);if(_0x58a682)_0x3fea78[0x0]=await _0x38e199(_0x526755,_0x143c9f,_0x5a3eaf,_0x58a682);if(_0x3fea78[0x0]===null)return null;if(isNaN(_0x3fea78[0x1]))return null;return _0x3fea78[0x0][_0x13a8bf(0x102)](0x0,_0x3fea78[0x1]);}case _0x13a8bf(0xf0):{const [_0xef1a52]=_0x6c74c7(_0x3fea78[0x0]);if(_0x3fea78[_0x13a8bf(0x108)]<0x2)return null;if(_0xef1a52)_0x3fea78[0x0]=await _0x38e199(_0x526755,_0x143c9f,_0x5a3eaf,_0xef1a52);if(_0x3fea78[0x0]===null)return null;const _0x6ae567=_0x3fea78[0x1];if(isNaN(_0x6ae567))return null;let _0x19ef57;if(_0x3fea78['length']===0x3)_0x19ef57=_0x3fea78[0x0][_0x13a8bf(0x10a)](_0x3fea78[0x2]);else _0x19ef57=_0x19ef57=_0x3fea78[0x0][_0x13a8bf(0x10a)]('\x20');if(_0x6ae567<=_0x19ef57['length'])return _0x19ef57[_0x6ae567-0x1];else return'';}case _0x13a8bf(0x16a):{const [_0x51b3d6]=_0x6c74c7(_0x3fea78[0x0]);if(_0x51b3d6)_0x3fea78[0x0]=await _0x38e199(_0x526755,_0x143c9f,_0x5a3eaf,_0x51b3d6);if(_0x3fea78[0x0]===null)return null;if(_0x3fea78[_0x13a8bf(0x108)]!==0x3)return null;return _0x3fea78[0x0][_0x13a8bf(0xb1)](_0x3fea78[0x1],_0x3fea78[0x2]);}case _0x13a8bf(0x18a):{if(_0x3fea78[_0x13a8bf(0x108)]!==0x1)return null;const [_0x37996f]=_0x6c74c7(_0x3fea78[0x0]);if(_0x37996f)_0x3fea78[0x0]=await _0x38e199(_0x526755,_0x143c9f,_0x5a3eaf,_0x37996f);if(_0x3fea78[0x0]===null)return null;return a0_0x38a5e6[_0x13a8bf(0xf4)](_0x3fea78[0x0]);}case _0x13a8bf(0x142):{let _0x49f318='';for(let _0x5c19d5=0x0;_0x5c19d5<_0x3fea78['length'];_0x5c19d5++){const [_0x22fc5a]=_0x6c74c7(_0x3fea78[_0x5c19d5]);if(_0x22fc5a)_0x3fea78[_0x5c19d5]=await _0x38e199(_0x526755,_0x143c9f,_0x5a3eaf,_0x22fc5a);if(_0x3fea78[_0x5c19d5]===null)return null;_0x49f318+=_0x3fea78[_0x5c19d5];}return _0x49f318;}case'increment':{if(_0x3fea78[_0x13a8bf(0x108)]>0x2)return null;const [_0x279a01]=_0x6c74c7(_0x3fea78[0x0]);if(_0x279a01)_0x3fea78[0x0]=await _0x38e199(_0x526755,_0x143c9f,_0x5a3eaf,_0x279a01);if(_0x3fea78[0x0]===null)return null;const _0x22766a=parseInt(_0x3fea78[0x0]);if(isNaN(_0x22766a))return null;let _0x43a3f4=_0x13a8bf(0xcf);_0x43a3f4+=','+_0x3fea78[0x0];if(_0x3fea78['length']===0x2&&_0x3fea78[0x1][_0x13a8bf(0x17d)]()===_0x13a8bf(0xaa))_0x43a3f4+=_0x13a8bf(0x68);else _0x43a3f4+=',false';return _0x43a3f4+='##',_0x43a3f4;}case _0x13a8bf(0x182):{if(_0x3fea78[_0x13a8bf(0x108)]!==0x1)return null;const [_0x334de8]=_0x6c74c7(_0x3fea78[0x0]);if(_0x334de8)_0x3fea78[0x0]=await _0x38e199(_0x526755,_0x143c9f,_0x5a3eaf,_0x334de8);if(_0x3fea78[0x0]===null)return null;let _0x332de5,_0x1e6158=![],_0x245483='';const _0x496f56=_0x3fea78[0x0][_0x13a8bf(0x10a)]('##');if(_0x496f56[_0x13a8bf(0x108)]>0x2)for(let _0x19d036=0x0;_0x19d036<_0x496f56[_0x13a8bf(0x108)];_0x19d036++){if(_0x496f56[_0x19d036][_0x13a8bf(0x106)](_0x13a8bf(0x15e))){const _0x42cfd4=_0x496f56[_0x19d036]['split'](',');if(_0x42cfd4[_0x13a8bf(0x108)]<0x2)return null;const _0x3c2a15=parseInt(_0x42cfd4[0x1]);if(isNaN(_0x3c2a15))return null;_0x245483='##'+_0x496f56[_0x19d036]+'##',_0x332de5=_0x42cfd4[0x1],_0x42cfd4[_0x13a8bf(0x108)]>0x2&&(_0x1e6158=_0x42cfd4[0x2][_0x13a8bf(0x17d)]()===_0x13a8bf(0xaa));}}let _0x246c0b,_0x2f0c4a=0x0,_0x2882e2=0x0;if(_0x332de5){_0x2882e2=_0x332de5[_0x13a8bf(0x108)],_0x2f0c4a=0xa;for(let _0x48847a=0x1;_0x48847a<_0x2882e2;_0x48847a++){_0x2f0c4a*=0xa;}_0x2f0c4a-=0x1,_0x246c0b=parseInt(_0x332de5);if(isNaN(_0x246c0b))return null;_0x246c0b-=0x1;}else _0x246c0b=0x0;do{_0x246c0b+=0x1;let _0x5a9fb0=_0x3fea78[0x0];if(_0x332de5!==undefined&&_0x245483){let _0x499c1e=_0x246c0b[_0x13a8bf(0x146)]();while(_0x499c1e[_0x13a8bf(0x108)]<_0x2882e2){_0x499c1e='0'+_0x499c1e;}_0x1e6158?_0x5a9fb0=_0x5a9fb0[_0x13a8bf(0x16a)](_0x245483,_0x499c1e):(_0x5a9fb0=_0x5a9fb0['replace'](_0x245483,''),_0x1e6158=!![],_0x246c0b-=0x1);}try{const _0x5082d1=await _0x4711f7(_0x526755,_0x5a3eaf,_0x5a9fb0);if(!_0x5082d1)return _0x5a9fb0;}catch(_0x5eb424){return _0x2730d1[_0x13a8bf(0x138)][_0x13a8bf(0x109)](_0x2730d1[_0x13a8bf(0xe0)]+'['+_0x2730d1[_0x13a8bf(0x144)]+']\x20'+_0x2d71d9+_0x13a8bf(0x6f)+_0x5eb424[_0x13a8bf(0x143)]),null;}}while(_0x246c0b<_0x2f0c4a);return null;}default:}return null;},_0x557960=async(_0x597633,_0xe01e9c)=>{const _0x2ac945=_0x2fe9b2;for(const _0x478bf3 in _0xe01e9c){const _0xa0bdae=_0xe01e9c[_0x478bf3],[_0x162134,_0x4e8246]=_0x6c74c7(_0xa0bdae);if(_0x162134){const _0x5d621b=''+_0x478bf3,_0xe4339c=_0x162134+'('+_0x4e8246[_0x2ac945(0x142)](',')+')',_0x1c4d8a=await _0x38e199(_0x597633,_0xe01e9c,_0x5d621b,_0xe4339c);if(_0x1c4d8a===null)delete _0xe01e9c[_0x478bf3];else _0xe01e9c[_0x478bf3]=_0x1c4d8a;}for(const _0x159459 in _0xa0bdae){const _0x3731e9=_0xa0bdae[_0x159459],[_0x3c2d99,_0x52366d]=_0x6c74c7(_0x3731e9);if(_0x3c2d99){const _0x17d970=_0x478bf3+'.'+_0x159459,_0x552b3c=_0x3c2d99+'('+_0x52366d[_0x2ac945(0x142)](',')+')',_0x1f6fbb=await _0x38e199(_0x597633,_0xe01e9c,_0x17d970,_0x552b3c);if(_0x1f6fbb===null)delete _0xa0bdae[_0x159459];else _0xa0bdae[_0x159459]=_0x1f6fbb;}}}return _0xe01e9c;},_0x4d7f62=async(_0x2b4381,_0xcbdf3c,_0x7c1aa0,_0x31d29b)=>{const _0x4ffa2a=_0x2fe9b2;if(!_0x4e0537)throw new Error(_0x4ffa2a(0x8c));if(!_0x2a68a4)throw new Error(_0x4ffa2a(0x15d));try{if(!_0x2730d1[_0x4ffa2a(0x16c)])_0x2730d1[_0x4ffa2a(0x16c)]=_0x2730d1['newHelperRest']();const _0x5adbb6={'headers':{'Authorization':_0x2a68a4}},_0x41fdc9=await _0x2730d1[_0x4ffa2a(0x16c)]['doRequest'](undefined,_0xcbdf3c,_0x4e0537+_0x7c1aa0,_0x31d29b,undefined,_0x5adbb6);return _0x41fdc9[_0x4ffa2a(0xb0)];}catch(_0x2a2f9a){try{const _0xc1118f=JSON['parse'](_0x2a2f9a[_0x4ffa2a(0x143)]);if(_0xc1118f[_0x4ffa2a(0xb0)])throw new Error(JSON[_0x4ffa2a(0x14d)](_0xc1118f[_0x4ffa2a(0xb0)]));throw new Error(_0x2a2f9a[_0x4ffa2a(0x143)]);}catch(_0x1ac986){throw new Error(_0x4ffa2a(0x17c)+_0x1ac986[_0x4ffa2a(0x143)]);}}},_0x2850f9=async _0x2c6807=>{const _0x260b57=_0x2fe9b2,_0xb5db13=_0x2730d1['config'][_0x260b57(0x11a)][_0x260b57(0x12f)];if(!_0xb5db13){_0x2c6807[_0x260b57(0x15f)][_0x260b57(0x90)]=0x1f4,_0x2730d1['logger'][_0x260b57(0x109)](_0x2730d1[_0x260b57(0xe0)]+'['+_0x2730d1['pluginName']+_0x260b57(0x145));return;}try{new URL(_0xb5db13);}catch(_0x1adec6){_0x2c6807[_0x260b57(0x15f)][_0x260b57(0x90)]=0x1f4,_0x2730d1[_0x260b57(0x138)]['error'](_0x2730d1[_0x260b57(0xe0)]+'['+_0x2730d1['pluginName']+_0x260b57(0x107)+_0x1adec6[_0x260b57(0x143)]);return;}try{if(!_0x2730d1[_0x260b57(0x16c)])_0x2730d1[_0x260b57(0x16c)]=_0x2730d1[_0x260b57(0xc2)]();const _0x5deb6f=new URL(_0x2c6807['request'][_0x260b57(0xd4)]),_0x4a3328=_0x2c6807[_0x260b57(0x7d)]['method'],_0x48dd4f=_0x2c6807[_0x260b57(0x7d)]['url'][_0x260b57(0x16a)](_0x5deb6f[_0x260b57(0x16e)],_0xb5db13),_0x246b18=_0x2c6807['request'][_0x260b57(0xb0)],_0x3dc7ab={'headers':{'Authorization':_0x2c6807[_0x260b57(0x7d)]['headers'][_0x260b57(0x8f)]}},_0x1d1efb=await _0x2730d1[_0x260b57(0x16c)][_0x260b57(0x157)](_0x260b57(0x7c),_0x4a3328,_0x48dd4f,_0x246b18,undefined,_0x3dc7ab);_0x2c6807[_0x260b57(0x15f)]['status']=_0x1d1efb[_0x260b57(0xd9)];try{_0x2c6807[_0x260b57(0x15f)]['body']=JSON[_0x260b57(0x14d)](_0x1d1efb[_0x260b57(0xb0)]);}catch(_0x544a80){_0x2c6807[_0x260b57(0x15f)][_0x260b57(0xb0)]=_0x1d1efb['body'];}}catch(_0x15be0e){try{const _0x9eb0cc=JSON[_0x260b57(0x184)](_0x15be0e[_0x260b57(0x143)]);_0x2c6807[_0x260b57(0x15f)][_0x260b57(0x90)]=_0x9eb0cc?.['body']?.['status']||_0x9eb0cc?.[_0x260b57(0xd9)]||0x1f4,_0x2c6807['response']['body']=_0x9eb0cc['body']?JSON[_0x260b57(0x14d)](_0x9eb0cc['body']):_0x15be0e[_0x260b57(0x143)];}catch(_0x16733e){_0x2c6807[_0x260b57(0x15f)][_0x260b57(0x90)]=0x1f4,_0x2730d1[_0x260b57(0x138)][_0x260b57(0x109)](_0x2730d1[_0x260b57(0xe0)]+'['+_0x2730d1[_0x260b57(0x144)]+_0x260b57(0xa0)+_0x15be0e[_0x260b57(0x143)]);}}};}}export class Publisher{constructor(_0x43eda9){const _0x3cfc2d=a0_0xab49,_0x72e218=_0x43eda9,_0x51e4fa={},_0x1ab482=async(_0x5968b9,_0x2efc54)=>{const _0x55f8f2=a0_0xab49,_0x175de2=_0x51e4fa[_0x5968b9]['config']?.[_0x55f8f2(0xde)]?.[_0x55f8f2(0x70)];let _0x83f2b3=0x0;for await(const _0x1c398c of _0x2efc54[_0x55f8f2(0x90)]()){switch(_0x1c398c['type']){case _0x55f8f2(0x159):_0x72e218[_0x55f8f2(0x138)][_0x55f8f2(0x109)](_0x72e218['gwName']+'['+_0x72e218[_0x55f8f2(0x144)]+_0x55f8f2(0x16d)+_0x5968b9+']['+_0x175de2+_0x55f8f2(0xa9)+_0x1c398c[_0x55f8f2(0xbc)]+_0x55f8f2(0x186)),_0x83f2b3=0x0;break;case _0x55f8f2(0x9e):_0x72e218[_0x55f8f2(0x138)][_0x55f8f2(0xe3)](_0x72e218[_0x55f8f2(0xe0)]+'['+_0x72e218[_0x55f8f2(0x144)]+']\x20publisher['+_0x5968b9+']['+_0x175de2+_0x55f8f2(0x67)+_0x1c398c[_0x55f8f2(0xbc)]);break;case _0x55f8f2(0x109):_0x72e218[_0x55f8f2(0x138)][_0x55f8f2(0x109)](_0x72e218['gwName']+'['+_0x72e218[_0x55f8f2(0x144)]+_0x55f8f2(0x16d)+_0x5968b9+']['+_0x175de2+_0x55f8f2(0x170)+_0x1c398c['data']);break;case _0x55f8f2(0x178):_0x83f2b3+=0x1;_0x83f2b3%0x1e===0x0&&_0x72e218[_0x55f8f2(0x138)][_0x55f8f2(0x14c)](_0x72e218[_0x55f8f2(0xe0)]+'['+_0x72e218[_0x55f8f2(0x144)]+_0x55f8f2(0x16d)+_0x5968b9+']['+_0x175de2+_0x55f8f2(0x8e)+_0x1c398c['data']+_0x55f8f2(0x151)+_0x83f2b3+')');break;case _0x55f8f2(0x141):_0x72e218[_0x55f8f2(0x138)][_0x55f8f2(0x14c)](_0x72e218[_0x55f8f2(0xe0)]+'['+_0x72e218[_0x55f8f2(0x144)]+_0x55f8f2(0x16d)+_0x5968b9+']['+_0x175de2+_0x55f8f2(0x120)+_0x1c398c[_0x55f8f2(0xbc)]);break;}}},_0x5b9475=async(_0x534079,_0x3a0563)=>{const _0x74c456=a0_0xab49,_0x13464e=_0x51e4fa[_0x534079][_0x74c456(0x13e)]?.['nats']?.[_0x74c456(0x70)];let _0x47e971;try{_0x47e971=await a0_0x2cc5a3(_0x3a0563);if(_0x47e971[_0x74c456(0xe3)]['server_name']!==_0x74c456(0x135)){_0x47e971[_0x74c456(0xbd)]();return;}_0x51e4fa[_0x534079]['nc']=_0x47e971,_0x1ab482(_0x534079,_0x47e971);}catch(_0x3efb6b){_0x72e218['logger'][_0x74c456(0x109)](_0x72e218[_0x74c456(0xe0)]+'['+_0x72e218[_0x74c456(0x144)]+_0x74c456(0x16d)+_0x534079+']['+_0x13464e+']\x20connect\x20error:\x20'+_0x3efb6b['message']+'\x20-\x20will\x20do\x20auto\x20connect\x20when\x20available\x20-\x20however,\x20please\x20verify\x20stream\x20configuration'),_0x3a0563[_0x74c456(0x6b)]=!![];try{_0x47e971=await a0_0x2cc5a3(_0x3a0563);if(_0x47e971[_0x74c456(0xe3)][_0x74c456(0xe4)]!==_0x74c456(0x135)){_0x47e971[_0x74c456(0xbd)]();return;}_0x51e4fa[_0x534079]['nc']=_0x47e971,_0x1ab482(_0x534079,_0x47e971);}catch(_0x2ed978){_0x72e218[_0x74c456(0x138)][_0x74c456(0x109)](_0x72e218[_0x74c456(0xe0)]+'['+_0x72e218[_0x74c456(0x144)]+']\x20publisher['+_0x534079+']['+_0x13464e+']\x20connect\x20error:\x20'+_0x2ed978[_0x74c456(0x143)]);return;}}_0x72e218[_0x74c456(0x138)][_0x74c456(0x14c)](_0x72e218[_0x74c456(0xe0)]+'['+_0x72e218[_0x74c456(0x144)]+_0x74c456(0x16d)+_0x534079+']['+_0x13464e+_0x74c456(0xbe)+(_0x3a0563['tls']['ca']?_0x74c456(0xbb):'')+'\x20'+_0x47e971[_0x74c456(0x153)]()),_0x47e971[_0x74c456(0x185)]()[_0x74c456(0x101)](_0x8f994e=>{const _0x26943d=_0x74c456;_0x8f994e&&_0x72e218['logger'][_0x26943d(0x109)](_0x72e218[_0x26943d(0xe0)]+'['+_0x72e218[_0x26943d(0x144)]+']\x20publisher['+_0x534079+']['+_0x13464e+']\x20closed\x20with\x20error:\x20'+_0x8f994e['message']);});};this['add']=async(_0x4ed6bf,_0x5e31ee)=>{const _0x14d87c=a0_0xab49;if(!_0x5e31ee?.['nats']){_0x72e218[_0x14d87c(0x138)][_0x14d87c(0x109)](_0x72e218[_0x14d87c(0xe0)]+'['+_0x72e218['pluginName']+']\x20publisher['+_0x4ed6bf+_0x14d87c(0x128));return;}if(!_0x5e31ee?.[_0x14d87c(0xde)]?.['tenant']){_0x72e218['logger'][_0x14d87c(0x109)](_0x72e218[_0x14d87c(0xe0)]+'['+_0x72e218[_0x14d87c(0x144)]+_0x14d87c(0x16d)+_0x4ed6bf+']\x20initialization\x20error:\x20missing\x20configuration\x20nats.tenant');return;}if(!_0x5e31ee?.[_0x14d87c(0xde)]?.['subject']){_0x72e218[_0x14d87c(0x138)][_0x14d87c(0x109)](_0x72e218[_0x14d87c(0xe0)]+'['+_0x72e218[_0x14d87c(0x144)]+_0x14d87c(0x16d)+_0x4ed6bf+_0x14d87c(0x137));return;}if(!_0x5e31ee?.[_0x14d87c(0xde)]?.['subject'][_0x14d87c(0x106)]('GW.')){_0x72e218[_0x14d87c(0x138)][_0x14d87c(0x109)](_0x72e218[_0x14d87c(0xe0)]+'['+_0x72e218[_0x14d87c(0x144)]+_0x14d87c(0x16d)+_0x4ed6bf+_0x14d87c(0x130));return;}if(!_0x5e31ee['baseUrls']||!Array[_0x14d87c(0xa1)](_0x5e31ee[_0x14d87c(0x115)])||_0x5e31ee['baseUrls'][_0x14d87c(0x108)]<0x1){_0x72e218[_0x14d87c(0x138)]['error'](_0x72e218[_0x14d87c(0xe0)]+'['+_0x72e218['pluginName']+_0x14d87c(0x16d)+_0x4ed6bf+_0x14d87c(0xcd));return;}if(!_0x5e31ee?.[_0x14d87c(0x114)]?.['ca']){_0x72e218[_0x14d87c(0x138)][_0x14d87c(0x109)](_0x72e218['gwName']+'['+_0x72e218[_0x14d87c(0x144)]+_0x14d87c(0x16d)+_0x4ed6bf+_0x14d87c(0x122));return;}const _0x120f15={};try{let _0x31a5fd=a0_0x3f43f4[_0x14d87c(0x142)](_0x72e218[_0x14d87c(0x88)],_0x14d87c(0x76),_0x5e31ee?.[_0x14d87c(0x114)]?.['ca']||_0x14d87c(0xab));(_0x5e31ee?.[_0x14d87c(0x114)]?.['ca']?.['startsWith']('/')||_0x5e31ee?.[_0x14d87c(0x114)]?.['ca']?.[_0x14d87c(0x11b)]('\x5c'))&&(_0x31a5fd=_0x5e31ee[_0x14d87c(0x114)]['ca']),_0x120f15['ca']=[a0_0x4b3d48[_0x14d87c(0xb5)](_0x31a5fd)],_0x120f15[_0x14d87c(0x10b)]=!![];}catch(_0x283fd8){_0x72e218[_0x14d87c(0x138)]['error'](_0x72e218[_0x14d87c(0xe0)]+'['+_0x72e218[_0x14d87c(0x144)]+']\x20publisher['+_0x4ed6bf+_0x14d87c(0xf9)+_0x283fd8['message']);return;}const _0x4057e9={},_0x5bbda8=new TextEncoder()[_0x14d87c(0xd3)](_0x5e31ee?.[_0x14d87c(0xde)]?.[_0x14d87c(0xdb)]),_0x4ed6ad=_0x5e31ee?.[_0x14d87c(0xde)]?.['jwt'];_0x4057e9['authenticator']=jwtAuthenticator(_0x4ed6ad,_0x5bbda8),_0x4057e9[_0x14d87c(0x69)]=_0x5e31ee['baseUrls'],_0x4057e9[_0x14d87c(0xbb)]=_0x120f15,_0x4057e9[_0x14d87c(0x6b)]=![],_0x4057e9[_0x14d87c(0x9e)]=!![],_0x4057e9[_0x14d87c(0x164)]=0x3e8*0xa,_0x4057e9[_0x14d87c(0xff)]=-0x1,_0x4057e9[_0x14d87c(0x149)]=0x2*0x3c*0x3e8,_0x4057e9['maxPingOut']=0x5,_0x4057e9['debug']=![],_0x51e4fa[_0x4ed6bf]={},_0x51e4fa[_0x4ed6bf][_0x14d87c(0x13e)]=_0x5e31ee,_0x51e4fa[_0x4ed6bf]['nc']=undefined,_0x5b9475(_0x4ed6bf,_0x4057e9);},this[_0x3cfc2d(0x166)]=async _0x30cdd8=>{const _0x32b120=_0x3cfc2d;let _0x17a28e;const _0xf18d75=a0_0xc5a644['randomUUID']();try{if(_0x30cdd8[_0x32b120(0xf8)]===Object){_0x17a28e=_0x30cdd8[_0x32b120(0x14b)];if(!_0x17a28e)_0x30cdd8[_0x32b120(0x14b)]=_0x32b120(0x7c);if(_0x30cdd8?.[_0x32b120(0xc4)]?.[_0x32b120(0x7d)]?.['headers']){const _0x369f69=_0x30cdd8[_0x32b120(0xc4)][_0x32b120(0x7d)][_0x32b120(0xe9)][_0x32b120(0x173)](_0x32b120(0x8f));if(_0x369f69)_0x30cdd8[_0x32b120(0xc4)]['request'][_0x32b120(0xe9)][_0x32b120(0xc8)](_0x32b120(0x8f),a0_0x5892aa[_0x32b120(0x12b)](_0x369f69,_0xf18d75));}if(_0x30cdd8?.[_0x32b120(0xc4)]?.[_0x32b120(0x117)]?.['headers']){const _0x1f8d1f=_0x30cdd8['ctx'][_0x32b120(0x117)][_0x32b120(0xe9)][_0x32b120(0x173)](_0x32b120(0x8f));if(_0x1f8d1f)_0x30cdd8[_0x32b120(0xc4)][_0x32b120(0x117)][_0x32b120(0xe9)][_0x32b120(0xc8)](_0x32b120(0x8f),a0_0x5892aa[_0x32b120(0x12b)](_0x1f8d1f,_0xf18d75));}_0x30cdd8=JSON['stringify'](_0x30cdd8);}else{const _0x30d502=JSON[_0x32b120(0x184)](_0x30cdd8);_0x17a28e=_0x30d502[_0x32b120(0x14b)];}}catch(_0x274967){throw new Error('publisher['+_0x17a28e+_0x32b120(0x72));}if(!_0x51e4fa[_0x17a28e])throw new Error('publisher['+_0x17a28e+_0x32b120(0x152)+_0x17a28e);const _0x59719=headers();_0x59719[_0x32b120(0x7f)]('Msg-Id',_0xf18d75);let _0x1db6be;try{if(!_0x51e4fa[_0x17a28e]['nc'])throw new Error(_0x32b120(0xb6));_0x1db6be=await _0x51e4fa[_0x17a28e]['nc'][_0x32b120(0x7d)](_0x51e4fa[_0x17a28e][_0x32b120(0x13e)]?.['nats']?.[_0x32b120(0x70)],_0x30cdd8,{'headers':_0x59719});}catch(_0x770f98){if(_0x770f98[_0x32b120(0x143)]===_0x32b120(0xa5))throw new Error(_0x32b120(0x168)+_0x17a28e+_0x32b120(0x7a)+_0x51e4fa[_0x17a28e][_0x32b120(0x13e)]?.['nats']?.[_0x32b120(0x70)]);else throw new Error('publisher['+_0x17a28e+_0x32b120(0x172)+_0x770f98[_0x32b120(0x143)]);}let _0x5e7943;try{_0x5e7943=JSON[_0x32b120(0x184)](_0x1db6be[_0x32b120(0x84)]());try{JSON[_0x32b120(0x184)](_0x5e7943[_0x32b120(0xb0)]);if(!_0x5e7943[_0x32b120(0xe9)])_0x5e7943[_0x32b120(0xe9)]={};if(!_0x5e7943[_0x32b120(0xe9)][_0x32b120(0x6a)])_0x5e7943[_0x32b120(0xe9)]['content-type']=_0x32b120(0x112);}catch(_0xbe64b3){void 0x0;}}catch(_0x15b218){throw new Error(_0x32b120(0x100)+_0x1db6be[_0x32b120(0x84)]());}if(_0x5e7943?.[_0x32b120(0x109)]){const _0x26ff12=new Error(_0x32b120(0xd6)+_0x5e7943[_0x32b120(0x109)]);_0x26ff12[_0x32b120(0x104)]=_0x5e7943[_0x32b120(0xca)];throw _0x26ff12;}return _0x5e7943;},process['on']('SIGTERM',async()=>{const _0x1ff39b=_0x3cfc2d;for(const _0x568afd in _0x51e4fa){_0x51e4fa[_0x568afd]['nc']&&!_0x51e4fa[_0x568afd]['nc'][_0x1ff39b(0x13d)]()&&await _0x51e4fa[_0x568afd]['nc'][_0x1ff39b(0x6d)]();}}),process['on'](_0x3cfc2d(0x183),async()=>{const _0x5326ab=_0x3cfc2d;for(const _0x178e87 in _0x51e4fa){_0x51e4fa[_0x178e87]['nc']&&!_0x51e4fa[_0x178e87]['nc']['isClosed']()&&await _0x51e4fa[_0x178e87]['nc'][_0x5326ab(0x6d)]();}});}}export const getAppRoles=async(_0x20ae39,_0x50aac4)=>{const _0x37c1c2=a0_0xab49,_0x3ee2d6='getAppRoles',_0x257a5c=_0x20ae39;_0x257a5c[_0x37c1c2(0x138)]['debug'](_0x257a5c[_0x37c1c2(0xe0)]+'['+_0x257a5c[_0x37c1c2(0x144)]+_0x37c1c2(0xb3)+_0x3ee2d6+'\x22');try{if(!a0_0x4b3d48['existsSync'](_0x257a5c[_0x37c1c2(0x88)]+_0x37c1c2(0x150)))a0_0x4b3d48[_0x37c1c2(0x73)](_0x257a5c[_0x37c1c2(0x88)]+_0x37c1c2(0x150));}catch(_0x37e5e5){void 0x0;}const _0x45b7b0=a0_0x3f43f4[_0x37c1c2(0x142)](''+_0x257a5c[_0x37c1c2(0x88)],'approles',_0x37c1c2(0x13a)+_0x257a5c[_0x37c1c2(0x144)]+_0x37c1c2(0xc6)),_0x226442={};a0_0x5892aa[_0x37c1c2(0x181)](_0x45b7b0)&&a0_0x4b3d48[_0x37c1c2(0xb5)](_0x45b7b0,_0x37c1c2(0x12a))['split'](/\r?\n/)[_0x37c1c2(0x10c)](_0x4ded35=>{const _0x424d56=_0x37c1c2,_0x199058=_0x4ded35[_0x424d56(0x10a)]('\x20');_0x199058['length']===0x2&&(_0x226442[_0x199058[0x0]]=_0x199058[0x1]);});const _0x3ecc29=a0_0x4b3d48[_0x37c1c2(0x82)](_0x45b7b0,{'flags':'w','encoding':'utf8','mode':0x1b6,'autoClose':!![]}),_0x3ed611=[],_0x19e0b0=await _0x257a5c[_0x37c1c2(0x187)](_0x50aac4,{'attribute':undefined,'operator':undefined,'value':undefined},['id',_0x37c1c2(0xa2)]);return _0x19e0b0[_0x37c1c2(0x17e)][_0x37c1c2(0x10c)](_0x4ebc54=>{const _0x6630f7=_0x37c1c2;if(_0x4ebc54['id']){let _0x3e2431=a0_0xc5a644[_0x6630f7(0x132)]();if(_0x226442[_0x4ebc54['id']])_0x3e2431=_0x226442[_0x4ebc54['id']];const _0x363adf={'allowedMemberTypes':['User'],'description':'SCIM\x20Stream\x20-\x20Autogenerated','displayName':_0x4ebc54[_0x6630f7(0xa2)]||_0x4ebc54['id'],'id':_0x3e2431,'isEnabled':!![],'lang':null,'origin':_0x6630f7(0x87),'value':decodeURIComponent(_0x4ebc54['id'])};_0x3ed611[_0x6630f7(0xac)](_0x363adf),_0x3ecc29[_0x6630f7(0xce)](_0x4ebc54['id']+'\x20'+_0x3e2431+'\x0a');}}),_0x3ecc29[_0x37c1c2(0xbd)](),_0x257a5c[_0x37c1c2(0x138)][_0x37c1c2(0x14c)](_0x257a5c[_0x37c1c2(0xe0)]+'['+_0x257a5c[_0x37c1c2(0x144)]+_0x37c1c2(0x14e)+_0x45b7b0),{'Resources':[{'appRoles':_0x3ed611}]};};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scimgateway",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Using SCIM protocol as a gateway for user provisioning to other endpoints",
|
|
6
6
|
"author": "Jarle Elshaug <jarle.elshaug@gmail.com> (https://elshaug.xyz)",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@ldapjs/asn1": "^2.0.0",
|
|
39
|
-
"@nats-io/jetstream": "^3.0.0
|
|
40
|
-
"@nats-io/nats-core": "^3.0.0
|
|
41
|
-
"@nats-io/transport-node": "^3.0.0
|
|
39
|
+
"@nats-io/jetstream": "^3.0.0",
|
|
40
|
+
"@nats-io/nats-core": "^3.0.0",
|
|
41
|
+
"@nats-io/transport-node": "^3.0.0",
|
|
42
42
|
"@types/ldapjs": "^3.0.6",
|
|
43
43
|
"@types/lokijs": "^1.5.14",
|
|
44
44
|
"@types/tedious": "^18.0.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"jsonwebtoken": "^9.0.2",
|
|
50
50
|
"ldapjs": "^3.0.7",
|
|
51
51
|
"lokijs": "^1.5.12",
|
|
52
|
-
"mongodb": "^6.
|
|
52
|
+
"mongodb": "^6.15.0",
|
|
53
53
|
"node-machine-id": "1.1.12",
|
|
54
54
|
"nodemailer": "^6.10.0",
|
|
55
55
|
"passport": "^0.7.0",
|