astro/packages/integrations/cloudflare/test/fixtures/basics/functions/[[path]].js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

278 lines
116 KiB
JavaScript
Raw Normal View History

globalThis.process = {
argv: [],
env: {},
};
var En=Object.create;var lt=Object.defineProperty;var jn=Object.getOwnPropertyDescriptor;var $n=Object.getOwnPropertyNames;var Cn=Object.getPrototypeOf,Fn=Object.prototype.hasOwnProperty;var Rn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Pn=(e,t,a,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $n(t))!Fn.call(e,o)&&o!==a&&lt(e,o,{get:()=>t[o],enumerable:!(i=jn(t,o))||i.enumerable});return e};var ct=(e,t,a)=>(a=e!=null?En(Cn(e)):{},Pn(t||!e||!e.__esModule?lt(a,"default",{value:e,enumerable:!0}):a,e));var je=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)};var u=(e,t,a)=>(je(e,t,"read from private field"),a?a.call(e):t.get(e)),k=(e,t,a)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,a)},j=(e,t,a,i)=>(je(e,t,"write to private field"),i?i.call(e,a):t.set(e,a),a);var M=(e,t,a)=>(je(e,t,"access private method"),a);var Ce=Rn($e=>{"use strict";$e.parse=zn;$e.serialize=On;var Nn=decodeURIComponent,Tn=encodeURIComponent,me=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function zn(e,t){if(typeof e!="string")throw new TypeError("argument str must be a string");for(var a={},i=t||{},o=e.split(";"),r=i.decode||Nn,n=0;n<o.length;n++){var s=o[n],p=s.indexOf("=");if(!(p<0)){var d=s.substring(0,p).trim();if(a[d]==null){var l=s.substring(p+1,s.length).trim();l[0]==='"'&&(l=l.slice(1,-1)),a[d]=Mn(l,r)}}}return a}function On(e,t,a){var i=a||{},o=i.encode||Tn;if(typeof o!="function")throw new TypeError("option encode is invalid");if(!me.test(e))throw new TypeError("argument name is invalid");var r=o(t);if(r&&!me.test(r))throw new TypeError("argument val is invalid");var n=e+"="+r;if(i.maxAge!=null){var s=i.maxAge-0;if(isNaN(s)||!isFinite(s))throw new TypeError("option maxAge is invalid");n+="; Max-Age="+Math.floor(s)}if(i.domain){if(!me.test(i.domain))throw new TypeError("option domain is invalid");n+="; Domain="+i.domain}if(i.path){if(!me.test(i.path))throw new TypeError("option path is invalid");n+="; Path="+i.path}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");n+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(n+="; HttpOnly"),i.secure&&(n+="; Secure"),i.sameSite){var p=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(p){case!0:n+="; SameSite=Strict";break;case"lax":n+="; SameSite=Lax";break;case"strict":n+="; SameSite=Strict";break;case"none":n+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return n}function Mn(e,t){try{return t(e)}catch{return e}}});var ae=ct(Ce(),1);function we(){this._types=Object.create(null),this._extensions=Object.create(null);for(let e=0;e<arguments.length;e++)this.define(arguments[e]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}we.prototype.define=function(e,t){for(let a in e){let i=e[a].map(function(o){return o.toLowerCase()});a=a.toLowerCase();for(let o=0;o<i.length;o++){let r=i[o];if(r[0]!=="*"){if(!t&&r in this._types)throw new Error('Attempt to change mapping for "'+r+'" extension from "'+this._types[r]+'" to "'+a+'". Pass `force=true` to allow this, otherwise remove "'+r+'" from the list of extensions for "'+a+'".');this._types[r]=a}}if(t||!this._extensions[a]){let o=i[0];this._extensions[a]=o[0]!=="*"?o:o.substr(1)}}};we.prototype.getType=function(e){e=String(e);let t=e.replace(/^.*[/\\]/,"").toLowerCase(),a=t.replace(/^.*\./,"").toLowerCase(),i=t.length<e.length;return(a.length<t.length-1||!i)&&this._types[a]||null};we.prototype.getExtension=function(e){return e=/^\s*([^;\s]*)/.test(e)&&RegExp.$1,e&&this._extensions[e.toLowerCase()]||null};var In=we,Dn={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"app
${i>0?`There ${a?"are.":"is."} ${i} renderer${a?"s.":""} configured in your \`astro.config.mjs\` file,
but ${a?"none were.":"it was not."} able to server-side render \`${e}\`.`:`No valid renderer was found ${t?`for the \`.${t}\` file extension.`:"for this file extension."}`}`,hint:e=>`Did you mean to enable the ${e} integration?
See https://docs.astro.build/en/core-concepts/framework-components/ for more information on how to install and configure integrations.`},NoClientEntrypoint:{title:"No client entrypoint specified in renderer.",code:3008,message:(e,t,a)=>`\`${e}\` component has a \`client:${t}\` directive, but no client entrypoint was provided by \`${a}\`.`,hint:"See https://docs.astro.build/en/reference/integrations-reference/#addrenderer-option for more information on how to configure your renderer."},NoClientOnlyHint:{title:"Missing hint on client:only directive.",code:3009,message:e=>`Unable to render \`${e}\`. When using the \`client:only\` hydration strategy, Astro needs a hint to use the correct renderer.`,hint:e=>`Did you mean to pass \`client:only="${e}"\`? See https://docs.astro.build/en/reference/directives-reference/#clientonly for more information on client:only`},InvalidGetStaticPathParam:{title:"Invalid value returned by a `getStaticPaths` path.",code:3010,message:e=>`Invalid params given to \`getStaticPaths\` path. Expected an \`object\`, got \`${e}\``,hint:"See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths."},InvalidGetStaticPathsReturn:{title:"Invalid value returned by getStaticPaths.",code:3011,message:e=>`Invalid type returned by \`getStaticPaths\`. Expected an \`array\`, got \`${e}\``,hint:"See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths."},GetStaticPathsRemovedRSSHelper:{title:"getStaticPaths RSS helper is not available anymore.",code:3012,message:"The RSS helper has been removed from `getStaticPaths`. Try the new @astrojs/rss package instead.",hint:"See https://docs.astro.build/en/guides/rss/ for more information."},GetStaticPathsExpectedParams:{title:"Missing params property on `getStaticPaths` route.",code:3013,message:"Missing or empty required `params` property on `getStaticPaths` route.",hint:"See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths."},GetStaticPathsInvalidRouteParam:{title:"Invalid value for `getStaticPaths` route parameter.",code:3014,message:(e,t,a)=>`Invalid getStaticPaths route parameter for \`${e}\`. Expected undefined, a string or a number, received \`${a}\` (\`${t}\`)`,hint:"See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths."},GetStaticPathsRequired:{title:"`getStaticPaths()` function required for dynamic routes.",code:3015,message:"`getStaticPaths()` function is required for dynamic routes. Make sure that you `export` a `getStaticPaths` function from your dynamic route.",hint:'See https://docs.astro.build/en/core-concepts/routing/#dynamic-routes for more information on dynamic routes.\n\nAlternatively, set `output: "server"` in your Astro config file to switch to a non-static server build. This error can also occur if using `export const prerender = true;`.\nSee https://docs.astro.build/en/guides/server-side-rendering/ for more information on non-static rendering.'},ReservedSlotName:{title:"Invalid slot name.",code:3016,message:e=>`Unable to create a slot named \`${e}\`. \`${e}\` is a reserved slot name. Please update the name of this slot.`},NoAdapterInstalled:{title:"Cannot use Server-side Rendering without an adapter.",code:3017,message:"Cannot use `output: 'server'` without an adapter. Please install and configure the appropriate server adapter for your final deployment.",hint:"See https://docs.astro.build/en/guides/server-side-rendering/ for more information."},NoMatchingImport:{title:"No import found for component.",code:3018,message:e=>`Could not render \`${e}\`. No matching import has been found for \`${e}\`.`,hint:"Please make sure the component is properly imported."},InvalidPrerenderExport:{title:"Invalid prerender export.",code:3019,message:(e,t)=>{let a="A `prerender` export has been detected, but its value cannot be statically analyzed.";return e!=="const"&&(a+=`
Expected \`const\` declaration but got \`${e}\`.`),t!=="true"&&(a+=`
Expected \`true\` value but got \`${t}\`.`),a},hint:"Mutable values declared at runtime are not supported. Please make sure to use exactly `export const prerender = true`."},InvalidComponentArgs:{title:"Invalid component arguments.",code:3020,message:e=>`Invalid arguments passed to${e?` <${e}>`:""} component.`,hint:"Astro components cannot be rendered directly via function call, such as `Component()` or `{items.map(Component)}`."},PageNumberParamNotFound:{title:"Page number param not found.",code:3021,message:e=>`[paginate()] page number param \`${e}\` not found in your filepath.`,hint:"Rename your file to `[page].astro` or `[...page].astro`."},ImageMissingAlt:{title:"Missing alt property.",code:3022,message:"The alt property is required.",hint:"The `alt` property is important for the purpose of accessibility, without it users using screen readers or other assistive technologies won't be able to understand what your image is supposed to represent. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-alt for more information."},InvalidImageService:{title:"Error while loading image service.",code:3023,message:"There was an error loading the configured image service. Please see the stack trace for more information."},MissingImageDimension:{title:"Missing image dimensions",code:3024,message:(e,t)=>`Missing ${e==="both"?"width and height attributes":`${e} attribute`} for ${t}. When using remote images, both dimensions are always required in order to avoid CLS.`,hint:"If your image is inside your `src` folder, you probably meant to import it instead. See [the Imports guide for more information](https://docs.astro.build/en/guides/imports/#other-assets)."},UnsupportedImageFormat:{title:"Unsupported image format",code:3025,message:(e,t,a)=>`Received unsupported format \`${e}\` from \`${t}\`. Currently only ${a.join(", ")} are supported for optimization.`,hint:"If you do not need optimization, using an `img` tag directly instead of the `Image` component might be what you're looking for."},PrerenderDynamicEndpointPathCollide:{title:"Prerendered dynamic endpoint has path collision.",code:3026,message:e=>`Could not render \`${e}\` with an \`undefined\` param as the generated path will collide during prerendering. Prevent passing \`undefined\` as \`params\` for the endpoint's \`getStaticPaths()\` function, or add an additional extension to the endpoint's filename.`,hint:e=>`Rename \`${e}\` to \`${e.replace(/\.(js|ts)/,t=>".json"+t)}\``},ExpectedImage:{title:"Expected src to be an image.",code:3027,message:e=>`Expected \`src\` property to be either an ESM imported image or a string with the path of a remote image. Received \`${e}\`.`,hint:"This error can often happen because of a wrong path. Make sure the path to your image is correct."},ExpectedImageOptions:{title:"Expected image options.",code:3028,message:e=>`Expected getImage() parameter to be an object. Received \`${e}\`.`},MarkdownImageNotFound:{title:"Image not found.",code:3029,message:(e,t)=>`Could not find requested image \`${e}\`${t?` at \`${t}\`.`:"."}`,hint:"This is often caused by a typo in the image path. Please make sure the file exists, and is spelled correctly."},ResponseSentError:{title:"Unable to set response",code:3030,message:"The response has already been sent to the browser and cannot be altered."},MiddlewareNoDataOrNextCalled:{title:"The middleware didn't return a response or call `next`",code:3031,message:"The middleware needs to either return a `Response` object or call the `next` function."},MiddlewareNotAResponse:{title:"The middleware returned something that is not a `Response` object",code:3032,message:"Any data returned from middleware must be a valid `Response` object."},LocalsNotAnObject:{title:"Value assigned to `locals` is not accepted",code:3033,message:"`locals` can only be assigned to an object. Other values like numbers, strings, etc. are not accepted.",hint:"If you tried to remove some information from the `locals` object, try to use `delete` or set the property to `undefined`."},LocalsNotSerializable:{title:"`Astro.locals` is
Make sure you store only serializable data.`},UnknownViteError:{title:"Unknown Vite Error.",code:4e3},FailedToLoadModuleSSR:{title:"Could not import file.",code:4001,message:e=>`Could not import \`${e}\`.`,hint:"This is often caused by a typo in the import path. Please make sure the file exists."},InvalidGlob:{title:"Invalid glob pattern.",code:4002,message:e=>`Invalid glob pattern: \`${e}\`. Glob patterns must start with './', '../' or '/'.`,hint:"See https://docs.astro.build/en/guides/imports/#glob-patterns for more information on supported glob patterns."},UnknownCSSError:{title:"Unknown CSS Error.",code:5e3},CSSSyntaxError:{title:"CSS Syntax Error.",code:5001},UnknownMarkdownError:{title:"Unknown Markdown Error.",code:6e3},MarkdownFrontmatterParseError:{title:"Failed to parse Markdown frontmatter.",code:6001},InvalidFrontmatterInjectionError:{title:"Invalid frontmatter injection.",code:6003,message:'A remark or rehype plugin attempted to inject invalid frontmatter. Ensure "astro.frontmatter" is set to a valid JSON object that is not `null` or `undefined`.',hint:"See the frontmatter injection docs https://docs.astro.build/en/guides/markdown-content/#modifying-frontmatter-programmatically for more information."},MdxIntegrationMissingError:{title:"MDX integration missing.",code:6004,message:e=>`Unable to render ${e}. Ensure that the \`@astrojs/mdx\` integration is installed.`,hint:"See the MDX integration docs for installation and usage instructions: https://docs.astro.build/en/guides/integrations-guide/mdx/"},UnknownConfigError:{title:"Unknown configuration error.",code:7e3},ConfigNotFound:{title:"Specified configuration file not found.",code:7001,message:e=>`Unable to resolve \`--config "${e}"\`. Does the file exist?`},ConfigLegacyKey:{title:"Legacy configuration detected.",code:7002,message:e=>`Legacy configuration detected: \`${e}\`.`,hint:`Please update your configuration to the new format.
See https://astro.build/config for more information.`},UnknownCLIError:{title:"Unknown CLI Error.",code:8e3},GenerateContentTypesError:{title:"Failed to generate content types.",code:8001,message:e=>`\`astro sync\` command failed to generate content collection types: ${e}`,hint:"Check your `src/content/config.*` file for typos."},UnknownContentCollectionError:{title:"Unknown Content Collection Error.",code:9e3},InvalidContentEntryFrontmatterError:{title:"Content entry frontmatter does not match schema.",code:9001,message:(e,t,a)=>[`**${String(e)} \u2192 ${String(t)}** frontmatter does not match collection schema.`,...a.errors.map(i=>i.message)].join(`
`),hint:"See https://docs.astro.build/en/guides/content-collections/ for more information on content schemas."},InvalidContentEntrySlugError:{title:"Invalid content entry slug.",code:9002,message:(e,t)=>`${String(e)} \u2192 ${String(t)} has an invalid slug. \`slug\` must be a string.`,hint:"See https://docs.astro.build/en/guides/content-collections/ for more on the `slug` field."},ContentSchemaContainsSlugError:{title:"Content Schema should not contain `slug`.",code:9003,message:e=>`A content collection schema should not contain \`slug\` since it is reserved for slug generation. Remove this from your ${e} collection schema.`,hint:"See https://docs.astro.build/en/guides/content-collections/ for more on the `slug` field."},UnknownError:{title:"Unknown Error.",code:99999}};function Hn(e){return e.replace(/\r\n|\r(?!\n)|\n/g,`
`)}function qn(e){let t=Object.entries(f).find(a=>a[1].code===e);if(t)return{name:t[0],data:t[1]}}function Bn(e,t){if(!t||t.line===void 0||t.column===void 0)return"";let a=Hn(e).split(`
`).map(n=>n.replace(/\t/g," ")),i=[];for(let n=-2;n<=2;n++)a[t.line+n]&&i.push(t.line+n);let o=0;for(let n of i){let s=`> ${n}`;s.length>o&&(o=s.length)}let r="";for(let n of i){let s=n===t.line-1;r+=s?"> ":" ",r+=`${n+1} | ${a[n]}
`,s&&(r+=`${Array.from({length:o}).join(" ")} | ${Array.from({length:t.column}).join(" ")}^
`)}return r}var v=class extends Error{constructor(t,...a){var i;super(...a),this.type="AstroError";let{code:o,name:r,title:n,message:s,stack:p,location:d,hint:l,frame:c}=t;this.errorCode=o,r&&r!=="Error"?this.name=r:this.name=((i=qn(this.errorCode))==null?void 0:i.name)??"UnknownError",this.title=n,s&&(this.message=s),this.stack=p||this.stack,this.loc=d,this.hint=l,this.frame=c}setErrorCode(t){this.errorCode=t}setLocation(t){this.loc=t}setName(t){this.name=t}setMessage(t){this.message=t}setHint(t){this.hint=t}setFrame(t,a){this.frame=Bn(t,a)}static is(t){return t.type==="AstroError"}},Vn=new Date(0),dt="deleted",Jn=Symbol.for("astro.responseSent"),ee=class{constructor(t){this.value=t}json(){if(this.value===void 0)throw new Error("Cannot convert undefined to an object.");return JSON.parse(this.value)}number(){return Number(this.value)}boolean(){return this.value==="false"||this.value==="0"?!1:!!this.value}},J,I,R,ie,De,oe,_e,ve,Mt,ue=class{constructor(t){k(this,ie);k(this,oe);k(this,ve);k(this,J,void 0);k(this,I,void 0);k(this,R,void 0);j(this,J,t),j(this,I,null),j(this,R,null)}delete(t,a){let i={expires:Vn};a?.domain&&(i.domain=a.domain),a?.path&&(i.path=a.path),M(this,oe,_e).call(this).set(t,[dt,(0,ae.serialize)(t,dt,i),!1])}get(t){if(u(this,R)!==null&&u(this,R).has(t)){let[o,,r]=u(this,R).get(t);return r?new ee(o):new ee(void 0)}let i=M(this,ie,De).call(this)[t];return new ee(i)}has(t){if(u(this,R)!==null&&u(this,R).has(t)){let[,,i]=u(this,R).get(t);return i}return!!M(this,ie,De).call(this)[t]}set(t,a,i){let o;if(typeof a=="string")o=a;else{let n=a.toString();n===Object.prototype.toString.call(a)?o=JSON.stringify(a):o=n}let r={};if(i&&Object.assign(r,i),M(this,oe,_e).call(this).set(t,[o,(0,ae.serialize)(t,o,r),!0]),u(this,J)[Jn])throw new v({...f.ResponseSentError})}*headers(){if(u(this,R)!=null)for(let[,t]of u(this,R))yield t[1]}};J=new WeakMap,I=new WeakMap,R=new WeakMap,ie=new WeakSet,De=function(){return u(this,I)||M(this,ve,Mt).call(this),u(this,I)||j(this,I,{}),u(this,I)},oe=new WeakSet,_e=function(){return u(this,R)||j(this,R,new Map),u(this,R)},ve=new WeakSet,Mt=function(){let t=u(this,J).headers.get("cookie");t&&j(this,I,(0,ae.parse)(t))};var It=Symbol.for("astro.cookies");function Qe(e,t){Reflect.set(e,It,t)}function Gn(e){let t=Reflect.get(e,It);if(t!=null)return t}function*Wn(e){let t=Gn(e);if(!t)return[];for(let a of t.headers())yield a;return[]}function Kn(e){return!(e.length!==3||!e[0]||typeof e[0]!="object")}function Dt(e,t){var a;let i=((a=t?.split("/").pop())==null?void 0:a.replace(".astro",""))??"",o=(...r)=>{if(!Kn(r))throw new v({...f.InvalidComponentArgs,message:f.InvalidComponentArgs.message(i)});return e(...r)};return Object.defineProperty(o,"name",{value:i,writable:!1}),o.isAstroComponentFactory=!0,o.moduleId=t,o}function Xn(e){let t=Dt(e.factory,e.moduleId);return t.propagation=e.propagation,t}function _t(e,t){return typeof e=="function"?Dt(e,t):Xn(e)}var Ut="2.4.2";function Yn(){return(t,a)=>{let i=[...Object.values(t)];if(i.length===0)throw new Error(`Astro.glob(${JSON.stringify(a())}) - no matches found.`);return Promise.all(i.map(o=>o()))}}function Lt(e){return{site:e?new URL(e):void 0,generator:`Astro v${Ut}`,glob:Yn()}}function Qn(e,t){if(e[t])return e[t];if(t==="delete"&&e.del)return e.del;if(e.all)return e.all}async function Zn(e,t,a){var i;let{request:o,params:r,locals:n}=t,s=(i=o.method)==null?void 0:i.toLowerCase(),p=Qn(e,s);if(!a&&a===!1&&s&&s!=="get"&&console.warn(`
${s} requests are not available when building a static site. Update your config to output: 'server' to handle ${s} requests.`),!p||typeof p!="function")return new Response(null,{status:404,headers:{"X-Astro-Response":"Not-Found"}});p.length>1&&console.warn(`
API routes with 2 arguments have been deprecated. Instead they take a single argument in the form of:
export function get({ params, request }) {
//...
}
Update your code to remove this warning.`);let d=new Proxy(t,{get(l,c){return c in l?Reflect.get(l,c):c in r?(console.warn(`
API routes no longer pass params as the first argument. Instead an object containing a params property is provided in the form of:
export function get({ params }) {
// ...
}
Update your code to remove this warning.`),Reflect.get(r,c)):void 0}});return p.call(e,d,o)}var{replace:ea}="",ta=/[&<>'"]/g,na={"&":"&amp;","<":"&lt;",">":"&gt;","'":"&#39;",'"':"&quot;"},aa=e=>na[e],ia=e=>ea.call(e,ta,aa);function Ht(e){let t={};return a(e),Object.keys(t).join(" ");function a(i){i&&typeof i.forEach=="function"?i.forEach(a):i===Object(i)?Object.keys(i).forEach(o=>{i[o]&&a(o)}):(i=i===!1||i==null?"":String(i).trim(),i&&i.split(/\s+/).forEach(o=>{t[o]=!0}))}}function Ze(e){return!!e&&typeof e=="object"&&typeof e.then=="function"}async function*mt(e){let t=e.getReader();try{for(;;){let{done:a,value:i}=await t.read();if(a)return;yield i}}finally{t.releaseLock()}}var te=ia,V=class extends String{get[Symbol.toStringTag](){return"HTMLString"}},y=e=>e instanceof V?e:typeof e=="string"?new V(e):e;function et(e){return Object.prototype.toString.call(e)==="[object HTMLString]"}var Se="astro:jsx",ut=Symbol("empty"),ft=e=>e;function ne(e){return e&&typeof e=="object"&&e[Se]}function oa(e){if(typeof e.type=="string")return e;let t={};if(ne(e.props.children)){let a=e.props.children;if(!ne(a)||!("slot"in a.props))return;let i=ft(a.props.slot);t[i]=[a],t[i].$$slot=!0,delete a.props.slot,delete e.props.children}Array.isArray(e.props.children)&&(e.props.children=e.props.children.map(a=>{if(!ne(a)||!("slot"in a.props))return a;let i=ft(a.props.slot);return Array.isArray(t[i])?t[i].push(a):(t[i]=[a],t[i].$$slot=!0),delete a.props.slot,ut}).filter(a=>a!==ut)),Object.assign(e.props,t)}function qt(e){return typeof e=="string"?y(e):Array.isArray(e)?e.map(t=>qt(t)):e}function ra(e){if("set:html"in e.props||"set:text"in e.props){if("set:html"in e.props){let t=qt(e.props["set:html"]);delete e.props["set:html"],Object.assign(e.props,{children:t});return}if("set:text"in e.props){let t=e.props["set:text"];delete e.props["set:text"],Object.assign(e.props,{children:t});return}}}function sa(e,t){let a={[qe]:"astro:jsx",[Se]:!0,type:e,props:t??{}};return ra(a),oa(a),a}var pa=`(self.Astro = self.Astro || {}).idle = (getHydrateCallback) => {
const cb = async () => {
let hydrate = await getHydrateCallback();
await hydrate();
};
if ("requestIdleCallback" in window) {
window.requestIdleCallback(cb);
} else {
setTimeout(cb, 200);
}
};
window.dispatchEvent(new Event("astro:idle"));`,la=`(self.Astro = self.Astro || {}).load = (getHydrateCallback) => {
(async () => {
let hydrate = await getHydrateCallback();
await hydrate();
})();
};
window.dispatchEvent(new Event("astro:load"));`,ca=`(self.Astro = self.Astro || {}).media = (getHydrateCallback, options) => {
const cb = async () => {
let hydrate = await getHydrateCallback();
await hydrate();
};
if (options.value) {
const mql = matchMedia(options.value);
if (mql.matches) {
cb();
} else {
mql.addEventListener("change", cb, { once: true });
}
}
};
window.dispatchEvent(new Event("astro:media"));`,da=`(self.Astro = self.Astro || {}).only = (getHydrateCallback) => {
(async () => {
let hydrate = await getHydrateCallback();
await hydrate();
})();
};
window.dispatchEvent(new Event("astro:only"));`,ma=`(self.Astro = self.Astro || {}).visible = (getHydrateCallback, _opts, root) => {
const cb = async () => {
let hydrate = await getHydrateCallback();
await hydrate();
};
let io = new IntersectionObserver((entries) => {
for (const entry of entries) {
if (!entry.isIntersecting)
continue;
io.disconnect();
cb();
break;
}
});
for (let i = 0; i < root.children.length; i++) {
const child = root.children[i];
io.observe(child);
}
};
window.dispatchEvent(new Event("astro:visible"));`,ua=`var _a;
{
const propTypes = {
0: (value) => value,
1: (value) => JSON.parse(value, reviver),
2: (value) => new RegExp(value),
3: (value) => new Date(value),
4: (value) => new Map(JSON.parse(value, reviver)),
5: (value) => new Set(JSON.parse(value, reviver)),
6: (value) => BigInt(value),
7: (value) => new URL(value),
8: (value) => new Uint8Array(JSON.parse(value)),
9: (value) => new Uint16Array(JSON.parse(value)),
10: (value) => new Uint32Array(JSON.parse(value))
};
const reviver = (propKey, raw) => {
if (propKey === "" || !Array.isArray(raw))
return raw;
const [type, value] = raw;
return type in propTypes ? propTypes[type](value) : void 0;
};
if (!customElements.get("astro-island")) {
customElements.define(
"astro-island",
(_a = class extends HTMLElement {
constructor() {
super(...arguments);
this.hydrate = () => {
if (!this.hydrator || this.parentElement && this.parentElement.closest("astro-island[ssr]")) {
return;
}
const slotted = this.querySelectorAll("astro-slot");
const slots = {};
const templates = this.querySelectorAll("template[data-astro-template]");
for (const template of templates) {
const closest = template.closest(this.tagName);
if (!closest || !closest.isSameNode(this))
continue;
slots[template.getAttribute("data-astro-template") || "default"] = template.innerHTML;
template.remove();
}
for (const slot of slotted) {
const closest = slot.closest(this.tagName);
if (!closest || !closest.isSameNode(this))
continue;
slots[slot.getAttribute("name") || "default"] = slot.innerHTML;
}
const props = this.hasAttribute("props") ? JSON.parse(this.getAttribute("props"), reviver) : {};
this.hydrator(this)(this.Component, props, slots, {
client: this.getAttribute("client")
});
this.removeAttribute("ssr");
window.removeEventListener("astro:hydrate", this.hydrate);
window.dispatchEvent(new CustomEvent("astro:hydrate"));
};
}
connectedCallback() {
if (!this.hasAttribute("await-children") || this.firstChild) {
this.childrenConnectedCallback();
} else {
new MutationObserver((_, mo) => {
mo.disconnect();
this.childrenConnectedCallback();
}).observe(this, { childList: true });
}
}
async childrenConnectedCallback() {
window.addEventListener("astro:hydrate", this.hydrate);
let beforeHydrationUrl = this.getAttribute("before-hydration-url");
if (beforeHydrationUrl) {
await import(beforeHydrationUrl);
}
this.start();
}
start() {
const opts = JSON.parse(this.getAttribute("opts"));
const directive = this.getAttribute("client");
if (Astro[directive] === void 0) {
window.addEventListener(\`astro:\${directive}\`, () => this.start(), { once: true });
return;
}
Astro[directive](
async () => {
const rendererUrl = this.getAttribute("renderer-url");
const [componentModule, { default: hydrator }] = await Promise.all([
import(this.getAttribute("component-url")),
rendererUrl ? import(rendererUrl) : () => () => {
}
]);
const componentExport = this.getAttribute("component-export") || "default";
if (!componentExport.includes(".")) {
this.Component = componentModule[componentExport];
} else {
this.Component = componentModule;
for (const part of componentExport.split(".")) {
this.Component = this.Component[part];
}
}
this.hydrator = hydrator;
return this.hydrate;
},
opts,
this
);
}
attributeChangedCallback() {
if (this.hydrator)
this.hydrate();
}
}, _a.observedAttributes = ["props"], _a)
);
}
}`;function fa(e){return e._metadata.hasHydrationScript?!1:e._metadata.hasHydrationScript=!0}var xt={idle:pa,load:la,only:da,media:ca,visible:ma};function xa(e,t){return e._metadata.hasDirectives.has(t)?!1:(e._metadata.hasDirectives.add(t),!0)}function ht(e){if(!(e in xt))throw new Error(`Unknown directive: ${e}`);return xt[e]}function ha(e,t){switch(e){case"both":return`<style>astro-island,astro-slot{display:contents}</style><script>${ht(t)+ua}<\/script>`;case"directive":return`<script>${ht(t)}<\/script>`}return""}var tt=/^(area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/i,ga=/^(allowfullscreen|async|autofocus|autoplay|controls|default|defer|disabled|disablepictureinpicture|disableremoteplayback|formnovalidate|hidden|loop|nomodule|novalidate|open|playsinline|readonly|required|reversed|scoped|seamless|itemscope)$/i,va=/^(contenteditable|draggable|spellcheck|value)$/i,ya=/^(autoReverse|externalResourcesRequired|focusable|preserveAlpha)$/i,ba=new Set(["set:html","set:text"]),wa=e=>e.trim().replace(/(?:(?!^)\b\w|\s+|[^\w]+)/g,(t,a)=>/[^\w]|\s/.test(t)?"":a===0?t:t.toUpperCase()),Q=(e,t=!0)=>t?String(e).replace(/&/g,"&#38;").replace(/"/g,"&#34;"):e,Fe=e=>e.toLowerCase()===e?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Sa=e=>Object.entries(e).map(([t,a])=>t[0]!=="-"&&t[1]!=="-"?`${Fe(t)}:${a}`:Fe(t)!==t?`${Fe(t)}:var(${t});${t}:${a}`:`${t}:${a}`).join(";");function ka(e){let t="";for(let[a,i]of Object.entries(e))t+=`const ${wa(a)} = ${JSON.stringify(i)};
`;return y(t)}function gt(e){return e.length===1?e[0]:`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`}function Bt(e,t,a=!0){if(e==null)return"";if(e===!1)return va.test(t)||ya.test(t)?y(` ${t}="false"`):"";if(ba.has(t))return console.warn(`[astro] The "${t}" directive cannot be applied dynamically at runtime. It will not be rendered as an attribute.
Make sure to use the static attribute syntax (\`${t}={value}\`) instead of the dynamic spread syntax (\`{...{ "${t}": value }}\`).`),"";if(t==="class:list"){let i=Q(Ht(e),a);return i===""?"":y(` ${t.slice(0,-5)}="${i}"`)}return t==="style"&&!(e instanceof V)&&typeof e=="object"?y(` ${t}="${Q(Sa(e),a)}"`):t==="className"?y(` class="${Q(e,a)}"`):e===!0&&(t.startsWith("data-")||ga.test(t))?y(` ${t}`):y(` ${t}="${Q(e,a)}"`)}function Ue(e,t=!0){let a="";for(let[i,o]of Object.entries(e))a+=Bt(o,i,t);return y(a)}function Z(e,{props:t,children:a=""},i=!0){let{lang:o,"data-astro-id":r,"define:vars":n,...s}=t;return n&&(e==="style"&&(delete s["is:global"],delete s["is:scoped"]),e==="script"&&(delete s.hoist,a=ka(n)+`
`+a)),(a==null||a=="")&&tt.test(e)?`<${e}${Ue(s,i)} />`:`<${e}${Ue(s,i)}>${a}</${e}>`}var Re=(e,t,a)=>{let i=JSON.stringify(e.props),o=e.children;return t===a.findIndex(r=>JSON.stringify(r.props)===i&&r.children==o)};function vt(e){e._metadata.hasRenderedHead=!0;let t=Array.from(e.styles).filter(Re).map(r=>r.props.rel==="stylesheet"?Z("link",r):Z("style",r));e.styles.clear();let a=Array.from(e.scripts).filter(Re).map((r,n)=>Z("script",r,!1)),o=Array.from(e.links).filter(Re).map(r=>Z("link",r,!1)).join(`
`)+t.join(`
`)+a.join(`
`);if(e.extraHead.length>0)for(let r of e.extraHead)o+=r;return y(o)}function*Vt(e){yield{type:"head",result:e}}function*Aa(e){e._metadata.hasRenderedHead||(yield{type:"maybe-head",result:e,scope:e.scope})}var Ea=Symbol.for("astro.headAndContent");function ke(e){return typeof e=="object"&&!!e[Ea]}var yt,Jt=Symbol.for("astro.renderTemplateResult"),Le=class{constructor(t,a){this[yt]=!0,this.htmlParts=t,this.error=void 0,this.expressions=a.map(i=>Ze(i)?Promise.resolve(i).catch(o=>{if(!this.error)throw this.error=o,o}):i)}async*[(yt=Jt,Symbol.asyncIterator)](){let{htmlParts:t,expressions:a}=this;for(let i=0;i<t.length;i++){let o=t[i],r=a[i];yield y(o),yield*W(r)}}};function Gt(e){return typeof e=="object"&&!!e[Jt]}async function*Ae(e){for await(let t of e)if(t||t===0)for await(let a of W(t))switch(a.type){case"directive":{yield a;break}default:{yield y(a);break}}}function nt(e,...t){return new Le(e,t)}function Wt(e){return e==null?!1:e.isAstroComponentFactory===!0}async function ja(e,t,a,i){let o=await t(e,a,i);if(o instanceof Response)throw o;let r=new X,n=ke(o)?o.content:o;for await(let s of Ae(n))r.append(s,e);return r.toString()}function $a(e,t){let a=t.propagation||"none";return t.moduleId&&e.componentMetadata.has(t.moduleId)&&a==="none"&&(a=e.componentMetadata.get(t.moduleId).propagation),a==="in-tree"||a==="self"}var N={Value:0,JSON:1,RegExp:2,Date:3,Map:4,Set:5,BigInt:6,URL:7,Uint8Array:8,Uint16Array:9,Uint32Array:10};function Pe(e,t={},a=new WeakSet){if(a.has(e))throw new Error(`Cyclic reference detected while serializing props for <${t.displayName} client:${t.hydrate}>!
Cyclic references cannot be safely serialized for client-side usage. Please remove the cyclic reference.`);a.add(e);let i=e.map(o=>Xt(o,t,a));return a.delete(e),i}function Kt(e,t={},a=new WeakSet){if(a.has(e))throw new Error(`Cyclic reference detected while serializing props for <${t.displayName} client:${t.hydrate}>!
Cyclic references cannot be safely serialized for client-side usage. Please remove the cyclic reference.`);a.add(e);let i=Object.fromEntries(Object.entries(e).map(([o,r])=>[o,Xt(r,t,a)]));return a.delete(e),i}function Xt(e,t={},a=new WeakSet){switch(Object.prototype.toString.call(e)){case"[object Date]":return[N.Date,e.toISOString()];case"[object RegExp]":return[N.RegExp,e.source];case"[object Map]":return[N.Map,JSON.stringify(Pe(Array.from(e),t,a))];case"[object Set]":return[N.Set,JSON.stringify(Pe(Array.from(e),t,a))];case"[object BigInt]":return[N.BigInt,e.toString()];case"[object URL]":return[N.URL,e.toString()];case"[object Array]":return[N.JSON,JSON.stringify(Pe(e,t,a))];case"[object Uint8Array]":return[N.Uint8Array,JSON.stringify(Array.from(e))];case"[object Uint16Array]":return[N.Uint16Array,JSON.stringify(Array.from(e))];case"[object Uint32Array]":return[N.Uint32Array,JSON.stringify(Array.from(e))];default:return e!==null&&typeof e=="object"?[N.Value,Kt(e,t,a)]:[N.Value,e]}}function Yt(e,t){return JSON.stringify(Kt(e,t))}var Qt=["load","idle","media","visible","only"],Ca=new Set(Qt),Zt=new Set(Qt.map(e=>`client:${e}`));function Fa(e,t){let a={isPage:!1,hydration:null,props:{}};for(let[i,o]of Object.entries(t))if(i.startsWith("server:")&&i==="server:root"&&(a.isPage=!0),i.startsWith("client:"))switch(a.hydration||(a.hydration={directive:"",value:"",componentUrl:"",componentExport:{value:""}}),i){case"client:component-path":{a.hydration.componentUrl=o;break}case"client:component-export":{a.hydration.componentExport.value=o;break}case"client:component-hydration":break;case"client:display-name":break;default:{if(a.hydration.directive=i.split(":")[1],a.hydration.value=o,!Ca.has(a.hydration.directive))throw new Error(`Error: invalid hydration directive "${i}". Supported hydration methods: ${Array.from(Zt).join(", ")}`);if(a.hydration.directive==="media"&&typeof a.hydration.value!="string")throw new v(f.MissingMediaQueryDirective);break}}else i==="class:list"?o&&(a.props[i.slice(0,-5)]=Ht(o)):a.props[i]=o;for(let i of Object.getOwnPropertySymbols(t))a.props[i]=t[i];return a}async function Ra(e,t){let{renderer:a,result:i,astroId:o,props:r,attrs:n}=e,{hydrate:s,componentUrl:p,componentExport:d}=t;if(!d.value)throw new Error(`Unable to resolve a valid export for "${t.displayName}"! Please open an issue at https://astro.build/issues!`);let l={children:"",props:{uid:o}};if(n)for(let[m,b]of Object.entries(n))l.props[m]=te(b);l.props["component-url"]=await i.resolve(decodeURI(p)),a.clientEntrypoint&&(l.props["component-export"]=d.value,l.props["renderer-url"]=await i.resolve(decodeURI(a.clientEntrypoint)),l.props.props=te(Yt(r,t))),l.props.ssr="",l.props.client=s;let c=await i.resolve("astro:scripts/before-hydration.js");return c.length&&(l.props["before-hydration-url"]=c),l.props.opts=te(JSON.stringify({name:t.displayName,value:t.hydrateArgs||""})),l}var en,tn=Symbol.for("astro.componentInstance"),He=class{constructor(t,a,i,o){this[en]=!0,this.result=t,this.props=a,this.factory=o,this.slotValues={};for(let r in i){let n=i[r](t);this.slotValues[r]=()=>n}}async init(t){return this.returnValue=this.factory(t,this.props,this.slotValues),this.returnValue}async*render(){this.returnValue===void 0&&await this.init(this.result);let t=this.returnValue;Ze(t)&&(t=await t),ke(t)?yield*t.content:yield*W(t)}};en=tn;function Pa(e,t){if(e!=null)for(let a of Object.keys(e))Zt.has(a)&&console.warn(`You are attempting to render <${t} ${a} />, but ${t} is an Astro component. Astro components do not render in the client and should not have a hydration directive. Please use a framework component for client rendering.`)}function Na(e,t,a,i,o={}){Pa(i,t);let r=new He(e,i,o,a);return $a(e,a)&&!e.propagators.has(a)&&e.propagators.set(a,r),r}function at(e){return typeof e=="object"&&!!e[tn]}async function*W(e){if(e=await e,e instanceof fe)e.instructions&&(yield*e.instructions),yield e;else if(et(e))yield e;else if(Array.isArray(e))for(let t of e)yield y(await W(t));else typeof e=="function"?yield*W(e()):typeof e=="string"?yield y(te(e)):!e&&e!==0||(Gt
Did you forget to import the component or is it possible there is a typo?`);case t.type===Symbol.for("astro:fragment"):return U(e,t.props.children);case t.type.isAstroComponentFactory:{let i={},o={};for(let[n,s]of Object.entries(t.props??{}))n==="children"||s&&typeof s=="object"&&s.$$slot?o[n==="children"?"default":n]=()=>U(e,s):i[n]=s;return y(await ja(e,t.type,i,o))}case(!t.type&&t.type!==0):return"";case(typeof t.type=="string"&&t.type!==bt):return y(await Ia(e,t.type,t.props??{}))}if(t.type){let i=function(l){if(Array.isArray(l))return l.map(c=>i(c));if(!ne(l)){n.default.push(l);return}if("slot"in l.props){n[l.props.slot]=[...n[l.props.slot]??[],l],delete l.props.slot;return}n.default.push(l)};if(typeof t.type=="function"&&t.type["astro:renderer"]&&a.increment(),typeof t.type=="function"&&t.props["server:root"]){let l=await t.type(t.props??{});return await U(e,l)}if(typeof t.type=="function")if(a.haveNoTried()||a.isCompleted()){_a();try{let l=await t.type(t.props??{}),c;if(l&&l[Se])return c=await Ve(e,l,a),c;if(!l)return c=await Ve(e,l,a),c}catch(l){if(a.isCompleted())throw l;a.increment()}finally{Ua()}}else a.increment();let{children:o=null,...r}=t.props??{},n={default:[]};i(o);for(let[l,c]of Object.entries(r))c.$$slot&&(n[l]=c,delete r[l]);let s=[],p={};for(let[l,c]of Object.entries(n))s.push(U(e,c).then(m=>{m.toString().trim().length!==0&&(p[l]=()=>m)}));await Promise.all(s),r[_.symbol]=a;let d;if(t.type===bt&&t.props["client:only"]?d=await St(e,t.props["client:display-name"]??"",null,r,p):d=await St(e,typeof t.type=="function"?t.type.name:t.type,t.type,r,p),typeof d!="string"&&Symbol.asyncIterator in d){let l=new X;for await(let c of d)l.append(c,e);return y(l.toString())}else return y(d)}}return y(`${t}`)}async function Ia(e,t,{children:a,...i}){return y(`<${t}${oi(i)}${y((a==null||a=="")&&tt.test(t)?"/>":`>${a==null?"":await U(e,Da(t,a))}</${t}>`)}`)}function Da(e,t){return typeof t=="string"&&(e==="style"||e==="script")?y(t):t}function _a(){if(ot++,!Be){Be=console.error;try{console.error=La}catch{}}}function Ua(){ot--}function La(e,...t){ot>0&&typeof e=="string"&&e.includes("Warning: Invalid hook call.")&&e.includes("https://reactjs.org/link/invalid-hook-call")||Be(e,...t)}var Je="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY",Ne=Je.length;function Ha(e){let t=0;if(e.length===0)return t;for(let a=0;a<e.length;a++){let i=e.charCodeAt(a);t=(t<<5)-t+i,t=t&t}return t}function qa(e){let t,a="",i=Ha(e),o=i<0?"Z":"";for(i=Math.abs(i);i>=Ne;)t=i%Ne,i=Math.floor(i/Ne),a=Je[t]+a;return i>0&&(a=Je[i]+a),o+a}function Ba(e){return typeof HTMLElement<"u"&&HTMLElement.isPrototypeOf(e)}async function Va(e,t,a,i){let o=Ja(t),r="";for(let n in a)r+=` ${n}="${Q(await a[n])}"`;return y(`<${o}${r}>${await K(e,i?.default)}</${o}>`)}function Ja(e){let t=customElements.getName(e);return t||e.name.replace(/^HTML|Element$/g,"").replace(/[A-Z]/g,"-$&").toLowerCase().replace(/^-/,"html-")}var wt=new Map([["solid","solid-js"]]);function Ga(e){switch(e?.split(".").pop()){case"svelte":return["@astrojs/svelte"];case"vue":return["@astrojs/vue"];case"jsx":case"tsx":return["@astrojs/react","@astrojs/preact","@astrojs/solid-js","@astrojs/vue (jsx)"];default:return["@astrojs/react","@astrojs/preact","@astrojs/solid-js","@astrojs/vue","@astrojs/svelte","@astrojs/lit"]}}function Wa(e){return e===za}function Ka(e){return e&&typeof e=="object"&&e["astro:html"]}async function Xa(e,t,a,i,o={}){var r,n;if(!a&&!i["client:only"])throw new Error(`Unable to render ${t} because it is ${a}!
Did you forget to import the component or is it possible there is a typo?`);let{renderers:s}=e._metadata,p={displayName:t},{hydration:d,isPage:l,props:c}=Fa(t,i),m="",b;d&&(p.hydrate=d.directive,p.hydrateArgs=d.value,p.componentExport=d.componentExport,p.componentUrl=d.componentUrl);let x=Ga(p.componentUrl),w=s.filter(S=>S.name!=="astro:jsx"),{children:h,slotInstructions:$}=await on(e,o),g;if(p.hydrate!=="only"){let S=!1;try{S=a&&a[qe]}catch{}if(S){let E=a[qe];g=s.find(({name:F})=>F===E)}if(!g){let E;for(let F of s)try{if(await F.ssr.check.call({result:e},a,c,h)){g=F;break}}catch(Ee){E??(E=Ee)}if(!g&&E)throw E}if(!g&&typeof HTMLElement=="function"&&Ba(a))return Va(e,a,i,o)}else{if(p.hydrateArgs){let S=p.hydrateArgs,E=wt.has(S)?wt.get(S):S;g=s.find(({name:F})=>F===`@astrojs/${E}`||F===E)}if(!g&&w.length===1&&(g=w[0]),!g){let S=(r=p.componentUrl)==null?void 0:r.split(".").pop();g=s.filter(({name:E})=>E===`@astrojs/${S}`||E===S)[0]}}if(g)p.hydrate==="only"?m=await K(e,o?.fallback):{html:m,attrs:b}=await g.ssr.renderToStaticMarkup.call({result:e},a,c,h,p);else{if(p.hydrate==="only")throw new v({...f.NoClientOnlyHint,message:f.NoClientOnlyHint.message(p.displayName),hint:f.NoClientOnlyHint.hint(x.map(S=>S.replace("@astrojs/","")).join("|"))});if(typeof a!="string"){let S=w.filter(F=>x.includes(F.name)),E=w.length>1;if(S.length===0)throw new v({...f.NoMatchingRenderer,message:f.NoMatchingRenderer.message(p.displayName,(n=p?.componentUrl)==null?void 0:n.split(".").pop(),E,w.length),hint:f.NoMatchingRenderer.hint(gt(x.map(F=>"`"+F+"`")))});if(S.length===1)g=S[0],{html:m,attrs:b}=await g.ssr.renderToStaticMarkup.call({result:e},a,c,h,p);else throw new Error(`Unable to render ${p.displayName}!
This component likely uses ${gt(x)},
but Astro encountered an error during server-side rendering.
Please ensure that ${p.displayName}:
1. Does not unconditionally access browser-specific globals like \`window\` or \`document\`.
If this is unavoidable, use the \`client:only\` hydration directive.
2. Does not conditionally return \`null\` or \`undefined\` when rendered on the server.
If you're still stuck, please open an issue on GitHub or join us at https://astro.build/chat.`)}}if(g&&!g.clientEntrypoint&&g.name!=="@astrojs/lit"&&p.hydrate)throw new v({...f.NoClientEntrypoint,message:f.NoClientEntrypoint.message(t,p.hydrate,g.name)});if(!m&&typeof a=="string"){let S=Ya(a),E=Object.values(h).join(""),F=Ae(await nt`<${S}${Ue(c)}${y(E===""&&tt.test(S)?"/>":`>${E}</${S}>`)}`);m="";for await(let Ee of F)m+=Ee}if(!d)return async function*(){$&&(yield*$),l||g?.name==="astro:jsx"?yield m:m&&m.length>0?yield y(m.replace(/\<\/?astro-slot\b[^>]*>/g,"")):yield""}();let A=qa(`<!--${p.componentExport.value}:${p.componentUrl}-->
${m}
${Yt(c,p)}`),C=await Ra({renderer:g,result:e,astroId:A,props:c,attrs:b},p),O=[];if(m){if(Object.keys(h).length>0)for(let S of Object.keys(h))m.includes(S==="default"?"<astro-slot>":`<astro-slot name="${S}">`)||O.push(S)}else O=Object.keys(h);let P=O.length>0?O.map(S=>`<template data-astro-template${S!=="default"?`="${S}"`:""}>${h[S]}</template>`).join(""):"";C.children=`${m??""}${P}`,C.children&&(C.props["await-children"]="");async function*H(){$&&(yield*$),yield{type:"directive",hydration:d,result:e},yield y(Z("astro-island",C,!1))}return H()}function Ya(e){let t=/[&<>'"\s]+/g;return t.test(e)?e.trim().split(t)[0].trim():e}async function Qa(e,t={}){let a=await K(e,t?.default);return a==null?a:y(a)}async function Za(e,t,a,i={}){let{slotInstructions:o,children:r}=await on(e,i),n=t.render({slots:r}),s=o?o.map(p=>de(e,p)).join(""):"";return y(s+n)}function rt(e,t,a,i,o={}){return Ze(a)?Promise.resolve(a).then(r=>rt(e,t,r,i,o)):Wa(a)?Qa(e,o):Ka(a)?Za(e,a,i,o):Wt(a)?Na(e,t,a,i,o):Xa(e,t,a,i,o)}function St(e,t,a,i,o={}){let r=rt(e,t,a,i,o);return at(r)?r.render():r}var Ge=typeof process=="object"&&Object.prototype.toString.call(process)==="[object process]",xe;function ei(){var e,t,a;return xe=(a=class extends Response{constructor(o,r){let n=o instanceof ReadableStream;super(n?null:o,r);k(this,e,void 0);k(this,t,void 0);j(this,e,n),j(this,t,o)}get body(){return u(this,t)}async text(){if(u(this,e)&&Ge){let o=new TextDecoder,r=u(this,t),n="";for await(let s of mt(r))n+=o.decode(s);return n}return super.text()}async arrayBuffer(){if(u(this,e)&&Ge){let o=u(this,t),r=[],n=0;for await(let d of mt(o))r.push(d),n+=d.length;let s=new Uint8Array(n),p=0;for(let d of r)s.set(d,p),p+=d.length;return s}return super.arrayBuffer()}},e=new WeakMap,t=new WeakMap,a),xe}var ti=Ge?(e,t)=>typeof e=="string"||ArrayBuffer.isView(e)?new Response(e,t):typeof xe>"u"?new(ei())(e,t):new xe(e,t):(e,t)=>new Response(e,t),kt=Symbol.for("astro.needsHeadRendering");function ni(e){return kt in e&&!!e[kt]}async function At(e,t,a){let i=new X,o=0;for await(let r of t)et(r)&&o===0&&(o++,/<!doctype html/i.test(String(r))||(i.append(`<!DOCTYPE html>
`,e),a&&await a(i))),i.append(r,e);return i.toArrayBuffer()}async function ai(e){let t=e.propagators.values();for(;;){let{value:a,done:i}=t.next();if(i)break;let o=await a.init(e);ke(o)&&e.extraHead.push(o.head)}}async function ii(e,t,a,i,o,r){var n,s;if(!Wt(t)){e._metadata.headInTree=((n=e.componentMetadata.get(t.moduleId))==null?void 0:n.containsHead)??!1;let l={...a??{},"server:root":!0},c,m="";try{if(ni(t)){let w=new X;for await(let h of Aa(e))w.append(h,e);m=w.toString()}let x=await rt(e,t.name,t,l,null);at(x)?c=x.render():c=x}catch(x){throw v.is(x)&&!x.loc&&x.setLocation({file:r?.component}),x}let b=await At(e,c,async x=>{x.append(m,e)});return new Response(b,{headers:new Headers([["Content-Type","text/html; charset=utf-8"],["Content-Length",b.byteLength.toString()]])})}e._metadata.headInTree=((s=e.componentMetadata.get(t.moduleId))==null?void 0:s.containsHead)??!1;let p=await t(e,a,i),d=ke(p);if(Gt(p)||d){await ai(e);let l=d?p.content:p,c=Ae(l),m=e.response,b=new Headers(m.headers),x;return o?x=new ReadableStream({start(h){async function $(){let g=0;try{for await(let A of c){et(A)&&g===0&&(/<!doctype html/i.test(String(A))||h.enqueue(it.encode(`<!DOCTYPE html>
`)));let C=Ma(e,A);h.enqueue(C),g++}h.close()}catch(A){v.is(A)&&!A.loc&&A.setLocation({file:r?.component}),h.error(A)}}$()}}):(x=await At(e,c),b.set("Content-Length",x.byteLength.toString())),ti(x,{...m,headers:b})}if(!(p instanceof Response))throw new v({...f.OnlyResponseCanBeReturned,message:f.OnlyResponseCanBeReturned.message(r?.route,typeof p),location:{file:r?.component}});return p}function oi(e,t,{class:a}={}){let i="";a&&(typeof e.class<"u"?e.class+=` ${a}`:typeof e["class:list"]<"u"?e["class:list"]=[e["class:list"],a]:e.class=a);for(let[o,r]of Object.entries(e))i+=Bt(r,o,!0);return y(i)}var We,rn,sn,pn,ln=!0;typeof process<"u"&&({FORCE_COLOR:We,NODE_DISABLE_COLORS:rn,NO_COLOR:sn,TERM:pn}=process.env||{},ln=process.stdout&&process.stdout.isTTY);var ri={enabled:!rn&&sn==null&&pn!=="dumb"&&(We!=null&&We!=="0"||ln)};function Y(e,t){let a=new RegExp(`\\x1b\\[${t}m`,"g"),i=`\x1B[${e}m`,o=`\x1B[${t}m`;return function(r){return!ri.enabled||r==null?r:i+(~(""+r).indexOf(o)?r.replace(a,o+i):r)+o}}var si=Y(0,0),Te=Y(1,22),pi=Y(2,22),li=Y(31,39),Et=Y(33,39),ci=Y(36,39),jt={},di={get exports(){return jt},set exports(e){jt=e}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(i){var o=i.charCodeAt(0),r=i.length==2?i.charCodeAt(1):0,n=o;return 55296<=o&&o<=56319&&56320<=r&&r<=57343&&(o&=1023,r&=1023,n=o<<10|r,n+=65536),n==12288||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":n==8361||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||n==172||n==175||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":n==161||n==164||167<=n&&n<=168||n==170||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||n==198||n==208||215<=n&&n<=216||222<=n&&n<=225||n==230||232<=n&&n<=234||236<=n&&n<=237||n==240||242<=n&&n<=243||247<=n&&n<=250||n==252||n==254||n==257||n==273||n==275||n==283||294<=n&&n<=295||n==299||305<=n&&n<=307||n==312||319<=n&&n<=322||n==324||328<=n&&n<=331||n==333||338<=n&&n<=339||358<=n&&n<=359||n==363||n==462||n==464||n==466||n==468||n==470||n==472||n==474||n==476||n==593||n==609||n==708||n==711||713<=n&&n<=715||n==717||n==720||728<=n&&n<=731||n==733||n==735||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||n==1025||1040<=n&&n<=1103||n==1105||n==8208||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||n==8240||8242<=n&&n<=8243||n==8245||n==8251||n==8254||n==8308||n==8319||8321<=n&&n<=8324||n==8364||n==8451||n==8453||n==8457||n==8467||n==8470||8481<=n&&n<=8482||n==8486||n==8491||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||n==8585||8592<=n&&n<=8601||8632<=n&&n<=8633||n==8658||n==8660||n==8679||n==8704||8706<=n&&n<=8707||8711<=n&&n<=8712||n==8715||n==8719||n==8721||n==8725||n==8730||8733<=n&&n<=8736||n==8739||n==8741||8743<=n&&n<=8748||n==8750||8756<=n&&n<=8759||8764<=n&&n<=8765||n==8776||n==8780||n==8786||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||n==8853||n==8857||n==8869||n==8895||n==8978||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n
<head>
<title>Testing</title>
${Vt(e)}</head>
<body>
<h1>Testing</h1>
<div id="env">${{}.SECRET_STUFF}</div>
</body>
</html>`},"/home/otterlord/Documents/Repos/astro/packages/integrations/cloudflare/test/fixtures/basics/src/pages/index.astro"),Qi="/home/otterlord/Documents/Repos/astro/packages/integrations/cloudflare/test/fixtures/basics/src/pages/index.astro",Zi="",bn=Object.freeze(Object.defineProperty({__proto__:null,default:yn,file:Qi,url:Zi},Symbol.toStringTag,{value:"Module"}));var ho=ct(Ce(),1),eo=typeof process=="object"&&Object.prototype.toString.call(process)==="[object process]";function to(){return new Proxy({},{get:(e,t)=>{console.warn(`Unable to access \`import.meta\0.env.${t.toString()}\` on initialization as the Cloudflare platform only provides the environment variables per request. Please move the environment variable access inside a function that's only called after a request has been received.`)}})}eo||(process.env=to());function kn(e){let t=new ge(e);return{onRequest:async({request:i,next:o,...r})=>{process.env=r.env;let{pathname:n}=new URL(i.url);if(e.assets.has(n))return o(i);let s=t.match(i,{matchNotFound:!0});if(s){Reflect.set(i,Symbol.for("astro.clientAddress"),i.headers.get("cf-connecting-ip")),Reflect.set(i,Symbol.for("runtime"),{...r,name:"cloudflare",next:o});let p=await t.render(i,s);if(t.setCookieHeaders)for(let d of t.setCookieHeaders(p))p.headers.append("Set-Cookie",d);return p}return new Response(null,{status:404,statusText:"Not found"})}}}var wn=Object.freeze(Object.defineProperty({__proto__:null,createExports:kn},Symbol.toStringTag,{value:"Module"})),no=new Map([["src/pages/index.astro",bn]]),ao=[Object.assign({name:"astro:jsx",serverEntrypoint:"astro/jsx/server.js",jsxImportSource:"astro"},{ssr:vn})],An=Object.assign(xn({adapterName:"@astrojs/cloudflare",routes:[{file:"",links:[],scripts:[],styles:[],routeData:{route:"/",type:"page",pattern:"^\\/$",segments:[],params:[],component:"src/pages/index.astro",pathname:"/",prerender:!1,_meta:{trailingSlash:"ignore"}}}],base:"/",markdown:{drafts:!1,syntaxHighlight:"shiki",shikiConfig:{langs:[],theme:"github-dark",wrap:!1},remarkPlugins:[],rehypePlugins:[],remarkRehype:{},gfm:!0,smartypants:!0},pageMap:null,componentMetadata:[["/home/otterlord/Documents/Repos/astro/packages/integrations/cloudflare/test/fixtures/basics/src/pages/index.astro",{propagation:"none",containsHead:!0}]],renderers:[],entryModules:{"\0@astrojs-ssr-virtual-entry":"_@astrojs-ssr-virtual-entry.mjs","astro:scripts/before-hydration.js":""},assets:["/$server_build/chunks/astro.034d8dae.mjs","/$server_build/chunks/pages/all.89c51540.mjs"]}),{pageMap:no,renderers:ao}),io=void 0,oo=kn(An),go=oo.onRequest,Sn="start";Sn in wn&&wn[Sn](An,io);export{go as onRequest,no as pageMap,ao as renderers};
/**
* shortdash - https://github.com/bibig/node-shorthash
*
* @license
*
* (The MIT License)
*
* Copyright (c) 2013 Bibig <bibig@me.com>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
/*! Bundled license information:
cookie/index.js:
(*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*)
*/