PageSourceSearch

https://www.summerlandadvocate.com/ASSET/1390x25804/XPATH/cms/js/cookie_consent/3rd_parties/inmobi/header.js

js summerlandadvocate.com collected 2026-10-04 18:03:59 UTC 9,452 bytes, 322 lines download raw bytes

1// InMobi Choice. Consent Manager Tag v3.0 (for TCF 2.2)
2(function() {
3  var host = 'lionslight.org';
4  var element = document.createElement('script');
5  var firstScript = document.getElementsByTagName('script')[0];
6  var url = 'https://cmp.inmobi.com'
7    .concat('/choice/', 'GANCBjEfRH5Fe', '/', host, '/choice.js?tag_version=V3');
8  var uspTries = 0;
9  var uspTriesLimit = 3;
10  element.async = true;
11  element.type = 'text/javascript';
12  element.src = url;
13
14  firstScript.parentNode.insertBefore(element, firstScript);
15
16  function makeStub() {
17    var TCF_LOCATOR_NAME = '__tcfapiLocator';
18    var queue = [];
19    var win = window;
20    var cmpFrame;
21
22    function addFrame() {
23      var doc = win.document;
24      var otherCMP = !!(win.frames[TCF_LOCATOR_NAME]);
25
26      if (!otherCMP) {
27        if (doc.body) {
28          var iframe = doc.createElement('iframe');
29
30          iframe.style.cssText = 'display:none';
31          iframe.name = TCF_LOCATOR_NAME;
32          doc.body.appendChild(iframe);
33        } else {
34          setTimeout(addFrame, 5);
35        }
36      }
37      return !otherCMP;
38    }
39
40    function tcfAPIHandler() {
41      var gdprApplies;
42      var args = arguments;
43
44      if (!args.length) {
45        return queue;
46      } else if (args[0] === 'setGdprApplies') {
47        if (
48          args.length > 3 &&
49          args[2] === 2 &&
50          typeof args[3] === 'boolean'
51        ) {
52          gdprApplies = args[3];
53          if (typeof args[2] === 'function') {
54            args[2]('set', true);
55          }
56        }
57      } else if (args[0] === 'ping') {
58        var retr = {
59          gdprApplies: gdprApplies,
60          cmpLoaded: false,
61          cmpStatus: 'stub'
62        };
63
64        if (typeof args[2] === 'function') {
65          args[2](retr);
66        }
67      } else {
68        if(args[0] === 'init' && typeof args[3] === 'object') {
69          args[3] = Object.assign(args[3], { tag_version: 'V3' });
70        }
71        queue.push(args);
72      }
73    }
74
75    function postMessageEventHandler(event) {
76      var msgIsString = typeof event.data === 'string';
77      var json = {};
78
79      try {
80        if (msgIsString) {
81          json = JSON.parse(event.data);
82        } else {
83          json = event.data;
84        }
85      } catch (ignore) {}
86
87      var payload = json.__tcfapiCall;
88
89      if (payload) {
90        window.__tcfapi(
91          payload.command,
92          payload.version,
93          function(retValue, success) {
94            var returnMsg = {
95              __tcfapiReturn: {
96                returnValue: retValue,
97                success: success,
98                callId: payload.callId
99              }
100            };
101            if (msgIsString) {
102              returnMsg = JSON.stringify(returnMsg);
103            }
104            if (event && event.source && event.source.postMessage) {
105              event.source.postMessage(returnMsg, '*');
106            }
107          },
108          payload.parameter
109        );
110      }
111    }
112
113    while (win) {
114      try {
115        if (win.frames[TCF_LOCATOR_NAME]) {
116          cmpFrame = win;
117          break;
118        }
119      } catch (ignore) {}
120
121      if (win === window.top) {
122        break;
123      }
124      win = win.parent;
125    }
126    if (!cmpFrame) {
127      addFrame();
128      win.__tcfapi = tcfAPIHandler;
129      win.addEventListener('message', postMessageEventHandler, false);
130    }
131  };
132
133  makeStub();
134
135  function makeGppStub() {
136    const CMP_ID = 10;
137    const SUPPORTED_APIS = [
138      '2:tcfeuv2',
139      '6:uspv1',
140      '7:usnatv1',
141      '8:usca',
142      '9:usvav1',
143      '10:uscov1',
144      '11:usutv1',
145      '12:usctv1'
146    ];
147
148    window.__gpp_addFrame = function (n) {
149      if (!window.frames[n]) {
150        if (document.body) {
151          var i = document.createElement("iframe");
152          i.style.cssText = "display:none";
153          i.name = n;
154          document.body.appendChild(i);
155        } else {
156          window.setTimeout(window.__gpp_addFrame, 10, n);
157        }
158      }
159    };
160    window.__gpp_stub = function () {
161      var b = arguments;
162      __gpp.queue = __gpp.queue || [];
163      __gpp.events = __gpp.events || [];
164
165      if (!b.length || (b.length == 1 && b[0] == "queue")) {
166        return __gpp.queue;
167      }
168
169      if (b.length == 1 && b[0] == "events") {
170        return __gpp.events;
171      }
172
173      var cmd = b[0];
174      var clb = b.length > 1 ? b[1] : null;
175      var par = b.length > 2 ? b[2] : null;
176      if (cmd === "ping") {
177        clb(
178          {
179            gppVersion: "1.1", // must be "Version.Subversion", current: "1.1"
180            cmpStatus: "stub", // possible values: stub, loading, loaded, error
181            cmpDisplayStatus: "hidden", // possible values: hidden, visible, disabled
182            signalStatus: "not ready", // possible values: not ready, ready
183            supportedAPIs: SUPPORTED_APIS, // list of supported APIs
184            cmpId: CMP_ID, // IAB assigned CMP ID, may be 0 during stub/loading
185            sectionList: [],
186            applicableSections: [-1],
187            gppString: "",
188            parsedSections: {},
189          },
190          true
191        );
192      } else if (cmd === "addEventListener") {
193        if (!("lastId" in __gpp)) {
194          __gpp.lastId = 0;
195        }
196        __gpp.lastId++;
197        var lnr = __gpp.lastId;
198        __gpp.events.push({
199          id: lnr,
200          callback: clb,
201          parameter: par,
202        });
203        clb(
204          {
205            eventName: "listenerRegistered",
206            listenerId: lnr, // Registered ID of the listener
207            data: true, // positive signal
208            pingData: {
209              gppVersion: "1.1", // must be "Version.Subversion", current: "1.1"
210              cmpStatus: "stub", // possible values: stub, loading, loaded, error
211              cmpDisplayStatus: "hidden", // possible values: hidden, visible, disabled
212              signalStatus: "not ready", // possible values: not ready, ready
213              supportedAPIs: SUPPORTED_APIS, // list of supported APIs
214              cmpId: CMP_ID, // list of supported APIs
215              sectionList: [],
216              applicableSections: [-1],
217              gppString: "",
218              parsedSections: {},
219            },
220          },
221          true
222        );
223      } else if (cmd === "removeEventListener") {
224        var success = false;
225        for (var i = 0; i < __gpp.events.length; i++) {
226          if (__gpp.events[i].id == par) {
227            __gpp.events.splice(i, 1);
228            success = true;
229            break;
230          }
231        }
232        clb(
233          {
234            eventName: "listenerRemoved",
235            listenerId: par, // Registered ID of the listener
236            data: success, // status info
237            pingData: {
238              gppVersion: "1.1", // must be "Version.Subversion", current: "1.1"
239              cmpStatus: "stub", // possible values: stub, loading, loaded, error
240              cmpDisplayStatus: "hidden", // possible values: hidden, visible, disabled
241              signalStatus: "not ready", // possible values: not ready, ready
242              supportedAPIs: SUPPORTED_APIS, // list of supported APIs
243              cmpId: CMP_ID, // CMP ID
244              sectionList: [],
245              applicableSections: [-1],
246              gppString: "",
247              parsedSections: {},
248            },
249          },
250          true
251        );
252      } else if (cmd === "hasSection") {
253        clb(false, true);
254      } else if (cmd === "getSection" || cmd === "getField") {
255        clb(null, true);
256      }
257      //queue all other commands
258      else {
259        __gpp.queue.push([].slice.apply(b));
260      }
261    };
262    window.__gpp_msghandler = function (event) {
263      var msgIsString = typeof event.data === "string";
264      try {
265        var json = msgIsString ? JSON.parse(event.data) : event.data;
266      } catch (e) {
267        var json = null;
268      }
269      if (typeof json === "object" && json !== null && "__gppCall" in json) {
270        var i = json.__gppCall;
271        window.__gpp(
272          i.command,
273          function (retValue, success) {
274            var returnMsg = {
275              __gppReturn: {
276                returnValue: retValue,
277                success: success,
278                callId: i.callId,
279              },
280            };
281            event.source.postMessage(msgIsString ? JSON.stringify(returnMsg) : returnMsg, "*");
282          },
283          "parameter" in i ? i.parameter : null,
284          "version" in i ? i.version : "1.1"
285        );
286      }
287    };
288    if (!("__gpp" in window) || typeof window.__gpp !== "function") {
289      window.__gpp = window.__gpp_stub;
290      window.addEventListener("message", window.__gpp_msghandler, false);
291      window.__gpp_addFrame("__gppLocator");
292    }
293  };
294
295  makeGppStub();
296
297  var uspStubFunction = function() {
298    var arg = arguments;
299    if (typeof window.__uspapi !== uspStubFunction) {
300      setTimeout(function() {
301        if (typeof window.__uspapi !== 'undefined') {
302          window.__uspapi.apply(window.__uspapi, arg);
303        }
304      }, 500);
305    }
306  };
307
308  var checkIfUspIsReady = function() {
309    uspTries++;
310    if (window.__uspapi === uspStubFunction && uspTries < uspTriesLimit) {
311      console.warn('USP is not accessible');
312    } else {
313      clearInterval(uspInterval);
314    }
315  };
316
317  if (typeof window.__uspapi === 'undefined') {
318    window.__uspapi = uspStubFunction;
319    var uspInterval = setInterval(checkIfUspIsReady, 6000);
320  }
321})();
322// End InMobi Choice. Consent Manager Tag v3.0 (for TCF 2.2)

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.