@ddict/popup 1.4.6 → 1.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/popup.umd.js CHANGED
@@ -14,7 +14,7 @@ Only state can be modified.`);i[0]="$state",l2=!1,l.set(s,i,l.state.value),l2=!0
14
14
  state: () => new MyClass()
15
15
  Found in store "${y.$id}".`),b&&s&&n.hydrate&&n.hydrate(y.$state,b),d=!0,u=!0,y}function h2(e,o,n){let l,a;const s=typeof o=="function";if(typeof e=="string")l=e,a=s?n:o;else if(a=e,l=e.id,process.env.NODE_ENV!=="production"&&typeof l!="string")throw new Error('[🍍]: "defineStore()" must be passed a store id as its first argument.');function i(r,c){const d=t.hasInjectionContext();if(r=(process.env.NODE_ENV==="test"&&f2&&f2._testing?null:r)||(d?t.inject(_e,null):null),r&&p2(r),process.env.NODE_ENV!=="production"&&!f2)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
16
16
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
17
- This will fail in production.`);r=f2,r._s.has(l)||(s?W2(l,o,a,r):De(l,a,r),process.env.NODE_ENV!=="production"&&(i._pinia=r));const u=r._s.get(l);if(process.env.NODE_ENV!=="production"&&c){const f="__hot:"+l,v=s?W2(f,o,a,r,!0):De(f,D({},a),r,!0);c._hotUpdate(v),delete r.state.value[f],r._s.delete(f)}if(process.env.NODE_ENV!=="production"&&E2){const f=t.getCurrentInstance();if(f&&f.proxy&&!c){const v=f.proxy,h="_pStores"in v?v._pStores:v._pStores={};h[l]=u}}return u}return i.$id=l,i}const n2=h2("loader",()=>{const e=t.ref({translation:!1,aiExplanation:!1,writing:!1});return{loadingStates:e,setLoading:(l,a)=>{e.value[l]=a},isLoading:l=>e.value[l]}}),He={__name:"Select",props:t.mergeModels({languages:{type:Object,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const o=n2(),n=e,l=t.useModel(e,"modelValue"),a=t.ref(""),s=t.ref(null),i=t.computed(()=>Object.entries(n.languages).filter(([,c])=>c.toLowerCase().includes(a.value.toLowerCase()))),r=c=>{c.target.value="",a.value="",s.value&&s.value.$el.click()};return(c,d)=>(t.openBlock(),t.createBlock(t.unref(mt),{modelValue:l.value,"onUpdate:modelValue":d[3]||(d[3]=u=>l.value=u),disabled:t.unref(o).loading,as:"div",class:"relative mt-1"},{default:t.withCtx(()=>[t.createVNode(t.unref(gt),{class:"w-full bg-white border border-gray-300 rounded py-2.5 pl-3 pr-10 text-sm text-gray-800 font-medium focus:outline-none focus:ring-0.5 focus:ring-gray-400 focus:border-gray-400",onChange:d[0]||(d[0]=u=>a.value=u.target.value),displayValue:u=>e.languages[u],onFocus:d[1]||(d[1]=u=>r(u))},null,8,["displayValue"]),t.createVNode(t.unref(ht),{ref_key:"btnSelect",ref:s,class:"absolute inset-y-0 right-0 flex items-center pr-2"},{default:t.withCtx(()=>[t.createVNode(t.unref(xt),{class:"h-5 w-5 text-gray-400","aria-hidden":"true",onClick:d[2]||(d[2]=u=>r(u))})]),_:1},512),t.createVNode(t.unref(Ct),{class:"absolute mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm z-50"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.value,([u,f])=>(t.openBlock(),t.createBlock(t.unref(bt),{key:u,value:u},{default:t.withCtx(({active:v,selected:h})=>[t.createElementVNode("li",{class:t.normalizeClass(["relative cursor-default select-none py-2 pl-3 pr-9",v?"bg-[#3B5695] text-white":"text-textCustom"])},[t.createElementVNode("span",{class:t.normalizeClass(["block truncate",h&&"font-semibold"])},t.toDisplayString(f),3)],2)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue","disabled"]))}},Pe="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.68688%202.3131C3.88214%202.50837%203.88214%202.82495%203.68688%203.02021L2.04043%204.66666L3.68688%206.3131C3.88214%206.50837%203.88214%206.82495%203.68688%207.02021C3.49162%207.21547%203.17504%207.21547%202.97977%207.02021L0.979775%205.02021C0.784513%204.82495%200.784513%204.50837%200.979775%204.3131L2.97977%202.3131C3.17504%202.11784%203.49162%202.11784%203.68688%202.3131Z'%20fill='%237E7E7E'/%3e%3cpath%20d='M12.3131%208.97977C12.5084%208.78451%2012.825%208.78451%2013.0202%208.97977L15.0202%2010.9798C15.2155%2011.175%2015.2155%2011.4916%2015.0202%2011.6869L13.0202%2013.6869C12.825%2013.8821%2012.5084%2013.8821%2012.3131%2013.6869C12.1178%2013.4916%2012.1178%2013.175%2012.3131%2012.9798L13.9596%2011.3333L12.3131%209.68688C12.1178%209.49161%2012.1178%209.17503%2012.3131%208.97977Z'%20fill='%237E7E7E'/%3e%3cpath%20d='M0.833328%204.66666C0.833328%204.39051%201.05719%204.16666%201.33333%204.16666H14.6667C14.9428%204.16666%2015.1667%204.39051%2015.1667%204.66666C15.1667%204.9428%2014.9428%205.16666%2014.6667%205.16666H1.33333C1.05719%205.16666%200.833328%204.9428%200.833328%204.66666Z'%20fill='%237E7E7E'/%3e%3cpath%20d='M0.833328%2011.3333C0.833328%2011.0572%201.05719%2010.8333%201.33333%2010.8333H14.6667C14.9428%2010.8333%2015.1667%2011.0572%2015.1667%2011.3333C15.1667%2011.6095%2014.9428%2011.8333%2014.6667%2011.8333H1.33333C1.05719%2011.8333%200.833328%2011.6095%200.833328%2011.3333Z'%20fill='%237E7E7E'/%3e%3c/svg%3e",Yt=["disabled"],Qt=[t.createElementVNode("img",{src:Pe,alt:"swap",class:"w-4"},null,-1)],Xt=["disabled"],Kt=[t.createElementVNode("img",{src:Pe,alt:"swap",class:"w-4"},null,-1)],e1={__name:"SwapBtn",props:{isBidirect:{type:Boolean,default:!1}},emits:["swap"],setup(e,{emit:o}){const n=n2(),l=t.computed(()=>n.isLoading("translation")),a=o;return(s,i)=>e.isBidirect?(t.openBlock(),t.createElementBlock("button",{key:1,onClick:i[0]||(i[0]=r=>a("swap")),disabled:l.value},Kt,8,Xt)):(t.openBlock(),t.createElementBlock("button",{key:0,disabled:l.value},Qt,8,Yt))}},s2=h2("language",()=>{const e=t.ref("auto"),o=t.ref("vi"),n=t.ref({src:[],target:[]}),l=t.computed(()=>n.value.src[e.value]),a=t.computed(()=>n.value.target[o.value]);function s(c,d){e.value=c==null?void 0:c.src,o.value=c==null?void 0:c.target,n.value=d}function i(){if(!n.value.src[o.value]||!n.value.target[e.value])return;const c=e.value;e.value=o.value,o.value=c}function r(c){return n.value.src[c]||n.value.target[c]}return{languages:n,src:e,target:o,srcLabel:l,targetLabel:a,init:s,swap:i,getLabel:r}}),t1={key:0,class:"flex flex-col"},n1={class:"flex"},o1={class:"grow flex flex-col"},l1={key:0,class:"flex mt-1 space-x-1"},a1=["onClick"],s1={class:"grow flex flex-col"},r1={key:0,class:"flex mt-1 space-x-1 justify-end"},i1=["onClick"],c1={class:"flex"},d1={class:"grow flex flex-col"},u1={class:"grow flex flex-col"},Ze=3,f1={__name:"Selects",setup(e){const o=s2(),n=t.ref([]),l=t.ref([]);function a(){o.swap()}return t.onMounted(()=>{var s,i;n.value=((s=b2.getLocalStorage("recentSrc"))==null?void 0:s.filter(r=>!!r))||[],l.value=((i=b2.getLocalStorage("recentTarget"))==null?void 0:i.filter(r=>!!r))||[]}),t.watch(()=>o.src,s=>{s&&(n.value.includes(s)||(n.value.unshift(s),n.value=n.value.slice(0,Ze),b2.setLocalStorage("recentSrc",n.value)))}),t.watch(()=>o.target,s=>{s&&(l.value.includes(s)||(l.value.unshift(s),l.value=l.value.slice(0,Ze),b2.setLocalStorage("recentTarget",l.value)))}),(s,i)=>t.unref(o).languages?(t.openBlock(),t.createElementBlock("div",t1,[t.createElementVNode("div",n1,[t.createElementVNode("div",o1,[n.value.length>0?(t.openBlock(),t.createElementBlock("div",l1,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,r=>(t.openBlock(),t.createElementBlock("button",{key:r,class:"px-1 bg-baseColor border border-primaryColor text-primaryColor text-xs rounded hover:bg-primaryColor hover:text-baseColor",onClick:c=>t.unref(o).src=r},t.toDisplayString(t.unref(o).languages.src[r]),9,a1))),128))])):t.createCommentVNode("",!0)]),t.createElementVNode("div",s1,[l.value.length>0?(t.openBlock(),t.createElementBlock("div",r1,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,r=>(t.openBlock(),t.createElementBlock("button",{key:r,class:"px-1 bg-baseColor border border-primaryColor text-primaryColor text-xs rounded hover:bg-primaryColor hover:text-baseColor",onClick:c=>t.unref(o).target=r},t.toDisplayString(t.unref(o).languages.target[r]),9,i1))),128))])):t.createCommentVNode("",!0)])]),t.createElementVNode("div",c1,[t.createElementVNode("div",d1,[t.createVNode(He,{modelValue:t.unref(o).src,"onUpdate:modelValue":i[0]||(i[0]=r=>t.unref(o).src=r),languages:t.unref(o).languages.src,class:"grow"},null,8,["modelValue","languages"])]),t.createVNode(e1,{isBidirect:t.unref(o).src!=="auto",class:"grow-0 mx-3 mt-4 self-start",onSwap:a},null,8,["isBidirect"]),t.createElementVNode("div",u1,[t.createVNode(He,{modelValue:t.unref(o).target,"onUpdate:modelValue":i[1]||(i[1]=r=>t.unref(o).target=r),languages:t.unref(o).languages.target,class:"grow"},null,8,["modelValue","languages"])])])])):t.createCommentVNode("",!0)}},r2={INPUT_MAX_LENGTH:5e3,INPUT_DEBOUNCE:1e3,IMPROVE_INPUT_MIN_LENGTH:4,DEFAULT_DIFF_MODE:!0},G=(e,o)=>{const n=e.__vccOpts||e;for(const[l,a]of o)n[l]=a;return n},p1={},m1={class:"mr-2 loading loading-dots loading-xs"};function h1(e,o){return t.openBlock(),t.createElementBlock("span",m1)}const q2=G(p1,[["render",h1]]),G2=h2("tts",()=>{const e=t.ref({src:null,target:null});function o(a){a.src&&(e.value.src=a.src),a.target&&(e.value.target=a.target)}function n(a){if(a==="src")return e.value.src;if(a==="target")return e.value.target}function l(){e.value={src:null,target:null}}return{tts:e,set:o,get:n,reset:l}}),g1="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.33325%204.66667H3.51125C3.82693%204.6667%204.13239%204.55473%204.37325%204.35067L6.83392%202.26667C6.99592%202.12953%207.19374%202.04156%207.40407%202.01312C7.61441%201.98468%207.82849%202.01696%208.02109%202.10615C8.21369%202.19534%208.37678%202.33772%208.49114%202.51652C8.60551%202.69532%208.66638%202.90309%208.66659%203.11534V12.8847C8.66649%2013.097%208.60565%2013.305%208.49125%2013.4839C8.37685%2013.6628%208.21367%2013.8053%208.02094%2013.8945C7.82822%2013.9837%207.614%2014.0159%207.40356%2013.9874C7.19312%2013.9588%206.99523%2013.8707%206.83325%2013.7333L4.37325%2011.6487C4.13229%2011.4449%203.82685%2011.3331%203.51125%2011.3333H2.33325C2.06804%2011.3333%201.81368%2011.228%201.62615%2011.0404C1.43861%2010.8529%201.33325%2010.5986%201.33325%2010.3333V5.66667C1.33325%205.40145%201.43861%205.1471%201.62615%204.95956C1.81368%204.77203%202.06804%204.66667%202.33325%204.66667ZM11.1779%2011.18C11.5969%2010.763%2011.9294%2010.2674%2012.1562%209.72156C12.3831%209.17572%2012.4999%208.59044%2012.4999%207.99934C12.4999%207.40823%2012.3831%206.82295%2012.1562%206.27711C11.9294%205.73127%2011.5969%205.23564%2011.1779%204.81867C11.1317%204.77098%2011.0765%204.73297%2011.0155%204.70686C10.9544%204.68075%2010.8888%204.66705%2010.8224%204.66657C10.756%204.66609%2010.6902%204.67883%2010.6288%204.70406C10.5674%204.72929%2010.5116%204.76649%2010.4647%204.8135C10.4179%204.86051%2010.3808%204.91639%2010.3558%204.97787C10.3307%205.03935%2010.3181%205.10521%2010.3188%205.17159C10.3195%205.23798%2010.3334%205.30357%2010.3597%205.36453C10.3859%205.42549%2010.4241%205.48061%2010.4719%205.52667C10.7977%205.85079%2011.0562%206.23609%2011.2326%206.66043C11.409%207.08477%2011.4998%207.53979%2011.4998%207.99934C11.4998%208.45888%2011.409%208.9139%2011.2326%209.33824C11.0562%209.76258%2010.7977%2010.1479%2010.4719%2010.472C10.4241%2010.5181%2010.3859%2010.5732%2010.3597%2010.6341C10.3334%2010.6951%2010.3195%2010.7607%2010.3188%2010.8271C10.3181%2010.8935%2010.3307%2010.9593%2010.3558%2011.0208C10.3808%2011.0823%2010.4179%2011.1382%2010.4647%2011.1852C10.5116%2011.2322%2010.5674%2011.2694%2010.6288%2011.2946C10.6902%2011.3198%2010.756%2011.3326%2010.8224%2011.3321C10.8888%2011.3316%2010.9544%2011.3179%2011.0155%2011.2918C11.0765%2011.2657%2011.1317%2011.2277%2011.1779%2011.18ZM12.7113%2013.2127C12.6123%2013.2126%2012.5157%2013.1832%2012.4335%2013.1281C12.3513%2013.0731%2012.2873%2012.9949%2012.2495%2012.9035C12.2118%2012.8121%2012.202%2012.7115%2012.2214%2012.6146C12.2408%2012.5176%2012.2886%2012.4285%2012.3586%2012.3587C12.9317%2011.7866%2013.3865%2011.1071%2013.6967%2010.359C14.0069%209.61101%2014.1666%208.80915%2014.1666%207.99934C14.1666%207.18952%2014.0069%206.38766%2013.6967%205.63963C13.3865%204.8916%2012.9317%204.2121%2012.3586%203.64C12.3122%203.59351%2012.2754%203.53834%2012.2503%203.47764C12.2252%203.41693%2012.2124%203.35188%2012.2124%203.2862C12.2125%203.22052%2012.2255%203.15549%2012.2507%203.09483C12.2759%203.03417%2012.3128%202.97907%2012.3593%202.93267C12.4057%202.88627%2012.4609%202.84948%2012.5216%202.8244C12.5823%202.79932%2012.6474%202.78645%2012.7131%202.78651C12.7787%202.78657%2012.8438%202.79957%2012.9044%202.82476C12.9651%202.84995%2013.0202%202.88685%2013.0666%202.93334C13.7327%203.59825%2014.2612%204.38801%2014.6218%205.25741C14.9824%206.12681%2015.168%207.05879%2015.168%208C15.168%208.94122%2014.9824%209.87319%2014.6218%2010.7426C14.2612%2011.612%2013.7327%2012.4018%2013.0666%2013.0667C13.02%2013.1134%2012.9646%2013.1504%2012.9036%2013.1756C12.8426%2013.2007%2012.7772%2013.2129%2012.7113%2013.2127Z'%20fill='%233B5695'/%3e%3c/svg%3e",C1="data:image/svg+xml,%3csvg%20class='swap-on%20fill-current%20h-4%20w-4'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill-rule='evenodd'%20d='M4.5%207.5a3%203%200%200%201%203-3h9a3%203%200%200%201%203%203v9a3%203%200%200%201-3%203h-9a3%203%200%200%201-3-3v-9Z'%20clip-rule='evenodd'%20fill='%238595BE'/%3e%3c/svg%3e",b1=["disabled"],v1=["src"],x1=["src"],w1={__name:"SpeakBtn",props:{type:{type:String,default:""},disabled:Boolean},emits:["loadTTS"],setup(e,{emit:o}){const n=G2(),l=e,a=o,s=t.computed(()=>n.tts[l.type]),i=t.ref(!1),r=new Audio;t.watch(s,()=>{if(!s.value){i.value=!1;return}d()},{immediate:!0}),t.onUnmounted(()=>{u(),r.src=""});function c(){if(s.value){d();return}i.value=!0,a("loadTTS")}function d(){s.value&&(r.src=s.value,i.value=!0,r.play().catch(()=>{i.value=!1}))}function u(){r.pause(),r.currentTime=0,i.value=!1}return r.onended=()=>{i.value=!1},(f,v)=>i.value?(t.openBlock(),t.createElementBlock("button",{key:1,class:"btn btn-xs btn-circle",onClick:t.withModifiers(u,["prevent"])},[t.createElementVNode("img",{src:t.unref(C1),alt:"Stop",class:"w-4"},null,8,x1)])):(t.openBlock(),t.createElementBlock("button",{key:0,class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled,onClick:t.withModifiers(c,["prevent"])},[t.createElementVNode("img",{src:t.unref(g1),alt:"Play",class:t.normalizeClass(["w-4",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,v1)],10,b1))}},y1="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.19102%203.19102C3.44571%202.93633%203.85864%202.93633%204.11333%203.19102L12.809%2011.8867C13.0637%2012.1414%2013.0637%2012.5543%2012.809%2012.809C12.5543%2013.0637%2012.1414%2013.0637%2011.8867%2012.809L3.19102%204.11333C2.93633%203.85864%202.93633%203.44571%203.19102%203.19102Z'%20fill='%231A1F2A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.809%203.19102C13.0637%203.44571%2013.0637%203.85864%2012.809%204.11333L4.11333%2012.809C3.85864%2013.0637%203.44571%2013.0637%203.19102%2012.809C2.93633%2012.5543%202.93633%2012.1414%203.19102%2011.8867L11.8867%203.19102C12.1414%202.93633%2012.5543%202.93633%2012.809%203.19102Z'%20fill='%231A1F2A'/%3e%3c/svg%3e",E1={class:"tooltip tooltip-bottom tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":"Clear"},_1=["disabled"],k1=["src"],je={__name:"ClearBtn",props:{disabled:Boolean},setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("div",E1,[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled},[t.createElementVNode("img",{src:t.unref(y1),alt:"Clear",class:t.normalizeClass(["w-4",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,k1)],10,_1)]))}},S1="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.47207%201.31905C7.57125%201.12371%207.77589%201%208.00001%201C8.22413%201%208.42877%201.12367%208.52795%201.31905L10.3721%204.95175L14.4959%205.53427C14.7177%205.5656%2014.9019%205.7166%2014.9712%205.9238C15.0404%206.13101%2014.9827%206.35843%2014.8222%206.51049L11.8382%209.33816L12.5427%2013.3309C12.5806%2013.5456%2012.4897%2013.7626%2012.3084%2013.8906C12.1272%2014.0187%2011.8868%2014.0356%2011.6884%2013.9342L8.00004%2012.0491L4.31158%2013.9343C4.11323%2014.0356%203.87286%2014.0187%203.69157%2013.8907C3.51028%2013.7627%203.4195%2013.5457%203.45736%2013.3309L4.1618%209.33819L1.17781%206.51052C1.01735%206.35846%200.959571%206.13101%201.02884%205.92383C1.09807%205.71663%201.28232%205.56563%201.50409%205.53431L5.62787%204.95178L7.47207%201.31905Z'%20fill='%23FFC857'/%3e%3c/svg%3e",L1="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.9491%205.89315C14.8278%205.53128%2014.5111%205.27252%2014.1226%205.21783L10.5264%204.7114L8.91813%201.55315C8.74435%201.21195%208.39257%201%207.99998%201C7.60739%201%207.25557%201.21195%207.08183%201.55315L5.47358%204.7114L1.8774%205.21783C1.48888%205.27252%201.17219%205.53128%201.05086%205.89315C0.929554%206.25501%201.02881%206.64477%201.30993%206.91038L3.91217%209.36871L3.29786%2012.8399C3.2315%2013.215%203.38755%2013.5868%203.7052%2013.8105C3.88128%2013.9344%204.08938%2014%204.30704%2014C4.47232%2014%204.63705%2013.9606%204.78341%2013.886L7.99995%2012.2471L11.2165%2013.886C11.3628%2013.9606%2011.5276%2014%2011.6929%2014C11.9106%2014%2012.1187%2013.9345%2012.2948%2013.8105C12.6124%2013.5868%2012.7685%2013.215%2012.7021%2012.84L12.0878%209.36871L14.6901%206.91035C14.9712%206.64477%2015.0704%206.25498%2014.9491%205.89315ZM14.0266%206.25082L11.2455%208.87813C11.1335%208.98392%2011.0824%209.13637%2011.1089%209.28575L11.7654%2012.9956C11.7701%2013.0226%2011.759%2013.0493%2011.7362%2013.0653C11.7202%2013.0766%2011.7038%2013.079%2011.6929%2013.079C11.6809%2013.079%2011.6694%2013.0762%2011.6587%2013.0708L8.22108%2011.3192C8.15189%2011.284%208.07593%2011.2663%207.99998%2011.2663C7.92402%2011.2663%207.84807%2011.284%207.77882%2011.3193L4.34118%2013.0708C4.33052%2013.0763%204.31904%2013.079%204.30701%2013.079C4.29611%2013.079%204.27969%2013.0767%204.26373%2013.0654C4.24092%2013.0494%204.22975%2013.0226%204.2345%2012.9957L4.89104%209.28584C4.91747%209.13646%204.86637%208.98401%204.75439%208.87822L1.97327%206.25091C1.95308%206.23184%201.94595%206.20383%201.95466%206.17786C1.9634%206.15185%201.98612%206.13326%202.01405%206.12933L5.85743%205.58807C6.0122%205.56626%206.14599%205.47208%206.21521%205.33616L7.93404%201.9608C7.94653%201.9363%207.97178%201.92107%207.99998%201.92107C8.02818%201.92107%208.05343%201.9363%208.06591%201.9608L9.78468%205.33607C9.85391%205.47199%209.9877%205.5662%2010.1425%205.58799L13.9859%206.12924C14.0138%206.1332%2014.0365%206.15176%2014.0452%206.17777C14.0539%206.20374%2014.0468%206.23175%2014.0266%206.25082Z'%20fill='%231A1F2A'/%3e%3c/svg%3e",V1={class:"tooltip tooltip-bottom tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":"Favorite"},T1=["disabled"],B1=["src"],$1={__name:"FavoriteBtn",props:{disabled:Boolean,isFilled:Boolean},setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("div",V1,[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled},[t.createElementVNode("img",{src:e.isFilled?t.unref(S1):t.unref(L1),alt:"Favorite",class:t.normalizeClass(["w-4",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,B1)],10,T1)]))}},I1="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.8544%203.20309C5.39975%202.89815%204.26277%201.76117%203.95787%200.30649C3.92042%200.12792%203.76292%200%203.58041%200C3.3979%200%203.2404%200.12792%203.20297%200.30652C2.89805%201.76117%201.76107%202.89812%200.306418%203.20302C0.127818%203.24045%20-0.00012207%203.39798%20-0.00012207%203.58046C-0.00012207%203.76295%200.127798%203.92047%200.306418%203.9579C1.76105%204.26285%202.89798%205.3998%203.2029%206.85448C3.24033%207.03307%203.39783%207.16102%203.58034%207.16102C3.76282%207.16102%203.92035%207.0331%203.95778%206.85448C4.26272%205.39983%205.39973%204.26287%206.85438%203.95799C7.03297%203.92056%207.16092%203.76306%207.16092%203.58056C7.1609%203.39805%207.03297%203.24052%206.8544%203.20309ZM3.58036%205.60938C3.14292%204.73132%202.42956%204.01792%201.55151%203.58049C2.42958%203.14305%203.14297%202.42968%203.58041%201.55161C4.01785%202.4297%204.73122%203.14307%205.60926%203.58053C4.73119%204.01797%204.0178%204.73132%203.58036%205.60938Z'%20fill='%23FFC857'/%3e%3cpath%20d='M6.21683%209.574C5.53147%209.4303%204.99578%208.8947%204.85209%208.2093C4.81466%208.0307%204.65716%207.90271%204.47465%207.90271C4.29217%207.90271%204.13464%208.0306%204.09721%208.2092C3.95352%208.8946%203.4178%209.4303%202.73244%209.574C2.55385%209.6114%202.4259%209.7689%202.4259%209.9514C2.4259%2010.1339%202.55383%2010.2914%202.73244%2010.3288C3.41778%2010.4725%203.95349%2011.0082%204.09716%2011.6936C4.13459%2011.8722%204.2921%2012.0002%204.4746%2012.0002C4.65709%2012.0002%204.81461%2011.8723%204.85204%2011.6936C4.99574%2011.0082%205.53145%2010.4725%206.21683%2010.3289C6.39543%2010.2914%206.52337%2010.1339%206.52337%209.9514C6.52337%209.7689%206.39545%209.6114%206.21683%209.574ZM4.47463%2010.6408C4.29163%2010.3688%204.05725%2010.1345%203.78526%209.9515C4.0573%209.7684%204.29163%209.5341%204.47463%209.2621C4.65765%209.5341%204.892%209.7685%205.164%209.9515C4.892%2010.1345%204.65763%2010.3688%204.47463%2010.6408Z'%20fill='%23FFC857'/%3e%3cpath%20d='M11.4271%206.00324C10.5007%205.80904%209.7766%205.08496%209.5825%204.15859C9.545%203.98%209.3875%203.85205%209.205%203.85205C9.0225%203.85205%208.865%203.97995%208.8276%204.15857C8.6334%205.08496%207.90932%205.80902%206.98293%206.0032C6.80434%206.04063%206.67639%206.19815%206.67639%206.38064C6.67639%206.56312%206.80431%206.72062%206.98293%206.75807C7.9093%206.95228%208.6334%207.67633%208.8275%208.6027C8.865%208.7813%209.0225%208.9093%209.205%208.9093C9.3875%208.9093%209.545%208.7814%209.5824%208.6027C9.7766%207.67633%2010.5007%206.95228%2011.4271%206.75812C11.6057%206.72067%2011.7336%206.56317%2011.7336%206.38068C11.7336%206.1982%2011.6057%206.04067%2011.4271%206.00324ZM9.205%207.47681C8.9365%207.02634%208.5593%206.64914%208.1089%206.38066C8.5593%206.11218%208.9365%205.73502%209.205%205.28453C9.4735%205.73502%209.8507%206.11221%2010.3012%206.38068C9.8507%206.64916%209.4735%207.02636%209.205%207.47681Z'%20fill='%23FFC857'/%3e%3ccircle%20cx='3.5'%20cy='3.5'%20r='1.5'%20fill='%23FFC857'/%3e%3cellipse%20cx='4.5'%20cy='10'%20rx='0.5'%20ry='1'%20fill='%23FFC857'/%3e%3cpath%20d='M3.5%201L4.79904%202.5H2.20096L3.5%201Z'%20fill='%23FFC857'/%3e%3cpath%20d='M6%203.5L4.5%204.79904L4.5%202.20096L6%203.5Z'%20fill='%23FFC857'/%3e%3cpath%20d='M10.3697%206.67832L8.22108%207.01422L9.5776%204.65296L10.3697%206.67832Z'%20fill='%23FFC857'/%3e%3cpath%20d='M8.27756%205.34149L10.768%206.00067L9.11199%207.77878L8.27756%205.34149Z'%20fill='%23FFC857'/%3e%3cpath%20d='M1%203.5L2.5%202.20096L2.5%204.79904L1%203.5Z'%20fill='%23FFC857'/%3e%3cpath%20d='M3.5%206L2.20096%204.5L4.79904%204.5L3.5%206Z'%20fill='%23FFC857'/%3e%3ccircle%20cx='9'%20cy='6'%20r='1'%20fill='%23FFC857'/%3e%3cpath%20d='M5.49718%209.92495L4.03391%2010.4693L3.96891%209.60573L5.49718%209.92495Z'%20fill='%23FFC857'/%3e%3cpath%20d='M3.54089%209.71696L5.10212%209.72621L4.857%2010.5568L3.54089%209.71696Z'%20fill='%23FFC857'/%3e%3cpath%20d='M3.50071%209.96247L5.0159%209.58606L4.9834%2010.4515L3.50071%209.96247Z'%20fill='%23FFC857'/%3e%3c/svg%3e",M1="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.8544%203.20309C5.39975%202.89815%204.26277%201.76117%203.95787%200.30649C3.92042%200.12792%203.76292%200%203.58041%200C3.3979%200%203.2404%200.12792%203.20297%200.30652C2.89805%201.76117%201.76107%202.89812%200.306418%203.20302C0.127818%203.24045%20-0.00012207%203.39798%20-0.00012207%203.58046C-0.00012207%203.76295%200.127798%203.92047%200.306418%203.9579C1.76105%204.26285%202.89798%205.3998%203.2029%206.85448C3.24033%207.03307%203.39783%207.16102%203.58034%207.16102C3.76282%207.16102%203.92035%207.0331%203.95778%206.85448C4.26272%205.39983%205.39973%204.26287%206.85438%203.95799C7.03297%203.92056%207.16092%203.76306%207.16092%203.58056C7.1609%203.39805%207.03297%203.24052%206.8544%203.20309ZM3.58036%205.60938C3.14292%204.73132%202.42956%204.01792%201.55151%203.58049C2.42958%203.14305%203.14297%202.42968%203.58041%201.55161C4.01785%202.4297%204.73122%203.14307%205.60926%203.58053C4.73119%204.01797%204.0178%204.73132%203.58036%205.60938Z'%20fill='%23FFC857'/%3e%3cpath%20d='M6.21683%209.574C5.53147%209.4303%204.99578%208.8947%204.85209%208.2093C4.81466%208.0307%204.65716%207.90271%204.47465%207.90271C4.29217%207.90271%204.13464%208.0306%204.09721%208.2092C3.95352%208.8946%203.4178%209.4303%202.73244%209.574C2.55385%209.6114%202.4259%209.7689%202.4259%209.9514C2.4259%2010.1339%202.55383%2010.2914%202.73244%2010.3288C3.41778%2010.4725%203.95349%2011.0082%204.09716%2011.6936C4.13459%2011.8722%204.2921%2012.0002%204.4746%2012.0002C4.65709%2012.0002%204.81461%2011.8723%204.85204%2011.6936C4.99574%2011.0082%205.53145%2010.4725%206.21683%2010.3289C6.39543%2010.2914%206.52337%2010.1339%206.52337%209.9514C6.52337%209.7689%206.39545%209.6114%206.21683%209.574ZM4.47463%2010.6408C4.29163%2010.3688%204.05725%2010.1345%203.78526%209.9515C4.0573%209.7684%204.29163%209.5341%204.47463%209.2621C4.65765%209.5341%204.892%209.7685%205.164%209.9515C4.892%2010.1345%204.65763%2010.3688%204.47463%2010.6408Z'%20fill='%23FFC857'/%3e%3cpath%20d='M11.4271%206.00324C10.5007%205.80904%209.7766%205.08496%209.5825%204.15859C9.545%203.98%209.3875%203.85205%209.205%203.85205C9.0225%203.85205%208.865%203.97995%208.8276%204.15857C8.6334%205.08496%207.90932%205.80902%206.98293%206.0032C6.80434%206.04063%206.67639%206.19815%206.67639%206.38064C6.67639%206.56312%206.80431%206.72062%206.98293%206.75807C7.9093%206.95228%208.6334%207.67633%208.8275%208.6027C8.865%208.7813%209.0225%208.9093%209.205%208.9093C9.3875%208.9093%209.545%208.7814%209.5824%208.6027C9.7766%207.67633%2010.5007%206.95228%2011.4271%206.75812C11.6057%206.72067%2011.7336%206.56317%2011.7336%206.38068C11.7336%206.1982%2011.6057%206.04067%2011.4271%206.00324ZM9.205%207.47681C8.9365%207.02634%208.5593%206.64914%208.1089%206.38066C8.5593%206.11218%208.9365%205.73502%209.205%205.28453C9.4735%205.73502%209.8507%206.11221%2010.3012%206.38068C9.8507%206.64916%209.4735%207.02636%209.205%207.47681Z'%20fill='%23FFC857'/%3e%3c/svg%3e",O1={class:"tooltip tooltip-top tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!text-xs before:!py-1 before:!px-2","data-tip":"AI Translate"},N1=["disabled"],F1=["src"],A1={__name:"AIBtn",props:{disabled:Boolean,isFilled:Boolean},setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("div",O1,[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled},[t.createElementVNode("img",{src:e.isFilled?t.unref(I1):t.unref(M1),alt:"AI",class:t.normalizeClass(["w-4",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,F1)],10,N1)]))}},R1="data:image/svg+xml,%3csvg%20width='14'%20height='16'%20viewBox='0%200%2014%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.9023%203.26667L10.8093%200.1C10.7767%200.0666667%2010.7116%200%2010.5814%200H3.74419C3.12558%200%202.60465%200.533333%202.60465%201.16667V2.66667H1.13953C0.52093%202.66667%200%203.2%200%203.83333V14.8667C0%2015.4667%200.52093%2016%201.13953%2016H10.2558C10.8744%2016%2011.3953%2015.4667%2011.3953%2014.8333V13.3333H12.8605C13.4791%2013.3333%2014%2012.8%2014%2012.1667V3.5C14%203.4%2013.9674%203.3%2013.9023%203.26667ZM12.893%203.16667H11.3954C11.1349%203.16667%2010.907%202.93333%2010.907%202.66667V1.13333L12.893%203.16667ZM10.2558%2015.3333H1.13953C0.87907%2015.3333%200.651163%2015.1%200.651163%2014.8333V3.83333C0.651163%203.53333%200.87907%203.33333%201.13953%203.33333H7.68372V5.33333C7.68372%205.96667%208.20465%206.5%208.82326%206.5H10.7767V14.8667C10.7442%2015.1%2010.5488%2015.3333%2010.2558%2015.3333ZM9.31163%204.8L10.2884%205.8H8.7907C8.53023%205.8%208.30233%205.56667%208.30233%205.3V3.76667L9.31163%204.8ZM12.8605%2012.6667H11.3953V6.13333C11.3953%206.06667%2011.3628%205.96667%2011.2977%205.9L8.20465%202.73333C8.17209%202.7%208.07442%202.66667%208.0093%202.66667H3.25581V1.16667C3.25581%200.9%203.45116%200.666666%203.74419%200.666666H10.2558V2.66667C10.2558%203.3%2010.7767%203.83333%2011.3954%203.83333H13.3488V12.2C13.3488%2012.4667%2013.1209%2012.6667%2012.8605%2012.6667Z'%20fill='%233B5695'/%3e%3c/svg%3e",D1=["data-tip"],H1=["disabled"],P1=["src"],ze={__name:"CopyBtn",props:{disabled:Boolean},setup(e){const o=t.ref("Copy"),n=()=>{o.value="Copied",setTimeout(()=>{o.value="Copy"},1e3)};return(l,a)=>(t.openBlock(),t.createElementBlock("div",{class:"tooltip tooltip-bottom tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":o.value},[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled,onClick:n},[t.createElementVNode("img",{src:t.unref(R1),alt:"Copy",class:t.normalizeClass(["w-3",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,P1)],10,H1)],8,D1))}},Z1={class:"flex flex-row px-1 pr-10 pt-1 items-center bg-transparent relative"},j1={class:"ml-1 text-sm text-gray-600"},z1={key:0,class:"italic"},U1={class:"absolute right-1 top-1 flex flex-col items-center gap-0"},Ue=G({__name:"InputBtnGroup",props:{loading:{type:Boolean,default:!1},isTTS:{type:Boolean,default:!0},src:{type:String,default:""},srcLabel:{type:String,default:""},type:{type:String,default:""},phonetic:{type:String,default:""},hasClearBtn:{type:Boolean,default:!1},hasFavoriteBtn:{type:Boolean,default:!1},hasAIBtn:{type:Boolean,default:!1},hasCopyBtn:{type:Boolean,default:!1},isFavorite:{type:Boolean,default:!1},isAITranslate:{type:Boolean,default:!1},onFavorite:{type:Function,default:()=>{}}},emits:["clear","favorite","loadTTS","aiTranslate","copy"],setup(e,{emit:o}){const n=o;return(l,a)=>(t.openBlock(),t.createElementBlock("div",Z1,[e.src&&e.isTTS?(t.openBlock(),t.createBlock(w1,{key:0,type:e.type,onLoadTTS:a[0]||(a[0]=s=>n("loadTTS"))},null,8,["type"])):t.createCommentVNode("",!0),t.createElementVNode("div",j1,[t.createTextVNode(t.toDisplayString(e.srcLabel)+" ",1),e.phonetic?(t.openBlock(),t.createElementBlock("span",z1,"- "+t.toDisplayString(e.phonetic),1)):t.createCommentVNode("",!0)]),e.loading?(t.openBlock(),t.createBlock(q2,{key:1,class:"absolute right-6 top-2"})):t.createCommentVNode("",!0),t.createElementVNode("div",U1,[e.hasClearBtn?(t.openBlock(),t.createBlock(je,{key:0,onClick:a[1]||(a[1]=s=>n("clear")),disabled:e.loading},null,8,["disabled"])):t.createCommentVNode("",!0),e.src&&e.hasAIBtn?(t.openBlock(),t.createBlock(A1,{key:1,isFilled:e.isAITranslate,onClick:a[2]||(a[2]=s=>n("aiTranslate")),disabled:e.loading},null,8,["isFilled","disabled"])):t.createCommentVNode("",!0),e.src&&e.hasFavoriteBtn?(t.openBlock(),t.createBlock($1,{key:2,isFilled:e.isFavorite,onClick:a[3]||(a[3]=s=>n("favorite")),disabled:e.loading},null,8,["isFilled","disabled"])):t.createCommentVNode("",!0),e.src&&e.hasCopyBtn?(t.openBlock(),t.createBlock(ze,{key:3,onClick:a[4]||(a[4]=s=>n("copy")),disabled:e.loading},null,8,["disabled"])):t.createCommentVNode("",!0)])]))}},[["__scopeId","data-v-a687b916"]]),J=h2("translation",()=>{const e=t.ref(null),o=t.ref(null),n=t.ref(null),l=t.ref({src:null,target:null}),a=t.ref(null),s=t.ref([]),i=t.ref([]),r=t.ref([]),c=t.ref([]),d=t.ref({src:null,target:null}),u=s2(),f=t.computed(()=>u.getLabel(e.value)),v=t.computed(()=>u.getLabel(o.value));function h(g){e.value=g.src,o.value=g.target,n.value=g.text,l.value=g.phonetic,a.value=g.result,s.value=g.dictionary,i.value=g.definitions,r.value=g.synonyms,c.value=g.examples,d.value=g.tts}function b(){e.value=null,o.value=null,n.value=null,l.value={src:null,target:null},a.value=null,s.value=[],i.value=[],r.value=[],c.value=[],d.value={src:null,target:null}}return{src:e,srcLabel:f,target:o,targetLabel:v,phonetic:l,text:n,result:a,dictionary:s,definitions:i,synonyms:r,examples:c,tts:d,init:h,reset:b}});function W1(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}function V2(e){return typeof e=="function"?e():t.unref(e)}const q1=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const We=()=>{};function G1(e,o){function n(...l){return new Promise((a,s)=>{Promise.resolve(e(()=>o.apply(this,l),{fn:o,thisArg:this,args:l})).then(a).catch(s)})}return n}function J1(e,o={}){let n,l,a=We;const s=r=>{clearTimeout(r),a(),a=We};return r=>{const c=V2(e),d=V2(o.maxWait);return n&&s(n),c<=0||d!==void 0&&d<=0?(l&&(s(l),l=null),Promise.resolve(r())):new Promise((u,f)=>{a=o.rejectOnCancel?f:u,d&&!l&&(l=setTimeout(()=>{n&&s(n),l=null,u(r())},d)),n=setTimeout(()=>{l&&s(l),l=null,u(r())},c)})}}function Y1(e,o=200,n={}){return G1(J1(o,n),e)}function qe(e){var o;const n=V2(e);return(o=n==null?void 0:n.$el)!=null?o:n}const Q1=q1?window:void 0;function X1(){const e=t.ref(!1),o=t.getCurrentInstance();return o&&t.onMounted(()=>{e.value=!0},o),e}function K1(e){const o=X1();return t.computed(()=>(o.value,!!e()))}function en(e,o,n={}){const{window:l=Q1,...a}=n;let s;const i=K1(()=>l&&"ResizeObserver"in l),r=()=>{s&&(s.disconnect(),s=void 0)},c=t.computed(()=>Array.isArray(e)?e.map(f=>qe(f)):[qe(e)]),d=t.watch(c,f=>{if(r(),i.value&&l){s=new ResizeObserver(o);for(const v of f)v&&s.observe(v,a)}},{immediate:!0,flush:"post"}),u=()=>{r(),d()};return W1(u),{isSupported:i,stop:u}}function T2(e){var o;const n=t.ref(e==null?void 0:e.element),l=t.ref(e==null?void 0:e.input),a=(o=e==null?void 0:e.styleProp)!=null?o:"height",s=t.ref(1);function i(){var r;if(!n.value)return;let c="";n.value.style[a]="1px",s.value=(r=n.value)==null?void 0:r.scrollHeight,e!=null&&e.styleTarget?V2(e.styleTarget).style[a]=`${s.value}px`:c=`${s.value}px`,n.value.style[a]=c}return t.watch([l,n],()=>t.nextTick(i),{immediate:!0}),t.watch(s,()=>{var r;return(r=e==null?void 0:e.onResize)==null?void 0:r.call(e)}),en(n,()=>i()),e!=null&&e.watch&&t.watch(e.watch,i,{immediate:!0,deep:!0}),{textarea:n,input:l,triggerResize:i}}const tn={class:"bg-white relative z-10 border rounded"},nn=G({__name:"Input",props:{text:{type:String,default:""},isTTS:{type:Boolean,default:!0}},emits:["change","clear","loadTTS"],setup(e,{emit:o}){const n=J(),l=e,a=t.ref(l.text),s=t.computed(()=>n.src),i=t.computed(()=>n.srcLabel),r=t.computed(()=>{var b;return(b=n.phonetic)==null?void 0:b.src}),{textarea:c}=T2({input:a,styleProp:"minHeight"}),d=o,u=Y1(()=>{d("change",a.value)},r2.INPUT_DEBOUNCE);t.onMounted(()=>{h()});function f(){if(!a.value){v();return}u()}function v(){d("clear"),a.value="",c.value.focus()}async function h(){await t.nextTick(),c.value.select()}return t.watch(()=>l.text,b=>{a.value!==b&&h(),a.value=b}),(b,g)=>(t.openBlock(),t.createElementBlock("div",tn,[t.createVNode(Ue,{src:s.value,srcLabel:i.value,isTTS:e.isTTS,type:"src",phonetic:r.value,hasClearBtn:a.value.length>0,onClear:v,onLoadTTS:g[0]||(g[0]=V=>d("loadTTS"))},null,8,["src","srcLabel","isTTS","phonetic","hasClearBtn"]),t.withDirectives(t.createElementVNode("textarea",{ref_key:"textarea",ref:c,"onUpdate:modelValue":g[1]||(g[1]=V=>a.value=V),class:"w-full outline-none px-2 pr-8 bg-transparent text-gray-800 resize-none pb-3 overflow-x-hidden overflow-y-hidden",autofocus:"",rows:"2",onInput:f,onFocus:h},null,544),[[t.vModelText,a.value,void 0,{trim:!0}]])]))}},[["__scopeId","data-v-0133ec1c"]]),on={class:"bg-white relative z-10 rounded-md h-full"},ln={class:"bg-transparent"},an=G({__name:"Result",props:{isFavoriteFeatureEnabled:Boolean,isAITranslateFeatureEnabled:Boolean,isAITranslate:Boolean,isFavorite:Boolean,isTTS:{type:Boolean,default:!0}},emits:["loadTTS","favorite","aiTranslate","copy"],setup(e,{emit:o}){const n=J(),l=t.computed(()=>n.result),a=t.computed(()=>n.target),s=t.computed(()=>n.targetLabel),i=t.computed(()=>{var v;return(v=n.phonetic)==null?void 0:v.target}),r=n2(),c=t.computed(()=>r.isLoading("translation")),{textarea:d,input:u}=T2({input:l,styleProp:"minHeight"}),f=o;return(v,h)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["relative p-0.5 bg-[length:300%_300%] bg-[position:0%_50%] border rounded",{"bg-gradient-to-br from-[#8556f0] via-[#d6b379] via-[#6bedd1] to-[#439beb] animate-moveGradient border border-white":e.isAITranslate&&!c.value}])},[t.createElementVNode("div",on,[t.createVNode(Ue,{loading:c.value,src:a.value,srcLabel:s.value,isTTS:e.isTTS,type:"target",hasFavoriteBtn:e.isFavoriteFeatureEnabled,hasAIBtn:e.isAITranslateFeatureEnabled,hasCopyBtn:!0,isFavorite:e.isFavorite,isAITranslate:e.isAITranslate,phonetic:i.value,onFavorite:h[0]||(h[0]=b=>f("favorite")),onLoadTTS:h[1]||(h[1]=b=>f("loadTTS")),onAiTranslate:h[2]||(h[2]=b=>f("aiTranslate")),onCopy:h[3]||(h[3]=b=>f("copy"))},null,8,["loading","src","srcLabel","isTTS","hasFavoriteBtn","hasAIBtn","isFavorite","isAITranslate","phonetic"]),t.createElementVNode("div",ln,[t.withDirectives(t.createElementVNode("textarea",{ref_key:"textarea",ref:d,"onUpdate:modelValue":h[4]||(h[4]=b=>t.isRef(u)?u.value=b:null),class:"w-full outline-none px-2 pr-8 bg-transparent text-gray-800 resize-none pb-3 overflow-x-hidden overflow-y-hidden",readonly:"",rows:"2",spellcheck:"false"},null,512),[[t.vModelText,t.unref(u)]])])])],2))}},[["__scopeId","data-v-439ecf6b"]]),sn={class:"btn btn-xs btn-circle btn-ghost"},B2={__name:"ToggleBtn",props:{isExpanded:Boolean},setup(e){const o=e;return(n,l)=>(t.openBlock(),t.createElementBlock("button",sn,[o.isExpanded?(t.openBlock(),t.createBlock(t.unref(wt),{key:0,class:"w-7 text-gray-400"})):(t.openBlock(),t.createBlock(t.unref(vt),{key:1,class:"w-7 text-gray-400"}))]))}},rn=t.createElementVNode("h2",{class:"card-title text-base font-bold text-textCustom"},"Dictionary",-1),cn={class:"capitalize text-xs font-normal text-textSecondary mb-1"},dn={class:"list-none list-inside"},un=["onClick"],fn={class:"text-sm font-normal text-gray-800 leading-4"},pn={__name:"Dictionary",emits:["translate"],setup(e,{emit:o}){const n=t.ref(!0),l=J(),a=s2(),s=t.computed(()=>l.dictionary),i=o,r=()=>{n.value=!n.value},c=d=>{i("translate",d,l.target,l.src),a.src=l.target,a.target=l.src,window.scrollTo(0,0)};return(d,u)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"flex justify-between items-center",onClick:r},[rn,t.createVNode(B2,{isExpanded:n.value},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",n.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.value,(f,v)=>(t.openBlock(),t.createElementBlock("li",{key:`${f.pos}-${v}`,class:"mb-2"},[t.createElementVNode("h5",cn,t.toDisplayString(f.pos),1),t.createElementVNode("ul",dn,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(f.items,(h,b)=>(t.openBlock(),t.createElementBlock("li",{key:`${h.word}-${b}`},[t.createElementVNode("span",{class:"m-0.5 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded",onClick:g=>c(h.word)},t.toDisplayString(h.word),9,un),t.createElementVNode("small",fn," - "+t.toDisplayString(h.reverse_translation.join(", ")),1)]))),128))])]))),128))])],2)],64))}},mn=t.createElementVNode("h2",{class:"card-title text-base font-bold text-textCustom"},"Definitions",-1),hn={class:"capitalize text-xs font-normal text-textSecondary mb-1"},gn={class:"text-sm text-textCustom list-disc list-outside ml-5"},Cn=t.createElementVNode("br",null,null,-1),bn={key:0,class:"italic text-textSecondary"},vn={__name:"Definition",setup(e){const o=t.ref(!0),n=J(),l=t.computed(()=>n.definitions),a=()=>{o.value=!o.value};return(s,i)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"flex justify-between items-center",onClick:a},[mn,t.createVNode(B2,{isExpanded:o.value},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",o.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,(r,c)=>(t.openBlock(),t.createElementBlock("li",{key:`${r.pos}-${c}`,class:"mb-2"},[t.createElementVNode("h5",hn,t.toDisplayString(r.pos),1),t.createElementVNode("ul",gn,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.items,(d,u)=>(t.openBlock(),t.createElementBlock("li",{key:`${d.gloss}-${u}`,class:"mb-1"},[t.createElementVNode("span",null,t.toDisplayString(d.gloss),1),Cn,d.example?(t.openBlock(),t.createElementBlock("small",bn,'"'+t.toDisplayString(d.example)+'"',1)):t.createCommentVNode("",!0)]))),128))])]))),128))])],2)],64))}},xn=t.createElementVNode("h2",{class:"card-title text-base font-bold text-textCustom"},"Examples",-1),wn={class:"text-textCustom text-sm list-disc list-outside ml-5 my-2"},yn=["innerHTML"],En={__name:"Example",setup(e){const o=t.ref(!0),n=J(),l=t.computed(()=>n.examples),a=()=>{o.value=!o.value};return(s,i)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"flex justify-between items-center",onClick:a},[xn,t.createVNode(B2,{isExpanded:o.value},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",o.value?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"])},[t.createElementVNode("ul",wn,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,(r,c)=>(t.openBlock(),t.createElementBlock("li",{key:`${r.definition_id}-${c}`,innerHTML:r},null,8,yn))),128))])],2)],64))}},_n=t.createElementVNode("h2",{class:"card-title text-base font-bold text-textCustom"},"Synonyms",-1),kn={class:"capitalize text-xs font-normal text-textSecondary mb-1"},Sn={class:"list-none list-inside"},Ln={class:"flex flex-wrap"},Vn=["onClick"],Tn={__name:"Synonyms",emits:["translate"],setup(e,{emit:o}){const n=t.ref(!0),l=J(),a=t.computed(()=>l.synonyms),s=o,i=()=>{n.value=!n.value},r=c=>{s("translate",c),window.scrollTo(0,0)};return(c,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"flex justify-between items-center",onClick:i},[_n,t.createVNode(B2,{isExpanded:n.value},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",n.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.value,(u,f)=>(t.openBlock(),t.createElementBlock("li",{key:`${u.pos}-${f}`,class:"mb-2"},[t.createElementVNode("h5",kn,t.toDisplayString(u.pos),1),t.createElementVNode("ul",Sn,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.items,(v,h)=>(t.openBlock(),t.createElementBlock("li",{key:`${v.word}-${h}`,class:"mb-2"},[t.createElementVNode("div",Ln,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(v.synonym,(b,g)=>(t.openBlock(),t.createElementBlock("span",{key:`${b}-${g}`,class:"m-0.5 ml-0 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded",onClick:V=>r(b)},t.toDisplayString(b),9,Vn))),128))])]))),128))])]))),128))])],2)],64))}},Bn="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%3e%3cpath%20fill='%23FFC857'%20d='M12%207a5%205%200%200%200-2%209.584V19h4v-2.416A5.001%205.001%200%200%200%2012%207z'/%3e%3cpath%20stroke='%23FFC857'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'%20d='M21%2012h1m-3.5-6.5%201-1M12%203V2M5.5%205.5l-1-1M3%2012H2m8%2010h4m3-10a5%205%200%201%200-7%204.584V19h4v-2.416A5.001%205.001%200%200%200%2017%2012z'/%3e%3c/svg%3e",$n="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%3e%3cpath%20stroke='%23FFC857'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'%20d='M21%2012h1m-3.5-6.5%201-1M12%203V2M5.5%205.5l-1-1M3%2012H2m8%2010h4m3-10a5%205%200%201%200-7%204.584V19h4v-2.416A5.001%205.001%200%200%200%2017%2012z'/%3e%3c/svg%3e",In=["disabled"],Mn=["src"],On={__name:"ChevronAIBtn",props:{disabled:Boolean,isExpanded:Boolean},setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled},[t.createElementVNode("img",{src:e.isExpanded?t.unref(Bn):t.unref($n),alt:"AI",class:t.normalizeClass(["w-6",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,Mn)],10,In))}},Nn={class:"card-body bg-white pl-2 pr-1 py-1 gap-0 relative z-10 rounded"},Fn={class:"flex justify-between items-center"},An=t.createElementVNode("h2",{class:"card-title text-base font-bold text-textCustom"},"AI Summary",-1),Rn={class:"flex items-center"},Dn={class:"tooltip tooltip-bottom tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded before:!text-textSecondary before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":"AI Summarize"},Hn={key:0,class:"text-textCustom list-none list-outside"},Pn=["innerHTML"],Zn={__name:"AIExplanation",props:{isAIExplain:{type:Boolean,default:!1,required:!0},explanation:{type:Object,required:!0}},emits:["aiExplain"],setup(e,{emit:o}){const n=n2(),l=t.computed(()=>n.isLoading("aiExplanation")),a=o;function s(){a("aiExplain")}return(i,r)=>{var c,d;return t.openBlock(),t.createElementBlock("div",Nn,[t.createElementVNode("div",Fn,[An,t.createElementVNode("div",Rn,[l.value?(t.openBlock(),t.createBlock(q2,{key:0})):t.createCommentVNode("",!0),t.createElementVNode("div",Dn,[t.createVNode(On,{isExpanded:e.isAIExplain,disabled:l.value,onClick:s},null,8,["isExpanded","disabled"])])])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",e.isAIExplain?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"])},[(c=e.explanation)!=null&&c.result?(t.openBlock(),t.createElementBlock("ul",Hn,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(((d=e.explanation)==null?void 0:d.result.split(`
17
+ This will fail in production.`);r=f2,r._s.has(l)||(s?W2(l,o,a,r):De(l,a,r),process.env.NODE_ENV!=="production"&&(i._pinia=r));const u=r._s.get(l);if(process.env.NODE_ENV!=="production"&&c){const f="__hot:"+l,v=s?W2(f,o,a,r,!0):De(f,D({},a),r,!0);c._hotUpdate(v),delete r.state.value[f],r._s.delete(f)}if(process.env.NODE_ENV!=="production"&&E2){const f=t.getCurrentInstance();if(f&&f.proxy&&!c){const v=f.proxy,h="_pStores"in v?v._pStores:v._pStores={};h[l]=u}}return u}return i.$id=l,i}const n2=h2("loader",()=>{const e=t.ref({translation:!1,aiExplanation:!1,writing:!1});return{loadingStates:e,setLoading:(l,a)=>{e.value[l]=a},isLoading:l=>e.value[l]}}),He={__name:"Select",props:t.mergeModels({languages:{type:Object,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const o=n2(),n=e,l=t.useModel(e,"modelValue"),a=t.ref(""),s=t.ref(null),i=t.computed(()=>Object.entries(n.languages).filter(([,c])=>c.toLowerCase().includes(a.value.toLowerCase()))),r=c=>{c.target.value="",a.value="",s.value&&s.value.$el.click()};return(c,d)=>(t.openBlock(),t.createBlock(t.unref(mt),{modelValue:l.value,"onUpdate:modelValue":d[3]||(d[3]=u=>l.value=u),disabled:t.unref(o).loading,as:"div",class:"relative mt-1"},{default:t.withCtx(()=>[t.createVNode(t.unref(gt),{class:"w-full bg-white border border-gray-300 rounded py-2.5 pl-3 pr-10 text-sm text-gray-800 font-medium focus:outline-none focus:ring-0.5 focus:ring-gray-400 focus:border-gray-400",onChange:d[0]||(d[0]=u=>a.value=u.target.value),displayValue:u=>e.languages[u],onFocus:d[1]||(d[1]=u=>r(u))},null,8,["displayValue"]),t.createVNode(t.unref(ht),{ref_key:"btnSelect",ref:s,class:"absolute inset-y-0 right-0 flex items-center pr-2"},{default:t.withCtx(()=>[t.createVNode(t.unref(xt),{class:"h-5 w-5 text-gray-400","aria-hidden":"true",onClick:d[2]||(d[2]=u=>r(u))})]),_:1},512),t.createVNode(t.unref(Ct),{class:"absolute mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm z-50"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.value,([u,f])=>(t.openBlock(),t.createBlock(t.unref(bt),{key:u,value:u},{default:t.withCtx(({active:v,selected:h})=>[t.createElementVNode("li",{class:t.normalizeClass(["relative cursor-default select-none py-2 pl-3 pr-9",v?"bg-[#3B5695] text-white":"text-textCustom"])},[t.createElementVNode("span",{class:t.normalizeClass(["block truncate",h&&"font-semibold"])},t.toDisplayString(f),3)],2)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue","disabled"]))}},Pe="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.68688%202.3131C3.88214%202.50837%203.88214%202.82495%203.68688%203.02021L2.04043%204.66666L3.68688%206.3131C3.88214%206.50837%203.88214%206.82495%203.68688%207.02021C3.49162%207.21547%203.17504%207.21547%202.97977%207.02021L0.979775%205.02021C0.784513%204.82495%200.784513%204.50837%200.979775%204.3131L2.97977%202.3131C3.17504%202.11784%203.49162%202.11784%203.68688%202.3131Z'%20fill='%237E7E7E'/%3e%3cpath%20d='M12.3131%208.97977C12.5084%208.78451%2012.825%208.78451%2013.0202%208.97977L15.0202%2010.9798C15.2155%2011.175%2015.2155%2011.4916%2015.0202%2011.6869L13.0202%2013.6869C12.825%2013.8821%2012.5084%2013.8821%2012.3131%2013.6869C12.1178%2013.4916%2012.1178%2013.175%2012.3131%2012.9798L13.9596%2011.3333L12.3131%209.68688C12.1178%209.49161%2012.1178%209.17503%2012.3131%208.97977Z'%20fill='%237E7E7E'/%3e%3cpath%20d='M0.833328%204.66666C0.833328%204.39051%201.05719%204.16666%201.33333%204.16666H14.6667C14.9428%204.16666%2015.1667%204.39051%2015.1667%204.66666C15.1667%204.9428%2014.9428%205.16666%2014.6667%205.16666H1.33333C1.05719%205.16666%200.833328%204.9428%200.833328%204.66666Z'%20fill='%237E7E7E'/%3e%3cpath%20d='M0.833328%2011.3333C0.833328%2011.0572%201.05719%2010.8333%201.33333%2010.8333H14.6667C14.9428%2010.8333%2015.1667%2011.0572%2015.1667%2011.3333C15.1667%2011.6095%2014.9428%2011.8333%2014.6667%2011.8333H1.33333C1.05719%2011.8333%200.833328%2011.6095%200.833328%2011.3333Z'%20fill='%237E7E7E'/%3e%3c/svg%3e",Yt=["disabled"],Qt=[t.createElementVNode("img",{src:Pe,alt:"swap",class:"w-4"},null,-1)],Xt=["disabled"],Kt=[t.createElementVNode("img",{src:Pe,alt:"swap",class:"w-4"},null,-1)],e1={__name:"SwapBtn",props:{isBidirect:{type:Boolean,default:!1}},emits:["swap"],setup(e,{emit:o}){const n=n2(),l=t.computed(()=>n.isLoading("translation")),a=o;return(s,i)=>e.isBidirect?(t.openBlock(),t.createElementBlock("button",{key:1,onClick:i[0]||(i[0]=r=>a("swap")),disabled:l.value},Kt,8,Xt)):(t.openBlock(),t.createElementBlock("button",{key:0,disabled:l.value},Qt,8,Yt))}},s2=h2("language",()=>{const e=t.ref("auto"),o=t.ref("vi"),n=t.ref({src:[],target:[]}),l=t.computed(()=>n.value.src[e.value]),a=t.computed(()=>n.value.target[o.value]);function s(c,d){e.value=c==null?void 0:c.src,o.value=c==null?void 0:c.target,n.value=d}function i(){if(!n.value.src[o.value]||!n.value.target[e.value])return;const c=e.value;e.value=o.value,o.value=c}function r(c){return n.value.src[c]||n.value.target[c]}return{languages:n,src:e,target:o,srcLabel:l,targetLabel:a,init:s,swap:i,getLabel:r}}),t1={key:0,class:"flex flex-col"},n1={class:"flex"},o1={class:"grow flex flex-col"},l1={key:0,class:"flex mt-1 space-x-1"},a1=["onClick"],s1={class:"grow flex flex-col"},r1={key:0,class:"flex mt-1 space-x-1 justify-end"},i1=["onClick"],c1={class:"flex"},d1={class:"grow flex flex-col"},u1={class:"grow flex flex-col"},Ze=3,f1={__name:"Selects",setup(e){const o=s2(),n=t.ref([]),l=t.ref([]);function a(){o.swap()}return t.onMounted(()=>{var s,i;n.value=((s=b2.getLocalStorage("recentSrc"))==null?void 0:s.filter(r=>!!r))||[],l.value=((i=b2.getLocalStorage("recentTarget"))==null?void 0:i.filter(r=>!!r))||[]}),t.watch(()=>o.src,s=>{s&&(n.value.includes(s)||(n.value.unshift(s),n.value=n.value.slice(0,Ze),b2.setLocalStorage("recentSrc",n.value)))}),t.watch(()=>o.target,s=>{s&&(l.value.includes(s)||(l.value.unshift(s),l.value=l.value.slice(0,Ze),b2.setLocalStorage("recentTarget",l.value)))}),(s,i)=>t.unref(o).languages?(t.openBlock(),t.createElementBlock("div",t1,[t.createElementVNode("div",n1,[t.createElementVNode("div",o1,[n.value.length>0?(t.openBlock(),t.createElementBlock("div",l1,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,r=>(t.openBlock(),t.createElementBlock("button",{key:r,class:"px-1 bg-baseColor border border-primaryColor text-primaryColor text-xs rounded hover:bg-primaryColor hover:text-baseColor",onClick:c=>t.unref(o).src=r},t.toDisplayString(t.unref(o).languages.src[r]),9,a1))),128))])):t.createCommentVNode("",!0)]),t.createElementVNode("div",s1,[l.value.length>0?(t.openBlock(),t.createElementBlock("div",r1,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,r=>(t.openBlock(),t.createElementBlock("button",{key:r,class:"px-1 bg-baseColor border border-primaryColor text-primaryColor text-xs rounded hover:bg-primaryColor hover:text-baseColor",onClick:c=>t.unref(o).target=r},t.toDisplayString(t.unref(o).languages.target[r]),9,i1))),128))])):t.createCommentVNode("",!0)])]),t.createElementVNode("div",c1,[t.createElementVNode("div",d1,[t.createVNode(He,{modelValue:t.unref(o).src,"onUpdate:modelValue":i[0]||(i[0]=r=>t.unref(o).src=r),languages:t.unref(o).languages.src,class:"grow"},null,8,["modelValue","languages"])]),t.createVNode(e1,{isBidirect:t.unref(o).src!=="auto",class:"grow-0 mx-3 mt-4 self-start",onSwap:a},null,8,["isBidirect"]),t.createElementVNode("div",u1,[t.createVNode(He,{modelValue:t.unref(o).target,"onUpdate:modelValue":i[1]||(i[1]=r=>t.unref(o).target=r),languages:t.unref(o).languages.target,class:"grow"},null,8,["modelValue","languages"])])])])):t.createCommentVNode("",!0)}},r2={INPUT_MAX_LENGTH:5e3,INPUT_DEBOUNCE:1e3,IMPROVE_INPUT_MIN_LENGTH:4,DEFAULT_DIFF_MODE:!0},G=(e,o)=>{const n=e.__vccOpts||e;for(const[l,a]of o)n[l]=a;return n},p1={},m1={class:"mr-2 loading loading-dots loading-xs"};function h1(e,o){return t.openBlock(),t.createElementBlock("span",m1)}const q2=G(p1,[["render",h1]]),G2=h2("tts",()=>{const e=t.ref({src:null,target:null});function o(a){a.src&&(e.value.src=a.src),a.target&&(e.value.target=a.target)}function n(a){if(a==="src")return e.value.src;if(a==="target")return e.value.target}function l(){e.value={src:null,target:null}}return{tts:e,set:o,get:n,reset:l}}),g1="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.33325%204.66667H3.51125C3.82693%204.6667%204.13239%204.55473%204.37325%204.35067L6.83392%202.26667C6.99592%202.12953%207.19374%202.04156%207.40407%202.01312C7.61441%201.98468%207.82849%202.01696%208.02109%202.10615C8.21369%202.19534%208.37678%202.33772%208.49114%202.51652C8.60551%202.69532%208.66638%202.90309%208.66659%203.11534V12.8847C8.66649%2013.097%208.60565%2013.305%208.49125%2013.4839C8.37685%2013.6628%208.21367%2013.8053%208.02094%2013.8945C7.82822%2013.9837%207.614%2014.0159%207.40356%2013.9874C7.19312%2013.9588%206.99523%2013.8707%206.83325%2013.7333L4.37325%2011.6487C4.13229%2011.4449%203.82685%2011.3331%203.51125%2011.3333H2.33325C2.06804%2011.3333%201.81368%2011.228%201.62615%2011.0404C1.43861%2010.8529%201.33325%2010.5986%201.33325%2010.3333V5.66667C1.33325%205.40145%201.43861%205.1471%201.62615%204.95956C1.81368%204.77203%202.06804%204.66667%202.33325%204.66667ZM11.1779%2011.18C11.5969%2010.763%2011.9294%2010.2674%2012.1562%209.72156C12.3831%209.17572%2012.4999%208.59044%2012.4999%207.99934C12.4999%207.40823%2012.3831%206.82295%2012.1562%206.27711C11.9294%205.73127%2011.5969%205.23564%2011.1779%204.81867C11.1317%204.77098%2011.0765%204.73297%2011.0155%204.70686C10.9544%204.68075%2010.8888%204.66705%2010.8224%204.66657C10.756%204.66609%2010.6902%204.67883%2010.6288%204.70406C10.5674%204.72929%2010.5116%204.76649%2010.4647%204.8135C10.4179%204.86051%2010.3808%204.91639%2010.3558%204.97787C10.3307%205.03935%2010.3181%205.10521%2010.3188%205.17159C10.3195%205.23798%2010.3334%205.30357%2010.3597%205.36453C10.3859%205.42549%2010.4241%205.48061%2010.4719%205.52667C10.7977%205.85079%2011.0562%206.23609%2011.2326%206.66043C11.409%207.08477%2011.4998%207.53979%2011.4998%207.99934C11.4998%208.45888%2011.409%208.9139%2011.2326%209.33824C11.0562%209.76258%2010.7977%2010.1479%2010.4719%2010.472C10.4241%2010.5181%2010.3859%2010.5732%2010.3597%2010.6341C10.3334%2010.6951%2010.3195%2010.7607%2010.3188%2010.8271C10.3181%2010.8935%2010.3307%2010.9593%2010.3558%2011.0208C10.3808%2011.0823%2010.4179%2011.1382%2010.4647%2011.1852C10.5116%2011.2322%2010.5674%2011.2694%2010.6288%2011.2946C10.6902%2011.3198%2010.756%2011.3326%2010.8224%2011.3321C10.8888%2011.3316%2010.9544%2011.3179%2011.0155%2011.2918C11.0765%2011.2657%2011.1317%2011.2277%2011.1779%2011.18ZM12.7113%2013.2127C12.6123%2013.2126%2012.5157%2013.1832%2012.4335%2013.1281C12.3513%2013.0731%2012.2873%2012.9949%2012.2495%2012.9035C12.2118%2012.8121%2012.202%2012.7115%2012.2214%2012.6146C12.2408%2012.5176%2012.2886%2012.4285%2012.3586%2012.3587C12.9317%2011.7866%2013.3865%2011.1071%2013.6967%2010.359C14.0069%209.61101%2014.1666%208.80915%2014.1666%207.99934C14.1666%207.18952%2014.0069%206.38766%2013.6967%205.63963C13.3865%204.8916%2012.9317%204.2121%2012.3586%203.64C12.3122%203.59351%2012.2754%203.53834%2012.2503%203.47764C12.2252%203.41693%2012.2124%203.35188%2012.2124%203.2862C12.2125%203.22052%2012.2255%203.15549%2012.2507%203.09483C12.2759%203.03417%2012.3128%202.97907%2012.3593%202.93267C12.4057%202.88627%2012.4609%202.84948%2012.5216%202.8244C12.5823%202.79932%2012.6474%202.78645%2012.7131%202.78651C12.7787%202.78657%2012.8438%202.79957%2012.9044%202.82476C12.9651%202.84995%2013.0202%202.88685%2013.0666%202.93334C13.7327%203.59825%2014.2612%204.38801%2014.6218%205.25741C14.9824%206.12681%2015.168%207.05879%2015.168%208C15.168%208.94122%2014.9824%209.87319%2014.6218%2010.7426C14.2612%2011.612%2013.7327%2012.4018%2013.0666%2013.0667C13.02%2013.1134%2012.9646%2013.1504%2012.9036%2013.1756C12.8426%2013.2007%2012.7772%2013.2129%2012.7113%2013.2127Z'%20fill='%233B5695'/%3e%3c/svg%3e",C1="data:image/svg+xml,%3csvg%20class='swap-on%20fill-current%20h-4%20w-4'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill-rule='evenodd'%20d='M4.5%207.5a3%203%200%200%201%203-3h9a3%203%200%200%201%203%203v9a3%203%200%200%201-3%203h-9a3%203%200%200%201-3-3v-9Z'%20clip-rule='evenodd'%20fill='%238595BE'/%3e%3c/svg%3e",b1=["disabled"],v1=["src"],x1=["src"],w1={__name:"SpeakBtn",props:{type:{type:String,default:""},disabled:Boolean},emits:["loadTTS"],setup(e,{emit:o}){const n=G2(),l=e,a=o,s=t.computed(()=>n.tts[l.type]),i=t.ref(!1),r=new Audio,c=t.ref(!1);t.watch(s,()=>{if(!s.value){i.value=!1;return}c.value&&(c.value=!1,u())},{immediate:!0}),t.onUnmounted(()=>{f(),r.src=""});function d(){if(s.value){u();return}c.value=!0,i.value=!0,a("loadTTS")}function u(){s.value&&(r.src=s.value,r.playbackRate=.7,i.value=!0,r.play().catch(()=>{i.value=!1}))}function f(){r.pause(),r.currentTime=0,i.value=!1}return r.onended=()=>{i.value=!1},(v,h)=>i.value?(t.openBlock(),t.createElementBlock("button",{key:1,class:"btn btn-xs btn-circle",onClick:t.withModifiers(f,["prevent"])},[t.createElementVNode("img",{src:t.unref(C1),alt:"Stop",class:"w-4"},null,8,x1)])):(t.openBlock(),t.createElementBlock("button",{key:0,class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled,onClick:t.withModifiers(d,["prevent"])},[t.createElementVNode("img",{src:t.unref(g1),alt:"Play",class:t.normalizeClass(["w-4",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,v1)],10,b1))}},y1="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.19102%203.19102C3.44571%202.93633%203.85864%202.93633%204.11333%203.19102L12.809%2011.8867C13.0637%2012.1414%2013.0637%2012.5543%2012.809%2012.809C12.5543%2013.0637%2012.1414%2013.0637%2011.8867%2012.809L3.19102%204.11333C2.93633%203.85864%202.93633%203.44571%203.19102%203.19102Z'%20fill='%231A1F2A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.809%203.19102C13.0637%203.44571%2013.0637%203.85864%2012.809%204.11333L4.11333%2012.809C3.85864%2013.0637%203.44571%2013.0637%203.19102%2012.809C2.93633%2012.5543%202.93633%2012.1414%203.19102%2011.8867L11.8867%203.19102C12.1414%202.93633%2012.5543%202.93633%2012.809%203.19102Z'%20fill='%231A1F2A'/%3e%3c/svg%3e",E1={class:"tooltip tooltip-bottom tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":"Clear"},_1=["disabled"],k1=["src"],je={__name:"ClearBtn",props:{disabled:Boolean},setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("div",E1,[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled},[t.createElementVNode("img",{src:t.unref(y1),alt:"Clear",class:t.normalizeClass(["w-4",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,k1)],10,_1)]))}},S1="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.47207%201.31905C7.57125%201.12371%207.77589%201%208.00001%201C8.22413%201%208.42877%201.12367%208.52795%201.31905L10.3721%204.95175L14.4959%205.53427C14.7177%205.5656%2014.9019%205.7166%2014.9712%205.9238C15.0404%206.13101%2014.9827%206.35843%2014.8222%206.51049L11.8382%209.33816L12.5427%2013.3309C12.5806%2013.5456%2012.4897%2013.7626%2012.3084%2013.8906C12.1272%2014.0187%2011.8868%2014.0356%2011.6884%2013.9342L8.00004%2012.0491L4.31158%2013.9343C4.11323%2014.0356%203.87286%2014.0187%203.69157%2013.8907C3.51028%2013.7627%203.4195%2013.5457%203.45736%2013.3309L4.1618%209.33819L1.17781%206.51052C1.01735%206.35846%200.959571%206.13101%201.02884%205.92383C1.09807%205.71663%201.28232%205.56563%201.50409%205.53431L5.62787%204.95178L7.47207%201.31905Z'%20fill='%23FFC857'/%3e%3c/svg%3e",L1="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.9491%205.89315C14.8278%205.53128%2014.5111%205.27252%2014.1226%205.21783L10.5264%204.7114L8.91813%201.55315C8.74435%201.21195%208.39257%201%207.99998%201C7.60739%201%207.25557%201.21195%207.08183%201.55315L5.47358%204.7114L1.8774%205.21783C1.48888%205.27252%201.17219%205.53128%201.05086%205.89315C0.929554%206.25501%201.02881%206.64477%201.30993%206.91038L3.91217%209.36871L3.29786%2012.8399C3.2315%2013.215%203.38755%2013.5868%203.7052%2013.8105C3.88128%2013.9344%204.08938%2014%204.30704%2014C4.47232%2014%204.63705%2013.9606%204.78341%2013.886L7.99995%2012.2471L11.2165%2013.886C11.3628%2013.9606%2011.5276%2014%2011.6929%2014C11.9106%2014%2012.1187%2013.9345%2012.2948%2013.8105C12.6124%2013.5868%2012.7685%2013.215%2012.7021%2012.84L12.0878%209.36871L14.6901%206.91035C14.9712%206.64477%2015.0704%206.25498%2014.9491%205.89315ZM14.0266%206.25082L11.2455%208.87813C11.1335%208.98392%2011.0824%209.13637%2011.1089%209.28575L11.7654%2012.9956C11.7701%2013.0226%2011.759%2013.0493%2011.7362%2013.0653C11.7202%2013.0766%2011.7038%2013.079%2011.6929%2013.079C11.6809%2013.079%2011.6694%2013.0762%2011.6587%2013.0708L8.22108%2011.3192C8.15189%2011.284%208.07593%2011.2663%207.99998%2011.2663C7.92402%2011.2663%207.84807%2011.284%207.77882%2011.3193L4.34118%2013.0708C4.33052%2013.0763%204.31904%2013.079%204.30701%2013.079C4.29611%2013.079%204.27969%2013.0767%204.26373%2013.0654C4.24092%2013.0494%204.22975%2013.0226%204.2345%2012.9957L4.89104%209.28584C4.91747%209.13646%204.86637%208.98401%204.75439%208.87822L1.97327%206.25091C1.95308%206.23184%201.94595%206.20383%201.95466%206.17786C1.9634%206.15185%201.98612%206.13326%202.01405%206.12933L5.85743%205.58807C6.0122%205.56626%206.14599%205.47208%206.21521%205.33616L7.93404%201.9608C7.94653%201.9363%207.97178%201.92107%207.99998%201.92107C8.02818%201.92107%208.05343%201.9363%208.06591%201.9608L9.78468%205.33607C9.85391%205.47199%209.9877%205.5662%2010.1425%205.58799L13.9859%206.12924C14.0138%206.1332%2014.0365%206.15176%2014.0452%206.17777C14.0539%206.20374%2014.0468%206.23175%2014.0266%206.25082Z'%20fill='%231A1F2A'/%3e%3c/svg%3e",V1={class:"tooltip tooltip-bottom tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":"Favorite"},T1=["disabled"],B1=["src"],$1={__name:"FavoriteBtn",props:{disabled:Boolean,isFilled:Boolean},setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("div",V1,[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled},[t.createElementVNode("img",{src:e.isFilled?t.unref(S1):t.unref(L1),alt:"Favorite",class:t.normalizeClass(["w-4",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,B1)],10,T1)]))}},I1="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.8544%203.20309C5.39975%202.89815%204.26277%201.76117%203.95787%200.30649C3.92042%200.12792%203.76292%200%203.58041%200C3.3979%200%203.2404%200.12792%203.20297%200.30652C2.89805%201.76117%201.76107%202.89812%200.306418%203.20302C0.127818%203.24045%20-0.00012207%203.39798%20-0.00012207%203.58046C-0.00012207%203.76295%200.127798%203.92047%200.306418%203.9579C1.76105%204.26285%202.89798%205.3998%203.2029%206.85448C3.24033%207.03307%203.39783%207.16102%203.58034%207.16102C3.76282%207.16102%203.92035%207.0331%203.95778%206.85448C4.26272%205.39983%205.39973%204.26287%206.85438%203.95799C7.03297%203.92056%207.16092%203.76306%207.16092%203.58056C7.1609%203.39805%207.03297%203.24052%206.8544%203.20309ZM3.58036%205.60938C3.14292%204.73132%202.42956%204.01792%201.55151%203.58049C2.42958%203.14305%203.14297%202.42968%203.58041%201.55161C4.01785%202.4297%204.73122%203.14307%205.60926%203.58053C4.73119%204.01797%204.0178%204.73132%203.58036%205.60938Z'%20fill='%23FFC857'/%3e%3cpath%20d='M6.21683%209.574C5.53147%209.4303%204.99578%208.8947%204.85209%208.2093C4.81466%208.0307%204.65716%207.90271%204.47465%207.90271C4.29217%207.90271%204.13464%208.0306%204.09721%208.2092C3.95352%208.8946%203.4178%209.4303%202.73244%209.574C2.55385%209.6114%202.4259%209.7689%202.4259%209.9514C2.4259%2010.1339%202.55383%2010.2914%202.73244%2010.3288C3.41778%2010.4725%203.95349%2011.0082%204.09716%2011.6936C4.13459%2011.8722%204.2921%2012.0002%204.4746%2012.0002C4.65709%2012.0002%204.81461%2011.8723%204.85204%2011.6936C4.99574%2011.0082%205.53145%2010.4725%206.21683%2010.3289C6.39543%2010.2914%206.52337%2010.1339%206.52337%209.9514C6.52337%209.7689%206.39545%209.6114%206.21683%209.574ZM4.47463%2010.6408C4.29163%2010.3688%204.05725%2010.1345%203.78526%209.9515C4.0573%209.7684%204.29163%209.5341%204.47463%209.2621C4.65765%209.5341%204.892%209.7685%205.164%209.9515C4.892%2010.1345%204.65763%2010.3688%204.47463%2010.6408Z'%20fill='%23FFC857'/%3e%3cpath%20d='M11.4271%206.00324C10.5007%205.80904%209.7766%205.08496%209.5825%204.15859C9.545%203.98%209.3875%203.85205%209.205%203.85205C9.0225%203.85205%208.865%203.97995%208.8276%204.15857C8.6334%205.08496%207.90932%205.80902%206.98293%206.0032C6.80434%206.04063%206.67639%206.19815%206.67639%206.38064C6.67639%206.56312%206.80431%206.72062%206.98293%206.75807C7.9093%206.95228%208.6334%207.67633%208.8275%208.6027C8.865%208.7813%209.0225%208.9093%209.205%208.9093C9.3875%208.9093%209.545%208.7814%209.5824%208.6027C9.7766%207.67633%2010.5007%206.95228%2011.4271%206.75812C11.6057%206.72067%2011.7336%206.56317%2011.7336%206.38068C11.7336%206.1982%2011.6057%206.04067%2011.4271%206.00324ZM9.205%207.47681C8.9365%207.02634%208.5593%206.64914%208.1089%206.38066C8.5593%206.11218%208.9365%205.73502%209.205%205.28453C9.4735%205.73502%209.8507%206.11221%2010.3012%206.38068C9.8507%206.64916%209.4735%207.02636%209.205%207.47681Z'%20fill='%23FFC857'/%3e%3ccircle%20cx='3.5'%20cy='3.5'%20r='1.5'%20fill='%23FFC857'/%3e%3cellipse%20cx='4.5'%20cy='10'%20rx='0.5'%20ry='1'%20fill='%23FFC857'/%3e%3cpath%20d='M3.5%201L4.79904%202.5H2.20096L3.5%201Z'%20fill='%23FFC857'/%3e%3cpath%20d='M6%203.5L4.5%204.79904L4.5%202.20096L6%203.5Z'%20fill='%23FFC857'/%3e%3cpath%20d='M10.3697%206.67832L8.22108%207.01422L9.5776%204.65296L10.3697%206.67832Z'%20fill='%23FFC857'/%3e%3cpath%20d='M8.27756%205.34149L10.768%206.00067L9.11199%207.77878L8.27756%205.34149Z'%20fill='%23FFC857'/%3e%3cpath%20d='M1%203.5L2.5%202.20096L2.5%204.79904L1%203.5Z'%20fill='%23FFC857'/%3e%3cpath%20d='M3.5%206L2.20096%204.5L4.79904%204.5L3.5%206Z'%20fill='%23FFC857'/%3e%3ccircle%20cx='9'%20cy='6'%20r='1'%20fill='%23FFC857'/%3e%3cpath%20d='M5.49718%209.92495L4.03391%2010.4693L3.96891%209.60573L5.49718%209.92495Z'%20fill='%23FFC857'/%3e%3cpath%20d='M3.54089%209.71696L5.10212%209.72621L4.857%2010.5568L3.54089%209.71696Z'%20fill='%23FFC857'/%3e%3cpath%20d='M3.50071%209.96247L5.0159%209.58606L4.9834%2010.4515L3.50071%209.96247Z'%20fill='%23FFC857'/%3e%3c/svg%3e",M1="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.8544%203.20309C5.39975%202.89815%204.26277%201.76117%203.95787%200.30649C3.92042%200.12792%203.76292%200%203.58041%200C3.3979%200%203.2404%200.12792%203.20297%200.30652C2.89805%201.76117%201.76107%202.89812%200.306418%203.20302C0.127818%203.24045%20-0.00012207%203.39798%20-0.00012207%203.58046C-0.00012207%203.76295%200.127798%203.92047%200.306418%203.9579C1.76105%204.26285%202.89798%205.3998%203.2029%206.85448C3.24033%207.03307%203.39783%207.16102%203.58034%207.16102C3.76282%207.16102%203.92035%207.0331%203.95778%206.85448C4.26272%205.39983%205.39973%204.26287%206.85438%203.95799C7.03297%203.92056%207.16092%203.76306%207.16092%203.58056C7.1609%203.39805%207.03297%203.24052%206.8544%203.20309ZM3.58036%205.60938C3.14292%204.73132%202.42956%204.01792%201.55151%203.58049C2.42958%203.14305%203.14297%202.42968%203.58041%201.55161C4.01785%202.4297%204.73122%203.14307%205.60926%203.58053C4.73119%204.01797%204.0178%204.73132%203.58036%205.60938Z'%20fill='%23FFC857'/%3e%3cpath%20d='M6.21683%209.574C5.53147%209.4303%204.99578%208.8947%204.85209%208.2093C4.81466%208.0307%204.65716%207.90271%204.47465%207.90271C4.29217%207.90271%204.13464%208.0306%204.09721%208.2092C3.95352%208.8946%203.4178%209.4303%202.73244%209.574C2.55385%209.6114%202.4259%209.7689%202.4259%209.9514C2.4259%2010.1339%202.55383%2010.2914%202.73244%2010.3288C3.41778%2010.4725%203.95349%2011.0082%204.09716%2011.6936C4.13459%2011.8722%204.2921%2012.0002%204.4746%2012.0002C4.65709%2012.0002%204.81461%2011.8723%204.85204%2011.6936C4.99574%2011.0082%205.53145%2010.4725%206.21683%2010.3289C6.39543%2010.2914%206.52337%2010.1339%206.52337%209.9514C6.52337%209.7689%206.39545%209.6114%206.21683%209.574ZM4.47463%2010.6408C4.29163%2010.3688%204.05725%2010.1345%203.78526%209.9515C4.0573%209.7684%204.29163%209.5341%204.47463%209.2621C4.65765%209.5341%204.892%209.7685%205.164%209.9515C4.892%2010.1345%204.65763%2010.3688%204.47463%2010.6408Z'%20fill='%23FFC857'/%3e%3cpath%20d='M11.4271%206.00324C10.5007%205.80904%209.7766%205.08496%209.5825%204.15859C9.545%203.98%209.3875%203.85205%209.205%203.85205C9.0225%203.85205%208.865%203.97995%208.8276%204.15857C8.6334%205.08496%207.90932%205.80902%206.98293%206.0032C6.80434%206.04063%206.67639%206.19815%206.67639%206.38064C6.67639%206.56312%206.80431%206.72062%206.98293%206.75807C7.9093%206.95228%208.6334%207.67633%208.8275%208.6027C8.865%208.7813%209.0225%208.9093%209.205%208.9093C9.3875%208.9093%209.545%208.7814%209.5824%208.6027C9.7766%207.67633%2010.5007%206.95228%2011.4271%206.75812C11.6057%206.72067%2011.7336%206.56317%2011.7336%206.38068C11.7336%206.1982%2011.6057%206.04067%2011.4271%206.00324ZM9.205%207.47681C8.9365%207.02634%208.5593%206.64914%208.1089%206.38066C8.5593%206.11218%208.9365%205.73502%209.205%205.28453C9.4735%205.73502%209.8507%206.11221%2010.3012%206.38068C9.8507%206.64916%209.4735%207.02636%209.205%207.47681Z'%20fill='%23FFC857'/%3e%3c/svg%3e",O1={class:"tooltip tooltip-top tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!text-xs before:!py-1 before:!px-2","data-tip":"AI Translate"},N1=["disabled"],F1=["src"],A1={__name:"AIBtn",props:{disabled:Boolean,isFilled:Boolean},setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("div",O1,[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled},[t.createElementVNode("img",{src:e.isFilled?t.unref(I1):t.unref(M1),alt:"AI",class:t.normalizeClass(["w-4",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,F1)],10,N1)]))}},R1="data:image/svg+xml,%3csvg%20width='14'%20height='16'%20viewBox='0%200%2014%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.9023%203.26667L10.8093%200.1C10.7767%200.0666667%2010.7116%200%2010.5814%200H3.74419C3.12558%200%202.60465%200.533333%202.60465%201.16667V2.66667H1.13953C0.52093%202.66667%200%203.2%200%203.83333V14.8667C0%2015.4667%200.52093%2016%201.13953%2016H10.2558C10.8744%2016%2011.3953%2015.4667%2011.3953%2014.8333V13.3333H12.8605C13.4791%2013.3333%2014%2012.8%2014%2012.1667V3.5C14%203.4%2013.9674%203.3%2013.9023%203.26667ZM12.893%203.16667H11.3954C11.1349%203.16667%2010.907%202.93333%2010.907%202.66667V1.13333L12.893%203.16667ZM10.2558%2015.3333H1.13953C0.87907%2015.3333%200.651163%2015.1%200.651163%2014.8333V3.83333C0.651163%203.53333%200.87907%203.33333%201.13953%203.33333H7.68372V5.33333C7.68372%205.96667%208.20465%206.5%208.82326%206.5H10.7767V14.8667C10.7442%2015.1%2010.5488%2015.3333%2010.2558%2015.3333ZM9.31163%204.8L10.2884%205.8H8.7907C8.53023%205.8%208.30233%205.56667%208.30233%205.3V3.76667L9.31163%204.8ZM12.8605%2012.6667H11.3953V6.13333C11.3953%206.06667%2011.3628%205.96667%2011.2977%205.9L8.20465%202.73333C8.17209%202.7%208.07442%202.66667%208.0093%202.66667H3.25581V1.16667C3.25581%200.9%203.45116%200.666666%203.74419%200.666666H10.2558V2.66667C10.2558%203.3%2010.7767%203.83333%2011.3954%203.83333H13.3488V12.2C13.3488%2012.4667%2013.1209%2012.6667%2012.8605%2012.6667Z'%20fill='%233B5695'/%3e%3c/svg%3e",D1=["data-tip"],H1=["disabled"],P1=["src"],ze={__name:"CopyBtn",props:{disabled:Boolean},setup(e){const o=t.ref("Copy"),n=()=>{o.value="Copied",setTimeout(()=>{o.value="Copy"},1e3)};return(l,a)=>(t.openBlock(),t.createElementBlock("div",{class:"tooltip tooltip-bottom tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":o.value},[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled,onClick:n},[t.createElementVNode("img",{src:t.unref(R1),alt:"Copy",class:t.normalizeClass(["w-3",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,P1)],10,H1)],8,D1))}},Z1={class:"flex flex-row px-1 pr-10 pt-1 items-center bg-transparent relative"},j1={class:"ml-1 text-sm text-gray-600"},z1={key:0,class:"italic"},U1={class:"absolute right-1 top-1 flex flex-col items-center gap-0"},Ue=G({__name:"InputBtnGroup",props:{loading:{type:Boolean,default:!1},isTTS:{type:Boolean,default:!0},src:{type:String,default:""},srcLabel:{type:String,default:""},type:{type:String,default:""},phonetic:{type:String,default:""},hasClearBtn:{type:Boolean,default:!1},hasFavoriteBtn:{type:Boolean,default:!1},hasAIBtn:{type:Boolean,default:!1},hasCopyBtn:{type:Boolean,default:!1},isFavorite:{type:Boolean,default:!1},isAITranslate:{type:Boolean,default:!1},onFavorite:{type:Function,default:()=>{}}},emits:["clear","favorite","loadTTS","aiTranslate","copy"],setup(e,{emit:o}){const n=o;return(l,a)=>(t.openBlock(),t.createElementBlock("div",Z1,[e.src&&e.isTTS?(t.openBlock(),t.createBlock(w1,{key:0,type:e.type,onLoadTTS:a[0]||(a[0]=s=>n("loadTTS"))},null,8,["type"])):t.createCommentVNode("",!0),t.createElementVNode("div",j1,[t.createTextVNode(t.toDisplayString(e.srcLabel)+" ",1),e.phonetic?(t.openBlock(),t.createElementBlock("span",z1,"- "+t.toDisplayString(e.phonetic),1)):t.createCommentVNode("",!0)]),e.loading?(t.openBlock(),t.createBlock(q2,{key:1,class:"absolute right-6 top-2"})):t.createCommentVNode("",!0),t.createElementVNode("div",U1,[e.hasClearBtn?(t.openBlock(),t.createBlock(je,{key:0,onClick:a[1]||(a[1]=s=>n("clear")),disabled:e.loading},null,8,["disabled"])):t.createCommentVNode("",!0),e.src&&e.hasAIBtn?(t.openBlock(),t.createBlock(A1,{key:1,isFilled:e.isAITranslate,onClick:a[2]||(a[2]=s=>n("aiTranslate")),disabled:e.loading},null,8,["isFilled","disabled"])):t.createCommentVNode("",!0),e.src&&e.hasFavoriteBtn?(t.openBlock(),t.createBlock($1,{key:2,isFilled:e.isFavorite,onClick:a[3]||(a[3]=s=>n("favorite")),disabled:e.loading},null,8,["isFilled","disabled"])):t.createCommentVNode("",!0),e.src&&e.hasCopyBtn?(t.openBlock(),t.createBlock(ze,{key:3,onClick:a[4]||(a[4]=s=>n("copy")),disabled:e.loading},null,8,["disabled"])):t.createCommentVNode("",!0)])]))}},[["__scopeId","data-v-a687b916"]]),J=h2("translation",()=>{const e=t.ref(null),o=t.ref(null),n=t.ref(null),l=t.ref({src:null,target:null}),a=t.ref(null),s=t.ref([]),i=t.ref([]),r=t.ref([]),c=t.ref([]),d=t.ref({src:null,target:null}),u=s2(),f=t.computed(()=>u.getLabel(e.value)),v=t.computed(()=>u.getLabel(o.value));function h(g){e.value=g.src,o.value=g.target,n.value=g.text,l.value=g.phonetic,a.value=g.result,s.value=g.dictionary,i.value=g.definitions,r.value=g.synonyms,c.value=g.examples,d.value=g.tts}function b(){e.value=null,o.value=null,n.value=null,l.value={src:null,target:null},a.value=null,s.value=[],i.value=[],r.value=[],c.value=[],d.value={src:null,target:null}}return{src:e,srcLabel:f,target:o,targetLabel:v,phonetic:l,text:n,result:a,dictionary:s,definitions:i,synonyms:r,examples:c,tts:d,init:h,reset:b}});function W1(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}function V2(e){return typeof e=="function"?e():t.unref(e)}const q1=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const We=()=>{};function G1(e,o){function n(...l){return new Promise((a,s)=>{Promise.resolve(e(()=>o.apply(this,l),{fn:o,thisArg:this,args:l})).then(a).catch(s)})}return n}function J1(e,o={}){let n,l,a=We;const s=r=>{clearTimeout(r),a(),a=We};return r=>{const c=V2(e),d=V2(o.maxWait);return n&&s(n),c<=0||d!==void 0&&d<=0?(l&&(s(l),l=null),Promise.resolve(r())):new Promise((u,f)=>{a=o.rejectOnCancel?f:u,d&&!l&&(l=setTimeout(()=>{n&&s(n),l=null,u(r())},d)),n=setTimeout(()=>{l&&s(l),l=null,u(r())},c)})}}function Y1(e,o=200,n={}){return G1(J1(o,n),e)}function qe(e){var o;const n=V2(e);return(o=n==null?void 0:n.$el)!=null?o:n}const Q1=q1?window:void 0;function X1(){const e=t.ref(!1),o=t.getCurrentInstance();return o&&t.onMounted(()=>{e.value=!0},o),e}function K1(e){const o=X1();return t.computed(()=>(o.value,!!e()))}function en(e,o,n={}){const{window:l=Q1,...a}=n;let s;const i=K1(()=>l&&"ResizeObserver"in l),r=()=>{s&&(s.disconnect(),s=void 0)},c=t.computed(()=>Array.isArray(e)?e.map(f=>qe(f)):[qe(e)]),d=t.watch(c,f=>{if(r(),i.value&&l){s=new ResizeObserver(o);for(const v of f)v&&s.observe(v,a)}},{immediate:!0,flush:"post"}),u=()=>{r(),d()};return W1(u),{isSupported:i,stop:u}}function T2(e){var o;const n=t.ref(e==null?void 0:e.element),l=t.ref(e==null?void 0:e.input),a=(o=e==null?void 0:e.styleProp)!=null?o:"height",s=t.ref(1);function i(){var r;if(!n.value)return;let c="";n.value.style[a]="1px",s.value=(r=n.value)==null?void 0:r.scrollHeight,e!=null&&e.styleTarget?V2(e.styleTarget).style[a]=`${s.value}px`:c=`${s.value}px`,n.value.style[a]=c}return t.watch([l,n],()=>t.nextTick(i),{immediate:!0}),t.watch(s,()=>{var r;return(r=e==null?void 0:e.onResize)==null?void 0:r.call(e)}),en(n,()=>i()),e!=null&&e.watch&&t.watch(e.watch,i,{immediate:!0,deep:!0}),{textarea:n,input:l,triggerResize:i}}const tn={class:"bg-white relative z-10 border rounded"},nn=G({__name:"Input",props:{text:{type:String,default:""},isTTS:{type:Boolean,default:!0}},emits:["change","clear","loadTTS"],setup(e,{emit:o}){const n=J(),l=e,a=t.ref(l.text),s=t.computed(()=>n.src),i=t.computed(()=>n.srcLabel),r=t.computed(()=>{var b;return(b=n.phonetic)==null?void 0:b.src}),{textarea:c}=T2({input:a,styleProp:"minHeight"}),d=o,u=Y1(()=>{d("change",a.value)},r2.INPUT_DEBOUNCE);t.onMounted(()=>{h()});function f(){if(!a.value){v();return}u()}function v(){d("clear"),a.value="",c.value.focus()}async function h(){await t.nextTick(),c.value.select()}return t.watch(()=>l.text,b=>{a.value!==b&&h(),a.value=b}),(b,g)=>(t.openBlock(),t.createElementBlock("div",tn,[t.createVNode(Ue,{src:s.value,srcLabel:i.value,isTTS:e.isTTS,type:"src",phonetic:r.value,hasClearBtn:a.value.length>0,onClear:v,onLoadTTS:g[0]||(g[0]=V=>d("loadTTS"))},null,8,["src","srcLabel","isTTS","phonetic","hasClearBtn"]),t.withDirectives(t.createElementVNode("textarea",{ref_key:"textarea",ref:c,"onUpdate:modelValue":g[1]||(g[1]=V=>a.value=V),class:"w-full outline-none px-2 pr-8 bg-transparent text-gray-800 resize-none pb-3 overflow-x-hidden overflow-y-hidden",autofocus:"",rows:"2",onInput:f,onFocus:h},null,544),[[t.vModelText,a.value,void 0,{trim:!0}]])]))}},[["__scopeId","data-v-0133ec1c"]]),on={class:"bg-white relative z-10 rounded-md h-full"},ln={class:"bg-transparent"},an=G({__name:"Result",props:{isFavoriteFeatureEnabled:Boolean,isAITranslateFeatureEnabled:Boolean,isAITranslate:Boolean,isFavorite:Boolean,isTTS:{type:Boolean,default:!0}},emits:["loadTTS","favorite","aiTranslate","copy"],setup(e,{emit:o}){const n=J(),l=t.computed(()=>n.result),a=t.computed(()=>n.target),s=t.computed(()=>n.targetLabel),i=t.computed(()=>{var v;return(v=n.phonetic)==null?void 0:v.target}),r=n2(),c=t.computed(()=>r.isLoading("translation")),{textarea:d,input:u}=T2({input:l,styleProp:"minHeight"}),f=o;return(v,h)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["relative p-0.5 bg-[length:300%_300%] bg-[position:0%_50%] border rounded",{"bg-gradient-to-br from-[#8556f0] via-[#d6b379] via-[#6bedd1] to-[#439beb] animate-moveGradient border border-white":e.isAITranslate&&!c.value}])},[t.createElementVNode("div",on,[t.createVNode(Ue,{loading:c.value,src:a.value,srcLabel:s.value,isTTS:e.isTTS,type:"target",hasFavoriteBtn:e.isFavoriteFeatureEnabled,hasAIBtn:e.isAITranslateFeatureEnabled,hasCopyBtn:!0,isFavorite:e.isFavorite,isAITranslate:e.isAITranslate,phonetic:i.value,onFavorite:h[0]||(h[0]=b=>f("favorite")),onLoadTTS:h[1]||(h[1]=b=>f("loadTTS")),onAiTranslate:h[2]||(h[2]=b=>f("aiTranslate")),onCopy:h[3]||(h[3]=b=>f("copy"))},null,8,["loading","src","srcLabel","isTTS","hasFavoriteBtn","hasAIBtn","isFavorite","isAITranslate","phonetic"]),t.createElementVNode("div",ln,[t.withDirectives(t.createElementVNode("textarea",{ref_key:"textarea",ref:d,"onUpdate:modelValue":h[4]||(h[4]=b=>t.isRef(u)?u.value=b:null),class:"w-full outline-none px-2 pr-8 bg-transparent text-gray-800 resize-none pb-3 overflow-x-hidden overflow-y-hidden",readonly:"",rows:"2",spellcheck:"false"},null,512),[[t.vModelText,t.unref(u)]])])])],2))}},[["__scopeId","data-v-439ecf6b"]]),sn={class:"btn btn-xs btn-circle btn-ghost"},B2={__name:"ToggleBtn",props:{isExpanded:Boolean},setup(e){const o=e;return(n,l)=>(t.openBlock(),t.createElementBlock("button",sn,[o.isExpanded?(t.openBlock(),t.createBlock(t.unref(wt),{key:0,class:"w-7 text-gray-400"})):(t.openBlock(),t.createBlock(t.unref(vt),{key:1,class:"w-7 text-gray-400"}))]))}},rn=t.createElementVNode("h2",{class:"card-title text-base font-bold text-textCustom"},"Dictionary",-1),cn={class:"capitalize text-xs font-normal text-textSecondary mb-1"},dn={class:"list-none list-inside"},un=["onClick"],fn={class:"text-sm font-normal text-gray-800 leading-4"},pn={__name:"Dictionary",emits:["translate"],setup(e,{emit:o}){const n=t.ref(!0),l=J(),a=s2(),s=t.computed(()=>l.dictionary),i=o,r=()=>{n.value=!n.value},c=d=>{i("translate",d,l.target,l.src),a.src=l.target,a.target=l.src,window.scrollTo(0,0)};return(d,u)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"flex justify-between items-center",onClick:r},[rn,t.createVNode(B2,{isExpanded:n.value},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",n.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.value,(f,v)=>(t.openBlock(),t.createElementBlock("li",{key:`${f.pos}-${v}`,class:"mb-2"},[t.createElementVNode("h5",cn,t.toDisplayString(f.pos),1),t.createElementVNode("ul",dn,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(f.items,(h,b)=>(t.openBlock(),t.createElementBlock("li",{key:`${h.word}-${b}`},[t.createElementVNode("span",{class:"m-0.5 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded",onClick:g=>c(h.word)},t.toDisplayString(h.word),9,un),t.createElementVNode("small",fn," - "+t.toDisplayString(h.reverse_translation.join(", ")),1)]))),128))])]))),128))])],2)],64))}},mn=t.createElementVNode("h2",{class:"card-title text-base font-bold text-textCustom"},"Definitions",-1),hn={class:"capitalize text-xs font-normal text-textSecondary mb-1"},gn={class:"text-sm text-textCustom list-disc list-outside ml-5"},Cn=t.createElementVNode("br",null,null,-1),bn={key:0,class:"italic text-textSecondary"},vn={__name:"Definition",setup(e){const o=t.ref(!0),n=J(),l=t.computed(()=>n.definitions),a=()=>{o.value=!o.value};return(s,i)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"flex justify-between items-center",onClick:a},[mn,t.createVNode(B2,{isExpanded:o.value},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",o.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,(r,c)=>(t.openBlock(),t.createElementBlock("li",{key:`${r.pos}-${c}`,class:"mb-2"},[t.createElementVNode("h5",hn,t.toDisplayString(r.pos),1),t.createElementVNode("ul",gn,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.items,(d,u)=>(t.openBlock(),t.createElementBlock("li",{key:`${d.gloss}-${u}`,class:"mb-1"},[t.createElementVNode("span",null,t.toDisplayString(d.gloss),1),Cn,d.example?(t.openBlock(),t.createElementBlock("small",bn,'"'+t.toDisplayString(d.example)+'"',1)):t.createCommentVNode("",!0)]))),128))])]))),128))])],2)],64))}},xn=t.createElementVNode("h2",{class:"card-title text-base font-bold text-textCustom"},"Examples",-1),wn={class:"text-textCustom text-sm list-disc list-outside ml-5 my-2"},yn=["innerHTML"],En={__name:"Example",setup(e){const o=t.ref(!0),n=J(),l=t.computed(()=>n.examples),a=()=>{o.value=!o.value};return(s,i)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"flex justify-between items-center",onClick:a},[xn,t.createVNode(B2,{isExpanded:o.value},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",o.value?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"])},[t.createElementVNode("ul",wn,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,(r,c)=>(t.openBlock(),t.createElementBlock("li",{key:`${r.definition_id}-${c}`,innerHTML:r},null,8,yn))),128))])],2)],64))}},_n=t.createElementVNode("h2",{class:"card-title text-base font-bold text-textCustom"},"Synonyms",-1),kn={class:"capitalize text-xs font-normal text-textSecondary mb-1"},Sn={class:"list-none list-inside"},Ln={class:"flex flex-wrap"},Vn=["onClick"],Tn={__name:"Synonyms",emits:["translate"],setup(e,{emit:o}){const n=t.ref(!0),l=J(),a=t.computed(()=>l.synonyms),s=o,i=()=>{n.value=!n.value},r=c=>{s("translate",c),window.scrollTo(0,0)};return(c,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"flex justify-between items-center",onClick:i},[_n,t.createVNode(B2,{isExpanded:n.value},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",n.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.value,(u,f)=>(t.openBlock(),t.createElementBlock("li",{key:`${u.pos}-${f}`,class:"mb-2"},[t.createElementVNode("h5",kn,t.toDisplayString(u.pos),1),t.createElementVNode("ul",Sn,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.items,(v,h)=>(t.openBlock(),t.createElementBlock("li",{key:`${v.word}-${h}`,class:"mb-2"},[t.createElementVNode("div",Ln,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(v.synonym,(b,g)=>(t.openBlock(),t.createElementBlock("span",{key:`${b}-${g}`,class:"m-0.5 ml-0 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded",onClick:V=>r(b)},t.toDisplayString(b),9,Vn))),128))])]))),128))])]))),128))])],2)],64))}},Bn="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%3e%3cpath%20fill='%23FFC857'%20d='M12%207a5%205%200%200%200-2%209.584V19h4v-2.416A5.001%205.001%200%200%200%2012%207z'/%3e%3cpath%20stroke='%23FFC857'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'%20d='M21%2012h1m-3.5-6.5%201-1M12%203V2M5.5%205.5l-1-1M3%2012H2m8%2010h4m3-10a5%205%200%201%200-7%204.584V19h4v-2.416A5.001%205.001%200%200%200%2017%2012z'/%3e%3c/svg%3e",$n="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%3e%3cpath%20stroke='%23FFC857'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'%20d='M21%2012h1m-3.5-6.5%201-1M12%203V2M5.5%205.5l-1-1M3%2012H2m8%2010h4m3-10a5%205%200%201%200-7%204.584V19h4v-2.416A5.001%205.001%200%200%200%2017%2012z'/%3e%3c/svg%3e",In=["disabled"],Mn=["src"],On={__name:"ChevronAIBtn",props:{disabled:Boolean,isExpanded:Boolean},setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled},[t.createElementVNode("img",{src:e.isExpanded?t.unref(Bn):t.unref($n),alt:"AI",class:t.normalizeClass(["w-6",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,Mn)],10,In))}},Nn={class:"card-body bg-white pl-2 pr-1 py-1 gap-0 relative z-10 rounded"},Fn={class:"flex justify-between items-center"},An=t.createElementVNode("h2",{class:"card-title text-base font-bold text-textCustom"},"AI Summary",-1),Rn={class:"flex items-center"},Dn={class:"tooltip tooltip-bottom tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded before:!text-textSecondary before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":"AI Summarize"},Hn={key:0,class:"text-textCustom list-none list-outside"},Pn=["innerHTML"],Zn={__name:"AIExplanation",props:{isAIExplain:{type:Boolean,default:!1,required:!0},explanation:{type:Object,required:!0}},emits:["aiExplain"],setup(e,{emit:o}){const n=n2(),l=t.computed(()=>n.isLoading("aiExplanation")),a=o;function s(){a("aiExplain")}return(i,r)=>{var c,d;return t.openBlock(),t.createElementBlock("div",Nn,[t.createElementVNode("div",Fn,[An,t.createElementVNode("div",Rn,[l.value?(t.openBlock(),t.createBlock(q2,{key:0})):t.createCommentVNode("",!0),t.createElementVNode("div",Dn,[t.createVNode(On,{isExpanded:e.isAIExplain,disabled:l.value,onClick:s},null,8,["isExpanded","disabled"])])])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",e.isAIExplain?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"])},[(c=e.explanation)!=null&&c.result?(t.openBlock(),t.createElementBlock("ul",Hn,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(((d=e.explanation)==null?void 0:d.result.split(`
18
18
  `))||[],(u,f)=>(t.openBlock(),t.createElementBlock("li",{key:`${u}-${f}`,innerHTML:u},null,8,Pn))),128))])):t.createCommentVNode("",!0)],2)])}}};function jn(){document.documentElement.setAttribute("dir","rtl")}function zn(){document.documentElement.removeAttribute("dir")}const Ge={supportRTL:jn,removeRTL:zn},Un=["ar","fa","iw","yi","ur","pa"],Wn=e=>(t.pushScopeId("data-v-77944531"),e=e(),t.popScopeId(),e),qn={class:"pb-6"},Gn={class:"flex flex-col lg:flex-row lg:gap-2"},Jn={id:"input",class:"w-full lg:w-[calc(50%-1rem)] flex mt-1"},Yn=Wn(()=>t.createElementVNode("div",{class:"w-6 h-4 mx-auto hidden lg:block"},null,-1)),Qn={class:"w-full lg:w-[calc(50%-1rem)] flex mt-1"},Xn={key:0,class:"masonry-container mt-1"},Kn={key:0,class:"masonry-item"},eo={key:1,class:"masonry-item"},to={class:"p-2"},no={key:2,class:"masonry-item"},oo={class:"p-2"},lo={key:3,class:"masonry-item"},ao={class:"p-2"},so={key:4,class:"masonry-item"},ro={class:"p-2"},io={key:1,class:"text-textCustom italic font-medium"},co=G({__name:"TranslateTab",props:{opt:Object,languages:Object,translation:Object,explanation:Object,tts:Object,isTTS:Boolean,isFavoriteFeatureEnabled:Boolean,isAITranslateFeatureEnabled:Boolean,isFavorite:Boolean,isAITranslate:Boolean,isAIExplain:Boolean,aiExplainMinLength:Number},emits:["opt","translate","loadTTS","favorite","aiTranslate","aiExplain","copy"],setup(e,{emit:o}){const n=t.ref(""),l=e,a=t.inject("translationStore"),s=t.inject("ttsStore"),i=t.inject("languageStore"),r=t.inject("loaderStore"),c=o,d=()=>{const x=l.opt.target;Un.includes(x)?Ge.supportRTL():Ge.removeRTL()};t.watch(()=>l.translation,x=>{r.setLoading("translation",!1),x&&(n.value=x.text,a.init(x),s.reset())},{immediate:!0}),t.watch([()=>l.explanation,()=>l.isAIExplain],([x])=>{x!=null&&x.result&&r.setLoading("aiExplanation",!1)},{immediate:!0,deep:!0}),t.watch(()=>l.tts,x=>{if(!x){s.reset();return}s.set(x)},{immediate:!0}),t.watch([()=>l.opt,()=>l.languages],([x,C])=>{i.init(x,C),d()}),t.watch([()=>i.src,()=>i.target],([x,C])=>{c("opt",{src:x,target:C}),h(n.value)}),t.onMounted(()=>{i.init(l.opt,l.languages),d()});function u(){n.value="",l.isAITranslate&&b(),a.reset()}function f(x){n.value=x,h(x)}function v(x){const C=x==="src"?a.text:a.result;c("loadTTS",{type:x,data:C})}function h(x,C=i.src,_=i.target){x&&(V(),n.value=x,r.setLoading("translation",!0),c("translate",{src:C,target:_,text:x}))}function b(){l.isAITranslate||r.setLoading("translation",!0),c("aiTranslate",{src:i.src,target:i.target,text:n.value})}function g(){l.isAIExplain||r.setLoading("aiExplanation",!0),c("aiExplain",{src:i.src,target:i.target,text:n.value})}function V(){const x=document.getElementById("input");x&&x.getBoundingClientRect().top<0&&x.scrollIntoView({behavior:"smooth"})}return(x,C)=>{var _,S,w,T,y;return t.openBlock(),t.createElementBlock("div",qn,[t.createVNode(f1),t.createElementVNode("div",Gn,[t.createElementVNode("div",Jn,[t.createVNode(nn,{text:n.value,isTTS:e.isTTS,onChange:f,onClear:u,onLoadTTS:C[0]||(C[0]=E=>v("src")),class:"flex-grow flex flex-col"},null,8,["text","isTTS"])]),Yn,t.createElementVNode("div",Qn,[t.createVNode(an,{isFavoriteFeatureEnabled:e.isFavoriteFeatureEnabled,isAITranslateFeatureEnabled:e.isAITranslateFeatureEnabled,isAITranslate:e.isAITranslate,isFavorite:e.isFavorite,isTTS:e.isTTS,onCopy:C[1]||(C[1]=E=>{var B;return x.$emit("copy",(B=t.unref(a))==null?void 0:B.result)}),onAiTranslate:b,onFavorite:C[2]||(C[2]=E=>x.$emit("favorite")),onLoadTTS:C[3]||(C[3]=E=>v("target")),class:"flex-grow flex flex-col"},null,8,["isFavoriteFeatureEnabled","isAITranslateFeatureEnabled","isAITranslate","isFavorite","isTTS"])])]),e.translation?(t.openBlock(),t.createElementBlock("div",Xn,[((_=t.unref(a).result)==null?void 0:_.length)>e.aiExplainMinLength?(t.openBlock(),t.createElementBlock("div",Kn,[t.createVNode(Zn,{isAIExplain:e.isAIExplain,explanation:e.explanation,onAiExplain:g},null,8,["isAIExplain","explanation"])])):t.createCommentVNode("",!0),(S=t.unref(a).dictionary)!=null&&S.length?(t.openBlock(),t.createElementBlock("div",eo,[t.createElementVNode("div",to,[t.createVNode(pn,{onTranslate:h})])])):t.createCommentVNode("",!0),(w=t.unref(a).definitions)!=null&&w.length?(t.openBlock(),t.createElementBlock("div",no,[t.createElementVNode("div",oo,[t.createVNode(vn)])])):t.createCommentVNode("",!0),(T=t.unref(a).synonyms)!=null&&T.length?(t.openBlock(),t.createElementBlock("div",lo,[t.createElementVNode("div",ao,[t.createVNode(Tn,{onTranslate:h})])])):t.createCommentVNode("",!0),(y=t.unref(a).examples)!=null&&y.length?(t.openBlock(),t.createElementBlock("div",so,[t.createElementVNode("div",ro,[t.createVNode(En)])])):t.createCommentVNode("",!0)])):(t.openBlock(),t.createElementBlock("span",io,"Service unavailable"))])}}},[["__scopeId","data-v-77944531"]]),uo="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%20stroke='%233B5695'%3e%3cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'%20d='M4%204v5h.582m15.356%202A8.001%208.001%200%20004.582%209m0%200H9m11%2011v-5h-.581m0%200a8.003%208.003%200%2001-15.357-2m15.357%202H15'%20/%3e%3c/svg%3e",fo=["disabled"],po=["src"],mo={__name:"RetryBtn",props:{disabled:Boolean},emits:["click"],setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("button",{class:"bg-white rounded-full hover:bg-gray-100 focus:outline-none active:scale-95",onClick:n[0]||(n[0]=l=>o.$emit("click")),disabled:e.disabled,"aria-label":"Retry"},[t.createElementVNode("img",{src:t.unref(uo),alt:"Retry",class:t.normalizeClass(["h-5 w-5 text-primaryColor",{"opacity-50":e.disabled}])},null,10,po)],8,fo))}},ho="data:image/svg+xml,%3csvg%20fill='%233B5695'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12,7a4,4,0,1,0,4,4A4,4,0,0,0,12,7Zm0,6a2,2,0,1,1,2-2A2,2,0,0,1,12,13Zm6.5,2v1.5H20a1,1,0,0,1,0,2H18.5V20a1,1,0,0,1-2,0V18.5H15a1,1,0,0,1,0-2h1.5V15a1,1,0,0,1,2,0Zm3.438-4.345a.987.987,0,0,1,0,.69,13.339,13.339,0,0,1-1.08,2.264,1,1,0,1,1-1.715-1.028A11.3,11.3,0,0,0,19.928,11C18.451,7.343,15.373,5,12,5S5.549,7.343,4.072,11a9.315,9.315,0,0,0,6.167,5.787,1,1,0,1,1-.478,1.942,11.393,11.393,0,0,1-7.7-7.383.99.99,0,0,1,0-.691C3.773,6,7.674,3,12,3S20.227,6,21.938,10.655Z'/%3e%3c/svg%3e",go="data:image/svg+xml,%3csvg%20fill='%233B5695'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.293,21.707a1,1,0,0,0,1.414,0l3.2-3.2A9.581,9.581,0,0,0,12,20c4.325,0,8.227-3,9.938-7.654a.993.993,0,0,0,0-.692A12.6,12.6,0,0,0,18.7,6.719l3.012-3.012a1,1,0,1,0-1.414-1.414l-3.2,3.2A9.581,9.581,0,0,0,12,4C7.675,4,3.773,7,2.062,11.654a.993.993,0,0,0,0,.692,12.6,12.6,0,0,0,3.243,4.935L2.293,20.293A1,1,0,0,0,2.293,21.707ZM17.266,8.148A10.454,10.454,0,0,1,19.929,12c-1.478,3.657-4.556,6-7.929,6a7.52,7.52,0,0,1-3.632-.954l1.613-1.613A3.947,3.947,0,0,0,12,16a4,4,0,0,0,4-4,3.947,3.947,0,0,0-.567-2.019Zm-7.191,4.363A1.96,1.96,0,0,1,10,12a2,2,0,0,1,2-2,1.96,1.96,0,0,1,.511.075Zm3.85-1.022A1.96,1.96,0,0,1,14,12a2,2,0,0,1-2,2,1.96,1.96,0,0,1-.511-.075ZM4.071,12C5.549,8.343,8.627,6,12,6a7.52,7.52,0,0,1,3.632.954L14.019,8.567A3.947,3.947,0,0,0,12,8a4,4,0,0,0-4,4,3.947,3.947,0,0,0,.567,2.019L6.734,15.852A10.454,10.454,0,0,1,4.071,12Z'/%3e%3c/svg%3e",Co=["data-tip"],bo=["disabled"],vo=["src","alt"],xo={__name:"ToggleDiffBtn",props:{disabled:Boolean,isDiffMode:Boolean},emits:["toggle"],setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("div",{class:"tooltip tooltip-bottom tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":e.isDiffMode?"Hide Differences":"Show Differences"},[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled,onClick:n[0]||(n[0]=l=>o.$emit("toggle"))},[t.createElementVNode("img",{src:e.isDiffMode?t.unref(ho):t.unref(go),alt:e.isDiffMode?"Hide Differences":"Show Differences",class:t.normalizeClass(["w-4",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,vo)],10,bo)],8,Co))}},wo={class:"flex flex-row px-2 pr-10 items-center bg-transparent relative"},yo={class:"absolute right-1 top-1 flex flex-col items-center gap-0"},Je={__name:"InputBtnGroup",props:{loading:{type:Boolean,default:!1},src:{type:String,default:""},hasCopyBtn:{type:Boolean,default:!1},hasClearBtn:{type:Boolean,default:!1},showDiffToggle:{type:Boolean,default:!1},isDiffMode:{type:Boolean,default:!1},hasInfoBtn:{type:Boolean,default:!1}},emits:["copy","clear","toggleDiff","info"],setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("div",wo,[e.loading?(t.openBlock(),t.createBlock(q2,{key:0,class:"absolute right-6 top-2"})):t.createCommentVNode("",!0),t.createElementVNode("div",yo,[e.showDiffToggle?(t.openBlock(),t.createBlock(xo,{key:0,disabled:e.loading,isDiffMode:e.isDiffMode,onToggle:n[0]||(n[0]=l=>o.$emit("toggleDiff"))},null,8,["disabled","isDiffMode"])):t.createCommentVNode("",!0),e.hasClearBtn&&e.src?(t.openBlock(),t.createBlock(je,{key:1,onClick:n[1]||(n[1]=l=>o.$emit("clear")),disabled:e.loading},null,8,["disabled"])):t.createCommentVNode("",!0),e.hasCopyBtn&&e.src?(t.openBlock(),t.createBlock(ze,{key:2,onClick:n[2]||(n[2]=l=>o.$emit("copy"))})):t.createCommentVNode("",!0)])]))}},Eo={class:"bg-white relative z-10 border rounded"},_o=["onKeydown","placeholder"],ko=G({__name:"Input",props:{text:{type:String,default:""}},emits:["change","clear","improve"],setup(e,{emit:o}){const n=e,l=t.ref(n.text),{textarea:a}=T2({input:l,styleProp:"minHeight"}),s=o;function i(){if(!l.value){r();return}s("change",l.value)}function r(){s("clear"),l.value="",a.value.focus()}function c(){a.value&&a.value.select()}function d(){l.value&&s("improve",l.value)}return t.watch(()=>n.text,u=>{l.value!==u&&(l.value=u,t.nextTick(c))}),t.onMounted(()=>{l.value=n.text,t.nextTick(()=>{a.value.focus(),c()})}),(u,f)=>(t.openBlock(),t.createElementBlock("div",Eo,[t.createVNode(Je,{src:e.text,hasClearBtn:!0,hasInfoBtn:!0,onClear:r,class:"mb-1"},null,8,["src"]),t.withDirectives(t.createElementVNode("textarea",{ref_key:"textarea",ref:a,"onUpdate:modelValue":f[0]||(f[0]=v=>l.value=v),class:"w-full outline-none px-2 pr-8 bg-transparent text-gray-800 resize-none pb-3 overflow-x-hidden overflow-y-hidden h-full",autofocus:"",rows:"2",onInput:i,onFocus:c,onKeydown:t.withKeys(t.withModifiers(d,["ctrl","prevent"]),["enter"]),placeholder:`Min ${t.unref(r2).IMPROVE_INPUT_MIN_LENGTH} characters. ${t.unref(N2)?"":"Ctrl+Enter to improve"}`},null,40,_o),[[t.vModelText,l.value,void 0,{trim:!0}]])]))}},[["__scopeId","data-v-0b6444b1"]]);function z(){}z.prototype={diff:function(o,n){var l,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=a.callback;typeof a=="function"&&(s=a,a={});var i=this;function r(S){return S=i.postProcess(S,a),s?(setTimeout(function(){s(S)},0),!0):S}o=this.castInput(o,a),n=this.castInput(n,a),o=this.removeEmpty(this.tokenize(o,a)),n=this.removeEmpty(this.tokenize(n,a));var c=n.length,d=o.length,u=1,f=c+d;a.maxEditLength!=null&&(f=Math.min(f,a.maxEditLength));var v=(l=a.timeout)!==null&&l!==void 0?l:1/0,h=Date.now()+v,b=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(b[0],n,o,0,a);if(b[0].oldPos+1>=d&&g+1>=c)return r(Ye(i,b[0].lastComponent,n,o,i.useLongestToken));var V=-1/0,x=1/0;function C(){for(var S=Math.max(V,-u);S<=Math.min(x,u);S+=2){var w=void 0,T=b[S-1],y=b[S+1];T&&(b[S-1]=void 0);var E=!1;if(y){var B=y.oldPos-S;E=y&&0<=B&&B<c}var p=T&&T.oldPos+1<d;if(!E&&!p){b[S]=void 0;continue}if(!p||E&&T.oldPos<y.oldPos?w=i.addToPath(y,!0,!1,0,a):w=i.addToPath(T,!1,!0,1,a),g=i.extractCommon(w,n,o,S,a),w.oldPos+1>=d&&g+1>=c)return r(Ye(i,w.lastComponent,n,o,i.useLongestToken));b[S]=w,w.oldPos+1>=d&&(x=Math.min(x,S-1)),g+1>=c&&(V=Math.max(V,S+1))}u++}if(s)(function S(){setTimeout(function(){if(u>f||Date.now()>h)return s();C()||S()},0)})();else for(;u<=f&&Date.now()<=h;){var _=C();if(_)return _}},addToPath:function(o,n,l,a,s){var i=o.lastComponent;return i&&!s.oneChangePerToken&&i.added===n&&i.removed===l?{oldPos:o.oldPos+a,lastComponent:{count:i.count+1,added:n,removed:l,previousComponent:i.previousComponent}}:{oldPos:o.oldPos+a,lastComponent:{count:1,added:n,removed:l,previousComponent:i}}},extractCommon:function(o,n,l,a,s){for(var i=n.length,r=l.length,c=o.oldPos,d=c-a,u=0;d+1<i&&c+1<r&&this.equals(l[c+1],n[d+1],s);)d++,c++,u++,s.oneChangePerToken&&(o.lastComponent={count:1,previousComponent:o.lastComponent,added:!1,removed:!1});return u&&!s.oneChangePerToken&&(o.lastComponent={count:u,previousComponent:o.lastComponent,added:!1,removed:!1}),o.oldPos=c,d},equals:function(o,n,l){return l.comparator?l.comparator(o,n):o===n||l.ignoreCase&&o.toLowerCase()===n.toLowerCase()},removeEmpty:function(o){for(var n=[],l=0;l<o.length;l++)o[l]&&n.push(o[l]);return n},castInput:function(o){return o},tokenize:function(o){return Array.from(o)},join:function(o){return o.join("")},postProcess:function(o){return o}};function Ye(e,o,n,l,a){for(var s=[],i;o;)s.push(o),i=o.previousComponent,delete o.previousComponent,o=i;s.reverse();for(var r=0,c=s.length,d=0,u=0;r<c;r++){var f=s[r];if(f.removed)f.value=e.join(l.slice(u,u+f.count)),u+=f.count;else{if(!f.added&&a){var v=n.slice(d,d+f.count);v=v.map(function(h,b){var g=l[u+b];return g.length>h.length?g:h}),f.value=e.join(v)}else f.value=e.join(n.slice(d,d+f.count));d+=f.count,f.added||(u+=f.count)}}return s}function Qe(e,o){var n;for(n=0;n<e.length&&n<o.length;n++)if(e[n]!=o[n])return e.slice(0,n);return e.slice(0,n)}function Xe(e,o){var n;if(!e||!o||e[e.length-1]!=o[o.length-1])return"";for(n=0;n<e.length&&n<o.length;n++)if(e[e.length-(n+1)]!=o[o.length-(n+1)])return e.slice(-n);return e.slice(-n)}function J2(e,o,n){if(e.slice(0,o.length)!=o)throw Error("string ".concat(JSON.stringify(e)," doesn't start with prefix ").concat(JSON.stringify(o),"; this is a bug"));return n+e.slice(o.length)}function Y2(e,o,n){if(!o)return e+n;if(e.slice(-o.length)!=o)throw Error("string ".concat(JSON.stringify(e)," doesn't end with suffix ").concat(JSON.stringify(o),"; this is a bug"));return e.slice(0,-o.length)+n}function g2(e,o){return J2(e,o,"")}function $2(e,o){return Y2(e,o,"")}function Ke(e,o){return o.slice(0,So(e,o))}function So(e,o){var n=0;e.length>o.length&&(n=e.length-o.length);var l=o.length;e.length<o.length&&(l=e.length);var a=Array(l),s=0;a[0]=0;for(var i=1;i<l;i++){for(o[i]==o[s]?a[i]=a[s]:a[i]=s;s>0&&o[i]!=o[s];)s=a[s];o[i]==o[s]&&s++}s=0;for(var r=n;r<e.length;r++){for(;s>0&&e[r]!=o[s];)s=a[s];e[r]==o[s]&&s++}return s}var I2="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",Lo=new RegExp("[".concat(I2,"]+|\\s+|[^").concat(I2,"]"),"ug"),M2=new z;M2.equals=function(e,o,n){return n.ignoreCase&&(e=e.toLowerCase(),o=o.toLowerCase()),e.trim()===o.trim()},M2.tokenize=function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n;if(o.intlSegmenter){if(o.intlSegmenter.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');n=Array.from(o.intlSegmenter.segment(e),function(s){return s.segment})}else n=e.match(Lo)||[];var l=[],a=null;return n.forEach(function(s){/\s/.test(s)?a==null?l.push(s):l.push(l.pop()+s):/\s/.test(a)?l[l.length-1]==a?l.push(l.pop()+s):l.push(a+s):l.push(s),a=s}),l},M2.join=function(e){return e.map(function(o,n){return n==0?o:o.replace(/^\s+/,"")}).join("")},M2.postProcess=function(e,o){if(!e||o.oneChangePerToken)return e;var n=null,l=null,a=null;return e.forEach(function(s){s.added?l=s:s.removed?a=s:((l||a)&&e0(n,a,l,s),n=s,l=null,a=null)}),(l||a)&&e0(n,a,l,null),e};function e0(e,o,n,l){if(o&&n){var a=o.value.match(/^\s*/)[0],s=o.value.match(/\s*$/)[0],i=n.value.match(/^\s*/)[0],r=n.value.match(/\s*$/)[0];if(e){var c=Qe(a,i);e.value=Y2(e.value,i,c),o.value=g2(o.value,c),n.value=g2(n.value,c)}if(l){var d=Xe(s,r);l.value=J2(l.value,r,d),o.value=$2(o.value,d),n.value=$2(n.value,d)}}else if(n)e&&(n.value=n.value.replace(/^\s*/,"")),l&&(l.value=l.value.replace(/^\s*/,""));else if(e&&l){var u=l.value.match(/^\s*/)[0],f=o.value.match(/^\s*/)[0],v=o.value.match(/\s*$/)[0],h=Qe(u,f);o.value=g2(o.value,h);var b=Xe(g2(u,h),v);o.value=$2(o.value,b),l.value=J2(l.value,u,b),e.value=Y2(e.value,u,u.slice(0,u.length-b.length))}else if(l){var g=l.value.match(/^\s*/)[0],V=o.value.match(/\s*$/)[0],x=Ke(V,g);o.value=$2(o.value,x)}else if(e){var C=e.value.match(/\s*$/)[0],_=o.value.match(/^\s*/)[0],S=Ke(C,_);o.value=g2(o.value,S)}}var t0=new z;t0.tokenize=function(e){var o=new RegExp("(\\r?\\n)|[".concat(I2,"]+|[^\\S\\n\\r]+|[^").concat(I2,"]"),"ug");return e.match(o)||[]};function Vo(e,o,n){return t0.diff(e,o,n)}var Q2=new z;Q2.tokenize=function(e,o){o.stripTrailingCr&&(e=e.replace(/\r\n/g,`
19
19
  `));var n=[],l=e.split(/(\n|\r\n)/);l[l.length-1]||l.pop();for(var a=0;a<l.length;a++){var s=l[a];a%2&&!o.newlineIsToken?n[n.length-1]+=s:n.push(s)}return n},Q2.equals=function(e,o,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
20
20
  `))&&(e=e.trim()),(!n.newlineIsToken||!o.includes(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ddict/popup",
3
- "version": "1.4.6",
3
+ "version": "1.4.7",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"