// @bun
var{defineProperty:A,getOwnPropertyNames:J,getOwnPropertyDescriptor:K}=Object,N=Object.prototype.hasOwnProperty;function O(b){return this[b]}var W=(b)=>{var j=(F??=new WeakMap).get(b),q;if(j)return j;if(j=A({},"__esModule",{value:!0}),b&&typeof b==="object"||typeof b==="function"){for(var w of J(b))if(!N.call(j,w))A(j,w,{get:O.bind(b,w),enumerable:!(q=K(b,w))||q.enumerable})}return F.set(b,j),j},F;var P=(b)=>b;function Q(b,j){this[b]=P.bind(null,j)}var X=(b,j)=>{for(var q in j)A(b,q,{get:j[q],enumerable:!0,configurable:!0,set:Q.bind(j,q)})};var R=(b,j)=>()=>(b&&(j=b(b=0)),j);var Y=import.meta.require;function _(b){H=b}function $(){return H}function i(b){z={...z,...b}}function k(){z={}}function T(b,j={}){let q=z[b]||S[b]||{message:`Unknown error (code: ${b})`},w=q.message,x=q.help;for(let[I,B]of Object.entries(j)){let D=`{{${I}}}`;if(w=w.replace(new RegExp(D,"g"),B),x)x=x.replace(new RegExp(D,"g"),B)}return{message:w,help:x}}function y(b,j={}){let{message:q,help:w}=T(b,j);return w?`${q}
  Help: ${w}`:q}function C(b){for(let[j,q]of Object.entries(U))if(q===b)return j;return}var S,z,H="en",U;var V=R(()=>{S={1001:{message:"Unclosed directive: {{directive}}",help:"Make sure to close the directive with the appropriate end tag"},1002:{message:"Unclosed expression at position {{position}}",help:"Check for missing closing braces }}"},1003:{message:"Invalid directive syntax: {{directive}}",help:"Review the directive documentation for correct syntax"},1004:{message:"Malformed expression: {{expression}}",help:"Check for syntax errors in your expression"},1005:{message:"Unexpected token: {{token}}",help:"Remove or fix the unexpected token"},1101:{message:"Undefined variable: {{variable}}",help:"Make sure the variable is defined in the template context"},1102:{message:"Type error: {{details}}",help:"Check that you are using the correct types"},1103:{message:"Evaluation error: {{details}}",help:"Review the expression for errors"},1104:{message:"Infinite loop detected in {{location}}",help:"Check your loop conditions"},1105:{message:"Circular reference detected: {{path}}",help:"Remove the circular dependency"},1201:{message:"Unsafe expression blocked: {{expression}}",help:"This expression contains potentially dangerous code"},1202:{message:"Path traversal attempt blocked: {{path}}",help:"Use only relative paths within allowed directories"},1203:{message:"Potential XSS attempt blocked",help:"Sanitize user input before rendering"},1204:{message:"Code injection attempt blocked: {{code}}",help:"Avoid executing dynamic code"},1205:{message:"Prohibited DOM API usage: {{api}}",help:"Use STX.useRefs(), STX.useRef(), STX.el() and other STX helpers instead of direct DOM manipulation"},1301:{message:"File not found: {{path}}",help:"Check that the file exists and the path is correct"},1302:{message:"Error reading file: {{path}}",help:"Check file permissions and encoding"},1303:{message:"Invalid file path: {{path}}",help:"Use a valid file path"},1304:{message:"Permission denied: {{path}}",help:"Check file permissions"},1401:{message:"Invalid configuration: {{details}}",help:"Review your stx.config.ts file"},1402:{message:"Missing required configuration: {{key}}",help:"Add the required configuration option"},1403:{message:"Deprecated configuration: {{key}}",help:"Update to the new configuration format"},1501:{message:"Component not found: {{name}}",help:"Check that the component exists in your components directory"},1502:{message:"Invalid props for component {{name}}: {{details}}",help:"Check the component prop requirements"},1503:{message:"Error rendering component {{name}}: {{details}}",help:"Check the component template for errors"},1601:{message:"Filter not found: {{filter}}",help:"Register the filter or check the filter name"},1602:{message:"Invalid arguments for filter {{filter}}: {{details}}",help:"Check the filter documentation for correct arguments"},1603:{message:"Expression evaluation timed out",help:"Simplify the expression or increase the timeout"}},z={};U={UNCLOSED_DIRECTIVE:1001,UNCLOSED_EXPRESSION:1002,INVALID_DIRECTIVE_SYNTAX:1003,MALFORMED_EXPRESSION:1004,UNEXPECTED_TOKEN:1005,UNDEFINED_VARIABLE:1101,TYPE_ERROR:1102,EVALUATION_ERROR:1103,INFINITE_LOOP:1104,CIRCULAR_REFERENCE:1105,UNSAFE_EXPRESSION:1201,PATH_TRAVERSAL:1202,XSS_ATTEMPT:1203,CODE_INJECTION:1204,DOM_API_VIOLATION:1205,FILE_NOT_FOUND:1301,FILE_READ_ERROR:1302,INVALID_FILE_PATH:1303,PERMISSION_DENIED:1304,INVALID_CONFIG:1401,MISSING_REQUIRED_CONFIG:1402,DEPRECATED_CONFIG:1403,COMPONENT_NOT_FOUND:1501,INVALID_PROPS:1502,COMPONENT_RENDER_ERROR:1503,FILTER_NOT_FOUND:1601,INVALID_FILTER_ARGS:1602,EXPRESSION_TIMEOUT:1603}});V();export{_ as setErrorLocale,i as registerErrorMessages,T as getErrorMessage,$ as getErrorLocale,C as getErrorCodeName,y as formatLocalizedError,k as clearErrorMessages,U as ErrorCodes};
