PageSourceSearch

https://www.svgai.org/_next/static/chunks/5.5f0eb8cd77deba71.js

js svgai.org collected 2026-10-04 08:36:53 UTC 3,517 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5],{10651:(e,t,r)=>{r.d(t,{JX:()=>c,N$:()=>i,OD:()=>o,pc:()=>a,zx:()=>n});class s extends Error{constructor(e,t,r=400){super(e),this.name=this.constructor.name,this.code=t,this.statusCode=r,Object.setPrototypeOf(this,new.target.prototype)}}class o extends s{constructor(e,t="FILE_VALIDATION_FAILED"){super(e,t,400)}}class n extends s{constructor(e,t="CONVERSION_FAILED"){super(e,t,500)}}class i extends s{constructor(e,t,r){super(r||(e?`Format '${e}' is not supported`:"Unsupported file format"),"UNSUPPORTED_FORMAT",400),this.format=e,this.supportedFormats=t}}class a extends s{constructor(e,t){super(e?`The ${e.toUpperCase()} file appears to be corrupted or invalid. ${t||"Please try with a different file."}`:`The file appears to be corrupted or invalid. ${t||"Please try with a different file."}`,"CORRUPTED_FILE",400)}}let l={NETWORK_ERROR:"Network error occurred during conversion",TIMEOUT:"Conversion timed out. Please try with a smaller file",ENCODING_ERROR:"Unable to process the file encoding. Please ensure the file is not corrupted."};function c(e){if(e instanceof s)return e.message;if(e instanceof Error){let t=e.message.toLowerCase();return t.includes("memory")||t.includes("heap")?"The file is too large to process. Please try with a smaller file or reduce its dimensions.":t.includes("timeout")?l.TIMEOUT:t.includes("network")||t.includes("fetch")?l.NETWORK_ERROR:t.includes("encoding")||t.includes("decode")?l.ENCODING_ERROR:e.message}return"An unexpected error occurred. Please try again."}},80005:(e,t,r)=>{r.d(t,{aiToSvgHandler:()=>n});var s=r(10651),o=r(44134).Buffer;let n=async(e,t={})=>{try{let r="string"==typeof e?o.from(e,"base64"):e,n=new Blob([r],{type:"application/postscript"}),i=new FormData;i.append("file",n,"design.ai"),t.width&&i.append("width",t.width.toString()),t.height&&i.append("height",t.height.toString()),void 0!==t.preserveAspectRatio&&i.append("preserveAspectRatio",t.preserveAspectRatio.toString());let a=Date.now(),l=null;l=function(e,t){return e?setInterval(()=>{let r=Date.now()-t;e(Math.min(r<2e3?.1+r/2e3*.2:r<8e3?.3+(r-2e3)/6e3*.5:r<15e3?.8+(r-8e3)/7e3*.1:.9,.9))},250):null}(t.onProgress,a);try{let e,r=await fetch("/api/convert/ai-to-svg",{method:"POST",body:i,signal:AbortSignal.timeout(3e5)}),o=r.headers.get("content-type")||"";if(!r.ok){let e=`Request failed with status ${r.status}`;try{if(o.includes("application/json")){let t=await r.json();e=t.error||t.message||e}else{let t=await r.text();t&&t.length<1e3&&(e=t)}}catch(e){}throw new s.zx(e,"API_REQUEST_FAILED")}if(o.includes("image/svg+xml")||o.includes("text/xml")||!o)e=await r.text();else if(o.includes("application/json")){let t=await r.json();if(t.data)e=t.data;else if(t.error)throw new s.zx(t.error,"CONVERSION_FAILED");else throw new s.zx("Invalid response format","INVALID_RESPONSE")}else e=await r.text();if(!e||!e.includes("<svg")&&!e.includes("<?xml"))throw new s.zx("Invalid SVG data received","INVALID_SVG_DATA");let n=Date.now()-a;return t.onProgress&&t.onProgress(1),{success:!0,data:e,mimeType:"image/svg+xml",metadata:{format:"svg",size:e.length,conversionTime:n,engine:"inkscape"}}}finally{l&&clearInterval(l)}}catch(e){if(e instanceof Error&&"AbortError"===e.name)throw new s.zx("Conversion timed out. The file may be too large or complex.","CONVERSION_TIMEOUT");if(e instanceof s.zx)throw e;throw new s.zx(`Failed to convert AI file: ${e instanceof Error?e.message:"Unknown error"}`,"AI_TO_SVG_FAILED")}}}}]);

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.