qcobjects 2.5.102-beta → 2.5.105-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -6,16 +5,18 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
6
5
  var __getProtoOf = Object.getPrototypeOf;
7
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
7
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
+ }) : x)(function(x) {
11
+ if (typeof require !== "undefined") return require.apply(this, arguments);
12
+ throw Error('Dynamic require of "' + x + '" is not supported');
13
+ });
9
14
  var __esm = (fn, res) => function __init() {
10
15
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
11
16
  };
12
- var __commonJS = (cb, mod) => function __require() {
17
+ var __commonJS = (cb, mod) => function __require2() {
13
18
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
14
19
  };
15
- var __export = (target, all) => {
16
- for (var name in all)
17
- __defProp(target, name, { get: all[name], enumerable: true });
18
- };
19
20
  var __copyProps = (to, from, except, desc) => {
20
21
  if (from && typeof from === "object" || typeof from === "function") {
21
22
  for (let key of __getOwnPropNames(from))
@@ -32,7 +33,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
32
33
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
33
34
  mod
34
35
  ));
35
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
36
 
37
37
  // src/assign.ts
38
38
  var require_assign = __commonJS({
@@ -93,7 +93,7 @@ var init_platform = __esm({
93
93
  return isDeno ? deno_require(name) : ((name2) => {
94
94
  let r;
95
95
  try {
96
- r = require(name2);
96
+ r = __require(name2);
97
97
  } catch (e) {
98
98
  logger.debug(`An error ocurred importing module. ${e}`);
99
99
  r = { export: {} };
@@ -629,7 +629,7 @@ var init_InheritClass = __esm({
629
629
  }
630
630
  hierarchy() {
631
631
  const __instance__ = this;
632
- return this.getClass().hierarchy(__instance__);
632
+ return this.constructor.hierarchy(__instance__);
633
633
  }
634
634
  append(_child) {
635
635
  const child = _child || this.body;
@@ -947,7 +947,7 @@ var init_Class = __esm({
947
947
  }
948
948
  hierarchy() {
949
949
  const __instance__ = this;
950
- return this.getClass().hierarchy(__instance__);
950
+ return this.getClass()?.hierarchy(__instance__);
951
951
  }
952
952
  append(_child) {
953
953
  const child = _child || this.body;
@@ -3454,17 +3454,262 @@ var init_ComponentFactory = __esm({
3454
3454
  }
3455
3455
  });
3456
3456
 
3457
+ // src/Service.ts
3458
+ var Service, JSONService, ConfigService;
3459
+ var init_Service = __esm({
3460
+ "src/Service.ts"() {
3461
+ "use strict";
3462
+ init_basePath();
3463
+ init_Crypt();
3464
+ init_domain();
3465
+ init_InheritClass();
3466
+ init_Logger();
3467
+ init_Package();
3468
+ init_secretKey();
3469
+ init_CONFIG();
3470
+ Service = class extends InheritClass {
3471
+ static {
3472
+ __name(this, "Service");
3473
+ }
3474
+ options;
3475
+ withCredentials;
3476
+ useHTTP2;
3477
+ // eslint-disable-next-line no-unused-vars
3478
+ mockup({ request, service }) {
3479
+ throw new Error("Method not implemented.");
3480
+ }
3481
+ name;
3482
+ responseHeaders;
3483
+ // eslint-disable-next-line no-unused-vars
3484
+ local({ request, service }) {
3485
+ throw new Error("Method not implemented.");
3486
+ }
3487
+ kind = "rest";
3488
+ /* it can be rest, mockup, local */
3489
+ domain = _domain_;
3490
+ basePath = _basePath_;
3491
+ url = "";
3492
+ method = "GET";
3493
+ data = {};
3494
+ reload = false;
3495
+ cached = false;
3496
+ headers;
3497
+ template;
3498
+ // eslint-disable-next-line no-unused-vars
3499
+ done({ request, service }) {
3500
+ throw new Error("Method not implemented.");
3501
+ }
3502
+ // eslint-disable-next-line no-unused-vars
3503
+ fail(...args) {
3504
+ throw new Error("Method not implemented.");
3505
+ }
3506
+ set(name, value) {
3507
+ this[name] = value;
3508
+ }
3509
+ get(name, _default) {
3510
+ return this[name] || _default;
3511
+ }
3512
+ };
3513
+ JSONService = class extends Service {
3514
+ static {
3515
+ __name(this, "JSONService");
3516
+ }
3517
+ method = "GET";
3518
+ cached = false;
3519
+ headers = {
3520
+ "Content-Type": "application/json",
3521
+ "charset": "utf-8"
3522
+ };
3523
+ JSONresponse = void 0;
3524
+ done(result) {
3525
+ logger.debug("***** RECEIVED RESPONSE:");
3526
+ logger.debug(result.service.template);
3527
+ this.JSONresponse = JSON.parse(result.service.template);
3528
+ }
3529
+ };
3530
+ ConfigService = class extends JSONService {
3531
+ static {
3532
+ __name(this, "ConfigService");
3533
+ }
3534
+ method = "GET";
3535
+ cached = false;
3536
+ configFileName = "config.json";
3537
+ headers = {
3538
+ "Content-Type": "application/json",
3539
+ "charset": "utf-8"
3540
+ };
3541
+ configLoaded() {
3542
+ throw Error("Method not implemented.");
3543
+ }
3544
+ JSONresponse = void 0;
3545
+ done(result) {
3546
+ logger.debug("***** CONFIG LOADED:");
3547
+ logger.debug(result.service.template);
3548
+ this.JSONresponse = JSON.parse(result.service.template);
3549
+ if (Object.hasOwn(this.JSONresponse, "__encoded__")) {
3550
+ const decodedValue = _Crypt.decrypt(this.JSONresponse?.__encoded__, _secretKey);
3551
+ this.JSONresponse = JSON.parse(decodedValue);
3552
+ }
3553
+ const jsonResponse = this.JSONresponse;
3554
+ Object.keys(jsonResponse).map((k) => {
3555
+ CONFIG.set(k, jsonResponse[k]);
3556
+ return k;
3557
+ });
3558
+ this.configLoaded().catch((e) => {
3559
+ throw new Error(`An error ocurred: ${e}`);
3560
+ });
3561
+ }
3562
+ fail() {
3563
+ this.configLoaded().catch((e) => {
3564
+ throw new Error(`An error ocurred: ${e}`);
3565
+ });
3566
+ }
3567
+ constructor() {
3568
+ super();
3569
+ this.set("url", `${this.get("basePath")}${this.get("configFileName")}`);
3570
+ }
3571
+ };
3572
+ Package("com.qcobjects.api", [
3573
+ Service
3574
+ ]);
3575
+ Package("com.qcobjects.api.services", [
3576
+ JSONService
3577
+ ]);
3578
+ Package("com.qcobjects.api.config", [
3579
+ ConfigService
3580
+ ]);
3581
+ }
3582
+ });
3583
+
3584
+ // src/globalSettings.ts
3585
+ var GlobalSettings;
3586
+ var init_globalSettings = __esm({
3587
+ "src/globalSettings.ts"() {
3588
+ "use strict";
3589
+ init_CONFIG();
3590
+ init_InheritClass();
3591
+ init_Logger();
3592
+ init_Package();
3593
+ init_platform();
3594
+ init_serviceLoader();
3595
+ init_top();
3596
+ init_Service();
3597
+ GlobalSettings = class _GlobalSettings extends InheritClass {
3598
+ static {
3599
+ __name(this, "GlobalSettings");
3600
+ }
3601
+ static __start__() {
3602
+ return _GlobalSettings.instance.__start__();
3603
+ }
3604
+ _GLOBAL = {};
3605
+ static _instance;
3606
+ static get instance() {
3607
+ if (typeof _GlobalSettings._instance === "undefined") {
3608
+ _GlobalSettings._instance = new _GlobalSettings();
3609
+ }
3610
+ return _GlobalSettings._instance;
3611
+ }
3612
+ set(name, value) {
3613
+ this._GLOBAL[name] = value;
3614
+ }
3615
+ get(name, _default) {
3616
+ let _value;
3617
+ if (typeof this._GLOBAL[name] !== "undefined") {
3618
+ _value = this._GLOBAL[name];
3619
+ } else if (typeof _default !== "undefined") {
3620
+ _value = _default;
3621
+ }
3622
+ return _value;
3623
+ }
3624
+ __start__() {
3625
+ const __load__serviceWorker = /* @__PURE__ */ __name(function() {
3626
+ let _promise;
3627
+ if (isBrowser) {
3628
+ _promise = new Promise(function(resolve, reject) {
3629
+ if ("serviceWorker" in navigator && typeof CONFIG.get("serviceWorkerURI") !== "undefined") {
3630
+ CONFIG.set("serviceWorkerScope", CONFIG.get("serviceWorkerScope") ? CONFIG.get("serviceWorkerScope") : "/");
3631
+ navigator.serviceWorker.register(CONFIG.get("serviceWorkerURI"), {
3632
+ scope: CONFIG.get("serviceWorkerScope")
3633
+ }).then(function(registration) {
3634
+ logger.debug("Service Worker Registered");
3635
+ resolve.call(_promise, registration);
3636
+ }, function(registration) {
3637
+ logger.debug("Error registering Service Worker");
3638
+ reject.call(_promise, registration);
3639
+ });
3640
+ navigator.serviceWorker.ready.then(function(registration) {
3641
+ logger.debug("Service Worker Ready");
3642
+ resolve.call(_promise, registration);
3643
+ }, function(registration) {
3644
+ logger.debug("Error loading Service Worker");
3645
+ reject.call(_promise, registration);
3646
+ });
3647
+ }
3648
+ });
3649
+ } else {
3650
+ _promise = Promise.resolve();
3651
+ }
3652
+ return _promise;
3653
+ }, "__load__serviceWorker");
3654
+ const _buildComponents = /* @__PURE__ */ __name(function() {
3655
+ return new Promise((resolve) => {
3656
+ if (isBrowser) {
3657
+ logger.debug("Starting to building components");
3658
+ try {
3659
+ buildComponentsStack();
3660
+ } catch (e) {
3661
+ throw Error(`Something went wrong trying to start components tree: ${e.message}`);
3662
+ }
3663
+ logger.debug("Initializing the service worker");
3664
+ __load__serviceWorker.call(_top).catch(function(e) {
3665
+ logger.debug(`error loading the service worker ${e}`);
3666
+ });
3667
+ }
3668
+ resolve();
3669
+ });
3670
+ }, "_buildComponents");
3671
+ return new Promise((resolve) => {
3672
+ logger.debug("Starting to load the config settings...");
3673
+ if (CONFIG.get("useConfigService", false)) {
3674
+ logger.debug("Loading settings using local configuration file...");
3675
+ setConfigService(new ConfigService());
3676
+ configService.configLoaded = _buildComponents;
3677
+ serviceLoader(configService)?.then((standardResponse) => {
3678
+ resolve(standardResponse);
3679
+ })?.catch((e) => {
3680
+ throw new Error(`An error ocurred while trying to load ${configService.url}: ${e}`);
3681
+ });
3682
+ } else {
3683
+ logger.debug("Starting to load the components...");
3684
+ _buildComponents.call(this).then(() => {
3685
+ resolve({});
3686
+ }).catch((e) => {
3687
+ throw new Error(`An error ocurred while trying to build the components stack. ${e}`);
3688
+ });
3689
+ }
3690
+ });
3691
+ }
3692
+ };
3693
+ Package("com.qcobjects", [
3694
+ GlobalSettings
3695
+ ]);
3696
+ }
3697
+ });
3698
+
3457
3699
  // src/top.ts
3458
- var _top, componentsStack, resetTop, buildComponentsStack, configService, setConfigService;
3700
+ var _top, componentsStack, resetTop, buildComponentsStack, configService, setConfigService, set, get;
3459
3701
  var init_top = __esm({
3460
3702
  "src/top.ts"() {
3461
3703
  "use strict";
3462
3704
  init_ComponentFactory();
3463
- _top = typeof self !== "undefined" && self || typeof window !== "undefined" && window || typeof global !== "undefined" && global || void 0;
3705
+ init_Cast();
3706
+ init_globalSettings();
3707
+ _top = typeof module !== "undefined" && typeof module.exports !== "undefined" && module.exports || typeof global !== "undefined" && global || typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof self !== "undefined" && self || void 0;
3464
3708
  _top.lastCache = void 0;
3465
3709
  componentsStack = [];
3466
- resetTop = /* @__PURE__ */ __name((_top_) => {
3467
- _top = _top_;
3710
+ resetTop = /* @__PURE__ */ __name(() => {
3711
+ const globalSettings = new GlobalSettings();
3712
+ _top = _CastProps(globalSettings, _top);
3468
3713
  }, "resetTop");
3469
3714
  buildComponentsStack = /* @__PURE__ */ __name(() => {
3470
3715
  componentsStack = buildComponents(document);
@@ -3473,6 +3718,12 @@ var init_top = __esm({
3473
3718
  _top.global.configService = _configService;
3474
3719
  configService = _configService;
3475
3720
  }, "setConfigService");
3721
+ set = /* @__PURE__ */ __name((name, value) => {
3722
+ _top.set(name, value);
3723
+ }, "set");
3724
+ get = /* @__PURE__ */ __name((name, _defaultValue) => {
3725
+ return _top.get(name, _defaultValue);
3726
+ }, "get");
3476
3727
  }
3477
3728
  });
3478
3729
 
@@ -4175,2412 +4426,2070 @@ var init_Import = __esm({
4175
4426
  }
4176
4427
  });
4177
4428
 
4178
- // src/BackendMicroservice.ts
4179
- var BackendMicroservice;
4180
- var init_BackendMicroservice = __esm({
4181
- "src/BackendMicroservice.ts"() {
4182
- "use strict";
4183
- init_basePath();
4184
- init_DataStringify();
4185
- init_domain();
4186
- init_InheritClass();
4187
- init_Logger();
4188
- init_Package();
4189
- BackendMicroservice = class extends InheritClass {
4190
- static {
4191
- __name(this, "BackendMicroservice");
4192
- }
4193
- stream;
4194
- route;
4195
- headers;
4196
- request;
4197
- constructor({
4198
- domain = _domain_,
4199
- basePath = _basePath_,
4200
- body = null,
4201
- stream = null,
4202
- request = null
4203
- }) {
4204
- super({
4205
- domain,
4206
- basePath,
4207
- body,
4208
- stream,
4209
- request
4210
- });
4211
- logger.debug("Initializing BackendMicroservice...");
4212
- const microservice = this;
4213
- if (typeof this.body === "undefined") {
4214
- this.body = null;
4215
- }
4216
- if (typeof body !== "undefined") {
4217
- this.body = body;
4218
- }
4219
- this.cors();
4220
- microservice.stream = stream;
4221
- stream?.on("data", (data) => {
4222
- const requestMethod2 = request?.method.toLowerCase();
4223
- const supportedMethods2 = {
4224
- "post": microservice.post.bind(microservice)
4225
- };
4226
- if (Object.hasOwn(supportedMethods2, requestMethod2)) {
4227
- supportedMethods2[requestMethod2].call(microservice, data);
4228
- }
4229
- });
4230
- const requestMethod = request?.method.toLowerCase();
4231
- const supportedMethods = {
4232
- "get": microservice.get.bind(microservice),
4233
- "head": microservice.head.bind(microservice),
4234
- "put": microservice.put.bind(microservice),
4235
- "delete": microservice.delete.bind(microservice),
4236
- "connect": microservice.connect.bind(microservice),
4237
- "options": microservice.options.bind(microservice),
4238
- "trace": microservice.trace.bind(microservice),
4239
- "patch": microservice.patch.bind(microservice)
4240
- };
4241
- if (Object.hasOwn(supportedMethods, requestMethod)) {
4242
- supportedMethods[requestMethod].call(microservice);
4243
- }
4244
- }
4245
- cors() {
4246
- if (this.route.cors) {
4247
- logger.debug("Validating CORS...");
4248
- const {
4249
- allow_origins,
4250
- allow_credentials,
4251
- allow_methods,
4252
- allow_headers
4253
- } = this.route.cors;
4254
- const microservice = this;
4255
- if (typeof microservice.headers !== "object") {
4256
- microservice.headers = {};
4257
- }
4258
- if (typeof microservice.route.responseHeaders !== "object") {
4259
- microservice.route.responseHeaders = {};
4260
- }
4261
- if (typeof allow_origins !== "undefined") {
4262
- logger.debug("CORS: allow_origins available. Validating origins...");
4263
- if (allow_origins === "*" || typeof microservice.request.headers.origin === "undefined" || [...allow_origins].indexOf(microservice.request.headers.origin) !== -1) {
4264
- logger.debug("CORS: Adding header Access-Control-Allow-Origin=*");
4265
- microservice.route.responseHeaders["Access-Control-Allow-Origin"] = "*";
4266
- } else {
4267
- logger.debug("CORS: Origin is not allowed: " + microservice.request.headers.origin);
4268
- logger.debug("CORS: Forcing to finish the response...");
4269
- this.body = {};
4270
- try {
4271
- this.done();
4272
- } catch (e) {
4273
- logger.debug(`It was not possible to finish the call to the microservice: ${e}`);
4274
- }
4275
- }
4276
- } else {
4277
- logger.debug("CORS: no allow_origins available. Allowing all origins...");
4278
- logger.debug("CORS: Adding header Access-Control-Allow-Origin=*");
4279
- microservice.route.responseHeaders["Access-Control-Allow-Origin"] = "*";
4280
- }
4281
- if (typeof allow_credentials !== "undefined") {
4282
- logger.debug(`CORS: allow_credentials present. Allowing ${allow_credentials}...`);
4283
- microservice.route.responseHeaders["Access-Control-Allow-Credentials"] = allow_credentials.toString();
4284
- } else {
4285
- logger.debug("CORS: No allow_credentials present. Allowing all credentials.");
4286
- microservice.route.responseHeaders["Access-Control-Allow-Credentials"] = "true";
4287
- }
4288
- if (typeof allow_methods !== "undefined") {
4289
- logger.debug(`CORS: allow_methods present. Allowing ${allow_methods}...`);
4290
- microservice.route.responseHeaders["Access-Control-Allow-Methods"] = [...allow_methods].join(",");
4291
- } else {
4292
- logger.debug("CORS: No allow_methods present. Allowing only GET, OPTIONS and POST");
4293
- microservice.route.responseHeaders["Access-Control-Allow-Methods"] = "GET, OPTIONS, POST";
4294
- }
4295
- if (typeof allow_headers !== "undefined") {
4296
- logger.debug(`CORS: allow_headers present. Allowing ${allow_headers}...`);
4297
- microservice.route.responseHeaders["Access-Control-Allow-Headers"] = [...allow_headers].join(",");
4298
- } else {
4299
- logger.debug("CORS: No allow_headers present. Allowing all headers...");
4300
- microservice.route.responseHeaders["Access-Control-Allow-Headers"] = "*";
4301
- }
4429
+ // src/loadSDK.ts
4430
+ function loadSDK() {
4431
+ if (CONFIG.get("useSDK")) {
4432
+ (function() {
4433
+ const remoteImportsPath = CONFIG.get("remoteImportsPath");
4434
+ const external = !CONFIG.get("useLocalSDK");
4435
+ CONFIG.set("remoteImportsPath", CONFIG.get("remoteSDKPath"));
4436
+ let tryImportingSDK = false;
4437
+ let sdkName = "QCObjects-SDK";
4438
+ if (isBrowser) {
4439
+ tryImportingSDK = true;
4440
+ } else {
4441
+ const sdkPath = findPackageNodePath("qcobjects-sdk");
4442
+ if (sdkPath !== null) {
4443
+ sdkName = "qcobjects-sdk";
4444
+ tryImportingSDK = true;
4445
+ } else if (sdkPath !== "") {
4446
+ sdkName = "node_modules/qcobjects-sdk/QCObjects-SDK";
4447
+ tryImportingSDK = true;
4302
4448
  } else {
4303
- logger.debug("No CORS validation available. You can specify cors in CONFIG.backend.routes[].cors");
4304
- }
4305
- }
4306
- head(formData) {
4307
- logger.debug(`[BackendMicroservice.head] Data received: ${_DataStringify(formData)}`);
4308
- this.done();
4309
- }
4310
- get(formData) {
4311
- logger.debug(`[BackendMicroservice.get] Data received: ${_DataStringify(formData)}`);
4312
- this.done();
4313
- }
4314
- post(formData) {
4315
- logger.debug(`[BackendMicroservice.post] Data received: ${_DataStringify(formData)}`);
4316
- this.done();
4317
- }
4318
- put(formData) {
4319
- logger.debug(`[BackendMicroservice.put] Data received: ${_DataStringify(formData)}`);
4320
- this.done();
4321
- }
4322
- delete(formData) {
4323
- logger.debug(`[BackendMicroservice.delete] Data received: ${_DataStringify(formData)}`);
4324
- this.done();
4325
- }
4326
- connect(formData) {
4327
- logger.debug(`[BackendMicroservice.connect] Data received: ${_DataStringify(formData)}`);
4328
- this.done();
4329
- }
4330
- options(formData) {
4331
- logger.debug(`[BackendMicroservice.options] Data received: ${_DataStringify(formData)}`);
4332
- this.done();
4333
- }
4334
- trace(formData) {
4335
- logger.debug(`[BackendMicroservice.trace] Data received: ${_DataStringify(formData)}`);
4336
- this.done();
4337
- }
4338
- patch(formData) {
4339
- logger.debug(`[BackendMicroservice.patch] Data received: ${_DataStringify(formData)}`);
4340
- this.done();
4341
- }
4342
- finishWithBody(stream) {
4343
- try {
4344
- logger.debug("[BackendMicroservice.finishWithBody] Ending the stream...");
4345
- logger.debug(`[BackendMicroservice.finishWithBody] type of body is: ${typeof this.body}`);
4346
- if (typeof this.body !== "string") {
4347
- this.body = _DataStringify(this.body);
4348
- }
4349
- logger.debug(`[BackendMicroservice.finishWithBody]
4350
- body: ${this.body} `);
4351
- stream?.write(this.body);
4352
- stream?.end();
4353
- logger.debug("[BackendMicroservice.finishWithBody] Stream ended.");
4354
- } catch (e) {
4355
- logger.debug(`[BackendMicroservice.finishWithBody] Something went wrong ending the stream: ${e}`);
4449
+ tryImportingSDK = false;
4356
4450
  }
4357
4451
  }
4358
- done() {
4359
- logger.debug("[BackendMicroservice.done] Finalizing the response...");
4360
- const microservice = this;
4361
- const stream = microservice.stream;
4362
- try {
4363
- logger.debug("[BackendMicroservice.done] Sending response headers...");
4364
- if (microservice.route.responseHeaders) {
4365
- logger.debug(`[BackendMicroservice.done] Response headers present: ${Object.keys(microservice.route.responseHeaders).join(",")}`);
4366
- stream.respond(microservice.route.responseHeaders);
4452
+ if (tryImportingSDK) {
4453
+ logger.info("Importing SDK... " + sdkName);
4454
+ if (isNodeCommonJS && typeof __require !== "undefined") {
4455
+ const sdk = _require_("qcobjects-sdk");
4456
+ if (sdk) {
4457
+ logger.debug("QCObjects SDK was loaded OK.");
4367
4458
  } else {
4368
- throw Error("[BackendMicroservice.done] No headers present.");
4369
- }
4370
- } catch (e) {
4371
- logger.debug(`[BackendMicroservice.done] Something went wrong sending response headers: ${e}`);
4372
- }
4373
- if (microservice.body !== null) {
4374
- try {
4375
- logger.debug("[BackendMicroservice.done] A body of message is present. Finalizing the response...");
4376
- microservice.finishWithBody.call(microservice, stream);
4377
- } catch (e) {
4378
- logger.debug(`[BackendMicroservice.done] Something went wrong finalizing the response: ${e}`);
4459
+ logger.debug("QCObjects SDK could not be imported.");
4379
4460
  }
4380
4461
  } else {
4381
- logger.debug("[BackendMicroservice.done] No body present. Ending stream...");
4382
- stream.end();
4462
+ Import(sdkName, function() {
4463
+ if (external) {
4464
+ logger.debug("QCObjects-SDK.js loaded from remote location");
4465
+ } else {
4466
+ logger.debug("QCObjects-SDK.js loaded from local");
4467
+ }
4468
+ CONFIG.set("remoteImportsPath", remoteImportsPath);
4469
+ }, external)?.catch((e) => {
4470
+ throw new Error(`An error ocurred when trying to import: ${e}`);
4471
+ });
4383
4472
  }
4473
+ } else {
4474
+ logger.debug("SDK has not been imported as it is not available at the moment");
4384
4475
  }
4385
- };
4386
- Package("com.qcobjects.api", [
4387
- BackendMicroservice
4388
- ]);
4476
+ })();
4389
4477
  }
4390
- });
4391
-
4392
- // src/DefaultTemplateHandler.ts
4393
- var DefaultTemplateHandler;
4394
- var init_DefaultTemplateHandler = __esm({
4395
- "src/DefaultTemplateHandler.ts"() {
4478
+ }
4479
+ var loadSDK_default;
4480
+ var init_loadSDK = __esm({
4481
+ "src/loadSDK.ts"() {
4396
4482
  "use strict";
4483
+ init_CONFIG();
4484
+ init_findPackageNodePath();
4485
+ init_Import();
4397
4486
  init_Logger();
4398
- init_Processor();
4399
- init_RegisterClass();
4400
- DefaultTemplateHandler = class {
4401
- static {
4402
- __name(this, "DefaultTemplateHandler");
4403
- }
4404
- template = "";
4405
- __definition = {};
4406
- static __definition = {};
4407
- component;
4408
- constructor({ component, template }) {
4409
- this.component = component;
4410
- this.template = template;
4411
- }
4412
- assign(data) {
4413
- const templateInstance = this;
4414
- if (typeof templateInstance.component === "undefined") {
4415
- throw new Error("DefaultTemplateHandler.assign: component is undefined");
4416
- }
4417
- if (typeof templateInstance.component.processorHandler === "undefined") {
4418
- throw new Error("DefaultTemplateHandler.assign: component.processorHandler is undefined");
4419
- }
4420
- const processorHandler = templateInstance.component.processorHandler;
4421
- processorHandler.component = templateInstance.component;
4422
- let parsedAssignmentText = typeof templateInstance.template !== "undefined" ? templateInstance.template : "";
4423
- if (typeof data === "object") {
4424
- [...Object.keys(data)].map((k) => {
4425
- let _value = data[k];
4426
- if (typeof _value === "string" || typeof _value === "number" || !isNaN(_value)) {
4427
- try {
4428
- _value = GlobalProcessor.processObject.bind(processorHandler).call(processorHandler, _value, templateInstance.component);
4429
- parsedAssignmentText = parsedAssignmentText.replace(new RegExp(`{{${k}}}`, "g"), _value);
4430
- } catch (e) {
4431
- logger.warn(`${templateInstance.component.name} could not parse processors.`);
4432
- throw Error(`${templateInstance.component.name} could not parse processors. Reason: ${e.message}`);
4433
- }
4434
- }
4435
- return k;
4436
- });
4437
- } else {
4438
- logger.debug(`${templateInstance.component.name}.data is not an object`);
4439
- }
4440
- try {
4441
- parsedAssignmentText = GlobalProcessor.processObject.call(processorHandler, parsedAssignmentText, templateInstance.component);
4442
- } catch (e) {
4443
- logger.warn(`${templateInstance.component.name} could not parse processors.`);
4444
- throw Error(`${templateInstance.component.name} could not parse processors. Reason: ${e.message}`);
4445
- }
4446
- return parsedAssignmentText;
4447
- }
4448
- };
4449
- RegisterClass(DefaultTemplateHandler, "com.qcobjects");
4487
+ init_platform();
4488
+ __name(loadSDK, "loadSDK");
4489
+ loadSDK_default = loadSDK;
4450
4490
  }
4451
4491
  });
4452
4492
 
4453
- // src/SourceJS.ts
4454
- var SourceJS;
4455
- var init_SourceJS = __esm({
4456
- "src/SourceJS.ts"() {
4493
+ // src/MainProcess.ts
4494
+ var require_MainProcess = __commonJS({
4495
+ "src/MainProcess.ts"() {
4457
4496
  "use strict";
4458
- init_basePath();
4497
+ init_asyncLoad();
4498
+ init_captureFalseTouch();
4459
4499
  init_Cast();
4460
- init_domain();
4461
- init_DOMCreateElement();
4462
- init_InheritClass();
4463
- init_Package();
4500
+ init_Class();
4501
+ init_ClassFactory();
4502
+ init_Component();
4503
+ init_ComponentFactory();
4504
+ init_componentLoader();
4505
+ init_CONFIG();
4506
+ init_DataStringify();
4507
+ init_defaultProcessors();
4508
+ init_Export();
4509
+ init_Import();
4510
+ init_introspection();
4511
+ init_isQCObjects();
4464
4512
  init_Logger();
4465
- SourceJS = class extends InheritClass {
4466
- static {
4467
- __name(this, "SourceJS");
4468
- }
4469
- domain = _domain_;
4470
- basePath = _basePath_;
4471
- type = "text/javascript";
4472
- containerTag = "body";
4473
- url = "";
4474
- data = {};
4475
- async = false;
4476
- external = false;
4477
- constructor(o) {
4478
- super(o);
4479
- this.body = _DOMCreateElement("script");
4480
- }
4481
- set(name, value) {
4482
- this[name] = value;
4483
- }
4484
- get(name, _default) {
4485
- return this[name] || _default;
4486
- }
4487
- status = false;
4488
- done() {
4489
- }
4490
- fail() {
4491
- }
4492
- rebuild() {
4493
- const context = this;
4513
+ init_mathFunctions();
4514
+ init_NamespaceRef();
4515
+ init_New();
4516
+ init_ObjectName();
4517
+ init_Package();
4518
+ init_platform();
4519
+ init_PrimaryCollections();
4520
+ init_Ready();
4521
+ init_serviceLoader();
4522
+ init_Tag();
4523
+ init_top();
4524
+ init_Processor();
4525
+ init_is_a();
4526
+ init_getType();
4527
+ init_shortCode();
4528
+ init_DOMCreateElement();
4529
+ init_ComplexStorageCache();
4530
+ init_super();
4531
+ init_waitUntil();
4532
+ init_subelements();
4533
+ init_globalSettings();
4534
+ init_loadSDK();
4535
+ (/* @__PURE__ */ __name(function __qcobjects__(_top2) {
4536
+ if (typeof Object.defineProperty !== "undefined" && typeof _top2 !== "undefined") {
4494
4537
  try {
4495
- document.getElementsByTagName(context.containerTag)[0].appendChild(
4496
- function(s, url, context2) {
4497
- s.type = context2.type;
4498
- s.src = url;
4499
- s.crossOrigin = Object.hasOwn(context2, "crossOrigin") ? context2.crossOrigin : "anonymous";
4500
- s.async = context2.async;
4501
- s.onreadystatechange = function() {
4502
- if (this.readyState === "complete") {
4503
- context2.done.call(context2);
4504
- }
4505
- };
4506
- s.onload = function(e) {
4507
- context2.status = true;
4508
- context2.done.call(context2, e);
4509
- };
4510
- s.onerror = function(e) {
4511
- context2.status = false;
4512
- context2.fail.call(context2, e);
4513
- };
4514
- context2.body = s;
4515
- return s;
4516
- }.call(
4517
- this,
4518
- _DOMCreateElement("script"),
4519
- this.external ? this.url : this.basePath + this.url,
4520
- context
4521
- )
4522
- );
4538
+ Object.defineProperty(_top2, "__qcobjects__", {
4539
+ enumerable: true,
4540
+ configurable: false,
4541
+ writable: false,
4542
+ value: __qcobjects__
4543
+ });
4523
4544
  } catch (e) {
4524
- context.status = false;
4525
4545
  logger.debug(`An error ocurred: ${e}`);
4526
- context.fail();
4546
+ if (typeof _top2.__qcobjects__ !== "undefined") {
4547
+ _top2.__qcobjects__.loaded = true;
4548
+ }
4527
4549
  }
4528
4550
  }
4529
- Cast(o) {
4530
- return _Cast(this, o);
4531
- }
4532
- _new_(properties) {
4533
- this.__new__(properties);
4534
- this.rebuild();
4535
- }
4536
- };
4537
- Package("com.qcobjects", [SourceJS]);
4538
- }
4539
- });
4540
-
4541
- // src/SourceCSS.ts
4542
- var SourceCSS;
4543
- var init_SourceCSS = __esm({
4544
- "src/SourceCSS.ts"() {
4545
- "use strict";
4546
- init_basePath();
4547
- init_Cast();
4548
- init_domain();
4549
- init_DOMCreateElement();
4550
- init_InheritClass();
4551
- init_platform();
4552
- init_Package();
4553
- SourceCSS = class extends InheritClass {
4554
- static {
4555
- __name(this, "SourceCSS");
4556
- }
4557
- domain = _domain_;
4558
- basePath = _basePath_;
4559
- url = "";
4560
- data = {};
4561
- async = false;
4562
- external = false;
4563
- constructor(o) {
4564
- super(o);
4565
- this.body = _DOMCreateElement("link");
4566
- }
4567
- fail() {
4568
- throw new Error("Method not implemented.");
4569
- }
4570
- Cast(o) {
4571
- return _Cast(this, o);
4572
- }
4573
- set(name, value) {
4574
- this[name] = value;
4575
- }
4576
- get(name, _default) {
4577
- return this[name] || _default;
4578
- }
4579
- done() {
4580
- }
4581
- rebuild() {
4582
- const context = this;
4551
+ if (typeof _top2.__qcobjects__.loaded === "undefined") {
4552
+ _top2.__qcobjects__.loaded = true;
4553
+ const global2 = _top2;
4554
+ _top2.global = global2;
4583
4555
  if (isBrowser) {
4584
- window.document.getElementsByTagName("head")[0].appendChild(
4585
- function(s, url, context2) {
4586
- s.type = "text/css";
4587
- s.rel = "stylesheet";
4588
- s.href = url;
4589
- s.crossOrigin = "anonymous";
4590
- s.onreadystatechange = function() {
4591
- if (this.readyState === "complete") {
4592
- context2.done.call(context2);
4593
- }
4594
- };
4595
- s.onload = context2.done;
4596
- context2.body = s;
4597
- return s;
4598
- }.call(
4599
- this,
4600
- _DOMCreateElement("link"),
4601
- this.external ? this.url : this.basePath + this.url,
4602
- context
4603
- )
4604
- );
4556
+ Element.prototype.subelements = subelements;
4557
+ Document.prototype.subelements = subelements;
4558
+ HTMLElement.prototype.subelements = subelements;
4559
+ if (typeof ShadowRoot !== "undefined") {
4560
+ ShadowRoot.prototype.subelements = subelements;
4561
+ }
4605
4562
  }
4606
- }
4607
- };
4608
- Package("com.qcobjects", [SourceCSS]);
4609
- }
4610
- });
4611
-
4612
- // src/Service.ts
4613
- var Service, JSONService, ConfigService;
4614
- var init_Service = __esm({
4615
- "src/Service.ts"() {
4616
- "use strict";
4617
- init_basePath();
4618
- init_Crypt();
4619
- init_domain();
4620
- init_InheritClass();
4621
- init_Logger();
4622
- init_Package();
4623
- init_secretKey();
4624
- init_CONFIG();
4625
- Service = class extends InheritClass {
4626
- static {
4627
- __name(this, "Service");
4628
- }
4629
- options;
4630
- withCredentials;
4631
- useHTTP2;
4632
- // eslint-disable-next-line no-unused-vars
4633
- mockup({ request, service }) {
4634
- throw new Error("Method not implemented.");
4635
- }
4636
- name;
4637
- responseHeaders;
4638
- // eslint-disable-next-line no-unused-vars
4639
- local({ request, service }) {
4640
- throw new Error("Method not implemented.");
4641
- }
4642
- kind = "rest";
4643
- /* it can be rest, mockup, local */
4644
- domain = _domain_;
4645
- basePath = _basePath_;
4646
- url = "";
4647
- method = "GET";
4648
- data = {};
4649
- reload = false;
4650
- cached = false;
4651
- headers;
4652
- template;
4653
- // eslint-disable-next-line no-unused-vars
4654
- done({ request, service }) {
4655
- throw new Error("Method not implemented.");
4656
- }
4657
- // eslint-disable-next-line no-unused-vars
4658
- fail(...args) {
4659
- throw new Error("Method not implemented.");
4660
- }
4661
- set(name, value) {
4662
- this[name] = value;
4663
- }
4664
- get(name, _default) {
4665
- return this[name] || _default;
4666
- }
4667
- };
4668
- JSONService = class extends Service {
4669
- static {
4670
- __name(this, "JSONService");
4671
- }
4672
- method = "GET";
4673
- cached = false;
4674
- headers = {
4675
- "Content-Type": "application/json",
4676
- "charset": "utf-8"
4677
- };
4678
- JSONresponse = void 0;
4679
- done(result) {
4680
- logger.debug("***** RECEIVED RESPONSE:");
4681
- logger.debug(result.service.template);
4682
- this.JSONresponse = JSON.parse(result.service.template);
4683
- }
4684
- };
4685
- ConfigService = class extends JSONService {
4686
- static {
4687
- __name(this, "ConfigService");
4688
- }
4689
- method = "GET";
4690
- cached = false;
4691
- configFileName = "config.json";
4692
- headers = {
4693
- "Content-Type": "application/json",
4694
- "charset": "utf-8"
4695
- };
4696
- configLoaded() {
4697
- throw Error("Method not implemented.");
4698
- }
4699
- JSONresponse = void 0;
4700
- done(result) {
4701
- logger.debug("***** CONFIG LOADED:");
4702
- logger.debug(result.service.template);
4703
- this.JSONresponse = JSON.parse(result.service.template);
4704
- if (Object.hasOwn(this.JSONresponse, "__encoded__")) {
4705
- const decodedValue = _Crypt.decrypt(this.JSONresponse?.__encoded__, _secretKey);
4706
- this.JSONresponse = JSON.parse(decodedValue);
4707
- }
4708
- const jsonResponse = this.JSONresponse;
4709
- Object.keys(jsonResponse).map((k) => {
4710
- CONFIG.set(k, jsonResponse[k]);
4711
- return k;
4712
- });
4713
- this.configLoaded().catch((e) => {
4714
- throw new Error(`An error ocurred: ${e}`);
4715
- });
4716
- }
4717
- fail() {
4718
- this.configLoaded().catch((e) => {
4719
- throw new Error(`An error ocurred: ${e}`);
4720
- });
4721
- }
4722
- constructor() {
4723
- super();
4724
- this.set("url", `${this.get("basePath")}${this.get("configFileName")}`);
4725
- }
4726
- };
4727
- Package("com.qcobjects.api", [
4728
- Service
4729
- ]);
4730
- Package("com.qcobjects.api.services", [
4731
- JSONService
4732
- ]);
4733
- Package("com.qcobjects.api.config", [
4734
- ConfigService
4735
- ]);
4736
- }
4737
- });
4738
-
4739
- // src/globalSettings.ts
4740
- var GlobalSettings;
4741
- var init_globalSettings = __esm({
4742
- "src/globalSettings.ts"() {
4743
- "use strict";
4744
- init_CONFIG();
4745
- init_InheritClass();
4746
- init_Logger();
4747
- init_Package();
4748
- init_platform();
4749
- init_serviceLoader();
4750
- init_top();
4751
- init_Service();
4752
- GlobalSettings = class _GlobalSettings extends InheritClass {
4753
- static {
4754
- __name(this, "GlobalSettings");
4755
- }
4756
- static __start__() {
4757
- return _GlobalSettings.instance.__start__();
4758
- }
4759
- _GLOBAL = {};
4760
- static _instance;
4761
- static get instance() {
4762
- if (typeof _GlobalSettings._instance === "undefined") {
4763
- _GlobalSettings._instance = new _GlobalSettings();
4764
- }
4765
- return _GlobalSettings._instance;
4766
- }
4767
- set(name, value) {
4768
- this._GLOBAL[name] = value;
4769
- }
4770
- get(name, _default) {
4771
- let _value;
4772
- if (typeof this._GLOBAL[name] !== "undefined") {
4773
- _value = this._GLOBAL[name];
4774
- } else if (typeof _default !== "undefined") {
4775
- _value = _default;
4563
+ logger.debugEnabled = false;
4564
+ logger.infoEnabled = true;
4565
+ _top2.logger = logger;
4566
+ if (isBrowser) {
4567
+ Element.prototype.find = function(tag) {
4568
+ const _self = this;
4569
+ const _oo = [];
4570
+ const _tags = document.subelements(tag);
4571
+ _tags.map((_tt, _t) => {
4572
+ if (typeof _tags[_t] !== "undefined" && _tags[_t].parentNode.tagName === _self.parentNode.tagName) {
4573
+ _oo.push(_Cast(_tt, new Object()));
4574
+ }
4575
+ return _tt;
4576
+ });
4577
+ return _oo;
4578
+ };
4776
4579
  }
4777
- return _value;
4778
- }
4779
- __start__() {
4780
- const __load__serviceWorker = /* @__PURE__ */ __name(function() {
4781
- let _promise;
4782
- if (isBrowser) {
4783
- _promise = new Promise(function(resolve, reject) {
4784
- if ("serviceWorker" in navigator && typeof CONFIG.get("serviceWorkerURI") !== "undefined") {
4785
- CONFIG.set("serviceWorkerScope", CONFIG.get("serviceWorkerScope") ? CONFIG.get("serviceWorkerScope") : "/");
4786
- navigator.serviceWorker.register(CONFIG.get("serviceWorkerURI"), {
4787
- scope: CONFIG.get("serviceWorkerScope")
4788
- }).then(function(registration) {
4789
- logger.debug("Service Worker Registered");
4790
- resolve.call(_promise, registration);
4791
- }, function(registration) {
4792
- logger.debug("Error registering Service Worker");
4793
- reject.call(_promise, registration);
4794
- });
4795
- navigator.serviceWorker.ready.then(function(registration) {
4796
- logger.debug("Service Worker Ready");
4797
- resolve.call(_promise, registration);
4798
- }, function(registration) {
4799
- logger.debug("Error loading Service Worker");
4800
- reject.call(_promise, registration);
4580
+ if (isBrowser) {
4581
+ Element.prototype.append = /* @__PURE__ */ __name(function QC_Append(child) {
4582
+ if (isQCObjects_Object(child) || typeof child.body !== "undefined") {
4583
+ this.appendChild(child.body);
4584
+ } else {
4585
+ this.appendChild(child);
4586
+ }
4587
+ }, "QC_Append");
4588
+ Element.prototype.render = /* @__PURE__ */ __name(function QC_Render(content) {
4589
+ const _self = this;
4590
+ const _appendVDOM = /* @__PURE__ */ __name((_self2, content2) => {
4591
+ if (typeof document.implementation.createHTMLDocument !== "undefined") {
4592
+ const doc = document.implementation.createHTMLDocument("");
4593
+ doc.body.innerHTML = content2;
4594
+ doc.body.subelements("*").map((element) => {
4595
+ return _self2.append(element);
4801
4596
  });
4802
4597
  }
4803
- });
4804
- } else {
4805
- _promise = Promise.resolve();
4806
- }
4807
- return _promise;
4808
- }, "__load__serviceWorker");
4809
- const _buildComponents = /* @__PURE__ */ __name(function() {
4810
- return new Promise((resolve) => {
4811
- if (isBrowser) {
4812
- logger.debug("Starting to building components");
4598
+ }, "_appendVDOM");
4599
+ if (typeof this.innerHTML !== "undefined") {
4813
4600
  try {
4814
- buildComponentsStack();
4601
+ this.innerHTML += content;
4815
4602
  } catch (e) {
4816
- throw Error(`Something went wrong trying to start components tree: ${e.message}`);
4603
+ logger.debug(`An error ocurred: ${e}`);
4604
+ _appendVDOM(_self, content);
4817
4605
  }
4818
- logger.debug("Initializing the service worker");
4819
- __load__serviceWorker.call(_top).catch(function(e) {
4820
- logger.debug(`error loading the service worker ${e}`);
4821
- });
4606
+ } else {
4607
+ _appendVDOM(_self, content);
4822
4608
  }
4823
- resolve();
4824
- });
4825
- }, "_buildComponents");
4826
- return new Promise((resolve) => {
4827
- logger.debug("Starting to load the config settings...");
4828
- if (CONFIG.get("useConfigService", false)) {
4829
- logger.debug("Loading settings using local configuration file...");
4830
- setConfigService(new ConfigService());
4831
- configService.configLoaded = _buildComponents;
4832
- serviceLoader(configService)?.then((standardResponse) => {
4833
- resolve(standardResponse);
4834
- })?.catch((e) => {
4835
- throw new Error(`An error ocurred while trying to load ${configService.url}: ${e}`);
4836
- });
4837
- } else {
4838
- logger.debug("Starting to load the components...");
4839
- _buildComponents.call(this).then(() => {
4840
- resolve({});
4841
- }).catch((e) => {
4842
- throw new Error(`An error ocurred while trying to build the components stack. ${e}`);
4843
- });
4844
- }
4845
- });
4846
- }
4847
- };
4848
- Package("com.qcobjects", [
4849
- GlobalSettings
4850
- ]);
4851
- }
4852
- });
4853
-
4854
- // src/WidgetsFactory.ts
4855
- var QCObjectsWidgetNode, _ComponentWidget_, RegisterWidget, RegisterWidgets;
4856
- var init_WidgetsFactory = __esm({
4857
- "src/WidgetsFactory.ts"() {
4858
- "use strict";
4859
- init_DOMCreateElement();
4860
- init_Export();
4861
- init_introspection();
4862
- init_platform();
4863
- QCObjectsWidgetNode = class {
4864
- static {
4865
- __name(this, "QCObjectsWidgetNode");
4866
- }
4867
- accessKey;
4868
- accessKeyLabel;
4869
- autocapitalize;
4870
- dir;
4871
- draggable;
4872
- hidden;
4873
- inert;
4874
- innerText;
4875
- lang;
4876
- offsetHeight;
4877
- offsetLeft;
4878
- offsetParent;
4879
- offsetTop;
4880
- offsetWidth;
4881
- outerText;
4882
- popover;
4883
- spellcheck;
4884
- title;
4885
- translate;
4886
- attachInternals() {
4887
- throw new Error("Method not implemented.");
4888
- }
4889
- click() {
4890
- throw new Error("Method not implemented.");
4891
- }
4892
- hidePopover() {
4893
- throw new Error("Method not implemented.");
4894
- }
4895
- showPopover() {
4896
- throw new Error("Method not implemented.");
4897
- }
4898
- togglePopover(force) {
4899
- throw new Error("Method not implemented.");
4900
- }
4901
- addEventListener(type, listener, options) {
4902
- throw new Error("Method not implemented.");
4903
- }
4904
- removeEventListener(type, listener, options) {
4905
- throw new Error("Method not implemented.");
4906
- }
4907
- attributes;
4908
- classList;
4909
- className;
4910
- clientHeight;
4911
- clientLeft;
4912
- clientTop;
4913
- clientWidth;
4914
- id;
4915
- innerHTML;
4916
- localName;
4917
- namespaceURI;
4918
- onfullscreenchange;
4919
- onfullscreenerror;
4920
- outerHTML;
4921
- ownerDocument;
4922
- part;
4923
- prefix;
4924
- scrollHeight;
4925
- scrollLeft;
4926
- scrollTop;
4927
- scrollWidth;
4928
- shadowRoot;
4929
- slot;
4930
- tagName;
4931
- attachShadow(init) {
4932
- throw new Error("Method not implemented.");
4933
- }
4934
- checkVisibility(options) {
4935
- throw new Error("Method not implemented.");
4936
- }
4937
- closest(selectors) {
4938
- throw new Error("Method not implemented.");
4939
- }
4940
- computedStyleMap() {
4941
- throw new Error("Method not implemented.");
4942
- }
4943
- getAttribute(qualifiedName) {
4944
- throw new Error("Method not implemented.");
4945
- }
4946
- getAttributeNS(namespace, localName) {
4947
- throw new Error("Method not implemented.");
4948
- }
4949
- getAttributeNames() {
4950
- throw new Error("Method not implemented.");
4951
- }
4952
- getAttributeNode(qualifiedName) {
4953
- throw new Error("Method not implemented.");
4954
- }
4955
- getAttributeNodeNS(namespace, localName) {
4956
- throw new Error("Method not implemented.");
4957
- }
4958
- getBoundingClientRect() {
4959
- throw new Error("Method not implemented.");
4960
- }
4961
- getClientRects() {
4962
- throw new Error("Method not implemented.");
4963
- }
4964
- getElementsByClassName(classNames) {
4965
- throw new Error("Method not implemented.");
4966
- }
4967
- getElementsByTagName(qualifiedName) {
4968
- throw new Error("Method not implemented.");
4969
- }
4970
- getElementsByTagNameNS(namespace, localName) {
4971
- throw new Error("Method not implemented.");
4972
- }
4973
- getHTML(options) {
4974
- throw new Error("Method not implemented.");
4975
- }
4976
- hasAttribute(qualifiedName) {
4977
- throw new Error("Method not implemented.");
4978
- }
4979
- hasAttributeNS(namespace, localName) {
4980
- throw new Error("Method not implemented.");
4981
- }
4982
- hasAttributes() {
4983
- throw new Error("Method not implemented.");
4984
- }
4985
- hasPointerCapture(pointerId) {
4986
- throw new Error("Method not implemented.");
4987
- }
4988
- insertAdjacentElement(where, element) {
4989
- throw new Error("Method not implemented.");
4990
- }
4991
- insertAdjacentHTML(position, string) {
4992
- throw new Error("Method not implemented.");
4993
- }
4994
- insertAdjacentText(where, data) {
4995
- throw new Error("Method not implemented.");
4996
- }
4997
- matches(selectors) {
4998
- throw new Error("Method not implemented.");
4999
- }
5000
- releasePointerCapture(pointerId) {
5001
- throw new Error("Method not implemented.");
5002
- }
5003
- removeAttribute(qualifiedName) {
5004
- throw new Error("Method not implemented.");
5005
- }
5006
- removeAttributeNS(namespace, localName) {
5007
- throw new Error("Method not implemented.");
5008
- }
5009
- removeAttributeNode(attr) {
5010
- throw new Error("Method not implemented.");
5011
- }
5012
- requestFullscreen(options) {
5013
- throw new Error("Method not implemented.");
5014
- }
5015
- requestPointerLock(options) {
5016
- throw new Error("Method not implemented.");
5017
- }
5018
- scroll(x, y) {
5019
- throw new Error("Method not implemented.");
5020
- }
5021
- scrollBy(x, y) {
5022
- throw new Error("Method not implemented.");
5023
- }
5024
- scrollIntoView(arg) {
5025
- throw new Error("Method not implemented.");
5026
- }
5027
- scrollTo(x, y) {
5028
- throw new Error("Method not implemented.");
5029
- }
5030
- setAttribute(qualifiedName, value) {
5031
- throw new Error("Method not implemented.");
5032
- }
5033
- setAttributeNS(namespace, qualifiedName, value) {
5034
- throw new Error("Method not implemented.");
5035
- }
5036
- setAttributeNode(attr) {
5037
- throw new Error("Method not implemented.");
5038
- }
5039
- setAttributeNodeNS(attr) {
5040
- throw new Error("Method not implemented.");
5041
- }
5042
- setHTMLUnsafe(html) {
5043
- throw new Error("Method not implemented.");
5044
- }
5045
- setPointerCapture(pointerId) {
5046
- throw new Error("Method not implemented.");
5047
- }
5048
- toggleAttribute(qualifiedName, force) {
5049
- throw new Error("Method not implemented.");
5050
- }
5051
- webkitMatchesSelector(selectors) {
5052
- throw new Error("Method not implemented.");
5053
- }
5054
- baseURI;
5055
- childNodes;
5056
- firstChild;
5057
- isConnected;
5058
- lastChild;
5059
- nextSibling;
5060
- nodeName;
5061
- nodeType;
5062
- nodeValue;
5063
- parentElement;
5064
- parentNode;
5065
- previousSibling;
5066
- textContent;
5067
- appendChild(node) {
5068
- throw new Error("Method not implemented.");
5069
- }
5070
- cloneNode(deep) {
5071
- throw new Error("Method not implemented.");
5072
- }
5073
- compareDocumentPosition(other) {
5074
- throw new Error("Method not implemented.");
5075
- }
5076
- contains(other) {
5077
- throw new Error("Method not implemented.");
5078
- }
5079
- getRootNode(options) {
5080
- throw new Error("Method not implemented.");
5081
- }
5082
- hasChildNodes() {
5083
- throw new Error("Method not implemented.");
5084
- }
5085
- insertBefore(node, child) {
5086
- throw new Error("Method not implemented.");
5087
- }
5088
- isDefaultNamespace(namespace) {
5089
- throw new Error("Method not implemented.");
5090
- }
5091
- isEqualNode(otherNode) {
5092
- throw new Error("Method not implemented.");
5093
- }
5094
- isSameNode(otherNode) {
5095
- throw new Error("Method not implemented.");
5096
- }
5097
- lookupNamespaceURI(prefix) {
5098
- throw new Error("Method not implemented.");
5099
- }
5100
- lookupPrefix(namespace) {
5101
- throw new Error("Method not implemented.");
5102
- }
5103
- normalize() {
5104
- throw new Error("Method not implemented.");
5105
- }
5106
- removeChild(child) {
5107
- throw new Error("Method not implemented.");
5108
- }
5109
- replaceChild(node, child) {
5110
- throw new Error("Method not implemented.");
5111
- }
5112
- ELEMENT_NODE;
5113
- ATTRIBUTE_NODE;
5114
- TEXT_NODE;
5115
- CDATA_SECTION_NODE;
5116
- ENTITY_REFERENCE_NODE;
5117
- ENTITY_NODE;
5118
- PROCESSING_INSTRUCTION_NODE;
5119
- COMMENT_NODE;
5120
- DOCUMENT_NODE;
5121
- DOCUMENT_TYPE_NODE;
5122
- DOCUMENT_FRAGMENT_NODE;
5123
- NOTATION_NODE;
5124
- DOCUMENT_POSITION_DISCONNECTED;
5125
- DOCUMENT_POSITION_PRECEDING;
5126
- DOCUMENT_POSITION_FOLLOWING;
5127
- DOCUMENT_POSITION_CONTAINS;
5128
- DOCUMENT_POSITION_CONTAINED_BY;
5129
- DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;
5130
- dispatchEvent(event) {
5131
- throw new Error("Method not implemented.");
5132
- }
5133
- ariaAtomic;
5134
- ariaAutoComplete;
5135
- ariaBrailleLabel;
5136
- ariaBrailleRoleDescription;
5137
- ariaBusy;
5138
- ariaChecked;
5139
- ariaColCount;
5140
- ariaColIndex;
5141
- ariaColSpan;
5142
- ariaCurrent;
5143
- ariaDescription;
5144
- ariaDisabled;
5145
- ariaExpanded;
5146
- ariaHasPopup;
5147
- ariaHidden;
5148
- ariaInvalid;
5149
- ariaKeyShortcuts;
5150
- ariaLabel;
5151
- ariaLevel;
5152
- ariaLive;
5153
- ariaModal;
5154
- ariaMultiLine;
5155
- ariaMultiSelectable;
5156
- ariaOrientation;
5157
- ariaPlaceholder;
5158
- ariaPosInSet;
5159
- ariaPressed;
5160
- ariaReadOnly;
5161
- ariaRequired;
5162
- ariaRoleDescription;
5163
- ariaRowCount;
5164
- ariaRowIndex;
5165
- ariaRowSpan;
5166
- ariaSelected;
5167
- ariaSetSize;
5168
- ariaSort;
5169
- ariaValueMax;
5170
- ariaValueMin;
5171
- ariaValueNow;
5172
- ariaValueText;
5173
- role;
5174
- animate(keyframes, options) {
5175
- throw new Error("Method not implemented.");
5176
- }
5177
- getAnimations(options) {
5178
- throw new Error("Method not implemented.");
5179
- }
5180
- after(...nodes) {
5181
- throw new Error("Method not implemented.");
5182
- }
5183
- before(...nodes) {
5184
- throw new Error("Method not implemented.");
5185
- }
5186
- remove() {
5187
- throw new Error("Method not implemented.");
5188
- }
5189
- replaceWith(...nodes) {
5190
- throw new Error("Method not implemented.");
5191
- }
5192
- nextElementSibling;
5193
- previousElementSibling;
5194
- childElementCount;
5195
- children;
5196
- firstElementChild;
5197
- lastElementChild;
5198
- append(...nodes) {
5199
- throw new Error("Method not implemented.");
5200
- }
5201
- prepend(...nodes) {
5202
- throw new Error("Method not implemented.");
5203
- }
5204
- querySelector(selectors) {
5205
- throw new Error("Method not implemented.");
5206
- }
5207
- querySelectorAll(selectors) {
5208
- throw new Error("Method not implemented.");
5209
- }
5210
- replaceChildren(...nodes) {
5211
- throw new Error("Method not implemented.");
5212
- }
5213
- assignedSlot;
5214
- attributeStyleMap;
5215
- style;
5216
- contentEditable;
5217
- enterKeyHint;
5218
- inputMode;
5219
- isContentEditable;
5220
- onabort;
5221
- onanimationcancel;
5222
- onanimationend;
5223
- onanimationiteration;
5224
- onanimationstart;
5225
- onauxclick;
5226
- onbeforeinput;
5227
- onbeforetoggle;
5228
- onblur;
5229
- oncancel;
5230
- oncanplay;
5231
- oncanplaythrough;
5232
- onchange;
5233
- onclick;
5234
- onclose;
5235
- oncontextlost;
5236
- oncontextmenu;
5237
- oncontextrestored;
5238
- oncopy;
5239
- oncuechange;
5240
- oncut;
5241
- ondblclick;
5242
- ondrag;
5243
- ondragend;
5244
- ondragenter;
5245
- ondragleave;
5246
- ondragover;
5247
- ondragstart;
5248
- ondrop;
5249
- ondurationchange;
5250
- onemptied;
5251
- onended;
5252
- onerror;
5253
- onfocus;
5254
- onformdata;
5255
- ongotpointercapture;
5256
- oninput;
5257
- oninvalid;
5258
- onkeydown;
5259
- onkeypress;
5260
- onkeyup;
5261
- onload;
5262
- onloadeddata;
5263
- onloadedmetadata;
5264
- onloadstart;
5265
- onlostpointercapture;
5266
- onmousedown;
5267
- onmouseenter;
5268
- onmouseleave;
5269
- onmousemove;
5270
- onmouseout;
5271
- onmouseover;
5272
- onmouseup;
5273
- onpaste;
5274
- onpause;
5275
- onplay;
5276
- onplaying;
5277
- onpointercancel;
5278
- onpointerdown;
5279
- onpointerenter;
5280
- onpointerleave;
5281
- onpointermove;
5282
- onpointerout;
5283
- onpointerover;
5284
- onpointerup;
5285
- onprogress;
5286
- onratechange;
5287
- onreset;
5288
- onresize;
5289
- onscroll;
5290
- onscrollend;
5291
- onsecuritypolicyviolation;
5292
- onseeked;
5293
- onseeking;
5294
- onselect;
5295
- onselectionchange;
5296
- onselectstart;
5297
- onslotchange;
5298
- onstalled;
5299
- onsubmit;
5300
- onsuspend;
5301
- ontimeupdate;
5302
- ontoggle;
5303
- ontouchcancel;
5304
- ontouchend;
5305
- ontouchmove;
5306
- ontouchstart;
5307
- ontransitioncancel;
5308
- ontransitionend;
5309
- ontransitionrun;
5310
- ontransitionstart;
5311
- onvolumechange;
5312
- onwaiting;
5313
- onwebkitanimationend;
5314
- onwebkitanimationiteration;
5315
- onwebkitanimationstart;
5316
- onwebkittransitionend;
5317
- onwheel;
5318
- autofocus;
5319
- dataset;
5320
- nonce;
5321
- tabIndex;
5322
- blur() {
5323
- throw new Error("Method not implemented.");
5324
- }
5325
- focus(options) {
5326
- throw new Error("Method not implemented.");
5327
- }
5328
- };
5329
- if (isBrowser) {
5330
- _ComponentWidget_ = class _ComponentWidget_ extends HTMLElement {
5331
- static {
5332
- __name(this, "_ComponentWidget_");
5333
- }
5334
- constructor() {
5335
- super();
5336
- const componentWidget = this;
5337
- const componentName = componentWidget.nodeName.toLowerCase();
5338
- const componentBody = _DOMCreateElement("quick-component");
5339
- const __enabled__atributes__ = componentWidget.getAttributeNames();
5340
- componentBody.setAttribute("name", componentName);
5341
- if (!componentWidget.hasAttribute("shadowed")) {
5342
- componentBody.setAttribute("shadowed", "true");
5343
- }
5344
- __enabled__atributes__.map(function(attributeName) {
5345
- if (componentWidget.hasAttribute(attributeName)) {
5346
- componentBody.setAttribute(attributeName, componentWidget?.getAttribute(attributeName));
5347
- componentWidget.removeAttribute(attributeName);
5348
- }
5349
- });
5350
- const data_attributenames = componentWidget.getAttributeNames().filter(function(a) {
5351
- return a.startsWith("data-");
5352
- }).map(function(a) {
5353
- return a.split("-")[1];
5354
- });
5355
- data_attributenames.map(function(_attribute_name_) {
5356
- componentBody.setAttribute("data-" + _attribute_name_, componentWidget?.getAttribute("data-" + _attribute_name_));
5357
- componentWidget.removeAttribute("data-" + _attribute_name_);
5358
- });
5359
- [...componentWidget.children].map(function(element) {
5360
- componentBody.appendChild(element.cloneNode(true));
5361
- element.remove();
5362
- });
5363
- componentWidget.append(componentBody);
5364
- }
5365
- };
5366
- } else {
5367
- _ComponentWidget_ = class _ComponentWidget_ extends QCObjectsWidgetNode {
5368
- static {
5369
- __name(this, "_ComponentWidget_");
5370
- }
5371
- constructor() {
5372
- super();
5373
- throw new Error("Class not implemented.");
5374
- }
5375
- };
5376
- }
5377
- Export(_ComponentWidget_);
5378
- RegisterWidget = /* @__PURE__ */ __name(function(widgetName) {
5379
- if (isBrowser) {
5380
- customElements.define(widgetName, class extends _ComponentWidget_ {
5381
- });
5382
- } else {
5383
- throw new Error("RegisterWidget is not implemented for non browser ecosystems yet.");
5384
- }
5385
- }, "RegisterWidget");
5386
- RegisterWidgets = /* @__PURE__ */ __name(function(...args) {
5387
- const widgetList = [...args];
5388
- widgetList.filter(function(widgetName) {
5389
- return typeof widgetName === "string";
5390
- }).map(function(widgetName) {
5391
- return RegisterWidget(widgetName);
5392
- });
5393
- }, "RegisterWidgets");
5394
- _protected_code_(RegisterWidget);
5395
- _protected_code_(RegisterWidgets);
5396
- Export(RegisterWidget);
5397
- Export(RegisterWidgets);
5398
- }
5399
- });
5400
-
5401
- // src/Controller.ts
5402
- var Controller;
5403
- var init_Controller = __esm({
5404
- "src/Controller.ts"() {
5405
- "use strict";
5406
- init_ClassFactory();
5407
- init_getType();
5408
- init_InheritClass();
5409
- init_Logger();
5410
- init_New();
5411
- init_Package();
5412
- init_platform();
5413
- Controller = class extends InheritClass {
5414
- static {
5415
- __name(this, "Controller");
5416
- }
5417
- component;
5418
- dependencies = [];
5419
- constructor({
5420
- component,
5421
- dependencies
5422
- }) {
5423
- super({ component, dependencies });
5424
- this.component = component;
5425
- this.dependencies = dependencies;
5426
- if (typeof this.component === "undefined" || this.component === null) {
5427
- throw Error(`${__getType__(this)} must be called with a component`);
4609
+ }, "QC_Render");
5428
4610
  }
5429
- }
5430
- // eslint-disable-next-line no-unused-vars
5431
- fail(...args) {
5432
- throw new Error("Method not implemented.");
5433
- }
5434
- routingSelectedAttr(attrName) {
5435
- return this.component?.routingSelected.map((r) => {
5436
- return r[attrName];
5437
- }).filter(function(v) {
5438
- return v;
5439
- }).pop();
5440
- }
5441
- isTouchable() {
5442
- return "ontouchstart" in window || navigator.MaxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
5443
- }
5444
- onpress(subelementSelector, handler) {
4611
+ Export(waitUntil);
4612
+ Export(_super_);
4613
+ Export(ComplexStorageCache);
4614
+ Export(ClassFactory);
4615
+ Export(_DOMCreateElement);
4616
+ Export(shortCode);
4617
+ Export(__getType__);
4618
+ Export(is_a);
4619
+ Package("com.qcobjects", [Processor]);
5445
4620
  if (isBrowser) {
5446
- try {
5447
- if (this.isTouchable()) {
5448
- (this.component?.componentRoot?.subelements(subelementSelector))[0].addEventListener("touchstart", handler, {
5449
- passive: true
5450
- });
5451
- } else {
5452
- (this.component?.componentRoot?.subelements(subelementSelector))[0].addEventListener("click", handler, {
5453
- passive: true
5454
- });
5455
- }
5456
- } catch (e) {
5457
- logger.debug(`An error ocurred: ${e}.`);
5458
- logger.debug("No button to assign press event");
5459
- }
4621
+ Element.prototype.Cast = /* @__PURE__ */ __name(function QC_Cast(_o) {
4622
+ const _self = this;
4623
+ return _Cast(_self, _o);
4624
+ }, "QC_Cast");
5460
4625
  }
5461
- }
5462
- createRoutingController() {
5463
- const controller = this;
5464
- const component = controller.component;
5465
- const controllerName = controller.routingSelectedAttr("controllerclass");
5466
- if (typeof controllerName !== "undefined") {
5467
- const _Controller2 = ClassFactory(controllerName);
5468
- if (typeof _Controller2 !== "undefined" && component !== null) {
5469
- component.routingController = New(_Controller2, {
5470
- component
5471
- });
5472
- if (typeof component.routingController !== "undefined" && Object.hasOwn(component.routingController, "done") && typeof component.routingController.done === "function") {
5473
- component.routingController.done.call(component.routingController);
5474
- }
4626
+ if (isBrowser) {
4627
+ window.onload = _Ready;
4628
+ if (is_phonegap) {
4629
+ document.addEventListener("deviceready", _Ready, captureFalseTouch);
5475
4630
  }
4631
+ } else {
4632
+ global2.onload = _Ready;
5476
4633
  }
5477
- }
5478
- done() {
5479
- }
5480
- };
5481
- Package("com.qcobjects.controllers", [
5482
- Controller
5483
- ]);
5484
- }
5485
- });
5486
-
5487
- // src/View.ts
5488
- var View;
5489
- var init_View = __esm({
5490
- "src/View.ts"() {
5491
- "use strict";
5492
- init_getType();
5493
- init_InheritClass();
5494
- init_Package();
5495
- View = class extends InheritClass {
5496
- static {
5497
- __name(this, "View");
5498
- }
5499
- constructor({ component = void 0, dependencies = [] }) {
5500
- super({ component, dependencies });
5501
- if (typeof this.component === "undefined" || this.component === "null") {
5502
- throw Error(`${__getType__(this)} must be called with a component`);
5503
- }
5504
- }
5505
- };
5506
- Package("com.qcobjects.views", [
5507
- View
5508
- ]);
5509
- }
5510
- });
5511
-
5512
- // src/VO.ts
5513
- var VO;
5514
- var init_VO = __esm({
5515
- "src/VO.ts"() {
5516
- "use strict";
5517
- init_InheritClass();
5518
- init_Package();
5519
- VO = class extends InheritClass {
5520
- static {
5521
- __name(this, "VO");
5522
- }
5523
- };
5524
- Package("com.qcobjects.valueObjects", [
5525
- VO
5526
- ]);
5527
- }
5528
- });
5529
-
5530
- // src/Effect.ts
5531
- var Effect;
5532
- var init_Effect = __esm({
5533
- "src/Effect.ts"() {
5534
- "use strict";
5535
- init_InheritClass();
5536
- init_Package();
5537
- Effect = class extends InheritClass {
5538
- static {
5539
- __name(this, "Effect");
5540
- }
5541
- // eslint-disable-next-line no-unused-vars
5542
- done(...args) {
5543
- throw new Error("Method not implemented.");
5544
- }
5545
- // eslint-disable-next-line no-unused-vars
5546
- apply(...args) {
5547
- throw new Error("Method not implemented.");
5548
- }
5549
- duration = 1e3;
5550
- animate({
5551
- timing,
5552
- draw,
5553
- duration
5554
- }) {
5555
- const _self = this;
5556
- const start = performance.now();
5557
- requestAnimationFrame(/* @__PURE__ */ __name(function animate(time) {
5558
- let timeFraction = (time - start) / duration;
5559
- if (timeFraction > 1) timeFraction = 1;
5560
- const progress = timing(timeFraction);
5561
- draw(Math.round(progress * 100));
5562
- if (timeFraction < 1) {
5563
- requestAnimationFrame(animate);
5564
- } else {
5565
- if (typeof _self !== "undefined" && _self !== null && Object.hasOwn(_self, "done") && (typeof _self.done).toLowerCase() === "function") {
5566
- _self.done.call(_self);
5567
- }
5568
- }
5569
- }, "animate"));
5570
- }
5571
- };
5572
- Package("com.qcobjects.effects.base", [
5573
- Effect
5574
- ]);
5575
- }
5576
- });
5577
-
5578
- // src/TransitionEffect.ts
5579
- var TransitionEffect;
5580
- var init_TransitionEffect = __esm({
5581
- "src/TransitionEffect.ts"() {
5582
- "use strict";
5583
- init_Effect();
5584
- init_Logger();
5585
- init_Package();
5586
- init_ClassFactory();
5587
- TransitionEffect = class extends Effect {
5588
- static {
5589
- __name(this, "TransitionEffect");
5590
- }
5591
- duration = 385;
5592
- defaultParams = {
5593
- alphaFrom: 0,
5594
- alphaTo: 1,
5595
- angleFrom: 180,
5596
- angleTo: 0,
5597
- radiusFrom: 0,
5598
- radiusTo: 30,
5599
- scaleFrom: 0,
5600
- scaleTo: 1
5601
- };
5602
- fitToHeight = false;
5603
- fitToWidth = false;
5604
- component;
5605
- effects;
5606
- apply({
5607
- alphaFrom,
5608
- alphaTo,
5609
- angleFrom,
5610
- angleTo,
5611
- radiusFrom,
5612
- radiusTo,
5613
- scaleFrom,
5614
- scaleTo
5615
- }) {
5616
- const _transition_ = this;
5617
- logger.info("EXECUTING TransitionEffect ");
5618
- const componentRoot = _transition_.component.componentRoot;
5619
- if (typeof componentRoot !== "undefined" && componentRoot !== null) {
5620
- if (_transition_.fitToHeight) {
5621
- componentRoot.height = typeof componentRoot.offsetParent === "object" && componentRoot.offsetParent !== null ? componentRoot.offsetParent?.scrollHeight : componentRoot.getBoundingClientRect().height;
5622
- }
5623
- if (_transition_.fitToWidth) {
5624
- componentRoot.width = typeof componentRoot.offsetParent === "object" && componentRoot.offsetParent !== null ? componentRoot.offsetParent?.scrollWidth : componentRoot.getBoundingClientRect().width;
5625
- }
5626
- if (_transition_.component.shadowed) {
5627
- componentRoot.host.style.display = "block";
5628
- } else {
5629
- componentRoot.style.display = "block";
5630
- }
5631
- _transition_.effects.map((effectClassName) => {
5632
- const __effectClass__ = ClassFactory(effectClassName);
5633
- const effectObj = new __effectClass__({});
5634
- const effectClassMethod = effectObj.apply.bind(_transition_);
5635
- const componentHost = _transition_.component.shadowed ? componentRoot.host : componentRoot;
5636
- const effectParams = {
5637
- alphaFrom,
5638
- alphaTo,
5639
- angleFrom,
5640
- angleTo,
5641
- radiusFrom,
5642
- radiusTo,
5643
- scaleFrom,
5644
- scaleTo
5645
- };
5646
- effectClassMethod(componentHost, ...Object.values(effectParams));
5647
- return effectClassName;
4634
+ if (isBrowser) {
4635
+ window.addEventListener("popstate", function(popStateEvent) {
4636
+ popStateEvent.stopImmediatePropagation();
4637
+ popStateEvent.stopPropagation();
4638
+ Component.route().catch((e) => {
4639
+ throw new Error(`An error ocurred when trying to load initial routes. ${e}`);
4640
+ });
5648
4641
  });
5649
4642
  }
5650
- }
5651
- };
5652
- Package("com.qcobjects.effects.transitions.base", [
5653
- TransitionEffect
5654
- ]);
5655
- }
5656
- });
5657
-
5658
- // src/Timer.ts
5659
- var Timer;
5660
- var init_Timer = __esm({
5661
- "src/Timer.ts"() {
5662
- "use strict";
5663
- init_InheritClass();
5664
- init_Package();
5665
- Timer = class extends InheritClass {
5666
- static {
5667
- __name(this, "Timer");
5668
- }
5669
- duration = 1e3;
5670
- alive = true;
5671
- thread({
5672
- timing,
5673
- intervalInterceptor,
5674
- duration
5675
- }) {
5676
- const timer = this;
5677
- const start = performance.now();
5678
- requestAnimationFrame(/* @__PURE__ */ __name(function thread(time) {
5679
- const elapsed = time - start;
5680
- let timeFraction = elapsed / duration;
5681
- if (timeFraction > 1) timeFraction = 1;
5682
- const progress = timing(timeFraction, elapsed);
5683
- intervalInterceptor(Math.round(progress * 100));
5684
- if ((timeFraction < 1 || duration === -1) && timer.alive) {
5685
- requestAnimationFrame(thread);
4643
+ Export(serviceLoader);
4644
+ Export(componentLoader);
4645
+ Export(ComponentURI);
4646
+ Export(ObjectName);
4647
+ Export(_DataStringify);
4648
+ Export(isQCObjects_Class);
4649
+ Export(isQCObjects_Object);
4650
+ Export(NamespaceRef);
4651
+ Array.prototype.unique = function() {
4652
+ return this.filter(function(value, index, self2) {
4653
+ return self2.indexOf(value) === index;
4654
+ });
4655
+ };
4656
+ Array.unique = function(a) {
4657
+ return a.unique();
4658
+ };
4659
+ _protected_code_(Array.unique);
4660
+ _protected_code_(Array.prototype.unique);
4661
+ Array.prototype.table = function() {
4662
+ console.table(this);
4663
+ };
4664
+ Array.table = function(a) {
4665
+ a.table();
4666
+ return;
4667
+ };
4668
+ _protected_code_(Array.table);
4669
+ _protected_code_(Array.prototype.table);
4670
+ Array.prototype.sum = function() {
4671
+ return this.reduce(function(prev, current) {
4672
+ return __to_number(prev) + __to_number(current);
4673
+ }, 0);
4674
+ };
4675
+ Array.sum = function(a) {
4676
+ return a.sum();
4677
+ };
4678
+ _protected_code_(Array.sum);
4679
+ _protected_code_(Array.prototype.sum);
4680
+ Array.prototype.avg = function() {
4681
+ return this.length < 1 ? 0 : this.reduce(function(prev, current) {
4682
+ return (__to_number(prev) + __to_number(current)) / 2;
4683
+ });
4684
+ };
4685
+ Array.avg = function(a) {
4686
+ return a.avg();
4687
+ };
4688
+ _protected_code_(Array.avg);
4689
+ _protected_code_(Array.prototype.avg);
4690
+ Array.prototype.min = function() {
4691
+ return this.reduce(function(prev, current) {
4692
+ return __to_number(prev) <= __to_number(current) ? prev : current;
4693
+ }, Infinity);
4694
+ };
4695
+ Array.min = function(a) {
4696
+ return a.min();
4697
+ };
4698
+ _protected_code_(Array.min);
4699
+ _protected_code_(Array.prototype.min);
4700
+ Array.prototype.max = function() {
4701
+ return this.reduce(function(prev, current) {
4702
+ return __to_number(prev) >= __to_number(current) ? prev : current;
4703
+ }, 0);
4704
+ };
4705
+ Array.max = function(a) {
4706
+ return a.max();
4707
+ };
4708
+ _protected_code_(Array.max);
4709
+ _protected_code_(Array.prototype.max);
4710
+ Array.prototype.sortBy = function(propName, sortAsc = true) {
4711
+ const sort_function = sortAsc ? function(prev, current) {
4712
+ return current[propName] < prev[propName] ? 1 : -1;
4713
+ } : function(prev, current) {
4714
+ return current[propName] > prev[propName] ? 1 : -1;
4715
+ };
4716
+ return this.sort(sort_function);
4717
+ };
4718
+ Array.sortBy = function(a, propName, sortAsc = true) {
4719
+ return a.sortBy(propName, sortAsc);
4720
+ };
4721
+ _protected_code_(Array.sortBy);
4722
+ _protected_code_(Array.prototype.sortBy);
4723
+ Array.prototype.matrix = function(_length, _fillValue = 0) {
4724
+ const x_func = /* @__PURE__ */ __name(function(x = void 0) {
4725
+ return _fillValue;
4726
+ }, "x_func");
4727
+ return Array.from({
4728
+ length: _length
4729
+ }, x_func);
4730
+ };
4731
+ Array.matrix = function(a, _length, _fillValue = 0) {
4732
+ return a.matrix(_length, _fillValue);
4733
+ };
4734
+ _protected_code_(Array.matrix);
4735
+ _protected_code_(Array.prototype.matrix);
4736
+ Array.prototype.matrix2d = function(_length, _fillValue = 0) {
4737
+ const y_func = /* @__PURE__ */ __name(function(y) {
4738
+ return _fillValue;
4739
+ }, "y_func");
4740
+ const x_func = /* @__PURE__ */ __name(function(x) {
4741
+ return Array.from({
4742
+ length: _length
4743
+ }, y_func);
4744
+ }, "x_func");
4745
+ return Array.from({
4746
+ length: _length
4747
+ }, x_func);
4748
+ };
4749
+ Array.matrix2d = function(a, _length, _fillValue = 0) {
4750
+ return a.matrix2d(_length, _fillValue);
4751
+ };
4752
+ _protected_code_(Array.matrix2d);
4753
+ _protected_code_(Array.prototype.matrix2d);
4754
+ Array.prototype.matrix3d = function(_length, _fillValue = 0) {
4755
+ const y_func = /* @__PURE__ */ __name(function(y) {
4756
+ return Array.from({
4757
+ length: _length
4758
+ }, function() {
4759
+ return _fillValue;
4760
+ });
4761
+ }, "y_func");
4762
+ const x_func = /* @__PURE__ */ __name(function(x) {
4763
+ return Array.from({
4764
+ length: _length
4765
+ }, y_func);
4766
+ }, "x_func");
4767
+ return Array.from({
4768
+ length: _length
4769
+ }, x_func);
4770
+ };
4771
+ Array.matrix3d = function(a, _length, _fillValue = 0) {
4772
+ return a.matrix3d(_length, _fillValue);
4773
+ };
4774
+ _protected_code_(Array.matrix3d);
4775
+ _protected_code_(Array.prototype.matrix3d);
4776
+ String.prototype.list = function() {
4777
+ const __instance = this;
4778
+ return _top2.range(0, __instance.length - 1).map(function(i) {
4779
+ return __instance[i];
4780
+ });
4781
+ };
4782
+ _protected_code_(String.prototype.list);
4783
+ setDefaultProcessors();
4784
+ Ready(function() {
4785
+ if (!CONFIG.get("useSDK")) {
4786
+ GlobalSettings.__start__().catch((e) => {
4787
+ throw Error(e);
4788
+ });
5686
4789
  }
5687
- }, "thread"));
5688
- }
5689
- };
5690
- Package("com.qcobjects.timing", [
5691
- Timer
5692
- ]);
5693
- }
5694
- });
5695
-
5696
- // src/DDO.ts
5697
- var DDO;
5698
- var init_DDO = __esm({
5699
- "src/DDO.ts"() {
5700
- "use strict";
5701
- init_Export();
5702
- init_InheritClass();
5703
- init_Logger();
5704
- init_ObjectName();
5705
- DDO = class extends InheritClass {
5706
- static {
5707
- __name(this, "DDO");
5708
- }
5709
- constructor({
5710
- instance,
5711
- name,
5712
- fget,
5713
- fset,
5714
- value
5715
- }) {
5716
- super({
5717
- instance,
5718
- name,
5719
- fget,
5720
- fset,
5721
- value
5722
4790
  });
5723
- this._new_({
5724
- instance,
5725
- name,
5726
- fget,
5727
- fset,
5728
- value
5729
- });
5730
- }
5731
- _new_({
5732
- instance,
5733
- name,
5734
- fget,
5735
- fset
5736
- }) {
5737
- const ddoInstance = this;
5738
- var name = typeof name === "undefined" ? ObjectName(ddoInstance) : name;
5739
- Object.defineProperty(instance, name, {
5740
- set(val) {
5741
- const _value = val;
5742
- logger.debug("value changed " + name);
5743
- let ret;
5744
- if (typeof fset !== "undefined" && typeof fset === "function") {
5745
- ret = fset(_value);
5746
- } else {
5747
- ret = _value;
4791
+ Export(Export);
4792
+ Export(Import);
4793
+ Export(Package);
4794
+ Export(Class);
4795
+ Export(New);
4796
+ Export(Tag);
4797
+ Export(Ready);
4798
+ Export(ready);
4799
+ Export(isBrowser);
4800
+ Export(_methods_);
4801
+ Export(GlobalSettings);
4802
+ resetTop();
4803
+ (function(_top3) {
4804
+ Object.defineProperty(_top3, "PackagesNameList", {
4805
+ // eslint-disable-next-line no-unused-vars
4806
+ set(val) {
4807
+ logger.debug("PackagesNameList is readonly");
4808
+ },
4809
+ get() {
4810
+ const _get_packages_names = /* @__PURE__ */ __name(function(_packages) {
4811
+ let _keys = [];
4812
+ for (const _k of Object.keys(_packages)) {
4813
+ if (typeof _packages[_k] !== "undefined" && typeof _packages[_k] !== "function" && Object.hasOwn(_packages[_k], "length") && _packages[_k].length > 0) {
4814
+ _keys.push(_k);
4815
+ _keys = _keys.concat(_get_packages_names(_packages[_k]));
4816
+ }
4817
+ }
4818
+ return _keys;
4819
+ }, "_get_packages_names");
4820
+ return _get_packages_names(_QC_PACKAGES);
5748
4821
  }
5749
- instance["_" + name] = ret;
5750
- },
5751
- get() {
5752
- const _value = instance["_" + name];
5753
- logger.debug("returning value " + name);
5754
- const is_ddo = /* @__PURE__ */ __name((v) => {
5755
- if (typeof v === "object" && Object.hasOwn(v, "value")) {
5756
- return v.value;
5757
- }
5758
- return v;
5759
- }, "is_ddo");
5760
- let ret;
5761
- if (typeof fget !== "undefined" && typeof fget === "function") {
5762
- ret = fget(is_ddo(_value));
5763
- } else {
5764
- ret = is_ddo(_value);
4822
+ });
4823
+ Object.defineProperty(_top3, "PackagesList", {
4824
+ // eslint-disable-next-line no-unused-vars
4825
+ set(value) {
4826
+ logger.debug("PackagesList is readonly");
4827
+ },
4828
+ get() {
4829
+ return _top3.PackagesNameList.map(function(packagename) {
4830
+ const _classesList = Package(packagename);
4831
+ let _ret_ = void 0;
4832
+ if (_classesList) {
4833
+ _ret_ = {
4834
+ packageName: packagename,
4835
+ classesList: _classesList.filter(function(_packageClass) {
4836
+ return isQCObjects_Class(_packageClass);
4837
+ })
4838
+ };
4839
+ }
4840
+ return _ret_;
4841
+ }).filter(function(_p) {
4842
+ return typeof _p !== "undefined";
4843
+ });
5765
4844
  }
5766
- return ret;
4845
+ });
4846
+ Object.defineProperty(_top3, "ClassesList", {
4847
+ // eslint-disable-next-line no-unused-vars
4848
+ set(value) {
4849
+ logger.debug("ClassesList is readonly");
4850
+ },
4851
+ get() {
4852
+ let _classesList = [];
4853
+ _top3.PackagesList.map(function(_package_element) {
4854
+ _classesList = _classesList.concat(_package_element.classesList.map(
4855
+ function(_class_element) {
4856
+ return {
4857
+ packageName: _package_element.packageName,
4858
+ className: _package_element.packageName + "." + _class_element.__definition.__classType,
4859
+ classFactory: _class_element
4860
+ };
4861
+ }
4862
+ ));
4863
+ return _package_element;
4864
+ });
4865
+ return _classesList;
4866
+ }
4867
+ });
4868
+ Object.defineProperty(_top3, "ClassesNameList", {
4869
+ // eslint-disable-next-line no-unused-vars
4870
+ set(value) {
4871
+ logger.debug("ClassesNameList is readonly");
4872
+ },
4873
+ get() {
4874
+ return _top3.ClassesList.map(function(_class_element) {
4875
+ return _class_element.className;
4876
+ });
4877
+ }
4878
+ });
4879
+ if (isBrowser) {
4880
+ Class("GLOBAL", _QC_CLASSES.global);
4881
+ Export(ClassFactory("GLOBAL"));
5767
4882
  }
5768
- });
4883
+ Export(global2);
4884
+ loadSDK_default();
4885
+ })(_top2);
4886
+ if (isBrowser) {
4887
+ asyncLoad(function() {
4888
+ Ready(function() {
4889
+ (function(_top3) {
4890
+ let ticking = false;
4891
+ const scrollHeight = Math.max(
4892
+ document.body.scrollHeight,
4893
+ document.documentElement.scrollHeight,
4894
+ document.body.offsetHeight,
4895
+ document.documentElement.offsetHeight,
4896
+ document.body.clientHeight,
4897
+ document.documentElement.clientHeight
4898
+ );
4899
+ const scrollWidth = Math.max(
4900
+ document.body.scrollWidth,
4901
+ document.documentElement.scrollWidth,
4902
+ document.body.offsetWidth,
4903
+ document.documentElement.offsetWidth,
4904
+ document.body.clientWidth,
4905
+ document.documentElement.clientWidth
4906
+ );
4907
+ function scrollDispatcher(event) {
4908
+ const percentY = Math.round(_top3.scrollY * 100 / scrollHeight);
4909
+ const percentX = Math.round(_top3.scrollX * 100 / scrollWidth);
4910
+ const scrollPercentEventEvent = new CustomEvent("scrollpercent", {
4911
+ detail: {
4912
+ percentX,
4913
+ percentY
4914
+ }
4915
+ });
4916
+ event.target.dispatchEvent(scrollPercentEventEvent);
4917
+ let secondaryEventName = "defaultscroll";
4918
+ const __valid_scrolls__ = [0, 5, 10, 25, 50, 75, 90, 95, 100];
4919
+ __valid_scrolls__.filter(function(p) {
4920
+ return p === percentY;
4921
+ }).map(function(pY) {
4922
+ secondaryEventName = "percentY" + percentY.toString();
4923
+ const secondaryCustomEvent = new CustomEvent(secondaryEventName, {
4924
+ detail: {
4925
+ percentX,
4926
+ percentY
4927
+ }
4928
+ });
4929
+ event.target.dispatchEvent(secondaryCustomEvent);
4930
+ return pY;
4931
+ });
4932
+ }
4933
+ __name(scrollDispatcher, "scrollDispatcher");
4934
+ document.addEventListener("scroll", function(event) {
4935
+ if (!ticking) {
4936
+ requestAnimationFrame(function() {
4937
+ scrollDispatcher(event);
4938
+ ticking = false;
4939
+ });
4940
+ ticking = true;
4941
+ }
4942
+ });
4943
+ })(_top2);
4944
+ });
4945
+ }, []);
4946
+ }
4947
+ if (!isBrowser) {
4948
+ if (typeof _top2.global !== "undefined" && Object.hasOwn(_top2.global, "_fireAsyncLoad")) {
4949
+ _fireAsyncLoad.call(_top2);
4950
+ }
4951
+ if (typeof _top2.global !== "undefined" && Object.hasOwn(_top2.global, "onload")) {
4952
+ _top2.global.onload.call(_top2);
4953
+ }
4954
+ }
4955
+ (function(isBrowser2) {
4956
+ const __freeze__ = /* @__PURE__ */ __name(function() {
4957
+ Object.freeze(Object.prototype);
4958
+ Object.freeze(Object);
4959
+ }, "__freeze__");
4960
+ if (isBrowser2 && CONFIG.get("secureObjects", false)) {
4961
+ Ready(function() {
4962
+ __freeze__();
4963
+ });
4964
+ } else if (CONFIG.get("secureObjects", false)) {
4965
+ __freeze__();
4966
+ }
4967
+ })(isBrowser);
5769
4968
  }
5770
- };
5771
- Export(DDO);
4969
+ }, "__qcobjects__"))(_top);
5772
4970
  }
5773
4971
  });
5774
4972
 
5775
- // src/Toggle.ts
5776
- var Toggle;
5777
- var init_Toggle = __esm({
5778
- "src/Toggle.ts"() {
5779
- "use strict";
5780
- init_InheritClass();
5781
- init_Logger();
5782
- init_Package();
5783
- Toggle = class extends InheritClass {
5784
- static {
5785
- __name(this, "Toggle");
5786
- }
5787
- _toggle = false;
5788
- _inverse = true;
5789
- _positive = null;
5790
- _negative = null;
5791
- _dispatched = null;
5792
- _args = {};
5793
- constructor(positive, negative, args) {
5794
- super({ positive, negative, args });
5795
- this._new_({ positive, negative, args });
5796
- }
5797
- changeToggle() {
5798
- this._toggle = !this._toggle;
5799
- }
5800
- _new_({
5801
- positive,
5802
- negative,
5803
- args
5804
- }) {
5805
- this._positive = positive;
5806
- this._negative = negative;
5807
- this._args = args;
4973
+ // src/QCObjects.ts
4974
+ var AssignPolyfill = __toESM(require_assign());
4975
+ init_top();
4976
+ init_PrimaryCollections();
4977
+ init_DataStringify();
4978
+ init_DOMCreateElement();
4979
+ init_introspection();
4980
+ init_Logger();
4981
+ init_platform();
4982
+ init_subelements();
4983
+ init_is_raw_class();
4984
+ init_LegacyCopy();
4985
+ init_asyncLoad();
4986
+ init_IncrementInstanceID();
4987
+ init_ObjectName();
4988
+ init_getType();
4989
+ init_is_a();
4990
+ init_ComplexStorageCache();
4991
+ init_waitUntil();
4992
+ init_Cast();
4993
+ init_isQCObjects();
4994
+ init_Package();
4995
+ init_ClassFactory();
4996
+ init_Export();
4997
+ init_Class();
4998
+ init_InheritClass();
4999
+ init_super();
5000
+ init_shortCode();
5001
+ init_Processor();
5002
+ init_New();
5003
+ init_Ready();
5004
+ init_captureFalseTouch();
5005
+ init_serviceLoader();
5006
+ init_componentLoader();
5007
+ init_ComponentFactory();
5008
+ init_NamespaceRef();
5009
+ init_defaultProcessors();
5010
+ init_Tag();
5011
+ init_Import();
5012
+
5013
+ // src/BackendMicroservice.ts
5014
+ init_basePath();
5015
+ init_DataStringify();
5016
+ init_domain();
5017
+ init_InheritClass();
5018
+ init_Logger();
5019
+ init_Package();
5020
+ var BackendMicroservice = class extends InheritClass {
5021
+ static {
5022
+ __name(this, "BackendMicroservice");
5023
+ }
5024
+ stream;
5025
+ route;
5026
+ headers;
5027
+ request;
5028
+ constructor({
5029
+ domain = _domain_,
5030
+ basePath = _basePath_,
5031
+ body = null,
5032
+ stream = null,
5033
+ request = null
5034
+ }) {
5035
+ super({
5036
+ domain,
5037
+ basePath,
5038
+ body,
5039
+ stream,
5040
+ request
5041
+ });
5042
+ logger.debug("Initializing BackendMicroservice...");
5043
+ const microservice = this;
5044
+ if (typeof this.body === "undefined") {
5045
+ this.body = null;
5046
+ }
5047
+ if (typeof body !== "undefined") {
5048
+ this.body = body;
5049
+ }
5050
+ this.cors();
5051
+ microservice.stream = stream;
5052
+ stream?.on("data", (data) => {
5053
+ const requestMethod2 = request?.method.toLowerCase();
5054
+ const supportedMethods2 = {
5055
+ "post": microservice.post.bind(microservice)
5056
+ };
5057
+ if (Object.hasOwn(supportedMethods2, requestMethod2)) {
5058
+ supportedMethods2[requestMethod2].call(microservice, data);
5808
5059
  }
5809
- fire() {
5810
- const toggle = this;
5811
- var _promise = new Promise(function(resolve, reject) {
5812
- if (typeof toggle._positive === "function" && typeof toggle._negative === "function") {
5813
- if (toggle._inverse) {
5814
- toggle._dispatched = toggle._toggle ? toggle._negative.bind(toggle) : toggle._positive.bind(toggle);
5815
- } else {
5816
- toggle._dispatched = toggle._toggle ? toggle._positive.bind(toggle) : toggle._negative.bind(toggle);
5817
- }
5818
- toggle._dispatched?.call(toggle, toggle._args);
5819
- resolve.call(_promise, toggle);
5820
- } else {
5821
- logger.debug("Toggle functions are not declared");
5822
- reject.call(_promise, toggle);
5060
+ });
5061
+ const requestMethod = request?.method.toLowerCase();
5062
+ const supportedMethods = {
5063
+ "get": microservice.get.bind(microservice),
5064
+ "head": microservice.head.bind(microservice),
5065
+ "put": microservice.put.bind(microservice),
5066
+ "delete": microservice.delete.bind(microservice),
5067
+ "connect": microservice.connect.bind(microservice),
5068
+ "options": microservice.options.bind(microservice),
5069
+ "trace": microservice.trace.bind(microservice),
5070
+ "patch": microservice.patch.bind(microservice)
5071
+ };
5072
+ if (Object.hasOwn(supportedMethods, requestMethod)) {
5073
+ supportedMethods[requestMethod].call(microservice);
5074
+ }
5075
+ }
5076
+ cors() {
5077
+ if (this.route.cors) {
5078
+ logger.debug("Validating CORS...");
5079
+ const {
5080
+ allow_origins,
5081
+ allow_credentials,
5082
+ allow_methods,
5083
+ allow_headers
5084
+ } = this.route.cors;
5085
+ const microservice = this;
5086
+ if (typeof microservice.headers !== "object") {
5087
+ microservice.headers = {};
5088
+ }
5089
+ if (typeof microservice.route.responseHeaders !== "object") {
5090
+ microservice.route.responseHeaders = {};
5091
+ }
5092
+ if (typeof allow_origins !== "undefined") {
5093
+ logger.debug("CORS: allow_origins available. Validating origins...");
5094
+ if (allow_origins === "*" || typeof microservice.request.headers.origin === "undefined" || [...allow_origins].indexOf(microservice.request.headers.origin) !== -1) {
5095
+ logger.debug("CORS: Adding header Access-Control-Allow-Origin=*");
5096
+ microservice.route.responseHeaders["Access-Control-Allow-Origin"] = "*";
5097
+ } else {
5098
+ logger.debug("CORS: Origin is not allowed: " + microservice.request.headers.origin);
5099
+ logger.debug("CORS: Forcing to finish the response...");
5100
+ this.body = {};
5101
+ try {
5102
+ this.done();
5103
+ } catch (e) {
5104
+ logger.debug(`It was not possible to finish the call to the microservice: ${e}`);
5823
5105
  }
5824
- return toggle;
5825
- }).then(function(toggle2) {
5826
- toggle2.changeToggle();
5827
- return toggle2;
5828
- }).catch(function(e) {
5829
- logger.debug(e.toString());
5830
- return toggle;
5831
- }).finally(() => {
5832
- return toggle;
5833
- });
5834
- return _promise;
5106
+ }
5107
+ } else {
5108
+ logger.debug("CORS: no allow_origins available. Allowing all origins...");
5109
+ logger.debug("CORS: Adding header Access-Control-Allow-Origin=*");
5110
+ microservice.route.responseHeaders["Access-Control-Allow-Origin"] = "*";
5835
5111
  }
5836
- };
5837
- Package("com.qcobjects.tools.essentials", [
5838
- Toggle
5839
- ]);
5112
+ if (typeof allow_credentials !== "undefined") {
5113
+ logger.debug(`CORS: allow_credentials present. Allowing ${allow_credentials}...`);
5114
+ microservice.route.responseHeaders["Access-Control-Allow-Credentials"] = allow_credentials.toString();
5115
+ } else {
5116
+ logger.debug("CORS: No allow_credentials present. Allowing all credentials.");
5117
+ microservice.route.responseHeaders["Access-Control-Allow-Credentials"] = "true";
5118
+ }
5119
+ if (typeof allow_methods !== "undefined") {
5120
+ logger.debug(`CORS: allow_methods present. Allowing ${allow_methods}...`);
5121
+ microservice.route.responseHeaders["Access-Control-Allow-Methods"] = [...allow_methods].join(",");
5122
+ } else {
5123
+ logger.debug("CORS: No allow_methods present. Allowing only GET, OPTIONS and POST");
5124
+ microservice.route.responseHeaders["Access-Control-Allow-Methods"] = "GET, OPTIONS, POST";
5125
+ }
5126
+ if (typeof allow_headers !== "undefined") {
5127
+ logger.debug(`CORS: allow_headers present. Allowing ${allow_headers}...`);
5128
+ microservice.route.responseHeaders["Access-Control-Allow-Headers"] = [...allow_headers].join(",");
5129
+ } else {
5130
+ logger.debug("CORS: No allow_headers present. Allowing all headers...");
5131
+ microservice.route.responseHeaders["Access-Control-Allow-Headers"] = "*";
5132
+ }
5133
+ } else {
5134
+ logger.debug("No CORS validation available. You can specify cors in CONFIG.backend.routes[].cors");
5135
+ }
5840
5136
  }
5841
- });
5842
-
5843
- // src/DocumentLayout.ts
5844
- var getDocumentLayout;
5845
- var init_DocumentLayout = __esm({
5846
- "src/DocumentLayout.ts"() {
5847
- "use strict";
5848
- getDocumentLayout = /* @__PURE__ */ __name(function() {
5849
- const h = /* @__PURE__ */ __name((w, h2) => {
5850
- return w > h2 ? "landscape" : null;
5851
- }, "h");
5852
- const v = /* @__PURE__ */ __name((w, h2) => {
5853
- return h2 > w ? "portrait" : null;
5854
- }, "v");
5855
- const square = /* @__PURE__ */ __name((w, h2) => {
5856
- return w === h2 ? "square" : null;
5857
- }, "square");
5858
- return [
5859
- h(document.documentElement.clientWidth, document.documentElement.clientHeight),
5860
- v(document.documentElement.clientWidth, document.documentElement.clientHeight),
5861
- square(document.documentElement.clientWidth, document.documentElement.clientHeight)
5862
- ].filter((e) => e !== null).pop();
5863
- }, "getDocumentLayout");
5137
+ head(formData) {
5138
+ logger.debug(`[BackendMicroservice.head] Data received: ${_DataStringify(formData)}`);
5139
+ this.done();
5864
5140
  }
5865
- });
5866
-
5867
- // src/types/global/index.d.ts
5868
- var init_index_d = __esm({
5869
- "src/types/global/index.d.ts"() {
5870
- "use strict";
5141
+ get(formData) {
5142
+ logger.debug(`[BackendMicroservice.get] Data received: ${_DataStringify(formData)}`);
5143
+ this.done();
5871
5144
  }
5872
- });
5873
-
5874
- // src/loadSDK.ts
5875
- function loadSDK() {
5876
- if (CONFIG.get("useSDK")) {
5877
- (function() {
5878
- const remoteImportsPath = CONFIG.get("remoteImportsPath");
5879
- const external = !CONFIG.get("useLocalSDK");
5880
- CONFIG.set("remoteImportsPath", CONFIG.get("remoteSDKPath"));
5881
- let tryImportingSDK = false;
5882
- let sdkName = "QCObjects-SDK";
5883
- if (isBrowser) {
5884
- tryImportingSDK = true;
5145
+ post(formData) {
5146
+ logger.debug(`[BackendMicroservice.post] Data received: ${_DataStringify(formData)}`);
5147
+ this.done();
5148
+ }
5149
+ put(formData) {
5150
+ logger.debug(`[BackendMicroservice.put] Data received: ${_DataStringify(formData)}`);
5151
+ this.done();
5152
+ }
5153
+ delete(formData) {
5154
+ logger.debug(`[BackendMicroservice.delete] Data received: ${_DataStringify(formData)}`);
5155
+ this.done();
5156
+ }
5157
+ connect(formData) {
5158
+ logger.debug(`[BackendMicroservice.connect] Data received: ${_DataStringify(formData)}`);
5159
+ this.done();
5160
+ }
5161
+ options(formData) {
5162
+ logger.debug(`[BackendMicroservice.options] Data received: ${_DataStringify(formData)}`);
5163
+ this.done();
5164
+ }
5165
+ trace(formData) {
5166
+ logger.debug(`[BackendMicroservice.trace] Data received: ${_DataStringify(formData)}`);
5167
+ this.done();
5168
+ }
5169
+ patch(formData) {
5170
+ logger.debug(`[BackendMicroservice.patch] Data received: ${_DataStringify(formData)}`);
5171
+ this.done();
5172
+ }
5173
+ finishWithBody(stream) {
5174
+ try {
5175
+ logger.debug("[BackendMicroservice.finishWithBody] Ending the stream...");
5176
+ logger.debug(`[BackendMicroservice.finishWithBody] type of body is: ${typeof this.body}`);
5177
+ if (typeof this.body !== "string") {
5178
+ this.body = _DataStringify(this.body);
5179
+ }
5180
+ logger.debug(`[BackendMicroservice.finishWithBody]
5181
+ body: ${this.body} `);
5182
+ stream?.write(this.body);
5183
+ stream?.end();
5184
+ logger.debug("[BackendMicroservice.finishWithBody] Stream ended.");
5185
+ } catch (e) {
5186
+ logger.debug(`[BackendMicroservice.finishWithBody] Something went wrong ending the stream: ${e}`);
5187
+ }
5188
+ }
5189
+ done() {
5190
+ logger.debug("[BackendMicroservice.done] Finalizing the response...");
5191
+ const microservice = this;
5192
+ const stream = microservice.stream;
5193
+ try {
5194
+ logger.debug("[BackendMicroservice.done] Sending response headers...");
5195
+ if (microservice.route.responseHeaders) {
5196
+ logger.debug(`[BackendMicroservice.done] Response headers present: ${Object.keys(microservice.route.responseHeaders).join(",")}`);
5197
+ stream.respond(microservice.route.responseHeaders);
5885
5198
  } else {
5886
- const sdkPath = findPackageNodePath("qcobjects-sdk");
5887
- if (sdkPath !== null) {
5888
- sdkName = "qcobjects-sdk";
5889
- tryImportingSDK = true;
5890
- } else if (sdkPath !== "") {
5891
- sdkName = "node_modules/qcobjects-sdk/QCObjects-SDK";
5892
- tryImportingSDK = true;
5893
- } else {
5894
- tryImportingSDK = false;
5895
- }
5199
+ throw Error("[BackendMicroservice.done] No headers present.");
5896
5200
  }
5897
- if (tryImportingSDK) {
5898
- logger.info("Importing SDK... " + sdkName);
5899
- if (isNodeCommonJS && typeof require !== "undefined") {
5900
- const sdk = _require_("qcobjects-sdk");
5901
- if (sdk) {
5902
- logger.debug("QCObjects SDK was loaded OK.");
5903
- } else {
5904
- logger.debug("QCObjects SDK could not be imported.");
5905
- }
5906
- } else {
5907
- Import(sdkName, function() {
5908
- if (external) {
5909
- logger.debug("QCObjects-SDK.js loaded from remote location");
5910
- } else {
5911
- logger.debug("QCObjects-SDK.js loaded from local");
5912
- }
5913
- CONFIG.set("remoteImportsPath", remoteImportsPath);
5914
- }, external)?.catch((e) => {
5915
- throw new Error(`An error ocurred when trying to import: ${e}`);
5916
- });
5917
- }
5918
- } else {
5919
- logger.debug("SDK has not been imported as it is not available at the moment");
5201
+ } catch (e) {
5202
+ logger.debug(`[BackendMicroservice.done] Something went wrong sending response headers: ${e}`);
5203
+ }
5204
+ if (microservice.body !== null) {
5205
+ try {
5206
+ logger.debug("[BackendMicroservice.done] A body of message is present. Finalizing the response...");
5207
+ microservice.finishWithBody.call(microservice, stream);
5208
+ } catch (e) {
5209
+ logger.debug(`[BackendMicroservice.done] Something went wrong finalizing the response: ${e}`);
5920
5210
  }
5921
- })();
5922
- }
5923
- }
5924
- var loadSDK_default;
5925
- var init_loadSDK = __esm({
5926
- "src/loadSDK.ts"() {
5927
- "use strict";
5928
- init_CONFIG();
5929
- init_findPackageNodePath();
5930
- init_Import();
5931
- init_Logger();
5932
- init_platform();
5933
- __name(loadSDK, "loadSDK");
5934
- loadSDK_default = loadSDK;
5211
+ } else {
5212
+ logger.debug("[BackendMicroservice.done] No body present. Ending stream...");
5213
+ stream.end();
5214
+ }
5935
5215
  }
5936
- });
5216
+ };
5217
+ Package("com.qcobjects.api", [
5218
+ BackendMicroservice
5219
+ ]);
5937
5220
 
5938
- // src/MainProcess.ts
5939
- var require_MainProcess = __commonJS({
5940
- "src/MainProcess.ts"() {
5941
- "use strict";
5942
- init_asyncLoad();
5943
- init_captureFalseTouch();
5944
- init_Cast();
5945
- init_Class();
5946
- init_ClassFactory();
5947
- init_Component();
5948
- init_ComponentFactory();
5949
- init_componentLoader();
5950
- init_CONFIG();
5951
- init_DataStringify();
5952
- init_defaultProcessors();
5953
- init_Export();
5954
- init_Import();
5955
- init_introspection();
5956
- init_isQCObjects();
5957
- init_Logger();
5958
- init_mathFunctions();
5959
- init_NamespaceRef();
5960
- init_New();
5961
- init_ObjectName();
5962
- init_Package();
5963
- init_platform();
5964
- init_PrimaryCollections();
5965
- init_Ready();
5966
- init_serviceLoader();
5967
- init_Tag();
5968
- init_top();
5969
- init_Processor();
5970
- init_is_a();
5971
- init_getType();
5972
- init_shortCode();
5973
- init_DOMCreateElement();
5974
- init_ComplexStorageCache();
5975
- init_super();
5976
- init_waitUntil();
5977
- init_subelements();
5978
- init_globalSettings();
5979
- init_loadSDK();
5980
- (/* @__PURE__ */ __name(function __qcobjects__(_top2) {
5981
- if (typeof Object.defineProperty !== "undefined" && typeof _top2 !== "undefined") {
5982
- try {
5983
- Object.defineProperty(_top2, "__qcobjects__", {
5984
- enumerable: true,
5985
- configurable: false,
5986
- writable: false,
5987
- value: __qcobjects__
5988
- });
5989
- } catch (e) {
5990
- logger.debug(`An error ocurred: ${e}`);
5991
- if (typeof _top2.__qcobjects__ !== "undefined") {
5992
- _top2.__qcobjects__.loaded = true;
5993
- }
5994
- }
5995
- }
5996
- if (typeof _top2.__qcobjects__.loaded === "undefined") {
5997
- _top2.__qcobjects__.loaded = true;
5998
- const global2 = _top2;
5999
- _top2.global = global2;
6000
- if (isBrowser) {
6001
- Element.prototype.subelements = subelements;
6002
- Document.prototype.subelements = subelements;
6003
- HTMLElement.prototype.subelements = subelements;
6004
- if (typeof ShadowRoot !== "undefined") {
6005
- ShadowRoot.prototype.subelements = subelements;
5221
+ // src/QCObjects.ts
5222
+ init_Component();
5223
+ init_Crypt();
5224
+
5225
+ // src/DefaultTemplateHandler.ts
5226
+ init_Logger();
5227
+ init_Processor();
5228
+ init_RegisterClass();
5229
+ var DefaultTemplateHandler = class {
5230
+ static {
5231
+ __name(this, "DefaultTemplateHandler");
5232
+ }
5233
+ template = "";
5234
+ __definition = {};
5235
+ static __definition = {};
5236
+ component;
5237
+ constructor({ component, template }) {
5238
+ this.component = component;
5239
+ this.template = template;
5240
+ }
5241
+ assign(data) {
5242
+ const templateInstance = this;
5243
+ if (typeof templateInstance.component === "undefined") {
5244
+ throw new Error("DefaultTemplateHandler.assign: component is undefined");
5245
+ }
5246
+ if (typeof templateInstance.component.processorHandler === "undefined") {
5247
+ throw new Error("DefaultTemplateHandler.assign: component.processorHandler is undefined");
5248
+ }
5249
+ const processorHandler = templateInstance.component.processorHandler;
5250
+ processorHandler.component = templateInstance.component;
5251
+ let parsedAssignmentText = typeof templateInstance.template !== "undefined" ? templateInstance.template : "";
5252
+ if (typeof data === "object") {
5253
+ [...Object.keys(data)].map((k) => {
5254
+ let _value = data[k];
5255
+ if (typeof _value === "string" || typeof _value === "number" || !isNaN(_value)) {
5256
+ try {
5257
+ _value = GlobalProcessor.processObject.bind(processorHandler).call(processorHandler, _value, templateInstance.component);
5258
+ parsedAssignmentText = parsedAssignmentText.replace(new RegExp(`{{${k}}}`, "g"), _value);
5259
+ } catch (e) {
5260
+ logger.warn(`${templateInstance.component.name} could not parse processors.`);
5261
+ throw Error(`${templateInstance.component.name} could not parse processors. Reason: ${e.message}`);
6006
5262
  }
6007
5263
  }
6008
- logger.debugEnabled = false;
6009
- logger.infoEnabled = true;
6010
- _top2.logger = logger;
6011
- if (isBrowser) {
6012
- Element.prototype.find = function(tag) {
6013
- const _self = this;
6014
- const _oo = [];
6015
- const _tags = document.subelements(tag);
6016
- _tags.map((_tt, _t) => {
6017
- if (typeof _tags[_t] !== "undefined" && _tags[_t].parentNode.tagName === _self.parentNode.tagName) {
6018
- _oo.push(_Cast(_tt, new Object()));
6019
- }
6020
- return _tt;
6021
- });
6022
- return _oo;
6023
- };
6024
- }
6025
- if (isBrowser) {
6026
- Element.prototype.append = /* @__PURE__ */ __name(function QC_Append(child) {
6027
- if (isQCObjects_Object(child) || typeof child.body !== "undefined") {
6028
- this.appendChild(child.body);
6029
- } else {
6030
- this.appendChild(child);
5264
+ return k;
5265
+ });
5266
+ } else {
5267
+ logger.debug(`${templateInstance.component.name}.data is not an object`);
5268
+ }
5269
+ try {
5270
+ parsedAssignmentText = GlobalProcessor.processObject.call(processorHandler, parsedAssignmentText, templateInstance.component);
5271
+ } catch (e) {
5272
+ logger.warn(`${templateInstance.component.name} could not parse processors.`);
5273
+ throw Error(`${templateInstance.component.name} could not parse processors. Reason: ${e.message}`);
5274
+ }
5275
+ return parsedAssignmentText;
5276
+ }
5277
+ };
5278
+ RegisterClass(DefaultTemplateHandler, "com.qcobjects");
5279
+
5280
+ // src/SourceJS.ts
5281
+ init_basePath();
5282
+ init_Cast();
5283
+ init_domain();
5284
+ init_DOMCreateElement();
5285
+ init_InheritClass();
5286
+ init_Package();
5287
+ init_Logger();
5288
+ var SourceJS = class extends InheritClass {
5289
+ static {
5290
+ __name(this, "SourceJS");
5291
+ }
5292
+ domain = _domain_;
5293
+ basePath = _basePath_;
5294
+ type = "text/javascript";
5295
+ containerTag = "body";
5296
+ url = "";
5297
+ data = {};
5298
+ async = false;
5299
+ external = false;
5300
+ constructor(o) {
5301
+ super(o);
5302
+ this.body = _DOMCreateElement("script");
5303
+ }
5304
+ set(name, value) {
5305
+ this[name] = value;
5306
+ }
5307
+ get(name, _default) {
5308
+ return this[name] || _default;
5309
+ }
5310
+ status = false;
5311
+ done() {
5312
+ }
5313
+ fail() {
5314
+ }
5315
+ rebuild() {
5316
+ const context = this;
5317
+ try {
5318
+ document.getElementsByTagName(context.containerTag)[0].appendChild(
5319
+ function(s, url, context2) {
5320
+ s.type = context2.type;
5321
+ s.src = url;
5322
+ s.crossOrigin = Object.hasOwn(context2, "crossOrigin") ? context2.crossOrigin : "anonymous";
5323
+ s.async = context2.async;
5324
+ s.onreadystatechange = function() {
5325
+ if (this.readyState === "complete") {
5326
+ context2.done.call(context2);
6031
5327
  }
6032
- }, "QC_Append");
6033
- Element.prototype.render = /* @__PURE__ */ __name(function QC_Render(content) {
6034
- const _self = this;
6035
- const _appendVDOM = /* @__PURE__ */ __name((_self2, content2) => {
6036
- if (typeof document.implementation.createHTMLDocument !== "undefined") {
6037
- const doc = document.implementation.createHTMLDocument("");
6038
- doc.body.innerHTML = content2;
6039
- doc.body.subelements("*").map((element) => {
6040
- return _self2.append(element);
6041
- });
6042
- }
6043
- }, "_appendVDOM");
6044
- if (typeof this.innerHTML !== "undefined") {
6045
- try {
6046
- this.innerHTML += content;
6047
- } catch (e) {
6048
- logger.debug(`An error ocurred: ${e}`);
6049
- _appendVDOM(_self, content);
6050
- }
6051
- } else {
6052
- _appendVDOM(_self, content);
5328
+ };
5329
+ s.onload = function(e) {
5330
+ context2.status = true;
5331
+ context2.done.call(context2, e);
5332
+ };
5333
+ s.onerror = function(e) {
5334
+ context2.status = false;
5335
+ context2.fail.call(context2, e);
5336
+ };
5337
+ context2.body = s;
5338
+ return s;
5339
+ }.call(
5340
+ this,
5341
+ _DOMCreateElement("script"),
5342
+ this.external ? this.url : this.basePath + this.url,
5343
+ context
5344
+ )
5345
+ );
5346
+ } catch (e) {
5347
+ context.status = false;
5348
+ logger.debug(`An error ocurred: ${e}`);
5349
+ context.fail();
5350
+ }
5351
+ }
5352
+ Cast(o) {
5353
+ return _Cast(this, o);
5354
+ }
5355
+ _new_(properties) {
5356
+ this.__new__(properties);
5357
+ this.rebuild();
5358
+ }
5359
+ };
5360
+ Package("com.qcobjects", [SourceJS]);
5361
+
5362
+ // src/SourceCSS.ts
5363
+ init_basePath();
5364
+ init_Cast();
5365
+ init_domain();
5366
+ init_DOMCreateElement();
5367
+ init_InheritClass();
5368
+ init_platform();
5369
+ init_Package();
5370
+ var SourceCSS = class extends InheritClass {
5371
+ static {
5372
+ __name(this, "SourceCSS");
5373
+ }
5374
+ domain = _domain_;
5375
+ basePath = _basePath_;
5376
+ url = "";
5377
+ data = {};
5378
+ async = false;
5379
+ external = false;
5380
+ constructor(o) {
5381
+ super(o);
5382
+ this.body = _DOMCreateElement("link");
5383
+ }
5384
+ fail() {
5385
+ throw new Error("Method not implemented.");
5386
+ }
5387
+ Cast(o) {
5388
+ return _Cast(this, o);
5389
+ }
5390
+ set(name, value) {
5391
+ this[name] = value;
5392
+ }
5393
+ get(name, _default) {
5394
+ return this[name] || _default;
5395
+ }
5396
+ done() {
5397
+ }
5398
+ rebuild() {
5399
+ const context = this;
5400
+ if (isBrowser) {
5401
+ window.document.getElementsByTagName("head")[0].appendChild(
5402
+ function(s, url, context2) {
5403
+ s.type = "text/css";
5404
+ s.rel = "stylesheet";
5405
+ s.href = url;
5406
+ s.crossOrigin = "anonymous";
5407
+ s.onreadystatechange = function() {
5408
+ if (this.readyState === "complete") {
5409
+ context2.done.call(context2);
6053
5410
  }
6054
- }, "QC_Render");
6055
- }
6056
- Export(waitUntil);
6057
- Export(_super_);
6058
- Export(ComplexStorageCache);
6059
- Export(ClassFactory);
6060
- Export(_DOMCreateElement);
6061
- Export(shortCode);
6062
- Export(__getType__);
6063
- Export(is_a);
6064
- Package("com.qcobjects", [Processor]);
6065
- if (isBrowser) {
6066
- Element.prototype.Cast = /* @__PURE__ */ __name(function QC_Cast(_o) {
6067
- const _self = this;
6068
- return _Cast(_self, _o);
6069
- }, "QC_Cast");
6070
- }
6071
- if (isBrowser) {
6072
- window.onload = _Ready;
6073
- if (is_phonegap) {
6074
- document.addEventListener("deviceready", _Ready, captureFalseTouch);
6075
- }
6076
- } else {
6077
- global2.onload = _Ready;
6078
- }
6079
- if (isBrowser) {
6080
- window.addEventListener("popstate", function(popStateEvent) {
6081
- popStateEvent.stopImmediatePropagation();
6082
- popStateEvent.stopPropagation();
6083
- Component.route().catch((e) => {
6084
- throw new Error(`An error ocurred when trying to load initial routes. ${e}`);
6085
- });
6086
- });
6087
- }
6088
- Export(serviceLoader);
6089
- Export(componentLoader);
6090
- Export(ComponentURI);
6091
- Export(ObjectName);
6092
- Export(_DataStringify);
6093
- Export(isQCObjects_Class);
6094
- Export(isQCObjects_Object);
6095
- Export(NamespaceRef);
6096
- Array.prototype.unique = function() {
6097
- return this.filter(function(value, index, self2) {
6098
- return self2.indexOf(value) === index;
6099
- });
6100
- };
6101
- Array.unique = function(a) {
6102
- return a.unique();
6103
- };
6104
- _protected_code_(Array.unique);
6105
- _protected_code_(Array.prototype.unique);
6106
- Array.prototype.table = function() {
6107
- console.table(this);
6108
- };
6109
- Array.table = function(a) {
6110
- a.table();
6111
- return;
6112
- };
6113
- _protected_code_(Array.table);
6114
- _protected_code_(Array.prototype.table);
6115
- Array.prototype.sum = function() {
6116
- return this.reduce(function(prev, current) {
6117
- return __to_number(prev) + __to_number(current);
6118
- }, 0);
6119
- };
6120
- Array.sum = function(a) {
6121
- return a.sum();
6122
- };
6123
- _protected_code_(Array.sum);
6124
- _protected_code_(Array.prototype.sum);
6125
- Array.prototype.avg = function() {
6126
- return this.length < 1 ? 0 : this.reduce(function(prev, current) {
6127
- return (__to_number(prev) + __to_number(current)) / 2;
6128
- });
6129
- };
6130
- Array.avg = function(a) {
6131
- return a.avg();
6132
- };
6133
- _protected_code_(Array.avg);
6134
- _protected_code_(Array.prototype.avg);
6135
- Array.prototype.min = function() {
6136
- return this.reduce(function(prev, current) {
6137
- return __to_number(prev) <= __to_number(current) ? prev : current;
6138
- }, Infinity);
6139
- };
6140
- Array.min = function(a) {
6141
- return a.min();
6142
- };
6143
- _protected_code_(Array.min);
6144
- _protected_code_(Array.prototype.min);
6145
- Array.prototype.max = function() {
6146
- return this.reduce(function(prev, current) {
6147
- return __to_number(prev) >= __to_number(current) ? prev : current;
6148
- }, 0);
6149
- };
6150
- Array.max = function(a) {
6151
- return a.max();
6152
- };
6153
- _protected_code_(Array.max);
6154
- _protected_code_(Array.prototype.max);
6155
- Array.prototype.sortBy = function(propName, sortAsc = true) {
6156
- const sort_function = sortAsc ? function(prev, current) {
6157
- return current[propName] < prev[propName] ? 1 : -1;
6158
- } : function(prev, current) {
6159
- return current[propName] > prev[propName] ? 1 : -1;
6160
5411
  };
6161
- return this.sort(sort_function);
6162
- };
6163
- Array.sortBy = function(a, propName, sortAsc = true) {
6164
- return a.sortBy(propName, sortAsc);
6165
- };
6166
- _protected_code_(Array.sortBy);
6167
- _protected_code_(Array.prototype.sortBy);
6168
- Array.prototype.matrix = function(_length, _fillValue = 0) {
6169
- const x_func = /* @__PURE__ */ __name(function(x = void 0) {
6170
- return _fillValue;
6171
- }, "x_func");
6172
- return Array.from({
6173
- length: _length
6174
- }, x_func);
6175
- };
6176
- Array.matrix = function(a, _length, _fillValue = 0) {
6177
- return a.matrix(_length, _fillValue);
6178
- };
6179
- _protected_code_(Array.matrix);
6180
- _protected_code_(Array.prototype.matrix);
6181
- Array.prototype.matrix2d = function(_length, _fillValue = 0) {
6182
- const y_func = /* @__PURE__ */ __name(function(y) {
6183
- return _fillValue;
6184
- }, "y_func");
6185
- const x_func = /* @__PURE__ */ __name(function(x) {
6186
- return Array.from({
6187
- length: _length
6188
- }, y_func);
6189
- }, "x_func");
6190
- return Array.from({
6191
- length: _length
6192
- }, x_func);
6193
- };
6194
- Array.matrix2d = function(a, _length, _fillValue = 0) {
6195
- return a.matrix2d(_length, _fillValue);
6196
- };
6197
- _protected_code_(Array.matrix2d);
6198
- _protected_code_(Array.prototype.matrix2d);
6199
- Array.prototype.matrix3d = function(_length, _fillValue = 0) {
6200
- const y_func = /* @__PURE__ */ __name(function(y) {
6201
- return Array.from({
6202
- length: _length
6203
- }, function() {
6204
- return _fillValue;
6205
- });
6206
- }, "y_func");
6207
- const x_func = /* @__PURE__ */ __name(function(x) {
6208
- return Array.from({
6209
- length: _length
6210
- }, y_func);
6211
- }, "x_func");
6212
- return Array.from({
6213
- length: _length
6214
- }, x_func);
6215
- };
6216
- Array.matrix3d = function(a, _length, _fillValue = 0) {
6217
- return a.matrix3d(_length, _fillValue);
6218
- };
6219
- _protected_code_(Array.matrix3d);
6220
- _protected_code_(Array.prototype.matrix3d);
6221
- String.prototype.list = function() {
6222
- const __instance = this;
6223
- return _top2.range(0, __instance.length - 1).map(function(i) {
6224
- return __instance[i];
6225
- });
6226
- };
6227
- _protected_code_(String.prototype.list);
6228
- setDefaultProcessors();
6229
- Ready(function() {
6230
- if (!CONFIG.get("useSDK")) {
6231
- GlobalSettings.__start__().catch((e) => {
6232
- throw Error(e);
6233
- });
6234
- }
6235
- });
6236
- Export(Export);
6237
- Export(Import);
6238
- Export(Package);
6239
- Export(Class);
6240
- Export(New);
6241
- Export(Tag);
6242
- Export(Ready);
6243
- Export(ready);
6244
- Export(isBrowser);
6245
- Export(_methods_);
6246
- Export(GlobalSettings);
6247
- resetTop(_CastProps(New(GlobalSettings), _top2));
6248
- (function(_top3) {
6249
- Object.defineProperty(_top3, "PackagesNameList", {
6250
- // eslint-disable-next-line no-unused-vars
6251
- set(val) {
6252
- logger.debug("PackagesNameList is readonly");
6253
- },
6254
- get() {
6255
- const _get_packages_names = /* @__PURE__ */ __name(function(_packages) {
6256
- let _keys = [];
6257
- for (const _k of Object.keys(_packages)) {
6258
- if (typeof _packages[_k] !== "undefined" && typeof _packages[_k] !== "function" && Object.hasOwn(_packages[_k], "length") && _packages[_k].length > 0) {
6259
- _keys.push(_k);
6260
- _keys = _keys.concat(_get_packages_names(_packages[_k]));
6261
- }
6262
- }
6263
- return _keys;
6264
- }, "_get_packages_names");
6265
- return _get_packages_names(_QC_PACKAGES);
6266
- }
6267
- });
6268
- Object.defineProperty(_top3, "PackagesList", {
6269
- // eslint-disable-next-line no-unused-vars
6270
- set(value) {
6271
- logger.debug("PackagesList is readonly");
6272
- },
6273
- get() {
6274
- return _top3.PackagesNameList.map(function(packagename) {
6275
- const _classesList = Package(packagename);
6276
- let _ret_ = void 0;
6277
- if (_classesList) {
6278
- _ret_ = {
6279
- packageName: packagename,
6280
- classesList: _classesList.filter(function(_packageClass) {
6281
- return isQCObjects_Class(_packageClass);
6282
- })
6283
- };
6284
- }
6285
- return _ret_;
6286
- }).filter(function(_p) {
6287
- return typeof _p !== "undefined";
6288
- });
6289
- }
6290
- });
6291
- Object.defineProperty(_top3, "ClassesList", {
6292
- // eslint-disable-next-line no-unused-vars
6293
- set(value) {
6294
- logger.debug("ClassesList is readonly");
6295
- },
6296
- get() {
6297
- let _classesList = [];
6298
- _top3.PackagesList.map(function(_package_element) {
6299
- _classesList = _classesList.concat(_package_element.classesList.map(
6300
- function(_class_element) {
6301
- return {
6302
- packageName: _package_element.packageName,
6303
- className: _package_element.packageName + "." + _class_element.__definition.__classType,
6304
- classFactory: _class_element
6305
- };
6306
- }
6307
- ));
6308
- return _package_element;
6309
- });
6310
- return _classesList;
6311
- }
5412
+ s.onload = context2.done;
5413
+ context2.body = s;
5414
+ return s;
5415
+ }.call(
5416
+ this,
5417
+ _DOMCreateElement("link"),
5418
+ this.external ? this.url : this.basePath + this.url,
5419
+ context
5420
+ )
5421
+ );
5422
+ }
5423
+ }
5424
+ };
5425
+ Package("com.qcobjects", [SourceCSS]);
5426
+
5427
+ // src/QCObjects.ts
5428
+ init_globalSettings();
5429
+ init_RegisterClass();
5430
+
5431
+ // src/WidgetsFactory.ts
5432
+ init_DOMCreateElement();
5433
+ init_Export();
5434
+ init_introspection();
5435
+ init_platform();
5436
+ var QCObjectsWidgetNode = class {
5437
+ static {
5438
+ __name(this, "QCObjectsWidgetNode");
5439
+ }
5440
+ accessKey;
5441
+ accessKeyLabel;
5442
+ autocapitalize;
5443
+ dir;
5444
+ draggable;
5445
+ hidden;
5446
+ inert;
5447
+ innerText;
5448
+ lang;
5449
+ offsetHeight;
5450
+ offsetLeft;
5451
+ offsetParent;
5452
+ offsetTop;
5453
+ offsetWidth;
5454
+ outerText;
5455
+ popover;
5456
+ spellcheck;
5457
+ title;
5458
+ translate;
5459
+ attachInternals() {
5460
+ throw new Error("Method not implemented.");
5461
+ }
5462
+ click() {
5463
+ throw new Error("Method not implemented.");
5464
+ }
5465
+ hidePopover() {
5466
+ throw new Error("Method not implemented.");
5467
+ }
5468
+ showPopover() {
5469
+ throw new Error("Method not implemented.");
5470
+ }
5471
+ togglePopover(force) {
5472
+ throw new Error("Method not implemented.");
5473
+ }
5474
+ addEventListener(type, listener, options) {
5475
+ throw new Error("Method not implemented.");
5476
+ }
5477
+ removeEventListener(type, listener, options) {
5478
+ throw new Error("Method not implemented.");
5479
+ }
5480
+ attributes;
5481
+ classList;
5482
+ className;
5483
+ clientHeight;
5484
+ clientLeft;
5485
+ clientTop;
5486
+ clientWidth;
5487
+ id;
5488
+ innerHTML;
5489
+ localName;
5490
+ namespaceURI;
5491
+ onfullscreenchange;
5492
+ onfullscreenerror;
5493
+ outerHTML;
5494
+ ownerDocument;
5495
+ part;
5496
+ prefix;
5497
+ scrollHeight;
5498
+ scrollLeft;
5499
+ scrollTop;
5500
+ scrollWidth;
5501
+ shadowRoot;
5502
+ slot;
5503
+ tagName;
5504
+ attachShadow(init) {
5505
+ throw new Error("Method not implemented.");
5506
+ }
5507
+ checkVisibility(options) {
5508
+ throw new Error("Method not implemented.");
5509
+ }
5510
+ closest(selectors) {
5511
+ throw new Error("Method not implemented.");
5512
+ }
5513
+ computedStyleMap() {
5514
+ throw new Error("Method not implemented.");
5515
+ }
5516
+ getAttribute(qualifiedName) {
5517
+ throw new Error("Method not implemented.");
5518
+ }
5519
+ getAttributeNS(namespace, localName) {
5520
+ throw new Error("Method not implemented.");
5521
+ }
5522
+ getAttributeNames() {
5523
+ throw new Error("Method not implemented.");
5524
+ }
5525
+ getAttributeNode(qualifiedName) {
5526
+ throw new Error("Method not implemented.");
5527
+ }
5528
+ getAttributeNodeNS(namespace, localName) {
5529
+ throw new Error("Method not implemented.");
5530
+ }
5531
+ getBoundingClientRect() {
5532
+ throw new Error("Method not implemented.");
5533
+ }
5534
+ getClientRects() {
5535
+ throw new Error("Method not implemented.");
5536
+ }
5537
+ getElementsByClassName(classNames) {
5538
+ throw new Error("Method not implemented.");
5539
+ }
5540
+ getElementsByTagName(qualifiedName) {
5541
+ throw new Error("Method not implemented.");
5542
+ }
5543
+ getElementsByTagNameNS(namespace, localName) {
5544
+ throw new Error("Method not implemented.");
5545
+ }
5546
+ getHTML(options) {
5547
+ throw new Error("Method not implemented.");
5548
+ }
5549
+ hasAttribute(qualifiedName) {
5550
+ throw new Error("Method not implemented.");
5551
+ }
5552
+ hasAttributeNS(namespace, localName) {
5553
+ throw new Error("Method not implemented.");
5554
+ }
5555
+ hasAttributes() {
5556
+ throw new Error("Method not implemented.");
5557
+ }
5558
+ hasPointerCapture(pointerId) {
5559
+ throw new Error("Method not implemented.");
5560
+ }
5561
+ insertAdjacentElement(where, element) {
5562
+ throw new Error("Method not implemented.");
5563
+ }
5564
+ insertAdjacentHTML(position, string) {
5565
+ throw new Error("Method not implemented.");
5566
+ }
5567
+ insertAdjacentText(where, data) {
5568
+ throw new Error("Method not implemented.");
5569
+ }
5570
+ matches(selectors) {
5571
+ throw new Error("Method not implemented.");
5572
+ }
5573
+ releasePointerCapture(pointerId) {
5574
+ throw new Error("Method not implemented.");
5575
+ }
5576
+ removeAttribute(qualifiedName) {
5577
+ throw new Error("Method not implemented.");
5578
+ }
5579
+ removeAttributeNS(namespace, localName) {
5580
+ throw new Error("Method not implemented.");
5581
+ }
5582
+ removeAttributeNode(attr) {
5583
+ throw new Error("Method not implemented.");
5584
+ }
5585
+ requestFullscreen(options) {
5586
+ throw new Error("Method not implemented.");
5587
+ }
5588
+ requestPointerLock(options) {
5589
+ throw new Error("Method not implemented.");
5590
+ }
5591
+ scroll(x, y) {
5592
+ throw new Error("Method not implemented.");
5593
+ }
5594
+ scrollBy(x, y) {
5595
+ throw new Error("Method not implemented.");
5596
+ }
5597
+ scrollIntoView(arg) {
5598
+ throw new Error("Method not implemented.");
5599
+ }
5600
+ scrollTo(x, y) {
5601
+ throw new Error("Method not implemented.");
5602
+ }
5603
+ setAttribute(qualifiedName, value) {
5604
+ throw new Error("Method not implemented.");
5605
+ }
5606
+ setAttributeNS(namespace, qualifiedName, value) {
5607
+ throw new Error("Method not implemented.");
5608
+ }
5609
+ setAttributeNode(attr) {
5610
+ throw new Error("Method not implemented.");
5611
+ }
5612
+ setAttributeNodeNS(attr) {
5613
+ throw new Error("Method not implemented.");
5614
+ }
5615
+ setHTMLUnsafe(html) {
5616
+ throw new Error("Method not implemented.");
5617
+ }
5618
+ setPointerCapture(pointerId) {
5619
+ throw new Error("Method not implemented.");
5620
+ }
5621
+ toggleAttribute(qualifiedName, force) {
5622
+ throw new Error("Method not implemented.");
5623
+ }
5624
+ webkitMatchesSelector(selectors) {
5625
+ throw new Error("Method not implemented.");
5626
+ }
5627
+ baseURI;
5628
+ childNodes;
5629
+ firstChild;
5630
+ isConnected;
5631
+ lastChild;
5632
+ nextSibling;
5633
+ nodeName;
5634
+ nodeType;
5635
+ nodeValue;
5636
+ parentElement;
5637
+ parentNode;
5638
+ previousSibling;
5639
+ textContent;
5640
+ appendChild(node) {
5641
+ throw new Error("Method not implemented.");
5642
+ }
5643
+ cloneNode(deep) {
5644
+ throw new Error("Method not implemented.");
5645
+ }
5646
+ compareDocumentPosition(other) {
5647
+ throw new Error("Method not implemented.");
5648
+ }
5649
+ contains(other) {
5650
+ throw new Error("Method not implemented.");
5651
+ }
5652
+ getRootNode(options) {
5653
+ throw new Error("Method not implemented.");
5654
+ }
5655
+ hasChildNodes() {
5656
+ throw new Error("Method not implemented.");
5657
+ }
5658
+ insertBefore(node, child) {
5659
+ throw new Error("Method not implemented.");
5660
+ }
5661
+ isDefaultNamespace(namespace) {
5662
+ throw new Error("Method not implemented.");
5663
+ }
5664
+ isEqualNode(otherNode) {
5665
+ throw new Error("Method not implemented.");
5666
+ }
5667
+ isSameNode(otherNode) {
5668
+ throw new Error("Method not implemented.");
5669
+ }
5670
+ lookupNamespaceURI(prefix) {
5671
+ throw new Error("Method not implemented.");
5672
+ }
5673
+ lookupPrefix(namespace) {
5674
+ throw new Error("Method not implemented.");
5675
+ }
5676
+ normalize() {
5677
+ throw new Error("Method not implemented.");
5678
+ }
5679
+ removeChild(child) {
5680
+ throw new Error("Method not implemented.");
5681
+ }
5682
+ replaceChild(node, child) {
5683
+ throw new Error("Method not implemented.");
5684
+ }
5685
+ ELEMENT_NODE;
5686
+ ATTRIBUTE_NODE;
5687
+ TEXT_NODE;
5688
+ CDATA_SECTION_NODE;
5689
+ ENTITY_REFERENCE_NODE;
5690
+ ENTITY_NODE;
5691
+ PROCESSING_INSTRUCTION_NODE;
5692
+ COMMENT_NODE;
5693
+ DOCUMENT_NODE;
5694
+ DOCUMENT_TYPE_NODE;
5695
+ DOCUMENT_FRAGMENT_NODE;
5696
+ NOTATION_NODE;
5697
+ DOCUMENT_POSITION_DISCONNECTED;
5698
+ DOCUMENT_POSITION_PRECEDING;
5699
+ DOCUMENT_POSITION_FOLLOWING;
5700
+ DOCUMENT_POSITION_CONTAINS;
5701
+ DOCUMENT_POSITION_CONTAINED_BY;
5702
+ DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;
5703
+ dispatchEvent(event) {
5704
+ throw new Error("Method not implemented.");
5705
+ }
5706
+ ariaAtomic;
5707
+ ariaAutoComplete;
5708
+ ariaBrailleLabel;
5709
+ ariaBrailleRoleDescription;
5710
+ ariaBusy;
5711
+ ariaChecked;
5712
+ ariaColCount;
5713
+ ariaColIndex;
5714
+ ariaColSpan;
5715
+ ariaCurrent;
5716
+ ariaDescription;
5717
+ ariaDisabled;
5718
+ ariaExpanded;
5719
+ ariaHasPopup;
5720
+ ariaHidden;
5721
+ ariaInvalid;
5722
+ ariaKeyShortcuts;
5723
+ ariaLabel;
5724
+ ariaLevel;
5725
+ ariaLive;
5726
+ ariaModal;
5727
+ ariaMultiLine;
5728
+ ariaMultiSelectable;
5729
+ ariaOrientation;
5730
+ ariaPlaceholder;
5731
+ ariaPosInSet;
5732
+ ariaPressed;
5733
+ ariaReadOnly;
5734
+ ariaRequired;
5735
+ ariaRoleDescription;
5736
+ ariaRowCount;
5737
+ ariaRowIndex;
5738
+ ariaRowSpan;
5739
+ ariaSelected;
5740
+ ariaSetSize;
5741
+ ariaSort;
5742
+ ariaValueMax;
5743
+ ariaValueMin;
5744
+ ariaValueNow;
5745
+ ariaValueText;
5746
+ role;
5747
+ animate(keyframes, options) {
5748
+ throw new Error("Method not implemented.");
5749
+ }
5750
+ getAnimations(options) {
5751
+ throw new Error("Method not implemented.");
5752
+ }
5753
+ after(...nodes) {
5754
+ throw new Error("Method not implemented.");
5755
+ }
5756
+ before(...nodes) {
5757
+ throw new Error("Method not implemented.");
5758
+ }
5759
+ remove() {
5760
+ throw new Error("Method not implemented.");
5761
+ }
5762
+ replaceWith(...nodes) {
5763
+ throw new Error("Method not implemented.");
5764
+ }
5765
+ nextElementSibling;
5766
+ previousElementSibling;
5767
+ childElementCount;
5768
+ children;
5769
+ firstElementChild;
5770
+ lastElementChild;
5771
+ append(...nodes) {
5772
+ throw new Error("Method not implemented.");
5773
+ }
5774
+ prepend(...nodes) {
5775
+ throw new Error("Method not implemented.");
5776
+ }
5777
+ querySelector(selectors) {
5778
+ throw new Error("Method not implemented.");
5779
+ }
5780
+ querySelectorAll(selectors) {
5781
+ throw new Error("Method not implemented.");
5782
+ }
5783
+ replaceChildren(...nodes) {
5784
+ throw new Error("Method not implemented.");
5785
+ }
5786
+ assignedSlot;
5787
+ attributeStyleMap;
5788
+ style;
5789
+ contentEditable;
5790
+ enterKeyHint;
5791
+ inputMode;
5792
+ isContentEditable;
5793
+ onabort;
5794
+ onanimationcancel;
5795
+ onanimationend;
5796
+ onanimationiteration;
5797
+ onanimationstart;
5798
+ onauxclick;
5799
+ onbeforeinput;
5800
+ onbeforetoggle;
5801
+ onblur;
5802
+ oncancel;
5803
+ oncanplay;
5804
+ oncanplaythrough;
5805
+ onchange;
5806
+ onclick;
5807
+ onclose;
5808
+ oncontextlost;
5809
+ oncontextmenu;
5810
+ oncontextrestored;
5811
+ oncopy;
5812
+ oncuechange;
5813
+ oncut;
5814
+ ondblclick;
5815
+ ondrag;
5816
+ ondragend;
5817
+ ondragenter;
5818
+ ondragleave;
5819
+ ondragover;
5820
+ ondragstart;
5821
+ ondrop;
5822
+ ondurationchange;
5823
+ onemptied;
5824
+ onended;
5825
+ onerror;
5826
+ onfocus;
5827
+ onformdata;
5828
+ ongotpointercapture;
5829
+ oninput;
5830
+ oninvalid;
5831
+ onkeydown;
5832
+ onkeypress;
5833
+ onkeyup;
5834
+ onload;
5835
+ onloadeddata;
5836
+ onloadedmetadata;
5837
+ onloadstart;
5838
+ onlostpointercapture;
5839
+ onmousedown;
5840
+ onmouseenter;
5841
+ onmouseleave;
5842
+ onmousemove;
5843
+ onmouseout;
5844
+ onmouseover;
5845
+ onmouseup;
5846
+ onpaste;
5847
+ onpause;
5848
+ onplay;
5849
+ onplaying;
5850
+ onpointercancel;
5851
+ onpointerdown;
5852
+ onpointerenter;
5853
+ onpointerleave;
5854
+ onpointermove;
5855
+ onpointerout;
5856
+ onpointerover;
5857
+ onpointerup;
5858
+ onprogress;
5859
+ onratechange;
5860
+ onreset;
5861
+ onresize;
5862
+ onscroll;
5863
+ onscrollend;
5864
+ onsecuritypolicyviolation;
5865
+ onseeked;
5866
+ onseeking;
5867
+ onselect;
5868
+ onselectionchange;
5869
+ onselectstart;
5870
+ onslotchange;
5871
+ onstalled;
5872
+ onsubmit;
5873
+ onsuspend;
5874
+ ontimeupdate;
5875
+ ontoggle;
5876
+ ontouchcancel;
5877
+ ontouchend;
5878
+ ontouchmove;
5879
+ ontouchstart;
5880
+ ontransitioncancel;
5881
+ ontransitionend;
5882
+ ontransitionrun;
5883
+ ontransitionstart;
5884
+ onvolumechange;
5885
+ onwaiting;
5886
+ onwebkitanimationend;
5887
+ onwebkitanimationiteration;
5888
+ onwebkitanimationstart;
5889
+ onwebkittransitionend;
5890
+ onwheel;
5891
+ autofocus;
5892
+ dataset;
5893
+ nonce;
5894
+ tabIndex;
5895
+ blur() {
5896
+ throw new Error("Method not implemented.");
5897
+ }
5898
+ focus(options) {
5899
+ throw new Error("Method not implemented.");
5900
+ }
5901
+ };
5902
+ var _ComponentWidget_;
5903
+ if (isBrowser) {
5904
+ _ComponentWidget_ = class _ComponentWidget_ extends HTMLElement {
5905
+ static {
5906
+ __name(this, "_ComponentWidget_");
5907
+ }
5908
+ constructor() {
5909
+ super();
5910
+ const componentWidget = this;
5911
+ const componentName = componentWidget.nodeName.toLowerCase();
5912
+ const componentBody = _DOMCreateElement("quick-component");
5913
+ const __enabled__atributes__ = componentWidget.getAttributeNames();
5914
+ componentBody.setAttribute("name", componentName);
5915
+ if (!componentWidget.hasAttribute("shadowed")) {
5916
+ componentBody.setAttribute("shadowed", "true");
5917
+ }
5918
+ __enabled__atributes__.map(function(attributeName) {
5919
+ if (componentWidget.hasAttribute(attributeName)) {
5920
+ componentBody.setAttribute(attributeName, componentWidget?.getAttribute(attributeName));
5921
+ componentWidget.removeAttribute(attributeName);
5922
+ }
5923
+ });
5924
+ const data_attributenames = componentWidget.getAttributeNames().filter(function(a) {
5925
+ return a.startsWith("data-");
5926
+ }).map(function(a) {
5927
+ return a.split("-")[1];
5928
+ });
5929
+ data_attributenames.map(function(_attribute_name_) {
5930
+ componentBody.setAttribute("data-" + _attribute_name_, componentWidget?.getAttribute("data-" + _attribute_name_));
5931
+ componentWidget.removeAttribute("data-" + _attribute_name_);
5932
+ });
5933
+ [...componentWidget.children].map(function(element) {
5934
+ componentBody.appendChild(element.cloneNode(true));
5935
+ element.remove();
5936
+ });
5937
+ componentWidget.append(componentBody);
5938
+ }
5939
+ };
5940
+ } else {
5941
+ _ComponentWidget_ = class _ComponentWidget_ extends QCObjectsWidgetNode {
5942
+ static {
5943
+ __name(this, "_ComponentWidget_");
5944
+ }
5945
+ constructor() {
5946
+ super();
5947
+ throw new Error("Class not implemented.");
5948
+ }
5949
+ };
5950
+ }
5951
+ Export(_ComponentWidget_);
5952
+ var RegisterWidget = /* @__PURE__ */ __name(function(widgetName) {
5953
+ if (isBrowser) {
5954
+ customElements.define(widgetName, class extends _ComponentWidget_ {
5955
+ });
5956
+ } else {
5957
+ throw new Error("RegisterWidget is not implemented for non browser ecosystems yet.");
5958
+ }
5959
+ }, "RegisterWidget");
5960
+ var RegisterWidgets = /* @__PURE__ */ __name(function(...args) {
5961
+ const widgetList = [...args];
5962
+ widgetList.filter(function(widgetName) {
5963
+ return typeof widgetName === "string";
5964
+ }).map(function(widgetName) {
5965
+ return RegisterWidget(widgetName);
5966
+ });
5967
+ }, "RegisterWidgets");
5968
+ _protected_code_(RegisterWidget);
5969
+ _protected_code_(RegisterWidgets);
5970
+ Export(RegisterWidget);
5971
+ Export(RegisterWidgets);
5972
+
5973
+ // src/QCObjects.ts
5974
+ init_CONFIG();
5975
+
5976
+ // src/Controller.ts
5977
+ init_ClassFactory();
5978
+ init_getType();
5979
+ init_InheritClass();
5980
+ init_Logger();
5981
+ init_New();
5982
+ init_Package();
5983
+ init_platform();
5984
+ var Controller = class extends InheritClass {
5985
+ static {
5986
+ __name(this, "Controller");
5987
+ }
5988
+ component;
5989
+ dependencies = [];
5990
+ constructor({
5991
+ component,
5992
+ dependencies
5993
+ }) {
5994
+ super({ component, dependencies });
5995
+ this.component = component;
5996
+ this.dependencies = dependencies;
5997
+ if (typeof this.component === "undefined" || this.component === null) {
5998
+ throw Error(`${__getType__(this)} must be called with a component`);
5999
+ }
6000
+ }
6001
+ // eslint-disable-next-line no-unused-vars
6002
+ fail(...args) {
6003
+ throw new Error("Method not implemented.");
6004
+ }
6005
+ routingSelectedAttr(attrName) {
6006
+ return this.component?.routingSelected.map((r) => {
6007
+ return r[attrName];
6008
+ }).filter(function(v) {
6009
+ return v;
6010
+ }).pop();
6011
+ }
6012
+ isTouchable() {
6013
+ return "ontouchstart" in window || navigator.MaxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
6014
+ }
6015
+ onpress(subelementSelector, handler) {
6016
+ if (isBrowser) {
6017
+ try {
6018
+ if (this.isTouchable()) {
6019
+ (this.component?.componentRoot?.subelements(subelementSelector))[0].addEventListener("touchstart", handler, {
6020
+ passive: true
6312
6021
  });
6313
- Object.defineProperty(_top3, "ClassesNameList", {
6314
- // eslint-disable-next-line no-unused-vars
6315
- set(value) {
6316
- logger.debug("ClassesNameList is readonly");
6317
- },
6318
- get() {
6319
- return _top3.ClassesList.map(function(_class_element) {
6320
- return _class_element.className;
6321
- });
6322
- }
6022
+ } else {
6023
+ (this.component?.componentRoot?.subelements(subelementSelector))[0].addEventListener("click", handler, {
6024
+ passive: true
6323
6025
  });
6324
- if (isBrowser) {
6325
- Class("GLOBAL", _QC_CLASSES.global);
6326
- Export(ClassFactory("GLOBAL"));
6327
- }
6328
- Export(global2);
6329
- loadSDK_default();
6330
- })(_top2);
6331
- if (isBrowser) {
6332
- asyncLoad(function() {
6333
- Ready(function() {
6334
- (function(_top3) {
6335
- let ticking = false;
6336
- const scrollHeight = Math.max(
6337
- document.body.scrollHeight,
6338
- document.documentElement.scrollHeight,
6339
- document.body.offsetHeight,
6340
- document.documentElement.offsetHeight,
6341
- document.body.clientHeight,
6342
- document.documentElement.clientHeight
6343
- );
6344
- const scrollWidth = Math.max(
6345
- document.body.scrollWidth,
6346
- document.documentElement.scrollWidth,
6347
- document.body.offsetWidth,
6348
- document.documentElement.offsetWidth,
6349
- document.body.clientWidth,
6350
- document.documentElement.clientWidth
6351
- );
6352
- function scrollDispatcher(event) {
6353
- const percentY = Math.round(_top3.scrollY * 100 / scrollHeight);
6354
- const percentX = Math.round(_top3.scrollX * 100 / scrollWidth);
6355
- const scrollPercentEventEvent = new CustomEvent("scrollpercent", {
6356
- detail: {
6357
- percentX,
6358
- percentY
6359
- }
6360
- });
6361
- event.target.dispatchEvent(scrollPercentEventEvent);
6362
- let secondaryEventName = "defaultscroll";
6363
- const __valid_scrolls__ = [0, 5, 10, 25, 50, 75, 90, 95, 100];
6364
- __valid_scrolls__.filter(function(p) {
6365
- return p === percentY;
6366
- }).map(function(pY) {
6367
- secondaryEventName = "percentY" + percentY.toString();
6368
- const secondaryCustomEvent = new CustomEvent(secondaryEventName, {
6369
- detail: {
6370
- percentX,
6371
- percentY
6372
- }
6373
- });
6374
- event.target.dispatchEvent(secondaryCustomEvent);
6375
- return pY;
6376
- });
6377
- }
6378
- __name(scrollDispatcher, "scrollDispatcher");
6379
- document.addEventListener("scroll", function(event) {
6380
- if (!ticking) {
6381
- requestAnimationFrame(function() {
6382
- scrollDispatcher(event);
6383
- ticking = false;
6384
- });
6385
- ticking = true;
6386
- }
6387
- });
6388
- })(_top2);
6389
- });
6390
- }, []);
6391
6026
  }
6392
- if (!isBrowser) {
6393
- if (typeof _top2.global !== "undefined" && Object.hasOwn(_top2.global, "_fireAsyncLoad")) {
6394
- _fireAsyncLoad.call(_top2);
6395
- }
6396
- if (typeof _top2.global !== "undefined" && Object.hasOwn(_top2.global, "onload")) {
6397
- _top2.global.onload.call(_top2);
6398
- }
6027
+ } catch (e) {
6028
+ logger.debug(`An error ocurred: ${e}.`);
6029
+ logger.debug("No button to assign press event");
6030
+ }
6031
+ }
6032
+ }
6033
+ createRoutingController() {
6034
+ const controller = this;
6035
+ const component = controller.component;
6036
+ const controllerName = controller.routingSelectedAttr("controllerclass");
6037
+ if (typeof controllerName !== "undefined") {
6038
+ const _Controller2 = ClassFactory(controllerName);
6039
+ if (typeof _Controller2 !== "undefined" && component !== null) {
6040
+ component.routingController = New(_Controller2, {
6041
+ component
6042
+ });
6043
+ if (typeof component.routingController !== "undefined" && Object.hasOwn(component.routingController, "done") && typeof component.routingController.done === "function") {
6044
+ component.routingController.done.call(component.routingController);
6399
6045
  }
6400
- (function(isBrowser2) {
6401
- const __freeze__ = /* @__PURE__ */ __name(function() {
6402
- Object.freeze(Object.prototype);
6403
- Object.freeze(Object);
6404
- }, "__freeze__");
6405
- if (isBrowser2 && CONFIG.get("secureObjects", false)) {
6406
- Ready(function() {
6407
- __freeze__();
6408
- });
6409
- } else if (CONFIG.get("secureObjects", false)) {
6410
- __freeze__();
6411
- }
6412
- })(isBrowser);
6413
6046
  }
6414
- }, "__qcobjects__"))(_top);
6047
+ }
6415
6048
  }
6416
- });
6049
+ done() {
6050
+ }
6051
+ };
6052
+ Package("com.qcobjects.controllers", [
6053
+ Controller
6054
+ ]);
6055
+
6056
+ // src/View.ts
6057
+ init_getType();
6058
+ init_InheritClass();
6059
+ init_Package();
6060
+ var View = class extends InheritClass {
6061
+ static {
6062
+ __name(this, "View");
6063
+ }
6064
+ constructor({ component = void 0, dependencies = [] }) {
6065
+ super({ component, dependencies });
6066
+ if (typeof this.component === "undefined" || this.component === "null") {
6067
+ throw Error(`${__getType__(this)} must be called with a component`);
6068
+ }
6069
+ }
6070
+ };
6071
+ Package("com.qcobjects.views", [
6072
+ View
6073
+ ]);
6417
6074
 
6418
6075
  // src/QCObjects.ts
6419
- var QCObjects_exports = {};
6420
- __export(QCObjects_exports, {
6421
- ArrayCollection: () => ArrayCollection,
6422
- ArrayList: () => ArrayList,
6423
- AssignPolyfill: () => AssignPolyfill,
6424
- BackendMicroservice: () => BackendMicroservice,
6425
- CONFIG: () => CONFIG,
6426
- Class: () => Class,
6427
- ClassFactory: () => ClassFactory,
6428
- ComplexStorageCache: () => ComplexStorageCache,
6429
- Component: () => Component,
6430
- ComponentURI: () => ComponentURI,
6431
- ConfigService: () => ConfigService,
6432
- Controller: () => Controller,
6433
- DDO: () => DDO,
6434
- DefaultTemplateHandler: () => DefaultTemplateHandler,
6435
- Effect: () => Effect,
6436
- Export: () => Export,
6437
- GlobalSettings: () => GlobalSettings,
6438
- Import: () => Import,
6439
- InheritClass: () => InheritClass,
6440
- JSONService: () => JSONService,
6441
- Logger: () => Logger,
6442
- NamespaceRef: () => NamespaceRef,
6443
- New: () => New,
6444
- ObjectName: () => ObjectName,
6445
- Package: () => Package,
6446
- Processor: () => Processor,
6447
- QCObjects: () => QCObjects,
6448
- Ready: () => Ready,
6449
- RegisterClass: () => RegisterClass,
6450
- RegisterWidget: () => RegisterWidget,
6451
- RegisterWidgets: () => RegisterWidgets,
6452
- Service: () => Service,
6453
- SourceCSS: () => SourceCSS,
6454
- SourceJS: () => SourceJS,
6455
- Tag: () => Tag,
6456
- TagElements: () => TagElements,
6457
- Timer: () => Timer,
6458
- Toggle: () => Toggle,
6459
- TransitionEffect: () => TransitionEffect,
6460
- VO: () => VO,
6461
- View: () => View,
6462
- _Cast: () => _Cast,
6463
- _CastProps: () => _CastProps,
6464
- _ComponentWidget_: () => _ComponentWidget_,
6465
- _Crypt: () => _Crypt,
6466
- _DOMCreateElement: () => _DOMCreateElement,
6467
- _DataStringify: () => _DataStringify,
6468
- _LegacyCopy: () => _LegacyCopy,
6469
- _QC_CLASSES: () => _QC_CLASSES,
6470
- _QC_PACKAGES: () => _QC_PACKAGES,
6471
- _QC_PACKAGES_IMPORTED: () => _QC_PACKAGES_IMPORTED,
6472
- _QC_READY_LISTENERS: () => _QC_READY_LISTENERS,
6473
- _Ready: () => _Ready,
6474
- __getType__: () => __getType__,
6475
- __instanceID: () => __instanceID,
6476
- __is_raw_class__: () => __is_raw_class__,
6477
- __make_global__: () => __make_global__,
6478
- __to_number: () => __to_number,
6479
- _buildComponentsFromElements_: () => _buildComponentsFromElements_,
6480
- _fireAsyncLoad: () => _fireAsyncLoad,
6481
- _methods_: () => _methods_,
6482
- _protected_code_: () => _protected_code_,
6483
- _require_: () => _require_,
6484
- _super_: () => _super_,
6485
- _tag_filter_: () => _tag_filter_,
6486
- _top: () => _top,
6487
- asyncLoad: () => asyncLoad,
6488
- captureFalseTouch: () => captureFalseTouch,
6489
- componentLoader: () => componentLoader,
6490
- findPackageNodePath: () => findPackageNodePath,
6491
- getDocumentLayout: () => getDocumentLayout,
6492
- global: () => _top,
6493
- isBrowser: () => isBrowser,
6494
- isNodeCommonJS: () => isNodeCommonJS,
6495
- isQCObjects_Class: () => isQCObjects_Class,
6496
- isQCObjects_Object: () => isQCObjects_Object,
6497
- is_a: () => is_a,
6498
- is_phonegap: () => is_phonegap,
6499
- logger: () => logger,
6500
- range: () => range,
6501
- ready: () => ready,
6502
- resetTop: () => resetTop,
6503
- serviceLoader: () => serviceLoader,
6504
- setDefaultProcessors: () => setDefaultProcessors,
6505
- shortCode: () => shortCode,
6506
- subelements: () => subelements,
6507
- waitUntil: () => waitUntil
6508
- });
6509
- var AssignPolyfill, QCObjects;
6510
- var init_QCObjects = __esm({
6511
- "src/QCObjects.ts"() {
6512
- "use strict";
6513
- AssignPolyfill = __toESM(require_assign());
6514
- init_top();
6515
- init_PrimaryCollections();
6516
- init_DataStringify();
6517
- init_DOMCreateElement();
6518
- init_introspection();
6519
- init_Logger();
6520
- init_platform();
6521
- init_subelements();
6522
- init_is_raw_class();
6523
- init_LegacyCopy();
6524
- init_asyncLoad();
6525
- init_IncrementInstanceID();
6526
- init_ObjectName();
6527
- init_getType();
6528
- init_is_a();
6529
- init_ComplexStorageCache();
6530
- init_waitUntil();
6531
- init_Cast();
6532
- init_isQCObjects();
6533
- init_Package();
6534
- init_ClassFactory();
6535
- init_Export();
6536
- init_Class();
6537
- init_InheritClass();
6538
- init_super();
6539
- init_shortCode();
6540
- init_Processor();
6541
- init_New();
6542
- init_Ready();
6543
- init_captureFalseTouch();
6544
- init_serviceLoader();
6545
- init_componentLoader();
6546
- init_ComponentFactory();
6547
- init_NamespaceRef();
6548
- init_defaultProcessors();
6549
- init_Tag();
6550
- init_Import();
6551
- init_BackendMicroservice();
6552
- init_Component();
6553
- init_Crypt();
6554
- init_DefaultTemplateHandler();
6555
- init_SourceJS();
6556
- init_SourceCSS();
6557
- init_globalSettings();
6558
- init_RegisterClass();
6559
- init_WidgetsFactory();
6560
- init_CONFIG();
6561
- init_Controller();
6562
- init_View();
6563
- init_Service();
6564
- init_VO();
6565
- init_Effect();
6566
- init_TransitionEffect();
6567
- init_Timer();
6568
- init_tag_filter();
6569
- init_range();
6570
- init_ArrayCollection();
6571
- init_DDO();
6572
- init_Toggle();
6573
- init_findPackageNodePath();
6574
- init_DocumentLayout();
6575
- init_index_d();
6576
- init_mathFunctions();
6577
- init_top();
6578
- init_make_global();
6579
- QCObjects = __toESM(require_MainProcess());
6076
+ init_Service();
6077
+
6078
+ // src/VO.ts
6079
+ init_InheritClass();
6080
+ init_Package();
6081
+ var VO = class extends InheritClass {
6082
+ static {
6083
+ __name(this, "VO");
6580
6084
  }
6581
- });
6085
+ };
6086
+ Package("com.qcobjects.valueObjects", [
6087
+ VO
6088
+ ]);
6089
+
6090
+ // src/Effect.ts
6091
+ init_InheritClass();
6092
+ init_Package();
6093
+ var Effect = class extends InheritClass {
6094
+ static {
6095
+ __name(this, "Effect");
6096
+ }
6097
+ // eslint-disable-next-line no-unused-vars
6098
+ done(...args) {
6099
+ throw new Error("Method not implemented.");
6100
+ }
6101
+ // eslint-disable-next-line no-unused-vars
6102
+ apply(...args) {
6103
+ throw new Error("Method not implemented.");
6104
+ }
6105
+ duration = 1e3;
6106
+ animate({
6107
+ timing,
6108
+ draw,
6109
+ duration
6110
+ }) {
6111
+ const _self = this;
6112
+ const start = performance.now();
6113
+ requestAnimationFrame(/* @__PURE__ */ __name(function animate(time) {
6114
+ let timeFraction = (time - start) / duration;
6115
+ if (timeFraction > 1) timeFraction = 1;
6116
+ const progress = timing(timeFraction);
6117
+ draw(Math.round(progress * 100));
6118
+ if (timeFraction < 1) {
6119
+ requestAnimationFrame(animate);
6120
+ } else {
6121
+ if (typeof _self !== "undefined" && _self !== null && Object.hasOwn(_self, "done") && (typeof _self.done).toLowerCase() === "function") {
6122
+ _self.done.call(_self);
6123
+ }
6124
+ }
6125
+ }, "animate"));
6126
+ }
6127
+ };
6128
+ Package("com.qcobjects.effects.base", [
6129
+ Effect
6130
+ ]);
6131
+
6132
+ // src/TransitionEffect.ts
6133
+ init_Logger();
6134
+ init_Package();
6135
+ init_ClassFactory();
6136
+ var TransitionEffect = class extends Effect {
6137
+ static {
6138
+ __name(this, "TransitionEffect");
6139
+ }
6140
+ duration = 385;
6141
+ defaultParams = {
6142
+ alphaFrom: 0,
6143
+ alphaTo: 1,
6144
+ angleFrom: 180,
6145
+ angleTo: 0,
6146
+ radiusFrom: 0,
6147
+ radiusTo: 30,
6148
+ scaleFrom: 0,
6149
+ scaleTo: 1
6150
+ };
6151
+ fitToHeight = false;
6152
+ fitToWidth = false;
6153
+ component;
6154
+ effects;
6155
+ apply({
6156
+ alphaFrom,
6157
+ alphaTo,
6158
+ angleFrom,
6159
+ angleTo,
6160
+ radiusFrom,
6161
+ radiusTo,
6162
+ scaleFrom,
6163
+ scaleTo
6164
+ }) {
6165
+ const _transition_ = this;
6166
+ logger.info("EXECUTING TransitionEffect ");
6167
+ const componentRoot = _transition_.component.componentRoot;
6168
+ if (typeof componentRoot !== "undefined" && componentRoot !== null) {
6169
+ if (_transition_.fitToHeight) {
6170
+ componentRoot.height = typeof componentRoot.offsetParent === "object" && componentRoot.offsetParent !== null ? componentRoot.offsetParent?.scrollHeight : componentRoot.getBoundingClientRect().height;
6171
+ }
6172
+ if (_transition_.fitToWidth) {
6173
+ componentRoot.width = typeof componentRoot.offsetParent === "object" && componentRoot.offsetParent !== null ? componentRoot.offsetParent?.scrollWidth : componentRoot.getBoundingClientRect().width;
6174
+ }
6175
+ if (_transition_.component.shadowed) {
6176
+ componentRoot.host.style.display = "block";
6177
+ } else {
6178
+ componentRoot.style.display = "block";
6179
+ }
6180
+ _transition_.effects.map((effectClassName) => {
6181
+ const __effectClass__ = ClassFactory(effectClassName);
6182
+ const effectObj = new __effectClass__({});
6183
+ const effectClassMethod = effectObj.apply.bind(_transition_);
6184
+ const componentHost = _transition_.component.shadowed ? componentRoot.host : componentRoot;
6185
+ const effectParams = {
6186
+ alphaFrom,
6187
+ alphaTo,
6188
+ angleFrom,
6189
+ angleTo,
6190
+ radiusFrom,
6191
+ radiusTo,
6192
+ scaleFrom,
6193
+ scaleTo
6194
+ };
6195
+ effectClassMethod(componentHost, ...Object.values(effectParams));
6196
+ return effectClassName;
6197
+ });
6198
+ }
6199
+ }
6200
+ };
6201
+ Package("com.qcobjects.effects.transitions.base", [
6202
+ TransitionEffect
6203
+ ]);
6204
+
6205
+ // src/Timer.ts
6206
+ init_InheritClass();
6207
+ init_Package();
6208
+ var Timer = class extends InheritClass {
6209
+ static {
6210
+ __name(this, "Timer");
6211
+ }
6212
+ duration = 1e3;
6213
+ alive = true;
6214
+ thread({
6215
+ timing,
6216
+ intervalInterceptor,
6217
+ duration
6218
+ }) {
6219
+ const timer = this;
6220
+ const start = performance.now();
6221
+ requestAnimationFrame(/* @__PURE__ */ __name(function thread(time) {
6222
+ const elapsed = time - start;
6223
+ let timeFraction = elapsed / duration;
6224
+ if (timeFraction > 1) timeFraction = 1;
6225
+ const progress = timing(timeFraction, elapsed);
6226
+ intervalInterceptor(Math.round(progress * 100));
6227
+ if ((timeFraction < 1 || duration === -1) && timer.alive) {
6228
+ requestAnimationFrame(thread);
6229
+ }
6230
+ }, "thread"));
6231
+ }
6232
+ };
6233
+ Package("com.qcobjects.timing", [
6234
+ Timer
6235
+ ]);
6236
+
6237
+ // src/QCObjects.ts
6238
+ init_tag_filter();
6239
+ init_range();
6240
+ init_ArrayCollection();
6241
+
6242
+ // src/DDO.ts
6243
+ init_Export();
6244
+ init_InheritClass();
6245
+ init_Logger();
6246
+ init_ObjectName();
6247
+ var DDO = class extends InheritClass {
6248
+ static {
6249
+ __name(this, "DDO");
6250
+ }
6251
+ constructor({
6252
+ instance,
6253
+ name,
6254
+ fget,
6255
+ fset,
6256
+ value
6257
+ }) {
6258
+ super({
6259
+ instance,
6260
+ name,
6261
+ fget,
6262
+ fset,
6263
+ value
6264
+ });
6265
+ this._new_({
6266
+ instance,
6267
+ name,
6268
+ fget,
6269
+ fset,
6270
+ value
6271
+ });
6272
+ }
6273
+ _new_({
6274
+ instance,
6275
+ name,
6276
+ fget,
6277
+ fset
6278
+ }) {
6279
+ const ddoInstance = this;
6280
+ var name = typeof name === "undefined" ? ObjectName(ddoInstance) : name;
6281
+ Object.defineProperty(instance, name, {
6282
+ set(val) {
6283
+ const _value = val;
6284
+ logger.debug("value changed " + name);
6285
+ let ret;
6286
+ if (typeof fset !== "undefined" && typeof fset === "function") {
6287
+ ret = fset(_value);
6288
+ } else {
6289
+ ret = _value;
6290
+ }
6291
+ instance["_" + name] = ret;
6292
+ },
6293
+ get() {
6294
+ const _value = instance["_" + name];
6295
+ logger.debug("returning value " + name);
6296
+ const is_ddo = /* @__PURE__ */ __name((v) => {
6297
+ if (typeof v === "object" && Object.hasOwn(v, "value")) {
6298
+ return v.value;
6299
+ }
6300
+ return v;
6301
+ }, "is_ddo");
6302
+ let ret;
6303
+ if (typeof fget !== "undefined" && typeof fget === "function") {
6304
+ ret = fget(is_ddo(_value));
6305
+ } else {
6306
+ ret = is_ddo(_value);
6307
+ }
6308
+ return ret;
6309
+ }
6310
+ });
6311
+ }
6312
+ };
6313
+ Export(DDO);
6314
+
6315
+ // src/Toggle.ts
6316
+ init_InheritClass();
6317
+ init_Logger();
6318
+ init_Package();
6319
+ var Toggle = class extends InheritClass {
6320
+ static {
6321
+ __name(this, "Toggle");
6322
+ }
6323
+ _toggle = false;
6324
+ _inverse = true;
6325
+ _positive = null;
6326
+ _negative = null;
6327
+ _dispatched = null;
6328
+ _args = {};
6329
+ constructor(positive, negative, args) {
6330
+ super({ positive, negative, args });
6331
+ this._new_({ positive, negative, args });
6332
+ }
6333
+ changeToggle() {
6334
+ this._toggle = !this._toggle;
6335
+ }
6336
+ _new_({
6337
+ positive,
6338
+ negative,
6339
+ args
6340
+ }) {
6341
+ this._positive = positive;
6342
+ this._negative = negative;
6343
+ this._args = args;
6344
+ }
6345
+ fire() {
6346
+ const toggle = this;
6347
+ var _promise = new Promise(function(resolve, reject) {
6348
+ if (typeof toggle._positive === "function" && typeof toggle._negative === "function") {
6349
+ if (toggle._inverse) {
6350
+ toggle._dispatched = toggle._toggle ? toggle._negative.bind(toggle) : toggle._positive.bind(toggle);
6351
+ } else {
6352
+ toggle._dispatched = toggle._toggle ? toggle._positive.bind(toggle) : toggle._negative.bind(toggle);
6353
+ }
6354
+ toggle._dispatched?.call(toggle, toggle._args);
6355
+ resolve.call(_promise, toggle);
6356
+ } else {
6357
+ logger.debug("Toggle functions are not declared");
6358
+ reject.call(_promise, toggle);
6359
+ }
6360
+ return toggle;
6361
+ }).then(function(toggle2) {
6362
+ toggle2.changeToggle();
6363
+ return toggle2;
6364
+ }).catch(function(e) {
6365
+ logger.debug(e.toString());
6366
+ return toggle;
6367
+ }).finally(() => {
6368
+ return toggle;
6369
+ });
6370
+ return _promise;
6371
+ }
6372
+ };
6373
+ Package("com.qcobjects.tools.essentials", [
6374
+ Toggle
6375
+ ]);
6376
+
6377
+ // src/QCObjects.ts
6378
+ init_findPackageNodePath();
6582
6379
 
6583
- // src/index.cts
6584
- var QCObjects2 = (init_QCObjects(), __toCommonJS(QCObjects_exports));
6585
- module.exports = QCObjects2;
6586
- //# sourceMappingURL=index.cjs.map
6380
+ // src/DocumentLayout.ts
6381
+ var getDocumentLayout = /* @__PURE__ */ __name(function() {
6382
+ const h = /* @__PURE__ */ __name((w, h2) => {
6383
+ return w > h2 ? "landscape" : null;
6384
+ }, "h");
6385
+ const v = /* @__PURE__ */ __name((w, h2) => {
6386
+ return h2 > w ? "portrait" : null;
6387
+ }, "v");
6388
+ const square = /* @__PURE__ */ __name((w, h2) => {
6389
+ return w === h2 ? "square" : null;
6390
+ }, "square");
6391
+ return [
6392
+ h(document.documentElement.clientWidth, document.documentElement.clientHeight),
6393
+ v(document.documentElement.clientWidth, document.documentElement.clientHeight),
6394
+ square(document.documentElement.clientWidth, document.documentElement.clientHeight)
6395
+ ].filter((e) => e !== null).pop();
6396
+ }, "getDocumentLayout");
6397
+
6398
+ // src/QCObjects.ts
6399
+ init_mathFunctions();
6400
+ init_top();
6401
+ init_make_global();
6402
+ init_top();
6403
+ var QCObjects = __toESM(require_MainProcess());
6404
+ export {
6405
+ ArrayCollection,
6406
+ ArrayList,
6407
+ AssignPolyfill,
6408
+ BackendMicroservice,
6409
+ CONFIG,
6410
+ Class,
6411
+ ClassFactory,
6412
+ ComplexStorageCache,
6413
+ Component,
6414
+ ComponentURI,
6415
+ ConfigService,
6416
+ Controller,
6417
+ DDO,
6418
+ DefaultTemplateHandler,
6419
+ Effect,
6420
+ Export,
6421
+ GlobalSettings,
6422
+ Import,
6423
+ InheritClass,
6424
+ JSONService,
6425
+ Logger,
6426
+ NamespaceRef,
6427
+ New,
6428
+ ObjectName,
6429
+ Package,
6430
+ Processor,
6431
+ QCObjects,
6432
+ Ready,
6433
+ RegisterClass,
6434
+ RegisterWidget,
6435
+ RegisterWidgets,
6436
+ Service,
6437
+ SourceCSS,
6438
+ SourceJS,
6439
+ Tag,
6440
+ TagElements,
6441
+ Timer,
6442
+ Toggle,
6443
+ TransitionEffect,
6444
+ VO,
6445
+ View,
6446
+ _Cast,
6447
+ _CastProps,
6448
+ _ComponentWidget_,
6449
+ _Crypt,
6450
+ _DOMCreateElement,
6451
+ _DataStringify,
6452
+ _LegacyCopy,
6453
+ _QC_CLASSES,
6454
+ _QC_PACKAGES,
6455
+ _QC_PACKAGES_IMPORTED,
6456
+ _QC_READY_LISTENERS,
6457
+ _Ready,
6458
+ __getType__,
6459
+ __instanceID,
6460
+ __is_raw_class__,
6461
+ __make_global__,
6462
+ __to_number,
6463
+ _buildComponentsFromElements_,
6464
+ _fireAsyncLoad,
6465
+ _methods_,
6466
+ _protected_code_,
6467
+ _require_,
6468
+ _super_,
6469
+ _tag_filter_,
6470
+ _top,
6471
+ asyncLoad,
6472
+ captureFalseTouch,
6473
+ componentLoader,
6474
+ findPackageNodePath,
6475
+ get,
6476
+ getDocumentLayout,
6477
+ _top as global,
6478
+ isBrowser,
6479
+ isNodeCommonJS,
6480
+ isQCObjects_Class,
6481
+ isQCObjects_Object,
6482
+ is_a,
6483
+ is_phonegap,
6484
+ logger,
6485
+ range,
6486
+ ready,
6487
+ resetTop,
6488
+ serviceLoader,
6489
+ set,
6490
+ setDefaultProcessors,
6491
+ shortCode,
6492
+ subelements,
6493
+ waitUntil
6494
+ };
6495
+ //# sourceMappingURL=QCObjects.mjs.map