PageSourceSearch

https://members.acli.com/bundles/acliScripts?v=ingYGm3b9skMFDjxqovMFabIt4BYwUyIZgh3aWEbrgM1

js acli.com collected 2026-10-02 05:04:18 UTC 58,823 bytes, 1,231 lines download raw bytes

1/* Minification failed. Returning unminified contents.
2(100,51-52): run-time error JS1195: Expected expression: >
3(105,6-7): run-time error JS1195: Expected expression: )
4(133,42-43): run-time error JS1195: Expected expression: >
5(137,6-7): run-time error JS1195: Expected expression: )
6(466,45-46): run-time error JS1100: Expected ',': =
7(545,41-42): run-time error JS1100: Expected ',': =
8(545,55-56): run-time error JS1002: Syntax error: ,
9(545,67-68): run-time error JS1100: Expected ',': =
10(811,54-55): run-time error JS1195: Expected expression: >
11(811,76-77): run-time error JS1004: Expected ';': )
12(813,9-37): run-time error JS1033: Expected 'catch': CustomResultsPerPageDropdown
13(833,5-6): run-time error JS1002: Syntax error: }
14(859,53-54): run-time error JS1195: Expected expression: >
15(859,74-75): run-time error JS1004: Expected ';': )
16(860,9-10): run-time error JS1002: Syntax error: }
17(862,75-76): run-time error JS1195: Expected expression: )
18(862,77-78): run-time error JS1004: Expected ';': {
19(911,5-6): run-time error JS1002: Syntax error: }
20(912,11-12): run-time error JS1002: Syntax error: }
21(915,20-21): run-time error JS1010: Expected identifier: (
22(919,6-7): run-time error JS1195: Expected expression: ,
23(920,5-17): run-time error JS1197: Too many errors. The file might not be a JavaScript file: getEmployees
24 */
25var acli = {};
26
27acli.AllPages = {
28		init: function() {
29        jQuery(document)
30            .ready(function() {
31					acli.AllPages.setNavigation();
32				});
33		},
34		setNavigation: function() {
35			var path = window.location.pathname;
36			path = path.replace(/\/$/, "");
37			path = decodeURIComponent(path);
38
39			if (path === "") {
40                jQuery(".nav a li:first").addClass('active');
41			} else {
42				jQuery(".nav a").each(function() {
43                    var href = "" + jQuery(this).attr('href');
44
45					if (path.substring(0, href.length) === href && href !== "/") {
46                        jQuery(this).closest('li').addClass('active');
47						return false;
48					}
49
50					return true;
51				});
52			}
53		}
54	}
55;
56/**
57 * ++++++++++++++++++++++
58 * Add-to-Calendar Button
59 * ++++++++++++++++++++++
60 */
61const atcbVersion = '1.4.1';
62/* Creator: Jens Kuerschner (https://jenskuerschner.de)
63 * Project: https://github.com/jekuer/add-to-calendar-button
64 * License: MIT with “Commons Clause” License Condition v1.0
65 * 
66 */
67
68
69
70// INITIALIZE THE SCRIPT AND FUNCTIONALITY
71function atcb_init() {
72    // let's get started
73    console.log("add-to-calendar button initialized (version " + atcbVersion + ")");
74    console.log("See https://github.com/jekuer/add-to-calendar-button for details");
75    // get all placeholders
76    let atcButtons = document.querySelectorAll('.atcb');
77    // if there are some, move on
78    if (atcButtons.length > 0) {
79        // get the amount of already initialized ones first
80        let atcButtonsInitialized = document.querySelectorAll('.atcb_initialized');
81        // generate the buttons one by one
82        for (let i = 0; i < atcButtons.length; i++) {
83            // skip already initialized ones
84            if (atcButtons[i].classList.contains('atcb_initialized')) {
85                continue;
86            }
87            let atcbConfig;
88            // check if schema.org markup is present
89            let schema = atcButtons[i].querySelector('script');
90            // get their JSON content first
91            if (schema && schema.innerHTML) {
92                // get schema.org event markup and flatten the event block
93                atcbConfig = JSON.parse(schema.innerHTML);
94                atcbConfig = atcb_clean_schema_json(atcbConfig);
95                // set flag to not delete HTML content later
96                atcbConfig['deleteJSON'] = false;
97            } else {
98                // get JSON from HTML block
99                atcbConfig = JSON.parse(atcButtons[i].innerHTML);
100                // set flag to delete HTML content later
101                atcbConfig['deleteJSON'] = true;
102            }
103            // rewrite config for backwards compatibility - you can remove this, if you did not use this script before v1.4.0.
104            atcbConfig = atcb_rewrite_config(atcbConfig);
105            // check, if all required data is available
106            if (atcb_check_required(atcbConfig)) {
107                // calculate the real date values in case that there are some special rules included (e.g. adding days dynamically)
108                atcbConfig['startDate'] = atcb_date_calculation(atcbConfig['startDate']);
109                atcbConfig['endDate'] = atcb_date_calculation(atcbConfig['endDate']);
110                // validate the JSON ...
111                if (atcb_validate(atcbConfig)) {
112                    // ... and generate the button on success
113                    atcb_generate(atcButtons[i], i + atcButtonsInitialized.length, atcbConfig);
114                }
115            }
116        }
117    }
118}
119
120
121
122// CLEAN/NORMALIZE JSON FROM SCHEMA.ORG MARKUP
123function atcb_clean_schema_json(atcbConfig) {
124    Object.keys(atcbConfig['event']).forEach(key => {
125        // move entries one level up, but skip schema types
126        if (key.charAt(0) !== '@') {
127            atcbConfig[key] = atcbConfig['event'][key];
128        }
129    });
130    // clean schema date+time format
131    const endpoints = ['start', 'end'];
132    endpoints.forEach(function (point) {
133        if (atcbConfig[point + 'Date'] != null) {
134            let tmpSplitStartDate = atcbConfig[point + 'Date'].split('T');
135            if (tmpSplitStartDate[1] != null) {
136                atcbConfig[point + 'Date'] = tmpSplitStartDate[0];
137                atcbConfig[point + 'Time'] = tmpSplitStartDate[1];
138            }
139        }
140    });
141    // drop the event block and return
142    delete atcbConfig.event;
143    return atcbConfig;
144}
145
146
147
148// BACKWARDS COMPATIBILITY REWRITE - you can remove this, if you did not use this script before v1.4.0.
149function atcb_rewrite_config(atcbConfig) {
150    const keyChanges = {
151        'title': 'name',
152        'dateStart': 'startDate',
153        'dateEnd': 'endDate',
154        'timeStart': 'startTime',
155        'timeEnd': 'endTime',
156    };
157    Object.keys(keyChanges).forEach(key => {
158        if (atcbConfig[keyChanges[key]] == null && atcbConfig[key] != null) {
159            atcbConfig[keyChanges[key]] = atcbConfig[key];
160        }
161    });
162    return atcbConfig;
163}
164
165
166
167// CHECK FOR REQUIRED FIELDS
168function atcb_check_required(data) {
169    // check for at least 1 option
170    if (data['options'] == null || data['options'].length < 1) {
171        console.log("add-to-calendar button generation failed: no options set");
172        return false;
173    }
174    // check for min required data (without "options")
175    const requiredField = ['name', 'startDate', 'endDate']
176    return requiredField.every(function (field) {
177        if (data[field] == null || data[field] == "") {
178            console.log("add-to-calendar button generation failed: required setting missing [" + field + "]");
179            return false;
180        }
181        return true;
182    });
183}
184
185
186
187// CALCULATE AND CLEAN UP THE ACTUAL DATES
188function atcb_date_calculation(dateString) {
189    // replace "today" with the current date first
190    let today = new Date();
191    let todayString = (today.getMonth() + 1) + '-' + today.getDate() + '-' + today.getFullYear();
192    dateString = dateString.replace(/today/ig, todayString);
193    // check for any dynamic additions and adjust
194    const dateStringParts = dateString.split('+');
195    const dateParts = dateStringParts[0].split('-');
196    let newDate = new Date(dateParts[2], dateParts[0] - 1, dateParts[1]);
197    if (dateStringParts[1] != null && dateStringParts[1] > 0) {
198        newDate.setDate(newDate.getDate() + parseInt(dateStringParts[1]));
199    }
200    return (((newDate.getMonth() + 1) < 10 ? '0' : '') + (newDate.getMonth() + 1)) + '-' + (newDate.getDate() < 10 ? '0' : '') + newDate.getDate() + '-' + newDate.getFullYear();
201}
202
203
204
205// VALIDATE THE JSON DATA
206function atcb_validate(data) {
207    // validate options
208    const options = ['Apple', 'Google', 'iCal', 'Microsoft365', 'Outlook.com', 'Yahoo']
209    if (!data['options'].every(function (option) {
210        let cleanOption = option.split('|');
211        if (!options.includes(cleanOption[0])) {
212            console.log("add-to-calendar button generation failed: invalid option [" + cleanOption[0] + "]");
213            return false;
214        }
215        return true;
216    })) {
217        return false;
218    }
219    // validate date
220    const dates = ['startDate', 'endDate'];
221    let newDate = dates;
222    if (!dates.every(function (date) {
223        const dateParts = data[date].split('-');
224        if (dateParts.length < 3 || dateParts.length > 3) {
225            console.log("add-to-calendar button generation failed: date misspelled [" + date + ": " + data[date] + "]");
226            return false;
227        }
228        newDate[date] = new Date(dateParts[2], dateParts[0] - 1, dateParts[1]);
229        return true;
230    })) {
231        return false;
232    }
233    // validate time
234    const times = ['startTime', 'endTime'];
235    if (!times.every(function (time) {
236        if (data[time] != null) {
237            const timeParts = data[time].split(':');
238            // validate the time parts
239            if (timeParts.length < 2 || timeParts.length > 2) {
240                console.log("add-to-calendar button generation failed: time misspelled [" + time + ": " + data[time] + "]");
241                return false;
242            }
243            if (timeParts[0] > 23) {
244                console.log("add-to-calendar button generation failed: time misspelled - hours number too high [" + time + ": " + timeParts[0] + "]");
245                return false;
246            }
247            if (timeParts[1] > 59) {
248                console.log("add-to-calendar button generation failed: time misspelled - minutes number too high [" + time + ": " + timeParts[1] + "]");
249                return false;
250            }
251            // update the date with the time for further validation steps
252            if (time == 'startTime') {
253                newDate['startDate'] = new Date(newDate['startDate'].getTime() + (timeParts[0] * 3600000) + (timeParts[1] * 60000))
254            }
255            if (time == 'endTime') {
256                newDate['endDate'] = new Date(newDate['endDate'].getTime() + (timeParts[0] * 3600000) + (timeParts[1] * 60000))
257            }
258        }
259        return true;
260    })) {
261        return false;
262    }
263    if ((data['startTime'] != null && data['endTime'] == null) || (data['startTime'] == null && data['endTime'] != null)) {
264        console.log("add-to-calendar button generation failed: if you set a starting time, you also need to define an end time");
265        return false;
266    }
267    // validate whether end is not before start
268    if (newDate['endDate'] < newDate['startDate']) {
269        console.log("add-to-calendar button generation failed: end date before start date");
270        return false;
271    }
272    // on passing the validation, return true
273    return true;
274}
275
276
277
278// GENERATE THE ACTUAL BUTTON
279function atcb_generate(button, buttonId, data) {
280    // clean the placeholder, if flagged that way
281    if (data['deleteJSON']) {
282        button.innerHTML = '';
283    }
284    // generate the wrapper div
285    let buttonTriggerWrapper = document.createElement('div');
286    buttonTriggerWrapper.classList.add('atcb_button_wrapper');
287    button.appendChild(buttonTriggerWrapper);
288    // generate the button trigger div
289    let buttonTrigger = document.createElement('div');
290    buttonTrigger.id = 'atcb_button_' + buttonId;
291    buttonTrigger.classList.add('atcb_button');
292    buttonTrigger.dataset.atcbtn = buttonId;
293    buttonTriggerWrapper.appendChild(buttonTrigger);
294    buttonTrigger.innerHTML = '<span class="atcb_icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 122.88 122.88"><path d="M81.61 4.73c0-2.61 2.58-4.73 5.77-4.73s5.77 2.12 5.77 4.73v20.72c0 2.61-2.58 4.73-5.77 4.73s-5.77-2.12-5.77-4.73V4.73h0zm-3.65 76.03c1.83 0 3.32 1.49 3.32 3.32s-1.49 3.32-3.32 3.32l-12.95-.04-.04 12.93c0 1.83-1.49 3.32-3.32 3.32s-3.32-1.49-3.32-3.32l.04-12.94-12.93-.05c-1.83 0-3.32-1.49-3.32-3.32s1.49-3.32 3.32-3.32l12.94.04.04-12.93c0-1.83 1.49-3.32 3.32-3.32s3.32 1.49 3.32 3.32l-.04 12.95 12.94.04h0zM29.61 4.73c0-2.61 2.58-4.73 5.77-4.73s5.77 2.12 5.77 4.73v20.72c0 2.61-2.58 4.73-5.77 4.73s-5.77-2.12-5.77-4.73V4.73h0zM6.4 45.32h110.08V21.47c0-.8-.33-1.53-.86-2.07-.53-.53-1.26-.86-2.07-.86H103c-1.77 0-3.2-1.43-3.2-3.2s1.43-3.2 3.2-3.2h10.55c2.57 0 4.9 1.05 6.59 2.74s2.74 4.02 2.74 6.59v27.06 65.03c0 2.57-1.05 4.9-2.74 6.59s-4.02 2.74-6.59 2.74H9.33c-2.57 0-4.9-1.05-6.59-2.74-1.69-1.7-2.74-4.03-2.74-6.6V48.53 21.47c0-2.57 1.05-4.9 2.74-6.59s4.02-2.74 6.59-2.74H20.6c1.77 0 3.2 1.43 3.2 3.2s-1.43 3.2-3.2 3.2H9.33c-.8 0-1.53.33-2.07.86-.53.53-.86 1.26-.86 2.07v23.85h0zm110.08 6.41H6.4v61.82c0 .8.33 1.53.86 2.07.53.53 1.26.86 2.07.86h104.22c.8 0 1.53-.33 2.07-.86.53-.53.86-1.26.86-2.07V51.73h0zM50.43 18.54c-1.77 0-3.2-1.43-3.2-3.2s1.43-3.2 3.2-3.2h21.49c1.77 0 3.2 1.43 3.2 3.2s-1.43 3.2-3.2 3.2H50.43h0z"/></svg></span>';
295    buttonTrigger.innerHTML += '<span class="atcb_text">' + (data['label'] || 'Add to Calendar') + '</span>';
296    // set event listeners for the button trigger
297    if (data['trigger'] == 'click') {
298        buttonTrigger.addEventListener('click', atcb_toggle, { passive: true });
299    } else {
300        buttonTrigger.addEventListener('touchstart', atcb_toggle, { passive: true });
301        buttonTrigger.addEventListener('mouseenter', atcb_open, false);
302    }
303    // standardize any line breaks in the description
304    data['description'] = data['description'].replace(/<br\s*\/?>/gmi, '\n');
305    // generate the options list
306    let optionsList = document.createElement('div');
307    optionsList.id = 'atcb_list_' + buttonId;
308    optionsList.classList.add('atcb_list');
309    optionsList.style.display = 'none';
310    buttonTriggerWrapper.appendChild(optionsList);
311    // generate the list items
312    data['options'].forEach(function (option) {
313        let optionParts = option.split('|');
314        let optionItem = document.createElement('div');
315        optionItem.classList.add('atcb_list_item');
316        optionsList.appendChild(optionItem);
317        switch (optionParts[0]) {
318            case "Apple":
319                optionItem.innerHTML = '<span class="atcb_icon"><svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" shape-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" viewBox="0 0 640 640"><path d="M494.782 340.02c-.803-81.025 66.084-119.907 69.072-121.832-37.595-54.993-96.167-62.552-117.037-63.402-49.843-5.032-97.242 29.362-122.565 29.3
31962-25.253 0-64.277-28.607-105.604-27.85-54.32.803-104.4 31.594-132.403 80.245C29.81 334.457 71.81 479.58 126.816 558.976c26.87 38.882 58.914 82.56 100.997 81 40.512-1.594 55.843-26.244 104.848-26.244 48.993 0 62.753 26.245 105.64 25.406 43.606-.803 71.232-39.638 97.925-78.65 30.887-45.12 43.548-88.75 44.316-90.994-.969-.437-85.029-32.634-85.879-129.439l.118-.035zM414.23 102.178C436.553 75.095 451.636 37.5 447.514-.024c-32.162 1.311-71.163 21.437-94.253 48.485-20.729 24.012-38.836 62.28-33.993 99.036 35.918 2.8 72.591-18.248 94.926-45.272l.036-.047z"/></svg></span>';
320                optionItem.innerHTML += '<span class="atcb_text">';
321                optionItem.innerHTML += optionParts[1] || 'Apple';
322                optionItem.innerHTML += '</span>';
323                optionItem.addEventListener('click', function () {
324                    atcb_generate_ical(data);
325                    atcb_close_all();
326                }, false);
327                break;
328            case "Google":
329                optionItem.innerHTML = '<span class="atcb_icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 122.88 122.88"><path d="M93.78 29.1H29.1v64.68h64.68V29.1z" fill="#fff"/><path d="M93.78 122.88l29.1-29.1h-29.1v29.1z" fill="#f72a25"/><path d="M122.88 29.1h-29.1v64.68h29.1V29.1z" fill="#fbbc04"/><path d="M93.78 93.78H29.1v29.1h64.68v-29.1z" fill="#34a853"/><path d="M0 93.78v19.4c0 5.36 4.34 9.7 9.7 9.7h19.4v-29.1H0h0z" fill="#188038"/><path d="M122.88 29.1V9.7c0-5.36-4.34-9.7-9.7-9.7h-19.4v29.1h29.1 0z" fill="#1967d2"/><path d="M93.78 0H9.7C4.34 0 0 4.34 0 9.7v84.08h29.1V29.1h64.67V0h.01z" fill="#4285f4"/><path d="M42.37 79.27c-2.42-1.63-4.09-4.02-5-7.17l5.61-2.31c.51 1.94 1.4 3.44 2.67 4.51 1.26 1.07 2.8 1.59 4.59 1.59 1.84 0 3.41-.56 4.73-1.67 1.32-1.12 1.98-2.54 1.98-4.26 0-1.76-.7-3.2-2.09-4.32s-3.14-1.67-5.22-1.67H46.4v-5.55h2.91c1.79 0 3.31-.48 4.54-1.46 1.23-.97 1.84-2.3 1.84-3.99 0-1.5-.55-2.7-1.65-3.6s-2.49-1.35-4.18-1.35c-1.65 0-2.96.44-3.93 1.32s-1.7 2-2.12 3.24l-5.55-2.31c.74-2.09 2.09-3.93 4.07-5.52s4.51-2.39 7.58-2.39c2.27 0 4.32.44 6.13 1.32s3.23 2.1 4.26 3.65c1.03 1.56 1.54 3.31 1.54 5.25 0 1.98-.48 3.65-1.43 5.03-.95 1.37-2.13 2.43-3.52 3.16v.33c1.79.74 3.36 1.96 4.51 3.52 1.17 1.58 1.76 3.46 1.76 5.66s-.56 4.16-1.67 5.88c-1.12 1.72-2.66 3.08-4.62 4.07s-4.17 1.49-6.62 1.49c-2.84 0-5.46-.81-7.88-2.45h0 0zm34.46-27.84l-6.16 4.45-3.08-4.67 11.05-7.97h4.24v37.6h-6.05V51.43h0z" fill="#1a73e8"/></svg></span>';
330                optionItem.innerHTML += '<span class="atcb_text">';
331                optionItem.innerHTML += optionParts[1] || 'Google';
332                optionItem.innerHTML += '</span>';
333                optionItem.addEventListener('click', function () {
334                    atcb_generate_google(data);
335                    atcb_close_all();
336                }, false);
337                break;
338            case "iCal":
339                optionItem.innerHTML = '<span class="atcb_icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 122.88 122.88"><path d="M81.61 4.73c0-2.61 2.58-4.73 5.77-4.73s5.77 2.12 5.77 4.73v20.72c0 2.61-2.58 4.73-5.77 4.73s-5.77-2.12-5.77-4.73V4.73h0zm-15.5 99.08c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2H81.9c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H66.11h0zM15.85 67.09c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2h15.79c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H15.85h0zm25.13 0c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2h15.79c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H40.98h0zm25.13 0c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2H81.9c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H66.11h0zm25.14 0c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2h15.79c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H91.25h0zm-75.4 18.36c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2h15.79c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H15.85h0zm25.13 0c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2h15.79c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H40.98h0zm25.13 0c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2H81.9c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H66.11h0zm25.14 0c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2h15.79c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H91.25h0zm-75.4 18.36c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2h15.79c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H15.85h0zm25.13 0c-.34 0-.61-1.43-.61-3.2s.27-3.2.61-3.2h15.79c.34 0 .61 1.43.61 3.2s-.27 3.2-.61 3.2H40.98h0zM29.61 4.73c0-2.61 2.58-4.73 5.77-4.73s5.77 2.12 5.77 4.73v20.72c0 2.61-2.58 4.73-5.77 4.73s-5.7
3397-2.12-5.77-4.73V4.73h0zM6.4 45.32h110.07V21.47c0-.8-.33-1.53-.86-2.07-.53-.53-1.26-.86-2.07-.86H103c-1.77 0-3.2-1.43-3.2-3.2s1.43-3.2 3.2-3.2h10.55c2.57 0 4.9 1.05 6.59 2.74s2.74 4.02 2.74 6.59v27.06 65.03c0 2.57-1.05 4.9-2.74 6.59s-4.02 2.74-6.59 2.74H9.33c-2.57 0-4.9-1.05-6.59-2.74-1.69-1.7-2.74-4.03-2.74-6.6V48.52 21.47c0-2.57 1.05-4.9 2.74-6.59s4.02-2.74 6.59-2.74H20.6c1.77 0 3.2 1.43 3.2 3.2s-1.43 3.2-3.2 3.2H9.33c-.8 0-1.53.33-2.07.86-.53.53-.86 1.26-.86 2.07v23.85h0zm110.08 6.41H6.4v61.82c0 .8.33 1.53.86 2.07.53.53 1.26.86 2.07.86h104.22c.8 0 1.53-.33 2.07-.86.53-.53.86-1.26.86-2.07V51.73h0zM50.43 18.54c-1.77 0-3.2-1.43-3.2-3.2s1.43-3.2 3.2-3.2h21.49c1.77 0 3.2 1.43 3.2 3.2s-1.43 3.2-3.2 3.2H50.43h0z"/></svg></span>';
340                optionItem.innerHTML += '<span class="atcb_text">';
341                optionItem.innerHTML += optionParts[1] || 'iCal File';
342                optionItem.innerHTML += '</span>';
343                optionItem.addEventListener('click', function () {
344                    atcb_generate_ical(data);
345                    atcb_close_all();
346                }, false);
347                break;
348            case "Microsoft365":
349                optionItem.innerHTML = '<span class="atcb_icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 278050 333334" shape-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd"><path fill="#ea3e23" d="M278050 305556l-29-16V28627L178807 0 448 66971l-448 87 22 200227 60865-23821V80555l117920-28193-17 239519L122 267285l178668 65976v73l99231-27462v-316z"/></svg></span>';
350                optionItem.innerHTML += '<span class="atcb_text">';
351                optionItem.innerHTML += optionParts[1] || 'Microsoft 365';
352                optionItem.innerHTML += '</span>';
353                optionItem.addEventListener('click', function () {
354                    atcb_generate_microsoft(data, '365');
355                    atcb_close_all();
356                }, false);
357                break;
358            case "Outlook.com":
359                optionItem.innerHTML = '<span class="atcb_icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="-0.129793726981 0 33.251996719421 32" width="2500" height="2397"><path d="M28.596 2H11.404A1.404 1.404 0 0 0 10 3.404V5l9.69 3L30 5V3.404A1.404 1.404 0 0 0 28.596 2z" fill="#0364b8"/><path d="M31.65 17.405A11.341 11.341 0 0 0 32 16a.666.666 0 0 0-.333-.576l-.013-.008-.004-.002L20.812 9.24a1.499 1.499 0 0 0-1.479-.083 1.49 1.49 0 0 0-.145.082L8.35 15.415l-.004.002-.012.007A.666.666 0 0 0 8 16a11.344 11.344 0 0 0 .35 1.405l11.492 8.405z" fill="#0a2767"/><path d="M24 5h-7l-2.021 3L17 11l7 6h6v-6z" fill="#28a8ea"/><path d="M10 5h7v6h-7z" fill="#0078d4"/><path d="M24 5h6v6h-6z" fill="#50d9ff"/><path d="M24 17l-7-6h-7v6l7 6 10.832 1.768z" fill="#0364b8"/><path d="M17 11h7v6h-7z" fill="#0078d4"/><path d="M10 17h7v6h-7z" fill="#064a8c"/><path d="M24 17h6v6h-6z" fill="#0078d4"/><path d="M20.19 25.218l-11.793-8.6.495-.87 10.909 6.212a.528.528 0 0 0 .42-.012l10.933-6.23.496.869z" fill="#0a2767" opacity=".5"/><path d="M31.667 16.577l-.014.008-.003.002-10.838 6.174a1.497 1.497 0 0 1-1.46.091l3.774 5.061 8.254 1.797v.004A1.498 1.498 0 0 0 32 28.5V16a.666.666 0 0 1-.333.577z" fill="#1490df"/><path d="M32 28.5v-.738l-9.983-5.688-1.205.687a1.497 1.497 0 0 1-1.46.091l3.774 5.061 8.254 1.797v.004A1.498 1.498 0 0 0 32 28.5z" opacity=".05"/><path d="M31.95 28.883L21.007 22.65l-.195.11a1.497 1.497 0 0 1-1.46.092l3.774 5.061 8.254 1.797v.004a1.501 1.501 0 0 0 .57-.83z" opacity=".1"/><path d="M8.35 16.59v-.01h-.01l-.03-.02A.65.65 0 0 1 8 16v12.5A1.498 1.498 0 0 0 9.5 30h21a1.503 1.503 0 0 0 .37-.05.637.637 0 0 0 .18-.06.142.142 0 0 0 .06-.02 1.048 1.048 0 0 0 .23-.13c.02-.01.03-.01.04-.03z" fill="#28a8ea"/><path d="M18 24.667V8.333A1.337 1.337 0 0 0 16.667 7H10.03v7.456l-1.68.958-.005.002-.012.007A.666.666 0 0 0 8 16v.005V16v10h8.667A1.337 1.337 0 0 0 18 24.667z" opacity=".1"/><path d="M17 25.667V9.333A1.337 1.337 0 0 0 15.667 8H10.03v6.456l-1.68.958-.005.002-.012.007A.666.666 0 0 0 8 16v.005V16v11h7.667A1.337 1.337 0 0 0 17 25.667z" opacity=".2"/><path d="M17 23.667V9.333A1.337 1.337 0 0 0 15.667 8H10.03v6.456l-1.68.958-.005.002-.012.007A.666.666 0 0 0 8 16v.005V16v9h7.667A1.337 1.337 0 0 0 17 23.667z" opacity=".2"/><path d="M16 23.667V9.333A1.337 1.337 0 0 0 14.667 8H10.03v6.456l-1.68.958-.005.002-.012.007A.666.666 0 0 0 8 16v.005V16v9h6.667A1.337 1.337 0 0 0 16 23.667z" opacity=".2"/><path d="M1.333 8h13.334A1.333 1.333 0 0 1 16 9.333v13.334A1.333 1.333 0 0 1 14.667 24H1.333A1.333 1.333 0 0 1 0 22.667V9.333A1.333 1.333 0 0 1 1.333 8z" fill="#0078d4"/><path d="M3.867 13.468a4.181 4.181 0 0 1 1.642-1.814A4.965 4.965 0 0 1 8.119 11a4.617 4.617 0 0 1 2.413.62 4.14 4.14 0 0 1 1.598 1.733 5.597 5.597 0 0 1 .56 2.55 5.901 5.901 0 0 1-.577 2.666 4.239 4.239 0 0 1-1.645 1.794A4.8 4.8 0 0 1 7.963 21a4.729 4.729 0 0 1-2.468-.627 4.204 4.204 0 0 1-1.618-1.736 5.459 5.459 0 0 1-.567-2.519 6.055 6.055 0 0 1 .557-2.65zm1.75 4.258a2.716 2.716 0 0 0 .923 1.194 2.411 2.411 0 0 0 1.443.435 2.533 2.533 0 0 0 1.541-.449 2.603 2.603 0 0 0 .897-1.197 4.626 4.626 0 0 0 .286-1.665 5.063 5.063 0 0 0-.27-1.686 2.669 2.669 0 0 0-.866-1.24 2.387 2.387 0 0 0-1.527-.473 2.493 2.493 0 0 0-1.477.439 2.741 2.741 0 0 0-.944 1.203 4.776 4.776 0 0 0-.007 3.44z" fill="#fff"/></svg></span>';
360                optionItem.innerHTML += '<span class="atcb_text">';
361                optionItem.innerHTML += optionParts[1] || 'Outlook.com';
362                optionItem.innerHTML += '</span>';
363                optionItem.addEventListener('click', function () {
364                    atcb_generate_microsoft(data, 'outlook');
365                    atcb_close_all();
366                }, false);
367                break;
368            case "Yahoo":
369                optionItem.innerHTML = '<span class="atcb_icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3386.34 3010.5" shape-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd"><path d="M0 732.88h645.84l376.07 962.1 380.96-962.1h628.76l-946.8 2277.62H451.98l259.19-603.53L.02 732.88zm2763.84 768.75h-704.26L2684.65 0l701.69.03-622.5 1501.6zm-519.78 143.72c216.09 0 391.25 175.17 391.25 391.22 0 216.06-175.16 391.23-391.25 391.23-216.06 0-391.19-175.17-391.19-391.23 0-216.05 175.16-391.22 391.19-391.22z" fill="#5f01d1" fill-rule="nonzero"/></svg></span>';
370                optionItem.innerHTML += '<span class="atcb_text">';
371                optionItem.innerHTML += optionParts[1] || 'Yahoo';
372                optionItem.innerHTML += '</span>';
373                optionItem.addEventListener('click', function () {
374                    atcb_generate_yahoo(data);
375                    atcb_close_all();
376                }, false);
377                break;
378        }
379    });
380    // create the background overlay, which also acts as trigger to close any dropdowns
381    let bgOverlay = document.createElement('div');
382    bgOverlay.id = 'atcb_bgoverlay_' + buttonId;
383    bgOverlay.classList.add('atcb_bgoverlay');
384    bgOverlay.style.display = 'none';
385    button.appendChild(bgOverlay);
386    bgOverlay.addEventListener('click', atcb_close_all, { passive: true });
387    bgOverlay.addEventListener('touchstart', atcb_close_all, { passive: true });
388    bgOverlay.addEventListener('mouseenter', atcb_close_all, false);
389    // update the placeholder class to prevent multiple initializations
390    button.classList.remove('atcb');
391    button.classList.add('atcb_initialized');
392    // show the placeholder div
393    if (data['inline']) {
394        button.style.display = 'inline-block';
395    } else {
396        button.style.display = 'block';
397    }
398    // console log
399    console.log("add-to-calendar button #" + (buttonId + 1) + " created");
400}
401
402
403
404// FUNCTIONS TO CONTROL THE INTERACTION
405function atcb_toggle() {
406    // check for state and adjust accordingly
407    if (this.classList.contains('active')) {
408        atcb_close.call(this);
409    } else {
410        atcb_open.call(this);
411    }
412}
413
414function atcb_open() {
415    // add open class and show the list (+ the background overlay)
416    this.classList.add('active');
417    let list = document.getElementById('atcb_list_' + this.dataset.atcbtn);
418    list.style.display = 'block';
419    document.getElementById('atcb_bgoverlay_' + this.dataset.atcbtn).style.display = 'block';
420}
421
422function atcb_close() {
423    // remove the active class, hide the list and the background overlay
424    this.classList.remove('active');
425    let list = document.getElementById('atcb_list_' + this.dataset.atcbtn);
426    list.style.display = 'none';
427    document.getElementById('atcb_bgoverlay_' + this.dataset.atcbtn).style.display = 'none';
428}
429
430
431function atcb_close_all() {
432    // get all buttons
433    let atcButtons = document.querySelectorAll('.atcb_button');
434    // and close them one by one
435    for (let i = 0; i < atcButtons.length; i++) {
436        atcb_close.call(atcButtons[i]);
437    }
438}
439
440
441
442// FUNCTION TO GENERATE THE GOOGLE URL
443function atcb_generate_google(data) {
444    // base url
445    let url = 'https://calendar.google.com/calendar/render?action=TEMPLATE';
446    // generate and add date
447    let formattedDate = atcb_generate_time(data, 'clean', 'google');
448    url += '&dates=' + formattedDate['start'] + '%2F' + formattedDate['end'];
449    // add details (if set)
450    if (data['description'] != null && data['description'] != '') {
451        url += '&details=' + encodeURIComponent(data['description']);
452    }
453    if (data['location'] != null && data['location'] != '') {
454        url += '&location=' + encodeURIComponent(data['location']);
455    }
456    if (data['name'] != null && data['name'] != '') {
457        url += '&text=' + encodeURIComponent(data['name']);
458    }
459    window.open(url, '_blank').focus();
460}
461
462
463
464// FUNCTION TO GENERATE THE YAHOO URL
465function atcb_generate_yahoo(data) {
466    // base url
467    let url = 'https://calendar.yahoo.com/?v=60';
468    // generate and add date
469    let formattedDate = atcb_generate_time(data, 'clean');
470    url += '&st=' + formattedDate['start'] + '&et=' + formattedDate['end'];
471    if (formattedDate['allday']) {
472        url += '&dur=allday';
473    }
474    // add details (if set)
475    if (data['description'] != null && data['description'] != '') {
476        url += '&desc=' + encodeURIComponent(data['description']);
477    }
478    if (data['location'] != null && data['location'] != '') {
479        url += '&in_loc=' + encodeURIComponent(data['location']);
480    }
481    if (data['name'] != null && data['name'] != '') {
482        url += '&title=' + encodeURIComponent(data['name']);
483    }
484    window.open(url, '_blank').focus();
485}
486
487
488
489// FUNCTION TO GENERATE THE MICROSOFT 365 OR OUTLOOK WEB URL
490function atcb_generate_microsoft(data, type = '365') {
491    // base url
492    let url = 'https://';
493    if (type == 'outlook') {
494        url += 'outlook.live.com';
495    } else {
496        url += 'outlook.office.com';
497    }
498    url += '/calendar/0/deeplink/compose?path=%2Fcalendar%2Faction%2Fcompose&rru=addevent';
499    // generate and add date
500    let formattedDate = atcb_generate_time(data, 'delimiters', 'microsoft');
501    url += '&startdt=' + formattedDate['start'] + '&enddt=' + formattedDate['end'];
502    if (formattedDate['allday']) {
503        url += '&allday=true';
504    }
505    // add details (if set)
506    if (data['description'] != null && data['description'] != '') {
507        url += '&body=' + encodeURIComponent(data['description']);
508    }
509    if (data['location'] != null && data['location'] != '') {
510        url += '&location=' + encodeURIComponent(data['location']);
511    }
512    if (data['name'] != null && data['name'] != '') {
513        url += '&subject=' + encodeURIComponent(data['name']);
514    }
515    window.open(url, '_blank').focus();
516}
517
518
519
520// FUNCTION TO GENERATE THE iCAL FILE (also for the Apple option)
521function atcb_generate_ical(data) {
522    let now = new Date();
523    now = now.toISOString().replace(/\-/g, '').replace(/\:/g, '').replace(/\..../g, '');
524    let formattedDate = atcb_generate_time(data, 'clean', 'ical');
525    let timeslot = '';
526    if (formattedDate['allday']) {
527        timeslot = ';VALUE=DATE';
528    }
529    let ics_lines = [
530        "BEGIN:VCALENDAR",
531        "VERSION:2.0",
532        "CALSCALE:GREGORIAN",
533        "BEGIN:VEVENT",
534        "DTSTAMP:" + formattedDate['start'],
535        "DTSTART" + timeslot + ":" + formattedDate['start'],
536        "DTEND" + timeslot + ":" + formattedDate['end'],
537        "DESCRIPTION:" + data['description'].replace(/\n/g, '\\n'),
538        "SUMMARY:" + data['name'],
539        "LOCATION:" + data['location'],
540        "STATUS:CONFIRMED",
541        "LAST-MODIFIED:" + now,
542        "SEQUENCE:0",
543        "END:VEVENT",
544        "END:VCALENDAR"
545    ];
546    let dlurl = 'data:text/calendar;base64,' + btoa(ics_lines.join('\r\n'));
547    try {
548        if (!window.ActiveXObject) {
549            let save = document.createElement('a');
550            save.href = dlurl;
551            save.target = '_blank';
552            save.download = data['iCalFileName'] || 'event-to-save-in-my-calendar';
553            let evt = new MouseEvent('click', {
554                'view': window,
555                'bubbles': true,
556                'cancelable': false
557            });
558            save.dispatchEvent(evt);
559            (window.URL || window.webkitURL).revokeObjectURL(save.href);
560        }
561    } catch (e) {
562        console.log(e);
563    }
564}
565
566
567
568// SHARED FUNCTION TO GENERATE A TIME STRING
569function atcb_generate_time(data, style = 'delimiters', targetCal = 'general') {
570    let startDate = data['startDate'].split('-');
571    let endDate = data['endDate'].split('-');
572    let start = '';
573    let end = '';
574    let allday = false;
575    if (data['startTime'] != null && data['endTime'] != null) {
576        // Adjust for timezone, if set (see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for either the TZ name or the offset)
577        if (data['timeZoneOffset'] != null && data['timeZoneOffset'] != '') {
578            // if we have a timezone offset given, consider it
579            start = new Date(startDate[2] + '-' + startDate[0] + '-' + startDate[1] + 'T' + data['startTime'] + ':00.000' + data['timeZoneOffset']);
580            end = new Date(endDate[2] + '-' + endDate[0] + '-' + endDate[1] + 'T' + data['endTime'] + ':00.000' + data['timeZoneOffset']);
581            start = start.toISOString().replace('.000', '');
582            end = end.toISOString().replace('.000', '');
583            if (style == 'clean') {
584                start = start.replace(/\-/g, '').replace(/\:/g, '');
585                end = end.replace(/\-/g, '').replace(/\:/g, '');
586            }
587        } else {
588            // if there is no offset, we prepare the time, assuming it is UTC formatted
589            start = new Date(startDate[2] + '-' + startDate[0] + '-' + startDate[1] + 'T' + data['startTime'] + ':00.000+00:00');
590            end = new Date(endDate[2] + '-' + endDate[0] + '-' + endDate[1] + 'T' + data['endTime'] + ':00.000+00:00');
591            if (data['timeZone'] != null && data['timeZone'] != '') {
592                // if a timezone is given, we adjust dynamically with the modern toLocaleStr
592ing function
593                let utcDate = new Date(start.toLocaleString('en-US', { timeZone: "UTC" }));
594                let tzDate = new Date(start.toLocaleString('en-US', { timeZone: data['timeZone'] }));
595                let offset = utcDate.getTime() - tzDate.getTime();
596                start.setTime(start.getTime() + offset);
597                end.setTime(end.getTime() + offset);
598            }
599            start = start.toISOString().replace('.000', '');
600            end = end.toISOString().replace('.000', '');
601            if (style == 'clean') {
602                start = start.replace(/\-/g, '').replace(/\:/g, '');
603                end = end.replace(/\-/g, '').replace(/\:/g, '');
604            }
605        }
606    } else { // would be an allday event then
607        allday = true;
608        start = new Date(startDate[2], startDate[0] - 1, startDate[1]);
609        start.setDate(start.getDate() + 1); // increment the day by 1
610        let breakStart = start.toISOString().split('T');
611        end = new Date(endDate[2], endDate[0] - 1, endDate[1]);
612        if (targetCal == 'google' || targetCal == 'microsoft' || targetCal == 'ical') {
613            end.setDate(end.getDate() + 2); // increment the day by 2 for Google Calendar, iCal and Outlook
614        } else {
615            end.setDate(end.getDate() + 1); // otherwise by 1
616        }
617        let breakEnd = end.toISOString().split('T');
618        if (style == 'clean') {
619            breakStart[0] = breakStart[0].replace(/\-/g, '');
620            breakEnd[0] = breakEnd[0].replace(/\-/g, '');
621        }
622        start = breakStart[0];
623        end = breakEnd[0];
624    }
625    let returnObject = { 'start': start, 'end': end, 'allday': allday };
626    return returnObject;
627}
628
629
630
631// START THE MAGIC AS SOON AS THE DOM HAS BEEN LOADED
632document.addEventListener('DOMContentLoaded', atcb_init, false);
633;
634acli.CommitteeSearch = {
635    init: function () {
636        jQuery(document)
637            .ready(function () {
638            });
639    },
640    getAllCommittees: function () {
641        jQuery(document)
642            .ready(function () {
643                jQuery.ajax({
644                    url: "/acliapi/GetAllCommittees/",
645                    type: "GET",
646                    dataType: "JSON",
647                    success: function (results) {
648                        jQuery("#committeeResult").empty();
649
650                        jQuery.each(results,
651                            function (key, value) {
652                                jQuery("#committeeResult")
653                                    .append("<a href=\"/Committees/Roster-Search/Result/?Code=" +
654                                        key +
655                                        "\" target=\"_blank\">" +
656                                        value +
657                                        "</a><br/>");
658                            });
659                    }
660                });
661            }
662            );
663    },
664    getCommitteesByName: function () {
665        jQuery(document)
666            .ready(function () {
667                jQuery.ajax({
668                    url: "/acliapi/GetCommitteesByName/",
669                    data: {
670                        committeeName: jQuery("#committeeName").val()
671                    },
672                    type: "GET",
673                    dataType: "JSON",
674                    success: function (results) {
675                        SetResults(results);
676                    }
677                });
678            }
679            );
680    },
681    getCommitteesByNameKeyDown: function (event) {
682        if (event.which || event.keyCode) {
683            if ((event.which == 13) || (event.keyCode == 13)) {
684                acli.CommitteeSearch.getCommitteesByName();
685                return false;
686            }
687        } else {
688            return true
689        };
690    },
691    getCommittesByACLIRep: function () {
692        jQuery(document)
693            .ready(function () {
694                jQuery.ajax({
695                    url: "/acliapi/GetCommittesByACLIRep/",
696                    data: {
697                        lastName: jQuery("#repLastName").val(),
698                        firstName: jQuery("#repFirstName").val()
699                    },
700                    type: "GET",
701                    dataType: "JSON",
702                    success: function (results) {
703                        SetResults(results);
704                    }
705                });
706            }
707            );
708    },
709    getCommittesByACLIRepKeyDown: function (event) {
710        if (event.which || event.keyCode) {
711            if ((event.which == 13) || (event.keyCode == 13)) {
712                acli.CommitteeSearch.getCommittesByACLIRep();
713                return false;
714            }
715        } else {
716            return true
717        };
718    },
719    getCommitteesByMember: function () {
720        jQuery(document)
721            .ready(function () {
722                jQuery.ajax({
723                    url: "/acliapi/GetCommitteesByMember/",
724                    data: {
725                        lastName: jQuery("#memberLastName").val(),
726                        firstName: jQuery("#memberFirstName").val(),
727                        company: jQuery("#memberCompany").val()
728                    },
729                    type: "GET",
730                    dataType: "JSON",
731                    success: function (results) {
732                        SetResults(results);
733                    }
734                });
735            }
736            );
737    },
738    getCommitteesByMemberKeyDown: function (event) {
739        if (event.which || event.keyCode) {
740            if ((event.which == 13) || (event.keyCode == 13)) {
741                acli.CommitteeSearch.getCommitteesByMember();
742                return false;
743            }
744        } else {
745            return true
746        };
747    }
748};
749
750function SetResults(results) {
751    jQuery("#committeeResult").empty();
752
753    jQuery.each(results,
754        function (key, value) {
755            jQuery("#committeeResult")
756                .append("<a href=\"/Committees/Roster-Search/Result/?Code=" +
757                    key +
758                    "\" target=\"_blank\">" +
759                    value +
760                    "</a><br/>");
761        });
762}
763;
764acli.CompanySearch = {
765    init: function (isMemberSite) {
766        jQuery(document)
767            .ready(function () {
768            $("#companySearchForm").submit(function (event) {
769                event.preventDefault();
770                acli.CompanySearch.getCompanies(isMemberSite);
771            });
772
773            $("#companySearchReset").click(function (event) {
774                $("#companyResult").empty();
775            });
776        });
777    },
778    getCompanies: function (isMemberSite) {
779        var url = isMemberSite ? "/About-ACLI/Member-Directory/Company-Search/" : "/About-ACLI/Membership/Member-List/";
780        var companyResult = $("#companyResult");
781        companyResult.empty();
782
783        $.ajax({
784            url: "/acliapi/GetCompanies/",
785            data: {
786                companyName: $("#company").val()
787            },
788            type: "GET",
789            dataType: "JSON",
790            success: function (results) {
791                $.each(results,
792                    function (i, result) {
793                        var companyLink = $("<a>",
794                            {
795                                class: "body-link",
796                                target: "_blank",
797                                text: result.CompanyName,
798                                href: url + "Result/?Code=" + result.CompanyId
799                            });
800
801                        companyResult.append(companyLink).append("<br/>");
802                    });
803            },
804            error: function () {
805                companyResult.append("<em>There was a problem running the search. Please try again.</em>");
806            }
807        });
808    }
809};
810;
811acli.ControlBar = {
812    printButton: function () {
813        jQuery("#printbutton").click(function () {
814            window.print();
815        });
816    }
817};
818;
819try {
820    const CustomResultsPerPageDropdown = (function (_super) {
821        __extends(CustomResultsPerPageDropdown, Coveo.Component);
822        function CustomResultsPerPageDropdown(element, options, bindings) {
823            _super.call(this, element, CustomResultsPerPageDropdown.ID, bindings);
824            this.type = 'CustomResultsPerPageDropdown';
825            Coveo.Component.bindComponentToElement(element, this);
826            this.element = element;
827            this.options = Coveo.ComponentOptions.initComponentOptions(element, CustomResultsPerPageDropdown, options);
828            this.bindings = bindings;
829            //set dropdown to appropriate value if numberOfResults value exists in url hash
830            if (window.location.hash.match(/numberOfResults=\d+/)) {
831                var hashNumberOfResults = /numberOfResults=(?<numResults>\d+)/.exec(window.location.hash).groups.numResults;
832                Coveo.$(this.element).children("select").val(hashNumberOfResults);
833            }
834            var dropdown = Coveo.$(this.element).children("select")[0];
835            dropdown.addEventListener('change', (e) => this.handleChange(e));
836        }
837        CustomResultsPerPageDropdown.prototype.handleChange = function (e) {
838            this.executeNewQuery();
839            var position = Coveo.$(".coveo-results-column").position();
840            window.scrollTo(position);
841        }
842        CustomResultsPerPageDropdown.prototype.executeNewQuery = function () {
843            var resultsPerPage = Coveo.$(this.element).children("select").val();
844            this.bindings.queryController.options.resultsPerPage = resultsPerPage;
845            this.bindings.searchInterface.resultsPerPage = resultsPerPage;
846
847            this.bindings.queryStateModel.set('numberOfResults', resultsPerPage);
848            this.bindings.queryController.executeQuery();
849        }
850
851        CustomResultsPerPageDropdown.options = {
852            initialChoice: Coveo.ComponentOptions.buildStringOption()
853        }
854
855        CustomResultsPerPageDropdown.ID = 'CustomResultsPerPageDropdown';
856        Coveo.Initialization.registerAutoCreateComponent(CustomResultsPerPageDropdown);
857    })(Coveo.Component);
858
859    const ExcludeArchivedFacet = (function (_super) {
860        __extends(ExcludeArchivedFacet, Coveo.Component);
861        var urlExcludeArchived = "false";
862        function ExcludeArchivedFacet(element, options, bindings) {
863            _super.call(this, element, ExcludeArchivedFacet.ID, bindings);
864            this.type = 'ExcludeArchivedFacet';
865            Coveo.Component.bindComponentToElement(element, this);
866            this.element = element;
867            this.options = Coveo.ComponentOptions.initComponentOptions(element, ExcludeArchivedFacet, options);
868            this.bindings = bindings;
869
870            this.registerStateAttribute();
871            this.registerBuildingQueryEvent();
872            var checkbox = Coveo.$(this.element).find(".coveo-facet-value-label-wrapper")[0];
873
874            if (window.location.hash.match(/f:@excludearchived=/)) {
875                var excludeArchived = /f:@excludearchived=(?<excludeArchived>\w+)/.exec(window.location.hash).groups.excludeArchived;
876                if (excludeArchived !== undefined && excludeArchived == "true") {
877                    Coveo.$(this.element).find("li").addClass("coveo-selected");
878                    Coveo.$(this.element).find("input[type=checkbox]").prop("checked", true);
879                    urlExcludeArchived = "true";
880                }
881            }
882
883            checkbox.addEventListener('click', (e) => this.handleClick(e));
884        }
885
886        ExcludeArchivedFacet.prototype.registerStateAttribute = function () {
887            var coveoClass = this;
888            Coveo.$(this.bindings.searchInterface.element).on("afterComponentsInitialization", function (e) {
889                coveoClass.bindings.searchInterface.element.Coveostate.registerNewAttribute("f:@excludearchived", urlExcludeArchived);
890            });
891        };
892
893        ExcludeArchivedFacet.prototype.registerBuildingQueryEvent = function () {
894            var coveoClass = this;
895            Coveo.$(this.bindings.searchInterface.element).on('buildingQuery', function (e, args) {
896                coveoClass.handleBuildingQuery(e, args);
897            });
898        }
899
900        ExcludeArchivedFacet.prototype.handleClick = function (e) {
901            //toggle hidden checkbox
902            var checkbox = Coveo.$(this.element).find("input[type=checkbox]");
903            checkbox.prop("checked", !checkbox.prop("checked"));
904            Coveo.$(this.element).find("li").toggleClass("coveo-selected");
905            Coveo.$(this.element).find(".coveo-facet-value-checkbox").attr("aria-pressed", checkbox.prop("checked"));
906            e.preventDefault();
907            this.processQueryChange();
908        }
909
910        ExcludeArchivedFacet.prototype.processQueryChange = function () {
911            var excludeArchivedValue = Coveo.$(this.element).find("input[type=checkbox]").prop("checked");
912
913            if (this.bindings.searchInterface.element.Coveostate !== undefined) {
914                this.bindings.searchInterface.element.Coveostate.set('f:@excludearchived', excludeArchivedValue.toString());
915            }
916
917            this.bindings.usageAnalytics.logSearchEvent({
918                name: 'facetSelect',
919                type: 'facet'
920            });
921
922            this.bindings.queryController.executeQuery();
923        }
924
925        ExcludeArchivedFacet.prototype.handleBuildingQuery = function (e, args) {
926            var excludeArchived = this.bindings.searchInterface.element.Coveostate.attributes["f:@excludearchived"];
927            if (excludeArchived !== undefined && excludeArchived == "true") {
928                var archiveDateFieldName = CoveoForSitecore.Context.fields.toCoveo("@Archive Date")
929                args.queryBuilder.advancedExpression.add("NOT " + archiveDateFieldName + " OR " + archiveDateFieldName + " >= today");
930            }
931        }
932
933        ExcludeArchivedFacet.ID = 'ExcludeArchivedFacet';
934        Coveo.Initialization.registerAutoCreateComponent(ExcludeArchivedFacet);
935    })(Coveo.Component);
936} catch { }
937;
938acli.EmployeeSearch = {
939    init: function () {
940        jQuery(document)
941            .ready(function () {
942        });
943    },
944    getEmployees: function () {
945        jQuery(document)
946            .ready(function () {
947            jQuery.ajax({
948                url: "/acliapi/GetEmployees/",
949                data: {
950                    lastName: jQuery("#lastName").val(),
951                    firstName: jQuery("#firstName").val(),
952                    companyName: jQuery("#companyName").val(),
953                    title: jQuery("#title").val()
954                },
955                type: "GET",
956                dataType: "JSON",
957                success: function (results) {
958                    jQuery("#employeeResult").empty();
959
960                    jQuery.each(results,
961                        function (i, result) {
962                            jQuery("#employeeResult")
963                                .append("<p class=\"margin-bottom-20\"><a class=\"body-link\" href=\"/About-ACLI/Member-Directory/Employee-Search/Result/?Code=" +
964                                    result.EmployeeId +
965                                    "\" target=\"_blank\">" +
966                                    result.EmployeeName +
967                                    "</a><br/>" +
968                                    result.EmployeeTitle +
969                                    "<br/><a class=\"body-link\" href=\"/About-ACLI/Member-Directory/Company-Search/Result/?Code=" +
970                                    result.CompanyId +
971                                    "\" target=\"_blank\">" +
972                                    result.CompanyName +
973                                    "</a></p>");
974                        });
975                }
976            });
977        });
978    },
979    resetEmployees: function () {
980        jQuery("#employeeResult").empty();
981        jQuery("#lastName").val("");
982        jQuery("#firstName").val("");
983        jQuery("#companyName").val("");
984        jQuery("#title").val("");
985    },
986    keyDown: function (event) {
987        if (event.which || event.keyCode) {
988            if ((event.which == 13) || (event.keyCode == 13)) {
989                acli.EmployeeSearch.getEmployees();
990                return false;
991            }
992        } else {
993            return true
994        };
995    }
996};
997;
998acli.MenuToggle = {
999    init: function () {
1000        window.open = function () {
1001            AddRemoveDisabled();
1002            jQuery(window).resize(function () {
1003                AddRemoveDisabled();
1004            });
1005        };
1006
1007        // Adds or removes the disabled class depending on if the mobile navigation controls are visible
1008        function AddRemoveDisabled() {
1009            if (jQuery(".navbar-toggle").is(":visible")) {
1010                jQuery("a.dropdown-toggle").removeClass("disabled");
1011            }
1012            else {
1013                jQuery("a.dropdown-toggle").addClass("disabled");
1014                jQuery("ul.navbar-nav li.open").removeClass("open");
1015            }
1016        };
1017    },
1018};
1019
1020acli.MenuToggle.init();
1021;
1022acli.Publication = {
1023    init: function () {
1024        jQuery(document)
1025            .ready(function () {
1026            var article = jQuery("#ArticleId").val();
1027            jQuery("#ArticleDdl").val(article);
1028        });
1029    },
1030    getArticlesInPublication: function () {
1031        jQuery(document)
1032            .ready(function () {
1033            var pubId = jQuery("#PublicationId option:selected").text();
1034            jQuery("#ArticleDdl").html("");
1035
1036            if (pubId == "") {
1037                jQuery("#ArticleDdl")
1038                    .append(
1039                        jQuery("<option></option>").val("").html("Please select publication first..."));
1040            } else {
1041                jQuery.ajax({
1042                    url: "/acliapi/GetArticlesInPublication/",
1043                    data: {
1044                        value: pubId
1045                    },
1046                    type: "GET",
1047                    dataType: "JSON",
1048                    success: function (articles) {
1049                        jQuery("#ArticleDdl")
1050                            .append(
1051                                jQuery("<option></option>").val("").html("Please select article..."));
1052                        jQuery.each(articles,
1053                            function (i, article) {
1054                                jQuery("#ArticleDdl")
1055                                    .append(
1056                                        jQuery("<option></option>").val(article.ItemName).html(article.DisplayName));
1057                            });
1058                    }
1059                });
1060            }
1061        });
1062    },
1063    sendToSubscribers: function () {
1064        jQuery(document)
1065            .ready(function () {
1066            SetArticleId();
1067            jQuery("form").submit();
1068        });
1069    },
1070    sendToTestRecipients: function () {
1071        jQuery(document)
1072            .ready(function () {
1073            SetArticleId();
1074
1075            if (jQuery("#TestEmails").val() == "") {
1076                alert("Please enter test email(s) to send the publication to");
1077            } else {
1078                jQuery("form").submit();
1079            }
1080        });
1081    }
1082};
1083
1084function SetArticleId() {
1085	var article = jQuery("#ArticleDdl").val();
1086	jQuery("#ArticleId").val(article);
1087}
1088;
1089acli.Twitter = {
1090		removeMedia: function() {
1091			jQuery('.twitter-block').on('DOMSubtreeModified propertychange',
1092				"#twitter-widget-0",
1093				function() {
1094					jQuery(".twitter-timeline").contents().find(".timeline-Tweet-media").css("display", "none");
1095					jQuery(".twitter-block").css("height", "100%");
1096				});
1097		}
1098	};
1099;
1100acli.UserProfile = {
1101    init: function (allowEdit) {
1102        jQuery(document)
1103            .ready(function () {
1104            var useDdl = CheckCountry();
1105
1106            $('form').submit(function () {
1107                $('button[type=submit]', this).attr('disabled', 'disabled');
1108            });
1109
1110            if (useDdl) {
1111                jQuery("#StateProvinceDdl").val(jQuery("#StateProvince").val());
1112                jQuery("#StateProvinceDdl")
1113                    .prepend(
1114                        jQuery("<option></option>").val("").html("Please select state/province..."));
1115            } else {
1116                jQuery("#StateProvinceText").val(jQuery("#StateProvince").val());
1117            }
1118
1119            if (allowEdit === "False") {
1120                jQuery("form :input").attr("disabled", true);
1121            }
1122
1123            jQuery("form")
1124                .submit(function () {
1125                    var useDdl = CheckCountry();
1126                    var state;
1127
1128                    if (useDdl) {
1129                        state = jQuery("#StateProvinceDdl").val();
1130                    } else {
1131                        state = jQuery("#StateProvinceText").val();
1132                    }
1133
1134                    jQuery("#StateProvince").val(state);
1135                });
1136        });
1137    },
1138    setState: function () {
1139        jQuery(document)
1140            .ready(function () {
1141            var useDdl = CheckCountry();
1142            var country = jQuery("#Country").val();
1143
1144            if (useDdl) {
1145                jQuery.ajax({
1146                    url: "/acliapi/FillStates/",
1147                    data: {
1148                        value: country
1149                    },
1150                    type: "GET",
1151                    dataType: "JSON",
1152                    success: function (states) {
1153                        jQuery("#StateProvinceDdl").html("");
1154                        jQuery("#StateProvinceDdl")
1155                            .append(
1156                                jQuery("<option></option>").val("").html("Please select state/province..."));
1157                        jQuery.each(states,
1158                            function (i, state) {
1159                                jQuery("#StateProvinceDdl")
1160                                    .append(
1161                                        jQuery("<option></option>").val(state.StateProvinceId).html(state.StateProvinceName));
1162                            });
1163                    }
1164                });
1165            }
1166        });
1167    }
1168};
1169
1170function CheckCountry() {
1171	var useDdl;
1172	var country = jQuery("#Country").val();
1173
1174	switch (country) {
1175		case "USA":
1176		case "Japan":
1177		case "Canada":
1178		{
1179			useDdl = true;
1180			jQuery("#StateTxt").hide();
1181			jQuery("#StateDdl").show();
1182			break;
1183		}
1184		default:
1185		{
1186			useDdl = false;
1187			jQuery("#StateTxt").show();
1188			jQuery("#StateDdl").hide();
1189			break;
1190		}
1191	}
1192
1193	return useDdl;
1194}
1195;
1196acli.WebDirectPrefs = {
1197    selectAll: function (divId) {
1198        jQuery(document)
1199            .ready(function () {
1200            jQuery("#" + divId + " :checkbox:enabled").prop("checked", true);
1201        });
1202    },
1203    unselectAll: function (divId) {
1204        jQuery(document)
1205            .ready(function () {
1206            jQuery("#" + divId + " :checkbox:enabled").prop("checked", false);
1207        });
1208    },
1209    selectAllStates: function (divId) {
1210        jQuery(document)
1211            .ready(function () {
1212            jQuery("#" + divId + " :checkbox:enabled").prop("checked", false);
1213            jQuery("#" + divId + " :checkbox:enabled").prop("checked", true);
1214            jQuery("#" + divId + " :checkbox[value='Fed']").prop("checked", false);
1215            jQuery("#" + divId + " :checkbox[value='Int']").prop("checked", false);
1216        });
1217    },
1218    checkFrequency: function () {
1219        jQuery(document)
1220            .ready(function () {
1221            var frequency = jQuery("input[name='frequency']:checked").val();
1222
1223            if (frequency == undefined) {
1224                alert("You must select a \"Frequency of Update Emails\" value");
1225            } else {
1226                jQuery("form").submit();
1227            }
1228        });
1229    }
1230};
1231;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.