3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [numPeople, setNumPeople] = useState(4);
7 const [numRecipes, setNumRecipes] = useState(1);
229}
230
231function client() {
232 createRoot(document.getElementById("root")).render(<App />);
233}
234if (typeof document !== "undefined") { client(); }
235
236function extractJSONFromMarkdown(markdown: string): string {
237 const jsonMatch = markdown.match(/```json\n([\s\S]*?)\n```/);
238 return jsonMatch ? jsonMatch[1] : "";
239}
240
241export default async function server(request: Request): Promise<Response> {
242 if (request.method === "POST" && new URL(request.url).pathname === "/recipes") {
243 const { OpenAI } = await import("https://esm.town/v/std/openai");
338}
339
340async function generateImage(recipeName: string): Promise<string> {
341 const response = await fetch(`https://maxm-imggenurl.web.val.run/${encodeURIComponent(recipeName)}`);
342 if (!response.ok) {
4import React, { useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
5
6function ConfirmationModal({ isOpen, onClose }) {
7 if (!isOpen) return null;
8
18}
19
20function App() {
21 const [sport, setSport] = useState("");
22 const [skillLevel, setSkillLevel] = useState("");
396}
397
398function client() {
399 createRoot(document.getElementById("root")).render(<App />);
400}
735`;
736
737async function server(request: Request): Promise<Response> {
738 if (request.method === "POST" && new URL(request.url).pathname === "/generate-training") {
739 const YOUTUBE_API_KEY = Deno.env.get("YOUTUBE_API_KEY2");
826 const { email } = await import("https://esm.town/v/std/email");
827
828 // Function to insert YouTube links into the training plan
829 const insertYouTubeLinks = (plan, links) => {
830 let modifiedPlan = plan;
891}
892
893async function getYouTubeVideoId(query, sport, apiKey, useApiKey = true) {
894 if (useApiKey) {
895 try {
913}
914
915function getFallbackYouTubeLink(query, sport) {
916 const searchQuery = encodeURIComponent(`${sport} ${query}`);
917 return `https://www.youtube.com/results?search_query=${searchQuery}`;
3// Fetches a random joke.
4// Fetches a random joke.
5async function fetchRandomJoke() {
6 const response = await fetch(
7 "https://official-joke-api.appspot.com/random_joke",
5const BASE_URL = "https://stevekrouse-cors_example_backend.web.val.run";
6
7export function App() {
8 const [logs, setLogs] = useState([]);
9 async function request(url, options) {
10 try {
11 const response = await fetch(url, options);
1export default async function(req: Request): Promise<Response> {
2 return new Response(
3 `
14]
15
16function esc(string) {
17 return replacements.reduce(function(string, replacement) {
18 return string.replace(replacement[0], replacement[1])
19 }, string)
71 )
72
73 function c(tag, style) {
74 const elem = document.createElement(tag)
75 if (style) elem.style = style
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function FAQ({ question, answer }) {
6 const [isOpen, setIsOpen] = useState(false);
7
30}
31
32function GallagherArticle() {
33 const faqs = [
34 {
133}
134
135function client() {
136 createRoot(document.getElementById("root")).render(<GallagherArticle />);
137}
139if (typeof document !== "undefined") { client(); }
140
141export default async function server(request: Request): Promise<Response> {
142 return new Response(`
143 <html>
134];
135
136function ExternalLinks() {
137 return (
138 <div className="external-links">
159}
160
161function BandIntroduction() {
162 return (
163 <div className="band-introduction">
188}
189
190function AlbumCard({ album }) {
191 return (
192 <div className="album-card">
206}
207
208function App() {
209 return (
210 <div className="oasis-discography">
224}
225
226function client() {
227 createRoot(document.getElementById("root")).render(<App />);
228}
229if (typeof document !== "undefined") { client(); }
230
231export default async function handler(request: Request): Promise<Response> {
232 return new Response(`
233 <html>
4import { createRoot } from "https://esm.sh/react-dom/client";
5
6function App() {
7 const [message, setMessage] = useState("");
8 const [status, setStatus] = useState("");
82}
83
84function client() {
85 createRoot(document.getElementById("root")).render(<App />);
86}
87if (typeof document !== "undefined") { client(); }
88
89export default async function server(request: Request): Promise<Response> {
90 if (request.method === "POST" && new URL(request.url).pathname === "/post-bluesky") {
91 try {
5import { createRoot } from "https://esm.sh/react-dom/client";
6
7function ThankYouCard({ note, theme, font, recipientName, senderName }) {
8 const [firstHalf, secondHalf] = splitNote(note);
9
30}
31
32function splitNote(note) {
33 const words = note.split(" ");
34 const midpoint = Math.ceil(words.length / 2);
39}
40
41function capitalizeName(name) {
42 if (!name) return "";
43 return name
50}
51
52function App() {
53 const [recipientName, setRecipientName] = useState("");
54 const [senderName, setSenderName] = useState("");
295}
296
297function client() {
298 createRoot(document.getElementById("root")).render(<App />);
299}
303}
304
305export default async function server(request: Request): Promise<Response> {
306 console.log(`Received ${request.method} request to ${request.url}`);
307