PageSourceSearch

https://polaronsolar.com/i/_next/static/chunks/app/news/layout-b586ef0e0e9bde15.js

js polaronsolar.com collected 2026-10-07 11:21:16 UTC 4,281 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1543,4576,3880],{25059:function(e,t,r){Promise.resolve().then(r.bind(r,59030))},59030:function(e,t,r){"use strict";r.d(t,{PostProvider:function(){return y},aw:function(){return f},uu:function(){return g}});var a=r(57437),o=r(2265),s=r(33081);let n={posts:null,filteredPosts:null,filters:{categories:[],tags:[],search:""},loading:!1,error:null,resultCount:0,taxonomyCount:{},hasInteracted:!1},l=e=>Array.isArray(e)?e:null==e?[]:[e],i=e=>Array.from(new Set(e.filter(Boolean))),u=(e,t)=>{switch(t.type){case"SET_POSTS":return{...e,posts:t.payload,loading:!1,error:null};case"SET_LOADING":return{...e,loading:t.payload};case"SET_ERROR":return{...e,error:t.payload,loading:!1};case"SET_FILTERS":{var r,a,o;let s=(null===(r=t.payload)||void 0===r?void 0:r.categories)!==void 0?i(l(t.payload.categories)):e.filters.categories,n=(null===(a=t.payload)||void 0===a?void 0:a.tags)!==void 0?i(l(t.payload.tags)):e.filters.tags,u=(null===(o=t.payload)||void 0===o?void 0:o.search)!==void 0?String(t.payload.search||""):e.filters.search;return{...e,filters:{categories:s,tags:n,search:u}}}case"RESET_FILTERS":return{...e,filters:{categories:[],tags:[],search:""}};case"SET_RESULT_COUNT":return{...e,resultCount:t.payload};case"SET_FILTERED_POSTS":return{...e,filteredPosts:t.payload};case"SET_TAXONOMY_COUNT":return{...e,taxonomyCount:t.payload};case"SET_HAS_INTERACTED":return{...e,hasInteracted:t.payload};default:return e}},c=(0,o.createContext)({state:n,dispatch:()=>null}),d=(e,t)=>{let{categories:r,tags:a,search:o}=t;return e.filter(e=>{var t,s;let n=0===r.length||Array.isArray(e.categories)&&r.some(t=>e.categories.some(e=>{let{slug:r}=e;return r===t})),l=0===a.length||Array.isArray(e.tags)&&a.every(t=>e.tags.some(e=>{let{slug:r}=e;return r===t})),i=!o||(null===(t=e.title)||void 0===t?void 0:t.toLowerCase().includes(o.toLowerCase()))||(null===(s=e.excerpt)||void 0===s?void 0:s.toLowerCase().includes(o.toLowerCase()));return n&&l&&i})},p=async e=>{e({type:"SET_LOADING",payload:!0});try{let t=await (0,s.yz)();e({type:"SET_POSTS",payload:t})}catch(t){e({type:"SET_ERROR",payload:t.message||"An error occurred while fetching posts."})}finally{e({type:"SET_LOADING",payload:!1})}},y=e=>{let{children:t}=e,[r,s]=(0,o.useReducer)(u,n);(0,o.useEffect)(()=>{p(s)},[]),(0,o.useEffect)(()=>{if(r.posts&&r.filters){let e=d(r.posts,r.filters);s({type:"SET_FILTERED_POSTS",payload:e}),s({type:"SET_RESULT_COUNT",payload:e.length});let t=i(e,["categories","tags"]);JSON.stringify(t)!==JSON.stringify(r.taxonomyCount)&&s({type:"SET_TAXONOMY_COUNT",payload:t})}},[r.filters,r.posts]);let l=(e,t)=>{let r={};return e.forEach(e=>{let a=e[t];a&&a.forEach(e=>{let t=e.slug||e.name;t&&(r[t]=(r[t]||0)+1)})}),r},i=(e,t)=>t.reduce((t,r)=>(t[r]=l(e,r),t),{}),y=(0,o.useMemo)(()=>({state:r,dispatch:s}),[r,s]);return(0,a.jsx)(c.Provider,{value:y,children:t})},g=()=>(0,o.useContext)(c),f=(e,t)=>{e(t?{type:"SET_FILTERS",payload:t}:{type:"RESET_FILTERS"})}},33081:function(e,t,r){"use strict";r.d(t,{Zq:function(){return i},dn:function(){return n},nd:function(){return s},yz:function(){return o}});let a=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{let r=await fetch(e,t);if(!r.ok)throw Error("HTTP error! Status: ".concat(r.status));return await r.json()}catch(e){throw console.error("API Fetch Error:",e),e}},o=async()=>await a("https://polaronsolar.com/wp-json/custom-api/v1/posts"),s=async(e,t)=>{let r=await a("https://polaronsolar.com/wp-json/custom-api/v1/posts-by-tag/".concat(e));return t?r.slice(0,t):r},n=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,a=l(await o(),e,t);return r?a.slice(0,r):a},l=(e,t,r)=>e.filter(e=>{let a=e.categories.map(e=>e.slug),o=e.tags.map(e=>e.slug),s=0===t.length||t.some(e=>a.includes(e)),n=0===r.length||r.some(e=>o.includes(e));return s&&n}),i=(e,t,r)=>e.filter(e=>{let a=e.categories.map(e=>e.slug),o=e.tags.map(e=>e.slug),s=0===t.length||!t.some(e=>a.includes(e)),n=0===r.length||!r.some(e=>o.includes(e));return s&&n})}},function(e){e.O(0,[2971,7023,1744],function(){return e(e.s=25059)}),_N_E=e.O()}]);

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.