[{"data":1,"prerenderedAt":5768},["ShallowReactive",2],{"docs-navigation":3,"content-query-rt8ijQdFn0":303},[4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70,73,76,79,82,85,88,91,94,97,100,103,106,109,112,115,118,121,124,127,130,133,136,139,142,145,148,151,154,157,160,163,166,169,172,175,178,181,184,187,190,193,196,199,202,205,208,211,214,217,220,223,226,229,232,235,238,241,244,246,249,252,255,258,261,264,267,270,273,276,279,282,285,288,291,294,297,300],{"_path":5,"title":6},"/docs/account/account-management","Account management",{"_path":8,"title":9},"/docs/account/mfa","Multi-factor authentication (MFA)",{"_path":11,"title":12},"/docs/account/team","Teams and sub-accounts",{"_path":14,"title":15},"/docs/account/billing-and-subscriptions","Billing & subscriptions",{"_path":17,"title":18},"/docs/account/access-tokens","Webhook Relay access tokens: permissions and subscription scopes",{"_path":20,"title":21},"/docs/clawhub","Webhook Relay on ClawHub",{"_path":23,"title":24},"/docs/email","Receive emails as webhooks",{"_path":26,"title":27},"/docs/email/payload","Email webhook payload",{"_path":29,"title":30},"/docs/email/filtering-and-policy","Sender filtering & policy",{"_path":32,"title":33},"/docs/email/cli","Create & poll email addresses from the CLI",{"_path":35,"title":36},"/docs","Getting Started",{"_path":38,"title":39},"/docs/installation/cli","CLI",{"_path":41,"title":42},"/docs/installation/docker","Docker container",{"_path":44,"title":45},"/docs/installation/docker-compose","Docker Compose",{"_path":47,"title":48},"/docs/installation/kubernetes","Kubernetes",{"_path":50,"title":51},"/docs/installation/autostart-windows","Autostart (Windows)",{"_path":53,"title":54},"/docs/installation/autostart-linux","Autostart (Linux)",{"_path":56,"title":57},"/docs/installation/autostart-macos","Autostart (MacOS)",{"_path":59,"title":60},"/docs/installation/behind-proxy","HTTP proxy configuration",{"_path":62,"title":63},"/docs/mcp","MCP Server",{"_path":65,"title":66},"/docs/security","Security & Tech",{"_path":68,"title":69},"/docs/service-connections","Service Connections",{"_path":71,"title":72},"/docs/service-connections/ai-providers","AI provider connections",{"_path":74,"title":75},"/docs/service-connections/aws_s3","AWS S3",{"_path":77,"title":78},"/docs/service-connections/aws_sns","AWS SNS",{"_path":80,"title":81},"/docs/service-connections/aws_sqs","AWS SQS",{"_path":83,"title":84},"/docs/service-connections/azure","Azure",{"_path":86,"title":87},"/docs/service-connections/gcp_gcs","GCP Cloud Storage",{"_path":89,"title":90},"/docs/service-connections/gcp_pubsub","GCP Pub/Sub",{"_path":92,"title":93},"/docs/service-connections/secrets","Secrets",{"_path":95,"title":96},"/docs/skills","Agent Skills",{"_path":98,"title":99},"/docs/skills-cli","skills.sh — the Agent Skills CLI",{"_path":101,"title":102},"/docs/tunnels/demoing-your-website","Demoing your website",{"_path":104,"title":105},"/docs/tunnels/regions","Regions",{"_path":107,"title":108},"/docs/tutorials/cicd/jenkins-bitbucket","Jenkins and Bitbucket",{"_path":110,"title":111},"/docs/tutorials/cicd/jenkins-github","Jenkins and GitHub",{"_path":113,"title":114},"/docs/tutorials/cicd/jenkins-plugin","Jenkins Plugin",{"_path":116,"title":117},"/docs/tutorials/cicd/jenkins-plugin-multibranch","Jenkins Multibranch Pipelines",{"_path":119,"title":120},"/docs/tutorials/cicd/kubernetes-operator","Kubernetes Operator",{"_path":122,"title":123},"/docs/tutorials/cicd/terraform-atlantis","Terraform Atlantis",{"_path":125,"title":126},"/docs/tutorials/cicd/webhook-exec","Execute scripts on webhook",{"_path":128,"title":129},"/docs/tutorials/edge/home-assistant","Home Assistant",{"_path":131,"title":132},"/docs/tutorials/edge/javascript-app","JavaScript app",{"_path":134,"title":135},"/docs/tutorials/edge/node-red","Node-RED",{"_path":137,"title":138},"/docs/tutorials/email/airtable","Email to Airtable",{"_path":140,"title":141},"/docs/tutorials/email/api","Email to API",{"_path":143,"title":144},"/docs/tutorials/email/database","Email to Database",{"_path":146,"title":147},"/docs/tutorials/email/discord","Email to Discord",{"_path":149,"title":150},"/docs/tutorials/email/google-sheets","Email to Google Sheets",{"_path":152,"title":153},"/docs/tutorials/email/microsoft-teams","Email to Microsoft Teams",{"_path":155,"title":156},"/docs/tutorials/email/notion","Email to Notion",{"_path":158,"title":159},"/docs/tutorials/email/slack","Email to Slack",{"_path":161,"title":162},"/docs/tutorials","Tutorials",{"_path":164,"title":165},"/docs/tutorials/n8n/email-trigger","n8n Email Trigger (Inbound Email)",{"_path":167,"title":168},"/docs/tutorials/n8n/webhook-trigger","n8n Webhook Trigger (No Public IP)",{"_path":170,"title":171},"/docs/tutorials/n8n/whatsapp-cloud-api-webhook","n8n WhatsApp Cloud API Webhook Setup",{"_path":173,"title":174},"/docs/tutorials/transform/docker-to-slack","DockerHub webhook to Slack notification",{"_path":176,"title":177},"/docs/tutorials/transform/enrich-webhooks","Enrich webhooks from APIs",{"_path":179,"title":180},"/docs/tutorials/transform/stripe-to-plain","Sync Stripe subscriptions to Plain.com tenants",{"_path":182,"title":183},"/docs/tutorials/warehouse/bigquery","GCP BigQuery",{"_path":185,"title":186},"/docs/webhooks/alerts","Alerts",{"_path":188,"title":189},"/docs/webhooks/auth/username-password","Username and password",{"_path":191,"title":192},"/docs/webhooks/auth/hmac","HMAC",{"_path":194,"title":195},"/docs/webhooks/auth/jwt","JWT authentication",{"_path":197,"title":198},"/docs/webhooks/auth/http-method","Auth using request method",{"_path":200,"title":201},"/docs/webhooks/cors","CORS for webhooks",{"_path":203,"title":204},"/docs/webhooks/cron/using-cron-webhooks","Schedule recurring webhooks",{"_path":206,"title":207},"/docs/webhooks/custom-domains","Custom webhook domains",{"_path":209,"title":210},"/docs/webhooks/custom-subdomains","Custom webhook subdomains",{"_path":212,"title":213},"/docs/webhooks/custom-webhook-response","Custom response to webhooks",{"_path":215,"title":216},"/docs/webhooks/durable-webhooks","Durable webhooks: reliable delivery with automatic retries",{"_path":218,"title":219},"/docs/webhooks/functions/manipulating-json","JSON encoding",{"_path":221,"title":222},"/docs/webhooks/functions/make-http-request","Make HTTP request",{"_path":224,"title":225},"/docs/webhooks/functions/modify-request","Modify webhook headers, body, method and path",{"_path":227,"title":228},"/docs/webhooks/functions/multipart-form-data","Multipart form to JSON",{"_path":230,"title":231},"/docs/webhooks/functions/url-encoded-data","URL Encoded Form",{"_path":233,"title":234},"/docs/webhooks/functions/working-with-time","Working with time",{"_path":236,"title":237},"/docs/webhooks/functions/send-emails","Sending emails",{"_path":239,"title":240},"/docs/webhooks/functions/crypto-functions","Base64, encryption",{"_path":242,"title":243},"/docs/webhooks/functions/integrate-into-cicd","Integrating into CI/CD",{"_path":245,"title":183},"/docs/webhooks/functions/big-query",{"_path":247,"title":248},"/docs/webhooks/functions/accessing-metadata","Accessing metadata",{"_path":250,"title":251},"/docs/webhooks/functions/response-functions","Response (post-delivery) functions",{"_path":253,"title":254},"/docs/webhooks/functions/alerting","Alerting from functions",{"_path":256,"title":257},"/docs/webhooks/functions/helper-libraries","Helper libraries",{"_path":259,"title":260},"/docs/webhooks/functions/transform-webhook-payload","Transform a webhook payload",{"_path":262,"title":263},"/docs/webhooks/functions/filter-webhooks","Filter or drop webhooks before forwarding",{"_path":265,"title":266},"/docs/webhooks/functions/provider-helpers","Provider-aware function helpers",{"_path":268,"title":269},"/docs/webhooks/functions","Webhook transformations (functions): modify body, headers, method and path",{"_path":271,"title":272},"/docs/webhooks/internal/localhost","Receive webhooks on localhost with the relay CLI",{"_path":274,"title":275},"/docs/webhooks/large-webhooks","Large Webhooks",{"_path":277,"title":278},"/docs/webhooks/outbound-throttling","Outbound throttling: control webhook delivery speed",{"_path":280,"title":281},"/docs/webhooks/polling-webhooks","Polling webhooks with /v1/events",{"_path":283,"title":284},"/docs/webhooks/public/public-destination","Forward to public URL",{"_path":286,"title":287},"/docs/webhooks/public/multiple-destination-urls","Forward webhooks to multiple destinations",{"_path":289,"title":290},"/docs/webhooks/replay-on-agent-connect","Webhook replay on agent connect: recover missed webhooks",{"_path":292,"title":293},"/docs/webhooks/static-ip-address","Static IP Address",{"_path":295,"title":296},"/docs/webhooks/tls-ssl-errors","Fix TLS/SSL handshake errors: unsupported protocol, wrong version number, handshake failure",{"_path":298,"title":299},"/docs/webhooks/websocket-server","Connecting to websocket server",{"_path":301,"title":302},"/docs/webhooks/zero-retention-buckets","Zero Retention Buckets",{"_path":179,"_dir":304,"_draft":305,"_partial":305,"_locale":306,"title":180,"description":307,"intro":308,"type":309,"layout":310,"tags":311,"faq":315,"body":328,"_type":5761,"_id":5762,"_source":5763,"_file":5764,"_stem":5765,"_extension":5766,"sitemap":5767},"transform",false,"","Keep Plain.com customers, tenants and tenant tiers in sync with Stripe subscription state using a single Webhook Relay function: verify the Stripe signature, map subscription events to Plain GraphQL mutations and answer Stripe — no server, no Cloudflare Worker.","Sync Stripe subscription state into Plain.com tenants with one Webhook Relay function — signature verification, customer upserts and tier updates included, nothing to deploy.","tutorial","doc",[312,313,314],"Functions","Stripe","Webhook Forwarding",[316,319,322,325],{"q":317,"a":318},"Do I need a destination output for this to work?","No. The function is attached to the bucket's input and calls the Plain GraphQL API directly with http.request, then answers Stripe itself with r.stopForwarding(). The bucket needs no output destinations; every request is still logged and replayable.",{"q":320,"a":321},"Which Stripe subscription statuses count as paid?","active, trialing and past_due set the paid tenant tier. Everything else — including customer.subscription.deleted, canceled and unpaid — clears the tier back to none.",{"q":323,"a":324},"What does Stripe see when Plain is down?","The function returns a 500, so Stripe retries the event on its normal schedule. Signature failures and malformed bodies return a 400, which Stripe does not retry. Successful handling returns a 200 with a JSON body.",{"q":326,"a":327},"Is the sync idempotent when Stripe retries the same event?","Yes. Every Plain mutation is an upsert keyed on the customer's email address and the Stripe customer ID as the tenant external ID, so replaying an event or re-running it from the bucket log converges to the same state.",{"type":329,"children":330,"toc":5751},"root",[331,345,354,359,366,399,405,426,513,524,530,574,5142,5153,5275,5281,5300,5306,5320,5359,5393,5399,5420,5490,5517,5523,5679,5685,5734,5745],{"type":332,"tag":333,"props":334,"children":335},"element","p",{},[336,343],{"type":332,"tag":337,"props":338,"children":339},"strong",{},[340],{"type":341,"value":342},"text","This tutorial replaces a \"Stripe → Plain.com\" sync worker (for example a Cloudflare Worker) with a single Webhook Relay function attached to a bucket input.",{"type":341,"value":344}," Stripe delivers subscription events to the bucket's permanent input URL; the function verifies the Stripe signature, looks up the customer, and upserts Plain.com customers, tenants and tenant tiers through Plain's GraphQL API — no server to deploy, no public endpoint of your own to secure. Every event is logged in the bucket and can be replayed.",{"type":332,"tag":333,"props":346,"children":347},{},[348],{"type":332,"tag":349,"props":350,"children":353},"img",{"alt":351,"src":352},"Stripe posts subscription events to a Webhook Relay bucket input. A function attached to the input verifies the Stripe signature, maps the event to a paid or free tier, and upserts Plain.com customers, tenants and tenant tiers through http.request GraphQL calls. The input answers Stripe with 200 received true, and every event is logged for replay.","/images/tutorials/transform/stripe-to-plain.svg",[],{"type":332,"tag":333,"props":355,"children":356},{},[357],{"type":341,"value":358},"The pattern works for any \"webhook in, GraphQL out\" integration — only the mutations change.",{"type":332,"tag":360,"props":361,"children":363},"h2",{"id":362},"_1-create-a-bucket-for-stripe-events",[364],{"type":341,"value":365},"1. Create a bucket for Stripe events",{"type":332,"tag":333,"props":367,"children":368},{},[369,371,380,382,389,391,397],{"type":341,"value":370},"In ",{"type":332,"tag":372,"props":373,"children":377},"a",{"href":374,"rel":375},"https://my.webhookrelay.com/buckets",[376],"nofollow",[378],{"type":341,"value":379},"my.webhookrelay.com/buckets",{"type":341,"value":381}," create a bucket named ",{"type":332,"tag":383,"props":384,"children":386},"code",{"className":385},[],[387],{"type":341,"value":388},"stripe",{"type":341,"value":390},". Its default input URL (",{"type":332,"tag":383,"props":392,"children":394},{"className":393},[],[395],{"type":341,"value":396},"https://xxx.hooks.webhookrelay.com/v1/web/...",{"type":341,"value":398},") is permanent and public — that is the endpoint Stripe will deliver to. No output destinations are needed.",{"type":332,"tag":360,"props":400,"children":402},{"id":401},"_2-store-the-credentials-as-secret-connections",[403],{"type":341,"value":404},"2. Store the credentials as secret connections",{"type":332,"tag":333,"props":406,"children":407},{},[408,410,415,417,424],{"type":341,"value":409},"The function needs three credentials. Create each as a ",{"type":332,"tag":337,"props":411,"children":412},{},[413],{"type":341,"value":414},"Secret",{"type":341,"value":416}," service connection at ",{"type":332,"tag":372,"props":418,"children":421},{"href":419,"rel":420},"https://my.webhookrelay.com/service-connections",[376],[422],{"type":341,"value":423},"my.webhookrelay.com/service-connections",{"type":341,"value":425}," — secrets are write-only, encrypted at rest and redacted from logs, unlike values pasted into source code:",{"type":332,"tag":427,"props":428,"children":429},"table",{},[430,449],{"type":332,"tag":431,"props":432,"children":433},"thead",{},[434],{"type":332,"tag":435,"props":436,"children":437},"tr",{},[438,444],{"type":332,"tag":439,"props":440,"children":441},"th",{},[442],{"type":341,"value":443},"Alias in the function",{"type":332,"tag":439,"props":445,"children":446},{},[447],{"type":341,"value":448},"Holds",{"type":332,"tag":450,"props":451,"children":452},"tbody",{},[453,479,496],{"type":332,"tag":435,"props":454,"children":455},{},[456,466],{"type":332,"tag":457,"props":458,"children":459},"td",{},[460],{"type":332,"tag":383,"props":461,"children":463},{"className":462},[],[464],{"type":341,"value":465},"secret:stripe-signing-secret",{"type":332,"tag":457,"props":467,"children":468},{},[469,471,477],{"type":341,"value":470},"Stripe webhook signing secret (",{"type":332,"tag":383,"props":472,"children":474},{"className":473},[],[475],{"type":341,"value":476},"whsec_...",{"type":341,"value":478}," from the webhook endpoint settings)",{"type":332,"tag":435,"props":480,"children":481},{},[482,491],{"type":332,"tag":457,"props":483,"children":484},{},[485],{"type":332,"tag":383,"props":486,"children":488},{"className":487},[],[489],{"type":341,"value":490},"secret:stripe-api-key",{"type":332,"tag":457,"props":492,"children":493},{},[494],{"type":341,"value":495},"Stripe secret API key (used to look up the customer's email on subscription events)",{"type":332,"tag":435,"props":497,"children":498},{},[499,508],{"type":332,"tag":457,"props":500,"children":501},{},[502],{"type":332,"tag":383,"props":503,"children":505},{"className":504},[],[506],{"type":341,"value":507},"secret:plain-api-key",{"type":332,"tag":457,"props":509,"children":510},{},[511],{"type":341,"value":512},"Plain.com API token",{"type":332,"tag":333,"props":514,"children":515},{},[516,518,522],{"type":341,"value":517},"How secret imports and bindings work: ",{"type":332,"tag":372,"props":519,"children":520},{"href":92},[521],{"type":341,"value":93},{"type":341,"value":523},".",{"type":332,"tag":360,"props":525,"children":527},{"id":526},"_3-create-the-function",[528],{"type":341,"value":529},"3. Create the function",{"type":332,"tag":333,"props":531,"children":532},{},[533,535,542,544,550,552,557,559,564,566,572],{"type":341,"value":534},"Go to ",{"type":332,"tag":372,"props":536,"children":539},{"href":537,"rel":538},"https://my.webhookrelay.com/functions",[376],[540],{"type":341,"value":541},"my.webhookrelay.com/functions",{"type":341,"value":543},", create a function named ",{"type":332,"tag":383,"props":545,"children":547},{"className":546},[],[548],{"type":341,"value":549},"stripe-to-plain",{"type":341,"value":551}," (driver ",{"type":332,"tag":337,"props":553,"children":554},{},[555],{"type":341,"value":556},"JavaScript",{"type":341,"value":558},") and paste in the code below. Then open the function's ",{"type":332,"tag":337,"props":560,"children":561},{},[562],{"type":341,"value":563},"Connections",{"type":341,"value":565}," tab and bind each ",{"type":332,"tag":383,"props":567,"children":569},{"className":568},[],[570],{"type":341,"value":571},"secret:",{"type":341,"value":573}," alias to the connection from step 2.",{"type":332,"tag":575,"props":576,"children":580},"pre",{"className":577,"code":578,"language":579,"meta":306,"style":306},"language-javascript shiki shiki-themes github-dark","// Stripe → Plain.com sync. Attached to a bucket INPUT: verifies Stripe's\n// signature, keeps Plain customers/tenants/tiers in sync with subscription\n// state, and answers Stripe directly. No output destination required.\n\n// Bound on the function's Connections tab — never hard-code these:\nconst stripeSigningSecret = require(\"secret:stripe-signing-secret\") // whsec_...\nconst stripeApiKey = require(\"secret:stripe-api-key\")               // sk_...\nconst plainApiKey = require(\"secret:plain-api-key\")                 // plainApiKey_...\n\n// Non-secret settings (function config, not secrets):\n//   PLAIN_PAID_TIER_ID – Plain tenant tier id that marks a tenant as paid\n//                        (Plain → Settings → Tenants → Tiers)\n//   DRY_RUN            – unset or \"true\" = log only, \"false\" = write to Plain\nconst PLAIN_API = \"https://core-api.uk.plain.com/graphql/v1\"\nconst SIGNATURE_TOLERANCE_S = 300\n\nconst PAID_STATUSES = [\"active\", \"trialing\", \"past_due\"]\nconst HANDLED_EVENTS = [\n  \"customer.subscription.created\",\n  \"customer.subscription.updated\",\n  \"customer.subscription.deleted\",\n  \"customer.created\"\n]\n\n// ---------- Plain GraphQL ----------\n\nconst UPSERT_CUSTOMER = `\n  mutation UpsertCustomer($input: UpsertCustomerInput!) {\n    upsertCustomer(input: $input) {\n      customer { id email { email } }\n      error { message code }\n    }\n  }`\n\nconst UPSERT_TENANT = `\n  mutation UpsertTenant($input: UpsertTenantInput!) {\n    upsertTenant(input: $input) {\n      tenant { id name externalId }\n      error { message code }\n    }\n  }`\n\nconst UPDATE_TENANT_TIER = `\n  mutation UpdateTenantTier($input: UpdateTenantTierInput!) {\n    updateTenantTier(input: $input) {\n      error { message code }\n    }\n  }`\n\nconst ADD_CUSTOMER_TO_TENANTS = `\n  mutation AddCustomerToTenants($input: AddCustomerToTenantsInput!) {\n    addCustomerToTenants(input: $input) {\n      customer { id }\n      error { message code }\n    }\n  }`\n\nfunction plain(query, variables) {\n  const resp = http.request(\"POST\", PLAIN_API, {\n    headers: {\n      \"Content-Type\": \"application/json\",\n      Authorization: \"Bearer \" + plainApiKey\n    },\n    body: JSON.stringify({ query: query, variables: variables })\n  })\n  if (resp.status_code !== 200) {\n    throw new Error(\"Plain HTTP \" + resp.status_code + \": \" + resp.body)\n  }\n  const body = JSON.parse(resp.body)\n  if (body.errors && body.errors.length > 0) {\n    throw new Error(\"Plain GraphQL: \" + body.errors.map(e => e.message).join(\"; \"))\n  }\n  if (!body.data) throw new Error(\"Plain returned empty data\")\n  return body.data\n}\n\nfunction upsertPlainCustomer(email, fullName, stripeCustomerId) {\n  const data = plain(UPSERT_CUSTOMER, {\n    input: {\n      identifier: { emailAddress: email },\n      onCreate: {\n        fullName: fullName || email,\n        email: { email: email, isVerified: false },\n        externalId: stripeCustomerId\n      },\n      onUpdate: {}\n    }\n  })\n  if (data.upsertCustomer.error) {\n    throw new Error(\"upsertCustomer: \" + data.upsertCustomer.error.message)\n  }\n  return data.upsertCustomer.customer.id\n}\n\nfunction upsertPlainTenant(stripeCustomerId, name) {\n  const data = plain(UPSERT_TENANT, {\n    input: {\n      identifier: { externalId: stripeCustomerId },\n      name: name,\n      externalId: stripeCustomerId\n    }\n  })\n  if (data.upsertTenant.error) {\n    throw new Error(\"upsertTenant: \" + data.upsertTenant.error.message)\n  }\n  return data.upsertTenant.tenant.id\n}\n\nfunction setPlainTenantTier(tenantId, tierId) {\n  if (!tierId) throw new Error(\"PLAIN_PAID_TIER_ID is not set in function config\")\n  plain(UPDATE_TENANT_TIER, {\n    input: {\n      tenantIdentifier: { tenantId: tenantId },\n      tierIdentifier: { tierId: tierId }\n    }\n  })\n}\n\nfunction clearPlainTenantTier(tenantId) {\n  plain(UPDATE_TENANT_TIER, {\n    input: {\n      tenantIdentifier: { tenantId: tenantId },\n      tierIdentifier: null\n    }\n  })\n}\n\nfunction linkPlainCustomerToTenant(customerId, tenantId) {\n  plain(ADD_CUSTOMER_TO_TENANTS, {\n    input: {\n      customerIdentifier: { customerId: customerId },\n      tenantIdentifiers: [{ tenantId: tenantId }]\n    }\n  })\n}\n\n// ---------- Stripe ----------\n\nfunction fetchStripeCustomer(customerId) {\n  const resp = http.request(\n    \"GET\",\n    \"https://api.stripe.com/v1/customers/\" + customerId,\n    { headers: { Authorization: \"Bearer \" + stripeApiKey } }\n  )\n  if (resp.status_code !== 200) {\n    throw new Error(\"Stripe customer lookup \" + resp.status_code + \": \" + resp.body)\n  }\n  return JSON.parse(resp.body)\n}\n\n// ---------- main ----------\n\nfunction answer(status, payload) {\n  r.setResponseStatus(status)\n  r.setResponseHeader(\"Content-Type\", \"application/json\")\n  r.setResponseBody(JSON.stringify(payload))\n  r.stopForwarding()\n}\n\n// 1) Verify Stripe's signature before trusting the payload.\n//    Stripe-Signature: t=\u003Cunix ts>, v1=\u003Chex hmac of \"\u003Cts>.\u003Cbody>\">\nconst signature = r.headers[\"Stripe-Signature\"] || \"\"\nconst timestamp = (signature.match(/t=(\\d+)/) || [])[1]\nconst sent = (signature.match(/v1=([a-f0-9]+)/) || [])[1]\n\nif (!timestamp || !sent) {\n  answer(400, { error: \"missing Stripe-Signature header\" })\n  return\n}\nif (Math.abs(time.unix() - parseInt(timestamp, 10)) > SIGNATURE_TOLERANCE_S) {\n  answer(400, { error: \"timestamp outside tolerance\" })\n  return\n}\nconst expected = crypto.hmac(\"sha256\", stripeSigningSecret, timestamp + \".\" + r.body)\nif (expected !== sent) {\n  answer(400, { error: \"signature mismatch\" })\n  return\n}\n\n// 2) Parse the event; ignore anything we do not sync.\nlet event\ntry {\n  event = JSON.parse(r.body)\n} catch (e) {\n  answer(400, { error: \"invalid JSON body\" })\n  return\n}\nif (HANDLED_EVENTS.indexOf(event.type) === -1) {\n  answer(200, { received: true, handled: false, type: event.type })\n  return\n}\n\n// 3) Sync. Any Plain error → 500 so Stripe retries the delivery.\ntry {\n  const outcome = syncEvent(event)\n  console.log(\"stripe-to-plain\", event.type, JSON.stringify(outcome))\n  answer(200, { received: true, handled: true, outcome: outcome })\n} catch (e) {\n  console.error(\"stripe-to-plain error\", event.type, String(e))\n  answer(500, { error: String(e) })\n}\n\n// ---------- sync ----------\n\nfunction syncEvent(event) {\n  let email, name, stripeCustomerId, tier\n\n  if (event.type === \"customer.created\") {\n    // New Stripe customer: make sure they exist in Plain on the free tier.\n    const c = event.data.object\n    if (!c.email) return { action: \"noop\", reason: \"customer_has_no_email\" }\n    email = c.email\n    name = c.name\n    stripeCustomerId = c.id\n    tier = \"free\"\n  } else {\n    // Subscription events: resolve the customer for email + name.\n    const sub = event.data.object\n    stripeCustomerId = typeof sub.customer === \"string\" ? sub.customer : sub.customer.id\n    const customer = fetchStripeCustomer(stripeCustomerId)\n    if (!customer.email) {\n      return { action: \"noop\", reason: \"stripe_customer_has_no_email\" }\n    }\n    email = customer.email\n    name = customer.name\n    if (event.type === \"customer.subscription.deleted\") {\n      tier = \"free\"\n    } else if (PAID_STATUSES.indexOf(sub.status) !== -1) {\n      tier = \"paid\"\n    } else {\n      tier = \"free\"\n    }\n  }\n\n  const action = tier === \"paid\" ? \"set_paid\" : \"set_free\"\n\n  // DRY_RUN unset or \"true\" = log only; set DRY_RUN=false to write to Plain.\n  if (cfg.get(\"DRY_RUN\") !== \"false\") {\n    return { action: action, email: email, reason: \"dry_run\" }\n  }\n\n  const customerId = upsertPlainCustomer(email, name, stripeCustomerId)\n  const tenantId = upsertPlainTenant(stripeCustomerId, email)\n  if (tier === \"paid\") {\n    setPlainTenantTier(tenantId, cfg.get(\"PLAIN_PAID_TIER_ID\"))\n  } else {\n    clearPlainTenantTier(tenantId)\n  }\n  linkPlainCustomerToTenant(customerId, tenantId)\n\n  return { action: action, email: email, plain_customer_id: customerId }\n}\n","javascript",[581],{"type":332,"tag":383,"props":582,"children":583},{"__ignoreMap":306},[584,596,605,614,624,633,682,722,762,770,779,788,797,806,828,850,858,909,931,945,958,971,980,988,996,1005,1013,1035,1044,1053,1062,1071,1080,1089,1097,1118,1127,1136,1145,1153,1161,1169,1177,1198,1207,1216,1224,1232,1240,1248,1269,1278,1287,1296,1304,1312,1320,1328,1366,1417,1426,1449,1473,1482,1510,1519,1547,1603,1612,1648,1690,1766,1774,1824,1838,1847,1855,1899,1933,1942,1951,1960,1979,1998,2007,2016,2025,2033,2041,2054,2088,2096,2109,2117,2125,2159,2192,2200,2209,2218,2227,2235,2243,2256,2290,2298,2311,2319,2327,2362,2408,2430,2438,2447,2456,2464,2472,2480,2488,2513,2533,2541,2549,2563,2571,2579,2587,2595,2629,2650,2658,2667,2676,2684,2692,2700,2708,2717,2725,2750,2779,2792,2810,2832,2841,2865,2914,2922,2946,2954,2962,2971,2979,3014,3033,3067,3101,3119,3127,3135,3144,3153,3194,3276,3351,3359,3395,3428,3437,3445,3516,3545,3553,3561,3620,3642,3671,3679,3687,3695,3704,3718,3732,3763,3782,3811,3819,3827,3876,3917,3925,3933,3941,3950,3962,3989,4034,4071,4087,4123,4153,4161,4169,4178,4186,4211,4225,4233,4259,4268,4291,4343,4361,4379,4397,4415,4433,4442,4463,4513,4539,4560,4590,4598,4615,4632,4657,4674,4730,4747,4763,4779,4787,4795,4803,4853,4861,4870,4914,4937,4945,4953,4979,5005,5030,5061,5077,5091,5099,5113,5121,5134],{"type":332,"tag":585,"props":586,"children":589},"span",{"class":587,"line":588},"line",1,[590],{"type":332,"tag":585,"props":591,"children":593},{"style":592},"--shiki-default:#6A737D",[594],{"type":341,"value":595},"// Stripe → Plain.com sync. Attached to a bucket INPUT: verifies Stripe's\n",{"type":332,"tag":585,"props":597,"children":599},{"class":587,"line":598},2,[600],{"type":332,"tag":585,"props":601,"children":602},{"style":592},[603],{"type":341,"value":604},"// signature, keeps Plain customers/tenants/tiers in sync with subscription\n",{"type":332,"tag":585,"props":606,"children":608},{"class":587,"line":607},3,[609],{"type":332,"tag":585,"props":610,"children":611},{"style":592},[612],{"type":341,"value":613},"// state, and answers Stripe directly. No output destination required.\n",{"type":332,"tag":585,"props":615,"children":617},{"class":587,"line":616},4,[618],{"type":332,"tag":585,"props":619,"children":621},{"emptyLinePlaceholder":620},true,[622],{"type":341,"value":623},"\n",{"type":332,"tag":585,"props":625,"children":627},{"class":587,"line":626},5,[628],{"type":332,"tag":585,"props":629,"children":630},{"style":592},[631],{"type":341,"value":632},"// Bound on the function's Connections tab — never hard-code these:\n",{"type":332,"tag":585,"props":634,"children":636},{"class":587,"line":635},6,[637,643,649,654,660,666,672,677],{"type":332,"tag":585,"props":638,"children":640},{"style":639},"--shiki-default:#F97583",[641],{"type":341,"value":642},"const",{"type":332,"tag":585,"props":644,"children":646},{"style":645},"--shiki-default:#79B8FF",[647],{"type":341,"value":648}," stripeSigningSecret",{"type":332,"tag":585,"props":650,"children":651},{"style":639},[652],{"type":341,"value":653}," =",{"type":332,"tag":585,"props":655,"children":657},{"style":656},"--shiki-default:#B392F0",[658],{"type":341,"value":659}," require",{"type":332,"tag":585,"props":661,"children":663},{"style":662},"--shiki-default:#E1E4E8",[664],{"type":341,"value":665},"(",{"type":332,"tag":585,"props":667,"children":669},{"style":668},"--shiki-default:#9ECBFF",[670],{"type":341,"value":671},"\"secret:stripe-signing-secret\"",{"type":332,"tag":585,"props":673,"children":674},{"style":662},[675],{"type":341,"value":676},") ",{"type":332,"tag":585,"props":678,"children":679},{"style":592},[680],{"type":341,"value":681},"// whsec_...\n",{"type":332,"tag":585,"props":683,"children":685},{"class":587,"line":684},7,[686,690,695,699,703,707,712,717],{"type":332,"tag":585,"props":687,"children":688},{"style":639},[689],{"type":341,"value":642},{"type":332,"tag":585,"props":691,"children":692},{"style":645},[693],{"type":341,"value":694}," stripeApiKey",{"type":332,"tag":585,"props":696,"children":697},{"style":639},[698],{"type":341,"value":653},{"type":332,"tag":585,"props":700,"children":701},{"style":656},[702],{"type":341,"value":659},{"type":332,"tag":585,"props":704,"children":705},{"style":662},[706],{"type":341,"value":665},{"type":332,"tag":585,"props":708,"children":709},{"style":668},[710],{"type":341,"value":711},"\"secret:stripe-api-key\"",{"type":332,"tag":585,"props":713,"children":714},{"style":662},[715],{"type":341,"value":716},")               ",{"type":332,"tag":585,"props":718,"children":719},{"style":592},[720],{"type":341,"value":721},"// sk_...\n",{"type":332,"tag":585,"props":723,"children":725},{"class":587,"line":724},8,[726,730,735,739,743,747,752,757],{"type":332,"tag":585,"props":727,"children":728},{"style":639},[729],{"type":341,"value":642},{"type":332,"tag":585,"props":731,"children":732},{"style":645},[733],{"type":341,"value":734}," plainApiKey",{"type":332,"tag":585,"props":736,"children":737},{"style":639},[738],{"type":341,"value":653},{"type":332,"tag":585,"props":740,"children":741},{"style":656},[742],{"type":341,"value":659},{"type":332,"tag":585,"props":744,"children":745},{"style":662},[746],{"type":341,"value":665},{"type":332,"tag":585,"props":748,"children":749},{"style":668},[750],{"type":341,"value":751},"\"secret:plain-api-key\"",{"type":332,"tag":585,"props":753,"children":754},{"style":662},[755],{"type":341,"value":756},")                 ",{"type":332,"tag":585,"props":758,"children":759},{"style":592},[760],{"type":341,"value":761},"// plainApiKey_...\n",{"type":332,"tag":585,"props":763,"children":765},{"class":587,"line":764},9,[766],{"type":332,"tag":585,"props":767,"children":768},{"emptyLinePlaceholder":620},[769],{"type":341,"value":623},{"type":332,"tag":585,"props":771,"children":773},{"class":587,"line":772},10,[774],{"type":332,"tag":585,"props":775,"children":776},{"style":592},[777],{"type":341,"value":778},"// Non-secret settings (function config, not secrets):\n",{"type":332,"tag":585,"props":780,"children":782},{"class":587,"line":781},11,[783],{"type":332,"tag":585,"props":784,"children":785},{"style":592},[786],{"type":341,"value":787},"//   PLAIN_PAID_TIER_ID – Plain tenant tier id that marks a tenant as paid\n",{"type":332,"tag":585,"props":789,"children":791},{"class":587,"line":790},12,[792],{"type":332,"tag":585,"props":793,"children":794},{"style":592},[795],{"type":341,"value":796},"//                        (Plain → Settings → Tenants → Tiers)\n",{"type":332,"tag":585,"props":798,"children":800},{"class":587,"line":799},13,[801],{"type":332,"tag":585,"props":802,"children":803},{"style":592},[804],{"type":341,"value":805},"//   DRY_RUN            – unset or \"true\" = log only, \"false\" = write to Plain\n",{"type":332,"tag":585,"props":807,"children":809},{"class":587,"line":808},14,[810,814,819,823],{"type":332,"tag":585,"props":811,"children":812},{"style":639},[813],{"type":341,"value":642},{"type":332,"tag":585,"props":815,"children":816},{"style":645},[817],{"type":341,"value":818}," PLAIN_API",{"type":332,"tag":585,"props":820,"children":821},{"style":639},[822],{"type":341,"value":653},{"type":332,"tag":585,"props":824,"children":825},{"style":668},[826],{"type":341,"value":827}," \"https://core-api.uk.plain.com/graphql/v1\"\n",{"type":332,"tag":585,"props":829,"children":831},{"class":587,"line":830},15,[832,836,841,845],{"type":332,"tag":585,"props":833,"children":834},{"style":639},[835],{"type":341,"value":642},{"type":332,"tag":585,"props":837,"children":838},{"style":645},[839],{"type":341,"value":840}," SIGNATURE_TOLERANCE_S",{"type":332,"tag":585,"props":842,"children":843},{"style":639},[844],{"type":341,"value":653},{"type":332,"tag":585,"props":846,"children":847},{"style":645},[848],{"type":341,"value":849}," 300\n",{"type":332,"tag":585,"props":851,"children":853},{"class":587,"line":852},16,[854],{"type":332,"tag":585,"props":855,"children":856},{"emptyLinePlaceholder":620},[857],{"type":341,"value":623},{"type":332,"tag":585,"props":859,"children":861},{"class":587,"line":860},17,[862,866,871,875,880,885,890,895,899,904],{"type":332,"tag":585,"props":863,"children":864},{"style":639},[865],{"type":341,"value":642},{"type":332,"tag":585,"props":867,"children":868},{"style":645},[869],{"type":341,"value":870}," PAID_STATUSES",{"type":332,"tag":585,"props":872,"children":873},{"style":639},[874],{"type":341,"value":653},{"type":332,"tag":585,"props":876,"children":877},{"style":662},[878],{"type":341,"value":879}," [",{"type":332,"tag":585,"props":881,"children":882},{"style":668},[883],{"type":341,"value":884},"\"active\"",{"type":332,"tag":585,"props":886,"children":887},{"style":662},[888],{"type":341,"value":889},", ",{"type":332,"tag":585,"props":891,"children":892},{"style":668},[893],{"type":341,"value":894},"\"trialing\"",{"type":332,"tag":585,"props":896,"children":897},{"style":662},[898],{"type":341,"value":889},{"type":332,"tag":585,"props":900,"children":901},{"style":668},[902],{"type":341,"value":903},"\"past_due\"",{"type":332,"tag":585,"props":905,"children":906},{"style":662},[907],{"type":341,"value":908},"]\n",{"type":332,"tag":585,"props":910,"children":912},{"class":587,"line":911},18,[913,917,922,926],{"type":332,"tag":585,"props":914,"children":915},{"style":639},[916],{"type":341,"value":642},{"type":332,"tag":585,"props":918,"children":919},{"style":645},[920],{"type":341,"value":921}," HANDLED_EVENTS",{"type":332,"tag":585,"props":923,"children":924},{"style":639},[925],{"type":341,"value":653},{"type":332,"tag":585,"props":927,"children":928},{"style":662},[929],{"type":341,"value":930}," [\n",{"type":332,"tag":585,"props":932,"children":934},{"class":587,"line":933},19,[935,940],{"type":332,"tag":585,"props":936,"children":937},{"style":668},[938],{"type":341,"value":939},"  \"customer.subscription.created\"",{"type":332,"tag":585,"props":941,"children":942},{"style":662},[943],{"type":341,"value":944},",\n",{"type":332,"tag":585,"props":946,"children":948},{"class":587,"line":947},20,[949,954],{"type":332,"tag":585,"props":950,"children":951},{"style":668},[952],{"type":341,"value":953},"  \"customer.subscription.updated\"",{"type":332,"tag":585,"props":955,"children":956},{"style":662},[957],{"type":341,"value":944},{"type":332,"tag":585,"props":959,"children":961},{"class":587,"line":960},21,[962,967],{"type":332,"tag":585,"props":963,"children":964},{"style":668},[965],{"type":341,"value":966},"  \"customer.subscription.deleted\"",{"type":332,"tag":585,"props":968,"children":969},{"style":662},[970],{"type":341,"value":944},{"type":332,"tag":585,"props":972,"children":974},{"class":587,"line":973},22,[975],{"type":332,"tag":585,"props":976,"children":977},{"style":668},[978],{"type":341,"value":979},"  \"customer.created\"\n",{"type":332,"tag":585,"props":981,"children":983},{"class":587,"line":982},23,[984],{"type":332,"tag":585,"props":985,"children":986},{"style":662},[987],{"type":341,"value":908},{"type":332,"tag":585,"props":989,"children":991},{"class":587,"line":990},24,[992],{"type":332,"tag":585,"props":993,"children":994},{"emptyLinePlaceholder":620},[995],{"type":341,"value":623},{"type":332,"tag":585,"props":997,"children":999},{"class":587,"line":998},25,[1000],{"type":332,"tag":585,"props":1001,"children":1002},{"style":592},[1003],{"type":341,"value":1004},"// ---------- Plain GraphQL ----------\n",{"type":332,"tag":585,"props":1006,"children":1008},{"class":587,"line":1007},26,[1009],{"type":332,"tag":585,"props":1010,"children":1011},{"emptyLinePlaceholder":620},[1012],{"type":341,"value":623},{"type":332,"tag":585,"props":1014,"children":1016},{"class":587,"line":1015},27,[1017,1021,1026,1030],{"type":332,"tag":585,"props":1018,"children":1019},{"style":639},[1020],{"type":341,"value":642},{"type":332,"tag":585,"props":1022,"children":1023},{"style":645},[1024],{"type":341,"value":1025}," UPSERT_CUSTOMER",{"type":332,"tag":585,"props":1027,"children":1028},{"style":639},[1029],{"type":341,"value":653},{"type":332,"tag":585,"props":1031,"children":1032},{"style":668},[1033],{"type":341,"value":1034}," `\n",{"type":332,"tag":585,"props":1036,"children":1038},{"class":587,"line":1037},28,[1039],{"type":332,"tag":585,"props":1040,"children":1041},{"style":668},[1042],{"type":341,"value":1043},"  mutation UpsertCustomer($input: UpsertCustomerInput!) {\n",{"type":332,"tag":585,"props":1045,"children":1047},{"class":587,"line":1046},29,[1048],{"type":332,"tag":585,"props":1049,"children":1050},{"style":668},[1051],{"type":341,"value":1052},"    upsertCustomer(input: $input) {\n",{"type":332,"tag":585,"props":1054,"children":1056},{"class":587,"line":1055},30,[1057],{"type":332,"tag":585,"props":1058,"children":1059},{"style":668},[1060],{"type":341,"value":1061},"      customer { id email { email } }\n",{"type":332,"tag":585,"props":1063,"children":1065},{"class":587,"line":1064},31,[1066],{"type":332,"tag":585,"props":1067,"children":1068},{"style":668},[1069],{"type":341,"value":1070},"      error { message code }\n",{"type":332,"tag":585,"props":1072,"children":1074},{"class":587,"line":1073},32,[1075],{"type":332,"tag":585,"props":1076,"children":1077},{"style":668},[1078],{"type":341,"value":1079},"    }\n",{"type":332,"tag":585,"props":1081,"children":1083},{"class":587,"line":1082},33,[1084],{"type":332,"tag":585,"props":1085,"children":1086},{"style":668},[1087],{"type":341,"value":1088},"  }`\n",{"type":332,"tag":585,"props":1090,"children":1092},{"class":587,"line":1091},34,[1093],{"type":332,"tag":585,"props":1094,"children":1095},{"emptyLinePlaceholder":620},[1096],{"type":341,"value":623},{"type":332,"tag":585,"props":1098,"children":1100},{"class":587,"line":1099},35,[1101,1105,1110,1114],{"type":332,"tag":585,"props":1102,"children":1103},{"style":639},[1104],{"type":341,"value":642},{"type":332,"tag":585,"props":1106,"children":1107},{"style":645},[1108],{"type":341,"value":1109}," UPSERT_TENANT",{"type":332,"tag":585,"props":1111,"children":1112},{"style":639},[1113],{"type":341,"value":653},{"type":332,"tag":585,"props":1115,"children":1116},{"style":668},[1117],{"type":341,"value":1034},{"type":332,"tag":585,"props":1119,"children":1121},{"class":587,"line":1120},36,[1122],{"type":332,"tag":585,"props":1123,"children":1124},{"style":668},[1125],{"type":341,"value":1126},"  mutation UpsertTenant($input: UpsertTenantInput!) {\n",{"type":332,"tag":585,"props":1128,"children":1130},{"class":587,"line":1129},37,[1131],{"type":332,"tag":585,"props":1132,"children":1133},{"style":668},[1134],{"type":341,"value":1135},"    upsertTenant(input: $input) {\n",{"type":332,"tag":585,"props":1137,"children":1139},{"class":587,"line":1138},38,[1140],{"type":332,"tag":585,"props":1141,"children":1142},{"style":668},[1143],{"type":341,"value":1144},"      tenant { id name externalId }\n",{"type":332,"tag":585,"props":1146,"children":1148},{"class":587,"line":1147},39,[1149],{"type":332,"tag":585,"props":1150,"children":1151},{"style":668},[1152],{"type":341,"value":1070},{"type":332,"tag":585,"props":1154,"children":1156},{"class":587,"line":1155},40,[1157],{"type":332,"tag":585,"props":1158,"children":1159},{"style":668},[1160],{"type":341,"value":1079},{"type":332,"tag":585,"props":1162,"children":1164},{"class":587,"line":1163},41,[1165],{"type":332,"tag":585,"props":1166,"children":1167},{"style":668},[1168],{"type":341,"value":1088},{"type":332,"tag":585,"props":1170,"children":1172},{"class":587,"line":1171},42,[1173],{"type":332,"tag":585,"props":1174,"children":1175},{"emptyLinePlaceholder":620},[1176],{"type":341,"value":623},{"type":332,"tag":585,"props":1178,"children":1180},{"class":587,"line":1179},43,[1181,1185,1190,1194],{"type":332,"tag":585,"props":1182,"children":1183},{"style":639},[1184],{"type":341,"value":642},{"type":332,"tag":585,"props":1186,"children":1187},{"style":645},[1188],{"type":341,"value":1189}," UPDATE_TENANT_TIER",{"type":332,"tag":585,"props":1191,"children":1192},{"style":639},[1193],{"type":341,"value":653},{"type":332,"tag":585,"props":1195,"children":1196},{"style":668},[1197],{"type":341,"value":1034},{"type":332,"tag":585,"props":1199,"children":1201},{"class":587,"line":1200},44,[1202],{"type":332,"tag":585,"props":1203,"children":1204},{"style":668},[1205],{"type":341,"value":1206},"  mutation UpdateTenantTier($input: UpdateTenantTierInput!) {\n",{"type":332,"tag":585,"props":1208,"children":1210},{"class":587,"line":1209},45,[1211],{"type":332,"tag":585,"props":1212,"children":1213},{"style":668},[1214],{"type":341,"value":1215},"    updateTenantTier(input: $input) {\n",{"type":332,"tag":585,"props":1217,"children":1219},{"class":587,"line":1218},46,[1220],{"type":332,"tag":585,"props":1221,"children":1222},{"style":668},[1223],{"type":341,"value":1070},{"type":332,"tag":585,"props":1225,"children":1227},{"class":587,"line":1226},47,[1228],{"type":332,"tag":585,"props":1229,"children":1230},{"style":668},[1231],{"type":341,"value":1079},{"type":332,"tag":585,"props":1233,"children":1235},{"class":587,"line":1234},48,[1236],{"type":332,"tag":585,"props":1237,"children":1238},{"style":668},[1239],{"type":341,"value":1088},{"type":332,"tag":585,"props":1241,"children":1243},{"class":587,"line":1242},49,[1244],{"type":332,"tag":585,"props":1245,"children":1246},{"emptyLinePlaceholder":620},[1247],{"type":341,"value":623},{"type":332,"tag":585,"props":1249,"children":1251},{"class":587,"line":1250},50,[1252,1256,1261,1265],{"type":332,"tag":585,"props":1253,"children":1254},{"style":639},[1255],{"type":341,"value":642},{"type":332,"tag":585,"props":1257,"children":1258},{"style":645},[1259],{"type":341,"value":1260}," ADD_CUSTOMER_TO_TENANTS",{"type":332,"tag":585,"props":1262,"children":1263},{"style":639},[1264],{"type":341,"value":653},{"type":332,"tag":585,"props":1266,"children":1267},{"style":668},[1268],{"type":341,"value":1034},{"type":332,"tag":585,"props":1270,"children":1272},{"class":587,"line":1271},51,[1273],{"type":332,"tag":585,"props":1274,"children":1275},{"style":668},[1276],{"type":341,"value":1277},"  mutation AddCustomerToTenants($input: AddCustomerToTenantsInput!) {\n",{"type":332,"tag":585,"props":1279,"children":1281},{"class":587,"line":1280},52,[1282],{"type":332,"tag":585,"props":1283,"children":1284},{"style":668},[1285],{"type":341,"value":1286},"    addCustomerToTenants(input: $input) {\n",{"type":332,"tag":585,"props":1288,"children":1290},{"class":587,"line":1289},53,[1291],{"type":332,"tag":585,"props":1292,"children":1293},{"style":668},[1294],{"type":341,"value":1295},"      customer { id }\n",{"type":332,"tag":585,"props":1297,"children":1299},{"class":587,"line":1298},54,[1300],{"type":332,"tag":585,"props":1301,"children":1302},{"style":668},[1303],{"type":341,"value":1070},{"type":332,"tag":585,"props":1305,"children":1307},{"class":587,"line":1306},55,[1308],{"type":332,"tag":585,"props":1309,"children":1310},{"style":668},[1311],{"type":341,"value":1079},{"type":332,"tag":585,"props":1313,"children":1315},{"class":587,"line":1314},56,[1316],{"type":332,"tag":585,"props":1317,"children":1318},{"style":668},[1319],{"type":341,"value":1088},{"type":332,"tag":585,"props":1321,"children":1323},{"class":587,"line":1322},57,[1324],{"type":332,"tag":585,"props":1325,"children":1326},{"emptyLinePlaceholder":620},[1327],{"type":341,"value":623},{"type":332,"tag":585,"props":1329,"children":1331},{"class":587,"line":1330},58,[1332,1337,1342,1346,1352,1356,1361],{"type":332,"tag":585,"props":1333,"children":1334},{"style":639},[1335],{"type":341,"value":1336},"function",{"type":332,"tag":585,"props":1338,"children":1339},{"style":656},[1340],{"type":341,"value":1341}," plain",{"type":332,"tag":585,"props":1343,"children":1344},{"style":662},[1345],{"type":341,"value":665},{"type":332,"tag":585,"props":1347,"children":1349},{"style":1348},"--shiki-default:#FFAB70",[1350],{"type":341,"value":1351},"query",{"type":332,"tag":585,"props":1353,"children":1354},{"style":662},[1355],{"type":341,"value":889},{"type":332,"tag":585,"props":1357,"children":1358},{"style":1348},[1359],{"type":341,"value":1360},"variables",{"type":332,"tag":585,"props":1362,"children":1363},{"style":662},[1364],{"type":341,"value":1365},") {\n",{"type":332,"tag":585,"props":1367,"children":1369},{"class":587,"line":1368},59,[1370,1375,1380,1384,1389,1394,1398,1403,1407,1412],{"type":332,"tag":585,"props":1371,"children":1372},{"style":639},[1373],{"type":341,"value":1374},"  const",{"type":332,"tag":585,"props":1376,"children":1377},{"style":645},[1378],{"type":341,"value":1379}," resp",{"type":332,"tag":585,"props":1381,"children":1382},{"style":639},[1383],{"type":341,"value":653},{"type":332,"tag":585,"props":1385,"children":1386},{"style":662},[1387],{"type":341,"value":1388}," http.",{"type":332,"tag":585,"props":1390,"children":1391},{"style":656},[1392],{"type":341,"value":1393},"request",{"type":332,"tag":585,"props":1395,"children":1396},{"style":662},[1397],{"type":341,"value":665},{"type":332,"tag":585,"props":1399,"children":1400},{"style":668},[1401],{"type":341,"value":1402},"\"POST\"",{"type":332,"tag":585,"props":1404,"children":1405},{"style":662},[1406],{"type":341,"value":889},{"type":332,"tag":585,"props":1408,"children":1409},{"style":645},[1410],{"type":341,"value":1411},"PLAIN_API",{"type":332,"tag":585,"props":1413,"children":1414},{"style":662},[1415],{"type":341,"value":1416},", {\n",{"type":332,"tag":585,"props":1418,"children":1420},{"class":587,"line":1419},60,[1421],{"type":332,"tag":585,"props":1422,"children":1423},{"style":662},[1424],{"type":341,"value":1425},"    headers: {\n",{"type":332,"tag":585,"props":1427,"children":1429},{"class":587,"line":1428},61,[1430,1435,1440,1445],{"type":332,"tag":585,"props":1431,"children":1432},{"style":668},[1433],{"type":341,"value":1434},"      \"Content-Type\"",{"type":332,"tag":585,"props":1436,"children":1437},{"style":662},[1438],{"type":341,"value":1439},": ",{"type":332,"tag":585,"props":1441,"children":1442},{"style":668},[1443],{"type":341,"value":1444},"\"application/json\"",{"type":332,"tag":585,"props":1446,"children":1447},{"style":662},[1448],{"type":341,"value":944},{"type":332,"tag":585,"props":1450,"children":1452},{"class":587,"line":1451},62,[1453,1458,1463,1468],{"type":332,"tag":585,"props":1454,"children":1455},{"style":662},[1456],{"type":341,"value":1457},"      Authorization: ",{"type":332,"tag":585,"props":1459,"children":1460},{"style":668},[1461],{"type":341,"value":1462},"\"Bearer \"",{"type":332,"tag":585,"props":1464,"children":1465},{"style":639},[1466],{"type":341,"value":1467}," +",{"type":332,"tag":585,"props":1469,"children":1470},{"style":662},[1471],{"type":341,"value":1472}," plainApiKey\n",{"type":332,"tag":585,"props":1474,"children":1476},{"class":587,"line":1475},63,[1477],{"type":332,"tag":585,"props":1478,"children":1479},{"style":662},[1480],{"type":341,"value":1481},"    },\n",{"type":332,"tag":585,"props":1483,"children":1485},{"class":587,"line":1484},64,[1486,1491,1496,1500,1505],{"type":332,"tag":585,"props":1487,"children":1488},{"style":662},[1489],{"type":341,"value":1490},"    body: ",{"type":332,"tag":585,"props":1492,"children":1493},{"style":645},[1494],{"type":341,"value":1495},"JSON",{"type":332,"tag":585,"props":1497,"children":1498},{"style":662},[1499],{"type":341,"value":523},{"type":332,"tag":585,"props":1501,"children":1502},{"style":656},[1503],{"type":341,"value":1504},"stringify",{"type":332,"tag":585,"props":1506,"children":1507},{"style":662},[1508],{"type":341,"value":1509},"({ query: query, variables: variables })\n",{"type":332,"tag":585,"props":1511,"children":1513},{"class":587,"line":1512},65,[1514],{"type":332,"tag":585,"props":1515,"children":1516},{"style":662},[1517],{"type":341,"value":1518},"  })\n",{"type":332,"tag":585,"props":1520,"children":1522},{"class":587,"line":1521},66,[1523,1528,1533,1538,1543],{"type":332,"tag":585,"props":1524,"children":1525},{"style":639},[1526],{"type":341,"value":1527},"  if",{"type":332,"tag":585,"props":1529,"children":1530},{"style":662},[1531],{"type":341,"value":1532}," (resp.status_code ",{"type":332,"tag":585,"props":1534,"children":1535},{"style":639},[1536],{"type":341,"value":1537},"!==",{"type":332,"tag":585,"props":1539,"children":1540},{"style":645},[1541],{"type":341,"value":1542}," 200",{"type":332,"tag":585,"props":1544,"children":1545},{"style":662},[1546],{"type":341,"value":1365},{"type":332,"tag":585,"props":1548,"children":1550},{"class":587,"line":1549},67,[1551,1556,1561,1566,1570,1575,1579,1584,1589,1594,1598],{"type":332,"tag":585,"props":1552,"children":1553},{"style":639},[1554],{"type":341,"value":1555},"    throw",{"type":332,"tag":585,"props":1557,"children":1558},{"style":639},[1559],{"type":341,"value":1560}," new",{"type":332,"tag":585,"props":1562,"children":1563},{"style":656},[1564],{"type":341,"value":1565}," Error",{"type":332,"tag":585,"props":1567,"children":1568},{"style":662},[1569],{"type":341,"value":665},{"type":332,"tag":585,"props":1571,"children":1572},{"style":668},[1573],{"type":341,"value":1574},"\"Plain HTTP \"",{"type":332,"tag":585,"props":1576,"children":1577},{"style":639},[1578],{"type":341,"value":1467},{"type":332,"tag":585,"props":1580,"children":1581},{"style":662},[1582],{"type":341,"value":1583}," resp.status_code ",{"type":332,"tag":585,"props":1585,"children":1586},{"style":639},[1587],{"type":341,"value":1588},"+",{"type":332,"tag":585,"props":1590,"children":1591},{"style":668},[1592],{"type":341,"value":1593}," \": \"",{"type":332,"tag":585,"props":1595,"children":1596},{"style":639},[1597],{"type":341,"value":1467},{"type":332,"tag":585,"props":1599,"children":1600},{"style":662},[1601],{"type":341,"value":1602}," resp.body)\n",{"type":332,"tag":585,"props":1604,"children":1606},{"class":587,"line":1605},68,[1607],{"type":332,"tag":585,"props":1608,"children":1609},{"style":662},[1610],{"type":341,"value":1611},"  }\n",{"type":332,"tag":585,"props":1613,"children":1615},{"class":587,"line":1614},69,[1616,1620,1625,1629,1634,1638,1643],{"type":332,"tag":585,"props":1617,"children":1618},{"style":639},[1619],{"type":341,"value":1374},{"type":332,"tag":585,"props":1621,"children":1622},{"style":645},[1623],{"type":341,"value":1624}," body",{"type":332,"tag":585,"props":1626,"children":1627},{"style":639},[1628],{"type":341,"value":653},{"type":332,"tag":585,"props":1630,"children":1631},{"style":645},[1632],{"type":341,"value":1633}," JSON",{"type":332,"tag":585,"props":1635,"children":1636},{"style":662},[1637],{"type":341,"value":523},{"type":332,"tag":585,"props":1639,"children":1640},{"style":656},[1641],{"type":341,"value":1642},"parse",{"type":332,"tag":585,"props":1644,"children":1645},{"style":662},[1646],{"type":341,"value":1647},"(resp.body)\n",{"type":332,"tag":585,"props":1649,"children":1651},{"class":587,"line":1650},70,[1652,1656,1661,1666,1671,1676,1681,1686],{"type":332,"tag":585,"props":1653,"children":1654},{"style":639},[1655],{"type":341,"value":1527},{"type":332,"tag":585,"props":1657,"children":1658},{"style":662},[1659],{"type":341,"value":1660}," (body.errors ",{"type":332,"tag":585,"props":1662,"children":1663},{"style":639},[1664],{"type":341,"value":1665},"&&",{"type":332,"tag":585,"props":1667,"children":1668},{"style":662},[1669],{"type":341,"value":1670}," body.errors.",{"type":332,"tag":585,"props":1672,"children":1673},{"style":645},[1674],{"type":341,"value":1675},"length",{"type":332,"tag":585,"props":1677,"children":1678},{"style":639},[1679],{"type":341,"value":1680}," >",{"type":332,"tag":585,"props":1682,"children":1683},{"style":645},[1684],{"type":341,"value":1685}," 0",{"type":332,"tag":585,"props":1687,"children":1688},{"style":662},[1689],{"type":341,"value":1365},{"type":332,"tag":585,"props":1691,"children":1693},{"class":587,"line":1692},71,[1694,1698,1702,1706,1710,1715,1719,1723,1728,1732,1737,1742,1747,1752,1756,1761],{"type":332,"tag":585,"props":1695,"children":1696},{"style":639},[1697],{"type":341,"value":1555},{"type":332,"tag":585,"props":1699,"children":1700},{"style":639},[1701],{"type":341,"value":1560},{"type":332,"tag":585,"props":1703,"children":1704},{"style":656},[1705],{"type":341,"value":1565},{"type":332,"tag":585,"props":1707,"children":1708},{"style":662},[1709],{"type":341,"value":665},{"type":332,"tag":585,"props":1711,"children":1712},{"style":668},[1713],{"type":341,"value":1714},"\"Plain GraphQL: \"",{"type":332,"tag":585,"props":1716,"children":1717},{"style":639},[1718],{"type":341,"value":1467},{"type":332,"tag":585,"props":1720,"children":1721},{"style":662},[1722],{"type":341,"value":1670},{"type":332,"tag":585,"props":1724,"children":1725},{"style":656},[1726],{"type":341,"value":1727},"map",{"type":332,"tag":585,"props":1729,"children":1730},{"style":662},[1731],{"type":341,"value":665},{"type":332,"tag":585,"props":1733,"children":1734},{"style":1348},[1735],{"type":341,"value":1736},"e",{"type":332,"tag":585,"props":1738,"children":1739},{"style":639},[1740],{"type":341,"value":1741}," =>",{"type":332,"tag":585,"props":1743,"children":1744},{"style":662},[1745],{"type":341,"value":1746}," e.message).",{"type":332,"tag":585,"props":1748,"children":1749},{"style":656},[1750],{"type":341,"value":1751},"join",{"type":332,"tag":585,"props":1753,"children":1754},{"style":662},[1755],{"type":341,"value":665},{"type":332,"tag":585,"props":1757,"children":1758},{"style":668},[1759],{"type":341,"value":1760},"\"; \"",{"type":332,"tag":585,"props":1762,"children":1763},{"style":662},[1764],{"type":341,"value":1765},"))\n",{"type":332,"tag":585,"props":1767,"children":1769},{"class":587,"line":1768},72,[1770],{"type":332,"tag":585,"props":1771,"children":1772},{"style":662},[1773],{"type":341,"value":1611},{"type":332,"tag":585,"props":1775,"children":1777},{"class":587,"line":1776},73,[1778,1782,1787,1792,1797,1802,1806,1810,1814,1819],{"type":332,"tag":585,"props":1779,"children":1780},{"style":639},[1781],{"type":341,"value":1527},{"type":332,"tag":585,"props":1783,"children":1784},{"style":662},[1785],{"type":341,"value":1786}," (",{"type":332,"tag":585,"props":1788,"children":1789},{"style":639},[1790],{"type":341,"value":1791},"!",{"type":332,"tag":585,"props":1793,"children":1794},{"style":662},[1795],{"type":341,"value":1796},"body.data) ",{"type":332,"tag":585,"props":1798,"children":1799},{"style":639},[1800],{"type":341,"value":1801},"throw",{"type":332,"tag":585,"props":1803,"children":1804},{"style":639},[1805],{"type":341,"value":1560},{"type":332,"tag":585,"props":1807,"children":1808},{"style":656},[1809],{"type":341,"value":1565},{"type":332,"tag":585,"props":1811,"children":1812},{"style":662},[1813],{"type":341,"value":665},{"type":332,"tag":585,"props":1815,"children":1816},{"style":668},[1817],{"type":341,"value":1818},"\"Plain returned empty data\"",{"type":332,"tag":585,"props":1820,"children":1821},{"style":662},[1822],{"type":341,"value":1823},")\n",{"type":332,"tag":585,"props":1825,"children":1827},{"class":587,"line":1826},74,[1828,1833],{"type":332,"tag":585,"props":1829,"children":1830},{"style":639},[1831],{"type":341,"value":1832},"  return",{"type":332,"tag":585,"props":1834,"children":1835},{"style":662},[1836],{"type":341,"value":1837}," body.data\n",{"type":332,"tag":585,"props":1839,"children":1841},{"class":587,"line":1840},75,[1842],{"type":332,"tag":585,"props":1843,"children":1844},{"style":662},[1845],{"type":341,"value":1846},"}\n",{"type":332,"tag":585,"props":1848,"children":1850},{"class":587,"line":1849},76,[1851],{"type":332,"tag":585,"props":1852,"children":1853},{"emptyLinePlaceholder":620},[1854],{"type":341,"value":623},{"type":332,"tag":585,"props":1856,"children":1858},{"class":587,"line":1857},77,[1859,1863,1868,1872,1877,1881,1886,1890,1895],{"type":332,"tag":585,"props":1860,"children":1861},{"style":639},[1862],{"type":341,"value":1336},{"type":332,"tag":585,"props":1864,"children":1865},{"style":656},[1866],{"type":341,"value":1867}," upsertPlainCustomer",{"type":332,"tag":585,"props":1869,"children":1870},{"style":662},[1871],{"type":341,"value":665},{"type":332,"tag":585,"props":1873,"children":1874},{"style":1348},[1875],{"type":341,"value":1876},"email",{"type":332,"tag":585,"props":1878,"children":1879},{"style":662},[1880],{"type":341,"value":889},{"type":332,"tag":585,"props":1882,"children":1883},{"style":1348},[1884],{"type":341,"value":1885},"fullName",{"type":332,"tag":585,"props":1887,"children":1888},{"style":662},[1889],{"type":341,"value":889},{"type":332,"tag":585,"props":1891,"children":1892},{"style":1348},[1893],{"type":341,"value":1894},"stripeCustomerId",{"type":332,"tag":585,"props":1896,"children":1897},{"style":662},[1898],{"type":341,"value":1365},{"type":332,"tag":585,"props":1900,"children":1902},{"class":587,"line":1901},78,[1903,1907,1912,1916,1920,1924,1929],{"type":332,"tag":585,"props":1904,"children":1905},{"style":639},[1906],{"type":341,"value":1374},{"type":332,"tag":585,"props":1908,"children":1909},{"style":645},[1910],{"type":341,"value":1911}," data",{"type":332,"tag":585,"props":1913,"children":1914},{"style":639},[1915],{"type":341,"value":653},{"type":332,"tag":585,"props":1917,"children":1918},{"style":656},[1919],{"type":341,"value":1341},{"type":332,"tag":585,"props":1921,"children":1922},{"style":662},[1923],{"type":341,"value":665},{"type":332,"tag":585,"props":1925,"children":1926},{"style":645},[1927],{"type":341,"value":1928},"UPSERT_CUSTOMER",{"type":332,"tag":585,"props":1930,"children":1931},{"style":662},[1932],{"type":341,"value":1416},{"type":332,"tag":585,"props":1934,"children":1936},{"class":587,"line":1935},79,[1937],{"type":332,"tag":585,"props":1938,"children":1939},{"style":662},[1940],{"type":341,"value":1941},"    input: {\n",{"type":332,"tag":585,"props":1943,"children":1945},{"class":587,"line":1944},80,[1946],{"type":332,"tag":585,"props":1947,"children":1948},{"style":662},[1949],{"type":341,"value":1950},"      identifier: { emailAddress: email },\n",{"type":332,"tag":585,"props":1952,"children":1954},{"class":587,"line":1953},81,[1955],{"type":332,"tag":585,"props":1956,"children":1957},{"style":662},[1958],{"type":341,"value":1959},"      onCreate: {\n",{"type":332,"tag":585,"props":1961,"children":1963},{"class":587,"line":1962},82,[1964,1969,1974],{"type":332,"tag":585,"props":1965,"children":1966},{"style":662},[1967],{"type":341,"value":1968},"        fullName: fullName ",{"type":332,"tag":585,"props":1970,"children":1971},{"style":639},[1972],{"type":341,"value":1973},"||",{"type":332,"tag":585,"props":1975,"children":1976},{"style":662},[1977],{"type":341,"value":1978}," email,\n",{"type":332,"tag":585,"props":1980,"children":1982},{"class":587,"line":1981},83,[1983,1988,1993],{"type":332,"tag":585,"props":1984,"children":1985},{"style":662},[1986],{"type":341,"value":1987},"        email: { email: email, isVerified: ",{"type":332,"tag":585,"props":1989,"children":1990},{"style":645},[1991],{"type":341,"value":1992},"false",{"type":332,"tag":585,"props":1994,"children":1995},{"style":662},[1996],{"type":341,"value":1997}," },\n",{"type":332,"tag":585,"props":1999,"children":2001},{"class":587,"line":2000},84,[2002],{"type":332,"tag":585,"props":2003,"children":2004},{"style":662},[2005],{"type":341,"value":2006},"        externalId: stripeCustomerId\n",{"type":332,"tag":585,"props":2008,"children":2010},{"class":587,"line":2009},85,[2011],{"type":332,"tag":585,"props":2012,"children":2013},{"style":662},[2014],{"type":341,"value":2015},"      },\n",{"type":332,"tag":585,"props":2017,"children":2019},{"class":587,"line":2018},86,[2020],{"type":332,"tag":585,"props":2021,"children":2022},{"style":662},[2023],{"type":341,"value":2024},"      onUpdate: {}\n",{"type":332,"tag":585,"props":2026,"children":2028},{"class":587,"line":2027},87,[2029],{"type":332,"tag":585,"props":2030,"children":2031},{"style":662},[2032],{"type":341,"value":1079},{"type":332,"tag":585,"props":2034,"children":2036},{"class":587,"line":2035},88,[2037],{"type":332,"tag":585,"props":2038,"children":2039},{"style":662},[2040],{"type":341,"value":1518},{"type":332,"tag":585,"props":2042,"children":2044},{"class":587,"line":2043},89,[2045,2049],{"type":332,"tag":585,"props":2046,"children":2047},{"style":639},[2048],{"type":341,"value":1527},{"type":332,"tag":585,"props":2050,"children":2051},{"style":662},[2052],{"type":341,"value":2053}," (data.upsertCustomer.error) {\n",{"type":332,"tag":585,"props":2055,"children":2057},{"class":587,"line":2056},90,[2058,2062,2066,2070,2074,2079,2083],{"type":332,"tag":585,"props":2059,"children":2060},{"style":639},[2061],{"type":341,"value":1555},{"type":332,"tag":585,"props":2063,"children":2064},{"style":639},[2065],{"type":341,"value":1560},{"type":332,"tag":585,"props":2067,"children":2068},{"style":656},[2069],{"type":341,"value":1565},{"type":332,"tag":585,"props":2071,"children":2072},{"style":662},[2073],{"type":341,"value":665},{"type":332,"tag":585,"props":2075,"children":2076},{"style":668},[2077],{"type":341,"value":2078},"\"upsertCustomer: \"",{"type":332,"tag":585,"props":2080,"children":2081},{"style":639},[2082],{"type":341,"value":1467},{"type":332,"tag":585,"props":2084,"children":2085},{"style":662},[2086],{"type":341,"value":2087}," data.upsertCustomer.error.message)\n",{"type":332,"tag":585,"props":2089,"children":2091},{"class":587,"line":2090},91,[2092],{"type":332,"tag":585,"props":2093,"children":2094},{"style":662},[2095],{"type":341,"value":1611},{"type":332,"tag":585,"props":2097,"children":2099},{"class":587,"line":2098},92,[2100,2104],{"type":332,"tag":585,"props":2101,"children":2102},{"style":639},[2103],{"type":341,"value":1832},{"type":332,"tag":585,"props":2105,"children":2106},{"style":662},[2107],{"type":341,"value":2108}," data.upsertCustomer.customer.id\n",{"type":332,"tag":585,"props":2110,"children":2112},{"class":587,"line":2111},93,[2113],{"type":332,"tag":585,"props":2114,"children":2115},{"style":662},[2116],{"type":341,"value":1846},{"type":332,"tag":585,"props":2118,"children":2120},{"class":587,"line":2119},94,[2121],{"type":332,"tag":585,"props":2122,"children":2123},{"emptyLinePlaceholder":620},[2124],{"type":341,"value":623},{"type":332,"tag":585,"props":2126,"children":2128},{"class":587,"line":2127},95,[2129,2133,2138,2142,2146,2150,2155],{"type":332,"tag":585,"props":2130,"children":2131},{"style":639},[2132],{"type":341,"value":1336},{"type":332,"tag":585,"props":2134,"children":2135},{"style":656},[2136],{"type":341,"value":2137}," upsertPlainTenant",{"type":332,"tag":585,"props":2139,"children":2140},{"style":662},[2141],{"type":341,"value":665},{"type":332,"tag":585,"props":2143,"children":2144},{"style":1348},[2145],{"type":341,"value":1894},{"type":332,"tag":585,"props":2147,"children":2148},{"style":662},[2149],{"type":341,"value":889},{"type":332,"tag":585,"props":2151,"children":2152},{"style":1348},[2153],{"type":341,"value":2154},"name",{"type":332,"tag":585,"props":2156,"children":2157},{"style":662},[2158],{"type":341,"value":1365},{"type":332,"tag":585,"props":2160,"children":2162},{"class":587,"line":2161},96,[2163,2167,2171,2175,2179,2183,2188],{"type":332,"tag":585,"props":2164,"children":2165},{"style":639},[2166],{"type":341,"value":1374},{"type":332,"tag":585,"props":2168,"children":2169},{"style":645},[2170],{"type":341,"value":1911},{"type":332,"tag":585,"props":2172,"children":2173},{"style":639},[2174],{"type":341,"value":653},{"type":332,"tag":585,"props":2176,"children":2177},{"style":656},[2178],{"type":341,"value":1341},{"type":332,"tag":585,"props":2180,"children":2181},{"style":662},[2182],{"type":341,"value":665},{"type":332,"tag":585,"props":2184,"children":2185},{"style":645},[2186],{"type":341,"value":2187},"UPSERT_TENANT",{"type":332,"tag":585,"props":2189,"children":2190},{"style":662},[2191],{"type":341,"value":1416},{"type":332,"tag":585,"props":2193,"children":2195},{"class":587,"line":2194},97,[2196],{"type":332,"tag":585,"props":2197,"children":2198},{"style":662},[2199],{"type":341,"value":1941},{"type":332,"tag":585,"props":2201,"children":2203},{"class":587,"line":2202},98,[2204],{"type":332,"tag":585,"props":2205,"children":2206},{"style":662},[2207],{"type":341,"value":2208},"      identifier: { externalId: stripeCustomerId },\n",{"type":332,"tag":585,"props":2210,"children":2212},{"class":587,"line":2211},99,[2213],{"type":332,"tag":585,"props":2214,"children":2215},{"style":662},[2216],{"type":341,"value":2217},"      name: name,\n",{"type":332,"tag":585,"props":2219,"children":2221},{"class":587,"line":2220},100,[2222],{"type":332,"tag":585,"props":2223,"children":2224},{"style":662},[2225],{"type":341,"value":2226},"      externalId: stripeCustomerId\n",{"type":332,"tag":585,"props":2228,"children":2230},{"class":587,"line":2229},101,[2231],{"type":332,"tag":585,"props":2232,"children":2233},{"style":662},[2234],{"type":341,"value":1079},{"type":332,"tag":585,"props":2236,"children":2238},{"class":587,"line":2237},102,[2239],{"type":332,"tag":585,"props":2240,"children":2241},{"style":662},[2242],{"type":341,"value":1518},{"type":332,"tag":585,"props":2244,"children":2246},{"class":587,"line":2245},103,[2247,2251],{"type":332,"tag":585,"props":2248,"children":2249},{"style":639},[2250],{"type":341,"value":1527},{"type":332,"tag":585,"props":2252,"children":2253},{"style":662},[2254],{"type":341,"value":2255}," (data.upsertTenant.error) {\n",{"type":332,"tag":585,"props":2257,"children":2259},{"class":587,"line":2258},104,[2260,2264,2268,2272,2276,2281,2285],{"type":332,"tag":585,"props":2261,"children":2262},{"style":639},[2263],{"type":341,"value":1555},{"type":332,"tag":585,"props":2265,"children":2266},{"style":639},[2267],{"type":341,"value":1560},{"type":332,"tag":585,"props":2269,"children":2270},{"style":656},[2271],{"type":341,"value":1565},{"type":332,"tag":585,"props":2273,"children":2274},{"style":662},[2275],{"type":341,"value":665},{"type":332,"tag":585,"props":2277,"children":2278},{"style":668},[2279],{"type":341,"value":2280},"\"upsertTenant: \"",{"type":332,"tag":585,"props":2282,"children":2283},{"style":639},[2284],{"type":341,"value":1467},{"type":332,"tag":585,"props":2286,"children":2287},{"style":662},[2288],{"type":341,"value":2289}," data.upsertTenant.error.message)\n",{"type":332,"tag":585,"props":2291,"children":2293},{"class":587,"line":2292},105,[2294],{"type":332,"tag":585,"props":2295,"children":2296},{"style":662},[2297],{"type":341,"value":1611},{"type":332,"tag":585,"props":2299,"children":2301},{"class":587,"line":2300},106,[2302,2306],{"type":332,"tag":585,"props":2303,"children":2304},{"style":639},[2305],{"type":341,"value":1832},{"type":332,"tag":585,"props":2307,"children":2308},{"style":662},[2309],{"type":341,"value":2310}," data.upsertTenant.tenant.id\n",{"type":332,"tag":585,"props":2312,"children":2314},{"class":587,"line":2313},107,[2315],{"type":332,"tag":585,"props":2316,"children":2317},{"style":662},[2318],{"type":341,"value":1846},{"type":332,"tag":585,"props":2320,"children":2322},{"class":587,"line":2321},108,[2323],{"type":332,"tag":585,"props":2324,"children":2325},{"emptyLinePlaceholder":620},[2326],{"type":341,"value":623},{"type":332,"tag":585,"props":2328,"children":2330},{"class":587,"line":2329},109,[2331,2335,2340,2344,2349,2353,2358],{"type":332,"tag":585,"props":2332,"children":2333},{"style":639},[2334],{"type":341,"value":1336},{"type":332,"tag":585,"props":2336,"children":2337},{"style":656},[2338],{"type":341,"value":2339}," setPlainTenantTier",{"type":332,"tag":585,"props":2341,"children":2342},{"style":662},[2343],{"type":341,"value":665},{"type":332,"tag":585,"props":2345,"children":2346},{"style":1348},[2347],{"type":341,"value":2348},"tenantId",{"type":332,"tag":585,"props":2350,"children":2351},{"style":662},[2352],{"type":341,"value":889},{"type":332,"tag":585,"props":2354,"children":2355},{"style":1348},[2356],{"type":341,"value":2357},"tierId",{"type":332,"tag":585,"props":2359,"children":2360},{"style":662},[2361],{"type":341,"value":1365},{"type":332,"tag":585,"props":2363,"children":2365},{"class":587,"line":2364},110,[2366,2370,2374,2378,2383,2387,2391,2395,2399,2404],{"type":332,"tag":585,"props":2367,"children":2368},{"style":639},[2369],{"type":341,"value":1527},{"type":332,"tag":585,"props":2371,"children":2372},{"style":662},[2373],{"type":341,"value":1786},{"type":332,"tag":585,"props":2375,"children":2376},{"style":639},[2377],{"type":341,"value":1791},{"type":332,"tag":585,"props":2379,"children":2380},{"style":662},[2381],{"type":341,"value":2382},"tierId) ",{"type":332,"tag":585,"props":2384,"children":2385},{"style":639},[2386],{"type":341,"value":1801},{"type":332,"tag":585,"props":2388,"children":2389},{"style":639},[2390],{"type":341,"value":1560},{"type":332,"tag":585,"props":2392,"children":2393},{"style":656},[2394],{"type":341,"value":1565},{"type":332,"tag":585,"props":2396,"children":2397},{"style":662},[2398],{"type":341,"value":665},{"type":332,"tag":585,"props":2400,"children":2401},{"style":668},[2402],{"type":341,"value":2403},"\"PLAIN_PAID_TIER_ID is not set in function config\"",{"type":332,"tag":585,"props":2405,"children":2406},{"style":662},[2407],{"type":341,"value":1823},{"type":332,"tag":585,"props":2409,"children":2411},{"class":587,"line":2410},111,[2412,2417,2421,2426],{"type":332,"tag":585,"props":2413,"children":2414},{"style":656},[2415],{"type":341,"value":2416},"  plain",{"type":332,"tag":585,"props":2418,"children":2419},{"style":662},[2420],{"type":341,"value":665},{"type":332,"tag":585,"props":2422,"children":2423},{"style":645},[2424],{"type":341,"value":2425},"UPDATE_TENANT_TIER",{"type":332,"tag":585,"props":2427,"children":2428},{"style":662},[2429],{"type":341,"value":1416},{"type":332,"tag":585,"props":2431,"children":2433},{"class":587,"line":2432},112,[2434],{"type":332,"tag":585,"props":2435,"children":2436},{"style":662},[2437],{"type":341,"value":1941},{"type":332,"tag":585,"props":2439,"children":2441},{"class":587,"line":2440},113,[2442],{"type":332,"tag":585,"props":2443,"children":2444},{"style":662},[2445],{"type":341,"value":2446},"      tenantIdentifier: { tenantId: tenantId },\n",{"type":332,"tag":585,"props":2448,"children":2450},{"class":587,"line":2449},114,[2451],{"type":332,"tag":585,"props":2452,"children":2453},{"style":662},[2454],{"type":341,"value":2455},"      tierIdentifier: { tierId: tierId }\n",{"type":332,"tag":585,"props":2457,"children":2459},{"class":587,"line":2458},115,[2460],{"type":332,"tag":585,"props":2461,"children":2462},{"style":662},[2463],{"type":341,"value":1079},{"type":332,"tag":585,"props":2465,"children":2467},{"class":587,"line":2466},116,[2468],{"type":332,"tag":585,"props":2469,"children":2470},{"style":662},[2471],{"type":341,"value":1518},{"type":332,"tag":585,"props":2473,"children":2475},{"class":587,"line":2474},117,[2476],{"type":332,"tag":585,"props":2477,"children":2478},{"style":662},[2479],{"type":341,"value":1846},{"type":332,"tag":585,"props":2481,"children":2483},{"class":587,"line":2482},118,[2484],{"type":332,"tag":585,"props":2485,"children":2486},{"emptyLinePlaceholder":620},[2487],{"type":341,"value":623},{"type":332,"tag":585,"props":2489,"children":2491},{"class":587,"line":2490},119,[2492,2496,2501,2505,2509],{"type":332,"tag":585,"props":2493,"children":2494},{"style":639},[2495],{"type":341,"value":1336},{"type":332,"tag":585,"props":2497,"children":2498},{"style":656},[2499],{"type":341,"value":2500}," clearPlainTenantTier",{"type":332,"tag":585,"props":2502,"children":2503},{"style":662},[2504],{"type":341,"value":665},{"type":332,"tag":585,"props":2506,"children":2507},{"style":1348},[2508],{"type":341,"value":2348},{"type":332,"tag":585,"props":2510,"children":2511},{"style":662},[2512],{"type":341,"value":1365},{"type":332,"tag":585,"props":2514,"children":2516},{"class":587,"line":2515},120,[2517,2521,2525,2529],{"type":332,"tag":585,"props":2518,"children":2519},{"style":656},[2520],{"type":341,"value":2416},{"type":332,"tag":585,"props":2522,"children":2523},{"style":662},[2524],{"type":341,"value":665},{"type":332,"tag":585,"props":2526,"children":2527},{"style":645},[2528],{"type":341,"value":2425},{"type":332,"tag":585,"props":2530,"children":2531},{"style":662},[2532],{"type":341,"value":1416},{"type":332,"tag":585,"props":2534,"children":2536},{"class":587,"line":2535},121,[2537],{"type":332,"tag":585,"props":2538,"children":2539},{"style":662},[2540],{"type":341,"value":1941},{"type":332,"tag":585,"props":2542,"children":2544},{"class":587,"line":2543},122,[2545],{"type":332,"tag":585,"props":2546,"children":2547},{"style":662},[2548],{"type":341,"value":2446},{"type":332,"tag":585,"props":2550,"children":2552},{"class":587,"line":2551},123,[2553,2558],{"type":332,"tag":585,"props":2554,"children":2555},{"style":662},[2556],{"type":341,"value":2557},"      tierIdentifier: ",{"type":332,"tag":585,"props":2559,"children":2560},{"style":645},[2561],{"type":341,"value":2562},"null\n",{"type":332,"tag":585,"props":2564,"children":2566},{"class":587,"line":2565},124,[2567],{"type":332,"tag":585,"props":2568,"children":2569},{"style":662},[2570],{"type":341,"value":1079},{"type":332,"tag":585,"props":2572,"children":2574},{"class":587,"line":2573},125,[2575],{"type":332,"tag":585,"props":2576,"children":2577},{"style":662},[2578],{"type":341,"value":1518},{"type":332,"tag":585,"props":2580,"children":2582},{"class":587,"line":2581},126,[2583],{"type":332,"tag":585,"props":2584,"children":2585},{"style":662},[2586],{"type":341,"value":1846},{"type":332,"tag":585,"props":2588,"children":2590},{"class":587,"line":2589},127,[2591],{"type":332,"tag":585,"props":2592,"children":2593},{"emptyLinePlaceholder":620},[2594],{"type":341,"value":623},{"type":332,"tag":585,"props":2596,"children":2598},{"class":587,"line":2597},128,[2599,2603,2608,2612,2617,2621,2625],{"type":332,"tag":585,"props":2600,"children":2601},{"style":639},[2602],{"type":341,"value":1336},{"type":332,"tag":585,"props":2604,"children":2605},{"style":656},[2606],{"type":341,"value":2607}," linkPlainCustomerToTenant",{"type":332,"tag":585,"props":2609,"children":2610},{"style":662},[2611],{"type":341,"value":665},{"type":332,"tag":585,"props":2613,"children":2614},{"style":1348},[2615],{"type":341,"value":2616},"customerId",{"type":332,"tag":585,"props":2618,"children":2619},{"style":662},[2620],{"type":341,"value":889},{"type":332,"tag":585,"props":2622,"children":2623},{"style":1348},[2624],{"type":341,"value":2348},{"type":332,"tag":585,"props":2626,"children":2627},{"style":662},[2628],{"type":341,"value":1365},{"type":332,"tag":585,"props":2630,"children":2632},{"class":587,"line":2631},129,[2633,2637,2641,2646],{"type":332,"tag":585,"props":2634,"children":2635},{"style":656},[2636],{"type":341,"value":2416},{"type":332,"tag":585,"props":2638,"children":2639},{"style":662},[2640],{"type":341,"value":665},{"type":332,"tag":585,"props":2642,"children":2643},{"style":645},[2644],{"type":341,"value":2645},"ADD_CUSTOMER_TO_TENANTS",{"type":332,"tag":585,"props":2647,"children":2648},{"style":662},[2649],{"type":341,"value":1416},{"type":332,"tag":585,"props":2651,"children":2653},{"class":587,"line":2652},130,[2654],{"type":332,"tag":585,"props":2655,"children":2656},{"style":662},[2657],{"type":341,"value":1941},{"type":332,"tag":585,"props":2659,"children":2661},{"class":587,"line":2660},131,[2662],{"type":332,"tag":585,"props":2663,"children":2664},{"style":662},[2665],{"type":341,"value":2666},"      customerIdentifier: { customerId: customerId },\n",{"type":332,"tag":585,"props":2668,"children":2670},{"class":587,"line":2669},132,[2671],{"type":332,"tag":585,"props":2672,"children":2673},{"style":662},[2674],{"type":341,"value":2675},"      tenantIdentifiers: [{ tenantId: tenantId }]\n",{"type":332,"tag":585,"props":2677,"children":2679},{"class":587,"line":2678},133,[2680],{"type":332,"tag":585,"props":2681,"children":2682},{"style":662},[2683],{"type":341,"value":1079},{"type":332,"tag":585,"props":2685,"children":2687},{"class":587,"line":2686},134,[2688],{"type":332,"tag":585,"props":2689,"children":2690},{"style":662},[2691],{"type":341,"value":1518},{"type":332,"tag":585,"props":2693,"children":2695},{"class":587,"line":2694},135,[2696],{"type":332,"tag":585,"props":2697,"children":2698},{"style":662},[2699],{"type":341,"value":1846},{"type":332,"tag":585,"props":2701,"children":2703},{"class":587,"line":2702},136,[2704],{"type":332,"tag":585,"props":2705,"children":2706},{"emptyLinePlaceholder":620},[2707],{"type":341,"value":623},{"type":332,"tag":585,"props":2709,"children":2711},{"class":587,"line":2710},137,[2712],{"type":332,"tag":585,"props":2713,"children":2714},{"style":592},[2715],{"type":341,"value":2716},"// ---------- Stripe ----------\n",{"type":332,"tag":585,"props":2718,"children":2720},{"class":587,"line":2719},138,[2721],{"type":332,"tag":585,"props":2722,"children":2723},{"emptyLinePlaceholder":620},[2724],{"type":341,"value":623},{"type":332,"tag":585,"props":2726,"children":2728},{"class":587,"line":2727},139,[2729,2733,2738,2742,2746],{"type":332,"tag":585,"props":2730,"children":2731},{"style":639},[2732],{"type":341,"value":1336},{"type":332,"tag":585,"props":2734,"children":2735},{"style":656},[2736],{"type":341,"value":2737}," fetchStripeCustomer",{"type":332,"tag":585,"props":2739,"children":2740},{"style":662},[2741],{"type":341,"value":665},{"type":332,"tag":585,"props":2743,"children":2744},{"style":1348},[2745],{"type":341,"value":2616},{"type":332,"tag":585,"props":2747,"children":2748},{"style":662},[2749],{"type":341,"value":1365},{"type":332,"tag":585,"props":2751,"children":2753},{"class":587,"line":2752},140,[2754,2758,2762,2766,2770,2774],{"type":332,"tag":585,"props":2755,"children":2756},{"style":639},[2757],{"type":341,"value":1374},{"type":332,"tag":585,"props":2759,"children":2760},{"style":645},[2761],{"type":341,"value":1379},{"type":332,"tag":585,"props":2763,"children":2764},{"style":639},[2765],{"type":341,"value":653},{"type":332,"tag":585,"props":2767,"children":2768},{"style":662},[2769],{"type":341,"value":1388},{"type":332,"tag":585,"props":2771,"children":2772},{"style":656},[2773],{"type":341,"value":1393},{"type":332,"tag":585,"props":2775,"children":2776},{"style":662},[2777],{"type":341,"value":2778},"(\n",{"type":332,"tag":585,"props":2780,"children":2782},{"class":587,"line":2781},141,[2783,2788],{"type":332,"tag":585,"props":2784,"children":2785},{"style":668},[2786],{"type":341,"value":2787},"    \"GET\"",{"type":332,"tag":585,"props":2789,"children":2790},{"style":662},[2791],{"type":341,"value":944},{"type":332,"tag":585,"props":2793,"children":2795},{"class":587,"line":2794},142,[2796,2801,2805],{"type":332,"tag":585,"props":2797,"children":2798},{"style":668},[2799],{"type":341,"value":2800},"    \"https://api.stripe.com/v1/customers/\"",{"type":332,"tag":585,"props":2802,"children":2803},{"style":639},[2804],{"type":341,"value":1467},{"type":332,"tag":585,"props":2806,"children":2807},{"style":662},[2808],{"type":341,"value":2809}," customerId,\n",{"type":332,"tag":585,"props":2811,"children":2813},{"class":587,"line":2812},143,[2814,2819,2823,2827],{"type":332,"tag":585,"props":2815,"children":2816},{"style":662},[2817],{"type":341,"value":2818},"    { headers: { Authorization: ",{"type":332,"tag":585,"props":2820,"children":2821},{"style":668},[2822],{"type":341,"value":1462},{"type":332,"tag":585,"props":2824,"children":2825},{"style":639},[2826],{"type":341,"value":1467},{"type":332,"tag":585,"props":2828,"children":2829},{"style":662},[2830],{"type":341,"value":2831}," stripeApiKey } }\n",{"type":332,"tag":585,"props":2833,"children":2835},{"class":587,"line":2834},144,[2836],{"type":332,"tag":585,"props":2837,"children":2838},{"style":662},[2839],{"type":341,"value":2840},"  )\n",{"type":332,"tag":585,"props":2842,"children":2844},{"class":587,"line":2843},145,[2845,2849,2853,2857,2861],{"type":332,"tag":585,"props":2846,"children":2847},{"style":639},[2848],{"type":341,"value":1527},{"type":332,"tag":585,"props":2850,"children":2851},{"style":662},[2852],{"type":341,"value":1532},{"type":332,"tag":585,"props":2854,"children":2855},{"style":639},[2856],{"type":341,"value":1537},{"type":332,"tag":585,"props":2858,"children":2859},{"style":645},[2860],{"type":341,"value":1542},{"type":332,"tag":585,"props":2862,"children":2863},{"style":662},[2864],{"type":341,"value":1365},{"type":332,"tag":585,"props":2866,"children":2868},{"class":587,"line":2867},146,[2869,2873,2877,2881,2885,2890,2894,2898,2902,2906,2910],{"type":332,"tag":585,"props":2870,"children":2871},{"style":639},[2872],{"type":341,"value":1555},{"type":332,"tag":585,"props":2874,"children":2875},{"style":639},[2876],{"type":341,"value":1560},{"type":332,"tag":585,"props":2878,"children":2879},{"style":656},[2880],{"type":341,"value":1565},{"type":332,"tag":585,"props":2882,"children":2883},{"style":662},[2884],{"type":341,"value":665},{"type":332,"tag":585,"props":2886,"children":2887},{"style":668},[2888],{"type":341,"value":2889},"\"Stripe customer lookup \"",{"type":332,"tag":585,"props":2891,"children":2892},{"style":639},[2893],{"type":341,"value":1467},{"type":332,"tag":585,"props":2895,"children":2896},{"style":662},[2897],{"type":341,"value":1583},{"type":332,"tag":585,"props":2899,"children":2900},{"style":639},[2901],{"type":341,"value":1588},{"type":332,"tag":585,"props":2903,"children":2904},{"style":668},[2905],{"type":341,"value":1593},{"type":332,"tag":585,"props":2907,"children":2908},{"style":639},[2909],{"type":341,"value":1467},{"type":332,"tag":585,"props":2911,"children":2912},{"style":662},[2913],{"type":341,"value":1602},{"type":332,"tag":585,"props":2915,"children":2917},{"class":587,"line":2916},147,[2918],{"type":332,"tag":585,"props":2919,"children":2920},{"style":662},[2921],{"type":341,"value":1611},{"type":332,"tag":585,"props":2923,"children":2925},{"class":587,"line":2924},148,[2926,2930,2934,2938,2942],{"type":332,"tag":585,"props":2927,"children":2928},{"style":639},[2929],{"type":341,"value":1832},{"type":332,"tag":585,"props":2931,"children":2932},{"style":645},[2933],{"type":341,"value":1633},{"type":332,"tag":585,"props":2935,"children":2936},{"style":662},[2937],{"type":341,"value":523},{"type":332,"tag":585,"props":2939,"children":2940},{"style":656},[2941],{"type":341,"value":1642},{"type":332,"tag":585,"props":2943,"children":2944},{"style":662},[2945],{"type":341,"value":1647},{"type":332,"tag":585,"props":2947,"children":2949},{"class":587,"line":2948},149,[2950],{"type":332,"tag":585,"props":2951,"children":2952},{"style":662},[2953],{"type":341,"value":1846},{"type":332,"tag":585,"props":2955,"children":2957},{"class":587,"line":2956},150,[2958],{"type":332,"tag":585,"props":2959,"children":2960},{"emptyLinePlaceholder":620},[2961],{"type":341,"value":623},{"type":332,"tag":585,"props":2963,"children":2965},{"class":587,"line":2964},151,[2966],{"type":332,"tag":585,"props":2967,"children":2968},{"style":592},[2969],{"type":341,"value":2970},"// ---------- main ----------\n",{"type":332,"tag":585,"props":2972,"children":2974},{"class":587,"line":2973},152,[2975],{"type":332,"tag":585,"props":2976,"children":2977},{"emptyLinePlaceholder":620},[2978],{"type":341,"value":623},{"type":332,"tag":585,"props":2980,"children":2982},{"class":587,"line":2981},153,[2983,2987,2992,2996,3001,3005,3010],{"type":332,"tag":585,"props":2984,"children":2985},{"style":639},[2986],{"type":341,"value":1336},{"type":332,"tag":585,"props":2988,"children":2989},{"style":656},[2990],{"type":341,"value":2991}," answer",{"type":332,"tag":585,"props":2993,"children":2994},{"style":662},[2995],{"type":341,"value":665},{"type":332,"tag":585,"props":2997,"children":2998},{"style":1348},[2999],{"type":341,"value":3000},"status",{"type":332,"tag":585,"props":3002,"children":3003},{"style":662},[3004],{"type":341,"value":889},{"type":332,"tag":585,"props":3006,"children":3007},{"style":1348},[3008],{"type":341,"value":3009},"payload",{"type":332,"tag":585,"props":3011,"children":3012},{"style":662},[3013],{"type":341,"value":1365},{"type":332,"tag":585,"props":3015,"children":3017},{"class":587,"line":3016},154,[3018,3023,3028],{"type":332,"tag":585,"props":3019,"children":3020},{"style":662},[3021],{"type":341,"value":3022},"  r.",{"type":332,"tag":585,"props":3024,"children":3025},{"style":656},[3026],{"type":341,"value":3027},"setResponseStatus",{"type":332,"tag":585,"props":3029,"children":3030},{"style":662},[3031],{"type":341,"value":3032},"(status)\n",{"type":332,"tag":585,"props":3034,"children":3036},{"class":587,"line":3035},155,[3037,3041,3046,3050,3055,3059,3063],{"type":332,"tag":585,"props":3038,"children":3039},{"style":662},[3040],{"type":341,"value":3022},{"type":332,"tag":585,"props":3042,"children":3043},{"style":656},[3044],{"type":341,"value":3045},"setResponseHeader",{"type":332,"tag":585,"props":3047,"children":3048},{"style":662},[3049],{"type":341,"value":665},{"type":332,"tag":585,"props":3051,"children":3052},{"style":668},[3053],{"type":341,"value":3054},"\"Content-Type\"",{"type":332,"tag":585,"props":3056,"children":3057},{"style":662},[3058],{"type":341,"value":889},{"type":332,"tag":585,"props":3060,"children":3061},{"style":668},[3062],{"type":341,"value":1444},{"type":332,"tag":585,"props":3064,"children":3065},{"style":662},[3066],{"type":341,"value":1823},{"type":332,"tag":585,"props":3068,"children":3070},{"class":587,"line":3069},156,[3071,3075,3080,3084,3088,3092,3096],{"type":332,"tag":585,"props":3072,"children":3073},{"style":662},[3074],{"type":341,"value":3022},{"type":332,"tag":585,"props":3076,"children":3077},{"style":656},[3078],{"type":341,"value":3079},"setResponseBody",{"type":332,"tag":585,"props":3081,"children":3082},{"style":662},[3083],{"type":341,"value":665},{"type":332,"tag":585,"props":3085,"children":3086},{"style":645},[3087],{"type":341,"value":1495},{"type":332,"tag":585,"props":3089,"children":3090},{"style":662},[3091],{"type":341,"value":523},{"type":332,"tag":585,"props":3093,"children":3094},{"style":656},[3095],{"type":341,"value":1504},{"type":332,"tag":585,"props":3097,"children":3098},{"style":662},[3099],{"type":341,"value":3100},"(payload))\n",{"type":332,"tag":585,"props":3102,"children":3104},{"class":587,"line":3103},157,[3105,3109,3114],{"type":332,"tag":585,"props":3106,"children":3107},{"style":662},[3108],{"type":341,"value":3022},{"type":332,"tag":585,"props":3110,"children":3111},{"style":656},[3112],{"type":341,"value":3113},"stopForwarding",{"type":332,"tag":585,"props":3115,"children":3116},{"style":662},[3117],{"type":341,"value":3118},"()\n",{"type":332,"tag":585,"props":3120,"children":3122},{"class":587,"line":3121},158,[3123],{"type":332,"tag":585,"props":3124,"children":3125},{"style":662},[3126],{"type":341,"value":1846},{"type":332,"tag":585,"props":3128,"children":3130},{"class":587,"line":3129},159,[3131],{"type":332,"tag":585,"props":3132,"children":3133},{"emptyLinePlaceholder":620},[3134],{"type":341,"value":623},{"type":332,"tag":585,"props":3136,"children":3138},{"class":587,"line":3137},160,[3139],{"type":332,"tag":585,"props":3140,"children":3141},{"style":592},[3142],{"type":341,"value":3143},"// 1) Verify Stripe's signature before trusting the payload.\n",{"type":332,"tag":585,"props":3145,"children":3147},{"class":587,"line":3146},161,[3148],{"type":332,"tag":585,"props":3149,"children":3150},{"style":592},[3151],{"type":341,"value":3152},"//    Stripe-Signature: t=\u003Cunix ts>, v1=\u003Chex hmac of \"\u003Cts>.\u003Cbody>\">\n",{"type":332,"tag":585,"props":3154,"children":3156},{"class":587,"line":3155},162,[3157,3161,3166,3170,3175,3180,3185,3189],{"type":332,"tag":585,"props":3158,"children":3159},{"style":639},[3160],{"type":341,"value":642},{"type":332,"tag":585,"props":3162,"children":3163},{"style":645},[3164],{"type":341,"value":3165}," signature",{"type":332,"tag":585,"props":3167,"children":3168},{"style":639},[3169],{"type":341,"value":653},{"type":332,"tag":585,"props":3171,"children":3172},{"style":662},[3173],{"type":341,"value":3174}," r.headers[",{"type":332,"tag":585,"props":3176,"children":3177},{"style":668},[3178],{"type":341,"value":3179},"\"Stripe-Signature\"",{"type":332,"tag":585,"props":3181,"children":3182},{"style":662},[3183],{"type":341,"value":3184},"] ",{"type":332,"tag":585,"props":3186,"children":3187},{"style":639},[3188],{"type":341,"value":1973},{"type":332,"tag":585,"props":3190,"children":3191},{"style":668},[3192],{"type":341,"value":3193}," \"\"\n",{"type":332,"tag":585,"props":3195,"children":3197},{"class":587,"line":3196},163,[3198,3202,3207,3211,3216,3221,3225,3230,3236,3241,3245,3250,3254,3258,3262,3267,3272],{"type":332,"tag":585,"props":3199,"children":3200},{"style":639},[3201],{"type":341,"value":642},{"type":332,"tag":585,"props":3203,"children":3204},{"style":645},[3205],{"type":341,"value":3206}," timestamp",{"type":332,"tag":585,"props":3208,"children":3209},{"style":639},[3210],{"type":341,"value":653},{"type":332,"tag":585,"props":3212,"children":3213},{"style":662},[3214],{"type":341,"value":3215}," (signature.",{"type":332,"tag":585,"props":3217,"children":3218},{"style":656},[3219],{"type":341,"value":3220},"match",{"type":332,"tag":585,"props":3222,"children":3223},{"style":662},[3224],{"type":341,"value":665},{"type":332,"tag":585,"props":3226,"children":3227},{"style":668},[3228],{"type":341,"value":3229},"/",{"type":332,"tag":585,"props":3231,"children":3233},{"style":3232},"--shiki-default:#DBEDFF",[3234],{"type":341,"value":3235},"t=(",{"type":332,"tag":585,"props":3237,"children":3238},{"style":645},[3239],{"type":341,"value":3240},"\\d",{"type":332,"tag":585,"props":3242,"children":3243},{"style":639},[3244],{"type":341,"value":1588},{"type":332,"tag":585,"props":3246,"children":3247},{"style":3232},[3248],{"type":341,"value":3249},")",{"type":332,"tag":585,"props":3251,"children":3252},{"style":668},[3253],{"type":341,"value":3229},{"type":332,"tag":585,"props":3255,"children":3256},{"style":662},[3257],{"type":341,"value":676},{"type":332,"tag":585,"props":3259,"children":3260},{"style":639},[3261],{"type":341,"value":1973},{"type":332,"tag":585,"props":3263,"children":3264},{"style":662},[3265],{"type":341,"value":3266}," [])[",{"type":332,"tag":585,"props":3268,"children":3269},{"style":645},[3270],{"type":341,"value":3271},"1",{"type":332,"tag":585,"props":3273,"children":3274},{"style":662},[3275],{"type":341,"value":908},{"type":332,"tag":585,"props":3277,"children":3279},{"class":587,"line":3278},164,[3280,3284,3289,3293,3297,3301,3305,3309,3314,3319,3323,3327,3331,3335,3339,3343,3347],{"type":332,"tag":585,"props":3281,"children":3282},{"style":639},[3283],{"type":341,"value":642},{"type":332,"tag":585,"props":3285,"children":3286},{"style":645},[3287],{"type":341,"value":3288}," sent",{"type":332,"tag":585,"props":3290,"children":3291},{"style":639},[3292],{"type":341,"value":653},{"type":332,"tag":585,"props":3294,"children":3295},{"style":662},[3296],{"type":341,"value":3215},{"type":332,"tag":585,"props":3298,"children":3299},{"style":656},[3300],{"type":341,"value":3220},{"type":332,"tag":585,"props":3302,"children":3303},{"style":662},[3304],{"type":341,"value":665},{"type":332,"tag":585,"props":3306,"children":3307},{"style":668},[3308],{"type":341,"value":3229},{"type":332,"tag":585,"props":3310,"children":3311},{"style":3232},[3312],{"type":341,"value":3313},"v1=(",{"type":332,"tag":585,"props":3315,"children":3316},{"style":645},[3317],{"type":341,"value":3318},"[a-f0-9]",{"type":332,"tag":585,"props":3320,"children":3321},{"style":639},[3322],{"type":341,"value":1588},{"type":332,"tag":585,"props":3324,"children":3325},{"style":3232},[3326],{"type":341,"value":3249},{"type":332,"tag":585,"props":3328,"children":3329},{"style":668},[3330],{"type":341,"value":3229},{"type":332,"tag":585,"props":3332,"children":3333},{"style":662},[3334],{"type":341,"value":676},{"type":332,"tag":585,"props":3336,"children":3337},{"style":639},[3338],{"type":341,"value":1973},{"type":332,"tag":585,"props":3340,"children":3341},{"style":662},[3342],{"type":341,"value":3266},{"type":332,"tag":585,"props":3344,"children":3345},{"style":645},[3346],{"type":341,"value":3271},{"type":332,"tag":585,"props":3348,"children":3349},{"style":662},[3350],{"type":341,"value":908},{"type":332,"tag":585,"props":3352,"children":3354},{"class":587,"line":3353},165,[3355],{"type":332,"tag":585,"props":3356,"children":3357},{"emptyLinePlaceholder":620},[3358],{"type":341,"value":623},{"type":332,"tag":585,"props":3360,"children":3362},{"class":587,"line":3361},166,[3363,3368,3372,3376,3381,3385,3390],{"type":332,"tag":585,"props":3364,"children":3365},{"style":639},[3366],{"type":341,"value":3367},"if",{"type":332,"tag":585,"props":3369,"children":3370},{"style":662},[3371],{"type":341,"value":1786},{"type":332,"tag":585,"props":3373,"children":3374},{"style":639},[3375],{"type":341,"value":1791},{"type":332,"tag":585,"props":3377,"children":3378},{"style":662},[3379],{"type":341,"value":3380},"timestamp ",{"type":332,"tag":585,"props":3382,"children":3383},{"style":639},[3384],{"type":341,"value":1973},{"type":332,"tag":585,"props":3386,"children":3387},{"style":639},[3388],{"type":341,"value":3389}," !",{"type":332,"tag":585,"props":3391,"children":3392},{"style":662},[3393],{"type":341,"value":3394},"sent) {\n",{"type":332,"tag":585,"props":3396,"children":3398},{"class":587,"line":3397},167,[3399,3404,3408,3413,3418,3423],{"type":332,"tag":585,"props":3400,"children":3401},{"style":656},[3402],{"type":341,"value":3403},"  answer",{"type":332,"tag":585,"props":3405,"children":3406},{"style":662},[3407],{"type":341,"value":665},{"type":332,"tag":585,"props":3409,"children":3410},{"style":645},[3411],{"type":341,"value":3412},"400",{"type":332,"tag":585,"props":3414,"children":3415},{"style":662},[3416],{"type":341,"value":3417},", { error: ",{"type":332,"tag":585,"props":3419,"children":3420},{"style":668},[3421],{"type":341,"value":3422},"\"missing Stripe-Signature header\"",{"type":332,"tag":585,"props":3424,"children":3425},{"style":662},[3426],{"type":341,"value":3427}," })\n",{"type":332,"tag":585,"props":3429,"children":3431},{"class":587,"line":3430},168,[3432],{"type":332,"tag":585,"props":3433,"children":3434},{"style":639},[3435],{"type":341,"value":3436},"  return\n",{"type":332,"tag":585,"props":3438,"children":3440},{"class":587,"line":3439},169,[3441],{"type":332,"tag":585,"props":3442,"children":3443},{"style":662},[3444],{"type":341,"value":1846},{"type":332,"tag":585,"props":3446,"children":3448},{"class":587,"line":3447},170,[3449,3453,3458,3463,3468,3473,3478,3483,3488,3493,3498,3503,3508,3512],{"type":332,"tag":585,"props":3450,"children":3451},{"style":639},[3452],{"type":341,"value":3367},{"type":332,"tag":585,"props":3454,"children":3455},{"style":662},[3456],{"type":341,"value":3457}," (Math.",{"type":332,"tag":585,"props":3459,"children":3460},{"style":656},[3461],{"type":341,"value":3462},"abs",{"type":332,"tag":585,"props":3464,"children":3465},{"style":662},[3466],{"type":341,"value":3467},"(time.",{"type":332,"tag":585,"props":3469,"children":3470},{"style":656},[3471],{"type":341,"value":3472},"unix",{"type":332,"tag":585,"props":3474,"children":3475},{"style":662},[3476],{"type":341,"value":3477},"() ",{"type":332,"tag":585,"props":3479,"children":3480},{"style":639},[3481],{"type":341,"value":3482},"-",{"type":332,"tag":585,"props":3484,"children":3485},{"style":656},[3486],{"type":341,"value":3487}," parseInt",{"type":332,"tag":585,"props":3489,"children":3490},{"style":662},[3491],{"type":341,"value":3492},"(timestamp, ",{"type":332,"tag":585,"props":3494,"children":3495},{"style":645},[3496],{"type":341,"value":3497},"10",{"type":332,"tag":585,"props":3499,"children":3500},{"style":662},[3501],{"type":341,"value":3502},")) ",{"type":332,"tag":585,"props":3504,"children":3505},{"style":639},[3506],{"type":341,"value":3507},">",{"type":332,"tag":585,"props":3509,"children":3510},{"style":645},[3511],{"type":341,"value":840},{"type":332,"tag":585,"props":3513,"children":3514},{"style":662},[3515],{"type":341,"value":1365},{"type":332,"tag":585,"props":3517,"children":3519},{"class":587,"line":3518},171,[3520,3524,3528,3532,3536,3541],{"type":332,"tag":585,"props":3521,"children":3522},{"style":656},[3523],{"type":341,"value":3403},{"type":332,"tag":585,"props":3525,"children":3526},{"style":662},[3527],{"type":341,"value":665},{"type":332,"tag":585,"props":3529,"children":3530},{"style":645},[3531],{"type":341,"value":3412},{"type":332,"tag":585,"props":3533,"children":3534},{"style":662},[3535],{"type":341,"value":3417},{"type":332,"tag":585,"props":3537,"children":3538},{"style":668},[3539],{"type":341,"value":3540},"\"timestamp outside tolerance\"",{"type":332,"tag":585,"props":3542,"children":3543},{"style":662},[3544],{"type":341,"value":3427},{"type":332,"tag":585,"props":3546,"children":3548},{"class":587,"line":3547},172,[3549],{"type":332,"tag":585,"props":3550,"children":3551},{"style":639},[3552],{"type":341,"value":3436},{"type":332,"tag":585,"props":3554,"children":3556},{"class":587,"line":3555},173,[3557],{"type":332,"tag":585,"props":3558,"children":3559},{"style":662},[3560],{"type":341,"value":1846},{"type":332,"tag":585,"props":3562,"children":3564},{"class":587,"line":3563},174,[3565,3569,3574,3578,3583,3588,3592,3597,3602,3606,3611,3615],{"type":332,"tag":585,"props":3566,"children":3567},{"style":639},[3568],{"type":341,"value":642},{"type":332,"tag":585,"props":3570,"children":3571},{"style":645},[3572],{"type":341,"value":3573}," expected",{"type":332,"tag":585,"props":3575,"children":3576},{"style":639},[3577],{"type":341,"value":653},{"type":332,"tag":585,"props":3579,"children":3580},{"style":662},[3581],{"type":341,"value":3582}," crypto.",{"type":332,"tag":585,"props":3584,"children":3585},{"style":656},[3586],{"type":341,"value":3587},"hmac",{"type":332,"tag":585,"props":3589,"children":3590},{"style":662},[3591],{"type":341,"value":665},{"type":332,"tag":585,"props":3593,"children":3594},{"style":668},[3595],{"type":341,"value":3596},"\"sha256\"",{"type":332,"tag":585,"props":3598,"children":3599},{"style":662},[3600],{"type":341,"value":3601},", stripeSigningSecret, timestamp ",{"type":332,"tag":585,"props":3603,"children":3604},{"style":639},[3605],{"type":341,"value":1588},{"type":332,"tag":585,"props":3607,"children":3608},{"style":668},[3609],{"type":341,"value":3610}," \".\"",{"type":332,"tag":585,"props":3612,"children":3613},{"style":639},[3614],{"type":341,"value":1467},{"type":332,"tag":585,"props":3616,"children":3617},{"style":662},[3618],{"type":341,"value":3619}," r.body)\n",{"type":332,"tag":585,"props":3621,"children":3623},{"class":587,"line":3622},175,[3624,3628,3633,3637],{"type":332,"tag":585,"props":3625,"children":3626},{"style":639},[3627],{"type":341,"value":3367},{"type":332,"tag":585,"props":3629,"children":3630},{"style":662},[3631],{"type":341,"value":3632}," (expected ",{"type":332,"tag":585,"props":3634,"children":3635},{"style":639},[3636],{"type":341,"value":1537},{"type":332,"tag":585,"props":3638,"children":3639},{"style":662},[3640],{"type":341,"value":3641}," sent) {\n",{"type":332,"tag":585,"props":3643,"children":3645},{"class":587,"line":3644},176,[3646,3650,3654,3658,3662,3667],{"type":332,"tag":585,"props":3647,"children":3648},{"style":656},[3649],{"type":341,"value":3403},{"type":332,"tag":585,"props":3651,"children":3652},{"style":662},[3653],{"type":341,"value":665},{"type":332,"tag":585,"props":3655,"children":3656},{"style":645},[3657],{"type":341,"value":3412},{"type":332,"tag":585,"props":3659,"children":3660},{"style":662},[3661],{"type":341,"value":3417},{"type":332,"tag":585,"props":3663,"children":3664},{"style":668},[3665],{"type":341,"value":3666},"\"signature mismatch\"",{"type":332,"tag":585,"props":3668,"children":3669},{"style":662},[3670],{"type":341,"value":3427},{"type":332,"tag":585,"props":3672,"children":3674},{"class":587,"line":3673},177,[3675],{"type":332,"tag":585,"props":3676,"children":3677},{"style":639},[3678],{"type":341,"value":3436},{"type":332,"tag":585,"props":3680,"children":3682},{"class":587,"line":3681},178,[3683],{"type":332,"tag":585,"props":3684,"children":3685},{"style":662},[3686],{"type":341,"value":1846},{"type":332,"tag":585,"props":3688,"children":3690},{"class":587,"line":3689},179,[3691],{"type":332,"tag":585,"props":3692,"children":3693},{"emptyLinePlaceholder":620},[3694],{"type":341,"value":623},{"type":332,"tag":585,"props":3696,"children":3698},{"class":587,"line":3697},180,[3699],{"type":332,"tag":585,"props":3700,"children":3701},{"style":592},[3702],{"type":341,"value":3703},"// 2) Parse the event; ignore anything we do not sync.\n",{"type":332,"tag":585,"props":3705,"children":3707},{"class":587,"line":3706},181,[3708,3713],{"type":332,"tag":585,"props":3709,"children":3710},{"style":639},[3711],{"type":341,"value":3712},"let",{"type":332,"tag":585,"props":3714,"children":3715},{"style":662},[3716],{"type":341,"value":3717}," event\n",{"type":332,"tag":585,"props":3719,"children":3721},{"class":587,"line":3720},182,[3722,3727],{"type":332,"tag":585,"props":3723,"children":3724},{"style":639},[3725],{"type":341,"value":3726},"try",{"type":332,"tag":585,"props":3728,"children":3729},{"style":662},[3730],{"type":341,"value":3731}," {\n",{"type":332,"tag":585,"props":3733,"children":3735},{"class":587,"line":3734},183,[3736,3741,3746,3750,3754,3758],{"type":332,"tag":585,"props":3737,"children":3738},{"style":662},[3739],{"type":341,"value":3740},"  event ",{"type":332,"tag":585,"props":3742,"children":3743},{"style":639},[3744],{"type":341,"value":3745},"=",{"type":332,"tag":585,"props":3747,"children":3748},{"style":645},[3749],{"type":341,"value":1633},{"type":332,"tag":585,"props":3751,"children":3752},{"style":662},[3753],{"type":341,"value":523},{"type":332,"tag":585,"props":3755,"children":3756},{"style":656},[3757],{"type":341,"value":1642},{"type":332,"tag":585,"props":3759,"children":3760},{"style":662},[3761],{"type":341,"value":3762},"(r.body)\n",{"type":332,"tag":585,"props":3764,"children":3766},{"class":587,"line":3765},184,[3767,3772,3777],{"type":332,"tag":585,"props":3768,"children":3769},{"style":662},[3770],{"type":341,"value":3771},"} ",{"type":332,"tag":585,"props":3773,"children":3774},{"style":639},[3775],{"type":341,"value":3776},"catch",{"type":332,"tag":585,"props":3778,"children":3779},{"style":662},[3780],{"type":341,"value":3781}," (e) {\n",{"type":332,"tag":585,"props":3783,"children":3785},{"class":587,"line":3784},185,[3786,3790,3794,3798,3802,3807],{"type":332,"tag":585,"props":3787,"children":3788},{"style":656},[3789],{"type":341,"value":3403},{"type":332,"tag":585,"props":3791,"children":3792},{"style":662},[3793],{"type":341,"value":665},{"type":332,"tag":585,"props":3795,"children":3796},{"style":645},[3797],{"type":341,"value":3412},{"type":332,"tag":585,"props":3799,"children":3800},{"style":662},[3801],{"type":341,"value":3417},{"type":332,"tag":585,"props":3803,"children":3804},{"style":668},[3805],{"type":341,"value":3806},"\"invalid JSON body\"",{"type":332,"tag":585,"props":3808,"children":3809},{"style":662},[3810],{"type":341,"value":3427},{"type":332,"tag":585,"props":3812,"children":3814},{"class":587,"line":3813},186,[3815],{"type":332,"tag":585,"props":3816,"children":3817},{"style":639},[3818],{"type":341,"value":3436},{"type":332,"tag":585,"props":3820,"children":3822},{"class":587,"line":3821},187,[3823],{"type":332,"tag":585,"props":3824,"children":3825},{"style":662},[3826],{"type":341,"value":1846},{"type":332,"tag":585,"props":3828,"children":3830},{"class":587,"line":3829},188,[3831,3835,3839,3844,3848,3853,3858,3863,3868,3872],{"type":332,"tag":585,"props":3832,"children":3833},{"style":639},[3834],{"type":341,"value":3367},{"type":332,"tag":585,"props":3836,"children":3837},{"style":662},[3838],{"type":341,"value":1786},{"type":332,"tag":585,"props":3840,"children":3841},{"style":645},[3842],{"type":341,"value":3843},"HANDLED_EVENTS",{"type":332,"tag":585,"props":3845,"children":3846},{"style":662},[3847],{"type":341,"value":523},{"type":332,"tag":585,"props":3849,"children":3850},{"style":656},[3851],{"type":341,"value":3852},"indexOf",{"type":332,"tag":585,"props":3854,"children":3855},{"style":662},[3856],{"type":341,"value":3857},"(event.type) ",{"type":332,"tag":585,"props":3859,"children":3860},{"style":639},[3861],{"type":341,"value":3862},"===",{"type":332,"tag":585,"props":3864,"children":3865},{"style":639},[3866],{"type":341,"value":3867}," -",{"type":332,"tag":585,"props":3869,"children":3870},{"style":645},[3871],{"type":341,"value":3271},{"type":332,"tag":585,"props":3873,"children":3874},{"style":662},[3875],{"type":341,"value":1365},{"type":332,"tag":585,"props":3877,"children":3879},{"class":587,"line":3878},189,[3880,3884,3888,3893,3898,3903,3908,3912],{"type":332,"tag":585,"props":3881,"children":3882},{"style":656},[3883],{"type":341,"value":3403},{"type":332,"tag":585,"props":3885,"children":3886},{"style":662},[3887],{"type":341,"value":665},{"type":332,"tag":585,"props":3889,"children":3890},{"style":645},[3891],{"type":341,"value":3892},"200",{"type":332,"tag":585,"props":3894,"children":3895},{"style":662},[3896],{"type":341,"value":3897},", { received: ",{"type":332,"tag":585,"props":3899,"children":3900},{"style":645},[3901],{"type":341,"value":3902},"true",{"type":332,"tag":585,"props":3904,"children":3905},{"style":662},[3906],{"type":341,"value":3907},", handled: ",{"type":332,"tag":585,"props":3909,"children":3910},{"style":645},[3911],{"type":341,"value":1992},{"type":332,"tag":585,"props":3913,"children":3914},{"style":662},[3915],{"type":341,"value":3916},", type: event.type })\n",{"type":332,"tag":585,"props":3918,"children":3920},{"class":587,"line":3919},190,[3921],{"type":332,"tag":585,"props":3922,"children":3923},{"style":639},[3924],{"type":341,"value":3436},{"type":332,"tag":585,"props":3926,"children":3928},{"class":587,"line":3927},191,[3929],{"type":332,"tag":585,"props":3930,"children":3931},{"style":662},[3932],{"type":341,"value":1846},{"type":332,"tag":585,"props":3934,"children":3936},{"class":587,"line":3935},192,[3937],{"type":332,"tag":585,"props":3938,"children":3939},{"emptyLinePlaceholder":620},[3940],{"type":341,"value":623},{"type":332,"tag":585,"props":3942,"children":3944},{"class":587,"line":3943},193,[3945],{"type":332,"tag":585,"props":3946,"children":3947},{"style":592},[3948],{"type":341,"value":3949},"// 3) Sync. Any Plain error → 500 so Stripe retries the delivery.\n",{"type":332,"tag":585,"props":3951,"children":3953},{"class":587,"line":3952},194,[3954,3958],{"type":332,"tag":585,"props":3955,"children":3956},{"style":639},[3957],{"type":341,"value":3726},{"type":332,"tag":585,"props":3959,"children":3960},{"style":662},[3961],{"type":341,"value":3731},{"type":332,"tag":585,"props":3963,"children":3965},{"class":587,"line":3964},195,[3966,3970,3975,3979,3984],{"type":332,"tag":585,"props":3967,"children":3968},{"style":639},[3969],{"type":341,"value":1374},{"type":332,"tag":585,"props":3971,"children":3972},{"style":645},[3973],{"type":341,"value":3974}," outcome",{"type":332,"tag":585,"props":3976,"children":3977},{"style":639},[3978],{"type":341,"value":653},{"type":332,"tag":585,"props":3980,"children":3981},{"style":656},[3982],{"type":341,"value":3983}," syncEvent",{"type":332,"tag":585,"props":3985,"children":3986},{"style":662},[3987],{"type":341,"value":3988},"(event)\n",{"type":332,"tag":585,"props":3990,"children":3992},{"class":587,"line":3991},196,[3993,3998,4003,4007,4012,4017,4021,4025,4029],{"type":332,"tag":585,"props":3994,"children":3995},{"style":662},[3996],{"type":341,"value":3997},"  console.",{"type":332,"tag":585,"props":3999,"children":4000},{"style":656},[4001],{"type":341,"value":4002},"log",{"type":332,"tag":585,"props":4004,"children":4005},{"style":662},[4006],{"type":341,"value":665},{"type":332,"tag":585,"props":4008,"children":4009},{"style":668},[4010],{"type":341,"value":4011},"\"stripe-to-plain\"",{"type":332,"tag":585,"props":4013,"children":4014},{"style":662},[4015],{"type":341,"value":4016},", event.type, ",{"type":332,"tag":585,"props":4018,"children":4019},{"style":645},[4020],{"type":341,"value":1495},{"type":332,"tag":585,"props":4022,"children":4023},{"style":662},[4024],{"type":341,"value":523},{"type":332,"tag":585,"props":4026,"children":4027},{"style":656},[4028],{"type":341,"value":1504},{"type":332,"tag":585,"props":4030,"children":4031},{"style":662},[4032],{"type":341,"value":4033},"(outcome))\n",{"type":332,"tag":585,"props":4035,"children":4037},{"class":587,"line":4036},197,[4038,4042,4046,4050,4054,4058,4062,4066],{"type":332,"tag":585,"props":4039,"children":4040},{"style":656},[4041],{"type":341,"value":3403},{"type":332,"tag":585,"props":4043,"children":4044},{"style":662},[4045],{"type":341,"value":665},{"type":332,"tag":585,"props":4047,"children":4048},{"style":645},[4049],{"type":341,"value":3892},{"type":332,"tag":585,"props":4051,"children":4052},{"style":662},[4053],{"type":341,"value":3897},{"type":332,"tag":585,"props":4055,"children":4056},{"style":645},[4057],{"type":341,"value":3902},{"type":332,"tag":585,"props":4059,"children":4060},{"style":662},[4061],{"type":341,"value":3907},{"type":332,"tag":585,"props":4063,"children":4064},{"style":645},[4065],{"type":341,"value":3902},{"type":332,"tag":585,"props":4067,"children":4068},{"style":662},[4069],{"type":341,"value":4070},", outcome: outcome })\n",{"type":332,"tag":585,"props":4072,"children":4074},{"class":587,"line":4073},198,[4075,4079,4083],{"type":332,"tag":585,"props":4076,"children":4077},{"style":662},[4078],{"type":341,"value":3771},{"type":332,"tag":585,"props":4080,"children":4081},{"style":639},[4082],{"type":341,"value":3776},{"type":332,"tag":585,"props":4084,"children":4085},{"style":662},[4086],{"type":341,"value":3781},{"type":332,"tag":585,"props":4088,"children":4090},{"class":587,"line":4089},199,[4091,4095,4100,4104,4109,4113,4118],{"type":332,"tag":585,"props":4092,"children":4093},{"style":662},[4094],{"type":341,"value":3997},{"type":332,"tag":585,"props":4096,"children":4097},{"style":656},[4098],{"type":341,"value":4099},"error",{"type":332,"tag":585,"props":4101,"children":4102},{"style":662},[4103],{"type":341,"value":665},{"type":332,"tag":585,"props":4105,"children":4106},{"style":668},[4107],{"type":341,"value":4108},"\"stripe-to-plain error\"",{"type":332,"tag":585,"props":4110,"children":4111},{"style":662},[4112],{"type":341,"value":4016},{"type":332,"tag":585,"props":4114,"children":4115},{"style":656},[4116],{"type":341,"value":4117},"String",{"type":332,"tag":585,"props":4119,"children":4120},{"style":662},[4121],{"type":341,"value":4122},"(e))\n",{"type":332,"tag":585,"props":4124,"children":4126},{"class":587,"line":4125},200,[4127,4131,4135,4140,4144,4148],{"type":332,"tag":585,"props":4128,"children":4129},{"style":656},[4130],{"type":341,"value":3403},{"type":332,"tag":585,"props":4132,"children":4133},{"style":662},[4134],{"type":341,"value":665},{"type":332,"tag":585,"props":4136,"children":4137},{"style":645},[4138],{"type":341,"value":4139},"500",{"type":332,"tag":585,"props":4141,"children":4142},{"style":662},[4143],{"type":341,"value":3417},{"type":332,"tag":585,"props":4145,"children":4146},{"style":656},[4147],{"type":341,"value":4117},{"type":332,"tag":585,"props":4149,"children":4150},{"style":662},[4151],{"type":341,"value":4152},"(e) })\n",{"type":332,"tag":585,"props":4154,"children":4156},{"class":587,"line":4155},201,[4157],{"type":332,"tag":585,"props":4158,"children":4159},{"style":662},[4160],{"type":341,"value":1846},{"type":332,"tag":585,"props":4162,"children":4164},{"class":587,"line":4163},202,[4165],{"type":332,"tag":585,"props":4166,"children":4167},{"emptyLinePlaceholder":620},[4168],{"type":341,"value":623},{"type":332,"tag":585,"props":4170,"children":4172},{"class":587,"line":4171},203,[4173],{"type":332,"tag":585,"props":4174,"children":4175},{"style":592},[4176],{"type":341,"value":4177},"// ---------- sync ----------\n",{"type":332,"tag":585,"props":4179,"children":4181},{"class":587,"line":4180},204,[4182],{"type":332,"tag":585,"props":4183,"children":4184},{"emptyLinePlaceholder":620},[4185],{"type":341,"value":623},{"type":332,"tag":585,"props":4187,"children":4189},{"class":587,"line":4188},205,[4190,4194,4198,4202,4207],{"type":332,"tag":585,"props":4191,"children":4192},{"style":639},[4193],{"type":341,"value":1336},{"type":332,"tag":585,"props":4195,"children":4196},{"style":656},[4197],{"type":341,"value":3983},{"type":332,"tag":585,"props":4199,"children":4200},{"style":662},[4201],{"type":341,"value":665},{"type":332,"tag":585,"props":4203,"children":4204},{"style":1348},[4205],{"type":341,"value":4206},"event",{"type":332,"tag":585,"props":4208,"children":4209},{"style":662},[4210],{"type":341,"value":1365},{"type":332,"tag":585,"props":4212,"children":4214},{"class":587,"line":4213},206,[4215,4220],{"type":332,"tag":585,"props":4216,"children":4217},{"style":639},[4218],{"type":341,"value":4219},"  let",{"type":332,"tag":585,"props":4221,"children":4222},{"style":662},[4223],{"type":341,"value":4224}," email, name, stripeCustomerId, tier\n",{"type":332,"tag":585,"props":4226,"children":4228},{"class":587,"line":4227},207,[4229],{"type":332,"tag":585,"props":4230,"children":4231},{"emptyLinePlaceholder":620},[4232],{"type":341,"value":623},{"type":332,"tag":585,"props":4234,"children":4236},{"class":587,"line":4235},208,[4237,4241,4246,4250,4255],{"type":332,"tag":585,"props":4238,"children":4239},{"style":639},[4240],{"type":341,"value":1527},{"type":332,"tag":585,"props":4242,"children":4243},{"style":662},[4244],{"type":341,"value":4245}," (event.type ",{"type":332,"tag":585,"props":4247,"children":4248},{"style":639},[4249],{"type":341,"value":3862},{"type":332,"tag":585,"props":4251,"children":4252},{"style":668},[4253],{"type":341,"value":4254}," \"customer.created\"",{"type":332,"tag":585,"props":4256,"children":4257},{"style":662},[4258],{"type":341,"value":1365},{"type":332,"tag":585,"props":4260,"children":4262},{"class":587,"line":4261},209,[4263],{"type":332,"tag":585,"props":4264,"children":4265},{"style":592},[4266],{"type":341,"value":4267},"    // New Stripe customer: make sure they exist in Plain on the free tier.\n",{"type":332,"tag":585,"props":4269,"children":4271},{"class":587,"line":4270},210,[4272,4277,4282,4286],{"type":332,"tag":585,"props":4273,"children":4274},{"style":639},[4275],{"type":341,"value":4276},"    const",{"type":332,"tag":585,"props":4278,"children":4279},{"style":645},[4280],{"type":341,"value":4281}," c",{"type":332,"tag":585,"props":4283,"children":4284},{"style":639},[4285],{"type":341,"value":653},{"type":332,"tag":585,"props":4287,"children":4288},{"style":662},[4289],{"type":341,"value":4290}," event.data.object\n",{"type":332,"tag":585,"props":4292,"children":4294},{"class":587,"line":4293},211,[4295,4300,4304,4308,4313,4318,4323,4328,4333,4338],{"type":332,"tag":585,"props":4296,"children":4297},{"style":639},[4298],{"type":341,"value":4299},"    if",{"type":332,"tag":585,"props":4301,"children":4302},{"style":662},[4303],{"type":341,"value":1786},{"type":332,"tag":585,"props":4305,"children":4306},{"style":639},[4307],{"type":341,"value":1791},{"type":332,"tag":585,"props":4309,"children":4310},{"style":662},[4311],{"type":341,"value":4312},"c.email) ",{"type":332,"tag":585,"props":4314,"children":4315},{"style":639},[4316],{"type":341,"value":4317},"return",{"type":332,"tag":585,"props":4319,"children":4320},{"style":662},[4321],{"type":341,"value":4322}," { action: ",{"type":332,"tag":585,"props":4324,"children":4325},{"style":668},[4326],{"type":341,"value":4327},"\"noop\"",{"type":332,"tag":585,"props":4329,"children":4330},{"style":662},[4331],{"type":341,"value":4332},", reason: ",{"type":332,"tag":585,"props":4334,"children":4335},{"style":668},[4336],{"type":341,"value":4337},"\"customer_has_no_email\"",{"type":332,"tag":585,"props":4339,"children":4340},{"style":662},[4341],{"type":341,"value":4342}," }\n",{"type":332,"tag":585,"props":4344,"children":4346},{"class":587,"line":4345},212,[4347,4352,4356],{"type":332,"tag":585,"props":4348,"children":4349},{"style":662},[4350],{"type":341,"value":4351},"    email ",{"type":332,"tag":585,"props":4353,"children":4354},{"style":639},[4355],{"type":341,"value":3745},{"type":332,"tag":585,"props":4357,"children":4358},{"style":662},[4359],{"type":341,"value":4360}," c.email\n",{"type":332,"tag":585,"props":4362,"children":4364},{"class":587,"line":4363},213,[4365,4370,4374],{"type":332,"tag":585,"props":4366,"children":4367},{"style":662},[4368],{"type":341,"value":4369},"    name ",{"type":332,"tag":585,"props":4371,"children":4372},{"style":639},[4373],{"type":341,"value":3745},{"type":332,"tag":585,"props":4375,"children":4376},{"style":662},[4377],{"type":341,"value":4378}," c.name\n",{"type":332,"tag":585,"props":4380,"children":4382},{"class":587,"line":4381},214,[4383,4388,4392],{"type":332,"tag":585,"props":4384,"children":4385},{"style":662},[4386],{"type":341,"value":4387},"    stripeCustomerId ",{"type":332,"tag":585,"props":4389,"children":4390},{"style":639},[4391],{"type":341,"value":3745},{"type":332,"tag":585,"props":4393,"children":4394},{"style":662},[4395],{"type":341,"value":4396}," c.id\n",{"type":332,"tag":585,"props":4398,"children":4400},{"class":587,"line":4399},215,[4401,4406,4410],{"type":332,"tag":585,"props":4402,"children":4403},{"style":662},[4404],{"type":341,"value":4405},"    tier ",{"type":332,"tag":585,"props":4407,"children":4408},{"style":639},[4409],{"type":341,"value":3745},{"type":332,"tag":585,"props":4411,"children":4412},{"style":668},[4413],{"type":341,"value":4414}," \"free\"\n",{"type":332,"tag":585,"props":4416,"children":4418},{"class":587,"line":4417},216,[4419,4424,4429],{"type":332,"tag":585,"props":4420,"children":4421},{"style":662},[4422],{"type":341,"value":4423},"  } ",{"type":332,"tag":585,"props":4425,"children":4426},{"style":639},[4427],{"type":341,"value":4428},"else",{"type":332,"tag":585,"props":4430,"children":4431},{"style":662},[4432],{"type":341,"value":3731},{"type":332,"tag":585,"props":4434,"children":4436},{"class":587,"line":4435},217,[4437],{"type":332,"tag":585,"props":4438,"children":4439},{"style":592},[4440],{"type":341,"value":4441},"    // Subscription events: resolve the customer for email + name.\n",{"type":332,"tag":585,"props":4443,"children":4445},{"class":587,"line":4444},218,[4446,4450,4455,4459],{"type":332,"tag":585,"props":4447,"children":4448},{"style":639},[4449],{"type":341,"value":4276},{"type":332,"tag":585,"props":4451,"children":4452},{"style":645},[4453],{"type":341,"value":4454}," sub",{"type":332,"tag":585,"props":4456,"children":4457},{"style":639},[4458],{"type":341,"value":653},{"type":332,"tag":585,"props":4460,"children":4461},{"style":662},[4462],{"type":341,"value":4290},{"type":332,"tag":585,"props":4464,"children":4466},{"class":587,"line":4465},219,[4467,4471,4475,4480,4485,4489,4494,4499,4503,4508],{"type":332,"tag":585,"props":4468,"children":4469},{"style":662},[4470],{"type":341,"value":4387},{"type":332,"tag":585,"props":4472,"children":4473},{"style":639},[4474],{"type":341,"value":3745},{"type":332,"tag":585,"props":4476,"children":4477},{"style":639},[4478],{"type":341,"value":4479}," typeof",{"type":332,"tag":585,"props":4481,"children":4482},{"style":662},[4483],{"type":341,"value":4484}," sub.customer ",{"type":332,"tag":585,"props":4486,"children":4487},{"style":639},[4488],{"type":341,"value":3862},{"type":332,"tag":585,"props":4490,"children":4491},{"style":668},[4492],{"type":341,"value":4493}," \"string\"",{"type":332,"tag":585,"props":4495,"children":4496},{"style":639},[4497],{"type":341,"value":4498}," ?",{"type":332,"tag":585,"props":4500,"children":4501},{"style":662},[4502],{"type":341,"value":4484},{"type":332,"tag":585,"props":4504,"children":4505},{"style":639},[4506],{"type":341,"value":4507},":",{"type":332,"tag":585,"props":4509,"children":4510},{"style":662},[4511],{"type":341,"value":4512}," sub.customer.id\n",{"type":332,"tag":585,"props":4514,"children":4516},{"class":587,"line":4515},220,[4517,4521,4526,4530,4534],{"type":332,"tag":585,"props":4518,"children":4519},{"style":639},[4520],{"type":341,"value":4276},{"type":332,"tag":585,"props":4522,"children":4523},{"style":645},[4524],{"type":341,"value":4525}," customer",{"type":332,"tag":585,"props":4527,"children":4528},{"style":639},[4529],{"type":341,"value":653},{"type":332,"tag":585,"props":4531,"children":4532},{"style":656},[4533],{"type":341,"value":2737},{"type":332,"tag":585,"props":4535,"children":4536},{"style":662},[4537],{"type":341,"value":4538},"(stripeCustomerId)\n",{"type":332,"tag":585,"props":4540,"children":4542},{"class":587,"line":4541},221,[4543,4547,4551,4555],{"type":332,"tag":585,"props":4544,"children":4545},{"style":639},[4546],{"type":341,"value":4299},{"type":332,"tag":585,"props":4548,"children":4549},{"style":662},[4550],{"type":341,"value":1786},{"type":332,"tag":585,"props":4552,"children":4553},{"style":639},[4554],{"type":341,"value":1791},{"type":332,"tag":585,"props":4556,"children":4557},{"style":662},[4558],{"type":341,"value":4559},"customer.email) {\n",{"type":332,"tag":585,"props":4561,"children":4563},{"class":587,"line":4562},222,[4564,4569,4573,4577,4581,4586],{"type":332,"tag":585,"props":4565,"children":4566},{"style":639},[4567],{"type":341,"value":4568},"      return",{"type":332,"tag":585,"props":4570,"children":4571},{"style":662},[4572],{"type":341,"value":4322},{"type":332,"tag":585,"props":4574,"children":4575},{"style":668},[4576],{"type":341,"value":4327},{"type":332,"tag":585,"props":4578,"children":4579},{"style":662},[4580],{"type":341,"value":4332},{"type":332,"tag":585,"props":4582,"children":4583},{"style":668},[4584],{"type":341,"value":4585},"\"stripe_customer_has_no_email\"",{"type":332,"tag":585,"props":4587,"children":4588},{"style":662},[4589],{"type":341,"value":4342},{"type":332,"tag":585,"props":4591,"children":4593},{"class":587,"line":4592},223,[4594],{"type":332,"tag":585,"props":4595,"children":4596},{"style":662},[4597],{"type":341,"value":1079},{"type":332,"tag":585,"props":4599,"children":4601},{"class":587,"line":4600},224,[4602,4606,4610],{"type":332,"tag":585,"props":4603,"children":4604},{"style":662},[4605],{"type":341,"value":4351},{"type":332,"tag":585,"props":4607,"children":4608},{"style":639},[4609],{"type":341,"value":3745},{"type":332,"tag":585,"props":4611,"children":4612},{"style":662},[4613],{"type":341,"value":4614}," customer.email\n",{"type":332,"tag":585,"props":4616,"children":4618},{"class":587,"line":4617},225,[4619,4623,4627],{"type":332,"tag":585,"props":4620,"children":4621},{"style":662},[4622],{"type":341,"value":4369},{"type":332,"tag":585,"props":4624,"children":4625},{"style":639},[4626],{"type":341,"value":3745},{"type":332,"tag":585,"props":4628,"children":4629},{"style":662},[4630],{"type":341,"value":4631}," customer.name\n",{"type":332,"tag":585,"props":4633,"children":4635},{"class":587,"line":4634},226,[4636,4640,4644,4648,4653],{"type":332,"tag":585,"props":4637,"children":4638},{"style":639},[4639],{"type":341,"value":4299},{"type":332,"tag":585,"props":4641,"children":4642},{"style":662},[4643],{"type":341,"value":4245},{"type":332,"tag":585,"props":4645,"children":4646},{"style":639},[4647],{"type":341,"value":3862},{"type":332,"tag":585,"props":4649,"children":4650},{"style":668},[4651],{"type":341,"value":4652}," \"customer.subscription.deleted\"",{"type":332,"tag":585,"props":4654,"children":4655},{"style":662},[4656],{"type":341,"value":1365},{"type":332,"tag":585,"props":4658,"children":4660},{"class":587,"line":4659},227,[4661,4666,4670],{"type":332,"tag":585,"props":4662,"children":4663},{"style":662},[4664],{"type":341,"value":4665},"      tier ",{"type":332,"tag":585,"props":4667,"children":4668},{"style":639},[4669],{"type":341,"value":3745},{"type":332,"tag":585,"props":4671,"children":4672},{"style":668},[4673],{"type":341,"value":4414},{"type":332,"tag":585,"props":4675,"children":4677},{"class":587,"line":4676},228,[4678,4683,4687,4692,4696,4701,4705,4709,4714,4718,4722,4726],{"type":332,"tag":585,"props":4679,"children":4680},{"style":662},[4681],{"type":341,"value":4682},"    } ",{"type":332,"tag":585,"props":4684,"children":4685},{"style":639},[4686],{"type":341,"value":4428},{"type":332,"tag":585,"props":4688,"children":4689},{"style":639},[4690],{"type":341,"value":4691}," if",{"type":332,"tag":585,"props":4693,"children":4694},{"style":662},[4695],{"type":341,"value":1786},{"type":332,"tag":585,"props":4697,"children":4698},{"style":645},[4699],{"type":341,"value":4700},"PAID_STATUSES",{"type":332,"tag":585,"props":4702,"children":4703},{"style":662},[4704],{"type":341,"value":523},{"type":332,"tag":585,"props":4706,"children":4707},{"style":656},[4708],{"type":341,"value":3852},{"type":332,"tag":585,"props":4710,"children":4711},{"style":662},[4712],{"type":341,"value":4713},"(sub.status) ",{"type":332,"tag":585,"props":4715,"children":4716},{"style":639},[4717],{"type":341,"value":1537},{"type":332,"tag":585,"props":4719,"children":4720},{"style":639},[4721],{"type":341,"value":3867},{"type":332,"tag":585,"props":4723,"children":4724},{"style":645},[4725],{"type":341,"value":3271},{"type":332,"tag":585,"props":4727,"children":4728},{"style":662},[4729],{"type":341,"value":1365},{"type":332,"tag":585,"props":4731,"children":4733},{"class":587,"line":4732},229,[4734,4738,4742],{"type":332,"tag":585,"props":4735,"children":4736},{"style":662},[4737],{"type":341,"value":4665},{"type":332,"tag":585,"props":4739,"children":4740},{"style":639},[4741],{"type":341,"value":3745},{"type":332,"tag":585,"props":4743,"children":4744},{"style":668},[4745],{"type":341,"value":4746}," \"paid\"\n",{"type":332,"tag":585,"props":4748,"children":4750},{"class":587,"line":4749},230,[4751,4755,4759],{"type":332,"tag":585,"props":4752,"children":4753},{"style":662},[4754],{"type":341,"value":4682},{"type":332,"tag":585,"props":4756,"children":4757},{"style":639},[4758],{"type":341,"value":4428},{"type":332,"tag":585,"props":4760,"children":4761},{"style":662},[4762],{"type":341,"value":3731},{"type":332,"tag":585,"props":4764,"children":4766},{"class":587,"line":4765},231,[4767,4771,4775],{"type":332,"tag":585,"props":4768,"children":4769},{"style":662},[4770],{"type":341,"value":4665},{"type":332,"tag":585,"props":4772,"children":4773},{"style":639},[4774],{"type":341,"value":3745},{"type":332,"tag":585,"props":4776,"children":4777},{"style":668},[4778],{"type":341,"value":4414},{"type":332,"tag":585,"props":4780,"children":4782},{"class":587,"line":4781},232,[4783],{"type":332,"tag":585,"props":4784,"children":4785},{"style":662},[4786],{"type":341,"value":1079},{"type":332,"tag":585,"props":4788,"children":4790},{"class":587,"line":4789},233,[4791],{"type":332,"tag":585,"props":4792,"children":4793},{"style":662},[4794],{"type":341,"value":1611},{"type":332,"tag":585,"props":4796,"children":4798},{"class":587,"line":4797},234,[4799],{"type":332,"tag":585,"props":4800,"children":4801},{"emptyLinePlaceholder":620},[4802],{"type":341,"value":623},{"type":332,"tag":585,"props":4804,"children":4806},{"class":587,"line":4805},235,[4807,4811,4816,4820,4825,4829,4834,4838,4843,4848],{"type":332,"tag":585,"props":4808,"children":4809},{"style":639},[4810],{"type":341,"value":1374},{"type":332,"tag":585,"props":4812,"children":4813},{"style":645},[4814],{"type":341,"value":4815}," action",{"type":332,"tag":585,"props":4817,"children":4818},{"style":639},[4819],{"type":341,"value":653},{"type":332,"tag":585,"props":4821,"children":4822},{"style":662},[4823],{"type":341,"value":4824}," tier ",{"type":332,"tag":585,"props":4826,"children":4827},{"style":639},[4828],{"type":341,"value":3862},{"type":332,"tag":585,"props":4830,"children":4831},{"style":668},[4832],{"type":341,"value":4833}," \"paid\"",{"type":332,"tag":585,"props":4835,"children":4836},{"style":639},[4837],{"type":341,"value":4498},{"type":332,"tag":585,"props":4839,"children":4840},{"style":668},[4841],{"type":341,"value":4842}," \"set_paid\"",{"type":332,"tag":585,"props":4844,"children":4845},{"style":639},[4846],{"type":341,"value":4847}," :",{"type":332,"tag":585,"props":4849,"children":4850},{"style":668},[4851],{"type":341,"value":4852}," \"set_free\"\n",{"type":332,"tag":585,"props":4854,"children":4856},{"class":587,"line":4855},236,[4857],{"type":332,"tag":585,"props":4858,"children":4859},{"emptyLinePlaceholder":620},[4860],{"type":341,"value":623},{"type":332,"tag":585,"props":4862,"children":4864},{"class":587,"line":4863},237,[4865],{"type":332,"tag":585,"props":4866,"children":4867},{"style":592},[4868],{"type":341,"value":4869},"  // DRY_RUN unset or \"true\" = log only; set DRY_RUN=false to write to Plain.\n",{"type":332,"tag":585,"props":4871,"children":4873},{"class":587,"line":4872},238,[4874,4878,4883,4888,4892,4897,4901,4905,4910],{"type":332,"tag":585,"props":4875,"children":4876},{"style":639},[4877],{"type":341,"value":1527},{"type":332,"tag":585,"props":4879,"children":4880},{"style":662},[4881],{"type":341,"value":4882}," (cfg.",{"type":332,"tag":585,"props":4884,"children":4885},{"style":656},[4886],{"type":341,"value":4887},"get",{"type":332,"tag":585,"props":4889,"children":4890},{"style":662},[4891],{"type":341,"value":665},{"type":332,"tag":585,"props":4893,"children":4894},{"style":668},[4895],{"type":341,"value":4896},"\"DRY_RUN\"",{"type":332,"tag":585,"props":4898,"children":4899},{"style":662},[4900],{"type":341,"value":676},{"type":332,"tag":585,"props":4902,"children":4903},{"style":639},[4904],{"type":341,"value":1537},{"type":332,"tag":585,"props":4906,"children":4907},{"style":668},[4908],{"type":341,"value":4909}," \"false\"",{"type":332,"tag":585,"props":4911,"children":4912},{"style":662},[4913],{"type":341,"value":1365},{"type":332,"tag":585,"props":4915,"children":4917},{"class":587,"line":4916},239,[4918,4923,4928,4933],{"type":332,"tag":585,"props":4919,"children":4920},{"style":639},[4921],{"type":341,"value":4922},"    return",{"type":332,"tag":585,"props":4924,"children":4925},{"style":662},[4926],{"type":341,"value":4927}," { action: action, email: email, reason: ",{"type":332,"tag":585,"props":4929,"children":4930},{"style":668},[4931],{"type":341,"value":4932},"\"dry_run\"",{"type":332,"tag":585,"props":4934,"children":4935},{"style":662},[4936],{"type":341,"value":4342},{"type":332,"tag":585,"props":4938,"children":4940},{"class":587,"line":4939},240,[4941],{"type":332,"tag":585,"props":4942,"children":4943},{"style":662},[4944],{"type":341,"value":1611},{"type":332,"tag":585,"props":4946,"children":4948},{"class":587,"line":4947},241,[4949],{"type":332,"tag":585,"props":4950,"children":4951},{"emptyLinePlaceholder":620},[4952],{"type":341,"value":623},{"type":332,"tag":585,"props":4954,"children":4956},{"class":587,"line":4955},242,[4957,4961,4966,4970,4974],{"type":332,"tag":585,"props":4958,"children":4959},{"style":639},[4960],{"type":341,"value":1374},{"type":332,"tag":585,"props":4962,"children":4963},{"style":645},[4964],{"type":341,"value":4965}," customerId",{"type":332,"tag":585,"props":4967,"children":4968},{"style":639},[4969],{"type":341,"value":653},{"type":332,"tag":585,"props":4971,"children":4972},{"style":656},[4973],{"type":341,"value":1867},{"type":332,"tag":585,"props":4975,"children":4976},{"style":662},[4977],{"type":341,"value":4978},"(email, name, stripeCustomerId)\n",{"type":332,"tag":585,"props":4980,"children":4982},{"class":587,"line":4981},243,[4983,4987,4992,4996,5000],{"type":332,"tag":585,"props":4984,"children":4985},{"style":639},[4986],{"type":341,"value":1374},{"type":332,"tag":585,"props":4988,"children":4989},{"style":645},[4990],{"type":341,"value":4991}," tenantId",{"type":332,"tag":585,"props":4993,"children":4994},{"style":639},[4995],{"type":341,"value":653},{"type":332,"tag":585,"props":4997,"children":4998},{"style":656},[4999],{"type":341,"value":2137},{"type":332,"tag":585,"props":5001,"children":5002},{"style":662},[5003],{"type":341,"value":5004},"(stripeCustomerId, email)\n",{"type":332,"tag":585,"props":5006,"children":5008},{"class":587,"line":5007},244,[5009,5013,5018,5022,5026],{"type":332,"tag":585,"props":5010,"children":5011},{"style":639},[5012],{"type":341,"value":1527},{"type":332,"tag":585,"props":5014,"children":5015},{"style":662},[5016],{"type":341,"value":5017}," (tier ",{"type":332,"tag":585,"props":5019,"children":5020},{"style":639},[5021],{"type":341,"value":3862},{"type":332,"tag":585,"props":5023,"children":5024},{"style":668},[5025],{"type":341,"value":4833},{"type":332,"tag":585,"props":5027,"children":5028},{"style":662},[5029],{"type":341,"value":1365},{"type":332,"tag":585,"props":5031,"children":5033},{"class":587,"line":5032},245,[5034,5039,5044,5048,5052,5057],{"type":332,"tag":585,"props":5035,"children":5036},{"style":656},[5037],{"type":341,"value":5038},"    setPlainTenantTier",{"type":332,"tag":585,"props":5040,"children":5041},{"style":662},[5042],{"type":341,"value":5043},"(tenantId, cfg.",{"type":332,"tag":585,"props":5045,"children":5046},{"style":656},[5047],{"type":341,"value":4887},{"type":332,"tag":585,"props":5049,"children":5050},{"style":662},[5051],{"type":341,"value":665},{"type":332,"tag":585,"props":5053,"children":5054},{"style":668},[5055],{"type":341,"value":5056},"\"PLAIN_PAID_TIER_ID\"",{"type":332,"tag":585,"props":5058,"children":5059},{"style":662},[5060],{"type":341,"value":1765},{"type":332,"tag":585,"props":5062,"children":5064},{"class":587,"line":5063},246,[5065,5069,5073],{"type":332,"tag":585,"props":5066,"children":5067},{"style":662},[5068],{"type":341,"value":4423},{"type":332,"tag":585,"props":5070,"children":5071},{"style":639},[5072],{"type":341,"value":4428},{"type":332,"tag":585,"props":5074,"children":5075},{"style":662},[5076],{"type":341,"value":3731},{"type":332,"tag":585,"props":5078,"children":5080},{"class":587,"line":5079},247,[5081,5086],{"type":332,"tag":585,"props":5082,"children":5083},{"style":656},[5084],{"type":341,"value":5085},"    clearPlainTenantTier",{"type":332,"tag":585,"props":5087,"children":5088},{"style":662},[5089],{"type":341,"value":5090},"(tenantId)\n",{"type":332,"tag":585,"props":5092,"children":5094},{"class":587,"line":5093},248,[5095],{"type":332,"tag":585,"props":5096,"children":5097},{"style":662},[5098],{"type":341,"value":1611},{"type":332,"tag":585,"props":5100,"children":5102},{"class":587,"line":5101},249,[5103,5108],{"type":332,"tag":585,"props":5104,"children":5105},{"style":656},[5106],{"type":341,"value":5107},"  linkPlainCustomerToTenant",{"type":332,"tag":585,"props":5109,"children":5110},{"style":662},[5111],{"type":341,"value":5112},"(customerId, tenantId)\n",{"type":332,"tag":585,"props":5114,"children":5116},{"class":587,"line":5115},250,[5117],{"type":332,"tag":585,"props":5118,"children":5119},{"emptyLinePlaceholder":620},[5120],{"type":341,"value":623},{"type":332,"tag":585,"props":5122,"children":5124},{"class":587,"line":5123},251,[5125,5129],{"type":332,"tag":585,"props":5126,"children":5127},{"style":639},[5128],{"type":341,"value":1832},{"type":332,"tag":585,"props":5130,"children":5131},{"style":662},[5132],{"type":341,"value":5133}," { action: action, email: email, plain_customer_id: customerId }\n",{"type":332,"tag":585,"props":5135,"children":5137},{"class":587,"line":5136},252,[5138],{"type":332,"tag":585,"props":5139,"children":5140},{"style":662},[5141],{"type":341,"value":1846},{"type":332,"tag":333,"props":5143,"children":5144},{},[5145,5147,5152],{"type":341,"value":5146},"Notes on the APIs used, all covered in the ",{"type":332,"tag":372,"props":5148,"children":5149},{"href":268},[5150],{"type":341,"value":5151},"functions reference",{"type":341,"value":4507},{"type":332,"tag":5154,"props":5155,"children":5156},"ul",{},[5157,5176,5201,5226,5237],{"type":332,"tag":5158,"props":5159,"children":5160},"li",{},[5161,5167,5169,5174],{"type":332,"tag":383,"props":5162,"children":5164},{"className":5163},[],[5165],{"type":341,"value":5166},"require(\"secret:...\")",{"type":341,"value":5168}," resolves ",{"type":332,"tag":372,"props":5170,"children":5171},{"href":92},[5172],{"type":341,"value":5173},"secret connections",{"type":341,"value":5175}," before the code runs; an unbound alias fails fast.",{"type":332,"tag":5158,"props":5177,"children":5178},{},[5179,5185,5187,5193,5195,5200],{"type":332,"tag":383,"props":5180,"children":5182},{"className":5181},[],[5183],{"type":341,"value":5184},"http.request",{"type":341,"value":5186}," is synchronous and returns ",{"type":332,"tag":383,"props":5188,"children":5190},{"className":5189},[],[5191],{"type":341,"value":5192},"{ body, status_code, headers }",{"type":341,"value":5194}," — see ",{"type":332,"tag":372,"props":5196,"children":5197},{"href":221},[5198],{"type":341,"value":5199},"make HTTP requests",{"type":341,"value":523},{"type":332,"tag":5158,"props":5202,"children":5203},{},[5204,5210,5212,5218,5220,5225],{"type":332,"tag":383,"props":5205,"children":5207},{"className":5206},[],[5208],{"type":341,"value":5209},"crypto.hmac(\"sha256\", key, message)",{"type":341,"value":5211}," returns a hex digest, matching Stripe's ",{"type":332,"tag":383,"props":5213,"children":5215},{"className":5214},[],[5216],{"type":341,"value":5217},"v1=",{"type":341,"value":5219}," signature — see ",{"type":332,"tag":372,"props":5221,"children":5222},{"href":239},[5223],{"type":341,"value":5224},"crypto functions",{"type":341,"value":523},{"type":332,"tag":5158,"props":5227,"children":5228},{},[5229,5235],{"type":332,"tag":383,"props":5230,"children":5232},{"className":5231},[],[5233],{"type":341,"value":5234},"time.unix()",{"type":341,"value":5236}," gives the current Unix time in seconds for the tolerance check.",{"type":332,"tag":5158,"props":5238,"children":5239},{},[5240,5246,5248,5253,5254,5259,5260,5265,5267,5273],{"type":332,"tag":383,"props":5241,"children":5243},{"className":5242},[],[5244],{"type":341,"value":5245},"answer()",{"type":341,"value":5247}," uses ",{"type":332,"tag":372,"props":5249,"children":5250},{"href":212},[5251],{"type":341,"value":5252},"response control",{"type":341,"value":1786},{"type":332,"tag":383,"props":5255,"children":5257},{"className":5256},[],[5258],{"type":341,"value":3027},{"type":341,"value":3229},{"type":332,"tag":383,"props":5261,"children":5263},{"className":5262},[],[5264],{"type":341,"value":3079},{"type":341,"value":5266},") plus ",{"type":332,"tag":383,"props":5268,"children":5270},{"className":5269},[],[5271],{"type":341,"value":5272},"r.stopForwarding()",{"type":341,"value":5274},", so Stripe is answered by the input itself.",{"type":332,"tag":360,"props":5276,"children":5278},{"id":5277},"_4-attach-the-function-to-the-input",[5279],{"type":341,"value":5280},"4. Attach the function to the input",{"type":332,"tag":333,"props":5282,"children":5283},{},[5284,5286,5291,5293,5298],{"type":341,"value":5285},"Open the ",{"type":332,"tag":383,"props":5287,"children":5289},{"className":5288},[],[5290],{"type":341,"value":388},{"type":341,"value":5292}," bucket, find the input's settings and select ",{"type":332,"tag":383,"props":5294,"children":5296},{"className":5295},[],[5297],{"type":341,"value":549},{"type":341,"value":5299}," as its function. An input-attached function is required here: functions attached to an output cannot customize the response returned to Stripe.",{"type":332,"tag":360,"props":5301,"children":5303},{"id":5302},"_5-point-stripe-at-the-bucket",[5304],{"type":341,"value":5305},"5. Point Stripe at the bucket",{"type":332,"tag":333,"props":5307,"children":5308},{},[5309,5311,5318],{"type":341,"value":5310},"In the ",{"type":332,"tag":372,"props":5312,"children":5315},{"href":5313,"rel":5314},"https://dashboard.stripe.com/webhooks",[376],[5316],{"type":341,"value":5317},"Stripe dashboard",{"type":341,"value":5319}," add a webhook endpoint with the bucket's input URL and subscribe to the events the function handles:",{"type":332,"tag":5154,"props":5321,"children":5322},{},[5323,5332,5341,5350],{"type":332,"tag":5158,"props":5324,"children":5325},{},[5326],{"type":332,"tag":383,"props":5327,"children":5329},{"className":5328},[],[5330],{"type":341,"value":5331},"customer.created",{"type":332,"tag":5158,"props":5333,"children":5334},{},[5335],{"type":332,"tag":383,"props":5336,"children":5338},{"className":5337},[],[5339],{"type":341,"value":5340},"customer.subscription.created",{"type":332,"tag":5158,"props":5342,"children":5343},{},[5344],{"type":332,"tag":383,"props":5345,"children":5347},{"className":5346},[],[5348],{"type":341,"value":5349},"customer.subscription.updated",{"type":332,"tag":5158,"props":5351,"children":5352},{},[5353],{"type":332,"tag":383,"props":5354,"children":5356},{"className":5355},[],[5357],{"type":341,"value":5358},"customer.subscription.deleted",{"type":332,"tag":333,"props":5360,"children":5361},{},[5362,5364,5369,5371,5376,5378,5384,5386,5392],{"type":341,"value":5363},"Stripe shows you the signing secret (",{"type":332,"tag":383,"props":5365,"children":5367},{"className":5366},[],[5368],{"type":341,"value":476},{"type":341,"value":5370},") for this endpoint — that is the value for the ",{"type":332,"tag":383,"props":5372,"children":5374},{"className":5373},[],[5375],{"type":341,"value":465},{"type":341,"value":5377}," binding. For testing against your live account first, the same flow works with a ",{"type":332,"tag":372,"props":5379,"children":5381},{"href":5380},"/blog/stripe-cli-alternative",[5382],{"type":341,"value":5383},"Stripe CLI alternative",{"type":341,"value":5385}," or a ",{"type":332,"tag":372,"props":5387,"children":5389},{"href":5388},"/blog/receiving-stripe-webhooks-localhost",[5390],{"type":341,"value":5391},"local receiver",{"type":341,"value":523},{"type":332,"tag":360,"props":5394,"children":5396},{"id":5395},"_6-test-it-dry-run-first",[5397],{"type":341,"value":5398},"6. Test it, dry run first",{"type":332,"tag":333,"props":5400,"children":5401},{},[5402,5404,5410,5412,5418],{"type":341,"value":5403},"The function ships safe by default: with ",{"type":332,"tag":383,"props":5405,"children":5407},{"className":5406},[],[5408],{"type":341,"value":5409},"DRY_RUN",{"type":341,"value":5411}," unset it only logs what it would do. In the function editor (or with ",{"type":332,"tag":383,"props":5413,"children":5415},{"className":5414},[],[5416],{"type":341,"value":5417},"relay function invoke",{"type":341,"value":5419},"), send a sample subscription event and check the logs — you should see:",{"type":332,"tag":575,"props":5421,"children":5425},{"className":5422,"code":5423,"language":5424,"meta":306,"style":306},"language-json shiki shiki-themes github-dark","{ \"action\": \"set_paid\", \"email\": \"ada@example.com\", \"reason\": \"dry_run\" }\n","json",[5426],{"type":332,"tag":383,"props":5427,"children":5428},{"__ignoreMap":306},[5429],{"type":332,"tag":585,"props":5430,"children":5431},{"class":587,"line":588},[5432,5437,5442,5446,5451,5455,5460,5464,5469,5473,5478,5482,5486],{"type":332,"tag":585,"props":5433,"children":5434},{"style":662},[5435],{"type":341,"value":5436},"{ ",{"type":332,"tag":585,"props":5438,"children":5439},{"style":645},[5440],{"type":341,"value":5441},"\"action\"",{"type":332,"tag":585,"props":5443,"children":5444},{"style":662},[5445],{"type":341,"value":1439},{"type":332,"tag":585,"props":5447,"children":5448},{"style":668},[5449],{"type":341,"value":5450},"\"set_paid\"",{"type":332,"tag":585,"props":5452,"children":5453},{"style":662},[5454],{"type":341,"value":889},{"type":332,"tag":585,"props":5456,"children":5457},{"style":645},[5458],{"type":341,"value":5459},"\"email\"",{"type":332,"tag":585,"props":5461,"children":5462},{"style":662},[5463],{"type":341,"value":1439},{"type":332,"tag":585,"props":5465,"children":5466},{"style":668},[5467],{"type":341,"value":5468},"\"ada@example.com\"",{"type":332,"tag":585,"props":5470,"children":5471},{"style":662},[5472],{"type":341,"value":889},{"type":332,"tag":585,"props":5474,"children":5475},{"style":645},[5476],{"type":341,"value":5477},"\"reason\"",{"type":332,"tag":585,"props":5479,"children":5480},{"style":662},[5481],{"type":341,"value":1439},{"type":332,"tag":585,"props":5483,"children":5484},{"style":668},[5485],{"type":341,"value":4932},{"type":332,"tag":585,"props":5487,"children":5488},{"style":662},[5489],{"type":341,"value":4342},{"type":332,"tag":333,"props":5491,"children":5492},{},[5493,5495,5501,5503,5508,5510,5515],{"type":341,"value":5494},"Then set ",{"type":332,"tag":383,"props":5496,"children":5498},{"className":5497},[],[5499],{"type":341,"value":5500},"PLAIN_PAID_TIER_ID",{"type":341,"value":5502}," in the function's config, flip ",{"type":332,"tag":383,"props":5504,"children":5506},{"className":5505},[],[5507],{"type":341,"value":5409},{"type":341,"value":5509}," to ",{"type":332,"tag":383,"props":5511,"children":5513},{"className":5512},[],[5514],{"type":341,"value":1992},{"type":341,"value":5516},", and trigger a real event (for example toggle a test subscription in Stripe). The customer appears in Plain, the tenant is created with the Stripe customer ID as its external ID, and the paid tier is set. In the bucket's request log you can open any past delivery and replay it — the Plain mutations are upserts, so a replay converges to the same state instead of duplicating anything.",{"type":332,"tag":360,"props":5518,"children":5520},{"id":5519},"what-each-event-does",[5521],{"type":341,"value":5522},"What each event does",{"type":332,"tag":427,"props":5524,"children":5525},{},[5526,5542],{"type":332,"tag":431,"props":5527,"children":5528},{},[5529],{"type":332,"tag":435,"props":5530,"children":5531},{},[5532,5537],{"type":332,"tag":439,"props":5533,"children":5534},{},[5535],{"type":341,"value":5536},"Stripe event",{"type":332,"tag":439,"props":5538,"children":5539},{},[5540],{"type":341,"value":5541},"Plain effect",{"type":332,"tag":450,"props":5543,"children":5544},{},[5545,5561,5613,5646,5661],{"type":332,"tag":435,"props":5546,"children":5547},{},[5548,5556],{"type":332,"tag":457,"props":5549,"children":5550},{},[5551],{"type":332,"tag":383,"props":5552,"children":5554},{"className":5553},[],[5555],{"type":341,"value":5331},{"type":332,"tag":457,"props":5557,"children":5558},{},[5559],{"type":341,"value":5560},"Customer upserted by email, tenant created (external ID = Stripe customer ID), tier cleared (free)",{"type":332,"tag":435,"props":5562,"children":5563},{},[5564,5603],{"type":332,"tag":457,"props":5565,"children":5566},{},[5567,5572,5574,5580,5582,5588,5589,5595,5597],{"type":332,"tag":383,"props":5568,"children":5570},{"className":5569},[],[5571],{"type":341,"value":5340},{"type":341,"value":5573}," / ",{"type":332,"tag":383,"props":5575,"children":5577},{"className":5576},[],[5578],{"type":341,"value":5579},".updated",{"type":341,"value":5581}," with status ",{"type":332,"tag":383,"props":5583,"children":5585},{"className":5584},[],[5586],{"type":341,"value":5587},"active",{"type":341,"value":889},{"type":332,"tag":383,"props":5590,"children":5592},{"className":5591},[],[5593],{"type":341,"value":5594},"trialing",{"type":341,"value":5596}," or ",{"type":332,"tag":383,"props":5598,"children":5600},{"className":5599},[],[5601],{"type":341,"value":5602},"past_due",{"type":332,"tag":457,"props":5604,"children":5605},{},[5606,5608],{"type":341,"value":5607},"Customer + tenant upserted, ",{"type":332,"tag":337,"props":5609,"children":5610},{},[5611],{"type":341,"value":5612},"paid tier set",{"type":332,"tag":435,"props":5614,"children":5615},{},[5616,5641],{"type":332,"tag":457,"props":5617,"children":5618},{},[5619,5624,5626,5632,5633,5639],{"type":332,"tag":383,"props":5620,"children":5622},{"className":5621},[],[5623],{"type":341,"value":5349},{"type":341,"value":5625}," with any other status (",{"type":332,"tag":383,"props":5627,"children":5629},{"className":5628},[],[5630],{"type":341,"value":5631},"unpaid",{"type":341,"value":889},{"type":332,"tag":383,"props":5634,"children":5636},{"className":5635},[],[5637],{"type":341,"value":5638},"canceled",{"type":341,"value":5640},", ...)",{"type":332,"tag":457,"props":5642,"children":5643},{},[5644],{"type":341,"value":5645},"Tier cleared",{"type":332,"tag":435,"props":5647,"children":5648},{},[5649,5657],{"type":332,"tag":457,"props":5650,"children":5651},{},[5652],{"type":332,"tag":383,"props":5653,"children":5655},{"className":5654},[],[5656],{"type":341,"value":5358},{"type":332,"tag":457,"props":5658,"children":5659},{},[5660],{"type":341,"value":5645},{"type":332,"tag":435,"props":5662,"children":5663},{},[5664,5669],{"type":332,"tag":457,"props":5665,"children":5666},{},[5667],{"type":341,"value":5668},"Any other event",{"type":332,"tag":457,"props":5670,"children":5671},{},[5672,5677],{"type":332,"tag":383,"props":5673,"children":5675},{"className":5674},[],[5676],{"type":341,"value":3892},{"type":341,"value":5678}," to Stripe, nothing synced",{"type":332,"tag":360,"props":5680,"children":5682},{"id":5681},"why-this-beats-a-worker-for-this-job",[5683],{"type":341,"value":5684},"Why this beats a worker for this job",{"type":332,"tag":5154,"props":5686,"children":5687},{},[5688,5698,5708,5724],{"type":332,"tag":5158,"props":5689,"children":5690},{},[5691,5696],{"type":332,"tag":337,"props":5692,"children":5693},{},[5694],{"type":341,"value":5695},"Nothing to deploy.",{"type":341,"value":5697}," The function lives next to the bucket; no CI, no wrangler, no worker URL to rotate.",{"type":332,"tag":5158,"props":5699,"children":5700},{},[5701,5706],{"type":332,"tag":337,"props":5702,"children":5703},{},[5704],{"type":341,"value":5705},"Every event is kept.",{"type":341,"value":5707}," Stripe deliveries land in the bucket's log with full request/response bodies, so you can audit and replay a missed sync — the upserts make replays safe.",{"type":332,"tag":5158,"props":5709,"children":5710},{},[5711,5716,5718,5722],{"type":332,"tag":337,"props":5712,"children":5713},{},[5714],{"type":341,"value":5715},"Secrets stay write-only.",{"type":341,"value":5717}," Credentials live in ",{"type":332,"tag":372,"props":5719,"children":5720},{"href":92},[5721],{"type":341,"value":5173},{"type":341,"value":5723},", not in source or environment variables that leak into logs.",{"type":332,"tag":5158,"props":5725,"children":5726},{},[5727,5732],{"type":332,"tag":337,"props":5728,"children":5729},{},[5730],{"type":341,"value":5731},"Retries are handled for you.",{"type":341,"value":5733}," A Plain outage returns a 500 to Stripe, which retries; a recovered event replays from the log without waiting for Stripe.",{"type":332,"tag":333,"props":5735,"children":5736},{},[5737,5739,5744],{"type":341,"value":5738},"If you also want the raw events somewhere durable (a warehouse, a queue, an internal API), keep the bucket's input as-is and add an output per destination — the input function still answers Stripe, and each output can have its own ",{"type":332,"tag":372,"props":5740,"children":5741},{"href":262},[5742],{"type":341,"value":5743},"function or forwarding rules",{"type":341,"value":523},{"type":332,"tag":5746,"props":5747,"children":5748},"style",{},[5749],{"type":341,"value":5750},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":306,"searchDepth":607,"depth":607,"links":5752},[5753,5754,5755,5756,5757,5758,5759,5760],{"id":362,"depth":598,"text":365},{"id":401,"depth":598,"text":404},{"id":526,"depth":598,"text":529},{"id":5277,"depth":598,"text":5280},{"id":5302,"depth":598,"text":5305},{"id":5395,"depth":598,"text":5398},{"id":5519,"depth":598,"text":5522},{"id":5681,"depth":598,"text":5684},"markdown","content:docs:tutorials:transform:3.stripe-to-plain.md","content","docs/tutorials/transform/3.stripe-to-plain.md","docs/tutorials/transform/3.stripe-to-plain","md",{"loc":179},1790768392106]