PageSourceSearch

https://storyloop.com/_next/static/chunks/1046-abfc912c78df0000.js

js storyloop.com collected 2026-10-08 07:23:09 UTC 13,938 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1046],{72397:function(e,t,l){var n=l(85893),s=l(67294);l(40500);var o=l(26787),a=l(89942);t.Z=e=>{let{productId:t,productName:l,onProductAdded:i}=e,[r,c]=(0,s.useState)([]),[d,u]=(0,s.useState)(""),{addProductToCollection:h,wishlist:v,fetchWishlist1:p}=(0,a.Z)(),[f,m]=(0,s.useState)(null),[g,w]=(0,s.useState)(!1),{closeAddIntoCollection:x}=(0,s.useContext)(o.t),j=(0,s.useRef)(null);(0,s.useEffect)(()=>{p(),y();let e=e=>{j.current&&!j.current.contains(e.target)&&x()};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[m]);let y=async()=>{let e=localStorage.getItem("wishlist"),t=e?JSON.parse(e):[];if("undefined"==typeof localStorage)return!1;c(t);let l=localStorage.getItem("selectedCollectionId");if(l)m(Number(l));else{let e=t.find(e=>e.is_favorite);e&&m(e.id)}},S=async()=>{let e=localStorage.getItem("token");if(!d.trim()){f&&h(f,t,i),x();return}if(d.trim())try{let l=await fetch("".concat("https://storyloop.com/wp-json","/").concat("wp/v2","/user/wishlists?title=").concat(d),{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok)throw Error("Failed to create collection");let n=await l.json();h(n.id,t,i),u(""),localStorage.setItem("selectedCollectionId",String(n.id))}catch(e){console.error("Error:",e)}else f&&h(f,t,i);x()};return(0,n.jsx)("div",{className:"info-popup info-active",id:"add-collection-popup",children:(0,n.jsx)("div",{className:"info-popup-outer",children:(0,n.jsxs)("div",{className:"info-popup-wrapper",ref:j,children:[" ",(0,n.jsxs)("div",{className:"info-popup-header",children:[(0,n.jsx)("h6",{children:l}),(0,n.jsx)("a",{href:"javascript:void(0)",className:"info-close",onClick:x,children:(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,n.jsx)("path",{d:"M15 5L5 15",stroke:"#181818",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,n.jsx)("path",{d:"M5 5L15 15",stroke:"#181818",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]})})]}),(0,n.jsx)("div",{className:"login-popup-form",children:(0,n.jsxs)("div",{className:"info-popup-form",children:[(0,n.jsx)("h3",{children:"Add to Collection"}),(0,n.jsxs)("div",{className:"form-row",children:[(0,n.jsxs)("div",{className:"form-column full-column",children:[(0,n.jsx)("label",{className:"collection name",children:"Select Collection"}),g?(0,n.jsx)("p",{children:"Loading collections..."}):(0,n.jsx)("div",{className:"select",children:(0,n.jsxs)("select",{className:"input-field",onChange:e=>{let t=Number(e.target.value);m(t),localStorage.setItem("selectedCollectionId",String(t))},value:f||"",defaultValue:"",children:[(0,n.jsx)("option",{value:"",disabled:!0,children:"Select Collection"}),r.map(e=>(0,n.jsx)("option",{value:e.id,children:e.title},e.id))]})})]}),(0,n.jsx)("div",{className:"form-column full-column",children:(0,n.jsx)("div",{className:"divider",children:(0,n.jsx)("span",{children:"OR"})})}),(0,n.jsxs)("div",{className:"form-column full-column",children:[(0,n.jsx)("label",{className:"collection name",children:"Create New Collection"}),(0,n.jsx)("div",{className:"input-column",children:(0,n.jsx)("input",{className:"input-field",type:"text",placeholder:"New Collection",value:d,onChange:e=>u(e.target.value)})})]})]}),(0,n.jsx)("div",{className:"info-popup-form-footer",children:(0,n.jsx)("button",{type:"button",className:"primary-btn info-close",onClick:S,children:"Save"})})]})})]})})})}},81046:function(e,t,l){l.r(t),l.d(t,{default:function(){return E}});var n=l(85893),s=l(83387),o=l(67294),a=l(11163),i=l(46066),r=l(26787),c=l(89942),d=l(5152),u=l.n(d),h=l(84431),v=l(54151),p=l(41664),f=l.n(p);let m=u()(()=>Promise.all([l.e(5675),l.e(6539)]).then(l.bind(l,23188)),{loadableGenerated:{webpack:()=>[23188]},ssr:!1});var g=e=>{let{categoryData:t,mainResult:l,predefinedFetched:s}=e,[a,d]=(0,o.useState)(Array(t.length).fill(0)),[u,p]=(0,o.useState)([]),[g,w]=(0,o.useState)(!1),[x,j]=(0,o.useState)(null),[y,S]=(0,o.useState)(!1),[N,k]=(0,o.useState)([]),[b,E]=(0,o.useState)({}),[C,L]=(0,o.useState)(null),{openAddIntoCollection:_,setTheProductID:I,openSignIn:T,setTheProductName:O,alertMsg:R,showAlertPopup:A}=(0,o.useContext)(r.t),{isProductInWishlist1:P,handleDeleteProductFromCollection:M}=(0,c.Z)();(0,o.useEffect)(()=>{S(!0);{j(localStorage.getItem("token")),w(window.innerWidth<=767);let e=()=>{w(window.innerWidth<=767)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}},[]),(0,o.useEffect)(()=>{d(Array(t.length).fill(0)),p(e=>Array(t.length).fill(null).map((t,l)=>e[l]||o.createRef()))},[t.length]);let W=e=>{let t=[...a];t[e]>0&&(t[e]-=1),d(t);let l=u[e].current;l&&l.slickPrev()},Z=e=>{let l=[...a];l[e]<t[e].data.length-z.slidesToShow&&(l[e]+=1),d(l);let n=u[e].current;n&&n.slickNext()},F=(e,t)=>{let l=e.length||0;return t>=1200&&l<=3||t<1200&&t>=600&&l<=2||t<600&&l<=1},z={arrows:!1,autoplay:!1,autoplaySpeed:3e3,infinite:!1,slidesToShow:4.05,slidesToScroll:4,speed:500,responsive:[{breakpoint:1920,settings:{slidesToShow:3.05,slidesToScroll:3,speed:500}},{breakpoint:1200,settings:{slidesToShow:2.05,slidesToScroll:2,speed:500}},{breakpoint:768,settings:{slidesToShow:2.05,slidesToScroll:2,speed:500}},{breakpoint:600,settings:{slidesToShow:1,autoplay:!1,infinite:!0,dots:!0,speed:200,dotsClass:"slick-dots",slidesToScroll:1}}]};(0,o.useEffect)(()=>{!async function(){let e=await (0,h.P)();e&&k(e)}()},[]);let[B,D]=(0,o.useState)(0);return((0,o.useEffect)(()=>
1{if(s){let e=setInterval(()=>{D(l=>l<t.length?l+1:(clearInterval(e),l))},0);return()=>clearInterval(e)}D(t.length)},[s,t]),y)?(0,n.jsxs)(n.Fragment,{children:[t&&t.length>0&&(()=>{let e=new Set,s=l.reduce((e,l,n)=>{var s,o;return e[null===(s=t[n])||void 0===s?void 0:s.category]=(null==l?void 0:null===(o=l.total)||void 0===o?void 0:o.value)||0,e},{});return t.slice(0,B).filter(t=>!e.has(t.category)&&(e.add(t.category),!0)).map((e,t)=>{var l,r,c;let d=s[e.category]||0;return(null==e?void 0:null===(l=e.data)||void 0===l?void 0:l.length)>0?(0,n.jsxs)(o.Fragment,{children:[(0,n.jsxs)("div",{className:"section-header-collection viewall-header",children:[(0,n.jsxs)("h3",{children:[e.category," ",(0,n.jsxs)("span",{style:{color:"#a3a3a3"},children:["(",d,")"]})]}),!F(e.data,window.innerWidth)&&(0,n.jsxs)("div",{className:"slider-arrows",children:[(0,n.jsx)("button",{className:"prev-btn ".concat(0===a[t]?"slick-disabled":""),onClick:()=>W(t),disabled:0===a[t],"aria-label":"Previous",style:{display:g?"none":""},children:(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:(0,n.jsx)("path",{d:"M12.8332 7.00033H1.99984M6.99984 1.16699L1.1665 7.00033L6.99984 12.8337",stroke:"#181818",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,n.jsx)("button",{className:"next-btn ".concat(a[t]>=e.data.length-z.slidesToShow?"slick-disabled":""),onClick:()=>Z(t),"aria-label":"Next",disabled:a[t]>=e.data.length-z.slidesToShow,style:{display:g?"none":""},children:(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:(0,n.jsx)("path",{d:"M1.1665 7.00033H11.9998M6.99984 1.16699L12.8332 7.00033L6.99984 12.8337",stroke:"#181818",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,n.jsx)(f(),{href:"".concat(window.location.href).concat(window.location.href.includes("?")?"&":"?","ep_filter_type=").concat(e.slug),className:"secondary-btn",style:{display:g?"block":""},children:"View All"})]})]}),(null==e?void 0:null===(r=e.data)||void 0===r?void 0:r.length)===1?(0,n.jsx)("div",{className:"product-grid",children:e.data.map(e=>(0,n.jsx)("div",{className:"slider-item",children:(0,n.jsx)(m,{item:e,Authors:N})},null==e?void 0:e.ID))}):(0,n.jsx)(i.Z,{className:(null==e?void 0:null===(c=e.data)||void 0===c?void 0:c.length)<4?"related":"",ref:u[t],...z,children:e.data.map(e=>(0,n.jsx)("div",{children:(0,n.jsx)(m,{item:e,Authors:N})},e.ID))})]},e.category):null})})(),A&&(0,n.jsx)(v.Z,{message:R})]}):null},w=l(5812),x=l(72397),j=l(31254);l(40500);var y=l(50549);let S=["type","language","season","topic","scripture","style","aesthetic","color","energy","bpm","key","duration","resolution","frame_rate","format","word","producer","artist","audience"];var N=()=>{let[e,t]=(0,o.useState)(null),[l,s]=(0,o.useState)(null),[a,i]=(0,o.useState)(null),[r,c]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{for(let[e,l]of new URLSearchParams(window.location.search).entries())if(S.includes(e)){t({taxonomy:e,value:l});break}},[]),(0,o.useEffect)(()=>{let t=async(e,t)=>{try{c(!0);let l=await fetch("".concat("https://storyloop.com/wp-json","/").concat("wp/v2","/category/").concat(e,"/").concat(t,"/"),{method:"GET",headers:{"Content-Type":"application/json"}}),n=await l.json();(null==n?void 0:n.category_info)&&(s(n.category_info.name),i(n.category_info.description)),c(!1)}catch(l){console.error("Error fetching data for ".concat(e,"=").concat(t,":"),l)}finally{c(!1)}};e&&t(e.taxonomy,e.value)},[e]),(0,n.jsx)("div",{children:e?r?(0,n.jsxs)("div",{className:"seasonal",children:[(0,n.jsx)("h2",{children:(0,n.jsx)(y.Z,{height:30,width:200,baseColor:"#4a4a4a",highlightColor:"#6a6a6a"})}),(0,n.jsx)("p",{className:"seasonal-description",children:(0,n.jsx)(y.Z,{height:30,width:200,baseColor:"#4a4a4a",highlightColor:"#6a6a6a"})})]}):(0,n.jsxs)("div",{className:"seasonal",children:[(0,n.jsx)("h2",{children:l}),(0,n.jsx)("p",{className:"seasonal-description",dangerouslySetInnerHTML:{__html:a||""}})]}):null})},k=l(81458),b=l(6219),E=e=>{var t,l;let{url:i}=e,c=(0,a.useRouter)(),{query:d}=c,[u,h]=(0,o.useState)([]),[v,p]=(0,o.useState)([]),[f,m]=(0,o.useState)(!0),[y,S]=(0,o.useState)(!1),[E,C]=(0,o.useState)(!0),[L,_]=(0,o.useState)(0),[I,T]=(0,o.useState)(!1),[O,R]=(0,o.useState)(!1),A=(0,o.useRef)(null),{productID:P,productName:M,showAddIntoCollection:W,showDownloadPopup:Z,alertMsg:F,showAlertPopup:z}=(0,o.useContext)(r.t),[B,D]=(0,o.useState)(!1),[H,G]=(0,o.useState)(!0),J=(0,o.useRef)(null);(0,o.useEffect)(()=>{{R(window.innerWidth<=767);let e=()=>{R(window.innerWidth<=767)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}},[]);let V=O?4:8,U=(0,o.useCallback)(async function(e,t,l){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:V,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(y)try{var a,i,r,c;let d;m(!0);let{s:u="",sort:v=null,order:f=null,orderby:g=null,_download_type:w=null}=n;d=u&&!g?"relevance":g||"trending";let x="/api/downloads?sort=".concat(null!=v?v:"","&page=").concat(o,"&order=").concat(null!=f?f:"","&orderby=").concat(d,"&_download_type=").concat(null!=w?w:"","&search=").concat(u,"&per_page_items=").concat(s,"&params=").concat(JSON.stringify(e)),j=await fetch(x);if(!j.ok)throw Error("Network response was not ok");let y=await j.json();(null==y?void 0:null===(i=y.hits)||void 0===i?void 0:null===(a=i.hits)||void 0===a?void 0:a.length)>0?C(!0):C(!1),h(e=>{var n;return[...e,{category:t,slug:l,data:(null==y?void 0:null===(n=y.hits)||void 0===n?void 0:n.hits)||[]}]}),p(e=>[...e,(null==y?void 0:y.hits)||{}]),G((null==y?void 0:null===(c=y.hits)||void 0===c?void 0:null===(r=c.hits)||void 0===r?void 0:r.length)===s)}catch(e){console.error("Error fetching Elasticsearch data:",e)}},[y]);(0,o.useEffect)(()=>{S(!0)},[]),(0,o.useEffect)(()=>{y&&c.isReady&&(async()=>{m(!0);try{let e=(0,j.EF)(),t=c.asPath,l=[...s];for(let n of(J.current!==t&&l.some(e=>t.includes(e.slug))&&(J.current=t,T(!1)),l)){m(!0);let t={[n.taxonomy_slug]:[n.slug]};if(Object.keys(e).length>0)for(let[l,n]of Object.entries(e))t[l]=n;await U(t,n.name,n.slug,Object.keys(d).length>0?d:{},V)}T(!0)}catch(e){console.error("Error fetching pre-defined categories:",e)}finally{m(!1)}})()},[y,c.isReady,c.asPath,d,U]);let q=async()=>
1{if(L<w.length){D(!0);let e=w.slice(L,L+6),t=(0,j.EF)();try{await Promise.all(e.map(e=>{let l={[e.taxonomy_slug]:[e.slug]};if(Object.keys(t).length>0)for(let[e,n]of Object.entries(t))l[e]=n;return U(l,e.name,e.slug,Object.keys(d).length>0?d:{},V)}))}catch(e){console.error("Error fetching categories:",e)}finally{_(e=>e+6),D(!1)}}};(0,o.useEffect)(()=>{let e=new IntersectionObserver(e=>{e[0].isIntersecting&&!f&&!B&&I&&K()},{rootMargin:"100px",threshold:1});return A.current&&e.observe(A.current),()=>{A.current&&e.unobserve(A.current)}},[f,B,I]);let K=async()=>{m(!0),await q(),m(!1)};return(0,n.jsxs)("div",{className:"latest-collections spacer-margin",children:[(0,n.jsx)(N,{}),(null==i?void 0:i.s)&&(0,n.jsx)("div",{className:"result-found-header",children:(0,n.jsx)("div",{className:"result-found-header-content",children:(0,n.jsxs)("h3",{children:["Search Results for ",(0,n.jsxs)("span",{children:['"',d.s,'"']})]})})}),y?(0,n.jsxs)(n.Fragment,{children:[u.some(e=>{var t;return(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.length)>0})||v.some(e=>{var t;return(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.length)>0})?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(g,{categoryData:u,mainResult:v}),I&&!f&&L<w.length&&(null===(l=u[L+1])||void 0===l?void 0:null===(t=l.data)||void 0===t?void 0:t.length)>0&&(0,n.jsx)("a",{ref:A,"data-nosnippet":!0,className:"load-more",href:"#",children:"Loading More"})]}):!f&&I&&!E&&(0,n.jsx)("div",{className:"no-data-found",children:(0,n.jsxs)("p",{children:['No data found against your search "',d.s,'".']})}),f?(0,n.jsx)("div",{className:"product-grid",style:{padding:"0px",margin:"0"},children:Array.from({length:4}).map((e,t)=>(0,n.jsx)(b._,{height:200,width:680,dynamicCount:!0},t))}):null]}):null,W&&(0,n.jsx)(x.Z,{productId:P,productName:M,onProductAdded:()=>{!function(){throw Error("Function not implemented.")}()}}),Z&&(0,n.jsx)(k.Z,{})]})}}}]);

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.