// @bun
var{defineProperty:Q,getOwnPropertyNames:Y,getOwnPropertyDescriptor:Z}=Object,$=Object.prototype.hasOwnProperty;function b(j){return this[j]}var y=(j)=>{var q=(S??=new WeakMap).get(j),w;if(q)return q;if(q=Q({},"__esModule",{value:!0}),j&&typeof j==="object"||typeof j==="function"){for(var z of Y(j))if(!$.call(q,z))Q(q,z,{get:b.bind(j,z),enumerable:!(w=Z(j,z))||w.enumerable})}return S.set(j,q),q},S;var v=(j)=>j;function G(j,q){this[j]=v.bind(null,q)}var C=(j,q)=>{for(var w in q)Q(j,w,{get:q[w],enumerable:!0,configurable:!0,set:G.bind(q,w)})};var H=(j,q)=>()=>(j&&(q=j(j=0)),q);var D=import.meta.require;import{Buffer as V}from"buffer";import W from"crypto";function O(j=K){let q=W.randomBytes(Math.ceil(j/2)).toString("hex").slice(0,j);return J=q,q}function I(){if(!J)O();return J}function L(){J=null}function A(j){J=j}function M(j=X){let q=I();return`<input type="hidden" name="${j}" value="${q}">`}function U(j){return j.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(q,w,z)=>{return M(z||X)})}function B(j,q){let w=q??J;if(!w)return!1;let z=V.from(j),R=V.from(w);if(z.length!==R.length)return!1;return W.timingSafeEqual(z,R)}var K=40,X="_token",J=null;var P=()=>{};P();export{B as verifyCsrfToken,A as setCsrfToken,L as resetCsrfToken,U as processCsrfDirectives,I as getCsrfToken,O as generateCsrfToken,M as csrfField};
