PageSourceSearch

https://slatebot.ai/_next/static/chunks/6020.c87cd7c815f3dc91.js

js slatebot.ai collected 2026-10-05 15:06:18 UTC 5,913 bytes, 1 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];if(null!=t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:sl8-app":!0})}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6020],{66020:(e,r,t)=>{t.r(r),t.d(r,{UnicornScene:()=>d,default:()=>f});var n=t(2315),o=t(68987),i=[15,24,30,60,120],l={position:"relative",width:"var(--unicorn-width)",height:"var(--unicorn-height)"},u={display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},c={textAlign:"center",padding:"1rem",borderRadius:"0.5rem",backgroundColor:"rgb(254 242 242)",color:"rgb(239 68 68)"},a={fontWeight:"600",marginBottom:"0.25rem"},s={fontSize:"0.875rem",marginTop:"0.25rem"};function d({projectId:e,jsonFilePath:r,sdkUrl:t="https://cdn.jsdelivr.net/gh/hiunicornstudio/[email protected]/dist/unicornStudio.umd.js",width:f="100%",height:p="100%",scale:h=1,dpi:m=1.5,fps:v=60,altText:g="Scene",ariaLabel:y,className:w="",lazyLoad:b=!0,production:E=!0,placeholder:S,placeholderClassName:$,showPlaceholderOnError:k=!0,showPlaceholderWhileLoading:x=!0,onLoad:j,onError:L}
1){let C=(0,n.useRef)(null),[M,_]=(0,n.useState)(!1),[N,R]=(0,n.useState)(!0),{isLoaded:I,error:P}=function(e){let[r,t]=(0,n.useState)(!1),[o,i]=(0,n.useState)(null),l=(0,n.useCallback)(()=>{t(!0)},[]),u=(0,n.useCallback)(()=>{i(Error("Failed to load UnicornStudio script"))},[]);return(0,n.useEffect)(()=>{let r=document.querySelector(`script[src="${e}"]`);if(r)return"true"===r.getAttribute("data-loaded")?void t(!0):(r.addEventListener("load",l),r.addEventListener("error",u),()=>{r.removeEventListener("load",l),r.removeEventListener("error",u)});let n=document.createElement("script");return n.src=e,n.async=!0,n.addEventListener("load",()=>{n.setAttribute("data-loaded","true"),l()}),n.addEventListener("error",u),document.head.appendChild(n),()=>{n.parentNode&&(n.removeEventListener("load",l),n.removeEventListener("error",u))}},[e,l,u]),{isLoaded:r,error:o,handleScriptLoad:l,handleScriptError:u}}(t),{error:U}=function({elementRef:e,projectId:r,jsonFilePath:t,production:o,scale:l,dpi:u,fps:c,lazyLoad:a,altText:s,ariaLabel:d,isScriptLoaded:f,onLoad:p,onError:h}){let m=(0,n.useRef)(null),[v,g]=(0,n.useState)(null),y=(0,n.useRef)(!1),w=(0,n.useRef)(""),b=(0,n.useRef)(!1),E=(0,n.useMemo)(()=>(function(e,r){return e>=.25&&e<=1?i.includes(r)?null:`Invalid fps: ${r}. FPS must be one of: 15, 24, 30, 60, 120`:`Invalid scale: ${e}. Scale must be between 0.25 and 1.0`})(l,c),[l,c]),S=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(E!==S.current)if(S.current=E,E){let e=Error(E);g(e),null==h||h(e)}else g(null)},[E,h]);let $=(0,n.useCallback)(()=>{var e;(null==(e=m.current)?void 0:e.destroy)&&(m.current.destroy(),m.current=null),b.current=!1},[]),k=(0,n.useCallback)(async()=>{var n;if(!e.current||!f||E)return;if(b.current)return void console.log("Already initializing, skipping...");let i=`${r||""}-${t||""}-${l}-${u}-${c}-${o?"prod":"dev"}`;if(w.current===i&&m.current)return void console.log("Scene already initialized with this configuration, skipping...");w.current=i,y.current=!0,b.current=!0;try{let i;if($(),!(null==(n=window.UnicornStudio)?void 0:n.addScene))throw Error("UnicornStudio.addScene not found");let f={elementId:e.current.id||`unicorn-${Math.random().toString(36).slice(2,11)}`,scale:l,dpi:u,fps:c,lazyLoad:a,altText:s,ariaLabel:d,production:o};if(e.current.id||(e.current.id=f.elementId),t)f.filePath=t;else if(r)f.projectId=r;else throw Error("No project ID or JSON file path provided");let h=new Promise((e,r)=>{i=setTimeout(()=>r(Error("Scene initialization timeout")),15e3)}),v=()=>{i&&clearTimeout(i)};try{let e=await Promise.race([window.UnicornStudio.addScene(f),h]);if(v(),e)m.current=e,y.current=!1,g(null),b.current=!1,null==p||p();else throw b.current=!1,Error("Failed to initialize scene")}catch(e){throw v(),e}}catch(t){let e=(t instanceof Error?t:Error("Unknown error")).message;e.includes("404")||e.includes("Failed to fetch")?e="Resource not found":e.includes("Network")||e.includes("network")?e="Network error occurred":e.includes("timeout")&&(e="Loading timeout");let r=Error(e);g(r),b.current=!1,null==h||h(r)}},[e,f,t,r,o,l,u,c,a,s,d,$,p,h,E]);return(0,n.useEffect)(()=>{f&&k()},[f,k]),(0,n.useEffect)(()=>$,[$]),(0,n.useEffect)(()=>{let e=`${r||""}-${t||""}-${l}-${u}-${c}-${o?"prod":"dev"}`;w.current!==e&&(y.current=!1,g(null),b.current=!1,w.current="")},[r,t,l,u,c,o]),{error:v}}({elementRef:C,projectId:e,jsonFilePath:r,production:E,scale:h,dpi:m,fps:v,lazyLoad:b,altText:g,ariaLabel:y||g,isScriptLoaded:I,onLoad:()=>{_(!0),null==j||j()},onError:L}),z=P||U;(0,n.useEffect)(()=>{R(function(){if("u"<typeof window)return!0;try{let e=document.createElement("canvas");return!!(e.getContext("webgl")||e.getContext("experimental-webgl"))}catch(e){return!1}}())},[]);let A=(S||$)&&(!N||x&&!M||k&&z),F="number"==typeof f?f:0,T="number"==typeof p?p:0,B="number"==typeof f&&"number"==typeof p,O={"--unicorn-width":"number"==typeof f?`${f}px`:f,"--unicorn-height":"number"==typeof p?`${p}px`:p};return(0,o.jsxs)("div",{ref:C,style:{...l,...O},className:w,children:[A&&(S||$)&&(0,o.jsx)("div",{style:{position:"absolute",inset:0},children:"string"==typeof S?(0,o.jsx)("img",{src:S,alt:g,style:{width:B?`${F}px`:"100%",height:B?`${T}px`:"100%",objectFit:"cover"}}):S||($?(0,o.jsx)("div",{className:$,style:{width:"100%",height:"100%"},"aria-label":g}):null)}),z&&!A&&(0,o.jsx)("div",{style:u,children:(0,o.jsxs)("div",{style:c,children:[(0,o.jsx)("p",{style:a,children:"Error loading scene"}),(0,o.jsx)("p",{style:s,children:z.message})]})})]})}var f=d}}]);

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.