PageSourceSearch

https://ejfoundation.org/vite/assets/FitText-0a90e8a8.js

js ejfoundation.org collected 2026-09-24 08:36:59 UTC 3,548 bytes, 2 lines download raw bytes

1import{c as p,g as b}from"./_commonjsHelpers-725317a4.js";var m={exports:{}};(function(y,v){(function(c,f){y.exports=f()})(typeof p=="object"?p:p,function(){var c={alignVert:!1,alignHoriz:!1,multiLine:!1,detectMultiLine:!0,minFontSize:6,maxFontSize:80,reProcess:!0,widthOnly:!1,alignVertWithFlexbox:!1};return function(e,i){i||(i={});var l={};for(var n in c)i.hasOwnProperty(n)?l[n]=i[n]:l[n]=c[n];typeof e.toArray=="function"&&(e=e.toArray());var a=Object.prototype.toString.call(e);a!=="[object Array]"&&a!=="[object NodeList]"&&a!=="[object HTMLCollection]"&&(e=[e]);for(var r=0;r<e.length;r++)f(e[r],l)};function f(t,e){if(!w(t)||!e.reProcess&&t.getAttribute("textFitted"))return!1;e.reProcess||t.setAttribute("textFitted",1);var i,l,n,a,r,o,s;if(n=t.innerHTML,a=F(t),l=h(t),!a||!e.widthOnly&&!l)throw e.widthOnly?new Error("Set a static width on the target element "+t.outerHTML+" before using textFit!"):new Error("Set a static height and width on the target element "+t.outerHTML+" before using textFit!");n.indexOf("textFitted")===-1?(i=document.createElement("span"),i.className="textFitted",i.style.display="inline-block",i.innerHTML=n,t.innerHTML="",t.appendChild(i)):(i=t.querySelector("span.textFitted"),u(i,"textFitAlignVert")&&(i.className=i.className.replace("textFitAlignVert",""),i.style.height="",t.className.replace("textFitAlignVertFlex",""))),e.alignHoriz&&(t.style["text-align"]="center",i.style["text-align"]="center");var d=e.multiLine;e.detectMultiLine&&!d&&i.scrollHeight>
1=parseInt(window.getComputedStyle(i)["font-size"],10)*2&&(d=!0),d||(t.style["white-space"]="nowrap"),r=e.minFontSize,s=e.maxFontSize;for(var x=r;r<=s;)o=s+r>>1,i.style.fontSize=o+"px",i.scrollWidth<=a&&(e.widthOnly||i.scrollHeight<=l)?(x=o,r=o+1):s=o-1;if(i.style.fontSize!=x+"px"&&(i.style.fontSize=x+"px"),e.alignVert){S();var V=i.scrollHeight;window.getComputedStyle(t).position==="static"&&(t.style.position="relative"),u(i,"textFitAlignVert")||(i.className=i.className+" textFitAlignVert"),i.style.height=V+"px",e.alignVertWithFlexbox&&!u(t,"textFitAlignVertFlex")&&(t.className=t.className+" textFitAlignVertFlex")}}function h(t){var e=window.getComputedStyle(t,null);return t.clientHeight-parseInt(e.getPropertyValue("padding-top"),10)-parseInt(e.getPropertyValue("padding-bottom"),10)}function F(t){var e=window.getComputedStyle(t,null);return t.clientWidth-parseInt(e.getPropertyValue("padding-left"),10)-parseInt(e.getPropertyValue("padding-right"),10)}function w(t){return typeof HTMLElement=="object"?t instanceof HTMLElement:t&&typeof t=="object"&&t!==null&&t.nodeType===1&&typeof t.nodeName=="string"}function u(t,e){return(" "+t.className+" ").indexOf(" "+e+" ")>-1}function S(){if(!document.getElementById("textFitStyleSheet")){var t=[".textFitAlignVert{","position: absolute;","top: 0; right: 0; bottom: 0; left: 0;","margin: auto;","display: flex;","justify-content: center;","flex-direction: column;","}",".textFitAlignVertFlex{","display: flex;","}",".textFitAlignVertFlex .textFitAlignVert{","position: static;","}"].join(""),e=document.createElement("style");e.type="text/css",e.id="textFitStyleSheet",e.innerHTML=t,document.body.appendChild(e)}}})})(m);var H=m.exports;const g=b(H);function L(){g(document.getElementsByClassName("stat__line"),{multiline:!0,widthOnly:!0,maxFontSize:180,alignVert:!1,alignVertWithFlexbox:!0}),g(document.getElementsByClassName("stat__line--one"),{multiline:!0,widthOnly:!0,maxFontSize:50,alignVert:!1,alignVertWithFlexbox:!0})}export{L as default};
2//# sourceMappingURL=FitText-0a90e8a8.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.