PageSourceSearch

https://bestrong.global/assets/plugins/simple-cloudflare-turnstile/js/interaction-label.js?ver=1.1

js bestrong.global collected 2026-09-24 10:55:34 UTC 2,113 bytes, 60 lines download raw bytes

1/**
2 * Show interaction-only helper elements only when the Turnstile widget is visible.
3 *
4 * In "Interaction Only" appearance mode the widget stays invisible (zero height)
5 * unless an interaction is required. Any associated helper elements (the
6 * "Widget Label Text" above the widget, and the spacer/line break below it) are
7 * hidden by default and revealed only while their widget has a visible height.
8 */
9(function () {
10    function findWidget(el) {
11        var next = el.nextElementSibling;
12        if (next && next.classList && next.classList.contains('cf-turnstile')) {
13            return next;
14        }
15        var prev = el.previousElementSibling;
16        if (prev && prev.classList && prev.classList.contains('cf-turnstile')) {
17            return prev;
18        }
19        return el.parentNode ? el.parentNode.querySelector('.cf-turnstile') : null;
20    }
21
22    function toggle(el, widget) {
23        el.style.display = widget.offsetHeight > 10 ? '' : 'none';
24    }
25
26    function init() {
27        var elements = document.querySelectorAll('.cfturnstile-widget-label-interaction, .cfturnstile-widget-spacer-interaction');
28        elements.forEach(function (el) {
29            if (el.getAttribute('data-cft-observed') === 'true') {
30                return;
31            }
32            var widget = findWidget(el);
33            if (!widget) {
34                return;
35            }
36            el.setAttribute('data-cft-observed', 'true');
37            var run = function () {
38                toggle(el, widget);
39            };
40            run();
41            if (window.ResizeObserver) {
42                try {
43                    new ResizeObserver(run).observe(widget);
44                } catch (e) {
45                    setInterval(run, 500);
46                }
47            } else {
48                setInterval(run, 500);
49            }
50        });
51    }
52
53    window.cfturnstileInitInteractionLabels = init;
54
55    if (document.readyState === 'loading') {
56        document.addEventListener('DOMContentLoaded', init);
57    } else {
58        init();
59    }
60})();

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.