PageSourceSearch

https://www.pandasecurity.com/Scripts/Custom/util.js

js pandasecurity.com collected 2026-09-24 07:22:06 UTC 7,604 bytes, 191 lines download raw bytes

1/*!
2  * Bootstrap util.js v4.6.1 (https://getbootstrap.com/)
3  * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5  */
6(function (global, factory) {
7    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
8        typeof define === 'function' && define.amd ? define(['jquery'], factory) :
9            (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Util = factory(global.jQuery));
10})(this, (function ($) {
11    'use strict';
12
13    function _interopDefaultLegacy(e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
15    var $__default = /*#__PURE__*/_interopDefaultLegacy($);
16
17    /**
18     * --------------------------------------------------------------------------
19     * Bootstrap (v4.6.1): util.js
20     * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
21     * --------------------------------------------------------------------------
22     */
23    /**
24     * Private TransitionEnd Helpers
25     */
26
27    var TRANSITION_END = 'transitionend';
28    var MAX_UID = 1000000;
29    var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
30
31    function toType(obj) {
32        if (obj === null || typeof obj === 'undefined') {
33            return "" + obj;
34        }
35
36        return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
37    }
38
39    function getSpecialTransitionEndEvent() {
40        return {
41            bindType: TRANSITION_END,
42            delegateType: TRANSITION_END,
43            handle: function handle(event) {
44                if ($__default["default"](event.target).is(this)) {
45                    return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
46                }
47
48                return undefined;
49            }
50        };
51    }
52
53    function transitionEndEmulator(duration) {
54        var _this = this;
55
56        var called = false;
57        $__default["default"](this).one(Util.TRANSITION_END, function () {
58            called = true;
59        });
60        setTimeout(function () {
61            if (!called) {
62                Util.triggerTransitionEnd(_this);
63            }
64        }, duration);
65        return this;
66    }
67
68    function setTransitionEndSupport() {
69        $__default["default"].fn.emulateTransitionEnd = transitionEndEmulator;
70        $__default["default"].event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
71    }
72    /**
73     * Public Util API
74     */
75
76
77    var Util = {
78        TRANSITION_END: 'bsTransitionEnd',
79        getUID: function getUID(prefix) {
80            do {
81                // eslint-disable-next-line no-bitwise
82                prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
83            } while (document.getElementById(prefix));
84
85            return prefix;
86        },
87        getSelectorFromElement: function getSelectorFromElement(element) {
88            var selector = element.getAttribute('data-target');
89
90            if (!selector || selector === '#') {
91                var hrefAttr = element.getAttribute('href');
92                selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
93            }
94
95            try {
96                return document.querySelector(selector) ? selector : null;
97            } catch (_) {
98                return null;
99            }
100        },
101        getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
102            if (!element) {
103                return 0;
104            } // Get transition-duration of the element
105
106
107            var transitionDuration = $__default["default"](element).css('transition-duration');
108            var transitionDelay = $__default["default"](element).css('transition-delay');
109            var floatTransitionDuration = parseFloat(transitionDuration);
110            var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
111
112            if (!floatTransitionDuration && !floatTransitionDelay) {
113                return 0;
114            } // If multiple durations are defined, take the first
115
116
117            transitionDuration = transitionDuration.split(',')[0];
118            transitionDelay = transitionDelay.split(',')[0];
119            return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
120        },
121        reflow: function reflow(element) {
122            return element.offsetHeight;
123        },
124        triggerTransitionEnd: function triggerTransitionEnd(element) {
125            $__default["default"](element).trigger(TRANSITION_END);
126        },
127        supportsTransitionEnd: function supportsTransitionEnd() {
128            return Boolean(TRANSITION_END);
129        },
130        isElement: function isElement(obj) {
131            return (obj[0] || obj).nodeType;
132        },
133        typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
134            for (var property in configTypes) {
135                if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
136                    var expectedTypes = configTypes[property];
137                    var value = config[property];
138                    var valueType = value && Util.isElement(value) ? 'element' : toType(value);
139
140                    if (!new RegExp(expectedTypes).test(valueType)) {
141                        throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
142                    }
143                }
144            }
145        },
146        findShadowRoot: function findShadowRoot(element) {
147            if (!document.documentElement.attachShadow) {
148                return null;
149            } // Can find the shadow root otherwise it'll return the document
150
151
152            if (typeof element.getRootNode === 'function') {
153                var root = element.getRootNode();
154                return root instanceof ShadowRoot ? root : null;
155            }
156
157            if (element instanceof ShadowRoot) {
158                return element;
159            } // when we don't find a shadow root
160
161
162            if (!element.parentNode) {
163                return null;
164            }
165
166            return Util.findShadowRoot(element.parentNode);
167        },
168        jQueryDetection: function jQueryDetection() {
169            if (typeof $__default["default"] === 'undefined') {
170                throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
171            }
172
173            var version = $__default["default"].fn.jquery.split(' ')[0].split('.');
174            var minMajor = 1;
175            var ltMajor = 2;
176            var minMinor = 9;
177            var minPatch = 1;
178            var maxMajor = 4;
179
180            if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >
180= maxMajor) {
181                throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
182            }
183        }
184    };
185    Util.jQueryDetection();
186    setTransitionEndSupport();
187
188    return Util;
189
190}));
191//# sourceMappingURL=util.js.map

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