From 39ba5efd1b9b666abf9bc467d3b1f6ebfbf481d6 Mon Sep 17 00:00:00 2001 From: lapy Date: Mon, 12 Oct 2026 14:16:35 +0100 Subject: [PATCH] chore(web): rebuild vendored generator from translated source Regenerated from the westernized xiaozhi-assets-generator checkout: - code bundle is now Han-free (locales, toasts, log messages translated upstream) - built with relative base ./ so the console's /generator/ mount actually resolves its assets (upstream default /tools/assets-generator/ 404s there, matching upstream's older relative-path vendored copy) - static/ device data (charsets, fonts, emoji gifs, wakenet blobs) unchanged --- .../generator/assets/HomePage-2JWdk2sE.css | 1 - .../generator/assets/HomePage-BQbVVCiA.js | 19 ------------------- .../generator/assets/HomePage-C46hPw_t.js | 19 +++++++++++++++++++ .../generator/assets/HomePage-DL-rX2r7.css | 1 + .../generator/assets/index-CT_dZ65o.css | 1 - .../{index-E7j_fXTF.js => index-C_B_50-2.js} | 18 +++++++++--------- .../generator/assets/index-D3IPibb6.css | 1 + main/manager-web/public/generator/index.html | 5 ++--- 8 files changed, 32 insertions(+), 33 deletions(-) delete mode 100644 main/manager-web/public/generator/assets/HomePage-2JWdk2sE.css delete mode 100644 main/manager-web/public/generator/assets/HomePage-BQbVVCiA.js create mode 100644 main/manager-web/public/generator/assets/HomePage-C46hPw_t.js create mode 100644 main/manager-web/public/generator/assets/HomePage-DL-rX2r7.css delete mode 100644 main/manager-web/public/generator/assets/index-CT_dZ65o.css rename main/manager-web/public/generator/assets/{index-E7j_fXTF.js => index-C_B_50-2.js} (76%) create mode 100644 main/manager-web/public/generator/assets/index-D3IPibb6.css diff --git a/main/manager-web/public/generator/assets/HomePage-2JWdk2sE.css b/main/manager-web/public/generator/assets/HomePage-2JWdk2sE.css deleted file mode 100644 index 68c1d468f..000000000 --- a/main/manager-web/public/generator/assets/HomePage-2JWdk2sE.css +++ /dev/null @@ -1 +0,0 @@ -.emoji-container[data-v-38d663e6]{display:flex;align-items:center;justify-content:center}.emoji-image[data-v-38d663e6]{border-radius:8px;-o-object-fit:contain;object-fit:contain}.emoji-fallback[data-v-38d663e6]{display:flex;align-items:center;justify-content:center}.text-message[data-v-38d663e6]{line-height:1;word-wrap:break-word} diff --git a/main/manager-web/public/generator/assets/HomePage-BQbVVCiA.js b/main/manager-web/public/generator/assets/HomePage-BQbVVCiA.js deleted file mode 100644 index 802f93d43..000000000 --- a/main/manager-web/public/generator/assets/HomePage-BQbVVCiA.js +++ /dev/null @@ -1,19 +0,0 @@ -import{u as TA,r as j,w as DA,o as Me,a as G,c as U,b as s,t as d,d as fg,e as HA,f as wg,g as O,h as ig,i as nA,j as eA,n as nt,k as gA,F as bA,l as LA,m as rA,v as aA,p as Xe,q as PA,s as CA,x as UA,y as Bt,z as st,_ as aI,A as we}from"./index-E7j_fXTF.js";const QI={class:"space-y-6"},EI={class:"text-xl font-semibold text-gray-900 mb-4"},lI={class:"text-gray-600 mb-6"},cI={key:0},hI={key:1},uI={key:2},dI={key:0,class:"space-y-4"},fI={class:"bg-blue-50 border-2 border-blue-200 rounded-lg p-6"},wI={class:"flex items-center justify-center space-x-3"},yI={class:"text-lg font-medium text-blue-900"},pI={class:"text-sm text-blue-700 mt-1"},DI={key:1,class:"space-y-4"},mI={class:"bg-green-50 border-2 border-green-200 rounded-lg p-4"},FI={class:"flex items-start justify-between mb-3"},kI={class:"flex items-center"},vI={class:"text-lg font-medium text-green-900"},SI={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mt-4"},GI={class:"bg-white rounded-lg p-3"},RI={class:"block text-sm font-medium text-gray-700 mb-1"},UI={class:"text-base font-semibold text-gray-900"},NI={class:"bg-white rounded-lg p-3"},bI={class:"block text-sm font-medium text-gray-700 mb-1"},LI={class:"text-base font-semibold text-gray-900"},MI={class:"bg-white rounded-lg p-3"},JI={class:"block text-sm font-medium text-gray-700 mb-1"},xI={class:"text-base font-semibold text-gray-900"},HI={class:"mt-3 text-sm text-green-700"},YI={class:"border border-gray-200 rounded-lg p-4"},KI={key:0,class:"mt-4"},TI={key:2,class:"space-y-4"},VI={class:"bg-yellow-50 border border-yellow-200 rounded-lg p-4"},qI={class:"flex items-start"},OI={class:"font-medium text-yellow-900"},WI={class:"text-sm text-yellow-700 mt-1"},PI={class:"border-2 border-gray-300 rounded-lg p-4"},ZI={class:"text-lg font-medium text-gray-900 mb-4"},XI={class:"flex justify-end"},jI=["disabled"],zI={__name:"ChipConfig",props:{modelValue:{type:Object,default:()=>({model:"",display:{width:320,height:240,color:"RGB565"}})}},emits:["update:modelValue","next"],setup(e,{emit:A}){const{t:g}=TA(),t=A,I=nA(()=>[{value:"",label:g("chipConfig.selectChip")},{value:"esp32s3",label:"ESP32-S3"},{value:"esp32c3",label:"ESP32-C3"},{value:"esp32c5",label:"ESP32-C5"},{value:"esp32c6",label:"ESP32-C6"},{value:"esp32p4",label:"ESP32-P4"},{value:"esp32",label:"ESP32"},{value:"others",label:g("common.other")}]),o={name:"ConfigForm",props:{config:{type:Object,required:!0},showRequired:{type:Boolean,default:!1}},render(){const y=this.$t;return eA("div",{class:"grid grid-cols-1 md:grid-cols-3 gap-4"},[eA("div",[eA("label",{class:"block text-sm font-medium text-gray-700 mb-2"},[y("chipConfig.chipRequired")+" ",this.showRequired&&eA("span",{class:"text-red-500"},"*")]),eA("select",{class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500",value:this.config.model,onChange:v=>{this.config.model=v.target.value}},fg(I).map(v=>eA("option",{value:v.value,key:v.value},v.label)))]),eA("div",[eA("label",{class:"block text-sm font-medium text-gray-700 mb-2"},[y("chipConfig.widthRequired")+" ",this.showRequired&&eA("span",{class:"text-red-500"},"*")]),eA("input",{type:"number",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500",value:this.config.display.width,min:128,max:800,placeholder:"320",onInput:v=>{this.config.display.width=Number(v.target.value)}})]),eA("div",[eA("label",{class:"block text-sm font-medium text-gray-700 mb-2"},[y("chipConfig.heightRequired")+" ",this.showRequired&&eA("span",{class:"text-red-500"},"*")]),eA("input",{type:"number",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500",value:this.config.display.height,min:128,max:600,placeholder:"240",onInput:v=>{this.config.display.height=Number(v.target.value)}})])])}},{deviceInfo:i,isDeviceOnline:r,hasToken:C}=ig(),B=j(C.value),n=j(!1),Q=j(""),a=j(!1),E=j({model:"",display:{width:320,height:240,color:"RGB565"}}),h={"ESP32-S3":"esp32s3",ESP32S3:"esp32s3","ESP32-C3":"esp32c3",ESP32C3:"esp32c3","ESP32-C5":"esp32c5",ESP32C5:"esp32c5","ESP32-P4":"esp32p4",ESP32P4:"esp32p4","ESP32-C6":"esp32c6",ESP32C6:"esp32c6",ESP32:"esp32"},w=()=>{var y,v;try{if(!r.value)return B.value||(Q.value=g("chipConfig.deviceOffline"),n.value=!1),!1;const N=(y=i.value.chip)==null?void 0:y.model;if(!N||N==="未知")return!1;let L=h[N.toUpperCase()]||h[N]||N.toLowerCase().replace(/-/g,"");["esp32s3","esp32c3","esp32c5","esp32p4","esp32c6","esp32","others"].includes(L)||(L="others");const k=(v=i.value.screen)==null?void 0:v.resolution;if(!k||k==="未知")return!1;const[m,M]=k.split("x").map(Number);return!m||!M||isNaN(m)||isNaN(M)?(Q.value=g("chipConfig.resolutionFormatError"),n.value=!1,B.value=!1,!1):(E.value={model:L,display:{width:m,height:M,color:"RGB565"}},t("update:modelValue",{model:L,display:{width:m,height:M,color:"RGB565"}}),n.value=!0,Q.value="",B.value=!1,console.log("✓ 设备配置加载成功:",{chip:L,width:m,height:M}),!0)}catch(N){return console.error("加载设备配置失败:",N),Q.value=g("chipConfig.loadingError"),n.value=!1,B.value=!1,!1}},u=nA(()=>E.value.model&&E.value.display.width&&E.value.display.height),l=nA(()=>E.value.model?E.value.model.toUpperCase().replace(/ESP32/i,"ESP32-"):""),f=nA(()=>E.value.display),c=()=>{a.value=!a.value},D=()=>{u.value&&t("next")};return DA(()=>E.value,y=>{t("update:modelValue",{model:y.model,display:{...y.display}})},{deep:!0}),DA(()=>r.value,y=>{y&&!n.value&&(B.value=!0,Q.value="",setTimeout(()=>{w()},100))}),DA(()=>[i.value.chip,i.value.screen],()=>{r.value&&!n.value&&w()},{deep:!0}),Me(()=>{if(!C.value){B.value=!1,Q.value=g("chipConfig.manualConfigRequired"),console.log("⚠ 未检测到设备连接,使用手动配置模式");return}r.value&&i.value.chip&&i.value.chip.model!=="未知"&&i.value.screen&&i.value.screen.resolution!=="未知"?(console.log("✓ 检测到已缓存的设备信息,立即加载"),w()):r.value?(console.log("⏳ 设备在线,等待设备信息加载..."),B.value=!0,setTimeout(()=>{w()},500),setTimeout(()=>{B.value&&!n.value&&r.value&&(B.value=!1,!i.value.chip||i.value.chip.model==="未知"?Q.value=g("chipConfig.chipModelError"):!i.value.screen||i.value.screen.resolution==="未知"?Q.value=g("chipConfig.resolutionError"):Q.value=g("chipConfig.timeoutError"),console.warn("⚠ 设备配置加载超时:",Q.value))},1e4)):(console.log("⏳ 等待设备连接..."),B.value=!0,setTimeout(()=>{B.value&&!n.value&&!r.value&&(B.value=!1,Q.value=g("chipConfig.manualConfigHint"),console.warn("⚠ 等待设备连接超时"))},1e4))}),(y,v)=>(G(),U("div",QI,[s("div",null,[s("h2",EI,d(y.$t("chipConfig.title")),1),s("p",lI,[B.value?(G(),U("span",cI,d(y.$t("chipConfig.loadingFromDevice")),1)):n.value?(G(),U("span",hI,d(y.$t("chipConfig.loadedFromDevice")),1)):(G(),U("span",uI,d(y.$t("chipConfig.manualConfig")),1))])]),B.value?(G(),U("div",dI,[s("div",fI,[s("div",wI,[v[0]||(v[0]=s("svg",{class:"animate-spin h-6 w-6 text-blue-600",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[s("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),s("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),s("div",null,[s("h3",yI,d(y.$t("chipConfig.loadingTitle")),1),s("p",pI,d(y.$t("chipConfig.loadingDesc")),1)])])])])):fg(r)&&n.value?(G(),U("div",DI,[s("div",mI,[s("div",FI,[s("div",kI,[v[1]||(v[1]=s("div",{class:"w-5 h-5 bg-green-500 rounded-full flex items-center justify-center mr-2"},[s("svg",{class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},[s("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})])],-1)),s("h3",vI,d(y.$t("chipConfig.autoLoadedTitle")),1)])]),s("div",SI,[s("div",GI,[s("label",RI,d(y.$t("chipConfig.chipModel")),1),s("div",UI,d(l.value),1)]),s("div",NI,[s("label",bI,d(y.$t("chipConfig.screenWidth")),1),s("div",LI,d(f.value.width)+" px",1)]),s("div",MI,[s("label",JI,d(y.$t("chipConfig.screenHeight")),1),s("div",xI,d(f.value.height)+" px",1)])]),s("div",HI," ✓ "+d(y.$t("chipConfig.colorFormat"))+" "+d(f.value.color),1)]),s("div",YI,[s("button",{onClick:c,class:"flex items-center text-sm text-gray-600 hover:text-gray-900"},[v[2]||(v[2]=s("svg",{class:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1)),HA(" "+d(a.value?y.$t("chipConfig.collapseManual"):y.$t("chipConfig.manualEdit")),1)]),a.value?(G(),U("div",KI,[wg(o,{config:E.value},null,8,["config"])])):O("",!0)])])):(G(),U("div",TI,[s("div",VI,[s("div",qI,[v[3]||(v[3]=s("svg",{class:"w-5 h-5 text-yellow-600 mr-3 flex-shrink-0 mt-0.5",fill:"currentColor",viewBox:"0 0 20 20"},[s("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1)),s("div",null,[s("h4",OI,d(y.$t("chipConfig.manualConfigDesc")),1),s("p",WI,d(Q.value||y.$t("chipConfig.manualConfigHint")),1)])])]),s("div",PI,[s("h3",ZI,d(y.$t("chipConfig.manualConfigTitle")),1),wg(o,{config:E.value,"show-required":!0},null,8,["config"])])])),s("div",XI,[s("button",{onClick:D,disabled:!u.value,class:"bg-primary-500 hover:bg-primary-600 disabled:bg-gray-300 text-white px-6 py-2 rounded-lg font-medium transition-colors"},d(y.$t("chipConfig.next")),9,jI)])]))}},_I={class:"space-y-6"},$I={class:"text-lg font-medium text-gray-900 mb-2"},Ao={class:"text-gray-600"},eo={key:0,class:"bg-orange-50 border border-orange-200 rounded-lg p-4"},go={class:"text-sm text-orange-800"},to={class:"mt-1"},Io={key:1,class:"space-y-6"},oo={class:"flex space-x-4"},io={key:0,class:"space-y-4"},ro={class:"block text-sm font-medium text-gray-700"},Co={class:"relative"},no=["value"],Bo=["value"],so={key:1,class:"space-y-4 bg-gray-50 p-4 rounded-lg border border-gray-200"},ao={class:"font-medium text-gray-900"},Qo={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Eo={class:"block text-sm font-medium text-gray-700 mb-1"},lo=["placeholder"],co={key:0,class:"text-xs text-red-500 mt-1"},ho={class:"block text-sm font-medium text-gray-700 mb-1"},uo=["placeholder"],fo={key:0,class:"text-xs text-red-500 mt-1"},wo={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},yo={class:"block text-sm font-medium text-gray-700 mb-1"},po={class:"flex items-center space-x-2"},Do={class:"text-sm text-gray-600 w-8"},mo={class:"text-xs text-gray-500 mt-1"},Fo={class:"block text-sm font-medium text-gray-700 mb-1"},ko={key:0,class:"text-xs text-red-500 mt-1"},vo={class:"block text-sm font-medium text-gray-700 mb-1"},So={value:"mn6_en"},Go={class:"bg-blue-50 border border-blue-200 rounded-lg p-3"},Ro={class:"text-sm text-blue-800"},Uo={class:"mt-1 list-disc list-inside space-y-1"},No={key:0},bo={key:1},Lo={key:2},Mo={__name:"WakewordConfig",props:{modelValue:{type:Object,required:!0},chipModel:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:A}){const{t:g}=TA(),t=e,I=A,o=[{id:"wn9s_hilexin",name:"Hi, Espressif",model:"WakeNet9s"},{id:"wn9s_hiesp",name:"Hi,ESP",model:"WakeNet9s"},{id:"wn9s_nihaoxiaozhi",name:"Hello Xiaozhi",model:"WakeNet9s"},{id:"wn9s_hijason",name:"Hi,Jason",model:"WakeNet9s"},{id:"wn9s_alexa",name:"Alexa",model:"WakeNet9s"},{id:"wn9_hilexin",name:"Hi, Espressif",model:"WakeNet9"},{id:"wn9_hiesp",name:"Hi,ESP",model:"WakeNet9"},{id:"wn9_nihaoxiaozhi_tts",name:"Hello Xiaozhi",model:"WakeNet9"},{id:"wn9_hijason_tts2",name:"Hi,Jason",model:"WakeNet9"},{id:"wn9_himfive",name:"Hi,M Five",model:"WakeNet9"},{id:"wn9_alexa",name:"Alexa",model:"WakeNet9"},{id:"wn9_jarvis_tts",name:"Jarvis",model:"WakeNet9"},{id:"wn9_computer_tts",name:"Computer",model:"WakeNet9"},{id:"wn9_heywillow_tts",name:"Hey,Willow",model:"WakeNet9"},{id:"wn9_sophia_tts",name:"Sophia",model:"WakeNet9"},{id:"wn9_heyprinter_tts",name:"Hey,Printer",model:"WakeNet9"},{id:"wn9_hijoy_tts",name:"Hi,Joy",model:"WakeNet9"},{id:"wn9_heywanda_tts",name:"Hey,Wand",model:"WakeNet9"},{id:"wn9_astrolabe_tts",name:"Astrolabe",model:"WakeNet9"},{id:"wn9_heyily_tts2",name:"Hey,Ily",model:"WakeNet9"},{id:"wn9_hijolly_tts2",name:"Hi,Jolly",model:"WakeNet9"},{id:"wn9_hifairy_tts2",name:"Hi,Fairy",model:"WakeNet9"},{id:"wn9_bluechip_tts2",name:"Blue Chip",model:"WakeNet9"},{id:"wn9_hiandy_tts2",name:"Hi,Andy",model:"WakeNet9"},{id:"wn9_heyivy_tts2",name:"Hey,Ivy",model:"WakeNet9"},{id:"wn9_histackchan_tts3",name:"Hi,Stack Chan",model:"WakeNet9"},{id:"wn9_hiwalle_tts2",name:"Hi,Wall E",model:"WakeNet9"},{id:"wn9_hilili_tts",name:"Hi,Lily",model:"WakeNet9"},{id:"wn9_hitelly_tts",name:"Hi,Telly",model:"WakeNet9"},{id:"wn9_linaiban_tts2",name:"Lina Board",model:"WakeNet9"}],i=nA(()=>{const l=t.chipModel.toLowerCase();return l==="esp32s3"||l==="esp32p4"}),r=nA(()=>{const l=t.chipModel.toLowerCase();return l==="esp32c3"||l==="esp32c5"||l==="esp32c6"}),C=nA(()=>t.chipModel.toLowerCase()==="esp32s3"),B=nA(()=>i.value||r.value),n=nA(()=>i.value?o.filter(l=>l.model==="WakeNet9"):r.value?o.filter(l=>l.model==="WakeNet9s"):[]),Q=j({name:"",command:"",threshold:20,duration:3e3,model:"mn6_en"}),a=j({name:"",command:"",duration:""}),E=()=>{let l=!0;return a.value={name:"",command:"",duration:""},Q.value.name.trim()||(a.value.name=g("wakewordConfig.errors.nameRequired"),l=!1),Q.value.command.trim()?Q.value.model.includes("_en")&&/[!,.?]/.test(Q.value.command)&&(a.value.command=g("wakewordConfig.errors.noPunctuation"),l=!1):(a.value.command=g("wakewordConfig.errors.commandRequired"),l=!1),(!Q.value.duration||Q.value.duration<500||Q.value.duration>1e4)&&(a.value.duration=g("wakewordConfig.errors.durationRange"),l=!1),l},h=j(!1),w=l=>{var f;I("update:modelValue",{...t.modelValue,type:l,preset:l==="preset"&&(t.modelValue.preset||((f=n.value[0])==null?void 0:f.id))||"",custom:{...t.modelValue.custom,...Q.value}})},u=l=>{I("update:modelValue",{...t.modelValue,preset:l})};return DA(Q,l=>{h.value||t.modelValue.type==="custom"&&(E(),I("update:modelValue",{...t.modelValue,custom:{...l}}))},{deep:!0}),DA(()=>t.modelValue.custom,l=>{l&&(h.value=!0,Q.value={name:l.name||"",command:l.command||"",threshold:l.threshold!==void 0?l.threshold:20,duration:l.duration!==void 0?l.duration:3e3,model:l.model||"mn6_en"},nt(()=>{h.value=!1}))},{deep:!0,immediate:!0}),(l,f)=>(G(),U("div",_I,[s("div",null,[s("h3",$I,d(l.$t("wakewordConfig.title")),1),s("p",Ao,d(l.$t("wakewordConfig.description")),1)]),B.value?(G(),U("div",Io,[s("div",oo,[s("button",{onClick:f[0]||(f[0]=c=>w("none")),class:gA(["px-4 py-2 border rounded-lg transition-colors",e.modelValue.type==="none"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(l.$t("wakewordConfig.noWakeword")),3),s("button",{onClick:f[1]||(f[1]=c=>w("preset")),class:gA(["px-4 py-2 border rounded-lg transition-colors",e.modelValue.type==="preset"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(l.$t("wakewordConfig.presetWakeword")),3),C.value?(G(),U("button",{key:0,onClick:f[2]||(f[2]=c=>w("custom")),class:gA(["px-4 py-2 border rounded-lg transition-colors",e.modelValue.type==="custom"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(l.$t("wakewordConfig.customWakeword")),3)):O("",!0)]),e.modelValue.type==="preset"?(G(),U("div",io,[s("label",ro,d(l.$t("wakewordConfig.selectWakeword")),1),s("div",Co,[s("select",{value:e.modelValue.preset,onChange:f[3]||(f[3]=c=>u(c.target.value)),class:"w-full border border-gray-300 rounded-md px-3 py-2 pr-10 bg-white focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},[(G(!0),U(bA,null,LA(n.value,c=>(G(),U("option",{key:c.id,value:c.id},d(c.name)+" ("+d(c.model)+") ",9,Bo))),128))],40,no)])])):O("",!0),e.modelValue.type==="custom"?(G(),U("div",so,[s("h4",ao,d(l.$t("wakewordConfig.customSettings")),1),s("div",Qo,[s("div",null,[s("label",Eo,[HA(d(l.$t("wakewordConfig.wakewordName"))+" ",1),f[9]||(f[9]=s("span",{class:"text-red-500"},"*",-1))]),rA(s("input",{type:"text","onUpdate:modelValue":f[4]||(f[4]=c=>Q.value.name=c),placeholder:l.$t("wakewordConfig.wakewordNamePlaceholder"),class:gA(["w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500",{"border-red-500":a.value.name}])},null,10,lo),[[aA,Q.value.name]]),a.value.name?(G(),U("p",co,d(a.value.name),1)):O("",!0)]),s("div",null,[s("label",ho,[HA(d(l.$t("wakewordConfig.wakewordCommand"))+" ",1),f[10]||(f[10]=s("span",{class:"text-red-500"},"*",-1))]),rA(s("input",{type:"text","onUpdate:modelValue":f[5]||(f[5]=c=>Q.value.command=c),placeholder:l.$t("wakewordConfig.wakewordCommandPlaceholderEN"),class:gA(["w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500",{"border-red-500":a.value.command}])},null,10,uo),[[aA,Q.value.command]]),a.value.command?(G(),U("p",fo,d(a.value.command),1)):O("",!0)])]),s("div",wo,[s("div",null,[s("label",yo,d(l.$t("wakewordConfig.threshold")),1),s("div",po,[rA(s("input",{type:"range","onUpdate:modelValue":f[6]||(f[6]=c=>Q.value.threshold=c),min:"0",max:"100",step:"1",class:"flex-1"},null,512),[[aA,Q.value.threshold,void 0,{number:!0}]]),s("span",Do,d(Q.value.threshold),1)]),s("p",mo,d(l.$t("wakewordConfig.thresholdDesc")),1)]),s("div",null,[s("label",Fo,d(l.$t("wakewordConfig.duration"))+" (ms) ",1),rA(s("input",{type:"number","onUpdate:modelValue":f[7]||(f[7]=c=>Q.value.duration=c),min:"500",max:"10000",step:"100",class:gA(["w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500",{"border-red-500":a.value.duration}])},null,2),[[aA,Q.value.duration,void 0,{number:!0}]]),a.value.duration?(G(),U("p",ko,d(a.value.duration),1)):O("",!0)]),s("div",null,[s("label",vo,d(l.$t("wakewordConfig.selectModel")),1),rA(s("select",{"onUpdate:modelValue":f[8]||(f[8]=c=>Q.value.model=c),class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500"},[s("option",So,d(l.$t("wakewordConfig.mn6en")),1)],512),[[Xe,Q.value.model]])])])])):O("",!0),s("div",Go,[s("div",Ro,[s("strong",null,d(l.$t("wakewordConfig.tips.tipLabel")),1),s("ul",Uo,[s("li",null,d(l.$t("wakewordConfig.tips.optional")),1),r.value?(G(),U("li",No,d(l.$t("wakewordConfig.tips.wakeNet9sOnly")),1)):i.value?(G(),U("li",bo,d(l.$t("wakewordConfig.tips.wakeNet9Full")),1)):O("",!0),C.value?(G(),U("li",Lo,d(l.$t("wakewordConfig.tips.customSupport")),1)):O("",!0)])])])])):(G(),U("div",eo,[s("div",go,[s("strong",null,d(l.$t("wakewordConfig.notice")),1),s("p",to,d(l.$t("wakewordConfig.unsupportedMessage",{chipModel:e.chipModel})),1)])]))]))}};class Jo{constructor(){this.dbName="XiaozhiConfigDB",this.version=1,this.db=null,this.initialized=!1}async initialize(){if(!(this.initialized&&this.db))return new Promise((A,g)=>{const t=indexedDB.open(this.dbName,this.version);t.onerror=()=>{console.error("IndexedDB 初始化失败:",t.error),g(t.error)},t.onsuccess=()=>{this.db=t.result,this.initialized=!0,console.log("IndexedDB 初始化成功"),A()},t.onupgradeneeded=I=>{const o=I.target.result;if(o.objectStoreNames.contains("configs")||o.createObjectStore("configs",{keyPath:"key"}).createIndex("timestamp","timestamp",{unique:!1}),!o.objectStoreNames.contains("files")){const i=o.createObjectStore("files",{keyPath:"id"});i.createIndex("type","type",{unique:!1}),i.createIndex("timestamp","timestamp",{unique:!1})}if(!o.objectStoreNames.contains("temp_data")){const i=o.createObjectStore("temp_data",{keyPath:"key"});i.createIndex("type","type",{unique:!1}),i.createIndex("timestamp","timestamp",{unique:!1})}console.log("IndexedDB 表结构创建完成")}})}async saveConfig(A){this.initialized||await this.initialize();const t={key:"current_config",config:this.sanitizeConfigForStorage(A),timestamp:Date.now()};return new Promise((I,o)=>{const C=this.db.transaction(["configs"],"readwrite").objectStore("configs").put(t);C.onerror=()=>{console.error("保存配置失败:",C.error),o(C.error)},C.onsuccess=()=>{console.log("配置已保存到 IndexedDB"),I()}})}sanitizeConfigForStorage(A){var t,I,o,i,r,C,B,n,Q,a;const g=JSON.parse(JSON.stringify(A||{}));try{if((I=(t=g==null?void 0:g.theme)==null?void 0:t.font)!=null&&I.custom&&(g.theme.font.custom.file=null),((i=(o=g==null?void 0:g.theme)==null?void 0:o.emoji)==null?void 0:i.type)==="custom"){g.theme.emoji.custom||(g.theme.emoji.custom={});const E=((C=(r=g.theme.emoji)==null?void 0:r.custom)==null?void 0:C.images)||{},h={};if(Object.keys(E).forEach(w=>{h[w]=null}),g.theme.emoji.custom.images=h,g.theme.emoji.custom.emotionMap,g.theme.emoji.custom.fileMap){const w=g.theme.emoji.custom.fileMap,u={};Object.keys(w).forEach(l=>{u[l]=null}),g.theme.emoji.custom.fileMap=u}}(n=(B=g==null?void 0:g.theme)==null?void 0:B.skin)!=null&&n.light&&(g.theme.skin.light.backgroundImage=null),(a=(Q=g==null?void 0:g.theme)==null?void 0:Q.skin)!=null&&a.dark&&(g.theme.skin.dark.backgroundImage=null)}catch{}return g}async loadConfig(){return this.initialized||await this.initialize(),new Promise((A,g)=>{const o=this.db.transaction(["configs"],"readonly").objectStore("configs").get("current_config");o.onerror=()=>{console.error("加载配置失败:",o.error),g(o.error)},o.onsuccess=()=>{const i=o.result;i?(console.log("从 IndexedDB 恢复配置成功"),A({config:i.config,timestamp:i.timestamp})):A(null)}})}async saveFile(A,g,t,I={}){this.initialized||await this.initialize();const o=await this.fileToArrayBuffer(g);let i={};try{i=I?JSON.parse(JSON.stringify(I)):{}}catch{i={...I}}const r={id:A,type:t,name:g.name,size:g.size,mimeType:g.type,lastModified:g.lastModified,data:o,metadata:i,timestamp:Date.now()};return new Promise((C,B)=>{const a=this.db.transaction(["files"],"readwrite").objectStore("files").put(r);a.onerror=()=>{console.error("保存文件失败:",a.error),B(a.error)},a.onsuccess=()=>{console.log(`文件 ${g.name} 已保存到 IndexedDB`),C()}})}async loadFile(A){return this.initialized||await this.initialize(),new Promise((g,t)=>{const i=this.db.transaction(["files"],"readonly").objectStore("files").get(A);i.onerror=()=>{console.error("加载文件失败:",i.error),t(i.error)},i.onsuccess=()=>{const r=i.result;if(r){const C=new Blob([r.data],{type:r.mimeType}),B=new File([C],r.name,{type:r.mimeType,lastModified:r.lastModified});B.storedId=r.id,B.storedType=r.type,B.storedMetadata=r.metadata,B.storedTimestamp=r.timestamp,console.log(`文件 ${r.name} 从 IndexedDB 恢复成功`),g(B)}else g(null)}})}async getFilesByType(A){return this.initialized||await this.initialize(),new Promise((g,t)=>{const r=this.db.transaction(["files"],"readonly").objectStore("files").index("type").getAll(A);r.onerror=()=>{console.error("获取文件列表失败:",r.error),t(r.error)},r.onsuccess=()=>{const B=(r.result||[]).map(n=>{const Q=new Blob([n.data],{type:n.mimeType}),a=new File([Q],n.name,{type:n.mimeType,lastModified:n.lastModified});return a.storedId=n.id,a.storedType=n.type,a.storedMetadata=n.metadata,a.storedTimestamp=n.timestamp,a});g(B)}})}async saveTempData(A,g,t,I={}){this.initialized||await this.initialize();const o={key:A,type:t,data:g,metadata:I,timestamp:Date.now()};return new Promise((i,r)=>{const n=this.db.transaction(["temp_data"],"readwrite").objectStore("temp_data").put(o);n.onerror=()=>{console.error("保存临时数据失败:",n.error),r(n.error)},n.onsuccess=()=>{console.log(`临时数据 ${A} 已保存`),i()}})}async loadTempData(A){return this.initialized||await this.initialize(),new Promise((g,t)=>{const i=this.db.transaction(["temp_data"],"readonly").objectStore("temp_data").get(A);i.onerror=()=>{console.error("加载临时数据失败:",i.error),t(i.error)},i.onsuccess=()=>{const r=i.result;g(r||null)}})}async clearAll(){this.initialized||await this.initialize();const A=["configs","files","temp_data"];return new Promise((g,t)=>{const I=this.db.transaction(A,"readwrite");let o=0,i=!1;const r=()=>{o++,o===A.length&&(i?t(new Error("清空部分数据时出现错误")):(console.log("所有存储数据已清空"),g()))};A.forEach(C=>{const n=I.objectStore(C).clear();n.onerror=()=>{console.error(`清空 ${C} 失败:`,n.error),i=!0,r()},n.onsuccess=()=>{console.log(`${C} 已清空`),r()}})})}async deleteFile(A){return this.initialized||await this.initialize(),new Promise((g,t)=>{const i=this.db.transaction(["files"],"readwrite").objectStore("files").delete(A);i.onerror=()=>{console.error("删除文件失败:",i.error),t(i.error)},i.onsuccess=()=>{console.log(`文件 ${A} 已删除`),g()}})}async getStorageInfo(){this.initialized||await this.initialize();const A=["configs","files","temp_data"],g={};for(const I of A){const o=await new Promise((i,r)=>{const n=this.db.transaction([I],"readonly").objectStore(I).count();n.onerror=()=>r(n.error),n.onsuccess=()=>i(n.result)});g[I]={count:o}}const t=await this.loadConfig();return g.lastSaved=t?new Date(t.timestamp):null,g}async hasStoredConfig(){try{return await this.loadConfig()!==null}catch(A){return console.error("检查存储配置时出错:",A),!1}}fileToArrayBuffer(A){return new Promise((g,t)=>{const I=new FileReader;I.onload=()=>g(I.result),I.onerror=()=>t(new Error("读取文件失败")),I.readAsArrayBuffer(A)})}close(){this.db&&(this.db.close(),this.db=null,this.initialized=!1,console.log("IndexedDB 连接已关闭"))}}const cA=new Jo;class Ie{static async saveFontFile(A,g={}){if(A){const t="custom_font";try{await cA.saveFile(t,A,"font",{size:g.size||20,bpp:g.bpp||4,charset:g.charset||"deepseek"}),console.log(`字体文件已保存: ${A.name}`)}catch(I){console.warn(`保存字体文件失败: ${A.name}`,I)}}}static async saveEmojiFile(A,g,t={}){var I,o;if(g&&A){const i=A.startsWith("hash_")?A:`emoji_${A}`;try{const r=((I=t==null?void 0:t.size)==null?void 0:I.width)??64,C=((o=t==null?void 0:t.size)==null?void 0:o.height)??64;await cA.saveFile(i,g,"emoji",{name:A,size:{width:r,height:C},format:t==null?void 0:t.format,emotions:t==null?void 0:t.emotions}),console.log(`表情文件已保存: ${i} - ${g.name}`)}catch(r){console.warn(`保存表情文件失败: ${A}`,r)}}}static async saveBackgroundFile(A,g,t={}){if(g&&A){const I=`background_${A}`;try{let o={};try{o=t?JSON.parse(JSON.stringify(t)):{}}catch{o={...t}}await cA.saveFile(I,g,"background",{mode:A,...o}),console.log(`背景文件已保存: ${A} - ${g.name}`)}catch(o){console.warn(`保存背景文件失败: ${A}`,o)}}}static async restoreFontFile(){try{return await cA.loadFile("custom_font")}catch(A){return console.warn("恢复字体文件失败:",A),null}}static async restoreEmojiFile(A){if(!A)return null;try{const g=A.startsWith("hash_")?A:`emoji_${A}`;return await cA.loadFile(g)}catch(g){return console.warn(`恢复表情文件失败: ${A}`,g),null}}static async restoreBackgroundFile(A){if(!A)return null;try{const g=`background_${A}`;return await cA.loadFile(g)}catch(g){return console.warn(`恢复背景文件失败: ${A}`,g),null}}static async deleteFontFile(){try{await cA.deleteFile("custom_font"),console.log("字体文件已删除")}catch(A){console.warn("删除字体文件失败:",A)}}static async deleteEmojiFile(A){if(A)try{const g=A.startsWith("hash_")?A:`emoji_${A}`;await cA.deleteFile(g),console.log(`表情文件已删除: ${g}`)}catch(g){console.warn(`删除表情文件失败: ${A}`,g)}}static async deleteBackgroundFile(A){if(A)try{const g=`background_${A}`;await cA.deleteFile(g),console.log(`背景文件已删除: ${A}`)}catch(g){console.warn(`删除背景文件失败: ${A}`,g)}}static async getStorageInfo(){try{return await cA.getStorageInfo()}catch(A){return console.warn("获取存储信息失败:",A),{configs:{count:0},files:{count:0},temp_data:{count:0},lastSaved:null}}}static async clearAllFiles(){try{await cA.clearAll(),console.log("所有存储文件已清理")}catch(A){throw console.warn("清理存储文件失败:",A),A}}}const xo={class:"space-y-6"},Ho={class:"text-lg font-medium text-gray-900 mb-2"},Yo={class:"text-gray-600"},Ko={class:"space-y-4"},To={class:"flex space-x-4"},Vo={key:0,class:"space-y-4"},qo={class:"bg-gray-50 border border-gray-200 rounded-lg p-6 text-center"},Oo={class:"mt-2 text-gray-600"},Wo={key:1,class:"space-y-4"},Po={class:"font-medium text-gray-900"},Zo={class:"grid grid-cols-1 md:grid-cols-4 gap-4"},Xo=["onClick"],jo={class:"flex items-start justify-between"},zo={class:"flex-1"},_o={class:"font-medium text-gray-900 mb-1"},$o={class:"text-sm text-gray-600 space-y-1"},Ai={key:0,class:"flex-shrink-0 ml-3"},ei={key:2,class:"space-y-6"},gi={class:"font-medium text-gray-900"},ti={class:"space-y-2"},Ii={class:"block text-sm font-medium text-gray-700"},oi={key:0},ii={class:"mt-2"},ri={class:"text-gray-500"},Ci={class:"text-xs text-gray-400 mt-1"},ni={key:1,class:"text-green-600"},Bi={class:"mt-1 font-medium"},si={key:0,class:"grid grid-cols-1 md:grid-cols-3 gap-4"},ai={class:"block text-sm font-medium text-gray-700 mb-2"},Qi={class:"text-xs text-gray-500 mt-1"},Ei={class:"block text-sm font-medium text-gray-700 mb-2"},li={value:1},ci={value:2},hi={value:4},ui={class:"block text-sm font-medium text-gray-700 mb-2"},di={value:"qwen"},fi={value:"deepseek"},wi={value:"latin"},yi={value:"full"},pi={class:"flex items-center justify-between p-4 bg-gray-50 rounded-lg border border-gray-200"},Di={class:"flex-1"},mi={class:"font-medium text-gray-900"},Fi={class:"text-sm text-gray-500 mt-1"},ki={class:"ml-4"},vi={class:"relative inline-flex items-center cursor-pointer"},Si=["checked"],Gi={__name:"FontConfig",props:{modelValue:{type:Object,required:!0}},emits:["update:modelValue"],setup(e,{emit:A}){const{t:g}=TA(),t=e,I=A,o=j(null),i=[{id:"font_puhui_deepseek_14_1",size:14,bpp:1,fileSize:"~180KB"},{id:"font_puhui_deepseek_16_4",size:16,bpp:4,fileSize:"~720KB"},{id:"font_puhui_deepseek_20_4",size:20,bpp:4,fileSize:"~1.1MB"},{id:"font_puhui_deepseek_30_4",size:30,bpp:4,fileSize:"~2.5MB"},{id:"font_noto_qwen_14_1",size:14,bpp:1,fileSize:"~626KB"},{id:"font_noto_qwen_16_4",size:16,bpp:4,fileSize:"~2.0MB"},{id:"font_noto_qwen_20_4",size:20,bpp:4,fileSize:"~2.9MB"},{id:"font_noto_qwen_30_4",size:30,bpp:4,fileSize:"~5.8MB"}],r=nA(()=>i.map(u=>{let l;return u.id.startsWith("font_puhui_deepseek_")?l=g("fontConfig.charsetDeepseek"):u.id.startsWith("font_noto_qwen_")&&(l=g("fontConfig.charsetQwen")),{...u,name:g("fontConfig.presetFontNames."+u.id),charset:l}})),C=j({size:20,bpp:4,charset:"qwen"}),B=u=>{I("update:modelValue",{...t.modelValue,type:u,preset:u==="preset"?t.modelValue.preset||"font_puhui_deepseek_20_4":"",custom:{...t.modelValue.custom,file:t.modelValue.custom.file||null}})},n=u=>{I("update:modelValue",{...t.modelValue,preset:u,custom:{...t.modelValue.custom,file:t.modelValue.custom.file||null}})},Q=u=>{const l=u.target.files[0];l&&E(l)},a=u=>{u.preventDefault();const l=u.dataTransfer.files;l.length>0&&E(l[0])},E=async u=>{u&&(u.type.includes("font")||u.name.toLowerCase().match(/\.(ttf|woff|woff2)$/))?(I("update:modelValue",{...t.modelValue,custom:{...t.modelValue.custom,file:u,...C.value}}),await Ie.saveFontFile(u,C.value)):alert(g("fontConfig.selectValidFontFile"))},h=async()=>{I("update:modelValue",{...t.modelValue,custom:{...t.modelValue.custom,file:null}}),o.value&&(o.value.value=""),await Ie.deleteFontFile()},w=j(!1);return DA(()=>C.value,u=>{w.value||t.modelValue.type==="custom"&&t.modelValue.custom.file&&I("update:modelValue",{...t.modelValue,custom:{...t.modelValue.custom,...u}})},{deep:!0}),DA(()=>t.modelValue.custom,u=>{u.size&&u.bpp&&u.charset&&(w.value=!0,C.value={size:u.size,bpp:u.bpp,charset:u.charset},nt(()=>{w.value=!1}))},{deep:!0,immediate:!0}),(u,l)=>{var f;return G(),U("div",xo,[s("div",null,[s("h3",Ho,d(u.$t("fontConfig.title")),1),s("p",Yo,d(u.$t("fontConfig.description")),1)]),s("div",Ko,[s("div",To,[s("button",{onClick:l[0]||(l[0]=c=>B("none")),class:gA(["px-4 py-2 border rounded-lg transition-colors",e.modelValue.type==="none"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(u.$t("fontConfig.noFonts")),3),s("button",{onClick:l[1]||(l[1]=c=>B("preset")),class:gA(["px-4 py-2 border rounded-lg transition-colors",e.modelValue.type==="preset"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(u.$t("fontConfig.presetFonts")),3),s("button",{onClick:l[2]||(l[2]=c=>B("custom")),class:gA(["px-4 py-2 border rounded-lg transition-colors",e.modelValue.type==="custom"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(u.$t("fontConfig.customFonts")),3)])]),e.modelValue.type==="none"?(G(),U("div",Vo,[s("div",qo,[l[10]||(l[10]=s("svg",{class:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)),s("p",Oo,d(u.$t("fontConfig.noFontsDescription")),1)])])):O("",!0),e.modelValue.type==="preset"?(G(),U("div",Wo,[s("h4",Po,d(u.$t("fontConfig.presetFonts")),1),s("div",Zo,[(G(!0),U(bA,null,LA(r.value,c=>(G(),U("div",{key:c.id,onClick:D=>n(c.id),class:gA(["border-2 rounded-lg p-4 cursor-pointer transition-all",e.modelValue.preset===c.id?"border-primary-500 bg-primary-50":"border-gray-200 hover:border-gray-300"])},[s("div",jo,[s("div",zo,[s("h5",_o,d(c.name),1),s("div",$o,[s("div",null,d(u.$t("fontConfig.fontSize"))+" "+d(c.size)+"px",1),s("div",null,d(u.$t("fontConfig.bitDepth"))+" "+d(c.bpp)+"bpp",1),s("div",null,d(u.$t("fontConfig.charset"))+" "+d(c.charset),1),s("div",null,d(u.$t("fontConfig.fileSize"))+" "+d(c.fileSize),1)])]),e.modelValue.preset===c.id?(G(),U("div",Ai,[...l[11]||(l[11]=[s("div",{class:"w-5 h-5 bg-primary-500 rounded-full flex items-center justify-center"},[s("svg",{class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},[s("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})])],-1)])])):O("",!0)])],10,Xo))),128))])])):O("",!0),e.modelValue.type==="custom"?(G(),U("div",ei,[s("h4",gi,d(u.$t("fontConfig.customFonts")),1),s("div",ti,[s("label",Ii,d(u.$t("fontConfig.fontFile")),1),s("div",{onDrop:a,onDragover:l[4]||(l[4]=PA(()=>{},["prevent"])),onDragenter:l[5]||(l[5]=PA(()=>{},["prevent"])),class:"border-2 border-dashed border-gray-300 rounded-lg p-6 text-center hover:border-gray-400 transition-colors"},[s("input",{ref_key:"fileInput",ref:o,type:"file",accept:".ttf,.woff,.woff2",onChange:Q,class:"hidden"},null,544),e.modelValue.custom.file?(G(),U("div",ni,[l[13]||(l[13]=s("svg",{class:"mx-auto h-8 w-8",fill:"currentColor",viewBox:"0 0 20 20"},[s("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1)),s("p",Bi,d((f=e.modelValue.custom.file)==null?void 0:f.name),1),s("button",{onClick:h,class:"text-red-600 hover:text-red-500 text-sm mt-1"},d(u.$t("fontConfig.removeFile")),1)])):(G(),U("div",oi,[l[12]||(l[12]=s("svg",{class:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})],-1)),s("div",ii,[s("button",{onClick:l[3]||(l[3]=c=>u.$refs.fileInput.click()),class:"text-primary-600 hover:text-primary-500 font-medium"},d(u.$t("fontConfig.clickSelectFontFile")),1),s("p",ri,d(u.$t("fontConfig.orDragFileHere")),1)]),s("p",Ci,d(u.$t("fontConfig.supportedFormats")),1)]))],32)]),e.modelValue.custom.file?(G(),U("div",si,[s("div",null,[s("label",ai,d(u.$t("fontConfig.fontSizePx")),1),rA(s("input",{type:"number","onUpdate:modelValue":l[6]||(l[6]=c=>C.value.size=c),min:"8",max:"80",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},null,512),[[aA,C.value.size,void 0,{number:!0}]]),s("p",Qi,d(u.$t("fontConfig.range"))+" 8-80px",1)]),s("div",null,[s("label",Ei,d(u.$t("fontConfig.bitDepthBpp")),1),rA(s("select",{"onUpdate:modelValue":l[7]||(l[7]=c=>C.value.bpp=c),class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},[s("option",li,d(u.$t("fontConfig.monochrome")),1),s("option",ci,d(u.$t("fontConfig.fourColors")),1),s("option",hi,d(u.$t("fontConfig.sixteenColors")),1)],512),[[Xe,C.value.bpp]])]),s("div",null,[s("label",ui,d(u.$t("fontConfig.characterSet")),1),rA(s("select",{"onUpdate:modelValue":l[8]||(l[8]=c=>C.value.charset=c),class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},[s("option",di,d(u.$t("fontConfig.qwen18409")),1),s("option",fi,d(u.$t("fontConfig.deepseekR1")),1),s("option",wi,d(u.$t("fontConfig.latin1")),1),s("option",yi,d(u.$t("fontConfig.fullCharset")),1)],512),[[Xe,C.value.charset]])])])):O("",!0)])):O("",!0),s("div",pi,[s("div",Di,[s("h4",mi,d(u.$t("fontConfig.hideSubtitle")),1),s("p",Fi,d(u.$t("fontConfig.hideSubtitleDescription")),1)]),s("div",ki,[s("label",vi,[s("input",{type:"checkbox",checked:e.modelValue.hide_subtitle,onChange:l[9]||(l[9]=c=>I("update:modelValue",{...e.modelValue,hide_subtitle:c.target.checked})),class:"sr-only peer"},null,40,Si),l[14]||(l[14]=s("div",{class:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-primary-500"},null,-1))])])])])}}},Ri={class:"space-y-6"},Ui={class:"text-lg font-medium text-gray-900 mb-2"},Ni={class:"text-gray-600"},bi={class:"space-y-4"},Li={class:"flex flex-wrap gap-3"},Mi={key:0,class:"text-sm text-gray-500"},Ji={key:0,class:"space-y-4"},xi={class:"font-medium text-gray-900"},Hi={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Yi=["onClick"],Ki={class:"flex items-start justify-between mb-3"},Ti={class:"font-medium text-gray-900"},Vi={class:"text-sm text-gray-600"},qi={class:"text-xs text-gray-500 mt-1"},Oi={key:0,class:"flex-shrink-0 ml-3"},Wi={class:"grid grid-cols-7 gap-1 justify-items-center overflow-hidden"},Pi=["src","alt"],Zi={key:1,class:"space-y-6"},Xi={class:"font-medium text-gray-900"},ji={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},zi={class:"block text-sm font-medium text-gray-700 mb-2"},_i={class:"block text-sm font-medium text-gray-700 mb-2"},$i={class:"space-y-4"},Ar={class:"font-medium text-gray-900"},er={class:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-7 gap-4"},gr={class:"text-center"},tr={class:"text-lg mb-1"},Ir={class:"text-xs text-gray-600 flex items-center justify-center gap-1"},or={key:0,class:"text-red-500"},ir=["onDrop"],rr=["onChange"],Cr=["onClick"],nr={class:"text-xs text-gray-500"},Br={key:1,class:"w-full h-full relative"},sr=["src","alt"],ar=["onClick"],Qr={class:"text-xs text-gray-500 mt-2"},Er={__name:"EmojiConfig",props:{modelValue:{type:Object,required:!0}},emits:["update:modelValue"],setup(e,{emit:A}){const{t:g}=TA(),t=e,I=A,o=async f=>{const c=await f.arrayBuffer(),D=await crypto.subtle.digest("SHA-256",c);return Array.from(new Uint8Array(D)).map(N=>N.toString(16).padStart(2,"0")).join("")},i=[{id:"twemoji32",name:g("emojiConfig.twitterEmojiName",{size:32}),description:g("emojiConfig.twitterEmojiDescription",{size:32}),size:32,format:"png",preview:["neutral","happy","laughing","funny","sad","angry","crying"]},{id:"twemoji64",name:g("emojiConfig.twitterEmojiName",{size:64}),description:g("emojiConfig.twitterEmojiDescription",{size:64}),size:64,format:"png",preview:["neutral","happy","laughing","funny","sad","angry","crying"]},{id:"noto-emoji_64",name:g("emojiConfig.notoEmojiName",{size:64}),description:g("emojiConfig.notoEmojiDescription",{size:64}),size:64,format:"gif",preview:["neutral","happy","laughing","funny","sad","angry","crying"]},{id:"noto-emoji_128",name:g("emojiConfig.notoEmojiName",{size:128}),description:g("emojiConfig.notoEmojiDescription",{size:128}),size:128,format:"gif",preview:["neutral","happy","laughing","funny","sad","angry","crying"]}],r=nA(()=>[{key:"neutral",name:g("emojiConfig.emotions.neutral"),emoji:"😶"},{key:"happy",name:g("emojiConfig.emotions.happy"),emoji:"🙂"},{key:"laughing",name:g("emojiConfig.emotions.laughing"),emoji:"😆"},{key:"funny",name:g("emojiConfig.emotions.funny"),emoji:"😂"},{key:"sad",name:g("emojiConfig.emotions.sad"),emoji:"😔"},{key:"angry",name:g("emojiConfig.emotions.angry"),emoji:"😠"},{key:"crying",name:g("emojiConfig.emotions.crying"),emoji:"😭"},{key:"loving",name:g("emojiConfig.emotions.loving"),emoji:"😍"},{key:"embarrassed",name:g("emojiConfig.emotions.embarrassed"),emoji:"😳"},{key:"surprised",name:g("emojiConfig.emotions.surprised"),emoji:"😯"},{key:"shocked",name:g("emojiConfig.emotions.shocked"),emoji:"😱"},{key:"thinking",name:g("emojiConfig.emotions.thinking"),emoji:"🤔"},{key:"winking",name:g("emojiConfig.emotions.winking"),emoji:"😉"},{key:"cool",name:g("emojiConfig.emotions.cool"),emoji:"😎"},{key:"relaxed",name:g("emojiConfig.emotions.relaxed"),emoji:"😌"},{key:"delicious",name:g("emojiConfig.emotions.delicious"),emoji:"🤤"},{key:"kissy",name:g("emojiConfig.emotions.kissy"),emoji:"😘"},{key:"confident",name:g("emojiConfig.emotions.confident"),emoji:"😏"},{key:"sleepy",name:g("emojiConfig.emotions.sleepy"),emoji:"😴"},{key:"silly",name:g("emojiConfig.emotions.silly"),emoji:"😜"},{key:"confused",name:g("emojiConfig.emotions.confused"),emoji:"🙄"}]),C=j({size:{width:32,height:32}}),B=f=>{if(t.modelValue.type===f)return;const c={...t.modelValue,type:f};f==="none"?(c.preset="",c.custom={...t.modelValue.custom,images:t.modelValue.custom.images||{}}):f==="preset"?(c.preset=t.modelValue.preset||"twemoji32",c.custom={...t.modelValue.custom,images:t.modelValue.custom.images||{}}):f==="custom"&&(c.preset="",c.custom={...t.modelValue.custom,images:t.modelValue.custom.images||{}}),I("update:modelValue",c)},n=f=>{t.modelValue.preset!==f&&I("update:modelValue",{...t.modelValue,preset:f,custom:{...t.modelValue.custom,images:t.modelValue.custom.images||{}}})},Q=(f,c)=>{const D=f.target.files[0];D&&E(c,D)},a=(f,c)=>{f.preventDefault();const D=f.dataTransfer.files;D.length>0&&E(c,D[0])},E=async(f,c)=>{const D=["png","gif"],y=c.name.split(".").pop().toLowerCase();if(!D.includes(y)){alert(g("emojiConfig.selectValidFormat"));return}const v=await o(c),N=t.modelValue.custom||{},L={...N.fileMap||{}},X={...N.emotionMap||{}},k={...N.images||{}};let m=[];for(const[M,oA]of Object.entries(X))oA===v&&M!==f&&m.push(M);m.length>0&&console.log(g("emojiConfig.sharedFileMessage",{emotionKey:f,existingEmotions:m.join(", ")})),L[v]=c,X[f]=v,k[f]=c,I("update:modelValue",{...t.modelValue,custom:{...N,size:C.value.size,images:k,fileMap:L,emotionMap:X}}),await Ie.saveEmojiFile(`hash_${v}`,c,{size:C.value.size,format:y,emotions:[...m,f]})},h=async f=>{const c=t.modelValue.custom||{},D={...c.images},y={...c.emotionMap||{}},v={...c.fileMap||{}},N=y[f];delete D[f],delete y[f],Object.values(y).filter(X=>X===N).length===0&&N?(delete v[N],await Ie.deleteEmojiFile(`hash_${N}`),console.log(g("emojiConfig.fileDeleted",{fileHash:N}))):console.log(g("emojiConfig.fileRetained",{fileHash:N})),I("update:modelValue",{...t.modelValue,custom:{...c,images:D,emotionMap:y,fileMap:v}})},w=(f,c)=>{const D=i.find(v=>v.id===f),y=(D==null?void 0:D.format)||"png";return`./static/emojis/${f}/${c}.${y}`},u=f=>{if(t.modelValue.type==="preset")return w(t.modelValue.preset,f);{const c=t.modelValue.custom.images[f];return c instanceof File||c instanceof Blob?URL.createObjectURL(c):null}},l=f=>{console.warn(g("emojiConfig.imageLoadFailed"),f.target.src),f.target.style.display="none"};return DA(()=>C.value.size,f=>{if(t.modelValue.type==="custom"){const c=t.modelValue.custom;JSON.stringify(c.size)!==JSON.stringify(f)&&I("update:modelValue",{...t.modelValue,custom:{...c,size:f}})}},{deep:!0}),t.modelValue.custom.size&&(C.value={size:{...t.modelValue.custom.size}}),(f,c)=>(G(),U("div",Ri,[s("div",null,[s("h3",Ui,d(f.$t("emojiConfig.title")),1),s("p",Ni,d(f.$t("emojiConfig.description")),1)]),s("div",bi,[s("div",Li,[s("button",{onClick:c[0]||(c[0]=D=>B("none")),class:gA(["px-4 py-2 border rounded-lg transition-colors",e.modelValue.type==="none"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(f.$t("emojiConfig.noEmojiPack")),3),s("button",{onClick:c[1]||(c[1]=D=>B("preset")),class:gA(["px-4 py-2 border rounded-lg transition-colors",e.modelValue.type==="preset"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(f.$t("emojiConfig.presetEmojiPack")),3),s("button",{onClick:c[2]||(c[2]=D=>B("custom")),class:gA(["px-4 py-2 border rounded-lg transition-colors",e.modelValue.type==="custom"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(f.$t("emojiConfig.customEmojiPack")),3)]),e.modelValue.type==="none"?(G(),U("p",Mi,d(f.$t("emojiConfig.noEmojiPackDescription")),1)):O("",!0)]),e.modelValue.type==="preset"?(G(),U("div",Ji,[s("h4",xi,d(f.$t("emojiConfig.selectPresetEmojiPack")),1),s("div",Hi,[(G(),U(bA,null,LA(i,D=>s("div",{key:D.id,onClick:y=>n(D.id),class:gA(["border-2 rounded-lg p-4 cursor-pointer transition-all",e.modelValue.preset===D.id?"border-primary-500 bg-primary-50":"border-gray-200 hover:border-gray-300"])},[s("div",Ki,[s("div",null,[s("h5",Ti,d(D.name),1),s("p",Vi,d(D.description),1),s("div",qi,d(f.$t("emojiConfig.size"))+": "+d(D.size)+"px × "+d(D.size)+"px ",1)]),e.modelValue.preset===D.id?(G(),U("div",Oi,[...c[7]||(c[7]=[s("div",{class:"w-5 h-5 bg-primary-500 rounded-full flex items-center justify-center"},[s("svg",{class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},[s("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})])],-1)])])):O("",!0)]),s("div",Wi,[(G(!0),U(bA,null,LA(D.preview,y=>(G(),U("div",{key:y,style:CA({width:D.size+"px",height:D.size+"px"}),class:"bg-gray-100 rounded flex items-center justify-center"},[s("img",{src:w(D.id,y),alt:y,style:CA({width:D.size+"px",height:D.size+"px"}),class:"object-contain rounded",onError:l},null,44,Pi)],4))),128))])],10,Yi)),64))])])):O("",!0),e.modelValue.type==="custom"?(G(),U("div",Zi,[s("h4",Xi,d(f.$t("emojiConfig.customEmojiPackConfig")),1),s("div",ji,[s("div",null,[s("label",zi,d(f.$t("emojiConfig.maxImageWidth")),1),rA(s("input",{type:"number","onUpdate:modelValue":c[3]||(c[3]=D=>C.value.size.width=D),min:"16",max:"200",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},null,512),[[aA,C.value.size.width,void 0,{number:!0}]])]),s("div",null,[s("label",_i,d(f.$t("emojiConfig.maxImageHeight")),1),rA(s("input",{type:"number","onUpdate:modelValue":c[4]||(c[4]=D=>C.value.size.height=D),min:"16",max:"200",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},null,512),[[aA,C.value.size.height,void 0,{number:!0}]])])]),s("div",$i,[s("h5",Ar,d(f.$t("emojiConfig.uploadEmojiImages")),1),s("div",er,[(G(!0),U(bA,null,LA(r.value,D=>(G(),U("div",{key:D.key,class:"space-y-2"},[s("div",gr,[s("div",tr,d(D.emoji),1),s("div",Ir,[s("span",null,d(D.name),1),D.key==="neutral"?(G(),U("span",or,d(f.$t("emojiConfig.required")),1)):O("",!0)])]),s("div",{onDrop:y=>a(y,D.key),onDragover:c[5]||(c[5]=PA(()=>{},["prevent"])),onDragenter:c[6]||(c[6]=PA(()=>{},["prevent"])),class:gA(["border-2 border-dashed rounded-lg p-2 text-center cursor-pointer transition-colors aspect-square flex flex-col items-center justify-center",e.modelValue.custom.images[D.key]?"border-green-300 bg-green-50":D.key==="neutral"?"border-red-300 bg-red-50":"border-gray-300 hover:border-gray-400"])},[s("input",{ref_for:!0,ref:D.key+"Input",type:"file",accept:".png,.gif",onChange:y=>Q(y,D.key),class:"hidden"},null,40,rr),e.modelValue.custom.images[D.key]?(G(),U("div",Br,[u(D.key)?(G(),U("img",{key:0,src:u(D.key),alt:D.name,class:"w-full h-full object-cover rounded",onError:l},null,40,sr)):O("",!0),s("button",{onClick:y=>h(D.key),class:"absolute -top-1 -right-1 w-4 h-4 bg-red-500 text-white rounded-full flex items-center justify-center text-xs hover:bg-red-600"}," × ",8,ar)])):(G(),U("div",{key:0,onClick:y=>{var v;return(v=f.$refs[D.key+"Input"][0])==null?void 0:v.click()}},[c[8]||(c[8]=s("svg",{class:"w-6 h-6 text-gray-400 mx-auto mb-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})],-1)),s("div",nr,d(f.$t("emojiConfig.clickToUploadOrDrag")),1)],8,Cr))],42,ir)]))),128))]),s("div",Qr,d(f.$t("emojiConfig.neutralRequiredNotice")),1)])])):O("",!0)]))}},lr={class:"space-y-6"},cr={class:"text-lg font-medium text-gray-900 mb-2"},hr={class:"text-gray-600"},ur={class:"space-y-4"},dr={class:"font-medium text-gray-900 flex items-center"},fr={class:"border border-gray-200 rounded-lg p-4 space-y-4"},wr={class:"flex space-x-4"},yr={key:0,class:"space-y-3"},pr={class:"flex items-center space-x-3"},Dr={class:"text-sm font-medium text-gray-700"},mr={class:"flex items-center space-x-2"},Fr={class:"flex items-center space-x-3"},kr={class:"text-sm font-medium text-gray-700"},vr={class:"flex items-center space-x-2"},Sr={key:1,class:"space-y-3"},Gr={class:"text-sm font-medium text-gray-700"},Rr={class:"mt-1 text-sm text-gray-600"},Ur={key:1,class:"space-y-2"},Nr=["src"],br={class:"text-sm text-green-700 font-medium"},Lr={class:"flex items-center space-x-3"},Mr={class:"text-sm font-medium text-gray-700"},Jr={class:"flex items-center space-x-2"},xr={class:"space-y-4"},Hr={class:"font-medium text-gray-900 flex items-center"},Yr={class:"border border-gray-200 rounded-lg p-4 space-y-4"},Kr={class:"flex space-x-4"},Tr={key:0,class:"space-y-3"},Vr={class:"flex items-center space-x-3"},qr={class:"text-sm font-medium text-gray-700"},Or={class:"flex items-center space-x-2"},Wr={class:"flex items-center space-x-3"},Pr={class:"text-sm font-medium text-gray-700"},Zr={class:"flex items-center space-x-2"},Xr={key:1,class:"space-y-3"},jr={class:"text-sm font-medium text-gray-700"},zr={class:"mt-1 text-sm text-gray-600"},_r={key:1,class:"space-y-2"},$r=["src"],AC={class:"text-sm text-green-700 font-medium"},eC={class:"flex items-center space-x-3"},gC={class:"text-sm font-medium text-gray-700"},tC={class:"flex items-center space-x-2"},IC={class:"space-y-4"},oC={class:"font-medium text-gray-900"},iC={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},rC={class:"space-y-2"},CC={class:"text-sm font-medium text-gray-700"},nC={class:"absolute inset-0 bg-white bg-opacity-10 flex items-center justify-center rounded-lg"},BC={class:"space-y-2"},sC={class:"text-sm font-medium text-gray-700"},aC={class:"absolute inset-0 bg-black bg-opacity-10 flex items-center justify-center rounded-lg"},QC={class:"bg-blue-50 border border-blue-200 rounded-lg p-4"},EC={class:"font-medium text-blue-900 mb-2"},lC={class:"flex flex-wrap gap-2"},cC={__name:"BackgroundConfig",props:{modelValue:{type:Object,required:!0}},emits:["update:modelValue"],setup(e,{emit:A}){const{t:g}=TA(),t=e,I=A,o=j(null),i=j(null),r=nA({get:()=>t.modelValue.light.backgroundColor,set:k=>E(k)}),C=nA({get:()=>t.modelValue.dark.backgroundColor,set:k=>h(k)}),B=nA({get:()=>t.modelValue.light.textColor,set:k=>w(k)}),n=nA({get:()=>t.modelValue.dark.textColor,set:k=>u(k)}),Q=k=>{I("update:modelValue",{...t.modelValue,light:{...t.modelValue.light,backgroundType:k,backgroundImage:k==="image"?t.modelValue.light.backgroundImage:null}})},a=k=>{I("update:modelValue",{...t.modelValue,dark:{...t.modelValue.dark,backgroundType:k,backgroundImage:k==="image"?t.modelValue.dark.backgroundImage:null}})},E=k=>{I("update:modelValue",{...t.modelValue,light:{...t.modelValue.light,backgroundColor:k}})},h=k=>{I("update:modelValue",{...t.modelValue,dark:{...t.modelValue.dark,backgroundColor:k}})},w=k=>{I("update:modelValue",{...t.modelValue,light:{...t.modelValue.light,textColor:k}})},u=k=>{I("update:modelValue",{...t.modelValue,dark:{...t.modelValue.dark,textColor:k}})},l=(k,m)=>{const M=k.target.files[0];M&&c(m,M)},f=(k,m)=>{k.preventDefault();const M=k.dataTransfer.files;M.length>0&&c(m,M[0])},c=async(k,m)=>{m&&m.type.startsWith("image/")?(I("update:modelValue",{...t.modelValue,[k]:{...t.modelValue[k],backgroundImage:m}}),await Ie.saveBackgroundFile(k,m)):alert(g("backgroundConfig.selectValidImage"))},D=async k=>{I("update:modelValue",{...t.modelValue,[k]:{...t.modelValue[k],backgroundImage:null}}),k==="light"&&o.value&&(o.value.value=""),k==="dark"&&i.value&&(i.value.value=""),await Ie.deleteBackgroundFile(k)},y=k=>{const m=t.modelValue[k].backgroundImage;return m?URL.createObjectURL(m):null},v=()=>t.modelValue.light.backgroundType==="image"&&t.modelValue.light.backgroundImage?{backgroundImage:`url(${y("light")})`,backgroundSize:"cover",backgroundPosition:"center"}:{backgroundColor:t.modelValue.light.backgroundColor},N=()=>t.modelValue.dark.backgroundType==="image"&&t.modelValue.dark.backgroundImage?{backgroundImage:`url(${y("dark")})`,backgroundSize:"cover",backgroundPosition:"center"}:{backgroundColor:t.modelValue.dark.backgroundColor},L=(k,m)=>{const M=X(k)?"#000000":"#ffffff",oA=X(m)?"#000000":"#ffffff";I("update:modelValue",{...t.modelValue,light:{...t.modelValue.light,backgroundType:"color",backgroundColor:k,textColor:M,backgroundImage:null},dark:{...t.modelValue.dark,backgroundType:"color",backgroundColor:m,textColor:oA,backgroundImage:null}})},X=k=>{const m=k.replace("#",""),M=parseInt(m.substr(0,2),16),oA=parseInt(m.substr(2,2),16),F=parseInt(m.substr(4,2),16);return(M*299+oA*587+F*114)/1e3>128};return(k,m)=>(G(),U("div",lr,[s("div",null,[s("h3",cr,d(k.$t("backgroundConfig.title")),1),s("p",hr,d(k.$t("backgroundConfig.description")),1)]),s("div",ur,[s("h4",dr,[m[33]||(m[33]=s("svg",{class:"w-5 h-5 mr-2 text-yellow-500",fill:"currentColor",viewBox:"0 0 20 20"},[s("path",{"fill-rule":"evenodd",d:"M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z","clip-rule":"evenodd"})],-1)),HA(" "+d(k.$t("backgroundConfig.lightMode")),1)]),s("div",fr,[s("div",wr,[s("button",{onClick:m[0]||(m[0]=M=>Q("color")),class:gA(["px-3 py-2 text-sm border rounded transition-colors",e.modelValue.light.backgroundType==="color"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(k.$t("backgroundConfig.solidBackground")),3),s("button",{onClick:m[1]||(m[1]=M=>Q("image")),class:gA(["px-3 py-2 text-sm border rounded transition-colors",e.modelValue.light.backgroundType==="image"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(k.$t("backgroundConfig.imageBackground")),3)]),e.modelValue.light.backgroundType==="color"?(G(),U("div",yr,[s("div",pr,[s("label",Dr,d(k.$t("backgroundConfig.backgroundColor")),1),s("div",mr,[rA(s("input",{type:"color","onUpdate:modelValue":m[2]||(m[2]=M=>r.value=M),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[aA,r.value]]),rA(s("input",{type:"text","onUpdate:modelValue":m[3]||(m[3]=M=>r.value=M),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[aA,r.value]])]),s("div",{style:CA({backgroundColor:r.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)]),s("div",Fr,[s("label",kr,d(k.$t("backgroundConfig.textColor")),1),s("div",vr,[rA(s("input",{type:"color","onUpdate:modelValue":m[4]||(m[4]=M=>B.value=M),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[aA,B.value]]),rA(s("input",{type:"text","onUpdate:modelValue":m[5]||(m[5]=M=>B.value=M),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[aA,B.value]])]),s("div",{style:CA({backgroundColor:B.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)])])):O("",!0),e.modelValue.light.backgroundType==="image"?(G(),U("div",Sr,[s("label",Gr,d(k.$t("backgroundConfig.backgroundImage")),1),s("div",{onDrop:m[9]||(m[9]=M=>f(M,"light")),onDragover:m[10]||(m[10]=PA(()=>{},["prevent"])),onDragenter:m[11]||(m[11]=PA(()=>{},["prevent"])),class:gA(["border-2 border-dashed rounded-lg p-4 text-center cursor-pointer transition-colors",e.modelValue.light.backgroundImage?"border-green-300 bg-green-50":"border-gray-300 hover:border-gray-400"])},[s("input",{ref_key:"lightImageInput",ref:o,type:"file",accept:"image/*",onChange:m[6]||(m[6]=M=>l(M,"light")),class:"hidden"},null,544),e.modelValue.light.backgroundImage?(G(),U("div",Ur,[s("img",{src:y("light"),alt:"{{ $t('backgroundConfig.lightModePreview') }}背景",class:"max-w-32 max-h-32 mx-auto rounded shadow"},null,8,Nr),s("p",br,d(e.modelValue.light.backgroundImage.name),1),s("button",{onClick:m[8]||(m[8]=M=>D("light")),class:"text-red-600 hover:text-red-500 text-sm"},d(k.$t("backgroundConfig.removeImage")),1)])):(G(),U("div",{key:0,onClick:m[7]||(m[7]=M=>k.$refs.lightImageInput.click())},[m[34]||(m[34]=s("svg",{class:"mx-auto h-8 w-8 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),s("p",Rr,d(k.$t("backgroundConfig.clickOrDragToUpload")),1)]))],34),s("div",Lr,[s("label",Mr,d(k.$t("backgroundConfig.textColor")),1),s("div",Jr,[rA(s("input",{type:"color","onUpdate:modelValue":m[12]||(m[12]=M=>B.value=M),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[aA,B.value]]),rA(s("input",{type:"text","onUpdate:modelValue":m[13]||(m[13]=M=>B.value=M),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[aA,B.value]])]),s("div",{style:CA({backgroundColor:B.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)])])):O("",!0)])]),s("div",xr,[s("h4",Hr,[m[35]||(m[35]=s("svg",{class:"w-5 h-5 mr-2 text-gray-600",fill:"currentColor",viewBox:"0 0 20 20"},[s("path",{d:"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"})],-1)),HA(" "+d(k.$t("backgroundConfig.darkMode")),1)]),s("div",Yr,[s("div",Kr,[s("button",{onClick:m[14]||(m[14]=M=>a("color")),class:gA(["px-3 py-2 text-sm border rounded transition-colors",e.modelValue.dark.backgroundType==="color"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(k.$t("backgroundConfig.solidBackground")),3),s("button",{onClick:m[15]||(m[15]=M=>a("image")),class:gA(["px-3 py-2 text-sm border rounded transition-colors",e.modelValue.dark.backgroundType==="image"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(k.$t("backgroundConfig.imageBackground")),3)]),e.modelValue.dark.backgroundType==="color"?(G(),U("div",Tr,[s("div",Vr,[s("label",qr,d(k.$t("backgroundConfig.backgroundColor")),1),s("div",Or,[rA(s("input",{type:"color","onUpdate:modelValue":m[16]||(m[16]=M=>C.value=M),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[aA,C.value]]),rA(s("input",{type:"text","onUpdate:modelValue":m[17]||(m[17]=M=>C.value=M),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[aA,C.value]])]),s("div",{style:CA({backgroundColor:C.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)]),s("div",Wr,[s("label",Pr,d(k.$t("backgroundConfig.textColor")),1),s("div",Zr,[rA(s("input",{type:"color","onUpdate:modelValue":m[18]||(m[18]=M=>n.value=M),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[aA,n.value]]),rA(s("input",{type:"text","onUpdate:modelValue":m[19]||(m[19]=M=>n.value=M),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[aA,n.value]])]),s("div",{style:CA({backgroundColor:n.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)])])):O("",!0),e.modelValue.dark.backgroundType==="image"?(G(),U("div",Xr,[s("label",jr,d(k.$t("backgroundConfig.backgroundImage")),1),s("div",{onDrop:m[23]||(m[23]=M=>f(M,"dark")),onDragover:m[24]||(m[24]=PA(()=>{},["prevent"])),onDragenter:m[25]||(m[25]=PA(()=>{},["prevent"])),class:gA(["border-2 border-dashed rounded-lg p-4 text-center cursor-pointer transition-colors",e.modelValue.dark.backgroundImage?"border-green-300 bg-green-50":"border-gray-300 hover:border-gray-400"])},[s("input",{ref_key:"darkImageInput",ref:i,type:"file",accept:"image/*",onChange:m[20]||(m[20]=M=>l(M,"dark")),class:"hidden"},null,544),e.modelValue.dark.backgroundImage?(G(),U("div",_r,[s("img",{src:y("dark"),alt:"{{ $t('backgroundConfig.darkModePreview') }}背景",class:"max-w-32 max-h-32 mx-auto rounded shadow"},null,8,$r),s("p",AC,d(e.modelValue.dark.backgroundImage.name),1),s("button",{onClick:m[22]||(m[22]=M=>D("dark")),class:"text-red-600 hover:text-red-500 text-sm"},d(k.$t("backgroundConfig.removeImage")),1)])):(G(),U("div",{key:0,onClick:m[21]||(m[21]=M=>k.$refs.darkImageInput.click())},[m[36]||(m[36]=s("svg",{class:"mx-auto h-8 w-8 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),s("p",zr,d(k.$t("backgroundConfig.clickOrDragToUpload")),1)]))],34),s("div",eC,[s("label",gC,d(k.$t("backgroundConfig.textColor")),1),s("div",tC,[rA(s("input",{type:"color","onUpdate:modelValue":m[26]||(m[26]=M=>n.value=M),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[aA,n.value]]),rA(s("input",{type:"text","onUpdate:modelValue":m[27]||(m[27]=M=>n.value=M),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[aA,n.value]])]),s("div",{style:CA({backgroundColor:n.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)])])):O("",!0)])]),s("div",IC,[s("h4",oC,d(k.$t("backgroundConfig.backgroundPreview")),1),s("div",iC,[s("div",rC,[s("div",CC,d(k.$t("backgroundConfig.lightModePreview")),1),s("div",{style:CA(v()),class:"h-32 border border-gray-300 rounded-lg flex items-center justify-center text-sm relative overflow-hidden"},[s("div",nC,[s("span",{style:CA({color:e.modelValue.light.textColor})},d(k.$t("backgroundConfig.chatArea")),5)])],4)]),s("div",BC,[s("div",sC,d(k.$t("backgroundConfig.darkModePreview")),1),s("div",{style:CA(N()),class:"h-32 border border-gray-300 rounded-lg flex items-center justify-center text-sm relative overflow-hidden"},[s("div",aC,[s("span",{style:CA({color:e.modelValue.dark.textColor})},d(k.$t("backgroundConfig.chatArea")),5)])],4)])])]),s("div",QC,[s("h5",EC,d(k.$t("backgroundConfig.quickConfig")),1),s("div",lC,[s("button",{onClick:m[28]||(m[28]=M=>L("#ffffff","#1f2937")),class:"px-3 py-1 text-sm bg-white border border-gray-300 rounded hover:bg-gray-50"},d(k.$t("backgroundConfig.defaultColors")),1),s("button",{onClick:m[29]||(m[29]=M=>L("#f5f5f4","#374151")),class:"px-3 py-1 text-sm bg-stone-100 border border-gray-300 rounded hover:bg-stone-200"},d(k.$t("backgroundConfig.stoneTexture")),1),s("button",{onClick:m[30]||(m[30]=M=>L("#fef7cd","#7c2d12")),class:"px-3 py-1 text-sm bg-yellow-100 border border-gray-300 rounded hover:bg-yellow-200"},d(k.$t("backgroundConfig.sunnyColors")),1),s("button",{onClick:m[31]||(m[31]=M=>L("#e0f2fe","#1e40af")),class:"px-3 py-1 text-sm bg-sky-100 border border-gray-300 rounded hover:bg-sky-200"},d(k.$t("backgroundConfig.skyBlue")),1),s("button",{onClick:m[32]||(m[32]=M=>L("#fdf2f8","#be185d")),class:"px-3 py-1 text-sm bg-pink-100 border border-gray-300 rounded hover:bg-pink-200"},d(k.$t("backgroundConfig.romanticPink")),1)])])]))}},hC={class:"space-y-6"},uC={class:"text-xl font-semibold text-gray-900 mb-4"},dC={class:"text-gray-600 mb-6"},fC={class:"border-b border-gray-200"},wC={class:"-mb-px flex space-x-4 sm:space-x-8"},yC=["onClick"],pC={class:"flex items-center"},DC={class:"hidden sm:inline"},mC={class:"min-h-96"},FC={class:"flex justify-between"},kC={__name:"ThemeDesign",props:{modelValue:{type:Object,required:!0},chipModel:{type:String,required:!0},activeTab:{type:String,default:"wakeword"}},emits:["update:modelValue","next","prev","tabChange"],setup(e,{emit:A}){const{t:g}=TA(),t={render(){return eA("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[eA("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"})])}},I={render(){return eA("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 640 640"},[eA("path",{d:"M320 96C329.5 96 338 101.5 341.9 110.2L515.1 496L536 496C549.3 496 560 506.7 560 520C560 533.3 549.3 544 536 544L440 544C426.7 544 416 533.3 416 520C416 506.7 426.7 496 440 496L462.5 496L426.6 416L213.4 416L177.5 496L200 496C213.3 496 224 506.7 224 520C224 533.3 213.3 544 200 544L104 544C90.7 544 80 533.3 80 520C80 506.7 90.7 496 104 496L124.9 496L298.1 110.2C302 101.5 310.5 96 320 96zM320 178.6L235 368L405 368L320 178.6z"})])}},o={render(){return eA("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[eA("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])}},i={render(){return eA("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 640 640"},[eA("path",{d:"M160 144C151.2 144 144 151.2 144 160L144 480C144 488.8 151.2 496 160 496L480 496C488.8 496 496 488.8 496 480L496 160C496 151.2 488.8 144 480 144L160 144zM96 160C96 124.7 124.7 96 160 96L480 96C515.3 96 544 124.7 544 160L544 480C544 515.3 515.3 544 480 544L160 544C124.7 544 96 515.3 96 480L96 160zM224 192C241.7 192 256 206.3 256 224C256 241.7 241.7 256 224 256C206.3 256 192 241.7 192 224C192 206.3 206.3 192 224 192zM360 264C368.5 264 376.4 268.5 380.7 275.8L460.7 411.8C465.1 419.2 465.1 428.4 460.8 435.9C456.5 443.4 448.6 448 440 448L200 448C191.1 448 182.8 443 178.7 435.1C174.6 427.2 175.2 417.6 180.3 410.3L236.3 330.3C240.8 323.9 248.1 320.1 256 320.1C263.9 320.1 271.2 323.9 275.7 330.3L292.9 354.9L339.4 275.9C343.7 268.6 351.6 264.1 360.1 264.1z"})])}},r=e,C=A,B=j(r.activeTab),n=nA(()=>[{id:"wakeword",name:g("themeDesign.tabs.wakeword"),icon:t},{id:"font",name:g("themeDesign.tabs.font"),icon:I},{id:"emoji",name:g("themeDesign.tabs.emoji"),icon:o},{id:"background",name:g("themeDesign.tabs.background"),icon:i}]),Q=nA({get:()=>r.modelValue,set:h=>C("update:modelValue",h)}),a=()=>{var u,l,f;const h=r.modelValue.wakeword;if(h.type==="custom"){if(!((u=h.custom.name)!=null&&u.trim())){alert(g("wakewordConfig.errors.nameRequired"));return}if(!((l=h.custom.command)!=null&&l.trim())){alert(g("wakewordConfig.errors.commandRequired"));return}if(!h.custom.duration||h.custom.duration<500||h.custom.duration>1e4){alert(g("wakewordConfig.errors.durationRange"));return}}const w=r.modelValue.font;if(w.type==="custom"&&!((f=w.custom)!=null&&f.file)){alert(g("fontConfig.selectValidFontFile"));return}C("next")},E=h=>{B.value=h,C("tabChange",h)};return DA(()=>r.activeTab,h=>{B.value=h}),(h,w)=>(G(),U("div",hC,[s("div",null,[s("h2",uC,d(h.$t("themeDesign.title")),1),s("p",dC,d(h.$t("themeDesign.description")),1)]),s("div",fC,[s("nav",wC,[(G(!0),U(bA,null,LA(n.value,u=>(G(),U("button",{key:u.id,onClick:l=>E(u.id),class:gA(["py-2 px-1 border-b-2 font-medium text-sm relative",B.value===u.id?"border-primary-500 text-primary-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"])},[s("span",pC,[(G(),UA(Bt(u.icon),{class:"w-5 h-5 sm:mr-2"})),s("span",DC,d(u.name),1)])],10,yC))),128))])]),s("div",mC,[B.value==="wakeword"?(G(),UA(Mo,{key:0,modelValue:Q.value.wakeword,"onUpdate:modelValue":w[0]||(w[0]=u=>Q.value.wakeword=u),chipModel:e.chipModel},null,8,["modelValue","chipModel"])):O("",!0),B.value==="font"?(G(),UA(Gi,{key:1,modelValue:Q.value.font,"onUpdate:modelValue":w[1]||(w[1]=u=>Q.value.font=u)},null,8,["modelValue"])):O("",!0),B.value==="emoji"?(G(),UA(Er,{key:2,modelValue:Q.value.emoji,"onUpdate:modelValue":w[2]||(w[2]=u=>Q.value.emoji=u)},null,8,["modelValue"])):O("",!0),B.value==="background"?(G(),UA(cC,{key:3,modelValue:Q.value.skin,"onUpdate:modelValue":w[3]||(w[3]=u=>Q.value.skin=u)},null,8,["modelValue"])):O("",!0)]),s("div",FC,[s("button",{onClick:w[4]||(w[4]=u=>h.$emit("prev")),class:"bg-gray-500 hover:bg-gray-600 text-white px-6 py-2 rounded-lg font-medium transition-colors"},d(h.$t("themeDesign.previous")),1),s("button",{onClick:a,class:"bg-primary-500 hover:bg-primary-600 text-white px-6 py-2 rounded-lg font-medium transition-colors"},d(h.$t("themeDesign.next")),1)])]))}},vC=(e,A)=>{const g=e.__vccOpts||e;for(const[t,I]of A)g[t]=I;return g},SC={class:"space-y-6"},GC={class:"text-xl font-semibold text-gray-900 mb-4"},RC={class:"text-gray-600 mb-6"},UC={class:"flex flex-col lg:flex-row gap-8"},NC={class:"flex-1"},bC={class:"text-lg font-medium text-gray-900 mb-4"},LC={class:"bg-gray-100 p-4 rounded-lg"},MC={class:"max-w-full overflow-auto flex justify-center"},JC={class:"bg-gray-800 p-6 rounded-2xl shadow-2xl inline-block"},xC={class:"bg-gray-900 p-2 rounded-xl"},HC={class:"relative z-10 flex flex-col items-center justify-center p-4 text-center"},YC={class:"mb-4"},KC={key:0,class:"emoji-container"},TC=["src","alt"],VC={key:1,class:"emoji-container"},qC={class:"text-center"},OC={class:"text-sm"},WC={class:"text-xs"},PC={key:0,class:"absolute inset-0 flex items-center justify-center"},ZC={class:"animate-pulse text-gray-400 text-xs"},XC={class:"mt-3 text-center text-xs text-gray-400"},jC={class:"w-full lg:w-80"},zC={class:"text-lg font-medium text-gray-900 mb-4"},_C={class:"space-y-6 bg-white border border-gray-200 rounded-lg p-4"},$C={class:"block text-sm font-medium text-gray-700 mb-2"},An={class:"block text-sm font-medium text-gray-700 mb-2"},en={key:0,class:"flex flex-wrap gap-2 max-h-32 overflow-y-auto justify-center"},gn=["onClick","title"],tn={key:0},In=["src","alt"],on={key:1,class:"text-lg"},rn={key:1,class:"text-center py-4 text-gray-500 bg-gray-50 rounded-lg border-2 border-dashed"},Cn={class:"text-2xl mb-2"},nn={class:"text-sm"},Bn={class:"block text-sm font-medium text-gray-700 mb-2"},sn={class:"flex space-x-2"},an={class:"border-t pt-4"},Qn={class:"font-medium text-gray-900 mb-2"},En={class:"text-xs text-gray-600 space-y-1"},ln={key:0},cn={class:"flex items-center"},hn={key:0,class:"ml-2 animate-pulse text-blue-500"},un={key:1},dn={class:"flex justify-between"},fn={__name:"GenerateSummary",props:{config:{type:Object,required:!0}},emits:["prev","generate"],setup(e){const{t:A}=TA(),g=e,t=j(A("generateSummary.defaultPreviewText")),I=j("happy"),o=j("light"),i=j(!1),r=j(""),C=nA(()=>[{key:"neutral",name:A("generateSummary.emotions.neutral"),emoji:"😶"},{key:"happy",name:A("generateSummary.emotions.happy"),emoji:"🙂"},{key:"laughing",name:A("generateSummary.emotions.laughing"),emoji:"😆"},{key:"funny",name:A("generateSummary.emotions.funny"),emoji:"😂"},{key:"sad",name:A("generateSummary.emotions.sad"),emoji:"😔"},{key:"angry",name:A("generateSummary.emotions.angry"),emoji:"😠"},{key:"crying",name:A("generateSummary.emotions.crying"),emoji:"😭"},{key:"loving",name:A("generateSummary.emotions.loving"),emoji:"😍"},{key:"surprised",name:A("generateSummary.emotions.surprised"),emoji:"😯"},{key:"thinking",name:A("generateSummary.emotions.thinking"),emoji:"🤔"},{key:"cool",name:A("generateSummary.emotions.cool"),emoji:"😎"},{key:"sleepy",name:A("generateSummary.emotions.sleepy"),emoji:"😴"}]),B=nA(()=>{if(g.config.theme.emoji.type==="preset"&&g.config.theme.emoji.preset)return C.value;if(g.config.theme.emoji.type==="custom"){const F=g.config.theme.emoji.custom.images;return C.value.filter(S=>F[S.key])}else return[]}),n=nA(()=>c(I.value)),Q=()=>{const{width:F,height:S}=g.config.chip.display;return{width:`${F}px`,height:`${S}px`}},a=()=>{const F=g.config.theme.skin[o.value];if(F.backgroundType==="image"&&F.backgroundImage)try{if(F.backgroundImage&&typeof F.backgroundImage=="object"&&F.backgroundImage.size)return{backgroundImage:`url(${URL.createObjectURL(F.backgroundImage)})`,backgroundSize:"cover",backgroundPosition:"center"}}catch(S){console.warn("Failed to load background preview:",S)}return{backgroundColor:F.backgroundColor||"#ffffff"}},E={twemoji32:32,twemoji64:64,"noto-emoji_64":64,"noto-emoji_128":128},h=()=>{let F=48;return g.config.theme.emoji.type==="preset"?F=E[g.config.theme.emoji.preset]||32:g.config.theme.emoji.custom.size&&(F=Math.min(g.config.theme.emoji.custom.size.width,g.config.theme.emoji.custom.size.height)),{width:`${F}px`,height:`${F}px`}},w=()=>{let F=14;if(g.config.theme.font.type==="preset"){const J=g.config.theme.font.preset;J.includes("_14_")?F=14:J.includes("_16_")?F=16:J.includes("_20_")?F=20:J.includes("_30_")&&(F=30)}else g.config.theme.font.custom.size&&(F=g.config.theme.font.custom.size);const S=o.value==="dark"?g.config.theme.skin.dark.textColor:g.config.theme.skin.light.textColor;return{fontSize:`${F}px`,color:S,fontFamily:l(),textShadow:o.value==="dark"?"1px 1px 2px rgba(0,0,0,0.5)":"1px 1px 2px rgba(255,255,255,0.5)"}},u=async()=>{document.querySelectorAll("style[data-font-preview]").forEach(S=>S.remove()),i.value=!1,r.value="";try{if(g.config.theme.font.type==="preset"){const S=g.config.theme.font.preset;let J,V;S&&S.startsWith("font_noto_qwen_")?(J="NotoPreview",V="./static/fonts/noto_qwen.ttf"):(J="PuHuiPreview",V="./static/fonts/puhui_deepseek.ttf");const q=document.createElement("style");q.setAttribute("data-font-preview","true"),q.textContent=` - @font-face { - font-family: '${J}'; - src: url('${V}') format('truetype'); - font-display: swap; - } - `,document.head.appendChild(q),await document.fonts.load(`16px "${J}"`),r.value=J,i.value=!0}else if(g.config.theme.font.custom.file)try{const S=g.config.theme.font.custom.file;if(!S||typeof S!="object"||!S.size)throw new Error("Invalid font file object");const J="CustomFontPreview",V=URL.createObjectURL(S),q=document.createElement("style");q.setAttribute("data-font-preview","true"),q.textContent=` - @font-face { - font-family: '${J}'; - src: url('${V}'); - font-display: swap; - } - `,document.head.appendChild(q),await document.fonts.load(`16px "${J}"`),r.value=J,i.value=!0}catch(S){console.warn("Failed to load custom font preview:",S),r.value="system-ui",i.value=!0}else r.value="system-ui",i.value=!0}catch(S){console.warn("Font loading failed:",S),r.value="system-ui",i.value=!0}},l=()=>i.value&&r.value?`"${r.value}", "Noto Sans", "Segoe UI", sans-serif`:'"Noto Sans", "Segoe UI", sans-serif',f={twemoji32:"png",twemoji64:"png","noto-emoji_64":"gif","noto-emoji_128":"gif"},c=F=>{if(g.config.theme.emoji.type==="preset"){const S=g.config.theme.emoji.preset,J=f[S]||"png";return`./static/emojis/${S}/${F}.${J}`}else if(g.config.theme.emoji.type==="custom"&&g.config.theme.emoji.custom.images[F])try{const S=g.config.theme.emoji.custom.images[F];if(S&&typeof S=="object"&&S.size)return URL.createObjectURL(S)}catch(S){console.warn(`Failed to load emoji preview (${F}):`,S)}return null},D=F=>{const S=C.value.find(J=>J.key===F);return S?S.emoji:"😶"},y=()=>{if(g.config.theme.emoji.type==="preset"){const F=E[g.config.theme.emoji.preset]||32;return Math.min(F+16,80)}else if(g.config.theme.emoji.custom.size){const F=Math.min(g.config.theme.emoji.custom.size.width,g.config.theme.emoji.custom.size.height);return Math.min(F+16,80)}return 48},v=()=>{if(g.config.theme.emoji.type==="preset"){const F=E[g.config.theme.emoji.preset]||32;return Math.min(F,64)}else if(g.config.theme.emoji.custom.size)return Math.min(g.config.theme.emoji.custom.size.width,g.config.theme.emoji.custom.size.height,64);return 32},N=F=>{I.value=F},L={wn9s_hilexin:"generateModal.wakewordNames.wn9s_hilexin",wn9s_hiesp:"generateModal.wakewordNames.wn9s_hiesp",wn9s_nihaoxiaozhi:"generateModal.wakewordNames.wn9s_nihaoxiaozhi",wn9s_hijason:"Hi, Jason",wn9s_alexa:"Alexa",wn9_hilexin:"Hi, Espressif",wn9_hiesp:"Hi, ESP",wn9_nihaoxiaozhi_tts:"generateModal.wakewordNames.wn9_nihaoxiaozhi_tts",wn9_hijason_tts2:"Hi, Jason",wn9_himfive:"Hi, M Five",wn9_alexa:"generateModal.wakewordNames.wn9_alexa",wn9_jarvis_tts:"Jarvis",wn9_computer_tts:"Computer",wn9_heywillow_tts:"Hey, Willow",wn9_sophia_tts:"Sophia",wn9_heyprinter_tts:"Hey, Printer",wn9_hijoy_tts:"Hi, Joy",wn9_heywanda_tts:"Hey, Wand",wn9_astrolabe_tts:"Astrolabe",wn9_heyily_tts2:"Hey, Ily",wn9_hijolly_tts2:"Hi, Jolly",wn9_hifairy_tts2:"Hi, Fairy",wn9_bluechip_tts2:"Blue Chip",wn9_hiandy_tts2:"Hi, Andy",wn9_heyivy_tts2:"Hey, Ivy",wn9_histackchan_tts3:"Hi, Stack Chan",wn9_hiwalle_tts2:"Hi, Wall E",wn9_hilili_tts:"Hi, Lily",wn9_hitelly_tts:"Hi, Telly",wn9_linaiban_tts2:"Lina Board"},X=F=>{const S=L[F];return S!=null&&S.startsWith("generateModal.")?A(S):S||F},k=()=>{const F=g.config.theme.wakeword;return!F||F.type==="none"?A("wakewordConfig.noWakeword"):F.type==="preset"?X(F.preset):F.type==="custom"?F.custom.name||A("wakewordConfig.customWakeword"):A("wakewordConfig.noWakeword")},m=()=>{if(g.config.theme.font.type==="preset")return A("fontConfig.presetFontNames."+g.config.theme.font.preset)||g.config.theme.font.preset;{const F=g.config.theme.font.custom;return A("generateSummary.customFont",{size:F.size})}},M=()=>{if(g.config.theme.emoji.type==="preset"&&g.config.theme.emoji.preset)return{twemoji32:"Twemoji 32×32",twemoji64:"Twemoji 64×64","noto-emoji_64":"Noto Emoji 64×64","noto-emoji_128":"Noto Emoji 128×128"}[g.config.theme.emoji.preset]||g.config.theme.emoji.preset;if(g.config.theme.emoji.type==="custom"){const F=Object.keys(g.config.theme.emoji.custom.images).length;return A("generateSummary.customEmoji",{count:F})}else return g.config.theme.emoji.type==="none"?A("emojiConfig.noEmojiPack"):A("generateSummary.notConfigured")},oA=()=>{const F=g.config.theme.skin.light.backgroundType==="image"?A("generateSummary.image"):A("generateSummary.color"),S=g.config.theme.skin.dark.backgroundType==="image"?A("generateSummary.image"):A("generateSummary.color");return A("generateSummary.skinLight",{type:F})+"/"+A("generateSummary.skinDark",{type:S})};return DA(()=>g.config.theme.font,()=>{u()},{deep:!0}),Me(async()=>{B.value.length>0?I.value=B.value[0].key:I.value="",await u()}),st(()=>{document.querySelectorAll("style[data-font-preview]").forEach(S=>S.remove())}),(F,S)=>(G(),U("div",SC,[s("div",null,[s("h2",GC,d(F.$t("generateSummary.title")),1),s("p",RC,d(F.$t("generateSummary.description")),1)]),s("div",UC,[s("div",NC,[s("h3",bC,d(F.$t("generateSummary.devicePreview")),1),s("div",LC,[s("div",MC,[s("div",JC,[s("div",xC,[s("div",{style:CA(Q()),class:"relative rounded-lg overflow-hidden border-2 border-gray-700 flex flex-col items-center justify-center"},[s("div",{style:CA(a()),class:"absolute inset-0"},null,4),s("div",HC,[s("div",YC,[I.value&&B.value.length>0?(G(),U("div",KC,[n.value?(G(),U("img",{key:0,src:n.value,alt:I.value,style:CA(h()),class:"emoji-image"},null,12,TC)):(G(),U("div",{key:1,style:CA(h()),class:"emoji-fallback bg-gray-200 rounded-full flex items-center justify-center text-2xl"},d(D(I.value)),5))])):(G(),U("div",VC,[s("div",{style:CA(h()),class:"emoji-placeholder flex items-center justify-center text-gray-400 border-2 border-dashed border-gray-300 rounded bg-gray-50"},[s("div",qC,[s("div",OC,d(e.config.theme.emoji.type==="none"?"📦":"😕"),1),s("div",WC,d(e.config.theme.emoji.type==="none"?F.$t("emojiConfig.noEmojiPack"):F.$t("generateSummary.noEmotionConfigured")),1)])],4)]))]),e.config.theme.font.hide_subtitle?O("",!0):(G(),U("div",{key:0,style:CA(w()),class:"text-message max-w-full break-words relative"},[i.value?O("",!0):(G(),U("div",PC,[s("div",ZC,d(F.$t("generateSummary.fontLoading")),1)])),s("div",{class:gA({"opacity-0":!i.value})},d(t.value),3)],4))])],4)]),s("div",XC,d(e.config.chip.display.width)+" × "+d(e.config.chip.display.height)+" "+d(e.config.chip.model.toUpperCase()),1)])])])]),s("div",jC,[s("h3",zC,d(F.$t("generateSummary.previewSettings")),1),s("div",_C,[s("div",null,[s("label",$C,d(F.$t("generateSummary.previewText")),1),rA(s("textarea",{"onUpdate:modelValue":S[0]||(S[0]=J=>t.value=J),class:"w-full border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500",rows:"3",placeholder:"Hi, I'm your friend Xiaozhi!"},null,512),[[aA,t.value]])]),s("div",null,[s("label",An,d(F.$t("generateSummary.currentEmotion")),1),B.value.length>0?(G(),U("div",en,[(G(!0),U(bA,null,LA(B.value,J=>(G(),U("button",{key:J.key,onClick:V=>N(J.key),class:gA(["p-2 border rounded transition-colors flex items-center justify-center",I.value===J.key?"border-primary-500 bg-primary-50":"border-gray-200 hover:border-gray-300"]),title:J.name,style:CA({width:y()+"px",height:y()+"px"})},[c(J.key)?(G(),U("div",tn,[s("img",{src:c(J.key),alt:J.name,style:CA({width:v()+"px",height:v()+"px"}),class:"object-contain rounded"},null,12,In)])):(G(),U("div",on,d(J.emoji),1))],14,gn))),128))])):(G(),U("div",rn,[s("div",Cn,d(e.config.theme.emoji.type==="none"?"📦":"😕"),1),s("div",nn,d(e.config.theme.emoji.type==="none"?F.$t("emojiConfig.noEmojiPackDescription"):F.$t("generateSummary.configureEmojiFirst")),1)]))]),s("div",null,[s("label",Bn,d(F.$t("generateSummary.themeMode")),1),s("div",sn,[s("button",{onClick:S[1]||(S[1]=J=>o.value="light"),class:gA(["flex-1 py-2 px-3 text-sm border rounded transition-colors",o.value==="light"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])}," 🌞 "+d(F.$t("generateSummary.lightMode")),3),s("button",{onClick:S[2]||(S[2]=J=>o.value="dark"),class:gA(["flex-1 py-2 px-3 text-sm border rounded transition-colors",o.value==="dark"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])}," 🌙 "+d(F.$t("generateSummary.darkMode")),3)])]),s("div",an,[s("h4",Qn,d(F.$t("generateSummary.configSummary")),1),s("div",En,[e.config.theme.wakeword?(G(),U("div",ln,d(F.$t("generateSummary.wakeword"))+" "+d(k()),1)):O("",!0),s("div",cn,[s("span",null,d(F.$t("generateSummary.font"))+" "+d(m()),1),i.value?O("",!0):(G(),U("span",hn,d(F.$t("generateSummary.loading")),1))]),s("div",null,d(F.$t("generateSummary.emotion"))+" "+d(M()),1),s("div",null,d(F.$t("generateSummary.skin"))+" "+d(oA()),1),e.config.theme.font.hide_subtitle?(G(),U("div",un,d(F.$t("generateSummary.hideSubtitle"))+" "+d(F.$t("common.yes")),1)):O("",!0)])])])])]),s("div",dn,[s("button",{onClick:S[3]||(S[3]=J=>F.$emit("prev")),class:"bg-gray-500 hover:bg-gray-600 text-white px-6 py-2 rounded-lg font-medium transition-colors"},d(F.$t("generateSummary.previous")),1),s("button",{onClick:S[4]||(S[4]=J=>F.$emit("generate")),class:"bg-green-500 hover:bg-green-600 text-white px-8 py-2 rounded-lg font-medium transition-colors flex items-center"},[S[5]||(S[5]=s("svg",{class:"w-5 h-5 mr-2",fill:"currentColor",viewBox:"0 0 20 20"},[s("path",{"fill-rule":"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)),HA(" "+d(F.$t("generateSummary.generate")),1)])])]))}},wn=vC(fn,[["__scopeId","data-v-38d663e6"]]);/*! https://mths.be/codepointat v0.2.0 by @mathias */String.prototype.codePointAt||function(){var e=function(){try{var g={},t=Object.defineProperty,I=t(g,g,g)&&t}catch{}return I}(),A=function(g){if(this==null)throw TypeError();var t=String(this),I=t.length,o=g?Number(g):0;if(o!=o&&(o=0),!(o<0||o>=I)){var i=t.charCodeAt(o),r;return i>=55296&&i<=56319&&I>o+1&&(r=t.charCodeAt(o+1),r>=56320&&r<=57343)?(i-55296)*1024+r-56320+65536:i}};e?e(String.prototype,"codePointAt",{value:A,configurable:!0,writable:!0}):String.prototype.codePointAt=A}();var rg=0,at=-3;function se(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function yn(e,A){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=A,this.destLen=0,this.ltree=new se,this.dtree=new se}var Qt=new se,Et=new se,Cg=new Uint8Array(30),ng=new Uint16Array(30),lt=new Uint8Array(30),ct=new Uint16Array(30),pn=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),yg=new se,GA=new Uint8Array(320);function ht(e,A,g,t){var I,o;for(I=0;I>>=1,A}function RA(e,A,g){if(!A)return g;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-A;return e.tag>>>=A,e.bitcount-=A,t+g}function je(e,A){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++I,g+=A.table[I],t-=A.table[I];while(t>=0);return e.tag=o,e.bitcount-=I,A.trans[g+t]}function Fn(e,A,g){var t,I,o,i,r,C;for(t=RA(e,5,257),I=RA(e,5,1),o=RA(e,4,4),i=0;i<19;++i)GA[i]=0;for(i=0;i8;)e.sourceIndex--,e.bitcount-=8;if(A=e.source[e.sourceIndex+1],A=256*A+e.source[e.sourceIndex],g=e.source[e.sourceIndex+3],g=256*g+e.source[e.sourceIndex+2],A!==(~g&65535))return at;for(e.sourceIndex+=4,t=A;t;--t)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,rg}function vn(e,A){var g=new yn(e,A),t,I,o;do{switch(t=mn(g),I=RA(g,2,0),I){case 0:o=kn(g);break;case 1:o=Dg(g,Qt,Et);break;case 2:Fn(g,g.ltree,g.dtree),o=Dg(g,g.ltree,g.dtree);break;default:o=at}if(o!==rg)throw new Error("Data error")}while(!t);return g.destLenthis.x2&&(this.x2=e)),typeof A=="number"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=A,this.y2=A),Athis.y2&&(this.y2=A))};VA.prototype.addX=function(e){this.addPoint(e,null)};VA.prototype.addY=function(e){this.addPoint(null,e)};VA.prototype.addBezier=function(e,A,g,t,I,o,i,r){var C=[e,A],B=[g,t],n=[I,o],Q=[i,r];this.addPoint(e,A),this.addPoint(i,r);for(var a=0;a<=1;a++){var E=6*C[a]-12*B[a]+6*n[a],h=-3*C[a]+9*B[a]-9*n[a]+3*Q[a],w=3*B[a]-3*C[a];if(h===0){if(E===0)continue;var u=-w/E;0=0&&C>0&&(r+=" "),r+=A(B)}return r}for(var t="",I=0;I=0&&e<=255,"Byte value should be between 0 and 255."),[e]};P.BYTE=vA(1);x.CHAR=function(e){return[e.charCodeAt(0)]};P.CHAR=vA(1);x.CHARARRAY=function(e){typeof e>"u"&&(e="",console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));for(var A=[],g=0;g"u"?0:e.length};x.USHORT=function(e){return[e>>8&255,e&255]};P.USHORT=vA(2);x.SHORT=function(e){return e>=Fg&&(e=-(2*Fg-e)),[e>>8&255,e&255]};P.SHORT=vA(2);x.UINT24=function(e){return[e>>16&255,e>>8&255,e&255]};P.UINT24=vA(3);x.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]};P.ULONG=vA(4);x.LONG=function(e){return e>=kg&&(e=-(2*kg-e)),[e>>24&255,e>>16&255,e>>8&255,e&255]};P.LONG=vA(4);x.FIXED=x.ULONG;P.FIXED=P.ULONG;x.FWORD=x.SHORT;P.FWORD=P.SHORT;x.UFWORD=x.USHORT;P.UFWORD=P.USHORT;x.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,e&255]};P.LONGDATETIME=vA(8);x.TAG=function(e){return W.argument(e.length===4,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]};P.TAG=vA(4);x.Card8=x.BYTE;P.Card8=P.BYTE;x.Card16=x.USHORT;P.Card16=P.USHORT;x.OffSize=x.BYTE;P.OffSize=P.BYTE;x.SID=x.USHORT;P.SID=P.USHORT;x.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?(e=e-108,[(e>>8)+247,e&255]):e>=-1131&&e<=-108?(e=-e-108,[(e>>8)+251,e&255]):e>=-32768&&e<=32767?x.NUMBER16(e):x.NUMBER32(e)};P.NUMBER=function(e){return x.NUMBER(e).length};x.NUMBER16=function(e){return[28,e>>8&255,e&255]};P.NUMBER16=vA(3);x.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,e&255]};P.NUMBER32=vA(5);x.REAL=function(e){var A=e.toString(),g=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(A);if(g){var t=parseFloat("1e"+((g[2]?+g[2]:0)+g[1].length));A=(Math.round(e*t)/t).toString()}for(var I="",o=0,i=A.length;o>8&255,A[A.length]=t&255}return A};P.UTF16=function(e){return e.length*2};var ze={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};oe.MACSTRING=function(e,A,g,t){var I=ze[t];if(I!==void 0){for(var o="",i=0;i=128&&(o=g[o],o===void 0))return;t[I]=o}return t}};P.MACSTRING=function(e,A){var g=x.MACSTRING(e,A);return g!==void 0?g.length:0};function _e(e){return e>=-128&&e<=127}function Rn(e,A,g){for(var t=0,I=e.length;A>8&255,C+256&255)}return o}x.VARDELTAS=function(e){for(var A=0,g=[];A=-128&&t<=127?A=Un(e,A,g):A=Nn(e,A,g)}return g};x.INDEX=function(e){for(var A=1,g=[A],t=[],I=0;I>8,A[Q+1]=a&255,A=A.concat(t[n])}return A};P.TABLE=function(e){for(var A=0,g=e.fields.length,t=0;t0)return new p(this.data,this.offset+A).parseStruct(e)};p.prototype.parsePointer32=function(e){var A=this.parseOffset32();if(A>0)return new p(this.data,this.offset+A).parseStruct(e)};p.prototype.parseListOfLists=function(e){for(var A=this.parseOffset16List(),g=A.length,t=this.relativeOffset,I=new Array(g),o=0;o>1,A.skip("uShort",3),e.glyphIndexMap={};for(var i=new T.Parser(g,t+I+14),r=new T.Parser(g,t+I+16+o*2),C=new T.Parser(g,t+I+16+o*4),B=new T.Parser(g,t+I+16+o*6),n=t+I+16+o*8,Q=0;Q=0;I-=1){var o=T.getUShort(e,A+4+I*8),i=T.getUShort(e,A+4+I*8+2);if(o===3&&(i===0||i===1||i===10)||o===0&&(i===0||i===1||i===2||i===3||i===4)){t=T.getULong(e,A+4+I*8+4);break}}if(t===-1)throw new Error("No valid cmap sub-tables found.");var r=new T.Parser(e,A+t);if(g.format=r.parseUShort(),g.format===12)Yn(g,r);else if(g.format===4)Kn(g,r,e,A,t);else throw new Error("Only format 4 and 12 cmap tables are supported (found format "+g.format+").");return g}function Vn(e,A,g){e.segments.push({end:A,start:A,delta:-(A-g),offset:0,glyphIndex:g})}function qn(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}function On(e){var A=!0,g;for(g=e.length-1;g>0;g-=1){var t=e.get(g);if(t.unicode>65535){console.log("Adding CMAP format 12 (needed!)"),A=!1;break}}var I=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:A?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:A?12:20}];A||(I=I.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),I=I.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var o=new Y.Table("cmap",I);for(o.segments=[],g=0;g>4,i=I&15;if(o===g||(A+=t[o],i===g))break;A+=t[i]}return parseFloat(A)}function oB(e,A){var g,t,I,o;if(A===28)return g=e.parseByte(),t=e.parseByte(),g<<8|t;if(A===29)return g=e.parseByte(),t=e.parseByte(),I=e.parseByte(),o=e.parseByte(),g<<24|t<<16|I<<8|o;if(A===30)return IB(e);if(A>=32&&A<=246)return A-139;if(A>=247&&A<=250)return g=e.parseByte(),(A-247)*256+g+108;if(A>=251&&A<=254)return g=e.parseByte(),-(A-251)*256-g-108;throw new Error("Invalid b0 "+A)}function iB(e){for(var A={},g=0;g>1,C.length=0,n=!0}function N(L){for(var X,k,m,M,oA,F,S,J,V,q,$,AA,_=0;_1&&!n&&(D=C.shift()+l,n=!0),E+=C.pop(),y(a,E);break;case 5:for(;C.length>0;)a+=C.shift(),E+=C.shift(),r.lineTo(a,E);break;case 6:for(;C.length>0&&(a+=C.shift(),r.lineTo(a,E),C.length!==0);)E+=C.shift(),r.lineTo(a,E);break;case 7:for(;C.length>0&&(E+=C.shift(),r.lineTo(a,E),C.length!==0);)a+=C.shift(),r.lineTo(a,E);break;case 8:for(;C.length>0;)t=a+C.shift(),I=E+C.shift(),o=t+C.shift(),i=I+C.shift(),a=o+C.shift(),E=i+C.shift(),r.curveTo(t,I,o,i,a,E);break;case 10:oA=C.pop()+w,F=h[oA],F&&N(F);break;case 11:return;case 12:switch(iA=L[_],_+=1,iA){case 35:t=a+C.shift(),I=E+C.shift(),o=t+C.shift(),i=I+C.shift(),S=o+C.shift(),J=i+C.shift(),V=S+C.shift(),q=J+C.shift(),$=V+C.shift(),AA=q+C.shift(),a=$+C.shift(),E=AA+C.shift(),C.shift(),r.curveTo(t,I,o,i,S,J),r.curveTo(V,q,$,AA,a,E);break;case 34:t=a+C.shift(),I=E,o=t+C.shift(),i=I+C.shift(),S=o+C.shift(),J=i,V=S+C.shift(),q=i,$=V+C.shift(),AA=E,a=$+C.shift(),r.curveTo(t,I,o,i,S,J),r.curveTo(V,q,$,AA,a,E);break;case 36:t=a+C.shift(),I=E+C.shift(),o=t+C.shift(),i=I+C.shift(),S=o+C.shift(),J=i,V=S+C.shift(),q=i,$=V+C.shift(),AA=q+C.shift(),a=$+C.shift(),r.curveTo(t,I,o,i,S,J),r.curveTo(V,q,$,AA,a,E);break;case 37:t=a+C.shift(),I=E+C.shift(),o=t+C.shift(),i=I+C.shift(),S=o+C.shift(),J=i+C.shift(),V=S+C.shift(),q=J+C.shift(),$=V+C.shift(),AA=q+C.shift(),Math.abs($-a)>Math.abs(AA-E)?a=$+C.shift():E=AA+C.shift(),r.curveTo(t,I,o,i,S,J),r.curveTo(V,q,$,AA,a,E);break;default:console.log("Glyph "+A.index+": unknown operator 1200"+iA),C.length=0}break;case 14:C.length>0&&!n&&(D=C.shift()+l,n=!0),Q&&(r.closePath(),Q=!1);break;case 18:v();break;case 19:case 20:v(),_+=B+7>>3;break;case 21:C.length>2&&!n&&(D=C.shift()+l,n=!0),E+=C.pop(),a+=C.pop(),y(a,E);break;case 22:C.length>1&&!n&&(D=C.shift()+l,n=!0),a+=C.pop(),y(a,E);break;case 23:v();break;case 24:for(;C.length>2;)t=a+C.shift(),I=E+C.shift(),o=t+C.shift(),i=I+C.shift(),a=o+C.shift(),E=i+C.shift(),r.curveTo(t,I,o,i,a,E);a+=C.shift(),E+=C.shift(),r.lineTo(a,E);break;case 25:for(;C.length>6;)a+=C.shift(),E+=C.shift(),r.lineTo(a,E);t=a+C.shift(),I=E+C.shift(),o=t+C.shift(),i=I+C.shift(),a=o+C.shift(),E=i+C.shift(),r.curveTo(t,I,o,i,a,E);break;case 26:for(C.length%2&&(a+=C.shift());C.length>0;)t=a,I=E+C.shift(),o=t+C.shift(),i=I+C.shift(),a=o,E=i+C.shift(),r.curveTo(t,I,o,i,a,E);break;case 27:for(C.length%2&&(E+=C.shift());C.length>0;)t=a+C.shift(),I=E,o=t+C.shift(),i=I+C.shift(),a=o+C.shift(),E=i,r.curveTo(t,I,o,i,a,E);break;case 28:X=L[_],k=L[_+1],C.push((X<<24|k<<16)>>16),_+=2;break;case 29:oA=C.pop()+e.gsubrsBias,F=e.gsubrs[oA],F&&N(F);break;case 30:for(;C.length>0&&(t=a,I=E+C.shift(),o=t+C.shift(),i=I+C.shift(),a=o+C.shift(),E=i+(C.length===1?C.shift():0),r.curveTo(t,I,o,i,a,E),C.length!==0);)t=a+C.shift(),I=E,o=t+C.shift(),i=I+C.shift(),E=i+C.shift(),a=o+(C.length===1?C.shift():0),r.curveTo(t,I,o,i,a,E);break;case 31:for(;C.length>0&&(t=a+C.shift(),I=E,o=t+C.shift(),i=I+C.shift(),E=i+C.shift(),a=o+(C.length===1?C.shift():0),r.curveTo(t,I,o,i,a,E),C.length!==0);)t=a,I=E+C.shift(),o=t+C.shift(),i=I+C.shift(),a=o+C.shift(),E=i+(C.length===1?C.shift():0),r.curveTo(t,I,o,i,a,E);break;default:iA<32?console.log("Glyph "+A.index+": unknown operator "+iA):iA<247?C.push(iA-139):iA<251?(X=L[_],_+=1,C.push((iA-247)*256+X+108)):iA<255?(X=L[_],_+=1,C.push(-(iA-251)*256-X-108)):(X=L[_],k=L[_+1],m=L[_+2],M=L[_+3],_+=4,C.push((X<<24|k<<16|m<<8|M)/65536))}}}return N(g),A.advanceWidth=D,r}function sB(e,A,g,t){var I=[],o,i=new T.Parser(e,A),r=i.parseCard8();if(r===0)for(var C=0;C=t)throw new Error("CFF table CID Font FDSelect has bad FD index value "+o+" (FD count "+t+")");I.push(o)}else if(r===3){var B=i.parseCard16(),n=i.parseCard16();if(n!==0)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+n);for(var Q,a=0;a=t)throw new Error("CFF table CID Font FDSelect has bad FD index value "+o+" (FD count "+t+")");if(Q>g)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+Q);for(;n=0&&(g=t),t=A.indexOf(e),t>=0?g=t+ve.length:(g=ve.length+A.length,A.push(e)),g}function QB(){return new Y.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function EB(e){var A=new Y.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);A.names=[];for(var g=0;g=g.begin&&e=1&&(g.ulCodePageRange1=t.parseULong(),g.ulCodePageRange2=t.parseULong()),g.version>=2&&(g.sxHeight=t.parseShort(),g.sCapHeight=t.parseShort(),g.usDefaultChar=t.parseUShort(),g.usBreakChar=t.parseUShort(),g.usMaxContent=t.parseUShort()),g}function VB(e){return new Y.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)}var tg={parse:TB,make:VB,unicodeRanges:gg,getUnicodeRange:KB};function qB(e,A){var g={},t=new T.Parser(e,A);switch(g.version=t.parseVersion(),g.italicAngle=t.parseFixed(),g.underlinePosition=t.parseShort(),g.underlineThickness=t.parseShort(),g.isFixedPitch=t.parseULong(),g.minMemType42=t.parseULong(),g.maxMemType42=t.parseULong(),g.minMemType1=t.parseULong(),g.maxMemType1=t.parseULong(),g.version){case 1:g.names=_A.slice();break;case 2:g.numberOfGlyphs=t.parseUShort(),g.glyphNameIndex=new Array(g.numberOfGlyphs);for(var I=0;I=_A.length){var i=t.parseChar();g.names.push(t.parseString(i))}break;case 2.5:g.numberOfGlyphs=t.parseUShort(),g.offset=new Array(g.numberOfGlyphs);for(var r=0;rQ.value.tag?1:-1}),A.fields=A.fields.concat(t),A.fields=A.fields.concat(I),A}function xg(e,A,g){for(var t=0;t0){var o=e.glyphs.get(I);return o.getMetrics()}}return g}function jB(e){for(var A=0,g=0;gu||C===void 0)&&u>0&&(C=u),B 123 are reserved for internal usage");if(w.name!==".notdef"){var f=w.getMetrics();A.push(f.xMin),g.push(f.yMin),t.push(f.xMax),I.push(f.yMax),i.push(f.leftSideBearing),r.push(f.rightSideBearing),o.push(w.advanceWidth)}}var c={xMin:Math.min.apply(null,A),yMin:Math.min.apply(null,g),xMax:Math.max.apply(null,t),yMax:Math.max.apply(null,I),advanceWidthMax:Math.max.apply(null,o),advanceWidthAvg:jB(o),minLeftSideBearing:Math.min.apply(null,i),maxLeftSideBearing:Math.max.apply(null,i),minRightSideBearing:Math.min.apply(null,r)};c.ascender=e.ascender,c.descender=e.descender;var D=Ut.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:c.xMin,yMin:c.yMin,xMax:c.xMax,yMax:c.yMax,lowestRecPPEM:3,createdTimestamp:e.createdTimestamp}),y=Nt.make({ascender:c.ascender,descender:c.descender,advanceWidthMax:c.advanceWidthMax,minLeftSideBearing:c.minLeftSideBearing,minRightSideBearing:c.minRightSideBearing,xMaxExtent:c.maxLeftSideBearing+(c.xMax-c.xMin),numberOfHMetrics:e.glyphs.length}),v=Mt.make(e.glyphs.length),N=tg.make(Object.assign({xAvgCharWidth:Math.round(c.advanceWidthAvg),usFirstCharIndex:C,usLastCharIndex:B,ulUnicodeRange1:n,ulUnicodeRange2:Q,ulUnicodeRange3:a,ulUnicodeRange4:E,sTypoAscender:c.ascender,sTypoDescender:c.descender,sTypoLineGap:0,usWinAscent:c.yMax,usWinDescent:Math.abs(c.yMin),ulCodePageRange1:1,sxHeight:xg(e,"xyvw",{yMax:Math.round(c.ascender/2)}).yMax,sCapHeight:xg(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",c).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0},e.tables.os2)),L=bt.make(e.glyphs),X=ft.make(e.glyphs),k=e.getEnglishName("fontFamily"),m=e.getEnglishName("fontSubfamily"),M=k+" "+m,oA=e.getEnglishName("postScriptName");oA||(oA=k.replace(/\s/g,"")+"-"+m);var F={};for(var S in e.names)F[S]=e.names[S];F.uniqueID||(F.uniqueID={en:e.getEnglishName("manufacturer")+":"+M}),F.postScriptName||(F.postScriptName={en:oA}),F.preferredFamily||(F.preferredFamily=e.names.fontFamily),F.preferredSubfamily||(F.preferredSubfamily=e.names.fontSubfamily);var J=[],V=Kt.make(F,J),q=J.length>0?Lt.make(J):void 0,$=Tt.make(),AA=Rt.make(e.glyphs,{version:e.getEnglishName("version"),fullName:M,familyName:k,weightName:m,postScriptName:oA,unitsPerEm:e.unitsPerEm,fontBBox:[0,c.yMin,c.ascender,c.advanceWidthMax]}),_=e.metas&&Object.keys(e.metas).length>0?qt.make(e.metas):void 0,iA=[D,y,v,N,V,X,$,AA,L];q&&iA.push(q),e.tables.gsub&&iA.push(Vt.make(e.tables.gsub)),_&&iA.push(_);for(var b=Ot(iA),H=b.encode(),Z=Qg(H),IA=b.fields,z=!1,lA=0;lA>>1,o=e[I].tag;if(o===A)return I;o>>1,o=e[I];if(o===A)return I;o>>1;g=e[o];var i=g.start;if(i===A)return g;i0)return g=e[t-1],A>g.end?0:g}function ce(e,A){this.font=e,this.tableName=A}ce.prototype={searchTag:Ke,binSearch:Hg,getTable:function(e){var A=this.font.tables[this.tableName];return!A&&e&&(A=this.font.tables[this.tableName]=this.createDefaultTable()),A},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(A){return A.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var A=!1,g=0;g=0)return t[I].script;if(A){var o={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return t.splice(-1-I,0,o),o.script}}},getLangSysTable:function(e,A,g){var t=this.getScriptTable(e,g);if(t){if(!A||A==="dflt"||A==="DFLT")return t.defaultLangSys;var I=Ke(t.langSysRecords,A);if(I>=0)return t.langSysRecords[I].langSys;if(g){var o={tag:A,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return t.langSysRecords.splice(-1-I,0,o),o.langSys}}},getFeatureTable:function(e,A,g,t){var I=this.getLangSysTable(e,A,t);if(I){for(var o,i=I.featureIndexes,r=this.font.tables[this.tableName].features,C=0;C=r[B-1].tag,"Features must be added in alphabetical order."),o={tag:g,feature:{params:0,lookupListIndexes:[]}},r.push(o),i.push(B),o.feature}}},getLookupTables:function(e,A,g,t,I){var o=this.getFeatureTable(e,A,g,I),i=[];if(o){for(var r,C=o.lookupListIndexes,B=this.font.tables[this.tableName].lookups,n=0;n=0?g:-1;case 2:var t=Yg(e.ranges,A);return t?t.index+A-t.start:-1}},expandCoverage:function(e){if(e.format===1)return e.glyphs;for(var A=[],g=e.ranges,t=0;t1,'Multiple: "by" must be an array of two or more ids');var I=this.getLookupTables(g,t,e,2,!0)[0],o=Eg(I,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});W.assert(o.coverage.format===1,"Multiple: unable to modify coverage table format "+o.coverage.format);var i=A.sub,r=this.binSearch(o.coverage.glyphs,i);r<0&&(r=-1-r,o.coverage.glyphs.splice(r,0,i),o.sequences.splice(r,0,0)),o.sequences[r]=A.by};dA.prototype.addAlternate=function(e,A,g,t){var I=this.getLookupTables(g,t,e,3,!0)[0],o=Eg(I,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});W.assert(o.coverage.format===1,"Alternate: unable to modify coverage table format "+o.coverage.format);var i=A.sub,r=this.binSearch(o.coverage.glyphs,i);r<0&&(r=-1-r,o.coverage.glyphs.splice(r,0,i),o.alternateSets.splice(r,0,0)),o.alternateSets[r]=A.by};dA.prototype.addLigature=function(e,A,g,t){var I=this.getLookupTables(g,t,e,4,!0)[0],o=I.subtables[0];o||(o={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},I.subtables[0]=o),W.assert(o.coverage.format===1,"Ligature: unable to modify coverage table format "+o.coverage.format);var i=A.sub[0],r=A.sub.slice(1),C={ligGlyph:A.by,components:r},B=this.binSearch(o.coverage.glyphs,i);if(B>=0){for(var n=o.ligatureSets[B],Q=0;Q0?(o=e.parseByte(),A&I||(o=-o),o=g+o):(A&I)>0?o=g:o=g+e.parseShort(),o}function Pt(e,A,g){var t=new T.Parser(A,g);e.numberOfContours=t.parseShort(),e._xMin=t.parseShort(),e._yMin=t.parseShort(),e._xMax=t.parseShort(),e._yMax=t.parseShort();var I,o;if(e.numberOfContours>0){for(var i=e.endPointIndices=[],r=0;r0)for(var Q=t.parseByte(),a=0;a0){var E=[],h;if(B>0){for(var w=0;w=0,E.push(h);for(var u=0,l=0;l0?(I&2)>0?(y.dx=t.parseShort(),y.dy=t.parseShort()):y.matchedPoints=[t.parseUShort(),t.parseUShort()]:(I&2)>0?(y.dx=t.parseChar(),y.dy=t.parseChar()):y.matchedPoints=[t.parseByte(),t.parseByte()],(I&8)>0?y.xScale=y.yScale=t.parseF2Dot14():(I&64)>0?(y.xScale=t.parseF2Dot14(),y.yScale=t.parseF2Dot14()):(I&128)>0&&(y.xScale=t.parseF2Dot14(),y.scale01=t.parseF2Dot14(),y.scale10=t.parseF2Dot14(),y.yScale=t.parseF2Dot14()),e.components.push(y),D=!!(I&32)}if(I&256){e.instructionLength=t.parseUShort(),e.instructions=[];for(var v=0;vA.points.length-1||t.matchedPoints[1]>I.points.length-1)throw Error("Matched points out of range in "+A.name);var i=A.points[t.matchedPoints[0]],r=I.points[t.matchedPoints[1]],C={xScale:t.xScale,scale01:t.scale01,scale10:t.scale10,yScale:t.yScale,dx:0,dy:0};r=Te([r],C)[0],C.dx=i.x-r.x,C.dy=i.y-r.y,o=Te(I.points,C)}A.points=A.points.concat(o)}}return Zt(A.points)}function ts(e,A,g,t){for(var I=new MA.GlyphSet(t),o=0;o2)){var g=this.font,t=this._prepState;if(!t||t.ppem!==A){var I=this._fpgmState;if(!I){ZA.prototype=ss,I=this._fpgmState=new ZA("fpgm",g.tables.fpgm),I.funcs=[],I.font=g,exports.DEBUG&&(console.log("---EXEC FPGM---"),I.step=-1);try{Ae(I)}catch(B){console.log("Hinting error in FPGM:"+B),this._errorState=3;return}}ZA.prototype=I,t=this._prepState=new ZA("prep",g.tables.prep),t.ppem=A;var o=g.tables.cvt;if(o)for(var i=t.cvt=new Array(o.length),r=A/g.unitsPerEm,C=0;C1))try{return _t(e,t)}catch(B){this._errorState<1&&(console.log("Hinting error:"+B),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}}};_t=function(e,A){var g=A.ppem/A.font.unitsPerEm,t=g,I=e.components,o,i,r;if(ZA.prototype=A,!I)r=new ZA("glyf",e.instructions),exports.DEBUG&&(console.log("---EXEC GLYPH---"),r.step=-1),Ig(e,r,g,t),i=r.gZone;else{var C=A.font;i=[],o=[];for(var B=0;B=176&&o<=183)t+=o-176+1;else if(o>=184&&o<=191)t+=(o-184+1)*2;else if(A&&I===1&&o===27)break;while(I>0);e.ip=t}function Tg(e,A){exports.DEBUG&&console.log(A.step,"SVTCA["+e.axis+"]"),A.fv=A.pv=A.dpv=e}function Vg(e,A){exports.DEBUG&&console.log(A.step,"SPVTCA["+e.axis+"]"),A.pv=A.dpv=e}function qg(e,A){exports.DEBUG&&console.log(A.step,"SFVTCA["+e.axis+"]"),A.fv=e}function Og(e,A){var g=A.stack,t=g.pop(),I=g.pop(),o=A.z2[t],i=A.z1[I];exports.DEBUG&&console.log("SPVTL["+e+"]",t,I);var r,C;e?(r=o.y-i.y,C=i.x-o.x):(r=i.x-o.x,C=i.y-o.y),A.pv=A.dpv=de(r,C)}function Wg(e,A){var g=A.stack,t=g.pop(),I=g.pop(),o=A.z2[t],i=A.z1[I];exports.DEBUG&&console.log("SFVTL["+e+"]",t,I);var r,C;e?(r=o.y-i.y,C=i.x-o.x):(r=i.x-o.x,C=i.y-o.y),A.fv=de(r,C)}function as(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"SPVFS[]",g,t),e.pv=e.dpv=de(t,g)}function Qs(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"SPVFS[]",g,t),e.fv=de(t,g)}function Es(e){var A=e.stack,g=e.pv;exports.DEBUG&&console.log(e.step,"GPV[]"),A.push(g.x*16384),A.push(g.y*16384)}function ls(e){var A=e.stack,g=e.fv;exports.DEBUG&&console.log(e.step,"GFV[]"),A.push(g.x*16384),A.push(g.y*16384)}function cs(e){e.fv=e.pv,exports.DEBUG&&console.log(e.step,"SFVTPV[]")}function hs(e){var A=e.stack,g=A.pop(),t=A.pop(),I=A.pop(),o=A.pop(),i=A.pop(),r=e.z0,C=e.z1,B=r[g],n=r[t],Q=C[I],a=C[o],E=e.z2[i];exports.DEBUG&&console.log("ISECT[], ",g,t,I,o,i);var h=B.x,w=B.y,u=n.x,l=n.y,f=Q.x,c=Q.y,D=a.x,y=a.y,v=(h-u)*(c-y)-(w-l)*(f-D),N=h*l-w*u,L=f*y-c*D;E.x=(N*(f-D)-L*(h-u))/v,E.y=(N*(c-y)-L*(w-l))/v}function us(e){e.rp0=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SRP0[]",e.rp0)}function ds(e){e.rp1=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SRP1[]",e.rp1)}function fs(e){e.rp2=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SRP2[]",e.rp2)}function ws(e){var A=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZP0[]",A),e.zp0=A,A){case 0:e.tZone||Je(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function ys(e){var A=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZP1[]",A),e.zp1=A,A){case 0:e.tZone||Je(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function ps(e){var A=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZP2[]",A),e.zp2=A,A){case 0:e.tZone||Je(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function Ds(e){var A=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZPS[]",A),e.zp0=e.zp1=e.zp2=A,A){case 0:e.tZone||Je(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function ms(e){e.loop=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SLOOP[]",e.loop)}function Fs(e){exports.DEBUG&&console.log(e.step,"RTG[]"),e.round=AI}function ks(e){exports.DEBUG&&console.log(e.step,"RTHG[]"),e.round=Cs}function vs(e){var A=e.stack.pop();exports.DEBUG&&console.log(e.step,"SMD[]",A),e.minDis=A/64}function Ss(e){exports.DEBUG&&console.log(e.step,"ELSE[]"),gI(e,!1)}function Gs(e){var A=e.stack.pop();exports.DEBUG&&console.log(e.step,"JMPR[]",A),e.ip+=A-1}function Rs(e){var A=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCVTCI[]",A),e.cvCutIn=A/64}function Us(e){var A=e.stack;exports.DEBUG&&console.log(e.step,"DUP[]"),A.push(A[A.length-1])}function Ve(e){exports.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function Ns(e){exports.DEBUG&&console.log(e.step,"CLEAR[]"),e.stack.length=0}function bs(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"SWAP[]"),A.push(g),A.push(t)}function Ls(e){var A=e.stack;exports.DEBUG&&console.log(e.step,"DEPTH[]"),A.push(A.length)}function Ms(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"LOOPCALL[]",g,t);var I=e.ip,o=e.prog;e.prog=e.funcs[g];for(var i=0;i1?"loop "+(A.loop-r)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",B)}A.loop=1}function jg(e,A){var g=A.stack,t=e?A.rp1:A.rp2,I=(e?A.z0:A.z1)[t],o=A.fv,i=A.pv,r=g.pop(),C=A.z2[A.contours[r]],B=C;exports.DEBUG&&console.log(A.step,"SHC["+e+"]",r);var n=i.distance(I,I,!1,!0);do B!==I&&o.setRelative(B,B,n,i),B=B.nextPointOnContour;while(B!==C)}function zg(e,A){var g=A.stack,t=e?A.rp1:A.rp2,I=(e?A.z0:A.z1)[t],o=A.fv,i=A.pv,r=g.pop();exports.DEBUG&&console.log(A.step,"SHZ["+e+"]",r);var C;switch(r){case 0:C=A.tZone;break;case 1:C=A.gZone;break;default:throw new Error("Invalid zone")}for(var B,n=i.distance(I,I,!1,!0),Q=C.length-2,a=0;a1?"loop "+(e.loop-g)+": ":"")+"SHPIX[]",i,I),t.setRelative(r,r,I),t.touch(r)}e.loop=1}function Ts(e){for(var A=e.stack,g=e.rp1,t=e.rp2,I=e.loop,o=e.z0[g],i=e.z1[t],r=e.fv,C=e.dpv,B=e.z2;I--;){var n=A.pop(),Q=B[n];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-I)+": ":"")+"IP[]",n,g,"<->",t),r.interpolate(Q,o,i,C),r.touch(Q)}e.loop=1}function _g(e,A){var g=A.stack,t=g.pop()/64,I=g.pop(),o=A.z1[I],i=A.z0[A.rp0],r=A.fv,C=A.pv;r.setRelative(o,i,t,C),r.touch(o),exports.DEBUG&&console.log(A.step,"MSIRP["+e+"]",t,I),A.rp1=A.rp0,A.rp2=I,e&&(A.rp0=I)}function Vs(e){for(var A=e.stack,g=e.rp0,t=e.z0[g],I=e.loop,o=e.fv,i=e.pv,r=e.z1;I--;){var C=A.pop(),B=r[C];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-I)+": ":"")+"ALIGNRP[]",C),o.setRelative(B,t,0,i),o.touch(B)}e.loop=1}function qs(e){exports.DEBUG&&console.log(e.step,"RTDG[]"),e.round=rs}function $g(e,A){var g=A.stack,t=g.pop(),I=g.pop(),o=A.z0[I],i=A.fv,r=A.pv,C=A.cvt[t];exports.DEBUG&&console.log(A.step,"MIAP["+e+"]",t,"(",C,")",I);var B=r.distance(o,Ee);e&&(Math.abs(B-C)",r),A.stack.push(Math.round(r*64))}function zs(e){exports.DEBUG&&console.log(e.step,"MPPEM[]"),e.stack.push(e.ppem)}function _s(e){exports.DEBUG&&console.log(e.step,"FLIPON[]"),e.autoFlip=!0}function $s(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"LT[]",g,t),A.push(tg?1:0)}function ga(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"GTEQ[]",g,t),A.push(t>=g?1:0)}function ta(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"EQ[]",g,t),A.push(g===t?1:0)}function Ia(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"NEQ[]",g,t),A.push(g!==t?1:0)}function oa(e){var A=e.stack,g=A.pop();exports.DEBUG&&console.log(e.step,"ODD[]",g),A.push(Math.trunc(g)%2?1:0)}function ia(e){var A=e.stack,g=A.pop();exports.DEBUG&&console.log(e.step,"EVEN[]",g),A.push(Math.trunc(g)%2?0:1)}function ra(e){var A=e.stack.pop();exports.DEBUG&&console.log(e.step,"IF[]",A),A||(gI(e,!0),exports.DEBUG&&console.log(e.step,"EIF[]"))}function Ca(e){exports.DEBUG&&console.log(e.step,"EIF[]")}function na(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"AND[]",g,t),A.push(g&&t?1:0)}function Ba(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"OR[]",g,t),A.push(g||t?1:0)}function sa(e){var A=e.stack,g=A.pop();exports.DEBUG&&console.log(e.step,"NOT[]",g),A.push(g?0:1)}function qe(e,A){var g=A.stack,t=g.pop(),I=A.fv,o=A.pv,i=A.ppem,r=A.deltaBase+(e-1)*16,C=A.deltaShift,B=A.z0;exports.DEBUG&&console.log(A.step,"DELTAP["+e+"]",t,g);for(var n=0;n>4);if(E===i){var h=(a&15)-8;h>=0&&h++,exports.DEBUG&&console.log(A.step,"DELTAPFIX",Q,"by",h*C);var w=B[Q];I.setRelative(w,w,h*C,o)}}}function aa(e){var A=e.stack,g=A.pop();exports.DEBUG&&console.log(e.step,"SDB[]",g),e.deltaBase=g}function Qa(e){var A=e.stack,g=A.pop();exports.DEBUG&&console.log(e.step,"SDS[]",g),e.deltaShift=Math.pow(.5,g)}function Ea(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"ADD[]",g,t),A.push(t+g)}function la(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"SUB[]",g,t),A.push(t-g)}function ca(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"DIV[]",g,t),A.push(t*64/g)}function ha(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"MUL[]",g,t),A.push(t*g/64)}function ua(e){var A=e.stack,g=A.pop();exports.DEBUG&&console.log(e.step,"ABS[]",g),A.push(Math.abs(g))}function da(e){var A=e.stack,g=A.pop();exports.DEBUG&&console.log(e.step,"NEG[]",g),A.push(-g)}function fa(e){var A=e.stack,g=A.pop();exports.DEBUG&&console.log(e.step,"FLOOR[]",g),A.push(Math.floor(g/64)*64)}function wa(e){var A=e.stack,g=A.pop();exports.DEBUG&&console.log(e.step,"CEILING[]",g),A.push(Math.ceil(g/64)*64)}function Fe(e,A){var g=A.stack,t=g.pop();exports.DEBUG&&console.log(A.step,"ROUND[]"),g.push(A.round(t/64)*64)}function ya(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"WCVTF[]",g,t),e.cvt[t]=g*e.ppem/e.font.unitsPerEm}function Oe(e,A){var g=A.stack,t=g.pop(),I=A.ppem,o=A.deltaBase+(e-1)*16,i=A.deltaShift;exports.DEBUG&&console.log(A.step,"DELTAC["+e+"]",t,g);for(var r=0;r>4);if(n===I){var Q=(B&15)-8;Q>=0&&Q++;var a=Q*i;exports.DEBUG&&console.log(A.step,"DELTACFIX",C,"by",a),A.cvt[C]+=a}}}function pa(e){var A=e.stack.pop();exports.DEBUG&&console.log(e.step,"SROUND[]",A),e.round=eI;var g;switch(A&192){case 0:g=.5;break;case 64:g=1;break;case 128:g=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=g,A&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*g;break;case 32:e.srPhase=.5*g;break;case 48:e.srPhase=.75*g;break;default:throw new Error("invalid SROUND value")}A&=15,A===0?e.srThreshold=0:e.srThreshold=(A/8-.5)*g}function Da(e){var A=e.stack.pop();exports.DEBUG&&console.log(e.step,"S45ROUND[]",A),e.round=eI;var g;switch(A&192){case 0:g=Math.sqrt(2)/2;break;case 64:g=Math.sqrt(2);break;case 128:g=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=g,A&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*g;break;case 32:e.srPhase=.5*g;break;case 48:e.srPhase=.75*g;break;default:throw new Error("invalid S45ROUND value")}A&=15,A===0?e.srThreshold=0:e.srThreshold=(A/8-.5)*g}function ma(e){exports.DEBUG&&console.log(e.step,"ROFF[]"),e.round=is}function Fa(e){exports.DEBUG&&console.log(e.step,"RUTG[]"),e.round=ns}function ka(e){exports.DEBUG&&console.log(e.step,"RDTG[]"),e.round=Bs}function va(e){var A=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANCTRL[]",A)}function gt(e,A){var g=A.stack,t=g.pop(),I=g.pop(),o=A.z2[t],i=A.z1[I];exports.DEBUG&&console.log(A.step,"SDPVTL["+e+"]",t,I);var r,C;e?(r=o.y-i.y,C=i.x-o.x):(r=i.x-o.x,C=i.y-o.y),A.dpv=de(r,C)}function Sa(e){var A=e.stack,g=A.pop(),t=0;exports.DEBUG&&console.log(e.step,"GETINFO[]",g),g&1&&(t=35),g&32&&(t|=4096),A.push(t)}function Ga(e){var A=e.stack,g=A.pop(),t=A.pop(),I=A.pop();exports.DEBUG&&console.log(e.step,"ROLL[]"),A.push(t),A.push(g),A.push(I)}function Ra(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"MAX[]",g,t),A.push(Math.max(t,g))}function Ua(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"MIN[]",g,t),A.push(Math.min(t,g))}function Na(e){var A=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANTYPE[]",A)}function ba(e){var A=e.stack.pop(),g=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"INSTCTRL[]",A,g),A){case 1:e.inhibitGridFit=!!g;return;case 2:e.ignoreCvt=!!g;return;default:throw new Error("invalid INSTCTRL[] selector")}}function qA(e,A){var g=A.stack,t=A.prog,I=A.ip;exports.DEBUG&&console.log(A.step,"PUSHB["+e+"]");for(var o=0;o=0?1:-1,u=Math.abs(u),e&&(f=o.cvt[r],t&&Math.abs(u-f)":"_")+(t?"R":"_")+(I===0?"Gr":I===1?"Bl":I===2?"Wh":"")+"]",e?r+"("+o.cvt[r]+","+f+")":"",C,"(d =",w,"->",l*u,")"),o.rp1=o.rp0,o.rp2=C,A&&(o.rp0=C)}zt=[Tg.bind(void 0,xA),Tg.bind(void 0,NA),Vg.bind(void 0,xA),Vg.bind(void 0,NA),qg.bind(void 0,xA),qg.bind(void 0,NA),Og.bind(void 0,0),Og.bind(void 0,1),Wg.bind(void 0,0),Wg.bind(void 0,1),as,Qs,Es,ls,cs,hs,us,ds,fs,ws,ys,ps,Ds,ms,Fs,ks,vs,Ss,Gs,Rs,void 0,void 0,Us,Ve,Ns,bs,Ls,xs,Hs,void 0,void 0,void 0,Ms,Js,Ys,void 0,Pg.bind(void 0,0),Pg.bind(void 0,1),Zg.bind(void 0,xA),Zg.bind(void 0,NA),Xg.bind(void 0,0),Xg.bind(void 0,1),jg.bind(void 0,0),jg.bind(void 0,1),zg.bind(void 0,0),zg.bind(void 0,1),Ks,Ts,_g.bind(void 0,0),_g.bind(void 0,1),Vs,qs,$g.bind(void 0,0),$g.bind(void 0,1),Os,Ws,Ps,Zs,Xs,js,At.bind(void 0,0),At.bind(void 0,1),void 0,et.bind(void 0,0),et.bind(void 0,1),zs,void 0,_s,void 0,void 0,$s,Aa,ea,ga,ta,Ia,oa,ia,ra,Ca,na,Ba,sa,qe.bind(void 0,1),aa,Qa,Ea,la,ca,ha,ua,da,fa,wa,Fe.bind(void 0,0),Fe.bind(void 0,1),Fe.bind(void 0,2),Fe.bind(void 0,3),void 0,void 0,void 0,void 0,ya,qe.bind(void 0,2),qe.bind(void 0,3),Oe.bind(void 0,1),Oe.bind(void 0,2),Oe.bind(void 0,3),pa,Da,void 0,void 0,ma,void 0,Fa,ka,Ve,Ve,void 0,void 0,void 0,void 0,void 0,va,gt.bind(void 0,0),gt.bind(void 0,1),Sa,void 0,Ga,Ra,Ua,Na,ba,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,qA.bind(void 0,1),qA.bind(void 0,2),qA.bind(void 0,3),qA.bind(void 0,4),qA.bind(void 0,5),qA.bind(void 0,6),qA.bind(void 0,7),qA.bind(void 0,8),OA.bind(void 0,1),OA.bind(void 0,2),OA.bind(void 0,3),OA.bind(void 0,4),OA.bind(void 0,5),OA.bind(void 0,6),OA.bind(void 0,7),OA.bind(void 0,8),K.bind(void 0,0,0,0,0,0),K.bind(void 0,0,0,0,0,1),K.bind(void 0,0,0,0,0,2),K.bind(void 0,0,0,0,0,3),K.bind(void 0,0,0,0,1,0),K.bind(void 0,0,0,0,1,1),K.bind(void 0,0,0,0,1,2),K.bind(void 0,0,0,0,1,3),K.bind(void 0,0,0,1,0,0),K.bind(void 0,0,0,1,0,1),K.bind(void 0,0,0,1,0,2),K.bind(void 0,0,0,1,0,3),K.bind(void 0,0,0,1,1,0),K.bind(void 0,0,0,1,1,1),K.bind(void 0,0,0,1,1,2),K.bind(void 0,0,0,1,1,3),K.bind(void 0,0,1,0,0,0),K.bind(void 0,0,1,0,0,1),K.bind(void 0,0,1,0,0,2),K.bind(void 0,0,1,0,0,3),K.bind(void 0,0,1,0,1,0),K.bind(void 0,0,1,0,1,1),K.bind(void 0,0,1,0,1,2),K.bind(void 0,0,1,0,1,3),K.bind(void 0,0,1,1,0,0),K.bind(void 0,0,1,1,0,1),K.bind(void 0,0,1,1,0,2),K.bind(void 0,0,1,1,0,3),K.bind(void 0,0,1,1,1,0),K.bind(void 0,0,1,1,1,1),K.bind(void 0,0,1,1,1,2),K.bind(void 0,0,1,1,1,3),K.bind(void 0,1,0,0,0,0),K.bind(void 0,1,0,0,0,1),K.bind(void 0,1,0,0,0,2),K.bind(void 0,1,0,0,0,3),K.bind(void 0,1,0,0,1,0),K.bind(void 0,1,0,0,1,1),K.bind(void 0,1,0,0,1,2),K.bind(void 0,1,0,0,1,3),K.bind(void 0,1,0,1,0,0),K.bind(void 0,1,0,1,0,1),K.bind(void 0,1,0,1,0,2),K.bind(void 0,1,0,1,0,3),K.bind(void 0,1,0,1,1,0),K.bind(void 0,1,0,1,1,1),K.bind(void 0,1,0,1,1,2),K.bind(void 0,1,0,1,1,3),K.bind(void 0,1,1,0,0,0),K.bind(void 0,1,1,0,0,1),K.bind(void 0,1,1,0,0,2),K.bind(void 0,1,1,0,0,3),K.bind(void 0,1,1,0,1,0),K.bind(void 0,1,1,0,1,1),K.bind(void 0,1,1,0,1,2),K.bind(void 0,1,1,0,1,3),K.bind(void 0,1,1,1,0,0),K.bind(void 0,1,1,1,0,1),K.bind(void 0,1,1,1,0,2),K.bind(void 0,1,1,1,0,3),K.bind(void 0,1,1,1,1,0),K.bind(void 0,1,1,1,1,1),K.bind(void 0,1,1,1,1,2),K.bind(void 0,1,1,1,1,3)];function re(e){this.char=e,this.state={},this.activeState=null}function lg(e,A,g){this.contextName=g,this.startIndex=e,this.endOffset=A}function La(e,A,g){this.contextName=e,this.openRange=null,this.ranges=[],this.checkStart=A,this.checkEnd=g}function FA(e,A){this.context=e,this.index=A,this.length=e.length,this.current=e[A],this.backtrack=e.slice(0,A),this.lookahead=e.slice(A+1)}function xe(e){this.eventId=e,this.subscribers=[]}function Ma(e){var A=this,g=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];g.forEach(function(I){Object.defineProperty(A.events,I,{value:new xe(I)})}),e&&g.forEach(function(I){var o=e[I];typeof o=="function"&&A.events[I].subscribe(o)});var t=["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"];t.forEach(function(I){A.events[I].subscribe(A.updateContextsRanges)})}function BA(e){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],Ma.call(this,e)}re.prototype.setState=function(e,A){return this.state[e]=A,this.activeState={key:e,value:this.state[e]},this.activeState};re.prototype.getState=function(e){return this.state[e]||null};BA.prototype.inboundIndex=function(e){return e>=0&&e0&&e<=this.lookahead.length):return this.lookahead[e-1];default:return null}};BA.prototype.rangeToText=function(e){if(e instanceof lg)return this.getRangeTokens(e).map(function(A){return A.char}).join("")};BA.prototype.getText=function(){return this.tokens.map(function(e){return e.char}).join("")};BA.prototype.getContext=function(e){var A=this.registeredContexts[e];return A||null};BA.prototype.on=function(e,A){var g=this.events[e];return g?g.subscribe(A):null};BA.prototype.dispatch=function(e,A){var g=this,t=this.events[e];t instanceof xe&&t.subscribers.forEach(function(I){I.apply(g,A||[])})};BA.prototype.registerContextChecker=function(e,A,g){if(this.getContext(e))return{FAIL:"context name '"+e+"' is already registered."};if(typeof A!="function")return{FAIL:"missing context start check."};if(typeof g!="function")return{FAIL:"missing context end check."};var t=new La(e,A,g);return this.registeredContexts[e]=t,this.contextCheckers.push(t),t};BA.prototype.getRangeTokens=function(e){var A=e.startIndex+e.endOffset;return[].concat(this.tokens.slice(e.startIndex,A))};BA.prototype.getContextRanges=function(e){var A=this.getContext(e);return A?A.ranges:{FAIL:"context checker '"+e+"' is not registered."}};BA.prototype.resetContextsRanges=function(){var e=this.registeredContexts;for(var A in e)if(e.hasOwnProperty(A)){var g=e[A];g.ranges=[]}};BA.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var e=this.tokens.map(function(t){return t.char}),A=0;A=I.start&&e<=I.end){var o=e-I.start;return I.index+o}}break;default:return-1}return-1}function xa(e,A){var g=fe(e,A.coverage);return g===-1?null:e+A.deltaGlyphId}function Ha(e,A){var g=fe(e,A.coverage);return g===-1?null:A.substitute[g]}function We(e,A){for(var g=[],t=0;t=0;g--){var t=A[g],I=tI(t),o=jA(t);if(!I&&!o)return!0;if(I)return!1}return!1}function AQ(e){if(tI(e.current))return!1;for(var A=0;A0}g("fontFamily"),g("weightName"),g("manufacturer"),g("copyright"),g("version"),this.unitsPerEm>0};tA.prototype.toTables=function(){return _B.fontToTable(this)};tA.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()};tA.prototype.toArrayBuffer=function(){for(var e=this.toTables(),A=e.encode(),g=new ArrayBuffer(A.length),t=new Uint8Array(g),I=0;I=1.2&&(I.markGlyphSets=g.parsePointer(pQ)),I}var mQ={parse:DQ},kA=new Array(10);kA[1]=function(){var A=this.offset+this.relativeOffset,g=this.parseUShort();if(g===1)return{posFormat:1,coverage:this.parsePointer(p.coverage),value:this.parseValueRecord()};if(g===2)return{posFormat:2,coverage:this.parsePointer(p.coverage),values:this.parseValueRecordList()};W.assert(!1,"0x"+A.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")};kA[2]=function(){var A=this.offset+this.relativeOffset,g=this.parseUShort();W.assert(g===1||g===2,"0x"+A.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var t=this.parsePointer(p.coverage),I=this.parseUShort(),o=this.parseUShort();if(g===1)return{posFormat:g,coverage:t,valueFormat1:I,valueFormat2:o,pairSets:this.parseList(p.pointer(p.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(I),value2:this.parseValueRecord(o)}})))};if(g===2){var i=this.parsePointer(p.classDef),r=this.parsePointer(p.classDef),C=this.parseUShort(),B=this.parseUShort();return{posFormat:g,coverage:t,valueFormat1:I,valueFormat2:o,classDef1:i,classDef2:r,class1Count:C,class2Count:B,classRecords:this.parseList(C,p.list(B,function(){return{value1:this.parseValueRecord(I),value2:this.parseValueRecord(o)}}))}}};kA[3]=function(){return{error:"GPOS Lookup 3 not supported"}};kA[4]=function(){return{error:"GPOS Lookup 4 not supported"}};kA[5]=function(){return{error:"GPOS Lookup 5 not supported"}};kA[6]=function(){return{error:"GPOS Lookup 6 not supported"}};kA[7]=function(){return{error:"GPOS Lookup 7 not supported"}};kA[8]=function(){return{error:"GPOS Lookup 8 not supported"}};kA[9]=function(){return{error:"GPOS Lookup 9 not supported"}};function FQ(e,A){A=A||0;var g=new p(e,A),t=g.parseVersion(1);return W.argument(t===1||t===1.1,"Unsupported GPOS table version "+t),t===1?{version:t,scripts:g.parseScriptList(),features:g.parseFeatureList(),lookups:g.parseLookupList(kA)}:{version:t,scripts:g.parseScriptList(),features:g.parseFeatureList(),lookups:g.parseLookupList(kA),variations:g.parseFeatureVariationsList()}}var kQ=new Array(10);function vQ(e){return new Y.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new Y.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new Y.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new Y.LookupList(e.lookups,kQ)}])}var SQ={parse:FQ,make:vQ};function GQ(e){var A={};e.skip("uShort");var g=e.parseUShort();W.argument(g===0,"Unsupported kern sub-table version."),e.skip("uShort",2);var t=e.parseUShort();e.skip("uShort",3);for(var I=0;I1&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");var t=e.parseUShort(),I=t&255;if(e.skip("uShort"),I===0){var o=e.parseUShort();e.skip("uShort",3);for(var i=0;i"u",I=t&&!g.isUrl?MQ:JQ;return new Promise(function(o,i){I(e,function(r,C){if(r){if(A)return A(r);i(r)}var B;try{B=ug(C,g)}catch(n){if(A)return A(n,null);i(n)}if(A)return A(null,B);o(B)})})}function YQ(e,A){var g=require("fs"),t=g.readFileSync(e);return ug(Wt(t),A)}var og=Object.freeze({__proto__:null,Font:tA,Glyph:uA,Path:QA,BoundingBox:VA,_parse:T,parse:ug,load:HQ,loadSync:YQ});const KQ=()=>aI(()=>import("./ft_render-ByO_jG18.js"),[]);let R=null,le=0;const TQ=new Promise(e=>{KQ().then(A=>{A.default().then(g=>{R=g,e()})})});function rt(e){return e/65536}function pA(e){return e/64}function ne(e){return e>=0?e:e+256}let oI,iI,rI,dg,CI,nI,BI;async function VQ(){if(await TQ,R._init_constants(),oI=R.cwrap("FT_New_Memory_Face","number",["number","number","number","number","number"]),iI=R.cwrap("FT_Set_Char_Size","number",["number","number","number","number","number"]),rI=R.cwrap("FT_Set_Pixel_Sizes","number",["number","number","number"]),dg=R.cwrap("FT_Get_Char_Index","number",["number","number"]),CI=R.cwrap("FT_Load_Glyph","number",["number","number","number"]),nI=R.cwrap("FT_Get_Sfnt_Table","number",["number","number"]),R.cwrap("FT_Get_Kerning","number",["number","number","number","number","number"]),BI=R.cwrap("FT_Done_Face","number",["number"]),!le){let e=R._malloc(4);try{let A=R.ccall("FT_Init_FreeType","number",["number"],[e]);if(A)throw new Error(`error in FT_Init_FreeType: ${A}`);le=R.getValue(e,"i32")}finally{R._free(e)}}}function qQ(e,A){let g,t;if(e instanceof ArrayBuffer)t=e.byteLength;else if(e instanceof Uint8Array)t=e.byteLength;else if(e&&typeof e.length=="number")t=e.length;else throw new Error("Invalid font source format");let I={ptr:0,font:R._malloc(t)};const o=e instanceof ArrayBuffer?new Uint8Array(e):e;R.writeArrayToMemory(o,I.font);let i=R._malloc(4);try{if(g=oI(le,I.font,t,0,i),g)throw new Error(`error in FT_New_Memory_Face: ${g}`);I.ptr=R.getValue(i,"i32")}finally{R._free(i)}if(g=iI(I.ptr,0,A*64,300,300),g)throw new Error(`error in FT_Set_Char_Size: ${g}`);if(g=rI(I.ptr,0,A),g)throw new Error(`error in FT_Set_Pixel_Sizes: ${g}`);let r=R.getValue(I.ptr+R.OFFSET_FACE_UNITS_PER_EM,"i16"),C=R.getValue(I.ptr+R.OFFSET_FACE_ASCENDER,"i16"),B=R.getValue(I.ptr+R.OFFSET_FACE_DESCENDER,"i16"),n=R.getValue(I.ptr+R.OFFSET_FACE_HEIGHT,"i16");return Object.assign(I,{units_per_em:r,ascender:C,descender:B,height:n})}function OQ(e){let A=nI(e.ptr,R.FT_SFNT_OS2);if(!A)throw new Error("os/2 table not found for this font");let g=R.getValue(A+R.OFFSET_TT_OS2_ASCENDER,"i16"),t=R.getValue(A+R.OFFSET_TT_OS2_DESCENDER,"i16"),I=R.getValue(A+R.OFFSET_TT_OS2_LINEGAP,"i16");return{typoAscent:g,typoDescent:t,typoLineGap:I}}function Ze(e,A){return dg(e.ptr,A)!==0}function WQ(e,A,g={}){let t=dg(e.ptr,A);if(t===0)throw new Error(`glyph does not exist for codepoint ${A}`);let I=R.FT_LOAD_RENDER;g.mono?I|=R.FT_LOAD_TARGET_MONO:g.lcd?I|=R.FT_LOAD_TARGET_LCD:g.lcd_v?I|=R.FT_LOAD_TARGET_LCD_V:g.autohint_strong?I|=R.FT_LOAD_TARGET_NORMAL:I|=R.FT_LOAD_TARGET_LIGHT,g.autohint_off?I|=R.FT_LOAD_NO_AUTOHINT:I|=R.FT_LOAD_FORCE_AUTOHINT,g.use_color_info&&(I|=R.FT_LOAD_COLOR);let o=CI(e.ptr,t,I);if(o)throw new Error(`error in FT_Load_Glyph: ${o}`);let i=R.getValue(e.ptr+R.OFFSET_FACE_GLYPH,"i32"),r={glyph_index:R.getValue(i+R.OFFSET_GLYPH_INDEX,"i32"),metrics:{width:pA(R.getValue(i+R.OFFSET_GLYPH_METRICS_WIDTH,"i32")),height:pA(R.getValue(i+R.OFFSET_GLYPH_METRICS_HEIGHT,"i32")),horiBearingX:pA(R.getValue(i+R.OFFSET_GLYPH_METRICS_HORI_BEARING_X,"i32")),horiBearingY:pA(R.getValue(i+R.OFFSET_GLYPH_METRICS_HORI_BEARING_Y,"i32")),horiAdvance:pA(R.getValue(i+R.OFFSET_GLYPH_METRICS_HORI_ADVANCE,"i32")),vertBearingX:pA(R.getValue(i+R.OFFSET_GLYPH_METRICS_VERT_BEARING_X,"i32")),vertBearingY:pA(R.getValue(i+R.OFFSET_GLYPH_METRICS_VERT_BEARING_Y,"i32")),vertAdvance:pA(R.getValue(i+R.OFFSET_GLYPH_METRICS_VERT_ADVANCE,"i32"))},linearHoriAdvance:rt(R.getValue(i+R.OFFSET_GLYPH_LINEAR_HORI_ADVANCE,"i32")),linearVertAdvance:rt(R.getValue(i+R.OFFSET_GLYPH_LINEAR_VERT_ADVANCE,"i32")),advance:{x:pA(R.getValue(i+R.OFFSET_GLYPH_ADVANCE_X,"i32")),y:pA(R.getValue(i+R.OFFSET_GLYPH_ADVANCE_Y,"i32"))},bitmap:{width:R.getValue(i+R.OFFSET_GLYPH_BITMAP_WIDTH,"i32"),rows:R.getValue(i+R.OFFSET_GLYPH_BITMAP_ROWS,"i32"),pitch:R.getValue(i+R.OFFSET_GLYPH_BITMAP_PITCH,"i32"),num_grays:R.getValue(i+R.OFFSET_GLYPH_BITMAP_NUM_GRAYS,"i16"),pixel_mode:R.getValue(i+R.OFFSET_GLYPH_BITMAP_PIXEL_MODE,"i8"),palette_mode:R.getValue(i+R.OFFSET_GLYPH_BITMAP_PALETTE_MODE,"i8")},bitmap_left:R.getValue(i+R.OFFSET_GLYPH_BITMAP_LEFT,"i32"),bitmap_top:R.getValue(i+R.OFFSET_GLYPH_BITMAP_TOP,"i32"),lsb_delta:pA(R.getValue(i+R.OFFSET_GLYPH_LSB_DELTA,"i32")),rsb_delta:pA(R.getValue(i+R.OFFSET_GLYPH_RSB_DELTA,"i32"))},C=r.bitmap.width,B=r.bitmap.rows,n=r.bitmap_left,Q=r.bitmap_top,a=R.getValue(i+R.OFFSET_GLYPH_BITMAP_BUFFER,"i32"),E=Math.abs(r.bitmap.pitch),h=r.linearHoriAdvance,w=r.linearVertAdvance,u=r.bitmap.pixel_mode,l=[];for(let f=0;f255&&(k=255),X=(255-k)*X/255,D.push(X)}else{let v=R.getValue(c+y,"i8");D.push(ne(v))}l.push(D)}return{x:n,y:Q,width:C,height:B,advance_x:h,advance_y:w,pixels:l,freetype:r}}function PQ(e){let A=BI(e.ptr);if(A)throw new Error(`error in FT_Done_Face: ${A}`);R._free(e.font),e.ptr=0,e.font=0}function ZQ(){let e=R.ccall("FT_Done_FreeType","number",["number"],[le]);if(e)throw new Error(`error in FT_Done_FreeType: ${e}`);le=0}class KA extends Error{constructor(A){super(A),this.name="AppError",Error.captureStackTrace&&Error.captureStackTrace(this,KA)}}class XQ{constructor(){this.data={}}add_range(A,g,t,I){let o=I-g,i=[];for(let r=g;r<=t;r++)this._set_char(A,r,r+o),i.push(r);return i}add_symbols(A,g){let t=[];for(let I of g){let o=I.codePointAt(0);this._set_char(A,o,o),t.push(o)}return t}_set_char(A,g,t){this.data[t]={font:A,code:g}}get(){return this.data}}async function jQ(e){await VQ();let A={};e.font.forEach(a=>{A[a.source_path]=a});let g={},t={};for(let{source_path:a,source_bin:E}of e.font)if(!g[a])try{let h=E;h instanceof File?h=await h.arrayBuffer():h instanceof Uint8Array&&(h=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength)),g[a]=og.parse(h),t[a]=qQ(h,e.size)}catch(h){throw new KA(`Cannot load font "${a}": ${h.message}`)}let I=new XQ;for(let{source_path:a,ranges:E}of e.font){let h=t[a];for(let w of E){if(w.range)for(let u=0;ua-E).map(Number);for(let a of r){let E=o[a].code,h=o[a].font;if(!Ze(t[h],E))continue;let w=WQ(t[h],E,{autohint_off:A[h].autohint_off,autohint_strong:A[h].autohint_strong,lcd:e.lcd,lcd_v:e.lcd_v,mono:!e.lcd&&!e.lcd_v&&e.bpp===1,use_color_info:e.use_color_info});i.push({code:a,advanceWidth:w.advance_x,bbox:{x:w.x,y:w.y-w.height,width:w.width,height:w.height},kerning:{},freetype:w.freetype,pixels:w.pixels})}if(!e.no_kerning){let a=i.map(E=>E.code);for(let{code:E,kerning:h}of i){let w=o[E].code,u=o[E].font,l=g[u],f=l.charToGlyph(String.fromCodePoint(w));for(let c of a){if(o[c].font!==u)continue;let D=o[c].code,y=l.charToGlyph(String.fromCodePoint(D)),v=l.getKerningValue(f,y);v&&(h[c]=v*e.size/l.unitsPerEm)}}}let C=t[e.font[0].source_path],B=e.size/C.units_per_em,n=OQ(C),Q=g[e.font[0].source_path].tables.post;for(let a of Object.values(t))PQ(a);return ZQ(),{ascent:Math.max(...i.map(a=>a.bbox.y+a.bbox.height)),descent:Math.min(...i.map(a=>a.bbox.y)),typoAscent:Math.round(n.typoAscent*B),typoDescent:Math.round(n.typoDescent*B),typoLineGap:Math.round(n.typoLineGap*B),size:e.size,glyphs:i,underlinePosition:Math.round(Q.underlinePosition*B),underlineThickness:Math.round(Q.underlineThickness*B)}}function zQ(){return 16}function _Q(e,A){return 16+(A-e+1)}function $Q(e){return 16+e*2}function Ct(e){e=e.sort((t,I)=>t-I);let A=[];for(let t=0;t=0?A[o-1].dist:0,r;e[t]-e[o]<256&&(r=_Q(e[o],e[t]),i+r=0;){let I=A[t];g.unshift([I.format,e.slice(I.start,I.end+1)]),t=I.start-1}return g}const hA=4,AE=(e,A,g)=>{e.setUint32(g,A,!0),e.setUint32(g+4,0,!0)};class eE{constructor(A,g){if(this.src=A,this.opts=g,this.font_name=g.lv_font_name,this.font_name||(this.font_name=g.output||"font"),g.bpp===3&&g.no_compress)throw new KA('LVGL supports "--bpp 3" with compression only');this.init_tables()}init_tables(){this.head=new gE(this),this.glyf=new IE(this),this.cmap=new oE(this),this.kern=new iE(this)}toCBin(){const[A,g]=this.glyf.toCBin(),t=this.cmap.toCBin(hA),I=this.kern.toCBin(hA),o=12+hA*6+0,i=8+hA*4,r=new ArrayBuffer(o+i),C=new DataView(r),B=(u,l)=>C.setUint32(l,u,!0);var n=0;B(0,n),n+=hA,B(0,n),n+=hA,B(0,n),n+=hA,C.setUint32(n,this.src.ascent-this.src.descent,!0),n+=4,C.setInt32(n,-this.src.descent,!0),n+=4,C.setUint8(n,this.src.subpixels_mode||0),n+=1,C.setInt8(n,this.src.underlinePosition||0),n+=1,C.setInt8(n,this.src.underlineThickness||0),n+=1,n+=1,B(o,n),n+=hA,B(0,n),n+=hA,B(0,n),n+=hA;const Q=this.head.kern_ref();B(i+I.byteLength,n),n+=hA,B(i+I.byteLength+A.byteLength,n),n+=hA,B(i+I.byteLength+A.byteLength+g.byteLength,n),n+=hA,B(Q.dsc==="NULL"?0:i,n),n+=hA,C.setUint16(n,Q.scale,!0),n+=2;const a=this.cmap.getMapNumber(),E=this.opts.bpp,h=Q.classes,w=this.glyf.getCompressionCode();return C.setUint16(n,a|E<<9|h<<13|w<<14,!0),n+=2,this.concatArrayBuffers([r,I,A,g,t])}concatArrayBuffers(A){const g=A.reduce((i,r)=>i+r.byteLength,0),t=new ArrayBuffer(g),I=new Uint8Array(t);let o=0;for(const i of A)I.set(new Uint8Array(i),o),o+=i.byteLength;return t}}class gE{constructor(A){this.font=A}kern_ref(){return this.font,{scale:0,dsc:"NULL",classes:0}}}class tE{constructor(A){this.buffer=new Uint8Array(A),this.byteIndex=0,this.bitIndex=0,this.bigEndian=!0}writeBits(A,g){for(;g>0;){const t=Math.min(8-this.bitIndex,g),I=(1<>g-t&I;this.bigEndian?this.buffer[this.byteIndex]|=o<<8-this.bitIndex-t:this.buffer[this.byteIndex]|=o<=8&&(this.byteIndex++,this.bitIndex=0),g-=t}}getUsedBytes(){return this.bitIndex>0?this.byteIndex+1:this.byteIndex}}class IE{constructor(A){this.font=A,this.lv_data=[],this.lv_compiled=!1}pixelsToBpp(A){const g=this.font.opts.bpp;return A.map(t=>t.map(I=>I>>>8-g))}storePixels(A,g){this.getCompressionCode()===0?this.storePixelsRaw(A,g):this.storePixelsCompressed(A,g)}storePixelsRaw(A,g){const t=this.font.opts.bpp;for(let I=0;I{const I=A.glyph_id[t.code],o=this.lv_bitmap(t);this.lv_data[I]={bin:o,offset:g,glyph:t},g+=o.byteLength})}toCBin(){this.lv_compile();const A=this.lv_data.slice(1).filter(i=>i).map(i=>i.bin),g=this.balign4(this.concatArrayBuffers(A)),t=new ArrayBuffer(this.lv_data.length*16+16),I=new DataView(t);let o=1;return this.lv_data.forEach(i=>{if(i){const r=Math.round(i.glyph.advanceWidth*16);I.setUint32(o*16,i.offset,!0),I.setUint32(o*16+4,r,!0),I.setUint16(o*16+8,i.glyph.bbox.width,!0),I.setUint16(o*16+10,i.glyph.bbox.height,!0),I.setInt16(o*16+12,i.glyph.bbox.x,!0),I.setInt16(o*16+14,i.glyph.bbox.y,!0)}o++}),[g,t]}balign4(A){const g=A.byteLength%4;if(g===0)return A;const t=4-g,I=new ArrayBuffer(t);return this.concatArrayBuffers([A,I])}concatArrayBuffers(A){const g=A.reduce((i,r)=>i+r.byteLength,0),t=new ArrayBuffer(g),I=new Uint8Array(t);let o=0;for(const i of A)I.set(new Uint8Array(i),o),o+=i.byteLength;return t}getCompressionCode(){return this.font.opts.no_compress||this.font.opts.bpp===1?0:this.font.opts.no_prefilter?2:1}}class oE{constructor(A){this.font=A,this.lv_compiled=!1,this.lv_subtables=[],this.subtables_plan=null,this.buildGlyphIdMap()}buildGlyphIdMap(){const A=this.font;A.glyph_id={},A.src.glyphs&&A.src.glyphs.forEach((g,t)=>{A.glyph_id[g.code]=t+1})}lv_format2enum(A){switch(A){case"format0_tiny":return"LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY";case"format0":return"LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL";case"sparse_tiny":return"LV_FONT_FMT_TXT_CMAP_SPARSE_TINY";case"sparse":return"LV_FONT_FMT_TXT_CMAP_SPARSE_FULL";default:throw new Error("Unknown subtable format")}}lv_format2int(A){return["format0","sparse","format0_tiny","sparse_tiny"].indexOf(A)}getMapNumber(){if(!this.subtables_plan){const A=this.font;if(!A.src.glyphs||A.src.glyphs.length===0)return 0;this.subtables_plan=Ct(A.src.glyphs.map(g=>g.code))}return this.subtables_plan.length}glyphByCode(A){const g=this.font;return g.src.glyphs?g.src.glyphs.find(t=>t.code===A):null}collect_format0_data(A,g,t){const I=this.font,o=[];for(let i=A;i<=g;i++){const r=I.glyph_id[i]||0;o.push(r?r-t:0)}return o}collect_sparse_data(A,g){const t=this.font;let I=[],o=[];for(let i of A){let r=this.glyphByCode(i),C=t.glyph_id[r.code],B=i-A[0],n=C-g;if(B<0||B>65535)throw new Error("Codepoint delta out of range");if(n<0||n>65535)throw new Error("Glyph ID delta out of range");I.push(B),o.push(n)}return{codes:I,ids:o}}toCBin(A){const g=this.font;if(!g.src.glyphs||g.src.glyphs.length===0)return new ArrayBuffer(0);this.subtables_plan||(this.subtables_plan=Ct(g.src.glyphs.map(Q=>Q.code)));const t=this.subtables_plan;let I=0;const o=12+A*2+(A==4?0:4),i=new ArrayBuffer(t.length*o),r=new DataView(i),C=A==4?(Q,a)=>r.setUint32(a,Q,!0):(Q,a)=>AE(r,Q,a),B=[];let n=i.byteLength;for(let[Q,a]of t){let E=this.glyphByCode(a[0]),h=g.glyph_id[E.code],w=a[0],u=a[a.length-1],l=!1,f=!1,c=0,D=new ArrayBuffer(0),y=new ArrayBuffer(0);if(Q!=="format0_tiny")if(Q==="format0"){f=!0;let N=this.collect_format0_data(w,u,h);c=N.length,D=this.balign4(this.uint8ArrayToBuffer(new Uint8Array(N)))}else if(Q==="sparse_tiny"){l=!0;let N=this.collect_sparse_data(a,h);c=N.codes.length,y=this.balign4(this.uint16ArrayToBuffer(new Uint16Array(N.codes)))}else{l=!0,f=!0;let N=this.collect_sparse_data(a,h);c=N.codes.length,y=this.balign4(this.uint16ArrayToBuffer(new Uint16Array(N.codes))),D=this.align4(this.uint16ArrayToBuffer(new Uint16Array(N.ids)))}let v=I*o;r.setUint32(v,w,!0),v+=4,r.setUint16(v,u-w+1,!0),v+=2,r.setUint16(v,h,!0),v+=2,C(l?n:0,v),v+=A,n+=y.byteLength,C(f?n:0,v),v+=A,n+=D.byteLength,r.setUint16(v,c,!0),v+=2,r.setUint8(v,this.lv_format2int(Q)),v+=1,B.push(y),B.push(D),I++}return this.concatArrayBuffers([i,...B])}balign4(A){const g=A.byteLength%4;if(g===0)return A;const t=4-g,I=new ArrayBuffer(t);return this.concatArrayBuffers([A,I])}align4(A){const g=A.byteLength%4;if(g===0)return A;const t=4-g,I=new ArrayBuffer(t);return this.concatArrayBuffers([A,I])}uint8ArrayToBuffer(A){const g=new ArrayBuffer(A.byteLength);return new Uint8Array(g).set(A),g}uint16ArrayToBuffer(A){return A.buffer.slice(0,A.byteLength)}concatArrayBuffers(A){const g=A.reduce((i,r)=>i+r.byteLength,0),t=new ArrayBuffer(g),I=new Uint8Array(t);let o=0;for(const i of A)I.set(new Uint8Array(i),o),o+=i.byteLength;return t}}class iE{constructor(A){this.font=A}toCBin(A){return new ArrayBuffer(0)}}function rE(e,A){if(!e.output)throw new KA('Output is required for "cbin" writer');const t=new eE(A,e).toCBin();return{[e.output]:t}}class CE{constructor(){this.initialized=!1,this.supportedFormats=["ttf","woff","woff2","otf"],this.charsetCache=new Map}async initialize(){if(!this.initialized)try{if(typeof og>"u")throw new Error("opentype.js not loaded");this.initialized=!0,console.log("BrowserFontConverter initialized")}catch(A){throw console.error("BrowserFontConverter initialization failed:",A),A}}validateFont(A){if(!A)return!1;if(A instanceof File){const g=A.name.toLowerCase(),t=A.type.toLowerCase(),I=this.supportedFormats.some(i=>g.endsWith(`.${i}`)),o=["font/ttf","font/truetype","application/x-font-ttf","font/woff","font/woff2","application/font-woff","font/otf","application/x-font-otf"].some(i=>t.includes(i));return I||o}return A instanceof ArrayBuffer&&A.byteLength>0}async getFontInfo(A){try{let g;if(A instanceof File)g=await A.arrayBuffer();else if(A instanceof ArrayBuffer)g=A;else throw new Error("Unsupported font file type");const t=og.parse(g);return{familyName:this.getLocalizedName(t.names.fontFamily)||"Unknown",fullName:this.getLocalizedName(t.names.fullName)||"Unknown",postScriptName:this.getLocalizedName(t.names.postScriptName)||"Unknown",version:this.getLocalizedName(t.names.version)||"Unknown",unitsPerEm:t.unitsPerEm,ascender:t.ascender,descender:t.descender,numGlyphs:t.numGlyphs,supported:!0}}catch(g){return console.error("Failed to get font information:",g),{familyName:"Unknown",supported:!1,error:g.message}}}getLocalizedName(A){return A?A.en||A[Object.keys(A)[0]]:null}async convertToCBIN(A){this.initialized||await this.initialize();const{fontFile:g,fontName:t,fontSize:I=20,bpp:o=4,charset:i="deepseek",symbols:r="",range:C="",compression:B=!1,lcd:n=!1,lcd_v:Q=!1,progressCallback:a=null}=A;if(!this.validateFont(g))throw new KA("Unsupported font file format");try{a&&a(0,"Starting font processing...");let E;g instanceof File?E=await g.arrayBuffer():E=g,a&&a(10,"Parsing font structure...");const{ranges:h,charSymbols:w}=await this.parseCharacterInputAsync(i,r,C);a&&a(20,"Preparing conversion parameters...");const u={font:[{source_path:t||"custom_font",source_bin:E,ranges:[{range:h,symbols:w}],autohint_off:!1,autohint_strong:!1}],size:I,bpp:o,lcd:n,lcd_v:Q,no_compress:!B,no_kerning:!1,use_color_info:!1,format:"cbin",output:t||"font"};a&&a(30,"Collecting font data...");const l=await jQ(u);a&&a(70,"Generating CBIN format...");const f=rE(u,l),c=u.output;return a&&a(100,"Conversion completed!"),f[c]}catch(E){throw console.error("Font conversion failed:",E),new KA(`Font conversion failed: ${E.message}`)}}async parseCharacterInputAsync(A,g,t){let I=[],o=g||"";return A==="full"?(I=[0,65535,0],{ranges:I,charSymbols:o}):(A&&A!=="custom"&&(o=await this.getCharsetContentAsync(A)+o),t&&(I=this.parseUnicodeRange(t)),{ranges:I,charSymbols:o})}parseCharacterInput(A,g,t){let I=[],o=g||"";return A==="full"?(I=[0,65535,0],{ranges:I,charSymbols:o}):(A&&A!=="custom"&&(o=this.getCharsetContent(A)+o),t&&(I=this.parseUnicodeRange(t)),{ranges:I,charSymbols:o})}async loadCharsetFromFile(A){const t={latin:"./static/charsets/latin1.txt",deepseek:"./static/charsets/deepseek.txt",qwen:"./static/charsets/qwen18409.txt"}[A];if(!t)return null;try{const I=await fetch(t);if(!I.ok)throw new Error(`Failed to load charset file: ${I.status}`);const i=(await I.text()).split(` -`).join("");return this.charsetCache.set(A,i),i}catch(I){return console.error(`Failed to load charset ${A}:`,I),null}}getCharsetContent(A){const g={};return(A==="latin"||A==="deepseek"||A==="qwen")&&this.charsetCache.has(A)?this.charsetCache.get(A):A==="basic"?this.getCharsetContent("latin"):g[A]||""}async getCharsetContentAsync(A){if(A==="basic"&&(A="latin"),this.charsetCache.has(A))return this.charsetCache.get(A);if(A==="latin"||A==="deepseek"||A==="qwen"){const g=await this.loadCharsetFromFile(A);if(g)return g}return this.getCharsetContent(A)}parseUnicodeRange(A){const g=[],t=A.split(",");for(const I of t){const o=I.trim();if(o)if(o.includes("-")){const[i,r]=o.split("-"),C=this.parseHexOrDec(i),B=this.parseHexOrDec(r);C!==null&&B!==null&&g.push(C,B,C)}else{const i=this.parseHexOrDec(o);i!==null&&g.push(i,i,i)}}return g}parseHexOrDec(A){const g=A.trim();if(g.startsWith("0x")||g.startsWith("0X")){const I=parseInt(g,16);return isNaN(I)?null:I}const t=parseInt(g,10);return isNaN(t)?null:t}async estimateSizeAsync(A){const{fontSize:g=20,bpp:t=4,charset:I="latin",symbols:o="",range:i=""}=A;let r=o.length;if(I==="full")r=65536;else if(I&&I!=="custom"){const n=await this.getCharsetContentAsync(I);r+=n.length}if(i){const n=this.parseUnicodeRange(i);for(let Q=0;Q0}catch(A){return console.error("加载 FST 模型失败",A),!1}}packString(A,g){const t=new Uint8Array(g),I=Math.min(A.length,g);for(let o=0;o>8&255,g[2]=A>>16&255,g[3]=A>>24&255,g}packModels(){if(this.models.size===0)throw new Error("没有模型数据可打包");let A=0;const g=[];for(const[B,n]of Array.from(this.models.entries()).sort((Q,a)=>Q[0].localeCompare(a[0]))){A+=n.size;const Q=Array.from(n.entries()).sort((a,E)=>a[0].localeCompare(E[0]));g.push({name:B,files:Q})}const t=this.models.size;let I=4;for(const B of g)I+=36,I+=B.files.length*40;const o=I+Array.from(this.models.values()).reduce((B,n)=>B+Array.from(n.values()).reduce((Q,a)=>Q+a.byteLength,0),0),i=new Uint8Array(o);let r=0;i.set(this.packUint32(t),r),r+=4;let C=I;for(const B of g){i.set(this.packString(B.name,32),r),r+=32,i.set(this.packUint32(B.files.length),r),r+=4;for(const[n,Q]of B.files)i.set(this.packString(n,32),r),r+=32,i.set(this.packUint32(C),r),r+=4,i.set(this.packUint32(Q.byteLength),r),r+=4,C+=Q.byteLength}for(const B of g)for(const[n,Q]of B.files)i.set(new Uint8Array(Q),r),r+=Q.byteLength;return i.buffer}static isValidModel(A,g){return g==="esp32c3"||g==="esp32c6"?A.startsWith("wn9s_"):A.startsWith("wn9_")}clear(){this.models.clear()}getStats(){let A=0,g=0;for(const t of this.models.values()){A+=t.size;for(const I of t.values())g+=I.byteLength}return{modelCount:this.models.size,fileCount:A,totalSize:g,models:Array.from(this.models.keys())}}validatePackingCompatibility(){const A="test_model",g=this.packString(A,32),t=305419896,I=this.packUint32(t);return{stringPacking:{input:A,output:Array.from(g).map(o=>`0x${o.toString(16).padStart(2,"0")}`),isASCII:g.every((o,i)=>i>=A.length||o===A.charCodeAt(i))},intPacking:{input:`0x${t.toString(16)}`,output:Array.from(I).map(o=>`0x${o.toString(16).padStart(2,"0")}`),isLittleEndian:I[0]===120&&I[3]===18}}}}class sE{constructor(){this.files=[],this.textEncoder=new TextEncoder}addFile(A,g,t={}){A.length>32&&console.warn(`Filename "${A}" exceeds 32 bytes and will be truncated`),this.files.push({filename:A,data:g,size:g.byteLength,width:t.width||0,height:t.height||0})}async getImageDimensions(A){return new Promise(g=>{try{const t=new Blob([A]),I=URL.createObjectURL(t),o=new Image;o.onload=()=>{URL.revokeObjectURL(I),g({width:o.width,height:o.height})},o.onerror=()=>{URL.revokeObjectURL(I),g({width:0,height:0})},o.src=I}catch{g({width:0,height:0})}})}parseSpecialImageFormat(A,g){const t=A.toLowerCase().split(".").pop();if([".sjpg",".spng",".sqoi"].includes("."+t))try{const I=new DataView(g),o=I.getUint16(14,!0),i=I.getUint16(16,!0);return{width:o,height:i}}catch(I){console.warn(`Failed to parse special image format: ${A}`,I)}return{width:0,height:0}}packUint32(A){const g=new Uint8Array(4);return g[0]=A&255,g[1]=A>>8&255,g[2]=A>>16&255,g[3]=A>>24&255,g}packUint16(A){const g=new Uint8Array(2);return g[0]=A&255,g[1]=A>>8&255,g}packString(A,g){const t=new Uint8Array(g),I=this.textEncoder.encode(A),o=Math.min(I.length,g);return t.set(I.slice(0,o),0),t}computeChecksum(A){let g=0;for(let t=0;t{const I=g.filename.split(".").pop()||"",o=t.filename.split(".").pop()||"";if(I!==o)return I.localeCompare(o);const i=g.filename.replace(/\.[^/.]+$/,""),r=t.filename.replace(/\.[^/.]+$/,"");return i.localeCompare(r)})}async generate(A=null){if(this.files.length===0)throw new Error("No files to package");A&&A(0,"Starting to package files...");const g=this.sortFiles(this.files),t=g.length,I=[];let o=0;for(let f=0;f0||v.height>0)D=v.width,y=v.height;else{const N=c.filename.toLowerCase().split(".").pop();if(["png","jpg","jpeg","gif","bmp","webp"].includes(N)){const L=await this.getImageDimensions(c.data);D=L.width,y=L.height}}}I.push({filename:c.filename,data:c.data,size:c.size,offset:o,width:D,height:y}),o+=2+c.size}A&&A(40,"Building file mapping table...");const i=t*44,r=new Uint8Array(i);let C=0;for(const f of I)r.set(this.packString(f.filename,32),C),C+=32,r.set(this.packUint32(f.size),C),C+=4,r.set(this.packUint32(f.offset),C),C+=4,r.set(this.packUint16(f.width),C),C+=2,r.set(this.packUint16(f.height),C),C+=2;A&&A(60,"Merging file data...");const B=new Uint8Array(o);let n=0;for(let f=0;f0?Math.round(A/this.files.length):0}}printFileList(){if(console.log("=== Packaged File List ==="),console.log(`Total files: ${this.files.length}`),this.files.length===0){console.log("No files available");return}this.sortFiles(this.files).forEach((t,I)=>{var C;const o=((C=t.filename.split(".").pop())==null?void 0:C.toLowerCase())||"unknown",i=(t.size/1024).toFixed(2),r=t.width&&t.height?`${t.width}x${t.height}`:"N/A";console.log(`${String(I+1).padStart(3," ")}. ${t.filename}`),console.log(` Type: ${o.toUpperCase()}`),console.log(` Size: ${i} KB (${t.size} bytes)`),console.log(` Dimensions: ${r}`),console.log("")});const g=this.getStats();console.log("=== File Statistics ==="),console.log(`Total size: ${(g.totalSize/1024).toFixed(2)} KB`),console.log(`Average size: ${(g.averageFileSize/1024).toFixed(2)} KB`),console.log("File type distribution:"),Object.entries(g.fileTypes).forEach(([t,I])=>{console.log(` ${t.toUpperCase()}: ${I} files`)})}clear(){this.files=[]}}let ke={tool:{workerLocalUrl:`var gifsicle=function(){Me="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(Me=Me||__filename);var Me,c=function(e){var j,r,h=void 0!==(e=e||{})?e:{},t=(h.ready=new Promise(function(e,r){j=e}),h.preRun=h.preRun||[],h.preRun.push(function(){if(h.folder&&h.folder.length)for(let e=0;e>10,56320|1023&s)))):i+=String.fromCharCode(u)}return i}function W(e,r){return e?g(E,e,r):""}function X(e,r,t,n){if(!(0>6,r[t++]=128|63&s}else if(s<=65535){if(i<=t+2)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(i<=t+3)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o}function G(e){for(var r=0,t=0;t>2]=e}var x={splitPath:function(e){return/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,r){for(var t=0,n=e.length-1;0<=n;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:function(e){var r="/"===e.charAt(0),t="/"===e.substr(-1);return(e=(e=x.normalizeArray(e.split("/").filter(function(e){return!!e}),!r).join("/"))||r?e:".")&&t&&(e+="/"),(r?"/":"")+e},dirname:function(e){var e=x.splitPath(e),r=e[0],e=e[1];return r||e?r+(e=e&&e.substr(0,e.length-1)):"."},basename:function(e){if("/"===e)return"/";var r=e.lastIndexOf("/");return-1===r?e:e.substr(r+1)},extname:function(e){return x.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return x.normalize(e.join("/"))},join2:function(e,r){return x.normalize(e+"/"+r)}},R={resolve:function(){for(var e="",r=!1,t=arguments.length-1;-1<=t&&!r;t--){var n=0<=t?arguments[t]:T.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r="/"===n.charAt(0)}return(r?"/":"")+(e=x.normalizeArray(e.split("/").filter(function(e){return!!e}),!r).join("/"))||"."},relative:function(e,r){function t(e){for(var r=0;r>>0),0!=t&&(r=Math.max(r,256)),t=e.contents,e.contents=new Uint8Array(r),0r)e.contents.length=r;else for(;e.contents.length=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(8>>0)%T.nameTable.length},hashAddNode:function(e){var r=T.hashName(e.parent.id,e.name);e.name_next=T.nameTable[r],T.nameTable[r]=e},hashRemoveNode:function(e){var r=T.hashName(e.parent.id,e.name);if(T.nameTable[r]===e)T.nameTable[r]=e.name_next;else for(var t=T.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode:function(e,r){var t=T.mayLookup(e);if(t)throw new T.ErrnoError(t,e);for(var t=T.hashName(e.id,r),n=T.nameTable[t];n;n=n.name_next){var o=n.name;if(n.parent.id===e.id&&o===r)return n}return T.lookup(e,r)},createNode:function(e,r,t,n){e=new T.FSNode(e,r,t,n);return T.hashAddNode(e),e},destroyNode:function(e){T.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(e){var r=T.flagModes[e];if(void 0===r)throw new Error("Unknown file open mode: "+e);return r},flagsToPermissionString:function(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:function(e,r){return T.ignorePermissions||(-1===r.indexOf("r")||292&e.mode)&&(-1===r.indexOf("w")||146&e.mode)&&(-1===r.indexOf("x")||73&e.mode)?0:2},mayLookup:function(e){var r=T.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate:function(e,r){try{T.lookupNode(e,r);return 20}catch(e){}return T.nodePermissions(e,"wx")},mayDelete:function(e,r,t){var n;try{n=T.lookupNode(e,r)}catch(e){return e.errno}r=T.nodePermissions(e,"wx");if(r)return r;if(t){if(!T.isDir(n.mode))return 54;if(T.isRoot(n)||T.getPath(n)===T.cwd())return 10}else if(T.isDir(n.mode))return 31;return 0},mayOpen:function(e,r){return e?T.isLink(e.mode)?32:T.isDir(e.mode)&&("r"!==T.flagsToPermissionString(r)||512&r)?31:T.nodePermissions(e,T.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd:function(e,r){r=r||T.MAX_OPEN_FDS;for(var t=e=e||0;t<=r;t++)if(!T.streams[t])return t;throw new T.ErrnoError(33)},getStream:function(e){return T.streams[e]},createStream:function(e,r,t){T.FSStream||(T.FSStream=function(){},T.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var n,o=new T.FSStream;for(n in e)o[n]=e[n];e=o;r=T.nextfd(r,t);return e.fd=r,T.streams[r]=e},closeStream:function(e){T.streams[e]=null},chrdev_stream_ops:{open:function(e){var r=T.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new T.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,r){return e<<8|r},registerDevice:function(e,r){T.devices[e]={stream_ops:r}},getDevice:function(e){return T.devices[e]},getMounts:function(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs:function(r,t){"function"==typeof r&&(t=r,r=!1),T.syncFSRequests++,1=n.length&&i(null)}n.forEach(function(e){if(!e.type.syncfs)return a(null);e.type.syncfs(e,r,a)})},mount:function(e,r,t){var n,o="/"===t,i=!t;if(o&&T.root)throw new T.ErrnoError(10);if(!o&&!i){i=T.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,T.isMountpoint(n))throw new T.ErrnoError(10);if(!T.isDir(n.mode))throw new T.ErrnoError(54)}i={type:e,opts:r,mountpoint:t,mounts:[]},r=e.mount(i);return(r.mount=i).root=r,o?T.root=r:n&&(n.mounted=i,n.mount&&n.mount.mounts.push(i)),r},unmount:function(e){e=T.lookupPath(e,{follow_mount:!1});if(!T.isMountpoint(e.node))throw new T.ErrnoError(28);var e=e.node,r=e.mounted,n=T.getMounts(r),r=(Object.keys(T.nameTable).forEach(function(e){for(var r=T.nameTable[e];r;){var t=r.name_next;-1!==n.indexOf(r.mount)&&T.destroyNode(r),r=t}}),e.mounted=null,e.mount.mounts.indexOf(r));e.mount.mounts.splice(r,1)},lookup:function(e,r){return e.node_ops.lookup(e,r)},mknod:function(e,r,t){var n=T.lookupPath(e,{parent:!0}).node,e=x.basename(e);if(!e||"."===e||".."===e)throw new T.ErrnoError(28);var o=T.mayCreate(n,e);if(o)throw new T.ErrnoError(o);if(n.node_ops.mknod)return n.node_ops.mknod(n,e,r,t);throw new T.ErrnoError(63)},create:function(e,r){return T.mknod(e,r=(r=void 0!==r?r:438)&4095|32768,0)},mkdir:function(e,r){return T.mknod(e,r=(r=void 0!==r?r:511)&1023|16384,0)},mkdirTree:function(e,r){for(var t=e.split("/"),n="",o=0;othis.length-1||e<0))return r=e%this.chunkSize,e=e/this.chunkSize|0,this.getter(e)[r]},o.prototype.setDataGetter=function(e){this.getter=e},o.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",a,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw new Error("Couldn't load "+a+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),t=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,e=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,o=1048576,i=(t||(o=n),this);i.setDataGetter(function(e){var r=e*o,t=(e+1)*o-1,t=Math.min(t,n-1);if(void 0===i.chunks[e]&&(i.chunks[e]=function(e,r){if(r=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s>2]=n.dev,k[t+4>>2]=0,k[t+8>>2]=n.ino,k[t+12>>2]=n.mode,k[t+16>>2]=n.nlink,k[t+20>>2]=n.uid,k[t+24>>2]=n.gid,k[t+28>>2]=n.rdev,k[t+32>>2]=0,F=[n.size>>>0,(S=n.size,1<=+ne(S)?0>>0:~~+oe((S-(~~S>>>0))/4294967296)>>>0:0)],k[t+40>>2]=F[0],k[t+44>>2]=F[1],k[t+48>>2]=4096,k[t+52>>2]=n.blocks,k[t+56>>2]=n.atime.getTime()/1e3|0,k[t+60>>2]=0,k[t+64>>2]=n.mtime.getTime()/1e3|0,k[t+68>>2]=0,k[t+72>>2]=n.ctime.getTime()/1e3|0,k[t+76>>2]=0,F=[n.ino>>>0,(S=n.ino,1<=+ne(S)?0>>0:~~+oe((S-(~~S>>>0))/4294967296)>>>0:0)],k[t+80>>2]=F[0],k[t+84>>2]=F[1],0},doMsync:function(e,r,t,n,o){e=E.slice(e,e+t);T.msync(r,e,o,t,n)},doMkdir:function(e,r){return"/"===(e=x.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),T.mkdir(e,r,0),0},doMknod:function(e,r,t){switch(61440&r){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return T.mknod(e,r,t),0},doReadlink:function(e,r,t){if(t<=0)return-28;var e=T.readlink(e),n=Math.min(t,G(e)),o=y[r+n];return X(e,E,r,t+1),y[r+n]=o,n},doAccess:function(e,r){if(-8&r)return-28;e=T.lookupPath(e,{follow:!0}).node;if(!e)return-44;var t="";return 4&r&&(t+="r"),2&r&&(t+="w"),1&r&&(t+="x"),t&&T.nodePermissions(e,t)?-2:0},doDup:function(e,r,t){var n=T.getStream(t);return n&&T.close(n),T.open(e,r,0,t,t).fd},doReadv:function(e,r,t,n){for(var o=0,i=0;i>2],s=k[r+(8*i+4)>>2],a=T.read(e,y,a,s,n);if(a<0)return-1;if(o+=a,a>2],s=k[r+(8*i+4)>>2],a=T.write(e,y,a,s,n);if(a<0)return-1;o+=a}return o},varargs:void 0,get:function(){return N.varargs+=4,k[N.varargs-4>>2]},getStr:function(e){return W(e)},getStreamFromFD:function(e){e=T.getStream(e);if(e)return e;throw new T.ErrnoError(8)},get64:function(e,r){return e}};var ge={};function z(){if(!z.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:C||"./this.program"};for(r in ge)e[r]=ge[r];var r,t=[];for(r in e)t.push(r+"="+e[r]);z.strings=t}return z.strings}function ve(e,r,t,n){this.parent=e=e||this,this.mount=e.mount,this.mounted=null,this.id=T.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n}function ye(e,r,t){t=0>2]=t/1e3|0,k[r+4>>2]=t%1e3*1e3*1e3|0,0},d:function(e,r,t){N.varargs=t;try{var n=N.getStreamFromFD(e);switch(r){case 0:return(o=N.get())<0?-28:T.open(n.path,n.flags,0,o).fd;case 1:case 2:return 0;case 3:return n.flags;case 4:var o=N.get();return n.flags|=o,0;case 12:o=N.get();return K[o+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return A(28),-1;default:return-28}}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},i:function(e,r,t){N.varargs=t;try{var n=N.getStreamFromFD(e);switch(r){case 21509:case 21505:return n.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=N.get();return k[o>>2]=0;case 21520:return n.tty?-28:-59;case 21531:o=N.get();return T.ioctl(n,r,o);case 21523:case 21524:return n.tty?0:-59;default:D("bad ioctl syscall "+r)}}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},e:function(e,r,t){N.varargs=t;try{var n=N.getStr(e),o=N.get();return T.open(n,r,o).fd}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},t:function(e){try{return e=N.getStr(e),T.rmdir(e),0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},j:function(e){try{var r=N.umask;return N.umask=e,r}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},u:function(e){try{return e=N.getStr(e),T.unlink(e),0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},v:function(e,r,t,n){try{D("cannot wait on child processes")}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},n:function(e,r,t){E.copyWithin(e,r,r+t)},b:function(e){var r=E.length,t=2147483648;if(t<(e>>>=0))return!1;for(var n,o=1;o<=4;o*=2){var i=r*(1+.2/o),i=Math.min(i,e+100663296);if(function(e){try{return p.grow(e-v.byteLength+65535>>>16),Y(p.buffer),1}catch(e){}}(Math.min(t,(0<(i=Math.max(16777216,e,i))%(n=65536)&&(i+=n-i%n),i))))return!0}return!1},p:function(a,s){var u=0;return z().forEach(function(e,r){for(var t=s+u,n=(k[a+4*r>>2]=t,e),o=t,r=void 0,i=0;i>0]=n.charCodeAt(i);r||(y[o>>0]=0),u+=e.length+1}),0},q:function(e,r){var t=z(),n=(k[e>>2]=t.length,0);return t.forEach(function(e){n+=e.length+1}),k[r>>2]=n,0},c:function(e){xe(e)},f:function(e){try{var r=N.getStreamFromFD(e);return T.close(r),0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},r:function(e,r){try{var t=N.getStreamFromFD(e),n=t.tty?2:T.isDir(t.mode)?3:T.isLink(t.mode)?7:4;return y[r>>0]=n,0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},h:function(e,r,t,n){try{var o=N.getStreamFromFD(e),i=N.doReadv(o,r,t);return k[n>>2]=i,0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},m:function(e,r,t,n,o){try{var i=N.getStreamFromFD(e),a=4294967296*t+(r>>>0),s=9007199254740992;return a<=-s||s<=a?-61:(T.llseek(i,a,n),F=[i.position>>>0,(S=i.position,1<=+ne(S)?0>>0:~~+oe((S-(~~S>>>0))/4294967296)>>>0:0)],k[o>>2]=F[0],k[o+4>>2]=F[1],i.getdents&&0==a&&0===n&&(i.getdents=null),0)}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},g:function(e,r,t,n){try{var o=N.getStreamFromFD(e),i=N.doWritev(o,r,t);return k[n>>2]=i,0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},memory:p,o:function(){w("missing function: popen"),D(-1)},l:function(){return 6},k:function(){},table:I},_e=(!function(){var r={a:ke};function t(e,r){e=e.exports;h.asm=e,ue()}function n(e){t(e.instance)}function o(e){return(l||!L&&!c||"function"!=typeof fetch||de(P)?new Promise(function(e,r){e(pe())}):fetch(P,{credentials:"same-origin"}).then(function(e){if(e.ok)return e.arrayBuffer();throw"failed to load wasm binary file at '"+P+"'"}).catch(pe)).then(function(e){return WebAssembly.instantiate(e,r)}).then(e,function(e){w("failed to asynchronously prepare wasm: "+e),D(e)})}if(se(),h.instantiateWasm)try{h.instantiateWasm(r,t);return}catch(e){return w("Module.instantiateWasm callback failed with error: "+e)}l||"function"!=typeof WebAssembly.instantiateStreaming||ce(P,fe)||de(P)||"function"!=typeof fetch?o(n):fetch(P,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,r).then(n,function(e){return w("wasm streaming compile failed: "+e),w("falling back to ArrayBuffer instantiation"),o(n)})})}(),h.___wasm_call_ctors=function(){return(_e=h.___wasm_call_ctors=h.asm.w).apply(null,arguments)}),be=h._malloc=function(){return(be=h._malloc=h.asm.x).apply(null,arguments)},De=h.___errno_location=function(){return(De=h.___errno_location=h.asm.y).apply(null,arguments)},Se=(h._main=function(){return(h._main=h.asm.z).apply(null,arguments)},h.stackAlloc=function(){return(Se=h.stackAlloc=h.asm.A).apply(null,arguments)});function Fe(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Pe(r){var t=h._main;r=r||[];try{for(let e=0;e>2]=V(C);for(var n=1;n>2)+n]=V(e[n-1]);return k[(t>>2)+r]=0,{argc:r,argv:t}}(s.split(" ").filter(e=>Boolean(e)));if(0!==(n=t(o,i)))break}xe(n,!0)}catch(e){if(e instanceof Fe)return;if("unwind"==e)return void(d=!0);var a=e;e&&"object"==typeof e&&e.stack&&(a=[e,e.stack]),w("exception thrown: "+a),u(1,e)}}function Ae(e){function r(){Ee||(Ee=!0,h.calledRun=!0,U||(h.noFSInit||T.init.initialized||T.init(),Z(J),T.ignorePermissions=!1,Z(Q),j(h),h.onRuntimeInitialized&&h.onRuntimeInitialized(),Re&&Pe(e),te()))}e=e||a,0<_||(re(),0<_||(h.setStatus?(h.setStatus("Running..."),setTimeout(function(){setTimeout(function(){h.setStatus("")},1),r()},1)):r()))}function xe(e,r){r&&d&&0===e||(d||(U=!0,h.onExit&&h.onExit(e)),u(e,new Fe(e)))}if(h.dynCall_vi=function(){return(h.dynCall_vi=h.asm.B).apply(null,arguments)},b=function e(){Ee||Ae(),Ee||(b=e)},h.run=Ae,h.preInit)for("function"==typeof h.preInit&&(h.preInit=[h.preInit]);0{0{t+=String.fromCharCode(e),10===e&&(console.error(t),t="")},stdout:e=>{r+=String.fromCharCode(e),10===e&&(console.log(r),r="")}};const l=[];return async(e={})=>{let{data:i=null,command:a=[],folder:s=[],isStrict:u=!1}=e;return await new Promise(e=>{l.push(e),1===l.length&&l[0]()}),new Promise((r,t)=>{let n=!1,o="";c({stdout:f.stdout,stderr:e=>{o+=String.fromCharCode(e),10===e&&(console.error(o),u&&t(o))},arguments:a,input:i,folder:s,output:e=>{r(e),n=!0}}).then(()=>{(0,f.flush)(),n||t(),0{var e=await gifsicle(r.data).catch(e=>{postMessage(e)});postMessage(e)})().catch(e=>{postMessage(null)})};`,workerBlobUrl:"",worker(){return this.workerBlobUrl||(this.workerLocalUrl?this.workerBlobUrl=URL.createObjectURL(new Blob([this.workerLocalUrl])):this.workerBlobUrl="../src/worker.js",this.workerBlobUrl)},errorLink(){return` - Check: https://github.com/renzhezhilu/gifsicle-wasm-browser`},testType(e){return e instanceof Element?"element":Object.prototype.toString.call(e).replace(/\[object\s(.+)\]/,"$1").toLowerCase()},async textToUrl(e){return this.worker()},loadCommand(e){var A=this.testType(e);if(e.length===0)throw" the content can not be blank"+this.errorLink();if(A==="array")return e.map(g=>g.replace(/\n/gi," "));throw" types:"+A+", must be an array"+this.errorLink()},loadOne(e){return new Promise(async(A,g)=>{var t=this.testType(e);if(["string"].includes(t))fetch(e).then(I=>{if(I.status!==200)throw"<"+e+"> Url error!!!"+this.errorLink();return I.arrayBuffer()}).then(I=>A(I));else if(["blob","file"].includes(t))new Response(e).arrayBuffer().then(I=>A(I));else{if(!["arraybuffer"].includes(t))throw" types:"+t+", only supports Url, blob, file, arraybuffer"+this.errorLink();A(e)}})},loadFile(e){return new Promise(async(A,g)=>{var t=this.testType(e);if(t!=="array")throw" types:"+t+", only supports Array"+this.errorLink();if(e.length===0)throw" the content can not be blank"+this.errorLink();t=e.map(I=>this.loadOne(I.file)),Promise.all(t).then(function(I){var o=e.map((i,r)=>(i.file=I[r],i));A(o)}).catch(function(I){})})},loadFolder(e){return new Promise(async(A,g)=>{var t=this.testType(e);if(!["array"].includes(t))throw" types:"+t+", only supports Array"+this.errorLink();A(e)})}},run(e={}){return new Promise(async(A,g)=>{let{input:t=[],command:I="",folder:o=[],isStrict:i=!1,start:r=E=>{}}=e;var C=await this.tool.textToUrl();let B=new Worker(C);var n=this.tool.loadCommand(I),Q=await this.tool.loadFile(t),a=(r(Q),await this.tool.loadFolder(o));B.postMessage({data:Q,command:n,folder:a,isStrict:i}),B.onmessage=async function(E){if(!E.data||typeof E.data=="string")return B.terminate(),void g(E.data);let h=[];for(let u=0;u=0&&n.push(`--loopcount=${C}`),r&&r>0&&n.push(`--lossy=${r}`),i&&n.push(`-O${this.optimizationLevel}`),n.push("1.gif"),n.push("-o /out/output.gif");const Q=n.join(" ");this.debug&&(console.log("GIF 缩放命令:",Q),console.log("输入文件大小:",A.size||"未知"));const a=await ke.run({input:[{file:A,name:"1.gif"}],command:[Q]});if(!a||a.length===0)throw new Error("gifsicle 处理失败,未返回结果");const E=a[0];if(this.debug&&(console.log("GIF 缩放完成"),console.log("输出文件大小:",E.size),A.size)){const h=((1-E.size/A.size)*100).toFixed(2);console.log(`压缩率: ${h}%`)}return new Blob([E],{type:"image/gif"})}catch(B){throw console.error("GIF 缩放失败:",B),new Error(`GIF 缩放失败: ${B.message}`)}}async scaleGifBatch(A){const g=[];for(let t=0;t=0&&i.push(`--loopcount=${o}`),t&&t>0&&i.push(`--lossy=${t}`),i.push(`-O${I}`),i.push("1.gif"),i.push("-o /out/output.gif");const r=i.join(" ");this.debug&&console.log("GIF 优化命令:",r);const C=await ke.run({input:[{file:A,name:"1.gif"}],command:[r]});if(!C||C.length===0)throw new Error("gifsicle 优化失败");return new Blob([C[0]],{type:"image/gif"})}catch(i){throw console.error("GIF 优化失败:",i),new Error(`GIF 优化失败: ${i.message}`)}}async getGifInfo(A){try{const g=await ke.run({input:[{file:A,name:"1.gif"}],command:["--info 1.gif -o /out/info.txt"]});if(!g||g.length===0)throw new Error("无法获取 GIF 信息");const I=await g[0].text();return this.parseGifInfo(I)}catch(g){return console.error("获取 GIF 信息失败:",g),{size:A.size||0,type:"image/gif"}}}parseGifInfo(A){const g={frames:0,width:0,height:0,colors:0,loopCount:0};try{const t=A.match(/(\d+) images?/);t&&(g.frames=parseInt(t[1]));const I=A.match(/logical screen (\d+)x(\d+)/);I&&(g.width=parseInt(I[1]),g.height=parseInt(I[2]));const o=A.match(/(\d+) colors/);if(o&&(g.colors=parseInt(o[1])),A.includes("loop forever"))g.loopCount=0;else{const i=A.match(/loop count (\d+)/);i&&(g.loopCount=parseInt(i[1]))}}catch(t){console.warn("解析 GIF 信息时出错:",t)}return g}async cropGif(A,g){const{x:t,y:I,width:o,height:i}=g;try{const r=["-U",`--crop ${t},${I}+${o}x${i}`,"1.gif","-o /out/output.gif"].join(" ");this.debug&&console.log("GIF 裁剪命令:",r);const C=await ke.run({input:[{file:A,name:"1.gif"}],command:[r]});if(!C||C.length===0)throw new Error("gifsicle 裁剪失败");return new Blob([C[0]],{type:"image/gif"})}catch(r){throw console.error("GIF 裁剪失败:",r),new Error(`GIF 裁剪失败: ${r.message}`)}}dispose(){this.debug&&console.log("WasmGifScaler disposed")}setDebug(A){this.debug=A}setQuality(A){if(A<1||A>200)throw new Error("质量参数必须在 1-200 之间");this.quality=A}setOptimizationLevel(A){if(A<1||A>3)throw new Error("优化级别必须在 1-3 之间");this.optimizationLevel=A}}class sI{constructor(){this.config=null,this.resources=new Map,this.tempFiles=[],this.fontConverterBrowser=nE,this.convertedFonts=new Map,this.wakenetPacker=new BE,this.spiffsGenerator=new sE,this.gifScaler=new aE({quality:30,debug:!0,scalingMode:"auto",optimize:!0,optimizationLevel:2}),this.configStorage=cA,this.autoSaveEnabled=!0}setConfig(A,g={}){if(((g==null?void 0:g.strict)??!0)&&!this.validateConfig(A))throw new Error("Configuration object validation failed");return this.config={...A},this}validateConfig(A){var I,o,i;if(!A)return!1;if(!((I=A.chip)!=null&&I.model))return console.error("Missing chip model configuration"),!1;const g=A.chip.display;if(!(g!=null&&g.width)||!(g!=null&&g.height))return console.error("Missing display resolution configuration"),!1;const t=(o=A.theme)==null?void 0:o.font;return(t==null?void 0:t.type)==="preset"&&!t.preset?(console.error("Preset font configuration is incomplete"),!1):(t==null?void 0:t.type)==="custom"&&!((i=t.custom)!=null&&i.file)?(console.error("Custom font file not provided"),!1):!0}addResource(A,g,t,I="other"){return this.resources.set(A,{file:g,filename:t,size:g.size,type:g.type,lastModified:g.lastModified||Date.now(),resourceType:I}),this.autoSaveEnabled&&g instanceof File&&this.saveFileToStorage(A,g,I).catch(o=>{console.warn(`Auto-saving file ${t} failed:`,o)}),this}async saveFileToStorage(A,g,t){try{await this.configStorage.saveFile(A,g,t),console.log(`File ${g.name} auto-saved to storage`)}catch(I){throw console.error(`Failed to save file to storage: ${g.name}`,I),I}}async restoreResourceFromStorage(A){try{const g=await this.configStorage.loadFile(A);return g?(this.resources.set(A,{file:g,filename:g.name,size:g.size,type:g.type,lastModified:g.lastModified,resourceType:g.storedType,fromStorage:!0}),console.log(`Resource ${A} restored from storage successfully: ${g.name}`),!0):!1}catch(g){return console.error(`Failed to restore resource from storage: ${A}`,g),!1}}async restoreAllResourcesFromStorage(A){var t,I,o,i,r,C,B,n,Q,a,E;if(!A)return;const g=[];if((I=(t=A.theme)==null?void 0:t.font)!=null&&I.custom&&((o=A.theme.font.custom)==null?void 0:o.file)===null){const h="custom_font";if(await this.restoreResourceFromStorage(h)){const w=this.resources.get(h);w&&(A.theme.font.custom.file=w.file,g.push(`Custom font: ${w.filename}`),console.log(`Custom font restored even when type is '${A.theme.font.type}'`))}}if(((r=(i=A.theme)==null?void 0:i.emoji)==null?void 0:r.type)==="custom"&&A.theme.emoji.custom){const h=A.theme.emoji.custom,w=h.emotionMap||{},u=h.fileMap||{},l=h.images||{};if(Object.keys(w).length>0||Object.keys(u).length>0){const f=new Set;for(const c of Object.keys(u))u[c]===null&&f.add(c);for(const c of f){let D=`hash_${c}`,y=await this.restoreResourceFromStorage(D);if(!y){const v=`emoji_hash_${c}`;y=await this.restoreResourceFromStorage(v),y&&(D=v)}if(y){const v=this.resources.get(D);if(v){u[c]=v.file;const N=Object.entries(w).filter(([L,X])=>X===c).map(([L,X])=>L);N.forEach(L=>{l[L]=v.file}),g.push(`Emoji file ${c.substring(0,8)}... (used for: ${N.join(", ")})`)}}}Object.keys(u).forEach(c=>{A.theme.emoji.custom.fileMap[c]=u[c]}),Object.keys(l).forEach(c=>{A.theme.emoji.custom.images[c]=l[c]})}else{for(const[f,c]of Object.entries(l))if(c===null){const D=`emoji_${f}`;if(await this.restoreResourceFromStorage(D)){const y=this.resources.get(D);y&&(l[f]=y.file,g.push(`Emoji ${f}: ${y.filename}`))}}A.theme.emoji.custom.images=l}}if(((n=(B=(C=A.theme)==null?void 0:C.skin)==null?void 0:B.light)==null?void 0:n.backgroundType)==="image"&&A.theme.skin.light.backgroundImage===null){const h="background_light";if(await this.restoreResourceFromStorage(h)){const w=this.resources.get(h);w&&(A.theme.skin.light.backgroundImage=w.file,g.push(`Light background: ${w.filename}`))}}if(((E=(a=(Q=A.theme)==null?void 0:Q.skin)==null?void 0:a.dark)==null?void 0:E.backgroundType)==="image"&&A.theme.skin.dark.backgroundImage===null){const h="background_dark";if(await this.restoreResourceFromStorage(h)){const w=this.resources.get(h);w&&(A.theme.skin.dark.backgroundImage=w.file,g.push(`Dark background: ${w.filename}`))}}try{const h=this.getFontInfo();if(h&&h.type==="custom"){const w=`converted_font_${h.filename}`,u=await this.configStorage.loadTempData(w);u&&(this.convertedFonts.set(h.filename,u.data),console.log(`Converted font data restored: ${h.filename}`))}}catch(h){console.warn("Error restoring converted font data:",h)}g.length>0&&console.log("Files restored from storage:",g)}getWakewordModelInfo(){if(!this.config||!this.config.chip||!this.config.theme)return null;const A=this.config.chip.model,g=this.config.theme.wakeword;return!g||g.type==="none"?null:g.type==="preset"?{type:A==="esp32c3"||A==="esp32c6"?"WakeNet9s":"WakeNet9",name:g.preset,filename:"srmodels.bin"}:g.type==="custom"?{type:"MultiNet",name:g.custom.model,filename:"srmodels.bin",custom:g.custom}:null}getFontInfo(){if(!this.config||!this.config.theme||!this.config.theme.font)return null;const A=this.config.theme.font;if(A.type==="preset")return{type:"preset",filename:`${A.preset}.bin`,source:A.preset};if(A.type==="custom"&&A.custom.file){const g=A.custom;return{type:"custom",filename:`font_custom_${g.size}_${g.bpp}.bin`,source:A.custom.file,config:{size:g.size,bpp:g.bpp,charset:g.charset}}}return null}getEmojiCollectionInfo(){if(!this.config||!this.config.theme||!this.config.theme.emoji)return[];const A=this.config.theme.emoji,g=[];if(A.type==="preset"){const t=["neutral","happy","laughing","funny","sad","angry","crying","loving","embarrassed","surprised","shocked","thinking","winking","cool","relaxed","delicious","kissy","confident","sleepy","silly","confused"],o={twemoji32:{size:32,format:"png"},twemoji64:{size:64,format:"png"},"noto-emoji_64":{size:64,format:"gif"},"noto-emoji_128":{size:128,format:"gif"}}[A.preset]||{size:64,format:"png"};t.forEach(i=>{g.push({name:i,file:`${i}.${o.format}`,source:`preset:${A.preset}`,size:{width:o.size,height:o.size}})})}else if(A.type==="custom"){A.custom.images;const t=A.custom.emotionMap||{},I=A.custom.fileMap||{},o=A.custom.size||{width:64,height:64};if(Object.keys(t).length===0||Object.keys(I).length===0)throw console.error("❌ Error: Detected old version of emoji data structure"),console.error("Please clear browser cache or reset configuration, then re-upload emoji images"),new Error("Incompatible emoji data structure: Missing fileMap or emotionMap. Please reconfigure emojis.");const i=new Map;Object.entries(t).forEach(([r,C])=>{const B=I[C];if(B){if(!i.has(C)){const Q=B.name?B.name.split(".").pop().toLowerCase():"png",a=`emoji_${C.substring(0,8)}.${Q}`;i.set(C,a)}const n=i.get(C);g.push({name:r,file:n,source:B,fileHash:C,size:{...o}})}}),console.log(`Emoji deduplication: ${Object.keys(t).length} emojis using ${i.size} different image files`),g.find(r=>r.name==="neutral")||console.warn("Warning: neutral emoji not provided, default image will be used")}return g}getSkinInfo(){if(!this.config||!this.config.theme||!this.config.theme.skin)return{};const A=this.config.theme.skin,g={};return A.light&&(g.light={text_color:A.light.textColor||"#000000",background_color:A.light.backgroundColor||"#ffffff"},A.light.backgroundType==="image"&&A.light.backgroundImage&&(g.light.background_image="background_light.raw")),A.dark&&(g.dark={text_color:A.dark.textColor||"#ffffff",background_color:A.dark.backgroundColor||"#121212"},A.dark.backgroundType==="image"&&A.dark.backgroundImage&&(g.dark.background_image="background_dark.raw")),g}generateIndexJson(){if(!this.config)throw new Error("Configuration object not set");const A={version:1,chip_model:this.config.chip.model,hide_subtitle:this.config.theme.font.hide_subtitle||!1,display_config:{width:this.config.chip.display.width,height:this.config.chip.display.height,monochrome:!1,color:this.config.chip.display.color||"RGB565"}},g=this.getWakewordModelInfo();if(g&&(A.srmodels=g.filename,g.type==="MultiNet"&&g.custom)){const i=g.custom;A.multinet_model={language:i.model.includes("_en")?"en":"cn",duration:i.duration||3e3,threshold:i.threshold/100,commands:[{command:i.command,text:i.name,action:"wake"}]}}const t=this.getFontInfo();t&&(A.text_font=t.filename);const I=this.getSkinInfo();Object.keys(I).length>0&&(A.skin=I);const o=this.getEmojiCollectionInfo();return o.length>0&&(A.emoji_collection=o.map(i=>({name:i.name,file:i.file}))),A}preparePackageResources(){var r,C,B,n;const A={files:[],indexJson:this.generateIndexJson(),config:{...this.config}},g=this.getWakewordModelInfo();g&&g.name&&A.files.push({type:"wakeword",name:g.name,filename:g.filename,modelType:g.type,isCustom:g.type==="MultiNet"});const t=this.getFontInfo();t&&A.files.push({type:"font",filename:t.filename,source:t.source,config:t.config||null});const I=this.getEmojiCollectionInfo(),o=new Set;I.forEach(Q=>{if(Q.fileHash){if(o.has(Q.fileHash)){console.log(`Skipping duplicate file: ${Q.name} -> ${Q.file} (hash: ${Q.fileHash.substring(0,8)})`);return}o.add(Q.fileHash)}A.files.push({type:"emoji",name:Q.name,filename:Q.file,source:Q.source,size:Q.size,fileHash:Q.fileHash})});const i=(C=(r=this.config)==null?void 0:r.theme)==null?void 0:C.skin;return((B=i==null?void 0:i.light)==null?void 0:B.backgroundType)==="image"&&i.light.backgroundImage&&A.files.push({type:"background",filename:"background_light.raw",source:i.light.backgroundImage,mode:"light"}),((n=i==null?void 0:i.dark)==null?void 0:n.backgroundType)==="image"&&i.dark.backgroundImage&&A.files.push({type:"background",filename:"background_dark.raw",source:i.dark.backgroundImage,mode:"dark"}),A}async preprocessCustomFonts(A=null){const g=this.getFontInfo();if(g&&g.type==="custom"&&!this.convertedFonts.has(g.filename)){A&&A(20,"Converting custom font...");try{const t={fontFile:g.source,fontName:g.filename.replace(/\.bin$/,""),fontSize:g.config.size,bpp:g.config.bpp,charset:g.config.charset,symbols:g.config.symbols||"",range:g.config.range||"",compression:!1,progressCallback:(o,i)=>{A&&A(20+o*.2,`Font conversion: ${i}`)}};let I;if(await this.fontConverterBrowser.initialize(),I=await this.fontConverterBrowser.convertToCBIN(t),this.convertedFonts.set(g.filename,I),this.autoSaveEnabled){const o=`converted_font_${g.filename}`;try{await this.configStorage.saveTempData(o,I,"converted_font",{filename:g.filename,size:g.config.size,bpp:g.config.bpp,charset:g.config.charset}),console.log(`Converted font saved to storage: ${g.filename}`)}catch(i){console.warn(`Failed to save converted font: ${g.filename}`,i)}}}catch(t){throw console.error("Font conversion failed:",t),new Error(`Font conversion failed: ${t.message}`)}}}async generateAssetsBin(A=null){if(!this.config)throw new Error("Configuration object not set");try{A&&A(0,"Starting generation..."),await this.preprocessCustomFonts(A),await new Promise(I=>setTimeout(I,100)),A&&A(40,"Preparing resource files...");const g=this.preparePackageResources();this.wakenetPacker.clear(),this.spiffsGenerator.clear(),await this.processResourceFiles(g,A),await new Promise(I=>setTimeout(I,100)),A&&A(90,"Generating final file..."),this.spiffsGenerator.printFileList();const t=await this.spiffsGenerator.generate((I,o)=>{A&&A(90+I*.1,o)});return A&&A(100,"Generation completed"),new Blob([t],{type:"application/octet-stream"})}catch(g){throw console.error("Failed to generate assets.bin:",g),g}}downloadAssetsBin(A,g="assets.bin"){const t=URL.createObjectURL(A),I=document.createElement("a");I.href=t,I.download=g,document.body.appendChild(I),I.click(),document.body.removeChild(I),URL.revokeObjectURL(t)}async getFontInfoWithDetails(A=null){var g,t,I,o;try{const i=A||((o=(I=(t=(g=this.config)==null?void 0:g.theme)==null?void 0:t.font)==null?void 0:I.custom)==null?void 0:o.file);if(!i)return null;let r;return await this.fontConverterBrowser.initialize(),r=await this.fontConverterBrowser.getFontInfo(i),{...r,file:i,isCustom:!0}}catch(i){return console.error("Failed to get font details:",i),null}}async estimateFontSize(A=null){var g,t,I;try{const o=A||((I=(t=(g=this.config)==null?void 0:g.theme)==null?void 0:t.font)==null?void 0:I.custom);if(!o)return null;const i={fontSize:o.size,bpp:o.bpp,charset:o.charset,symbols:o.symbols||"",range:o.range||""};let r;return r=this.fontConverterBrowser.estimateSize(i),r}catch(o){return console.error("Failed to estimate font size:",o),null}}validateCustomFont(A){const g=[],t=[];return A.file?this.fontConverterBrowser.validateFont(A.file)||g.push("Font file format not supported"):g.push("Missing font file"),(A.size<8||A.size>80)&&g.push("Font size must be between 8-80"),[1,2,4,8].includes(A.bpp)||g.push("BPP must be 1, 2, 4 or 8"),!A.charset&&!A.symbols&&!A.range&&t.push("No charset, symbols or range specified, default charset will be used"),{valid:g.length===0,errors:g,warnings:t}}getConverterStatus(){return{initialized:this.fontConverterBrowser.initialized,supportedFormats:this.fontConverterBrowser.supportedFormats}}async processResourceFiles(A,g=null){let t=0;const I=A.files.length,o=new TextEncoder().encode(JSON.stringify(A.indexJson,null,2));console.log("index.json",A.indexJson),this.spiffsGenerator.addFile("index.json",o.buffer);for(const i of A.files){const r=40+t/I*40;g&&g(r,`Processing file: ${i.filename}`);try{await this.processResourceFile(i),t++}catch(C){throw console.error(`Failed to process resource file: ${i.filename}`,C),new Error(`Failed to process resource file: ${i.filename} - ${C.message}`)}}}async processResourceFile(A){switch(A.type){case"wakeword":await this.processWakewordModel(A);break;case"font":await this.processFontFile(A);break;case"emoji":await this.processEmojiFile(A);break;case"background":await this.processBackgroundFile(A);break;default:console.warn(`Unknown resource type: ${A.type}`)}}async processWakewordModel(A){if(!await this.wakenetPacker.loadModelFromShare(A.name))throw new Error(`Failed to load wakeword model: ${A.name}`);const t=this.wakenetPacker.packModels();this.spiffsGenerator.addFile(A.filename,t)}async processFontFile(A){if(A.config){const g=this.convertedFonts.get(A.filename);if(g)this.spiffsGenerator.addFile(A.filename,g);else throw new Error(`Converted font not found: ${A.filename}`)}else{const g=await this.loadPresetFont(A.source);this.spiffsGenerator.addFile(A.filename,g)}}async processEmojiFile(A){var i,r;let g,t=!1,I="png",o=!1;if(typeof A.source=="string"&&A.source.startsWith("preset:")){const C=A.source.replace("preset:","");g=await this.loadPresetEmoji(C,A.name)}else{const C=A.source;o=this.isGifFile(C),I=C.name.split(".").pop().toLowerCase();try{const n=await this.getImageDimensions(C),Q=A.size||{width:64,height:64};(n.width>Q.width||n.height>Q.height)&&(t=!0,console.log(`Emoji ${A.name} needs scaling: ${n.width}x${n.height} -> ${Q.width}x${Q.height}`))}catch(n){console.warn(`Failed to get emoji image dimensions: ${A.name}`,n)}t||(g=await this.fileToArrayBuffer(C))}if(t)try{const C=A.size||{width:64,height:64};if(o){console.log(`Using WasmGifScaler to process GIF emoji: ${A.name}`);const B=await this.gifScaler.scaleGif(A.source,{maxWidth:C.width,maxHeight:C.height,keepAspectRatio:!0,lossy:30});g=await this.fileToArrayBuffer(B)}else g=await this.scaleImageToFit(A.source,C,I)}catch(C){console.error(`Failed to scale emoji image: ${A.name}`,C),g=await this.fileToArrayBuffer(A.source)}this.spiffsGenerator.addFile(A.filename,g,{width:((i=A.size)==null?void 0:i.width)||0,height:((r=A.size)==null?void 0:r.height)||0}),A.fileHash&&console.log(`Emoji file added: ${A.filename} (hash: ${A.fileHash.substring(0,8)})`)}async processBackgroundFile(A){const g=await this.fileToArrayBuffer(A.source),t=await this.convertImageToRgb565(g);this.spiffsGenerator.addFile(A.filename,t)}async loadPresetFont(A){try{const g=await fetch(`./static/fonts/${A}.bin`);if(!g.ok)throw new Error(`HTTP ${g.status}`);return await g.arrayBuffer()}catch(g){throw new Error(`Failed to load preset font: ${A} - ${g.message}`)}}async loadPresetEmoji(A,g){try{const I={twemoji32:"png",twemoji64:"png","noto-emoji_64":"gif","noto-emoji_128":"gif"}[A]||"png",o=await fetch(`./static/emojis/${A}/${g}.${I}`);if(!o.ok)throw new Error(`HTTP ${o.status}`);return await o.arrayBuffer()}catch(t){throw new Error(`Failed to load preset emoji: ${A}/${g} - ${t.message}`)}}fileToArrayBuffer(A){return new Promise((g,t)=>{const I=new FileReader;I.onload=()=>g(I.result),I.onerror=()=>t(new Error("Failed to read file")),I.readAsArrayBuffer(A)})}async scaleImageToFit(A,g,t="png"){return new Promise((I,o)=>{const i=A instanceof File?A:new Blob([A]),r=URL.createObjectURL(i),C=new Image;C.onload=()=>{try{const B=document.createElement("canvas"),n=B.getContext("2d");B.width=g.width,B.height=g.height;const Q=C.width/C.height,a=g.width/g.height;let E,h,w,u;Q>a?(E=g.width,h=g.width/Q,w=0,u=(g.height-h)/2):(h=g.height,E=g.height*Q,w=(g.width-E)/2,u=0),t==="png"?n.clearRect(0,0,B.width,B.height):(n.fillStyle="#FFFFFF",n.fillRect(0,0,B.width,B.height)),n.drawImage(C,w,u,E,h),B.toBlob(l=>{const f=new FileReader;f.onload=()=>I(f.result),f.onerror=()=>o(new Error("Failed to convert image data")),f.readAsArrayBuffer(l)},`image/${t}`),URL.revokeObjectURL(r)}catch(B){URL.revokeObjectURL(r),o(B)}},C.onerror=()=>{URL.revokeObjectURL(r),o(new Error("Unable to load image"))},C.src=r})}isGifFile(A){return A.type==="image/gif"?!0:A.name.split(".").pop().toLowerCase()==="gif"}async getImageDimensions(A){return new Promise((g,t)=>{const I=A instanceof File?A:new Blob([A]),o=URL.createObjectURL(I),i=new Image;i.onload=()=>{URL.revokeObjectURL(o),g({width:i.width,height:i.height})},i.onerror=()=>{URL.revokeObjectURL(o),t(new Error("Unable to get image dimensions"))},i.src=o})}async convertImageToRgb565(A){return new Promise((g,t)=>{const I=new Blob([A]),o=URL.createObjectURL(I),i=new Image;i.onload=()=>{var r,C,B,n,Q,a;try{const E=document.createElement("canvas"),h=E.getContext("2d",{willReadFrequently:!0});E.width=((B=(C=(r=this.config)==null?void 0:r.chip)==null?void 0:C.display)==null?void 0:B.width)||320,E.height=((a=(Q=(n=this.config)==null?void 0:n.chip)==null?void 0:Q.display)==null?void 0:a.height)||240;const w=i.width/i.height,u=E.width/E.height;let l,f,c,D;w>u?(f=E.height,l=E.height*w,c=(E.width-l)/2,D=0):(l=E.width,f=E.width/w,c=0,D=(E.height-f)/2),h.drawImage(i,c,D,l,f);const v=h.getImageData(0,0,E.width,E.height).data,N=new ArrayBuffer(E.width*E.height*2),L=new Uint16Array(N);for(let _=0;_>3,b=v[_+1]>>2,H=v[_+2]>>3;L[_/4]=iA<<11|b<<5|H}const X=25,k=18,m=E.width*2,M=28,oA=M+N.byteLength,F=new ArrayBuffer(oA),S=new Uint8Array(F),J=new DataView(F);let V=0;const q=0|k<<8|X;J.setUint32(V,q,!0),V+=4;const $=E.height<<16|E.width;J.setUint32(V,$,!0),V+=4;const AA=0|m;J.setUint32(V,AA,!0),V+=4,J.setUint32(V,N.byteLength,!0),V+=4,J.setUint32(V,M,!0),V+=4,J.setUint32(V,0,!0),V+=4,J.setUint32(V,0,!0),V+=4,S.set(new Uint8Array(N),M),URL.revokeObjectURL(o),g(F)}catch(E){URL.revokeObjectURL(o),t(E)}},i.onerror=()=>{URL.revokeObjectURL(o),t(new Error("Unable to load image"))},i.src=o})}cleanup(){this.resources.clear(),this.tempFiles=[],this.convertedFonts.clear(),this.wakenetPacker.clear(),this.spiffsGenerator.clear(),this.gifScaler.dispose()}async clearAllStoredData(){try{await this.configStorage.clearAll(),this.cleanup(),console.log("All stored data cleared")}catch(A){throw console.error("Failed to clear stored data:",A),A}}async getStorageStatus(){try{const A=await this.configStorage.getStorageInfo();return{hasStoredData:await this.configStorage.hasStoredConfig(),storageInfo:A,autoSaveEnabled:this.autoSaveEnabled}}catch(A){return console.error("Failed to get storage status:",A),{hasStoredData:!1,storageInfo:null,autoSaveEnabled:this.autoSaveEnabled}}}setAutoSave(A){this.autoSaveEnabled=A,console.log(`Auto-save ${A?"enabled":"disabled"}`)}getResourceSummary(){const A=[],g=this.preparePackageResources(),t={wakeword:0,font:0,emoji:0,background:0};return g.files.forEach(I=>{t[I.type]=(t[I.type]||0)+1;let o="";switch(I.type){case"wakeword":o=`Wakeword model: ${I.name} (${I.modelType})`;break;case"font":I.config?o=`Custom font: size ${I.config.size}px, BPP ${I.config.bpp}`:o=`Preset font: ${I.source}`;break;case"emoji":o=`Emoji: ${I.name} (${I.size.width}x${I.size.height})`;break;case"background":o=`${I.mode==="light"?"Light":"Dark"} mode background`;break}A.push({type:I.type,filename:I.filename,description:o})}),{files:A,counts:t,totalFiles:A.length,indexJson:g.indexJson}}}const QE={class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4"},EE={class:"bg-white rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] overflow-hidden"},lE={class:"flex items-center justify-between p-6 border-b border-gray-200"},cE={class:"text-lg font-medium text-gray-900"},hE={key:1,class:"text-sm text-orange-600 font-medium"},uE={class:"p-6 overflow-y-auto",style:{"max-height":"calc(90vh - 140px)"}},dE={key:0,class:"space-y-6"},fE={class:"font-medium text-gray-900 mb-3"},wE={class:"bg-gray-50 rounded-lg p-4 space-y-2 text-sm"},yE={class:"flex justify-between"},pE={class:"text-gray-600"},DE={class:"font-medium"},mE={class:"flex justify-between"},FE={class:"text-gray-600"},kE={class:"font-medium"},vE={class:"flex justify-between"},SE={class:"text-gray-600"},GE={class:"font-medium"},RE={class:"flex justify-between"},UE={class:"text-gray-600"},NE={class:"font-medium"},bE={class:"flex justify-between"},LE={class:"text-gray-600"},ME={class:"font-medium"},JE={class:"font-medium text-gray-900 mb-3"},xE={class:"space-y-2 max-h-64 overflow-y-auto"},HE={class:"flex items-center"},YE={class:"text-sm font-medium text-gray-900"},KE={class:"text-sm text-gray-700"},TE={key:0,class:"text-xs text-gray-500 ml-1"},VE={key:1,class:"text-xs text-gray-500 ml-1"},qE={key:1,class:"space-y-6 text-center"},OE={class:"space-y-4"},WE={class:"text-gray-600 mt-2"},PE={class:"bg-gray-200 rounded-full h-2 overflow-hidden"},ZE={class:"text-sm text-gray-600"},XE={class:"mt-1"},jE={class:"space-y-2 text-left"},zE={class:"flex-shrink-0 mr-3"},_E={key:0,class:"w-5 h-5 bg-green-500 rounded-full flex items-center justify-center"},$E={key:1,class:"w-5 h-5 bg-primary-500 rounded-full animate-pulse"},Al={key:2,class:"w-5 h-5 bg-gray-300 rounded-full"},el={key:2,class:"text-center space-y-6"},gl={class:"text-gray-600 mt-2"},tl={class:"bg-green-50 border border-green-200 rounded-lg p-4"},Il={class:"text-sm text-green-800 space-y-1"},ol={class:"space-y-3"},il=["disabled"],rl={key:3,class:"space-y-6 text-center"},Cl={class:"space-y-4"},nl={class:"text-gray-600"},Bl={class:"bg-gray-200 rounded-full h-2 overflow-hidden"},sl={class:"text-sm text-gray-600"},al={class:"mt-1"},Ql={key:4,class:"text-center mt-4"},El={class:"text-sm text-red-600"},ll={class:"flex justify-end space-x-3 p-6 border-t border-gray-200"},cl=["disabled"],hl={__name:"GenerateModal",props:{config:{type:Object,required:!0}},emits:["close","generate","startFlash","cancelFlash"],setup(e,{emit:A}){const{t:g}=TA(),t=e,I=A,{deviceInfo:o}=ig(),i=j(!1),r=j(!1),C=j(0),B=j(""),n=j(""),Q=j(""),a=j(null),E=j(null),h=j(!1),w=j(!1),u=j(0),l=j(""),f=j(""),c=nA(()=>[{id:1,name:g("progressSteps.init"),status:"pending"},{id:2,name:g("progressSteps.font"),status:"pending"},{id:3,name:g("progressSteps.wakeword"),status:"pending"},{id:4,name:g("progressSteps.emoji"),status:"pending"},{id:5,name:g("progressSteps.background"),status:"pending"},{id:6,name:g("progressSteps.index"),status:"pending"},{id:7,name:g("progressSteps.spiffs"),status:"pending"},{id:8,name:g("progressSteps.package"),status:"pending"}]),D=j([]),y=we({render:()=>eA("svg",{fill:"currentColor",viewBox:"0 0 20 20"},[eA("path",{d:"M4 3a2 2 0 00-2 2v1a1 1 0 001 1h14a1 1 0 001-1V5a2 2 0 00-2-2H4zM3 8a1 1 0 011-1h12a1 1 0 011 1v5a2 2 0 01-2 2H5a2 2 0 01-2-2V8z"})])}),v=we({render:()=>eA("svg",{fill:"currentColor",viewBox:"0 0 20 20"},[eA("path",{"fill-rule":"evenodd",d:"M7 4a3 3 0 016 0v4a3 3 0 11-6 0V4zm4 10.93A7.001 7.001 0 0017 8a1 1 0 10-2 0A5 5 0 015 8a1 1 0 00-2 0 7.001 7.001 0 006 6.93V17H6a1 1 0 100 2h8a1 1 0 100-2h-3v-2.07z","clip-rule":"evenodd"})])}),N=we({render:()=>eA("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[eA("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 4l8 16m-6-6h4"})])}),L=we({render:()=>eA("svg",{fill:"currentColor",viewBox:"0 0 20 20"},[eA("path",{"fill-rule":"evenodd",d:"M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z","clip-rule":"evenodd"})])}),X=nA(()=>D.value.length>0),k={wn9s_hilexin:"generateModal.wakewordNames.wn9s_hilexin",wn9s_hiesp:"generateModal.wakewordNames.wn9s_hiesp",wn9s_nihaoxiaozhi:"generateModal.wakewordNames.wn9s_nihaoxiaozhi",wn9s_hijason:"Hi, Jason",wn9s_alexa:"Alexa",wn9_hilexin:"Hi, Espressif",wn9_hiesp:"Hi, ESP",wn9_nihaoxiaozhi_tts:"generateModal.wakewordNames.wn9_nihaoxiaozhi_tts",wn9_hijason_tts2:"Hi, Jason",wn9_himfive:"Hi, M Five",wn9_alexa:"generateModal.wakewordNames.wn9_alexa",wn9_jarvis_tts:"Jarvis",wn9_computer_tts:"Computer",wn9_heywillow_tts:"Hey, Willow",wn9_sophia_tts:"Sophia",wn9_heyprinter_tts:"Hey, Printer",wn9_hijoy_tts:"Hi, Joy",wn9_heywanda_tts:"Hey, Wand",wn9_astrolabe_tts:"Astrolabe",wn9_heyily_tts2:"Hey, Ily",wn9_hijolly_tts2:"Hi, Jolly",wn9_hifairy_tts2:"Hi, Fairy",wn9_bluechip_tts2:"Blue Chip",wn9_hiandy_tts2:"Hi, Andy",wn9_heyivy_tts2:"Hey, Ivy",wn9_histackchan_tts3:"Hi, Stack Chan",wn9_hiwalle_tts2:"Hi, Wall E",wn9_hilili_tts:"Hi, Lily",wn9_hitelly_tts:"Hi, Telly",wn9_linaiban_tts2:"Lina Board"},m=b=>{const H=k[b];return H!=null&&H.startsWith("generateModal.")?g(H):H||b},M=()=>{const b=t.config.theme.wakeword;return!b||b.type==="none"?g("wakewordConfig.noWakeword"):b.type==="preset"?m(b.preset):b.type==="custom"?b.custom.name||g("wakewordConfig.customWakeword"):g("wakewordConfig.noWakeword")},oA=()=>t.config.theme.font.type==="preset"?t.config.theme.font.preset.replace("font_","").replace("_"," "):g("generateModal.customFont"),F=()=>t.config.theme.emoji.type==="preset"&&t.config.theme.emoji.preset?{twemoji32:"Twemoji 32×32",twemoji64:"Twemoji 64×64","noto-emoji_64":"Noto Emoji 64×64","noto-emoji_128":"Noto Emoji 128×128"}[t.config.theme.emoji.preset]||t.config.theme.emoji.preset:t.config.theme.emoji.type==="custom"?g("generateModal.customEmoji"):t.config.theme.emoji.type==="none"?g("emojiConfig.noEmojiPack"):g("generateModal.notConfigured"),S=()=>{D.value=[],D.value.push({id:"index",name:"index.json",description:"Configuration index file",icon:y,iconColor:"text-blue-500",size:"1KB"});const b=t.config.theme.wakeword;if(b&&b.type!=="none"&&D.value.push({id:"srmodels",name:"srmodels.bin",description:b.type==="custom"?"Custom command model":"Preset wake word model",icon:v,iconColor:"text-green-500",size:b.type==="custom"?"~1.2MB":"~300KB"}),t.config.theme.font.type==="preset"){const H={font_puhui_deepseek_14_1:"180KB",font_puhui_deepseek_16_4:"720KB",font_puhui_deepseek_20_4:"1.1MB",font_puhui_deepseek_30_4:"2.5MB"};D.value.push({id:"font",name:`${t.config.theme.font.preset}.bin`,description:"Preset font file",icon:N,iconColor:"text-yellow-500",size:H[t.config.theme.font.preset]||"500KB"})}else if(t.config.theme.font.custom.file){const H=t.config.theme.font.custom,Z=Math.max(100,H.size*H.size*H.bpp*.7);D.value.push({id:"font",name:`font_custom_${H.size}_${H.bpp}.bin`,description:"Custom font file",icon:N,iconColor:"text-yellow-500",size:Z>1024?`${(Z/1024).toFixed(1)}MB`:`${Math.round(Z)}KB`,estimated:!0})}if(t.config.theme.emoji.type==="preset"&&t.config.theme.emoji.preset){const H=["neutral","happy","laughing","funny","sad","angry","crying","loving","embarrassed","surprised","shocked","thinking","winking","cool","relaxed","delicious","kissy","confident","sleepy","silly","confused"],Z=t.config.theme.emoji.preset==="twemoji64"?"3KB":"1KB";H.forEach(IA=>{D.value.push({id:`emoji_${IA}`,name:`${IA}.png`,description:`${IA} emoji image`,icon:L,iconColor:"text-pink-500",size:Z})})}else if(t.config.theme.emoji.type==="custom"){const H=t.config.theme.emoji.custom,Z=H.emotionMap||{},IA=H.fileMap||{};if(H.images,Object.keys(Z).length===0||Object.keys(IA).length===0){console.error(g("errors.incompatibleEmojiData"));return}const z=new Map,lA=new Map;Object.entries(Z).forEach(([wA,yA])=>{const JA=IA[yA];if(JA){if(!z.has(yA)){const ee=Math.round(JA.size/1024);z.set(yA,{file:JA,size:ee>1024?`${(ee/1024).toFixed(1)}MB`:`${ee}KB`,emotions:[]})}z.get(yA).emotions.push(wA),lA.set(wA,yA)}}),z.forEach((wA,yA)=>{const JA=wA.emotions.join(", "),ee=wA.emotions.length>1;D.value.push({id:`emoji_${yA.substring(0,8)}`,name:`emoji_${yA.substring(0,8)}.${wA.file.name.split(".").pop()}`,description:ee?`Shared emoji images (${JA})`:`${JA} emoji image`,icon:L,iconColor:ee?"text-purple-500":"text-pink-500",size:wA.size,isCustomEmoji:!0})}),z.size1024?`${(IA/1024).toFixed(1)}MB`:`${IA}KB`,estimated:!0})}if(t.config.theme.skin.dark.backgroundType==="image"&&t.config.theme.skin.dark.backgroundImage){const{width:H,height:Z}=t.config.chip.display,IA=Math.round(H*Z*2/1024);D.value.push({id:"bg_dark",name:"background_dark.raw",description:"Dark mode background image",icon:L,iconColor:"text-indigo-500",size:IA>1024?`${(IA/1024).toFixed(1)}MB`:`${IA}KB`,estimated:!0})}},J=b=>{if(b===0)return"0 B";const H=1024,Z=["B","KB","MB","GB"],IA=Math.floor(Math.log(b)/Math.log(H));return`${parseFloat((b/Math.pow(H,IA)).toFixed(2))} ${Z[IA]}`},V=b=>{if(b<1e3)return`${b}ms`;if(b<6e4)return`${(b/1e3).toFixed(1)}s`;{const H=Math.floor(b/6e4),Z=Math.floor(b%6e4/1e3);return`${H}m ${Z}s`}},q=async()=>{i.value=!0,C.value=0,E.value=Date.now();try{const b=new sI;b.setConfig(t.config);const H=await b.generateAssetsBin((z,lA)=>{C.value=parseInt(z),B.value=lA;const wA=Math.floor(z/(100/c.value.length));c.value.forEach((yA,JA)=>{JA{z.status="completed"}),I("generate",D.value.map(z=>({id:z.id,name:z.name})))}catch(b){console.error("Failed to generate assets.bin:",b),i.value=!1,r.value=!1,alert(g("errors.generationFailed",{error:b.message}))}},$=()=>{if(a.value){const b=URL.createObjectURL(a.value),H=document.createElement("a");H.href=b,H.download="assets.bin",H.style.display="none",document.body.appendChild(H),H.click(),document.body.removeChild(H),URL.revokeObjectURL(b)}else console.error(g("errors.noFileToDownload"))},AA=async()=>{try{const H=new URLSearchParams(window.location.search).get("token");if(!H){h.value=!1;return}const Z=await fetch("/api/messaging/device/tools/list",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${H}`}});h.value=Z.ok}catch(b){console.error(g("flashProgress.unableToGetDeviceStatus"),b),h.value=!1}},_=async()=>{if(!a.value){alert(g("errors.noFileToDownload"));return}if(!h.value){alert(g("errors.deviceOffline"));return}if(o.value.assetsPartition&&o.value.assetsPartition.size){const b=o.value.assetsPartition.size,H=a.value.size;if(H>b){const Z=(H/1024/1024).toFixed(2),IA=(b/1024/1024).toFixed(2);alert(g("errors.fileTooLarge",{fileSize:Z,partitionSize:IA}));return}}w.value=!0,u.value=0,l.value=g("flashProgress.startingFileTransfer"),f.value="";try{I("startFlash",{blob:a.value,onProgress:(b,H)=>{u.value=b,l.value=H},onComplete:()=>{w.value=!1,u.value=100,l.value=g("flashProgress.flashCompleted")},onError:b=>{w.value=!1,f.value=b,console.error(g("flashProgress.onlineFlashFailed",{error:b}))}})}catch(b){w.value=!1,f.value=g("flashProgress.onlineFlashFailed",{error:b.message}),console.error(g("flashProgress.onlineFlashFailed",{error:b}))}},iA=()=>{confirm(g("errors.flashCancelConfirm"))&&(w.value=!1,u.value=0,l.value="",f.value="",I("cancelFlash"))};return Me(async()=>{S(),await AA()}),(b,H)=>(G(),U("div",QE,[s("div",EE,[s("div",lE,[s("h3",cE,d(b.$t("generateModal.title")),1),w.value?(G(),U("div",hE,d(b.$t("generateModal.flashingInProgress")),1)):(G(),U("button",{key:0,onClick:H[0]||(H[0]=Z=>b.$emit("close")),class:"text-gray-400 hover:text-gray-500"},[...H[3]||(H[3]=[s("svg",{class:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])]))]),s("div",uE,[!i.value&&!r.value?(G(),U("div",dE,[s("div",null,[s("h4",fE,d(b.$t("generateModal.confirmConfig")),1),s("div",wE,[s("div",yE,[s("span",pE,d(b.$t("generateModal.chipModel")),1),s("span",DE,d(e.config.chip.model.toUpperCase()),1)]),s("div",mE,[s("span",FE,d(b.$t("generateModal.resolution")),1),s("span",kE,d(e.config.chip.display.width)+"×"+d(e.config.chip.display.height),1)]),s("div",vE,[s("span",SE,d(b.$t("generateModal.wakeword")),1),s("span",GE,d(M()),1)]),s("div",RE,[s("span",UE,d(b.$t("generateModal.font")),1),s("span",NE,d(oA()),1)]),s("div",bE,[s("span",LE,d(b.$t("generateModal.emoji")),1),s("span",ME,d(F()),1)])])]),s("div",null,[s("h4",JE,d(b.$t("generateModal.fileList")),1),s("div",xE,[(G(!0),U(bA,null,LA(D.value,Z=>(G(),U("div",{key:Z.id,class:"flex items-center justify-between px-3 py-2 border border-gray-200 rounded bg-gray-50"},[s("div",HE,[(G(),UA(Bt(Z.icon),{class:gA(["w-4 h-4 mr-2",Z.iconColor])},null,8,["class"])),s("span",YE,d(Z.name),1)]),s("div",KE,[HA(d(Z.size)+" ",1),Z.estimated?(G(),U("span",TE,d(b.$t("generateModal.estimated")),1)):O("",!0),Z.isCustomEmoji?(G(),U("span",VE,d(b.$t("generateModal.compressed")),1)):O("",!0)])]))),128))])])])):O("",!0),i.value?(G(),U("div",qE,[H[5]||(H[5]=s("div",{class:"flex items-center justify-center"},[s("div",{class:"animate-spin rounded-full h-16 w-16 border-b-2 border-primary-500"})],-1)),s("div",OE,[s("p",WE,d(b.$t("generateModal.generating")),1),s("div",PE,[s("div",{class:"bg-primary-500 h-2 rounded-full transition-all duration-500 ease-out",style:CA({width:C.value+"%"})},null,4)]),s("div",ZE,[s("div",null,d(B.value),1),s("div",XE,d(b.$t("generateModal.progress",{progress:C.value})),1)])]),s("div",jE,[(G(!0),U(bA,null,LA(c.value,Z=>(G(),U("div",{key:Z.id,class:"flex items-center text-sm"},[s("div",zE,[Z.status==="completed"?(G(),U("div",_E,[...H[4]||(H[4]=[s("svg",{class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},[s("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})],-1)])])):Z.status==="processing"?(G(),U("div",$E)):(G(),U("div",Al))]),s("span",{class:gA([Z.status==="completed"?"text-green-700":Z.status==="processing"?"text-primary-700":"text-gray-500"])},d(Z.name),3)]))),128))])])):O("",!0),r.value&&!w.value?(G(),U("div",el,[H[8]||(H[8]=s("div",{class:"mx-auto flex items-center justify-center"},[s("svg",{class:"w-20 h-20 text-green-600",fill:"currentColor",viewBox:"0 0 20 20"},[s("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})])],-1)),s("div",null,[s("p",gl,d(b.$t("generateModal.completed")),1)]),s("div",tl,[s("div",Il,[s("div",null,d(b.$t("generateModal.filename")),1),s("div",null,d(b.$t("generateModal.fileSize",{size:n.value})),1),s("div",null,d(b.$t("generateModal.generationTime",{time:Q.value})),1)])]),s("div",ol,[s("button",{onClick:$,class:"w-full bg-gray-100 hover:bg-gray-200 text-gray-700 px-6 py-3 rounded-lg font-medium transition-colors flex items-center justify-center"},[H[6]||(H[6]=s("svg",{class:"w-5 h-5 mr-2",fill:"currentColor",viewBox:"0 0 20 20"},[s("path",{"fill-rule":"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)),HA(" "+d(b.$t("generateModal.downloadAssets")),1)]),s("button",{onClick:_,disabled:!h.value,class:"w-full bg-blue-500 hover:bg-blue-600 disabled:bg-gray-300 text-white px-6 py-3 rounded-lg font-medium transition-colors flex items-center justify-center"},[H[7]||(H[7]=s("svg",{class:"w-5 h-5 mr-2",fill:"currentColor",viewBox:"0 0 20 20"},[s("path",{"fill-rule":"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)),HA(" "+d(b.$t("generateModal.flashToDevice")),1)],8,il)])])):O("",!0),w.value&&!f.value?(G(),U("div",rl,[H[9]||(H[9]=s("div",{class:"flex items-center justify-center"},[s("div",{class:"animate-spin rounded-full h-16 w-16 border-b-2 border-blue-500"})],-1)),s("div",Cl,[s("p",nl,d(b.$t("generateModal.flashing")),1),s("div",Bl,[s("div",{class:"bg-blue-500 h-2 rounded-full transition-all duration-500 ease-out",style:CA({width:u.value+"%"})},null,4)]),s("div",sl,[s("div",null,d(l.value),1),s("div",al,d(b.$t("generateModal.progress",{progress:u.value})),1)])]),s("button",{onClick:iA,class:"px-4 py-2 text-sm font-medium text-red-600 bg-red-50 hover:bg-red-100 rounded-md transition-colors"},d(b.$t("generateModal.flashingCancel")),1)])):O("",!0),f.value?(G(),U("div",Ql,[s("p",El,d(f.value),1)])):O("",!0)]),s("div",ll,[!i.value&&!r.value?(G(),U("button",{key:0,onClick:H[1]||(H[1]=Z=>b.$emit("close")),class:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-md transition-colors"},d(b.$t("common.cancel")),1)):O("",!0),!i.value&&!r.value?(G(),U("button",{key:1,onClick:q,disabled:!X.value,class:"px-6 py-2 text-sm font-medium text-white bg-primary-500 hover:bg-primary-600 disabled:bg-gray-300 rounded-md transition-colors"},d(b.$t("common.start"))+" "+d(b.$t("common.generate")),9,cl)):O("",!0),r.value&&!w.value?(G(),U("button",{key:2,onClick:H[2]||(H[2]=Z=>b.$emit("close")),class:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-md transition-colors"},d(b.$t("common.close")),1)):O("",!0)])])]))}};class ul{constructor(A){this.token=A,this.ws=null,this.isConnected=!1,this.isCancelled=!1,this.chunkSize=64*1024,this.onProgress=null,this.onError=null,this.onComplete=null,this.onDownloadUrlReady=null,this.onTransferStarted=null,this.currentSession=null,this.totalBytesSent=0,this.isSendingChunk=!1}async connect(){return new Promise((A,g)=>{try{const t=`wss://api.tenclass.net/transfer/?token=${encodeURIComponent(this.token)}`;this.ws=new WebSocket(t),this.ws.onopen=()=>{this.isConnected=!0,console.log("WebSocket connected to transfer server"),A()},this.ws.onmessage=I=>{this.handleMessage(I)},this.ws.onerror=I=>{console.error("WebSocket error:",I),this.isConnected=!1,g(new Error("WebSocket connection failed"))},this.ws.onclose=I=>{console.log("WebSocket closed:",I.code,I.reason),this.isConnected=!1},setTimeout(()=>{this.isConnected||(this.ws.close(),g(new Error("WebSocket connection timeout")))},1e4)}catch(t){g(new Error(`Failed to create WebSocket connection: ${t.message}`))}})}handleMessage(A){try{if(typeof A.data=="string"){const g=JSON.parse(A.data);switch(g.type){case"file_created":this.currentSession&&(this.currentSession.url=g.url,this.onDownloadUrlReady&&this.onDownloadUrlReady(g.url));break;case"transfer_started":this.currentSession&&(this.currentSession.transferStarted=!0,this.onTransferStarted&&this.onTransferStarted(),this.currentSession.transferReady&&this.sendFileData());break;case"ack":if(this.currentSession){const{blob:t}=this.currentSession,I=t.size,o=g.bytesSent;if(o<0){console.error("Invalid server bytesSent (negative):",o),this.isSendingChunk=!1,this.onError&&this.onError(new Error("Server returned invalid byte count"));return}if(o>I){console.error(`Server bytesSent (${o}) exceeds fileSize (${I})`),this.isSendingChunk=!1,this.onError&&this.onError(new Error("Server byte count exceeds file size"));return}this.isSendingChunk=!1,o>this.currentSession.bytesSent&&(this.currentSession.bytesSent=o),this.sendFileData()}break;case"transfer_completed":if(this.currentSession){const t=this.currentSession.blob.size;this.totalBytesSent!==t&&console.warn(`Transfer size mismatch: sent ${this.totalBytesSent} bytes, expected ${t} bytes`)}this.onComplete&&this.onComplete();break;case"error":console.error("Transfer error:",g.message),this.onError&&this.onError(new Error(g.message));break}}}catch(g){console.error("Error handling message:",g),this.onError&&this.onError(g)}}async sendFileData(){if(this.isSendingChunk||!this.currentSession||this.isCancelled)return;const{blob:A}=this.currentSession,g=A.size;let t=this.currentSession.bytesSent;if(t>=g){this.onProgress&&this.onProgress(100,"Transfer completed, waiting for device confirmation...");return}if(this.isSendingChunk=!0,t>g){console.error(`Critical error: bytesSent (${t}) exceeds fileSize (${g})`),this.onError&&this.onError(new Error("Transfer byte count exceeds file size"));return}const I=Math.max(0,g-t),o=Math.min(this.chunkSize,I);if(o<=0)return;const i=A.slice(t,t+o);try{const r=await new Promise((Q,a)=>{const E=new FileReader;E.onload=()=>Q(E.result),E.onerror=()=>a(new Error("File read failed")),E.readAsArrayBuffer(i)});if(this.isCancelled)return;this.ws.send(r);const C=t+o;if(this.currentSession.bytesSent=C,this.totalBytesSent+=o,C>g){console.error(`Critical error: bytesSent (${C}) exceeds fileSize (${g})`),this.onError&&this.onError(new Error("Transfer byte count exceeds file size"));return}if(this.totalBytesSent>g){console.error(`Critical error: totalBytesSent (${this.totalBytesSent}) exceeds fileSize (${g})`),this.onError&&this.onError(new Error("Total sent bytes exceed file size"));return}const B=Math.round(C/g*60)+40,n=`Transferring... ${Math.round(C/1024)}KB / ${Math.round(g/1024)}KB`;this.onProgress&&this.onProgress(B,n)}catch(r){console.error("Error sending file chunk:",r),this.isSendingChunk=!1,this.onError&&this.onError(r)}}async initializeSession(A,g,t,I){return new Promise((o,i)=>{this.onProgress=g,this.onError=r=>{t&&t(r),i(r)},this.onDownloadUrlReady=r=>{I&&I(r),o(r)},this.isCancelled=!1;try{this.onProgress&&this.onProgress(5,"Connecting to transfer server..."),this.connect().then(()=>{this.onProgress&&this.onProgress(10,"Creating file session...");const r={type:"create_file",fileName:"assets.bin",fileSize:A.size};this.ws.send(JSON.stringify(r)),this.currentSession={blob:A,bytesSent:0,fileSize:A.size,transferStarted:!1,transferReady:!0},this.totalBytesSent=0}).catch(r=>{console.error("Transfer initialization failed:",r),this.onError&&this.onError(r)})}catch(r){console.error("Transfer initialization failed:",r),this.onError&&this.onError(r)}})}async startTransfer(A,g,t){return new Promise((I,o)=>{if(this.onProgress=A,this.onError=i=>{this.isSendingChunk=!1,g&&g(i),o(i)},this.onComplete=()=>{this.isSendingChunk=!1,t&&t(),I()},!this.currentSession||!this.currentSession.blob){const i=new Error("Transfer session not initialized");this.onError&&this.onError(i),o(i);return}this.currentSession.transferReady=!0,this.currentSession.transferStarted&&this.sendFileData()})}async transferFile(A,g,t,I,o){if(o){await this.initializeSession(A,g,t,o);return}this.onProgress=g,this.onError=t,this.onComplete=I,this.isCancelled=!1;try{this.onProgress&&this.onProgress(5,"Connecting to transfer server..."),await this.connect(),this.onProgress&&this.onProgress(10,"Creating file session...");const i={type:"create_file",fileName:"assets.bin",fileSize:A.size};this.ws.send(JSON.stringify(i)),this.currentSession={blob:A,bytesSent:0,fileSize:A.size,transferStarted:!1,transferReady:!0}}catch(i){console.error("Transfer initialization failed:",i),this.onError&&this.onError(i)}}cancel(){this.isCancelled=!0,this.isSendingChunk=!1,this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.close()}destroy(){this.cancel(),this.onProgress=null,this.onError=null,this.onComplete=null,this.onDownloadUrlReady=null,this.onTransferStarted=null,this.totalBytesSent=0,this.isSendingChunk=!1}}const dl={class:"flex items-center justify-between mb-2"},fl={class:"flex items-center"},wl={class:"text-blue-800 font-medium"},yl={class:"text-blue-600 text-sm mb-3"},pl={class:"flex justify-end space-x-2"},Dl={class:"flex items-center justify-center mb-8"},ml={class:"flex flex-col items-center"},Fl={class:"text-sm mt-2 text-gray-600"},kl={key:0,class:"w-16 h-0.5 bg-gray-300 mx-4"},vl={class:"bg-white rounded-lg shadow-sm border p-6"},Gl={__name:"HomePage",setup(e){const{callMcpTool:A}=ig(),{t:g}=TA(),t=j(0),I=j(!1),o=j("wakeword"),i=j(!1),r=j(!1),C=j(!1),B=j(!0),n=new sI,Q=j(null),a=j(null),E=[{titleKey:"steps.chip",key:"chip"},{titleKey:"steps.theme",key:"theme"},{titleKey:"steps.generate",key:"generate"}],h=j({chip:{model:"",display:{width:320,height:240,color:"RGB565"}},theme:{wakeword:{type:"none",preset:"",custom:{name:"",command:"",threshold:20,duration:3e3,model:"mn6_en"}},font:{type:"none",preset:"",hide_subtitle:!1,custom:{file:null,size:20,bpp:4,charset:"deepseek"}},emoji:{type:"none",preset:"",custom:{size:{width:160,height:120},images:{}}},skin:{light:{backgroundType:"color",backgroundColor:"#ffffff",textColor:"#000000",backgroundImage:null},dark:{backgroundType:"color",backgroundColor:"#121212",textColor:"#ffffff",backgroundImage:null}}}}),w=S=>S{t.value{t.value>0&&t.value--},f=()=>{I.value=!0},c=async S=>{},D=()=>new URLSearchParams(window.location.search).get("token"),y=async(S,J={})=>await A(S,J),v=async S=>{const{blob:J,onProgress:V,onComplete:q,onError:$}=S;try{const AA=D();if(!AA)throw new Error(g("flashProgress.authTokenMissing"));V(5,g("flashProgress.checkingDeviceStatus"));try{if(!await y("self.get_device_status"))throw new Error(g("flashProgress.deviceOfflineOrUnresponsive",{error:g("flashProgress.unableToGetDeviceStatus")}))}catch(z){console.error("Failed to check device status:",z),$(g("flashProgress.deviceOfflineOrUnresponsive",{error:z.message}));return}V(15,g("flashProgress.initializingTransferService")),a.value=new ul(AA);let _=null;const iA=new Promise((z,lA)=>{_=z});let b=null;const H=new Promise((z,lA)=>{b=z});a.value.onTransferStarted=()=>{b&&(b(),b=null)},await a.value.initializeSession(J,(z,lA)=>{V(15+z*.75,lA)},z=>{console.error("Failed to initialize the WebSocket session:",z),$(g("flashProgress.initializeTransferFailed",{error:z.message}))},z=>{_(z)});const Z=await iA;V(30,g("flashProgress.settingDeviceDownloadUrl"));try{await y("self.assets.set_download_url",{url:Z})}catch(z){console.error("Failed to set the device download URL:",z),$(g("flashProgress.setDownloadUrlFailed",{error:z.message}));return}V(40,g("flashProgress.rebootingDevice")),y("self.reboot").catch(z=>{console.warn("Reboot call warning (the device may have already restarted):",z)}),V(50,g("flashProgress.waitingForDeviceReboot"));const IA=new Promise((z,lA)=>{setTimeout(()=>lA(new Error(g("flashProgress.deviceRebootTimeout"))),6e4)});await Promise.race([H,IA]),V(60,g("flashProgress.startingFileTransfer")),await a.value.startTransfer((z,lA)=>{const wA=60+z*.4;V(Math.round(wA),lA)},z=>{$(g("flashProgress.onlineFlashFailed",{error:z.message}))},()=>{q()}),a.value.onTransferStarted=null}catch(AA){console.error("Online flashing failed:",AA),$(g("flashProgress.onlineFlashFailed",{error:AA.message}))}},N=()=>{a.value&&(a.value.cancel(),a.value.destroy(),a.value=null)},L=S=>{o.value=S},X=async()=>{var S,J,V;try{B.value=!0;const q=await cA.loadConfig();if(q){h.value=q.config,t.value=0,o.value="wakeword",i.value=!0,r.value=!0,await k(),Q.value&&clearTimeout(Q.value),Q.value=setTimeout(()=>{i.value=!1},5e3),n.setConfig(h.value,{strict:!1}),await n.restoreAllResourcesFromStorage(h.value);try{const $=((V=(J=(S=h.value)==null?void 0:S.theme)==null?void 0:J.emoji)==null?void 0:V.custom)||{},AA=$.images||{},_=$.fileMap||{},iA=$.emotionMap||{};h.value={...h.value,theme:{...h.value.theme,emoji:{...h.value.theme.emoji,custom:{...$,images:{...AA},fileMap:{..._},emotionMap:{...iA}}}}}}catch($){console.error("Failed to refresh emoji config references:",$)}}else i.value=!1,r.value=!1}catch(q){console.error("Failed to load the saved configuration:",q),i.value=!1,r.value=!1}finally{B.value=!1}},k=async()=>{var S,J,V;try{const q=(V=(J=(S=h.value)==null?void 0:S.theme)==null?void 0:J.emoji)==null?void 0:V.custom;if(!q)return;const $=Object.keys(q.images||{}).length>0,AA=q.fileMap&&Object.keys(q.fileMap).length>0,_=q.emotionMap&&Object.keys(q.emotionMap).length>0;if($&&(!AA||!_)){console.warn("Detected an incompatible legacy emoji data structure"),console.log("Cleaning legacy emoji data...");try{const b=Object.keys(q.images||{});for(const H of b)await cA.deleteFile(`emoji_${H}`);console.log(`Deleted ${b.length} legacy emoji files`)}catch(b){console.warn("Failed while deleting legacy emoji files:",b)}h.value.theme.emoji.custom={size:q.size||{width:64,height:64},images:{},fileMap:{},emotionMap:{}},h.value.theme.emoji.type==="custom"&&(h.value.theme.emoji.type="",console.log("Reset the emoji type so it can be selected again")),await m(),console.log("Legacy emoji data was fully cleared"),setTimeout(()=>{alert(`An incompatible legacy emoji data structure was removed. - -The new version deduplicates shared image files to save storage space. - -Please re-upload your custom emoji images.`)},500)}}catch(q){console.error("Failed to clean up legacy emoji data:",q)}},m=async()=>{try{await cA.saveConfig(h.value)}catch(S){console.error("Failed to save configuration:",S)}},M=async()=>{try{C.value=!0,await n.clearAllStoredData();const S={model:h.value.chip.model,display:{...h.value.chip.display}};h.value={chip:S,theme:{wakeword:{type:"none",preset:"",custom:{name:"",command:"",threshold:20,model:"mn6_en"}},font:{type:"none",preset:"",hide_subtitle:!1,custom:{file:null,size:20,bpp:4,charset:"deepseek"}},emoji:{type:"none",preset:"",custom:{size:{width:64,height:64},images:{}}},skin:{light:{backgroundType:"color",backgroundColor:"#ffffff",textColor:"#000000",backgroundImage:null},dark:{backgroundType:"color",backgroundColor:"#121212",textColor:"#ffffff",backgroundImage:null}}}},t.value=0,o.value="wakeword",i.value=!1,r.value=!1}catch(S){console.error("Failed to reset configuration:",S),alert(g("errors.resetFailed"))}finally{C.value=!1}};DA(h,async S=>{!B.value&&r.value&&await m()},{deep:!0}),Me(async()=>{await cA.initialize(),await X()}),st(()=>{Q.value&&clearTimeout(Q.value)});const oA=()=>{i.value=!1,Q.value&&clearTimeout(Q.value)},F=()=>{Q.value&&clearTimeout(Q.value),Q.value=setTimeout(()=>{i.value=!1},5e3)};return(S,J)=>(G(),U("div",null,[i.value?(G(),U("div",{key:0,class:"fixed bottom-4 right-4 z-50 bg-blue-50 border border-blue-200 rounded-lg p-4 shadow-lg transition-opacity duration-300 min-w-[300px]",onMouseenter:F},[s("div",dl,[s("div",fl,[J[3]||(J[3]=s("svg",{class:"w-5 h-5 text-blue-500 mr-2",fill:"currentColor",viewBox:"0 0 20 20"},[s("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"})],-1)),s("span",wl,d(S.$t("configNotice.title")),1)]),s("button",{onClick:oA,class:"text-gray-500 hover:text-gray-700"},[...J[4]||(J[4]=[s("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),s("p",yl,d(S.$t("configNotice.message")),1),s("div",pl,[s("button",{onClick:M,class:"px-3 py-1 text-sm text-red-600 hover:text-red-800 font-medium"},d(S.$t("configNotice.restart")),1)])],32)):O("",!0),s("div",Dl,[(G(),U(bA,null,LA(E,(V,q)=>s("div",{key:q,class:"flex items-center"},[s("div",ml,[s("div",{class:gA(w(q))},d(q+1),3),s("span",Fl,d(S.$t(V.titleKey)),1)]),qh.value.chip=V),onNext:u},null,8,["modelValue"])):O("",!0),t.value===1?(G(),UA(kC,{key:1,modelValue:h.value.theme,"onUpdate:modelValue":J[1]||(J[1]=V=>h.value.theme=V),chipModel:h.value.chip.model,activeTab:o.value,onNext:u,onPrev:l,onTabChange:L},null,8,["modelValue","chipModel","activeTab"])):O("",!0),t.value===2?(G(),UA(wn,{key:2,config:h.value,onGenerate:f,onPrev:l},null,8,["config"])):O("",!0)]),I.value?(G(),UA(hl,{key:1,config:h.value,onClose:J[2]||(J[2]=V=>I.value=!1),onGenerate:c,onStartFlash:v,onCancelFlash:N},null,8,["config"])):O("",!0)]))}};export{Gl as default}; diff --git a/main/manager-web/public/generator/assets/HomePage-C46hPw_t.js b/main/manager-web/public/generator/assets/HomePage-C46hPw_t.js new file mode 100644 index 000000000..1679252b9 --- /dev/null +++ b/main/manager-web/public/generator/assets/HomePage-C46hPw_t.js @@ -0,0 +1,19 @@ +import{u as TA,r as j,w as DA,o as Me,a as G,c as U,b as a,t as d,d as fg,e as HA,f as wg,g as O,h as ig,i as nA,j as eA,n as nt,k as gA,F as bA,l as LA,m as rA,v as sA,p as Xe,q as PA,s as CA,x as UA,y as Bt,z as at,_ as sI,A as we}from"./index-C_B_50-2.js";const QI={class:"space-y-6"},EI={class:"text-xl font-semibold text-gray-900 mb-4"},lI={class:"text-gray-600 mb-6"},cI={key:0},hI={key:1},uI={key:2},dI={key:0,class:"space-y-4"},fI={class:"bg-blue-50 border-2 border-blue-200 rounded-lg p-6"},wI={class:"flex items-center justify-center space-x-3"},pI={class:"text-lg font-medium text-blue-900"},yI={class:"text-sm text-blue-700 mt-1"},DI={key:1,class:"space-y-4"},mI={class:"bg-green-50 border-2 border-green-200 rounded-lg p-4"},FI={class:"flex items-start justify-between mb-3"},kI={class:"flex items-center"},vI={class:"text-lg font-medium text-green-900"},SI={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mt-4"},GI={class:"bg-white rounded-lg p-3"},RI={class:"block text-sm font-medium text-gray-700 mb-1"},UI={class:"text-base font-semibold text-gray-900"},NI={class:"bg-white rounded-lg p-3"},bI={class:"block text-sm font-medium text-gray-700 mb-1"},LI={class:"text-base font-semibold text-gray-900"},MI={class:"bg-white rounded-lg p-3"},JI={class:"block text-sm font-medium text-gray-700 mb-1"},xI={class:"text-base font-semibold text-gray-900"},HI={class:"mt-3 text-sm text-green-700"},YI={class:"border border-gray-200 rounded-lg p-4"},KI={key:0,class:"mt-4"},TI={key:2,class:"space-y-4"},VI={class:"bg-yellow-50 border border-yellow-200 rounded-lg p-4"},qI={class:"flex items-start"},OI={class:"font-medium text-yellow-900"},WI={class:"text-sm text-yellow-700 mt-1"},PI={class:"border-2 border-gray-300 rounded-lg p-4"},ZI={class:"text-lg font-medium text-gray-900 mb-4"},XI={class:"flex justify-end"},jI=["disabled"],zI={__name:"ChipConfig",props:{modelValue:{type:Object,default:()=>({model:"",display:{width:320,height:240,color:"RGB565"}})}},emits:["update:modelValue","next"],setup(e,{emit:A}){const{t:g}=TA(),t=A,I=nA(()=>[{value:"",label:g("chipConfig.selectChip")},{value:"esp32s3",label:"ESP32-S3"},{value:"esp32c3",label:"ESP32-C3"},{value:"esp32c5",label:"ESP32-C5"},{value:"esp32c6",label:"ESP32-C6"},{value:"esp32p4",label:"ESP32-P4"},{value:"esp32",label:"ESP32"},{value:"others",label:g("common.other")}]),o={name:"ConfigForm",props:{config:{type:Object,required:!0},showRequired:{type:Boolean,default:!1}},render(){const p=this.$t;return eA("div",{class:"grid grid-cols-1 md:grid-cols-3 gap-4"},[eA("div",[eA("label",{class:"block text-sm font-medium text-gray-700 mb-2"},[p("chipConfig.chipRequired")+" ",this.showRequired&&eA("span",{class:"text-red-500"},"*")]),eA("select",{class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500",value:this.config.model,onChange:v=>{this.config.model=v.target.value}},fg(I).map(v=>eA("option",{value:v.value,key:v.value},v.label)))]),eA("div",[eA("label",{class:"block text-sm font-medium text-gray-700 mb-2"},[p("chipConfig.widthRequired")+" ",this.showRequired&&eA("span",{class:"text-red-500"},"*")]),eA("input",{type:"number",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500",value:this.config.display.width,min:128,max:800,placeholder:"320",onInput:v=>{this.config.display.width=Number(v.target.value)}})]),eA("div",[eA("label",{class:"block text-sm font-medium text-gray-700 mb-2"},[p("chipConfig.heightRequired")+" ",this.showRequired&&eA("span",{class:"text-red-500"},"*")]),eA("input",{type:"number",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500",value:this.config.display.height,min:128,max:600,placeholder:"240",onInput:v=>{this.config.display.height=Number(v.target.value)}})])])}},{deviceInfo:i,isDeviceOnline:r,hasToken:C}=ig(),B=j(C.value),n=j(!1),Q=j(""),s=j(!1),E=j({model:"",display:{width:320,height:240,color:"RGB565"}}),h={"ESP32-S3":"esp32s3",ESP32S3:"esp32s3","ESP32-C3":"esp32c3",ESP32C3:"esp32c3","ESP32-C5":"esp32c5",ESP32C5:"esp32c5","ESP32-P4":"esp32p4",ESP32P4:"esp32p4","ESP32-C6":"esp32c6",ESP32C6:"esp32c6",ESP32:"esp32"},w=()=>{var p,v;try{if(!r.value)return B.value||(Q.value=g("chipConfig.deviceOffline"),n.value=!1),!1;const N=(p=i.value.chip)==null?void 0:p.model;if(!N||N==="Unknown")return!1;let L=h[N.toUpperCase()]||h[N]||N.toLowerCase().replace(/-/g,"");["esp32s3","esp32c3","esp32c5","esp32p4","esp32c6","esp32","others"].includes(L)||(L="others");const k=(v=i.value.screen)==null?void 0:v.resolution;if(!k||k==="Unknown")return!1;const[m,M]=k.split("x").map(Number);return!m||!M||isNaN(m)||isNaN(M)?(Q.value=g("chipConfig.resolutionFormatError"),n.value=!1,B.value=!1,!1):(E.value={model:L,display:{width:m,height:M,color:"RGB565"}},t("update:modelValue",{model:L,display:{width:m,height:M,color:"RGB565"}}),n.value=!0,Q.value="",B.value=!1,console.log("✓ Device config loaded successfully:",{chip:L,width:m,height:M}),!0)}catch(N){return console.error("Failed to load device config:",N),Q.value=g("chipConfig.loadingError"),n.value=!1,B.value=!1,!1}},u=nA(()=>E.value.model&&E.value.display.width&&E.value.display.height),l=nA(()=>E.value.model?E.value.model.toUpperCase().replace(/ESP32/i,"ESP32-"):""),f=nA(()=>E.value.display),c=()=>{s.value=!s.value},D=()=>{u.value&&t("next")};return DA(()=>E.value,p=>{t("update:modelValue",{model:p.model,display:{...p.display}})},{deep:!0}),DA(()=>r.value,p=>{p&&!n.value&&(B.value=!0,Q.value="",setTimeout(()=>{w()},100))}),DA(()=>[i.value.chip,i.value.screen],()=>{r.value&&!n.value&&w()},{deep:!0}),Me(()=>{if(!C.value){B.value=!1,Q.value=g("chipConfig.manualConfigRequired"),console.log("⚠ No device connection detected, using manual config mode");return}r.value&&i.value.chip&&i.value.chip.model!=="Unknown"&&i.value.screen&&i.value.screen.resolution!=="Unknown"?(console.log("✓ Cached device info detected, loading immediately"),w()):r.value?(console.log("⏳ Device online, waiting for device info to load..."),B.value=!0,setTimeout(()=>{w()},500),setTimeout(()=>{B.value&&!n.value&&r.value&&(B.value=!1,!i.value.chip||i.value.chip.model==="Unknown"?Q.value=g("chipConfig.chipModelError"):!i.value.screen||i.value.screen.resolution==="Unknown"?Q.value=g("chipConfig.resolutionError"):Q.value=g("chipConfig.timeoutError"),console.warn("⚠ Device config load timeout:",Q.value))},1e4)):(console.log("⏳ Waiting for device connection..."),B.value=!0,setTimeout(()=>{B.value&&!n.value&&!r.value&&(B.value=!1,Q.value=g("chipConfig.manualConfigHint"),console.warn("⚠ Device connection timeout"))},1e4))}),(p,v)=>(G(),U("div",QI,[a("div",null,[a("h2",EI,d(p.$t("chipConfig.title")),1),a("p",lI,[B.value?(G(),U("span",cI,d(p.$t("chipConfig.loadingFromDevice")),1)):n.value?(G(),U("span",hI,d(p.$t("chipConfig.loadedFromDevice")),1)):(G(),U("span",uI,d(p.$t("chipConfig.manualConfig")),1))])]),B.value?(G(),U("div",dI,[a("div",fI,[a("div",wI,[v[0]||(v[0]=a("svg",{class:"animate-spin h-6 w-6 text-blue-600",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[a("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),a("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),a("div",null,[a("h3",pI,d(p.$t("chipConfig.loadingTitle")),1),a("p",yI,d(p.$t("chipConfig.loadingDesc")),1)])])])])):fg(r)&&n.value?(G(),U("div",DI,[a("div",mI,[a("div",FI,[a("div",kI,[v[1]||(v[1]=a("div",{class:"w-5 h-5 bg-green-500 rounded-full flex items-center justify-center mr-2"},[a("svg",{class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},[a("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})])],-1)),a("h3",vI,d(p.$t("chipConfig.autoLoadedTitle")),1)])]),a("div",SI,[a("div",GI,[a("label",RI,d(p.$t("chipConfig.chipModel")),1),a("div",UI,d(l.value),1)]),a("div",NI,[a("label",bI,d(p.$t("chipConfig.screenWidth")),1),a("div",LI,d(f.value.width)+" px",1)]),a("div",MI,[a("label",JI,d(p.$t("chipConfig.screenHeight")),1),a("div",xI,d(f.value.height)+" px",1)])]),a("div",HI," ✓ "+d(p.$t("chipConfig.colorFormat"))+" "+d(f.value.color),1)]),a("div",YI,[a("button",{onClick:c,class:"flex items-center text-sm text-gray-600 hover:text-gray-900"},[v[2]||(v[2]=a("svg",{class:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1)),HA(" "+d(s.value?p.$t("chipConfig.collapseManual"):p.$t("chipConfig.manualEdit")),1)]),s.value?(G(),U("div",KI,[wg(o,{config:E.value},null,8,["config"])])):O("",!0)])])):(G(),U("div",TI,[a("div",VI,[a("div",qI,[v[3]||(v[3]=a("svg",{class:"w-5 h-5 text-yellow-600 mr-3 flex-shrink-0 mt-0.5",fill:"currentColor",viewBox:"0 0 20 20"},[a("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1)),a("div",null,[a("h4",OI,d(p.$t("chipConfig.manualConfigDesc")),1),a("p",WI,d(Q.value||p.$t("chipConfig.manualConfigHint")),1)])])]),a("div",PI,[a("h3",ZI,d(p.$t("chipConfig.manualConfigTitle")),1),wg(o,{config:E.value,"show-required":!0},null,8,["config"])])])),a("div",XI,[a("button",{onClick:D,disabled:!u.value,class:"bg-primary-500 hover:bg-primary-600 disabled:bg-gray-300 text-white px-6 py-2 rounded-lg font-medium transition-colors"},d(p.$t("chipConfig.next")),9,jI)])]))}},_I={class:"space-y-6"},$I={class:"text-lg font-medium text-gray-900 mb-2"},Ao={class:"text-gray-600"},eo={key:0,class:"bg-orange-50 border border-orange-200 rounded-lg p-4"},go={class:"text-sm text-orange-800"},to={class:"mt-1"},Io={key:1,class:"space-y-6"},oo={class:"flex space-x-4"},io={key:0,class:"space-y-4"},ro={class:"block text-sm font-medium text-gray-700"},Co={class:"relative"},no=["value"],Bo=["value"],ao={key:1,class:"space-y-4 bg-gray-50 p-4 rounded-lg border border-gray-200"},so={class:"font-medium text-gray-900"},Qo={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Eo={class:"block text-sm font-medium text-gray-700 mb-1"},lo=["placeholder"],co={key:0,class:"text-xs text-red-500 mt-1"},ho={class:"block text-sm font-medium text-gray-700 mb-1"},uo=["placeholder"],fo={key:0,class:"text-xs text-red-500 mt-1"},wo={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},po={class:"block text-sm font-medium text-gray-700 mb-1"},yo={class:"flex items-center space-x-2"},Do={class:"text-sm text-gray-600 w-8"},mo={class:"text-xs text-gray-500 mt-1"},Fo={class:"block text-sm font-medium text-gray-700 mb-1"},ko={key:0,class:"text-xs text-red-500 mt-1"},vo={class:"block text-sm font-medium text-gray-700 mb-1"},So={value:"mn6_en"},Go={class:"bg-blue-50 border border-blue-200 rounded-lg p-3"},Ro={class:"text-sm text-blue-800"},Uo={class:"mt-1 list-disc list-inside space-y-1"},No={key:0},bo={key:1},Lo={key:2},Mo={__name:"WakewordConfig",props:{modelValue:{type:Object,required:!0},chipModel:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:A}){const{t:g}=TA(),t=e,I=A,o=[{id:"wn9s_hilexin",name:"Hi, Espressif",model:"WakeNet9s"},{id:"wn9s_hiesp",name:"Hi,ESP",model:"WakeNet9s"},{id:"wn9s_nihaoxiaozhi",name:"Hello Xiaozhi",model:"WakeNet9s"},{id:"wn9s_hijason",name:"Hi,Jason",model:"WakeNet9s"},{id:"wn9s_alexa",name:"Alexa",model:"WakeNet9s"},{id:"wn9_hilexin",name:"Hi, Espressif",model:"WakeNet9"},{id:"wn9_hiesp",name:"Hi,ESP",model:"WakeNet9"},{id:"wn9_nihaoxiaozhi_tts",name:"Hello Xiaozhi",model:"WakeNet9"},{id:"wn9_hijason_tts2",name:"Hi,Jason",model:"WakeNet9"},{id:"wn9_himfive",name:"Hi,M Five",model:"WakeNet9"},{id:"wn9_alexa",name:"Alexa",model:"WakeNet9"},{id:"wn9_jarvis_tts",name:"Jarvis",model:"WakeNet9"},{id:"wn9_computer_tts",name:"Computer",model:"WakeNet9"},{id:"wn9_heywillow_tts",name:"Hey,Willow",model:"WakeNet9"},{id:"wn9_sophia_tts",name:"Sophia",model:"WakeNet9"},{id:"wn9_heyprinter_tts",name:"Hey,Printer",model:"WakeNet9"},{id:"wn9_hijoy_tts",name:"Hi,Joy",model:"WakeNet9"},{id:"wn9_heywanda_tts",name:"Hey,Wand",model:"WakeNet9"},{id:"wn9_astrolabe_tts",name:"Astrolabe",model:"WakeNet9"},{id:"wn9_heyily_tts2",name:"Hey,Ily",model:"WakeNet9"},{id:"wn9_hijolly_tts2",name:"Hi,Jolly",model:"WakeNet9"},{id:"wn9_hifairy_tts2",name:"Hi,Fairy",model:"WakeNet9"},{id:"wn9_bluechip_tts2",name:"Blue Chip",model:"WakeNet9"},{id:"wn9_hiandy_tts2",name:"Hi,Andy",model:"WakeNet9"},{id:"wn9_heyivy_tts2",name:"Hey,Ivy",model:"WakeNet9"},{id:"wn9_histackchan_tts3",name:"Hi,Stack Chan",model:"WakeNet9"},{id:"wn9_hiwalle_tts2",name:"Hi,Wall E",model:"WakeNet9"},{id:"wn9_hilili_tts",name:"Hi,Lily",model:"WakeNet9"},{id:"wn9_hitelly_tts",name:"Hi,Telly",model:"WakeNet9"},{id:"wn9_linaiban_tts2",name:"Lina Board",model:"WakeNet9"}],i=nA(()=>{const l=t.chipModel.toLowerCase();return l==="esp32s3"||l==="esp32p4"}),r=nA(()=>{const l=t.chipModel.toLowerCase();return l==="esp32c3"||l==="esp32c5"||l==="esp32c6"}),C=nA(()=>t.chipModel.toLowerCase()==="esp32s3"),B=nA(()=>i.value||r.value),n=nA(()=>i.value?o.filter(l=>l.model==="WakeNet9"):r.value?o.filter(l=>l.model==="WakeNet9s"):[]),Q=j({name:"",command:"",threshold:20,duration:3e3,model:"mn6_en"}),s=j({name:"",command:"",duration:""}),E=()=>{let l=!0;return s.value={name:"",command:"",duration:""},Q.value.name.trim()||(s.value.name=g("wakewordConfig.errors.nameRequired"),l=!1),Q.value.command.trim()?Q.value.model.includes("_en")&&/[!,.?]/.test(Q.value.command)&&(s.value.command=g("wakewordConfig.errors.noPunctuation"),l=!1):(s.value.command=g("wakewordConfig.errors.commandRequired"),l=!1),(!Q.value.duration||Q.value.duration<500||Q.value.duration>1e4)&&(s.value.duration=g("wakewordConfig.errors.durationRange"),l=!1),l},h=j(!1),w=l=>{var f;I("update:modelValue",{...t.modelValue,type:l,preset:l==="preset"&&(t.modelValue.preset||((f=n.value[0])==null?void 0:f.id))||"",custom:{...t.modelValue.custom,...Q.value}})},u=l=>{I("update:modelValue",{...t.modelValue,preset:l})};return DA(Q,l=>{h.value||t.modelValue.type==="custom"&&(E(),I("update:modelValue",{...t.modelValue,custom:{...l}}))},{deep:!0}),DA(()=>t.modelValue.custom,l=>{l&&(h.value=!0,Q.value={name:l.name||"",command:l.command||"",threshold:l.threshold!==void 0?l.threshold:20,duration:l.duration!==void 0?l.duration:3e3,model:l.model||"mn6_en"},nt(()=>{h.value=!1}))},{deep:!0,immediate:!0}),(l,f)=>(G(),U("div",_I,[a("div",null,[a("h3",$I,d(l.$t("wakewordConfig.title")),1),a("p",Ao,d(l.$t("wakewordConfig.description")),1)]),B.value?(G(),U("div",Io,[a("div",oo,[a("button",{onClick:f[0]||(f[0]=c=>w("none")),class:gA(["px-4 py-2 border rounded-lg transition-colors",e.modelValue.type==="none"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(l.$t("wakewordConfig.noWakeword")),3),a("button",{onClick:f[1]||(f[1]=c=>w("preset")),class:gA(["px-4 py-2 border rounded-lg transition-colors",e.modelValue.type==="preset"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(l.$t("wakewordConfig.presetWakeword")),3),C.value?(G(),U("button",{key:0,onClick:f[2]||(f[2]=c=>w("custom")),class:gA(["px-4 py-2 border rounded-lg transition-colors",e.modelValue.type==="custom"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(l.$t("wakewordConfig.customWakeword")),3)):O("",!0)]),e.modelValue.type==="preset"?(G(),U("div",io,[a("label",ro,d(l.$t("wakewordConfig.selectWakeword")),1),a("div",Co,[a("select",{value:e.modelValue.preset,onChange:f[3]||(f[3]=c=>u(c.target.value)),class:"w-full border border-gray-300 rounded-md px-3 py-2 pr-10 bg-white focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},[(G(!0),U(bA,null,LA(n.value,c=>(G(),U("option",{key:c.id,value:c.id},d(c.name)+" ("+d(c.model)+") ",9,Bo))),128))],40,no)])])):O("",!0),e.modelValue.type==="custom"?(G(),U("div",ao,[a("h4",so,d(l.$t("wakewordConfig.customSettings")),1),a("div",Qo,[a("div",null,[a("label",Eo,[HA(d(l.$t("wakewordConfig.wakewordName"))+" ",1),f[9]||(f[9]=a("span",{class:"text-red-500"},"*",-1))]),rA(a("input",{type:"text","onUpdate:modelValue":f[4]||(f[4]=c=>Q.value.name=c),placeholder:l.$t("wakewordConfig.wakewordNamePlaceholder"),class:gA(["w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500",{"border-red-500":s.value.name}])},null,10,lo),[[sA,Q.value.name]]),s.value.name?(G(),U("p",co,d(s.value.name),1)):O("",!0)]),a("div",null,[a("label",ho,[HA(d(l.$t("wakewordConfig.wakewordCommand"))+" ",1),f[10]||(f[10]=a("span",{class:"text-red-500"},"*",-1))]),rA(a("input",{type:"text","onUpdate:modelValue":f[5]||(f[5]=c=>Q.value.command=c),placeholder:l.$t("wakewordConfig.wakewordCommandPlaceholderEN"),class:gA(["w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500",{"border-red-500":s.value.command}])},null,10,uo),[[sA,Q.value.command]]),s.value.command?(G(),U("p",fo,d(s.value.command),1)):O("",!0)])]),a("div",wo,[a("div",null,[a("label",po,d(l.$t("wakewordConfig.threshold")),1),a("div",yo,[rA(a("input",{type:"range","onUpdate:modelValue":f[6]||(f[6]=c=>Q.value.threshold=c),min:"0",max:"100",step:"1",class:"flex-1"},null,512),[[sA,Q.value.threshold,void 0,{number:!0}]]),a("span",Do,d(Q.value.threshold),1)]),a("p",mo,d(l.$t("wakewordConfig.thresholdDesc")),1)]),a("div",null,[a("label",Fo,d(l.$t("wakewordConfig.duration"))+" (ms) ",1),rA(a("input",{type:"number","onUpdate:modelValue":f[7]||(f[7]=c=>Q.value.duration=c),min:"500",max:"10000",step:"100",class:gA(["w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500",{"border-red-500":s.value.duration}])},null,2),[[sA,Q.value.duration,void 0,{number:!0}]]),s.value.duration?(G(),U("p",ko,d(s.value.duration),1)):O("",!0)]),a("div",null,[a("label",vo,d(l.$t("wakewordConfig.selectModel")),1),rA(a("select",{"onUpdate:modelValue":f[8]||(f[8]=c=>Q.value.model=c),class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500"},[a("option",So,d(l.$t("wakewordConfig.mn6en")),1)],512),[[Xe,Q.value.model]])])])])):O("",!0),a("div",Go,[a("div",Ro,[a("strong",null,d(l.$t("wakewordConfig.tips.tipLabel")),1),a("ul",Uo,[a("li",null,d(l.$t("wakewordConfig.tips.optional")),1),r.value?(G(),U("li",No,d(l.$t("wakewordConfig.tips.wakeNet9sOnly")),1)):i.value?(G(),U("li",bo,d(l.$t("wakewordConfig.tips.wakeNet9Full")),1)):O("",!0),C.value?(G(),U("li",Lo,d(l.$t("wakewordConfig.tips.customSupport")),1)):O("",!0)])])])])):(G(),U("div",eo,[a("div",go,[a("strong",null,d(l.$t("wakewordConfig.notice")),1),a("p",to,d(l.$t("wakewordConfig.unsupportedMessage",{chipModel:e.chipModel})),1)])]))]))}};class Jo{constructor(){this.dbName="XiaozhiConfigDB",this.version=1,this.db=null,this.initialized=!1}async initialize(){if(!(this.initialized&&this.db))return new Promise((A,g)=>{const t=indexedDB.open(this.dbName,this.version);t.onerror=()=>{console.error("IndexedDB initialization failed:",t.error),g(t.error)},t.onsuccess=()=>{this.db=t.result,this.initialized=!0,console.log("IndexedDB initialized successfully"),A()},t.onupgradeneeded=I=>{const o=I.target.result;if(o.objectStoreNames.contains("configs")||o.createObjectStore("configs",{keyPath:"key"}).createIndex("timestamp","timestamp",{unique:!1}),!o.objectStoreNames.contains("files")){const i=o.createObjectStore("files",{keyPath:"id"});i.createIndex("type","type",{unique:!1}),i.createIndex("timestamp","timestamp",{unique:!1})}if(!o.objectStoreNames.contains("temp_data")){const i=o.createObjectStore("temp_data",{keyPath:"key"});i.createIndex("type","type",{unique:!1}),i.createIndex("timestamp","timestamp",{unique:!1})}console.log("IndexedDB schema created")}})}async saveConfig(A){this.initialized||await this.initialize();const t={key:"current_config",config:this.sanitizeConfigForStorage(A),timestamp:Date.now()};return new Promise((I,o)=>{const C=this.db.transaction(["configs"],"readwrite").objectStore("configs").put(t);C.onerror=()=>{console.error("Failed to save config:",C.error),o(C.error)},C.onsuccess=()=>{console.log("Config saved to IndexedDB"),I()}})}sanitizeConfigForStorage(A){var t,I,o,i,r,C,B,n,Q,s;const g=JSON.parse(JSON.stringify(A||{}));try{if((I=(t=g==null?void 0:g.theme)==null?void 0:t.font)!=null&&I.custom&&(g.theme.font.custom.file=null),((i=(o=g==null?void 0:g.theme)==null?void 0:o.emoji)==null?void 0:i.type)==="custom"){g.theme.emoji.custom||(g.theme.emoji.custom={});const E=((C=(r=g.theme.emoji)==null?void 0:r.custom)==null?void 0:C.images)||{},h={};if(Object.keys(E).forEach(w=>{h[w]=null}),g.theme.emoji.custom.images=h,g.theme.emoji.custom.emotionMap,g.theme.emoji.custom.fileMap){const w=g.theme.emoji.custom.fileMap,u={};Object.keys(w).forEach(l=>{u[l]=null}),g.theme.emoji.custom.fileMap=u}}(n=(B=g==null?void 0:g.theme)==null?void 0:B.skin)!=null&&n.light&&(g.theme.skin.light.backgroundImage=null),(s=(Q=g==null?void 0:g.theme)==null?void 0:Q.skin)!=null&&s.dark&&(g.theme.skin.dark.backgroundImage=null)}catch{}return g}async loadConfig(){return this.initialized||await this.initialize(),new Promise((A,g)=>{const o=this.db.transaction(["configs"],"readonly").objectStore("configs").get("current_config");o.onerror=()=>{console.error("Failed to load config:",o.error),g(o.error)},o.onsuccess=()=>{const i=o.result;i?(console.log("Config restored from IndexedDB successfully"),A({config:i.config,timestamp:i.timestamp})):A(null)}})}async saveFile(A,g,t,I={}){this.initialized||await this.initialize();const o=await this.fileToArrayBuffer(g);let i={};try{i=I?JSON.parse(JSON.stringify(I)):{}}catch{i={...I}}const r={id:A,type:t,name:g.name,size:g.size,mimeType:g.type,lastModified:g.lastModified,data:o,metadata:i,timestamp:Date.now()};return new Promise((C,B)=>{const s=this.db.transaction(["files"],"readwrite").objectStore("files").put(r);s.onerror=()=>{console.error("Failed to save file:",s.error),B(s.error)},s.onsuccess=()=>{console.log(`File ${g.name} saved to IndexedDB`),C()}})}async loadFile(A){return this.initialized||await this.initialize(),new Promise((g,t)=>{const i=this.db.transaction(["files"],"readonly").objectStore("files").get(A);i.onerror=()=>{console.error("Failed to load file:",i.error),t(i.error)},i.onsuccess=()=>{const r=i.result;if(r){const C=new Blob([r.data],{type:r.mimeType}),B=new File([C],r.name,{type:r.mimeType,lastModified:r.lastModified});B.storedId=r.id,B.storedType=r.type,B.storedMetadata=r.metadata,B.storedTimestamp=r.timestamp,console.log(`File ${r.name} restored from IndexedDB successfully`),g(B)}else g(null)}})}async getFilesByType(A){return this.initialized||await this.initialize(),new Promise((g,t)=>{const r=this.db.transaction(["files"],"readonly").objectStore("files").index("type").getAll(A);r.onerror=()=>{console.error("Failed to get file list:",r.error),t(r.error)},r.onsuccess=()=>{const B=(r.result||[]).map(n=>{const Q=new Blob([n.data],{type:n.mimeType}),s=new File([Q],n.name,{type:n.mimeType,lastModified:n.lastModified});return s.storedId=n.id,s.storedType=n.type,s.storedMetadata=n.metadata,s.storedTimestamp=n.timestamp,s});g(B)}})}async saveTempData(A,g,t,I={}){this.initialized||await this.initialize();const o={key:A,type:t,data:g,metadata:I,timestamp:Date.now()};return new Promise((i,r)=>{const n=this.db.transaction(["temp_data"],"readwrite").objectStore("temp_data").put(o);n.onerror=()=>{console.error("Failed to save temporary data:",n.error),r(n.error)},n.onsuccess=()=>{console.log(`Temporary data ${A} saved`),i()}})}async loadTempData(A){return this.initialized||await this.initialize(),new Promise((g,t)=>{const i=this.db.transaction(["temp_data"],"readonly").objectStore("temp_data").get(A);i.onerror=()=>{console.error("Failed to load temporary data:",i.error),t(i.error)},i.onsuccess=()=>{const r=i.result;g(r||null)}})}async clearAll(){this.initialized||await this.initialize();const A=["configs","files","temp_data"];return new Promise((g,t)=>{const I=this.db.transaction(A,"readwrite");let o=0,i=!1;const r=()=>{o++,o===A.length&&(i?t(new Error("Error occurred while clearing partial data")):(console.log("All storage data cleared"),g()))};A.forEach(C=>{const n=I.objectStore(C).clear();n.onerror=()=>{console.error(`Failed to clear ${C}:`,n.error),i=!0,r()},n.onsuccess=()=>{console.log(`${C} cleared`),r()}})})}async deleteFile(A){return this.initialized||await this.initialize(),new Promise((g,t)=>{const i=this.db.transaction(["files"],"readwrite").objectStore("files").delete(A);i.onerror=()=>{console.error("Failed to delete file:",i.error),t(i.error)},i.onsuccess=()=>{console.log(`File ${A} deleted`),g()}})}async getStorageInfo(){this.initialized||await this.initialize();const A=["configs","files","temp_data"],g={};for(const I of A){const o=await new Promise((i,r)=>{const n=this.db.transaction([I],"readonly").objectStore(I).count();n.onerror=()=>r(n.error),n.onsuccess=()=>i(n.result)});g[I]={count:o}}const t=await this.loadConfig();return g.lastSaved=t?new Date(t.timestamp):null,g}async hasStoredConfig(){try{return await this.loadConfig()!==null}catch(A){return console.error("Error checking config:",A),!1}}fileToArrayBuffer(A){return new Promise((g,t)=>{const I=new FileReader;I.onload=()=>g(I.result),I.onerror=()=>t(new Error("Failed to read file")),I.readAsArrayBuffer(A)})}close(){this.db&&(this.db.close(),this.db=null,this.initialized=!1,console.log("IndexedDB connection closed"))}}const cA=new Jo;class Ie{static async saveFontFile(A,g={}){if(A){const t="custom_font";try{await cA.saveFile(t,A,"font",{size:g.size||20,bpp:g.bpp||4,charset:g.charset||"deepseek"}),console.log(`Font file saved: ${A.name}`)}catch(I){console.warn(`Failed to save font file: ${A.name}`,I)}}}static async saveEmojiFile(A,g,t={}){var I,o;if(g&&A){const i=A.startsWith("hash_")?A:`emoji_${A}`;try{const r=((I=t==null?void 0:t.size)==null?void 0:I.width)??64,C=((o=t==null?void 0:t.size)==null?void 0:o.height)??64;await cA.saveFile(i,g,"emoji",{name:A,size:{width:r,height:C},format:t==null?void 0:t.format,emotions:t==null?void 0:t.emotions}),console.log(`Expression file saved: ${i} - ${g.name}`)}catch(r){console.warn(`Failed to save expression file: ${A}`,r)}}}static async saveBackgroundFile(A,g,t={}){if(g&&A){const I=`background_${A}`;try{let o={};try{o=t?JSON.parse(JSON.stringify(t)):{}}catch{o={...t}}await cA.saveFile(I,g,"background",{mode:A,...o}),console.log(`Background file saved: ${A} - ${g.name}`)}catch(o){console.warn(`Failed to save background file: ${A}`,o)}}}static async restoreFontFile(){try{return await cA.loadFile("custom_font")}catch(A){return console.warn("Failed to restore font file:",A),null}}static async restoreEmojiFile(A){if(!A)return null;try{const g=A.startsWith("hash_")?A:`emoji_${A}`;return await cA.loadFile(g)}catch(g){return console.warn(`Failed to restore expression file: ${A}`,g),null}}static async restoreBackgroundFile(A){if(!A)return null;try{const g=`background_${A}`;return await cA.loadFile(g)}catch(g){return console.warn(`Failed to restore background file: ${A}`,g),null}}static async deleteFontFile(){try{await cA.deleteFile("custom_font"),console.log("Font file deleted")}catch(A){console.warn("Failed to delete font file:",A)}}static async deleteEmojiFile(A){if(A)try{const g=A.startsWith("hash_")?A:`emoji_${A}`;await cA.deleteFile(g),console.log(`Expression file deleted: ${g}`)}catch(g){console.warn(`Failed to delete expression file: ${A}`,g)}}static async deleteBackgroundFile(A){if(A)try{const g=`background_${A}`;await cA.deleteFile(g),console.log(`Background file deleted: ${A}`)}catch(g){console.warn(`Failed to delete background file: ${A}`,g)}}static async getStorageInfo(){try{return await cA.getStorageInfo()}catch(A){return console.warn("Failed to get storage info:",A),{configs:{count:0},files:{count:0},temp_data:{count:0},lastSaved:null}}}static async clearAllFiles(){try{await cA.clearAll(),console.log("All storage files cleaned")}catch(A){throw console.warn("Failed to clean up storage files:",A),A}}}const xo={class:"space-y-6"},Ho={class:"text-lg font-medium text-gray-900 mb-2"},Yo={class:"text-gray-600"},Ko={class:"space-y-4"},To={class:"flex space-x-4"},Vo={key:0,class:"space-y-4"},qo={class:"bg-gray-50 border border-gray-200 rounded-lg p-6 text-center"},Oo={class:"mt-2 text-gray-600"},Wo={key:1,class:"space-y-4"},Po={class:"font-medium text-gray-900"},Zo={class:"grid grid-cols-1 md:grid-cols-4 gap-4"},Xo=["onClick"],jo={class:"flex items-start justify-between"},zo={class:"flex-1"},_o={class:"font-medium text-gray-900 mb-1"},$o={class:"text-sm text-gray-600 space-y-1"},Ai={key:0,class:"flex-shrink-0 ml-3"},ei={key:2,class:"space-y-6"},gi={class:"font-medium text-gray-900"},ti={class:"space-y-2"},Ii={class:"block text-sm font-medium text-gray-700"},oi={key:0},ii={class:"mt-2"},ri={class:"text-gray-500"},Ci={class:"text-xs text-gray-400 mt-1"},ni={key:1,class:"text-green-600"},Bi={class:"mt-1 font-medium"},ai={key:0,class:"grid grid-cols-1 md:grid-cols-3 gap-4"},si={class:"block text-sm font-medium text-gray-700 mb-2"},Qi={class:"text-xs text-gray-500 mt-1"},Ei={class:"block text-sm font-medium text-gray-700 mb-2"},li={value:1},ci={value:2},hi={value:4},ui={class:"block text-sm font-medium text-gray-700 mb-2"},di={value:"qwen"},fi={value:"deepseek"},wi={value:"latin"},pi={value:"full"},yi={class:"flex items-center justify-between p-4 bg-gray-50 rounded-lg border border-gray-200"},Di={class:"flex-1"},mi={class:"font-medium text-gray-900"},Fi={class:"text-sm text-gray-500 mt-1"},ki={class:"ml-4"},vi={class:"relative inline-flex items-center cursor-pointer"},Si=["checked"],Gi={__name:"FontConfig",props:{modelValue:{type:Object,required:!0}},emits:["update:modelValue"],setup(e,{emit:A}){const{t:g}=TA(),t=e,I=A,o=j(null),i=[{id:"font_puhui_deepseek_14_1",size:14,bpp:1,fileSize:"~180KB"},{id:"font_puhui_deepseek_16_4",size:16,bpp:4,fileSize:"~720KB"},{id:"font_puhui_deepseek_20_4",size:20,bpp:4,fileSize:"~1.1MB"},{id:"font_puhui_deepseek_30_4",size:30,bpp:4,fileSize:"~2.5MB"},{id:"font_noto_qwen_14_1",size:14,bpp:1,fileSize:"~626KB"},{id:"font_noto_qwen_16_4",size:16,bpp:4,fileSize:"~2.0MB"},{id:"font_noto_qwen_20_4",size:20,bpp:4,fileSize:"~2.9MB"},{id:"font_noto_qwen_30_4",size:30,bpp:4,fileSize:"~5.8MB"}],r=nA(()=>i.map(u=>{let l;return u.id.startsWith("font_puhui_deepseek_")?l=g("fontConfig.charsetDeepseek"):u.id.startsWith("font_noto_qwen_")&&(l=g("fontConfig.charsetQwen")),{...u,name:g("fontConfig.presetFontNames."+u.id),charset:l}})),C=j({size:20,bpp:4,charset:"qwen"}),B=u=>{I("update:modelValue",{...t.modelValue,type:u,preset:u==="preset"?t.modelValue.preset||"font_puhui_deepseek_20_4":"",custom:{...t.modelValue.custom,file:t.modelValue.custom.file||null}})},n=u=>{I("update:modelValue",{...t.modelValue,preset:u,custom:{...t.modelValue.custom,file:t.modelValue.custom.file||null}})},Q=u=>{const l=u.target.files[0];l&&E(l)},s=u=>{u.preventDefault();const l=u.dataTransfer.files;l.length>0&&E(l[0])},E=async u=>{u&&(u.type.includes("font")||u.name.toLowerCase().match(/\.(ttf|woff|woff2)$/))?(I("update:modelValue",{...t.modelValue,custom:{...t.modelValue.custom,file:u,...C.value}}),await Ie.saveFontFile(u,C.value)):alert(g("fontConfig.selectValidFontFile"))},h=async()=>{I("update:modelValue",{...t.modelValue,custom:{...t.modelValue.custom,file:null}}),o.value&&(o.value.value=""),await Ie.deleteFontFile()},w=j(!1);return DA(()=>C.value,u=>{w.value||t.modelValue.type==="custom"&&t.modelValue.custom.file&&I("update:modelValue",{...t.modelValue,custom:{...t.modelValue.custom,...u}})},{deep:!0}),DA(()=>t.modelValue.custom,u=>{u.size&&u.bpp&&u.charset&&(w.value=!0,C.value={size:u.size,bpp:u.bpp,charset:u.charset},nt(()=>{w.value=!1}))},{deep:!0,immediate:!0}),(u,l)=>{var f;return G(),U("div",xo,[a("div",null,[a("h3",Ho,d(u.$t("fontConfig.title")),1),a("p",Yo,d(u.$t("fontConfig.description")),1)]),a("div",Ko,[a("div",To,[a("button",{onClick:l[0]||(l[0]=c=>B("none")),class:gA(["px-4 py-2 border rounded-lg transition-colors",e.modelValue.type==="none"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(u.$t("fontConfig.noFonts")),3),a("button",{onClick:l[1]||(l[1]=c=>B("preset")),class:gA(["px-4 py-2 border rounded-lg transition-colors",e.modelValue.type==="preset"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(u.$t("fontConfig.presetFonts")),3),a("button",{onClick:l[2]||(l[2]=c=>B("custom")),class:gA(["px-4 py-2 border rounded-lg transition-colors",e.modelValue.type==="custom"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(u.$t("fontConfig.customFonts")),3)])]),e.modelValue.type==="none"?(G(),U("div",Vo,[a("div",qo,[l[10]||(l[10]=a("svg",{class:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)),a("p",Oo,d(u.$t("fontConfig.noFontsDescription")),1)])])):O("",!0),e.modelValue.type==="preset"?(G(),U("div",Wo,[a("h4",Po,d(u.$t("fontConfig.presetFonts")),1),a("div",Zo,[(G(!0),U(bA,null,LA(r.value,c=>(G(),U("div",{key:c.id,onClick:D=>n(c.id),class:gA(["border-2 rounded-lg p-4 cursor-pointer transition-all",e.modelValue.preset===c.id?"border-primary-500 bg-primary-50":"border-gray-200 hover:border-gray-300"])},[a("div",jo,[a("div",zo,[a("h5",_o,d(c.name),1),a("div",$o,[a("div",null,d(u.$t("fontConfig.fontSize"))+" "+d(c.size)+"px",1),a("div",null,d(u.$t("fontConfig.bitDepth"))+" "+d(c.bpp)+"bpp",1),a("div",null,d(u.$t("fontConfig.charset"))+" "+d(c.charset),1),a("div",null,d(u.$t("fontConfig.fileSize"))+" "+d(c.fileSize),1)])]),e.modelValue.preset===c.id?(G(),U("div",Ai,[...l[11]||(l[11]=[a("div",{class:"w-5 h-5 bg-primary-500 rounded-full flex items-center justify-center"},[a("svg",{class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},[a("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})])],-1)])])):O("",!0)])],10,Xo))),128))])])):O("",!0),e.modelValue.type==="custom"?(G(),U("div",ei,[a("h4",gi,d(u.$t("fontConfig.customFonts")),1),a("div",ti,[a("label",Ii,d(u.$t("fontConfig.fontFile")),1),a("div",{onDrop:s,onDragover:l[4]||(l[4]=PA(()=>{},["prevent"])),onDragenter:l[5]||(l[5]=PA(()=>{},["prevent"])),class:"border-2 border-dashed border-gray-300 rounded-lg p-6 text-center hover:border-gray-400 transition-colors"},[a("input",{ref_key:"fileInput",ref:o,type:"file",accept:".ttf,.woff,.woff2",onChange:Q,class:"hidden"},null,544),e.modelValue.custom.file?(G(),U("div",ni,[l[13]||(l[13]=a("svg",{class:"mx-auto h-8 w-8",fill:"currentColor",viewBox:"0 0 20 20"},[a("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1)),a("p",Bi,d((f=e.modelValue.custom.file)==null?void 0:f.name),1),a("button",{onClick:h,class:"text-red-600 hover:text-red-500 text-sm mt-1"},d(u.$t("fontConfig.removeFile")),1)])):(G(),U("div",oi,[l[12]||(l[12]=a("svg",{class:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})],-1)),a("div",ii,[a("button",{onClick:l[3]||(l[3]=c=>u.$refs.fileInput.click()),class:"text-primary-600 hover:text-primary-500 font-medium"},d(u.$t("fontConfig.clickSelectFontFile")),1),a("p",ri,d(u.$t("fontConfig.orDragFileHere")),1)]),a("p",Ci,d(u.$t("fontConfig.supportedFormats")),1)]))],32)]),e.modelValue.custom.file?(G(),U("div",ai,[a("div",null,[a("label",si,d(u.$t("fontConfig.fontSizePx")),1),rA(a("input",{type:"number","onUpdate:modelValue":l[6]||(l[6]=c=>C.value.size=c),min:"8",max:"80",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},null,512),[[sA,C.value.size,void 0,{number:!0}]]),a("p",Qi,d(u.$t("fontConfig.range"))+" 8-80px",1)]),a("div",null,[a("label",Ei,d(u.$t("fontConfig.bitDepthBpp")),1),rA(a("select",{"onUpdate:modelValue":l[7]||(l[7]=c=>C.value.bpp=c),class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},[a("option",li,d(u.$t("fontConfig.monochrome")),1),a("option",ci,d(u.$t("fontConfig.fourColors")),1),a("option",hi,d(u.$t("fontConfig.sixteenColors")),1)],512),[[Xe,C.value.bpp]])]),a("div",null,[a("label",ui,d(u.$t("fontConfig.characterSet")),1),rA(a("select",{"onUpdate:modelValue":l[8]||(l[8]=c=>C.value.charset=c),class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},[a("option",di,d(u.$t("fontConfig.qwen18409")),1),a("option",fi,d(u.$t("fontConfig.deepseekR1")),1),a("option",wi,d(u.$t("fontConfig.latin1")),1),a("option",pi,d(u.$t("fontConfig.fullCharset")),1)],512),[[Xe,C.value.charset]])])])):O("",!0)])):O("",!0),a("div",yi,[a("div",Di,[a("h4",mi,d(u.$t("fontConfig.hideSubtitle")),1),a("p",Fi,d(u.$t("fontConfig.hideSubtitleDescription")),1)]),a("div",ki,[a("label",vi,[a("input",{type:"checkbox",checked:e.modelValue.hide_subtitle,onChange:l[9]||(l[9]=c=>I("update:modelValue",{...e.modelValue,hide_subtitle:c.target.checked})),class:"sr-only peer"},null,40,Si),l[14]||(l[14]=a("div",{class:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-primary-500"},null,-1))])])])])}}},Ri={class:"space-y-6"},Ui={class:"text-lg font-medium text-gray-900 mb-2"},Ni={class:"text-gray-600"},bi={class:"space-y-4"},Li={class:"flex flex-wrap gap-3"},Mi={key:0,class:"text-sm text-gray-500"},Ji={key:0,class:"space-y-4"},xi={class:"font-medium text-gray-900"},Hi={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Yi=["onClick"],Ki={class:"flex items-start justify-between mb-3"},Ti={class:"font-medium text-gray-900"},Vi={class:"text-sm text-gray-600"},qi={class:"text-xs text-gray-500 mt-1"},Oi={key:0,class:"flex-shrink-0 ml-3"},Wi={class:"grid grid-cols-7 gap-1 justify-items-center overflow-hidden"},Pi=["src","alt"],Zi={key:1,class:"space-y-6"},Xi={class:"font-medium text-gray-900"},ji={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},zi={class:"block text-sm font-medium text-gray-700 mb-2"},_i={class:"block text-sm font-medium text-gray-700 mb-2"},$i={class:"space-y-4"},Ar={class:"font-medium text-gray-900"},er={class:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-7 gap-4"},gr={class:"text-center"},tr={class:"text-lg mb-1"},Ir={class:"text-xs text-gray-600 flex items-center justify-center gap-1"},or={key:0,class:"text-red-500"},ir=["onDrop"],rr=["onChange"],Cr=["onClick"],nr={class:"text-xs text-gray-500"},Br={key:1,class:"w-full h-full relative"},ar=["src","alt"],sr=["onClick"],Qr={class:"text-xs text-gray-500 mt-2"},Er={__name:"EmojiConfig",props:{modelValue:{type:Object,required:!0}},emits:["update:modelValue"],setup(e,{emit:A}){const{t:g}=TA(),t=e,I=A,o=async f=>{const c=await f.arrayBuffer(),D=await crypto.subtle.digest("SHA-256",c);return Array.from(new Uint8Array(D)).map(N=>N.toString(16).padStart(2,"0")).join("")},i=[{id:"twemoji32",name:g("emojiConfig.twitterEmojiName",{size:32}),description:g("emojiConfig.twitterEmojiDescription",{size:32}),size:32,format:"png",preview:["neutral","happy","laughing","funny","sad","angry","crying"]},{id:"twemoji64",name:g("emojiConfig.twitterEmojiName",{size:64}),description:g("emojiConfig.twitterEmojiDescription",{size:64}),size:64,format:"png",preview:["neutral","happy","laughing","funny","sad","angry","crying"]},{id:"noto-emoji_64",name:g("emojiConfig.notoEmojiName",{size:64}),description:g("emojiConfig.notoEmojiDescription",{size:64}),size:64,format:"gif",preview:["neutral","happy","laughing","funny","sad","angry","crying"]},{id:"noto-emoji_128",name:g("emojiConfig.notoEmojiName",{size:128}),description:g("emojiConfig.notoEmojiDescription",{size:128}),size:128,format:"gif",preview:["neutral","happy","laughing","funny","sad","angry","crying"]}],r=nA(()=>[{key:"neutral",name:g("emojiConfig.emotions.neutral"),emoji:"😶"},{key:"happy",name:g("emojiConfig.emotions.happy"),emoji:"🙂"},{key:"laughing",name:g("emojiConfig.emotions.laughing"),emoji:"😆"},{key:"funny",name:g("emojiConfig.emotions.funny"),emoji:"😂"},{key:"sad",name:g("emojiConfig.emotions.sad"),emoji:"😔"},{key:"angry",name:g("emojiConfig.emotions.angry"),emoji:"😠"},{key:"crying",name:g("emojiConfig.emotions.crying"),emoji:"😭"},{key:"loving",name:g("emojiConfig.emotions.loving"),emoji:"😍"},{key:"embarrassed",name:g("emojiConfig.emotions.embarrassed"),emoji:"😳"},{key:"surprised",name:g("emojiConfig.emotions.surprised"),emoji:"😯"},{key:"shocked",name:g("emojiConfig.emotions.shocked"),emoji:"😱"},{key:"thinking",name:g("emojiConfig.emotions.thinking"),emoji:"🤔"},{key:"winking",name:g("emojiConfig.emotions.winking"),emoji:"😉"},{key:"cool",name:g("emojiConfig.emotions.cool"),emoji:"😎"},{key:"relaxed",name:g("emojiConfig.emotions.relaxed"),emoji:"😌"},{key:"delicious",name:g("emojiConfig.emotions.delicious"),emoji:"🤤"},{key:"kissy",name:g("emojiConfig.emotions.kissy"),emoji:"😘"},{key:"confident",name:g("emojiConfig.emotions.confident"),emoji:"😏"},{key:"sleepy",name:g("emojiConfig.emotions.sleepy"),emoji:"😴"},{key:"silly",name:g("emojiConfig.emotions.silly"),emoji:"😜"},{key:"confused",name:g("emojiConfig.emotions.confused"),emoji:"🙄"}]),C=j({size:{width:32,height:32}}),B=f=>{if(t.modelValue.type===f)return;const c={...t.modelValue,type:f};f==="none"?(c.preset="",c.custom={...t.modelValue.custom,images:t.modelValue.custom.images||{}}):f==="preset"?(c.preset=t.modelValue.preset||"twemoji32",c.custom={...t.modelValue.custom,images:t.modelValue.custom.images||{}}):f==="custom"&&(c.preset="",c.custom={...t.modelValue.custom,images:t.modelValue.custom.images||{}}),I("update:modelValue",c)},n=f=>{t.modelValue.preset!==f&&I("update:modelValue",{...t.modelValue,preset:f,custom:{...t.modelValue.custom,images:t.modelValue.custom.images||{}}})},Q=(f,c)=>{const D=f.target.files[0];D&&E(c,D)},s=(f,c)=>{f.preventDefault();const D=f.dataTransfer.files;D.length>0&&E(c,D[0])},E=async(f,c)=>{const D=["png","gif"],p=c.name.split(".").pop().toLowerCase();if(!D.includes(p)){alert(g("emojiConfig.selectValidFormat"));return}const v=await o(c),N=t.modelValue.custom||{},L={...N.fileMap||{}},X={...N.emotionMap||{}},k={...N.images||{}};let m=[];for(const[M,oA]of Object.entries(X))oA===v&&M!==f&&m.push(M);m.length>0&&console.log(g("emojiConfig.sharedFileMessage",{emotionKey:f,existingEmotions:m.join(", ")})),L[v]=c,X[f]=v,k[f]=c,I("update:modelValue",{...t.modelValue,custom:{...N,size:C.value.size,images:k,fileMap:L,emotionMap:X}}),await Ie.saveEmojiFile(`hash_${v}`,c,{size:C.value.size,format:p,emotions:[...m,f]})},h=async f=>{const c=t.modelValue.custom||{},D={...c.images},p={...c.emotionMap||{}},v={...c.fileMap||{}},N=p[f];delete D[f],delete p[f],Object.values(p).filter(X=>X===N).length===0&&N?(delete v[N],await Ie.deleteEmojiFile(`hash_${N}`),console.log(g("emojiConfig.fileDeleted",{fileHash:N}))):console.log(g("emojiConfig.fileRetained",{fileHash:N})),I("update:modelValue",{...t.modelValue,custom:{...c,images:D,emotionMap:p,fileMap:v}})},w=(f,c)=>{const D=i.find(v=>v.id===f),p=(D==null?void 0:D.format)||"png";return`./static/emojis/${f}/${c}.${p}`},u=f=>{if(t.modelValue.type==="preset")return w(t.modelValue.preset,f);{const c=t.modelValue.custom.images[f];return c instanceof File||c instanceof Blob?URL.createObjectURL(c):null}},l=f=>{console.warn(g("emojiConfig.imageLoadFailed"),f.target.src),f.target.style.display="none"};return DA(()=>C.value.size,f=>{if(t.modelValue.type==="custom"){const c=t.modelValue.custom;JSON.stringify(c.size)!==JSON.stringify(f)&&I("update:modelValue",{...t.modelValue,custom:{...c,size:f}})}},{deep:!0}),t.modelValue.custom.size&&(C.value={size:{...t.modelValue.custom.size}}),(f,c)=>(G(),U("div",Ri,[a("div",null,[a("h3",Ui,d(f.$t("emojiConfig.title")),1),a("p",Ni,d(f.$t("emojiConfig.description")),1)]),a("div",bi,[a("div",Li,[a("button",{onClick:c[0]||(c[0]=D=>B("none")),class:gA(["px-4 py-2 border rounded-lg transition-colors",e.modelValue.type==="none"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(f.$t("emojiConfig.noEmojiPack")),3),a("button",{onClick:c[1]||(c[1]=D=>B("preset")),class:gA(["px-4 py-2 border rounded-lg transition-colors",e.modelValue.type==="preset"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(f.$t("emojiConfig.presetEmojiPack")),3),a("button",{onClick:c[2]||(c[2]=D=>B("custom")),class:gA(["px-4 py-2 border rounded-lg transition-colors",e.modelValue.type==="custom"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(f.$t("emojiConfig.customEmojiPack")),3)]),e.modelValue.type==="none"?(G(),U("p",Mi,d(f.$t("emojiConfig.noEmojiPackDescription")),1)):O("",!0)]),e.modelValue.type==="preset"?(G(),U("div",Ji,[a("h4",xi,d(f.$t("emojiConfig.selectPresetEmojiPack")),1),a("div",Hi,[(G(),U(bA,null,LA(i,D=>a("div",{key:D.id,onClick:p=>n(D.id),class:gA(["border-2 rounded-lg p-4 cursor-pointer transition-all",e.modelValue.preset===D.id?"border-primary-500 bg-primary-50":"border-gray-200 hover:border-gray-300"])},[a("div",Ki,[a("div",null,[a("h5",Ti,d(D.name),1),a("p",Vi,d(D.description),1),a("div",qi,d(f.$t("emojiConfig.size"))+": "+d(D.size)+"px × "+d(D.size)+"px ",1)]),e.modelValue.preset===D.id?(G(),U("div",Oi,[...c[7]||(c[7]=[a("div",{class:"w-5 h-5 bg-primary-500 rounded-full flex items-center justify-center"},[a("svg",{class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},[a("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})])],-1)])])):O("",!0)]),a("div",Wi,[(G(!0),U(bA,null,LA(D.preview,p=>(G(),U("div",{key:p,style:CA({width:D.size+"px",height:D.size+"px"}),class:"bg-gray-100 rounded flex items-center justify-center"},[a("img",{src:w(D.id,p),alt:p,style:CA({width:D.size+"px",height:D.size+"px"}),class:"object-contain rounded",onError:l},null,44,Pi)],4))),128))])],10,Yi)),64))])])):O("",!0),e.modelValue.type==="custom"?(G(),U("div",Zi,[a("h4",Xi,d(f.$t("emojiConfig.customEmojiPackConfig")),1),a("div",ji,[a("div",null,[a("label",zi,d(f.$t("emojiConfig.maxImageWidth")),1),rA(a("input",{type:"number","onUpdate:modelValue":c[3]||(c[3]=D=>C.value.size.width=D),min:"16",max:"200",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},null,512),[[sA,C.value.size.width,void 0,{number:!0}]])]),a("div",null,[a("label",_i,d(f.$t("emojiConfig.maxImageHeight")),1),rA(a("input",{type:"number","onUpdate:modelValue":c[4]||(c[4]=D=>C.value.size.height=D),min:"16",max:"200",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},null,512),[[sA,C.value.size.height,void 0,{number:!0}]])])]),a("div",$i,[a("h5",Ar,d(f.$t("emojiConfig.uploadEmojiImages")),1),a("div",er,[(G(!0),U(bA,null,LA(r.value,D=>(G(),U("div",{key:D.key,class:"space-y-2"},[a("div",gr,[a("div",tr,d(D.emoji),1),a("div",Ir,[a("span",null,d(D.name),1),D.key==="neutral"?(G(),U("span",or,d(f.$t("emojiConfig.required")),1)):O("",!0)])]),a("div",{onDrop:p=>s(p,D.key),onDragover:c[5]||(c[5]=PA(()=>{},["prevent"])),onDragenter:c[6]||(c[6]=PA(()=>{},["prevent"])),class:gA(["border-2 border-dashed rounded-lg p-2 text-center cursor-pointer transition-colors aspect-square flex flex-col items-center justify-center",e.modelValue.custom.images[D.key]?"border-green-300 bg-green-50":D.key==="neutral"?"border-red-300 bg-red-50":"border-gray-300 hover:border-gray-400"])},[a("input",{ref_for:!0,ref:D.key+"Input",type:"file",accept:".png,.gif",onChange:p=>Q(p,D.key),class:"hidden"},null,40,rr),e.modelValue.custom.images[D.key]?(G(),U("div",Br,[u(D.key)?(G(),U("img",{key:0,src:u(D.key),alt:D.name,class:"w-full h-full object-cover rounded",onError:l},null,40,ar)):O("",!0),a("button",{onClick:p=>h(D.key),class:"absolute -top-1 -right-1 w-4 h-4 bg-red-500 text-white rounded-full flex items-center justify-center text-xs hover:bg-red-600"}," × ",8,sr)])):(G(),U("div",{key:0,onClick:p=>{var v;return(v=f.$refs[D.key+"Input"][0])==null?void 0:v.click()}},[c[8]||(c[8]=a("svg",{class:"w-6 h-6 text-gray-400 mx-auto mb-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})],-1)),a("div",nr,d(f.$t("emojiConfig.clickToUploadOrDrag")),1)],8,Cr))],42,ir)]))),128))]),a("div",Qr,d(f.$t("emojiConfig.neutralRequiredNotice")),1)])])):O("",!0)]))}},lr={class:"space-y-6"},cr={class:"text-lg font-medium text-gray-900 mb-2"},hr={class:"text-gray-600"},ur={class:"space-y-4"},dr={class:"font-medium text-gray-900 flex items-center"},fr={class:"border border-gray-200 rounded-lg p-4 space-y-4"},wr={class:"flex space-x-4"},pr={key:0,class:"space-y-3"},yr={class:"flex items-center space-x-3"},Dr={class:"text-sm font-medium text-gray-700"},mr={class:"flex items-center space-x-2"},Fr={class:"flex items-center space-x-3"},kr={class:"text-sm font-medium text-gray-700"},vr={class:"flex items-center space-x-2"},Sr={key:1,class:"space-y-3"},Gr={class:"text-sm font-medium text-gray-700"},Rr={class:"mt-1 text-sm text-gray-600"},Ur={key:1,class:"space-y-2"},Nr=["src"],br={class:"text-sm text-green-700 font-medium"},Lr={class:"flex items-center space-x-3"},Mr={class:"text-sm font-medium text-gray-700"},Jr={class:"flex items-center space-x-2"},xr={class:"space-y-4"},Hr={class:"font-medium text-gray-900 flex items-center"},Yr={class:"border border-gray-200 rounded-lg p-4 space-y-4"},Kr={class:"flex space-x-4"},Tr={key:0,class:"space-y-3"},Vr={class:"flex items-center space-x-3"},qr={class:"text-sm font-medium text-gray-700"},Or={class:"flex items-center space-x-2"},Wr={class:"flex items-center space-x-3"},Pr={class:"text-sm font-medium text-gray-700"},Zr={class:"flex items-center space-x-2"},Xr={key:1,class:"space-y-3"},jr={class:"text-sm font-medium text-gray-700"},zr={class:"mt-1 text-sm text-gray-600"},_r={key:1,class:"space-y-2"},$r=["src"],AC={class:"text-sm text-green-700 font-medium"},eC={class:"flex items-center space-x-3"},gC={class:"text-sm font-medium text-gray-700"},tC={class:"flex items-center space-x-2"},IC={class:"space-y-4"},oC={class:"font-medium text-gray-900"},iC={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},rC={class:"space-y-2"},CC={class:"text-sm font-medium text-gray-700"},nC={class:"absolute inset-0 bg-white bg-opacity-10 flex items-center justify-center rounded-lg"},BC={class:"space-y-2"},aC={class:"text-sm font-medium text-gray-700"},sC={class:"absolute inset-0 bg-black bg-opacity-10 flex items-center justify-center rounded-lg"},QC={class:"bg-blue-50 border border-blue-200 rounded-lg p-4"},EC={class:"font-medium text-blue-900 mb-2"},lC={class:"flex flex-wrap gap-2"},cC={__name:"BackgroundConfig",props:{modelValue:{type:Object,required:!0}},emits:["update:modelValue"],setup(e,{emit:A}){const{t:g}=TA(),t=e,I=A,o=j(null),i=j(null),r=nA({get:()=>t.modelValue.light.backgroundColor,set:k=>E(k)}),C=nA({get:()=>t.modelValue.dark.backgroundColor,set:k=>h(k)}),B=nA({get:()=>t.modelValue.light.textColor,set:k=>w(k)}),n=nA({get:()=>t.modelValue.dark.textColor,set:k=>u(k)}),Q=k=>{I("update:modelValue",{...t.modelValue,light:{...t.modelValue.light,backgroundType:k,backgroundImage:k==="image"?t.modelValue.light.backgroundImage:null}})},s=k=>{I("update:modelValue",{...t.modelValue,dark:{...t.modelValue.dark,backgroundType:k,backgroundImage:k==="image"?t.modelValue.dark.backgroundImage:null}})},E=k=>{I("update:modelValue",{...t.modelValue,light:{...t.modelValue.light,backgroundColor:k}})},h=k=>{I("update:modelValue",{...t.modelValue,dark:{...t.modelValue.dark,backgroundColor:k}})},w=k=>{I("update:modelValue",{...t.modelValue,light:{...t.modelValue.light,textColor:k}})},u=k=>{I("update:modelValue",{...t.modelValue,dark:{...t.modelValue.dark,textColor:k}})},l=(k,m)=>{const M=k.target.files[0];M&&c(m,M)},f=(k,m)=>{k.preventDefault();const M=k.dataTransfer.files;M.length>0&&c(m,M[0])},c=async(k,m)=>{m&&m.type.startsWith("image/")?(I("update:modelValue",{...t.modelValue,[k]:{...t.modelValue[k],backgroundImage:m}}),await Ie.saveBackgroundFile(k,m)):alert(g("backgroundConfig.selectValidImage"))},D=async k=>{I("update:modelValue",{...t.modelValue,[k]:{...t.modelValue[k],backgroundImage:null}}),k==="light"&&o.value&&(o.value.value=""),k==="dark"&&i.value&&(i.value.value=""),await Ie.deleteBackgroundFile(k)},p=k=>{const m=t.modelValue[k].backgroundImage;return m?URL.createObjectURL(m):null},v=()=>t.modelValue.light.backgroundType==="image"&&t.modelValue.light.backgroundImage?{backgroundImage:`url(${p("light")})`,backgroundSize:"cover",backgroundPosition:"center"}:{backgroundColor:t.modelValue.light.backgroundColor},N=()=>t.modelValue.dark.backgroundType==="image"&&t.modelValue.dark.backgroundImage?{backgroundImage:`url(${p("dark")})`,backgroundSize:"cover",backgroundPosition:"center"}:{backgroundColor:t.modelValue.dark.backgroundColor},L=(k,m)=>{const M=X(k)?"#000000":"#ffffff",oA=X(m)?"#000000":"#ffffff";I("update:modelValue",{...t.modelValue,light:{...t.modelValue.light,backgroundType:"color",backgroundColor:k,textColor:M,backgroundImage:null},dark:{...t.modelValue.dark,backgroundType:"color",backgroundColor:m,textColor:oA,backgroundImage:null}})},X=k=>{const m=k.replace("#",""),M=parseInt(m.substr(0,2),16),oA=parseInt(m.substr(2,2),16),F=parseInt(m.substr(4,2),16);return(M*299+oA*587+F*114)/1e3>128};return(k,m)=>(G(),U("div",lr,[a("div",null,[a("h3",cr,d(k.$t("backgroundConfig.title")),1),a("p",hr,d(k.$t("backgroundConfig.description")),1)]),a("div",ur,[a("h4",dr,[m[33]||(m[33]=a("svg",{class:"w-5 h-5 mr-2 text-yellow-500",fill:"currentColor",viewBox:"0 0 20 20"},[a("path",{"fill-rule":"evenodd",d:"M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z","clip-rule":"evenodd"})],-1)),HA(" "+d(k.$t("backgroundConfig.lightMode")),1)]),a("div",fr,[a("div",wr,[a("button",{onClick:m[0]||(m[0]=M=>Q("color")),class:gA(["px-3 py-2 text-sm border rounded transition-colors",e.modelValue.light.backgroundType==="color"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(k.$t("backgroundConfig.solidBackground")),3),a("button",{onClick:m[1]||(m[1]=M=>Q("image")),class:gA(["px-3 py-2 text-sm border rounded transition-colors",e.modelValue.light.backgroundType==="image"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(k.$t("backgroundConfig.imageBackground")),3)]),e.modelValue.light.backgroundType==="color"?(G(),U("div",pr,[a("div",yr,[a("label",Dr,d(k.$t("backgroundConfig.backgroundColor")),1),a("div",mr,[rA(a("input",{type:"color","onUpdate:modelValue":m[2]||(m[2]=M=>r.value=M),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[sA,r.value]]),rA(a("input",{type:"text","onUpdate:modelValue":m[3]||(m[3]=M=>r.value=M),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[sA,r.value]])]),a("div",{style:CA({backgroundColor:r.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)]),a("div",Fr,[a("label",kr,d(k.$t("backgroundConfig.textColor")),1),a("div",vr,[rA(a("input",{type:"color","onUpdate:modelValue":m[4]||(m[4]=M=>B.value=M),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[sA,B.value]]),rA(a("input",{type:"text","onUpdate:modelValue":m[5]||(m[5]=M=>B.value=M),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[sA,B.value]])]),a("div",{style:CA({backgroundColor:B.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)])])):O("",!0),e.modelValue.light.backgroundType==="image"?(G(),U("div",Sr,[a("label",Gr,d(k.$t("backgroundConfig.backgroundImage")),1),a("div",{onDrop:m[9]||(m[9]=M=>f(M,"light")),onDragover:m[10]||(m[10]=PA(()=>{},["prevent"])),onDragenter:m[11]||(m[11]=PA(()=>{},["prevent"])),class:gA(["border-2 border-dashed rounded-lg p-4 text-center cursor-pointer transition-colors",e.modelValue.light.backgroundImage?"border-green-300 bg-green-50":"border-gray-300 hover:border-gray-400"])},[a("input",{ref_key:"lightImageInput",ref:o,type:"file",accept:"image/*",onChange:m[6]||(m[6]=M=>l(M,"light")),class:"hidden"},null,544),e.modelValue.light.backgroundImage?(G(),U("div",Ur,[a("img",{src:p("light"),alt:"{{ $t('backgroundConfig.lightModePreview') }} Background",class:"max-w-32 max-h-32 mx-auto rounded shadow"},null,8,Nr),a("p",br,d(e.modelValue.light.backgroundImage.name),1),a("button",{onClick:m[8]||(m[8]=M=>D("light")),class:"text-red-600 hover:text-red-500 text-sm"},d(k.$t("backgroundConfig.removeImage")),1)])):(G(),U("div",{key:0,onClick:m[7]||(m[7]=M=>k.$refs.lightImageInput.click())},[m[34]||(m[34]=a("svg",{class:"mx-auto h-8 w-8 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),a("p",Rr,d(k.$t("backgroundConfig.clickOrDragToUpload")),1)]))],34),a("div",Lr,[a("label",Mr,d(k.$t("backgroundConfig.textColor")),1),a("div",Jr,[rA(a("input",{type:"color","onUpdate:modelValue":m[12]||(m[12]=M=>B.value=M),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[sA,B.value]]),rA(a("input",{type:"text","onUpdate:modelValue":m[13]||(m[13]=M=>B.value=M),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[sA,B.value]])]),a("div",{style:CA({backgroundColor:B.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)])])):O("",!0)])]),a("div",xr,[a("h4",Hr,[m[35]||(m[35]=a("svg",{class:"w-5 h-5 mr-2 text-gray-600",fill:"currentColor",viewBox:"0 0 20 20"},[a("path",{d:"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"})],-1)),HA(" "+d(k.$t("backgroundConfig.darkMode")),1)]),a("div",Yr,[a("div",Kr,[a("button",{onClick:m[14]||(m[14]=M=>s("color")),class:gA(["px-3 py-2 text-sm border rounded transition-colors",e.modelValue.dark.backgroundType==="color"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(k.$t("backgroundConfig.solidBackground")),3),a("button",{onClick:m[15]||(m[15]=M=>s("image")),class:gA(["px-3 py-2 text-sm border rounded transition-colors",e.modelValue.dark.backgroundType==="image"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},d(k.$t("backgroundConfig.imageBackground")),3)]),e.modelValue.dark.backgroundType==="color"?(G(),U("div",Tr,[a("div",Vr,[a("label",qr,d(k.$t("backgroundConfig.backgroundColor")),1),a("div",Or,[rA(a("input",{type:"color","onUpdate:modelValue":m[16]||(m[16]=M=>C.value=M),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[sA,C.value]]),rA(a("input",{type:"text","onUpdate:modelValue":m[17]||(m[17]=M=>C.value=M),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[sA,C.value]])]),a("div",{style:CA({backgroundColor:C.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)]),a("div",Wr,[a("label",Pr,d(k.$t("backgroundConfig.textColor")),1),a("div",Zr,[rA(a("input",{type:"color","onUpdate:modelValue":m[18]||(m[18]=M=>n.value=M),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[sA,n.value]]),rA(a("input",{type:"text","onUpdate:modelValue":m[19]||(m[19]=M=>n.value=M),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[sA,n.value]])]),a("div",{style:CA({backgroundColor:n.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)])])):O("",!0),e.modelValue.dark.backgroundType==="image"?(G(),U("div",Xr,[a("label",jr,d(k.$t("backgroundConfig.backgroundImage")),1),a("div",{onDrop:m[23]||(m[23]=M=>f(M,"dark")),onDragover:m[24]||(m[24]=PA(()=>{},["prevent"])),onDragenter:m[25]||(m[25]=PA(()=>{},["prevent"])),class:gA(["border-2 border-dashed rounded-lg p-4 text-center cursor-pointer transition-colors",e.modelValue.dark.backgroundImage?"border-green-300 bg-green-50":"border-gray-300 hover:border-gray-400"])},[a("input",{ref_key:"darkImageInput",ref:i,type:"file",accept:"image/*",onChange:m[20]||(m[20]=M=>l(M,"dark")),class:"hidden"},null,544),e.modelValue.dark.backgroundImage?(G(),U("div",_r,[a("img",{src:p("dark"),alt:"{{ $t('backgroundConfig.darkModePreview') }} Background",class:"max-w-32 max-h-32 mx-auto rounded shadow"},null,8,$r),a("p",AC,d(e.modelValue.dark.backgroundImage.name),1),a("button",{onClick:m[22]||(m[22]=M=>D("dark")),class:"text-red-600 hover:text-red-500 text-sm"},d(k.$t("backgroundConfig.removeImage")),1)])):(G(),U("div",{key:0,onClick:m[21]||(m[21]=M=>k.$refs.darkImageInput.click())},[m[36]||(m[36]=a("svg",{class:"mx-auto h-8 w-8 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),a("p",zr,d(k.$t("backgroundConfig.clickOrDragToUpload")),1)]))],34),a("div",eC,[a("label",gC,d(k.$t("backgroundConfig.textColor")),1),a("div",tC,[rA(a("input",{type:"color","onUpdate:modelValue":m[26]||(m[26]=M=>n.value=M),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[sA,n.value]]),rA(a("input",{type:"text","onUpdate:modelValue":m[27]||(m[27]=M=>n.value=M),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[sA,n.value]])]),a("div",{style:CA({backgroundColor:n.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)])])):O("",!0)])]),a("div",IC,[a("h4",oC,d(k.$t("backgroundConfig.backgroundPreview")),1),a("div",iC,[a("div",rC,[a("div",CC,d(k.$t("backgroundConfig.lightModePreview")),1),a("div",{style:CA(v()),class:"h-32 border border-gray-300 rounded-lg flex items-center justify-center text-sm relative overflow-hidden"},[a("div",nC,[a("span",{style:CA({color:e.modelValue.light.textColor})},d(k.$t("backgroundConfig.chatArea")),5)])],4)]),a("div",BC,[a("div",aC,d(k.$t("backgroundConfig.darkModePreview")),1),a("div",{style:CA(N()),class:"h-32 border border-gray-300 rounded-lg flex items-center justify-center text-sm relative overflow-hidden"},[a("div",sC,[a("span",{style:CA({color:e.modelValue.dark.textColor})},d(k.$t("backgroundConfig.chatArea")),5)])],4)])])]),a("div",QC,[a("h5",EC,d(k.$t("backgroundConfig.quickConfig")),1),a("div",lC,[a("button",{onClick:m[28]||(m[28]=M=>L("#ffffff","#1f2937")),class:"px-3 py-1 text-sm bg-white border border-gray-300 rounded hover:bg-gray-50"},d(k.$t("backgroundConfig.defaultColors")),1),a("button",{onClick:m[29]||(m[29]=M=>L("#f5f5f4","#374151")),class:"px-3 py-1 text-sm bg-stone-100 border border-gray-300 rounded hover:bg-stone-200"},d(k.$t("backgroundConfig.stoneTexture")),1),a("button",{onClick:m[30]||(m[30]=M=>L("#fef7cd","#7c2d12")),class:"px-3 py-1 text-sm bg-yellow-100 border border-gray-300 rounded hover:bg-yellow-200"},d(k.$t("backgroundConfig.sunnyColors")),1),a("button",{onClick:m[31]||(m[31]=M=>L("#e0f2fe","#1e40af")),class:"px-3 py-1 text-sm bg-sky-100 border border-gray-300 rounded hover:bg-sky-200"},d(k.$t("backgroundConfig.skyBlue")),1),a("button",{onClick:m[32]||(m[32]=M=>L("#fdf2f8","#be185d")),class:"px-3 py-1 text-sm bg-pink-100 border border-gray-300 rounded hover:bg-pink-200"},d(k.$t("backgroundConfig.romanticPink")),1)])])]))}},hC={class:"space-y-6"},uC={class:"text-xl font-semibold text-gray-900 mb-4"},dC={class:"text-gray-600 mb-6"},fC={class:"border-b border-gray-200"},wC={class:"-mb-px flex space-x-4 sm:space-x-8"},pC=["onClick"],yC={class:"flex items-center"},DC={class:"hidden sm:inline"},mC={class:"min-h-96"},FC={class:"flex justify-between"},kC={__name:"ThemeDesign",props:{modelValue:{type:Object,required:!0},chipModel:{type:String,required:!0},activeTab:{type:String,default:"wakeword"}},emits:["update:modelValue","next","prev","tabChange"],setup(e,{emit:A}){const{t:g}=TA(),t={render(){return eA("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[eA("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"})])}},I={render(){return eA("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 640 640"},[eA("path",{d:"M320 96C329.5 96 338 101.5 341.9 110.2L515.1 496L536 496C549.3 496 560 506.7 560 520C560 533.3 549.3 544 536 544L440 544C426.7 544 416 533.3 416 520C416 506.7 426.7 496 440 496L462.5 496L426.6 416L213.4 416L177.5 496L200 496C213.3 496 224 506.7 224 520C224 533.3 213.3 544 200 544L104 544C90.7 544 80 533.3 80 520C80 506.7 90.7 496 104 496L124.9 496L298.1 110.2C302 101.5 310.5 96 320 96zM320 178.6L235 368L405 368L320 178.6z"})])}},o={render(){return eA("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[eA("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])}},i={render(){return eA("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 640 640"},[eA("path",{d:"M160 144C151.2 144 144 151.2 144 160L144 480C144 488.8 151.2 496 160 496L480 496C488.8 496 496 488.8 496 480L496 160C496 151.2 488.8 144 480 144L160 144zM96 160C96 124.7 124.7 96 160 96L480 96C515.3 96 544 124.7 544 160L544 480C544 515.3 515.3 544 480 544L160 544C124.7 544 96 515.3 96 480L96 160zM224 192C241.7 192 256 206.3 256 224C256 241.7 241.7 256 224 256C206.3 256 192 241.7 192 224C192 206.3 206.3 192 224 192zM360 264C368.5 264 376.4 268.5 380.7 275.8L460.7 411.8C465.1 419.2 465.1 428.4 460.8 435.9C456.5 443.4 448.6 448 440 448L200 448C191.1 448 182.8 443 178.7 435.1C174.6 427.2 175.2 417.6 180.3 410.3L236.3 330.3C240.8 323.9 248.1 320.1 256 320.1C263.9 320.1 271.2 323.9 275.7 330.3L292.9 354.9L339.4 275.9C343.7 268.6 351.6 264.1 360.1 264.1z"})])}},r=e,C=A,B=j(r.activeTab),n=nA(()=>[{id:"wakeword",name:g("themeDesign.tabs.wakeword"),icon:t},{id:"font",name:g("themeDesign.tabs.font"),icon:I},{id:"emoji",name:g("themeDesign.tabs.emoji"),icon:o},{id:"background",name:g("themeDesign.tabs.background"),icon:i}]),Q=nA({get:()=>r.modelValue,set:h=>C("update:modelValue",h)}),s=()=>{var u,l,f;const h=r.modelValue.wakeword;if(h.type==="custom"){if(!((u=h.custom.name)!=null&&u.trim())){alert(g("wakewordConfig.errors.nameRequired"));return}if(!((l=h.custom.command)!=null&&l.trim())){alert(g("wakewordConfig.errors.commandRequired"));return}if(!h.custom.duration||h.custom.duration<500||h.custom.duration>1e4){alert(g("wakewordConfig.errors.durationRange"));return}}const w=r.modelValue.font;if(w.type==="custom"&&!((f=w.custom)!=null&&f.file)){alert(g("fontConfig.selectValidFontFile"));return}C("next")},E=h=>{B.value=h,C("tabChange",h)};return DA(()=>r.activeTab,h=>{B.value=h}),(h,w)=>(G(),U("div",hC,[a("div",null,[a("h2",uC,d(h.$t("themeDesign.title")),1),a("p",dC,d(h.$t("themeDesign.description")),1)]),a("div",fC,[a("nav",wC,[(G(!0),U(bA,null,LA(n.value,u=>(G(),U("button",{key:u.id,onClick:l=>E(u.id),class:gA(["py-2 px-1 border-b-2 font-medium text-sm relative",B.value===u.id?"border-primary-500 text-primary-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"])},[a("span",yC,[(G(),UA(Bt(u.icon),{class:"w-5 h-5 sm:mr-2"})),a("span",DC,d(u.name),1)])],10,pC))),128))])]),a("div",mC,[B.value==="wakeword"?(G(),UA(Mo,{key:0,modelValue:Q.value.wakeword,"onUpdate:modelValue":w[0]||(w[0]=u=>Q.value.wakeword=u),chipModel:e.chipModel},null,8,["modelValue","chipModel"])):O("",!0),B.value==="font"?(G(),UA(Gi,{key:1,modelValue:Q.value.font,"onUpdate:modelValue":w[1]||(w[1]=u=>Q.value.font=u)},null,8,["modelValue"])):O("",!0),B.value==="emoji"?(G(),UA(Er,{key:2,modelValue:Q.value.emoji,"onUpdate:modelValue":w[2]||(w[2]=u=>Q.value.emoji=u)},null,8,["modelValue"])):O("",!0),B.value==="background"?(G(),UA(cC,{key:3,modelValue:Q.value.skin,"onUpdate:modelValue":w[3]||(w[3]=u=>Q.value.skin=u)},null,8,["modelValue"])):O("",!0)]),a("div",FC,[a("button",{onClick:w[4]||(w[4]=u=>h.$emit("prev")),class:"bg-gray-500 hover:bg-gray-600 text-white px-6 py-2 rounded-lg font-medium transition-colors"},d(h.$t("themeDesign.previous")),1),a("button",{onClick:s,class:"bg-primary-500 hover:bg-primary-600 text-white px-6 py-2 rounded-lg font-medium transition-colors"},d(h.$t("themeDesign.next")),1)])]))}},vC=(e,A)=>{const g=e.__vccOpts||e;for(const[t,I]of A)g[t]=I;return g},SC={class:"space-y-6"},GC={class:"text-xl font-semibold text-gray-900 mb-4"},RC={class:"text-gray-600 mb-6"},UC={class:"flex flex-col lg:flex-row gap-8"},NC={class:"flex-1"},bC={class:"text-lg font-medium text-gray-900 mb-4"},LC={class:"bg-gray-100 p-4 rounded-lg"},MC={class:"max-w-full overflow-auto flex justify-center"},JC={class:"bg-gray-800 p-6 rounded-2xl shadow-2xl inline-block"},xC={class:"bg-gray-900 p-2 rounded-xl"},HC={class:"relative z-10 flex flex-col items-center justify-center p-4 text-center"},YC={class:"mb-4"},KC={key:0,class:"emoji-container"},TC=["src","alt"],VC={key:1,class:"emoji-container"},qC={class:"text-center"},OC={class:"text-sm"},WC={class:"text-xs"},PC={key:0,class:"absolute inset-0 flex items-center justify-center"},ZC={class:"animate-pulse text-gray-400 text-xs"},XC={class:"mt-3 text-center text-xs text-gray-400"},jC={class:"w-full lg:w-80"},zC={class:"text-lg font-medium text-gray-900 mb-4"},_C={class:"space-y-6 bg-white border border-gray-200 rounded-lg p-4"},$C={class:"block text-sm font-medium text-gray-700 mb-2"},An={class:"block text-sm font-medium text-gray-700 mb-2"},en={key:0,class:"flex flex-wrap gap-2 max-h-32 overflow-y-auto justify-center"},gn=["onClick","title"],tn={key:0},In=["src","alt"],on={key:1,class:"text-lg"},rn={key:1,class:"text-center py-4 text-gray-500 bg-gray-50 rounded-lg border-2 border-dashed"},Cn={class:"text-2xl mb-2"},nn={class:"text-sm"},Bn={class:"block text-sm font-medium text-gray-700 mb-2"},an={class:"flex space-x-2"},sn={class:"border-t pt-4"},Qn={class:"font-medium text-gray-900 mb-2"},En={class:"text-xs text-gray-600 space-y-1"},ln={key:0},cn={class:"flex items-center"},hn={key:0,class:"ml-2 animate-pulse text-blue-500"},un={key:1},dn={class:"flex justify-between"},fn={__name:"GenerateSummary",props:{config:{type:Object,required:!0}},emits:["prev","generate"],setup(e){const{t:A}=TA(),g=e,t=j(A("generateSummary.defaultPreviewText")),I=j("happy"),o=j("light"),i=j(!1),r=j(""),C=nA(()=>[{key:"neutral",name:A("generateSummary.emotions.neutral"),emoji:"😶"},{key:"happy",name:A("generateSummary.emotions.happy"),emoji:"🙂"},{key:"laughing",name:A("generateSummary.emotions.laughing"),emoji:"😆"},{key:"funny",name:A("generateSummary.emotions.funny"),emoji:"😂"},{key:"sad",name:A("generateSummary.emotions.sad"),emoji:"😔"},{key:"angry",name:A("generateSummary.emotions.angry"),emoji:"😠"},{key:"crying",name:A("generateSummary.emotions.crying"),emoji:"😭"},{key:"loving",name:A("generateSummary.emotions.loving"),emoji:"😍"},{key:"surprised",name:A("generateSummary.emotions.surprised"),emoji:"😯"},{key:"thinking",name:A("generateSummary.emotions.thinking"),emoji:"🤔"},{key:"cool",name:A("generateSummary.emotions.cool"),emoji:"😎"},{key:"sleepy",name:A("generateSummary.emotions.sleepy"),emoji:"😴"}]),B=nA(()=>{if(g.config.theme.emoji.type==="preset"&&g.config.theme.emoji.preset)return C.value;if(g.config.theme.emoji.type==="custom"){const F=g.config.theme.emoji.custom.images;return C.value.filter(S=>F[S.key])}else return[]}),n=nA(()=>c(I.value)),Q=()=>{const{width:F,height:S}=g.config.chip.display;return{width:`${F}px`,height:`${S}px`}},s=()=>{const F=g.config.theme.skin[o.value];if(F.backgroundType==="image"&&F.backgroundImage)try{if(F.backgroundImage&&typeof F.backgroundImage=="object"&&F.backgroundImage.size)return{backgroundImage:`url(${URL.createObjectURL(F.backgroundImage)})`,backgroundSize:"cover",backgroundPosition:"center"}}catch(S){console.warn("Failed to load background preview:",S)}return{backgroundColor:F.backgroundColor||"#ffffff"}},E={twemoji32:32,twemoji64:64,"noto-emoji_64":64,"noto-emoji_128":128},h=()=>{let F=48;return g.config.theme.emoji.type==="preset"?F=E[g.config.theme.emoji.preset]||32:g.config.theme.emoji.custom.size&&(F=Math.min(g.config.theme.emoji.custom.size.width,g.config.theme.emoji.custom.size.height)),{width:`${F}px`,height:`${F}px`}},w=()=>{let F=14;if(g.config.theme.font.type==="preset"){const J=g.config.theme.font.preset;J.includes("_14_")?F=14:J.includes("_16_")?F=16:J.includes("_20_")?F=20:J.includes("_30_")&&(F=30)}else g.config.theme.font.custom.size&&(F=g.config.theme.font.custom.size);const S=o.value==="dark"?g.config.theme.skin.dark.textColor:g.config.theme.skin.light.textColor;return{fontSize:`${F}px`,color:S,fontFamily:l(),textShadow:o.value==="dark"?"1px 1px 2px rgba(0,0,0,0.5)":"1px 1px 2px rgba(255,255,255,0.5)"}},u=async()=>{document.querySelectorAll("style[data-font-preview]").forEach(S=>S.remove()),i.value=!1,r.value="";try{if(g.config.theme.font.type==="preset"){const S=g.config.theme.font.preset;let J,V;S&&S.startsWith("font_noto_qwen_")?(J="NotoPreview",V="./static/fonts/noto_qwen.ttf"):(J="PuHuiPreview",V="./static/fonts/puhui_deepseek.ttf");const q=document.createElement("style");q.setAttribute("data-font-preview","true"),q.textContent=` + @font-face { + font-family: '${J}'; + src: url('${V}') format('truetype'); + font-display: swap; + } + `,document.head.appendChild(q),await document.fonts.load(`16px "${J}"`),r.value=J,i.value=!0}else if(g.config.theme.font.custom.file)try{const S=g.config.theme.font.custom.file;if(!S||typeof S!="object"||!S.size)throw new Error("Invalid font file object");const J="CustomFontPreview",V=URL.createObjectURL(S),q=document.createElement("style");q.setAttribute("data-font-preview","true"),q.textContent=` + @font-face { + font-family: '${J}'; + src: url('${V}'); + font-display: swap; + } + `,document.head.appendChild(q),await document.fonts.load(`16px "${J}"`),r.value=J,i.value=!0}catch(S){console.warn("Failed to load custom font preview:",S),r.value="system-ui",i.value=!0}else r.value="system-ui",i.value=!0}catch(S){console.warn("Font loading failed:",S),r.value="system-ui",i.value=!0}},l=()=>i.value&&r.value?`"${r.value}", "Noto Sans", "Segoe UI", sans-serif`:'"Noto Sans", "Segoe UI", sans-serif',f={twemoji32:"png",twemoji64:"png","noto-emoji_64":"gif","noto-emoji_128":"gif"},c=F=>{if(g.config.theme.emoji.type==="preset"){const S=g.config.theme.emoji.preset,J=f[S]||"png";return`./static/emojis/${S}/${F}.${J}`}else if(g.config.theme.emoji.type==="custom"&&g.config.theme.emoji.custom.images[F])try{const S=g.config.theme.emoji.custom.images[F];if(S&&typeof S=="object"&&S.size)return URL.createObjectURL(S)}catch(S){console.warn(`Failed to load emoji preview (${F}):`,S)}return null},D=F=>{const S=C.value.find(J=>J.key===F);return S?S.emoji:"😶"},p=()=>{if(g.config.theme.emoji.type==="preset"){const F=E[g.config.theme.emoji.preset]||32;return Math.min(F+16,80)}else if(g.config.theme.emoji.custom.size){const F=Math.min(g.config.theme.emoji.custom.size.width,g.config.theme.emoji.custom.size.height);return Math.min(F+16,80)}return 48},v=()=>{if(g.config.theme.emoji.type==="preset"){const F=E[g.config.theme.emoji.preset]||32;return Math.min(F,64)}else if(g.config.theme.emoji.custom.size)return Math.min(g.config.theme.emoji.custom.size.width,g.config.theme.emoji.custom.size.height,64);return 32},N=F=>{I.value=F},L={wn9s_hilexin:"generateModal.wakewordNames.wn9s_hilexin",wn9s_hiesp:"generateModal.wakewordNames.wn9s_hiesp",wn9s_nihaoxiaozhi:"generateModal.wakewordNames.wn9s_nihaoxiaozhi",wn9s_hijason:"Hi, Jason",wn9s_alexa:"Alexa",wn9_hilexin:"Hi, Espressif",wn9_hiesp:"Hi, ESP",wn9_nihaoxiaozhi_tts:"generateModal.wakewordNames.wn9_nihaoxiaozhi_tts",wn9_hijason_tts2:"Hi, Jason",wn9_himfive:"Hi, M Five",wn9_alexa:"generateModal.wakewordNames.wn9_alexa",wn9_jarvis_tts:"Jarvis",wn9_computer_tts:"Computer",wn9_heywillow_tts:"Hey, Willow",wn9_sophia_tts:"Sophia",wn9_heyprinter_tts:"Hey, Printer",wn9_hijoy_tts:"Hi, Joy",wn9_heywanda_tts:"Hey, Wand",wn9_astrolabe_tts:"Astrolabe",wn9_heyily_tts2:"Hey, Ily",wn9_hijolly_tts2:"Hi, Jolly",wn9_hifairy_tts2:"Hi, Fairy",wn9_bluechip_tts2:"Blue Chip",wn9_hiandy_tts2:"Hi, Andy",wn9_heyivy_tts2:"Hey, Ivy",wn9_histackchan_tts3:"Hi, Stack Chan",wn9_hiwalle_tts2:"Hi, Wall E",wn9_hilili_tts:"Hi, Lily",wn9_hitelly_tts:"Hi, Telly",wn9_linaiban_tts2:"Lina Board"},X=F=>{const S=L[F];return S!=null&&S.startsWith("generateModal.")?A(S):S||F},k=()=>{const F=g.config.theme.wakeword;return!F||F.type==="none"?A("wakewordConfig.noWakeword"):F.type==="preset"?X(F.preset):F.type==="custom"?F.custom.name||A("wakewordConfig.customWakeword"):A("wakewordConfig.noWakeword")},m=()=>{if(g.config.theme.font.type==="preset")return A("fontConfig.presetFontNames."+g.config.theme.font.preset)||g.config.theme.font.preset;{const F=g.config.theme.font.custom;return A("generateSummary.customFont",{size:F.size})}},M=()=>{if(g.config.theme.emoji.type==="preset"&&g.config.theme.emoji.preset)return{twemoji32:"Twemoji 32×32",twemoji64:"Twemoji 64×64","noto-emoji_64":"Noto Emoji 64×64","noto-emoji_128":"Noto Emoji 128×128"}[g.config.theme.emoji.preset]||g.config.theme.emoji.preset;if(g.config.theme.emoji.type==="custom"){const F=Object.keys(g.config.theme.emoji.custom.images).length;return A("generateSummary.customEmoji",{count:F})}else return g.config.theme.emoji.type==="none"?A("emojiConfig.noEmojiPack"):A("generateSummary.notConfigured")},oA=()=>{const F=g.config.theme.skin.light.backgroundType==="image"?A("generateSummary.image"):A("generateSummary.color"),S=g.config.theme.skin.dark.backgroundType==="image"?A("generateSummary.image"):A("generateSummary.color");return A("generateSummary.skinLight",{type:F})+"/"+A("generateSummary.skinDark",{type:S})};return DA(()=>g.config.theme.font,()=>{u()},{deep:!0}),Me(async()=>{B.value.length>0?I.value=B.value[0].key:I.value="",await u()}),at(()=>{document.querySelectorAll("style[data-font-preview]").forEach(S=>S.remove())}),(F,S)=>(G(),U("div",SC,[a("div",null,[a("h2",GC,d(F.$t("generateSummary.title")),1),a("p",RC,d(F.$t("generateSummary.description")),1)]),a("div",UC,[a("div",NC,[a("h3",bC,d(F.$t("generateSummary.devicePreview")),1),a("div",LC,[a("div",MC,[a("div",JC,[a("div",xC,[a("div",{style:CA(Q()),class:"relative rounded-lg overflow-hidden border-2 border-gray-700 flex flex-col items-center justify-center"},[a("div",{style:CA(s()),class:"absolute inset-0"},null,4),a("div",HC,[a("div",YC,[I.value&&B.value.length>0?(G(),U("div",KC,[n.value?(G(),U("img",{key:0,src:n.value,alt:I.value,style:CA(h()),class:"emoji-image"},null,12,TC)):(G(),U("div",{key:1,style:CA(h()),class:"emoji-fallback bg-gray-200 rounded-full flex items-center justify-center text-2xl"},d(D(I.value)),5))])):(G(),U("div",VC,[a("div",{style:CA(h()),class:"emoji-placeholder flex items-center justify-center text-gray-400 border-2 border-dashed border-gray-300 rounded bg-gray-50"},[a("div",qC,[a("div",OC,d(e.config.theme.emoji.type==="none"?"📦":"😕"),1),a("div",WC,d(e.config.theme.emoji.type==="none"?F.$t("emojiConfig.noEmojiPack"):F.$t("generateSummary.noEmotionConfigured")),1)])],4)]))]),e.config.theme.font.hide_subtitle?O("",!0):(G(),U("div",{key:0,style:CA(w()),class:"text-message max-w-full break-words relative"},[i.value?O("",!0):(G(),U("div",PC,[a("div",ZC,d(F.$t("generateSummary.fontLoading")),1)])),a("div",{class:gA({"opacity-0":!i.value})},d(t.value),3)],4))])],4)]),a("div",XC,d(e.config.chip.display.width)+" × "+d(e.config.chip.display.height)+" "+d(e.config.chip.model.toUpperCase()),1)])])])]),a("div",jC,[a("h3",zC,d(F.$t("generateSummary.previewSettings")),1),a("div",_C,[a("div",null,[a("label",$C,d(F.$t("generateSummary.previewText")),1),rA(a("textarea",{"onUpdate:modelValue":S[0]||(S[0]=J=>t.value=J),class:"w-full border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500",rows:"3",placeholder:"Hi, I'm your friend Xiaozhi!"},null,512),[[sA,t.value]])]),a("div",null,[a("label",An,d(F.$t("generateSummary.currentEmotion")),1),B.value.length>0?(G(),U("div",en,[(G(!0),U(bA,null,LA(B.value,J=>(G(),U("button",{key:J.key,onClick:V=>N(J.key),class:gA(["p-2 border rounded transition-colors flex items-center justify-center",I.value===J.key?"border-primary-500 bg-primary-50":"border-gray-200 hover:border-gray-300"]),title:J.name,style:CA({width:p()+"px",height:p()+"px"})},[c(J.key)?(G(),U("div",tn,[a("img",{src:c(J.key),alt:J.name,style:CA({width:v()+"px",height:v()+"px"}),class:"object-contain rounded"},null,12,In)])):(G(),U("div",on,d(J.emoji),1))],14,gn))),128))])):(G(),U("div",rn,[a("div",Cn,d(e.config.theme.emoji.type==="none"?"📦":"😕"),1),a("div",nn,d(e.config.theme.emoji.type==="none"?F.$t("emojiConfig.noEmojiPackDescription"):F.$t("generateSummary.configureEmojiFirst")),1)]))]),a("div",null,[a("label",Bn,d(F.$t("generateSummary.themeMode")),1),a("div",an,[a("button",{onClick:S[1]||(S[1]=J=>o.value="light"),class:gA(["flex-1 py-2 px-3 text-sm border rounded transition-colors",o.value==="light"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])}," 🌞 "+d(F.$t("generateSummary.lightMode")),3),a("button",{onClick:S[2]||(S[2]=J=>o.value="dark"),class:gA(["flex-1 py-2 px-3 text-sm border rounded transition-colors",o.value==="dark"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])}," 🌙 "+d(F.$t("generateSummary.darkMode")),3)])]),a("div",sn,[a("h4",Qn,d(F.$t("generateSummary.configSummary")),1),a("div",En,[e.config.theme.wakeword?(G(),U("div",ln,d(F.$t("generateSummary.wakeword"))+" "+d(k()),1)):O("",!0),a("div",cn,[a("span",null,d(F.$t("generateSummary.font"))+" "+d(m()),1),i.value?O("",!0):(G(),U("span",hn,d(F.$t("generateSummary.loading")),1))]),a("div",null,d(F.$t("generateSummary.emotion"))+" "+d(M()),1),a("div",null,d(F.$t("generateSummary.skin"))+" "+d(oA()),1),e.config.theme.font.hide_subtitle?(G(),U("div",un,d(F.$t("generateSummary.hideSubtitle"))+" "+d(F.$t("common.yes")),1)):O("",!0)])])])])]),a("div",dn,[a("button",{onClick:S[3]||(S[3]=J=>F.$emit("prev")),class:"bg-gray-500 hover:bg-gray-600 text-white px-6 py-2 rounded-lg font-medium transition-colors"},d(F.$t("generateSummary.previous")),1),a("button",{onClick:S[4]||(S[4]=J=>F.$emit("generate")),class:"bg-green-500 hover:bg-green-600 text-white px-8 py-2 rounded-lg font-medium transition-colors flex items-center"},[S[5]||(S[5]=a("svg",{class:"w-5 h-5 mr-2",fill:"currentColor",viewBox:"0 0 20 20"},[a("path",{"fill-rule":"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)),HA(" "+d(F.$t("generateSummary.generate")),1)])])]))}},wn=vC(fn,[["__scopeId","data-v-fdf7b702"]]);/*! https://mths.be/codepointat v0.2.0 by @mathias */String.prototype.codePointAt||function(){var e=function(){try{var g={},t=Object.defineProperty,I=t(g,g,g)&&t}catch{}return I}(),A=function(g){if(this==null)throw TypeError();var t=String(this),I=t.length,o=g?Number(g):0;if(o!=o&&(o=0),!(o<0||o>=I)){var i=t.charCodeAt(o),r;return i>=55296&&i<=56319&&I>o+1&&(r=t.charCodeAt(o+1),r>=56320&&r<=57343)?(i-55296)*1024+r-56320+65536:i}};e?e(String.prototype,"codePointAt",{value:A,configurable:!0,writable:!0}):String.prototype.codePointAt=A}();var rg=0,st=-3;function ae(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function pn(e,A){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=A,this.destLen=0,this.ltree=new ae,this.dtree=new ae}var Qt=new ae,Et=new ae,Cg=new Uint8Array(30),ng=new Uint16Array(30),lt=new Uint8Array(30),ct=new Uint16Array(30),yn=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),pg=new ae,GA=new Uint8Array(320);function ht(e,A,g,t){var I,o;for(I=0;I>>=1,A}function RA(e,A,g){if(!A)return g;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-A;return e.tag>>>=A,e.bitcount-=A,t+g}function je(e,A){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++I,g+=A.table[I],t-=A.table[I];while(t>=0);return e.tag=o,e.bitcount-=I,A.trans[g+t]}function Fn(e,A,g){var t,I,o,i,r,C;for(t=RA(e,5,257),I=RA(e,5,1),o=RA(e,4,4),i=0;i<19;++i)GA[i]=0;for(i=0;i8;)e.sourceIndex--,e.bitcount-=8;if(A=e.source[e.sourceIndex+1],A=256*A+e.source[e.sourceIndex],g=e.source[e.sourceIndex+3],g=256*g+e.source[e.sourceIndex+2],A!==(~g&65535))return st;for(e.sourceIndex+=4,t=A;t;--t)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,rg}function vn(e,A){var g=new pn(e,A),t,I,o;do{switch(t=mn(g),I=RA(g,2,0),I){case 0:o=kn(g);break;case 1:o=Dg(g,Qt,Et);break;case 2:Fn(g,g.ltree,g.dtree),o=Dg(g,g.ltree,g.dtree);break;default:o=st}if(o!==rg)throw new Error("Data error")}while(!t);return g.destLenthis.x2&&(this.x2=e)),typeof A=="number"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=A,this.y2=A),Athis.y2&&(this.y2=A))};VA.prototype.addX=function(e){this.addPoint(e,null)};VA.prototype.addY=function(e){this.addPoint(null,e)};VA.prototype.addBezier=function(e,A,g,t,I,o,i,r){var C=[e,A],B=[g,t],n=[I,o],Q=[i,r];this.addPoint(e,A),this.addPoint(i,r);for(var s=0;s<=1;s++){var E=6*C[s]-12*B[s]+6*n[s],h=-3*C[s]+9*B[s]-9*n[s]+3*Q[s],w=3*B[s]-3*C[s];if(h===0){if(E===0)continue;var u=-w/E;0=0&&C>0&&(r+=" "),r+=A(B)}return r}for(var t="",I=0;I=0&&e<=255,"Byte value should be between 0 and 255."),[e]};P.BYTE=vA(1);x.CHAR=function(e){return[e.charCodeAt(0)]};P.CHAR=vA(1);x.CHARARRAY=function(e){typeof e>"u"&&(e="",console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));for(var A=[],g=0;g"u"?0:e.length};x.USHORT=function(e){return[e>>8&255,e&255]};P.USHORT=vA(2);x.SHORT=function(e){return e>=Fg&&(e=-(2*Fg-e)),[e>>8&255,e&255]};P.SHORT=vA(2);x.UINT24=function(e){return[e>>16&255,e>>8&255,e&255]};P.UINT24=vA(3);x.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]};P.ULONG=vA(4);x.LONG=function(e){return e>=kg&&(e=-(2*kg-e)),[e>>24&255,e>>16&255,e>>8&255,e&255]};P.LONG=vA(4);x.FIXED=x.ULONG;P.FIXED=P.ULONG;x.FWORD=x.SHORT;P.FWORD=P.SHORT;x.UFWORD=x.USHORT;P.UFWORD=P.USHORT;x.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,e&255]};P.LONGDATETIME=vA(8);x.TAG=function(e){return W.argument(e.length===4,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]};P.TAG=vA(4);x.Card8=x.BYTE;P.Card8=P.BYTE;x.Card16=x.USHORT;P.Card16=P.USHORT;x.OffSize=x.BYTE;P.OffSize=P.BYTE;x.SID=x.USHORT;P.SID=P.USHORT;x.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?(e=e-108,[(e>>8)+247,e&255]):e>=-1131&&e<=-108?(e=-e-108,[(e>>8)+251,e&255]):e>=-32768&&e<=32767?x.NUMBER16(e):x.NUMBER32(e)};P.NUMBER=function(e){return x.NUMBER(e).length};x.NUMBER16=function(e){return[28,e>>8&255,e&255]};P.NUMBER16=vA(3);x.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,e&255]};P.NUMBER32=vA(5);x.REAL=function(e){var A=e.toString(),g=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(A);if(g){var t=parseFloat("1e"+((g[2]?+g[2]:0)+g[1].length));A=(Math.round(e*t)/t).toString()}for(var I="",o=0,i=A.length;o>8&255,A[A.length]=t&255}return A};P.UTF16=function(e){return e.length*2};var ze={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};oe.MACSTRING=function(e,A,g,t){var I=ze[t];if(I!==void 0){for(var o="",i=0;i=128&&(o=g[o],o===void 0))return;t[I]=o}return t}};P.MACSTRING=function(e,A){var g=x.MACSTRING(e,A);return g!==void 0?g.length:0};function _e(e){return e>=-128&&e<=127}function Rn(e,A,g){for(var t=0,I=e.length;A>8&255,C+256&255)}return o}x.VARDELTAS=function(e){for(var A=0,g=[];A=-128&&t<=127?A=Un(e,A,g):A=Nn(e,A,g)}return g};x.INDEX=function(e){for(var A=1,g=[A],t=[],I=0;I>8,A[Q+1]=s&255,A=A.concat(t[n])}return A};P.TABLE=function(e){for(var A=0,g=e.fields.length,t=0;t0)return new y(this.data,this.offset+A).parseStruct(e)};y.prototype.parsePointer32=function(e){var A=this.parseOffset32();if(A>0)return new y(this.data,this.offset+A).parseStruct(e)};y.prototype.parseListOfLists=function(e){for(var A=this.parseOffset16List(),g=A.length,t=this.relativeOffset,I=new Array(g),o=0;o>1,A.skip("uShort",3),e.glyphIndexMap={};for(var i=new T.Parser(g,t+I+14),r=new T.Parser(g,t+I+16+o*2),C=new T.Parser(g,t+I+16+o*4),B=new T.Parser(g,t+I+16+o*6),n=t+I+16+o*8,Q=0;Q=0;I-=1){var o=T.getUShort(e,A+4+I*8),i=T.getUShort(e,A+4+I*8+2);if(o===3&&(i===0||i===1||i===10)||o===0&&(i===0||i===1||i===2||i===3||i===4)){t=T.getULong(e,A+4+I*8+4);break}}if(t===-1)throw new Error("No valid cmap sub-tables found.");var r=new T.Parser(e,A+t);if(g.format=r.parseUShort(),g.format===12)Yn(g,r);else if(g.format===4)Kn(g,r,e,A,t);else throw new Error("Only format 4 and 12 cmap tables are supported (found format "+g.format+").");return g}function Vn(e,A,g){e.segments.push({end:A,start:A,delta:-(A-g),offset:0,glyphIndex:g})}function qn(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}function On(e){var A=!0,g;for(g=e.length-1;g>0;g-=1){var t=e.get(g);if(t.unicode>65535){console.log("Adding CMAP format 12 (needed!)"),A=!1;break}}var I=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:A?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:A?12:20}];A||(I=I.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),I=I.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var o=new Y.Table("cmap",I);for(o.segments=[],g=0;g>4,i=I&15;if(o===g||(A+=t[o],i===g))break;A+=t[i]}return parseFloat(A)}function oB(e,A){var g,t,I,o;if(A===28)return g=e.parseByte(),t=e.parseByte(),g<<8|t;if(A===29)return g=e.parseByte(),t=e.parseByte(),I=e.parseByte(),o=e.parseByte(),g<<24|t<<16|I<<8|o;if(A===30)return IB(e);if(A>=32&&A<=246)return A-139;if(A>=247&&A<=250)return g=e.parseByte(),(A-247)*256+g+108;if(A>=251&&A<=254)return g=e.parseByte(),-(A-251)*256-g-108;throw new Error("Invalid b0 "+A)}function iB(e){for(var A={},g=0;g>1,C.length=0,n=!0}function N(L){for(var X,k,m,M,oA,F,S,J,V,q,$,AA,_=0;_1&&!n&&(D=C.shift()+l,n=!0),E+=C.pop(),p(s,E);break;case 5:for(;C.length>0;)s+=C.shift(),E+=C.shift(),r.lineTo(s,E);break;case 6:for(;C.length>0&&(s+=C.shift(),r.lineTo(s,E),C.length!==0);)E+=C.shift(),r.lineTo(s,E);break;case 7:for(;C.length>0&&(E+=C.shift(),r.lineTo(s,E),C.length!==0);)s+=C.shift(),r.lineTo(s,E);break;case 8:for(;C.length>0;)t=s+C.shift(),I=E+C.shift(),o=t+C.shift(),i=I+C.shift(),s=o+C.shift(),E=i+C.shift(),r.curveTo(t,I,o,i,s,E);break;case 10:oA=C.pop()+w,F=h[oA],F&&N(F);break;case 11:return;case 12:switch(iA=L[_],_+=1,iA){case 35:t=s+C.shift(),I=E+C.shift(),o=t+C.shift(),i=I+C.shift(),S=o+C.shift(),J=i+C.shift(),V=S+C.shift(),q=J+C.shift(),$=V+C.shift(),AA=q+C.shift(),s=$+C.shift(),E=AA+C.shift(),C.shift(),r.curveTo(t,I,o,i,S,J),r.curveTo(V,q,$,AA,s,E);break;case 34:t=s+C.shift(),I=E,o=t+C.shift(),i=I+C.shift(),S=o+C.shift(),J=i,V=S+C.shift(),q=i,$=V+C.shift(),AA=E,s=$+C.shift(),r.curveTo(t,I,o,i,S,J),r.curveTo(V,q,$,AA,s,E);break;case 36:t=s+C.shift(),I=E+C.shift(),o=t+C.shift(),i=I+C.shift(),S=o+C.shift(),J=i,V=S+C.shift(),q=i,$=V+C.shift(),AA=q+C.shift(),s=$+C.shift(),r.curveTo(t,I,o,i,S,J),r.curveTo(V,q,$,AA,s,E);break;case 37:t=s+C.shift(),I=E+C.shift(),o=t+C.shift(),i=I+C.shift(),S=o+C.shift(),J=i+C.shift(),V=S+C.shift(),q=J+C.shift(),$=V+C.shift(),AA=q+C.shift(),Math.abs($-s)>Math.abs(AA-E)?s=$+C.shift():E=AA+C.shift(),r.curveTo(t,I,o,i,S,J),r.curveTo(V,q,$,AA,s,E);break;default:console.log("Glyph "+A.index+": unknown operator 1200"+iA),C.length=0}break;case 14:C.length>0&&!n&&(D=C.shift()+l,n=!0),Q&&(r.closePath(),Q=!1);break;case 18:v();break;case 19:case 20:v(),_+=B+7>>3;break;case 21:C.length>2&&!n&&(D=C.shift()+l,n=!0),E+=C.pop(),s+=C.pop(),p(s,E);break;case 22:C.length>1&&!n&&(D=C.shift()+l,n=!0),s+=C.pop(),p(s,E);break;case 23:v();break;case 24:for(;C.length>2;)t=s+C.shift(),I=E+C.shift(),o=t+C.shift(),i=I+C.shift(),s=o+C.shift(),E=i+C.shift(),r.curveTo(t,I,o,i,s,E);s+=C.shift(),E+=C.shift(),r.lineTo(s,E);break;case 25:for(;C.length>6;)s+=C.shift(),E+=C.shift(),r.lineTo(s,E);t=s+C.shift(),I=E+C.shift(),o=t+C.shift(),i=I+C.shift(),s=o+C.shift(),E=i+C.shift(),r.curveTo(t,I,o,i,s,E);break;case 26:for(C.length%2&&(s+=C.shift());C.length>0;)t=s,I=E+C.shift(),o=t+C.shift(),i=I+C.shift(),s=o,E=i+C.shift(),r.curveTo(t,I,o,i,s,E);break;case 27:for(C.length%2&&(E+=C.shift());C.length>0;)t=s+C.shift(),I=E,o=t+C.shift(),i=I+C.shift(),s=o+C.shift(),E=i,r.curveTo(t,I,o,i,s,E);break;case 28:X=L[_],k=L[_+1],C.push((X<<24|k<<16)>>16),_+=2;break;case 29:oA=C.pop()+e.gsubrsBias,F=e.gsubrs[oA],F&&N(F);break;case 30:for(;C.length>0&&(t=s,I=E+C.shift(),o=t+C.shift(),i=I+C.shift(),s=o+C.shift(),E=i+(C.length===1?C.shift():0),r.curveTo(t,I,o,i,s,E),C.length!==0);)t=s+C.shift(),I=E,o=t+C.shift(),i=I+C.shift(),E=i+C.shift(),s=o+(C.length===1?C.shift():0),r.curveTo(t,I,o,i,s,E);break;case 31:for(;C.length>0&&(t=s+C.shift(),I=E,o=t+C.shift(),i=I+C.shift(),E=i+C.shift(),s=o+(C.length===1?C.shift():0),r.curveTo(t,I,o,i,s,E),C.length!==0);)t=s,I=E+C.shift(),o=t+C.shift(),i=I+C.shift(),s=o+C.shift(),E=i+(C.length===1?C.shift():0),r.curveTo(t,I,o,i,s,E);break;default:iA<32?console.log("Glyph "+A.index+": unknown operator "+iA):iA<247?C.push(iA-139):iA<251?(X=L[_],_+=1,C.push((iA-247)*256+X+108)):iA<255?(X=L[_],_+=1,C.push(-(iA-251)*256-X-108)):(X=L[_],k=L[_+1],m=L[_+2],M=L[_+3],_+=4,C.push((X<<24|k<<16|m<<8|M)/65536))}}}return N(g),A.advanceWidth=D,r}function aB(e,A,g,t){var I=[],o,i=new T.Parser(e,A),r=i.parseCard8();if(r===0)for(var C=0;C=t)throw new Error("CFF table CID Font FDSelect has bad FD index value "+o+" (FD count "+t+")");I.push(o)}else if(r===3){var B=i.parseCard16(),n=i.parseCard16();if(n!==0)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+n);for(var Q,s=0;s=t)throw new Error("CFF table CID Font FDSelect has bad FD index value "+o+" (FD count "+t+")");if(Q>g)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+Q);for(;n=0&&(g=t),t=A.indexOf(e),t>=0?g=t+ve.length:(g=ve.length+A.length,A.push(e)),g}function QB(){return new Y.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function EB(e){var A=new Y.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);A.names=[];for(var g=0;g=g.begin&&e=1&&(g.ulCodePageRange1=t.parseULong(),g.ulCodePageRange2=t.parseULong()),g.version>=2&&(g.sxHeight=t.parseShort(),g.sCapHeight=t.parseShort(),g.usDefaultChar=t.parseUShort(),g.usBreakChar=t.parseUShort(),g.usMaxContent=t.parseUShort()),g}function VB(e){return new Y.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)}var tg={parse:TB,make:VB,unicodeRanges:gg,getUnicodeRange:KB};function qB(e,A){var g={},t=new T.Parser(e,A);switch(g.version=t.parseVersion(),g.italicAngle=t.parseFixed(),g.underlinePosition=t.parseShort(),g.underlineThickness=t.parseShort(),g.isFixedPitch=t.parseULong(),g.minMemType42=t.parseULong(),g.maxMemType42=t.parseULong(),g.minMemType1=t.parseULong(),g.maxMemType1=t.parseULong(),g.version){case 1:g.names=_A.slice();break;case 2:g.numberOfGlyphs=t.parseUShort(),g.glyphNameIndex=new Array(g.numberOfGlyphs);for(var I=0;I=_A.length){var i=t.parseChar();g.names.push(t.parseString(i))}break;case 2.5:g.numberOfGlyphs=t.parseUShort(),g.offset=new Array(g.numberOfGlyphs);for(var r=0;rQ.value.tag?1:-1}),A.fields=A.fields.concat(t),A.fields=A.fields.concat(I),A}function xg(e,A,g){for(var t=0;t0){var o=e.glyphs.get(I);return o.getMetrics()}}return g}function jB(e){for(var A=0,g=0;gu||C===void 0)&&u>0&&(C=u),B 123 are reserved for internal usage");if(w.name!==".notdef"){var f=w.getMetrics();A.push(f.xMin),g.push(f.yMin),t.push(f.xMax),I.push(f.yMax),i.push(f.leftSideBearing),r.push(f.rightSideBearing),o.push(w.advanceWidth)}}var c={xMin:Math.min.apply(null,A),yMin:Math.min.apply(null,g),xMax:Math.max.apply(null,t),yMax:Math.max.apply(null,I),advanceWidthMax:Math.max.apply(null,o),advanceWidthAvg:jB(o),minLeftSideBearing:Math.min.apply(null,i),maxLeftSideBearing:Math.max.apply(null,i),minRightSideBearing:Math.min.apply(null,r)};c.ascender=e.ascender,c.descender=e.descender;var D=Ut.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:c.xMin,yMin:c.yMin,xMax:c.xMax,yMax:c.yMax,lowestRecPPEM:3,createdTimestamp:e.createdTimestamp}),p=Nt.make({ascender:c.ascender,descender:c.descender,advanceWidthMax:c.advanceWidthMax,minLeftSideBearing:c.minLeftSideBearing,minRightSideBearing:c.minRightSideBearing,xMaxExtent:c.maxLeftSideBearing+(c.xMax-c.xMin),numberOfHMetrics:e.glyphs.length}),v=Mt.make(e.glyphs.length),N=tg.make(Object.assign({xAvgCharWidth:Math.round(c.advanceWidthAvg),usFirstCharIndex:C,usLastCharIndex:B,ulUnicodeRange1:n,ulUnicodeRange2:Q,ulUnicodeRange3:s,ulUnicodeRange4:E,sTypoAscender:c.ascender,sTypoDescender:c.descender,sTypoLineGap:0,usWinAscent:c.yMax,usWinDescent:Math.abs(c.yMin),ulCodePageRange1:1,sxHeight:xg(e,"xyvw",{yMax:Math.round(c.ascender/2)}).yMax,sCapHeight:xg(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",c).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0},e.tables.os2)),L=bt.make(e.glyphs),X=ft.make(e.glyphs),k=e.getEnglishName("fontFamily"),m=e.getEnglishName("fontSubfamily"),M=k+" "+m,oA=e.getEnglishName("postScriptName");oA||(oA=k.replace(/\s/g,"")+"-"+m);var F={};for(var S in e.names)F[S]=e.names[S];F.uniqueID||(F.uniqueID={en:e.getEnglishName("manufacturer")+":"+M}),F.postScriptName||(F.postScriptName={en:oA}),F.preferredFamily||(F.preferredFamily=e.names.fontFamily),F.preferredSubfamily||(F.preferredSubfamily=e.names.fontSubfamily);var J=[],V=Kt.make(F,J),q=J.length>0?Lt.make(J):void 0,$=Tt.make(),AA=Rt.make(e.glyphs,{version:e.getEnglishName("version"),fullName:M,familyName:k,weightName:m,postScriptName:oA,unitsPerEm:e.unitsPerEm,fontBBox:[0,c.yMin,c.ascender,c.advanceWidthMax]}),_=e.metas&&Object.keys(e.metas).length>0?qt.make(e.metas):void 0,iA=[D,p,v,N,V,X,$,AA,L];q&&iA.push(q),e.tables.gsub&&iA.push(Vt.make(e.tables.gsub)),_&&iA.push(_);for(var b=Ot(iA),H=b.encode(),Z=Qg(H),IA=b.fields,z=!1,lA=0;lA>>1,o=e[I].tag;if(o===A)return I;o>>1,o=e[I];if(o===A)return I;o>>1;g=e[o];var i=g.start;if(i===A)return g;i0)return g=e[t-1],A>g.end?0:g}function ce(e,A){this.font=e,this.tableName=A}ce.prototype={searchTag:Ke,binSearch:Hg,getTable:function(e){var A=this.font.tables[this.tableName];return!A&&e&&(A=this.font.tables[this.tableName]=this.createDefaultTable()),A},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(A){return A.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var A=!1,g=0;g=0)return t[I].script;if(A){var o={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return t.splice(-1-I,0,o),o.script}}},getLangSysTable:function(e,A,g){var t=this.getScriptTable(e,g);if(t){if(!A||A==="dflt"||A==="DFLT")return t.defaultLangSys;var I=Ke(t.langSysRecords,A);if(I>=0)return t.langSysRecords[I].langSys;if(g){var o={tag:A,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return t.langSysRecords.splice(-1-I,0,o),o.langSys}}},getFeatureTable:function(e,A,g,t){var I=this.getLangSysTable(e,A,t);if(I){for(var o,i=I.featureIndexes,r=this.font.tables[this.tableName].features,C=0;C=r[B-1].tag,"Features must be added in alphabetical order."),o={tag:g,feature:{params:0,lookupListIndexes:[]}},r.push(o),i.push(B),o.feature}}},getLookupTables:function(e,A,g,t,I){var o=this.getFeatureTable(e,A,g,I),i=[];if(o){for(var r,C=o.lookupListIndexes,B=this.font.tables[this.tableName].lookups,n=0;n=0?g:-1;case 2:var t=Yg(e.ranges,A);return t?t.index+A-t.start:-1}},expandCoverage:function(e){if(e.format===1)return e.glyphs;for(var A=[],g=e.ranges,t=0;t1,'Multiple: "by" must be an array of two or more ids');var I=this.getLookupTables(g,t,e,2,!0)[0],o=Eg(I,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});W.assert(o.coverage.format===1,"Multiple: unable to modify coverage table format "+o.coverage.format);var i=A.sub,r=this.binSearch(o.coverage.glyphs,i);r<0&&(r=-1-r,o.coverage.glyphs.splice(r,0,i),o.sequences.splice(r,0,0)),o.sequences[r]=A.by};dA.prototype.addAlternate=function(e,A,g,t){var I=this.getLookupTables(g,t,e,3,!0)[0],o=Eg(I,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});W.assert(o.coverage.format===1,"Alternate: unable to modify coverage table format "+o.coverage.format);var i=A.sub,r=this.binSearch(o.coverage.glyphs,i);r<0&&(r=-1-r,o.coverage.glyphs.splice(r,0,i),o.alternateSets.splice(r,0,0)),o.alternateSets[r]=A.by};dA.prototype.addLigature=function(e,A,g,t){var I=this.getLookupTables(g,t,e,4,!0)[0],o=I.subtables[0];o||(o={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},I.subtables[0]=o),W.assert(o.coverage.format===1,"Ligature: unable to modify coverage table format "+o.coverage.format);var i=A.sub[0],r=A.sub.slice(1),C={ligGlyph:A.by,components:r},B=this.binSearch(o.coverage.glyphs,i);if(B>=0){for(var n=o.ligatureSets[B],Q=0;Q0?(o=e.parseByte(),A&I||(o=-o),o=g+o):(A&I)>0?o=g:o=g+e.parseShort(),o}function Pt(e,A,g){var t=new T.Parser(A,g);e.numberOfContours=t.parseShort(),e._xMin=t.parseShort(),e._yMin=t.parseShort(),e._xMax=t.parseShort(),e._yMax=t.parseShort();var I,o;if(e.numberOfContours>0){for(var i=e.endPointIndices=[],r=0;r0)for(var Q=t.parseByte(),s=0;s0){var E=[],h;if(B>0){for(var w=0;w=0,E.push(h);for(var u=0,l=0;l0?(I&2)>0?(p.dx=t.parseShort(),p.dy=t.parseShort()):p.matchedPoints=[t.parseUShort(),t.parseUShort()]:(I&2)>0?(p.dx=t.parseChar(),p.dy=t.parseChar()):p.matchedPoints=[t.parseByte(),t.parseByte()],(I&8)>0?p.xScale=p.yScale=t.parseF2Dot14():(I&64)>0?(p.xScale=t.parseF2Dot14(),p.yScale=t.parseF2Dot14()):(I&128)>0&&(p.xScale=t.parseF2Dot14(),p.scale01=t.parseF2Dot14(),p.scale10=t.parseF2Dot14(),p.yScale=t.parseF2Dot14()),e.components.push(p),D=!!(I&32)}if(I&256){e.instructionLength=t.parseUShort(),e.instructions=[];for(var v=0;vA.points.length-1||t.matchedPoints[1]>I.points.length-1)throw Error("Matched points out of range in "+A.name);var i=A.points[t.matchedPoints[0]],r=I.points[t.matchedPoints[1]],C={xScale:t.xScale,scale01:t.scale01,scale10:t.scale10,yScale:t.yScale,dx:0,dy:0};r=Te([r],C)[0],C.dx=i.x-r.x,C.dy=i.y-r.y,o=Te(I.points,C)}A.points=A.points.concat(o)}}return Zt(A.points)}function ta(e,A,g,t){for(var I=new MA.GlyphSet(t),o=0;o2)){var g=this.font,t=this._prepState;if(!t||t.ppem!==A){var I=this._fpgmState;if(!I){ZA.prototype=aa,I=this._fpgmState=new ZA("fpgm",g.tables.fpgm),I.funcs=[],I.font=g,exports.DEBUG&&(console.log("---EXEC FPGM---"),I.step=-1);try{Ae(I)}catch(B){console.log("Hinting error in FPGM:"+B),this._errorState=3;return}}ZA.prototype=I,t=this._prepState=new ZA("prep",g.tables.prep),t.ppem=A;var o=g.tables.cvt;if(o)for(var i=t.cvt=new Array(o.length),r=A/g.unitsPerEm,C=0;C1))try{return _t(e,t)}catch(B){this._errorState<1&&(console.log("Hinting error:"+B),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}}};_t=function(e,A){var g=A.ppem/A.font.unitsPerEm,t=g,I=e.components,o,i,r;if(ZA.prototype=A,!I)r=new ZA("glyf",e.instructions),exports.DEBUG&&(console.log("---EXEC GLYPH---"),r.step=-1),Ig(e,r,g,t),i=r.gZone;else{var C=A.font;i=[],o=[];for(var B=0;B=176&&o<=183)t+=o-176+1;else if(o>=184&&o<=191)t+=(o-184+1)*2;else if(A&&I===1&&o===27)break;while(I>0);e.ip=t}function Tg(e,A){exports.DEBUG&&console.log(A.step,"SVTCA["+e.axis+"]"),A.fv=A.pv=A.dpv=e}function Vg(e,A){exports.DEBUG&&console.log(A.step,"SPVTCA["+e.axis+"]"),A.pv=A.dpv=e}function qg(e,A){exports.DEBUG&&console.log(A.step,"SFVTCA["+e.axis+"]"),A.fv=e}function Og(e,A){var g=A.stack,t=g.pop(),I=g.pop(),o=A.z2[t],i=A.z1[I];exports.DEBUG&&console.log("SPVTL["+e+"]",t,I);var r,C;e?(r=o.y-i.y,C=i.x-o.x):(r=i.x-o.x,C=i.y-o.y),A.pv=A.dpv=de(r,C)}function Wg(e,A){var g=A.stack,t=g.pop(),I=g.pop(),o=A.z2[t],i=A.z1[I];exports.DEBUG&&console.log("SFVTL["+e+"]",t,I);var r,C;e?(r=o.y-i.y,C=i.x-o.x):(r=i.x-o.x,C=i.y-o.y),A.fv=de(r,C)}function sa(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"SPVFS[]",g,t),e.pv=e.dpv=de(t,g)}function Qa(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"SPVFS[]",g,t),e.fv=de(t,g)}function Ea(e){var A=e.stack,g=e.pv;exports.DEBUG&&console.log(e.step,"GPV[]"),A.push(g.x*16384),A.push(g.y*16384)}function la(e){var A=e.stack,g=e.fv;exports.DEBUG&&console.log(e.step,"GFV[]"),A.push(g.x*16384),A.push(g.y*16384)}function ca(e){e.fv=e.pv,exports.DEBUG&&console.log(e.step,"SFVTPV[]")}function ha(e){var A=e.stack,g=A.pop(),t=A.pop(),I=A.pop(),o=A.pop(),i=A.pop(),r=e.z0,C=e.z1,B=r[g],n=r[t],Q=C[I],s=C[o],E=e.z2[i];exports.DEBUG&&console.log("ISECT[], ",g,t,I,o,i);var h=B.x,w=B.y,u=n.x,l=n.y,f=Q.x,c=Q.y,D=s.x,p=s.y,v=(h-u)*(c-p)-(w-l)*(f-D),N=h*l-w*u,L=f*p-c*D;E.x=(N*(f-D)-L*(h-u))/v,E.y=(N*(c-p)-L*(w-l))/v}function ua(e){e.rp0=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SRP0[]",e.rp0)}function da(e){e.rp1=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SRP1[]",e.rp1)}function fa(e){e.rp2=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SRP2[]",e.rp2)}function wa(e){var A=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZP0[]",A),e.zp0=A,A){case 0:e.tZone||Je(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function pa(e){var A=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZP1[]",A),e.zp1=A,A){case 0:e.tZone||Je(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function ya(e){var A=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZP2[]",A),e.zp2=A,A){case 0:e.tZone||Je(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function Da(e){var A=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZPS[]",A),e.zp0=e.zp1=e.zp2=A,A){case 0:e.tZone||Je(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function ma(e){e.loop=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SLOOP[]",e.loop)}function Fa(e){exports.DEBUG&&console.log(e.step,"RTG[]"),e.round=AI}function ka(e){exports.DEBUG&&console.log(e.step,"RTHG[]"),e.round=Ca}function va(e){var A=e.stack.pop();exports.DEBUG&&console.log(e.step,"SMD[]",A),e.minDis=A/64}function Sa(e){exports.DEBUG&&console.log(e.step,"ELSE[]"),gI(e,!1)}function Ga(e){var A=e.stack.pop();exports.DEBUG&&console.log(e.step,"JMPR[]",A),e.ip+=A-1}function Ra(e){var A=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCVTCI[]",A),e.cvCutIn=A/64}function Ua(e){var A=e.stack;exports.DEBUG&&console.log(e.step,"DUP[]"),A.push(A[A.length-1])}function Ve(e){exports.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function Na(e){exports.DEBUG&&console.log(e.step,"CLEAR[]"),e.stack.length=0}function ba(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"SWAP[]"),A.push(g),A.push(t)}function La(e){var A=e.stack;exports.DEBUG&&console.log(e.step,"DEPTH[]"),A.push(A.length)}function Ma(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"LOOPCALL[]",g,t);var I=e.ip,o=e.prog;e.prog=e.funcs[g];for(var i=0;i1?"loop "+(A.loop-r)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",B)}A.loop=1}function jg(e,A){var g=A.stack,t=e?A.rp1:A.rp2,I=(e?A.z0:A.z1)[t],o=A.fv,i=A.pv,r=g.pop(),C=A.z2[A.contours[r]],B=C;exports.DEBUG&&console.log(A.step,"SHC["+e+"]",r);var n=i.distance(I,I,!1,!0);do B!==I&&o.setRelative(B,B,n,i),B=B.nextPointOnContour;while(B!==C)}function zg(e,A){var g=A.stack,t=e?A.rp1:A.rp2,I=(e?A.z0:A.z1)[t],o=A.fv,i=A.pv,r=g.pop();exports.DEBUG&&console.log(A.step,"SHZ["+e+"]",r);var C;switch(r){case 0:C=A.tZone;break;case 1:C=A.gZone;break;default:throw new Error("Invalid zone")}for(var B,n=i.distance(I,I,!1,!0),Q=C.length-2,s=0;s1?"loop "+(e.loop-g)+": ":"")+"SHPIX[]",i,I),t.setRelative(r,r,I),t.touch(r)}e.loop=1}function Ta(e){for(var A=e.stack,g=e.rp1,t=e.rp2,I=e.loop,o=e.z0[g],i=e.z1[t],r=e.fv,C=e.dpv,B=e.z2;I--;){var n=A.pop(),Q=B[n];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-I)+": ":"")+"IP[]",n,g,"<->",t),r.interpolate(Q,o,i,C),r.touch(Q)}e.loop=1}function _g(e,A){var g=A.stack,t=g.pop()/64,I=g.pop(),o=A.z1[I],i=A.z0[A.rp0],r=A.fv,C=A.pv;r.setRelative(o,i,t,C),r.touch(o),exports.DEBUG&&console.log(A.step,"MSIRP["+e+"]",t,I),A.rp1=A.rp0,A.rp2=I,e&&(A.rp0=I)}function Va(e){for(var A=e.stack,g=e.rp0,t=e.z0[g],I=e.loop,o=e.fv,i=e.pv,r=e.z1;I--;){var C=A.pop(),B=r[C];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-I)+": ":"")+"ALIGNRP[]",C),o.setRelative(B,t,0,i),o.touch(B)}e.loop=1}function qa(e){exports.DEBUG&&console.log(e.step,"RTDG[]"),e.round=ra}function $g(e,A){var g=A.stack,t=g.pop(),I=g.pop(),o=A.z0[I],i=A.fv,r=A.pv,C=A.cvt[t];exports.DEBUG&&console.log(A.step,"MIAP["+e+"]",t,"(",C,")",I);var B=r.distance(o,Ee);e&&(Math.abs(B-C)",r),A.stack.push(Math.round(r*64))}function za(e){exports.DEBUG&&console.log(e.step,"MPPEM[]"),e.stack.push(e.ppem)}function _a(e){exports.DEBUG&&console.log(e.step,"FLIPON[]"),e.autoFlip=!0}function $a(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"LT[]",g,t),A.push(tg?1:0)}function gs(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"GTEQ[]",g,t),A.push(t>=g?1:0)}function ts(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"EQ[]",g,t),A.push(g===t?1:0)}function Is(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"NEQ[]",g,t),A.push(g!==t?1:0)}function os(e){var A=e.stack,g=A.pop();exports.DEBUG&&console.log(e.step,"ODD[]",g),A.push(Math.trunc(g)%2?1:0)}function is(e){var A=e.stack,g=A.pop();exports.DEBUG&&console.log(e.step,"EVEN[]",g),A.push(Math.trunc(g)%2?0:1)}function rs(e){var A=e.stack.pop();exports.DEBUG&&console.log(e.step,"IF[]",A),A||(gI(e,!0),exports.DEBUG&&console.log(e.step,"EIF[]"))}function Cs(e){exports.DEBUG&&console.log(e.step,"EIF[]")}function ns(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"AND[]",g,t),A.push(g&&t?1:0)}function Bs(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"OR[]",g,t),A.push(g||t?1:0)}function as(e){var A=e.stack,g=A.pop();exports.DEBUG&&console.log(e.step,"NOT[]",g),A.push(g?0:1)}function qe(e,A){var g=A.stack,t=g.pop(),I=A.fv,o=A.pv,i=A.ppem,r=A.deltaBase+(e-1)*16,C=A.deltaShift,B=A.z0;exports.DEBUG&&console.log(A.step,"DELTAP["+e+"]",t,g);for(var n=0;n>4);if(E===i){var h=(s&15)-8;h>=0&&h++,exports.DEBUG&&console.log(A.step,"DELTAPFIX",Q,"by",h*C);var w=B[Q];I.setRelative(w,w,h*C,o)}}}function ss(e){var A=e.stack,g=A.pop();exports.DEBUG&&console.log(e.step,"SDB[]",g),e.deltaBase=g}function Qs(e){var A=e.stack,g=A.pop();exports.DEBUG&&console.log(e.step,"SDS[]",g),e.deltaShift=Math.pow(.5,g)}function Es(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"ADD[]",g,t),A.push(t+g)}function ls(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"SUB[]",g,t),A.push(t-g)}function cs(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"DIV[]",g,t),A.push(t*64/g)}function hs(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"MUL[]",g,t),A.push(t*g/64)}function us(e){var A=e.stack,g=A.pop();exports.DEBUG&&console.log(e.step,"ABS[]",g),A.push(Math.abs(g))}function ds(e){var A=e.stack,g=A.pop();exports.DEBUG&&console.log(e.step,"NEG[]",g),A.push(-g)}function fs(e){var A=e.stack,g=A.pop();exports.DEBUG&&console.log(e.step,"FLOOR[]",g),A.push(Math.floor(g/64)*64)}function ws(e){var A=e.stack,g=A.pop();exports.DEBUG&&console.log(e.step,"CEILING[]",g),A.push(Math.ceil(g/64)*64)}function Fe(e,A){var g=A.stack,t=g.pop();exports.DEBUG&&console.log(A.step,"ROUND[]"),g.push(A.round(t/64)*64)}function ps(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"WCVTF[]",g,t),e.cvt[t]=g*e.ppem/e.font.unitsPerEm}function Oe(e,A){var g=A.stack,t=g.pop(),I=A.ppem,o=A.deltaBase+(e-1)*16,i=A.deltaShift;exports.DEBUG&&console.log(A.step,"DELTAC["+e+"]",t,g);for(var r=0;r>4);if(n===I){var Q=(B&15)-8;Q>=0&&Q++;var s=Q*i;exports.DEBUG&&console.log(A.step,"DELTACFIX",C,"by",s),A.cvt[C]+=s}}}function ys(e){var A=e.stack.pop();exports.DEBUG&&console.log(e.step,"SROUND[]",A),e.round=eI;var g;switch(A&192){case 0:g=.5;break;case 64:g=1;break;case 128:g=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=g,A&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*g;break;case 32:e.srPhase=.5*g;break;case 48:e.srPhase=.75*g;break;default:throw new Error("invalid SROUND value")}A&=15,A===0?e.srThreshold=0:e.srThreshold=(A/8-.5)*g}function Ds(e){var A=e.stack.pop();exports.DEBUG&&console.log(e.step,"S45ROUND[]",A),e.round=eI;var g;switch(A&192){case 0:g=Math.sqrt(2)/2;break;case 64:g=Math.sqrt(2);break;case 128:g=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=g,A&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*g;break;case 32:e.srPhase=.5*g;break;case 48:e.srPhase=.75*g;break;default:throw new Error("invalid S45ROUND value")}A&=15,A===0?e.srThreshold=0:e.srThreshold=(A/8-.5)*g}function ms(e){exports.DEBUG&&console.log(e.step,"ROFF[]"),e.round=ia}function Fs(e){exports.DEBUG&&console.log(e.step,"RUTG[]"),e.round=na}function ks(e){exports.DEBUG&&console.log(e.step,"RDTG[]"),e.round=Ba}function vs(e){var A=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANCTRL[]",A)}function gt(e,A){var g=A.stack,t=g.pop(),I=g.pop(),o=A.z2[t],i=A.z1[I];exports.DEBUG&&console.log(A.step,"SDPVTL["+e+"]",t,I);var r,C;e?(r=o.y-i.y,C=i.x-o.x):(r=i.x-o.x,C=i.y-o.y),A.dpv=de(r,C)}function Ss(e){var A=e.stack,g=A.pop(),t=0;exports.DEBUG&&console.log(e.step,"GETINFO[]",g),g&1&&(t=35),g&32&&(t|=4096),A.push(t)}function Gs(e){var A=e.stack,g=A.pop(),t=A.pop(),I=A.pop();exports.DEBUG&&console.log(e.step,"ROLL[]"),A.push(t),A.push(g),A.push(I)}function Rs(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"MAX[]",g,t),A.push(Math.max(t,g))}function Us(e){var A=e.stack,g=A.pop(),t=A.pop();exports.DEBUG&&console.log(e.step,"MIN[]",g,t),A.push(Math.min(t,g))}function Ns(e){var A=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANTYPE[]",A)}function bs(e){var A=e.stack.pop(),g=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"INSTCTRL[]",A,g),A){case 1:e.inhibitGridFit=!!g;return;case 2:e.ignoreCvt=!!g;return;default:throw new Error("invalid INSTCTRL[] selector")}}function qA(e,A){var g=A.stack,t=A.prog,I=A.ip;exports.DEBUG&&console.log(A.step,"PUSHB["+e+"]");for(var o=0;o=0?1:-1,u=Math.abs(u),e&&(f=o.cvt[r],t&&Math.abs(u-f)":"_")+(t?"R":"_")+(I===0?"Gr":I===1?"Bl":I===2?"Wh":"")+"]",e?r+"("+o.cvt[r]+","+f+")":"",C,"(d =",w,"->",l*u,")"),o.rp1=o.rp0,o.rp2=C,A&&(o.rp0=C)}zt=[Tg.bind(void 0,xA),Tg.bind(void 0,NA),Vg.bind(void 0,xA),Vg.bind(void 0,NA),qg.bind(void 0,xA),qg.bind(void 0,NA),Og.bind(void 0,0),Og.bind(void 0,1),Wg.bind(void 0,0),Wg.bind(void 0,1),sa,Qa,Ea,la,ca,ha,ua,da,fa,wa,pa,ya,Da,ma,Fa,ka,va,Sa,Ga,Ra,void 0,void 0,Ua,Ve,Na,ba,La,xa,Ha,void 0,void 0,void 0,Ma,Ja,Ya,void 0,Pg.bind(void 0,0),Pg.bind(void 0,1),Zg.bind(void 0,xA),Zg.bind(void 0,NA),Xg.bind(void 0,0),Xg.bind(void 0,1),jg.bind(void 0,0),jg.bind(void 0,1),zg.bind(void 0,0),zg.bind(void 0,1),Ka,Ta,_g.bind(void 0,0),_g.bind(void 0,1),Va,qa,$g.bind(void 0,0),$g.bind(void 0,1),Oa,Wa,Pa,Za,Xa,ja,At.bind(void 0,0),At.bind(void 0,1),void 0,et.bind(void 0,0),et.bind(void 0,1),za,void 0,_a,void 0,void 0,$a,As,es,gs,ts,Is,os,is,rs,Cs,ns,Bs,as,qe.bind(void 0,1),ss,Qs,Es,ls,cs,hs,us,ds,fs,ws,Fe.bind(void 0,0),Fe.bind(void 0,1),Fe.bind(void 0,2),Fe.bind(void 0,3),void 0,void 0,void 0,void 0,ps,qe.bind(void 0,2),qe.bind(void 0,3),Oe.bind(void 0,1),Oe.bind(void 0,2),Oe.bind(void 0,3),ys,Ds,void 0,void 0,ms,void 0,Fs,ks,Ve,Ve,void 0,void 0,void 0,void 0,void 0,vs,gt.bind(void 0,0),gt.bind(void 0,1),Ss,void 0,Gs,Rs,Us,Ns,bs,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,qA.bind(void 0,1),qA.bind(void 0,2),qA.bind(void 0,3),qA.bind(void 0,4),qA.bind(void 0,5),qA.bind(void 0,6),qA.bind(void 0,7),qA.bind(void 0,8),OA.bind(void 0,1),OA.bind(void 0,2),OA.bind(void 0,3),OA.bind(void 0,4),OA.bind(void 0,5),OA.bind(void 0,6),OA.bind(void 0,7),OA.bind(void 0,8),K.bind(void 0,0,0,0,0,0),K.bind(void 0,0,0,0,0,1),K.bind(void 0,0,0,0,0,2),K.bind(void 0,0,0,0,0,3),K.bind(void 0,0,0,0,1,0),K.bind(void 0,0,0,0,1,1),K.bind(void 0,0,0,0,1,2),K.bind(void 0,0,0,0,1,3),K.bind(void 0,0,0,1,0,0),K.bind(void 0,0,0,1,0,1),K.bind(void 0,0,0,1,0,2),K.bind(void 0,0,0,1,0,3),K.bind(void 0,0,0,1,1,0),K.bind(void 0,0,0,1,1,1),K.bind(void 0,0,0,1,1,2),K.bind(void 0,0,0,1,1,3),K.bind(void 0,0,1,0,0,0),K.bind(void 0,0,1,0,0,1),K.bind(void 0,0,1,0,0,2),K.bind(void 0,0,1,0,0,3),K.bind(void 0,0,1,0,1,0),K.bind(void 0,0,1,0,1,1),K.bind(void 0,0,1,0,1,2),K.bind(void 0,0,1,0,1,3),K.bind(void 0,0,1,1,0,0),K.bind(void 0,0,1,1,0,1),K.bind(void 0,0,1,1,0,2),K.bind(void 0,0,1,1,0,3),K.bind(void 0,0,1,1,1,0),K.bind(void 0,0,1,1,1,1),K.bind(void 0,0,1,1,1,2),K.bind(void 0,0,1,1,1,3),K.bind(void 0,1,0,0,0,0),K.bind(void 0,1,0,0,0,1),K.bind(void 0,1,0,0,0,2),K.bind(void 0,1,0,0,0,3),K.bind(void 0,1,0,0,1,0),K.bind(void 0,1,0,0,1,1),K.bind(void 0,1,0,0,1,2),K.bind(void 0,1,0,0,1,3),K.bind(void 0,1,0,1,0,0),K.bind(void 0,1,0,1,0,1),K.bind(void 0,1,0,1,0,2),K.bind(void 0,1,0,1,0,3),K.bind(void 0,1,0,1,1,0),K.bind(void 0,1,0,1,1,1),K.bind(void 0,1,0,1,1,2),K.bind(void 0,1,0,1,1,3),K.bind(void 0,1,1,0,0,0),K.bind(void 0,1,1,0,0,1),K.bind(void 0,1,1,0,0,2),K.bind(void 0,1,1,0,0,3),K.bind(void 0,1,1,0,1,0),K.bind(void 0,1,1,0,1,1),K.bind(void 0,1,1,0,1,2),K.bind(void 0,1,1,0,1,3),K.bind(void 0,1,1,1,0,0),K.bind(void 0,1,1,1,0,1),K.bind(void 0,1,1,1,0,2),K.bind(void 0,1,1,1,0,3),K.bind(void 0,1,1,1,1,0),K.bind(void 0,1,1,1,1,1),K.bind(void 0,1,1,1,1,2),K.bind(void 0,1,1,1,1,3)];function re(e){this.char=e,this.state={},this.activeState=null}function lg(e,A,g){this.contextName=g,this.startIndex=e,this.endOffset=A}function Ls(e,A,g){this.contextName=e,this.openRange=null,this.ranges=[],this.checkStart=A,this.checkEnd=g}function FA(e,A){this.context=e,this.index=A,this.length=e.length,this.current=e[A],this.backtrack=e.slice(0,A),this.lookahead=e.slice(A+1)}function xe(e){this.eventId=e,this.subscribers=[]}function Ms(e){var A=this,g=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];g.forEach(function(I){Object.defineProperty(A.events,I,{value:new xe(I)})}),e&&g.forEach(function(I){var o=e[I];typeof o=="function"&&A.events[I].subscribe(o)});var t=["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"];t.forEach(function(I){A.events[I].subscribe(A.updateContextsRanges)})}function BA(e){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],Ms.call(this,e)}re.prototype.setState=function(e,A){return this.state[e]=A,this.activeState={key:e,value:this.state[e]},this.activeState};re.prototype.getState=function(e){return this.state[e]||null};BA.prototype.inboundIndex=function(e){return e>=0&&e0&&e<=this.lookahead.length):return this.lookahead[e-1];default:return null}};BA.prototype.rangeToText=function(e){if(e instanceof lg)return this.getRangeTokens(e).map(function(A){return A.char}).join("")};BA.prototype.getText=function(){return this.tokens.map(function(e){return e.char}).join("")};BA.prototype.getContext=function(e){var A=this.registeredContexts[e];return A||null};BA.prototype.on=function(e,A){var g=this.events[e];return g?g.subscribe(A):null};BA.prototype.dispatch=function(e,A){var g=this,t=this.events[e];t instanceof xe&&t.subscribers.forEach(function(I){I.apply(g,A||[])})};BA.prototype.registerContextChecker=function(e,A,g){if(this.getContext(e))return{FAIL:"context name '"+e+"' is already registered."};if(typeof A!="function")return{FAIL:"missing context start check."};if(typeof g!="function")return{FAIL:"missing context end check."};var t=new Ls(e,A,g);return this.registeredContexts[e]=t,this.contextCheckers.push(t),t};BA.prototype.getRangeTokens=function(e){var A=e.startIndex+e.endOffset;return[].concat(this.tokens.slice(e.startIndex,A))};BA.prototype.getContextRanges=function(e){var A=this.getContext(e);return A?A.ranges:{FAIL:"context checker '"+e+"' is not registered."}};BA.prototype.resetContextsRanges=function(){var e=this.registeredContexts;for(var A in e)if(e.hasOwnProperty(A)){var g=e[A];g.ranges=[]}};BA.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var e=this.tokens.map(function(t){return t.char}),A=0;A=I.start&&e<=I.end){var o=e-I.start;return I.index+o}}break;default:return-1}return-1}function xs(e,A){var g=fe(e,A.coverage);return g===-1?null:e+A.deltaGlyphId}function Hs(e,A){var g=fe(e,A.coverage);return g===-1?null:A.substitute[g]}function We(e,A){for(var g=[],t=0;t=0;g--){var t=A[g],I=tI(t),o=jA(t);if(!I&&!o)return!0;if(I)return!1}return!1}function AQ(e){if(tI(e.current))return!1;for(var A=0;A0}g("fontFamily"),g("weightName"),g("manufacturer"),g("copyright"),g("version"),this.unitsPerEm>0};tA.prototype.toTables=function(){return _B.fontToTable(this)};tA.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()};tA.prototype.toArrayBuffer=function(){for(var e=this.toTables(),A=e.encode(),g=new ArrayBuffer(A.length),t=new Uint8Array(g),I=0;I=1.2&&(I.markGlyphSets=g.parsePointer(yQ)),I}var mQ={parse:DQ},kA=new Array(10);kA[1]=function(){var A=this.offset+this.relativeOffset,g=this.parseUShort();if(g===1)return{posFormat:1,coverage:this.parsePointer(y.coverage),value:this.parseValueRecord()};if(g===2)return{posFormat:2,coverage:this.parsePointer(y.coverage),values:this.parseValueRecordList()};W.assert(!1,"0x"+A.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")};kA[2]=function(){var A=this.offset+this.relativeOffset,g=this.parseUShort();W.assert(g===1||g===2,"0x"+A.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var t=this.parsePointer(y.coverage),I=this.parseUShort(),o=this.parseUShort();if(g===1)return{posFormat:g,coverage:t,valueFormat1:I,valueFormat2:o,pairSets:this.parseList(y.pointer(y.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(I),value2:this.parseValueRecord(o)}})))};if(g===2){var i=this.parsePointer(y.classDef),r=this.parsePointer(y.classDef),C=this.parseUShort(),B=this.parseUShort();return{posFormat:g,coverage:t,valueFormat1:I,valueFormat2:o,classDef1:i,classDef2:r,class1Count:C,class2Count:B,classRecords:this.parseList(C,y.list(B,function(){return{value1:this.parseValueRecord(I),value2:this.parseValueRecord(o)}}))}}};kA[3]=function(){return{error:"GPOS Lookup 3 not supported"}};kA[4]=function(){return{error:"GPOS Lookup 4 not supported"}};kA[5]=function(){return{error:"GPOS Lookup 5 not supported"}};kA[6]=function(){return{error:"GPOS Lookup 6 not supported"}};kA[7]=function(){return{error:"GPOS Lookup 7 not supported"}};kA[8]=function(){return{error:"GPOS Lookup 8 not supported"}};kA[9]=function(){return{error:"GPOS Lookup 9 not supported"}};function FQ(e,A){A=A||0;var g=new y(e,A),t=g.parseVersion(1);return W.argument(t===1||t===1.1,"Unsupported GPOS table version "+t),t===1?{version:t,scripts:g.parseScriptList(),features:g.parseFeatureList(),lookups:g.parseLookupList(kA)}:{version:t,scripts:g.parseScriptList(),features:g.parseFeatureList(),lookups:g.parseLookupList(kA),variations:g.parseFeatureVariationsList()}}var kQ=new Array(10);function vQ(e){return new Y.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new Y.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new Y.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new Y.LookupList(e.lookups,kQ)}])}var SQ={parse:FQ,make:vQ};function GQ(e){var A={};e.skip("uShort");var g=e.parseUShort();W.argument(g===0,"Unsupported kern sub-table version."),e.skip("uShort",2);var t=e.parseUShort();e.skip("uShort",3);for(var I=0;I1&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");var t=e.parseUShort(),I=t&255;if(e.skip("uShort"),I===0){var o=e.parseUShort();e.skip("uShort",3);for(var i=0;i"u",I=t&&!g.isUrl?MQ:JQ;return new Promise(function(o,i){I(e,function(r,C){if(r){if(A)return A(r);i(r)}var B;try{B=ug(C,g)}catch(n){if(A)return A(n,null);i(n)}if(A)return A(null,B);o(B)})})}function YQ(e,A){var g=require("fs"),t=g.readFileSync(e);return ug(Wt(t),A)}var og=Object.freeze({__proto__:null,Font:tA,Glyph:uA,Path:QA,BoundingBox:VA,_parse:T,parse:ug,load:HQ,loadSync:YQ});const KQ=()=>sI(()=>import("./ft_render-ByO_jG18.js"),[],import.meta.url);let R=null,le=0;const TQ=new Promise(e=>{KQ().then(A=>{A.default().then(g=>{R=g,e()})})});function rt(e){return e/65536}function yA(e){return e/64}function ne(e){return e>=0?e:e+256}let oI,iI,rI,dg,CI,nI,BI;async function VQ(){if(await TQ,R._init_constants(),oI=R.cwrap("FT_New_Memory_Face","number",["number","number","number","number","number"]),iI=R.cwrap("FT_Set_Char_Size","number",["number","number","number","number","number"]),rI=R.cwrap("FT_Set_Pixel_Sizes","number",["number","number","number"]),dg=R.cwrap("FT_Get_Char_Index","number",["number","number"]),CI=R.cwrap("FT_Load_Glyph","number",["number","number","number"]),nI=R.cwrap("FT_Get_Sfnt_Table","number",["number","number"]),R.cwrap("FT_Get_Kerning","number",["number","number","number","number","number"]),BI=R.cwrap("FT_Done_Face","number",["number"]),!le){let e=R._malloc(4);try{let A=R.ccall("FT_Init_FreeType","number",["number"],[e]);if(A)throw new Error(`error in FT_Init_FreeType: ${A}`);le=R.getValue(e,"i32")}finally{R._free(e)}}}function qQ(e,A){let g,t;if(e instanceof ArrayBuffer)t=e.byteLength;else if(e instanceof Uint8Array)t=e.byteLength;else if(e&&typeof e.length=="number")t=e.length;else throw new Error("Invalid font source format");let I={ptr:0,font:R._malloc(t)};const o=e instanceof ArrayBuffer?new Uint8Array(e):e;R.writeArrayToMemory(o,I.font);let i=R._malloc(4);try{if(g=oI(le,I.font,t,0,i),g)throw new Error(`error in FT_New_Memory_Face: ${g}`);I.ptr=R.getValue(i,"i32")}finally{R._free(i)}if(g=iI(I.ptr,0,A*64,300,300),g)throw new Error(`error in FT_Set_Char_Size: ${g}`);if(g=rI(I.ptr,0,A),g)throw new Error(`error in FT_Set_Pixel_Sizes: ${g}`);let r=R.getValue(I.ptr+R.OFFSET_FACE_UNITS_PER_EM,"i16"),C=R.getValue(I.ptr+R.OFFSET_FACE_ASCENDER,"i16"),B=R.getValue(I.ptr+R.OFFSET_FACE_DESCENDER,"i16"),n=R.getValue(I.ptr+R.OFFSET_FACE_HEIGHT,"i16");return Object.assign(I,{units_per_em:r,ascender:C,descender:B,height:n})}function OQ(e){let A=nI(e.ptr,R.FT_SFNT_OS2);if(!A)throw new Error("os/2 table not found for this font");let g=R.getValue(A+R.OFFSET_TT_OS2_ASCENDER,"i16"),t=R.getValue(A+R.OFFSET_TT_OS2_DESCENDER,"i16"),I=R.getValue(A+R.OFFSET_TT_OS2_LINEGAP,"i16");return{typoAscent:g,typoDescent:t,typoLineGap:I}}function Ze(e,A){return dg(e.ptr,A)!==0}function WQ(e,A,g={}){let t=dg(e.ptr,A);if(t===0)throw new Error(`glyph does not exist for codepoint ${A}`);let I=R.FT_LOAD_RENDER;g.mono?I|=R.FT_LOAD_TARGET_MONO:g.lcd?I|=R.FT_LOAD_TARGET_LCD:g.lcd_v?I|=R.FT_LOAD_TARGET_LCD_V:g.autohint_strong?I|=R.FT_LOAD_TARGET_NORMAL:I|=R.FT_LOAD_TARGET_LIGHT,g.autohint_off?I|=R.FT_LOAD_NO_AUTOHINT:I|=R.FT_LOAD_FORCE_AUTOHINT,g.use_color_info&&(I|=R.FT_LOAD_COLOR);let o=CI(e.ptr,t,I);if(o)throw new Error(`error in FT_Load_Glyph: ${o}`);let i=R.getValue(e.ptr+R.OFFSET_FACE_GLYPH,"i32"),r={glyph_index:R.getValue(i+R.OFFSET_GLYPH_INDEX,"i32"),metrics:{width:yA(R.getValue(i+R.OFFSET_GLYPH_METRICS_WIDTH,"i32")),height:yA(R.getValue(i+R.OFFSET_GLYPH_METRICS_HEIGHT,"i32")),horiBearingX:yA(R.getValue(i+R.OFFSET_GLYPH_METRICS_HORI_BEARING_X,"i32")),horiBearingY:yA(R.getValue(i+R.OFFSET_GLYPH_METRICS_HORI_BEARING_Y,"i32")),horiAdvance:yA(R.getValue(i+R.OFFSET_GLYPH_METRICS_HORI_ADVANCE,"i32")),vertBearingX:yA(R.getValue(i+R.OFFSET_GLYPH_METRICS_VERT_BEARING_X,"i32")),vertBearingY:yA(R.getValue(i+R.OFFSET_GLYPH_METRICS_VERT_BEARING_Y,"i32")),vertAdvance:yA(R.getValue(i+R.OFFSET_GLYPH_METRICS_VERT_ADVANCE,"i32"))},linearHoriAdvance:rt(R.getValue(i+R.OFFSET_GLYPH_LINEAR_HORI_ADVANCE,"i32")),linearVertAdvance:rt(R.getValue(i+R.OFFSET_GLYPH_LINEAR_VERT_ADVANCE,"i32")),advance:{x:yA(R.getValue(i+R.OFFSET_GLYPH_ADVANCE_X,"i32")),y:yA(R.getValue(i+R.OFFSET_GLYPH_ADVANCE_Y,"i32"))},bitmap:{width:R.getValue(i+R.OFFSET_GLYPH_BITMAP_WIDTH,"i32"),rows:R.getValue(i+R.OFFSET_GLYPH_BITMAP_ROWS,"i32"),pitch:R.getValue(i+R.OFFSET_GLYPH_BITMAP_PITCH,"i32"),num_grays:R.getValue(i+R.OFFSET_GLYPH_BITMAP_NUM_GRAYS,"i16"),pixel_mode:R.getValue(i+R.OFFSET_GLYPH_BITMAP_PIXEL_MODE,"i8"),palette_mode:R.getValue(i+R.OFFSET_GLYPH_BITMAP_PALETTE_MODE,"i8")},bitmap_left:R.getValue(i+R.OFFSET_GLYPH_BITMAP_LEFT,"i32"),bitmap_top:R.getValue(i+R.OFFSET_GLYPH_BITMAP_TOP,"i32"),lsb_delta:yA(R.getValue(i+R.OFFSET_GLYPH_LSB_DELTA,"i32")),rsb_delta:yA(R.getValue(i+R.OFFSET_GLYPH_RSB_DELTA,"i32"))},C=r.bitmap.width,B=r.bitmap.rows,n=r.bitmap_left,Q=r.bitmap_top,s=R.getValue(i+R.OFFSET_GLYPH_BITMAP_BUFFER,"i32"),E=Math.abs(r.bitmap.pitch),h=r.linearHoriAdvance,w=r.linearVertAdvance,u=r.bitmap.pixel_mode,l=[];for(let f=0;f255&&(k=255),X=(255-k)*X/255,D.push(X)}else{let v=R.getValue(c+p,"i8");D.push(ne(v))}l.push(D)}return{x:n,y:Q,width:C,height:B,advance_x:h,advance_y:w,pixels:l,freetype:r}}function PQ(e){let A=BI(e.ptr);if(A)throw new Error(`error in FT_Done_Face: ${A}`);R._free(e.font),e.ptr=0,e.font=0}function ZQ(){let e=R.ccall("FT_Done_FreeType","number",["number"],[le]);if(e)throw new Error(`error in FT_Done_FreeType: ${e}`);le=0}class KA extends Error{constructor(A){super(A),this.name="AppError",Error.captureStackTrace&&Error.captureStackTrace(this,KA)}}class XQ{constructor(){this.data={}}add_range(A,g,t,I){let o=I-g,i=[];for(let r=g;r<=t;r++)this._set_char(A,r,r+o),i.push(r);return i}add_symbols(A,g){let t=[];for(let I of g){let o=I.codePointAt(0);this._set_char(A,o,o),t.push(o)}return t}_set_char(A,g,t){this.data[t]={font:A,code:g}}get(){return this.data}}async function jQ(e){await VQ();let A={};e.font.forEach(s=>{A[s.source_path]=s});let g={},t={};for(let{source_path:s,source_bin:E}of e.font)if(!g[s])try{let h=E;h instanceof File?h=await h.arrayBuffer():h instanceof Uint8Array&&(h=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength)),g[s]=og.parse(h),t[s]=qQ(h,e.size)}catch(h){throw new KA(`Cannot load font "${s}": ${h.message}`)}let I=new XQ;for(let{source_path:s,ranges:E}of e.font){let h=t[s];for(let w of E){if(w.range)for(let u=0;us-E).map(Number);for(let s of r){let E=o[s].code,h=o[s].font;if(!Ze(t[h],E))continue;let w=WQ(t[h],E,{autohint_off:A[h].autohint_off,autohint_strong:A[h].autohint_strong,lcd:e.lcd,lcd_v:e.lcd_v,mono:!e.lcd&&!e.lcd_v&&e.bpp===1,use_color_info:e.use_color_info});i.push({code:s,advanceWidth:w.advance_x,bbox:{x:w.x,y:w.y-w.height,width:w.width,height:w.height},kerning:{},freetype:w.freetype,pixels:w.pixels})}if(!e.no_kerning){let s=i.map(E=>E.code);for(let{code:E,kerning:h}of i){let w=o[E].code,u=o[E].font,l=g[u],f=l.charToGlyph(String.fromCodePoint(w));for(let c of s){if(o[c].font!==u)continue;let D=o[c].code,p=l.charToGlyph(String.fromCodePoint(D)),v=l.getKerningValue(f,p);v&&(h[c]=v*e.size/l.unitsPerEm)}}}let C=t[e.font[0].source_path],B=e.size/C.units_per_em,n=OQ(C),Q=g[e.font[0].source_path].tables.post;for(let s of Object.values(t))PQ(s);return ZQ(),{ascent:Math.max(...i.map(s=>s.bbox.y+s.bbox.height)),descent:Math.min(...i.map(s=>s.bbox.y)),typoAscent:Math.round(n.typoAscent*B),typoDescent:Math.round(n.typoDescent*B),typoLineGap:Math.round(n.typoLineGap*B),size:e.size,glyphs:i,underlinePosition:Math.round(Q.underlinePosition*B),underlineThickness:Math.round(Q.underlineThickness*B)}}function zQ(){return 16}function _Q(e,A){return 16+(A-e+1)}function $Q(e){return 16+e*2}function Ct(e){e=e.sort((t,I)=>t-I);let A=[];for(let t=0;t=0?A[o-1].dist:0,r;e[t]-e[o]<256&&(r=_Q(e[o],e[t]),i+r=0;){let I=A[t];g.unshift([I.format,e.slice(I.start,I.end+1)]),t=I.start-1}return g}const hA=4,AE=(e,A,g)=>{e.setUint32(g,A,!0),e.setUint32(g+4,0,!0)};class eE{constructor(A,g){if(this.src=A,this.opts=g,this.font_name=g.lv_font_name,this.font_name||(this.font_name=g.output||"font"),g.bpp===3&&g.no_compress)throw new KA('LVGL supports "--bpp 3" with compression only');this.init_tables()}init_tables(){this.head=new gE(this),this.glyf=new IE(this),this.cmap=new oE(this),this.kern=new iE(this)}toCBin(){const[A,g]=this.glyf.toCBin(),t=this.cmap.toCBin(hA),I=this.kern.toCBin(hA),o=12+hA*6+0,i=8+hA*4,r=new ArrayBuffer(o+i),C=new DataView(r),B=(u,l)=>C.setUint32(l,u,!0);var n=0;B(0,n),n+=hA,B(0,n),n+=hA,B(0,n),n+=hA,C.setUint32(n,this.src.ascent-this.src.descent,!0),n+=4,C.setInt32(n,-this.src.descent,!0),n+=4,C.setUint8(n,this.src.subpixels_mode||0),n+=1,C.setInt8(n,this.src.underlinePosition||0),n+=1,C.setInt8(n,this.src.underlineThickness||0),n+=1,n+=1,B(o,n),n+=hA,B(0,n),n+=hA,B(0,n),n+=hA;const Q=this.head.kern_ref();B(i+I.byteLength,n),n+=hA,B(i+I.byteLength+A.byteLength,n),n+=hA,B(i+I.byteLength+A.byteLength+g.byteLength,n),n+=hA,B(Q.dsc==="NULL"?0:i,n),n+=hA,C.setUint16(n,Q.scale,!0),n+=2;const s=this.cmap.getMapNumber(),E=this.opts.bpp,h=Q.classes,w=this.glyf.getCompressionCode();return C.setUint16(n,s|E<<9|h<<13|w<<14,!0),n+=2,this.concatArrayBuffers([r,I,A,g,t])}concatArrayBuffers(A){const g=A.reduce((i,r)=>i+r.byteLength,0),t=new ArrayBuffer(g),I=new Uint8Array(t);let o=0;for(const i of A)I.set(new Uint8Array(i),o),o+=i.byteLength;return t}}class gE{constructor(A){this.font=A}kern_ref(){return this.font,{scale:0,dsc:"NULL",classes:0}}}class tE{constructor(A){this.buffer=new Uint8Array(A),this.byteIndex=0,this.bitIndex=0,this.bigEndian=!0}writeBits(A,g){for(;g>0;){const t=Math.min(8-this.bitIndex,g),I=(1<>g-t&I;this.bigEndian?this.buffer[this.byteIndex]|=o<<8-this.bitIndex-t:this.buffer[this.byteIndex]|=o<=8&&(this.byteIndex++,this.bitIndex=0),g-=t}}getUsedBytes(){return this.bitIndex>0?this.byteIndex+1:this.byteIndex}}class IE{constructor(A){this.font=A,this.lv_data=[],this.lv_compiled=!1}pixelsToBpp(A){const g=this.font.opts.bpp;return A.map(t=>t.map(I=>I>>>8-g))}storePixels(A,g){this.getCompressionCode()===0?this.storePixelsRaw(A,g):this.storePixelsCompressed(A,g)}storePixelsRaw(A,g){const t=this.font.opts.bpp;for(let I=0;I{const I=A.glyph_id[t.code],o=this.lv_bitmap(t);this.lv_data[I]={bin:o,offset:g,glyph:t},g+=o.byteLength})}toCBin(){this.lv_compile();const A=this.lv_data.slice(1).filter(i=>i).map(i=>i.bin),g=this.balign4(this.concatArrayBuffers(A)),t=new ArrayBuffer(this.lv_data.length*16+16),I=new DataView(t);let o=1;return this.lv_data.forEach(i=>{if(i){const r=Math.round(i.glyph.advanceWidth*16);I.setUint32(o*16,i.offset,!0),I.setUint32(o*16+4,r,!0),I.setUint16(o*16+8,i.glyph.bbox.width,!0),I.setUint16(o*16+10,i.glyph.bbox.height,!0),I.setInt16(o*16+12,i.glyph.bbox.x,!0),I.setInt16(o*16+14,i.glyph.bbox.y,!0)}o++}),[g,t]}balign4(A){const g=A.byteLength%4;if(g===0)return A;const t=4-g,I=new ArrayBuffer(t);return this.concatArrayBuffers([A,I])}concatArrayBuffers(A){const g=A.reduce((i,r)=>i+r.byteLength,0),t=new ArrayBuffer(g),I=new Uint8Array(t);let o=0;for(const i of A)I.set(new Uint8Array(i),o),o+=i.byteLength;return t}getCompressionCode(){return this.font.opts.no_compress||this.font.opts.bpp===1?0:this.font.opts.no_prefilter?2:1}}class oE{constructor(A){this.font=A,this.lv_compiled=!1,this.lv_subtables=[],this.subtables_plan=null,this.buildGlyphIdMap()}buildGlyphIdMap(){const A=this.font;A.glyph_id={},A.src.glyphs&&A.src.glyphs.forEach((g,t)=>{A.glyph_id[g.code]=t+1})}lv_format2enum(A){switch(A){case"format0_tiny":return"LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY";case"format0":return"LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL";case"sparse_tiny":return"LV_FONT_FMT_TXT_CMAP_SPARSE_TINY";case"sparse":return"LV_FONT_FMT_TXT_CMAP_SPARSE_FULL";default:throw new Error("Unknown subtable format")}}lv_format2int(A){return["format0","sparse","format0_tiny","sparse_tiny"].indexOf(A)}getMapNumber(){if(!this.subtables_plan){const A=this.font;if(!A.src.glyphs||A.src.glyphs.length===0)return 0;this.subtables_plan=Ct(A.src.glyphs.map(g=>g.code))}return this.subtables_plan.length}glyphByCode(A){const g=this.font;return g.src.glyphs?g.src.glyphs.find(t=>t.code===A):null}collect_format0_data(A,g,t){const I=this.font,o=[];for(let i=A;i<=g;i++){const r=I.glyph_id[i]||0;o.push(r?r-t:0)}return o}collect_sparse_data(A,g){const t=this.font;let I=[],o=[];for(let i of A){let r=this.glyphByCode(i),C=t.glyph_id[r.code],B=i-A[0],n=C-g;if(B<0||B>65535)throw new Error("Codepoint delta out of range");if(n<0||n>65535)throw new Error("Glyph ID delta out of range");I.push(B),o.push(n)}return{codes:I,ids:o}}toCBin(A){const g=this.font;if(!g.src.glyphs||g.src.glyphs.length===0)return new ArrayBuffer(0);this.subtables_plan||(this.subtables_plan=Ct(g.src.glyphs.map(Q=>Q.code)));const t=this.subtables_plan;let I=0;const o=12+A*2+(A==4?0:4),i=new ArrayBuffer(t.length*o),r=new DataView(i),C=A==4?(Q,s)=>r.setUint32(s,Q,!0):(Q,s)=>AE(r,Q,s),B=[];let n=i.byteLength;for(let[Q,s]of t){let E=this.glyphByCode(s[0]),h=g.glyph_id[E.code],w=s[0],u=s[s.length-1],l=!1,f=!1,c=0,D=new ArrayBuffer(0),p=new ArrayBuffer(0);if(Q!=="format0_tiny")if(Q==="format0"){f=!0;let N=this.collect_format0_data(w,u,h);c=N.length,D=this.balign4(this.uint8ArrayToBuffer(new Uint8Array(N)))}else if(Q==="sparse_tiny"){l=!0;let N=this.collect_sparse_data(s,h);c=N.codes.length,p=this.balign4(this.uint16ArrayToBuffer(new Uint16Array(N.codes)))}else{l=!0,f=!0;let N=this.collect_sparse_data(s,h);c=N.codes.length,p=this.balign4(this.uint16ArrayToBuffer(new Uint16Array(N.codes))),D=this.align4(this.uint16ArrayToBuffer(new Uint16Array(N.ids)))}let v=I*o;r.setUint32(v,w,!0),v+=4,r.setUint16(v,u-w+1,!0),v+=2,r.setUint16(v,h,!0),v+=2,C(l?n:0,v),v+=A,n+=p.byteLength,C(f?n:0,v),v+=A,n+=D.byteLength,r.setUint16(v,c,!0),v+=2,r.setUint8(v,this.lv_format2int(Q)),v+=1,B.push(p),B.push(D),I++}return this.concatArrayBuffers([i,...B])}balign4(A){const g=A.byteLength%4;if(g===0)return A;const t=4-g,I=new ArrayBuffer(t);return this.concatArrayBuffers([A,I])}align4(A){const g=A.byteLength%4;if(g===0)return A;const t=4-g,I=new ArrayBuffer(t);return this.concatArrayBuffers([A,I])}uint8ArrayToBuffer(A){const g=new ArrayBuffer(A.byteLength);return new Uint8Array(g).set(A),g}uint16ArrayToBuffer(A){return A.buffer.slice(0,A.byteLength)}concatArrayBuffers(A){const g=A.reduce((i,r)=>i+r.byteLength,0),t=new ArrayBuffer(g),I=new Uint8Array(t);let o=0;for(const i of A)I.set(new Uint8Array(i),o),o+=i.byteLength;return t}}class iE{constructor(A){this.font=A}toCBin(A){return new ArrayBuffer(0)}}function rE(e,A){if(!e.output)throw new KA('Output is required for "cbin" writer');const t=new eE(A,e).toCBin();return{[e.output]:t}}class CE{constructor(){this.initialized=!1,this.supportedFormats=["ttf","woff","woff2","otf"],this.charsetCache=new Map}async initialize(){if(!this.initialized)try{if(typeof og>"u")throw new Error("opentype.js not loaded");this.initialized=!0,console.log("BrowserFontConverter initialized")}catch(A){throw console.error("BrowserFontConverter initialization failed:",A),A}}validateFont(A){if(!A)return!1;if(A instanceof File){const g=A.name.toLowerCase(),t=A.type.toLowerCase(),I=this.supportedFormats.some(i=>g.endsWith(`.${i}`)),o=["font/ttf","font/truetype","application/x-font-ttf","font/woff","font/woff2","application/font-woff","font/otf","application/x-font-otf"].some(i=>t.includes(i));return I||o}return A instanceof ArrayBuffer&&A.byteLength>0}async getFontInfo(A){try{let g;if(A instanceof File)g=await A.arrayBuffer();else if(A instanceof ArrayBuffer)g=A;else throw new Error("Unsupported font file type");const t=og.parse(g);return{familyName:this.getLocalizedName(t.names.fontFamily)||"Unknown",fullName:this.getLocalizedName(t.names.fullName)||"Unknown",postScriptName:this.getLocalizedName(t.names.postScriptName)||"Unknown",version:this.getLocalizedName(t.names.version)||"Unknown",unitsPerEm:t.unitsPerEm,ascender:t.ascender,descender:t.descender,numGlyphs:t.numGlyphs,supported:!0}}catch(g){return console.error("Failed to get font information:",g),{familyName:"Unknown",supported:!1,error:g.message}}}getLocalizedName(A){return A?A.en||A[Object.keys(A)[0]]:null}async convertToCBIN(A){this.initialized||await this.initialize();const{fontFile:g,fontName:t,fontSize:I=20,bpp:o=4,charset:i="deepseek",symbols:r="",range:C="",compression:B=!1,lcd:n=!1,lcd_v:Q=!1,progressCallback:s=null}=A;if(!this.validateFont(g))throw new KA("Unsupported font file format");try{s&&s(0,"Starting font processing...");let E;g instanceof File?E=await g.arrayBuffer():E=g,s&&s(10,"Parsing font structure...");const{ranges:h,charSymbols:w}=await this.parseCharacterInputAsync(i,r,C);s&&s(20,"Preparing conversion parameters...");const u={font:[{source_path:t||"custom_font",source_bin:E,ranges:[{range:h,symbols:w}],autohint_off:!1,autohint_strong:!1}],size:I,bpp:o,lcd:n,lcd_v:Q,no_compress:!B,no_kerning:!1,use_color_info:!1,format:"cbin",output:t||"font"};s&&s(30,"Collecting font data...");const l=await jQ(u);s&&s(70,"Generating CBIN format...");const f=rE(u,l),c=u.output;return s&&s(100,"Conversion completed!"),f[c]}catch(E){throw console.error("Font conversion failed:",E),new KA(`Font conversion failed: ${E.message}`)}}async parseCharacterInputAsync(A,g,t){let I=[],o=g||"";return A==="full"?(I=[0,65535,0],{ranges:I,charSymbols:o}):(A&&A!=="custom"&&(o=await this.getCharsetContentAsync(A)+o),t&&(I=this.parseUnicodeRange(t)),{ranges:I,charSymbols:o})}parseCharacterInput(A,g,t){let I=[],o=g||"";return A==="full"?(I=[0,65535,0],{ranges:I,charSymbols:o}):(A&&A!=="custom"&&(o=this.getCharsetContent(A)+o),t&&(I=this.parseUnicodeRange(t)),{ranges:I,charSymbols:o})}async loadCharsetFromFile(A){const t={latin:"./static/charsets/latin1.txt",deepseek:"./static/charsets/deepseek.txt",qwen:"./static/charsets/qwen18409.txt"}[A];if(!t)return null;try{const I=await fetch(t);if(!I.ok)throw new Error(`Failed to load charset file: ${I.status}`);const i=(await I.text()).split(` +`).join("");return this.charsetCache.set(A,i),i}catch(I){return console.error(`Failed to load charset ${A}:`,I),null}}getCharsetContent(A){const g={};return(A==="latin"||A==="deepseek"||A==="qwen")&&this.charsetCache.has(A)?this.charsetCache.get(A):A==="basic"?this.getCharsetContent("latin"):g[A]||""}async getCharsetContentAsync(A){if(A==="basic"&&(A="latin"),this.charsetCache.has(A))return this.charsetCache.get(A);if(A==="latin"||A==="deepseek"||A==="qwen"){const g=await this.loadCharsetFromFile(A);if(g)return g}return this.getCharsetContent(A)}parseUnicodeRange(A){const g=[],t=A.split(",");for(const I of t){const o=I.trim();if(o)if(o.includes("-")){const[i,r]=o.split("-"),C=this.parseHexOrDec(i),B=this.parseHexOrDec(r);C!==null&&B!==null&&g.push(C,B,C)}else{const i=this.parseHexOrDec(o);i!==null&&g.push(i,i,i)}}return g}parseHexOrDec(A){const g=A.trim();if(g.startsWith("0x")||g.startsWith("0X")){const I=parseInt(g,16);return isNaN(I)?null:I}const t=parseInt(g,10);return isNaN(t)?null:t}async estimateSizeAsync(A){const{fontSize:g=20,bpp:t=4,charset:I="latin",symbols:o="",range:i=""}=A;let r=o.length;if(I==="full")r=65536;else if(I&&I!=="custom"){const n=await this.getCharsetContentAsync(I);r+=n.length}if(i){const n=this.parseUnicodeRange(i);for(let Q=0;Q0}catch(A){return console.error("Failed to load FST model",A),!1}}packString(A,g){const t=new Uint8Array(g),I=Math.min(A.length,g);for(let o=0;o>8&255,g[2]=A>>16&255,g[3]=A>>24&255,g}packModels(){if(this.models.size===0)throw new Error("No model data available for packing");let A=0;const g=[];for(const[B,n]of Array.from(this.models.entries()).sort((Q,s)=>Q[0].localeCompare(s[0]))){A+=n.size;const Q=Array.from(n.entries()).sort((s,E)=>s[0].localeCompare(E[0]));g.push({name:B,files:Q})}const t=this.models.size;let I=4;for(const B of g)I+=36,I+=B.files.length*40;const o=I+Array.from(this.models.values()).reduce((B,n)=>B+Array.from(n.values()).reduce((Q,s)=>Q+s.byteLength,0),0),i=new Uint8Array(o);let r=0;i.set(this.packUint32(t),r),r+=4;let C=I;for(const B of g){i.set(this.packString(B.name,32),r),r+=32,i.set(this.packUint32(B.files.length),r),r+=4;for(const[n,Q]of B.files)i.set(this.packString(n,32),r),r+=32,i.set(this.packUint32(C),r),r+=4,i.set(this.packUint32(Q.byteLength),r),r+=4,C+=Q.byteLength}for(const B of g)for(const[n,Q]of B.files)i.set(new Uint8Array(Q),r),r+=Q.byteLength;return i.buffer}static isValidModel(A,g){return g==="esp32c3"||g==="esp32c6"?A.startsWith("wn9s_"):A.startsWith("wn9_")}clear(){this.models.clear()}getStats(){let A=0,g=0;for(const t of this.models.values()){A+=t.size;for(const I of t.values())g+=I.byteLength}return{modelCount:this.models.size,fileCount:A,totalSize:g,models:Array.from(this.models.keys())}}validatePackingCompatibility(){const A="test_model",g=this.packString(A,32),t=305419896,I=this.packUint32(t);return{stringPacking:{input:A,output:Array.from(g).map(o=>`0x${o.toString(16).padStart(2,"0")}`),isASCII:g.every((o,i)=>i>=A.length||o===A.charCodeAt(i))},intPacking:{input:`0x${t.toString(16)}`,output:Array.from(I).map(o=>`0x${o.toString(16).padStart(2,"0")}`),isLittleEndian:I[0]===120&&I[3]===18}}}}class aE{constructor(){this.files=[],this.textEncoder=new TextEncoder}addFile(A,g,t={}){A.length>32&&console.warn(`Filename "${A}" exceeds 32 bytes and will be truncated`),this.files.push({filename:A,data:g,size:g.byteLength,width:t.width||0,height:t.height||0})}async getImageDimensions(A){return new Promise(g=>{try{const t=new Blob([A]),I=URL.createObjectURL(t),o=new Image;o.onload=()=>{URL.revokeObjectURL(I),g({width:o.width,height:o.height})},o.onerror=()=>{URL.revokeObjectURL(I),g({width:0,height:0})},o.src=I}catch{g({width:0,height:0})}})}parseSpecialImageFormat(A,g){const t=A.toLowerCase().split(".").pop();if([".sjpg",".spng",".sqoi"].includes("."+t))try{const I=new DataView(g),o=I.getUint16(14,!0),i=I.getUint16(16,!0);return{width:o,height:i}}catch(I){console.warn(`Failed to parse special image format: ${A}`,I)}return{width:0,height:0}}packUint32(A){const g=new Uint8Array(4);return g[0]=A&255,g[1]=A>>8&255,g[2]=A>>16&255,g[3]=A>>24&255,g}packUint16(A){const g=new Uint8Array(2);return g[0]=A&255,g[1]=A>>8&255,g}packString(A,g){const t=new Uint8Array(g),I=this.textEncoder.encode(A),o=Math.min(I.length,g);return t.set(I.slice(0,o),0),t}computeChecksum(A){let g=0;for(let t=0;t{const I=g.filename.split(".").pop()||"",o=t.filename.split(".").pop()||"";if(I!==o)return I.localeCompare(o);const i=g.filename.replace(/\.[^/.]+$/,""),r=t.filename.replace(/\.[^/.]+$/,"");return i.localeCompare(r)})}async generate(A=null){if(this.files.length===0)throw new Error("No files to package");A&&A(0,"Starting to package files...");const g=this.sortFiles(this.files),t=g.length,I=[];let o=0;for(let f=0;f0||v.height>0)D=v.width,p=v.height;else{const N=c.filename.toLowerCase().split(".").pop();if(["png","jpg","jpeg","gif","bmp","webp"].includes(N)){const L=await this.getImageDimensions(c.data);D=L.width,p=L.height}}}I.push({filename:c.filename,data:c.data,size:c.size,offset:o,width:D,height:p}),o+=2+c.size}A&&A(40,"Building file mapping table...");const i=t*44,r=new Uint8Array(i);let C=0;for(const f of I)r.set(this.packString(f.filename,32),C),C+=32,r.set(this.packUint32(f.size),C),C+=4,r.set(this.packUint32(f.offset),C),C+=4,r.set(this.packUint16(f.width),C),C+=2,r.set(this.packUint16(f.height),C),C+=2;A&&A(60,"Merging file data...");const B=new Uint8Array(o);let n=0;for(let f=0;f0?Math.round(A/this.files.length):0}}printFileList(){if(console.log("=== Packaged File List ==="),console.log(`Total files: ${this.files.length}`),this.files.length===0){console.log("No files available");return}this.sortFiles(this.files).forEach((t,I)=>{var C;const o=((C=t.filename.split(".").pop())==null?void 0:C.toLowerCase())||"unknown",i=(t.size/1024).toFixed(2),r=t.width&&t.height?`${t.width}x${t.height}`:"N/A";console.log(`${String(I+1).padStart(3," ")}. ${t.filename}`),console.log(` Type: ${o.toUpperCase()}`),console.log(` Size: ${i} KB (${t.size} bytes)`),console.log(` Dimensions: ${r}`),console.log("")});const g=this.getStats();console.log("=== File Statistics ==="),console.log(`Total size: ${(g.totalSize/1024).toFixed(2)} KB`),console.log(`Average size: ${(g.averageFileSize/1024).toFixed(2)} KB`),console.log("File type distribution:"),Object.entries(g.fileTypes).forEach(([t,I])=>{console.log(` ${t.toUpperCase()}: ${I} files`)})}clear(){this.files=[]}}let ke={tool:{workerLocalUrl:`var gifsicle=function(){Me="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(Me=Me||__filename);var Me,c=function(e){var j,r,h=void 0!==(e=e||{})?e:{},t=(h.ready=new Promise(function(e,r){j=e}),h.preRun=h.preRun||[],h.preRun.push(function(){if(h.folder&&h.folder.length)for(let e=0;e>10,56320|1023&s)))):i+=String.fromCharCode(u)}return i}function W(e,r){return e?g(E,e,r):""}function X(e,r,t,n){if(!(0>6,r[t++]=128|63&s}else if(s<=65535){if(i<=t+2)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(i<=t+3)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o}function G(e){for(var r=0,t=0;t>2]=e}var x={splitPath:function(e){return/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,r){for(var t=0,n=e.length-1;0<=n;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:function(e){var r="/"===e.charAt(0),t="/"===e.substr(-1);return(e=(e=x.normalizeArray(e.split("/").filter(function(e){return!!e}),!r).join("/"))||r?e:".")&&t&&(e+="/"),(r?"/":"")+e},dirname:function(e){var e=x.splitPath(e),r=e[0],e=e[1];return r||e?r+(e=e&&e.substr(0,e.length-1)):"."},basename:function(e){if("/"===e)return"/";var r=e.lastIndexOf("/");return-1===r?e:e.substr(r+1)},extname:function(e){return x.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return x.normalize(e.join("/"))},join2:function(e,r){return x.normalize(e+"/"+r)}},R={resolve:function(){for(var e="",r=!1,t=arguments.length-1;-1<=t&&!r;t--){var n=0<=t?arguments[t]:T.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r="/"===n.charAt(0)}return(r?"/":"")+(e=x.normalizeArray(e.split("/").filter(function(e){return!!e}),!r).join("/"))||"."},relative:function(e,r){function t(e){for(var r=0;r>>0),0!=t&&(r=Math.max(r,256)),t=e.contents,e.contents=new Uint8Array(r),0r)e.contents.length=r;else for(;e.contents.length=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(8>>0)%T.nameTable.length},hashAddNode:function(e){var r=T.hashName(e.parent.id,e.name);e.name_next=T.nameTable[r],T.nameTable[r]=e},hashRemoveNode:function(e){var r=T.hashName(e.parent.id,e.name);if(T.nameTable[r]===e)T.nameTable[r]=e.name_next;else for(var t=T.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode:function(e,r){var t=T.mayLookup(e);if(t)throw new T.ErrnoError(t,e);for(var t=T.hashName(e.id,r),n=T.nameTable[t];n;n=n.name_next){var o=n.name;if(n.parent.id===e.id&&o===r)return n}return T.lookup(e,r)},createNode:function(e,r,t,n){e=new T.FSNode(e,r,t,n);return T.hashAddNode(e),e},destroyNode:function(e){T.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(e){var r=T.flagModes[e];if(void 0===r)throw new Error("Unknown file open mode: "+e);return r},flagsToPermissionString:function(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:function(e,r){return T.ignorePermissions||(-1===r.indexOf("r")||292&e.mode)&&(-1===r.indexOf("w")||146&e.mode)&&(-1===r.indexOf("x")||73&e.mode)?0:2},mayLookup:function(e){var r=T.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate:function(e,r){try{T.lookupNode(e,r);return 20}catch(e){}return T.nodePermissions(e,"wx")},mayDelete:function(e,r,t){var n;try{n=T.lookupNode(e,r)}catch(e){return e.errno}r=T.nodePermissions(e,"wx");if(r)return r;if(t){if(!T.isDir(n.mode))return 54;if(T.isRoot(n)||T.getPath(n)===T.cwd())return 10}else if(T.isDir(n.mode))return 31;return 0},mayOpen:function(e,r){return e?T.isLink(e.mode)?32:T.isDir(e.mode)&&("r"!==T.flagsToPermissionString(r)||512&r)?31:T.nodePermissions(e,T.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd:function(e,r){r=r||T.MAX_OPEN_FDS;for(var t=e=e||0;t<=r;t++)if(!T.streams[t])return t;throw new T.ErrnoError(33)},getStream:function(e){return T.streams[e]},createStream:function(e,r,t){T.FSStream||(T.FSStream=function(){},T.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var n,o=new T.FSStream;for(n in e)o[n]=e[n];e=o;r=T.nextfd(r,t);return e.fd=r,T.streams[r]=e},closeStream:function(e){T.streams[e]=null},chrdev_stream_ops:{open:function(e){var r=T.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new T.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,r){return e<<8|r},registerDevice:function(e,r){T.devices[e]={stream_ops:r}},getDevice:function(e){return T.devices[e]},getMounts:function(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs:function(r,t){"function"==typeof r&&(t=r,r=!1),T.syncFSRequests++,1=n.length&&i(null)}n.forEach(function(e){if(!e.type.syncfs)return a(null);e.type.syncfs(e,r,a)})},mount:function(e,r,t){var n,o="/"===t,i=!t;if(o&&T.root)throw new T.ErrnoError(10);if(!o&&!i){i=T.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,T.isMountpoint(n))throw new T.ErrnoError(10);if(!T.isDir(n.mode))throw new T.ErrnoError(54)}i={type:e,opts:r,mountpoint:t,mounts:[]},r=e.mount(i);return(r.mount=i).root=r,o?T.root=r:n&&(n.mounted=i,n.mount&&n.mount.mounts.push(i)),r},unmount:function(e){e=T.lookupPath(e,{follow_mount:!1});if(!T.isMountpoint(e.node))throw new T.ErrnoError(28);var e=e.node,r=e.mounted,n=T.getMounts(r),r=(Object.keys(T.nameTable).forEach(function(e){for(var r=T.nameTable[e];r;){var t=r.name_next;-1!==n.indexOf(r.mount)&&T.destroyNode(r),r=t}}),e.mounted=null,e.mount.mounts.indexOf(r));e.mount.mounts.splice(r,1)},lookup:function(e,r){return e.node_ops.lookup(e,r)},mknod:function(e,r,t){var n=T.lookupPath(e,{parent:!0}).node,e=x.basename(e);if(!e||"."===e||".."===e)throw new T.ErrnoError(28);var o=T.mayCreate(n,e);if(o)throw new T.ErrnoError(o);if(n.node_ops.mknod)return n.node_ops.mknod(n,e,r,t);throw new T.ErrnoError(63)},create:function(e,r){return T.mknod(e,r=(r=void 0!==r?r:438)&4095|32768,0)},mkdir:function(e,r){return T.mknod(e,r=(r=void 0!==r?r:511)&1023|16384,0)},mkdirTree:function(e,r){for(var t=e.split("/"),n="",o=0;othis.length-1||e<0))return r=e%this.chunkSize,e=e/this.chunkSize|0,this.getter(e)[r]},o.prototype.setDataGetter=function(e){this.getter=e},o.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",a,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw new Error("Couldn't load "+a+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),t=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,e=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,o=1048576,i=(t||(o=n),this);i.setDataGetter(function(e){var r=e*o,t=(e+1)*o-1,t=Math.min(t,n-1);if(void 0===i.chunks[e]&&(i.chunks[e]=function(e,r){if(r=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s>2]=n.dev,k[t+4>>2]=0,k[t+8>>2]=n.ino,k[t+12>>2]=n.mode,k[t+16>>2]=n.nlink,k[t+20>>2]=n.uid,k[t+24>>2]=n.gid,k[t+28>>2]=n.rdev,k[t+32>>2]=0,F=[n.size>>>0,(S=n.size,1<=+ne(S)?0>>0:~~+oe((S-(~~S>>>0))/4294967296)>>>0:0)],k[t+40>>2]=F[0],k[t+44>>2]=F[1],k[t+48>>2]=4096,k[t+52>>2]=n.blocks,k[t+56>>2]=n.atime.getTime()/1e3|0,k[t+60>>2]=0,k[t+64>>2]=n.mtime.getTime()/1e3|0,k[t+68>>2]=0,k[t+72>>2]=n.ctime.getTime()/1e3|0,k[t+76>>2]=0,F=[n.ino>>>0,(S=n.ino,1<=+ne(S)?0>>0:~~+oe((S-(~~S>>>0))/4294967296)>>>0:0)],k[t+80>>2]=F[0],k[t+84>>2]=F[1],0},doMsync:function(e,r,t,n,o){e=E.slice(e,e+t);T.msync(r,e,o,t,n)},doMkdir:function(e,r){return"/"===(e=x.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),T.mkdir(e,r,0),0},doMknod:function(e,r,t){switch(61440&r){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return T.mknod(e,r,t),0},doReadlink:function(e,r,t){if(t<=0)return-28;var e=T.readlink(e),n=Math.min(t,G(e)),o=y[r+n];return X(e,E,r,t+1),y[r+n]=o,n},doAccess:function(e,r){if(-8&r)return-28;e=T.lookupPath(e,{follow:!0}).node;if(!e)return-44;var t="";return 4&r&&(t+="r"),2&r&&(t+="w"),1&r&&(t+="x"),t&&T.nodePermissions(e,t)?-2:0},doDup:function(e,r,t){var n=T.getStream(t);return n&&T.close(n),T.open(e,r,0,t,t).fd},doReadv:function(e,r,t,n){for(var o=0,i=0;i>2],s=k[r+(8*i+4)>>2],a=T.read(e,y,a,s,n);if(a<0)return-1;if(o+=a,a>2],s=k[r+(8*i+4)>>2],a=T.write(e,y,a,s,n);if(a<0)return-1;o+=a}return o},varargs:void 0,get:function(){return N.varargs+=4,k[N.varargs-4>>2]},getStr:function(e){return W(e)},getStreamFromFD:function(e){e=T.getStream(e);if(e)return e;throw new T.ErrnoError(8)},get64:function(e,r){return e}};var ge={};function z(){if(!z.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:C||"./this.program"};for(r in ge)e[r]=ge[r];var r,t=[];for(r in e)t.push(r+"="+e[r]);z.strings=t}return z.strings}function ve(e,r,t,n){this.parent=e=e||this,this.mount=e.mount,this.mounted=null,this.id=T.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n}function ye(e,r,t){t=0>2]=t/1e3|0,k[r+4>>2]=t%1e3*1e3*1e3|0,0},d:function(e,r,t){N.varargs=t;try{var n=N.getStreamFromFD(e);switch(r){case 0:return(o=N.get())<0?-28:T.open(n.path,n.flags,0,o).fd;case 1:case 2:return 0;case 3:return n.flags;case 4:var o=N.get();return n.flags|=o,0;case 12:o=N.get();return K[o+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return A(28),-1;default:return-28}}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},i:function(e,r,t){N.varargs=t;try{var n=N.getStreamFromFD(e);switch(r){case 21509:case 21505:return n.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=N.get();return k[o>>2]=0;case 21520:return n.tty?-28:-59;case 21531:o=N.get();return T.ioctl(n,r,o);case 21523:case 21524:return n.tty?0:-59;default:D("bad ioctl syscall "+r)}}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},e:function(e,r,t){N.varargs=t;try{var n=N.getStr(e),o=N.get();return T.open(n,r,o).fd}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},t:function(e){try{return e=N.getStr(e),T.rmdir(e),0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},j:function(e){try{var r=N.umask;return N.umask=e,r}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},u:function(e){try{return e=N.getStr(e),T.unlink(e),0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},v:function(e,r,t,n){try{D("cannot wait on child processes")}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},n:function(e,r,t){E.copyWithin(e,r,r+t)},b:function(e){var r=E.length,t=2147483648;if(t<(e>>>=0))return!1;for(var n,o=1;o<=4;o*=2){var i=r*(1+.2/o),i=Math.min(i,e+100663296);if(function(e){try{return p.grow(e-v.byteLength+65535>>>16),Y(p.buffer),1}catch(e){}}(Math.min(t,(0<(i=Math.max(16777216,e,i))%(n=65536)&&(i+=n-i%n),i))))return!0}return!1},p:function(a,s){var u=0;return z().forEach(function(e,r){for(var t=s+u,n=(k[a+4*r>>2]=t,e),o=t,r=void 0,i=0;i>0]=n.charCodeAt(i);r||(y[o>>0]=0),u+=e.length+1}),0},q:function(e,r){var t=z(),n=(k[e>>2]=t.length,0);return t.forEach(function(e){n+=e.length+1}),k[r>>2]=n,0},c:function(e){xe(e)},f:function(e){try{var r=N.getStreamFromFD(e);return T.close(r),0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},r:function(e,r){try{var t=N.getStreamFromFD(e),n=t.tty?2:T.isDir(t.mode)?3:T.isLink(t.mode)?7:4;return y[r>>0]=n,0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},h:function(e,r,t,n){try{var o=N.getStreamFromFD(e),i=N.doReadv(o,r,t);return k[n>>2]=i,0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},m:function(e,r,t,n,o){try{var i=N.getStreamFromFD(e),a=4294967296*t+(r>>>0),s=9007199254740992;return a<=-s||s<=a?-61:(T.llseek(i,a,n),F=[i.position>>>0,(S=i.position,1<=+ne(S)?0>>0:~~+oe((S-(~~S>>>0))/4294967296)>>>0:0)],k[o>>2]=F[0],k[o+4>>2]=F[1],i.getdents&&0==a&&0===n&&(i.getdents=null),0)}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},g:function(e,r,t,n){try{var o=N.getStreamFromFD(e),i=N.doWritev(o,r,t);return k[n>>2]=i,0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},memory:p,o:function(){w("missing function: popen"),D(-1)},l:function(){return 6},k:function(){},table:I},_e=(!function(){var r={a:ke};function t(e,r){e=e.exports;h.asm=e,ue()}function n(e){t(e.instance)}function o(e){return(l||!L&&!c||"function"!=typeof fetch||de(P)?new Promise(function(e,r){e(pe())}):fetch(P,{credentials:"same-origin"}).then(function(e){if(e.ok)return e.arrayBuffer();throw"failed to load wasm binary file at '"+P+"'"}).catch(pe)).then(function(e){return WebAssembly.instantiate(e,r)}).then(e,function(e){w("failed to asynchronously prepare wasm: "+e),D(e)})}if(se(),h.instantiateWasm)try{h.instantiateWasm(r,t);return}catch(e){return w("Module.instantiateWasm callback failed with error: "+e)}l||"function"!=typeof WebAssembly.instantiateStreaming||ce(P,fe)||de(P)||"function"!=typeof fetch?o(n):fetch(P,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,r).then(n,function(e){return w("wasm streaming compile failed: "+e),w("falling back to ArrayBuffer instantiation"),o(n)})})}(),h.___wasm_call_ctors=function(){return(_e=h.___wasm_call_ctors=h.asm.w).apply(null,arguments)}),be=h._malloc=function(){return(be=h._malloc=h.asm.x).apply(null,arguments)},De=h.___errno_location=function(){return(De=h.___errno_location=h.asm.y).apply(null,arguments)},Se=(h._main=function(){return(h._main=h.asm.z).apply(null,arguments)},h.stackAlloc=function(){return(Se=h.stackAlloc=h.asm.A).apply(null,arguments)});function Fe(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Pe(r){var t=h._main;r=r||[];try{for(let e=0;e>2]=V(C);for(var n=1;n>2)+n]=V(e[n-1]);return k[(t>>2)+r]=0,{argc:r,argv:t}}(s.split(" ").filter(e=>Boolean(e)));if(0!==(n=t(o,i)))break}xe(n,!0)}catch(e){if(e instanceof Fe)return;if("unwind"==e)return void(d=!0);var a=e;e&&"object"==typeof e&&e.stack&&(a=[e,e.stack]),w("exception thrown: "+a),u(1,e)}}function Ae(e){function r(){Ee||(Ee=!0,h.calledRun=!0,U||(h.noFSInit||T.init.initialized||T.init(),Z(J),T.ignorePermissions=!1,Z(Q),j(h),h.onRuntimeInitialized&&h.onRuntimeInitialized(),Re&&Pe(e),te()))}e=e||a,0<_||(re(),0<_||(h.setStatus?(h.setStatus("Running..."),setTimeout(function(){setTimeout(function(){h.setStatus("")},1),r()},1)):r()))}function xe(e,r){r&&d&&0===e||(d||(U=!0,h.onExit&&h.onExit(e)),u(e,new Fe(e)))}if(h.dynCall_vi=function(){return(h.dynCall_vi=h.asm.B).apply(null,arguments)},b=function e(){Ee||Ae(),Ee||(b=e)},h.run=Ae,h.preInit)for("function"==typeof h.preInit&&(h.preInit=[h.preInit]);0{0{t+=String.fromCharCode(e),10===e&&(console.error(t),t="")},stdout:e=>{r+=String.fromCharCode(e),10===e&&(console.log(r),r="")}};const l=[];return async(e={})=>{let{data:i=null,command:a=[],folder:s=[],isStrict:u=!1}=e;return await new Promise(e=>{l.push(e),1===l.length&&l[0]()}),new Promise((r,t)=>{let n=!1,o="";c({stdout:f.stdout,stderr:e=>{o+=String.fromCharCode(e),10===e&&(console.error(o),u&&t(o))},arguments:a,input:i,folder:s,output:e=>{r(e),n=!0}}).then(()=>{(0,f.flush)(),n||t(),0{var e=await gifsicle(r.data).catch(e=>{postMessage(e)});postMessage(e)})().catch(e=>{postMessage(null)})};`,workerBlobUrl:"",worker(){return this.workerBlobUrl||(this.workerLocalUrl?this.workerBlobUrl=URL.createObjectURL(new Blob([this.workerLocalUrl])):this.workerBlobUrl="../src/worker.js",this.workerBlobUrl)},errorLink(){return` + Check: https://github.com/renzhezhilu/gifsicle-wasm-browser`},testType(e){return e instanceof Element?"element":Object.prototype.toString.call(e).replace(/\[object\s(.+)\]/,"$1").toLowerCase()},async textToUrl(e){return this.worker()},loadCommand(e){var A=this.testType(e);if(e.length===0)throw" the content can not be blank"+this.errorLink();if(A==="array")return e.map(g=>g.replace(/\n/gi," "));throw" types:"+A+", must be an array"+this.errorLink()},loadOne(e){return new Promise(async(A,g)=>{var t=this.testType(e);if(["string"].includes(t))fetch(e).then(I=>{if(I.status!==200)throw"<"+e+"> Url error!!!"+this.errorLink();return I.arrayBuffer()}).then(I=>A(I));else if(["blob","file"].includes(t))new Response(e).arrayBuffer().then(I=>A(I));else{if(!["arraybuffer"].includes(t))throw" types:"+t+", only supports Url, blob, file, arraybuffer"+this.errorLink();A(e)}})},loadFile(e){return new Promise(async(A,g)=>{var t=this.testType(e);if(t!=="array")throw" types:"+t+", only supports Array"+this.errorLink();if(e.length===0)throw" the content can not be blank"+this.errorLink();t=e.map(I=>this.loadOne(I.file)),Promise.all(t).then(function(I){var o=e.map((i,r)=>(i.file=I[r],i));A(o)}).catch(function(I){})})},loadFolder(e){return new Promise(async(A,g)=>{var t=this.testType(e);if(!["array"].includes(t))throw" types:"+t+", only supports Array"+this.errorLink();A(e)})}},run(e={}){return new Promise(async(A,g)=>{let{input:t=[],command:I="",folder:o=[],isStrict:i=!1,start:r=E=>{}}=e;var C=await this.tool.textToUrl();let B=new Worker(C);var n=this.tool.loadCommand(I),Q=await this.tool.loadFile(t),s=(r(Q),await this.tool.loadFolder(o));B.postMessage({data:Q,command:n,folder:s,isStrict:i}),B.onmessage=async function(E){if(!E.data||typeof E.data=="string")return B.terminate(),void g(E.data);let h=[];for(let u=0;u=0&&n.push(`--loopcount=${C}`),r&&r>0&&n.push(`--lossy=${r}`),i&&n.push(`-O${this.optimizationLevel}`),n.push("1.gif"),n.push("-o /out/output.gif");const Q=n.join(" ");this.debug&&(console.log("GIF scaling command:",Q),console.log("Input file size:",A.size||"Unknown"));const s=await ke.run({input:[{file:A,name:"1.gif"}],command:[Q]});if(!s||s.length===0)throw new Error("gifsicle processing failed, no result returned");const E=s[0];if(this.debug&&(console.log("GIF scaling complete"),console.log("Output file size:",E.size),A.size)){const h=((1-E.size/A.size)*100).toFixed(2);console.log(`Compression ratio: ${h}%`)}return new Blob([E],{type:"image/gif"})}catch(B){throw console.error("GIF scaling failed:",B),new Error(`GIF scaling failed: ${B.message}`)}}async scaleGifBatch(A){const g=[];for(let t=0;t=0&&i.push(`--loopcount=${o}`),t&&t>0&&i.push(`--lossy=${t}`),i.push(`-O${I}`),i.push("1.gif"),i.push("-o /out/output.gif");const r=i.join(" ");this.debug&&console.log("GIF optimization command:",r);const C=await ke.run({input:[{file:A,name:"1.gif"}],command:[r]});if(!C||C.length===0)throw new Error("gifsicle optimization failed");return new Blob([C[0]],{type:"image/gif"})}catch(i){throw console.error("GIF optimization failed:",i),new Error(`GIF optimization failed: ${i.message}`)}}async getGifInfo(A){try{const g=await ke.run({input:[{file:A,name:"1.gif"}],command:["--info 1.gif -o /out/info.txt"]});if(!g||g.length===0)throw new Error("Failed to get GIF info");const I=await g[0].text();return this.parseGifInfo(I)}catch(g){return console.error("Failed to get GIF info:",g),{size:A.size||0,type:"image/gif"}}}parseGifInfo(A){const g={frames:0,width:0,height:0,colors:0,loopCount:0};try{const t=A.match(/(\d+) images?/);t&&(g.frames=parseInt(t[1]));const I=A.match(/logical screen (\d+)x(\d+)/);I&&(g.width=parseInt(I[1]),g.height=parseInt(I[2]));const o=A.match(/(\d+) colors/);if(o&&(g.colors=parseInt(o[1])),A.includes("loop forever"))g.loopCount=0;else{const i=A.match(/loop count (\d+)/);i&&(g.loopCount=parseInt(i[1]))}}catch(t){console.warn("Error parsing GIF info:",t)}return g}async cropGif(A,g){const{x:t,y:I,width:o,height:i}=g;try{const r=["-U",`--crop ${t},${I}+${o}x${i}`,"1.gif","-o /out/output.gif"].join(" ");this.debug&&console.log("GIF cropping command:",r);const C=await ke.run({input:[{file:A,name:"1.gif"}],command:[r]});if(!C||C.length===0)throw new Error("gifsicle cropping failed");return new Blob([C[0]],{type:"image/gif"})}catch(r){throw console.error("GIF cropping failed:",r),new Error(`GIF cropping failed: ${r.message}`)}}dispose(){this.debug&&console.log("WasmGifScaler disposed")}setDebug(A){this.debug=A}setQuality(A){if(A<1||A>200)throw new Error("Quality parameter must be between 1 and 200");this.quality=A}setOptimizationLevel(A){if(A<1||A>3)throw new Error("Optimization level must be between 1 and 3");this.optimizationLevel=A}}class aI{constructor(){this.config=null,this.resources=new Map,this.tempFiles=[],this.fontConverterBrowser=nE,this.convertedFonts=new Map,this.wakenetPacker=new BE,this.spiffsGenerator=new aE,this.gifScaler=new sE({quality:30,debug:!0,scalingMode:"auto",optimize:!0,optimizationLevel:2}),this.configStorage=cA,this.autoSaveEnabled=!0}setConfig(A,g={}){if(((g==null?void 0:g.strict)??!0)&&!this.validateConfig(A))throw new Error("Configuration object validation failed");return this.config={...A},this}validateConfig(A){var I,o,i;if(!A)return!1;if(!((I=A.chip)!=null&&I.model))return console.error("Missing chip model configuration"),!1;const g=A.chip.display;if(!(g!=null&&g.width)||!(g!=null&&g.height))return console.error("Missing display resolution configuration"),!1;const t=(o=A.theme)==null?void 0:o.font;return(t==null?void 0:t.type)==="preset"&&!t.preset?(console.error("Preset font configuration is incomplete"),!1):(t==null?void 0:t.type)==="custom"&&!((i=t.custom)!=null&&i.file)?(console.error("Custom font file not provided"),!1):!0}addResource(A,g,t,I="other"){return this.resources.set(A,{file:g,filename:t,size:g.size,type:g.type,lastModified:g.lastModified||Date.now(),resourceType:I}),this.autoSaveEnabled&&g instanceof File&&this.saveFileToStorage(A,g,I).catch(o=>{console.warn(`Auto-saving file ${t} failed:`,o)}),this}async saveFileToStorage(A,g,t){try{await this.configStorage.saveFile(A,g,t),console.log(`File ${g.name} auto-saved to storage`)}catch(I){throw console.error(`Failed to save file to storage: ${g.name}`,I),I}}async restoreResourceFromStorage(A){try{const g=await this.configStorage.loadFile(A);return g?(this.resources.set(A,{file:g,filename:g.name,size:g.size,type:g.type,lastModified:g.lastModified,resourceType:g.storedType,fromStorage:!0}),console.log(`Resource ${A} restored from storage successfully: ${g.name}`),!0):!1}catch(g){return console.error(`Failed to restore resource from storage: ${A}`,g),!1}}async restoreAllResourcesFromStorage(A){var t,I,o,i,r,C,B,n,Q,s,E;if(!A)return;const g=[];if((I=(t=A.theme)==null?void 0:t.font)!=null&&I.custom&&((o=A.theme.font.custom)==null?void 0:o.file)===null){const h="custom_font";if(await this.restoreResourceFromStorage(h)){const w=this.resources.get(h);w&&(A.theme.font.custom.file=w.file,g.push(`Custom font: ${w.filename}`),console.log(`Custom font restored even when type is '${A.theme.font.type}'`))}}if(((r=(i=A.theme)==null?void 0:i.emoji)==null?void 0:r.type)==="custom"&&A.theme.emoji.custom){const h=A.theme.emoji.custom,w=h.emotionMap||{},u=h.fileMap||{},l=h.images||{};if(Object.keys(w).length>0||Object.keys(u).length>0){const f=new Set;for(const c of Object.keys(u))u[c]===null&&f.add(c);for(const c of f){let D=`hash_${c}`,p=await this.restoreResourceFromStorage(D);if(!p){const v=`emoji_hash_${c}`;p=await this.restoreResourceFromStorage(v),p&&(D=v)}if(p){const v=this.resources.get(D);if(v){u[c]=v.file;const N=Object.entries(w).filter(([L,X])=>X===c).map(([L,X])=>L);N.forEach(L=>{l[L]=v.file}),g.push(`Emoji file ${c.substring(0,8)}... (used for: ${N.join(", ")})`)}}}Object.keys(u).forEach(c=>{A.theme.emoji.custom.fileMap[c]=u[c]}),Object.keys(l).forEach(c=>{A.theme.emoji.custom.images[c]=l[c]})}else{for(const[f,c]of Object.entries(l))if(c===null){const D=`emoji_${f}`;if(await this.restoreResourceFromStorage(D)){const p=this.resources.get(D);p&&(l[f]=p.file,g.push(`Emoji ${f}: ${p.filename}`))}}A.theme.emoji.custom.images=l}}if(((n=(B=(C=A.theme)==null?void 0:C.skin)==null?void 0:B.light)==null?void 0:n.backgroundType)==="image"&&A.theme.skin.light.backgroundImage===null){const h="background_light";if(await this.restoreResourceFromStorage(h)){const w=this.resources.get(h);w&&(A.theme.skin.light.backgroundImage=w.file,g.push(`Light background: ${w.filename}`))}}if(((E=(s=(Q=A.theme)==null?void 0:Q.skin)==null?void 0:s.dark)==null?void 0:E.backgroundType)==="image"&&A.theme.skin.dark.backgroundImage===null){const h="background_dark";if(await this.restoreResourceFromStorage(h)){const w=this.resources.get(h);w&&(A.theme.skin.dark.backgroundImage=w.file,g.push(`Dark background: ${w.filename}`))}}try{const h=this.getFontInfo();if(h&&h.type==="custom"){const w=`converted_font_${h.filename}`,u=await this.configStorage.loadTempData(w);u&&(this.convertedFonts.set(h.filename,u.data),console.log(`Converted font data restored: ${h.filename}`))}}catch(h){console.warn("Error restoring converted font data:",h)}g.length>0&&console.log("Files restored from storage:",g)}getWakewordModelInfo(){if(!this.config||!this.config.chip||!this.config.theme)return null;const A=this.config.chip.model,g=this.config.theme.wakeword;return!g||g.type==="none"?null:g.type==="preset"?{type:A==="esp32c3"||A==="esp32c6"?"WakeNet9s":"WakeNet9",name:g.preset,filename:"srmodels.bin"}:g.type==="custom"?{type:"MultiNet",name:g.custom.model,filename:"srmodels.bin",custom:g.custom}:null}getFontInfo(){if(!this.config||!this.config.theme||!this.config.theme.font)return null;const A=this.config.theme.font;if(A.type==="preset")return{type:"preset",filename:`${A.preset}.bin`,source:A.preset};if(A.type==="custom"&&A.custom.file){const g=A.custom;return{type:"custom",filename:`font_custom_${g.size}_${g.bpp}.bin`,source:A.custom.file,config:{size:g.size,bpp:g.bpp,charset:g.charset}}}return null}getEmojiCollectionInfo(){if(!this.config||!this.config.theme||!this.config.theme.emoji)return[];const A=this.config.theme.emoji,g=[];if(A.type==="preset"){const t=["neutral","happy","laughing","funny","sad","angry","crying","loving","embarrassed","surprised","shocked","thinking","winking","cool","relaxed","delicious","kissy","confident","sleepy","silly","confused"],o={twemoji32:{size:32,format:"png"},twemoji64:{size:64,format:"png"},"noto-emoji_64":{size:64,format:"gif"},"noto-emoji_128":{size:128,format:"gif"}}[A.preset]||{size:64,format:"png"};t.forEach(i=>{g.push({name:i,file:`${i}.${o.format}`,source:`preset:${A.preset}`,size:{width:o.size,height:o.size}})})}else if(A.type==="custom"){A.custom.images;const t=A.custom.emotionMap||{},I=A.custom.fileMap||{},o=A.custom.size||{width:64,height:64};if(Object.keys(t).length===0||Object.keys(I).length===0)throw console.error("❌ Error: Detected old version of emoji data structure"),console.error("Please clear browser cache or reset configuration, then re-upload emoji images"),new Error("Incompatible emoji data structure: Missing fileMap or emotionMap. Please reconfigure emojis.");const i=new Map;Object.entries(t).forEach(([r,C])=>{const B=I[C];if(B){if(!i.has(C)){const Q=B.name?B.name.split(".").pop().toLowerCase():"png",s=`emoji_${C.substring(0,8)}.${Q}`;i.set(C,s)}const n=i.get(C);g.push({name:r,file:n,source:B,fileHash:C,size:{...o}})}}),console.log(`Emoji deduplication: ${Object.keys(t).length} emojis using ${i.size} different image files`),g.find(r=>r.name==="neutral")||console.warn("Warning: neutral emoji not provided, default image will be used")}return g}getSkinInfo(){if(!this.config||!this.config.theme||!this.config.theme.skin)return{};const A=this.config.theme.skin,g={};return A.light&&(g.light={text_color:A.light.textColor||"#000000",background_color:A.light.backgroundColor||"#ffffff"},A.light.backgroundType==="image"&&A.light.backgroundImage&&(g.light.background_image="background_light.raw")),A.dark&&(g.dark={text_color:A.dark.textColor||"#ffffff",background_color:A.dark.backgroundColor||"#121212"},A.dark.backgroundType==="image"&&A.dark.backgroundImage&&(g.dark.background_image="background_dark.raw")),g}generateIndexJson(){if(!this.config)throw new Error("Configuration object not set");const A={version:1,chip_model:this.config.chip.model,hide_subtitle:this.config.theme.font.hide_subtitle||!1,display_config:{width:this.config.chip.display.width,height:this.config.chip.display.height,monochrome:!1,color:this.config.chip.display.color||"RGB565"}},g=this.getWakewordModelInfo();if(g&&(A.srmodels=g.filename,g.type==="MultiNet"&&g.custom)){const i=g.custom;A.multinet_model={language:i.model.includes("_en")?"en":"cn",duration:i.duration||3e3,threshold:i.threshold/100,commands:[{command:i.command,text:i.name,action:"wake"}]}}const t=this.getFontInfo();t&&(A.text_font=t.filename);const I=this.getSkinInfo();Object.keys(I).length>0&&(A.skin=I);const o=this.getEmojiCollectionInfo();return o.length>0&&(A.emoji_collection=o.map(i=>({name:i.name,file:i.file}))),A}preparePackageResources(){var r,C,B,n;const A={files:[],indexJson:this.generateIndexJson(),config:{...this.config}},g=this.getWakewordModelInfo();g&&g.name&&A.files.push({type:"wakeword",name:g.name,filename:g.filename,modelType:g.type,isCustom:g.type==="MultiNet"});const t=this.getFontInfo();t&&A.files.push({type:"font",filename:t.filename,source:t.source,config:t.config||null});const I=this.getEmojiCollectionInfo(),o=new Set;I.forEach(Q=>{if(Q.fileHash){if(o.has(Q.fileHash)){console.log(`Skipping duplicate file: ${Q.name} -> ${Q.file} (hash: ${Q.fileHash.substring(0,8)})`);return}o.add(Q.fileHash)}A.files.push({type:"emoji",name:Q.name,filename:Q.file,source:Q.source,size:Q.size,fileHash:Q.fileHash})});const i=(C=(r=this.config)==null?void 0:r.theme)==null?void 0:C.skin;return((B=i==null?void 0:i.light)==null?void 0:B.backgroundType)==="image"&&i.light.backgroundImage&&A.files.push({type:"background",filename:"background_light.raw",source:i.light.backgroundImage,mode:"light"}),((n=i==null?void 0:i.dark)==null?void 0:n.backgroundType)==="image"&&i.dark.backgroundImage&&A.files.push({type:"background",filename:"background_dark.raw",source:i.dark.backgroundImage,mode:"dark"}),A}async preprocessCustomFonts(A=null){const g=this.getFontInfo();if(g&&g.type==="custom"&&!this.convertedFonts.has(g.filename)){A&&A(20,"Converting custom font...");try{const t={fontFile:g.source,fontName:g.filename.replace(/\.bin$/,""),fontSize:g.config.size,bpp:g.config.bpp,charset:g.config.charset,symbols:g.config.symbols||"",range:g.config.range||"",compression:!1,progressCallback:(o,i)=>{A&&A(20+o*.2,`Font conversion: ${i}`)}};let I;if(await this.fontConverterBrowser.initialize(),I=await this.fontConverterBrowser.convertToCBIN(t),this.convertedFonts.set(g.filename,I),this.autoSaveEnabled){const o=`converted_font_${g.filename}`;try{await this.configStorage.saveTempData(o,I,"converted_font",{filename:g.filename,size:g.config.size,bpp:g.config.bpp,charset:g.config.charset}),console.log(`Converted font saved to storage: ${g.filename}`)}catch(i){console.warn(`Failed to save converted font: ${g.filename}`,i)}}}catch(t){throw console.error("Font conversion failed:",t),new Error(`Font conversion failed: ${t.message}`)}}}async generateAssetsBin(A=null){if(!this.config)throw new Error("Configuration object not set");try{A&&A(0,"Starting generation..."),await this.preprocessCustomFonts(A),await new Promise(I=>setTimeout(I,100)),A&&A(40,"Preparing resource files...");const g=this.preparePackageResources();this.wakenetPacker.clear(),this.spiffsGenerator.clear(),await this.processResourceFiles(g,A),await new Promise(I=>setTimeout(I,100)),A&&A(90,"Generating final file..."),this.spiffsGenerator.printFileList();const t=await this.spiffsGenerator.generate((I,o)=>{A&&A(90+I*.1,o)});return A&&A(100,"Generation completed"),new Blob([t],{type:"application/octet-stream"})}catch(g){throw console.error("Failed to generate assets.bin:",g),g}}downloadAssetsBin(A,g="assets.bin"){const t=URL.createObjectURL(A),I=document.createElement("a");I.href=t,I.download=g,document.body.appendChild(I),I.click(),document.body.removeChild(I),URL.revokeObjectURL(t)}async getFontInfoWithDetails(A=null){var g,t,I,o;try{const i=A||((o=(I=(t=(g=this.config)==null?void 0:g.theme)==null?void 0:t.font)==null?void 0:I.custom)==null?void 0:o.file);if(!i)return null;let r;return await this.fontConverterBrowser.initialize(),r=await this.fontConverterBrowser.getFontInfo(i),{...r,file:i,isCustom:!0}}catch(i){return console.error("Failed to get font details:",i),null}}async estimateFontSize(A=null){var g,t,I;try{const o=A||((I=(t=(g=this.config)==null?void 0:g.theme)==null?void 0:t.font)==null?void 0:I.custom);if(!o)return null;const i={fontSize:o.size,bpp:o.bpp,charset:o.charset,symbols:o.symbols||"",range:o.range||""};let r;return r=this.fontConverterBrowser.estimateSize(i),r}catch(o){return console.error("Failed to estimate font size:",o),null}}validateCustomFont(A){const g=[],t=[];return A.file?this.fontConverterBrowser.validateFont(A.file)||g.push("Font file format not supported"):g.push("Missing font file"),(A.size<8||A.size>80)&&g.push("Font size must be between 8-80"),[1,2,4,8].includes(A.bpp)||g.push("BPP must be 1, 2, 4 or 8"),!A.charset&&!A.symbols&&!A.range&&t.push("No charset, symbols or range specified, default charset will be used"),{valid:g.length===0,errors:g,warnings:t}}getConverterStatus(){return{initialized:this.fontConverterBrowser.initialized,supportedFormats:this.fontConverterBrowser.supportedFormats}}async processResourceFiles(A,g=null){let t=0;const I=A.files.length,o=new TextEncoder().encode(JSON.stringify(A.indexJson,null,2));console.log("index.json",A.indexJson),this.spiffsGenerator.addFile("index.json",o.buffer);for(const i of A.files){const r=40+t/I*40;g&&g(r,`Processing file: ${i.filename}`);try{await this.processResourceFile(i),t++}catch(C){throw console.error(`Failed to process resource file: ${i.filename}`,C),new Error(`Failed to process resource file: ${i.filename} - ${C.message}`)}}}async processResourceFile(A){switch(A.type){case"wakeword":await this.processWakewordModel(A);break;case"font":await this.processFontFile(A);break;case"emoji":await this.processEmojiFile(A);break;case"background":await this.processBackgroundFile(A);break;default:console.warn(`Unknown resource type: ${A.type}`)}}async processWakewordModel(A){if(!await this.wakenetPacker.loadModelFromShare(A.name))throw new Error(`Failed to load wakeword model: ${A.name}`);const t=this.wakenetPacker.packModels();this.spiffsGenerator.addFile(A.filename,t)}async processFontFile(A){if(A.config){const g=this.convertedFonts.get(A.filename);if(g)this.spiffsGenerator.addFile(A.filename,g);else throw new Error(`Converted font not found: ${A.filename}`)}else{const g=await this.loadPresetFont(A.source);this.spiffsGenerator.addFile(A.filename,g)}}async processEmojiFile(A){var i,r;let g,t=!1,I="png",o=!1;if(typeof A.source=="string"&&A.source.startsWith("preset:")){const C=A.source.replace("preset:","");g=await this.loadPresetEmoji(C,A.name)}else{const C=A.source;o=this.isGifFile(C),I=C.name.split(".").pop().toLowerCase();try{const n=await this.getImageDimensions(C),Q=A.size||{width:64,height:64};(n.width>Q.width||n.height>Q.height)&&(t=!0,console.log(`Emoji ${A.name} needs scaling: ${n.width}x${n.height} -> ${Q.width}x${Q.height}`))}catch(n){console.warn(`Failed to get emoji image dimensions: ${A.name}`,n)}t||(g=await this.fileToArrayBuffer(C))}if(t)try{const C=A.size||{width:64,height:64};if(o){console.log(`Using WasmGifScaler to process GIF emoji: ${A.name}`);const B=await this.gifScaler.scaleGif(A.source,{maxWidth:C.width,maxHeight:C.height,keepAspectRatio:!0,lossy:30});g=await this.fileToArrayBuffer(B)}else g=await this.scaleImageToFit(A.source,C,I)}catch(C){console.error(`Failed to scale emoji image: ${A.name}`,C),g=await this.fileToArrayBuffer(A.source)}this.spiffsGenerator.addFile(A.filename,g,{width:((i=A.size)==null?void 0:i.width)||0,height:((r=A.size)==null?void 0:r.height)||0}),A.fileHash&&console.log(`Emoji file added: ${A.filename} (hash: ${A.fileHash.substring(0,8)})`)}async processBackgroundFile(A){const g=await this.fileToArrayBuffer(A.source),t=await this.convertImageToRgb565(g);this.spiffsGenerator.addFile(A.filename,t)}async loadPresetFont(A){try{const g=await fetch(`./static/fonts/${A}.bin`);if(!g.ok)throw new Error(`HTTP ${g.status}`);return await g.arrayBuffer()}catch(g){throw new Error(`Failed to load preset font: ${A} - ${g.message}`)}}async loadPresetEmoji(A,g){try{const I={twemoji32:"png",twemoji64:"png","noto-emoji_64":"gif","noto-emoji_128":"gif"}[A]||"png",o=await fetch(`./static/emojis/${A}/${g}.${I}`);if(!o.ok)throw new Error(`HTTP ${o.status}`);return await o.arrayBuffer()}catch(t){throw new Error(`Failed to load preset emoji: ${A}/${g} - ${t.message}`)}}fileToArrayBuffer(A){return new Promise((g,t)=>{const I=new FileReader;I.onload=()=>g(I.result),I.onerror=()=>t(new Error("Failed to read file")),I.readAsArrayBuffer(A)})}async scaleImageToFit(A,g,t="png"){return new Promise((I,o)=>{const i=A instanceof File?A:new Blob([A]),r=URL.createObjectURL(i),C=new Image;C.onload=()=>{try{const B=document.createElement("canvas"),n=B.getContext("2d");B.width=g.width,B.height=g.height;const Q=C.width/C.height,s=g.width/g.height;let E,h,w,u;Q>s?(E=g.width,h=g.width/Q,w=0,u=(g.height-h)/2):(h=g.height,E=g.height*Q,w=(g.width-E)/2,u=0),t==="png"?n.clearRect(0,0,B.width,B.height):(n.fillStyle="#FFFFFF",n.fillRect(0,0,B.width,B.height)),n.drawImage(C,w,u,E,h),B.toBlob(l=>{const f=new FileReader;f.onload=()=>I(f.result),f.onerror=()=>o(new Error("Failed to convert image data")),f.readAsArrayBuffer(l)},`image/${t}`),URL.revokeObjectURL(r)}catch(B){URL.revokeObjectURL(r),o(B)}},C.onerror=()=>{URL.revokeObjectURL(r),o(new Error("Unable to load image"))},C.src=r})}isGifFile(A){return A.type==="image/gif"?!0:A.name.split(".").pop().toLowerCase()==="gif"}async getImageDimensions(A){return new Promise((g,t)=>{const I=A instanceof File?A:new Blob([A]),o=URL.createObjectURL(I),i=new Image;i.onload=()=>{URL.revokeObjectURL(o),g({width:i.width,height:i.height})},i.onerror=()=>{URL.revokeObjectURL(o),t(new Error("Unable to get image dimensions"))},i.src=o})}async convertImageToRgb565(A){return new Promise((g,t)=>{const I=new Blob([A]),o=URL.createObjectURL(I),i=new Image;i.onload=()=>{var r,C,B,n,Q,s;try{const E=document.createElement("canvas"),h=E.getContext("2d",{willReadFrequently:!0});E.width=((B=(C=(r=this.config)==null?void 0:r.chip)==null?void 0:C.display)==null?void 0:B.width)||320,E.height=((s=(Q=(n=this.config)==null?void 0:n.chip)==null?void 0:Q.display)==null?void 0:s.height)||240;const w=i.width/i.height,u=E.width/E.height;let l,f,c,D;w>u?(f=E.height,l=E.height*w,c=(E.width-l)/2,D=0):(l=E.width,f=E.width/w,c=0,D=(E.height-f)/2),h.drawImage(i,c,D,l,f);const v=h.getImageData(0,0,E.width,E.height).data,N=new ArrayBuffer(E.width*E.height*2),L=new Uint16Array(N);for(let _=0;_>3,b=v[_+1]>>2,H=v[_+2]>>3;L[_/4]=iA<<11|b<<5|H}const X=25,k=18,m=E.width*2,M=28,oA=M+N.byteLength,F=new ArrayBuffer(oA),S=new Uint8Array(F),J=new DataView(F);let V=0;const q=0|k<<8|X;J.setUint32(V,q,!0),V+=4;const $=E.height<<16|E.width;J.setUint32(V,$,!0),V+=4;const AA=0|m;J.setUint32(V,AA,!0),V+=4,J.setUint32(V,N.byteLength,!0),V+=4,J.setUint32(V,M,!0),V+=4,J.setUint32(V,0,!0),V+=4,J.setUint32(V,0,!0),V+=4,S.set(new Uint8Array(N),M),URL.revokeObjectURL(o),g(F)}catch(E){URL.revokeObjectURL(o),t(E)}},i.onerror=()=>{URL.revokeObjectURL(o),t(new Error("Unable to load image"))},i.src=o})}cleanup(){this.resources.clear(),this.tempFiles=[],this.convertedFonts.clear(),this.wakenetPacker.clear(),this.spiffsGenerator.clear(),this.gifScaler.dispose()}async clearAllStoredData(){try{await this.configStorage.clearAll(),this.cleanup(),console.log("All stored data cleared")}catch(A){throw console.error("Failed to clear stored data:",A),A}}async getStorageStatus(){try{const A=await this.configStorage.getStorageInfo();return{hasStoredData:await this.configStorage.hasStoredConfig(),storageInfo:A,autoSaveEnabled:this.autoSaveEnabled}}catch(A){return console.error("Failed to get storage status:",A),{hasStoredData:!1,storageInfo:null,autoSaveEnabled:this.autoSaveEnabled}}}setAutoSave(A){this.autoSaveEnabled=A,console.log(`Auto-save ${A?"enabled":"disabled"}`)}getResourceSummary(){const A=[],g=this.preparePackageResources(),t={wakeword:0,font:0,emoji:0,background:0};return g.files.forEach(I=>{t[I.type]=(t[I.type]||0)+1;let o="";switch(I.type){case"wakeword":o=`Wakeword model: ${I.name} (${I.modelType})`;break;case"font":I.config?o=`Custom font: size ${I.config.size}px, BPP ${I.config.bpp}`:o=`Preset font: ${I.source}`;break;case"emoji":o=`Emoji: ${I.name} (${I.size.width}x${I.size.height})`;break;case"background":o=`${I.mode==="light"?"Light":"Dark"} mode background`;break}A.push({type:I.type,filename:I.filename,description:o})}),{files:A,counts:t,totalFiles:A.length,indexJson:g.indexJson}}}const QE={class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4"},EE={class:"bg-white rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] overflow-hidden"},lE={class:"flex items-center justify-between p-6 border-b border-gray-200"},cE={class:"text-lg font-medium text-gray-900"},hE={key:1,class:"text-sm text-orange-600 font-medium"},uE={class:"p-6 overflow-y-auto",style:{"max-height":"calc(90vh - 140px)"}},dE={key:0,class:"space-y-6"},fE={class:"font-medium text-gray-900 mb-3"},wE={class:"bg-gray-50 rounded-lg p-4 space-y-2 text-sm"},pE={class:"flex justify-between"},yE={class:"text-gray-600"},DE={class:"font-medium"},mE={class:"flex justify-between"},FE={class:"text-gray-600"},kE={class:"font-medium"},vE={class:"flex justify-between"},SE={class:"text-gray-600"},GE={class:"font-medium"},RE={class:"flex justify-between"},UE={class:"text-gray-600"},NE={class:"font-medium"},bE={class:"flex justify-between"},LE={class:"text-gray-600"},ME={class:"font-medium"},JE={class:"font-medium text-gray-900 mb-3"},xE={class:"space-y-2 max-h-64 overflow-y-auto"},HE={class:"flex items-center"},YE={class:"text-sm font-medium text-gray-900"},KE={class:"text-sm text-gray-700"},TE={key:0,class:"text-xs text-gray-500 ml-1"},VE={key:1,class:"text-xs text-gray-500 ml-1"},qE={key:1,class:"space-y-6 text-center"},OE={class:"space-y-4"},WE={class:"text-gray-600 mt-2"},PE={class:"bg-gray-200 rounded-full h-2 overflow-hidden"},ZE={class:"text-sm text-gray-600"},XE={class:"mt-1"},jE={class:"space-y-2 text-left"},zE={class:"flex-shrink-0 mr-3"},_E={key:0,class:"w-5 h-5 bg-green-500 rounded-full flex items-center justify-center"},$E={key:1,class:"w-5 h-5 bg-primary-500 rounded-full animate-pulse"},Al={key:2,class:"w-5 h-5 bg-gray-300 rounded-full"},el={key:2,class:"text-center space-y-6"},gl={class:"text-gray-600 mt-2"},tl={class:"bg-green-50 border border-green-200 rounded-lg p-4"},Il={class:"text-sm text-green-800 space-y-1"},ol={class:"space-y-3"},il=["disabled"],rl={key:3,class:"space-y-6 text-center"},Cl={class:"space-y-4"},nl={class:"text-gray-600"},Bl={class:"bg-gray-200 rounded-full h-2 overflow-hidden"},al={class:"text-sm text-gray-600"},sl={class:"mt-1"},Ql={key:4,class:"text-center mt-4"},El={class:"text-sm text-red-600"},ll={class:"flex justify-end space-x-3 p-6 border-t border-gray-200"},cl=["disabled"],hl={__name:"GenerateModal",props:{config:{type:Object,required:!0}},emits:["close","generate","startFlash","cancelFlash"],setup(e,{emit:A}){const{t:g}=TA(),t=e,I=A,{deviceInfo:o}=ig(),i=j(!1),r=j(!1),C=j(0),B=j(""),n=j(""),Q=j(""),s=j(null),E=j(null),h=j(!1),w=j(!1),u=j(0),l=j(""),f=j(""),c=nA(()=>[{id:1,name:g("progressSteps.init"),status:"pending"},{id:2,name:g("progressSteps.font"),status:"pending"},{id:3,name:g("progressSteps.wakeword"),status:"pending"},{id:4,name:g("progressSteps.emoji"),status:"pending"},{id:5,name:g("progressSteps.background"),status:"pending"},{id:6,name:g("progressSteps.index"),status:"pending"},{id:7,name:g("progressSteps.spiffs"),status:"pending"},{id:8,name:g("progressSteps.package"),status:"pending"}]),D=j([]),p=we({render:()=>eA("svg",{fill:"currentColor",viewBox:"0 0 20 20"},[eA("path",{d:"M4 3a2 2 0 00-2 2v1a1 1 0 001 1h14a1 1 0 001-1V5a2 2 0 00-2-2H4zM3 8a1 1 0 011-1h12a1 1 0 011 1v5a2 2 0 01-2 2H5a2 2 0 01-2-2V8z"})])}),v=we({render:()=>eA("svg",{fill:"currentColor",viewBox:"0 0 20 20"},[eA("path",{"fill-rule":"evenodd",d:"M7 4a3 3 0 016 0v4a3 3 0 11-6 0V4zm4 10.93A7.001 7.001 0 0017 8a1 1 0 10-2 0A5 5 0 015 8a1 1 0 00-2 0 7.001 7.001 0 006 6.93V17H6a1 1 0 100 2h8a1 1 0 100-2h-3v-2.07z","clip-rule":"evenodd"})])}),N=we({render:()=>eA("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[eA("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 4l8 16m-6-6h4"})])}),L=we({render:()=>eA("svg",{fill:"currentColor",viewBox:"0 0 20 20"},[eA("path",{"fill-rule":"evenodd",d:"M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z","clip-rule":"evenodd"})])}),X=nA(()=>D.value.length>0),k={wn9s_hilexin:"generateModal.wakewordNames.wn9s_hilexin",wn9s_hiesp:"generateModal.wakewordNames.wn9s_hiesp",wn9s_nihaoxiaozhi:"generateModal.wakewordNames.wn9s_nihaoxiaozhi",wn9s_hijason:"Hi, Jason",wn9s_alexa:"Alexa",wn9_hilexin:"Hi, Espressif",wn9_hiesp:"Hi, ESP",wn9_nihaoxiaozhi_tts:"generateModal.wakewordNames.wn9_nihaoxiaozhi_tts",wn9_hijason_tts2:"Hi, Jason",wn9_himfive:"Hi, M Five",wn9_alexa:"generateModal.wakewordNames.wn9_alexa",wn9_jarvis_tts:"Jarvis",wn9_computer_tts:"Computer",wn9_heywillow_tts:"Hey, Willow",wn9_sophia_tts:"Sophia",wn9_heyprinter_tts:"Hey, Printer",wn9_hijoy_tts:"Hi, Joy",wn9_heywanda_tts:"Hey, Wand",wn9_astrolabe_tts:"Astrolabe",wn9_heyily_tts2:"Hey, Ily",wn9_hijolly_tts2:"Hi, Jolly",wn9_hifairy_tts2:"Hi, Fairy",wn9_bluechip_tts2:"Blue Chip",wn9_hiandy_tts2:"Hi, Andy",wn9_heyivy_tts2:"Hey, Ivy",wn9_histackchan_tts3:"Hi, Stack Chan",wn9_hiwalle_tts2:"Hi, Wall E",wn9_hilili_tts:"Hi, Lily",wn9_hitelly_tts:"Hi, Telly",wn9_linaiban_tts2:"Lina Board"},m=b=>{const H=k[b];return H!=null&&H.startsWith("generateModal.")?g(H):H||b},M=()=>{const b=t.config.theme.wakeword;return!b||b.type==="none"?g("wakewordConfig.noWakeword"):b.type==="preset"?m(b.preset):b.type==="custom"?b.custom.name||g("wakewordConfig.customWakeword"):g("wakewordConfig.noWakeword")},oA=()=>t.config.theme.font.type==="preset"?t.config.theme.font.preset.replace("font_","").replace("_"," "):g("generateModal.customFont"),F=()=>t.config.theme.emoji.type==="preset"&&t.config.theme.emoji.preset?{twemoji32:"Twemoji 32×32",twemoji64:"Twemoji 64×64","noto-emoji_64":"Noto Emoji 64×64","noto-emoji_128":"Noto Emoji 128×128"}[t.config.theme.emoji.preset]||t.config.theme.emoji.preset:t.config.theme.emoji.type==="custom"?g("generateModal.customEmoji"):t.config.theme.emoji.type==="none"?g("emojiConfig.noEmojiPack"):g("generateModal.notConfigured"),S=()=>{D.value=[],D.value.push({id:"index",name:"index.json",description:"Configuration index file",icon:p,iconColor:"text-blue-500",size:"1KB"});const b=t.config.theme.wakeword;if(b&&b.type!=="none"&&D.value.push({id:"srmodels",name:"srmodels.bin",description:b.type==="custom"?"Custom command model":"Preset wake word model",icon:v,iconColor:"text-green-500",size:b.type==="custom"?"~1.2MB":"~300KB"}),t.config.theme.font.type==="preset"){const H={font_puhui_deepseek_14_1:"180KB",font_puhui_deepseek_16_4:"720KB",font_puhui_deepseek_20_4:"1.1MB",font_puhui_deepseek_30_4:"2.5MB"};D.value.push({id:"font",name:`${t.config.theme.font.preset}.bin`,description:"Preset font file",icon:N,iconColor:"text-yellow-500",size:H[t.config.theme.font.preset]||"500KB"})}else if(t.config.theme.font.custom.file){const H=t.config.theme.font.custom,Z=Math.max(100,H.size*H.size*H.bpp*.7);D.value.push({id:"font",name:`font_custom_${H.size}_${H.bpp}.bin`,description:"Custom font file",icon:N,iconColor:"text-yellow-500",size:Z>1024?`${(Z/1024).toFixed(1)}MB`:`${Math.round(Z)}KB`,estimated:!0})}if(t.config.theme.emoji.type==="preset"&&t.config.theme.emoji.preset){const H=["neutral","happy","laughing","funny","sad","angry","crying","loving","embarrassed","surprised","shocked","thinking","winking","cool","relaxed","delicious","kissy","confident","sleepy","silly","confused"],Z=t.config.theme.emoji.preset==="twemoji64"?"3KB":"1KB";H.forEach(IA=>{D.value.push({id:`emoji_${IA}`,name:`${IA}.png`,description:`${IA} emoji image`,icon:L,iconColor:"text-pink-500",size:Z})})}else if(t.config.theme.emoji.type==="custom"){const H=t.config.theme.emoji.custom,Z=H.emotionMap||{},IA=H.fileMap||{};if(H.images,Object.keys(Z).length===0||Object.keys(IA).length===0){console.error(g("errors.incompatibleEmojiData"));return}const z=new Map,lA=new Map;Object.entries(Z).forEach(([wA,pA])=>{const JA=IA[pA];if(JA){if(!z.has(pA)){const ee=Math.round(JA.size/1024);z.set(pA,{file:JA,size:ee>1024?`${(ee/1024).toFixed(1)}MB`:`${ee}KB`,emotions:[]})}z.get(pA).emotions.push(wA),lA.set(wA,pA)}}),z.forEach((wA,pA)=>{const JA=wA.emotions.join(", "),ee=wA.emotions.length>1;D.value.push({id:`emoji_${pA.substring(0,8)}`,name:`emoji_${pA.substring(0,8)}.${wA.file.name.split(".").pop()}`,description:ee?`Shared emoji images (${JA})`:`${JA} emoji image`,icon:L,iconColor:ee?"text-purple-500":"text-pink-500",size:wA.size,isCustomEmoji:!0})}),z.size1024?`${(IA/1024).toFixed(1)}MB`:`${IA}KB`,estimated:!0})}if(t.config.theme.skin.dark.backgroundType==="image"&&t.config.theme.skin.dark.backgroundImage){const{width:H,height:Z}=t.config.chip.display,IA=Math.round(H*Z*2/1024);D.value.push({id:"bg_dark",name:"background_dark.raw",description:"Dark mode background image",icon:L,iconColor:"text-indigo-500",size:IA>1024?`${(IA/1024).toFixed(1)}MB`:`${IA}KB`,estimated:!0})}},J=b=>{if(b===0)return"0 B";const H=1024,Z=["B","KB","MB","GB"],IA=Math.floor(Math.log(b)/Math.log(H));return`${parseFloat((b/Math.pow(H,IA)).toFixed(2))} ${Z[IA]}`},V=b=>{if(b<1e3)return`${b}ms`;if(b<6e4)return`${(b/1e3).toFixed(1)}s`;{const H=Math.floor(b/6e4),Z=Math.floor(b%6e4/1e3);return`${H}m ${Z}s`}},q=async()=>{i.value=!0,C.value=0,E.value=Date.now();try{const b=new aI;b.setConfig(t.config);const H=await b.generateAssetsBin((z,lA)=>{C.value=parseInt(z),B.value=lA;const wA=Math.floor(z/(100/c.value.length));c.value.forEach((pA,JA)=>{JA{z.status="completed"}),I("generate",D.value.map(z=>({id:z.id,name:z.name})))}catch(b){console.error("Failed to generate assets.bin:",b),i.value=!1,r.value=!1,alert(g("errors.generationFailed",{error:b.message}))}},$=()=>{if(s.value){const b=URL.createObjectURL(s.value),H=document.createElement("a");H.href=b,H.download="assets.bin",H.style.display="none",document.body.appendChild(H),H.click(),document.body.removeChild(H),URL.revokeObjectURL(b)}else console.error(g("errors.noFileToDownload"))},AA=async()=>{try{const H=new URLSearchParams(window.location.search).get("token");if(!H){h.value=!1;return}const Z=await fetch("/api/messaging/device/tools/list",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${H}`}});h.value=Z.ok}catch(b){console.error(g("flashProgress.unableToGetDeviceStatus"),b),h.value=!1}},_=async()=>{if(!s.value){alert(g("errors.noFileToDownload"));return}if(!h.value){alert(g("errors.deviceOffline"));return}if(o.value.assetsPartition&&o.value.assetsPartition.size){const b=o.value.assetsPartition.size,H=s.value.size;if(H>b){const Z=(H/1024/1024).toFixed(2),IA=(b/1024/1024).toFixed(2);alert(g("errors.fileTooLarge",{fileSize:Z,partitionSize:IA}));return}}w.value=!0,u.value=0,l.value=g("flashProgress.startingFileTransfer"),f.value="";try{I("startFlash",{blob:s.value,onProgress:(b,H)=>{u.value=b,l.value=H},onComplete:()=>{w.value=!1,u.value=100,l.value=g("flashProgress.flashCompleted")},onError:b=>{w.value=!1,f.value=b,console.error(g("flashProgress.onlineFlashFailed",{error:b}))}})}catch(b){w.value=!1,f.value=g("flashProgress.onlineFlashFailed",{error:b.message}),console.error(g("flashProgress.onlineFlashFailed",{error:b}))}},iA=()=>{confirm(g("errors.flashCancelConfirm"))&&(w.value=!1,u.value=0,l.value="",f.value="",I("cancelFlash"))};return Me(async()=>{S(),await AA()}),(b,H)=>(G(),U("div",QE,[a("div",EE,[a("div",lE,[a("h3",cE,d(b.$t("generateModal.title")),1),w.value?(G(),U("div",hE,d(b.$t("generateModal.flashingInProgress")),1)):(G(),U("button",{key:0,onClick:H[0]||(H[0]=Z=>b.$emit("close")),class:"text-gray-400 hover:text-gray-500"},[...H[3]||(H[3]=[a("svg",{class:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])]))]),a("div",uE,[!i.value&&!r.value?(G(),U("div",dE,[a("div",null,[a("h4",fE,d(b.$t("generateModal.confirmConfig")),1),a("div",wE,[a("div",pE,[a("span",yE,d(b.$t("generateModal.chipModel")),1),a("span",DE,d(e.config.chip.model.toUpperCase()),1)]),a("div",mE,[a("span",FE,d(b.$t("generateModal.resolution")),1),a("span",kE,d(e.config.chip.display.width)+"×"+d(e.config.chip.display.height),1)]),a("div",vE,[a("span",SE,d(b.$t("generateModal.wakeword")),1),a("span",GE,d(M()),1)]),a("div",RE,[a("span",UE,d(b.$t("generateModal.font")),1),a("span",NE,d(oA()),1)]),a("div",bE,[a("span",LE,d(b.$t("generateModal.emoji")),1),a("span",ME,d(F()),1)])])]),a("div",null,[a("h4",JE,d(b.$t("generateModal.fileList")),1),a("div",xE,[(G(!0),U(bA,null,LA(D.value,Z=>(G(),U("div",{key:Z.id,class:"flex items-center justify-between px-3 py-2 border border-gray-200 rounded bg-gray-50"},[a("div",HE,[(G(),UA(Bt(Z.icon),{class:gA(["w-4 h-4 mr-2",Z.iconColor])},null,8,["class"])),a("span",YE,d(Z.name),1)]),a("div",KE,[HA(d(Z.size)+" ",1),Z.estimated?(G(),U("span",TE,d(b.$t("generateModal.estimated")),1)):O("",!0),Z.isCustomEmoji?(G(),U("span",VE,d(b.$t("generateModal.compressed")),1)):O("",!0)])]))),128))])])])):O("",!0),i.value?(G(),U("div",qE,[H[5]||(H[5]=a("div",{class:"flex items-center justify-center"},[a("div",{class:"animate-spin rounded-full h-16 w-16 border-b-2 border-primary-500"})],-1)),a("div",OE,[a("p",WE,d(b.$t("generateModal.generating")),1),a("div",PE,[a("div",{class:"bg-primary-500 h-2 rounded-full transition-all duration-500 ease-out",style:CA({width:C.value+"%"})},null,4)]),a("div",ZE,[a("div",null,d(B.value),1),a("div",XE,d(b.$t("generateModal.progress",{progress:C.value})),1)])]),a("div",jE,[(G(!0),U(bA,null,LA(c.value,Z=>(G(),U("div",{key:Z.id,class:"flex items-center text-sm"},[a("div",zE,[Z.status==="completed"?(G(),U("div",_E,[...H[4]||(H[4]=[a("svg",{class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},[a("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})],-1)])])):Z.status==="processing"?(G(),U("div",$E)):(G(),U("div",Al))]),a("span",{class:gA([Z.status==="completed"?"text-green-700":Z.status==="processing"?"text-primary-700":"text-gray-500"])},d(Z.name),3)]))),128))])])):O("",!0),r.value&&!w.value?(G(),U("div",el,[H[8]||(H[8]=a("div",{class:"mx-auto flex items-center justify-center"},[a("svg",{class:"w-20 h-20 text-green-600",fill:"currentColor",viewBox:"0 0 20 20"},[a("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})])],-1)),a("div",null,[a("p",gl,d(b.$t("generateModal.completed")),1)]),a("div",tl,[a("div",Il,[a("div",null,d(b.$t("generateModal.filename")),1),a("div",null,d(b.$t("generateModal.fileSize",{size:n.value})),1),a("div",null,d(b.$t("generateModal.generationTime",{time:Q.value})),1)])]),a("div",ol,[a("button",{onClick:$,class:"w-full bg-gray-100 hover:bg-gray-200 text-gray-700 px-6 py-3 rounded-lg font-medium transition-colors flex items-center justify-center"},[H[6]||(H[6]=a("svg",{class:"w-5 h-5 mr-2",fill:"currentColor",viewBox:"0 0 20 20"},[a("path",{"fill-rule":"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)),HA(" "+d(b.$t("generateModal.downloadAssets")),1)]),a("button",{onClick:_,disabled:!h.value,class:"w-full bg-blue-500 hover:bg-blue-600 disabled:bg-gray-300 text-white px-6 py-3 rounded-lg font-medium transition-colors flex items-center justify-center"},[H[7]||(H[7]=a("svg",{class:"w-5 h-5 mr-2",fill:"currentColor",viewBox:"0 0 20 20"},[a("path",{"fill-rule":"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)),HA(" "+d(b.$t("generateModal.flashToDevice")),1)],8,il)])])):O("",!0),w.value&&!f.value?(G(),U("div",rl,[H[9]||(H[9]=a("div",{class:"flex items-center justify-center"},[a("div",{class:"animate-spin rounded-full h-16 w-16 border-b-2 border-blue-500"})],-1)),a("div",Cl,[a("p",nl,d(b.$t("generateModal.flashing")),1),a("div",Bl,[a("div",{class:"bg-blue-500 h-2 rounded-full transition-all duration-500 ease-out",style:CA({width:u.value+"%"})},null,4)]),a("div",al,[a("div",null,d(l.value),1),a("div",sl,d(b.$t("generateModal.progress",{progress:u.value})),1)])]),a("button",{onClick:iA,class:"px-4 py-2 text-sm font-medium text-red-600 bg-red-50 hover:bg-red-100 rounded-md transition-colors"},d(b.$t("generateModal.flashingCancel")),1)])):O("",!0),f.value?(G(),U("div",Ql,[a("p",El,d(f.value),1)])):O("",!0)]),a("div",ll,[!i.value&&!r.value?(G(),U("button",{key:0,onClick:H[1]||(H[1]=Z=>b.$emit("close")),class:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-md transition-colors"},d(b.$t("common.cancel")),1)):O("",!0),!i.value&&!r.value?(G(),U("button",{key:1,onClick:q,disabled:!X.value,class:"px-6 py-2 text-sm font-medium text-white bg-primary-500 hover:bg-primary-600 disabled:bg-gray-300 rounded-md transition-colors"},d(b.$t("common.start"))+" "+d(b.$t("common.generate")),9,cl)):O("",!0),r.value&&!w.value?(G(),U("button",{key:2,onClick:H[2]||(H[2]=Z=>b.$emit("close")),class:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-md transition-colors"},d(b.$t("common.close")),1)):O("",!0)])])]))}};class ul{constructor(A){this.token=A,this.ws=null,this.isConnected=!1,this.isCancelled=!1,this.chunkSize=64*1024,this.onProgress=null,this.onError=null,this.onComplete=null,this.onDownloadUrlReady=null,this.onTransferStarted=null,this.currentSession=null,this.totalBytesSent=0,this.isSendingChunk=!1}async connect(){return new Promise((A,g)=>{try{const t=`wss://api.tenclass.net/transfer/?token=${encodeURIComponent(this.token)}`;this.ws=new WebSocket(t),this.ws.onopen=()=>{this.isConnected=!0,console.log("WebSocket connected to transfer server"),A()},this.ws.onmessage=I=>{this.handleMessage(I)},this.ws.onerror=I=>{console.error("WebSocket error:",I),this.isConnected=!1,g(new Error("WebSocket connection failed"))},this.ws.onclose=I=>{console.log("WebSocket closed:",I.code,I.reason),this.isConnected=!1},setTimeout(()=>{this.isConnected||(this.ws.close(),g(new Error("WebSocket connection timeout")))},1e4)}catch(t){g(new Error(`Failed to create WebSocket connection: ${t.message}`))}})}handleMessage(A){try{if(typeof A.data=="string"){const g=JSON.parse(A.data);switch(g.type){case"file_created":this.currentSession&&(this.currentSession.url=g.url,this.onDownloadUrlReady&&this.onDownloadUrlReady(g.url));break;case"transfer_started":this.currentSession&&(this.currentSession.transferStarted=!0,this.onTransferStarted&&this.onTransferStarted(),this.currentSession.transferReady&&this.sendFileData());break;case"ack":if(this.currentSession){const{blob:t}=this.currentSession,I=t.size,o=g.bytesSent;if(o<0){console.error("Invalid server bytesSent (negative):",o),this.isSendingChunk=!1,this.onError&&this.onError(new Error("Server returned invalid byte count"));return}if(o>I){console.error(`Server bytesSent (${o}) exceeds fileSize (${I})`),this.isSendingChunk=!1,this.onError&&this.onError(new Error("Server byte count exceeds file size"));return}this.isSendingChunk=!1,o>this.currentSession.bytesSent&&(this.currentSession.bytesSent=o),this.sendFileData()}break;case"transfer_completed":if(this.currentSession){const t=this.currentSession.blob.size;this.totalBytesSent!==t&&console.warn(`Transfer size mismatch: sent ${this.totalBytesSent} bytes, expected ${t} bytes`)}this.onComplete&&this.onComplete();break;case"error":console.error("Transfer error:",g.message),this.onError&&this.onError(new Error(g.message));break}}}catch(g){console.error("Error handling message:",g),this.onError&&this.onError(g)}}async sendFileData(){if(this.isSendingChunk||!this.currentSession||this.isCancelled)return;const{blob:A}=this.currentSession,g=A.size;let t=this.currentSession.bytesSent;if(t>=g){this.onProgress&&this.onProgress(100,"Transfer completed, waiting for device confirmation...");return}if(this.isSendingChunk=!0,t>g){console.error(`Critical error: bytesSent (${t}) exceeds fileSize (${g})`),this.onError&&this.onError(new Error("Transfer byte count exceeds file size"));return}const I=Math.max(0,g-t),o=Math.min(this.chunkSize,I);if(o<=0)return;const i=A.slice(t,t+o);try{const r=await new Promise((Q,s)=>{const E=new FileReader;E.onload=()=>Q(E.result),E.onerror=()=>s(new Error("File read failed")),E.readAsArrayBuffer(i)});if(this.isCancelled)return;this.ws.send(r);const C=t+o;if(this.currentSession.bytesSent=C,this.totalBytesSent+=o,C>g){console.error(`Critical error: bytesSent (${C}) exceeds fileSize (${g})`),this.onError&&this.onError(new Error("Transfer byte count exceeds file size"));return}if(this.totalBytesSent>g){console.error(`Critical error: totalBytesSent (${this.totalBytesSent}) exceeds fileSize (${g})`),this.onError&&this.onError(new Error("Total sent bytes exceed file size"));return}const B=Math.round(C/g*60)+40,n=`Transferring... ${Math.round(C/1024)}KB / ${Math.round(g/1024)}KB`;this.onProgress&&this.onProgress(B,n)}catch(r){console.error("Error sending file chunk:",r),this.isSendingChunk=!1,this.onError&&this.onError(r)}}async initializeSession(A,g,t,I){return new Promise((o,i)=>{this.onProgress=g,this.onError=r=>{t&&t(r),i(r)},this.onDownloadUrlReady=r=>{I&&I(r),o(r)},this.isCancelled=!1;try{this.onProgress&&this.onProgress(5,"Connecting to transfer server..."),this.connect().then(()=>{this.onProgress&&this.onProgress(10,"Creating file session...");const r={type:"create_file",fileName:"assets.bin",fileSize:A.size};this.ws.send(JSON.stringify(r)),this.currentSession={blob:A,bytesSent:0,fileSize:A.size,transferStarted:!1,transferReady:!0},this.totalBytesSent=0}).catch(r=>{console.error("Transfer initialization failed:",r),this.onError&&this.onError(r)})}catch(r){console.error("Transfer initialization failed:",r),this.onError&&this.onError(r)}})}async startTransfer(A,g,t){return new Promise((I,o)=>{if(this.onProgress=A,this.onError=i=>{this.isSendingChunk=!1,g&&g(i),o(i)},this.onComplete=()=>{this.isSendingChunk=!1,t&&t(),I()},!this.currentSession||!this.currentSession.blob){const i=new Error("Transfer session not initialized");this.onError&&this.onError(i),o(i);return}this.currentSession.transferReady=!0,this.currentSession.transferStarted&&this.sendFileData()})}async transferFile(A,g,t,I,o){if(o){await this.initializeSession(A,g,t,o);return}this.onProgress=g,this.onError=t,this.onComplete=I,this.isCancelled=!1;try{this.onProgress&&this.onProgress(5,"Connecting to transfer server..."),await this.connect(),this.onProgress&&this.onProgress(10,"Creating file session...");const i={type:"create_file",fileName:"assets.bin",fileSize:A.size};this.ws.send(JSON.stringify(i)),this.currentSession={blob:A,bytesSent:0,fileSize:A.size,transferStarted:!1,transferReady:!0}}catch(i){console.error("Transfer initialization failed:",i),this.onError&&this.onError(i)}}cancel(){this.isCancelled=!0,this.isSendingChunk=!1,this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.close()}destroy(){this.cancel(),this.onProgress=null,this.onError=null,this.onComplete=null,this.onDownloadUrlReady=null,this.onTransferStarted=null,this.totalBytesSent=0,this.isSendingChunk=!1}}const dl={class:"flex items-center justify-between mb-2"},fl={class:"flex items-center"},wl={class:"text-blue-800 font-medium"},pl={class:"text-blue-600 text-sm mb-3"},yl={class:"flex justify-end space-x-2"},Dl={class:"flex items-center justify-center mb-8"},ml={class:"flex flex-col items-center"},Fl={class:"text-sm mt-2 text-gray-600"},kl={key:0,class:"w-16 h-0.5 bg-gray-300 mx-4"},vl={class:"bg-white rounded-lg shadow-sm border p-6"},Gl={__name:"HomePage",setup(e){const{callMcpTool:A}=ig(),{t:g}=TA(),t=j(0),I=j(!1),o=j("wakeword"),i=j(!1),r=j(!1),C=j(!1),B=j(!0),n=new aI,Q=j(null),s=j(null),E=[{titleKey:"steps.chip",key:"chip"},{titleKey:"steps.theme",key:"theme"},{titleKey:"steps.generate",key:"generate"}],h=j({chip:{model:"",display:{width:320,height:240,color:"RGB565"}},theme:{wakeword:{type:"none",preset:"",custom:{name:"",command:"",threshold:20,duration:3e3,model:"mn6_en"}},font:{type:"none",preset:"",hide_subtitle:!1,custom:{file:null,size:20,bpp:4,charset:"deepseek"}},emoji:{type:"none",preset:"",custom:{size:{width:160,height:120},images:{}}},skin:{light:{backgroundType:"color",backgroundColor:"#ffffff",textColor:"#000000",backgroundImage:null},dark:{backgroundType:"color",backgroundColor:"#121212",textColor:"#ffffff",backgroundImage:null}}}}),w=S=>S{t.value{t.value>0&&t.value--},f=()=>{I.value=!0},c=async S=>{},D=()=>new URLSearchParams(window.location.search).get("token"),p=async(S,J={})=>await A(S,J),v=async S=>{const{blob:J,onProgress:V,onComplete:q,onError:$}=S;try{const AA=D();if(!AA)throw new Error(g("flashProgress.authTokenMissing"));V(5,g("flashProgress.checkingDeviceStatus"));try{if(!await p("self.get_device_status"))throw new Error(g("flashProgress.deviceOfflineOrUnresponsive",{error:g("flashProgress.unableToGetDeviceStatus")}))}catch(z){console.error("Failed to check device status:",z),$(g("flashProgress.deviceOfflineOrUnresponsive",{error:z.message}));return}V(15,g("flashProgress.initializingTransferService")),s.value=new ul(AA);let _=null;const iA=new Promise((z,lA)=>{_=z});let b=null;const H=new Promise((z,lA)=>{b=z});s.value.onTransferStarted=()=>{b&&(b(),b=null)},await s.value.initializeSession(J,(z,lA)=>{V(15+z*.75,lA)},z=>{console.error("Failed to initialize the WebSocket session:",z),$(g("flashProgress.initializeTransferFailed",{error:z.message}))},z=>{_(z)});const Z=await iA;V(30,g("flashProgress.settingDeviceDownloadUrl"));try{await p("self.assets.set_download_url",{url:Z})}catch(z){console.error("Failed to set the device download URL:",z),$(g("flashProgress.setDownloadUrlFailed",{error:z.message}));return}V(40,g("flashProgress.rebootingDevice")),p("self.reboot").catch(z=>{console.warn("Reboot call warning (the device may have already restarted):",z)}),V(50,g("flashProgress.waitingForDeviceReboot"));const IA=new Promise((z,lA)=>{setTimeout(()=>lA(new Error(g("flashProgress.deviceRebootTimeout"))),6e4)});await Promise.race([H,IA]),V(60,g("flashProgress.startingFileTransfer")),await s.value.startTransfer((z,lA)=>{const wA=60+z*.4;V(Math.round(wA),lA)},z=>{$(g("flashProgress.onlineFlashFailed",{error:z.message}))},()=>{q()}),s.value.onTransferStarted=null}catch(AA){console.error("Online flashing failed:",AA),$(g("flashProgress.onlineFlashFailed",{error:AA.message}))}},N=()=>{s.value&&(s.value.cancel(),s.value.destroy(),s.value=null)},L=S=>{o.value=S},X=async()=>{var S,J,V;try{B.value=!0;const q=await cA.loadConfig();if(q){h.value=q.config,t.value=0,o.value="wakeword",i.value=!0,r.value=!0,await k(),Q.value&&clearTimeout(Q.value),Q.value=setTimeout(()=>{i.value=!1},5e3),n.setConfig(h.value,{strict:!1}),await n.restoreAllResourcesFromStorage(h.value);try{const $=((V=(J=(S=h.value)==null?void 0:S.theme)==null?void 0:J.emoji)==null?void 0:V.custom)||{},AA=$.images||{},_=$.fileMap||{},iA=$.emotionMap||{};h.value={...h.value,theme:{...h.value.theme,emoji:{...h.value.theme.emoji,custom:{...$,images:{...AA},fileMap:{..._},emotionMap:{...iA}}}}}}catch($){console.error("Failed to refresh emoji config references:",$)}}else i.value=!1,r.value=!1}catch(q){console.error("Failed to load the saved configuration:",q),i.value=!1,r.value=!1}finally{B.value=!1}},k=async()=>{var S,J,V;try{const q=(V=(J=(S=h.value)==null?void 0:S.theme)==null?void 0:J.emoji)==null?void 0:V.custom;if(!q)return;const $=Object.keys(q.images||{}).length>0,AA=q.fileMap&&Object.keys(q.fileMap).length>0,_=q.emotionMap&&Object.keys(q.emotionMap).length>0;if($&&(!AA||!_)){console.warn("Detected an incompatible legacy emoji data structure"),console.log("Cleaning legacy emoji data...");try{const b=Object.keys(q.images||{});for(const H of b)await cA.deleteFile(`emoji_${H}`);console.log(`Deleted ${b.length} legacy emoji files`)}catch(b){console.warn("Failed while deleting legacy emoji files:",b)}h.value.theme.emoji.custom={size:q.size||{width:64,height:64},images:{},fileMap:{},emotionMap:{}},h.value.theme.emoji.type==="custom"&&(h.value.theme.emoji.type="",console.log("Reset the emoji type so it can be selected again")),await m(),console.log("Legacy emoji data was fully cleared"),setTimeout(()=>{alert(`An incompatible legacy emoji data structure was removed. + +The new version deduplicates shared image files to save storage space. + +Please re-upload your custom emoji images.`)},500)}}catch(q){console.error("Failed to clean up legacy emoji data:",q)}},m=async()=>{try{await cA.saveConfig(h.value)}catch(S){console.error("Failed to save configuration:",S)}},M=async()=>{try{C.value=!0,await n.clearAllStoredData();const S={model:h.value.chip.model,display:{...h.value.chip.display}};h.value={chip:S,theme:{wakeword:{type:"none",preset:"",custom:{name:"",command:"",threshold:20,model:"mn6_en"}},font:{type:"none",preset:"",hide_subtitle:!1,custom:{file:null,size:20,bpp:4,charset:"deepseek"}},emoji:{type:"none",preset:"",custom:{size:{width:64,height:64},images:{}}},skin:{light:{backgroundType:"color",backgroundColor:"#ffffff",textColor:"#000000",backgroundImage:null},dark:{backgroundType:"color",backgroundColor:"#121212",textColor:"#ffffff",backgroundImage:null}}}},t.value=0,o.value="wakeword",i.value=!1,r.value=!1}catch(S){console.error("Failed to reset configuration:",S),alert(g("errors.resetFailed"))}finally{C.value=!1}};DA(h,async S=>{!B.value&&r.value&&await m()},{deep:!0}),Me(async()=>{await cA.initialize(),await X()}),at(()=>{Q.value&&clearTimeout(Q.value)});const oA=()=>{i.value=!1,Q.value&&clearTimeout(Q.value)},F=()=>{Q.value&&clearTimeout(Q.value),Q.value=setTimeout(()=>{i.value=!1},5e3)};return(S,J)=>(G(),U("div",null,[i.value?(G(),U("div",{key:0,class:"fixed bottom-4 right-4 z-50 bg-blue-50 border border-blue-200 rounded-lg p-4 shadow-lg transition-opacity duration-300 min-w-[300px]",onMouseenter:F},[a("div",dl,[a("div",fl,[J[3]||(J[3]=a("svg",{class:"w-5 h-5 text-blue-500 mr-2",fill:"currentColor",viewBox:"0 0 20 20"},[a("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"})],-1)),a("span",wl,d(S.$t("configNotice.title")),1)]),a("button",{onClick:oA,class:"text-gray-500 hover:text-gray-700"},[...J[4]||(J[4]=[a("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),a("p",pl,d(S.$t("configNotice.message")),1),a("div",yl,[a("button",{onClick:M,class:"px-3 py-1 text-sm text-red-600 hover:text-red-800 font-medium"},d(S.$t("configNotice.restart")),1)])],32)):O("",!0),a("div",Dl,[(G(),U(bA,null,LA(E,(V,q)=>a("div",{key:q,class:"flex items-center"},[a("div",ml,[a("div",{class:gA(w(q))},d(q+1),3),a("span",Fl,d(S.$t(V.titleKey)),1)]),qh.value.chip=V),onNext:u},null,8,["modelValue"])):O("",!0),t.value===1?(G(),UA(kC,{key:1,modelValue:h.value.theme,"onUpdate:modelValue":J[1]||(J[1]=V=>h.value.theme=V),chipModel:h.value.chip.model,activeTab:o.value,onNext:u,onPrev:l,onTabChange:L},null,8,["modelValue","chipModel","activeTab"])):O("",!0),t.value===2?(G(),UA(wn,{key:2,config:h.value,onGenerate:f,onPrev:l},null,8,["config"])):O("",!0)]),I.value?(G(),UA(hl,{key:1,config:h.value,onClose:J[2]||(J[2]=V=>I.value=!1),onGenerate:c,onStartFlash:v,onCancelFlash:N},null,8,["config"])):O("",!0)]))}};export{Gl as default}; diff --git a/main/manager-web/public/generator/assets/HomePage-DL-rX2r7.css b/main/manager-web/public/generator/assets/HomePage-DL-rX2r7.css new file mode 100644 index 000000000..9a70c0bb8 --- /dev/null +++ b/main/manager-web/public/generator/assets/HomePage-DL-rX2r7.css @@ -0,0 +1 @@ +.emoji-container[data-v-fdf7b702]{display:flex;align-items:center;justify-content:center}.emoji-image[data-v-fdf7b702]{border-radius:8px;-o-object-fit:contain;object-fit:contain}.emoji-fallback[data-v-fdf7b702]{display:flex;align-items:center;justify-content:center}.text-message[data-v-fdf7b702]{line-height:1;word-wrap:break-word} diff --git a/main/manager-web/public/generator/assets/index-CT_dZ65o.css b/main/manager-web/public/generator/assets/index-CT_dZ65o.css deleted file mode 100644 index b299c78e5..000000000 --- a/main/manager-web/public/generator/assets/index-CT_dZ65o.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.-right-1{right:-.25rem}.-top-1{top:-.25rem}.bottom-4{bottom:1rem}.right-0{right:0}.right-4{right:1rem}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-0\.5{height:.125rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-32{height:8rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-full{height:100%}.max-h-32{max-height:8rem}.max-h-64{max-height:16rem}.max-h-\[90vh\]{max-height:90vh}.min-h-96{min-height:24rem}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[300px\]{min-width:300px}.max-w-2xl{max-width:42rem}.max-w-32{max-width:8rem}.max-w-7xl{max-width:80rem}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.grow{flex-grow:1}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-items-center{justify-items:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-green-300{--tw-border-opacity: 1;border-color:rgb(134 239 172 / var(--tw-border-opacity, 1))}.border-orange-200{--tw-border-opacity: 1;border-color:rgb(254 215 170 / var(--tw-border-opacity, 1))}.border-primary-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-orange-50{--tw-bg-opacity: 1;background-color:rgb(255 247 237 / var(--tw-bg-opacity, 1))}.bg-pink-100{--tw-bg-opacity: 1;background-color:rgb(252 231 243 / var(--tw-bg-opacity, 1))}.bg-primary-50{--tw-bg-opacity: 1;background-color:rgb(240 249 255 / var(--tw-bg-opacity, 1))}.bg-primary-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-sky-100{--tw-bg-opacity: 1;background-color:rgb(224 242 254 / var(--tw-bg-opacity, 1))}.bg-stone-100{--tw-bg-opacity: 1;background-color:rgb(245 245 244 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-opacity-10{--tw-bg-opacity: .1}.bg-opacity-50{--tw-bg-opacity: .5}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pr-10{padding-right:2.5rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-tight{line-height:1.25}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-green-900{--tw-text-opacity: 1;color:rgb(20 83 45 / var(--tw-text-opacity, 1))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-pink-500{--tw-text-opacity: 1;color:rgb(236 72 153 / var(--tw-text-opacity, 1))}.text-primary-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-primary-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-purple-500{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(113 63 18 / var(--tw-text-opacity, 1))}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-60{opacity:.6}.opacity-75{opacity:.75}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.grayscale{--tw-grayscale: grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.step-indicator{display:flex;height:2rem;width:2rem;align-items:center;justify-content:center;border-radius:9999px;font-size:.875rem;line-height:1.25rem;font-weight:500}.step-indicator.active{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.step-indicator.completed{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.step-indicator.inactive{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.tab-button{border-top-left-radius:.5rem;border-top-right-radius:.5rem;border-bottom-width:2px;padding:.5rem 1rem;font-size:.875rem;line-height:1.25rem;font-weight:500;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}.tab-button.active{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.tab-button.inactive{border-color:transparent;--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.tab-button.inactive:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:left-\[2px\]:after{content:var(--tw-content);left:2px}.after\:top-\[2px\]:after{content:var(--tw-content);top:2px}.after\:h-5:after{content:var(--tw-content);height:1.25rem}.after\:w-5:after{content:var(--tw-content);width:1.25rem}.after\:rounded-full:after{content:var(--tw-content);border-radius:9999px}.after\:border:after{content:var(--tw-content);border-width:1px}.after\:border-gray-300:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.after\:bg-white:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.after\:transition-all:after{content:var(--tw-content);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.after\:content-\[\'\'\]:after{--tw-content: "";content:var(--tw-content)}.hover\:border-gray-300:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.hover\:border-gray-400:hover{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity, 1))}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-600:hover{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.hover\:bg-pink-200:hover{--tw-bg-opacity: 1;background-color:rgb(251 207 232 / var(--tw-bg-opacity, 1))}.hover\:bg-primary-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-sky-200:hover{--tw-bg-opacity: 1;background-color:rgb(186 230 253 / var(--tw-bg-opacity, 1))}.hover\:bg-stone-200:hover{--tw-bg-opacity: 1;background-color:rgb(231 229 228 / var(--tw-bg-opacity, 1))}.hover\:bg-yellow-200:hover{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.hover\:text-gray-500:hover{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.hover\:text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.hover\:text-primary-500:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\:text-red-800:hover{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.focus\:border-primary-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:bg-gray-100:focus{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.focus\:ring-primary-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.disabled\:bg-gray-300:disabled{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.peer:checked~.peer-checked\:bg-primary-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.peer:checked~.peer-checked\:after\:translate-x-full:after{content:var(--tw-content);--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:checked~.peer-checked\:after\:border-white:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.peer:focus~.peer-focus\:outline-none{outline:2px solid transparent;outline-offset:2px}.peer:focus~.peer-focus\:ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}@media (min-width: 640px){.sm\:mr-2{margin-right:.5rem}.sm\:inline{display:inline}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:gap-0{gap:0px}.sm\:space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}}@media (min-width: 768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-80{width:20rem}.lg\:grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:px-8{padding-left:2rem;padding-right:2rem}} diff --git a/main/manager-web/public/generator/assets/index-E7j_fXTF.js b/main/manager-web/public/generator/assets/index-C_B_50-2.js similarity index 76% rename from main/manager-web/public/generator/assets/index-E7j_fXTF.js rename to main/manager-web/public/generator/assets/index-C_B_50-2.js index d32d303c0..bc81b840e 100644 --- a/main/manager-web/public/generator/assets/index-E7j_fXTF.js +++ b/main/manager-web/public/generator/assets/index-C_B_50-2.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomePage-BQbVVCiA.js","assets/HomePage-2JWdk2sE.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./HomePage-C46hPw_t.js","./HomePage-DL-rX2r7.css"])))=>i.map(i=>d[i]); (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();/** * @vue/shared v3.5.31 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -7,11 +7,11 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomePage-BQbVVC * @vue/reactivity v3.5.31 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let et;class dl{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=et,!t&&et&&(this.index=(et.scopes||(et.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0&&(et=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n0)return;if(jn){let t=jn;for(jn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Hn;){let t=Hn;for(Hn=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function _l(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function vl(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),Js(r),yc(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function Es(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(bl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function bl(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Yn)||(e.globalVersion=Yn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Es(e))))return;e.flags|=2;const t=e.dep,n=ye,r=pt;ye=e,pt=!0;try{_l(e);const s=e.fn(e._value);(t.version===0||kt(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{ye=n,pt=r,vl(e),e.flags&=-3}}function Js(e,t=!1){const{dep:n,prevSub:r,nextSub:s}=e;if(r&&(r.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Js(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function yc(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let pt=!0;const yl=[];function Ht(){yl.push(pt),pt=!1}function jt(){const e=yl.pop();pt=e===void 0?!0:e}function Ti(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ye;ye=void 0;try{t()}finally{ye=n}}}let Yn=0;class Ec{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Qs{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ye||!pt||ye===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ye)n=this.activeLink=new Ec(ye,this),ye.deps?(n.prevDep=ye.depsTail,ye.depsTail.nextDep=n,ye.depsTail=n):ye.deps=ye.depsTail=n,El(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=ye.depsTail,n.nextDep=void 0,ye.depsTail.nextDep=n,ye.depsTail=n,ye.deps===n&&(ye.deps=r)}return n}trigger(t){this.version++,Yn++,this.notify(t)}notify(t){zs();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{qs()}}}function El(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)El(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Cs=new WeakMap,cn=Symbol(""),Ts=Symbol(""),Xn=Symbol("");function je(e,t,n){if(pt&&ye){let r=Cs.get(e);r||Cs.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new Qs),s.map=r,s.key=n),s.track()}}function Mt(e,t,n,r,s,i){const o=Cs.get(e);if(!o){Yn++;return}const l=a=>{a&&a.trigger()};if(zs(),t==="clear")o.forEach(l);else{const a=J(e),c=a&&Ys(n);if(a&&n==="length"){const u=Number(r);o.forEach((h,g)=>{(g==="length"||g===Xn||!xt(g)&&g>=u)&&l(h)})}else switch((n!==void 0||o.has(void 0))&&l(o.get(n)),c&&l(o.get(Xn)),t){case"add":a?c&&l(o.get("length")):(l(o.get(cn)),yn(e)&&l(o.get(Ts)));break;case"delete":a||(l(o.get(cn)),yn(e)&&l(o.get(Ts)));break;case"set":yn(e)&&l(o.get(cn));break}}qs()}function mn(e){const t=fe(e);return t===e?t:(je(t,"iterate",Xn),ft(e)?t:t.map(_t))}function Vr(e){return je(e=fe(e),"iterate",Xn),e}function Ct(e,t){return $t(e)?wn(un(e)?_t(t):t):_t(t)}const Cc={__proto__:null,[Symbol.iterator](){return as(this,Symbol.iterator,e=>Ct(this,e))},concat(...e){return mn(this).concat(...e.map(t=>J(t)?mn(t):t))},entries(){return as(this,"entries",e=>(e[1]=Ct(this,e[1]),e))},every(e,t){return Ot(this,"every",e,t,void 0,arguments)},filter(e,t){return Ot(this,"filter",e,t,n=>n.map(r=>Ct(this,r)),arguments)},find(e,t){return Ot(this,"find",e,t,n=>Ct(this,n),arguments)},findIndex(e,t){return Ot(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ot(this,"findLast",e,t,n=>Ct(this,n),arguments)},findLastIndex(e,t){return Ot(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ot(this,"forEach",e,t,void 0,arguments)},includes(...e){return cs(this,"includes",e)},indexOf(...e){return cs(this,"indexOf",e)},join(e){return mn(this).join(e)},lastIndexOf(...e){return cs(this,"lastIndexOf",e)},map(e,t){return Ot(this,"map",e,t,void 0,arguments)},pop(){return An(this,"pop")},push(...e){return An(this,"push",e)},reduce(e,...t){return ki(this,"reduce",e,t)},reduceRight(e,...t){return ki(this,"reduceRight",e,t)},shift(){return An(this,"shift")},some(e,t){return Ot(this,"some",e,t,void 0,arguments)},splice(...e){return An(this,"splice",e)},toReversed(){return mn(this).toReversed()},toSorted(e){return mn(this).toSorted(e)},toSpliced(...e){return mn(this).toSpliced(...e)},unshift(...e){return An(this,"unshift",e)},values(){return as(this,"values",e=>Ct(this,e))}};function as(e,t,n){const r=Vr(e),s=r[t]();return r!==e&&!ft(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const Tc=Array.prototype;function Ot(e,t,n,r,s,i){const o=Vr(e),l=o!==e&&!ft(e),a=o[t];if(a!==Tc[t]){const h=a.apply(e,i);return l?_t(h):h}let c=n;o!==e&&(l?c=function(h,g){return n.call(this,Ct(e,h),g,e)}:n.length>2&&(c=function(h,g){return n.call(this,h,g,e)}));const u=a.call(o,c,r);return l&&s?s(u):u}function ki(e,t,n,r){const s=Vr(e),i=s!==e&&!ft(e);let o=n,l=!1;s!==e&&(i?(l=r.length===0,o=function(c,u,h){return l&&(l=!1,c=Ct(e,c)),n.call(this,c,Ct(e,u),h,e)}):n.length>3&&(o=function(c,u,h){return n.call(this,c,u,h,e)}));const a=s[t](o,...r);return l?Ct(e,a):a}function cs(e,t,n){const r=fe(e);je(r,"iterate",Xn);const s=r[t](...n);return(s===-1||s===!1)&&ti(n[0])?(n[0]=fe(n[0]),r[t](...n)):s}function An(e,t,n=[]){Ht(),zs();const r=fe(e)[t].apply(e,n);return qs(),jt(),r}const kc=Gs("__proto__,__v_isRef,__isVue"),Cl=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(xt));function wc(e){xt(e)||(e=String(e));const t=fe(this);return je(t,"has",e),t.hasOwnProperty(e)}class Tl{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return i;if(n==="__v_raw")return r===(s?i?Dc:Nl:i?Sl:wl).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const o=J(t);if(!s){let a;if(o&&(a=Cc[n]))return a;if(n==="hasOwnProperty")return wc}const l=Reflect.get(t,n,Ue(t)?t:r);if((xt(n)?Cl.has(n):kc(n))||(s||je(t,"get",n),i))return l;if(Ue(l)){const a=o&&Ys(n)?l:l.value;return s&&ge(a)?ws(a):a}return ge(l)?s?ws(l):Br(l):l}}class kl extends Tl{constructor(t=!1){super(!1,t)}set(t,n,r,s){let i=t[n];const o=J(t)&&Ys(n);if(!this._isShallow){const c=$t(i);if(!ft(r)&&!$t(r)&&(i=fe(i),r=fe(r)),!o&&Ue(i)&&!Ue(r))return c||(i.value=r),!0}const l=o?Number(n)e,ur=e=>Reflect.getPrototypeOf(e);function Ic(e,t,n){return function(...r){const s=this.__v_raw,i=fe(s),o=yn(i),l=e==="entries"||e===Symbol.iterator&&o,a=e==="keys"&&o,c=s[e](...r),u=n?ks:t?wn:_t;return!t&&je(i,"iterate",a?Ts:cn),He(Object.create(c),{next(){const{value:h,done:g}=c.next();return g?{value:h,done:g}:{value:l?[u(h[0]),u(h[1])]:u(h),done:g}}})}}function fr(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Oc(e,t){const n={get(s){const i=this.__v_raw,o=fe(i),l=fe(s);e||(kt(s,l)&&je(o,"get",s),je(o,"get",l));const{has:a}=ur(o),c=t?ks:e?wn:_t;if(a.call(o,s))return c(i.get(s));if(a.call(o,l))return c(i.get(l));i!==o&&i.get(s)},get size(){const s=this.__v_raw;return!e&&je(fe(s),"iterate",cn),s.size},has(s){const i=this.__v_raw,o=fe(i),l=fe(s);return e||(kt(s,l)&&je(o,"has",s),je(o,"has",l)),s===l?i.has(s):i.has(s)||i.has(l)},forEach(s,i){const o=this,l=o.__v_raw,a=fe(l),c=t?ks:e?wn:_t;return!e&&je(a,"iterate",cn),l.forEach((u,h)=>s.call(i,c(u),c(h),o))}};return He(n,e?{add:fr("add"),set:fr("set"),delete:fr("delete"),clear:fr("clear")}:{add(s){const i=fe(this),o=ur(i),l=fe(s),a=!t&&!ft(s)&&!$t(s)?l:s;return o.has.call(i,a)||kt(s,a)&&o.has.call(i,s)||kt(l,a)&&o.has.call(i,l)||(i.add(a),Mt(i,"add",a,a)),this},set(s,i){!t&&!ft(i)&&!$t(i)&&(i=fe(i));const o=fe(this),{has:l,get:a}=ur(o);let c=l.call(o,s);c||(s=fe(s),c=l.call(o,s));const u=a.call(o,s);return o.set(s,i),c?kt(i,u)&&Mt(o,"set",s,i):Mt(o,"add",s,i),this},delete(s){const i=fe(this),{has:o,get:l}=ur(i);let a=o.call(i,s);a||(s=fe(s),a=o.call(i,s)),l&&l.call(i,s);const c=i.delete(s);return a&&Mt(i,"delete",s,void 0),c},clear(){const s=fe(this),i=s.size!==0,o=s.clear();return i&&Mt(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Ic(s,e,t)}),n}function Zs(e,t){const n=Oc(e,t);return(r,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(he(n,s)&&s in r?n:r,s,i)}const Lc={get:Zs(!1,!1)},Ac={get:Zs(!1,!0)},Rc={get:Zs(!0,!1)};const wl=new WeakMap,Sl=new WeakMap,Nl=new WeakMap,Dc=new WeakMap;function Fc(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Mc(e){return e.__v_skip||!Object.isExtensible(e)?0:Fc(lc(e))}function Br(e){return $t(e)?e:ei(e,!1,Nc,Lc,wl)}function Pl(e){return ei(e,!1,xc,Ac,Sl)}function ws(e){return ei(e,!0,Pc,Rc,Nl)}function ei(e,t,n,r,s){if(!ge(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=Mc(e);if(i===0)return e;const o=s.get(e);if(o)return o;const l=new Proxy(e,i===2?r:n);return s.set(e,l),l}function un(e){return $t(e)?un(e.__v_raw):!!(e&&e.__v_isReactive)}function $t(e){return!!(e&&e.__v_isReadonly)}function ft(e){return!!(e&&e.__v_isShallow)}function ti(e){return e?!!e.__v_raw:!1}function fe(e){const t=e&&e.__v_raw;return t?fe(t):e}function Uc(e){return!he(e,"__v_skip")&&Object.isExtensible(e)&&cl(e,"__v_skip",!0),e}const _t=e=>ge(e)?Br(e):e,wn=e=>ge(e)?ws(e):e;function Ue(e){return e?e.__v_isRef===!0:!1}function it(e){return xl(e,!1)}function ni(e){return xl(e,!0)}function xl(e,t){return Ue(e)?e:new Wc(e,t)}class Wc{constructor(t,n){this.dep=new Qs,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:fe(t),this._value=n?t:_t(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||ft(t)||$t(t);t=r?t:fe(t),kt(t,n)&&(this._rawValue=t,this._value=r?t:_t(t),this.dep.trigger())}}function Y(e){return Ue(e)?e.value:e}const Hc={get:(e,t,n)=>t==="__v_raw"?e:Y(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return Ue(s)&&!Ue(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Il(e){return un(e)?e:new Proxy(e,Hc)}class jc{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Qs(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Yn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ye!==this)return pl(this,!0),!0}get value(){const t=this.dep.track();return bl(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function $c(e,t,n=!1){let r,s;return ee(e)?r=e:(r=e.get,s=e.set),new jc(r,s,n)}const hr={},kr=new WeakMap;let on;function Vc(e,t=!1,n=on){if(n){let r=kr.get(n);r||kr.set(n,r=[]),r.push(e)}}function Bc(e,t,n=ve){const{immediate:r,deep:s,once:i,scheduler:o,augmentJob:l,call:a}=n,c=y=>s?y:ft(y)||s===!1||s===0?Ut(y,1):Ut(y);let u,h,g,v,x=!1,k=!1;if(Ue(e)?(h=()=>e.value,x=ft(e)):un(e)?(h=()=>c(e),x=!0):J(e)?(k=!0,x=e.some(y=>un(y)||ft(y)),h=()=>e.map(y=>{if(Ue(y))return y.value;if(un(y))return c(y);if(ee(y))return a?a(y,2):y()})):ee(e)?t?h=a?()=>a(e,2):e:h=()=>{if(g){Ht();try{g()}finally{jt()}}const y=on;on=u;try{return a?a(e,3,[v]):e(v)}finally{on=y}}:h=St,t&&s){const y=h,L=s===!0?1/0:s;h=()=>Ut(y(),L)}const D=bc(),A=()=>{u.stop(),D&&D.active&&Ks(D.effects,u)};if(i&&t){const y=t;t=(...L)=>{y(...L),A()}}let R=k?new Array(e.length).fill(hr):hr;const b=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const L=u.run();if(s||x||(k?L.some((P,F)=>kt(P,R[F])):kt(L,R))){g&&g();const P=on;on=u;try{const F=[L,R===hr?void 0:k&&R[0]===hr?[]:R,v];R=L,a?a(t,3,F):t(...F)}finally{on=P}}}else u.run()};return l&&l(b),u=new ml(h),u.scheduler=o?()=>o(b,!1):b,v=y=>Vc(y,!1,u),g=u.onStop=()=>{const y=kr.get(u);if(y){if(a)a(y,4);else for(const L of y)L();kr.delete(u)}},t?r?b(!0):R=u.run():o?o(b.bind(null,!0),!0):u.run(),A.pause=u.pause.bind(u),A.resume=u.resume.bind(u),A.stop=A,A}function Ut(e,t=1/0,n){if(t<=0||!ge(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ue(e))Ut(e.value,t,n);else if(J(e))for(let r=0;r{Ut(r,t,n)});else if(al(e)){for(const r in e)Ut(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Ut(e[r],t,n)}return e}/** +**/let et;class dl{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=et,!t&&et&&(this.index=(et.scopes||(et.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0&&(et=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n0)return;if(jn){let t=jn;for(jn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Hn;){let t=Hn;for(Hn=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function _l(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function vl(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),Js(r),yc(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function Es(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(bl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function bl(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Yn)||(e.globalVersion=Yn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Es(e))))return;e.flags|=2;const t=e.dep,n=ye,r=pt;ye=e,pt=!0;try{_l(e);const s=e.fn(e._value);(t.version===0||kt(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{ye=n,pt=r,vl(e),e.flags&=-3}}function Js(e,t=!1){const{dep:n,prevSub:r,nextSub:s}=e;if(r&&(r.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Js(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function yc(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let pt=!0;const yl=[];function Ht(){yl.push(pt),pt=!1}function jt(){const e=yl.pop();pt=e===void 0?!0:e}function Ti(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ye;ye=void 0;try{t()}finally{ye=n}}}let Yn=0;class Ec{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Qs{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ye||!pt||ye===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ye)n=this.activeLink=new Ec(ye,this),ye.deps?(n.prevDep=ye.depsTail,ye.depsTail.nextDep=n,ye.depsTail=n):ye.deps=ye.depsTail=n,El(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=ye.depsTail,n.nextDep=void 0,ye.depsTail.nextDep=n,ye.depsTail=n,ye.deps===n&&(ye.deps=r)}return n}trigger(t){this.version++,Yn++,this.notify(t)}notify(t){zs();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{qs()}}}function El(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)El(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Cs=new WeakMap,cn=Symbol(""),Ts=Symbol(""),Xn=Symbol("");function je(e,t,n){if(pt&&ye){let r=Cs.get(e);r||Cs.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new Qs),s.map=r,s.key=n),s.track()}}function Mt(e,t,n,r,s,i){const o=Cs.get(e);if(!o){Yn++;return}const l=a=>{a&&a.trigger()};if(zs(),t==="clear")o.forEach(l);else{const a=J(e),c=a&&Ys(n);if(a&&n==="length"){const u=Number(r);o.forEach((d,g)=>{(g==="length"||g===Xn||!xt(g)&&g>=u)&&l(d)})}else switch((n!==void 0||o.has(void 0))&&l(o.get(n)),c&&l(o.get(Xn)),t){case"add":a?c&&l(o.get("length")):(l(o.get(cn)),yn(e)&&l(o.get(Ts)));break;case"delete":a||(l(o.get(cn)),yn(e)&&l(o.get(Ts)));break;case"set":yn(e)&&l(o.get(cn));break}}qs()}function mn(e){const t=fe(e);return t===e?t:(je(t,"iterate",Xn),ft(e)?t:t.map(_t))}function Vr(e){return je(e=fe(e),"iterate",Xn),e}function Ct(e,t){return $t(e)?wn(un(e)?_t(t):t):_t(t)}const Cc={__proto__:null,[Symbol.iterator](){return as(this,Symbol.iterator,e=>Ct(this,e))},concat(...e){return mn(this).concat(...e.map(t=>J(t)?mn(t):t))},entries(){return as(this,"entries",e=>(e[1]=Ct(this,e[1]),e))},every(e,t){return Ot(this,"every",e,t,void 0,arguments)},filter(e,t){return Ot(this,"filter",e,t,n=>n.map(r=>Ct(this,r)),arguments)},find(e,t){return Ot(this,"find",e,t,n=>Ct(this,n),arguments)},findIndex(e,t){return Ot(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ot(this,"findLast",e,t,n=>Ct(this,n),arguments)},findLastIndex(e,t){return Ot(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ot(this,"forEach",e,t,void 0,arguments)},includes(...e){return cs(this,"includes",e)},indexOf(...e){return cs(this,"indexOf",e)},join(e){return mn(this).join(e)},lastIndexOf(...e){return cs(this,"lastIndexOf",e)},map(e,t){return Ot(this,"map",e,t,void 0,arguments)},pop(){return An(this,"pop")},push(...e){return An(this,"push",e)},reduce(e,...t){return ki(this,"reduce",e,t)},reduceRight(e,...t){return ki(this,"reduceRight",e,t)},shift(){return An(this,"shift")},some(e,t){return Ot(this,"some",e,t,void 0,arguments)},splice(...e){return An(this,"splice",e)},toReversed(){return mn(this).toReversed()},toSorted(e){return mn(this).toSorted(e)},toSpliced(...e){return mn(this).toSpliced(...e)},unshift(...e){return An(this,"unshift",e)},values(){return as(this,"values",e=>Ct(this,e))}};function as(e,t,n){const r=Vr(e),s=r[t]();return r!==e&&!ft(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const Tc=Array.prototype;function Ot(e,t,n,r,s,i){const o=Vr(e),l=o!==e&&!ft(e),a=o[t];if(a!==Tc[t]){const d=a.apply(e,i);return l?_t(d):d}let c=n;o!==e&&(l?c=function(d,g){return n.call(this,Ct(e,d),g,e)}:n.length>2&&(c=function(d,g){return n.call(this,d,g,e)}));const u=a.call(o,c,r);return l&&s?s(u):u}function ki(e,t,n,r){const s=Vr(e),i=s!==e&&!ft(e);let o=n,l=!1;s!==e&&(i?(l=r.length===0,o=function(c,u,d){return l&&(l=!1,c=Ct(e,c)),n.call(this,c,Ct(e,u),d,e)}):n.length>3&&(o=function(c,u,d){return n.call(this,c,u,d,e)}));const a=s[t](o,...r);return l?Ct(e,a):a}function cs(e,t,n){const r=fe(e);je(r,"iterate",Xn);const s=r[t](...n);return(s===-1||s===!1)&&ti(n[0])?(n[0]=fe(n[0]),r[t](...n)):s}function An(e,t,n=[]){Ht(),zs();const r=fe(e)[t].apply(e,n);return qs(),jt(),r}const kc=Gs("__proto__,__v_isRef,__isVue"),Cl=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(xt));function wc(e){xt(e)||(e=String(e));const t=fe(this);return je(t,"has",e),t.hasOwnProperty(e)}class Tl{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return i;if(n==="__v_raw")return r===(s?i?Dc:Nl:i?Sl:wl).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const o=J(t);if(!s){let a;if(o&&(a=Cc[n]))return a;if(n==="hasOwnProperty")return wc}const l=Reflect.get(t,n,Ue(t)?t:r);if((xt(n)?Cl.has(n):kc(n))||(s||je(t,"get",n),i))return l;if(Ue(l)){const a=o&&Ys(n)?l:l.value;return s&&ge(a)?ws(a):a}return ge(l)?s?ws(l):Br(l):l}}class kl extends Tl{constructor(t=!1){super(!1,t)}set(t,n,r,s){let i=t[n];const o=J(t)&&Ys(n);if(!this._isShallow){const c=$t(i);if(!ft(r)&&!$t(r)&&(i=fe(i),r=fe(r)),!o&&Ue(i)&&!Ue(r))return c||(i.value=r),!0}const l=o?Number(n)e,ur=e=>Reflect.getPrototypeOf(e);function Ic(e,t,n){return function(...r){const s=this.__v_raw,i=fe(s),o=yn(i),l=e==="entries"||e===Symbol.iterator&&o,a=e==="keys"&&o,c=s[e](...r),u=n?ks:t?wn:_t;return!t&&je(i,"iterate",a?Ts:cn),He(Object.create(c),{next(){const{value:d,done:g}=c.next();return g?{value:d,done:g}:{value:l?[u(d[0]),u(d[1])]:u(d),done:g}}})}}function fr(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Oc(e,t){const n={get(s){const i=this.__v_raw,o=fe(i),l=fe(s);e||(kt(s,l)&&je(o,"get",s),je(o,"get",l));const{has:a}=ur(o),c=t?ks:e?wn:_t;if(a.call(o,s))return c(i.get(s));if(a.call(o,l))return c(i.get(l));i!==o&&i.get(s)},get size(){const s=this.__v_raw;return!e&&je(fe(s),"iterate",cn),s.size},has(s){const i=this.__v_raw,o=fe(i),l=fe(s);return e||(kt(s,l)&&je(o,"has",s),je(o,"has",l)),s===l?i.has(s):i.has(s)||i.has(l)},forEach(s,i){const o=this,l=o.__v_raw,a=fe(l),c=t?ks:e?wn:_t;return!e&&je(a,"iterate",cn),l.forEach((u,d)=>s.call(i,c(u),c(d),o))}};return He(n,e?{add:fr("add"),set:fr("set"),delete:fr("delete"),clear:fr("clear")}:{add(s){const i=fe(this),o=ur(i),l=fe(s),a=!t&&!ft(s)&&!$t(s)?l:s;return o.has.call(i,a)||kt(s,a)&&o.has.call(i,s)||kt(l,a)&&o.has.call(i,l)||(i.add(a),Mt(i,"add",a,a)),this},set(s,i){!t&&!ft(i)&&!$t(i)&&(i=fe(i));const o=fe(this),{has:l,get:a}=ur(o);let c=l.call(o,s);c||(s=fe(s),c=l.call(o,s));const u=a.call(o,s);return o.set(s,i),c?kt(i,u)&&Mt(o,"set",s,i):Mt(o,"add",s,i),this},delete(s){const i=fe(this),{has:o,get:l}=ur(i);let a=o.call(i,s);a||(s=fe(s),a=o.call(i,s)),l&&l.call(i,s);const c=i.delete(s);return a&&Mt(i,"delete",s,void 0),c},clear(){const s=fe(this),i=s.size!==0,o=s.clear();return i&&Mt(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Ic(s,e,t)}),n}function Zs(e,t){const n=Oc(e,t);return(r,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(he(n,s)&&s in r?n:r,s,i)}const Lc={get:Zs(!1,!1)},Ac={get:Zs(!1,!0)},Rc={get:Zs(!0,!1)};const wl=new WeakMap,Sl=new WeakMap,Nl=new WeakMap,Dc=new WeakMap;function Fc(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Mc(e){return e.__v_skip||!Object.isExtensible(e)?0:Fc(lc(e))}function Br(e){return $t(e)?e:ei(e,!1,Nc,Lc,wl)}function Pl(e){return ei(e,!1,xc,Ac,Sl)}function ws(e){return ei(e,!0,Pc,Rc,Nl)}function ei(e,t,n,r,s){if(!ge(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=Mc(e);if(i===0)return e;const o=s.get(e);if(o)return o;const l=new Proxy(e,i===2?r:n);return s.set(e,l),l}function un(e){return $t(e)?un(e.__v_raw):!!(e&&e.__v_isReactive)}function $t(e){return!!(e&&e.__v_isReadonly)}function ft(e){return!!(e&&e.__v_isShallow)}function ti(e){return e?!!e.__v_raw:!1}function fe(e){const t=e&&e.__v_raw;return t?fe(t):e}function Uc(e){return!he(e,"__v_skip")&&Object.isExtensible(e)&&cl(e,"__v_skip",!0),e}const _t=e=>ge(e)?Br(e):e,wn=e=>ge(e)?ws(e):e;function Ue(e){return e?e.__v_isRef===!0:!1}function it(e){return xl(e,!1)}function ni(e){return xl(e,!0)}function xl(e,t){return Ue(e)?e:new Wc(e,t)}class Wc{constructor(t,n){this.dep=new Qs,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:fe(t),this._value=n?t:_t(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||ft(t)||$t(t);t=r?t:fe(t),kt(t,n)&&(this._rawValue=t,this._value=r?t:_t(t),this.dep.trigger())}}function Y(e){return Ue(e)?e.value:e}const Hc={get:(e,t,n)=>t==="__v_raw"?e:Y(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return Ue(s)&&!Ue(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Il(e){return un(e)?e:new Proxy(e,Hc)}class jc{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Qs(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Yn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ye!==this)return pl(this,!0),!0}get value(){const t=this.dep.track();return bl(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function $c(e,t,n=!1){let r,s;return ee(e)?r=e:(r=e.get,s=e.set),new jc(r,s,n)}const hr={},kr=new WeakMap;let on;function Vc(e,t=!1,n=on){if(n){let r=kr.get(n);r||kr.set(n,r=[]),r.push(e)}}function Bc(e,t,n=ve){const{immediate:r,deep:s,once:i,scheduler:o,augmentJob:l,call:a}=n,c=y=>s?y:ft(y)||s===!1||s===0?Ut(y,1):Ut(y);let u,d,g,v,N=!1,k=!1;if(Ue(e)?(d=()=>e.value,N=ft(e)):un(e)?(d=()=>c(e),N=!0):J(e)?(k=!0,N=e.some(y=>un(y)||ft(y)),d=()=>e.map(y=>{if(Ue(y))return y.value;if(un(y))return c(y);if(ee(y))return a?a(y,2):y()})):ee(e)?t?d=a?()=>a(e,2):e:d=()=>{if(g){Ht();try{g()}finally{jt()}}const y=on;on=u;try{return a?a(e,3,[v]):e(v)}finally{on=y}}:d=St,t&&s){const y=d,L=s===!0?1/0:s;d=()=>Ut(y(),L)}const D=bc(),A=()=>{u.stop(),D&&D.active&&Ks(D.effects,u)};if(i&&t){const y=t;t=(...L)=>{y(...L),A()}}let R=k?new Array(e.length).fill(hr):hr;const b=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const L=u.run();if(s||N||(k?L.some((x,F)=>kt(x,R[F])):kt(L,R))){g&&g();const x=on;on=u;try{const F=[L,R===hr?void 0:k&&R[0]===hr?[]:R,v];R=L,a?a(t,3,F):t(...F)}finally{on=x}}}else u.run()};return l&&l(b),u=new ml(d),u.scheduler=o?()=>o(b,!1):b,v=y=>Vc(y,!1,u),g=u.onStop=()=>{const y=kr.get(u);if(y){if(a)a(y,4);else for(const L of y)L();kr.delete(u)}},t?r?b(!0):R=u.run():o?o(b.bind(null,!0),!0):u.run(),A.pause=u.pause.bind(u),A.resume=u.resume.bind(u),A.stop=A,A}function Ut(e,t=1/0,n){if(t<=0||!ge(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ue(e))Ut(e.value,t,n);else if(J(e))for(let r=0;r{Ut(r,t,n)});else if(al(e)){for(const r in e)Ut(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Ut(e[r],t,n)}return e}/** * @vue/runtime-core v3.5.31 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function sr(e,t,n,r){try{return r?e(...r):e()}catch(s){Gr(s,t,n)}}function It(e,t,n,r){if(ee(e)){const s=sr(e,t,n,r);return s&&ol(s)&&s.catch(i=>{Gr(i,t,n)}),s}if(J(e)){const s=[];for(let i=0;i>>1,s=ze[r],i=zn(s);i=zn(n)?ze.push(e):ze.splice(Kc(t),0,e),e.flags|=1,Ll()}}function Ll(){wr||(wr=Ol.then(Rl))}function Yc(e){J(e)?En.push(...e):Kt&&e.id===-1?Kt.splice(gn+1,0,e):e.flags&1||(En.push(e),e.flags|=1),Ll()}function wi(e,t,n=Et+1){for(;nzn(n)-zn(r));if(En.length=0,Kt){Kt.push(...t);return}for(Kt=t,gn=0;gne.id==null?e.flags&2?-1:1/0:e.id;function Rl(e){try{for(Et=0;Et{r._d&&xr(-1);const i=Sr(t);let o;try{o=e(...s)}finally{Sr(i),r._d&&xr(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function Fp(e,t){if(ot===null)return e;const n=qr(ot),r=e.dirs||(e.dirs=[]);for(let s=0;s1)return n&&ee(t)?t.call(r&&r.proxy):t}}const zc=Symbol.for("v-scx"),qc=()=>Nt(zc);function fn(e,t,n){return Fl(e,t,n)}function Fl(e,t,n=ve){const{immediate:r,deep:s,flush:i,once:o}=n,l=He({},n),a=t&&r||!t&&i!=="post";let c;if(Jn){if(i==="sync"){const v=qc();c=v.__watcherHandles||(v.__watcherHandles=[])}else if(!a){const v=()=>{};return v.stop=St,v.resume=St,v.pause=St,v}}const u=Ve;l.call=(v,x,k)=>It(v,u,x,k);let h=!1;i==="post"?l.scheduler=v=>{Ze(v,u&&u.suspense)}:i!=="sync"&&(h=!0,l.scheduler=(v,x)=>{x?v():si(v)}),l.augmentJob=v=>{t&&(v.flags|=4),h&&(v.flags|=2,u&&(v.id=u.uid,v.i=u))};const g=Bc(e,t,l);return Jn&&(c?c.push(g):a&&g()),g}function Jc(e,t,n){const r=this.proxy,s=Ie(e)?e.includes(".")?Ml(r,e):()=>r[e]:e.bind(r,r);let i;ee(t)?i=t:(i=t.handler,n=t);const o=ar(this),l=Fl(s,i.bind(r),n);return o(),l}function Ml(e,t){const n=t.split(".");return()=>{let r=e;for(let s=0;se.__isTeleport,eu=Symbol("_leaveCb");function ii(e,t){e.shapeFlag&6&&e.component?(e.transition=t,ii(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ir(e,t){return ee(e)?He({name:e.name},t,{setup:e}):e}function Ul(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Si(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Nr=new WeakMap;function $n(e,t,n,r,s=!1){if(J(e)){e.forEach((k,D)=>$n(k,t&&(J(t)?t[D]:t),n,r,s));return}if(Vn(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&$n(e,t,n,r.component.subTree);return}const i=r.shapeFlag&4?qr(r.component):r.el,o=s?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===ve?l.refs={}:l.refs,h=l.setupState,g=fe(h),v=h===ve?il:k=>Si(u,k)?!1:he(g,k),x=(k,D)=>!(D&&Si(u,D));if(c!=null&&c!==a){if(Ni(t),Ie(c))u[c]=null,v(c)&&(h[c]=null);else if(Ue(c)){const k=t;x(c,k.k)&&(c.value=null),k.k&&(u[k.k]=null)}}if(ee(a))sr(a,l,12,[o,u]);else{const k=Ie(a),D=Ue(a);if(k||D){const A=()=>{if(e.f){const R=k?v(a)?h[a]:u[a]:x()||!e.k?a.value:u[e.k];if(s)J(R)&&Ks(R,i);else if(J(R))R.includes(i)||R.push(i);else if(k)u[a]=[i],v(a)&&(h[a]=u[a]);else{const b=[i];x(a,e.k)&&(a.value=b),e.k&&(u[e.k]=b)}}else k?(u[a]=o,v(a)&&(h[a]=o)):D&&(x(a,e.k)&&(a.value=o),e.k&&(u[e.k]=o))};if(o){const R=()=>{A(),Nr.delete(e)};R.id=-1,Nr.set(e,R),Ze(R,n)}else Ni(e),A()}}}function Ni(e){const t=Nr.get(e);t&&(t.flags|=8,Nr.delete(e))}$r().requestIdleCallback;$r().cancelIdleCallback;const Vn=e=>!!e.type.__asyncLoader,Wl=e=>e.type.__isKeepAlive;function tu(e,t){Hl(e,"a",t)}function nu(e,t){Hl(e,"da",t)}function Hl(e,t,n=Ve){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(Kr(t,r,n),n){let s=n.parent;for(;s&&s.parent;)Wl(s.parent.vnode)&&ru(r,t,n,s),s=s.parent}}function ru(e,t,n,r){const s=Kr(t,e,r,!0);or(()=>{Ks(r[t],s)},n)}function Kr(e,t,n=Ve,r=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{Ht();const l=ar(n),a=It(t,n,e,o);return l(),jt(),a});return r?s.unshift(i):s.push(i),i}}const Vt=e=>(t,n=Ve)=>{(!Jn||e==="sp")&&Kr(e,(...r)=>t(...r),n)},jl=Vt("bm"),Yr=Vt("m"),su=Vt("bu"),iu=Vt("u"),ou=Vt("bum"),or=Vt("um"),lu=Vt("sp"),au=Vt("rtg"),cu=Vt("rtc");function uu(e,t=Ve){Kr("ec",e,t)}const $l="components";function fu(e,t){return Bl($l,e,!0,t)||e}const Vl=Symbol.for("v-ndc");function Mp(e){return Ie(e)?Bl($l,e,!1)||e:e||Vl}function Bl(e,t,n=!0,r=!1){const s=ot||Ve;if(s){const i=s.type;{const l=Ju(i,!1);if(l&&(l===t||l===qe(t)||l===Hr(qe(t))))return i}const o=Pi(s[e]||i[e],t)||Pi(s.appContext[e],t);return!o&&r?i:o}}function Pi(e,t){return e&&(e[t]||e[qe(t)]||e[Hr(qe(t))])}function hu(e,t,n,r){let s;const i=n,o=J(e);if(o||Ie(e)){const l=o&&un(e);let a=!1,c=!1;l&&(a=!ft(e),c=$t(e),e=Vr(e)),s=new Array(e.length);for(let u=0,h=e.length;ut(l,a,void 0,i));else{const l=Object.keys(e);s=new Array(l.length);for(let a=0,c=l.length;ae?ua(e)?qr(e):Ss(e.parent):null,Bn=He(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Ss(e.parent),$root:e=>Ss(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Kl(e),$forceUpdate:e=>e.f||(e.f=()=>{si(e.update)}),$nextTick:e=>e.n||(e.n=ri.bind(e.proxy)),$watch:e=>Jc.bind(e)}),us=(e,t)=>e!==ve&&!e.__isScriptSetup&&he(e,t),du={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,props:i,accessCache:o,type:l,appContext:a}=e;if(t[0]!=="$"){const g=o[t];if(g!==void 0)switch(g){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return i[t]}else{if(us(r,t))return o[t]=1,r[t];if(s!==ve&&he(s,t))return o[t]=2,s[t];if(he(i,t))return o[t]=3,i[t];if(n!==ve&&he(n,t))return o[t]=4,n[t];Ns&&(o[t]=0)}}const c=Bn[t];let u,h;if(c)return t==="$attrs"&&je(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==ve&&he(n,t))return o[t]=4,n[t];if(h=a.config.globalProperties,he(h,t))return h[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:i}=e;return us(s,t)?(s[t]=n,!0):r!==ve&&he(r,t)?(r[t]=n,!0):he(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:s,props:i,type:o}},l){let a;return!!(n[l]||e!==ve&&l[0]!=="$"&&he(e,l)||us(t,l)||he(i,l)||he(r,l)||he(Bn,l)||he(s.config.globalProperties,l)||(a=o.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:he(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function xi(e){return J(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Ns=!0;function mu(e){const t=Kl(e),n=e.proxy,r=e.ctx;Ns=!1,t.beforeCreate&&Ii(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:o,watch:l,provide:a,inject:c,created:u,beforeMount:h,mounted:g,beforeUpdate:v,updated:x,activated:k,deactivated:D,beforeDestroy:A,beforeUnmount:R,destroyed:b,unmounted:y,render:L,renderTracked:P,renderTriggered:F,errorCaptured:B,serverPrefetch:W,expose:ae,inheritAttrs:ke,components:Z,directives:_e,filters:ht}=t;if(c&&gu(c,r,null),o)for(const ie in o){const se=o[ie];ee(se)&&(r[ie]=se.bind(n))}if(s){const ie=s.call(n,n);ge(ie)&&(e.data=Br(ie))}if(Ns=!0,i)for(const ie in i){const se=i[ie],Be=ee(se)?se.bind(n,n):ee(se.get)?se.get.bind(n,n):St,Je=!ee(se)&&ee(se.set)?se.set.bind(n):St,we=ce({get:Be,set:Je});Object.defineProperty(r,ie,{enumerable:!0,configurable:!0,get:()=>we.value,set:Se=>we.value=Se})}if(l)for(const ie in l)Gl(l[ie],r,n,ie);if(a){const ie=ee(a)?a.call(n):a;Reflect.ownKeys(ie).forEach(se=>{_r(se,ie[se])})}u&&Ii(u,e,"c");function de(ie,se){J(se)?se.forEach(Be=>ie(Be.bind(n))):se&&ie(se.bind(n))}if(de(jl,h),de(Yr,g),de(su,v),de(iu,x),de(tu,k),de(nu,D),de(uu,B),de(cu,P),de(au,F),de(ou,R),de(or,y),de(lu,W),J(ae))if(ae.length){const ie=e.exposed||(e.exposed={});ae.forEach(se=>{Object.defineProperty(ie,se,{get:()=>n[se],set:Be=>n[se]=Be,enumerable:!0})})}else e.exposed||(e.exposed={});L&&e.render===St&&(e.render=L),ke!=null&&(e.inheritAttrs=ke),Z&&(e.components=Z),_e&&(e.directives=_e),W&&Ul(e)}function gu(e,t,n=St){J(e)&&(e=Ps(e));for(const r in e){const s=e[r];let i;ge(s)?"default"in s?i=Nt(s.from||r,s.default,!0):i=Nt(s.from||r):i=Nt(s),Ue(i)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):t[r]=i}}function Ii(e,t,n){It(J(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Gl(e,t,n,r){let s=r.includes(".")?Ml(n,r):()=>n[r];if(Ie(e)){const i=t[e];ee(i)&&fn(s,i)}else if(ee(e))fn(s,e.bind(n));else if(ge(e))if(J(e))e.forEach(i=>Gl(i,t,n,r));else{const i=ee(e.handler)?e.handler.bind(n):t[e.handler];ee(i)&&fn(s,i,e)}}function Kl(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:i,config:{optionMergeStrategies:o}}=e.appContext,l=i.get(t);let a;return l?a=l:!s.length&&!n&&!r?a=t:(a={},s.length&&s.forEach(c=>Pr(a,c,o,!0)),Pr(a,t,o)),ge(t)&&i.set(t,a),a}function Pr(e,t,n,r=!1){const{mixins:s,extends:i}=t;i&&Pr(e,i,n,!0),s&&s.forEach(o=>Pr(e,o,n,!0));for(const o in t)if(!(r&&o==="expose")){const l=pu[o]||n&&n[o];e[o]=l?l(e[o],t[o]):t[o]}return e}const pu={data:Oi,props:Li,emits:Li,methods:Mn,computed:Mn,beforeCreate:Ke,created:Ke,beforeMount:Ke,mounted:Ke,beforeUpdate:Ke,updated:Ke,beforeDestroy:Ke,beforeUnmount:Ke,destroyed:Ke,unmounted:Ke,activated:Ke,deactivated:Ke,errorCaptured:Ke,serverPrefetch:Ke,components:Mn,directives:Mn,watch:vu,provide:Oi,inject:_u};function Oi(e,t){return t?e?function(){return He(ee(e)?e.call(this,this):e,ee(t)?t.call(this,this):t)}:t:e}function _u(e,t){return Mn(Ps(e),Ps(t))}function Ps(e){if(J(e)){const t={};for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${qe(t)}Modifiers`]||e[`${dn(t)}Modifiers`];function Cu(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||ve;let s=n;const i=t.startsWith("update:"),o=i&&Eu(r,t.slice(7));o&&(o.trim&&(s=n.map(u=>Ie(u)?u.trim():u)),o.number&&(s=n.map(jr)));let l,a=r[l=is(t)]||r[l=is(qe(t))];!a&&i&&(a=r[l=is(dn(t))]),a&&It(a,e,6,s);const c=r[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,It(c,e,6,s)}}const Tu=new WeakMap;function Xl(e,t,n=!1){const r=n?Tu:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const i=e.emits;let o={},l=!1;if(!ee(e)){const a=c=>{const u=Xl(c,t,!0);u&&(l=!0,He(o,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(ge(e)&&r.set(e,null),null):(J(i)?i.forEach(a=>o[a]=null):He(o,i),ge(e)&&r.set(e,o),o)}function Xr(e,t){return!e||!Fr(t)?!1:(t=t.slice(2).replace(/Once$/,""),he(e,t[0].toLowerCase()+t.slice(1))||he(e,dn(t))||he(e,t))}function Ai(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[i],slots:o,attrs:l,emit:a,render:c,renderCache:u,props:h,data:g,setupState:v,ctx:x,inheritAttrs:k}=e,D=Sr(e);let A,R;try{if(n.shapeFlag&4){const y=s||r,L=y;A=Tt(c.call(L,y,u,h,v,g,x)),R=l}else{const y=t;A=Tt(y.length>1?y(h,{attrs:l,slots:o,emit:a}):y(h,null)),R=t.props?l:ku(l)}}catch(y){Gn.length=0,Gr(y,e,1),A=Ee(zt)}let b=A;if(R&&k!==!1){const y=Object.keys(R),{shapeFlag:L}=b;y.length&&L&7&&(i&&y.some(Mr)&&(R=wu(R,i)),b=Sn(b,R,!1,!0))}return n.dirs&&(b=Sn(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&ii(b,n.transition),A=b,Sr(D),A}const ku=e=>{let t;for(const n in e)(n==="class"||n==="style"||Fr(n))&&((t||(t={}))[n]=e[n]);return t},wu=(e,t)=>{const n={};for(const r in e)(!Mr(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Su(e,t,n){const{props:r,children:s,component:i}=e,{props:o,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return r?Ri(r,o,c):!!o;if(a&8){const u=t.dynamicProps;for(let h=0;hObject.create(ql),Ql=e=>Object.getPrototypeOf(e)===ql;function Pu(e,t,n,r=!1){const s={},i=Jl();e.propsDefaults=Object.create(null),Zl(e,t,s,i);for(const o in e.propsOptions[0])o in s||(s[o]=void 0);n?e.props=r?s:Pl(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function xu(e,t,n,r){const{props:s,attrs:i,vnode:{patchFlag:o}}=e,l=fe(s),[a]=e.propsOptions;let c=!1;if((r||o>0)&&!(o&16)){if(o&8){const u=e.vnode.dynamicProps;for(let h=0;h{a=!0;const[g,v]=ea(h,t,!0);He(o,g),v&&l.push(...v)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return ge(e)&&r.set(e,bn),bn;if(J(i))for(let u=0;ue==="_"||e==="_ctx"||e==="$stable",li=e=>J(e)?e.map(Tt):[Tt(e)],Ou=(e,t,n)=>{if(t._n)return t;const r=Xc((...s)=>li(t(...s)),n);return r._c=!1,r},ta=(e,t,n)=>{const r=e._ctx;for(const s in e){if(oi(s))continue;const i=e[s];if(ee(i))t[s]=Ou(s,i,r);else if(i!=null){const o=li(i);t[s]=()=>o}}},na=(e,t)=>{const n=li(t);e.slots.default=()=>n},ra=(e,t,n)=>{for(const r in t)(n||!oi(r))&&(e[r]=t[r])},Lu=(e,t,n)=>{const r=e.slots=Jl();if(e.vnode.shapeFlag&32){const s=t._;s?(ra(r,t,n),n&&cl(r,"_",s,!0)):ta(t,r)}else t&&na(e,t)},Au=(e,t,n)=>{const{vnode:r,slots:s}=e;let i=!0,o=ve;if(r.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:ra(s,t,n):(i=!t.$stable,ta(t,s)),o=t}else t&&(na(e,t),o={default:1});if(i)for(const l in s)!oi(l)&&o[l]==null&&delete s[l]},Ze=Uu;function Ru(e){return Du(e)}function Du(e,t){const n=$r();n.__VUE__=!0;const{insert:r,remove:s,patchProp:i,createElement:o,createText:l,createComment:a,setText:c,setElementText:u,parentNode:h,nextSibling:g,setScopeId:v=St,insertStaticContent:x}=e,k=(m,_,p,T=null,O=null,N=null,H=void 0,U=null,f=!!_.dynamicChildren)=>{if(m===_)return;m&&!Rn(m,_)&&(T=I(m),Se(m,O,N,!0),m=null),_.patchFlag===-2&&(f=!1,_.dynamicChildren=null);const{type:d,ref:C,shapeFlag:w}=_;switch(d){case lr:D(m,_,p,T);break;case zt:A(m,_,p,T);break;case vr:m==null&&R(_,p,T,H);break;case st:Z(m,_,p,T,O,N,H,U,f);break;default:w&1?L(m,_,p,T,O,N,H,U,f):w&6?_e(m,_,p,T,O,N,H,U,f):(w&64||w&128)&&d.process(m,_,p,T,O,N,H,U,f,K)}C!=null&&O?$n(C,m&&m.ref,N,_||m,!_):C==null&&m&&m.ref!=null&&$n(m.ref,null,N,m,!0)},D=(m,_,p,T)=>{if(m==null)r(_.el=l(_.children),p,T);else{const O=_.el=m.el;_.children!==m.children&&c(O,_.children)}},A=(m,_,p,T)=>{m==null?r(_.el=a(_.children||""),p,T):_.el=m.el},R=(m,_,p,T)=>{[m.el,m.anchor]=x(m.children,_,p,T,m.el,m.anchor)},b=({el:m,anchor:_},p,T)=>{let O;for(;m&&m!==_;)O=g(m),r(m,p,T),m=O;r(_,p,T)},y=({el:m,anchor:_})=>{let p;for(;m&&m!==_;)p=g(m),s(m),m=p;s(_)},L=(m,_,p,T,O,N,H,U,f)=>{if(_.type==="svg"?H="svg":_.type==="math"&&(H="mathml"),m==null)P(_,p,T,O,N,H,U,f);else{const d=m.el&&m.el._isVueCE?m.el:null;try{d&&d._beginPatch(),W(m,_,O,N,H,U,f)}finally{d&&d._endPatch()}}},P=(m,_,p,T,O,N,H,U)=>{let f,d;const{props:C,shapeFlag:w,transition:j,dirs:M}=m;if(f=m.el=o(m.type,N,C&&C.is,C),w&8?u(f,m.children):w&16&&B(m.children,f,null,T,O,fs(m,N),H,U),M&&tn(m,null,T,"created"),F(f,m,m.scopeId,H,T),C){for(const S in C)S!=="value"&&!Wn(S)&&i(f,S,null,C[S],N,T);"value"in C&&i(f,"value",null,C.value,N),(d=C.onVnodeBeforeMount)&&yt(d,T,m)}M&&tn(m,null,T,"beforeMount");const E=Fu(O,j);E&&j.beforeEnter(f),r(f,_,p),((d=C&&C.onVnodeMounted)||E||M)&&Ze(()=>{try{d&&yt(d,T,m),E&&j.enter(f),M&&tn(m,null,T,"mounted")}finally{}},O)},F=(m,_,p,T,O)=>{if(p&&v(m,p),T)for(let N=0;N{for(let d=f;d{const U=_.el=m.el;let{patchFlag:f,dynamicChildren:d,dirs:C}=_;f|=m.patchFlag&16;const w=m.props||ve,j=_.props||ve;let M;if(p&&nn(p,!1),(M=j.onVnodeBeforeUpdate)&&yt(M,p,_,m),C&&tn(_,m,p,"beforeUpdate"),p&&nn(p,!0),(w.innerHTML&&j.innerHTML==null||w.textContent&&j.textContent==null)&&u(U,""),d?ae(m.dynamicChildren,d,U,p,T,fs(_,O),N):H||se(m,_,U,null,p,T,fs(_,O),N,!1),f>0){if(f&16)ke(U,w,j,p,O);else if(f&2&&w.class!==j.class&&i(U,"class",null,j.class,O),f&4&&i(U,"style",w.style,j.style,O),f&8){const E=_.dynamicProps;for(let S=0;S{M&&yt(M,p,_,m),C&&tn(_,m,p,"updated")},T)},ae=(m,_,p,T,O,N,H)=>{for(let U=0;U<_.length;U++){const f=m[U],d=_[U],C=f.el&&(f.type===st||!Rn(f,d)||f.shapeFlag&198)?h(f.el):p;k(f,d,C,null,T,O,N,H,!0)}},ke=(m,_,p,T,O)=>{if(_!==p){if(_!==ve)for(const N in _)!Wn(N)&&!(N in p)&&i(m,N,_[N],null,O,T);for(const N in p){if(Wn(N))continue;const H=p[N],U=_[N];H!==U&&N!=="value"&&i(m,N,U,H,O,T)}"value"in p&&i(m,"value",_.value,p.value,O)}},Z=(m,_,p,T,O,N,H,U,f)=>{const d=_.el=m?m.el:l(""),C=_.anchor=m?m.anchor:l("");let{patchFlag:w,dynamicChildren:j,slotScopeIds:M}=_;M&&(U=U?U.concat(M):M),m==null?(r(d,p,T),r(C,p,T),B(_.children||[],p,C,O,N,H,U,f)):w>0&&w&64&&j&&m.dynamicChildren&&m.dynamicChildren.length===j.length?(ae(m.dynamicChildren,j,p,O,N,H,U),(_.key!=null||O&&_===O.subTree)&&sa(m,_,!0)):se(m,_,p,C,O,N,H,U,f)},_e=(m,_,p,T,O,N,H,U,f)=>{_.slotScopeIds=U,m==null?_.shapeFlag&512?O.ctx.activate(_,p,T,H,f):ht(_,p,T,O,N,H,f):at(m,_,f)},ht=(m,_,p,T,O,N,H)=>{const U=m.component=Ku(m,T,O);if(Wl(m)&&(U.ctx.renderer=K),Yu(U,!1,H),U.asyncDep){if(O&&O.registerDep(U,de,H),!m.el){const f=U.subTree=Ee(zt);A(null,f,_,p),m.placeholder=f.el}}else de(U,m,_,p,O,N,H)},at=(m,_,p)=>{const T=_.component=m.component;if(Su(m,_,p))if(T.asyncDep&&!T.asyncResolved){ie(T,_,p);return}else T.next=_,T.update();else _.el=m.el,T.vnode=_},de=(m,_,p,T,O,N,H)=>{const U=()=>{if(m.isMounted){let{next:w,bu:j,u:M,parent:E,vnode:S}=m;{const Me=ia(m);if(Me){w&&(w.el=S.el,ie(m,w,H)),Me.asyncDep.then(()=>{Ze(()=>{m.isUnmounted||d()},O)});return}}let X=w,te;nn(m,!1),w?(w.el=S.el,ie(m,w,H)):w=S,j&&pr(j),(te=w.props&&w.props.onVnodeBeforeUpdate)&&yt(te,E,w,S),nn(m,!0);const be=Ai(m),Ge=m.subTree;m.subTree=be,k(Ge,be,h(Ge.el),I(Ge),m,O,N),w.el=be.el,X===null&&Nu(m,be.el),M&&Ze(M,O),(te=w.props&&w.props.onVnodeUpdated)&&Ze(()=>yt(te,E,w,S),O)}else{let w;const{el:j,props:M}=_,{bm:E,m:S,parent:X,root:te,type:be}=m,Ge=Vn(_);nn(m,!1),E&&pr(E),!Ge&&(w=M&&M.onVnodeBeforeMount)&&yt(w,X,_),nn(m,!0);{te.ce&&te.ce._hasShadowRoot()&&te.ce._injectChildStyle(be,m.parent?m.parent.type:void 0);const Me=m.subTree=Ai(m);k(null,Me,p,T,m,O,N),_.el=Me.el}if(S&&Ze(S,O),!Ge&&(w=M&&M.onVnodeMounted)){const Me=_;Ze(()=>yt(w,X,Me),O)}(_.shapeFlag&256||X&&Vn(X.vnode)&&X.vnode.shapeFlag&256)&&m.a&&Ze(m.a,O),m.isMounted=!0,_=p=T=null}};m.scope.on();const f=m.effect=new ml(U);m.scope.off();const d=m.update=f.run.bind(f),C=m.job=f.runIfDirty.bind(f);C.i=m,C.id=m.uid,f.scheduler=()=>si(C),nn(m,!0),d()},ie=(m,_,p)=>{_.component=m;const T=m.vnode.props;m.vnode=_,m.next=null,xu(m,_.props,T,p),Au(m,_.children,p),Ht(),wi(m),jt()},se=(m,_,p,T,O,N,H,U,f=!1)=>{const d=m&&m.children,C=m?m.shapeFlag:0,w=_.children,{patchFlag:j,shapeFlag:M}=_;if(j>0){if(j&128){Je(d,w,p,T,O,N,H,U,f);return}else if(j&256){Be(d,w,p,T,O,N,H,U,f);return}}M&8?(C&16&&Re(d,O,N),w!==d&&u(p,w)):C&16?M&16?Je(d,w,p,T,O,N,H,U,f):Re(d,O,N,!0):(C&8&&u(p,""),M&16&&B(w,p,T,O,N,H,U,f))},Be=(m,_,p,T,O,N,H,U,f)=>{m=m||bn,_=_||bn;const d=m.length,C=_.length,w=Math.min(d,C);let j;for(j=0;jC?Re(m,O,N,!0,!1,w):B(_,p,T,O,N,H,U,f,w)},Je=(m,_,p,T,O,N,H,U,f)=>{let d=0;const C=_.length;let w=m.length-1,j=C-1;for(;d<=w&&d<=j;){const M=m[d],E=_[d]=f?Ft(_[d]):Tt(_[d]);if(Rn(M,E))k(M,E,p,null,O,N,H,U,f);else break;d++}for(;d<=w&&d<=j;){const M=m[w],E=_[j]=f?Ft(_[j]):Tt(_[j]);if(Rn(M,E))k(M,E,p,null,O,N,H,U,f);else break;w--,j--}if(d>w){if(d<=j){const M=j+1,E=Mj)for(;d<=w;)Se(m[d],O,N,!0),d++;else{const M=d,E=d,S=new Map;for(d=E;d<=j;d++){const rt=_[d]=f?Ft(_[d]):Tt(_[d]);rt.key!=null&&S.set(rt.key,d)}let X,te=0;const be=j-E+1;let Ge=!1,Me=0;const en=new Array(be);for(d=0;d=be){Se(rt,O,N,!0);continue}let bt;if(rt.key!=null)bt=S.get(rt.key);else for(X=E;X<=j;X++)if(en[X-E]===0&&Rn(rt,_[X])){bt=X;break}bt===void 0?Se(rt,O,N,!0):(en[bt-E]=d+1,bt>=Me?Me=bt:Ge=!0,k(rt,_[bt],p,null,O,N,H,U,f),te++)}const ss=Ge?Mu(en):bn;for(X=ss.length-1,d=be-1;d>=0;d--){const rt=E+d,bt=_[rt],bi=_[rt+1],yi=rt+1{const{el:N,type:H,transition:U,children:f,shapeFlag:d}=m;if(d&6){we(m.component.subTree,_,p,T);return}if(d&128){m.suspense.move(_,p,T);return}if(d&64){H.move(m,_,p,K);return}if(H===st){r(N,_,p);for(let w=0;wU.enter(N),O);else{const{leave:w,delayLeave:j,afterLeave:M}=U,E=()=>{m.ctx.isUnmounted?s(N):r(N,_,p)},S=()=>{N._isLeaving&&N[eu](!0),w(N,()=>{E(),M&&M()})};j?j(N,E,S):S()}else r(N,_,p)},Se=(m,_,p,T=!1,O=!1)=>{const{type:N,props:H,ref:U,children:f,dynamicChildren:d,shapeFlag:C,patchFlag:w,dirs:j,cacheIndex:M,memo:E}=m;if(w===-2&&(O=!1),U!=null&&(Ht(),$n(U,null,p,m,!0),jt()),M!=null&&(_.renderCache[M]=void 0),C&256){_.ctx.deactivate(m);return}const S=C&1&&j,X=!Vn(m);let te;if(X&&(te=H&&H.onVnodeBeforeUnmount)&&yt(te,_,m),C&6)nt(m.component,p,T);else{if(C&128){m.suspense.unmount(p,T);return}S&&tn(m,null,_,"beforeUnmount"),C&64?m.type.remove(m,_,p,K,T):d&&!d.hasOnce&&(N!==st||w>0&&w&64)?Re(d,_,p,!1,!0):(N===st&&w&384||!O&&C&16)&&Re(f,_,p),T&&ct(m)}const be=E!=null&&M==null;(X&&(te=H&&H.onVnodeUnmounted)||S||be)&&Ze(()=>{te&&yt(te,_,m),S&&tn(m,null,_,"unmounted"),be&&(m.el=null)},p)},ct=m=>{const{type:_,el:p,anchor:T,transition:O}=m;if(_===st){tt(p,T);return}if(_===vr){y(m);return}const N=()=>{s(p),O&&!O.persisted&&O.afterLeave&&O.afterLeave()};if(m.shapeFlag&1&&O&&!O.persisted){const{leave:H,delayLeave:U}=O,f=()=>H(p,N);U?U(m.el,N,f):f()}else N()},tt=(m,_)=>{let p;for(;m!==_;)p=g(m),s(m),m=p;s(_)},nt=(m,_,p)=>{const{bum:T,scope:O,job:N,subTree:H,um:U,m:f,a:d}=m;Fi(f),Fi(d),T&&pr(T),O.stop(),N&&(N.flags|=8,Se(H,m,_,p)),U&&Ze(U,_),Ze(()=>{m.isUnmounted=!0},_)},Re=(m,_,p,T=!1,O=!1,N=0)=>{for(let H=N;H{if(m.shapeFlag&6)return I(m.component.subTree);if(m.shapeFlag&128)return m.suspense.next();const _=g(m.anchor||m.el),p=_&&_[Qc];return p?g(p):_};let G=!1;const $=(m,_,p)=>{let T;m==null?_._vnode&&(Se(_._vnode,null,null,!0),T=_._vnode.component):k(_._vnode||null,m,_,null,null,null,p),_._vnode=m,G||(G=!0,wi(T),Al(),G=!1)},K={p:k,um:Se,m:we,r:ct,mt:ht,mc:B,pc:se,pbc:ae,n:I,o:e};return{render:$,hydrate:void 0,createApp:yu($)}}function fs({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function nn({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Fu(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function sa(e,t,n=!1){const r=e.children,s=t.children;if(J(r)&&J(s))for(let i=0;i>1,e[n[l]]0&&(t[r]=n[i-1]),n[i]=r)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}function ia(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ia(t)}function Fi(e){if(e)for(let t=0;te.__isSuspense;function Uu(e,t){t&&t.pendingBranch?J(e)?t.effects.push(...e):t.effects.push(e):Yc(e)}const st=Symbol.for("v-fgt"),lr=Symbol.for("v-txt"),zt=Symbol.for("v-cmt"),vr=Symbol.for("v-stc"),Gn=[];let lt=null;function oe(e=!1){Gn.push(lt=e?null:[])}function Wu(){Gn.pop(),lt=Gn[Gn.length-1]||null}let qn=1;function xr(e,t=!1){qn+=e,e<0&<&&t&&(lt.hasOnce=!0)}function aa(e){return e.dynamicChildren=qn>0?lt||bn:null,Wu(),qn>0&<&<.push(e),e}function me(e,t,n,r,s,i){return aa(z(e,t,n,r,s,i,!0))}function Un(e,t,n,r,s){return aa(Ee(e,t,n,r,s,!0))}function Ir(e){return e?e.__v_isVNode===!0:!1}function Rn(e,t){return e.type===t.type&&e.key===t.key}const ca=({key:e})=>e??null,br=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ie(e)||Ue(e)||ee(e)?{i:ot,r:e,k:t,f:!!n}:e:null);function z(e,t=null,n=null,r=0,s=null,i=e===st?0:1,o=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ca(t),ref:t&&br(t),scopeId:Dl,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:ot};return l?(ai(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=Ie(n)?8:16),qn>0&&!o&<&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&<.push(a),a}const Ee=Hu;function Hu(e,t=null,n=null,r=0,s=null,i=!1){if((!e||e===Vl)&&(e=zt),Ir(e)){const l=Sn(e,t,!0);return n&&ai(l,n),qn>0&&!i&<&&(l.shapeFlag&6?lt[lt.indexOf(e)]=l:lt.push(l)),l.patchFlag=-2,l}if(Qu(e)&&(e=e.__vccOpts),t){t=ju(t);let{class:l,style:a}=t;l&&!Ie(l)&&(t.class=$e(l)),ge(a)&&(ti(a)&&!J(a)&&(a=He({},a)),t.style=Xs(a))}const o=Ie(e)?1:la(e)?128:Zc(e)?64:ge(e)?4:ee(e)?2:0;return z(e,t,n,r,s,o,i,!0)}function ju(e){return e?ti(e)||Ql(e)?He({},e):e:null}function Sn(e,t,n=!1,r=!1){const{props:s,ref:i,patchFlag:o,children:l,transition:a}=e,c=t?Vu(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&ca(c),ref:t&&t.ref?n&&i?J(i)?i.concat(br(t)):[i,br(t)]:br(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==st?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Sn(e.ssContent),ssFallback:e.ssFallback&&Sn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&r&&ii(u,a.clone(u)),u}function $u(e=" ",t=0){return Ee(lr,null,e,t)}function zr(e,t){const n=Ee(vr,null,e);return n.staticCount=t,n}function Le(e="",t=!1){return t?(oe(),Un(zt,null,e)):Ee(zt,null,e)}function Tt(e){return e==null||typeof e=="boolean"?Ee(zt):J(e)?Ee(st,null,e.slice()):Ir(e)?Ft(e):Ee(lr,null,String(e))}function Ft(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Sn(e)}function ai(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(J(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),ai(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!Ql(t)?t._ctx=ot:s===3&&ot&&(ot.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ee(t)?(t={default:t,_ctx:ot},n=32):(t=String(t),r&64?(n=16,t=[$u(t)]):n=8);e.children=t,e.shapeFlag|=n}function Vu(...e){const t={};for(let n=0;nVe||ot;let Or,Is;{const e=$r(),t=(n,r)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(r),i=>{s.length>1?s.forEach(o=>o(i)):s[0](i)}};Or=t("__VUE_INSTANCE_SETTERS__",n=>Ve=n),Is=t("__VUE_SSR_SETTERS__",n=>Jn=n)}const ar=e=>{const t=Ve;return Or(e),e.scope.on(),()=>{e.scope.off(),Or(t)}},Mi=()=>{Ve&&Ve.scope.off(),Or(null)};function ua(e){return e.vnode.shapeFlag&4}let Jn=!1;function Yu(e,t=!1,n=!1){t&&Is(t);const{props:r,children:s}=e.vnode,i=ua(e);Pu(e,r,i,t),Lu(e,s,n||t);const o=i?Xu(e,t):void 0;return t&&Is(!1),o}function Xu(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,du);const{setup:r}=n;if(r){Ht();const s=e.setupContext=r.length>1?qu(e):null,i=ar(e),o=sr(r,e,0,[e.props,s]),l=ol(o);if(jt(),i(),(l||e.sp)&&!Vn(e)&&Ul(e),l){if(o.then(Mi,Mi),t)return o.then(a=>{Ui(e,a)}).catch(a=>{Gr(a,e,0)});e.asyncDep=o}else Ui(e,o)}else fa(e)}function Ui(e,t,n){ee(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ge(t)&&(e.setupState=Il(t)),fa(e)}function fa(e,t,n){const r=e.type;e.render||(e.render=r.render||St);{const s=ar(e);Ht();try{mu(e)}finally{jt(),s()}}}const zu={get(e,t){return je(e,"get",""),e[t]}};function qu(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,zu),slots:e.slots,emit:e.emit,expose:t}}function qr(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Il(Uc(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Bn)return Bn[n](e)},has(t,n){return n in t||n in Bn}})):e.proxy}function Ju(e,t=!0){return ee(e)?e.displayName||e.name:e.name||t&&e.__name}function Qu(e){return ee(e)&&"__vccOpts"in e}const ce=(e,t)=>$c(e,t,Jn);function Jr(e,t,n){try{xr(-1);const r=arguments.length;return r===2?ge(t)&&!J(t)?Ir(t)?Ee(e,null,[t]):Ee(e,t):Ee(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ir(n)&&(n=[n]),Ee(e,t,n))}finally{xr(1)}}const Zu="3.5.31";/** +**/function sr(e,t,n,r){try{return r?e(...r):e()}catch(s){Gr(s,t,n)}}function It(e,t,n,r){if(ee(e)){const s=sr(e,t,n,r);return s&&ol(s)&&s.catch(i=>{Gr(i,t,n)}),s}if(J(e)){const s=[];for(let i=0;i>>1,s=ze[r],i=zn(s);i=zn(n)?ze.push(e):ze.splice(Kc(t),0,e),e.flags|=1,Ll()}}function Ll(){wr||(wr=Ol.then(Rl))}function Yc(e){J(e)?En.push(...e):Kt&&e.id===-1?Kt.splice(gn+1,0,e):e.flags&1||(En.push(e),e.flags|=1),Ll()}function wi(e,t,n=Et+1){for(;nzn(n)-zn(r));if(En.length=0,Kt){Kt.push(...t);return}for(Kt=t,gn=0;gne.id==null?e.flags&2?-1:1/0:e.id;function Rl(e){try{for(Et=0;Et{r._d&&xr(-1);const i=Sr(t);let o;try{o=e(...s)}finally{Sr(i),r._d&&xr(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function Fp(e,t){if(ot===null)return e;const n=qr(ot),r=e.dirs||(e.dirs=[]);for(let s=0;s1)return n&&ee(t)?t.call(r&&r.proxy):t}}const zc=Symbol.for("v-scx"),qc=()=>Nt(zc);function fn(e,t,n){return Fl(e,t,n)}function Fl(e,t,n=ve){const{immediate:r,deep:s,flush:i,once:o}=n,l=He({},n),a=t&&r||!t&&i!=="post";let c;if(Jn){if(i==="sync"){const v=qc();c=v.__watcherHandles||(v.__watcherHandles=[])}else if(!a){const v=()=>{};return v.stop=St,v.resume=St,v.pause=St,v}}const u=Ve;l.call=(v,N,k)=>It(v,u,N,k);let d=!1;i==="post"?l.scheduler=v=>{Ze(v,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(v,N)=>{N?v():si(v)}),l.augmentJob=v=>{t&&(v.flags|=4),d&&(v.flags|=2,u&&(v.id=u.uid,v.i=u))};const g=Bc(e,t,l);return Jn&&(c?c.push(g):a&&g()),g}function Jc(e,t,n){const r=this.proxy,s=Ie(e)?e.includes(".")?Ml(r,e):()=>r[e]:e.bind(r,r);let i;ee(t)?i=t:(i=t.handler,n=t);const o=ar(this),l=Fl(s,i.bind(r),n);return o(),l}function Ml(e,t){const n=t.split(".");return()=>{let r=e;for(let s=0;se.__isTeleport,eu=Symbol("_leaveCb");function ii(e,t){e.shapeFlag&6&&e.component?(e.transition=t,ii(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ir(e,t){return ee(e)?He({name:e.name},t,{setup:e}):e}function Ul(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Si(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Nr=new WeakMap;function $n(e,t,n,r,s=!1){if(J(e)){e.forEach((k,D)=>$n(k,t&&(J(t)?t[D]:t),n,r,s));return}if(Vn(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&$n(e,t,n,r.component.subTree);return}const i=r.shapeFlag&4?qr(r.component):r.el,o=s?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===ve?l.refs={}:l.refs,d=l.setupState,g=fe(d),v=d===ve?il:k=>Si(u,k)?!1:he(g,k),N=(k,D)=>!(D&&Si(u,D));if(c!=null&&c!==a){if(Ni(t),Ie(c))u[c]=null,v(c)&&(d[c]=null);else if(Ue(c)){const k=t;N(c,k.k)&&(c.value=null),k.k&&(u[k.k]=null)}}if(ee(a))sr(a,l,12,[o,u]);else{const k=Ie(a),D=Ue(a);if(k||D){const A=()=>{if(e.f){const R=k?v(a)?d[a]:u[a]:N()||!e.k?a.value:u[e.k];if(s)J(R)&&Ks(R,i);else if(J(R))R.includes(i)||R.push(i);else if(k)u[a]=[i],v(a)&&(d[a]=u[a]);else{const b=[i];N(a,e.k)&&(a.value=b),e.k&&(u[e.k]=b)}}else k?(u[a]=o,v(a)&&(d[a]=o)):D&&(N(a,e.k)&&(a.value=o),e.k&&(u[e.k]=o))};if(o){const R=()=>{A(),Nr.delete(e)};R.id=-1,Nr.set(e,R),Ze(R,n)}else Ni(e),A()}}}function Ni(e){const t=Nr.get(e);t&&(t.flags|=8,Nr.delete(e))}$r().requestIdleCallback;$r().cancelIdleCallback;const Vn=e=>!!e.type.__asyncLoader,Wl=e=>e.type.__isKeepAlive;function tu(e,t){Hl(e,"a",t)}function nu(e,t){Hl(e,"da",t)}function Hl(e,t,n=Ve){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(Kr(t,r,n),n){let s=n.parent;for(;s&&s.parent;)Wl(s.parent.vnode)&&ru(r,t,n,s),s=s.parent}}function ru(e,t,n,r){const s=Kr(t,e,r,!0);or(()=>{Ks(r[t],s)},n)}function Kr(e,t,n=Ve,r=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{Ht();const l=ar(n),a=It(t,n,e,o);return l(),jt(),a});return r?s.unshift(i):s.push(i),i}}const Vt=e=>(t,n=Ve)=>{(!Jn||e==="sp")&&Kr(e,(...r)=>t(...r),n)},jl=Vt("bm"),Yr=Vt("m"),su=Vt("bu"),iu=Vt("u"),ou=Vt("bum"),or=Vt("um"),lu=Vt("sp"),au=Vt("rtg"),cu=Vt("rtc");function uu(e,t=Ve){Kr("ec",e,t)}const $l="components";function fu(e,t){return Bl($l,e,!0,t)||e}const Vl=Symbol.for("v-ndc");function Mp(e){return Ie(e)?Bl($l,e,!1)||e:e||Vl}function Bl(e,t,n=!0,r=!1){const s=ot||Ve;if(s){const i=s.type;{const l=Ju(i,!1);if(l&&(l===t||l===qe(t)||l===Hr(qe(t))))return i}const o=Pi(s[e]||i[e],t)||Pi(s.appContext[e],t);return!o&&r?i:o}}function Pi(e,t){return e&&(e[t]||e[qe(t)]||e[Hr(qe(t))])}function hu(e,t,n,r){let s;const i=n,o=J(e);if(o||Ie(e)){const l=o&&un(e);let a=!1,c=!1;l&&(a=!ft(e),c=$t(e),e=Vr(e)),s=new Array(e.length);for(let u=0,d=e.length;ut(l,a,void 0,i));else{const l=Object.keys(e);s=new Array(l.length);for(let a=0,c=l.length;ae?ua(e)?qr(e):Ss(e.parent):null,Bn=He(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Ss(e.parent),$root:e=>Ss(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Kl(e),$forceUpdate:e=>e.f||(e.f=()=>{si(e.update)}),$nextTick:e=>e.n||(e.n=ri.bind(e.proxy)),$watch:e=>Jc.bind(e)}),us=(e,t)=>e!==ve&&!e.__isScriptSetup&&he(e,t),du={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,props:i,accessCache:o,type:l,appContext:a}=e;if(t[0]!=="$"){const g=o[t];if(g!==void 0)switch(g){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return i[t]}else{if(us(r,t))return o[t]=1,r[t];if(s!==ve&&he(s,t))return o[t]=2,s[t];if(he(i,t))return o[t]=3,i[t];if(n!==ve&&he(n,t))return o[t]=4,n[t];Ns&&(o[t]=0)}}const c=Bn[t];let u,d;if(c)return t==="$attrs"&&je(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==ve&&he(n,t))return o[t]=4,n[t];if(d=a.config.globalProperties,he(d,t))return d[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:i}=e;return us(s,t)?(s[t]=n,!0):r!==ve&&he(r,t)?(r[t]=n,!0):he(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:s,props:i,type:o}},l){let a;return!!(n[l]||e!==ve&&l[0]!=="$"&&he(e,l)||us(t,l)||he(i,l)||he(r,l)||he(Bn,l)||he(s.config.globalProperties,l)||(a=o.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:he(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function xi(e){return J(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Ns=!0;function mu(e){const t=Kl(e),n=e.proxy,r=e.ctx;Ns=!1,t.beforeCreate&&Ii(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:o,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:g,beforeUpdate:v,updated:N,activated:k,deactivated:D,beforeDestroy:A,beforeUnmount:R,destroyed:b,unmounted:y,render:L,renderTracked:x,renderTriggered:F,errorCaptured:B,serverPrefetch:W,expose:ae,inheritAttrs:ke,components:Z,directives:_e,filters:ht}=t;if(c&&gu(c,r,null),o)for(const ie in o){const se=o[ie];ee(se)&&(r[ie]=se.bind(n))}if(s){const ie=s.call(n,n);ge(ie)&&(e.data=Br(ie))}if(Ns=!0,i)for(const ie in i){const se=i[ie],Be=ee(se)?se.bind(n,n):ee(se.get)?se.get.bind(n,n):St,Je=!ee(se)&&ee(se.set)?se.set.bind(n):St,we=ce({get:Be,set:Je});Object.defineProperty(r,ie,{enumerable:!0,configurable:!0,get:()=>we.value,set:Se=>we.value=Se})}if(l)for(const ie in l)Gl(l[ie],r,n,ie);if(a){const ie=ee(a)?a.call(n):a;Reflect.ownKeys(ie).forEach(se=>{_r(se,ie[se])})}u&&Ii(u,e,"c");function de(ie,se){J(se)?se.forEach(Be=>ie(Be.bind(n))):se&&ie(se.bind(n))}if(de(jl,d),de(Yr,g),de(su,v),de(iu,N),de(tu,k),de(nu,D),de(uu,B),de(cu,x),de(au,F),de(ou,R),de(or,y),de(lu,W),J(ae))if(ae.length){const ie=e.exposed||(e.exposed={});ae.forEach(se=>{Object.defineProperty(ie,se,{get:()=>n[se],set:Be=>n[se]=Be,enumerable:!0})})}else e.exposed||(e.exposed={});L&&e.render===St&&(e.render=L),ke!=null&&(e.inheritAttrs=ke),Z&&(e.components=Z),_e&&(e.directives=_e),W&&Ul(e)}function gu(e,t,n=St){J(e)&&(e=Ps(e));for(const r in e){const s=e[r];let i;ge(s)?"default"in s?i=Nt(s.from||r,s.default,!0):i=Nt(s.from||r):i=Nt(s),Ue(i)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):t[r]=i}}function Ii(e,t,n){It(J(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Gl(e,t,n,r){let s=r.includes(".")?Ml(n,r):()=>n[r];if(Ie(e)){const i=t[e];ee(i)&&fn(s,i)}else if(ee(e))fn(s,e.bind(n));else if(ge(e))if(J(e))e.forEach(i=>Gl(i,t,n,r));else{const i=ee(e.handler)?e.handler.bind(n):t[e.handler];ee(i)&&fn(s,i,e)}}function Kl(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:i,config:{optionMergeStrategies:o}}=e.appContext,l=i.get(t);let a;return l?a=l:!s.length&&!n&&!r?a=t:(a={},s.length&&s.forEach(c=>Pr(a,c,o,!0)),Pr(a,t,o)),ge(t)&&i.set(t,a),a}function Pr(e,t,n,r=!1){const{mixins:s,extends:i}=t;i&&Pr(e,i,n,!0),s&&s.forEach(o=>Pr(e,o,n,!0));for(const o in t)if(!(r&&o==="expose")){const l=pu[o]||n&&n[o];e[o]=l?l(e[o],t[o]):t[o]}return e}const pu={data:Oi,props:Li,emits:Li,methods:Mn,computed:Mn,beforeCreate:Ke,created:Ke,beforeMount:Ke,mounted:Ke,beforeUpdate:Ke,updated:Ke,beforeDestroy:Ke,beforeUnmount:Ke,destroyed:Ke,unmounted:Ke,activated:Ke,deactivated:Ke,errorCaptured:Ke,serverPrefetch:Ke,components:Mn,directives:Mn,watch:vu,provide:Oi,inject:_u};function Oi(e,t){return t?e?function(){return He(ee(e)?e.call(this,this):e,ee(t)?t.call(this,this):t)}:t:e}function _u(e,t){return Mn(Ps(e),Ps(t))}function Ps(e){if(J(e)){const t={};for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${qe(t)}Modifiers`]||e[`${dn(t)}Modifiers`];function Cu(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||ve;let s=n;const i=t.startsWith("update:"),o=i&&Eu(r,t.slice(7));o&&(o.trim&&(s=n.map(u=>Ie(u)?u.trim():u)),o.number&&(s=n.map(jr)));let l,a=r[l=is(t)]||r[l=is(qe(t))];!a&&i&&(a=r[l=is(dn(t))]),a&&It(a,e,6,s);const c=r[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,It(c,e,6,s)}}const Tu=new WeakMap;function Xl(e,t,n=!1){const r=n?Tu:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const i=e.emits;let o={},l=!1;if(!ee(e)){const a=c=>{const u=Xl(c,t,!0);u&&(l=!0,He(o,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(ge(e)&&r.set(e,null),null):(J(i)?i.forEach(a=>o[a]=null):He(o,i),ge(e)&&r.set(e,o),o)}function Xr(e,t){return!e||!Fr(t)?!1:(t=t.slice(2).replace(/Once$/,""),he(e,t[0].toLowerCase()+t.slice(1))||he(e,dn(t))||he(e,t))}function Ai(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[i],slots:o,attrs:l,emit:a,render:c,renderCache:u,props:d,data:g,setupState:v,ctx:N,inheritAttrs:k}=e,D=Sr(e);let A,R;try{if(n.shapeFlag&4){const y=s||r,L=y;A=Tt(c.call(L,y,u,d,v,g,N)),R=l}else{const y=t;A=Tt(y.length>1?y(d,{attrs:l,slots:o,emit:a}):y(d,null)),R=t.props?l:ku(l)}}catch(y){Gn.length=0,Gr(y,e,1),A=Ee(zt)}let b=A;if(R&&k!==!1){const y=Object.keys(R),{shapeFlag:L}=b;y.length&&L&7&&(i&&y.some(Mr)&&(R=wu(R,i)),b=Sn(b,R,!1,!0))}return n.dirs&&(b=Sn(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&ii(b,n.transition),A=b,Sr(D),A}const ku=e=>{let t;for(const n in e)(n==="class"||n==="style"||Fr(n))&&((t||(t={}))[n]=e[n]);return t},wu=(e,t)=>{const n={};for(const r in e)(!Mr(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Su(e,t,n){const{props:r,children:s,component:i}=e,{props:o,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return r?Ri(r,o,c):!!o;if(a&8){const u=t.dynamicProps;for(let d=0;dObject.create(ql),Ql=e=>Object.getPrototypeOf(e)===ql;function Pu(e,t,n,r=!1){const s={},i=Jl();e.propsDefaults=Object.create(null),Zl(e,t,s,i);for(const o in e.propsOptions[0])o in s||(s[o]=void 0);n?e.props=r?s:Pl(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function xu(e,t,n,r){const{props:s,attrs:i,vnode:{patchFlag:o}}=e,l=fe(s),[a]=e.propsOptions;let c=!1;if((r||o>0)&&!(o&16)){if(o&8){const u=e.vnode.dynamicProps;for(let d=0;d{a=!0;const[g,v]=ea(d,t,!0);He(o,g),v&&l.push(...v)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return ge(e)&&r.set(e,bn),bn;if(J(i))for(let u=0;ue==="_"||e==="_ctx"||e==="$stable",li=e=>J(e)?e.map(Tt):[Tt(e)],Ou=(e,t,n)=>{if(t._n)return t;const r=Xc((...s)=>li(t(...s)),n);return r._c=!1,r},ta=(e,t,n)=>{const r=e._ctx;for(const s in e){if(oi(s))continue;const i=e[s];if(ee(i))t[s]=Ou(s,i,r);else if(i!=null){const o=li(i);t[s]=()=>o}}},na=(e,t)=>{const n=li(t);e.slots.default=()=>n},ra=(e,t,n)=>{for(const r in t)(n||!oi(r))&&(e[r]=t[r])},Lu=(e,t,n)=>{const r=e.slots=Jl();if(e.vnode.shapeFlag&32){const s=t._;s?(ra(r,t,n),n&&cl(r,"_",s,!0)):ta(t,r)}else t&&na(e,t)},Au=(e,t,n)=>{const{vnode:r,slots:s}=e;let i=!0,o=ve;if(r.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:ra(s,t,n):(i=!t.$stable,ta(t,s)),o=t}else t&&(na(e,t),o={default:1});if(i)for(const l in s)!oi(l)&&o[l]==null&&delete s[l]},Ze=Uu;function Ru(e){return Du(e)}function Du(e,t){const n=$r();n.__VUE__=!0;const{insert:r,remove:s,patchProp:i,createElement:o,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:g,setScopeId:v=St,insertStaticContent:N}=e,k=(m,_,p,T=null,O=null,P=null,H=void 0,U=null,f=!!_.dynamicChildren)=>{if(m===_)return;m&&!Rn(m,_)&&(T=I(m),Se(m,O,P,!0),m=null),_.patchFlag===-2&&(f=!1,_.dynamicChildren=null);const{type:h,ref:C,shapeFlag:w}=_;switch(h){case lr:D(m,_,p,T);break;case zt:A(m,_,p,T);break;case vr:m==null&&R(_,p,T,H);break;case st:Z(m,_,p,T,O,P,H,U,f);break;default:w&1?L(m,_,p,T,O,P,H,U,f):w&6?_e(m,_,p,T,O,P,H,U,f):(w&64||w&128)&&h.process(m,_,p,T,O,P,H,U,f,K)}C!=null&&O?$n(C,m&&m.ref,P,_||m,!_):C==null&&m&&m.ref!=null&&$n(m.ref,null,P,m,!0)},D=(m,_,p,T)=>{if(m==null)r(_.el=l(_.children),p,T);else{const O=_.el=m.el;_.children!==m.children&&c(O,_.children)}},A=(m,_,p,T)=>{m==null?r(_.el=a(_.children||""),p,T):_.el=m.el},R=(m,_,p,T)=>{[m.el,m.anchor]=N(m.children,_,p,T,m.el,m.anchor)},b=({el:m,anchor:_},p,T)=>{let O;for(;m&&m!==_;)O=g(m),r(m,p,T),m=O;r(_,p,T)},y=({el:m,anchor:_})=>{let p;for(;m&&m!==_;)p=g(m),s(m),m=p;s(_)},L=(m,_,p,T,O,P,H,U,f)=>{if(_.type==="svg"?H="svg":_.type==="math"&&(H="mathml"),m==null)x(_,p,T,O,P,H,U,f);else{const h=m.el&&m.el._isVueCE?m.el:null;try{h&&h._beginPatch(),W(m,_,O,P,H,U,f)}finally{h&&h._endPatch()}}},x=(m,_,p,T,O,P,H,U)=>{let f,h;const{props:C,shapeFlag:w,transition:j,dirs:M}=m;if(f=m.el=o(m.type,P,C&&C.is,C),w&8?u(f,m.children):w&16&&B(m.children,f,null,T,O,fs(m,P),H,U),M&&tn(m,null,T,"created"),F(f,m,m.scopeId,H,T),C){for(const S in C)S!=="value"&&!Wn(S)&&i(f,S,null,C[S],P,T);"value"in C&&i(f,"value",null,C.value,P),(h=C.onVnodeBeforeMount)&&yt(h,T,m)}M&&tn(m,null,T,"beforeMount");const E=Fu(O,j);E&&j.beforeEnter(f),r(f,_,p),((h=C&&C.onVnodeMounted)||E||M)&&Ze(()=>{try{h&&yt(h,T,m),E&&j.enter(f),M&&tn(m,null,T,"mounted")}finally{}},O)},F=(m,_,p,T,O)=>{if(p&&v(m,p),T)for(let P=0;P{for(let h=f;h{const U=_.el=m.el;let{patchFlag:f,dynamicChildren:h,dirs:C}=_;f|=m.patchFlag&16;const w=m.props||ve,j=_.props||ve;let M;if(p&&nn(p,!1),(M=j.onVnodeBeforeUpdate)&&yt(M,p,_,m),C&&tn(_,m,p,"beforeUpdate"),p&&nn(p,!0),(w.innerHTML&&j.innerHTML==null||w.textContent&&j.textContent==null)&&u(U,""),h?ae(m.dynamicChildren,h,U,p,T,fs(_,O),P):H||se(m,_,U,null,p,T,fs(_,O),P,!1),f>0){if(f&16)ke(U,w,j,p,O);else if(f&2&&w.class!==j.class&&i(U,"class",null,j.class,O),f&4&&i(U,"style",w.style,j.style,O),f&8){const E=_.dynamicProps;for(let S=0;S{M&&yt(M,p,_,m),C&&tn(_,m,p,"updated")},T)},ae=(m,_,p,T,O,P,H)=>{for(let U=0;U<_.length;U++){const f=m[U],h=_[U],C=f.el&&(f.type===st||!Rn(f,h)||f.shapeFlag&198)?d(f.el):p;k(f,h,C,null,T,O,P,H,!0)}},ke=(m,_,p,T,O)=>{if(_!==p){if(_!==ve)for(const P in _)!Wn(P)&&!(P in p)&&i(m,P,_[P],null,O,T);for(const P in p){if(Wn(P))continue;const H=p[P],U=_[P];H!==U&&P!=="value"&&i(m,P,U,H,O,T)}"value"in p&&i(m,"value",_.value,p.value,O)}},Z=(m,_,p,T,O,P,H,U,f)=>{const h=_.el=m?m.el:l(""),C=_.anchor=m?m.anchor:l("");let{patchFlag:w,dynamicChildren:j,slotScopeIds:M}=_;M&&(U=U?U.concat(M):M),m==null?(r(h,p,T),r(C,p,T),B(_.children||[],p,C,O,P,H,U,f)):w>0&&w&64&&j&&m.dynamicChildren&&m.dynamicChildren.length===j.length?(ae(m.dynamicChildren,j,p,O,P,H,U),(_.key!=null||O&&_===O.subTree)&&sa(m,_,!0)):se(m,_,p,C,O,P,H,U,f)},_e=(m,_,p,T,O,P,H,U,f)=>{_.slotScopeIds=U,m==null?_.shapeFlag&512?O.ctx.activate(_,p,T,H,f):ht(_,p,T,O,P,H,f):at(m,_,f)},ht=(m,_,p,T,O,P,H)=>{const U=m.component=Ku(m,T,O);if(Wl(m)&&(U.ctx.renderer=K),Yu(U,!1,H),U.asyncDep){if(O&&O.registerDep(U,de,H),!m.el){const f=U.subTree=Ee(zt);A(null,f,_,p),m.placeholder=f.el}}else de(U,m,_,p,O,P,H)},at=(m,_,p)=>{const T=_.component=m.component;if(Su(m,_,p))if(T.asyncDep&&!T.asyncResolved){ie(T,_,p);return}else T.next=_,T.update();else _.el=m.el,T.vnode=_},de=(m,_,p,T,O,P,H)=>{const U=()=>{if(m.isMounted){let{next:w,bu:j,u:M,parent:E,vnode:S}=m;{const Me=ia(m);if(Me){w&&(w.el=S.el,ie(m,w,H)),Me.asyncDep.then(()=>{Ze(()=>{m.isUnmounted||h()},O)});return}}let X=w,te;nn(m,!1),w?(w.el=S.el,ie(m,w,H)):w=S,j&&pr(j),(te=w.props&&w.props.onVnodeBeforeUpdate)&&yt(te,E,w,S),nn(m,!0);const be=Ai(m),Ge=m.subTree;m.subTree=be,k(Ge,be,d(Ge.el),I(Ge),m,O,P),w.el=be.el,X===null&&Nu(m,be.el),M&&Ze(M,O),(te=w.props&&w.props.onVnodeUpdated)&&Ze(()=>yt(te,E,w,S),O)}else{let w;const{el:j,props:M}=_,{bm:E,m:S,parent:X,root:te,type:be}=m,Ge=Vn(_);nn(m,!1),E&&pr(E),!Ge&&(w=M&&M.onVnodeBeforeMount)&&yt(w,X,_),nn(m,!0);{te.ce&&te.ce._hasShadowRoot()&&te.ce._injectChildStyle(be,m.parent?m.parent.type:void 0);const Me=m.subTree=Ai(m);k(null,Me,p,T,m,O,P),_.el=Me.el}if(S&&Ze(S,O),!Ge&&(w=M&&M.onVnodeMounted)){const Me=_;Ze(()=>yt(w,X,Me),O)}(_.shapeFlag&256||X&&Vn(X.vnode)&&X.vnode.shapeFlag&256)&&m.a&&Ze(m.a,O),m.isMounted=!0,_=p=T=null}};m.scope.on();const f=m.effect=new ml(U);m.scope.off();const h=m.update=f.run.bind(f),C=m.job=f.runIfDirty.bind(f);C.i=m,C.id=m.uid,f.scheduler=()=>si(C),nn(m,!0),h()},ie=(m,_,p)=>{_.component=m;const T=m.vnode.props;m.vnode=_,m.next=null,xu(m,_.props,T,p),Au(m,_.children,p),Ht(),wi(m),jt()},se=(m,_,p,T,O,P,H,U,f=!1)=>{const h=m&&m.children,C=m?m.shapeFlag:0,w=_.children,{patchFlag:j,shapeFlag:M}=_;if(j>0){if(j&128){Je(h,w,p,T,O,P,H,U,f);return}else if(j&256){Be(h,w,p,T,O,P,H,U,f);return}}M&8?(C&16&&Re(h,O,P),w!==h&&u(p,w)):C&16?M&16?Je(h,w,p,T,O,P,H,U,f):Re(h,O,P,!0):(C&8&&u(p,""),M&16&&B(w,p,T,O,P,H,U,f))},Be=(m,_,p,T,O,P,H,U,f)=>{m=m||bn,_=_||bn;const h=m.length,C=_.length,w=Math.min(h,C);let j;for(j=0;jC?Re(m,O,P,!0,!1,w):B(_,p,T,O,P,H,U,f,w)},Je=(m,_,p,T,O,P,H,U,f)=>{let h=0;const C=_.length;let w=m.length-1,j=C-1;for(;h<=w&&h<=j;){const M=m[h],E=_[h]=f?Ft(_[h]):Tt(_[h]);if(Rn(M,E))k(M,E,p,null,O,P,H,U,f);else break;h++}for(;h<=w&&h<=j;){const M=m[w],E=_[j]=f?Ft(_[j]):Tt(_[j]);if(Rn(M,E))k(M,E,p,null,O,P,H,U,f);else break;w--,j--}if(h>w){if(h<=j){const M=j+1,E=Mj)for(;h<=w;)Se(m[h],O,P,!0),h++;else{const M=h,E=h,S=new Map;for(h=E;h<=j;h++){const rt=_[h]=f?Ft(_[h]):Tt(_[h]);rt.key!=null&&S.set(rt.key,h)}let X,te=0;const be=j-E+1;let Ge=!1,Me=0;const en=new Array(be);for(h=0;h=be){Se(rt,O,P,!0);continue}let bt;if(rt.key!=null)bt=S.get(rt.key);else for(X=E;X<=j;X++)if(en[X-E]===0&&Rn(rt,_[X])){bt=X;break}bt===void 0?Se(rt,O,P,!0):(en[bt-E]=h+1,bt>=Me?Me=bt:Ge=!0,k(rt,_[bt],p,null,O,P,H,U,f),te++)}const ss=Ge?Mu(en):bn;for(X=ss.length-1,h=be-1;h>=0;h--){const rt=E+h,bt=_[rt],bi=_[rt+1],yi=rt+1{const{el:P,type:H,transition:U,children:f,shapeFlag:h}=m;if(h&6){we(m.component.subTree,_,p,T);return}if(h&128){m.suspense.move(_,p,T);return}if(h&64){H.move(m,_,p,K);return}if(H===st){r(P,_,p);for(let w=0;wU.enter(P),O);else{const{leave:w,delayLeave:j,afterLeave:M}=U,E=()=>{m.ctx.isUnmounted?s(P):r(P,_,p)},S=()=>{P._isLeaving&&P[eu](!0),w(P,()=>{E(),M&&M()})};j?j(P,E,S):S()}else r(P,_,p)},Se=(m,_,p,T=!1,O=!1)=>{const{type:P,props:H,ref:U,children:f,dynamicChildren:h,shapeFlag:C,patchFlag:w,dirs:j,cacheIndex:M,memo:E}=m;if(w===-2&&(O=!1),U!=null&&(Ht(),$n(U,null,p,m,!0),jt()),M!=null&&(_.renderCache[M]=void 0),C&256){_.ctx.deactivate(m);return}const S=C&1&&j,X=!Vn(m);let te;if(X&&(te=H&&H.onVnodeBeforeUnmount)&&yt(te,_,m),C&6)nt(m.component,p,T);else{if(C&128){m.suspense.unmount(p,T);return}S&&tn(m,null,_,"beforeUnmount"),C&64?m.type.remove(m,_,p,K,T):h&&!h.hasOnce&&(P!==st||w>0&&w&64)?Re(h,_,p,!1,!0):(P===st&&w&384||!O&&C&16)&&Re(f,_,p),T&&ct(m)}const be=E!=null&&M==null;(X&&(te=H&&H.onVnodeUnmounted)||S||be)&&Ze(()=>{te&&yt(te,_,m),S&&tn(m,null,_,"unmounted"),be&&(m.el=null)},p)},ct=m=>{const{type:_,el:p,anchor:T,transition:O}=m;if(_===st){tt(p,T);return}if(_===vr){y(m);return}const P=()=>{s(p),O&&!O.persisted&&O.afterLeave&&O.afterLeave()};if(m.shapeFlag&1&&O&&!O.persisted){const{leave:H,delayLeave:U}=O,f=()=>H(p,P);U?U(m.el,P,f):f()}else P()},tt=(m,_)=>{let p;for(;m!==_;)p=g(m),s(m),m=p;s(_)},nt=(m,_,p)=>{const{bum:T,scope:O,job:P,subTree:H,um:U,m:f,a:h}=m;Fi(f),Fi(h),T&&pr(T),O.stop(),P&&(P.flags|=8,Se(H,m,_,p)),U&&Ze(U,_),Ze(()=>{m.isUnmounted=!0},_)},Re=(m,_,p,T=!1,O=!1,P=0)=>{for(let H=P;H{if(m.shapeFlag&6)return I(m.component.subTree);if(m.shapeFlag&128)return m.suspense.next();const _=g(m.anchor||m.el),p=_&&_[Qc];return p?g(p):_};let G=!1;const $=(m,_,p)=>{let T;m==null?_._vnode&&(Se(_._vnode,null,null,!0),T=_._vnode.component):k(_._vnode||null,m,_,null,null,null,p),_._vnode=m,G||(G=!0,wi(T),Al(),G=!1)},K={p:k,um:Se,m:we,r:ct,mt:ht,mc:B,pc:se,pbc:ae,n:I,o:e};return{render:$,hydrate:void 0,createApp:yu($)}}function fs({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function nn({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Fu(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function sa(e,t,n=!1){const r=e.children,s=t.children;if(J(r)&&J(s))for(let i=0;i>1,e[n[l]]0&&(t[r]=n[i-1]),n[i]=r)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}function ia(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ia(t)}function Fi(e){if(e)for(let t=0;te.__isSuspense;function Uu(e,t){t&&t.pendingBranch?J(e)?t.effects.push(...e):t.effects.push(e):Yc(e)}const st=Symbol.for("v-fgt"),lr=Symbol.for("v-txt"),zt=Symbol.for("v-cmt"),vr=Symbol.for("v-stc"),Gn=[];let lt=null;function oe(e=!1){Gn.push(lt=e?null:[])}function Wu(){Gn.pop(),lt=Gn[Gn.length-1]||null}let qn=1;function xr(e,t=!1){qn+=e,e<0&<&&t&&(lt.hasOnce=!0)}function aa(e){return e.dynamicChildren=qn>0?lt||bn:null,Wu(),qn>0&<&<.push(e),e}function me(e,t,n,r,s,i){return aa(z(e,t,n,r,s,i,!0))}function Un(e,t,n,r,s){return aa(Ee(e,t,n,r,s,!0))}function Ir(e){return e?e.__v_isVNode===!0:!1}function Rn(e,t){return e.type===t.type&&e.key===t.key}const ca=({key:e})=>e??null,br=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ie(e)||Ue(e)||ee(e)?{i:ot,r:e,k:t,f:!!n}:e:null);function z(e,t=null,n=null,r=0,s=null,i=e===st?0:1,o=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ca(t),ref:t&&br(t),scopeId:Dl,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:ot};return l?(ai(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=Ie(n)?8:16),qn>0&&!o&<&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&<.push(a),a}const Ee=Hu;function Hu(e,t=null,n=null,r=0,s=null,i=!1){if((!e||e===Vl)&&(e=zt),Ir(e)){const l=Sn(e,t,!0);return n&&ai(l,n),qn>0&&!i&<&&(l.shapeFlag&6?lt[lt.indexOf(e)]=l:lt.push(l)),l.patchFlag=-2,l}if(Qu(e)&&(e=e.__vccOpts),t){t=ju(t);let{class:l,style:a}=t;l&&!Ie(l)&&(t.class=$e(l)),ge(a)&&(ti(a)&&!J(a)&&(a=He({},a)),t.style=Xs(a))}const o=Ie(e)?1:la(e)?128:Zc(e)?64:ge(e)?4:ee(e)?2:0;return z(e,t,n,r,s,o,i,!0)}function ju(e){return e?ti(e)||Ql(e)?He({},e):e:null}function Sn(e,t,n=!1,r=!1){const{props:s,ref:i,patchFlag:o,children:l,transition:a}=e,c=t?Vu(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&ca(c),ref:t&&t.ref?n&&i?J(i)?i.concat(br(t)):[i,br(t)]:br(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==st?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Sn(e.ssContent),ssFallback:e.ssFallback&&Sn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&r&&ii(u,a.clone(u)),u}function $u(e=" ",t=0){return Ee(lr,null,e,t)}function zr(e,t){const n=Ee(vr,null,e);return n.staticCount=t,n}function Le(e="",t=!1){return t?(oe(),Un(zt,null,e)):Ee(zt,null,e)}function Tt(e){return e==null||typeof e=="boolean"?Ee(zt):J(e)?Ee(st,null,e.slice()):Ir(e)?Ft(e):Ee(lr,null,String(e))}function Ft(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Sn(e)}function ai(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(J(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),ai(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!Ql(t)?t._ctx=ot:s===3&&ot&&(ot.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ee(t)?(t={default:t,_ctx:ot},n=32):(t=String(t),r&64?(n=16,t=[$u(t)]):n=8);e.children=t,e.shapeFlag|=n}function Vu(...e){const t={};for(let n=0;nVe||ot;let Or,Is;{const e=$r(),t=(n,r)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(r),i=>{s.length>1?s.forEach(o=>o(i)):s[0](i)}};Or=t("__VUE_INSTANCE_SETTERS__",n=>Ve=n),Is=t("__VUE_SSR_SETTERS__",n=>Jn=n)}const ar=e=>{const t=Ve;return Or(e),e.scope.on(),()=>{e.scope.off(),Or(t)}},Mi=()=>{Ve&&Ve.scope.off(),Or(null)};function ua(e){return e.vnode.shapeFlag&4}let Jn=!1;function Yu(e,t=!1,n=!1){t&&Is(t);const{props:r,children:s}=e.vnode,i=ua(e);Pu(e,r,i,t),Lu(e,s,n||t);const o=i?Xu(e,t):void 0;return t&&Is(!1),o}function Xu(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,du);const{setup:r}=n;if(r){Ht();const s=e.setupContext=r.length>1?qu(e):null,i=ar(e),o=sr(r,e,0,[e.props,s]),l=ol(o);if(jt(),i(),(l||e.sp)&&!Vn(e)&&Ul(e),l){if(o.then(Mi,Mi),t)return o.then(a=>{Ui(e,a)}).catch(a=>{Gr(a,e,0)});e.asyncDep=o}else Ui(e,o)}else fa(e)}function Ui(e,t,n){ee(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ge(t)&&(e.setupState=Il(t)),fa(e)}function fa(e,t,n){const r=e.type;e.render||(e.render=r.render||St);{const s=ar(e);Ht();try{mu(e)}finally{jt(),s()}}}const zu={get(e,t){return je(e,"get",""),e[t]}};function qu(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,zu),slots:e.slots,emit:e.emit,expose:t}}function qr(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Il(Uc(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Bn)return Bn[n](e)},has(t,n){return n in t||n in Bn}})):e.proxy}function Ju(e,t=!0){return ee(e)?e.displayName||e.name:e.name||t&&e.__name}function Qu(e){return ee(e)&&"__vccOpts"in e}const ce=(e,t)=>$c(e,t,Jn);function Jr(e,t,n){try{xr(-1);const r=arguments.length;return r===2?ge(t)&&!J(t)?Ir(t)?Ee(e,null,[t]):Ee(e,t):Ee(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ir(n)&&(n=[n]),Ee(e,t,n))}finally{xr(1)}}const Zu="3.5.31";/** * @vue/runtime-dom v3.5.31 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT @@ -24,16 +24,16 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomePage-BQbVVC * (c) 2025 kazuya kawaguchi * Released under the MIT License. */function Hf(e,t,n){return{line:e,column:t,offset:n}}function Dr(e,t,n){return{start:e,end:t}}const jf=/\{([0-9a-zA-Z]+)\}/g;function ga(e,...t){return t.length===1&&$f(t[0])&&(t=t[0]),(!t||!t.hasOwnProperty)&&(t={}),e.replace(jf,(n,r)=>t.hasOwnProperty(r)?t[r]:"")}const pa=Object.assign,ro=e=>typeof e=="string",$f=e=>e!==null&&typeof e=="object";function _a(e,t=""){return e.reduce((n,r,s)=>s===0?n+r:n+t+r,"")}const ci={USE_MODULO_SYNTAX:1,__EXTEND_POINT__:2},Vf={[ci.USE_MODULO_SYNTAX]:"Use modulo before '{{0}}'."};function Bf(e,t,...n){const r=ga(Vf[e],...n||[]),s={message:String(r),code:e};return t&&(s.location=t),s}const q={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17},Gf={[q.EXPECTED_TOKEN]:"Expected token: '{0}'",[q.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[q.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[q.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[q.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[q.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[q.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[q.EMPTY_PLACEHOLDER]:"Empty placeholder",[q.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[q.INVALID_LINKED_FORMAT]:"Invalid linked format",[q.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[q.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[q.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[q.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[q.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[q.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function Ln(e,t,n={}){const{domain:r,messages:s,args:i}=n,o=ga((s||Gf)[e]||"",...i||[]),l=new SyntaxError(String(o));return l.code=e,t&&(l.location=t),l.domain=r,l}function Kf(e){throw e}const Lt=" ",Yf="\r",Ye=` -`,Xf="\u2028",zf="\u2029";function qf(e){const t=e;let n=0,r=1,s=1,i=0;const o=F=>t[F]===Yf&&t[F+1]===Ye,l=F=>t[F]===Ye,a=F=>t[F]===zf,c=F=>t[F]===Xf,u=F=>o(F)||l(F)||a(F)||c(F),h=()=>n,g=()=>r,v=()=>s,x=()=>i,k=F=>o(F)||a(F)||c(F)?Ye:t[F],D=()=>k(n),A=()=>k(n+i);function R(){return i=0,u(n)&&(r++,s=0),o(n)&&n++,n++,s++,t[n]}function b(){return o(n+i)&&i++,i++,t[n+i]}function y(){n=0,r=1,s=1,i=0}function L(F=0){i=F}function P(){const F=n+i;for(;F!==n;)R();i=0}return{index:h,line:g,column:v,peekOffset:x,charAt:k,currentChar:D,currentPeek:A,next:R,peek:b,reset:y,resetPeek:L,skipToPeek:P}}const Bt=void 0,Jf=".",so="'",Qf="tokenizer";function Zf(e,t={}){const n=t.location!==!1,r=qf(e),s=()=>r.index(),i=()=>Hf(r.line(),r.column(),r.index()),o=i(),l=s(),a={currentType:14,offset:l,startLoc:o,endLoc:o,lastType:14,lastOffset:l,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function h(f,d,C,...w){const j=c();if(d.column+=C,d.offset+=C,u){const M=n?Dr(j.startLoc,d):null,E=Ln(f,M,{domain:Qf,args:w});u(E)}}function g(f,d,C){f.endLoc=i(),f.currentType=d;const w={type:d};return n&&(w.loc=Dr(f.startLoc,f.endLoc)),C!=null&&(w.value=C),w}const v=f=>g(f,14);function x(f,d){return f.currentChar()===d?(f.next(),d):(h(q.EXPECTED_TOKEN,i(),0,d),"")}function k(f){let d="";for(;f.currentPeek()===Lt||f.currentPeek()===Ye;)d+=f.currentPeek(),f.peek();return d}function D(f){const d=k(f);return f.skipToPeek(),d}function A(f){if(f===Bt)return!1;const d=f.charCodeAt(0);return d>=97&&d<=122||d>=65&&d<=90||d===95}function R(f){if(f===Bt)return!1;const d=f.charCodeAt(0);return d>=48&&d<=57}function b(f,d){const{currentType:C}=d;if(C!==2)return!1;k(f);const w=A(f.currentPeek());return f.resetPeek(),w}function y(f,d){const{currentType:C}=d;if(C!==2)return!1;k(f);const w=f.currentPeek()==="-"?f.peek():f.currentPeek(),j=R(w);return f.resetPeek(),j}function L(f,d){const{currentType:C}=d;if(C!==2)return!1;k(f);const w=f.currentPeek()===so;return f.resetPeek(),w}function P(f,d){const{currentType:C}=d;if(C!==8)return!1;k(f);const w=f.currentPeek()===".";return f.resetPeek(),w}function F(f,d){const{currentType:C}=d;if(C!==9)return!1;k(f);const w=A(f.currentPeek());return f.resetPeek(),w}function B(f,d){const{currentType:C}=d;if(!(C===8||C===12))return!1;k(f);const w=f.currentPeek()===":";return f.resetPeek(),w}function W(f,d){const{currentType:C}=d;if(C!==10)return!1;const w=()=>{const M=f.currentPeek();return M==="{"?A(f.peek()):M==="@"||M==="%"||M==="|"||M===":"||M==="."||M===Lt||!M?!1:M===Ye?(f.peek(),w()):Z(f,!1)},j=w();return f.resetPeek(),j}function ae(f){k(f);const d=f.currentPeek()==="|";return f.resetPeek(),d}function ke(f){const d=k(f),C=f.currentPeek()==="%"&&f.peek()==="{";return f.resetPeek(),{isModulo:C,hasSpace:d.length>0}}function Z(f,d=!0){const C=(j=!1,M="",E=!1)=>{const S=f.currentPeek();return S==="{"?M==="%"?!1:j:S==="@"||!S?M==="%"?!0:j:S==="%"?(f.peek(),C(j,"%",!0)):S==="|"?M==="%"||E?!0:!(M===Lt||M===Ye):S===Lt?(f.peek(),C(!0,Lt,E)):S===Ye?(f.peek(),C(!0,Ye,E)):!0},w=C();return d&&f.resetPeek(),w}function _e(f,d){const C=f.currentChar();return C===Bt?Bt:d(C)?(f.next(),C):null}function ht(f){const d=f.charCodeAt(0);return d>=97&&d<=122||d>=65&&d<=90||d>=48&&d<=57||d===95||d===36}function at(f){return _e(f,ht)}function de(f){const d=f.charCodeAt(0);return d>=97&&d<=122||d>=65&&d<=90||d>=48&&d<=57||d===95||d===36||d===45}function ie(f){return _e(f,de)}function se(f){const d=f.charCodeAt(0);return d>=48&&d<=57}function Be(f){return _e(f,se)}function Je(f){const d=f.charCodeAt(0);return d>=48&&d<=57||d>=65&&d<=70||d>=97&&d<=102}function we(f){return _e(f,Je)}function Se(f){let d="",C="";for(;d=Be(f);)C+=d;return C}function ct(f){D(f);const d=f.currentChar();return d!=="%"&&h(q.EXPECTED_TOKEN,i(),0,d),f.next(),"%"}function tt(f){let d="";for(;;){const C=f.currentChar();if(C==="{"||C==="}"||C==="@"||C==="|"||!C)break;if(C==="%")if(Z(f))d+=C,f.next();else break;else if(C===Lt||C===Ye)if(Z(f))d+=C,f.next();else{if(ae(f))break;d+=C,f.next()}else d+=C,f.next()}return d}function nt(f){D(f);let d="",C="";for(;d=ie(f);)C+=d;return f.currentChar()===Bt&&h(q.UNTERMINATED_CLOSING_BRACE,i(),0),C}function Re(f){D(f);let d="";return f.currentChar()==="-"?(f.next(),d+=`-${Se(f)}`):d+=Se(f),f.currentChar()===Bt&&h(q.UNTERMINATED_CLOSING_BRACE,i(),0),d}function I(f){return f!==so&&f!==Ye}function G(f){D(f),x(f,"'");let d="",C="";for(;d=_e(f,I);)d==="\\"?C+=$(f):C+=d;const w=f.currentChar();return w===Ye||w===Bt?(h(q.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),w===Ye&&(f.next(),x(f,"'")),C):(x(f,"'"),C)}function $(f){const d=f.currentChar();switch(d){case"\\":case"'":return f.next(),`\\${d}`;case"u":return K(f,d,4);case"U":return K(f,d,6);default:return h(q.UNKNOWN_ESCAPE_SEQUENCE,i(),0,d),""}}function K(f,d,C){x(f,d);let w="";for(let j=0;j{const w=f.currentChar();return w==="{"||w==="%"||w==="@"||w==="|"||w==="("||w===")"||!w||w===Lt?C:(C+=w,f.next(),d(C))};return d("")}function T(f){D(f);const d=x(f,"|");return D(f),d}function O(f,d){let C=null;switch(f.currentChar()){case"{":return d.braceNest>=1&&h(q.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),f.next(),C=g(d,2,"{"),D(f),d.braceNest++,C;case"}":return d.braceNest>0&&d.currentType===2&&h(q.EMPTY_PLACEHOLDER,i(),0),f.next(),C=g(d,3,"}"),d.braceNest--,d.braceNest>0&&D(f),d.inLinked&&d.braceNest===0&&(d.inLinked=!1),C;case"@":return d.braceNest>0&&h(q.UNTERMINATED_CLOSING_BRACE,i(),0),C=N(f,d)||v(d),d.braceNest=0,C;default:{let j=!0,M=!0,E=!0;if(ae(f))return d.braceNest>0&&h(q.UNTERMINATED_CLOSING_BRACE,i(),0),C=g(d,1,T(f)),d.braceNest=0,d.inLinked=!1,C;if(d.braceNest>0&&(d.currentType===5||d.currentType===6||d.currentType===7))return h(q.UNTERMINATED_CLOSING_BRACE,i(),0),d.braceNest=0,H(f,d);if(j=b(f,d))return C=g(d,5,nt(f)),D(f),C;if(M=y(f,d))return C=g(d,6,Re(f)),D(f),C;if(E=L(f,d))return C=g(d,7,G(f)),D(f),C;if(!j&&!M&&!E)return C=g(d,13,m(f)),h(q.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,C.value),D(f),C;break}}return C}function N(f,d){const{currentType:C}=d;let w=null;const j=f.currentChar();switch((C===8||C===9||C===12||C===10)&&(j===Ye||j===Lt)&&h(q.INVALID_LINKED_FORMAT,i(),0),j){case"@":return f.next(),w=g(d,8,"@"),d.inLinked=!0,w;case".":return D(f),f.next(),g(d,9,".");case":":return D(f),f.next(),g(d,10,":");default:return ae(f)?(w=g(d,1,T(f)),d.braceNest=0,d.inLinked=!1,w):P(f,d)||B(f,d)?(D(f),N(f,d)):F(f,d)?(D(f),g(d,12,_(f))):W(f,d)?(D(f),j==="{"?O(f,d)||w:g(d,11,p(f))):(C===8&&h(q.INVALID_LINKED_FORMAT,i(),0),d.braceNest=0,d.inLinked=!1,H(f,d))}}function H(f,d){let C={type:14};if(d.braceNest>0)return O(f,d)||v(d);if(d.inLinked)return N(f,d)||v(d);switch(f.currentChar()){case"{":return O(f,d)||v(d);case"}":return h(q.UNBALANCED_CLOSING_BRACE,i(),0),f.next(),g(d,3,"}");case"@":return N(f,d)||v(d);default:{if(ae(f))return C=g(d,1,T(f)),d.braceNest=0,d.inLinked=!1,C;const{isModulo:j,hasSpace:M}=ke(f);if(j)return M?g(d,0,tt(f)):g(d,4,ct(f));if(Z(f))return g(d,0,tt(f));break}}return C}function U(){const{currentType:f,offset:d,startLoc:C,endLoc:w}=a;return a.lastType=f,a.lastOffset=d,a.lastStartLoc=C,a.lastEndLoc=w,a.offset=s(),a.startLoc=i(),r.currentChar()===Bt?g(a,14):H(r,a)}return{nextToken:U,currentOffset:s,currentPosition:i,context:c}}const eh="parser",th=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function nh(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(t||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function rh(e={}){const t=e.location!==!1,{onError:n,onWarn:r}=e;function s(b,y,L,P,...F){const B=b.currentPosition();if(B.offset+=P,B.column+=P,n){const W=t?Dr(L,B):null,ae=Ln(y,W,{domain:eh,args:F});n(ae)}}function i(b,y,L,P,...F){const B=b.currentPosition();if(B.offset+=P,B.column+=P,r){const W=t?Dr(L,B):null;r(Bf(y,W,F))}}function o(b,y,L){const P={type:b};return t&&(P.start=y,P.end=y,P.loc={start:L,end:L}),P}function l(b,y,L,P){t&&(b.end=y,b.loc&&(b.loc.end=L))}function a(b,y){const L=b.context(),P=o(3,L.offset,L.startLoc);return P.value=y,l(P,b.currentOffset(),b.currentPosition()),P}function c(b,y){const L=b.context(),{lastOffset:P,lastStartLoc:F}=L,B=o(5,P,F);return B.index=parseInt(y,10),b.nextToken(),l(B,b.currentOffset(),b.currentPosition()),B}function u(b,y,L){const P=b.context(),{lastOffset:F,lastStartLoc:B}=P,W=o(4,F,B);return W.key=y,L===!0&&(W.modulo=!0),b.nextToken(),l(W,b.currentOffset(),b.currentPosition()),W}function h(b,y){const L=b.context(),{lastOffset:P,lastStartLoc:F}=L,B=o(9,P,F);return B.value=y.replace(th,nh),b.nextToken(),l(B,b.currentOffset(),b.currentPosition()),B}function g(b){const y=b.nextToken(),L=b.context(),{lastOffset:P,lastStartLoc:F}=L,B=o(8,P,F);return y.type!==12?(s(b,q.UNEXPECTED_EMPTY_LINKED_MODIFIER,L.lastStartLoc,0),B.value="",l(B,P,F),{nextConsumeToken:y,node:B}):(y.value==null&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,L.lastStartLoc,0,dt(y)),B.value=y.value||"",l(B,b.currentOffset(),b.currentPosition()),{node:B})}function v(b,y){const L=b.context(),P=o(7,L.offset,L.startLoc);return P.value=y,l(P,b.currentOffset(),b.currentPosition()),P}function x(b){const y=b.context(),L=o(6,y.offset,y.startLoc);let P=b.nextToken();if(P.type===9){const F=g(b);L.modifier=F.node,P=F.nextConsumeToken||b.nextToken()}switch(P.type!==10&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,dt(P)),P=b.nextToken(),P.type===2&&(P=b.nextToken()),P.type){case 11:P.value==null&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,dt(P)),L.key=v(b,P.value||"");break;case 5:P.value==null&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,dt(P)),L.key=u(b,P.value||"");break;case 6:P.value==null&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,dt(P)),L.key=c(b,P.value||"");break;case 7:P.value==null&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,dt(P)),L.key=h(b,P.value||"");break;default:{s(b,q.UNEXPECTED_EMPTY_LINKED_KEY,y.lastStartLoc,0);const F=b.context(),B=o(7,F.offset,F.startLoc);return B.value="",l(B,F.offset,F.startLoc),L.key=B,l(L,F.offset,F.startLoc),{nextConsumeToken:P,node:L}}}return l(L,b.currentOffset(),b.currentPosition()),{node:L}}function k(b){const y=b.context(),L=y.currentType===1?b.currentOffset():y.offset,P=y.currentType===1?y.endLoc:y.startLoc,F=o(2,L,P);F.items=[];let B=null,W=null;do{const Z=B||b.nextToken();switch(B=null,Z.type){case 0:Z.value==null&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,dt(Z)),F.items.push(a(b,Z.value||""));break;case 6:Z.value==null&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,dt(Z)),F.items.push(c(b,Z.value||""));break;case 4:W=!0;break;case 5:Z.value==null&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,dt(Z)),F.items.push(u(b,Z.value||"",!!W)),W&&(i(b,ci.USE_MODULO_SYNTAX,y.lastStartLoc,0,dt(Z)),W=null);break;case 7:Z.value==null&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,dt(Z)),F.items.push(h(b,Z.value||""));break;case 8:{const _e=x(b);F.items.push(_e.node),B=_e.nextConsumeToken||null;break}}}while(y.currentType!==14&&y.currentType!==1);const ae=y.currentType===1?y.lastOffset:b.currentOffset(),ke=y.currentType===1?y.lastEndLoc:b.currentPosition();return l(F,ae,ke),F}function D(b,y,L,P){const F=b.context();let B=P.items.length===0;const W=o(1,y,L);W.cases=[],W.cases.push(P);do{const ae=k(b);B||(B=ae.items.length===0),W.cases.push(ae)}while(F.currentType!==14);return B&&s(b,q.MUST_HAVE_MESSAGES_IN_PLURAL,L,0),l(W,b.currentOffset(),b.currentPosition()),W}function A(b){const y=b.context(),{offset:L,startLoc:P}=y,F=k(b);return y.currentType===14?F:D(b,L,P,F)}function R(b){const y=Zf(b,pa({},e)),L=y.context(),P=o(0,L.offset,L.startLoc);return t&&P.loc&&(P.loc.source=b),P.body=A(y),e.onCacheKey&&(P.cacheKey=e.onCacheKey(b)),L.currentType!==14&&s(y,q.UNEXPECTED_LEXICAL_ANALYSIS,L.lastStartLoc,0,b[L.offset]||""),l(P,y.currentOffset(),y.currentPosition()),P}return{parse:R}}function dt(e){if(e.type===14)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function sh(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function io(e,t){for(let n=0;noo(n)),e}function oo(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;no;function a(k,D){o.code+=k}function c(k,D=!0){const A=D?r:"";a(s?A+" ".repeat(k):A)}function u(k=!0){const D=++o.indentLevel;k&&c(D)}function h(k=!0){const D=--o.indentLevel;k&&c(D)}function g(){c(o.indentLevel)}return{context:l,push:a,indent:u,deindent:h,newline:g,helper:k=>`_${k}`,needIndent:()=>o.needIndent}}function uh(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Pn(e,t.key),t.modifier?(e.push(", "),Pn(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function fh(e,t){const{helper:n,needIndent:r}=e;e.push(`${n("normalize")}([`),e.indent(r());const s=t.items.length;for(let i=0;i1){e.push(`${n("plural")}([`),e.indent(r());const s=t.cases.length;for(let i=0;i{const n=ro(t.mode)?t.mode:"normal",r=ro(t.filename)?t.filename:"message.intl";t.sourceMap;const s=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":` +`,Xf="\u2028",zf="\u2029";function qf(e){const t=e;let n=0,r=1,s=1,i=0;const o=F=>t[F]===Yf&&t[F+1]===Ye,l=F=>t[F]===Ye,a=F=>t[F]===zf,c=F=>t[F]===Xf,u=F=>o(F)||l(F)||a(F)||c(F),d=()=>n,g=()=>r,v=()=>s,N=()=>i,k=F=>o(F)||a(F)||c(F)?Ye:t[F],D=()=>k(n),A=()=>k(n+i);function R(){return i=0,u(n)&&(r++,s=0),o(n)&&n++,n++,s++,t[n]}function b(){return o(n+i)&&i++,i++,t[n+i]}function y(){n=0,r=1,s=1,i=0}function L(F=0){i=F}function x(){const F=n+i;for(;F!==n;)R();i=0}return{index:d,line:g,column:v,peekOffset:N,charAt:k,currentChar:D,currentPeek:A,next:R,peek:b,reset:y,resetPeek:L,skipToPeek:x}}const Bt=void 0,Jf=".",so="'",Qf="tokenizer";function Zf(e,t={}){const n=t.location!==!1,r=qf(e),s=()=>r.index(),i=()=>Hf(r.line(),r.column(),r.index()),o=i(),l=s(),a={currentType:14,offset:l,startLoc:o,endLoc:o,lastType:14,lastOffset:l,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function d(f,h,C,...w){const j=c();if(h.column+=C,h.offset+=C,u){const M=n?Dr(j.startLoc,h):null,E=Ln(f,M,{domain:Qf,args:w});u(E)}}function g(f,h,C){f.endLoc=i(),f.currentType=h;const w={type:h};return n&&(w.loc=Dr(f.startLoc,f.endLoc)),C!=null&&(w.value=C),w}const v=f=>g(f,14);function N(f,h){return f.currentChar()===h?(f.next(),h):(d(q.EXPECTED_TOKEN,i(),0,h),"")}function k(f){let h="";for(;f.currentPeek()===Lt||f.currentPeek()===Ye;)h+=f.currentPeek(),f.peek();return h}function D(f){const h=k(f);return f.skipToPeek(),h}function A(f){if(f===Bt)return!1;const h=f.charCodeAt(0);return h>=97&&h<=122||h>=65&&h<=90||h===95}function R(f){if(f===Bt)return!1;const h=f.charCodeAt(0);return h>=48&&h<=57}function b(f,h){const{currentType:C}=h;if(C!==2)return!1;k(f);const w=A(f.currentPeek());return f.resetPeek(),w}function y(f,h){const{currentType:C}=h;if(C!==2)return!1;k(f);const w=f.currentPeek()==="-"?f.peek():f.currentPeek(),j=R(w);return f.resetPeek(),j}function L(f,h){const{currentType:C}=h;if(C!==2)return!1;k(f);const w=f.currentPeek()===so;return f.resetPeek(),w}function x(f,h){const{currentType:C}=h;if(C!==8)return!1;k(f);const w=f.currentPeek()===".";return f.resetPeek(),w}function F(f,h){const{currentType:C}=h;if(C!==9)return!1;k(f);const w=A(f.currentPeek());return f.resetPeek(),w}function B(f,h){const{currentType:C}=h;if(!(C===8||C===12))return!1;k(f);const w=f.currentPeek()===":";return f.resetPeek(),w}function W(f,h){const{currentType:C}=h;if(C!==10)return!1;const w=()=>{const M=f.currentPeek();return M==="{"?A(f.peek()):M==="@"||M==="%"||M==="|"||M===":"||M==="."||M===Lt||!M?!1:M===Ye?(f.peek(),w()):Z(f,!1)},j=w();return f.resetPeek(),j}function ae(f){k(f);const h=f.currentPeek()==="|";return f.resetPeek(),h}function ke(f){const h=k(f),C=f.currentPeek()==="%"&&f.peek()==="{";return f.resetPeek(),{isModulo:C,hasSpace:h.length>0}}function Z(f,h=!0){const C=(j=!1,M="",E=!1)=>{const S=f.currentPeek();return S==="{"?M==="%"?!1:j:S==="@"||!S?M==="%"?!0:j:S==="%"?(f.peek(),C(j,"%",!0)):S==="|"?M==="%"||E?!0:!(M===Lt||M===Ye):S===Lt?(f.peek(),C(!0,Lt,E)):S===Ye?(f.peek(),C(!0,Ye,E)):!0},w=C();return h&&f.resetPeek(),w}function _e(f,h){const C=f.currentChar();return C===Bt?Bt:h(C)?(f.next(),C):null}function ht(f){const h=f.charCodeAt(0);return h>=97&&h<=122||h>=65&&h<=90||h>=48&&h<=57||h===95||h===36}function at(f){return _e(f,ht)}function de(f){const h=f.charCodeAt(0);return h>=97&&h<=122||h>=65&&h<=90||h>=48&&h<=57||h===95||h===36||h===45}function ie(f){return _e(f,de)}function se(f){const h=f.charCodeAt(0);return h>=48&&h<=57}function Be(f){return _e(f,se)}function Je(f){const h=f.charCodeAt(0);return h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102}function we(f){return _e(f,Je)}function Se(f){let h="",C="";for(;h=Be(f);)C+=h;return C}function ct(f){D(f);const h=f.currentChar();return h!=="%"&&d(q.EXPECTED_TOKEN,i(),0,h),f.next(),"%"}function tt(f){let h="";for(;;){const C=f.currentChar();if(C==="{"||C==="}"||C==="@"||C==="|"||!C)break;if(C==="%")if(Z(f))h+=C,f.next();else break;else if(C===Lt||C===Ye)if(Z(f))h+=C,f.next();else{if(ae(f))break;h+=C,f.next()}else h+=C,f.next()}return h}function nt(f){D(f);let h="",C="";for(;h=ie(f);)C+=h;return f.currentChar()===Bt&&d(q.UNTERMINATED_CLOSING_BRACE,i(),0),C}function Re(f){D(f);let h="";return f.currentChar()==="-"?(f.next(),h+=`-${Se(f)}`):h+=Se(f),f.currentChar()===Bt&&d(q.UNTERMINATED_CLOSING_BRACE,i(),0),h}function I(f){return f!==so&&f!==Ye}function G(f){D(f),N(f,"'");let h="",C="";for(;h=_e(f,I);)h==="\\"?C+=$(f):C+=h;const w=f.currentChar();return w===Ye||w===Bt?(d(q.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),w===Ye&&(f.next(),N(f,"'")),C):(N(f,"'"),C)}function $(f){const h=f.currentChar();switch(h){case"\\":case"'":return f.next(),`\\${h}`;case"u":return K(f,h,4);case"U":return K(f,h,6);default:return d(q.UNKNOWN_ESCAPE_SEQUENCE,i(),0,h),""}}function K(f,h,C){N(f,h);let w="";for(let j=0;j{const w=f.currentChar();return w==="{"||w==="%"||w==="@"||w==="|"||w==="("||w===")"||!w||w===Lt?C:(C+=w,f.next(),h(C))};return h("")}function T(f){D(f);const h=N(f,"|");return D(f),h}function O(f,h){let C=null;switch(f.currentChar()){case"{":return h.braceNest>=1&&d(q.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),f.next(),C=g(h,2,"{"),D(f),h.braceNest++,C;case"}":return h.braceNest>0&&h.currentType===2&&d(q.EMPTY_PLACEHOLDER,i(),0),f.next(),C=g(h,3,"}"),h.braceNest--,h.braceNest>0&&D(f),h.inLinked&&h.braceNest===0&&(h.inLinked=!1),C;case"@":return h.braceNest>0&&d(q.UNTERMINATED_CLOSING_BRACE,i(),0),C=P(f,h)||v(h),h.braceNest=0,C;default:{let j=!0,M=!0,E=!0;if(ae(f))return h.braceNest>0&&d(q.UNTERMINATED_CLOSING_BRACE,i(),0),C=g(h,1,T(f)),h.braceNest=0,h.inLinked=!1,C;if(h.braceNest>0&&(h.currentType===5||h.currentType===6||h.currentType===7))return d(q.UNTERMINATED_CLOSING_BRACE,i(),0),h.braceNest=0,H(f,h);if(j=b(f,h))return C=g(h,5,nt(f)),D(f),C;if(M=y(f,h))return C=g(h,6,Re(f)),D(f),C;if(E=L(f,h))return C=g(h,7,G(f)),D(f),C;if(!j&&!M&&!E)return C=g(h,13,m(f)),d(q.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,C.value),D(f),C;break}}return C}function P(f,h){const{currentType:C}=h;let w=null;const j=f.currentChar();switch((C===8||C===9||C===12||C===10)&&(j===Ye||j===Lt)&&d(q.INVALID_LINKED_FORMAT,i(),0),j){case"@":return f.next(),w=g(h,8,"@"),h.inLinked=!0,w;case".":return D(f),f.next(),g(h,9,".");case":":return D(f),f.next(),g(h,10,":");default:return ae(f)?(w=g(h,1,T(f)),h.braceNest=0,h.inLinked=!1,w):x(f,h)||B(f,h)?(D(f),P(f,h)):F(f,h)?(D(f),g(h,12,_(f))):W(f,h)?(D(f),j==="{"?O(f,h)||w:g(h,11,p(f))):(C===8&&d(q.INVALID_LINKED_FORMAT,i(),0),h.braceNest=0,h.inLinked=!1,H(f,h))}}function H(f,h){let C={type:14};if(h.braceNest>0)return O(f,h)||v(h);if(h.inLinked)return P(f,h)||v(h);switch(f.currentChar()){case"{":return O(f,h)||v(h);case"}":return d(q.UNBALANCED_CLOSING_BRACE,i(),0),f.next(),g(h,3,"}");case"@":return P(f,h)||v(h);default:{if(ae(f))return C=g(h,1,T(f)),h.braceNest=0,h.inLinked=!1,C;const{isModulo:j,hasSpace:M}=ke(f);if(j)return M?g(h,0,tt(f)):g(h,4,ct(f));if(Z(f))return g(h,0,tt(f));break}}return C}function U(){const{currentType:f,offset:h,startLoc:C,endLoc:w}=a;return a.lastType=f,a.lastOffset=h,a.lastStartLoc=C,a.lastEndLoc=w,a.offset=s(),a.startLoc=i(),r.currentChar()===Bt?g(a,14):H(r,a)}return{nextToken:U,currentOffset:s,currentPosition:i,context:c}}const eh="parser",th=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function nh(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(t||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function rh(e={}){const t=e.location!==!1,{onError:n,onWarn:r}=e;function s(b,y,L,x,...F){const B=b.currentPosition();if(B.offset+=x,B.column+=x,n){const W=t?Dr(L,B):null,ae=Ln(y,W,{domain:eh,args:F});n(ae)}}function i(b,y,L,x,...F){const B=b.currentPosition();if(B.offset+=x,B.column+=x,r){const W=t?Dr(L,B):null;r(Bf(y,W,F))}}function o(b,y,L){const x={type:b};return t&&(x.start=y,x.end=y,x.loc={start:L,end:L}),x}function l(b,y,L,x){t&&(b.end=y,b.loc&&(b.loc.end=L))}function a(b,y){const L=b.context(),x=o(3,L.offset,L.startLoc);return x.value=y,l(x,b.currentOffset(),b.currentPosition()),x}function c(b,y){const L=b.context(),{lastOffset:x,lastStartLoc:F}=L,B=o(5,x,F);return B.index=parseInt(y,10),b.nextToken(),l(B,b.currentOffset(),b.currentPosition()),B}function u(b,y,L){const x=b.context(),{lastOffset:F,lastStartLoc:B}=x,W=o(4,F,B);return W.key=y,L===!0&&(W.modulo=!0),b.nextToken(),l(W,b.currentOffset(),b.currentPosition()),W}function d(b,y){const L=b.context(),{lastOffset:x,lastStartLoc:F}=L,B=o(9,x,F);return B.value=y.replace(th,nh),b.nextToken(),l(B,b.currentOffset(),b.currentPosition()),B}function g(b){const y=b.nextToken(),L=b.context(),{lastOffset:x,lastStartLoc:F}=L,B=o(8,x,F);return y.type!==12?(s(b,q.UNEXPECTED_EMPTY_LINKED_MODIFIER,L.lastStartLoc,0),B.value="",l(B,x,F),{nextConsumeToken:y,node:B}):(y.value==null&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,L.lastStartLoc,0,dt(y)),B.value=y.value||"",l(B,b.currentOffset(),b.currentPosition()),{node:B})}function v(b,y){const L=b.context(),x=o(7,L.offset,L.startLoc);return x.value=y,l(x,b.currentOffset(),b.currentPosition()),x}function N(b){const y=b.context(),L=o(6,y.offset,y.startLoc);let x=b.nextToken();if(x.type===9){const F=g(b);L.modifier=F.node,x=F.nextConsumeToken||b.nextToken()}switch(x.type!==10&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,dt(x)),x=b.nextToken(),x.type===2&&(x=b.nextToken()),x.type){case 11:x.value==null&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,dt(x)),L.key=v(b,x.value||"");break;case 5:x.value==null&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,dt(x)),L.key=u(b,x.value||"");break;case 6:x.value==null&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,dt(x)),L.key=c(b,x.value||"");break;case 7:x.value==null&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,dt(x)),L.key=d(b,x.value||"");break;default:{s(b,q.UNEXPECTED_EMPTY_LINKED_KEY,y.lastStartLoc,0);const F=b.context(),B=o(7,F.offset,F.startLoc);return B.value="",l(B,F.offset,F.startLoc),L.key=B,l(L,F.offset,F.startLoc),{nextConsumeToken:x,node:L}}}return l(L,b.currentOffset(),b.currentPosition()),{node:L}}function k(b){const y=b.context(),L=y.currentType===1?b.currentOffset():y.offset,x=y.currentType===1?y.endLoc:y.startLoc,F=o(2,L,x);F.items=[];let B=null,W=null;do{const Z=B||b.nextToken();switch(B=null,Z.type){case 0:Z.value==null&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,dt(Z)),F.items.push(a(b,Z.value||""));break;case 6:Z.value==null&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,dt(Z)),F.items.push(c(b,Z.value||""));break;case 4:W=!0;break;case 5:Z.value==null&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,dt(Z)),F.items.push(u(b,Z.value||"",!!W)),W&&(i(b,ci.USE_MODULO_SYNTAX,y.lastStartLoc,0,dt(Z)),W=null);break;case 7:Z.value==null&&s(b,q.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,dt(Z)),F.items.push(d(b,Z.value||""));break;case 8:{const _e=N(b);F.items.push(_e.node),B=_e.nextConsumeToken||null;break}}}while(y.currentType!==14&&y.currentType!==1);const ae=y.currentType===1?y.lastOffset:b.currentOffset(),ke=y.currentType===1?y.lastEndLoc:b.currentPosition();return l(F,ae,ke),F}function D(b,y,L,x){const F=b.context();let B=x.items.length===0;const W=o(1,y,L);W.cases=[],W.cases.push(x);do{const ae=k(b);B||(B=ae.items.length===0),W.cases.push(ae)}while(F.currentType!==14);return B&&s(b,q.MUST_HAVE_MESSAGES_IN_PLURAL,L,0),l(W,b.currentOffset(),b.currentPosition()),W}function A(b){const y=b.context(),{offset:L,startLoc:x}=y,F=k(b);return y.currentType===14?F:D(b,L,x,F)}function R(b){const y=Zf(b,pa({},e)),L=y.context(),x=o(0,L.offset,L.startLoc);return t&&x.loc&&(x.loc.source=b),x.body=A(y),e.onCacheKey&&(x.cacheKey=e.onCacheKey(b)),L.currentType!==14&&s(y,q.UNEXPECTED_LEXICAL_ANALYSIS,L.lastStartLoc,0,b[L.offset]||""),l(x,y.currentOffset(),y.currentPosition()),x}return{parse:R}}function dt(e){if(e.type===14)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function sh(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function io(e,t){for(let n=0;noo(n)),e}function oo(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;no;function a(k,D){o.code+=k}function c(k,D=!0){const A=D?r:"";a(s?A+" ".repeat(k):A)}function u(k=!0){const D=++o.indentLevel;k&&c(D)}function d(k=!0){const D=--o.indentLevel;k&&c(D)}function g(){c(o.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:g,helper:k=>`_${k}`,needIndent:()=>o.needIndent}}function uh(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Pn(e,t.key),t.modifier?(e.push(", "),Pn(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function fh(e,t){const{helper:n,needIndent:r}=e;e.push(`${n("normalize")}([`),e.indent(r());const s=t.items.length;for(let i=0;i1){e.push(`${n("plural")}([`),e.indent(r());const s=t.cases.length;for(let i=0;i{const n=ro(t.mode)?t.mode:"normal",r=ro(t.filename)?t.filename:"message.intl";t.sourceMap;const s=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":` `,i=t.needIndent?t.needIndent:n!=="arrow",o=e.helpers||[],l=ch(e,{filename:r,breakLineCode:s,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),o.length>0&&(l.push(`const { ${_a(o.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),Pn(l,e),l.deindent(i),l.push("}"),delete e.helpers;const{code:a,map:c}=l.context();return{ast:e,code:a,map:c?c.toJSON():void 0}};function gh(e,t={}){const n=pa({},t),r=!!n.jit,s=!!n.minify,i=n.optimize==null?!0:n.optimize,l=rh(n).parse(e);return r?(i&&oh(l),s&&pn(l),{ast:l,code:""}):(ih(l,n),mh(l,n))}/*! * core-base v9.14.5 * (c) 2025 kazuya kawaguchi * Released under the MIT License. - */function ph(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Wt().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(Wt().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Wt().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Pt(e){return le(e)&&fi(e)===0&&(mt(e,"b")||mt(e,"body"))}const va=["b","body"];function _h(e){return Qt(e,va)}const ba=["c","cases"];function vh(e){return Qt(e,ba,[])}const ya=["s","static"];function bh(e){return Qt(e,ya)}const Ea=["i","items"];function yh(e){return Qt(e,Ea,[])}const Ca=["t","type"];function fi(e){return Qt(e,Ca)}const Ta=["v","value"];function mr(e,t){const n=Qt(e,Ta);if(n!=null)return n;throw Qn(t)}const ka=["m","modifier"];function Eh(e){return Qt(e,ka)}const wa=["k","key"];function Ch(e){const t=Qt(e,wa);if(t)return t;throw Qn(6)}function Qt(e,t,n){for(let r=0;r{o===void 0?o=l:o+=l},g[1]=()=>{o!==void 0&&(t.push(o),o=void 0)},g[2]=()=>{g[0](),s++},g[3]=()=>{if(s>0)s--,r=4,g[0]();else{if(s=0,o===void 0||(o=Nh(o),o===!1))return!1;g[1]()}};function v(){const x=e[n+1];if(r===5&&x==="'"||r===6&&x==='"')return n++,l="\\"+x,g[0](),!0}for(;r!==null;)if(n++,i=e[n],!(i==="\\"&&v())){if(a=Sh(i),h=Zt[r],c=h[a]||h.l||8,c===8||(r=c[0],c[1]!==void 0&&(u=g[c[1]],u&&(l=i,u()===!1))))return;if(r===7)return t}}const lo=new Map;function xh(e,t){return le(e)?e[t]:null}function Ih(e,t){if(!le(e))return null;let n=lo.get(t);if(n||(n=Ph(t),n&&lo.set(t,n)),!n)return null;const r=n.length;let s=e,i=0;for(;ie,Lh=e=>"",Ah="text",Rh=e=>e.length===0?"":Wf(e),Dh=Uf;function ao(e,t){return e=Math.abs(e),t===2?e?e>1?1:0:1:e?Math.min(e,2):0}function Fh(e){const t=xe(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(xe(e.named.count)||xe(e.named.n))?xe(e.named.count)?e.named.count:xe(e.named.n)?e.named.n:t:t}function Mh(e,t){t.count||(t.count=e),t.n||(t.n=e)}function Uh(e={}){const t=e.locale,n=Fh(e),r=le(e.pluralRules)&&V(t)&&Ce(e.pluralRules[t])?e.pluralRules[t]:ao,s=le(e.pluralRules)&&V(t)&&Ce(e.pluralRules[t])?ao:void 0,i=A=>A[r(n,A.length,s)],o=e.list||[],l=A=>o[A],a=e.named||pe();xe(e.pluralIndex)&&Mh(n,a);const c=A=>a[A];function u(A){const R=Ce(e.messages)?e.messages(A):le(e.messages)?e.messages[A]:!1;return R||(e.parent?e.parent.message(A):Lh)}const h=A=>e.modifiers?e.modifiers[A]:Oh,g=Q(e.processor)&&Ce(e.processor.normalize)?e.processor.normalize:Rh,v=Q(e.processor)&&Ce(e.processor.interpolate)?e.processor.interpolate:Dh,x=Q(e.processor)&&V(e.processor.type)?e.processor.type:Ah,D={list:l,named:c,plural:i,linked:(A,...R)=>{const[b,y]=R;let L="text",P="";R.length===1?le(b)?(P=b.modifier||P,L=b.type||L):V(b)&&(P=b||P):R.length===2&&(V(b)&&(P=b||P),V(y)&&(L=y||L));const F=u(A)(D),B=L==="vnode"&&Te(F)&&P?F[0]:F;return P?h(P)(B,L):B},message:u,type:x,interpolate:v,normalize:g,values:We(pe(),o,a)};return D}let Zn=null;function Wh(e){Zn=e}function Hh(e,t,n){Zn&&Zn.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const jh=$h("function:translate");function $h(e){return t=>Zn&&Zn.emit(e,t)}const Vh=ci.__EXTEND_POINT__,rn=Zr(Vh),Bh={FALLBACK_TO_TRANSLATE:rn(),CANNOT_FORMAT_NUMBER:rn(),FALLBACK_TO_NUMBER_FORMAT:rn(),CANNOT_FORMAT_DATE:rn(),FALLBACK_TO_DATE_FORMAT:rn(),EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:rn(),__EXTEND_POINT__:rn()},Na=q.__EXTEND_POINT__,sn=Zr(Na),gt={INVALID_ARGUMENT:Na,INVALID_DATE_ARGUMENT:sn(),INVALID_ISO_DATE_ARGUMENT:sn(),NOT_SUPPORT_NON_STRING_MESSAGE:sn(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:sn(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:sn(),NOT_SUPPORT_LOCALE_TYPE:sn(),__EXTEND_POINT__:sn()};function wt(e){return Ln(e,null,void 0)}function hi(e,t){return t.locale!=null?co(t.locale):co(e.locale)}let ms;function co(e){if(V(e))return e;if(Ce(e)){if(e.resolvedOnce&&ms!=null)return ms;if(e.constructor.name==="Function"){const t=e();if(Mf(t))throw wt(gt.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return ms=t}else throw wt(gt.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw wt(gt.NOT_SUPPORT_LOCALE_TYPE)}function Gh(e,t,n){return[...new Set([n,...Te(t)?t:le(t)?Object.keys(t):V(t)?[t]:[n]])]}function Pa(e,t,n){const r=V(n)?n:xn,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(r);if(!i){i=[];let o=[n];for(;Te(o);)o=uo(i,o,t);const l=Te(t)||!Q(t)?t:t.default?t.default:null;o=V(l)?[l]:l,Te(o)&&uo(i,o,!1),s.__localeChainCache.set(r,i)}return i}function uo(e,t,n){let r=!0;for(let s=0;s`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function zh(){return{upper:(e,t)=>t==="text"&&V(e)?e.toUpperCase():t==="vnode"&&le(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&V(e)?e.toLowerCase():t==="vnode"&&le(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&V(e)?ho(e):t==="vnode"&&le(e)&&"__v_isVNode"in e?ho(e.children):e}}let xa;function mo(e){xa=e}let Ia;function qh(e){Ia=e}let Oa;function Jh(e){Oa=e}let La=null;const Qh=e=>{La=e},Zh=()=>La;let Aa=null;const go=e=>{Aa=e},ed=()=>Aa;let po=0;function td(e={}){const t=Ce(e.onWarn)?e.onWarn:If,n=V(e.version)?e.version:Xh,r=V(e.locale)||Ce(e.locale)?e.locale:xn,s=Ce(r)?xn:r,i=Te(e.fallbackLocale)||Q(e.fallbackLocale)||V(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,o=Q(e.messages)?e.messages:gs(s),l=Q(e.datetimeFormats)?e.datetimeFormats:gs(s),a=Q(e.numberFormats)?e.numberFormats:gs(s),c=We(pe(),e.modifiers,zh()),u=e.pluralRules||pe(),h=Ce(e.missing)?e.missing:null,g=re(e.missingWarn)||qt(e.missingWarn)?e.missingWarn:!0,v=re(e.fallbackWarn)||qt(e.fallbackWarn)?e.fallbackWarn:!0,x=!!e.fallbackFormat,k=!!e.unresolving,D=Ce(e.postTranslation)?e.postTranslation:null,A=Q(e.processor)?e.processor:null,R=re(e.warnHtmlMessage)?e.warnHtmlMessage:!0,b=!!e.escapeParameter,y=Ce(e.messageCompiler)?e.messageCompiler:xa,L=Ce(e.messageResolver)?e.messageResolver:Ia||xh,P=Ce(e.localeFallbacker)?e.localeFallbacker:Oa||Gh,F=le(e.fallbackContext)?e.fallbackContext:void 0,B=e,W=le(B.__datetimeFormatters)?B.__datetimeFormatters:new Map,ae=le(B.__numberFormatters)?B.__numberFormatters:new Map,ke=le(B.__meta)?B.__meta:{};po++;const Z={version:n,cid:po,locale:r,fallbackLocale:i,messages:o,modifiers:c,pluralRules:u,missing:h,missingWarn:g,fallbackWarn:v,fallbackFormat:x,unresolving:k,postTranslation:D,processor:A,warnHtmlMessage:R,escapeParameter:b,messageCompiler:y,messageResolver:L,localeFallbacker:P,fallbackContext:F,onWarn:t,__meta:ke};return Z.datetimeFormats=l,Z.numberFormats=a,Z.__datetimeFormatters=W,Z.__numberFormatters=ae,__INTLIFY_PROD_DEVTOOLS__&&Hh(Z,n,ke),Z}const gs=e=>({[e]:pe()});function di(e,t,n,r,s){const{missing:i,onWarn:o}=e;if(i!==null){const l=i(e,n,t,s);return V(l)?l:t}else return t}function Dn(e,t,n){const r=e;r.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function nd(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function rd(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let r=n+1;rsd(n,e)}function sd(e,t){const n=_h(t);if(n==null)throw Qn(0);if(fi(n)===1){const i=vh(n);return e.plural(i.reduce((o,l)=>[...o,_o(e,l)],[]))}else return _o(e,n)}function _o(e,t){const n=bh(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const r=yh(t).reduce((s,i)=>[...s,Ls(e,i)],[]);return e.normalize(r)}}function Ls(e,t){const n=fi(t);switch(n){case 3:return mr(t,n);case 9:return mr(t,n);case 4:{const r=t;if(mt(r,"k")&&r.k)return e.interpolate(e.named(r.k));if(mt(r,"key")&&r.key)return e.interpolate(e.named(r.key));throw Qn(n)}case 5:{const r=t;if(mt(r,"i")&&xe(r.i))return e.interpolate(e.list(r.i));if(mt(r,"index")&&xe(r.index))return e.interpolate(e.list(r.index));throw Qn(n)}case 6:{const r=t,s=Eh(r),i=Ch(r);return e.linked(Ls(e,i),s?Ls(e,s):void 0,e.type)}case 7:return mr(t,n);case 8:return mr(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const Ra=e=>e;let vn=pe();function Da(e,t={}){let n=!1;const r=t.onError||Kf;return t.onError=s=>{n=!0,r(s)},{...gh(e,t),detectError:n}}const id=(e,t)=>{if(!V(e))throw wt(gt.NOT_SUPPORT_NON_STRING_MESSAGE);{re(t.warnHtmlMessage)&&t.warnHtmlMessage;const r=(t.onCacheKey||Ra)(e),s=vn[r];if(s)return s;const{code:i,detectError:o}=Da(e,t),l=new Function(`return ${i}`)();return o?l:vn[r]=l}};function od(e,t){if(__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&V(e)){re(t.warnHtmlMessage)&&t.warnHtmlMessage;const r=(t.onCacheKey||Ra)(e),s=vn[r];if(s)return s;const{ast:i,detectError:o}=Da(e,{...t,location:!1,jit:!0}),l=ps(i);return o?l:vn[r]=l}else{const n=e.cacheKey;if(n){const r=vn[n];return r||(vn[n]=ps(e))}else return ps(e)}}const vo=()=>"",ut=e=>Ce(e);function bo(e,...t){const{fallbackFormat:n,postTranslation:r,unresolving:s,messageCompiler:i,fallbackLocale:o,messages:l}=e,[a,c]=As(...t),u=re(c.missingWarn)?c.missingWarn:e.missingWarn,h=re(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,g=re(c.escapeParameter)?c.escapeParameter:e.escapeParameter,v=!!c.resolvedMessage,x=V(c.default)||re(c.default)?re(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:"",k=n||x!=="",D=hi(e,c);g&&ld(c);let[A,R,b]=v?[a,D,l[D]||pe()]:Fa(e,a,D,o,h,u),y=A,L=a;if(!v&&!(V(y)||Pt(y)||ut(y))&&k&&(y=x,L=y),!v&&(!(V(y)||Pt(y)||ut(y))||!V(R)))return s?es:a;let P=!1;const F=()=>{P=!0},B=ut(y)?y:Ma(e,a,R,y,L,F);if(P)return y;const W=ud(e,R,b,c),ae=Uh(W),ke=ad(e,B,ae);let Z=r?r(ke,a):ke;if(g&&V(Z)&&(Z=Df(Z)),__INTLIFY_PROD_DEVTOOLS__){const _e={timestamp:Date.now(),key:V(a)?a:ut(y)?y.key:"",locale:R||(ut(y)?y.locale:""),format:V(y)?y:ut(y)?y.source:"",message:Z};_e.meta=We({},e.__meta,Zh()||{}),jh(_e)}return Z}function ld(e){Te(e.list)?e.list=e.list.map(t=>V(t)?to(t):t):le(e.named)&&Object.keys(e.named).forEach(t=>{V(e.named[t])&&(e.named[t]=to(e.named[t]))})}function Fa(e,t,n,r,s,i){const{messages:o,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,r,n);let h=pe(),g,v=null;const x="translate";for(let k=0;kr;return c.locale=n,c.key=t,c}const a=o(r,cd(e,n,s,r,l,i));return a.locale=n,a.key=t,a.source=r,a}function ad(e,t,n){return t(n)}function As(...e){const[t,n,r]=e,s=pe();if(!V(t)&&!xe(t)&&!ut(t)&&!Pt(t))throw wt(gt.INVALID_ARGUMENT);const i=xe(t)?String(t):(ut(t),t);return xe(n)?s.plural=n:V(n)?s.default=n:Q(n)&&!Qr(n)?s.named=n:Te(n)&&(s.list=n),xe(r)?s.plural=r:V(r)?s.default=r:Q(r)&&We(s,r),[i,s]}function cd(e,t,n,r,s,i){return{locale:t,key:n,warnHtmlMessage:s,onError:o=>{throw i&&i(o),o},onCacheKey:o=>Of(t,n,o)}}function ud(e,t,n,r){const{modifiers:s,pluralRules:i,messageResolver:o,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,g={locale:t,modifiers:s,pluralRules:i,messages:v=>{let x=o(n,v);if(x==null&&u){const[,,k]=Fa(u,v,t,l,a,c);x=o(k,v)}if(V(x)||Pt(x)){let k=!1;const A=Ma(e,v,t,x,v,()=>{k=!0});return k?vo:A}else return ut(x)?x:vo}};return e.processor&&(g.processor=e.processor),r.list&&(g.list=r.list),r.named&&(g.named=r.named),xe(r.plural)&&(g.pluralIndex=r.plural),g}function yo(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:s,onWarn:i,localeFallbacker:o}=e,{__datetimeFormatters:l}=e,[a,c,u,h]=Rs(...t),g=re(u.missingWarn)?u.missingWarn:e.missingWarn;re(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const v=!!u.part,x=hi(e,u),k=o(e,s,x);if(!V(a)||a==="")return new Intl.DateTimeFormat(x,h).format(c);let D={},A,R=null;const b="datetime format";for(let P=0;P{Ua.includes(a)?o[a]=n[a]:i[a]=n[a]}),V(r)?i.locale=r:Q(r)&&(o=r),Q(s)&&(o=s),[i.key||"",l,i,o]}function Eo(e,t,n){const r=e;for(const s in n){const i=`${t}__${s}`;r.__datetimeFormatters.has(i)&&r.__datetimeFormatters.delete(i)}}function Co(e,...t){const{numberFormats:n,unresolving:r,fallbackLocale:s,onWarn:i,localeFallbacker:o}=e,{__numberFormatters:l}=e,[a,c,u,h]=Ds(...t),g=re(u.missingWarn)?u.missingWarn:e.missingWarn;re(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const v=!!u.part,x=hi(e,u),k=o(e,s,x);if(!V(a)||a==="")return new Intl.NumberFormat(x,h).format(c);let D={},A,R=null;const b="number format";for(let P=0;P{Wa.includes(a)?o[a]=n[a]:i[a]=n[a]}),V(r)?i.locale=r:Q(r)&&(o=r),Q(s)&&(o=s),[i.key||"",l,i,o]}function To(e,t,n){const r=e;for(const s in n){const i=`${t}__${s}`;r.__numberFormatters.has(i)&&r.__numberFormatters.delete(i)}}ph();/*! + */function ph(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Wt().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(Wt().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Wt().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Pt(e){return le(e)&&fi(e)===0&&(mt(e,"b")||mt(e,"body"))}const va=["b","body"];function _h(e){return Qt(e,va)}const ba=["c","cases"];function vh(e){return Qt(e,ba,[])}const ya=["s","static"];function bh(e){return Qt(e,ya)}const Ea=["i","items"];function yh(e){return Qt(e,Ea,[])}const Ca=["t","type"];function fi(e){return Qt(e,Ca)}const Ta=["v","value"];function mr(e,t){const n=Qt(e,Ta);if(n!=null)return n;throw Qn(t)}const ka=["m","modifier"];function Eh(e){return Qt(e,ka)}const wa=["k","key"];function Ch(e){const t=Qt(e,wa);if(t)return t;throw Qn(6)}function Qt(e,t,n){for(let r=0;r{o===void 0?o=l:o+=l},g[1]=()=>{o!==void 0&&(t.push(o),o=void 0)},g[2]=()=>{g[0](),s++},g[3]=()=>{if(s>0)s--,r=4,g[0]();else{if(s=0,o===void 0||(o=Nh(o),o===!1))return!1;g[1]()}};function v(){const N=e[n+1];if(r===5&&N==="'"||r===6&&N==='"')return n++,l="\\"+N,g[0](),!0}for(;r!==null;)if(n++,i=e[n],!(i==="\\"&&v())){if(a=Sh(i),d=Zt[r],c=d[a]||d.l||8,c===8||(r=c[0],c[1]!==void 0&&(u=g[c[1]],u&&(l=i,u()===!1))))return;if(r===7)return t}}const lo=new Map;function xh(e,t){return le(e)?e[t]:null}function Ih(e,t){if(!le(e))return null;let n=lo.get(t);if(n||(n=Ph(t),n&&lo.set(t,n)),!n)return null;const r=n.length;let s=e,i=0;for(;ie,Lh=e=>"",Ah="text",Rh=e=>e.length===0?"":Wf(e),Dh=Uf;function ao(e,t){return e=Math.abs(e),t===2?e?e>1?1:0:1:e?Math.min(e,2):0}function Fh(e){const t=xe(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(xe(e.named.count)||xe(e.named.n))?xe(e.named.count)?e.named.count:xe(e.named.n)?e.named.n:t:t}function Mh(e,t){t.count||(t.count=e),t.n||(t.n=e)}function Uh(e={}){const t=e.locale,n=Fh(e),r=le(e.pluralRules)&&V(t)&&Ce(e.pluralRules[t])?e.pluralRules[t]:ao,s=le(e.pluralRules)&&V(t)&&Ce(e.pluralRules[t])?ao:void 0,i=A=>A[r(n,A.length,s)],o=e.list||[],l=A=>o[A],a=e.named||pe();xe(e.pluralIndex)&&Mh(n,a);const c=A=>a[A];function u(A){const R=Ce(e.messages)?e.messages(A):le(e.messages)?e.messages[A]:!1;return R||(e.parent?e.parent.message(A):Lh)}const d=A=>e.modifiers?e.modifiers[A]:Oh,g=Q(e.processor)&&Ce(e.processor.normalize)?e.processor.normalize:Rh,v=Q(e.processor)&&Ce(e.processor.interpolate)?e.processor.interpolate:Dh,N=Q(e.processor)&&V(e.processor.type)?e.processor.type:Ah,D={list:l,named:c,plural:i,linked:(A,...R)=>{const[b,y]=R;let L="text",x="";R.length===1?le(b)?(x=b.modifier||x,L=b.type||L):V(b)&&(x=b||x):R.length===2&&(V(b)&&(x=b||x),V(y)&&(L=y||L));const F=u(A)(D),B=L==="vnode"&&Te(F)&&x?F[0]:F;return x?d(x)(B,L):B},message:u,type:N,interpolate:v,normalize:g,values:We(pe(),o,a)};return D}let Zn=null;function Wh(e){Zn=e}function Hh(e,t,n){Zn&&Zn.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const jh=$h("function:translate");function $h(e){return t=>Zn&&Zn.emit(e,t)}const Vh=ci.__EXTEND_POINT__,rn=Zr(Vh),Bh={FALLBACK_TO_TRANSLATE:rn(),CANNOT_FORMAT_NUMBER:rn(),FALLBACK_TO_NUMBER_FORMAT:rn(),CANNOT_FORMAT_DATE:rn(),FALLBACK_TO_DATE_FORMAT:rn(),EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:rn(),__EXTEND_POINT__:rn()},Na=q.__EXTEND_POINT__,sn=Zr(Na),gt={INVALID_ARGUMENT:Na,INVALID_DATE_ARGUMENT:sn(),INVALID_ISO_DATE_ARGUMENT:sn(),NOT_SUPPORT_NON_STRING_MESSAGE:sn(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:sn(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:sn(),NOT_SUPPORT_LOCALE_TYPE:sn(),__EXTEND_POINT__:sn()};function wt(e){return Ln(e,null,void 0)}function hi(e,t){return t.locale!=null?co(t.locale):co(e.locale)}let ms;function co(e){if(V(e))return e;if(Ce(e)){if(e.resolvedOnce&&ms!=null)return ms;if(e.constructor.name==="Function"){const t=e();if(Mf(t))throw wt(gt.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return ms=t}else throw wt(gt.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw wt(gt.NOT_SUPPORT_LOCALE_TYPE)}function Gh(e,t,n){return[...new Set([n,...Te(t)?t:le(t)?Object.keys(t):V(t)?[t]:[n]])]}function Pa(e,t,n){const r=V(n)?n:xn,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(r);if(!i){i=[];let o=[n];for(;Te(o);)o=uo(i,o,t);const l=Te(t)||!Q(t)?t:t.default?t.default:null;o=V(l)?[l]:l,Te(o)&&uo(i,o,!1),s.__localeChainCache.set(r,i)}return i}function uo(e,t,n){let r=!0;for(let s=0;s`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function zh(){return{upper:(e,t)=>t==="text"&&V(e)?e.toUpperCase():t==="vnode"&&le(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&V(e)?e.toLowerCase():t==="vnode"&&le(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&V(e)?ho(e):t==="vnode"&&le(e)&&"__v_isVNode"in e?ho(e.children):e}}let xa;function mo(e){xa=e}let Ia;function qh(e){Ia=e}let Oa;function Jh(e){Oa=e}let La=null;const Qh=e=>{La=e},Zh=()=>La;let Aa=null;const go=e=>{Aa=e},ed=()=>Aa;let po=0;function td(e={}){const t=Ce(e.onWarn)?e.onWarn:If,n=V(e.version)?e.version:Xh,r=V(e.locale)||Ce(e.locale)?e.locale:xn,s=Ce(r)?xn:r,i=Te(e.fallbackLocale)||Q(e.fallbackLocale)||V(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,o=Q(e.messages)?e.messages:gs(s),l=Q(e.datetimeFormats)?e.datetimeFormats:gs(s),a=Q(e.numberFormats)?e.numberFormats:gs(s),c=We(pe(),e.modifiers,zh()),u=e.pluralRules||pe(),d=Ce(e.missing)?e.missing:null,g=re(e.missingWarn)||qt(e.missingWarn)?e.missingWarn:!0,v=re(e.fallbackWarn)||qt(e.fallbackWarn)?e.fallbackWarn:!0,N=!!e.fallbackFormat,k=!!e.unresolving,D=Ce(e.postTranslation)?e.postTranslation:null,A=Q(e.processor)?e.processor:null,R=re(e.warnHtmlMessage)?e.warnHtmlMessage:!0,b=!!e.escapeParameter,y=Ce(e.messageCompiler)?e.messageCompiler:xa,L=Ce(e.messageResolver)?e.messageResolver:Ia||xh,x=Ce(e.localeFallbacker)?e.localeFallbacker:Oa||Gh,F=le(e.fallbackContext)?e.fallbackContext:void 0,B=e,W=le(B.__datetimeFormatters)?B.__datetimeFormatters:new Map,ae=le(B.__numberFormatters)?B.__numberFormatters:new Map,ke=le(B.__meta)?B.__meta:{};po++;const Z={version:n,cid:po,locale:r,fallbackLocale:i,messages:o,modifiers:c,pluralRules:u,missing:d,missingWarn:g,fallbackWarn:v,fallbackFormat:N,unresolving:k,postTranslation:D,processor:A,warnHtmlMessage:R,escapeParameter:b,messageCompiler:y,messageResolver:L,localeFallbacker:x,fallbackContext:F,onWarn:t,__meta:ke};return Z.datetimeFormats=l,Z.numberFormats=a,Z.__datetimeFormatters=W,Z.__numberFormatters=ae,__INTLIFY_PROD_DEVTOOLS__&&Hh(Z,n,ke),Z}const gs=e=>({[e]:pe()});function di(e,t,n,r,s){const{missing:i,onWarn:o}=e;if(i!==null){const l=i(e,n,t,s);return V(l)?l:t}else return t}function Dn(e,t,n){const r=e;r.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function nd(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function rd(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let r=n+1;rsd(n,e)}function sd(e,t){const n=_h(t);if(n==null)throw Qn(0);if(fi(n)===1){const i=vh(n);return e.plural(i.reduce((o,l)=>[...o,_o(e,l)],[]))}else return _o(e,n)}function _o(e,t){const n=bh(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const r=yh(t).reduce((s,i)=>[...s,Ls(e,i)],[]);return e.normalize(r)}}function Ls(e,t){const n=fi(t);switch(n){case 3:return mr(t,n);case 9:return mr(t,n);case 4:{const r=t;if(mt(r,"k")&&r.k)return e.interpolate(e.named(r.k));if(mt(r,"key")&&r.key)return e.interpolate(e.named(r.key));throw Qn(n)}case 5:{const r=t;if(mt(r,"i")&&xe(r.i))return e.interpolate(e.list(r.i));if(mt(r,"index")&&xe(r.index))return e.interpolate(e.list(r.index));throw Qn(n)}case 6:{const r=t,s=Eh(r),i=Ch(r);return e.linked(Ls(e,i),s?Ls(e,s):void 0,e.type)}case 7:return mr(t,n);case 8:return mr(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const Ra=e=>e;let vn=pe();function Da(e,t={}){let n=!1;const r=t.onError||Kf;return t.onError=s=>{n=!0,r(s)},{...gh(e,t),detectError:n}}const id=(e,t)=>{if(!V(e))throw wt(gt.NOT_SUPPORT_NON_STRING_MESSAGE);{re(t.warnHtmlMessage)&&t.warnHtmlMessage;const r=(t.onCacheKey||Ra)(e),s=vn[r];if(s)return s;const{code:i,detectError:o}=Da(e,t),l=new Function(`return ${i}`)();return o?l:vn[r]=l}};function od(e,t){if(__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&V(e)){re(t.warnHtmlMessage)&&t.warnHtmlMessage;const r=(t.onCacheKey||Ra)(e),s=vn[r];if(s)return s;const{ast:i,detectError:o}=Da(e,{...t,location:!1,jit:!0}),l=ps(i);return o?l:vn[r]=l}else{const n=e.cacheKey;if(n){const r=vn[n];return r||(vn[n]=ps(e))}else return ps(e)}}const vo=()=>"",ut=e=>Ce(e);function bo(e,...t){const{fallbackFormat:n,postTranslation:r,unresolving:s,messageCompiler:i,fallbackLocale:o,messages:l}=e,[a,c]=As(...t),u=re(c.missingWarn)?c.missingWarn:e.missingWarn,d=re(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,g=re(c.escapeParameter)?c.escapeParameter:e.escapeParameter,v=!!c.resolvedMessage,N=V(c.default)||re(c.default)?re(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:"",k=n||N!=="",D=hi(e,c);g&&ld(c);let[A,R,b]=v?[a,D,l[D]||pe()]:Fa(e,a,D,o,d,u),y=A,L=a;if(!v&&!(V(y)||Pt(y)||ut(y))&&k&&(y=N,L=y),!v&&(!(V(y)||Pt(y)||ut(y))||!V(R)))return s?es:a;let x=!1;const F=()=>{x=!0},B=ut(y)?y:Ma(e,a,R,y,L,F);if(x)return y;const W=ud(e,R,b,c),ae=Uh(W),ke=ad(e,B,ae);let Z=r?r(ke,a):ke;if(g&&V(Z)&&(Z=Df(Z)),__INTLIFY_PROD_DEVTOOLS__){const _e={timestamp:Date.now(),key:V(a)?a:ut(y)?y.key:"",locale:R||(ut(y)?y.locale:""),format:V(y)?y:ut(y)?y.source:"",message:Z};_e.meta=We({},e.__meta,Zh()||{}),jh(_e)}return Z}function ld(e){Te(e.list)?e.list=e.list.map(t=>V(t)?to(t):t):le(e.named)&&Object.keys(e.named).forEach(t=>{V(e.named[t])&&(e.named[t]=to(e.named[t]))})}function Fa(e,t,n,r,s,i){const{messages:o,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,r,n);let d=pe(),g,v=null;const N="translate";for(let k=0;kr;return c.locale=n,c.key=t,c}const a=o(r,cd(e,n,s,r,l,i));return a.locale=n,a.key=t,a.source=r,a}function ad(e,t,n){return t(n)}function As(...e){const[t,n,r]=e,s=pe();if(!V(t)&&!xe(t)&&!ut(t)&&!Pt(t))throw wt(gt.INVALID_ARGUMENT);const i=xe(t)?String(t):(ut(t),t);return xe(n)?s.plural=n:V(n)?s.default=n:Q(n)&&!Qr(n)?s.named=n:Te(n)&&(s.list=n),xe(r)?s.plural=r:V(r)?s.default=r:Q(r)&&We(s,r),[i,s]}function cd(e,t,n,r,s,i){return{locale:t,key:n,warnHtmlMessage:s,onError:o=>{throw i&&i(o),o},onCacheKey:o=>Of(t,n,o)}}function ud(e,t,n,r){const{modifiers:s,pluralRules:i,messageResolver:o,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,g={locale:t,modifiers:s,pluralRules:i,messages:v=>{let N=o(n,v);if(N==null&&u){const[,,k]=Fa(u,v,t,l,a,c);N=o(k,v)}if(V(N)||Pt(N)){let k=!1;const A=Ma(e,v,t,N,v,()=>{k=!0});return k?vo:A}else return ut(N)?N:vo}};return e.processor&&(g.processor=e.processor),r.list&&(g.list=r.list),r.named&&(g.named=r.named),xe(r.plural)&&(g.pluralIndex=r.plural),g}function yo(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:s,onWarn:i,localeFallbacker:o}=e,{__datetimeFormatters:l}=e,[a,c,u,d]=Rs(...t),g=re(u.missingWarn)?u.missingWarn:e.missingWarn;re(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const v=!!u.part,N=hi(e,u),k=o(e,s,N);if(!V(a)||a==="")return new Intl.DateTimeFormat(N,d).format(c);let D={},A,R=null;const b="datetime format";for(let x=0;x{Ua.includes(a)?o[a]=n[a]:i[a]=n[a]}),V(r)?i.locale=r:Q(r)&&(o=r),Q(s)&&(o=s),[i.key||"",l,i,o]}function Eo(e,t,n){const r=e;for(const s in n){const i=`${t}__${s}`;r.__datetimeFormatters.has(i)&&r.__datetimeFormatters.delete(i)}}function Co(e,...t){const{numberFormats:n,unresolving:r,fallbackLocale:s,onWarn:i,localeFallbacker:o}=e,{__numberFormatters:l}=e,[a,c,u,d]=Ds(...t),g=re(u.missingWarn)?u.missingWarn:e.missingWarn;re(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const v=!!u.part,N=hi(e,u),k=o(e,s,N);if(!V(a)||a==="")return new Intl.NumberFormat(N,d).format(c);let D={},A,R=null;const b="number format";for(let x=0;x{Wa.includes(a)?o[a]=n[a]:i[a]=n[a]}),V(r)?i.locale=r:Q(r)&&(o=r),Q(s)&&(o=s),[i.key||"",l,i,o]}function To(e,t,n){const r=e;for(const s in n){const i=`${t}__${s}`;r.__numberFormatters.has(i)&&r.__numberFormatters.delete(i)}}ph();/*! * vue-i18n v9.14.5 * (c) 2025 kazuya kawaguchi * Released under the MIT License. - */const fd="9.14.5";function hd(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Wt().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Wt().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(Wt().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Wt().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Wt().__INTLIFY_PROD_DEVTOOLS__=!1)}const dd=Bh.__EXTEND_POINT__,At=Zr(dd);At(),At(),At(),At(),At(),At(),At(),At(),At();const Ha=gt.__EXTEND_POINT__,Qe=Zr(Ha),Ae={UNEXPECTED_RETURN_TYPE:Ha,INVALID_ARGUMENT:Qe(),MUST_BE_CALL_SETUP_TOP:Qe(),NOT_INSTALLED:Qe(),NOT_AVAILABLE_IN_LEGACY_MODE:Qe(),REQUIRED_VALUE:Qe(),INVALID_VALUE:Qe(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:Qe(),NOT_INSTALLED_WITH_PROVIDE:Qe(),UNEXPECTED_ERROR:Qe(),NOT_COMPATIBLE_LEGACY_VUE_I18N:Qe(),BRIDGE_SUPPORT_VUE_2_ONLY:Qe(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:Qe(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:Qe(),__EXTEND_POINT__:Qe()};function Fe(e,...t){return Ln(e,null,void 0)}const Fs=Jt("__translateVNode"),Ms=Jt("__datetimeParts"),Us=Jt("__numberParts"),ja=Jt("__setPluralRules"),$a=Jt("__injectWithOption"),Ws=Jt("__dispose");function er(e){if(!le(e)||Pt(e))return e;for(const t in e)if(mt(e,t))if(!t.includes("."))le(e[t])&&er(e[t]);else{const n=t.split("."),r=n.length-1;let s=e,i=!1;for(let o=0;o{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(o[a]=o[a]||pe(),Er(c,o[a])):Er(c,o)}else V(l)&&Er(JSON.parse(l),o)}),s==null&&i)for(const l in o)mt(o,l)&&er(o[l]);return o}function Va(e){return e.type}function Ba(e,t,n){let r=le(t.messages)?t.messages:pe();"__i18nGlobal"in n&&(r=ts(e.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const s=Object.keys(r);s.length&&s.forEach(i=>{e.mergeLocaleMessage(i,r[i])});{if(le(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(o=>{e.mergeDateTimeFormat(o,t.datetimeFormats[o])})}if(le(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(o=>{e.mergeNumberFormat(o,t.numberFormats[o])})}}}function ko(e){return Ee(lr,null,e,0)}const wo="__INTLIFY_META__",So=()=>[],md=()=>!1;let No=0;function Po(e){return(t,n,r,s)=>e(n,r,Nn()||void 0,s)}const gd=()=>{const e=Nn();let t=null;return e&&(t=Va(e)[wo])?{[wo]:t}:null};function mi(e={},t){const{__root:n,__injectWithOption:r}=e,s=n===void 0,i=e.flatJson,o=Rr?it:ni,l=!!e.translateExistCompatible;let a=re(e.inheritLocale)?e.inheritLocale:!0;const c=o(n&&a?n.locale.value:V(e.locale)?e.locale:xn),u=o(n&&a?n.fallbackLocale.value:V(e.fallbackLocale)||Te(e.fallbackLocale)||Q(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:c.value),h=o(ts(c.value,e)),g=o(Q(e.datetimeFormats)?e.datetimeFormats:{[c.value]:{}}),v=o(Q(e.numberFormats)?e.numberFormats:{[c.value]:{}});let x=n?n.missingWarn:re(e.missingWarn)||qt(e.missingWarn)?e.missingWarn:!0,k=n?n.fallbackWarn:re(e.fallbackWarn)||qt(e.fallbackWarn)?e.fallbackWarn:!0,D=n?n.fallbackRoot:re(e.fallbackRoot)?e.fallbackRoot:!0,A=!!e.fallbackFormat,R=Ce(e.missing)?e.missing:null,b=Ce(e.missing)?Po(e.missing):null,y=Ce(e.postTranslation)?e.postTranslation:null,L=n?n.warnHtmlMessage:re(e.warnHtmlMessage)?e.warnHtmlMessage:!0,P=!!e.escapeParameter;const F=n?n.modifiers:Q(e.modifiers)?e.modifiers:{};let B=e.pluralRules||n&&n.pluralRules,W;W=(()=>{s&&go(null);const E={version:fd,locale:c.value,fallbackLocale:u.value,messages:h.value,modifiers:F,pluralRules:B,missing:b===null?void 0:b,missingWarn:x,fallbackWarn:k,fallbackFormat:A,unresolving:!0,postTranslation:y===null?void 0:y,warnHtmlMessage:L,escapeParameter:P,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};E.datetimeFormats=g.value,E.numberFormats=v.value,E.__datetimeFormatters=Q(W)?W.__datetimeFormatters:void 0,E.__numberFormatters=Q(W)?W.__numberFormatters:void 0;const S=td(E);return s&&go(S),S})(),Dn(W,c.value,u.value);function ke(){return[c.value,u.value,h.value,g.value,v.value]}const Z=ce({get:()=>c.value,set:E=>{c.value=E,W.locale=c.value}}),_e=ce({get:()=>u.value,set:E=>{u.value=E,W.fallbackLocale=u.value,Dn(W,c.value,E)}}),ht=ce(()=>h.value),at=ce(()=>g.value),de=ce(()=>v.value);function ie(){return Ce(y)?y:null}function se(E){y=E,W.postTranslation=E}function Be(){return R}function Je(E){E!==null&&(b=Po(E)),R=E,W.missing=b}const we=(E,S,X,te,be,Ge)=>{ke();let Me;try{__INTLIFY_PROD_DEVTOOLS__,s||(W.fallbackContext=n?ed():void 0),Me=E(W)}finally{__INTLIFY_PROD_DEVTOOLS__,s||(W.fallbackContext=void 0)}if(X!=="translate exists"&&xe(Me)&&Me===es||X==="translate exists"&&!Me){const[en,ss]=S();return n&&D?te(n):be(en)}else{if(Ge(Me))return Me;throw Fe(Ae.UNEXPECTED_RETURN_TYPE)}};function Se(...E){return we(S=>Reflect.apply(bo,null,[S,...E]),()=>As(...E),"translate",S=>Reflect.apply(S.t,S,[...E]),S=>S,S=>V(S))}function ct(...E){const[S,X,te]=E;if(te&&!le(te))throw Fe(Ae.INVALID_ARGUMENT);return Se(S,X,We({resolvedMessage:!0},te||{}))}function tt(...E){return we(S=>Reflect.apply(yo,null,[S,...E]),()=>Rs(...E),"datetime format",S=>Reflect.apply(S.d,S,[...E]),()=>fo,S=>V(S))}function nt(...E){return we(S=>Reflect.apply(Co,null,[S,...E]),()=>Ds(...E),"number format",S=>Reflect.apply(S.n,S,[...E]),()=>fo,S=>V(S))}function Re(E){return E.map(S=>V(S)||xe(S)||re(S)?ko(String(S)):S)}const G={normalize:Re,interpolate:E=>E,type:"vnode"};function $(...E){return we(S=>{let X;const te=S;try{te.processor=G,X=Reflect.apply(bo,null,[te,...E])}finally{te.processor=null}return X},()=>As(...E),"translate",S=>S[Fs](...E),S=>[ko(S)],S=>Te(S))}function K(...E){return we(S=>Reflect.apply(Co,null,[S,...E]),()=>Ds(...E),"number format",S=>S[Us](...E),So,S=>V(S)||Te(S))}function ne(...E){return we(S=>Reflect.apply(yo,null,[S,...E]),()=>Rs(...E),"datetime format",S=>S[Ms](...E),So,S=>V(S)||Te(S))}function m(E){B=E,W.pluralRules=B}function _(E,S){return we(()=>{if(!E)return!1;const X=V(S)?S:c.value,te=O(X),be=W.messageResolver(te,E);return l?be!=null:Pt(be)||ut(be)||V(be)},()=>[E],"translate exists",X=>Reflect.apply(X.te,X,[E,S]),md,X=>re(X))}function p(E){let S=null;const X=Pa(W,u.value,c.value);for(let te=0;te{a&&(c.value=E,W.locale=E,Dn(W,c.value,u.value))}),fn(n.fallbackLocale,E=>{a&&(u.value=E,W.fallbackLocale=E,Dn(W,c.value,u.value))}));const M={id:No,locale:Z,fallbackLocale:_e,get inheritLocale(){return a},set inheritLocale(E){a=E,E&&n&&(c.value=n.locale.value,u.value=n.fallbackLocale.value,Dn(W,c.value,u.value))},get availableLocales(){return Object.keys(h.value).sort()},messages:ht,get modifiers(){return F},get pluralRules(){return B||{}},get isGlobal(){return s},get missingWarn(){return x},set missingWarn(E){x=E,W.missingWarn=x},get fallbackWarn(){return k},set fallbackWarn(E){k=E,W.fallbackWarn=k},get fallbackRoot(){return D},set fallbackRoot(E){D=E},get fallbackFormat(){return A},set fallbackFormat(E){A=E,W.fallbackFormat=A},get warnHtmlMessage(){return L},set warnHtmlMessage(E){L=E,W.warnHtmlMessage=E},get escapeParameter(){return P},set escapeParameter(E){P=E,W.escapeParameter=E},t:Se,getLocaleMessage:O,setLocaleMessage:N,mergeLocaleMessage:H,getPostTranslationHandler:ie,setPostTranslationHandler:se,getMissingHandler:Be,setMissingHandler:Je,[ja]:m};return M.datetimeFormats=at,M.numberFormats=de,M.rt=ct,M.te=_,M.tm=T,M.d=tt,M.n=nt,M.getDateTimeFormat=U,M.setDateTimeFormat=f,M.mergeDateTimeFormat=d,M.getNumberFormat=C,M.setNumberFormat=w,M.mergeNumberFormat=j,M[$a]=r,M[Fs]=$,M[Ms]=ne,M[Us]=K,M}function pd(e){const t=V(e.locale)?e.locale:xn,n=V(e.fallbackLocale)||Te(e.fallbackLocale)||Q(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,r=Ce(e.missing)?e.missing:void 0,s=re(e.silentTranslationWarn)||qt(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=re(e.silentFallbackWarn)||qt(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,o=re(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Q(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Ce(e.postTranslation)?e.postTranslation:void 0,h=V(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,g=!!e.escapeParameterHtml,v=re(e.sync)?e.sync:!0;let x=e.messages;if(Q(e.sharedMessages)){const P=e.sharedMessages;x=Object.keys(P).reduce((B,W)=>{const ae=B[W]||(B[W]={});return We(ae,P[W]),B},x||{})}const{__i18n:k,__root:D,__injectWithOption:A}=e,R=e.datetimeFormats,b=e.numberFormats,y=e.flatJson,L=e.translateExistCompatible;return{locale:t,fallbackLocale:n,messages:x,flatJson:y,datetimeFormats:R,numberFormats:b,missing:r,missingWarn:s,fallbackWarn:i,fallbackRoot:o,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:h,escapeParameter:g,messageResolver:e.messageResolver,inheritLocale:v,translateExistCompatible:L,__i18n:k,__root:D,__injectWithOption:A}}function Hs(e={},t){{const n=mi(pd(e)),{__extender:r}=e,s={id:n.id,get locale(){return n.locale.value},set locale(i){n.locale.value=i},get fallbackLocale(){return n.fallbackLocale.value},set fallbackLocale(i){n.fallbackLocale.value=i},get messages(){return n.messages.value},get datetimeFormats(){return n.datetimeFormats.value},get numberFormats(){return n.numberFormats.value},get availableLocales(){return n.availableLocales},get formatter(){return{interpolate(){return[]}}},set formatter(i){},get missing(){return n.getMissingHandler()},set missing(i){n.setMissingHandler(i)},get silentTranslationWarn(){return re(n.missingWarn)?!n.missingWarn:n.missingWarn},set silentTranslationWarn(i){n.missingWarn=re(i)?!i:i},get silentFallbackWarn(){return re(n.fallbackWarn)?!n.fallbackWarn:n.fallbackWarn},set silentFallbackWarn(i){n.fallbackWarn=re(i)?!i:i},get modifiers(){return n.modifiers},get formatFallbackMessages(){return n.fallbackFormat},set formatFallbackMessages(i){n.fallbackFormat=i},get postTranslation(){return n.getPostTranslationHandler()},set postTranslation(i){n.setPostTranslationHandler(i)},get sync(){return n.inheritLocale},set sync(i){n.inheritLocale=i},get warnHtmlInMessage(){return n.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(i){n.warnHtmlMessage=i!=="off"},get escapeParameterHtml(){return n.escapeParameter},set escapeParameterHtml(i){n.escapeParameter=i},get preserveDirectiveContent(){return!0},set preserveDirectiveContent(i){},get pluralizationRules(){return n.pluralRules||{}},__composer:n,t(...i){const[o,l,a]=i,c={};let u=null,h=null;if(!V(o))throw Fe(Ae.INVALID_ARGUMENT);const g=o;return V(l)?c.locale=l:Te(l)?u=l:Q(l)&&(h=l),Te(a)?u=a:Q(a)&&(h=a),Reflect.apply(n.t,n,[g,u||h||{},c])},rt(...i){return Reflect.apply(n.rt,n,[...i])},tc(...i){const[o,l,a]=i,c={plural:1};let u=null,h=null;if(!V(o))throw Fe(Ae.INVALID_ARGUMENT);const g=o;return V(l)?c.locale=l:xe(l)?c.plural=l:Te(l)?u=l:Q(l)&&(h=l),V(a)?c.locale=a:Te(a)?u=a:Q(a)&&(h=a),Reflect.apply(n.t,n,[g,u||h||{},c])},te(i,o){return n.te(i,o)},tm(i){return n.tm(i)},getLocaleMessage(i){return n.getLocaleMessage(i)},setLocaleMessage(i,o){n.setLocaleMessage(i,o)},mergeLocaleMessage(i,o){n.mergeLocaleMessage(i,o)},d(...i){return Reflect.apply(n.d,n,[...i])},getDateTimeFormat(i){return n.getDateTimeFormat(i)},setDateTimeFormat(i,o){n.setDateTimeFormat(i,o)},mergeDateTimeFormat(i,o){n.mergeDateTimeFormat(i,o)},n(...i){return Reflect.apply(n.n,n,[...i])},getNumberFormat(i){return n.getNumberFormat(i)},setNumberFormat(i,o){n.setNumberFormat(i,o)},mergeNumberFormat(i,o){n.mergeNumberFormat(i,o)},getChoiceIndex(i,o){return-1}};return s.__extender=r,s}}const gi={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function _d({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((r,s)=>[...r,...s.type===st?s.children:[s]],[]):t.reduce((n,r)=>{const s=e[r];return s&&(n[r]=s()),n},pe())}function Ga(e){return st}const vd=ir({name:"i18n-t",props:We({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>xe(e)||!isNaN(e)}},gi),setup(e,t){const{slots:n,attrs:r}=t,s=e.i18n||cr({useScope:e.scope,__useComponent:!0});return()=>{const i=Object.keys(n).filter(h=>h!=="_"),o=pe();e.locale&&(o.locale=e.locale),e.plural!==void 0&&(o.plural=V(e.plural)?+e.plural:e.plural);const l=_d(t,i),a=s[Fs](e.keypath,l,o),c=We(pe(),r),u=V(e.tag)||le(e.tag)?e.tag:Ga();return Jr(u,c,a)}}}),xo=vd;function bd(e){return Te(e)&&!V(e[0])}function Ka(e,t,n,r){const{slots:s,attrs:i}=t;return()=>{const o={part:!0};let l=pe();e.locale&&(o.locale=e.locale),V(e.format)?o.key=e.format:le(e.format)&&(V(e.format.key)&&(o.key=e.format.key),l=Object.keys(e.format).reduce((g,v)=>n.includes(v)?We(pe(),g,{[v]:e.format[v]}):g,pe()));const a=r(e.value,o,l);let c=[o.key];Te(a)?c=a.map((g,v)=>{const x=s[g.type],k=x?x({[g.type]:g.value,index:v,parts:a}):[g.value];return bd(k)&&(k[0].key=`${g.type}-${v}`),k}):V(a)&&(c=[a]);const u=We(pe(),i),h=V(e.tag)||le(e.tag)?e.tag:Ga();return Jr(h,u,c)}}const yd=ir({name:"i18n-n",props:We({value:{type:Number,required:!0},format:{type:[String,Object]}},gi),setup(e,t){const n=e.i18n||cr({useScope:e.scope,__useComponent:!0});return Ka(e,t,Wa,(...r)=>n[Us](...r))}}),Io=yd,Ed=ir({name:"i18n-d",props:We({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},gi),setup(e,t){const n=e.i18n||cr({useScope:e.scope,__useComponent:!0});return Ka(e,t,Ua,(...r)=>n[Ms](...r))}}),Oo=Ed;function Cd(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const r=n.__getInstance(t);return r!=null?r.__composer:e.global.__composer}}function Td(e){const t=o=>{const{instance:l,modifiers:a,value:c}=o;if(!l||!l.$)throw Fe(Ae.UNEXPECTED_ERROR);const u=Cd(e,l.$),h=Lo(c);return[Reflect.apply(u.t,u,[...Ao(h)]),u]};return{created:(o,l)=>{const[a,c]=t(l);Rr&&e.global===c&&(o.__i18nWatcher=fn(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),o.__composer=c,o.textContent=a},unmounted:o=>{Rr&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:l})=>{if(o.__composer){const a=o.__composer,c=Lo(l);o.textContent=Reflect.apply(a.t,a,[...Ao(c)])}},getSSRProps:o=>{const[l]=t(o);return{textContent:l}}}}function Lo(e){if(V(e))return{path:e};if(Q(e)){if(!("path"in e))throw Fe(Ae.REQUIRED_VALUE,"path");return e}else throw Fe(Ae.INVALID_VALUE)}function Ao(e){const{path:t,locale:n,args:r,choice:s,plural:i}=e,o={},l=r||{};return V(n)&&(o.locale=n),xe(s)&&(o.plural=s),xe(i)&&(o.plural=i),[t,l,o]}function kd(e,t,...n){const r=Q(n[0])?n[0]:{},s=!!r.useI18nComponentName;(re(r.globalInstall)?r.globalInstall:!0)&&([s?"i18n":xo.name,"I18nT"].forEach(o=>e.component(o,xo)),[Io.name,"I18nN"].forEach(o=>e.component(o,Io)),[Oo.name,"I18nD"].forEach(o=>e.component(o,Oo))),e.directive("t",Td(t))}function wd(e,t,n){return{beforeCreate(){const r=Nn();if(!r)throw Fe(Ae.UNEXPECTED_ERROR);const s=this.$options;if(s.i18n){const i=s.i18n;if(s.__i18n&&(i.__i18n=s.__i18n),i.__root=t,this===this.$root)this.$i18n=Ro(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Hs(i);const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=Ro(e,s);else{this.$i18n=Hs({__i18n:s.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;s.__i18nGlobal&&Ba(t,s,s),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$tc=(...i)=>this.$i18n.tc(...i),this.$te=(i,o)=>this.$i18n.te(i,o),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(r,this.$i18n)},mounted(){},unmounted(){const r=Nn();if(!r)throw Fe(Ae.UNEXPECTED_ERROR);const s=this.$i18n;delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,s.__disposer&&(s.__disposer(),delete s.__disposer,delete s.__extender),n.__deleteInstance(r),delete this.$i18n}}}function Ro(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[ja](t.pluralizationRules||e.pluralizationRules);const n=ts(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(r=>e.mergeLocaleMessage(r,n[r])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(r=>e.mergeDateTimeFormat(r,t.datetimeFormats[r])),t.numberFormats&&Object.keys(t.numberFormats).forEach(r=>e.mergeNumberFormat(r,t.numberFormats[r])),e}const Sd=Jt("global-vue-i18n");function Nd(e={},t){const n=__VUE_I18N_LEGACY_API__&&re(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,r=re(e.globalInjection)?e.globalInjection:!0,s=__VUE_I18N_LEGACY_API__&&n?!!e.allowComposition:!0,i=new Map,[o,l]=Pd(e,n),a=Jt("");function c(g){return i.get(g)||null}function u(g,v){i.set(g,v)}function h(g){i.delete(g)}{const g={get mode(){return __VUE_I18N_LEGACY_API__&&n?"legacy":"composition"},get allowComposition(){return s},async install(v,...x){if(v.__VUE_I18N_SYMBOL__=a,v.provide(v.__VUE_I18N_SYMBOL__,g),Q(x[0])){const A=x[0];g.__composerExtend=A.__composerExtend,g.__vueI18nExtend=A.__vueI18nExtend}let k=null;!n&&r&&(k=Md(v,g.global)),__VUE_I18N_FULL_INSTALL__&&kd(v,g,...x),__VUE_I18N_LEGACY_API__&&n&&v.mixin(wd(l,l.__composer,g));const D=v.unmount;v.unmount=()=>{k&&k(),g.dispose(),D()}},get global(){return l},dispose(){o.stop()},__instances:i,__getInstance:c,__setInstance:u,__deleteInstance:h};return g}}function cr(e={}){const t=Nn();if(t==null)throw Fe(Ae.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Fe(Ae.NOT_INSTALLED);const n=xd(t),r=Od(n),s=Va(t),i=Id(e,s);if(__VUE_I18N_LEGACY_API__&&n.mode==="legacy"&&!e.__useComponent){if(!n.allowComposition)throw Fe(Ae.NOT_AVAILABLE_IN_LEGACY_MODE);return Dd(t,i,r,e)}if(i==="global")return Ba(r,e,s),r;if(i==="parent"){let a=Ld(n,t,e.__useComponent);return a==null&&(a=r),a}const o=n;let l=o.__getInstance(t);if(l==null){const a=We({},e);"__i18n"in s&&(a.__i18n=s.__i18n),r&&(a.__root=r),l=mi(a),o.__composerExtend&&(l[Ws]=o.__composerExtend(l)),Rd(o,t,l),o.__setInstance(t,l)}return l}function Pd(e,t,n){const r=vc();{const s=__VUE_I18N_LEGACY_API__&&t?r.run(()=>Hs(e)):r.run(()=>mi(e));if(s==null)throw Fe(Ae.UNEXPECTED_ERROR);return[r,s]}}function xd(e){{const t=Nt(e.isCE?Sd:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Fe(e.isCE?Ae.NOT_INSTALLED_WITH_PROVIDE:Ae.UNEXPECTED_ERROR);return t}}function Id(e,t){return Qr(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function Od(e){return e.mode==="composition"?e.global:e.global.__composer}function Ld(e,t,n=!1){let r=null;const s=t.root;let i=Ad(t,n);for(;i!=null;){const o=e;if(e.mode==="composition")r=o.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=o.__getInstance(i);l!=null&&(r=l.__composer,n&&r&&!r[$a]&&(r=null))}if(r!=null||s===i)break;i=i.parent}return r}function Ad(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function Rd(e,t,n){Yr(()=>{},t),or(()=>{const r=n;e.__deleteInstance(t);const s=r[Ws];s&&(s(),delete r[Ws])},t)}function Dd(e,t,n,r={}){const s=t==="local",i=ni(null);if(s&&e.proxy&&!(e.proxy.$options.i18n||e.proxy.$options.__i18n))throw Fe(Ae.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const o=re(r.inheritLocale)?r.inheritLocale:!V(r.locale),l=it(!s||o?n.locale.value:V(r.locale)?r.locale:xn),a=it(!s||o?n.fallbackLocale.value:V(r.fallbackLocale)||Te(r.fallbackLocale)||Q(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:l.value),c=it(ts(l.value,r)),u=it(Q(r.datetimeFormats)?r.datetimeFormats:{[l.value]:{}}),h=it(Q(r.numberFormats)?r.numberFormats:{[l.value]:{}}),g=s?n.missingWarn:re(r.missingWarn)||qt(r.missingWarn)?r.missingWarn:!0,v=s?n.fallbackWarn:re(r.fallbackWarn)||qt(r.fallbackWarn)?r.fallbackWarn:!0,x=s?n.fallbackRoot:re(r.fallbackRoot)?r.fallbackRoot:!0,k=!!r.fallbackFormat,D=Ce(r.missing)?r.missing:null,A=Ce(r.postTranslation)?r.postTranslation:null,R=s?n.warnHtmlMessage:re(r.warnHtmlMessage)?r.warnHtmlMessage:!0,b=!!r.escapeParameter,y=s?n.modifiers:Q(r.modifiers)?r.modifiers:{},L=r.pluralRules||s&&n.pluralRules;function P(){return[l.value,a.value,c.value,u.value,h.value]}const F=ce({get:()=>i.value?i.value.locale.value:l.value,set:p=>{i.value&&(i.value.locale.value=p),l.value=p}}),B=ce({get:()=>i.value?i.value.fallbackLocale.value:a.value,set:p=>{i.value&&(i.value.fallbackLocale.value=p),a.value=p}}),W=ce(()=>i.value?i.value.messages.value:c.value),ae=ce(()=>u.value),ke=ce(()=>h.value);function Z(){return i.value?i.value.getPostTranslationHandler():A}function _e(p){i.value&&i.value.setPostTranslationHandler(p)}function ht(){return i.value?i.value.getMissingHandler():D}function at(p){i.value&&i.value.setMissingHandler(p)}function de(p){return P(),p()}function ie(...p){return i.value?de(()=>Reflect.apply(i.value.t,null,[...p])):de(()=>"")}function se(...p){return i.value?Reflect.apply(i.value.rt,null,[...p]):""}function Be(...p){return i.value?de(()=>Reflect.apply(i.value.d,null,[...p])):de(()=>"")}function Je(...p){return i.value?de(()=>Reflect.apply(i.value.n,null,[...p])):de(()=>"")}function we(p){return i.value?i.value.tm(p):{}}function Se(p,T){return i.value?i.value.te(p,T):!1}function ct(p){return i.value?i.value.getLocaleMessage(p):{}}function tt(p,T){i.value&&(i.value.setLocaleMessage(p,T),c.value[p]=T)}function nt(p,T){i.value&&i.value.mergeLocaleMessage(p,T)}function Re(p){return i.value?i.value.getDateTimeFormat(p):{}}function I(p,T){i.value&&(i.value.setDateTimeFormat(p,T),u.value[p]=T)}function G(p,T){i.value&&i.value.mergeDateTimeFormat(p,T)}function $(p){return i.value?i.value.getNumberFormat(p):{}}function K(p,T){i.value&&(i.value.setNumberFormat(p,T),h.value[p]=T)}function ne(p,T){i.value&&i.value.mergeNumberFormat(p,T)}const m={get id(){return i.value?i.value.id:-1},locale:F,fallbackLocale:B,messages:W,datetimeFormats:ae,numberFormats:ke,get inheritLocale(){return i.value?i.value.inheritLocale:o},set inheritLocale(p){i.value&&(i.value.inheritLocale=p)},get availableLocales(){return i.value?i.value.availableLocales:Object.keys(c.value)},get modifiers(){return i.value?i.value.modifiers:y},get pluralRules(){return i.value?i.value.pluralRules:L},get isGlobal(){return i.value?i.value.isGlobal:!1},get missingWarn(){return i.value?i.value.missingWarn:g},set missingWarn(p){i.value&&(i.value.missingWarn=p)},get fallbackWarn(){return i.value?i.value.fallbackWarn:v},set fallbackWarn(p){i.value&&(i.value.missingWarn=p)},get fallbackRoot(){return i.value?i.value.fallbackRoot:x},set fallbackRoot(p){i.value&&(i.value.fallbackRoot=p)},get fallbackFormat(){return i.value?i.value.fallbackFormat:k},set fallbackFormat(p){i.value&&(i.value.fallbackFormat=p)},get warnHtmlMessage(){return i.value?i.value.warnHtmlMessage:R},set warnHtmlMessage(p){i.value&&(i.value.warnHtmlMessage=p)},get escapeParameter(){return i.value?i.value.escapeParameter:b},set escapeParameter(p){i.value&&(i.value.escapeParameter=p)},t:ie,getPostTranslationHandler:Z,setPostTranslationHandler:_e,getMissingHandler:ht,setMissingHandler:at,rt:se,d:Be,n:Je,tm:we,te:Se,getLocaleMessage:ct,setLocaleMessage:tt,mergeLocaleMessage:nt,getDateTimeFormat:Re,setDateTimeFormat:I,mergeDateTimeFormat:G,getNumberFormat:$,setNumberFormat:K,mergeNumberFormat:ne};function _(p){p.locale.value=l.value,p.fallbackLocale.value=a.value,Object.keys(c.value).forEach(T=>{p.mergeLocaleMessage(T,c.value[T])}),Object.keys(u.value).forEach(T=>{p.mergeDateTimeFormat(T,u.value[T])}),Object.keys(h.value).forEach(T=>{p.mergeNumberFormat(T,h.value[T])}),p.escapeParameter=b,p.fallbackFormat=k,p.fallbackRoot=x,p.fallbackWarn=v,p.missingWarn=g,p.warnHtmlMessage=R}return jl(()=>{if(e.proxy==null||e.proxy.$i18n==null)throw Fe(Ae.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const p=i.value=e.proxy.$i18n.__composer;t==="global"?(l.value=p.locale.value,a.value=p.fallbackLocale.value,c.value=p.messages.value,u.value=p.datetimeFormats.value,h.value=p.numberFormats.value):s&&_(p)}),m}const Fd=["locale","fallbackLocale","availableLocales"],Do=["t","rt","d","n","tm","te"];function Md(e,t){const n=Object.create(null);return Fd.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i)throw Fe(Ae.UNEXPECTED_ERROR);const o=Ue(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,s,o)}),e.config.globalProperties.$i18n=n,Do.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i||!i.value)throw Fe(Ae.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,i)}),()=>{delete e.config.globalProperties.$i18n,Do.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}hd();__INTLIFY_JIT_COMPILATION__?mo(od):mo(id);qh(Ih);Jh(Pa);if(__INTLIFY_PROD_DEVTOOLS__){const e=Wt();e.__INTLIFY__=!0,Wh(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const Yt=it({isOnline:!1,error:"",lastCheck:null}),De=it({chip:null,board:null,firmware:null,flash:null,assetsPartition:null,network:null,screen:null}),hn=it(""),Cr=it(!1),kn=it(null),Ud=e=>new URLSearchParams(window.location.search).get(e),Tr=async(e,t={})=>{if(!hn.value)throw new Error("Authentication token not found");const n=await fetch("/api/messaging/device/tools/call",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${hn.value}`},body:JSON.stringify({name:e,arguments:t})});if(n.ok)return await n.json();{const r=await n.text();console.error(`MCP tool ${e} failed:`,n.status,r);let s=`Failed to call ${e}`;try{const i=JSON.parse(r);i.message&&(s=i.message)}catch{s=`${s}: HTTP ${n.status}`}throw new Error(s)}},Wd=async()=>{var e,t,n,r;try{const[s,i,o]=await Promise.allSettled([Tr("self.get_system_info"),Tr("self.get_device_status"),Tr("self.screen.get_info")]);if(s.status==="fulfilled"&&s.value){const l=s.value.data||s.value;if(De.value.chip={model:l.chip_model_name||"Unknown"},De.value.board={model:((e=l.board)==null?void 0:e.name)||"Unknown"},De.value.firmware={version:((t=l.application)==null?void 0:t.version)||"Unknown"},l.flash_size){const a=Math.round(l.flash_size/1024/1024);De.value.flash={size:`${a}MB`}}else De.value.flash={size:"Unknown"};if(l.partition_table){const a=l.partition_table.find(c=>c.label==="assets");a?De.value.assetsPartition={size:a.size,sizeFormatted:`${Math.round(a.size/1024/1024)}MB`}:De.value.assetsPartition=null}else De.value.assetsPartition=null}else console.warn("系统信息获取失败:",s.reason||s.value),De.value.chip={model:"Unknown"},De.value.board={model:"Unknown"},De.value.firmware={version:"Unknown"},De.value.flash={size:"Unknown"},De.value.assetsPartition=null;if(i.status==="fulfilled"&&i.value){const l=i.value.data||i.value;De.value.network={type:((n=l.network)==null?void 0:n.type)||"unknown",signal:((r=l.network)==null?void 0:r.signal)||"Unknown"}}else console.warn("设备状态获取失败:",i.reason||i.value),De.value.network={type:"unknown",signal:"Unknown"};if(o.status==="fulfilled"&&o.value){const l=o.value.data||o.value;De.value.screen={resolution:`${l.width||0}x${l.height||0}`}}else console.warn("屏幕信息获取失败:",o.reason||o.value),De.value.screen={resolution:"Unknown"}}catch(s){console.error("获取设备信息时发生错误:",s)}},ns=async()=>{if(!(Cr.value||!hn.value)){Cr.value=!0;try{const e=await fetch("/api/messaging/device/tools/list",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${hn.value}`}});if(e.ok)Yt.value.isOnline=!0,Yt.value.error="",Yt.value.lastCheck=new Date,await Wd();else throw new Error(`HTTP ${e.status}: ${e.statusText}`)}catch{Yt.value.isOnline=!1,Yt.value.error="",Yt.value.lastCheck=new Date,kn.value&&clearTimeout(kn.value),kn.value=setTimeout(ns,3e4)}finally{Cr.value=!1}}},Hd=(e,t)=>{if(!e)return t("device.signal.unknown");switch(e.toLowerCase()){case"strong":return t("device.signal.strong");case"medium":return t("device.signal.medium");case"weak":return t("device.signal.weak");case"none":return t("device.signal.none");default:return e}},jd=()=>{hn.value=Ud("token"),hn.value&&ns()},$d=()=>{kn.value&&(clearTimeout(kn.value),kn.value=null)},Vd=async()=>{await ns()};function Bd(){const e=ce(()=>!!hn.value),t=ce(()=>Yt.value.isOnline);return{deviceStatus:Yt,deviceInfo:De,isChecking:Cr,hasToken:e,isDeviceOnline:t,initializeDeviceStatus:jd,cleanupDeviceStatus:$d,refreshDeviceStatus:Vd,checkDeviceStatus:ns,callMcpTool:Tr,getSignalDisplayText:Hd}}const Fo={__name:"WifiIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-blue-500"}},setup(e){const t=e,n=ce(()=>`${t.size} ${t.color}`);return(r,s)=>(oe(),me("svg",{class:$e(n.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...s[0]||(s[0]=[z("path",{d:"M3 9c4.97-4.97 13.03-4.97 18 0","stroke-width":"2","stroke-linecap":"round"},null,-1),z("path",{d:"M6 12c3.31-3.31 8.69-3.31 12 0","stroke-width":"2","stroke-linecap":"round"},null,-1),z("path",{d:"M9 15c1.66-1.66 4.34-1.66 6 0","stroke-width":"2","stroke-linecap":"round"},null,-1),z("circle",{cx:"12",cy:"18",r:"1.5",fill:"currentColor"},null,-1)])],2))}},Mo={__name:"Signal4GIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-green-500"}},setup(e){const t=e,n=ce(()=>`${t.size} ${t.color}`);return(r,s)=>(oe(),me("svg",{class:$e(n.value),fill:"currentColor",viewBox:"0 0 24 24"},[...s[0]||(s[0]=[zr('4G',5)])],2))}},Uo={__name:"ChipIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-gray-400"}},setup(e){const t=e,n=ce(()=>`${t.size} ${t.color}`);return(r,s)=>(oe(),me("svg",{class:$e(n.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...s[0]||(s[0]=[zr('',14)])],2))}},Wo={__name:"FlashIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-gray-400"}},setup(e){const t=e,n=ce(()=>`${t.size} ${t.color}`);return(r,s)=>(oe(),me("svg",{class:$e(n.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...s[0]||(s[0]=[zr('',10)])],2))}},Ho={__name:"BoardIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-gray-400"}},setup(e){const t=e,n=ce(()=>`${t.size} ${t.color}`);return(r,s)=>(oe(),me("svg",{class:$e(n.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...s[0]||(s[0]=[zr('',10)])],2))}},jo={__name:"ScreenIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-gray-400"}},setup(e){const t=e,n=ce(()=>`${t.size} ${t.color}`);return(r,s)=>(oe(),me("svg",{class:$e(n.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...s[0]||(s[0]=[z("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},null,-1)])],2))}},Gd={class:"flex items-center space-x-2"},Kd={class:"flex items-center space-x-1"},Yd={key:0,class:"flex items-center space-x-1"},Xd={class:"text-xs text-gray-500"},zd={key:0,class:"flex items-center space-x-4 text-sm text-gray-600"},qd={key:0,class:"flex items-center space-x-1"},Jd={key:1,class:"flex items-center space-x-1"},Qd={key:2,class:"flex items-center space-x-1"},Zd={key:3,class:"flex items-center space-x-1"},em={key:1,class:"lg:hidden flex flex-col bg-white rounded-lg border border-gray-200 shadow-sm overflow-hidden"},tm={class:"flex items-center justify-between px-4 py-3 bg-gray-50 border-b border-gray-200"},nm={class:"flex items-center space-x-2"},rm={key:0,class:"flex items-center space-x-1"},sm={class:"text-xs font-medium text-gray-600"},im={key:0,class:"px-4 py-3"},om={class:"grid grid-cols-1 gap-2.5"},lm={class:"flex justify-between items-center py-1.5 border-b border-gray-100"},am={key:0,class:"flex items-center space-x-2 flex-1"},cm={class:"min-w-0 flex-1"},um={class:"text-xs text-gray-500 leading-tight"},fm={class:"text-sm text-gray-800 font-medium truncate"},hm={key:1,class:"flex items-center space-x-2 flex-1 ml-3"},dm={class:"min-w-0 flex-1"},mm={class:"text-xs text-gray-500 leading-tight"},gm={class:"text-sm text-gray-800 font-medium truncate"},pm={class:"flex justify-between items-center py-1.5"},_m={key:0,class:"flex items-center space-x-2 flex-1"},vm={class:"min-w-0 flex-1"},bm={class:"text-xs text-gray-500 leading-tight"},ym={class:"text-sm text-gray-800 font-medium"},Em={key:1,class:"flex items-center space-x-2 flex-1 ml-3"},Cm={class:"min-w-0 flex-1"},Tm={class:"text-xs text-gray-500 leading-tight"},km={class:"text-sm text-gray-800 font-medium"},wm={__name:"DeviceStatus",setup(e){const{t}=cr(),{deviceStatus:n,deviceInfo:r,hasToken:s,initializeDeviceStatus:i,cleanupDeviceStatus:o,getSignalDisplayText:l}=Bd(),a=ce(()=>s.value);return Yr(()=>{i()}),or(()=>{o()}),(c,u)=>(oe(),me(st,null,[a.value?(oe(),me("div",{key:0,class:$e(["hidden lg:flex items-center space-x-4",Y(n).isOnline?"":"opacity-60"])},[z("div",Gd,[z("div",Kd,[z("div",{class:$e(["w-2 h-2 rounded-full",Y(n).isOnline?"bg-green-500":"bg-gray-400"])},null,2),z("span",{class:$e(["text-sm font-medium",Y(n).isOnline?"text-gray-700":"text-gray-500"])},Ne(Y(n).isOnline?c.$t("device.online"):c.$t("device.offline")),3)]),Y(n).isOnline&&Y(r).network?(oe(),me("div",Yd,[Y(r).network.type==="wifi"?(oe(),Un(Y(Fo),{key:0,color:"text-blue-500"})):Y(r).network.type==="4g"?(oe(),Un(Y(Mo),{key:1})):Le("",!0),z("span",Xd,Ne(Y(l)(Y(r).network.signal,Y(t))),1)])):Le("",!0)]),Y(n).isOnline?(oe(),me("div",zd,[Y(r).chip?(oe(),me("div",qd,[Ee(Y(Uo)),z("span",null,Ne(Y(r).chip.model),1)])):Le("",!0),Y(r).flash?(oe(),me("div",Jd,[Ee(Y(Wo)),z("span",null,Ne(Y(r).flash.size),1)])):Le("",!0),Y(r).board?(oe(),me("div",Qd,[Ee(Y(Ho)),z("span",null,Ne(Y(r).board.model),1)])):Le("",!0),Y(r).screen?(oe(),me("div",Zd,[Ee(Y(jo)),z("span",null,Ne(Y(r).screen.resolution),1)])):Le("",!0)])):Le("",!0)],2)):Le("",!0),a.value?(oe(),me("div",em,[z("div",tm,[z("div",nm,[z("div",{class:$e(["w-2.5 h-2.5 rounded-full",Y(n).isOnline?"bg-green-500":"bg-red-400"])},null,2),z("span",{class:$e(["text-sm font-medium",Y(n).isOnline?"text-gray-800":"text-gray-600"])},Ne(Y(n).isOnline?c.$t("device.online"):c.$t("device.offline")),3)]),Y(n).isOnline&&Y(r).network?(oe(),me("div",rm,[Y(r).network.type==="wifi"?(oe(),Un(Y(Fo),{key:0,color:"text-blue-500"})):Y(r).network.type==="4g"?(oe(),Un(Y(Mo),{key:1})):Le("",!0),z("span",sm,Ne(Y(l)(Y(r).network.signal,Y(t))),1)])):Le("",!0)]),Y(n).isOnline?(oe(),me("div",im,[z("div",om,[z("div",lm,[Y(r).chip?(oe(),me("div",am,[Ee(Y(Uo),{class:"flex-shrink-0"}),z("div",cm,[z("div",um,Ne(c.$t("device.chip")),1),z("div",fm,Ne(Y(r).chip.model),1)])])):Le("",!0),Y(r).board?(oe(),me("div",hm,[Ee(Y(Ho),{class:"flex-shrink-0"}),z("div",dm,[z("div",mm,Ne(c.$t("device.board")),1),z("div",gm,Ne(Y(r).board.model),1)])])):Le("",!0)]),z("div",pm,[Y(r).flash?(oe(),me("div",_m,[Ee(Y(Wo),{class:"flex-shrink-0"}),z("div",vm,[z("div",bm,Ne(c.$t("device.flash")),1),z("div",ym,Ne(Y(r).flash.size),1)])])):Le("",!0),Y(r).screen?(oe(),me("div",Em,[Ee(Y(jo),{class:"flex-shrink-0"}),z("div",Cm,[z("div",Tm,Ne(c.$t("device.screen")),1),z("div",km,Ne(Y(r).screen.resolution),1)])])):Le("",!0)])])])):Le("",!0)])):Le("",!0)],64))}},Sm={title:"Xiaozhi AI Customization"},Nm={cancel:"Cancel",confirm:"Confirm",close:"Close",start:"Start",download:"Download",generate:"Generate",reset:"Reset",yes:"Yes",no:"No",loading:"Loading...",error:"Error",success:"Success",warning:"Warning",info:"Information",next:"Next",previous:"Previous",finish:"Finish",retry:"Retry",ok:"OK",other:"Other"},Pm={title:"Xiaozhi AI Customization"},xm={title:"Saved Configuration Detected",message:"Configuration has been automatically restored. You can continue from where you left off or start over.",restart:"Start Over"},Im={chip:"Chip Configuration",theme:"Theme Design",generate:"Preview & Generate"},Om={title:"Generate assets.bin",confirmConfig:"Please confirm your configuration",chipModel:"Chip Model:",resolution:"Resolution:",wakeword:"Wake Word:",font:"Font:",emoji:"Emoji Package:",fileList:"Included Files List",estimated:"Estimated",compressed:"Before compression",generating:"Generating assets.bin...",progress:"{progress}% Complete",completed:"Your assets.bin file is ready",filename:"Filename: assets.bin",fileSize:"File Size: {size}",generationTime:"Generation Time: {time}",downloadAssets:"Download assets.bin",flashToDevice:"Flash to Device Online",flashing:"Flashing to device...",flashingCancel:"Cancel Flash",flashingError:"Flashing Error",flashingInProgress:"Flashing in progress, please do not close the window",customFont:"Custom Font",customEmoji:"Custom Emoji Package",notConfigured:"Not Configured",wakewordNames:{wn9s_hilexin:"Hi, Espressif",wn9s_hiesp:"Hi, ESP",wn9s_nihaoxiaozhi:"Hello Xiaozhi",wn9_nihaoxiaozhi_tts:"Hello Xiaozhi",wn9_alexa:"Alexa"}},Lm={init:"Initialize Generator",font:"Process Font Files",wakeword:"Package Wake Word Model",emoji:"Process Emoji Images",background:"Process Background Images",index:"Generate Index File",spiffs:"Build SPIFFS Mapping",package:"Complete Packaging"},Am={title:"Wake Word Configuration",description:"Select a preset wake word model or customize it using a command recognition model.",supportWakeNet9:"Your chip supports WakeNet9 models.",supportWakeNet9s:"Your chip supports WakeNet9s models.",notSupported:"Your chip does not support wake word functionality.",notice:"Note:",unsupportedMessage:"{chipModel} chip does not support wake word functionality. If you need to use wake words, please select ESP32-S3, ESP32-P4, or ESP32-C3/C5/C6 chips.",noWakeword:"No Wake Word",presetWakeword:"Preset Wake Word",customWakeword:"Custom Wake Word",selectWakeword:"Select Wake Word",placeholder:"Select wake word...",customSettings:"Custom Wake Word Settings",wakewordName:"Wake Word Name",wakewordNamePlaceholder:"e.g., Xiaozhi / Potato",wakewordCommand:"Wake Command",wakewordCommandPlaceholderEN:"English words, no punctuation, e.g., HELLO POTATO",threshold:"Sensitivity Threshold (0-100)",thresholdDesc:"Lower is more sensitive, default 20",duration:"Recognition Duration",durationDesc:"Maximum duration for command recognition",selectModel:"Select Recognition Model",mn6en:"MultiNet6 (English)",mn7en:"MultiNet7 (English)",errors:{nameRequired:"Please enter wake word name",commandRequired:"Please enter wake command",noPunctuation:"Command cannot contain punctuation",durationRange:"Duration must be between 500-10000ms"},tips:{tipLabel:"Tip:",optional:"Wake words are optional. If disabled, the device cannot be voice-activated.",wakeNet9sOnly:"C3/C5/C6 chips only support WakeNet9s lightweight models.",wakeNet9Full:"S3/P4 chips support complete WakeNet9 models with more choices.",customSupport:"Custom wake words use MultiNet models, currently only supported on ESP32-S3."}},Rm={resetFailed:"Reset failed, please refresh the page and try again",generationFailed:"Generation failed: {error}",noFileToDownload:"No downloadable file available",deviceOffline:"Device is offline and cannot be flashed",fileTooLarge:"Flash failed: File size {fileSize}MB exceeds assets partition size {partitionSize}MB. Please reduce configuration content or use a device with larger capacity.",flashCancelConfirm:"Are you sure you want to cancel flashing?",oldDataCleared:`Old version emoji data structure has been detected and cleared. + */const fd="9.14.5";function hd(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Wt().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Wt().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(Wt().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Wt().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Wt().__INTLIFY_PROD_DEVTOOLS__=!1)}const dd=Bh.__EXTEND_POINT__,At=Zr(dd);At(),At(),At(),At(),At(),At(),At(),At(),At();const Ha=gt.__EXTEND_POINT__,Qe=Zr(Ha),Ae={UNEXPECTED_RETURN_TYPE:Ha,INVALID_ARGUMENT:Qe(),MUST_BE_CALL_SETUP_TOP:Qe(),NOT_INSTALLED:Qe(),NOT_AVAILABLE_IN_LEGACY_MODE:Qe(),REQUIRED_VALUE:Qe(),INVALID_VALUE:Qe(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:Qe(),NOT_INSTALLED_WITH_PROVIDE:Qe(),UNEXPECTED_ERROR:Qe(),NOT_COMPATIBLE_LEGACY_VUE_I18N:Qe(),BRIDGE_SUPPORT_VUE_2_ONLY:Qe(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:Qe(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:Qe(),__EXTEND_POINT__:Qe()};function Fe(e,...t){return Ln(e,null,void 0)}const Fs=Jt("__translateVNode"),Ms=Jt("__datetimeParts"),Us=Jt("__numberParts"),ja=Jt("__setPluralRules"),$a=Jt("__injectWithOption"),Ws=Jt("__dispose");function er(e){if(!le(e)||Pt(e))return e;for(const t in e)if(mt(e,t))if(!t.includes("."))le(e[t])&&er(e[t]);else{const n=t.split("."),r=n.length-1;let s=e,i=!1;for(let o=0;o{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(o[a]=o[a]||pe(),Er(c,o[a])):Er(c,o)}else V(l)&&Er(JSON.parse(l),o)}),s==null&&i)for(const l in o)mt(o,l)&&er(o[l]);return o}function Va(e){return e.type}function Ba(e,t,n){let r=le(t.messages)?t.messages:pe();"__i18nGlobal"in n&&(r=ts(e.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const s=Object.keys(r);s.length&&s.forEach(i=>{e.mergeLocaleMessage(i,r[i])});{if(le(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(o=>{e.mergeDateTimeFormat(o,t.datetimeFormats[o])})}if(le(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(o=>{e.mergeNumberFormat(o,t.numberFormats[o])})}}}function ko(e){return Ee(lr,null,e,0)}const wo="__INTLIFY_META__",So=()=>[],md=()=>!1;let No=0;function Po(e){return(t,n,r,s)=>e(n,r,Nn()||void 0,s)}const gd=()=>{const e=Nn();let t=null;return e&&(t=Va(e)[wo])?{[wo]:t}:null};function mi(e={},t){const{__root:n,__injectWithOption:r}=e,s=n===void 0,i=e.flatJson,o=Rr?it:ni,l=!!e.translateExistCompatible;let a=re(e.inheritLocale)?e.inheritLocale:!0;const c=o(n&&a?n.locale.value:V(e.locale)?e.locale:xn),u=o(n&&a?n.fallbackLocale.value:V(e.fallbackLocale)||Te(e.fallbackLocale)||Q(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:c.value),d=o(ts(c.value,e)),g=o(Q(e.datetimeFormats)?e.datetimeFormats:{[c.value]:{}}),v=o(Q(e.numberFormats)?e.numberFormats:{[c.value]:{}});let N=n?n.missingWarn:re(e.missingWarn)||qt(e.missingWarn)?e.missingWarn:!0,k=n?n.fallbackWarn:re(e.fallbackWarn)||qt(e.fallbackWarn)?e.fallbackWarn:!0,D=n?n.fallbackRoot:re(e.fallbackRoot)?e.fallbackRoot:!0,A=!!e.fallbackFormat,R=Ce(e.missing)?e.missing:null,b=Ce(e.missing)?Po(e.missing):null,y=Ce(e.postTranslation)?e.postTranslation:null,L=n?n.warnHtmlMessage:re(e.warnHtmlMessage)?e.warnHtmlMessage:!0,x=!!e.escapeParameter;const F=n?n.modifiers:Q(e.modifiers)?e.modifiers:{};let B=e.pluralRules||n&&n.pluralRules,W;W=(()=>{s&&go(null);const E={version:fd,locale:c.value,fallbackLocale:u.value,messages:d.value,modifiers:F,pluralRules:B,missing:b===null?void 0:b,missingWarn:N,fallbackWarn:k,fallbackFormat:A,unresolving:!0,postTranslation:y===null?void 0:y,warnHtmlMessage:L,escapeParameter:x,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};E.datetimeFormats=g.value,E.numberFormats=v.value,E.__datetimeFormatters=Q(W)?W.__datetimeFormatters:void 0,E.__numberFormatters=Q(W)?W.__numberFormatters:void 0;const S=td(E);return s&&go(S),S})(),Dn(W,c.value,u.value);function ke(){return[c.value,u.value,d.value,g.value,v.value]}const Z=ce({get:()=>c.value,set:E=>{c.value=E,W.locale=c.value}}),_e=ce({get:()=>u.value,set:E=>{u.value=E,W.fallbackLocale=u.value,Dn(W,c.value,E)}}),ht=ce(()=>d.value),at=ce(()=>g.value),de=ce(()=>v.value);function ie(){return Ce(y)?y:null}function se(E){y=E,W.postTranslation=E}function Be(){return R}function Je(E){E!==null&&(b=Po(E)),R=E,W.missing=b}const we=(E,S,X,te,be,Ge)=>{ke();let Me;try{__INTLIFY_PROD_DEVTOOLS__,s||(W.fallbackContext=n?ed():void 0),Me=E(W)}finally{__INTLIFY_PROD_DEVTOOLS__,s||(W.fallbackContext=void 0)}if(X!=="translate exists"&&xe(Me)&&Me===es||X==="translate exists"&&!Me){const[en,ss]=S();return n&&D?te(n):be(en)}else{if(Ge(Me))return Me;throw Fe(Ae.UNEXPECTED_RETURN_TYPE)}};function Se(...E){return we(S=>Reflect.apply(bo,null,[S,...E]),()=>As(...E),"translate",S=>Reflect.apply(S.t,S,[...E]),S=>S,S=>V(S))}function ct(...E){const[S,X,te]=E;if(te&&!le(te))throw Fe(Ae.INVALID_ARGUMENT);return Se(S,X,We({resolvedMessage:!0},te||{}))}function tt(...E){return we(S=>Reflect.apply(yo,null,[S,...E]),()=>Rs(...E),"datetime format",S=>Reflect.apply(S.d,S,[...E]),()=>fo,S=>V(S))}function nt(...E){return we(S=>Reflect.apply(Co,null,[S,...E]),()=>Ds(...E),"number format",S=>Reflect.apply(S.n,S,[...E]),()=>fo,S=>V(S))}function Re(E){return E.map(S=>V(S)||xe(S)||re(S)?ko(String(S)):S)}const G={normalize:Re,interpolate:E=>E,type:"vnode"};function $(...E){return we(S=>{let X;const te=S;try{te.processor=G,X=Reflect.apply(bo,null,[te,...E])}finally{te.processor=null}return X},()=>As(...E),"translate",S=>S[Fs](...E),S=>[ko(S)],S=>Te(S))}function K(...E){return we(S=>Reflect.apply(Co,null,[S,...E]),()=>Ds(...E),"number format",S=>S[Us](...E),So,S=>V(S)||Te(S))}function ne(...E){return we(S=>Reflect.apply(yo,null,[S,...E]),()=>Rs(...E),"datetime format",S=>S[Ms](...E),So,S=>V(S)||Te(S))}function m(E){B=E,W.pluralRules=B}function _(E,S){return we(()=>{if(!E)return!1;const X=V(S)?S:c.value,te=O(X),be=W.messageResolver(te,E);return l?be!=null:Pt(be)||ut(be)||V(be)},()=>[E],"translate exists",X=>Reflect.apply(X.te,X,[E,S]),md,X=>re(X))}function p(E){let S=null;const X=Pa(W,u.value,c.value);for(let te=0;te{a&&(c.value=E,W.locale=E,Dn(W,c.value,u.value))}),fn(n.fallbackLocale,E=>{a&&(u.value=E,W.fallbackLocale=E,Dn(W,c.value,u.value))}));const M={id:No,locale:Z,fallbackLocale:_e,get inheritLocale(){return a},set inheritLocale(E){a=E,E&&n&&(c.value=n.locale.value,u.value=n.fallbackLocale.value,Dn(W,c.value,u.value))},get availableLocales(){return Object.keys(d.value).sort()},messages:ht,get modifiers(){return F},get pluralRules(){return B||{}},get isGlobal(){return s},get missingWarn(){return N},set missingWarn(E){N=E,W.missingWarn=N},get fallbackWarn(){return k},set fallbackWarn(E){k=E,W.fallbackWarn=k},get fallbackRoot(){return D},set fallbackRoot(E){D=E},get fallbackFormat(){return A},set fallbackFormat(E){A=E,W.fallbackFormat=A},get warnHtmlMessage(){return L},set warnHtmlMessage(E){L=E,W.warnHtmlMessage=E},get escapeParameter(){return x},set escapeParameter(E){x=E,W.escapeParameter=E},t:Se,getLocaleMessage:O,setLocaleMessage:P,mergeLocaleMessage:H,getPostTranslationHandler:ie,setPostTranslationHandler:se,getMissingHandler:Be,setMissingHandler:Je,[ja]:m};return M.datetimeFormats=at,M.numberFormats=de,M.rt=ct,M.te=_,M.tm=T,M.d=tt,M.n=nt,M.getDateTimeFormat=U,M.setDateTimeFormat=f,M.mergeDateTimeFormat=h,M.getNumberFormat=C,M.setNumberFormat=w,M.mergeNumberFormat=j,M[$a]=r,M[Fs]=$,M[Ms]=ne,M[Us]=K,M}function pd(e){const t=V(e.locale)?e.locale:xn,n=V(e.fallbackLocale)||Te(e.fallbackLocale)||Q(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,r=Ce(e.missing)?e.missing:void 0,s=re(e.silentTranslationWarn)||qt(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=re(e.silentFallbackWarn)||qt(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,o=re(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Q(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Ce(e.postTranslation)?e.postTranslation:void 0,d=V(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,g=!!e.escapeParameterHtml,v=re(e.sync)?e.sync:!0;let N=e.messages;if(Q(e.sharedMessages)){const x=e.sharedMessages;N=Object.keys(x).reduce((B,W)=>{const ae=B[W]||(B[W]={});return We(ae,x[W]),B},N||{})}const{__i18n:k,__root:D,__injectWithOption:A}=e,R=e.datetimeFormats,b=e.numberFormats,y=e.flatJson,L=e.translateExistCompatible;return{locale:t,fallbackLocale:n,messages:N,flatJson:y,datetimeFormats:R,numberFormats:b,missing:r,missingWarn:s,fallbackWarn:i,fallbackRoot:o,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:g,messageResolver:e.messageResolver,inheritLocale:v,translateExistCompatible:L,__i18n:k,__root:D,__injectWithOption:A}}function Hs(e={},t){{const n=mi(pd(e)),{__extender:r}=e,s={id:n.id,get locale(){return n.locale.value},set locale(i){n.locale.value=i},get fallbackLocale(){return n.fallbackLocale.value},set fallbackLocale(i){n.fallbackLocale.value=i},get messages(){return n.messages.value},get datetimeFormats(){return n.datetimeFormats.value},get numberFormats(){return n.numberFormats.value},get availableLocales(){return n.availableLocales},get formatter(){return{interpolate(){return[]}}},set formatter(i){},get missing(){return n.getMissingHandler()},set missing(i){n.setMissingHandler(i)},get silentTranslationWarn(){return re(n.missingWarn)?!n.missingWarn:n.missingWarn},set silentTranslationWarn(i){n.missingWarn=re(i)?!i:i},get silentFallbackWarn(){return re(n.fallbackWarn)?!n.fallbackWarn:n.fallbackWarn},set silentFallbackWarn(i){n.fallbackWarn=re(i)?!i:i},get modifiers(){return n.modifiers},get formatFallbackMessages(){return n.fallbackFormat},set formatFallbackMessages(i){n.fallbackFormat=i},get postTranslation(){return n.getPostTranslationHandler()},set postTranslation(i){n.setPostTranslationHandler(i)},get sync(){return n.inheritLocale},set sync(i){n.inheritLocale=i},get warnHtmlInMessage(){return n.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(i){n.warnHtmlMessage=i!=="off"},get escapeParameterHtml(){return n.escapeParameter},set escapeParameterHtml(i){n.escapeParameter=i},get preserveDirectiveContent(){return!0},set preserveDirectiveContent(i){},get pluralizationRules(){return n.pluralRules||{}},__composer:n,t(...i){const[o,l,a]=i,c={};let u=null,d=null;if(!V(o))throw Fe(Ae.INVALID_ARGUMENT);const g=o;return V(l)?c.locale=l:Te(l)?u=l:Q(l)&&(d=l),Te(a)?u=a:Q(a)&&(d=a),Reflect.apply(n.t,n,[g,u||d||{},c])},rt(...i){return Reflect.apply(n.rt,n,[...i])},tc(...i){const[o,l,a]=i,c={plural:1};let u=null,d=null;if(!V(o))throw Fe(Ae.INVALID_ARGUMENT);const g=o;return V(l)?c.locale=l:xe(l)?c.plural=l:Te(l)?u=l:Q(l)&&(d=l),V(a)?c.locale=a:Te(a)?u=a:Q(a)&&(d=a),Reflect.apply(n.t,n,[g,u||d||{},c])},te(i,o){return n.te(i,o)},tm(i){return n.tm(i)},getLocaleMessage(i){return n.getLocaleMessage(i)},setLocaleMessage(i,o){n.setLocaleMessage(i,o)},mergeLocaleMessage(i,o){n.mergeLocaleMessage(i,o)},d(...i){return Reflect.apply(n.d,n,[...i])},getDateTimeFormat(i){return n.getDateTimeFormat(i)},setDateTimeFormat(i,o){n.setDateTimeFormat(i,o)},mergeDateTimeFormat(i,o){n.mergeDateTimeFormat(i,o)},n(...i){return Reflect.apply(n.n,n,[...i])},getNumberFormat(i){return n.getNumberFormat(i)},setNumberFormat(i,o){n.setNumberFormat(i,o)},mergeNumberFormat(i,o){n.mergeNumberFormat(i,o)},getChoiceIndex(i,o){return-1}};return s.__extender=r,s}}const gi={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function _d({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((r,s)=>[...r,...s.type===st?s.children:[s]],[]):t.reduce((n,r)=>{const s=e[r];return s&&(n[r]=s()),n},pe())}function Ga(e){return st}const vd=ir({name:"i18n-t",props:We({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>xe(e)||!isNaN(e)}},gi),setup(e,t){const{slots:n,attrs:r}=t,s=e.i18n||cr({useScope:e.scope,__useComponent:!0});return()=>{const i=Object.keys(n).filter(d=>d!=="_"),o=pe();e.locale&&(o.locale=e.locale),e.plural!==void 0&&(o.plural=V(e.plural)?+e.plural:e.plural);const l=_d(t,i),a=s[Fs](e.keypath,l,o),c=We(pe(),r),u=V(e.tag)||le(e.tag)?e.tag:Ga();return Jr(u,c,a)}}}),xo=vd;function bd(e){return Te(e)&&!V(e[0])}function Ka(e,t,n,r){const{slots:s,attrs:i}=t;return()=>{const o={part:!0};let l=pe();e.locale&&(o.locale=e.locale),V(e.format)?o.key=e.format:le(e.format)&&(V(e.format.key)&&(o.key=e.format.key),l=Object.keys(e.format).reduce((g,v)=>n.includes(v)?We(pe(),g,{[v]:e.format[v]}):g,pe()));const a=r(e.value,o,l);let c=[o.key];Te(a)?c=a.map((g,v)=>{const N=s[g.type],k=N?N({[g.type]:g.value,index:v,parts:a}):[g.value];return bd(k)&&(k[0].key=`${g.type}-${v}`),k}):V(a)&&(c=[a]);const u=We(pe(),i),d=V(e.tag)||le(e.tag)?e.tag:Ga();return Jr(d,u,c)}}const yd=ir({name:"i18n-n",props:We({value:{type:Number,required:!0},format:{type:[String,Object]}},gi),setup(e,t){const n=e.i18n||cr({useScope:e.scope,__useComponent:!0});return Ka(e,t,Wa,(...r)=>n[Us](...r))}}),Io=yd,Ed=ir({name:"i18n-d",props:We({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},gi),setup(e,t){const n=e.i18n||cr({useScope:e.scope,__useComponent:!0});return Ka(e,t,Ua,(...r)=>n[Ms](...r))}}),Oo=Ed;function Cd(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const r=n.__getInstance(t);return r!=null?r.__composer:e.global.__composer}}function Td(e){const t=o=>{const{instance:l,modifiers:a,value:c}=o;if(!l||!l.$)throw Fe(Ae.UNEXPECTED_ERROR);const u=Cd(e,l.$),d=Lo(c);return[Reflect.apply(u.t,u,[...Ao(d)]),u]};return{created:(o,l)=>{const[a,c]=t(l);Rr&&e.global===c&&(o.__i18nWatcher=fn(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),o.__composer=c,o.textContent=a},unmounted:o=>{Rr&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:l})=>{if(o.__composer){const a=o.__composer,c=Lo(l);o.textContent=Reflect.apply(a.t,a,[...Ao(c)])}},getSSRProps:o=>{const[l]=t(o);return{textContent:l}}}}function Lo(e){if(V(e))return{path:e};if(Q(e)){if(!("path"in e))throw Fe(Ae.REQUIRED_VALUE,"path");return e}else throw Fe(Ae.INVALID_VALUE)}function Ao(e){const{path:t,locale:n,args:r,choice:s,plural:i}=e,o={},l=r||{};return V(n)&&(o.locale=n),xe(s)&&(o.plural=s),xe(i)&&(o.plural=i),[t,l,o]}function kd(e,t,...n){const r=Q(n[0])?n[0]:{},s=!!r.useI18nComponentName;(re(r.globalInstall)?r.globalInstall:!0)&&([s?"i18n":xo.name,"I18nT"].forEach(o=>e.component(o,xo)),[Io.name,"I18nN"].forEach(o=>e.component(o,Io)),[Oo.name,"I18nD"].forEach(o=>e.component(o,Oo))),e.directive("t",Td(t))}function wd(e,t,n){return{beforeCreate(){const r=Nn();if(!r)throw Fe(Ae.UNEXPECTED_ERROR);const s=this.$options;if(s.i18n){const i=s.i18n;if(s.__i18n&&(i.__i18n=s.__i18n),i.__root=t,this===this.$root)this.$i18n=Ro(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Hs(i);const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=Ro(e,s);else{this.$i18n=Hs({__i18n:s.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;s.__i18nGlobal&&Ba(t,s,s),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$tc=(...i)=>this.$i18n.tc(...i),this.$te=(i,o)=>this.$i18n.te(i,o),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(r,this.$i18n)},mounted(){},unmounted(){const r=Nn();if(!r)throw Fe(Ae.UNEXPECTED_ERROR);const s=this.$i18n;delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,s.__disposer&&(s.__disposer(),delete s.__disposer,delete s.__extender),n.__deleteInstance(r),delete this.$i18n}}}function Ro(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[ja](t.pluralizationRules||e.pluralizationRules);const n=ts(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(r=>e.mergeLocaleMessage(r,n[r])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(r=>e.mergeDateTimeFormat(r,t.datetimeFormats[r])),t.numberFormats&&Object.keys(t.numberFormats).forEach(r=>e.mergeNumberFormat(r,t.numberFormats[r])),e}const Sd=Jt("global-vue-i18n");function Nd(e={},t){const n=__VUE_I18N_LEGACY_API__&&re(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,r=re(e.globalInjection)?e.globalInjection:!0,s=__VUE_I18N_LEGACY_API__&&n?!!e.allowComposition:!0,i=new Map,[o,l]=Pd(e,n),a=Jt("");function c(g){return i.get(g)||null}function u(g,v){i.set(g,v)}function d(g){i.delete(g)}{const g={get mode(){return __VUE_I18N_LEGACY_API__&&n?"legacy":"composition"},get allowComposition(){return s},async install(v,...N){if(v.__VUE_I18N_SYMBOL__=a,v.provide(v.__VUE_I18N_SYMBOL__,g),Q(N[0])){const A=N[0];g.__composerExtend=A.__composerExtend,g.__vueI18nExtend=A.__vueI18nExtend}let k=null;!n&&r&&(k=Md(v,g.global)),__VUE_I18N_FULL_INSTALL__&&kd(v,g,...N),__VUE_I18N_LEGACY_API__&&n&&v.mixin(wd(l,l.__composer,g));const D=v.unmount;v.unmount=()=>{k&&k(),g.dispose(),D()}},get global(){return l},dispose(){o.stop()},__instances:i,__getInstance:c,__setInstance:u,__deleteInstance:d};return g}}function cr(e={}){const t=Nn();if(t==null)throw Fe(Ae.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Fe(Ae.NOT_INSTALLED);const n=xd(t),r=Od(n),s=Va(t),i=Id(e,s);if(__VUE_I18N_LEGACY_API__&&n.mode==="legacy"&&!e.__useComponent){if(!n.allowComposition)throw Fe(Ae.NOT_AVAILABLE_IN_LEGACY_MODE);return Dd(t,i,r,e)}if(i==="global")return Ba(r,e,s),r;if(i==="parent"){let a=Ld(n,t,e.__useComponent);return a==null&&(a=r),a}const o=n;let l=o.__getInstance(t);if(l==null){const a=We({},e);"__i18n"in s&&(a.__i18n=s.__i18n),r&&(a.__root=r),l=mi(a),o.__composerExtend&&(l[Ws]=o.__composerExtend(l)),Rd(o,t,l),o.__setInstance(t,l)}return l}function Pd(e,t,n){const r=vc();{const s=__VUE_I18N_LEGACY_API__&&t?r.run(()=>Hs(e)):r.run(()=>mi(e));if(s==null)throw Fe(Ae.UNEXPECTED_ERROR);return[r,s]}}function xd(e){{const t=Nt(e.isCE?Sd:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Fe(e.isCE?Ae.NOT_INSTALLED_WITH_PROVIDE:Ae.UNEXPECTED_ERROR);return t}}function Id(e,t){return Qr(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function Od(e){return e.mode==="composition"?e.global:e.global.__composer}function Ld(e,t,n=!1){let r=null;const s=t.root;let i=Ad(t,n);for(;i!=null;){const o=e;if(e.mode==="composition")r=o.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=o.__getInstance(i);l!=null&&(r=l.__composer,n&&r&&!r[$a]&&(r=null))}if(r!=null||s===i)break;i=i.parent}return r}function Ad(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function Rd(e,t,n){Yr(()=>{},t),or(()=>{const r=n;e.__deleteInstance(t);const s=r[Ws];s&&(s(),delete r[Ws])},t)}function Dd(e,t,n,r={}){const s=t==="local",i=ni(null);if(s&&e.proxy&&!(e.proxy.$options.i18n||e.proxy.$options.__i18n))throw Fe(Ae.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const o=re(r.inheritLocale)?r.inheritLocale:!V(r.locale),l=it(!s||o?n.locale.value:V(r.locale)?r.locale:xn),a=it(!s||o?n.fallbackLocale.value:V(r.fallbackLocale)||Te(r.fallbackLocale)||Q(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:l.value),c=it(ts(l.value,r)),u=it(Q(r.datetimeFormats)?r.datetimeFormats:{[l.value]:{}}),d=it(Q(r.numberFormats)?r.numberFormats:{[l.value]:{}}),g=s?n.missingWarn:re(r.missingWarn)||qt(r.missingWarn)?r.missingWarn:!0,v=s?n.fallbackWarn:re(r.fallbackWarn)||qt(r.fallbackWarn)?r.fallbackWarn:!0,N=s?n.fallbackRoot:re(r.fallbackRoot)?r.fallbackRoot:!0,k=!!r.fallbackFormat,D=Ce(r.missing)?r.missing:null,A=Ce(r.postTranslation)?r.postTranslation:null,R=s?n.warnHtmlMessage:re(r.warnHtmlMessage)?r.warnHtmlMessage:!0,b=!!r.escapeParameter,y=s?n.modifiers:Q(r.modifiers)?r.modifiers:{},L=r.pluralRules||s&&n.pluralRules;function x(){return[l.value,a.value,c.value,u.value,d.value]}const F=ce({get:()=>i.value?i.value.locale.value:l.value,set:p=>{i.value&&(i.value.locale.value=p),l.value=p}}),B=ce({get:()=>i.value?i.value.fallbackLocale.value:a.value,set:p=>{i.value&&(i.value.fallbackLocale.value=p),a.value=p}}),W=ce(()=>i.value?i.value.messages.value:c.value),ae=ce(()=>u.value),ke=ce(()=>d.value);function Z(){return i.value?i.value.getPostTranslationHandler():A}function _e(p){i.value&&i.value.setPostTranslationHandler(p)}function ht(){return i.value?i.value.getMissingHandler():D}function at(p){i.value&&i.value.setMissingHandler(p)}function de(p){return x(),p()}function ie(...p){return i.value?de(()=>Reflect.apply(i.value.t,null,[...p])):de(()=>"")}function se(...p){return i.value?Reflect.apply(i.value.rt,null,[...p]):""}function Be(...p){return i.value?de(()=>Reflect.apply(i.value.d,null,[...p])):de(()=>"")}function Je(...p){return i.value?de(()=>Reflect.apply(i.value.n,null,[...p])):de(()=>"")}function we(p){return i.value?i.value.tm(p):{}}function Se(p,T){return i.value?i.value.te(p,T):!1}function ct(p){return i.value?i.value.getLocaleMessage(p):{}}function tt(p,T){i.value&&(i.value.setLocaleMessage(p,T),c.value[p]=T)}function nt(p,T){i.value&&i.value.mergeLocaleMessage(p,T)}function Re(p){return i.value?i.value.getDateTimeFormat(p):{}}function I(p,T){i.value&&(i.value.setDateTimeFormat(p,T),u.value[p]=T)}function G(p,T){i.value&&i.value.mergeDateTimeFormat(p,T)}function $(p){return i.value?i.value.getNumberFormat(p):{}}function K(p,T){i.value&&(i.value.setNumberFormat(p,T),d.value[p]=T)}function ne(p,T){i.value&&i.value.mergeNumberFormat(p,T)}const m={get id(){return i.value?i.value.id:-1},locale:F,fallbackLocale:B,messages:W,datetimeFormats:ae,numberFormats:ke,get inheritLocale(){return i.value?i.value.inheritLocale:o},set inheritLocale(p){i.value&&(i.value.inheritLocale=p)},get availableLocales(){return i.value?i.value.availableLocales:Object.keys(c.value)},get modifiers(){return i.value?i.value.modifiers:y},get pluralRules(){return i.value?i.value.pluralRules:L},get isGlobal(){return i.value?i.value.isGlobal:!1},get missingWarn(){return i.value?i.value.missingWarn:g},set missingWarn(p){i.value&&(i.value.missingWarn=p)},get fallbackWarn(){return i.value?i.value.fallbackWarn:v},set fallbackWarn(p){i.value&&(i.value.missingWarn=p)},get fallbackRoot(){return i.value?i.value.fallbackRoot:N},set fallbackRoot(p){i.value&&(i.value.fallbackRoot=p)},get fallbackFormat(){return i.value?i.value.fallbackFormat:k},set fallbackFormat(p){i.value&&(i.value.fallbackFormat=p)},get warnHtmlMessage(){return i.value?i.value.warnHtmlMessage:R},set warnHtmlMessage(p){i.value&&(i.value.warnHtmlMessage=p)},get escapeParameter(){return i.value?i.value.escapeParameter:b},set escapeParameter(p){i.value&&(i.value.escapeParameter=p)},t:ie,getPostTranslationHandler:Z,setPostTranslationHandler:_e,getMissingHandler:ht,setMissingHandler:at,rt:se,d:Be,n:Je,tm:we,te:Se,getLocaleMessage:ct,setLocaleMessage:tt,mergeLocaleMessage:nt,getDateTimeFormat:Re,setDateTimeFormat:I,mergeDateTimeFormat:G,getNumberFormat:$,setNumberFormat:K,mergeNumberFormat:ne};function _(p){p.locale.value=l.value,p.fallbackLocale.value=a.value,Object.keys(c.value).forEach(T=>{p.mergeLocaleMessage(T,c.value[T])}),Object.keys(u.value).forEach(T=>{p.mergeDateTimeFormat(T,u.value[T])}),Object.keys(d.value).forEach(T=>{p.mergeNumberFormat(T,d.value[T])}),p.escapeParameter=b,p.fallbackFormat=k,p.fallbackRoot=N,p.fallbackWarn=v,p.missingWarn=g,p.warnHtmlMessage=R}return jl(()=>{if(e.proxy==null||e.proxy.$i18n==null)throw Fe(Ae.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const p=i.value=e.proxy.$i18n.__composer;t==="global"?(l.value=p.locale.value,a.value=p.fallbackLocale.value,c.value=p.messages.value,u.value=p.datetimeFormats.value,d.value=p.numberFormats.value):s&&_(p)}),m}const Fd=["locale","fallbackLocale","availableLocales"],Do=["t","rt","d","n","tm","te"];function Md(e,t){const n=Object.create(null);return Fd.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i)throw Fe(Ae.UNEXPECTED_ERROR);const o=Ue(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,s,o)}),e.config.globalProperties.$i18n=n,Do.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i||!i.value)throw Fe(Ae.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,i)}),()=>{delete e.config.globalProperties.$i18n,Do.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}hd();__INTLIFY_JIT_COMPILATION__?mo(od):mo(id);qh(Ih);Jh(Pa);if(__INTLIFY_PROD_DEVTOOLS__){const e=Wt();e.__INTLIFY__=!0,Wh(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const Yt=it({isOnline:!1,error:"",lastCheck:null}),De=it({chip:null,board:null,firmware:null,flash:null,assetsPartition:null,network:null,screen:null}),hn=it(""),Cr=it(!1),kn=it(null),Ud=e=>new URLSearchParams(window.location.search).get(e),Tr=async(e,t={})=>{if(!hn.value)throw new Error("Authentication token not found");const n=await fetch("/api/messaging/device/tools/call",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${hn.value}`},body:JSON.stringify({name:e,arguments:t})});if(n.ok)return await n.json();{const r=await n.text();console.error(`MCP tool ${e} failed:`,n.status,r);let s=`Failed to call ${e}`;try{const i=JSON.parse(r);i.message&&(s=i.message)}catch{s=`${s}: HTTP ${n.status}`}throw new Error(s)}},Wd=async()=>{var e,t,n,r;try{const[s,i,o]=await Promise.allSettled([Tr("self.get_system_info"),Tr("self.get_device_status"),Tr("self.screen.get_info")]);if(s.status==="fulfilled"&&s.value){const l=s.value.data||s.value;if(De.value.chip={model:l.chip_model_name||"Unknown"},De.value.board={model:((e=l.board)==null?void 0:e.name)||"Unknown"},De.value.firmware={version:((t=l.application)==null?void 0:t.version)||"Unknown"},l.flash_size){const a=Math.round(l.flash_size/1024/1024);De.value.flash={size:`${a}MB`}}else De.value.flash={size:"Unknown"};if(l.partition_table){const a=l.partition_table.find(c=>c.label==="assets");a?De.value.assetsPartition={size:a.size,sizeFormatted:`${Math.round(a.size/1024/1024)}MB`}:De.value.assetsPartition=null}else De.value.assetsPartition=null}else console.warn("Failed to get system info:",s.reason||s.value),De.value.chip={model:"Unknown"},De.value.board={model:"Unknown"},De.value.firmware={version:"Unknown"},De.value.flash={size:"Unknown"},De.value.assetsPartition=null;if(i.status==="fulfilled"&&i.value){const l=i.value.data||i.value;De.value.network={type:((n=l.network)==null?void 0:n.type)||"unknown",signal:((r=l.network)==null?void 0:r.signal)||"Unknown"}}else console.warn("Failed to get device state:",i.reason||i.value),De.value.network={type:"unknown",signal:"Unknown"};if(o.status==="fulfilled"&&o.value){const l=o.value.data||o.value;De.value.screen={resolution:`${l.width||0}x${l.height||0}`}}else console.warn("Failed to get screen info:",o.reason||o.value),De.value.screen={resolution:"Unknown"}}catch(s){console.error("Error getting device info:",s)}},ns=async()=>{if(!(Cr.value||!hn.value)){Cr.value=!0;try{const e=await fetch("/api/messaging/device/tools/list",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${hn.value}`}});if(e.ok)Yt.value.isOnline=!0,Yt.value.error="",Yt.value.lastCheck=new Date,await Wd();else throw new Error(`HTTP ${e.status}: ${e.statusText}`)}catch{Yt.value.isOnline=!1,Yt.value.error="",Yt.value.lastCheck=new Date,kn.value&&clearTimeout(kn.value),kn.value=setTimeout(ns,3e4)}finally{Cr.value=!1}}},Hd=(e,t)=>{if(!e)return t("device.signal.unknown");switch(e.toLowerCase()){case"strong":return t("device.signal.strong");case"medium":return t("device.signal.medium");case"weak":return t("device.signal.weak");case"none":return t("device.signal.none");default:return e}},jd=()=>{hn.value=Ud("token"),hn.value&&ns()},$d=()=>{kn.value&&(clearTimeout(kn.value),kn.value=null)},Vd=async()=>{await ns()};function Bd(){const e=ce(()=>!!hn.value),t=ce(()=>Yt.value.isOnline);return{deviceStatus:Yt,deviceInfo:De,isChecking:Cr,hasToken:e,isDeviceOnline:t,initializeDeviceStatus:jd,cleanupDeviceStatus:$d,refreshDeviceStatus:Vd,checkDeviceStatus:ns,callMcpTool:Tr,getSignalDisplayText:Hd}}const Fo={__name:"WifiIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-blue-500"}},setup(e){const t=e,n=ce(()=>`${t.size} ${t.color}`);return(r,s)=>(oe(),me("svg",{class:$e(n.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...s[0]||(s[0]=[z("path",{d:"M3 9c4.97-4.97 13.03-4.97 18 0","stroke-width":"2","stroke-linecap":"round"},null,-1),z("path",{d:"M6 12c3.31-3.31 8.69-3.31 12 0","stroke-width":"2","stroke-linecap":"round"},null,-1),z("path",{d:"M9 15c1.66-1.66 4.34-1.66 6 0","stroke-width":"2","stroke-linecap":"round"},null,-1),z("circle",{cx:"12",cy:"18",r:"1.5",fill:"currentColor"},null,-1)])],2))}},Mo={__name:"Signal4GIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-green-500"}},setup(e){const t=e,n=ce(()=>`${t.size} ${t.color}`);return(r,s)=>(oe(),me("svg",{class:$e(n.value),fill:"currentColor",viewBox:"0 0 24 24"},[...s[0]||(s[0]=[zr('4G',5)])],2))}},Uo={__name:"ChipIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-gray-400"}},setup(e){const t=e,n=ce(()=>`${t.size} ${t.color}`);return(r,s)=>(oe(),me("svg",{class:$e(n.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...s[0]||(s[0]=[zr('',14)])],2))}},Wo={__name:"FlashIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-gray-400"}},setup(e){const t=e,n=ce(()=>`${t.size} ${t.color}`);return(r,s)=>(oe(),me("svg",{class:$e(n.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...s[0]||(s[0]=[zr('',10)])],2))}},Ho={__name:"BoardIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-gray-400"}},setup(e){const t=e,n=ce(()=>`${t.size} ${t.color}`);return(r,s)=>(oe(),me("svg",{class:$e(n.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...s[0]||(s[0]=[zr('',10)])],2))}},jo={__name:"ScreenIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-gray-400"}},setup(e){const t=e,n=ce(()=>`${t.size} ${t.color}`);return(r,s)=>(oe(),me("svg",{class:$e(n.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...s[0]||(s[0]=[z("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},null,-1)])],2))}},Gd={class:"flex items-center space-x-2"},Kd={class:"flex items-center space-x-1"},Yd={key:0,class:"flex items-center space-x-1"},Xd={class:"text-xs text-gray-500"},zd={key:0,class:"flex items-center space-x-4 text-sm text-gray-600"},qd={key:0,class:"flex items-center space-x-1"},Jd={key:1,class:"flex items-center space-x-1"},Qd={key:2,class:"flex items-center space-x-1"},Zd={key:3,class:"flex items-center space-x-1"},em={key:1,class:"lg:hidden flex flex-col bg-white rounded-lg border border-gray-200 shadow-sm overflow-hidden"},tm={class:"flex items-center justify-between px-4 py-3 bg-gray-50 border-b border-gray-200"},nm={class:"flex items-center space-x-2"},rm={key:0,class:"flex items-center space-x-1"},sm={class:"text-xs font-medium text-gray-600"},im={key:0,class:"px-4 py-3"},om={class:"grid grid-cols-1 gap-2.5"},lm={class:"flex justify-between items-center py-1.5 border-b border-gray-100"},am={key:0,class:"flex items-center space-x-2 flex-1"},cm={class:"min-w-0 flex-1"},um={class:"text-xs text-gray-500 leading-tight"},fm={class:"text-sm text-gray-800 font-medium truncate"},hm={key:1,class:"flex items-center space-x-2 flex-1 ml-3"},dm={class:"min-w-0 flex-1"},mm={class:"text-xs text-gray-500 leading-tight"},gm={class:"text-sm text-gray-800 font-medium truncate"},pm={class:"flex justify-between items-center py-1.5"},_m={key:0,class:"flex items-center space-x-2 flex-1"},vm={class:"min-w-0 flex-1"},bm={class:"text-xs text-gray-500 leading-tight"},ym={class:"text-sm text-gray-800 font-medium"},Em={key:1,class:"flex items-center space-x-2 flex-1 ml-3"},Cm={class:"min-w-0 flex-1"},Tm={class:"text-xs text-gray-500 leading-tight"},km={class:"text-sm text-gray-800 font-medium"},wm={__name:"DeviceStatus",setup(e){const{t}=cr(),{deviceStatus:n,deviceInfo:r,hasToken:s,initializeDeviceStatus:i,cleanupDeviceStatus:o,getSignalDisplayText:l}=Bd(),a=ce(()=>s.value);return Yr(()=>{i()}),or(()=>{o()}),(c,u)=>(oe(),me(st,null,[a.value?(oe(),me("div",{key:0,class:$e(["hidden lg:flex items-center space-x-4",Y(n).isOnline?"":"opacity-60"])},[z("div",Gd,[z("div",Kd,[z("div",{class:$e(["w-2 h-2 rounded-full",Y(n).isOnline?"bg-green-500":"bg-gray-400"])},null,2),z("span",{class:$e(["text-sm font-medium",Y(n).isOnline?"text-gray-700":"text-gray-500"])},Ne(Y(n).isOnline?c.$t("device.online"):c.$t("device.offline")),3)]),Y(n).isOnline&&Y(r).network?(oe(),me("div",Yd,[Y(r).network.type==="wifi"?(oe(),Un(Y(Fo),{key:0,color:"text-blue-500"})):Y(r).network.type==="4g"?(oe(),Un(Y(Mo),{key:1})):Le("",!0),z("span",Xd,Ne(Y(l)(Y(r).network.signal,Y(t))),1)])):Le("",!0)]),Y(n).isOnline?(oe(),me("div",zd,[Y(r).chip?(oe(),me("div",qd,[Ee(Y(Uo)),z("span",null,Ne(Y(r).chip.model),1)])):Le("",!0),Y(r).flash?(oe(),me("div",Jd,[Ee(Y(Wo)),z("span",null,Ne(Y(r).flash.size),1)])):Le("",!0),Y(r).board?(oe(),me("div",Qd,[Ee(Y(Ho)),z("span",null,Ne(Y(r).board.model),1)])):Le("",!0),Y(r).screen?(oe(),me("div",Zd,[Ee(Y(jo)),z("span",null,Ne(Y(r).screen.resolution),1)])):Le("",!0)])):Le("",!0)],2)):Le("",!0),a.value?(oe(),me("div",em,[z("div",tm,[z("div",nm,[z("div",{class:$e(["w-2.5 h-2.5 rounded-full",Y(n).isOnline?"bg-green-500":"bg-red-400"])},null,2),z("span",{class:$e(["text-sm font-medium",Y(n).isOnline?"text-gray-800":"text-gray-600"])},Ne(Y(n).isOnline?c.$t("device.online"):c.$t("device.offline")),3)]),Y(n).isOnline&&Y(r).network?(oe(),me("div",rm,[Y(r).network.type==="wifi"?(oe(),Un(Y(Fo),{key:0,color:"text-blue-500"})):Y(r).network.type==="4g"?(oe(),Un(Y(Mo),{key:1})):Le("",!0),z("span",sm,Ne(Y(l)(Y(r).network.signal,Y(t))),1)])):Le("",!0)]),Y(n).isOnline?(oe(),me("div",im,[z("div",om,[z("div",lm,[Y(r).chip?(oe(),me("div",am,[Ee(Y(Uo),{class:"flex-shrink-0"}),z("div",cm,[z("div",um,Ne(c.$t("device.chip")),1),z("div",fm,Ne(Y(r).chip.model),1)])])):Le("",!0),Y(r).board?(oe(),me("div",hm,[Ee(Y(Ho),{class:"flex-shrink-0"}),z("div",dm,[z("div",mm,Ne(c.$t("device.board")),1),z("div",gm,Ne(Y(r).board.model),1)])])):Le("",!0)]),z("div",pm,[Y(r).flash?(oe(),me("div",_m,[Ee(Y(Wo),{class:"flex-shrink-0"}),z("div",vm,[z("div",bm,Ne(c.$t("device.flash")),1),z("div",ym,Ne(Y(r).flash.size),1)])])):Le("",!0),Y(r).screen?(oe(),me("div",Em,[Ee(Y(jo),{class:"flex-shrink-0"}),z("div",Cm,[z("div",Tm,Ne(c.$t("device.screen")),1),z("div",km,Ne(Y(r).screen.resolution),1)])])):Le("",!0)])])])):Le("",!0)])):Le("",!0)],64))}},Sm={title:"Xiaozhi AI Customization"},Nm={cancel:"Cancel",confirm:"Confirm",close:"Close",start:"Start",download:"Download",generate:"Generate",reset:"Reset",yes:"Yes",no:"No",loading:"Loading...",error:"Error",success:"Success",warning:"Warning",info:"Information",next:"Next",previous:"Previous",finish:"Finish",retry:"Retry",ok:"OK",other:"Other"},Pm={title:"Xiaozhi AI Customization"},xm={title:"Saved Configuration Detected",message:"Configuration has been automatically restored. You can continue from where you left off or start over.",restart:"Start Over"},Im={chip:"Chip Configuration",theme:"Theme Design",generate:"Preview & Generate"},Om={title:"Generate assets.bin",confirmConfig:"Please confirm your configuration",chipModel:"Chip Model:",resolution:"Resolution:",wakeword:"Wake Word:",font:"Font:",emoji:"Emoji Package:",fileList:"Included Files List",estimated:"Estimated",compressed:"Before compression",generating:"Generating assets.bin...",progress:"{progress}% Complete",completed:"Your assets.bin file is ready",filename:"Filename: assets.bin",fileSize:"File Size: {size}",generationTime:"Generation Time: {time}",downloadAssets:"Download assets.bin",flashToDevice:"Flash to Device Online",flashing:"Flashing to device...",flashingCancel:"Cancel Flash",flashingError:"Flashing Error",flashingInProgress:"Flashing in progress, please do not close the window",customFont:"Custom Font",customEmoji:"Custom Emoji Package",notConfigured:"Not Configured",wakewordNames:{wn9s_hilexin:"Hi, Espressif",wn9s_hiesp:"Hi, ESP",wn9s_nihaoxiaozhi:"Hello Xiaozhi",wn9_nihaoxiaozhi_tts:"Hello Xiaozhi",wn9_alexa:"Alexa"}},Lm={init:"Initialize Generator",font:"Process Font Files",wakeword:"Package Wake Word Model",emoji:"Process Emoji Images",background:"Process Background Images",index:"Generate Index File",spiffs:"Build SPIFFS Mapping",package:"Complete Packaging"},Am={title:"Wake Word Configuration",description:"Select a preset wake word model or customize it using a command recognition model.",supportWakeNet9:"Your chip supports WakeNet9 models.",supportWakeNet9s:"Your chip supports WakeNet9s models.",notSupported:"Your chip does not support wake word functionality.",notice:"Note:",unsupportedMessage:"{chipModel} chip does not support wake word functionality. If you need to use wake words, please select ESP32-S3, ESP32-P4, or ESP32-C3/C5/C6 chips.",noWakeword:"No Wake Word",presetWakeword:"Preset Wake Word",customWakeword:"Custom Wake Word",selectWakeword:"Select Wake Word",placeholder:"Select wake word...",customSettings:"Custom Wake Word Settings",wakewordName:"Wake Word Name",wakewordNamePlaceholder:"e.g., Xiaozhi / Potato",wakewordCommand:"Wake Command",wakewordCommandPlaceholderEN:"English words, no punctuation, e.g., HELLO POTATO",threshold:"Sensitivity Threshold (0-100)",thresholdDesc:"Lower is more sensitive, default 20",duration:"Recognition Duration",durationDesc:"Maximum duration for command recognition",selectModel:"Select Recognition Model",mn6en:"MultiNet6 (English)",mn7en:"MultiNet7 (English)",errors:{nameRequired:"Please enter wake word name",commandRequired:"Please enter wake command",noPunctuation:"Command cannot contain punctuation",durationRange:"Duration must be between 500-10000ms"},tips:{tipLabel:"Tip:",optional:"Wake words are optional. If disabled, the device cannot be voice-activated.",wakeNet9sOnly:"C3/C5/C6 chips only support WakeNet9s lightweight models.",wakeNet9Full:"S3/P4 chips support complete WakeNet9 models with more choices.",customSupport:"Custom wake words use MultiNet models, currently only supported on ESP32-S3."}},Rm={resetFailed:"Reset failed, please refresh the page and try again",generationFailed:"Generation failed: {error}",noFileToDownload:"No downloadable file available",deviceOffline:"Device is offline and cannot be flashed",fileTooLarge:"Flash failed: File size {fileSize}MB exceeds assets partition size {partitionSize}MB. Please reduce configuration content or use a device with larger capacity.",flashCancelConfirm:"Are you sure you want to cancel flashing?",oldDataCleared:`Old version emoji data structure has been detected and cleared. The new version uses file deduplication technology to save storage space. @@ -41,12 +41,12 @@ Please re-upload custom emoji images.`,incompatibleEmojiData:"Incompatible emoji Phiên bản mới sử dụng công nghệ loại bỏ trùng lặp tệp để tiết kiệm không gian lưu trữ. -Vui lòng tải lại hình ảnh biểu tượng cảm xúc tùy chỉnh.`,incompatibleEmojiData:"Phát hiện dữ liệu biểu tượng cảm xúc không tương thích, vui lòng cấu hình lại"},Zm={authTokenMissing:"Không tìm thấy mã thông báo xác thực",checkingDeviceStatus:"Đang kiểm tra trạng thái thiết bị...",deviceOfflineOrUnresponsive:"Thiết bị ngoại tuyến hoặc không phản hồi: {error}",unableToGetDeviceStatus:"Không thể lấy trạng thái thiết bị",initializingTransferService:"Đang khởi tạo dịch vụ truyền tải...",initializeTransferFailed:"Khởi tạo dịch vụ truyền tải thất bại: {error}",settingDeviceDownloadUrl:"Đang thiết lập URL tải xuống thiết bị...",setDownloadUrlFailed:"Thiết lập URL tải xuống thất bại: {error}",rebootingDevice:"Đang khởi động lại thiết bị...",waitingForDeviceReboot:"Đang chờ thiết bị khởi động lại...",deviceRebootTimeout:"Hết thời gian chờ thiết bị khởi động lại (60 giây)",startingFileTransfer:"Đang bắt đầu truyền tải tệp...",flashCompleted:"Flash hoàn thành!",onlineFlashFailed:"Flash trực tuyến thất bại: {error}"},eg={online:"Trực tuyến",offline:"Ngoại tuyến",checking:"Đang kiểm tra...",flashing:"Đang flash...",ready:"Sẵn sàng",chip:"Chip",board:"Bo mạch",flash:"Flash",screen:"Màn hình",signal:{unknown:"Không xác định",strong:"Mạnh",medium:"Trung bình",weak:"Yếu",none:"Không có tín hiệu"}},tg={title:"Bước 1: Cấu hình mô hình chip và màn hình",loadingFromDevice:"Đang tải cấu hình phần cứng từ thiết bị...",loadedFromDevice:"Cấu hình phần cứng được tải tự động từ thiết bị",manualConfig:"Vui lòng cấu hình các thông số phần cứng theo cách thủ công",loadingTitle:"Đang tải cấu hình thiết bị...",loadingDesc:"Đang đọc mô hình chip và độ phân giải màn hình từ thiết bị",autoLoadedTitle:"Cấu hình thiết bị được tải tự động",chipModel:"Mô hình chip",screenWidth:"Chiều rộng màn hình",screenHeight:"Chiều cao màn hình",colorFormat:"Định dạng màu:",manualEdit:"Cấu hình thủ công",collapseManual:"Thu gọn cấu hình thủ công",manualConfigTitle:"Cấu hình phần cứng thủ công",next:"Tiếp theo",selectChip:"Chọn chip",chipRequired:"Mô hình chip",widthRequired:"Chiều rộng màn hình",heightRequired:"Chiều cao màn hình",loadingError:"Lỗi tải cấu hình",deviceOffline:"Thiết bị chưa kết nối hoặc ngoại tuyến",chipModelError:"Không thể lấy mô hình chip, vui lòng nhập thủ công",resolutionError:"Không thể lấy độ phân giải màn hình, vui lòng nhập thủ công",timeoutError:"Hết thời gian tải cấu hình, vui lòng nhập thủ công",manualConfigDesc:"Không thể tự động đọc cấu hình thiết bị",manualConfigHint:"Thiết bị chưa kết nối hoặc ngoại tuyến, vui lòng nhập cấu hình phần cứng thủ công",manualConfigRequired:"Vui lòng nhập cấu hình phần cứng thủ công",resolutionFormatError:"Lỗi định dạng độ phân giải màn hình"},ng={title:"Bước 2: Thiết kế chủ đề",description:"Cấu hình từ đánh thức, phông chữ, biểu tượng cảm xúc và nền để tùy chỉnh chủ đề Xiaozhi AI của bạn.",previous:"Trước đó",next:"Tiếp theo",tabs:{wakeword:"Cấu hình từ đánh thức",font:"Cấu hình phông chữ",emoji:"Bộ sưu tập biểu tượng cảm xúc",background:"Nền trò chuyện"}},rg={title:"Bước 3: Xem trước",description:"Xem trước hiệu ứng của cấu hình tùy chỉnh trên thiết bị thực tế.",devicePreview:"Xem trước thiết bị (tỷ lệ pixel 1:1)",previewSettings:"Cài đặt xem trước",previewText:"Văn bản xem trước",defaultPreviewText:"Xin chào, tôi là bạn của bạn Xiaozhi!",currentEmotion:"Cảm xúc hiện tại",themeMode:"Chế độ chủ đề",lightMode:"Sáng",darkMode:"Tối",configSummary:"Tóm tắt cấu hình",wakeword:"Từ đánh thức:",font:"Phông chữ:",loading:"Đang tải...",emotion:"Cảm xúc:",skin:"Da:",previous:"Trước đó",generate:"Tạo assets.bin",emotions:{neutral:"Trung lập",happy:"Vui vẻ",laughing:"Cười lớn",funny:"Hài hước",sad:"Buồn",angry:"Giận dữ",crying:"Khóc",loving:"Yêu thương",embarrassed:"Xấu hổ",surprised:"Bất ngờ",shocked:"Sốc",thinking:"Suy nghĩ",winking:"Nháy mắt",cool:"Ngầu",relaxed:"Thoải mái",delicious:"Ngon miệng",kissy:"Hôn",confident:"Tự tin",sleepy:"Buồn ngủ",silly:"Ngớ ngẩn",confused:"Bối rối"},noEmotionConfigured:"Chưa cấu hình cảm xúc",fontLoading:"Đang tải phông chữ...",configureEmojiFirst:"Vui lòng cấu hình gói biểu tượng cảm xúc trong thiết kế chủ đề trước",customFont:"Phông chữ tùy chỉnh {size}px",customEmoji:"Biểu tượng cảm xúc tùy chỉnh {count} hình ảnh",notConfigured:"Chưa cấu hình",skinLight:"Sáng {type}",skinDark:"Tối {type}",hideSubtitle:"Ẩn phụ đề:",image:"Hình ảnh",color:"Màu sắc"},sg={title:"Cấu hình nền trò chuyện",description:"Cấu hình nền trò chuyện cho chế độ sáng và tối, hỗ trợ màu đơn hoặc hình ảnh tùy chỉnh.",lightMode:"Nền chế độ sáng",darkMode:"Nền chế độ tối",solidBackground:"Nền màu đơn",imageBackground:"Nền hình ảnh",backgroundColor:"Màu nền:",textColor:"Màu chữ:",backgroundImage:"Hình ảnh nền:",clickOrDragToUpload:"Nhấp hoặc kéo để tải lên hình ảnh nền",removeImage:"Xóa hình ảnh",backgroundPreview:"Xem trước nền",lightModePreview:"Chế độ sáng",darkModePreview:"Chế độ tối",chatArea:"Khu vực nội dung trò chuyện",quickConfig:"Cấu hình nhanh",defaultColors:"Màu mặc định",stoneTexture:"Kết cấu đá",sunnyColors:"Màu nắng",skyBlue:"Xanh trời",romanticPink:"Hồng lãng mạn",selectValidImage:"Vui lòng chọn tệp hình ảnh hợp lệ"},ig={title:"Cấu hình bộ sưu tập biểu tượng cảm xúc",description:"Chọn gói biểu tượng cảm xúc đặt sẵn hoặc hình ảnh biểu tượng cảm xúc tùy chỉnh. Mỗi gói biểu tượng cảm xúc chứa 21 biểu cảm cảm xúc khác nhau.",noEmojiPack:"Không có gói biểu tượng cảm xúc",noEmojiPackDescription:"Không cấu hình gói biểu tượng cảm xúc, chỉ bao gồm phông chữ và tài nguyên nền trong gói.",presetEmojiPack:"Gói biểu tượng cảm xúc đặt sẵn",customEmojiPack:"Gói biểu tượng cảm xúc tùy chỉnh",selectPresetEmojiPack:"Chọn gói biểu tượng cảm xúc đặt sẵn",twemoji64:"Twemoji 64×64",twemoji32:"Twemoji 32×32",twemojiDescription:"Bộ biểu tượng cảm xúc chất lượng cao từ Twitter, hoàn hảo để hiển thị rõ ràng",twitterEmojiName:"Twemoji {size}x{size}",twitterEmojiDescription:"Gói biểu tượng cảm xúc Twitter, {size}×{size} pixel",size:"Kích thước",preview:"Xem trước",select:"Chọn",customEmojiTitle:"Gói biểu tượng cảm xúc tùy chỉnh",customEmojiDescription:"Tải lên hình ảnh biểu tượng cảm xúc của riêng bạn. Mỗi cảm xúc cần một hình ảnh.",uploadInstructions:"Nhấp hoặc kéo để tải lên hình ảnh biểu tượng cảm xúc (PNG/JPG/WEBP)",supportedFormats:"Định dạng được hỗ trợ: PNG, JPG, WEBP. Kích thước khuyến nghị: 64×64 pixel",emotionMapping:"Ánh xạ cảm xúc",uploadAllEmotions:"Vui lòng tải lên hình ảnh biểu tượng cảm xúc cho tất cả cảm xúc",maxImageWidth:"Chiều rộng hình ảnh tối đa (px)",maxImageHeight:"Chiều cao hình ảnh tối đa (px)",clickToUpload:"Nhấp để tải lên",orDragDrop:"hoặc kéo và thả",clickToUploadOrDrag:"Nhấp để tải lên hoặc kéo vào đây",remove:"Xóa",replace:"Thay thế",selectValidEmojiImage:"Vui lòng chọn tệp hình ảnh biểu tượng cảm xúc hợp lệ",selectValidFormat:"Vui lòng chọn hình ảnh định dạng PNG hoặc GIF hợp lệ",maxFileSize:"Kích thước tệp không được vượt quá 1MB",invalidFormat:"Định dạng hình ảnh không được hỗ trợ. Vui lòng sử dụng PNG, JPG hoặc WEBP.",required:"Bắt buộc",uploadEmojiImages:"Tải lên hình ảnh biểu tượng cảm xúc (GIF cần PSRAM)",customEmojiPackConfig:"Cấu hình gói biểu tượng cảm xúc tùy chỉnh",neutralRequiredNotice:"* Phải tải lên cảm xúc mặc định trung lập, các cảm xúc khác là tùy chọn. Nếu không tải lên, cảm xúc mặc định sẽ được sử dụng thay thế.",sharedFileMessage:"Cảm xúc {emotionKey} sử dụng cùng tệp hình ảnh với {existingEmotions} (lưu trữ chia sẻ)",fileDeleted:"Tệp {fileHash} đã bị xóa (không có tham chiếu cảm xúc khác)",fileRetained:"Tệp {fileHash} vẫn được sử dụng bởi các cảm xúc khác, được giữ lại",imageLoadFailed:"Không tải được hình ảnh biểu tượng cảm xúc",emotions:{neutral:"Trung lập",happy:"Vui vẻ",laughing:"Cười lớn",funny:"Hài hước",sad:"Buồn",angry:"Giận dữ",crying:"Khóc",loving:"Yêu thương",embarrassed:"Xấu hổ",surprised:"Bất ngờ",shocked:"Sốc",thinking:"Suy nghĩ",winking:"Nháy mắt",cool:"Ngầu",relaxed:"Thoải mái",delicious:"Ngon miệng",kissy:"Hôn",confident:"Tự tin",sleepy:"Buồn ngủ",silly:"Ngớ ngẩn",confused:"Bối rối"}},og={title:"Cấu hình phông chữ",description:"Chọn phông chữ đặt sẵn hoặc tải lên tệp phông chữ tùy chỉnh.",noFonts:"Không có phông chữ",noFontsDescription:"Không sử dụng cấu hình phông chữ, thiết bị sẽ sử dụng phông chữ mặc định",presetFonts:"Phông chữ đặt sẵn",customFonts:"Phông chữ tùy chỉnh",selectPresetFont:"Chọn phông chữ đặt sẵn",fontSize:"Kích thước phông chữ:",bitDepth:"Độ sâu bit:",charset:"Bộ ký tự:",fileSize:"Kích thước tệp:",customFontConfig:"Cấu hình phông chữ tùy chỉnh",fontFile:"Tệp phông chữ",clickSelectFontFile:"Nhấp để chọn tệp phông chữ",orDragFileHere:"hoặc kéo tệp vào đây",supportedFormats:"Hỗ trợ định dạng TTF, WOFF, WOFF2",removeFile:"Xóa tệp",fontSizePx:"Kích thước phông chữ (px)",range:"Phạm vi:",bitDepthBpp:"Độ sâu bit (BPP)",monochrome:"1 bpp (Đơn sắc)",fourColors:"2 bpp (4 màu)",sixteenColors:"4 bpp (16 màu)",characterSet:"Bộ ký tự",deepseekR1:"DeepSeek R1 (7405 ký tự)",qwen18409:"Qwen (18409 ký tự)",latin1:"Latin1 (190 ký tự)",fullCharset:"Bộ ký tự đầy đủ (Tất cả ký tự trong tệp phông chữ)",hideSubtitle:"Ẩn phụ đề",hideSubtitleDescription:"Không hiển thị phụ đề văn bản trong khi trò chuyện",selectValidFontFile:"Vui lòng chọn tệp phông chữ hợp lệ (TTF, WOFF, WOFF2)",presetFontNames:{font_puhui_deepseek_14_1:"Alibaba PuHuiTi 14px",font_puhui_deepseek_16_4:"Alibaba PuHuiTi 16px",font_puhui_deepseek_20_4:"Alibaba PuHuiTi 20px",font_puhui_deepseek_30_4:"Alibaba PuHuiTi 30px",font_noto_qwen_14_1:"Noto Sans 14px",font_noto_qwen_16_4:"Noto Sans 16px",font_noto_qwen_20_4:"Noto Sans 20px",font_noto_qwen_30_4:"Noto Sans 30px"},charsetDeepseek:"DeepSeek 7405",charsetQwen:"Qwen 18409"},lg={app:Bm,common:Gm,header:Km,configNotice:Ym,steps:Xm,generateModal:zm,progressSteps:qm,wakewordConfig:Jm,errors:Qm,flashProgress:Zm,device:eg,chipConfig:tg,themeDesign:ng,generateSummary:rg,backgroundConfig:sg,emojiConfig:ig,fontConfig:og},ag={en:Vm,vi:lg},gr=[{code:"en",name:"English",flag:"🇺🇸"},{code:"vi",name:"Tiếng Việt",flag:"🇻🇳"}];function cg(){const e=navigator.language||navigator.userLanguage;return{vi:"vi",en:"en","en-US":"en","en-GB":"en"}[e]||"en"}const ug={class:"relative"},fg={class:"py-1"},hg=["onClick"],dg={class:"mr-3"},mg={key:0,class:"ml-auto w-4 h-4 text-blue-600",fill:"currentColor",viewBox:"0 0 20 20"},gg={__name:"LanguageSelector",setup(e){const{locale:t}=cr(),n=it(!1),r=ce(()=>gr.find(a=>a.code===t.value)||gr[0]),s=()=>{n.value=!n.value},i=()=>{n.value=!1},o=a=>{t.value=a,localStorage.setItem("user-language",a),i()},l=a=>{a.target.closest(".relative")||i()};return Yr(()=>{document.addEventListener("click",l);const a=localStorage.getItem("user-language");a&&gr.find(c=>c.code===a)&&(t.value=a)}),or(()=>{document.removeEventListener("click",l)}),(a,c)=>(oe(),me("div",ug,[z("button",{onClick:s,class:"flex items-center space-x-2 px-3 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"},[z("span",null,Ne(r.value.flag),1),z("span",null,Ne(r.value.name),1),(oe(),me("svg",{class:$e(["w-4 h-4 transition-transform duration-200",{"rotate-180":n.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...c[1]||(c[1]=[z("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))]),n.value?(oe(),me("div",{key:0,class:"absolute right-0 mt-2 w-48 bg-white border border-gray-200 rounded-md shadow-lg z-50",onClick:c[0]||(c[0]=kf(()=>{},["stop"]))},[z("div",fg,[(oe(!0),me(st,null,hu(Y(gr),u=>(oe(),me("button",{key:u.code,onClick:h=>o(u.code),class:$e(["flex items-center w-full px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100",{"bg-blue-50 text-blue-700":u.code===r.value.code}])},[z("span",dg,Ne(u.flag),1),z("span",null,Ne(u.name),1),u.code===r.value.code?(oe(),me("svg",mg,[...c[2]||(c[2]=[z("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):Le("",!0)],10,hg))),128))])])):Le("",!0),n.value?(oe(),me("div",{key:1,class:"fixed inset-0 z-40",onClick:i})):Le("",!0)]))}},pg={class:"min-h-screen bg-gray-50"},_g={class:"bg-white shadow-sm border-b"},vg={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4"},bg={class:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 sm:gap-0"},yg={class:"text-2xl font-bold text-gray-900"},Eg={class:"flex items-center space-x-4"},Cg={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"},Tg={__name:"App",setup(e){return(t,n)=>{const r=fu("router-view");return oe(),me("div",pg,[z("header",_g,[z("div",vg,[z("div",bg,[z("h1",yg,Ne(t.$t("header.title")),1),z("div",Eg,[Ee(wm),Ee(gg)])])])]),z("main",Cg,[Ee(r)])])}}},kg="modulepreload",wg=function(e){return"/tools/assets-generator/"+e},$o={},Sg=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(a=>{if(a=wg(a),a in $o)return;$o[a]=!0;const c=a.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${u}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":kg,c||(h.as="script"),h.crossOrigin="",h.href=a,l&&h.setAttribute("nonce",l),document.head.appendChild(h),c)return new Promise((g,v)=>{h.addEventListener("load",g),h.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${a}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};/*! +Vui lòng tải lại hình ảnh biểu tượng cảm xúc tùy chỉnh.`,incompatibleEmojiData:"Phát hiện dữ liệu biểu tượng cảm xúc không tương thích, vui lòng cấu hình lại"},Zm={authTokenMissing:"Không tìm thấy mã thông báo xác thực",checkingDeviceStatus:"Đang kiểm tra trạng thái thiết bị...",deviceOfflineOrUnresponsive:"Thiết bị ngoại tuyến hoặc không phản hồi: {error}",unableToGetDeviceStatus:"Không thể lấy trạng thái thiết bị",initializingTransferService:"Đang khởi tạo dịch vụ truyền tải...",initializeTransferFailed:"Khởi tạo dịch vụ truyền tải thất bại: {error}",settingDeviceDownloadUrl:"Đang thiết lập URL tải xuống thiết bị...",setDownloadUrlFailed:"Thiết lập URL tải xuống thất bại: {error}",rebootingDevice:"Đang khởi động lại thiết bị...",waitingForDeviceReboot:"Đang chờ thiết bị khởi động lại...",deviceRebootTimeout:"Hết thời gian chờ thiết bị khởi động lại (60 giây)",startingFileTransfer:"Đang bắt đầu truyền tải tệp...",flashCompleted:"Flash hoàn thành!",onlineFlashFailed:"Flash trực tuyến thất bại: {error}"},eg={online:"Trực tuyến",offline:"Ngoại tuyến",checking:"Đang kiểm tra...",flashing:"Đang flash...",ready:"Sẵn sàng",chip:"Chip",board:"Bo mạch",flash:"Flash",screen:"Màn hình",signal:{unknown:"Không xác định",strong:"Mạnh",medium:"Trung bình",weak:"Yếu",none:"Không có tín hiệu"}},tg={title:"Bước 1: Cấu hình mô hình chip và màn hình",loadingFromDevice:"Đang tải cấu hình phần cứng từ thiết bị...",loadedFromDevice:"Cấu hình phần cứng được tải tự động từ thiết bị",manualConfig:"Vui lòng cấu hình các thông số phần cứng theo cách thủ công",loadingTitle:"Đang tải cấu hình thiết bị...",loadingDesc:"Đang đọc mô hình chip và độ phân giải màn hình từ thiết bị",autoLoadedTitle:"Cấu hình thiết bị được tải tự động",chipModel:"Mô hình chip",screenWidth:"Chiều rộng màn hình",screenHeight:"Chiều cao màn hình",colorFormat:"Định dạng màu:",manualEdit:"Cấu hình thủ công",collapseManual:"Thu gọn cấu hình thủ công",manualConfigTitle:"Cấu hình phần cứng thủ công",next:"Tiếp theo",selectChip:"Chọn chip",chipRequired:"Mô hình chip",widthRequired:"Chiều rộng màn hình",heightRequired:"Chiều cao màn hình",loadingError:"Lỗi tải cấu hình",deviceOffline:"Thiết bị chưa kết nối hoặc ngoại tuyến",chipModelError:"Không thể lấy mô hình chip, vui lòng nhập thủ công",resolutionError:"Không thể lấy độ phân giải màn hình, vui lòng nhập thủ công",timeoutError:"Hết thời gian tải cấu hình, vui lòng nhập thủ công",manualConfigDesc:"Không thể tự động đọc cấu hình thiết bị",manualConfigHint:"Thiết bị chưa kết nối hoặc ngoại tuyến, vui lòng nhập cấu hình phần cứng thủ công",manualConfigRequired:"Vui lòng nhập cấu hình phần cứng thủ công",resolutionFormatError:"Lỗi định dạng độ phân giải màn hình"},ng={title:"Bước 2: Thiết kế chủ đề",description:"Cấu hình từ đánh thức, phông chữ, biểu tượng cảm xúc và nền để tùy chỉnh chủ đề Xiaozhi AI của bạn.",previous:"Trước đó",next:"Tiếp theo",tabs:{wakeword:"Cấu hình từ đánh thức",font:"Cấu hình phông chữ",emoji:"Bộ sưu tập biểu tượng cảm xúc",background:"Nền trò chuyện"}},rg={title:"Bước 3: Xem trước",description:"Xem trước hiệu ứng của cấu hình tùy chỉnh trên thiết bị thực tế.",devicePreview:"Xem trước thiết bị (tỷ lệ pixel 1:1)",previewSettings:"Cài đặt xem trước",previewText:"Văn bản xem trước",defaultPreviewText:"Xin chào, tôi là bạn của bạn Xiaozhi!",currentEmotion:"Cảm xúc hiện tại",themeMode:"Chế độ chủ đề",lightMode:"Sáng",darkMode:"Tối",configSummary:"Tóm tắt cấu hình",wakeword:"Từ đánh thức:",font:"Phông chữ:",loading:"Đang tải...",emotion:"Cảm xúc:",skin:"Da:",previous:"Trước đó",generate:"Tạo assets.bin",emotions:{neutral:"Trung lập",happy:"Vui vẻ",laughing:"Cười lớn",funny:"Hài hước",sad:"Buồn",angry:"Giận dữ",crying:"Khóc",loving:"Yêu thương",embarrassed:"Xấu hổ",surprised:"Bất ngờ",shocked:"Sốc",thinking:"Suy nghĩ",winking:"Nháy mắt",cool:"Ngầu",relaxed:"Thoải mái",delicious:"Ngon miệng",kissy:"Hôn",confident:"Tự tin",sleepy:"Buồn ngủ",silly:"Ngớ ngẩn",confused:"Bối rối"},noEmotionConfigured:"Chưa cấu hình cảm xúc",fontLoading:"Đang tải phông chữ...",configureEmojiFirst:"Vui lòng cấu hình gói biểu tượng cảm xúc trong thiết kế chủ đề trước",customFont:"Phông chữ tùy chỉnh {size}px",customEmoji:"Biểu tượng cảm xúc tùy chỉnh {count} hình ảnh",notConfigured:"Chưa cấu hình",skinLight:"Sáng {type}",skinDark:"Tối {type}",hideSubtitle:"Ẩn phụ đề:",image:"Hình ảnh",color:"Màu sắc"},sg={title:"Cấu hình nền trò chuyện",description:"Cấu hình nền trò chuyện cho chế độ sáng và tối, hỗ trợ màu đơn hoặc hình ảnh tùy chỉnh.",lightMode:"Nền chế độ sáng",darkMode:"Nền chế độ tối",solidBackground:"Nền màu đơn",imageBackground:"Nền hình ảnh",backgroundColor:"Màu nền:",textColor:"Màu chữ:",backgroundImage:"Hình ảnh nền:",clickOrDragToUpload:"Nhấp hoặc kéo để tải lên hình ảnh nền",removeImage:"Xóa hình ảnh",backgroundPreview:"Xem trước nền",lightModePreview:"Chế độ sáng",darkModePreview:"Chế độ tối",chatArea:"Khu vực nội dung trò chuyện",quickConfig:"Cấu hình nhanh",defaultColors:"Màu mặc định",stoneTexture:"Kết cấu đá",sunnyColors:"Màu nắng",skyBlue:"Xanh trời",romanticPink:"Hồng lãng mạn",selectValidImage:"Vui lòng chọn tệp hình ảnh hợp lệ"},ig={title:"Cấu hình bộ sưu tập biểu tượng cảm xúc",description:"Chọn gói biểu tượng cảm xúc đặt sẵn hoặc hình ảnh biểu tượng cảm xúc tùy chỉnh. Mỗi gói biểu tượng cảm xúc chứa 21 biểu cảm cảm xúc khác nhau.",noEmojiPack:"Không có gói biểu tượng cảm xúc",noEmojiPackDescription:"Không cấu hình gói biểu tượng cảm xúc, chỉ bao gồm phông chữ và tài nguyên nền trong gói.",presetEmojiPack:"Gói biểu tượng cảm xúc đặt sẵn",customEmojiPack:"Gói biểu tượng cảm xúc tùy chỉnh",selectPresetEmojiPack:"Chọn gói biểu tượng cảm xúc đặt sẵn",twemoji64:"Twemoji 64×64",twemoji32:"Twemoji 32×32",twemojiDescription:"Bộ biểu tượng cảm xúc chất lượng cao từ Twitter, hoàn hảo để hiển thị rõ ràng",twitterEmojiName:"Twemoji {size}x{size}",twitterEmojiDescription:"Gói biểu tượng cảm xúc Twitter, {size}×{size} pixel",size:"Kích thước",preview:"Xem trước",select:"Chọn",customEmojiTitle:"Gói biểu tượng cảm xúc tùy chỉnh",customEmojiDescription:"Tải lên hình ảnh biểu tượng cảm xúc của riêng bạn. Mỗi cảm xúc cần một hình ảnh.",uploadInstructions:"Nhấp hoặc kéo để tải lên hình ảnh biểu tượng cảm xúc (PNG/JPG/WEBP)",supportedFormats:"Định dạng được hỗ trợ: PNG, JPG, WEBP. Kích thước khuyến nghị: 64×64 pixel",emotionMapping:"Ánh xạ cảm xúc",uploadAllEmotions:"Vui lòng tải lên hình ảnh biểu tượng cảm xúc cho tất cả cảm xúc",maxImageWidth:"Chiều rộng hình ảnh tối đa (px)",maxImageHeight:"Chiều cao hình ảnh tối đa (px)",clickToUpload:"Nhấp để tải lên",orDragDrop:"hoặc kéo và thả",clickToUploadOrDrag:"Nhấp để tải lên hoặc kéo vào đây",remove:"Xóa",replace:"Thay thế",selectValidEmojiImage:"Vui lòng chọn tệp hình ảnh biểu tượng cảm xúc hợp lệ",selectValidFormat:"Vui lòng chọn hình ảnh định dạng PNG hoặc GIF hợp lệ",maxFileSize:"Kích thước tệp không được vượt quá 1MB",invalidFormat:"Định dạng hình ảnh không được hỗ trợ. Vui lòng sử dụng PNG, JPG hoặc WEBP.",required:"Bắt buộc",uploadEmojiImages:"Tải lên hình ảnh biểu tượng cảm xúc (GIF cần PSRAM)",customEmojiPackConfig:"Cấu hình gói biểu tượng cảm xúc tùy chỉnh",neutralRequiredNotice:"* Phải tải lên cảm xúc mặc định trung lập, các cảm xúc khác là tùy chọn. Nếu không tải lên, cảm xúc mặc định sẽ được sử dụng thay thế.",sharedFileMessage:"Cảm xúc {emotionKey} sử dụng cùng tệp hình ảnh với {existingEmotions} (lưu trữ chia sẻ)",fileDeleted:"Tệp {fileHash} đã bị xóa (không có tham chiếu cảm xúc khác)",fileRetained:"Tệp {fileHash} vẫn được sử dụng bởi các cảm xúc khác, được giữ lại",imageLoadFailed:"Không tải được hình ảnh biểu tượng cảm xúc",emotions:{neutral:"Trung lập",happy:"Vui vẻ",laughing:"Cười lớn",funny:"Hài hước",sad:"Buồn",angry:"Giận dữ",crying:"Khóc",loving:"Yêu thương",embarrassed:"Xấu hổ",surprised:"Bất ngờ",shocked:"Sốc",thinking:"Suy nghĩ",winking:"Nháy mắt",cool:"Ngầu",relaxed:"Thoải mái",delicious:"Ngon miệng",kissy:"Hôn",confident:"Tự tin",sleepy:"Buồn ngủ",silly:"Ngớ ngẩn",confused:"Bối rối"}},og={title:"Cấu hình phông chữ",description:"Chọn phông chữ đặt sẵn hoặc tải lên tệp phông chữ tùy chỉnh.",noFonts:"Không có phông chữ",noFontsDescription:"Không sử dụng cấu hình phông chữ, thiết bị sẽ sử dụng phông chữ mặc định",presetFonts:"Phông chữ đặt sẵn",customFonts:"Phông chữ tùy chỉnh",selectPresetFont:"Chọn phông chữ đặt sẵn",fontSize:"Kích thước phông chữ:",bitDepth:"Độ sâu bit:",charset:"Bộ ký tự:",fileSize:"Kích thước tệp:",customFontConfig:"Cấu hình phông chữ tùy chỉnh",fontFile:"Tệp phông chữ",clickSelectFontFile:"Nhấp để chọn tệp phông chữ",orDragFileHere:"hoặc kéo tệp vào đây",supportedFormats:"Hỗ trợ định dạng TTF, WOFF, WOFF2",removeFile:"Xóa tệp",fontSizePx:"Kích thước phông chữ (px)",range:"Phạm vi:",bitDepthBpp:"Độ sâu bit (BPP)",monochrome:"1 bpp (Đơn sắc)",fourColors:"2 bpp (4 màu)",sixteenColors:"4 bpp (16 màu)",characterSet:"Bộ ký tự",deepseekR1:"DeepSeek R1 (7405 ký tự)",qwen18409:"Qwen (18409 ký tự)",latin1:"Latin1 (190 ký tự)",fullCharset:"Bộ ký tự đầy đủ (Tất cả ký tự trong tệp phông chữ)",hideSubtitle:"Ẩn phụ đề",hideSubtitleDescription:"Không hiển thị phụ đề văn bản trong khi trò chuyện",selectValidFontFile:"Vui lòng chọn tệp phông chữ hợp lệ (TTF, WOFF, WOFF2)",presetFontNames:{font_puhui_deepseek_14_1:"Alibaba PuHuiTi 14px",font_puhui_deepseek_16_4:"Alibaba PuHuiTi 16px",font_puhui_deepseek_20_4:"Alibaba PuHuiTi 20px",font_puhui_deepseek_30_4:"Alibaba PuHuiTi 30px",font_noto_qwen_14_1:"Noto Sans 14px",font_noto_qwen_16_4:"Noto Sans 16px",font_noto_qwen_20_4:"Noto Sans 20px",font_noto_qwen_30_4:"Noto Sans 30px"},charsetDeepseek:"DeepSeek 7405",charsetQwen:"Qwen 18409"},lg={app:Bm,common:Gm,header:Km,configNotice:Ym,steps:Xm,generateModal:zm,progressSteps:qm,wakewordConfig:Jm,errors:Qm,flashProgress:Zm,device:eg,chipConfig:tg,themeDesign:ng,generateSummary:rg,backgroundConfig:sg,emojiConfig:ig,fontConfig:og},ag={en:Vm,vi:lg},gr=[{code:"en",name:"English",flag:"🇺🇸"},{code:"vi",name:"Tiếng Việt",flag:"🇻🇳"}];function cg(){const e=navigator.language||navigator.userLanguage;return{vi:"vi",en:"en","en-US":"en","en-GB":"en"}[e]||"en"}const ug={class:"relative"},fg={class:"py-1"},hg=["onClick"],dg={class:"mr-3"},mg={key:0,class:"ml-auto w-4 h-4 text-blue-600",fill:"currentColor",viewBox:"0 0 20 20"},gg={__name:"LanguageSelector",setup(e){const{locale:t}=cr(),n=it(!1),r=ce(()=>gr.find(a=>a.code===t.value)||gr[0]),s=()=>{n.value=!n.value},i=()=>{n.value=!1},o=a=>{t.value=a,localStorage.setItem("user-language",a),i()},l=a=>{a.target.closest(".relative")||i()};return Yr(()=>{document.addEventListener("click",l);const a=localStorage.getItem("user-language");a&&gr.find(c=>c.code===a)&&(t.value=a)}),or(()=>{document.removeEventListener("click",l)}),(a,c)=>(oe(),me("div",ug,[z("button",{onClick:s,class:"flex items-center space-x-2 px-3 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"},[z("span",null,Ne(r.value.flag),1),z("span",null,Ne(r.value.name),1),(oe(),me("svg",{class:$e(["w-4 h-4 transition-transform duration-200",{"rotate-180":n.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...c[1]||(c[1]=[z("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))]),n.value?(oe(),me("div",{key:0,class:"absolute right-0 mt-2 w-48 bg-white border border-gray-200 rounded-md shadow-lg z-50",onClick:c[0]||(c[0]=kf(()=>{},["stop"]))},[z("div",fg,[(oe(!0),me(st,null,hu(Y(gr),u=>(oe(),me("button",{key:u.code,onClick:d=>o(u.code),class:$e(["flex items-center w-full px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100",{"bg-blue-50 text-blue-700":u.code===r.value.code}])},[z("span",dg,Ne(u.flag),1),z("span",null,Ne(u.name),1),u.code===r.value.code?(oe(),me("svg",mg,[...c[2]||(c[2]=[z("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):Le("",!0)],10,hg))),128))])])):Le("",!0),n.value?(oe(),me("div",{key:1,class:"fixed inset-0 z-40",onClick:i})):Le("",!0)]))}},pg={class:"min-h-screen bg-gray-50"},_g={class:"bg-white shadow-sm border-b"},vg={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4"},bg={class:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 sm:gap-0"},yg={class:"text-2xl font-bold text-gray-900"},Eg={class:"flex items-center space-x-4"},Cg={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"},Tg={__name:"App",setup(e){return(t,n)=>{const r=fu("router-view");return oe(),me("div",pg,[z("header",_g,[z("div",vg,[z("div",bg,[z("h1",yg,Ne(t.$t("header.title")),1),z("div",Eg,[Ee(wm),Ee(gg)])])])]),z("main",Cg,[Ee(r)])])}}},kg="modulepreload",wg=function(e,t){return new URL(e,t).href},$o={},Sg=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),a=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=wg(c,r),c in $o)return;$o[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(!!r)for(let N=o.length-1;N>=0;N--){const k=o[N];if(k.href===c&&(!u||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${d}`))return;const v=document.createElement("link");if(v.rel=u?"stylesheet":kg,u||(v.as="script"),v.crossOrigin="",v.href=c,a&&v.setAttribute("nonce",a),document.head.appendChild(v),u)return new Promise((N,k)=>{v.addEventListener("load",N),v.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};/*! * vue-router v4.6.4 * (c) 2025 Eduardo San Martin Morote * @license MIT - */const _n=typeof document<"u";function Ya(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Ng(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Ya(e.default)}const ue=Object.assign;function _s(e,t){const n={};for(const r in t){const s=t[r];n[r]=vt(s)?s.map(e):e(s)}return n}const Kn=()=>{},vt=Array.isArray;function Vo(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Xa=/#/g,Pg=/&/g,xg=/\//g,Ig=/=/g,Og=/\?/g,za=/\+/g,Lg=/%5B/g,Ag=/%5D/g,qa=/%5E/g,Rg=/%60/g,Ja=/%7B/g,Dg=/%7C/g,Qa=/%7D/g,Fg=/%20/g;function pi(e){return e==null?"":encodeURI(""+e).replace(Dg,"|").replace(Lg,"[").replace(Ag,"]")}function Mg(e){return pi(e).replace(Ja,"{").replace(Qa,"}").replace(qa,"^")}function js(e){return pi(e).replace(za,"%2B").replace(Fg,"+").replace(Xa,"%23").replace(Pg,"%26").replace(Rg,"`").replace(Ja,"{").replace(Qa,"}").replace(qa,"^")}function Ug(e){return js(e).replace(Ig,"%3D")}function Wg(e){return pi(e).replace(Xa,"%23").replace(Og,"%3F")}function Hg(e){return Wg(e).replace(xg,"%2F")}function tr(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const jg=/\/$/,$g=e=>e.replace(jg,"");function vs(e,t,n="/"){let r,s={},i="",o="";const l=t.indexOf("#");let a=t.indexOf("?");return a=l>=0&&a>l?-1:a,a>=0&&(r=t.slice(0,a),i=t.slice(a,l>0?l:t.length),s=e(i.slice(1))),l>=0&&(r=r||t.slice(0,l),o=t.slice(l,t.length)),r=Kg(r??t,n),{fullPath:r+i+o,path:r,query:s,hash:tr(o)}}function Vg(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Bo(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Bg(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&In(t.matched[r],n.matched[s])&&Za(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function In(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Za(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Gg(e[n],t[n]))return!1;return!0}function Gg(e,t){return vt(e)?Go(e,t):vt(t)?Go(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Go(e,t){return vt(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function Kg(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let i=n.length-1,o,l;for(o=0;o1&&i--;else break;return n.slice(0,i).join("/")+"/"+r.slice(o).join("/")}const Gt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let $s=function(e){return e.pop="pop",e.push="push",e}({}),bs=function(e){return e.back="back",e.forward="forward",e.unknown="",e}({});function Yg(e){if(!e)if(_n){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),$g(e)}const Xg=/^[^#]+#/;function zg(e,t){return e.replace(Xg,"#")+t}function qg(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const rs=()=>({left:window.scrollX,top:window.scrollY});function Jg(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=qg(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Ko(e,t){return(history.state?history.state.position-t:-1)+e}const Vs=new Map;function Qg(e,t){Vs.set(e,t)}function Zg(e){const t=Vs.get(e);return Vs.delete(e),t}function ep(e){return typeof e=="string"||e&&typeof e=="object"}function ec(e){return typeof e=="string"||typeof e=="symbol"}let Pe=function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e}({});const tc=Symbol("");Pe.MATCHER_NOT_FOUND+"",Pe.NAVIGATION_GUARD_REDIRECT+"",Pe.NAVIGATION_ABORTED+"",Pe.NAVIGATION_CANCELLED+"",Pe.NAVIGATION_DUPLICATED+"";function On(e,t){return ue(new Error,{type:e,[tc]:!0},t)}function Rt(e,t){return e instanceof Error&&tc in e&&(t==null||!!(e.type&t))}const tp=["params","query","hash"];function np(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of tp)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function rp(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;rs&&js(s)):[r&&js(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function sp(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=vt(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const ip=Symbol(""),Xo=Symbol(""),_i=Symbol(""),nc=Symbol(""),Bs=Symbol("");function Fn(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Xt(e,t,n,r,s,i=o=>o()){const o=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((l,a)=>{const c=g=>{g===!1?a(On(Pe.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?a(g):ep(g)?a(On(Pe.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(o&&r.enterCallbacks[s]===o&&typeof g=="function"&&o.push(g),l())},u=i(()=>e.call(r&&r.instances[s],t,n,c));let h=Promise.resolve(u);e.length<3&&(h=h.then(c)),h.catch(g=>a(g))})}function ys(e,t,n,r,s=i=>i()){const i=[];for(const o of e)for(const l in o.components){let a=o.components[l];if(!(t!=="beforeRouteEnter"&&!o.instances[l]))if(Ya(a)){const c=(a.__vccOpts||a)[t];c&&i.push(Xt(c,n,r,o,l,s))}else{let c=a();i.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${l}" at "${o.path}"`);const h=Ng(u)?u.default:u;o.mods[l]=u,o.components[l]=h;const g=(h.__vccOpts||h)[t];return g&&Xt(g,n,r,o,l,s)()}))}}return i}function op(e,t){const n=[],r=[],s=[],i=Math.max(t.matched.length,e.matched.length);for(let o=0;oIn(c,l))?r.push(l):n.push(l));const a=e.matched[o];a&&(t.matched.find(c=>In(c,a))||s.push(a))}return[n,r,s]}/*! + */const _n=typeof document<"u";function Ya(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Ng(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Ya(e.default)}const ue=Object.assign;function _s(e,t){const n={};for(const r in t){const s=t[r];n[r]=vt(s)?s.map(e):e(s)}return n}const Kn=()=>{},vt=Array.isArray;function Vo(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Xa=/#/g,Pg=/&/g,xg=/\//g,Ig=/=/g,Og=/\?/g,za=/\+/g,Lg=/%5B/g,Ag=/%5D/g,qa=/%5E/g,Rg=/%60/g,Ja=/%7B/g,Dg=/%7C/g,Qa=/%7D/g,Fg=/%20/g;function pi(e){return e==null?"":encodeURI(""+e).replace(Dg,"|").replace(Lg,"[").replace(Ag,"]")}function Mg(e){return pi(e).replace(Ja,"{").replace(Qa,"}").replace(qa,"^")}function js(e){return pi(e).replace(za,"%2B").replace(Fg,"+").replace(Xa,"%23").replace(Pg,"%26").replace(Rg,"`").replace(Ja,"{").replace(Qa,"}").replace(qa,"^")}function Ug(e){return js(e).replace(Ig,"%3D")}function Wg(e){return pi(e).replace(Xa,"%23").replace(Og,"%3F")}function Hg(e){return Wg(e).replace(xg,"%2F")}function tr(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const jg=/\/$/,$g=e=>e.replace(jg,"");function vs(e,t,n="/"){let r,s={},i="",o="";const l=t.indexOf("#");let a=t.indexOf("?");return a=l>=0&&a>l?-1:a,a>=0&&(r=t.slice(0,a),i=t.slice(a,l>0?l:t.length),s=e(i.slice(1))),l>=0&&(r=r||t.slice(0,l),o=t.slice(l,t.length)),r=Kg(r??t,n),{fullPath:r+i+o,path:r,query:s,hash:tr(o)}}function Vg(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Bo(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Bg(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&In(t.matched[r],n.matched[s])&&Za(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function In(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Za(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Gg(e[n],t[n]))return!1;return!0}function Gg(e,t){return vt(e)?Go(e,t):vt(t)?Go(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Go(e,t){return vt(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function Kg(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let i=n.length-1,o,l;for(o=0;o1&&i--;else break;return n.slice(0,i).join("/")+"/"+r.slice(o).join("/")}const Gt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let $s=function(e){return e.pop="pop",e.push="push",e}({}),bs=function(e){return e.back="back",e.forward="forward",e.unknown="",e}({});function Yg(e){if(!e)if(_n){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),$g(e)}const Xg=/^[^#]+#/;function zg(e,t){return e.replace(Xg,"#")+t}function qg(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const rs=()=>({left:window.scrollX,top:window.scrollY});function Jg(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=qg(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Ko(e,t){return(history.state?history.state.position-t:-1)+e}const Vs=new Map;function Qg(e,t){Vs.set(e,t)}function Zg(e){const t=Vs.get(e);return Vs.delete(e),t}function ep(e){return typeof e=="string"||e&&typeof e=="object"}function ec(e){return typeof e=="string"||typeof e=="symbol"}let Pe=function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e}({});const tc=Symbol("");Pe.MATCHER_NOT_FOUND+"",Pe.NAVIGATION_GUARD_REDIRECT+"",Pe.NAVIGATION_ABORTED+"",Pe.NAVIGATION_CANCELLED+"",Pe.NAVIGATION_DUPLICATED+"";function On(e,t){return ue(new Error,{type:e,[tc]:!0},t)}function Rt(e,t){return e instanceof Error&&tc in e&&(t==null||!!(e.type&t))}const tp=["params","query","hash"];function np(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of tp)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function rp(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;rs&&js(s)):[r&&js(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function sp(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=vt(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const ip=Symbol(""),Xo=Symbol(""),_i=Symbol(""),nc=Symbol(""),Bs=Symbol("");function Fn(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Xt(e,t,n,r,s,i=o=>o()){const o=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((l,a)=>{const c=g=>{g===!1?a(On(Pe.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?a(g):ep(g)?a(On(Pe.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(o&&r.enterCallbacks[s]===o&&typeof g=="function"&&o.push(g),l())},u=i(()=>e.call(r&&r.instances[s],t,n,c));let d=Promise.resolve(u);e.length<3&&(d=d.then(c)),d.catch(g=>a(g))})}function ys(e,t,n,r,s=i=>i()){const i=[];for(const o of e)for(const l in o.components){let a=o.components[l];if(!(t!=="beforeRouteEnter"&&!o.instances[l]))if(Ya(a)){const c=(a.__vccOpts||a)[t];c&&i.push(Xt(c,n,r,o,l,s))}else{let c=a();i.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${l}" at "${o.path}"`);const d=Ng(u)?u.default:u;o.mods[l]=u,o.components[l]=d;const g=(d.__vccOpts||d)[t];return g&&Xt(g,n,r,o,l,s)()}))}}return i}function op(e,t){const n=[],r=[],s=[],i=Math.max(t.matched.length,e.matched.length);for(let o=0;oIn(c,l))?r.push(l):n.push(l));const a=e.matched[o];a&&(t.matched.find(c=>In(c,a))||s.push(a))}return[n,r,s]}/*! * vue-router v4.6.4 * (c) 2025 Eduardo San Martin Morote * @license MIT - */let lp=()=>location.protocol+"//"+location.host;function rc(e,t){const{pathname:n,search:r,hash:s}=t,i=e.indexOf("#");if(i>-1){let o=s.includes(e.slice(i))?e.slice(i).length:1,l=s.slice(o);return l[0]!=="/"&&(l="/"+l),Bo(l,"")}return Bo(n,e)+r+s}function ap(e,t,n,r){let s=[],i=[],o=null;const l=({state:g})=>{const v=rc(e,location),x=n.value,k=t.value;let D=0;if(g){if(n.value=v,t.value=g,o&&o===x){o=null;return}D=k?g.position-k.position:0}else r(v);s.forEach(A=>{A(n.value,x,{delta:D,type:$s.pop,direction:D?D>0?bs.forward:bs.back:bs.unknown})})};function a(){o=n.value}function c(g){s.push(g);const v=()=>{const x=s.indexOf(g);x>-1&&s.splice(x,1)};return i.push(v),v}function u(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(ue({},g.state,{scroll:rs()}),"")}}function h(){for(const g of i)g();i=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:a,listen:c,destroy:h}}function zo(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?rs():null}}function cp(e){const{history:t,location:n}=window,r={value:rc(e,n)},s={value:t.state};s.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(a,c,u){const h=e.indexOf("#"),g=h>-1?(n.host&&document.querySelector("base")?e:e.slice(h))+a:lp()+e+a;try{t[u?"replaceState":"pushState"](c,"",g),s.value=c}catch(v){console.error(v),n[u?"replace":"assign"](g)}}function o(a,c){i(a,ue({},t.state,zo(s.value.back,a,s.value.forward,!0),c,{position:s.value.position}),!0),r.value=a}function l(a,c){const u=ue({},s.value,t.state,{forward:a,scroll:rs()});i(u.current,u,!0),i(a,ue({},zo(r.value,a,null),{position:u.position+1},c),!1),r.value=a}return{location:r,state:s,push:l,replace:o}}function up(e){e=Yg(e);const t=cp(e),n=ap(e,t.state,t.location,t.replace);function r(i,o=!0){o||n.pauseListeners(),history.go(i)}const s=ue({location:"",base:e,go:r,createHref:zg.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}let an=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var Oe=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}(Oe||{});const fp={type:an.Static,value:""},hp=/[a-zA-Z0-9_]/;function dp(e){if(!e)return[[]];if(e==="/")return[[fp]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(v){throw new Error(`ERR (${n})/"${c}": ${v}`)}let n=Oe.Static,r=n;const s=[];let i;function o(){i&&s.push(i),i=[]}let l=0,a,c="",u="";function h(){c&&(n===Oe.Static?i.push({type:an.Static,value:c}):n===Oe.Param||n===Oe.ParamRegExp||n===Oe.ParamRegExpEnd?(i.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:an.Param,value:c,regexp:u,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),c="")}function g(){c+=a}for(;lt.length?t.length===1&&t[0]===Xe.Static+Xe.Segment?1:-1:0}function sc(e,t){let n=0;const r=e.score,s=t.score;for(;n0&&t[t.length-1]<0}const vp={strict:!1,end:!0,sensitive:!1};function bp(e,t,n){const r=pp(dp(e.path),n),s=ue(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function yp(e,t){const n=[],r=new Map;t=Vo(vp,t);function s(h){return r.get(h)}function i(h,g,v){const x=!v,k=Zo(h);k.aliasOf=v&&v.record;const D=Vo(t,h),A=[k];if("alias"in h){const y=typeof h.alias=="string"?[h.alias]:h.alias;for(const L of y)A.push(Zo(ue({},k,{components:v?v.record.components:k.components,path:L,aliasOf:v?v.record:k})))}let R,b;for(const y of A){const{path:L}=y;if(g&&L[0]!=="/"){const P=g.record.path,F=P[P.length-1]==="/"?"":"/";y.path=g.record.path+(L&&F+L)}if(R=bp(y,g,D),v?v.alias.push(R):(b=b||R,b!==R&&b.alias.push(R),x&&h.name&&!el(R)&&o(h.name)),ic(R)&&a(R),k.children){const P=k.children;for(let F=0;F{o(b)}:Kn}function o(h){if(ec(h)){const g=r.get(h);g&&(r.delete(h),n.splice(n.indexOf(g),1),g.children.forEach(o),g.alias.forEach(o))}else{const g=n.indexOf(h);g>-1&&(n.splice(g,1),h.record.name&&r.delete(h.record.name),h.children.forEach(o),h.alias.forEach(o))}}function l(){return n}function a(h){const g=Tp(h,n);n.splice(g,0,h),h.record.name&&!el(h)&&r.set(h.record.name,h)}function c(h,g){let v,x={},k,D;if("name"in h&&h.name){if(v=r.get(h.name),!v)throw On(Pe.MATCHER_NOT_FOUND,{location:h});D=v.record.name,x=ue(Qo(g.params,v.keys.filter(b=>!b.optional).concat(v.parent?v.parent.keys.filter(b=>b.optional):[]).map(b=>b.name)),h.params&&Qo(h.params,v.keys.map(b=>b.name))),k=v.stringify(x)}else if(h.path!=null)k=h.path,v=n.find(b=>b.re.test(k)),v&&(x=v.parse(k),D=v.record.name);else{if(v=g.name?r.get(g.name):n.find(b=>b.re.test(g.path)),!v)throw On(Pe.MATCHER_NOT_FOUND,{location:h,currentLocation:g});D=v.record.name,x=ue({},g.params,h.params),k=v.stringify(x)}const A=[];let R=v;for(;R;)A.unshift(R.record),R=R.parent;return{name:D,path:k,params:x,matched:A,meta:Cp(A)}}e.forEach(h=>i(h));function u(){n.length=0,r.clear()}return{addRoute:i,resolve:c,removeRoute:o,clearRoutes:u,getRoutes:l,getRecordMatcher:s}}function Qo(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Zo(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Ep(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Ep(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function el(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Cp(e){return e.reduce((t,n)=>ue(t,n.meta),{})}function Tp(e,t){let n=0,r=t.length;for(;n!==r;){const i=n+r>>1;sc(e,t[i])<0?r=i:n=i+1}const s=kp(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function kp(e){let t=e;for(;t=t.parent;)if(ic(t)&&sc(e,t)===0)return t}function ic({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function tl(e){const t=Nt(_i),n=Nt(nc),r=ce(()=>{const a=Y(e.to);return t.resolve(a)}),s=ce(()=>{const{matched:a}=r.value,{length:c}=a,u=a[c-1],h=n.matched;if(!u||!h.length)return-1;const g=h.findIndex(In.bind(null,u));if(g>-1)return g;const v=nl(a[c-2]);return c>1&&nl(u)===v&&h[h.length-1].path!==v?h.findIndex(In.bind(null,a[c-2])):g}),i=ce(()=>s.value>-1&&xp(n.params,r.value.params)),o=ce(()=>s.value>-1&&s.value===n.matched.length-1&&Za(n.params,r.value.params));function l(a={}){if(Pp(a)){const c=t[Y(e.replace)?"replace":"push"](Y(e.to)).catch(Kn);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:r,href:ce(()=>r.value.href),isActive:i,isExactActive:o,navigate:l}}function wp(e){return e.length===1?e[0]:e}const Sp=ir({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:tl,setup(e,{slots:t}){const n=Br(tl(e)),{options:r}=Nt(_i),s=ce(()=>({[rl(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[rl(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&wp(t.default(n));return e.custom?i:Jr("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},i)}}}),Np=Sp;function Pp(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function xp(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!vt(s)||s.length!==r.length||r.some((i,o)=>i.valueOf()!==s[o].valueOf()))return!1}return!0}function nl(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const rl=(e,t,n)=>e??t??n,Ip=ir({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Nt(Bs),s=ce(()=>e.route||r.value),i=Nt(Xo,0),o=ce(()=>{let c=Y(i);const{matched:u}=s.value;let h;for(;(h=u[c])&&!h.components;)c++;return c}),l=ce(()=>s.value.matched[o.value]);_r(Xo,ce(()=>o.value+1)),_r(ip,l),_r(Bs,s);const a=it();return fn(()=>[a.value,l.value,e.name],([c,u,h],[g,v,x])=>{u&&(u.instances[h]=c,v&&v!==u&&c&&c===g&&(u.leaveGuards.size||(u.leaveGuards=v.leaveGuards),u.updateGuards.size||(u.updateGuards=v.updateGuards))),c&&u&&(!v||!In(u,v)||!g)&&(u.enterCallbacks[h]||[]).forEach(k=>k(c))},{flush:"post"}),()=>{const c=s.value,u=e.name,h=l.value,g=h&&h.components[u];if(!g)return sl(n.default,{Component:g,route:c});const v=h.props[u],x=v?v===!0?c.params:typeof v=="function"?v(c):v:null,D=Jr(g,ue({},x,t,{onVnodeUnmounted:A=>{A.component.isUnmounted&&(h.instances[u]=null)},ref:a}));return sl(n.default,{Component:D,route:c})||D}}});function sl(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Op=Ip;function Lp(e){const t=yp(e.routes,e),n=e.parseQuery||rp,r=e.stringifyQuery||Yo,s=e.history,i=Fn(),o=Fn(),l=Fn(),a=ni(Gt);let c=Gt;_n&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=_s.bind(null,I=>""+I),h=_s.bind(null,Hg),g=_s.bind(null,tr);function v(I,G){let $,K;return ec(I)?($=t.getRecordMatcher(I),K=G):K=I,t.addRoute(K,$)}function x(I){const G=t.getRecordMatcher(I);G&&t.removeRoute(G)}function k(){return t.getRoutes().map(I=>I.record)}function D(I){return!!t.getRecordMatcher(I)}function A(I,G){if(G=ue({},G||a.value),typeof I=="string"){const p=vs(n,I,G.path),T=t.resolve({path:p.path},G),O=s.createHref(p.fullPath);return ue(p,T,{params:g(T.params),hash:tr(p.hash),redirectedFrom:void 0,href:O})}let $;if(I.path!=null)$=ue({},I,{path:vs(n,I.path,G.path).path});else{const p=ue({},I.params);for(const T in p)p[T]==null&&delete p[T];$=ue({},I,{params:h(p)}),G.params=h(G.params)}const K=t.resolve($,G),ne=I.hash||"";K.params=u(g(K.params));const m=Vg(r,ue({},I,{hash:Mg(ne),path:K.path})),_=s.createHref(m);return ue({fullPath:m,hash:ne,query:r===Yo?sp(I.query):I.query||{}},K,{redirectedFrom:void 0,href:_})}function R(I){return typeof I=="string"?vs(n,I,a.value.path):ue({},I)}function b(I,G){if(c!==I)return On(Pe.NAVIGATION_CANCELLED,{from:G,to:I})}function y(I){return F(I)}function L(I){return y(ue(R(I),{replace:!0}))}function P(I,G){const $=I.matched[I.matched.length-1];if($&&$.redirect){const{redirect:K}=$;let ne=typeof K=="function"?K(I,G):K;return typeof ne=="string"&&(ne=ne.includes("?")||ne.includes("#")?ne=R(ne):{path:ne},ne.params={}),ue({query:I.query,hash:I.hash,params:ne.path!=null?{}:I.params},ne)}}function F(I,G){const $=c=A(I),K=a.value,ne=I.state,m=I.force,_=I.replace===!0,p=P($,K);if(p)return F(ue(R(p),{state:typeof p=="object"?ue({},ne,p.state):ne,force:m,replace:_}),G||$);const T=$;T.redirectedFrom=G;let O;return!m&&Bg(r,K,$)&&(O=On(Pe.NAVIGATION_DUPLICATED,{to:T,from:K}),we(K,K,!0,!1)),(O?Promise.resolve(O):ae(T,K)).catch(N=>Rt(N)?Rt(N,Pe.NAVIGATION_GUARD_REDIRECT)?N:Je(N):se(N,T,K)).then(N=>{if(N){if(Rt(N,Pe.NAVIGATION_GUARD_REDIRECT))return F(ue({replace:_},R(N.to),{state:typeof N.to=="object"?ue({},ne,N.to.state):ne,force:m}),G||T)}else N=Z(T,K,!0,_,ne);return ke(T,K,N),N})}function B(I,G){const $=b(I,G);return $?Promise.reject($):Promise.resolve()}function W(I){const G=tt.values().next().value;return G&&typeof G.runWithContext=="function"?G.runWithContext(I):I()}function ae(I,G){let $;const[K,ne,m]=op(I,G);$=ys(K.reverse(),"beforeRouteLeave",I,G);for(const p of K)p.leaveGuards.forEach(T=>{$.push(Xt(T,I,G))});const _=B.bind(null,I,G);return $.push(_),Re($).then(()=>{$=[];for(const p of i.list())$.push(Xt(p,I,G));return $.push(_),Re($)}).then(()=>{$=ys(ne,"beforeRouteUpdate",I,G);for(const p of ne)p.updateGuards.forEach(T=>{$.push(Xt(T,I,G))});return $.push(_),Re($)}).then(()=>{$=[];for(const p of m)if(p.beforeEnter)if(vt(p.beforeEnter))for(const T of p.beforeEnter)$.push(Xt(T,I,G));else $.push(Xt(p.beforeEnter,I,G));return $.push(_),Re($)}).then(()=>(I.matched.forEach(p=>p.enterCallbacks={}),$=ys(m,"beforeRouteEnter",I,G,W),$.push(_),Re($))).then(()=>{$=[];for(const p of o.list())$.push(Xt(p,I,G));return $.push(_),Re($)}).catch(p=>Rt(p,Pe.NAVIGATION_CANCELLED)?p:Promise.reject(p))}function ke(I,G,$){l.list().forEach(K=>W(()=>K(I,G,$)))}function Z(I,G,$,K,ne){const m=b(I,G);if(m)return m;const _=G===Gt,p=_n?history.state:{};$&&(K||_?s.replace(I.fullPath,ue({scroll:_&&p&&p.scroll},ne)):s.push(I.fullPath,ne)),a.value=I,we(I,G,$,_),Je()}let _e;function ht(){_e||(_e=s.listen((I,G,$)=>{if(!nt.listening)return;const K=A(I),ne=P(K,nt.currentRoute.value);if(ne){F(ue(ne,{replace:!0,force:!0}),K).catch(Kn);return}c=K;const m=a.value;_n&&Qg(Ko(m.fullPath,$.delta),rs()),ae(K,m).catch(_=>Rt(_,Pe.NAVIGATION_ABORTED|Pe.NAVIGATION_CANCELLED)?_:Rt(_,Pe.NAVIGATION_GUARD_REDIRECT)?(F(ue(R(_.to),{force:!0}),K).then(p=>{Rt(p,Pe.NAVIGATION_ABORTED|Pe.NAVIGATION_DUPLICATED)&&!$.delta&&$.type===$s.pop&&s.go(-1,!1)}).catch(Kn),Promise.reject()):($.delta&&s.go(-$.delta,!1),se(_,K,m))).then(_=>{_=_||Z(K,m,!1),_&&($.delta&&!Rt(_,Pe.NAVIGATION_CANCELLED)?s.go(-$.delta,!1):$.type===$s.pop&&Rt(_,Pe.NAVIGATION_ABORTED|Pe.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),ke(K,m,_)}).catch(Kn)}))}let at=Fn(),de=Fn(),ie;function se(I,G,$){Je(I);const K=de.list();return K.length?K.forEach(ne=>ne(I,G,$)):console.error(I),Promise.reject(I)}function Be(){return ie&&a.value!==Gt?Promise.resolve():new Promise((I,G)=>{at.add([I,G])})}function Je(I){return ie||(ie=!I,ht(),at.list().forEach(([G,$])=>I?$(I):G()),at.reset()),I}function we(I,G,$,K){const{scrollBehavior:ne}=e;if(!_n||!ne)return Promise.resolve();const m=!$&&Zg(Ko(I.fullPath,0))||(K||!$)&&history.state&&history.state.scroll||null;return ri().then(()=>ne(I,G,m)).then(_=>_&&Jg(_)).catch(_=>se(_,I,G))}const Se=I=>s.go(I);let ct;const tt=new Set,nt={currentRoute:a,listening:!0,addRoute:v,removeRoute:x,clearRoutes:t.clearRoutes,hasRoute:D,getRoutes:k,resolve:A,options:e,push:y,replace:L,go:Se,back:()=>Se(-1),forward:()=>Se(1),beforeEach:i.add,beforeResolve:o.add,afterEach:l.add,onError:de.add,isReady:Be,install(I){I.component("RouterLink",Np),I.component("RouterView",Op),I.config.globalProperties.$router=nt,Object.defineProperty(I.config.globalProperties,"$route",{enumerable:!0,get:()=>Y(a)}),_n&&!ct&&a.value===Gt&&(ct=!0,y(s.location).catch(K=>{}));const G={};for(const K in Gt)Object.defineProperty(G,K,{get:()=>a.value[K],enumerable:!0});I.provide(_i,nt),I.provide(nc,Pl(G)),I.provide(Bs,a);const $=I.unmount;tt.add(I),I.unmount=function(){tt.delete(I),tt.size<1&&(c=Gt,_e&&_e(),_e=null,a.value=Gt,ct=!1,ie=!1),$()}}};function Re(I){return I.reduce((G,$)=>G.then(()=>W($)),Promise.resolve())}return nt}const Ap=[{path:"/",name:"Home",component:()=>Sg(()=>import("./HomePage-BQbVVCiA.js"),__vite__mapDeps([0,1]))}],Rp=Lp({history:up("/tools/assets-generator/"),routes:Ap}),Dp=Nd({legacy:!1,locale:cg(),fallbackLocale:"en",messages:ag}),vi=Nf(Tg);vi.use(Rp);vi.use(Dp);vi.mount("#app");export{Uc as A,st as F,Sg as _,oe as a,z as b,me as c,Y as d,$u as e,Ee as f,Le as g,Bd as h,ce as i,Jr as j,$e as k,hu as l,Fp as m,ri as n,Yr as o,Wp as p,kf as q,it as r,Xs as s,Ne as t,cr as u,Up as v,fn as w,Un as x,Mp as y,or as z}; + */let lp=()=>location.protocol+"//"+location.host;function rc(e,t){const{pathname:n,search:r,hash:s}=t,i=e.indexOf("#");if(i>-1){let o=s.includes(e.slice(i))?e.slice(i).length:1,l=s.slice(o);return l[0]!=="/"&&(l="/"+l),Bo(l,"")}return Bo(n,e)+r+s}function ap(e,t,n,r){let s=[],i=[],o=null;const l=({state:g})=>{const v=rc(e,location),N=n.value,k=t.value;let D=0;if(g){if(n.value=v,t.value=g,o&&o===N){o=null;return}D=k?g.position-k.position:0}else r(v);s.forEach(A=>{A(n.value,N,{delta:D,type:$s.pop,direction:D?D>0?bs.forward:bs.back:bs.unknown})})};function a(){o=n.value}function c(g){s.push(g);const v=()=>{const N=s.indexOf(g);N>-1&&s.splice(N,1)};return i.push(v),v}function u(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(ue({},g.state,{scroll:rs()}),"")}}function d(){for(const g of i)g();i=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:a,listen:c,destroy:d}}function zo(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?rs():null}}function cp(e){const{history:t,location:n}=window,r={value:rc(e,n)},s={value:t.state};s.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(a,c,u){const d=e.indexOf("#"),g=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+a:lp()+e+a;try{t[u?"replaceState":"pushState"](c,"",g),s.value=c}catch(v){console.error(v),n[u?"replace":"assign"](g)}}function o(a,c){i(a,ue({},t.state,zo(s.value.back,a,s.value.forward,!0),c,{position:s.value.position}),!0),r.value=a}function l(a,c){const u=ue({},s.value,t.state,{forward:a,scroll:rs()});i(u.current,u,!0),i(a,ue({},zo(r.value,a,null),{position:u.position+1},c),!1),r.value=a}return{location:r,state:s,push:l,replace:o}}function up(e){e=Yg(e);const t=cp(e),n=ap(e,t.state,t.location,t.replace);function r(i,o=!0){o||n.pauseListeners(),history.go(i)}const s=ue({location:"",base:e,go:r,createHref:zg.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}let an=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var Oe=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}(Oe||{});const fp={type:an.Static,value:""},hp=/[a-zA-Z0-9_]/;function dp(e){if(!e)return[[]];if(e==="/")return[[fp]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(v){throw new Error(`ERR (${n})/"${c}": ${v}`)}let n=Oe.Static,r=n;const s=[];let i;function o(){i&&s.push(i),i=[]}let l=0,a,c="",u="";function d(){c&&(n===Oe.Static?i.push({type:an.Static,value:c}):n===Oe.Param||n===Oe.ParamRegExp||n===Oe.ParamRegExpEnd?(i.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:an.Param,value:c,regexp:u,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),c="")}function g(){c+=a}for(;lt.length?t.length===1&&t[0]===Xe.Static+Xe.Segment?1:-1:0}function sc(e,t){let n=0;const r=e.score,s=t.score;for(;n0&&t[t.length-1]<0}const vp={strict:!1,end:!0,sensitive:!1};function bp(e,t,n){const r=pp(dp(e.path),n),s=ue(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function yp(e,t){const n=[],r=new Map;t=Vo(vp,t);function s(d){return r.get(d)}function i(d,g,v){const N=!v,k=Zo(d);k.aliasOf=v&&v.record;const D=Vo(t,d),A=[k];if("alias"in d){const y=typeof d.alias=="string"?[d.alias]:d.alias;for(const L of y)A.push(Zo(ue({},k,{components:v?v.record.components:k.components,path:L,aliasOf:v?v.record:k})))}let R,b;for(const y of A){const{path:L}=y;if(g&&L[0]!=="/"){const x=g.record.path,F=x[x.length-1]==="/"?"":"/";y.path=g.record.path+(L&&F+L)}if(R=bp(y,g,D),v?v.alias.push(R):(b=b||R,b!==R&&b.alias.push(R),N&&d.name&&!el(R)&&o(d.name)),ic(R)&&a(R),k.children){const x=k.children;for(let F=0;F{o(b)}:Kn}function o(d){if(ec(d)){const g=r.get(d);g&&(r.delete(d),n.splice(n.indexOf(g),1),g.children.forEach(o),g.alias.forEach(o))}else{const g=n.indexOf(d);g>-1&&(n.splice(g,1),d.record.name&&r.delete(d.record.name),d.children.forEach(o),d.alias.forEach(o))}}function l(){return n}function a(d){const g=Tp(d,n);n.splice(g,0,d),d.record.name&&!el(d)&&r.set(d.record.name,d)}function c(d,g){let v,N={},k,D;if("name"in d&&d.name){if(v=r.get(d.name),!v)throw On(Pe.MATCHER_NOT_FOUND,{location:d});D=v.record.name,N=ue(Qo(g.params,v.keys.filter(b=>!b.optional).concat(v.parent?v.parent.keys.filter(b=>b.optional):[]).map(b=>b.name)),d.params&&Qo(d.params,v.keys.map(b=>b.name))),k=v.stringify(N)}else if(d.path!=null)k=d.path,v=n.find(b=>b.re.test(k)),v&&(N=v.parse(k),D=v.record.name);else{if(v=g.name?r.get(g.name):n.find(b=>b.re.test(g.path)),!v)throw On(Pe.MATCHER_NOT_FOUND,{location:d,currentLocation:g});D=v.record.name,N=ue({},g.params,d.params),k=v.stringify(N)}const A=[];let R=v;for(;R;)A.unshift(R.record),R=R.parent;return{name:D,path:k,params:N,matched:A,meta:Cp(A)}}e.forEach(d=>i(d));function u(){n.length=0,r.clear()}return{addRoute:i,resolve:c,removeRoute:o,clearRoutes:u,getRoutes:l,getRecordMatcher:s}}function Qo(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Zo(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Ep(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Ep(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function el(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Cp(e){return e.reduce((t,n)=>ue(t,n.meta),{})}function Tp(e,t){let n=0,r=t.length;for(;n!==r;){const i=n+r>>1;sc(e,t[i])<0?r=i:n=i+1}const s=kp(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function kp(e){let t=e;for(;t=t.parent;)if(ic(t)&&sc(e,t)===0)return t}function ic({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function tl(e){const t=Nt(_i),n=Nt(nc),r=ce(()=>{const a=Y(e.to);return t.resolve(a)}),s=ce(()=>{const{matched:a}=r.value,{length:c}=a,u=a[c-1],d=n.matched;if(!u||!d.length)return-1;const g=d.findIndex(In.bind(null,u));if(g>-1)return g;const v=nl(a[c-2]);return c>1&&nl(u)===v&&d[d.length-1].path!==v?d.findIndex(In.bind(null,a[c-2])):g}),i=ce(()=>s.value>-1&&xp(n.params,r.value.params)),o=ce(()=>s.value>-1&&s.value===n.matched.length-1&&Za(n.params,r.value.params));function l(a={}){if(Pp(a)){const c=t[Y(e.replace)?"replace":"push"](Y(e.to)).catch(Kn);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:r,href:ce(()=>r.value.href),isActive:i,isExactActive:o,navigate:l}}function wp(e){return e.length===1?e[0]:e}const Sp=ir({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:tl,setup(e,{slots:t}){const n=Br(tl(e)),{options:r}=Nt(_i),s=ce(()=>({[rl(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[rl(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&wp(t.default(n));return e.custom?i:Jr("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},i)}}}),Np=Sp;function Pp(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function xp(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!vt(s)||s.length!==r.length||r.some((i,o)=>i.valueOf()!==s[o].valueOf()))return!1}return!0}function nl(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const rl=(e,t,n)=>e??t??n,Ip=ir({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Nt(Bs),s=ce(()=>e.route||r.value),i=Nt(Xo,0),o=ce(()=>{let c=Y(i);const{matched:u}=s.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),l=ce(()=>s.value.matched[o.value]);_r(Xo,ce(()=>o.value+1)),_r(ip,l),_r(Bs,s);const a=it();return fn(()=>[a.value,l.value,e.name],([c,u,d],[g,v,N])=>{u&&(u.instances[d]=c,v&&v!==u&&c&&c===g&&(u.leaveGuards.size||(u.leaveGuards=v.leaveGuards),u.updateGuards.size||(u.updateGuards=v.updateGuards))),c&&u&&(!v||!In(u,v)||!g)&&(u.enterCallbacks[d]||[]).forEach(k=>k(c))},{flush:"post"}),()=>{const c=s.value,u=e.name,d=l.value,g=d&&d.components[u];if(!g)return sl(n.default,{Component:g,route:c});const v=d.props[u],N=v?v===!0?c.params:typeof v=="function"?v(c):v:null,D=Jr(g,ue({},N,t,{onVnodeUnmounted:A=>{A.component.isUnmounted&&(d.instances[u]=null)},ref:a}));return sl(n.default,{Component:D,route:c})||D}}});function sl(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Op=Ip;function Lp(e){const t=yp(e.routes,e),n=e.parseQuery||rp,r=e.stringifyQuery||Yo,s=e.history,i=Fn(),o=Fn(),l=Fn(),a=ni(Gt);let c=Gt;_n&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=_s.bind(null,I=>""+I),d=_s.bind(null,Hg),g=_s.bind(null,tr);function v(I,G){let $,K;return ec(I)?($=t.getRecordMatcher(I),K=G):K=I,t.addRoute(K,$)}function N(I){const G=t.getRecordMatcher(I);G&&t.removeRoute(G)}function k(){return t.getRoutes().map(I=>I.record)}function D(I){return!!t.getRecordMatcher(I)}function A(I,G){if(G=ue({},G||a.value),typeof I=="string"){const p=vs(n,I,G.path),T=t.resolve({path:p.path},G),O=s.createHref(p.fullPath);return ue(p,T,{params:g(T.params),hash:tr(p.hash),redirectedFrom:void 0,href:O})}let $;if(I.path!=null)$=ue({},I,{path:vs(n,I.path,G.path).path});else{const p=ue({},I.params);for(const T in p)p[T]==null&&delete p[T];$=ue({},I,{params:d(p)}),G.params=d(G.params)}const K=t.resolve($,G),ne=I.hash||"";K.params=u(g(K.params));const m=Vg(r,ue({},I,{hash:Mg(ne),path:K.path})),_=s.createHref(m);return ue({fullPath:m,hash:ne,query:r===Yo?sp(I.query):I.query||{}},K,{redirectedFrom:void 0,href:_})}function R(I){return typeof I=="string"?vs(n,I,a.value.path):ue({},I)}function b(I,G){if(c!==I)return On(Pe.NAVIGATION_CANCELLED,{from:G,to:I})}function y(I){return F(I)}function L(I){return y(ue(R(I),{replace:!0}))}function x(I,G){const $=I.matched[I.matched.length-1];if($&&$.redirect){const{redirect:K}=$;let ne=typeof K=="function"?K(I,G):K;return typeof ne=="string"&&(ne=ne.includes("?")||ne.includes("#")?ne=R(ne):{path:ne},ne.params={}),ue({query:I.query,hash:I.hash,params:ne.path!=null?{}:I.params},ne)}}function F(I,G){const $=c=A(I),K=a.value,ne=I.state,m=I.force,_=I.replace===!0,p=x($,K);if(p)return F(ue(R(p),{state:typeof p=="object"?ue({},ne,p.state):ne,force:m,replace:_}),G||$);const T=$;T.redirectedFrom=G;let O;return!m&&Bg(r,K,$)&&(O=On(Pe.NAVIGATION_DUPLICATED,{to:T,from:K}),we(K,K,!0,!1)),(O?Promise.resolve(O):ae(T,K)).catch(P=>Rt(P)?Rt(P,Pe.NAVIGATION_GUARD_REDIRECT)?P:Je(P):se(P,T,K)).then(P=>{if(P){if(Rt(P,Pe.NAVIGATION_GUARD_REDIRECT))return F(ue({replace:_},R(P.to),{state:typeof P.to=="object"?ue({},ne,P.to.state):ne,force:m}),G||T)}else P=Z(T,K,!0,_,ne);return ke(T,K,P),P})}function B(I,G){const $=b(I,G);return $?Promise.reject($):Promise.resolve()}function W(I){const G=tt.values().next().value;return G&&typeof G.runWithContext=="function"?G.runWithContext(I):I()}function ae(I,G){let $;const[K,ne,m]=op(I,G);$=ys(K.reverse(),"beforeRouteLeave",I,G);for(const p of K)p.leaveGuards.forEach(T=>{$.push(Xt(T,I,G))});const _=B.bind(null,I,G);return $.push(_),Re($).then(()=>{$=[];for(const p of i.list())$.push(Xt(p,I,G));return $.push(_),Re($)}).then(()=>{$=ys(ne,"beforeRouteUpdate",I,G);for(const p of ne)p.updateGuards.forEach(T=>{$.push(Xt(T,I,G))});return $.push(_),Re($)}).then(()=>{$=[];for(const p of m)if(p.beforeEnter)if(vt(p.beforeEnter))for(const T of p.beforeEnter)$.push(Xt(T,I,G));else $.push(Xt(p.beforeEnter,I,G));return $.push(_),Re($)}).then(()=>(I.matched.forEach(p=>p.enterCallbacks={}),$=ys(m,"beforeRouteEnter",I,G,W),$.push(_),Re($))).then(()=>{$=[];for(const p of o.list())$.push(Xt(p,I,G));return $.push(_),Re($)}).catch(p=>Rt(p,Pe.NAVIGATION_CANCELLED)?p:Promise.reject(p))}function ke(I,G,$){l.list().forEach(K=>W(()=>K(I,G,$)))}function Z(I,G,$,K,ne){const m=b(I,G);if(m)return m;const _=G===Gt,p=_n?history.state:{};$&&(K||_?s.replace(I.fullPath,ue({scroll:_&&p&&p.scroll},ne)):s.push(I.fullPath,ne)),a.value=I,we(I,G,$,_),Je()}let _e;function ht(){_e||(_e=s.listen((I,G,$)=>{if(!nt.listening)return;const K=A(I),ne=x(K,nt.currentRoute.value);if(ne){F(ue(ne,{replace:!0,force:!0}),K).catch(Kn);return}c=K;const m=a.value;_n&&Qg(Ko(m.fullPath,$.delta),rs()),ae(K,m).catch(_=>Rt(_,Pe.NAVIGATION_ABORTED|Pe.NAVIGATION_CANCELLED)?_:Rt(_,Pe.NAVIGATION_GUARD_REDIRECT)?(F(ue(R(_.to),{force:!0}),K).then(p=>{Rt(p,Pe.NAVIGATION_ABORTED|Pe.NAVIGATION_DUPLICATED)&&!$.delta&&$.type===$s.pop&&s.go(-1,!1)}).catch(Kn),Promise.reject()):($.delta&&s.go(-$.delta,!1),se(_,K,m))).then(_=>{_=_||Z(K,m,!1),_&&($.delta&&!Rt(_,Pe.NAVIGATION_CANCELLED)?s.go(-$.delta,!1):$.type===$s.pop&&Rt(_,Pe.NAVIGATION_ABORTED|Pe.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),ke(K,m,_)}).catch(Kn)}))}let at=Fn(),de=Fn(),ie;function se(I,G,$){Je(I);const K=de.list();return K.length?K.forEach(ne=>ne(I,G,$)):console.error(I),Promise.reject(I)}function Be(){return ie&&a.value!==Gt?Promise.resolve():new Promise((I,G)=>{at.add([I,G])})}function Je(I){return ie||(ie=!I,ht(),at.list().forEach(([G,$])=>I?$(I):G()),at.reset()),I}function we(I,G,$,K){const{scrollBehavior:ne}=e;if(!_n||!ne)return Promise.resolve();const m=!$&&Zg(Ko(I.fullPath,0))||(K||!$)&&history.state&&history.state.scroll||null;return ri().then(()=>ne(I,G,m)).then(_=>_&&Jg(_)).catch(_=>se(_,I,G))}const Se=I=>s.go(I);let ct;const tt=new Set,nt={currentRoute:a,listening:!0,addRoute:v,removeRoute:N,clearRoutes:t.clearRoutes,hasRoute:D,getRoutes:k,resolve:A,options:e,push:y,replace:L,go:Se,back:()=>Se(-1),forward:()=>Se(1),beforeEach:i.add,beforeResolve:o.add,afterEach:l.add,onError:de.add,isReady:Be,install(I){I.component("RouterLink",Np),I.component("RouterView",Op),I.config.globalProperties.$router=nt,Object.defineProperty(I.config.globalProperties,"$route",{enumerable:!0,get:()=>Y(a)}),_n&&!ct&&a.value===Gt&&(ct=!0,y(s.location).catch(K=>{}));const G={};for(const K in Gt)Object.defineProperty(G,K,{get:()=>a.value[K],enumerable:!0});I.provide(_i,nt),I.provide(nc,Pl(G)),I.provide(Bs,a);const $=I.unmount;tt.add(I),I.unmount=function(){tt.delete(I),tt.size<1&&(c=Gt,_e&&_e(),_e=null,a.value=Gt,ct=!1,ie=!1),$()}}};function Re(I){return I.reduce((G,$)=>G.then(()=>W($)),Promise.resolve())}return nt}const Ap=[{path:"/",name:"Home",component:()=>Sg(()=>import("./HomePage-C46hPw_t.js"),__vite__mapDeps([0,1]),import.meta.url)}],Rp=Lp({history:up("./"),routes:Ap}),Dp=Nd({legacy:!1,locale:cg(),fallbackLocale:"en",messages:ag}),vi=Nf(Tg);vi.use(Rp);vi.use(Dp);vi.mount("#app");export{Uc as A,st as F,Sg as _,oe as a,z as b,me as c,Y as d,$u as e,Ee as f,Le as g,Bd as h,ce as i,Jr as j,$e as k,hu as l,Fp as m,ri as n,Yr as o,Wp as p,kf as q,it as r,Xs as s,Ne as t,cr as u,Up as v,fn as w,Un as x,Mp as y,or as z}; diff --git a/main/manager-web/public/generator/assets/index-D3IPibb6.css b/main/manager-web/public/generator/assets/index-D3IPibb6.css new file mode 100644 index 000000000..1ca1a5736 --- /dev/null +++ b/main/manager-web/public/generator/assets/index-D3IPibb6.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.-right-1{right:-.25rem}.-top-1{top:-.25rem}.bottom-4{bottom:1rem}.right-0{right:0}.right-4{right:1rem}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-0\.5{height:.125rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-32{height:8rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-full{height:100%}.max-h-32{max-height:8rem}.max-h-64{max-height:16rem}.max-h-\[90vh\]{max-height:90vh}.min-h-96{min-height:24rem}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[300px\]{min-width:300px}.max-w-2xl{max-width:42rem}.max-w-32{max-width:8rem}.max-w-7xl{max-width:80rem}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.grow{flex-grow:1}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-items-center{justify-items:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-green-300{--tw-border-opacity: 1;border-color:rgb(134 239 172 / var(--tw-border-opacity, 1))}.border-orange-200{--tw-border-opacity: 1;border-color:rgb(254 215 170 / var(--tw-border-opacity, 1))}.border-primary-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-orange-50{--tw-bg-opacity: 1;background-color:rgb(255 247 237 / var(--tw-bg-opacity, 1))}.bg-pink-100{--tw-bg-opacity: 1;background-color:rgb(252 231 243 / var(--tw-bg-opacity, 1))}.bg-primary-50{--tw-bg-opacity: 1;background-color:rgb(240 249 255 / var(--tw-bg-opacity, 1))}.bg-primary-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-sky-100{--tw-bg-opacity: 1;background-color:rgb(224 242 254 / var(--tw-bg-opacity, 1))}.bg-stone-100{--tw-bg-opacity: 1;background-color:rgb(245 245 244 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-opacity-10{--tw-bg-opacity: .1}.bg-opacity-50{--tw-bg-opacity: .5}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pr-10{padding-right:2.5rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-tight{line-height:1.25}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-green-900{--tw-text-opacity: 1;color:rgb(20 83 45 / var(--tw-text-opacity, 1))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-pink-500{--tw-text-opacity: 1;color:rgb(236 72 153 / var(--tw-text-opacity, 1))}.text-primary-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-primary-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-purple-500{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(113 63 18 / var(--tw-text-opacity, 1))}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-60{opacity:.6}.opacity-75{opacity:.75}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.grayscale{--tw-grayscale: grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.step-indicator{display:flex;height:2rem;width:2rem;align-items:center;justify-content:center;border-radius:9999px;font-size:.875rem;line-height:1.25rem;font-weight:500}.step-indicator.active{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.step-indicator.completed{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.step-indicator.inactive{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.tab-button{border-top-left-radius:.5rem;border-top-right-radius:.5rem;border-bottom-width:2px;padding:.5rem 1rem;font-size:.875rem;line-height:1.25rem;font-weight:500;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}.tab-button.active{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.tab-button.inactive{border-color:transparent;--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.tab-button.inactive:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:left-\[2px\]:after{content:var(--tw-content);left:2px}.after\:top-\[2px\]:after{content:var(--tw-content);top:2px}.after\:h-5:after{content:var(--tw-content);height:1.25rem}.after\:w-5:after{content:var(--tw-content);width:1.25rem}.after\:rounded-full:after{content:var(--tw-content);border-radius:9999px}.after\:border:after{content:var(--tw-content);border-width:1px}.after\:border-gray-300:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.after\:bg-white:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.after\:transition-all:after{content:var(--tw-content);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.after\:content-\[\'\'\]:after{--tw-content: "";content:var(--tw-content)}.hover\:border-gray-300:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.hover\:border-gray-400:hover{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity, 1))}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-600:hover{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.hover\:bg-pink-200:hover{--tw-bg-opacity: 1;background-color:rgb(251 207 232 / var(--tw-bg-opacity, 1))}.hover\:bg-primary-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-sky-200:hover{--tw-bg-opacity: 1;background-color:rgb(186 230 253 / var(--tw-bg-opacity, 1))}.hover\:bg-stone-200:hover{--tw-bg-opacity: 1;background-color:rgb(231 229 228 / var(--tw-bg-opacity, 1))}.hover\:bg-yellow-200:hover{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.hover\:text-gray-500:hover{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.hover\:text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.hover\:text-primary-500:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\:text-red-800:hover{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.focus\:border-primary-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:bg-gray-100:focus{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.focus\:ring-primary-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.disabled\:bg-gray-300:disabled{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.peer:checked~.peer-checked\:bg-primary-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.peer:checked~.peer-checked\:after\:translate-x-full:after{content:var(--tw-content);--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:checked~.peer-checked\:after\:border-white:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.peer:focus~.peer-focus\:outline-none{outline:2px solid transparent;outline-offset:2px}.peer:focus~.peer-focus\:ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}@media (min-width: 640px){.sm\:mr-2{margin-right:.5rem}.sm\:inline{display:inline}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:gap-0{gap:0px}.sm\:space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}}@media (min-width: 768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-80{width:20rem}.lg\:grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:px-8{padding-left:2rem;padding-right:2rem}} diff --git a/main/manager-web/public/generator/index.html b/main/manager-web/public/generator/index.html index 7eaef3e6c..0a5e085ee 100644 --- a/main/manager-web/public/generator/index.html +++ b/main/manager-web/public/generator/index.html @@ -2,11 +2,10 @@ - Xiaozhi AI Customization - - + +