PageSourceSearch

https://www.foregon.com/static/blog/js/pagination.4186c12077399af75171.js

js foregon.com collected 2026-10-02 10:58:36 UTC 15,691 bytes, 82 lines download raw bytes

vendor: 6,474 bytes, lines 1-2
1/*! For license information please see pagination.4186c12077399af75171.js.LICENSE.txt */
2"use strict";(globalThis.webpackChunkblog||=[]).push([[67],{644(e,t,s){s.d(t,{default:()=>K});const n=new WeakMap,i=e=>(...t)=>{const s=e(...t);return n.set(s,!0),s},a=e=>"function"==typeof e&&n.has(e),r="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,o=(e,t,s=null)=>{for(;t!==s;){const s=t.nextSibling;e.removeChild(t),t=s}},l={},c={},d=`{{lit-${String(Math.random()).slice(2)}}}`,h=`\x3c!--${d}--\x3e`,u=new RegExp(`${d}|${h}`),p="$lit$";class m{constructor(e,t){this.parts=[],this.element=t;const s=[],n=[],i=document.createTreeWalker(t.content,133,null,!1);let a=0,r=-1,o=0;const{strings:l,values:{length:c}}=e;for(;o<c;){const e=i.nextNode();if(null!==e){if(r++,1===e.nodeType){if(e.hasAttributes()){const t=e.attributes,{length:s}=t;let n=0;for(let e=0;e<s;e++)g(t[e].name,p)&&n++;for(;n-- >0;){const t=l[o],s=_.exec(t)[2],n=s.toLowerCase()+p,i=e.getAttribute(n);e.removeAttribute(n);const a=i.split(u);this.parts.push({type:"attribute",index:r,name:s,strings:a}),o+=a.length-1}}"TEMPLATE"===e.tagName&&(n.push(e),i.currentNode=e.content)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(d)>=0){const n=e.parentNode,i=t.split(u),a=i.length-1;for(let t=0;t<a;t++){let s,a=i[t];if(""===a)s=v();else{const e=_.exec(a);null!==e&&g(e[2],p)&&(a=a.slice(0,e.index)+e[1]+e[2].slice(0,-5)+e[3]),s=document.createTextNode(a)}n.insertBefore(s,e),this.parts.push({type:"node",index:++r})}""===i[a]?(n.insertBefore(v(),e),s.push(e)):e.data=i[a],o+=a}}else if(8===e.nodeType)if(e.data===d){const t=e.parentNode;null!==e.previousSibling&&r!==a||(r++,t.insertBefore(v(),e)),a=r,this.parts.push({type:"node",index:r}),null===e.nextSibling?e.data="":(s.push(e),r--),o++}else{let t=-1;for(;-1!==(t=e.data.indexOf(d,t+1));)this.parts.push({type:"node",index:-1}),o++}}else i.currentNode=n.pop()}for(const e of s)e.parentNode.removeChild(e)}}const g=(e,t)=>{const s=e.length-t.length;return s>=0&&e.slice(s)===t},f=e=>-1!==e.index,v=()=>document.createComment(""),_=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class y{constructor(e,t,s){this.__parts=[],this.template=e,this.processor=t,this.options=s}update(e){let t=0;for(const s of this.__parts)void 0!==s&&s.setValue(e[t]),t++;for(const e of this.__parts)void 0!==e&&e.commit()}_clone(){const e=r?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],s=this.template.parts,n=document.createTreeWalker(e,133,null,!1);let i,a=0,o=0,l=n.nextNode();for(;a<s.length;)if(i=s[a],f(i)){for(;o<i.index;)o++,"TEMPLATE"===l.nodeName&&(t.push(l),n.currentNode=l.content),null===(l=n.nextNode())&&(n.currentNode=t.pop(),l=n.nextNode());if("node"===i.type){const e=this.processor.handleTextExpression(this.options);e.insertAfterNode(l.previousSibling),this.__parts.push(e)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,i.name,i.strings,this.options));a++}else this.__parts.push(void 0),a++;return r&&(document.adoptNode(e),customElements.upgrade(e)),e}}const x=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:e=>e}),b=` ${d} `;class k{constructor(e,t,s,n){this.strings=e,this.values=t,this.type=s,this.processor=n}getHTML(){const e=this.strings.length-1;let t="",s=!1;for(let n=0;n<e;n++){const e=this.strings[n],i=e.lastIndexOf("\x3c!--");s=(i>-1||s)&&-1===e.indexOf("--\x3e",i+1);const a=_.exec(e);t+=null===a?e+(s?b:h):e.substr(0,a.index)+a[1]+a[2]+"$lit$"+a[3]+d}return t+=this.strings[e],t}getTemplateElement(){const e=document.createElement("template");let t=this.getHTML();return void 0!==x&&(t=x.createHTML(t)),e.innerHTML=t,e}}const $=e=>null===e||!("object"==typeof e||"function"==typeof e),N=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class w{constructor(e,t,s){this.dirty=!0,this.element=e,this.name=t,this.strings=s,this.parts=[];for(let e=0;e<s.length-1;e++)this.parts[e]=this._createPart()}_createPart(){return new E(this)}_getValue(){const e=this.strings,t=e.length-1,s=this.parts;if(1===t&&""===e[0]&&""===e[1]){const e=s[0].value;if("symbol"==typeof e)return String(e);if("string"==typeof e||!N(e))return e}let n="";for(let i=0;i<t;i++){n+=e[i];const t=s[i];if(void 0!==t){const e=t.value;if($(e)||!N(e))n+="string"==typeof e?e:String(e);else for(const t of e)n+="string"==typeof t?t:String(t)}}return n+=e[t],n}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class E{constructor(e){this.value=void 0,this.committer=e}setValue(e){e===l||$(e)&&e===this.value||(this.value=e,a(e)||(this.committer.dirty=!0))}commit(){for(;a(this.value);){const e=this.value;this.value=l,e(this)}this.value!==l&&this.committer.commit()}}class V{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(v()),this.endNode=e.appendChild(v())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=v()),e.__insert(this.endNode=v())}insertAfterPart(e){e.__insert(this.startNode=v()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(null===this.startNode.parentNode)return;for(;a(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=l,e(this)}const e=this.__pendingValue;e!==l&&($(e)?e!==this.value&&this.__commitText(e):e instanceof k?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):N(e)?this.__commitIterable(e):e===c?(this.value=c,this.clear()):this.__commitText(e))}__insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}__commitNode(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}__commitText(e){const t=this.startNode.nextSibling,s="string"==typeof(e=e??"")?e:String(e);t===this.endNode.previousSibling&&3===t.nodeType?t.data=s:this.__commitNode(document.createTextNode(s)),this.value=e}__commitTemplateResult(e){const t=this.options.templateFactory(e);if(this.value instanceof y&&this.value.template===t)this.value.update(e.values);else{const s=new y(t,e.processor,this.options),n=s._clone();s.update(e.values),this.__commitNode(n),this.value=s}}__commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());const t=this.value;let s,n=0;for(const i of e)s=t[n],void 0===s&&(s=new V(this.options),t.push(s),0===n?
2s.appendIntoPart(this):s.insertAfterPart(t[n-1])),s.setValue(i),s.commit(),n++;n<t.length&&(t.length=n,this.clear(s&&s.endNode))}clear(e=this.startNode){o(this.startNode.parentNode,e.nextSibling,this.endNode)}}class T{constructor(e,t,s){if(this.value=void 0,this.__pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=s}setValue(e){this.__pendingValue=e}commit(){for(;a(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=l,e(this)}if(this.__pendingValue===l)return;const e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=l}}class C extends w{constructor(e,t,s){super(e,t,s),this.single=2===s.length&&""===s[0]&&""===s[1]}_createPart(){return new A(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class A extends E{}let L=!1;(()=>{try{const e={get capture(){return L=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class S{constructor(e,t,s){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=s,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;a(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=l,e(this)}if(this.__pendingValue===l)return;const e=this.__pendingValue,t=this.value,s=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),n=null!=e&&(null==t||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),n&&(this.__options=M(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=l}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const M=e=>e&&(L?{capture:e.capture,passive:e.passive,once:e.once}:e.capture);const I=new class{handleAttributeExpressions(e,t,s,n){const i=t[0];if("."===i){return new C(e,t.slice(1),s).parts}if("@"===i)return[new S(e,t.slice(1),n.eventContext)];if("?"===i)return[new T(e,t.slice(1),s)];return new w(e,t,s).parts}handleTextExpression(e){return new V(e)}};function j(e){let t=O.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},O.set(e.type,t));let s=t.stringsArray.get(e.strings);if(void 0!==s)return s;const n=e.strings.join(d);return s=t.keyString.get(n),void 0===s&&(s=new m(e,e.getTemplateElement()),t.keyString.set(n,s)),t.stringsArray.set(e.strings,s),s}const O=new Map,H=new WeakMap;"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const P=(e,...t)=>new k(e,t,"html",I),R=new WeakMap,W=2147483647,F=i((...e)=>t=>{let s=R.get(t);void 0===s&&(s={lastRenderedIndex:W,values:[]},R.set(t,s));const n=s.values;let i=n.length;s.values=e;for(let a=0;a<e.length&&!(a>s.lastRenderedIndex);a++){const r=e[a];if($(r)||"function"!=typeof r.then){t.setValue(r),s.lastRenderedIndex=a;break}a<i&&r===n[a]||(s.lastRenderedIndex=W,i=0,Promise.resolve(r).then(e=>{const n=s.values.indexOf(r);n>-1&&n<s.lastRenderedIndex&&(s.lastRenderedIndex=n,t.setValue(e),t.commit())}))}}),q=new WeakMap,B=i(e=>t=>{const s=q.get(t);if(void 0===e&&t instanceof E){if(void 0!==s||!q.has(t)){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else e!==s&&t.setValue(e);q.set(t,e)}),z=(e={})=>{const t={href:e.href,date:e.date,image:e.image,isLazy:e.isLazy,author:e.author,tracker:e.tracker,pubdate:e.pubdate,modified:e.modified,category:e.category,headline:e.headline,description:e.description},s=t.image&&t.image.includes("/static/blog/img/featured-image/");let n="";if(t.category)switch(t.category.slug){case"loan":case"emprestimo":case"creditcard":case"cartao-de-credito":case"account":case"conta-digital":case"payment":case"maquina-de-cartao":n="u-color-blue-curious";break;default:n="u-color-black-60"}return P`
3    <div class="c-postitem">
4      <a
5        class="c-postitem--shadow u-pd-24 u-pd-0@md u-db u-underline-none u-background-white"
6        href="${t.href}"
7        data-tracker-type="${B(t.tracker&&t.tracker.type)}"
8        data-tracker-event="${B(t.tracker&&t.tracker.event)}"
9        data-tracker-action="${B(t.tracker&&t.tracker.action)}"
10        data-cy="postitem"
11      >
12        <div class="o-row u-direction-row-reverse@md">
13          <div class="o-column o-column-12@xs o-column-9@md">
14            ${t.category?P`
15                  <object class="u-db u-mb-16" tutle="${t.category.name}">
16                    <a
17                      class="o-title u-underline-none u-fs-12 u-db u-uppercase ${n}"
18                      href="${t.category.href}"
19                      data-tracker-type=${t.tracker?t.tracker:void 0}
20                      data-tracker-event=${t.tracker?t.tracker:"clicked"}
21                      data-tracker-action=${t.tracker?t.tracker:"post"}
22                      >${t.category.name}</a
23                    >
24                  </object>
25                `:""}
26
27            <h3 class="o-headline u-mb-8 u-fs-18  u-fs-20@md">
28              ${t.headline}
29            </h3>
30
31            <p
32              class="o-text u-mb-16 u-color-black-87 o-line-clamp o-line-clamp:2@sm"
33            >
34              ${t.description.slice(0,150)}
35            </p>
36
37            ${t.author&&t.pubdate?P`
38                  <span
39                    class="u-db u-mb-16 u-fs-14 u-lh-copy u-color-black-60 u-mb-0@md"
40                    >${t.author.slug?P`
41                          <object title="${t.author.name}">
42                            <a
43                              class="u-color-black-60 u-underline-none"
44                              href="/blog/autor/${t.author.slug}/"
45                              data-tracker-type=${t.tracker?t.tracker:void 0}
46                              data-tracker-event=${t.tracker?t.tracker:"clicked"}
47                              data-tracker-action=${t.tracker?t.tracker:"author"}
48                              >${t.author.name}</a
49                            >,
50                          </object>
51                        `:`${t.author.name},`}
52                    <time date="${t.date}" pubdate>${t.pubdate}</time>
53                  </span>
54                `:""}
55          </div>
56
57          <div
58            class="o-column o-column-12@xs o-column-3@md ${s?"u-dn u-flex@md":""}"
59          >
60            <figure class="o-picture u-h-100">
61              <img src="${t.image}" alt="" />
62            </figure>
63          </div>
64        </div>
65      </a>
66    </div>
67  `},D=(e={})=>{const t=e.order;return P`
68    <div data-order="${t}" class="js-adlazy" data-cy="adlazy">
69      <div
70        class="js-adsense u-mb-40 u-mb-56@md"
71        data-order="${t}"
72      ></div>
73    </div>
74  `},G=e=>"string"==typeof e?document.querySelector(e):e,J="o-button-loading";const K=class{constructor(e){this.page=1,this.items=[],this.perpage=e.perpage?e.perpage:11,this.offset=e.offset?e.offset:16,this.adSense=e.adSense,this.initOrder=e.initOrder?e.initOrder:0,this.main=G("main"),this.element=G(e.element),this.toChargeElement=G(e.toChargeElement),this.main&&this.main.dataset&&this.main.dataset.category&&(this.category=this.main.dataset.category),this.main&&this.main.dataset&&this.main.dataset.author&&(this.author=this.main.dataset.author),this.toChargeElement&&this.mount()}mount(){this.toChargeElement.addEventListener("click",()=>{((e,t,s)=>{let n=H.get(t);void 0===n&&(o(t,t.firstChild),H.set(t,n=new V(Object.assign({templateFactory:j},s))),n.appendInto(t)),n.setValue(e),n.commit()})(this.getContent(),this.element)})}setLoading(e=!0){if(e){const e=document.createElement("span");e.classList.add(`${J}`),e.innerHTML='\n        <span class="mq"></span>\n        <span class="mg"></span>\n        <span class="mq"></span>\n      ',this.toChargeElement.disabled=!0,this.toChargeElement.insertAdjacentElement("afterbegin",e)}else{this.toChargeElement.disabled=!1;const e=this.toChargeElement.querySelector(`.${J}`);e&&e.remove()}}getItems(e=5){this.setLoading();const t=window.location.origin;return fetch(`${t}/blog/api/posts?per_page=${e}&page=${this.page}\n      ${this.offset?`&offset=${this.offset}`:""}\n      ${this.author?`&author=${this.author}`:""}\n      ${this.category?`&category=${this.category}`:""}`).then(e=>e.json())}getContent(){const e=this.toChargeElement.getAttribute("data-tracker-type");return P`
75      ${F(this.getItems(this.perpage).then(t=>{this.page+=1,this.items=[...this.items,...t.posts],this.setLoading(!1),t.hasNext||(this.toChargeElement.classList.add("u-dn"),this.toChargeElement.classList.remove("u-inline-flex"));let s=2,n=this.initOrder;const i=this.initOrder+3;return P`
76              ${this.items.map((t,a)=>{let r=!1;return this.adSense&&a===s&&n<i&&(r=!0,s+=3,n+=1),P`
77                  ${z(Object.assign(t,{tracker:e}))}
78                  ${r?D({order:n}):null}
79                `})}
80            `}).catch(()=>{this.setLoading(!1)}))}
81    `}}}}]);
82//# sourceMappingURL=pagination.4186c12077399af75171.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.