PageSourceSearch

https://offeco.nl/_nuxt/DB0Wivvs.js

js offeco.nl collected 2026-10-08 12:16:20 UTC 6,278 bytes, 1 lines download raw bytes

1import{d as T,L as U,av as V,r as n,aA as D,J as I,c as l,b as t,p as h,a as _,l as s,aB as A,t as d,k as p,o as r,C as B,A as G,V as $,aC as F,q as b,z as W,an as q,n as H,F as j,s as z,W as J}from"./CQCWzu_E.js";import{_ as P}from"./8kffdZjT.js";import{u as Y}from"./iFftQvb0.js";import"./D53Ls7ng.js";const K={class:"boxed-content container py-10"},Q={class:"mx-auto max-w-3xl"},X={key:0,class:"mb-6 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-900",role:"alert"},Z={key:1,class:"mb-6 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-900",role:"alert"},ee=["disabled"],te={key:0,class:"mt-6 rounded-lg border border-asparagus-200 bg-asparagus-50 p-4"},se={class:"mb-3 break-all text-sm text-mine-shaft-700"},oe={class:"flex flex-wrap gap-3"},ae={key:0,class:"text-sm text-mine-shaft-600"},ne={key:1,class:"text-sm text-red-700",role:"alert"},re={key:2,class:"text-sm text-mine-shaft-600"},le={key:3,class:"overflow-x-auto"},de={class:"w-full text-left text-sm text-mine-shaft-600"},ie={class:"px-2 py-3"},ce={class:"font-medium text-mine-shaft-900"},ue={class:"mt-1 block text-xs text-mine-shaft-500"},pe={class:"px-2 py-3"},me={class:"mt-1 block text-xs text-mine-shaft-500"},xe={class:"px-2 py-3"},fe={class:"px-2 py-3"},be=["disabled","onClick"],Le=T({__name:"dev",setup(ge){const k=U().public.environment;if(!(k!=="production"&&k!=="prod"))throw V({statusCode:404,statusMessage:"Not found",fatal:!0});const c=n(""),u=n(""),w=n(""),m=n(!1),C=n(!0),g=n(""),i=n(""),x=n(!1),v=n(!1),f=n(""),y=n([]);Y({metaTitle:"Order view dev tools"}),D({meta:[{name:"robots",content:"noindex, nofollow"}]});async function L(o){return(await $fetch("/api/order/dev/link",{query:{orderId:o}})).url}async function E(){m.value=!0,v.value=!1;try{const o=await L(c.value.trim());u.value=o,w.value=new URL(o).pathname+new URL(o).search}catch(o){i.value=o?.data?.statusMessage||o?.statusMessage||"Could not generate order view link."}finally{m.value=!1}}async function O(o){f.value=o;try{const e=await L(o);await J(new URL(e).pathname+new URL(e).search)}catch(e){i.value=e?.data?.statusMessage||e?.statusMessage||"Could not generate order view link."}finally{f.value=""}}async function M(){!u.value||!navigator?.clipboard||(await navigator.clipboard.writeText(u.value),v.value=!0)}return I(async()=>{try{const o=await $fetch("/api/order/dev/status");if(x.value=o.configured,!o.configured)return;const e=await $fetch("/api/order/dev/recent");y.value=e.orders}catch(o){g.value=o?.data?.statusMessage||o?.statusMessage||"Could not load recent orders."}finally{C.value=!1}}),(o,e)=>{const N=q,S=H,R=P;return r(),l("div",K,[t("div",Q,[e[10]||(e[10]=t("p",{class:"mb-4 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900",role:"status"}," Development only — this page is not available in production. ",-1)),e[11]||(e[11]=t("h1",{class:"mb-2 text-2xl font-bold text-mine-shaft-900"},"Order view test links",-1)),e[12]||(e[12]=t("p",{class:"mb-8 text-sm text-mine-shaft-600"}," Generate a secure order view URL without setting up the confirmation email yet. ",-1)),s(x)?s(i)?(r(),l("div",Z,d(s(i)),1)):h("",!0):(r(),l("div",X,e[1]||(e[1]=[A('<p class="font-semibold">ORDER_VIEW_SECRET is not configured</p><p class="mt-2"> Add <code class="rounded bg-red-100 px-1">ORDER_VIEW_SECRET=your-secret</code> to your <code class="rounded bg-red-100 px-1">.env</code> file and restart <code class="rounded bg-red-100 px-1">npm run dev</code>. </p>',2)]))),_(R,{class:"mb-8"},{header:p(()=>e[2]||(e[2]=[b("Generate link by order ID")])),default:p(()=>[t("form",{class:"flex flex-col gap-4",onSubmit:B(E,["prevent"])},[t("div",null,[e[3]||(e[3]=t("label",{for:"order-id",class:"mb-1 block text-sm font-semibold text-mine-shaft-900"}," Shopware order ID ",-1)),G(t("input",{id:"order-id","onUpdate:modelValue":e[0]||(e[0]=a=>$(c)?c.value=a:null),type:"text",class:"w-full rounded-lg border border-mine-shaft-100 px-3 py-2 text-sm text-mine-shaft-900",placeholder:"32-character hex order id",autocomplete:"off",spellcheck:"false"},null,512),[[F,s(c)]]),e[4]||(e[4]=t("p",{class:"mt-1 text-xs text-mine-shaft-500"}," You can copy this from Shopware Admin → Orders → order details URL. ",-1))]),t("button",{type:"submit",class:"flex w-fit items-center justify-center gap-2 rounded-lg bg-asparagus-600 px-4 py-2 text-sm text-white transition-opacity hover:bg-asparagus-700 disabled:opacity-70",disabled:s(m)||!s(c).trim()||!s(x)||!!s(i)},[e[5]||(e[5]=b(" Generate link ")),s(m)?(r(),W(N,{key:0,class:"w-4 animate-spin"})):h("",!0)],8,ee)],32),s(u)?(r(),l("div",te,[e[7]||(e[7]=t("p",{class:"mb-2 text-sm font-semibold text-mine-shaft-900"},"Generated link",-1)),t("p",se,d(s(u)),1),t("div",oe,[t("button",{type:"button",class:"rounded-lg border border-asparagus-600 px-3 py-2 text-sm font-medium text-asparagus-700 hover:bg-asparagus-100",onClick:M},d(s(v)?"Copied":"Copy link"),1),_(S,{to:s(w),class:"rounded-lg bg-asparagus-600 px-3 py-2 text-sm font-medium text-white hover:bg-asparagus-700"},{default:p(()=>e[6]||(e[6]=[b(" Open order page ")])),_:1},8,["to"])])])):h("",!0)]),_:1}),_(R,null,{header:p(()=>e[8]||(e[8]=[b("Recent orders")])),default:p(()=>[s(C)?(r(),l("p",ae,"Loading recent orders…")):s(g)?(r(),l("p",ne,d(s(g)),1)):s(y).length===0?(r(),l("div",re," No recent orders found. ")):(r(),l("div",le,[t("table",de,[e[9]||(e[9]=t("thead",{class:"border-b border-mine-shaft-50 text-xs font-semibold text-asparagus-800"},[t("tr",null,[t("th",{scope:"col",class:"px-2 py-2"},"Order"),t("th",{scope:"col",class:"px-2 py-2"},"Customer"),t("th",{scope:"col",class:"px-2 py-2"},"Status"),t("th",{scope:"col",class:"px-2 py-2"},[t("span",{class:"sr-only"},"Actions")])])],-1)),t("tbody",null,[(r(!0),l(j,null,z(s(y),a=>(r(),l("tr",{key:a.id,class:"border-b border-mine-shaft-50 align-top"},[t("td",ie,[t("span",ce,d(a.orderNumber),1),t("span",ue,d(a.id),1)]),t("td",pe,[t("span",null,d(a.customerName),1),t("span",me,d(a.email),1)]),t("td",xe,d(a.status),1),t("td",fe,[t("button",{type:"button",class:"text-sail-600 underline hover:text-sail-700 disabled:opacity-60",disabled:!s(x)||!!s(i)||s(f)===a.id,onClick:he=>O(a.id)},d(s(f)===a.id?"Opening…":"Open test link"),9,be)])]))),128))])])]))]),_:1})])])}}});
1export{Le as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.