1System.register(['axios', 'vue', '@Obsidian/Libs/pluralize', 'luxon', '@Obsidian/Enums/Controls/dayOfWeek', 'mitt', '@Obsidian/Enums/Controls/controlLazyMode', '@Obsidian/Enums/Controls/pickerDisplayStyle', '@Obsidian/Libs/liquidjs', '@Obsidian/Libs/big', '@Obsidian/Enums/Controls/slidingDateRangeType', '@Obsidian/Enums/Controls/timeUnitType', '@Obsidian/Enums/Controls/mergeTemplateOwnership'], (function (exports) { 2 'use strict'; 3 var axios, provide, getCurrentInstance, inject, ref, watch, nextTick, defineAsyncComponent$1, reactive, createVNode, render, onMounted, onUnmounted, Pluralize, FixedOffsetZone, DateTime, DayOfWeek, mitt, ControlLazyMode, PickerDisplayStyle, Liquid, Big, SlidingDateRangeType, TimeUnitType, MergeTemplateOwnership; 4 return { 5 setters: [function (module) { 6 axios = module.default; 7 }, function (module) { 8 provide = module.provide; 9 getCurrentInstance = module.getCurrentInstance; 10 inject = module.inject; 11 ref = module.ref; 12 watch = module.watch; 13 nextTick = module.nextTick; 14 defineAsyncComponent$1 = module.defineAsyncComponent; 15 reactive = module.reactive; 16 createVNode = module.createVNode; 17 render = module.render; 18 onMounted = module.onMounted; 19 onUnmounted = module.onUnmounted; 20 }, function (module) { 21 Pluralize = module.Pluralize; 22 }, function (module) { 23 FixedOffsetZone = module.FixedOffsetZone; 24 DateTime = module.DateTime; 25 }, function (module) { 26 DayOfWeek = module.DayOfWeek; 27 }, function (module) { 28 mitt = module.default; 29 }, function (module) { 30 ControlLazyMode = module.ControlLazyMode; 31 }, function (module) { 32 PickerDisplayStyle = module.PickerDisplayStyle; 33 }, function (module) { 34 Liquid = module.Liquid; 35 }, function (module) { 36 Big = module.default; 37 }, function (module) { 38 SlidingDateRangeType = module.SlidingDateRangeType; 39 }, function (module) { 40 TimeUnitType = module.TimeUnitType; 41 }, function (module) { 42 MergeTemplateOwnership = module.MergeTemplateOwnership; 43 }], 44 execute: (function () { 45 46 function _iterableToArrayLimit(r, l) { 47 var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; 48 if (null != t) { 49 var e, 50 n, 51 i, 52 u, 53 a = [], 54 f = !0, 55 o = !1; 56 try { 57 if (i = (t = t.call(r)).next, 0 === l) { 58 if (Object(t) !== t) return; 59 f = !1; 60 } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); 61 } catch (r) { 62 o = !0, n = r; 63 } finally { 64 try { 65 if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; 66 } finally { 67 if (o) throw n; 68 } 69 } 70 return a; 71 } 72 } 73 function ownKeys(e, r) { 74 var t = Object.keys(e); 75 if (Object.getOwnPropertySymbols) { 76 var o = Object.getOwnPropertySymbols(e); 77 r && (o = o.filter(function (r) { 78 return Object.getOwnPropertyDescriptor(e, r).enumerable; 79 })), t.push.apply(t, o); 80 } 81 return t; 82 } 83 function _objectSpread2(e) { 84 for (var r = 1; r < arguments.length; r++) { 85 var t = null != arguments[r] ? arguments[r] : {}; 86 r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { 87 _defineProperty(e, r, t[r]); 88 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { 89 Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); 90 }); 91 } 92 return e; 93 } 94 function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { 95 try { 96 var info = gen[key](arg); 97 var value = info.value; 98 } catch (error) { 99 reject(error); 100 return; 101 } 102 if (info.done) { 103 resolve(value); 104 } else { 105 Promise.resolve(value).then(_next, _throw); 106 } 107 } 108 function _asyncToGenerator(fn) { 109 return function () { 110 var self = this, 111 args = arguments; 112 return new Promise(function (resolve, reject) { 113 var gen = fn.apply(self, args); 114 function _next(value) { 115 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); 116 } 117 function _throw(err) { 118 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); 119 } 120 _next(undefined); 121 }); 122 }; 123 } 124 function _defineProperty(obj, key, value) { 125 key = _toPropertyKey(key); 126 if (key in obj) { 127 Object.defineProperty(obj, key, { 128 value: value, 129 enumerable: true, 130 configurable: true, 131 writable: true 132 }); 133 } else { 134 obj[key] = value; 135 } 136 return obj; 137 } 138 function _slicedToArray(arr, i) { 139 return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); 140 } 141 function _arrayWithHoles(arr) { 142 if (Array.isArray(arr)) return arr; 143 } 144 function _unsupportedIterableToArray(o, minLen) { 145 if (!o) return; 146 if (typeof o === "string") return _arrayLikeToArray(o, minLen); 147 var n = Object.prototype.toString.call(o).slice(8, -1); 148 if (n === "Object" && o.constructor) n = o.constructor.name; 149 if (n === "Map" || n === "Set") return Array.from(o); 150 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); 151 } 152 function _arrayLikeToArray(arr, len) { 153 if (len == null || len > arr.length) len = arr.length; 154 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; 155 return arr2; 156 } 157 function _nonIterableRest() {
158 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 159 } 160 function _createForOfIteratorHelper(o, allowArrayLike) { 161 var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; 162 if (!it) { 163 if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { 164 if (it) o = it; 165 var i = 0; 166 var F = function () {}; 167 return { 168 s: F, 169 n: function () { 170 if (i >= o.length) return { 171 done: true 172 }; 173 return { 174 done: false, 175 value: o[i++] 176 }; 177 }, 178 e: function (e) { 179 throw e; 180 }, 181 f: F 182 }; 183 } 184 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 185 } 186 var normalCompletion = true, 187 didErr = false, 188 err; 189 return { 190 s: function () { 191 it = it.call(o); 192 }, 193 n: function () { 194 var step = it.next(); 195 normalCompletion = step.done; 196 return step; 197 }, 198 e: function (e) { 199 didErr = true; 200 err = e; 201 }, 202 f: function () { 203 try { 204 if (!normalCompletion && it.return != null) it.return(); 205 } finally { 206 if (didErr) throw err; 207 } 208 } 209 }; 210 } 211 function _toPrimitive(input, hint) { 212 if (typeof input !== "object" || input === null) return input; 213 var prim = input[Symbol.toPrimitive]; 214 if (prim !== undefined) { 215 var res = prim.call(input, hint || "default"); 216 if (typeof res !== "object") return res; 217 throw new TypeError("@@toPrimitive must return a primitive value."); 218 } 219 return (hint === "string" ? String : Number)(input); 220 } 221 function _toPropertyKey(arg) { 222 var key = _toPrimitive(arg, "string"); 223 return typeof key === "symbol" ? key : String(key); 224 } 225 226 function doApiCallRaw(_x, _x2, _x3, _x4, _x5) { 227 return _doApiCallRaw.apply(this, arguments); 228 } 229 function _doApiCallRaw() { 230 _doApiCallRaw = _asyncToGenerator(function* (method, url, params, data, cancellationToken) { 231 return yield axios({ 232 method, 233 url, 234 params, 235 data, 236 signal: getSignal(cancellationToken) 237 }); 238 }); 239 return _doApiCallRaw.apply(this, arguments); 240 } 241 function getSignal(cancellationToken) { 242 if (cancellationToken) { 243 var controller = new AbortController(); 244 cancellationToken.onCancellationRequested(() => { 245 if (controller && controller.signal && !controller.signal.aborted) { 246 controller.abort(); 247 } 248 }); 249 return controller.signal; 250 } 251 } 252 function doApiCall(_x6, _x7) { 253 return _doApiCall.apply(this, arguments); 254 } 255 function _doApiCall() { 256 _doApiCall = _asyncToGenerator(function* (method, url) { 257 var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; 258 var data = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined; 259 var cancellationToken = arguments.length > 4 ? arguments[4] : undefined; 260 try { 261 var result = yield doApiCallRaw(method, url, params, data, cancellationToken); 262 return { 263 data: result.data, 264 isError: false, 265 isSuccess: true, 266 statusCode: result.status, 267 errorMessage: null 268 }; 269 } catch (e) { 270 if (axios.isAxiosError(e)) { 271 var _e$response, _e$response2, _e$response$status, _e$response4; 272 if ((_e$response = e.response) !== null && _e$response !== void 0 && (_e$response = _e$response.data) !== null && _e$response !== void 0 && _e$response.Message || e !== null && e !== void 0 && (_e$response2 = e.response) !== null && _e$response2 !== void 0 && (_e$response2 = _e$response2.data) !== null && _e$response2 !== void 0 && _e$response2.message) { 273 var _e$response$data$Mess, _e$response3; 274 return { 275 data: null, 276 isError: true, 277 isSuccess: false, 278 statusCode: e.response.status, 279 errorMessage: (_e$response$data$Mess = e === null || e === void 0 || (_e$response3 = e.response) === null || _e$response3 === void 0 || (_e$response3 = _e$response3.data) === null || _e$response3 === void 0 ? void 0 : _e$response3.Message) !== null && _e$response$data$Mess !== void 0 ? _e$response$data$Mess : e.response.data.message 280 }; 281 } 282 return { 283 data: null, 284 isError: true, 285 isSuccess: false, 286 statusCode: (_e$response$status = (_e$response4 = e.response) === null || _e$response4 === void 0 ? void 0 : _e$response4.status) !== null && _e$response$status !== void 0 ? _e$response$status : 0, 287 errorMessage: null 288 }; 289 } else { 290 return { 291 data: null, 292 isError: true, 293 isSuccess: false, 294 statusCode: 0, 295 errorMessage: null 296 }; 297 } 298 } 299 }); 300 return _doApiCall.apply(this, arguments); 301 } 302 function get$1(_x8) { 303 return _get.apply(this, arguments); 304 } 305 function _get() { 306 _get = _asyncToGenerator(function* (url) { 307 var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; 308 return yield doApiCall("GET", url, params, undefined); 309 }); 310 return _get.apply(this, arguments); 311 } 312 function post(_x9) { 313 return _post.apply(this, arguments); 314 } 315 function _post() { 316 _post = _asyncToGenerator(function* (url) { 317 var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; 318 var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; 319 var cancellationToken = arguments.length > 3 ? arguments[3] : undefined; 320 return yield doApiCall("POST", url, params, data, cancellationToken); 321 }); 322 return _post.apply(this, arguments); 323 } 324 var httpFunctionsSymbol = Symbol("http-functions"); 325 function provideHttp(functions) { 326 provide(httpFunctionsSymbol, functions); 327 } 328 function useHttp() { 329 var http; 330 if (getCurrentInstance()) { 331 http = inject(httpFunctionsSymbol); 332 } 333 return http || { 334 doApiCall: doApiCall, 335 get: get$1, 336 post: post 337 }; 338 } 339 function createApiCaller(options) { 340 var fetchFunction = useHttp()[(options.method || "post").toLowerCase()]; 341 var isLoading = ref(false); 342 var hasError = ref(false); 343 var errorMessage = ref(); 344 return { 345 isLoading, 346 hasError, 347 errorMessage, 348 run() { 349 var _arguments = arguments; 350 return _asyncToGenerator(function* () { 351 isLoading.value = true; 352 hasError.value = false;
353 errorMessage.value = undefined; 354 for (var _len = _arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 355 args[_key] = _arguments[_key]; 356 } 357 var params = typeof options.params === "function" ? options.params(...args) : options.params; 358 var data = typeof options.data === "function" ? options.data(...args) : options.data; 359 try { 360 var result = yield fetchFunction(options.url, params, data); 361 if (result.isSuccess) { 362 if (typeof options.onComplete === "function") { 363 options.onComplete(result.data, ...args); 364 } 365 return result.data; 366 } else { 367 var _result$errorMessage; 368 hasError.value = true; 369 errorMessage.value = (_result$errorMessage = result.errorMessage) !== null && _result$errorMessage !== void 0 ? _result$errorMessage : undefined; 370 } 371 } catch (e) { 372 hasError.value = true; 373 if (e instanceof Error) { 374 errorMessage.value = e.message; 375 } else if (typeof e === "string") { 376 errorMessage.value = e; 377 } else { 378 errorMessage.value = "An unknown error occurred."; 379 } 380 } finally { 381 isLoading.value = false; 382 } 383 })(); 384 } 385 }; 386 } 387 function uploadFile(_x10, _x11, _x12) { 388 return _uploadFile.apply(this, arguments); 389 } 390 function _uploadFile() { 391 _uploadFile = _asyncToGenerator(function* (url, data, progress) { 392 var result; 393 try { 394 result = yield axios.post(url, data, { 395 headers: { 396 "Content-Type": "multipart/form-data" 397 }, 398 onUploadProgress: event => { 399 if (progress && event.total !== undefined) { 400 progress(event.loaded, event.total, Math.floor(event.loaded * 100 / event.total)); 401 } 402 } 403 }); 404 } catch (e) { 405 result = e.response; 406 } 407 if (!result) { 408 throw new Error("Upload failed."); 409 } 410 if (result.status === 200 && typeof result.data === "object") { 411 return result.data; 412 } 413 if (result.status === 406) { 414 throw new Error("File type is not allowed."); 415 } 416 if (typeof result.data === "string") { 417 throw new Error(result.data); 418 } 419 throw new Error("Upload failed."); 420 }); 421 return _uploadFile.apply(this, arguments); 422 } 423 function uploadContentFile(_x13, _x14, _x15, _x16) { 424 return _uploadContentFile.apply(this, arguments); 425 } 426 function _uploadContentFile() { 427 _uploadContentFile = _asyncToGenerator(function* (file, encryptedRootFolder, folderPath, options) { 428 var _options$baseUrl; 429 var url = "".concat((_options$baseUrl = options === null || options === void 0 ? void 0 : options.baseUrl) !== null && _options$baseUrl !== void 0 ? _options$baseUrl : "/FileUploader.ashx", "?rootFolder=").concat(encodeURIComponent(encryptedRootFolder)); 430 var formData = new FormData(); 431 formData.append("file", file); 432 if (folderPath) { 433 formData.append("folderPath", folderPath); 434 } 435 var result = yield uploadFile(url, formData, options === null || options === void 0 ? void 0 : options.progress); 436 return { 437 value: "", 438 text: result.FileName 439 }; 440 }); 441 return _uploadContentFile.apply(this, arguments); 442 } 443 function uploadAssetProviderFile(_x17, _x18, _x19, _x20) { 444 return _uploadAssetProviderFile.apply(this, arguments); 445 } 446 function _uploadAssetProviderFile() { 447 _uploadAssetProviderFile = _asyncToGenerator(function* (file, folderPath, assetStorageId, options) { 448 var _options$baseUrl2; 449 var url = "".concat((_options$baseUrl2 = options === null || options === void 0 ? void 0 : options.baseUrl) !== null && _options$baseUrl2 !== void 0 ? _options$baseUrl2 : "/FileUploader.ashx", "?rootFolder="); 450 var formData = new FormData(); 451 if (!assetStorageId) { 452 throw "Asset Storage Id and Key are required."; 453 } 454 formData.append("file", file); 455 formData.append("StorageId", assetStorageId); 456 formData.append("Key", folderPath); 457 formData.append("IsAssetStorageProviderAsset", "true"); 458 var result = yield uploadFile(url, formData, options === null || options === void 0 ? void 0 : options.progress); 459 return { 460 value: "", 461 text: result.FileName 462 }; 463 }); 464 return _uploadAssetProviderFile.apply(this, arguments); 465 } 466 function uploadBinaryFile(_x21, _x22, _x23) { 467 return _uploadBinaryFile.apply(this, arguments); 468 } 469 function _uploadBinaryFile() { 470 _uploadBinaryFile = _asyncToGenerator(function* (file, binaryFileTypeGuid, options) { 471 var _options$baseUrl3; 472 var url = "".concat((_options$baseUrl3 = options === null || options === void 0 ? void 0 : options.baseUrl) !== null && _options$baseUrl3 !== void 0 ? _options$baseUrl3 : "/FileUploader.ashx", "?isBinaryFile=True&fileTypeGuid=").concat(binaryFileTypeGuid); 473 if ((options === null || options === void 0 ? void 0 : options.isTemporary) === false) { 474 url += "&isTemporary=False"; 475 } else { 476 url += "&isTemporary=True"; 477 } 478 if (options !== null && options !== void 0 && options.parentEntityTypeId) { 479 url += "&ParentEntityTypeId=" + options.parentEntityTypeId; 480 } 481 if (options !== null && options !== void 0 && options.parentEntityId) { 482 url += "&ParentEntityId=" + options.parentEntityId; 483 } 484 if (options !== null && options !== void 0 && options.securityGrantToken) { 485 url += "&SecurityGrantToken=" + encodeURIComponent(options.securityGrantToken); 486 } 487 var formData = new FormData(); 488 formData.append("file", file); 489 var result = yield uploadFile(url, formData, options === null || options === void 0 ? void 0 : options.progress); 490 return { 491 value: result.Guid, 492 text: result.FileName 493 }; 494 }); 495 return _uploadBinaryFile.apply(this, arguments); 496 } 497 var http$1 = { 498 doApiCall, 499 post, 500 get: get$1 501 }; 502 503 var http$2 = /*#__PURE__*/Object.freeze({ 504 __proto__: null, 505 createApiCaller: createApiCaller, 506 default: http$1, 507 doApiCall: doApiCall, 508 get: get$1, 509 post: post, 510 provideHttp: provideHttp, 511 uploadAssetProviderFile: uploadAssetProviderFile, 512 uploadBinaryFile: uploadBinaryFile, 513 uploadContentFile: uploadContentFile, 514 useHttp: useHttp 515 }); 516 exports('http', http$2); 517 518 function getDefaultAddressControlModel() { 519 return { 520 state: "AZ", 521 country: "US" 522 }; 523 } 524 function validateAddress(address) { 525 var post = useHttp().post; 526 return post("/api/v2/Controls/AddressControlValidateAddress", undefined, address); 527 } 528 function getAddressString(address) { 529 var post = useHttp().post; 530 return post("/api/v2/Controls/AddressControlGetStreetAddressString", undefined, address); 531 } 532 533 var address = /*#__PURE__*/Object.freeze({ 534 __proto__: null, 535 getAddressString: getAddressString, 536 getDefaultAddressControlModel: getDefaultAddressControlModel, 537 validateAddress: validateAddress 538 }); 539 exports('address', address); 540 541 function flatten(arr) { 542 var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; 543 var result = [];
544 var forEach = result.forEach; 545 var flatDeep = function flatDeep(arr, depth) { 546 forEach.call(arr, function (val) { 547 if (depth > 0 && Array.isArray(val)) { 548 flatDeep(val, depth - 1); 549 } else { 550 result.push(val); 551 } 552 }); 553 }; 554 flatDeep(arr, depth); 555 return result; 556 } 557 function forceToArray(value, multiple) { 558 if (value === undefined || value === null) { 559 return []; 560 } else if (Array.isArray(value)) { 561 if (!multiple && value.length > 1) { 562 return [value[0]]; 563 } else { 564 return value; 565 } 566 } else { 567 return [value]; 568 } 569 } 570 571 var arrayUtils = /*#__PURE__*/Object.freeze({ 572 __proto__: null, 573 flatten: flatten, 574 forceToArray: forceToArray 575 }); 576 exports('arrayUtils', arrayUtils); 577 578 var moreThanOneElement = "More than one element was found in collection."; 579 var noElementsFound = "No element was found in collection."; 580 function valueComparer(keySelector, descending) { 581 return (a, b) => { 582 var valueA = keySelector(a); 583 var valueB = keySelector(b); 584 if (valueA === undefined || valueA === null) { 585 if (valueB === undefined || valueB === null) { 586 return 0; 587 } 588 return !descending ? -1 : 1; 589 } 590 if (valueB === undefined || valueB === null) { 591 return !descending ? 1 : -1; 592 } 593 if (valueA > valueB) { 594 return !descending ? 1 : -1; 595 } else if (valueA < valueB) { 596 return !descending ? -1 : 1; 597 } else { 598 return 0; 599 } 600 }; 601 } 602 class List { 603 constructor(elements) { 604 if (elements === undefined) { 605 this.elements = []; 606 } else { 607 this.elements = [...elements]; 608 } 609 } 610 static fromArrayNoCopy(elements) { 611 var list = new List(); 612 list.elements = elements; 613 return list; 614 } 615 any(predicate) { 616 var elements = this.elements; 617 if (predicate !== undefined) { 618 elements = elements.filter(predicate); 619 } 620 return elements.length > 0; 621 } 622 first(predicate) { 623 var elements = this.elements; 624 if (predicate !== undefined) { 625 elements = elements.filter(predicate); 626 } 627 if (elements.length >= 1) { 628 return elements[0]; 629 } else { 630 throw noElementsFound; 631 } 632 } 633 firstOrUndefined(predicate) { 634 var elements = this.elements; 635 if (predicate !== undefined) { 636 elements = elements.filter(predicate); 637 } 638 if (elements.length === 1) { 639 return elements[0]; 640 } else { 641 return undefined; 642 } 643 } 644 lastOrUndefined(predicate) { 645 var elements = this.elements; 646 if (predicate !== undefined) { 647 elements = elements.filter(predicate); 648 } 649 if (elements.length) { 650 return elements[elements.length - 1]; 651 } else { 652 return undefined; 653 } 654 } 655 single(predicate) { 656 var elements = this.elements; 657 if (predicate !== undefined) { 658 elements = elements.filter(predicate); 659 } 660 if (elements.length === 1) { 661 return elements[0]; 662 } else { 663 throw moreThanOneElement; 664 } 665 } 666 singleOrUndefined(predicate) { 667 var elements = this.elements; 668 if (predicate !== undefined) { 669 elements = elements.filter(predicate); 670 } 671 if (elements.length === 0) { 672 return undefined; 673 } else if (elements.length === 1) { 674 return elements[0]; 675 } else { 676 throw moreThanOneElement; 677 } 678 } 679 orderBy(keySelector) { 680 var comparer = valueComparer(keySelector, false); 681 return new OrderedList(this.elements, comparer); 682 } 683 orderByDescending(keySelector) { 684 var comparer = valueComparer(keySelector, true); 685 return new OrderedList(this.elements, comparer); 686 } 687 where(predicate) { 688 return new List(this.elements.filter(predicate)); 689 } 690 toArray() { 691 return [...this.elements]; 692 } 693 } 694 class OrderedList extends List { 695 constructor(elements, baseComparer) { 696 super(elements); 697 this.baseComparer = baseComparer; 698 this.elements.sort(this.baseComparer); 699 } 700 thenBy(keySelector) { 701 var comparer = valueComparer(keySelector, false); 702 return new OrderedList(this.elements, (a, b) => this.baseComparer(a, b) || comparer(a, b)); 703 } 704 thenByDescending(keySelector) { 705 var comparer = valueComparer(keySelector, true); 706 return new OrderedList(this.elements, (a, b) => this.baseComparer(a, b) || comparer(a, b)); 707 } 708 } 709 class Enumerable { 710 constructor(iterableFactory) { 711 this.iterableFactory = iterableFactory; 712 } 713 static from(source) { 714 if (typeof source === "function") { 715 return new Enumerable(source); 716 } else { 717 return new Enumerable(() => source); 718 } 719 } 720 *[Symbol.iterator]() { 721 yield* this.iterableFactory(); 722 } 723 where(predicate) { 724 var self = this; 725 return new Enumerable(function* () { 726 var _iterator = _createForOfIteratorHelper(self), 727 _step; 728 try { 729 for (_iterator.s();
729 !(_step = _iterator.n()).done;) { 730 var _item = _step.value; 731 if (predicate(_item)) { 732 yield _item; 733 } 734 } 735 } catch (err) { 736 _iterator.e(err); 737 } finally { 738 _iterator.f(); 739 } 740 }); 741 } 742 select(selector) { 743 var self = this; 744 return new Enumerable(function* () { 745 var _iterator2 = _createForOfIteratorHelper(self), 746 _step2; 747 try { 748 for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { 749 var _item2 = _step2.value; 750 yield selector(_item2); 751 } 752 } catch (err) { 753 _iterator2.e(err); 754 } finally { 755 _iterator2.f(); 756 } 757 }); 758 } 759 skip(count) { 760 var self = this; 761 return new Enumerable(function* () { 762 var skipped = 0; 763 var _iterator3 = _createForOfIteratorHelper(self), 764 _step3; 765 try { 766 for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { 767 var _item3 = _step3.value; 768 if (skipped++ >= count) { 769 yield _item3; 770 } 771 } 772 } catch (err) { 773 _iterator3.e(err); 774 } finally { 775 _iterator3.f(); 776 } 777 }); 778 } 779 take(count) { 780 var self = this; 781 return new Enumerable(function* () { 782 var i = 0; 783 var _iterator4 = _createForOfIteratorHelper(self), 784 _step4; 785 try { 786 for (_iterator4.s();
786 !(_step4 = _iterator4.n()).done;) { 787 var _item4 = _step4.value; 788 if (i++ < count) { 789 yield _item4; 790 } else { 791 break; 792 } 793 } 794 } catch (err) { 795 _iterator4.e(err); 796 } finally { 797 _iterator4.f(); 798 } 799 }); 800 } 801 firstOrDefault(defaultValue) { 802 var _iterator5 = _createForOfIteratorHelper(this), 803 _step5; 804 try { 805 for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) { 806 var _item5 = _step5.value; 807 return _item5; 808 } 809 } catch (err) { 810 _iterator5.e(err); 811 } finally { 812 _iterator5.f(); 813 } 814 return defaultValue; 815 } 816 lastOrDefault(defaultValue) { 817 var last = defaultValue; 818 var _iterator6 = _createForOfIteratorHelper(this), 819 _step6; 820 try { 821 for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) { 822 var _item6 = _step6.value; 823 last = _item6; 824 } 825 } catch (err) { 826 _iterator6.e(err); 827 } finally { 828 _iterator6.f(); 829 } 830 return last; 831 } 832 aggregate(accumulator, seed) { 833 var result = seed; 834 var index = 0; 835 var _iterator7 = _createForOfIteratorHelper(this), 836 _step7; 837 try { 838 for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) { 839 var _item7 = _step7.value; 840 result = accumulator(result, _item7, index++); 841 } 842 } catch (err) { 843 _iterator7.e(err); 844 } finally { 845 _iterator7.f(); 846 } 847 return result; 848 } 849 any(predicate) { 850 var _iterator8 = _createForOfIteratorHelper(this), 851 _step8; 852 try { 853 for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) { 854 var _item8 = _step8.value; 855 if (!predicate || predicate(_item8)) { 856 return true; 857 } 858 } 859 } catch (err) { 860 _iterator8.e(err); 861 } finally { 862 _iterator8.f(); 863 } 864 return false; 865 } 866 all(predicate) { 867 var _iterator9 = _createForOfIteratorHelper(this), 868 _step9; 869 try { 870 for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) { 871 var _item9 = _step9.value; 872 if (!predicate(_item9)) { 873 return false; 874 } 875 } 876 } catch (err) { 877 _iterator9.e(err); 878 } finally { 879 _iterator9.f(); 880 } 881 return true; 882 } 883 forEach(action) { 884 var _iterator10 = _createForOfIteratorHelper(this), 885 _step10; 886 try { 887 for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) { 888 var _item10 = _step10.value; 889 action(_item10); 890 } 891 } catch (err) { 892 _iterator10.e(err); 893 } finally { 894 _iterator10.f(); 895 } 896 } 897 toArray() { 898 return Array.from(this); 899 } 900 toList() { 901 return new List(this.toArray()); 902 } 903 orderBy(keySelector) { 904 var comparer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (a, b) => a > b ? 1 : a < b ? -1 : 0; 905 return new OrderedEnumerable(this.iterableFactory, (a, b) => comparer(keySelector(a), keySelector(b))); 906 } 907 orderByDescending(keySelector) { 908 var comparer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (a, b) => a > b ? 1 : a < b ? -1 : 0; 909 var descendingComparer = (a, b) => -comparer(a, b); 910 return this.orderBy(keySelector, descendingComparer); 911 } 912 *withIndex() { 913 var index = 0; 914 var _iterator11 = _createForOfIteratorHelper(this), 915 _step11; 916 try { 917 for (_iterator11.s();
917 !(_step11 = _iterator11.n()).done;) { 918 var _item11 = _step11.value; 919 yield [_item11, index++]; 920 } 921 } catch (err) { 922 _iterator11.e(err); 923 } finally { 924 _iterator11.f(); 925 } 926 } 927 ofType(typeCheck) { 928 var self = this; 929 return new Enumerable(function* () { 930 var _iterator12 = _createForOfIteratorHelper(self), 931 _step12; 932 try { 933 for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) { 934 var _item12 = _step12.value; 935 if (typeCheck(_item12)) { 936 yield _item12; 937 } 938 } 939 } catch (err) { 940 _iterator12.e(err); 941 } finally { 942 _iterator12.f(); 943 } 944 }); 945 } 946 } 947 class OrderedEnumerable extends Enumerable { 948 constructor(iterableFactory, initialComparer) { 949 super(iterableFactory); 950 this.sortComparers = [initialComparer]; 951 } 952 thenOrderBy(keySelector) { 953 var comparer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (a, b) => a > b ? 1 : a < b ? -1 : 0; 954 var self = this; 955 return new OrderedEnumerable(this.iterableFactory, (a, b) => { 956 var _iterator13 = _createForOfIteratorHelper(self.sortComparers), 957 _step13; 958 try { 959 for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) { 960 var cmp = _step13.value; 961 var result = cmp(a, b); 962 if (result !== 0) return result; 963 } 964 } catch (err) { 965 _iterator13.e(err); 966 } finally { 967 _iterator13.f(); 968 } 969 return comparer(keySelector(a), keySelector(b)); 970 }); 971 } 972 thenOrderByDescending(keySelector) { 973 var comparer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (a, b) => a > b ? 1 : a < b ? -1 : 0; 974 var descendingComparer = (a, b) => -comparer(a, b); 975 return this.thenOrderBy(keySelector, descendingComparer); 976 } 977 toArray() { 978 return Array.from(this); 979 } 980 *[Symbol.iterator]() { 981 var array = Array.from(this.iterableFactory()); 982 array.sort((a, b) => { 983 var _iterator14 = _createForOfIteratorHelper(this.sortComparers), 984 _step14; 985 try { 986 for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) { 987 var comparer = _step14.value; 988 var result = comparer(a, b); 989 if (result !== 0) return result; 990 } 991 } catch (err) { 992 _iterator14.e(err); 993 } finally { 994 _iterator14.f(); 995 } 996 return 0; 997 }); 998 yield* array; 999 } 1000 } 1001 1002 var linq = /*#__PURE__*/Object.freeze({ 1003 __proto__: null, 1004 Enumerable: Enumerable, 1005 List: List 1006 }); 1007 exports('linq', linq); 1008 1009 var emptyGuid = "00000000-0000-0000-0000-000000000000"; 1010 function newGuid() { 1011 return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, c => { 1012 var r = Math.random() * 16 | 0; 1013 var v = c === "x" ? r : r & 0x3 | 0x8; 1014 return v.toString(16); 1015 }); 1016 } 1017 function normalize(a) { 1018 if (!a) { 1019 return null; 1020 } 1021 return a.toLowerCase(); 1022 } 1023 function isValidGuid(guid) { 1024 return /^[0-9A-Fa-f]{8}-(?:[0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/.test(guid); 1025 } 1026 function toGuidOrNull(value) { 1027 if (value === null || value === undefined) { 1028 return null; 1029 } 1030 if (!isValidGuid(value)) { 1031 return null; 1032 } 1033 return value; 1034 } 1035 function areEqual(a, b) { 1036 return normalize(a) === normalize(b); 1037 } 1038 var guid = { 1039 newGuid, 1040 normalize, 1041 areEqual 1042 }; 1043 1044 var guid$1 = /*#__PURE__*/Object.freeze({ 1045 __proto__: null, 1046 areEqual: areEqual, 1047 default: guid, 1048 emptyGuid: emptyGuid, 1049 isValidGuid: isValidGuid, 1050 newGuid: newGuid, 1051 normalize: normalize, 1052 toGuidOrNull: toGuidOrNull 1053 }); 1054 exports('guid', guid$1); 1055 1056 function isEmpty(val) { 1057 if (typeof val === "string") { 1058 return val.length === 0; 1059 } 1060 return false;
1061 } 1062 function isWhiteSpace(val) { 1063 if (typeof val === "string") { 1064 return val.trim().length === 0; 1065 } 1066 return false; 1067 } 1068 function isNullOrWhiteSpace(val) { 1069 return isWhiteSpace(val) || val === undefined || val === null; 1070 } 1071 function splitCase(val) { 1072 val = val.replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2"); 1073 return val.replace(/([a-z0-9])([A-Z])/g, "$1 $2"); 1074 } 1075 function asCommaAnd(strs, andStr) { 1076 if (strs.length === 0) { 1077 return ""; 1078 } 1079 if (strs.length === 1) { 1080 return strs[0]; 1081 } 1082 if (!andStr) { 1083 andStr = "and"; 1084 } 1085 if (strs.length === 2) { 1086 return "".concat(strs[0], " ").concat(andStr, " ").concat(strs[1]); 1087 } 1088 var last = strs.pop(); 1089 return "".concat(strs.join(", "), " ").concat(andStr, " ").concat(last); 1090 } 1091 function toTitleCase(str) { 1092 if (!str) { 1093 return ""; 1094 } 1095 return str.replace(/\w\S*/g, word => { 1096 return word.charAt(0).toUpperCase() + word.substring(1).toLowerCase(); 1097 }); 1098 } 1099 function toKebabCase(str) { 1100 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 1101 var _options$preserveMult = options.preserveMultipleDashes, 1102 preserveMultipleDashes = _options$preserveMult === void 0 ? false : _options$preserveMult, 1103 _options$allowLeading = options.allowLeadingDashes, 1104 allowLeadingDashes = _options$allowLeading === void 0 ? false : _options$allowLeading, 1105 _options$allowTrailin = options.allowTrailingDashes, 1106 allowTrailingDashes = _options$allowTrailin === void 0 ? false : _options$allowTrailin, 1107 _options$allowSpecial = options.allowSpecialChars, 1108 allowSpecialChars = _options$allowSpecial === void 0 ? false : _options$allowSpecial; 1109 var result = str.trim(); 1110 result = result.replace(/([a-z])([A-Z])/g, "$1-$2"); 1111 result = result.replace(/\s+/g, "-"); 1112 if (!allowSpecialChars) { 1113 result = result.replace(/[^a-zA-Z0-9-]/g, ""); 1114 } 1115 if (!preserveMultipleDashes) { 1116 result = result.replace(/-+/g, "-"); 1117 } 1118 result = result.toLowerCase(); 1119 if (!allowLeadingDashes) { 1120 result = result.replace(/^-+/, ""); 1121 } 1122 if (!allowTrailingDashes) { 1123 result = result.replace(/-+$/, ""); 1124 } 1125 return result; 1126 } 1127 function upperCaseFirstCharacter(str) { 1128 if (!str) { 1129 return ""; 1130 } 1131 return str.charAt(0).toUpperCase() + str.substring(1); 1132 } 1133 function pluralize(word, count) { 1134 return Pluralize(word, count); 1135 } 1136 function pluralConditional(num, singular, plural) { 1137 return num === 1 ? singular : plural; 1138 } 1139 function padLeft(str, length) { 1140 var padCharacter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : " "; 1141 if (padCharacter == "") { 1142 padCharacter = " "; 1143 } else if (padCharacter.length > 1) { 1144 padCharacter = padCharacter.substring(0, 1); 1145 } 1146 if (!str) { 1147 return Array(length + 1).join(padCharacter); 1148 } 1149 if (str.length >= length) { 1150 return str; 1151 } 1152 return Array(length - str.length + 1).join(padCharacter) + str; 1153 } 1154 function padRight(str, length) { 1155 var padCharacter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : " "; 1156 if (padCharacter == "") { 1157 padCharacter = " "; 1158 } else if (padCharacter.length > 1) { 1159 padCharacter = padCharacter.substring(0, 1); 1160 } 1161 if (!str) { 1162 return Array(length).join(padCharacter); 1163 } 1164 if (str.length >= length) { 1165 return str; 1166 } 1167 return str + Array(length - str.length + 1).join(padCharacter); 1168 } 1169 function truncate(str, limit, options) { 1170 if (str.length <= limit) { 1171 return str; 1172 } 1173 var trimmable = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u2028\u2029\u3000\uFEFF"; 1174 var reg = new RegExp("(?=[".concat(trimmable, "])")); 1175 var words = str.split(reg); 1176 var count = 0; 1177 if (options && options.ellipsis === true) { 1178 limit -= 3; 1179 } 1180 var visibleWords = words.filter(function (word) { 1181 count += word.length; 1182 return count <= limit; 1183 }); 1184 return "".concat(visibleWords.join(""), "..."); 1185 } 1186 var escapeHtmlRegExp = /["'&<>]/g; 1187 var escapeHtmlMap = { 1188 '"': """, 1189 "&": "&", 1190 "'": "'", 1191 "<": "<", 1192 ">": ">" 1193 }; 1194 function escapeHtml(str) { 1195 return str.replace(escapeHtmlRegExp, ch => { 1196 return escapeHtmlMap[ch]; 1197 }); 1198 } 1199 function defaultControlCompareValue(value, itemValue) { 1200 var guidValue = toGuidOrNull(value); 1201 var guidItemValue = toGuidOrNull(itemValue); 1202 if (guidValue !== null && guidItemValue !== null) { 1203 return areEqual(guidValue, guidItemValue); 1204 } 1205 return value === itemValue; 1206 } 1207 function containsHtmlTag(value) { 1208 return /<[/0-9a-zA-Z]/.test(value); 1209 } 1210 function createHash(str) { 1211 var hash = 0; 1212 for (var i = 0; i < str.length; i++) { 1213 var chr = str.charCodeAt(i); 1214 hash = (hash << 5) - hash + chr; 1215 hash |= 0; 1216 } 1217 return hash; 1218 } 1219 function createHashSha256(_x) { 1220 return _createHashSha.apply(this, arguments); 1221 } 1222 function _createHashSha() { 1223 _createHashSha = _asyncToGenerator(function* (str) { 1224 var encoder = new TextEncoder(); 1225 var data = encoder.encode(str); 1226 var hashBuffer = yield crypto.subtle.digest("SHA-256", data); 1227 return Array.from(new Uint8Array(hashBuffer)).map(b => b.toString(16).padStart(2, "0")).join(""); 1228 }); 1229 return _createHashSha.apply(this, arguments); 1230 } 1231 function replaceAll(str, search, replace) { 1232 return str.replace(new RegExp(search, "g"), replace); 1233 } 1234 var stringUtils = { 1235 asCommaAnd, 1236 containsHtmlTag, 1237 escapeHtml, 1238 splitCase, 1239 isNullOrWhiteSpace, 1240 isWhiteSpace, 1241 isEmpty, 1242 toKebabCase, 1243 toTitleCase, 1244 upperCaseFirstCharacter, 1245 pluralize, 1246 pluralConditional, 1247 padLeft, 1248 padRight, 1249 truncate, 1250 createHash, 1251 replaceAll 1252 }; 1253 1254 var stringUtils$1 = /*#__PURE__*/Object.freeze({ 1255 __proto__: null, 1256 asCommaAnd: asCommaAnd, 1257 containsHtmlTag: containsHtmlTag, 1258 createHash: createHash, 1259 createHashSha256: createHashSha256,
1260 default: stringUtils, 1261 defaultControlCompareValue: defaultControlCompareValue, 1262 escapeHtml: escapeHtml, 1263 isEmpty: isEmpty, 1264 isNullOrWhiteSpace: isNullOrWhiteSpace, 1265 isWhiteSpace: isWhiteSpace, 1266 padLeft: padLeft, 1267 padRight: padRight, 1268 pluralConditional: pluralConditional, 1269 pluralize: pluralize, 1270 replaceAll: replaceAll, 1271 splitCase: splitCase, 1272 toKebabCase: toKebabCase, 1273 toTitleCase: toTitleCase, 1274 truncate: truncate, 1275 upperCaseFirstCharacter: upperCaseFirstCharacter 1276 }); 1277 exports('stringUtils', stringUtils$1); 1278 1279 class LocaleDateFormatter { 1280 constructor(jsDateFormatString) { 1281 this.jsDateFormatString = jsDateFormatString; 1282 } 1283 static fromCurrent() { 1284 var date = new Date(2222, 2, 4); 1285 var localeDateString = date.toLocaleDateString(undefined, { 1286 year: "numeric", 1287 month: "numeric", 1288 day: "numeric" 1289 }); 1290 var defaultFormatString = "MM/DD/YYYY"; 1291 var localeFormatString = localeDateString; 1292 if (localeDateString.includes("2222")) { 1293 localeFormatString = localeDateString.replace("2222", "YYYY"); 1294 } else if (localeDateString.includes("22")) { 1295 localeFormatString = localeDateString.replace("22", "YY"); 1296 } else { 1297 return new LocaleDateFormatter(defaultFormatString); 1298 } 1299 if (localeFormatString.includes("03")) { 1300 localeFormatString = localeFormatString.replace("03", "MM"); 1301 } else if (localeFormatString.includes("3")) { 1302 localeFormatString = localeFormatString.replace("3", "M"); 1303 } else { 1304 return new LocaleDateFormatter(defaultFormatString); 1305 } 1306 if (localeFormatString.includes("04")) { 1307 localeFormatString = localeFormatString.replace("04", "DD"); 1308 } else if (localeFormatString.includes("4")) { 1309 localeFormatString = localeFormatString.replace("4", "D"); 1310 } else { 1311 return new LocaleDateFormatter(defaultFormatString); 1312 } 1313 return new LocaleDateFormatter(localeFormatString); 1314 } 1315 get aspDateFormat() { 1316 if (!this.aspDateFormatString) { 1317 this.aspDateFormatString = this.jsDateFormatString.replace(/D/g, "d").replace(/Y/g, "y"); 1318 } 1319 return this.aspDateFormatString; 1320 } 1321 get datePickerFormat() { 1322 if (!this.datePickerFormatString) { 1323 this.datePickerFormatString = this.jsDateFormatString.replace(/D/g, "d").replace(/M/g, "m").replace(/Y/g, "y"); 1324 } 1325 return this.datePickerFormatString; 1326 } 1327 } 1328 1329 var localeDateFormatter = /*#__PURE__*/Object.freeze({ 1330 __proto__: null, 1331 LocaleDateFormatter: LocaleDateFormatter 1332 }); 1333 exports('localeDateFormatter', localeDateFormatter); 1334 1335 function blankIfZero(value) { 1336 return parseInt(value) === 0 ? "" : value; 1337 } 1338 function get12HourValue(hour) { 1339 if (hour == 0) { 1340 return 12; 1341 } else if (hour < 13) { 1342 return hour; 1343 } else { 1344 return hour - 12; 1345 } 1346 } 1347 var englishDayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; 1348 var englishMonthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
1348November", "December"]; 1349 var dateFormatters = { 1350 "yyyyy": date => padLeft(date.year.toString(), 5, "0"), 1351 "yyyy": date => padLeft(date.year.toString(), 4, "0"), 1352 "yyy": date => padLeft(date.year.toString(), 3, "0"), 1353 "yy": date => padLeft((date.year % 100).toString(), 2, "0"), 1354 "y": date => (date.year % 100).toString(), 1355 "MMMM": date => englishMonthNames[date.month - 1], 1356 "MMM": date => englishMonthNames[date.month - 1].substr(0, 3), 1357 "MM": date => padLeft(date.month.toString(), 2, "0"), 1358 "M": date => date.month.toString(), 1359 "dddd": date => englishDayNames[date.dayOfWeek], 1360 "ddd": date => englishDayNames[date.dayOfWeek].substr(0, 3), 1361 "dd": date => padLeft(date.day.toString(), 2, "0"), 1362 "d": date => date.day.toString(), 1363 "fffffff": date => padRight((date.millisecond * 10000).toString(), 7, "0"), 1364 "ffffff": date => padRight((date.millisecond * 1000).toString(), 6, "0"), 1365 "fffff": date => padRight((date.millisecond * 100).toString(), 5, "0"), 1366 "ffff": date => padRight((date.millisecond * 10).toString(), 4, "0"), 1367 "fff": date => padRight(date.millisecond.toString(), 3, "0"), 1368 "ff": date => padRight(Math.floor(date.millisecond / 10).toString(), 2, "0"), 1369 "f": date => padRight(Math.floor(date.millisecond / 100).toString(), 1, "0"), 1370 "FFFFFFF": date => blankIfZero(padRight((date.millisecond * 10000).toString(), 7, "0")), 1371 "FFFFFF": date => blankIfZero(padRight((date.millisecond * 1000).toString(), 6, "0")), 1372 "FFFFF": date => blankIfZero(padRight((date.millisecond * 100).toString(), 5, "0")), 1373 "FFFF": date => blankIfZero(padRight((date.millisecond * 10).toString(), 4, "0")), 1374 "FFF": date => blankIfZero(padRight(date.millisecond.toString(), 3, "0")), 1375 "FF": date => blankIfZero(padRight(Math.floor(date.millisecond / 10).toString(), 2, "0")), 1376 "F": date => blankIfZero(padRight(Math.floor(date.millisecond / 100).toString(), 1, "0")), 1377 "g": date => date.year < 0 ? "B.C." : "A.D.", 1378 "gg": date => date.year < 0 ? "B.C." : "A.D.", 1379 "hh": date => padLeft(get12HourValue(date.hour).toString(), 2, "0"), 1380 "h": date => get12HourValue(date.hour).toString(), 1381 "HH": date => padLeft(date.hour.toString(), 2, "0"), 1382 "H": date => date.hour.toString(), 1383 "mm": date => padLeft(date.minute.toString(), 2, "0"), 1384 "m": date => date.minute.toString(), 1385 "ss": date => padLeft(date.second.toString(), 2, "0"), 1386 "s": date => date.second.toString(), 1387 "K": date => { 1388 var offset = date.offset; 1389 var offsetHour = Math.abs(Math.floor(offset / 60)); 1390 var offsetMinute = Math.abs(offset % 60); 1391 return "".concat(offset >= 0 ? "+" : "-").concat(padLeft(offsetHour.toString(), 2, "0"), ":").concat(padLeft(offsetMinute.toString(), 2, "0")); 1392 }, 1393 "tt": date => date.hour >= 12 ? "PM" : "AM", 1394 "t": date => date.hour >= 12 ? "P" : "A", 1395 "zzz": date => { 1396 var offset = date.offset; 1397 var offsetHour = Math.abs(Math.floor(offset / 60)); 1398 var offsetMinute = Math.abs(offset % 60); 1399 return "".concat(offset >= 0 ? "+" : "-").concat(padLeft(offsetHour.toString(), 2, "0"), ":").concat(padLeft(offsetMinute.toString(), 2, "0")); 1400 }, 1401 "zz": date => { 1402 var offset = date.offset; 1403 var offsetHour = Math.abs(Math.floor(offset / 60)); 1404 return "".concat(offset >= 0 ? "+" : "-").concat(padLeft(offsetHour.toString(), 2, "0")); 1405 }, 1406 "z": date => { 1407 var offset = date.offset; 1408 var offsetHour = Math.abs(Math.floor(offset / 60)); 1409 return "".concat(offset >= 0 ? "+" : "-").concat(offsetHour); 1410 }, 1411 ":": () => ":", 1412 "/": () => "/" 1413 }; 1414 var dateFormatterKeys = new List(Object.keys(dateFormatters)).orderByDescending(k => k.length).toArray(); 1415 var currentLocaleDateFormatter = LocaleDateFormatter.fromCurrent(); 1416 var standardDateFormats = { 1417 "d": date => formatAspDate(date, currentLocaleDateFormatter.aspDateFormat), 1418 "D": date => formatAspDate(date, "dddd, MMMM dd, yyyy"), 1419 "t": date => formatAspDate(date, "h:mm tt"), 1420 "T": date => formatAspDate(date, "h:mm:ss tt"), 1421 "M": date => formatAspDate(date, "MMMM dd"), 1422 "m": date => formatAspDate(date, "MMMM dd"), 1423 "Y": date => formatAspDate(date, "yyyy MMMM"), 1424 "y": date => formatAspDate(date, "yyyy MMMM"), 1425 "f": date => "".concat(formatAspDate(date, "D"), " ").concat(formatAspDate(date, "t")), 1426 "F": date => "".concat(formatAspDate(date, "D"), " ").concat(formatAspDate(date, "T")), 1427 "g": date => "".concat(formatAspDate(date, "d"), " ").concat(formatAspDate(date, "t")), 1428 "G": date => "".concat(formatAspDate(date, "d"), " ").concat(formatAspDate(date, "T")), 1429 "o": date => formatAspDate(date, "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffzzz"), 1430 "O": date => formatAspDate(date, "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffzzz"), 1431 "r": date => formatAspDate(date, "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'"), 1432 "R": date => formatAspDate(date, "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'"), 1433 "s": date => formatAspDate(date, "yyyy'-'MM'-'dd'T'HH':'mm':'ss"),
1434 "u": date => formatAspDate(date, "yyyy'-'MM'-'dd HH':'mm':'ss'Z'"), 1435 "U": date => { 1436 return formatAspDate(date.universalDateTime, "F"); 1437 } 1438 }; 1439 function formatAspCustomDate(date, format) { 1440 var result = ""; 1441 for (var i = 0; i < format.length;) { 1442 var matchFound = false; 1443 var _iterator = _createForOfIteratorHelper(dateFormatterKeys), 1444 _step; 1445 try { 1446 for (_iterator.s(); !(_step = _iterator.n()).done;) { 1447 var k = _step.value; 1448 if (format.substr(i, k.length) === k) { 1449 result += dateFormatters[k](date); 1450 matchFound = true; 1451 i += k.length; 1452 break; 1453 } 1454 } 1455 } catch (err) { 1456 _iterator.e(err); 1457 } finally { 1458 _iterator.f(); 1459 } 1460 if (matchFound) { 1461 continue; 1462 } 1463 if (format[i] === "\\") { 1464 i++; 1465 if (i < format.length) { 1466 result += format[i++]; 1467 } 1468 } else if (format[i] === "'") { 1469 i++; 1470 for (; i < format.length && format[i] !== "'"; i++) { 1471 result += format[i]; 1472 } 1473 i++; 1474 } else if (format[i] === '"') { 1475 i++; 1476 for (; i < format.length && format[i] !== '"'; i++) { 1477 result += format[i]; 1478 } 1479 i++; 1480 } else { 1481 result += format[i++]; 1482 } 1483 } 1484 return result; 1485 } 1486 function formatAspStandardDate(date, format) { 1487 if (standardDateFormats[format] !== undefined) { 1488 return standardDateFormats[format](date); 1489 } 1490 return format; 1491 } 1492 function formatAspDate(date, format) { 1493 if (format.length === 1) { 1494 return formatAspStandardDate(date, format); 1495 } else if (format.length === 2 && format[0] === "%") { 1496 return formatAspCustomDate(date, format[1]); 1497 } else { 1498 return formatAspCustomDate(date, format); 1499 } 1500 } 1501 1502 var aspDateFormat = /*#__PURE__*/Object.freeze({ 1503 __proto__: null, 1504 formatAspDate: formatAspDate 1505 }); 1506 exports('aspDateFormat', aspDateFormat); 1507 1508 var DateTimeFormat = { 1509 DateFull: { 1510 year: "numeric", 1511 month: "long", 1512 day: "numeric" 1513 }, 1514 DateMedium: { 1515 year: "numeric", 1516 month: "short", 1517 day: "numeric" 1518 }, 1519 DateShort: { 1520 year: "numeric", 1521 month: "numeric", 1522 day: "numeric" 1523 }, 1524 TimeShort: { 1525 hour: "numeric", 1526 minute: "numeric" 1527 }, 1528 TimeWithSeconds: { 1529 hour: "numeric", 1530 minute: "numeric", 1531 second: "numeric" 1532 }, 1533 DateTimeShort: { 1534 year: "numeric", 1535 month: "numeric", 1536 day: "numeric", 1537 hour: "numeric", 1538 minute: "numeric" 1539 }, 1540 DateTimeShortWithSeconds: { 1541 year: "numeric", 1542 month: "numeric", 1543 day: "numeric", 1544 hour: "numeric", 1545 minute: "numeric", 1546 second: "numeric" 1547 }, 1548 DateTimeMedium: { 1549 year: "numeric", 1550 month: "short", 1551 day: "numeric", 1552 hour: "numeric", 1553 minute: "numeric" 1554 }, 1555 DateTimeMediumWithSeconds: { 1556 year: "numeric", 1557 month: "short", 1558 day: "numeric", 1559 hour: "numeric", 1560 minute: "numeric", 1561 second: "numeric" 1562 }, 1563 DateTimeFull: { 1564 year: "numeric", 1565 month: "long", 1566 day: "numeric", 1567 hour: "numeric", 1568 minute: "numeric" 1569 }, 1570 DateTimeFullWithSeconds: { 1571 year: "numeric", 1572 month: "long", 1573 day: "numeric", 1574 hour: "numeric", 1575 minute: "numeric", 1576 second: "numeric" 1577 } 1578 }; 1579 class RockDateTime { 1580 constructor(dateTime) { 1581 this.dateTime = dateTime; 1582 } 1583 static fromParts(year, month, day, hour, minute, second, millisecond, zone) { 1584 var luxonZone; 1585 if (zone !== undefined) { 1586 if (typeof zone === "number") { 1587 luxonZone = FixedOffsetZone.instance(zone); 1588 } else { 1589 luxonZone = zone; 1590 } 1591 } 1592 var dateTime = DateTime.fromObject({ 1593 year, 1594 month, 1595 day, 1596 hour, 1597 minute, 1598 second, 1599 millisecond 1600 }, { 1601 zone: luxonZone 1602 }); 1603 if (!dateTime.isValid) { 1604 return null; 1605 } 1606 return new RockDateTime(dateTime); 1607 } 1608 static fromMilliseconds(milliseconds) { 1609 var dateTime = DateTime.fromMillis(milliseconds); 1610 if (!dateTime.isValid) { 1611 return null; 1612 } 1613 return new RockDateTime(dateTime); 1614 } 1615 static fromJSDate(date) { 1616 var dateTime = DateTime.fromJSDate(date); 1617 if (!dateTime.isValid) { 1618 return null; 1619 } 1620 return new RockDateTime(dateTime); 1621 } 1622 static parseISO(dateString) { 1623 var dateTime = DateTime.fromISO(dateString, { 1624 setZone: true 1625 }); 1626 if (!dateTime.isValid) { 1627 return null; 1628 } 1629 return new RockDateTime(dateTime); 1630 } 1631 static parseHTTP(dateString) { 1632 var dateTime = DateTime.fromHTTP(dateString, { 1633 setZone: true 1634 }); 1635 if (!dateTime.isValid) { 1636 return null; 1637 } 1638 return new RockDateTime(dateTime); 1639 } 1640 static now() { 1641 return new RockDateTime(DateTime.now()); 1642 } 1643 static utcNow() { 1644 return new RockDateTime(DateTime.now().toUTC()); 1645 } 1646 get date() { 1647 var date = RockDateTime.fromParts(this.year, this.month, this.day, 0, 0, 0, 0, this.offset); 1648 if (date === null) { 1649 throw "Could not convert to date instance."; 1650 } 1651 return date; 1652 } 1653 get rawDate() { 1654 var date = RockDateTime.fromParts(this.year, this.month, this.day, 0, 0, 0, 0); 1655 if (date === null) { 1656 throw "Could not convert to date instance."; 1657 } 1658 return date; 1659 } 1660 get day() { 1661 return this.dateTime.day; 1662 } 1663 get dayOfWeek() { 1664 switch (this.dateTime.weekday) { 1665 case 1: 1666 return DayOfWeek.Monday; 1667 case 2: 1668 return DayOfWeek.Tuesday; 1669 case 3: 1670 return DayOfWeek.Wednesday; 1671 case 4: 1672 return DayOfWeek.Thursday; 1673 case 5: 1674 return DayOfWeek.Friday; 1675 case 6: 1676 return DayOfWeek.Saturday; 1677 case 7: 1678 return DayOfWeek.Sunday; 1679 } 1680 throw "Could not determine day of week."; 1681 } 1682 get dayOfYear() { 1683 return this.dateTime.ordinal; 1684 } 1685 get hour() { 1686 return this.dateTime.hour; 1687 } 1688 get millisecond() { 1689 return this.dateTime.millisecond; 1690 } 1691 get minute() { 1692 return this.dateTime.minute; 1693 } 1694 get month() { 1695 return this.dateTime.month; 1696 } 1697 get offset() { 1698 return this.dateTime.offset; 1699 } 1700 get second() { 1701 return this.dateTime.second; 1702 } 1703 get year() { 1704 return this.dateTime.year; 1705 } 1706 get localDateTime() { 1707 return new RockDateTime(this.dateTime.toLocal()); 1708 } 1709 get organizationDateTime() { 1710 throw "Not Implemented"; 1711 } 1712 get universalDateTime() { 1713 return new RockDateTime(this.dateTime.toUTC()); 1714 } 1715 addDays(days) { 1716 var dateTime = this.dateTime.plus({ 1717 days: days 1718 }); 1719 if (!dateTime.isValid) {
1720 throw "Operation produced an invalid date."; 1721 } 1722 return new RockDateTime(dateTime); 1723 } 1724 endOfMonth() { 1725 var dateTime = this.dateTime.endOf("month"); 1726 if (!dateTime.isValid) { 1727 throw "Operation produced an invalid date."; 1728 } 1729 return new RockDateTime(dateTime); 1730 } 1731 addHours(hours) { 1732 var dateTime = this.dateTime.plus({ 1733 hours: hours 1734 }); 1735 if (!dateTime.isValid) { 1736 throw "Operation produced an invalid date."; 1737 } 1738 return new RockDateTime(dateTime); 1739 } 1740 addMilliseconds(milliseconds) { 1741 var dateTime = this.dateTime.plus({ 1742 milliseconds: milliseconds 1743 }); 1744 if (!dateTime.isValid) { 1745 throw "Operation produced an invalid date."; 1746 } 1747 return new RockDateTime(dateTime); 1748 } 1749 addMinutes(minutes) { 1750 var dateTime = this.dateTime.plus({ 1751 minutes: minutes 1752 }); 1753 if (!dateTime.isValid) { 1754 throw "Operation produced an invalid date."; 1755 } 1756 return new RockDateTime(dateTime); 1757 } 1758 addMonths(months) { 1759 var dateTime = this.dateTime.plus({ 1760 months: months 1761 }); 1762 if (!dateTime.isValid) { 1763 throw "Operation produced an invalid date."; 1764 } 1765 return new RockDateTime(dateTime); 1766 } 1767 addSeconds(seconds) { 1768 var dateTime = this.dateTime.plus({ 1769 seconds: seconds 1770 }); 1771 if (!dateTime.isValid) { 1772 throw "Operation produced an invalid date."; 1773 } 1774 return new RockDateTime(dateTime); 1775 } 1776 addYears(years) { 1777 var dateTime = this.dateTime.plus({ 1778 years: years 1779 }); 1780 if (!dateTime.isValid) { 1781 throw "Operation produced an invalid date."; 1782 } 1783 return new RockDateTime(dateTime); 1784 } 1785 toMilliseconds() { 1786 return this.dateTime.toMillis(); 1787 } 1788 toOffset(zone) { 1789 var dateTime; 1790 if (typeof zone === "number") { 1791 dateTime = this.dateTime.setZone(FixedOffsetZone.instance(zone)); 1792 } else { 1793 dateTime = this.dateTime.setZone(zone); 1794 } 1795 if (!dateTime.isValid) { 1796 throw "Invalid time zone specified."; 1797 } 1798 return new RockDateTime(dateTime); 1799 } 1800 toASPString(format) { 1801 return formatAspDate(this, format); 1802 } 1803 toISOString() { 1804 return this.dateTime.toISO(); 1805 } 1806 toLocaleString(format) { 1807 return this.dateTime.toLocaleString(format); 1808 } 1809 toElapsedString(currentDateTime) { 1810 var msPerSecond = 1000; 1811 var msPerMinute = 1000 * 60; 1812 var msPerHour = 1000 * 60 * 60; 1813 var hoursPerDay = 24; 1814 var daysPerYear = 365; 1815 var start = new RockDateTime(this.dateTime); 1816 var end = currentDateTime !== null && currentDateTime !== void 0 ? currentDateTime : RockDateTime.now(); 1817 var direction = "Ago"; 1818 var totalMs = end.toMilliseconds() - start.toMilliseconds(); 1819 if (totalMs < 0) { 1820 direction = "From Now"; 1821 totalMs = Math.abs(totalMs); 1822 start = end; 1823 end = new RockDateTime(this.dateTime); 1824 } 1825 var totalSeconds = totalMs / msPerSecond; 1826 var totalMinutes = totalMs / msPerMinute; 1827 var totalHours = totalMs / msPerHour; 1828 var totalDays = totalHours / hoursPerDay; 1829 if (totalHours < 24) { 1830 if (totalSeconds < 2) { 1831 return "1 Second ".concat(direction); 1832 } 1833 if (totalSeconds < 60) { 1834 return "".concat(Math.floor(totalSeconds), " Seconds ").concat(direction); 1835 } 1836 if (totalMinutes < 2) { 1837 return "1 Minute ".concat(direction); 1838 } 1839 if (totalMinutes < 60) { 1840 return "".concat(Math.floor(totalMinutes), " Minutes ").concat(direction); 1841 } 1842 if (totalHours < 2) { 1843 return "1 Hour ".concat(direction); 1844 } 1845 if (totalHours < 60) { 1846 return "".concat(Math.floor(totalHours), " Hours ").concat(direction); 1847 } 1848 } 1849 if (totalDays < 2) { 1850 return "1 Day ".concat(direction); 1851 } 1852 if (totalDays < 31) { 1853 return "".concat(Math.floor(totalDays), " Days ").concat(direction); 1854 } 1855 var totalMonths = end.totalMonths(start); 1856 if (totalMonths <= 1) { 1857 return "1 Month ".concat(direction); 1858 } 1859 if (totalMonths <= 18) { 1860 return "".concat(Math.round(totalMonths), " Months ").concat(direction); 1861 } 1862 var totalYears = Math.floor(totalDays / daysPerYear); 1863 if (totalYears <= 1) { 1864 return "1 Year ".concat(direction); 1865 } 1866 return "".concat(Math.round(totalYears), " Years ").concat(direction); 1867 } 1868 toHTTPString() { 1869 return this.dateTime.toHTTP(); 1870 } 1871 valueOf() { 1872 return this.dateTime.valueOf(); 1873 } 1874 toString() {
1875 return this.toLocaleString(DateTimeFormat.DateTimeFull); 1876 } 1877 isEqualTo(otherDateTime) { 1878 return this.dateTime.toMillis() === otherDateTime.dateTime.toMillis(); 1879 } 1880 isLaterThan(otherDateTime) { 1881 return this.dateTime.toMillis() > otherDateTime.dateTime.toMillis(); 1882 } 1883 isEarlierThan(otherDateTime) { 1884 return this.dateTime.toMillis() < otherDateTime.dateTime.toMillis(); 1885 } 1886 humanizeElapsed(otherDateTime) { 1887 var _otherDateTime; 1888 otherDateTime = (_otherDateTime = otherDateTime) !== null && _otherDateTime !== void 0 ? _otherDateTime : RockDateTime.now(); 1889 var totalSeconds = Math.floor((otherDateTime.dateTime.toMillis() - this.dateTime.toMillis()) / 1000); 1890 if (totalSeconds <= 1) { 1891 return "right now"; 1892 } else if (totalSeconds < 60) { 1893 return "".concat(totalSeconds, " seconds ago"); 1894 } else if (totalSeconds >= 60 && totalSeconds <= 119) { 1895 return "1 minute ago"; 1896 } else if (totalSeconds < 3600) { 1897 return "".concat(Math.floor(totalSeconds / 60), " minutes ago"); 1898 } else if (totalSeconds < 86400) { 1899 return "".concat(Math.floor(totalSeconds / 3600), " hours ago"); 1900 } else if (totalSeconds < 31536000) { 1901 return "".concat(Math.floor(totalSeconds / 86400), " days ago"); 1902 } else { 1903 return "".concat(Math.floor(totalSeconds / 31536000), " years ago"); 1904 } 1905 } 1906 totalMonths(otherDateTime) { 1907 return this.year * 12 + this.month - (otherDateTime.year * 12 + otherDateTime.month); 1908 } 1909 } 1910 1911 var rockDateTime = /*#__PURE__*/Object.freeze({ 1912 __proto__: null, 1913 DateTimeFormat: DateTimeFormat, 1914 DayOfWeek: DayOfWeek, 1915 RockDateTime: RockDateTime 1916 }); 1917 exports('rockDateTime', rockDateTime); 1918 1919 function shortcutCancelledEvent(listener) { 1920 window.setTimeout(listener, 0); 1921 } 1922 function isCancellationToken(thing) { 1923 if (thing === CancellationTokenNone || thing === CancellationTokenCancelled) { 1924 return true; 1925 } 1926 if (thing instanceof MutableToken) { 1927 return true; 1928 } 1929 if (!thing || typeof thing !== "object") { 1930 return false; 1931 } 1932 return typeof thing.isCancellationRequested === "boolean" && typeof thing.onCancellationRequested === "function"; 1933 } 1934 var CancellationTokenNone = Object.freeze({ 1935 isCancellationRequested: false, 1936 onCancellationRequested() {} 1937 }); 1938 var CancellationTokenCancelled = Object.freeze({ 1939 isCancellationRequested: true, 1940 onCancellationRequested: shortcutCancelledEvent 1941 }); 1942 class MutableToken { 1943 constructor() { 1944 _defineProperty(this, "isCancelled", false); 1945 _defineProperty(this, "emitter", null); 1946 } 1947 cancel() { 1948 if (!this.isCancelled) { 1949 this.isCancelled = true; 1950 if (this.emitter) { 1951 this.emitter.emit("cancel", undefined); 1952 this.emitter = null; 1953 } 1954 } 1955 } 1956 get isCancellationRequested() { 1957 return this.isCancelled; 1958 } 1959 onCancellationRequested(listener) { 1960 if (this.isCancelled) { 1961 return shortcutCancelledEvent(listener); 1962 } 1963 if (!this.emitter) { 1964 this.emitter = mitt(); 1965 } 1966 this.emitter.on("cancel", listener); 1967 } 1968 } 1969 class CancellationTokenSource { 1970 constructor(parent) { 1971 _defineProperty(this, "internalToken", undefined); 1972 if (parent) { 1973 parent.onCancellationRequested(() => this.cancel()); 1974 } 1975 } 1976 get token() { 1977 if (!this.internalToken) { 1978 this.internalToken = new MutableToken(); 1979 } 1980 return this.internalToken; 1981 } 1982 cancel() { 1983 if (!this.internalToken) { 1984 this.internalToken = CancellationTokenCancelled; 1985 } else if (this.internalToken instanceof MutableToken) { 1986 this.internalToken.cancel(); 1987 } 1988 } 1989 } 1990 1991 var cancellation = /*#__PURE__*/Object.freeze({ 1992 __proto__: null, 1993 CancellationTokenCancelled: CancellationTokenCancelled, 1994 CancellationTokenNone: CancellationTokenNone, 1995 CancellationTokenSource: CancellationTokenSource, 1996 isCancellationToken: isCancellationToken 1997 }); 1998 exports('cancellation', cancellation); 1999 2000 function getUniqueCssSelector(el) { 2001 var path = []; 2002 var parent = el.parentNode; 2003 while (parent) { 2004 path.unshift("".concat(el.tagName, ":nth-child(").concat([].indexOf.call(parent.children, el) + 1, ")")); 2005 el = parent; 2006 parent = el.parentNode; 2007 } 2008 return "".concat(path.join(" > ")).toLowerCase(); 2009 } 2010 function* getAncestors(element) { 2011 var parent = element.parentElement; 2012 while (parent) { 2013 yield parent; 2014 parent = parent.parentElement; 2015 } 2016 } 2017 function scrollElementStartToTop(element) { 2018 var isWithinScrolledContainer = Enumerable.from(getAncestors(element)).any(ancestorElement => { 2019 var _getComputedStyle = getComputedStyle(ancestorElement), 2020 overflowY = _getComputedStyle.overflowY; 2021 var isScrollable = overflowY === "scroll" || overflowY === "auto"; 2022 return isScrollable && ancestorElement.scrollHeight > ancestorElement.clientHeight; 2023 }); 2024 if (isWithinScrolledContainer) { 2025 element.scrollIntoView({ 2026 block: "start", 2027 behavior: "smooth" 2028 }); 2029 } else { 2030 var rect = element.getBoundingClientRect(); 2031 var desiredLeft = rect.left < 0 ? 0 : rect.left; 2032 var desiredTop = 0; 2033 var elementsAtDesiredLocation = document.elementsFromPoint(desiredLeft + 1, desiredTop + 1); 2034 var fixedElementAtDesiredLocation = elementsAtDesiredLocation.find(el => getComputedStyle(el).position === "fixed"); 2035 if (fixedElementAtDesiredLocation) { 2036 var _fixedElementAtDesire = fixedElementAtDesiredLocation.getBoundingClientRect(), 2037 fixedHeight = _fixedElementAtDesire.height; 2038 desiredTop = fixedHeight; 2039 } 2040 window.scrollBy({ 2041 top: rect.top - desiredTop, 2042 behavior: "smooth" 2043 }); 2044 } 2045 } 2046 function findDirectChildContaining(element, descendantElement) {
2047 var current = descendantElement; 2048 while (current && current !== element) { 2049 if (current.parentElement === element && isHTMLElement(current)) { 2050 return current; 2051 } 2052 current = current.parentElement; 2053 } 2054 return null; 2055 } 2056 function findNearestIFrameElementFromPoint(iframe, x, y, selector) { 2057 var _iframe$contentWindow; 2058 var xRange = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 10; 2059 var yRange = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 10; 2060 var iframeDoc = iframe.contentDocument || ((_iframe$contentWindow = iframe.contentWindow) === null || _iframe$contentWindow === void 0 ? void 0 : _iframe$contentWindow.document); 2061 if (!iframeDoc) { 2062 console.error("Unable to access iframe content."); 2063 return { 2064 element: null, 2065 isAbove: false, 2066 isBelow: false, 2067 isLeft: false, 2068 isRight: false 2069 }; 2070 } 2071 var iframeRect = iframe.getBoundingClientRect(); 2072 var closestElement = null; 2073 var isAbove = false; 2074 var isBelow = false; 2075 var isLeft = false; 2076 var isRight = false; 2077 var smallestDistance = Infinity; 2078 var _loop = function _loop(dx) { 2079 var _loop2 = function _loop2(dy) { 2080 Enumerable.from(iframeDoc.elementsFromPoint(x + dx, y + dy)).where(element => element.matches(selector)).ofType(isHTMLElement).forEach(element => { 2081 var rect = element.getBoundingClientRect(); 2082 var elementX = rect.left - iframeRect.left; 2083 var elementY = rect.top - iframeRect.top; 2084 var distance = Math.sqrt(Math.pow(elementX - x, 2) + Math.pow(elementY - y, 2)); 2085 if (distance < smallestDistance) { 2086 smallestDistance = distance; 2087 closestElement = element; 2088 isAbove = dy < 0; 2089 isBelow = dy > 0; 2090 isLeft = dx < 0; 2091 isRight = dx > 0; 2092 } 2093 }); 2094 }; 2095 for (var dy = -yRange; dy <= yRange; dy += 1) { 2096 _loop2(dy); 2097 } 2098 }; 2099 for (var dx = -xRange; dx <= xRange; dx += 1) { 2100 _loop(dx); 2101 } 2102 return { 2103 element: closestElement, 2104 isAbove, 2105 isBelow, 2106 isLeft, 2107 isRight 2108 }; 2109 } 2110 function getWindow(el) { 2111 return el.ownerDocument.defaultView; 2112 } 2113 function isElement(el) { 2114 var _el$ownerDocument; 2115 var elWindow = el === null || el === void 0 || (_el$ownerDocument = el["ownerDocument"]) === null || _el$ownerDocument === void 0 ? void 0 : _el$ownerDocument["defaultView"]; 2116 return el instanceof Element || !!elWindow && el instanceof elWindow.Element; 2117 } 2118 function isHTMLElement(el) { 2119 var _el$ownerDocument2; 2120 var elWindow = el === null || el === void 0 || (_el$ownerDocument2 = el["ownerDocument"]) === null || _el$ownerDocument2 === void 0 ? void 0 : _el$ownerDocument2["defaultView"]; 2121 return el instanceof HTMLElement || !!elWindow && el instanceof elWindow.HTMLElement || typeof el === "object" && el !== null && typeof el.tagName === "string" && typeof el.classList === "object"; 2122 } 2123 function isHTMLTableElement(el) { 2124 var _el$ownerDocument3; 2125 var elWindow = el === null || el === void 0 || (_el$ownerDocument3 = el["ownerDocument"]) === null || _el$ownerDocument3 === void 0 ? void 0 : _el$ownerDocument3["defaultView"]; 2126 return el instanceof HTMLTableElement || !!elWindow && el instanceof elWindow.HTMLTableElement; 2127 } 2128 function isHTMLAnchorElement(el) { 2129 var _el$ownerDocument4; 2130 var elWindow = el === null || el === void 0 || (_el$ownerDocument4 = el["ownerDocument"]) === null || _el$ownerDocument4 === void 0 ? void 0 : _el$ownerDocument4["defaultView"]; 2131 return !!elWindow && el instanceof elWindow.HTMLAnchorElement; 2132 } 2133 function isDocument(doc) { 2134 var docWindow = doc === null || doc === void 0 ? void 0 : doc["defaultView"]; 2135 return !!docWindow && doc instanceof docWindow.Document; 2136 } 2137 function isMouseEvent(event) { 2138 var eventWindow = event === null || event === void 0 ? void 0 : event["view"]; 2139 return !!eventWindow && event instanceof eventWindow.MouseEvent; 2140 } 2141 function isTouchEvent(event) { 2142 var eventWindow = event === null || event === void 0 ? void 0 : event["view"]; 2143 return !!(eventWindow !== null && eventWindow !== void 0 && eventWindow.TouchEvent) && event instanceof eventWindow.TouchEvent; 2144 } 2145 function removeWhiteSpaceFromElement(element, selector) { 2146 var _element$textContent; 2147 if ((!selector || element.matches(selector)) && element.childNodes.length && Enumerable.from(element.childNodes).all(n => n.nodeType === Node.TEXT_NODE) && !((_element$textContent = element.textContent) !== null && _element$textContent !== void 0 && _element$textContent.trim())) { 2148 element.innerHTML = ""; 2149 } 2150 } 2151 function removeWhiteSpaceFromElementAndChildElements(element, selector) { 2152 removeWhiteSpaceFromChildElements(element, selector); 2153 removeWhiteSpaceFromElement(element, selector); 2154 } 2155 function removeWhiteSpaceFromChildElements(element, selector) { 2156 if (selector) { 2157 element.querySelectorAll(selector).forEach(el => { 2158 removeWhiteSpaceFromElement(el, selector); 2159 }); 2160 } else {
2161 Enumerable.from(element.children).forEach(el => { 2162 removeWhiteSpaceFromElement(el, selector); 2163 }); 2164 } 2165 } 2166 2167 var dom = /*#__PURE__*/Object.freeze({ 2168 __proto__: null, 2169 findDirectChildContaining: findDirectChildContaining, 2170 findNearestIFrameElementFromPoint: findNearestIFrameElementFromPoint, 2171 getAncestors: getAncestors, 2172 getUniqueCssSelector: getUniqueCssSelector, 2173 getWindow: getWindow, 2174 isDocument: isDocument, 2175 isElement: isElement, 2176 isHTMLAnchorElement: isHTMLAnchorElement, 2177 isHTMLElement: isHTMLElement, 2178 isHTMLTableElement: isHTMLTableElement, 2179 isMouseEvent: isMouseEvent, 2180 isTouchEvent: isTouchEvent, 2181 removeWhiteSpaceFromChildElements: removeWhiteSpaceFromChildElements, 2182 removeWhiteSpaceFromElement: removeWhiteSpaceFromElement, 2183 removeWhiteSpaceFromElementAndChildElements: removeWhiteSpaceFromElementAndChildElements, 2184 scrollElementStartToTop: scrollElementStartToTop 2185 }); 2186 exports('dom', dom); 2187 2188 function deepEqual(a, b, strict) { 2189 if (strict && a === b) { 2190 return true; 2191 } else if (!strict && a == b) { 2192 return true; 2193 } 2194 if (typeof a === "number" && typeof b === "number" && isNaN(a) && isNaN(b)) { 2195 return true; 2196 } 2197 if (a && b && typeof a === "object" && typeof b === "object") { 2198 if (Array.isArray(a) !== Array.isArray(b)) { 2199 return false; 2200 } 2201 if (Array.isArray(a) && Array.isArray(b)) { 2202 if (a.length !== b.length) { 2203 return false; 2204 } 2205 for (var i = 0; i < a.length; i++) { 2206 if (!deepEqual(a[i], b[i], strict)) { 2207 return false; 2208 } 2209 } 2210 return true; 2211 } else { 2212 if (a.constructor !== b.constructor) { 2213 return false; 2214 } 2215 if (isHTMLElement(a) && isHTMLElement(b)) { 2216 return a === b; 2217 } 2218 var aEntries = Object.entries(a).sort((a, b) => a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0); 2219 var bEntries = Object.entries(b).sort((a, b) => a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0); 2220 if (aEntries.length !== bEntries.length) { 2221 return false; 2222 } 2223 for (var _i = 0; _i < aEntries.length; _i++) { 2224 var aEntry = aEntries[_i]; 2225 var bEntry = bEntries[_i]; 2226 if (!deepEqual(aEntry[0], bEntry[0], true)) { 2227 return false; 2228 } 2229 if (!deepEqual(aEntry[1], bEntry[1], strict)) { 2230 return false; 2231 } 2232 } 2233 return true; 2234 } 2235 } 2236 return false; 2237 } 2238 function debounce(fn) { 2239 var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 250; 2240 var eager = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 2241 var timeout = null; 2242 return () => { 2243 if (timeout) { 2244 clearTimeout(timeout); 2245 } else if (eager) { 2246 fn(); 2247 timeout = setTimeout(() => timeout = null, delay); 2248 return; 2249 } 2250 timeout = setTimeout(() => { 2251 timeout = null; 2252 fn(); 2253 }, delay); 2254 }; 2255 } 2256 function debounceAsync(fn, options) { 2257 var _options$delay, _options$eager; 2258 var delay = (_options$delay = options === null || options === void 0 ? void 0 : options.delay) !== null && _options$delay !== void 0 ? _options$delay : 250; 2259 var eager = (_options$eager = options === null || options === void 0 ? void 0 : options.eager) !== null && _options$eager !== void 0 ? _options$eager : false; 2260 var timeout = null; 2261 var source = null; 2262 var isEagerExecutionInProgress = false; 2263 var pendingPromise = null; 2264 return function () { 2265 var _ref = _asyncToGenerator(function* (parentCancellationToken) { 2266 var _source; 2267 (_source = source) === null || _source === void 0 || _source.cancel(); 2268 if (timeout) { 2269 clearTimeout(timeout); 2270 timeout = null; 2271 } else if (eager && !isEagerExecutionInProgress) { 2272 isEagerExecutionInProgress = true; 2273 source = new CancellationTokenSource(parentCancellationToken); 2274 timeout = setTimeout(() => { 2275 timeout = null; 2276 isEagerExecutionInProgress = false;
2277 }, delay); 2278 try { 2279 pendingPromise = fn(source.token); 2280 return yield pendingPromise; 2281 } catch (e) { 2282 console.error(e || "Unknown error while debouncing async function call."); 2283 throw e; 2284 } 2285 } 2286 source = new CancellationTokenSource(parentCancellationToken); 2287 var cts = source; 2288 return new Promise((resolve, reject) => { 2289 timeout = setTimeout(_asyncToGenerator(function* () { 2290 try { 2291 pendingPromise = fn(cts.token); 2292 resolve(yield pendingPromise); 2293 } catch (e) { 2294 console.error(e || "Unknown error while debouncing async function call."); 2295 reject(e); 2296 } 2297 timeout = null; 2298 isEagerExecutionInProgress = false; 2299 }), delay); 2300 }); 2301 }); 2302 return function (_x) { 2303 return _ref.apply(this, arguments); 2304 }; 2305 }(); 2306 } 2307 function isNullish(value) { 2308 return (value !== null && value !== void 0 ? value : null) === null; 2309 } 2310 function isNotNullish(item) { 2311 return !isNullish(item); 2312 } 2313 2314 var util = /*#__PURE__*/Object.freeze({ 2315 __proto__: null, 2316 debounce: debounce, 2317 debounceAsync: debounceAsync, 2318 deepEqual: deepEqual, 2319 isNotNullish: isNotNullish, 2320 isNullish: isNullish 2321 }); 2322 exports('util', util); 2323 2324 var PageMessages = { 2325 QueryStringChanged: "page.core.queryStringChanged" 2326 }; 2327 var BlockMessages = { 2328 BeginEdit: "block.core.beginEdit", 2329 EndEdit: "block.core.endEdit" 2330 }; 2331 function useBrowserBus(options) { 2332 return new BrowserBus(options !== null && options !== void 0 ? options : {}); 2333 } 2334 var customDomEventName = "rockMessage"; 2335 class BrowserBus { 2336 constructor(options) { 2337 _defineProperty(this, "handlers", []); 2338 this.options = _objectSpread2({}, options); 2339 this.eventListener = e => this.onEvent(e); 2340 document.addEventListener(customDomEventName, this.eventListener); 2341 } 2342 onEvent(event) { 2343 if (!(event instanceof CustomEvent)) { 2344 return; 2345 } 2346 var message = event.detail; 2347 if (!message.name) { 2348 return; 2349 } 2350 if (typeof message.timestamp === "undefined") { 2351 message = _objectSpread2(_objectSpread2({}, message), {}, { 2352 timestamp: 0 2353 }); 2354 } 2355 this.onMessage(message); 2356 } 2357 onMessage(message) { 2358 var handlers = [...this.handlers]; 2359 for (var _i = 0, _handlers = handlers; _i < _handlers.length; _i++) { 2360 var handler = _handlers[_i]; 2361 try { 2362 if (handler.name && handler.name !== message.name) { 2363 continue; 2364 } 2365 if (handler.blockType && !areEqual(handler.blockType, message.blockType)) { 2366 continue; 2367 } 2368 if (handler.block && !areEqual(handler.block, message.block)) { 2369 continue; 2370 } 2371 handler.callback(message); 2372 } catch (e) { 2373 console.error(e); 2374 } 2375 } 2376 } 2377 dispose() { 2378 document.removeEventListener(customDomEventName, this.eventListener); 2379 this.handlers.splice(0, this.handlers.length); 2380 } 2381 publish(messageName, data) { 2382 this.publishMessage({ 2383 name: messageName, 2384 timestamp: Date.now(), 2385 blockType: this.options.blockType, 2386 block: this.options.block, 2387 data 2388 }); 2389 } 2390 publishMessage(message) { 2391 var event = new CustomEvent(customDomEventName, { 2392 detail: message 2393 }); 2394 document.dispatchEvent(event); 2395 } 2396 subscribe(messageNameOrCallback, callback) { 2397 var name; 2398 if (typeof messageNameOrCallback === "string") { 2399 name = messageNameOrCallback; 2400 } else { 2401 name = undefined; 2402 callback = messageNameOrCallback; 2403 } 2404 if (!callback) { 2405 return; 2406 } 2407 this.handlers.push({ 2408 name, 2409 callback 2410 }); 2411 } 2412 subscribeToBlockType(messageNameOrBlockType, blockTypeOrCallback, callback) { 2413 var name; 2414 var blockType; 2415 if (typeof blockTypeOrCallback === "string") { 2416 name = messageNameOrBlockType; 2417 blockType = blockTypeOrCallback; 2418 } else { 2419 blockType = messageNameOrBlockType; 2420 callback = blockTypeOrCallback; 2421 } 2422 if (!blockType || !callback) { 2423 return; 2424 } 2425 this.handlers.push({ 2426 name, 2427 blockType, 2428 callback 2429 }); 2430 } 2431 subscribeToBlock(messageNameOrBlock, blockOrCallback, callback) { 2432 var name; 2433 var block; 2434 if (typeof blockOrCallback === "string") { 2435 name = messageNameOrBlock; 2436 block = blockOrCallback; 2437 } else { 2438 block = messageNameOrBlock; 2439 callback = blockOrCallback; 2440 } 2441 if (!block || !callback) { 2442 return; 2443 } 2444 this.handlers.push({ 2445 name, 2446 block, 2447 callback 2448 }); 2449 } 2450 } 2451 2452 var browserBus = /*#__PURE__*/Object.freeze({ 2453 __proto__: null, 2454 BlockMessages: BlockMessages, 2455 BrowserBus: BrowserBus, 2456 PageMessages: PageMessages, 2457 useBrowserBus: useBrowserBus 2458 }); 2459 exports('browserBus', browserBus); 2460 2461 var blockReloadSymbol = Symbol(); 2462 var configurationValuesChangedSymbol = Symbol(); 2463 var staticContentSymbol = Symbol("static-content"); 2464 var blockBrowserBusSymbol = Symbol("block-browser-bus"); 2465 function useConfigurationValues() { 2466 var result = inject("configurationValues"); 2467 if (result === undefined) { 2468 throw "Attempted to access block configuration outside of a RockBlock."; 2469 } 2470 return result.value; 2471 } 2472 function useInvokeBlockAction() { 2473 var result = inject("invokeBlockAction"); 2474 if (result === undefined) { 2475 throw "Attempted to access block action invocation outside of a RockBlock."; 2476 } 2477 return result; 2478 } 2479 function useBlockActionUrl() { 2480 var result = inject("blockActionUrl"); 2481 if (result === undefined) { 2482 throw "Attempted to access block action URL outside of a RockBlock."; 2483 } 2484 return result; 2485 } 2486 function createInvokeBlockAction(post, pageGuid, blockGuid, pageParameters, sessionGuid, interactionGuid) { 2487 function invokeBlockAction(_x) { 2488 return _invokeBlockAction.apply(this, arguments); 2489 } 2490 function _invokeBlockAction() { 2491 _invokeBlockAction = _asyncToGenerator(function* (actionName) { 2492 var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; 2493 var actionContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; 2494 var cancellationToken = arguments.length > 3 ? arguments[3] : undefined; 2495 var context = {}; 2496 if (actionContext) {
2497 context = _objectSpread2({}, actionContext); 2498 } 2499 context.pageParameters = pageParameters; 2500 context.interactionGuid = interactionGuid; 2501 context.sessionGuid = sessionGuid; 2502 return yield post("/api/v2/BlockActions/".concat(pageGuid, "/").concat(blockGuid, "/").concat(actionName), undefined, _objectSpread2({ 2503 __context: context 2504 }, data), cancellationToken); 2505 }); 2506 return _invokeBlockAction.apply(this, arguments); 2507 } 2508 return invokeBlockAction; 2509 } 2510 function provideReloadBlock(callback) { 2511 provide(blockReloadSymbol, callback); 2512 } 2513 function useReloadBlock() { 2514 return inject(blockReloadSymbol, () => {}); 2515 } 2516 function provideConfigurationValuesChanged() { 2517 var callbacks = []; 2518 provide(configurationValuesChangedSymbol, callbacks); 2519 return { 2520 invoke: () => { 2521 for (var _i = 0, _callbacks = callbacks; _i < _callbacks.length; _i++) { 2522 var c = _callbacks[_i]; 2523 c(); 2524 } 2525 }, 2526 reset: () => { 2527 callbacks.splice(0, callbacks.length); 2528 } 2529 }; 2530 } 2531 function onConfigurationValuesChanged(callback) { 2532 var callbacks = inject(configurationValuesChangedSymbol); 2533 if (callbacks !== undefined) { 2534 callbacks.push(callback); 2535 } 2536 } 2537 function provideStaticContent(content) { 2538 provide(staticContentSymbol, content); 2539 } 2540 function useStaticContent() { 2541 var content = inject(staticContentSymbol); 2542 if (!content) { 2543 return []; 2544 } 2545 return content.value; 2546 } 2547 function provideBlockBrowserBus(bus) { 2548 provide(blockBrowserBusSymbol, bus); 2549 } 2550 function useBlockBrowserBus() { 2551 return inject(blockBrowserBusSymbol, () => useBrowserBus(), true); 2552 } 2553 function setCustomSettingsBoxValue(box, propertyName, value) { 2554 if (!box.settings) { 2555 box.settings = {}; 2556 } 2557 box.settings[propertyName] = value; 2558 if (!box.validProperties) { 2559 box.validProperties = []; 2560 } 2561 if (!box.validProperties.includes(propertyName)) { 2562 box.validProperties.push(propertyName); 2563 } 2564 } 2565 function setPropertiesBoxValue(box, propertyName, value) { 2566 if (!box.bag) { 2567 box.bag = {}; 2568 } 2569 box.bag[propertyName] = value; 2570 if (!box.validProperties) { 2571 box.validProperties = []; 2572 } 2573 if (!box.validProperties.some(p => p.toLowerCase() === propertyName.toLowerCase())) { 2574 box.validProperties.push(propertyName); 2575 } 2576 } 2577 function dispatchBlockEvent(eventName, blockGuid, eventData) { 2578 var ev = new CustomEvent(eventName, { 2579 cancelable: true, 2580 detail: { 2581 guid: blockGuid, 2582 data: eventData 2583 } 2584 }); 2585 return document.dispatchEvent(ev); 2586 } 2587 function isBlockEvent(event) { 2588 return event instanceof CustomEvent && typeof event.detail === "object" && "guid" in event.detail && "data" in event.detail; 2589 } 2590 var entityTypeNameSymbol = Symbol("EntityTypeName"); 2591 var entityTypeGuidSymbol = Symbol("EntityTypeGuid"); 2592 function useEntityDetailBlock(options) { 2593 var securityGrant = getSecurityGrant(options.blockConfig.securityGrantToken); 2594 provideSecurityGrant(securityGrant); 2595 if (options.blockConfig.entityTypeName) { 2596 provideEntityTypeName(options.blockConfig.entityTypeName); 2597 } 2598 if (options.blockConfig.entityTypeGuid) { 2599 provideEntityTypeGuid(options.blockConfig.entityTypeGuid); 2600 } 2601 var entity = options.entity; 2602 var result = {}; 2603 if (entity) { 2604 var invokeBlockAction = useInvokeBlockAction(); 2605 var refreshAttributesDebounce = debounce(() => refreshEntityDetailAttributes(entity, invokeBlockAction), undefined, true); 2606 result.onPropertyChanged = propertyName => { 2607 if (!options.blockConfig.qualifiedAttributeProperties || !options.blockConfig.qualifiedAttributeProperties.some(n => n.toLowerCase() === propertyName.toLowerCase())) { 2608 return; 2609 } 2610 refreshAttributesDebounce(); 2611 }; 2612 } 2613 return result; 2614 } 2615 function provideEntityTypeName(name) { 2616 provide(entityTypeNameSymbol, name); 2617 } 2618 function useEntityTypeName() { 2619 return inject(entityTypeNameSymbol, undefined); 2620 } 2621 function provideEntityTypeGuid(guid) { 2622 provide(entityTypeGuidSymbol, guid); 2623 } 2624 function useEntityTypeGuid() { 2625 return inject(entityTypeGuidSymbol, undefined); 2626 } 2627 var securityGrantSymbol = Symbol(); 2628 function getSecurityGrant(token) { 2629 var tokenRef = ref(token || null); 2630 var invokeBlockAction = useInvokeBlockAction(); 2631 var renewalTimeout = null; 2632 var renewToken = function () { 2633 var _ref = _asyncToGenerator(function* () { 2634 var result = yield invokeBlockAction("RenewSecurityGrantToken"); 2635 if (result.isSuccess && result.data) { 2636 tokenRef.value = result.data; 2637 scheduleRenewal(); 2638 } 2639 }); 2640 return function renewToken() { 2641 return _ref.apply(this, arguments); 2642 }; 2643 }(); 2644 var scheduleRenewal = () => { 2645 var _tokenRef$value; 2646 if (renewalTimeout !== null) { 2647 clearTimeout(renewalTimeout); 2648 renewalTimeout = null; 2649 } 2650 if (tokenRef.value === null) { 2651 return; 2652 } 2653 var segments = (_tokenRef$value = tokenRef.value) === null || _tokenRef$value === void 0 ? void 0 : _tokenRef$value.split(";"); 2654 if (segments.length !== 3 || segments[0] !== "1") { 2655 return; 2656 } 2657 var expiresDateTime = RockDateTime.parseISO(segments[1]); 2658 if (expiresDateTime === null) { 2659 return; 2660 } 2661 var renewTimeout = expiresDateTime.addMinutes(-15).toMilliseconds() - RockDateTime.now().toMilliseconds(); 2662 if (renewTimeout < 0) { 2663 return; 2664 } 2665 renewalTimeout = setTimeout(renewToken, renewTimeout); 2666 }; 2667 scheduleRenewal(); 2668 return { 2669 token: tokenRef, 2670 updateToken(newToken) { 2671 tokenRef.value = newToken || null; 2672 scheduleRenewal(); 2673 } 2674 }; 2675 } 2676 function provideSecurityGrant(grant) { 2677 provide(securityGrantSymbol, grant); 2678 } 2679 function useSecurityGrantToken() { 2680 var grant = inject(securityGrantSymbol); 2681 return grant ? grant.token : ref(null); 2682 } 2683 function watchPropertyChanges(propertyRefs, emit) { 2684 var _iterator = _createForOfIteratorHelper(propertyRefs), 2685 _step; 2686 try { 2687 var _loop = function _loop() { 2688 var propRef = _step.value; 2689 watch(propRef, () => { 2690 if (propRef.context.propertyName) { 2691 emit("propertyChanged", propRef.context.propertyName); 2692 } 2693 }); 2694 }; 2695 for (_iterator.s();
2695 !(_step = _iterator.n()).done;) { 2696 _loop(); 2697 } 2698 } catch (err) { 2699 _iterator.e(err); 2700 } finally { 2701 _iterator.f(); 2702 } 2703 } 2704 function refreshEntityDetailAttributes(_x2, _x3) { 2705 return _refreshEntityDetailAttributes.apply(this, arguments); 2706 } 2707 function _refreshEntityDetailAttributes() { 2708 _refreshEntityDetailAttributes = _asyncToGenerator(function* (box, invokeBlockAction) { 2709 var result = yield invokeBlockAction("RefreshAttributes", { 2710 box: box.value 2711 }); 2712 if (result.isSuccess) { 2713 if (result.statusCode === 200 && result.data && box.value) { 2714 var _result$data$bag, _result$data$bag2; 2715 var newBox = _objectSpread2(_objectSpread2({}, box.value), {}, { 2716 bag: _objectSpread2(_objectSpread2({}, box.value.bag), {}, { 2717 attributes: (_result$data$bag = result.data.bag) === null || _result$data$bag === void 0 ? void 0 : _result$data$bag.attributes, 2718 attributeValues: (_result$data$bag2 = result.data.bag) === null || _result$data$bag2 === void 0 ? void 0 : _result$data$bag2.attributeValues 2719 }) 2720 }); 2721 box.value = newBox; 2722 } 2723 } 2724 }); 2725 return _refreshEntityDetailAttributes.apply(this, arguments); 2726 } 2727 function refreshDetailAttributes(_x4, _x5, _x6) { 2728 return _refreshDetailAttributes.apply(this, arguments); 2729 } 2730 function _refreshDetailAttributes() { 2731 _refreshDetailAttributes = _asyncToGenerator(function* (bag, validProperties, invokeBlockAction) { 2732 var data = { 2733 entity: bag.value, 2734 isEditable: true, 2735 validProperties: validProperties 2736 }; 2737 var result = yield invokeBlockAction("RefreshAttributes", { 2738 box: data 2739 }); 2740 if (result.isSuccess) { 2741 if (result.statusCode === 200 && result.data && bag.value) { 2742 var _result$data$entity, _result$data$entity2; 2743 var newBag = _objectSpread2(_objectSpread2({}, bag.value), {}, { 2744 attributes: (_result$data$entity = result.data.entity) === null || _result$data$entity === void 0 ? void 0 : _result$data$entity.attributes, 2745 attributeValues: (_result$data$entity2 = result.data.entity) === null || _result$data$entity2 === void 0 ? void 0 : _result$data$entity2.attributeValues 2746 }); 2747 bag.value = newBag; 2748 } 2749 } 2750 }); 2751 return _refreshDetailAttributes.apply(this, arguments); 2752 } 2753 var blockGuidSymbol = Symbol("block-guid"); 2754 var blockTypeGuidSymbol = Symbol("block-type-guid"); 2755 function provideBlockGuid(blockGuid) { 2756 provide(blockGuidSymbol, blockGuid); 2757 } 2758 function useBlockGuid() { 2759 return inject(blockGuidSymbol); 2760 } 2761 function provideBlockTypeGuid(blockTypeGuid) { 2762 provide(blockTypeGuidSymbol, blockTypeGuid); 2763 } 2764 function useBlockTypeGuid() { 2765 return inject(blockTypeGuidSymbol); 2766 } 2767 var blockPreferenceProviderSymbol = Symbol(); 2768 var emptyPreferences = { 2769 getValue() { 2770 return ""; 2771 }, 2772 setValue() {}, 2773 getKeys() { 2774 return []; 2775 }, 2776 containsKey() { 2777 return false; 2778 }, 2779 save() { 2780 return Promise.resolve(); 2781 }, 2782 withPrefix() { 2783 return emptyPreferences; 2784 }, 2785 on() {}, 2786 off() {} 2787 }; 2788 var emptyPreferenceProvider = { 2789 blockPreferences: emptyPreferences, 2790 getGlobalPreferences() { 2791 return Promise.resolve(emptyPreferences); 2792 }, 2793 getEntityPreferences() { 2794 return Promise.resolve(emptyPreferences); 2795 } 2796 }; 2797 function providePersonPreferences(provider) { 2798 provide(blockPreferenceProviderSymbol, provider); 2799 } 2800 function usePersonPreferences() { 2801 var _inject; 2802 return (_inject = inject(blockPreferenceProviderSymbol)) !== null && _inject !== void 0 ? _inject : emptyPreferenceProvider; 2803 } 2804 2805 var block = /*#__PURE__*/Object.freeze({ 2806 __proto__: null, 2807 createInvokeBlockAction: createInvokeBlockAction, 2808 dispatchBlockEvent: dispatchBlockEvent, 2809 getSecurityGrant: getSecurityGrant, 2810 isBlockEvent: isBlockEvent, 2811 onConfigurationValuesChanged: onConfigurationValuesChanged, 2812 provideBlockBrowserBus: provideBlockBrowserBus, 2813 provideBlockGuid: provideBlockGuid, 2814 provideBlockTypeGuid: provideBlockTypeGuid, 2815 provideConfigurationValuesChanged: provideConfigurationValuesChanged, 2816 provideEntityTypeGuid: provideEntityTypeGuid, 2817 provideEntityTypeName: provideEntityTypeName, 2818 providePersonPreferences: providePersonPreferences, 2819 provideReloadBlock: provideReloadBlock, 2820 provideSecurityGrant: provideSecurityGrant, 2821 provideStaticContent: provideStaticContent, 2822 refreshDetailAttributes: refreshDetailAttributes, 2823 setCustomSettingsBoxValue: setCustomSettingsBoxValue, 2824 setPropertiesBoxValue: setPropertiesBoxValue, 2825 useBlockActionUrl: useBlockActionUrl, 2826 useBlockBrowserBus: useBlockBrowserBus, 2827 useBlockGuid: useBlockGuid, 2828 useBlockTypeGuid: useBlockTypeGuid, 2829 useConfigurationValues: useConfigurationValues, 2830 useEntityDetailBlock: useEntityDetailBlock, 2831 useEntityTypeGuid: useEntityTypeGuid, 2832 useEntityTypeName: useEntityTypeName, 2833 useInvokeBlockAction: useInvokeBlockAction, 2834 usePersonPreferences: usePersonPreferences, 2835 useReloadBlock: useReloadBlock, 2836 useSecurityGrantToken: useSecurityGrantToken, 2837 useStaticContent: useStaticContent,
2838 watchPropertyChanges: watchPropertyChanges 2839 }); 2840 exports('block', block); 2841 2842 function asBooleanOrNull(val) { 2843 if (val === undefined || val === null) { 2844 return null; 2845 } 2846 if (typeof val === "boolean") { 2847 return val; 2848 } 2849 if (typeof val === "string") { 2850 var asString = (val || "").trim().toLowerCase(); 2851 if (!asString) { 2852 return null; 2853 } 2854 return ["true", "yes", "t", "y", "1"].indexOf(asString) !== -1; 2855 } 2856 if (typeof val === "number") { 2857 return !!val; 2858 } 2859 return null; 2860 } 2861 function asBoolean(val) { 2862 return !!asBooleanOrNull(val); 2863 } 2864 function asYesNoOrNull(val) { 2865 var boolOrNull = asBooleanOrNull(val); 2866 if (boolOrNull === null) { 2867 return null; 2868 } 2869 return boolOrNull ? "Yes" : "No"; 2870 } 2871 function asTrueFalseOrNull(val) { 2872 var boolOrNull = asBooleanOrNull(val); 2873 if (boolOrNull === null) { 2874 return null; 2875 } 2876 return boolOrNull ? "True" : "False"; 2877 } 2878 function asTrueOrFalseString(val) { 2879 var boolOrNull = asBooleanOrNull(val); 2880 return boolOrNull ? "True" : "False"; 2881 } 2882 2883 var booleanUtils = /*#__PURE__*/Object.freeze({ 2884 __proto__: null, 2885 asBoolean: asBoolean, 2886 asBooleanOrNull: asBooleanOrNull, 2887 asTrueFalseOrNull: asTrueFalseOrNull, 2888 asTrueOrFalseString: asTrueOrFalseString, 2889 asYesNoOrNull: asYesNoOrNull 2890 }); 2891 exports('booleanUtils', booleanUtils); 2892 2893 var keyPrefix = "ObsidianCache_"; 2894 function set(key, value) { 2895 var ttl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 60; 2896 if (typeof ttl !== "number") { 2897 ttl = 60; 2898 console.warn("Cache.set has been changed to use a Time-To-Live instead of an expiration date/time. Please update your code to use a Time-To-Live."); 2899 } 2900 var expiration = RockDateTime.now().addSeconds(ttl).toMilliseconds(); 2901 var cache = { 2902 expiration, 2903 value 2904 }; 2905 var cacheJson = JSON.stringify(cache); 2906 sessionStorage.setItem(keyPrefix + key, cacheJson); 2907 } 2908 function get(key) { 2909 var cacheJson = sessionStorage.getItem(keyPrefix + key); 2910 if (!cacheJson) { 2911 return null; 2912 } 2913 var cache = JSON.parse(cacheJson); 2914 if (!cache || !cache.expiration) { 2915 return null; 2916 } 2917 if (cache.expiration < RockDateTime.now().toMilliseconds()) { 2918 return null; 2919 } 2920 return cache.value; 2921 } 2922 var promiseCache = {}; 2923 function cachePromiseFactory(key, fn, ttl) { 2924 return _asyncToGenerator(function* () { 2925 var _promiseCache$key; 2926 if (typeof ttl !== "number" || ttl !== undefined) { 2927 console.warn("Cache.cachePromiseFactory has been changed to use a Time-To-Live instead of an expiration date/time. Please update your code to use a Time-To-Live."); 2928 } 2929 var cachedResult = get(key); 2930 if (cachedResult) { 2931 return cachedResult; 2932 } 2933 if (promiseCache[key]) { 2934 return promiseCache[key]; 2935 } 2936 promiseCache[key] = fn(); 2937 (_promiseCache$key = promiseCache[key]) === null || _promiseCache$key === void 0 || _promiseCache$key.then(result => { 2938 set(key, result, ttl); 2939 delete promiseCache[key]; 2940 return result; 2941 }).catch(e => { 2942 delete promiseCache[key]; 2943 throw e; 2944 }); 2945 return promiseCache[key]; 2946 }); 2947 } 2948 var Cache = { 2949 set, 2950 get, 2951 cachePromiseFactory 2952 }; 2953 2954 var cache = /*#__PURE__*/Object.freeze({ 2955 __proto__: null, 2956 default: Cache 2957 }); 2958 exports('cache', cache); 2959 2960 var suspenseSymbol = Symbol("RockSuspense"); 2961 class BasicSuspenseProvider { 2962 constructor(parentProvider) { 2963 this.operationKey = newGuid(); 2964 this.parentProvider = parentProvider; 2965 this.pendingOperations = []; 2966 this.finishedHandlers = []; 2967 } 2968 allOperationsComplete() { 2969 nextTick(() => { 2970 if (this.pendingOperations.length !== 0) { 2971 return; 2972 } 2973 var _iterator = _createForOfIteratorHelper(this.finishedHandlers), 2974 _step; 2975 try { 2976 for (_iterator.s();
2976 !(_step = _iterator.n()).done;) { 2977 var handler = _step.value; 2978 handler(); 2979 } 2980 } catch (err) { 2981 _iterator.e(err); 2982 } finally { 2983 _iterator.f(); 2984 } 2985 this.finishedHandlers = []; 2986 if (this.parentProvider) { 2987 this.parentProvider.completeAsyncOperation(this.operationKey); 2988 } 2989 }); 2990 } 2991 addOperation(operation) { 2992 var operationKey = newGuid(); 2993 this.startAsyncOperation(operationKey); 2994 operation.then(() => this.completeAsyncOperation(operationKey)).catch(() => this.completeAsyncOperation(operationKey)); 2995 } 2996 startAsyncOperation(key) { 2997 this.pendingOperations.push(key); 2998 if (this.pendingOperations.length === 1 && this.parentProvider) { 2999 this.parentProvider.startAsyncOperation(this.operationKey); 3000 } 3001 } 3002 completeAsyncOperation(key) { 3003 var index = this.pendingOperations.indexOf(key); 3004 if (index !== -1) { 3005 this.pendingOperations.splice(index, 1); 3006 } 3007 if (this.pendingOperations.length === 0) { 3008 this.allOperationsComplete(); 3009 } 3010 } 3011 hasPendingOperations() { 3012 return this.pendingOperations.length > 0; 3013 } 3014 addFinishedHandler(callback) { 3015 this.finishedHandlers.push(callback); 3016 } 3017 } 3018 function provideSuspense(provider) { 3019 provide(suspenseSymbol, provider); 3020 } 3021 function useSuspense() { 3022 return inject(suspenseSymbol, undefined); 3023 } 3024 3025 var suspense = /*#__PURE__*/Object.freeze({ 3026 __proto__: null, 3027 BasicSuspenseProvider: BasicSuspenseProvider, 3028 provideSuspense: provideSuspense, 3029 useSuspense: useSuspense 3030 }); 3031 exports('suspense', suspense); 3032 3033 function asFormattedString(num, digits) { 3034 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 3035 if (num === null) { 3036 return ""; 3037 } 3038 return num.toLocaleString("en-US", _objectSpread2({ 3039 minimumFractionDigits: digits, 3040 maximumFractionDigits: digits !== null && digits !== void 0 ? digits : 9 3041 }, options)); 3042 } 3043 function toNumber(str) { 3044 return toNumberOrNull(str) || 0; 3045 } 3046 function toNumberOrNull(str) { 3047 if (str === null || str === undefined || str === "") { 3048 return null; 3049 } 3050 if (typeof str === "number") { 3051 return str; 3052 } 3053 var replaced = str.replace(/[$,]/g, ""); 3054 var num = Number(replaced); 3055 return !isNaN(num) ? num : null; 3056 } 3057 function toCurrencyOrNull(value) { 3058 var _currencyInfo$symbol, _currencyInfo$decimal; 3059 var currencyInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; 3060 if (typeof value === "string") { 3061 value = toNumberOrNull(value); 3062 } 3063 if (value === null || value === undefined) { 3064 return null; 3065 } 3066 var currencySymbol = (_currencyInfo$symbol = currencyInfo === null || currencyInfo === void 0 ? void 0 : currencyInfo.symbol) !== null && _currencyInfo$symbol !== void 0 ? _currencyInfo$symbol : "$"; 3067 var currencyDecimalPlaces = (_currencyInfo$decimal = currencyInfo === null || currencyInfo === void 0 ? void 0 : currencyInfo.decimalPlaces) !== null && _currencyInfo$decimal !== void 0 ? _currencyInfo$decimal : 2; 3068 return "".concat(currencySymbol).concat(asFormattedString(value, currencyDecimalPlaces)); 3069 } 3070 function toOrdinalSuffix(num) { 3071 if (!num) { 3072 return ""; 3073 } 3074 var j = num % 10; 3075 var k = num % 100; 3076 if (j == 1 && k != 11) { 3077 return num + "st"; 3078 } 3079 if (j == 2 && k != 12) { 3080 return num + "nd"; 3081 } 3082 if (j == 3 && k != 13) { 3083 return num + "rd"; 3084 } 3085 return num + "th"; 3086 } 3087 function toOrdinal(num) { 3088 if (!num) { 3089 return ""; 3090 } 3091 switch (num) { 3092 case 1: 3093 return "first"; 3094 case 2: 3095 return "second"; 3096 case 3: 3097 return "third"; 3098 case 4: 3099 return "fourth"; 3100 case 5: 3101 return "fifth"; 3102 case 6: 3103 return "sixth"; 3104 case 7: 3105 return "seventh"; 3106 case 8: 3107 return "eighth"; 3108 case 9: 3109 return "ninth"; 3110 case 10: 3111 return "tenth"; 3112 default: 3113 return toOrdinalSuffix(num); 3114 } 3115 } 3116 function toWord(num) { 3117 if (num === null || num === undefined) { 3118 return ""; 3119 } 3120 switch (num) { 3121 case 1: 3122 return "one"; 3123 case 2:
3124 return "two"; 3125 case 3: 3126 return "three"; 3127 case 4: 3128 return "four"; 3129 case 5: 3130 return "five"; 3131 case 6: 3132 return "six"; 3133 case 7: 3134 return "seven"; 3135 case 8: 3136 return "eight"; 3137 case 9: 3138 return "nine"; 3139 case 10: 3140 return "ten"; 3141 default: 3142 return "".concat(num); 3143 } 3144 } 3145 function zeroPad(num, length) { 3146 var str = num.toString(); 3147 while (str.length < length) { 3148 str = "0" + str; 3149 } 3150 return str; 3151 } 3152 function toDecimalPlaces(num, decimalPlaces) { 3153 decimalPlaces = Math.floor(decimalPlaces); 3154 return Math.round(num * Math.pow(10, decimalPlaces)) / Math.pow(10, decimalPlaces); 3155 } 3156 function toWordFull(numb) { 3157 var numberWords = { 3158 0: "zero", 3159 1: "one", 3160 2: "two", 3161 3: "three", 3162 4: "four", 3163 5: "five", 3164 6: "six", 3165 7: "seven", 3166 8: "eight", 3167 9: "nine", 3168 10: "ten", 3169 11: "eleven", 3170 12: "twelve", 3171 13: "thirteen", 3172 14: "fourteen", 3173 15: "fifteen", 3174 16: "sixteen", 3175 17: "seventeen", 3176 18: "eighteen", 3177 19: "nineteen", 3178 20: "twenty", 3179 30: "thirty", 3180 40: "forty", 3181 50: "fifty", 3182 60: "sixty", 3183 70: "seventy", 3184 80: "eighty", 3185 90: "ninety", 3186 100: "one hundred", 3187 1000: "one thousand", 3188 1000000: "one million", 3189 1000000000: "one billion", 3190 1000000000000: "one trillion", 3191 1000000000000000: "one quadrillion" 3192 }; 3193 var oneHundred = 100; 3194 var oneThousand = 1000; 3195 var oneMillion = 1000000; 3196 var oneBillion = 1000000000; 3197 var oneTrillion = 1000000000000; 3198 var oneQuadrillion = 1000000000000000; 3199 if (numberWords[numb]) { 3200 return numberWords[numb]; 3201 } 3202 function quadrillionsToWord(numb) { 3203 var trillions = trillionsToWord(numb); 3204 if (numb >= oneQuadrillion) { 3205 var quadrillions = hundredsToWord(Number(numb.toString().slice(-18, -15))); 3206 if (trillions) { 3207 return "".concat(quadrillions, " quadrillion ").concat(trillions); 3208 } else { 3209 return "".concat(quadrillions, " quadrillion"); 3210 } 3211 } else { 3212 return trillions; 3213 } 3214 } 3215 function trillionsToWord(numb) { 3216 numb = Number(numb.toString().slice(-15)); 3217 var billions = billionsToWord(numb); 3218 if (numb >= oneTrillion) { 3219 var trillions = hundredsToWord(Number(numb.toString().slice(-15, -12))); 3220 if (billions) { 3221 return "".concat(trillions, " trillion ").concat(billions); 3222 } else { 3223 return "".concat(trillions, " trillion"); 3224 } 3225 } else { 3226 return billions; 3227 } 3228 } 3229 function billionsToWord(numb) { 3230 numb = Number(numb.toString().slice(-12)); 3231 var millions = millionsToWord(numb); 3232 if (numb >= oneBillion) { 3233 var billions = hundredsToWord(Number(numb.toString().slice(-12, -9))); 3234 if (millions) { 3235 return "".concat(billions, " billion ").concat(millions); 3236 } else { 3237 return "".concat(billions, " billion"); 3238 } 3239 } else { 3240 return millions; 3241 } 3242 } 3243 function millionsToWord(numb) { 3244 numb = Number(numb.toString().slice(-9)); 3245 var thousands = thousandsToWord(numb); 3246 if (numb >= oneMillion) { 3247 var millions = hundredsToWord(Number(numb.toString().slice(-9, -6))); 3248 if (thousands) { 3249 return "".concat(millions, " million ").concat(thousands); 3250 } else { 3251 return "".concat(millions, " million"); 3252 } 3253 } else { 3254 return thousands; 3255 } 3256 }
3257 function thousandsToWord(numb) { 3258 numb = Number(numb.toString().slice(-6)); 3259 var hundreds = hundredsToWord(numb); 3260 if (numb >= oneThousand) { 3261 var thousands = hundredsToWord(Number(numb.toString().slice(-6, -3))); 3262 if (hundreds) { 3263 return "".concat(thousands, " thousand ").concat(hundreds); 3264 } else { 3265 return "".concat(thousands, " thousandths"); 3266 } 3267 } else { 3268 return hundreds; 3269 } 3270 } 3271 function hundredsToWord(numb) { 3272 numb = Number(numb.toString().slice(-3)); 3273 if (numberWords[numb]) { 3274 return numberWords[numb]; 3275 } 3276 var tens = tensToWord(numb); 3277 if (numb >= oneHundred) { 3278 var hundreds = Number(numb.toString().slice(-3, -2)); 3279 if (tens) { 3280 return "".concat(numberWords[hundreds], " hundred ").concat(tens); 3281 } else { 3282 return "".concat(numberWords[hundreds], " hundred"); 3283 } 3284 } else { 3285 return tens; 3286 } 3287 } 3288 function tensToWord(numb) { 3289 numb = Number(numb.toString().slice(-2)); 3290 if (numberWords[numb]) { 3291 return numberWords[numb]; 3292 } 3293 var ones = onesToWord(numb); 3294 if (numb >= 20) { 3295 var tens = Number(numb.toString().slice(-2, -1)); 3296 if (ones) { 3297 return "".concat(numberWords[tens * 10], "-").concat(ones); 3298 } else { 3299 return numberWords[tens * 10]; 3300 } 3301 } else { 3302 return ones; 3303 } 3304 } 3305 function onesToWord(numb) { 3306 numb = Number(numb.toString().slice(-1)); 3307 return numberWords[numb]; 3308 } 3309 return quadrillionsToWord(numb); 3310 } 3311 var numberUtils = { 3312 toOrdinal, 3313 toOrdinalSuffix, 3314 toNumberOrNull, 3315 asFormattedString 3316 }; 3317 3318 var numberUtils$1 = /*#__PURE__*/Object.freeze({ 3319 __proto__: null, 3320 asFormattedString: asFormattedString, 3321 default: numberUtils, 3322 toCurrencyOrNull: toCurrencyOrNull, 3323 toDecimalPlaces: toDecimalPlaces, 3324 toNumber: toNumber, 3325 toNumberOrNull: toNumberOrNull, 3326 toOrdinal: toOrdinal, 3327 toOrdinalSuffix: toOrdinalSuffix, 3328 toWord: toWord, 3329 toWordFull: toWordFull, 3330 zeroPad: zeroPad 3331 }); 3332 exports('numberUtils', numberUtils$1); 3333 3334 function useVModelPassthrough(props, modelName, emit, options) { 3335 var internalValue = ref(props[modelName]); 3336 watch(() => props[modelName], val => updateRefValue(internalValue, val), options); 3337 watch(internalValue, val => { 3338 if (val !== props[modelName]) { 3339 emit("update:".concat(modelName), val); 3340 } 3341 }, options); 3342 return internalValue; 3343 } 3344 function useVModelPassthroughWithPropUpdateCheck(props, modelName, emit, options) { 3345 var internalValue = ref(props[modelName]); 3346 var listeners = []; 3347 watch(() => props[modelName], val => { 3348 if (updateRefValue(internalValue, val)) { 3349 onPropUpdate(); 3350 } 3351 }, options); 3352 watch(internalValue, val => emit("update:".concat(modelName), val), options); 3353 function onPropUpdate() { 3354 listeners.forEach(fn => fn()); 3355 } 3356 function addPropUpdateListener(fn) { 3357 listeners.push(fn); 3358 } 3359 return [internalValue, addPropUpdateListener]; 3360 } 3361 function updateRefValue(target, value) { 3362 if (deepEqual(target.value, value, true)) { 3363 return false; 3364 } 3365 target.value = value; 3366 return true; 3367 } 3368 function defineAsyncComponent(source) { 3369 return defineAsyncComponent$1(_asyncToGenerator(function* () { 3370 var suspense = useSuspense(); 3371 var operationKey = newGuid(); 3372 suspense === null || suspense === void 0 || suspense.startAsyncOperation(operationKey); 3373 var component = yield source(); 3374 suspense === null || suspense === void 0 || suspense.completeAsyncOperation(operationKey); 3375 return component; 3376 })); 3377 }
3378 var standardRockFormFieldProps = { 3379 label: { 3380 type: String, 3381 default: "" 3382 }, 3383 disableLabel: { 3384 type: Boolean, 3385 default: false 3386 }, 3387 help: { 3388 type: String, 3389 default: "" 3390 }, 3391 rules: { 3392 type: [Array, Object, String], 3393 default: "" 3394 }, 3395 formGroupClasses: { 3396 type: String, 3397 default: "" 3398 }, 3399 validationTitle: { 3400 type: String, 3401 default: "" 3402 }, 3403 isRequiredIndicatorHidden: { 3404 type: Boolean, 3405 default: false 3406 } 3407 }; 3408 function copyStandardRockFormFieldProps(source, destination) { 3409 destination.formGroupClasses = source.formGroupClasses; 3410 destination.help = source.help; 3411 destination.label = source.label; 3412 destination.rules = source.rules; 3413 destination.validationTitle = source.validationTitle; 3414 } 3415 function useStandardRockFormFieldProps(props) { 3416 var propValues = reactive({ 3417 label: props.label, 3418 disableLabel: props.disableLabel, 3419 help: props.help, 3420 rules: props.rules, 3421 formGroupClasses: props.formGroupClasses, 3422 validationTitle: props.validationTitle, 3423 isRequiredIndicatorHidden: props.isRequiredIndicatorHidden 3424 }); 3425 watch([() => props.formGroupClasses, () => props.help, () => props.label, () => props.rules, () => props.validationTitle], () => { 3426 copyStandardRockFormFieldProps(props, propValues); 3427 }); 3428 return propValues; 3429 } 3430 var standardAsyncPickerProps = _objectSpread2(_objectSpread2({}, standardRockFormFieldProps), {}, { 3431 enhanceForLongLists: { 3432 type: Boolean, 3433 default: false 3434 }, 3435 lazyMode: { 3436 type: String, 3437 default: ControlLazyMode.OnDemand 3438 }, 3439 multiple: { 3440 type: Boolean, 3441 default: false 3442 }, 3443 showBlankItem: { 3444 type: Boolean, 3445 default: false 3446 }, 3447 blankValue: { 3448 type: String, 3449 default: "" 3450 }, 3451 displayStyle: { 3452 type: String, 3453 default: PickerDisplayStyle.Auto 3454 }, 3455 columnCount: { 3456 type: Number, 3457 default: 0 3458 } 3459 }); 3460 function copyStandardAsyncPickerProps(source, destination) { 3461 copyStandardRockFormFieldProps(source, destination); 3462 destination.enhanceForLongLists = source.enhanceForLongLists; 3463 destination.lazyMode = source.lazyMode; 3464 destination.multiple = source.multiple; 3465 destination.showBlankItem = source.showBlankItem; 3466 destination.blankValue = source.blankValue; 3467 destination.displayStyle = source.displayStyle; 3468 destination.columnCount = source.columnCount; 3469 } 3470 function useStandardAsyncPickerProps(props) { 3471 var standardFieldProps = useStandardRockFormFieldProps(props); 3472 var propValues = reactive(_objectSpread2(_objectSpread2({}, standardFieldProps), {}, { 3473 enhanceForLongLists: props.enhanceForLongLists, 3474 lazyMode: props.lazyMode, 3475 multiple: props.multiple, 3476 showBlankItem: props.showBlankItem, 3477 blankValue: props.blankValue, 3478 displayStyle: props.displayStyle, 3479 columnCount: props.columnCount 3480 })); 3481 watch(() => standardFieldProps, () => { 3482 copyStandardRockFormFieldProps(props, propValues); 3483 }, { 3484 deep: true 3485 }); 3486 watch([() => props.enhanceForLongLists, () => props.lazyMode, () => props.multiple, () => props.showBlankItem, () => props.displayStyle, () => props.columnCount], () => { 3487 copyStandardAsyncPickerProps(props, propValues); 3488 }); 3489 return propValues; 3490 } 3491 var dataViewFilterProps = { 3492 modelValue: { 3493 type: Object, 3494 required: true 3495 }, 3496 filterMode: { 3497 type: Number, 3498 required: true 3499 } 3500 }; 3501 var dataViewSelectProps = { 3502 modelValue: { 3503 type: Object, 3504 required: true 3505 } 3506 }; 3507 function extendedRef(value, context) { 3508 var refValue = ref(value); 3509 refValue.context = context; 3510 return refValue; 3511 } 3512 function propertyRef(value, propertyName) { 3513 return extendedRef(value, { 3514 propertyName 3515 }); 3516 } 3517 function getVNodeProp(node, propName) { 3518 if (node.props && node.props[propName] !== undefined) { 3519 return node.props[propName]; 3520 } 3521 if (typeof node.type === "object" && typeof node.type["props"] === "object") { 3522 var defaultProps = node.type["props"]; 3523 var defaultProp = defaultProps[propName]; 3524 if (defaultProp && typeof defaultProp === "object" && defaultProp["default"] !== undefined) { 3525 return defaultProp["default"]; 3526 } 3527 } 3528 return undefined; 3529 } 3530 function getVNodeProps(node) { 3531 var props = {}; 3532 if (typeof node.type === "object" && typeof node.type["props"] === "object") { 3533 var defaultProps = node.type["props"]; 3534 for (var p in defaultProps) { 3535 var defaultProp = defaultProps[p]; 3536 if (defaultProp && typeof defaultProp === "object" && defaultProp["default"] !== undefined) { 3537 props[p] = defaultProp["default"]; 3538 } 3539 } 3540 } 3541 if (node.props) { 3542 for (var _p in node.props) { 3543 if (typeof node.type === "object" && typeof node.type["props"] === "object") { 3544 var _node$type$props$_p; 3545 var propType = (_node$type$props$_p = node.type["props"][_p]) === null || _node$type$props$_p === void 0 ? void 0 : _node$type$props$_p.type; 3546 if (propType === Boolean) { 3547 props[_p] = node.props[_p] === true || node.props[_p] === ""; 3548 } else if (propType === Number) { 3549 var _toNumberOrNull; 3550 props[_p] = (_toNumberOrNull = toNumberOrNull(node.props[_p])) !== null && _toNumberOrNull !== void 0 ? _toNumberOrNull : undefined; 3551 } else { 3552 props[_p] = node.props[_p]; 3553 } 3554 } else { 3555 props[_p] = node.props[_p]; 3556 } 3557 } 3558 } 3559 return props; 3560 } 3561 function extractText(node, props) { 3562 var el = document.createElement("div"); 3563 var vnode = createVNode(node, props); 3564 render(vnode, el); 3565 var text = el.innerText; 3566 render(null, el); 3567 return text.trim(); 3568 } 3569 function extractHtml(node, props) { 3570 var el = document.createElement("div"); 3571 var vnode = createVNode(node, props); 3572 render(vnode, el); 3573 var html = el.innerHTML; 3574 render(null, el); 3575 return html; 3576 } 3577 3578 var component = /*#__PURE__*/Object.freeze({ 3579 __proto__: null, 3580 dataViewFilterProps: dataViewFilterProps, 3581 dataViewSelectProps: dataViewSelectProps, 3582 defineAsyncComponent: defineAsyncComponent, 3583 extendedRef: extendedRef, 3584 extractHtml: extractHtml, 3585 extractText: extractText, 3586 getVNodeProp: getVNodeProp, 3587 getVNodeProps: getVNodeProps, 3588 propertyRef: propertyRef, 3589 standardAsyncPickerProps: standardAsyncPickerProps,
3590 standardRockFormFieldProps: standardRockFormFieldProps, 3591 updateRefValue: updateRefValue, 3592 useStandardAsyncPickerProps: useStandardAsyncPickerProps, 3593 useStandardRockFormFieldProps: useStandardRockFormFieldProps, 3594 useVModelPassthrough: useVModelPassthrough, 3595 useVModelPassthroughWithPropUpdateCheck: useVModelPassthroughWithPropUpdateCheck 3596 }); 3597 exports('component', component); 3598 3599 var dateKeyLength = "YYYYMMDD".length; 3600 var dateKeyNoYearLength = "MMDD".length; 3601 function getYear(dateKey) { 3602 var defaultValue = 0; 3603 if (!dateKey || dateKey.length !== dateKeyLength) { 3604 return defaultValue; 3605 } 3606 var asString = dateKey.substring(0, 4); 3607 var year = toNumberOrNull(asString) || defaultValue; 3608 return year; 3609 } 3610 function getMonth(dateKey) { 3611 var defaultValue = 0; 3612 if (!dateKey) { 3613 return defaultValue; 3614 } 3615 if (dateKey.length === dateKeyLength) { 3616 var asString = dateKey.substring(4, 6); 3617 return toNumberOrNull(asString) || defaultValue; 3618 } 3619 if (dateKey.length === dateKeyNoYearLength) { 3620 var _asString = dateKey.substring(0, 2); 3621 return toNumberOrNull(_asString) || defaultValue; 3622 } 3623 return defaultValue; 3624 } 3625 function getDay(dateKey) { 3626 var defaultValue = 0; 3627 if (!dateKey) { 3628 return defaultValue; 3629 } 3630 if (dateKey.length === dateKeyLength) { 3631 var asString = dateKey.substring(6, 8); 3632 return toNumberOrNull(asString) || defaultValue; 3633 } 3634 if (dateKey.length === dateKeyNoYearLength) { 3635 var _asString2 = dateKey.substring(2, 4); 3636 return toNumberOrNull(_asString2) || defaultValue; 3637 } 3638 return defaultValue; 3639 } 3640 function toDateKey(year, month, day) { 3641 if (!year || year > 9999 || year < 0) { 3642 year = 0; 3643 } 3644 if (!month || month > 12 || month < 0) { 3645 month = 0; 3646 } 3647 if (!day || day > 31 || day < 0) { 3648 day = 0; 3649 } 3650 var yearStr = zeroPad(year, 4); 3651 var monthStr = zeroPad(month, 2); 3652 var dayStr = zeroPad(day, 2); 3653 return "".concat(yearStr).concat(monthStr).concat(dayStr); 3654 } 3655 function toNoYearDateKey(month, day) { 3656 if (!month || month > 12 || month < 0) { 3657 month = 0; 3658 } 3659 if (!day || day > 31 || day < 0) { 3660 day = 0; 3661 } 3662 var monthStr = zeroPad(month, 2); 3663 var dayStr = zeroPad(day, 2); 3664 return "".concat(monthStr).concat(dayStr); 3665 } 3666 var dateKey = { 3667 getYear, 3668 getMonth, 3669 getDay, 3670 toDateKey, 3671 toNoYearDateKey 3672 }; 3673 3674 var dateKey$1 = /*#__PURE__*/Object.freeze({ 3675 __proto__: null, 3676 default: dateKey, 3677 getDay: getDay, 3678 getMonth: getMonth, 3679 getYear: getYear, 3680 toDateKey: toDateKey, 3681 toNoYearDateKey: toNoYearDateKey 3682 }); 3683 exports('dateKey', dateKey$1); 3684 3685 function smoothScrollToTop() { 3686 window.scrollTo({ 3687 top: 0, 3688 behavior: "smooth" 3689 }); 3690 } 3691 var page = { 3692 smoothScrollToTop 3693 }; 3694 var currentModalCount = 0; 3695 function trackModalState(state) { 3696 var body = document.body;
3697 var cssClasses = ["modal-open"]; 3698 if (state) { 3699 currentModalCount++; 3700 } else { 3701 currentModalCount = currentModalCount > 0 ? currentModalCount - 1 : 0; 3702 } 3703 if (currentModalCount > 0) { 3704 var _iterator = _createForOfIteratorHelper(cssClasses), 3705 _step; 3706 try { 3707 for (_iterator.s(); !(_step = _iterator.n()).done;) { 3708 var cssClass = _step.value; 3709 body.classList.add(cssClass); 3710 } 3711 } catch (err) { 3712 _iterator.e(err); 3713 } finally { 3714 _iterator.f(); 3715 } 3716 } else { 3717 var _iterator2 = _createForOfIteratorHelper(cssClasses), 3718 _step2; 3719 try { 3720 for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { 3721 var _cssClass = _step2.value; 3722 body.classList.remove(_cssClass); 3723 } 3724 } catch (err) { 3725 _iterator2.e(err); 3726 } finally { 3727 _iterator2.f(); 3728 } 3729 } 3730 } 3731 function loadJavaScriptAsync(_x, _x2, _x3, _x4) { 3732 return _loadJavaScriptAsync.apply(this, arguments); 3733 } 3734 function _loadJavaScriptAsync() { 3735 _loadJavaScriptAsync = _asyncToGenerator(function* (source, isScriptLoaded, attributes, fingerprint) { 3736 var _Obsidian; 3737 var src = source; 3738 if (fingerprint !== false && typeof Obsidian !== "undefined" && (_Obsidian = Obsidian) !== null && _Obsidian !== void 0 && (_Obsidian = _Obsidian.options) !== null && _Obsidian !== void 0 && _Obsidian.fingerprint) { 3739 if (src.indexOf("?") === -1) { 3740 src += "?".concat(Obsidian.options.fingerprint); 3741 } else { 3742 src += "&".concat(Obsidian.options.fingerprint); 3743 } 3744 } 3745 if (isScriptLoaded) { 3746 if (isScriptLoaded()) { 3747 return true; 3748 } 3749 } 3750 var scripts = Array.from(document.getElementsByTagName("script")); 3751 var thisScript = scripts.filter(s => s.src === src); 3752 if (thisScript.length > 0) { 3753 var _promise = scriptLoadedPromise(thisScript[0]); 3754 return _promise; 3755 } 3756 var script = document.createElement("script"); 3757 script.type = "text/javascript"; 3758 script.src = src; 3759 if (attributes) { 3760 for (var key in attributes) { 3761 script.setAttribute(key, attributes[key]); 3762 } 3763 } 3764 var promise = scriptLoadedPromise(script); 3765 document.getElementsByTagName("head")[0].appendChild(script); 3766 return promise; 3767 function scriptLoadedPromise(_x5) { 3768 return _scriptLoadedPromise.apply(this, arguments); 3769 } 3770 function _scriptLoadedPromise() { 3771 _scriptLoadedPromise = _asyncToGenerator(function* (scriptElement) { 3772 try { 3773 yield new Promise((resolve, reject) => { 3774 scriptElement.addEventListener("load", () => resolve()); 3775 scriptElement.addEventListener("error", () => { 3776 reject(); 3777 }); 3778 }); 3779 if (isScriptLoaded) { 3780 return isScriptLoaded(); 3781 } 3782 return true; 3783 } catch (_unused) { 3784 return false; 3785 } 3786 }); 3787 return _scriptLoadedPromise.apply(this, arguments); 3788 } 3789 }); 3790 return _loadJavaScriptAsync.apply(this, arguments); 3791 } 3792 function addQuickReturn(title, section, sectionOrder) { 3793 var rock = window["Rock"]; 3794 if (rock && rock.personalLinks) { 3795 rock.personalLinks.addQuickReturn(section, sectionOrder !== null && sectionOrder !== void 0 ? sectionOrder : 0, title); 3796 } 3797 } 3798 3799 var page$1 = /*#__PURE__*/Object.freeze({ 3800 __proto__: null, 3801 addQuickReturn: addQuickReturn, 3802 default: page, 3803 loadJavaScriptAsync: loadJavaScriptAsync, 3804 smoothScrollToTop: smoothScrollToTop, 3805 trackModalState: trackModalState 3806 }); 3807 exports('page', page$1); 3808 3809 function createDialog(body, footer) { 3810 var scrollable = document.createElement("div"); 3811 scrollable.classList.add("modal-scrollable"); 3812 scrollable.style.zIndex = "1060"; 3813 var modal = document.createElement("div"); 3814 scrollable.appendChild(modal); 3815 modal.classList.add("modal", "fade"); 3816 modal.tabIndex = -1; 3817 modal.setAttribute("role", "dialog"); 3818 modal.setAttribute("aria-hidden", "false"); 3819 modal.style.display = "block"; 3820 var modalDialog = document.createElement("div"); 3821 modal.appendChild(modalDialog); 3822 modalDialog.classList.add("modal-dialog"); 3823 var modalContent = document.createElement("div"); 3824 modalDialog.appendChild(modalContent); 3825 modalContent.classList.add("modal-content"); 3826 var modalBody = document.createElement("div"); 3827 modalContent.appendChild(modalBody); 3828 modalBody.classList.add("modal-body"); 3829 if (Array.isArray(body)) { 3830 var _iterator = _createForOfIteratorHelper(body), 3831 _step; 3832 try { 3833 for (_iterator.s();
3833 !(_step = _iterator.n()).done;) { 3834 var el = _step.value; 3835 modalBody.appendChild(el); 3836 } 3837 } catch (err) { 3838 _iterator.e(err); 3839 } finally { 3840 _iterator.f(); 3841 } 3842 } else { 3843 modalBody.appendChild(body); 3844 } 3845 if (footer && (!Array.isArray(footer) || footer.length > 0)) { 3846 var modalFooter = document.createElement("div"); 3847 modalContent.appendChild(modalFooter); 3848 modalFooter.classList.add("modal-footer"); 3849 if (Array.isArray(footer)) { 3850 var _iterator2 = _createForOfIteratorHelper(footer), 3851 _step2; 3852 try { 3853 for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { 3854 var _el = _step2.value; 3855 modalFooter.appendChild(_el); 3856 } 3857 } catch (err) { 3858 _iterator2.e(err); 3859 } finally { 3860 _iterator2.f(); 3861 } 3862 } else { 3863 modalFooter.appendChild(footer); 3864 } 3865 } 3866 scrollable.addEventListener("click", () => { 3867 modal.classList.remove("animated", "shake"); 3868 setTimeout(() => { 3869 modal.classList.add("animated", "shake"); 3870 }, 0); 3871 }); 3872 return scrollable; 3873 } 3874 function createCloseButton() { 3875 var closeButton = document.createElement("button"); 3876 closeButton.classList.add("close"); 3877 closeButton.type = "button"; 3878 closeButton.style.marginTop = "-10px"; 3879 closeButton.innerHTML = "×"; 3880 return closeButton; 3881 } 3882 function createBackdrop() { 3883 var backdrop = document.createElement("div"); 3884 backdrop.classList.add("modal-backdrop"); 3885 backdrop.style.zIndex = "1050"; 3886 return backdrop; 3887 } 3888 function showDialog(options) { 3889 return new Promise(resolve => { 3890 var _options$cancellation; 3891 var timer = null; 3892 var container = document.fullscreenElement || document.body; 3893 var body = document.createElement("div"); 3894 var autoFocus = null; 3895 if (options.message instanceof HTMLElement) { 3896 body.appendChild(options.message); 3897 } else { 3898 body.innerText = options.message; 3899 } 3900 var buttons = []; 3901 function clearDialog(result) { 3902 if (timer !== null) { 3903 return; 3904 } 3905 timer = setTimeout(() => { 3906 backdrop.remove(); 3907 dialog.remove(); 3908 trackModalState(false); 3909 resolve(result); 3910 }, 1000); 3911 modal.addEventListener("transitionend", () => { 3912 if (timer) { 3913 clearTimeout(timer); 3914 } 3915 backdrop.remove(); 3916 dialog.remove(); 3917 trackModalState(false); 3918 resolve(result); 3919 }); 3920 modal.classList.remove("in"); 3921 backdrop.classList.remove("in"); 3922 } 3923 var _iterator3 = _createForOfIteratorHelper(options.buttons), 3924 _step3; 3925 try { 3926 var _loop = function _loop() { 3927 var button = _step3.value; 3928 var btn = document.createElement("button"); 3929 btn.classList.value = button.className; 3930 btn.type = "button"; 3931 btn.innerText = button.label; 3932 btn.addEventListener("click", () => { 3933 clearDialog(button.key); 3934 }); 3935 if (button.autoFocus) { 3936 autoFocus = btn; 3937 } 3938 buttons.push(btn); 3939 }; 3940 for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { 3941 _loop(); 3942 } 3943 } catch (err) { 3944 _iterator3.e(err); 3945 } finally { 3946 _iterator3.f(); 3947 } 3948 var dialogBody = [body]; 3949 if (!options.hideCloseButton) { 3950 var closeButton = createCloseButton(); 3951 closeButton.addEventListener("click", () => { 3952 clearDialog("cancel"); 3953 }); 3954 dialogBody.splice(0, 0, closeButton); 3955 } 3956 var dialog = createDialog(dialogBody, buttons); 3957 var backdrop = createBackdrop(); 3958 var modal = dialog.querySelector(".modal"); 3959 trackModalState(true); 3960 container.appendChild(dialog); 3961 container.appendChild(backdrop); 3962 modal.style.marginTop = "-".concat(modal.offsetHeight / 2.0, "px"); 3963 if (autoFocus) { 3964 autoFocus.focus(); 3965 } 3966 backdrop.classList.add("in"); 3967 modal.classList.add("in"); 3968 (_options$cancellation = options.cancellationToken) === null || _options$cancellation === void 0 || _options$cancellation.onCancellationRequested(() => { 3969 clearDialog("cancel"); 3970 }); 3971 }); 3972 } 3973 function alert(_x) { 3974 return _alert.apply(this, arguments); 3975 } 3976 function _alert() { 3977 _alert = _asyncToGenerator(function* (message) { 3978 yield showDialog({ 3979 message, 3980 buttons: [{ 3981 key: "ok", 3982 label: "OK", 3983 className: "btn btn-primary" 3984 }] 3985 }); 3986 }); 3987 return _alert.apply(this, arguments); 3988 } 3989 function confirm(_x2) {
3990 return _confirm.apply(this, arguments); 3991 } 3992 function _confirm() { 3993 _confirm = _asyncToGenerator(function* (message) { 3994 var result = yield showDialog({ 3995 message, 3996 buttons: [{ 3997 key: "ok", 3998 label: "OK", 3999 className: "btn btn-primary", 4000 autoFocus: true 4001 }, { 4002 key: "cancel", 4003 label: "Cancel", 4004 className: "btn btn-default" 4005 }] 4006 }); 4007 return result === "ok"; 4008 }); 4009 return _confirm.apply(this, arguments); 4010 } 4011 function confirmDelete(typeName, additionalMessage) { 4012 var message = "Are you sure you want to delete this ".concat(typeName, "?"); 4013 if (additionalMessage) { 4014 message += " ".concat(additionalMessage); 4015 } 4016 return confirm(message); 4017 } 4018 function showSecurity(entityTypeIdKey, entityIdKey) { 4019 var entityTitle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "Item"; 4020 Rock.controls.modal.show(undefined, "/Secure/".concat(entityTypeIdKey, "/").concat(entityIdKey, "?t=Secure ").concat(entityTitle, "&pb=&sb=Done")); 4021 } 4022 function showChildPages(pageId) { 4023 Rock.controls.modal.show(undefined, "/pages/".concat(pageId, "?t=Child Pages&pb=&sb=Done")); 4024 } 4025 4026 var dialogs = /*#__PURE__*/Object.freeze({ 4027 __proto__: null, 4028 alert: alert, 4029 confirm: confirm, 4030 confirmDelete: confirmDelete, 4031 showChildPages: showChildPages, 4032 showDialog: showDialog, 4033 showSecurity: showSecurity 4034 }); 4035 exports('dialogs', dialogs); 4036 4037 function isEmail(val) { 4038 if (typeof val === "string") { 4039 var re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 4040 return re.test(val.toLowerCase()); 4041 } 4042 return false; 4043 } 4044 4045 var email = /*#__PURE__*/Object.freeze({ 4046 __proto__: null, 4047 isEmail: isEmail 4048 }); 4049 exports('email', email); 4050 4051 function enumToListItemBag(description) { 4052 var listItemBagList = []; 4053 var order = description["__order"]; 4054 if (order) { 4055 var _iterator = _createForOfIteratorHelper(order), 4056 _step; 4057 try { 4058 for (_iterator.s(); !(_step = _iterator.n()).done;) { 4059 var value = _step.value; 4060 listItemBagList.push({ 4061 text: description[value], 4062 value: value.toString() 4063 }); 4064 } 4065 } catch (err) { 4066 _iterator.e(err); 4067 } finally { 4068 _iterator.f(); 4069 } 4070 } else { 4071 for (var property in description) { 4072 listItemBagList.push({ 4073 text: description[property], 4074 value: property.toString() 4075 }); 4076 } 4077 } 4078 return listItemBagList; 4079 } 4080 4081 var enumUtils = /*#__PURE__*/Object.freeze({ 4082 __proto__: null, 4083 enumToListItemBag: enumToListItemBag 4084 }); 4085 exports('enumUtils', enumUtils); 4086 4087 var fieldTypeTable = {}; 4088 var fieldTypeAttributeGuidSymbol = Symbol(); 4089 function registerFieldType(fieldTypeGuid, fieldType) { 4090 var normalizedGuid = normalize(fieldTypeGuid); 4091 if (!isValidGuid(fieldTypeGuid) || normalizedGuid === null) { 4092 throw "Invalid guid specified when registering field type."; 4093 } 4094 if (fieldTypeTable[normalizedGuid] !== undefined) { 4095 throw "Invalid attempt to replace existing field type."; 4096 } 4097 fieldTypeTable[normalizedGuid] = fieldType; 4098 } 4099 function getFieldType(fieldTypeGuid) { 4100 var normalizedGuid = normalize(fieldTypeGuid); 4101 if (normalizedGuid !== null) { 4102 var field = fieldTypeTable[normalizedGuid]; 4103 if (field) { 4104 return field; 4105 } 4106 } 4107 console.warn("Field type \"".concat(fieldTypeGuid, "\" was not found")); 4108 return null; 4109 } 4110 function provideFieldTypeAttributeGuid(guid) { 4111 provide(fieldTypeAttributeGuidSymbol, guid); 4112 } 4113 function useFieldTypeAttributeGuid() { 4114 return inject(fieldTypeAttributeGuidSymbol, ref()); 4115 } 4116 4117 var fieldTypes = /*#__PURE__*/Object.freeze({ 4118 __proto__: null, 4119 getFieldType: getFieldType, 4120 provideFieldTypeAttributeGuid: provideFieldTypeAttributeGuid, 4121 registerFieldType: registerFieldType, 4122 useFieldTypeAttributeGuid: useFieldTypeAttributeGuid 4123 }); 4124 exports('fieldTypes', fieldTypes); 4125 4126 function downloadFile(_x, _x2) { 4127 return _downloadFile.apply(this, arguments); 4128 } 4129 function _downloadFile() { 4130 _downloadFile = _asyncToGenerator(function* (data, filename) { 4131 var url = URL.createObjectURL(data); 4132 var element = document.createElement("a"); 4133 element.innerText = "Download"; 4134 element.style.position = "absolute"; 4135 element.style.top = "-100px"; 4136 element.style.left = "0"; 4137 element.href = url; 4138 element.download = filename; 4139 document.body.appendChild(element); 4140 element.click(); 4141 document.body.removeChild(element); 4142 setTimeout(() => URL.revokeObjectURL(url), 100); 4143 }); 4144 return _downloadFile.apply(this, arguments); 4145 } 4146 function fetchImageFileExtensions() { 4147 return _fetchImageFileExtensions.apply(this, arguments); 4148 } 4149 function _fetchImageFileExtensions() { 4150 _fetchImageFileExtensions = _asyncToGenerator(function* () { 4151 var http = useHttp(); 4152 var result = yield http.post("/api/v2/Utilities/GetImageFileExtensions"); 4153 if (result.isSuccess && result.data) { 4154 return result.data.split(","); 4155 } 4156 return null; 4157 }); 4158 return _fetchImageFileExtensions.apply(this, arguments); 4159 }
4160 var getImageFileExtensions = Cache.cachePromiseFactory("imageFileExtensions", fetchImageFileExtensions); 4161 function isImage(_x3) { 4162 return _isImage.apply(this, arguments); 4163 } 4164 function _isImage() { 4165 _isImage = _asyncToGenerator(function* (filename) { 4166 var _imageExtensions$incl; 4167 var imageExtensions = yield getImageFileExtensions(); 4168 var extension = filename.split(".").pop(); 4169 return !!extension && ((_imageExtensions$incl = imageExtensions === null || imageExtensions === void 0 ? void 0 : imageExtensions.includes(extension.toLowerCase())) !== null && _imageExtensions$incl !== void 0 ? _imageExtensions$incl : false); 4170 }); 4171 return _isImage.apply(this, arguments); 4172 } 4173 function resizeImageFileProcessor() { 4174 var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, 4175 maxWidth = _ref.maxWidth, 4176 maxHeight = _ref.maxHeight; 4177 return file => { 4178 if (!file.type.startsWith("image/")) { 4179 return file; 4180 } 4181 return new Promise((resolve, reject) => { 4182 var img = new Image(); 4183 img.src = URL.createObjectURL(file); 4184 img.onload = () => { 4185 var width = img.width, 4186 height = img.height; 4187 if (!maxWidth && !maxHeight) { 4188 resolve(file); 4189 return; 4190 } 4191 var widthScale = maxWidth ? maxWidth / width : 1; 4192 var heightScale = maxHeight ? maxHeight / height : 1; 4193 var scaleFactor = Math.min(widthScale, heightScale, 1); 4194 if (scaleFactor === 1) { 4195 resolve(file); 4196 return; 4197 } 4198 var newWidth = Math.round(width * scaleFactor); 4199 var newHeight = Math.round(height * scaleFactor); 4200 var canvas = document.createElement("canvas"); 4201 canvas.width = newWidth; 4202 canvas.height = newHeight; 4203 var ctx = canvas.getContext("2d"); 4204 if (!ctx) { 4205 reject(new Error("Failed to get canvas context")); 4206 return; 4207 } 4208 ctx.drawImage(img, 0, 0, newWidth, newHeight); 4209 canvas.toBlob(blob => { 4210 if (!blob) { 4211 reject(new Error("Failed to resize image")); 4212 return; 4213 } 4214 var resizedFile = new File([blob], file.name, { 4215 type: file.type 4216 }); 4217 resolve(resizedFile); 4218 }, file.type); 4219 }; 4220 img.onerror = () => reject(new Error("Failed to load image")); 4221 }); 4222 }; 4223 } 4224 4225 var file = /*#__PURE__*/Object.freeze({ 4226 __proto__: null, 4227 downloadFile: downloadFile, 4228 getImageFileExtensions: getImageFileExtensions, 4229 isImage: isImage, 4230 resizeImageFileProcessor: resizeImageFileProcessor 4231 }); 4232 exports('file', file); 4233 4234 var formStateSymbol = Symbol(); 4235 function provideFormState(state) { 4236 provide(formStateSymbol, state); 4237 } 4238 function useFormState() { 4239 return inject(formStateSymbol, undefined); 4240 } 4241 4242 var form = /*#__PURE__*/Object.freeze({ 4243 __proto__: null, 4244 provideFormState: provideFormState, 4245 useFormState: useFormState 4246 }); 4247 exports('form', form); 4248 4249 function enterFullscreen(_x, _x2) { 4250 return _enterFullscreen.apply(this, arguments); 4251 } 4252 function _enterFullscreen() { 4253 _enterFullscreen = _asyncToGenerator(function* (element, exitCallback) { 4254 try { 4255 if (element.requestFullscreen) { 4256 yield element.requestFullscreen(); 4257 } else if (element.mozRequestFullscreen) { 4258 yield element.mozRequestFullscreen(); 4259 } else if (element.webkitRequestFullscreen) { 4260 yield element.webkitRequestFullscreen(); 4261 } else { 4262 return false; 4263 } 4264 element.classList.add("is-fullscreen"); 4265 var onFullscreenChange = () => { 4266 element.classList.remove("is-fullscreen"); 4267 document.removeEventListener("fullscreenchange", onFullscreenChange); 4268 document.removeEventListener("mozfullscreenchange", onFullscreenChange); 4269 document.removeEventListener("webkitfullscreenchange", onFullscreenChange); 4270 if (exitCallback) { 4271 exitCallback(); 4272 } 4273 }; 4274 document.addEventListener("fullscreenchange", onFullscreenChange); 4275 document.addEventListener("mozfullscreenchange", onFullscreenChange); 4276 document.addEventListener("webkitfullscreenchange", onFullscreenChange); 4277 return true; 4278 } catch (ex) { 4279 console.error(ex); 4280 return false;
4281 } 4282 }); 4283 return _enterFullscreen.apply(this, arguments); 4284 } 4285 function isFullscreen() { 4286 return !!getFullscreenElement(); 4287 } 4288 function getFullscreenElement() { 4289 return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement; 4290 } 4291 function exitFullscreen() { 4292 return _exitFullscreen.apply(this, arguments); 4293 } 4294 function _exitFullscreen() { 4295 _exitFullscreen = _asyncToGenerator(function* () { 4296 try { 4297 if (document.exitFullscreen) { 4298 yield document.exitFullscreen(); 4299 } else if (document.mozCancelFullScreen) { 4300 yield document.mozCancelFullScreen(); 4301 } else if (document.webkitExitFullscreen) { 4302 document.webkitExitFullscreen(); 4303 } else { 4304 return false; 4305 } 4306 return true; 4307 } catch (ex) { 4308 console.error(ex); 4309 return false; 4310 } 4311 }); 4312 return _exitFullscreen.apply(this, arguments); 4313 } 4314 4315 var fullscreen = /*#__PURE__*/Object.freeze({ 4316 __proto__: null, 4317 enterFullscreen: enterFullscreen, 4318 exitFullscreen: exitFullscreen, 4319 getFullscreenElement: getFullscreenElement, 4320 isFullscreen: isFullscreen 4321 }); 4322 exports('fullscreen', fullscreen); 4323 4324 function toCoordinate(coord) { 4325 var isWellKnown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 4326 if (typeof coord == "string") { 4327 if (isWellKnown) { 4328 return coord.split(" ").reverse().map(val => parseFloat(val)); 4329 } else { 4330 return coord.split(",").map(val => parseFloat(val)); 4331 } 4332 } else { 4333 return [coord.lat(), coord.lng()]; 4334 } 4335 } 4336 function wellKnownToCoordinates(wellKnownText, type) { 4337 if (wellKnownText == "") { 4338 return []; 4339 } 4340 if (type == "Point") { 4341 return [toCoordinate(wellKnownText.replace(/(POINT *\( *)|( *\) *)/ig, ""), true)]; 4342 } else { 4343 return wellKnownText.replace(/(POLYGON *\(+ *)|( *\)+ *)/ig, "").split(/ *, */).map(coord => toCoordinate(coord, true)); 4344 } 4345 } 4346 function coordinatesToWellKnown(coordinates, type) { 4347 if (coordinates.length == 0) { 4348 return ""; 4349 } else if (type == "Point") { 4350 return "POINT(".concat(coordinates[0].reverse().join(" "), ")"); 4351 } else { 4352 if (isClockwisePolygon(coordinates)) { 4353 coordinates.reverse(); 4354 } 4355 var coordinateString = coordinates.map(coords => coords.reverse().join(" ")).join(", "); 4356 return "POLYGON((".concat(coordinateString, "))"); 4357 } 4358 } 4359 function nearAddressForCoordinate(coordinate) { 4360 return new Promise(resolve => { 4361 if (window.google) { 4362 var geocoder = new google.maps.Geocoder(); 4363 geocoder.geocode({ 4364 location: new google.maps.LatLng(...coordinate) 4365 }, function (results, status) { 4366 if (status == google.maps.GeocoderStatus.OK && results !== null && results !== void 0 && results[0]) { 4367 resolve("near " + results[0].formatted_address); 4368 } else { 4369 console.log("Geocoder failed due to: " + status); 4370 resolve(""); 4371 } 4372 }); 4373 } else { 4374 resolve(""); 4375 } 4376 }); 4377 } 4378 function nearAddressForCoordinates(coordinates) { 4379 if (!coordinates || coordinates.length == 0) { 4380 return Promise.resolve(""); 4381 } 4382 return nearAddressForCoordinate(coordinates[0]); 4383 } 4384 function isClockwisePolygon(polygon) { 4385 var sum = 0; 4386 for (var i = 0; i < polygon.length - 1; i++) { 4387 sum += (Math.abs(polygon[i + 1][0]) - Math.abs(polygon[i][0])) * (Math.abs(polygon[i + 1][1]) + Math.abs(polygon[i][1])); 4388 } 4389 return sum > 0; 4390 } 4391 function loadMapResources() { 4392 return _loadMapResources.apply(this, arguments); 4393 } 4394 function _loadMapResources() { 4395 _loadMapResources = _asyncToGenerator(function* () { 4396 var _response$data; 4397 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { 4398 mapStyleValueGuid: emptyGuid 4399 }; 4400 var response = yield post("/api/v2/Controls/GeoPickerGetGoogleMapSettings", undefined, options); 4401 var googleMapSettings = (_response$data = response.data) !== null && _response$data !== void 0 ? _response$data : {}; 4402 var keyParam = ""; 4403 if (googleMapSettings.googleApiKey) { 4404 keyParam = "key=".concat(googleMapSettings.googleApiKey, "&"); 4405 } 4406 yield loadJavaScriptAsync("https://maps.googleapis.com/ma
4406ps/api/js?".concat(keyParam, "v=3.64&libraries=drawing,visualization,geometry,marker"), () => typeof google != "undefined" && typeof google.maps != "undefined", {}, false); 4407 return googleMapSettings; 4408 }); 4409 return _loadMapResources.apply(this, arguments); 4410 } 4411 function createLatLng(latOrLatLngOrLatLngLiteral, lngOrNoClampNoWrap, noClampNoWrap) { 4412 return new google.maps.LatLng(latOrLatLngOrLatLngLiteral, lngOrNoClampNoWrap, noClampNoWrap); 4413 } 4414 4415 var geo = /*#__PURE__*/Object.freeze({ 4416 __proto__: null, 4417 coordinatesToWellKnown: coordinatesToWellKnown, 4418 createLatLng: createLatLng, 4419 isClockwisePolygon: isClockwisePolygon, 4420 loadMapResources: loadMapResources, 4421 nearAddressForCoordinate: nearAddressForCoordinate, 4422 nearAddressForCoordinates: nearAddressForCoordinates, 4423 toCoordinate: toCoordinate, 4424 wellKnownToCoordinates: wellKnownToCoordinates 4425 }); 4426 exports('geo', geo); 4427 4428 var nthNamesAbbreviated = [[1, "1st"], [2, "2nd"], [3, "3rd"], [4, "4th"], [-1, "last"]]; 4429 function padZeroLeft(value, length) { 4430 var str = value.toString(); 4431 return "0".repeat(length - str.length) + str; 4432 } 4433 function getDateString(date) { 4434 var year = date.year; 4435 var month = date.month; 4436 var day = date.day; 4437 return "".concat(year).concat(padZeroLeft(month, 2)).concat(padZeroLeft(day, 2)); 4438 } 4439 function getTimeString(date) { 4440 var hour = date.hour; 4441 var minute = date.minute; 4442 var second = date.second; 4443 return "".concat(padZeroLeft(hour, 2)).concat(padZeroLeft(minute, 2)).concat(padZeroLeft(second, 2)); 4444 } 4445 function getDateTimeString(date) { 4446 return "".concat(getDateString(date), "T").concat(getTimeString(date)); 4447 } 4448 function getDatesFromRangeOrPeriod(value) { 4449 var segments = value.split("/"); 4450 if (segments.length === 0) { 4451 return []; 4452 } 4453 var startDate = getDateFromString(segments[0]); 4454 if (!startDate) { 4455 return []; 4456 } 4457 if (segments.length !== 2) { 4458 return [startDate]; 4459 } 4460 var dates = []; 4461 if (segments[1].startsWith("P")) { 4462 var days = getPeriodDurationInDays(segments[1]); 4463 for (var day = 0; day < days; day++) { 4464 var date = startDate.addDays(day); 4465 if (date) { 4466 dates.push(date); 4467 } 4468 } 4469 } else { 4470 var endDate = getDateFromString(segments[1]); 4471 if (endDate !== null) { 4472 var _date = startDate; 4473 while (_date <= endDate) { 4474 dates.push(_date); 4475 _date = _date.addDays(1); 4476 } 4477 } 4478 } 4479 return dates; 4480 } 4481 function getDateFromString(value) { 4482 if (value.length < 8) { 4483 return null; 4484 } 4485 var year = parseInt(value.substring(0, 4)); 4486 var month = parseInt(value.substring(4, 6)); 4487 var day = parseInt(value.substring(6, 8)); 4488 return RockDateTime.fromParts(year, month, day); 4489 } 4490 function getDateTimeFromString(value) { 4491 if (value.length < 15 || value[8] !== "T") { 4492 return null; 4493 } 4494 var year = parseInt(value.substring(0, 4)); 4495 var month = parseInt(value.substring(4, 6)); 4496 var day = parseInt(value.substring(6, 8)); 4497 var hour = parseInt(value.substring(9, 11)); 4498 var minute = parseInt(value.substring(11, 13)); 4499 var second = parseInt(value.substring(13, 15)); 4500 return RockDateTime.fromParts(year, month, day, hour, minute, second); 4501 } 4502 function getPeriodDurationInDays(period) { 4503 if (!period.startsWith("P")) { 4504 return 0; 4505 } 4506 if (period.endsWith("D")) { 4507 return parseInt(period.substring(1, period.length - 1)); 4508 } else if (period.endsWith("W")) { 4509 return parseInt(period.substring(1, period.length - 1)) * 7; 4510 } 4511 return 0; 4512 } 4513 function getRecurrenceDates(attributes, value) { 4514 var recurrenceDates = []; 4515 var valueParts = value.split(","); 4516 var valueType = attributes["VALUE"]; 4517 var _iterator = _createForOfIteratorHelper(valueParts), 4518 _step; 4519 try { 4520 for (_iterator.s();
4520 !(_step = _iterator.n()).done;) { 4521 var valuePart = _step.value; 4522 if (!valueType) { 4523 var length = valuePart.length; 4524 if (length === 8) { 4525 valueType = "DATE"; 4526 } else if ((length === 15 || length === 16) && valuePart[8] === "T") { 4527 valueType = "DATE-TIME"; 4528 } else { 4529 valueType = "PERIOD"; 4530 } 4531 } 4532 if (valueType === "PERIOD") { 4533 recurrenceDates.push(...getDatesFromRangeOrPeriod(valuePart)); 4534 } else if (valueType === "DATE") { 4535 var date = getDateFromString(valuePart); 4536 if (date) { 4537 recurrenceDates.push(date); 4538 } 4539 } else if (valueType === "DATE-TIME") { 4540 var _date2 = getDateTimeFromString(valuePart); 4541 if (_date2) { 4542 recurrenceDates.push(_date2); 4543 } 4544 } 4545 } 4546 } catch (err) { 4547 _iterator.e(err); 4548 } finally { 4549 _iterator.f(); 4550 } 4551 return recurrenceDates; 4552 } 4553 function getWeekdayName(day) { 4554 if (day === DayOfWeek.Sunday) { 4555 return "Sunday"; 4556 } else if (day === DayOfWeek.Monday) { 4557 return "Monday"; 4558 } else if (day === DayOfWeek.Tuesday) { 4559 return "Tuesday"; 4560 } else if (day === DayOfWeek.Wednesday) { 4561 return "Wednesday"; 4562 } else if (day === DayOfWeek.Thursday) { 4563 return "Thursday"; 4564 } else if (day === DayOfWeek.Friday) { 4565 return "Friday"; 4566 } else if (day === DayOfWeek.Saturday) { 4567 return "Saturday"; 4568 } else { 4569 return "Unknown"; 4570 } 4571 } 4572 function dateMatchesDays(rockDate, days) { 4573 var _iterator2 = _createForOfIteratorHelper(days), 4574 _step2; 4575 try { 4576 for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { 4577 var day = _step2.value; 4578 if (rockDate.dayOfWeek === day) { 4579 return true; 4580 } 4581 } 4582 } catch (err) { 4583 _iterator2.e(err); 4584 } finally { 4585 _iterator2.f(); 4586 } 4587 return false; 4588 } 4589 function dateMatchesOffsetDayOfWeeks(rockDate, dayOfWeek, offsets) { 4590 if (!dateMatchesDays(rockDate, [dayOfWeek])) { 4591 return false; 4592 } 4593 var dayOfMonth = rockDate.day; 4594 var _iterator3 = _createForOfIteratorHelper(offsets), 4595 _step3; 4596 try { 4597 for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { 4598 var offset = _step3.value; 4599 if (offset === 1 && dayOfMonth >= 1 && dayOfMonth <= 7) { 4600 return true; 4601 } else if (offset === 2 && dayOfMonth >= 8 && dayOfMonth <= 14) { 4602 return true; 4603 } else if (offset === 3 && dayOfMonth >= 15 && dayOfMonth <= 21) { 4604 return true; 4605 } else if (offset === 4 && dayOfMonth >= 22 && dayOfMonth <= 28) { 4606 return true; 4607 } else if (offset === -1) { 4608 var lastDayOfMonth = rockDate.addDays(-(rockDate.day - 1)).addMonths(1).addDays(-1).day; 4609 if (dayOfMonth >= lastDayOfMonth - 7 && dayOfMonth <= lastDayOfMonth) { 4610 return true; 4611 } 4612 } 4613 } 4614 } catch (err) { 4615 _iterator3.e(err); 4616 } finally { 4617 _iterator3.f(); 4618 } 4619 return false; 4620 } 4621 function getDayOfWeekFromIcalDay(day) { 4622 switch (day) { 4623 case "SU": 4624 return DayOfWeek.Sunday; 4625 case "MO": 4626 return DayOfWeek.Monday; 4627 case "TU": 4628 return DayOfWeek.Tuesday; 4629 case "WE": 4630 return DayOfWeek.Wednesday; 4631 case "TH": 4632 return DayOfWeek.Thursday; 4633 case "FR": 4634 return DayOfWeek.Friday; 4635 case "SA": 4636 return DayOfWeek.Saturday; 4637 } 4638 } 4639 function getiCalDay(day) { 4640 switch (day) { 4641 case DayOfWeek.Sunday: 4642 return "SU"; 4643 case DayOfWeek.Monday: 4644 return "MO"; 4645 case DayOfWeek.Tuesday: 4646 return "TU"; 4647 case DayOfWeek.Wednesday: 4648 return "WE"; 4649 case DayOfWeek.Thursday: 4650 return "TH"; 4651 case DayOfWeek.Friday: 4652 return "FR"; 4653 case DayOfWeek.Saturday: 4654 return "SA"; 4655 } 4656 } 4657 function normalizeLineLength(lines) { 4658 var newLines = [...lines]; 4659 for (var lineNumber = 0; lineNumber < newLines.length; lineNumber++) { 4660 if (newLines[lineNumber].length > 75) { 4661 var currentLine = newLines[lineNumber].substring(0, 75); 4662 var newLine = " " + newLines[lineNumber].substring(75); 4663 newLines.splice(lineNumber, 1, currentLine, newLine); 4664 } 4665 } 4666 return newLines; 4667 } 4668 function denormalizeLineLength(lines) { 4669 var newLines = [...lines]; 4670 for (var lineNumber = 1; lineNumber < newLines.length;) { 4671 if (newLines[lineNumber][0] === " ") { 4672 newLines[lineNumber - 1] += newLines[lineNumber].substring(1); 4673 newLines.splice(lineNumber, 1); 4674 } else { 4675 lineNumber++; 4676 } 4677 } 4678 return newLines; 4679 } 4680 class LineFeeder { 4681 constructor(content) { 4682 var lines = content.split(/\r\n|\n|\r/); 4683 this.lines = denormalizeLineLength(lines); 4684 } 4685 peek() { 4686 if (this.lines.length === 0) { 4687 return null; 4688 } 4689 return this.lines[0]; 4690 } 4691 pop() { 4692 if (this.lines.length === 0) { 4693 return null; 4694 } 4695 return this.lines.splice(0, 1)[0]; 4696 } 4697 } 4698 class RecurrenceRule { 4699 constructor() { 4700 var _values$UNTIL, _values$UNTIL2; 4701 var rule = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; 4702 _defineProperty(this, "interval", 1); 4703 _defineProperty(this, "byMonthDay", []); 4704 _defineProperty(this, "byDay", []); 4705 if (!rule) { 4706 return; 4707 } 4708 var values = {}; 4709 var _iterator4 = _createForOfIteratorHelper(rule.split(";")), 4710 _step4; 4711 try { 4712 for (_iterator4.s();
4712 !(_step4 = _iterator4.n()).done;) { 4713 var attr = _step4.value; 4714 var attrParts = attr.split("="); 4715 if (attrParts.length === 2) { 4716 values[attrParts[0]] = attrParts[1]; 4717 } 4718 } 4719 } catch (err) { 4720 _iterator4.e(err); 4721 } finally { 4722 _iterator4.f(); 4723 } 4724 if (values["UNTIL"] !== undefined && values["COUNT"] !== undefined) { 4725 throw new Error("Recurrence rule '".concat(rule, "' cannot specify both UNTIL and COUNT.")); 4726 } 4727 if (values["FREQ"] !== "DAILY" && values["FREQ"] !== "WEEKLY" && values["FREQ"] !== "MONTHLY") { 4728 throw new Error("Invalid frequence for recurrence rule '".concat(rule, "'.")); 4729 } 4730 this.frequency = values["FREQ"]; 4731 if (((_values$UNTIL = values["UNTIL"]) === null || _values$UNTIL === void 0 ? void 0 : _values$UNTIL.length) === 8) { 4732 var _getDateFromString; 4733 this.endDate = (_getDateFromString = getDateFromString(values["UNTIL"])) !== null && _getDateFromString !== void 0 ? _getDateFromString : undefined; 4734 } else if (((_values$UNTIL2 = values["UNTIL"]) === null || _values$UNTIL2 === void 0 ? void 0 : _values$UNTIL2.length) >= 15) { 4735 var _getDateTimeFromStrin; 4736 this.endDate = (_getDateTimeFromStrin = getDateTimeFromString(values["UNTIL"])) !== null && _getDateTimeFromStrin !== void 0 ? _getDateTimeFromStrin : undefined; 4737 } 4738 if (values["COUNT"] !== undefined) { 4739 var _toNumberOrNull; 4740 this.count = (_toNumberOrNull = toNumberOrNull(values["COUNT"])) !== null && _toNumberOrNull !== void 0 ? _toNumberOrNull : undefined; 4741 } 4742 if (values["INTERVAL"] !== undefined) { 4743 var _toNumberOrNull2; 4744 this.interval = (_toNumberOrNull2 = toNumberOrNull(values["INTERVAL"])) !== null && _toNumberOrNull2 !== void 0 ? _toNumberOrNull2 : 1; 4745 } 4746 if (values["BYMONTHDAY"] !== undefined && values["BYMONTHDAY"].length > 0) { 4747 this.byMonthDay = []; 4748 var _iterator5 = _createForOfIteratorHelper(values["BYMONTHDAY"].split(",")), 4749 _step5; 4750 try { 4751 for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) { 4752 var v = _step5.value; 4753 var num = toNumberOrNull(v); 4754 if (num !== null) { 4755 this.byMonthDay.push(num); 4756 } 4757 } 4758 } catch (err) { 4759 _iterator5.e(err); 4760 } finally { 4761 _iterator5.f(); 4762 } 4763 } 4764 if (values["BYDAY"] !== undefined && values["BYDAY"].length > 0) { 4765 this.byDay = []; 4766 var _iterator6 = _createForOfIteratorHelper(values["BYDAY"].split(",")), 4767 _step6; 4768 try { 4769 for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) { 4770 var _v = _step6.value; 4771 if (_v.length < 2) { 4772 continue; 4773 } 4774 var _num = _v.length > 2 ? toNumberOrNull(_v.substring(0, _v.length - 2)) : 1; 4775 var day = _v.substring(_v.length - 2); 4776 if (_num === null) { 4777 continue; 4778 } 4779 if (day === "SU" || day === "MO" || day === "TU" || day == "WE" || day == "TH" || day == "FR" || day == "SA") { 4780 this.byDay.push({ 4781 value: _num, 4782 day: getDayOfWeekFromIcalDay(day) 4783 }); 4784 } 4785 } 4786 } catch (err) { 4787 _iterator6.e(err); 4788 } finally { 4789 _iterator6.f(); 4790 } 4791 } 4792 } 4793 build() { 4794 var attributes = []; 4795 attributes.push("FREQ=".concat(this.frequency)); 4796 if (this.count !== undefined) { 4797 attributes.push("COUNT=".concat(this.count)); 4798 } else if (this.endDate) { 4799 attributes.push("UNTIL=".concat(getDateTimeString(this.endDate))); 4800 } 4801 if (this.interval > 1) { 4802 attributes.push("INTERVAL=".concat(this.interval)); 4803 } 4804 if (this.byMonthDay.length > 0) { 4805 var monthDayValues = this.byMonthDay.map(md => md.toString()).join(","); 4806 attributes.push("BYMONTHDAY=".concat(monthDayValues)); 4807 } 4808 if (this.frequency === "MONTHLY" && this.byDay.length > 0) { 4809 var dayValues = this.byDay.map(d => "".concat(d.value).concat(getiCalDay(d.day))); 4810 attributes.push("BYDAY=".concat(dayValues)); 4811 } else if (this.byDay.length > 0) { 4812 var _dayValues = this.byDay.map(d => d.value !== 1 ? "".concat(d.value).concat(getiCalDay(d.day)) : getiCalDay(d.day)); 4813 attributes.push("BYDAY=".concat(_dayValues)); 4814 } 4815 return attributes.join(";"); 4816 } 4817 getDates(eventStartDateTime, startDateTime, endDateTime) { 4818 var dates = []; 4819 var rockDate = eventStartDateTime; 4820 var dateCount = 0; 4821 if (!rockDate) { 4822 return []; 4823 } 4824 if (this.endDate && this.endDate < endDateTime) { 4825 endDateTime = this.endDate; 4826 } 4827 while (rockDate < endDateTime && dateCount < 100000) { 4828 if (this.count && dateCount >= this.count) { 4829 break; 4830 } 4831 dateCount++; 4832 if (rockDate >= startDateTime) { 4833 dates.push(rockDate); 4834 } 4835 var nextDate = this.nextDateAfter(rockDate); 4836 if (nextDate === null) { 4837 break; 4838 } else { 4839 rockDate = nextDate; 4840 } 4841 } 4842 return dates; 4843 } 4844 nextDateAfter(rockDate) { 4845 if (this.frequency === "DAILY") { 4846 return rockDate.addDays(this.interval); 4847 } else if (this.frequency === "WEEKLY" && this.byDay.length > 0) { 4848 var nextDate = rockDate; 4849 if (nextDate.dayOfWeek === DayOfWeek.Saturday) { 4850 nextDate = nextDate.addDays(1 + (this.interval - 1) * 7); 4851 } else { 4852 nextDate = nextDate.addDays(1); 4853 } 4854 while (!dateMatchesDays(nextDate, this.byDay.map(d => d.day))) { 4855 if (nextDate.dayOfWeek === DayOfWeek.Saturday) { 4856 nextDate = nextDate.addDays(1 + (this.interval - 1) * 7); 4857 } else { 4858 nextDate = nextDate.addDays(1); 4859 } 4860 } 4861 return nextDate; 4862 } else if (this.frequency === "MONTHLY") { 4863 if (this.byMonthDay.length > 0) { 4864 var _nextDate = rockDate.addDays(-(rockDate.day - 1)); 4865 if (rockDate.day >= this.byMonthDay[0]) { 4866 _nextDate = _nextDate.addMonths(this.interval); 4867 } 4868 var lastDayOfMonth = _nextDate.addMonths(1).addDays(-1).day; 4869 var loopCount = 0; 4870 while (lastDayOfMonth < this.byMonthDay[0]) { 4871 _nextDate = _nextDate.addMonths(this.interval); 4872 lastDayOfMonth = _nextDate.addMonths(1).addDays(-1).day; 4873 if (loopCount++ >= 100) { 4874 return null; 4875 } 4876 } 4877 _nextDate = _nextDate.addDays(this.byMonthDay[0] - 1); 4878 return _nextDate; 4879 } else if (this.byDay.length > 0) { 4880 var dayOfWeek = this.byDay[0].day; 4881 var offsets = this.byDay.map(d => d.value); 4882 var _nextDate2 = rockDate.addDays(1); 4883 while (!dateMatchesOffsetDayOfWeeks(_nextDate2, dayOfWeek, offsets)) { 4884 _nextDate2 = _nextDate2.addDays(1); 4885 } 4886 return _nextDate2; 4887 } 4888 } 4889 return null; 4890 } 4891 } 4892 class Event { 4893 constructor() { 4894 var icsContent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; 4895 _defineProperty(this, "excludedDates", []); 4896 _defineProperty(this, "recurrenceDates", []); 4897 _defineProperty(this, "recurrenceRules", []); 4898 if (icsContent === undefined) { 4899 this.uid = newGuid(); 4900 return; 4901 } 4902 var feeder; 4903 if (typeof icsContent === "string") { 4904 feeder = new LineFeeder(icsContent); 4905 } else { 4906 feeder = icsContent; 4907 } 4908 this.parse(feeder); 4909 } 4910 buildLines() { 4911 if (!this.startDateTime || !this.endDateTime) { 4912 return []; 4913 } 4914 var lines = []; 4915 lines.push("BEGIN:VEVENT"); 4916 lines.push("DTEND:".concat(getDateTimeString(this.endDateTime))); 4917 lines.push("DTSTAMP:".concat(getDateTimeString(RockDateTime.now()))); 4918 lines.push("DTSTART:".concat(getDateTimeString(this.startDateTime))); 4919 if (this.excludedDates.length > 0) { 4920 lines.push("EXDATE:".concat(this.excludedDates.map(d => getDateString(d) + "/P1D").join(","))); 4921 } 4922 if (this.recurrenceDates.length > 0) { 4923 var recurrenceDates = []; 4924 var _iterator7 = _createForOfIteratorHelper(this.recurrenceDates), 4925 _step7; 4926 try { 4927 for (_iterator7.s();
4927 !(_step7 = _iterator7.n()).done;) { 4928 var date = _step7.value; 4929 var rDate = RockDateTime.fromParts(date.year, date.month, date.day, this.startDateTime.hour, this.startDateTime.minute, this.startDateTime.second); 4930 if (rDate) { 4931 recurrenceDates.push(getDateTimeString(rDate)); 4932 } 4933 } 4934 } catch (err) { 4935 _iterator7.e(err); 4936 } finally { 4937 _iterator7.f(); 4938 } 4939 lines.push("RDATE:".concat(recurrenceDates.join(","))); 4940 } else if (this.recurrenceRules.length > 0) { 4941 var _iterator8 = _createForOfIteratorHelper(this.recurrenceRules), 4942 _step8; 4943 try { 4944 for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) { 4945 var rrule = _step8.value; 4946 lines.push("RRULE:".concat(rrule.build())); 4947 } 4948 } catch (err) { 4949 _iterator8.e(err); 4950 } finally { 4951 _iterator8.f(); 4952 } 4953 } 4954 lines.push("SEQUENCE:0"); 4955 lines.push("UID:".concat(this.uid)); 4956 lines.push("END:VEVENT"); 4957 return lines; 4958 } 4959 build() { 4960 var lines = this.buildLines(); 4961 if (lines.length === 0) { 4962 return null; 4963 } 4964 return normalizeLineLength(lines).join("\r\n"); 4965 } 4966 parse(feeder) { 4967 var line; 4968 if (feeder.peek() !== "BEGIN:VEVENT") { 4969 throw new Error("Invalid event."); 4970 } 4971 feeder.pop(); 4972 while ((line = feeder.pop()) !== null) { 4973 if (line === "END:VEVENT") { 4974 break; 4975 } 4976 var splitAt = line.indexOf(":"); 4977 if (splitAt < 0) { 4978 continue; 4979 } 4980 var key = line.substring(0, splitAt); 4981 var value = line.substring(splitAt + 1); 4982 var keyAttributes = {}; 4983 var keySegments = key.split(";"); 4984 if (keySegments.length > 1) { 4985 key = keySegments[0]; 4986 keySegments.splice(0, 1); 4987 var _iterator9 = _createForOfIteratorHelper(keySegments), 4988 _step9; 4989 try { 4990 for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) { 4991 var attr = _step9.value; 4992 var attrSegments = attr.split("="); 4993 if (attr.length === 2) { 4994 keyAttributes[attrSegments[0]] = attrSegments[1]; 4995 } 4996 } 4997 } catch (err) { 4998 _iterator9.e(err); 4999 } finally { 5000 _iterator9.f(); 5001 } 5002 } 5003 if (key === "DTSTART") { 5004 var _getDateTimeFromStrin2; 5005 this.startDateTime = (_getDateTimeFromStrin2 = getDateTimeFromString(value)) !== null && _getDateTimeFromStrin2 !== void 0 ? _getDateTimeFromStrin2 : undefined; 5006 } else if (key === "DTEND") { 5007 var _getDateTimeFromStrin3; 5008 this.endDateTime = (_getDateTimeFromStrin3 = getDateTimeFromString(value)) !== null && _getDateTimeFromStrin3 !== void 0 ? _getDateTimeFromStrin3 : undefined; 5009 } else if (key === "RRULE") { 5010 this.recurrenceRules.push(new RecurrenceRule(value)); 5011 } else if (key === "RDATE") { 5012 this.recurrenceDates = getRecurrenceDates(keyAttributes, value); 5013 } else if (key === "UID") { 5014 this.uid = value; 5015 } else if (key === "DURATION") ; else if (key === "EXDATE") { 5016 var dateValues = value.split(","); 5017 var _iterator10 = _createForOfIteratorHelper(dateValues), 5018 _step10; 5019 try { 5020 for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) { 5021 var dateValue = _step10.value; 5022 var dates = getDatesFromRangeOrPeriod(dateValue); 5023 this.excludedDates.push(...dates); 5024 } 5025 } catch (err) { 5026 _iterator10.e(err); 5027 } finally { 5028 _iterator10.f(); 5029 } 5030 } 5031 } 5032 } 5033 isDateExcluded(rockDate) { 5034 var rockDateOnly = rockDate.date; 5035 var _iterator11 = _createForOfIteratorHelper(this.excludedDates), 5036 _step11; 5037 try { 5038 for (_iterator11.s();
5038 !(_step11 = _iterator11.n()).done;) { 5039 var excludedDate = _step11.value; 5040 if (excludedDate.date.isEqualTo(rockDateOnly)) { 5041 return true; 5042 } 5043 } 5044 } catch (err) { 5045 _iterator11.e(err); 5046 } finally { 5047 _iterator11.f(); 5048 } 5049 return false; 5050 } 5051 getDates(startDateTime, endDateTime) { 5052 if (!this.startDateTime) { 5053 return []; 5054 } 5055 if (this.startDateTime > startDateTime) { 5056 startDateTime = this.startDateTime; 5057 } 5058 if (this.recurrenceDates.length > 0) { 5059 var dates = []; 5060 var recurrenceDates = [this.startDateTime, ...this.recurrenceDates]; 5061 for (var _i = 0, _recurrenceDates = recurrenceDates; _i < _recurrenceDates.length; _i++) { 5062 var date = _recurrenceDates[_i]; 5063 if (date >= startDateTime && date < endDateTime) { 5064 dates.push(date); 5065 } 5066 } 5067 return dates; 5068 } else if (this.recurrenceRules.length > 0) { 5069 var rrule = this.recurrenceRules[0]; 5070 return rrule.getDates(this.startDateTime, startDateTime, endDateTime).filter(d => !this.isDateExcluded(d)); 5071 } else { 5072 if (this.startDateTime >= startDateTime && this.startDateTime < endDateTime) { 5073 return [this.startDateTime]; 5074 } 5075 return []; 5076 } 5077 } 5078 toFriendlyText() { 5079 return this.toFriendlyString(false); 5080 } 5081 toFriendlyHtml() { 5082 return this.toFriendlyString(true); 5083 } 5084 toFriendlyString(html) { 5085 if (!this.startDateTime) { 5086 return ""; 5087 } 5088 var startTimeText = this.startDateTime.toLocaleString({ 5089 hour: "numeric", 5090 minute: "2-digit", 5091 hour12: true 5092 }); 5093 if (this.recurrenceRules.length > 0) { 5094 var rrule = this.recurrenceRules[0]; 5095 if (rrule.frequency === "DAILY") { 5096 var result = "Daily"; 5097 if (rrule.interval > 1) { 5098 result += " every ".concat(rrule.interval, " ").concat(pluralConditional(rrule.interval, "day", "days")); 5099 } 5100 result += " at ".concat(startTimeText); 5101 return result; 5102 } else if (rrule.frequency === "WEEKLY") { 5103 if (rrule.byDay.length === 0) { 5104 return "No Scheduled Days"; 5105 } 5106 var _result = rrule.byDay.map(d => getWeekdayName(d.day) + "s").join(","); 5107 if (rrule.interval > 1) { 5108 _result = "Every ".concat(rrule.interval, " weeks: ").concat(_result); 5109 } else { 5110 _result = "Weekly: ".concat(_result); 5111 } 5112 return "".concat(_result, " at ").concat(startTimeText); 5113 } else if (rrule.frequency === "MONTHLY") { 5114 if (rrule.byMonthDay.length > 0) { 5115 var _result2 = "Day ".concat(rrule.byMonthDay[0], " of every "); 5116 if (rrule.interval > 1) { 5117 _result2 += "".concat(rrule.interval, " months"); 5118 } else { 5119 _result2 += "month"; 5120 } 5121 return "".concat(_result2, " at ").concat(startTimeText); 5122 } else if (rrule.byDay.length > 0) { 5123 var byDay = rrule.byDay[0]; 5124 var offsetNames = nthNamesAbbreviated.filter(n => rrule.byDay.some(d => d.value == n[0])).map(n => n[1]); 5125 var _result3 = ""; 5126 if (offsetNames.length > 0) { 5127 var nameText; 5128 if (offsetNames.length > 2) { 5129 nameText = "".concat(offsetNames.slice(0, offsetNames.length - 1).join(", "), " and ").concat(offsetNames[offsetNames.length - 1]); 5130 } else { 5131 nameText = offsetNames.join(" and "); 5132 } 5133 _result3 = "The ".concat(nameText, " ").concat(getWeekdayName(byDay.day), " of every month"); 5134 } else { 5135 return ""; 5136 } 5137 return "".concat(_result3, " at ").concat(startTimeText); 5138 } else { 5139 return ""; 5140 } 5141 } else { 5142 return ""; 5143 } 5144 } else { 5145 var dates = [this.startDateTime, ...this.recurrenceDates]; 5146 if (dates.length === 1) { 5147 return "Once at ".concat(this.startDateTime.toASPString("g")); 5148 } else if (!html || dates.length > 99) { 5149 var firstDate = dates[0]; 5150 var lastDate = dates[dates.length - 1]; 5151 if (firstDate && lastDate) { 5152 return "Multiple dates between ".concat(firstDate.toASPString("g"), " and ").concat(lastDate.toASPString("g")); 5153 } else { 5154 return ""; 5155 } 5156 } else if (dates.length > 1) { 5157 var listHtml = "<ul class=\"list-unstyled\">"; 5158 var _iterator12 = _createForOfIteratorHelper(dates), 5159 _step12; 5160 try { 5161 for (_iterator12.s();
5161 !(_step12 = _iterator12.n()).done;) { 5162 var date = _step12.value; 5163 listHtml += "<li>".concat(date.toASPString("g"), "</li>"); 5164 } 5165 } catch (err) { 5166 _iterator12.e(err); 5167 } finally { 5168 _iterator12.f(); 5169 } 5170 listHtml += "</li>"; 5171 return listHtml; 5172 } else { 5173 return "No Schedule"; 5174 } 5175 } 5176 } 5177 } 5178 class Calendar { 5179 constructor() { 5180 var icsContent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; 5181 _defineProperty(this, "events", []); 5182 if (icsContent === undefined) { 5183 return; 5184 } 5185 var feeder = new LineFeeder(icsContent); 5186 this.parse(feeder); 5187 } 5188 build() { 5189 var lines = []; 5190 lines.push("BEGIN:VCALENDAR"); 5191 lines.push("PRODID:-//github.com/SparkDevNetwork/Rock//NONSGML Rock//EN"); 5192 lines.push("VERSION:2.0"); 5193 var _iterator13 = _createForOfIteratorHelper(this.events), 5194 _step13; 5195 try { 5196 for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) { 5197 var event = _step13.value; 5198 lines.push(...event.buildLines()); 5199 } 5200 } catch (err) { 5201 _iterator13.e(err); 5202 } finally { 5203 _iterator13.f(); 5204 } 5205 lines.push("END:VCALENDAR"); 5206 return denormalizeLineLength(lines).join("\r\n"); 5207 } 5208 parse(feeder) { 5209 var line; 5210 while ((line = feeder.peek()) !== null) { 5211 if (line === "BEGIN:VEVENT") { 5212 var event = new Event(feeder); 5213 this.events.push(event); 5214 } else { 5215 feeder.pop(); 5216 } 5217 } 5218 } 5219 } 5220 5221 var internetCalendar = /*#__PURE__*/Object.freeze({ 5222 __proto__: null, 5223 Calendar: Calendar, 5224 Event: Event, 5225 RecurrenceRule: RecurrenceRule 5226 }); 5227 exports('internetCalendar', internetCalendar); 5228 5229 var engine = new Liquid({ 5230 cache: true 5231 }); 5232 var hasLavaCommandFieldsRegex = /\{%.+%\}/; 5233 var hasLavaShortcodeFieldsRegex = /\{\[.+\]\}/; 5234 function resolveMergeFields(template, mergeFields) { 5235 var tpl = engine.parse(template); 5236 return engine.renderSync(tpl, mergeFields); 5237 } 5238 function hasLavaCommandFields(template) { 5239 return hasLavaCommandFieldsRegex.test(template); 5240 } 5241 function hasLavaShortcodeFields(template) { 5242 return hasLavaShortcodeFieldsRegex.test(template); 5243 } 5244 5245 var lava = /*#__PURE__*/Object.freeze({ 5246 __proto__: null, 5247 hasLavaCommandFields: hasLavaCommandFields, 5248 hasLavaShortcodeFields: hasLavaShortcodeFields, 5249 resolveMergeFields: resolveMergeFields 5250 }); 5251 exports('lava', lava); 5252 5253 function asListItemBagOrNull(bagJson) { 5254 try { 5255 var val = JSON.parse(bagJson); 5256 if ("value" in val || "text" in val) { 5257 return val; 5258 } 5259 return null; 5260 } catch (e) { 5261 return null; 5262 } 5263 } 5264 5265 var listItemBag = /*#__PURE__*/Object.freeze({ 5266 __proto__: null, 5267 asListItemBagOrNull: asListItemBagOrNull 5268 }); 5269 exports('listItemBag', listItemBag); 5270 5271 function formatValue(_x) { 5272 return _formatValue.apply(this, arguments); 5273 } 5274 function _formatValue() { 5275 _formatValue = _asyncToGenerator(function* (value) { 5276 var http = useHttp(); 5277 var options = { 5278 selectedValue: value 5279 }; 5280 var response = yield http.post("/api/v2/Controls/MergeFieldPickerFormatSelectedValue", {}, options); 5281 if (response.isSuccess && response.data) { 5282 return response.data; 5283 } else { 5284 console.error("Error", response.errorMessage || "Error formatting '".concat(value, "'.")); 5285 return ""; 5286 } 5287 }); 5288 return _formatValue.apply(this, arguments); 5289 } 5290 5291 var mergeField = /*#__PURE__*/Object.freeze({ 5292 __proto__: null, 5293 formatValue: formatValue 5294 }); 5295 exports('mergeField', mergeField); 5296
5297 function fromEntries(entries) { 5298 var res = {}; 5299 var _iterator = _createForOfIteratorHelper(entries), 5300 _step; 5301 try { 5302 for (_iterator.s(); !(_step = _iterator.n()).done;) { 5303 var entry = _step.value; 5304 res[entry[0]] = entry[1]; 5305 } 5306 } catch (err) { 5307 _iterator.e(err); 5308 } finally { 5309 _iterator.f(); 5310 } 5311 return res; 5312 } 5313 function clone(obj) { 5314 return JSON.parse(JSON.stringify(obj)); 5315 } 5316 function toListItemBagList(obj) { 5317 return Object.entries(obj).map(_ref => { 5318 var _ref2 = _slicedToArray(_ref, 2), 5319 key = _ref2[0], 5320 value = _ref2[1]; 5321 return { 5322 text: key, 5323 value: "".concat(value) 5324 }; 5325 }); 5326 } 5327 function getValueFromPath(object, path) { 5328 if (!object || !path) { 5329 return; 5330 } 5331 var pathNames = path.split("."); 5332 for (var i = 0; i < pathNames.length; i++) { 5333 var pathName = pathNames[i].trim(); 5334 if (!pathName || !Object.prototype.hasOwnProperty.call(object, pathName)) { 5335 return; 5336 } 5337 var value = object[pathName]; 5338 if (i === pathNames.length - 1) { 5339 return value; 5340 } 5341 if (typeof value !== "object") { 5342 return; 5343 } 5344 object = value; 5345 } 5346 return; 5347 } 5348 5349 var objectUtils = /*#__PURE__*/Object.freeze({ 5350 __proto__: null, 5351 clone: clone, 5352 fromEntries: fromEntries, 5353 getValueFromPath: getValueFromPath, 5354 toListItemBagList: toListItemBagList 5355 }); 5356 exports('objectUtils', objectUtils); 5357 5358 function fetchPhoneNumberConfiguration() { 5359 return _fetchPhoneNumberConfiguration.apply(this, arguments); 5360 } 5361 function _fetchPhoneNumberConfiguration() { 5362 _fetchPhoneNumberConfiguration = _asyncToGenerator(function* () { 5363 var _result$errorMessage; 5364 var http = useHttp(); 5365 var result = yield http.post("/api/v2/Controls/PhoneNumberBoxGetConfiguration", undefined, null); 5366 if (result.isSuccess && result.data) { 5367 return result.data; 5368 } 5369 throw new Error((_result$errorMessage = result.errorMessage) !== null && _result$errorMessage !== void 0 ? _result$errorMessage : "Error fetching phone number configuration"); 5370 }); 5371 return _fetchPhoneNumberConfiguration.apply(this, arguments); 5372 } 5373 function fetchPhoneNumberAndSmsConfiguration() { 5374 return _fetchPhoneNumberAndSmsConfiguration.apply(this, arguments); 5375 } 5376 function _fetchPhoneNumberAndSmsConfiguration() { 5377 _fetchPhoneNumberAndSmsConfiguration = _asyncToGenerator(function* () { 5378 var _result$errorMessage2;
5379 var http = useHttp(); 5380 var options = { 5381 showSmsOptIn: true 5382 }; 5383 var result = yield http.post("/api/v2/Controls/PhoneNumberBoxGetConfiguration", undefined, options); 5384 if (result.isSuccess && result.data) { 5385 return result.data; 5386 } 5387 throw new Error((_result$errorMessage2 = result.errorMessage) !== null && _result$errorMessage2 !== void 0 ? _result$errorMessage2 : "Error fetching phone number configuration"); 5388 }); 5389 return _fetchPhoneNumberAndSmsConfiguration.apply(this, arguments); 5390 } 5391 var getPhoneNumberConfiguration = Cache.cachePromiseFactory("phoneNumberConfiguration", fetchPhoneNumberConfiguration); 5392 var getPhoneNumberAndSmsConfiguration = Cache.cachePromiseFactory("phoneNumberAndSmsConfiguration", fetchPhoneNumberAndSmsConfiguration); 5393 var defaultRulesConfig = [{ 5394 "match": "^(\\d{3})(\\d{4})$", 5395 "format": "$1-$2" 5396 }, { 5397 "match": "^(\\d{3})(\\d{3})(\\d{4})$", 5398 "format": "($1) $2-$3" 5399 }, { 5400 "match": "^1(\\d{3})(\\d{3})(\\d{4})$", 5401 "format": "($1) $2-$3" 5402 }]; 5403 function formatPhoneNumber(value) { 5404 var rules = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultRulesConfig; 5405 value = stripPhoneNumber(value); 5406 if (!value || rules.length == 0) { 5407 return value; 5408 } 5409 var _iterator = _createForOfIteratorHelper(rules), 5410 _step; 5411 try { 5412 for (_iterator.s(); !(_step = _iterator.n()).done;) { 5413 var _rule$match; 5414 var rule = _step.value; 5415 var regex = new RegExp((_rule$match = rule.match) !== null && _rule$match !== void 0 ? _rule$match : ""); 5416 if (regex.test(value)) { 5417 var _rule$format; 5418 return value.replace(regex, (_rule$format = rule.format) !== null && _rule$format !== void 0 ? _rule$format : "") || value; 5419 } 5420 } 5421 } catch (err) { 5422 _iterator.e(err); 5423 } finally { 5424 _iterator.f(); 5425 } 5426 return value; 5427 } 5428 function stripPhoneNumber(str) { 5429 if (!str) { 5430 return ""; 5431 } 5432 return str.replace(/\D/g, ""); 5433 } 5434 var phone = { 5435 getPhoneNumberConfiguration, 5436 formatPhoneNumber, 5437 stripPhoneNumber 5438 }; 5439 window.formatPhoneNumber = formatPhoneNumber; 5440 5441 var phone$1 = /*#__PURE__*/Object.freeze({ 5442 __proto__: null, 5443 default: phone, 5444 formatPhoneNumber: formatPhoneNumber, 5445 getPhoneNumberAndSmsConfiguration: getPhoneNumberAndSmsConfiguration, 5446 getPhoneNumberConfiguration: getPhoneNumberConfiguration, 5447 stripPhoneNumber: stripPhoneNumber 5448 }); 5449 exports('phone', phone$1); 5450 5451 function popover(node, options) { 5452 var _options$sanitize; 5453 if (Array.isArray(node)) { 5454 var _iterator = _createForOfIteratorHelper(node), 5455 _step; 5456 try { 5457 for (_iterator.s(); !(_step = _iterator.n()).done;) { 5458 var n = _step.value; 5459 popover(n, options); 5460 } 5461 } catch (err) { 5462 _iterator.e(err); 5463 } finally { 5464 _iterator.f(); 5465 } 5466 return; 5467 } 5468 $(node).popover({ 5469 html: options === null || options === void 0 ? void 0 : options.html, 5470 sanitize: (_options$sanitize = options === null || options === void 0 ? void 0 : options.sanitize) !== null && _options$sanitize !== void 0 ? _options$sanitize : true 5471 }); 5472 } 5473 5474 var popover$1 = /*#__PURE__*/Object.freeze({ 5475 __proto__: null, 5476 popover: popover 5477 }); 5478 exports('popover', popover$1); 5479 5480 function sleep(ms) { 5481 return new Promise(resolve => { 5482 setTimeout(resolve, ms); 5483 }); 5484 } 5485 function isPromise(obj) { 5486 return !!obj && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function"; 5487 } 5488 class PromiseCompletionSource { 5489 constructor() { 5490 _defineProperty(this, "internalResolve", () => {}); 5491 _defineProperty(this, "internalReject", () => {}); 5492 this.internalPromise = new Promise((resolve, reject) => { 5493 this.internalResolve = resolve; 5494 this.internalReject = reject; 5495 }); 5496 } 5497 get promise() { 5498 return this.internalPromise; 5499 } 5500 resolve(value) { 5501 this.internalResolve(value); 5502 } 5503 reject(reason) { 5504 this.internalReject(reason); 5505 } 5506 } 5507 5508 var promiseUtils = /*#__PURE__*/Object.freeze({ 5509 __proto__: null, 5510 PromiseCompletionSource: PromiseCompletionSource, 5511 isPromise: isPromise, 5512 sleep: sleep 5513 }); 5514 exports('promiseUtils', promiseUtils); 5515 5516 var libraryObject = null; 5517 var libraryPromise = null; 5518 function getRealTimeObject() { 5519 return _getRealTimeObject.apply(this, arguments); 5520 } 5521 function _getRealTimeObject() { 5522 _getRealTimeObject = _asyncToGenerator(function* () { 5523 var _window$Rock2; 5524 if (libraryObject) { 5525 return libraryObject; 5526 } 5527 if (!libraryPromise) { 5528 libraryPromise = loadJavaScriptAsync("/Scripts/Rock/realtime.js", () => { 5529 var _window$Rock; 5530 return !!((_window$Rock = window["Rock"]) !== null && _window$Rock !== void 0 && _window$Rock["RealTime"]); 5531 }); 5532 } 5533 if (!(yield libraryPromise)) { 5534 throw new Error("Unable to load RealTime library."); 5535 } 5536 libraryObject = (_window$Rock2 = window["Rock"]) === null || _window$Rock2 === void 0 ? void 0 : _window$Rock2["RealTime"]; 5537 return libraryObject; 5538 }); 5539 return _getRealTimeObject.apply(this, arguments); 5540 } 5541 function getTopic(_x) { 5542 return _getTopic.apply(this, arguments); 5543 } 5544 function _getTopic() { 5545 _getTopic = _asyncToGenerator(function* (identifier) { 5546 var realTime = yield getRealTimeObject(); 5547 return realTime.getTopic(identifier); 5548 }); 5549 return _getTopic.apply(this, arguments); 5550 } 5551 5552 var realTime = /*#__PURE__*/Object.freeze({ 5553 __proto__: null, 5554 getTopic: getTopic 5555 }); 5556 exports('realTime', realTime); 5557 5558 var regexPatterns = { 5559 specialCharacterPattern: /[({[\]})"]/, 5560 emojiPattern: /(?:[\u2600-\u27BF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDEFF]|\uD83E[\uDD00-\uDDFF])/, 5561 specialFontPattern: /(?:\uD835[\uDC00-\uDFFF]|\uD83C[\uDD00-\uDDFF])/ 5562 }; 5563 var getSpecialCharacterPattern = () => regexPatterns.specialCharacterPattern; 5564 var getEmojiPattern = () => regexPatterns.emojiPattern; 5565 var getSpecialFontPattern = () => regexPatterns.specialFontPattern; 5566 5567 var regexPatterns$1 = /*#__PURE__*/Object.freeze({ 5568 __proto__: null, 5569 getEmojiPattern: getEmojiPattern, 5570 getSpecialCharacterPattern: getSpecialCharacterPattern, 5571 getSpecialFontPattern: getSpecialFontPattern, 5572 regexPatterns: regexPatterns 5573 }); 5574 exports('regexPatterns', regexPatterns$1); 5575 5576 class RockCurrency { 5577 get isZero() { 5578 return this.big.eq(0); 5579 } 5580 get number() { 5581 return this.big.toNumber(); 5582 } 5583 get isNegative() { 5584 return this.big.lt(0); 5585 } 5586 get units() { 5587 return this.big.times(new Big(10).pow(this.currencyInfo.decimalPlaces)).toNumber(); 5588 } 5589 constructor(value, currencyInfo) { 5590 this.currencyInfo = currencyInfo; 5591 if (value instanceof RockCurrency) { 5592 this.big = new Big(value.big).round(this.currencyInfo.decimalPlaces, Big.roundDown); 5593 } else { 5594 this.big = new Big(value !== null && value !== void 0 ? value : 0).round(this.currencyInfo.decimalPlaces, Big.roundDown); 5595 } 5596 } 5597 static create(value, currencyInfo) { 5598 return new RockCurrency(value, currencyInfo); 5599 } 5600 asRockCurrency(value) { 5601 return value instanceof RockCurrency ? value : new RockCurrency(value, this.currencyInfo); 5602 } 5603 add(value) { 5604 var currency = this.asRockCurrency(value); 5605 return new RockCurrency(this.big.plus(currency.big), this.currencyInfo); 5606 } 5607 negate() { 5608 return new RockCurrency(this.big.neg(), this.currencyInfo); 5609 } 5610 divide(divisor) { 5611 var quotient = this.big.div(divisor).round(this.currencyInfo.decimalPlaces, Big.roundDown); 5612 var remainder = this.big.minus(quotient.times(divisor)); 5613 return { 5614 quotient: new RockCurrency(quotient, this.currencyInfo), 5615 remainder: new RockCurrency(remainder, this.currencyInfo) 5616 }; 5617 } 5618 subtract(value) { 5619 var currency = this.asRockCurrency(value); 5620 return new RockCurrency(this.big.minus(currency.big), this.currencyInfo); 5621 } 5622 isEqualTo(value) { 5623 var currency = this.asRockCurrency(value); 5624 return this.big.eq(currency.big); 5625 } 5626 isNotEqualTo(value) { 5627 var currency = this.asRockCurrency(value); 5628 return !this.big.eq(currency.big); 5629 } 5630 isLessThan(value) { 5631 var currency = this.asRockCurrency(value); 5632 return this.big.lt(currency.big); 5633 } 5634 isLessThanOrEqualTo(value) { 5635 var currency = this.asRockCurrency(value); 5636 return this.big.lte(currency.big); 5637 } 5638 noLessThan(value) { 5639 var currency = this.asRockCurrency(value); 5640 if (this.big.lt(currency.big)) { 5641 return new RockCurrency(currency.big, this.currencyInfo); 5642 } else { 5643 return this; 5644 } 5645 } 5646 isGreaterThan(value) { 5647 var limit = this.asRockCurrency(value); 5648 return this.big.gt(limit.big); 5649 } 5650 noGreaterThan(value) { 5651 var currency = this.asRockCurrency(value); 5652 if (this.big.gt(currency.big)) { 5653 return currency; 5654 } else { 5655 return this; 5656 } 5657 } 5658 abs() { 5659 return new RockCurrency(this.big.abs(), this.currencyInfo); 5660 } 5661 mod(divisor) { 5662 var _this$divide = this.divide(divisor), 5663 remainder = _this$divide.remainder; 5664 return remainder; 5665 } 5666 format() { 5667 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; 5668 if (options !== null && options !== void 0 && options.excludeGroupingSeparators) { 5669 var valueString = this.big.toFixed(this.currencyInfo.decimalPlaces, Big.roundDown); 5670 return "".concat(this.currencyInfo.symbol).concat(valueString); 5671 } 5672 return this.toString(); 5673 } 5674 toString() { 5675 var _toCurrencyOrNull; 5676 var valueString = this.big.toFixed(this.currencyInfo.decimalPlaces, Big.roundDown); 5677 return (_toCurrencyOrNull = toCurrencyOrNull(valueString, this.currencyInfo)) !== null && _toCurrencyOrNull !== void 0 ? _toCurrencyOrNull : "".concat(this.currencyInfo.symbol).concat(valueString); 5678 } 5679 } 5680 5681 var rockCurrency = /*#__PURE__*/Object.freeze({ 5682 __proto__: null, 5683 RockCurrency: RockCurrency 5684 }); 5685 exports('rockCurrency', rockCurrency); 5686 5687 function useScreenSize() { 5688 var mobileThreshold = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 480; 5689 var isMobile = ref(false); 5690 var screenSize = ref(screen.width); 5691 function onResize() { 5692 screenSize.value = screen.width; 5693 if (screen.width <= mobileThreshold) { 5694 isMobile.value = true; 5695 } else { 5696 isMobile.value = false;
5697 } 5698 } 5699 onMounted(() => { 5700 nextTick(() => { 5701 onResize(); 5702 }); 5703 window.addEventListener("resize", onResize); 5704 }); 5705 onUnmounted(() => { 5706 window.removeEventListener("resize", onResize); 5707 }); 5708 return { 5709 isMobile, 5710 screenSize 5711 }; 5712 } 5713 function useViewportWidth() { 5714 var mobileThreshold = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 480; 5715 var isMobile = ref(false); 5716 var viewportWidth = ref(window.innerWidth); 5717 function onResize() { 5718 viewportWidth.value = window.innerWidth; 5719 isMobile.value = viewportWidth.value <= mobileThreshold; 5720 } 5721 onMounted(() => { 5722 nextTick(() => { 5723 onResize(); 5724 }); 5725 window.addEventListener("resize", onResize); 5726 }); 5727 onUnmounted(() => { 5728 window.removeEventListener("resize", onResize); 5729 }); 5730 return { 5731 isMobile, 5732 viewportWidth: viewportWidth 5733 }; 5734 } 5735 5736 var screenSize = /*#__PURE__*/Object.freeze({ 5737 __proto__: null, 5738 useScreenSize: useScreenSize, 5739 useViewportWidth: useViewportWidth 5740 }); 5741 exports('screenSize', screenSize); 5742 5743 var rangeTypeOptions = [{ 5744 value: SlidingDateRangeType.Current.toString(), 5745 text: "Current" 5746 }, { 5747 value: SlidingDateRangeType.Previous.toString(), 5748 text: "Previous" 5749 }, { 5750 value: SlidingDateRangeType.Last.toString(), 5751 text: "Last" 5752 }, { 5753 value: SlidingDateRangeType.Next.toString(), 5754 text: "Next" 5755 }, { 5756 value: SlidingDateRangeType.Upcoming.toString(), 5757 text: "Upcoming" 5758 }, { 5759 value: SlidingDateRangeType.DateRange.toString(), 5760 text: "Date Range" 5761 }]; 5762 var timeUnitOptions = [{ 5763 value: TimeUnitType.Hour.toString(), 5764 text: "Hour" 5765 }, { 5766 value: TimeUnitType.Day.toString(), 5767 text: "Day" 5768 }, { 5769 value: TimeUnitType.Week.toString(), 5770 text: "Week" 5771 }, { 5772 value: TimeUnitType.Month.toString(), 5773 text: "Month" 5774 }, { 5775 value: TimeUnitType.Year.toString(), 5776 text: "Year" 5777 }]; 5778 function getTextForValue(value, options) { 5779 var _matches$0$text; 5780 var matches = options.filter(v => v.value === value); 5781 return matches.length > 0 ? (_matches$0$text = matches[0].text) !== null && _matches$0$text !== void 0 ? _matches$0$text : "" : ""; 5782 } 5783 function getRangeTypeText(rangeType) { 5784 var _rangeTypes$0$text; 5785 var rangeTypes = rangeTypeOptions.filter(o => o.value === rangeType.toString()); 5786 return rangeTypes.length > 0 ? (_rangeTypes$0$text = rangeTypes[0].text) !== null && _rangeTypes$0$text !== void 0 ? _rangeTypes$0$text : "" : ""; 5787 } 5788 function getTimeUnitText(timeUnit) { 5789 var _timeUnits$0$text; 5790 var timeUnits = timeUnitOptions.filter(o => o.value === timeUnit.toString()); 5791 return timeUnits.length > 0 ? (_timeUnits$0$text = timeUnits[0].text) !== null && _timeUnits$0$text !== void 0 ? _timeUnits$0$text : "" : ""; 5792 } 5793 function parseSlidingDateRangeString(value) { 5794 var segments = value.split("|"); 5795 if (segments.length < 3) { 5796 return null; 5797 } 5798 var rangeTypes = rangeTypeOptions.filter(o => { 5799 var _o$text; 5800 return ((_o$text = o.text) !== null && _o$text !== void 0 ? _o$text : "").replace(" ", "").toLowerCase() === segments[0].toLowerCase() || o.value === segments[0]; 5801 }); 5802 var timeUnits = timeUnitOptions.filter(o => { 5803 var _o$text2; 5804 return ((_o$text2 = o.text) !== null && _o$text2 !== void 0 ? _o$text2 : "").toLowerCase() === segments[2].toLowerCase() || o.value === segments[2]; 5805 }); 5806 if (rangeTypes.length === 0) { 5807 return null; 5808 } 5809 var range = { 5810 rangeType: toNumber(rangeTypes[0].value) 5811 }; 5812 if ([SlidingDateRangeType.Current, SlidingDateRangeType.Last, SlidingDateRangeType.Next, SlidingDateRangeType.Previous, SlidingDateRangeType.Upcoming].includes(range.rangeType)) { 5813 range.timeUnit = timeUnits.length > 0 ? toNumber(timeUnits[0].value) : TimeUnitType.Hour; 5814 if ([SlidingDateRangeType.Last, SlidingDateRangeType.Next, SlidingDateRangeType.Previous, SlidingDateRangeType.Upcoming].includes(range.rangeType)) { 5815 var _toNumberOrNull; 5816 range.timeValue = (_toNumberOrNull = toNumberOrNull(segments[1])) !== null && _toNumberOrNull !== void 0 ? _toNumberOrNull : 1; 5817 } 5818 } 5819 if (range.rangeType === SlidingDateRangeType.DateRange) { 5820 if (segments.length > 3) { 5821 range.lowerDate = segments[3]; 5822 } 5823 if (segments.length > 4) { 5824 range.upperDate = segments[4]; 5825 } 5826 } 5827 return range; 5828 } 5829 function slidingDateRangeToString(value) { 5830 var _value$timeUnit$toStr, _value$timeUnit, _value$lowerDate, _value$upperDate, _value$timeValue, _value$timeUnit$toStr2, _value$timeUnit2; 5831 switch (value.rangeType) { 5832 case SlidingDateRangeType.Current: 5833 return "Current||".concat(getTextForValue((_value$timeUnit$toStr = (_value$timeUnit = value.timeUnit) === null || _value$timeUnit === void 0 ? void 0 : _value$timeUnit.toString()) !== null && _value$timeUnit$toStr !== void 0 ? _value$timeUnit$toStr : "", timeUnitOptions), "||"); 5834 case SlidingDateRangeType.DateRange: 5835 return "DateRange|||".concat((_value$lowerDate = value.lowerDate) !== null && _value$lowerDate !== void 0 ? _value$lowerDate : "", "|").concat((_value$upperDate = value.upperDate) !== null && _value$upperDate !== void 0 ? _value$upperDate : ""); 5836 default: 5837 return "".concat(getTextForValue(value.rangeType.toString(), rangeTypeOptions), "|").concat((_value$timeValue = value.timeValue) !== null && _value$timeValue !== void 0 ? _value$timeValue : "", "|").concat(getTextForValue((_value$timeUnit$toStr2 = (_value$timeUnit2 = value.timeUnit) === null || _value$timeUnit2 === void 0 ? void 0 : _value$timeUnit2.toString()) !== null && _value$timeUnit$toStr2 !== void 0 ? _value$timeUnit$toStr2 : "", timeUnitOptions), "||"); 5838 } 5839 } 5840 function calculateSlidingDateRange(value) { 5841 var currentDateTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; 5842 var result = { 5843 start: null, 5844 end: null 5845 }; 5846 if (!currentDateTime) { 5847 currentDateTime = RockDateTime.now(); 5848 } 5849 if (value.rangeType === SlidingDateRangeType.Current) { 5850 if (value.timeUnit === TimeUnitType.Hour) { 5851 var _result$start$addHour, _result$start; 5852 result.start = RockDateTime.fromParts(currentDateTime.year, currentDateTime.month, currentDateTime.day, currentDateTime.hour, 0, 0); 5853 result.end = (_result$start$addHour = (_result$start = result.start) === null || _result$start === void 0 ? void 0 : _result$start.addHours(1)) !== null && _result$start$addHour !== void 0 ? _result$start$addHour : null; 5854 } else if (value.timeUnit === TimeUnitType.Day) { 5855 result.start = currentDateTime.date; 5856 result.end = result.start.addDays(1); 5857 } else if (value.timeUnit === TimeUnitType.Week) { 5858 var diff = currentDateTime.dayOfWeek - DayOfWeek.Monday; 5859 if (diff < 0) { 5860 diff += 7; 5861 } 5862 result.start = currentDateTime.addDays(-1 * diff).date; 5863 result.end = result.start.addDays(7); 5864 } else if (value.timeUnit === TimeUnitType.Month) { 5865 var _result$start$addMont, _result$start2; 5866 result.start = RockDateTime.fromParts(currentDateTime.year, currentDateTime.month, 1); 5867 result.end = (_result$start$addMont = (_result$start2 = result.start) === null || _result$start2 === void 0 ? void 0 : _result$start2.addMonths(1)) !== null && _result$start$addMont !== void 0 ? _result$start$addMont : null; 5868 } else if (value.timeUnit === TimeUnitType.Year) { 5869 result.start = RockDateTime.fromParts(currentDateTime.year, 1, 1); 5870 result.end = RockDateTime.fromParts(currentDateTime.year + 1, 1, 1); 5871 } 5872 } else if (value.rangeType === SlidingDateRangeType.Last || value.rangeType === SlidingDateRangeType.Previous) { 5873 var _value$timeValue2; 5874 var count = (_value$timeValue2 = value.timeValue) !== null && _value$timeValue2 !== void 0 ? _value$timeValue2 : 1; 5875 var roundUpCount = value.rangeType === SlidingDateRangeType.Last ? 1 : 0; 5876 if (value.timeUnit === TimeUnitType.Hour) { 5877 var _RockDateTime$fromPar, _RockDateTime$fromPar2, _result$end$addHours, _result$end; 5878 result.end = (_RockDateTime$fromPar = (_RockDateTime$fromPar2 = RockDateTime.fromParts(currentDateTime.year, currentDateTime.month, currentDateTime.day, currentDateTime.hour, 0, 0)) === null || _RockDateTime$fromPar2 === void 0 ? void 0 : _RockDateTime$fromPar2.addHours(roundUpCount)) !== null && _RockDateTime$fromPar !== void 0 ? _RockDateTime$fromPar : null; 5879 result.start = (_result$end$addHours = (_result$end = result.end) === null || _result$end === void 0 ? void 0 : _result$end.addHours(-count)) !== null && _result$end$addHours !== void 0 ? _result$end$addHours : null; 5880 } else if (value.timeUnit === TimeUnitType.Day) { 5881 var _result$end$addDays, _result$end2; 5882 result.end = currentDateTime.date.addDays(roundUpCount); 5883 result.start = (_result$end$addDays = (_result$end2 = result.end) === null || _result$end2 === void 0 ? void 0 : _result$end2.addDays(-count)) !== null && _result$end$addDays !== void 0 ? _result$end$addDays : null; 5884 } else if (value.timeUnit === TimeUnitType.Week) { 5885 var _diff = currentDateTime.dayOfWeek - DayOfWeek.Monday; 5886 if (_diff < 0) { 5887 _diff += 7; 5888 } 5889 result.end = currentDateTime.addDays(-1 * _diff).date.addDays(7 * roundUpCount); 5890 result.start = result.end.addDays(-count * 7); 5891 } else if (value.timeUnit === TimeUnitType.Month) { 5892 var _RockDateTime$fromPar3, _RockDateTime$fromPar4, _result$end$addMonths, _result$end3; 5893 result.end = (_RockDateTime$fromPar3 = (_RockDateTime$fromPar4 = RockDateTime.fromParts(currentDateTime.year, currentDateTime.month, 1)) === null || _RockDateTime$fromPar4 === void 0 ? void 0 : _RockDateTime$fromPar4.addMonths(roundUpCount)) !== null && _RockDateTime$fromPar3 !== void 0 ? _RockDateTime$fromPar3 : null; 5894 result.start = (_result$end$addMonths = (_result$end3 = result.end) === null || _result$end3 === void 0 ? void 0 : _result$end3.addMonths(-count)) !== null && _result$end$addMonths !== void 0 ? _result$end$addMonths : null; 5895 } else if (value.timeUnit === TimeUnitType.Year) { 5896 var _RockDateTime$fromPar5, _RockDateTime$fromPar6, _result$end$addYears, _result$end4; 5897 result.end = (_RockDateTime$fromPar5 = (_RockDateTime$fromPar6 = RockDateTime.fromParts(currentDateTime.year, 1, 1)) === null || _RockDateTime$fromPar6 === void 0 ? void 0 : _RockDateTime$fromPar6.addYears(roundUpCount)) !== null && _RockDateTime$fromPar5 !== void 0 ? _RockDateTime$fromPar5 : null; 5898 result.start = (_result$end$addYears = (_result$end4 = result.end) === null || _result$end4 === void 0 ? void 0 : _result$end4.addYears(-count)) !== null && _result$end$addYears !== void 0 ? _result$end$addYears : null; 5899 } 5900 var cutoffDate = currentDateTime.date.addDays(1); 5901 if (result.end && result.end.date > cutoffDate) { 5902 result.end = cutoffDate; 5903 } 5904 } else if (value.rangeType === SlidingDateRangeType.Next || value.rangeType === SlidingDateRangeType.Upcoming) { 5905 var _value$timeValue3; 5906 var _count = (_value$timeValue3 = value.timeValue) !== null && _value$timeValue3 !== void 0 ? _value$timeValue3 : 1; 5907 var _roundUpCount = value.rangeType === SlidingDateRangeType.Upcoming ? 1 : 0; 5908 if (value.timeUnit === TimeUnitType.Hour) { 5909 var _RockDateTime$fromPar7, _RockDateTime$fromPar8, _result$start$addHour2, _result$start3; 5910 result.start = (_RockDateTime$fromPar7 = (_RockDateTime$fromPar8 = RockDateTime.fromParts(currentDateTime.year, currentDateTime.month, currentDateTime.day, currentDateTime.hour, 0, 0)) === null || _RockDateTime$fromPar8 === void 0 ? void 0 : _RockDateTime$fromPar8.addHours(_roundUpCount)) !== null && _RockDateTime$fromPar7 !== void 0 ? _RockDateTime$fromPar7 : null; 5911 result.end = (_result$start$addHour2 = (_result$start3 = result.start) === null || _result$start3 === void 0 ? void 0 : _result$start3.addHours(_count)) !== null && _result$start$addHour2 !== void 0 ? _result$start$addHour2 : null; 5912 } else if (value.timeUnit === TimeUnitType.Day) { 5913 result.start = currentDateTime.date.addDays(_roundUpCount); 5914 result.end = result.start.addDays(_count); 5915 } else if (value.timeUnit === TimeUnitType.Week) { 5916 var _diff2 = currentDateTime.dayOfWeek - DayOfWeek.Monday; 5917 if (_diff2 < 0) { 5918 _diff2 += 7; 5919 } 5920 result.start = currentDateTime.addDays(-1 * _diff2).date.addDays(7 * _roundUpCount); 5921 result.end = result.start.addDays(_count * 7); 5922 } else if (value.timeUnit === TimeUnitType.Month) { 5923 var _RockDateTime$fromPar9, _RockDateTime$fromPar10, _result$start$addMont2, _result$start4; 5924 result.start = (_RockDateTime$fromPar9 = (_RockDateTime$fromPar10 = RockDateTime.fromParts(currentDateTime.year, currentDateTime.month, 1)) === null || _RockDateTime$fromPar10 === void 0 ? void 0 : _RockDateTime$fromPar10.addMonths(_roundUpCount)) !== null && _RockDateTime$fromPar9 !== void 0 ? _RockDateTime$fromPar9 : null; 5925 result.end = (_result$start$addMont2 = (_result$start4 = result.start) === null || _result$start4 === void 0 ? void 0 : _result$start4.addMonths(_count)) !== null && _result$start$addMont2 !== void 0 ? _result$start$addMont2 : null; 5926 } else if (value.timeUnit === TimeUnitType.Year) { 5927 var _RockDateTime$fromPar11, _RockDateTime$fromPar12, _result$start$addYear, _result$start5; 5928 result.start = (_RockDateTime$fromPar11 = (_RockDateTime$fromPar12 = RockDateTime.fromParts(currentDateTime.year, 1, 1)) === null || _RockDateTime$fromPar12 === void 0 ? void 0 : _RockDateTime$fromPar12.addYears(_roundUpCount)) !== null && _RockDateTime$fromPar11 !== void 0 ? _RockDateTime$fromPar11 : null; 5929 result.end = (_result$start$addYear = (_result$start5 = result.start) === null || _result$start5 === void 0 ? void 0 : _result$start5.addYears(_count)) !== null && _result$start$addYear !== void 0 ? _result$start$addYear : null; 5930 } 5931 if (result.start && result.start.date < currentDateTime.date) { 5932 result.start = currentDateTime.date; 5933 } 5934 } else if (value.rangeType === SlidingDateRangeType.DateRange) { 5935 var _value$lowerDate2, _value$upperDate2; 5936 result.start = RockDateTime.parseISO((_value$lowerDate2 = value.lowerDate) !== null && _value$lowerDate2 !== void 0 ? _value$lowerDate2 : ""); 5937 result.end = RockDateTime.parseISO((_value$upperDate2 = value.upperDate) !== null && _value$upperDate2 !== void 0 ? _value$upperDate2 : ""); 5938 if (!result.start && value.lowerDate) { 5939 result.start = RockDateTime.fromJSDate(new Date(value.lowerDate)); 5940 } 5941 if (!result.end && value.upperDate) { 5942 result.end = RockDateTime.fromJSDate(new Date(value.upperDate)); 5943 } 5944 if (result.end) { 5945 result.end = result.end.addDays(1); 5946 } 5947 } 5948 if (result.end && value.timeUnit != TimeUnitType.Hour) { 5949 result.end = result.end.addMilliseconds(-1); 5950 } 5951 return result; 5952 } 5953 5954 var slidingDateRange = /*#__PURE__*/Object.freeze({ 5955 __proto__: null, 5956 RangeType: SlidingDateRangeType, 5957 TimeUnit: TimeUnitType, 5958 calculateSlidingD
5958ateRange: calculateSlidingDateRange, 5959 getRangeTypeText: getRangeTypeText, 5960 getTimeUnitText: getTimeUnitText, 5961 parseSlidingDateRangeString: parseSlidingDateRangeString, 5962 rangeTypeOptions: rangeTypeOptions, 5963 slidingDateRangeToString: slidingDateRangeToString, 5964 timeUnitOptions: timeUnitOptions 5965 }); 5966 exports('slidingDateRange', slidingDateRange); 5967 5968 var http = useHttp(); 5969 function getStructuredContentEditorConfiguration(_x) { 5970 return _getStructuredContentEditorConfiguration.apply(this, arguments); 5971 } 5972 function _getStructuredContentEditorConfiguration() { 5973 _getStructuredContentEditorConfiguration = _asyncToGenerator(function* (options) { 5974 var result = yield http.post("/api/v2/Controls/StructuredContentEditorGetConfiguration", undefined, options); 5975 if (result.isSuccess && result.data) { 5976 return result.data; 5977 } 5978 throw new Error(result.errorMessage || "Error fetching structured content editor configuration"); 5979 }); 5980 return _getStructuredContentEditorConfiguration.apply(this, arguments); 5981 } 5982 var structuredContentEditor = { 5983 getStructuredContentEditorConfiguration 5984 }; 5985 5986 var structuredContentEditor$1 = /*#__PURE__*/Object.freeze({ 5987 __proto__: null, 5988 default: structuredContentEditor, 5989 getStructuredContentEditorConfiguration: getStructuredContentEditorConfiguration 5990 }); 5991 exports('structuredContentEditor', structuredContentEditor$1); 5992 5993 function tooltip(node, options) { 5994 if (Array.isArray(node)) { 5995 var _iterator = _createForOfIteratorHelper(node), 5996 _step; 5997 try { 5998 for (_iterator.s(); !(_step = _iterator.n()).done;) { 5999 var n = _step.value; 6000 tooltip(n, options); 6001 } 6002 } catch (err) { 6003 _iterator.e(err); 6004 } finally { 6005 _iterator.f(); 6006 } 6007 return; 6008 } 6009 if (typeof $ !== "function") { 6010 return; 6011 } 6012 var $node = $(node); 6013 var appliedContainer = undefined; 6014 var fsElement = undefined; 6015 var getContainer = () => { 6016 var _options$container2; 6017 if (!isFullscreen() && fsElement) { 6018 var _options$container; 6019 fsElement.style.position = ""; 6020 fsElement = undefined; 6021 return (_options$container = options === null || options === void 0 ? void 0 : options.container) !== null && _options$container !== void 0 ? _options$container : "body"; 6022 } 6023 var newFsElement = getFullscreenElement();
6024 if (newFsElement && newFsElement === fsElement) { 6025 return undefined; 6026 } 6027 if (newFsElement && newFsElement.contains(node)) { 6028 fsElement = newFsElement; 6029 var fsElementPosition = getComputedStyle(fsElement).position; 6030 if (fsElementPosition === "static") { 6031 fsElement.style.position = "relative"; 6032 } 6033 return getUniqueCssSelector(fsElement); 6034 } 6035 return (_options$container2 = options === null || options === void 0 ? void 0 : options.container) !== null && _options$container2 !== void 0 ? _options$container2 : "body"; 6036 }; 6037 var applyTooltip = container => { 6038 if (appliedContainer === container || container === undefined) { 6039 return; 6040 } 6041 if (appliedContainer) { 6042 $node === null || $node === void 0 || $node.tooltip("destroy"); 6043 setTimeout(() => { 6044 var _options$sanitize; 6045 $node === null || $node === void 0 || $node.tooltip({ 6046 container: container, 6047 html: options === null || options === void 0 ? void 0 : options.html, 6048 sanitize: (_options$sanitize = options === null || options === void 0 ? void 0 : options.sanitize) !== null && _options$sanitize !== void 0 ? _options$sanitize : true, 6049 delay: options === null || options === void 0 ? void 0 : options.delay, 6050 trigger: "hover focus" 6051 }); 6052 }, 151); 6053 } else { 6054 var _options$sanitize2; 6055 $node === null || $node === void 0 || $node.tooltip({ 6056 container: container, 6057 html: options === null || options === void 0 ? void 0 : options.html, 6058 sanitize: (_options$sanitize2 = options === null || options === void 0 ? void 0 : options.sanitize) !== null && _options$sanitize2 !== void 0 ? _options$sanitize2 : true, 6059 delay: options === null || options === void 0 ? void 0 : options.delay, 6060 trigger: "hover focus" 6061 }); 6062 } 6063 appliedContainer = container; 6064 }; 6065 if (!(options !== null && options !== void 0 && options.container) || options.container === "body" || options.container === "html") { 6066 document.addEventListener("fullscreenchange", () => applyTooltip(getContainer())); 6067 } 6068 applyTooltip(getContainer()); 6069 $(document).on("click", ".tooltip", function (e) { 6070 e.stopPropagation(); 6071 }); 6072 $node === null || $node === void 0 || $node.on("mouseleave", function () { 6073 if (!$(this).data("tooltip-pinned")) { 6074 $node === null || $node === void 0 || $node.tooltip("hide"); 6075 } 6076 }); 6077 } 6078 function showTooltip(node) { 6079 if (typeof $ === "function") { 6080 $(node).tooltip("show"); 6081 $(node).data("tooltip-pinned", true); 6082 } 6083 } 6084 function hideTooltip(node) { 6085 if (typeof $ === "function") { 6086 $(node).data("tooltip-pinned", false); 6087 $(node).tooltip("hide"); 6088 } 6089 } 6090 function destroyTooltip(node) { 6091 if (typeof $ === "function") { 6092 $(node).tooltip("destroy"); 6093 } 6094 } 6095 6096 var tooltip$1 = /*#__PURE__*/Object.freeze({ 6097 __proto__: null, 6098 destroyTooltip: destroyTooltip, 6099 hideTooltip: hideTooltip, 6100 showTooltip: showTooltip, 6101 tooltip: tooltip 6102 }); 6103 exports('tooltip', tooltip$1); 6104 6105 class CategoryTreeItemProvider { 6106 getItems(parentGuid) { 6107 var _this = this; 6108 return _asyncToGenerator(function* () { 6109 var options = { 6110 parentGuid: parentGuid, 6111 entityTypeGuid: _this.entityTypeGuid, 6112 entityTypeQualifierColumn: _this.entityTypeQualifierColumn, 6113 entityTypeQualifierValue: _this.entityTypeQualifierValue, 6114 lazyLoad: false, 6115 securityGrantToken: _this.securityGrantToken, 6116 getCategorizedItems: false, 6117 includeCategoriesWithoutChildren: true, 6118 includeInactiveItems: false, 6119 includeUnnamedEntityItems: false 6120 }; 6121 var response = yield post("/api/v2/Controls/CategoryPickerChildTreeItems", {}, options); 6122 if (response.isSuccess && response.data) { 6123 return response.data; 6124 } else { 6125 console.log("Error", response.errorMessage); 6126 return []; 6127 } 6128 })(); 6129 } 6130 getRootItems() { 6131 var _this2 = this; 6132 return _asyncToGenerator(function* () { 6133 return yield _this2.getItems(_this2.rootCategoryGuid); 6134 })(); 6135 } 6136 getChildItems(item) { 6137 var _this3 = this; 6138 return _asyncToGenerator(function* () { 6139 return _this3.getItems(item.value); 6140 })(); 6141 } 6142 } 6143 class LocationTreeItemProvider { 6144 getItems(parentGuid) { 6145 var _this4 = this; 6146 return _asyncToGenerator(function* () { 6147 var _toGuidOrNull; 6148 var options = { 6149 guid: (_toGuidOrNull = toGuidOrNull(parentGuid)) !== null && _toGuidOrNull !== void 0 ? _toGuidOrNull : emptyGuid, 6150 rootLocationGuid: emptyGuid, 6151 securityGrantToken: _this4.securityGrantToken 6152 }; 6153 var url = "/api/v2/Controls/LocationItemPickerGetActiveChildren"; 6154 var response = yield post(url, undefined, options); 6155 if (response.isSuccess && response.data) { 6156 return response.data; 6157 } else { 6158 console.log("Error", response.errorMessage); 6159 return []; 6160 } 6161 })(); 6162 } 6163 getRootItems() { 6164 var _this5 = this; 6165 return _asyncToGenerator(function* () { 6166 return yield _this5.getItems(null); 6167 })(); 6168 } 6169 getChildItems(item) { 6170 var _this6 = this; 6171 return _asyncToGenerator(function* () { 6172 return _this6.getItems(item.value); 6173 })(); 6174 } 6175 } 6176 class DataViewTreeItemProvider { 6177 constructor() { 6178 _defineProperty(this, "displayPersistedOnly", false); 6179 } 6180 getItems(parentGuid) { 6181 var _this7 = this; 6182 return _asyncToGenerator(function* () { 6183 var options = { 6184 parentGuid, 6185 getCategorizedItems: true, 6186 includeCategoriesWithoutChildren: false, 6187 entityTypeGuidFilter: _this7.entityTypeGuid, 6188 lazyLoad: false, 6189 securityGrantToken: _this7.securityGrantToken, 6190 displayPersistedOnly: _this7.displayPersistedOnly, 6191 includeUnnamedEntityItems: false 6192 }; 6193 var response = yield post("/api/v2/Controls/DataViewPickerGetDataViews", {}, options); 6194 if (response.isSuccess && response.data) { 6195 return response.data; 6196 } else { 6197 console.log("Error", response.errorMessage); 6198 return []; 6199 } 6200 })(); 6201 } 6202 getRootItems() { 6203 var _this8 = this; 6204 return _asyncToGenerator(function* () { 6205 return yield _this8.getItems(); 6206 })(); 6207 } 6208 getChildItems(item) { 6209 var _this9 = this; 6210 return _asyncToGenerator(function* () { 6211 return _this9.getItems(item.value); 6212 })(); 6213 } 6214 } 6215 class WorkflowTypeTreeItemProvider { 6216 getItems(parentGuid) { 6217 var _this10 = this; 6218 return _asyncToGenerator(function* () { 6219 var _this10$includeInacti; 6220 var options = { 6221 parentGuid, 6222 includeInactiveItems: (_this10$includeInacti = _this10.includeInactiveItems) !== null && _this10$includeInacti !== void 0 ? _this10$includeInacti : false, 6223 securityGrantToken: _this10.securityGrantToken, 6224 getCategorizedItems: false, 6225 includeCategoriesWithoutChildren: false, 6226 includeUnnamedEntityItems: false, 6227 lazyLoad: false 6228 }; 6229 var response = yield post("/api/v2/Controls/WorkflowTypePickerGetWorkflowTypes", {}, options); 6230 if (response.isSuccess && response.data) { 6231 return response.data; 6232 } else { 6233 console.log("Error", response.errorMessage); 6234 return []; 6235 } 6236 })(); 6237 } 6238 getRootItems() { 6239 var _this11 = this; 6240 return _asyncToGenerator(function* () { 6241 return yield _this11.getItems(); 6242 })(); 6243 } 6244 getChildItems(item) { 6245 var _this12 = this; 6246 return _asyncToGenerator(function* () { 6247 return _this12.getItems(item.value); 6248 })(); 6249 } 6250 } 6251 class PageTreeItemProvider { 6252 getItems(parentGuid) { 6253 var _this13 = this; 6254 return _asyncToGenerator(function* () { 6255 var _toGuidOrNull2, _this13$hidePageGuids; 6256 var result; 6257 var options = { 6258 guid: (_toGuidOrNull2 = toGuidOrNull(parentGuid)) !== null && _toGuidOrNull2 !== void 0 ? _toGuidOrNull2 : emptyGuid, 6259 rootPageGuid: null, 6260 hidePageGuids: (_this13$hidePageGuids = _this13.hidePageGuids) !== null && _this13$hidePageGuids !== void 0 ? _this13$hidePageGuids : [], 6261 securityGrantToken: _this13.securityGrantToken, 6262 siteType: _this13.siteType 6263 }; 6264 var url = "/api/v2/Controls/PagePickerGetChildren"; 6265 var response = yield post(url, undefined, options); 6266 if (response.isSuccess && response.data) { 6267 result = response.data; 6268 } else { 6269 console.log("Error", response.errorMessage); 6270 return []; 6271 } 6272 if (parentGuid || !_this13.selectedPageGuids) { 6273 return result; 6274 } 6275 return _this13.getHierarchyToSelectedPage(result); 6276 })(); 6277 } 6278 getParentList() { 6279 var _this14 = this; 6280 return _asyncToGenerator(function* () { 6281 var options = { 6282 selectedPageGuids: _this14.selectedPageGuids, 6283 securityGrantToken: _this14.securityGrantToken 6284 }; 6285 var url = "/api/v2/Controls/PagePickerGetSelectedPageHierarchy"; 6286 var response = yield post(url, undefined, options); 6287 if (response.isSuccess && response.data) { 6288 return response.data; 6289 } else { 6290 console.log("Error", response.errorMessage); 6291 return []; 6292 } 6293 })(); 6294 } 6295 getHierarchyToSelectedPage(rootLayer) { 6296 var _this15 = this; 6297 return _asyncToGenerator(function* () { 6298 var parents = yield _this15.getParentList(); 6299 if (!parents || parents.length == 0) { 6300 return rootLayer; 6301 } 6302 var childLists = yield Promise.all(parents.map(guid => _this15.getItems(guid))); 6303 var allPages = rootLayer.concat(flatten(childLists));
6304 parents.forEach((parentGuid, i) => { 6305 var parentPage = allPages.find(page => page.value == parentGuid); 6306 if (parentPage) { 6307 parentPage.children = childLists[i]; 6308 } 6309 }); 6310 return rootLayer; 6311 })(); 6312 } 6313 getRootItems() { 6314 var _this16 = this; 6315 return _asyncToGenerator(function* () { 6316 return yield _this16.getItems(null); 6317 })(); 6318 } 6319 getChildItems(item) { 6320 var _this17 = this; 6321 return _asyncToGenerator(function* () { 6322 return _this17.getItems(item.value); 6323 })(); 6324 } 6325 } 6326 class ConnectionRequestTreeItemProvider { 6327 getItems(parentGuid) { 6328 var _this18 = this; 6329 return _asyncToGenerator(function* () { 6330 var options = { 6331 parentGuid, 6332 securityGrantToken: _this18.securityGrantToken 6333 }; 6334 var url = "/api/v2/Controls/ConnectionRequestPickerGetChildren"; 6335 var response = yield post(url, undefined, options); 6336 if (response.isSuccess && response.data) { 6337 return response.data; 6338 } else { 6339 console.log("Error", response.errorMessage); 6340 return []; 6341 } 6342 })(); 6343 } 6344 getRootItems() { 6345 var _this19 = this; 6346 return _asyncToGenerator(function* () { 6347 return yield _this19.getItems(null); 6348 })(); 6349 } 6350 getChildItems(item) { 6351 var _this20 = this; 6352 return _asyncToGenerator(function* () { 6353 return _this20.getItems(item.value); 6354 })(); 6355 } 6356 } 6357 class GroupTreeItemProvider { 6358 constructor() { 6359 _defineProperty(this, "securityGrantToken", null); 6360 _defineProperty(this, "rootGroupGuid", null); 6361 _defineProperty(this, "includedGroupTypeGuids", []); 6362 _defineProperty(this, "includeInactiveGroups", false); 6363 _defineProperty(this, "limitToSchedulingEnabled", false); 6364 _defineProperty(this, "limitToRSVPEnabled", false); 6365 } 6366 getItems() { 6367 var _arguments = arguments, 6368 _this21 = this; 6369 return _asyncToGenerator(function* () { 6370 var parentGuid = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : null; 6371 var options = { 6372 guid: parentGuid, 6373 rootGroupGuid: _this21.rootGroupGuid, 6374 includedGroupTypeGuids: _this21.includedGroupTypeGuids, 6375 includeInactiveGroups: _this21.includeInactiveGroups, 6376 limitToSchedulingEnabled: _this21.limitToSchedulingEnabled, 6377 limitToRSVPEnabled: _this21.limitToRSVPEnabled, 6378 securityGrantToken: _this21.securityGrantToken 6379 }; 6380 var url = "/api/v2/Controls/GroupPickerGetChildren"; 6381 var response = yield post(url, undefined, options); 6382 if (response.isSuccess && response.data) { 6383 return response.data; 6384 } else { 6385 console.log("Error", response.errorMessage); 6386 return []; 6387 } 6388 })(); 6389 } 6390 getRootItems() { 6391 var _this22 = this; 6392 return _asyncToGenerator(function* () { 6393 return yield _this22.getItems(null); 6394 })(); 6395 } 6396 getChildItems(item) { 6397 var _this23 = this; 6398 return _asyncToGenerator(function* () { 6399 return _this23.getItems(item.value); 6400 })(); 6401 } 6402 } 6403 class MergeTemplateTreeItemProvider { 6404 constructor() { 6405 _defineProperty(this, "securityGrantToken", null); 6406 _defineProperty(this, "mergeTemplateOwnership", MergeTemplateOwnership.Global); 6407 } 6408 getItems() { 6409 var _arguments2 = arguments, 6410 _this24 = this; 6411 return _asyncToGenerator(function* () { 6412 var _toNumberOrNull; 6413 var parentGuid = _arguments2.length > 0 && _arguments2[0] !== undefined ? _arguments2[0] : null; 6414 var options = { 6415 parentGuid, 6416 mergeTemplateOwnership: (_toNumberOrNull = toNumberOrNull(_this24.mergeTemplateOwnership)) !== null && _toNumberOrNull !== void 0 ? _toNumberOrNull : 0, 6417 securityGrantToken: _this24.securityGrantToken 6418 }; 6419 var url = "/api/v2/Controls/MergeTemplatePickerGetMergeTemplates"; 6420 var response = yield post(url, undefined, options); 6421 if (response.isSuccess && response.data) { 6422 return response.data; 6423 } else { 6424 console.log("Error", response.errorMessage); 6425 return []; 6426 } 6427 })(); 6428 } 6429 getRootItems() { 6430 var _this25 = this; 6431 return _asyncToGenerator(function* () { 6432 return yield _this25.getItems(null); 6433 })(); 6434 } 6435 getChildItems(item) { 6436 var _this26 = this; 6437 return _asyncToGenerator(function* () { 6438 return _this26.getItems(item.value); 6439 })(); 6440 } 6441 } 6442 class MetricCategoryTreeItemProvider { 6443 constructor() { 6444 _defineProperty(this, "securityGrantToken", null); 6445 } 6446 getItems() { 6447 var _arguments3 = arguments, 6448 _this27 = this; 6449 return _asyncToGenerator(function* () { 6450 var parentGuid = _arguments3.length > 0 && _arguments3[0] !== undefined ? _arguments3[0] : null; 6451 var options = { 6452 parentGuid, 6453 securityGrantToken: _this27.securityGrantToken 6454 }; 6455 var url = "/api/v2/Controls/MetricCategoryPickerGetChildren"; 6456 var response = yield post(url, undefined, options); 6457 if (response.isSuccess && response.data) { 6458 return response.data; 6459 } else { 6460 console.log("Error", response.errorMessage); 6461 return []; 6462 } 6463 })(); 6464 } 6465 getRootItems() { 6466 var _this28 = this; 6467 return _asyncToGenerator(function* () { 6468 return yield _this28.getItems(null); 6469 })(); 6470 } 6471 getChildItems(item) { 6472 var _this29 = this; 6473 return _asyncToGenerator(function* () { 6474 return _this29.getItems(item.value); 6475 })(); 6476 } 6477 } 6478 class MetricItemTreeItemProvider { 6479 constructor() { 6480 _defineProperty(this, "securityGrantToken", null); 6481 _defineProperty(this, "includeCategoryGuids", null); 6482 } 6483 getItems() { 6484 var _arguments4 = arguments, 6485 _this30 = this; 6486 return _asyncToGenerator(function* () { 6487 var parentGuid = _arguments4.length > 0 && _arguments4[0] !== undefined ? _arguments4[0] : null; 6488 var options = { 6489 parentGuid, 6490 includeCategoryGuids: _this30.includeCategoryGuids, 6491 securityGrantToken: _this30.securityGrantToken 6492 }; 6493 var url = "/api/v2/Controls/MetricItemPickerGetChildren"; 6494 var response = yield post(url, undefined, options); 6495 if (response.isSuccess && response.data) { 6496 return response.data; 6497 } else { 6498 console.log("Error", response.errorMessage); 6499 return []; 6500 } 6501 })(); 6502 } 6503 getRootItems() { 6504 var _this31 = this; 6505 return _asyncToGenerator(function* () { 6506 return yield _this31.getItems(null); 6507 })(); 6508 } 6509 getChildItems(item) { 6510 var _this32 = this; 6511 return _asyncToGenerator(function* () { 6512 return _this32.getItems(item.value); 6513 })(); 6514 } 6515 } 6516 class RegistrationTemplateTreeItemProvider { 6517 constructor() { 6518 _defineProperty(this, "securityGrantToken", null); 6519 } 6520 getItems() { 6521 var _arguments5 = arguments, 6522 _this33 = this; 6523 return _asyncToGenerator(function* () { 6524 var parentGuid = _arguments5.length > 0 && _arguments5[0] !== undefined ? _arguments5[0] : null; 6525 var options = { 6526 parentGuid, 6527 securityGrantToken: _this33.securityGrantToken 6528 }; 6529 var url = "/api/v2/Controls/RegistrationTemplatePickerGetChildren"; 6530 var response = yield post(url, undefined, options); 6531 if (response.isSuccess && response.data) { 6532 return response.data; 6533 } else { 6534 console.log("Error", response.errorMessage); 6535 return []; 6536 } 6537 })(); 6538 } 6539 getRootItems() { 6540 var _this34 = this; 6541 return _asyncToGenerator(function* () { 6542 return yield _this34.getItems(null); 6543 })(); 6544 } 6545 getChildItems(item) { 6546 var _this35 = this; 6547 return _asyncToGenerator(function* () { 6548 return _this35.getItems(item.value); 6549 })(); 6550 } 6551 } 6552 class ReportTreeItemProvider { 6553 constructor() { 6554 _defineProperty(this, "securityGrantToken", null); 6555 _defineProperty(this, "includeCategoryGuids", null); 6556 _defineProperty(this, "entityTypeGuid", null); 6557 } 6558 getItems() { 6559 var _arguments6 = arguments, 6560 _this36 = this; 6561 return _asyncToGenerator(function* () { 6562 var parentGuid = _arguments6.length > 0 && _arguments6[0] !== undefined ? _arguments6[0] : null; 6563 var options = { 6564 parentGuid, 6565 includeCategoryGuids: _this36.includeCategoryGuids, 6566 entityTypeGuid: _this36.entityTypeGuid, 6567 securityGrantToken: _this36.securityGrantToken 6568 }; 6569 var url = "/api/v2/Controls/ReportPickerGetChildren"; 6570 var response = yield post(url, undefined, options); 6571 if (response.isSuccess && response.data) { 6572 return response.data; 6573 } else { 6574 console.log("Error", response.errorMessage); 6575 return []; 6576 } 6577 })(); 6578 } 6579 getRootItems() { 6580 var _this37 = this; 6581 return _asyncToGenerator(function* () { 6582 return yield _this37.getItems(null); 6583 })(); 6584 } 6585 getChildItems(item) { 6586 var _this38 = this; 6587 return _asyncToGenerator(function* () { 6588 return _this38.getItems(item.value); 6589 })(); 6590 } 6591 } 6592 class ScheduleTreeItemProvider { 6593 constructor() { 6594 _defineProperty(this, "securityGrantToken", null); 6595 _defineProperty(this, "includeInactive", false); 6596 _defineProperty(this, "includePublicOnly", false); 6597 } 6598 getItems() { 6599 var _arguments7 = arguments, 6600 _this39 = this; 6601 return _asyncToGenerator(function* () { 6602 var parentGuid = _arguments7.length > 0 && _arguments7[0] !== undefined ? _arguments7[0] : null; 6603 var options = { 6604 parentGuid, 6605 includeInactiveItems: _this39.includeInactive, 6606 includePublicItemsOnly: _this39.includePublicOnly, 6607 securityGrantToken: _this39.securityGrantToken 6608 }; 6609 var url = "/api/v2/Controls/SchedulePickerGetChildren"; 6610 var response = yield post(url, undefined, options); 6611 if (response.isSuccess && response.data) { 6612 return response.data; 6613 } else { 6614 console.log("Error", response.errorMessage); 6615 return []; 6616 } 6617 })(); 6618 } 6619 getRootItems() { 6620 var _this40 = this; 6621 return _asyncToGenerator(function* () { 6622 return yield _this40.getItems(null); 6623 })(); 6624 } 6625 getChildItems(item) { 6626 var _this41 = this; 6627 return _asyncToGenerator(function* () { 6628 return _this41.getItems(item.value); 6629 })(); 6630 } 6631 } 6632 class WorkflowActionTypeTreeItemProvider { 6633 constructor() { 6634 _defineProperty(this, "securityGrantToken", null); 6635 _defineProperty(this, "includeInactive", false); 6636 } 6637 getItems() { 6638 var _arguments8 = arguments, 6639 _this42 = this; 6640 return _asyncToGenerator(function* () { 6641 var _toNumberOrNull2; 6642 var parentId = _arguments8.length > 0 && _arguments8[0] !== undefined ? _arguments8[0] : null; 6643 var options = { 6644 parentId: (_toNumberOrNull2 = toNumberOrNull(parentId)) !== null && _toNumberOrNull2 !== void 0 ? _toNumberOrNull2 : 0, 6645 securityGrantToken: _this42.securityGrantToken 6646 }; 6647 var url = "/api/v2/Controls/WorkflowActionTypePickerGetChildren"; 6648 var response = yield post(url, undefined, options); 6649 if (response.isSuccess && response.data) { 6650 return response.data; 6651 } else { 6652 console.log("Error", response.errorMessage); 6653 return []; 6654 } 6655 })(); 6656 } 6657 getRootItems() { 6658 var _this43 = this; 6659 return _asyncToGenerator(function* () { 6660 return yield _this43.getItems(null); 6661 })(); 6662 } 6663 getChildItems(item) { 6664 var _this44 = this; 6665 return _asyncToGenerator(function* () { 6666 return _this44.getItems(item.value); 6667 })(); 6668 } 6669 } 6670 class MergeFieldTreeItemProvider { 6671 constructor() { 6672 _defineProperty(this, "additionalFields", ""); 6673 } 6674 getItems(parentId) { 6675 var _this45 = this; 6676 return _asyncToGenerator(function* () { 6677 var result; 6678 var options = { 6679 id: parentId || "0", 6680 additionalFields: _this45.additionalFields 6681 }; 6682 var url = "/api/v2/Controls/MergeFieldPickerGetChildren"; 6683 var response = yield post(url, undefined, options); 6684 if (response.isSuccess && response.data) { 6685 result = response.data; 6686 } else { 6687 console.log("Error", response.errorMessage); 6688 return []; 6689 } 6690 if (parentId || !_this45.selectedIds || _this45.selectedIds.length == 0) { 6691 return result; 6692 } 6693 return _this45.getHierarchyToSelectedMergeField(result); 6694 })(); 6695 } 6696 getHierarchyToSelectedMergeField(rootLayer) { 6697 var _this46 = this; 6698 return _asyncToGenerator(function* () { 6699 var parents = _this46.getParentList(); 6700 if (!parents || parents.length == 0) { 6701 return rootLayer; 6702 } 6703 var childLists = yield Promise.all(parents.map(id =>
6703 _this46.getItems(id))); 6704 var allMergeFields = rootLayer.concat(flatten(childLists)); 6705 parents.forEach((parentGuid, i) => { 6706 var parentMergeField = allMergeFields.find(page => page.value == parentGuid); 6707 if (parentMergeField) { 6708 parentMergeField.children = childLists[i]; 6709 } 6710 }); 6711 return rootLayer; 6712 })(); 6713 } 6714 getParentList() { 6715 if (!this.selectedIds || this.selectedIds.length == 0) { 6716 return null; 6717 } 6718 if (typeof this.selectedIds == "string") { 6719 return this.splitSelectionIntoParents(this.selectedIds); 6720 } 6721 return flatten(this.selectedIds.map(sel => this.splitSelectionIntoParents(sel))); 6722 } 6723 splitSelectionIntoParents(selection) { 6724 var parentIds = []; 6725 var splitList = selection.split("|"); 6726 splitList.pop(); 6727 while (splitList.length >= 1) { 6728 parentIds.unshift(splitList.join("|")); 6729 splitList.pop(); 6730 } 6731 return parentIds; 6732 } 6733 getRootItems() { 6734 var _this47 = this; 6735 return _asyncToGenerator(function* () { 6736 return yield _this47.getItems(); 6737 })(); 6738 } 6739 getChildItems(item) { 6740 var _this48 = this; 6741 return _asyncToGenerator(function* () { 6742 return _this48.getItems(item.value); 6743 })(); 6744 } 6745 } 6746 class AssetManagerTreeItemProvider { 6747 constructor() { 6748 _defineProperty(this, "openFolders", new Set()); 6749 _defineProperty(this, "selectedFolder", ""); 6750 _defineProperty(this, "enableAssetManager", false); 6751 _defineProperty(this, "enableFileManager", false); 6752 _defineProperty(this, "encryptedRootFolder", ""); 6753 _defineProperty(this, "securityGrantToken", ""); 6754 _defineProperty(this, "userSpecificRoot", false); 6755 } 6756 getRootItems() { 6757 var _this49 = this; 6758 return _asyncToGenerator(function* () { 6759 var options = { 6760 expandedFolders: _this49.openFolders.size > 0 ? Array.from(_this49.openFolders) : null, 6761 selectedFolder: _this49.selectedFolder, 6762 enableAssetManager: _this49.enableAssetManager, 6763 enableFileManager: _this49.enableFileManager, 6764 rootFolder: _this49.encryptedRootFolder, 6765 securityGrantToken: _this49.securityGrantToken, 6766 userSpecificRoot: _this49.userSpecificRoot 6767 }; 6768 var url = "/api/v2/Controls/AssetManagerGetRootFolders"; 6769 var response = yield post(url, undefined, options); 6770 if (response.isSuccess && response.data) { 6771 _this49.openFolders = new Set(response.data.updatedExpandedFolders); 6772 return response.data.tree; 6773 } else { 6774 console.error("Error Fetching Root Asset Manager Items", response.errorMessage); 6775 return []; 6776 } 6777 })(); 6778 } 6779 getChildItems(item) { 6780 var _this50 = this; 6781 return _asyncToGenerator(function* () { 6782 var options = { 6783 assetFolderId: item.value, 6784 securityGrantToken: _this50.securityGrantToken 6785 }; 6786 var url = "/api/v2/Controls/AssetManagerGetChildren"; 6787 var response = yield post(url, undefined, options); 6788 if (response.isSuccess && response.data) { 6789 return response.data; 6790 } else { 6791 console.error("Error Fetching Asset Manager Children", response.errorMessage); 6792 return []; 6793 } 6794 })(); 6795 } 6796 } 6797 class AdaptiveMessageTreeItemProvider { 6798 getItems(parentGuid) { 6799 var _this51 = this; 6800 return _asyncToGenerator(function* () { 6801 var options = { 6802 parentValue: parentGuid, 6803 securityGrantToken: _this51.securityGrantToken 6804 }; 6805 var response = yield post("/api/v2/Controls/AdaptiveMessagePickerGetAdaptiveMessages", {}, options); 6806 if (response.isSuccess && response.data) { 6807 return response.data; 6808 } else { 6809 console.log("Error", response.errorMessage); 6810 return []; 6811 } 6812 })(); 6813 } 6814 getRootItems() { 6815 var _this52 = this; 6816 return _asyncToGenerator(function* () { 6817 return yield _this52.getItems(); 6818 })(); 6819 } 6820 getChildItems(item) { 6821 var _this53 = this; 6822 return _asyncToGenerator(function* () { 6823 return _this53.getItems(item.value); 6824 })(); 6825 } 6826 } 6827 6828 var treeItemProviders = /*#__PURE__*/Object.freeze({ 6829 __proto__: null, 6830 AdaptiveMessageTreeItemProvider: AdaptiveMessageTreeItemProvider, 6831 AssetManagerTreeItemProvider: AssetManagerTreeItemProvider, 6832 CategoryTreeItemProvider: CategoryTreeItemProvider, 6833 ConnectionRequestTreeItemProvider: ConnectionRequestTreeItemProvider, 6834 DataViewTreeItemProvider: DataViewTreeItemProvider, 6835 GroupTreeItemProvider: GroupTreeItemProvider, 6836 LocationTreeItemProvider: LocationTreeItemProvider, 6837 MergeFieldTreeItemProvider: MergeFieldTreeItemProvider, 6838 MergeTemplateTreeItemProvider: MergeTemplateTreeItemProvider, 6839 MetricCategoryTreeItemProvider: MetricCategoryTreeItemProvider, 6840 MetricItemTreeItemProvider: MetricItemTreeItemProvider, 6841 PageTreeItemProvider: PageTreeItemProvider, 6842 RegistrationTemplateTreeItemProvider: RegistrationTemplateTreeItemProvider, 6843 ReportTreeItemProvider: ReportTreeItemProvider, 6844 ScheduleTreeItemProvider: ScheduleTreeItemProvider, 6845 WorkflowActionTypeTreeItemProvider: WorkflowActionTypeTreeItemProvider, 6846 WorkflowTypeTreeItemProvider: WorkflowTypeTreeItemProvider 6847 }); 6848 exports('treeItemProviders', treeItemProviders); 6849 6850 function isUrl(val) { 6851 if (typeof val === "string") { 6852 var re = /^(http[s]?:\/\/)?[^\s(["<,>]*\.?[^\s[",><]*$/; 6853 return re.test(val); 6854 } 6855 return false;
6856 } 6857 function makeUrlRedirectSafe(url) { 6858 try { 6859 var u = new URL(url); 6860 if (u.protocol !== "http:" && u.protocol !== "https:") { 6861 return "/"; 6862 } 6863 return makeUrlRedirectSafe("".concat(u.pathname).concat(u.search)); 6864 } catch (_unused) { 6865 if (url.indexOf(":") !== -1) { 6866 return "/"; 6867 } 6868 return url; 6869 } 6870 } 6871 function syncRefsWithQueryParams(refs) { 6872 var params = new URLSearchParams(window.location.search); 6873 Object.entries(refs).forEach(_ref => { 6874 var _ref2 = _slicedToArray(_ref, 2), 6875 key = _ref2[0], 6876 ref = _ref2[1]; 6877 var param = null; 6878 try { 6879 var _params$get; 6880 param = JSON.parse(decodeURI((_params$get = params.get(key)) !== null && _params$get !== void 0 ? _params$get : "")); 6881 } catch (e) {} 6882 if (param != null) { 6883 ref.value = param; 6884 } 6885 watch(ref, updater(key)); 6886 }); 6887 function updater(key) { 6888 return value => { 6889 params.set(key, encodeURI(JSON.stringify(value))); 6890 history.replaceState(null, "", "?" + params.toString()); 6891 }; 6892 } 6893 } 6894 function removeCurrentUrlQueryParams() { 6895 for (var _len = arguments.length, queryParamKeys = new Array(_len), _key = 0; _key < _len; _key++) { 6896 queryParamKeys[_key] = arguments[_key]; 6897 } 6898 return removeUrlQueryParams(window.location.href, ...queryParamKeys); 6899 } 6900 function removeUrlQueryParams(url) { 6901 for (var _len2 = arguments.length, queryParamKeys = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { 6902 queryParamKeys[_key2 - 1] = arguments[_key2]; 6903 } 6904 if (!queryParamKeys || !queryParamKeys.length) { 6905 return []; 6906 } 6907 if (typeof url === "string") { 6908 url = new URL(url); 6909 } 6910 var queryParams = url.searchParams; 6911 var removedQueryParams = []; 6912 for (var i = 0; i < queryParamKeys.length; i++) { 6913 var queryParamKey = queryParamKeys[i]; 6914 removedQueryParams.push(queryParams.get(queryParamKey)); 6915 queryParams.delete(queryParamKey); 6916 } 6917 window.history.replaceState(null, "", url); 6918 return removedQueryParams; 6919 } 6920 6921 var url = /*#__PURE__*/Object.freeze({ 6922 __proto__: null, 6923 isUrl: isUrl, 6924 makeUrlRedirectSafe: makeUrlRedirectSafe, 6925 removeCurrentUrlQueryParams: removeCurrentUrlQueryParams, 6926 removeUrlQueryParams: removeUrlQueryParams, 6927 syncRefsWithQueryParams: syncRefsWithQueryParams 6928 }); 6929 exports('url', url); 6930 6931 var definedRules = {}; 6932 var rulesPropType = { 6933 type: [Array, Object, String], 6934 default: "" 6935 }; 6936 function parseRule(rule) { 6937 var name = ""; 6938 var params = []; 6939 var colonIndex = rule.indexOf(":"); 6940 if (colonIndex === -1) { 6941 name = rule; 6942 } else { 6943 name = rule.substring(0, colonIndex); 6944 params = rule.substring(colonIndex + 1).split(","); 6945 } 6946 return { 6947 name, 6948 params 6949 }; 6950 } 6951 function normalizeRules(rules) { 6952 if (typeof rules === "string") { 6953 if (rules.indexOf("|") !== -1) { 6954 return rules.split("|").filter(r => r.trim() !== ""); 6955 } else if (rules.trim() !== "") { 6956 return [rules.trim()]; 6957 } 6958 } else if (Array.isArray(rules)) { 6959 var normalizedRules = []; 6960 var _iterator = _createForOfIteratorHelper(rules), 6961 _step; 6962 try { 6963 for (_iterator.s(); !(_step = _iterator.n()).done;) { 6964 var r = _step.value; 6965 normalizedRules.push(...normalizeRules(r)); 6966 } 6967 } catch (err) { 6968 _iterator.e(err); 6969 } finally { 6970 _iterator.f(); 6971 } 6972 return normalizedRules; 6973 } else if (typeof rules === "function") { 6974 return [rules]; 6975 } else if (typeof rules === "object") { 6976 return [rules]; 6977 } 6978 return []; 6979 } 6980 function containsRequiredRule(rules) { 6981 return normalizeRules(rules).some(r => r === "required"); 6982 } 6983 function normalizeRulesToFunctions(rules) { 6984 var ruleFunctions = []; 6985 var _iterator2 = _createForOfIteratorHelper(rules), 6986 _step2; 6987 try { 6988 var _loop = function _loop() { 6989 var rule = _step2.value; 6990 if (typeof rule === "string") { 6991 var ruleRef = parseRule(rule); 6992 var fn = definedRules[ruleRef.name]; 6993 if (fn) { 6994 ruleFunctions.push(value => fn(value, ruleRef.params)); 6995 } else { 6996 console.warn("Attempt to validate with unknown rule ".concat(rule, ".")); 6997 } 6998 } else if (typeof rule === "function") { 6999 ruleFunctions.push(rule); 7000 } else if (typeof rule === "object") { 7001 var _fn = definedRules[rule.name]; 7002 if (_fn) { 7003 ruleFunctions.push(value => _fn(value, rule.params)); 7004 } else { 7005 console.warn("Attempt to validate with unknown rule ".concat(rule.name, ".")); 7006 } 7007 } 7008 }; 7009 for (_iterator2.s();
7009 !(_step2 = _iterator2.n()).done;) { 7010 _loop(); 7011 } 7012 } catch (err) { 7013 _iterator2.e(err); 7014 } finally { 7015 _iterator2.f(); 7016 } 7017 return ruleFunctions; 7018 } 7019 function normalizeRuleResult(result) { 7020 if (typeof result === "string") { 7021 return result; 7022 } else if (result === true) { 7023 return ""; 7024 } else { 7025 return "failed validation"; 7026 } 7027 } 7028 function validateValue(value, rule) { 7029 var fns = normalizeRulesToFunctions(normalizeRules(rule)); 7030 var results = []; 7031 var _iterator3 = _createForOfIteratorHelper(fns), 7032 _step3; 7033 try { 7034 for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { 7035 var fn = _step3.value; 7036 var result = normalizeRuleResult(fn(value)); 7037 if (result !== "") { 7038 results.push(result); 7039 } 7040 } 7041 } catch (err) { 7042 _iterator3.e(err); 7043 } finally { 7044 _iterator3.f(); 7045 } 7046 return results; 7047 } 7048 function defineRule(ruleName, validator) { 7049 if (definedRules[ruleName] !== undefined) { 7050 console.warn("Attempt to redefine validation rule ".concat(ruleName, ".")); 7051 } else { 7052 definedRules[ruleName] = validator; 7053 } 7054 } 7055 7056 var validationRules = /*#__PURE__*/Object.freeze({ 7057 __proto__: null, 7058 containsRequiredRule: containsRequiredRule, 7059 defineRule: defineRule, 7060 normalizeRules: normalizeRules, 7061 parseRule: parseRule, 7062 rulesPropType: rulesPropType, 7063 validateValue: validateValue 7064 }); 7065 exports('validationRules', validationRules); 7066 7067 }) 7068 }; 7069})); 7070//# sourceMappingURL=Utility.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.