PageSourceSearch

https://cdn.shopify.com/shopifycloud/world/brochure/production-shopify/assets/clientErrorReporter-De2FI1f6.js

js shopify.com collected 2026-09-24 03:05:22 UTC 4,603 bytes, 2 lines download raw bytes

1import{w as e}from"./chunk-62JRHF6Z-Bxb16a7V.js";import{t}from"./constants-DD2b5kKK.js";var n=60*1024,r=2*1024,i=`…[truncated]`,a=e=>typeof TextEncoder<`u`?new TextEncoder().encode(e).byteLength:e.length*3,o=(e,t)=>{if(a(e)<=t)return e;let n=Math.max(0,t-a(i)),r=e.slice(0,n);for(;r.length>0&&a(r)>n;)r=r.slice(0,-1);return r+i},s=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function c(e){let t=JSON.stringify(e)??`null`;if(a(t)<=n)return t;if(!s(e))return JSON.stringify({payloadTruncated:`true`,originalPayloadBytes:String(a(t))});let i=a(t),c={...e};if(s(c.extraMetadata)){let e={...c.extraMetadata,payloadTruncated:`true`,originalPayloadBytes:String(i)};c.extraMetadata=e;let s=Object.keys(e).filter(t=>typeof e[t]==`string`&&t!==`payloadTruncated`&&t!==`originalPayloadBytes`).sort((t,n)=>e[n].length-e[t].length);for(let i of s){if(t=JSON.stringify(c),a(t)<=n)return t;e[i]=o(e[i],r)}}return t=JSON.stringify(c),a(t)<=n||typeof c.stack==`string`&&(c.stack=o(c.stack,r),t=JSON.stringify(c),a(t)<=n)?t:JSON.stringify({url:typeof c.url==`string`?o(c.url,2048):`unknown`,message:typeof c.message==`string`?o(c.message,r):`Unknown error`,errorClass:typeof c.errorClass==`string`?c.errorClass:`Error`,extraMetadata:{payloadTruncated:`true`,originalPayloadBytes:String(i)}})}var l=e=>String(e).includes(`this.#window.fetch`);function u(e,t){let n=c(t);typeof navigator<`u`&&navigator.sendBeacon&&(l(navigator.sendBeacon)||navigator.sendBeacon(e,n))||typeof fetch<`u`&&fetch(e,{method:`POST`,body:n,headers:{"Content-Type":`application/json`},keepalive:!0}).catch(()=>{})}function d(e){return typeof e==`object`&&!!e&&e.__brochureNotFoundPage===!0}var f=`Object.getOwnPropertyDescriptor [as _getOwnPropertyDescriptor]`,p=e=>e instanceof Error?e.message===`Maximum call stack size exceeded`&&typeof e.stack==`string`&&e.stack.includes(f):!1;function m(e){return e instanceof Error&&Object.getPrototypeOf(e)===Error.prototype&&e.name===`Error`&&e.message===`Unexpected Server Error`&&(e.stack===void 0||e.stack===``)}var h=[D,_,p,m,v,E,g];function g(t){return e(t)&&t.status===404&&d(t.data)}function _(e){let t=e instanceof Error?e.message:String(e);return t.includes(`The object can not be found here`)||t.includes(`The operation would yield an incorrect node tree`)}function v(e){if(e==null)return!0;if(typeof e!=`object`)return!1;if(e instanceof Error){let{message:t,stack:n}=e;return t===`Script error.`||t===`Script error`?!0:t===``&&(n==null||n===``)}return!1}var y=500,b=20;function x(t){if(e(t))return`ErrorResponse`;try{let e=t.constructor;return typeof e==`function`&&e.name?e.name:`Object`}catch{return`Object`}}function S(e){if(!(`data`in e)||e.data===void 0||e.data===null)return;if(typeof e.data==`string`)return e.data.length===0?void 0:e.data.length>y?`${e.data.slice(0,y)}…`:e.data;if(typeof e.data!=`object`)return e.data;let t;try{t=JSON.stringify(e.data).length}catch{return}if(t!==0)return t>y?`[truncated: ${t} bytes]`:e.data}function C(e){try{let t=Object.keys(e);return t.length>0?t.slice(0,b).join(`,`):void 0}catch{return}}function w(e){if(e instanceof Error&&e.message||typeof e!=`object`||!e)return null;let t=e,n={shape:x(t)};typeof t.status==`number`&&(n.status=t.status),typeof t.statusText==`string`&&t.statusText.length>0&&(n.statusText=t.statusText);let r=S(t);r!==void 0&&(n.data=r);let i=C(t);return i!==void 0&&(n.ownProperties=i),n}function T(e){let t=e?.message;if(typeof t==`string`&&t.length>0)return{message:t,diagnostics:null};let n=w(e);if(n){let e=[];
1if(n.shape&&e.push(n.shape),typeof n.status==`number`&&e.push(String(n.status)),n.statusText&&e.push(n.statusText),e.length>0)return{message:e.join(` `),diagnostics:n}}return{message:`Unknown error`,diagnostics:n}}function E(e){if(typeof e!=`object`||!e)return!1;let{status:t,data:n}=e;return t===429&&typeof n==`string`&&n.includes(`used Cloudflare to restrict access`)}function D(e){if(!(e instanceof TypeError)||e.message!==`Failed to fetch`)return!1;try{let e=navigator.userAgent||``,t=navigator.userAgentData;return navigator.webdriver===!0||/HeadlessChrome/i.test(e)||/bot|spider|crawler|crawling/i.test(e)||/MSIE\s?[67]\.0/i.test(e)||t?.brands?.some(e=>/HeadlessChrome/i.test(e.brand))===!0}catch{return!1}}function O(e,n){if(h.some(t=>t(e)))return;let r=e,{message:i,diagnostics:a}=T(e),o=r?.stack||`Unknown stack`,s=typeof window<`u`&&window.location?.href?window.location.href:`unknown`;u(t,{url:s,pageViewToken:``,message:i,stack:o,errorClass:r?.name||`Error`,extraMetadata:{url:s,...n,...a?{nonErrorDiagnostics:a}:{}}})}export{O as t};
2//# sourceMappingURL=clientErrorReporter-De2FI1f6.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.