UNPKG

cogjs

Version:

CogJS is a lightweight, modular JavaScript library for cognitive and neurodivergent accessibility on the web.

255 lines (246 loc) 24 kB
"use strict";(()=>{window.cogReadConfig={read:{label:"Speak",iconSize:"1.5rem"},styles:` .cog-read-button { background-color: transparent; color: #000; } .cog-read-button:hover { background-color: #000; } `};window.cogConfig={active:!0,animation:{default:!0,respectSystemPref:!0,styles:` .cog-no-animation *, .cog-no-animation { animation: none !important; transition: none !important; scroll-behavior: auto !important; } `},background:window.cogThemeConfig,read:{...window.cogReadConfig?.read||{},...window.cogReadConfig?.styles?{styles:window.cogReadConfig.styles}:{}}};window.isCogActive=function(r){for(;r;){let a=r.getAttribute&&r.getAttribute("cog-active");if(a==="false")return!1;if(a==="true")return!0;r=r.parentElement}return window.cogConfig.active!==!1};(function(){let r=window.cogConfig||{};window.injectCogStyle=function(s,c="cog-style"){if(document.getElementById(c))return;let o=document.createElement("style");o.id=c,o.textContent=s,document.head.appendChild(o)};let a=!1;window.initCogAccessibility=function(){a||(a=!0,typeof window.initCogAnimation=="function"&&window.initCogAnimation(),typeof window.initCogBackground=="function"&&window.initCogBackground(),typeof window.initCogRead=="function"&&window.initCogRead(),typeof window.initCogToggleContent=="function"&&window.initCogToggleContent(),typeof window.initCogChunk=="function"&&window.initCogChunk(),typeof window.initCogHint=="function"&&window.initCogHint(),typeof window.initCogPath=="function"&&window.initCogPath(),typeof window.initCogRemind=="function"&&window.initCogRemind(),typeof window.initCogTOC=="function"&&window.initCogTOC(),typeof window.initCogGhost=="function"&&window.initCogGhost(),typeof window.initCogOrient=="function"&&window.initCogOrient(),typeof window.initCogDelay=="function"&&window.initCogDelay(),typeof window.initCogBreak=="function"&&window.initCogBreak())},document.addEventListener("DOMContentLoaded",window.initCogAccessibility)})();(function(){let r=window.cogConfig||{};function a(){let c=window.matchMedia("(prefers-reduced-motion: reduce)").matches;r.animation?.respectSystemPref&&c&&document.body.classList.add("cog-no-animation")}function s(){r.animation?.styles&&window.injectCogStyle(r.animation.styles),a(),document.querySelectorAll("[cog-animation]").forEach(o=>{if(!window.isCogActive(o))return;o.getAttribute("cog-animation")==="false"&&o.classList.add("cog-no-animation")})}window.initCogAnimation=s})();(function(){let a=(window.cogConfig||{}).background||{};function s(o,n=document){let e=a.themes?.[o]||a.themes?.[a.defaultTheme];e&&(n instanceof Element&&(n.style.backgroundColor=e.background,n.style.color=e.foreground),a.targets?.background?.forEach(i=>{n.querySelectorAll(i).forEach(l=>{l.style.backgroundColor=e.background})}),a.targets?.foreground?.forEach(i=>{n.querySelectorAll(i).forEach(l=>{l.style.color=e.foreground})}))}function c(){let o=document.querySelectorAll("[cog-background]");if(o.length>0)o.forEach(n=>{if(!window.isCogActive(n))return;let e=n.getAttribute("cog-background");s(e,n)});else{let n=document.body.getAttribute("cog-background")||a.defaultTheme;s(n,document.body)}}window.initCogBackground=c})();(function(){let r=window.cogConfig||{};console.log("[CogJS] cog-read.js executing");let a=` .cog-read-button { position: absolute; top: 0.5rem; right: 0.5rem; background-color: #000; color: black; border: none; padding: 0.25rem; cursor: pointer; border-radius: 4px; z-index: 1000; display: flex; align-items: center; justify-content: center; background: transparent; } .cog-read-button svg { display: inline-block; fill: black; } .cog-read-button:hover { background-color: #666; color: #fff; } `;function s(){if(!window.speechSynthesis)return;if(typeof window.injectCogStyle!="function"||typeof window.isCogActive!="function"){console.warn("Required cog functions not available");return}window.injectCogStyle(a,"cog-style-read-default"),(r.read?.styles||r.styles)&&window.injectCogStyle(r.read?.styles||r.styles,"cog-style-read"),document.querySelectorAll("[cog-read]").forEach((o,n)=>{if(!window.isCogActive(o)||o.querySelector(".cog-read-button"))return;let e=document.createElement("span");e.setAttribute("aria-hidden","true"),e.style.display="inline";let i=document.createElement("button"),l=`cog-read-button-${n}`,d=r.read?.label,u=r.read?.iconSize||"1.24rem";i.id=l,i.className="cog-read-button",i.setAttribute("tabindex","-1"),i.setAttribute("type","button"),i.setAttribute("aria-hidden","true"),i.setAttribute("title",r.read?.label||"Read aloud"),i.innerHTML=` <svg width="${u}" height="${u}" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> <title>${d||"Read"}</title> <g paint-order="stroke fill markers"> <path fill="currentColor" d="M9.37 20.38c-.02 0-.04 0-.05 0H7.24v.01c-.5.08-.88.5-.88 1.02v10.4c0 .52.38.95.88 1.02v.01h4.23V20.38H9.38c-.01 0-.01 0-.01 0z"/> <path fill="currentColor" d="M23.81 11.58c-.27 0-.55.07-.79.21l-9.94 8.12v13.22h.04l9.9 8.09c.24.14.52.21.79.21.59-.01 1.13-.39 1.13-1.29V12.87c0-.9-.54-1.28-1.13-1.29z"/> <path fill="currentColor" d="M28.54 18.8c-.64-1.38-.34-1.88.05-2.33.32-.37 1.53-.74 2.27.07 5.44 6.59 4.67 13.9 0 19.71-1.93 1.85-3.44-.24-2.19-2.19 4.06-6.56 3.58-9.04-.12-15.27z"/> <path fill="currentColor" d="M33.33 13.08c-.68-1.08-.39-1.86-.01-2.27.35-.38 1.45-.75 2.32.02 8.16 8.84 8.67 20.91.12 31.28-1.14 1.54-4.06.51-2.19-2.19 6.63-8.47 6.86-18-0.24-26.83z"/> </g> </svg> `,i.addEventListener("click",()=>{if(window.speechSynthesis.speaking){window.speechSynthesis.cancel();return}let t=e.style.display;e.style.display="none";let g=o.textContent.trim();if(e.style.display=t,g=g.replace(l,"").trim(),g&&g!==r.read?.label){let m=new SpeechSynthesisUtterance(g);m.volume=1,m.pitch=1,m.rate=1,window.speechSynthesis.speak(m)}}),e.appendChild(i),o.style.position="relative",o.appendChild(e)})}window.initCogRead=s})();(function(){let r=` .cog-toggle { position: relative; padding: 1rem; border: 1px solid #ccc; border-radius: 0.5rem; margin-bottom: 1rem; } .cog-toggle-button { position: absolute; top: 10px; left: 10px; background: #000; color: #fff; border-radius: 50%; width: 30px; height: 30px; display: flex; justify-content: center; align-items: center; cursor: pointer; border: none; } .cog-toggle-button:hover { background-color: #333; } .cog-toggle-button svg { width: 20px; height: 20px; fill: currentColor; } .cog-toggle-label { position: absolute; top: 10px; left: 50px; font-weight: bold; font-size: 0.875rem; background: transparent; padding: 0.25rem 0.5rem; border-radius: 0.25rem; user-select: none; } .cog-version { margin-top: 40px; } .cog-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; } `;function a(){if(document.getElementById("cog-style-toggle"))return;let c=document.createElement("style");c.id="cog-style-toggle",c.textContent=r,document.head.appendChild(c)}function s(){a(),document.querySelectorAll("[cog-toggle-content]").forEach(c=>{if(!window.isCogActive?.(c))return;let o=Array.from(c.children);if(o.length<2)return;let n=document.createElement("div");n.className="cog-toggle-body",o.forEach((t,g)=>{t.classList.add("cog-version"),t.hidden=g!==0,n.appendChild(t)});let e=document.createElement("div");e.className="cog-toggle",c.replaceWith(e),e.appendChild(n);let i=document.createElement("div");i.className="cog-visually-hidden",i.setAttribute("aria-live","polite"),e.appendChild(i);let l=document.createElement("span");l.className="cog-toggle-label",l.textContent=`Cycle text version 1 of ${o.length}`,l.setAttribute("aria-hidden","true");let d=document.createElement("button");d.className="cog-toggle-button",d.setAttribute("type","button"),d.setAttribute("aria-label","Cycle text version"),d.innerHTML=` <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <title>Cycle version button</title> <path d="M25.988 5.503c-7.694-2.198-8.41 7.097-4.122 9.34l10.308 5.377C16.086 28.914 8.439 47.808 13.949 65.244c6.4 20.057 27.848 31.128 47.906 24.728 20.058-6.4 31.129-27.849 24.728-47.907a38.12 38.12 0 0 0-4.728-9.746l-7.525 7.302a27.865 27.865 0 0 1 2.483 5.562c4.679 14.662-3.414 30.34-18.076 35.018-14.662 4.679-30.34-3.414-35.018-18.075-4.009-12.607 1.4-26.296 12.943-32.758l-.742 11.996c-.899 7.21 9.394 8.35 10.098 1.507l1.866-20.298.8-6.073-5.205-2.331Z"/> </svg> `;let u=0;d.addEventListener("click",()=>{o[u].hidden=!0,u=(u+1)%o.length,o[u].hidden=!1,l.textContent=`Cycle text version ${u+1} of ${o.length}`,i.textContent=`Showing version ${u+1} of ${o.length}`}),e.insertBefore(d,n),e.insertBefore(l,d)})}window.initCogToggleContent=s})();(function(){function r(){document.querySelectorAll("[cog-chunk]").forEach(s=>{if(!window.isCogActive(s))return;let c=Array.from(s.children).filter(t=>t.tagName==="FIELDSET"||t.tagName==="DIV"),o=c.length,n=0;c.forEach((t,g)=>{t.classList.add("cog-chunk-step"),t.setAttribute("aria-hidden","true");let m=document.createElement("div");m.className="cog-chunk-counter",m.textContent=`Step ${g+1} of ${o}`,t.prepend(m)});let e=document.createElement("div");e.className="cog-chunk-nav";let i=document.createElement("button"),l=document.createElement("button");i.textContent="Previous",l.textContent="Next",e.append(i,l),s.append(e);function d(){i.disabled=n===0,l.disabled=n===o-1}function u(t){c.forEach((g,m)=>{g.setAttribute("aria-hidden",m!==t),g.setAttribute("aria-current",m===t?"step":"false")}),d()}i.addEventListener("click",()=>{n>0&&(n--,u(n))}),l.addEventListener("click",()=>{n<o-1&&(n++,u(n))}),document.addEventListener("keydown",t=>{t.key==="ArrowRight"&&!l.disabled&&l.click(),t.key==="ArrowLeft"&&!i.disabled&&i.click()}),u(n)})}let a=document.createElement("style");a.textContent=` .cog-chunk-step { display: none; } .cog-chunk-step[aria-current="step"] { display: block; } .cog-chunk-nav { display: flex; justify-content: space-between; margin-top: 1rem; } .cog-chunk-nav button:disabled { opacity: 0.5; cursor: not-allowed; } .cog-chunk-counter { font-size: 0.9em; color: #666; margin-bottom: 0.5rem; font-weight: bold; } `,document.head.append(a),window.initCogChunk=r})();(function(){function r(){document.querySelectorAll("[cog-hint]").forEach(s=>{if(!window.isCogActive(s))return;let c=s.getAttribute("cog-hint");if(!c)return;let o=document.createElement("div");o.className="cog-hint-tooltip",o.setAttribute("role","tooltip"),o.textContent=c,o.style.display="none",s.appendChild(o),s.addEventListener("focusin",()=>{o.style.display="block",o.style.opacity="1"}),s.addEventListener("focusout",()=>{o.style.opacity="0",setTimeout(()=>{o.style.display="none"},300)});let n;s.addEventListener("mouseenter",()=>{n=setTimeout(()=>{o.style.display="block",o.style.opacity="1"},800)}),s.addEventListener("mouseleave",()=>{clearTimeout(n),o.style.opacity="0",setTimeout(()=>{o.style.display="none"},300)})})}let a=document.createElement("style");a.textContent=` .cog-hint-tooltip { position: absolute; bottom: 0rem; background-color: #ccc; color: #000; padding: 0.5em 1em; font-size: 0.875em; border-radius: 0.5em; opacity: 0; transition: opacity 0.3s ease; z-index: 1000; white-space: nowrap; pointer-events: none; transform: translateY(-120%); } [cog-hint] { position: relative; } `,document.head.append(a),window.initCogHint=r})();(function(){let r="cogGlobalPathTrail";function s(){return document.querySelector('meta[name="cog-label"]')?.content||document.title||window.location.pathname}function c(){try{let e=JSON.parse(sessionStorage.getItem(r));if(e&&Date.now()-e.timestamp<72e5)return e.trail||[]}catch(e){console.warn("Error loading trail:",e)}return[]}function o(e){sessionStorage.setItem(r,JSON.stringify({trail:e,timestamp:Date.now()}))}function n(){let e=document.querySelector("[cog-path]");if(!e){console.warn("[cog-path] not found");return}let i=window.location.pathname,l=s(),d=c().filter(u=>u.path!==i);d.push({path:i,label:l}),o(d),e.innerHTML="",e.setAttribute("role","navigation"),e.setAttribute("aria-label","Breadcrumb"),d.forEach((u,t)=>{let g=document.createElement("a");if(g.href=u.path,g.textContent=u.label,g.setAttribute("aria-current",t===d.length-1?"location":"false"),e.appendChild(g),t<d.length-1){let m=document.createElement("span");m.textContent=" \u203A ",m.setAttribute("aria-hidden","true"),e.appendChild(m)}}),console.log("\u{1F4CD} cog-path trail updated:",d)}window.initCogPath=n})();(function(){function r(o){if(!o)return null;let[n,...e]=o.split(":"),i=e.join(":").trim(),l=a(n.trim());return isNaN(l)||!i?null:{ms:l,message:i}}function a(o){let n=o.match(/^(\d+)([smh])$/);if(!n)return NaN;let[,e,i]=n,l={s:1e3,m:6e4,h:36e5};return parseInt(e,10)*(l[i]||0)}function s(o){let n=document.getElementById("cog-toast-container");n||(n=document.createElement("div"),n.id="cog-toast-container",n.setAttribute("aria-live","polite"),n.setAttribute("role","status"),n.style.cssText=` position: fixed; top: 1rem; right: 1rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 9999; `,document.body.appendChild(n));let e=document.createElement("div");e.className="cog-remind-toast",e.textContent=o,e.style.cssText=` background: #000; color: #fff; padding: 0.75rem 1rem; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.2); font-size: 0.9rem; max-width: 300px; opacity: 0; transform: translateY(10px); transition: opacity 0.3s ease, transform 0.3s ease; `,n.appendChild(e),requestAnimationFrame(()=>{e.style.opacity="1",e.style.transform="translateY(0)"}),setTimeout(()=>{e.style.opacity="0",e.style.transform="translateY(10px)",setTimeout(()=>e.remove(),300)},5e3)}function c(){document.querySelectorAll("[cog-remind]").forEach(n=>{if(!window.isCogActive?.(n))return;let e=n.getAttribute("cog-remind"),i=r(e);i&&setTimeout(()=>{s(i.message)},i.ms)})}window.initCogRemind=c})();(function(){function r(){document.querySelectorAll("[cog-toc]").forEach(s=>{if(!window.isCogActive?.(s))return;let c=document.createElement("ul");c.className="cog-toc-list",c.setAttribute("role","list");let o=s.nextElementSibling;if(!o)return;let n=o.querySelectorAll("h1, h2, h3, h4");n.length&&(n.forEach((e,i)=>{let l=parseInt(e.tagName.slice(1),10),d=`cog-toc-${i}`;e.id=d;let u=document.createElement("li");u.className=`cog-toc-level-${l}`;let t=document.createElement("a");if(t.href=`#${d}`,t.textContent=e.textContent,t.setAttribute("role","link"),u.appendChild(t),c.appendChild(u),s.hasAttribute("cog-toc-back")){let g=document.createElement("a");g.href=`#${s.id||"top"}`,g.className="cog-toc-back",g.textContent="Back to top";let m=e.nextElementSibling;for(;m&&m.tagName?.startsWith("H");)m=m.nextElementSibling;m?m.insertAdjacentElement("afterend",g):e.insertAdjacentElement("afterend",g)}}),s.appendChild(c))})}window.initCogTOC=r})();(function(){function a(){let n=document.createElement("style");n.textContent=` .cog-ghost-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(5px); pointer-events: none; z-index: 9998; opacity: 0; transition: opacity 0.3s ease; } .cog-ghost-overlay.active { opacity: 1; pointer-events: auto; } .cog-ghost-target { position: relative !important; z-index: 9999 !important; } `,document.head.appendChild(n)}function s(){if(document.querySelector(".cog-ghost-overlay"))return;let n=document.createElement("div");n.className="cog-ghost-overlay",n.setAttribute("aria-hidden","true"),document.body.appendChild(n)}function c(){let n=document.querySelector(".cog-ghost-overlay");n&&document.querySelectorAll("[cog-ghost]").forEach(e=>{e.dataset.ghostInitialized||(e.addEventListener("focus",()=>{n.classList.add("active"),e.classList.add("cog-ghost-target")}),e.addEventListener("blur",()=>{n.classList.remove("active"),e.classList.remove("cog-ghost-target")}),e.dataset.ghostInitialized="true")})}function o(){a(),s(),c(),new MutationObserver(c).observe(document.body,{childList:!0,subtree:!0})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",o):o()})();(function(){let a="cog-orient-active",s=document.createElement("style");s.textContent=` .${a} { outline: 2px solid #007acc; background-color: rgba(0, 122, 204, 0.05); transition: background-color 0.3s ease, outline 0.3s ease; } `,document.head.appendChild(s);let c=new IntersectionObserver(o=>{let n=o.filter(e=>e.isIntersecting);n.length>0&&(n.sort((e,i)=>e.boundingClientRect.top-i.boundingClientRect.top),document.querySelectorAll("[cog-orient]").forEach(e=>{e.classList.remove(a)}),n[0].target.classList.add(a))},{threshold:.5});document.querySelectorAll("[cog-orient]").forEach(o=>{c.observe(o)})})();(function(){let a="cog-delay-active",s="cog-delay-cancel",c="cog-delay-disabled",o="cog-delay-countdown",n=Symbol("originalLabel");function e(){let t=document.getElementById("cog-delay-live");return t||(t=document.createElement("div"),t.id="cog-delay-live",t.setAttribute("aria-live","assertive"),t.setAttribute("role","status"),t.setAttribute("aria-atomic","true"),Object.assign(t.style,{position:"absolute",width:"1px",height:"1px",overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"}),document.body.appendChild(t)),t}function i(t){t.setAttribute("aria-disabled","true"),t.tabIndex=-1,t.classList.add(c)}function l(t){t.removeAttribute("aria-disabled"),t.tabIndex=0,t.classList.remove(c)}function d(t){if(t.dataset.delayInitialized)return;t.dataset.delayInitialized="true";let g=t.getAttribute("cog-delay")||"3s",m=parseFloat(g)*1e3;t.addEventListener("click",y=>{if(t.dataset.cogDelayActive==="true")return;y.preventDefault(),y.stopImmediatePropagation();let w=t.getAttribute("cog-onclick"),C=t.closest("form"),k=t.type==="submit"&&C,h=Math.max(1,Math.round(m/1e3)),A=t.innerHTML;t[n]=A,t.dataset.cogDelayActive="true",t.classList.add(a),i(t),t.innerHTML="Confirm action";let f=document.createElement("span");f.className=o,f.setAttribute("aria-hidden","true"),f.style.marginLeft="0.5rem",f.textContent=`(${h})`,t.insertAdjacentElement("afterend",f),t.setAttribute("aria-describedby",f.id=`cog-countdown-${Date.now()}`);let p=document.createElement("button");p.type="button",p.className=s,p.innerText="Cancel",p.setAttribute("aria-label","Cancel delayed action"),Object.assign(p.style,{marginLeft:"1rem",fontSize:"0.9rem",padding:"0.3rem 0.75rem"}),f.insertAdjacentElement("afterend",p);let b=e();b.textContent="",setTimeout(()=>{b.textContent=`You have ${h} seconds to cancel`},50);let v=setInterval(()=>{h--,h>0?f.textContent=`(${h})`:(clearInterval(v),p.remove(),f.remove(),t.classList.remove(a),t.innerHTML=t[n],l(t),t.dataset.cogDelayActive="false",t.removeAttribute("aria-describedby"),w&&typeof window[w]=="function"?window[w](t):k?C.requestSubmit(t):t.click(),b.textContent="")},m/5);p.addEventListener("click",()=>{clearInterval(v),p.remove(),f.remove(),t.classList.remove(a),t.innerHTML=t[n],l(t),t.dataset.cogDelayActive="false",t.removeAttribute("aria-describedby"),b.textContent="Action canceled"})})}function u(){document.querySelectorAll("button[cog-delay]").forEach(d),new MutationObserver(()=>{document.querySelectorAll("button[cog-delay]").forEach(d)}).observe(document.body,{childList:!0,subtree:!0})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",u):u()})();(function(){let r=window.cogBreakConfig||{};function a(e){return`You have ${e} minute${e!==1?"s":""} left.`}function s(){if(document.getElementById("cog-break-styles"))return;let e=document.createElement("style");e.id="cog-break-styles",e.textContent=` .cog-break-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.8); color: #fff; display: flex; align-items: center; justify-content: center; z-index: 9999; } .cog-break-inner { background: #333; padding: 2rem; border-radius: 0.5rem; text-align: center; max-width: 90%; width: 400px; outline: none; } .cog-break-title { margin-bottom: 1rem; } .cog-break-message { margin-bottom: 2rem; } .cog-break-cancel { background: #f33; color: #fff; padding: 0.75rem 1.5rem; border: none; border-radius: 0.3rem; font-size: 1rem; cursor: pointer; } .cog-break-button { margin-top: 1rem; } `,document.head.appendChild(e)}function c(e){let i=document.createElement("div");i.className="cog-break-modal",i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true"),i.setAttribute("tabindex","-1");let l=r.title||`You are taking a break for ${e} minutes.`,d=r.message||a(e),u=r.cancelButton||"Cancel Break";return i.innerHTML=` <div class="cog-break-inner" tabindex="0"> <h2 class="cog-break-title">${l}</h2> <p class="cog-break-message">${d}</p> <button type="button" class="cog-break-cancel">${u}</button> </div> `,document.body.appendChild(i),i.querySelector(".cog-break-inner").focus(),i.addEventListener("keydown",function(t){t.key==="Escape"&&o(i)}),i.querySelector(".cog-break-cancel").addEventListener("click",function(){o(i)}),i}function o(e){e.timerInterval&&clearInterval(e.timerInterval),e.remove()}function n(){s();let e=document.querySelectorAll("[cog-break]");e.length>0&&e.forEach(i=>{if(!window.isCogActive(i))return;let l=i.getAttribute("cog-break"),d=parseInt(l,10)||5,u=r.buttonText||"Take a Break",t=document.createElement("button");t.type="button",t.className="cog-break-button",t.textContent=u,t.addEventListener("click",function(){if(document.querySelector(".cog-break-modal"))return;let g=c(d),m=d-1;g.timerInterval=setInterval(()=>{if(m<=0)o(g);else{let y=g.querySelector(".cog-break-message");y&&(y.textContent=a(m)),m--}},6e4)}),i.appendChild(t)})}window.initCogBreak=n})();typeof window.initCogRead!="function"?console.warn("initCogRead not available on window"):console.log("\u2705 initCogRead registered");console.log("initCogRead:",typeof window.initCogRead);console.log("keys:",Object.keys(window).filter(r=>r.startsWith("initCog")));typeof window.initCogAccessibility=="function"&&window.initCogAccessibility();})();