const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/js/BlackGold-Psyol3Bg.js","assets/js/vendor-element-DhixKrWD.js","assets/js/vendor-core-k7kcNcJz.js","assets/css/vendor-core-BgDCIyLK.css","assets/css/vendor-element-bHUG51Ut.css","assets/js/SiteBrand.vue_vue_type_script_setup_true_lang-CRWWrRfI.js","assets/js/index-BLric5IS.js","assets/css/index-B4CfueHR.css","assets/js/logo-aA1Jln-Z.js","assets/js/knowledge-CuTZgwdW.js","assets/js/order-CbAwhV3F.js","assets/js/complaint-D0QpFWHn.js","assets/js/common-Cbte6Lkq.js","assets/js/format-BSrYeaol.js","assets/js/index-0CGjLwZk.js","assets/js/index-D_Q-sIMk.js","assets/js/index.vue_vue_type_script_setup_true_lang-Dnj11IW3.js","assets/js/vendor-icons-CkMBQOzK.js","assets/css/vendor-icons-D4_GzDKB.css","assets/css/index-BTvD56UT.css","assets/css/index-BIxkwO5H.css","assets/css/BlackGold-E7dmSYRK.css","assets/js/SpringFestival-DzGNpRXr.js","assets/css/SpringFestival-MuD7Ps6E.css","assets/js/Enterprise-AhbkYXrT.js","assets/js/ReceiptConfirmDialog.vue_vue_type_script_setup_true_lang-D17IUC02.js","assets/css/Enterprise-CT6z-cVl.css","assets/js/Default-BhsRsRQF.js"])))=>i.map(i=>d[i]);
var t=(t,e,r)=>new Promise((n,o)=>{var s=t=>{try{a(r.next(t))}catch(e){o(e)}},i=t=>{try{a(r.throw(t))}catch(e){o(e)}},a=t=>t.done?n(t.value):Promise.resolve(t.value).then(s,i);a((r=r.apply(t,e)).next())});import{a as e,u as r,_ as n}from"./index-BLric5IS.js";import{bE as o,bF as s,bG as i,t as a,c as l,E as d,J as c,x as u}from"./vendor-core-k7kcNcJz.js";import{_ as m}from"./logo-aA1Jln-Z.js";import"./vendor-element-DhixKrWD.js";const p={},f=(t,e,r)=>{const n=t.trim();if(!n)return"";const o=n.includes("<template")?n:`<template>${n}</template>`,s=e.trim()?`\n<style>${e}</style>`:"";if(!r.trim())return`${o}${s}`;var i;return`${o}${`\n<script setup lang="ts">\nimport { onMounted } from 'vue'\n${`\nonMounted(() => {\n  try {\n    const root = document.querySelector('[data-ext-theme-root]') || document.body\n    const fn = new Function('root', 'window', 'document', \`${i=r,String(i||"").replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}\`)\n    fn(root, window, document)\n  } catch (e) {\n    console.error('External theme runtime script failed:', e)\n  }\n})`}\n<\/script>`}${s}`},g=t=>{if(!t)return"";if(/^https?:\/\//i.test(t)||t.startsWith("data:"))return t;const e="undefined"!=typeof window?window.location.origin:"";if(t.startsWith("/src/")||t.startsWith("/assets/"))return e?`${e}${t}`:t;const r=String("").trim(),n=(()=>{if(!r)return e;try{return new URL(r,e||void 0).href}catch(t){return e}})();if(!n)return t.startsWith("/")?t:`/${t}`;try{return new URL(t,n).href}catch(o){return t.startsWith("/")?t:`/${t}`}},_=(t,e,r)=>{var n;const o=window.__ADVANCED_THEME_CONTEXT__||{},s=g(m),i=g(e.siteLogo||(null==(n=e.siteConfig)?void 0:n.site_logo)||"")||s,a={"{{siteName}}":e.siteName||"","{{siteLogo}}":i,"{{siteLogoImg}}":i?`<img src="${i}" alt="logo" />`:"","{{siteDescription}}":e.siteDescription||"","{{siteKeywords}}":e.siteKeywords||"","{{siteCopyright}}":e.siteCopyright||"","{{siteIcp}}":e.siteIcp||"","{{siteDianzeng}}":e.siteDianzeng||""};{const t=o.order||{};a["{{orderTradeNo}}"]=t.trade_no||"",a["{{orderStatus}}"]=t.status||"",a["{{orderAmount}}"]=t.amount||"",a["{{orderProductName}}"]=t.product_name||"",a["{{orderSearchWidget}}"]='\n<div class="order-search-widget" data-ext-order-widget>\n  <div class="flex flex-col gap-3">\n    <div class="flex flex-col sm:flex-row gap-2">\n      <input data-field="keyword" type="text" placeholder="请输入订单号或联系方式" class="flex-1 px-3 py-2 border rounded text-sm" />\n      <button data-action="submit" class="px-4 py-2 text-sm rounded bg-blue-600 text-white disabled:opacity-60" type="button">查询订单</button>\n    </div>\n    <div data-field="error" class="text-sm text-red-500"></div>\n    <div data-field="result" class="mt-4 space-y-3"></div>\n  </div>\n</div>'}let l=t;return Object.keys(a).forEach(t=>{const e=a[t];l=l.split(t).join(e)}),l},v=(r,n)=>t(null,null,function*(){const t=`${r}:${n}`;if(p[t])return p[t];try{const i=yield(o=r,s=n,e.get({url:"/api/theme/payload",params:{module:o,id:s}}));return p[t]=i||null,p[t]}catch(i){return p[t]=null,null}var o,s}),h=a({__name:"search",setup(e){const a=r(),m=l(()=>{const e=a.siteConfig.theme_order_query;return String(e||"").startsWith("ext_")?(l="order",d=e,o(()=>t(null,null,function*(){const t=r();yield t.fetchSiteConfig();const e=yield v(l,d),n=_(String((null==e?void 0:e.html)||""),t),o=_(String((null==e?void 0:e.css)||""),t),a=_(String((null==e?void 0:e.js)||""),t),c=`<div data-ext-theme-root>${n}</div>`;if(!n.trim()&&!o.trim()&&!a.trim())return{template:'<div class="p-10 text-center">Template content is empty or failed to load.</div>'};const u=f(c,o,a||""),m={moduleCache:{vue:i},getFile:()=>u,addStyle(t){const e=document.createElement("style");e.textContent=t;const r=document.head.getElementsByTagName("style")[0]||null;document.head.insertBefore(e,r)}};return yield s("custom.vue",m)}))):o("black_gold"===e?()=>n(()=>import("./BlackGold-Psyol3Bg.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])):"spring_festival"===e?()=>n(()=>import("./SpringFestival-DzGNpRXr.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,23])):"enterprise"===e?()=>n(()=>import("./Enterprise-AhbkYXrT.js"),__vite__mapDeps([24,1,2,3,4,5,6,7,8,25,12,10,14,15,16,17,18,19,20,9,11,13,26])):()=>n(()=>import("./Default-BhsRsRQF.js"),__vite__mapDeps([27,1,2,3,4,9,10,6,7,11,12,13,5,8,14,15,16,17,18,19,20])));var l,d});return(t,e)=>(u(),d(c(m.value)))}});export{h as default};
