@ddict/popup 1.3.1 → 1.3.3
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.es.js +518 -512
- package/dist/popup.umd.js +7 -7
- package/package.json +1 -1
package/dist/popup.umd.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
(function(G,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(G=typeof globalThis<"u"?globalThis:G||self,t(G.Popup={},G.Vue))})(this,function(G,t){"use strict";const It="data:image/svg+xml,%3csvg%20width='96'%20height='32'%20viewBox='0%200%2096%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M40.151%208.94498H35.7256V23.055H40.151C44.7473%2023.055%2047.826%2020.0825%2047.826%2015.9795C47.8267%2011.8093%2044.7678%208.94498%2040.151%208.94498ZM40.1312%2021.025H37.993V10.9974H40.1312C43.4217%2010.9974%2045.4972%2012.9846%2045.4972%2015.9795C45.4965%2018.9296%2043.4012%2021.025%2040.1312%2021.025Z'%20fill='%233B5695'/%3e%3cpath%20d='M54.5158%208.94498H50.0903V23.055H54.5158C59.1121%2023.055%2062.1908%2020.0825%2062.1908%2015.9795C62.1914%2011.8093%2059.1351%208.94498%2054.5158%208.94498ZM54.496%2021.025H52.3578V10.9974H54.496C57.789%2010.9974%2059.8619%2012.9846%2059.8619%2015.9795C59.8613%2018.9296%2057.766%2021.025%2054.496%2021.025Z'%20fill='%233B5695'/%3e%3cpath%20d='M66.7237%208.94498H64.4575V23.055H66.7237V8.94498Z'%20fill='%233B5695'/%3e%3cpath%20d='M76.4301%2010.7837C78.29%2010.7837%2079.7436%2011.6603%2080.7487%2013.2207L82.4589%2011.9591C81.2401%209.97057%2078.9957%208.70953%2076.409%208.70953C72.3898%208.64555%2068.9048%2011.9591%2068.9906%2016C68.9048%2020.0403%2072.3898%2023.3544%2076.409%2023.2905C79.0385%2023.2905%2081.2618%2022.0294%2082.4589%2020.0409L80.7487%2018.7793C79.7436%2020.3397%2078.29%2021.2163%2076.4301%2021.2163C73.544%2021.2163%2071.3418%2018.993%2071.3418%2016C71.3418%2013.007%2073.5433%2010.7837%2076.4301%2010.7837Z'%20fill='%233B5695'/%3e%3cpath%20d='M83.3135%208.94498V10.9757H88.0595V23.055H90.3256V10.9757H95.0934V8.94498H83.3135Z'%20fill='%233B5695'/%3e%3cpath%20d='M8.66351%204.7121H4.604V15.4427L6.87208%2013.3839V6.79143H8.64559C11.4639%206.79143%2013.2835%208.47857%2013.2835%2011.0877C13.2835%2013.6916%2011.421%2015.4427%208.64559%2015.4427H4.604V17.5016H8.66351C12.7531%2017.5016%2015.6098%2014.8644%2015.6098%2011.0877C15.6104%207.27575%2012.8196%204.7121%208.66351%204.7121Z'%20fill='%233B5695'/%3e%3cpath%20d='M26.2425%209.25528H21.5502L20.7537%2014.293L21.4523%2014.3308L21.4069%2014.7294C21.3916%2014.8656%2021.3289%2015.0448%2021.112%2015.1734C21.1017%2015.9399%2021.0845%2017.0493%2020.9706%2018.1766H26.5937V19.8586H21.4677C22.4133%2022.9424%2024.1254%2024.9648%2026.5611%2025.8669L27.1536%2026.0864L26.6795%2026.5048C26.4875%2026.6737%2026.2182%2027.0141%2026.0896%2027.2489L25.9258%2027.5438L25.6155%2027.4152C23.167%2026.4095%2021.4223%2024.4926%2020.2905%2021.563C19.3602%2024.3365%2017.5797%2026.2553%2014.8592%2027.428L14.5438%2027.5617L14.3775%2027.2642C14.2764%2027.08%2014.0294%2026.7876%2013.8151%2026.5989L13.3564%2026.1951L13.9239%2025.9655C16.4555%2024.9392%2018.064%2023.1414%2018.8228%2020.4837C19.6647%2019.8381%2020.2099%2018.8221%2020.2169%2017.6801V4.53231C20.2169%202.58349%2018.6334%201%2016.6846%201H3.53487C1.58349%201%200%202.58349%200%204.53231V17.6795C0%2019.6283%201.58349%2021.2143%203.53487%2021.2143H8.25528V27.2431C8.25528%2029.3135%209.93986%2031%2012.0096%2031H26.2431C28.3161%2031%2029.9974%2029.3129%2029.9974%2027.2431V13.0096C29.9974%2010.9392%2028.3154%209.25528%2026.2425%209.25528ZM3.53487%2019.4517C2.55662%2019.4517%201.762%2018.6603%201.762%2017.6788V4.53231C1.762%203.55662%202.55598%202.762%203.53487%202.762H16.6839C17.6571%202.762%2018.4517%203.55598%2018.4517%204.53231V17.6795C18.4517%2017.778%2018.444%2017.8733%2018.4267%2017.9667C18.3941%2018.1811%2018.3231%2018.38%2018.215%2018.5592C17.9149%2019.0934%2017.3372%2019.4517%2016.6846%2019.4517H3.53487Z'%20fill='%233B5695'/%3e%3c/svg%3e",Bt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='%233B5695'%20class='bi%20bi-list-stars%20fill-primaryColor'%3e%3cpath%20fill-rule='evenodd'%20d='M5%2011.5a.5.5%200%200%201%20.5-.5h9a.5.5%200%200%201%200%201h-9a.5.5%200%200%201-.5-.5zm0-4a.5.5%200%200%201%20.5-.5h9a.5.5%200%200%201%200%201h-9a.5.5%200%200%201-.5-.5zm0-4a.5.5%200%200%201%20.5-.5h9a.5.5%200%200%201%200%201h-9a.5.5%200%200%201-.5-.5z'/%3e%3cpath%20d='M2.242%202.194a.27.27%200%200%201%20.516%200l.162.53c.035.115.14.194.258.194h.551c.259%200%20.37.333.164.493l-.468.363a.277.277%200%200%200-.094.3l.173.569c.078.256-.213.462-.423.3l-.417-.324a.267.267%200%200%200-.328%200l-.417.323c-.21.163-.5-.043-.423-.299l.173-.57a.277.277%200%200%200-.094-.299l-.468-.363c-.206-.16-.095-.493.164-.493h.55a.271.271%200%200%200%20.259-.194l.162-.53zm0%204a.27.27%200%200%201%20.516%200l.162.53c.035.115.14.194.258.194h.551c.259%200%20.37.333.164.493l-.468.363a.277.277%200%200%200-.094.3l.173.569c.078.255-.213.462-.423.3l-.417-.324a.267.267%200%200%200-.328%200l-.417.323c-.21.163-.5-.043-.423-.299l.173-.57a.277.277%200%200%200-.094-.299l-.468-.363c-.206-.16-.095-.493.164-.493h.55a.271.271%200%200%200%20.259-.194l.162-.53zm0%204a.27.27%200%200%201%20.516%200l.162.53c.035.115.14.194.258.194h.551c.259%200%20.37.333.164.493l-.468.363a.277.277%200%200%200-.094.3l.173.569c.078.255-.213.462-.423.3l-.417-.324a.267.267%200%200%200-.328%200l-.417.323c-.21.163-.5-.043-.423-.299l.173-.57a.277.277%200%200%200-.094-.299l-.468-.363c-.206-.16-.095-.493.164-.493h.55a.271.271%200%200%200%20.259-.194l.162-.53z'/%3e%3c/svg%3e",Lt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.5%203.25C5.25736%203.25%204.25%204.25736%204.25%205.5H3.5H2.75C2.75%203.42893%204.42893%201.75%206.5%201.75H17.5C17.9142%201.75%2018.25%202.08579%2018.25%202.5V15.5C18.25%2015.9142%2017.9142%2016.25%2017.5%2016.25H6.5C5.26293%2016.25%204.25%2017.2576%204.25%2018.5C4.25%2018.9142%203.91421%2019.25%203.5%2019.25C3.08579%2019.25%202.75%2018.9142%202.75%2018.5V5.5C2.75%205.49993%202.75%205.5%203.5%205.5C4.25%205.5%204.25%205.49993%204.25%205.5V15.5017C4.87779%2015.0296%205.65755%2014.75%206.5%2014.75H16.75V3.25H6.5Z'%20fill='%233B5695'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M20.5%202.75C20.9142%202.75%2021.25%203.08579%2021.25%203.5V21.5C21.25%2021.9142%2020.9142%2022.25%2020.5%2022.25H6.5C4.42893%2022.25%202.75%2020.5711%202.75%2018.5C2.75%2016.4289%204.42893%2014.75%206.5%2014.75H17.4995C17.4996%2014.75%2017.5%2014.75%2017.5%2015.5C17.5%2016.25%2017.5001%2016.25%2017.5%2016.25H6.5C5.25736%2016.25%204.25%2017.2574%204.25%2018.5C4.25%2019.7426%205.25736%2020.75%206.5%2020.75H19.75V3.5C19.75%203.08579%2020.0858%202.75%2020.5%202.75ZM18.25%2015.5C18.25%2015.9142%2017.9142%2016.25%2017.5%2016.25V15.5L17.4995%2014.75C17.9137%2014.75%2018.25%2015.0858%2018.25%2015.5Z'%20fill='%233B5695'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.25%2018.5C6.25%2018.0858%206.58579%2017.75%207%2017.75H17C17.4142%2017.75%2017.75%2018.0858%2017.75%2018.5C17.75%2018.9142%2017.4142%2019.25%2017%2019.25H7C6.58579%2019.25%206.25%2018.9142%206.25%2018.5Z'%20fill='%233B5695'/%3e%3c/svg%3e",Nt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.467%202.47236C2.75841%202.17799%203.23328%202.17559%203.52764%202.467L8.52765%207.41675C8.82201%207.70816%208.82441%208.18303%208.533%208.4774C8.24159%208.77176%207.76672%208.77416%207.47235%208.48275L2.47236%203.533C2.17799%203.24159%202.17559%202.76672%202.467%202.47236Z'%20fill='%233B5695'/%3e%3cpath%20d='M8.533%2015.4724C8.82441%2015.7667%208.82201%2016.2416%208.52765%2016.533L3.52765%2021.4828C3.23328%2021.7742%202.75841%2021.7718%202.467%2021.4774C2.17559%2021.183%202.17799%2020.7082%202.47236%2020.4167L7.47235%2015.467C7.76672%2015.1756%208.24159%2015.178%208.533%2015.4724Z'%20fill='%233B5695'/%3e%3cpath%20d='M15.52%2015.4697C15.8129%2015.1768%2016.2877%2015.1768%2016.5806%2015.4697L21.5304%2020.4194C21.8233%2020.7123%2021.8233%2021.1872%2021.5304%2021.4801C21.2375%2021.773%2020.7626%2021.773%2020.4697%2021.4801L15.52%2016.5303C15.2271%2016.2374%2015.2271%2015.7626%2015.52%2015.4697Z'%20fill='%233B5695'/%3e%3cpath%20d='M21.4801%202.46967C21.773%202.76256%2021.773%203.23744%2021.4801%203.53033L16.5303%208.48008C16.2374%208.77297%2015.7626%208.77297%2015.4697%208.48008C15.1768%208.18719%2015.1768%207.71231%2015.4697%207.41942L20.4194%202.46967C20.7123%202.17678%2021.1872%202.17678%2021.4801%202.46967Z'%20fill='%233B5695'/%3e%3cpath%20d='M15.75%203C15.75%202.58579%2016.0858%202.25%2016.5%202.25H21C21.4142%202.25%2021.75%202.58579%2021.75%203V7.5C21.75%207.91421%2021.4142%208.25%2021%208.25C20.5858%208.25%2020.25%207.91421%2020.25%207.5V3.75H16.5C16.0858%203.75%2015.75%203.41421%2015.75%203Z'%20fill='%233B5695'/%3e%3cpath%20d='M21%2015.75C21.4142%2015.75%2021.75%2016.0858%2021.75%2016.5V21C21.75%2021.4142%2021.4142%2021.75%2021%2021.75H16.5C16.0858%2021.75%2015.75%2021.4142%2015.75%2021C15.75%2020.5858%2016.0858%2020.25%2016.5%2020.25H20.25V16.5C20.25%2016.0858%2020.5858%2015.75%2021%2015.75Z'%20fill='%233B5695'/%3e%3cpath%20d='M3%2015.75C3.41421%2015.75%203.75%2016.0858%203.75%2016.5V20.25H7.5C7.91421%2020.25%208.25%2020.5858%208.25%2021C8.25%2021.4142%207.91421%2021.75%207.5%2021.75H3C2.58579%2021.75%202.25%2021.4142%202.25%2021V16.5C2.25%2016.0858%202.58579%2015.75%203%2015.75Z'%20fill='%233B5695'/%3e%3cpath%20d='M2.25%203C2.25%202.58579%202.58579%202.25%203%202.25H7.5C7.91421%202.25%208.25%202.58579%208.25%203C8.25%203.41421%207.91421%203.75%207.5%203.75H3.75V7.5C3.75%207.91421%203.41421%208.25%203%208.25C2.58579%208.25%202.25%207.91421%202.25%207.5V3Z'%20fill='%233B5695'/%3e%3c/svg%3e",Mt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.12596%201.63869C9.46935%201.54364%209.83221%201.70329%209.99413%202.02068C10.3672%202.75191%2011.1261%203.25%2012%203.25C12.8739%203.25%2013.6328%202.75191%2014.0059%202.02068C14.1678%201.70329%2014.5307%201.54364%2014.874%201.63869C16.5585%202.10497%2018.0759%202.9704%2019.3184%204.12574C19.5611%204.35137%2019.6269%204.70948%2019.4804%205.00666C19.3331%205.30535%2019.25%205.6419%2019.25%206C19.25%207.24263%2020.2574%208.25%2021.5%208.25L21.5314%208.24977C21.8629%208.24504%2022.1583%208.45859%2022.2576%208.77495C22.5777%209.79397%2022.75%2010.8776%2022.75%2012C22.75%2012.7408%2022.6749%2013.4649%2022.5318%2014.1648C22.4548%2014.5411%2022.1059%2014.7985%2021.7237%2014.7609C21.6504%2014.7537%2021.5758%2014.75%2021.5%2014.75C20.2574%2014.75%2019.25%2015.7574%2019.25%2017C19.25%2017.5531%2019.4486%2018.0579%2019.7793%2018.4498C20.027%2018.7434%2020.0128%2019.1767%2019.7465%2019.4535C18.4777%2020.7719%2016.8745%2021.7678%2015.0721%2022.3044C14.6807%2022.4209%2014.2681%2022.2029%2014.1437%2021.814C13.8535%2020.906%2013.0024%2020.25%2012%2020.25C10.9976%2020.25%2010.1465%2020.906%209.85629%2021.814C9.73195%2022.2029%209.31927%2022.4209%208.92789%2022.3044C7.12545%2021.7678%205.52229%2020.7719%204.25353%2019.4535C3.98716%2019.1767%203.97299%2018.7434%204.22072%2018.4498C4.55139%2018.0579%204.75%2017.5531%204.75%2017C4.75%2015.7574%203.74264%2014.75%202.5%2014.75C2.42423%2014.75%202.34963%2014.7537%202.27634%2014.7609C1.89406%2014.7985%201.54519%2014.5411%201.46821%2014.1648C1.32505%2013.4649%201.25%2012.7408%201.25%2012C1.25%2010.8776%201.42227%209.79398%201.74236%208.77494C1.84173%208.45859%202.13705%208.24504%202.4686%208.24977L2.5%208.25C3.74264%208.25%204.75%207.24263%204.75%206C4.75%205.6419%204.66689%205.30535%204.51962%205.00666C4.3731%204.70948%204.43894%204.35137%204.68159%204.12574C5.92411%202.9704%207.44153%202.10497%209.12596%201.63869ZM6.08277%204.88991C6.19152%205.24123%206.25%205.61424%206.25%206C6.25%207.88945%204.85261%209.45253%203.03493%209.71213C2.84898%2010.4432%202.75%2011.2096%202.75%2012C2.75%2012.4294%202.77921%2012.8516%202.83567%2013.2648C4.74948%2013.4346%206.25%2015.0421%206.25%2017C6.25%2017.6669%206.0754%2018.2941%205.76971%2018.8372C6.62645%2019.6184%207.63002%2020.2404%208.73362%2020.657C9.37706%2019.5189%2010.598%2018.75%2012%2018.75C13.402%2018.75%2014.6229%2019.5189%2015.2664%2020.657C16.37%2020.2404%2017.3735%2019.6184%2018.2303%2018.8372C17.9246%2018.2941%2017.75%2017.6669%2017.75%2017C17.75%2015.0421%2019.2505%2013.4346%2021.1643%2013.2648C21.2208%2012.8516%2021.25%2012.4294%2021.25%2012C21.25%2011.2096%2021.151%2010.4432%2020.9651%209.71213C19.1474%209.45252%2017.75%207.88945%2017.75%206C17.75%205.61424%2017.8085%205.24123%2017.9172%204.88991C17.0618%204.1771%2016.0762%203.61614%2015.0018%203.24775C14.3184%204.15897%2013.2287%204.75%2012%204.75C10.7713%204.75%209.68158%204.15897%208.99819%203.24775C7.92382%203.61614%206.93823%204.1771%206.08277%204.88991Z'%20fill='%233B5695'/%3e%3cpath%20d='M7.75%2012C7.75%209.65278%209.65279%207.75%2012%207.75C14.3472%207.75%2016.25%209.65278%2016.25%2012C16.25%2014.3472%2014.3472%2016.25%2012%2016.25C9.65279%2016.25%207.75%2014.3472%207.75%2012ZM12%209.25C10.4812%209.25%209.25%2010.4812%209.25%2012C9.25%2013.5188%2010.4812%2014.75%2012%2014.75C13.5188%2014.75%2014.75%2013.5188%2014.75%2012C14.75%2010.4812%2013.5188%209.25%2012%209.25Z'%20fill='%233B5695'/%3e%3c/svg%3e",Rt={class:"flex justify-between"},Ft=t.createElementVNode("div",{class:"flex flex-row"},[t.createElementVNode("img",{src:It,alt:"Vue logo",class:"w-24"})],-1),At={class:"flex"},Pt={class:"tooltip tooltip-bottom 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%]","data-tip":"Saved Words"},Dt=[t.createElementVNode("img",{src:Bt,alt:"Star list",class:"w-7"},null,-1)],jt={class:"tooltip tooltip-bottom 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%]","data-tip":"Reader"},Ht=[t.createElementVNode("img",{src:Lt,alt:"Reader",class:"w-7"},null,-1)],zt={class:"tooltip tooltip-bottom 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%] md:hidden","data-tip":"Full screen"},Ut=[t.createElementVNode("img",{src:Nt,alt:"Full screen",class:"w-7"},null,-1)],Zt={class:"tooltip tooltip-bottom 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%]","data-tip":"Settings"},Wt=[t.createElementVNode("img",{src:Mt,alt:"Setting",class:"w-7"},null,-1)],Gt={__name:"Header",emits:["settings","fullScreen","reader","starList"],setup(e,{emit:l}){const n=l;return(o,a)=>(t.openBlock(),t.createElementBlock("div",Rt,[Ft,t.createElementVNode("div",At,[t.createElementVNode("div",Pt,[t.createElementVNode("button",{class:"btn btn-ghost btn-circle",onClick:a[0]||(a[0]=r=>n("starList"))},Dt)]),t.createElementVNode("div",jt,[t.createElementVNode("button",{class:"btn btn-ghost btn-circle",onClick:a[1]||(a[1]=r=>n("reader"))},Ht)]),t.createElementVNode("div",zt,[t.createElementVNode("button",{class:"btn btn-ghost btn-circle",onClick:a[2]||(a[2]=r=>n("fullScreen"))},Ut)]),t.createElementVNode("div",Zt,[t.createElementVNode("button",{class:"btn btn-ghost btn-circle",onClick:a[3]||(a[3]=r=>n("settings"))},Wt)])])]))}},ue={isRTL:qt,setLocalStorage:Jt,getLocalStorage:Kt};function qt(e){return["ar","fa","iw","yi","ur","pa"].indexOf(e)>-1}function Jt(e,l){localStorage.setItem(e,JSON.stringify(l))}function Kt(e){return JSON.parse(localStorage.getItem(e))}function oe(e,l,n){let o=n.initialDeps??[],a;return()=>{var r,i,s,c;let d;n.key&&((r=n.debug)!=null&&r.call(n))&&(d=Date.now());const u=e();if(!(u.length!==o.length||u.some((y,g)=>o[g]!==y)))return a;o=u;let b;if(n.key&&((i=n.debug)!=null&&i.call(n))&&(b=Date.now()),a=l(...u),n.key&&((s=n.debug)!=null&&s.call(n))){const y=Math.round((Date.now()-d)*100)/100,g=Math.round((Date.now()-b)*100)/100,w=g/16,I=(_,x)=>{for(_=String(_);_.length<x;)_=" "+_;return _};console.info(`%c⏱ ${I(g,5)} /${I(y,5)} ms`,`
|
|
1
|
+
(function(G,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(G=typeof globalThis<"u"?globalThis:G||self,t(G.Popup={},G.Vue))})(this,function(G,t){"use strict";const Bt="data:image/svg+xml,%3csvg%20width='96'%20height='32'%20viewBox='0%200%2096%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M40.151%208.94498H35.7256V23.055H40.151C44.7473%2023.055%2047.826%2020.0825%2047.826%2015.9795C47.8267%2011.8093%2044.7678%208.94498%2040.151%208.94498ZM40.1312%2021.025H37.993V10.9974H40.1312C43.4217%2010.9974%2045.4972%2012.9846%2045.4972%2015.9795C45.4965%2018.9296%2043.4012%2021.025%2040.1312%2021.025Z'%20fill='%233B5695'/%3e%3cpath%20d='M54.5158%208.94498H50.0903V23.055H54.5158C59.1121%2023.055%2062.1908%2020.0825%2062.1908%2015.9795C62.1914%2011.8093%2059.1351%208.94498%2054.5158%208.94498ZM54.496%2021.025H52.3578V10.9974H54.496C57.789%2010.9974%2059.8619%2012.9846%2059.8619%2015.9795C59.8613%2018.9296%2057.766%2021.025%2054.496%2021.025Z'%20fill='%233B5695'/%3e%3cpath%20d='M66.7237%208.94498H64.4575V23.055H66.7237V8.94498Z'%20fill='%233B5695'/%3e%3cpath%20d='M76.4301%2010.7837C78.29%2010.7837%2079.7436%2011.6603%2080.7487%2013.2207L82.4589%2011.9591C81.2401%209.97057%2078.9957%208.70953%2076.409%208.70953C72.3898%208.64555%2068.9048%2011.9591%2068.9906%2016C68.9048%2020.0403%2072.3898%2023.3544%2076.409%2023.2905C79.0385%2023.2905%2081.2618%2022.0294%2082.4589%2020.0409L80.7487%2018.7793C79.7436%2020.3397%2078.29%2021.2163%2076.4301%2021.2163C73.544%2021.2163%2071.3418%2018.993%2071.3418%2016C71.3418%2013.007%2073.5433%2010.7837%2076.4301%2010.7837Z'%20fill='%233B5695'/%3e%3cpath%20d='M83.3135%208.94498V10.9757H88.0595V23.055H90.3256V10.9757H95.0934V8.94498H83.3135Z'%20fill='%233B5695'/%3e%3cpath%20d='M8.66351%204.7121H4.604V15.4427L6.87208%2013.3839V6.79143H8.64559C11.4639%206.79143%2013.2835%208.47857%2013.2835%2011.0877C13.2835%2013.6916%2011.421%2015.4427%208.64559%2015.4427H4.604V17.5016H8.66351C12.7531%2017.5016%2015.6098%2014.8644%2015.6098%2011.0877C15.6104%207.27575%2012.8196%204.7121%208.66351%204.7121Z'%20fill='%233B5695'/%3e%3cpath%20d='M26.2425%209.25528H21.5502L20.7537%2014.293L21.4523%2014.3308L21.4069%2014.7294C21.3916%2014.8656%2021.3289%2015.0448%2021.112%2015.1734C21.1017%2015.9399%2021.0845%2017.0493%2020.9706%2018.1766H26.5937V19.8586H21.4677C22.4133%2022.9424%2024.1254%2024.9648%2026.5611%2025.8669L27.1536%2026.0864L26.6795%2026.5048C26.4875%2026.6737%2026.2182%2027.0141%2026.0896%2027.2489L25.9258%2027.5438L25.6155%2027.4152C23.167%2026.4095%2021.4223%2024.4926%2020.2905%2021.563C19.3602%2024.3365%2017.5797%2026.2553%2014.8592%2027.428L14.5438%2027.5617L14.3775%2027.2642C14.2764%2027.08%2014.0294%2026.7876%2013.8151%2026.5989L13.3564%2026.1951L13.9239%2025.9655C16.4555%2024.9392%2018.064%2023.1414%2018.8228%2020.4837C19.6647%2019.8381%2020.2099%2018.8221%2020.2169%2017.6801V4.53231C20.2169%202.58349%2018.6334%201%2016.6846%201H3.53487C1.58349%201%200%202.58349%200%204.53231V17.6795C0%2019.6283%201.58349%2021.2143%203.53487%2021.2143H8.25528V27.2431C8.25528%2029.3135%209.93986%2031%2012.0096%2031H26.2431C28.3161%2031%2029.9974%2029.3129%2029.9974%2027.2431V13.0096C29.9974%2010.9392%2028.3154%209.25528%2026.2425%209.25528ZM3.53487%2019.4517C2.55662%2019.4517%201.762%2018.6603%201.762%2017.6788V4.53231C1.762%203.55662%202.55598%202.762%203.53487%202.762H16.6839C17.6571%202.762%2018.4517%203.55598%2018.4517%204.53231V17.6795C18.4517%2017.778%2018.444%2017.8733%2018.4267%2017.9667C18.3941%2018.1811%2018.3231%2018.38%2018.215%2018.5592C17.9149%2019.0934%2017.3372%2019.4517%2016.6846%2019.4517H3.53487Z'%20fill='%233B5695'/%3e%3c/svg%3e",Lt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='%233B5695'%20class='bi%20bi-list-stars%20fill-primaryColor'%3e%3cpath%20fill-rule='evenodd'%20d='M5%2011.5a.5.5%200%200%201%20.5-.5h9a.5.5%200%200%201%200%201h-9a.5.5%200%200%201-.5-.5zm0-4a.5.5%200%200%201%20.5-.5h9a.5.5%200%200%201%200%201h-9a.5.5%200%200%201-.5-.5zm0-4a.5.5%200%200%201%20.5-.5h9a.5.5%200%200%201%200%201h-9a.5.5%200%200%201-.5-.5z'/%3e%3cpath%20d='M2.242%202.194a.27.27%200%200%201%20.516%200l.162.53c.035.115.14.194.258.194h.551c.259%200%20.37.333.164.493l-.468.363a.277.277%200%200%200-.094.3l.173.569c.078.256-.213.462-.423.3l-.417-.324a.267.267%200%200%200-.328%200l-.417.323c-.21.163-.5-.043-.423-.299l.173-.57a.277.277%200%200%200-.094-.299l-.468-.363c-.206-.16-.095-.493.164-.493h.55a.271.271%200%200%200%20.259-.194l.162-.53zm0%204a.27.27%200%200%201%20.516%200l.162.53c.035.115.14.194.258.194h.551c.259%200%20.37.333.164.493l-.468.363a.277.277%200%200%200-.094.3l.173.569c.078.255-.213.462-.423.3l-.417-.324a.267.267%200%200%200-.328%200l-.417.323c-.21.163-.5-.043-.423-.299l.173-.57a.277.277%200%200%200-.094-.299l-.468-.363c-.206-.16-.095-.493.164-.493h.55a.271.271%200%200%200%20.259-.194l.162-.53zm0%204a.27.27%200%200%201%20.516%200l.162.53c.035.115.14.194.258.194h.551c.259%200%20.37.333.164.493l-.468.363a.277.277%200%200%200-.094.3l.173.569c.078.255-.213.462-.423.3l-.417-.324a.267.267%200%200%200-.328%200l-.417.323c-.21.163-.5-.043-.423-.299l.173-.57a.277.277%200%200%200-.094-.299l-.468-.363c-.206-.16-.095-.493.164-.493h.55a.271.271%200%200%200%20.259-.194l.162-.53z'/%3e%3c/svg%3e",Nt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.5%203.25C5.25736%203.25%204.25%204.25736%204.25%205.5H3.5H2.75C2.75%203.42893%204.42893%201.75%206.5%201.75H17.5C17.9142%201.75%2018.25%202.08579%2018.25%202.5V15.5C18.25%2015.9142%2017.9142%2016.25%2017.5%2016.25H6.5C5.26293%2016.25%204.25%2017.2576%204.25%2018.5C4.25%2018.9142%203.91421%2019.25%203.5%2019.25C3.08579%2019.25%202.75%2018.9142%202.75%2018.5V5.5C2.75%205.49993%202.75%205.5%203.5%205.5C4.25%205.5%204.25%205.49993%204.25%205.5V15.5017C4.87779%2015.0296%205.65755%2014.75%206.5%2014.75H16.75V3.25H6.5Z'%20fill='%233B5695'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M20.5%202.75C20.9142%202.75%2021.25%203.08579%2021.25%203.5V21.5C21.25%2021.9142%2020.9142%2022.25%2020.5%2022.25H6.5C4.42893%2022.25%202.75%2020.5711%202.75%2018.5C2.75%2016.4289%204.42893%2014.75%206.5%2014.75H17.4995C17.4996%2014.75%2017.5%2014.75%2017.5%2015.5C17.5%2016.25%2017.5001%2016.25%2017.5%2016.25H6.5C5.25736%2016.25%204.25%2017.2574%204.25%2018.5C4.25%2019.7426%205.25736%2020.75%206.5%2020.75H19.75V3.5C19.75%203.08579%2020.0858%202.75%2020.5%202.75ZM18.25%2015.5C18.25%2015.9142%2017.9142%2016.25%2017.5%2016.25V15.5L17.4995%2014.75C17.9137%2014.75%2018.25%2015.0858%2018.25%2015.5Z'%20fill='%233B5695'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.25%2018.5C6.25%2018.0858%206.58579%2017.75%207%2017.75H17C17.4142%2017.75%2017.75%2018.0858%2017.75%2018.5C17.75%2018.9142%2017.4142%2019.25%2017%2019.25H7C6.58579%2019.25%206.25%2018.9142%206.25%2018.5Z'%20fill='%233B5695'/%3e%3c/svg%3e",Mt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.467%202.47236C2.75841%202.17799%203.23328%202.17559%203.52764%202.467L8.52765%207.41675C8.82201%207.70816%208.82441%208.18303%208.533%208.4774C8.24159%208.77176%207.76672%208.77416%207.47235%208.48275L2.47236%203.533C2.17799%203.24159%202.17559%202.76672%202.467%202.47236Z'%20fill='%233B5695'/%3e%3cpath%20d='M8.533%2015.4724C8.82441%2015.7667%208.82201%2016.2416%208.52765%2016.533L3.52765%2021.4828C3.23328%2021.7742%202.75841%2021.7718%202.467%2021.4774C2.17559%2021.183%202.17799%2020.7082%202.47236%2020.4167L7.47235%2015.467C7.76672%2015.1756%208.24159%2015.178%208.533%2015.4724Z'%20fill='%233B5695'/%3e%3cpath%20d='M15.52%2015.4697C15.8129%2015.1768%2016.2877%2015.1768%2016.5806%2015.4697L21.5304%2020.4194C21.8233%2020.7123%2021.8233%2021.1872%2021.5304%2021.4801C21.2375%2021.773%2020.7626%2021.773%2020.4697%2021.4801L15.52%2016.5303C15.2271%2016.2374%2015.2271%2015.7626%2015.52%2015.4697Z'%20fill='%233B5695'/%3e%3cpath%20d='M21.4801%202.46967C21.773%202.76256%2021.773%203.23744%2021.4801%203.53033L16.5303%208.48008C16.2374%208.77297%2015.7626%208.77297%2015.4697%208.48008C15.1768%208.18719%2015.1768%207.71231%2015.4697%207.41942L20.4194%202.46967C20.7123%202.17678%2021.1872%202.17678%2021.4801%202.46967Z'%20fill='%233B5695'/%3e%3cpath%20d='M15.75%203C15.75%202.58579%2016.0858%202.25%2016.5%202.25H21C21.4142%202.25%2021.75%202.58579%2021.75%203V7.5C21.75%207.91421%2021.4142%208.25%2021%208.25C20.5858%208.25%2020.25%207.91421%2020.25%207.5V3.75H16.5C16.0858%203.75%2015.75%203.41421%2015.75%203Z'%20fill='%233B5695'/%3e%3cpath%20d='M21%2015.75C21.4142%2015.75%2021.75%2016.0858%2021.75%2016.5V21C21.75%2021.4142%2021.4142%2021.75%2021%2021.75H16.5C16.0858%2021.75%2015.75%2021.4142%2015.75%2021C15.75%2020.5858%2016.0858%2020.25%2016.5%2020.25H20.25V16.5C20.25%2016.0858%2020.5858%2015.75%2021%2015.75Z'%20fill='%233B5695'/%3e%3cpath%20d='M3%2015.75C3.41421%2015.75%203.75%2016.0858%203.75%2016.5V20.25H7.5C7.91421%2020.25%208.25%2020.5858%208.25%2021C8.25%2021.4142%207.91421%2021.75%207.5%2021.75H3C2.58579%2021.75%202.25%2021.4142%202.25%2021V16.5C2.25%2016.0858%202.58579%2015.75%203%2015.75Z'%20fill='%233B5695'/%3e%3cpath%20d='M2.25%203C2.25%202.58579%202.58579%202.25%203%202.25H7.5C7.91421%202.25%208.25%202.58579%208.25%203C8.25%203.41421%207.91421%203.75%207.5%203.75H3.75V7.5C3.75%207.91421%203.41421%208.25%203%208.25C2.58579%208.25%202.25%207.91421%202.25%207.5V3Z'%20fill='%233B5695'/%3e%3c/svg%3e",Rt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.12596%201.63869C9.46935%201.54364%209.83221%201.70329%209.99413%202.02068C10.3672%202.75191%2011.1261%203.25%2012%203.25C12.8739%203.25%2013.6328%202.75191%2014.0059%202.02068C14.1678%201.70329%2014.5307%201.54364%2014.874%201.63869C16.5585%202.10497%2018.0759%202.9704%2019.3184%204.12574C19.5611%204.35137%2019.6269%204.70948%2019.4804%205.00666C19.3331%205.30535%2019.25%205.6419%2019.25%206C19.25%207.24263%2020.2574%208.25%2021.5%208.25L21.5314%208.24977C21.8629%208.24504%2022.1583%208.45859%2022.2576%208.77495C22.5777%209.79397%2022.75%2010.8776%2022.75%2012C22.75%2012.7408%2022.6749%2013.4649%2022.5318%2014.1648C22.4548%2014.5411%2022.1059%2014.7985%2021.7237%2014.7609C21.6504%2014.7537%2021.5758%2014.75%2021.5%2014.75C20.2574%2014.75%2019.25%2015.7574%2019.25%2017C19.25%2017.5531%2019.4486%2018.0579%2019.7793%2018.4498C20.027%2018.7434%2020.0128%2019.1767%2019.7465%2019.4535C18.4777%2020.7719%2016.8745%2021.7678%2015.0721%2022.3044C14.6807%2022.4209%2014.2681%2022.2029%2014.1437%2021.814C13.8535%2020.906%2013.0024%2020.25%2012%2020.25C10.9976%2020.25%2010.1465%2020.906%209.85629%2021.814C9.73195%2022.2029%209.31927%2022.4209%208.92789%2022.3044C7.12545%2021.7678%205.52229%2020.7719%204.25353%2019.4535C3.98716%2019.1767%203.97299%2018.7434%204.22072%2018.4498C4.55139%2018.0579%204.75%2017.5531%204.75%2017C4.75%2015.7574%203.74264%2014.75%202.5%2014.75C2.42423%2014.75%202.34963%2014.7537%202.27634%2014.7609C1.89406%2014.7985%201.54519%2014.5411%201.46821%2014.1648C1.32505%2013.4649%201.25%2012.7408%201.25%2012C1.25%2010.8776%201.42227%209.79398%201.74236%208.77494C1.84173%208.45859%202.13705%208.24504%202.4686%208.24977L2.5%208.25C3.74264%208.25%204.75%207.24263%204.75%206C4.75%205.6419%204.66689%205.30535%204.51962%205.00666C4.3731%204.70948%204.43894%204.35137%204.68159%204.12574C5.92411%202.9704%207.44153%202.10497%209.12596%201.63869ZM6.08277%204.88991C6.19152%205.24123%206.25%205.61424%206.25%206C6.25%207.88945%204.85261%209.45253%203.03493%209.71213C2.84898%2010.4432%202.75%2011.2096%202.75%2012C2.75%2012.4294%202.77921%2012.8516%202.83567%2013.2648C4.74948%2013.4346%206.25%2015.0421%206.25%2017C6.25%2017.6669%206.0754%2018.2941%205.76971%2018.8372C6.62645%2019.6184%207.63002%2020.2404%208.73362%2020.657C9.37706%2019.5189%2010.598%2018.75%2012%2018.75C13.402%2018.75%2014.6229%2019.5189%2015.2664%2020.657C16.37%2020.2404%2017.3735%2019.6184%2018.2303%2018.8372C17.9246%2018.2941%2017.75%2017.6669%2017.75%2017C17.75%2015.0421%2019.2505%2013.4346%2021.1643%2013.2648C21.2208%2012.8516%2021.25%2012.4294%2021.25%2012C21.25%2011.2096%2021.151%2010.4432%2020.9651%209.71213C19.1474%209.45252%2017.75%207.88945%2017.75%206C17.75%205.61424%2017.8085%205.24123%2017.9172%204.88991C17.0618%204.1771%2016.0762%203.61614%2015.0018%203.24775C14.3184%204.15897%2013.2287%204.75%2012%204.75C10.7713%204.75%209.68158%204.15897%208.99819%203.24775C7.92382%203.61614%206.93823%204.1771%206.08277%204.88991Z'%20fill='%233B5695'/%3e%3cpath%20d='M7.75%2012C7.75%209.65278%209.65279%207.75%2012%207.75C14.3472%207.75%2016.25%209.65278%2016.25%2012C16.25%2014.3472%2014.3472%2016.25%2012%2016.25C9.65279%2016.25%207.75%2014.3472%207.75%2012ZM12%209.25C10.4812%209.25%209.25%2010.4812%209.25%2012C9.25%2013.5188%2010.4812%2014.75%2012%2014.75C13.5188%2014.75%2014.75%2013.5188%2014.75%2012C14.75%2010.4812%2013.5188%209.25%2012%209.25Z'%20fill='%233B5695'/%3e%3c/svg%3e",Ft={class:"flex justify-between"},At=t.createElementVNode("div",{class:"flex flex-row"},[t.createElementVNode("img",{src:Bt,alt:"Vue logo",class:"w-24"})],-1),Pt={class:"flex"},Dt={class:"tooltip tooltip-bottom 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%]","data-tip":"Saved Words"},jt=[t.createElementVNode("img",{src:Lt,alt:"Star list",class:"w-7"},null,-1)],Ht={class:"tooltip tooltip-bottom 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%]","data-tip":"Reader"},zt=[t.createElementVNode("img",{src:Nt,alt:"Reader",class:"w-7"},null,-1)],Ut={class:"tooltip tooltip-bottom 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%] md:hidden","data-tip":"Full screen"},Zt=[t.createElementVNode("img",{src:Mt,alt:"Full screen",class:"w-7"},null,-1)],Wt={class:"tooltip tooltip-bottom 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%]","data-tip":"Settings"},Gt=[t.createElementVNode("img",{src:Rt,alt:"Setting",class:"w-7"},null,-1)],qt={__name:"Header",emits:["settings","fullScreen","reader","starList"],setup(e,{emit:l}){const n=l;return(o,a)=>(t.openBlock(),t.createElementBlock("div",Ft,[At,t.createElementVNode("div",Pt,[t.createElementVNode("div",Dt,[t.createElementVNode("button",{class:"btn btn-ghost btn-circle",onClick:a[0]||(a[0]=r=>n("starList"))},jt)]),t.createElementVNode("div",Ht,[t.createElementVNode("button",{class:"btn btn-ghost btn-circle",onClick:a[1]||(a[1]=r=>n("reader"))},zt)]),t.createElementVNode("div",Ut,[t.createElementVNode("button",{class:"btn btn-ghost btn-circle",onClick:a[2]||(a[2]=r=>n("fullScreen"))},Zt)]),t.createElementVNode("div",Wt,[t.createElementVNode("button",{class:"btn btn-ghost btn-circle",onClick:a[3]||(a[3]=r=>n("settings"))},Gt)])])]))}},ue={isRTL:Jt,setLocalStorage:Kt,getLocalStorage:Yt};function Jt(e){return["ar","fa","iw","yi","ur","pa"].indexOf(e)>-1}function Kt(e,l){localStorage.setItem(e,JSON.stringify(l))}function Yt(e){return JSON.parse(localStorage.getItem(e))}function oe(e,l,n){let o=n.initialDeps??[],a;return()=>{var r,i,s,c;let d;n.key&&((r=n.debug)!=null&&r.call(n))&&(d=Date.now());const u=e();if(!(u.length!==o.length||u.some((y,g)=>o[g]!==y)))return a;o=u;let b;if(n.key&&((i=n.debug)!=null&&i.call(n))&&(b=Date.now()),a=l(...u),n.key&&((s=n.debug)!=null&&s.call(n))){const y=Math.round((Date.now()-d)*100)/100,g=Math.round((Date.now()-b)*100)/100,w=g/16,I=(_,x)=>{for(_=String(_);_.length<x;)_=" "+_;return _};console.info(`%c⏱ ${I(g,5)} /${I(y,5)} ms`,`
|
|
2
2
|
font-size: .6rem;
|
|
3
3
|
font-weight: bold;
|
|
4
|
-
color: hsl(${Math.max(0,Math.min(120-120*w,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(c=n==null?void 0:n.onChange)==null||c.call(n,a),a}}function ke(e,l){if(e===void 0)throw new Error("Unexpected undefined");return e}const Yt=(e,l)=>Math.abs(e-l)<1,Qt=(e,l,n)=>{let o;return function(...a){e.clearTimeout(o),o=e.setTimeout(()=>l.apply(this,a),n)}},Xt=e=>e,en=e=>{const l=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let a=l;a<=n;a++)o.push(a);return o},tn=(e,l)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;const a=i=>{const{width:s,height:c}=i;l({width:Math.round(s),height:Math.round(c)})};if(a(n.getBoundingClientRect()),!o.ResizeObserver)return()=>{};const r=new o.ResizeObserver(i=>{const s=i[0];if(s!=null&&s.borderBoxSize){const c=s.borderBoxSize[0];if(c){a({width:c.inlineSize,height:c.blockSize});return}}a(n.getBoundingClientRect())});return r.observe(n,{box:"border-box"}),()=>{r.unobserve(n)}},Fe={passive:!0},nn=typeof window>"u"?!0:"onscrollend"in window,on=(e,l)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;let a=0;const r=nn?()=>{}:Qt(o,()=>{l(a,!1)},e.options.isScrollingResetDelay),i=d=>()=>{a=n[e.options.horizontal?"scrollLeft":"scrollTop"],r(),l(a,d)},s=i(!0),c=i(!1);return c(),n.addEventListener("scroll",s,Fe),n.addEventListener("scrollend",c,Fe),()=>{n.removeEventListener("scroll",s),n.removeEventListener("scrollend",c)}},ln=(e,l,n)=>{if(l!=null&&l.borderBoxSize){const o=l.borderBoxSize[0];if(o)return Math.round(o[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},an=(e,{adjustments:l=0,behavior:n},o)=>{var a,r;const i=e+l;(r=(a=o.scrollElement)==null?void 0:a.scrollTo)==null||r.call(a,{[o.options.horizontal?"left":"top"]:i,behavior:n})};class sn{constructor(l){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const o=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(a=>{a.forEach(r=>{this._measureElement(r.target,r)})}));return{disconnect:()=>{var a;return(a=o())==null?void 0:a.disconnect()},observe:a=>{var r;return(r=o())==null?void 0:r.observe(a,{box:"border-box"})},unobserve:a=>{var r;return(r=o())==null?void 0:r.unobserve(a)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([o,a])=>{typeof a>"u"&&delete n[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Xt,rangeExtractor:en,onChange:()=>{},measureElement:ln,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,...n}},this.notify=(n,o)=>{var a,r;const{startIndex:i,endIndex:s}=this.range??{startIndex:void 0,endIndex:void 0},c=this.calculateRange();(n||i!==(c==null?void 0:c.startIndex)||s!==(c==null?void 0:c.endIndex))&&((r=(a=this.options).onChange)==null||r.call(a,this,o))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.observer.disconnect(),this.elementsCache.clear()},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.notify(!1,!1);return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(a,r)=>{this.scrollAdjustments=0,this.scrollDirection=r?this.getScrollOffset()<a?"forward":"backward":null,this.scrollOffset=a;const i=this.isScrolling;this.isScrolling=r,this.notify(i!==r,r)}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,o)=>{const a=new Map,r=new Map;for(let i=o-1;i>=0;i--){const s=n[i];if(a.has(s.lane))continue;const c=r.get(s.lane);if(c==null||s.end>c.end?r.set(s.lane,s):s.end<c.end&&a.set(s.lane,!0),a.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((i,s)=>i.end===s.end?i.index-s.index:i.end-s.end)[0]:void 0},this.getMeasurementOptions=oe(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,o,a,r,i)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:o,scrollMargin:a,getItemKey:r,enabled:i}),{key:!1}),this.getMeasurements=oe(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:o,scrollMargin:a,getItemKey:r,enabled:i},s)=>{var c;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(m=>{this.itemSizeCache.set(m.key,m.size)}));const d=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,d);for(let m=d;m<n;m++){let b=(c=this.measurementsCache[m])==null?void 0:c.measureElement;b||(b=B=>{const v=r(m),k=this.elementsCache.get(v);if(!B){k&&(this.observer.unobserve(k),this.elementsCache.delete(v));return}k!==B&&(k&&this.observer.unobserve(k),this.observer.observe(B),this.elementsCache.set(v,B)),B.isConnected&&this.resizeItem(m,this.options.measureElement(B,void 0,this))});const y=r(m),g=this.options.lanes===1?u[m-1]:this.getFurthestMeasurement(u,m),w=g?g.end+this.options.gap:o+a,I=s.get(y),_=typeof I=="number"?I:this.options.estimateSize(m),x=w+_,$=g?g.lane:m%this.options.lanes;u[m]={index:m,start:w,size:_,end:x,key:y,lane:$,measureElement:b}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=oe(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,o,a)=>this.range=n.length>0&&o>0?rn({measurements:n,outerSize:o,scrollOffset:a}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getIndexes=oe(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,o,a,r)=>o===null?[]:n({startIndex:o.startIndex,endIndex:o.endIndex,overscan:a,count:r}),{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const o=this.options.indexAttribute,a=n.getAttribute(o);return a?parseInt(a,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(n,o)=>{const a=this.indexFromElement(n),r=this.getMeasurements()[a];if(!r||!n.isConnected){this.elementsCache.forEach((s,c)=>{s===n&&(this.observer.unobserve(n),this.elementsCache.delete(c))});return}const i=this.elementsCache.get(r.key);i!==n&&(i&&this.observer.unobserve(i),this.observer.observe(n),this.elementsCache.set(r.key,n)),this.resizeItem(a,this.options.measureElement(n,o,this))},this.resizeItem=(n,o)=>{const a=this.getMeasurements()[n];if(!a)return;const r=this.itemSizeCache.get(a.key)??a.size,i=o-r;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(a,i,this):a.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(a.index),this.itemSizeCache=new Map(this.itemSizeCache.set(a.key,o)),this.notify(!0,!1))},this.measureElement=n=>{n&&this._measureElement(n,void 0)},this.getVirtualItems=oe(()=>[this.getIndexes(),this.getMeasurements()],(n,o)=>{const a=[];for(let r=0,i=n.length;r<i;r++){const s=n[r],c=o[s];a.push(c)}return a},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const o=this.getMeasurements();if(o.length!==0)return ke(o[Ae(0,o.length-1,a=>ke(o[a]).start,n)])},this.getOffsetForAlignment=(n,o)=>{const a=this.getSize(),r=this.getScrollOffset();o==="auto"&&(n<=r?o="start":n>=r+a?o="end":o="start"),o==="start"?n=n:o==="end"?n=n-a:o==="center"&&(n=n-a/2);const i=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[i]:this.scrollElement[i]:0)-a;return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,o="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const a=this.getMeasurements()[n];if(!a)return;const r=this.getSize(),i=this.getScrollOffset();if(o==="auto")if(a.end>=i+r-this.options.scrollPaddingEnd)o="end";else if(a.start<=i+this.options.scrollPaddingStart)o="start";else return[i,o];const s=o==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,o),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:o="start",behavior:a}={})=>{this.cancelScrollToIndex(),a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,o),{adjustments:void 0,behavior:a})},this.scrollToIndex=(n,{align:o="auto",behavior:a}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const r=this.getOffsetForIndex(n,o);if(!r)return;const[i,s]=r;this._scrollToOffset(i,{adjustments:void 0,behavior:a}),a!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[d]=ke(this.getOffsetForIndex(n,s));Yt(d,this.getScrollOffset())||this.scrollToIndex(n,{align:s,behavior:a})}else this.scrollToIndex(n,{align:s,behavior:a})}))},this.scrollBy=(n,{behavior:o}={})=>{this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var n;const o=this.getMeasurements();let a;return o.length===0?a=this.options.paddingStart:a=this.options.lanes===1?((n=o[o.length-1])==null?void 0:n.end)??0:Math.max(...o.slice(-this.options.lanes).map(r=>r.end)),a-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(n,{adjustments:o,behavior:a})=>{this.options.scrollToFn(n,{behavior:a,adjustments:o},this)},this.measure=()=>{var n,o;this.itemSizeCache=new Map,(o=(n=this.options).onChange)==null||o.call(n,this,!1)},this.setOptions(l)}}const Ae=(e,l,n,o)=>{for(;e<=l;){const a=(e+l)/2|0,r=n(a);if(r<o)e=a+1;else if(r>o)l=a-1;else return a}return e>0?e-1:0};function rn({measurements:e,outerSize:l,scrollOffset:n}){const o=e.length-1,r=Ae(0,o,s=>e[s].start,n);let i=r;for(;i<o&&e[i].end<n+l;)i++;return{startIndex:r,endIndex:i}}function cn(e){const l=new sn(t.unref(e)),n=t.shallowRef(l),o=l._didMount();return t.watch(()=>t.unref(e).getScrollElement(),a=>{a&&l._willUpdate()},{immediate:!0}),t.watch(()=>t.unref(e),a=>{l.setOptions({...a,onChange:(r,i)=>{var s;t.triggerRef(n),(s=a.onChange)==null||s.call(a,r,i)}}),l._willUpdate(),t.triggerRef(n)},{immediate:!0}),t.onScopeDispose(o),n}function dn(e){return cn(t.computed(()=>({observeElementRect:tn,observeElementOffset:on,scrollToFn:an,...t.unref(e)})))}function un(e,l,n){let o=t.ref(n==null?void 0:n.value),a=t.computed(()=>e.value!==void 0);return[t.computed(()=>a.value?e.value:o.value),function(r){return a.value||(o.value=r),l==null?void 0:l(r)}]}function fn(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(l=>setTimeout(()=>{throw l}))}function fe(){let e=[],l={addEventListener(n,o,a,r){return n.addEventListener(o,a,r),l.add(()=>n.removeEventListener(o,a,r))},requestAnimationFrame(...n){let o=requestAnimationFrame(...n);l.add(()=>cancelAnimationFrame(o))},nextFrame(...n){l.requestAnimationFrame(()=>{l.requestAnimationFrame(...n)})},setTimeout(...n){let o=setTimeout(...n);l.add(()=>clearTimeout(o))},microTask(...n){let o={current:!0};return fn(()=>{o.current&&n[0]()}),l.add(()=>{o.current=!1})},style(n,o,a){let r=n.style.getPropertyValue(o);return Object.assign(n.style,{[o]:a}),this.add(()=>{Object.assign(n.style,{[o]:r})})},group(n){let o=fe();return n(o),this.add(()=>o.dispose())},add(n){return e.push(n),()=>{let o=e.indexOf(n);if(o>=0)for(let a of e.splice(o,1))a()}},dispose(){for(let n of e.splice(0))n()}};return l}function pn(){let e=fe();return t.onUnmounted(()=>e.dispose()),e}function mn(){let e=pn();return l=>{e.dispose(),e.nextFrame(l)}}let hn=Symbol("headlessui.useid"),gn=0;function le(){return t.inject(hn,()=>`${++gn}`)()}function O(e){var l;if(e==null||e.value==null)return null;let n=(l=e.value.$el)!=null?l:e.value;return n instanceof Node?n:null}function U(e,l,...n){if(e in l){let a=l[e];return typeof a=="function"?a(...n):a}let o=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(l).map(a=>`"${a}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(o,U),o}var bn=Object.defineProperty,Cn=(e,l,n)=>l in e?bn(e,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[l]=n,Pe=(e,l,n)=>(Cn(e,typeof l!="symbol"?l+"":l,n),n);let xn=class{constructor(){Pe(this,"current",this.detect()),Pe(this,"currentId",0)}set(l){this.current!==l&&(this.currentId=0,this.current=l)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}},Ve=new xn;function Oe(e){if(Ve.isServer)return null;if(e instanceof Node)return e.ownerDocument;if(e!=null&&e.hasOwnProperty("value")){let l=O(e);if(l)return l.ownerDocument}return document}let De=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var vn=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(vn||{}),yn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(yn||{}),wn=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(wn||{}),je=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(je||{});function En(e,l=0){var n;return e===((n=Oe(e))==null?void 0:n.body)?!1:U(l,{0(){return e.matches(De)},1(){let o=e;for(;o!==null;){if(o.matches(De))return!0;o=o.parentElement}return!1}})}var _n=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(_n||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Sn(e,l=n=>n){return e.slice().sort((n,o)=>{let a=l(n),r=l(o);if(a===null||r===null)return 0;let i=a.compareDocumentPosition(r);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function kn(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Vn(){return/Android/gi.test(window.navigator.userAgent)}function He(){return kn()||Vn()}function pe(e,l,n){Ve.isServer||t.watchEffect(o=>{document.addEventListener(e,l,n),o(()=>document.removeEventListener(e,l,n))})}function On(e,l,n){Ve.isServer||t.watchEffect(o=>{window.addEventListener(e,l,n),o(()=>window.removeEventListener(e,l,n))})}function $n(e,l,n=t.computed(()=>!0)){function o(r,i){if(!n.value||r.defaultPrevented)return;let s=i(r);if(s===null||!s.getRootNode().contains(s))return;let c=function d(u){return typeof u=="function"?d(u()):Array.isArray(u)||u instanceof Set?u:[u]}(e);for(let d of c){if(d===null)continue;let u=d instanceof HTMLElement?d:O(d);if(u!=null&&u.contains(s)||r.composed&&r.composedPath().includes(u))return}return!En(s,je.Loose)&&s.tabIndex!==-1&&r.preventDefault(),l(r,s)}let a=t.ref(null);pe("pointerdown",r=>{var i,s;n.value&&(a.value=((s=(i=r.composedPath)==null?void 0:i.call(r))==null?void 0:s[0])||r.target)},!0),pe("mousedown",r=>{var i,s;n.value&&(a.value=((s=(i=r.composedPath)==null?void 0:i.call(r))==null?void 0:s[0])||r.target)},!0),pe("click",r=>{He()||a.value&&(o(r,()=>a.value),a.value=null)},!0),pe("touchend",r=>o(r,()=>r.target instanceof HTMLElement?r.target:null),!0),On("blur",r=>o(r,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function ze(e,l){if(e)return e;let n=l??"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function Tn(e,l){let n=t.ref(ze(e.value.type,e.value.as));return t.onMounted(()=>{n.value=ze(e.value.type,e.value.as)}),t.watchEffect(()=>{var o;n.value||O(l)&&O(l)instanceof HTMLButtonElement&&!((o=O(l))!=null&&o.hasAttribute("type"))&&(n.value="button")}),n}function Ue(e){return[e.screenX,e.screenY]}function In(){let e=t.ref([-1,-1]);return{wasMoved(l){let n=Ue(l);return e.value[0]===n[0]&&e.value[1]===n[1]?!1:(e.value=n,!0)},update(l){e.value=Ue(l)}}}function Bn({container:e,accept:l,walk:n,enabled:o}){t.watchEffect(()=>{let a=e.value;if(!a||o!==void 0&&!o.value)return;let r=Oe(e);if(!r)return;let i=Object.assign(c=>l(c),{acceptNode:l}),s=r.createTreeWalker(a,NodeFilter.SHOW_ELEMENT,i,!1);for(;s.nextNode();)n(s.currentNode)})}var ae=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(ae||{}),Ln=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Ln||{});function q({visible:e=!0,features:l=0,ourProps:n,theirProps:o,...a}){var r;let i=We(o,n),s=Object.assign(a,{props:i});if(e||l&2&&i.static)return $e(s);if(l&1){let c=(r=i.unmount)==null||r?0:1;return U(c,{0(){return null},1(){return $e({...a,props:{...i,hidden:!0,style:{display:"none"}}})}})}return $e(s)}function $e({props:e,attrs:l,slots:n,slot:o,name:a}){var r,i;let{as:s,...c}=me(e,["unmount","static"]),d=(r=n.default)==null?void 0:r.call(n,o),u={};if(o){let m=!1,b=[];for(let[y,g]of Object.entries(o))typeof g=="boolean"&&(m=!0),g===!0&&b.push(y);m&&(u["data-headlessui-state"]=b.join(" "))}if(s==="template"){if(d=Ze(d??[]),Object.keys(c).length>0||Object.keys(l).length>0){let[m,...b]=d??[];if(!Mn(m)||b.length>0)throw new Error(['Passing props on "template"!',"",`The current component <${a} /> is rendering a "template".`,"However we need to passthrough the following props:",Object.keys(c).concat(Object.keys(l)).map(w=>w.trim()).filter((w,I,_)=>_.indexOf(w)===I).sort((w,I)=>w.localeCompare(I)).map(w=>` - ${w}`).join(`
|
|
4
|
+
color: hsl(${Math.max(0,Math.min(120-120*w,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(c=n==null?void 0:n.onChange)==null||c.call(n,a),a}}function ke(e,l){if(e===void 0)throw new Error("Unexpected undefined");return e}const Qt=(e,l)=>Math.abs(e-l)<1,Xt=(e,l,n)=>{let o;return function(...a){e.clearTimeout(o),o=e.setTimeout(()=>l.apply(this,a),n)}},en=e=>e,tn=e=>{const l=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let a=l;a<=n;a++)o.push(a);return o},nn=(e,l)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;const a=i=>{const{width:s,height:c}=i;l({width:Math.round(s),height:Math.round(c)})};if(a(n.getBoundingClientRect()),!o.ResizeObserver)return()=>{};const r=new o.ResizeObserver(i=>{const s=i[0];if(s!=null&&s.borderBoxSize){const c=s.borderBoxSize[0];if(c){a({width:c.inlineSize,height:c.blockSize});return}}a(n.getBoundingClientRect())});return r.observe(n,{box:"border-box"}),()=>{r.unobserve(n)}},Fe={passive:!0},on=typeof window>"u"?!0:"onscrollend"in window,ln=(e,l)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;let a=0;const r=on?()=>{}:Xt(o,()=>{l(a,!1)},e.options.isScrollingResetDelay),i=d=>()=>{a=n[e.options.horizontal?"scrollLeft":"scrollTop"],r(),l(a,d)},s=i(!0),c=i(!1);return c(),n.addEventListener("scroll",s,Fe),n.addEventListener("scrollend",c,Fe),()=>{n.removeEventListener("scroll",s),n.removeEventListener("scrollend",c)}},an=(e,l,n)=>{if(l!=null&&l.borderBoxSize){const o=l.borderBoxSize[0];if(o)return Math.round(o[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},sn=(e,{adjustments:l=0,behavior:n},o)=>{var a,r;const i=e+l;(r=(a=o.scrollElement)==null?void 0:a.scrollTo)==null||r.call(a,{[o.options.horizontal?"left":"top"]:i,behavior:n})};class rn{constructor(l){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const o=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(a=>{a.forEach(r=>{this._measureElement(r.target,r)})}));return{disconnect:()=>{var a;return(a=o())==null?void 0:a.disconnect()},observe:a=>{var r;return(r=o())==null?void 0:r.observe(a,{box:"border-box"})},unobserve:a=>{var r;return(r=o())==null?void 0:r.unobserve(a)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([o,a])=>{typeof a>"u"&&delete n[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:en,rangeExtractor:tn,onChange:()=>{},measureElement:an,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,...n}},this.notify=(n,o)=>{var a,r;const{startIndex:i,endIndex:s}=this.range??{startIndex:void 0,endIndex:void 0},c=this.calculateRange();(n||i!==(c==null?void 0:c.startIndex)||s!==(c==null?void 0:c.endIndex))&&((r=(a=this.options).onChange)==null||r.call(a,this,o))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.observer.disconnect(),this.elementsCache.clear()},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.notify(!1,!1);return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(a,r)=>{this.scrollAdjustments=0,this.scrollDirection=r?this.getScrollOffset()<a?"forward":"backward":null,this.scrollOffset=a;const i=this.isScrolling;this.isScrolling=r,this.notify(i!==r,r)}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,o)=>{const a=new Map,r=new Map;for(let i=o-1;i>=0;i--){const s=n[i];if(a.has(s.lane))continue;const c=r.get(s.lane);if(c==null||s.end>c.end?r.set(s.lane,s):s.end<c.end&&a.set(s.lane,!0),a.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((i,s)=>i.end===s.end?i.index-s.index:i.end-s.end)[0]:void 0},this.getMeasurementOptions=oe(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,o,a,r,i)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:o,scrollMargin:a,getItemKey:r,enabled:i}),{key:!1}),this.getMeasurements=oe(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:o,scrollMargin:a,getItemKey:r,enabled:i},s)=>{var c;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(m=>{this.itemSizeCache.set(m.key,m.size)}));const d=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,d);for(let m=d;m<n;m++){let b=(c=this.measurementsCache[m])==null?void 0:c.measureElement;b||(b=B=>{const v=r(m),k=this.elementsCache.get(v);if(!B){k&&(this.observer.unobserve(k),this.elementsCache.delete(v));return}k!==B&&(k&&this.observer.unobserve(k),this.observer.observe(B),this.elementsCache.set(v,B)),B.isConnected&&this.resizeItem(m,this.options.measureElement(B,void 0,this))});const y=r(m),g=this.options.lanes===1?u[m-1]:this.getFurthestMeasurement(u,m),w=g?g.end+this.options.gap:o+a,I=s.get(y),_=typeof I=="number"?I:this.options.estimateSize(m),x=w+_,$=g?g.lane:m%this.options.lanes;u[m]={index:m,start:w,size:_,end:x,key:y,lane:$,measureElement:b}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=oe(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,o,a)=>this.range=n.length>0&&o>0?cn({measurements:n,outerSize:o,scrollOffset:a}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getIndexes=oe(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,o,a,r)=>o===null?[]:n({startIndex:o.startIndex,endIndex:o.endIndex,overscan:a,count:r}),{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const o=this.options.indexAttribute,a=n.getAttribute(o);return a?parseInt(a,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(n,o)=>{const a=this.indexFromElement(n),r=this.getMeasurements()[a];if(!r||!n.isConnected){this.elementsCache.forEach((s,c)=>{s===n&&(this.observer.unobserve(n),this.elementsCache.delete(c))});return}const i=this.elementsCache.get(r.key);i!==n&&(i&&this.observer.unobserve(i),this.observer.observe(n),this.elementsCache.set(r.key,n)),this.resizeItem(a,this.options.measureElement(n,o,this))},this.resizeItem=(n,o)=>{const a=this.getMeasurements()[n];if(!a)return;const r=this.itemSizeCache.get(a.key)??a.size,i=o-r;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(a,i,this):a.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(a.index),this.itemSizeCache=new Map(this.itemSizeCache.set(a.key,o)),this.notify(!0,!1))},this.measureElement=n=>{n&&this._measureElement(n,void 0)},this.getVirtualItems=oe(()=>[this.getIndexes(),this.getMeasurements()],(n,o)=>{const a=[];for(let r=0,i=n.length;r<i;r++){const s=n[r],c=o[s];a.push(c)}return a},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const o=this.getMeasurements();if(o.length!==0)return ke(o[Ae(0,o.length-1,a=>ke(o[a]).start,n)])},this.getOffsetForAlignment=(n,o)=>{const a=this.getSize(),r=this.getScrollOffset();o==="auto"&&(n<=r?o="start":n>=r+a?o="end":o="start"),o==="start"?n=n:o==="end"?n=n-a:o==="center"&&(n=n-a/2);const i=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[i]:this.scrollElement[i]:0)-a;return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,o="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const a=this.getMeasurements()[n];if(!a)return;const r=this.getSize(),i=this.getScrollOffset();if(o==="auto")if(a.end>=i+r-this.options.scrollPaddingEnd)o="end";else if(a.start<=i+this.options.scrollPaddingStart)o="start";else return[i,o];const s=o==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,o),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:o="start",behavior:a}={})=>{this.cancelScrollToIndex(),a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,o),{adjustments:void 0,behavior:a})},this.scrollToIndex=(n,{align:o="auto",behavior:a}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const r=this.getOffsetForIndex(n,o);if(!r)return;const[i,s]=r;this._scrollToOffset(i,{adjustments:void 0,behavior:a}),a!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[d]=ke(this.getOffsetForIndex(n,s));Qt(d,this.getScrollOffset())||this.scrollToIndex(n,{align:s,behavior:a})}else this.scrollToIndex(n,{align:s,behavior:a})}))},this.scrollBy=(n,{behavior:o}={})=>{this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var n;const o=this.getMeasurements();let a;return o.length===0?a=this.options.paddingStart:a=this.options.lanes===1?((n=o[o.length-1])==null?void 0:n.end)??0:Math.max(...o.slice(-this.options.lanes).map(r=>r.end)),a-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(n,{adjustments:o,behavior:a})=>{this.options.scrollToFn(n,{behavior:a,adjustments:o},this)},this.measure=()=>{var n,o;this.itemSizeCache=new Map,(o=(n=this.options).onChange)==null||o.call(n,this,!1)},this.setOptions(l)}}const Ae=(e,l,n,o)=>{for(;e<=l;){const a=(e+l)/2|0,r=n(a);if(r<o)e=a+1;else if(r>o)l=a-1;else return a}return e>0?e-1:0};function cn({measurements:e,outerSize:l,scrollOffset:n}){const o=e.length-1,r=Ae(0,o,s=>e[s].start,n);let i=r;for(;i<o&&e[i].end<n+l;)i++;return{startIndex:r,endIndex:i}}function dn(e){const l=new rn(t.unref(e)),n=t.shallowRef(l),o=l._didMount();return t.watch(()=>t.unref(e).getScrollElement(),a=>{a&&l._willUpdate()},{immediate:!0}),t.watch(()=>t.unref(e),a=>{l.setOptions({...a,onChange:(r,i)=>{var s;t.triggerRef(n),(s=a.onChange)==null||s.call(a,r,i)}}),l._willUpdate(),t.triggerRef(n)},{immediate:!0}),t.onScopeDispose(o),n}function un(e){return dn(t.computed(()=>({observeElementRect:nn,observeElementOffset:ln,scrollToFn:sn,...t.unref(e)})))}function fn(e,l,n){let o=t.ref(n==null?void 0:n.value),a=t.computed(()=>e.value!==void 0);return[t.computed(()=>a.value?e.value:o.value),function(r){return a.value||(o.value=r),l==null?void 0:l(r)}]}function pn(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(l=>setTimeout(()=>{throw l}))}function fe(){let e=[],l={addEventListener(n,o,a,r){return n.addEventListener(o,a,r),l.add(()=>n.removeEventListener(o,a,r))},requestAnimationFrame(...n){let o=requestAnimationFrame(...n);l.add(()=>cancelAnimationFrame(o))},nextFrame(...n){l.requestAnimationFrame(()=>{l.requestAnimationFrame(...n)})},setTimeout(...n){let o=setTimeout(...n);l.add(()=>clearTimeout(o))},microTask(...n){let o={current:!0};return pn(()=>{o.current&&n[0]()}),l.add(()=>{o.current=!1})},style(n,o,a){let r=n.style.getPropertyValue(o);return Object.assign(n.style,{[o]:a}),this.add(()=>{Object.assign(n.style,{[o]:r})})},group(n){let o=fe();return n(o),this.add(()=>o.dispose())},add(n){return e.push(n),()=>{let o=e.indexOf(n);if(o>=0)for(let a of e.splice(o,1))a()}},dispose(){for(let n of e.splice(0))n()}};return l}function mn(){let e=fe();return t.onUnmounted(()=>e.dispose()),e}function hn(){let e=mn();return l=>{e.dispose(),e.nextFrame(l)}}let gn=Symbol("headlessui.useid"),bn=0;function le(){return t.inject(gn,()=>`${++bn}`)()}function O(e){var l;if(e==null||e.value==null)return null;let n=(l=e.value.$el)!=null?l:e.value;return n instanceof Node?n:null}function U(e,l,...n){if(e in l){let a=l[e];return typeof a=="function"?a(...n):a}let o=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(l).map(a=>`"${a}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(o,U),o}var Cn=Object.defineProperty,xn=(e,l,n)=>l in e?Cn(e,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[l]=n,Pe=(e,l,n)=>(xn(e,typeof l!="symbol"?l+"":l,n),n);let vn=class{constructor(){Pe(this,"current",this.detect()),Pe(this,"currentId",0)}set(l){this.current!==l&&(this.currentId=0,this.current=l)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}},Ve=new vn;function Oe(e){if(Ve.isServer)return null;if(e instanceof Node)return e.ownerDocument;if(e!=null&&e.hasOwnProperty("value")){let l=O(e);if(l)return l.ownerDocument}return document}let De=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var yn=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(yn||{}),wn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(wn||{}),En=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(En||{}),je=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(je||{});function _n(e,l=0){var n;return e===((n=Oe(e))==null?void 0:n.body)?!1:U(l,{0(){return e.matches(De)},1(){let o=e;for(;o!==null;){if(o.matches(De))return!0;o=o.parentElement}return!1}})}var Sn=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Sn||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function kn(e,l=n=>n){return e.slice().sort((n,o)=>{let a=l(n),r=l(o);if(a===null||r===null)return 0;let i=a.compareDocumentPosition(r);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Vn(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function On(){return/Android/gi.test(window.navigator.userAgent)}function He(){return Vn()||On()}function pe(e,l,n){Ve.isServer||t.watchEffect(o=>{document.addEventListener(e,l,n),o(()=>document.removeEventListener(e,l,n))})}function $n(e,l,n){Ve.isServer||t.watchEffect(o=>{window.addEventListener(e,l,n),o(()=>window.removeEventListener(e,l,n))})}function Tn(e,l,n=t.computed(()=>!0)){function o(r,i){if(!n.value||r.defaultPrevented)return;let s=i(r);if(s===null||!s.getRootNode().contains(s))return;let c=function d(u){return typeof u=="function"?d(u()):Array.isArray(u)||u instanceof Set?u:[u]}(e);for(let d of c){if(d===null)continue;let u=d instanceof HTMLElement?d:O(d);if(u!=null&&u.contains(s)||r.composed&&r.composedPath().includes(u))return}return!_n(s,je.Loose)&&s.tabIndex!==-1&&r.preventDefault(),l(r,s)}let a=t.ref(null);pe("pointerdown",r=>{var i,s;n.value&&(a.value=((s=(i=r.composedPath)==null?void 0:i.call(r))==null?void 0:s[0])||r.target)},!0),pe("mousedown",r=>{var i,s;n.value&&(a.value=((s=(i=r.composedPath)==null?void 0:i.call(r))==null?void 0:s[0])||r.target)},!0),pe("click",r=>{He()||a.value&&(o(r,()=>a.value),a.value=null)},!0),pe("touchend",r=>o(r,()=>r.target instanceof HTMLElement?r.target:null),!0),$n("blur",r=>o(r,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function ze(e,l){if(e)return e;let n=l??"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function In(e,l){let n=t.ref(ze(e.value.type,e.value.as));return t.onMounted(()=>{n.value=ze(e.value.type,e.value.as)}),t.watchEffect(()=>{var o;n.value||O(l)&&O(l)instanceof HTMLButtonElement&&!((o=O(l))!=null&&o.hasAttribute("type"))&&(n.value="button")}),n}function Ue(e){return[e.screenX,e.screenY]}function Bn(){let e=t.ref([-1,-1]);return{wasMoved(l){let n=Ue(l);return e.value[0]===n[0]&&e.value[1]===n[1]?!1:(e.value=n,!0)},update(l){e.value=Ue(l)}}}function Ln({container:e,accept:l,walk:n,enabled:o}){t.watchEffect(()=>{let a=e.value;if(!a||o!==void 0&&!o.value)return;let r=Oe(e);if(!r)return;let i=Object.assign(c=>l(c),{acceptNode:l}),s=r.createTreeWalker(a,NodeFilter.SHOW_ELEMENT,i,!1);for(;s.nextNode();)n(s.currentNode)})}var ae=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(ae||{}),Nn=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Nn||{});function q({visible:e=!0,features:l=0,ourProps:n,theirProps:o,...a}){var r;let i=We(o,n),s=Object.assign(a,{props:i});if(e||l&2&&i.static)return $e(s);if(l&1){let c=(r=i.unmount)==null||r?0:1;return U(c,{0(){return null},1(){return $e({...a,props:{...i,hidden:!0,style:{display:"none"}}})}})}return $e(s)}function $e({props:e,attrs:l,slots:n,slot:o,name:a}){var r,i;let{as:s,...c}=me(e,["unmount","static"]),d=(r=n.default)==null?void 0:r.call(n,o),u={};if(o){let m=!1,b=[];for(let[y,g]of Object.entries(o))typeof g=="boolean"&&(m=!0),g===!0&&b.push(y);m&&(u["data-headlessui-state"]=b.join(" "))}if(s==="template"){if(d=Ze(d??[]),Object.keys(c).length>0||Object.keys(l).length>0){let[m,...b]=d??[];if(!Rn(m)||b.length>0)throw new Error(['Passing props on "template"!',"",`The current component <${a} /> is rendering a "template".`,"However we need to passthrough the following props:",Object.keys(c).concat(Object.keys(l)).map(w=>w.trim()).filter((w,I,_)=>_.indexOf(w)===I).sort((w,I)=>w.localeCompare(I)).map(w=>` - ${w}`).join(`
|
|
5
5
|
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',"Render a single element as the child so that we can forward the props onto that element."].map(w=>` - ${w}`).join(`
|
|
6
6
|
`)].join(`
|
|
7
|
-
`));let y=We((i=m.props)!=null?i:{},c,u),g=t.cloneVNode(m,y,!0);for(let w in y)w.startsWith("on")&&(g.props||(g.props={}),g.props[w]=y[w]);return g}return Array.isArray(d)&&d.length===1?d[0]:d}return t.h(s,Object.assign({},c,u),{default:()=>d})}function Ze(e){return e.flatMap(l=>l.type===t.Fragment?Ze(l.children):[l])}function We(...e){if(e.length===0)return{};if(e.length===1)return e[0];let l={},n={};for(let o of e)for(let a in o)a.startsWith("on")&&typeof o[a]=="function"?(n[a]!=null||(n[a]=[]),n[a].push(o[a])):l[a]=o[a];if(l.disabled||l["aria-disabled"])return Object.assign(l,Object.fromEntries(Object.keys(n).map(o=>[o,void 0])));for(let o in n)Object.assign(l,{[o](a,...r){let i=n[o];for(let s of i){if(a instanceof Event&&a.defaultPrevented)return;s(a,...r)}}});return l}function Nn(e){let l=Object.assign({},e);for(let n in l)l[n]===void 0&&delete l[n];return l}function me(e,l=[]){let n=Object.assign({},e);for(let o of l)o in n&&delete n[o];return n}function Mn(e){return e==null?!1:typeof e.type=="string"||typeof e.type=="object"||typeof e.type=="function"}var Ge=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Ge||{});let Rn=t.defineComponent({name:"Hidden",props:{as:{type:[Object,String],default:"div"},features:{type:Number,default:1}},setup(e,{slots:l,attrs:n}){return()=>{var o;let{features:a,...r}=e,i={"aria-hidden":(a&2)===2?!0:(o=r["aria-hidden"])!=null?o:void 0,hidden:(a&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(a&4)===4&&(a&2)!==2&&{display:"none"}}};return q({ourProps:i,theirProps:r,slot:{},attrs:n,slots:l,name:"Hidden"})}}}),qe=Symbol("Context");var se=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(se||{});function Fn(){return t.inject(qe,null)}function An(e){t.provide(qe,e)}var A=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(A||{}),Je=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Je||{});function Pn(e){function l(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",l))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",l),l())}let J=[];Pn(()=>{function e(l){l.target instanceof HTMLElement&&l.target!==document.body&&J[0]!==l.target&&(J.unshift(l.target),J=J.filter(n=>n!=null&&n.isConnected),J.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function Dn(e){throw new Error("Unexpected object: "+e)}var R=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(R||{});function Ke(e,l){let n=l.resolveItems();if(n.length<=0)return null;let o=l.resolveActiveIndex(),a=o??-1;switch(e.focus){case 0:{for(let r=0;r<n.length;++r)if(!l.resolveDisabled(n[r],r,n))return r;return o}case 1:{a===-1&&(a=n.length);for(let r=a-1;r>=0;--r)if(!l.resolveDisabled(n[r],r,n))return r;return o}case 2:{for(let r=a+1;r<n.length;++r)if(!l.resolveDisabled(n[r],r,n))return r;return o}case 3:{for(let r=n.length-1;r>=0;--r)if(!l.resolveDisabled(n[r],r,n))return r;return o}case 4:{for(let r=0;r<n.length;++r)if(l.resolveId(n[r],r,n)===e.id)return r;return o}case 5:return null;default:Dn(e)}}function Ye(e={},l=null,n=[]){for(let[o,a]of Object.entries(e))Xe(n,Qe(l,o),a);return n}function Qe(e,l){return e?e+"["+l+"]":l}function Xe(e,l,n){if(Array.isArray(n))for(let[o,a]of n.entries())Xe(e,Qe(l,o.toString()),a);else n instanceof Date?e.push([l,n.toISOString()]):typeof n=="boolean"?e.push([l,n?"1":"0"]):typeof n=="string"?e.push([l,n]):typeof n=="number"?e.push([l,`${n}`]):n==null?e.push([l,""]):Ye(n,l,e)}function jn(e,l){return e===l}var Hn=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Hn||{}),zn=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(zn||{}),Un=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(Un||{});let et=Symbol("ComboboxContext");function K(e){let l=t.inject(et,null);if(l===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,K),n}return l}let tt=Symbol("VirtualContext"),Zn=t.defineComponent({name:"VirtualProvider",setup(e,{slots:l}){let n=K("VirtualProvider"),o=t.computed(()=>{let s=O(n.optionsRef);if(!s)return{start:0,end:0};let c=window.getComputedStyle(s);return{start:parseFloat(c.paddingBlockStart||c.paddingTop),end:parseFloat(c.paddingBlockEnd||c.paddingBottom)}}),a=dn(t.computed(()=>({scrollPaddingStart:o.value.start,scrollPaddingEnd:o.value.end,count:n.virtual.value.options.length,estimateSize(){return 40},getScrollElement(){return O(n.optionsRef)},overscan:12}))),r=t.computed(()=>{var s;return(s=n.virtual.value)==null?void 0:s.options}),i=t.ref(0);return t.watch([r],()=>{i.value+=1}),t.provide(tt,n.virtual.value?a:null),()=>[t.h("div",{style:{position:"relative",width:"100%",height:`${a.value.getTotalSize()}px`},ref:s=>{if(s){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||n.activationTrigger.value===0)return;n.activeOptionIndex.value!==null&&n.virtual.value.options.length>n.activeOptionIndex.value&&a.value.scrollToIndex(n.activeOptionIndex.value)}}},a.value.getVirtualItems().map(s=>t.cloneVNode(l.default({option:n.virtual.value.options[s.index],open:n.comboboxState.value===0})[0],{key:`${i.value}-${s.index}`,"data-index":s.index,"aria-setsize":n.virtual.value.options.length,"aria-posinset":s.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${s.start}px)`,overflowAnchor:"none"}})))]}}),Wn=t.defineComponent({name:"Combobox",emits:{"update:modelValue":e=>!0},props:{as:{type:[Object,String],default:"template"},disabled:{type:[Boolean],default:!1},by:{type:[String,Function],nullable:!0,default:null},modelValue:{type:[Object,String,Number,Boolean],default:void 0},defaultValue:{type:[Object,String,Number,Boolean],default:void 0},form:{type:String,optional:!0},name:{type:String,optional:!0},nullable:{type:Boolean,default:!1},multiple:{type:[Boolean],default:!1},immediate:{type:[Boolean],default:!1},virtual:{type:Object,default:null}},inheritAttrs:!1,setup(e,{slots:l,attrs:n,emit:o}){let a=t.ref(1),r=t.ref(null),i=t.ref(null),s=t.ref(null),c=t.ref(null),d=t.ref({static:!1,hold:!1}),u=t.ref([]),m=t.ref(null),b=t.ref(2),y=t.ref(!1);function g(f=p=>p){let p=m.value!==null?u.value[m.value]:null,E=f(u.value.slice()),S=E.length>0&&E[0].dataRef.order.value!==null?E.sort((L,D)=>L.dataRef.order.value-D.dataRef.order.value):Sn(E,L=>O(L.dataRef.domRef)),T=p?S.indexOf(p):null;return T===-1&&(T=null),{options:S,activeOptionIndex:T}}let w=t.computed(()=>e.multiple?1:0),I=t.computed(()=>e.nullable),[_,x]=un(t.computed(()=>e.modelValue),f=>o("update:modelValue",f),t.computed(()=>e.defaultValue)),$=t.computed(()=>_.value===void 0?U(w.value,{1:[],0:void 0}):_.value),B=null,v=null;function k(f){return U(w.value,{0(){return x==null?void 0:x(f)},1:()=>{let p=t.toRaw(h.value.value).slice(),E=t.toRaw(f),S=p.findIndex(T=>h.compare(E,t.toRaw(T)));return S===-1?p.push(E):p.splice(S,1),x==null?void 0:x(p)}})}let C=t.computed(()=>{});t.watch([C],([f],[p])=>{if(h.virtual.value&&f&&p&&m.value!==null){let E=f.indexOf(p[m.value]);E!==-1?m.value=E:m.value=null}});let h={comboboxState:a,value:$,mode:w,compare(f,p){if(typeof e.by=="string"){let E=e.by;return(f==null?void 0:f[E])===(p==null?void 0:p[E])}return e.by===null?jn(f,p):e.by(f,p)},calculateIndex(f){return h.virtual.value?e.by===null?h.virtual.value.options.indexOf(f):h.virtual.value.options.findIndex(p=>h.compare(p,f)):u.value.findIndex(p=>h.compare(p.dataRef.value,f))},defaultValue:t.computed(()=>e.defaultValue),nullable:I,immediate:t.computed(()=>!1),virtual:t.computed(()=>null),inputRef:i,labelRef:r,buttonRef:s,optionsRef:c,disabled:t.computed(()=>e.disabled),options:u,change(f){x(f)},activeOptionIndex:t.computed(()=>{if(y.value&&m.value===null&&(h.virtual.value?h.virtual.value.options.length>0:u.value.length>0)){if(h.virtual.value){let p=h.virtual.value.options.findIndex(E=>{var S;return!((S=h.virtual.value)!=null&&S.disabled(E))});if(p!==-1)return p}let f=u.value.findIndex(p=>!p.dataRef.disabled);if(f!==-1)return f}return m.value}),activationTrigger:b,optionsPropsRef:d,closeCombobox(){y.value=!1,!e.disabled&&a.value!==1&&(a.value=1,m.value=null)},openCombobox(){if(y.value=!0,!e.disabled&&a.value!==0){if(h.value.value){let f=h.calculateIndex(h.value.value);f!==-1&&(m.value=f)}a.value=0}},setActivationTrigger(f){b.value=f},goToOption(f,p,E){y.value=!1,B!==null&&cancelAnimationFrame(B),B=requestAnimationFrame(()=>{if(e.disabled||c.value&&!d.value.static&&a.value===1)return;if(h.virtual.value){m.value=f===R.Specific?p:Ke({focus:f},{resolveItems:()=>h.virtual.value.options,resolveActiveIndex:()=>{var L,D;return(D=(L=h.activeOptionIndex.value)!=null?L:h.virtual.value.options.findIndex(j=>{var M;return!((M=h.virtual.value)!=null&&M.disabled(j))}))!=null?D:null},resolveDisabled:L=>h.virtual.value.disabled(L),resolveId(){throw new Error("Function not implemented.")}}),b.value=E??2;return}let S=g();if(S.activeOptionIndex===null){let L=S.options.findIndex(D=>!D.dataRef.disabled);L!==-1&&(S.activeOptionIndex=L)}let T=f===R.Specific?p:Ke({focus:f},{resolveItems:()=>S.options,resolveActiveIndex:()=>S.activeOptionIndex,resolveId:L=>L.id,resolveDisabled:L=>L.dataRef.disabled});m.value=T,b.value=E??2,u.value=S.options})},selectOption(f){let p=u.value.find(S=>S.id===f);if(!p)return;let{dataRef:E}=p;k(E.value)},selectActiveOption(){if(h.activeOptionIndex.value!==null){if(h.virtual.value)k(h.virtual.value.options[h.activeOptionIndex.value]);else{let{dataRef:f}=u.value[h.activeOptionIndex.value];k(f.value)}h.goToOption(R.Specific,h.activeOptionIndex.value)}},registerOption(f,p){let E=t.reactive({id:f,dataRef:p});if(h.virtual.value){u.value.push(E);return}v&&cancelAnimationFrame(v);let S=g(T=>(T.push(E),T));m.value===null&&h.isSelected(p.value.value)&&(S.activeOptionIndex=S.options.indexOf(E)),u.value=S.options,m.value=S.activeOptionIndex,b.value=2,S.options.some(T=>!O(T.dataRef.domRef))&&(v=requestAnimationFrame(()=>{let T=g();u.value=T.options,m.value=T.activeOptionIndex}))},unregisterOption(f,p){if(B!==null&&cancelAnimationFrame(B),p&&(y.value=!0),h.virtual.value){u.value=u.value.filter(S=>S.id!==f);return}let E=g(S=>{let T=S.findIndex(L=>L.id===f);return T!==-1&&S.splice(T,1),S});u.value=E.options,m.value=E.activeOptionIndex,b.value=2},isSelected(f){return U(w.value,{0:()=>h.compare(t.toRaw(h.value.value),t.toRaw(f)),1:()=>t.toRaw(h.value.value).some(p=>h.compare(t.toRaw(p),t.toRaw(f)))})},isActive(f){return m.value===h.calculateIndex(f)}};$n([i,s,c],()=>h.closeCombobox(),t.computed(()=>a.value===0)),t.provide(et,h),An(t.computed(()=>U(a.value,{0:se.Open,1:se.Closed})));let V=t.computed(()=>{var f;return(f=O(i))==null?void 0:f.closest("form")});return t.onMounted(()=>{t.watch([V],()=>{if(!V.value||e.defaultValue===void 0)return;function f(){h.change(e.defaultValue)}return V.value.addEventListener("reset",f),()=>{var p;(p=V.value)==null||p.removeEventListener("reset",f)}},{immediate:!0})}),()=>{var f,p,E;let{name:S,disabled:T,form:L,...D}=e,j={open:a.value===0,disabled:T,activeIndex:h.activeOptionIndex.value,activeOption:h.activeOptionIndex.value===null?null:h.virtual.value?h.virtual.value.options[(f=h.activeOptionIndex.value)!=null?f:0]:(E=(p=h.options.value[h.activeOptionIndex.value])==null?void 0:p.dataRef.value)!=null?E:null,value:$.value};return t.h(t.Fragment,[...S!=null&&$.value!=null?Ye({[S]:$.value}).map(([M,K0])=>t.h(Rn,Nn({features:Ge.Hidden,key:M,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:L,disabled:T,name:M,value:K0}))):[],q({theirProps:{...n,...me(D,["by","defaultValue","immediate","modelValue","multiple","nullable","onUpdate:modelValue","virtual"])},ourProps:{},slot:j,slots:l,attrs:n,name:"Combobox"})])}}});t.defineComponent({name:"ComboboxLabel",props:{as:{type:[Object,String],default:"label"},id:{type:String,default:null}},setup(e,{attrs:l,slots:n}){var o;let a=(o=e.id)!=null?o:`headlessui-combobox-label-${le()}`,r=K("ComboboxLabel");function i(){var s;(s=O(r.inputRef))==null||s.focus({preventScroll:!0})}return()=>{let s={open:r.comboboxState.value===0,disabled:r.disabled.value},{...c}=e,d={id:a,ref:r.labelRef,onClick:i};return q({ourProps:d,theirProps:c,slot:s,attrs:l,slots:n,name:"ComboboxLabel"})}}});let Gn=t.defineComponent({name:"ComboboxButton",props:{as:{type:[Object,String],default:"button"},id:{type:String,default:null}},setup(e,{attrs:l,slots:n,expose:o}){var a;let r=(a=e.id)!=null?a:`headlessui-combobox-button-${le()}`,i=K("ComboboxButton");o({el:i.buttonRef,$el:i.buttonRef});function s(u){i.disabled.value||(i.comboboxState.value===0?i.closeCombobox():(u.preventDefault(),i.openCombobox()),t.nextTick(()=>{var m;return(m=O(i.inputRef))==null?void 0:m.focus({preventScroll:!0})}))}function c(u){switch(u.key){case A.ArrowDown:u.preventDefault(),u.stopPropagation(),i.comboboxState.value===1&&i.openCombobox(),t.nextTick(()=>{var m;return(m=i.inputRef.value)==null?void 0:m.focus({preventScroll:!0})});return;case A.ArrowUp:u.preventDefault(),u.stopPropagation(),i.comboboxState.value===1&&(i.openCombobox(),t.nextTick(()=>{i.value.value||i.goToOption(R.Last)})),t.nextTick(()=>{var m;return(m=i.inputRef.value)==null?void 0:m.focus({preventScroll:!0})});return;case A.Escape:if(i.comboboxState.value!==0)return;u.preventDefault(),i.optionsRef.value&&!i.optionsPropsRef.value.static&&u.stopPropagation(),i.closeCombobox(),t.nextTick(()=>{var m;return(m=i.inputRef.value)==null?void 0:m.focus({preventScroll:!0})});return}}let d=Tn(t.computed(()=>({as:e.as,type:l.type})),i.buttonRef);return()=>{var u,m;let b={open:i.comboboxState.value===0,disabled:i.disabled.value,value:i.value.value},{...y}=e,g={ref:i.buttonRef,id:r,type:d.value,tabindex:"-1","aria-haspopup":"listbox","aria-controls":(u=O(i.optionsRef))==null?void 0:u.id,"aria-expanded":i.comboboxState.value===0,"aria-labelledby":i.labelRef.value?[(m=O(i.labelRef))==null?void 0:m.id,r].join(" "):void 0,disabled:i.disabled.value===!0?!0:void 0,onKeydown:c,onClick:s};return q({ourProps:g,theirProps:y,slot:b,attrs:l,slots:n,name:"ComboboxButton"})}}}),qn=t.defineComponent({name:"ComboboxInput",props:{as:{type:[Object,String],default:"input"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},displayValue:{type:Function},defaultValue:{type:String,default:void 0},id:{type:String,default:null}},emits:{change:e=>!0},setup(e,{emit:l,attrs:n,slots:o,expose:a}){var r;let i=(r=e.id)!=null?r:`headlessui-combobox-input-${le()}`,s=K("ComboboxInput"),c=t.computed(()=>Oe(O(s.inputRef))),d={value:!1};a({el:s.inputRef,$el:s.inputRef});function u(){s.change(null);let v=O(s.optionsRef);v&&(v.scrollTop=0),s.goToOption(R.Nothing)}let m=t.computed(()=>{var v;let k=s.value.value;return O(s.inputRef)?typeof e.displayValue<"u"&&k!==void 0?(v=e.displayValue(k))!=null?v:"":typeof k=="string"?k:"":""});t.onMounted(()=>{t.watch([m,s.comboboxState,c],([v,k],[C,h])=>{if(d.value)return;let V=O(s.inputRef);V&&((h===0&&k===1||v!==C)&&(V.value=v),requestAnimationFrame(()=>{var f;if(d.value||!V||((f=c.value)==null?void 0:f.activeElement)!==V)return;let{selectionStart:p,selectionEnd:E}=V;Math.abs((E??0)-(p??0))===0&&p===0&&V.setSelectionRange(V.value.length,V.value.length)}))},{immediate:!0}),t.watch([s.comboboxState],([v],[k])=>{if(v===0&&k===1){if(d.value)return;let C=O(s.inputRef);if(!C)return;let h=C.value,{selectionStart:V,selectionEnd:f,selectionDirection:p}=C;C.value="",C.value=h,p!==null?C.setSelectionRange(V,f,p):C.setSelectionRange(V,f)}})});let b=t.ref(!1);function y(){b.value=!0}function g(){fe().nextFrame(()=>{b.value=!1})}let w=mn();function I(v){switch(d.value=!0,w(()=>{d.value=!1}),v.key){case A.Enter:if(d.value=!1,s.comboboxState.value!==0||b.value)return;if(v.preventDefault(),v.stopPropagation(),s.activeOptionIndex.value===null){s.closeCombobox();return}s.selectActiveOption(),s.mode.value===0&&s.closeCombobox();break;case A.ArrowDown:return d.value=!1,v.preventDefault(),v.stopPropagation(),U(s.comboboxState.value,{0:()=>s.goToOption(R.Next),1:()=>s.openCombobox()});case A.ArrowUp:return d.value=!1,v.preventDefault(),v.stopPropagation(),U(s.comboboxState.value,{0:()=>s.goToOption(R.Previous),1:()=>{s.openCombobox(),t.nextTick(()=>{s.value.value||s.goToOption(R.Last)})}});case A.Home:if(v.shiftKey)break;return d.value=!1,v.preventDefault(),v.stopPropagation(),s.goToOption(R.First);case A.PageUp:return d.value=!1,v.preventDefault(),v.stopPropagation(),s.goToOption(R.First);case A.End:if(v.shiftKey)break;return d.value=!1,v.preventDefault(),v.stopPropagation(),s.goToOption(R.Last);case A.PageDown:return d.value=!1,v.preventDefault(),v.stopPropagation(),s.goToOption(R.Last);case A.Escape:if(d.value=!1,s.comboboxState.value!==0)return;v.preventDefault(),s.optionsRef.value&&!s.optionsPropsRef.value.static&&v.stopPropagation(),s.nullable.value&&s.mode.value===0&&s.value.value===null&&u(),s.closeCombobox();break;case A.Tab:if(d.value=!1,s.comboboxState.value!==0)return;s.mode.value===0&&s.activationTrigger.value!==1&&s.selectActiveOption(),s.closeCombobox();break}}function _(v){l("change",v),s.nullable.value&&s.mode.value===0&&v.target.value===""&&u(),s.openCombobox()}function x(v){var k,C,h;let V=(k=v.relatedTarget)!=null?k:J.find(f=>f!==v.currentTarget);if(d.value=!1,!((C=O(s.optionsRef))!=null&&C.contains(V))&&!((h=O(s.buttonRef))!=null&&h.contains(V))&&s.comboboxState.value===0)return v.preventDefault(),s.mode.value===0&&(s.nullable.value&&s.value.value===null?u():s.activationTrigger.value!==1&&s.selectActiveOption()),s.closeCombobox()}function $(v){var k,C,h;let V=(k=v.relatedTarget)!=null?k:J.find(f=>f!==v.currentTarget);(C=O(s.buttonRef))!=null&&C.contains(V)||(h=O(s.optionsRef))!=null&&h.contains(V)||s.disabled.value||s.immediate.value&&s.comboboxState.value!==0&&(s.openCombobox(),fe().nextFrame(()=>{s.setActivationTrigger(1)}))}let B=t.computed(()=>{var v,k,C,h;return(h=(C=(k=e.defaultValue)!=null?k:s.defaultValue.value!==void 0?(v=e.displayValue)==null?void 0:v.call(e,s.defaultValue.value):null)!=null?C:s.defaultValue.value)!=null?h:""});return()=>{var v,k,C,h,V,f,p;let E={open:s.comboboxState.value===0},{displayValue:S,onChange:T,...L}=e,D={"aria-controls":(v=s.optionsRef.value)==null?void 0:v.id,"aria-expanded":s.comboboxState.value===0,"aria-activedescendant":s.activeOptionIndex.value===null?void 0:s.virtual.value?(k=s.options.value.find(j=>!s.virtual.value.disabled(j.dataRef.value)&&s.compare(j.dataRef.value,s.virtual.value.options[s.activeOptionIndex.value])))==null?void 0:k.id:(C=s.options.value[s.activeOptionIndex.value])==null?void 0:C.id,"aria-labelledby":(f=(h=O(s.labelRef))==null?void 0:h.id)!=null?f:(V=O(s.buttonRef))==null?void 0:V.id,"aria-autocomplete":"list",id:i,onCompositionstart:y,onCompositionend:g,onKeydown:I,onInput:_,onFocus:$,onBlur:x,role:"combobox",type:(p=n.type)!=null?p:"text",tabIndex:0,ref:s.inputRef,defaultValue:B.value,disabled:s.disabled.value===!0?!0:void 0};return q({ourProps:D,theirProps:L,slot:E,attrs:n,slots:o,features:ae.RenderStrategy|ae.Static,name:"ComboboxInput"})}}}),Jn=t.defineComponent({name:"ComboboxOptions",props:{as:{type:[Object,String],default:"ul"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},hold:{type:[Boolean],default:!1}},setup(e,{attrs:l,slots:n,expose:o}){let a=K("ComboboxOptions"),r=`headlessui-combobox-options-${le()}`;o({el:a.optionsRef,$el:a.optionsRef}),t.watchEffect(()=>{a.optionsPropsRef.value.static=e.static}),t.watchEffect(()=>{a.optionsPropsRef.value.hold=e.hold});let i=Fn(),s=t.computed(()=>i!==null?(i.value&se.Open)===se.Open:a.comboboxState.value===0);Bn({container:t.computed(()=>O(a.optionsRef)),enabled:t.computed(()=>a.comboboxState.value===0),accept(d){return d.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:d.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(d){d.setAttribute("role","none")}});function c(d){d.preventDefault()}return()=>{var d,u,m;let b={open:a.comboboxState.value===0},y={"aria-labelledby":(m=(d=O(a.labelRef))==null?void 0:d.id)!=null?m:(u=O(a.buttonRef))==null?void 0:u.id,id:r,ref:a.optionsRef,role:"listbox","aria-multiselectable":a.mode.value===1?!0:void 0,onMousedown:c},g=me(e,["hold"]);return q({ourProps:y,theirProps:g,slot:b,attrs:l,slots:a.virtual.value&&a.comboboxState.value===0?{...n,default:()=>[t.h(Zn,{},n.default)]}:n,features:ae.RenderStrategy|ae.Static,visible:s.value,name:"ComboboxOptions"})}}}),Kn=t.defineComponent({name:"ComboboxOption",props:{as:{type:[Object,String],default:"li"},value:{type:[Object,String,Number,Boolean]},disabled:{type:Boolean,default:!1},order:{type:[Number],default:null}},setup(e,{slots:l,attrs:n,expose:o}){let a=K("ComboboxOption"),r=`headlessui-combobox-option-${le()}`,i=t.ref(null),s=t.computed(()=>e.disabled);o({el:i,$el:i});let c=t.computed(()=>{var x;return a.virtual.value?a.activeOptionIndex.value===a.calculateIndex(e.value):a.activeOptionIndex.value===null?!1:((x=a.options.value[a.activeOptionIndex.value])==null?void 0:x.id)===r}),d=t.computed(()=>a.isSelected(e.value)),u=t.inject(tt,null),m=t.computed(()=>({disabled:e.disabled,value:e.value,domRef:i,order:t.computed(()=>e.order)}));t.onMounted(()=>a.registerOption(r,m)),t.onUnmounted(()=>a.unregisterOption(r,c.value)),t.watchEffect(()=>{let x=O(i);x&&(u==null||u.value.measureElement(x))}),t.watchEffect(()=>{a.comboboxState.value===0&&c.value&&(a.virtual.value||a.activationTrigger.value!==0&&t.nextTick(()=>{var x,$;return($=(x=O(i))==null?void 0:x.scrollIntoView)==null?void 0:$.call(x,{block:"nearest"})}))});function b(x){x.preventDefault(),x.button===Je.Left&&(s.value||(a.selectOption(r),He()||requestAnimationFrame(()=>{var $;return($=O(a.inputRef))==null?void 0:$.focus({preventScroll:!0})}),a.mode.value===0&&a.closeCombobox()))}function y(){var x;if(e.disabled||(x=a.virtual.value)!=null&&x.disabled(e.value))return a.goToOption(R.Nothing);let $=a.calculateIndex(e.value);a.goToOption(R.Specific,$)}let g=In();function w(x){g.update(x)}function I(x){var $;if(!g.wasMoved(x)||e.disabled||($=a.virtual.value)!=null&&$.disabled(e.value)||c.value)return;let B=a.calculateIndex(e.value);a.goToOption(R.Specific,B,0)}function _(x){var $;g.wasMoved(x)&&(e.disabled||($=a.virtual.value)!=null&&$.disabled(e.value)||c.value&&(a.optionsPropsRef.value.hold||a.goToOption(R.Nothing)))}return()=>{let{disabled:x}=e,$={active:c.value,selected:d.value,disabled:x},B={id:r,ref:i,role:"option",tabIndex:x===!0?void 0:-1,"aria-disabled":x===!0?!0:void 0,"aria-selected":d.value,disabled:void 0,onMousedown:b,onFocus:y,onPointerenter:w,onMouseenter:w,onPointermove:I,onMousemove:I,onPointerleave:_,onMouseleave:_},v=me(e,["order","value"]);return q({ourProps:B,theirProps:v,slot:$,attrs:n,slots:l,name:"ComboboxOption"})}}});function Yn(e,l){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"})])}function Qn(e,l){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z","clip-rule":"evenodd"})])}function Xn(e,l){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.47 6.47a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 1 1-1.06 1.06L10 8.06l-3.72 3.72a.75.75 0 0 1-1.06-1.06l4.25-4.25Z","clip-rule":"evenodd"})])}var nt=!1;function he(e,l,n){return Array.isArray(e)?(e.length=Math.max(e.length,l),e.splice(l,1,n),n):(e[l]=n,n)}function Te(e,l){if(Array.isArray(e)){e.splice(l,1);return}delete e[l]}function eo(){return ot().__VUE_DEVTOOLS_GLOBAL_HOOK__}function ot(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const to=typeof Proxy=="function",no="devtools-plugin:setup",oo="plugin:settings:set";let ee,Ie;function lo(){var e;return ee!==void 0||(typeof window<"u"&&window.performance?(ee=!0,Ie=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(ee=!0,Ie=globalThis.perf_hooks.performance):ee=!1),ee}function ao(){return lo()?Ie.now():Date.now()}class so{constructor(l,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=l,this.hook=n;const o={};if(l.settings)for(const i in l.settings){const s=l.settings[i];o[i]=s.defaultValue}const a=`__vue-devtools-plugin-settings__${l.id}`;let r=Object.assign({},o);try{const i=localStorage.getItem(a),s=JSON.parse(i);Object.assign(r,s)}catch{}this.fallbacks={getSettings(){return r},setSettings(i){try{localStorage.setItem(a,JSON.stringify(i))}catch{}r=i},now(){return ao()}},n&&n.on(oo,(i,s)=>{i===this.plugin.id&&this.fallbacks.setSettings(s)}),this.proxiedOn=new Proxy({},{get:(i,s)=>this.target?this.target.on[s]:(...c)=>{this.onQueue.push({method:s,args:c})}}),this.proxiedTarget=new Proxy({},{get:(i,s)=>this.target?this.target[s]:s==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(s)?(...c)=>(this.targetQueue.push({method:s,args:c,resolve:()=>{}}),this.fallbacks[s](...c)):(...c)=>new Promise(d=>{this.targetQueue.push({method:s,args:c,resolve:d})})})}async setRealTarget(l){this.target=l;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function lt(e,l){const n=e,o=ot(),a=eo(),r=to&&n.enableEarlyProxy;if(a&&(o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!r))a.emit(no,e,l);else{const i=r?new so(n,a):null;(o.__VUE_DEVTOOLS_PLUGINS__=o.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:l,proxy:i}),i&&l(i.proxiedTarget)}}/*!
|
|
7
|
+
`));let y=We((i=m.props)!=null?i:{},c,u),g=t.cloneVNode(m,y,!0);for(let w in y)w.startsWith("on")&&(g.props||(g.props={}),g.props[w]=y[w]);return g}return Array.isArray(d)&&d.length===1?d[0]:d}return t.h(s,Object.assign({},c,u),{default:()=>d})}function Ze(e){return e.flatMap(l=>l.type===t.Fragment?Ze(l.children):[l])}function We(...e){if(e.length===0)return{};if(e.length===1)return e[0];let l={},n={};for(let o of e)for(let a in o)a.startsWith("on")&&typeof o[a]=="function"?(n[a]!=null||(n[a]=[]),n[a].push(o[a])):l[a]=o[a];if(l.disabled||l["aria-disabled"])return Object.assign(l,Object.fromEntries(Object.keys(n).map(o=>[o,void 0])));for(let o in n)Object.assign(l,{[o](a,...r){let i=n[o];for(let s of i){if(a instanceof Event&&a.defaultPrevented)return;s(a,...r)}}});return l}function Mn(e){let l=Object.assign({},e);for(let n in l)l[n]===void 0&&delete l[n];return l}function me(e,l=[]){let n=Object.assign({},e);for(let o of l)o in n&&delete n[o];return n}function Rn(e){return e==null?!1:typeof e.type=="string"||typeof e.type=="object"||typeof e.type=="function"}var Ge=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Ge||{});let Fn=t.defineComponent({name:"Hidden",props:{as:{type:[Object,String],default:"div"},features:{type:Number,default:1}},setup(e,{slots:l,attrs:n}){return()=>{var o;let{features:a,...r}=e,i={"aria-hidden":(a&2)===2?!0:(o=r["aria-hidden"])!=null?o:void 0,hidden:(a&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(a&4)===4&&(a&2)!==2&&{display:"none"}}};return q({ourProps:i,theirProps:r,slot:{},attrs:n,slots:l,name:"Hidden"})}}}),qe=Symbol("Context");var se=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(se||{});function An(){return t.inject(qe,null)}function Pn(e){t.provide(qe,e)}var A=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(A||{}),Je=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Je||{});function Dn(e){function l(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",l))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",l),l())}let J=[];Dn(()=>{function e(l){l.target instanceof HTMLElement&&l.target!==document.body&&J[0]!==l.target&&(J.unshift(l.target),J=J.filter(n=>n!=null&&n.isConnected),J.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function jn(e){throw new Error("Unexpected object: "+e)}var R=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(R||{});function Ke(e,l){let n=l.resolveItems();if(n.length<=0)return null;let o=l.resolveActiveIndex(),a=o??-1;switch(e.focus){case 0:{for(let r=0;r<n.length;++r)if(!l.resolveDisabled(n[r],r,n))return r;return o}case 1:{a===-1&&(a=n.length);for(let r=a-1;r>=0;--r)if(!l.resolveDisabled(n[r],r,n))return r;return o}case 2:{for(let r=a+1;r<n.length;++r)if(!l.resolveDisabled(n[r],r,n))return r;return o}case 3:{for(let r=n.length-1;r>=0;--r)if(!l.resolveDisabled(n[r],r,n))return r;return o}case 4:{for(let r=0;r<n.length;++r)if(l.resolveId(n[r],r,n)===e.id)return r;return o}case 5:return null;default:jn(e)}}function Ye(e={},l=null,n=[]){for(let[o,a]of Object.entries(e))Xe(n,Qe(l,o),a);return n}function Qe(e,l){return e?e+"["+l+"]":l}function Xe(e,l,n){if(Array.isArray(n))for(let[o,a]of n.entries())Xe(e,Qe(l,o.toString()),a);else n instanceof Date?e.push([l,n.toISOString()]):typeof n=="boolean"?e.push([l,n?"1":"0"]):typeof n=="string"?e.push([l,n]):typeof n=="number"?e.push([l,`${n}`]):n==null?e.push([l,""]):Ye(n,l,e)}function Hn(e,l){return e===l}var zn=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(zn||{}),Un=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Un||{}),Zn=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(Zn||{});let et=Symbol("ComboboxContext");function K(e){let l=t.inject(et,null);if(l===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,K),n}return l}let tt=Symbol("VirtualContext"),Wn=t.defineComponent({name:"VirtualProvider",setup(e,{slots:l}){let n=K("VirtualProvider"),o=t.computed(()=>{let s=O(n.optionsRef);if(!s)return{start:0,end:0};let c=window.getComputedStyle(s);return{start:parseFloat(c.paddingBlockStart||c.paddingTop),end:parseFloat(c.paddingBlockEnd||c.paddingBottom)}}),a=un(t.computed(()=>({scrollPaddingStart:o.value.start,scrollPaddingEnd:o.value.end,count:n.virtual.value.options.length,estimateSize(){return 40},getScrollElement(){return O(n.optionsRef)},overscan:12}))),r=t.computed(()=>{var s;return(s=n.virtual.value)==null?void 0:s.options}),i=t.ref(0);return t.watch([r],()=>{i.value+=1}),t.provide(tt,n.virtual.value?a:null),()=>[t.h("div",{style:{position:"relative",width:"100%",height:`${a.value.getTotalSize()}px`},ref:s=>{if(s){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||n.activationTrigger.value===0)return;n.activeOptionIndex.value!==null&&n.virtual.value.options.length>n.activeOptionIndex.value&&a.value.scrollToIndex(n.activeOptionIndex.value)}}},a.value.getVirtualItems().map(s=>t.cloneVNode(l.default({option:n.virtual.value.options[s.index],open:n.comboboxState.value===0})[0],{key:`${i.value}-${s.index}`,"data-index":s.index,"aria-setsize":n.virtual.value.options.length,"aria-posinset":s.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${s.start}px)`,overflowAnchor:"none"}})))]}}),Gn=t.defineComponent({name:"Combobox",emits:{"update:modelValue":e=>!0},props:{as:{type:[Object,String],default:"template"},disabled:{type:[Boolean],default:!1},by:{type:[String,Function],nullable:!0,default:null},modelValue:{type:[Object,String,Number,Boolean],default:void 0},defaultValue:{type:[Object,String,Number,Boolean],default:void 0},form:{type:String,optional:!0},name:{type:String,optional:!0},nullable:{type:Boolean,default:!1},multiple:{type:[Boolean],default:!1},immediate:{type:[Boolean],default:!1},virtual:{type:Object,default:null}},inheritAttrs:!1,setup(e,{slots:l,attrs:n,emit:o}){let a=t.ref(1),r=t.ref(null),i=t.ref(null),s=t.ref(null),c=t.ref(null),d=t.ref({static:!1,hold:!1}),u=t.ref([]),m=t.ref(null),b=t.ref(2),y=t.ref(!1);function g(f=p=>p){let p=m.value!==null?u.value[m.value]:null,E=f(u.value.slice()),S=E.length>0&&E[0].dataRef.order.value!==null?E.sort((L,D)=>L.dataRef.order.value-D.dataRef.order.value):kn(E,L=>O(L.dataRef.domRef)),T=p?S.indexOf(p):null;return T===-1&&(T=null),{options:S,activeOptionIndex:T}}let w=t.computed(()=>e.multiple?1:0),I=t.computed(()=>e.nullable),[_,x]=fn(t.computed(()=>e.modelValue),f=>o("update:modelValue",f),t.computed(()=>e.defaultValue)),$=t.computed(()=>_.value===void 0?U(w.value,{1:[],0:void 0}):_.value),B=null,v=null;function k(f){return U(w.value,{0(){return x==null?void 0:x(f)},1:()=>{let p=t.toRaw(h.value.value).slice(),E=t.toRaw(f),S=p.findIndex(T=>h.compare(E,t.toRaw(T)));return S===-1?p.push(E):p.splice(S,1),x==null?void 0:x(p)}})}let C=t.computed(()=>{});t.watch([C],([f],[p])=>{if(h.virtual.value&&f&&p&&m.value!==null){let E=f.indexOf(p[m.value]);E!==-1?m.value=E:m.value=null}});let h={comboboxState:a,value:$,mode:w,compare(f,p){if(typeof e.by=="string"){let E=e.by;return(f==null?void 0:f[E])===(p==null?void 0:p[E])}return e.by===null?Hn(f,p):e.by(f,p)},calculateIndex(f){return h.virtual.value?e.by===null?h.virtual.value.options.indexOf(f):h.virtual.value.options.findIndex(p=>h.compare(p,f)):u.value.findIndex(p=>h.compare(p.dataRef.value,f))},defaultValue:t.computed(()=>e.defaultValue),nullable:I,immediate:t.computed(()=>!1),virtual:t.computed(()=>null),inputRef:i,labelRef:r,buttonRef:s,optionsRef:c,disabled:t.computed(()=>e.disabled),options:u,change(f){x(f)},activeOptionIndex:t.computed(()=>{if(y.value&&m.value===null&&(h.virtual.value?h.virtual.value.options.length>0:u.value.length>0)){if(h.virtual.value){let p=h.virtual.value.options.findIndex(E=>{var S;return!((S=h.virtual.value)!=null&&S.disabled(E))});if(p!==-1)return p}let f=u.value.findIndex(p=>!p.dataRef.disabled);if(f!==-1)return f}return m.value}),activationTrigger:b,optionsPropsRef:d,closeCombobox(){y.value=!1,!e.disabled&&a.value!==1&&(a.value=1,m.value=null)},openCombobox(){if(y.value=!0,!e.disabled&&a.value!==0){if(h.value.value){let f=h.calculateIndex(h.value.value);f!==-1&&(m.value=f)}a.value=0}},setActivationTrigger(f){b.value=f},goToOption(f,p,E){y.value=!1,B!==null&&cancelAnimationFrame(B),B=requestAnimationFrame(()=>{if(e.disabled||c.value&&!d.value.static&&a.value===1)return;if(h.virtual.value){m.value=f===R.Specific?p:Ke({focus:f},{resolveItems:()=>h.virtual.value.options,resolveActiveIndex:()=>{var L,D;return(D=(L=h.activeOptionIndex.value)!=null?L:h.virtual.value.options.findIndex(j=>{var M;return!((M=h.virtual.value)!=null&&M.disabled(j))}))!=null?D:null},resolveDisabled:L=>h.virtual.value.disabled(L),resolveId(){throw new Error("Function not implemented.")}}),b.value=E??2;return}let S=g();if(S.activeOptionIndex===null){let L=S.options.findIndex(D=>!D.dataRef.disabled);L!==-1&&(S.activeOptionIndex=L)}let T=f===R.Specific?p:Ke({focus:f},{resolveItems:()=>S.options,resolveActiveIndex:()=>S.activeOptionIndex,resolveId:L=>L.id,resolveDisabled:L=>L.dataRef.disabled});m.value=T,b.value=E??2,u.value=S.options})},selectOption(f){let p=u.value.find(S=>S.id===f);if(!p)return;let{dataRef:E}=p;k(E.value)},selectActiveOption(){if(h.activeOptionIndex.value!==null){if(h.virtual.value)k(h.virtual.value.options[h.activeOptionIndex.value]);else{let{dataRef:f}=u.value[h.activeOptionIndex.value];k(f.value)}h.goToOption(R.Specific,h.activeOptionIndex.value)}},registerOption(f,p){let E=t.reactive({id:f,dataRef:p});if(h.virtual.value){u.value.push(E);return}v&&cancelAnimationFrame(v);let S=g(T=>(T.push(E),T));m.value===null&&h.isSelected(p.value.value)&&(S.activeOptionIndex=S.options.indexOf(E)),u.value=S.options,m.value=S.activeOptionIndex,b.value=2,S.options.some(T=>!O(T.dataRef.domRef))&&(v=requestAnimationFrame(()=>{let T=g();u.value=T.options,m.value=T.activeOptionIndex}))},unregisterOption(f,p){if(B!==null&&cancelAnimationFrame(B),p&&(y.value=!0),h.virtual.value){u.value=u.value.filter(S=>S.id!==f);return}let E=g(S=>{let T=S.findIndex(L=>L.id===f);return T!==-1&&S.splice(T,1),S});u.value=E.options,m.value=E.activeOptionIndex,b.value=2},isSelected(f){return U(w.value,{0:()=>h.compare(t.toRaw(h.value.value),t.toRaw(f)),1:()=>t.toRaw(h.value.value).some(p=>h.compare(t.toRaw(p),t.toRaw(f)))})},isActive(f){return m.value===h.calculateIndex(f)}};Tn([i,s,c],()=>h.closeCombobox(),t.computed(()=>a.value===0)),t.provide(et,h),Pn(t.computed(()=>U(a.value,{0:se.Open,1:se.Closed})));let V=t.computed(()=>{var f;return(f=O(i))==null?void 0:f.closest("form")});return t.onMounted(()=>{t.watch([V],()=>{if(!V.value||e.defaultValue===void 0)return;function f(){h.change(e.defaultValue)}return V.value.addEventListener("reset",f),()=>{var p;(p=V.value)==null||p.removeEventListener("reset",f)}},{immediate:!0})}),()=>{var f,p,E;let{name:S,disabled:T,form:L,...D}=e,j={open:a.value===0,disabled:T,activeIndex:h.activeOptionIndex.value,activeOption:h.activeOptionIndex.value===null?null:h.virtual.value?h.virtual.value.options[(f=h.activeOptionIndex.value)!=null?f:0]:(E=(p=h.options.value[h.activeOptionIndex.value])==null?void 0:p.dataRef.value)!=null?E:null,value:$.value};return t.h(t.Fragment,[...S!=null&&$.value!=null?Ye({[S]:$.value}).map(([M,el])=>t.h(Fn,Mn({features:Ge.Hidden,key:M,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:L,disabled:T,name:M,value:el}))):[],q({theirProps:{...n,...me(D,["by","defaultValue","immediate","modelValue","multiple","nullable","onUpdate:modelValue","virtual"])},ourProps:{},slot:j,slots:l,attrs:n,name:"Combobox"})])}}});t.defineComponent({name:"ComboboxLabel",props:{as:{type:[Object,String],default:"label"},id:{type:String,default:null}},setup(e,{attrs:l,slots:n}){var o;let a=(o=e.id)!=null?o:`headlessui-combobox-label-${le()}`,r=K("ComboboxLabel");function i(){var s;(s=O(r.inputRef))==null||s.focus({preventScroll:!0})}return()=>{let s={open:r.comboboxState.value===0,disabled:r.disabled.value},{...c}=e,d={id:a,ref:r.labelRef,onClick:i};return q({ourProps:d,theirProps:c,slot:s,attrs:l,slots:n,name:"ComboboxLabel"})}}});let qn=t.defineComponent({name:"ComboboxButton",props:{as:{type:[Object,String],default:"button"},id:{type:String,default:null}},setup(e,{attrs:l,slots:n,expose:o}){var a;let r=(a=e.id)!=null?a:`headlessui-combobox-button-${le()}`,i=K("ComboboxButton");o({el:i.buttonRef,$el:i.buttonRef});function s(u){i.disabled.value||(i.comboboxState.value===0?i.closeCombobox():(u.preventDefault(),i.openCombobox()),t.nextTick(()=>{var m;return(m=O(i.inputRef))==null?void 0:m.focus({preventScroll:!0})}))}function c(u){switch(u.key){case A.ArrowDown:u.preventDefault(),u.stopPropagation(),i.comboboxState.value===1&&i.openCombobox(),t.nextTick(()=>{var m;return(m=i.inputRef.value)==null?void 0:m.focus({preventScroll:!0})});return;case A.ArrowUp:u.preventDefault(),u.stopPropagation(),i.comboboxState.value===1&&(i.openCombobox(),t.nextTick(()=>{i.value.value||i.goToOption(R.Last)})),t.nextTick(()=>{var m;return(m=i.inputRef.value)==null?void 0:m.focus({preventScroll:!0})});return;case A.Escape:if(i.comboboxState.value!==0)return;u.preventDefault(),i.optionsRef.value&&!i.optionsPropsRef.value.static&&u.stopPropagation(),i.closeCombobox(),t.nextTick(()=>{var m;return(m=i.inputRef.value)==null?void 0:m.focus({preventScroll:!0})});return}}let d=In(t.computed(()=>({as:e.as,type:l.type})),i.buttonRef);return()=>{var u,m;let b={open:i.comboboxState.value===0,disabled:i.disabled.value,value:i.value.value},{...y}=e,g={ref:i.buttonRef,id:r,type:d.value,tabindex:"-1","aria-haspopup":"listbox","aria-controls":(u=O(i.optionsRef))==null?void 0:u.id,"aria-expanded":i.comboboxState.value===0,"aria-labelledby":i.labelRef.value?[(m=O(i.labelRef))==null?void 0:m.id,r].join(" "):void 0,disabled:i.disabled.value===!0?!0:void 0,onKeydown:c,onClick:s};return q({ourProps:g,theirProps:y,slot:b,attrs:l,slots:n,name:"ComboboxButton"})}}}),Jn=t.defineComponent({name:"ComboboxInput",props:{as:{type:[Object,String],default:"input"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},displayValue:{type:Function},defaultValue:{type:String,default:void 0},id:{type:String,default:null}},emits:{change:e=>!0},setup(e,{emit:l,attrs:n,slots:o,expose:a}){var r;let i=(r=e.id)!=null?r:`headlessui-combobox-input-${le()}`,s=K("ComboboxInput"),c=t.computed(()=>Oe(O(s.inputRef))),d={value:!1};a({el:s.inputRef,$el:s.inputRef});function u(){s.change(null);let v=O(s.optionsRef);v&&(v.scrollTop=0),s.goToOption(R.Nothing)}let m=t.computed(()=>{var v;let k=s.value.value;return O(s.inputRef)?typeof e.displayValue<"u"&&k!==void 0?(v=e.displayValue(k))!=null?v:"":typeof k=="string"?k:"":""});t.onMounted(()=>{t.watch([m,s.comboboxState,c],([v,k],[C,h])=>{if(d.value)return;let V=O(s.inputRef);V&&((h===0&&k===1||v!==C)&&(V.value=v),requestAnimationFrame(()=>{var f;if(d.value||!V||((f=c.value)==null?void 0:f.activeElement)!==V)return;let{selectionStart:p,selectionEnd:E}=V;Math.abs((E??0)-(p??0))===0&&p===0&&V.setSelectionRange(V.value.length,V.value.length)}))},{immediate:!0}),t.watch([s.comboboxState],([v],[k])=>{if(v===0&&k===1){if(d.value)return;let C=O(s.inputRef);if(!C)return;let h=C.value,{selectionStart:V,selectionEnd:f,selectionDirection:p}=C;C.value="",C.value=h,p!==null?C.setSelectionRange(V,f,p):C.setSelectionRange(V,f)}})});let b=t.ref(!1);function y(){b.value=!0}function g(){fe().nextFrame(()=>{b.value=!1})}let w=hn();function I(v){switch(d.value=!0,w(()=>{d.value=!1}),v.key){case A.Enter:if(d.value=!1,s.comboboxState.value!==0||b.value)return;if(v.preventDefault(),v.stopPropagation(),s.activeOptionIndex.value===null){s.closeCombobox();return}s.selectActiveOption(),s.mode.value===0&&s.closeCombobox();break;case A.ArrowDown:return d.value=!1,v.preventDefault(),v.stopPropagation(),U(s.comboboxState.value,{0:()=>s.goToOption(R.Next),1:()=>s.openCombobox()});case A.ArrowUp:return d.value=!1,v.preventDefault(),v.stopPropagation(),U(s.comboboxState.value,{0:()=>s.goToOption(R.Previous),1:()=>{s.openCombobox(),t.nextTick(()=>{s.value.value||s.goToOption(R.Last)})}});case A.Home:if(v.shiftKey)break;return d.value=!1,v.preventDefault(),v.stopPropagation(),s.goToOption(R.First);case A.PageUp:return d.value=!1,v.preventDefault(),v.stopPropagation(),s.goToOption(R.First);case A.End:if(v.shiftKey)break;return d.value=!1,v.preventDefault(),v.stopPropagation(),s.goToOption(R.Last);case A.PageDown:return d.value=!1,v.preventDefault(),v.stopPropagation(),s.goToOption(R.Last);case A.Escape:if(d.value=!1,s.comboboxState.value!==0)return;v.preventDefault(),s.optionsRef.value&&!s.optionsPropsRef.value.static&&v.stopPropagation(),s.nullable.value&&s.mode.value===0&&s.value.value===null&&u(),s.closeCombobox();break;case A.Tab:if(d.value=!1,s.comboboxState.value!==0)return;s.mode.value===0&&s.activationTrigger.value!==1&&s.selectActiveOption(),s.closeCombobox();break}}function _(v){l("change",v),s.nullable.value&&s.mode.value===0&&v.target.value===""&&u(),s.openCombobox()}function x(v){var k,C,h;let V=(k=v.relatedTarget)!=null?k:J.find(f=>f!==v.currentTarget);if(d.value=!1,!((C=O(s.optionsRef))!=null&&C.contains(V))&&!((h=O(s.buttonRef))!=null&&h.contains(V))&&s.comboboxState.value===0)return v.preventDefault(),s.mode.value===0&&(s.nullable.value&&s.value.value===null?u():s.activationTrigger.value!==1&&s.selectActiveOption()),s.closeCombobox()}function $(v){var k,C,h;let V=(k=v.relatedTarget)!=null?k:J.find(f=>f!==v.currentTarget);(C=O(s.buttonRef))!=null&&C.contains(V)||(h=O(s.optionsRef))!=null&&h.contains(V)||s.disabled.value||s.immediate.value&&s.comboboxState.value!==0&&(s.openCombobox(),fe().nextFrame(()=>{s.setActivationTrigger(1)}))}let B=t.computed(()=>{var v,k,C,h;return(h=(C=(k=e.defaultValue)!=null?k:s.defaultValue.value!==void 0?(v=e.displayValue)==null?void 0:v.call(e,s.defaultValue.value):null)!=null?C:s.defaultValue.value)!=null?h:""});return()=>{var v,k,C,h,V,f,p;let E={open:s.comboboxState.value===0},{displayValue:S,onChange:T,...L}=e,D={"aria-controls":(v=s.optionsRef.value)==null?void 0:v.id,"aria-expanded":s.comboboxState.value===0,"aria-activedescendant":s.activeOptionIndex.value===null?void 0:s.virtual.value?(k=s.options.value.find(j=>!s.virtual.value.disabled(j.dataRef.value)&&s.compare(j.dataRef.value,s.virtual.value.options[s.activeOptionIndex.value])))==null?void 0:k.id:(C=s.options.value[s.activeOptionIndex.value])==null?void 0:C.id,"aria-labelledby":(f=(h=O(s.labelRef))==null?void 0:h.id)!=null?f:(V=O(s.buttonRef))==null?void 0:V.id,"aria-autocomplete":"list",id:i,onCompositionstart:y,onCompositionend:g,onKeydown:I,onInput:_,onFocus:$,onBlur:x,role:"combobox",type:(p=n.type)!=null?p:"text",tabIndex:0,ref:s.inputRef,defaultValue:B.value,disabled:s.disabled.value===!0?!0:void 0};return q({ourProps:D,theirProps:L,slot:E,attrs:n,slots:o,features:ae.RenderStrategy|ae.Static,name:"ComboboxInput"})}}}),Kn=t.defineComponent({name:"ComboboxOptions",props:{as:{type:[Object,String],default:"ul"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},hold:{type:[Boolean],default:!1}},setup(e,{attrs:l,slots:n,expose:o}){let a=K("ComboboxOptions"),r=`headlessui-combobox-options-${le()}`;o({el:a.optionsRef,$el:a.optionsRef}),t.watchEffect(()=>{a.optionsPropsRef.value.static=e.static}),t.watchEffect(()=>{a.optionsPropsRef.value.hold=e.hold});let i=An(),s=t.computed(()=>i!==null?(i.value&se.Open)===se.Open:a.comboboxState.value===0);Ln({container:t.computed(()=>O(a.optionsRef)),enabled:t.computed(()=>a.comboboxState.value===0),accept(d){return d.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:d.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(d){d.setAttribute("role","none")}});function c(d){d.preventDefault()}return()=>{var d,u,m;let b={open:a.comboboxState.value===0},y={"aria-labelledby":(m=(d=O(a.labelRef))==null?void 0:d.id)!=null?m:(u=O(a.buttonRef))==null?void 0:u.id,id:r,ref:a.optionsRef,role:"listbox","aria-multiselectable":a.mode.value===1?!0:void 0,onMousedown:c},g=me(e,["hold"]);return q({ourProps:y,theirProps:g,slot:b,attrs:l,slots:a.virtual.value&&a.comboboxState.value===0?{...n,default:()=>[t.h(Wn,{},n.default)]}:n,features:ae.RenderStrategy|ae.Static,visible:s.value,name:"ComboboxOptions"})}}}),Yn=t.defineComponent({name:"ComboboxOption",props:{as:{type:[Object,String],default:"li"},value:{type:[Object,String,Number,Boolean]},disabled:{type:Boolean,default:!1},order:{type:[Number],default:null}},setup(e,{slots:l,attrs:n,expose:o}){let a=K("ComboboxOption"),r=`headlessui-combobox-option-${le()}`,i=t.ref(null),s=t.computed(()=>e.disabled);o({el:i,$el:i});let c=t.computed(()=>{var x;return a.virtual.value?a.activeOptionIndex.value===a.calculateIndex(e.value):a.activeOptionIndex.value===null?!1:((x=a.options.value[a.activeOptionIndex.value])==null?void 0:x.id)===r}),d=t.computed(()=>a.isSelected(e.value)),u=t.inject(tt,null),m=t.computed(()=>({disabled:e.disabled,value:e.value,domRef:i,order:t.computed(()=>e.order)}));t.onMounted(()=>a.registerOption(r,m)),t.onUnmounted(()=>a.unregisterOption(r,c.value)),t.watchEffect(()=>{let x=O(i);x&&(u==null||u.value.measureElement(x))}),t.watchEffect(()=>{a.comboboxState.value===0&&c.value&&(a.virtual.value||a.activationTrigger.value!==0&&t.nextTick(()=>{var x,$;return($=(x=O(i))==null?void 0:x.scrollIntoView)==null?void 0:$.call(x,{block:"nearest"})}))});function b(x){x.preventDefault(),x.button===Je.Left&&(s.value||(a.selectOption(r),He()||requestAnimationFrame(()=>{var $;return($=O(a.inputRef))==null?void 0:$.focus({preventScroll:!0})}),a.mode.value===0&&a.closeCombobox()))}function y(){var x;if(e.disabled||(x=a.virtual.value)!=null&&x.disabled(e.value))return a.goToOption(R.Nothing);let $=a.calculateIndex(e.value);a.goToOption(R.Specific,$)}let g=Bn();function w(x){g.update(x)}function I(x){var $;if(!g.wasMoved(x)||e.disabled||($=a.virtual.value)!=null&&$.disabled(e.value)||c.value)return;let B=a.calculateIndex(e.value);a.goToOption(R.Specific,B,0)}function _(x){var $;g.wasMoved(x)&&(e.disabled||($=a.virtual.value)!=null&&$.disabled(e.value)||c.value&&(a.optionsPropsRef.value.hold||a.goToOption(R.Nothing)))}return()=>{let{disabled:x}=e,$={active:c.value,selected:d.value,disabled:x},B={id:r,ref:i,role:"option",tabIndex:x===!0?void 0:-1,"aria-disabled":x===!0?!0:void 0,"aria-selected":d.value,disabled:void 0,onMousedown:b,onFocus:y,onPointerenter:w,onMouseenter:w,onPointermove:I,onMousemove:I,onPointerleave:_,onMouseleave:_},v=me(e,["order","value"]);return q({ourProps:B,theirProps:v,slot:$,attrs:n,slots:l,name:"ComboboxOption"})}}});function Qn(e,l){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"})])}function Xn(e,l){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z","clip-rule":"evenodd"})])}function eo(e,l){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.47 6.47a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 1 1-1.06 1.06L10 8.06l-3.72 3.72a.75.75 0 0 1-1.06-1.06l4.25-4.25Z","clip-rule":"evenodd"})])}var nt=!1;function he(e,l,n){return Array.isArray(e)?(e.length=Math.max(e.length,l),e.splice(l,1,n),n):(e[l]=n,n)}function Te(e,l){if(Array.isArray(e)){e.splice(l,1);return}delete e[l]}function to(){return ot().__VUE_DEVTOOLS_GLOBAL_HOOK__}function ot(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const no=typeof Proxy=="function",oo="devtools-plugin:setup",lo="plugin:settings:set";let ee,Ie;function ao(){var e;return ee!==void 0||(typeof window<"u"&&window.performance?(ee=!0,Ie=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(ee=!0,Ie=globalThis.perf_hooks.performance):ee=!1),ee}function so(){return ao()?Ie.now():Date.now()}class ro{constructor(l,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=l,this.hook=n;const o={};if(l.settings)for(const i in l.settings){const s=l.settings[i];o[i]=s.defaultValue}const a=`__vue-devtools-plugin-settings__${l.id}`;let r=Object.assign({},o);try{const i=localStorage.getItem(a),s=JSON.parse(i);Object.assign(r,s)}catch{}this.fallbacks={getSettings(){return r},setSettings(i){try{localStorage.setItem(a,JSON.stringify(i))}catch{}r=i},now(){return so()}},n&&n.on(lo,(i,s)=>{i===this.plugin.id&&this.fallbacks.setSettings(s)}),this.proxiedOn=new Proxy({},{get:(i,s)=>this.target?this.target.on[s]:(...c)=>{this.onQueue.push({method:s,args:c})}}),this.proxiedTarget=new Proxy({},{get:(i,s)=>this.target?this.target[s]:s==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(s)?(...c)=>(this.targetQueue.push({method:s,args:c,resolve:()=>{}}),this.fallbacks[s](...c)):(...c)=>new Promise(d=>{this.targetQueue.push({method:s,args:c,resolve:d})})})}async setRealTarget(l){this.target=l;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function lt(e,l){const n=e,o=ot(),a=to(),r=no&&n.enableEarlyProxy;if(a&&(o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!r))a.emit(oo,e,l);else{const i=r?new ro(n,a):null;(o.__VUE_DEVTOOLS_PLUGINS__=o.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:l,proxy:i}),i&&l(i.proxiedTarget)}}/*!
|
|
8
8
|
* pinia v2.1.7
|
|
9
9
|
* (c) 2023 Eduardo San Martin Morote
|
|
10
10
|
* @license MIT
|
|
11
|
-
*/let re;const ie=e=>re=e,at=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function Y(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var z;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(z||(z={}));const ge=typeof window<"u",ce=(process.env.NODE_ENV!=="production"||!1)&&process.env.NODE_ENV!=="test"&&ge,st=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:typeof globalThis=="object"?globalThis:{HTMLElement:null};function
|
|
11
|
+
*/let re;const ie=e=>re=e,at=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function Y(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var z;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(z||(z={}));const ge=typeof window<"u",ce=(process.env.NODE_ENV!=="production"||!1)&&process.env.NODE_ENV!=="test"&&ge,st=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:typeof globalThis=="object"?globalThis:{HTMLElement:null};function io(e,{autoBom:l=!1}={}){return l&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function Be(e,l,n){const o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){ct(o.response,l,n)},o.onerror=function(){console.error("could not download file")},o.send()}function rt(e){const l=new XMLHttpRequest;l.open("HEAD",e,!1);try{l.send()}catch{}return l.status>=200&&l.status<=299}function be(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{const n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(n)}}const Ce=typeof navigator=="object"?navigator:{userAgent:""},it=/Macintosh/.test(Ce.userAgent)&&/AppleWebKit/.test(Ce.userAgent)&&!/Safari/.test(Ce.userAgent),ct=ge?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!it?co:"msSaveOrOpenBlob"in Ce?uo:fo:()=>{};function co(e,l="download",n){const o=document.createElement("a");o.download=l,o.rel="noopener",typeof e=="string"?(o.href=e,o.origin!==location.origin?rt(o.href)?Be(e,l,n):(o.target="_blank",be(o)):be(o)):(o.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(o.href)},4e4),setTimeout(function(){be(o)},0))}function uo(e,l="download",n){if(typeof e=="string")if(rt(e))Be(e,l,n);else{const o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){be(o)})}else navigator.msSaveOrOpenBlob(io(e,n),l)}function fo(e,l,n,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof e=="string")return Be(e,l,n);const a=e.type==="application/octet-stream",r=/constructor/i.test(String(st.HTMLElement))||"safari"in st,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||a&&r||it)&&typeof FileReader<"u"){const s=new FileReader;s.onloadend=function(){let c=s.result;if(typeof c!="string")throw o=null,new Error("Wrong reader.result type");c=i?c:c.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=c:location.assign(c),o=null},s.readAsDataURL(e)}else{const s=URL.createObjectURL(e);o?o.location.assign(s):location.href=s,o=null,setTimeout(function(){URL.revokeObjectURL(s)},4e4)}}function N(e,l){const n="🍍 "+e;typeof __VUE_DEVTOOLS_TOAST__=="function"?__VUE_DEVTOOLS_TOAST__(n,l):l==="error"?console.error(n):l==="warn"?console.warn(n):console.log(n)}function Le(e){return"_a"in e&&"install"in e}function dt(){if(!("clipboard"in navigator))return N("Your browser doesn't support the Clipboard API","error"),!0}function ut(e){return e instanceof Error&&e.message.toLowerCase().includes("document is not focused")?(N('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function po(e){if(!dt())try{await navigator.clipboard.writeText(JSON.stringify(e.state.value)),N("Global state copied to clipboard.")}catch(l){if(ut(l))return;N("Failed to serialize the state. Check the console for more details.","error"),console.error(l)}}async function mo(e){if(!dt())try{ft(e,JSON.parse(await navigator.clipboard.readText())),N("Global state pasted from clipboard.")}catch(l){if(ut(l))return;N("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(l)}}async function ho(e){try{ct(new Blob([JSON.stringify(e.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(l){N("Failed to export the state as JSON. Check the console for more details.","error"),console.error(l)}}let Z;function go(){Z||(Z=document.createElement("input"),Z.type="file",Z.accept=".json");function e(){return new Promise((l,n)=>{Z.onchange=async()=>{const o=Z.files;if(!o)return l(null);const a=o.item(0);return l(a?{text:await a.text(),file:a}:null)},Z.oncancel=()=>l(null),Z.onerror=n,Z.click()})}return e}async function bo(e){try{const n=await go()();if(!n)return;const{text:o,file:a}=n;ft(e,JSON.parse(o)),N(`Global state imported from "${a.name}".`)}catch(l){N("Failed to import the state from JSON. Check the console for more details.","error"),console.error(l)}}function ft(e,l){for(const n in l){const o=e.state.value[n];o?Object.assign(o,l[n]):e.state.value[n]=l[n]}}function H(e){return{_custom:{display:e}}}const pt="🍍 Pinia (root)",Ne="_root";function Co(e){return Le(e)?{id:Ne,label:pt}:{id:e.$id,label:e.$id}}function xo(e){if(Le(e)){const n=Array.from(e._s.keys()),o=e._s;return{state:n.map(r=>({editable:!0,key:r,value:e.state.value[r]})),getters:n.filter(r=>o.get(r)._getters).map(r=>{const i=o.get(r);return{editable:!1,key:r,value:i._getters.reduce((s,c)=>(s[c]=i[c],s),{})}})}}const l={state:Object.keys(e.$state).map(n=>({editable:!0,key:n,value:e.$state[n]}))};return e._getters&&e._getters.length&&(l.getters=e._getters.map(n=>({editable:!1,key:n,value:e[n]}))),e._customProperties.size&&(l.customProperties=Array.from(e._customProperties).map(n=>({editable:!0,key:n,value:e[n]}))),l}function vo(e){return e?Array.isArray(e)?e.reduce((l,n)=>(l.keys.push(n.key),l.operations.push(n.type),l.oldValue[n.key]=n.oldValue,l.newValue[n.key]=n.newValue,l),{oldValue:{},keys:[],operations:[],newValue:{}}):{operation:H(e.type),key:H(e.key),oldValue:e.oldValue,newValue:e.newValue}:{}}function yo(e){switch(e){case z.direct:return"mutation";case z.patchFunction:return"$patch";case z.patchObject:return"$patch";default:return"unknown"}}let te=!0;const xe=[],Q="pinia:mutations",F="pinia",{assign:wo}=Object,ve=e=>"🍍 "+e;function Eo(e,l){lt({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:xe,app:e},n=>{typeof n.now!="function"&&N("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),n.addTimelineLayer({id:Q,label:"Pinia 🍍",color:15064968}),n.addInspector({id:F,label:"Pinia 🍍",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{po(l)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await mo(l),n.sendInspectorTree(F),n.sendInspectorState(F)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{ho(l)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await bo(l),n.sendInspectorTree(F),n.sendInspectorState(F)},tooltip:"Import the state from a JSON file"}],nodeActions:[{icon:"restore",tooltip:'Reset the state (with "$reset")',action:o=>{const a=l._s.get(o);a?typeof a.$reset!="function"?N(`Cannot reset "${o}" store because it doesn't have a "$reset" method implemented.`,"warn"):(a.$reset(),N(`Store "${o}" reset.`)):N(`Cannot reset "${o}" store because it wasn't found.`,"warn")}}]}),n.on.inspectComponent((o,a)=>{const r=o.componentInstance&&o.componentInstance.proxy;if(r&&r._pStores){const i=o.componentInstance.proxy._pStores;Object.values(i).forEach(s=>{o.instanceData.state.push({type:ve(s.$id),key:"state",editable:!0,value:s._isOptionsAPI?{_custom:{value:t.toRaw(s.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>s.$reset()}]}}:Object.keys(s.$state).reduce((c,d)=>(c[d]=s.$state[d],c),{})}),s._getters&&s._getters.length&&o.instanceData.state.push({type:ve(s.$id),key:"getters",editable:!1,value:s._getters.reduce((c,d)=>{try{c[d]=s[d]}catch(u){c[d]=u}return c},{})})})}}),n.on.getInspectorTree(o=>{if(o.app===e&&o.inspectorId===F){let a=[l];a=a.concat(Array.from(l._s.values())),o.rootNodes=(o.filter?a.filter(r=>"$id"in r?r.$id.toLowerCase().includes(o.filter.toLowerCase()):pt.toLowerCase().includes(o.filter.toLowerCase())):a).map(Co)}}),n.on.getInspectorState(o=>{if(o.app===e&&o.inspectorId===F){const a=o.nodeId===Ne?l:l._s.get(o.nodeId);if(!a)return;a&&(o.state=xo(a))}}),n.on.editInspectorState((o,a)=>{if(o.app===e&&o.inspectorId===F){const r=o.nodeId===Ne?l:l._s.get(o.nodeId);if(!r)return N(`store "${o.nodeId}" not found`,"error");const{path:i}=o;Le(r)?i.unshift("state"):(i.length!==1||!r._customProperties.has(i[0])||i[0]in r.$state)&&i.unshift("$state"),te=!1,o.set(r,i,o.state.value),te=!0}}),n.on.editComponentState(o=>{if(o.type.startsWith("🍍")){const a=o.type.replace(/^🍍\s*/,""),r=l._s.get(a);if(!r)return N(`store "${a}" not found`,"error");const{path:i}=o;if(i[0]!=="state")return N(`Invalid path for store "${a}":
|
|
12
12
|
${i}
|
|
13
|
-
Only state can be modified.`);i[0]="$state",te=!1,o.set(r,i,o.state.value),te=!0}})})}function
|
|
13
|
+
Only state can be modified.`);i[0]="$state",te=!1,o.set(r,i,o.state.value),te=!0}})})}function _o(e,l){xe.includes(ve(l.$id))||xe.push(ve(l.$id)),lt({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:xe,app:e,settings:{logStoreChanges:{label:"Notify about new/deleted stores",type:"boolean",defaultValue:!0}}},n=>{const o=typeof n.now=="function"?n.now.bind(n):Date.now;l.$onAction(({after:i,onError:s,name:c,args:d})=>{const u=mt++;n.addTimelineEvent({layerId:Q,event:{time:o(),title:"🛫 "+c,subtitle:"start",data:{store:H(l.$id),action:H(c),args:d},groupId:u}}),i(m=>{W=void 0,n.addTimelineEvent({layerId:Q,event:{time:o(),title:"🛬 "+c,subtitle:"end",data:{store:H(l.$id),action:H(c),args:d,result:m},groupId:u}})}),s(m=>{W=void 0,n.addTimelineEvent({layerId:Q,event:{time:o(),logType:"error",title:"💥 "+c,subtitle:"end",data:{store:H(l.$id),action:H(c),args:d,error:m},groupId:u}})})},!0),l._customProperties.forEach(i=>{t.watch(()=>t.unref(l[i]),(s,c)=>{n.notifyComponentUpdate(),n.sendInspectorState(F),te&&n.addTimelineEvent({layerId:Q,event:{time:o(),title:"Change",subtitle:i,data:{newValue:s,oldValue:c},groupId:W}})},{deep:!0})}),l.$subscribe(({events:i,type:s},c)=>{if(n.notifyComponentUpdate(),n.sendInspectorState(F),!te)return;const d={time:o(),title:yo(s),data:wo({store:H(l.$id)},vo(i)),groupId:W};s===z.patchFunction?d.subtitle="⤵️":s===z.patchObject?d.subtitle="🧩":i&&!Array.isArray(i)&&(d.subtitle=i.type),i&&(d.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:i}}),n.addTimelineEvent({layerId:Q,event:d})},{detached:!0,flush:"sync"});const a=l._hotUpdate;l._hotUpdate=t.markRaw(i=>{a(i),n.addTimelineEvent({layerId:Q,event:{time:o(),title:"🔥 "+l.$id,subtitle:"HMR update",data:{store:H(l.$id),info:H("HMR update")}}}),n.notifyComponentUpdate(),n.sendInspectorTree(F),n.sendInspectorState(F)});const{$dispose:r}=l;l.$dispose=()=>{r(),n.notifyComponentUpdate(),n.sendInspectorTree(F),n.sendInspectorState(F),n.getSettings().logStoreChanges&&N(`Disposed "${l.$id}" store 🗑`)},n.notifyComponentUpdate(),n.sendInspectorTree(F),n.sendInspectorState(F),n.getSettings().logStoreChanges&&N(`"${l.$id}" store installed 🆕`)})}let mt=0,W;function ht(e,l,n){const o=l.reduce((a,r)=>(a[r]=t.toRaw(e)[r],a),{});for(const a in o)e[a]=function(){const r=mt,i=n?new Proxy(e,{get(...c){return W=r,Reflect.get(...c)},set(...c){return W=r,Reflect.set(...c)}}):e;W=r;const s=o[a].apply(i,arguments);return W=void 0,s}}function So({app:e,store:l,options:n}){if(l.$id.startsWith("__hot:"))return;l._isOptionsAPI=!!n.state,ht(l,Object.keys(n.actions),l._isOptionsAPI);const o=l._hotUpdate;t.toRaw(l)._hotUpdate=function(a){o.apply(this,arguments),ht(l,Object.keys(a._hmrPayload.actions),!!l._isOptionsAPI)},_o(e,l)}function ko(){const e=t.effectScope(!0),l=e.run(()=>t.ref({}));let n=[],o=[];const a=t.markRaw({install(r){ie(a),a._a=r,r.provide(at,a),r.config.globalProperties.$pinia=a,ce&&Eo(r,a),o.forEach(i=>n.push(i)),o=[]},use(r){return!this._a&&!nt?o.push(r):n.push(r),this},_p:n,_a:null,_e:e,_s:new Map,state:l});return ce&&typeof Proxy<"u"&&a.use(So),a}function gt(e,l){for(const n in l){const o=l[n];if(!(n in e))continue;const a=e[n];Y(a)&&Y(o)&&!t.isRef(o)&&!t.isReactive(o)?e[n]=gt(a,o):e[n]=o}return e}const bt=()=>{};function Ct(e,l,n,o=bt){e.push(l);const a=()=>{const r=e.indexOf(l);r>-1&&(e.splice(r,1),o())};return!n&&t.getCurrentScope()&&t.onScopeDispose(a),a}function ne(e,...l){e.slice().forEach(n=>{n(...l)})}const Vo=e=>e();function Me(e,l){e instanceof Map&&l instanceof Map&&l.forEach((n,o)=>e.set(o,n)),e instanceof Set&&l instanceof Set&&l.forEach(e.add,e);for(const n in l){if(!l.hasOwnProperty(n))continue;const o=l[n],a=e[n];Y(a)&&Y(o)&&e.hasOwnProperty(n)&&!t.isRef(o)&&!t.isReactive(o)?e[n]=Me(a,o):e[n]=o}return e}const Oo=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function $o(e){return!Y(e)||!e.hasOwnProperty(Oo)}const{assign:P}=Object;function xt(e){return!!(t.isRef(e)&&e.effect)}function vt(e,l,n,o){const{state:a,actions:r,getters:i}=l,s=n.state.value[e];let c;function d(){!s&&(process.env.NODE_ENV==="production"||!o)&&(n.state.value[e]=a?a():{});const u=process.env.NODE_ENV!=="production"&&o?t.toRefs(t.ref(a?a():{}).value):t.toRefs(n.state.value[e]);return P(u,r,Object.keys(i||{}).reduce((m,b)=>(process.env.NODE_ENV!=="production"&&b in u&&console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${b}" in store "${e}".`),m[b]=t.markRaw(t.computed(()=>{ie(n);const y=n._s.get(e);return i[b].call(y,y)})),m),{}))}return c=Re(e,d,l,n,o,!0),c}function Re(e,l,n={},o,a,r){let i;const s=P({actions:{}},n);if(process.env.NODE_ENV!=="production"&&!o._e.active)throw new Error("Pinia destroyed");const c={deep:!0};process.env.NODE_ENV!=="production"&&!nt&&(c.onTrigger=f=>{d?y=f:d==!1&&!C._hotUpdating&&(Array.isArray(y)?y.push(f):console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let d,u,m=[],b=[],y;const g=o.state.value[e];!r&&!g&&(process.env.NODE_ENV==="production"||!a)&&(o.state.value[e]={});const w=t.ref({});let I;function _(f){let p;d=u=!1,process.env.NODE_ENV!=="production"&&(y=[]),typeof f=="function"?(f(o.state.value[e]),p={type:z.patchFunction,storeId:e,events:y}):(Me(o.state.value[e],f),p={type:z.patchObject,payload:f,storeId:e,events:y});const E=I=Symbol();t.nextTick().then(()=>{I===E&&(d=!0)}),u=!0,ne(m,p,o.state.value[e])}const x=r?function(){const{state:p}=n,E=p?p():{};this.$patch(S=>{P(S,E)})}:process.env.NODE_ENV!=="production"?()=>{throw new Error(`🍍: Store "${e}" is built using the setup syntax and does not implement $reset().`)}:bt;function $(){i.stop(),m=[],b=[],o._s.delete(e)}function B(f,p){return function(){ie(o);const E=Array.from(arguments),S=[],T=[];function L(M){S.push(M)}function D(M){T.push(M)}ne(b,{args:E,name:f,store:C,after:L,onError:D});let j;try{j=p.apply(this&&this.$id===e?this:C,E)}catch(M){throw ne(T,M),M}return j instanceof Promise?j.then(M=>(ne(S,M),M)).catch(M=>(ne(T,M),Promise.reject(M))):(ne(S,j),j)}}const v=t.markRaw({actions:{},getters:{},state:[],hotState:w}),k={_p:o,$id:e,$onAction:Ct.bind(null,b),$patch:_,$reset:x,$subscribe(f,p={}){const E=Ct(m,f,p.detached,()=>S()),S=i.run(()=>t.watch(()=>o.state.value[e],T=>{(p.flush==="sync"?u:d)&&f({storeId:e,type:z.direct,events:y},T)},P({},c,p)));return E},$dispose:$},C=t.reactive(process.env.NODE_ENV!=="production"||ce?P({_hmrPayload:v,_customProperties:t.markRaw(new Set)},k):k);o._s.set(e,C);const V=(o._a&&o._a.runWithContext||Vo)(()=>o._e.run(()=>(i=t.effectScope()).run(l)));for(const f in V){const p=V[f];if(t.isRef(p)&&!xt(p)||t.isReactive(p))process.env.NODE_ENV!=="production"&&a?he(w.value,f,t.toRef(V,f)):r||(g&&$o(p)&&(t.isRef(p)?p.value=g[f]:Me(p,g[f])),o.state.value[e][f]=p),process.env.NODE_ENV!=="production"&&v.state.push(f);else if(typeof p=="function"){const E=process.env.NODE_ENV!=="production"&&a?p:B(f,p);V[f]=E,process.env.NODE_ENV!=="production"&&(v.actions[f]=p),s.actions[f]=p}else process.env.NODE_ENV!=="production"&&xt(p)&&(v.getters[f]=r?n.getters[f]:p,ge&&(V._getters||(V._getters=t.markRaw([]))).push(f))}if(P(C,V),P(t.toRaw(C),V),Object.defineProperty(C,"$state",{get:()=>process.env.NODE_ENV!=="production"&&a?w.value:o.state.value[e],set:f=>{if(process.env.NODE_ENV!=="production"&&a)throw new Error("cannot set hotState");_(p=>{P(p,f)})}}),process.env.NODE_ENV!=="production"&&(C._hotUpdate=t.markRaw(f=>{C._hotUpdating=!0,f._hmrPayload.state.forEach(p=>{if(p in C.$state){const E=f.$state[p],S=C.$state[p];typeof E=="object"&&Y(E)&&Y(S)?gt(E,S):f.$state[p]=S}he(C,p,t.toRef(f.$state,p))}),Object.keys(C.$state).forEach(p=>{p in f.$state||Te(C,p)}),d=!1,u=!1,o.state.value[e]=t.toRef(f._hmrPayload,"hotState"),u=!0,t.nextTick().then(()=>{d=!0});for(const p in f._hmrPayload.actions){const E=f[p];he(C,p,B(p,E))}for(const p in f._hmrPayload.getters){const E=f._hmrPayload.getters[p],S=r?t.computed(()=>(ie(o),E.call(C,C))):E;he(C,p,S)}Object.keys(C._hmrPayload.getters).forEach(p=>{p in f._hmrPayload.getters||Te(C,p)}),Object.keys(C._hmrPayload.actions).forEach(p=>{p in f._hmrPayload.actions||Te(C,p)}),C._hmrPayload=f._hmrPayload,C._getters=f._getters,C._hotUpdating=!1})),ce){const f={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(p=>{Object.defineProperty(C,p,P({value:C[p]},f))})}return o._p.forEach(f=>{if(ce){const p=i.run(()=>f({store:C,app:o._a,pinia:o,options:s}));Object.keys(p||{}).forEach(E=>C._customProperties.add(E)),P(C,p)}else P(C,i.run(()=>f({store:C,app:o._a,pinia:o,options:s})))}),process.env.NODE_ENV!=="production"&&C.$state&&typeof C.$state=="object"&&typeof C.$state.constructor=="function"&&!C.$state.constructor.toString().includes("[native code]")&&console.warn(`[🍍]: The "state" must be a plain object. It cannot be
|
|
14
14
|
state: () => new MyClass()
|
|
15
15
|
Found in store "${C.$id}".`),g&&r&&n.hydrate&&n.hydrate(C.$state,g),d=!0,u=!0,C}function ye(e,l,n){let o,a;const r=typeof l=="function";if(typeof e=="string")o=e,a=r?n:l;else if(a=e,o=e.id,process.env.NODE_ENV!=="production"&&typeof o!="string")throw new Error('[🍍]: "defineStore()" must be passed a store id as its first argument.');function i(s,c){const d=t.hasInjectionContext();if(s=(process.env.NODE_ENV==="test"&&re&&re._testing?null:s)||(d?t.inject(at,null):null),s&&ie(s),process.env.NODE_ENV!=="production"&&!re)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.`);s=re,s._s.has(o)||(r?Re(o,l,a,s):vt(o,a,s),process.env.NODE_ENV!=="production"&&(i._pinia=s));const u=s._s.get(o);if(process.env.NODE_ENV!=="production"&&c){const m="__hot:"+o,b=r?Re(m,l,a,s,!0):vt(m,P({},a),s,!0);c._hotUpdate(b),delete s.state.value[m],s._s.delete(m)}if(process.env.NODE_ENV!=="production"&&ge){const m=t.getCurrentInstance();if(m&&m.proxy&&!c){const b=m.proxy,y="_pStores"in b?b._pStores:b._pStores={};y[o]=u}}return u}return i.$id=o,i}const de=ye("loader",()=>{const e=t.ref({translation:!1,aiExplanation:!1});return{loadingStates:e,setLoading:(o,a)=>{e.value[o]=a},isLoading:o=>e.value[o]}}),yt={__name:"Select",props:t.mergeModels({languages:{type:Object,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=de(),n=e,o=t.useModel(e,"modelValue"),a=t.ref(""),r=t.ref(null),i=t.computed(()=>Object.entries(n.languages).filter(([,c])=>c.toLowerCase().includes(a.value.toLowerCase()))),s=c=>{c.target.value="",a.value="",r.value&&r.value.$el.click()};return(c,d)=>(t.openBlock(),t.createBlock(t.unref(Wn),{modelValue:o.value,"onUpdate:modelValue":d[3]||(d[3]=u=>o.value=u),disabled:t.unref(l).loading,as:"div",class:"relative mt-1"},{default:t.withCtx(()=>[t.createVNode(t.unref(qn),{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=>s(u))},null,8,["displayValue"]),t.createVNode(t.unref(Gn),{ref_key:"btnSelect",ref:r,class:"absolute inset-y-0 right-0 flex items-center pr-2"},{default:t.withCtx(()=>[t.createVNode(t.unref(Qn),{class:"h-5 w-5 text-gray-400","aria-hidden":"true",onClick:d[2]||(d[2]=u=>s(u))})]),_:1},512),t.createVNode(t.unref(Jn),{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,m])=>(t.openBlock(),t.createBlock(t.unref(Kn),{key:u,value:u},{default:t.withCtx(({active:b,selected:y})=>[t.createElementVNode("li",{class:t.normalizeClass(["relative cursor-default select-none py-2 pl-3 pr-9",b?"bg-[#3B5695] text-white":"text-textCustom"])},[t.createElementVNode("span",{class:t.normalizeClass(["block truncate",y&&"font-semibold"])},t.toDisplayString(m),3)],2)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue","disabled"]))}},wt="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",$o=["disabled"],To=[t.createElementVNode("img",{src:wt,alt:"swap",class:"w-4"},null,-1)],Io=["disabled"],Bo=[t.createElementVNode("img",{src:wt,alt:"swap",class:"w-4"},null,-1)],Lo={__name:"SwapBtn",props:{isBidirect:{type:Boolean,default:!1}},emits:["swap"],setup(e,{emit:l}){const n=de(),o=t.computed(()=>n.isLoading("translation")),a=l;return(r,i)=>e.isBidirect?(t.openBlock(),t.createElementBlock("button",{key:1,onClick:i[0]||(i[0]=s=>a("swap")),disabled:o.value},Bo,8,Io)):(t.openBlock(),t.createElementBlock("button",{key:0,disabled:o.value},To,8,$o))}},we=ye("language",()=>{const e=t.ref("auto"),l=t.ref("en"),n=t.ref({src:[],target:[]}),o=t.computed(()=>n.value.src[e.value]),a=t.computed(()=>n.value.target[l.value]);function r(c,d){e.value=c==null?void 0:c.src,l.value=c==null?void 0:c.target,n.value=d}function i(){if(!n.value.src[l.value]||!n.value.target[e.value])return;const c=e.value;e.value=l.value,l.value=c}function s(c){return n.value.src[c]||n.value.target[c]}return{languages:n,src:e,target:l,srcLabel:o,targetLabel:a,init:r,swap:i,getLabel:s}}),No={key:0,class:"flex flex-col"},Mo={class:"flex"},Ro={class:"grow flex flex-col"},Fo={key:0,class:"flex mt-1 space-x-1"},Ao=["onClick"],Po={class:"grow flex flex-col"},Do={key:0,class:"flex mt-1 space-x-1"},jo=["onClick"],Ho={__name:"Selects",setup(e){const l=we(),n=t.ref([]),o=t.ref([]);function a(){l.swap()}return t.onMounted(()=>{n.value=ue.getLocalStorage("recentSrc")||[],o.value=ue.getLocalStorage("recentTarget")||[]}),t.watch(()=>l.src,r=>{n.value.includes(r)||(n.value.unshift(r),n.value=n.value.slice(0,3),ue.setLocalStorage("recentSrc",n.value))}),t.watch(()=>l.target,r=>{o.value.includes(r)||(o.value.unshift(r),o.value=o.value.slice(0,3),ue.setLocalStorage("recentTarget",o.value))}),(r,i)=>t.unref(l).languages?(t.openBlock(),t.createElementBlock("div",No,[t.createElementVNode("div",Mo,[t.createElementVNode("div",Ro,[t.createVNode(yt,{modelValue:t.unref(l).src,"onUpdate:modelValue":i[0]||(i[0]=s=>t.unref(l).src=s),languages:t.unref(l).languages.src,class:"grow"},null,8,["modelValue","languages"]),n.value.length>0?(t.openBlock(),t.createElementBlock("div",Fo,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,s=>(t.openBlock(),t.createElementBlock("button",{key:s,class:"px-2 py-0.5 bg-baseColor border border-primaryColor text-primaryColor text-xs rounded-full hover:bg-primaryColor hover:text-baseColor transition-colors duration-200",onClick:c=>t.unref(l).src=s},t.toDisplayString(t.unref(l).languages.src[s]),9,Ao))),128))])):t.createCommentVNode("",!0)]),t.createVNode(Lo,{isBidirect:t.unref(l).src!=="auto",class:"grow-0 mx-3 mt-4 self-start",onSwap:a},null,8,["isBidirect"]),t.createElementVNode("div",Po,[t.createVNode(yt,{modelValue:t.unref(l).target,"onUpdate:modelValue":i[1]||(i[1]=s=>t.unref(l).target=s),languages:t.unref(l).languages.target,class:"grow"},null,8,["modelValue","languages"]),o.value.length>0?(t.openBlock(),t.createElementBlock("div",Do,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.value,s=>(t.openBlock(),t.createElementBlock("button",{key:s,class:"px-2 py-0.5 bg-baseColor border border-primaryColor text-primaryColor text-xs rounded-full hover:bg-primaryColor hover:text-baseColor transition-colors duration-200",onClick:c=>t.unref(l).target=s},t.toDisplayString(t.unref(l).languages.target[s]),9,jo))),128))])):t.createCommentVNode("",!0)])])])):t.createCommentVNode("",!0)}},zo={INPUT_MAX_LENGTH:5e3,INPUT_DEBOUNCE:500},Ee=(e,l)=>{const n=e.__vccOpts||e;for(const[o,a]of l)n[o]=a;return n},Uo={},Zo={class:"mr-2 loading loading-dots loading-xs"};function Wo(e,l){return t.openBlock(),t.createElementBlock("span",Zo)}const Et=Ee(Uo,[["render",Wo]]),_t=ye("tts",()=>{const e=t.ref({src:null,target:null});function l(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 o(){e.value={src:null,target:null}}return{tts:e,set:l,get:n,reset:o}}),Go="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",qo="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",Jo=["disabled"],Ko=["src"],Yo=["src"],Qo={__name:"SpeakBtn",props:{type:{type:String,default:""},disabled:Boolean},emits:["loadTTS"],setup(e,{emit:l}){const n=_t(),o=e,a=l,r=t.computed(()=>n.tts[o.type]),i=t.ref(!1),s=new Audio;t.watch(r,()=>{if(!r.value){i.value=!1;return}d()},{immediate:!0}),t.onUnmounted(()=>{u(),s.src=""});function c(){if(r.value){d();return}i.value=!0,a("loadTTS")}function d(){r.value&&(s.src=r.value,i.value=!0,s.play().catch(()=>{i.value=!1}))}function u(){s.pause(),s.currentTime=0,i.value=!1}return s.onended=()=>{i.value=!1},(m,b)=>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(qo),alt:"Stop",class:"w-4 transition-all duration-200"},null,8,Yo)])):(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(Go),alt:"Play",class:t.normalizeClass(["w-4 transition-all duration-200",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,Ko)],10,Jo))}},Xo="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",e2={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"},t2=["disabled"],n2=["src"],o2={__name:"ClearBtn",props:{disabled:Boolean},setup(e){return(l,n)=>(t.openBlock(),t.createElementBlock("div",e2,[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(Xo),alt:"Clear",class:t.normalizeClass(["w-4 transition-all duration-200",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,n2)],10,t2)]))}},l2="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",a2="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",s2={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"},r2=["disabled"],i2=["src"],c2={__name:"FavoriteBtn",props:{disabled:Boolean,isFilled:Boolean},setup(e){return(l,n)=>(t.openBlock(),t.createElementBlock("div",s2,[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(l2):t.unref(a2),alt:"Favorite",class:t.normalizeClass(["w-4 transition-all duration-200",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,i2)],10,r2)]))}},d2="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",u2="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",f2={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":"AI Translate"},p2=["disabled"],m2=["src"],St={__name:"AIBtn",props:{disabled:Boolean,isFilled:Boolean},setup(e){return(l,n)=>(t.openBlock(),t.createElementBlock("div",f2,[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(d2):t.unref(u2),alt:"AI",class:t.normalizeClass(["w-4 transition-all duration-200",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,m2)],10,p2)]))}},h2="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='%231A1F2A'/%3e%3c/svg%3e",g2=["data-tip"],b2=["disabled"],C2=["src"],x2={__name:"CopyBtn",props:{disabled:Boolean},setup(e){const l=t.ref("Copy"),n=()=>{l.value="Copied",setTimeout(()=>{l.value="Copy"},1e3)};return(o,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":l.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(h2),alt:"Copy",class:t.normalizeClass(["w-3 transition-all duration-200",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,C2)],10,b2)],8,g2))}},v2={class:"flex flex-row px-2 pr-10 pt-1 items-center bg-transparent relative"},y2={class:"ml-1 text-sm text-gray-600"},w2={key:0,class:"italic"},E2={class:"absolute right-1 top-1 flex flex-col items-center gap-0"},kt=Ee({__name:"TranslationBtnGroup",props:{loading:{type:Boolean,default:!1},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},hasDictionary:{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:l}){const n=e,o=l;return(a,r)=>(t.openBlock(),t.createElementBlock("div",v2,[n.src?(t.openBlock(),t.createBlock(Qo,{key:0,type:n.type,onLoadTTS:r[0]||(r[0]=i=>o("loadTTS"))},null,8,["type"])):t.createCommentVNode("",!0),t.createElementVNode("div",y2,[t.createTextVNode(t.toDisplayString(e.srcLabel)+" ",1),e.phonetic?(t.openBlock(),t.createElementBlock("span",w2,"- ["+t.toDisplayString(n.phonetic)+"]",1)):t.createCommentVNode("",!0)]),n.loading?(t.openBlock(),t.createBlock(Et,{key:1,class:"absolute right-6 top-2"})):t.createCommentVNode("",!0),t.createElementVNode("div",E2,[e.hasClearBtn&&e.src?(t.openBlock(),t.createBlock(o2,{key:0,onClick:r[1]||(r[1]=i=>o("clear")),disabled:e.loading},null,8,["disabled"])):t.createCommentVNode("",!0),e.src&&!e.hasDictionary&&e.hasAIBtn?(t.openBlock(),t.createBlock(St,{key:1,isFilled:e.isAITranslate,onClick:r[2]||(r[2]=i=>o("aiTranslate")),disabled:e.loading},null,8,["isFilled","disabled"])):t.createCommentVNode("",!0),e.src&&e.hasFavoriteBtn?(t.openBlock(),t.createBlock(c2,{key:2,isFilled:e.isFavorite,onClick:r[3]||(r[3]=i=>o("favorite")),disabled:e.loading},null,8,["isFilled","disabled"])):t.createCommentVNode("",!0),e.src&&e.hasCopyBtn?(t.openBlock(),t.createBlock(x2,{key:3,onClick:r[4]||(r[4]=i=>o("copy")),disabled:e.loading},null,8,["disabled"])):t.createCommentVNode("",!0)])]))}},[["__scopeId","data-v-c9ef8858"]]),X=ye("translation",()=>{const e=t.ref(null),l=t.ref(null),n=t.ref(null),o=t.ref({src:null,target:null}),a=t.ref(null),r=t.ref([]),i=t.ref([]),s=t.ref([]),c=t.ref([]),d=t.ref({src:null,target:null}),u=we(),m=t.computed(()=>u.getLabel(e.value)),b=t.computed(()=>u.getLabel(l.value));function y(w){e.value=w.src,l.value=w.target,n.value=w.text,o.value=w.phonetic,a.value=w.result,r.value=w.dictionary,i.value=w.definitions,s.value=w.synonyms,c.value=w.examples,d.value=w.tts}function g(){e.value=null,l.value=null,n.value=null,o.value={src:null,target:null},a.value=null,r.value=[],i.value=[],s.value=[],c.value=[],d.value={src:null,target:null}}return{src:e,srcLabel:m,target:l,targetLabel:b,phonetic:o,text:n,result:a,dictionary:r,definitions:i,synonyms:s,examples:c,tts:d,init:y,reset:g}});function _2(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}function _e(e){return typeof e=="function"?e():t.unref(e)}const S2=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Vt=()=>{};function k2(e,l){function n(...o){return new Promise((a,r)=>{Promise.resolve(e(()=>l.apply(this,o),{fn:l,thisArg:this,args:o})).then(a).catch(r)})}return n}function V2(e,l={}){let n,o,a=Vt;const r=s=>{clearTimeout(s),a(),a=Vt};return s=>{const c=_e(e),d=_e(l.maxWait);return n&&r(n),c<=0||d!==void 0&&d<=0?(o&&(r(o),o=null),Promise.resolve(s())):new Promise((u,m)=>{a=l.rejectOnCancel?m:u,d&&!o&&(o=setTimeout(()=>{n&&r(n),o=null,u(s())},d)),n=setTimeout(()=>{o&&r(o),o=null,u(s())},c)})}}function O2(e,l=200,n={}){return k2(V2(l,n),e)}function Ot(e){var l;const n=_e(e);return(l=n==null?void 0:n.$el)!=null?l:n}const $2=S2?window:void 0;function T2(){const e=t.ref(!1),l=t.getCurrentInstance();return l&&t.onMounted(()=>{e.value=!0},l),e}function I2(e){const l=T2();return t.computed(()=>(l.value,!!e()))}function B2(e,l,n={}){const{window:o=$2,...a}=n;let r;const i=I2(()=>o&&"ResizeObserver"in o),s=()=>{r&&(r.disconnect(),r=void 0)},c=t.computed(()=>Array.isArray(e)?e.map(m=>Ot(m)):[Ot(e)]),d=t.watch(c,m=>{if(s(),i.value&&o){r=new ResizeObserver(l);for(const b of m)b&&r.observe(b,a)}},{immediate:!0,flush:"post"}),u=()=>{s(),d()};return _2(u),{isSupported:i,stop:u}}function $t(e){var l;const n=t.ref(e==null?void 0:e.element),o=t.ref(e==null?void 0:e.input),a=(l=e==null?void 0:e.styleProp)!=null?l:"height",r=t.ref(1);function i(){var s;if(!n.value)return;let c="";n.value.style[a]="1px",r.value=(s=n.value)==null?void 0:s.scrollHeight,e!=null&&e.styleTarget?_e(e.styleTarget).style[a]=`${r.value}px`:c=`${r.value}px`,n.value.style[a]=c}return t.watch([o,n],()=>t.nextTick(i),{immediate:!0}),t.watch(r,()=>{var s;return(s=e==null?void 0:e.onResize)==null?void 0:s.call(e)}),B2(n,()=>i()),e!=null&&e.watch&&t.watch(e.watch,i,{immediate:!0,deep:!0}),{textarea:n,input:o,triggerResize:i}}const L2={class:"bg-white relative z-10 border rounded-md"},N2=Ee({__name:"TranslationInput",props:{text:{type:String,default:""}},emits:["change","clear","loadTTS"],setup(e,{emit:l}){const n=X(),o=e,a=t.ref(""),r=t.computed(()=>n.src),i=t.computed(()=>n.srcLabel),s=t.computed(()=>{var g;return(g=n.phonetic)==null?void 0:g.src}),{textarea:c}=$t({input:a,styleProp:"minHeight"}),d=l,u=O2(()=>{d("change",a.value)},zo.INPUT_DEBOUNCE);function m(){if(!a.value){b();return}u()}function b(){d("clear"),a.value="",c.value.focus()}async function y(){await t.nextTick(),c.value.select()}return t.watch(()=>o.text,g=>{a.value!==g&&y(),a.value=g}),(g,w)=>(t.openBlock(),t.createElementBlock("div",L2,[t.createVNode(kt,{src:r.value,srcLabel:i.value,type:"src",phonetic:s.value,hasClearBtn:!0,onClear:b,onLoadTTS:w[0]||(w[0]=I=>d("loadTTS")),class:"mb-2"},null,8,["src","srcLabel","phonetic"]),t.withDirectives(t.createElementVNode("textarea",{ref_key:"textarea",ref:c,"onUpdate:modelValue":w[1]||(w[1]=I=>a.value=I),class:"w-full outline-none px-5 pr-8 bg-transparent text-gray-800 resize-none pb-3 overflow-x-hidden overflow-y-hidden",autofocus:"",rows:"2",onInput:m,onFocus:y},null,544),[[t.vModelText,a.value,void 0,{trim:!0}]])]))}},[["__scopeId","data-v-3d7638d0"]]),M2=e=>(t.pushScopeId("data-v-7c33874e"),e=e(),t.popScopeId(),e),R2={class:"bg-white relative z-10 rounded-md h-full"},F2={class:"bg-transparent"},A2={key:0,class:"w-full flex items-center justify-end absolute -bottom-8 left-2 right-0 px-2 z-20"},P2=M2(()=>t.createElementVNode("span",{class:"text-sm text-gray-600"}," Powered by Ddict AI ",-1)),D2=Ee({__name:"TranslationResult",props:{isFavoriteFeatureEnabled:Boolean,isAITranslateFeatureEnabled:Boolean,isAITranslate:Boolean,isFavorite:Boolean},emits:["loadTTS","favorite","aiTranslate","copy"],setup(e,{emit:l}){const n=X(),o=t.computed(()=>n.result),a=t.computed(()=>n.target),r=t.computed(()=>n.targetLabel),i=t.computed(()=>{var y;return(y=n.phonetic)==null?void 0:y.target}),s=t.computed(()=>{var y;return!!((y=n.dictionary)!=null&&y.length)}),c=de(),d=t.computed(()=>c.isLoading("translation")),{textarea:u,input:m}=$t({input:o,styleProp:"minHeight"}),b=l;return(y,g)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["relative p-0.5 transition-all duration-300 ease-in-out bg-[length:300%_300%] bg-[position:0%_50%] border rounded-lg",{"bg-gradient-to-br from-[#8556f0] via-[#d6b379] via-[#6bedd1] to-[#439beb] animate-moveGradient border border-white":e.isAITranslate&&!d.value}])},[t.createElementVNode("div",R2,[t.createVNode(kt,{loading:d.value,src:a.value,srcLabel:r.value,type:"target",hasFavoriteBtn:e.isFavoriteFeatureEnabled,hasAIBtn:e.isAITranslateFeatureEnabled,hasCopyBtn:!0,isFavorite:e.isFavorite,isAITranslate:e.isAITranslate,hasDictionary:s.value,phonetic:i.value,onFavorite:g[0]||(g[0]=w=>b("favorite")),onLoadTTS:g[1]||(g[1]=w=>b("loadTTS")),onAiTranslate:g[2]||(g[2]=w=>b("aiTranslate")),onCopy:g[3]||(g[3]=w=>b("copy")),class:"mb-2"},null,8,["loading","src","srcLabel","hasFavoriteBtn","hasAIBtn","isFavorite","isAITranslate","hasDictionary","phonetic"]),t.createElementVNode("div",F2,[t.withDirectives(t.createElementVNode("textarea",{ref_key:"textarea",ref:u,"onUpdate:modelValue":g[4]||(g[4]=w=>t.isRef(m)?m.value=w:null),class:"w-full outline-none px-5 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(m)]])])]),e.isAITranslate?(t.openBlock(),t.createElementBlock("div",A2,[P2,t.createVNode(St,{disabled:"",isFilled:""})])):t.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-7c33874e"]]),j2={class:"btn btn-sm btn-circle btn-ghost"},Se={__name:"ToggleBtn",props:{isExpanded:Boolean},setup(e){const l=e;return(n,o)=>(t.openBlock(),t.createElementBlock("button",j2,[l.isExpanded?(t.openBlock(),t.createBlock(t.unref(Xn),{key:0,class:"w-7 text-gray-400"})):(t.openBlock(),t.createBlock(t.unref(Yn),{key:1,class:"w-7 text-gray-400"}))]))}},H2={class:"card border bg-white rounded-lg"},z2={class:"card-body px-4 py-2 gap-0"},U2={class:"flex justify-between items-center"},Z2=t.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Translations",-1),W2={class:"capitalize text-base font-normal text-textSecondary mb-1"},G2={class:"list-none list-inside"},q2=["onClick"],J2={class:"text-base font-normal text-gray-800 leading-4"},K2={__name:"Dictionary",emits:["translate"],setup(e,{emit:l}){const n=t.ref(!0),o=X(),a=we(),r=t.computed(()=>o.dictionary),i=l,s=()=>{n.value=!n.value},c=d=>{i("translate",d,o.target,o.src),a.src=o.target,a.target=o.src,window.scrollTo(0,0)};return(d,u)=>(t.openBlock(),t.createElementBlock("div",H2,[t.createElementVNode("div",z2,[t.createElementVNode("div",U2,[Z2,t.createVNode(Se,{isExpanded:n.value,onClick:s},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",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(r.value,(m,b)=>(t.openBlock(),t.createElementBlock("li",{key:`${m.pos}-${b}`,class:"mb-2"},[t.createElementVNode("h5",W2,t.toDisplayString(m.pos),1),t.createElementVNode("ul",G2,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.items,(y,g)=>(t.openBlock(),t.createElementBlock("li",{key:`${y.word}-${g}`},[t.createElementVNode("span",{class:"p-3 m-0.5 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded-lg",onClick:w=>c(y.word)},t.toDisplayString(y.word),9,q2),t.createElementVNode("small",J2," - "+t.toDisplayString(y.reverse_translation.join(", ")),1)]))),128))])]))),128))])],2)])]))}},Y2={class:"card border bg-white rounded-lg"},Q2={class:"card-body px-4 py-2 gap-0"},X2={class:"flex justify-between items-center"},e0=t.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Definitions",-1),t0={class:"capitalize text-base font-normal text-textSecondary mb-1"},n0={class:"text-base text-textCustom list-decimal list-outside ml-5"},o0=t.createElementVNode("br",null,null,-1),l0={key:0,class:"italic"},a0={__name:"Definition",setup(e){const l=t.ref(!0),n=X(),o=t.computed(()=>n.definitions),a=()=>{l.value=!l.value};return(r,i)=>(t.openBlock(),t.createElementBlock("div",Y2,[t.createElementVNode("div",Q2,[t.createElementVNode("div",X2,[e0,t.createVNode(Se,{isExpanded:l.value,onClick:a},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",l.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(o.value,(s,c)=>(t.openBlock(),t.createElementBlock("li",{key:`${s.pos}-${c}`,class:"mb-2"},[t.createElementVNode("h5",t0,t.toDisplayString(s.pos),1),t.createElementVNode("ul",n0,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.items,(d,u)=>(t.openBlock(),t.createElementBlock("li",{key:`${d.gloss}-${u}`,class:"mb-1"},[t.createElementVNode("span",null,t.toDisplayString(d.gloss),1),o0,d.example?(t.openBlock(),t.createElementBlock("small",l0,'"'+t.toDisplayString(d.example)+'"',1)):t.createCommentVNode("",!0)]))),128))])]))),128))])],2)])]))}},s0={class:"card border bg-white rounded-lg"},r0={class:"card-body px-4 py-2 gap-0"},i0={class:"flex justify-between items-center"},c0=t.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Examples",-1),d0={class:"text-textCustom list-decimal list-outside ml-7 my-2"},u0=["innerHTML"],f0={__name:"Example",setup(e){const l=t.ref(!0),n=X(),o=t.computed(()=>n.examples),a=()=>{l.value=!l.value};return(r,i)=>(t.openBlock(),t.createElementBlock("div",s0,[t.createElementVNode("div",r0,[t.createElementVNode("div",i0,[c0,t.createVNode(Se,{isExpanded:l.value,onClick:a},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",l.value?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"])},[t.createElementVNode("ul",d0,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.value,(s,c)=>(t.openBlock(),t.createElementBlock("li",{key:`${s.definition_id}-${c}`,innerHTML:s},null,8,u0))),128))])],2)])]))}},p0={class:"card border bg-white rounded-lg"},m0={class:"card-body px-4 py-2 gap-0"},h0={class:"flex justify-between items-center"},g0=t.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Synonyms",-1),b0={class:"capitalize text-base font-normal text-textSecondary mb-1"},C0={class:"list-none list-inside"},x0={class:"flex flex-wrap"},v0=["onClick"],y0={__name:"Synonyms",emits:["translate"],setup(e,{emit:l}){const n=t.ref(!0),o=X(),a=t.computed(()=>o.synonyms),r=l,i=()=>{n.value=!n.value},s=c=>{r("translate",c),window.scrollTo(0,0)};return(c,d)=>(t.openBlock(),t.createElementBlock("div",p0,[t.createElementVNode("div",m0,[t.createElementVNode("div",h0,[g0,t.createVNode(Se,{isExpanded:n.value,onClick:i},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",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,m)=>(t.openBlock(),t.createElementBlock("li",{key:`${u.pos}-${m}`,class:"mb-2"},[t.createElementVNode("h5",b0,t.toDisplayString(u.pos),1),t.createElementVNode("ul",C0,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.items,(b,y)=>(t.openBlock(),t.createElementBlock("li",{key:`${b.word}-${y}`,class:"mb-2"},[t.createElementVNode("div",x0,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(b.synonym,(g,w)=>(t.openBlock(),t.createElementBlock("span",{key:`${g}-${w}`,class:"p-3 m-0.5 ml-0 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded-lg",onClick:I=>s(g)},t.toDisplayString(g),9,v0))),128))])]))),128))])]))),128))])],2)])]))}},w0="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",E0="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",_0=["disabled"],S0=["src"],k0={__name:"ChevronAIBtn",props:{disabled:Boolean,isExpanded:Boolean},setup(e){return(l,n)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["btn btn-sm 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(w0):t.unref(E0),alt:"AI",class:t.normalizeClass(["w-6 transition-all duration-200",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,S0)],10,_0))}},V0={class:"card-body bg-white px-4 py-2 gap-0 relative z-10 rounded-md"},O0={class:"flex justify-between items-center"},$0=t.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"AI Summary",-1),T0={class:"flex items-center"},I0={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":"AI Summarize"},B0={key:0,class:"text-textCustom list-none list-outside my-2"},L0=["innerHTML"],N0={__name:"AIExplanation",props:{isAIExplain:{type:Boolean,default:!1,required:!0},explanation:{type:Object,required:!0}},emits:["aiExplain"],setup(e,{emit:l}){const n=de(),o=t.computed(()=>n.isLoading("aiExplanation")),a=l,r=()=>{a("aiExplain")};return(i,s)=>{var c,d;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["card border bg-white rounded-lg mb-8",["relative p-0.5 transition-all duration-300 ease-in-out bg-[length:300%_300%] bg-[position:0%_50%] border rounded-lg",{"bg-gradient-to-br from-[#8556f0] via-[#d6b379] via-[#6bedd1] to-[#439beb] animate-moveGradient border border-white":e.isAIExplain}]])},[t.createElementVNode("div",V0,[t.createElementVNode("div",O0,[$0,t.createElementVNode("div",T0,[o.value?(t.openBlock(),t.createBlock(Et,{key:0})):t.createCommentVNode("",!0),t.createElementVNode("div",I0,[t.createVNode(k0,{isExpanded:e.isAIExplain,disabled:o.value,onClick:r},null,8,["isExpanded","disabled"])])])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",e.isAIExplain?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"])},[(c=e.explanation)!=null&&c.result?(t.openBlock(),t.createElementBlock("ul",B0,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(((d=e.explanation)==null?void 0:d.result.split(`
|
|
18
|
-
`))||[],(u,m)=>(t.openBlock(),t.createElementBlock("li",{key:`${u}-${m}`,innerHTML:u},null,8,
|
|
17
|
+
This will fail in production.`);s=re,s._s.has(o)||(r?Re(o,l,a,s):vt(o,a,s),process.env.NODE_ENV!=="production"&&(i._pinia=s));const u=s._s.get(o);if(process.env.NODE_ENV!=="production"&&c){const m="__hot:"+o,b=r?Re(m,l,a,s,!0):vt(m,P({},a),s,!0);c._hotUpdate(b),delete s.state.value[m],s._s.delete(m)}if(process.env.NODE_ENV!=="production"&&ge){const m=t.getCurrentInstance();if(m&&m.proxy&&!c){const b=m.proxy,y="_pStores"in b?b._pStores:b._pStores={};y[o]=u}}return u}return i.$id=o,i}const de=ye("loader",()=>{const e=t.ref({translation:!1,aiExplanation:!1});return{loadingStates:e,setLoading:(o,a)=>{e.value[o]=a},isLoading:o=>e.value[o]}}),yt={__name:"Select",props:t.mergeModels({languages:{type:Object,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=de(),n=e,o=t.useModel(e,"modelValue"),a=t.ref(""),r=t.ref(null),i=t.computed(()=>Object.entries(n.languages).filter(([,c])=>c.toLowerCase().includes(a.value.toLowerCase()))),s=c=>{c.target.value="",a.value="",r.value&&r.value.$el.click()};return(c,d)=>(t.openBlock(),t.createBlock(t.unref(Gn),{modelValue:o.value,"onUpdate:modelValue":d[3]||(d[3]=u=>o.value=u),disabled:t.unref(l).loading,as:"div",class:"relative mt-1"},{default:t.withCtx(()=>[t.createVNode(t.unref(Jn),{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=>s(u))},null,8,["displayValue"]),t.createVNode(t.unref(qn),{ref_key:"btnSelect",ref:r,class:"absolute inset-y-0 right-0 flex items-center pr-2"},{default:t.withCtx(()=>[t.createVNode(t.unref(Xn),{class:"h-5 w-5 text-gray-400","aria-hidden":"true",onClick:d[2]||(d[2]=u=>s(u))})]),_:1},512),t.createVNode(t.unref(Kn),{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,m])=>(t.openBlock(),t.createBlock(t.unref(Yn),{key:u,value:u},{default:t.withCtx(({active:b,selected:y})=>[t.createElementVNode("li",{class:t.normalizeClass(["relative cursor-default select-none py-2 pl-3 pr-9",b?"bg-[#3B5695] text-white":"text-textCustom"])},[t.createElementVNode("span",{class:t.normalizeClass(["block truncate",y&&"font-semibold"])},t.toDisplayString(m),3)],2)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue","disabled"]))}},wt="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",To=["disabled"],Io=[t.createElementVNode("img",{src:wt,alt:"swap",class:"w-4"},null,-1)],Bo=["disabled"],Lo=[t.createElementVNode("img",{src:wt,alt:"swap",class:"w-4"},null,-1)],No={__name:"SwapBtn",props:{isBidirect:{type:Boolean,default:!1}},emits:["swap"],setup(e,{emit:l}){const n=de(),o=t.computed(()=>n.isLoading("translation")),a=l;return(r,i)=>e.isBidirect?(t.openBlock(),t.createElementBlock("button",{key:1,onClick:i[0]||(i[0]=s=>a("swap")),disabled:o.value},Lo,8,Bo)):(t.openBlock(),t.createElementBlock("button",{key:0,disabled:o.value},Io,8,To))}},we=ye("language",()=>{const e=t.ref("auto"),l=t.ref("vi"),n=t.ref({src:[],target:[]}),o=t.computed(()=>n.value.src[e.value]),a=t.computed(()=>n.value.target[l.value]);function r(c,d){e.value=c==null?void 0:c.src,l.value=c==null?void 0:c.target,n.value=d}function i(){if(!n.value.src[l.value]||!n.value.target[e.value])return;const c=e.value;e.value=l.value,l.value=c}function s(c){return n.value.src[c]||n.value.target[c]}return{languages:n,src:e,target:l,srcLabel:o,targetLabel:a,init:r,swap:i,getLabel:s}}),Mo={key:0,class:"flex flex-col"},Ro={class:"flex"},Fo={class:"grow flex flex-col"},Ao={class:"grow flex flex-col"},Po={class:"flex"},Do={class:"grow flex flex-col"},jo={key:0,class:"flex mt-1 space-x-1"},Ho=["onClick"],zo={class:"grow flex flex-col"},Uo={key:0,class:"flex mt-1 space-x-1 justify-end"},Zo=["onClick"],Et=3,Wo={__name:"Selects",setup(e){const l=we(),n=t.ref([]),o=t.ref([]);function a(){l.swap()}return t.onMounted(()=>{n.value=ue.getLocalStorage("recentSrc")||[],o.value=ue.getLocalStorage("recentTarget")||[]}),t.watch(()=>l.src,r=>{n.value.includes(r)||(n.value.unshift(r),n.value=n.value.slice(0,Et),ue.setLocalStorage("recentSrc",n.value))}),t.watch(()=>l.target,r=>{o.value.includes(r)||(o.value.unshift(r),o.value=o.value.slice(0,Et),ue.setLocalStorage("recentTarget",o.value))}),(r,i)=>t.unref(l).languages?(t.openBlock(),t.createElementBlock("div",Mo,[t.createElementVNode("div",Ro,[t.createElementVNode("div",Fo,[t.createVNode(yt,{modelValue:t.unref(l).src,"onUpdate:modelValue":i[0]||(i[0]=s=>t.unref(l).src=s),languages:t.unref(l).languages.src,class:"grow"},null,8,["modelValue","languages"])]),t.createVNode(No,{isBidirect:t.unref(l).src!=="auto",class:"grow-0 mx-3 mt-4 self-start",onSwap:a},null,8,["isBidirect"]),t.createElementVNode("div",Ao,[t.createVNode(yt,{modelValue:t.unref(l).target,"onUpdate:modelValue":i[1]||(i[1]=s=>t.unref(l).target=s),languages:t.unref(l).languages.target,class:"grow"},null,8,["modelValue","languages"])])]),t.createElementVNode("div",Po,[t.createElementVNode("div",Do,[n.value.length>0?(t.openBlock(),t.createElementBlock("div",jo,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,s=>(t.openBlock(),t.createElementBlock("button",{key:s,class:"px-2 py-0.5 bg-baseColor border border-primaryColor text-primaryColor text-xs rounded-full hover:bg-primaryColor hover:text-baseColor transition-colors duration-200",onClick:c=>t.unref(l).src=s},t.toDisplayString(t.unref(l).languages.src[s]),9,Ho))),128))])):t.createCommentVNode("",!0)]),t.createElementVNode("div",zo,[o.value.length>0?(t.openBlock(),t.createElementBlock("div",Uo,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.value,s=>(t.openBlock(),t.createElementBlock("button",{key:s,class:"px-2 py-0.5 bg-baseColor border border-primaryColor text-primaryColor text-xs rounded-full hover:bg-primaryColor hover:text-baseColor transition-colors duration-200",onClick:c=>t.unref(l).target=s},t.toDisplayString(t.unref(l).languages.target[s]),9,Zo))),128))])):t.createCommentVNode("",!0)])])])):t.createCommentVNode("",!0)}},Go={INPUT_MAX_LENGTH:5e3,INPUT_DEBOUNCE:500},Ee=(e,l)=>{const n=e.__vccOpts||e;for(const[o,a]of l)n[o]=a;return n},qo={},Jo={class:"mr-2 loading loading-dots loading-xs"};function Ko(e,l){return t.openBlock(),t.createElementBlock("span",Jo)}const _t=Ee(qo,[["render",Ko]]),St=ye("tts",()=>{const e=t.ref({src:null,target:null});function l(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 o(){e.value={src:null,target:null}}return{tts:e,set:l,get:n,reset:o}}),Yo="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",Qo="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",Xo=["disabled"],e2=["src"],t2=["src"],n2={__name:"SpeakBtn",props:{type:{type:String,default:""},disabled:Boolean},emits:["loadTTS"],setup(e,{emit:l}){const n=St(),o=e,a=l,r=t.computed(()=>n.tts[o.type]),i=t.ref(!1),s=new Audio;t.watch(r,()=>{if(!r.value){i.value=!1;return}d()},{immediate:!0}),t.onUnmounted(()=>{u(),s.src=""});function c(){if(r.value){d();return}i.value=!0,a("loadTTS")}function d(){r.value&&(s.src=r.value,i.value=!0,s.play().catch(()=>{i.value=!1}))}function u(){s.pause(),s.currentTime=0,i.value=!1}return s.onended=()=>{i.value=!1},(m,b)=>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(Qo),alt:"Stop",class:"w-4 transition-all duration-200"},null,8,t2)])):(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(Yo),alt:"Play",class:t.normalizeClass(["w-4 transition-all duration-200",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,e2)],10,Xo))}},o2="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",l2={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"},a2=["disabled"],s2=["src"],r2={__name:"ClearBtn",props:{disabled:Boolean},setup(e){return(l,n)=>(t.openBlock(),t.createElementBlock("div",l2,[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(o2),alt:"Clear",class:t.normalizeClass(["w-4 transition-all duration-200",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,s2)],10,a2)]))}},i2="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",c2="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",d2={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"},u2=["disabled"],f2=["src"],p2={__name:"FavoriteBtn",props:{disabled:Boolean,isFilled:Boolean},setup(e){return(l,n)=>(t.openBlock(),t.createElementBlock("div",d2,[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(i2):t.unref(c2),alt:"Favorite",class:t.normalizeClass(["w-4 transition-all duration-200",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,f2)],10,u2)]))}},m2="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",h2="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",g2={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"},b2=["disabled"],C2=["src"],kt={__name:"AIBtn",props:{disabled:Boolean,isFilled:Boolean},setup(e){return(l,n)=>(t.openBlock(),t.createElementBlock("div",g2,[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(m2):t.unref(h2),alt:"AI",class:t.normalizeClass(["w-4 transition-all duration-200",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,C2)],10,b2)]))}},x2="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='%231A1F2A'/%3e%3c/svg%3e",v2=["data-tip"],y2=["disabled"],w2=["src"],E2={__name:"CopyBtn",props:{disabled:Boolean},setup(e){const l=t.ref("Copy"),n=()=>{l.value="Copied",setTimeout(()=>{l.value="Copy"},1e3)};return(o,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":l.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(x2),alt:"Copy",class:t.normalizeClass(["w-3 transition-all duration-200",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,w2)],10,y2)],8,v2))}},_2={class:"flex flex-row px-2 pr-10 pt-1 items-center bg-transparent relative"},S2={class:"ml-1 text-sm text-gray-600"},k2={key:0,class:"italic"},V2={class:"absolute right-1 top-1 flex flex-col items-center gap-0"},Vt=Ee({__name:"TranslationBtnGroup",props:{loading:{type:Boolean,default:!1},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},hasDictionary:{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:l}){const n=e,o=l;return(a,r)=>(t.openBlock(),t.createElementBlock("div",_2,[n.src?(t.openBlock(),t.createBlock(n2,{key:0,type:n.type,onLoadTTS:r[0]||(r[0]=i=>o("loadTTS"))},null,8,["type"])):t.createCommentVNode("",!0),t.createElementVNode("div",S2,[t.createTextVNode(t.toDisplayString(e.srcLabel)+" ",1),e.phonetic?(t.openBlock(),t.createElementBlock("span",k2,"- ["+t.toDisplayString(n.phonetic)+"]",1)):t.createCommentVNode("",!0)]),n.loading?(t.openBlock(),t.createBlock(_t,{key:1,class:"absolute right-6 top-2"})):t.createCommentVNode("",!0),t.createElementVNode("div",V2,[e.hasClearBtn&&e.src?(t.openBlock(),t.createBlock(r2,{key:0,onClick:r[1]||(r[1]=i=>o("clear")),disabled:e.loading},null,8,["disabled"])):t.createCommentVNode("",!0),e.src&&!e.hasDictionary&&e.hasAIBtn?(t.openBlock(),t.createBlock(kt,{key:1,isFilled:e.isAITranslate,onClick:r[2]||(r[2]=i=>o("aiTranslate")),disabled:e.loading},null,8,["isFilled","disabled"])):t.createCommentVNode("",!0),e.src&&e.hasFavoriteBtn?(t.openBlock(),t.createBlock(p2,{key:2,isFilled:e.isFavorite,onClick:r[3]||(r[3]=i=>o("favorite")),disabled:e.loading},null,8,["isFilled","disabled"])):t.createCommentVNode("",!0),e.src&&e.hasCopyBtn?(t.openBlock(),t.createBlock(E2,{key:3,onClick:r[4]||(r[4]=i=>o("copy")),disabled:e.loading},null,8,["disabled"])):t.createCommentVNode("",!0)])]))}},[["__scopeId","data-v-c9ef8858"]]),X=ye("translation",()=>{const e=t.ref(null),l=t.ref(null),n=t.ref(null),o=t.ref({src:null,target:null}),a=t.ref(null),r=t.ref([]),i=t.ref([]),s=t.ref([]),c=t.ref([]),d=t.ref({src:null,target:null}),u=we(),m=t.computed(()=>u.getLabel(e.value)),b=t.computed(()=>u.getLabel(l.value));function y(w){e.value=w.src,l.value=w.target,n.value=w.text,o.value=w.phonetic,a.value=w.result,r.value=w.dictionary,i.value=w.definitions,s.value=w.synonyms,c.value=w.examples,d.value=w.tts}function g(){e.value=null,l.value=null,n.value=null,o.value={src:null,target:null},a.value=null,r.value=[],i.value=[],s.value=[],c.value=[],d.value={src:null,target:null}}return{src:e,srcLabel:m,target:l,targetLabel:b,phonetic:o,text:n,result:a,dictionary:r,definitions:i,synonyms:s,examples:c,tts:d,init:y,reset:g}});function O2(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}function _e(e){return typeof e=="function"?e():t.unref(e)}const $2=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ot=()=>{};function T2(e,l){function n(...o){return new Promise((a,r)=>{Promise.resolve(e(()=>l.apply(this,o),{fn:l,thisArg:this,args:o})).then(a).catch(r)})}return n}function I2(e,l={}){let n,o,a=Ot;const r=s=>{clearTimeout(s),a(),a=Ot};return s=>{const c=_e(e),d=_e(l.maxWait);return n&&r(n),c<=0||d!==void 0&&d<=0?(o&&(r(o),o=null),Promise.resolve(s())):new Promise((u,m)=>{a=l.rejectOnCancel?m:u,d&&!o&&(o=setTimeout(()=>{n&&r(n),o=null,u(s())},d)),n=setTimeout(()=>{o&&r(o),o=null,u(s())},c)})}}function B2(e,l=200,n={}){return T2(I2(l,n),e)}function $t(e){var l;const n=_e(e);return(l=n==null?void 0:n.$el)!=null?l:n}const L2=$2?window:void 0;function N2(){const e=t.ref(!1),l=t.getCurrentInstance();return l&&t.onMounted(()=>{e.value=!0},l),e}function M2(e){const l=N2();return t.computed(()=>(l.value,!!e()))}function R2(e,l,n={}){const{window:o=L2,...a}=n;let r;const i=M2(()=>o&&"ResizeObserver"in o),s=()=>{r&&(r.disconnect(),r=void 0)},c=t.computed(()=>Array.isArray(e)?e.map(m=>$t(m)):[$t(e)]),d=t.watch(c,m=>{if(s(),i.value&&o){r=new ResizeObserver(l);for(const b of m)b&&r.observe(b,a)}},{immediate:!0,flush:"post"}),u=()=>{s(),d()};return O2(u),{isSupported:i,stop:u}}function Tt(e){var l;const n=t.ref(e==null?void 0:e.element),o=t.ref(e==null?void 0:e.input),a=(l=e==null?void 0:e.styleProp)!=null?l:"height",r=t.ref(1);function i(){var s;if(!n.value)return;let c="";n.value.style[a]="1px",r.value=(s=n.value)==null?void 0:s.scrollHeight,e!=null&&e.styleTarget?_e(e.styleTarget).style[a]=`${r.value}px`:c=`${r.value}px`,n.value.style[a]=c}return t.watch([o,n],()=>t.nextTick(i),{immediate:!0}),t.watch(r,()=>{var s;return(s=e==null?void 0:e.onResize)==null?void 0:s.call(e)}),R2(n,()=>i()),e!=null&&e.watch&&t.watch(e.watch,i,{immediate:!0,deep:!0}),{textarea:n,input:o,triggerResize:i}}const F2={class:"bg-white relative z-10 border rounded-md"},A2=Ee({__name:"TranslationInput",props:{text:{type:String,default:""}},emits:["change","clear","loadTTS"],setup(e,{emit:l}){const n=X(),o=e,a=t.ref(""),r=t.computed(()=>n.src),i=t.computed(()=>n.srcLabel),s=t.computed(()=>{var g;return(g=n.phonetic)==null?void 0:g.src}),{textarea:c}=Tt({input:a,styleProp:"minHeight"}),d=l,u=B2(()=>{d("change",a.value)},Go.INPUT_DEBOUNCE);function m(){if(!a.value){b();return}u()}function b(){d("clear"),a.value="",c.value.focus()}async function y(){await t.nextTick(),c.value.select()}return t.watch(()=>o.text,g=>{a.value!==g&&y(),a.value=g}),(g,w)=>(t.openBlock(),t.createElementBlock("div",F2,[t.createVNode(Vt,{src:r.value,srcLabel:i.value,type:"src",phonetic:s.value,hasClearBtn:!0,onClear:b,onLoadTTS:w[0]||(w[0]=I=>d("loadTTS")),class:"mb-2"},null,8,["src","srcLabel","phonetic"]),t.withDirectives(t.createElementVNode("textarea",{ref_key:"textarea",ref:c,"onUpdate:modelValue":w[1]||(w[1]=I=>a.value=I),class:"w-full outline-none px-5 pr-8 bg-transparent text-gray-800 resize-none pb-3 overflow-x-hidden overflow-y-hidden",autofocus:"",rows:"2",onInput:m,onFocus:y},null,544),[[t.vModelText,a.value,void 0,{trim:!0}]])]))}},[["__scopeId","data-v-3d7638d0"]]),P2=e=>(t.pushScopeId("data-v-7c33874e"),e=e(),t.popScopeId(),e),D2={class:"bg-white relative z-10 rounded-md h-full"},j2={class:"bg-transparent"},H2={key:0,class:"w-full flex items-center justify-end absolute -bottom-8 left-2 right-0 px-2 z-20"},z2=P2(()=>t.createElementVNode("span",{class:"text-sm text-gray-600"}," Powered by Ddict AI ",-1)),U2=Ee({__name:"TranslationResult",props:{isFavoriteFeatureEnabled:Boolean,isAITranslateFeatureEnabled:Boolean,isAITranslate:Boolean,isFavorite:Boolean},emits:["loadTTS","favorite","aiTranslate","copy"],setup(e,{emit:l}){const n=X(),o=t.computed(()=>n.result),a=t.computed(()=>n.target),r=t.computed(()=>n.targetLabel),i=t.computed(()=>{var y;return(y=n.phonetic)==null?void 0:y.target}),s=t.computed(()=>{var y;return!!((y=n.dictionary)!=null&&y.length)}),c=de(),d=t.computed(()=>c.isLoading("translation")),{textarea:u,input:m}=Tt({input:o,styleProp:"minHeight"}),b=l;return(y,g)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["relative p-0.5 transition-all duration-300 ease-in-out bg-[length:300%_300%] bg-[position:0%_50%] border rounded-lg",{"bg-gradient-to-br from-[#8556f0] via-[#d6b379] via-[#6bedd1] to-[#439beb] animate-moveGradient border border-white":e.isAITranslate&&!d.value}])},[t.createElementVNode("div",D2,[t.createVNode(Vt,{loading:d.value,src:a.value,srcLabel:r.value,type:"target",hasFavoriteBtn:e.isFavoriteFeatureEnabled,hasAIBtn:e.isAITranslateFeatureEnabled,hasCopyBtn:!0,isFavorite:e.isFavorite,isAITranslate:e.isAITranslate,hasDictionary:s.value,phonetic:i.value,onFavorite:g[0]||(g[0]=w=>b("favorite")),onLoadTTS:g[1]||(g[1]=w=>b("loadTTS")),onAiTranslate:g[2]||(g[2]=w=>b("aiTranslate")),onCopy:g[3]||(g[3]=w=>b("copy")),class:"mb-2"},null,8,["loading","src","srcLabel","hasFavoriteBtn","hasAIBtn","isFavorite","isAITranslate","hasDictionary","phonetic"]),t.createElementVNode("div",j2,[t.withDirectives(t.createElementVNode("textarea",{ref_key:"textarea",ref:u,"onUpdate:modelValue":g[4]||(g[4]=w=>t.isRef(m)?m.value=w:null),class:"w-full outline-none px-5 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(m)]])])]),e.isAITranslate?(t.openBlock(),t.createElementBlock("div",H2,[z2,t.createVNode(kt,{disabled:"",isFilled:""})])):t.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-7c33874e"]]),Z2={class:"btn btn-sm btn-circle btn-ghost"},Se={__name:"ToggleBtn",props:{isExpanded:Boolean},setup(e){const l=e;return(n,o)=>(t.openBlock(),t.createElementBlock("button",Z2,[l.isExpanded?(t.openBlock(),t.createBlock(t.unref(eo),{key:0,class:"w-7 text-gray-400"})):(t.openBlock(),t.createBlock(t.unref(Qn),{key:1,class:"w-7 text-gray-400"}))]))}},W2={class:"card border bg-white rounded-lg"},G2={class:"card-body px-4 py-2 gap-0"},q2={class:"flex justify-between items-center"},J2=t.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Translations",-1),K2={class:"capitalize text-base font-normal text-textSecondary mb-1"},Y2={class:"list-none list-inside"},Q2=["onClick"],X2={class:"text-base font-normal text-gray-800 leading-4"},e0={__name:"Dictionary",emits:["translate"],setup(e,{emit:l}){const n=t.ref(!0),o=X(),a=we(),r=t.computed(()=>o.dictionary),i=l,s=()=>{n.value=!n.value},c=d=>{i("translate",d,o.target,o.src),a.src=o.target,a.target=o.src,window.scrollTo(0,0)};return(d,u)=>(t.openBlock(),t.createElementBlock("div",W2,[t.createElementVNode("div",G2,[t.createElementVNode("div",q2,[J2,t.createVNode(Se,{isExpanded:n.value,onClick:s},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",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(r.value,(m,b)=>(t.openBlock(),t.createElementBlock("li",{key:`${m.pos}-${b}`,class:"mb-2"},[t.createElementVNode("h5",K2,t.toDisplayString(m.pos),1),t.createElementVNode("ul",Y2,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.items,(y,g)=>(t.openBlock(),t.createElementBlock("li",{key:`${y.word}-${g}`},[t.createElementVNode("span",{class:"p-3 m-0.5 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded-lg",onClick:w=>c(y.word)},t.toDisplayString(y.word),9,Q2),t.createElementVNode("small",X2," - "+t.toDisplayString(y.reverse_translation.join(", ")),1)]))),128))])]))),128))])],2)])]))}},t0={class:"card border bg-white rounded-lg"},n0={class:"card-body px-4 py-2 gap-0"},o0={class:"flex justify-between items-center"},l0=t.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Definitions",-1),a0={class:"capitalize text-base font-normal text-textSecondary mb-1"},s0={class:"text-base text-textCustom list-decimal list-outside ml-5"},r0=t.createElementVNode("br",null,null,-1),i0={key:0,class:"italic"},c0={__name:"Definition",setup(e){const l=t.ref(!0),n=X(),o=t.computed(()=>n.definitions),a=()=>{l.value=!l.value};return(r,i)=>(t.openBlock(),t.createElementBlock("div",t0,[t.createElementVNode("div",n0,[t.createElementVNode("div",o0,[l0,t.createVNode(Se,{isExpanded:l.value,onClick:a},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",l.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(o.value,(s,c)=>(t.openBlock(),t.createElementBlock("li",{key:`${s.pos}-${c}`,class:"mb-2"},[t.createElementVNode("h5",a0,t.toDisplayString(s.pos),1),t.createElementVNode("ul",s0,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.items,(d,u)=>(t.openBlock(),t.createElementBlock("li",{key:`${d.gloss}-${u}`,class:"mb-1"},[t.createElementVNode("span",null,t.toDisplayString(d.gloss),1),r0,d.example?(t.openBlock(),t.createElementBlock("small",i0,'"'+t.toDisplayString(d.example)+'"',1)):t.createCommentVNode("",!0)]))),128))])]))),128))])],2)])]))}},d0={class:"card border bg-white rounded-lg"},u0={class:"card-body px-4 py-2 gap-0"},f0={class:"flex justify-between items-center"},p0=t.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Examples",-1),m0={class:"text-textCustom list-decimal list-outside ml-7 my-2"},h0=["innerHTML"],g0={__name:"Example",setup(e){const l=t.ref(!0),n=X(),o=t.computed(()=>n.examples),a=()=>{l.value=!l.value};return(r,i)=>(t.openBlock(),t.createElementBlock("div",d0,[t.createElementVNode("div",u0,[t.createElementVNode("div",f0,[p0,t.createVNode(Se,{isExpanded:l.value,onClick:a},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",l.value?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"])},[t.createElementVNode("ul",m0,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.value,(s,c)=>(t.openBlock(),t.createElementBlock("li",{key:`${s.definition_id}-${c}`,innerHTML:s},null,8,h0))),128))])],2)])]))}},b0={class:"card border bg-white rounded-lg"},C0={class:"card-body px-4 py-2 gap-0"},x0={class:"flex justify-between items-center"},v0=t.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Synonyms",-1),y0={class:"capitalize text-base font-normal text-textSecondary mb-1"},w0={class:"list-none list-inside"},E0={class:"flex flex-wrap"},_0=["onClick"],S0={__name:"Synonyms",emits:["translate"],setup(e,{emit:l}){const n=t.ref(!0),o=X(),a=t.computed(()=>o.synonyms),r=l,i=()=>{n.value=!n.value},s=c=>{r("translate",c),window.scrollTo(0,0)};return(c,d)=>(t.openBlock(),t.createElementBlock("div",b0,[t.createElementVNode("div",C0,[t.createElementVNode("div",x0,[v0,t.createVNode(Se,{isExpanded:n.value,onClick:i},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",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,m)=>(t.openBlock(),t.createElementBlock("li",{key:`${u.pos}-${m}`,class:"mb-2"},[t.createElementVNode("h5",y0,t.toDisplayString(u.pos),1),t.createElementVNode("ul",w0,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.items,(b,y)=>(t.openBlock(),t.createElementBlock("li",{key:`${b.word}-${y}`,class:"mb-2"},[t.createElementVNode("div",E0,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(b.synonym,(g,w)=>(t.openBlock(),t.createElementBlock("span",{key:`${g}-${w}`,class:"p-3 m-0.5 ml-0 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded-lg",onClick:I=>s(g)},t.toDisplayString(g),9,_0))),128))])]))),128))])]))),128))])],2)])]))}},k0="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",V0="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",O0=["disabled"],$0=["src"],T0={__name:"ChevronAIBtn",props:{disabled:Boolean,isExpanded:Boolean},setup(e){return(l,n)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["btn btn-sm 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(k0):t.unref(V0),alt:"AI",class:t.normalizeClass(["w-6 transition-all duration-200",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]])},null,10,$0)],10,O0))}},I0={class:"card-body bg-white px-4 py-2 gap-0 relative z-10 rounded-md"},B0={class:"flex justify-between items-center"},L0=t.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"AI Summary",-1),N0={class:"flex items-center"},M0={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":"AI Summarize"},R0={key:0,class:"text-textCustom list-none list-outside my-2"},F0=["innerHTML"],A0={__name:"AIExplanation",props:{isAIExplain:{type:Boolean,default:!1,required:!0},explanation:{type:Object,required:!0}},emits:["aiExplain"],setup(e,{emit:l}){const n=de(),o=t.computed(()=>n.isLoading("aiExplanation")),a=l,r=()=>{a("aiExplain")};return(i,s)=>{var c,d;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["card border bg-white rounded-lg mb-8",["relative p-0.5 transition-all duration-300 ease-in-out bg-[length:300%_300%] bg-[position:0%_50%] border rounded-lg",{"bg-gradient-to-br from-[#8556f0] via-[#d6b379] via-[#6bedd1] to-[#439beb] animate-moveGradient border border-white":e.isAIExplain}]])},[t.createElementVNode("div",I0,[t.createElementVNode("div",B0,[L0,t.createElementVNode("div",N0,[o.value?(t.openBlock(),t.createBlock(_t,{key:0})):t.createCommentVNode("",!0),t.createElementVNode("div",M0,[t.createVNode(T0,{isExpanded:e.isAIExplain,disabled:o.value,onClick:r},null,8,["isExpanded","disabled"])])])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",e.isAIExplain?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"])},[(c=e.explanation)!=null&&c.result?(t.openBlock(),t.createElementBlock("ul",R0,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(((d=e.explanation)==null?void 0:d.result.split(`
|
|
18
|
+
`))||[],(u,m)=>(t.openBlock(),t.createElementBlock("li",{key:`${u}-${m}`,innerHTML:u},null,8,F0))),128))])):t.createCommentVNode("",!0)],2)])],2)}}};function P0(){document.documentElement.setAttribute("dir","rtl")}function D0(){document.documentElement.removeAttribute("dir")}const It={supportRTL:P0,removeRTL:D0},j0=["ar","fa","iw","yi","ur","pa"],H0={class:"bg-white min-h-screen flex flex-col"},z0={class:"py-2 px-5 shadow-lg"},U0={class:"px-5 flex-grow"},Z0={class:"flex flex-col lg:flex-row lg:gap-2 mb-6"},W0={class:"w-full lg:w-[calc(50%-1rem)] my-2 flex"},G0=t.createElementVNode("div",{class:"w-6 h-4 mx-auto hidden lg:block"},null,-1),q0={class:"w-full lg:w-[calc(50%-1rem)] my-2 flex"},J0={key:0,class:"w-full my-4"},K0={class:"grid grid-cols-1 lg:grid-cols-3 gap-4"},Y0={key:1,class:"w-full my-4"},Q0={key:1,class:"text-textCustom italic font-medium"},X0={__name:"Popup",props:{opt:{type:Object,default:null},languages:{type:Object,default:null},translation:{type:Object,default:null},explanation:{type:Object,default:null},tts:{type:Object,default:null},isFavoriteFeatureEnabled:{type:Boolean,default:!1},isAITranslateFeatureEnabled:{type:Boolean,default:!1},isFavorite:{type:Boolean,default:!1},isAITranslate:{type:Boolean,default:!1},isAIExplain:{type:Boolean,default:!1},aiExplainMinLength:{type:Number,default:0}},emits:["opt","translate","reader","settings","fullscreen","starList","loadTTS","favorite","aiTranslate","aiExplain","copy"],setup(e,{emit:l}){const n=ko(),o=X(n),a=St(n),r=we(n),i=de(n),s=e,c=l,d=t.ref(""),u=()=>{const _=s.opt.target;j0.includes(_)?It.supportRTL():It.removeRTL()};t.watch(()=>s.translation,_=>{i.setLoading("translation",!1),_&&(d.value=_.text,o.init(_),a.reset())},{immediate:!0}),t.watch([()=>s.explanation,()=>s.isAIExplain],([_])=>{_!=null&&_.result&&i.setLoading("aiExplanation",!1)},{immediate:!0,deep:!0}),t.watch(()=>s.tts,_=>{if(!_){a.reset();return}a.set(_)},{immediate:!0}),t.watch([()=>s.opt,()=>s.languages],([_,x])=>{r.init(_,x),u()}),t.watch([()=>r.src,()=>r.target],([_,x])=>{c("opt",{src:_,target:x}),g(d.value)}),t.onMounted(()=>{r.init(s.opt,s.languages),u()});function m(){d.value="",s.isAITranslate&&w(),o.reset()}function b(_){g(_)}function y(_){const x=_==="src"?o.text:o.result;c("loadTTS",{type:_,data:x})}function g(_,x=r.src,$=r.target){_&&(d.value=_,i.setLoading("translation",!0),c("translate",{src:x,target:$,text:_}))}function w(){s.isAITranslate||i.setLoading("translation",!0),c("aiTranslate")}function I(){s.isAIExplain||i.setLoading("aiExplanation",!0),c("aiExplain")}return(_,x)=>{var $,B,v,k,C;return t.openBlock(),t.createElementBlock("div",H0,[t.createElementVNode("div",z0,[t.createVNode(qt,{onReader:x[0]||(x[0]=h=>c("reader")),onSettings:x[1]||(x[1]=h=>c("settings")),onFullScreen:x[2]||(x[2]=h=>c("fullscreen")),onStarList:x[3]||(x[3]=h=>c("starList"))})]),t.createElementVNode("div",U0,[t.createVNode(Wo,{class:"mt-3 mb-0"}),t.createElementVNode("div",Z0,[t.createElementVNode("div",W0,[t.createVNode(A2,{text:d.value,onChange:b,onClear:m,onLoadTTS:x[4]||(x[4]=h=>y("src")),class:"flex-grow flex flex-col"},null,8,["text"])]),G0,t.createElementVNode("div",q0,[t.createVNode(U2,{isFavoriteFeatureEnabled:e.isFavoriteFeatureEnabled,isAITranslateFeatureEnabled:e.isAITranslateFeatureEnabled,isAITranslate:e.isAITranslate,isFavorite:e.isFavorite,onCopy:x[5]||(x[5]=h=>c("copy")),onAiTranslate:w,onFavorite:x[6]||(x[6]=h=>c("favorite")),onLoadTTS:x[7]||(x[7]=h=>y("target")),class:"flex-grow flex flex-col"},null,8,["isFavoriteFeatureEnabled","isAITranslateFeatureEnabled","isAITranslate","isFavorite"])])]),s.translation?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[(($=t.unref(o).result)==null?void 0:$.length)>e.aiExplainMinLength?(t.openBlock(),t.createElementBlock("div",J0,[t.createVNode(A0,{isAIExplain:e.isAIExplain,explanation:e.explanation,onAiExplain:I},null,8,["isAIExplain","explanation"])])):t.createCommentVNode("",!0),t.createElementVNode("div",K0,[(B=t.unref(o).dictionary)!=null&&B.length?(t.openBlock(),t.createBlock(e0,{key:0,onTranslate:g})):t.createCommentVNode("",!0),(v=t.unref(o).definitions)!=null&&v.length?(t.openBlock(),t.createBlock(c0,{key:1})):t.createCommentVNode("",!0),(k=t.unref(o).synonyms)!=null&&k.length?(t.openBlock(),t.createBlock(S0,{key:2,onTranslate:g})):t.createCommentVNode("",!0)]),(C=t.unref(o).examples)!=null&&C.length?(t.openBlock(),t.createElementBlock("div",Y0,[t.createVNode(g0)])):t.createCommentVNode("",!0)],64)):(t.openBlock(),t.createElementBlock("span",Q0,"Service unavailable"))])])}}};G.default=X0,Object.defineProperties(G,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|