{"version":3,"sources":["app.utility.js","app.js","app.input.js","app.grids.js","app.fileUploaders.js","app.pagecontent.js","app.autocomplete.js","customValidators.js","app.ipaddress.js"],"names":["$","document","on","jQuery","expr","icontains","a","i","m","text","toUpperCase","indexOf","version","Page","constructor","applicationPath","app","util","console","groupCollapsed","this","appPath","id","el","components","componentActions","currentComponent","allComponents","storage","selectors","grandchildComponent","grandchildAction","datepicker","modals","confirmRemove","confirmRemoveOkButton","descriptiveError","descriptiveErrorMessage","loadError","removeConfirm","saveError","searchBar","initModals","initTooltips","initComponents","initBackToTopButton","groupEnd","log","page","not","each","initComponent","initPageAction","e","pc","subtype","group","closest","data","parent","undefined","obj","Component","init","push","findAllComponents","trigger","PageAction","type","event","proxy","triggerAction","key","target","is","preventDefault","action","successContent","foundation","handleRemoveOkButton","window","scroll","css","mainTop","offset","top","scrollTop","fadeIn","fadeOut","initToasts","toastr","options","closeButton","debug","newestOnTop","progressBar","positionClass","preventDuplicates","onclick","showDuration","hideDuration","timeOut","extendedTimeOut","showEasing","hideEasing","showMethod","hideMethod","showDescriptiveError","message","html","handleAjaxError","xmlHttpRequest","textStatus","error","status","location","replace","encodeURIComponent","pathname","readyState","responseText","findComponents","merge","getComponent","componentType","componentId","find","o","refreshTarget","alertContent","x","startViewMode","warningContent","forEach","item","found","Object","values","calloutContent","parentController","role","state","request","isCloning","controller","siblings","editComponent","viewComponent","buttons","cancel","clone","edit","remove","save","refresh","validationToken","controllerUrl","urls","base","view","noResultsElement","customRecordData","getCustomData","length","slideUp","bindViewMode","finishLoad","isInit","filterCriteria","startLoading","controllerId","newRecordData","abort","stringData","param","ajax","url","context","done","xhr","response","handleCFResponse","endLoading","success","bindByElement","triggerEvent","bindSubComponents","startRefreshMode","ev","startActionMode","actionURL","callerButton","actionCustomData","jsonObject","startCloneMode","startEditMode","val","addClass","bindEditMode","stopPropagation","off","cancelEditMode","saveEditMode","startRemove","removeComponent","removeClass","form","currentTarget","proceedWithSave","valid","componentTop","formData","getFormValues","method","parseInt","firstError","animate","waitForPendingRequests","bind","__RequestVerificationToken","index","slideDown","splice","isRebind","Foundation","reInit","isEditing","componentHtmlType","contentType","getResponseHeader","includes","parseJSON","componentHtml","toastMessages","toastMessage","toastType","toString","toLowerCase","title","refreshTargets","errorMessage","eventName","trace","hasClass","targetType","filterField","value","pageComponentActionAdd","pageComponentActionFilter","pageComponentActionFilterServer","pageComponentActionRefresh","pageComponentActionUpdateSetOptions","pageComponentActionUpdateSetValue","pageComponentActionUpdateSetVisibility","pageComponentActionUpdateId","pageComponentActionUpdateSubtype","pageComponentActionDownload","t","componentWrapper","newComponentSelector","wrapperType","count","append","after","next","before","prev","prepend","rows","show","field","split","hide","v","isPrintableCharacter","delay","timeout","clearTimeout","that","setTimeout","attr","name","appendTo","filters","pageNumber","targets","targetField","prop","i2","e2","getElementValue","showTarget","targetValue","setVisibility","displayName","toast","info","href","formdata","xhrFields","responseType","size","warning","filename","disposition","matches","exec","URL","createObjectURL","link","createElement","download","style","display","body","appendChild","click","removeChild","fail","jqXHR","errorThrown","always","clear","queue","token","customContent","format","content","fancyConsole","fn","isDebugMode","formats","arguments","arg","shift","join","warn","copyToClipboard","s","clipboardData","setData","queryCommandSupported","textarea","textContent","position","select","execCommand","ex","dateOrNull","d","Date","isNaN","valueType","NodeList","outerHTML","selectedIndex","unindexed_array","serializeArray","result","Array","isArray","getGuid","c","r","Math","random","getIndexByPropertyValue","array","property","some","getPageSize","w","width","getFormattedNumber","abs","parseFloat","toLocaleString","getAccountingNumber","minimumFractionDigits","maximumFractionDigits","getShortFriendlyNumber","numberFormats","toFixed","getFriendlyNumber","isJsonString","parsed","JSON","parse","isPageSmall","isPageMedium","isPageLarge","isPageExtraLarge","left","right","mergeSort","arr","middle","slice","callback","removeData","validator","unobtrusive","checkCount","interval","setInterval","pendingRequest","clearInterval","input","Init","initInputComponents","component","initMasks","initTextEditor","initDatePicker","initSelectMany","initAutocomplete","initCheckboxLists","inputmask","prefix","groupSeparator","selectManyContext","listSelected","selectedCheckboxNames","fieldSet","map","innerText","get","selMany","search","selAll","selAllChecked","ind","filterTargetFieldset","allSelects","showThis","curCheckbox","selectedOption","filteredField","filteredFieldValue","fdatepicker","endDateElement","date","valueOf","getTime","newDate","setDate","getDate","focus","onRender","startDate","element","tinymce","tinyMCE","baseURL","relative_urls","remove_script_host","selector","block_formats","plugins","mode","branding","menubar","toolbar","init_instance_callback","editor","triggerSave","settings","ignore","AutoComplete","Autocomplete","BindSetButtons","change","checked","grids","myGrids","initGridComponents","initPageGridActions","initGridComponent","initPageGridAction","gridComponents","gridElement","unique","grid","sortGrid","changeAllDropdown","changeAllTextbox","checkAll","keypress","code","pageGrid","gridComponent","table","filterForm","pageSize","showForResults","gridType","filterGrid","alert","sortDescending","removeAttr","reverse","row","children","keyCode","refreshGrid","otherData","pageNum","concat","forResults","eval","report","pageAction","theTarget","fileUploaders","myUploaders","initFileUploadComponents","fileUploadElement","initFileUploadComponent","multiUpload","allowedExtensions","allowedExtensionArray","sizeLimit","uploader","qq","FineUploader","multiple","endpoint","deleteFile","enabled","callbacks","onStatusChange","oldStatus","newStatus","targetIdBase","_options","fileSet","UpdateFile","RemoveFile","getUuid","getSize","getName","thumbnails","placeholders","notAvailablePath","waitingPath","validation","template","addInitialFiles","uuid","thumbnailUrl","file","fileElement","newTemplate","idVal","ready","pagecontent","BindContentEditor","mnemonic","isTooltip","AutocompleteObjects","searchIndex","IsAutoComplete","myAutocomplete","defineProperties","activeItem","resultList","resultItems","searchText","searchBox","generateId","cacheResults","endPoint","initialSelected","initialText","onSelect","selectedItem","outputField","placeholder","searchMinLength","replaceVal","filterType","label","propertyName","multiSelect","multiSelectDelimiter","extend","additionaldataselector","selected","outputText","displayText","cache","prototype","container","resultsBox","announcement","onFocus","onBlur","onKeyPress","onInput","selectItem","mousemove","mouseleave","jsonResult","autoComplete","setValue","DisplayText","OutputText","populateTemplate","emptyResultList","keyID","hideResultList","navigateUp","navigateDown","resetSearchList","populateList","clientSideDataOptions","getClientSideResults","filterClientSideResults","delayTimer","getResults","customData","dataType","filteredData","cleanSearch","trim","keys","results","populatedTemplate","stringify","showResultList","personOption","re","RegExp","cleanupRe","itemData","UpdateSelectedValues","objects","newItem","identifier","removeButton","hiddenValueWrapper","class","itemDataField","updateFunction","call","clearSelectItem","empty","newActiveIndex","eq","scrollIntoView","block","inline","first","addMethod","params","adapters","add","rules","messages","parameters","targetvalue","control","methods","required","dependentproperty","ipaddress"],"mappings":"AAAAA,EAAAC,UAAAC,GAAA,sBACA,WAEAC,OAAAC,KAAA,KAAAC,UAAA,SAAAC,EAAAC,EAAAC,GACA,OAAAL,OAAAG,GAAAG,OAAAC,cACAC,QAAAH,EAAA,GAAAE,gBAAA,CACA,CACA,ICIA,IAAAE,QAAA,MAMA,MAAAC,KAOA,WAAAC,CAAAC,GACAC,IAAAC,KAAAC,QAAAC,eAAA,6CAMAC,KAAAC,QAAAN,GAAA,GAMAK,KAAAE,GAAA,EAMAF,KAAAG,GAAAvB,EAAAC,UAMAmB,KAAAI,WAAA,CAAA,EAMAJ,KAAAK,iBAAA,CAAA,EAMAL,KAAAM,iBAAA,CAAA,EAMAN,KAAAO,cAAA,CAAA,EAMAP,KAAAQ,QAAA,CAAA,EAMAR,KAAAS,UAAA,CACAL,WAAA,8FACAM,oBAAA,iJACAL,iBAAA,kCACAM,iBAAA,+JACAC,WAAA,4BACAC,OAAA,CACAC,cAAA,sBACAC,sBAAA,0BACAC,iBAAA,yBACAC,wBAAA,yCACAC,UAAA,kBACAC,cAAA,sBACAC,UAAA,mBAEAC,UAAA,qBAIArB,KAAAsB,aACAtB,KAAAuB,eACAvB,KAAAwB,iBACAxB,KAAAyB,sBAEA7B,IAAAC,KAAAC,QAAA4B,WACA9B,IAAAC,KAAAC,QAAA6B,IAAA,2BACA,CAQA,cAAAH,GACA,IAAAI,EAAA5B,KAEAJ,IAAAC,KAAAC,QAAAC,eAAA,2BAEAnB,EAAAoB,KAAAS,UAAAL,YAAAyB,IAAA7B,KAAAS,U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F,EAAAoB,MAAAyF,KAAA,eAAA7G,EAAA,6BAAA2D,SAAAkD,QACA7G,EAAA,4BAAAoB,MAAAyP,OACA7Q,EAAAoB,MAAAoQ,KAAA,WAAA,YACAxR,EAAAoB,MAAA8D,IAAA,mBAAA,SACAlF,EAAAoB,MAAA8D,IAAA,QAAA,UACA,GACA,EAGA","file":"../site.js","sourcesContent":["$(document).on('page-init-complete',\r\n function () {\r\n //Case insensitive contains\r\n jQuery.expr[':'].icontains = function (a, i, m) {\r\n return jQuery(a).text().toUpperCase()\r\n .indexOf(m[3].toUpperCase()) >= 0;\r\n };\r\n });","//*************************************************************************************\r\n//* WaMS Component Framework - app.js\r\n//* Version 1.07f\r\n//* Author: Damian Koch\r\n//* Component framework essentials, plus utilities.\r\n//* Requires jQuery, foundation\r\n//* 4/05/22 DBK: Squish comments, added util namespace & console helpers\r\n//* 4/18/22 DBK: Moved functionality to app.util namespace\r\n//*************************************************************************************\r\n\r\n//$(document).foundation();\r\nvar version = '1.1';\r\n\r\n/**\r\n* Represents a page in the application.\r\n* @class\r\n*/\r\nclass Page {\r\n\r\n /**\r\n * Creates an instance of Page.\r\n * @constructor\r\n * @param {string} [applicationPath=''] - The application path.\r\n */\r\n constructor(applicationPath) {\r\n app.util.console.groupCollapsed(\"Initializing Component Framework 1.07f...\");\r\n\r\n /**\r\n * The application path.\r\n * @type {string}\r\n */\r\n this.appPath = applicationPath || '';\r\n\r\n /**\r\n * The ID of the page.\r\n * @type {number}\r\n */\r\n this.id = 0;\r\n\r\n /**\r\n * The jQuery element representing the page.\r\n * @type {jQuery}\r\n */\r\n this.el = $(document);\r\n\r\n /**\r\n * An object containing all components on the page.\r\n * @type {Object.}\r\n */\r\n this.components = {};\r\n\r\n /**\r\n * An object containing all component actions on the page.\r\n * @type {Object.}\r\n */\r\n this.componentActions = {};\r\n\r\n /**\r\n * The currently active component.\r\n * @type {Component}\r\n */\r\n this.currentComponent = {};\r\n\r\n /**\r\n * An object containing all components, including grandchild components.\r\n * @type {Object.}\r\n */\r\n this.allComponents = {};\r\n\r\n /**\r\n * An object for storing data related to the page.\r\n * @type {Object}\r\n */\r\n this.storage = {};\r\n\r\n /**\r\n * URLs for component actions.\r\n * @type {Object.}\r\n */\r\n this.selectors = {\r\n components: ':not([data-role~=\"component-template\"]) [data-role~=\"component\"], >[data-role~=\"component\"]',\r\n grandchildComponent: ':not([data-role~=\"component-template\"]) [data-role~=\"component\"] [data-role~=\"component\"], > [data-role~=\"component\"] [data-role~=\"component\"]',\r\n componentActions: '[data-role~=\"component-action\"]',\r\n grandchildAction: ':not([data-role~=\"component-template\"]) [data-role~=\"component\"] [data-role~=\"component-action\"], > [data-role~=\"component\"] [data-role~=\"component-action\"]',\r\n datepicker: '[data-role~=\"datepicker\"]',\r\n modals: {\r\n confirmRemove: '#removeConfirmModal',\r\n confirmRemoveOkButton: '#removeConfirmModal--ok',\r\n descriptiveError: '#descriptiveErrorModal',\r\n descriptiveErrorMessage: '[data-role~=\"descriptiveErrorMessage\"]',\r\n loadError: '#loadErrorModal',\r\n removeConfirm: '#removeConfirmModal',\r\n saveError: '#saveErrorModal'\r\n },\r\n searchBar: '[name=searchForm]'\r\n };\r\n\r\n // Initialize checkbox lists, modals, tooltips, components, and back to top button.\r\n this.initModals();\r\n this.initTooltips();\r\n this.initComponents();\r\n this.initBackToTopButton();\r\n\r\n app.util.console.groupEnd();\r\n app.util.console.log('Initialization complete.');\r\n }\r\n\r\n\r\n\r\n /**\r\n * Initializes components on the page.\r\n * @private\r\n */\r\n initComponents() {\r\n var page = this;\r\n\r\n app.util.console.groupCollapsed('Initializing Components');\r\n\r\n $(this.selectors.components).not(this.selectors.grandchildComponent).each(function () {\r\n page.initComponent(this, page);\r\n });\r\n\r\n app.util.console.groupEnd();\r\n app.util.console.groupCollapsed('Initializing Component Actions');\r\n\r\n $(this.selectors.componentActions).not(this.selectors.grandchildAction).each(function () {\r\n page.initPageAction(this, page);\r\n });\r\n\r\n app.util.console.groupEnd();\r\n }\r\n\r\n /**\r\n * Initializes a component on the page.\r\n * @param {Element} e - The element representing the component.\r\n * @param {Page|Component} pc - The parent component or page.\r\n * @param {string} [subtype] - The subtype of the component.\r\n */\r\n initComponent(e, pc, subtype) {\r\n // Determine the type and group of the component\r\n var type = $(e).closest('[data-component-type]').data('component-type');\r\n var group = type + ($(e).closest('[data-component-group]').data('component-group') || \"\");\r\n var parent = pc || this;\r\n\r\n // If the component group doesn't exist yet, initialize it\r\n if (parent.components[group] === undefined) {\r\n parent.components[group] = [];\r\n parent.components[`${group}-noResults`] = $(`[data-component-role=\"noResults\"][data-component-type=${group}]`, parent.el);\r\n }\r\n\r\n // Create a new component object and initialize it\r\n var obj = new Component(e, pc, this, subtype);\r\n obj.init();\r\n\r\n // Add the component to the parent's components array\r\n parent.components[group].push(obj);\r\n\r\n // Find all components on the page\r\n this.findAllComponents();\r\n\r\n // Trigger an event signaling that component initialization is complete\r\n $(document).trigger(\"component-init-complete\", obj);\r\n }\r\n\r\n /**\r\n * Initializes a page action on the page.\r\n * @param {Element} e - The element representing the page action.\r\n * @param {Page|Component} pc - The parent component or page.\r\n */\r\n initPageAction(e, pc) {\r\n var parent = pc || this;\r\n var obj = new PageAction(e, pc, this);\r\n\r\n // If the action type doesn't exist yet, initialize it\r\n if (parent.componentActions[obj.type] === undefined) {\r\n parent.componentActions[obj.type] = [];\r\n }\r\n\r\n // Bind the action to its event\r\n $(e).on(obj.event, $.proxy(obj.triggerAction, obj));\r\n\r\n // Watch for Enter keypress on component action text boxes to prevent form submission\r\n $(e).on(\"keypress keydown\", function (e) {\r\n if (e.key === \"Enter\" && $(e.target).is(\"input[type='text']\")) {\r\n e.preventDefault();\r\n return false;\r\n }\r\n });\r\n\r\n // Add the action to the parent's component actions array\r\n parent.componentActions[obj.type].push(obj);\r\n\r\n // Trigger an event signaling that component action initialization is complete\r\n $(document).trigger(\"component-action-init-complete\", obj);\r\n\r\n // Log the action bound event\r\n app.util.console.log(obj.action, app.util.console.successContent(obj.target), '(' + obj.event + ')', 'action bound.');\r\n }\r\n\r\n /**\r\n * Initializes tooltips on the page using the Foundation framework.\r\n */\r\n initTooltips() {\r\n $(document).foundation();\r\n }\r\n\r\n /**\r\n * Initializes modal functionality, such as event handlers for modal buttons.\r\n */\r\n initModals() {\r\n // Bind click event handler for the \"Ok\" button in the confirm remove modal\r\n $(this.selectors.modals.confirmRemoveOkButton).on('click', $.proxy(this.handleRemoveOkButton, this));\r\n }\r\n /**\r\n * Handler function for the \"Ok\" button in the remove confirmation modal.\r\n */\r\n handleRemoveOkButton() {\r\n // Check if there is a current component and if it has a 'confirmRemove()' method\r\n if (this.currentComponent && typeof this.currentComponent.confirmRemove === 'function') {\r\n // Call the 'confirmRemove()' method of the current component\r\n this.currentComponent.confirmRemove();\r\n }\r\n }\r\n /**\r\n * Initializes functionality for the back-to-top button.\r\n * This function shows/hides the button based on the user's scroll position and handles its click event.\r\n */\r\n initBackToTopButton() {\r\n // Show/hide back-to-top button based on scroll position\r\n $(window).scroll(function () {\r\n // Check if back-to-top button is fixed\r\n if ($(\".back-to-top\").css('position') === 'fixed') {\r\n // Get the top position of the main content area\r\n var mainTop = $('main').offset().top;\r\n // Show button if user scrolls past the main content area\r\n if ($(this).scrollTop() > mainTop) {\r\n $('.back-to-top').fadeIn();\r\n } else {\r\n $('.back-to-top').fadeOut();\r\n }\r\n }\r\n });\r\n\r\n // Handle click event for back-to-top button\r\n $(document).on('click', '.back-to-top', function () {\r\n // Hide the back-to-top button when clicked\r\n $(this).fadeOut();\r\n });\r\n }\r\n\r\n /**\r\n * Initializes options for toast notifications using the Toastr library.\r\n * This function sets various options such as position, duration, animation effects, etc.\r\n */\r\n initToasts() {\r\n // Set options for toastr notifications\r\n window.toastr.options = {\r\n \"closeButton\": true,\r\n \"debug\": false,\r\n \"newestOnTop\": false,\r\n \"progressBar\": true,\r\n \"positionClass\": 'toast-top-right',\r\n \"preventDuplicates\": false,\r\n \"onclick\": null,\r\n \"showDuration\": '300',\r\n \"hideDuration\": '1000',\r\n \"timeOut\": '5000',\r\n \"extendedTimeOut\": '1000',\r\n \"showEasing\": 'swing',\r\n \"hideEasing\": 'linear',\r\n \"showMethod\": 'fadeIn',\r\n \"hideMethod\": 'fadeOut'\r\n };\r\n }\r\n\r\n /**\r\n * Displays a descriptive error message in a modal.\r\n * @param {string} message - The error message to display.\r\n */\r\n showDescriptiveError(message) {\r\n // Set the error message in the modal\r\n $(this.selectors.modals.descriptiveErrorMessage, this.selectors.modals.descriptiveError).html(message);\r\n // Open the descriptive error modal\r\n $(this.selectors.modals.descriptiveError).foundation('open');\r\n }\r\n\r\n /**\r\n * Handles AJAX errors that occur during requests.\r\n * @param {XMLHttpRequest} xmlHttpRequest - The XMLHttpRequest object representing the AJAX request.\r\n * @param {string} textStatus - The status of the error.\r\n * @param {string} error - The error message.\r\n */\r\n handleAjaxError(xmlHttpRequest, textStatus, error) {\r\n // Check if the error status is unauthorized or redirected to login\r\n if (xmlHttpRequest.status === 401 || xmlHttpRequest.status === 302) {\r\n // Redirect to the login page\r\n window.location.replace(this.appPath + '/Account/Login?ReturnUrl=' + encodeURIComponent(window.location.pathname));\r\n } else if (textStatus !== 'abort' && xmlHttpRequest.readyState !== 0) {\r\n // Log the error and handle it\r\n app.util.console.error(error);\r\n // Check if there is a response text\r\n if (xmlHttpRequest.responseText !== '') {\r\n // Show descriptive error message if available\r\n app.page.showDescriptiveError(xmlHttpRequest.responseText);\r\n } else {\r\n // Open the default load error modal\r\n $(this.selectors.modals.loadError).foundation('open');\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Finds all components on the page.\r\n * This function resets the 'allComponents' property and then calls 'findComponents()' with the 'components' property.\r\n */\r\n findAllComponents() {\r\n // Reset the 'allComponents' property to an empty object\r\n this.allComponents = {};\r\n // Find components starting from the 'components' property\r\n this.findComponents(this.components);\r\n }\r\n\r\n /**\r\n * Recursively finds all components within nested component groups.\r\n * @param {Object} components - The components to search through.\r\n */\r\n findComponents(components) {\r\n // Iterate over each group of components\r\n for (var group in components) {\r\n // If the group doesn't exist in 'allComponents', initialize it as an empty array\r\n if (this.allComponents[group] === undefined) {\r\n this.allComponents[group] = [];\r\n }\r\n // Merge the components from the current group into 'allComponents'\r\n $.merge(this.allComponents[group], components[group]);\r\n // Recursively call 'findComponents' for each component within the group\r\n for (var key in components[group]) {\r\n this.findComponents(components[group][key].components);\r\n }\r\n }\r\n }\r\n\r\n\r\n /**\r\n * Retrieves a component by its type and ID.\r\n * @param {string} componentType - The type of the component to retrieve.\r\n * @param {string} componentId - The ID of the component to retrieve.\r\n * @returns {Component|null} The found component, or null if not found.\r\n */\r\n getComponent(componentType, componentId) {\r\n // Check if the component type exists in 'allComponents'\r\n if (this.allComponents[componentType]) {\r\n // Find the component with the matching ID within the specified type\r\n return this.allComponents[componentType].find((o) => o.id === componentId) || null;\r\n }\r\n // Return null if the component type does not exist\r\n return null;\r\n }\r\n\r\n /**\r\n * Refreshes the view mode of the specified component(s) based on component type and/or ID.\r\n * \r\n * If a specific component type is provided:\r\n * - If a component ID is specified, it refreshes only that component of the given type.\r\n * - If no component ID is provided, it refreshes all components of that type.\r\n * \r\n * If no component type is specified but a component ID is provided:\r\n * - It searches across all component types and refreshes any components matching the given ID.\r\n * \r\n * Logs relevant messages to the console via the `app.util.console` utility functions.\r\n * \r\n * @param {string} [componentType] - The type of component to refresh (e.g., \"person\", \"vehicle\"). If omitted, all types will be considered.\r\n * @param {number} [componentId] - The ID of the component to refresh. If omitted, all components within the specified type will be refreshed.\r\n */\r\n\r\n refreshTarget(componentType, componentId) {\r\n // Refresh by component type\r\n if (componentType) {\r\n const components = app.page.allComponents[componentType];\r\n if (!components) {\r\n app.util.console.alertContent(`Refresh Target: Type '${componentType}' not found.`);\r\n return;\r\n }\r\n\r\n if (componentId) {\r\n // Refresh a specific component by ID\r\n const target = components.find(x => x.id == componentId);\r\n if (target && typeof target.startViewMode === 'function') {\r\n target.startViewMode();\r\n app.util.console.successContent(`Refresh Target: Component with ID ${componentId} in type '${componentType}' refreshed successfully.`);\r\n } else {\r\n app.util.console.warningContent(`Refresh Target: No component found with ID ${componentId} in type '${componentType}'.`);\r\n }\r\n } else {\r\n // Refresh all components of the specified type\r\n components.forEach(item => {\r\n if (typeof item.startViewMode === 'function') {\r\n item.startViewMode();\r\n }\r\n });\r\n app.util.console.successContent(`Refresh Target: All components of type '${componentType}' refreshed successfully.`);\r\n }\r\n } else if (componentId) {\r\n // No specific type specified; handle by component ID across all types\r\n let found = false;\r\n Object.values(app.page.allComponents).forEach(group => {\r\n group.forEach(item => {\r\n if (item.id == componentId && typeof item.startViewMode === 'function') {\r\n item.startViewMode();\r\n found = true;\r\n }\r\n });\r\n });\r\n\r\n if (!found) {\r\n app.util.console.alertContent(`Refresh Target: No component found with ID ${componentId} across all types.`);\r\n } else {\r\n app.util.console.successContent(`Refresh Target: Component with ID ${componentId} refreshed across all types.`);\r\n }\r\n } else {\r\n app.util.console.calloutContent('Refresh Target: Component type and/or ID must be specified.');\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Represents a component on the page.\r\n * @param {Element} e - The DOM element representing the component.\r\n * @param {Component|Page} pc - The parent component or page.\r\n * @param {Page} page - The page containing the component.\r\n * @param {string} [subtype] - The subtype of the component.\r\n */\r\nclass Component {\r\n /**\r\n * Creates an instance of Component.\r\n * @constructor\r\n * @param {Element} e - The DOM element representing the component.\r\n * @param {Component|Page} pc - The parent component or page.\r\n * @param {Page} page - The page containing the component.\r\n * @param {string} [subtype] - The subtype of the component.\r\n */\r\n constructor(e, pc, page, subtype) {\r\n /**\r\n * DOM element representing the component.\r\n * @member {jQuery}\r\n */\r\n this.el = $(e);\r\n\r\n /**\r\n * Parent controller (component or page).\r\n * @member {Component|Page}\r\n */\r\n this.parentController = pc || {};\r\n\r\n /**\r\n * The page containing the component.\r\n * @member {Page}\r\n */\r\n this.page = page || app.page;\r\n\r\n /**\r\n * Subtype of the component.\r\n * @member {string}\r\n */\r\n this.subtype = subtype;\r\n\r\n /**\r\n * ID of the component.\r\n * @member {number|string}\r\n */\r\n this.id = this.el.data('component-id') || 0;\r\n\r\n /**\r\n * Role of the component.\r\n * @member {string}\r\n */\r\n this.role = this.el.closest('[data-component-role]').data('component-role');\r\n\r\n /**\r\n * Type of the component.\r\n * @member {string}\r\n */\r\n this.type = this.el.closest('[data-component-type]').data('component-type');\r\n\r\n /**\r\n * Group of the component.\r\n * @member {string}\r\n */\r\n this.group = this.type + (this.el.closest('[data-component-group]').data('component-group') || \"\");\r\n\r\n /**\r\n * State of the component.\r\n * @member {string}\r\n */\r\n this.state = this.el.data('component-state');\r\n\r\n /**\r\n * XMLHttpRequest object for AJAX requests.\r\n * @member {XMLHttpRequest|null}\r\n */\r\n this.request = null;\r\n\r\n /**\r\n * Flag indicating whether the component is being cloned.\r\n * @member {boolean}\r\n */\r\n this.isCloning = false;\r\n\r\n /**\r\n * Controller associated with the component.\r\n * @member {string}\r\n */\r\n this.controller = this.el.closest('[data-component-controller]').data('component-controller');\r\n\r\n /**\r\n * Siblings of the component within the same group.\r\n * @member {Array.}\r\n */\r\n this.siblings = pc ? pc.components[this.group] || [] : [];\r\n\r\n /**\r\n * Selectors related to the component.\r\n * @member {Object}\r\n */\r\n this.selectors = {\r\n // Selectors for various component elements\r\n editComponent: `> .card > .component-edit > [data-component-role=\"EditComponent\"], \r\n > .card.component-edit > [data-component-role=\"EditComponent\"], \r\n > .component-edit[data-component-role=\"EditComponent\"]`,\r\n viewComponent: `> .card > .component-view > [data-component-role=\"ViewComponent\"], \r\n > .component-view[data-component-role=\"ViewComponent\"]`,\r\n buttons: {\r\n cancel: `> .card > .component-edit > .component-buttons [data-component-role=\"CancelButton\"], \r\n > .card.component-edit > .component-buttons [data-component-role=\"CancelButton\"],\r\n > .component-edit > .component-buttons > [data-component-role=\"CancelButton\"]`,\r\n clone: `> .card > .component-view > [data-component-role=\"CloneButton\"]`,\r\n edit: `> .card > .component-view > .component-buttons > [data-component-role=\"EditButton\"],\r\n > .component-view > .row > .component-buttons > [data-component-role=\"EditButton\"],\r\n > .card > .component-view > .card-body > .row > .component-buttons > [data-component-role=\"EditButton\"],\r\n > .component-view[data-component-role=\"ViewComponent\"] > div > [data-component-role=\"EditButton\"]`,\r\n action: `> .card > .component-view > .component-buttons > [data-component-role=\"ActionButton\"],\r\n > .component-view > .row > .component-buttons > [data-component-role=\"ActionButton\"],\r\n > .card > .component-view > .card-body > .row > .component-buttons > [data-component-role=\"ActionButton\"],\r\n > .card > .component-view > .card-body > .component-collapse > .component-collapse-panel > .row > .columns > .display-value > [data-component-role=\"ActionButton\"],\r\n > .component-view[data-component-role=\"ViewComponent\"] > div > [data-component-role=\"ActionButton\"]`,\r\n remove: `> .card > .component-edit > .component-buttons [data-component-role=\"RemoveButton\"], \r\n > .card.component-edit > .component-buttons [data-component-role=\"RemoveButton\"],\r\n > .component-edit > .component-buttons > [data-component-role=\"RemoveButton\"]`,\r\n save: `> .card > .component-edit > .component-buttons [data-component-role=\"SaveButton\"], \r\n > .card.component-edit > .component-buttons [data-component-role=\"SaveButton\"],\r\n > .component-edit > .component-buttons > [data-component-role=\"SaveButton\"]`,\r\n refresh: `> .card > .component-view > .component-buttons > [data-component-role=\"RefreshButton\"],\r\n > .component-view > .row > .component-buttons > [data-component-role=\"RefreshButton\"],\r\n > .card > .component-view > .card-body > .row > .component-buttons > [data-component-role=\"RefreshButton\"],\r\n > .card > .component-view > .card-body > .component-collapse > .component-collapse-panel > .row > .columns > .display-value > [data-component-role=\"RefreshButton\"],\r\n > .component-view[data-component-role=\"ViewComponent\"] > div > [data-component-role=\"RefreshButton\"]`,\r\n\r\n },\r\n // Selector for the anti-forgery token used in forms\r\n validationToken: 'input[name=\"__RequestVerificationToken\"]'\r\n };\r\n var controllerUrl = this.page.appPath + '/' + this.controller;\r\n /**\r\n * URLs for various actions related to the component.\r\n * @member {Object}\r\n */\r\n this.urls = {\r\n base: controllerUrl,\r\n view: controllerUrl + '/Show' + this.type,\r\n clone: controllerUrl + '/Show' + this.type + 'CloneForm',\r\n edit: controllerUrl + '/Show' + this.type + 'Form',\r\n save: controllerUrl + '/Update' + this.type,\r\n remove: controllerUrl + '/Remove' + this.type,\r\n action: controllerUrl + '/Action' + this.type,\r\n };\r\n\r\n /**\r\n * Sub-components associated with the component.\r\n * @member {Object.>}\r\n */\r\n this.components = {};\r\n\r\n /**\r\n * Component actions associated with the component.\r\n * @member {Object.>}\r\n */\r\n this.componentActions = {};\r\n\r\n /**\r\n * Element representing the \"no results\" message for the component.\r\n * @member {jQuery}\r\n */\r\n this.noResultsElement = (pc) ? pc.components[this.group + '-noResults'] || [] : [];\r\n\r\n /**\r\n * Views for the component in edit and view modes.\r\n * @member {string}\r\n */\r\n this.viewComponent = '';\r\n this.editComponent = '';\r\n\r\n /**\r\n * Custom data associated with the component.\r\n * @member {Object}\r\n */\r\n this.customRecordData = app.util.getCustomData(this.el);\r\n }\r\n\r\n\r\n /**\r\n * Initializes the component.\r\n * This method handles the initialization logic for the component,\r\n * including hiding the \"no results\" element if there are no siblings,\r\n * starting the view mode, or binding the view mode based on the component's state.\r\n */\r\n init() {\r\n /**\r\n * Hide the \"no results\" element if there are no siblings.\r\n * @example\r\n * // Hides the \"no results\" element if there are no siblings.\r\n * component.init();\r\n */\r\n if (this.siblings.length === 0 && this.noResultsElement !== undefined) {\r\n $(this.noResultsElement).slideUp();\r\n }\r\n\r\n /**\r\n * Start the view mode if the component's state is not 'active'.\r\n * Otherwise, bind the view mode and finish loading.\r\n */\r\n if (this.state !== 'active') {\r\n // Start the view mode with animation\r\n this.startViewMode(true);\r\n } else {\r\n // Bind the view mode and finish loading\r\n this.bindViewMode();\r\n this.finishLoad();\r\n }\r\n }\r\n\r\n /**\r\n * Starts the view mode of the component.\r\n * This method initiates the view mode of the component by loading data from the server,\r\n * applying filter criteria if provided, and handling the response.\r\n * @param {boolean} isInit - Indicates whether this is the initial initialization.\r\n * @param {Object} [filterCriteria] - Optional filter criteria to be applied when loading data.\r\n * @example\r\n * // Start the view mode with initial initialization.\r\n * component.startViewMode(true);\r\n * @example\r\n * // Start the view mode with filter criteria.\r\n * component.startViewMode(false, { filter: 'criteria' });\r\n */\r\n startViewMode(isInit, filterCriteria) {\r\n // Start loading animation\r\n this.startLoading();\r\n\r\n // Prepare data for AJAX request\r\n let data;\r\n if (filterCriteria) {\r\n data = filterCriteria;\r\n } else {\r\n data = { id: this.id, controllerId: this.parentController.id };\r\n }\r\n\r\n // Merge custom record data if available\r\n if (this.customRecordData) {\r\n data = { ...data, ...this.customRecordData };\r\n }\r\n\r\n // Merge new record data from the parent controller if available\r\n if (this.parentController.newRecordData) {\r\n data = { ...data, ...this.parentController.newRecordData };\r\n }\r\n\r\n // Abort previous request if exists\r\n if (this.request != null) {\r\n this.request.abort();\r\n this.request = null;\r\n }\r\n\r\n // Convert data to a query string\r\n const stringData = $.param(data, true);\r\n\r\n // Send AJAX request to retrieve component data\r\n this.request = $.ajax({\r\n url: this.urls.view,\r\n data: stringData,\r\n context: this,\r\n error: this.page.handleAjaxError\r\n })\r\n .done(function (data, status, xhr) {\r\n // Handle the response data\r\n const response = this.handleCFResponse(data, xhr, 'full');\r\n // End loading animation\r\n this.endLoading();\r\n // Bind view mode if the response is successful\r\n if (response.success) {\r\n this.bindViewMode();\r\n }\r\n // Finish the initial load if specified\r\n if (isInit) {\r\n this.finishLoad();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Binds the view mode of the component.\r\n * This method sets up the view mode of the component by selecting the edit and view elements,\r\n * binding events, triggering events, binding sub-components, and initializing Foundation if present.\r\n * @example\r\n * // Bind the view mode of the component.\r\n * component.bindViewMode();\r\n */\r\n bindViewMode() {\r\n // Select the edit and view elements within the component\r\n this.editComponent = $(this.selectors.editComponent, this.el);\r\n this.viewComponent = $(this.selectors.viewComponent, this.el);\r\n\r\n // Bind events to the component elements\r\n this.bindByElement(this.el, false);\r\n\r\n // Trigger a custom event indicating completion of view mode binding\r\n this.triggerEvent(\"component-bind-view-mode-complete\");\r\n\r\n // Bind sub-components within the view mode\r\n this.bindSubComponents();\r\n\r\n //TODO: THis should go in app.input with a trigger?\r\n // Initialize Foundation components within the view mode if present\r\n this.viewComponent.foundation();\r\n }\r\n\r\n /**\r\n * Initiates the refresh mode of the component.\r\n * This method starts the refresh mode of the component by invoking the startViewMode method.\r\n * @param {Event} ev - The event object associated with the trigger.\r\n * @example\r\n * // Start the refresh mode of the component.\r\n * component.startRefreshMode(event);\r\n */\r\n startRefreshMode(ev) {\r\n // Start the view mode to refresh the component\r\n this.startViewMode();\r\n }\r\n\r\n /**\r\n * Initiates the action mode of the component.\r\n * This method starts the action mode of the component by sending an AJAX request to the server,\r\n * executing the action specified by the caller button, and handling the response accordingly.\r\n * @param {Event} ev - The event object associated with the trigger.\r\n * @example\r\n * // Start the action mode of the component.\r\n * component.startActionMode(event);\r\n */\r\n startActionMode(ev) {\r\n // Start loading animation\r\n this.startLoading();\r\n\r\n // Prepare data for AJAX request\r\n let data = { id: this.id, controllerId: this.parentController.id, subtype: this.subtype };\r\n\r\n // Merge custom record data if available\r\n if (this.customRecordData) {\r\n data = { ...data, ...this.customRecordData };\r\n }\r\n\r\n // Merge new record data from the parent controller if available\r\n if (this.id === 0 && this.parentController.newRecordData) {\r\n data = { ...data, ...this.parentController.newRecordData };\r\n }\r\n\r\n // Determine the action URL based on the caller button\r\n let actionURL = this.urls.action;\r\n const callerButton = $(ev.target);\r\n if (callerButton.data('component-action')) {\r\n const controller = callerButton.closest('[data-component-controller]').data('component-controller');\r\n const action = callerButton.data('component-action');\r\n actionURL = `${this.page.appPath}/${controller}/${action}`;\r\n }\r\n\r\n // Retrieve custom data associated with the caller button\r\n const actionCustomData = app.util.getCustomData(callerButton);\r\n if (actionCustomData) {\r\n data = { ...data, ...actionCustomData };\r\n }\r\n\r\n // Send AJAX request to execute the action\r\n $.ajax({\r\n url: actionURL,\r\n data: data,\r\n context: this,\r\n error: this.page.handleAjaxError\r\n })\r\n .done(function (data, status, xhr) {\r\n // Handle the response data\r\n const jsonObject = this.handleCFResponse(data, xhr, 'full');\r\n // End loading animation\r\n this.endLoading();\r\n // Bind view mode if the response is successful\r\n if (jsonObject.success) {\r\n this.bindViewMode();\r\n // Trigger a custom event indicating completion of the action\r\n this.triggerEvent(\"component-action-complete\");\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Initiates the clone mode of the component.\r\n * This method sets the component's cloning flag to true and starts the edit mode.\r\n * @example\r\n * // Start the clone mode of the component.\r\n * component.startCloneMode();\r\n */\r\n startCloneMode() {\r\n // Set the component's cloning flag to true\r\n this.isCloning = true;\r\n // Start the edit mode\r\n this.startEditMode();\r\n }\r\n\r\n /**\r\n * Initiates the edit mode of the component.\r\n * This method starts the edit mode of the component by sending an AJAX request to the server,\r\n * retrieving the edit HTML, and binding the edit mode accordingly.\r\n */\r\n startEditMode() {\r\n // Start loading animation\r\n this.startLoading();\r\n\r\n // Prepare data for AJAX request\r\n let data = {\r\n id: this.id,\r\n controllerId: this.parentController.id,\r\n subtype: this.subtype\r\n };\r\n\r\n // Merge custom record data if available\r\n if (this.customRecordData) {\r\n data = { ...data, ...this.customRecordData };\r\n }\r\n\r\n // Merge new record data from the parent controller if available\r\n if (this.id === 0 && this.parentController.newRecordData) {\r\n data = { ...data, ...this.parentController.newRecordData };\r\n }\r\n\r\n // Send AJAX request to retrieve edit HTML\r\n $.ajax({\r\n url: this.urls.edit,\r\n data: data,\r\n context: this,\r\n error: this.page.handleAjaxError\r\n })\r\n .done(function (data, status, xhr) {\r\n // Handle the response data\r\n const jsonObject = this.handleCFResponse(data, xhr, 'edit');\r\n\r\n // Set ID field value to 0 if cloning\r\n if (this.isCloning) {\r\n $('[name=\"Id\"]', this.editComponent).val(0);\r\n }\r\n\r\n // Add 'edit' class to the component element\r\n this.el.addClass('edit');\r\n\r\n // End loading animation\r\n this.endLoading();\r\n\r\n // Bind the edit mode\r\n this.bindEditMode();\r\n });\r\n }\r\n\r\n /**\r\n * Binds the edit mode of the component.\r\n * This method sets up event listeners for the edit mode, such as handling key presses and button clicks,\r\n * and triggers a custom event indicating completion of edit mode binding.\r\n */\r\n bindEditMode() {\r\n // Handle key presses on a form\r\n $('form', this.editComponent).on('keydown', $.proxy(function (e) {\r\n switch (e.key) {\r\n case \"Enter\":\r\n // Stop default form submission on \"Enter\" key press in textbox\r\n if ($(e.target).is(\"input[type='text']\")) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n }\r\n break;\r\n case \"Escape\":\r\n e.preventDefault();\r\n e.stopPropagation();\r\n //this.cancelEditMode();\r\n break;\r\n }\r\n }, this));\r\n \r\n // Add event listeners for cancel, save, and remove buttons\r\n $(this.selectors.buttons.cancel, this.el).off('click').on('click', $.proxy(this.cancelEditMode, this));\r\n $(this.selectors.buttons.save, this.el).off('click').on('click', $.proxy(this.saveEditMode, this));\r\n $(this.selectors.buttons.remove, this.el).off('click').on('click', $.proxy(this.startRemove, this));\r\n\r\n // Trigger a custom event indicating completion of edit mode binding\r\n this.triggerEvent(\"component-bind-edit-mode-complete\");\r\n\r\n // Bind sub-components within the edit mode\r\n this.bindSubComponents();\r\n }\r\n\r\n /**\r\n * Cancels the edit mode of the component.\r\n * This method cancels the edit mode of the component by removing the 'edit' class from the component element\r\n * and triggering a custom event to indicate that the edit mode has been canceled.\r\n */\r\n cancelEditMode() {\r\n // Reset the cloning flag if applicable\r\n if (this.isCloning) {\r\n this.isCloning = false;\r\n }\r\n\r\n // If the component is a new record (ID === 0), remove it; otherwise, remove the 'edit' class\r\n if (this.id === 0) {\r\n this.removeComponent();\r\n } else {\r\n this.el.removeClass('edit');\r\n }\r\n\r\n // Trigger a custom event to indicate that the edit mode has been canceled\r\n this.triggerEvent(\"component-edit-cancel\");\r\n }\r\n\r\n /**\r\n * Saves the changes made in edit mode of the component.\r\n * This method validates the form, sends an AJAX request to save the changes,\r\n * and handles the response accordingly.\r\n * @param {Event} event - The event object associated with the trigger.\r\n */\r\n saveEditMode(event) {\r\n // Find the form element within the edit component\r\n let form = $('form:not(.component-exclude)', this.editComponent);\r\n if (!form || form.length !== 1) {\r\n app.util.console.log(\"child form not found.\");\r\n if (this.editComponent.is(\"form:not(.component-exclude)\")) {\r\n app.util.console.log(\"edit component is the form\");\r\n form = this.editComponent;\r\n }\r\n }\r\n\r\n // Get the caller button\r\n const callerButton = $(event.currentTarget);\r\n\r\n // Function to execute after pending requests are complete\r\n function proceedWithSave() {\r\n // Log whether the form is valid\r\n app.util.console.log(\"form valid?\", form.valid());\r\n if (form.valid() || callerButton.data('component-ignore-validation') == true) {\r\n // If the top of the component is off of the page, scroll to it\r\n const componentTop = this.editComponent.offset().top - 50;\r\n if ($(document).scrollTop() > componentTop) $('html, body').scrollTop(componentTop);\r\n\r\n // Start loading animation\r\n this.startLoading();\r\n\r\n // Get form data\r\n let formData = app.util.getFormValues(form);\r\n\r\n // Merge action custom data if available\r\n const actionCustomData = app.util.getCustomData(callerButton);\r\n if (actionCustomData) {\r\n formData = { ...formData, ...actionCustomData };\r\n }\r\n\r\n // Send AJAX request to save changes\r\n $.ajax({\r\n url: this.urls.save,\r\n method: 'post',\r\n data: formData,\r\n context: this,\r\n error: this.page.handleAjaxError\r\n })\r\n .done(function (data, status, xhr) {\r\n // End loading animation\r\n this.endLoading();\r\n\r\n // Handle the response data\r\n if (data) {\r\n const jsonObject = this.handleCFResponse(data, xhr, 'view');\r\n if (jsonObject.success) {\r\n // Update component ID if it's a new record or cloning\r\n if (this.id === 0 || this.isCloning) {\r\n this.id = parseInt($('[name=\"Id\"]', this.viewComponent).val());\r\n if (this.isCloning) {\r\n this.isCloning = false;\r\n }\r\n this.bindByElement(this.viewComponent, false);\r\n } else {\r\n this.bindByElement(this.viewComponent, true);\r\n }\r\n\r\n // Reinitialize Foundation for view component\r\n this.viewComponent.foundation();\r\n\r\n // Bind sub-components\r\n this.bindSubComponents();\r\n\r\n // Trigger a custom event indicating completion of save operation\r\n this.triggerEvent(\"component-save-complete\");\r\n\r\n // Cancel edit mode\r\n this.cancelEditMode();\r\n }\r\n } else {\r\n // Open save error modal if data is empty\r\n $(app.page.selectors.modals.saveError).foundation('open');\r\n }\r\n });\r\n } else {\r\n // Give focus to the first error\r\n const firstError = $('#' + $('.field-validation-error', form).data('valmsg-for'));\r\n if (firstError.length) {\r\n $('html, body').animate({\r\n scrollTop: firstError.offset().top - 50\r\n }, 500);\r\n }\r\n }\r\n }\r\n\r\n if (!callerButton.data('component-ignore-validation') == true) {\r\n // Wait for pending requests to complete before proceeding with save\r\n app.util.waitForPendingRequests(form, proceedWithSave.bind(this));\r\n } else {\r\n proceedWithSave.bind(this)();\r\n }\r\n\r\n }\r\n\r\n /**\r\n * Initiates the removal process of the component.\r\n * This method checks if the component is a new record or an existing record,\r\n * and either directly removes the component (if it's a new record) or opens a confirmation modal for removal.\r\n */\r\n startRemove() {\r\n // If the component is a new record, directly remove it\r\n if (this.id === 0) {\r\n this.removeComponent();\r\n } else {\r\n // If the removal URL is defined and not empty, open the confirmation modal\r\n if (this.urls.remove !== undefined && this.urls.remove !== '') {\r\n // Set the current component in the page context\r\n app.page.currentComponent = this;\r\n // Open the remove confirmation modal\r\n $(app.page.selectors.modals.removeConfirm).foundation('open');\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Confirms the removal of the component.\r\n * This method sends an AJAX request to the server to remove the component,\r\n * and handles the response accordingly.\r\n */\r\n confirmRemove() {\r\n // If the removal URL is defined and not empty, proceed with removal\r\n if (this.urls.remove !== undefined && this.urls.remove !== '') {\r\n // Remove 'edit' class from the component element\r\n this.el.removeClass('edit');\r\n // Start loading animation\r\n this.startLoading();\r\n\r\n // Prepare data for AJAX request\r\n let data = { id: this.id, controllerId: this.parentController.id, __RequestVerificationToken: $(this.selectors.validationToken, this.editComponent).val() };\r\n\r\n // Merge custom record data if available\r\n if (this.customRecordData) {\r\n data = { ...data, ...this.customRecordData };\r\n }\r\n\r\n // Send AJAX request to remove the component\r\n $.ajax({\r\n url: this.urls.remove,\r\n method: 'post',\r\n data: data,\r\n context: this,\r\n error: this.page.handleAjaxError\r\n })\r\n .done(function (data, status, xhr) {\r\n // Handle the response data\r\n if (data) {\r\n const jsonObject = this.handleCFResponse(data, xhr);\r\n if (jsonObject.success) {\r\n // Remove the component if removal is successful\r\n this.removeComponent();\r\n // Trigger a custom event indicating completion of removal\r\n this.triggerEvent(\"component-remove-complete\");\r\n } else {\r\n // Add 'edit' class back to the component element\r\n this.el.addClass('edit');\r\n // End loading animation\r\n this.endLoading();\r\n }\r\n } else {\r\n // Add 'edit' class back to the component element\r\n this.el.addClass('edit');\r\n // End loading animation\r\n this.endLoading();\r\n // Open save error modal if data is empty\r\n $('#saveErrorModal').foundation('open');\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Removes the component from its parent container.\r\n * This method removes the component from its parent container and updates the display if necessary.\r\n */\r\n removeComponent() {\r\n // Find the index of the component in its siblings array\r\n const index = this.siblings.indexOf(this);\r\n\r\n // If there's only one sibling, show the 'no results' element\r\n if (this.siblings.length <= 1) {\r\n $(this.noResultsElement).slideDown();\r\n }\r\n\r\n // Remove the component from its siblings array\r\n this.siblings.splice(index, 1);\r\n\r\n // Remove the component element from the DOM\r\n if (this.role === 'accordion') {\r\n // If the component is part of an accordion, remove the accordion item\r\n this.el.closest('li.accordion-item').remove();\r\n } else {\r\n // Otherwise, remove the component element directly\r\n this.el.remove();\r\n }\r\n }\r\n\r\n\r\n /**\r\n * Binds event handlers to buttons within the specified element.\r\n * This method binds event handlers to buttons for various actions such as edit, refresh, action, clone, cancel, save, and remove.\r\n * @param {jQuery} el - The jQuery element to which event handlers will be bound.\r\n * @param {boolean} isRebind - Indicates whether this is a rebind operation.\r\n */\r\n bindByElement(el, isRebind) {\r\n // Bind event handler for edit button\r\n $(this.selectors.buttons.edit, this.el).off('click').on('click', $.proxy(this.startEditMode, this));\r\n\r\n // Bind event handler for refresh button\r\n $(this.selectors.buttons.refresh, this.el).off('click').on('click', $.proxy(this.startRefreshMode, this));\r\n\r\n // Bind event handler for action button\r\n $(this.selectors.buttons.action, this.el).off('click').on('click', $.proxy(this.startActionMode, this));\r\n\r\n // Bind event handler for clone button\r\n $(this.selectors.buttons.clone, this.el).off('click').on('click', $.proxy(this.startCloneMode, this));\r\n\r\n // Bind event handler for cancel button\r\n $(this.selectors.buttons.cancel, this.el).off('click').on('click', $.proxy(this.cancelEditMode, this));\r\n\r\n // Bind event handler for save button\r\n $(this.selectors.buttons.save, this.el).off('click').on('click', $.proxy(this.saveEditMode, this));\r\n\r\n // Bind event handler for remove button\r\n $(this.selectors.buttons.remove, this.el).off('click').on('click', $.proxy(this.startRemove, this));\r\n\r\n // Check if this is not a rebind operation\r\n if (!isRebind) {\r\n // Any additional setup if needed when not in rebind mode\r\n }\r\n }\r\n\r\n /**\r\n * Binds sub-components within the component.\r\n * This method initializes and binds sub-components and component actions within the current component.\r\n */\r\n bindSubComponents() {\r\n // Store a reference to the current controller\r\n const controller = this;\r\n\r\n // Reset the components object\r\n this.components = {};\r\n\r\n // Initialize and bind sub-components\r\n $(this.page.selectors.components, this.el).not($(this.page.selectors.grandchildComponent, this.el)).each(function () {\r\n controller.page.initComponent(this, controller);\r\n });\r\n\r\n // Initialize and bind component actions\r\n $(this.page.selectors.componentActions, this.el).not($(this.page.selectors.grandchildAction, this.el)).each(function () {\r\n controller.page.initPageAction(this, controller);\r\n });\r\n }\r\n\r\n\r\n /**\r\n * Initiates the loading state for the component.\r\n * This method adds a class to the component element to indicate loading state and triggers a custom event.\r\n */\r\n startLoading() {\r\n // Add a class to the component element to indicate loading state\r\n this.el.addClass('component-loading');\r\n\r\n // Trigger a custom event to indicate the start of loading\r\n this.triggerEvent(\"component-loading-start\");\r\n }\r\n\r\n\r\n /**\r\n * Ends the loading state for the component.\r\n * This method removes the loading class from the component element and triggers a custom event.\r\n */\r\n endLoading() {\r\n // Remove the loading class from the component element\r\n this.el.removeClass('component-loading');\r\n\r\n // Trigger a custom event to indicate the completion of loading\r\n this.triggerEvent(\"component-loading-complete\");\r\n }\r\n\r\n /**\r\n * Finishes the loading process for the component.\r\n * This method performs any necessary actions after the component finishes loading.\r\n */\r\n finishLoad() {\r\n // TODO: Determine the purpose of this method and document it accordingly.\r\n\r\n // If the component is part of an accordion, reinitialize Foundation for the accordion\r\n if (this.role === 'accordion') {\r\n window.Foundation.reInit($('.accordion'));\r\n }\r\n\r\n // If the component is in editing mode, start the edit mode\r\n if (this.isEditing()) {\r\n this.startEditMode();\r\n }\r\n\r\n // Log a message indicating successful loading\r\n app.util.console.log(\r\n app.util.console.calloutContent(this.type),\r\n app.util.console.successContent(this.id),\r\n 'loaded.'\r\n );\r\n }\r\n\r\n /**\r\n * Handles the response received from a Component Framework request.\r\n * This method processes the response data and performs corresponding actions based on the response.\r\n * @param {any} data - The response data received from the request.\r\n * @param {XMLHttpRequest} xhr - The XMLHttpRequest object associated with the request.\r\n * @param {string} componentHtmlType - The type of the html passed if the response is not JSON.\r\n * @returns {Object} - The processed response object.\r\n */\r\n handleCFResponse(data, xhr, componentHtmlType) {\r\n var response;\r\n var contentType = xhr.getResponseHeader(\"Content-Type\");\r\n if (data === true || data === false) {\r\n response = {\r\n success: data\r\n };\r\n }\r\n else if (contentType.includes('application/json')) {\r\n // Handle JSON response\r\n try {\r\n response = $.parseJSON(data);\r\n }\r\n catch {\r\n //response was already parsed\r\n response = data;\r\n }\r\n\r\n } else {\r\n // Handle raw response\r\n response = {\r\n success: true\r\n };\r\n if (componentHtmlType) {\r\n response.componentHtmlType = componentHtmlType;\r\n response.componentHtml = data\r\n }\r\n }\r\n\r\n // Display toast messages if available\r\n if (response.toastMessages && response.toastMessages.length > 0) {\r\n response.toastMessages.forEach(function (toastMessage) {\r\n // Display toast message using toastr.js\r\n var options = {};\r\n if (toastMessage.timeOut) options.timeOut = toastMessage.timeOut;\r\n if (toastMessage.extendedTimeOut) options.extendedTimeOut = toastMessage.extendedTimeOut;\r\n if (toastMessage.closeButton) options.closeButton = toastMessage.closeButton;\r\n \r\n toastr[toastMessage.toastType.toString().toLowerCase()](toastMessage.message, toastMessage.title,options);\r\n \r\n });\r\n }\r\n\r\n // Perform actions based on response data\r\n\r\n // Check if response.refreshTargets is truthy and iterate if so\r\n response.refreshTargets?.forEach(target => app.page\r\n .refreshTarget(target.componentType, target.componentId));\r\n\r\n if (response.componentHtml) {\r\n if (response.componentHtmlType === 'view') {\r\n this.viewComponent.html(response.componentHtml);\r\n } else if (response.componentHtmlType === 'edit') {\r\n this.editComponent.html(response.componentHtml);\r\n } else if (response.componentHtmlType === 'full') {\r\n this.el.html(response.componentHtml);\r\n } \r\n }\r\n\r\n if (response.errorMessage) {\r\n // Show descriptive error message\r\n app.page.showDescriptiveError(response.errorMessage);\r\n }\r\n\r\n return response;\r\n }\r\n\r\n\r\n /**\r\n * Triggers a custom event and logs related information.\r\n * This method triggers the specified event and logs information about the event.\r\n * @param {string} eventName - The name of the event to trigger.\r\n */\r\n triggerEvent(eventName) {\r\n // Log information about the triggered event\r\n app.util.console.groupCollapsed(\r\n app.util.console.calloutContent(this.type),\r\n app.util.console.successContent(this.id),\r\n eventName,\r\n \"triggered.\"\r\n );\r\n app.util.console.trace(eventName, \"triggered.\");\r\n app.util.console.trace(eventName + \"-\" + this.type, \"triggered.\");\r\n app.util.console.groupEnd();\r\n\r\n // Trigger the event\r\n $(document).trigger(eventName, this);\r\n $(document).trigger(eventName + \"-\" + this.type, this);\r\n }\r\n\r\n\r\n /**\r\n * Checks if the component is in editing mode.\r\n * @returns {boolean} - True if the component is in editing mode, otherwise false.\r\n */\r\n isEditing() {\r\n // Check if the component element has the 'edit' class\r\n return this.el.hasClass('edit');\r\n }\r\n\r\n}\r\n\r\n/**\r\n * Represents an action associated with a page component.\r\n * @class\r\n */\r\nclass PageAction {\r\n /**\r\n * Creates an instance of PageAction.\r\n * @param {Element|string} e - The DOM element or selector associated with the action.\r\n * @param {Object} [pc={}] - The parent controller object.\r\n * @param {Object} [page=app.page] - The page object.\r\n */\r\n constructor(e, pc, page) {\r\n this.el = $(e);\r\n this.parentController = pc || {};\r\n this.page = page || app.page;\r\n this.action = this.el.closest('[data-component-action]').data('component-action');\r\n this.event = this.el.closest('[data-component-action-event]').data('component-action-event') || 'click';\r\n this.type = this.el.closest('[data-component-type]').data('component-type');\r\n // Thing you are targeting (unique type (points to one))\r\n this.target = this.el.closest('[data-component-action-target]').data('component-action-target');\r\n // Type of the thing you are targeting (PersonComponents)\r\n this.targetType = this.el.closest('[data-component-action-target-type]').data('component-action-target-type');\r\n this.subtype = this.el.closest('[data-component-subtype]').data('component-subtype');\r\n\r\n switch (this.action) {\r\n case \"filter\":\r\n this.filterField = this.el.closest('[data-component-action-field]').data('component-action-field');\r\n break;\r\n case \"setvalue\":\r\n this.value = this.el.closest('[data-component-action-value]').data('component-action-value');\r\n break;\r\n }\r\n }\r\n /**\r\n * Triggers the action associated with the page component.\r\n * @param {Event} e - The event object.\r\n */\r\n triggerAction(e) {\r\n app.util.console.log('component action', app.util.console.calloutContent(this.action), 'for', app.util.console.warningContent(this.target), 'triggered.');\r\n\r\n switch (this.action) {\r\n case \"add5\":\r\n this.pageComponentActionAdd(this.el, this.parentController, this.target);\r\n this.pageComponentActionAdd(this.el, this.parentController, this.target);\r\n this.pageComponentActionAdd(this.el, this.parentController, this.target);\r\n this.pageComponentActionAdd(this.el, this.parentController, this.target);\r\n this.pageComponentActionAdd(this.el, this.parentController, this.target);\r\n break;\r\n case \"add\":\r\n this.pageComponentActionAdd(this.el, this.parentController, this.target);\r\n break;\r\n case \"filter\":\r\n this.pageComponentActionFilter(this.el, this.target);\r\n break;\r\n case \"filterserver\":\r\n this.pageComponentActionFilterServer(this.el, this.target, e);\r\n break;\r\n case \"refresh\":\r\n this.pageComponentActionRefresh(this.el, this.target);\r\n break;\r\n case \"setoptions\":\r\n this.pageComponentActionUpdateSetOptions(this.el, this.target);\r\n break;\r\n case \"setvalue\":\r\n this.pageComponentActionUpdateSetValue(this.el, this.target);\r\n break;\r\n case \"setvisibility\":\r\n this.pageComponentActionUpdateSetVisibility(this.el, this.target);\r\n break;\r\n case \"updateid\":\r\n this.pageComponentActionUpdateId(this.el, this.target);\r\n break;\r\n case \"updatesubtype\":\r\n this.pageComponentActionUpdateSubtype(this.el, this.target);\r\n break;\r\n case \"download\":\r\n this.pageComponentActionDownload(this.el, this.target, e);\r\n break;\r\n }\r\n\r\n $(document).trigger(\"component-action-complete\", this);\r\n $(document).trigger(\"component-action-complete-\" + this.type, this);\r\n }\r\n /**\r\n * Adds new components to the page.\r\n * @param {jQuery} el - The jQuery element triggering the action.\r\n * @param {Object} pc - The parent controller object.\r\n * @param {string} t - The target component.\r\n */\r\n pageComponentActionAdd(el, pc, t) {\r\n var target = $('[data-role~=\"component-action-target\"][data-component-target=\"' + t + '\"]', pc.el);\r\n var componentWrapper;\r\n\r\n if (el.data('component-template') && $('[data-role~=\"component-template\"][data-template-name=\"' + el.data('component-template') + '\"]')) {\r\n componentWrapper = $('[data-role~=\"component-template\"][data-template-name=\"' + el.data('component-template') + '\"]').html();\r\n } else {\r\n var wrapperType = el.data('component-wrapper-type') ? el.data('component-wrapper-type') : 'div';\r\n componentWrapper = '<' + wrapperType + ' class=\"edit ' + (el.data('component-wrapper-class') ? el.data('component-wrapper-class') : \"\") + '\" data-role=\"component\" data-component-id=\"0\">';\r\n }\r\n\r\n if (target.data('component-new-key') && target.data('component-new-value') !== 'undefined') {\r\n var count = 2;\r\n pc.newRecordData = {};\r\n\r\n pc.newRecordData[target.data('component-new-key')] = target.data('component-new-value');\r\n\r\n while (target.data('component-new-key' + count) && target.data('component-new-value' + count)) {\r\n pc.newRecordData[target.data('component-new-key' + count)] = target.data('component-new-value' + count);\r\n count++;\r\n }\r\n }\r\n\r\n if (el.data('parent-id')) {\r\n pc.id = el.data('parent-id');\r\n }\r\n var newComponentSelector;\r\n switch (target.data('component-insert-type')) {\r\n case 'append':\r\n target.append(componentWrapper);\r\n newComponentSelector = $('[data-role~=\"component\"]:last', target);\r\n break;\r\n case 'sibling-append':\r\n target.after(componentWrapper);\r\n newComponentSelector = target.next();\r\n break;\r\n case 'sibling-prepend':\r\n target.before(componentWrapper);\r\n newComponentSelector = target.prev();\r\n break;\r\n default:\r\n target.prepend(componentWrapper);\r\n newComponentSelector = $('[data-role~=\"component\"]:first', target);\r\n break;\r\n }\r\n if (this.el.data('component-subtype')) {\r\n this.subtype = this.el.data('component-subtype');\r\n } else {\r\n this.subtype = this.el.closest('[data-component-subtype]').data('component-subtype');\r\n }\r\n\r\n this.page.initComponent(newComponentSelector, pc, this.subtype);\r\n $(document).trigger(\"component-add-complete\", newComponentSelector);\r\n $(componentWrapper).foundation();\r\n }\r\n /**\r\n * Filters components based on user input.\r\n * @param {jQuery} el - The jQuery element triggering the action.\r\n * @param {string} t - The target component.\r\n */\r\n pageComponentActionFilter(el, t) {\r\n\r\n var context = $('[data-role~=\"component-action-target\"][data-component-target~=\"' + this.target + '\"]');\r\n var rows = $('[data-role~=\"component\"]', context);\r\n var form = $('form[data-role~=\"filter-server-form\"][data-component-action-target-type~=\"' + this.targetType + '\"]');\r\n rows.show();\r\n\r\n $(':input', form).each(function (i, e) {\r\n var el = $(e);\r\n if (el.val() !== '') {\r\n var field;\r\n\r\n if (el.data('target')) {\r\n field = '[data-label=\"' + el.data('target') + '\"]';\r\n }\r\n else {\r\n field = '[data-label]';\r\n }\r\n\r\n var values = el.val().toUpperCase().split(/\\s+/);\r\n rows.each(function (i, e) {\r\n var hide = false;\r\n\r\n $.each(values, function (index, v) {\r\n if ($(field + ':icontains(\"' + v + '\")', e).length < 1) {\r\n hide = true;\r\n return;\r\n }\r\n });\r\n if (hide) {\r\n $(e).hide();\r\n }\r\n });\r\n }\r\n });\r\n\r\n }\r\n\r\n /**\r\n * Filters components on the server side based on user input.\r\n * \r\n * This method triggers a server-side filtering operation based on user input. It gathers filter criteria from form fields, constructs a data payload, and sends an AJAX request to the server for filtering. Upon receiving the filtered data, it updates the page components accordingly.\r\n * \r\n * @param {jQuery} el - The jQuery element triggering the action.\r\n * @param {string} t - The target component.\r\n * @param {Event} e - The event object.\r\n */\r\n pageComponentActionFilterServer(el, t, e) {\r\n\r\n if (e === undefined || e.type !== \"keyup\" || app.util.isPrintableCharacter(e)) {\r\n //if keyup, add a delay\r\n var delay = 300;\r\n if (e !== undefined && e.type !== \"keyup\") {\r\n delay = 0;\r\n }\r\n\r\n if (this.timeout !== null) { clearTimeout(this.timeout); }\r\n var that = this;\r\n this.timeout = setTimeout(function () {\r\n\r\n var form = $('form[data-role~=\"filter-server-form\"][data-component-action-target-type=\"' + that.targetType + '\"]');\r\n\r\n var dataRoles = el.data('role');\r\n if (dataRoles.indexOf('page-size') !== -1) {\r\n\r\n //append to form\r\n if (form.find('[name=\"pageSize\"]').length) {\r\n form.find('[name=\"pageSize\"]').val(el.val());\r\n } else {\r\n //add to form\r\n $('').attr({\r\n type: 'hidden',\r\n id: 'pageSize',\r\n name: 'pageSize',\r\n value: el.val()\r\n }).appendTo(form);\r\n }\r\n }\r\n\r\n var filters = app.util.getFormValues(form); //form.serializeArray();\r\n\r\n if (el.data('page-value')) {\r\n filters.pageNumber = el.data('page-value');\r\n }\r\n\r\n var target = that.page.components[that.targetType][0];\r\n target.startViewMode(false, filters);\r\n\r\n }, delay, el, that);\r\n }\r\n }\r\n\r\n /**\r\n * Refreshes components based on user input.\r\n * \r\n * This method refreshes components based on filter criteria provided by the user. It retrieves filter values from form fields, constructs a filter object, and applies the filters to the components. It then triggers a view mode refresh for the affected components.\r\n * \r\n * @param {jQuery} el - The jQuery element triggering the action.\r\n * @param {string} t - The target component.\r\n */\r\n pageComponentActionRefresh(el, t) {\r\n var target = this.page.components[t][0];\r\n if (target) {\r\n target.startViewMode();\r\n }\r\n }\r\n /**\r\n * Updates the ID of a component.\r\n * \r\n * This method updates the ID of a component based on user input or predefined value. It retrieves the new ID value from the triggering element or a data attribute, applies the ID update to the component, and triggers a view mode refresh.\r\n * \r\n * @param {jQuery} el - The jQuery element triggering the action.\r\n * @param {string} t - The target component.\r\n */\r\n pageComponentActionUpdateId(el, t) {\r\n var target = this.page.components[t][0];\r\n var val;\r\n if (el.data('component-action-updateid-value')) {\r\n val = el.data('component-action-updateid-value');\r\n } else {\r\n val = el.val();\r\n }\r\n if (val.length > 0) {\r\n target.id = val;\r\n target.startViewMode();\r\n }\r\n }\r\n\r\n /**\r\n * Updates the subtype of a component.\r\n * \r\n * This method updates the subtype of a component based on user input. It retrieves the new subtype value from the triggering element and applies the subtype update to the target component.\r\n * \r\n * @param {jQuery} el - The jQuery element triggering the action.\r\n * @param {string} t - The target component.\r\n */\r\n pageComponentActionUpdateSubtype(el, t) {\r\n var target = $('[data-role~=\"component-action-target\"][data-component-target=\"' + t + '\"]');\r\n target.data('component-subtype', el.val());\r\n }\r\n /**\r\n * Sets options for components based on user input.\r\n * \r\n * This method sets options for components based on user selection. It retrieves selected options from form fields, determines the action type (e.g., show/hide), and applies the corresponding action to the target components.\r\n * \r\n * @param {jQuery} el - The jQuery element triggering the action.\r\n * @param {string} t - The target component.\r\n * @param {Event} e - The event object.\r\n */\r\n pageComponentActionUpdateSetOptions(el, t, e) {\r\n var targets = $('[data-component-target=\"' + t + '\"]');\r\n var values = $('input:checked', el);\r\n targets.each(function (i, e) {\r\n var targetField = $(e).data('component-action-setoptions-field');\r\n\r\n switch ($(e).data('component-action-setoptions-type')) {\r\n case \"showequal\":\r\n //remove all options\r\n if (values.length === 0 || values[0].value === '0') {\r\n $('.select-many-checkbox', e).show();\r\n } else {\r\n $('.select-many-checkbox', e).hide();\r\n $('.select-many-checkbox', e).prop('checked', false).trigger(\"change\");\r\n\r\n values.each(function (i2, e2) {\r\n var value = $(e2).val();\r\n //re add for thisv value\r\n $('.select-many-checkbox', e).each(function () {\r\n if ($('input', this).attr(targetField) === value) {\r\n $(this).show();\r\n }\r\n });\r\n });\r\n }\r\n break;\r\n }\r\n });\r\n }\r\n /**\r\n * Sets values for components based on user input.\r\n * \r\n * This method sets values for components based on user selection. It retrieves the value to be set from the triggering element or a data attribute and applies the value to the target component.\r\n * \r\n * @param {jQuery} el - The jQuery element triggering the action.\r\n * @param {string} t - The target component.\r\n */\r\n pageComponentActionUpdateSetValue(el, t) {\r\n var target = $(t);\r\n target.val($(el).data(\"component-action-value\"));\r\n }\r\n /**\r\n * Sets the visibility of components based on user input.\r\n * \r\n * This method sets the visibility of components based on user selection. It retrieves the visibility criteria from form fields or data attributes, determines the action type (e.g., show/hide), and applies the corresponding action to the target components.\r\n * \r\n * @param {jQuery} el - The jQuery element triggering the action.\r\n * @param {string} t - The target component.\r\n */\r\n pageComponentActionUpdateSetVisibility(el, t) {\r\n var targets = $('[data-component-target=\"' + t + '\"]');\r\n var val = app.util.getElementValue(el); // Retrieve the value of the element\r\n targets.each(function (i, e) {\r\n var showTarget = null;\r\n var type = $(e).data('component-action-setvisibility-type');\r\n var targetValue = $(e).data('component-action-setvisibility-value');\r\n\r\n switch (type) {\r\n case \"showchecked\":\r\n showTarget = el.prop(\"checked\"); // Boolean value based on checkbox state\r\n break;\r\n case \"showunchecked\":\r\n showTarget = !el.prop(\"checked\"); // Inverse of checkbox state\r\n break;\r\n case \"showequal\":\r\n showTarget = (val === targetValue); // Check if the values are equal\r\n break;\r\n case \"shownotequal\":\r\n showTarget = (val !== targetValue); // Check if the values are not equal\r\n break;\r\n case \"showcontains\":\r\n var vals = targetValue.split(','); // Split the target values into an array\r\n showTarget = vals.includes(val); // Check if the value is in the list\r\n break;\r\n case \"shownotcontains\":\r\n var vals = targetValue.split(','); // Split the target values into an array\r\n showTarget = !vals.includes(val); // Check if the value is not in the list\r\n break;\r\n }\r\n if (showTarget != null) {\r\n app.util.setVisibility(e, showTarget); // Set the visibility based on the condition\r\n }\r\n });\r\n }\r\n\r\n\r\n\r\n /**\r\n * Initiates a download action for components.\r\n * \r\n * This method initiates a download action for components based on user interaction. It retrieves the download URL from the triggering element or a data attribute, gathers additional data from form fields, constructs a data payload, and sends an AJAX request to the server for downloading. Upon completion, it displays a success or failure message to the user.\r\n * \r\n * @param {jQuery} el - The jQuery element triggering the action.\r\n * @param {string} t - The target component.\r\n * @param {Event} e - The event object.\r\n */\r\n pageComponentActionDownload(el, t, e) {\r\n var displayName = el.data('component-displayname');\r\n var toastMessage = `Download in Progress${displayName ? ` (${displayName})` : ''}`;\r\n\r\n var toast = toastr.info(toastMessage, '', {\r\n closeButton: true,\r\n timeOut: 0,\r\n extendedTimeOut: 0,\r\n });\r\n\r\n var href = el.data('component-href');\r\n\r\n var data = {};\r\n if (this.target) {\r\n var form = $(`form[data-role~=\"component-action-target\"][data-component-target~=\"${this.target}\"]`);\r\n var formdata = app.util.getFormValues(form);\r\n data = { ...data, ...formdata }\r\n } else if (this.targetType) {\r\n var form = $(`form[data-component-action-target-type~=\"${this.targetType}\"]`);\r\n var formdata = app.util.getFormValues(form);\r\n data = { ...data, ...formdata }\r\n }\r\n\r\n var actionCustomData = app.util.getCustomData(el);\r\n if (actionCustomData) {\r\n data = { ...data, ...actionCustomData };\r\n }\r\n\r\n $.ajax({\r\n url: href,\r\n method: 'POST',\r\n data: data,\r\n xhrFields: {\r\n responseType: 'blob'\r\n }\r\n })\r\n .done(function (data, status, xhr) {\r\n if (data.size <= 0) {\r\n toastr.warning(`No data found ${displayName ? ` (${displayName})` : ''}`);\r\n }\r\n else {\r\n var filename = '';\r\n var disposition = xhr.getResponseHeader('Content-Disposition');\r\n if (disposition && disposition.indexOf('attachment') !== -1) {\r\n var filenameRegex = /filename[^;=\\n]*=((['\"]).*?\\2|[^;\\n]*)/;\r\n var matches = filenameRegex.exec(disposition);\r\n if (matches != null && matches[1]) {\r\n filename = matches[1].replace(/['\"]/g, '');\r\n }\r\n }\r\n var url = window.URL.createObjectURL(data);\r\n var link = document.createElement('a');\r\n link.href = url;\r\n link.download = filename || 'default-filename';\r\n link.style.display = 'none';\r\n document.body.appendChild(link);\r\n link.click();\r\n document.body.removeChild(link);\r\n toastr.success(`Download Complete${displayName ? ` (${displayName})` : ''}`);\r\n }\r\n }).fail(function (jqXHR, textStatus, errorThrown) {\r\n toastr.error(`Download Failed${displayName ? ` (${displayName})` : ''}`);\r\n }).always(function () {\r\n toastr.clear(toast);\r\n });\r\n }\r\n\r\n}\r\n\r\nvar app = {}\r\napp.util = {\r\n console: (function () {\r\n \"use strict\";\r\n\r\n var queue = [];\r\n var token = {};\r\n\r\n function calloutContent(value) { return customContent(value, \"display: inline-block; background-color: #0479a8; color: white; font-weight: bold; padding: 3px;\"); }\r\n\r\n function successContent(value) { return customContent(value, \"display: inline-block; background-color: springgreen; color: black; font-weight: bold; padding: 3px;\"); }\r\n\r\n function alertContent(value) { return customContent(value, \"display: inline-block; background-color: yellow; color: black; font-weight: bold; padding: 3px;\"); }\r\n\r\n function warningContent(value) { return customContent(value, \"display: inline-block; background-color: #c5050c; color: white; font-weight: bold; padding: 3px;\"); }\r\n\r\n function customContent(value, format) {\r\n queue.push({ content: value, format: format })\r\n return token;\r\n }\r\n\r\n function fancyConsole(fn) {\r\n function fancyConsoleProxy() {\r\n if (!app.util.isDebugMode) return;\r\n\r\n var content = [];\r\n var formats = [];\r\n\r\n for (var i = 0; i < arguments.length; i++) {\r\n var arg = arguments[i];\r\n\r\n if (arg == token) {\r\n var o = queue.shift();\r\n\r\n content.push(\"%c\" + o.content);\r\n formats.push(o.format);\r\n }\r\n else {\r\n if (typeof (arg) === \"object\" || typeof (arg) === \"function\") {\r\n content.push(\"%o\");\r\n formats.push(arg);\r\n }\r\n else {\r\n content.push(\"%c\" + arg);\r\n formats.push(\"\");\r\n }\r\n }\r\n\r\n content.push(\"%c \");\r\n formats.push(\"\");\r\n }\r\n\r\n fn(content.join(\"\"), ...formats);\r\n }\r\n\r\n return fancyConsoleProxy;\r\n }\r\n\r\n return {\r\n log: fancyConsole(console.log),\r\n warn: fancyConsole(console.warn),\r\n error: fancyConsole(console.error),\r\n trace: fancyConsole(console.trace),\r\n group: fancyConsole(console.group),\r\n groupCollapsed: fancyConsole(console.groupCollapsed),\r\n groupEnd: fancyConsole(console.groupEnd),\r\n\r\n calloutContent: calloutContent,\r\n alertContent: alertContent,\r\n warningContent: warningContent,\r\n successContent: successContent,\r\n customContent: customContent\r\n };\r\n })(),\r\n copyToClipboard: function (s) {\r\n if (window.clipboardData && window.clipboardData.setData) {\r\n // IE specific code path to prevent textarea being shown while dialog is visible.\r\n return clipboardData.setData(\"Text\", s);\r\n } else if (document.queryCommandSupported && document.queryCommandSupported(\"copy\")) {\r\n var textarea = document.createElement(\"textarea\");\r\n textarea.textContent = s;\r\n textarea.style.position = \"fixed\"; // Prevent scrolling to bottom of page in MS Edge.\r\n document.body.appendChild(textarea);\r\n textarea.select();\r\n try {\r\n return document.execCommand(\"copy\"); // Security exception may be thrown by some browsers.\r\n } catch (ex) {\r\n console.warn(\"Copy to clipboard failed.\", ex);\r\n return false;\r\n } finally {\r\n document.body.removeChild(textarea);\r\n }\r\n }\r\n },\r\n dateOrNull: function (s) {\r\n var d = new Date(s);\r\n return isNaN(d) ? null : d;\r\n },\r\n\r\n getElementValue: function (el, valueType) {\r\n if (el instanceof NodeList) {\r\n el = el[0];\r\n }\r\n switch (valueType) {\r\n case 'html':\r\n return el.outerHTML;\r\n case 'seltext':\r\n return el.options[el.selectedIndex].text;\r\n case 'val':\r\n return el.value;\r\n default:\r\n return el.value;\r\n }\r\n },\r\n getFormValues: function (el) {\r\n var unindexed_array = el.serializeArray();\r\n var result = {};\r\n for (var i = 0; i < unindexed_array.length; i++) {\r\n var item = unindexed_array[i];\r\n\r\n if (result[item.name]) {\r\n if (!Array.isArray(result[item.name])) {\r\n result[item.name] = [result[item.name]];\r\n }\r\n\r\n result[item.name].push(item.value);\r\n } else {\r\n result[item.name] = item.value;\r\n }\r\n }\r\n\r\n return result;\r\n },\r\n getGuid: function () {\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\r\n var r = Math.random() * 16 | 0;\r\n return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);\r\n });\r\n },\r\n getIndexByPropertyValue: function (array, property, value) {\r\n var r = -1;\r\n array.some(function (item, i) {\r\n if (item[property] === value) {\r\n r = i;\r\n return true;\r\n }\r\n return false;\r\n });\r\n return r;\r\n },\r\n getPageSize: function () {\r\n var w = $(window).width();\r\n if (w < 768) {\r\n return 0;\r\n }\r\n else if (w <= 992) {\r\n return 1;\r\n }\r\n else if (w <= 1200) {\r\n return 3;\r\n }\r\n return 4;\r\n },\r\n getFormattedNumber: function (value, prepend) {\r\n if (value < 0) {\r\n prepend = \"-\" + (prepend ? prepend : \"\");\r\n value = Math.abs(value);\r\n }\r\n return (prepend ? prepend : \"\") + parseFloat(value).toLocaleString();\r\n },\r\n getAccountingNumber: function (value, prepend, append) {\r\n if (value < 0) {\r\n prepend = \"(\" + (prepend ? prepend : \"\");\r\n append = (append ? append : \"\") + \")\";\r\n value = Math.abs(value);\r\n }\r\n return (prepend ? prepend : \"\") + parseFloat(value).toLocaleString(undefined, { 'minimumFractionDigits': 2, 'maximumFractionDigits': 2 }) + (append ? append : \"\");\r\n },\r\n getShortFriendlyNumber: function (value, prepend) {\r\n var format;\r\n var numberFormats = [\r\n { s: \"T\", v: 1000000000000, d: 0 },\r\n { s: \"B\", v: 1000000000, d: 0 },\r\n { s: \"M\", v: 1000000, d: 0 },\r\n { s: \"k\", v: 1000, d: 0 }\r\n ];\r\n\r\n if (value < 0) {\r\n prepend = \"-\" + (prepend ? prepend : \"\");\r\n value = Math.abs(value);\r\n }\r\n\r\n for (var i = 0; i < numberFormats.length; i++) {\r\n if (value >= numberFormats[i].v) {\r\n format = numberFormats[i];\r\n value = (value / format.v).toFixed(format.d);\r\n break;\r\n }\r\n }\r\n\r\n if (format) { value = value + format.s; }\r\n value = (prepend ? prepend : \"\") + value;\r\n\r\n return value;\r\n },\r\n getFriendlyNumber: function (value, prepend) {\r\n var format;\r\n var numberFormats = [\r\n { s: \"T\", v: 1000000000000, d: 2 },\r\n { s: \"B\", v: 1000000000, d: 2 },\r\n { s: \"M\", v: 1000000, d: 2 },\r\n { s: \"k\", v: 1000, d: 2 }\r\n ];\r\n\r\n if (value < 0) {\r\n prepend = \"-\" + (prepend ? prepend : \"\");\r\n value = Math.abs(value);\r\n }\r\n\r\n for (var i = 0; i < numberFormats.length; i++) {\r\n if (value >= numberFormats[i].v) {\r\n format = numberFormats[i];\r\n value = (value / format.v).toFixed(format.d);\r\n break;\r\n }\r\n }\r\n\r\n if (format) { value = value + format.s; }\r\n value = (prepend ? prepend : \"\") + value;\r\n\r\n return value;\r\n },\r\n\r\n isDebugMode: true,\r\n isJsonString: function (s) {\r\n try {\r\n const parsed = JSON.parse(s);\r\n return typeof parsed === 'object' && parsed !== null;\r\n } catch (e) {\r\n return false;\r\n }\r\n },\r\n isPageSmall: function () { return this.getPageSize() === 0; },\r\n isPageMedium: function () { return this.getPageSize() === 1; },\r\n isPageLarge: function () { return this.getPageSize() === 2; },\r\n isPageExtraLarge: function () { return this.getPageSize() === 3; },\r\n isPrintableCharacter: function (event) {\r\n //special cases\r\n\r\n //We do not define space as a printable character\r\n if (event.key === \" \")\r\n return false;\r\n\r\n //As backspace will change the value, we define it as printable\r\n if (event.key === \"Backspace\")\r\n return true;\r\n //per the specs- printable characters will return single character if it is a printable. \r\n //If it is a control, it will be longer than 1 character. \r\n //If it is dead or unknown, it will be a defined string (\"Dead\" or \"Unidentified\")\r\n\r\n return event.key.length === 1;\r\n //return s === 8 || (s > 47 && s < 58) || (s > 64 && s < 91) || (s > 95 && s < 112) || (s > 185 && s < 193) || (s > 218 && s < 223);\r\n },\r\n\r\n merge: function (left, right, target) {\r\n var result = [];\r\n\r\n while (left.length && right.length) {\r\n //if (left[0] <= right[0]) {\r\n if ($('[data-label=\"' + target + '\"]', left[0]).text() <=\r\n $('[data-label=\"' + target + '\"]', right[0]).text()) {\r\n result.push(left.shift());\r\n } else {\r\n result.push(right.shift());\r\n }\r\n }\r\n\r\n if (this.isDebugMode) {\r\n app.util.console.groupCollapsed(\"left: \" + left.length);\r\n app.util.console.groupEnd(\" right: \" + right.length);\r\n }\r\n\r\n while (left.length) result.push(left.shift());\r\n while (right.length) result.push(right.shift());\r\n\r\n return result;\r\n },\r\n mergeSort: function (arr, target) {\r\n if (arr.length < 2) return arr;\r\n\r\n var middle = parseInt(arr.length / 2);\r\n var left = arr.slice(0, middle);\r\n var right = arr.slice(middle, arr.length);\r\n\r\n return this.merge(this.mergeSort(left, target), this.mergeSort(right, target), target);\r\n },\r\n\r\n getCustomData: function (el) {\r\n customRecordData = {};\r\n if (el.data('component-key') && el.data('component-value') !== 'undefined') {\r\n var count = 2;\r\n\r\n\r\n customRecordData[el.data('component-key')] = el.data('component-value');\r\n\r\n while (el.data('component-key' + count) && el.data('component-value' + count)) {\r\n customRecordData[el.data('component-key' + count)] = el.data('component-value' + count);\r\n count++;\r\n }\r\n }\r\n return customRecordData;\r\n },\r\n\r\n // Helper function to wait until there are no pending requests\r\n waitForPendingRequests(form, callback) {\r\n\r\n form.removeData(\"validator\");\r\n $.validator.unobtrusive.parse(form);\r\n\r\n var maxChecks = 50; // Maximum number of checks (adjust as needed)\r\n var checkCount = 0;\r\n\r\n var interval = setInterval(function () {\r\n if (form.valid() && form.data('validator').pendingRequest === 0) {\r\n clearInterval(interval);\r\n callback();\r\n } else if (!form.valid() || checkCount >= maxChecks) {\r\n clearInterval(interval);\r\n }\r\n checkCount++;\r\n }, 100); // Check every 100 milliseconds\r\n },\r\n\r\n getElementValue(el) {\r\n if (el.is(':checkbox') || el.is(':radio')) {\r\n return el.prop('checked');\r\n } else if (el.is('select')) {\r\n return el.find('option:selected').val();\r\n } else {\r\n return el.val();\r\n }\r\n },\r\n\r\n setVisibility(e, show) {\r\n if (show) {\r\n $(e).slideDown();\r\n $('input, select, textarea', e).prop(\"disabled\", false);\r\n } else {\r\n $(e).slideUp();\r\n $('input, select, textarea', e).prop(\"disabled\", true);\r\n }\r\n }\r\n};\r\n\r\n$(function () {\r\n app.page = new Page(window.applicationPath);\r\n $(document).trigger('page-init-complete');\r\n});\r\n","//*******************************************************************************************\r\n//* WaMS Component Framework - app.input.js\r\n//* Version 0.1\r\n//* Author: Damian Koch\r\n//* Component framework input helpers plugin\r\n//* Requires jQuery, WaMS Component Framework\r\n//* \r\n//* This component adds some rich input features. When this file is loaded, certain\r\n//* fields/attributes will be looked for in forms on showEditMode complete.\r\n//*******************************************************************************************\r\n\r\napp.input = (function () {\r\n var myInput = {\r\n Init: function () {\r\n this.initInputComponents(document);\r\n //init page\r\n\r\n //init future components\r\n $(document).on('component-bind-edit-mode-complete', function (e, component) {\r\n //app.util.console.log('component-bind-edit-mode-complete triggered: ' + component.type);\r\n app.input.initInputComponents(component.editComponent);\r\n });\r\n },\r\n initInputComponents: function (el) {\r\n app.input.initMasks(el);\r\n app.input.initTextEditor(el);\r\n app.input.initDatePicker(el);\r\n app.input.initSelectMany(el);\r\n app.input.initAutocomplete(el);\r\n app.input.initCheckboxLists(el);\r\n $(el).foundation();\r\n },\r\n initMasks: function (editComponent) {\r\n $('[data-component-input-type=\"Phone\"]', editComponent).inputmask('(999)999-9999');\r\n $('[data-component-input-type=\"phoneext\"]', editComponent).inputmask('(999)999-9999 x99999');\r\n $('[data-component-input-type=\"date\"]', editComponent).inputmask('99/99/9999');\r\n $('[data-component-input-type=\"numeric\"]', editComponent).inputmask('numeric');\r\n $('[data-component-input-type=\"percentage\"]', editComponent).inputmask('percentage');\r\n $('[data-component-input-type=\"currency\"]', editComponent).inputmask('currency', { prefix: '$', groupSeparator: ',' });\r\n $('[data-component-input-type=\"ssn\"]', editComponent).inputmask('ssn');\r\n },\r\n initSelectMany: function (editComponent) {\r\n $('[data-role=\"select-many\"]', editComponent).each(function () {\r\n var selectManyContext = this;\r\n var listSelected = function (el) {\r\n var selectedCheckboxNames;\r\n var context = $(el).closest('[data-role=\"select-many\"]');\r\n var fieldSet = $('fieldset', context);\r\n\r\n if ($('[type=\"checkbox\"]:not(:checked)', fieldSet).length === 0) {\r\n selectedCheckboxNames = 'All';\r\n }\r\n else {\r\n if ($('[type=\"checkbox\"]:checked', fieldSet).length === 0) {\r\n selectedCheckboxNames = 'None';\r\n } else {\r\n selectedCheckboxNames = $('[type=\"checkbox\"]:checked + label', fieldSet).map(function () {\r\n return this.innerText;\r\n }).get().join(', ');\r\n }\r\n }\r\n\r\n $('[data-role=\"selected-item-list\"]', context).text(selectedCheckboxNames);\r\n };\r\n\r\n listSelected($('fieldset', this));\r\n\r\n //on change update selection list label\r\n $('input[type=\"checkbox\"]', selectManyContext).on('change', function () { listSelected(this); });\r\n\r\n //filter event listener\r\n $(selectManyContext).on('input', '[data-role=\"select-many-filter\"]', function () {\r\n var value = $(this).val().toLowerCase();\r\n const selMany = $(this).closest('[data-role=\"select-many\"]');\r\n\r\n selMany.find('.select-many-checkbox').each(function () {\r\n if ($(this).find('label').text().toLowerCase().search(value) > -1) {\r\n $(this).show();\r\n }\r\n else {\r\n $(this).hide();\r\n }\r\n });\r\n\r\n var selAll = selMany.find('[type=\"checkbox\"][data-role~=\"selectall\"]:visible');\r\n var selAllChecked = true;\r\n\r\n\r\n //loop through visible values, if any is false, then mark the box as not all selected\r\n selMany.find('.select-many-checkbox input[type=\"checkbox\"]:visible').each(function (ind, el) {\r\n if ($(el).prop('checked') !== true) {\r\n selAllChecked = false;\r\n // returning false breaks from loop\r\n return false;\r\n }\r\n });\r\n\r\n selAll.prop('checked', selAllChecked);\r\n });\r\n\r\n app.util.console.log(editComponent);\r\n\r\n //custom dropdown filter event listener\r\n $(editComponent).on('change', 'select[data-role=\"filter-select-many\"]', function () {\r\n\r\n //var filterField = $(this).data(\"filter-field\");\r\n var filterTargetFieldset = $('#fst' + $(this).data('target'), selectManyContext);\r\n //var selectedOption = $(this).val();\r\n\r\n var allSelects = $('select[data-role=\"filter-select-many\"][data-target=\"' + $(this).data('target') + '\"]');\r\n\r\n filterTargetFieldset.find('.select-many-checkbox').each(function () {\r\n var showThis = true;\r\n var curCheckbox = $(this).find('input');\r\n\r\n allSelects.each(function (el) {\r\n var selectedOption = $(this).val();\r\n var filteredField = $(this).data('filter-field');\r\n var filteredFieldValue = curCheckbox.data(filteredField);\r\n\r\n showThis = showThis && (selectedOption == null || selectedOption === '' || filteredFieldValue == selectedOption);\r\n });\r\n\r\n if (showThis) {\r\n $(this).show();\r\n }\r\n else {\r\n $(this).hide();\r\n }\r\n });\r\n\r\n var selAll = $('[type=\"checkbox\"][data-role~=\"selectall\"][name=\"' + $(this).data('target') + '\"]:visible');\r\n var selAllChecked = true;\r\n $('.select-many-checkbox input[type=\"checkbox\"][name=\"' + $(this).data('target') + '\"]:visible').each(function (ind, el) {\r\n if ($(el).prop('checked') != true) {\r\n selAllChecked = false;\r\n // returning false breaks from loop\r\n return false;\r\n }\r\n });\r\n\r\n selAll.prop('checked', selAllChecked);\r\n });\r\n });\r\n },\r\n initDatePicker: function (editComponent) {\r\n $('[data-component-role=\"startdate\"]', editComponent).fdatepicker().on('changeDate', function (ev) {\r\n //When start date changes, check the end date\r\n //Find end date\r\n var endDateElement = $('#' + $(this).data('enddate-target'), $(this.form)).fdatepicker();\r\n\r\n if (ev.date.valueOf() > new Date(endDateElement.val()).getTime()) {\r\n //If the end date is too early, set to know and give focus\r\n var newDate = new Date(ev.date);\r\n newDate.setDate(newDate.getDate() + 1);\r\n endDateElement.fdatepicker('update', newDate);\r\n $(this).fdatepicker('hide');\r\n endDateElement[0].focus();\r\n }\r\n\r\n }).data('datepicker');\r\n\r\n $('[data-component-role=\"enddate\"]', editComponent).fdatepicker({\r\n onRender: function (date) {\r\n //get start date\r\n var startDate = $('[data-enddate-target=\"' + this.element.attr('id') + '\"').fdatepicker();\r\n //Only allow \r\n return date.valueOf() <= new Date(startDate.val()).getTime() ? 'disabled' : '';\r\n }\r\n }).on('changeDate', function (ev) {\r\n $(this).fdatepicker('hide');\r\n }).data('datepicker');\r\n\r\n\r\n $('[data-role~=\"datepicker\"]', editComponent).fdatepicker();\r\n },\r\n initTextEditor: function (editComponent) {\r\n $('[data-role~=\"richtext\"]', editComponent).each(function (index) {\r\n tinymce.remove('#' + this.id);\r\n tinyMCE.baseURL = app.page.appPath+ \"/content/tinymce\";\r\n tinymce.init({\r\n relative_urls: false,\r\n remove_script_host: false,\r\n selector: '#' + this.id, // change this value according to your HTML\r\n block_formats:\r\n 'Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre',\r\n plugins: 'code lists link table',\r\n mode: 'textareas',\r\n branding: false,\r\n menubar: false,\r\n toolbar: [\r\n 'bold italic superscript subscript | formatselect | numlist bullist | forecolor backcolor | alignleft aligncenter alignright | link | indent outdent | removeformat code'\r\n ],\r\n init_instance_callback: function (editor) {\r\n editor.on('change', function (e) {\r\n tinymce.triggerSave();\r\n $('#' + e.target.id).valid();\r\n });\r\n }\r\n });\r\n\r\n //Hook hidden field into the validation\r\n //Tried setting this on the form on creation, on custom validators.... Would not bind correctly\r\n //This works the best out of kludge options\r\n var form = $(this.form);\r\n if (form != undefined) {\r\n //create the validator\r\n $.validator.unobtrusive.parse(form);\r\n //set validator options\r\n var validator = form.data('validator');\r\n if (validator !== undefined) {\r\n validator.settings.ignore =\r\n ':hidden:not([data-role~=\"richtext\"]),.mce-content-body';\r\n }\r\n }\r\n });\r\n },\r\n initAutocomplete: function (editComponent) {\r\n $('[data-role~=\"autocomplete\"]', editComponent).each(function () {\r\n var ac = $(this).AutoComplete();\r\n });\r\n app.Autocomplete.BindSetButtons(editComponent);\r\n },\r\n initCheckboxLists: function (el) {\r\n $('[type=\"checkbox\"][data-role~=\"selectall\"]', el).each(function () {\r\n $('[type=\"checkbox\"][name=\"' + $(this).attr('name') + '\"]').change(function () {\r\n if ($(this).attr('data-role') === 'selectall') {\r\n $('[type=\"checkbox\"][name=\"' + $(this).attr('name') + '\"]:visible').prop('checked', this.checked);\r\n\r\n } else {\r\n var selAll = $('[type=\"checkbox\"][data-role~=\"selectall\"][name=\"' + $(this).attr('name') + '\"]:visible');\r\n\r\n //check for all selected, or not all selected\r\n if (selAll.is(':checked')) {\r\n if (!this.checked) {\r\n selAll.prop('checked', this.checked);\r\n }\r\n } else {\r\n if ($('[type=\"checkbox\"][name=\"' + $(this).attr('name') + '\"]:not(:checked)').length === 1) {\r\n selAll.prop('checked', this.checked);\r\n }\r\n }\r\n }\r\n });\r\n });\r\n $(document).trigger('component-bindCheckboxLists', el);\r\n }\r\n };\r\n\r\n return myInput;\r\n}());\r\n\r\n$(function () {\r\n app.input.Init();\r\n});\r\n","//*************************************************************************************\r\n//* WaMS Component Framework - app.grid.js\r\n//* Version 0.2\r\n//* Author: Damian Koch\r\n//* Component framework grids plugin\r\n//* Requires jQuery, WaMS Component Framework\r\n//* \r\n//* This component adds some grid features. Any component with 'component-grid' in data-role\r\n//* will be checked for [data-role=\"sort-action\"] on sorting controls, and [data-role=\"filter-action\"]\r\n//* on filtering controls.\r\n//* \r\n//* 8/17 DBK Added server grid support.\r\n//* 3/12 WMK Added auto pull if active grid state and not client side filtering.\r\n//* 5/21/18 Huisenga [STUDYAB-828]: Fix active state, arrow key presses\r\n//* 12/18/18 BWH: Updates to filter grid timeouts\r\n//*************************************************************************************\r\n\r\napp.grids = (function () {\r\n var myGrids = {\r\n Init: function () {\r\n this.initGridComponents();\r\n this.initPageGridActions();\r\n $(document).on(\"component-init-complete\", function (e, component) { app.grids.initGridComponent(component); });\r\n $(document).on(\"component-action-init-complete\", function (e, component) { app.grids.initPageGridAction(component); });\r\n },\r\n initGridComponents: function () {\r\n\r\n //This entire mess can be cleaned up if components get identified by guid\r\n var gridComponents = new Array();\r\n $('[data-role~=\"component-grid\"]').each(function (i, gridElement) {\r\n gridComponents.push($(gridElement).data('component-type'));\r\n });\r\n gridComponents = $.unique(gridComponents);\r\n $.each(gridComponents, function (i, componentType) {\r\n var grids = app.page.allComponents[componentType];\r\n grids.forEach(function (grid) {\r\n app.grids.initGridComponent(grid);\r\n });\r\n });\r\n\r\n $(document).on(\"component-bind-view-mode-complete\", function (e, component) {\r\n //app.util.console.log(\"component-bind-view-mode-complete triggered: \" + component.type);\r\n if (component.el.data('role').indexOf('component-grid')) {\r\n $('[data-role=\"sort-action\"]', component.el).attr('tabindex', '0');\r\n $('[data-role=\"sort-action\"]', component.el).attr('role', 'button');\r\n $('[data-role=\"sort-action\"]', component.el).on('click', $.proxy(component.sortGrid, component));\r\n $('[data-role=\"dropdown-all\"]', component.el).on('change', $.proxy(component.changeAllDropdown, component));\r\n $('[data-role=\"textbox-all\"]', component.el).on('keyup', $.proxy(component.changeAllTextbox, component));\r\n $('[data-role=\"check-all\"]', component.el).on('click', $.proxy(component.checkAll, component));\r\n $('[data-role=\"sort-action\"]', component.el).keypress(function (e) {\r\n var code = e.key;\r\n if (code === \"Enter\" || code === \"Space\") {\r\n $(this).click();\r\n }\r\n });\r\n $('[data-role=\"grid-page-action\"]', component.el).on('click', $.proxy(component.pageGrid, component));\r\n //Not sure why this was here. Was added in Study Abroad.\r\n //app.input.initDatePicker(document);\r\n }\r\n });\r\n },\r\n initGridComponent: function (gridComponent) {\r\n gridComponent.selectors.table = 'table';\r\n gridComponent.selectors.filterForm = 'form[data-role~=\"filter-grid\"][data-component-form-target~=\"' + gridComponent.type + '\"]';\r\n gridComponent.selectors.pageSize = '[data-role~=\"grid-page-size\"][data-component-form-target=\"' + gridComponent.type + '\"]';\r\n gridComponent.selectors.showForResults = '[data-role~=\"grid-show-for-results\"][data-component-form-target~=\"' + gridComponent.type + '\"]';\r\n\r\n if ($('[data-role~=\"component\"]', gridComponent.el).length) {\r\n gridComponent.selectors.rows = 'tbody:not([data-component-role=\"noResults\"])';\r\n }\r\n else {\r\n gridComponent.selectors.rows = 'tbody > tr:not([data-component-role=\"noResults\"])';\r\n }\r\n\r\n gridComponent.gridType = gridComponent.el.data('grid-type') || 'client';\r\n\r\n if (gridComponent.gridType === 'client') {\r\n gridComponent.filterGrid = function () {\r\n var context = $(this.selectors.table, this.el);\r\n var rows = $(this.selectors.rows, context);\r\n\r\n rows.show();\r\n\r\n $(':input', this.selectors.filterForm).each(function (i, e) {\r\n var el = $(e);\r\n if (el.val() !== '') {\r\n var field;\r\n\r\n if (el.data('target')) {\r\n field = '[data-label=\"' + el.data('target') + '\"]';\r\n }\r\n else {\r\n field = '';\r\n }\r\n\r\n var values = el.val().toUpperCase().split(/\\s+/);\r\n rows.each(function (i, e) {\r\n var hide = false;\r\n\r\n $.each(values, function (index, v) {\r\n if ($(field + ':icontains(\"' + v + '\")', e).length < 1) {\r\n hide = true;\r\n return;\r\n }\r\n });\r\n if (hide) {\r\n $(e).hide();\r\n }\r\n });\r\n }\r\n });\r\n\r\n //showhide noresults\r\n //TODO: move selectors to selector params\r\n if ($(this.selectors.rows + ':visible', context).length) {\r\n $('[data-component-role=\"noResults\"]', context).hide();\r\n } else {\r\n $('[data-component-role=\"noResults\"]', context).show();\r\n }\r\n };\r\n gridComponent.pageGrid = function () {\r\n alert('do this!');\r\n };\r\n gridComponent.sortGrid = function (e) {\r\n var el = $(e.target);\r\n var context = $(this.selectors.table, this.el);\r\n var rows = $(this.selectors.rows, context).get();\r\n var sortDescending = el.hasClass('asc');\r\n var component = this;\r\n\r\n $('[data-role=\"sort-action\"]', context).removeClass('asc').removeClass('desc').removeAttr('aria-sort');\r\n\r\n rows = app.util.mergeSort(rows, el.data('target'));\r\n\r\n if (sortDescending) {\r\n el.addClass('desc');\r\n el.attr('aria-sort', 'descending');\r\n rows = rows.reverse();\r\n } else {\r\n\r\n el.addClass('asc');\r\n el.attr('aria-sort', 'ascending');\r\n\r\n }\r\n\r\n if (component.selectors.rows === 'tbody') {\r\n $.each(rows, function (index, row) {\r\n context.append(row);\r\n });\r\n }\r\n else {\r\n $.each(rows, function (index, row) {\r\n context.children('tbody').append(row);\r\n });\r\n }\r\n };\r\n $(gridComponent.selectors.filterForm).on('keydown', function () {\r\n switch (event.keyCode) {\r\n case 13:\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n });\r\n } else {\r\n gridComponent.filterGrid = function () { this.refreshGrid(); };\r\n gridComponent.pageGrid = function (e) {\r\n var page = $(e.target).data('page-value');\r\n this.refreshGrid(page);\r\n };\r\n gridComponent.sortGrid = function (e) {\r\n var el = $(e.target);\r\n var context = $(this.selectors.table, this.el);\r\n var sortDescending = el.hasClass('asc');\r\n\r\n $('[data-role=\"sort-action\"]', context).removeClass('asc').removeClass('desc').removeAttr('aria-sort');\r\n\r\n if (sortDescending) {\r\n el.addClass('desc');\r\n el.attr('aria-sort', 'descending');\r\n } else {\r\n el.addClass('asc');\r\n el.attr('aria-sort', 'ascending');\r\n }\r\n\r\n this.refreshGrid();\r\n };\r\n gridComponent.checkAll = function (e) {\r\n if ($(e.target).prop('checked')) {\r\n $(\"[name*='\" + $(e.target).data('name') + \"']\").prop('checked', true);\r\n }\r\n else {\r\n $(\"[name*='\" + $(e.target).data('name') + \"']\").prop('checked', false);\r\n }\r\n };\r\n gridComponent.changeAllDropdown = function (e) {\r\n $(\"[name*='\" + $(e.target).data('name') + \"']\").val($(e.target).val());\r\n };\r\n gridComponent.changeAllTextbox = function (e) {\r\n $(\"[name*='\" + $(e.target).data('name') + \"']\").val($(e.target).val());\r\n };\r\n gridComponent.refreshGrid = function (pageNumber,otherData) {\r\n $(document).trigger(\"component-filter-grid-started\", this);\r\n\r\n var form = $(this.selectors.filterForm);\r\n var pageSize = $(this.selectors.pageSize).val();\r\n var el = this.el;\r\n var context = $(this.selectors.table, this.el);\r\n\r\n //get filters\r\n var filters = form.serializeArray();\r\n var pageNum = pageNumber || 1;\r\n filters.push({ name: \"pageNumber\", value: pageNum });\r\n filters.push({ name: \"pageSize\", value: pageSize });\r\n filters.push({ name: \"sortField\", value: $('[aria-sort]', context).data('target') });\r\n filters.push({ name: \"isSortAscending\", value: $('[aria-sort]', context).length === 0 || $('[aria-sort]', context).attr('aria-sort') === 'ascending' });\r\n //This is an option that let's you pass in additional data to the refresh action.\r\n //This could be used to create records, do sorting, one time filters etc. Values are not persisted in the filter form.\r\n //otherData should be an array with objects as above (name/value)\r\n if (otherData) {\r\n filters = filters.concat(otherData);\r\n }\r\n this.startLoading();\r\n if (this.request != null) {\r\n this.request.abort();\r\n this.request = null;\r\n }\r\n this.request = $.ajax({ url: this.urls.view, data: $.param(filters), context: this, error: this.page.handleAjaxError, type: 'POST' }).done(function (data) {\r\n el.html(data);\r\n this.endLoading();\r\n this.bindViewMode();\r\n var forResults = $(this.selectors.showForResults);\r\n\r\n if (forResults) {\r\n if ($('.no-results', this.el).length) {\r\n forResults.hide();\r\n eval();\r\n } else {\r\n forResults.show();\r\n eval();\r\n }\r\n } \r\n });\r\n\r\n $(document).trigger(\"component-filter-grid-completed\", this);\r\n $(document).trigger(\"component-filter-grid-completed-\" + this.type, this);\r\n };\r\n }\r\n\r\n $(gridComponent.componentActions.report).each(function () {\r\n app.grids.initPageGridAction(this);\r\n });\r\n\r\n if (gridComponent.state === \"active\") {\r\n $('[data-role=\"sort-action\"]', gridComponent.el).on('click', $.proxy(gridComponent.sortGrid, gridComponent));\r\n $('[data-role=\"grid-page-action\"]', gridComponent.el).on('click', $.proxy(gridComponent.pageGrid, gridComponent));\r\n }\r\n //Prevent enter key and escape to prevent unintended form posts\r\n $('form[data-component-action=\"filtergrid\"] input, form[data-component-action=\"filtergrid\"] select').on('keydown', $.proxy(function () {\r\n switch (event.keyCode) {\r\n case 13:\r\n event.preventDefault();\r\n event.stopPropagation();\r\n break;\r\n case 27:\r\n event.preventDefault();\r\n event.stopPropagation();\r\n break;\r\n }\r\n }, this));\r\n },\r\n initPageGridActions: function () {\r\n if (app.page.componentActions.report) {\r\n app.page.componentActions.report.forEach(function (pageAction) {\r\n app.grids.initPageGridAction(pageAction);\r\n });\r\n }\r\n },\r\n initPageGridAction: function (pageAction) {\r\n switch (pageAction.action) {\r\n case \"filtergrid\":\r\n pageAction.triggerAction = function (e) {\r\n if (e.type !== \"keyup\" || app.util.isPrintableCharacter(e)) {\r\n var delay = 300;\r\n if (e.type !== \"keyup\") {\r\n delay = 0;\r\n }\r\n //if keyup, add a delay\r\n if (this.timeout !== null) { clearTimeout(this.timeout); }\r\n var that = this;\r\n this.timeout = setTimeout(function () {\r\n\r\n var theTargets = that.target.split(\" \");\r\n theTargets.forEach(function (theTarget) {\r\n var grids = this.app.page.allComponents[theTarget];\r\n grids.forEach(function (grid) {\r\n grid.filterGrid(e);\r\n });\r\n });\r\n\r\n }, delay, e, that);\r\n }\r\n };\r\n pageAction.el.off(pageAction.event).on(pageAction.event, $.proxy(pageAction.triggerAction, pageAction));\r\n break;\r\n case \"viewgridpage\":\r\n pageAction.triggerAction = function (e) {\r\n var target = this.page.components[this.target][0];\r\n target.filterGrid($(e.target).data('component-action-value'));\r\n };\r\n pageAction.el.off(pageAction.event).on(pageAction.event, $.proxy(pageAction.triggerAction, pageAction));\r\n break;\r\n }\r\n }\r\n };\r\n\r\n return myGrids;\r\n}());\r\n\r\n$(function () {\r\n app.grids.Init();\r\n});","//*************************************************************************************\r\n//* WaMS Component Framework - app.fileUpload.js\r\n//* Version 0.1\r\n//* Author: Huisenga\r\n//* Component framework file upload plugin\r\n//* Requires jQuery, WaMS Component Framework, fine uploader\r\n//* \r\n//* Component tags file upload elements and intiailizes them using fine uploader\r\n//* \r\n//*************************************************************************************\r\n//2/23/18 Huisenga [STUDYAB-339]: Added Binding for edit mode complete\r\n\r\napp.fileUploaders = (function () {\r\n var myUploaders = {\r\n Init: function () {\r\n this.initFileUploadComponents();\r\n },\r\n initFileUploadComponents: function () {\r\n $(document).on(\"component-bind-edit-mode-complete\", function (e, component) {\r\n $('[data-role~=\"file-Upload\"]', component.el).each(function (i, fileUploadElement) {\r\n app.fileUploaders.initFileUploadComponent(fileUploadElement);\r\n });\r\n });\r\n $('[data-role~=\"file-Upload\"]').each(function (i, fileUploadElement) {\r\n app.fileUploaders.initFileUploadComponent(fileUploadElement);\r\n });\r\n },\r\n initFileUploadComponent: function (fileUploadElement) {\r\n var multiUpload = $(fileUploadElement).data('multiupload') === \"True\";\r\n var allowedExtensions = $(fileUploadElement).data('allowedextensions');\r\n if (!allowedExtensions) {\r\n allowedExtensionArray = [];\r\n } else {\r\n allowedExtensionArray = allowedExtensions.split(',');\r\n }\r\n var sizeLimit = $(fileUploadElement).data('sizelimit');\r\n if (!sizeLimit) {\r\n sizeLimit = 0;\r\n }\r\n\r\n var uploader = new qq.FineUploader({\r\n debug: false,\r\n multiple: multiUpload,\r\n element: fileUploadElement,\r\n request: {\r\n endpoint: '/File/Upload'\r\n },\r\n deleteFile: {\r\n enabled: true,\r\n endpoint: '/File/Delete'\r\n },\r\n callbacks: {\r\n onStatusChange: function (id, oldStatus, newStatus) {\r\n var targetIdBase = $(this._options.element).data('target-id');\r\n if ($(this._options.element).data('multiupload') === \"True\") {\r\n var fileSet = $('#' + targetIdBase + '_fileset');\r\n if (newStatus === 'upload successful') {\r\n app.fileUploaders.UpdateFile(this, fileSet, id);\r\n }\r\n else {\r\n app.fileUploaders.RemoveFile(fileSet, id);\r\n }\r\n } else {\r\n if (newStatus === 'upload successful') {\r\n $('#' + targetIdBase + '_Guid').val(this.getUuid(id));\r\n $('#' + targetIdBase + '_Size').val(this.getSize(id));\r\n $('#' + targetIdBase + '_FileName').val(this.getName(id));\r\n\r\n $('.qq-upload-button-selector', $(this._options.element)).hide();\r\n }\r\n else {\r\n $('#' + targetIdBase + '_Guid').val('');\r\n $('#' + targetIdBase + '_Size').val('');\r\n $('#' + targetIdBase + '_FileName').val('');\r\n $('.qq-upload-button-selector', $(this._options.element)).show();\r\n }\r\n }\r\n }\r\n },\r\n thumbnails: {\r\n placeholders: {\r\n notAvailablePath: \"/Content/placeholders/not_available-generic.png\",\r\n waitingPath: \"/Content/placeholders/waiting-generic.png\"\r\n }\r\n },\r\n validation: {\r\n allowedExtensions: allowedExtensionArray,\r\n sizeLimit: sizeLimit\r\n },\r\n template: 'qq-simple-thumbnails-template'\r\n });\r\n if ($(\".initfile\", $(fileUploadElement)).length && !multiUpload){\r\n //has init file, but is single upload\r\n //hide button\r\n $('.qq-upload-button-selector', $(fileUploadElement)).hide();\r\n }\r\n $(\".initfile\", $(fileUploadElement)).each(function () {\r\n if ($(this).data('initialfile-uuid') !== \"\") {\r\n uploader.addInitialFiles([{\r\n name: $(this).data('initialfile-name'),\r\n uuid: $(this).data('initialfile-uuid'),\r\n thumbnailUrl: $(this).data('initialfile-thumbnailurl'),\r\n size: $(this).data('initialfile-size')\r\n }]);\r\n }\r\n });\r\n }\r\n\r\n };\r\n myUploaders.UpdateFile = function (file, el, id) {\r\n var fileElement = $('[data-index=\"'+id+'\"]', el);\r\n if (!fileElement.length) {\r\n var newTemplate = $('.file-template .filespec', el).clone();\r\n $('.templateField', newTemplate).each(function() {\r\n var name = $(this).attr('name');\r\n $(this).attr('name', name.replace('fileIndex', id));\r\n var idVal = $(this).attr('id');\r\n $(this).attr('id', idVal.replace('fileIndex', id));\r\n $(this).val('');\r\n });\r\n\r\n $('.file-index', newTemplate).val(id);\r\n //$('.templateValidation', newTemplate).each(function () {\r\n // var name = $(this).attr('data-valmsg-for');\r\n // $(this).attr('data-valmsg-for', name.replace('feeIndex', newIndex));\r\n //});\r\n\r\n newTemplate.attr('data-index', id);\r\n\r\n //enable the fields\r\n $('input', newTemplate).removeAttr('disabled');\r\n\r\n el.append(newTemplate);\r\n fileElement = newTemplate;\r\n }\r\n\r\n $('.file-guid', fileElement).val(file.getUuid(id));\r\n $('.file-size', fileElement).val(file.getSize(id));\r\n $('.file-name', fileElement).val(file.getName(id));\r\n\r\n\r\n //$(\"form\").data(\"unobtrusiveValidation\", null);\r\n //$(\"form\").data(\"validator\", null);\r\n //$.validator.unobtrusive.parse($(\"form\"));\r\n };\r\n\r\n myUploaders.RemoveFile = function (el, id) {\r\n $('[data-index=\"' + id + '\"]', el).remove();\r\n };\r\n return myUploaders;\r\n}());\r\n$(document).ready(function () {\r\n app.fileUploaders.Init();\r\n});\r\n","app.pagecontent = (function () {\r\n var myPageContent = {\r\n Init: function () {\r\n this.BindContentEditor(document);\r\n $(document).on('component-bind-edit-mode-complete', function (e, component) {\r\n app.pagecontent.BindContentEditor(component.el);\r\n });\r\n },\r\n BindContentEditor: function (el) {\r\n $('.pagecontent-placeholder',$(el)).on('click', function () {\r\n $.ajax({ url: '/Admin/Content/EditForm', data: { mnemonic: $(this).data('pagecontentmnemonic'), isTooltip : $(this).data('istooltip') }, context: this, error: app.page.handleAjaxError }).done(function (data) {\r\n $('#pageContentModal #pageContentForm').html(data);\r\n $('#pageContentModal').foundation('open');\r\n app.input.initTextEditor($('#pageContentModal'));\r\n });\r\n });\r\n }\r\n };\r\n return myPageContent;\r\n}());\r\n\r\n$(function () {\r\n app.pagecontent.Init();\r\n});","//*************************************************************************************\r\n//* WaMS Component Framework Autocomplete - app.autocomplete.js\r\n//* Version 0.12\r\n//* Author: Bret Huisenga\r\n//* Component framework autocomplete plugin\r\n//* Requires jQuery, WaMS Component Framework\r\n//* \r\n//* This component adds some grid features. Any component with 'component-grid' in data-role\r\n//* will be checked for [data-role=\"sort-action\"] on sorting controls, and [data-role=\"filter-action\"]\r\n//* on filtering controls.\r\n//* \r\n//* 7/07/22 Updates keypress event handler\r\n//*************************************************************************************\r\n//Variable to hold autocomplete objects\r\nvar AutocompleteObjects = {};\r\n\r\njQuery.fn.AutoComplete = function () {\r\n var searchIndex = $(this[0]).data(\"searchindex\");\r\n var autocompleteObject;\r\n if (searchIndex === undefined || searchIndex === \"\") {\r\n autocompleteObject = new app.Autocomplete($(this));\r\n }\r\n else {\r\n autocompleteObject = AutocompleteObjects[searchIndex];\r\n }\r\n\r\n return autocompleteObject;\r\n};\r\njQuery.fn.IsAutoComplete = function () {\r\n var searchIndex = $(this[0]).data(\"searchindex\");\r\n if (searchIndex === undefined || searchIndex === \"\") {\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n};\r\napp.Autocomplete = (function () {\r\n var myAutocomplete = function (e, options) {\r\n this.el = $(e);\r\n this.id = $(this.el).attr(\"id\");\r\n\r\n //Define properties for the object\r\n Object.defineProperties(this,\r\n {\r\n //active item, find the element in the result list with the autocomplete-item and active classes\r\n \"activeItem\": {\r\n \"get\": function () { return this.resultList.find(\".autocomplete-item.active\"); }\r\n },\r\n //result items, find all of the elements in the result list with the autocomplete-item class\r\n \"resultItems\": {\r\n \"get\": function () { return this.resultList.find(\".autocomplete-item\"); }\r\n },\r\n //search text, get the value of the object's search box\r\n \"searchText\": {\r\n \"get\": function () { return this.searchBox.val(); }\r\n }\r\n });\r\n //generate a random id for the search\r\n this.searchIndex = this.generateId();\r\n\r\n //default options configuration\r\n this.options = {\r\n cacheResults: true,\r\n endPoint: \"\",\r\n initialSelected: null,\r\n initialText: \"\",\r\n onSelect: function (selectedItem) { },\r\n outputField: \"\",\r\n placeholder: \"Start typing to search...\",\r\n searchMinLength: 3,\r\n replaceVal: true,\r\n template: \"
#= FirstName # #= LastName #
#= NetID #
\",\r\n filterType: \"server\",\r\n label: \"\",\r\n propertyName: \"\",\r\n multiSelect: false,\r\n multiSelectDelimiter: \"|\"\r\n };\r\n\r\n //merge the options with the user configured options\r\n this.options = $.extend({}, this.options, options);\r\n\r\n //populate data attribute options\r\n if (this.el.data(\"autocomplete-cacheresults\") !== \"\" && this.el.data(\"autocomplete-cacheresults\") !== undefined) {\r\n this.options.cacheResults = this.el.data(\"autocomplete-cacheresults\");\r\n }\r\n if (this.el.data(\"autocomplete-endpoint\")) {\r\n this.options.endPoint = this.el.data(\"autocomplete-endpoint\");\r\n }\r\n if (this.el.data(\"autocomplete-initialtext\")) {\r\n this.options.initialText = this.el.data(\"autocomplete-initialtext\");\r\n }\r\n if (this.el.data(\"autocomplete-outputfield\")) {\r\n this.options.outputField = this.el.data(\"autocomplete-outputfield\");\r\n }\r\n if (this.el.data(\"autocomplete-placeholder\") !== \"undefined\") {\r\n this.options.placeholder = this.el.data(\"autocomplete-placeholder\");\r\n }\r\n if (this.el.data(\"autocomplete-searchminlength\") !== \"\" && this.el.data(\"autocomplete-searchminlength\") !== undefined) {\r\n this.options.searchMinLength = this.el.data(\"autocomplete-searchminlength\");\r\n }\r\n if (this.el.data(\"autocomplete-replaceval\") !== \"\" && this.el.data(\"autocomplete-replaceval\") !== undefined) {\r\n this.options.replaceVal = this.el.data(\"autocomplete-replaceval\");\r\n }\r\n if (this.el.data(\"autocomplete-template\")) {\r\n this.options.template = this.el.data(\"autocomplete-template\");\r\n }\r\n if (this.el.data(\"autocomplete-additionaldataselector\")) {\r\n this.options.additionaldataselector = this.el.data(\"autocomplete-additionaldataselector\");\r\n }\r\n if (this.el.data(\"autocomplete-filtertype\")) {\r\n this.options.filterType = this.el.data(\"autocomplete-filtertype\");\r\n }\r\n if (this.el.data(\"autocomplete-label\")) {\r\n this.options.label = this.el.data(\"autocomplete-label\");\r\n }\r\n if (this.el.data(\"autocomplete-property-name\")) {\r\n app.util.console.log(`setting property name: ${this.el.data(\"autocomplete-property-name\")}`);\r\n this.options.propertyName = this.el.data(\"autocomplete-property-name\");\r\n }\r\n if (this.el.data(\"autocomplete-multiselect\") !== \"\" && this.el.data(\"autocomplete-multiselect\") !== undefined) {\r\n //app.util.console.log(`setting property name: ${this.el.data('autocomplete-property-name')}`);\r\n this.options.multiSelect = this.el.data(\"autocomplete-multiselect\");\r\n }\r\n if (this.el.data(\"autocomplete-multiselect-delimiter\")) {\r\n this.options.multiSelectDelimiter = this.el.data(\"autocomplete-multiselect-delimiter\");\r\n }\r\n // plugin implementation\r\n this.selected = null;\r\n this.outputText = null;\r\n this.displayText = null;\r\n this.cache = {};\r\n\r\n //init new object\r\n this.init();\r\n\r\n //Log item\r\n AutocompleteObjects[this.searchIndex] = this;\r\n };\r\n\r\n myAutocomplete.prototype.init = function () {\r\n // check if input and alert if not\r\n if (!this.el.is(\"input\")) {\r\n app.util.console.error(\"Error: The autocomplete feature can only be used on inputs with type set to text.\");\r\n return;\r\n }\r\n //Log the searchIndex\r\n this.el.attr(\"data-searchIndex\", this.searchIndex);\r\n\r\n //init\r\n this.container = $(\"
\");\r\n this.container.addClass(\"autocomplete-container\");\r\n\r\n this.el.after(this.container);\r\n //add multiselect container\r\n this.resultsBox = $(\"
\");\r\n this.resultsBox.addClass(\"autocomplete-selected-container\");\r\n this.container.append(this.resultsBox);\r\n //create search box\r\n this.searchBox = $(\"\");\r\n // set accessibility tags\r\n this.searchBox.attr(\"type\", \"text\");\r\n this.searchBox.attr(\"placeholder\", this.options.placeholder);\r\n this.searchBox.attr(\"role\", \"combobox\");\r\n this.searchBox.attr(\"aria-autocomplete\", \"both\");\r\n this.searchBox.attr(\"aria-haspopup\", \"true\");\r\n this.searchBox.attr(\"aria-owns\", \"search-\" + this.searchIndex + \"-results\");\r\n this.searchBox.attr(\"aria-expanded\", \"false\");\r\n this.searchBox.attr(\"aria-label\", this.options.label);\r\n this.searchBox.attr(\"id\", \"search-\" + this.searchIndex);\r\n\r\n this.container.append(this.searchBox);\r\n\r\n //add announcement for notifying screen readers of changes\r\n this.announcement = $(\"
\");\r\n this.announcement.addClass(\"autocomplete-announcement\");\r\n this.announcement.attr(\"aria-live\", \"assertive\");\r\n\r\n this.container.append(this.announcement);\r\n\r\n this.resultList = $('
');\r\n this.container.append(this.resultList);\r\n //this.el.attr('type', 'hidden');\r\n this.el.addClass(\"autocomplete-hide\");\r\n this.el.attr(\"tabindex\", -1);\r\n\r\n //Bind actions\r\n //Bind Focus\r\n this.searchBox.on(\"focus\", $.proxy(this.onFocus, this));\r\n // close drop down when clicking away\r\n this.searchBox.on(\"blur\", $.proxy(this.onBlur, this));\r\n // this is mostly navigation support\r\n //TODO: INPUT OR KEYUP\r\n this.searchBox.on(\"keyup\", $.proxy(this.onKeyPress, this));\r\n // bind search\r\n this.searchBox.on(\"input propertychange paste\", $.proxy(this.onInput, this));\r\n\r\n // stop all default behavior when the user hits enter, up arrow and down arrow\r\n this.searchBox.on(\"keydown keypress\",\r\n function (event) {\r\n //up and down are IE/Edge specific values\r\n var keysToCancel = [\"Enter\", \"Up\", \"ArrowUp\", \"Down\", \"ArrowDown\"];\r\n //up arrow moves active up\r\n if (keysToCancel.includes(event.key)) {\r\n event.preventDefault();\r\n }\r\n });\r\n\r\n\r\n // Bind click event to list elements in results\r\n this.resultList.on(\"mousedown\", \"div.autocomplete-item\", $.proxy(this.selectItem, this));\r\n this.resultList.on({\r\n\r\n mousemove: function () {\r\n $(this).siblings().removeClass(\"active\");\r\n $(this).addClass(\"active\");\r\n },\r\n mouseleave: function (e) {\r\n $(this).removeClass(\"active\");\r\n }\r\n },\r\n \"div.autocomplete-item\");\r\n\r\n //init selected value\r\n\r\n\r\n if (this.options.multiSelect) {\r\n\r\n if (this.el.val()) {\r\n var jsonResult;\r\n try {\r\n jsonResult = JSON.parse(this.el.val());\r\n }\r\n catch (e) {\r\n app.util.console.error(`Error parsing Multiselect JSON: ${e}`);\r\n };\r\n if (jsonResult) {\r\n var autoComplete = this;\r\n $.each(jsonResult, function (i, item) {\r\n autoComplete.setValue(item.DisplayText,item.OutputText);\r\n });\r\n }\r\n }\r\n } else {\r\n if (this.options.initialSelected !== null) {\r\n\r\n this.activeItem = this.populateTemplate(this.initialSelected);\r\n this.selectItem();\r\n //this.searchBox.val(template.find('.display-text').text().trim());\r\n //this.el.val(template.find('.output-text').text().trim());\r\n //this.selected = this.initialSelected;\r\n //this.setValue(displayText, outputText, itemData);\r\n\r\n } else if (this.options.initialText !== \"\") {\r\n var outputText = this.el.val();\r\n if (!outputText) {\r\n outputText = this.options.initialText;\r\n }\r\n this.setValue(this.options.initialText, outputText);\r\n //this.searchBox.val(this.options.initialText);\r\n //this.selected = { text: this.options.initialText };\r\n } else if (this.el.val()) {\r\n this.setValue(this.el.val(), this.el.val());\r\n //this.searchBox.val(this.el.val());\r\n //this.selected = { text: this.el.val() };\r\n }\r\n }\r\n };\r\n\r\n myAutocomplete.prototype.onBlur = function () {\r\n this.emptyResultList();\r\n if (this.selected === null) {\r\n if (this.options.replaceVal) {\r\n this.searchBox.val(\"\");\r\n\r\n // trigger the change on the text box in case anyone is listening\r\n this.el.trigger(\"change\");\r\n } else {\r\n this.el.val(this.searchText);\r\n }\r\n }\r\n };\r\n myAutocomplete.prototype.onFocus = function () {\r\n if (this.searchText.length === 0 && this.options.searchMinLength === 0) {\r\n this.search();\r\n }\r\n };\r\n myAutocomplete.prototype.onKeyPress = function (event) {\r\n //reset selected\r\n var keyID = event.key;\r\n app.util.console.log(\"keypress:\" + keyID);\r\n // handle keyboard controls\r\n switch (event.key) {\r\n case \"Escape\":\r\n // ESC closes list\r\n this.hideResultList();\r\n break;\r\n case \"Enter\":\r\n // Enter selects active item\r\n if (this.activeItem.length)\r\n this.selectItem();\r\n break;\r\n case \"ArrowUp\":\r\n case \"Up\":\r\n // up arrow moves active up\r\n this.navigateUp();\r\n break;\r\n case \"ArrowDown\":\r\n case \"Down\":\r\n // down arrow moves active down\r\n this.navigateDown();\r\n break;\r\n }\r\n };\r\n myAutocomplete.prototype.onInput = function (event) {\r\n //reset selected\r\n this.selected = {};\r\n var keyID = event.key;\r\n app.util.console.log(\"change:\" + keyID);\r\n // Check if search should happen\r\n if (this.searchText.length >= this.options.searchMinLength) {\r\n this.search();\r\n }\r\n //Handle backspace/delete so results don't remain with less than specified characters\r\n else if (this.resultList.length > 0) {\r\n this.resetSearchList();\r\n }\r\n };\r\n myAutocomplete.prototype.search = function () {\r\n this.resetSearchList();\r\n\r\n // show loading image and notify users\r\n this.announcement.text(\"Loading results.\");\r\n this.searchBox.addClass(\"autocomplete-ajax-loading\");\r\n\r\n //Check if we've searched for this term before\r\n if (this.options.cacheResults && this.searchText in this.cache) {\r\n this.populateList(this.cache[this.searchText]);\r\n }\r\n else {\r\n if (this.options.filterType === \"client\") {\r\n if (this.clientSideDataOptions === undefined) {\r\n //get the values from somewhere\r\n this.getClientSideResults($.proxy(this.filterClientSideResults, this));\r\n } else {\r\n //filter\r\n //set\r\n this.filterClientSideResults();\r\n }\r\n }\r\n else {\r\n\r\n this.searchBox.addClass(\"autocomplete-ajax-loading\");\r\n\r\n //Check if we've searched for this term before\r\n clearTimeout(this.delayTimer);\r\n this.delayTimer = setTimeout($.proxy(function () {\r\n this.getResults();\r\n },\r\n this),\r\n 500);\r\n }\r\n }\r\n };\r\n myAutocomplete.prototype.getResults = function () {\r\n var data = { searchText: this.searchText };\r\n\r\n var customData = app.util.getCustomData(this.el);\r\n if (customData) {\r\n data = { ...data, ...customData };\r\n }\r\n if (this.options.additionaldataselector !== undefined && $(this.options.additionaldataselector).length) {\r\n var formData = app.app.util.getFormValues($(this.options.additionaldataselector));\r\n data = { ...data, ...formData }\r\n }\r\n if (this.request != null) {\r\n this.request.abort();\r\n this.request = null;\r\n }\r\n this.request = $.ajax({ url: window.applicationPath + this.options.endPoint, data: data, dataType: \"json\", context: this, error: app.page.handleAjaxError }).done(function (data) {\r\n\r\n //Add results to cache\r\n this.cache[this.searchText] = data;\r\n\r\n //add results to shown list\r\n this.populateList(data);\r\n });\r\n };\r\n myAutocomplete.prototype.getClientSideResults = function (callback) {\r\n\r\n this.request = $\r\n .ajax({\r\n url: window.applicationPath + this.options.endPoint,\r\n dataType: \"json\",\r\n context: this,\r\n error: app.page.handleAjaxError\r\n }).done(function (data) {\r\n\r\n //Add results to cache\r\n this.clientSideDataOptions = data;\r\n if (callback) {\r\n callback();\r\n }\r\n });\r\n\r\n }\r\n myAutocomplete.prototype.filterClientSideResults = function () {\r\n var filteredData = [];\r\n var cleanSearch = this.searchText.trim().toLowerCase();\r\n\r\n if (this.clientSideDataOptions.length > 0) {\r\n var keys = Object.keys(this.clientSideDataOptions[0]);\r\n\r\n //For each client side option get the index\r\n for (var index in this.clientSideDataOptions) {\r\n //find the object\r\n var result = this.clientSideDataOptions[index];\r\n if (cleanSearch.length > 0) {\r\n //for each search key\r\n for (var i = 0; i < keys.length; i++) {\r\n //if the filtered data list does not have the object\r\n if (filteredData.indexOf(result) === -1) {\r\n var propName = keys[i];\r\n //if there is a search text\r\n //only add items that match\r\n if (result[propName].toString().trim().toLowerCase().indexOf(cleanSearch) !== -1) {\r\n filteredData.push(result);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n //add all item\r\n filteredData.push(result);\r\n }\r\n }\r\n }\r\n //Add results to cache\r\n this.cache[this.searchText] = filteredData;\r\n //add results to shown list\r\n this.populateList(filteredData);\r\n }\r\n myAutocomplete.prototype.populateList = function (results) {\r\n this.emptyResultList();\r\n //update accessibility announcement\r\n if (results.length > 0) {\r\n this.announcement.text(results.length + \" records found, use up and down arrows to review\");\r\n } else {\r\n this.announcement.text(results.length + \" records found.\");\r\n }\r\n\r\n //Add results to the list\r\n for (var i = 0; i < results.length; i++) {\r\n app.util.console.log(this.populateTemplate(results[i]));\r\n //populate template\r\n var populatedTemplate = this.populateTemplate(results[i]);\r\n this.resultList.append(\"
\" +\r\n populatedTemplate +\r\n \"
\");\r\n }\r\n if (results.length === 1) {\r\n this.resultList.append(\"
Showing top record.
\");\r\n } else if (results.length > 0) {\r\n this.resultList.append(\"
Showing top \" + results.length + \" records.
\");\r\n } else {\r\n this.resultList.append(\"
No records found.
\");\r\n }\r\n this.showResultList();\r\n\r\n this.searchBox.removeClass(\"autocomplete-ajax-loading\");\r\n };\r\n\r\n //Populate the template with the data provided\r\n myAutocomplete.prototype.populateTemplate = function (result) {\r\n app.util.console.log(result);\r\n var personOption = this.options.template;\r\n //Loop through each key in the list, and replace with the identifier\r\n for (var key in result) {\r\n const re = new RegExp(\"#=[ ]*\" + key + \"[ ]*#\", \"gi\");\r\n personOption = personOption.replace(re, result[key]);\r\n }\r\n\r\n //Remove all missing identifiers\r\n const cleanupRe = new RegExp(\"#=.*?#\", \"g\");\r\n personOption = personOption.replace(cleanupRe, \"\");\r\n\r\n //Add the output field\r\n if (this.options.outputField !== \"\" && typeof result[this.options.outputField] !== \"undefined\") {\r\n personOption += '';\r\n }\r\n return personOption;\r\n };\r\n\r\n myAutocomplete.prototype.selectItem = function () {\r\n var displayText = this.activeItem.find(\".display-text\").text().trim();\r\n\r\n //output selected value\r\n var outputText = this.activeItem.find(\".output-text\").val();\r\n\r\n var itemData = this.activeItem.data(\"item-data\");\r\n\r\n this.setValue(displayText, outputText, itemData);\r\n\r\n };\r\n myAutocomplete.prototype.UpdateSelectedValues = function() {\r\n if (this.options.multiSelect) {\r\n var objects = new Array();\r\n $.each($(\".autocomplete-multiselect-data\", this.resultsBox), function (i, item) {\r\n objects.push({\r\n outputText: $(\".autocomplete-multiselect-outputtext\",item).val(),\r\n displayText: $(\".autocomplete-multiselect-displaytext\",item).val()\r\n });\r\n });\r\n var results = JSON.stringify(objects);\r\n this.el.val(results);\r\n }\r\n }\r\n myAutocomplete.prototype.setValue = function (displayText, outputText, itemData) {\r\n if (itemData) {\r\n this.selected = itemData;\r\n } else {\r\n this.selected = { displayText: displayText,outputText: outputText };\r\n }\r\n if (this.options.multiSelect) {\r\n\r\n var newItem = $('').text(displayText||outputText);\r\n var identifier = this.generateId();\r\n var propertyName = this.options.propertyName;\r\n var removeButton =\r\n $(``);\r\n newItem.append(removeButton);\r\n var hiddenValueWrapper = $(\"
\", { class: \"autocomplete-multiselect-data\" });\r\n newItem.append(hiddenValueWrapper);\r\n \r\n var index = $(``);\r\n hiddenValueWrapper.append(index);\r\n var value = $(``);\r\n hiddenValueWrapper.append(value);\r\n var displayText = $(\r\n ``);\r\n hiddenValueWrapper.append(displayText);\r\n var itemDataField = $(\r\n ``);\r\n hiddenValueWrapper.append(itemDataField);\r\n\r\n\r\n\r\n this.resultsBox.append(newItem);\r\n var updateFunction = $.proxy(this.UpdateSelectedValues, this) ;\r\n removeButton.click(function(e) {\r\n e.preventDefault();\r\n newItem.remove();\r\n updateFunction();\r\n });\r\n\r\n this.searchBox.val(\"\");\r\n this.UpdateSelectedValues();\r\n } else {\r\n\r\n this.searchBox.val(displayText);\r\n if (outputText) {\r\n //output selected value\r\n this.el.val(outputText);\r\n } else {\r\n //output display value\r\n this.el.val(displayText);\r\n }\r\n }\r\n\r\n this.emptyResultList();\r\n this.options.onSelect.call(this.selected);\r\n\r\n $(document).trigger(\"component-autocomplete-selected\", this);\r\n $(document).trigger(\"component-autocomplete-selected-\" + this.id, this);\r\n app.util.console.log(`component-autocomplete-selected triggered: ${this.id}`);\r\n\r\n //trigger the change on the text box in case anyone is listening\r\n this.el.trigger(\"change\");\r\n };\r\n\r\n myAutocomplete.prototype.clearSelectItem = function () {\r\n if (this.options.replaceVal) {\r\n this.el.val(\"\");\r\n }\r\n this.selected = null;\r\n this.emptyResultList();\r\n this.options.onSelect.call(this.selected);\r\n\r\n $(document).trigger(\"component-autocomplete-selectcleared\", this);\r\n $(document).trigger(\"component-autocomplete-selectcleared-\" + this.id, this);\r\n\r\n $(document).trigger(\"component-autocomplete-selected\", this);\r\n $(document).trigger(\"component-autocomplete-selected-\" + this.id, this);\r\n };\r\n\r\n myAutocomplete.prototype.resetSearchList = function () {\r\n this.emptyResultList();\r\n this.clearSelectItem();\r\n };\r\n\r\n myAutocomplete.prototype.showResultList = function () {\r\n this.resultList.addClass(\"active\");\r\n this.resultList.scrollTop(0);\r\n this.searchBox.attr(\"aria-expanded\", \"true\");\r\n //Using the result list to display the record count/ no record message\r\n //if (this.resultList.find('div.autocomplete-item').length > 0) {\r\n // this.resultList.addClass('active');\r\n //} else {\r\n // this.hideResultList();\r\n //}\r\n };\r\n myAutocomplete.prototype.hideResultList = function () {\r\n this.resultList.removeClass(\"active\");\r\n this.searchBox.attr(\"aria-expanded\", \"false\");\r\n };\r\n myAutocomplete.prototype.emptyResultList = function () {\r\n this.hideResultList();\r\n this.resultList.empty();\r\n };\r\n\r\n myAutocomplete.prototype.navigateUp = function () {\r\n if (this.activeItem.length) {\r\n var index = this.resultItems.index(this.activeItem);\r\n this.activeItem.removeClass(\"active\");\r\n this.activeItem.removeAttr(\"aria-selected\");\r\n var newActiveIndex = index - 1;\r\n if (index > -1) {\r\n this.resultItems.eq(newActiveIndex).addClass(\"active\");\r\n this.resultItems.eq(newActiveIndex).attr(\"aria-selected\", \"true\");\r\n this.searchBox.attr(\"aria-activedescendant\", this.resultItems.eq(newActiveIndex).attr(\"id\"));\r\n this.resultItems.eq(newActiveIndex)[0].scrollIntoView({ block: \"nearest\", inline: \"start\" });\r\n\r\n }\r\n } else {\r\n // set the first element active\r\n this.resultItems.first().addClass(\"active\");\r\n this.resultItems.first().attr(\"aria-selected\", \"true\");\r\n this.searchBox.attr(\"aria-activedescendant\", this.resultItems.first().attr(\"id\"));\r\n this.resultList.scrollTop(0);\r\n }\r\n };\r\n myAutocomplete.prototype.navigateDown = function () {\r\n if (this.activeItem.length && this.resultItems.index(this.activeItem) < this.resultItems.length - 1) {\r\n var index = this.resultItems.index(this.activeItem);\r\n this.activeItem.removeClass(\"active\");\r\n this.activeItem.removeAttr(\"aria-selected\");\r\n var newActiveIndex = index + 1;\r\n if (index < this.resultItems.length) {\r\n this.resultItems.eq(newActiveIndex).addClass(\"active\");\r\n this.resultItems.eq(newActiveIndex).attr(\"aria-selected\", \"true\");\r\n this.searchBox.attr(\"aria-activedescendant\", this.resultItems.eq(newActiveIndex).attr(\"id\"));\r\n this.resultItems.eq(newActiveIndex)[0].scrollIntoView({ block: \"nearest\", inline: \"start\" });\r\n\r\n }\r\n } else {\r\n //set the first element active\r\n this.resultItems.first().addClass(\"active\");\r\n this.resultItems.first().siblings().removeClass(\"active\");\r\n this.resultItems.first().attr(\"aria-selected\", \"true\");\r\n this.searchBox.attr(\"aria-activedescendant\", this.resultItems.first().attr(\"id\"));\r\n this.resultList.scrollTop(0);\r\n }\r\n };\r\n\r\n myAutocomplete.prototype.generateId = function () {\r\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g,\r\n function (c) {\r\n var r = Math.random() * 16 | 0, v = c == \"x\" ? r : (r & 0x3 | 0x8);\r\n return v.toString(16);\r\n });\r\n };\r\n return myAutocomplete;\r\n}());\r\n\r\napp.Autocomplete.BindSetButtons = function (el) {\r\n $('[data-autocomplete-action=\"set\"]', el).on(\"click\",\r\n function () {\r\n var action = $(this);\r\n $(\"#\" + action.data(\"autocomplete-target\")).AutoComplete().setValue(action.data(\"autocomplete-set-text\"), action.data(\"autocomplete-set-value\"));\r\n });\r\n};\r\n","//*************************************************************************************\r\n//* WaMS Custom Validators\r\n//* Version 1.0\r\n//* Author: Damian Koch\r\n//* JavaScript component of custom ComponentModel.DataAnnotations.ValidationAttribute\r\n//* Adds client-side support of RequiredIf, and ValidYearDuration\r\n//* Requires jQuery, jQuery.validate, jQuery.validate.unobtrusive\r\n//*************************************************************************************\r\njQuery(function () {\r\n jQuery.validator.addMethod('validyearduration', function (value, element, params) {\r\n if (value < 0) {\r\n return false;\r\n }\r\n return true;\r\n }, '');\r\n\r\n jQuery.validator.unobtrusive.adapters.add('validyearduration', function (options) {\r\n options.rules['validyearduration'] = {};\r\n options.messages['validyearduration'] = options.message;\r\n });\r\n\r\n jQuery.validator.addMethod('requiredif', function (value, element, parameters) {\r\n var name = '[name=\"' + parameters['dependentproperty'] + '\"]';\r\n // get the target value (as a string, as that's what actual value will be)\r\n var targetvalue = parameters['targetvalue'];\r\n targetvalue = (targetvalue == null ? '' : targetvalue).toString();\r\n\r\n // get the actual value of the target control note - this probably needs to cater for more control types, e.g. radios\r\n var control = $(name, element.closest('form'));\r\n var controltype = control.attr('type');\r\n var actualvalue = controltype === 'checkbox' ? control.attr('checked').toString() : control.val();\r\n\r\n // if the condition is true, reuse the existing required field validator functionality\r\n if (targetvalue === actualvalue) return $.validator.methods.required.call(this, value, element, parameters);\r\n\r\n return true;\r\n });\r\n\r\n jQuery.validator.unobtrusive.adapters.add('requiredif', ['dependentproperty', 'targetvalue'], function (options) {\r\n options.rules['requiredif'] = { dependentproperty: options.params['dependentproperty'], targetvalue: options.params['targetvalue'] };\r\n options.messages['requiredif'] = options.message;\r\n });\r\n\r\n}(jQuery));\r\n\r\n","\r\napp.ipaddress = (function () {\r\n var IPAddress = {\r\n init: function () {\r\n $(document).on('click', '[data-role=\"assign-address\"]', function () {\r\n $(this).html(\"Assigning...\" + $('[data-role=\"loading-gif\"]').parent().html());\r\n $('[data-role=\"loading-gif\"]', this).show();\r\n $(this).attr('disabled', 'disabled');\r\n $(this).css('background-color', 'white');\r\n $(this).css('color', '#c5050c');\r\n });\r\n }\r\n };\r\n return IPAddress;\r\n})"]}